From 925b65b7d0f6538d8ec410d9b1c285a178057bf1 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Thu, 9 Aug 2018 17:41:07 -0700 Subject: Update message.mk (#3602) Fixed typo --- message.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/message.mk b/message.mk index 1401698ddc..30fd0b9db7 100644 --- a/message.mk +++ b/message.mk @@ -55,7 +55,7 @@ MSG_ASSEMBLING = Assembling: MSG_CLEANING = Cleaning project: MSG_CREATING_LIBRARY = Creating library: MSG_SUBMODULE_DIRTY = $(WARN_COLOR)WARNING:$(NO_COLOR)\n \ - Some git sub-modules are out of date or modified, please consider runnning:$(BOLD)\n\ + Some git sub-modules are out of date or modified, please consider running:$(BOLD)\n\ make git-submodule\n\ You can ignore this warning if you are not compiling any ChibiOS keyboards,\n\ or if you have modified the ChibiOS libraries yourself. \n\n$(NO_COLOR) -- cgit v1.2.3 From 435e9b7bdb89043b3ce8b0cfc9b0f3ee4d298166 Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 10 Aug 2018 03:41:48 +0300 Subject: RGB Driver Documentation Update (#3601) - Minor formating in rgb matrix page - Added a short discription for is31fl3731 in drivers page --- docs/feature_rgb_matrix.md | 6 +++--- docs/hardware_drivers.md | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index cb7aa666cf..ed33c7ea4e 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -80,7 +80,7 @@ All RGB keycodes are currently shared with the RGBLIGHT system: These are the effects that are currently available: enum rgb_matrix_effects { - RGB_MATRIX_SOLID_COLOR = 1, + RGB_MATRIX_SOLID_COLOR = 1, RGB_MATRIX_ALPHAS_MODS, RGB_MATRIX_DUAL_BEACON, RGB_MATRIX_GRADIENT_UP_DOWN, @@ -93,7 +93,7 @@ These are the effects that are currently available: RGB_MATRIX_RAINBOW_MOVING_CHEVRON, RGB_MATRIX_JELLYBEAN_RAINDROPS, #ifdef RGB_MATRIX_KEYPRESSES - RGB_MATRIX_SOLID_REACTIVE, + RGB_MATRIX_SOLID_REACTIVE, RGB_MATRIX_SPLASH, RGB_MATRIX_MULTISPLASH, RGB_MATRIX_SOLID_SPLASH, @@ -107,7 +107,7 @@ These are the effects that are currently available: Custom layer effects can be done by defining this in your `.c`: void rgb_matrix_indicators_kb(void) { - // rgb_matrix_set_color(index, red, green, blue); + rgb_matrix_set_color(index, red, green, blue); } A similar function works in the keymap as `rgb_matrix_indicators_user`. diff --git a/docs/hardware_drivers.md b/docs/hardware_drivers.md index 46e6a71015..336bc908ef 100644 --- a/docs/hardware_drivers.md +++ b/docs/hardware_drivers.md @@ -25,3 +25,7 @@ You can make use of uGFX within QMK to drive character and graphic LCD's, LED ar ## WS2812 (AVR Only) Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page. + +## IS31FL3731 (AVR Only) + +Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to individually address LEDs using I2C. This allows up to 144 same color LEDs or 32 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. -- cgit v1.2.3 From ccfe60eb57b6cb11c5c9914445cceae77c09c0da Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 9 Aug 2018 17:45:43 -0700 Subject: Update ps2avrgb readme (#3599) * give ps2avrgb a specific readme * add homebrew and crosspack avr step * update readme of all ps2avrgb boards to reflect the new template --- keyboards/bfake/readme.md | 32 ++++++++++++++++++++++++++- keyboards/bmini/readme.md | 32 ++++++++++++++++++++++++++- keyboards/canoe/readme.md | 30 +++++++++++++++++++++++++ keyboards/facew/readme.md | 31 +++++++++++++++++++++++++- keyboards/singa/readme.md | 30 +++++++++++++++++++++++++ quantum/template/avr/readme.md | 15 +++++++++++++ quantum/template/base/readme.md | 15 ------------- quantum/template/ps2avrgb/readme.md | 44 +++++++++++++++++++++++++++++++++++++ 8 files changed, 211 insertions(+), 18 deletions(-) create mode 100644 quantum/template/avr/readme.md delete mode 100644 quantum/template/base/readme.md create mode 100644 quantum/template/ps2avrgb/readme.md diff --git a/keyboards/bfake/readme.md b/keyboards/bfake/readme.md index 47db914985..ca12b49962 100644 --- a/keyboards/bfake/readme.md +++ b/keyboards/bfake/readme.md @@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment): make bfake:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/bmini/readme.md b/keyboards/bmini/readme.md index 01017e175c..38dc493075 100644 --- a/keyboards/bmini/readme.md +++ b/keyboards/bmini/readme.md @@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment): make bmini:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/canoe/readme.md b/keyboards/canoe/readme.md index 4a83efd82a..f58ffe4fd6 100644 --- a/keyboards/canoe/readme.md +++ b/keyboards/canoe/readme.md @@ -11,4 +11,34 @@ Make example for this keyboard (after setting up your build environment): make canoe:default +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/facew/readme.md b/keyboards/facew/readme.md index 727c04d931..f948e7a46f 100644 --- a/keyboards/facew/readme.md +++ b/keyboards/facew/readme.md @@ -15,10 +15,39 @@ Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_ - The FaceW Sprit Edition can be purchased on [mechanicalkeyboards.com](www.mechanicalkeyboards.com) - Uses ps2avru instead of ps2avrgb - To put in reset mode hold `q` while inserting the USB cable -- When flashing, type `bootloadHID -r yourfile.hex` and wait awhile Make example for this keyboard (after setting up your build environment): make facew:default +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/singa/readme.md b/keyboards/singa/readme.md index c0325d1a02..09b540722e 100644 --- a/keyboards/singa/readme.md +++ b/keyboards/singa/readme.md @@ -16,4 +16,34 @@ Make example for this keyboard (after setting up your build environment): make singa:default +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/quantum/template/avr/readme.md b/quantum/template/avr/readme.md new file mode 100644 index 0000000000..d9349811d0 --- /dev/null +++ b/quantum/template/avr/readme.md @@ -0,0 +1,15 @@ +# %KEYBOARD% + +![%KEYBOARD%](imgur.com image replace me!) + +A short description of the keyboard/project + +Keyboard Maintainer: [You](https://github.com/yourusername) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make %KEYBOARD%:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/quantum/template/base/readme.md b/quantum/template/base/readme.md deleted file mode 100644 index d9349811d0..0000000000 --- a/quantum/template/base/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# %KEYBOARD% - -![%KEYBOARD%](imgur.com image replace me!) - -A short description of the keyboard/project - -Keyboard Maintainer: [You](https://github.com/yourusername) -Hardware Supported: The PCBs, controllers supported -Hardware Availability: links to where you can find this hardware - -Make example for this keyboard (after setting up your build environment): - - make %KEYBOARD%:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md new file mode 100644 index 0000000000..1dcbe6e755 --- /dev/null +++ b/quantum/template/ps2avrgb/readme.md @@ -0,0 +1,44 @@ +# %KEYBOARD% + +![%KEYBOARD%](imgur.com image replace me!) + +A short description of the keyboard/project + +Keyboard Maintainer: [You](https://github.com/yourusername) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make %KEYBOARD%:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -- cgit v1.2.3 From 83da38c5e413f703bd439e78dd376603c0bd7f6c Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Thu, 9 Aug 2018 17:50:09 -0700 Subject: Keymap: Update cache22 default keymap (#3597) - requested by rockydbull --- keyboards/catch22/keymaps/default/keymap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/catch22/keymaps/default/keymap.c b/keyboards/catch22/keymaps/default/keymap.c index f0300d27fe..f36478d440 100644 --- a/keyboards/catch22/keymaps/default/keymap.c +++ b/keyboards/catch22/keymaps/default/keymap.c @@ -7,11 +7,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT( /* Base */ - KC_A, KC_B, KC_C, KC_D, \ - KC_E, KC_F, KC_G, KC_H, \ - MO(_FN), KC_I, KC_J, KC_K, KC_L, \ - KC_1, KC_M, KC_N, KC_O, KC_P, \ - KC_Q, KC_R, KC_S, KC_T \ + KC_NLCK, KC_PSLS, KC_PAST, KC_BSPC, \ + KC_P7, KC_P8, KC_P9, KC_PEQL, \ + MO(_FN), KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_PENT, KC_P1, KC_P2, KC_P3, KC_PMNS, \ + KC_SPC, KC_P0, KC_PDOT, KC_TAB \ ), [_FN] = LAYOUT( RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUI, \ -- cgit v1.2.3 From 98afb45a2708bf704c981e5a88993b87f084590b Mon Sep 17 00:00:00 2001 From: Christopher Sexton Date: Thu, 9 Aug 2018 20:52:35 -0400 Subject: Keymap: Spaceman Spiff layout for the GH60 Satan (#3596) ![Keyboard Layout](https://i.imgur.com/M9glFON.png) Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings. Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key. Base Layer ---------- As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`: - `Esc` when pressed alone - `Ctrl` when pressed with another key Control+ Layer -------------- Left Ctrl key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions: - `Ctl+` + `hjkl` are vim-style motion keys - `Ctl+` + `p` and `Ctl+` + `n` are page up and down - `Ctl+` + `Backspace` is forward delete Fn Layer -------- Audio Controls: - `Fn` + `a` Volume Down - `Fn` + `s` Volume Up - `Fn` + `d` Mute To flash this layout you need to press `Fn+Backspace` --- keyboards/satan/keymaps/spacemanspiff/keymap.c | 77 +++++++++++++++++++++++++ keyboards/satan/keymaps/spacemanspiff/readme.md | 34 +++++++++++ 2 files changed, 111 insertions(+) create mode 100644 keyboards/satan/keymaps/spacemanspiff/keymap.c create mode 100644 keyboards/satan/keymaps/spacemanspiff/readme.md diff --git a/keyboards/satan/keymaps/spacemanspiff/keymap.c b/keyboards/satan/keymaps/spacemanspiff/keymap.c new file mode 100644 index 0000000000..7dc1d3d788 --- /dev/null +++ b/keyboards/satan/keymaps/spacemanspiff/keymap.c @@ -0,0 +1,77 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +#define _BL 0 +#define _FL 1 +#define _CL 3 + +// Add names for complex momentary keys, to keep the keymap matrix aligned better. +#define CTL_ESC MT(MOD_LCTL,KC_ESC) +#define GUI_ENT MT(MOD_RGUI, KC_ENT) + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * | `| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| -| =|Del | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |Ctl/Esc| A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Alt |Gui | Space |Gui |Alt |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = LAYOUT_60_ansi( + 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_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, \ + CTL_ESC, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + MO(_CL), KC_RALT, KC_LGUI, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, MO(_FL)), + + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | `| | | | | | | | | | | | | RESET| + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | |VDN|VUP|MUTE| | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ +[_FL] = LAYOUT_60_ansi( + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______), + + /* Keymap _CL: Control+ Layer + * ,-----------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | + * |-----------------------------------------------------------| + * | | | | | | | | | | |PGU| | | | + * |-----------------------------------------------------------| + * | | | | | | |LFT| DN| UP|RGT| | | | + * |-----------------------------------------------------------| + * | | | | | | |PGD| | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + +[_CL] = LAYOUT_60_ansi( + 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_DEL, \ + KC_TAB, LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, KC_ESC, LCTL(KC_RBRC), LCTL(KC_BSLS), \ + _______, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), \ + KC_LSFT, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_PGDN, LCTL(KC_N), LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), \ + _______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), KC_RCTL, MO(_FL)), +}; + diff --git a/keyboards/satan/keymaps/spacemanspiff/readme.md b/keyboards/satan/keymaps/spacemanspiff/readme.md new file mode 100644 index 0000000000..1d592509de --- /dev/null +++ b/keyboards/satan/keymaps/spacemanspiff/readme.md @@ -0,0 +1,34 @@ +# Spaceman Spiff Layout for GH60 Satan + +![Keyboard Layout](https://i.imgur.com/M9glFON.png) + + + +Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings. + +Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key. + +# Base Layer + +As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`: +- `Esc` when pressed alone +- `Ctrl` when pressed with another key + +# Control+ Layer + +Left Ctrl key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions: + +- `Ctl+` + `hjkl` are vim-style motion keys +- `Ctl+` + `p` and `Ctl+` + `n` are page up and down +- `Ctl+` + `Backspace` is forward delete + +# Fn Layer + +Audio Controls: +- `Fn` + `a` Volume Down +- `Fn` + `s` Volume Up +- `Fn` + `d` Mute + +To flash this layout you need to press `Fn+Backspace` + + -- cgit v1.2.3 From 1ac2dd9b63b8917fda487b3fb3ae9a2f52c3bda1 Mon Sep 17 00:00:00 2001 From: Christopher Sexton Date: Thu, 9 Aug 2018 20:53:13 -0400 Subject: Keymap: Spaceman Spiff layout for KBD75 (#3595) ![Keyboard Layout](https://i.imgur.com/tQLYDvu.png) Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings. Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key. Base Layer ---------- As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`: - `Esc` when pressed alone - `Ctrl` when pressed with another key Control+ Layer -------------- Left `Ctrl` key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions: - `Ctl+` + `hjkl` are vim-style motion keys - `Ctl+` + `p` and `Ctl+` + `n` are page up and down - `Ctl+` + `Backspace` is forward delete Fn Layer -------- Audio Controls: - `Fn` + `a` Volume Down - `Fn` + `s` Volume Up - `Fn` + `d` Mute To flash this layout you need to press `Fn+Backspace` --- keyboards/kbd75/keymaps/spacemanspiff/keymap.c | 50 +++++++++++++++++++++++++ keyboards/kbd75/keymaps/spacemanspiff/readme.md | 35 +++++++++++++++++ 2 files changed, 85 insertions(+) create mode 100644 keyboards/kbd75/keymaps/spacemanspiff/keymap.c create mode 100644 keyboards/kbd75/keymaps/spacemanspiff/readme.md diff --git a/keyboards/kbd75/keymaps/spacemanspiff/keymap.c b/keyboards/kbd75/keymaps/spacemanspiff/keymap.c new file mode 100644 index 0000000000..82a2ad9bec --- /dev/null +++ b/keyboards/kbd75/keymaps/spacemanspiff/keymap.c @@ -0,0 +1,50 @@ +#include QMK_KEYBOARD_H + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +#define _BL 0 // Base Layer +#define _FN 1 // Function Layer +#define _CL 2 // Control+ Layer + +// Add names for complex momentary keys, to keep the keymap matrix aligned better. +#define CTL_ESC MT(MOD_LCTL,KC_ESC) +#define GUI_ENT MT(MOD_RGUI, KC_ENT) + +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_F13, MO(_FN), KC_DEL, + 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_DEL, KC_BSPC, KC_HOME, + 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_PGUP, + CTL_ESC, 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_PGDN, + KC_LSFT, MO(_FN), 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_END, + MO(_CL), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, GUI_ENT, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN] = LAYOUT( + RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_CL] = LAYOUT( + LCTL(KC_ESC), LCTL(KC_F1), LCTL(KC_F2), LCTL(KC_F3), LCTL(KC_F4), LCTL(KC_F5), LCTL(KC_F6), LCTL(KC_F7), LCTL(KC_F8), LCTL(KC_F9), LCTL(KC_F10), LCTL(KC_F11), LCTL(KC_F12), LCTL(KC_PSCR), _______, LCTL(KC_DEL), + KC_ESC, LCTL(KC_1), LCTL(KC_2), LCTL(KC_3), LCTL(KC_4), LCTL(KC_5), LCTL(KC_6), LCTL(KC_7), LCTL(KC_8), LCTL(KC_9), LCTL(KC_0), LCTL(KC_MINS), LCTL(KC_EQL), LCTL(KC_DEL), KC_DEL, LCTL(KC_HOME), + LCTL(KC_TAB), LCTL(KC_Q), LCTL(KC_W), LCTL(KC_E), LCTL(KC_R), LCTL(KC_T), LCTL(KC_Y), LCTL(KC_U), LCTL(KC_I), LCTL(KC_O), KC_PGUP, LCTL(KC_LBRC), LCTL(KC_RBRC), LCTL(KC_BSLS), LCTL(KC_PGUP), + CTL_ESC, LCTL(KC_A), LCTL(KC_S), LCTL(KC_D), LCTL(KC_F), LCTL(KC_G), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, LCTL(KC_SCLN), LCTL(KC_QUOT), LCTL(KC_ENT), LCTL(KC_PGDN), + LCTL(KC_LSFT), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), LCTL(KC_B), KC_PGDN, LCTL(KC_M), LCTL(KC_COMM), LCTL(KC_DOT), LCTL(KC_SLSH), LCTL(KC_RSFT), LCTL(KC_UP), LCTL(KC_END), + _______, LCTL(KC_LALT), LCTL(KC_LGUI), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_SPC), LCTL(KC_RGUI), LCTL(KC_RALT), LCTL(KC_RCTL), LCTL(KC_LEFT), LCTL(KC_DOWN), LCTL(KC_RGHT) + ), + +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } +} + diff --git a/keyboards/kbd75/keymaps/spacemanspiff/readme.md b/keyboards/kbd75/keymaps/spacemanspiff/readme.md new file mode 100644 index 0000000000..6a78140a3d --- /dev/null +++ b/keyboards/kbd75/keymaps/spacemanspiff/readme.md @@ -0,0 +1,35 @@ +# Spaceman Spiff Layout for KBD75 + +![Keyboard Layout](https://i.imgur.com/tQLYDvu.png) + + + +Designed specifically to make switching back-n-forth with the Apple's MacBook Pro keyboard intuitive. Has a slight tendency toward readline/vim keybindings. + +Caps locks becomes an `Esc` when pressed alone, or a `Ctrl` when pressed with another key. + +# Base Layer + +As simalar to the Apple keyboard as possible. Notiable exception is `Caps Lock`: +- `Esc` when pressed alone +- `Ctrl` when pressed with another key + +# Control+ Layer + +Left Ctrl key switches to the "Control+ Layer". This layer mostly acts like a control key in most cases, with a few exceptions: + +- `Ctl+` + `hjkl` are vim-style motion keys +- `Ctl+` + `p` and `Ctl+` + `n` are page up and down +- `Ctl+` + `Backspace` is forward delete + +# Fn Layer + +Audio Controls: +- `Fn` + `a` Volume Down +- `Fn` + `s` Volume Up +- `Fn` + `d` Mute + +To flash this layout you need to press `Fn+Backspace` + + + -- cgit v1.2.3 From 489a922f347228baf167e4183f83bb688471b2fd Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 9 Aug 2018 18:03:34 -0700 Subject: Keyboard: Disable mouse keys for kbd6x (#3603) --- keyboards/kbd6x/rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kbd6x/rules.mk b/keyboards/kbd6x/rules.mk index 8f2e7e2adb..b8acb7ad99 100644 --- a/keyboards/kbd6x/rules.mk +++ b/keyboards/kbd6x/rules.mk @@ -52,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 -- cgit v1.2.3 From 243764b83d3130ba69bef510ba180916caaebf55 Mon Sep 17 00:00:00 2001 From: Erick Ozaki Date: Thu, 9 Aug 2018 22:09:43 -0300 Subject: Keymap: Custom L0 layout for ergodone (#3591) --- keyboards/ergodone/keymaps/eozaki/keymap.c | 223 ++++++++++++++++++++++++++++ keyboards/ergodone/keymaps/eozaki/readme.md | 13 ++ 2 files changed, 236 insertions(+) create mode 100644 keyboards/ergodone/keymaps/eozaki/keymap.c create mode 100644 keyboards/ergodone/keymaps/eozaki/readme.md diff --git a/keyboards/ergodone/keymaps/eozaki/keymap.c b/keyboards/ergodone/keymaps/eozaki/keymap.c new file mode 100644 index 0000000000..a6d17b61c2 --- /dev/null +++ b/keyboards/ergodone/keymaps/eozaki/keymap.c @@ -0,0 +1,223 @@ +#include QMK_KEYBOARD_H +#include "debug.h" +#include "action_layer.h" +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | ~ | | ' | 6 | 7 | 8 | 9 | 0 | = | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | ~ | | " | Y | U | I | O | P | - | + * |--------+------+------+------+------+------| ` | | |------+------+------+------+------+--------| + * | Ctrl | A | S | D | F | G |------| |------| H | J | K | L | ; | \ | + * |--------+------+------+------+------+------| { | | } |------+------+------+------+------+--------| + * | LAlt | Z | X | C | V | B | [ | | ] | N | M | , | . | / | LShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LT-1 | F4 | F5 | F6 | F11 | | Left | Down | Up | Right| RAlt | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | L1 | Prev | | Vol+ | L2 | + * ,------|------|------| |------+--------+------. + * | | | Play | | Vol- | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | Next | | Mute | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV), + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_GRV, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LALT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, + LT(SYMB, KC_F2), KC_F4, KC_F5, KC_F6, KC_F11, + TG(SYMB), KC_MPRV, + KC_MPLY, + KC_SPC,KC_BSPC,KC_MNXT, + // right hand + KC_QUOT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, + LSFT(KC_QUOT), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),KC_BSLS, + KC_RBRC, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_LSFT, + KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_RALT, + KC_VOLU, TG(MDIA), + KC_VOLD, + KC_MUTE,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RGB_MOD,KC_TRNS, + KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case 1: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // TODO: Make this relevant to the ErgoDox EZ. + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + // none + break; + } + +}; diff --git a/keyboards/ergodone/keymaps/eozaki/readme.md b/keyboards/ergodone/keymaps/eozaki/readme.md new file mode 100644 index 0000000000..bfde2b2c8e --- /dev/null +++ b/keyboards/ergodone/keymaps/eozaki/readme.md @@ -0,0 +1,13 @@ +# ErgoDox EZ Based Configuration + +## Changelog + +* Aug 2018: + * New custom L0 layout. +* Dec 2016: + * Added LED keys + * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. +* Sep 22, 2016: + * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). -- cgit v1.2.3 From 90d8ed6c448a7b09e0a459181f889e3153d960ee Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 10 Aug 2018 08:15:11 -0700 Subject: Keyboard: Add Configurator support for Clueboard 66 Hotswap (#3522) --- keyboards/clueboard/66_hotswap/info.json | 6 +++++- keyboards/clueboard/66_hotswap/readme.md | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/keyboards/clueboard/66_hotswap/info.json b/keyboards/clueboard/66_hotswap/info.json index 66705b7a7b..42fbeceddd 100644 --- a/keyboards/clueboard/66_hotswap/info.json +++ b/keyboards/clueboard/66_hotswap/info.json @@ -3,8 +3,12 @@ "width": 16.5, "height": 5, "layouts": { - "KEYMAP": { + "LAYOUT": { "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}] + }, + + "LAYOUT_66_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}] } } } diff --git a/keyboards/clueboard/66_hotswap/readme.md b/keyboards/clueboard/66_hotswap/readme.md index 014c761b02..2ae46b84c5 100644 --- a/keyboards/clueboard/66_hotswap/readme.md +++ b/keyboards/clueboard/66_hotswap/readme.md @@ -4,10 +4,10 @@ A fully customizable 66% keyboard with Hot Swap sockets. -* Keyboard Maintainer: [Zach White](https://github.com/skullydazed) +* Keyboard Maintainer: [Zach White](https://github.com/skullydazed) * Hardware Supported: Clueboard 66% HotSwap PCB * 2.9 -* Hardware Availability: [clueboard.co](https://clueboard.co/) +* Hardware Availability: [clueboard.co](https://clueboard.co/) Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From feb5e4aaebb78842c090230f68ea9de80a5c17e6 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Sat, 11 Aug 2018 00:22:09 +0900 Subject: Keyboard: Helix serial improvements (#3608) * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h --- .../helix/rev1/keymaps/OLED_sample/serial_config.h | 2 +- keyboards/helix/rev1/rules.mk | 4 +- keyboards/helix/rev1/serial_config.h | 2 +- keyboards/helix/rev2/keymaps/default/config.h | 3 + keyboards/helix/rev2/keymaps/edvorakjp/config.h | 3 + keyboards/helix/rev2/keymaps/five_rows/config.h | 6 + .../helix/rev2/keymaps/five_rows_jis/config.h | 3 + keyboards/helix/rev2/keymaps/froggy/config.h | 3 + keyboards/helix/rev2/keymaps/led_test/config.h | 3 + keyboards/helix/rev2/matrix.c | 58 +-- keyboards/helix/rev2/rules.mk | 7 +- keyboards/helix/rev2/serial_config.h | 3 +- keyboards/helix/rev2/serial_config_simpleapi.h | 8 + keyboards/helix/rev2/split_scomm.c | 73 ++++ keyboards/helix/rev2/split_scomm.h | 24 ++ keyboards/helix/rev2/split_util.c | 2 +- keyboards/helix/rules.mk | 9 +- keyboards/helix/serial.c | 411 ++++++++++++++------- keyboards/helix/serial.h | 63 +++- 19 files changed, 514 insertions(+), 173 deletions(-) create mode 100644 keyboards/helix/rev2/serial_config_simpleapi.h create mode 100644 keyboards/helix/rev2/split_scomm.c create mode 100644 keyboards/helix/rev2/split_scomm.h diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h index be2e7cb8b1..b991b874b7 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h +++ b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h @@ -9,7 +9,7 @@ #define SERIAL_PIN_INTERRUPT INT2_vect #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 +#define SERIAL_MASTER_BUFFER_LENGTH 0 //// #error rev1/keymaps/OLED_sample serial config diff --git a/keyboards/helix/rev1/rules.mk b/keyboards/helix/rev1/rules.mk index daba80eaea..13834f5da1 100644 --- a/keyboards/helix/rev1/rules.mk +++ b/keyboards/helix/rev1/rules.mk @@ -1,4 +1,4 @@ -SRC += rev1/matrix.c \ - rev1/split_util.c +SRC += rev1/matrix.c +SRC += rev1/split_util.c BACKLIGHT_ENABLE = no diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h index 2b668a6afc..51c6aa3750 100644 --- a/keyboards/helix/rev1/serial_config.h +++ b/keyboards/helix/rev1/serial_config.h @@ -9,7 +9,7 @@ #define SERIAL_PIN_INTERRUPT INT0_vect #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 +#define SERIAL_MASTER_BUFFER_LENGTH 0 /// #error rev1 serial config diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h index 6da6849a1d..185e678385 100644 --- a/keyboards/helix/rev2/keymaps/default/config.h +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -21,6 +21,9 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H +// if you need more program area, try uncomment follow line +//#include "serial_config_simpleapi.h" + // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h index a7a5f83600..ead31605b2 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h @@ -1,6 +1,9 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H +// if you need more program area, try uncomment follow line +//#include "serial_config_simpleapi.h" + #undef TAPPING_FORCE_HOLD #undef TAPPING_TERM #define TAPPING_TERM 120 diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h index 6da6849a1d..8372194604 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows/config.h @@ -21,6 +21,12 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H +// if you need more program area, try uncomment follow line +//#include "serial_config_simpleapi.h" + +#undef TAPPING_TERM +#define TAPPING_TERM 140 + // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h index 34650b99a6..c380b7db4e 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h @@ -23,6 +23,9 @@ along with this program. If not, see . // place overrides here +// if you need more program area, try uncomment follow line +//#include "serial_config_simpleapi.h" + #ifdef MOUSEKEY_ENABLE #undef MOUSEKEY_INTERVAL #define MOUSEKEY_INTERVAL 0 diff --git a/keyboards/helix/rev2/keymaps/froggy/config.h b/keyboards/helix/rev2/keymaps/froggy/config.h index df72aef123..dad2483034 100644 --- a/keyboards/helix/rev2/keymaps/froggy/config.h +++ b/keyboards/helix/rev2/keymaps/froggy/config.h @@ -21,6 +21,9 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H +// if you need more program area, try uncomment follow line +//#include "serial_config_simpleapi.h" + #undef TAPPING_TERM #define TAPPING_TERM 200 #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ diff --git a/keyboards/helix/rev2/keymaps/led_test/config.h b/keyboards/helix/rev2/keymaps/led_test/config.h index 6da6849a1d..0438254528 100644 --- a/keyboards/helix/rev2/keymaps/led_test/config.h +++ b/keyboards/helix/rev2/keymaps/led_test/config.h @@ -21,6 +21,9 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H +// if you need more program area, try uncomment follow line +#include "serial_config_simpleapi.h" + // place overrides here #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/matrix.c b/keyboards/helix/rev2/matrix.c index 8a1ce3af1e..322959dbbb 100644 --- a/keyboards/helix/rev2/matrix.c +++ b/keyboards/helix/rev2/matrix.c @@ -20,6 +20,7 @@ along with this program. If not, see . */ #include #include +#include #include #include #include @@ -34,7 +35,7 @@ along with this program. If not, see . #ifdef USE_MATRIX_I2C # include "i2c.h" #else // USE_SERIAL -# include "serial.h" +# include "split_scomm.h" #endif #ifndef DEBOUNCE @@ -102,6 +103,8 @@ void matrix_init(void) init_cols(); TX_RX_LED_INIT; + TXLED0; + RXLED0; // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { @@ -178,17 +181,20 @@ i2c_error: // the cable is disconnceted, or something else went wrong #else // USE_SERIAL -int serial_transaction(void) { +int serial_transaction(int master_changed) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else int ret=serial_update_buffers(); +#endif if (ret ) { - if(ret==2)RXLED1; + if(ret==2) RXLED1; return 1; } -RXLED0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); return 0; } #endif @@ -199,19 +205,9 @@ uint8_t matrix_scan(void) matrix_master_scan(); }else{ matrix_slave_scan(); - -// if(serial_slave_DATA_CORRUPT()){ -// TXLED0; - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - -// }else{ -// TXLED1; -// } - + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); matrix_scan_quantum(); } return 1; @@ -221,6 +217,7 @@ uint8_t matrix_scan(void) uint8_t matrix_master_scan(void) { int ret = _matrix_scan(); + int mchanged = 1; #ifndef KEYBOARD_helix_rev1 int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; @@ -231,16 +228,19 @@ uint8_t matrix_master_scan(void) { // i2c_slave_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); #endif #endif #ifdef USE_MATRIX_I2C if( i2c_transaction() ) { #else // USE_SERIAL - if( serial_transaction() ) { + if( serial_transaction(mchanged) ) { #endif // turn on the indicator led when halves are disconnected TXLED1; @@ -274,9 +274,19 @@ void matrix_slave_scan(void) { i2c_slave_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif serial_slave_buffer[i] = matrix[offset+i]; } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif #endif } diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk index 6ab01f44b4..4ea623c436 100644 --- a/keyboards/helix/rev2/rules.mk +++ b/keyboards/helix/rev2/rules.mk @@ -1,3 +1,4 @@ -SRC += rev2/matrix.c \ - rev2/split_util.c \ - ws2812.c +SRC += rev2/matrix.c +SRC += rev2/split_util.c +SRC += rev2/split_scomm.c +SRC += ws2812.c diff --git a/keyboards/helix/rev2/serial_config.h b/keyboards/helix/rev2/serial_config.h index 82c6e4e836..8d7e628378 100644 --- a/keyboards/helix/rev2/serial_config.h +++ b/keyboards/helix/rev2/serial_config.h @@ -8,8 +8,7 @@ #define SERIAL_PIN_MASK _BV(PD2) #define SERIAL_PIN_INTERRUPT INT2_vect -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_USE_MULTI_TRANSACTION //// #error rev2 serial config diff --git a/keyboards/helix/rev2/serial_config_simpleapi.h b/keyboards/helix/rev2/serial_config_simpleapi.h new file mode 100644 index 0000000000..e2d22a41e7 --- /dev/null +++ b/keyboards/helix/rev2/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/helix/rev2/split_scomm.c b/keyboards/helix/rev2/split_scomm.c new file mode 100644 index 0000000000..9719eb22ea --- /dev/null +++ b/keyboards/helix/rev2/split_scomm.c @@ -0,0 +1,73 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef SERIAL_DEBUG_MODE +#include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status; + static int need_retry = 0; + if( s_change_old != slave_buffer_change_count ) { + status = soft_serial_transaction(GET_SLAVE_BUFFER); + if( status == TRANSACTION_END ) + s_change_old = slave_buffer_change_count; + } + if( !master_update && !need_retry) + status = soft_serial_transaction(GET_SLAVE_STATUS); + else + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + need_retry = ( status == TRANSACTION_END ) ? 0 : 1; + return status; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/helix/rev2/split_scomm.h b/keyboards/helix/rev2/split_scomm.h new file mode 100644 index 0000000000..873d8939d8 --- /dev/null +++ b/keyboards/helix/rev2/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/helix/rev2/split_util.c b/keyboards/helix/rev2/split_util.c index beb39fa005..e1ff8b4379 100644 --- a/keyboards/helix/rev2/split_util.c +++ b/keyboards/helix/rev2/split_util.c @@ -11,7 +11,7 @@ #ifdef USE_MATRIX_I2C # include "i2c.h" #else -# include "serial.h" +# include "split_scomm.h" #endif volatile bool isLeftHand = true; diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk index c35f93fb07..e42f92cf8a 100644 --- a/keyboards/helix/rules.mk +++ b/keyboards/helix/rules.mk @@ -1,6 +1,9 @@ -SRC += i2c.c \ - serial.c \ - ssd1306.c +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto # MCU name #MCU = at90usb1287 diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 5919415877..11ceff0b37 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -9,40 +9,85 @@ #include #include #include +#include #include #include "serial.h" +//#include #ifdef USE_SERIAL +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ return soft_serial_transaction(); } + +#endif // Simple API (OLD API, compatible with let's split serial.c) + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) // Serial pulse period in microseconds. +#define TID_SEND_ADJUST 14 + #define SELECT_SERIAL_SPEED 1 #if SELECT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles #elif SELECT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 23 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles #elif SELECT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles #elif SELECT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles #elif SELECT_SERIAL_SPEED == 4 // Very Low speed #define SERIAL_DELAY 50 // micro sec - #define READ_WRITE_START_ADJUST 25 // cycles - #define READ_WRITE_WIDTH_ADJUST 10 // cycles + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles #else #error Illegal Serial Speed #endif @@ -51,14 +96,15 @@ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) -#define SLAVE_INT_WIDTH 1 -#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; +static SSTD_t *Transaction_table = NULL; inline static void serial_delay(void) { @@ -75,12 +121,14 @@ void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); } +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; @@ -92,50 +140,58 @@ uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void serial_master_init(void) { - serial_output(); - serial_high(); +void soft_serial_initiator_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_output(); + serial_high(); } -void serial_slave_init(void) { - serial_input_with_pullup(); +void soft_serial_target_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_input_with_pullup(); #if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); #elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); #else #error unknown SERIAL_PIN_MASK value #endif } // Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; static void sync_recv(void) { - for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { } - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. while (!serial_read_pin()); } // Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void)NO_INLINE; static void sync_send(void) { serial_low(); @@ -144,152 +200,245 @@ void sync_send(void) { } // Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + _delay_sub_us(READ_WRITE_START_ADJUST); - for ( uint8_t i = 0; i < 8; ++i) { - serial_delay_half1(); // read the middle of pulses - byte = (byte << 1) | serial_read_pin(); - _delay_sub_us(READ_WRITE_WIDTH_ADJUST); - serial_delay_half2(); + for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + return byte; } // Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 1<<7; - while( b ) { - if(data & b) { - serial_high(); - } else { - serial_low(); +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } - b >>= 1; + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } serial_delay(); - } - serial_low(); // sync_send() / senc_recv() need raise edge -} -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - serial_output(); + serial_low(); // sync_send() / senc_recv() need raise edge +} - // slave send phase - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; sync_send(); - serial_write_byte(serial_slave_buffer[i]); - checksum += serial_slave_buffer[i]; + serial_write_chunk(data,8); } - sync_send(); - serial_write_byte(checksum); - - // slave switch to input - sync_send(); //0 - serial_delay_half1(); //1 - serial_low(); //2 - serial_input_with_pullup(); //2 - serial_delay_half1(); //3 - - // slave recive phase - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; sync_recv(); - serial_master_buffer[i] = serial_read_byte(); - checksum_computed += serial_master_buffer[i]; + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid; + uint8_t pecount = 0; sync_recv(); - uint8_t checksum_received = serial_read_byte(); + tid = serial_read_chunk(&pecount,4); + if(pecount> 0) + return; + serial_delay_half1(); - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } } else { - status &= ~SLAVE_DATA_CORRUPT; + *trans->status = TRANSACTION_ACCEPTED; } - sync_recv(); //weit master output to high -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; + sync_recv(); //weit initiator output to high } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) // // Returns: -// 0 => no error -// 1 => slave did not respond -// 2 => checksum error -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif cli(); - // signal to the slave that we want to start a transaction + // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(SLAVE_INT_WIDTH); + _delay_us(SLAVE_INT_WIDTH_US); - // wait for the slaves response +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response serial_input_with_pullup(); _delay_us(SLAVE_INT_RESPONSE_TIME); - // check if the slave is present + // check if the target is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // target failed to pull the line low, assume not present serial_output(); serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return 1; + return TRANSACTION_NO_RESPONSE; } - // master recive phase - // if the slave is present syncronize with it +#else + // send transaction table index + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(sstd_index, 4); + serial_delay_half1(); - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - sync_recv(); - serial_slave_buffer[i] = serial_read_byte(); - checksum_computed += serial_slave_buffer[i]; + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); } - sync_recv(); - uint8_t checksum_received = serial_read_byte(); - if (checksum_computed != checksum_received) { - serial_output(); - serial_high(); - sei(); - return 2; + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } +#endif - // master switch to output - sync_recv(); //0 - serial_delay(); //1 - serial_low(); //3 - serial_output(); // 3 - serial_delay_half1(); //4 - - // master send phase - uint8_t checksum = 0; - - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - sync_send(); - serial_write_byte(serial_master_buffer[i]); - checksum += serial_master_buffer[i]; + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); } - sync_send(); - serial_write_byte(checksum); // always, release the line when not in use sync_send(); + *trans->status = TRANSACTION_END; sei(); - return 0; + return TRANSACTION_END; } +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + #endif diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h index c3c9569b2c..d2b7fd8e60 100644 --- a/keyboards/helix/serial.h +++ b/keyboards/helix/serial.h @@ -3,25 +3,78 @@ #include -// //////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////// // Need Soft Serial defines in serial_config.h -// //////////////////////////////////////////// +// ///////////////////////////////////////////////////////////////// // ex. // #define SERIAL_PIN_DDR DDRD // #define SERIAL_PIN_PORT PORTD // #define SERIAL_PIN_INPUT PIND // #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 // #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + -// Buffers for master - slave communication +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif void serial_master_init(void); void serial_slave_init(void); int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x4 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif #endif /* SOFT_SERIAL_H */ -- cgit v1.2.3 From fd0bd29a0a3f2de93a3e561007805fac67e7e0cd Mon Sep 17 00:00:00 2001 From: ishtob Date: Fri, 10 Aug 2018 11:30:21 -0400 Subject: Keymap: adding my personal userspace to QMK master (#3605) * Adding my personal planck keymap * Adding readme.md to my keymap * Create my userspace add users/ishtob/ * Moved macros off keymap macros now exsists in my userspace, moved them off keyboard specific keymaps * Create my userspace add users/ishtob/ * rebase from main QMK repo --- keyboards/planck/keymaps/ishtob/config.h | 60 ++++--------- keyboards/planck/keymaps/ishtob/keymap.c | 112 ++++-------------------- keyboards/planck/keymaps/ishtob/macros_public.h | 57 ------------ keyboards/planck/keymaps/ishtob/readme.md | 7 +- keyboards/planck/keymaps/ishtob/rule.mk | 4 - users/ishtob/config.h | 76 ++++++++++++++++ users/ishtob/ishtob.c | 69 +++++++++++++++ users/ishtob/ishtob.h | 76 ++++++++++++++++ users/ishtob/readme.md | 87 ++++++++++++++++++ users/ishtob/rules.mk | 7 ++ 10 files changed, 349 insertions(+), 206 deletions(-) delete mode 100644 keyboards/planck/keymaps/ishtob/macros_public.h create mode 100755 users/ishtob/config.h create mode 100644 users/ishtob/ishtob.c create mode 100644 users/ishtob/ishtob.h create mode 100644 users/ishtob/readme.md create mode 100755 users/ishtob/rules.mk diff --git a/keyboards/planck/keymaps/ishtob/config.h b/keyboards/planck/keymaps/ishtob/config.h index 730b4eaed9..e58ade0b0f 100755 --- a/keyboards/planck/keymaps/ishtob/config.h +++ b/keyboards/planck/keymaps/ishtob/config.h @@ -1,60 +1,36 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H -#include "../../config.h" +#ifndef USERSPACE_CONFIG_H +#define USERSPACE_CONFIG_H -#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING -#define PREVENT_STUCK_MODIFIERS +#ifdef AUDIO_ENABLE + +// #define STARTUP_SONG SONG(E1M1_DOOM) +// #define GOODBYE_SONG SONG(SONIC_RING) +/* #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + } +*/ //audio clicky #define AUDIO_CLICKY // to enable clicky on startup //#define AUDIO_CLICKY_ON #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f -/* ws2812 RGB LED -#define RGB_DI_PIN B5 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -*/ -#undef PLANCK_MIT_LAYOUT + +#endif + +#define FORCE_NKRO + +#define LEADER_TIMEOUT 300 +#define PREVENT_STUCK_MODIFIERS #undef DEBOUNCE #define DEBOUNCE 0 -//rgb-reactive -#define RGB_MATRIX_KEYPRESSES -#define EECONFIG_RGB_MATRIX (uint32_t *)16 - //skip usb startup check //#define NO_USB_STARTUP_CHECK -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - - #endif diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index be74a0d519..36720c4c3e 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -1,7 +1,6 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, // this is the style you want to emulate. -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" // #include "dynamic_macro.h" @@ -9,65 +8,10 @@ #include "audio.h" #endif #include "eeconfig.h" - -//Macro definition -#if (__has_include("macros_private.h") && !defined(SECRETS)) -#include "macros_private.h" -#else -#include "macros_public.h" -#endif +#include "ishtob.h" extern keymap_config_t keymap_config; -// 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 _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _PLOVER 5 -#define _FNLAYER 6 -#define _NUMLAY 7 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - LOWER, - RAISE, - BACKLIT, - EXT_PLV, - DFU, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY -#define P_CITRIX M(KC_CITRIX) // My login macros -#define P_MPASS M(KC_MPASS) -#define P_META M(KC_META) -#define O_DAYRN M(KC_DAYRN) // My work macros -#define O_AUTODC M(KC_AUTODC) -#define O_RTQ6H M(KC_RTQ6H) -#define M_EMAIL M(KC_EMAIL) // My personal email -#define M_EMAIL2 M(KC_EMAIL2) // My work email - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty ,-----------------------------------------------------------------------------------. @@ -86,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Colemak * ,-----------------------------------------------------------------------------------. * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | @@ -104,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Dvorak * ,-----------------------------------------------------------------------------------. * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | @@ -122,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), - + /* Lower * ,-----------------------------------------------------------------------------------. * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | @@ -140,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - + /* Raise * ,-----------------------------------------------------------------------------------. * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * | \ | @@ -158,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK ), - + /* Plover layer (http://opensteno.org) * ,-----------------------------------------------------------------------------------. * | # | # | # | # | # | # | # | # | # | # | # | # | @@ -170,14 +114,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Exit | | | A | O | | E | U | | | | * `-----------------------------------------------------------------------------------' */ - + [_PLOVER] = LAYOUT_planck_grid( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX ), - + /* FN layer on Esc key * ,-----------------------------------------------------------------------------------. * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | @@ -195,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - + /* Num Layer * ,-----------------------------------------------------------------------------------. * | | Q | Up | 4 | | | 7 | 8 | 9 | - | + | Bksp | @@ -213,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, _______, _______, KC_NLCK, KC_MPLY ), - + /* Mouse Layer (semi-col) * ,-----------------------------------------------------------------------------------. * | ACCL0| ACCL1| ACCL2|Email |Email2| Home | Wh_Up| WHL_L| M_Up | WHL_R|PASS| Meta | @@ -225,14 +169,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | BTN1 | | | | Citx | | * `-----------------------------------------------------------------------------------' */ - + [_MOUSECURSOR] = LAYOUT_planck_grid( KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, _______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC ), - + /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | @@ -250,7 +194,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG ) - + }; @@ -281,7 +225,7 @@ void persistant_default_layer_set(uint16_t default_layer) { void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { @@ -369,36 +313,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case DFU: - if (record->event.pressed) { - clear_keyboard(); - #if defined(MIDI_ENABLE) && defined(MIDI_BASIC) - process_midi_all_notes_off(); - #endif - #if defined(AUDIO_ENABLE) && !defined(NO_MUSIC_MODE) - music_all_notes_off(); - uint16_t timer_start = timer_read(); - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - shutdown_user(); - while(timer_elapsed(timer_start) < 250) - wait_ms(1); - stop_all_notes(); - #else - wait_ms(250); - #endif - // this is also done later in bootloader.c - not sure if it's neccesary here - #ifdef BOOTLOADER_CATERINA - *(uint16_t *)0x0800 = 0x7777; // these two are a-star-specific - #endif - bootloader_jump(); - } - return false; - break; } return true; } -void matrix_init_user(void) { +void matrix_init_keymap(void) { #ifdef AUDIO_ENABLE startup_user(); #endif @@ -432,4 +351,3 @@ void music_scale_user(void) #endif - diff --git a/keyboards/planck/keymaps/ishtob/macros_public.h b/keyboards/planck/keymaps/ishtob/macros_public.h deleted file mode 100644 index 27d6f75649..0000000000 --- a/keyboards/planck/keymaps/ishtob/macros_public.h +++ /dev/null @@ -1,57 +0,0 @@ -enum macro_keycodes { - KC_CITRIX, - KC_MPASS, - KC_META, - KC_RTQ6H, - KC_DAYRN, - KC_3DRN, - KC_AUTODC, - KC_EMAIL, - KC_EMAIL2 -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - //my login macros - case KC_CITRIX: - if (record->event.pressed){ - return MACRO (I(1), T(1), END); - } - case KC_MPASS: - if (record->event.pressed){ - return MACRO (I(1), T(1), END); - } - case KC_META: - if (record->event.pressed){ - return MACRO (I(1), T(1), END); - } - //my work macros - case KC_RTQ6H: - if (record->event.pressed){ - return MACRO (I(1), T(TAB), T(0), T (3), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(0), T (9), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(1), T (5), T(0), T(0), T(TAB), T(DOWN), T(TAB), T(2), T (1), T(0), T(0), T(TAB), D(LALT), T(O), U(LALT), END); - } - case KC_AUTODC: - if (record->event.pressed){ - return MACRO (I(1), D(LALT), T(V), U(LALT), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(T), T(TAB),T(N), D(LALT), T(S), U(LALT), END); - } - case KC_DAYRN: - if (record->event.pressed){ - return MACRO (I(1), T(TAB), T(TAB), T(TAB), T(TAB), T(TAB), T(1), D(LALT), T(S), U(LALT), END); - } - //Ops macros - case KC_EMAIL: - if (record->event.pressed){ - return MACRO (I(1), T(1), END); } - case KC_EMAIL2: - if (record->event.pressed){ - return MACRO (I(1), T(1), END); - } - } - - return MACRO_NONE; -} \ No newline at end of file diff --git a/keyboards/planck/keymaps/ishtob/readme.md b/keyboards/planck/keymaps/ishtob/readme.md index 22873141fd..108b9ee0c3 100644 --- a/keyboards/planck/keymaps/ishtob/readme.md +++ b/keyboards/planck/keymaps/ishtob/readme.md @@ -2,7 +2,7 @@ #Ishtob's personal planck layout -THis is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split. +This is the default layout used with my planck light, though the rest of the keymap could also be used for the full sized planck or let's split. Main difference with the default layout: @@ -14,8 +14,3 @@ Main difference with the default layout: * Capslock is on the base layer as it is used quite often with my work's software * Numbers layer on lower is positioned to resemble a numpad with 5 taking the location of J for the homing bump and easier entry - - -# Secret Macros - -`macros_public.h` contains a list of macros that can be replaced with passwords or other sensative private macros. `macros_private.h` will be used if it exsists in the folder during compiling and will ignore `macros_public.h` The private macros can be excluded from git commits by adding it to the exclusion list. diff --git a/keyboards/planck/keymaps/ishtob/rule.mk b/keyboards/planck/keymaps/ishtob/rule.mk index 923c3a5dc4..c8940c3b40 100755 --- a/keyboards/planck/keymaps/ishtob/rule.mk +++ b/keyboards/planck/keymaps/ishtob/rule.mk @@ -1,7 +1,3 @@ -ifeq ($(strip $(SECRETS)),yes) - OPT_DEF += -DSECRETS -endif - # Build Options # comment out to disable the options. # diff --git a/users/ishtob/config.h b/users/ishtob/config.h new file mode 100755 index 0000000000..9c4a7ed8dd --- /dev/null +++ b/users/ishtob/config.h @@ -0,0 +1,76 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +//#define LEADER_TIMEOUT 300 +//#define BACKLIGHT_BREATHING +#define PREVENT_STUCK_MODIFIERS +//#define PERMISSIVE_HOLD +// #define QMK_KEYS_PER_SCAN 4 + +//audio clicky + //#define AUDIO_CLICKY + // to enable clicky on startup + //#define AUDIO_CLICKY_ON + //#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.0f + +/* ws2812 RGB LED +#define RGB_DI_PIN B5 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +*/ +#undef PLANCK_MIT_LAYOUT + +//#define MUON_LEFT + +#undef DEBOUNCE +#define DEBOUNCE 0 + +//rgb-reactive +//#define RGB_MATRIX_KEYPRESSES +//#define EECONFIG_RGB_MATRIX (uint32_t *)16 + +//skip usb startup check +//#define NO_USB_STARTUP_CHECK + + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#endif diff --git a/users/ishtob/ishtob.c b/users/ishtob/ishtob.c new file mode 100644 index 0000000000..1b847d6306 --- /dev/null +++ b/users/ishtob/ishtob.c @@ -0,0 +1,69 @@ +/* +Based on userspace written by @drashna 2017 +Copyright 2018 Hsian Chang @ishtob + +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 . +*/ + +#include "ishtob.h" +#include "action.h" +#include "action_layer.h" +// #include "dynamic_macro.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + + +// Add reconfigurable functions here, for keymap customization +// This allows for a global, userspace functions, and continued +// customization of the keymap. Use _keymap instead of _user +// functions in the keymaps +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// Call user matrix init, then call the keymap's init function +void matrix_init_user(void) { + matrix_init_keymap(); +} + +// No global matrix scan code, so just run keymap's matix +// scan function +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DFU: + if (record->event.pressed) { + clear_keyboard(); + reset_keyboard(); + } + return false; + break; + } + return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); +} + diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h new file mode 100644 index 0000000000..2c47fce791 --- /dev/null +++ b/users/ishtob/ishtob.h @@ -0,0 +1,76 @@ +#ifndef USERSPACE +#define USERSPACE +#include "quantum.h" + +enum userspace_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV, + DFU, + P_CITRIX, //these macro exsists in macros_private.c, which is excluded from git + P_MPASS, + P_META, + O_DAYRN, + O_RTQ6H, + O_3DRN, + O_AUTODC, + M_EMAIL, + M_EMAIL2 +}; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _FNLAYER 6 +#define _NUMLAY 7 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + + + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY +/* +enum userspace_layers { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _FNLAYER, + _NUMLAY, + _MOUSECURSOR, + _ADJUST +}; +*/ + + + +#endif // !USERSPACE \ No newline at end of file diff --git a/users/ishtob/readme.md b/users/ishtob/readme.md new file mode 100644 index 0000000000..5b7064de9e --- /dev/null +++ b/users/ishtob/readme.md @@ -0,0 +1,87 @@ +# Ishtob's userspace + +under developement + +# Secret Macros + +This section is a modified version of what @drashna did in his userspace: https://github.com/qmk/qmk_firmware/tree/master/users/drashna#secret-macros + +`macros_private.c` will be used if it exsists in the userspace folder during compiling. + +To get started, put the following in rules.mk. this will have the compiler include the macros_private.c file if it exsists. +``` +SRC += ishtob.c +ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") + SRC += macros_private.c +endif +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif +``` + +Remember that all macro keycode has to be present in the header file (ishtob.h) to prevent error during compile. + +Next, you setup macros_private.c, ensure the keycodes are defined in ishtob.h (or your keymap.h). +Here is an example of my macros with the sensitive login information removed: +``` +#include "ishtob.h" //replace this with your userspace or keymap +#include "quantum.h" + +#pragma message "secret macros included" //debug line to let me know this file is included in the compile + +//this str is for the monthly password rotation per my workplace's security policy +char my_str[5] = "stuff"; + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + //my login macros + case P_CITRIX: + SEND_STRING("username"SS_TAP(X_TAB)"something"); + send_string(my_str); + return false; + case P_MPASS: + SEND_STRING("something"); + send_string(my_str); + return false; + case P_META: + SEND_STRING("metausername"); + return false; + //my work macros for the meta application + case O_RTQ6H: + SEND_STRING(SS_TAP(X_TAB)"0300"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"0900"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"1500"SS_TAP(X_TAB)SS_TAP(X_DOWN)SS_TAP(X_TAB)"2100"SS_TAP(X_TAB)SS_LALT("o")); + return false; + case O_AUTODC: + SEND_STRING(SS_LALT("v")SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"T"SS_TAP(X_TAB)"N"SS_LALT("s")); + return false; + case O_DAYRN: + SEND_STRING(SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)SS_TAP(X_TAB)"1"SS_LALT("s")); + return false; + //Ops macros + case M_EMAIL: + SEND_STRING("privatemail@email.com"); + return false; + case M_EMAIL2: + SEND_STRING("workemail@work.com"); + return false; + } + } + return true; +} +``` + + +Finally, add the following to .git/info/exclude to prevent private macros from being committed to git. +``` +# git ls-files --others --exclude-from=.git/info/exclude +# Lines that start with '#' are comments. +# For a project mostly in C, the following would be a good set of +# exclude patterns (uncomment them if you want to use them): +# *.[oa] +# *~ +/users/ishtob/macros_private.c +``` + +# Special mentions + +special thanks to @drashna for helping me through quite a bit of these codes. \ No newline at end of file diff --git a/users/ishtob/rules.mk b/users/ishtob/rules.mk new file mode 100755 index 0000000000..d19e952667 --- /dev/null +++ b/users/ishtob/rules.mk @@ -0,0 +1,7 @@ +SRC += ishtob.c +ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") + SRC += macros_private.c +endif +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif -- cgit v1.2.3 From 3eabd7946ec5e47d12d603d591e8d8658d82fa42 Mon Sep 17 00:00:00 2001 From: Seth Barberee Date: Sat, 11 Aug 2018 13:10:23 -0500 Subject: Split Common: Serial Backlight LED fix (#3586) --- quantum/split_common/matrix.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 0a79e42566..4af90209f6 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -340,6 +340,24 @@ void matrix_slave_scan(void) { for (int i = 0; i < ROWS_PER_HAND; ++i) { serial_slave_buffer[i] = matrix[offset+i]; } +#endif +#ifdef USE_I2C +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(i2c_slave_buffer[0]); +#endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[i+1] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } + +#ifdef BACKLIGHT_ENABLE + // Read backlight level sent from master and update level on slave + backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); +#endif #endif matrix_slave_scan_user(); } -- cgit v1.2.3 From 2a89134d8e939c86c5e9008f6ad77e15bb404c39 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Fri, 10 Aug 2018 23:56:27 -0700 Subject: add some of my default layouts for the clueboard I got --- layouts/community/66_ansi/layout.json | 5 ++++ layouts/community/66_ansi/mechmerlin/keymap.c | 36 +++++++++++++++++++++++++++ layouts/community/66_ansi/readme.md | 3 +++ 3 files changed, 44 insertions(+) create mode 100644 layouts/community/66_ansi/layout.json create mode 100644 layouts/community/66_ansi/mechmerlin/keymap.c create mode 100644 layouts/community/66_ansi/readme.md diff --git a/layouts/community/66_ansi/layout.json b/layouts/community/66_ansi/layout.json new file mode 100644 index 0000000000..60a3a47c00 --- /dev/null +++ b/layouts/community/66_ansi/layout.json @@ -0,0 +1,5 @@ +["~\n`","!\n1","@\n2","#\n3","$\n4","%\n5","^\n6","&\n7","*\n8","(\n9",")\n0","_\n-","+\n=",{w:2},"Backspace",{x:0.5},"Page Up"], +[{w:1.5},"Tab","Q","W","E","R","T","Y","U","I","O","P","{\n[","}\n]",{w:1.5},"|\n\\",{x:0.5},"Page Down"], +[{w:1.75},"Caps Lock","A","S","D","F","G","H","J","K","L",":\n;","\"\n'",{w:2.25},"Enter"], +[{w:2.25},"Shift","Z","X","C","V","B","N","M","<\n,",">\n.","?\n/",{w:2.25},"Shift","Up"], +[{w:1.25},"Ctrl",{w:1.25},"Win",{w:1.25},"Alt",{a:7,w:6.25},"",{a:4,w:1.25},"Alt","Fn",{w:1.25},"Ctrl","Left","Down","Right"] diff --git a/layouts/community/66_ansi/mechmerlin/keymap.c b/layouts/community/66_ansi/mechmerlin/keymap.c new file mode 100644 index 0000000000..9baf238c73 --- /dev/null +++ b/layouts/community/66_ansi/mechmerlin/keymap.c @@ -0,0 +1,36 @@ +#include QMK_KEYBOARD_H + +// 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. +#define _BL 0 +#define _FL 1 +#define _CL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT_66_ansi( + KC_GESC,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_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_PGDN, \ + KC_LCTL,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_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, MO(_FL),KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT_66_ansi( + KC_GRV, 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_DEL, KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \ + KC_CAPS,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLU,KC_VOLD,_______, _______, KC_PGUP, \ + _______,_______,_______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END), + + /* Keymap _CL: Control layer + */ +[_CL] = LAYOUT_66_ansi( + BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \ + RGB_TOG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ + _______,_______,_______, RGB_MOD, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI), +}; diff --git a/layouts/community/66_ansi/readme.md b/layouts/community/66_ansi/readme.md new file mode 100644 index 0000000000..7dee7387ab --- /dev/null +++ b/layouts/community/66_ansi/readme.md @@ -0,0 +1,3 @@ +# 66_ansi + + LAYOUT_66_ansi -- cgit v1.2.3 From 85659ae5e1b41af4889f154dcc47d4bc9c1f0a19 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Sat, 11 Aug 2018 08:31:35 -0700 Subject: add layout support to clueboard --- keyboards/clueboard/66/rules.mk | 2 ++ keyboards/clueboard/66_hotswap/rules.mk | 2 ++ 2 files changed, 4 insertions(+) diff --git a/keyboards/clueboard/66/rules.mk b/keyboards/clueboard/66/rules.mk index 11f391c3f1..c5f8b5c112 100644 --- a/keyboards/clueboard/66/rules.mk +++ b/keyboards/clueboard/66/rules.mk @@ -21,3 +21,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +LAYOUTS = 66_ansi diff --git a/keyboards/clueboard/66_hotswap/rules.mk b/keyboards/clueboard/66_hotswap/rules.mk index 1a22696e48..1fc5f89fac 100644 --- a/keyboards/clueboard/66_hotswap/rules.mk +++ b/keyboards/clueboard/66_hotswap/rules.mk @@ -21,3 +21,5 @@ RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID + +LAYOUTS = 66_ansi -- cgit v1.2.3 From 98b16b3294e4b04e6621daba8cff07fbd982f335 Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 11 Aug 2018 11:16:21 -0700 Subject: Comment and organize build_keyboard.mk a bit --- build_keyboard.mk | 81 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 53 insertions(+), 28 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index b25712385c..9f6c42ea15 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -1,3 +1,9 @@ +# Determine what keyboard we are building and setup the build environment. +# +# We support folders up to 5 levels deep below `keyboards/`. This file is +# responsible for determining which folder is being used and doing the +# corresponding environment setup. + ifndef VERBOSE .SILENT: endif @@ -6,26 +12,15 @@ endif include common.mk -# 5/4/3/2/1 -KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) -KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) -KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2))) -KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3))) -KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4))) -KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1)) -KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2)) -KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3)) -KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4)) -KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5)) - +# Set the filename for the final firmware binary KEYBOARD_FILESAFE := $(subst /,_,$(KEYBOARD)) - TARGET ?= $(KEYBOARD_FILESAFE)_$(KEYMAP) KEYBOARD_OUTPUT := $(BUILD_DIR)/obj_$(KEYBOARD_FILESAFE) # Force expansion TARGET := $(TARGET) +# For split boards we need to set a master half. MASTER ?= left ifdef master MASTER = $(master) @@ -39,35 +34,58 @@ $(error MASTER does not have a valid value(left/right)) endif endif +# Determine which subfolders exist. +KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) +KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) +KEYBOARD_FOLDER_PATH_3 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_2))) +KEYBOARD_FOLDER_PATH_4 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_3))) +KEYBOARD_FOLDER_PATH_5 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_4))) +KEYBOARD_FOLDER_1 := $(notdir $(KEYBOARD_FOLDER_PATH_1)) +KEYBOARD_FOLDER_2 := $(notdir $(KEYBOARD_FOLDER_PATH_2)) +KEYBOARD_FOLDER_3 := $(notdir $(KEYBOARD_FOLDER_PATH_3)) +KEYBOARD_FOLDER_4 := $(notdir $(KEYBOARD_FOLDER_PATH_4)) +KEYBOARD_FOLDER_5 := $(notdir $(KEYBOARD_FOLDER_PATH_5)) KEYBOARD_PATHS := - KEYBOARD_PATH_1 := keyboards/$(KEYBOARD_FOLDER_PATH_1) KEYBOARD_PATH_2 := keyboards/$(KEYBOARD_FOLDER_PATH_2) KEYBOARD_PATH_3 := keyboards/$(KEYBOARD_FOLDER_PATH_3) KEYBOARD_PATH_4 := keyboards/$(KEYBOARD_FOLDER_PATH_4) KEYBOARD_PATH_5 := keyboards/$(KEYBOARD_FOLDER_PATH_5) -ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","") +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","") KEYBOARD_PATHS += $(KEYBOARD_PATH_5) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","") + KEYBOARD_PATHS += $(KEYBOARD_PATH_4) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","") + KEYBOARD_PATHS += $(KEYBOARD_PATH_3) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","") + KEYBOARD_PATHS += $(KEYBOARD_PATH_2) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","") + KEYBOARD_PATHS += $(KEYBOARD_PATH_1) +endif + +# Pull in rules.mk files from all our subfolders +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/rules.mk)","") include $(KEYBOARD_PATH_5)/rules.mk endif ifneq ("$(wildcard $(KEYBOARD_PATH_4)/rules.mk)","") - KEYBOARD_PATHS += $(KEYBOARD_PATH_4) include $(KEYBOARD_PATH_4)/rules.mk endif ifneq ("$(wildcard $(KEYBOARD_PATH_3)/rules.mk)","") - KEYBOARD_PATHS += $(KEYBOARD_PATH_3) include $(KEYBOARD_PATH_3)/rules.mk endif ifneq ("$(wildcard $(KEYBOARD_PATH_2)/rules.mk)","") - KEYBOARD_PATHS += $(KEYBOARD_PATH_2) include $(KEYBOARD_PATH_2)/rules.mk endif ifneq ("$(wildcard $(KEYBOARD_PATH_1)/rules.mk)","") - KEYBOARD_PATHS += $(KEYBOARD_PATH_1) include $(KEYBOARD_PATH_1)/rules.mk endif +# Find all the C source files to be compiled in subfolders. KEYBOARD_SRC := KEYBOARD_C_1 := $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).c @@ -95,6 +113,15 @@ endif OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE) +# Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so +# that the same keymap may be used on multiple keyboards. +# +# We grab the most top-level include file that we can. That file should +# use #ifdef statements to include all the neccesary subfolder includes, +# as described here: +# +# https://docs.qmk.fm/#/feature_layouts?id=tips-for-making-layouts-keyboard-agnostic +# ifneq ("$(wildcard $(KEYBOARD_PATH_1)/$(KEYBOARD_FOLDER_1).h)","") QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_1).h endif @@ -111,13 +138,15 @@ ifneq ("$(wildcard $(KEYBOARD_PATH_5)/$(KEYBOARD_FOLDER_5).h)","") QMK_KEYBOARD_H = $(KEYBOARD_FOLDER_5).h endif -# We can assume a ChibiOS target When MCU_FAMILY is defined , since it's not used for LUFA +# Determine and set parameters based on the keyboard's processor family. +# We can assume a ChibiOS target When MCU_FAMILY is defined since it's +# not used for LUFA ifdef MCU_FAMILY - FIRMWARE_FORMAT=bin + FIRMWARE_FORMAT?=bin PLATFORM=CHIBIOS else PLATFORM=AVR - FIRMWARE_FORMAT=hex + FIRMWARE_FORMAT?=hex endif ifeq ($(PLATFORM),CHIBIOS) @@ -148,6 +177,7 @@ ifeq ($(PLATFORM),CHIBIOS) endif endif +# Find all of the config.h files and add them to our CONFIG_H define. CONFIG_H := ifneq ("$(wildcard $(KEYBOARD_PATH_5)/config.h)","") CONFIG_H += $(KEYBOARD_PATH_5)/config.h @@ -203,7 +233,7 @@ else # this state should never be reached endif -# User space stuff +# Userspace setup and definitions ifeq ("$(USER_NAME)","") USER_NAME := $(KEYMAP) endif @@ -283,11 +313,6 @@ $(KEYBOARD_OUTPUT)_CONFIG := $(PROJECT_CONFIG) # Default target. all: build check-size - -# Change the build target to build a HEX file or a library. build: elf cpfirmware -#build: elf hex eep lss sym -#build: lib - include $(TMK_PATH)/rules.mk -- cgit v1.2.3 From 9c8f8bd3bcfebf93ded0269ca1ba9e99720bc4b4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 9 Aug 2018 21:14:29 -0700 Subject: Fix minor typo in qmk_install.sh for MSYS/MINGW64 detection --- util/qmk_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 5a1a38fce5..67be6f4778 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -10,7 +10,7 @@ case $(uname) in Linux) exec "${util_dir}/linux_install.sh" ;; - MSYS_NT*|MINGW_64*) + MSYS_NT*|MINGW64_NT*) exec "${util_dir}/msys2_install.sh" ;; esac -- cgit v1.2.3 From 99cb107b717d75acae4278d62dfd2f400e0de600 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:47:25 -0700 Subject: Add 32 bit MINGW support .... --- util/qmk_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 67be6f4778..dcfa894b90 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -10,7 +10,7 @@ case $(uname) in Linux) exec "${util_dir}/linux_install.sh" ;; - MSYS_NT*|MINGW64_NT*) + MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; esac -- cgit v1.2.3 From bcdd7735c8fca998d7d609ebb4be22ee29b6e340 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:52:09 -0700 Subject: Add error message if config not detected --- util/qmk_install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index dcfa894b90..fede835dbc 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -13,4 +13,6 @@ case $(uname) in MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; + *) + echo "Environment not support. Pleas see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools" esac -- cgit v1.2.3 From bd4ba8d1808b11deaf3298cec9a1573fbd5e9cdf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 12:59:26 -0700 Subject: Add WSL support to script --- util/qmk_install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index fede835dbc..fefbc6f861 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -3,11 +3,14 @@ util_dir=$(dirname "$0") -case $(uname) in - Darwin) +case $(uname -a) in + *Darwin*) exec "${util_dir}/macos_install.sh" ;; - Linux) + *Linux*Microsoft*) + exec "${util_dir}/wsl_install.sh" + ;; + *Linux*) exec "${util_dir}/linux_install.sh" ;; MSYS_NT*|MINGW64_NT*|MINGW32_NT*) -- cgit v1.2.3 From c909c4ea50ee6cef77e54f746c11f2c896181e48 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 11 Aug 2018 13:01:01 -0700 Subject: Fix Typos in echo --- util/qmk_install.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util/qmk_install.sh b/util/qmk_install.sh index fefbc6f861..6f35e4c71b 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -17,5 +17,6 @@ case $(uname -a) in exec "${util_dir}/msys2_install.sh" ;; *) - echo "Environment not support. Pleas see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools" + echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." + ;; esac -- cgit v1.2.3 From 8e50a472ab2a6740f7659807cf6dd70c15fdf641 Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 11 Aug 2018 12:14:02 -0700 Subject: Make both RGB and sound work on Clueboard 66% hotswap --- keyboards/clueboard/66_hotswap/66_hotswap.h | 7 +------ keyboards/clueboard/66_hotswap/config.h | 15 +++------------ keyboards/clueboard/66_hotswap/gen1/config.h | 10 ++++------ keyboards/clueboard/66_hotswap/gen1/gen1.h | 8 ++------ keyboards/clueboard/66_hotswap/gen1/rules.mk | 25 ++++++++++++++++++++++++- keyboards/clueboard/66_hotswap/readme.md | 4 ++-- keyboards/clueboard/66_hotswap/rules.mk | 25 ------------------------- 7 files changed, 36 insertions(+), 58 deletions(-) delete mode 100644 keyboards/clueboard/66_hotswap/rules.mk diff --git a/keyboards/clueboard/66_hotswap/66_hotswap.h b/keyboards/clueboard/66_hotswap/66_hotswap.h index 61c6fe3594..9367c26337 100644 --- a/keyboards/clueboard/66_hotswap/66_hotswap.h +++ b/keyboards/clueboard/66_hotswap/66_hotswap.h @@ -1,10 +1,5 @@ -#ifndef CLUEBOARD_H -#define CLUEBOARD_H - -#include "quantum.h" +#pragma once #ifdef KEYBOARD_clueboard_66_hotswap_gen1 #include "gen1.h" #endif - -#endif diff --git a/keyboards/clueboard/66_hotswap/config.h b/keyboards/clueboard/66_hotswap/config.h index 59a0abc7f5..97da92cfd4 100644 --- a/keyboards/clueboard/66_hotswap/config.h +++ b/keyboards/clueboard/66_hotswap/config.h @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CLUEBOARD_66_CONFIG_H -#define CLUEBOARD_66_CONFIG_H - +#pragma once #include "config_common.h" /* USB Device descriptor parameter */ @@ -47,17 +45,10 @@ along with this program. If not, see . * 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_ONESHOT +#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/clueboard/66_hotswap/gen1/config.h b/keyboards/clueboard/66_hotswap/gen1/config.h index d8163f5383..14188634b3 100644 --- a/keyboards/clueboard/66_hotswap/gen1/config.h +++ b/keyboards/clueboard/66_hotswap/gen1/config.h @@ -1,6 +1,4 @@ -#ifndef CLUEBOARD_66_REV3_CONFIG_H -#define CLUEBOARD_66_REV3_CONFIG_H - +#pragma once #include "config_common.h" #define PRODUCT_ID 0x2390 @@ -26,7 +24,9 @@ /* Speaker configuration */ -//#define SPEAKER_PIN B7 // FIXME: find the correct name for this define +#define B7_AUDIO +#define NO_MUSIC_MODE +#define AUDIO_CLICKY /* Backlight configuration */ @@ -49,5 +49,3 @@ #define RGBLIGHT_EFFECT_KNIGHT_OFFSET 16 // The led to start at #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 8 // How many LEDs to travel #define RGBLIGHT_EFFECT_SNAKE_LENGTH 4 // How many LEDs wide to light up - -#endif diff --git a/keyboards/clueboard/66_hotswap/gen1/gen1.h b/keyboards/clueboard/66_hotswap/gen1/gen1.h index 293620ac0f..2d0a9d3977 100644 --- a/keyboards/clueboard/66_hotswap/gen1/gen1.h +++ b/keyboards/clueboard/66_hotswap/gen1/gen1.h @@ -1,7 +1,5 @@ -#ifndef gen1_H -#define gen1_H - -#include "66_hotswap.h" +#pragma once +#include "quantum.h" /* Clueboard matrix layout * ,-----------------------------------------------------------. ,---. @@ -67,5 +65,3 @@ { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ } - -#endif diff --git a/keyboards/clueboard/66_hotswap/gen1/rules.mk b/keyboards/clueboard/66_hotswap/gen1/rules.mk index 54a2685bf6..887592b373 100644 --- a/keyboards/clueboard/66_hotswap/gen1/rules.mk +++ b/keyboards/clueboard/66_hotswap/gen1/rules.mk @@ -1 +1,24 @@ -BACKLIGHT_ENABLE = yes \ No newline at end of file +EXTRAFLAGS += -flto +LAYOUTS = 66_ansi +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = yes +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = no +NKRO_ENABLE = yes +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = yes +MIDI_ENABLE = no +UNICODE_ENABLE = no +BLUETOOTH_ENABLE = no diff --git a/keyboards/clueboard/66_hotswap/readme.md b/keyboards/clueboard/66_hotswap/readme.md index 2ae46b84c5..014c761b02 100644 --- a/keyboards/clueboard/66_hotswap/readme.md +++ b/keyboards/clueboard/66_hotswap/readme.md @@ -4,10 +4,10 @@ A fully customizable 66% keyboard with Hot Swap sockets. -* Keyboard Maintainer: [Zach White](https://github.com/skullydazed) +* Keyboard Maintainer: [Zach White](https://github.com/skullydazed) * Hardware Supported: Clueboard 66% HotSwap PCB * 2.9 -* Hardware Availability: [clueboard.co](https://clueboard.co/) +* Hardware Availability: [clueboard.co](https://clueboard.co/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/clueboard/66_hotswap/rules.mk b/keyboards/clueboard/66_hotswap/rules.mk deleted file mode 100644 index 1fc5f89fac..0000000000 --- a/keyboards/clueboard/66_hotswap/rules.mk +++ /dev/null @@ -1,25 +0,0 @@ -DEFAULT_FOLDER = clueboard/66_hotswap/gen1 -LAYOUTS = 66_ansi -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # 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 # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID - -LAYOUTS = 66_ansi -- cgit v1.2.3 From e5f201edb426b01537abd659e1ca317260d87654 Mon Sep 17 00:00:00 2001 From: Biacco42 Date: Sun, 12 Aug 2018 05:22:32 +0900 Subject: Keymap: Port ergo42/biacco keymap to Helix pico (#3585) * Port ergo42/biacco keymap to Helix pico * Fix for review --- keyboards/helix/pico/keymaps/biacco/config.h | 29 +++++++ keyboards/helix/pico/keymaps/biacco/keymap.c | 118 +++++++++++++++++++++++++ keyboards/helix/pico/keymaps/biacco/rules.mk | 125 +++++++++++++++++++++++++++ 3 files changed, 272 insertions(+) create mode 100644 keyboards/helix/pico/keymaps/biacco/config.h create mode 100644 keyboards/helix/pico/keymaps/biacco/keymap.c create mode 100644 keyboards/helix/pico/keymaps/biacco/rules.mk diff --git a/keyboards/helix/pico/keymaps/biacco/config.h b/keyboards/helix/pico/keymaps/biacco/config.h new file mode 100644 index 0000000000..776eecfb64 --- /dev/null +++ b/keyboards/helix/pico/keymaps/biacco/config.h @@ -0,0 +1,29 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define AUDIO_CLICKY +#endif + diff --git a/keyboards/helix/pico/keymaps/biacco/keymap.c b/keyboards/helix/pico/keymaps/biacco/keymap.c new file mode 100644 index 0000000000..b4ee4fcaa9 --- /dev/null +++ b/keyboards/helix/pico/keymaps/biacco/keymap.c @@ -0,0 +1,118 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + BASE = 0, + META, + SYMB, + GAME +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Alt | A | S | D | F | G | | H | J | K | L | ; | : | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Ctrl | GUI | App | PrtSc| ESC/ |Space/|Tab/ |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | | ~SYMB|RCtrl |Shift |Space |~META | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + +[BASE] = LAYOUT( \ + 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_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO) , \ + KC_LCTL, KC_LGUI, KC_APP, KC_PSCR, LT(SYMB, KC_ESC), RCTL_T(KC_SPC), SFT_T(KC_TAB), KC_BSPC, LT(META, KC_ENT), KC_DELT, KC_PSCR, TG(GAME), TG(SYMB), KC_JYEN \ + ), + + /* META + * ,-----------------------------------------. ,-----------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | | 7 | 8 | 9 | 0 | - | ^ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Alt | F1 | |Muhen | Henk | | | Left | Down | Up |Right | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Sft | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 |\/Sft | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ |Back |Enter/| Del |Reset |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift |Space |~META | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [META] = LAYOUT( \ + 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_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, \ + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, SFT_T(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ + ), + + /* SYMB + * ,-----------------------------------------. ,-----------------------------------------. + * | ! | " | # | $ | % | & | | ' | ( | ) | ~ | = | ~ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Alt | | | | | | | ( | ) | { | } | + | * | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Sft | | | | | | | [ | ] | < | > | ? | \ | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift |Space |~META | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [SYMB] = LAYOUT( \ + S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), S(KC_MINS), S(KC_EQL), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_8), S(KC_9), S(KC_RBRC), S(KC_BSLS), S(KC_SCLN), S(KC_QUOT), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_RBRC, KC_BSLS, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* GAME + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Alt | A | S | D | F | G | | H | J | K | L | ; | : | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc | ESC |Space |Tab |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | | | | |Space | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [GAME] = LAYOUT( \ + 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_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \ + ) + +}; diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk new file mode 100644 index 0000000000..0a720002d7 --- /dev/null +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -0,0 +1,125 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +AUDIO_ENABLE = yes # Audio output on port B5 +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. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define HELIX_CUSTOMISE_MSG + $(info Helix customize) + $(info - OLED_ENABLE=$(OLED_ENABLE)) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Helix keyboard customize +# you can edit follows 6 Variables +# jp: 以下の6つの変数を必要に応じて編集します。 +OLED_ENABLE = no # OLED_ENABLE +LOCAL_GLCDFONT = no # use each keymaps "helixfont.h" insted of "common/glcdfont.c" +LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) +LED_ANIMATIONS = no # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Helix keyboard 'default' keymap: convenient command line option +## make HELIX= helix:defualt +## option= oled | back | under | na | ios +## ex. +## make HELIX=oled helix:defualt +## make HELIX=oled,back helix:defualt +## make HELIX=oled,under helix:defualt +## make HELIX=oled,back,na helix:defualt +## make HELIX=oled,back,ios helix:defualt +## +ifneq ($(strip $(HELIX)),) + ifeq ($(findstring oled,$(HELIX)), oled) + OLED_ENABLE = yes + endif + ifeq ($(findstring back,$(HELIX)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(HELIX)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(HELIX)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(HELIX)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(info ) +endif + +# Uncomment these for checking +# jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 +# $(eval $(call HELIX_CUSTOMISE_MSG)) +# $(info ) + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + Link_Time_Optimization = yes + endif + ifeq ($(strip $(OLED_ENABLE)),yes) + Link_Time_Optimization = yes + endif +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) -- cgit v1.2.3 From 317c624761741f71856f20ab55916e637183edb4 Mon Sep 17 00:00:00 2001 From: Nicholas Shaff Date: Sat, 11 Aug 2018 15:23:11 -0500 Subject: Keyboard: Six Shooter Keyboard (#3598) * Created base sixshooter configuration * Added SixShooter basic LED on/off support. * Updated LED identifier numbers to align with layout identifiers (and IDs on PCB). * Minor sixshooter documentation cleanup. * Added sixshooter info.json file. * Moved sixshooter custom keycodes out of keymaps and into base keyboard files, small documentation tweaks. * Removed unnecessary boot section size definition. * Removing CONFIG_H if/define and replacing with #pragma once. --- keyboards/sixshooter/config.h | 128 +++++++++++++++++++++++++ keyboards/sixshooter/info.json | 13 +++ keyboards/sixshooter/keymaps/default/keymap.c | 42 ++++++++ keyboards/sixshooter/keymaps/default/readme.md | 1 + keyboards/sixshooter/readme.md | 13 +++ keyboards/sixshooter/rules.mk | 64 +++++++++++++ keyboards/sixshooter/sixshooter.c | 57 +++++++++++ keyboards/sixshooter/sixshooter.h | 55 +++++++++++ 8 files changed, 373 insertions(+) create mode 100644 keyboards/sixshooter/config.h create mode 100644 keyboards/sixshooter/info.json create mode 100644 keyboards/sixshooter/keymaps/default/keymap.c create mode 100644 keyboards/sixshooter/keymaps/default/readme.md create mode 100644 keyboards/sixshooter/readme.md create mode 100644 keyboards/sixshooter/rules.mk create mode 100644 keyboards/sixshooter/sixshooter.c create mode 100644 keyboards/sixshooter/sixshooter.h diff --git a/keyboards/sixshooter/config.h b/keyboards/sixshooter/config.h new file mode 100644 index 0000000000..163a3ab431 --- /dev/null +++ b/keyboards/sixshooter/config.h @@ -0,0 +1,128 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6666 +#define DEVICE_VER 0x0001 +#define MANUFACTURER bpiphany +#define PRODUCT sixshooter +#define DESCRIPTION A PCB for the CM Storm switch tester utilizing a Teensy 2.0. + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { } +#define MATRIX_COL_PINS { F7, F6, F1, F5, F4, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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/sixshooter/info.json b/keyboards/sixshooter/info.json new file mode 100644 index 0000000000..79044589da --- /dev/null +++ b/keyboards/sixshooter/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "SixShooter", + "maintainer": "qmk", + "url": "https://geekhack.org/index.php?topic=70033.0", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "key_count": 6, + "layout": [{"label":"K00", "x":0, "y":0}, {"label":"K01", "x":1, "y":0}, {"label":"K02", "x":2, "y":0}, {"label":"K03", "x":0, "y":1}, {"label":"K04", "x":1, "y":1}, {"label":"K05", "x":2, "y":1}] + } + } +} diff --git a/keyboards/sixshooter/keymaps/default/keymap.c b/keyboards/sixshooter/keymaps/default/keymap.c new file mode 100644 index 0000000000..ca0973c60b --- /dev/null +++ b/keyboards/sixshooter/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2018 QMK Community + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Media Keys + * ,-----------. + * |Mut| V-| V+| + * |---+---+---| + * |Prv|Ply|Nxt| + * `-----------' + */ + [_BL] = LAYOUT( /* Base */ + MO(_FN), KC_VOLD, KC_VOLU, \ + KC_MPRV, KC_MPLY, KC_MNXT \ + ), + [_FN] = LAYOUT( + KC_TRNS, SS_LON, SS_LOFF, \ + KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +void matrix_init_user(void) { + /* Default all LEDs to on */ + sixshooter_led_all_on(); +} diff --git a/keyboards/sixshooter/keymaps/default/readme.md b/keyboards/sixshooter/keymaps/default/readme.md new file mode 100644 index 0000000000..050a6f2341 --- /dev/null +++ b/keyboards/sixshooter/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for sixshooter diff --git a/keyboards/sixshooter/readme.md b/keyboards/sixshooter/readme.md new file mode 100644 index 0000000000..18229bdbf6 --- /dev/null +++ b/keyboards/sixshooter/readme.md @@ -0,0 +1,13 @@ +# The Six Shooter + +A PCB for the CM Storm switch tester utilizing a Teensy 2.0 designed by Bpiphany. Because the PCB was designed with individual pins for each LED, there are custom keycodes (`SS_LON` and `SS_LOFF`) for turning on and off the backlight LEDs. + +Keyboard Maintainer: QMK Community\ +Hardware Supported: Six Shooter PCB, Teensy 2.0\ +Hardware Availability: [GeekHack.org](https://geekhack.org/index.php?topic=70033.0) + +Make example for this keyboard (after setting up your build environment): + + make sixshooter:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/sixshooter/rules.mk b/keyboards/sixshooter/rules.mk new file mode 100644 index 0000000000..5bf8d21650 --- /dev/null +++ b/keyboards/sixshooter/rules.mk @@ -0,0 +1,64 @@ +# MCU name +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 +# 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 = halfkay + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 diff --git a/keyboards/sixshooter/sixshooter.c b/keyboards/sixshooter/sixshooter.c new file mode 100644 index 0000000000..814d219a29 --- /dev/null +++ b/keyboards/sixshooter/sixshooter.c @@ -0,0 +1,57 @@ +#include "sixshooter.h" + +extern inline void sixshooter_led_0_on(void); +extern inline void sixshooter_led_1_on(void); +extern inline void sixshooter_led_2_on(void); +extern inline void sixshooter_led_3_on(void); +extern inline void sixshooter_led_4_on(void); +extern inline void sixshooter_led_5_on(void); + +extern inline void sixshooter_led_0_off(void); +extern inline void sixshooter_led_1_off(void); +extern inline void sixshooter_led_2_off(void); +extern inline void sixshooter_led_3_off(void); +extern inline void sixshooter_led_4_off(void); +extern inline void sixshooter_led_5_off(void); + +extern inline void sixshooter_led_all_on(void); +extern inline void sixshooter_led_all_off(void); + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + if (record->event.pressed) { + + /* Check for custom keycodes for turning on and off LEDs */ + switch(keycode) { + case SS_LON: + sixshooter_led_all_on(); + return false; + case SS_LOFF: + sixshooter_led_all_off(); + return false; + } + } + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/sixshooter/sixshooter.h b/keyboards/sixshooter/sixshooter.h new file mode 100644 index 0000000000..d27b1e419c --- /dev/null +++ b/keyboards/sixshooter/sixshooter.h @@ -0,0 +1,55 @@ +#ifndef SIXSHOOTER_H +#define SIXSHOOTER_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, \ + K03, K04, K05 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ +} + + +/* + * Define keyboard specific keycodes for controlling on/off for all LEDs as they + * are all on different pins with this PCB, rather than a single backlight pin + */ +enum keyboard_keycode { + SS_LON = SAFE_RANGE, + SS_LOFF, + SAFE_RANGE_KB +}; + +inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } +inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); } +inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); } +inline void sixshooter_led_3_on(void) { DDRB |= (1<<5); PORTB |= (1<<5); } +inline void sixshooter_led_4_on(void) { DDRD |= (1<<7); PORTD |= (1<<7); } +inline void sixshooter_led_5_on(void) { DDRB |= (1<<7); PORTB |= (1<<7); } + +inline void sixshooter_led_0_off(void) { DDRB &= ~(1<<6); PORTB &= ~(1<<6); } +inline void sixshooter_led_1_off(void) { DDRC &= ~(1<<7); PORTC &= ~(1<<7); } +inline void sixshooter_led_2_off(void) { DDRD &= ~(1<<0); PORTD &= ~(1<<0); } +inline void sixshooter_led_3_off(void) { DDRB &= ~(1<<5); PORTB &= ~(1<<5); } +inline void sixshooter_led_4_off(void) { DDRD &= ~(1<<7); PORTD &= ~(1<<7); } +inline void sixshooter_led_5_off(void) { DDRB &= ~(1<<7); PORTB &= ~(1<<7); } + +inline void sixshooter_led_all_on(void) { + sixshooter_led_0_on(); + sixshooter_led_1_on(); + sixshooter_led_2_on(); + sixshooter_led_3_on(); + sixshooter_led_4_on(); + sixshooter_led_5_on(); +} +inline void sixshooter_led_all_off(void) { + sixshooter_led_0_off(); + sixshooter_led_1_off(); + sixshooter_led_2_off(); + sixshooter_led_3_off(); + sixshooter_led_4_off(); + sixshooter_led_5_off(); +} + +#endif -- cgit v1.2.3 From a1568b99728a7c80f04dd18fe5c81a442b6ccc6c Mon Sep 17 00:00:00 2001 From: tong92 Date: Sun, 12 Aug 2018 05:24:06 +0900 Subject: Keymap: Add mac layout (#3607) - tv44 - planck --- keyboards/planck/keymaps/tong92/keymap.c | 168 ++++++++++++++++++++----------- keyboards/tv44/keymaps/tong92/keymap.c | 155 ++++++++++++++++++++-------- 2 files changed, 220 insertions(+), 103 deletions(-) diff --git a/keyboards/planck/keymaps/tong92/keymap.c b/keyboards/planck/keymaps/tong92/keymap.c index 60c8d793be..b9cd24c011 100644 --- a/keyboards/planck/keymaps/tong92/keymap.c +++ b/keyboards/planck/keymaps/tong92/keymap.c @@ -1,22 +1,39 @@ //Author: tong92 -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif +enum planck_layers { + _WINDOW, + _MAC, + _LOWER, + _RAISE, + _WINDOW_SHORTCUT, + _MAC_SHORTCUT, + _MOUSE +}; + +enum planck_keycodes { + WINDOW = SAFE_RANGE, + MAC, + MOUSE, + BACKLIT, + EXT_MOUSE +}; + // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO #define LOWER M(1) #define RAISE M(2) -#define GO_DEFT M(99) -# +#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) +#define MAC_SHORTCUT MO(_MAC_SHORTCUT) //MIT Layout const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* 0: Qwerty layer (Default) +/* Window - Qwerty * ,-----------------------------------------------------------------------. * |Tab | q | w | e | r | t | y | u | i | o | p | BS | * |-----------------------------------------------------------------------| @@ -27,13 +44,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn |Ctrl | Win | Alt |Lower| Space |Upper| ' | [ | ] | Alt | * `-----------------------------------------------------------------------' */ -[0] ={ +[_WINDOW] ={ {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, {KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT }, {KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT}, -{MO(4), KC_RCTL,KC_LGUI,KC_LALT,LOWER,KC_SPC,KC_SPC,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT} +{WINDOW_SHORTCUT, KC_RCTL,KC_LGUI,KC_LALT,LOWER,KC_SPC,KC_SPC,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT} }, -/* 1: Lower layer +/* Mac - Qwerty +* ,-----------------------------------------------------------------------. +* |Tab | q | w | e | r | t | y | u | i | o | p | BS | +* |-----------------------------------------------------------------------| +* |LComd| a | s | d | f | g | h | j | k | l | ; |enter| +* |-----------------------------------------------------------------------| +* |Shift| z | x | c | v | b | n | m | , | . | / |Shift| +* |-----------------------------------------------------------------------| +* | Fn |Lang |Ctrl | Alt |Lower| Space |Upper| ' | [ | ] |SPOT | +* `-----------------------------------------------------------------------' +*/ +[_MAC] ={ +{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, +{KC_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT }, +{KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT}, +{MAC_SHORTCUT, LCTL(KC_SPC),KC_LCTL,KC_LALT,LOWER,KC_SPC,KC_SPC,RAISE,KC_QUOT,KC_LBRC,KC_RBRC,LGUI(KC_SPC)} +}, +/* LOWER * ,-----------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | BS | * |-----------------------------------------------------------------------| @@ -41,16 +75,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------| * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| * |-----------------------------------------------------------------------| -* | | | | | | SPACE |mouse| END | LEFT| DOWN|RIGHT| +* | | | | | | SPACE | | END | LEFT| DOWN|RIGHT| * `-----------------------------------------------------------------------' */ -[1] ={ +[_LOWER] ={ {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, {_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS }, {_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,KC_F12,_______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN }, {XXXXXXX,_______,_______,_______,_______,KC_SPC,KC_SPC,_______,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT} }, -/* 2: Upper layer +/* RAISE * ,-----------------------------------------------------------------------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | BS | * |-----------------------------------------------------------------------| @@ -58,16 +92,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------| * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| * |-----------------------------------------------------------------------| -* | | | | |mouse| SPACE | | END | LEFT| DOWN|RIGHT| +* | | | | | | SPACE | | END | LEFT| DOWN|RIGHT| * `-----------------------------------------------------------------------' */ -[2] ={ +[_RAISE] ={ {KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSPC }, {_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE }, {_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN }, {XXXXXXX,_______,_______,_______,_______,KC_SPC, KC_SPC, _______,KC_END, KC_LEFT,KC_DOWN,KC_RIGHT} }, -/* 4: fn layer (Window shortcuts) +/* Window Shortcut * ,-----------------------------------------------------------------------. * | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DEL | * |-----------------------------------------------------------------------| @@ -78,11 +112,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |DeskL|DeskR|DeskX|Task | ChangeLang| | | | | LED | * `-----------------------------------------------------------------------' */ -[4] ={ +[_WINDOW_SHORTCUT] ={ {KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX ,S(KC_CAPS) ,XXXXXXX,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_DELT}, {_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT) ,XXXXXXX ,LALT(KC_CAPS),KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX}, {_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX ,LCTL(KC_CAPS),KC_SLCK,KC_HOME,XXXXXXX,KC_END,XXXXXXX,XXXXXXX}, -{KC_TRNS,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)),LGUI(LCTL(KC_F4)),LCTL(LALT(KC_DELT)),LGUI(KC_SPC),LGUI(KC_SPC),XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,M(0)} +{KC_TRNS,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)),LGUI(LCTL(KC_F4)),LCTL(LALT(KC_DELT)),LGUI(KC_SPC),LGUI(KC_SPC),XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,BACKLIT} +}, +/* Mac Shortcut +* ,-----------------------------------------------------------------------. +* | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DEL | +* |-----------------------------------------------------------------------| +* | |WBlkL|WBlkR| |ScrF | |CapsL| LEFT| DOWN|RIGHT| | | +* |-----------------------------------------------------------------------| +* | |BlckL|BlckR| | | | | HOME| | END | | | +* |-----------------------------------------------------------------------| +* | | | | | | MOUSE | | | | | LED | +* `-----------------------------------------------------------------------' +*/ +[_MAC_SHORTCUT] ={ +{KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX,XXXXXXX ,XXXXXXX,XXXXXXX,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,KC_DELT}, +{_______,LALT(LSFT(KC_LEFT)),LALT(LSFT(KC_RIGHT)),XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX,KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX}, +{_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX,XXXXXXX ,XXXXXXX,XXXXXXX,KC_HOME,XXXXXXX,KC_END,XXXXXXX,XXXXXXX}, +{KC_TRNS,_______ ,_______ ,MOUSE ,MOUSE ,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,BACKLIT} }, /* 10: mouse layer * ,-----------------------------------------------------------------------. @@ -90,58 +141,55 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------| * | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | * |-----------------------------------------------------------------------| -* | | | | | | | |M_AC0|M_AC1|M_AC2| | | +* | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO| * |-----------------------------------------------------------------------| -* | | | | | | GO_DEFT | | | | | | +* | | | | | | GO_DEFT | | | | | MAC | * `-----------------------------------------------------------------------' */ -[10] ={ +[_MOUSE] ={ {XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,RESET}, {XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX}, -{XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,XXXXXXX}, -{XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,GO_DEFT,GO_DEFT,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX} +{XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW}, +{XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,EXT_MOUSE,EXT_MOUSE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,MAC} } - }; -//Layout END -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } - break; - case 1: - if (record->event.pressed) { - layer_on(1); - update_tri_layer(1, 2, 10); - } else { - layer_off(1); - update_tri_layer(1, 2, 10); - } - break; - case 2: - if (record->event.pressed) { - layer_on(2); - update_tri_layer(1, 2, 10); - } else { - layer_off(2); - update_tri_layer(1, 2, 10); - } - break; - case 99: - if (record->event.pressed) { - layer_off(10); - layer_off(1); - layer_off(2); - layer_on(0); - update_tri_layer(0 ,1 ,2); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case WINDOW: + if (record->event.pressed) { + set_single_persistent_default_layer(_WINDOW); + } + return false; + break; + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } + return false; + break; + case EXT_MOUSE: + if (record->event.pressed) { + layer_off(_MOUSE); + layer_off(_WINDOW_SHORTCUT); + layer_off(_MAC_SHORTCUT); } - return MACRO_NONE; + return false; + break; + } + return true; }; diff --git a/keyboards/tv44/keymaps/tong92/keymap.c b/keyboards/tv44/keymaps/tong92/keymap.c index a8c101b646..758c3bb15c 100644 --- a/keyboards/tv44/keymaps/tong92/keymap.c +++ b/keyboards/tv44/keymaps/tong92/keymap.c @@ -7,18 +7,37 @@ #include "backlight.h" #endif +extern keymap_config_t keymap_config; + +enum tv44_layers { + _WINDOW, + _MAC, + _LOWER, + _RAISE, + _WINDOW_SHORTCUT, + _MAC_SHORTCUT, + _MOUSE +}; + +enum tv44_keycodes { + WINDOW = SAFE_RANGE, + MAC, + MOUSE, + BACKLIT, + EXT_MOUSE +}; + // Fillers to make layering more clear #define _______ KC_TRNS -#define LOWER F(1) -#define RAISE F(2) -#define FTN MO(4) -#define MOUSE M(10) -#define GO_DEFT M(99) +#define LOWER F(_LOWER) +#define RAISE F(_RAISE) #define XXXXXXX KC_NO +#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) +#define MAC_SHORTCUT MO(_MAC_SHORTCUT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty +/* Window - Qwerty * ,--------------------------------------------------------------------------. * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| @@ -26,14 +45,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | Ftn1 | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | + * | Ft | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | * `--------------------------------------------------------------------------' */ -[0] = LAYOUT_arrow( +[_WINDOW] = LAYOUT_arrow( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, -FTN, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT +WINDOW_SHORTCUT, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT +), +/* Mac - Qwerty + * ,--------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | Cmd | A | S | D | F | G | H | J | K | L | ; | Enter| + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | Ft | Alt | Ctrl | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | + * `--------------------------------------------------------------------------' + */ +[_MAC] = LAYOUT_arrow( +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +KC_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, +KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, +MAC_SHORTCUT, KC_LALT, KC_LCTRL, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT ), /* LOWER * ,--------------------------------------------------------------------------. @@ -46,7 +82,7 @@ FTN, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_R * | | | | | | END | LEFT| Down|RIGHT| * `--------------------------------------------------------------------------' */ -[1] = LAYOUT_arrow( +[_LOWER] = LAYOUT_arrow( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS, _______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, @@ -63,13 +99,13 @@ XXXXXXX,_______,_______, _______,XXXXXXX, KC_END, KC_LEFT, * | | | | | | END | LEFT| Down|RIGHT| * `--------------------------------------------------------------------------' */ -[2] = LAYOUT_arrow( +[_RAISE] = LAYOUT_arrow( KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE, _______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, XXXXXXX,_______,_______, _______,_______, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT ), -/* FTN +/* Window Shortcut * ,--------------------------------------------------------------------------. * | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET | * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| @@ -80,11 +116,28 @@ XXXXXXX,_______,_______, _______,_______, KC_END, KC_LEFT, * | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED | * `--------------------------------------------------------------------------' */ -[4] = LAYOUT_arrow( +[_WINDOW_SHORTCUT] = LAYOUT_arrow( KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX,S(KC_CAPS) ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, _______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT),XXXXXXX,LALT(KC_CAPS) ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, _______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,LCTL(KC_CAPS) ,KC_SLCK ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, -_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LALT(KC_DELT)),LGUI(LCTL(KC_F4)), MOUSE ,XXXXXXX ,XXXXXXX,M(0) +_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LALT(KC_DELT)),LGUI(LCTL(KC_F4)), MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT +), +/* Mac Shortcut + * ,--------------------------------------------------------------------------. + * | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DELET | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | |WBlkL|WBlkR| |ScrFu| |CapsL| LEFT| DOWN|RIGHT| | | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | |BlckL|BlckR| | | | | HOME| | END | | Ctrl| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | | | | | MOUSE| | | LED | + * `--------------------------------------------------------------------------' + */ +[_MAC_SHORTCUT] = LAYOUT_arrow( +KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, +_______,LALT(LSFT(KC_LEFT)) ,LALT(LSFT(KC_RIGHT)) ,XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, +_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, +_______,_______,_______, _______,_______, MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT ), /* MOUSE * ,--------------------------------------------------------------------------. @@ -92,45 +145,61 @@ _______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LAL * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| * | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | | | | | | | |M_AC0|M_AC1|M_AC2| | | + * | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO| * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | | | GO_DEFAULT | GO_DEFAULT | | | | | + * | | | | GO_DEFAULT | GO_DEFAULT | | | | MAC | * `--------------------------------------------------------------------------' */ -[10] = LAYOUT_arrow( +[_MOUSE] = LAYOUT_arrow( XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,RESET, XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX, -XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,XXXXXXX, -XXXXXXX,XXXXXXX,XXXXXXX, GO_DEFT,GO_DEFT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX +XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW, +XXXXXXX,XXXXXXX,XXXXXXX, EXT_MOUSE,EXT_MOUSE, XXXXXXX,XXXXXXX,XXXXXXX,MAC ) }; const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_KEY(1, KC_SPC), - [2] = ACTION_LAYER_TAP_KEY(2, KC_SPC) + [_LOWER] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), + [_RAISE] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 0: - if (record->event.pressed) { - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } - break; - case 10: - if (record->event.pressed) { - layer_on(10); - } - break; - case 99: - if (record->event.pressed) { - layer_off(10); - layer_off(4); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case WINDOW: + if (record->event.pressed) { + set_single_persistent_default_layer(_WINDOW); + } + return false; + break; + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif } - return MACRO_NONE; + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } + return false; + break; + case EXT_MOUSE: + if (record->event.pressed) { + layer_off(_MOUSE); + layer_off(_WINDOW_SHORTCUT); + layer_off(_MAC_SHORTCUT); + } + return false; + break; + } + return true; }; + -- cgit v1.2.3 From 5d723ab1584c2705ab11e9346c38d3c859d8be7c Mon Sep 17 00:00:00 2001 From: orbitingorca <32821588+orbitingorca@users.noreply.github.com> Date: Sat, 11 Aug 2018 20:27:05 +0000 Subject: Keyboard: Add ansi, split bs and rshift, 5 1u keys to right of space in DZ60 (#3612) * Dz60 keymap, ansi, split bs and rshift, 5 1u keys to right of space fixup * Change Keymap to layout --- keyboards/dz60/dz60.h | 14 ++++++++++++++ keyboards/dz60/info.json | 4 ++++ 2 files changed, 18 insertions(+) diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index f755ce3c71..b1089d3b64 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -162,4 +162,18 @@ { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ } +#define LAYOUT_60_ansi_split_bs_rshift_5x1u( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K403, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ +} + #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 0cdacdeaec..54d6753757 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -48,6 +48,10 @@ "LAYOUT_60_iso_5x1u": { "key_count": 63, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"~", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] + }, + "LAYOUT_60_ansi_split_bs_rshift_5x1u": { + "key_count": 64, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] } } } -- cgit v1.2.3 From 7ad0f24efa3d15f25a18972b54311f651337e9f7 Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 11 Aug 2018 13:12:13 -0700 Subject: Move my keymap to the community folder --- keyboards/clueboard/66/keymaps/skully/keymap.c | 53 ------------------------- keyboards/clueboard/66/keymaps/skully/readme.md | 11 ----- keyboards/clueboard/66/keymaps/skully/rules.mk | 2 - layouts/community/66_ansi/skully/keymap.c | 35 ++++++++++++++++ layouts/community/66_ansi/skully/readme.md | 3 ++ 5 files changed, 38 insertions(+), 66 deletions(-) delete mode 100644 keyboards/clueboard/66/keymaps/skully/keymap.c delete mode 100644 keyboards/clueboard/66/keymaps/skully/readme.md delete mode 100644 keyboards/clueboard/66/keymaps/skully/rules.mk create mode 100644 layouts/community/66_ansi/skully/keymap.c create mode 100644 layouts/community/66_ansi/skully/readme.md diff --git a/keyboards/clueboard/66/keymaps/skully/keymap.c b/keyboards/clueboard/66/keymaps/skully/keymap.c deleted file mode 100644 index 7f34a8cbae..0000000000 --- a/keyboards/clueboard/66/keymaps/skully/keymap.c +++ /dev/null @@ -1,53 +0,0 @@ -#include "66.h" - -enum custom_keycodes { - M_SHRUG = SAFE_RANGE -}; - -// 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 -#define _FL 1 -#define _CL 2 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ -[_BL] = LAYOUT( - KC_GESC, 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_GRV, KC_BSPC, 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_PGDN, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, - MO(_FL), KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, KC_UP, - KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, KC_SPC, KC_SPC, KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - /* Keymap _FL: Function Layer - */ -[_FL] = LAYOUT( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_GRV), KC_DEL, BL_STEP, - S(KC_TAB), S(KC_Q), S(KC_W),S(KC_E),S(KC_R),S(KC_T), S(KC_Y), S(KC_U),S(KC_I),S(KC_O), S(KC_P), S(KC_LBRC),S(KC_RBRC),S(KC_BSLS), S(KC_PGDN), - S(KC_LCTL),S(KC_A), MO(_CL),S(KC_D),S(KC_F),S(KC_G), S(KC_H), S(KC_J),S(KC_K),S(KC_L), S(KC_SCLN),S(KC_QUOT),S(KC_NUHS),S(KC_ENT), - MO(_FL), S(KC_NUBS),S(KC_Z),S(KC_X),S(KC_C),S(KC_V), S(KC_B), S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT), S(KC_SLSH),S(KC_RO), KC_RSFT, KC_PGUP, - KC_LCTL, KC_LALT, KC_LGUI,KC_MHEN, S(KC_SPC),S(KC_SPC), KC_HENK, KC_RGUI, KC_RALT, KC_RCTL, KC_HOME, KC_PGDN, KC_END), - - /* Keymap _CL: Control layer - */ -[_CL] = LAYOUT( - M_SHRUG, _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_TOG, RGB_VAI, - _______, _______, _______,_______,RESET, _______,_______,_______,_______,_______, _______, _______, _______, _______, RGB_VAD, - _______, _______, MO(_CL),_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, _______, - MO(_FL), _______, _______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______, MO(_FL), RGB_SAI, - _______, _______, _______,_______, RGB_MOD,RGB_MOD, _______, _______, _______, _______, RGB_HUD,RGB_SAD,RGB_HUI), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case M_SHRUG: - SEND_STRING("/shrug"SS_TAP(X_ENTER)); - return false; break; - } - } - return true; -}; diff --git a/keyboards/clueboard/66/keymaps/skully/readme.md b/keyboards/clueboard/66/keymaps/skully/readme.md deleted file mode 100644 index b9ad1b09a9..0000000000 --- a/keyboards/clueboard/66/keymaps/skully/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -![Clueboard Layout Image](http://i.imgur.com/VaoGn3M.png) - -# skullY's Clueboard Layout - -This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. - -I've made the following changes from the default layout: - -* shift_fn on left shift -* Change capslock to control -* Swap Alt and Cmd diff --git a/keyboards/clueboard/66/keymaps/skully/rules.mk b/keyboards/clueboard/66/keymaps/skully/rules.mk deleted file mode 100644 index ef4a726fe7..0000000000 --- a/keyboards/clueboard/66/keymaps/skully/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -RGBLIGHT_ENABLE = no -MOUSEKEY_ENABLE = yes diff --git a/layouts/community/66_ansi/skully/keymap.c b/layouts/community/66_ansi/skully/keymap.c new file mode 100644 index 0000000000..0533886534 --- /dev/null +++ b/layouts/community/66_ansi/skully/keymap.c @@ -0,0 +1,35 @@ +#include QMK_KEYBOARD_H + +// Layer names +#define _BL 0 +#define _FL 1 +#define _CL 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: Base Layer (Default Layer) + */ +[_BL] = LAYOUT_66_ansi( + KC_GESC,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_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_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, + MO(_FL), 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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + */ +[_FL] = LAYOUT_66_ansi( + KC_GRV, 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_DEL, BL_STEP, + S(KC_TAB), S(KC_Q),S(KC_W),S(KC_E),S(KC_R),S(KC_T),S(KC_Y),S(KC_U),S(KC_I),S(KC_O),S(KC_P),S(KC_LBRC),S(KC_RBRC),S(KC_BSLS),S(KC_PGDN), + S(KC_LCTL), S(KC_A),MO(_CL),S(KC_D),S(KC_F),S(KC_G),S(KC_H),S(KC_J),S(KC_K),S(KC_L),S(KC_SCLN),S(KC_QUOT),S(KC_ENT), + MO(_FL), S(KC_Z),S(KC_X),S(KC_C),S(KC_V),S(KC_B),S(KC_N),S(KC_M),S(KC_COMM),S(KC_DOT),S(KC_SLSH),KC_RSFT, KC_PGUP, + KC_LCTL, KC_LALT, KC_LGUI, S(KC_SPC), KC_RGUI, KC_RALT,KC_RCTL, KC_HOME,KC_PGDN,KC_END), + + /* Keymap _CL: Control layer + */ +[_CL] = LAYOUT_66_ansi( + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, + _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, + _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, + MO(_FL), _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, + _______, _______, _______, RGB_MOD, _______, _______,_______, RGB_HUD,RGB_SAD,RGB_HUI), +}; diff --git a/layouts/community/66_ansi/skully/readme.md b/layouts/community/66_ansi/skully/readme.md new file mode 100644 index 0000000000..63793b9ba0 --- /dev/null +++ b/layouts/community/66_ansi/skully/readme.md @@ -0,0 +1,3 @@ +# skullY's Clueboard Layout + +This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. -- cgit v1.2.3 From acd276763177e7a288a24f4eb86b47f95207ab2f Mon Sep 17 00:00:00 2001 From: eucalyn Date: Sun, 12 Aug 2018 06:22:49 +0900 Subject: Keyboard: add blockey keyboard (#3545) * add blockey * change sources by reviews --- keyboards/blockey/blockey.h | 45 +++++++ keyboards/blockey/config.h | 199 +++++++++++++++++++++++++++++ keyboards/blockey/keymaps/default/keymap.c | 80 ++++++++++++ keyboards/blockey/keymaps/eucalyn/keymap.c | 79 ++++++++++++ keyboards/blockey/readme.md | 15 +++ keyboards/blockey/rules.mk | 72 +++++++++++ 6 files changed, 490 insertions(+) create mode 100644 keyboards/blockey/blockey.h create mode 100644 keyboards/blockey/config.h create mode 100644 keyboards/blockey/keymaps/default/keymap.c create mode 100644 keyboards/blockey/keymaps/eucalyn/keymap.c create mode 100644 keyboards/blockey/readme.md create mode 100644 keyboards/blockey/rules.mk diff --git a/keyboards/blockey/blockey.h b/keyboards/blockey/blockey.h new file mode 100644 index 0000000000..f4869aa0e1 --- /dev/null +++ b/keyboards/blockey/blockey.h @@ -0,0 +1,45 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#ifndef BLOCKEY_H +#define BLOCKEY_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, \ + k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, \ + k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, \ + k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, \ + k55, k56, k57, k58, k59, k60, k61, k62 \ +) \ +{ \ + { k01, k02, k03, k04, k05, k06, k07 }, \ + { k15, k16, k17, k18, k19, k20, k21 }, \ + { k29, k30, k31, k32, k33, k34, k35 }, \ + { k42, k43, k44, k45, k46, k47, k48 }, \ + { k55, k56, k57, k58, KC_NO, KC_NO, k59 }, \ + { k08, k09, k10, k11, k12, k13, k14 }, \ + { k22, k23, k24, k25, k26, k27, k28 }, \ + { k36, k37, k38, k39, k40, k41, KC_NO }, \ + { k49, k50, k51, k52, k53, k54, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, k60, k61, k62, KC_NO}, \ +} + +#endif diff --git a/keyboards/blockey/config.h b/keyboards/blockey/config.h new file mode 100644 index 0000000000..b099a816bf --- /dev/null +++ b/keyboards/blockey/config.h @@ -0,0 +1,199 @@ +/* +Copyright 2018 Eucalyn + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Eucalyn +#define PRODUCT Blockey +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 7 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D1, D4, E6, B5, D2, F6, B3, B2, B6 } +#define MATRIX_COL_PINS { D0, B4, C6, D7, F4, F5, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B1 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 4 +#define ws2812_PORTREG PORTB +#define ws2812_DDRREG DDRB + +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#define RGBLIGHT_ANIMATIONS + + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/blockey/keymaps/default/keymap.c b/keyboards/blockey/keymaps/default/keymap.c new file mode 100644 index 0000000000..594f04f355 --- /dev/null +++ b/keyboards/blockey/keymaps/default/keymap.c @@ -0,0 +1,80 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_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_LCTL,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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_UP, MO(1), \ + KC_ESC, KC_CAPS,KC_LALT,KC_LGUI,KC_SPC, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + [1] = LAYOUT( + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______,RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + _______,RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, \ + _______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGUP,_______, \ + _______,_______,_______,_______,_______, KC_HOME,KC_PGDN,KC_END \ + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/blockey/keymaps/eucalyn/keymap.c b/keyboards/blockey/keymaps/eucalyn/keymap.c new file mode 100644 index 0000000000..7f79d6628b --- /dev/null +++ b/keyboards/blockey/keymaps/eucalyn/keymap.c @@ -0,0 +1,79 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + 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_TAB, KC_Q, KC_W, KC_COMM,KC_DOT, KC_SCLN,KC_M, KC_R, KC_D, KC_Y, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ + KC_LCTL,KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT,KC_ENT, \ + KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH,KC_UP, MO(1), \ + KC_ESC, KC_CAPS,KC_LALT,KC_LGUI,KC_SPC, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + [1] = LAYOUT( + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______,RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + _______,RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, \ + _______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGUP,_______, \ + _______,_______,_______,_______,_______, KC_HOME,KC_PGDN,KC_END \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/blockey/readme.md b/keyboards/blockey/readme.md new file mode 100644 index 0000000000..ecae561250 --- /dev/null +++ b/keyboards/blockey/readme.md @@ -0,0 +1,15 @@ +# BlocKey + +![BlocKey](https://imgur.com/a/6jAcrjr) + +A small keyboard. + +Keyboard Maintainer: [Eucalyn](https://github.com/eucalyn/) [@eucalyn_](https://twitter.com/eucalyn_) +Hardware Supported: BlocKey PCB, Pro Micro +Hardware Availability: + +Make example for this keyboard (after setting up your build environment): + + make blockey:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/blockey/rules.mk b/keyboards/blockey/rules.mk new file mode 100644 index 0000000000..e217305bff --- /dev/null +++ b/keyboards/blockey/rules.mk @@ -0,0 +1,72 @@ +SRC += ws2812.c + +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 + +RGBLIGHT_ENABLE = yes -- cgit v1.2.3 From 1cdef7cd2f4c2b6ad90c80215bf42fb3e66f0cee Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sat, 11 Aug 2018 14:28:01 -0700 Subject: Keymap: Add fauxclicky support to my keymap (#3625) --- layouts/community/66_ansi/skully/config.h | 12 ++++++++++++ layouts/community/66_ansi/skully/keymap.c | 2 +- layouts/community/66_ansi/skully/readme.md | 2 ++ 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 layouts/community/66_ansi/skully/config.h diff --git a/layouts/community/66_ansi/skully/config.h b/layouts/community/66_ansi/skully/config.h new file mode 100644 index 0000000000..f51361866c --- /dev/null +++ b/layouts/community/66_ansi/skully/config.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef AUDIO_CLICKY + #define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f + #define AUDIO_CLICKY_FREQ_MIN 65.41f + #define AUDIO_CLICKY_FREQ_MAX 1046.5f + //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f + //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e + #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio + #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f +#endif diff --git a/layouts/community/66_ansi/skully/keymap.c b/layouts/community/66_ansi/skully/keymap.c index 0533886534..9337cfe02b 100644 --- a/layouts/community/66_ansi/skully/keymap.c +++ b/layouts/community/66_ansi/skully/keymap.c @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_CL] = LAYOUT_66_ansi( _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,RGB_TOG, RGB_VAI, - _______, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, + CK_TOGG, _______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, _______, _______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, MO(_FL), _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_SAI, _______, _______, _______, RGB_MOD, _______, _______,_______, RGB_HUD,RGB_SAD,RGB_HUI), diff --git a/layouts/community/66_ansi/skully/readme.md b/layouts/community/66_ansi/skully/readme.md index 63793b9ba0..ad1a1e458d 100644 --- a/layouts/community/66_ansi/skully/readme.md +++ b/layouts/community/66_ansi/skully/readme.md @@ -1,3 +1,5 @@ # skullY's Clueboard Layout This layout is what I (@skullydazed) use on my personal Clueboards. I mostly use it for programming, CAD, and general typing. + +On boards with audio I have faux-clicky enabled. I've tuned it to values I find pleasing, they kinda remind me of the "talking" in Mike Tyson's Punch Out. -- cgit v1.2.3 From d263b27c9a998e31084d7960724b3c243311c4cf Mon Sep 17 00:00:00 2001 From: fauxpark Date: Mon, 6 Aug 2018 13:08:26 +1000 Subject: Dedupe shifted keycodes listing --- docs/_sidebar.md | 3 +-- docs/_summary.md | 3 +-- docs/feature_advanced_keycodes.md | 30 +----------------------------- docs/features.md | 2 +- docs/keycodes.md | 2 +- 5 files changed, 5 insertions(+), 35 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 6c56bb2e51..69170d8bb1 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -68,11 +68,10 @@ * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [RGB Light](feature_rgblight.md#rgblight-keycodes) * [RGB Matrix](feature_rgb_matrix.md#keycodes) - * [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes) + * [Shifted Keys](keycodes_us_ansi_shifted.md) * [Stenography](feature_stenography.md#keycode-reference) * [Swap Hands](feature_swap_hands.md#swap-keycodes) * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * Reference * [Config Options](config_options.md) diff --git a/docs/_summary.md b/docs/_summary.md index 6c56bb2e51..69170d8bb1 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -68,11 +68,10 @@ * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [RGB Light](feature_rgblight.md#rgblight-keycodes) * [RGB Matrix](feature_rgb_matrix.md#keycodes) - * [Shifted Keys](feature_advanced_keycodes.md#shifted-keycodes) + * [Shifted Keys](keycodes_us_ansi_shifted.md) * [Stenography](feature_stenography.md#keycode-reference) * [Swap Hands](feature_swap_hands.md#swap-keycodes) * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * Reference * [Config Options](config_options.md) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 493a99fd73..f93b8033a5 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -1,6 +1,6 @@ # Advanced Keycodes -Your keymap can include keycodes that are more advanced than normal, for example shifted keys. This page documents the functions that are available to you. +Your keymap can include keycodes that are more advanced than normal, for example keys that switch layers or send modifiers when held, but send regular keycodes when tapped. This page documents the functions that are available to you. ### Assigning Custom Names @@ -73,34 +73,6 @@ You can also chain these, like this: LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress. -# Shifted Keycodes - -The following shortcuts automatically add `LSFT()` to keycodes to get commonly used symbols. - -|Key |Aliases |Description | -|------------------------|------------------|-------------------| -|`KC_TILDE` |`KC_TILD` |`~` | -|`KC_EXCLAIM` |`KC_EXLM` |`!` | -|`KC_AT` | |`@` | -|`KC_HASH` | |`#` | -|`KC_DOLLAR` |`KC_DLR` |`$` | -|`KC_PERCENT` |`KC_PERC` |`%` | -|`KC_CIRCUMFLEX` |`KC_CIRC` |`^` | -|`KC_AMPERSAND` |`KC_AMPR` |`&` | -|`KC_ASTERISK` |`KC_ASTR` |`*` | -|`KC_LEFT_PAREN` |`KC_LPRN` |`(` | -|`KC_RIGHT_PAREN` |`KC_RPRN` |`)` | -|`KC_UNDERSCORE` |`KC_UNDS` |`_` | -|`KC_PLUS` | |`+` | -|`KC_LEFT_CURLY_BRACE` |`KC_LCBR` |`{` | -|`KC_RIGHT_CURLY_BRACE` |`KC_RCBR` |`}` | -|`KC_PIPE` | ||| -|`KC_COLON` |`KC_COLN` |`:` | -|`KC_DOUBLE_QUOTE` |`KC_DQT`/`KC_DQUO`|`"` | -|`KC_LEFT_ANGLE_BRACKET` |`KC_LT`/`KC_LABK` |`<` | -|`KC_RIGHT_ANGLE_BRACKET`|`KC_GT`/`KC_RABK` |`>` | -|`KC_QUESTION` |`KC_QUES` |`?` | - # Mod Tap `MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. diff --git a/docs/features.md b/docs/features.md index b10e0cc1de..537e1061cd 100644 --- a/docs/features.md +++ b/docs/features.md @@ -3,7 +3,7 @@ QMK has a staggering number of features for building your keyboard. It can take some time to understand all of them and determine which one will achieve your goal. -* [Advanced Keycodes](feature_advanced_keycodes.md) - Change layers, type shifted keys, and more. Go beyond typing simple characters. +* [Advanced Keycodes](feature_advanced_keycodes.md) - Change layers, dual-action keys, and more. Go beyond typing simple characters. * [Audio](feature_audio.md) - Connect a speaker to your keyboard for audio feedback, midi support, and music mode. * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. diff --git a/docs/keycodes.md b/docs/keycodes.md index dbafecb829..fd3776bb72 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -402,7 +402,7 @@ This is a reference only. Each group of keys links to the page documenting their |`PRINT_ON` |Start printing everything the user types| |`PRINT_OFF`|Stop printing everything the user types | -## [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) +## [US ANSI Shifted Symbols](keycodes_us_ansi_shifted.md) |Key |Aliases |Description | |------------------------|-------------------|-------------------| -- cgit v1.2.3 From 2a49832db33598b8acee822fa7b3a6c6af48de0d Mon Sep 17 00:00:00 2001 From: fauxpark Date: Sun, 5 Aug 2018 20:09:42 +1000 Subject: Update FAQ section on power keys --- docs/faq_keymap.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 447b892262..b05b968a6c 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -34,12 +34,11 @@ See [issue #168](https://github.com/tmk/tmk_keyboard/issues/168) and * http://en.wikipedia.org/wiki/Magic_SysRq_key * http://en.wikipedia.org/wiki/System_request -## Power Key Doesn't Work -Use `KC_PWR` instead of `KC_POWER` or vice versa. -* `KC_PWR` works with Windows and Linux, not with OSX. -* `KC_POWER` works with OSX and Linux, not with Windows. +## Power Keys Aren't Working -More info: http://geekhack.org/index.php?topic=14290.msg1327264#msg1327264 +Somewhat confusingly, there are two "Power" keycodes in QMK: `KC_POWER` in the Keyboard/Keypad HID usage page, and `KC_SYSTEM_POWER` (or `KC_PWR`) in the Consumer page. + +The former is only recognized on macOS, while the latter, `KC_SLEP` and `KC_WAKE` are supported by all three major operating systems, so it is recommended to use those instead. Under Windows, these keys take effect immediately, however on macOS they must be held down until a dialog appears. ## One Shot Modifier Solves my personal 'the' problem. I often got 'the' or 'THe' wrongly instead of 'The'. One Shot Shift mitigates this for me. -- cgit v1.2.3 From f0e0ca402c10fe2ade7129b28a0066bdf10d018d Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 11 Aug 2018 16:45:29 -0700 Subject: Keymap: copy skully's faux clicky mods (#3628) --- layouts/community/66_ansi/mechmerlin/config.h | 12 ++++++++++++ layouts/community/66_ansi/mechmerlin/keymap.c | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 layouts/community/66_ansi/mechmerlin/config.h diff --git a/layouts/community/66_ansi/mechmerlin/config.h b/layouts/community/66_ansi/mechmerlin/config.h new file mode 100644 index 0000000000..f51361866c --- /dev/null +++ b/layouts/community/66_ansi/mechmerlin/config.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef AUDIO_CLICKY + #define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_FREQ_DEFAULT 261.63f + #define AUDIO_CLICKY_FREQ_MIN 65.41f + #define AUDIO_CLICKY_FREQ_MAX 1046.5f + //#define AUDIO_CLICKY_FREQ_FACTOR 1.18921f + //#define AUDIO_CLICKY_FREQ_FACTOR 2.71828f // e + #define AUDIO_CLICKY_FREQ_FACTOR 1.61803f // golden ratio + #define AUDIO_CLICKY_FREQ_RANDOMNESS 17.0f +#endif diff --git a/layouts/community/66_ansi/mechmerlin/keymap.c b/layouts/community/66_ansi/mechmerlin/keymap.c index 9baf238c73..b8142f9674 100644 --- a/layouts/community/66_ansi/mechmerlin/keymap.c +++ b/layouts/community/66_ansi/mechmerlin/keymap.c @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_CL] = LAYOUT_66_ansi( BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \ RGB_TOG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + CK_TOGG,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, RGB_SAI, \ _______,_______,_______, RGB_MOD, _______,_______,_______,RGB_HUD,RGB_SAD,RGB_HUI), }; -- cgit v1.2.3 From 3be4d2417c8e24d14e56bac6ce70190e2261a22b Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sat, 11 Aug 2018 22:35:07 -0700 Subject: Keyboard: Make tada68 build .bin files by default (#3630) --- keyboards/tada68/readme.md | 6 +++++- keyboards/tada68/rules.mk | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index 25b054ba16..393666fc87 100755 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -9,10 +9,14 @@ Hardware Availability: [kbdfans](https://kbdfans.myshopify.com/products/tada68-m Make example for this keyboard (after setting up your build environment): - make tada68:default:bin + make tada68:default See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +## Firmware Format + +Out of the box the tada68 uses a .bin firmware file instead of a .hex like other custom keyboards. By default QMK will build and copy the correct .bin file for you. If for some reason you need a hex file instead, you can add `:hex` to your make command, or look inside `qmk_firmware/.build` to find the hex file. + ## Flashing Instructions (Win) *Read all the instructions, there are a few warnings of things to avoid doing to avoid bricking your Tada68. __It is much too easy to do!__* diff --git a/keyboards/tada68/rules.mk b/keyboards/tada68/rules.mk index dd5b2bbe0c..2af733b6b3 100755 --- a/keyboards/tada68/rules.mk +++ b/keyboards/tada68/rules.mk @@ -48,6 +48,8 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # USBaspLoader 2048 OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Mass storage bootloader on the tada68 uses bin files +FIRMWARE_FORMAT=bin # Build Options # comment out to disable the options. -- cgit v1.2.3 From 09759c20ae8b0c40d8f3a7570558d60cc3b5907d Mon Sep 17 00:00:00 2001 From: skullydazed Date: Sat, 11 Aug 2018 23:02:06 -0700 Subject: Document FIRMWARE_FORMAT (#3631) --- docs/config_options.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/config_options.md b/docs/config_options.md index afc29fae9c..e978bcce82 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -199,6 +199,8 @@ This is a [make](https://www.gnu.org/software/make/manual/make.html) file that i * `DEFAULT_FOLDER` * Used to specify a default folder when a keyboard has more than one sub-folder. +* `FIRMWARE_FORMAT` + * Defines which format (bin, hex) is copied to the root `qmk_firmware` folder after building. * `SRC` * Used to add files to the compilation/linking list. * `LAYOUTS` -- cgit v1.2.3 From e510491bbcd4fd59c24f2fdd0c1955f2d4765639 Mon Sep 17 00:00:00 2001 From: bmoorey <42108240+bmoorey@users.noreply.github.com> Date: Sun, 12 Aug 2018 12:31:28 -0400 Subject: Keymap: Created and populated a keymap folder for Iris (#3632) * Create a * Add files via upload * Delete a --- keyboards/iris/keymaps/bmoorey/config.h | 38 +++++++++++ keyboards/iris/keymaps/bmoorey/keymap.c | 114 ++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/bmoorey/rules.mk | 2 + 3 files changed, 154 insertions(+) create mode 100644 keyboards/iris/keymaps/bmoorey/config.h create mode 100644 keyboards/iris/keymaps/bmoorey/keymap.c create mode 100644 keyboards/iris/keymaps/bmoorey/rules.mk diff --git a/keyboards/iris/keymaps/bmoorey/config.h b/keyboards/iris/keymaps/bmoorey/config.h new file mode 100644 index 0000000000..9f8a9afab8 --- /dev/null +++ b/keyboards/iris/keymaps/bmoorey/config.h @@ -0,0 +1,38 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_RIGHT +// #define MASTER_RIGHT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define NO_ACTION_TAPPING +#define NO_ACTION_ONESHOT \ No newline at end of file diff --git a/keyboards/iris/keymaps/bmoorey/keymap.c b/keyboards/iris/keymaps/bmoorey/keymap.c new file mode 100644 index 0000000000..9484ccb3f4 --- /dev/null +++ b/keyboards/iris/keymaps/bmoorey/keymap.c @@ -0,0 +1,114 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC, KC_SPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LCTL, LOWER, KC_SPC, KC_SPC, LOWER, RAISE + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, KC_DEL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RESET, _______, KC_UP, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_LBRC, KC_RBRC, KC_P1, KC_P2, KC_P3, KC_PLUS, KC_PIPE, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_LCBR, _______, _______, KC_RCBR, KC_P0, KC_P0, _______, KC_MINS, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + 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_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, _______, _______, _______, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, _______, _______, KC_PLUS, KC_END, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + RGB_TOG, RGB_RMOD, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, RGB_VAD, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/bmoorey/rules.mk b/keyboards/iris/keymaps/bmoorey/rules.mk new file mode 100644 index 0000000000..c9465948e5 --- /dev/null +++ b/keyboards/iris/keymaps/bmoorey/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +EXTRAKEY_ENABLE = yes -- cgit v1.2.3 From 39256c2449c9c56562f3110f8655fdaf3e2cd5cc Mon Sep 17 00:00:00 2001 From: Felipe Coury Date: Sun, 12 Aug 2018 13:33:04 -0300 Subject: Keyboard: Pearl keyboard LAYOUT_spacebar had an undefined constant K34 (#3633) --- keyboards/pearl/pearl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/pearl/pearl.h b/keyboards/pearl/pearl.h index 900d4817a2..6f5fbce5db 100644 --- a/keyboards/pearl/pearl.h +++ b/keyboards/pearl/pearl.h @@ -54,7 +54,7 @@ along with this program. If not, see . { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C}, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO}, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO}, \ - { K30, K31, KC_NO, KC_NO, K34, K35, KC_NO, KC_NO, KC_NO, K39, K3A, KC_NO, KC_NO}, \ + { K30, K31, KC_NO, KC_NO, KC_NO, K35, KC_NO, KC_NO, KC_NO, K39, K3A, KC_NO, KC_NO}, \ } -- cgit v1.2.3 From 05b7383703d9e7bb68f29765adf865ba78facf2d Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 13 Aug 2018 15:05:58 -0400 Subject: Keyboard: Refactor Levinson to use split common code (#3639) * Migrate Levinson to use split_common code * Update keymap --- keyboards/levinson/config.h | 8 +- keyboards/levinson/i2c.c | 162 --------- keyboards/levinson/i2c.h | 49 --- keyboards/levinson/info.json | 4 +- keyboards/levinson/keymaps/bakingpy2u/config.h | 7 +- keyboards/levinson/keymaps/bakingpy2u/keymap.c | 4 +- keyboards/levinson/keymaps/bakingpy2u/rules.mk | 4 - keyboards/levinson/keymaps/default/config.h | 8 +- keyboards/levinson/keymaps/default/rules.mk | 5 +- keyboards/levinson/keymaps/treadwell/keymap.c | 4 +- keyboards/levinson/keymaps/treadwell/rules.mk | 4 - keyboards/levinson/keymaps/valgrahf/rules.mk | 5 - keyboards/levinson/levinson.h | 5 +- keyboards/levinson/matrix.c | 484 ------------------------- keyboards/levinson/rev1/config.h | 35 +- keyboards/levinson/rev1/rev1.c | 1 - keyboards/levinson/rev1/rev1.h | 7 +- keyboards/levinson/rev2/config.h | 35 +- keyboards/levinson/rev2/rev2.h | 7 +- keyboards/levinson/rules.mk | 52 +-- keyboards/levinson/serial.c | 228 ------------ keyboards/levinson/serial.h | 26 -- keyboards/levinson/split_util.c | 86 ----- keyboards/levinson/split_util.h | 20 - layouts/community/ortho_4x12/bakingpy/config.h | 8 +- layouts/community/ortho_4x12/bakingpy/keymap.c | 76 ++-- layouts/community/ortho_4x12/bakingpy/rules.mk | 3 +- 27 files changed, 66 insertions(+), 1271 deletions(-) delete mode 100644 keyboards/levinson/i2c.c delete mode 100644 keyboards/levinson/i2c.h delete mode 100644 keyboards/levinson/matrix.c delete mode 100644 keyboards/levinson/serial.c delete mode 100644 keyboards/levinson/serial.h delete mode 100644 keyboards/levinson/split_util.c delete mode 100644 keyboards/levinson/split_util.h diff --git a/keyboards/levinson/config.h b/keyboards/levinson/config.h index 591c656a29..ca0c79e554 100644 --- a/keyboards/levinson/config.h +++ b/keyboards/levinson/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 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 @@ -21,11 +22,4 @@ along with this program. If not, see . #include "config_common.h" -#ifdef SUBPROJECT_rev1 - #include "rev1/config.h" -#endif -#ifdef SUBPROJECT_rev2 - #include "rev2/config.h" -#endif - #endif diff --git a/keyboards/levinson/i2c.c b/keyboards/levinson/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/levinson/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/levinson/info.json b/keyboards/levinson/info.json index 4305135a1b..2fb8fa9e3e 100644 --- a/keyboards/levinson/info.json +++ b/keyboards/levinson/info.json @@ -1,7 +1,7 @@ { "keyboard_name": "Levinson", - "url": "", - "maintainer": "qmk", + "url": "https://keeb.io", + "maintainer": "Keebio", "width": 13, "height": 4, "layouts": { diff --git a/keyboards/levinson/keymaps/bakingpy2u/config.h b/keyboards/levinson/keymaps/bakingpy2u/config.h index 75753ac2e7..1db6ea433f 100644 --- a/keyboards/levinson/keymaps/bakingpy2u/config.h +++ b/keyboards/levinson/keymaps/bakingpy2u/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -22,5 +19,3 @@ #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/levinson/keymaps/bakingpy2u/keymap.c b/keyboards/levinson/keymaps/bakingpy2u/keymap.c index da46d2a05a..219e3468fb 100644 --- a/keyboards/levinson/keymaps/bakingpy2u/keymap.c +++ b/keyboards/levinson/keymaps/bakingpy2u/keymap.c @@ -1,6 +1,4 @@ -#include "levinson.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/levinson/keymaps/bakingpy2u/rules.mk b/keyboards/levinson/keymaps/bakingpy2u/rules.mk index 22b6ec4766..d7463419b4 100644 --- a/keyboards/levinson/keymaps/bakingpy2u/rules.mk +++ b/keyboards/levinson/keymaps/bakingpy2u/rules.mk @@ -1,6 +1,2 @@ RGBLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/levinson/keymaps/default/config.h b/keyboards/levinson/keymaps/default/config.h index 6b31e8d14e..e710d6e4aa 100644 --- a/keyboards/levinson/keymaps/default/config.h +++ b/keyboards/levinson/keymaps/default/config.h @@ -3,6 +3,7 @@ This is the c configuration file for the keymap Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 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 @@ -18,10 +19,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -33,5 +31,3 @@ along with this program. If not, see . #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/levinson/keymaps/default/rules.mk b/keyboards/levinson/keymaps/default/rules.mk index 457a3d01d4..d7463419b4 100644 --- a/keyboards/levinson/keymaps/default/rules.mk +++ b/keyboards/levinson/keymaps/default/rules.mk @@ -1,3 +1,2 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/levinson/keymaps/treadwell/keymap.c b/keyboards/levinson/keymaps/treadwell/keymap.c index 10d7d30355..f930ebb795 100644 --- a/keyboards/levinson/keymaps/treadwell/keymap.c +++ b/keyboards/levinson/keymaps/treadwell/keymap.c @@ -1,6 +1,4 @@ -#include "levinson.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; diff --git a/keyboards/levinson/keymaps/treadwell/rules.mk b/keyboards/levinson/keymaps/treadwell/rules.mk index c5e16f1369..1d2d9e5a9c 100644 --- a/keyboards/levinson/keymaps/treadwell/rules.mk +++ b/keyboards/levinson/keymaps/treadwell/rules.mk @@ -1,6 +1,2 @@ RGBLIGHT_ENABLE = no BACKLIGHT_ENABLE = no - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/levinson/keymaps/valgrahf/rules.mk b/keyboards/levinson/keymaps/valgrahf/rules.mk index 0db809fe4b..1f54b32c48 100644 --- a/keyboards/levinson/keymaps/valgrahf/rules.mk +++ b/keyboards/levinson/keymaps/valgrahf/rules.mk @@ -1,8 +1,3 @@ RGBLIGHT_ENABLE = yes BACKLIGHT_ENABLE = yes AUDIO_ENABLE = no -USE_I2C = no - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/levinson/levinson.h b/keyboards/levinson/levinson.h index 6b18b1a3e6..2106bc0e37 100644 --- a/keyboards/levinson/levinson.h +++ b/keyboards/levinson/levinson.h @@ -1,5 +1,4 @@ -#ifndef LEVINSON_H -#define LEVINSON_H +#pragma once #include "quantum.h" @@ -24,5 +23,3 @@ ) #define LAYOUT_kc_ortho_4x12 LAYOUT_kc - -#endif diff --git a/keyboards/levinson/matrix.c b/keyboards/levinson/matrix.c deleted file mode 100644 index 217264f263..0000000000 --- a/keyboards/levinson/matrix.c +++ /dev/null @@ -1,484 +0,0 @@ -/* -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // 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) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0; -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/levinson/rev1/config.h b/keyboards/levinson/rev1/config.h index ddccbc47a9..52a644e82f 100644 --- a/keyboards/levinson/rev1/config.h +++ b/keyboards/levinson/rev1/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 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 @@ -16,10 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once -#include "../config.h" +#include QMK_KEYBOARD_CONFIG_H /* USB Device descriptor parameter */ #define VENDOR_ID 0xCEEB @@ -38,12 +38,6 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D7, E6, B4, B5 } #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, F4 } -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 7 - /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 @@ -61,30 +55,7 @@ along with this program. If not, see . #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* Backlight LEDs */ #define BACKLIGHT_PIN B6 #define BACKLIGHT_LEVELS 7 - -/* - * 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 - - -#endif diff --git a/keyboards/levinson/rev1/rev1.c b/keyboards/levinson/rev1/rev1.c index edcfd93571..573fa787ba 100644 --- a/keyboards/levinson/rev1/rev1.c +++ b/keyboards/levinson/rev1/rev1.c @@ -1,6 +1,5 @@ #include "levinson.h" - #ifdef SSD1306OLED void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here diff --git a/keyboards/levinson/rev1/rev1.h b/keyboards/levinson/rev1/rev1.h index d24d1d7ad0..2120bb0fa9 100644 --- a/keyboards/levinson/rev1/rev1.h +++ b/keyboards/levinson/rev1/rev1.h @@ -1,7 +1,6 @@ -#ifndef REV2_H -#define REV2_H +#pragma once -#include "../levinson.h" +#include "levinson.h" //void promicro_bootloader_jmp(bool program); #include "quantum.h" @@ -58,5 +57,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/levinson/rev2/config.h b/keyboards/levinson/rev2/config.h index 51ae5cd3c7..4845c935e8 100644 --- a/keyboards/levinson/rev2/config.h +++ b/keyboards/levinson/rev2/config.h @@ -1,6 +1,7 @@ /* Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 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 @@ -16,10 +17,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once -#include "../config.h" +#include QMK_KEYBOARD_CONFIG_H /* USB Device descriptor parameter */ #define VENDOR_ID 0xCEEB @@ -38,12 +38,6 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { D4, D7, E6, B4 } #define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 7 - /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 @@ -61,30 +55,7 @@ along with this program. If not, see . #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* Backlight LEDs */ #define BACKLIGHT_PIN B5 #define BACKLIGHT_LEVELS 7 - -/* - * 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 - - -#endif diff --git a/keyboards/levinson/rev2/rev2.h b/keyboards/levinson/rev2/rev2.h index d24d1d7ad0..2120bb0fa9 100644 --- a/keyboards/levinson/rev2/rev2.h +++ b/keyboards/levinson/rev2/rev2.h @@ -1,7 +1,6 @@ -#ifndef REV2_H -#define REV2_H +#pragma once -#include "../levinson.h" +#include "levinson.h" //void promicro_bootloader_jmp(bool program); #include "quantum.h" @@ -58,5 +57,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/levinson/rules.mk b/keyboards/levinson/rules.mk index 8e67497f4b..4805ed99ee 100644 --- a/keyboards/levinson/rules.mk +++ b/keyboards/levinson/rules.mk @@ -1,49 +1,7 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c \ - ssd1306.c - -# MCU name -#MCU = at90usb1287 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) - -# 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 = caterina # Interrupt driven control endpoint task(+60) @@ -59,19 +17,17 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls 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. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes LAYOUTS = ortho_4x12 - DEFAULT_FOLDER = levinson/rev2 diff --git a/keyboards/levinson/serial.c b/keyboards/levinson/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/levinson/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/levinson/serial.h b/keyboards/levinson/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/levinson/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/levinson/split_util.c b/keyboards/levinson/split_util.c deleted file mode 100644 index 7f200e6c94..0000000000 --- a/keyboards/levinson/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init(); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/layouts/community/ortho_4x12/bakingpy/config.h b/layouts/community/ortho_4x12/bakingpy/config.h index 77fa69ad78..a90f38001a 100644 --- a/layouts/community/ortho_4x12/bakingpy/config.h +++ b/layouts/community/ortho_4x12/bakingpy/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once /* Use I2C or Serial, not both */ @@ -9,7 +6,6 @@ // #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS @@ -26,5 +22,3 @@ #ifdef AUDIO_ENABLE #define C6_AUDIO #endif - -#endif diff --git a/layouts/community/ortho_4x12/bakingpy/keymap.c b/layouts/community/ortho_4x12/bakingpy/keymap.c index b34e57cbeb..e71e5d5d2c 100644 --- a/layouts/community/ortho_4x12/bakingpy/keymap.c +++ b/layouts/community/ortho_4x12/bakingpy/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -19,6 +17,7 @@ enum custom_keycodes { LOWER, RAISE, ADJUST, + PLAY_ALLSTAR, }; #define KC_ KC_TRNS @@ -35,79 +34,80 @@ enum custom_keycodes { #define KC_ENTS MT(MOD_LSFT, KC_ENT) #define KC_BL_S BL_STEP #define KC_BL_T BL_TOGG +#define KC_ALLS PLAY_ALLSTAR const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ ESCC, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENTS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_COLEMAK] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ ESCC, A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH,ENTS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_DVORAK] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ ESCC, A , O , E , U , I , D , H , T , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ LSFT,SCLN, Q , J , K , X , B , M , W , V , Z ,ENTS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ GRVF,LCTL,LALT,LGUI,LOWR,SPC , BSPC,RASE,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_LOWER] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ASTR, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ + ALLS, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ DEL ,CAPP,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ ,CPYP, , ,DOWN,LCBR, RCBR, P1 , P2 , P3 ,MINS, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ BL_S,BL_T, , , ,DEL , DEL , , P0 ,PDOT, , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_RAISE] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ DEL ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ MUTE,MSTP,MPLY,VOLD,PGDN,MINS, PLUS,END , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), [_FKEYS] = LAYOUT_kc_ortho_4x12( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. + //┌────┬────┬────┬────┬────┬────┐ ┌────┬────┬────┬────┬────┬────┐ F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| + //├────┼────┼────┼────┼────┼────┤ ├────┼────┼────┼────┼────┼────┤ , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + //└────┴────┴────┴────┴────┴────┘ └────┴────┴────┴────┴────┴────┘ ), /* Adjust (Lower + Raise) @@ -122,10 +122,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) @@ -200,7 +200,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KC_ASTR: + case PLAY_ALLSTAR: if (record->event.pressed) { #ifdef AUDIO_ENABLE PLAY_SONG(all_star_song); diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk index 80e5f82eef..0d568c401a 100644 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ b/layouts/community/ortho_4x12/bakingpy/rules.mk @@ -2,4 +2,5 @@ ifeq ($(LAYOUTS_HAS_RGB),yes) RGBLIGHT_ENABLE = yes endif -AUDIO_ENABLE = yes +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = yes -- cgit v1.2.3 From 08963796d8ec370e1ee14d157d39cc6cfb78222f Mon Sep 17 00:00:00 2001 From: Logan Bussell <36081148+lbussell@users.noreply.github.com> Date: Mon, 13 Aug 2018 15:37:11 -0400 Subject: Keymap: Added buswerks ortho_4x12 keymap (#3623) * Added buswerks keymap * cleaned up comments on buswerks keymap * Added buswerks keymap readme.md * Fixed spelling in buswerks readme.md * Removed unnecessary includes, changed process_record_user to now use set_single_persistent_default_layer(), removed deprecated functions, and moved the audio ifdef block to config.h --- layouts/community/ortho_4x12/buswerks/config.h | 22 ++++ layouts/community/ortho_4x12/buswerks/keymap.c | 154 ++++++++++++++++++++++++ layouts/community/ortho_4x12/buswerks/readme.md | 28 +++++ 3 files changed, 204 insertions(+) create mode 100644 layouts/community/ortho_4x12/buswerks/config.h create mode 100644 layouts/community/ortho_4x12/buswerks/keymap.c create mode 100644 layouts/community/ortho_4x12/buswerks/readme.md diff --git a/layouts/community/ortho_4x12/buswerks/config.h b/layouts/community/ortho_4x12/buswerks/config.h new file mode 100644 index 0000000000..1498cae744 --- /dev/null +++ b/layouts/community/ortho_4x12/buswerks/config.h @@ -0,0 +1,22 @@ +#pragma once + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif \ No newline at end of file diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c new file mode 100644 index 0000000000..776ea461b7 --- /dev/null +++ b/layouts/community/ortho_4x12/buswerks/keymap.c @@ -0,0 +1,154 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define KC_ KC_TRNS +#define XXXXXXX KC_NO + +#define ESC_CMD MT(MOD_LGUI, KC_ESC) +#define RSE_ENT LT(_RAISE, KC_ENT) +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_ADJ ADJUST + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_COLEMAK] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, KC_BSPC, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ESC_CMD, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , KC_QUOT, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_DVORAK] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_LOWER] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_TILD, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_DEL, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, KC_CIRC, KC_ASTR, KC_UNDS, KC_EQL, KC_AMPR, _______, KC_1, KC_2, KC_3, KC_SLSH, _______, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_RAISE] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_GRV, _______, _______, KC_LPRN, KC_RPRN, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, KC_DEL, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_LCBR, KC_RCBR, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_BSLS, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_ADJUST] = LAYOUT_ortho_4x12( \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ + _______, _______, RESET, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/layouts/community/ortho_4x12/buswerks/readme.md b/layouts/community/ortho_4x12/buswerks/readme.md new file mode 100644 index 0000000000..452116423b --- /dev/null +++ b/layouts/community/ortho_4x12/buswerks/readme.md @@ -0,0 +1,28 @@ +Buswerks' 4x12 Ortholinear Layout +============================ +For use on Planck, Let's Split, and similar keyboards + +### Layout Overview + +- Main Layer + - An additional shift key is located on the right space key (only works for grid layouts) + - Enter is located on the Raise key (layer-tap) + - The left and right shift keys function as Space Cadet shift keys + - The bottom left key is the Adjust modifier + - Escape is in the traditional Caps Lock position + - Holding down the escape key acts as LGUI (intended for macOS use) +- Lower + - There is a numpad on the right hand (4, 5, and 6 are located under JKL/NEI/HTN) + - Plus and minus keys are located to the right of the numpad + - All other symbols are located on the other side of the keyboard, in a somewhat logical order + - Symbols from the number row are in order, starting on the left pinky. + - Equals and underscore are in easily accessible spots, because they are more commonly used in programming + - The ampersand is less common, so it is moved to the right of the equals symbol +- Raise + - Vim-style arrow keys + - Above the arrow keys are media controls + - Below are home, end, pgup, and pgdn + - The left hand has all three types of braces + - Curly braces are under the index and middle fingers for easy access during programming, and because parentheses are already available through Space Cadet shift +- Adjust + - Function keys are located along the top row (reset is moved to accommodate this) \ No newline at end of file -- cgit v1.2.3 From 6cdc6e8397a210a319c45c434eb21bcd136c5f3d Mon Sep 17 00:00:00 2001 From: josephchoi1116 <31532411+josephchoi1116@users.noreply.github.com> Date: Tue, 14 Aug 2018 03:37:53 +0800 Subject: Keyboard: Update info.json (#3638) Add a layout of ANSI split backspace & R.Shift --- keyboards/ok60/info.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keyboards/ok60/info.json b/keyboards/ok60/info.json index c233f66026..9c561c6b85 100644 --- a/keyboards/ok60/info.json +++ b/keyboards/ok60/info.json @@ -9,6 +9,10 @@ "key_count": 61, "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] }, + "LAYOUT_60_ansi_split_bksp_rshift": { + "key_count": 63, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_iso": { "key_count": 62, "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2}, {"x":13.75, "y":1, "w":1.25, "h":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] -- cgit v1.2.3 From e12151f15e49191b48d88eb428e010dc020fbc14 Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 13 Aug 2018 15:38:49 -0400 Subject: Keyboard: Clean up Iris files (#3640) --- keyboards/iris/info.json | 10 +++++----- keyboards/iris/iris.h | 5 +---- keyboards/iris/rev1/config.h | 5 +---- keyboards/iris/rev1/rev1.c | 1 - keyboards/iris/rev1/rev1.h | 5 +---- keyboards/iris/rev1_led/config.h | 5 +---- keyboards/iris/rev1_led/rev1_led.c | 1 - keyboards/iris/rev1_led/rev1_led.h | 5 +---- keyboards/iris/rev2/config.h | 5 +---- keyboards/iris/rev2/rev2.h | 5 +---- keyboards/iris/rules.mk | 5 +---- 11 files changed, 13 insertions(+), 39 deletions(-) diff --git a/keyboards/iris/info.json b/keyboards/iris/info.json index a26ffae87a..f7b017b97a 100644 --- a/keyboards/iris/info.json +++ b/keyboards/iris/info.json @@ -1,9 +1,9 @@ { - "keyboard_name": "Iris", - "url": "Keeb.io", - "maintainer": "qmk", - "width": 14.5, - "height": 5, + "keyboard_name": "Iris", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 14.5, + "height": 5, "layouts": { "LAYOUT": { "layout": [ diff --git a/keyboards/iris/iris.h b/keyboards/iris/iris.h index 56ba15473b..8d33b6b217 100644 --- a/keyboards/iris/iris.h +++ b/keyboards/iris/iris.h @@ -1,5 +1,4 @@ -#ifndef IRIS_H -#define IRIS_H +#pragma once #ifdef KEYBOARD_iris_rev1 #include "rev1.h" @@ -26,5 +25,3 @@ KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##LT4, KC_##RT4, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ KC_##LT1, KC_##LT2, KC_##LT3, KC_##RT3, KC_##RT2, KC_##RT1 \ ) - -#endif diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index c22d49b262..fd9b2ced39 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include QMK_KEYBOARD_CONFIG_H @@ -86,5 +85,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/iris/rev1/rev1.c b/keyboards/iris/rev1/rev1.c index 3fdfaa94bc..fe91fa3ead 100644 --- a/keyboards/iris/rev1/rev1.c +++ b/keyboards/iris/rev1/rev1.c @@ -1,6 +1,5 @@ #include "rev1.h" - #ifdef SSD1306OLED void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here diff --git a/keyboards/iris/rev1/rev1.h b/keyboards/iris/rev1/rev1.h index 4db6bd1973..da5c9cdc03 100644 --- a/keyboards/iris/rev1/rev1.h +++ b/keyboards/iris/rev1/rev1.h @@ -1,5 +1,4 @@ -#ifndef REV1_H -#define REV1_H +#pragma once #include "iris.h" @@ -36,5 +35,3 @@ { R35, R34, R33, R32, R31, R30 }, \ { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ } - -#endif diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h index 957776022e..18d783ae79 100644 --- a/keyboards/iris/rev1_led/config.h +++ b/keyboards/iris/rev1_led/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include QMK_KEYBOARD_CONFIG_H @@ -86,5 +85,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/iris/rev1_led/rev1_led.c b/keyboards/iris/rev1_led/rev1_led.c index 681625f4b0..d08eaea662 100644 --- a/keyboards/iris/rev1_led/rev1_led.c +++ b/keyboards/iris/rev1_led/rev1_led.c @@ -1,6 +1,5 @@ #include "rev1_led.h" - #ifdef SSD1306OLED void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here diff --git a/keyboards/iris/rev1_led/rev1_led.h b/keyboards/iris/rev1_led/rev1_led.h index bac5e7bec3..da5c9cdc03 100644 --- a/keyboards/iris/rev1_led/rev1_led.h +++ b/keyboards/iris/rev1_led/rev1_led.h @@ -1,5 +1,4 @@ -#ifndef REV1_LED_H -#define REV1_LED_H +#pragma once #include "iris.h" @@ -36,5 +35,3 @@ { R35, R34, R33, R32, R31, R30 }, \ { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ } - -#endif diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 4aa8cda176..2ea31a1541 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include QMK_KEYBOARD_CONFIG_H @@ -86,5 +85,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/iris/rev2/rev2.h b/keyboards/iris/rev2/rev2.h index d581b346d1..da5c9cdc03 100644 --- a/keyboards/iris/rev2/rev2.h +++ b/keyboards/iris/rev2/rev2.h @@ -1,5 +1,4 @@ -#ifndef REV2_H -#define REV2_H +#pragma once #include "iris.h" @@ -36,5 +35,3 @@ { R35, R34, R33, R32, R31, R30 }, \ { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ } - -#endif diff --git a/keyboards/iris/rules.mk b/keyboards/iris/rules.mk index 07d78059ea..fa261adc6f 100644 --- a/keyboards/iris/rules.mk +++ b/keyboards/iris/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -36,7 +35,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -59,8 +58,6 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SUBPROJECT_rev1 = yes -USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 61b61161478ebe1a65fc4b9a9efc0f887a342767 Mon Sep 17 00:00:00 2001 From: zwnk Date: Tue, 14 Aug 2018 00:23:11 -0300 Subject: Keyboard: Dactyl manuform 5x6 added and working (#3627) * mouse layer keys shifted * mouse layer keys shifted * manuform 5x6 added * mouse layer keys shifted * manuform 5x6 added * dactyl_manuform 5x6 keymap added * reorg. dactyl manuform folder * removed LAYOUTS = ortho_4x12 for 4x5 * Rows and Cols in config.h fixed * MASTER_LEFT * 5x6 matrix fixed * keymap updated * removed the i2c, serial, split_util and matrix files and inserted SPLIT_KEYBOARD --- keyboards/handwired/dactyl_manuform/4x5/config.h | 97 +++++ .../dactyl_manuform/4x5/dactyl_manuform.c | 23 + .../dactyl_manuform/4x5/dactyl_manuform.h | 71 ++++ .../dactyl_manuform/4x5/keymaps/default/config.h | 37 ++ .../dactyl_manuform/4x5/keymaps/default/keymap.c | 129 ++++++ .../dactyl_manuform/4x5/keymaps/default/rules.mk | 3 + .../dactyl_manuform/4x5/keymaps/dvorak/config.h | 37 ++ .../dactyl_manuform/4x5/keymaps/dvorak/keymap.c | 129 ++++++ .../dactyl_manuform/4x5/keymaps/dvorak/rules.mk | 3 + keyboards/handwired/dactyl_manuform/4x5/readme.md | 161 +++++++ keyboards/handwired/dactyl_manuform/4x5/rules.mk | 68 +++ keyboards/handwired/dactyl_manuform/5x6/config.h | 97 +++++ .../dactyl_manuform/5x6/dactyl_manuform.c | 23 + .../dactyl_manuform/5x6/dactyl_manuform.h | 47 +++ .../dactyl_manuform/5x6/keymaps/impstyle/config.h | 28 ++ .../dactyl_manuform/5x6/keymaps/impstyle/keymap.c | 75 ++++ keyboards/handwired/dactyl_manuform/5x6/readme.md | 142 +++++++ keyboards/handwired/dactyl_manuform/5x6/rules.mk | 67 +++ keyboards/handwired/dactyl_manuform/config.h | 97 ----- .../handwired/dactyl_manuform/dactyl_manuform.c | 23 - .../handwired/dactyl_manuform/dactyl_manuform.h | 69 --- .../handwired/dactyl_manuform/eeprom-lefthand.eep | 2 - .../handwired/dactyl_manuform/eeprom-righthand.eep | 2 - keyboards/handwired/dactyl_manuform/i2c.c | 162 ------- keyboards/handwired/dactyl_manuform/i2c.h | 49 --- .../dactyl_manuform/keymaps/default/config.h | 37 -- .../dactyl_manuform/keymaps/default/keymap.c | 129 ------ .../dactyl_manuform/keymaps/default/rules.mk | 3 - .../dactyl_manuform/keymaps/dvorak/config.h | 37 -- .../dactyl_manuform/keymaps/dvorak/keymap.c | 129 ------ .../dactyl_manuform/keymaps/dvorak/rules.mk | 3 - keyboards/handwired/dactyl_manuform/matrix.c | 465 --------------------- keyboards/handwired/dactyl_manuform/readme.md | 161 ------- keyboards/handwired/dactyl_manuform/rules.mk | 75 ---- keyboards/handwired/dactyl_manuform/serial.c | 228 ---------- keyboards/handwired/dactyl_manuform/serial.h | 26 -- keyboards/handwired/dactyl_manuform/split_util.c | 86 ---- keyboards/handwired/dactyl_manuform/split_util.h | 20 - keyboards/iris/keymaps/impstyle/keymap.c | 8 +- 39 files changed, 1241 insertions(+), 1807 deletions(-) create mode 100644 keyboards/handwired/dactyl_manuform/4x5/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c create mode 100644 keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk create mode 100644 keyboards/handwired/dactyl_manuform/4x5/readme.md create mode 100644 keyboards/handwired/dactyl_manuform/4x5/rules.mk create mode 100644 keyboards/handwired/dactyl_manuform/5x6/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c create mode 100644 keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/5x6/readme.md create mode 100644 keyboards/handwired/dactyl_manuform/5x6/rules.mk delete mode 100644 keyboards/handwired/dactyl_manuform/config.h delete mode 100644 keyboards/handwired/dactyl_manuform/dactyl_manuform.c delete mode 100644 keyboards/handwired/dactyl_manuform/dactyl_manuform.h delete mode 100644 keyboards/handwired/dactyl_manuform/eeprom-lefthand.eep delete mode 100644 keyboards/handwired/dactyl_manuform/eeprom-righthand.eep delete mode 100644 keyboards/handwired/dactyl_manuform/i2c.c delete mode 100644 keyboards/handwired/dactyl_manuform/i2c.h delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/default/config.h delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/default/keymap.c delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/default/rules.mk delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/dvorak/config.h delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/dvorak/keymap.c delete mode 100644 keyboards/handwired/dactyl_manuform/keymaps/dvorak/rules.mk delete mode 100644 keyboards/handwired/dactyl_manuform/matrix.c delete mode 100644 keyboards/handwired/dactyl_manuform/readme.md delete mode 100644 keyboards/handwired/dactyl_manuform/rules.mk delete mode 100644 keyboards/handwired/dactyl_manuform/serial.c delete mode 100644 keyboards/handwired/dactyl_manuform/serial.h delete mode 100644 keyboards/handwired/dactyl_manuform/split_util.c delete mode 100644 keyboards/handwired/dactyl_manuform/split_util.h diff --git a/keyboards/handwired/dactyl_manuform/4x5/config.h b/keyboards/handwired/dactyl_manuform/4x5/config.h new file mode 100644 index 0000000000..8917630e4a --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/config.h @@ -0,0 +1,97 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tshort +#define PRODUCT Dactyl-Manuform +#define DESCRIPTION A split keyboard for the cheap makers + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 5 + +// wiring of each half +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +// #define MATRIX_COL_PINS { B5, B4, E6, D7, C6 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* mouse config */ +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Enables This makes it easier for fast typists to use dual-function keys */ +#define PERMISSIVE_HOLD + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + + +#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c new file mode 100644 index 0000000000..17caecb4fd --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c @@ -0,0 +1,23 @@ +#include "dactyl_manuform.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h new file mode 100644 index 0000000000..7e126d3017 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h @@ -0,0 +1,71 @@ +#ifndef REV2_H +#define REV2_H + +#include "dactyl_manuform.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +#define LAYOUT( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L31, L32, R32, R33, \ + L33, L34, R30, R31, \ + L44, L43, R41, R40, \ + L42, L41, R43, R42 \ + ) \ + { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { KC_NO, L31, L32, L33, L34 }, \ + { KC_NO, L41, L42, L43, L44 }, \ +\ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { KC_NO, R33, R32, R31, R30 }, \ + { KC_NO, R43, R42, R41, R40 } \ + } +#else + + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L31, L32, R32, R33, \ + L33, L34, R30, R31, \ + L44, L43, R41, R40, \ + L42, L41, R43, R42 \ + ) \ + { \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { KC_NO, R33, R32, R31, R30 }, \ + { KC_NO, R43, R42, R41, R40 }, \ +\ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { KC_NO, L31, L32, L33, L34 }, \ + { KC_NO, L41, L42, L43, L44 } \ +\ + } +#endif +#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h new file mode 100644 index 0000000000..216917ed71 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c new file mode 100644 index 0000000000..24c02215ee --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/keymap.c @@ -0,0 +1,129 @@ +#include "dactyl_manuform.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +// Fillers to make layering more clear + +#define ____ KC_TRNS + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base (qwerty) + * ,----------------------------------, ,----------------------------------, + * | q | w | e | r | t | | y | u | i | o | p | + * |------+------+------+------+------| |-------------+------+------+------| + * | a | s | d | f | g | | h | j | k | l | ; | + * |------+------+------+------+------| |------|------+------+------+------| + * | z | x | c | v | b | | n | m | , | . | ' | + * |------+------+------+-------------, ,-------------+------+------+------, + * | [ | ] | | - | = | + * '------+------'-------------' '-------------'------+------' + * | ESC | BS | | SPACE|ENTER | + * | + | + | | + | + | + * | SHIFT| CTRL | | ALT |SHIFT | + * '------+------' '------+------' + * '------+------' '------+------' + * | TAB | HOME | | END | DEL | + * '------+------' '------+------' + * | Lower| ~ | | GUI | Raise| + * '------+------' '------+------' + */ + +[_BASE] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, \ + KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, \ + SFT_ESC, CTL_BSPC, ALT_SPC, SFT_ENT, \ + KC_TAB, KC_HOME, KC_END, KC_DEL, \ + RAISE, KC_GRV, KC_LGUI, LOWER +), + +/* Raise + * ,----------------------------------, ,----------------------------------, + * | | | mup | | | | VOL+ | | up | | PgUp | + * |------+------+------+------+------| |-------------+------+------+------| + * | | mleft| mdown|mright| | | MUTE | left | down |right | PgDn | + * |------+------+------+------+------| |------|------+------+------+------| + * | | | | | | | VOL- | / | \ | ? | | | + * |------+------+------+-------------, ,-------------+------+------+------, + * | | | | mbtn |mbtn2 | + * '------+------'-------------' '-------------'------+------' + * | | | | | | + * | | | | | | + * | | | | | | + * '------+------' '------+------' + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + */ + +[_RAISE] = LAYOUT( \ + ____, ____, KC_MU, ____, ____, KC_VOLU, ____, KC_UP, ____, KC_PGUP, \ + ____, KC_ML, KC_MD, KC_MR, ____, KC_MUTE, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, \ + ____, ____, ____, ____, ____, KC_VOLD, KC_SLSH, KC_BSLS, KC_QUES, KC_PIPE, \ + ____, ____, KC_MB1, KC_MB2, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____ \ +), +/* Lower + * ,----------------------------------, ,----------------------------------, + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |-------------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | + * |------+------+------+------+------| |------|------+------+------+------| + * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + * |------+------+------+-------------, ,-------------+------+------+------, + * | F11 | F12 | | - | = | + * '------+------'-------------' '-------------'------+------' + * | | | | | | + * | | | | | | + * | | | | | | + * '------+------' '------+------' + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + */ + +[_LOWER] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_F11, KC_F12, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____ \ +) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk new file mode 100644 index 0000000000..457a3d01d4 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h new file mode 100644 index 0000000000..216917ed71 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h @@ -0,0 +1,37 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/keymap.c b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/keymap.c new file mode 100644 index 0000000000..0a1c90b6bf --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/keymap.c @@ -0,0 +1,129 @@ +#include "dactyl_manuform.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +// Fillers to make layering more clear + +#define ____ KC_TRNS + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base (dvorak) + * ,----------------------------------, ,----------------------------------, + * | ' | , | . | p | y | | f | g | c | r | l | + * |------+------+------+------+------| |-------------+------+------+------| + * | a | o | e | u | i | | d | h | t | n | s | + * |------+------+------+------+------| |------|------+------+------+------| + * | ; | q | j | k | x | | b | m | w | v | z | + * |------+------+------+-------------, ,-------------+------+------+------, + * | [ | ] | | - | = | + * '------+------'-------------' '-------------'------+------' + * | ESC | BS | | SPACE|ENTER | + * | + | + | | + | + | + * | SHIFT| CTRL | | ALT |SHIFT | + * '------+------' '------+------' + * '------+------' '------+------' + * | TAB | HOME | | END | DEL | + * '------+------' '------+------' + * | Lower| ~ | | GUI | Raise| + * '------+------' '------+------' + */ + +[_BASE] = LAYOUT( \ + KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, \ + KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, \ + KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, \ + SFT_ESC, CTL_BSPC, ALT_SPC, SFT_ENT, \ + KC_TAB, KC_HOME, KC_END, KC_DEL, \ + RAISE, KC_GRV, KC_LGUI, LOWER +), + +/* Raise + * ,----------------------------------, ,----------------------------------, + * | | | mup | | | | VOL+ | | up | | PgUp | + * |------+------+------+------+------| |-------------+------+------+------| + * | | mleft| mdown|mright| | | MUTE | left | down |right | PgDn | + * |------+------+------+------+------| |------|------+------+------+------| + * | | | | | | | VOL- | / | \ | ? | | | + * |------+------+------+-------------, ,-------------+------+------+------, + * | | | | mbtn |mbtn2 | + * '------+------'-------------' '-------------'------+------' + * | | | | | | + * | | | | | | + * | | | | | | + * '------+------' '------+------' + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + */ + +[_RAISE] = LAYOUT( \ + ____, ____, KC_MU, ____, ____, KC_VOLU, ____, KC_UP, ____, KC_PGUP, \ + ____, KC_ML, KC_MD, KC_MR, ____, KC_MUTE, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, \ + ____, ____, ____, ____, ____, KC_VOLD, KC_SLSH, KC_BSLS, KC_QUES, KC_PIPE, \ + ____, ____, KC_MB1, KC_MB2, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____ \ +), +/* Lower + * ,----------------------------------, ,----------------------------------, + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |-------------+------+------+------| + * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | + * |------+------+------+------+------| |------|------+------+------+------| + * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + * |------+------+------+-------------, ,-------------+------+------+------, + * | F11 | F12 | | - | = | + * '------+------'-------------' '-------------'------+------' + * | | | | | | + * | | | | | | + * | | | | | | + * '------+------' '------+------' + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + * | | | | | | + * '------+------' '------+------' + */ + +[_LOWER] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_F11, KC_F12, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____, \ + ____, ____, ____, ____ \ +) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk new file mode 100644 index 0000000000..457a3d01d4 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/readme.md b/keyboards/handwired/dactyl_manuform/4x5/readme.md new file mode 100644 index 0000000000..aab792f224 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/readme.md @@ -0,0 +1,161 @@ +Dactyl Manuform 4x5 +====== +the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. +![Imgur](https://i.imgur.com/7y0Vbyd.jpg) + + +## First Time Setup + +Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: + +``` +$ make handwired/dactyl_manuform/4x5:dvorak +``` + +You will see a lot of output and if everything worked correctly you will see the built hex file: + +``` +dactyl_manuform_4x5_dvorak.hex +``` + +If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so: + +``` +$ make handwired/dactyl_manuform/4x5:YOUR_KEYMAP_NAME +``` + +If everything worked correctly you will see a file: + +``` +dactyl_manuform_4x5_YOUR_KEYMAP_NAME.hex +``` + +For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. + +## Keymaps +Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. +### Qwerty and Dvorak +Qwerty base layer: +![Imgur](https://i.imgur.com/Yb5e7dS.png) +Dvorak base layer: +![Imgur](https://i.imgur.com/CpuZptB.png) +Both keymaps have the same Raise and Lower layers: +Raise Layer +![Imgur](https://i.imgur.com/nOqePK5.png) +Lower Layer +![Imgur](https://i.imgur.com/WSshkYc.png) + +Required Hardware +----------------- + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. +* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable + +Alternatively, you can use any sort of cable and socket that has at least 3 +wires. If you want to use I2C to communicate between halves, you will need a +cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +Optional Hardware +----------------- +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +Wiring +------ + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + +The wiring for i2c: + +![i2c wiring](https://i.imgur.com/Hbzhc6E.png) + +The pull-up resistors may be placed on either half. It is also possible +to use 4 resistors and have the pull-ups in both halves, but this is +unnecessary in simple use cases. + +You can change your configuration between serial and i2c by modifying your `config.h` file. + +Notes on Software Configuration +------------------------------- + +the keymaps in here are for the 4x5 layout of the keyboard only. + +Flashing +------- +From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. +Example: `make lets_split/rev2:default:avrdude` + + +Choosing which board to plug the USB cable into (choosing Master) +-------- +Because the two boards are identical, the firmware has logic to differentiate the left and right board. + +It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. + +The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. + +The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. + +### Setting the left hand as master +If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. + +### Setting the right hand as master +If you always plug the usb cable into the right board, add an extra flag to your `config.h` +``` + #define MASTER_RIGHT +``` + +### Setting EE_hands to use either hands as master +If you define `EE_HANDS` in your `config.h`, you will need to set the +EEPROM for the left and right halves. + +The EEPROM is used to store whether the +half is left handed or right handed. This makes it so that the same firmware +file will run on both hands instead of having to flash left and right handed +versions of the firmware to each half. To flash the EEPROM file for the left +half run: +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +// or the equivalent in dfu-programmer + +``` +and similarly for right half +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +// or the equivalent in dfu-programmer +``` + +NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) + +After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. + +Note that you need to program both halves, but you have the option of using +different keymaps for each half. You could program the left half with a QWERTY +layout and the right half with a Colemak layout using bootmagic's default layout option. +Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the +right half is connected. + + +Notes on Using Pro Micro 3.3V +----------------------------- + +Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects +the frequency on the 3.3V board. + +Also, if the slave board is producing weird characters in certain columns, +update the following line in `matrix.c` to the following: + +``` +// _delay_us(30); // without this wait read unstable value. +_delay_us(300); // without this wait read unstable value. +``` diff --git a/keyboards/handwired/dactyl_manuform/4x5/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/rules.mk new file mode 100644 index 0000000000..99ac2880d5 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SUBPROJECT_rev1 = yes +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + diff --git a/keyboards/handwired/dactyl_manuform/5x6/config.h b/keyboards/handwired/dactyl_manuform/5x6/config.h new file mode 100644 index 0000000000..97495e9350 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/config.h @@ -0,0 +1,97 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tshort +#define PRODUCT Dactyl-Manuform +#define DESCRIPTION A split keyboard for the cheap makers + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_ROW_PINS { F6, F7, B1, B3, B2, B6 } + + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* mouse config */ +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Enables This makes it easier for fast typists to use dual-function keys */ +#define PERMISSIVE_HOLD + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + + +#endif diff --git a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c new file mode 100644 index 0000000000..17caecb4fd --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c @@ -0,0 +1,23 @@ +#include "dactyl_manuform.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h new file mode 100644 index 0000000000..5c1a4339bd --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h @@ -0,0 +1,47 @@ +#ifndef REV2_H +#define REV2_H + +#include "dactyl_manuform.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#define LAYOUT_5x6(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L42, L43, R42, R43, \ + L44, L45, R40, R41, \ + L54, L55, R50, R51, \ + L52, L53, R52, R53 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, L52, L53, L54, L55 }, \ +\ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, KC_NO, KC_NO },\ + { R50, R51, R52, R53, KC_NO, KC_NO }, \ + } + +#endif diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h new file mode 100644 index 0000000000..1a7d1e0659 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h @@ -0,0 +1,28 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 6 + +#include "../../config.h" diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c new file mode 100644 index 0000000000..7dd9f7c869 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c @@ -0,0 +1,75 @@ +#include "dactyl_manuform.h" +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +#define _______ KC_TRNS + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + [_QWERTY] = LAYOUT_5x6( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, + KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, + RAISE,KC_SPC, KC_ENT, LOWER, + KC_TAB,KC_HOME, KC_END, KC_DEL, + KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + ), + + [_LOWER] = LAYOUT_5x6( + KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS, + _______,KC_PSCR, _______, KC_P0, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ +), + + [_RAISE] = LAYOUT_5x6( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______, KC_EQL ,_______, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ + ), + + }; + + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/readme.md b/keyboards/handwired/dactyl_manuform/5x6/readme.md new file mode 100644 index 0000000000..eb76a7150e --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/readme.md @@ -0,0 +1,142 @@ +Dactyl Manuform 5x6 +====== +the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. +![Imgur](https://i.imgur.com/7y0Vbyd.jpg) + + +## First Time Setup + +Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: + +``` +$ make handwired/dactyl_manuform/5x6:YOUR_KEYMAP_NAME +``` + +If everything worked correctly you will see a file: + +``` +dactyl_manuform_5x6_YOUR_KEYMAP_NAME.hex +``` + +For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. + +## Keymaps +Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. +### Impstyle + + + +Required Hardware +----------------- + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. +* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable + +Alternatively, you can use any sort of cable and socket that has at least 3 +wires. If you want to use I2C to communicate between halves, you will need a +cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +Optional Hardware +----------------- +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +Wiring +------ + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + +The wiring for i2c: + +![i2c wiring](https://i.imgur.com/Hbzhc6E.png) + +The pull-up resistors may be placed on either half. It is also possible +to use 4 resistors and have the pull-ups in both halves, but this is +unnecessary in simple use cases. + +You can change your configuration between serial and i2c by modifying your `config.h` file. + +Notes on Software Configuration +------------------------------- + +the keymaps in here are for the 4x5 layout of the keyboard only. + +Flashing +------- +From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. +Example: `make lets_split/rev2:default:avrdude` + + +Choosing which board to plug the USB cable into (choosing Master) +-------- +Because the two boards are identical, the firmware has logic to differentiate the left and right board. + +It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. + +The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. + +The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. + +### Setting the left hand as master +If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. + +### Setting the right hand as master +If you always plug the usb cable into the right board, add an extra flag to your `config.h` +``` + #define MASTER_RIGHT +``` + +### Setting EE_hands to use either hands as master +If you define `EE_HANDS` in your `config.h`, you will need to set the +EEPROM for the left and right halves. + +The EEPROM is used to store whether the +half is left handed or right handed. This makes it so that the same firmware +file will run on both hands instead of having to flash left and right handed +versions of the firmware to each half. To flash the EEPROM file for the left +half run: +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +// or the equivalent in dfu-programmer + +``` +and similarly for right half +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +// or the equivalent in dfu-programmer +``` + +NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) + +After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. + +Note that you need to program both halves, but you have the option of using +different keymaps for each half. You could program the left half with a QWERTY +layout and the right half with a Colemak layout using bootmagic's default layout option. +Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the +right half is connected. + + +Notes on Using Pro Micro 3.3V +----------------------------- + +Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects +the frequency on the 3.3V board. + +Also, if the slave board is producing weird characters in certain columns, +update the following line in `matrix.c` to the following: + +``` +// _delay_us(30); // without this wait read unstable value. +_delay_us(300); // without this wait read unstable value. +``` diff --git a/keyboards/handwired/dactyl_manuform/5x6/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/rules.mk new file mode 100644 index 0000000000..6b1201781a --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/rules.mk @@ -0,0 +1,67 @@ +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SUBPROJECT_rev1 = yes +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes \ No newline at end of file diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h deleted file mode 100644 index 8917630e4a..0000000000 --- a/keyboards/handwired/dactyl_manuform/config.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x3060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER tshort -#define PRODUCT Dactyl-Manuform -#define DESCRIPTION A split keyboard for the cheap makers - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 10 -#define MATRIX_COLS 5 - -// wiring of each half -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -// #define MATRIX_COL_PINS { B5, B4, E6, D7, C6 } -#define MATRIX_COL_PINS { C6, D7, E6, B4, B5 } - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* mouse config */ -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Enables This makes it easier for fast typists to use dual-function keys */ -#define PERMISSIVE_HOLD - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * 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 - - -#endif diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/dactyl_manuform.c deleted file mode 100644 index 17caecb4fd..0000000000 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "dactyl_manuform.h" - - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h deleted file mode 100644 index 3dc8405ff9..0000000000 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef REV2_H -#define REV2_H - -#include "dactyl_manuform.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -#define LAYOUT( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ - L31, L32, R32, R33, \ - L33, L34, R30, R31, \ - L44, L43, R41, R40, \ - L42, L41, R43, R42 \ - ) \ - { \ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { KC_NO, L31, L32, L33, L34 }, \ - { KC_NO, L41, L42, L43, L44 }, \ -\ - { R04, R03, R02, R01, R00 }, \ - { R14, R13, R12, R11, R10 }, \ - { R24, R23, R22, R21, R20 }, \ - { KC_NO, R33, R32, R31, R30 }, \ - { KC_NO, R43, R42, R41, R40 } \ - } -#else -#define LAYOUT( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ - L31, L32, R32, R33, \ - L33, L34, R30, R31, \ - L44, L43, R41, R40, \ - L42, L41, R43, R42 \ - ) \ - { \ - { R04, R03, R02, R01, R00 }, \ - { R14, R13, R12, R11, R10 }, \ - { R24, R23, R22, R21, R20 }, \ - { KC_NO, R33, R32, R31, R30 }, \ - { KC_NO, R43, R42, R41, R40 }, \ -\ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { KC_NO, L31, L32, L33, L34 }, \ - { KC_NO, L41, L42, L43, L44 } \ -\ - } -#endif - -#endif diff --git a/keyboards/handwired/dactyl_manuform/eeprom-lefthand.eep b/keyboards/handwired/dactyl_manuform/eeprom-lefthand.eep deleted file mode 100644 index bda23cdb6e..0000000000 --- a/keyboards/handwired/dactyl_manuform/eeprom-lefthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000001F0 -:00000001FF diff --git a/keyboards/handwired/dactyl_manuform/eeprom-righthand.eep b/keyboards/handwired/dactyl_manuform/eeprom-righthand.eep deleted file mode 100644 index 549cd1ef0a..0000000000 --- a/keyboards/handwired/dactyl_manuform/eeprom-righthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000000F1 -:00000001FF diff --git a/keyboards/handwired/dactyl_manuform/i2c.c b/keyboards/handwired/dactyl_manuform/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/handwired/dactyl_manuform/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/handwired/dactyl_manuform/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/keymaps/default/config.h deleted file mode 100644 index 216917ed71..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/default/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -// #define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS - -#endif diff --git a/keyboards/handwired/dactyl_manuform/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/keymaps/default/keymap.c deleted file mode 100644 index 24c02215ee..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/default/keymap.c +++ /dev/null @@ -1,129 +0,0 @@ -#include "dactyl_manuform.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _RAISE 1 -#define _LOWER 2 - -// Fillers to make layering more clear - -#define ____ KC_TRNS - -#define SFT_ESC SFT_T(KC_ESC) -#define CTL_BSPC CTL_T(KC_BSPC) -#define ALT_SPC ALT_T(KC_SPC) -#define SFT_ENT SFT_T(KC_ENT) - -#define KC_ML KC_MS_LEFT -#define KC_MR KC_MS_RIGHT -#define KC_MU KC_MS_UP -#define KC_MD KC_MS_DOWN -#define KC_MB1 KC_MS_BTN1 -#define KC_MB2 KC_MS_BTN1 - -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Base (qwerty) - * ,----------------------------------, ,----------------------------------, - * | q | w | e | r | t | | y | u | i | o | p | - * |------+------+------+------+------| |-------------+------+------+------| - * | a | s | d | f | g | | h | j | k | l | ; | - * |------+------+------+------+------| |------|------+------+------+------| - * | z | x | c | v | b | | n | m | , | . | ' | - * |------+------+------+-------------, ,-------------+------+------+------, - * | [ | ] | | - | = | - * '------+------'-------------' '-------------'------+------' - * | ESC | BS | | SPACE|ENTER | - * | + | + | | + | + | - * | SHIFT| CTRL | | ALT |SHIFT | - * '------+------' '------+------' - * '------+------' '------+------' - * | TAB | HOME | | END | DEL | - * '------+------' '------+------' - * | Lower| ~ | | GUI | Raise| - * '------+------' '------+------' - */ - -[_BASE] = LAYOUT( \ - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, \ - KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, \ - SFT_ESC, CTL_BSPC, ALT_SPC, SFT_ENT, \ - KC_TAB, KC_HOME, KC_END, KC_DEL, \ - RAISE, KC_GRV, KC_LGUI, LOWER -), - -/* Raise - * ,----------------------------------, ,----------------------------------, - * | | | mup | | | | VOL+ | | up | | PgUp | - * |------+------+------+------+------| |-------------+------+------+------| - * | | mleft| mdown|mright| | | MUTE | left | down |right | PgDn | - * |------+------+------+------+------| |------|------+------+------+------| - * | | | | | | | VOL- | / | \ | ? | | | - * |------+------+------+-------------, ,-------------+------+------+------, - * | | | | mbtn |mbtn2 | - * '------+------'-------------' '-------------'------+------' - * | | | | | | - * | | | | | | - * | | | | | | - * '------+------' '------+------' - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - */ - -[_RAISE] = LAYOUT( \ - ____, ____, KC_MU, ____, ____, KC_VOLU, ____, KC_UP, ____, KC_PGUP, \ - ____, KC_ML, KC_MD, KC_MR, ____, KC_MUTE, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, \ - ____, ____, ____, ____, ____, KC_VOLD, KC_SLSH, KC_BSLS, KC_QUES, KC_PIPE, \ - ____, ____, KC_MB1, KC_MB2, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____ \ -), -/* Lower - * ,----------------------------------, ,----------------------------------, - * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | - * |------+------+------+------+------| |-------------+------+------+------| - * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | - * |------+------+------+------+------| |------|------+------+------+------| - * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - * |------+------+------+-------------, ,-------------+------+------+------, - * | F11 | F12 | | - | = | - * '------+------'-------------' '-------------'------+------' - * | | | | | | - * | | | | | | - * | | | | | | - * '------+------' '------+------' - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - */ - -[_LOWER] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ - KC_F11, KC_F12, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____ \ -) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - diff --git a/keyboards/handwired/dactyl_manuform/keymaps/default/rules.mk b/keyboards/handwired/dactyl_manuform/keymaps/default/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/default/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/config.h b/keyboards/handwired/dactyl_manuform/keymaps/dvorak/config.h deleted file mode 100644 index 216917ed71..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Use I2C or Serial, not both */ - -#define USE_SERIAL -// #define USE_I2C - -/* Select hand configuration */ - -// #define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS - -#endif diff --git a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/keymap.c b/keyboards/handwired/dactyl_manuform/keymaps/dvorak/keymap.c deleted file mode 100644 index 0a1c90b6bf..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/keymap.c +++ /dev/null @@ -1,129 +0,0 @@ -#include "dactyl_manuform.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -#define _BASE 0 -#define _RAISE 1 -#define _LOWER 2 - -// Fillers to make layering more clear - -#define ____ KC_TRNS - -#define SFT_ESC SFT_T(KC_ESC) -#define CTL_BSPC CTL_T(KC_BSPC) -#define ALT_SPC ALT_T(KC_SPC) -#define SFT_ENT SFT_T(KC_ENT) - -#define KC_ML KC_MS_LEFT -#define KC_MR KC_MS_RIGHT -#define KC_MU KC_MS_UP -#define KC_MD KC_MS_DOWN -#define KC_MB1 KC_MS_BTN1 -#define KC_MB2 KC_MS_BTN1 - -#define RAISE MO(_RAISE) -#define LOWER MO(_LOWER) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Base (dvorak) - * ,----------------------------------, ,----------------------------------, - * | ' | , | . | p | y | | f | g | c | r | l | - * |------+------+------+------+------| |-------------+------+------+------| - * | a | o | e | u | i | | d | h | t | n | s | - * |------+------+------+------+------| |------|------+------+------+------| - * | ; | q | j | k | x | | b | m | w | v | z | - * |------+------+------+-------------, ,-------------+------+------+------, - * | [ | ] | | - | = | - * '------+------'-------------' '-------------'------+------' - * | ESC | BS | | SPACE|ENTER | - * | + | + | | + | + | - * | SHIFT| CTRL | | ALT |SHIFT | - * '------+------' '------+------' - * '------+------' '------+------' - * | TAB | HOME | | END | DEL | - * '------+------' '------+------' - * | Lower| ~ | | GUI | Raise| - * '------+------' '------+------' - */ - -[_BASE] = LAYOUT( \ - KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ - KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, \ - KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, \ - KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, \ - SFT_ESC, CTL_BSPC, ALT_SPC, SFT_ENT, \ - KC_TAB, KC_HOME, KC_END, KC_DEL, \ - RAISE, KC_GRV, KC_LGUI, LOWER -), - -/* Raise - * ,----------------------------------, ,----------------------------------, - * | | | mup | | | | VOL+ | | up | | PgUp | - * |------+------+------+------+------| |-------------+------+------+------| - * | | mleft| mdown|mright| | | MUTE | left | down |right | PgDn | - * |------+------+------+------+------| |------|------+------+------+------| - * | | | | | | | VOL- | / | \ | ? | | | - * |------+------+------+-------------, ,-------------+------+------+------, - * | | | | mbtn |mbtn2 | - * '------+------'-------------' '-------------'------+------' - * | | | | | | - * | | | | | | - * | | | | | | - * '------+------' '------+------' - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - */ - -[_RAISE] = LAYOUT( \ - ____, ____, KC_MU, ____, ____, KC_VOLU, ____, KC_UP, ____, KC_PGUP, \ - ____, KC_ML, KC_MD, KC_MR, ____, KC_MUTE, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDOWN, \ - ____, ____, ____, ____, ____, KC_VOLD, KC_SLSH, KC_BSLS, KC_QUES, KC_PIPE, \ - ____, ____, KC_MB1, KC_MB2, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____ \ -), -/* Lower - * ,----------------------------------, ,----------------------------------, - * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | - * |------+------+------+------+------| |-------------+------+------+------| - * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 10 | - * |------+------+------+------+------| |------|------+------+------+------| - * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | - * |------+------+------+-------------, ,-------------+------+------+------, - * | F11 | F12 | | - | = | - * '------+------'-------------' '-------------'------+------' - * | | | | | | - * | | | | | | - * | | | | | | - * '------+------' '------+------' - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - * | | | | | | - * '------+------' '------+------' - */ - -[_LOWER] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ - KC_F11, KC_F12, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____, \ - ____, ____, ____, ____ \ -) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - diff --git a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/rules.mk b/keyboards/handwired/dactyl_manuform/keymaps/dvorak/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/handwired/dactyl_manuform/keymaps/dvorak/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/handwired/dactyl_manuform/matrix.c b/keyboards/handwired/dactyl_manuform/matrix.c deleted file mode 100644 index 904850d4d3..0000000000 --- a/keyboards/handwired/dactyl_manuform/matrix.c +++ /dev/null @@ -1,465 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md deleted file mode 100644 index 8b28757129..0000000000 --- a/keyboards/handwired/dactyl_manuform/readme.md +++ /dev/null @@ -1,161 +0,0 @@ -Dactyl Manuform -====== -the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. -![Imgur](https://i.imgur.com/7y0Vbyd.jpg) - - -## First Time Setup - -Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: - -``` -$ make dactyl_manuform:dvorak -``` - -You will see a lot of output and if everything worked correctly you will see the built hex file: - -``` -dactyl_manuform_dvorak.hex -``` - -If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so: - -``` -$ make dactyl_manuform:YOUR_KEYMAP_NAME -``` - -If everything worked correctly you will see a file: - -``` -dactyl_manuform_YOUR_KEYMAP_NAME.hex -``` - -For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. - -## Keymaps -Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. -### Qwerty and Dvorak -Qwerty base layer: -![Imgur](https://i.imgur.com/Yb5e7dS.png) -Dvorak base layer: -![Imgur](https://i.imgur.com/CpuZptB.png) -Both keymaps have the same Raise and Lower layers: -Raise Layer -![Imgur](https://i.imgur.com/nOqePK5.png) -Lower Layer -![Imgur](https://i.imgur.com/WSshkYc.png) - -Required Hardware ------------------ - -Apart from diodes and key switches for the keyboard matrix in each half, you -will need: - -* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. -* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable - -Alternatively, you can use any sort of cable and socket that has at least 3 -wires. If you want to use I2C to communicate between halves, you will need a -cable with at least 4 wires and 2x 4.7kΩ pull-up resistors - -Optional Hardware ------------------ -A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. - -Wiring ------- - -The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. -PD0 on the ATmega32u4) between the two Pro Micros. - -Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro -and modify the `matrix.c` accordingly. - -The wiring for serial: - -![serial wiring](https://i.imgur.com/C3D1GAQ.png) - -The wiring for i2c: - -![i2c wiring](https://i.imgur.com/Hbzhc6E.png) - -The pull-up resistors may be placed on either half. It is also possible -to use 4 resistors and have the pull-ups in both halves, but this is -unnecessary in simple use cases. - -You can change your configuration between serial and i2c by modifying your `config.h` file. - -Notes on Software Configuration -------------------------------- - -the keymaps in here are for the 4x5 layout of the keyboard only. - -Flashing -------- -From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. -Example: `make lets_split/rev2:default:avrdude` - - -Choosing which board to plug the USB cable into (choosing Master) --------- -Because the two boards are identical, the firmware has logic to differentiate the left and right board. - -It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. - -The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. - -The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. - -### Setting the left hand as master -If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. - -### Setting the right hand as master -If you always plug the usb cable into the right board, add an extra flag to your `config.h` -``` - #define MASTER_RIGHT -``` - -### Setting EE_hands to use either hands as master -If you define `EE_HANDS` in your `config.h`, you will need to set the -EEPROM for the left and right halves. - -The EEPROM is used to store whether the -half is left handed or right handed. This makes it so that the same firmware -file will run on both hands instead of having to flash left and right handed -versions of the firmware to each half. To flash the EEPROM file for the left -half run: -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep -// or the equivalent in dfu-programmer - -``` -and similarly for right half -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep -// or the equivalent in dfu-programmer -``` - -NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) - -After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. - -Note that you need to program both halves, but you have the option of using -different keymaps for each half. You could program the left half with a QWERTY -layout and the right half with a Colemak layout using bootmagic's default layout option. -Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the -right half is connected. - - -Notes on Using Pro Micro 3.3V ------------------------------ - -Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects -the frequency on the 3.3V board. - -Also, if the slave board is producing weird characters in certain columns, -update the following line in `matrix.c` to the following: - -``` -// _delay_us(30); // without this wait read unstable value. -_delay_us(300); // without this wait read unstable value. -``` diff --git a/keyboards/handwired/dactyl_manuform/rules.mk b/keyboards/handwired/dactyl_manuform/rules.mk deleted file mode 100644 index 6c0949b540..0000000000 --- a/keyboards/handwired/dactyl_manuform/rules.mk +++ /dev/null @@ -1,75 +0,0 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c \ - ssd1306.c - -# MCU name -#MCU = at90usb1287 -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -NKRO_ENABLE = no # 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 controls -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. -SUBPROJECT_rev1 = yes -USE_I2C = yes -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -CUSTOM_MATRIX = yes - -LAYOUTS = ortho_4x12 diff --git a/keyboards/handwired/dactyl_manuform/serial.c b/keyboards/handwired/dactyl_manuform/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/handwired/dactyl_manuform/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/handwired/dactyl_manuform/serial.h b/keyboards/handwired/dactyl_manuform/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/handwired/dactyl_manuform/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/handwired/dactyl_manuform/split_util.c b/keyboards/handwired/dactyl_manuform/split_util.c deleted file mode 100644 index 346cbc9089..0000000000 --- a/keyboards/handwired/dactyl_manuform/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/iris/keymaps/impstyle/keymap.c b/keyboards/iris/keymaps/impstyle/keymap.c index ba49cf72c3..30b4bf2d92 100644 --- a/keyboards/iris/keymaps/impstyle/keymap.c +++ b/keyboards/iris/keymaps/impstyle/keymap.c @@ -94,17 +94,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----| |----+----+----+----+----+----| // , , , , , , MS_WH_UP, , , , , , //|----+----+----+----+----+----| |----+----+----+----+----+----| - // MS_LEFT,MS_UP,MS_DOWN,MS_RGHT,,, MS_WH_DN,MS_BT1,MS_BT2,MS_BT3, , , + // ,,MS_LEFT,MS_UP,MS_DOWN,MS_RGHT,, MS_WH_DN,MS_BT1,MS_BT2,MS_BT3, , , //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| // , , , , , , , , , , ,MS_ACC0,MS_ACC1MS_ACC2 //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' // , , , , , // `----+----+----' `----+----+----' [_MOUSE] = LAYOUT( - _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, KC_MS_WH_UP,_______,_______,_______,_______,_______, - KC_MS_LEFT,KC_MS_UP,KC_MS_DOWN,KC_MS_RIGHT,_______,_______, KC_MS_WH_DOWN,KC_MS_BTN1,KC_MS_BTN2,KC_MS_BTN3,_______,_______, - _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, + _______,KC_MS_LEFT,KC_MS_UP,KC_MS_DOWN,KC_MS_RIGHT,_______, KC_MS_WH_DOWN,KC_MS_BTN1,KC_MS_BTN2,KC_MS_BTN3,_______,_______, + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,KC_MS_ACCEL0,KC_MS_ACCEL1,KC_MS_ACCEL2, _______,_______,_______, _______,_______,_______ ), -- cgit v1.2.3 From feec8ad4694814ed8953c6f72798f51f39724af5 Mon Sep 17 00:00:00 2001 From: zwnk Date: Tue, 14 Aug 2018 14:54:22 -0300 Subject: Keyboard: Add default keymap for dactyl_manuform 5x6 (#3649) * mouse layer keys shifted * mouse layer keys shifted * manuform 5x6 added * mouse layer keys shifted * manuform 5x6 added * dactyl_manuform 5x6 keymap added * reorg. dactyl manuform folder * removed LAYOUTS = ortho_4x12 for 4x5 * Rows and Cols in config.h fixed * MASTER_LEFT * 5x6 matrix fixed * keymap updated * removed the i2c, serial, split_util and matrix files and inserted SPLIT_KEYBOARD * default keymap for dactyl_manuform 5x6 * Fixes for Dactyl Manuform * Add/update default keymap --- keyboards/handwired/dactyl_manuform/4x5/4x5.c | 23 ++++ keyboards/handwired/dactyl_manuform/4x5/4x5.h | 70 ++++++++++ keyboards/handwired/dactyl_manuform/4x5/config.h | 53 +------- .../dactyl_manuform/4x5/dactyl_manuform.c | 23 ---- .../dactyl_manuform/4x5/dactyl_manuform.h | 71 ----------- keyboards/handwired/dactyl_manuform/4x5/rules.mk | 49 +------ keyboards/handwired/dactyl_manuform/5x6/5x6.c | 23 ++++ keyboards/handwired/dactyl_manuform/5x6/5x6.h | 46 +++++++ keyboards/handwired/dactyl_manuform/5x6/config.h | 62 +-------- .../dactyl_manuform/5x6/dactyl_manuform.c | 23 ---- .../dactyl_manuform/5x6/dactyl_manuform.h | 47 ------- .../dactyl_manuform/5x6/keymaps/default/config.h | 27 ++++ .../dactyl_manuform/5x6/keymaps/default/keymap.c | 71 +++++++++++ .../dactyl_manuform/5x6/keymaps/impstyle/config.h | 5 +- .../dactyl_manuform/5x6/keymaps/impstyle/keymap.c | 26 ++-- keyboards/handwired/dactyl_manuform/5x6/rules.mk | 48 +------ keyboards/handwired/dactyl_manuform/config.h | 78 +++++++++++ .../handwired/dactyl_manuform/dactyl_manuform.c | 1 + .../handwired/dactyl_manuform/dactyl_manuform.h | 22 ++++ keyboards/handwired/dactyl_manuform/readme.md | 142 +++++++++++++++++++++ keyboards/handwired/dactyl_manuform/rules.mk | 66 ++++++++++ 21 files changed, 588 insertions(+), 388 deletions(-) create mode 100644 keyboards/handwired/dactyl_manuform/4x5/4x5.c create mode 100644 keyboards/handwired/dactyl_manuform/4x5/4x5.h delete mode 100644 keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c delete mode 100644 keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/5x6.c create mode 100644 keyboards/handwired/dactyl_manuform/5x6/5x6.h delete mode 100644 keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c delete mode 100644 keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/default/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/config.h create mode 100644 keyboards/handwired/dactyl_manuform/dactyl_manuform.c create mode 100644 keyboards/handwired/dactyl_manuform/dactyl_manuform.h create mode 100644 keyboards/handwired/dactyl_manuform/readme.md create mode 100644 keyboards/handwired/dactyl_manuform/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/4x5/4x5.c b/keyboards/handwired/dactyl_manuform/4x5/4x5.c new file mode 100644 index 0000000000..78c0fee819 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/4x5.c @@ -0,0 +1,23 @@ +#include "4x5.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/4x5/4x5.h b/keyboards/handwired/dactyl_manuform/4x5/4x5.h new file mode 100644 index 0000000000..b34d97adbf --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/4x5.h @@ -0,0 +1,70 @@ +#pragma once + +#include "dactyl_manuform.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +#define LAYOUT( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L31, L32, R32, R33, \ + L33, L34, R30, R31, \ + L44, L43, R41, R40, \ + L42, L41, R43, R42 \ + ) \ + { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { KC_NO, L31, L32, L33, L34 }, \ + { KC_NO, L41, L42, L43, L44 }, \ +\ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { KC_NO, R33, R32, R31, R30 }, \ + { KC_NO, R43, R42, R41, R40 } \ + } +#else + + + +#define LAYOUT( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L31, L32, R32, R33, \ + L33, L34, R30, R31, \ + L44, L43, R41, R40, \ + L42, L41, R43, R42 \ + ) \ + { \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { KC_NO, R33, R32, R31, R30 }, \ + { KC_NO, R43, R42, R41, R40 }, \ +\ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { KC_NO, L31, L32, L33, L34 }, \ + { KC_NO, L41, L42, L43, L44 } \ +\ + } +#endif + diff --git a/keyboards/handwired/dactyl_manuform/4x5/config.h b/keyboards/handwired/dactyl_manuform/4x5/config.h index 8917630e4a..c8417a2f0f 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/config.h @@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -26,7 +25,6 @@ along with this program. If not, see . #define PRODUCT_ID 0x3060 #define DEVICE_VER 0x0001 #define MANUFACTURER tshort -#define PRODUCT Dactyl-Manuform #define DESCRIPTION A split keyboard for the cheap makers /* key matrix size */ @@ -45,53 +43,4 @@ along with this program. If not, see . /* number of backlight levels */ // #define BACKLIGHT_LEVELS 3 -/* mouse config */ -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Enables This makes it easier for fast typists to use dual-function keys */ -#define PERMISSIVE_HOLD - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * 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 - - -#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c deleted file mode 100644 index 17caecb4fd..0000000000 --- a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "dactyl_manuform.h" - - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - diff --git a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h deleted file mode 100644 index 7e126d3017..0000000000 --- a/keyboards/handwired/dactyl_manuform/4x5/dactyl_manuform.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef REV2_H -#define REV2_H - -#include "dactyl_manuform.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -#define LAYOUT( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ - L31, L32, R32, R33, \ - L33, L34, R30, R31, \ - L44, L43, R41, R40, \ - L42, L41, R43, R42 \ - ) \ - { \ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { KC_NO, L31, L32, L33, L34 }, \ - { KC_NO, L41, L42, L43, L44 }, \ -\ - { R04, R03, R02, R01, R00 }, \ - { R14, R13, R12, R11, R10 }, \ - { R24, R23, R22, R21, R20 }, \ - { KC_NO, R33, R32, R31, R30 }, \ - { KC_NO, R43, R42, R41, R40 } \ - } -#else - - - -#define LAYOUT( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ - L31, L32, R32, R33, \ - L33, L34, R30, R31, \ - L44, L43, R41, R40, \ - L42, L41, R43, R42 \ - ) \ - { \ - { R04, R03, R02, R01, R00 }, \ - { R14, R13, R12, R11, R10 }, \ - { R24, R23, R22, R21, R20 }, \ - { KC_NO, R33, R32, R31, R30 }, \ - { KC_NO, R43, R42, R41, R40 }, \ -\ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { KC_NO, L31, L32, L33, L34 }, \ - { KC_NO, L41, L42, L43, L44 } \ -\ - } -#endif -#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/rules.mk index 99ac2880d5..14b6e1e4e3 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/rules.mk +++ b/keyboards/handwired/dactyl_manuform/4x5/rules.mk @@ -1,47 +1,3 @@ -# MCU name -#MCU = at90usb1287 -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Build Options # change to "no" to disable the options, or define them in the Makefile in @@ -59,10 +15,7 @@ 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. -SUBPROJECT_rev1 = yes -USE_I2C = yes + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -SPLIT_KEYBOARD = yes - diff --git a/keyboards/handwired/dactyl_manuform/5x6/5x6.c b/keyboards/handwired/dactyl_manuform/5x6/5x6.c new file mode 100644 index 0000000000..68fceffd92 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/5x6.c @@ -0,0 +1,23 @@ +#include "5x6.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/5x6/5x6.h b/keyboards/handwired/dactyl_manuform/5x6/5x6.h new file mode 100644 index 0000000000..cb225a2cf2 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/5x6.h @@ -0,0 +1,46 @@ +#pragma once + +#include "dactyl_manuform.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + +#define LAYOUT_5x6(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L42, L43, R42, R43, \ + L44, L45, R40, R41, \ + L54, L55, R50, R51, \ + L52, L53, R52, R53 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, L52, L53, L54, L55 }, \ +\ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, KC_NO, KC_NO },\ + { R50, R51, R52, R53, KC_NO, KC_NO }, \ + } + + diff --git a/keyboards/handwired/dactyl_manuform/5x6/config.h b/keyboards/handwired/dactyl_manuform/5x6/config.h index 97495e9350..06ac02dfcb 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/config.h +++ b/keyboards/handwired/dactyl_manuform/5x6/config.h @@ -16,18 +16,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x3060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER tshort -#define PRODUCT Dactyl-Manuform -#define DESCRIPTION A split keyboard for the cheap makers + +#define PRODUCT Dactyl-Manuform (5x6) /* key matrix size */ // Rows are doubled-up @@ -45,53 +39,3 @@ along with this program. If not, see . /* number of backlight levels */ // #define BACKLIGHT_LEVELS 3 -/* mouse config */ -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Enables This makes it easier for fast typists to use dual-function keys */ -#define PERMISSIVE_HOLD - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * 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 - - -#endif diff --git a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c deleted file mode 100644 index 17caecb4fd..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.c +++ /dev/null @@ -1,23 +0,0 @@ -#include "dactyl_manuform.h" - - -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif - -void matrix_init_kb(void) { - - // // green led on - // DDRD |= (1<<5); - // PORTD &= ~(1<<5); - - // // orange led on - // DDRB |= (1<<0); - // PORTB &= ~(1<<0); - - matrix_init_user(); -}; - diff --git a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h deleted file mode 100644 index 5c1a4339bd..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6/dactyl_manuform.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef REV2_H -#define REV2_H - -#include "dactyl_manuform.h" - -//void promicro_bootloader_jmp(bool program); -#include "quantum.h" - - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - -//void promicro_bootloader_jmp(bool program); - - -#define LAYOUT_5x6(\ - L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ - L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ - L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ - L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ - L42, L43, R42, R43, \ - L44, L45, R40, R41, \ - L54, L55, R50, R51, \ - L52, L53, R52, R53 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05 }, \ - { L10, L11, L12, L13, L14, L15 }, \ - { L20, L21, L22, L23, L24, L25 }, \ - { L30, L31, L32, L33, L34, L35 }, \ - { KC_NO, KC_NO, L42, L43, L44, L45 }, \ - { KC_NO, KC_NO, L52, L53, L54, L55 }, \ -\ - { R00, R01, R02, R03, R04, R05 }, \ - { R10, R11, R12, R13, R14, R15 }, \ - { R20, R21, R22, R23, R24, R25 }, \ - { R30, R31, R32, R33, R34, R35 }, \ - { R40, R41, R42, R43, KC_NO, KC_NO },\ - { R50, R51, R52, R53, KC_NO, KC_NO }, \ - } - -#endif diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/config.h new file mode 100644 index 0000000000..29ab59ad66 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2012 Jun Wako + +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 + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c new file mode 100644 index 0000000000..d0bcbd4e6b --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +#include QMK_KEYBOARD_H + + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +#define _______ KC_TRNS + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + + [_QWERTY] = LAYOUT_5x6( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, + KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, + RAISE,KC_SPC, KC_ENT, LOWER, + KC_TAB,KC_HOME, KC_END, KC_DEL, + KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + ), + + [_LOWER] = LAYOUT_5x6( + + KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS, + _______,KC_PSCR, _______, KC_P0, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ +), + + [_RAISE] = LAYOUT_5x6( + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______, KC_EQL ,_______, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ + ), + + }; + diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h index 1a7d1e0659..d046806eaa 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/config.h @@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ +#pragma once #define USE_SERIAL @@ -22,7 +23,3 @@ along with this program. If not, see . // #define MASTER_RIGHT //#define EE_HANDS // Rows are doubled-up -#define MATRIX_ROWS 12 -#define MATRIX_COLS 6 - -#include "../../config.h" diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c index 7dd9f7c869..0282ccc7f9 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c @@ -1,6 +1,4 @@ -#include "dactyl_manuform.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -33,18 +31,18 @@ extern keymap_config_t keymap_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_5x6( - KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, - KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, - KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, - KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, - RAISE,KC_SPC, KC_ENT, LOWER, - KC_TAB,KC_HOME, KC_END, KC_DEL, - KC_BSPC, KC_GRV, KC_LGUI, KC_LALT - ), + [_QWERTY] = LAYOUT_5x6( + KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, + KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, + RAISE,KC_SPC, KC_ENT, LOWER, + KC_TAB,KC_HOME, KC_END, KC_DEL, + KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + ), - [_LOWER] = LAYOUT_5x6( + [_LOWER] = LAYOUT_5x6( KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, diff --git a/keyboards/handwired/dactyl_manuform/5x6/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/rules.mk index 6b1201781a..14b6e1e4e3 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/rules.mk +++ b/keyboards/handwired/dactyl_manuform/5x6/rules.mk @@ -1,47 +1,3 @@ -# MCU name -#MCU = at90usb1287 -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Build Options # change to "no" to disable the options, or define them in the Makefile in @@ -59,9 +15,7 @@ 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. -SUBPROJECT_rev1 = yes -USE_I2C = yes + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -SPLIT_KEYBOARD = yes \ No newline at end of file diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h new file mode 100644 index 0000000000..19cd356d89 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tshort +// defined in subfolder +#define DESCRIPTION A split keyboard for the cheap makers + +/* mouse config */ +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Enables This makes it easier for fast typists to use dual-function keys */ +#define PERMISSIVE_HOLD + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs + + +/* + * 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/handwired/dactyl_manuform/dactyl_manuform.c b/keyboards/handwired/dactyl_manuform/dactyl_manuform.c new file mode 100644 index 0000000000..043bbd5672 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.c @@ -0,0 +1 @@ +#include "dactyl_manuform.h" diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h new file mode 100644 index 0000000000..6c23e9143d --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h @@ -0,0 +1,22 @@ +#pragma once + + +#ifdef KEYBOARD_handwired_dactyl_manuform_5x6 + #include "5x6.h" +#elif KEYBOARD_handwired_dactyl_manuform_4x5 + #include "4x5.h" +#endif + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + + diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md new file mode 100644 index 0000000000..eb76a7150e --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/readme.md @@ -0,0 +1,142 @@ +Dactyl Manuform 5x6 +====== +the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. +![Imgur](https://i.imgur.com/7y0Vbyd.jpg) + + +## First Time Setup + +Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: + +``` +$ make handwired/dactyl_manuform/5x6:YOUR_KEYMAP_NAME +``` + +If everything worked correctly you will see a file: + +``` +dactyl_manuform_5x6_YOUR_KEYMAP_NAME.hex +``` + +For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. + +## Keymaps +Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. +### Impstyle + + + +Required Hardware +----------------- + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. +* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable + +Alternatively, you can use any sort of cable and socket that has at least 3 +wires. If you want to use I2C to communicate between halves, you will need a +cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +Optional Hardware +----------------- +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +Wiring +------ + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + +The wiring for i2c: + +![i2c wiring](https://i.imgur.com/Hbzhc6E.png) + +The pull-up resistors may be placed on either half. It is also possible +to use 4 resistors and have the pull-ups in both halves, but this is +unnecessary in simple use cases. + +You can change your configuration between serial and i2c by modifying your `config.h` file. + +Notes on Software Configuration +------------------------------- + +the keymaps in here are for the 4x5 layout of the keyboard only. + +Flashing +------- +From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. +Example: `make lets_split/rev2:default:avrdude` + + +Choosing which board to plug the USB cable into (choosing Master) +-------- +Because the two boards are identical, the firmware has logic to differentiate the left and right board. + +It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. + +The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. + +The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. + +### Setting the left hand as master +If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. + +### Setting the right hand as master +If you always plug the usb cable into the right board, add an extra flag to your `config.h` +``` + #define MASTER_RIGHT +``` + +### Setting EE_hands to use either hands as master +If you define `EE_HANDS` in your `config.h`, you will need to set the +EEPROM for the left and right halves. + +The EEPROM is used to store whether the +half is left handed or right handed. This makes it so that the same firmware +file will run on both hands instead of having to flash left and right handed +versions of the firmware to each half. To flash the EEPROM file for the left +half run: +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +// or the equivalent in dfu-programmer + +``` +and similarly for right half +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +// or the equivalent in dfu-programmer +``` + +NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) + +After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. + +Note that you need to program both halves, but you have the option of using +different keymaps for each half. You could program the left half with a QWERTY +layout and the right half with a Colemak layout using bootmagic's default layout option. +Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the +right half is connected. + + +Notes on Using Pro Micro 3.3V +----------------------------- + +Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects +the frequency on the 3.3V board. + +Also, if the slave board is producing weird characters in certain columns, +update the following line in `matrix.c` to the following: + +``` +// _delay_us(30); // without this wait read unstable value. +_delay_us(300); // without this wait read unstable value. +``` diff --git a/keyboards/handwired/dactyl_manuform/rules.mk b/keyboards/handwired/dactyl_manuform/rules.mk new file mode 100644 index 0000000000..adb058c8af --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/rules.mk @@ -0,0 +1,66 @@ +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes -- cgit v1.2.3 From ad2bb529c795be066b279f52bebec03257992fc2 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 15 Aug 2018 08:19:38 +0300 Subject: Rgb matrix arm (#3648) * Addition of I2C master driver for STM32, Generalization of ISSI3731 driver - Addition of an i2c_master driver for STM32 to replicate expectations of AVR driver. - Moved ISSI3731 driver one level up to make it accesible by both architectures. - Renamed ISSI3731 functions to a more general name for preparation of other ISSI drivers. - Added compiler directives where necessary to differenciate each architecture. * converted tabs to spaces --- drivers/arm/i2c_master.c | 103 ++++++++++++++++++ drivers/arm/i2c_master.h | 39 +++++++ drivers/avr/is31fl3731.c | 262 --------------------------------------------- drivers/avr/is31fl3731.h | 214 ------------------------------------- drivers/is31fl3731.c | 271 +++++++++++++++++++++++++++++++++++++++++++++++ drivers/is31fl3731.h | 214 +++++++++++++++++++++++++++++++++++++ quantum/rgb_matrix.c | 20 ++-- 7 files changed, 637 insertions(+), 486 deletions(-) create mode 100644 drivers/arm/i2c_master.c create mode 100644 drivers/arm/i2c_master.h delete mode 100644 drivers/avr/is31fl3731.c delete mode 100644 drivers/avr/is31fl3731.h create mode 100644 drivers/is31fl3731.c create mode 100644 drivers/is31fl3731.h diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c new file mode 100644 index 0000000000..2fdd9f65e1 --- /dev/null +++ b/drivers/arm/i2c_master.c @@ -0,0 +1,103 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * 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 . + */ + +/* This library follows the convention of the AVR i2c_master library. + * As a result addresses are expected to be already shifted (addr << 1). + * I2CD1 is the default driver which corresponds to pins B6 and B7. This + * can be changed. + * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that + * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. + */ + +#include "i2c_master.h" +#include +#include + +static uint8_t i2c_address; + +// This configures the I2C clock to 400Mhz assuming a 72Mhz clock +// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html +static const I2CConfig i2cconfig = { + STM32_TIMINGR_PRESC(15U) | + STM32_TIMINGR_SCLDEL(4U) | STM32_TIMINGR_SDADEL(2U) | + STM32_TIMINGR_SCLH(15U) | STM32_TIMINGR_SCLL(21U), + 0, + 0 +}; + +void i2c_init(void) +{ + palSetGroupMode(GPIOB,6,7, PAL_MODE_INPUT); // Try releasing special pins for a short time + chThdSleepMilliseconds(10); + + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); + + //i2cInit(); //This is invoked by halInit() so no need to redo it. +} + +// This is usually not needed +uint8_t i2c_start(uint8_t address) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + return 0; +} + +uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout)); +} + +uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = address; + i2cStart(&I2C_DRIVER, &i2cconfig); + return i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout)); +} + +uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = devaddr; + i2cStart(&I2C_DRIVER, &i2cconfig); + + uint8_t complete_packet[length + 1]; + for(uint8_t i = 0; i < length; i++) + { + complete_packet[i+1] = data[i]; + } + complete_packet[0] = regaddr + + return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); +} + +uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +{ + i2c_address = devaddr; + i2cStart(&I2C_DRIVER, &i2cconfig); + return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout)); +} + +// This is usually not needed. It releases the driver to allow pins to become GPIO again. +uint8_t i2c_stop(uint16_t timeout) +{ + i2c_address = address; + i2cStop(&I2C_DRIVER); + return 0; +} diff --git a/drivers/arm/i2c_master.h b/drivers/arm/i2c_master.h new file mode 100644 index 0000000000..9d51245be1 --- /dev/null +++ b/drivers/arm/i2c_master.h @@ -0,0 +1,39 @@ +/* Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * This program is free sofare: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Sofare 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 . + */ + +/* This library follows the convention of the AVR i2c_master library. + * As a result addresses are expected to be already shifted (addr << 1). + * I2CD1 is the default driver which corresponds to pins B6 and B7. This + * can be changed. + * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that + * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. + */ + +#include "ch.h" +#include + +#ifndef I2C_DRIVER + #define I2C_DRIVER I2CD1 +#endif + +void i2c_init(void); +uint8_t i2c_start(uint8_t address); +uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); +uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); +uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +void i2c_stop(void); diff --git a/drivers/avr/is31fl3731.c b/drivers/avr/is31fl3731.c deleted file mode 100644 index 70813464b2..0000000000 --- a/drivers/avr/is31fl3731.c +++ /dev/null @@ -1,262 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * - * 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 . - */ - -#include "is31fl3731.h" -#include -#include -#include -#include -#include "i2c_master.h" -#include "progmem.h" - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 0b1110100 AD <-> GND -// 0b1110111 AD <-> VCC -// 0b1110101 AD <-> SCL -// 0b1110110 AD <-> SDA -#define ISSI_ADDR_DEFAULT 0x74 - -#define ISSI_REG_CONFIG 0x00 -#define ISSI_REG_CONFIG_PICTUREMODE 0x00 -#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 -#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 - -#define ISSI_CONF_PICTUREMODE 0x00 -#define ISSI_CONF_AUTOFRAMEMODE 0x04 -#define ISSI_CONF_AUDIOMODE 0x08 - -#define ISSI_REG_PICTUREFRAME 0x01 - -#define ISSI_REG_SHUTDOWN 0x0A -#define ISSI_REG_AUDIOSYNC 0x06 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' - -#ifndef ISSI_TIMEOUT - #define ISSI_TIMEOUT 100 -#endif - -#ifndef ISSI_PERSISTENCE - #define ISSI_PERSISTENCE 0 -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. -// Storing them like this is optimal for I2C transfers to the registers. -// We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's -// probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][144]; -bool g_pwm_buffer_update_required = false; - -uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; -bool g_led_control_registers_update_required = false; - -// This is the bit pattern in the LED control registers -// (for matrix A, add one to register for matrix B) -// -// reg - b7 b6 b5 b4 b3 b2 b1 b0 -// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 -// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 -// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 -// 0x06 - - , - , - , - , - ,B02,B01,B00 -// 0x08 - - , - , - , - , - , - , - , - -// 0x0A - B17,B16,B15, - , - , - , - , - -// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 -// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 -// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 - - -void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ) -{ - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - - #if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) - break; - } - #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); - #endif -} - -void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) -{ - // assumes bank is already selected - - // transmit PWM registers in 9 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes - - // iterate over the pwm_buffer contents at 16 byte intervals - for ( int i = 0; i < 144; i += 16 ) { - // set the first register, e.g. 0x24, 0x34, 0x44, etc. - g_twi_transfer_buffer[0] = 0x24 + i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer - for ( int j = 0; j < 16; j++ ) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - - #if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) - break; - } - #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); - #endif - } -} - -void IS31FL3731_init( uint8_t addr ) -{ - // In order to avoid the LEDs being driven with garbage data - // in the LED driver's PWM registers, first enable software shutdown, - // then set up the mode and other settings, clear the PWM registers, - // then disable software shutdown. - - // select "function register" bank - IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); - - // enable software shutdown - IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); - // this delay was copied from other drivers, might not be needed - _delay_ms( 10 ); - - // picture mode - IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); - // display frame 0 - IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); - // audio sync off - IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); - - // select bank 0 - IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); - - // turn off all LEDs in the LED control register - for ( int i = 0x00; i <= 0x11; i++ ) - { - IS31FL3731_write_register( addr, i, 0x00 ); - } - - // turn off all LEDs in the blink control register (not really needed) - for ( int i = 0x12; i <= 0x23; i++ ) - { - IS31FL3731_write_register( addr, i, 0x00 ); - } - - // set PWM on all LEDs to 0 - for ( int i = 0x24; i <= 0xB3; i++ ) - { - IS31FL3731_write_register( addr, i, 0x00 ); - } - - // select "function register" bank - IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); - - // disable software shutdown - IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); - - // select bank 0 and leave it selected. - // most usage after initialization is just writing PWM buffers in bank 0 - // as there's not much point in double-buffering - IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); - -} - -void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - if ( index >= 0 && index < DRIVER_LED_TOTAL ) { - is31_led led = g_is31_leds[index]; - - // Subtract 0x24 to get the second index of g_pwm_buffer - g_pwm_buffer[led.driver][led.r - 0x24] = red; - g_pwm_buffer[led.driver][led.g - 0x24] = green; - g_pwm_buffer[led.driver][led.b - 0x24] = blue; - g_pwm_buffer_update_required = true; - } -} - -void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) - { - IS31FL3731_set_color( i, red, green, blue ); - } -} - -void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) -{ - is31_led led = g_is31_leds[index]; - - uint8_t control_register_r = (led.r - 0x24) / 8; - uint8_t control_register_g = (led.g - 0x24) / 8; - uint8_t control_register_b = (led.b - 0x24) / 8; - uint8_t bit_r = (led.r - 0x24) % 8; - uint8_t bit_g = (led.g - 0x24) % 8; - uint8_t bit_b = (led.b - 0x24) % 8; - - if ( red ) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); - } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); - } - if ( green ) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); - } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); - } - if ( blue ) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); - } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); - } - - g_led_control_registers_update_required = true; - -} - -void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) -{ - if ( g_pwm_buffer_update_required ) - { - IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] ); - IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] ); - } - g_pwm_buffer_update_required = false; -} - -void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) -{ - if ( g_led_control_registers_update_required ) - { - for ( int i=0; i<18; i++ ) - { - IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] ); - IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] ); - } - } -} - diff --git a/drivers/avr/is31fl3731.h b/drivers/avr/is31fl3731.h deleted file mode 100644 index 3d30fc67b7..0000000000 --- a/drivers/avr/is31fl3731.h +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * - * 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 . - */ - - -#ifndef IS31FL3731_DRIVER_H -#define IS31FL3731_DRIVER_H - -#include -#include - -typedef struct is31_led { - uint8_t driver:2; - uint8_t r; - uint8_t g; - uint8_t b; -} __attribute__((packed)) is31_led; - -extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; - -void IS31FL3731_init( uint8_t addr ); -void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ); -void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); - -void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); -void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); - -void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); -void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); - -#define C1_1 0x24 -#define C1_2 0x25 -#define C1_3 0x26 -#define C1_4 0x27 -#define C1_5 0x28 -#define C1_6 0x29 -#define C1_7 0x2A -#define C1_8 0x2B - -#define C1_9 0x2C -#define C1_10 0x2D -#define C1_11 0x2E -#define C1_12 0x2F -#define C1_13 0x30 -#define C1_14 0x31 -#define C1_15 0x32 -#define C1_16 0x33 - -#define C2_1 0x34 -#define C2_2 0x35 -#define C2_3 0x36 -#define C2_4 0x37 -#define C2_5 0x38 -#define C2_6 0x39 -#define C2_7 0x3A -#define C2_8 0x3B - -#define C2_9 0x3C -#define C2_10 0x3D -#define C2_11 0x3E -#define C2_12 0x3F -#define C2_13 0x40 -#define C2_14 0x41 -#define C2_15 0x42 -#define C2_16 0x43 - -#define C3_1 0x44 -#define C3_2 0x45 -#define C3_3 0x46 -#define C3_4 0x47 -#define C3_5 0x48 -#define C3_6 0x49 -#define C3_7 0x4A -#define C3_8 0x4B - -#define C3_9 0x4C -#define C3_10 0x4D -#define C3_11 0x4E -#define C3_12 0x4F -#define C3_13 0x50 -#define C3_14 0x51 -#define C3_15 0x52 -#define C3_16 0x53 - -#define C4_1 0x54 -#define C4_2 0x55 -#define C4_3 0x56 -#define C4_4 0x57 -#define C4_5 0x58 -#define C4_6 0x59 -#define C4_7 0x5A -#define C4_8 0x5B - -#define C4_9 0x5C -#define C4_10 0x5D -#define C4_11 0x5E -#define C4_12 0x5F -#define C4_13 0x60 -#define C4_14 0x61 -#define C4_15 0x62 -#define C4_16 0x63 - -#define C5_1 0x64 -#define C5_2 0x65 -#define C5_3 0x66 -#define C5_4 0x67 -#define C5_5 0x68 -#define C5_6 0x69 -#define C5_7 0x6A -#define C5_8 0x6B - -#define C5_9 0x6C -#define C5_10 0x6D -#define C5_11 0x6E -#define C5_12 0x6F -#define C5_13 0x70 -#define C5_14 0x71 -#define C5_15 0x72 -#define C5_16 0x73 - -#define C6_1 0x74 -#define C6_2 0x75 -#define C6_3 0x76 -#define C6_4 0x77 -#define C6_5 0x78 -#define C6_6 0x79 -#define C6_7 0x7A -#define C6_8 0x7B - -#define C6_9 0x7C -#define C6_10 0x7D -#define C6_11 0x7E -#define C6_12 0x7F -#define C6_13 0x80 -#define C6_14 0x81 -#define C6_15 0x82 -#define C6_16 0x83 - -#define C7_1 0x84 -#define C7_2 0x85 -#define C7_3 0x86 -#define C7_4 0x87 -#define C7_5 0x88 -#define C7_6 0x89 -#define C7_7 0x8A -#define C7_8 0x8B - -#define C7_9 0x8C -#define C7_10 0x8D -#define C7_11 0x8E -#define C7_12 0x8F -#define C7_13 0x90 -#define C7_14 0x91 -#define C7_15 0x92 -#define C7_16 0x93 - -#define C8_1 0x94 -#define C8_2 0x95 -#define C8_3 0x96 -#define C8_4 0x97 -#define C8_5 0x98 -#define C8_6 0x99 -#define C8_7 0x9A -#define C8_8 0x9B - -#define C8_9 0x9C -#define C8_10 0x9D -#define C8_11 0x9E -#define C8_12 0x9F -#define C8_13 0xA0 -#define C8_14 0xA1 -#define C8_15 0xA2 -#define C8_16 0xA3 - -#define C9_1 0xA4 -#define C9_2 0xA5 -#define C9_3 0xA6 -#define C9_4 0xA7 -#define C9_5 0xA8 -#define C9_6 0xA9 -#define C9_7 0xAA -#define C9_8 0xAB - -#define C9_9 0xAC -#define C9_10 0xAD -#define C9_11 0xAE -#define C9_12 0xAF -#define C9_13 0xB0 -#define C9_14 0xB1 -#define C9_15 0xB2 -#define C9_16 0xB3 - - - -#endif // IS31FL3731_DRIVER_H diff --git a/drivers/is31fl3731.c b/drivers/is31fl3731.c new file mode 100644 index 0000000000..0524feb49f --- /dev/null +++ b/drivers/is31fl3731.c @@ -0,0 +1,271 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * + * 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 . + */ + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include "is31fl3731.h" +#include +#include "i2c_master.h" +#include "progmem.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define ISSI_ADDR_DEFAULT 0x74 + +#define ISSI_REG_CONFIG 0x00 +#define ISSI_REG_CONFIG_PICTUREMODE 0x00 +#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 +#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 + +#define ISSI_CONF_PICTUREMODE 0x00 +#define ISSI_CONF_AUTOFRAMEMODE 0x04 +#define ISSI_CONF_AUDIOMODE 0x08 + +#define ISSI_REG_PICTUREFRAME 0x01 + +#define ISSI_REG_SHUTDOWN 0x0A +#define ISSI_REG_AUDIOSYNC 0x06 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][144]; +bool g_pwm_buffer_update_required = false; + +uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; +bool g_led_control_registers_update_required = false; + +// This is the bit pattern in the LED control registers +// (for matrix A, add one to register for matrix B) +// +// reg - b7 b6 b5 b4 b3 b2 b1 b0 +// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 +// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 +// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 +// 0x06 - - , - , - , - , - ,B02,B01,B00 +// 0x08 - - , - , - , - , - , - , - , - +// 0x0A - B17,B16,B15, - , - , - , - , - +// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 +// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 +// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 + + +void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) +{ + // assumes bank is already selected + + // transmit PWM registers in 9 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for ( int i = 0; i < 144; i += 16 ) { + // set the first register, e.g. 0x24, 0x34, 0x44, etc. + g_twi_transfer_buffer[0] = 0x24 + i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer + for ( int j = 0; j < 16; j++ ) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31_init( uint8_t addr ) +{ + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, first enable software shutdown, + // then set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // select "function register" bank + IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); + + // enable software shutdown + IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); + // this delay was copied from other drivers, might not be needed + #ifdef __AVR__ + _delay_ms( 10 ); + #else + wait_ms(10); + #endif + + // picture mode + IS31_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); + // display frame 0 + IS31_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); + // audio sync off + IS31_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); + + // select bank 0 + IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 ); + + // turn off all LEDs in the LED control register + for ( int i = 0x00; i <= 0x11; i++ ) + { + IS31_write_register( addr, i, 0x00 ); + } + + // turn off all LEDs in the blink control register (not really needed) + for ( int i = 0x12; i <= 0x23; i++ ) + { + IS31_write_register( addr, i, 0x00 ); + } + + // set PWM on all LEDs to 0 + for ( int i = 0x24; i <= 0xB3; i++ ) + { + IS31_write_register( addr, i, 0x00 ); + } + + // select "function register" bank + IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); + + // disable software shutdown + IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); + + // select bank 0 and leave it selected. + // most usage after initialization is just writing PWM buffers in bank 0 + // as there's not much point in double-buffering + IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 ); + +} + +void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + if ( index >= 0 && index < DRIVER_LED_TOTAL ) { + is31_led led = g_is31_leds[index]; + + // Subtract 0x24 to get the second index of g_pwm_buffer + g_pwm_buffer[led.driver][led.r - 0x24] = red; + g_pwm_buffer[led.driver][led.g - 0x24] = green; + g_pwm_buffer[led.driver][led.b - 0x24] = blue; + g_pwm_buffer_update_required = true; + } +} + +void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) + { + IS31_set_color( i, red, green, blue ); + } +} + +void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) +{ + is31_led led = g_is31_leds[index]; + + uint8_t control_register_r = (led.r - 0x24) / 8; + uint8_t control_register_g = (led.g - 0x24) / 8; + uint8_t control_register_b = (led.b - 0x24) / 8; + uint8_t bit_r = (led.r - 0x24) % 8; + uint8_t bit_g = (led.g - 0x24) % 8; + uint8_t bit_b = (led.b - 0x24) % 8; + + if ( red ) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if ( green ) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if ( blue ) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required = true; + +} + +void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_pwm_buffer_update_required ) + { + IS31_write_pwm_buffer( addr1, g_pwm_buffer[0] ); + IS31_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + } + g_pwm_buffer_update_required = false; +} + +void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_led_control_registers_update_required ) + { + for ( int i=0; i<18; i++ ) + { + IS31_write_register(addr1, i, g_led_control_registers[0][i] ); + IS31_write_register(addr2, i, g_led_control_registers[1][i] ); + } + } +} + diff --git a/drivers/is31fl3731.h b/drivers/is31fl3731.h new file mode 100644 index 0000000000..9e195c240e --- /dev/null +++ b/drivers/is31fl3731.h @@ -0,0 +1,214 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * + * 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 . + */ + + +#ifndef IS31FL3731_DRIVER_H +#define IS31FL3731_DRIVER_H + +#include +#include + +typedef struct is31_led { + uint8_t driver:2; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31_init( uint8_t addr ); +void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data ); +void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); + +void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); +void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); + +#define C1_1 0x24 +#define C1_2 0x25 +#define C1_3 0x26 +#define C1_4 0x27 +#define C1_5 0x28 +#define C1_6 0x29 +#define C1_7 0x2A +#define C1_8 0x2B + +#define C1_9 0x2C +#define C1_10 0x2D +#define C1_11 0x2E +#define C1_12 0x2F +#define C1_13 0x30 +#define C1_14 0x31 +#define C1_15 0x32 +#define C1_16 0x33 + +#define C2_1 0x34 +#define C2_2 0x35 +#define C2_3 0x36 +#define C2_4 0x37 +#define C2_5 0x38 +#define C2_6 0x39 +#define C2_7 0x3A +#define C2_8 0x3B + +#define C2_9 0x3C +#define C2_10 0x3D +#define C2_11 0x3E +#define C2_12 0x3F +#define C2_13 0x40 +#define C2_14 0x41 +#define C2_15 0x42 +#define C2_16 0x43 + +#define C3_1 0x44 +#define C3_2 0x45 +#define C3_3 0x46 +#define C3_4 0x47 +#define C3_5 0x48 +#define C3_6 0x49 +#define C3_7 0x4A +#define C3_8 0x4B + +#define C3_9 0x4C +#define C3_10 0x4D +#define C3_11 0x4E +#define C3_12 0x4F +#define C3_13 0x50 +#define C3_14 0x51 +#define C3_15 0x52 +#define C3_16 0x53 + +#define C4_1 0x54 +#define C4_2 0x55 +#define C4_3 0x56 +#define C4_4 0x57 +#define C4_5 0x58 +#define C4_6 0x59 +#define C4_7 0x5A +#define C4_8 0x5B + +#define C4_9 0x5C +#define C4_10 0x5D +#define C4_11 0x5E +#define C4_12 0x5F +#define C4_13 0x60 +#define C4_14 0x61 +#define C4_15 0x62 +#define C4_16 0x63 + +#define C5_1 0x64 +#define C5_2 0x65 +#define C5_3 0x66 +#define C5_4 0x67 +#define C5_5 0x68 +#define C5_6 0x69 +#define C5_7 0x6A +#define C5_8 0x6B + +#define C5_9 0x6C +#define C5_10 0x6D +#define C5_11 0x6E +#define C5_12 0x6F +#define C5_13 0x70 +#define C5_14 0x71 +#define C5_15 0x72 +#define C5_16 0x73 + +#define C6_1 0x74 +#define C6_2 0x75 +#define C6_3 0x76 +#define C6_4 0x77 +#define C6_5 0x78 +#define C6_6 0x79 +#define C6_7 0x7A +#define C6_8 0x7B + +#define C6_9 0x7C +#define C6_10 0x7D +#define C6_11 0x7E +#define C6_12 0x7F +#define C6_13 0x80 +#define C6_14 0x81 +#define C6_15 0x82 +#define C6_16 0x83 + +#define C7_1 0x84 +#define C7_2 0x85 +#define C7_3 0x86 +#define C7_4 0x87 +#define C7_5 0x88 +#define C7_6 0x89 +#define C7_7 0x8A +#define C7_8 0x8B + +#define C7_9 0x8C +#define C7_10 0x8D +#define C7_11 0x8E +#define C7_12 0x8F +#define C7_13 0x90 +#define C7_14 0x91 +#define C7_15 0x92 +#define C7_16 0x93 + +#define C8_1 0x94 +#define C8_2 0x95 +#define C8_3 0x96 +#define C8_4 0x97 +#define C8_5 0x98 +#define C8_6 0x99 +#define C8_7 0x9A +#define C8_8 0x9B + +#define C8_9 0x9C +#define C8_10 0x9D +#define C8_11 0x9E +#define C8_12 0x9F +#define C8_13 0xA0 +#define C8_14 0xA1 +#define C8_15 0xA2 +#define C8_16 0xA3 + +#define C9_1 0xA4 +#define C9_2 0xA5 +#define C9_3 0xA6 +#define C9_4 0xA7 +#define C9_5 0xA8 +#define C9_6 0xA9 +#define C9_7 0xAA +#define C9_8 0xAB + +#define C9_9 0xAC +#define C9_10 0xAD +#define C9_11 0xAE +#define C9_12 0xAF +#define C9_13 0xB0 +#define C9_14 0xB1 +#define C9_15 0xB2 +#define C9_16 0xB3 + + + +#endif // IS31FL3731_DRIVER_H diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index b4bbc3dc07..70ad1a1783 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -106,16 +106,16 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t } void rgb_matrix_update_pwm_buffers(void) { - IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); - IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { - IS31FL3731_set_color( index, red, green, blue ); + IS31_set_color( index, red, green, blue ); } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { - IS31FL3731_set_color_all( red, green, blue ); + IS31_set_color_all( red, green, blue ); } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { @@ -752,16 +752,16 @@ void rgb_matrix_init(void) { void rgb_matrix_setup_drivers(void) { // Initialize TWI i2c_init(); - IS31FL3731_init( DRIVER_ADDR_1 ); - IS31FL3731_init( DRIVER_ADDR_2 ); + IS31_init( DRIVER_ADDR_1 ); + IS31_init( DRIVER_ADDR_2 ); for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { bool enabled = true; // This only caches it for later - IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); + IS31_set_led_control_register( index, enabled, enabled, enabled ); } // This actually updates the LED drivers - IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); } // Deals with the messy details of incrementing an integer @@ -811,11 +811,11 @@ void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue ) { { if ( i == index ) { - IS31FL3731_set_led_control_register( i, red, green, blue ); + IS31_set_led_control_register( i, red, green, blue ); } else { - IS31FL3731_set_led_control_register( i, false, false, false ); + IS31_set_led_control_register( i, false, false, false ); } } } -- cgit v1.2.3 From 89838d0939f3370635b8f1c7068641430a6552ca Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 15 Aug 2018 12:27:34 -0400 Subject: Keyboard: Migrate Quefrency to use split common files (#3642) --- keyboards/quefrency/i2c.c | 162 ---------- keyboards/quefrency/i2c.h | 49 --- keyboards/quefrency/keymaps/default/config.h | 8 +- keyboards/quefrency/matrix.c | 467 --------------------------- keyboards/quefrency/readme.md | 2 + keyboards/quefrency/rev1/config.h | 33 +- keyboards/quefrency/rev1/rev1.c | 2 - keyboards/quefrency/rev1/rev1.h | 7 +- keyboards/quefrency/rules.mk | 43 +-- keyboards/quefrency/serial.c | 228 ------------- keyboards/quefrency/serial.h | 26 -- keyboards/quefrency/split_util.c | 80 ----- keyboards/quefrency/split_util.h | 20 -- 13 files changed, 10 insertions(+), 1117 deletions(-) delete mode 100644 keyboards/quefrency/i2c.c delete mode 100644 keyboards/quefrency/i2c.h delete mode 100644 keyboards/quefrency/matrix.c delete mode 100644 keyboards/quefrency/serial.c delete mode 100644 keyboards/quefrency/serial.h delete mode 100644 keyboards/quefrency/split_util.c delete mode 100644 keyboards/quefrency/split_util.h diff --git a/keyboards/quefrency/i2c.c b/keyboards/quefrency/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/quefrency/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/quefrency/keymaps/default/config.h b/keyboards/quefrency/keymaps/default/config.h index 20e49c4219..f9efe78c5b 100644 --- a/keyboards/quefrency/keymaps/default/config.h +++ b/keyboards/quefrency/keymaps/default/config.h @@ -3,6 +3,7 @@ This is the c configuration file for the keymap Copyright 2012 Jun Wako Copyright 2015 Jack Humbert +Copyright 2018 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 @@ -18,14 +19,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ #define USE_SERIAL // #define USE_I2C - -#endif diff --git a/keyboards/quefrency/matrix.c b/keyboards/quefrency/matrix.c deleted file mode 100644 index fdeead7dc7..0000000000 --- a/keyboards/quefrency/matrix.c +++ /dev/null @@ -1,467 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "backlight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // 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) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/quefrency/readme.md b/keyboards/quefrency/readme.md index 33681c1a73..8fb1c6bc18 100644 --- a/keyboards/quefrency/readme.md +++ b/keyboards/quefrency/readme.md @@ -15,6 +15,8 @@ Example of flashing this keyboard: make quefrency/rev1:default:avrdude +Handedness detection is already hardwired onto the PCB, so no need to deal with `EE_HANDS` or flashing .eep files. + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. A build guide for this keyboard can be found here: [Keebio Build Guides](https://docs.keeb.io) diff --git a/keyboards/quefrency/rev1/config.h b/keyboards/quefrency/rev1/config.h index c24cf5ab34..895ee03789 100644 --- a/keyboards/quefrency/rev1/config.h +++ b/keyboards/quefrency/rev1/config.h @@ -16,10 +16,9 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once -#include "../config.h" +#include QMK_KEYBOARD_CONFIG_H /* USB Device descriptor parameter */ #define VENDOR_ID 0xCB10 @@ -37,9 +36,7 @@ along with this program. If not, see . // wiring of each half #define MATRIX_ROW_PINS { F4, D4, D7, E6, B4 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 } - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST +#define SPLIT_HAND_PIN D2 /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 @@ -56,29 +53,5 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * 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 - - -#endif diff --git a/keyboards/quefrency/rev1/rev1.c b/keyboards/quefrency/rev1/rev1.c index 06fbfa25e1..a690a7eff7 100644 --- a/keyboards/quefrency/rev1/rev1.c +++ b/keyboards/quefrency/rev1/rev1.c @@ -1,7 +1,5 @@ #include "quefrency.h" - void matrix_init_kb(void) { matrix_init_user(); }; - diff --git a/keyboards/quefrency/rev1/rev1.h b/keyboards/quefrency/rev1/rev1.h index 44476354b9..14e0f9bbf5 100644 --- a/keyboards/quefrency/rev1/rev1.h +++ b/keyboards/quefrency/rev1/rev1.h @@ -1,7 +1,6 @@ -#ifndef REV1_H -#define REV1_H +#pragma once -#include "../quefrency.h" +#include "quefrency.h" #include "quantum.h" @@ -33,5 +32,3 @@ { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ { RE1, KC_NO, KC_NO, RE4, RE5, RE6, RE7, RE8 } \ } - -#endif diff --git a/keyboards/quefrency/rules.mk b/keyboards/quefrency/rules.mk index 93ccd2b055..b78dc5df7b 100644 --- a/keyboards/quefrency/rules.mk +++ b/keyboards/quefrency/rules.mk @@ -1,48 +1,7 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - -# MCU name -#MCU = at90usb1287 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) - -# 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 = caterina # Interrupt driven control endpoint task(+60) @@ -69,6 +28,6 @@ USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = quefrency/rev1 diff --git a/keyboards/quefrency/serial.c b/keyboards/quefrency/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/quefrency/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/quefrency/serial.h b/keyboards/quefrency/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/quefrency/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/quefrency/split_util.c b/keyboards/quefrency/split_util.c deleted file mode 100644 index 2704e30e04..0000000000 --- a/keyboards/quefrency/split_util.c +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" -#include "pincontrol.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - // Test D2 pin for handedness, if D2 is grounded, it's the right hand - pinMode(D2, PinDirectionInput); - isLeftHand = digitalRead(D2); -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init(); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif -- cgit v1.2.3 From 77b7e2cd59533abb203497cb8b7bb36d5a0086a2 Mon Sep 17 00:00:00 2001 From: josephchoi1116 <31532411+josephchoi1116@users.noreply.github.com> Date: Thu, 16 Aug 2018 00:28:47 +0800 Subject: Keyboard: Added layout LAYOUT_60_ansi_split_bksp_rshift to ok60 (#3644) * Added layout LAYOUT_60_ansi_split_bksp_rshift * Added layout 60_ansi_split_bksp_rshift --- keyboards/ok60/ok60.h | 14 ++++++++++++++ keyboards/ok60/rules.mk | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/keyboards/ok60/ok60.h b/keyboards/ok60/ok60.h index 81e2d13e08..7c459d8776 100644 --- a/keyboards/ok60/ok60.h +++ b/keyboards/ok60/ok60.h @@ -17,6 +17,20 @@ { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \ } +#define LAYOUT_60_ansi_split_bksp_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K402, K406, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, KC_NO }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, KC_NO } \ +} + #define LAYOUT_60_iso( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, \ diff --git a/keyboards/ok60/rules.mk b/keyboards/ok60/rules.mk index 3fcf165a92..03646c4857 100644 --- a/keyboards/ok60/rules.mk +++ b/keyboards/ok60/rules.mk @@ -63,4 +63,4 @@ RGBLIGHT_ENABLE = yes # Enable the RGB backlight # UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID -LAYOUTS = 60_ansi 60_iso 60_hhkb +LAYOUTS = 60_ansi 60_ansi_split_bksp_rshift 60_iso 60_hhkb -- cgit v1.2.3 From b3d80d4af011be30e6cdf55230d27e20a34b31a1 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Thu, 16 Aug 2018 01:30:34 +0900 Subject: Keymap: Helix : Update froggy keymap (#3652) * led ripple effect * fix key name --- keyboards/helix/rev2/keymaps/froggy/keymap.c | 122 ++++++++++++++++++++++----- 1 file changed, 101 insertions(+), 21 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c index 5ac927af3e..81a28dfa5d 100644 --- a/keyboards/helix/rev2/keymaps/froggy/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Y | S | N | I | U |Space | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Alt | win | Sym | Num | OPT | Ent | | | | | | | | + * | Ctrl | Alt | Gui | Sym | Num | OPT | Ent | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT( \ @@ -256,8 +256,31 @@ void register_delay_code(uint8_t layer){ } } +#ifdef RGBLIGHT_ENABLE +struct keybuf { + char col, row; + char frame; +}; +struct keybuf keybufs[256]; +unsigned char keybuf_begin, keybuf_end; + +int col, row; +#endif + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + #ifdef RGBLIGHT_ENABLE + col = record->event.key.col; + row = record->event.key.row; + if (record->event.pressed && ((row < 5 && is_master) || (row >= 5 && !is_master))) { + int end = keybuf_end; + keybufs[end].col = col; + keybufs[end].row = row % 5; + keybufs[end].frame = 0; + keybuf_end ++; + } + #endif + if(tap_timer&&keycode!=OPT_TAP_SP){ tapping_key = true; } @@ -475,6 +498,61 @@ void music_scale_user(void) #define L_NFNLAYER 192 #define L_MOUSECURSOR 256 +// LED Effect +#ifdef RGBLIGHT_ENABLE +unsigned char rgb[7][5][3]; +void led_ripple_effect(char r, char g, char b) { + static int scan_count = -10; + static int keys[] = { 6, 6, 6, 7, 7 }; + static int keys_sum[] = { 0, 6, 12, 18, 25 }; + + if (scan_count == -1) { + rgblight_enable_noeeprom(); + rgblight_mode(0); + } else if (scan_count >= 0 && scan_count < 5) { + for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) { + int i = c; + // FIXME: + + int y = scan_count; + int dist_y = abs(y - keybufs[i].row); + for (int x=0; x= 6 && scan_count <= 10) { + int y = scan_count - 6; + for (int x=0; x= 12) { scan_count = 0; } +} +#endif uint8_t layer_state_old; @@ -494,42 +572,44 @@ void matrix_scan_user(void) { if(layer_state_old != layer_state){ switch (layer_state) { case L_BASE: - #ifdef RGBLIGHT_ENABLE - if (!RGBAnimation){ - rgblight_sethsv(187,255,255); - rgblight_mode(1); - }else{ - rgblight_mode(RGB_current_mode); - } - #endif break; case L_OPT: register_delay_code(_OPT); break; case L_NUM: register_delay_code(_NUM); - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv(25,255,255); - rgblight_mode(1); - #endif break; case L_SYM: register_delay_code(_SYM); - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv(96,255,255); - rgblight_mode(1); - #endif break; case L_FUNC: register_delay_code(_FUNC); - #ifdef RGBLIGHT_ENABLE - rgblight_sethsv(331,255,255); - rgblight_mode(1); - #endif break; } layer_state_old = layer_state; } + + #ifdef RGBLIGHT_ENABLE + if(!RGBAnimation){ + switch (layer_state) { + case L_BASE: + led_ripple_effect(0,112,127); + break; + case L_OPT: + led_ripple_effect(127,0,100); + break; + case L_NUM: + led_ripple_effect(127,23,0); + break; + case L_SYM: + led_ripple_effect(0,127,0); + break; + case L_FUNC: + led_ripple_effect(127,0,61); + break; + } + } + #endif } //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -- cgit v1.2.3 From 23867894c099411a3e630bdb171bf91ea75a6a7d Mon Sep 17 00:00:00 2001 From: zgtm Date: Wed, 15 Aug 2018 18:43:39 +0200 Subject: Layouts: Add default ortho 5x14 layout (#3656) * Add default ortho 5x14 layout * Fix layout_ortho_5x14: KC_EQLS -> KC_EQL --- layouts/default/ortho_5x14/default_ortho_5x14/keymap.c | 11 +++++++++++ layouts/default/ortho_5x14/layout.json | 5 +++++ layouts/default/ortho_5x14/readme.md | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 layouts/default/ortho_5x14/default_ortho_5x14/keymap.c create mode 100644 layouts/default/ortho_5x14/layout.json create mode 100644 layouts/default/ortho_5x14/readme.md diff --git a/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c b/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c new file mode 100644 index 0000000000..2968cecdf1 --- /dev/null +++ b/layouts/default/ortho_5x14/default_ortho_5x14/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x14( + 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_ESC, KC_TAB, KC_Q, KC_W, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, + KC_DEL, 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_NUHS, + 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_LEFT, KC_RGHT, KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, KC_ENT, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_DOWN + ) +}; diff --git a/layouts/default/ortho_5x14/layout.json b/layouts/default/ortho_5x14/layout.json new file mode 100644 index 0000000000..e7703827e8 --- /dev/null +++ b/layouts/default/ortho_5x14/layout.json @@ -0,0 +1,5 @@ +["","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","","",""] diff --git a/layouts/default/ortho_5x14/readme.md b/layouts/default/ortho_5x14/readme.md new file mode 100644 index 0000000000..bf2af9a639 --- /dev/null +++ b/layouts/default/ortho_5x14/readme.md @@ -0,0 +1,3 @@ +# ortho_5x14 + + LAYOUT_ortho_5x14 -- cgit v1.2.3 From bfc9aa66f9ef8146da415a4229b3b9fc7c78ce54 Mon Sep 17 00:00:00 2001 From: zgtm Date: Wed, 15 Aug 2018 18:48:14 +0200 Subject: Docs: Update image in FAQ/Keymap: KC_EQLS -> KC_EQL (#3660) --- docs/faq_keymap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index b05b968a6c..07d74d6cf3 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here: - -![Keyboard Layout Image](https://i.imgur.com/45m4mRf.png) + +![Keyboard Layout Image](https://i.imgur.com/gvlNUpQ.png) ## Some Of My Keys Are Swapped Or Not Working -- cgit v1.2.3 From 1eaf9c8b9bde7c0b0da6f77980ba9f18eff76a8d Mon Sep 17 00:00:00 2001 From: David Vonau Date: Tue, 14 Aug 2018 08:40:02 +0200 Subject: this commit fixes #3643, rev2 was affected too --- keyboards/clueboard/66/rev2/rev2.h | 4 ++-- keyboards/clueboard/66/rev3/rev3.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/clueboard/66/rev2/rev2.h b/keyboards/clueboard/66/rev2/rev2.h index 5eedcd237a..bac608df97 100644 --- a/keyboards/clueboard/66/rev2/rev2.h +++ b/keyboards/clueboard/66/rev2/rev2.h @@ -64,14 +64,14 @@ { k20, k21, k22, k23, k24, k25, k26, k27 }, \ { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, KC_NO, k57 }, \ + { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ { KC_NO, KC_NO, k92, k93, k94, k95, k96, k97 } \ } -/* LAYOUT_66_iso, standard 67 key ISO layout +/* LAYOUT_66_iso, standard 67 key ISO layout */ #define LAYOUT_66_iso( \ k00, k01, k02, k03, k04, k05, k06, k07, k50, k51, k52, k53, k54, k56, k57, \ diff --git a/keyboards/clueboard/66/rev3/rev3.h b/keyboards/clueboard/66/rev3/rev3.h index c146d7bb3e..0f322a5c00 100644 --- a/keyboards/clueboard/66/rev3/rev3.h +++ b/keyboards/clueboard/66/rev3/rev3.h @@ -64,7 +64,7 @@ { k20, k21, k22, k23, k24, k25, k26, k27 }, \ { k30, KC_NO, k32, k33, k34, k35, k36, k37 }, \ { k40, k41, k42, KC_NO, KC_NO, KC_NO, k46, KC_NO }, \ - { k50, k51, k52, k53, k54, KC_NO, KC_NO, k57 }, \ + { k50, k51, k52, k53, k54, KC_NO, k56, k57 }, \ { k60, k61, k62, k63, k64, k65, KC_NO, k67 }, \ { k70, k71, k72, k73, KC_NO, k75, KC_NO, KC_NO }, \ { k80, k81, k82, k83, KC_NO, k85, k86, KC_NO }, \ -- cgit v1.2.3 From 4cfdd2cff5e602c16f9e81cb25e9519e62782e52 Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 15 Aug 2018 13:06:12 -0700 Subject: Add configurator support for 66_ansi layout for rev1, 2 and 3 --- keyboards/clueboard/66/info.json | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/keyboards/clueboard/66/info.json b/keyboards/clueboard/66/info.json index 7faeae29c4..1675ae7617 100644 --- a/keyboards/clueboard/66/info.json +++ b/keyboards/clueboard/66/info.json @@ -5,6 +5,10 @@ "layouts": { "KEYMAP": { "layout": [{"x": 0, "y": 0, "w": 1, "label": "GRAVE"}, {"x": 1, "y": 0, "w": 1, "label": "1"}, {"x": 2, "y": 0, "w": 1, "label": "2"}, {"x": 3, "y": 0, "w": 1, "label": "3"}, {"x": 4, "y": 0, "w": 1, "label": "4"}, {"x": 5, "y": 0, "w": 1, "label": "5"}, {"x": 6, "y": 0, "w": 1, "label": "6"}, {"x": 7, "y": 0, "w": 1, "label": "7"}, {"x": 8, "y": 0, "w": 1, "label": "8"}, {"x": 9, "y": 0, "w": 1, "label": "9"}, {"x": 10, "y": 0, "w": 1, "label": "0"}, {"x": 11, "y": 0, "w": 1, "label": "DASH"}, {"x": 12, "y": 0, "w": 1, "label": "EQUALSIGN"}, {"x": 13, "y": 0, "w": 1, "label": "YEN"}, {"x": 14, "y": 0, "w": 1, "label": "BACKSPACE"}, {"x": 15.5, "y": 0, "w": 1, "label": "PAGEUP"}, {"x": 0, "y": 1, "w": 1.5, "label": "TAB"}, {"x": 1.5, "y": 1, "w": 1, "label": "Q"}, {"x": 2.5, "y": 1, "w": 1, "label": "W"}, {"x": 3.5, "y": 1, "w": 1, "label": "E"}, {"x": 4.5, "y": 1, "w": 1, "label": "R"}, {"x": 5.5, "y": 1, "w": 1, "label": "T"}, {"x": 6.5, "y": 1, "w": 1, "label": "Y"}, {"x": 7.5, "y": 1, "w": 1, "label": "U"}, {"x": 8.5, "y": 1, "w": 1, "label": "I"}, {"x": 9.5, "y": 1, "w": 1, "label": "O"}, {"x": 10.5, "y": 1, "w": 1, "label": "P"}, {"x": 11.5, "y": 1, "w": 1, "label": "LBRACKET"}, {"x": 12.5, "y": 1, "w": 1, "label": "RBRACKET"}, {"x": 13.5, "y": 1, "w": 1.5, "label": "BACKSLASH"}, {"x": 15.5, "y": 1, "w": 1, "label": "PAGEDOWN"}, {"x": 0, "y": 2, "w": 1.75, "label": "CAPSLOCK"}, {"x": 1.75, "y": 2, "w": 1, "label": "A"}, {"x": 2.75, "y": 2, "w": 1, "label": "S"}, {"x": 3.75, "y": 2, "w": 1, "label": "D"}, {"x": 4.75, "y": 2, "w": 1, "label": "F"}, {"x": 5.75, "y": 2, "w": 1, "label": "G"}, {"x": 6.75, "y": 2, "w": 1, "label": "H"}, {"x": 7.75, "y": 2, "w": 1, "label": "J"}, {"x": 8.75, "y": 2, "w": 1, "label": "K"}, {"x": 9.75, "y": 2, "w": 1, "label": "L"}, {"x": 10.75, "y": 2, "w": 1, "label": "SEMICOLON"}, {"x": 11.75, "y": 2, "w": 1, "label": "QUOTE"}, {"x": 12.75, "y": 2, "w": 1, "label": "ISOHASH"}, {"x": 13.75, "y": 2, "w": 1.25, "label": "ENTER"}, {"x": 0, "y": 3, "w": 1.25, "label": "LSHIFT"}, {"x": 1.25, "y": 3, "w": 1, "label": "ISOBACKSLASH"}, {"x": 2.25, "y": 3, "w": 1, "label": "Z"}, {"x": 3.25, "y": 3, "w": 1, "label": "X"}, {"x": 4.25, "y": 3, "w": 1, "label": "C"}, {"x": 5.25, "y": 3, "w": 1, "label": "V"}, {"x": 6.25, "y": 3, "w": 1, "label": "B"}, {"x": 7.25, "y": 3, "w": 1, "label": "N"}, {"x": 8.25, "y": 3, "w": 1, "label": "M"}, {"x": 9.25, "y": 3, "w": 1, "label": "COMMA"}, {"x": 10.25, "y": 3, "w": 1, "label": "PERIOD"}, {"x": 11.25, "y": 3, "w": 1, "label": "SLASH"}, {"x": 12.25, "y": 3, "w": 1, "label": "JPBACKSLASH"}, {"x": 13.25, "y": 3, "w": 1.25, "label": "RSHIFT"}, {"x": 14.5, "y": 3, "w": 1, "label": "UP"}, {"x": 0, "y": 4, "w": 1.25, "label": "LCTRL"}, {"x": 1.25, "y": 4, "w": 1, "label": "LALT"}, {"x": 2.25, "y": 4, "w": 1.25, "label": "LCMD"}, {"x": 3.5, "y": 4, "w": 1.25, "label": "MUHENKAN"}, {"x": 4.75, "y": 4, "w": 2, "label": "SPACE1"}, {"x": 6.75, "y": 4, "w": 2, "label": "SPACE2"}, {"x": 8.75, "y": 4, "w": 1.25, "label": "HENKAN"}, {"x": 10, "y": 4, "w": 1.25, "label": "RCMD"}, {"x": 11.25, "y": 4, "w": 1, "label": "RCTRL"}, {"x": 12.25, "y": 4, "w": 1.25, "label": "FN"}, {"x": 13.5, "y": 4, "w": 1, "label": "LEFT"}, {"x": 14.5, "y": 4, "w": 1, "label": "DOWN"}, {"x": 15.5, "y": 4, "w": 1, "label": "RIGHT"}] + }, + + "LAYOUT_66_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.25}, {"x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4}, {"label":"Menu", "x":12.25, "y":4, "w":1.25}, {"x":13.5, "y":4}, {"x":14.5, "y":4}, {"x":15.5, "y":4}] } } } -- cgit v1.2.3 From 3549415116339a0af15d54437c07d188d6de6ad2 Mon Sep 17 00:00:00 2001 From: zwnk Date: Wed, 15 Aug 2018 19:31:59 -0300 Subject: Keyboard: dactyl manuform 6x6 added (#3662) * mouse layer keys shifted * mouse layer keys shifted * manuform 5x6 added * mouse layer keys shifted * manuform 5x6 added * dactyl_manuform 5x6 keymap added * reorg. dactyl manuform folder * removed LAYOUTS = ortho_4x12 for 4x5 * Rows and Cols in config.h fixed * MASTER_LEFT * 5x6 matrix fixed * keymap updated * removed the i2c, serial, split_util and matrix files and inserted SPLIT_KEYBOARD * default keymap for dactyl_manuform 5x6 * Fixes for Dactyl Manuform * Add/update default keymap * readme dactyl_manuform updated * links to keymaps added * dactyl_manuform 6x6 added. README updated * dactyl_manuform README updated * cleanup * more cleanup --- keyboards/handwired/dactyl_manuform/4x5/readme.md | 161 --------------------- .../dactyl_manuform/5x6/keymaps/default/keymap.c | 25 +--- .../dactyl_manuform/5x6/keymaps/impstyle/keymap.c | 46 ++---- keyboards/handwired/dactyl_manuform/5x6/readme.md | 142 ------------------ keyboards/handwired/dactyl_manuform/6x6/6x6.c | 23 +++ keyboards/handwired/dactyl_manuform/6x6/6x6.h | 44 ++++++ keyboards/handwired/dactyl_manuform/6x6/config.h | 33 +++++ .../dactyl_manuform/6x6/keymaps/default/config.h | 27 ++++ .../dactyl_manuform/6x6/keymaps/default/keymap.c | 57 ++++++++ keyboards/handwired/dactyl_manuform/6x6/rules.mk | 21 +++ .../handwired/dactyl_manuform/dactyl_manuform.h | 5 +- keyboards/handwired/dactyl_manuform/readme.md | 51 +++++-- 12 files changed, 266 insertions(+), 369 deletions(-) delete mode 100644 keyboards/handwired/dactyl_manuform/4x5/readme.md delete mode 100644 keyboards/handwired/dactyl_manuform/5x6/readme.md create mode 100644 keyboards/handwired/dactyl_manuform/6x6/6x6.c create mode 100644 keyboards/handwired/dactyl_manuform/6x6/6x6.h create mode 100644 keyboards/handwired/dactyl_manuform/6x6/config.h create mode 100644 keyboards/handwired/dactyl_manuform/6x6/keymaps/default/config.h create mode 100644 keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/6x6/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/4x5/readme.md b/keyboards/handwired/dactyl_manuform/4x5/readme.md deleted file mode 100644 index aab792f224..0000000000 --- a/keyboards/handwired/dactyl_manuform/4x5/readme.md +++ /dev/null @@ -1,161 +0,0 @@ -Dactyl Manuform 4x5 -====== -the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. -![Imgur](https://i.imgur.com/7y0Vbyd.jpg) - - -## First Time Setup - -Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: - -``` -$ make handwired/dactyl_manuform/4x5:dvorak -``` - -You will see a lot of output and if everything worked correctly you will see the built hex file: - -``` -dactyl_manuform_4x5_dvorak.hex -``` - -If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so: - -``` -$ make handwired/dactyl_manuform/4x5:YOUR_KEYMAP_NAME -``` - -If everything worked correctly you will see a file: - -``` -dactyl_manuform_4x5_YOUR_KEYMAP_NAME.hex -``` - -For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. - -## Keymaps -Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. -### Qwerty and Dvorak -Qwerty base layer: -![Imgur](https://i.imgur.com/Yb5e7dS.png) -Dvorak base layer: -![Imgur](https://i.imgur.com/CpuZptB.png) -Both keymaps have the same Raise and Lower layers: -Raise Layer -![Imgur](https://i.imgur.com/nOqePK5.png) -Lower Layer -![Imgur](https://i.imgur.com/WSshkYc.png) - -Required Hardware ------------------ - -Apart from diodes and key switches for the keyboard matrix in each half, you -will need: - -* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. -* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable - -Alternatively, you can use any sort of cable and socket that has at least 3 -wires. If you want to use I2C to communicate between halves, you will need a -cable with at least 4 wires and 2x 4.7kΩ pull-up resistors - -Optional Hardware ------------------ -A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. - -Wiring ------- - -The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. -PD0 on the ATmega32u4) between the two Pro Micros. - -Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro -and modify the `matrix.c` accordingly. - -The wiring for serial: - -![serial wiring](https://i.imgur.com/C3D1GAQ.png) - -The wiring for i2c: - -![i2c wiring](https://i.imgur.com/Hbzhc6E.png) - -The pull-up resistors may be placed on either half. It is also possible -to use 4 resistors and have the pull-ups in both halves, but this is -unnecessary in simple use cases. - -You can change your configuration between serial and i2c by modifying your `config.h` file. - -Notes on Software Configuration -------------------------------- - -the keymaps in here are for the 4x5 layout of the keyboard only. - -Flashing -------- -From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. -Example: `make lets_split/rev2:default:avrdude` - - -Choosing which board to plug the USB cable into (choosing Master) --------- -Because the two boards are identical, the firmware has logic to differentiate the left and right board. - -It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. - -The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. - -The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. - -### Setting the left hand as master -If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. - -### Setting the right hand as master -If you always plug the usb cable into the right board, add an extra flag to your `config.h` -``` - #define MASTER_RIGHT -``` - -### Setting EE_hands to use either hands as master -If you define `EE_HANDS` in your `config.h`, you will need to set the -EEPROM for the left and right halves. - -The EEPROM is used to store whether the -half is left handed or right handed. This makes it so that the same firmware -file will run on both hands instead of having to flash left and right handed -versions of the firmware to each half. To flash the EEPROM file for the left -half run: -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep -// or the equivalent in dfu-programmer - -``` -and similarly for right half -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep -// or the equivalent in dfu-programmer -``` - -NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) - -After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. - -Note that you need to program both halves, but you have the option of using -different keymaps for each half. You could program the left half with a QWERTY -layout and the right half with a Colemak layout using bootmagic's default layout option. -Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the -right half is connected. - - -Notes on Using Pro Micro 3.3V ------------------------------ - -Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects -the frequency on the 3.3V board. - -Also, if the slave board is producing weird characters in certain columns, -update the following line in `matrix.c` to the following: - -``` -// _delay_us(30); // without this wait read unstable value. -_delay_us(300); // without this wait read unstable value. -``` diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c index d0bcbd4e6b..7be6a5bc71 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/default/keymap.c @@ -1,27 +1,13 @@ -#include QMK_KEYBOARD_H +/* A standard layout for the Dactyl Manuform 5x6 Keyboard */ +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -// 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 _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define SFT_ESC SFT_T(KC_ESC) -#define CTL_BSPC CTL_T(KC_BSPC) -#define ALT_SPC ALT_T(KC_SPC) -#define SFT_ENT SFT_T(KC_ENT) - -#define KC_ML KC_MS_LEFT -#define KC_MR KC_MS_RIGHT -#define KC_MU KC_MS_UP -#define KC_MD KC_MS_DOWN -#define KC_MB1 KC_MS_BTN1 -#define KC_MB2 KC_MS_BTN1 #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) @@ -31,8 +17,6 @@ extern keymap_config_t keymap_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_5x6( KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, @@ -54,7 +38,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______, _______,_______, _______,_______, _______,_______, _______,_______, _______,_______ -), + + ), [_RAISE] = LAYOUT_5x6( KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , @@ -66,6 +51,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______, _______,_______, _______,_______, _______,_______ ), +}; - }; diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c index 0282ccc7f9..9a89212fec 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/impstyle/keymap.c @@ -1,26 +1,14 @@ + +/* A QWERTY 3 Layer layout for the Dactyl Manuform 5x6 Keyboard */ + #include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -// 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 _QWERTY 0 #define _LOWER 1 #define _RAISE 2 -#define SFT_ESC SFT_T(KC_ESC) -#define CTL_BSPC CTL_T(KC_BSPC) -#define ALT_SPC ALT_T(KC_SPC) -#define SFT_ENT SFT_T(KC_ENT) - -#define KC_ML KC_MS_LEFT -#define KC_MR KC_MS_RIGHT -#define KC_MU KC_MS_UP -#define KC_MD KC_MS_DOWN -#define KC_MB1 KC_MS_BTN1 -#define KC_MB2 KC_MS_BTN1 #define RAISE MO(_RAISE) #define LOWER MO(_LOWER) @@ -37,11 +25,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, - RAISE,KC_SPC, KC_ENT, LOWER, + RAISE,KC_SPC, KC_ENT, LOWER, KC_TAB,KC_HOME, KC_END, KC_DEL, - KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + KC_BSPC,KC_GRV, KC_LGUI, KC_LALT ), + [_LOWER] = LAYOUT_5x6( KC_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, @@ -51,23 +40,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______, _______,_______, _______,_______, _______,_______, _______,_______, _______,_______ + ), [_RAISE] = LAYOUT_5x6( - KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , - _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, - _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, - _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, - _______,_______, KC_EQL ,_______, - _______,_______, _______,_______, - _______,_______, _______,_______, - _______,_______, _______,_______ + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______, KC_EQL ,_______, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ ), }; - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} diff --git a/keyboards/handwired/dactyl_manuform/5x6/readme.md b/keyboards/handwired/dactyl_manuform/5x6/readme.md deleted file mode 100644 index eb76a7150e..0000000000 --- a/keyboards/handwired/dactyl_manuform/5x6/readme.md +++ /dev/null @@ -1,142 +0,0 @@ -Dactyl Manuform 5x6 -====== -the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. -![Imgur](https://i.imgur.com/7y0Vbyd.jpg) - - -## First Time Setup - -Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: - -``` -$ make handwired/dactyl_manuform/5x6:YOUR_KEYMAP_NAME -``` - -If everything worked correctly you will see a file: - -``` -dactyl_manuform_5x6_YOUR_KEYMAP_NAME.hex -``` - -For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. - -## Keymaps -Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. -### Impstyle - - - -Required Hardware ------------------ - -Apart from diodes and key switches for the keyboard matrix in each half, you -will need: - -* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. -* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable - -Alternatively, you can use any sort of cable and socket that has at least 3 -wires. If you want to use I2C to communicate between halves, you will need a -cable with at least 4 wires and 2x 4.7kΩ pull-up resistors - -Optional Hardware ------------------ -A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. - -Wiring ------- - -The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. -PD0 on the ATmega32u4) between the two Pro Micros. - -Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro -and modify the `matrix.c` accordingly. - -The wiring for serial: - -![serial wiring](https://i.imgur.com/C3D1GAQ.png) - -The wiring for i2c: - -![i2c wiring](https://i.imgur.com/Hbzhc6E.png) - -The pull-up resistors may be placed on either half. It is also possible -to use 4 resistors and have the pull-ups in both halves, but this is -unnecessary in simple use cases. - -You can change your configuration between serial and i2c by modifying your `config.h` file. - -Notes on Software Configuration -------------------------------- - -the keymaps in here are for the 4x5 layout of the keyboard only. - -Flashing -------- -From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. -Example: `make lets_split/rev2:default:avrdude` - - -Choosing which board to plug the USB cable into (choosing Master) --------- -Because the two boards are identical, the firmware has logic to differentiate the left and right board. - -It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. - -The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. - -The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. - -### Setting the left hand as master -If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. - -### Setting the right hand as master -If you always plug the usb cable into the right board, add an extra flag to your `config.h` -``` - #define MASTER_RIGHT -``` - -### Setting EE_hands to use either hands as master -If you define `EE_HANDS` in your `config.h`, you will need to set the -EEPROM for the left and right halves. - -The EEPROM is used to store whether the -half is left handed or right handed. This makes it so that the same firmware -file will run on both hands instead of having to flash left and right handed -versions of the firmware to each half. To flash the EEPROM file for the left -half run: -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep -// or the equivalent in dfu-programmer - -``` -and similarly for right half -``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep -// or the equivalent in dfu-programmer -``` - -NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) - -After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. - -Note that you need to program both halves, but you have the option of using -different keymaps for each half. You could program the left half with a QWERTY -layout and the right half with a Colemak layout using bootmagic's default layout option. -Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the -right half is connected. - - -Notes on Using Pro Micro 3.3V ------------------------------ - -Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects -the frequency on the 3.3V board. - -Also, if the slave board is producing weird characters in certain columns, -update the following line in `matrix.c` to the following: - -``` -// _delay_us(30); // without this wait read unstable value. -_delay_us(300); // without this wait read unstable value. -``` diff --git a/keyboards/handwired/dactyl_manuform/6x6/6x6.c b/keyboards/handwired/dactyl_manuform/6x6/6x6.c new file mode 100644 index 0000000000..9eb27531a8 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/6x6.c @@ -0,0 +1,23 @@ +#include "6x6.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/6x6/6x6.h b/keyboards/handwired/dactyl_manuform/6x6/6x6.h new file mode 100644 index 0000000000..c2980b3d31 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/6x6.h @@ -0,0 +1,44 @@ +#pragma once + +#include "dactyl_manuform.h" +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT_6x6(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45, \ + L52, L53, R52, R53, \ + L54, L55, R50, R51, \ + L64, L65, R60, R61, \ + L62, L63, R62, R63 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { KC_NO, KC_NO, L52, L53, L54, L55 }, \ + { KC_NO, KC_NO, L62, L63, L64, L65 }, \ +\ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 }, \ + { R50, R51, R52, R53, KC_NO, KC_NO },\ + { R60, R61, R62, R63, KC_NO, KC_NO }, \ + } + + diff --git a/keyboards/handwired/dactyl_manuform/6x6/config.h b/keyboards/handwired/dactyl_manuform/6x6/config.h new file mode 100644 index 0000000000..9bb7b07bf2 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + + +#define PRODUCT Dactyl-Manuform (6x6) + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 14 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_ROW_PINS { F5, F6, F7, B1, B3, B2, B6 } diff --git a/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/config.h new file mode 100644 index 0000000000..29ab59ad66 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2012 Jun Wako + +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 + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up diff --git a/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c new file mode 100644 index 0000000000..1b1cbd4aea --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/keymaps/default/keymap.c @@ -0,0 +1,57 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_6x6( + + 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_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC, + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_MINS, + KC_LSFT, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, + KC_LCTL, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_BSLASH, + KC_LBRC,KC_RBRC, KC_PLUS, KC_EQL, + RAISE,KC_SPC, KC_ENT, LOWER, + KC_TAB,KC_HOME, KC_END, KC_DEL, + KC_BSPC, KC_GRV, KC_LGUI, KC_LALT + ), + + [_LOWER] = LAYOUT_6x6( + + 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_TILD,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC, KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_DEL, + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7 , KC_P8 , KC_P9 ,_______,KC_PLUS, + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4 , KC_P5 , KC_P6 ,KC_MINS,KC_PIPE, + _______,_______,_______,_______,_______,_______, _______, KC_P1 , KC_P2 , KC_P3 ,KC_EQL ,KC_UNDS, + _______,KC_PSCR, _______, KC_P0, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ + ), + + [_RAISE] = LAYOUT_6x6( + + KC_F12 , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 , + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS ,KC_SLCK,KC_MUTE, + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______, + + _______,_______, KC_EQL ,_______, + _______,_______, _______,_______, + _______,_______, _______,_______, + _______,_______, _______,_______ + ), + +}; + diff --git a/keyboards/handwired/dactyl_manuform/6x6/rules.mk b/keyboards/handwired/dactyl_manuform/6x6/rules.mk new file mode 100644 index 0000000000..14b6e1e4e3 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/rules.mk @@ -0,0 +1,21 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h index 6c23e9143d..3222e6a617 100644 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h @@ -1,7 +1,10 @@ #pragma once -#ifdef KEYBOARD_handwired_dactyl_manuform_5x6 + +#ifdef KEYBOARD_handwired_dactyl_manuform_6x6 + #include "6x6.h" +#elif KEYBOARD_handwired_dactyl_manuform_5x6 #include "5x6.h" #elif KEYBOARD_handwired_dactyl_manuform_4x5 #include "4x5.h" diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md index eb76a7150e..3f72bd6b21 100644 --- a/keyboards/handwired/dactyl_manuform/readme.md +++ b/keyboards/handwired/dactyl_manuform/readme.md @@ -1,32 +1,55 @@ -Dactyl Manuform 5x6 +Dactyl Manuform (4x5, 5x6, 6x6) ====== the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. ![Imgur](https://i.imgur.com/7y0Vbyd.jpg) ## First Time Setup - +----------------- Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: +Depending on your Layout chose one of the follwing commands: + ``` -$ make handwired/dactyl_manuform/5x6:YOUR_KEYMAP_NAME +$ make handwired/dactyl_manuform/YOUR_LAYOUT:YOUR_KEYMAP_NAME +``` + +example: +``` +$ make handwired/dactyl_manuform/4x5:default ``` If everything worked correctly you will see a file: ``` -dactyl_manuform_5x6_YOUR_KEYMAP_NAME.hex +dactyl_manuform_YOUR_LAYOUT_YOUR_KEYMAP_NAME.hex ``` For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. + ## Keymaps -Currently there are only two keymaps: Qwerty and Dvorak, feel free to make changes and contribute your keymap. -### Impstyle +----------------- +### [Keymaps 4x5](/keyboards/handwired/dactyl_manuform/4x5/keymaps/) + +#### Default +Simple QWERTY layout with 3 Layers. +#### Dvorak + +### [Keymaps 5x6](/keyboards/handwired/dactyl_manuform/5x6/keymaps/) +#### Default +Just a copy of the Impstyle keymap. Feel free to adjust it. +#### Impstyle +A simple QWERTY keymap with 3 Layers. Both sides are connected via serial and the Left ist the master. -Required Hardware +### [Keymaps 6x6](/keyboards/handwired/dactyl_manuform/6x6/keymaps/) + +#### Default +Simple QWERTY layout with 3 Layers. + +##Required Hardware ----------------- Apart from diodes and key switches for the keyboard matrix in each half, you @@ -39,11 +62,11 @@ Alternatively, you can use any sort of cable and socket that has at least 3 wires. If you want to use I2C to communicate between halves, you will need a cable with at least 4 wires and 2x 4.7kΩ pull-up resistors -Optional Hardware +##Optional Hardware ----------------- A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. -Wiring +##Wiring ------ The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. @@ -66,18 +89,18 @@ unnecessary in simple use cases. You can change your configuration between serial and i2c by modifying your `config.h` file. -Notes on Software Configuration +##Notes on Software Configuration ------------------------------- the keymaps in here are for the 4x5 layout of the keyboard only. -Flashing +##Flashing ------- -From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. -Example: `make lets_split/rev2:default:avrdude` + +To flash your firmware take a look at: [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing) -Choosing which board to plug the USB cable into (choosing Master) +##Choosing which board to plug the USB cable into (choosing Master) -------- Because the two boards are identical, the firmware has logic to differentiate the left and right board. -- cgit v1.2.3 From 789619eeb987d4ea903676f2e8c978d6774cd7d8 Mon Sep 17 00:00:00 2001 From: bmoorey <42108240+bmoorey@users.noreply.github.com> Date: Wed, 15 Aug 2018 18:32:58 -0400 Subject: Keymap: Adding readme file to personal keymap folder (#3665) * Create a * Add files via upload * Delete a * added readme --- keyboards/iris/keymaps/bmoorey/readme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 keyboards/iris/keymaps/bmoorey/readme.md diff --git a/keyboards/iris/keymaps/bmoorey/readme.md b/keyboards/iris/keymaps/bmoorey/readme.md new file mode 100644 index 0000000000..84cf0332bb --- /dev/null +++ b/keyboards/iris/keymaps/bmoorey/readme.md @@ -0,0 +1,5 @@ +This is (what I consider to be) an improvement over the default Iris keymap. +It includes a QWERTY layer, a general system layer with arrows, volume control +and a numpad on the right board; a second raised layer with function keys and +more extensive media controls; and an adjust layer with controls for RGB +underlighting. \ No newline at end of file -- cgit v1.2.3 From 632287535c83e6607de97a5998713def61dc01bc Mon Sep 17 00:00:00 2001 From: zgtm Date: Thu, 16 Aug 2018 00:34:25 +0200 Subject: Keyboard: add generic ortho 5x14 layout support to Viterbi (#3658) * Add default ortho 5x14 layout * Fix layout_ortho_5x14: KC_EQLS -> KC_EQL * Add ortho_5x14 layout to Viterbi --- keyboards/viterbi/rev1/rev1.h | 2 ++ keyboards/viterbi/rev1/rules.mk | 4 +++- keyboards/viterbi/rules.mk | 6 ++++-- keyboards/viterbi/viterbi.h | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/keyboards/viterbi/rev1/rev1.h b/keyboards/viterbi/rev1/rev1.h index c47b1c4dbb..9c03e495a9 100644 --- a/keyboards/viterbi/rev1/rev1.h +++ b/keyboards/viterbi/rev1/rev1.h @@ -63,4 +63,6 @@ } #endif +#define LAYOUT_ortho_5x14 LAYOUT + #endif diff --git a/keyboards/viterbi/rev1/rules.mk b/keyboards/viterbi/rev1/rules.mk index f845616741..2bf03237c0 100644 --- a/keyboards/viterbi/rev1/rules.mk +++ b/keyboards/viterbi/rev1/rules.mk @@ -1 +1,3 @@ -BACKLIGHT_ENABLE = no \ No newline at end of file +BACKLIGHT_ENABLE = no + +LAYOUTS = ortho_5x14 diff --git a/keyboards/viterbi/rules.mk b/keyboards/viterbi/rules.mk index 1f77c63741..af24c15f53 100644 --- a/keyboards/viterbi/rules.mk +++ b/keyboards/viterbi/rules.mk @@ -41,7 +41,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -71,4 +71,6 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes -DEFAULT_FOLDER = viterbi/rev1 \ No newline at end of file +DEFAULT_FOLDER = viterbi/rev1 + +LAYOUTS = ortho_5x14 diff --git a/keyboards/viterbi/viterbi.h b/keyboards/viterbi/viterbi.h index 9081dc3d5a..80d2a8f25a 100644 --- a/keyboards/viterbi/viterbi.h +++ b/keyboards/viterbi/viterbi.h @@ -21,6 +21,8 @@ KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ ) +#define LAYOUT_ortho_5x14 LAYOUT + #include "quantum.h" #endif -- cgit v1.2.3 From c19d949b72844120fff5159bc7e637ada4dd2579 Mon Sep 17 00:00:00 2001 From: Joshua T Date: Wed, 15 Aug 2018 17:38:41 -0500 Subject: Keymap: Revamp replicaJunction keymaps (#3589) * Revamp replicaJunction keymaps Updates both the replicaJunction Ergodox and Atreus keymaps and moves most of the logic into a new user directory. * Cleanup as requested in #3589 * Slightly increased TAPPING_TERM * Fixed typo in #pragma once * Fix TAPPING_TERM redefined in config.h * Add include of replicaJunction.h Due to the tap dance references, without this include, I was getting compiler errors about both internal QMK items like `qk_tap_dance_state_t` and constants defined in my replicaJunction.h file like TD_LAYER_TOGGLE. Also remove some commented-out code that defined an enum which has since moved to replicaJunction.h. --- keyboards/atreus/keymaps/replicaJunction/config.h | 101 +-- keyboards/atreus/keymaps/replicaJunction/keymap.c | 260 ++------ .../keymaps/replicaJunction/kle/base-layer.txt | 34 + .../atreus/keymaps/replicaJunction/kle/e-layer.txt | 34 + .../keymaps/replicaJunction/kle/fn-layer.txt | 35 ++ .../atreus/keymaps/replicaJunction/kle/i-layer.txt | 34 + .../atreus/keymaps/replicaJunction/kle/r-layer.txt | 34 + .../keymaps/replicaJunction/kle/space-layer.txt | 34 + keyboards/atreus/keymaps/replicaJunction/readme.md | 102 ++- keyboards/atreus/keymaps/replicaJunction/rules.mk | 12 + layouts/community/ergodox/replicaJunction/config.h | 77 +-- layouts/community/ergodox/replicaJunction/keymap.c | 693 ++++++++++++--------- .../community/ergodox/replicaJunction/readme.md | 93 ++- layouts/community/ergodox/replicaJunction/rules.mk | 8 + users/replicaJunction/config.h | 72 +++ users/replicaJunction/readme.md | 14 + users/replicaJunction/replicaJunction.c | 149 +++++ users/replicaJunction/replicaJunction.h | 115 ++++ users/replicaJunction/rules.mk | 1 + 19 files changed, 1216 insertions(+), 686 deletions(-) create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt create mode 100644 keyboards/atreus/keymaps/replicaJunction/rules.mk create mode 100644 layouts/community/ergodox/replicaJunction/rules.mk create mode 100644 users/replicaJunction/config.h create mode 100644 users/replicaJunction/readme.md create mode 100644 users/replicaJunction/replicaJunction.c create mode 100644 users/replicaJunction/replicaJunction.h create mode 100644 users/replicaJunction/rules.mk diff --git a/keyboards/atreus/keymaps/replicaJunction/config.h b/keyboards/atreus/keymaps/replicaJunction/config.h index 437aa662c8..8e786aa0da 100644 --- a/keyboards/atreus/keymaps/replicaJunction/config.h +++ b/keyboards/atreus/keymaps/replicaJunction/config.h @@ -1,94 +1,11 @@ -/* -Config file - Atreus QMK with replicaJunction layout +#pragma once -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. +// Layer definitions -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Technomancy -#define PRODUCT Atreus -#define DESCRIPTION q.m.k. keyboard firmware for Atreus - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 11 - -// Change this to how you wired your keyboard -// COLS: Left to right, ROWS: Top to bottom -#if defined(ATREUS_ASTAR) -# define MATRIX_ROW_PINS { D0, D1, D3, D2 } -# define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 } -# define UNUSED_PINS -#elif defined(ATREUS_TEENSY2) -# define MATRIX_ROW_PINS { D0, D1, D2, D3 } -# define MATRIX_COL_PINS { F6, F5, F4, B7, B6, B5, B4, B3, B2, B1, B0 } -# define UNUSED_PINS -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -//#define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -// Default: 5 -#define DEBOUNCING_DELAY 6 - -// I don't have any locking keys, so I don't need these features - -/* 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Prevent modifiers from sticking when switching layers */ -#define PREVENT_STUCK_MODIFIERS - -/* - * 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 - -#endif +#define L_COLEMAK 0 +#define L_NUM 1 +#define L_EXTEND 2 +#define L_FUNC 3 +#define L_LL_R 4 +#define L_LL_E 5 +#define L_LL_I 6 diff --git a/keyboards/atreus/keymaps/replicaJunction/keymap.c b/keyboards/atreus/keymaps/replicaJunction/keymap.c index 2d8f0d70f8..c3cc371151 100644 --- a/keyboards/atreus/keymaps/replicaJunction/keymap.c +++ b/keyboards/atreus/keymaps/replicaJunction/keymap.c @@ -1,212 +1,78 @@ /* * Keyboard: Atreus * Keymap: replicaJunction - * Version: 0.4 - * - * This keymap is designed to complement my Ergodox keyboard layout, found in keyboards/ergodox_ez. - * The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. I now - * have both keyboards, so I've designed these layouts in an effort to make switching between the - * two as easy as possible. - * - * Clearly, the Atreus is the limiting factor in this equation, so I've taken heavy advantage of - * function and dual-role keys. - * - * The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found - * here: https://colemakmods.github.io/mod-dh/ + * Version: 2.1 */ #include QMK_KEYBOARD_H - -// 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. - -// Note that whatever is set as layer 0 will be the default layer of the keyboard. - -#define _CO 0 // Colemak -#define _QW 1 // QWERTY -#define _GA 2 // Gaming -#define _EX 3 // Extend -#define _NU 4 // Numpad -#define _FN 5 // Function - -// Some quick aliases, just to make it look pretty -#define _______ KC_TRNS -#define KCX_CA LCTL(KC_LALT) -#define KCX_CS LCTL(KC_LSFT) -#define KCX_CSA LCTL(LSFT(KC_LALT)) -#define KCX_LST LSFT(KC_TAB) -#define KX_COPY LCTL(KC_C) -#define KX_CUT LCTL(KC_X) -#define KX_PAST LCTL(KC_V) -#define KX_UNDO LCTL(KC_Z) - -#define _USER 0 // User macro - -; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements. +#include "replicaJunction.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * Colemak-ModDH - * - * ,----------------------------------. ,----------------------------------. - * | Q | W | F | P | B | | J | L | U | Y | ; | - * +------+------+------+------+------| +------+------+------+------+------| - * | A | R | S | T | G | | M | N | E | I | O | - * +------+------+------+------+------| +------+------+------+------+------| - * |Z Shft| X | C | D | V | ,------. ,------. | K | H | , | . |/ Shft| - * +------+------+------+------+------| | Ctrl | | Alt | +------+------+------+------+------| - * | Esc | Gui | Tab | _FN | Bksp | | Del | | Enter| |Sp/_NU| _EX | - | ' | = | - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_CO] = LAYOUT( - KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, - KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, - SFT_T(KC_Z), KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, SFT_T(KC_SLSH), - KC_ESC, KC_LGUI, KC_TAB, MO(_FN), KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL - ), - - /* - * QWERTY - * - * ,----------------------------------. ,----------------------------------. - * | Q | W | E | R | T | | Y | U | I | O | P | - * +------+------+------+------+------| +------+------+------+------+------| - * | A | S | D | F | G | | H | J | K | L | ; | - * +------+------+------+------+------| +------+------+------+------+------| - * |Z Shft| X | C | V | B | ,------. ,------. | N | M | , | . |/ Shft| - * +------+------+------+------+------| | Ctrl | | Alt | +------+------+------+------+------| - * | Esc | Gui | Tab | _FN | Bksp | | Del | | Enter| |Sp/_NU| _EX | - | ' | = | - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_QW] = LAYOUT( /* Qwerty */ - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - SFT_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, SFT_T(KC_SLSH), - KC_ESC, KC_LGUI, KC_TAB, MO(_FN), KC_BSPC, CTL_T(KC_DEL), ALT_T(KC_ENT), LT(_NU, KC_SPC), MO(_EX), KC_MINS, KC_QUOT, KC_EQL - ), - /* - * Extend - * - * Ctrl+` is a keyboard shortcut for the program ConEmu, which brings up a dropdown console window. - * - * Also note that some dual-role keys are overridden here with their modifiers - * - * ,----------------------------------. ,----------------------------------. - * | | | | |Ctrl `| | PgUp | Home | Up | End | Del | - * +------+------+------+------+------| +------+------+------+------+------| - * | Gui | Shift| Alt | Ctrl | | | PgDn | Left | Down | Right| Bksp | - * +------+------+------+------+------| +------+------+------+------+------| - * | Shift| Cut | Copy | | Paste| ,------. ,------. | | ^Tab | Tab | |Insert| - * +------+------+------+------+------| | Del | | Enter| +------+------+------+------+------| - * | | | | | | | | | | | Space|XXXXXX| | |PrntSc| - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_EX] = LAYOUT( /* Extend */ - _______, _______, _______, _______, LCTL(KC_GRV), KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, - KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, - KC_LSFT, KX_CUT, KX_COPY, _______, KX_PAST, _______, KCX_LST, KC_TAB, _______, KC_INS, - _______, _______, _______, _______, _______, KC_DEL, KC_ENT, KC_SPC, _______, _______, _______, KC_PSCR - ), +[L_COLEMAK] = LAYOUT( + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R_LT, KC_S_LT, KC_T, KC_G, KC_M, KC_N, KC_E_LT, KC_I_LT, KC_O, + KX_Z_MT, KX_X_MT, KX_C_MT, KX_D_MT, KC_V, KC_K, KX_H_MT, KX_COMT, KX_DOMT, KX_SLMT, + TD_LAYR, KC_LGUI, KC_TAB, KC_LSFT, KX_BKNM, KX_DCTL, KX_NALT, KX_SPAC, KC_RSFT, KC_MINS, KC_QUOT, KC_EQL +) +, + +[L_NUM] = LAYOUT( + KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_SLSH, KC_COLN, KC_7, KC_8, KC_9, KC_SLSH, + KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_PIPE, KC_HASH, KC_4, KC_5, KC_6, KC_ASTR, + KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BSLS, KC_BSPC, KC_1, KC_2, KC_3, KC_MINS, + _______, KC_AMPR, KC_TILD, KC_GRV, ooooooo, _______, KC_ENT, MO_FUNC, KC_0, KC_DOT, KC_EQL, KC_PLUS +) +, + +[L_EXTEND] = LAYOUT( + _______, _______, _______, KC_APP, KX_CGR, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, + KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, + _______, _______, _______, KX_SRCH, KX_PAST, _______, KX_STAB, KC_TAB, _______, KC_INS, + _______, _______, _______, _______, MO_FUNC, KC_DEL, KC_ENT, _______, _______, _______, _______, KC_PSCR +) +, + +[L_FUNC] = LAYOUT( + _______, _______, M_LCLIK, M_RCLIK, M_MCLIK, KC_VOLU, KC_F9, KC_F10, KC_F11, KC_F12, + KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, M_WHLUP, KC_MUTE, KC_F5, KC_F6, KC_F7, KC_F8, + M_LEFT, M_DOWN, M_UP, M_RIGHT, M_WHLDN, KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +, + +[L_LL_R] = LAYOUT( + _______, _______, _______, _______, _______, KC_COLN, KC_P7, KC_P8, KC_P9, KC_PSLS, + _______, ooooooo, KC_AMPR, KC_PIPE, _______, KC_HASH, KC_P4, KC_P5, KC_P6, KC_PAST, + _______, _______, _______, _______, _______, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PMNS, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_PLUS +) +, + +[L_LL_E] = LAYOUT( + RJ_MAKE, RJ_EQ, RJ_LEQ, RJ_GEQ, RJ_GEQR, _______, _______, _______, _______, _______, + _______, _______, RJ_SELS, RJ_DUND, _______, _______, _______, ooooooo, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +, + +[L_LL_I] = LAYOUT( + KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_SLSH, _______, KC_UNDS, KC_GRV, _______, _______, + KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_PIPE, _______, KC_MINS, KC_QUOT, ooooooo, _______, + KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BSLS, _______, KC_TILD, KC_DQT, _______, _______, + _______, KC_AMPR, KC_LABK, KC_RABK, _______, _______, _______, _______, _______, _______, _______, _______ +) - /* - * Numbers and symbols - * - * ,----------------------------------. ,----------------------------------. - * | ! | @ | { | } | & | | / | 7 | 8 | 9 | * | - * +------+------+------+------+------| +------+------+------+------+------| - * | # | $ | ( | ) | ~ | | | | 4 | 5 | 6 | - | - * +------+------+------+------+------| +------+------+------+------+------| - * | % | ^ | [ | ] | ` | ,------. ,------. | \ | 1 | 2 | 3 | + | - * +------+------+------+------+------| | | | | +------+------+------+------+------| - * | | _GA | | | | | | | | |XXXXXX| 0 | . | = | | - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_NU] = LAYOUT( /* Numbers and symbols */ - KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, KC_SLSH, KC_7, KC_8, KC_9, KC_ASTR, - KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, KC_PIPE, KC_4, KC_5, KC_6, KC_MINS, - KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, KC_BSLS, KC_1, KC_2, KC_3, KC_PLUS, - _______, TG(_GA), _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, _______ - ), - - /* - * Functions - * - * ,----------------------------------. ,----------------------------------. - * | Caps | F9 | F10 | F11 | F12 | | _USER|Whl Up| MUp |Whl Dn| | - * +------+------+------+------+------| +------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | | Vol ^| MLeft| MDown|MRight| | - * +------+------+------+------+------| +------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | ,------. ,------. | Vol v| | | | | - * +------+------+------+------+------| | | |RClick| +------+------+------+------+------| - * | | | |XXXXXX| | | | | | |LClick|MClick| _CO | _GA | RESET| - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_FN] = LAYOUT( /* Functions */ - KC_CAPS, KC_F9, KC_F10, KC_F11, KC_F12, M(_USER),KC_WH_U, KC_MS_U, KC_WH_D, _______, - _______, KC_F5, KC_F6, KC_F7, KC_F8, KC_VOLU, KC_MS_L, KC_MS_D, KC_MS_R, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_VOLD, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN1, KC_BTN3, DF(_CO), DF(_QW), RESET - ), - - /* - * Gaming - * - * ,----------------------------------. ,----------------------------------. - * | | | | | | | |Whl Up| MUp |Whl Dn| | - * +------+------+------+------+------| +------+------+------+------+------| - * | | | | | | | | MLeft| MDown|MRight| | - * +------+------+------+------+------| +------+------+------+------+------| - * | Z | | | | | ,------. ,------. | | | | | | - * +------+------+------+------+------| | Bksp | |RClick| +------+------+------+------+------| - * | | _GA | | Shift| Space| | | | | |LClick|MClick| | | | - * `----------------------------------' `------' `------' `----------------------------------' - * - */ - [_GA] = LAYOUT( /* Gaming */ - _______, _______, _______, _______, _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, - _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, - KC_Z, _______, _______, _______, _______, _______, _______, KC_MS_D, _______, _______, - _______, TG(_GA), _______, KC_LSFT, KC_SPC, KC_BSPC, KC_BTN2, KC_BTN1, KC_BTN3, _______, _______, _______ - ) }; -/* - * Template - * - * ,----------------------------------. ,----------------------------------. - * | | | | | | | | | | | | - * +------+------+------+------+------| +------+------+------+------+------| - * | | | | | | | | | | | | - * +------+------+------+------+------| +------+------+------+------+------| - * | | | | | | ,------. ,------. | | | | | | - * +------+------+------+------+------| | | | | +------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `----------------------------------' `------' `------' `----------------------------------' - * - */ +// Uncomment any of these to add keyboard-specific code. Otherwise, they +// will use user defaults defined in the replicaJunction.h header file. -const uint16_t PROGMEM fn_actions[] = { +// bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +// return true; +// } -}; +// void matrix_init_keymap(void) {}; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case _USER: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; +// void matrix_scan_keymap(void) {}; diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt new file mode 100644 index 0000000000..aec41316f2 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/base-layer.txt @@ -0,0 +1,34 @@ +[{r:10,rx:1,y:-0.1,x:2},"F"], +[{y:-0.65,x:1},"W",{x:1},"P"], +[{y:-0.75},"Q"], +[{y:-0.9,x:4},"B"], +[{y:-0.7,x:2},"S"], +[{y:-0.65,x:1,c:"#45b866"},"R",{x:1,c:"#cccccc"},"T"], +[{y:-0.75},"A"], +[{y:-0.9,x:4},"G"], +[{y:-0.7,x:2},"C\n\n\n"], +[{y:-0.65,x:1},"X\n\n\nCtrl",{x:1},"D\n\n\nCtrlAlt"], +[{y:-0.75},"Z"], +[{y:-0.9,x:4},"V\n\n\nAlt"], +[{y:-0.75,x:5,h:1.5},"Del\nCtrl"], +[{y:-0.95,x:2},"Tab"], +[{y:-0.65,x:1,a:7,fa:[7]},"",{x:1,a:4,f:3},"Shift"], +[{y:-0.75,f:3},"Layer tap"], +[{y:-0.9,x:4,f:3},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,f:3},"U"], +[{y:-0.65,x:1,f:3},"L",{x:1,f:3},"Y"], +[{y:-0.75,x:4,f:3},":\n;"], +[{y:-0.9,f:3},"J"], +[{y:-0.7,x:2,c:"#ffb07b",f:3},"E"], +[{y:-0.65,x:1,c:"#cccccc",f:3},"N",{x:1,c:"#5dcde3",f:3},"I"], +[{y:-0.75,x:4,c:"#cccccc",f:3},"O"], +[{y:-0.9,f:3},"M"], +[{y:-0.7,x:2,f:3},"<\n,\n\nCtrlAlt"], +[{y:-0.65,x:1,f:3},"H\n\n\nAlt",{x:1,f:3},">\n.\n\n"], +[{y:-0.75,x:4,f:3},"?\n/\n\nCtrl"], +[{y:-0.9,f:3},"K"], +[{y:-0.75,x:-1,f:3,h:1.5},"Enter\nAlt"], +[{y:-0.95,x:2,f:3},"_\n-"], +[{y:-0.65,x:1,f:3},"Shift",{x:1,f:3},"\"\n'"], +[{y:-0.75,x:4,f:3},"+\n="], +[{y:-0.9,c:"#ffe08d",f:3},"Space"] diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt new file mode 100644 index 0000000000..2b4105b2b4 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/e-layer.txt @@ -0,0 +1,34 @@ +[{r:10,rx:1,y:-0.1,x:2},"<="], +[{y:-0.65,x:1},"==",{x:1},">="], +[{y:-0.75},"make"], +[{y:-0.9,x:4},"=>"], +[{y:-0.7,x:2},"select *"], +[{y:-0.65,x:1,a:7},"",{x:1,a:4},"$_"], +[{y:-0.75,a:7},""], +[{y:-0.9,x:4},""], +[{y:-0.7,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{y:-0.75,x:5,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""], +[{y:-0.7,x:2,c:"#ffb07b"},""], +[{y:-0.65,x:1,c:"#cccccc"},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""], +[{y:-0.7,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""], +[{y:-0.75,x:-1,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""] diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt new file mode 100644 index 0000000000..d45fb7e97d --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/fn-layer.txt @@ -0,0 +1,35 @@ +[{r:10,rx:1,y:-0.1,x:2},"RClick"], +[{y:-0.65,x:1,a:7},"",{x:1,a:4},"LClick"], +[{y:-0.75,a:7},""], +[{y:-0.9,x:4,a:4},"MClick"], +[{y:-0.7,x:2},"Alt"], +[{y:-0.65,x:1},"Shift",{x:1},"Ctrl"], +[{y:-0.75,a:7,fa:[7]},""], +[{y:-0.9,x:4,a:4,fa:[5,0,0,0,0,0,0,0,0,0,7]},"\n\n\n\n\n\n\n\n\n\n"], +[{y:-0.7,x:2,fa:[0,0,0,0,0,0,0,0,0,0,7]},"\n\n\n\n\n\n\n\n\n\n"], +[{y:-0.65,x:1},"\n\n\n\n\n\n\n\n\n\n",{x:1},"\n\n\n\n\n\n\n\n\n\n"], +[{y:-0.75},"\n\n\n\n\n\n\n\n\n\n"], +[{y:-0.9,x:4,fa:[5,0,0,0,0,0,0,0,0,0,7]},"\n\n\n\n\n\n\n\n\n\n"], +[{y:-0.75,x:5,a:7,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4,c:"#ffe08d"},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,c:"#cccccc",a:4,f:3},"F10"], +[{y:-0.65,x:1,f:3},"F9",{x:1,f:3},"F11"], +[{y:-0.75,x:4,f:3},"F12"], +[{y:-0.9,a:7},""], +[{y:-0.7,x:2,a:4,f:3},"F6"], +[{y:-0.65,x:1,f:3},"F5",{x:1,f:3},"F7"], +[{y:-0.75,x:4,f:3},"F8"], +[{y:-0.9,a:7},""], +[{y:-0.7,x:2,a:4,f:3},"F2"], +[{y:-0.65,x:1,f:3},"F1",{x:1,f:3},"F3"], +[{y:-0.75,x:4,f:3},"F4"], +[{y:-0.9,a:7},""], +[{y:-0.75,x:-1,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9,c:"#ffe08d"},""] + diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt new file mode 100644 index 0000000000..45bef783a3 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/i-layer.txt @@ -0,0 +1,34 @@ +[{r:10,rx:1,y:-0.1,x:2},"{"], +[{y:-0.65,x:1},"@",{x:1},"}"], +[{y:-0.75},"!"], +[{y:-0.9,x:4},"/"], +[{y:-0.7,x:2},"("], +[{y:-0.65,x:1},"$",{x:1},")"], +[{y:-0.75},"#"], +[{y:-0.9,x:4},"|"], +[{y:-0.7,x:2},"["], +[{y:-0.65,x:1},"^",{x:1},"]"], +[{y:-0.75},"%"], +[{y:-0.9,x:4},"\\"], +[{y:-0.75,x:5,a:7,h:1.5},""], +[{y:-0.95,x:2,a:4},"<"], +[{y:-0.65,x:1},"&",{x:1},">"], +[{y:-0.75,a:7},""], +[{y:-0.9,x:4},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,a:4},"`"], +[{y:-0.65,x:1},"_",{x:1,a:7},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""], +[{y:-0.7,x:2,a:4},"'"], +[{y:-0.65,x:1},"-",{x:1,c:"#5dcde3",a:7},""], +[{y:-0.75,x:4,c:"#cccccc"},""], +[{y:-0.9},""], +[{y:-0.7,x:2,a:4},"\""], +[{y:-0.65,x:1},"~",{x:1,a:7},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""], +[{y:-0.75,x:-1,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4},""], +[{y:-0.9},""] diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt new file mode 100644 index 0000000000..3d44383863 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/r-layer.txt @@ -0,0 +1,34 @@ +[{r:10,rx:1,y:-0.1,x:2,a:7},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{y:-0.7,x:2,a:4},"&"], +[{y:-0.65,x:1,c:"#45b866",a:7},"",{x:1,c:"#cccccc",a:4},"|"], +[{y:-0.75,a:7},""], +[{y:-0.9,x:4},""], +[{y:-0.7,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{y:-0.75,x:5,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2,a:4},"8"], +[{y:-0.65,x:1},"7",{x:1},"9"], +[{y:-0.75,x:4},"/"], +[{y:-0.9},":"], +[{y:-0.7,x:2},"5"], +[{y:-0.65,x:1},"4",{x:1},"6"], +[{y:-0.75,x:4},"*"], +[{y:-0.9},"#"], +[{y:-0.7,x:2},"2"], +[{y:-0.65,x:1},"1",{x:1},"3"], +[{y:-0.75,x:4},"-"], +[{y:-0.9},""], +[{y:-0.75,x:-1,a:7,h:1.5},""], +[{y:-0.95,x:2,a:4},"."], +[{y:-0.65,x:1},"0",{x:1},"="], +[{y:-0.75,x:4},"+"], +[{y:-0.9},"Space"] diff --git a/keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt b/keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt new file mode 100644 index 0000000000..d1ffa35f89 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/kle/space-layer.txt @@ -0,0 +1,34 @@ +[{r:10,rx:1,y:-0.1,x:2,a:7},""], +[{y:-0.65,x:1},"",{x:1,fa:[7]},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{y:-0.7,x:2,a:4,f:3},"Alt"], +[{y:-0.65,x:1,f:3},"Shift",{x:1,f:3},"Ctrl"], +[{y:-0.75,a:7},""], +[{y:-0.9,x:4},""], +[{y:-0.7,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{y:-0.75,x:5,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75},""], +[{y:-0.9,x:4},""], +[{r:-10,rx:7,ry:0.965,y:-0.2,x:2},""], +[{y:-0.65,x:1,a:4,f:3},"Home",{x:1,f:3},"End"], +[{y:-0.75,x:4,f:3},"Delete"], +[{y:-0.9,f:3},"PgUp"], +[{y:-0.7,x:2,a:7},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4,a:4,f:3},"Bksp"], +[{y:-0.9,f:3},"PgDn"], +[{y:-0.7,x:2,f:3},"Tab"], +[{y:-0.65,x:1,f:3},"Shift+\n\n\n\n\n\nTab",{x:1,a:7},""], +[{y:-0.75,x:4,a:4,f:3},"Insert"], +[{y:-0.9,a:7},""], +[{y:-0.75,x:-1,h:1.5},""], +[{y:-0.95,x:2},""], +[{y:-0.65,x:1},"",{x:1},""], +[{y:-0.75,x:4,a:4,f:3},"Prnt Scrn"], +[{y:-0.9,c:"#ffe08d",a:7},""] diff --git a/keyboards/atreus/keymaps/replicaJunction/readme.md b/keyboards/atreus/keymaps/replicaJunction/readme.md index 6a330bdbfc..f1d6c47b13 100644 --- a/keyboards/atreus/keymaps/replicaJunction/readme.md +++ b/keyboards/atreus/keymaps/replicaJunction/readme.md @@ -1,61 +1,103 @@ -# replicaJunction - Atreus Layout # +# replicaJunction - Atreus Layout This layout is designed to make the absolute most out of the Atreus 40% keyboard. -I was enchanted with the idea of the Atreus keyboard after using my Ergodox for several months. I wanted something of a similar form factor that was easily portable, so I could bring and transport a keyboard to my workplace without much hassle. After building the Atreus keyboard, though, I realized very quickly that the 40% form factor requires a lot more creativity than a full-size keyboard (even one as strangely-shaped as the Ergodox). +This layout is probably not perfect for you. That's okay! Use it for ideas as you design your own perfect layout. -The default Atreus keyboard layout provides all the necessary keys in order to function with the keyboard, but as a programmer, I needed quicker access to just about everything. I noticed that the default layer didn't include any dual-role keys, and so I started on my journey to build my perfect layout for the Atreus. +Most of the custom logic in this keyboard is actually not in these files. Instead, it's in the directory `/users/replicaJunction` (from the root of the QMK repo). This allows me to share macros and custom logic between multiple keyboards. A `process_record_keyboard()` function defined weakly in `replicaJunction.h` allows keyboards to process records individually as well without overriding the `process_record_user()` function. (My Ergodox uses this to handle its LEDs, for example.) -I won't claim that this layout is perfect for everyone. It does make several significant changes from the "normal" Atreus layout. In my own use, though, I've found this keyboard turbocharges my Atreus, and gives it the power of a full-size keyboard without the size. +The default letter layout in this keymap is [Colemak-ModDH](https://colemakmods.github.io/mod-dh/). I use the "matrix version" of that layout, which retains the M key on the home row as in normal Colemak. -## Base Layer ## +## Design Goals -![Atreus base layout](http://imgur.com/YbOjS7O) +I designed this layout with the following goals in mind: -The letters on this layout are arranged in the [Colemak Mod-DH layout](https://colemakmods.github.io/mod-dh/). +* Nothing may interfere with ordinary typing. +* Symbols need to be accessible quickly and organized in a manner I can remember. +* Limit more difficult finger movements (and pinky usage in general). -The primary mechanism for the Shift keys in this keyboard are the dual-role Z and slash keys. Pressing the key sends the keystroke, while holding the key sends a shift. This is a design choice taken from the xyverz layout, and one I find much more intuitive than a thumb shift. In addition, the pinky doesn't need to stretch as far to reach these keys as it does to reach a standard Shift key. +### Nothing may interfere with ordinary typing -Occasionally, when typing the letter Z, I'll hold the key down a fraction of a second too long, and the keyboard will shift instead. If you're not a confident typist, this dual-role Shift key layout is probably not a good solution. In that case, I'd suggest moving Shift onto the Backspace key (press for Backspace, hold for Shift). +For a long time, this meant that I couldn't use letters or home row keys as dual-role keys. I'm a fast typer, and I'm sometimes already typing the next letter before I've fully released the previous one. Normal keyboards don't care about this, but if I started adding dual-role functionality to letters, I found that I would sometimes type the next letter before releasing the layer toggle, and the letter I tried to send would still be sent under the layer I thought I'd left off. -In addition to the Shift keys, there are three dual-purpose keys: Ctrl (Delete), Alt (Enter), and Space (Number layer). In QMK, these dual-role keys can be made to hold their primary key with a tap and hold. For example, if I wanted to insert a long string of Spaces, I would tap the Space key, then tap it again and hold. A single press and hold would trigger the secondary function of the key instead. +Fortunately, though, QMK has addressed this with the `PERMISSIVE_HOLD` flag. [Details are on the QMK docs page.](https://docs.qmk.fm/#/feature_advanced_keycodes?id=permissive-hold) -## Extend Layer ## +Using that flag, I'm comfortable having layer shift keys on the home row, and this goes a long way to eliminate finger stress. -![Atreus extend layer](http://imgur.com/WiKkMQw) +### Sympols need to be accessible quickly -This layout is designed primarily for keyboard navigation. Arrow keys are easily accessible under the right hand (a welcome change from the original Atreus layout, which places them under the left hand), along with Home/End and PgUp/PgDn. +Symbols are available under my left hand by holding the I key (on my right hand). I've grouped parenthesis, slashes, and braces together; the remaining symbols are ordered in the same way as they appear on USA keycap legends (for example, 1 is !, so that symbol is first in my lineup). Practically, I just had to get used to these other "misc" symbols. -Modifiers are also placed under the home row of the left hand. One of the single keyboard actions I use most is Shift+Ctrl+Left/Right to select a whole word; this layer makes those keypresses simple by adding the Ctrl key in an easy-to-reach location. +This also means that some symbols are accessible in more than one way. For example, the carats (greater than and less than) are available both in the "normal" location (Shift+Comma / Shift+Period) and on the symbol layer. I make regular changes to some of the symbols I don't use as commonly as I think of them. -For the common Ctrl shortcuts, I also added some hotkeys to this layer over the letter keys they are associated with. This gives the Extend key some extra utility by letting it "feel" like a Ctrl key in some cases. +### Limit more difficult finger movements -The Space key exists to prevent going from this layer directly into the Number layer. Similarly, the Shift key on the left pinky helps make sure that the normal letter (Z) doesn't fire. +This is why I kept trying to put layer toggles on the home row keys instead of just placing them on random thumb keys. I suffer from RSI, and it's important for me to watch out for more "stressful" finger movements. -## Number and Symbol Layer ## +The home row is the easiest row for your fingers to hit, followed by the upper row, and the lower row is noticeably more difficult to press. Because of this, I favored the upper row over the lower one any time I had the option to do so. -![Atreus number and symbol layer](http://imgur.com/gfTXcjC) +## Features -This layer provides the only way of accessing number keys on this keyboard, since it's too small for its own number row. Note that even though they are laid out in the number pad fashion, they send the "regular" number keystrokes. Games and programs that specifically use NumPad keys are not supported in this layout at the moment. +### ZXC Mods -This layer also provides plenty of symbol shortcuts. Most of these can be accessed through other means (like Shift+8 for the asterisk), but having shortcut keys to them makes for one less keypress, which adds up quickly when using these symbols on a regular basis. I've been through many revisions of this concept on my Ergodox as well as the Atreus, and I've finally arrived at this layout as the one that provides the symbols I need most frequently in places I can think to expect them. The Ordinary layout from the Ergodox-EZ keyboard in this repository was a large influence in this design. +Keys on the bottom row of each half of this keyboard can be held to send modifier keys. I've tried to map this in a relatively logical manner: -## Function Layer ## +* Z / Slash: Ctrl +* X / Period: GUI +* C / Comma: Ctrl+Alt +* D / H: Alt -![Atreus function layer](http://imgur.com/m5x0MxZ) +Combined with Shift keys on the thumbs, this makes all modifiers quick to access on either hand. -Function keys (F1-F12) are on this layer. Their layout in groups of four comes from Jeremy's Atreus layout in this repository. I'd been using 1-9 in a numpad layout, then adding 10-12 on the side...I suppose it took seeing someone else do it this way for me to realize how much more sense it makes. +### Layer tap dance -On the right side are mouse keys - cursor left/right/up/down, and scroll up/down. Volume keys are also here, though really only because there was room for them (I'm not entirely happy with their positions). +The lower-left key on the left hand can be used to apply or remove layers based on a number of taps: -Finally, the reset key is on this layer, as well as toggles from Colemak to QWERTY and back. The QWERTY layer is not currently documented, but it is functionally identical to the base layer except for letter positions. +* 1 tap sends Escape, and also disables any persistent layers. +* 2 taps enables the Number pad layer. +* 5 or more taps resets the keyboard. -## Gaming Layer ## +## Extend Layer -![Atreus gaming layer](http://imgur.com/4S5AO4E) +[Originally found on the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/), having a QMK-powered keyboard allows a super easy implementation of this concept. The idea is to place commonly-used keys under easy reach of your hands. Since I work with text often, my most common needs are things like Ctrl+Shift+arrow keys, and they're easy to access using this layer. (While technically it's four keypresses instead of just three, since it takes one key to enter the layer, that one key is a thumb button and the other three are all on the home row, so I find it much more comfortable than modifiers on a traditional keyboard.) -This is a small layer developed to allow some simple gameplay without a mouse. This layer is a toggle (from the Number layer), so it is designed to stay on while in use. +Also featured in this layer is easy access to Tab, plus a Shift+Tab key. Alt-Tabbing back and forth, along with Ctrl-Tab, are super easy and friendly. When I need Ctrl+Alt+Delete, I typically use the ones found on this layer. -The keys on the left hand bring Space into the left thumb's reach, as well as overriding the dual-role Shift with its standard function (Z in both QWERTY and in Colemak). This allows easy Shift presses without blocking the Z key, commonly used in games. +## Layout Images -I would probably not consider the Atreus a hard-core gaming keyboard in the first place, and this layout does have the huge problem of blocking access to the number keys, but for more casual games, it plays quite well. I've used it quite a bit on Minecraft, for example, and I'm quite pleased with it. \ No newline at end of file +Colored keys indicate keys that swap to another layer when held. + +These images are located in the `kle` folder of this directory. Also included is the "raw data" from Keyboard-Layout-Editor in a corresponding text file. + +### Base layer + +![Base layer](kle/base-layer.png) + +### R layer + +![R layer](kle/r-layer.png) + +### E layer + +![E layer](kle/i-layer.png) + +### I layer + +![I layer](kle/i-layer.png) + +### Space layer + +![Space layer](kle/space-layer.png) + +### Function layer + +![Function layer](kle/fn-layer.png) + +## Credits + +* [Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme.md) + * User / keymap function ideas +* [Jeremy](https://github.com/qmk/qmk_firmware/blob/master/keyboards/atreus/keymaps/jeremy/readme.md) + * Sanity check on the Function keys (_of course they should be in rows of 4, not rows of 3 like a number pad. Why did I ever use anything else?_) +* [DreymaR of the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/) + * Original idea of the Extend layer diff --git a/keyboards/atreus/keymaps/replicaJunction/rules.mk b/keyboards/atreus/keymaps/replicaJunction/rules.mk new file mode 100644 index 0000000000..9ff9c3fbb2 --- /dev/null +++ b/keyboards/atreus/keymaps/replicaJunction/rules.mk @@ -0,0 +1,12 @@ +# https://docs.qmk.fm/getting_started_make_guide.html + +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = yes +# KEY_LOCK_ENABLE = yes +# CONSOLE_ENABLE = no +# COMMAND_ENABLE = no + +# Use the "Unicode map" method +# UNICODE_ENABLE = no +# UNICODEMAP_ENABLE = yes + diff --git a/layouts/community/ergodox/replicaJunction/config.h b/layouts/community/ergodox/replicaJunction/config.h index c69ce8cea9..9ffd74dccd 100644 --- a/layouts/community/ergodox/replicaJunction/config.h +++ b/layouts/community/ergodox/replicaJunction/config.h @@ -1,64 +1,13 @@ -/* -Config file - Ergodox QMK with replicaJunction layout - -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 . -*/ - -#ifndef KEYBOARDS_ERGODOX_CONFIG_H_ -#define KEYBOARDS_ERGODOX_CONFIG_H_ - -#include QMK_KEYBOARD_CONFIG_H - - -#undef MOUSEKEY_DELAY -#undef MOUSEKEY_INTERVAL -#undef MOUSEKEY_MAX_SPEED -#undef MOUSEKEY_TIME_TO_MAX - -#define MOUSEKEY_DELAY 100 -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_MAX_SPEED 3 -#define MOUSEKEY_TIME_TO_MAX 10 - -#define TAPPING_TOGGLE 1 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -// MS the button needs to be held before a tap becomes a hold (default: 200) -#define TAPPING_TERM 200 - -#define IGNORE_MOD_TAP_INTERRUPT // this makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when you hold it, and when this option isn't enabled, z rapidly followed by x actually sends Ctrl-x. That's bad.) - -// I don't have any locking keys, so I don't need these features - - -/* 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 - -/* Prevent modifiers from sticking when switching layers */ -/* Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers */ -#define PREVENT_STUCK_MODIFIERS - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) || \ - keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ -) - - -#endif /* KEYBOARDS_ERGODOX_CONFIG_H_ */ +#pragma once + +// Layer definitions + +#define L_COLEMAK 0 +#define L_QWERTY 1 +#define L_NUM 2 +#define L_EXTEND 3 +#define L_FUNC 4 +#define L_GAMING 5 +#define L_LL_R 6 +#define L_LL_E 7 +#define L_LL_I 8 diff --git a/layouts/community/ergodox/replicaJunction/keymap.c b/layouts/community/ergodox/replicaJunction/keymap.c index fc80059276..ce0400be5c 100644 --- a/layouts/community/ergodox/replicaJunction/keymap.c +++ b/layouts/community/ergodox/replicaJunction/keymap.c @@ -1,333 +1,424 @@ /* * Keyboard: Ergodox * Keymap: replicaJunction - * Version: 1.2 - * - * This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus. - * The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox, and I now - * have both keyboards, so I've designed these layouts in an effort to make switching between the - * two as easy as possible. - * - * I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible, - * adding to the layers in the Atreus config without disturbing what's there already. This allows for - * things like F11-F20, the Application (Menu) key, and better media key placement. - * - * The default key layout in this keymap is Colemak-ModDH. Information on that layout can be found - * here: https://colemakmods.github.io/mod-dh/ + * Version: 2.1 */ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" - -#define _CO 0 // Colemak -#define _QW 1 // QWERTY -#define _ME 2 // media keys -#define _NU 3 // numpad -#define _EX 4 // extend -#define _GA 5 // mouse overlay for gaming - -// Some quick aliases, just to make it look pretty -#define _______ KC_TRNS -#define KCX_CGR LCTL(KC_GRV) -#define KX_STAB LSFT(KC_TAB) -#define KX_COPY LCTL(KC_C) -#define KX_CUT LCTL(KC_X) -#define KX_PAST LCTL(KC_V) -#define KX_UNDO LCTL(KC_Z) - -; // This doesn't do anything. It's just for VSCode because its syntax highlighting is weird for the above #define statements. +#include "config.h" +#include "replicaJunction.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * Keymap: Colemak-ModDH - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | LCtrl | Q | W | F | P | B | Home | | BkSp | J | L | U | Y | ; | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Tab | A | R | S | T | G |------| |------| M | N | E | I | O | ' | - * |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------| - * | LShft | Z | X | C | D | V | | | | K | H | , | , | / | RShft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGui | [ | ] |CtlShf| LAlt | | _EX | - | ' | = | \ | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtrl| ~GA | | Left | Right| - * ,------|------|------| |------+------+------. - * |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ | - * | BkSp | Del |------| |------| Enter| Space| - * | | | _NU | | Down | | | - * `--------------------' `--------------------' - */ -[_CO] = LAYOUT_ergodox( - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_LCTL,KC_Q, KC_W, KC_F, KC_P, KC_B, KC_HOME, - KC_TAB, KC_A, KC_R, KC_S, KC_T, KC_G, - KC_LSFT,KC_Z, KC_X, KC_C, KC_D, KC_V, ALL_T(KC_NO), - KC_LGUI,KC_LBRC,KC_RBRC, LCTL(KC_LSFT), KC_LALT, - - KC_LCTL, TG(_GA), - KC_HOME, - CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU), - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_BSPC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN,KC_MINS, - KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_BSLS, KC_K, KC_H, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, - MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS, - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC) - ), - - /* - * Keymap: QWERTY layout. - * - * This is optimized for gaming, not typing, so there aren't as many macros - * as the Dvorak layer. Some of the keys have also been moved to "game- - * like" locations, such as making the spacebar available to the left thumb, - * and repositioning the arrow keys at the bottom right corner. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | | 6 | 7 | 8 | 9 | 0 | = | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | LCtrl | Q | W | E | R | T | Home | | BkSp | Y | U | I | O | P | - | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | Tab | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| Hyper| | \ |------+------+------+------+------+--------| - * | LShft | Z | X | C | V | B | | | | N | M | , | . | / | RShft | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LGui | ` | \ |CtlShf| _NU | | _EX | - | ' | = | \ | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | LCtrl| ~GA | | Left | Right| - * ,------|------|------| |------+------+------. - * |LCtrl/| LAlt/| Home | | Up | Alt/| _NU/ | - * | BkSp | Del |------| |------| Enter| Space| - * | | | _NU | | Down | | | - * `--------------------' `--------------------' - */ -[_QW] = LAYOUT_ergodox( // Layer1: QWERTY - // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_ESC, - KC_LCTL,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_HOME, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - KC_LGUI,KC_GRV, KC_SLSH,LCTL(KC_LSFT), MO(_NU), - - KC_LCTL,TG(_GA), - KC_HOME, - CTL_T(KC_BSPC), ALT_T(KC_DEL), MO(_NU), - // right hand - KC_ESC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, - KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, - KC_BSLS, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, - MO(_EX),KC_MINS,KC_QUOT,KC_EQL, KC_BSLS, - - KC_LEFT, KC_RGHT, - KC_UP, - KC_DOWN, ALT_T(KC_ENT), LT(_NU,KC_SPC) - ), - - /* - * Keymap: Numbers and symbols - * - * Note that the number keys here are actually numpad keystrokes. This often doesn't matter, but it may be relevant in a few cases. - * That's why the Num Lock key exists on this layer - just in case. - * - * This layer also contains the layout switches. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | ! | @ | { | } | & | | | | / | 7 | 8 | 9 | * | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | # | $ | ( | ) | ~ |------| |------| | | 4 | 5 | 6 | - | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | % | ^ | [ | ] | ` | | | | \ | 1 | 2 | 3 | + | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | |QWERTY|Colemk| | | | 0 | . | = | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * |NumLck| RESET| | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - */ -[_NU] = LAYOUT_ergodox( - // left hand - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, - _______, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_AMPR, _______, - _______, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_TILD, - _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_GRV, _______, - _______, DF(_QW), DF(_CO), _______, _______, - - KC_NLCK,RESET, - _______, - _______,_______,_______, - // right hand - _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, KC_SLSH, KC_P7, KC_P8, KC_P9, KC_PAST, _______, - KC_PIPE, KC_P4, KC_P5, KC_P6, KC_PMNS, _______, - _______, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, _______, - KC_P0, KC_PDOT, KC_EQL, _______, _______, - - _______, _______, - _______, - _______, _______, _______ - ), - - /* - * Keymap: Extend - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | F11 | F12 | F13 | F14 | F15 | Mute | | | F16 | F17 | F18 | F19 | F20 | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | Ctrl`| Vol | | | PgUp | Home | Up | End | Del | | - * |--------+------+------+------+------+------| Up | | |------+------+------+------+------+--------| - * | | | Gui | Alt | Ctrl | |------| |------| PgDn | Left | Down | Right| BkSp | Menu | - * |--------+------+------+------+------+------| Vol | | |------+------+------+------+------+--------| - * | | Undo | Cut | Copy | | Paste| Down | | | | ^Tab | Tab | |Insert| PrntScr| - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | | | | | - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | | |------| |------| | | - * | | | | | | | | - * `--------------------' `--------------------' - * - * Ctrl+` is a keyboard shortcut for the program ConEmu, which provides a Quake-style drop-down command prompt. - * - */ -[_EX] = LAYOUT_ergodox( - // left hand - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_MUTE, - _______, _______, _______, _______, _______, KCX_CGR, KC_VOLU, - _______, _______, KC_LGUI, KC_LALT, KC_LCTL, _______, - _______, KX_UNDO, KX_CUT, KX_COPY, _______, KX_PAST, KC_VOLD, - _______, _______, _______, _______, _______, - - _______,_______, - _______, - _______,_______,_______, - // right hand - _______, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______, - KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU, - _______, _______, KX_STAB, KC_TAB, _______, KC_INS, KC_PSCR, - _______, _______, _______, _______, _______, - _______, _______, - _______, - _______, _______, _______ - ), - - /* - * Keymap: Gaming - * - * Provides a mouse overlay for the right hand, and also moves some "gamer friendly" keys to the left, such as space. - * This layer also removes a lot of dual-role keys, as when gaming, it's nicer not to need to keep track of those. - * - * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | | | | |WhlUp | MsUp |WhlDn | | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | |------| |------| |MsLeft|MsDown|MsRght| | | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | | | | | | | | | | | | | | | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | LCtrl| | | | | | | | | | | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | | ~_GA | | |MClick| - * ,------|------|------| |------+------+------. - * | | | | | | | | - * | Space| |------| |------|RClick|LClick| - * | | | | | | | | - * `--------------------' `--------------------' - */ -[_GA] = LAYOUT_ergodox( - // left hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - KC_LCTL, _______, _______, _______, _______, - - _______,_______, - _______, - KC_SPC, _______,_______, - - // right hand - _______, _______, _______, _______, _______, _______, _______, - _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, - _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, - _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, - _______, KC_BTN3, - _______, - _______, KC_BTN2, KC_BTN1 - ), -}; -const uint16_t PROGMEM fn_actions[] = { - [1] = ACTION_LAYER_TAP_TOGGLE(_NU) // FN1 - Momentary Layer 1 (Numbers and symbols) -}; +[L_COLEMAK] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + KC_ESC ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_GRV , +//--------|--------|--------|--------|--------|--------|--------| + KX_ECTL ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_LBRC , +//--------|--------|--------|--------|--------|--------|--------| + KC_TAB ,KC_A ,KC_R_LT ,KC_S_LT ,KC_T ,KC_G, +//--------|--------|--------|--------|--------|--------|--------| + KC_LSFT ,KX_Z_MT ,KX_X_MT ,KX_C_MT ,KX_D_MT ,KC_V ,KC_RBRC , +//--------|--------|--------|--------|--------|--------|--------| + TD_LAYR ,KC_LGUI ,KC_HYPR ,KX_CTSF ,KC_LCTL , +//--------|--------|--------|--------|--------|--------|--------| + KC_HOME ,KC_END , +// |--------|--------| + KC_PGUP , +// |--------|--------|--------| + KX_BKNM ,KX_DCTL ,KC_PGDN , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|-------| + TG_GAME ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_EQL , +//--------|--------|--------|--------|--------|--------|-------| + KC_DEL ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS, +//--------|--------|--------|--------|--------|--------|-------| + KC_M ,KC_N ,KC_E_LT ,KC_I_LT ,KC_O ,KC_QUOT, +//--------|--------|--------|--------|--------|--------|-------| + KC_LOCK ,KC_K ,KX_H_MT ,KX_COMT ,KX_DOMT ,KX_SLMT ,KC_RSFT, +//--------|--------|--------|--------|--------|--------|-------| + KC_LALT ,KC_MINS ,KC_QUOT ,KC_EQL ,TT_NUM , +//--------|--------|--------|--------|--------|--------|-------| + KC_LEFT ,KC_RGHT , +//--------|--------| + KC_UP , +//--------|--------|--------| + KC_DOWN ,KX_NALT ,KX_SPAC +//--------|--------|--------| + +), + + + +[L_QWERTY] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,KC_EQL , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT , +//--------|--------|--------|--------|--------|--------|--------| + KC_LOCK ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , +//--------|--------|--------|--------|--------|--------|--------| + KC_RALT ,KC_MINS ,KC_QUOT ,KC_EQL ,TT_NUM , +//--------|--------|--------|--------|--------|--------|--------| + KC_LEFT ,KC_RGHT , +//--------|--------| + KC_UP , +//--------|--------|--------| + KC_DOWN ,KX_NALT ,KX_SPAC +//--------|--------|--------| +), + + + +[L_NUM] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_SLSH ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_PIPE, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_BSLS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_AMPR ,KC_LABK ,KC_RABK, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_COLN ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PSLS ,KC_F12 , +//--------|--------|--------|--------|--------|--------|--------| + KC_HASH ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PAST ,KC_BSPC , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_BSPC ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PMNS ,KC_TAB , +//--------|--------|--------|--------|--------|--------|--------| + KC_P0 ,KC_PDOT ,KC_PEQL ,KC_PPLS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------| + _______ , +//--------|--------|--------| + _______ ,KC_PENT ,MO_FUNC +//--------|--------|--------| +), + + + +[L_EXTEND] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,KC_APP ,KX_CGR, KC_VOLU, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,KX_SRCH, KX_PAST, KC_VOLD, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------|--------| + _______ , +// |--------|--------|--------| + MO_FUNC, _______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_PGUP, KC_HOME, KC_UP, KC_END, KC_DEL, _______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_BSPC, KC_MENU, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KX_STAB, KC_TAB, _______ ,KC_INS, KC_PSCR, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,KC_PSCR, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ +//--------|--------|--------|--------|--------|--------|--------| +), + + + +[L_FUNC] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_F11 ,KC_F12 ,KC_F13 ,KC_F14 ,KC_F15 ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,M_LCLIK, M_RCLIK, M_MCLIK, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_LGUI, KC_LSFT, KC_LALT, KC_LCTL, M_WHLUP, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,M_LEFT, M_DOWN, M_UP ,M_RIGHT, M_WHLDN, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_F16 ,KC_F17 ,KC_F18 ,KC_F19 ,KC_F20 ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_VOLU, KC_F9, KC_F10, KC_F11, KC_F12, _______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_MUTE, KC_F5, KC_F6, KC_F7, KC_F8, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_VOLD, KC_F1, KC_F2, KC_F3, KC_F4, _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ +//--------|--------|--------|--------|--------|--------|--------| +), -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { + +[L_GAMING] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_ESC ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_R ,KC_S ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_LSFT, _______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,KC_LALT ,KC_LCTL , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + KC_SPC, KC_LSFT, _______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_E ,KC_I ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,KC_UP, KC_SLSH, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_LEFT, KC_DOWN, KC_RGHT, +//--------|--------|--------|--------|--------|--------|--------| + M_MCLIK ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + M_RCLIK , +//--------|--------|--------|--------|--------|--------|--------| + M_LCLIK ,KC_ENT ,KC_BSPC +//--------|--------|--------|--------|--------|--------|--------| +) +, + +// "Letter Layers" + +[L_LL_R] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,ooooooo ,KC_AMPR ,KC_PIPE ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_COLN ,KC_P7 ,KC_P8 ,KC_P9 ,KC_PSLS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_HASH ,KC_P4 ,KC_P5 ,KC_P6 ,KC_PAST ,KC_TAB , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_BSPC ,KC_P1 ,KC_P2 ,KC_P3 ,KC_PMNS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + KC_P0 ,KC_PDOT ,KC_PEQL ,KC_PPLS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------| + _______ , +//--------|--------|--------| + _______ ,KC_PENT ,MO_FUNC +//--------|--------|--------| +) +, + +[L_LL_E] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + RJ_QMKV ,RJ_MAKE ,RJ_EQ ,RJ_LEQ ,RJ_GEQ ,RJ_GEQR ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,RJ_SELS ,RJ_DUND ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,ooooooo ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------| + _______ , +//--------|--------|--------| + _______ ,_______ ,_______ +//--------|--------|--------| +) +, + +[L_LL_I] = LAYOUT_ergodox( +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_SLSH ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_HASH ,KC_DLR ,KC_LPRN ,KC_RPRN ,KC_PIPE, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_PERC ,KC_CIRC ,KC_LBRC ,KC_RBRC ,KC_BSLS ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_AMPR ,KC_LABK ,KC_RABK, +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +// |--------|--------| + _______ , +// |--------|--------|--------| + _______ ,_______ ,_______ , +// |--------|--------|--------| + +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_UNDS, KC_GRV ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,KC_MINS ,KC_QUOT ,ooooooo ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,KC_TILD, KC_DQT ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ ,_______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ , +//--------|--------|--------|--------|--------|--------|--------| + _______ ,_______ ,_______ +//--------|--------|--------|--------|--------|--------|--------| +) + }; -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { +// The normal QMK functions ending in _user are overridden in the +// replicaJunction userspace. Those functions handle my global +// settings, and redirect to these _keymap functions if something +// is unhandled. This allows me to keep most of my global preferences +// in one place while still allowing keyboard-specific code. + +// The idea was shamelessly copied from the amazing Drashna. + +// Nothing to do here, so I've commented it out. +// bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +// return true; +// } + +// void matrix_init_keymap(void) {}; + +void matrix_scan_keymap(void) { uint8_t layer = biton32(layer_state); // uint8_t default_layer = biton32(layer_state); ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); switch (layer) { - case _CO: + case L_COLEMAK: ergodox_right_led_1_on(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); break; - case _QW: + case L_NUM: + ergodox_right_led_1_on(); ergodox_right_led_2_on(); + ergodox_right_led_3_off(); break; - case _NU: + case L_EXTEND: + ergodox_right_led_1_on(); + ergodox_right_led_2_off(); ergodox_right_led_3_on(); break; - case _GA: + case L_FUNC: ergodox_right_led_1_on(); ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + case L_GAMING: + ergodox_right_led_1_off(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; default: // none break; diff --git a/layouts/community/ergodox/replicaJunction/readme.md b/layouts/community/ergodox/replicaJunction/readme.md index 8c4c03353a..9a1c09550a 100644 --- a/layouts/community/ergodox/replicaJunction/readme.md +++ b/layouts/community/ergodox/replicaJunction/readme.md @@ -1,5 +1,94 @@ # replicaJunction - Ergodox (EZ) Layout -I designed this layout, along with my complimentary Atreus layout, to address the challenge of having an Ergodox as my primary home keyboard and an Atreus as my primary work board. I wanted a layout that provided symbols in comfortable locations on both keyboards - but didn't require me to learn two separate sets of symbols for the two keyboards. +This keymap is designed to complement my Atreus keyboard layout, found in keyboards/atreus. The Atreus keyboard is a 40% board whose design was heavily influenced by the Ergodox. Since I use both keyboards, I've designed these layouts in an effort to make switching between the two as easy as possible. -I had originally used several keys as dual-role keys, where a tap would send a keypress and a long press and hold would trigger a different layer. However, after several months of experimenting with those ideas, I've begun moving away from that design due to performance. It's very hard to strike a balance between the time it takes to press a key normally while typing and the "delay" in the typing motion needed to trigger the alternate layer. I was frequently getting strange characters and artifacts because I pressed the function key + the symbol key too quickly, and the layer never shifted. \ No newline at end of file +I've also tried to make use of the extra keys on the Ergodox in as logical of a manner as possible, adding to the layers in the Atreus config without disturbing what's there already. This allows for things like F11-F20, the Application (Menu) key, and better media key placement. + +Because of this design philosophy, there are several cases where functionality is duplicated and keys are available in more than one place. I don't find that a bad thing. + +This layout makes heavy use of dual-role keys. Dual-role keys seemed to affect my typing speed for quite some time until I discovered the [`USE_PERMISSIVE_HOLD` flag](https://docs.qmk.fm/features/advanced-keycodes#permissive-hold). After applying this flag, I haven't had an issue with dual-role keys and typing quickly. + +The default letter layout in this keymap is [Colemak-ModDH](https://colemakmods.github.io/mod-dh/). I use the "matrix version" of that layout, which retains the M key on the home row as in normal Colemak. + +## Design Goals + +I designed this layout with the following goals in mind: + +* Atreus layout compatibility. +* Nothing may interfere with ordinary typing. +* Symbols need to be accessible quickly and organized in a manner I can remember. +* Limit more difficult finger movements (and pinky usage in general). +* Gaming should be easy. + +### Atreus layout compatibility + +Most of the functionality in this layout isn't strictly necessary - the Ergodox is a 76-key keyboard, and it's got plenty of room for extra keys and functionality compared to smaller boards like the Atreus. However, I've replicated a lot of 40% functionality on this layout in order to preserve my muscle memory. + +The biggest deviation is the Shift keys. My Atreus uses thumb keys for Shift, but the Ergodox doesn't have corresponding thumb keys in a comfortable enough location. I briefly tried using the outermost 1u keys in the bottom row as Shift keys, but they take a large enough thumb movement that it interfered with typing. + +### Nothing may interfere with ordinary typing + +For a long time, this meant that I couldn't use letters or home row keys as dual-role keys. I'm a fast typer, and I'm sometimes already typing the next letter before I've fully released the previous one. Normal keyboards don't care about this, but if I started adding dual-role functionality to letters, I found that I would sometimes type the next letter before releasing the layer toggle, and the letter I tried to send would still be sent under the layer I thought I'd left off. + +Fortunately, though, QMK has addressed this with the `PERMISSIVE_HOLD` flag. [Details are on the QMK docs page.](https://docs.qmk.fm/#/feature_advanced_keycodes?id=permissive-hold) + +Using that flag, I'm comfortable having layer shift keys on the home row, and this goes a long way to eliminate finger stress. + +### Sympols need to be accessible quickly + +Symbols are available under my left hand by holding the I key (on my right hand). I've grouped parenthesis, slashes, and braces together; the remaining symbols are ordered in the same way as they appear on USA keycap legends (for example, 1 is !, so that symbol is first in my lineup). Practically, I just had to get used to these other "misc" symbols. + +This also means that some symbols are accessible in more than one way. For example, the carats (greater than and less than) are available both in the "normal" location (Shift+Comma / Shift+Period) and on the symbol layer. I make regular changes to some of the symbols I don't use as commonly as I think of them. + +### Limit more difficult finger movements + +This is why I kept trying to put layer toggles on the home row keys instead of just placing them on random thumb keys. I suffer from RSI, and it's important for me to watch out for more "stressful" finger movements. + +The home row is the easiest row for your fingers to hit, followed by the upper row, and the lower row is noticeably more difficult to press. Because of this, I favored the upper row over the lower one any time I had the option to do so. + +### Gaming should be easy + +I've added a dedicated gaming layer accessible by pressing the upper-right key on the right hand (next to the 6 key). This layer disables most of the tap/hold functionality to allow keys to act normally. This layer also reverses Backspace and Space (so Space is available on the left thumb while the right hand is on the mouse). + +I've also added a lock key on the right hand's bottom 1.5u key and mouse keys on the right thumb cluster. This has been amazingly helpful for games that involve holding keys for extended times (for example, I can hold the left mouse button in Minecraft to continually mine). + +I strongly recommend using ESDF (QWERTY positions) for movement on the Ergodox rather than WASD. This makes the thumb keys much more accessible. + +Finally, I considered having the gaming layer revert to a QWERTY layout, but decided against it because it really threw me off when I needed to type in chat. I've accepted that I will need to rebind keys in most games as a reasonable compromise. + +## Features + +### ZXC Mods + +Keys on the bottom row of each half of this keyboard can be held to send modifier keys. I've tried to map this in a relatively logical manner: + +* Z / Slash: Ctrl +* X / Period: GUI +* C / Comma: Ctrl+Alt +* D / H: Alt + +This is an example of maintaining compatibility with the Atreus layout. An Ergodox doesn't really need these keys, but I've grown accustomed to them on the Atreus, so they're copied here to preserve compatibility. + +### Layer Switching - Tap Dance + +The lower-left key on the left hand can be used to apply or remove layers based on a number of taps: + +* 1 tap sends Escape, and also disables any persistent layers. +* 2 taps enables the Number pad layer. +* 3 taps enables the QWERTY layer. +* 5 or more taps resets the keyboard. + +## Extend Layer + +[Originally found on the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/), having a QMK-powered keyboard allows a super easy implementation of this concept. The idea is to place commonly-used keys under easy reach of your hands. Since I work with text often, my most common needs are things like Ctrl+Shift+arrow keys, and they're easy to access using this layer. (While technically it's four keypresses instead of just three, since it takes one key to enter the layer, that one key is a thumb button and the other three are all on the home row, so I find it much more comfortable than modifiers on a traditional keyboard.) + +Also featured in this layer is easy access to Tab, plus a Shift+Tab key. Alt-Tabbing back and forth, along with Ctrl-Tab, are super easy and friendly. When I need Ctrl+Alt+Delete, I typically use the ones found on this layer. + +## Credits + +* [Drashna](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/readme.md) + * User / keymap function ideas +* [Jeremy](https://github.com/qmk/qmk_firmware/blob/master/keyboards/atreus/keymaps/jeremy/readme.md) + * Sanity check on the Function keys (_of course they should be in rows of 4, not rows of 3 like a number pad. Why did I ever use anything else?_) +* [DreymaR of the Colemak forums](https://forum.colemak.com/topic/2014-extend-extra-extreme/) + * Original idea of the Extend layer diff --git a/layouts/community/ergodox/replicaJunction/rules.mk b/layouts/community/ergodox/replicaJunction/rules.mk new file mode 100644 index 0000000000..8a719766cd --- /dev/null +++ b/layouts/community/ergodox/replicaJunction/rules.mk @@ -0,0 +1,8 @@ +# https://docs.qmk.fm/getting_started_make_guide.html + +MOUSEKEY_ENABLE = yes +TAP_DANCE_ENABLE = yes +KEY_LOCK_ENABLE = yes +RGBLIGHT_ENABLE = no +# CONSOLE_ENABLE = no +# COMMAND_ENABLE = no diff --git a/users/replicaJunction/config.h b/users/replicaJunction/config.h new file mode 100644 index 0000000000..f3556c87ed --- /dev/null +++ b/users/replicaJunction/config.h @@ -0,0 +1,72 @@ +#pragma once + + +//////////////////////////////////////////////////////////////////////////////// +// Features That Can Be Enabled +// https://docs.qmk.fm/reference/config-options#features-that-can-be-enabled +//////////////////////////////////////////////////////////////////////////////// + +// Prevent modifiers from sticking when switching layers +// Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers +#define PREVENT_STUCK_MODIFIERS + + + +//////////////////////////////////////////////////////////////////////////////// +// Behaviors That Can Be Configured +// https://docs.qmk.fm/reference/config-options#behaviors-that-can-be-configured +//////////////////////////////////////////////////////////////////////////////// + +// MS the button needs to be held before a tap becomes a hold (default: 200) +#undef TAPPING_TERM +#define TAPPING_TERM 250 + +// Makes it easier for fast typists to use dual-role keys. See additional details here: +// https://docs.qmk.fm/features/advanced-keycodes#permissive-hold +#define PERMISSIVE_HOLD + +// MS after tapping the Leader key to listen for a sequence (default: 300) +#undef LEADER_TIMEOUT +#define LEADER_TIMEOUT 750 + +// This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold +// (for example, if z becomes ctrl when you hold it, when this option isn't enabled, z rapidly +// followed by x actually sends Ctrl-x. That's bad.) +#define IGNORE_MOD_TAP_INTERRUPT + + + +//////////////////////////////////////////////////////////////////////////////// +// Mouse Key Options +// https://docs.qmk.fm/reference/config-options#mouse-key-options +//////////////////////////////////////////////////////////////////////////////// + +#ifdef MOUSEKEY_ENABLE +// Mouse key config + +// Frequency with which cursor movements are sent. Lower means more resolution / DPI. +// Default: 20 +// #undef MOUSEKEY_INTERVAL +// #define MOUSEKEY_INTERVAL 20 + +// MS after pressing the key before initial movement begins. Lower means quicker response. +// Default: 0 +// #undef MOUSEKEY_DELAY +// #define MOUSEKEY_DELAY 0 + +// MS it takes the cursor to accelerate to max speed +// Default: 60 +// #undef MOUSEKEY_TIME_TO_MAX +// #define MOUSEKEY_TIME_TO_MAX 60 + +// Maximum speed for the mouse keys +// Default: 7 +// #undef MOUSEKEY_MAX_SPEED +// #define MOUSEKEY_MAX_SPEED 7 + +// Delay before the mouse wheel +// Default: 0 +// #undef MOUSEKEY_WHEEL_DELAY +// #define MOUSEKEY_WHEEL_DELAY 0 + +#endif // MOUSEKEY_ENABLE diff --git a/users/replicaJunction/readme.md b/users/replicaJunction/readme.md new file mode 100644 index 0000000000..2a9cad2729 --- /dev/null +++ b/users/replicaJunction/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 @ + +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 . \ No newline at end of file diff --git a/users/replicaJunction/replicaJunction.c b/users/replicaJunction/replicaJunction.c new file mode 100644 index 0000000000..f0bc59d257 --- /dev/null +++ b/users/replicaJunction/replicaJunction.c @@ -0,0 +1,149 @@ +#include "replicaJunction.h" +#include "version.h" + +#ifdef TAP_DANCE_ENABLE +void dance_layer(qk_tap_dance_state_t *state, void *user_data) +{ + uint8_t layer = biton32(layer_state); + + if (state->count >= 5) + { + // 5 or more taps resets the keyboard + reset_keyboard(); + } + #ifdef L_QWERTY + else if (state->count == 3) + { + // Triple tap changes to QWERTY layer + if (layer == L_QWERTY) + { + layer_off(L_QWERTY); + } + else + { + layer_on(L_QWERTY); + } + } + #endif + #ifdef L_NUM + else if (state->count == 2) + { + // Double tap toggles Number layer + if (layer == L_NUM) + { + layer_off(L_NUM); + } + else + { + layer_on(L_NUM); + } + } + #endif + else + { + // Single tap sends Escape, and also turns off layers + // That's mostly in case I get stuck and forget where I am + #ifdef L_NUM + layer_off(L_NUM); + #endif + #ifdef L_EXTEND + layer_off(L_EXTEND); + #endif + #ifdef L_SYMBOL + layer_off(L_SYMBOL); + #endif + #ifdef L_QWERTY + layer_off(L_QWERTY); + #endif + register_code(KC_ESC); + unregister_code(KC_ESC); + } +}; + +// Tap Dance Definitions +// Note - this needs to come AFTER the function is declared +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LAYER_TOGGLE] = ACTION_TAP_DANCE_FN(dance_layer) +}; + +#endif // TAP_DANCE_ENABLE + +// These functions can be overridden in individual keymap files. +// This allows a user function to be shared for all my keyboards, while each +// keyboard can also have a keyboard-specific section. + +// Note that keymaps don't need to override these if there's nothing to +// override them with. +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + #ifdef UNICODEMAP_ENABLE + // Set Unicode input to use WinCompose + // https://github.com/samhocevar/wincompose + set_unicode_input_mode(UC_WINC); + #endif // UNICODEMAP_ENABLE + + matrix_init_keymap(); +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + matrix_scan_keymap(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) + return true; + + switch(keycode) + { + case RJ_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu" + #elif defined(BOOTLOADER_HALFKAY) + ":teensy" + #elif defined(BOOTLOADER_CATERINA) + ":avrdude" + #endif // bootloader options + //SS_TAP(X_ENTER) + ); + return false; + case RJ_QMKV: + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + return false; + case RJ_EQ: + SEND_STRING("=="); + return false; + case RJ_NEQ: + SEND_STRING("!="); + return false; + case RJ_GEQ: + SEND_STRING(">="); + return false; + case RJ_LEQ: + SEND_STRING("<="); + return false; + case RJ_GEQR: + SEND_STRING("=>"); + return false; + case RJ_DUND: + SEND_STRING("$_"); + return false; + case RJ_SELS: + SEND_STRING("select *"); + return false; + } + + return process_record_keymap(keycode, record); +}; diff --git a/users/replicaJunction/replicaJunction.h b/users/replicaJunction/replicaJunction.h new file mode 100644 index 0000000000..ab0e8ab3e3 --- /dev/null +++ b/users/replicaJunction/replicaJunction.h @@ -0,0 +1,115 @@ +#pragma once + +#include "quantum.h" + +/////////////////////////////////////////////////////////////////////////////// +// Keymap definitions +/////////////////////////////////////////////////////////////////////////////// + +// Layer definitions +// #define L_COLEMAK 0 +// #define L_QWERTY 1 +// #define L_NUM 2 +// #define L_EXTEND 3 +// #define L_FUNC 4 +// #define L_GAMING 5 +// #define L_SYMBOL 6 +// #define L_LL_R 7 +// #define L_LL_S 8 +// #define L_LL_E 9 +// #define L_LL_I 10 + +// Keyboard aliases +#define _______ KC_TRNS +#define ooooooo KC_TRNS + +#define MO_FUNC MO(L_FUNC) +#define TT_NUM TT(L_NUM) +#define TG_GAME TG(L_GAMING) +#define OSL_SYM OSL(L_SYMBOL) + +#define OSM_LSF OSM(MOD_LSFT) +#define OSM_RSF OSM(MOD_RSFT) + +#define KX_CTSF LCTL(KC_LSFT) +#define KX_STAB LSFT(KC_TAB) +#define KX_CGR LCTL(KC_GRV) +#define KX_PAST LCTL(LGUI(LALT(KC_V))) +#define KX_SRCH LCTL(LGUI(LALT(KC_S))) + +#define KX_BKNM LT(L_NUM, KC_BSPC) +#define KX_DCTL CTL_T(KC_DEL) +#define KX_NALT ALT_T(KC_ENT) +#define KX_ECTL CTL_T(KC_ESC) +#define KX_SPAC LT(L_EXTEND, KC_SPC) + +#define KX_Z_MT CTL_T(KC_Z) +#define KX_X_MT GUI_T(KC_X) +#define KX_C_MT MT(MOD_LCTL | MOD_LALT, KC_C) +#define KX_D_MT ALT_T(KC_D) + +#define KX_SLMT CTL_T(KC_SLSH) +#define KX_DOMT GUI_T(KC_DOT) +#define KX_COMT MT(MOD_LCTL | MOD_LALT, KC_COMM) +#define KX_H_MT ALT_T(KC_H) + +#ifdef L_LL_R + #define KC_R_LT LT(L_LL_R, KC_R) +#else + #define KC_R_LT KC_R +#endif + +#ifdef L_LL_S + #define KC_S_LT LT(L_LL_S, KC_S) +#else + #define KC_S_LT KC_S +#endif + +#ifdef L_LL_E + #define KC_E_LT LT(L_LL_E, KC_E) +#else + #define KC_E_LT KC_E +#endif + +#ifdef L_LL_I + #define KC_I_LT LT(L_LL_I, KC_I) +#else + #define KC_I_LT KC_I +#endif + +// "Macro" functions +enum userspace_custom_keycodes { + RJ_MAKE = SAFE_RANGE, // QMK make command + RJ_QMKV, // QMK version + RJ_EQ, // == + RJ_NEQ, // != + RJ_GEQ, // >= + RJ_LEQ, // <= + RJ_GEQR, // => ("greater than or equal - right") + RJ_DUND, // $_ + RJ_SELS, // select * (used for PowerShell) + RJ_MUTE, // Discord mute (GUI+Shift+M) + RJ_DEAF, // Discord deafen (GUI+Shift+D) + RJ_DOVR // Toggle Discord overlay (GUI+Shift+O) +}; + +// Mouse keys +#define M_UP KC_MS_UP +#define M_DOWN KC_MS_DOWN +#define M_LEFT KC_MS_LEFT +#define M_RIGHT KC_MS_RIGHT +#define M_LCLIK KC_MS_BTN1 +#define M_RCLIK KC_MS_BTN2 +#define M_MCLIK KC_MS_BTN3 +#define M_WHLUP KC_WH_U +#define M_WHLDN KC_WH_D + +// Used in macro definitions +#define TAP(code) register_code (code); unregister_code (code); + +// Tap Dance +#ifdef TAP_DANCE_ENABLE +#define TD_LAYER_TOGGLE 0 +extern void dance_layer(qk_tap_dance_state_t *state, void *user_data); +#define TD_LAYR TD(TD_LAYER_TOGGLE) +#endif // TAP_DANCE_ENABLE diff --git a/users/replicaJunction/rules.mk b/users/replicaJunction/rules.mk new file mode 100644 index 0000000000..30a330195d --- /dev/null +++ b/users/replicaJunction/rules.mk @@ -0,0 +1 @@ +SRC += replicaJunction.c -- cgit v1.2.3 From 9eab1667b070e8310dd0585eaf06cc78570d75ea Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 16 Aug 2018 08:31:52 -0700 Subject: Keyboard: Update AL1 default keycaps to new QMK standards (#3675) * update keymaps to not use KC_FNX anymore * add a reset key as the al1 has no hardware reset --- keyboards/al1/keymaps/default/keymap.c | 14 +++++--------- keyboards/al1/keymaps/splitbs/keymap.c | 10 +++++----- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/keyboards/al1/keymaps/default/keymap.c b/keyboards/al1/keymaps/default/keymap.c index a4d62191cd..5da3b5a7b2 100644 --- a/keyboards/al1/keymaps/default/keymap.c +++ b/keyboards/al1/keymaps/default/keymap.c @@ -20,22 +20,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, 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_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_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FN0, KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT ), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT ), [1] = 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_BSPC, KC_INS, 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_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ + KC_TAB, KC_Q, KC_W, KC_E, RESET, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FN0, KC_RGUI, KC_RCTRL, KC_FN1, KC_FN2, KC_FN3, KC_P0, KC_PDOT ), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_TRNS, KC_RGUI, KC_RCTRL, BL_TOGG, BL_DEC, BL_INC, KC_P0, KC_PDOT ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function diff --git a/keyboards/al1/keymaps/splitbs/keymap.c b/keyboards/al1/keymaps/splitbs/keymap.c index 1d752aef57..095c9b9785 100644 --- a/keyboards/al1/keymaps/splitbs/keymap.c +++ b/keyboards/al1/keymaps/splitbs/keymap.c @@ -5,14 +5,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, 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_GRAVE, KC_BSPC, KC_INS, 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_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FN0, KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT ), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, MO(1), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RGUI, KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT ), [1] = LAYOUT_split_bs(\ 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_GRAVE, KC_DELETE, KC_INS, 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_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ + KC_TAB, KC_Q, KC_W, KC_E, RESET, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, KC_DELETE, KC_P7, KC_P8, KC_P9, KC_PPLS,\ 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FN0, KC_RGUI, KC_RCTRL, KC_FN1, KC_FN2, KC_FN3, KC_P0, KC_PDOT ), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_TRNS, KC_RGUI, KC_RCTRL, BL_TOGG, BL_DEC, BL_INC, KC_P0, KC_PDOT ), }; const uint16_t PROGMEM fn_actions[] = { -- cgit v1.2.3 From a828d49f8c6e0cce16727b596ed141f173c03495 Mon Sep 17 00:00:00 2001 From: Brad Date: Thu, 16 Aug 2018 10:33:02 -0500 Subject: Keymap: Adding broswen keymap for iris split keyboard. (#3654) * Adding broswen keymap for iris split keyboard. * added changes as requested by drashna * formatting --- keyboards/iris/keymaps/broswen/config.h | 52 +++++++++++++ keyboards/iris/keymaps/broswen/keymap.c | 126 ++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/broswen/rules.mk | 8 ++ 3 files changed, 186 insertions(+) create mode 100644 keyboards/iris/keymaps/broswen/config.h create mode 100644 keyboards/iris/keymaps/broswen/keymap.c create mode 100644 keyboards/iris/keymaps/broswen/rules.mk diff --git a/keyboards/iris/keymaps/broswen/config.h b/keyboards/iris/keymaps/broswen/config.h new file mode 100644 index 0000000000..19c47780db --- /dev/null +++ b/keyboards/iris/keymaps/broswen/config.h @@ -0,0 +1,52 @@ +/* + +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 +/* 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 5 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define C6_AUDIO + +#define NO_MUSIC_MODE + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(NO_SOUND) +#endif + + +#if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE) +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#define DISABLE_LEADER diff --git a/keyboards/iris/keymaps/broswen/keymap.c b/keyboards/iris/keymaps/broswen/keymap.c new file mode 100644 index 0000000000..7453a9eef9 --- /dev/null +++ b/keyboards/iris/keymaps/broswen/keymap.c @@ -0,0 +1,126 @@ +#include QMK_KEYBOARD_H + + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +#define KC_ KC_TRNS +#define _______ KC_TRNS + +#define KC_LOWR LOWER +#define KC_RASE RAISE +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , DEL, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + 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 ,LBRC, RBRC , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + LALT,LGUI,SPC, ENT ,LOWR,RASE + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,TILD,PIPE,MINS,PLUS, , LEFT,DOWN, UP ,RGHT, , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , GRV,BSLS,UNDS, EQL, , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + , , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + AU_TOG, CK_UP, CK_DOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + RESET , DEBUG , RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------. ,--------|--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //`--------+--------+--------+----+---+--------+--------+--------/ \--------+--------+--------+---+----+--------+--------+--------' + _______, _______, _______, _______, _______, _______ + // `--------+--------+--------' `--------+--------+--------' + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // case QWERTY: + // if (record->event.pressed) { + // persistent_default_layer_set(1UL<<_QWERTY); + // } + // return false; + // break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/broswen/rules.mk b/keyboards/iris/keymaps/broswen/rules.mk new file mode 100644 index 0000000000..14fa112898 --- /dev/null +++ b/keyboards/iris/keymaps/broswen/rules.mk @@ -0,0 +1,8 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no +MOUSEKEY_ENABLE = no +MIDI_ENABLE = no +BLUETOOTH_ENABLE = no +COMMAND_ENABLE = no +TERMINAL_ENABLE = no +AUDIO_ENABLE = yes -- cgit v1.2.3 From 303ca46e77965700de40b0b1d1b41284b2ff7811 Mon Sep 17 00:00:00 2001 From: Takuya Urakawa Date: Fri, 17 Aug 2018 00:36:35 +0900 Subject: Keyboard: add ergoinu keyboard (#3655) * add ergoinu * remove unnecessary code * replace include guard delete unused code * remove unused RGBLED defines --- keyboards/ergoinu/config.h | 116 ++++++++++ keyboards/ergoinu/ergoinu.c | 5 + keyboards/ergoinu/ergoinu.h | 44 ++++ keyboards/ergoinu/info.json | 20 ++ keyboards/ergoinu/keymaps/default/config.h | 24 ++ keyboards/ergoinu/keymaps/default/keymap.c | 101 +++++++++ keyboards/ergoinu/keymaps/default/rules.mk | 29 +++ keyboards/ergoinu/keymaps/default_jis/config.h | 24 ++ keyboards/ergoinu/keymaps/default_jis/keymap.c | 101 +++++++++ keyboards/ergoinu/keymaps/default_jis/rules.mk | 29 +++ keyboards/ergoinu/matrix.c | 303 +++++++++++++++++++++++++ keyboards/ergoinu/readme.md | 21 ++ keyboards/ergoinu/rules.mk | 84 +++++++ keyboards/ergoinu/serial.c | 295 ++++++++++++++++++++++++ keyboards/ergoinu/serial.h | 24 ++ keyboards/ergoinu/serial_config.h | 11 + keyboards/ergoinu/split_util.c | 56 +++++ keyboards/ergoinu/split_util.h | 12 + 18 files changed, 1299 insertions(+) create mode 100644 keyboards/ergoinu/config.h create mode 100644 keyboards/ergoinu/ergoinu.c create mode 100644 keyboards/ergoinu/ergoinu.h create mode 100644 keyboards/ergoinu/info.json create mode 100644 keyboards/ergoinu/keymaps/default/config.h create mode 100644 keyboards/ergoinu/keymaps/default/keymap.c create mode 100644 keyboards/ergoinu/keymaps/default/rules.mk create mode 100644 keyboards/ergoinu/keymaps/default_jis/config.h create mode 100644 keyboards/ergoinu/keymaps/default_jis/keymap.c create mode 100644 keyboards/ergoinu/keymaps/default_jis/rules.mk create mode 100644 keyboards/ergoinu/matrix.c create mode 100644 keyboards/ergoinu/readme.md create mode 100644 keyboards/ergoinu/rules.mk create mode 100644 keyboards/ergoinu/serial.c create mode 100644 keyboards/ergoinu/serial.h create mode 100644 keyboards/ergoinu/serial_config.h create mode 100644 keyboards/ergoinu/split_util.c create mode 100644 keyboards/ergoinu/split_util.h diff --git a/keyboards/ergoinu/config.h b/keyboards/ergoinu/config.h new file mode 100644 index 0000000000..4b7c584005 --- /dev/null +++ b/keyboards/ergoinu/config.h @@ -0,0 +1,116 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Takuya Urakawa + +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 + +#include "config_common.h" +#include + +/* USB Device descriptor parameter + VID & PID are lisenced from microchip sublisence program, Don't use other project! */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEE60 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Dm9Records +#define PRODUCT ergoinu +#define DESCRIPTION An (Not Portable But Small) Ergonomic split keyboard + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_ROW_PINS { F6, F7, B1, B3, B2 } + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, F5, F4 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B6 + +#define RGBLED_NUM 7 + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 7 + #define RGBLIGHT_LIMIT_VAL 255 + #define RGBLIGHT_VAL_STEP 17 + #endif +#else + #define RGBLIGHT_LIMIT_VAL 90 + #define RGBLIGHT_VAL_STEP 4 +#endif + +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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/ergoinu/ergoinu.c b/keyboards/ergoinu/ergoinu.c new file mode 100644 index 0000000000..b43ab17c8b --- /dev/null +++ b/keyboards/ergoinu/ergoinu.c @@ -0,0 +1,5 @@ +#include "ergoinu.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; diff --git a/keyboards/ergoinu/ergoinu.h b/keyboards/ergoinu/ergoinu.h new file mode 100644 index 0000000000..43249a8440 --- /dev/null +++ b/keyboards/ergoinu/ergoinu.h @@ -0,0 +1,44 @@ +/* +Copyright 2018 Takuya Urakawa + +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 + +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +#include "ws2812.h" +#endif + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L07, L08, L09, L10, L11, L12, L13, R07, R08, R09, R10, R11, R12, R13, \ + L14, L15, L16, L17, L18, L19, R14, R15, R16, R17, R18, R19, R20, \ + L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26, R27,\ + L26, L27, L28, L29, L30, R28, R29, R30, R31, R32 \ + ) { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L07, L08, L09, L10, L11, L12, L13 }, \ + { L14, KC_NO, L15, L16, L17, L18, L19 }, \ + { L20, KC_NO, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, L26, L27, L28, L29, L30}, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R13, R12, R11, R10, R09, R08, R07 }, \ + { R20, R19, R18, R17, R16, R15, R14 }, \ + { R27, R26, R25, R24, R23, R22, R21 }, \ + { KC_NO, KC_NO, R32, R31, R30, R29, R28 } \ + } + diff --git a/keyboards/ergoinu/info.json b/keyboards/ergoinu/info.json new file mode 100644 index 0000000000..f85447913c --- /dev/null +++ b/keyboards/ergoinu/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "Ergoinu", + "url": "", + "maintainer": "hsgw", + "width": 17, + "height": 6.75, + "layouts": { + "LAYOUT": { + "key_count": 64, + "layout": [ + {"x": 0, "y": 0.6}, {"x": 1, "y": 0.4}, {"x": 2, "y": 0.4}, {"x": 3, "y": 0.25}, {"x": 4, "y": 0}, {"x": 5, "y": 0.25}, {"x": 6, "y": 0.4}, {"x": 10, "y": 0.4}, {"x": 11, "y": 0.25}, {"x": 12, "y": 0}, {"x": 13, "y": 0.25}, {"x": 14, "y": 0.4}, {"x": 15, "y": 0.4}, {"x": 16, "y": 0.6}, + {"x": 0, "y": 1.6}, {"x": 1, "y": 1.4}, {"x": 2, "y": 1.4}, {"x": 3, "y": 1.25}, {"x": 4, "y": 1}, {"x": 5, "y": 1.25}, {"x": 6, "y": 1.4}, {"x": 10, "y": 1.4}, {"x": 11, "y": 1.25}, {"x": 12, "y": 1}, {"x": 13, "y": 1.25}, {"x": 14, "y": 1.4}, {"x": 15, "y": 1.4}, {"x": 16, "y": 1.6}, + {"x": 0.25, "y": 2.6, "W":1.75}, {"x": 2, "y": 2.4}, {"x": 3, "y": 2.25}, {"x": 4, "y": 2}, {"x": 5, "y": 2.25}, {"x": 6, "y": 2.4}, {"x": 10, "y": 2.4}, {"x": 11, "y": 2.25}, {"x": 12, "y": 2}, {"x": 13, "y": 2.25}, {"x": 14, "y": 2.4}, {"x": 15, "y": 2.4}, {"x": 16, "y": 2.6}, + {"x": 0.25, "y": 3.6, "W":1.75}, {"x": 2, "y": 3.4}, {"x": 3, "y": 3.25}, {"x": 4, "y": 3}, {"x": 5, "y": 3.25}, {"x": 6, "y": 3.4}, {"x": 10, "y": 3.4}, {"x": 11, "y": 3.25}, {"x": 12, "y": 3}, {"x": 13, "y": 3.25}, {"x": 14, "y": 3.4}, {"x": 15, "y": 3.4}, {"x": 16, "y": 3.6}, + {"x": 3, "y": 4.25}, {"x": 4, "y": 4}, {"x": 5, "y": 4.25}, {"x": 6, "y": 4.4}, {"X":7.5, "Y":4.4, "H":1.25,"R":30, "RX":6, "RY":4.4}, + {"X":8.25, "Y":4.4, "H":1.25,"R":-30, "RX":11, "RY":4.4}, {"x": 10, "y": 4.4}, {"x": 11, "y": 4.25}, {"x": 12, "y": 4}, {"x": 13, "y": 4.4} + ] + } + } +} diff --git a/keyboards/ergoinu/keymaps/default/config.h b/keyboards/ergoinu/keymaps/default/config.h new file mode 100644 index 0000000000..bb266f25e7 --- /dev/null +++ b/keyboards/ergoinu/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Takuya Urakawa + +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 + +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/ergoinu/keymaps/default/keymap.c b/keyboards/ergoinu/keymaps/default/keymap.c new file mode 100644 index 0000000000..7f1be4796c --- /dev/null +++ b/keyboards/ergoinu/keymaps/default/keymap.c @@ -0,0 +1,101 @@ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define JA_CLON KC_QUOT // : and + +#define JA_AT KC_LBRC // @ and ` +#define JA_HAT KC_EQL // ^ and ~ +#define JA_ENUN KC_RO // \ and _ (EN mark and UNder score) +#define JA_ENVL KC_JYEN // \ and | (EN mark and Vertical Line) +#define JA_LBRC KC_RBRC // [ and { +#define JA_RBRC KC_BSLS // ] and } + +enum LAYER_NO { + BASE = 0, + META, + CONF +}; + +enum CUSTOM_KEYCODES { + RGB_RST = SAFE_RANGE, + RGB_TYPE, +}; + +// Fillers to make layering more clear +#define ______ KC_TRNS +#define XXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT( \ + KC_ESC, 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_BSLS, \ + KC_DEL, 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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_GRV, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, \ + MO(META),KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, KC_RALT, MO(META) \ + ), + + [META] = LAYOUT( \ + MO(CONF),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_INS, \ + ______, KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ \ + ), + [CONF] = LAYOUT( \ + ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX \ + ) +}; + +bool enableLEDTypeAnime = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case RGB_RST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + enableLEDTypeAnime = false; + rgblight_step(); + } + #endif + return false; + case RGB_TYPE: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + enableLEDTypeAnime = !enableLEDTypeAnime; + } + #endif + return false; + default: + break; + } + #ifdef RGBLIGHT_ENABLE + if(enableLEDTypeAnime) { + rgblight_mode_noeeprom(1); + uint16_t hue = (rgblight_config.hue + 5) % 360; + rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val); + } + #endif + + return true; +} + +void matrix_init_user(void) { +} diff --git a/keyboards/ergoinu/keymaps/default/rules.mk b/keyboards/ergoinu/keymaps/default/rules.mk new file mode 100644 index 0000000000..7d7a475d17 --- /dev/null +++ b/keyboards/ergoinu/keymaps/default/rules.mk @@ -0,0 +1,29 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# ergoinu configs +DISABLE_PROMICRO_LEDs = yes + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/ergoinu/keymaps/default_jis/config.h b/keyboards/ergoinu/keymaps/default_jis/config.h new file mode 100644 index 0000000000..bb266f25e7 --- /dev/null +++ b/keyboards/ergoinu/keymaps/default_jis/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 Takuya Urakawa + +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 + +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/ergoinu/keymaps/default_jis/keymap.c b/keyboards/ergoinu/keymaps/default_jis/keymap.c new file mode 100644 index 0000000000..3a1a88f47c --- /dev/null +++ b/keyboards/ergoinu/keymaps/default_jis/keymap.c @@ -0,0 +1,101 @@ +#include QMK_KEYBOARD_H + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +#define JA_CLON KC_QUOT // : and + +#define JA_AT KC_LBRC // @ and ` +#define JA_HAT KC_EQL // ^ and ~ +#define JA_ENUN KC_RO // \ and _ (EN mark and UNder score) +#define JA_ENVL KC_JYEN // \ and | (EN mark and Vertical Line) +#define JA_LBRC KC_RBRC // [ and { +#define JA_RBRC KC_BSLS // ] and } + +enum LAYER_NO { + BASE = 0, + META, + CONF +}; + +enum CUSTOM_KEYCODES { + RGB_RST = SAFE_RANGE, + RGB_TYPE, +}; + +// Fillers to make layering more clear +#define ______ KC_TRNS +#define XXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, JA_HAT, KC_JYEN, \ + KC_DEL, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JA_AT, JA_LBRC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JA_CLON, JA_RBRC, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RO, KC_RSFT, \ + MO(META),KC_LALT, KC_ZKHK, KC_BSPC, KC_SPC, KC_ENT, KC_BSPC, KC_MHEN, KC_KANA, MO(META) \ + ), + + + [META] = LAYOUT( \ + MO(CONF),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_INS, \ + ______, KC_CAPS, ______, KC_UP, ______, ______, ______, ______, ______, ______, KC_SLCK, KC_PSCR, KC_HOME, KC_END, \ + ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, KC_PAUS, KC_PGUP, KC_UP, KC_PGDN, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RGHT, \ + ______, ______, KC_RGUI, KC_DEL, KC_ENT, ______, KC_DEL, KC_HENK, KC_LGUI, ______ \ + ), + [CONF] = LAYOUT( \ + ______, RGB_TYPE,RGB_MOD, RGB_VAI, RGB_HUI, RGB_HUI, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + RGB_RST, RGB_TOG, RGB_RMOD, RGB_VAD, RGB_HUD, RGB_HUD, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX \ + ) +}; + +bool enableLEDTypeAnime = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case RGB_RST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + enableLEDTypeAnime = false; + rgblight_step(); + } + #endif + return false; + case RGB_TYPE: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + enableLEDTypeAnime = !enableLEDTypeAnime; + } + #endif + return false; + default: + break; + } + #ifdef RGBLIGHT_ENABLE + if(enableLEDTypeAnime) { + rgblight_mode_noeeprom(1); + uint16_t hue = (rgblight_config.hue + 5) % 360; + rgblight_sethsv_noeeprom(hue, rgblight_config.sat, rgblight_config.val); + } + #endif + return true; +} + +void matrix_init_user(void) { +} diff --git a/keyboards/ergoinu/keymaps/default_jis/rules.mk b/keyboards/ergoinu/keymaps/default_jis/rules.mk new file mode 100644 index 0000000000..7d7a475d17 --- /dev/null +++ b/keyboards/ergoinu/keymaps/default_jis/rules.mk @@ -0,0 +1,29 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# ergoinu configs +DISABLE_PROMICRO_LEDs = yes + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/ergoinu/matrix.c b/keyboards/ergoinu/matrix.c new file mode 100644 index 0000000000..92c95e335e --- /dev/null +++ b/keyboards/ergoinu/matrix.c @@ -0,0 +1,303 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" + +#include "serial.h" + +// from pro_micro.h +#define TX_RX_LED_INIT DDRD |= (1<<5), DDRB |= (1<<0) + +#ifndef DISABLE_PROMICRO_LEDs + #define TXLED0 PORTD |= (1<<5) + #define TXLED1 PORTD &= ~(1<<5) + #define RXLED0 PORTB |= (1<<0) + #define RXLED1 PORTB &= ~(1<<0) +#else + #define TXLED0 + #define TXLED1 + #define RXLED0 + #define RXLED1 +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + #ifdef DISABLE_PROMICRO_LEDs + PORTD |= (1<<5); + PORTB |= (1<<0); + #endif + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) { + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int ret=serial_update_buffers(); + if (ret ) { + if(ret==2)RXLED1; + return 1; + } +RXLED0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} + +uint8_t matrix_scan(void) { + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + +// if(serial_slave_DATA_CORRUPT()){ +// TXLED0; + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + +// }else{ +// TXLED1; +// } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } + + if( serial_transaction() ) { + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/ergoinu/readme.md b/keyboards/ergoinu/readme.md new file mode 100644 index 0000000000..a0d1c18a24 --- /dev/null +++ b/keyboards/ergoinu/readme.md @@ -0,0 +1,21 @@ +ErgoInu +=== + +![ergoinu](https://i.imgur.com/4CCM8Vl.jpg) + +An (Not Portable But Small) Ergonomic Split Keyboard. + +Keyboard Maintainer: [hsgw](https://github.com/hsgw/) [twitter](https://twitter.com/hsgw) +Hardware Supported: Pro Micro +Hardware Availability & Repository: [https://github.com/hsgw/ergoinu](https://github.com/hsgw/ergoinu) + +Make example for this keyboard (after setting up your build environment): + + make ergoinu:default + + (or) + + make ergoinu:default_jis + + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/ergoinu/rules.mk b/keyboards/ergoinu/rules.mk new file mode 100644 index 0000000000..a00cc16de2 --- /dev/null +++ b/keyboards/ergoinu/rules.mk @@ -0,0 +1,84 @@ +SRC += matrix.c serial.c split_util.c + +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SUBPROJECT_rev1 = no +USE_I2C = no # i2c is not supported +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = ergoinu + +# ergoinu configs +DISABLE_PROMICRO_LEDs = yes + +ifneq ($(strip $(ERGOINU)),) + ifeq ($(findstring promicroled, $(ERGOINU)), promicroled) + DISABLE_PROMICRO_LEDs = no + endif +endif + +ifeq ($(strip $(DISABLE_PROMICRO_LEDs)), yes) + OPT_DEFS += -DDISABLE_PROMICRO_LEDs +endif diff --git a/keyboards/ergoinu/serial.c b/keyboards/ergoinu/serial.c new file mode 100644 index 0000000000..5919415877 --- /dev/null +++ b/keyboards/ergoinu/serial.c @@ -0,0 +1,295 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifdef USE_SERIAL + +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 23 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#else +#error Illegal Serial Speed +#endif + + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH 1 +#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input_with_pullup(); + +#if SERIAL_PIN_MASK == _BV(PD0) + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#elif SERIAL_PIN_MASK == _BV(PD2) + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#else + #error unknown SERIAL_PIN_MASK value +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static +void sync_recv(void) { + for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + _delay_sub_us(READ_WRITE_START_ADJUST); + for ( uint8_t i = 0; i < 8; ++i) { + serial_delay_half1(); // read the middle of pulses + byte = (byte << 1) | serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 1<<7; + while( b ) { + if(data & b) { + serial_high(); + } else { + serial_low(); + } + b >>= 1; + serial_delay(); + } + serial_low(); // sync_send() / senc_recv() need raise edge +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + serial_output(); + + // slave send phase + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_slave_buffer[i]); + checksum += serial_slave_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // slave switch to input + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 + + // slave recive phase + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_master_buffer[i] = serial_read_byte(); + checksum_computed += serial_master_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } + + sync_recv(); //weit master output to high +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH); + + // wait for the slaves response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + sei(); + return 1; + } + + // master recive phase + // if the slave is present syncronize with it + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_slave_buffer[i] = serial_read_byte(); + checksum_computed += serial_slave_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if (checksum_computed != checksum_received) { + serial_output(); + serial_high(); + sei(); + return 2; + } + + // master switch to output + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); // 3 + serial_delay_half1(); //4 + + // master send phase + uint8_t checksum = 0; + + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_master_buffer[i]); + checksum += serial_master_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // always, release the line when not in use + sync_send(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/ergoinu/serial.h b/keyboards/ergoinu/serial.h new file mode 100644 index 0000000000..67cf06ac6b --- /dev/null +++ b/keyboards/ergoinu/serial.h @@ -0,0 +1,24 @@ +#pragma once + +#include + +// //////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// //////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); diff --git a/keyboards/ergoinu/serial_config.h b/keyboards/ergoinu/serial_config.h new file mode 100644 index 0000000000..a16db684ca --- /dev/null +++ b/keyboards/ergoinu/serial_config.h @@ -0,0 +1,11 @@ +#pragma once + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/ergoinu/split_util.c b/keyboards/ergoinu/split_util.c new file mode 100644 index 0000000000..0cbc2c69c4 --- /dev/null +++ b/keyboards/ergoinu/split_util.c @@ -0,0 +1,56 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#include "serial.h" + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + serial_master_init(); +} + +static void keyboard_slave_setup(void) { + serial_slave_init(); +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); -- cgit v1.2.3 From 9b237f5de32212a77338068128347dc91a065676 Mon Sep 17 00:00:00 2001 From: skullY Date: Thu, 16 Aug 2018 08:38:42 -0700 Subject: fix line endings --- keyboards/iris/keymaps/bmoorey/readme.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/iris/keymaps/bmoorey/readme.md b/keyboards/iris/keymaps/bmoorey/readme.md index 84cf0332bb..353f59449b 100644 --- a/keyboards/iris/keymaps/bmoorey/readme.md +++ b/keyboards/iris/keymaps/bmoorey/readme.md @@ -1,5 +1,5 @@ -This is (what I consider to be) an improvement over the default Iris keymap. -It includes a QWERTY layer, a general system layer with arrows, volume control -and a numpad on the right board; a second raised layer with function keys and -more extensive media controls; and an adjust layer with controls for RGB -underlighting. \ No newline at end of file +This is (what I consider to be) an improvement over the default Iris keymap. +It includes a QWERTY layer, a general system layer with arrows, volume control +and a numpad on the right board; a second raised layer with function keys and +more extensive media controls; and an adjust layer with controls for RGB +underlighting. -- cgit v1.2.3 From 4044c746d0461271f15690150f874616f372511b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 16 Aug 2018 08:54:17 -0700 Subject: Keyboard: Eagle/Viper V2 refactor and Configurator update (#3671) * Matrix refactor: eagle_viper/v2 LAYOUT_all - Deleted K0L (research indicates no switch position at this location) - Renamed K0J to K0I (spacebar key; on 9th column instead of 10th) - Updated info.json and default keymap to match - readability updates * Keymap refactor readability update --- keyboards/eagle_viper/info.json | 11 ++--- keyboards/eagle_viper/v2/keymaps/default/keymap.c | 30 ++++++------ .../eagle_viper/v2/keymaps/profanum429/keymap.c | 33 +++++++------- keyboards/eagle_viper/v2/v2.h | 53 ++++++++++++---------- 4 files changed, 64 insertions(+), 63 deletions(-) diff --git a/keyboards/eagle_viper/info.json b/keyboards/eagle_viper/info.json index e6a12aef06..f20babdbcf 100644 --- a/keyboards/eagle_viper/info.json +++ b/keyboards/eagle_viper/info.json @@ -4,19 +4,16 @@ "height": 5, "layouts": { "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"iso", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":5}, {"x":9, "y":4}, {"x":10, "y":4}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"|", "x":13.75, "y":5}] + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"ISO#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, - "LAYOUT_eagle": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, - "LAYOUT_eagle_splits": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, - "LAYOUT_viper": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}] + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"GUI", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"GUI", "x":12.5, "y":4}] } } } diff --git a/keyboards/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/eagle_viper/v2/keymaps/default/keymap.c index 2a6bda74f6..332db66e64 100644 --- a/keyboards/eagle_viper/v2/keymaps/default/keymap.c +++ b/keyboards/eagle_viper/v2/keymaps/default/keymap.c @@ -16,21 +16,23 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [0] = LAYOUT_all(\ - 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_NO, KC_BSPC, - 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, 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_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_NO, KC_RALT, KC_RGUI, KC_RCTL), + /* layer 0: qwerty */ + [0] = LAYOUT_all(\ + 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, XXXXXXX, KC_BSPC, \ + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \ + ), - [1] = LAYOUT_all(\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - }; + [1] = LAYOUT_all(\ + _______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; diff --git a/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c b/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c index d3be5e8005..a0163ad6aa 100644 --- a/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c +++ b/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c @@ -16,25 +16,24 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [0] = LAYOUT_viper(\ - KC_ESC, 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_BSLS, KC_GRV, - 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_BSPC, - KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), - KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI), + /* layer 0: qwerty */ + [0] = LAYOUT_viper( \ + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI \ + ), - [1] = LAYOUT_viper(\ - KC_TRNS, 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_INS, KC_DEL, - KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, - KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_ENT, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - }; + [1] = LAYOUT_viper( \ + _______, 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_INS, KC_DEL, \ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \ + _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, \ + _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______ \ + ), +}; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; }; - - - diff --git a/keyboards/eagle_viper/v2/v2.h b/keyboards/eagle_viper/v2/v2.h index ce8ca028f1..583966b906 100644 --- a/keyboards/eagle_viper/v2/v2.h +++ b/keyboards/eagle_viper/v2/v2.h @@ -18,18 +18,20 @@ #include "../eagle_viper.h" +#define ___ KC_NO + #define LAYOUT_all( \ K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, \ K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ ) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, KC_NO, K2O, }, \ - { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O } \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, ___, K2O }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ } #define LAYOUT_60_ansi( \ @@ -37,13 +39,13 @@ K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, \ - K0A, K0B, K0C, K0J, K0K, K0M, K0N, K0O \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ ) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, }, \ - { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, KC_NO, }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, KC_NO, K0M, K0N, K0O } \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, ___, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, ___ }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ } #define LAYOUT_eagle_splits( \ @@ -51,13 +53,13 @@ K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0A, K0B, K0C, K0J, K0K, K0M, K0N, K0O \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ ) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, }, \ - { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, KC_NO, K0M, K0N, K0O } \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ } #define LAYOUT_viper( \ @@ -65,14 +67,15 @@ K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0B, K0C, K0J, K0M, K0N \ + K0B, K0C, K0I, K0M, K0N \ ) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, }, \ - { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, }, \ - { KC_NO, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, KC_NO, KC_NO, K0M, K0N, KC_NO } \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { ___, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, ___, ___, K0M, K0N, ___ } \ } -#endif #define LAYOUT_eagle LAYOUT_60_ansi + +#endif -- cgit v1.2.3 From 15a73f4f64a3b2b109e63cf1eeb37c9875c3d870 Mon Sep 17 00:00:00 2001 From: Phil Hagelberg Date: Thu, 16 Aug 2018 08:47:36 -0700 Subject: Add Atreus as an official board. --- keyboards/atreus/readme.md | 7 +++++-- readme.md | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/keyboards/atreus/readme.md b/keyboards/atreus/readme.md index 221c7fac4a..6a86ff2e00 100644 --- a/keyboards/atreus/readme.md +++ b/keyboards/atreus/readme.md @@ -5,12 +5,15 @@ A small mechanical keyboard that is based around the shape of the human hand. These configuration files are specifically for the Atreus keyboards created by Phil Hagelberg (@technomancy). This keyboard is available in two variants: one powered by a Teensy 2, (usually hand-wired) one powered by an A-Star. (usually using a PCB) This repository currently assumes that you have an A-Star powered Atreus. If you are using a Teensy2, specify that by adding `TEENSY2=yes` to your `make` commands. -Keyboard Maintainer: QMK Community -Hardware Supported: Atreus PCB +Keyboard Maintainer: [Phil Hagelberg](https://github.com/technomancy) +Hardware Supported: Atreus, PCB-based or hand-wired Hardware Availability: https://atreus.technomancy.us Make example for this keyboard (after setting up your build environment): make atreus:default:avrdude +Unlike the TMK firmware, this command should be run from the root of +the repository, not the directory containing this readme. + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/readme.md b/readme.md index 859e3ed12f..6e6cfaa1bd 100644 --- a/readme.md +++ b/readme.md @@ -22,12 +22,13 @@ The docs are hosted on [Gitbook](https://www.gitbook.com/book/qmk/firmware/detai * [ErgoDox EZ](/keyboards/ergodox_ez/) * [Clueboard](/keyboards/clueboard/) * [Cluepad](/keyboards/clueboard/17/) +* [Atreus](/keyboards/atreus/) The project also includes community support for [lots of other keyboards](/keyboards/). ## Maintainers -QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), and the Clueboard by [Zach White](https://github.com/skullydazed). +QMK is developed and maintained by Jack Humbert of OLKB with contributions from the community, and of course, [Hasu](https://github.com/tmk). The OLKB product firmwares are maintained by [Jack Humbert](https://github.com/jackhumbert), the Ergodox EZ by [Erez Zukerman](https://github.com/ezuk), the Clueboard by [Zach White](https://github.com/skullydazed), and the Atreus by [Phil Hagelberg](https://github.com/technomancy). ## Official website -- cgit v1.2.3 From fe0683938a355f3b7662fb384058ce4c96f10c64 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Thu, 16 Aug 2018 21:35:24 +0900 Subject: change messege at 'check-size' target --- message.mk | 4 ++-- tmk_core/rules.mk | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/message.mk b/message.mk index 30fd0b9db7..427925dac1 100644 --- a/message.mk +++ b/message.mk @@ -77,6 +77,6 @@ endef MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL) MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR) MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex -MSG_FILE_TOO_BIG = $(ERROR_COLOR)Your file is too big!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE)\n +MSG_FILE_TOO_BIG = $(ERROR_COLOR)Your file is too big!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) over)\n MSG_FILE_TOO_SMALL = Your file is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n -MSG_FILE_JUST_RIGHT = File size is fine - $(CURRENT_SIZE)/$(MAX_SIZE)\n +MSG_FILE_JUST_RIGHT = File size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) free)\n diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index b556c4609b..5b1858b718 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -374,6 +374,8 @@ ifeq ($(findstring avr-gcc,$(CC)),avr-gcc) check-size: $(eval MAX_SIZE=$(shell n=`$(CC) -E -mmcu=$(MCU) $(CFLAGS) $(OPT_DEFS) tmk_core/common/avr/bootloader_size.c 2> /dev/null | sed -ne '/^#/n;/^AVR_SIZE:/,$${s/^AVR_SIZE: //;p;}'` && echo $$(($$n)) || echo 0)) $(eval CURRENT_SIZE=$(shell if [ -f $(BUILD_DIR)/$(TARGET).hex ]; then $(SIZE) --target=$(FORMAT) $(BUILD_DIR)/$(TARGET).hex | $(AWK) 'NR==2 {print $$4}'; else printf 0; fi)) + $(eval FREE_SIZE=$(shell expr $(MAX_SIZE) - $(CURRENT_SIZE))) + $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ -- cgit v1.2.3 From 97df0fc072333684e7dfbca0effd7d25097c2e26 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 16 Aug 2018 09:06:19 -0700 Subject: Keyboard: DC60 Support (#3667) * initial commit and get pins correct * get the switch matrix done * Add Configurator support * update LED numbering * enable lighting options * add a default-ish keymap * turn off mouse keys as the file gets too large * put my name everywhere * update Alf names * update keymap to match whats on qmkeyboard.cn --- keyboards/dc60/config.h | 224 +++++++++++++++++++++++++++++++ keyboards/dc60/dc60.c | 49 +++++++ keyboards/dc60/dc60.h | 42 ++++++ keyboards/dc60/info.json | 12 ++ keyboards/dc60/keymaps/default/config.h | 19 +++ keyboards/dc60/keymaps/default/keymap.c | 70 ++++++++++ keyboards/dc60/keymaps/default/readme.md | 1 + keyboards/dc60/readme.md | 15 +++ keyboards/dc60/rules.mk | 70 ++++++++++ 9 files changed, 502 insertions(+) create mode 100644 keyboards/dc60/config.h create mode 100644 keyboards/dc60/dc60.c create mode 100644 keyboards/dc60/dc60.h create mode 100644 keyboards/dc60/info.json create mode 100644 keyboards/dc60/keymaps/default/config.h create mode 100644 keyboards/dc60/keymaps/default/keymap.c create mode 100644 keyboards/dc60/keymaps/default/readme.md create mode 100644 keyboards/dc60/readme.md create mode 100644 keyboards/dc60/rules.mk diff --git a/keyboards/dc60/config.h b/keyboards/dc60/config.h new file mode 100644 index 0000000000..f6e527119f --- /dev/null +++ b/keyboards/dc60/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Alf +#define PRODUCT dc60 +#define DESCRIPTION custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/dc60/dc60.c b/keyboards/dc60/dc60.c new file mode 100644 index 0000000000..70979adf4e --- /dev/null +++ b/keyboards/dc60/dc60.c @@ -0,0 +1,49 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "dc60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 7); + PORTB &= ~(1 << 7); + } else { + DDRB &= ~(1 << 7); + PORTB &= ~(1 << 7); + } + + led_set_user(usb_led); +} diff --git a/keyboards/dc60/dc60.h b/keyboards/dc60/dc60.h new file mode 100644 index 0000000000..30e05b31f0 --- /dev/null +++ b/keyboards/dc60/dc60.h @@ -0,0 +1,42 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef DC60_H +#define DC60_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ + { K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ +} + +#endif diff --git a/keyboards/dc60/info.json b/keyboards/dc60/info.json new file mode 100644 index 0000000000..3929545205 --- /dev/null +++ b/keyboards/dc60/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "dc60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/dc60/keymaps/default/config.h b/keyboards/dc60/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/dc60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/dc60/keymaps/default/keymap.c b/keyboards/dc60/keymaps/default/keymap.c new file mode 100644 index 0000000000..b7425178bc --- /dev/null +++ b/keyboards/dc60/keymaps/default/keymap.c @@ -0,0 +1,70 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_BSPC, + 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_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_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_RGUI, KC_RGUI, KC_RCTL + ), + + [1] = 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/dc60/keymaps/default/readme.md b/keyboards/dc60/keymaps/default/readme.md new file mode 100644 index 0000000000..85bef5fc7b --- /dev/null +++ b/keyboards/dc60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for dc60 diff --git a/keyboards/dc60/readme.md b/keyboards/dc60/readme.md new file mode 100644 index 0000000000..9d70143199 --- /dev/null +++ b/keyboards/dc60/readme.md @@ -0,0 +1,15 @@ +# dc60 + +![dc60](imgur.com image replace me!) + +A 60% PCB sold with the Alf DC60. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: DC60 PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=96616.0) + +Make example for this keyboard (after setting up your build environment): + + make dc60:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/dc60/rules.mk b/keyboards/dc60/rules.mk new file mode 100644 index 0000000000..9ad6d7875e --- /dev/null +++ b/keyboards/dc60/rules.mk @@ -0,0 +1,70 @@ +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From 700aa8fe1c5775ba26358c343c122997225fafcc Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 17 Aug 2018 02:12:48 +1000 Subject: Tidy up keycode.h (#3666) * Tidy up keycode.h * Fix spacing here * Add back this comma --- tmk_core/common/keycode.h | 809 +++++++++++++++++++++++----------------------- 1 file changed, 412 insertions(+), 397 deletions(-) diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 9cb4f1e0c1..61642ae84f 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -16,8 +16,9 @@ along with this program. If not, see . */ /* - * Keycodes based on HID Usage Keyboard/Keypad Page(0x07) plus special codes - * https://web.archive.org/web/20060218214400/http://www.usb.org/developers/devclass_docs/Hut1_12.pdf + * Keycodes based on HID Keyboard/Keypad Usage Page (0x07) plus media keys from Generic Desktop Page (0x01) and Consumer Page (0x0C) + * + * See https://web.archive.org/web/20060218214400/http://www.usb.org/developers/devclass_docs/Hut1_12.pdf * or http://www.usb.org/developers/hidpage/Hut1_12v2.pdf (older) */ #ifndef KEYCODE_H @@ -30,76 +31,82 @@ along with this program. If not, see . #define IS_KEY(code) (KC_A <= (code) && (code) <= KC_EXSEL) #define IS_MOD(code) (KC_LCTRL <= (code) && (code) <= KC_RGUI) - #define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) #define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_MRWD) + #define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) + #define IS_MOUSEKEY(code) (KC_MS_UP <= (code) && (code) <= KC_MS_ACCEL2) #define IS_MOUSEKEY_MOVE(code) (KC_MS_UP <= (code) && (code) <= KC_MS_RIGHT) #define IS_MOUSEKEY_BUTTON(code) (KC_MS_BTN1 <= (code) && (code) <= KC_MS_BTN5) #define IS_MOUSEKEY_WHEEL(code) (KC_MS_WH_UP <= (code) && (code) <= KC_MS_WH_RIGHT) #define IS_MOUSEKEY_ACCEL(code) (KC_MS_ACCEL0 <= (code) && (code) <= KC_MS_ACCEL2) -#define MOD_BIT(code) (1<. #define KC_P9 KC_KP_9 #define KC_P0 KC_KP_0 #define KC_PDOT KC_KP_DOT -#define KC_PCMM KC_KP_COMMA -#define KC_PSLS KC_KP_SLASH -#define KC_PAST KC_KP_ASTERISK -#define KC_PMNS KC_KP_MINUS -#define KC_PPLS KC_KP_PLUS #define KC_PEQL KC_KP_EQUAL -#define KC_PENT KC_KP_ENTER -/* Unix function key */ -#define KC_EXEC KC_EXECUTE -#define KC_SLCT KC_SELECT -#define KC_AGIN KC_AGAIN -#define KC_PSTE KC_PASTE -/* Mousekey */ -#define KC_MS_U KC_MS_UP -#define KC_MS_D KC_MS_DOWN -#define KC_MS_L KC_MS_LEFT -#define KC_MS_R KC_MS_RIGHT -#define KC_BTN1 KC_MS_BTN1 -#define KC_BTN2 KC_MS_BTN2 -#define KC_BTN3 KC_MS_BTN3 -#define KC_BTN4 KC_MS_BTN4 -#define KC_BTN5 KC_MS_BTN5 -#define KC_WH_U KC_MS_WH_UP -#define KC_WH_D KC_MS_WH_DOWN -#define KC_WH_L KC_MS_WH_LEFT -#define KC_WH_R KC_MS_WH_RIGHT -#define KC_ACL0 KC_MS_ACCEL0 -#define KC_ACL1 KC_MS_ACCEL1 -#define KC_ACL2 KC_MS_ACCEL2 -/* Sytem Control */ +#define KC_PCMM KC_KP_COMMA + +/* Japanese specific */ +#define KC_ZKHK KC_GRAVE +#define KC_RO KC_INT1 +#define KC_KANA KC_INT2 +#define KC_JYEN KC_INT3 +#define KC_HENK KC_INT4 +#define KC_MHEN KC_INT5 + +/* Korean specific */ +#define KC_HAEN KC_LANG1 +#define KC_HANJ KC_LANG2 + +/* Modifiers */ +#define KC_LCTL KC_LCTRL +#define KC_LSFT KC_LSHIFT +#define KC_LCMD KC_LGUI +#define KC_LWIN KC_LGUI +#define KC_RCTL KC_RCTRL +#define KC_RSFT KC_RSHIFT +#define KC_RCMD KC_RGUI +#define KC_RWIN KC_RGUI + +/* Generic Desktop Page (0x01) */ #define KC_PWR KC_SYSTEM_POWER #define KC_SLEP KC_SYSTEM_SLEEP #define KC_WAKE KC_SYSTEM_WAKE -/* Consumer Page */ + +/* Consumer Page (0x0C) */ #define KC_MUTE KC_AUDIO_MUTE #define KC_VOLU KC_AUDIO_VOL_UP #define KC_VOLD KC_AUDIO_VOL_DOWN #define KC_MNXT KC_MEDIA_NEXT_TRACK #define KC_MPRV KC_MEDIA_PREV_TRACK -#define KC_MFFD KC_MEDIA_FAST_FORWARD -#define KC_MRWD KC_MEDIA_REWIND #define KC_MSTP KC_MEDIA_STOP #define KC_MPLY KC_MEDIA_PLAY_PAUSE #define KC_MSEL KC_MEDIA_SELECT @@ -166,339 +168,352 @@ along with this program. If not, see . #define KC_WSTP KC_WWW_STOP #define KC_WREF KC_WWW_REFRESH #define KC_WFAV KC_WWW_FAVORITES -/* Transparent */ -#define KC_TRANSPARENT 1 -#define KC_TRNS KC_TRANSPARENT -/* GUI key aliases */ -#define KC_LCMD KC_LGUI -#define KC_LWIN KC_LGUI -#define KC_RCMD KC_RGUI -#define KC_RWIN KC_RGUI - +#define KC_MFFD KC_MEDIA_FAST_FORWARD +#define KC_MRWD KC_MEDIA_REWIND +/* Mouse Keys */ +#define KC_MS_U KC_MS_UP +#define KC_MS_D KC_MS_DOWN +#define KC_MS_L KC_MS_LEFT +#define KC_MS_R KC_MS_RIGHT +#define KC_BTN1 KC_MS_BTN1 +#define KC_BTN2 KC_MS_BTN2 +#define KC_BTN3 KC_MS_BTN3 +#define KC_BTN4 KC_MS_BTN4 +#define KC_BTN5 KC_MS_BTN5 +#define KC_WH_U KC_MS_WH_UP +#define KC_WH_D KC_MS_WH_DOWN +#define KC_WH_L KC_MS_WH_LEFT +#define KC_WH_R KC_MS_WH_RIGHT +#define KC_ACL0 KC_MS_ACCEL0 +#define KC_ACL1 KC_MS_ACCEL1 +#define KC_ACL2 KC_MS_ACCEL2 -/* USB HID Keyboard/Keypad Usage(0x07) */ +/* Keyboard/Keypad Page (0x07) */ enum hid_keyboard_keypad_usage { - KC_NO = 0x00, - KC_ROLL_OVER, - KC_POST_FAIL, - KC_UNDEFINED, - KC_A, - KC_B, - KC_C, - KC_D, - KC_E, - KC_F, - KC_G, - KC_H, - KC_I, - KC_J, - KC_K, - KC_L, - KC_M, /* 0x10 */ - KC_N, - KC_O, - KC_P, - KC_Q, - KC_R, - KC_S, - KC_T, - KC_U, - KC_V, - KC_W, - KC_X, - KC_Y, - KC_Z, - KC_1, - KC_2, - KC_3, /* 0x20 */ - KC_4, - KC_5, - KC_6, - KC_7, - KC_8, - KC_9, - KC_0, - KC_ENTER, - KC_ESCAPE, - KC_BSPACE, - KC_TAB, - KC_SPACE, - KC_MINUS, - KC_EQUAL, - KC_LBRACKET, - KC_RBRACKET, /* 0x30 */ - KC_BSLASH, /* \ (and |) */ - KC_NONUS_HASH, /* Non-US # and ~ (Typically near the Enter key) */ - KC_SCOLON, /* ; (and :) */ - KC_QUOTE, /* ' and " */ - KC_GRAVE, /* Grave accent and tilde */ - KC_COMMA, /* , and < */ - KC_DOT, /* . and > */ - KC_SLASH, /* / and ? */ - KC_CAPSLOCK, - KC_F1, - KC_F2, - KC_F3, - KC_F4, - KC_F5, - KC_F6, - KC_F7, /* 0x40 */ - KC_F8, - KC_F9, - KC_F10, - KC_F11, - KC_F12, - KC_PSCREEN, - KC_SCROLLLOCK, - KC_PAUSE, - KC_INSERT, - KC_HOME, - KC_PGUP, - KC_DELETE, - KC_END, - KC_PGDOWN, - KC_RIGHT, - KC_LEFT, /* 0x50 */ - KC_DOWN, - KC_UP, - KC_NUMLOCK, - KC_KP_SLASH, - KC_KP_ASTERISK, - KC_KP_MINUS, - KC_KP_PLUS, - KC_KP_ENTER, - KC_KP_1, - KC_KP_2, - KC_KP_3, - KC_KP_4, - KC_KP_5, - KC_KP_6, - KC_KP_7, - KC_KP_8, /* 0x60 */ - KC_KP_9, - KC_KP_0, - KC_KP_DOT, - KC_NONUS_BSLASH, /* Non-US \ and | (Typically near the Left-Shift key) */ - KC_APPLICATION, - KC_POWER, - KC_KP_EQUAL, - KC_F13, - KC_F14, - KC_F15, - KC_F16, - KC_F17, - KC_F18, - KC_F19, - KC_F20, - KC_F21, /* 0x70 */ - KC_F22, - KC_F23, - KC_F24, - KC_EXECUTE, - KC_HELP, - KC_MENU, - KC_SELECT, - KC_STOP, - KC_AGAIN, - KC_UNDO, - KC_CUT, - KC_COPY, - KC_PASTE, - KC_FIND, - KC__MUTE, - KC__VOLUP, /* 0x80 */ - KC__VOLDOWN, - KC_LOCKING_CAPS, /* locking Caps Lock */ - KC_LOCKING_NUM, /* locking Num Lock */ - KC_LOCKING_SCROLL, /* locking Scroll Lock */ - KC_KP_COMMA, - KC_KP_EQUAL_AS400, /* equal sign on AS/400 */ - KC_INT1, - KC_INT2, - KC_INT3, - KC_INT4, - KC_INT5, - KC_INT6, - KC_INT7, - KC_INT8, - KC_INT9, - KC_LANG1, /* 0x90 */ - KC_LANG2, - KC_LANG3, - KC_LANG4, - KC_LANG5, - KC_LANG6, - KC_LANG7, - KC_LANG8, - KC_LANG9, - KC_ALT_ERASE, - KC_SYSREQ, - KC_CANCEL, - KC_CLEAR, - KC_PRIOR, - KC_RETURN, - KC_SEPARATOR, - KC_OUT, /* 0xA0 */ - KC_OPER, - KC_CLEAR_AGAIN, - KC_CRSEL, - KC_EXSEL, /* 0xA4 */ - - /* NOTE: 0xA5-DF are used for internal special purpose */ + KC_NO = 0x00, + KC_ROLL_OVER, + KC_POST_FAIL, + KC_UNDEFINED, + KC_A, + KC_B, + KC_C, + KC_D, + KC_E, + KC_F, + KC_G, + KC_H, + KC_I, + KC_J, + KC_K, + KC_L, + KC_M, //0x10 + KC_N, + KC_O, + KC_P, + KC_Q, + KC_R, + KC_S, + KC_T, + KC_U, + KC_V, + KC_W, + KC_X, + KC_Y, + KC_Z, + KC_1, + KC_2, + KC_3, //0x20 + KC_4, + KC_5, + KC_6, + KC_7, + KC_8, + KC_9, + KC_0, + KC_ENTER, + KC_ESCAPE, + KC_BSPACE, + KC_TAB, + KC_SPACE, + KC_MINUS, + KC_EQUAL, + KC_LBRACKET, + KC_RBRACKET, //0x30 + KC_BSLASH, + KC_NONUS_HASH, + KC_SCOLON, + KC_QUOTE, + KC_GRAVE, + KC_COMMA, + KC_DOT, + KC_SLASH, + KC_CAPSLOCK, + KC_F1, + KC_F2, + KC_F3, + KC_F4, + KC_F5, + KC_F6, + KC_F7, //0x40 + KC_F8, + KC_F9, + KC_F10, + KC_F11, + KC_F12, + KC_PSCREEN, + KC_SCROLLLOCK, + KC_PAUSE, + KC_INSERT, + KC_HOME, + KC_PGUP, + KC_DELETE, + KC_END, + KC_PGDOWN, + KC_RIGHT, + KC_LEFT, //0x50 + KC_DOWN, + KC_UP, + KC_NUMLOCK, + KC_KP_SLASH, + KC_KP_ASTERISK, + KC_KP_MINUS, + KC_KP_PLUS, + KC_KP_ENTER, + KC_KP_1, + KC_KP_2, + KC_KP_3, + KC_KP_4, + KC_KP_5, + KC_KP_6, + KC_KP_7, + KC_KP_8, //0x60 + KC_KP_9, + KC_KP_0, + KC_KP_DOT, + KC_NONUS_BSLASH, + KC_APPLICATION, + KC_POWER, + KC_KP_EQUAL, + KC_F13, + KC_F14, + KC_F15, + KC_F16, + KC_F17, + KC_F18, + KC_F19, + KC_F20, + KC_F21, //0x70 + KC_F22, + KC_F23, + KC_F24, + KC_EXECUTE, + KC_HELP, + KC_MENU, + KC_SELECT, + KC_STOP, + KC_AGAIN, + KC_UNDO, + KC_CUT, + KC_COPY, + KC_PASTE, + KC_FIND, + KC__MUTE, + KC__VOLUP, //0x80 + KC__VOLDOWN, + KC_LOCKING_CAPS, + KC_LOCKING_NUM, + KC_LOCKING_SCROLL, + KC_KP_COMMA, + KC_KP_EQUAL_AS400, + KC_INT1, + KC_INT2, + KC_INT3, + KC_INT4, + KC_INT5, + KC_INT6, + KC_INT7, + KC_INT8, + KC_INT9, + KC_LANG1, //0x90 + KC_LANG2, + KC_LANG3, + KC_LANG4, + KC_LANG5, + KC_LANG6, + KC_LANG7, + KC_LANG8, + KC_LANG9, + KC_ALT_ERASE, + KC_SYSREQ, + KC_CANCEL, + KC_CLEAR, + KC_PRIOR, + KC_RETURN, + KC_SEPARATOR, + KC_OUT, //0xA0 + KC_OPER, + KC_CLEAR_AGAIN, + KC_CRSEL, + KC_EXSEL, #if 0 - /* NOTE: Following codes(0xB0-DD) are not used. Leave them for reference. */ - KC_KP_00 = 0xB0, - KC_KP_000, - KC_THOUSANDS_SEPARATOR, - KC_DECIMAL_SEPARATOR, - KC_CURRENCY_UNIT, - KC_CURRENCY_SUB_UNIT, - KC_KP_LPAREN, - KC_KP_RPAREN, - KC_KP_LCBRACKET, /* { */ - KC_KP_RCBRACKET, /* } */ - KC_KP_TAB, - KC_KP_BSPACE, - KC_KP_A, - KC_KP_B, - KC_KP_C, - KC_KP_D, - KC_KP_E, /* 0xC0 */ - KC_KP_F, - KC_KP_XOR, - KC_KP_HAT, - KC_KP_PERC, - KC_KP_LT, - KC_KP_GT, - KC_KP_AND, - KC_KP_LAZYAND, - KC_KP_OR, - KC_KP_LAZYOR, - KC_KP_COLON, - KC_KP_HASH, - KC_KP_SPACE, - KC_KP_ATMARK, - KC_KP_EXCLAMATION, - KC_KP_MEM_STORE, /* 0xD0 */ - KC_KP_MEM_RECALL, - KC_KP_MEM_CLEAR, - KC_KP_MEM_ADD, - KC_KP_MEM_SUB, - KC_KP_MEM_MUL, - KC_KP_MEM_DIV, - KC_KP_PLUS_MINUS, - KC_KP_CLEAR, - KC_KP_CLEAR_ENTRY, - KC_KP_BINARY, - KC_KP_OCTAL, - KC_KP_DECIMAL, - KC_KP_HEXADECIMAL, /* 0xDD */ + // *************************************************************** + // These keycodes are present in the HID spec, but are * + // nonfunctional on modern OSes. QMK uses this range (0xA5-0xDF) * + // for the media and function keys instead - see below. * + // *************************************************************** + + KC_KP_00 = 0xB0, + KC_KP_000, + KC_THOUSANDS_SEPARATOR, + KC_DECIMAL_SEPARATOR, + KC_CURRENCY_UNIT, + KC_CURRENCY_SUB_UNIT, + KC_KP_LPAREN, + KC_KP_RPAREN, + KC_KP_LCBRACKET, + KC_KP_RCBRACKET, + KC_KP_TAB, + KC_KP_BSPACE, + KC_KP_A, + KC_KP_B, + KC_KP_C, + KC_KP_D, + KC_KP_E, //0xC0 + KC_KP_F, + KC_KP_XOR, + KC_KP_HAT, + KC_KP_PERC, + KC_KP_LT, + KC_KP_GT, + KC_KP_AND, + KC_KP_LAZYAND, + KC_KP_OR, + KC_KP_LAZYOR, + KC_KP_COLON, + KC_KP_HASH, + KC_KP_SPACE, + KC_KP_ATMARK, + KC_KP_EXCLAMATION, + KC_KP_MEM_STORE, //0xD0 + KC_KP_MEM_RECALL, + KC_KP_MEM_CLEAR, + KC_KP_MEM_ADD, + KC_KP_MEM_SUB, + KC_KP_MEM_MUL, + KC_KP_MEM_DIV, + KC_KP_PLUS_MINUS, + KC_KP_CLEAR, + KC_KP_CLEAR_ENTRY, + KC_KP_BINARY, + KC_KP_OCTAL, + KC_KP_DECIMAL, + KC_KP_HEXADECIMAL, #endif - /* Modifiers */ - KC_LCTRL = 0xE0, - KC_LSHIFT, - KC_LALT, - KC_LGUI, - KC_RCTRL, - KC_RSHIFT, - KC_RALT, - KC_RGUI, - - /* NOTE: 0xE8-FF are used for internal special purpose */ + /* Modifiers */ + KC_LCTRL = 0xE0, + KC_LSHIFT, + KC_LALT, + KC_LGUI, + KC_RCTRL, + KC_RSHIFT, + KC_RALT, + KC_RGUI + + // ********************************************** + // * 0xF0-0xFF are unallocated in the HID spec. * + // * QMK uses these for Mouse Keys - see below. * + // ********************************************** }; -/* Special keycodes */ -/* NOTE: 0xA5-DF and 0xE8-FF are used for internal special purpose */ +/* Media and Function keys */ enum internal_special_keycodes { - /* System Control */ - KC_SYSTEM_POWER = 0xA5, - KC_SYSTEM_SLEEP, - KC_SYSTEM_WAKE, - - /* Media Control */ - KC_AUDIO_MUTE, - KC_AUDIO_VOL_UP, - KC_AUDIO_VOL_DOWN, - KC_MEDIA_NEXT_TRACK, - KC_MEDIA_PREV_TRACK, - KC_MEDIA_STOP, - KC_MEDIA_PLAY_PAUSE, - KC_MEDIA_SELECT, - KC_MEDIA_EJECT, - KC_MAIL, - KC_CALCULATOR, - KC_MY_COMPUTER, - KC_WWW_SEARCH, - KC_WWW_HOME, - KC_WWW_BACK, - KC_WWW_FORWARD, - KC_WWW_STOP, - KC_WWW_REFRESH, - KC_WWW_FAVORITES, - KC_MEDIA_FAST_FORWARD, - KC_MEDIA_REWIND, /* 0xBC */ - - /* Fn key */ - KC_FN0 = 0xC0, - KC_FN1, - KC_FN2, - KC_FN3, - KC_FN4, - KC_FN5, - KC_FN6, - KC_FN7, - KC_FN8, - KC_FN9, - KC_FN10, - KC_FN11, - KC_FN12, - KC_FN13, - KC_FN14, - KC_FN15, - - KC_FN16 = 0xD0, - KC_FN17, - KC_FN18, - KC_FN19, - KC_FN20, - KC_FN21, - KC_FN22, - KC_FN23, - KC_FN24, - KC_FN25, - KC_FN26, - KC_FN27, - KC_FN28, - KC_FN29, - KC_FN30, - KC_FN31, /* 0xDF */ - - /**************************************/ - /* 0xE0-E7 for Modifiers. DO NOT USE. */ - /**************************************/ - - /* Mousekey */ - KC_MS_UP = 0xF0, - KC_MS_DOWN, - KC_MS_LEFT, - KC_MS_RIGHT, - KC_MS_BTN1, - KC_MS_BTN2, - KC_MS_BTN3, - KC_MS_BTN4, - KC_MS_BTN5, /* 0xF8 */ - /* Mousekey wheel */ - KC_MS_WH_UP, - KC_MS_WH_DOWN, - KC_MS_WH_LEFT, - KC_MS_WH_RIGHT, /* 0xFC */ - /* Mousekey accel */ - KC_MS_ACCEL0, - KC_MS_ACCEL1, - KC_MS_ACCEL2 /* 0xFF */ + /* Generic Desktop Page (0x01) */ + KC_SYSTEM_POWER = 0xA5, + KC_SYSTEM_SLEEP, + KC_SYSTEM_WAKE, + + /* Consumer Page (0x0C) */ + KC_AUDIO_MUTE, + KC_AUDIO_VOL_UP, + KC_AUDIO_VOL_DOWN, + KC_MEDIA_NEXT_TRACK, + KC_MEDIA_PREV_TRACK, + KC_MEDIA_STOP, + KC_MEDIA_PLAY_PAUSE, + KC_MEDIA_SELECT, + KC_MEDIA_EJECT, //0xB0 + KC_MAIL, + KC_CALCULATOR, + KC_MY_COMPUTER, + KC_WWW_SEARCH, + KC_WWW_HOME, + KC_WWW_BACK, + KC_WWW_FORWARD, + KC_WWW_STOP, + KC_WWW_REFRESH, + KC_WWW_FAVORITES, + KC_MEDIA_FAST_FORWARD, + KC_MEDIA_REWIND, + + /* Fn keys */ + KC_FN0 = 0xC0, + KC_FN1, + KC_FN2, + KC_FN3, + KC_FN4, + KC_FN5, + KC_FN6, + KC_FN7, + KC_FN8, + KC_FN9, + KC_FN10, + KC_FN11, + KC_FN12, + KC_FN13, + KC_FN14, + KC_FN15, + KC_FN16, //0xD0 + KC_FN17, + KC_FN18, + KC_FN19, + KC_FN20, + KC_FN21, + KC_FN22, + KC_FN23, + KC_FN24, + KC_FN25, + KC_FN26, + KC_FN27, + KC_FN28, + KC_FN29, + KC_FN30, + KC_FN31 }; -#endif /* KEYCODE_H */ +enum mouse_keys { + /* Mouse Buttons */ + KC_MS_UP = 0xF0, + KC_MS_DOWN, + KC_MS_LEFT, + KC_MS_RIGHT, + KC_MS_BTN1, + KC_MS_BTN2, + KC_MS_BTN3, + KC_MS_BTN4, + KC_MS_BTN5, + + /* Mouse Wheel */ + KC_MS_WH_UP, + KC_MS_WH_DOWN, + KC_MS_WH_LEFT, + KC_MS_WH_RIGHT, + + /* Acceleration */ + KC_MS_ACCEL0, + KC_MS_ACCEL1, + KC_MS_ACCEL2 +}; +#endif -- cgit v1.2.3 From da24a34efbfdeb80190b78f3f59451af86c4fb8b Mon Sep 17 00:00:00 2001 From: skullY Date: Sat, 11 Aug 2018 14:54:27 -0700 Subject: First pass at reorganizing docs --- docs/_sidebar.md | 68 +++++++++++++++++++++++--------------------------------- docs/_summary.md | 68 +++++++++++++++++++++++--------------------------------- 2 files changed, 56 insertions(+), 80 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 69170d8bb1..d439298dad 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,36 +1,50 @@ -* [Getting Started](README.md) - * [QMK Introduction](getting_started_introduction.md) - * [Install Build Tools](getting_started_build_tools.md) - * Alternative: [Vagrant Guide](getting_started_vagrant.md) - * [Build/Compile Instructions](getting_started_make_guide.md) - * [Flashing Firmware](flashing.md) - * [Contributing to QMK](contributing.md) - * [How to Use Github](getting_started_github.md) - * [Getting Help](getting_started_getting_help.md) - * [Complete Newbs Guide](newbs.md) * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) +* [QMK Basics](README.md) + * [QMK Introduction](getting_started_introduction.md) + * [Contributing to QMK](contributing.md) + * [How to Use Github](getting_started_github.md) + * [Getting Help](getting_started_getting_help.md) + * [FAQ](faq.md) * [General FAQ](faq_general.md) * [Build/Compile QMK](faq_build.md) * [Debugging/Troubleshooting QMK](faq_debug.md) * [Keymap](faq_keymap.md) +* Detailed Guides + * [Install Build Tools](getting_started_build_tools.md) + * [Vagrant Guide](getting_started_vagrant.md) + * [Build/Compile Instructions](getting_started_make_guide.md) + * [Flashing Firmware](flashing.md) + * [Customizing Functionality](custom_quantum_functions.md) + * [Keymap Overview](keymap.md) + * [Hardware](hardware.md) - * [Keyboard Guidelines](hardware_keyboard_guidelines.md) * [AVR Processors](hardware_avr.md) - * ARM Processors (TBD) * [Drivers](hardware_drivers.md) +* Reference + * [Keyboard Guidelines](hardware_keyboard_guidelines.md) + * [Config Options](config_options.md) + * [Keycodes](keycodes.md) + * [Documentation Best Practices](documentation_best_practices.md) + * [Documentation Templates](documentation_templates.md) + * [Glossary](reference_glossary.md) + * [Unit Testing](unit_testing.md) + * [Features](features.md) + * [Basic Keycodes](keycodes_basic.md) + * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) * [Auto Shift](feature_auto_shift.md) * [Backlight](feature_backlight.md) + * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) @@ -40,6 +54,7 @@ * [Leader Key](feature_leader_key.md) * [Macros](feature_macros.md) * [Mouse Keys](feature_mouse_keys.md) + * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) @@ -53,34 +68,7 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - -* [Keycodes](keycodes.md) - * [Basic](keycodes_basic.md) - * [Quantum](quantum_keycodes.md) - * [Audio](feature_audio.md#audio-keycodes) - * [Backlight](feature_backlight.md#backlight-keycodes) - * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) - * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) - * [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) - * [Mod+Key](feature_advanced_keycodes.md#modifier-keys) - * [Mod Tap](feature_advanced_keycodes.md#mod-tap) - * [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys) - * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - * [RGB Light](feature_rgblight.md#rgblight-keycodes) - * [RGB Matrix](feature_rgb_matrix.md#keycodes) - * [Shifted Keys](keycodes_us_ansi_shifted.md) - * [Stenography](feature_stenography.md#keycode-reference) - * [Swap Hands](feature_swap_hands.md#swap-keycodes) - * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) - -* Reference - * [Config Options](config_options.md) - * [Customizing Functionality](custom_quantum_functions.md) - * [Documentation Best Practices](documentation_best_practices.md) - * [Documentation Templates](documentation_templates.md) - * [Glossary](reference_glossary.md) - * [Keymap Overview](keymap.md) - * [Unit Testing](unit_testing.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) diff --git a/docs/_summary.md b/docs/_summary.md index 69170d8bb1..d439298dad 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -1,36 +1,50 @@ -* [Getting Started](README.md) - * [QMK Introduction](getting_started_introduction.md) - * [Install Build Tools](getting_started_build_tools.md) - * Alternative: [Vagrant Guide](getting_started_vagrant.md) - * [Build/Compile Instructions](getting_started_make_guide.md) - * [Flashing Firmware](flashing.md) - * [Contributing to QMK](contributing.md) - * [How to Use Github](getting_started_github.md) - * [Getting Help](getting_started_getting_help.md) - * [Complete Newbs Guide](newbs.md) * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) +* [QMK Basics](README.md) + * [QMK Introduction](getting_started_introduction.md) + * [Contributing to QMK](contributing.md) + * [How to Use Github](getting_started_github.md) + * [Getting Help](getting_started_getting_help.md) + * [FAQ](faq.md) * [General FAQ](faq_general.md) * [Build/Compile QMK](faq_build.md) * [Debugging/Troubleshooting QMK](faq_debug.md) * [Keymap](faq_keymap.md) +* Detailed Guides + * [Install Build Tools](getting_started_build_tools.md) + * [Vagrant Guide](getting_started_vagrant.md) + * [Build/Compile Instructions](getting_started_make_guide.md) + * [Flashing Firmware](flashing.md) + * [Customizing Functionality](custom_quantum_functions.md) + * [Keymap Overview](keymap.md) + * [Hardware](hardware.md) - * [Keyboard Guidelines](hardware_keyboard_guidelines.md) * [AVR Processors](hardware_avr.md) - * ARM Processors (TBD) * [Drivers](hardware_drivers.md) +* Reference + * [Keyboard Guidelines](hardware_keyboard_guidelines.md) + * [Config Options](config_options.md) + * [Keycodes](keycodes.md) + * [Documentation Best Practices](documentation_best_practices.md) + * [Documentation Templates](documentation_templates.md) + * [Glossary](reference_glossary.md) + * [Unit Testing](unit_testing.md) + * [Features](features.md) + * [Basic Keycodes](keycodes_basic.md) + * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) * [Auto Shift](feature_auto_shift.md) * [Backlight](feature_backlight.md) + * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) @@ -40,6 +54,7 @@ * [Leader Key](feature_leader_key.md) * [Macros](feature_macros.md) * [Mouse Keys](feature_mouse_keys.md) + * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) * [Pointing Device](feature_pointing_device.md) * [PS/2 Mouse](feature_ps2_mouse.md) * [RGB Lighting](feature_rgblight.md) @@ -53,34 +68,7 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - -* [Keycodes](keycodes.md) - * [Basic](keycodes_basic.md) - * [Quantum](quantum_keycodes.md) - * [Audio](feature_audio.md#audio-keycodes) - * [Backlight](feature_backlight.md#backlight-keycodes) - * [Bluetooth](feature_bluetooth.md#bluetooth-keycodes) - * [Bootmagic](feature_bootmagic.md#bootmagic-keycodes) - * [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) - * [Mod+Key](feature_advanced_keycodes.md#modifier-keys) - * [Mod Tap](feature_advanced_keycodes.md#mod-tap) - * [Mouse Keys](feature_mouse_keys.md#mapping-mouse-actions-to-keyboard-keys) - * [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - * [RGB Light](feature_rgblight.md#rgblight-keycodes) - * [RGB Matrix](feature_rgb_matrix.md#keycodes) - * [Shifted Keys](keycodes_us_ansi_shifted.md) - * [Stenography](feature_stenography.md#keycode-reference) - * [Swap Hands](feature_swap_hands.md#swap-keycodes) - * [Thermal Printer](feature_thermal_printer.md#thermal-printer-keycodes) - -* Reference - * [Config Options](config_options.md) - * [Customizing Functionality](custom_quantum_functions.md) - * [Documentation Best Practices](documentation_best_practices.md) - * [Documentation Templates](documentation_templates.md) - * [Glossary](reference_glossary.md) - * [Keymap Overview](keymap.md) - * [Unit Testing](unit_testing.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) -- cgit v1.2.3 From 8007d9f3a7583adeedd26fa7ab1622e06fed8034 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 17 Aug 2018 16:04:21 -0700 Subject: Keyboard: Zen refactor and Configurator support (#3677) * Matrix refactor * Keymap refactor * Configurator support * Readme reformatting --- keyboards/zen/info.json | 12 ++++ keyboards/zen/keymaps/default/keymap.c | 84 +++++++++++----------- keyboards/zen/keymaps/jwlawrence/keymap.c | 84 +++++++++++----------- keyboards/zen/keymaps/xyverz/keymap.c | 114 +++++++++++++++--------------- keyboards/zen/readme.md | 24 ++++--- keyboards/zen/rev1/rev1.h | 2 +- keyboards/zen/zen.h | 18 +---- 7 files changed, 168 insertions(+), 170 deletions(-) create mode 100644 keyboards/zen/info.json diff --git a/keyboards/zen/info.json b/keyboards/zen/info.json new file mode 100644 index 0000000000..f312529edc --- /dev/null +++ b/keyboards/zen/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Zen", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0.5, "y":0}, {"label":"k01", "x":1.5, "y":0}, {"label":"k02", "x":2.5, "y":0}, {"label":"k03", "x":3.5, "y":0}, {"label":"k04", "x":4.5, "y":0}, {"label":"k05", "x":5.5, "y":0}, {"label":"k55", "x":10.5, "y":0}, {"label":"k54", "x":11.5, "y":0}, {"label":"k53", "x":12.5, "y":0}, {"label":"k52", "x":13.5, "y":0}, {"label":"k51", "x":14.5, "y":0}, {"label":"k50", "x":15.5, "y":0}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k65", "x":10.5, "y":1}, {"label":"k64", "x":11.5, "y":1}, {"label":"k63", "x":12.5, "y":1}, {"label":"k62", "x":13.5, "y":1}, {"label":"k61", "x":14.5, "y":1}, {"label":"k60", "x":15.5, "y":1, "w":1.5}, {"label":"k20", "x":0, "y":2, "w":1.5}, {"label":"k21", "x":1.5, "y":2}, {"label":"k22", "x":2.5, "y":2}, {"label":"k23", "x":3.5, "y":2}, {"label":"k24", "x":4.5, "y":2}, {"label":"k25", "x":5.5, "y":2}, {"label":"k75", "x":10.5, "y":2}, {"label":"k74", "x":11.5, "y":2}, {"label":"k73", "x":12.5, "y":2}, {"label":"k72", "x":13.5, "y":2}, {"label":"k71", "x":14.5, "y":2}, {"label":"k70", "x":15.5, "y":2, "w":1.5}, {"label":"k30", "x":0, "y":3, "w":1.5}, {"label":"k31", "x":1.5, "y":3}, {"label":"k32", "x":2.5, "y":3}, {"label":"k33", "x":3.5, "y":3}, {"label":"k34", "x":4.5, "y":3}, {"label":"k35", "x":5.5, "y":3}, {"label":"k85", "x":10.5, "y":3}, {"label":"k84", "x":11.5, "y":3}, {"label":"k83", "x":12.5, "y":3}, {"label":"k82", "x":13.5, "y":3}, {"label":"k81", "x":14.5, "y":3}, {"label":"k80", "x":15.5, "y":3, "w":1.5}, {"label":"k40", "x":0, "y":4, "w":1.5}, {"label":"k41", "x":1.5, "y":4}, {"label":"k42", "x":2.5, "y":4}, {"label":"k43", "x":3.5, "y":4}, {"label":"k44", "x":4.5, "y":4}, {"label":"k45", "x":6, "y":4.5, "h":2}, {"label":"k46", "x":7, "y":4.5, "h":2}, {"label":"k96", "x":9, "y":4.5, "h":2}, {"label":"k95", "x":10, "y":4.5, "h":2}, {"label":"k94", "x":11.5, "y":4}, {"label":"k93", "x":12.5, "y":4}, {"label":"k92", "x":13.5, "y":4}, {"label":"k91", "x":14.5, "y":4}, {"label":"k90", "x":15.5, "y":4, "w":1.5}] + } + } +} diff --git a/keyboards/zen/keymaps/default/keymap.c b/keyboards/zen/keymaps/default/keymap.c index a955e892f4..e9e7d798ca 100644 --- a/keyboards/zen/keymaps/default/keymap.c +++ b/keyboards/zen/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "zen.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -24,47 +22,47 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | - * `------------------------------------------------''-----------------------------------------------' - */ -[_QWERTY] = KEYMAP( \ - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - LT(_NAV, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ -), + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBTOG| NAV |Space |Delete||Enter|Space | NAV | - | = | PGUP | PGDN | + * `------------------------------------------------''-----------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, KC_PGUP, KC_PGDN \ + ), -/* NAV - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |Shift | | | | | | | NKRO | | | Pause| Back | Next | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| - * `------------------------------------------------''-----------------------------------------------' - */ -[_NAV] = KEYMAP( \ - 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_TRNS, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME , \ - KC_TRNS, RGB_HUD, RGB_VAD, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END , \ - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MAGIC_TOGGLE_NKRO, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT , \ - KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_VOLD \ -), + /* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI| | | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |RGBMOD| | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ + [_NAV] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ + ), }; diff --git a/keyboards/zen/keymaps/jwlawrence/keymap.c b/keyboards/zen/keymaps/jwlawrence/keymap.c index ca70567188..1ca9b78c0f 100644 --- a/keyboards/zen/keymaps/jwlawrence/keymap.c +++ b/keyboards/zen/keymaps/jwlawrence/keymap.c @@ -1,6 +1,4 @@ -#include "zen.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -24,47 +22,47 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty - * ,-----------------------------------------. .-----------------------------------------. - * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | GUI | NAV |Space |Delete||Enter|Space | NAV | - | = |RGBTOG|Enter | - * `------------------------------------------------''-----------------------------------------------' - */ -[_QWERTY] = KEYMAP( \ - KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - LT(_NAV, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, RGB_TOG, KC_ENT \ -), + /* Qwerty + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |CAPS(NAV)|A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | GUI | NAV |Space |Delete||Enter|Space | NAV | - | = |RGBTOG|Enter | + * `------------------------------------------------''-----------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + LT(_NAV, 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_LGUI, MO(_NAV), KC_SPC, KC_DEL, KC_ENT, KC_SPACE, MO(_NAV), KC_MINS, KC_EQL, RGB_TOG, KC_ENT \ + ), -/* NAV - * ,-----------------------------------------. .-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | |RGBHUD|RGBVAD|RGBHUI|RGBMOD| | | | Left | Down | Right|Delete| End | - * |------+------+------+------+------+------| |------+------+------+------+------+------| - * |Shift | | | | | | | NKRO | | | Pause| Back | Next | - * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| - * | Ctrl | Alt | GUI | | | | || | | | | Mute | VOLUP| VOLDN| - * `------------------------------------------------''-----------------------------------------------' - */ -[_NAV] = KEYMAP( \ - 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_TRNS, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME , \ - KC_TRNS, RGB_HUD, RGB_VAD, RGB_HUI, RGB_MOD, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END , \ - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MAGIC_TOGGLE_NKRO, KC_TRNS, KC_TRNS, KC_MPLY, KC_MPRV, KC_MNXT , \ - KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLU, KC_VOLD \ -), + /* NAV + * ,-----------------------------------------. .-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBSAI|RGBVAI|RGBSAD| RESET| [ | | ] | Pgup | Up | Pgdn |Insert| Home | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGBHUD|RGBVAD|RGBHUI|RGBMOD| | | | Left | Down | Right|Delete| End | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |Shift | | | | | | | NKRO | | | Pause| Back | Next | + * |------+------+------+------+------+------+------..-----+------+------+------+------+------+------| + * | Ctrl | Alt | GUI | | | | || | | | | Mute | VOLUP| VOLDN| + * `------------------------------------------------''-----------------------------------------------' + */ + [_NAV] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAI, RGB_VAI, RGB_SAD, RESET, KC_LBRC, KC_RBRC, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGB_MOD, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, \ + KC_LSFT, _______, _______, _______, _______, _______, MAGIC_TOGGLE_NKRO, _______, _______, KC_MPLY, KC_MPRV, KC_MNXT, \ + KC_LCTL, KC_LALT, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLU, KC_VOLD \ + ), }; diff --git a/keyboards/zen/keymaps/xyverz/keymap.c b/keyboards/zen/keymaps/xyverz/keymap.c index 2180a7459c..8879fbb5ff 100644 --- a/keyboards/zen/keymaps/xyverz/keymap.c +++ b/keyboards/zen/keymaps/xyverz/keymap.c @@ -16,9 +16,7 @@ TODO: */ -#include "zen.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -55,61 +53,61 @@ enum atreus52_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_DVORAK] = KEYMAP( \ - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ - 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_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ -), - -[_QWERTY] = KEYMAP( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ - 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ -), - -[_COLEMAK] = KEYMAP( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ - KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ -), - -[_WOW] = KEYMAP( \ - KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ - 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_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, CTLBSPC, KC_LALT, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ -), - -[_LOWER] = KEYMAP( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ - KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ -), - -[_RAISE] = KEYMAP( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ - KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ - KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ - _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ - _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ -), - -[_ADJUST] = KEYMAP( \ - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_SNK, _______, QWERTY, COLEMAK, DVORAK, WOW, _______, \ - RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -), + [_DVORAK] = LAYOUT( \ + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ + 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_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ + ), + + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL , \ + 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_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ + ), + + [_COLEMAK] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , \ + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, KC_BSPC, KC_LGUI, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_RGUI, KC_RCTL, RAISE \ + ), + + [_WOW] = LAYOUT( \ + KC_RBRC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_LBRC, \ + 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_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + LOWER, KC_LCTL, KC_LALT, KC_LEFT, KC_RGHT, CTLBSPC, KC_LALT, KC_ENT, KC_SPC, KC_UP, KC_DOWN, KC_SLSH, KC_EQL, RAISE \ + ), + + [_LOWER] = LAYOUT( \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ + KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ + ), + + [_RAISE] = LAYOUT( \ + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12 , \ + KC_TILD, KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, \ + KC_CAPS, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, _______, _______, KC_HOME, KC_END, KC_DEL, _______, _______, KC_INS, KC_PGUP, KC_PGDN, _______, _______, _______ \ + ), + + [_ADJUST] = LAYOUT( \ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_SNK, _______, QWERTY, COLEMAK, DVORAK, WOW, _______, \ + RGB_TOG, RGB_MOD, RGB_SWR, RGB_M_K, RGB_M_G, RGB_HUI, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), }; diff --git a/keyboards/zen/readme.md b/keyboards/zen/readme.md index 36c63d2933..beb5e13ac1 100644 --- a/keyboards/zen/readme.md +++ b/keyboards/zen/readme.md @@ -1,12 +1,20 @@ -Zen Keyboard -==== +# Zen Keyboard A split ergo keyboard with a few goals in mind: - - Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen is only 8.0mm thick. - - Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholiniear, Atreus62, and Ergodox, this is the best layout for gaming and typing. - - RGB backlighting. 16 WS2812b LEDs shine through the perimeter switches. The SK6812 variant are cheap and easy to solder. - - Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. -A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/) +- Be as thin as possible. Other split KBs (Let's Split, Nyquist, Iris) are 15.2mm thick. The Zen is only 8.0mm thick. +- Layout designed for gaming. 1.5u pinky keys, ortho alphas, and angled thumb keys. After trying Ortholinear, Atreus62, and Ergodox, this is the best layout for gaming and typing. +- RGB backlighting. 16 WS2812b LEDs shine through the perimeter switches. The SK6812 variant are cheap and easy to solder. +- Price. Using Arduino Pro Micro, SK6812 LEDs, and PCB FR4 for the case, the cost of each half without switches or caps can be reduced to under $20 when purchased at volume. -Maintained by u/legonut3 \ No newline at end of file +Keyboard Maintainer: [Legonut](https://github.com/Legonut) +Hardware Supported: Zen rev1 +Hardware Availability: [RGBKB.net](https://www.rgbkb.net/) + +A build guide and more info for this keyboard can be found here: [Zen Build Guide](https://legonut.gitbooks.io/zen-keyboard/content/). + +Make example for this keyboard (after setting up your build environment): + + make zen/rev1:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/zen/rev1/rev1.h b/keyboards/zen/rev1/rev1.h index 4983bb2a30..c2444f047f 100644 --- a/keyboards/zen/rev1/rev1.h +++ b/keyboards/zen/rev1/rev1.h @@ -17,7 +17,7 @@ //void promicro_bootloader_jmp(bool program); -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k55, k54, k53, k52, k51, k50, \ k10, k11, k12, k13, k14, k15, k65, k64, k63, k62, k61, k60, \ k20, k21, k22, k23, k24, k25, k75, k74, k73, k72, k71, k70, \ diff --git a/keyboards/zen/zen.h b/keyboards/zen/zen.h index 4560ff8cda..56fc64fe26 100644 --- a/keyboards/zen/zen.h +++ b/keyboards/zen/zen.h @@ -4,20 +4,4 @@ #include "rev1.h" #include "quantum.h" -// Used to create a keymap using only KC_ prefixed keys -#define KC_KEYMAP( \ - L00, L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, R06,\ - L10, L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, R16,\ - L20, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, R26,\ - L30, L31, L32, L33, L34, L35, R31, R32, R33, R34, R35, R36,\ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - KEYMAP( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46, \ - ) - -#endif \ No newline at end of file +#endif -- cgit v1.2.3 From 9175eebc8796f31a481ba16b1ca2ba9e4432502e Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Fri, 17 Aug 2018 16:11:21 -0700 Subject: Keymap: Wanleg userspace (#3670) * configure wanleg userspace * additional layout support * additional layout support * userspace edits * fix swap hands between 30 and 40 percent * add additional keymaps * userspace edits * userspace configuration * userspace configuration * Update readme.md * userspace work * swap hands userspace fix * made requested edits * Update readme.md * use relative paths instead of copying file * Update wanleg.h * fixing layer order --- keyboards/gherkin/keymaps/wanleg/config.h | 24 -- keyboards/gherkin/keymaps/wanleg/keymap.c | 218 ------------------ keyboards/gherkin/keymaps/wanleg/readme.md | 86 ------- keyboards/gherkin/keymaps/wanleg/rules.mk | 7 - layouts/community/ortho_3x10/layout.json | 3 + layouts/community/ortho_3x10/readme.md | 3 + layouts/community/ortho_3x10/wanleg/config.h | 9 + layouts/community/ortho_3x10/wanleg/keymap.c | 29 +++ layouts/community/ortho_3x10/wanleg/readme.md | 83 +++++++ layouts/community/ortho_3x10/wanleg/rules.mk | 3 + layouts/community/ortho_4x12/wanleg/config.h | 15 ++ layouts/community/ortho_4x12/wanleg/keymap.c | 67 ++++++ layouts/community/ortho_4x12/wanleg/readme.md | 24 ++ layouts/community/ortho_4x12/wanleg/rules.mk | 6 + layouts/community/ortho_5x15/wanleg/config.h | 3 + layouts/community/ortho_5x15/wanleg/keymap.c | 176 +++++++++++++++ layouts/community/ortho_5x15/wanleg/rules.mk | 1 + users/wanleg/config.h | 32 +++ users/wanleg/readme.md | 14 ++ users/wanleg/rules.mk | 19 ++ users/wanleg/tapdances.c | 110 +++++++++ users/wanleg/wanleg.c | 158 +++++++++++++ users/wanleg/wanleg.h | 308 ++++++++++++++++++++++++++ 23 files changed, 1063 insertions(+), 335 deletions(-) delete mode 100644 keyboards/gherkin/keymaps/wanleg/config.h delete mode 100644 keyboards/gherkin/keymaps/wanleg/keymap.c delete mode 100644 keyboards/gherkin/keymaps/wanleg/readme.md delete mode 100644 keyboards/gherkin/keymaps/wanleg/rules.mk create mode 100644 layouts/community/ortho_3x10/layout.json create mode 100644 layouts/community/ortho_3x10/readme.md create mode 100644 layouts/community/ortho_3x10/wanleg/config.h create mode 100644 layouts/community/ortho_3x10/wanleg/keymap.c create mode 100644 layouts/community/ortho_3x10/wanleg/readme.md create mode 100644 layouts/community/ortho_3x10/wanleg/rules.mk create mode 100644 layouts/community/ortho_4x12/wanleg/config.h create mode 100644 layouts/community/ortho_4x12/wanleg/keymap.c create mode 100644 layouts/community/ortho_4x12/wanleg/readme.md create mode 100644 layouts/community/ortho_4x12/wanleg/rules.mk create mode 100644 layouts/community/ortho_5x15/wanleg/config.h create mode 100644 layouts/community/ortho_5x15/wanleg/keymap.c create mode 100644 layouts/community/ortho_5x15/wanleg/rules.mk create mode 100644 users/wanleg/config.h create mode 100644 users/wanleg/readme.md create mode 100644 users/wanleg/rules.mk create mode 100644 users/wanleg/tapdances.c create mode 100644 users/wanleg/wanleg.c create mode 100644 users/wanleg/wanleg.h diff --git a/keyboards/gherkin/keymaps/wanleg/config.h b/keyboards/gherkin/keymaps/wanleg/config.h deleted file mode 100644 index 98e2b23380..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/config.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" -#endif - -#define PREVENT_STUCK_MODIFIERS - -//Tap Dance Prerequisite -#define TAPPING_TERM 200 - -//Mousekeys Settings -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 - -/* for QMK DFU bootloader */ -/* not required if using default ProMicro bootloader */ -/* set top left key as bootloader mode escape key */ -#define QMK_ESC_OUTPUT B4 // usually COL -#define QMK_ESC_INPUT F7 // usually ROW -#define QMK_LED B0 \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/wanleg/keymap.c b/keyboards/gherkin/keymaps/wanleg/keymap.c deleted file mode 100644 index 108ed40e53..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/keymap.c +++ /dev/null @@ -1,218 +0,0 @@ -/* Copyright 2017 Brian Fong - * - * 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 . - */ -#include QMK_KEYBOARD_H - -// 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 _QW 0 -#define DIR 1 -#define NUM 2 -#define ETC 3 - -// Readability keycodes -#define _______ KC_TRNS - - -/////////////// TAP DANCE SECTION START /////////////// -//Tap Dance Declarations (list of my tap dance configurations) -enum { - TD_SFT_CAPS = 0 - ,TD_Q_ESC - ,ENT_TAP_DANCE - ,DEL_TAP_DANCE -}; - -///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START ///// -///// (no need to edit this section) ///// -//Enums used to clearly convey the state of the tap dance -enum { - SINGLE_TAP = 1, - SINGLE_HOLD = 2, - DOUBLE_TAP = 3, - DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP - // Add more enums here if you want for triple, quadruple, etc. -}; - -typedef struct { - bool is_press_action; - int state; -} tap; - -int cur_dance (qk_tap_dance_state_t *state) { - if (state->count == 1) { - //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP - if (state->interrupted || !state->pressed) return SINGLE_TAP; - if (state->interrupted) return SINGLE_TAP; - else return SINGLE_HOLD; - } - //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated - //with single tap. - else if (state->count == 2) { - if (state->interrupted) return DOUBLE_SINGLE_TAP; - else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } - else return 6; //magic number. At some point this method will expand to work for more presses -} -///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// -///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// -//instantialize an instance of 'tap' for the 'ENT' tap dance. -static tap ENTtap_state = { - .is_press_action = true, - .state = 0 -}; - -void ENT_finished (qk_tap_dance_state_t *state, void *user_data) { - ENTtap_state.state = cur_dance(state); - switch (ENTtap_state.state) { - case SINGLE_TAP: register_code(KC_SPC); break; - case SINGLE_HOLD: register_code(KC_LSFT); break; - case DOUBLE_TAP: register_code(KC_ENT); break; - case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want) - case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); - //Last case is for fast typing. Assuming your key is `f`: - //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. - //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. - } -} - -void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (ENTtap_state.state) { - case SINGLE_TAP: unregister_code(KC_SPC); break; - case SINGLE_HOLD: unregister_code(KC_LSFT); break; - case DOUBLE_TAP: unregister_code(KC_ENT); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC); - } - ENTtap_state.state = 0; -} - -//instanalize an instance of 'tap' for the 'DEL' tap dance. -static tap DELtap_state = { - .is_press_action = true, - .state = 0 -}; - -void DEL_finished (qk_tap_dance_state_t *state, void *user_data) { - DELtap_state.state = cur_dance(state); - switch (DELtap_state.state) { - case SINGLE_TAP: register_code(KC_BSPC); break; - case SINGLE_HOLD: register_code(KC_LCTL); break; - case DOUBLE_TAP: register_code(KC_DEL); break; - case DOUBLE_HOLD: register_code(KC_NO); break; - case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC); - } -} - -void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (DELtap_state.state) { - case SINGLE_TAP: unregister_code(KC_BSPC); break; - case SINGLE_HOLD: unregister_code(KC_LCTL); break; - case DOUBLE_TAP: unregister_code(KC_DEL); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); - } - DELtap_state.state = 0; -} -///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// - -//Tap Dance Definitions -//THIS SECTION HAS TO BE AT THE END OF THE TAP DANCE SECTION -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) -// Other declarations would go here, separated by commas, if you have them - ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) - ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) - ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) -}; - -//In Layer declaration, add tap dance item in place of a key code -//TD(TD_SFT_CAPS) - -///////////// TAP DANCE SECTION END /////////////// - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * .-----------------------------------------------------------------------------------------. - * | Q//ESC | W | E | R | T | Y | U | I | O | P | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | A | S | D | F | G | H | J | K | L | SPACE | - * | | | | | | | | | |SFThold | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC | - * | SFThold| | | | | | | | |CTRLhold| - * '-----------------------------------------------------------------------------------------' - */ - [_QW] = LAYOUT_ortho_3x10( /* Qwerty*/ - TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC), - SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) - ), - - /* - * Directional Modifiers - * .-----------------------------------------------------------------------------------------. - * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | P-Brk | | | | | | | RGUI | ALT | / | - * '-----------------------------------------------------------------------------------------' - */ - [DIR] = LAYOUT_ortho_3x10( /* Directional Modifiers */ - KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, - KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, - KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH - ), - - /* - * Numbers - * .-----------------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC | - * | | | | | | | | | |CTRLhold| - * '-----------------------------------------------------------------------------------------' - */ - [NUM] = LAYOUT_ortho_3x10 ( /* Numbers */ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) - ), - - /* - * ETC - * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mUp | mDown | | \ | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Sft//Cp| | | | | C-A-D | mLeft | mRight | ALT | DEL | - * '-----------------------------------------------------------------------------------------' - */ - [ETC] = LAYOUT_ortho_3x10( /* ETC */ - KC_GRV, KC_MS_U, _______, _______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS, - KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT, - TD(TD_SFT_CAPS), _______, _______, _______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL - ), - -}; diff --git a/keyboards/gherkin/keymaps/wanleg/readme.md b/keyboards/gherkin/keymaps/wanleg/readme.md deleted file mode 100644 index 0b1b099c4a..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/readme.md +++ /dev/null @@ -1,86 +0,0 @@ -![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) -# Gherkin Wanleg Layout -This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. -I originally set up a few Tap Dance keys, but dropped half of them in favor of chorded versions since in actual use, they tended to impede typing speed more than their current two-key versions. -I've left them in my `keymap.c` ready for use if anyone wants to try them out: - -Legend Name | Single Tap | Double Tap | Hold ---- | --- | --- | --- -*null* | space | enter | shift -*null* | backspace | delete | control -Sft//Cp | shift | caps lock | *null* -Q//Esc | KC_Q | escape | *null* - -# Gherkin Flashing -## Windows -1. The standard Gherkin uses a ProMicro (or clone) microcontroller, which has the Caterina bootloader by default. -2. If you have never flashed your ProMicro with QMK before, you will need to short the RST pin to GND to put it into bootloader mode (you only have 7 seconds to flash once it enters bootloader mode). You may need to touch the RST pin to GND **TWICE** in quick succession if it doesn't flash with just one touch. -3. Once connected to your computer, you should be able to flash using -`make gherkin:wanleg:avrdude` -4. Once you've been able to successfully flash the ProMicro, you should be able to use the `RESET` key for future flashes instead of shorting the RST pin. - -## Linux -### First Flash with QMK -The built-in `:avrdude` QMK target in Linux doesn't work with the default Caterina bootloader on the ProMicro, so we have to use avrdude separately. The instructions below are adapted from https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html - -1. To flash the device, you need to have AVRdude installed. You can do this via your distro's package manager (or compile from source if needed). -2. Once avrdude has been installed, open a terminal and run -`ls /dev/tty*` -3. Next, plug in your device and re-run `ls /dev/tty*` -There should be one more device than was seen previously. Make a note of it. For me, it's `/dev/ttyACM0`. -4. Navigate to the directory with your `.hex` file in it. Touch the RST pin to GND **TWICE** in quick succession, then run the following within 7 seconds: -`sudo avrdude -p m32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:YOUR_FILENAME.hex` -Replace YOUR_SERIAL_PORT with your serial port's device name, and YOUR_FILENAME.hex with the appropriate filename. For me, it looks like this: -`sudo avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:gherkin_wanleg.hex` -If you miss the 7 second window, the ProMicro will leave bootloader mode and the flash will fail. Hit `Control` + `C` to exit the `avrdude` command, connect RST to GND twice quickly, and try the `avrdude` command again. - -### Subsequent Flashes with QMK -1. Re-flashing is similar to the initial flash procedure. Plug in your keyboard, open a terminal and run -`ls /dev/tty*` -2. Next, hit the `RESET` key on your keyboard and re-run the `ls /dev/tty*` command to find your keyboard's serial port. -3. Flash your keyboard with the avrdude command you used for the initial flash within 7 seconds after hitting `RESET`. - -# ProMicro Bootloader Replacement (Caterina to QMK DFU) -If you have an Arduino (or clone), you can replace the bootloader for a few extra features (e.g. no more 7 second "flash window", simplified Linux flashing, blinking LED when the ProMicro is in bootloader mode, ability to exit bootloader mode without unplugging your keyboard, among others). -The instructions below have been adapted from https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) -## Arduino Setup -1. Upload the ArduinoISP sketch onto your Arduino board (https://www.arduino.cc/en/Tutorial/ArduinoISP). -2. Wire the Arduino to the ProMicro - -| Arduino | ProMicro | -| --- | --- | -| 10 | RST | -| 11 | 16 | -| 12 | 14 | -| 13 | 15 | -| GND | GND | -| 5V | VCC | - -## Make the QMK DFU .hex -3. In `config.h` add the following. This is already set up in `qmk_firmware/keyboards/gherkin/wanleg`. You only need to do this on other keymaps. -``` -#define QMK_ESC_OUTPUT B4 -#define QMK_ESC_INPUT F7 -#define QMK_LED B0 -``` -The `QMK_ESC_` lines define where the bootloader escape key is. Refer to the `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` lines in your keyboard's `config.h` to choose your preferred key. -You hit the bootloader escape key to exit bootloader mode after you've hit the RESET key to enter bootloader mode (e.g. if you change your mind and don't want to flash just then). -On a Gherkin, B4/F7 corresponds to the top-left corner key. -`B0` is an indicator light on one of the ProMicro's onboard LEDs. With QMK DFU, it will flash to indicate the ProMicro is in bootloader mode. -You can add `#define QMK_SPEAKER C6` if you have a speaker hooked up to pin C6. The Gherkin PCB already uses pin C6 in its switch layout, so you cannot use a speaker on a standard Gherkin. -4. Also, you should add `BOOTLOADER = qmk-dfu` to your `rules.mk` file, so it is flagged properly. Again, this is already set up in `qmk_firmware/keyboards/gherkin/wanleg`. -5. Once you've made the required edits, it's time to compile the firmware. If you use the `:production` target when compiling, it will produce the usual `.hex` file as well as `_bootloader.hex` and `_production.hex` files. The `_production.hex` will be what we want. This contains the bootloader and the firmware, so we only have to flash once (rather than flash the bootloader, and THEN flash the firmware). -For example -`make ::production` -For my particular keymap, for reasons listed in the **Using QMK DFU** section, you should use the following to ensure the bootloader is set properly -`make gherkin:wanleg:production dfu=qmk` - -## Burn QMK DFU -6. Navigate to the directory with your `_production.hex` file, and burn it with the following command -`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U YOUR_production.hex -P comPORT` -Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. - -## Using QMK DFU -7. Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with -`make gherkin::dfu dfu=qmk` -The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` diff --git a/keyboards/gherkin/keymaps/wanleg/rules.mk b/keyboards/gherkin/keymaps/wanleg/rules.mk deleted file mode 100644 index 7f2ff33277..0000000000 --- a/keyboards/gherkin/keymaps/wanleg/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -TAP_DANCE_ENABLE = yes # Enable Tap Dance (comment if not being implemented) - -#If ProMicro has QMK DFU bootloader instead of Caterina, -#run "make : dfu=qmk" when compiling to ensure it is flagged properly after being flashed -ifeq ($(strip $(dfu)), qmk) - BOOTLOADER = qmk-dfu -endif \ No newline at end of file diff --git a/layouts/community/ortho_3x10/layout.json b/layouts/community/ortho_3x10/layout.json new file mode 100644 index 0000000000..6600f32a6a --- /dev/null +++ b/layouts/community/ortho_3x10/layout.json @@ -0,0 +1,3 @@ +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""] diff --git a/layouts/community/ortho_3x10/readme.md b/layouts/community/ortho_3x10/readme.md new file mode 100644 index 0000000000..e0a31cdf63 --- /dev/null +++ b/layouts/community/ortho_3x10/readme.md @@ -0,0 +1,3 @@ +# ortho_3x10 + + LAYOUT_ortho_3x10 diff --git a/layouts/community/ortho_3x10/wanleg/config.h b/layouts/community/ortho_3x10/wanleg/config.h new file mode 100644 index 0000000000..6719a4591e --- /dev/null +++ b/layouts/community/ortho_3x10/wanleg/config.h @@ -0,0 +1,9 @@ +#pragma once + +//QMK DFU settings (ProMicro boards) +// set top left key as bootloader mode escape key on Gherkin +#if defined(KEYBOARD_gherkin) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT B4 // usually COL +#define QMK_ESC_INPUT F7 // usually ROW +#endif diff --git a/layouts/community/ortho_3x10/wanleg/keymap.c b/layouts/community/ortho_3x10/wanleg/keymap.c new file mode 100644 index 0000000000..44be300a41 --- /dev/null +++ b/layouts/community/ortho_3x10/wanleg/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[gGK] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________ +), + +[gNUM] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________ +), + +[gDIR] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________ +), + +[gETC] = LAYOUT_ortho_3x10_wrapper( + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________ +), + +}; diff --git a/layouts/community/ortho_3x10/wanleg/readme.md b/layouts/community/ortho_3x10/wanleg/readme.md new file mode 100644 index 0000000000..ef6c1f9dbb --- /dev/null +++ b/layouts/community/ortho_3x10/wanleg/readme.md @@ -0,0 +1,83 @@ +![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) +# Gherkin Wanleg Layout +This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. +I originally set up a few Tap Dance keys, but dropped half of them in favor of chorded versions since in actual use, they tended to impede typing speed more than their current two-key versions. +I've left them in my `keymap.c` ready for use if anyone wants to try them out: + +Legend Name | Single Tap | Double Tap | Hold +--- | --- | --- | --- +*null* | space | enter | shift +*null* | backspace | delete | control +Sft//Cp | shift | caps lock | *null* +Q//Esc | KC_Q | escape | *null* + +# Gherkin Flashing +## Windows +1. The standard Gherkin uses a ProMicro (or clone) microcontroller, which has the Caterina bootloader by default. +2. If you have never flashed your ProMicro with QMK before, you will need to short the RST pin to GND to put it into bootloader mode (you only have 7 seconds to flash once it enters bootloader mode). You may need to touch the RST pin to GND **TWICE** in quick succession if it doesn't flash with just one touch. +3. Once connected to your computer, you should be able to flash using +`make gherkin:wanleg:avrdude` +4. Once you've been able to successfully flash the ProMicro, you should be able to use the `RESET` key for future flashes instead of shorting the RST pin. + +## Linux +### First Flash with QMK +The built-in `:avrdude` QMK target in Linux doesn't work with the default Caterina bootloader on the ProMicro, so we have to use avrdude separately. The instructions below are adapted from https://deskthority.net/workshop-f7/how-to-use-a-pro-micro-as-a-cheap-controller-converter-like-soarer-s-t8448.html + +1. To flash the device, you need to have AVRdude installed. You can do this via your distro's package manager (or compile from source if needed). +2. Once avrdude has been installed, open a terminal and run +`ls /dev/tty*` +3. Next, plug in your device and re-run `ls /dev/tty*` +There should be one more device than was seen previously. Make a note of it. For me, it's `/dev/ttyACM0`. +4. Navigate to the directory with your `.hex` file in it. Touch the RST pin to GND **TWICE** in quick succession, then run the following within 7 seconds: +`sudo avrdude -p m32u4 -P YOUR_SERIAL_PORT -c avr109 -U flash:w:YOUR_FILENAME.hex` +Replace YOUR_SERIAL_PORT with your serial port's device name, and YOUR_FILENAME.hex with the appropriate filename. For me, it looks like this: +`sudo avrdude -p m32u4 -P /dev/ttyACM0 -c avr109 -U flash:w:gherkin_wanleg.hex` +If you miss the 7 second window, the ProMicro will leave bootloader mode and the flash will fail. Hit `Control` + `C` to exit the `avrdude` command, connect RST to GND twice quickly, and try the `avrdude` command again. + +### Subsequent Flashes with QMK +1. Re-flashing is similar to the initial flash procedure. Plug in your keyboard, open a terminal and run +`ls /dev/tty*` +2. Next, hit the `RESET` key on your keyboard and re-run the `ls /dev/tty*` command to find your keyboard's serial port. +3. Flash your keyboard with the avrdude command you used for the initial flash within 7 seconds after hitting `RESET`. + +# ProMicro Bootloader Replacement (Caterina to QMK DFU) +If you have an Arduino (or clone), you can replace the bootloader for a few extra features (e.g. no more 7 second "flash window", simplified Linux flashing, blinking LED when the ProMicro is in bootloader mode, ability to exit bootloader mode without unplugging your keyboard, among others). +The instructions below have been adapted from https://www.reddit.com/r/olkb/comments/8sxgzb/replace_pro_micro_bootloader_with_qmk_dfu/) +## Arduino Setup +1. Upload the ArduinoISP sketch onto your Arduino board (https://www.arduino.cc/en/Tutorial/ArduinoISP). +2. Wire the Arduino to the ProMicro + +| Arduino | ProMicro | +| --- | --- | +| 10 | RST | +| 11 | 16 | +| 12 | 14 | +| 13 | 15 | +| GND | GND | +| 5V | VCC | + +## Make the QMK DFU .hex +3. In `config.h` add the following. This is already set up in `qmk_firmware/layouts/community/ortho_3x10/wanleg`. You only need to do this on other keymaps. +``` +#define QMK_ESC_OUTPUT B4 +#define QMK_ESC_INPUT F7 +#define QMK_LED B0 +``` +The `QMK_ESC_` lines define where the bootloader escape key is. Refer to the `MATRIX_ROW_PINS` and `MATRIX_COL_PINS` lines in your keyboard's `config.h` to choose your preferred key. +You hit the bootloader escape key to exit bootloader mode after you've hit the RESET key to enter bootloader mode (e.g. if you change your mind and don't want to flash just then). +On a Gherkin, B4/F7 corresponds to the top-left corner key. +`B0` is an indicator light on one of the ProMicro's onboard LEDs. With QMK DFU, it will flash to indicate the ProMicro is in bootloader mode. +You can add `#define QMK_SPEAKER C6` if you have a speaker hooked up to pin C6. The Gherkin PCB already uses pin C6 in its switch layout, so you cannot use a speaker on a standard Gherkin. +4. Also, you should add `BOOTLOADER = qmk-dfu` to your `rules.mk` file, so it is flagged properly. Again, this is already set up in `qmk_firmware/layouts/community/ortho_3x10/wanleg`. +5. Once you've made the required edits, it's time to compile the firmware. If you use the `:production` target when compiling, it will produce the usual `.hex` file as well as `_bootloader.hex` and `_production.hex` files. The `_production.hex` will be what we want. This contains the bootloader and the firmware, so we only have to flash once (rather than flash the bootloader, and THEN flash the firmware). +For example +`make ::production` + +## Burn QMK DFU +6. Navigate to the directory with your `_production.hex` file, and burn it with the following command +`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U YOUR_production.hex -P comPORT` +Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. + +## Using QMK DFU +7. Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with +`make gherkin::dfu` diff --git a/layouts/community/ortho_3x10/wanleg/rules.mk b/layouts/community/ortho_3x10/wanleg/rules.mk new file mode 100644 index 0000000000..90841d2abe --- /dev/null +++ b/layouts/community/ortho_3x10/wanleg/rules.mk @@ -0,0 +1,3 @@ +SWAP_HANDS_ENABLE = no + +BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h new file mode 100644 index 0000000000..2c6fcc75f0 --- /dev/null +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -0,0 +1,15 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +//QMK DFU settings (ProMicro boards) +// set top left key as bootloader mode escape key on Lets Split rev2 +#if defined(KEYBOARD_lets_split_rev2) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define USE_SERIAL +#undef USE_I2C +#define EE_HANDS +#endif + +#endif diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c new file mode 100644 index 0000000000..43cae711ac --- /dev/null +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -0,0 +1,67 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +#if defined(KEYBOARD_lets_split_rev2) +[_GK] = LAYOUT_ortho_4x12_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + _______________GherkinLike_3_OneHand_______ +), +[ONE] = LAYOUT_ortho_4x12_wrapper( + _______________Qwerty_Row__0_______________, + _______________Qwerty_Row__1_______________, + _______________Qwerty_Row__2_______________, + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), KC_SPC, SUPRA, KC_RGUI, KC_RALT, KC_RGUI, KC_RCTL +), +#else +[_GK] = LAYOUT_ortho_4x12_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + _______________GherkinLike_3_______________ +), +#endif +[_QW] = LAYOUT_ortho_4x12_wrapper( + _______________Qwerty_Row__0_______________, + _______________Qwerty_Row__1_______________, + _______________Qwerty_Row__2_______________, + _______________Qwerty_Row__3_______________ +), + +[SUP] = LAYOUT_ortho_4x12_wrapper( + ________________SUPRA_Row_0________________, + ________________SUPRA_Row_1________________, + ________________SUPRA_Row_2________________, + ________________SUPRA_Row_3________________ +), + +[SUB] = LAYOUT_ortho_4x12_wrapper( + _______________SUBTER_Row__0_______________, + _______________SUBTER_Row__1_______________, + _______________SUBTER_Row__2_______________, + _______________SUBTER_Row__3_______________ +), + +[NUM] = LAYOUT_ortho_4x12_wrapper( + _______________NUMBERS_Row_0_______________, + _______________NUMBERS_Row_1_______________, + _______________NUMBERS_Row_2_______________, + _______________NUMBERS_Row_3_______________ +), + +[DIR] = LAYOUT_ortho_4x12_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _____________DIRECTIONS_Row__3_____________ +), + +[ETC] = LAYOUT_ortho_4x12_wrapper( + ______________ETCETERA_Row__0______________, + ______________ETCETERA_Row__1______________, + ______________ETCETERA_Row__2______________, + ______________ETCETERA_Row__3______________ +), +}; diff --git a/layouts/community/ortho_4x12/wanleg/readme.md b/layouts/community/ortho_4x12/wanleg/readme.md new file mode 100644 index 0000000000..2f89d1de61 --- /dev/null +++ b/layouts/community/ortho_4x12/wanleg/readme.md @@ -0,0 +1,24 @@ +# Let's Split Flashing +(More information at `qmk_firmware/layouts/community/ortho_3x10/wanleg/readme.md`) +## Make the QMK DFU .hex +`make lets_split/rev2:wanleg:production dfu=qmk` + +## Burning EEPROM settings and Firmware +Navigate to the directory with your .hex file and the `eeprom-lefthand.eep` and `eeprom-righthand.eep` files in it. +**Burn Left Side With QMK DFU and Firmware** +`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U eeprom:w:eeprom-lefthand.eep -P comPORT -U flash:w:YOUR_production.hex:a` + +**Burn Right Side With QMK DFU and Firmware** +`avrdude -b 19200 -c avrisp -p m32u4 -v -e -U lock:w:0x3F:m -U efuse:w:0xC3:m -U hfuse:w:0xD9:m -U lfuse:w:0x5E:m -U eeprom:w:eeprom-righthand.eep -P comPORT -U flash:w:YOUR_production.hex:a` + +Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Windows or `/dev/ttyACM0` in Linux). Use Device Manager in Windows to find the port being used. Use `ls /dev/tty*` in Linux. Change `YOUR_production.hex` to whatever you've created in the previous step. + +## Using QMK DFU +Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with +`make lets_split/rev2::dfu dfu=qmk` +The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` + +--- +# JJ40 +## To Do +- [ ] Mousekeys not working with Userspace for some reason (jj40 only) \ No newline at end of file diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk new file mode 100644 index 0000000000..79929689cb --- /dev/null +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -0,0 +1,6 @@ +AUDIO_ENABLE = no +SWAP_HANDS_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), jj40) + SWAP_HANDS_ENABLE = no +endif \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h new file mode 100644 index 0000000000..a55fc6a3eb --- /dev/null +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -0,0 +1,3 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H +#endif diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c new file mode 100644 index 0000000000..7731edb6a2 --- /dev/null +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -0,0 +1,176 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +#define _________________BLANK_75__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +#define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* QWERTY 75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| gherkin| | FN | + * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| + * | | 7 | 8 | 9 | + * | |--------+--------+--------| + * | 4x12 QWERTY LAYOUT | 4 | 5 | 6 | + * | |--------+--------+--------| + * | | 1 | 2 | 3 | + * | |--------+--------+--------| + * | | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[QW75] = LAYOUT_ortho_5x15_wrapper( + _________________Num_Row_75________________, GHERKIN75, XXXXXXX, FUNCTION75, + _______________Qwerty_Row__0_______________, KC_KP_7, KC_KP_8, KC_KP_9, + _______________Qwerty_Row__1_______________, KC_KP_4, KC_KP_5, KC_KP_6, + _______________Qwerty_Row__2_______________, KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER75, KC_LSFT, KC_SPC, SUPRA75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +), + + /* Gherkin 75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | | FN | + * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| + * | | 7 | 8 | 9 | + * | |--------+--------+--------| + * | 4x12 GHERKIN LAYOUT | 4 | 5 | 6 | + * | |--------+--------+--------| + * | | 1 | 2 | 3 | + * | |--------+--------+--------| + * | | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[GK75] = LAYOUT_ortho_5x15_wrapper( + _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, + _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, + _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, + TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +), + + /* SUBTER75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | SUBTER ROW 0 LAYOUT | | | | + * |-----------------------------------------------------------------------------------------------------------+--------+-----------------| + * | | / | * | - | + * | |--------+--------+--------| + * | 4x12 SUBTER LAYOUT | | | + | + * | |--------+--------+--------| + * | | | | ENTER | + * | |--------+--------+--------| + * | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[SUB75] = LAYOUT_ortho_5x15_wrapper( + _______________SUBTER_Row__0_______________, _______, _______, _______, + _______________SUBTER_Row__0_______________, KC_PSLS, KC_PAST, KC_PMNS, + _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, + _______________SUBTER_Row__2_______________, _______, _______, KC_PENT, + _______, _______, GHERKIN75, _______, _______, _______, KC_ENT, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ +), + +/* SUPRA75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | | | | + * | |--------+--------+--------| + * | 4x12 SUPRA LAYOUT | | | | + * | |--------+--------+--------| + * | | | | | + * | |--------+--------+--------| + * | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[SUP75] = LAYOUT_ortho_5x15_wrapper( + _________________BLANK_75__________________, + ________________SUPRA_Row_0________________, _______, _______, _______, + ________________SUPRA_Row_1________________, _______, _______, _______, + ________________SUPRA_Row_2________________, _______, _______, _______, + _________________BLANK_75__________________ +), + +/* Gherkin 75 Numbers + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| + * | | / | * | - | + * | |--------+--------+--------| + * | 4x12 NUMBERS LAYOUT | | | + | + * | |--------+--------+--------| + * | | | | ENTER | + * | |--------+--------+--------| + * | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[NUM75] = LAYOUT_ortho_5x15_wrapper( + _________________BLANK_75__________________, + _______________NUMBERS_Row_0_______________, KC_PSLS, KC_PAST, KC_PMNS, + _______________NUMBERS_Row_1_______________, _______, _______, KC_PPLS, + _______________NUMBERS_Row_2_______________, _______, _______, KC_PENT, + _______________NUMBERS_Row_3_______________, _______, _______, _______ +), + +/* Gherkin 75 Et Cetera + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| + * | | | | | + * | |--------+--------+--------| + * | 4x12 ETCETERA LAYOUT | | | | + * | |--------+--------+--------| + * | | | | | + * | |--------+--------+--------| + * | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[ETC75] = LAYOUT_ortho_5x15_wrapper( + _________________BLANK_75__________________, + ______________ETCETERA_Row__0______________, _______, _______, _______, + ______________ETCETERA_Row__1______________, _______, _______, _______, + ______________ETCETERA_Row__2______________, _______, _______, _______, + ______________ETCETERA_Row__3______________, _______, _______, _______ +), + +/* Gherkin 75 Directional Keys + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| + * | | | | | + * | |--------+--------+--------| + * | 4x12 DIRECTIONAL LAYOUT | | | | + * | |--------+--------+--------| + * | | | | | + * | |--------+--------+--------| + * | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[DIR75] = LAYOUT_ortho_5x15_wrapper( + _________________BLANK_75__________________, + _____________DIRECTIONS_Row__0_____________, _______, _______, _______, + _____________DIRECTIONS_Row__1_____________, _______, _______, _______, + _____________DIRECTIONS_Row__2_____________, _______, _______, _______, + _______, _______, QWERTY75, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* FUNCTION 75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAP LK | MS BT5 | MS BT4 | MS BT3 | MS BT2 | SLOW M | FAST M | NEXT | VOL+ | VOL- | PLAY | | | | WHEEL+ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RGB TG | RGB MD | RGB HI | RGB HD | RGB SI | RGB SD | RGB VI | RGB VD | BL TOG | BL INC | BL DEC | | | MOUS U | WHEEL- | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[FN75] = LAYOUT_ortho_5x15_wrapper( + _________________BLANK_75__________________, + _________________BLANK_75__________________, + KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______, KC_WH_U, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, KC_MS_U, KC_WH_D, + _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R +), +}; diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk new file mode 100644 index 0000000000..e36226fb2e --- /dev/null +++ b/layouts/community/ortho_5x15/wanleg/rules.mk @@ -0,0 +1 @@ +SWAP_HANDS_ENABLE = no \ No newline at end of file diff --git a/users/wanleg/config.h b/users/wanleg/config.h new file mode 100644 index 0000000000..22073449b2 --- /dev/null +++ b/users/wanleg/config.h @@ -0,0 +1,32 @@ +#ifndef USERSPACE_CONFIG_H +#define USERSPACE_CONFIG_H + +#define PREVENT_STUCK_MODIFIERS + +//TAPPING_TERM +#ifdef TAP_DANCE_ENABLE +#define TAPPING_TERM 200 +#endif + +//Mousekey Settings +#ifdef MOUSEKEY_ENABLE +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +#endif + +// Disable action_get_macro and fn_actions, since we don't use these +// and it saves on space in the firmware. +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#define NO_ACTION_ONESHOT + +#endif // !USERSPACE_CONFIG_H diff --git a/users/wanleg/readme.md b/users/wanleg/readme.md new file mode 100644 index 0000000000..f687b92f48 --- /dev/null +++ b/users/wanleg/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 Brian Fong @wanleg + +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 . diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk new file mode 100644 index 0000000000..8dcc911cef --- /dev/null +++ b/users/wanleg/rules.mk @@ -0,0 +1,19 @@ +ifeq ($(strip $(KEYBOARD)), lets_split_rev2) +SRC += ../../keyboards/lets_split/lets_split.c +endif + +SRC += wanleg.c tapdances.c + +ifndef TAP_DANCE_ENABLE +TAP_DANCE_ENABLE = yes +endif + +ifndef MOUSEKEY_ENABLE +MOUSEKEY_ENABLE = yes +endif + +#If using a ProMicro and it has the QMK DFU bootloader instead of Caterina, +#run "make : dfu=qmk" when compiling to ensure it is flagged properly after being flashed +ifeq ($(strip $(dfu)), qmk) + BOOTLOADER = qmk-dfu +endif diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c new file mode 100644 index 0000000000..318810b1b2 --- /dev/null +++ b/users/wanleg/tapdances.c @@ -0,0 +1,110 @@ +//Tap Dance Settings +#include "wanleg.h" + +///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START ///// +///// (no need to edit this section) ///// +//Enums used to clearly convey the state of the tap dance +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP + // Add more enums here if you want for triple, quadruple, etc. +}; + +typedef struct { + bool is_press_action; + int state; +} tap; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP + if (state->interrupted || !state->pressed) return SINGLE_TAP; + if (state->interrupted) return SINGLE_TAP; + else return SINGLE_HOLD; + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else return 6; //magic number. At some point this method will expand to work for more presses +} +///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// +///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// +//instantialize an instance of 'tap' for the 'ENT' tap dance. +static tap ENTtap_state = { + .is_press_action = true, + .state = 0 +}; + +void ENT_finished (qk_tap_dance_state_t *state, void *user_data) { + ENTtap_state.state = cur_dance(state); + switch (ENTtap_state.state) { + case SINGLE_TAP: register_code(KC_SPC); break; + case SINGLE_HOLD: register_code(KC_LSFT); break; + case DOUBLE_TAP: register_code(KC_ENT); break; + case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want) + case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); + //Last case is for fast typing. Assuming your key is `f`: + //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. + //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. + } +} + +void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (ENTtap_state.state) { + case SINGLE_TAP: unregister_code(KC_SPC); break; + case SINGLE_HOLD: unregister_code(KC_LSFT); break; + case DOUBLE_TAP: unregister_code(KC_ENT); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC); + } + ENTtap_state.state = 0; +} + +//instanalize an instance of 'tap' for the 'DEL' tap dance. +static tap DELtap_state = { + .is_press_action = true, + .state = 0 +}; + +void DEL_finished (qk_tap_dance_state_t *state, void *user_data) { + DELtap_state.state = cur_dance(state); + switch (DELtap_state.state) { + case SINGLE_TAP: register_code(KC_BSPC); break; + case SINGLE_HOLD: register_code(KC_LCTL); break; + case DOUBLE_TAP: register_code(KC_DEL); break; + case DOUBLE_HOLD: register_code(KC_NO); break; + case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC); + } +} + +void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (DELtap_state.state) { + case SINGLE_TAP: unregister_code(KC_BSPC); break; + case SINGLE_HOLD: unregister_code(KC_LCTL); break; + case DOUBLE_TAP: unregister_code(KC_DEL); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); + } + DELtap_state.state = 0; +} +///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// + +//Tap Dance Definitions +//THIS SECTION HAS TO BE AT THE END OF THE TAP DANCE SECTION +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +// Other declarations would go here, separated by commas, if you have them + ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) + ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) + ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) +}; + +//In Layer declaration, add tap dance item in place of a key code +//TD(TD_SFT_CAPS) \ No newline at end of file diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c new file mode 100644 index 0000000000..0175ae2010 --- /dev/null +++ b/users/wanleg/wanleg.c @@ -0,0 +1,158 @@ +#include "wanleg.h" + +// Defines actions for my global custom keycodes. Defined in wanleg.h file +// Then runs the _keymap's record handier if not processed here +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QW); + } + return false; + break; + case GHERKIN: + if (record->event.pressed) { + set_single_persistent_default_layer(_GK); + } + return false; + break; + case gGHERKIN: + if (record->event.pressed) { + set_single_persistent_default_layer(gGK); + } + return false; + break; + case ONEHAND: + if (record->event.pressed) { + set_single_persistent_default_layer(ONE); + } + return false; + break; + case QWERTY75: + if (record->event.pressed) { + set_single_persistent_default_layer(QW75); + } + return false; + break; + case GHERKIN75: + if (record->event.pressed) { + set_single_persistent_default_layer(GK75); + } + return false; + break; + case SUBTER: + if (record->event.pressed) { + layer_on(SUB); + } else { + layer_off(SUB); + } + return false; + break; + case SUPRA: + if (record->event.pressed) { + layer_on(SUP); + } else { + layer_off(SUP); + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(NUM); + } else { + layer_off(NUM); + } + return false; + break; + case DIRECTION: + if (record->event.pressed) { + layer_on(DIR); + } else { + layer_off(DIR); + } + return false; + break; + case ETCETERA: + if (record->event.pressed) { + layer_on(ETC); + } else { + layer_off(ETC); + } + return false; + break; + case gNUMBER: + if (record->event.pressed) { + layer_on(gNUM); + } else { + layer_off(gNUM); + } + return false; + break; + case gDIRECTION: + if (record->event.pressed) { + layer_on(gDIR); + } else { + layer_off(gDIR); + } + return false; + break; + case gETCETERA: + if (record->event.pressed) { + layer_on(gETC); + } else { + layer_off(gETC); + } + return false; + break; + case SUBTER75: + if (record->event.pressed) { + layer_on(SUB75); + } else { + layer_off(SUB75); + } + return false; + break; + case SUPRA75: + if (record->event.pressed) { + layer_on(SUP75); + } else { + layer_off(SUP75); + } + return false; + break; + case NUMBER75: + if (record->event.pressed) { + layer_on(NUM75); + } else { + layer_off(NUM75); + } + return false; + break; + case DIRECTION75: + if (record->event.pressed) { + layer_on(DIR75); + } else { + layer_off(DIR75); + } + return false; + break; + case ETCETERA75: + if (record->event.pressed) { + layer_on(ETC75); + } else { + layer_off(ETC75); + } + return false; + break; + case FUNCTION75: + if (record->event.pressed) { + layer_on(FN75); + } else { + layer_off(FN75); + } + return false; + break; + } + return true; +} diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h new file mode 100644 index 0000000000..da14dcdf5a --- /dev/null +++ b/users/wanleg/wanleg.h @@ -0,0 +1,308 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +// Define layer names and order +#ifdef KEYBOARD_gherkin +enum userspace_layers { + gGK = 0, + gNUM, + gDIR, + gETC, + _GK, + _QW, + QW75, + GK75, + ONE, + SUB, + SUP, + NUM, + DIR, + ETC, + SUB75, + SUP75, + NUM75, + DIR75, + ETC75, + FN75 +}; +#elif KEYBOARD_xd75 +enum userspace_layers { + GK75 = 0, + QW75, + SUB75, + SUP75, + NUM75, + DIR75, + ETC75, + FN75, + gGK, + _GK, + _QW, + ONE, + SUB, + SUP, + NUM, + DIR, + ETC, + gNUM, + gDIR, + gETC, +}; +#else + enum userspace_layers { + _GK = 0, + _QW, + QW75, + GK75, + gGK, + ONE, + SUB, + SUP, + NUM, + DIR, + ETC, + gNUM, + gDIR, + gETC, + SUB75, + SUP75, + NUM75, + DIR75, + ETC75, + FN75 +}; +#endif + +enum userspace_custom_keycodes { + gGHERKIN = SAFE_RANGE, + GHERKIN, + QWERTY, + QWERTY75, + GHERKIN75, + ONEHAND, + SUBTER, + SUPRA, + NUMBER, + DIRECTION, + ETCETERA, + gNUMBER, + gDIRECTION, + gETCETERA, + SUBTER75, + SUPRA75, + NUMBER75, + DIRECTION75, + ETCETERA75, + FUNCTION75 + +}; + +//Tap Dance Declarations (list of my tap dance configurations) +#ifdef TAP_DANCE_ENABLE +enum { + TD_SFT_CAPS = 0 + ,TD_Q_ESC + ,ENT_TAP_DANCE + ,DEL_TAP_DANCE +}; +#endif + +// Since our quirky block definitions are basically a list of comma separated +// arguments, we need a wrapper in order for these definitions to be +// expanded before being used as arguments to the LAYOUT_xxx macro. +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) + +// Blocks for each of the major keyboard layouts +// Organized so we can quickly adapt and modify all of them +// at once, rather than for each keyboard, one at a time. +// And this allows for much cleaner blocks in the keymaps. + +// NOTE: These are all the same length. If you do a search/replace +// then you need to add/remove underscores to keep the +// lengths consistent. + + +/* Pure Gherkin + * .-----------------------------------------------------------------------------------------. + * | Q//ESC | W | E | R | T | Y | U | I | O | P | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | A | S | D | F | G | H | J | K | L | SPACE | + * | | | | | | | | | |SFThold | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BKSC | + * | SFThold| | | | | | | | |CTRLhold| + * '-----------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_Row_0_______________ TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______________Gherkin_Row_1_______________ KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SFT_T(KC_SPC) +#define _______________Gherkin_Row_2_______________ SFT_T(KC_Z), KC_X, KC_C, LT(gNUM,KC_V), LT(gETC,KC_B), KC_N, LT(gDIR,KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC) + +/* Directional Keys + * .-----------------------------------------------------------------------------------------. + * | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | P-Brk | | | | | | | RGUI | ALT | / | + * '-----------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_DIR_0_______________ KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL +#define _______________Gherkin_DIR_1_______________ KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC +#define _______________Gherkin_DIR_2_______________ KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_LALT, KC_SLSH + +/* Numbers + * .-----------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC | + * | | | | | | | | | |CTRLhold| + * '-----------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_NUM_0_______________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 +#define _______________Gherkin_NUM_1_______________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 +#define _______________Gherkin_NUM_2_______________ KC_F11, KC_F12, _______,_______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC) + +/* Et Cetera + * .-----------------------------------------------------------------------------------------. + * | ` | mUP | | | RESET | SHIFT | mScrUp | mScrDn | | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Sft//Cp| | | | | C-A-D | mScrL | mScrR | ALT | DEL | + * '-----------------------------------------------------------------------------------------' + */ +#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS +#define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT +#define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),_______, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL + +/* Gherkin-Like + * .-----------------------------------------------------------------------------------------------------------. + * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | + * | | | | | | | | | | |SFThold | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC | ENT/SFT| + * | |SFThold | | | | | | | | |CTRLhold| | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ONEHAND| NUM | ETC | SPACE | DIR | RGUI | ALT | DEL | CTRL | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define _______________GherkinLike_0_______________ KC_ESC, _______________Gherkin_Row_0_______________, KC_BSPC +#define _______________GherkinLike_1_______________ KC_TAB, _______________Gherkin_Row_1_______________, KC_QUOT +#define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) +#define _______________GherkinLike_3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL +#define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL + +/* Qwerty + * .-------------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |-------+------+------+------+------+-------------+------+------+------+------+-------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |-------+------+------+------+------+------|------+------+------+------+------+-------| + * |Sft/Cps| Z | X | C | V | B | N | M | , | . | / |ENT/SFT| + * |-------+------+------+------+------+------+------+------+------+------+------+-------| + * | LCTRL | LGUI | ALT | ALT | SUB | SHIFT| SPACE| SUP | RGUI | RALT | DEL | CTRL | + * '-------------------------------------------------------------------------------------' + */ +#define _______________Qwerty_Row__0_______________ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC +#define _______________Qwerty_Row__1_______________ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT +#define _______________Qwerty_Row__2_______________ TD(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) +#define _______________Qwerty_Row__3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER, KC_LSFT, KC_SPC, SUPRA, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL + +/* SUPRA + * .-----------------------------------------------------------------------------------------------------------. + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define ________________SUPRA_Row_0________________ RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_RSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL +#define ________________SUPRA_Row_1________________ _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_RCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS +#define ________________SUPRA_Row_2________________ _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______ +#define ________________SUPRA_Row_3________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + +/* SUBTER + * .-----------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | | | RGUI | ./ALT | BKSC | | + * | | | | | | | | | | |CTRLhold| | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | gherkin| | | | ENTER | SHIFT | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define _______________SUBTER_Row__0_______________ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL +#define _______________SUBTER_Row__1_______________ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______ +#define _______________SUBTER_Row__2_______________ _______, KC_F11, KC_F12, _______, _______, _______, _______, _______, KC_RGUI,ALT_T(KC_DOT), CTL_T(KC_BSPC), _______ +#define _______________SUBTER_Row__3_______________ _______, _______, GHERKIN, _______, _______, _______, KC_ENT, KC_LSFT, _______,_______, _______, _______ + +/* Gherkin Numbers + * .-----------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | + * | | | | | | | | | | |CTRLhold| | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | ENTER | SHIFT | RGUI | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define _______________NUMBERS_Row_0_______________ _______, _______________Gherkin_NUM_0_______________, KC_DEL +#define _______________NUMBERS_Row_1_______________ _______, _______________Gherkin_NUM_1_______________, _______ +#define _______________NUMBERS_Row_2_______________ _______, _______________Gherkin_NUM_2_______________, _______ +#define _______________NUMBERS_Row_3_______________ _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______, _______ + + +/* Gherkin Directional Keys + * .-----------------------------------------------------------------------------------------------------------. + * | | TAB | up | | INS | CTRL | SHIFT | PgUp | HOME | - | = | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | left | down | right | PrScr | SHIFT | CTRL | PgDn | END | [ | ] | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | / | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | qwerty | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define _____________DIRECTIONS_Row__0_____________ _______, _______________Gherkin_DIR_0_______________, KC_DEL +#define _____________DIRECTIONS_Row__1_____________ _______, _______________Gherkin_DIR_1_______________, _______ +#define _____________DIRECTIONS_Row__2_____________ _______, _______________Gherkin_DIR_2_______________, _______ +#define _____________DIRECTIONS_Row__3_____________ _______, _______, QWERTY, _______, _______, _______, _______, _______, _______, _______, _______, _______ + +/* Gherkin Et Cetera + * .-----------------------------------------------------------------------------------------------------------. + * | | ` | mUP | | | RESET | SHIFT | mScrUp |mScrDown| | \ | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | Sft//Cp| | | | | C-A-D |mScrLeft| mScrRt | ALT | DEL | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | C-A-D | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ +#define ______________ETCETERA_Row__0______________ _______, _______________Gherkin_ETC_0_______________, KC_DEL +#define ______________ETCETERA_Row__1______________ _______, _______________Gherkin_ETC_1_______________, _______ +#define ______________ETCETERA_Row__2______________ _______, _______________Gherkin_ETC_2_______________, _______ +#define ______________ETCETERA_Row__3______________ _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______, _______ + +#endif // !USERSPACE -- cgit v1.2.3 From 19fdfccca28f923a12351fbee6c8c8282dca004e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 17 Aug 2018 16:12:22 -0700 Subject: Keyboard: Ckeys refactor (#3681) * Obelus Refactor: LAYOUT to LAYOUT_ortho_4x4 - Keymap also now uses #include QMK_KEYBOARD_H - Readability and white space changes - rules.mk now has LAYOUTS = ortho_4x4 - added info.json * naKey Refactor: LAYOUT to LAYOUT_numpad_5x4 - Matrix LAYOUT renamed to LAYOUT_numpad_5x4 - Now supports community layout numpad_5x4 - White space changes * naKey Configurator update Updated order of JSON objects to match new matrix order. --- keyboards/ckeys/nakey/info.json | 6 +- keyboards/ckeys/nakey/keymaps/default/keymap.c | 35 ++++++------ keyboards/ckeys/nakey/nakey.h | 13 ++--- keyboards/ckeys/nakey/rules.mk | 2 + keyboards/ckeys/obelus/info.json | 13 +++++ keyboards/ckeys/obelus/keymaps/default/keymap.c | 75 ++++++++++++------------- keyboards/ckeys/obelus/obelus.h | 2 +- keyboards/ckeys/obelus/rules.mk | 2 + 8 files changed, 81 insertions(+), 67 deletions(-) create mode 100644 keyboards/ckeys/obelus/info.json diff --git a/keyboards/ckeys/nakey/info.json b/keyboards/ckeys/nakey/info.json index b44d0daf74..093e61d0e0 100644 --- a/keyboards/ckeys/nakey/info.json +++ b/keyboards/ckeys/nakey/info.json @@ -5,8 +5,8 @@ "width": 4, "height": 5, "layouts": { - "LAYOUT": { - "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"Enter", "x":3, "y":3, "h":2}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}] - } + "LAYOUT_numpad_5x4": { + "layout": [{"label":"Num Lock", "x":0, "y":0}, {"label":"/", "x":1, "y":0}, {"label":"*", "x":2, "y":0}, {"label":"-", "x":3, "y":0}, {"label":"7", "x":0, "y":1}, {"label":"8", "x":1, "y":1}, {"label":"9", "x":2, "y":1}, {"label":"4", "x":0, "y":2}, {"label":"5", "x":1, "y":2}, {"label":"6", "x":2, "y":2}, {"label":"+", "x":3, "y":1, "h":2}, {"label":"1", "x":0, "y":3}, {"label":"2", "x":1, "y":3}, {"label":"3", "x":2, "y":3}, {"label":"0", "x":0, "y":4, "w":2}, {"label":".", "x":2, "y":4}, {"label":"Enter", "x":3, "y":3, "h":2}] + } } } diff --git a/keyboards/ckeys/nakey/keymaps/default/keymap.c b/keyboards/ckeys/nakey/keymaps/default/keymap.c index ebbb128bd2..9c3e45b946 100644 --- a/keyboards/ckeys/nakey/keymaps/default/keymap.c +++ b/keyboards/ckeys/nakey/keymaps/default/keymap.c @@ -16,32 +16,31 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT( /* Base */ - KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, KC_PPLS, \ - KC_P4, KC_P5, KC_P6, \ - KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_P0, KC_PDOT \ -), + [0] = LAYOUT_numpad_5x4( /* Base */ + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_P7, KC_P8, KC_P9, \ + KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT \ + ), }; const uint16_t PROGMEM fn_actions[] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); } - return MACRO_NONE; + break; + } + return MACRO_NONE; }; diff --git a/keyboards/ckeys/nakey/nakey.h b/keyboards/ckeys/nakey/nakey.h index 3cbfda844d..bbf531fb68 100644 --- a/keyboards/ckeys/nakey/nakey.h +++ b/keyboards/ckeys/nakey/nakey.h @@ -22,14 +22,13 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array -#define LAYOUT( \ +#define LAYOUT_numpad_5x4( \ k00, k01, k02, k03, \ - k10, k11, k12, k13, \ - k20, k21, k22, \ - k30, k31, k32, k33, \ - k40, k41 \ -) \ -{ \ + k10, k11, k12, \ + k20, k21, k22, k13, \ + k30, k31, k32, \ + k40, k41, k33 \ +) { \ { k00, k01, k02, k03 }, \ { k10, k11, k12, k13 }, \ { k20, k21, k22, KC_NO }, \ diff --git a/keyboards/ckeys/nakey/rules.mk b/keyboards/ckeys/nakey/rules.mk index a3571e8deb..36b2193aae 100644 --- a/keyboards/ckeys/nakey/rules.mk +++ b/keyboards/ckeys/nakey/rules.mk @@ -66,3 +66,5 @@ 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 + +LAYOUTS = numpad_5x4 diff --git a/keyboards/ckeys/obelus/info.json b/keyboards/ckeys/obelus/info.json new file mode 100644 index 0000000000..70d2f7e7e5 --- /dev/null +++ b/keyboards/ckeys/obelus/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Obelus", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + } + } +} diff --git a/keyboards/ckeys/obelus/keymaps/default/keymap.c b/keyboards/ckeys/obelus/keymaps/default/keymap.c index c2c8e4a052..bdad1cacab 100644 --- a/keyboards/ckeys/obelus/keymaps/default/keymap.c +++ b/keyboards/ckeys/obelus/keymaps/default/keymap.c @@ -1,5 +1,4 @@ -#include "obelus.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #ifdef AUDIO_ENABLE #include "audio.h" #endif @@ -18,12 +17,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * `---------------------- ' */ -[0] = LAYOUT( /* LAYER SELECT */ - KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ - TO(4), KC_TRNS, KC_TRNS, KC_TRNS, \ - TO(1), TO(2), TO(3), KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ -), + [0] = LAYOUT_ortho_4x4( /* LAYER SELECT */ + _______, _______, _______, RESET, \ + TO(4), _______, _______, _______, \ + TO(1), TO(2), TO(3), _______, \ + _______, _______, _______, _______ \ + ), /* NUMPAD * ,-----------------------. * | 7 | 8 | 9 | * | @@ -35,12 +34,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | 0 | . | / | = | * `---------------------- ' */ -[1] = LAYOUT( /* NUMPAD */ - KC_P7, KC_P8, KC_P9, KC_PAST, \ - KC_P4, KC_P5, KC_P6, KC_PMNS, \ - KC_P1, KC_P2, KC_P3, KC_PPLS, \ - KC_P0, KC_PDOT, KC_PSLS, LT(5,KC_PENT) \ -), + [1] = LAYOUT_ortho_4x4( /* NUMPAD */ + KC_P7, KC_P8, KC_P9, KC_PAST, \ + KC_P4, KC_P5, KC_P6, KC_PMNS, \ + KC_P1, KC_P2, KC_P3, KC_PPLS, \ + KC_P0, KC_PDOT, KC_PSLS, LT(5, KC_PENT) \ + ), /* NUMPAD SUPPLEMENT * ,-----------------------. * |NUMLK| | | | @@ -52,12 +51,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * `---------------------- ' */ -[5] = LAYOUT( /* NUMPAD SUPPLEMENT */ - KC_NLCK, KC_TRNS, KC_TRNS, TO(0), \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ -), + [5] = LAYOUT_ortho_4x4( /* NUMPAD SUPPLEMENT */ + KC_NLCK, _______, _______, TO(0), \ + _______, _______, _______, _______, \ + _______, _______, _______, _______, \ + _______, _______, _______, _______ \ + ), /* NAV * ,-----------------------. * | INS |PGUP | TAB |PRSCR| @@ -69,12 +68,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |LEFT |DOWN |RIGHT|ENTER| * `---------------------- ' */ -[2] = LAYOUT( /* NAV CLUSTER */ - KC_INS, KC_PGUP, KC_TAB, KC_PSCR, \ - KC_DEL, KC_PGDN, KC_VOLD, KC_VOLU, \ - KC_HOME, KC_UP, KC_END, TO(0), \ - KC_LEFT, KC_DOWN, KC_RGHT, KC_ENT \ -), + [2] = LAYOUT_ortho_4x4( /* NAV CLUSTER */ + KC_INS, KC_PGUP, KC_TAB, KC_PSCR, \ + KC_DEL, KC_PGDN, KC_VOLD, KC_VOLU, \ + KC_HOME, KC_UP, KC_END, TO(0), \ + KC_LEFT, KC_DOWN, KC_RGHT, KC_ENT \ + ), /* GAMING * ,-----------------------. * | ESC | 1 | 2 | 3 | @@ -86,12 +85,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |CTRL | C | R |SPACE| * `---------------------- ' */ -[3] = LAYOUT( /* GAMING */ - LT(4, KC_ESC), KC_1, KC_2, KC_3, \ - KC_TAB, KC_Q, KC_W, KC_E, \ - KC_LSFT, KC_A, KC_S, KC_D, \ - KC_LCTL, KC_C, KC_R, KC_SPC \ -), + [3] = LAYOUT_ortho_4x4( /* GAMING */ + LT(4, KC_ESC), KC_1, KC_2, KC_3, \ + KC_TAB, KC_Q, KC_W, KC_E, \ + KC_LSFT, KC_A, KC_S, KC_D, \ + KC_LCTL, KC_C, KC_R, KC_SPC \ + ), /* MUSIC * ,-----------------------. * | | | | | @@ -103,12 +102,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |TOGGL|MODE | | | * `---------------------- ' */ -[4] = LAYOUT( /* NUMPAD SUPPLEMENT */ - KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, \ - MU_TOG, MU_MOD, KC_NO, TO(0) \ -), + [4] = LAYOUT_ortho_4x4( /* NUMPAD SUPPLEMENT */ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MU_TOG, MU_MOD, XXXXXXX, TO(0) \ + ), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/ckeys/obelus/obelus.h b/keyboards/ckeys/obelus/obelus.h index 21bc4d723f..371b79df20 100644 --- a/keyboards/ckeys/obelus/obelus.h +++ b/keyboards/ckeys/obelus/obelus.h @@ -7,7 +7,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define LAYOUT( \ +#define LAYOUT_ortho_4x4( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, k23, \ diff --git a/keyboards/ckeys/obelus/rules.mk b/keyboards/ckeys/obelus/rules.mk index d999b118cb..f40610ee95 100644 --- a/keyboards/ckeys/obelus/rules.mk +++ b/keyboards/ckeys/obelus/rules.mk @@ -66,3 +66,5 @@ UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = yes # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches + +LAYOUTS = ortho_4x4 -- cgit v1.2.3 From a18cd1b2b693a1e4eeaf1715f6ffe53d70dd9ee4 Mon Sep 17 00:00:00 2001 From: Biacco42 Date: Mon, 20 Aug 2018 04:27:21 +0900 Subject: Keymap: Ergo42 biacco-biacco keymap (#3659) * Add biacco-biacco keymap * Change P position * Update biacco-biacco map y position * Revert y position... * Refactor needless lines * Fix some review commentted --- keyboards/ergo42/keymaps/biacco-biacco/config.h | 33 +++++ keyboards/ergo42/keymaps/biacco-biacco/keymap.c | 161 ++++++++++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 keyboards/ergo42/keymaps/biacco-biacco/config.h create mode 100644 keyboards/ergo42/keymaps/biacco-biacco/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco-biacco/config.h b/keyboards/ergo42/keymaps/biacco-biacco/config.h new file mode 100644 index 0000000000..360d6a5621 --- /dev/null +++ b/keyboards/ergo42/keymaps/biacco-biacco/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/ergo42/keymaps/biacco-biacco/keymap.c b/keyboards/ergo42/keymaps/biacco-biacco/keymap.c new file mode 100644 index 0000000000..ee471b3a51 --- /dev/null +++ b/keyboards/ergo42/keymaps/biacco-biacco/keymap.c @@ -0,0 +1,161 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +#define BASE 0 +#define META 1 +#define SYMB 2 +#define GAME 3 +#define BIAC 4 +#define BMETA 5 +#define BSYMB 6 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BASE + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[BASE] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, TG(BIAC),LT(SYMB, KC_ESC), RCTL_T(KC_SPC), SFT_T(KC_TAB), KC_BSPC, LT(META, KC_ENT), KC_DELT, KC_PSCR, TG(GAME), TG(SYMB), KC_JYEN \ +), + +/* META + * ,------------------------------------------------. ,------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | [ | | ] | 7 | 8 | 9 | 0 | - | ^ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | F1 | |Muhen | Henk | | ( | | ) | Left | Down | Up |Right | | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |Reset |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[META] = LAYOUT( \ + 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_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, \ + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, SFT_T(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ +), + +/* SYMB + * ,------------------------------------------------. ,------------------------------------------------. + * | ! | " | # | $ | % | & | [ | | ] | ' | ( | ) | ~ | = | ~ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | | | | | | ( | | ) | | | | | + | * | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | | | | | | { | | } | | | < | > | ? | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[SYMB] = LAYOUT( \ + S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), _______, _______, S(KC_7), S(KC_8), S(KC_9), S(KC_0), S(KC_MINS), S(KC_EQL), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_SCLN), S(KC_QUOT), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* GAME + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc | ESC |Space |Tab | |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | | | | | |Space | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ +[GAME] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \ +), + +/* BIAC + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | ; | , | . | P | Q | [ | | ] | Y | G | D | M | F | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | O | E | I | U | ( | | ) | B | N | T | R | S | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | W | { | | } | H | J | K | L | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |=>BIAC|ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc | | | \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[BIAC] = LAYOUT( \ + KC_TAB, KC_SCLN,KC_COMM, KC_DOT, KC_P, KC_Q, KC_RBRC, KC_BSLS, KC_Y, KC_G, KC_D, KC_M, KC_F, KC_LBRC, \ + KC_LALT, KC_A, KC_O, KC_E, KC_I, KC_U, S(KC_8), S(KC_9), KC_B, KC_N, KC_T, KC_R, KC_S, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_W, S(KC_RBRC), S(KC_BSLS), KC_H, KC_J, KC_K, KC_L, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, _______, LT(BSYMB, KC_ESC),RCTL_T(KC_SPC),SFT_T(KC_TAB), KC_BSPC, LT(BMETA, KC_ENT),KC_DELT, KC_PSCR, XXXXXXX, XXXXXXX, KC_JYEN \ +), + +/* META + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | 2 | 3 | 4 | 5 | 6 | [ | | ] | 7 | 8 | 9 | 0 | - | ^ | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | 1 | |Muhen | Henk | | ( | | ) | Left | Down | Up |Right | |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App | |ESC/ |Space/|Tab/ | |Back |Enter/| Del |Reset | | | \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[BMETA] = LAYOUT( \ + 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_2, KC_3, KC_4, KC_5, KC_6, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, \ + _______, KC_1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, SFT_T(KC_RO), \ + _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ +), + +/* SYMB + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | [ | | ] | | | [ | ] | + | * | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | " | # | $ | % | & | ( | | ) | ' | ( | ) | | = | ~ | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | ! | | | | | { | | } | { | } | < | > | ? | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App | |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc | | | \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[BSYMB] = LAYOUT( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_RBRC, KC_BSLS, S(KC_SCLN), S(KC_QUOT), \ + _______, S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), _______, _______, S(KC_7), S(KC_8), S(KC_9), S(KC_0), S(KC_MINS), S(KC_EQL), \ + _______, S(KC_1), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, S(KC_RBRC), S(KC_BSLS), S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \ + _______, _______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + -- cgit v1.2.3 From fe687af54d9a6810ded8bb4dd959eca9fe3e847c Mon Sep 17 00:00:00 2001 From: Cole Markham Date: Sun, 19 Aug 2018 14:29:03 -0500 Subject: Keyboard: Add Big Series 2-, 3-, and 4-key boards (#3669) * Implement magic 8-ball mode for big series switch * LED Testing * Add Ctrl+Alt+Del key mapping * Add Windows lock (win+L) layout. * Add Big Series 3-key * Add Big Series 4-key * Add Big Series 2-key * Fix layout mapping for Big Series 3u * Fix merge-conflict. * Refactor bigseries boards into a single folder --- keyboards/bigseries/1key/1key.c | 26 ++++ keyboards/bigseries/1key/1key.h | 28 ++++ keyboards/bigseries/1key/config.h | 63 +++++++++ keyboards/bigseries/1key/info.json | 12 ++ keyboards/bigseries/1key/keymaps/8ball/keymap.c | 144 +++++++++++++++++++++ .../bigseries/1key/keymaps/ctrl-alt-del/keymap.c | 91 +++++++++++++ keyboards/bigseries/1key/keymaps/default/keymap.c | 93 +++++++++++++ .../bigseries/1key/keymaps/dudeofawesome/README.md | 18 +++ .../bigseries/1key/keymaps/dudeofawesome/config.h | 23 ++++ .../bigseries/1key/keymaps/dudeofawesome/keymap.c | 50 +++++++ .../bigseries/1key/keymaps/dudeofawesome/rules.mk | 1 + keyboards/bigseries/1key/keymaps/leddance/config.h | 23 ++++ keyboards/bigseries/1key/keymaps/leddance/keymap.c | 127 ++++++++++++++++++ keyboards/bigseries/1key/keymaps/leddance/rules.mk | 1 + keyboards/bigseries/1key/keymaps/lock/keymap.c | 88 +++++++++++++ keyboards/bigseries/1key/keymaps/tester/keymap.c | 96 ++++++++++++++ keyboards/bigseries/1key/readme.md | 15 +++ keyboards/bigseries/1key/rules.mk | 1 + keyboards/bigseries/2key/2key.c | 26 ++++ keyboards/bigseries/2key/2key.h | 28 ++++ keyboards/bigseries/2key/config.h | 63 +++++++++ keyboards/bigseries/2key/info.json | 12 ++ keyboards/bigseries/2key/keymaps/default/keymap.c | 87 +++++++++++++ keyboards/bigseries/2key/keymaps/lock/keymap.c | 89 +++++++++++++ keyboards/bigseries/2key/keymaps/tester/keymap.c | 88 +++++++++++++ keyboards/bigseries/2key/readme.md | 15 +++ keyboards/bigseries/2key/rules.mk | 1 + keyboards/bigseries/3key/3key.c | 26 ++++ keyboards/bigseries/3key/3key.h | 28 ++++ keyboards/bigseries/3key/config.h | 63 +++++++++ keyboards/bigseries/3key/info.json | 12 ++ .../bigseries/3key/keymaps/ctrl-alt-del/keymap.c | 91 +++++++++++++ keyboards/bigseries/3key/keymaps/default/keymap.c | 95 ++++++++++++++ keyboards/bigseries/3key/keymaps/tester/keymap.c | 88 +++++++++++++ keyboards/bigseries/3key/readme.md | 15 +++ keyboards/bigseries/3key/rules.mk | 1 + keyboards/bigseries/4key/4key.c | 23 ++++ keyboards/bigseries/4key/4key.h | 30 +++++ keyboards/bigseries/4key/config.h | 63 +++++++++ keyboards/bigseries/4key/info.json | 12 ++ keyboards/bigseries/4key/keymaps/default/keymap.c | 89 +++++++++++++ keyboards/bigseries/4key/keymaps/tester/keymap.c | 88 +++++++++++++ keyboards/bigseries/4key/readme.md | 15 +++ keyboards/bigseries/4key/rules.mk | 1 + keyboards/bigseries/bigseries.c | 26 ---- keyboards/bigseries/bigseries.h | 28 ---- keyboards/bigseries/config.h | 59 --------- keyboards/bigseries/info.json | 12 -- keyboards/bigseries/keymaps/8ball/keymap.c | 144 --------------------- keyboards/bigseries/keymaps/default/keymap.c | 93 ------------- .../bigseries/keymaps/dudeofawesome/README.md | 18 --- keyboards/bigseries/keymaps/dudeofawesome/config.h | 23 ---- keyboards/bigseries/keymaps/dudeofawesome/keymap.c | 50 ------- keyboards/bigseries/keymaps/dudeofawesome/rules.mk | 1 - keyboards/bigseries/keymaps/leddance/config.h | 23 ---- keyboards/bigseries/keymaps/leddance/keymap.c | 127 ------------------ keyboards/bigseries/keymaps/leddance/rules.mk | 1 - keyboards/bigseries/readme.md | 11 +- keyboards/bigseries/rules.mk | 2 - 59 files changed, 2055 insertions(+), 612 deletions(-) create mode 100755 keyboards/bigseries/1key/1key.c create mode 100755 keyboards/bigseries/1key/1key.h create mode 100755 keyboards/bigseries/1key/config.h create mode 100644 keyboards/bigseries/1key/info.json create mode 100755 keyboards/bigseries/1key/keymaps/8ball/keymap.c create mode 100755 keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c create mode 100755 keyboards/bigseries/1key/keymaps/default/keymap.c create mode 100644 keyboards/bigseries/1key/keymaps/dudeofawesome/README.md create mode 100644 keyboards/bigseries/1key/keymaps/dudeofawesome/config.h create mode 100755 keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c create mode 100644 keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk create mode 100644 keyboards/bigseries/1key/keymaps/leddance/config.h create mode 100755 keyboards/bigseries/1key/keymaps/leddance/keymap.c create mode 100644 keyboards/bigseries/1key/keymaps/leddance/rules.mk create mode 100755 keyboards/bigseries/1key/keymaps/lock/keymap.c create mode 100755 keyboards/bigseries/1key/keymaps/tester/keymap.c create mode 100644 keyboards/bigseries/1key/readme.md create mode 100755 keyboards/bigseries/1key/rules.mk create mode 100755 keyboards/bigseries/2key/2key.c create mode 100755 keyboards/bigseries/2key/2key.h create mode 100755 keyboards/bigseries/2key/config.h create mode 100644 keyboards/bigseries/2key/info.json create mode 100755 keyboards/bigseries/2key/keymaps/default/keymap.c create mode 100755 keyboards/bigseries/2key/keymaps/lock/keymap.c create mode 100755 keyboards/bigseries/2key/keymaps/tester/keymap.c create mode 100644 keyboards/bigseries/2key/readme.md create mode 100755 keyboards/bigseries/2key/rules.mk create mode 100755 keyboards/bigseries/3key/3key.c create mode 100755 keyboards/bigseries/3key/3key.h create mode 100755 keyboards/bigseries/3key/config.h create mode 100644 keyboards/bigseries/3key/info.json create mode 100755 keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c create mode 100755 keyboards/bigseries/3key/keymaps/default/keymap.c create mode 100755 keyboards/bigseries/3key/keymaps/tester/keymap.c create mode 100644 keyboards/bigseries/3key/readme.md create mode 100755 keyboards/bigseries/3key/rules.mk create mode 100755 keyboards/bigseries/4key/4key.c create mode 100755 keyboards/bigseries/4key/4key.h create mode 100755 keyboards/bigseries/4key/config.h create mode 100644 keyboards/bigseries/4key/info.json create mode 100755 keyboards/bigseries/4key/keymaps/default/keymap.c create mode 100755 keyboards/bigseries/4key/keymaps/tester/keymap.c create mode 100644 keyboards/bigseries/4key/readme.md create mode 100755 keyboards/bigseries/4key/rules.mk delete mode 100755 keyboards/bigseries/bigseries.c delete mode 100755 keyboards/bigseries/bigseries.h delete mode 100755 keyboards/bigseries/config.h delete mode 100644 keyboards/bigseries/info.json delete mode 100755 keyboards/bigseries/keymaps/8ball/keymap.c delete mode 100755 keyboards/bigseries/keymaps/default/keymap.c delete mode 100644 keyboards/bigseries/keymaps/dudeofawesome/README.md delete mode 100644 keyboards/bigseries/keymaps/dudeofawesome/config.h delete mode 100755 keyboards/bigseries/keymaps/dudeofawesome/keymap.c delete mode 100644 keyboards/bigseries/keymaps/dudeofawesome/rules.mk delete mode 100644 keyboards/bigseries/keymaps/leddance/config.h delete mode 100755 keyboards/bigseries/keymaps/leddance/keymap.c delete mode 100644 keyboards/bigseries/keymaps/leddance/rules.mk diff --git a/keyboards/bigseries/1key/1key.c b/keyboards/bigseries/1key/1key.c new file mode 100755 index 0000000000..6036bd9991 --- /dev/null +++ b/keyboards/bigseries/1key/1key.c @@ -0,0 +1,26 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#include "1key.h" + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +#ifdef BACKLIGHT_ENABLE + backlight_task(); +#endif +}; diff --git a/keyboards/bigseries/1key/1key.h b/keyboards/bigseries/1key/1key.h new file mode 100755 index 0000000000..3441407798 --- /dev/null +++ b/keyboards/bigseries/1key/1key.h @@ -0,0 +1,28 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef BIGSWITCH_H +#define BIGSWITCH_H + +#include "quantum.h" + +#define LAYOUT( \ + K00 \ +) { \ + { K00 } \ +} + +#endif diff --git a/keyboards/bigseries/1key/config.h b/keyboards/bigseries/1key/config.h new file mode 100755 index 0000000000..4e30276fc0 --- /dev/null +++ b/keyboards/bigseries/1key/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6071 +#define DEVICE_VER 0x0002 +#define MANUFACTURER WoodKeys.click +#define PRODUCT BigSeries Single Keyboard +#define DESCRIPTION Single key board for Novelkeys Big Series Switch + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0 } +#define MATRIX_COL_PINS { B4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 50 + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 5 +#ifdef RGBLIGHT_LIMIT_VAL +#undef RGBLIGHT_LIMIT_VAL +#endif +#define RGBLIGHT_LIMIT_VAL 128 +#endif + +#endif diff --git a/keyboards/bigseries/1key/info.json b/keyboards/bigseries/1key/info.json new file mode 100644 index 0000000000..ff2fd54c57 --- /dev/null +++ b/keyboards/bigseries/1key/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Big Series 1-Key", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0, "w":4, "h":4}] + } + } +} diff --git a/keyboards/bigseries/1key/keymaps/8ball/keymap.c b/keyboards/bigseries/1key/keymaps/8ball/keymap.c new file mode 100755 index 0000000000..1097eb94af --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/8ball/keymap.c @@ -0,0 +1,144 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +static const char * const ANSWERS[] = { +// "Yes" answers +"It is certain\n", +"It is decidedly so\n", +"Without a doubt\n", +"Yes definitely\n", +"You may rely on it\n", +"As I see it, yes\n", +"Most likely\n", +"Outlook good\n", +"Yes\n", +"Signs point to yes\n", +// Uncertain answers, index 10 +"Reply hazy try again\n", +"Ask again later\n", +"Better not tell you now\n", +"Cannot predict now\n", +"Concentrate and ask again\n", +// "No" answers, index 15 +"Don't count on it\n", +"My reply is no\n", +"My sources say no\n", +"Outlook not so good\n", +"Very doubtful\n" +}; + +#define UNCERTAIN_BREAK 10 +#define NO_BREAK 15 +#define NUM_ANSWERS 20 +// Timeout of answer color in ms +#define ANSWER_TIMEOUT 3000 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A), +}; + + +void reset_rgb(void); + +bool initialized = 0; +uint32_t lastTime = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + rgblight_enable(); + reset_rgb(); + initialized = 1; + } +} + +void matrix_scan_user(void) { + if (lastTime > 0 && timer_elapsed32(lastTime) > ANSWER_TIMEOUT) { + lastTime = 0; + reset_rgb(); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A: + if (record->event.pressed) { + uint8_t num = rand() / (RAND_MAX / NUM_ANSWERS + 1); + rgblight_mode(1); + if (num < UNCERTAIN_BREAK) { + rgblight_setrgb_green(); + } else if (num < NO_BREAK) { + rgblight_setrgb_yellow(); + } else { + rgblight_setrgb_red(); + } + send_string(ANSWERS[num]); + lastTime = timer_read32(); + return false; + } + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +void reset_rgb(void) { + // This gets called on init and after the timeout for the answer color + // If you want to change the default color/mode, do it here + rgblight_sethsv_blue(); + rgblight_mode(7); +} diff --git a/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c b/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c new file mode 100755 index 0000000000..eb2d236827 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/ctrl-alt-del/keymap.c @@ -0,0 +1,91 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + LCTL(LALT(KC_DEL)) + ), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(7); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/1key/keymaps/default/keymap.c b/keyboards/bigseries/1key/keymaps/default/keymap.c new file mode 100755 index 0000000000..7ce837357f --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/default/keymap.c @@ -0,0 +1,93 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + rgblight_enable(); + rgblight_mode(7); + rgblight_sethsv(0,255,255); + rgblight_setrgb(0x00, 0x00, 0xFF); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A: + if (record->event.pressed) { + SEND_STRING("Howdy!!\n"); + rgblight_step(); + return false; + } + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/README.md b/keyboards/bigseries/1key/keymaps/dudeofawesome/README.md new file mode 100644 index 0000000000..86b79b4621 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/dudeofawesome/README.md @@ -0,0 +1,18 @@ +# DudeOfAwesome's Big Series 1-key layout + +## Features + +### Tap dancing taps: +1. Media Play / Pause +1. Media Next +1. RGB Mode Next +1. RGB Mode Previous + +## Building and flashing + +1. Put your board in DFU mode with the button on the bottom +1. Flash: + ```bash + $ make bigseries:dudeofawesome:dfu + ``` + diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/config.h b/keyboards/bigseries/1key/keymaps/dudeofawesome/config.h new file mode 100644 index 0000000000..30b86224c6 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/dudeofawesome/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#define TAPPING_TERM 1000 + +#endif diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c b/keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c new file mode 100755 index 0000000000..4c3739bbeb --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/dudeofawesome/keymap.c @@ -0,0 +1,50 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +enum TAP_DANCE { + TD_PLAY = 0, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT(TD(TD_PLAY)), +}; + +void tap_dance (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 0 ... 1: + register_code(KC_MEDIA_PLAY_PAUSE); + unregister_code(KC_MEDIA_PLAY_PAUSE); + break; + case 2: + register_code(KC_MEDIA_NEXT_TRACK); + unregister_code(KC_MEDIA_NEXT_TRACK); + break; + case 3: + rgblight_step(); + break; + case 4: default: + rgblight_step_reverse(); + break; + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_PLAY] = ACTION_TAP_DANCE_FN(tap_dance), +}; diff --git a/keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk b/keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk new file mode 100644 index 0000000000..e5ddcae8d9 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/dudeofawesome/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes diff --git a/keyboards/bigseries/1key/keymaps/leddance/config.h b/keyboards/bigseries/1key/keymaps/leddance/config.h new file mode 100644 index 0000000000..57398fb996 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/leddance/config.h @@ -0,0 +1,23 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#define TAPPING_TERM 400 + +#endif diff --git a/keyboards/bigseries/1key/keymaps/leddance/keymap.c b/keyboards/bigseries/1key/keymaps/leddance/keymap.c new file mode 100755 index 0000000000..3cd8f1db7f --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/leddance/keymap.c @@ -0,0 +1,127 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + + +extern rgblight_config_t rgblight_config; + +enum custom_keycodes { + BL = SAFE_RANGE +}; + +enum custom_layers { + BASE = 0, + LED +}; + +//Tap Dance Declarations +enum { + TD_TOGGLE = 0 +}; + +void dance_toggle (qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + println("Double tapped, switching layers"); + if (layer_state_is(LED)) { + layer_off(LED); + } else { + layer_on(LED); + } + } else { + print("Single tapped: "); + if (layer_state_is(LED)) { +#ifdef RGBLIGHT_ENABLE + if (!rgblight_config.enable) { + rgblight_enable(); + } + rgblight_step(); +#endif + } else { + println("Base layer, sending string"); + SEND_STRING("This thing is BIG!!\n"); + } + } +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_TOGGLE] = ACTION_TAP_DANCE_FN(dance_toggle) +// Other declarations would go here, separated by commas, if you have them +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BASE] = LAYOUT( + TD(TD_TOGGLE)), +[LED] = LAYOUT( + TD(TD_TOGGLE) + ) + + +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Nothing here, see dance_toggle + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/1key/keymaps/leddance/rules.mk b/keyboards/bigseries/1key/keymaps/leddance/rules.mk new file mode 100644 index 0000000000..1ba2fa8fbe --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/leddance/rules.mk @@ -0,0 +1 @@ +TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/bigseries/1key/keymaps/lock/keymap.c b/keyboards/bigseries/1key/keymaps/lock/keymap.c new file mode 100755 index 0000000000..3d3b002b02 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/lock/keymap.c @@ -0,0 +1,88 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + LGUI(KC_L)), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(7); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/1key/keymaps/tester/keymap.c b/keyboards/bigseries/1key/keymaps/tester/keymap.c new file mode 100755 index 0000000000..31553cef79 --- /dev/null +++ b/keyboards/bigseries/1key/keymaps/tester/keymap.c @@ -0,0 +1,96 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(35); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A: + if (record->event.pressed) { + SEND_STRING("Howdy!!\n"); + rgblight_step(); + return false; + } + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/1key/readme.md b/keyboards/bigseries/1key/readme.md new file mode 100644 index 0000000000..ad3ee28b14 --- /dev/null +++ b/keyboards/bigseries/1key/readme.md @@ -0,0 +1,15 @@ +# Big Series Keyboard + +![Big Series 1-Key](https://woodkeys.click/wp-content/uploads/2017/12/woodkeys_419.jpg) + +A PCB for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) +Hardware Supported: Big Series PCBs +Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](https://novelkeys.xyz) + +Make example for this keyboard (after setting up your build environment): + + make bigseries/1key:default + +See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/1key/rules.mk b/keyboards/bigseries/1key/rules.mk new file mode 100755 index 0000000000..772d56beb6 --- /dev/null +++ b/keyboards/bigseries/1key/rules.mk @@ -0,0 +1 @@ +# Dummy file to make the QMK build system happy \ No newline at end of file diff --git a/keyboards/bigseries/2key/2key.c b/keyboards/bigseries/2key/2key.c new file mode 100755 index 0000000000..cffb71907e --- /dev/null +++ b/keyboards/bigseries/2key/2key.c @@ -0,0 +1,26 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#include "2key.h" + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +#ifdef BACKLIGHT_ENABLE + backlight_task(); +#endif +}; diff --git a/keyboards/bigseries/2key/2key.h b/keyboards/bigseries/2key/2key.h new file mode 100755 index 0000000000..dcbf2f764c --- /dev/null +++ b/keyboards/bigseries/2key/2key.h @@ -0,0 +1,28 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef BIGSWITCH_H +#define BIGSWITCH_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01 \ +) { \ + { K00, K01 } \ +} + +#endif diff --git a/keyboards/bigseries/2key/config.h b/keyboards/bigseries/2key/config.h new file mode 100755 index 0000000000..83c8e31417 --- /dev/null +++ b/keyboards/bigseries/2key/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6071 +#define DEVICE_VER 0x0002 +#define MANUFACTURER WoodKeys.click +#define PRODUCT BigSeries Single Keyboard +#define DESCRIPTION Single key board for Novelkeys Big Series Switch + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 2 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0 } +#define MATRIX_COL_PINS { B4, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 50 + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#ifdef RGBLIGHT_LIMIT_VAL +#undef RGBLIGHT_LIMIT_VAL +#endif +#define RGBLIGHT_LIMIT_VAL 128 +#endif + +#endif diff --git a/keyboards/bigseries/2key/info.json b/keyboards/bigseries/2key/info.json new file mode 100644 index 0000000000..dc30449b12 --- /dev/null +++ b/keyboards/bigseries/2key/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Big Series 2-Key", + "url": "", + "maintainer": "qmk", + "width": 8, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}] + } + } +} diff --git a/keyboards/bigseries/2key/keymaps/default/keymap.c b/keyboards/bigseries/2key/keymaps/default/keymap.c new file mode 100755 index 0000000000..704649632b --- /dev/null +++ b/keyboards/bigseries/2key/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_Z, KC_X), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(35); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/2key/keymaps/lock/keymap.c b/keyboards/bigseries/2key/keymaps/lock/keymap.c new file mode 100755 index 0000000000..55a9240f32 --- /dev/null +++ b/keyboards/bigseries/2key/keymaps/lock/keymap.c @@ -0,0 +1,89 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + LGUI(KC_L), LCTL(LALT(KC_DEL)) + ), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(7); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/2key/keymaps/tester/keymap.c b/keyboards/bigseries/2key/keymaps/tester/keymap.c new file mode 100755 index 0000000000..5b574824d3 --- /dev/null +++ b/keyboards/bigseries/2key/keymaps/tester/keymap.c @@ -0,0 +1,88 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A, KC_B), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(35); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/2key/readme.md b/keyboards/bigseries/2key/readme.md new file mode 100644 index 0000000000..e882433017 --- /dev/null +++ b/keyboards/bigseries/2key/readme.md @@ -0,0 +1,15 @@ +# Big Series Keyboard + +![Big Series 2-Key](https://woodkeys.click/wp-content/uploads/2018/04/BigSeries_2u_Case_2018-Apr-03_08-45-05PM-000_CustomizedView8990071229.png) + +A PCB for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) +Hardware Supported: Big Series PCBs +Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](https://novelkeys.xyz) + +Make example for this keyboard (after setting up your build environment): + + make bigseries/2key:default + +See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/2key/rules.mk b/keyboards/bigseries/2key/rules.mk new file mode 100755 index 0000000000..772d56beb6 --- /dev/null +++ b/keyboards/bigseries/2key/rules.mk @@ -0,0 +1 @@ +# Dummy file to make the QMK build system happy \ No newline at end of file diff --git a/keyboards/bigseries/3key/3key.c b/keyboards/bigseries/3key/3key.c new file mode 100755 index 0000000000..3735c10543 --- /dev/null +++ b/keyboards/bigseries/3key/3key.c @@ -0,0 +1,26 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#include "3key.h" + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +#ifdef BACKLIGHT_ENABLE + backlight_task(); +#endif +}; diff --git a/keyboards/bigseries/3key/3key.h b/keyboards/bigseries/3key/3key.h new file mode 100755 index 0000000000..6aa843c263 --- /dev/null +++ b/keyboards/bigseries/3key/3key.h @@ -0,0 +1,28 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef BIGSWITCH_H +#define BIGSWITCH_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02 \ +) { \ + { K00, K01, K02 } \ +} + +#endif diff --git a/keyboards/bigseries/3key/config.h b/keyboards/bigseries/3key/config.h new file mode 100755 index 0000000000..e10b14db42 --- /dev/null +++ b/keyboards/bigseries/3key/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6073 +#define DEVICE_VER 0x0001 +#define MANUFACTURER WoodKeys.click +#define PRODUCT BigSeries Triple Keyboard +#define DESCRIPTION Triple key board for Novelkeys Big Series Switch + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 3 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0 } +#define MATRIX_COL_PINS { B4, B3, B5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 50 + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 11 +#ifdef RGBLIGHT_LIMIT_VAL +#undef RGBLIGHT_LIMIT_VAL +#endif +#define RGBLIGHT_LIMIT_VAL 128 +#endif + +#endif diff --git a/keyboards/bigseries/3key/info.json b/keyboards/bigseries/3key/info.json new file mode 100644 index 0000000000..4a288219a3 --- /dev/null +++ b/keyboards/bigseries/3key/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Big Series 3-Key", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}, {"x":2, "y":0, "w":4, "h":4}] + } + } +} diff --git a/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c b/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c new file mode 100755 index 0000000000..8e5b10db8b --- /dev/null +++ b/keyboards/bigseries/3key/keymaps/ctrl-alt-del/keymap.c @@ -0,0 +1,91 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_LCTL, KC_LALT, KC_DEL + ), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(7); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/3key/keymaps/default/keymap.c b/keyboards/bigseries/3key/keymaps/default/keymap.c new file mode 100755 index 0000000000..6f0ffc9e11 --- /dev/null +++ b/keyboards/bigseries/3key/keymaps/default/keymap.c @@ -0,0 +1,95 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A, KC_B, KC_C + ), +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(7); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_A: + if (record->event.pressed) { + SEND_STRING("Howdy!!\n"); + rgblight_step(); + return false; + } + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/3key/keymaps/tester/keymap.c b/keyboards/bigseries/3key/keymaps/tester/keymap.c new file mode 100755 index 0000000000..896a781fc5 --- /dev/null +++ b/keyboards/bigseries/3key/keymaps/tester/keymap.c @@ -0,0 +1,88 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_1, KC_2, KC_3), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(35); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/3key/readme.md b/keyboards/bigseries/3key/readme.md new file mode 100644 index 0000000000..d32ec486a0 --- /dev/null +++ b/keyboards/bigseries/3key/readme.md @@ -0,0 +1,15 @@ +# Big Series Keyboard + +![Big Series 3-Key](https://woodkeys.click/wp-content/uploads/2018/04/BigSeries_3u_Case_2018-Apr-03_07-03-31PM-000_CustomizedView20086357020.png) + +A PCB for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) +Hardware Supported: Big Series PCBs +Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](https://novelkeys.xyz) + +Make example for this keyboard (after setting up your build environment): + + make bigseries/3key:default + +See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/3key/rules.mk b/keyboards/bigseries/3key/rules.mk new file mode 100755 index 0000000000..772d56beb6 --- /dev/null +++ b/keyboards/bigseries/3key/rules.mk @@ -0,0 +1 @@ +# Dummy file to make the QMK build system happy \ No newline at end of file diff --git a/keyboards/bigseries/4key/4key.c b/keyboards/bigseries/4key/4key.c new file mode 100755 index 0000000000..891f11bbb0 --- /dev/null +++ b/keyboards/bigseries/4key/4key.c @@ -0,0 +1,23 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#include "4key.h" + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; diff --git a/keyboards/bigseries/4key/4key.h b/keyboards/bigseries/4key/4key.h new file mode 100755 index 0000000000..21373fdeda --- /dev/null +++ b/keyboards/bigseries/4key/4key.h @@ -0,0 +1,30 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef BIGSWITCH_H +#define BIGSWITCH_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, \ + K10, K11 \ +) { \ + { K00, K01 }, \ + { K10, K11 } \ +} + +#endif diff --git a/keyboards/bigseries/4key/config.h b/keyboards/bigseries/4key/config.h new file mode 100755 index 0000000000..3ebcfe0911 --- /dev/null +++ b/keyboards/bigseries/4key/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6074 +#define DEVICE_VER 0x0002 +#define MANUFACTURER WoodKeys.click +#define PRODUCT BigSeries Quad Keyboard +#define DESCRIPTION 4-key board for Novelkeys Big Series Switch + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 2 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B5 } +#define MATRIX_COL_PINS { B4, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 50 + +/* key combination for command */ +#define IS_COMMAND() ( \ + false \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef RGBLIGHT_ENABLE +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 +#ifdef RGBLIGHT_LIMIT_VAL +#undef RGBLIGHT_LIMIT_VAL +#endif +#define RGBLIGHT_LIMIT_VAL 128 +#endif + +#endif diff --git a/keyboards/bigseries/4key/info.json b/keyboards/bigseries/4key/info.json new file mode 100644 index 0000000000..bff643d389 --- /dev/null +++ b/keyboards/bigseries/4key/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Big Series 4-Key", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 16, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}, {"x":0, "y":1, "w":4, "h":4}, {"x":1, "y":1, "w":4, "h":4}] + } + } +} diff --git a/keyboards/bigseries/4key/keymaps/default/keymap.c b/keyboards/bigseries/4key/keymaps/default/keymap.c new file mode 100755 index 0000000000..1c65f44b08 --- /dev/null +++ b/keyboards/bigseries/4key/keymaps/default/keymap.c @@ -0,0 +1,89 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_HOME, KC_PGUP, + KC_END, KC_PGDN), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + rgblight_enable(); + rgblight_mode(7); + rgblight_sethsv(0,255,255); + rgblight_setrgb(0x00, 0x00, 0xFF); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + rgblight_step(); + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/4key/keymaps/tester/keymap.c b/keyboards/bigseries/4key/keymaps/tester/keymap.c new file mode 100755 index 0000000000..5d5fe0d386 --- /dev/null +++ b/keyboards/bigseries/4key/keymaps/tester/keymap.c @@ -0,0 +1,88 @@ +/* +Copyright 2018 Cole Markham + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_A, KC_B, KC_C, KC_D), + + +}; + + +bool initialized = 0; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE ; +} + +void matrix_init_user(void) { + if (!initialized){ + dprintf("Initializing in matrix_scan_user"); + // Disable to set a known state + rgblight_disable(); + rgblight_init(); + // None of the subsequent operations take effect if not enabled + rgblight_enable(); + rgblight_sethsv(0,0,255); + rgblight_mode(35); + initialized = 1; + } +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/bigseries/4key/readme.md b/keyboards/bigseries/4key/readme.md new file mode 100644 index 0000000000..ec40e83f2c --- /dev/null +++ b/keyboards/bigseries/4key/readme.md @@ -0,0 +1,15 @@ +# Big Series Keyboard + +![Big Series 4-Key](https://woodkeys.click/wp-content/uploads/2017/09/BigSeries_4u_with_keys_2018-Apr-01_04-54-09AM-000_CustomizedView38438685666_png.png) + +A PCB for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). + +Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) +Hardware Supported: Big Series PCBs +Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](https://novelkeys.xyz) + +Make example for this keyboard (after setting up your build environment): + + make bigseries/4key:default + +See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/4key/rules.mk b/keyboards/bigseries/4key/rules.mk new file mode 100755 index 0000000000..772d56beb6 --- /dev/null +++ b/keyboards/bigseries/4key/rules.mk @@ -0,0 +1 @@ +# Dummy file to make the QMK build system happy \ No newline at end of file diff --git a/keyboards/bigseries/bigseries.c b/keyboards/bigseries/bigseries.c deleted file mode 100755 index 0ef84478b3..0000000000 --- a/keyboards/bigseries/bigseries.c +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ -#include "bigseries.h" - -void matrix_scan_kb(void) { - // Looping keyboard code goes here - // This runs every cycle (a lot) - matrix_scan_user(); -#ifdef BACKLIGHT_ENABLE - backlight_task(); -#endif -}; diff --git a/keyboards/bigseries/bigseries.h b/keyboards/bigseries/bigseries.h deleted file mode 100755 index 3441407798..0000000000 --- a/keyboards/bigseries/bigseries.h +++ /dev/null @@ -1,28 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ -#ifndef BIGSWITCH_H -#define BIGSWITCH_H - -#include "quantum.h" - -#define LAYOUT( \ - K00 \ -) { \ - { K00 } \ -} - -#endif diff --git a/keyboards/bigseries/config.h b/keyboards/bigseries/config.h deleted file mode 100755 index 3c401f563b..0000000000 --- a/keyboards/bigseries/config.h +++ /dev/null @@ -1,59 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6071 -#define DEVICE_VER 0x0002 -#define MANUFACTURER WoodKeys.click -#define PRODUCT BigSeries Single Keyboard -#define DESCRIPTION Single key board for Novelkeys Big Series Switch - -/* key matrix size */ -#define MATRIX_ROWS 1 -#define MATRIX_COLS 1 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { B0 } -#define MATRIX_COL_PINS { B4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 - -/* key combination for command */ -#define IS_COMMAND() ( \ - false \ -) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - -#ifdef RGBLIGHT_ENABLE -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 5 -#endif - -#endif diff --git a/keyboards/bigseries/info.json b/keyboards/bigseries/info.json deleted file mode 100644 index ff2fd54c57..0000000000 --- a/keyboards/bigseries/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Big Series 1-Key", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 4, - "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0, "w":4, "h":4}] - } - } -} diff --git a/keyboards/bigseries/keymaps/8ball/keymap.c b/keyboards/bigseries/keymaps/8ball/keymap.c deleted file mode 100755 index 1097eb94af..0000000000 --- a/keyboards/bigseries/keymaps/8ball/keymap.c +++ /dev/null @@ -1,144 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#include QMK_KEYBOARD_H - -static const char * const ANSWERS[] = { -// "Yes" answers -"It is certain\n", -"It is decidedly so\n", -"Without a doubt\n", -"Yes definitely\n", -"You may rely on it\n", -"As I see it, yes\n", -"Most likely\n", -"Outlook good\n", -"Yes\n", -"Signs point to yes\n", -// Uncertain answers, index 10 -"Reply hazy try again\n", -"Ask again later\n", -"Better not tell you now\n", -"Cannot predict now\n", -"Concentrate and ask again\n", -// "No" answers, index 15 -"Don't count on it\n", -"My reply is no\n", -"My sources say no\n", -"Outlook not so good\n", -"Very doubtful\n" -}; - -#define UNCERTAIN_BREAK 10 -#define NO_BREAK 15 -#define NUM_ANSWERS 20 -// Timeout of answer color in ms -#define ANSWER_TIMEOUT 3000 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -LAYOUT( - KC_A), -}; - - -void reset_rgb(void); - -bool initialized = 0; -uint32_t lastTime = 0; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - -void matrix_init_user(void) { - if (!initialized){ - dprintf("Initializing in matrix_scan_user"); - rgblight_enable(); - reset_rgb(); - initialized = 1; - } -} - -void matrix_scan_user(void) { - if (lastTime > 0 && timer_elapsed32(lastTime) > ANSWER_TIMEOUT) { - lastTime = 0; - reset_rgb(); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_A: - if (record->event.pressed) { - uint8_t num = rand() / (RAND_MAX / NUM_ANSWERS + 1); - rgblight_mode(1); - if (num < UNCERTAIN_BREAK) { - rgblight_setrgb_green(); - } else if (num < NO_BREAK) { - rgblight_setrgb_yellow(); - } else { - rgblight_setrgb_red(); - } - send_string(ANSWERS[num]); - lastTime = timer_read32(); - return false; - } - } - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} - -void reset_rgb(void) { - // This gets called on init and after the timeout for the answer color - // If you want to change the default color/mode, do it here - rgblight_sethsv_blue(); - rgblight_mode(7); -} diff --git a/keyboards/bigseries/keymaps/default/keymap.c b/keyboards/bigseries/keymaps/default/keymap.c deleted file mode 100755 index 7ce837357f..0000000000 --- a/keyboards/bigseries/keymaps/default/keymap.c +++ /dev/null @@ -1,93 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -LAYOUT( - KC_A), - - -}; - - -bool initialized = 0; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - -void matrix_init_user(void) { - if (!initialized){ - dprintf("Initializing in matrix_scan_user"); - rgblight_enable(); - rgblight_mode(7); - rgblight_sethsv(0,255,255); - rgblight_setrgb(0x00, 0x00, 0xFF); - initialized = 1; - } -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_A: - if (record->event.pressed) { - SEND_STRING("Howdy!!\n"); - rgblight_step(); - return false; - } - } - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/bigseries/keymaps/dudeofawesome/README.md b/keyboards/bigseries/keymaps/dudeofawesome/README.md deleted file mode 100644 index 86b79b4621..0000000000 --- a/keyboards/bigseries/keymaps/dudeofawesome/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# DudeOfAwesome's Big Series 1-key layout - -## Features - -### Tap dancing taps: -1. Media Play / Pause -1. Media Next -1. RGB Mode Next -1. RGB Mode Previous - -## Building and flashing - -1. Put your board in DFU mode with the button on the bottom -1. Flash: - ```bash - $ make bigseries:dudeofawesome:dfu - ``` - diff --git a/keyboards/bigseries/keymaps/dudeofawesome/config.h b/keyboards/bigseries/keymaps/dudeofawesome/config.h deleted file mode 100644 index 30b86224c6..0000000000 --- a/keyboards/bigseries/keymaps/dudeofawesome/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#define TAPPING_TERM 1000 - -#endif diff --git a/keyboards/bigseries/keymaps/dudeofawesome/keymap.c b/keyboards/bigseries/keymaps/dudeofawesome/keymap.c deleted file mode 100755 index 4c3739bbeb..0000000000 --- a/keyboards/bigseries/keymaps/dudeofawesome/keymap.c +++ /dev/null @@ -1,50 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#include QMK_KEYBOARD_H - -enum TAP_DANCE { - TD_PLAY = 0, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT(TD(TD_PLAY)), -}; - -void tap_dance (qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 0 ... 1: - register_code(KC_MEDIA_PLAY_PAUSE); - unregister_code(KC_MEDIA_PLAY_PAUSE); - break; - case 2: - register_code(KC_MEDIA_NEXT_TRACK); - unregister_code(KC_MEDIA_NEXT_TRACK); - break; - case 3: - rgblight_step(); - break; - case 4: default: - rgblight_step_reverse(); - break; - } -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_PLAY] = ACTION_TAP_DANCE_FN(tap_dance), -}; diff --git a/keyboards/bigseries/keymaps/dudeofawesome/rules.mk b/keyboards/bigseries/keymaps/dudeofawesome/rules.mk deleted file mode 100644 index e5ddcae8d9..0000000000 --- a/keyboards/bigseries/keymaps/dudeofawesome/rules.mk +++ /dev/null @@ -1 +0,0 @@ -TAP_DANCE_ENABLE = yes diff --git a/keyboards/bigseries/keymaps/leddance/config.h b/keyboards/bigseries/keymaps/leddance/config.h deleted file mode 100644 index 57398fb996..0000000000 --- a/keyboards/bigseries/keymaps/leddance/config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#define TAPPING_TERM 400 - -#endif diff --git a/keyboards/bigseries/keymaps/leddance/keymap.c b/keyboards/bigseries/keymaps/leddance/keymap.c deleted file mode 100755 index 3cd8f1db7f..0000000000 --- a/keyboards/bigseries/keymaps/leddance/keymap.c +++ /dev/null @@ -1,127 +0,0 @@ -/* -Copyright 2018 Cole Markham - -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 . -*/ - -#include QMK_KEYBOARD_H - - -extern rgblight_config_t rgblight_config; - -enum custom_keycodes { - BL = SAFE_RANGE -}; - -enum custom_layers { - BASE = 0, - LED -}; - -//Tap Dance Declarations -enum { - TD_TOGGLE = 0 -}; - -void dance_toggle (qk_tap_dance_state_t *state, void *user_data) { - if (state->count >= 2) { - println("Double tapped, switching layers"); - if (layer_state_is(LED)) { - layer_off(LED); - } else { - layer_on(LED); - } - } else { - print("Single tapped: "); - if (layer_state_is(LED)) { -#ifdef RGBLIGHT_ENABLE - if (!rgblight_config.enable) { - rgblight_enable(); - } - rgblight_step(); -#endif - } else { - println("Base layer, sending string"); - SEND_STRING("This thing is BIG!!\n"); - } - } -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_TOGGLE] = ACTION_TAP_DANCE_FN(dance_toggle) -// Other declarations would go here, separated by commas, if you have them -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -[BASE] = LAYOUT( - TD(TD_TOGGLE)), -[LED] = LAYOUT( - TD(TD_TOGGLE) - ) - - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE ; -} - - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Nothing here, see dance_toggle - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/bigseries/keymaps/leddance/rules.mk b/keyboards/bigseries/keymaps/leddance/rules.mk deleted file mode 100644 index 1ba2fa8fbe..0000000000 --- a/keyboards/bigseries/keymaps/leddance/rules.mk +++ /dev/null @@ -1 +0,0 @@ -TAP_DANCE_ENABLE = yes \ No newline at end of file diff --git a/keyboards/bigseries/readme.md b/keyboards/bigseries/readme.md index 528df0de09..0b40667353 100644 --- a/keyboards/bigseries/readme.md +++ b/keyboards/bigseries/readme.md @@ -1,15 +1,16 @@ -# Big Series Keyboard +# Big Series Keyboards -![Big Series 1-Key](https://woodkeys.click/wp-content/uploads/2017/12/woodkeys_419.jpg) +![Big Series Keyboards](https://woodkeys.click/wp-content/uploads/2017/12/woodkeys_419.jpg) -A PCB for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). +The is the parent folder for all PCBs made by [Woodkeys](https://woodkeys.click) for the Big Series Switch by [NovelKeys](https://novelkeys.xyz). Available in 1, 2, 3, and 4 switch versions from [Woodkeys.click](https://woodkeys.click/product-category/big-series/). Keyboard Maintainer: [Cole Markham](https://github.com/colemarkham) / [Woodkeys.click](https://woodkeys.click) Hardware Supported: Big Series PCBs Hardware Availability: [Woodkeys.click](https://woodkeys.click), [NovelKeys](https://novelkeys.xyz) -Make example for this keyboard (after setting up your build environment): +Make example for these keyboards (after setting up your build environment): - make bigseries:default + make bigseries/1key:default + make bigseries/3key:ctrl-alt-del See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/build-compile-instructions) for more information. diff --git a/keyboards/bigseries/rules.mk b/keyboards/bigseries/rules.mk index 4cac07f725..c862f0b256 100755 --- a/keyboards/bigseries/rules.mk +++ b/keyboards/bigseries/rules.mk @@ -1,5 +1,3 @@ -#SRC += rgb_backlight.c - # MCU name MCU = atmega32u2 -- cgit v1.2.3 From 10b4591d88c2573ee3bdf99d195856f66c4899c3 Mon Sep 17 00:00:00 2001 From: DeastinY Date: Sun, 19 Aug 2018 21:30:28 +0200 Subject: Keymap: Added deastiny layout for contra [based on dvorak type II] (#3673) * Added deastiny layout for contra [based on dvorak type II] * added questionmark and slash to another layer * added pragma once --- keyboards/contra/keymaps/deastiny/config.h | 37 ++++++++ keyboards/contra/keymaps/deastiny/keymap.c | 142 ++++++++++++++++++++++++++++ keyboards/contra/keymaps/deastiny/readme.md | 56 +++++++++++ 3 files changed, 235 insertions(+) create mode 100644 keyboards/contra/keymaps/deastiny/config.h create mode 100644 keyboards/contra/keymaps/deastiny/keymap.c create mode 100644 keyboards/contra/keymaps/deastiny/readme.md diff --git a/keyboards/contra/keymaps/deastiny/config.h b/keyboards/contra/keymaps/deastiny/config.h new file mode 100644 index 0000000000..8757eb70d4 --- /dev/null +++ b/keyboards/contra/keymaps/deastiny/config.h @@ -0,0 +1,37 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/contra/keymaps/deastiny/keymap.c b/keyboards/contra/keymaps/deastiny/keymap.c new file mode 100644 index 0000000000..846cbe9c7b --- /dev/null +++ b/keyboards/contra/keymaps/deastiny/keymap.c @@ -0,0 +1,142 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_extras/keymap_german.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + DVORAK = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/** +,-----------------------------------------------------------------------------------. + | ESC | Ü | , | . | P | Y | F | G | C | T | Z | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | TAB | A | O | E | I | U | H | D | R | N | S | L | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| Ä | Ö | Q | J | K | X | B | M | W | V |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | CTRL | GUI | Alt | MOD |Lower | Space |Raise | Left |Right | Up |Down | + `-----------------------------------------------------------------------------------' +**/ + [_DVORAK] = LAYOUT_planck_mit( + KC_ESC, DE_UE, DE_COMM, DE_DOT, DE_P, DE_Y, DE_F, DE_G, DE_C, DE_T, DE_Z, KC_BSPC, + KC_TAB, DE_A, DE_O, DE_E, DE_I, DE_U, DE_H, DE_D, DE_R, DE_N, DE_S, DE_L, + KC_LSFT, DE_AE, DE_OE, DE_Q, DE_J, DE_K, DE_X, DE_B, DE_M, DE_W, DE_V, KC_ENT , + KC_LCTL, KC_LGUI, KC_LALT, MO(3), LOWER, KC_SPC, RAISE, KC_LEFT, KC_RIGHT, KC_UP, KC_DOWN + ), + + /* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_mit( + DE_TILD, DE_EXLM, DE_AT, DE_HASH, DE_DLR, DE_PERC, DE_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, DE_QST, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_mit( + DE_GRV, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, DE_EQL, DE_LBRC, DE_RBRC, DE_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, DE_SLSH, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + + /* Adjust (MO(3)) + * ,-----------------------------------------------------------------------------------. + * | | HOME | UP | END | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_mit( + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case DVORAK: + if (record->event.pressed) { + print("mode just switched to dvorak and this is a huge string\n"); + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/contra/keymaps/deastiny/readme.md b/keyboards/contra/keymaps/deastiny/readme.md new file mode 100644 index 0000000000..61d722847e --- /dev/null +++ b/keyboards/contra/keymaps/deastiny/readme.md @@ -0,0 +1,56 @@ +# A Dvorak Type II based board + +As I switched from a Poker II some keys are based on my experience there. + + +## DVORAK (Normal) Layer +``` +,-----------------------------------------------------------------------------------. + | ESC | Ü | , | . | P | Y | F | G | C | T | Z | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | TAB | A | O | E | I | U | H | D | R | N | S | L | + |------+------+------+------+------+------|------+------+------+------+------+------| + | Shift| Ä | Ö | Q | J | K | X | B | M | W | V |Enter | + |------+------+------+------+------+------+------+------+------+------+------+------| + | CTRL | OS | Alt | MO(3)|Lower | Space |Raise | Left |Right | Up |Down | + `-----------------------------------------------------------------------------------' +``` + +## Lower +``` +,-----------------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | ? | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' +``` + +## Raise +``` +,-----------------------------------------------------------------------------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |------+------+------+------+------+-------------+------+------+------+------+------| + | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | / | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | Next | Vol- | Vol+ | Play | + `-----------------------------------------------------------------------------------' +``` + +## Adjust (MO(3)) +``` + ,-----------------------------------------------------------------------------------. + | | HOME | UP | END | | | | | | | | Del | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | LEFT | DOWN | RIGHT| | | | | | | | | + |------+------+------+------+------+------|------+------+------+------+------+------| + | | | | | | | | | | | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` \ No newline at end of file -- cgit v1.2.3 From 78a01068a46fb1ba969f3f7875ffc08a8acb6f15 Mon Sep 17 00:00:00 2001 From: Biacco42 Date: Mon, 20 Aug 2018 04:52:23 +0900 Subject: Keymap: Remove needless lines / files for Ergo42 (#3685) --- keyboards/ergo42/keymaps/biacco-macOS/config.h | 6 +----- keyboards/ergo42/keymaps/biacco-macOS/rules.mk | 3 --- keyboards/ergo42/keymaps/biacco-underglow/config.h | 6 +----- keyboards/ergo42/keymaps/biacco-underglow/rules.mk | 4 ---- keyboards/ergo42/keymaps/biacco/config.h | 6 +----- keyboards/ergo42/keymaps/biacco/rules.mk | 3 --- keyboards/ergo42/keymaps/default-illustrator/config.h | 6 +----- keyboards/ergo42/keymaps/default-illustrator/rules.mk | 3 --- keyboards/ergo42/keymaps/default-underglow/config.h | 6 +----- keyboards/ergo42/keymaps/default/config.h | 6 +----- keyboards/ergo42/keymaps/default/rules.mk | 3 --- keyboards/ergo42/keymaps/hdbx/config.h | 6 +----- keyboards/ergo42/keymaps/hdbx/rules.mk | 5 ----- keyboards/ergo42/keymaps/ichi-t/config.h | 6 +----- 14 files changed, 8 insertions(+), 61 deletions(-) delete mode 100644 keyboards/ergo42/keymaps/biacco-macOS/rules.mk delete mode 100644 keyboards/ergo42/keymaps/biacco/rules.mk delete mode 100644 keyboards/ergo42/keymaps/default-illustrator/rules.mk delete mode 100644 keyboards/ergo42/keymaps/default/rules.mk delete mode 100644 keyboards/ergo42/keymaps/hdbx/rules.mk diff --git a/keyboards/ergo42/keymaps/biacco-macOS/config.h b/keyboards/ergo42/keymaps/biacco-macOS/config.h index 5a6261c4f7..360d6a5621 100644 --- a/keyboards/ergo42/keymaps/biacco-macOS/config.h +++ b/keyboards/ergo42/keymaps/biacco-macOS/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,4 +31,3 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -#endif diff --git a/keyboards/ergo42/keymaps/biacco-macOS/rules.mk b/keyboards/ergo42/keymaps/biacco-macOS/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/ergo42/keymaps/biacco-macOS/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergo42/keymaps/biacco-underglow/config.h b/keyboards/ergo42/keymaps/biacco-underglow/config.h index bc80be306a..efadfa8143 100644 --- a/keyboards/ergo42/keymaps/biacco-underglow/config.h +++ b/keyboards/ergo42/keymaps/biacco-underglow/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -40,4 +37,3 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_SLEEP -#endif diff --git a/keyboards/ergo42/keymaps/biacco-underglow/rules.mk b/keyboards/ergo42/keymaps/biacco-underglow/rules.mk index 75e9c6503e..1e3cebb145 100644 --- a/keyboards/ergo42/keymaps/biacco-underglow/rules.mk +++ b/keyboards/ergo42/keymaps/biacco-underglow/rules.mk @@ -1,5 +1 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - RGBLIGHT_ENABLE = yes diff --git a/keyboards/ergo42/keymaps/biacco/config.h b/keyboards/ergo42/keymaps/biacco/config.h index 5a6261c4f7..360d6a5621 100644 --- a/keyboards/ergo42/keymaps/biacco/config.h +++ b/keyboards/ergo42/keymaps/biacco/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,4 +31,3 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -#endif diff --git a/keyboards/ergo42/keymaps/biacco/rules.mk b/keyboards/ergo42/keymaps/biacco/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/ergo42/keymaps/biacco/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergo42/keymaps/default-illustrator/config.h b/keyboards/ergo42/keymaps/default-illustrator/config.h index 5a6261c4f7..360d6a5621 100644 --- a/keyboards/ergo42/keymaps/default-illustrator/config.h +++ b/keyboards/ergo42/keymaps/default-illustrator/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,4 +31,3 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -#endif diff --git a/keyboards/ergo42/keymaps/default-illustrator/rules.mk b/keyboards/ergo42/keymaps/default-illustrator/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/ergo42/keymaps/default-illustrator/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergo42/keymaps/default-underglow/config.h b/keyboards/ergo42/keymaps/default-underglow/config.h index bc80be306a..efadfa8143 100644 --- a/keyboards/ergo42/keymaps/default-underglow/config.h +++ b/keyboards/ergo42/keymaps/default-underglow/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -40,4 +37,3 @@ along with this program. If not, see . #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_SLEEP -#endif diff --git a/keyboards/ergo42/keymaps/default/config.h b/keyboards/ergo42/keymaps/default/config.h index 5a6261c4f7..360d6a5621 100644 --- a/keyboards/ergo42/keymaps/default/config.h +++ b/keyboards/ergo42/keymaps/default/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,4 +31,3 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -#endif diff --git a/keyboards/ergo42/keymaps/default/rules.mk b/keyboards/ergo42/keymaps/default/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/ergo42/keymaps/default/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergo42/keymaps/hdbx/config.h b/keyboards/ergo42/keymaps/hdbx/config.h index 6bddef1ea7..4f0704ae1a 100644 --- a/keyboards/ergo42/keymaps/hdbx/config.h +++ b/keyboards/ergo42/keymaps/hdbx/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -44,4 +41,3 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#endif diff --git a/keyboards/ergo42/keymaps/hdbx/rules.mk b/keyboards/ergo42/keymaps/hdbx/rules.mk deleted file mode 100644 index 1e57612788..0000000000 --- a/keyboards/ergo42/keymaps/hdbx/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergo42/keymaps/ichi-t/config.h b/keyboards/ergo42/keymaps/ichi-t/config.h index 5a6261c4f7..360d6a5621 100644 --- a/keyboards/ergo42/keymaps/ichi-t/config.h +++ b/keyboards/ergo42/keymaps/ichi-t/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,4 +31,3 @@ along with this program. If not, see . // #define MASTER_RIGHT // #define EE_HANDS -#endif -- cgit v1.2.3 From c55313509ff244194d08cee0cc3152ca4349bea1 Mon Sep 17 00:00:00 2001 From: Biacco42 Date: Mon, 20 Aug 2018 04:53:41 +0900 Subject: Keyboard: Update Ergo42 default keymap (#3686) --- keyboards/ergo42/keymaps/default-underglow/keymap.c | 14 +++++++------- keyboards/ergo42/keymaps/default/keymap.c | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/keyboards/ergo42/keymaps/default-underglow/keymap.c b/keyboards/ergo42/keymaps/default-underglow/keymap.c index a4d812c5de..4d7242579a 100644 --- a/keyboards/ergo42/keymaps/default-underglow/keymap.c +++ b/keyboards/ergo42/keymaps/default-underglow/keymap.c @@ -32,14 +32,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | RGB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| * `------------------------------------------------' `------------------------------------------------' */ [BASE] = LAYOUT( \ - KC_ESC, 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_BSPC, \ - KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \ - MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ - MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_ESC, 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_BSPC, \ + KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \ + MO(RGB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + KC_LGUI, KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, MO(META), KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \ ), /* META @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | RGB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | | + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | | | | * `------------------------------------------------' `------------------------------------------------' */ [META] = LAYOUT( \ @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | RGB | | | | | | { | | } | | | | | UP | Sft | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| * `------------------------------------------------' `------------------------------------------------' */ [SYMB] = LAYOUT( \ diff --git a/keyboards/ergo42/keymaps/default/keymap.c b/keyboards/ergo42/keymaps/default/keymap.c index ced239c84b..6c4cc1a620 100644 --- a/keyboards/ergo42/keymaps/default/keymap.c +++ b/keyboards/ergo42/keymaps/default/keymap.c @@ -21,14 +21,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | SYMB | LSft | Z | X | C | V | B | | N | M | , | . | / | UP | RSft | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| * `------------------------------------------------' `------------------------------------------------' */ [BASE] = LAYOUT( \ - KC_ESC, 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_BSPC, \ - KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \ - MO(SYMB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ - MO(META), KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_ESC, 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_BSPC, \ + KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RBRC, KC_ENT, \ + MO(SYMB), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + KC_LGUI, KC_LCTL, KC_GRV, KC_BSLS, KC_LALT, MO(META), KC_SPC, KC_SPC, KC_QUOT, KC_MINS, KC_EQL, KC_LEFT, KC_DOWN, KC_RGHT \ ), /* META @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | SYMB | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | | | | + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | | | | * `------------------------------------------------' `------------------------------------------------' */ [META] = LAYOUT( \ @@ -57,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| * | SYMB | | | | | | { | | } | | | | | UP | Sft | * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | META | LCtrl| ` | \ | LAlt | LGUI |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| + * | LGUI | LCtrl| ` | \ | LAlt | META |Space | |Space | ' | - | = | LEFT | DOWN | RIGHT| * `------------------------------------------------' `------------------------------------------------' */ [SYMB] = LAYOUT( \ -- cgit v1.2.3 From ee238f121986277eee0124b852db6755b3ee5c04 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 19 Aug 2018 13:04:03 -0700 Subject: Keyboard: add 1up60hse (#3687) * initial commit * update readme * enable/disable some keyboard features and add 60_ansi community layout support * put my name everywhere * can't use numbers for defines * enable lighting * put in a default keymap, use the correct pins, and put in a switch matrix * update switch matrix to use KXY hex notation * add QMK Configurator support * add the rest of my name * update where to get this keyboard --- keyboards/1up60hse/1up60hse.c | 43 +++++ keyboards/1up60hse/1up60hse.h | 39 +++++ keyboards/1up60hse/config.h | 224 +++++++++++++++++++++++++++ keyboards/1up60hse/info.json | 12 ++ keyboards/1up60hse/keymaps/default/config.h | 19 +++ keyboards/1up60hse/keymaps/default/keymap.c | 69 +++++++++ keyboards/1up60hse/keymaps/default/readme.md | 1 + keyboards/1up60hse/readme.md | 15 ++ keyboards/1up60hse/rules.mk | 72 +++++++++ 9 files changed, 494 insertions(+) create mode 100644 keyboards/1up60hse/1up60hse.c create mode 100644 keyboards/1up60hse/1up60hse.h create mode 100644 keyboards/1up60hse/config.h create mode 100644 keyboards/1up60hse/info.json create mode 100644 keyboards/1up60hse/keymaps/default/config.h create mode 100644 keyboards/1up60hse/keymaps/default/keymap.c create mode 100644 keyboards/1up60hse/keymaps/default/readme.md create mode 100644 keyboards/1up60hse/readme.md create mode 100644 keyboards/1up60hse/rules.mk diff --git a/keyboards/1up60hse/1up60hse.c b/keyboards/1up60hse/1up60hse.c new file mode 100644 index 0000000000..c04018d62c --- /dev/null +++ b/keyboards/1up60hse/1up60hse.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "1up60hse.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/1up60hse/1up60hse.h b/keyboards/1up60hse/1up60hse.h new file mode 100644 index 0000000000..d24bbaabf6 --- /dev/null +++ b/keyboards/1up60hse/1up60hse.h @@ -0,0 +1,39 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef KB_H +#define KB_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ + K40, K41, K42, K45, K49, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D } \ +} +#endif diff --git a/keyboards/1up60hse/config.h b/keyboards/1up60hse/config.h new file mode 100644 index 0000000000..b89a13b3d2 --- /dev/null +++ b/keyboards/1up60hse/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT 1up60hse +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/1up60hse/info.json b/keyboards/1up60hse/info.json new file mode 100644 index 0000000000..b765a376c7 --- /dev/null +++ b/keyboards/1up60hse/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "1up60hse", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/1up60hse/keymaps/default/config.h b/keyboards/1up60hse/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/1up60hse/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1up60hse/keymaps/default/keymap.c new file mode 100644 index 0000000000..040f9ebedb --- /dev/null +++ b/keyboards/1up60hse/keymaps/default/keymap.c @@ -0,0 +1,69 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + KC_ESC, 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_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_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_RGUI, KC_LCTL), + + [1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/1up60hse/keymaps/default/readme.md b/keyboards/1up60hse/keymaps/default/readme.md new file mode 100644 index 0000000000..22f10a9312 --- /dev/null +++ b/keyboards/1up60hse/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for 1up60hse diff --git a/keyboards/1up60hse/readme.md b/keyboards/1up60hse/readme.md new file mode 100644 index 0000000000..7eb4253945 --- /dev/null +++ b/keyboards/1up60hse/readme.md @@ -0,0 +1,15 @@ +# 1up60hse + +![1up60hse](imgur.com image replace me!) + +A 60% PCB with USB C, RGB underglow, backlighting, and hotswappable switches. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: The PCBs, controllers supported +Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) + +Make example for this keyboard (after setting up your build environment): + + make 1up60hse:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/1up60hse/rules.mk b/keyboards/1up60hse/rules.mk new file mode 100644 index 0000000000..f33e33fd9e --- /dev/null +++ b/keyboards/1up60hse/rules.mk @@ -0,0 +1,72 @@ +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) + +LAYOUTS = 60_ansi -- cgit v1.2.3 From 8bc771a84247b59ab924cc241f455beec6384362 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Sat, 18 Aug 2018 19:38:44 -0700 Subject: Added arrow layout. --- keyboards/zen/keymaps/333fred/keymap.c | 27 ++++++++++++++++++++++++--- users/333fred/333fred.h | 1 + 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/keyboards/zen/keymaps/333fred/keymap.c b/keyboards/zen/keymaps/333fred/keymap.c index 5332062e04..eeab87ad31 100644 --- a/keyboards/zen/keymaps/333fred/keymap.c +++ b/keyboards/zen/keymaps/333fred/keymap.c @@ -81,7 +81,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | CTRL | | | | F | | | | | | | | | + * | CTRL | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Shift| Z | | | | | | | | | | | GUI | * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| @@ -89,9 +89,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `------------------------------------------------..-----------------------------------------------' */ [GAME] = KEYMAP( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ + KC_ENT, TG(GAME_ARROW), KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ +), +/* Gaming Arrow mode (Raise) + * Turns wasd into arrows + * ,-----------------------------------------. .-----------------------------------------. + * | ESC | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | Up | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | CTRL | Left | Down | Right| | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | | | | | | | | | | | GUI | + * |------+------+------+------+------+------+------..------+------+------+------+------+------+------| + * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| + * `------------------------------------------------..-----------------------------------------------' + */ +[GAME_ARROW] = KEYMAP( \ KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_LSFT, KC_Z, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LGUI, \ KC_ENT, _______, KC_LOCK, KC_BSPC, KC_F5, KC_LALT, KC_SPC, OSL(SYMB), KC_F6, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(BASE) \ ) diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 8599198a57..3b6f21133b 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -8,6 +8,7 @@ #define MDIA 3 // media keys #define VIM 4 #define GAME 5 +#define GAME_ARROW 6 // Tap dance config shared between my keyboards enum tap_dance_declarations { -- cgit v1.2.3 From d87ef88de0303309a317283a292c52e7e89d6449 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Sun, 19 Aug 2018 13:18:19 -0700 Subject: Keyboard: add 5x5 board support (#3694) * 5x5 board support * 5x5 work * 5x5board config * add 5x5 board support --- keyboards/5x5/5x5.c | 29 +++++ keyboards/5x5/5x5.h | 57 +++++++++ keyboards/5x5/config.h | 208 +++++++++++++++++++++++++++++++++ keyboards/5x5/info.json | 0 keyboards/5x5/keymaps/default/config.h | 5 + keyboards/5x5/keymaps/default/keymap.c | 139 ++++++++++++++++++++++ keyboards/5x5/readme.md | 23 ++++ keyboards/5x5/rules.mk | 74 ++++++++++++ 8 files changed, 535 insertions(+) create mode 100644 keyboards/5x5/5x5.c create mode 100644 keyboards/5x5/5x5.h create mode 100644 keyboards/5x5/config.h create mode 100644 keyboards/5x5/info.json create mode 100644 keyboards/5x5/keymaps/default/config.h create mode 100644 keyboards/5x5/keymaps/default/keymap.c create mode 100644 keyboards/5x5/readme.md create mode 100644 keyboards/5x5/rules.mk diff --git a/keyboards/5x5/5x5.c b/keyboards/5x5/5x5.c new file mode 100644 index 0000000000..20e5246094 --- /dev/null +++ b/keyboards/5x5/5x5.c @@ -0,0 +1,29 @@ + +#include "5x5.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/5x5/5x5.h b/keyboards/5x5/5x5.h new file mode 100644 index 0000000000..cbfc28a901 --- /dev/null +++ b/keyboards/5x5/5x5.h @@ -0,0 +1,57 @@ + +#ifndef FIVEX5_H +#define FIVEX5_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_5x5( \ + K00, K01, K02, K03, K04, \ + K10, K11, K12, K13, K14, \ + K20, K21, K22, K23, K24, \ + K30, K31, K32, K33, K34, \ + K40, K41, K42, K43, K44 \ +) \ +{ \ + { K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x10( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ +} + +#endif diff --git a/keyboards/5x5/config.h b/keyboards/5x5/config.h new file mode 100644 index 0000000000..bc609934e3 --- /dev/null +++ b/keyboards/5x5/config.h @@ -0,0 +1,208 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x05B5 +#define MANUFACTURER di0ib +#define PRODUCT The 5x5 Keyboard +#define DESCRIPTION A 25 or 50 or 75 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/5x5/info.json b/keyboards/5x5/info.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/5x5/keymaps/default/config.h b/keyboards/5x5/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/5x5/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/5x5/keymaps/default/keymap.c b/keyboards/5x5/keymaps/default/keymap.c new file mode 100644 index 0000000000..a2c525d089 --- /dev/null +++ b/keyboards/5x5/keymaps/default/keymap.c @@ -0,0 +1,139 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +// Readability keycodes +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 5x5 board only + * .--------------------------------------------. + * | QWERTY | / | * | - | | + * |--------+--------+--------+--------+--------| + * | 7 | 8 | 9 | + | | + * |--------+--------+--------+--------+--------| + * | 4 | 5 | 6 | + | | + * |--------+--------+--------+--------+--------| + * | 1 | 2 | 3 | ENTER | | + * |--------+--------+--------+--------+--------| + * | 0 | 0 | . | ENTER | | + * '--------------------------------------------' + */ + + [PAD] = LAYOUT_ortho_5x5( + DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, + KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ + ), + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT + ), + +/* NUMBERS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | + * | | | | | | | | | | |CTRLhold| | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | ENTER | SHIFT | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, + _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/5x5/readme.md b/keyboards/5x5/readme.md new file mode 100644 index 0000000000..e25535968d --- /dev/null +++ b/keyboards/5x5/readme.md @@ -0,0 +1,23 @@ +# 5x5 + +![5x5](https://3.bp.blogspot.com/-bKOfUyMtdrE/WqGA_03kGZI/AAAAAAACPtY/DsHDTQS0IlMD3ie8HHlf1ATRUAwpZdcSgCLcBGAs/s1600/c.jpg) +=== + +**Modular Keypad/Keyboard** +The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. +5x5, 5x10, and 5x15 matrices are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) + +Keyboard Maintainer: QMK Community +Hardware Supported: 5x5 PCB +Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) + +Make example for this keyboard (after setting up your build environment): + + make 5x5:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/5x5/rules.mk b/keyboards/5x5/rules.mk new file mode 100644 index 0000000000..b04e4a527c --- /dev/null +++ b/keyboards/5x5/rules.mk @@ -0,0 +1,74 @@ +# 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 + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = caterina + +# 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 = no # USB Nkey Rollover +BACKLIGHT_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) + +LAYOUT = ortho_5x5 ortho_5x10 ortho_5x15 -- cgit v1.2.3 From 4cc1edbb67beecd0081fb84d3b5365e55d1a41e1 Mon Sep 17 00:00:00 2001 From: aydenvis <38897937+aydenvis@users.noreply.github.com> Date: Sun, 19 Aug 2018 15:23:13 -0500 Subject: Keyboard: Add QWERTYYdox keyboard (#3636) * Add files via upload * Update readme.md * Update readme.md * Update readme.md * Add files via upload * Delete split_util.h * Delete split_util.c * Delete serial.h * Delete serial.c * Delete matrix.c * Delete i2c.h * Delete i2c.c * Update rules.mk * Update config.h * Update readme.md * Update readme.md --- keyboards/qwertyydox/config.h | 90 ++++++++++++++++++++++++++ keyboards/qwertyydox/info.json | 16 +++++ keyboards/qwertyydox/keymaps/default/config.h | 43 +++++++++++++ keyboards/qwertyydox/keymaps/default/keymap.c | 83 ++++++++++++++++++++++++ keyboards/qwertyydox/keymaps/default/rules.mk | 1 + keyboards/qwertyydox/qwertyydox.c | 1 + keyboards/qwertyydox/qwertyydox.h | 24 +++++++ keyboards/qwertyydox/readme.md | 27 ++++++++ keyboards/qwertyydox/rev1/config.h | 91 +++++++++++++++++++++++++++ keyboards/qwertyydox/rev1/rev1.c | 22 +++++++ keyboards/qwertyydox/rev1/rev1.h | 37 +++++++++++ keyboards/qwertyydox/rev1/rules.mk | 1 + keyboards/qwertyydox/rules.mk | 69 ++++++++++++++++++++ 13 files changed, 505 insertions(+) create mode 100644 keyboards/qwertyydox/config.h create mode 100644 keyboards/qwertyydox/info.json create mode 100644 keyboards/qwertyydox/keymaps/default/config.h create mode 100644 keyboards/qwertyydox/keymaps/default/keymap.c create mode 100644 keyboards/qwertyydox/keymaps/default/rules.mk create mode 100644 keyboards/qwertyydox/qwertyydox.c create mode 100644 keyboards/qwertyydox/qwertyydox.h create mode 100644 keyboards/qwertyydox/readme.md create mode 100644 keyboards/qwertyydox/rev1/config.h create mode 100644 keyboards/qwertyydox/rev1/rev1.c create mode 100644 keyboards/qwertyydox/rev1/rev1.h create mode 100644 keyboards/qwertyydox/rev1/rules.mk create mode 100644 keyboards/qwertyydox/rules.mk diff --git a/keyboards/qwertyydox/config.h b/keyboards/qwertyydox/config.h new file mode 100644 index 0000000000..5c4f8a6b2a --- /dev/null +++ b/keyboards/qwertyydox/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2018 Ayden + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0100 +#define MANUFACTURER AYDENandDAD Youtube +#define PRODUCT QWERTYYdox +#define DESCRIPTION Split 45 percent ergonomic keyboard with two Y keys + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { B6, B2, B3, B1 } +#define MATRIX_COL_PINS { F7, F6, F5, C6, D7, D4, D1 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN E6 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D6 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 + +#endif diff --git a/keyboards/qwertyydox/info.json b/keyboards/qwertyydox/info.json new file mode 100644 index 0000000000..0b762388ec --- /dev/null +++ b/keyboards/qwertyydox/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "QWERTYYdox", + "manufacturer": "aydenvis", + "identifier": "0x1256", + "url": "", + "maintainer": "qmk", + "processor": "atmega32u4", + "width": 14, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 53, + "layout": [{"label":"L00", "x":0, "y":0.375}, {"label":"L01", "x":1, "y":0.25}, {"label":"L02", "x":2, "y":0.125}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0.125}, {"label":"L05", "x":5, "y":0.25}, {"label":"L06", "x":6, "y":0.5}, {"label":"R00", "x":9, "y":0.5}, {"label":"R01", "x":10, "y":0.25}, {"label":"R02", "x":11, "y":0.125}, {"label":"R03", "x":12, "y":0}, {"label":"R04", "x":13, "y":0.125}, {"label":"R05", "x":14, "y":0.25}, {"label":"R06", "x":15, "y":0.375}, {"label":"L10", "x":0, "y":1.375}, {"label":"L11", "x":1, "y":1.25}, {"label":"L12", "x":2, "y":1.125}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1.125}, {"label":"L15", "x":5, "y":1.25}, {"label":"L16", "x":6, "y":1.5}, {"label":"R10", "x":9, "y":1.5}, {"label":"R11", "x":10, "y":1.25}, {"label":"R12", "x":11, "y":1.125}, {"label":"R13", "x":12, "y":1}, {"label":"R14", "x":13, "y":1.125}, {"label":"R15", "x":14, "y":1.25}, {"label":"R16", "x":15, "y":1.375}, {"label":"L20", "x":0, "y":2.375}, {"label":"L21", "x":1, "y":2.25}, {"label":"L22", "x":2, "y":2.125}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2.125}, {"label":"L25", "x":5, "y":2.25}, {"label":"L26", "x":6.5, "y":3}, {"label":"R20", "x":8.5, "y":3}, {"label":"R21", "x":10, "y":2.25}, {"label":"R22", "x":11, "y":2.125}, {"label":"R23", "x":12, "y":2}, {"label":"R24", "x":13, "y":2.125}, {"label":"R25", "x":14, "y":2.25}, {"label":"R26", "x":15, "y":2.375}, {"label":"L30", "x":0, "y":3.375}, {"label":"L31", "x":1, "y":3.25}, {"label":"L32", "x":2, "y":3.125}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":5.5, "y":4}, {"label":"L35", "x":6.5, "y":4}, {"label":"R30", "x":8.5, "y":4}, {"label":"R31", "x":9.5, "y":4}, {"label":"R32", "x":12, "y":3}, {"label":"R33", "x":13, "y":3.125}, {"label":"R34", "x":14, "y":3.25}, {"label":"R35", "x":15, "y":3.375}] + } + } +} diff --git a/keyboards/qwertyydox/keymaps/default/config.h b/keyboards/qwertyydox/keymaps/default/config.h new file mode 100644 index 0000000000..6b4e3fe96e --- /dev/null +++ b/keyboards/qwertyydox/keymaps/default/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2018 Ayden . +*/ + +#pragma once + +/* 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 + +#define MOUSEKEY_DELAY 150 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 10 +#define MOUSEKEY_TIME_TO_MAX 10 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 \ No newline at end of file diff --git a/keyboards/qwertyydox/keymaps/default/keymap.c b/keyboards/qwertyydox/keymaps/default/keymap.c new file mode 100644 index 0000000000..5967c5146f --- /dev/null +++ b/keyboards/qwertyydox/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _NUM 1 +#define _NAV 2 +enum custom_keycodes { + qwerty = SAFE_RANGE, + nav, + num, + EQL +}; + +// #define KC_ KC_TRNS +#define __ KC_NO +#define NAV TO(2) +#define NUM TO(1) +#define ALPHA TO(0) +#define NPLUS KC_KP_PLUS +#define NMINUS KC_KP_MINUS +#define NSTAR KC_KP_ASTERISK +#define NSLASH KC_KP_SLASH + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + 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_BSLS, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, __, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_LGUI, KC_LALT, qwerty, KC_ENT, KC_DEL, NUM, NAV, KC_SPC, KC_BSPC, KC_LEFT, KC_RALT, KC_RGUI, KC_RCTL + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_NUM] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + 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_NO, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + 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_NO, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, __, KC_NO, KC_PPLS, KC_PMNS, EQL, KC_PAST, KC_PSLS, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LCTL, KC_ESC, KC_NO, num, KC_ENT, KC_LSFT, NAV, ALPHA, KC_SPC, KC_BSPC, KC_LEFT, KC_RALT, KC_RGUI, KC_RCTL + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_NAV] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_ESC, KC_NO, KC_ACL0, KC_ACL1, KC_ACL2, KC_WH_L, KC_WH_R, KC_ESC, KC_NO, KC_UP, NSLASH, NSTAR, NMINUS, NPLUS, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_WH_U, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT,KC_NO, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_INS, KC_HOME, KC_PGUP, KC_BTN1, KC_BTN2, KC_WH_D, __, KC_MS_L, KC_MS_U, KC_MS_D, KC_MS_R, KC_NO, KC_NO, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_DEL, KC_END, KC_PGDN, nav, KC_LCTL, KC_SPC, ALPHA, NUM, KC_LSFT, KC_BSPC, KC_NO, KC_NO, KC_NO, RESET + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case qwerty: + SEND_STRING("-QWERTY"); + return false; + case nav: + SEND_STRING("-NAV"); // selects all and copies + return false; + case num: + SEND_STRING("-NUM"); // selects all and copies + return false; + case EQL: + SEND_STRING("="); // selects all and copies + return false; + } + } + return true; +}; diff --git a/keyboards/qwertyydox/keymaps/default/rules.mk b/keyboards/qwertyydox/keymaps/default/rules.mk new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/keyboards/qwertyydox/keymaps/default/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/qwertyydox/qwertyydox.c b/keyboards/qwertyydox/qwertyydox.c new file mode 100644 index 0000000000..53c3eca648 --- /dev/null +++ b/keyboards/qwertyydox/qwertyydox.c @@ -0,0 +1 @@ +#include "qwertyydox.h" diff --git a/keyboards/qwertyydox/qwertyydox.h b/keyboards/qwertyydox/qwertyydox.h new file mode 100644 index 0000000000..57bd0dc54a --- /dev/null +++ b/keyboards/qwertyydox/qwertyydox.h @@ -0,0 +1,24 @@ +#ifndef QWERTYYDOX_H +#define QWERTYYDOX_H + +#ifdef KEYBOARD_qwertyydox_rev1 + #include "rev1.h" +#endif + +#include "quantum.h" + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + +#endif \ No newline at end of file diff --git a/keyboards/qwertyydox/readme.md b/keyboards/qwertyydox/readme.md new file mode 100644 index 0000000000..1fa984e031 --- /dev/null +++ b/keyboards/qwertyydox/readme.md @@ -0,0 +1,27 @@ +QWERTYYdox +==== + +![QWERTYYdox](https://imgur.com/gallery/Pwwb0Q0) + + +A split ergo 4x7 keyboard with 3 thumb keys and 2 Y keys. + +**Status** The QWERTYYdox is a personal project, however it is completely functional. + +Keyboard Maintainer: /u/aydenvis + +Hardware Supported: Pro Micro (ATmega32U4) + +Hardware Availability: The whole thing is handwired with plates cut by [/u/JOlimon](stratakb.com) + + +Make example for this keyboard (after setting up your build environment): + + make qwertyydox/rev1:default + +Example of flashing this keyboard: + + make qwertyydox/rev1:default:avrdude + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + diff --git a/keyboards/qwertyydox/rev1/config.h b/keyboards/qwertyydox/rev1/config.h new file mode 100644 index 0000000000..c5c4daa3d3 --- /dev/null +++ b/keyboards/qwertyydox/rev1/config.h @@ -0,0 +1,91 @@ +/* +Copyright 2018 Ayden + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0100 +#define MANUFACTURER AYDENandDAD +#define PRODUCT QWERTYdox Keyboard +#define DESCRIPTION Split 40 percent keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { B6, B2, B3, B1 } +#define MATRIX_COL_PINS { F7, F6, F5, C6, D7, D4, D1 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN E6 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D6 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + + +/* + * 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 + +#endif diff --git a/keyboards/qwertyydox/rev1/rev1.c b/keyboards/qwertyydox/rev1/rev1.c new file mode 100644 index 0000000000..609c479eb3 --- /dev/null +++ b/keyboards/qwertyydox/rev1/rev1.c @@ -0,0 +1,22 @@ +#include "rev1.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; diff --git a/keyboards/qwertyydox/rev1/rev1.h b/keyboards/qwertyydox/rev1/rev1.h new file mode 100644 index 0000000000..d620e62108 --- /dev/null +++ b/keyboards/qwertyydox/rev1/rev1.h @@ -0,0 +1,37 @@ +#ifndef REV1_H +#define REV1_H + +#include "qwertyydox.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20, }, \ + { R36, R35, R34, R33, R32, R31, R30 } \ + } + +#endif diff --git a/keyboards/qwertyydox/rev1/rules.mk b/keyboards/qwertyydox/rev1/rules.mk new file mode 100644 index 0000000000..7b30c0beff --- /dev/null +++ b/keyboards/qwertyydox/rev1/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = no diff --git a/keyboards/qwertyydox/rules.mk b/keyboards/qwertyydox/rules.mk new file mode 100644 index 0000000000..d8a287bbc8 --- /dev/null +++ b/keyboards/qwertyydox/rules.mk @@ -0,0 +1,69 @@ +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. +SUBPROJECT_rev1 = yes +USE_I2C = yes # I2C is used between the sides +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = qwertyydox/rev1 -- cgit v1.2.3 From 99da48c72b90e11e5ef945263530c6f8746848fd Mon Sep 17 00:00:00 2001 From: eucalyn Date: Mon, 20 Aug 2018 05:26:42 +0900 Subject: Keyboard: add mint60 keyboard (#3543) * add mint60 * change source by reviews --- keyboards/mint60/config.h | 235 +++++++++++++++++++ keyboards/mint60/i2c.c | 162 +++++++++++++ keyboards/mint60/i2c.h | 49 ++++ keyboards/mint60/info.json | 0 keyboards/mint60/keymaps/default/config.h | 23 ++ keyboards/mint60/keymaps/default/keymap.c | 104 +++++++++ keyboards/mint60/keymaps/default/readme.md | 1 + keyboards/mint60/keymaps/eucalyn/config.h | 23 ++ keyboards/mint60/keymaps/eucalyn/keymap.c | 104 +++++++++ keyboards/mint60/keymaps/eucalyn/readme.md | 3 + keyboards/mint60/matrix.c | 349 +++++++++++++++++++++++++++++ keyboards/mint60/mint60.c | 43 ++++ keyboards/mint60/mint60.h | 59 +++++ keyboards/mint60/readme.md | 15 ++ keyboards/mint60/rules.mk | 78 +++++++ keyboards/mint60/serial.c | 295 ++++++++++++++++++++++++ keyboards/mint60/serial.h | 27 +++ keyboards/mint60/serial_config.h | 16 ++ keyboards/mint60/split_util.c | 70 ++++++ keyboards/mint60/split_util.h | 19 ++ 20 files changed, 1675 insertions(+) create mode 100644 keyboards/mint60/config.h create mode 100644 keyboards/mint60/i2c.c create mode 100644 keyboards/mint60/i2c.h create mode 100644 keyboards/mint60/info.json create mode 100644 keyboards/mint60/keymaps/default/config.h create mode 100644 keyboards/mint60/keymaps/default/keymap.c create mode 100644 keyboards/mint60/keymaps/default/readme.md create mode 100644 keyboards/mint60/keymaps/eucalyn/config.h create mode 100644 keyboards/mint60/keymaps/eucalyn/keymap.c create mode 100644 keyboards/mint60/keymaps/eucalyn/readme.md create mode 100644 keyboards/mint60/matrix.c create mode 100644 keyboards/mint60/mint60.c create mode 100644 keyboards/mint60/mint60.h create mode 100644 keyboards/mint60/readme.md create mode 100644 keyboards/mint60/rules.mk create mode 100644 keyboards/mint60/serial.c create mode 100644 keyboards/mint60/serial.h create mode 100644 keyboards/mint60/serial_config.h create mode 100644 keyboards/mint60/split_util.c create mode 100644 keyboards/mint60/split_util.h diff --git a/keyboards/mint60/config.h b/keyboards/mint60/config.h new file mode 100644 index 0000000000..37b69e93a1 --- /dev/null +++ b/keyboards/mint60/config.h @@ -0,0 +1,235 @@ +/* +Copyright 2018 Eucalyn + +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 + +#include "config_common.h" +#include + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Eucalyn +#define PRODUCT Mint60 +#define DESCRIPTION A row staggered split keyboard + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { D4, B3, B1, F7, B2, B6, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 8 +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#define RGBLIGHT_ANIMATIONS + + + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/mint60/i2c.c b/keyboards/mint60/i2c.c new file mode 100644 index 0000000000..4bee5c6398 --- /dev/null +++ b/keyboards/mint60/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/mint60/info.json b/keyboards/mint60/info.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/mint60/keymaps/default/config.h b/keyboards/mint60/keymaps/default/config.h new file mode 100644 index 0000000000..0195c61dff --- /dev/null +++ b/keyboards/mint60/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 Eucalyn + * + * 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 + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +// #define MASTER_RIGHT diff --git a/keyboards/mint60/keymaps/default/keymap.c b/keyboards/mint60/keymaps/default/keymap.c new file mode 100644 index 0000000000..42c61ffaad --- /dev/null +++ b/keyboards/mint60/keymaps/default/keymap.c @@ -0,0 +1,104 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +enum custom_keycodes { + RGBRST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), \ + KC_ESC, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, KC_ENT, LALT(KC_GRV), KC_LEFT,KC_DOWN,KC_RGHT \ + ), + [1] = 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_DEL, \ + RGB_TOG, RGBRST, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_PGUP, _______, \ + XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END \ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/mint60/keymaps/default/readme.md b/keyboards/mint60/keymaps/default/readme.md new file mode 100644 index 0000000000..37dec75a66 --- /dev/null +++ b/keyboards/mint60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Mint60 diff --git a/keyboards/mint60/keymaps/eucalyn/config.h b/keyboards/mint60/keymaps/eucalyn/config.h new file mode 100644 index 0000000000..0195c61dff --- /dev/null +++ b/keyboards/mint60/keymaps/eucalyn/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 Eucalyn + * + * 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 + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +// #define MASTER_RIGHT diff --git a/keyboards/mint60/keymaps/eucalyn/keymap.c b/keyboards/mint60/keymaps/eucalyn/keymap.c new file mode 100644 index 0000000000..09b30730ad --- /dev/null +++ b/keyboards/mint60/keymaps/eucalyn/keymap.c @@ -0,0 +1,104 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +enum custom_keycodes { + RGBRST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + 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_TAB, KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_CAPS, KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH, KC_RSFT, KC_UP, MO(1), \ + KC_ESC, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_BSPC, KC_ENT, LALT(KC_GRV), KC_LEFT,KC_DOWN,KC_RGHT \ + ), + [1] = 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_DEL, \ + RGB_TOG, RGBRST, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_PGUP, _______, \ + XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END \ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/mint60/keymaps/eucalyn/readme.md b/keyboards/mint60/keymaps/eucalyn/readme.md new file mode 100644 index 0000000000..1478b951fe --- /dev/null +++ b/keyboards/mint60/keymaps/eucalyn/readme.md @@ -0,0 +1,3 @@ +# The Eucalyn keymap for Mint60 + +It use "Eucalyn" Kemboard Layout. diff --git a/keyboards/mint60/matrix.c b/keyboards/mint60/matrix.c new file mode 100644 index 0000000000..6d8878332a --- /dev/null +++ b/keyboards/mint60/matrix.c @@ -0,0 +1,349 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int ret=serial_update_buffers(); + if (ret ) { + if(ret==2)RXLED1; + return 1; + } +RXLED0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + +// if(serial_slave_DATA_CORRUPT()){ +// TXLED0; + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + +// }else{ +// TXLED1; +// } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + +#ifndef KEYBOARD_helix_rev1 + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } +#endif +#endif + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/mint60/mint60.c b/keyboards/mint60/mint60.c new file mode 100644 index 0000000000..724bea757a --- /dev/null +++ b/keyboards/mint60/mint60.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#include "mint60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/mint60/mint60.h b/keyboards/mint60/mint60.h new file mode 100644 index 0000000000..ed2ee255f4 --- /dev/null +++ b/keyboards/mint60/mint60.h @@ -0,0 +1,59 @@ +/* Copyright 2018 Eucalyn + * + * 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 . + */ +#ifndef MINT60_H +#define MINT60_H + +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + L00,L01,L02,L03,L04,L05, R00,R01,R02,R03,R04,R05,R06, R07, \ + L10, L11,L12,L13,L14,L15, R10,R11,R12,R13,R14,R15,R16,R17, \ + L20, L21,L22,L23,L24,L25, R20,R21,R22,R23,R24,R25, R27, \ + L30, L31,L32,L33,L34,L35, R30,R31,R32,R33,R34,R35,R36,R37, \ + L40,L41, L42, L43, L44, R40, R41, R43, R45,R46,R47 \ +) \ +{ \ + { L00, L01, L02, L03, L04, L05, KC_NO, KC_NO }, \ + { L10, L11, L12, L13, L14, L15, KC_NO, KC_NO }, \ + { L20, L21, L22, L23, L24, L25, KC_NO, KC_NO }, \ + { L30, L31, L32, L33, L34, L35, KC_NO, KC_NO }, \ + { L40, L41, L42, L43, L44, KC_NO, KC_NO, KC_NO }, \ + { R00, R01, R02, R03, R04, R05, R06, R07 }, \ + { R10, R11, R12, R13, R14, R15, R16, R17 }, \ + { R20, R21, R22, R23, R24, R25, KC_NO, R27 }, \ + { R30, R31, R32, R33, R34, R35, R36, R37 }, \ + { R40, R41, KC_NO, R43, KC_NO, R45, R46, R47 }, \ +} + +#endif diff --git a/keyboards/mint60/readme.md b/keyboards/mint60/readme.md new file mode 100644 index 0000000000..c425b213ba --- /dev/null +++ b/keyboards/mint60/readme.md @@ -0,0 +1,15 @@ +# Mint60 + +![Mint60](https://imgur.com/a/8xnTS4U) + +A short description of the keyboard/project + +Keyboard Maintainer: [Eucalyn](https://github.com/eucalyn) [@eucalyn_](https://twitter.com/eucalyn_) +Hardware Supported: The Mint60 PCBs, ProMicro supported +Hardware Availability: links to where you can find this hardware + +Make example for this keyboard (after setting up your build environment): + + make mint60:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/mint60/rules.mk b/keyboards/mint60/rules.mk new file mode 100644 index 0000000000..b4d4bddd33 --- /dev/null +++ b/keyboards/mint60/rules.mk @@ -0,0 +1,78 @@ +SRC += i2c.c \ + serial.c \ + matrix.c \ + split_util.c \ + +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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) + +CUSTOM_MATRIX = yes +USE_I2C = yes +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. diff --git a/keyboards/mint60/serial.c b/keyboards/mint60/serial.c new file mode 100644 index 0000000000..5919415877 --- /dev/null +++ b/keyboards/mint60/serial.c @@ -0,0 +1,295 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifdef USE_SERIAL + +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 23 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#else +#error Illegal Serial Speed +#endif + + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH 1 +#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input_with_pullup(); + +#if SERIAL_PIN_MASK == _BV(PD0) + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#elif SERIAL_PIN_MASK == _BV(PD2) + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#else + #error unknown SERIAL_PIN_MASK value +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static +void sync_recv(void) { + for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + _delay_sub_us(READ_WRITE_START_ADJUST); + for ( uint8_t i = 0; i < 8; ++i) { + serial_delay_half1(); // read the middle of pulses + byte = (byte << 1) | serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 1<<7; + while( b ) { + if(data & b) { + serial_high(); + } else { + serial_low(); + } + b >>= 1; + serial_delay(); + } + serial_low(); // sync_send() / senc_recv() need raise edge +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + serial_output(); + + // slave send phase + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_slave_buffer[i]); + checksum += serial_slave_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // slave switch to input + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 + + // slave recive phase + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_master_buffer[i] = serial_read_byte(); + checksum_computed += serial_master_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } + + sync_recv(); //weit master output to high +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH); + + // wait for the slaves response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + sei(); + return 1; + } + + // master recive phase + // if the slave is present syncronize with it + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_slave_buffer[i] = serial_read_byte(); + checksum_computed += serial_slave_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if (checksum_computed != checksum_received) { + serial_output(); + serial_high(); + sei(); + return 2; + } + + // master switch to output + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); // 3 + serial_delay_half1(); //4 + + // master send phase + uint8_t checksum = 0; + + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_master_buffer[i]); + checksum += serial_master_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // always, release the line when not in use + sync_send(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/mint60/serial.h b/keyboards/mint60/serial.h new file mode 100644 index 0000000000..c3c9569b2c --- /dev/null +++ b/keyboards/mint60/serial.h @@ -0,0 +1,27 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include + +// //////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// //////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/mint60/serial_config.h b/keyboards/mint60/serial_config.h new file mode 100644 index 0000000000..82c6e4e836 --- /dev/null +++ b/keyboards/mint60/serial_config.h @@ -0,0 +1,16 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +//// #error rev2 serial config + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/mint60/split_util.c b/keyboards/mint60/split_util.c new file mode 100644 index 0000000000..cd3a1896e5 --- /dev/null +++ b/keyboards/mint60/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif -- cgit v1.2.3 From 10c636a1eeaff65292edabe7f01c781110ba871f Mon Sep 17 00:00:00 2001 From: Graham P Heath Date: Sun, 19 Aug 2018 15:29:11 -0500 Subject: Keyboard: add Telophase board (and Graham's keymaps) (#3244) * add my config * fix backlight, clean up that code * group background code, restore static var * qwerty is supposed to be in the middle * wrap layer change backlight in ifdef * backlight levels and some more 'emojis'. * Restructure to make it possible to press cmd ent on the right side of the board with one hand. * Expose the period through the number layer. Add Hyper keys to mouse layer * reduce mouse speed * add a : -P key * Thumbs up and down, remove some keys that are duplicated via function keys, clean up * fix build issues * add various emoji * duplicate default Meira keymaps * Miera updates * add documented but unmapped emoji * Sound for the Meira, was stumped by a file size! Thanks drashna! * add docs * docs * revert lib changes... * clean up * clean up * remove make file * Fixes missing key * clean up * add my lets split * add more emoji * add the telophase board (unofficially, I guess...) * add missing files * add/reset files * Review feedback implementation: Not needed. Add #define FLIP_HALF to your config.h file instead. * Review feedback implementation: All of these includes should be replaced with #include QMK_KEYBOARD_H. * Review feedback implementation: [FAILING] You may want to use LAYOUT_ortho_4x12 instead, and move this to /layouts/community/ortho_4x12/ instead. That way, you can use the same keymap for all of the boards. * clean up * add a key for command tilde (osx loves it) * at least its building again * remove adjusts and migrate layer switching to MO(_LAYER) * update the telophase readme * update the telophase readme * grahampheaths -> grahampheath * ONEHAND_ENABLE -> SWAP_HANDS_ENABLE * convert lets split to use ortho_4x12 * Move lets split keyboard layout into community/ortho_4x12 * make telophase use LAYOUT() * I did it?! * Add clap and grin * swap tabs and back and forward * whitespace --- keyboards/meira/keymaps/grahampheath/keymap.c | 34 +-- keyboards/planck/keymaps/grahampheath/readme.md | 2 +- keyboards/telophase/config.h | 87 +++++++ keyboards/telophase/keymaps/default/keymap.c | 104 ++++++++ keyboards/telophase/matrix.c | 164 ++++++++++++ keyboards/telophase/readme.md | 16 ++ keyboards/telophase/rules.mk | 75 ++++++ keyboards/telophase/telophase.c | 41 +++ keyboards/telophase/telophase.h | 67 +++++ layouts/community/ortho_4x12/grahampheath/config.h | 39 +++ layouts/community/ortho_4x12/grahampheath/keymap.c | 287 +++++++++++++++++++++ layouts/community/ortho_4x12/grahampheath/rules.mk | 3 + 12 files changed, 901 insertions(+), 18 deletions(-) create mode 100644 keyboards/telophase/config.h create mode 100644 keyboards/telophase/keymaps/default/keymap.c create mode 100644 keyboards/telophase/matrix.c create mode 100644 keyboards/telophase/readme.md create mode 100644 keyboards/telophase/rules.mk create mode 100644 keyboards/telophase/telophase.c create mode 100644 keyboards/telophase/telophase.h create mode 100644 layouts/community/ortho_4x12/grahampheath/config.h create mode 100644 layouts/community/ortho_4x12/grahampheath/keymap.c create mode 100644 layouts/community/ortho_4x12/grahampheath/rules.mk diff --git a/keyboards/meira/keymaps/grahampheath/keymap.c b/keyboards/meira/keymaps/grahampheath/keymap.c index 6a4b9333c7..69815ef975 100644 --- a/keyboards/meira/keymaps/grahampheath/keymap.c +++ b/keyboards/meira/keymaps/grahampheath/keymap.c @@ -61,10 +61,10 @@ enum custom_keycodes { bool TOG_STATUS = false; int RGB_current_mode; -#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for GraveESC #define KC_X1 MT(MOD_RSFT, KC_ENT) // Hold for Right Shift, Tap for Enter #define KC_X2 MT(MOD_RSFT, LGUI(KC_ENT)) // Send Command Enter -#define KC_X3 MT(KC_LGUI, KC_SPC) // Hold for Left GUI, Tap for Space +#define KC_X3 MT(MOD_LGUI, KC_SPC) // Hold for Left GUI, Tap for Space #define KC_EMOJ TT(_EMOJI) // Hold for Emoji Layer, or tap 5 times. #define KC_QS LGUI(KC_SPC) // Send Command + Space (for QuickSilver). #define KC_TABR LGUI(KC_RCBR) // Send Command + } (for tab changing). @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Emoji |Adjust| Ctrl | Alt |Lower | Cmd |Space |Raise | Left | Down | Up |Right | + * |Emoji | Ctrl | Alt |Lower | Cmd |Space+|Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = KEYMAP( \ @@ -130,15 +130,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Emoji Layer * - * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │HYPR0│ │ ;-) │ │ │ :-P │ │ │:'-( │FLIP │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │HYPR1│ 👆 │SHRUG│ │ :-( │ │ <3 │ :-) │ │LLAP │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │HYPR2│ │ │ | :-\ │ │ │ :-D │ SHIT│ │ │ │ - * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ - * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │HYPR0│ │ ;-) │ │ │ :-P │ │ │:'-( │FLIP │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR1│ 👆 │SHRUG│ │ :-( │ │ <3 │ :-) │ │LLAP │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR2│ │ │ | :-\ │ │ │ :-D │ SHIT│ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ + * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ */ [_EMOJI] = KEYMAP ( \ HYPR_0, _______, WINK, _______, _______, TOUNGE, _______, _______, CRY, FLIP, _______, _______, \ @@ -151,20 +151,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Lower * ,-----------------------------------------------------------------------------------. - * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Tab- | Vol- | Vol+ | Tab+ | + * | | | | | | | | Tab- | | | Tab+ | * `-----------------------------------------------------------------------------------' */ [_LOWER] = KEYMAP( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, KC_TABL, THMBDN, THMBUP, KC_TABR \ + _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, KC_TABL, _______, _______, KC_TABR \ ), /* Raise @@ -197,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJUST] = KEYMAP( \ - _______, RESET, _______, KC_MRWD, KC_MPLY, KC_MFFD, KC_PSCR, _______, _______, _______, _______, KC_DEL, \ + _______, RESET, _______, _______, _______, _______, KC_PSCR, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ diff --git a/keyboards/planck/keymaps/grahampheath/readme.md b/keyboards/planck/keymaps/grahampheath/readme.md index 507120c6f1..ec8020f18c 100644 --- a/keyboards/planck/keymaps/grahampheath/readme.md +++ b/keyboards/planck/keymaps/grahampheath/readme.md @@ -1,4 +1,4 @@ # Graham's Planck ## Sounds -I've added a [8ohm 0.5W speaker](http://a.co/6MIKZSy), its a bit large, but it fits in approximately the same space as the ProMicro. I soldered to the pcb hole labeled PC6 on my Rev 3 Planck PCB, and GND on the near by chip. [Pic of an identical mod](https://i1.sndcdn.com/artworks-000128070066-myh0ls-t500x500.jpg) (not mine). +I've added a [8ohm 0.5W speaker](http://a.co/6MIKZSy), its a bit large, but it fits in approximately the same space as the ProMicro. I soldered to the pcb hole labeled PC6 on my Rev 3 Planck PCB, and GND on the near by chip. [Pic of an identical mod][https://i1.sndcdn.com/artworks-000128070066-myh0ls-t500x500.jpg] (not mine). diff --git a/keyboards/telophase/config.h b/keyboards/telophase/config.h new file mode 100644 index 0000000000..09655c0258 --- /dev/null +++ b/keyboards/telophase/config.h @@ -0,0 +1,87 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER unknown +#define PRODUCT Telophase +#define DESCRIPTION q.m.k. keyboard firmware for Telophase + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +#define ONESHOT_TIMEOUT 500 + + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +#define PREVENT_STUCK_MODIFIERS + +/* 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 + +//UART settings for communication with the RF microcontroller +#define SERIAL_UART_BAUD 1000000 +#define SERIAL_UART_DATA UDR1 +#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) +#define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX and RX */ \ + UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + } while(0) + +#endif diff --git a/keyboards/telophase/keymaps/default/keymap.c b/keyboards/telophase/keymaps/default/keymap.c new file mode 100644 index 0000000000..1e692ba12d --- /dev/null +++ b/keyboards/telophase/keymaps/default/keymap.c @@ -0,0 +1,104 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include "telophase.h" + +// 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. +enum telophase_layers +{ + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum telophase_keycodes +{ + LOWER = SAFE_RANGE, + RAISE, + ADJUST +}; + +#define LONGPRESS_DELAY 150 +#define LAYER_TOGGLE_DELAY 300 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QWERTY] = { /*QWERTY*/ + {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, + {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, + {KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT } +}, + + +[_LOWER] = { /*Lower*/ + {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE }, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______ }, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } +}, + + + +[_RAISE] = { /*Raise*/ + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, + {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, + {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______ }, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } + +}, + + +[_ADJUST] = { /*Adjust*/ + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } + +}, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + + } + return true; +} + +void matrix_scan_user(void) { + return; +}; + diff --git a/keyboards/telophase/matrix.c b/keyboards/telophase/matrix.c new file mode 100644 index 0000000000..b3544453e7 --- /dev/null +++ b/keyboards/telophase/matrix.c @@ -0,0 +1,164 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 Jack Humbert + +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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + SERIAL_UART_INIT(); + + uint32_t timeout = 0; + + //the s character requests the RF slave to send the matrix + SERIAL_UART_DATA = 's'; + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[13] = {0}; + + //there are 12 bytes corresponding to 12 columns, and an end byte + for (uint8_t i = 0; i < 13; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + break; + } + } + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[11] == 0xE0) + { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 6; + } + } + + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 + +#define red_led_off PORTF |= (1<<5) +#define red_led_on PORTF &= ~(1<<5) +#define blu_led_off PORTF |= (1<<4) +#define blu_led_on PORTF &= ~(1<<4) +#define grn_led_off PORTD |= (1<<1) +#define grn_led_on PORTD &= ~(1<<1) + +#define set_led_off red_led_off; grn_led_off; blu_led_off +#define set_led_red red_led_on; grn_led_off; blu_led_off +#define set_led_blue red_led_off; grn_led_off; blu_led_on +#define set_led_green red_led_off; grn_led_on; blu_led_off +#define set_led_yellow red_led_on; grn_led_on; blu_led_off +#define set_led_magenta red_led_on; grn_led_off; blu_led_on +#define set_led_cyan red_led_off; grn_led_on; blu_led_on +#define set_led_white red_led_on; grn_led_on; blu_led_on + +/* +#define LED_B 5 +#define LED_R 6 +#define LED_G 7 + +#define all_leds_off PORTF &= ~(1< +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#define FLIP_HALF + +#include "keyboards/lets_split/config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#endif diff --git a/layouts/community/ortho_4x12/grahampheath/keymap.c b/layouts/community/ortho_4x12/grahampheath/keymap.c new file mode 100644 index 0000000000..e2421e9a7e --- /dev/null +++ b/layouts/community/ortho_4x12/grahampheath/keymap.c @@ -0,0 +1,287 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum custom_layers { + _QWERTY, + _LOWER, + _RAISE, + _EMOJI, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + EMOJI, + ABOVE, + BUG, + CONFUSED, + CRY, + CLAP, + FLIP, + FNGLEFT, + FNGRIGHT, + FROWN, + GRIN, + HEART, + JOY, + LLAP, + ROFL, + SHIT, + SING, + SHRUG, + THINK, + THMBDN, + THMBUP, + TOUNGE, + WINK +}; + +#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for GraveESC +#define KC_X1 MT(MOD_RSFT, KC_ENT) // Hold for Right Shift, Tap for Enter +#define KC_X2 MT(MOD_RSFT, LGUI(KC_ENT)) // Send Command Enter +#define KC_BACK LGUI(KC_LBRC) // Back +#define KC_FORWARD LGUI(KC_RBRC) // Forward +#define KC_EMOJ TT(_EMOJI) // Hold for Emoji Layer, or tap 5 times. +#define KC_QS LGUI(KC_SPC) // Send Command + Space (for QuickSilver). +#define KC_WTAB LGUI(KC_TILD) // Send Command + ~ (for window changing). +#define KC_TABR LGUI(KC_RCBR) // Send Command + } (for tab changing). +#define KC_TABL LGUI(KC_LCBR) // Send Command + { (for tab changing). +#define HYPR_0 HYPR(KC_TILD) // Send Hyper + ~. +#define HYPR_1 HYPR(KC_EXLM) // Send Hyper + !. +#define HYPR_2 HYPR(KC_AT) // Send Hyper + @. + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Emoji | Ctrl | Alt |Lower | Cmd |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_X1, + KC_EMOJ, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |cmd(~)| <- | -> | TAB_L| TAB_R| F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Tab- | Vol- | Vol+ | Tab+ | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_WTAB, KC_BACK, KC_FORWARD, KC_TABL, KC_TABR, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, + _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, _______, _______, _______, _______ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * |cmd(~)| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home | PgUp | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_WTAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, KC_X2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Emoji Layer + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │HYPR0│ Q │ ;-) │ E │ 🤣 │ :-P │ Y │ U │:'-( │FLIP │ P │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR1│ 👆 │SHRUG│ GRIN│ :-( │ G │ <3 │ :-) │ k │LLAP │ ; │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │HYPR2│🎶^🎶│💭^💭│ 👏 | :-\ │ 🐛 │ n │ :-D │ SHIT│ . │ / │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ + * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ + * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ + */ +[_EMOJI] = LAYOUT_ortho_4x12( + HYPR_0, _______, WINK, _______, ROFL, TOUNGE, _______, _______, CRY, FLIP, _______, _______ , + HYPR_1, ABOVE, SHRUG, GRIN, FROWN, _______, HEART, JOY, _______, LLAP, _______, _______ , + HYPR_2, SING, THINK, CLAP, CONFUSED, BUG, _______, _______, SHIT, _______, _______, _______ , + _______, _______, _______, _______, KC_SLCK, KC_SLEP, KC_SLEP, KC_PAUS, FNGLEFT, THMBDN, THMBUP, FNGRIGHT +), +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ABOVE: + if (record->event.pressed) { + SEND_STRING("&above; "); + } + return false; + break; + case BUG: + if (record->event.pressed) { + SEND_STRING("&bug;"); + } + return false; + break; + case CONFUSED: + if (record->event.pressed) { + SEND_STRING(":-\\"); + } + return false; + break; + case CRY: + if (record->event.pressed) { + SEND_STRING(":'-( "); + } + return false; + break; + case CLAP: + if (record->event.pressed) { + SEND_STRING("&clap; "); + } + return false; + break; + case FLIP: + if (record->event.pressed) { + SEND_STRING("&fliptable;"); + } + return false; + break; + case FNGLEFT: + if (record->event.pressed) { + SEND_STRING("&fingerleft; "); + } + return false; + break; + case FNGRIGHT: + if (record->event.pressed) { + SEND_STRING("&fingerright; "); + } + return false; + break; + case FROWN: + if (record->event.pressed) { + SEND_STRING(":-( "); + } + return false; + break; + case GRIN: + if (record->event.pressed) { + SEND_STRING(":-D "); + } + return false; + break; + case HEART: + if (record->event.pressed) { + SEND_STRING("<3 "); + } + return false; + break; + case JOY: + if (record->event.pressed) { + SEND_STRING(":-) "); + } + return false; + break; + case LLAP: + if (record->event.pressed) { + SEND_STRING("&llap; "); + } + return false; + break; + case ROFL: + if (record->event.pressed) { + SEND_STRING("&rofl; "); + } + return false; + break; + case SHIT: + if (record->event.pressed) { + SEND_STRING("&shit; "); + } + return false; + break; + case SING: + if (record->event.pressed) { + SEND_STRING("_sing_"); + } + return false; + break; + case SHRUG: + if (record->event.pressed) { + SEND_STRING("&shrug; "); + } + return false; + break; + case THINK: + if (record->event.pressed) { + SEND_STRING("_think_"); + } + return false; + break; + case THMBDN: + if (record->event.pressed) { + SEND_STRING("&thumbdown; "); + } + return false; + break; + case THMBUP: + if (record->event.pressed) { + SEND_STRING("&thumbup; "); + } + return false; + break; + case TOUNGE: + if (record->event.pressed) { + SEND_STRING(":-P "); + } + return false; + break; + case WINK: + if (record->event.pressed) { + SEND_STRING(";-) "); + } + return false; + break; + + } + return true; +} + +void matrix_scan_user(void) { + return; +}; + diff --git a/layouts/community/ortho_4x12/grahampheath/rules.mk b/layouts/community/ortho_4x12/grahampheath/rules.mk new file mode 100644 index 0000000000..457a3d01d4 --- /dev/null +++ b/layouts/community/ortho_4x12/grahampheath/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3 From 4a3eb3bdd457af85fda4b25d9e6379ee245d468b Mon Sep 17 00:00:00 2001 From: Sebastian Kaim Date: Mon, 20 Aug 2018 04:32:35 +0200 Subject: [WIP] Added support for the b.face keyboard (#2493) * Added support for the b.face keyboard This commit adds support for the 60% keyboard from winkeyless, the b.face. The basic keyboard layout as well as the RGB backlighting works as expected; the per-key LEDs can be turned on or off but not yet dimmed. A default 60% US-layout is included. * Added link to the bface in the ps2avrGB README --- keyboards/bface/README.md | 61 +++++ keyboards/bface/backlight_ps2avrGB.c | 94 ++++++++ keyboards/bface/backlight_ps2avrGB.h | 35 +++ keyboards/bface/bface.c | 46 ++++ keyboards/bface/bface.h | 44 ++++ keyboards/bface/config.h | 49 ++++ keyboards/bface/i2c.c | 104 ++++++++ keyboards/bface/i2c.h | 25 ++ keyboards/bface/keymaps/default/keymap.c | 49 ++++ keyboards/bface/matrix.c | 113 +++++++++ keyboards/bface/program | 105 ++++++++ keyboards/bface/rules.mk | 47 ++++ keyboards/bface/usbconfig.h | 396 +++++++++++++++++++++++++++++++ keyboards/ps2avrGB/README.md | 1 + 14 files changed, 1169 insertions(+) create mode 100644 keyboards/bface/README.md create mode 100644 keyboards/bface/backlight_ps2avrGB.c create mode 100644 keyboards/bface/backlight_ps2avrGB.h create mode 100644 keyboards/bface/bface.c create mode 100644 keyboards/bface/bface.h create mode 100644 keyboards/bface/config.h create mode 100644 keyboards/bface/i2c.c create mode 100644 keyboards/bface/i2c.h create mode 100644 keyboards/bface/keymaps/default/keymap.c create mode 100644 keyboards/bface/matrix.c create mode 100755 keyboards/bface/program create mode 100644 keyboards/bface/rules.mk create mode 100644 keyboards/bface/usbconfig.h diff --git a/keyboards/bface/README.md b/keyboards/bface/README.md new file mode 100644 index 0000000000..f8360aec0c --- /dev/null +++ b/keyboards/bface/README.md @@ -0,0 +1,61 @@ +ps2avrGB keyboard firmware +========================== + +This is a port of the QMK firmware for boards that are based on the +ps2avrGB firmware, like the [ps2avrGB +keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold +by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/). + +Note that this is a complete replacement for the firmware, so you won't be +using Bootmapper Client to change any keyboard settings, since not all the +USB report options are supported. + +## Supported Boards + +Only the [B.mini X2](http://winkeyless.kr/product/b-mini-x2-pcb/) has been +tested so far (since it's the only one I own). But other boards that use +the ps2avrGB firmware should work as well. + +## Installing + +First, install the requirements. These commands are for OSX, but all you +need is the AVR toolchain and `bootloadHID` for flashing: + +``` +$ brew cask install crosspack-avr +$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb +``` + +In order to use the `./program` script, which can reboot the board into +the bootloader, you'll need Python 2 with PyUSB installed: + +``` +$ pip install pyusb +``` + +Then, with the keyboard plugged in, simply run this command from the +`qmk_firmware` directory: + +``` +$ make ps2avrGB-program +``` + +If you prefer, you can just build it and flash the firmware directly with +`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it +in the bootloader: + +``` +$ make ps2avrGB +$ bootloadHID -r ps2avrGB_default.hex +``` + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while pressing `L_Ctrl`. This will force it + to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/bface/backlight_ps2avrGB.c b/keyboards/bface/backlight_ps2avrGB.c new file mode 100644 index 0000000000..c0f6428407 --- /dev/null +++ b/keyboards/bface/backlight_ps2avrGB.c @@ -0,0 +1,94 @@ +/* Copyright 2017 Sebastian Kaim + * + * 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 . + */ + +#ifdef BACKLIGHT_ENABLE + +#include "backlight_ps2avrGB.h" +#define sbi(reg,bit) reg |= (_BV(bit)) +#define cbi(reg,bit) reg &= (~_BV(bit)) +#define PWM10 WGM10 +#define PWM11 WGM11 +#define COM1x1 COM1B1 +#define OCR1x OCR1B + +void backlight_init_ports(void) +{ +#if BACKLIGHT_ON_STATE == 0 + backlight_off(); +#else + backlight_on(); +#endif + + // setup pwm + // this bitmagic is sourced from the original firmware + /*TCCR1B = ((TCCR1B & ~0x07) | 0x03); + TCNT1H = 0; + TCNT1L = 0; + sbi(TIMSK, TOIE1); + OCR1BH = 0; + OCR1BL = 0; + cbi(TCCR1A,PWM11); + sbi(TCCR1A,PWM10); + sbi(TCCR1A,COM1B1); + cbi(TCCR1A,COM1B0);*/ + ICR1 = 0xFFFF; + + TCCR1A = _BV(COM1x1) | _BV(WGM11); // = 0b00001010; + TCCR1B = _BV(WGM13) | _BV(WGM12) | _BV(CS10); // = 0b00011001; + + backlight_init(); +} + +void backlight_set(uint8_t level) +{ + if( level == 0 ) { + backlight_off(); + } + else { + backlight_on(); + /*uint8_t pwm = get_pwm_for_brightness(level); + set_backlight_pwm(pwm); + TCCR1A |= _BV(COM1x1); + OCR1x = (level >= 2) ? 0xFFFF : 0x00FF;*/ + } +} + +#define PWM_MAX 0xFF +uint8_t get_pwm_for_brightness(uint8_t level) +{ + // we need to cast up here to allow multiplication with 0xFF. We could also use floats, but this is probably a lot faster. + uint16_t brightness = (uint16_t)level * (uint16_t)PWM_MAX / (uint16_t)BACKLIGHT_LEVELS; + return (uint8_t)brightness; +} + +void backlight_on(void) +{ + //_SFR_IO8(0x12) |= _BV(0x4); + LED_PIN |= BACKLIGHT_PORT_NUM; +} + +void backlight_off(void) +{ + //_SFR_IO8(0x12) &= ~_BV(0x4); + LED_PIN &= ~BACKLIGHT_PORT_NUM; +} + +void set_backlight_pwm(uint8_t level) { + // this does not work (yet) + //OCR1B = level; +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/bface/backlight_ps2avrGB.h b/keyboards/bface/backlight_ps2avrGB.h new file mode 100644 index 0000000000..d5ca903993 --- /dev/null +++ b/keyboards/bface/backlight_ps2avrGB.h @@ -0,0 +1,35 @@ +/* Copyright 2017 Sebastian Kaim + * + * 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 . + */ + + +#if defined(__AVR__) +#include +#include +#include +#endif +#include +#include +#include "backlight.h" + +#ifndef PS2AVRGB_BACKLIGHT_H +#define PS2AVRGB_BACKLIGHT_H + +uint8_t get_pwm_for_brightness(uint8_t level); +void set_backlight_pwm(uint8_t level); +void backlight_on(void); +void backlight_off(void); + +#endif diff --git a/keyboards/bface/bface.c b/keyboards/bface/bface.c new file mode 100644 index 0000000000..8422a4a40b --- /dev/null +++ b/keyboards/bface/bface.c @@ -0,0 +1,46 @@ +/* +Copyright 2017 Luiz Ribeiro +Copyright 2018 Sebastian Kaim + +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 . +*/ + +#include "bface.h" +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { + rgblight_task(); +} diff --git a/keyboards/bface/bface.h b/keyboards/bface/bface.h new file mode 100644 index 0000000000..1f1f3393ff --- /dev/null +++ b/keyboards/bface/bface.h @@ -0,0 +1,44 @@ +/* +Copyright 2017 Luiz Ribeiro +Copyright 2017 Sebastian Kaim + +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 . +*/ + +#ifndef KEYMAP_COMMON_H +#define KEYMAP_COMMON_H + +#include "quantum_keycodes.h" +#include "keycode.h" +#include "action.h" + +#define KEYMAP( \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, \ + K00, K10, K20, K56, K57, KA0, KB0, KC0 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KA0, KB0, KC0, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KC_NO, KE4 }, \ + { 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, K16, K26, K36, K46, K56, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB6, KC6, KD6, KE6 }, \ + { KC_NO, K17, K27, K37, K47, K57, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB7, KC7, KD7, KE7 } \ +} + + +#endif diff --git a/keyboards/bface/config.h b/keyboards/bface/config.h new file mode 100644 index 0000000000..3d74af4f14 --- /dev/null +++ b/keyboards/bface/config.h @@ -0,0 +1,49 @@ +/* +Copyright 2017 Luiz Ribeiro +Copyright 2017 Sebastian Kaim + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// You can edit those at usbconfig.h about line 250. These values will +// unforunatly be ignored so far +#define MANUFACTURER winkeyless.kr +#define PRODUCT b.face + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 +#define BOOTLOADHID_BOOTLOADER 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#ifdef BACKLIGHT_ENABLE + // the backlight PWM does not work (yet). Therefore, we only have two backlight levels (on/off) + #define BACKLIGHT_LEVELS 1 + #define LED_PIN PORTD + #define BACKLIGHT_PORT_NUM (1 << 4) +#endif + +#endif diff --git a/keyboards/bface/i2c.c b/keyboards/bface/i2c.c new file mode 100644 index 0000000000..c27f3e3d17 --- /dev/null +++ b/keyboards/bface/i2c.c @@ -0,0 +1,104 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/bface/keymaps/default/keymap.c b/keyboards/bface/keymaps/default/keymap.c new file mode 100644 index 0000000000..785ab2e9de --- /dev/null +++ b/keyboards/bface/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* +Copyright 2017 Sebastian Kaim + +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 . +*/ + +#include "bface.h" +#include "action_layer.h" +#include "rgblight.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = KEYMAP( + KC_ESC, 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_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_F1, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI,KC_FN0, KC_RCTL + ), + [1] = KEYMAP( + KC_TRNS,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_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,BL_INC, BL_DEC, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,RGB_SMOD,KC_TRNS,BL_ON, BL_OFF, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), + /* You can copy this layer as base for a new fn layer * / + [n] = KEYMAP( + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), // */ +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; diff --git a/keyboards/bface/matrix.c b/keyboards/bface/matrix.c new file mode 100644 index 0000000000..b3761a63ca --- /dev/null +++ b/keyboards/bface/matrix.c @@ -0,0 +1,113 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +uint8_t matrix_scan(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + matrix_set_row_status(row); + _delay_us(5); + + matrix_row_t cols = ( + // cols 0..7, PORTA 0 -> 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + matrix_scan_user(); + + return 1; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/bface/program b/keyboards/bface/program new file mode 100755 index 0000000000..298e645477 --- /dev/null +++ b/keyboards/bface/program @@ -0,0 +1,105 @@ +#!/usr/bin/env python +# Copyright 2017 Luiz Ribeiro , Sebastian Kaim +# +# 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 . + +from __future__ import print_function + +import os +import sys +import time +import usb + + +def checkForKeyboardInNormalMode(): + """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" + return usb.core.find(idVendor=0x20A0, idProduct=0x422D) + +def checkForKeyboardInBootloaderMode(): + """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" + return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) + +def flashKeyboard(firmware_file): + """Calls bootloadHID to flash the given file to the device.""" + print('Flashing firmware to device ...') + if os.system('bootloadHID -r "%s"' % firmware_file) == 0: + print('\nDone!') + else: + print('\nbootloadHID returned an error.') + +def printDeviceInfo(dev): + """Prints all infos for a given USB device""" + print('Device Information:') + print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) + print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) + print('Manufacturer: %s' % (dev.iManufacturer)) + print('Serial: %s' % (dev.iSerialNumber)) + print('Product: %s' % (dev.iProduct), end='\n\n') + +def sendDeviceToBootloaderMode(dev): + """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" + try: + dev.set_configuration() + + request_type = usb.util.build_request_type( + usb.util.CTRL_OUT, + usb.util.CTRL_TYPE_CLASS, + usb.util.CTRL_RECIPIENT_DEVICE) + + USBRQ_HID_SET_REPORT = 0x09 + HID_REPORT_OPTION = 0x0301 + + dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) + except usb.core.USBError: + # for some reason I keep getting USBError, but it works! + pass + + +if len(sys.argv) < 2: + print('Usage: %s ' % sys.argv[0]) + sys.exit(1) + +kb = checkForKeyboardInNormalMode() + +if kb is not None: + print('Found a keyboad in normal mode. Attempting to send it to bootloader mode ...', end='') + sendDeviceToBootloaderMode(kb) + print(' done.') + print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") + print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") + +attempts = 12 # 60 seconds +found = False +for attempt in range(1, attempts + 1): + print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') + + if checkForKeyboardInBootloaderMode(): + print('Found', end='\n\n') + flashKeyboard(sys.argv[1]) + found = True + break + else: + print('Nothing.', end='') + + if attempt != attempts: # no need to wait on the last attempt + print(' Sleeping 5 seconds.', end='') + time.sleep(5) + + # print a newline + print() + +if not found: + print("Couldn't find a flashable keyboard. Aborting.") + sys.exit(2) + diff --git a/keyboards/bface/rules.mk b/keyboards/bface/rules.mk new file mode 100644 index 0000000000..6fb32ae57b --- /dev/null +++ b/keyboards/bface/rules.mk @@ -0,0 +1,47 @@ +# Copyright 2017 Luiz Ribeiro +# +# 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 . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes +BACKLIGHT_BREATHING = no +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 +OPT_DEFS += -DBOOTLOADER_SIZE=2048 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight_ps2avrGB.c + +# programming options +PROGRAM_CMD = ./keyboards/bface/program .build/$(TARGET).hex diff --git a/keyboards/bface/usbconfig.h b/keyboards/bface/usbconfig.h new file mode 100644 index 0000000000..f87922615b --- /dev/null +++ b/keyboards/bface/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'b', '.', 'f', 'a', 'c', 'e' +#define USB_CFG_DEVICE_NAME_LEN 6 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/ps2avrGB/README.md b/keyboards/ps2avrGB/README.md index 5111be2646..8399dff029 100644 --- a/keyboards/ps2avrGB/README.md +++ b/keyboards/ps2avrGB/README.md @@ -17,6 +17,7 @@ compatible with QMK; fully supported boards have their own directory. - [b.fake](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bfake) - [b.mini](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bmini) +- [b.face](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bface) - [pearl](https://github.com/qmk/qmk_firmware/tree/master/keyboards/pearl) ## Installing -- cgit v1.2.3 From 2091280bbb9fad01b98a07fe598986c9ef443b97 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 19 Aug 2018 19:33:49 -0700 Subject: Keyboard: Fix Configurator rendering for Big Series 2-, 3-, and 4-key boards (#3698) --- keyboards/bigseries/2key/info.json | 2 +- keyboards/bigseries/3key/info.json | 2 +- keyboards/bigseries/4key/info.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/bigseries/2key/info.json b/keyboards/bigseries/2key/info.json index dc30449b12..2aea4d2005 100644 --- a/keyboards/bigseries/2key/info.json +++ b/keyboards/bigseries/2key/info.json @@ -6,7 +6,7 @@ "height": 4, "layouts": { "LAYOUT": { - "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}] + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":4, "y":0, "w":4, "h":4}] } } } diff --git a/keyboards/bigseries/3key/info.json b/keyboards/bigseries/3key/info.json index 4a288219a3..8f0b8c55c2 100644 --- a/keyboards/bigseries/3key/info.json +++ b/keyboards/bigseries/3key/info.json @@ -6,7 +6,7 @@ "height": 4, "layouts": { "LAYOUT": { - "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}, {"x":2, "y":0, "w":4, "h":4}] + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":4, "y":0, "w":4, "h":4}, {"x":8, "y":0, "w":4, "h":4}] } } } diff --git a/keyboards/bigseries/4key/info.json b/keyboards/bigseries/4key/info.json index bff643d389..0bdee578a7 100644 --- a/keyboards/bigseries/4key/info.json +++ b/keyboards/bigseries/4key/info.json @@ -2,11 +2,11 @@ "keyboard_name": "Big Series 4-Key", "url": "", "maintainer": "qmk", - "width": 16, - "height": 16, + "width": 8, + "height": 8, "layouts": { "LAYOUT": { - "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":1, "y":0, "w":4, "h":4}, {"x":0, "y":1, "w":4, "h":4}, {"x":1, "y":1, "w":4, "h":4}] + "layout": [{"x":0, "y":0, "w":4, "h":4}, {"x":4, "y":0, "w":4, "h":4}, {"x":0, "y":4, "w":4, "h":4}, {"x":4, "y":4, "w":4, "h":4}] } } } -- cgit v1.2.3 From e2755c11b31f1bbb3b10d2870ca27ef66560a311 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 19 Aug 2018 19:35:14 -0700 Subject: Keyboard: forgot to rename the layout 1up60hse correctly (#3699) --- keyboards/1up60hse/info.json | 14 +++++++------- keyboards/1up60hse/readme.md | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/1up60hse/info.json b/keyboards/1up60hse/info.json index b765a376c7..831614bc6b 100644 --- a/keyboards/1up60hse/info.json +++ b/keyboards/1up60hse/info.json @@ -1,12 +1,12 @@ { - "keyboard_name": "1up60hse", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, + "keyboard_name": "1up60hse", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_60_ansi": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] } } -} \ No newline at end of file +} diff --git a/keyboards/1up60hse/readme.md b/keyboards/1up60hse/readme.md index 7eb4253945..021e84d1e9 100644 --- a/keyboards/1up60hse/readme.md +++ b/keyboards/1up60hse/readme.md @@ -5,7 +5,7 @@ A 60% PCB with USB C, RGB underglow, backlighting, and hotswappable switches. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: The PCBs, controllers supported +Hardware Supported: 1up60hse 60% PCB. Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From dbef2ad6b9ba9a347dfebee0eed07b5b02e3c564 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 20 Aug 2018 09:45:15 -0700 Subject: Keymap: Update 333fred's keymap for Zen (#3690) Reset file to upstream/master, update only macro name (KEYMAP to LAYOUT). --- keyboards/zen/keymaps/333fred/keymap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/zen/keymaps/333fred/keymap.c b/keyboards/zen/keymaps/333fred/keymap.c index eeab87ad31..3dd7698039 100644 --- a/keyboards/zen/keymaps/333fred/keymap.c +++ b/keyboards/zen/keymaps/333fred/keymap.c @@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | F4 | F5 | GUI | Alt | Bksp |Lwr/VM||Enter|Space | NAV | - | = | Alt | Del | * `------------------------------------------------''-----------------------------------------------' */ -[BASE] = KEYMAP( \ +[BASE] = LAYOUT( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Pscr | | RESET| | | GAME | || | 0 | . | = | Prev | Next | Play | * `------------------------------------------------- -------------------------------------------------' */ -[SYMB] = KEYMAP( \ +[SYMB] = LAYOUT( \ KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_7, KC_8, KC_9, KC_ASTR, KC_RPRN, KC_F12, \ _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_4, KC_5, KC_6, KC_PLUS, KC_RCBR, KC_PIPE, \ @@ -66,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | || | | | | | | | * `------------------------------------------------..------------------------------------------------' */ -[VIM] = KEYMAP( \ +[VIM] = LAYOUT( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, \ _______, RGB_SAI, RGB_VAI, RGB_SAD, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, \ _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ @@ -88,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| * `------------------------------------------------..-----------------------------------------------' */ -[GAME] = KEYMAP( \ +[GAME] = LAYOUT( \ KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_LCTL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Enter| | Lock | Bksp | Alt | Spc | RESET|| | Lower| Left | Up | Down | Right|QWERTY| * `------------------------------------------------..-----------------------------------------------' */ -[GAME_ARROW] = KEYMAP( \ +[GAME_ARROW] = LAYOUT( \ KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, \ -- cgit v1.2.3 From 220ea4c9b7acefa45fd0c58d58f4e79f07dace0f Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Tue, 21 Aug 2018 18:37:29 +0300 Subject: Keymap: Nordic layouts for ErgoDox, Planck (#3693) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * first verion of skug * zudvp layer added and new thumb cluster * move del to arrw cluster and switch places of algr and no_circ * first verion of skug * zudvp layer added and new thumb cluster * move del to arrw cluster and switch places of algr and no_circ * rework layouts * Adds SYMB layer toggle to 'ä' Closes #2 Also moves ctrl away from '-' and 'z' to the outer bottom corners and removes redundant SYMB layer binds from there * Adds mouse movement to right hand on ARRW layer Closes #3 * Fix typoed keycodes * planck qwerty nordic * Update README.md * Update README.md * Implemented changes to planck layout requested by drashna * Implemented changes to ergodox layout requested by drashna NOTE: `version.h` is still required. --- keyboards/ergodox_ez/keymaps/skug/config.h | 6 + keyboards/ergodox_ez/keymaps/skug/keymap.c | 275 ++++++++++++++++++++++ keyboards/ergodox_ez/keymaps/skug/readme.md | 4 + keyboards/planck/keymaps/skug/config.h | 39 ++++ keyboards/planck/keymaps/skug/keymap.c | 338 ++++++++++++++++++++++++++++ keyboards/planck/keymaps/skug/readme.md | 3 + keyboards/planck/keymaps/skug/rules.mk | 1 + 7 files changed, 666 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/skug/config.h create mode 100644 keyboards/ergodox_ez/keymaps/skug/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/skug/readme.md create mode 100644 keyboards/planck/keymaps/skug/config.h create mode 100644 keyboards/planck/keymaps/skug/keymap.c create mode 100644 keyboards/planck/keymaps/skug/readme.md create mode 100644 keyboards/planck/keymaps/skug/rules.mk diff --git a/keyboards/ergodox_ez/keymaps/skug/config.h b/keyboards/ergodox_ez/keymaps/skug/config.h new file mode 100644 index 0000000000..d972813920 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/skug/config.h @@ -0,0 +1,6 @@ +#pragma once + +#undef LSPO_KEY +#undef RSPC_KEY +#define LSPO_KEY KC_8 // Nordic Left SpaceCadet +#define RSPC_KEY KC_9 // Nordic Right SpaceCadet diff --git a/keyboards/ergodox_ez/keymaps/skug/keymap.c b/keyboards/ergodox_ez/keymaps/skug/keymap.c new file mode 100644 index 0000000000..0d2ec1dd9f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/skug/keymap.c @@ -0,0 +1,275 @@ +/* Copyright 2018 Andreas Lindhé, Christoffer Holmberg + * + * 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 . + */ + + + + + +#include QMK_KEYBOARD_H +#include "version.h" +#include "keymap_swedish.h" + +#define _______ KC_TRNS + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys +#define ARRW 3 // arrow + soon mouse + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ½ | ! | " | # | # | % | Ins | | L1 | & | / | ( | ) | = | ? | + * | § | 1 | 2 @ | 3 £ | 4 $ | 5 | | | | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | Å | + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | L4 | A | S | D | F | G |------| |------| H | J | K | L |Ö / L3| Ä/L2 | + * | | | | | | | Hypr/| | Meh/ | | | | | | | + * |--------+------+------+------+------+------| Esc | | Ent |------+------+------+------+------+--------| + * | LShift/| Z | X | C | V | B | | | | N | M | ; | : | _ | RShift/| + * | ( | | | | | | | | | | | , | . | - | ) | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | '/ | ` |Alt | Left | Right| | Spc | Bksp | AltGr| * | ~/ | + * | Ctrl | ' | | | | | | | | | Ctrl | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | <>| | End | | Home | ^ | + * ,------|------|------| |------+--------+------. + * | Left | Right| PgDn | | PgUp | Up | Down | + * |------|------|------| |------|--------|------| + * | Ctrl/| Alt/ | | | | Alt/ | Ctrl/| + * | Enter| Esc | Lgui | | Lgui | Esc | Enter| + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_ +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox_80( // layer 0 : default + // left hand + NO_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_ESC), + CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC, + NO_LESS, KC_END, + KC_LEFT, KC_RIGHT, KC_PGDN, + CTL_T(KC_ENT), ALT_T(KC_ESC), KC_LGUI, + + // right hand + TO(ARRW), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE), + MEH_T(KC_ENT), KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, + KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD), + KC_HOME, NO_CIRC, + KC_PGUP, KC_UP, KC_DOWN, + KC_LGUI, ALT_T(KC_ESC), CTL_T(KC_ENT) +), +/* Keymap: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | . | 0 | = | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * |------|------|------| |------|------|------| + * |BNess-|Bness+| | | |Hue- |Hue+ | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox_80( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, + _______,KC_EXLM,NO_AT, NO_LCBR,NO_RCBR,NO_PIPE,_______, + _______,KC_HASH,NO_DLR, NO_LPRN,NO_RPRN,NO_GRV, + _______,KC_PERC,NO_CIRC,NO_LBRC,NO_RBRC,NO_TILD,_______, + EPRM,_______,_______,_______,_______, + RGB_MOD,_______, + _______,_______,_______, + RGB_VAD,RGB_VAI,_______, + // right hand + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______, + _______, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______, + _______,KC_DOT, KC_0, NO_EQL, _______, + RGB_TOG, RGB_SLD, + _______, _______, _______, + _______, RGB_HUD, RGB_HUI +), + +/* Keymap: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | MsUp | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |MsLeft|MsDown|MsRght| | |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | |------|------| |------|------|------| + * | | | | | | |BrBck | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox_80( + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_U, _______, _______, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_BTN1, KC_BTN2, + _______, _______, + _______, _______, _______, + _______, _______, _______, + // right hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_MPLY, + _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______, + KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, + _______, _______, + _______, _______, _______, + _______, _______, KC_WBAK +), + // Keymap: Ducky Style arrows +[ARRW] = LAYOUT_ergodox_80( + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_UP , _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, KC_DEL, _______, + _______, _______, + _______, _______, _______, + _______, _______, _______, + // right hand + TO(BASE), _______, _______, _______, _______, _______, _______, + _______, _______, KC_BTN4, KC_MS_U, KC_BTN5, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, + _______, _______, + _______, _______, _______, + _______, _______, _______ +), + +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + break; + case 1: + if (record->event.pressed) { // For resetting EEPROM + eeconfig_init(); + } + break; + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + } + return true; +} + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + // Binary: lsb at bottom + case 1: + ergodox_right_led_3_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_board_led_on(); + default: + // none + break; + } +}; diff --git a/keyboards/ergodox_ez/keymaps/skug/readme.md b/keyboards/ergodox_ez/keymaps/skug/readme.md new file mode 100644 index 0000000000..5c155619c0 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/skug/readme.md @@ -0,0 +1,4 @@ +# Nordic Qwerty layout for ErgoDox EZ, based on Andreas Lindhe's version + +*NOTE:* it might still be desirable to set the software layout to sv_SE in your +OS. diff --git a/keyboards/planck/keymaps/skug/config.h b/keyboards/planck/keymaps/skug/config.h new file mode 100644 index 0000000000..0a1d8d2892 --- /dev/null +++ b/keyboards/planck/keymaps/skug/config.h @@ -0,0 +1,39 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#endif diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c new file mode 100644 index 0000000000..00b2ab21ce --- /dev/null +++ b/keyboards/planck/keymaps/skug/keymap.c @@ -0,0 +1,338 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + BACKLIT, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_planck_grid( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Exit | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/skug/readme.md b/keyboards/planck/keymaps/skug/readme.md new file mode 100644 index 0000000000..259b52f86f --- /dev/null +++ b/keyboards/planck/keymaps/skug/readme.md @@ -0,0 +1,3 @@ +# Nordic Planck + +TODO: Add layout image diff --git a/keyboards/planck/keymaps/skug/rules.mk b/keyboards/planck/keymaps/skug/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/skug/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From 9d99fd84180fe668ab9aa914d08d325f66134610 Mon Sep 17 00:00:00 2001 From: Stephen Grier Date: Tue, 21 Aug 2018 16:38:26 +0100 Subject: Keymap: Adding stephengrier keymap for the DZ60 PCB (#3700) --- keyboards/dz60/keymaps/stephengrier/README.md | 45 ++++++++++++++ keyboards/dz60/keymaps/stephengrier/keymap.c | 86 +++++++++++++++++++++++++++ 2 files changed, 131 insertions(+) create mode 100644 keyboards/dz60/keymaps/stephengrier/README.md create mode 100644 keyboards/dz60/keymaps/stephengrier/keymap.c diff --git a/keyboards/dz60/keymaps/stephengrier/README.md b/keyboards/dz60/keymaps/stephengrier/README.md new file mode 100644 index 0000000000..002a8f255b --- /dev/null +++ b/keyboards/dz60/keymaps/stephengrier/README.md @@ -0,0 +1,45 @@ +### stephengrier's DZ60 layout + +This layout is for a DZ60 with a 2U left shift, 1U right shift and an arrow +cluster in the bottom right (i.e. the GK64 layout). + +Other features: + +* The capslock key is replaced with a second function key. +* The Alt an Cmd keys are swapped to replicate the Mac layout. +* Del is available as Fn+Backspace +* Tilde is available as Shift+Esc +* Backtick is available as Fn+Esc +* Underglow toggle and mode selection are available as Fn+Q and Fn+W + +### 0 Qwerty +``` +,-----------------------------------------------------------------------------------------. +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +|-----------------------------------------------------------------------------------------+ +| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Fn | +|-----------------------------------------------------------------------------------------+ +| Ctrl | Alt | Cmd | Space | Cmd | Alt | L | D | R | +`-----------------------------------------------------------------------------------------' +``` + +### 1 Fn Layer +``` +FN Layer +,-----------------------------------------------------------------------------------------. +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | +|-----------------------------------------------------------------------------------------+ +| |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | RESET | +|-----------------------------------------------------------------------------------------+ +| | BL T| BL M| BL+ | BL- | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + diff --git a/keyboards/dz60/keymaps/stephengrier/keymap.c b/keyboards/dz60/keymaps/stephengrier/keymap.c new file mode 100644 index 0000000000..d9403f59e2 --- /dev/null +++ b/keyboards/dz60/keymaps/stephengrier/keymap.c @@ -0,0 +1,86 @@ +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Fn | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | Alt | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_2_shifts( + F(0), 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_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, + MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | | BL T| BL M| BL+ | BL- | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRV, 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_TRNS, KC_DEL, + ______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, ______, ______, ______, ______, RESET, + ______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ + ), +}; + +enum function_id { + SHIFT_ESC, +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_FUNCTION(SHIFT_ESC), +}; + +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + static uint8_t shift_esc_shift_mask; + switch (id) { + case SHIFT_ESC: + shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; + if (record->event.pressed) { + if (shift_esc_shift_mask) { + add_key(KC_GRV); + send_keyboard_report(); + } else { + add_key(KC_ESC); + send_keyboard_report(); + } + } else { + if (shift_esc_shift_mask) { + del_key(KC_GRV); + send_keyboard_report(); + } else { + del_key(KC_ESC); + send_keyboard_report(); + } + } + break; + } +} -- cgit v1.2.3 From d0b55b59f917fea69eb6b4773572b42f92f7b7b3 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:39:25 -0700 Subject: Keyboard: bface update (#3702) * add configurator support * update bface code to more modern QMK standards * update readme * update readme * Make changes thanks to noroadsleft's PR comments --- keyboards/bface/README.md | 83 +++++++++++++------------------- keyboards/bface/bface.h | 2 +- keyboards/bface/info.json | 12 +++++ keyboards/bface/keymaps/default/keymap.c | 12 ++--- keyboards/bface/rules.mk | 2 + 5 files changed, 53 insertions(+), 58 deletions(-) create mode 100644 keyboards/bface/info.json diff --git a/keyboards/bface/README.md b/keyboards/bface/README.md index f8360aec0c..4120e3bc2d 100644 --- a/keyboards/bface/README.md +++ b/keyboards/bface/README.md @@ -1,61 +1,44 @@ -ps2avrGB keyboard firmware -========================== +# B.face -This is a port of the QMK firmware for boards that are based on the -ps2avrGB firmware, like the [ps2avrGB -keyboard](https://www.keyclack.com/product/gb-ps2avrgb/) or the ones sold -by [Winkeyless](http://winkeyless.kr/product/ps2avrgb-parts/). +A 60% keyboard with RGB that runs ps2avrgb natively. Please note that the B.face and B.fake have different switch matrices. Firmware on one, will not work on the other. -Note that this is a complete replacement for the firmware, so you won't be -using Bootmapper Client to change any keyboard settings, since not all the -USB report options are supported. +Keyboard Maintainer: QMK Community +Hardware Supported: B.face PCB +Hardware Availability: [Winkeyless](https://winkeyless.kr/product/b-face-x2-pcb/) -## Supported Boards +Make example for this keyboard (after setting up your build environment): -Only the [B.mini X2](http://winkeyless.kr/product/b-mini-x2-pcb/) has been -tested so far (since it's the only one I own). But other boards that use -the ps2avrGB firmware should work as well. + make bface:default -## Installing +Flashing -First, install the requirements. These commands are for OSX, but all you -need is the AVR toolchain and `bootloadHID` for flashing: +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. -``` -$ brew cask install crosspack-avr -$ brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb -``` +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. -In order to use the `./program` script, which can reboot the board into -the bootloader, you'll need Python 2 with PyUSB installed: +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + ``` -``` -$ pip install pyusb -``` +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -Then, with the keyboard plugged in, simply run this command from the -`qmk_firmware` directory: -``` -$ make ps2avrGB-program -``` - -If you prefer, you can just build it and flash the firmware directly with -`bootloadHID` if you boot the board while holding down `L_Ctrl` to keep it -in the bootloader: - -``` -$ make ps2avrGB -$ bootloadHID -r ps2avrGB_default.hex -``` - -## Troubleshooting - -From my experience, it's really hard to brick these boards. But these -tricks have been useful when it got stuck in a weird scenario. - -1. Try plugging the board in while pressing `L_Ctrl`. This will force it - to boot only the bootloader without loading the firmware. Once this is - done, just reflash the board with the original firmware. -2. Sometimes USB hubs can act weird, so try connecting the board directly - to your computer or plugging/unplugging the USB hub. +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/bface/bface.h b/keyboards/bface/bface.h index 1f1f3393ff..62d62f6953 100644 --- a/keyboards/bface/bface.h +++ b/keyboards/bface/bface.h @@ -23,7 +23,7 @@ along with this program. If not, see . #include "keycode.h" #include "action.h" -#define KEYMAP( \ +#define LAYOUT_60_ansi( \ K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, \ K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, \ K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, \ diff --git a/keyboards/bface/info.json b/keyboards/bface/info.json new file mode 100644 index 0000000000..f5ecf173d3 --- /dev/null +++ b/keyboards/bface/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "b.face", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/bface/keymaps/default/keymap.c b/keyboards/bface/keymaps/default/keymap.c index 785ab2e9de..c29ce9abfa 100644 --- a/keyboards/bface/keymaps/default/keymap.c +++ b/keyboards/bface/keymaps/default/keymap.c @@ -15,19 +15,17 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "bface.h" -#include "action_layer.h" -#include "rgblight.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( + [0] = LAYOUT_60_ansi( KC_ESC, 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_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_F1, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI,KC_FN0, KC_RCTL + KC_LCTL,KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI,MO(1), KC_RCTL ), - [1] = KEYMAP( + [1] = LAYOUT_60_ansi( KC_TRNS,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_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,BL_INC, BL_DEC, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, @@ -35,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS ), /* You can copy this layer as base for a new fn layer * / - [n] = KEYMAP( + [n] = LAYOUT_60_ansi( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, diff --git a/keyboards/bface/rules.mk b/keyboards/bface/rules.mk index 6fb32ae57b..95b6c8a97a 100644 --- a/keyboards/bface/rules.mk +++ b/keyboards/bface/rules.mk @@ -45,3 +45,5 @@ SRC = matrix.c i2c.c backlight_ps2avrGB.c # programming options PROGRAM_CMD = ./keyboards/bface/program .build/$(TARGET).hex + +LAYOUTS = 60_ansi -- cgit v1.2.3 From e1be79d7c9ab2b5f6591b511e19e235a32930c40 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:40:25 -0700 Subject: Keyboard: Corrected LFK65_HS LAYOUT_all matrix (#3703) Switch `k3D` was listed as `K3D` in the parameter list, causing a compile error (undeclared variable). --- keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h index 9f22efba94..53860ea2bf 100644 --- a/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h +++ b/keyboards/lfkeyboards/lfk65_hs/lfk65_hs.h @@ -23,6 +23,9 @@ void reset_keyboard_kb(void); +// readability +#define ___ KC_NO + /* All Keymap - contains every possible switch * ,-------------------------------------------------------------------------------. * | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 1A | 1B | 1C | 1D | 1E | 1F | 1G | @@ -41,15 +44,15 @@ void reset_keyboard_kb(void); #define LAYOUT_all( \ k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, \ k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2F, k2G, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, K3D, k3F, k3G, \ + k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3F, k3G, \ k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ ) { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, k3G}, \ - {k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ - {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, ___, k2F, k2G }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, k3D, k3E, k3F, k3G }, \ + { k41, k42, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G }, \ + { k51, k52, k53, ___, ___, ___, k57, ___, ___, ___, k5B, k5C, k5D, k5E, ___, ___ } \ } /* ANSI Keymap @@ -72,11 +75,11 @@ void reset_keyboard_kb(void); k41, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4F, k4G, \ k51, k52, k53, k57, k5B, k5C, k5D, k5E, k3E, k4E \ ) { \ - {k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, KC_NO, k1F, k1G}, \ - {k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, KC_NO, k2F, k2G}, \ - {k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G}, \ - {k41, KC_NO, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G}, \ - {k51, k52, k53, KC_NO, KC_NO, KC_NO, k57, KC_NO, KC_NO, KC_NO, k5B, k5C, k5D, k5E, KC_NO, KC_NO} \ + { k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, ___, k1F, k1G }, \ + { k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, ___, k2F, k2G }, \ + { k31, k32, k33, k34, k35, k36, k37, k38, k39, k3A, k3B, k3C, ___, k3E, k3F, k3G }, \ + { k41, ___, k43, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G }, \ + { k51, k52, k53, ___, ___, ___, k57, ___, ___, ___, k5B, k5C, k5D, k5E, ___, ___ } \ } #endif //LFK65_HS_H -- cgit v1.2.3 From 8720c6628a9b6d88fde6eb0a6e38f75fa9edbe8c Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:41:12 -0700 Subject: Keyboard: Alf X2 matrix fix (#3704) Invalid syntax in LAYOUT_split_arrows matrix macro. --- keyboards/alf_x2/alf_x2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/alf_x2/alf_x2.h b/keyboards/alf_x2/alf_x2.h index ca40451d8b..4ff20cc919 100644 --- a/keyboards/alf_x2/alf_x2.h +++ b/keyboards/alf_x2/alf_x2.h @@ -91,7 +91,7 @@ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_N), K313, K314 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ } -- cgit v1.2.3 From 3f8654c85d7e1abbdb55f3b242578e2231bd588f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:41:40 -0700 Subject: Keyboard: AMJ60 LAYOUT_iso matrix fix (#3705) LAYOUT_iso matrix was invalid. --- keyboards/amj60/amj60.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/amj60/amj60.h b/keyboards/amj60/amj60.h index 400f0691ee..07b406868e 100644 --- a/keyboards/amj60/amj60.h +++ b/keyboards/amj60/amj60.h @@ -3,7 +3,7 @@ #include "quantum.h" -// readability +// readability #define XXX KC_NO /* AMJ60 layout to the best of my knowledge matrix layout @@ -34,7 +34,7 @@ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } -/* +/* * ANSI * ,-----------------------------------------------------------. * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | @@ -92,7 +92,7 @@ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } -/* ISO +/* ISO * ,-----------------------------------------------------------. * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | * |-----------------------------------------------------------| @@ -116,7 +116,7 @@ {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d}, \ - {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, XXX}, \ + {k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, XXX, k3d}, \ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ } -- cgit v1.2.3 From cffaf0acf486a613cd9c131d2b2a47f980b90a5d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:42:18 -0700 Subject: Keyboard: Configurator render fix for AMJPad (#3706) - `LAYOUT` updated to `LAYOUT_numpad_6x4` - `LAYOUT_all` update to `LAYOUT_ortho_6x4` --- keyboards/amjpad/info.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/amjpad/info.json b/keyboards/amjpad/info.json index dde839dd87..d362bc070f 100644 --- a/keyboards/amjpad/info.json +++ b/keyboards/amjpad/info.json @@ -5,11 +5,11 @@ "width": 4, "height": 6, "layouts": { - "LAYOUT": { + "LAYOUT_numpad_6x4": { "key_count": 21, - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4, "h":2}, {"x":0, "y":5, "w":2}, {"x":2, "y":5}] + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k13", "x":3, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}, {"label":"k30", "x":0, "y":3}, {"label":"k31", "x":1, "y":3}, {"label":"k32", "x":2, "y":3}, {"label":"k23", "x":3, "y":2, "h":2}, {"label":"k40", "x":0, "y":4}, {"label":"k41", "x":1, "y":4}, {"label":"k42", "x":2, "y":4}, {"label":"k50", "x":0, "y":5, "w":2}, {"label":"k52", "x":2, "y":5}, {"label":"k43", "x":3, "y":4, "h":2}] }, - "LAYOUT_all": { + "LAYOUT_ortho_6x4": { "key_count": 24, "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k10", "x":0, "y":1}, {"label":"k11", "x":1, "y":1}, {"label":"k12", "x":2, "y":1}, {"label":"k13", "x":3, "y":1}, {"label":"k20", "x":0, "y":2}, {"label":"k21", "x":1, "y":2}, {"label":"k22", "x":2, "y":2}, {"label":"k23", "x":3, "y":2}, {"label":"k30", "x":0, "y":3}, {"label":"k31", "x":1, "y":3}, {"label":"k32", "x":2, "y":3}, {"label":"k33", "x":3, "y":3}, {"label":"k40", "x":0, "y":4}, {"label":"k41", "x":1, "y":4}, {"label":"k42", "x":2, "y":4}, {"label":"k43", "x":3, "y":4}, {"label":"k50", "x":0, "y":5}, {"label":"k51", "x":1, "y":5}, {"label":"k52", "x":2, "y":5}, {"label":"k53", "x":3, "y":5}] } -- cgit v1.2.3 From 343dc1be7fca9dfc01741050a18b83d0a3feb53e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 21 Aug 2018 08:45:42 -0700 Subject: Keyboard: UT47 Configurator support and readme cleanup (#3708) * Configurator support * Readme cleanup --- keyboards/ut47/info.json | 13 +++++++++++++ keyboards/ut47/readme.md | 6 ++---- 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 keyboards/ut47/info.json diff --git a/keyboards/ut47/info.json b/keyboards/ut47/info.json new file mode 100644 index 0000000000..59bffe99a3 --- /dev/null +++ b/keyboards/ut47/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "UT47", + "url": "", + "maintainer": "qmk", + "width": 12.5, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 47, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Backspace", "x":11, "y":0, "w":1.5}, {"label":"LT(3) / Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.25}, {"label":"Shift", "x":0, "y":2, "w":1.5}, {"label":"Z", "x":1.5, "y":2}, {"label":"X", "x":2.5, "y":2}, {"label":"C", "x":3.5, "y":2}, {"label":"V", "x":4.5, "y":2}, {"label":"B", "x":5.5, "y":2}, {"label":"N", "x":6.5, "y":2}, {"label":"M", "x":7.5, "y":2}, {"label":"<", "x":8.5, "y":2}, {"label":">", "x":9.5, "y":2}, {"label":"?", "x":10.5, "y":2}, {"label":"Shift / Enter", "x":11.5, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"GUI", "x":2, "y":3}, {"label":"Menu", "x":3, "y":3}, {"label":"MO(2)", "x":4, "y":3, "w":1.25}, {"x":5.25, "y":3, "w":2}, {"label":"MO(1)", "x":7.25, "y":3, "w":1.25}, {"label":"\u2190", "x":8.5, "y":3}, {"label":"\u2193", "x":9.5, "y":3}, {"label":"\u2191", "x":10.5, "y":3}, {"label":"\u2192", "x":11.5, "y":3}] + } + } +} diff --git a/keyboards/ut47/readme.md b/keyboards/ut47/readme.md index 3f08b3b329..244bbd1de8 100644 --- a/keyboards/ut47/readme.md +++ b/keyboards/ut47/readme.md @@ -4,10 +4,8 @@ Somewhere between ortholinear and standard offset. Created to have all the same functions on a Planck in a keyboard but with a more conventional keyboard row stagger. -Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations] - -Hardware Supported: [PCB design](http://www.40percent.club/2016/10/gnap-20-plateless.html), Arduino Pro Micro - +Keyboard Maintainer: [filoxo](https://github.com/filoxo), [network_operations] +Hardware Supported: [PCB design](http://www.40percent.club/2016/10/gnap-20-plateless.html), Arduino Pro Micro Hardware Availability: [How to order](http://www.40percent.club/2017/03/ordering-pcb.html) ### Instructions -- cgit v1.2.3 From a4294a153b25f1d257b6be5a6453fa2ca1e7a9d6 Mon Sep 17 00:00:00 2001 From: Kyle Peatt Date: Tue, 21 Aug 2018 22:07:18 -0400 Subject: Keymap: Added personal keymap for bface (#3719) * [keymap] Added personal keymap for bface * Add readme * [keymap] Added personal keymap for bface Add readme Remove right shift slash test --- keyboards/bface/keymaps/kpeatt/keymap.c | 79 ++++++++++++++++++++++++++++++++ keyboards/bface/keymaps/kpeatt/readme.md | 10 ++++ 2 files changed, 89 insertions(+) create mode 100644 keyboards/bface/keymaps/kpeatt/keymap.c create mode 100644 keyboards/bface/keymaps/kpeatt/readme.md diff --git a/keyboards/bface/keymaps/kpeatt/keymap.c b/keyboards/bface/keymaps/kpeatt/keymap.c new file mode 100644 index 0000000000..84de7872f4 --- /dev/null +++ b/keyboards/bface/keymaps/kpeatt/keymap.c @@ -0,0 +1,79 @@ +/* +Copyright 2017 Kyle Peatt + +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 . +*/ + +#include QMK_KEYBOARD_H + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Caps/FN | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | GUI | Alt | Space | Alt | GUI | Ctrl | Fn | + * `-----------------------------------------------------------------------------------------' + */ + + [0] = LAYOUT_60_ansi( + KC_GESC, 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_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, + LT(1, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_RCTL, MO(1) + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | `~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |-----------------------------------------------------------------------------------------+ + * | | | Up | | | | | | | |RGBMOD| Val+| Val- |RBGTOG| + * |-----------------------------------------------------------------------------------------+ + * | | Left| Down|Right| | | | | Sat+| Sat-| Hue+| Hue-| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + + [1] = LAYOUT_60_ansi( + KC_GRV, 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_UP,______,______,______,______,______,______,______,RGB_MOD,RGB_VAI,RGB_VAD,RGB_TOG, + ______,KC_LEFT,KC_DOWN,KC_RGHT,______, ______, ______,______,RGB_SAI,RGB_SAD,RGB_HUI,RGB_HUD,______, + ______,______,______,______,______, ______, ______,______,______,______,______, ______, + ______,______,______, ______, ______,______,______,______ + ), + /* You can copy this layer as base for a new fn layer * / + [n] = LAYOUT_60_ansi( + ______,______,______,______,______,______,______,______,______,______,______,______,______,______, + ______,______,______,______,______,______,______,______,______,______,______,______,______,______, + ______,______,______,______,______,______,______,______,______,______,______,______,______, + ______,______,______,______,______,______,______,______,______,______,______, ______, + ______,______,______, ______, ______,______,______,______ + ), // */ +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; diff --git a/keyboards/bface/keymaps/kpeatt/readme.md b/keyboards/bface/keymaps/kpeatt/readme.md new file mode 100644 index 0000000000..a7eef1e5fc --- /dev/null +++ b/keyboards/bface/keymaps/kpeatt/readme.md @@ -0,0 +1,10 @@ +kpeatt's bface layout +====================== + +## Keyboard Notes +- This is for a clone bface PCB that is no longer for sale as far as I can tell. [Used to be sold on KBDFans](https://www.aliexpress.com/item/bface-60-RGB-underground-copy-pcb-from-china-gh60-pcb-Customize-keyboard-PCB/32731084597.html). +- To put in reset mode hold `left ctrl` while inserting the USB cable +- Use flashing instructions in the main `bface` directory + +### Build +To build this keymap, run `make bface:kpeatt` from the qmk_firmware directory. -- cgit v1.2.3 From c8cd1ebc4570acbf3f3a56e5dcc74d3f19b92979 Mon Sep 17 00:00:00 2001 From: Kjili Date: Wed, 22 Aug 2018 04:08:17 +0200 Subject: Keyboard: Fix tada68 Linux readme (#3717) Remove confusing mention of a "Windows" computer. --- keyboards/tada68/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/tada68/readme.md b/keyboards/tada68/readme.md index 393666fc87..a2dbd92de6 100755 --- a/keyboards/tada68/readme.md +++ b/keyboards/tada68/readme.md @@ -70,7 +70,7 @@ $ make tada68:default:flashbin $ make tada68:default:flashbin ``` -2) Connect your keyboard to Windows computer, hit the reset button on the TADA, the lights will start flashing. +2) Connect your keyboard to the computer, hit the reset button on the TADA, the lights will start flashing. 3) A new entry should appear at `/dev/sd*`. Mount the board using this command: -- cgit v1.2.3 From 356fe590e60ce2a6799788ba9155da0516abcec3 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 22 Aug 2018 08:58:12 -0700 Subject: Keyboard: AMJ96 Refactor and Configurator update (#3707) * AMJ96 Refactor LAYOUT matrix and default keymap refactored to use full-length keycodes (instead of shorthand). * Configurator update Minor physical layout update and made the labels more sensible. * Readme update White space correction. * Default keymap update: #include QMK_KEYBOARD_H * rules.mk update Disabled the following options as my local test compile's .hex ended up too big to fit in the available flash space: MOUSEKEY_ENABLE EXTRAKEY_ENABLE BACKLIGHT_ENABLE RGBLIGHT_ENABLE If this is undesirable, suggestions are welcome. * Config/rules update Re-enabled MOUSEKEY_ENABLE, EXTRAKEY_ENABLE, BACKLIGHT_ENABLE, and RGBLIGHT_ENABLE and disabled COMMAND_ENABLE in rules.mk; enabled NO_ACTION_MACRO and NO_ACTION_FUNCTION per @drashna * Swapped `___` for `XXX` in amj96.h per @mechmerlin --- keyboards/amj96/amj96.h | 27 +++++++++++++++------------ keyboards/amj96/config.h | 4 ++-- keyboards/amj96/info.json | 7 ++++--- keyboards/amj96/keymaps/default/keymap.c | 32 +++++++++++++++++--------------- keyboards/amj96/readme.md | 2 +- keyboards/amj96/rules.mk | 4 ++-- 6 files changed, 41 insertions(+), 35 deletions(-) diff --git a/keyboards/amj96/amj96.h b/keyboards/amj96/amj96.h index 37bb6566fe..e8a83af0cb 100644 --- a/keyboards/amj96/amj96.h +++ b/keyboards/amj96/amj96.h @@ -18,25 +18,28 @@ #include "quantum.h" +// readability +#define XXX KC_NO + // This a shortcut to help you visually see your layout. // The following is an example using the Planck MIT layout // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT( \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K09, K0A, K0C, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K0B, K0F, K6F,\ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K0D, K6D,\ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K6E,\ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E, K5F, K0E, K07,\ - K60, K61, K62, K63, K64, K65, K66, K68, K69, K6A, K6B, K6C\ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K0B, K0F, K6F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F, K0D, K6D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K6E, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E, K5F, K0E, K07, \ + K60, K61, K62, K63, K64, K65, K66, K68, K69, K6A, K6B, K6C \ ) { \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_##K07, KC_NO, KC_##K09, KC_##K0A, KC_##K0B, KC_##K0C, KC_##K0D, KC_##K0E, KC_##K0F}, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1A, KC_##K1B, KC_##K1C, KC_##K1D, KC_##K1E, KC_##K1F}, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2A, KC_##K2B, KC_##K2C, KC_##K2D, KC_##K2E, KC_##K2F}, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3A, KC_##K3B, KC_##K3C, KC_##K3D, KC_##K3E, KC_##K3F}, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, KC_##K49, KC_##K4A, KC_##K4B, KC_##K4C, KC_##K4D, KC_##K4E, KC_##K4F}, \ - { KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, KC_##K59, KC_##K5A, KC_##K5B, KC_##K5C, KC_##K5D, KC_##K5E, KC_##K5F}, \ - { KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_NO, KC_##K68, KC_##K69, KC_##K6A, KC_##K6B, KC_##K6C, KC_##K6D, KC_##K6E, KC_##K6F} \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, K07, XXX, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \ + { K60, K61, K62, K63, K64, K65, K66, XXX, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F } \ } diff --git a/keyboards/amj96/config.h b/keyboards/amj96/config.h index 1ba35b54d0..6c51a24436 100644 --- a/keyboards/amj96/config.h +++ b/keyboards/amj96/config.h @@ -170,8 +170,8 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION /* * MIDI options diff --git a/keyboards/amj96/info.json b/keyboards/amj96/info.json index ac399adbde..bcee81b07b 100644 --- a/keyboards/amj96/info.json +++ b/keyboards/amj96/info.json @@ -5,8 +5,9 @@ "width": 19, "height": 6, "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Scroll Lock", "x":14, "y":0}, {"label":"Pause", "x":15, "y":0}, {"label":"Num Lock", "x":16, "y":0}, {"label":"/", "x":17, "y":0}, {"label":"*", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Insert", "x":15, "y":1}, {"label":"Home", "x":16, "y":1}, {"label":"PgUp", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Delete", "x":15, "y":2}, {"label":"End", "x":16, "y":2}, {"label":"PgDn", "x":17, "y":2}, {"label":"7", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"8", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"1", "x":14, "y":4}, {"label":"\u2191", "x":15, "y":4}, {"label":"\u2190", "x":16, "y":4}, {"label":"\u2193", "x":17, "y":4}, {"label":"\u2192", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}, {"label":"2", "x":15, "y":5}, {"label":".", "x":16, "y":5}, {"label":"3", "x":17, "y":5}, {"label":"9", "x":18, "y":5}] - } + "LAYOUT": { + "key_count": 103, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Ins", "x":15, "y":0}, {"label":"Del", "x":16, "y":0}, {"label":"Page Up", "x":17, "y":0}, {"label":"Page Down", "x":18, "y":0}, {"label":"` ~", "x":0, "y":1}, {"label":"1 !", "x":1, "y":1}, {"label":"2 @", "x":2, "y":1}, {"label":"3 #", "x":3, "y":1}, {"label":"4 $", "x":4, "y":1}, {"label":"5 %", "x":5, "y":1}, {"label":"6 ^", "x":6, "y":1}, {"label":"7 &", "x":7, "y":1}, {"label":"8 *", "x":8, "y":1}, {"label":"9 (", "x":9, "y":1}, {"label":"0 )", "x":10, "y":1}, {"label":"- _", "x":11, "y":1}, {"label":"= +", "x":12, "y":1}, {"label":"Back Space", "x":13, "y":1}, {"label":"Back Space 2", "x":14, "y":1}, {"label":"Num Lock", "x":15, "y":1}, {"label":"/", "x":16, "y":1}, {"label":"*", "x":17, "y":1}, {"label":"-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"[ {", "x":11.5, "y":2}, {"label":"] }", "x":12.5, "y":2}, {"label":"\\ |", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"+", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":"; :", "x":10.75, "y":3}, {"label":"' \"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"label":"ISO \\", "x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":", <", "x":9.25, "y":4}, {"label":". >", "x":10.25, "y":4}, {"label":"/ ?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"GUI", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"label":"Space", "x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.5}, {"label":"Fn", "x":11.5, "y":5, "w":1.5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}, {"label":"Enter", "x":18, "y":5}] + } } } diff --git a/keyboards/amj96/keymaps/default/keymap.c b/keyboards/amj96/keymaps/default/keymap.c index 72a44eedf7..0976d856e4 100644 --- a/keyboards/amj96/keymaps/default/keymap.c +++ b/keyboards/amj96/keymaps/default/keymap.c @@ -13,25 +13,27 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "amj96.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,PAUS, INS, DEL, PGUP,PGDN, \ - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC,NO, NLCK,PSLS,PAST,PMNS, \ - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, P7, P8, P9, PPLS, \ - CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, \ - LSFT,NO, Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT,UP, P1, P2, P3, PENT,\ - LCTL,LGUI,LALT, SPC, RALT,FN0, LEFT,DOWN, RGHT,P0, PDOT, PENT), + [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_PAUS, KC_INS, KC_DEL, KC_PGUP, KC_PGDN, \ + 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_NO, 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_P7, KC_P8, KC_P9, KC_PPLS, \ + 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_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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_FN0, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), - LAYOUT( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,\ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,NO, TRNS,TRNS,TRNS,TRNS,\ - TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,\ - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,\ - TRNS,NO, TRNS,TRNS, TRNS, TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS,\ - TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS) + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/amj96/readme.md b/keyboards/amj96/readme.md index 96bbb4a714..7c1b61c768 100644 --- a/keyboards/amj96/readme.md +++ b/keyboards/amj96/readme.md @@ -3,7 +3,7 @@ The AMD96 is a 96 key custom keyboard with anodized aluminum case, twin usb ports, and support for backlight LEDs and RGB underglow via SMD LEDs. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: AMJ96 +Hardware Supported: AMJ96 Hardware Availability: Was previously available on a GB via [Flashquark](https://flashquark.com/product/amj96/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/amj96/rules.mk b/keyboards/amj96/rules.mk index 3421d5820d..59451dee6b 100644 --- a/keyboards/amj96/rules.mk +++ b/keyboards/amj96/rules.mk @@ -55,12 +55,12 @@ 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 +COMMAND_ENABLE = no # 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 ?= yes # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default RGBLIGHT_ENABLE = yes MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode -- cgit v1.2.3 From 4951fc52be53c4297ed15186c5e127727e4feeda Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 22 Aug 2018 08:59:00 -0700 Subject: Keyboard: AL1 Configurator fix: misplaced arrow keys (#3716) * Configurator fix: misplaced arrow keys * rules.mk: set backlight and RGB rules --- keyboards/al1/info.json | 13 ++++++------- keyboards/al1/rules.mk | 3 ++- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/al1/info.json b/keyboards/al1/info.json index c40bd81965..f5ab643997 100644 --- a/keyboards/al1/info.json +++ b/keyboards/al1/info.json @@ -5,12 +5,11 @@ "width": 20.5, "height": 5.25, "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Num Lock", "x":16.5, "y":0}, {"label":"/", "x":17.5, "y":0}, {"label":"*", "x":18.5, "y":0}, {"label":"-", "x":19.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"7", "x":16.5, "y":1}, {"label":"8", "x":17.5, "y":1}, {"label":"9", "x":18.5, "y":1}, {"label":"+", "x":19.5, "y":1, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":16.5, "y":2}, {"label":"5", "x":17.5, "y":2}, {"label":"6", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"1", "x":16.5, "y":3}, {"label":"2", "x":17.5, "y":3}, {"label":"3", "x":18.5, "y":3}, {"label":"Enter", "x":19.5, "y":3, "h":2}, {"label":"\u2191", "x":15.25, "y":3.25}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":7}, {"label":"Alt", "x":10.5, "y":4, "w":1.25}, {"label":"Win", "x":11.75, "y":4}, {"label":"Menu", "x":12.75, "y":4, "w":1.25}, {"label":"0", "x":17.5, "y":4}, {"label":".", "x":18.5, "y":4}, {"label":"\u2190", "x":14.25, "y":4.25}, {"label":"\u2193", "x":15.25, "y":4.25}, {"label":"\u2192", "x":16.25, "y":4.25}] - }, - - "LAYOUT_split_bs": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Num Lock", "x":16.5, "y":0}, {"label":"/", "x":17.5, "y":0}, {"label":"*", "x":18.5, "y":0}, {"label":"-", "x":19.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"7", "x":16.5, "y":1}, {"label":"8", "x":17.5, "y":1}, {"label":"9", "x":18.5, "y":1}, {"label":"+", "x":19.5, "y":1, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":16.5, "y":2}, {"label":"5", "x":17.5, "y":2}, {"label":"6", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"1", "x":16.5, "y":3}, {"label":"2", "x":17.5, "y":3}, {"label":"3", "x":18.5, "y":3}, {"label":"Enter", "x":19.5, "y":3, "h":2}, {"label":"\u2191", "x":15.25, "y":3.25}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":7}, {"label":"Alt", "x":10.5, "y":4, "w":1.25}, {"label":"Win", "x":11.75, "y":4}, {"label":"Menu", "x":12.75, "y":4, "w":1.25}, {"label":"0", "x":17.5, "y":4}, {"label":".", "x":18.5, "y":4}, {"label":"\u2190", "x":14.25, "y":4.25}, {"label":"\u2193", "x":15.25, "y":4.25}, {"label":"\u2192", "x":16.25, "y":4.25}] - } + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Num Lock", "x":16.5, "y":0}, {"label":"/", "x":17.5, "y":0}, {"label":"*", "x":18.5, "y":0}, {"label":"-", "x":19.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"7", "x":16.5, "y":1}, {"label":"8", "x":17.5, "y":1}, {"label":"9", "x":18.5, "y":1}, {"label":"+", "x":19.5, "y":1, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":16.5, "y":2}, {"label":"5", "x":17.5, "y":2}, {"label":"6", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"↑", "x":15.25, "y":3.25}, {"label":"1", "x":16.5, "y":3}, {"label":"2", "x":17.5, "y":3}, {"label":"3", "x":18.5, "y":3}, {"label":"Enter", "x":19.5, "y":3, "h":2}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":7}, {"label":"Alt", "x":10.5, "y":4, "w":1.25}, {"label":"Win", "x":11.75, "y":4}, {"label":"Menu", "x":12.75, "y":4, "w":1.25}, {"label":"←", "x":14.25, "y":4.25}, {"label":"↓", "x":15.25, "y":4.25}, {"label":"→", "x":16.25, "y":4.25}, {"label":"0", "x":17.5, "y":4}, {"label":".", "x":18.5, "y":4}] + }, + "LAYOUT_split_bs": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Insert", "x":15.25, "y":0}, {"label":"Num Lock", "x":16.5, "y":0}, {"label":"/", "x":17.5, "y":0}, {"label":"*", "x":18.5, "y":0}, {"label":"-", "x":19.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Delete", "x":15.25, "y":1}, {"label":"7", "x":16.5, "y":1}, {"label":"8", "x":17.5, "y":1}, {"label":"9", "x":18.5, "y":1}, {"label":"+", "x":19.5, "y":1, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"4", "x":16.5, "y":2}, {"label":"5", "x":17.5, "y":2}, {"label":"6", "x":18.5, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"↑", "x":15.25, "y":3.25}, {"label":"1", "x":16.5, "y":3}, {"label":"2", "x":17.5, "y":3}, {"label":"3", "x":18.5, "y":3}, {"label":"Enter", "x":19.5, "y":3, "h":2}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4}, {"label":"Alt", "x":2.25, "y":4, "w":1.25}, {"x":3.5, "y":4, "w":7}, {"label":"Alt", "x":10.5, "y":4, "w":1.25}, {"label":"Win", "x":11.75, "y":4}, {"label":"Menu", "x":12.75, "y":4, "w":1.25}, {"label":"←", "x":14.25, "y":4.25}, {"label":"↓", "x":15.25, "y":4.25}, {"label":"→", "x":16.25, "y":4.25}, {"label":"0", "x":17.5, "y":4}, {"label":".", "x":18.5, "y":4}] + } } } diff --git a/keyboards/al1/rules.mk b/keyboards/al1/rules.mk index c730f7e7c7..3930f9adeb 100644 --- a/keyboards/al1/rules.mk +++ b/keyboards/al1/rules.mk @@ -60,7 +60,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = no 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 -- cgit v1.2.3 From 9d27d5544365b988575ca3face308d30feb40c86 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 22 Aug 2018 09:00:40 -0700 Subject: Keyboard: Blockey refactor (#3722) * Matrix refactor Edited for readability. * Keymap refactor Deleted TMK-syntax macro block. Edited for readability. * Readme cleanup Edited image link (link previously referenced a single-image album). * Configurator support --- keyboards/blockey/blockey.h | 17 ++++++----- keyboards/blockey/info.json | 12 ++++++++ keyboards/blockey/keymaps/default/keymap.c | 46 +++++++++--------------------- keyboards/blockey/keymaps/eucalyn/keymap.c | 45 +++++++++-------------------- keyboards/blockey/readme.md | 2 +- 5 files changed, 49 insertions(+), 73 deletions(-) create mode 100644 keyboards/blockey/info.json diff --git a/keyboards/blockey/blockey.h b/keyboards/blockey/blockey.h index f4869aa0e1..fa7624be76 100644 --- a/keyboards/blockey/blockey.h +++ b/keyboards/blockey/blockey.h @@ -18,6 +18,9 @@ #include "quantum.h" +// readability +#define XXX KC_NO + // This a shortcut to help you visually see your layout. // The following is an example using the Planck MIT layout // The first section contains all of the arguments @@ -25,21 +28,21 @@ #define LAYOUT( \ k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, k14, \ k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, k28, \ - k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, \ - k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, \ - k55, k56, k57, k58, k59, k60, k61, k62 \ + k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41, \ + k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, \ + k55, k56, k57, k58, k59, k60, k61, k62 \ ) \ { \ { k01, k02, k03, k04, k05, k06, k07 }, \ { k15, k16, k17, k18, k19, k20, k21 }, \ { k29, k30, k31, k32, k33, k34, k35 }, \ { k42, k43, k44, k45, k46, k47, k48 }, \ - { k55, k56, k57, k58, KC_NO, KC_NO, k59 }, \ + { k55, k56, k57, k58, XXX, XXX, k59 }, \ { k08, k09, k10, k11, k12, k13, k14 }, \ { k22, k23, k24, k25, k26, k27, k28 }, \ - { k36, k37, k38, k39, k40, k41, KC_NO }, \ - { k49, k50, k51, k52, k53, k54, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, k60, k61, k62, KC_NO}, \ + { k36, k37, k38, k39, k40, k41, XXX }, \ + { k49, k50, k51, k52, k53, k54, XXX }, \ + { XXX, XXX, XXX, k60, k61, k62, XXX }, \ } #endif diff --git a/keyboards/blockey/info.json b/keyboards/blockey/info.json new file mode 100644 index 0000000000..6180489726 --- /dev/null +++ b/keyboards/blockey/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "BlocKey", + "url": "", + "maintainer": "qmk", + "width": 14.16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"`", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"Back Space", "x":13, "y":0}, {"label":"Tab", "x":0.16, "y":1}, {"label":"Q", "x":1.16, "y":1}, {"label":"W", "x":2.16, "y":1}, {"label":"E", "x":3.16, "y":1}, {"label":"R", "x":4.16, "y":1}, {"label":"T", "x":5.16, "y":1}, {"label":"Y", "x":6.16, "y":1}, {"label":"U", "x":7.16, "y":1}, {"label":"I", "x":8.16, "y":1}, {"label":"O", "x":9.16, "y":1}, {"label":"P", "x":10.16, "y":1}, {"label":"[", "x":11.16, "y":1}, {"label":"]", "x":12.16, "y":1}, {"label":"\\", "x":13.16, "y":1}, {"label":"LCtrl", "x":0.33, "y":2}, {"label":"A", "x":1.33, "y":2}, {"label":"S", "x":2.33, "y":2}, {"label":"D", "x":3.33, "y":2}, {"label":"F", "x":4.33, "y":2}, {"label":"G", "x":5.33, "y":2}, {"label":"H", "x":6.33, "y":2}, {"label":"J", "x":7.33, "y":2}, {"label":"K", "x":8.33, "y":2}, {"label":"L", "x":9.33, "y":2}, {"label":";", "x":10.33, "y":2}, {"label":"\"", "x":11.33, "y":2}, {"label":"Enter", "x":12.66, "y":2}, {"label":"LShift", "x":0.5, "y":3}, {"label":"Z", "x":1.5, "y":3}, {"label":"X", "x":2.5, "y":3}, {"label":"C", "x":3.5, "y":3}, {"label":"V", "x":4.5, "y":3}, {"label":"B", "x":5.5, "y":3}, {"label":"N", "x":6.5, "y":3}, {"label":"M", "x":7.5, "y":3}, {"label":",", "x":8.5, "y":3}, {"label":".", "x":9.5, "y":3}, {"label":"/", "x":10.5, "y":3}, {"label":"Up", "x":11.5, "y":3}, {"label":"Fn", "x":12.83, "y":3}, {"label":"Esc", "x":0, "y":4}, {"label":"Caps Lock", "x":1, "y":4}, {"label":"LAlt", "x":2, "y":4}, {"label":"LGUI", "x":3, "y":4}, {"label":"Space", "x":4, "y":4, "w":6}, {"label":"Left", "x":10.5, "y":4}, {"label":"Down", "x":11.5, "y":4}, {"label":"Right", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/blockey/keymaps/default/keymap.c b/keyboards/blockey/keymaps/default/keymap.c index 594f04f355..5b11454823 100644 --- a/keyboards/blockey/keymaps/default/keymap.c +++ b/keyboards/blockey/keymaps/default/keymap.c @@ -27,41 +27,25 @@ extern rgblight_config_t rgblight_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - 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_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_LCTL,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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_UP, MO(1), \ - KC_ESC, KC_CAPS,KC_LALT,KC_LGUI,KC_SPC, KC_LEFT,KC_DOWN,KC_RGHT \ + 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_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_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, MO(1), \ + KC_ESC, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ - _______,RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ - _______,RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, \ - _______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGUP,_______, \ - _______,_______,_______,_______,_______, KC_HOME,KC_PGDN,KC_END \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} void matrix_init_user(void) { @@ -71,10 +55,6 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } diff --git a/keyboards/blockey/keymaps/eucalyn/keymap.c b/keyboards/blockey/keymaps/eucalyn/keymap.c index 7f79d6628b..33d1051a11 100644 --- a/keyboards/blockey/keymaps/eucalyn/keymap.c +++ b/keyboards/blockey/keymaps/eucalyn/keymap.c @@ -27,40 +27,25 @@ extern rgblight_config_t rgblight_config; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - 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_TAB, KC_Q, KC_W, KC_COMM,KC_DOT, KC_SCLN,KC_M, KC_R, KC_D, KC_Y, KC_P, KC_LBRC,KC_RBRC,KC_BSLS, \ - KC_LCTL,KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT,KC_ENT, \ - KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH,KC_UP, MO(1), \ - KC_ESC, KC_CAPS,KC_LALT,KC_LGUI,KC_SPC, KC_LEFT,KC_DOWN,KC_RGHT \ + 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_TAB, KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH, KC_UP, MO(1), \ + KC_ESC, KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ - _______,RGB_TOG,RGB_HUI,RGB_SAI,RGB_VAI,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ - _______,RGB_MOD,RGB_HUD,RGB_SAD,RGB_VAD,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, \ - _______,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_PGUP,_______, \ - _______,_______,_______,_______,_______, KC_HOME,KC_PGDN,KC_END \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, \ + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; }; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} void matrix_init_user(void) { @@ -70,10 +55,6 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } diff --git a/keyboards/blockey/readme.md b/keyboards/blockey/readme.md index ecae561250..24626318fb 100644 --- a/keyboards/blockey/readme.md +++ b/keyboards/blockey/readme.md @@ -1,6 +1,6 @@ # BlocKey -![BlocKey](https://imgur.com/a/6jAcrjr) +![BlocKey](https://i.imgur.com/VDdnuHo.jpg) A small keyboard. -- cgit v1.2.3 From 6076ed85be111f0e88c7049aa3d2e69eed5005a1 Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Thu, 23 Aug 2018 01:51:37 +0900 Subject: Keyboard: Partial refactor of the crkbd code (#3600) * Add display to LED-parameters function * Improvement of update timing for OLED display (Need TWI_Init) --- keyboards/crkbd/keymaps/default/config.h | 6 +-- keyboards/crkbd/keymaps/default/keymap.c | 33 ++++++------ keyboards/crkbd/keymaps/default/rules.mk | 13 +++-- .../crkbd/keymaps/lib/host_led_state_reader.c | 16 +++--- keyboards/crkbd/keymaps/lib/keylogger.c | 46 ++++++++--------- keyboards/crkbd/keymaps/lib/layer_state_reader.c | 38 +++++++------- keyboards/crkbd/keymaps/lib/logo_reader.c | 13 +++-- keyboards/crkbd/keymaps/lib/mode_icon_reader.c | 12 ++--- keyboards/crkbd/keymaps/lib/rgb_state_reader.c | 15 ++++++ keyboards/crkbd/keymaps/lib/timelogger.c | 13 +++-- keyboards/crkbd/keymaps/like_jis/keymap.c | 59 ++++++++++++++-------- keyboards/crkbd/keymaps/like_jis/rules.mk | 9 ++++ 12 files changed, 159 insertions(+), 114 deletions(-) create mode 100644 keyboards/crkbd/keymaps/lib/rgb_state_reader.c diff --git a/keyboards/crkbd/keymaps/default/config.h b/keyboards/crkbd/keymaps/default/config.h index 15aeb098bc..8d25f7cbc6 100644 --- a/keyboards/crkbd/keymaps/default/config.h +++ b/keyboards/crkbd/keymaps/default/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial */ @@ -50,4 +47,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#endif diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c index ac3b7215cd..87661d3451 100644 --- a/keyboards/crkbd/keymaps/default/keymap.c +++ b/keyboards/crkbd/keymaps/default/keymap.c @@ -1,24 +1,14 @@ -#include "crkbd.h" +#include QMK_KEYBOARD_H #include "bootloader.h" -#include "action_layer.h" -#include "action_util.h" -#include "eeconfig.h" #ifdef PROTOCOL_LUFA -#include "lufa.h" -#include "split_util.h" + #include "lufa.h" + #include "split_util.h" #endif -#include "LUFA/Drivers/Peripheral/TWI.h" #ifdef SSD1306OLED + #include "LUFA/Drivers/Peripheral/TWI.h" #include "ssd1306.h" #endif -#include "../lib/mode_icon_reader.c" -#include "../lib/layer_state_reader.c" -#include "../lib/host_led_state_reader.c" -#include "../lib/logo_reader.c" -#include "../lib/keylogger.c" -#include "../lib/timelogger.c" - extern keymap_config_t keymap_config; #ifdef RGBLIGHT_ENABLE @@ -148,12 +138,25 @@ void matrix_init_user(void) { //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + void matrix_scan_user(void) { iota_gfx_task(); } void matrix_render_user(struct CharacterMatrix *matrix) { if (is_master) { + // If you want to change the display of OLED, you need to change here matrix_write_ln(matrix, read_layer_state()); matrix_write_ln(matrix, read_keylog()); matrix_write_ln(matrix, read_keylogs()); @@ -182,7 +185,7 @@ void iota_gfx_task_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { set_keylog(keycode, record); - set_timelog(); + // set_timelog(); } switch (keycode) { diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk index 33ddd82a43..6570e2f5cb 100644 --- a/keyboards/crkbd/keymaps/default/rules.mk +++ b/keyboards/crkbd/keymaps/default/rules.mk @@ -15,11 +15,16 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -ONEHAND_ENABLE = no # Enable one-hand typing +SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +# If you want to change the display of OLED, you need to change here +SRC += ../lib/rgb_state_reader.c \ + ../lib/layer_state_reader.c \ + ../lib/logo_reader.c \ + ../lib/keylogger.c \ + # ../lib/mode_icon_reader.c \ + # ../lib/host_led_state_reader.c \ + # ../lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/lib/host_led_state_reader.c b/keyboards/crkbd/keymaps/lib/host_led_state_reader.c index c19af11f8a..41ac55dc2b 100644 --- a/keyboards/crkbd/keymaps/lib/host_led_state_reader.c +++ b/keyboards/crkbd/keymaps/lib/host_led_state_reader.c @@ -1,13 +1,15 @@ +#include #include "crkbd.h" -char host_led_state[40]; +char host_led_state_str[24]; -char *read_host_led_state(void) +const char *read_host_led_state(void) { - snprintf(host_led_state, sizeof(host_led_state), "\n%s %s %s", - (host_keyboard_leds() & (1 << USB_LED_NUM_LOCK)) ? "NUMLOCK" : " ", - (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) ? "CAPS" : " ", - (host_keyboard_leds() & (1 << USB_LED_SCROLL_LOCK)) ? "SCLK" : " "); + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); - return host_led_state; + return host_led_state_str; } diff --git a/keyboards/crkbd/keymaps/lib/keylogger.c b/keyboards/crkbd/keymaps/lib/keylogger.c index ee14ff0335..8f2a8ce3cc 100644 --- a/keyboards/crkbd/keymaps/lib/keylogger.c +++ b/keyboards/crkbd/keymaps/lib/keylogger.c @@ -1,10 +1,11 @@ +#include #include "crkbd.h" -char keylog[40] = {}; -char keylogs[21] = {}; -int keylogs_idx = 0; +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; -char code_to_name[60] = { +const char code_to_name[60] = { ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', @@ -12,38 +13,33 @@ char code_to_name[60] = { 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; -void set_keylog(uint16_t keycode, keyrecord_t *record) -{ +void set_keylog(uint16_t keycode, keyrecord_t *record) { char name = ' '; - if (keycode < 60) - { + if (keycode < 60) { name = code_to_name[keycode]; } // update keylog - snprintf(keylog, sizeof(keylog), "%dx%d, k%2d : %c", - record->event.key.row, - record->event.key.col, - keycode, - name); + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); // update keylogs - if (keylogs_idx == sizeof(keylogs) - 1) - { - keylogs_idx = 0; - for (int i = 0; i < sizeof(keylogs) - 1; i++) - { - keylogs[i] = ' '; + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; } } - keylogs[keylogs_idx] = name; - keylogs_idx++; + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; } -char *read_keylog(void) { - return keylog; +const char *read_keylog(void) { + return keylog_str; } -char *read_keylogs(void) { - return keylogs; +const char *read_keylogs(void) { + return keylogs_str; } diff --git a/keyboards/crkbd/keymaps/lib/layer_state_reader.c b/keyboards/crkbd/keymaps/lib/layer_state_reader.c index f79720d6f9..eddb71337e 100644 --- a/keyboards/crkbd/keymaps/lib/layer_state_reader.c +++ b/keyboards/crkbd/keymaps/lib/layer_state_reader.c @@ -1,3 +1,6 @@ + +#include QMK_KEYBOARD_H +#include #include "crkbd.h" #define L_BASE 0 @@ -6,27 +9,26 @@ #define L_ADJUST 65536 #define L_ADJUST_TRI 65560 -char layer_state_str[40]; +char layer_state_str[24]; -char *read_layer_state(void) -{ +const char *read_layer_state(void) { switch (layer_state) { - case L_BASE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); - break; - case L_RAISE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); - break; - case L_LOWER: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); - break; - case L_ADJUST: - case L_ADJUST_TRI: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); - break; - default: - snprintf(layer_state_str,sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); } return layer_state_str; diff --git a/keyboards/crkbd/keymaps/lib/logo_reader.c b/keyboards/crkbd/keymaps/lib/logo_reader.c index 46de17bfe0..1bc1503a60 100644 --- a/keyboards/crkbd/keymaps/lib/logo_reader.c +++ b/keyboards/crkbd/keymaps/lib/logo_reader.c @@ -1,12 +1,11 @@ #include "crkbd.h" -char *read_logo(void) -{ - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; return logo; } diff --git a/keyboards/crkbd/keymaps/lib/mode_icon_reader.c b/keyboards/crkbd/keymaps/lib/mode_icon_reader.c index cb3d8adb12..04c226506a 100644 --- a/keyboards/crkbd/keymaps/lib/mode_icon_reader.c +++ b/keyboards/crkbd/keymaps/lib/mode_icon_reader.c @@ -1,13 +1,13 @@ +#include #include "crkbd.h" -char mode_icon[40]; +char mode_icon[24]; -char *read_mode_icon(bool swap) -{ - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(swap == false){ +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); - }else{ + } else { snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); } diff --git a/keyboards/crkbd/keymaps/lib/rgb_state_reader.c b/keyboards/crkbd/keymaps/lib/rgb_state_reader.c new file mode 100644 index 0000000000..e0efe2e528 --- /dev/null +++ b/keyboards/crkbd/keymaps/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/crkbd/keymaps/lib/timelogger.c b/keyboards/crkbd/keymaps/lib/timelogger.c index 0e22bafe7f..69828a3a08 100644 --- a/keyboards/crkbd/keymaps/lib/timelogger.c +++ b/keyboards/crkbd/keymaps/lib/timelogger.c @@ -1,17 +1,16 @@ +#include #include "crkbd.h" -char timelog[40] = {}; +char timelog_str[24] = {}; int last_time = 0; int elapsed_time = 0; -void set_timelog(void) -{ +void set_timelog(void) { elapsed_time = timer_elapsed(last_time); last_time = timer_read(); - snprintf(timelog, sizeof(timelog), "lt:%5d, et:%5d", last_time, elapsed_time); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); } -char *read_timelog(void) -{ - return timelog; +const char *read_timelog(void) { + return timelog_str; } diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 0dd9c15500..31b5230b10 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -5,16 +5,10 @@ #include "split_util.h" #endif #ifdef SSD1306OLED + #include "LUFA/Drivers/Peripheral/TWI.h" #include "ssd1306.h" #endif -#include "../lib/mode_icon_reader.c" -#include "../lib/layer_state_reader.c" -#include "../lib/host_led_state_reader.c" -#include "../lib/logo_reader.c" -#include "../lib/keylogger.c" -#include "../lib/timelogger.c" - extern keymap_config_t keymap_config; #ifdef RGBLIGHT_ENABLE @@ -84,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+------+------+------+------+------| |------+------+------+------+------+------| _____, F11, F12, XXXXX, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - _____, _____, DEL, XXXXX, _____, APP \ + _____, _____, DEL, _____, _____, APP \ //`--------------------' `--------------------' ), @@ -96,19 +90,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+------+------+------+------+------| |------+------+------+------+------+------| _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, XXXXX,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - _____, _____, XXXXX, XXXXX, _____, LALT \ + _____, _____, BSPC, _____, _____, LALT \ //`--------------------' `--------------------' ), [_ADJUST] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - RST, LRST, KNRM, KSWP, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ - //|------+------+------+------+------+------| |------+------+------+------+------+------| - LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ - //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ + _____, RST, LRST, KNRM, KSWP,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + //|------+-------+------+------+------+-----| |------+------+------+------+------+------| + _____, LTOG, LHUI, LSAI, LVAI,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ + //|------+-------+------+------+------+-----| |------+------+------+------+------+------| + _____, LSMOD, LHUD, LSAD, LVAD,XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - _____, _____, XXXXX, XXXXX, _____, XXXXX \ + _____, _____, XXXXX, _____, _____, XXXXX \ //`--------------------' `--------------------' ) }; @@ -130,6 +124,7 @@ void matrix_init_user(void) { #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); iota_gfx_init(!has_usb()); // turns on the display #endif } @@ -137,18 +132,42 @@ void matrix_init_user(void) { //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +#ifdef RGBLIGHT_ENABLE + const char *read_rgb_info(void); + #define RENDER_RGB_INFO(m) matrix_write_ln(m, (const char*)read_rgb_info()) +#else + #define RENDER_RGB_INFO(m) +#endif + + void matrix_scan_user(void) { iota_gfx_task(); } inline void matrix_render_user(struct CharacterMatrix *matrix) { if (is_master) { + // If you want to change the display of OLED, you need to change here matrix_write_ln(matrix, read_layer_state()); matrix_write_ln(matrix, read_keylog()); - matrix_write_ln(matrix, read_keylogs()); - //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - //matrix_write_ln(matrix, read_host_led_state()); - //matrix_write_ln(matrix, read_timelog()); + RENDER_RGB_INFO(matrix); + // matrix_write_ln(matrix, read_keylogs()); + // matrix_write_ln(matrix, read_host_led_state()); + + // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + // matrix_write_ln(matrix, read_timelog()); } else { matrix_write(matrix, read_logo()); } @@ -174,7 +193,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef SSD1306OLED if (record->event.pressed) { set_keylog(keycode, record); - set_timelog(); + // set_timelog(); } #endif diff --git a/keyboards/crkbd/keymaps/like_jis/rules.mk b/keyboards/crkbd/keymaps/like_jis/rules.mk index 3f1bd9108d..6570e2f5cb 100644 --- a/keyboards/crkbd/keymaps/like_jis/rules.mk +++ b/keyboards/crkbd/keymaps/like_jis/rules.mk @@ -19,3 +19,12 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # 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 you want to change the display of OLED, you need to change here +SRC += ../lib/rgb_state_reader.c \ + ../lib/layer_state_reader.c \ + ../lib/logo_reader.c \ + ../lib/keylogger.c \ + # ../lib/mode_icon_reader.c \ + # ../lib/host_led_state_reader.c \ + # ../lib/timelogger.c \ -- cgit v1.2.3 From 5d8d3509762407997626d15700094cad066dcf6d Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 22 Aug 2018 20:14:52 -0700 Subject: Keyboard: Finish up the HSE now that I have a board to play with! (#3728) * fix up readmes * update keymap to match configurator default * add more info --- keyboards/1up60hse/config.h | 4 +-- keyboards/1up60hse/keymaps/default/keymap.c | 45 +++++++--------------------- keyboards/1up60hse/keymaps/default/readme.md | 7 ++++- keyboards/1up60hse/readme.md | 8 ++--- 4 files changed, 22 insertions(+), 42 deletions(-) diff --git a/keyboards/1up60hse/config.h b/keyboards/1up60hse/config.h index b89a13b3d2..c3682de43e 100644 --- a/keyboards/1up60hse/config.h +++ b/keyboards/1up60hse/config.h @@ -23,9 +23,9 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x0000 #define DEVICE_VER 0x0001 -#define MANUFACTURER You +#define MANUFACTURER 1upkeyboards #define PRODUCT 1up60hse -#define DESCRIPTION A custom keyboard +#define DESCRIPTION A custom 60% keyboard /* key matrix size */ #define MATRIX_ROWS 5 diff --git a/keyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1up60hse/keymaps/default/keymap.c index 040f9ebedb..556246a3b2 100644 --- a/keyboards/1up60hse/keymaps/default/keymap.c +++ b/keyboards/1up60hse/keymaps/default/keymap.c @@ -19,51 +19,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi( KC_ESC, 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_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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(1), KC_RGUI, KC_LCTL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), [1] = LAYOUT_60_ansi( - KC_GRV, 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_DEL, + KC_GRV, 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_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + [2] = LAYOUT_60_ansi( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/1up60hse/keymaps/default/readme.md b/keyboards/1up60hse/keymaps/default/readme.md index 22f10a9312..a9afa5ea6d 100644 --- a/keyboards/1up60hse/keymaps/default/readme.md +++ b/keyboards/1up60hse/keymaps/default/readme.md @@ -1 +1,6 @@ -# The default keymap for 1up60hse +# 1up60hse default keymap + +This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). + +## Notes +- Software reset key is located on `Esc` on the third layer. diff --git a/keyboards/1up60hse/readme.md b/keyboards/1up60hse/readme.md index 021e84d1e9..5ea040bf4a 100644 --- a/keyboards/1up60hse/readme.md +++ b/keyboards/1up60hse/readme.md @@ -1,11 +1,11 @@ -# 1up60hse +# 1up60hse (hot swap edition) -![1up60hse](imgur.com image replace me!) +![1up60hse](https://i2.wp.com/www.1upkeyboards.com/wp-content/uploads/2018/08/PCB-1up-60-hotswap-group-RGB.jpg?fit=1280%2C1280&ssl=1) -A 60% PCB with USB C, RGB underglow, backlighting, and hotswappable switches. +A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a standard ANSI layout. Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: 1up60hse 60% PCB. +Hardware Supported: 1up60hse 60% PCB. Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From 9064b424e9ba581f0ea2df7353ccdeef4f4a2ce7 Mon Sep 17 00:00:00 2001 From: Erik Thorsell Date: Thu, 23 Aug 2018 04:16:16 +0100 Subject: Keymap: Add Dvorak Svorak A5 layout for Ergodox-EZ (#3725) * Add svorak a5 * Update Svorak A5 keymap * Fix issue with special characters The initial keymap did not account for non US software layout. Hence, the special characters were incorrect. Since this layout is aimed towards Swedish writing people the presumption is that whoever uses it will have Swedish as their OS language. Includes: - Special character issue fixed - QWERTY layer that can be toggled if requiered (also presumes Swedish software layout) * Add special characters and media keys * Add ctrl, alt, etc. to functional layer --- .../community/ergodox/dvorak_svorak_a5/keymap.c | 214 +++++++++++++++++++++ .../community/ergodox/dvorak_svorak_a5/readme.md | 42 ++++ 2 files changed, 256 insertions(+) create mode 100644 layouts/community/ergodox/dvorak_svorak_a5/keymap.c create mode 100644 layouts/community/ergodox/dvorak_svorak_a5/readme.md diff --git a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c new file mode 100644 index 0000000000..2668fce866 --- /dev/null +++ b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c @@ -0,0 +1,214 @@ +#include QMK_KEYBOARD_H +#include "debug.h" +#include "action_layer.h" +#include "keymap_swedish.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MOUS 2 // mouse keys +#define QWRT 3 // qwerty layout + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | ~MOUS| | QWRT | 6 | 7 | 8 | 9 | 0 | + | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | P | Y | | | Del | F | G | C | R | L | , | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | Escape | A | O | E | U | I |------| |------| D | H | T | N | S | -/_ | + * |--------+------+------+------+------+------| | | RCTRL|------+------+------+------+------+--------| + * | LShift | . | Q | J | K | X | | | | B | M | W | V | Z | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LCTRL | | | LAlt | Super| | ~SYMB| Left | Down | Up | Right | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Ins | Del | | HOME | END | + * ,------|------|------| |------+--------+-------. + * | | | | | PgUp | | | + * | BSP | Tab |------| |------| Enter | Space | + * | | | | | PgDn | | | + * `--------------------' `-----------------------' + */ +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, MO(MOUS), + KC_TAB, NO_AA, NO_AE, NO_OSLH, KC_P, KC_Y, KC_NO, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSFT, KC_DOT, KC_Q, KC_J, KC_K, KC_X, KC_NO, + KC_LCTRL, KC_NO, KC_NO, KC_LALT, KC_LCMD, + KC_INSERT, KC_DEL, + KC_NO, + KC_BSPC, KC_TAB, KC_NO, + // right hand + TG(QWRT), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, + KC_DEL, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM, + KC_D, KC_H, KC_T, KC_N, KC_S, NO_MINS, + KC_RCTRL, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + MO(SYMB), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + KC_HOME, KC_END, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPACE + ), +/* Keymap 1: Symbol Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | { | } | [ | ] | $ | | | | " | ? | & | < | > | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | ; | / | ( | ) | | |------| |------| # | ^ | # | " | ~ | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | : | = | @ | ! | \ | | | | % | | ' | * | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | BSP | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, ALGR(KC_7), ALGR(KC_0), ALGR(KC_8), ALGR(KC_9), ALGR(KC_4), KC_NO, + KC_NO, LSFT(KC_COMM), KC_KP_SLASH, LSFT(KC_8), LSFT(KC_9), ALGR(KC_NUBS), + KC_NO, LSFT(KC_DOT), LSFT(KC_0), ALGR(KC_2), KC_EXLM, ALGR(KC_MINS), KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_TRNS, KC_NO, KC_NO, + // right hand + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, LSFT(KC_2), NO_QUES, LSFT(KC_6), NO_LESS, NO_GRTR, KC_NO, + KC_HASH, NO_CIRC, KC_HASH, LSFT(KC_2), NO_TILD, KC_NO, + KC_NO, KC_PERC, NO_ACUT, NO_APOS, NO_ASTR, NO_GRV, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | F11 | F12 | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | Vol Up | + * |--------+------+------+------+------+------| | | RCTRL|------+------+------+------+------+--------| + * | | | | | | | | | | | | | B1 | B2 |Vol Down| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LCTRL| | | LALT | | | | M_L | M_D | M_U | M_R | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | Play | + * | | | | | | | Pause| + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MOUS] = LAYOUT_ergodox( + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, + KC_NO, KC_F11, KC_F12, 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_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_NO, + // right hand + KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, 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_VOLU, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_BTN1, KC_BTN2, KC_VOLD, + KC_NO, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, + KC_NO, KC_NO, + KC_NO, + KC_NO, KC_NO, KC_MPLY +), +/* Keymap 3: QWERTY Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | Print | ! | " | # | # | % | | |Middle| & | / | ( | ) | = | ? | + * | Screen | 1 | 2 @ | 3 | 4 $ | 5 | F11 | |Mouse | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CapsLk | A | S | D | F | G |------| |------| H | J | K | L | | | + * |--------+------+------+------+------+------| ` | | Del |------+------+------+------+------+--------| + * | LShft | Z | X | C | V | B | ' | | | N | M | , | . | - | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | LCtl | ^ | * | LAlt | LGui | | AltGr| Down | Up | Left | Right| + * | (') | " ~ | ' | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,--------------. + * | LCtl | LAlt | | Home | End | + * ,------|------|------| |------+-------+------. + * | | | ~ | | PgUp | | | + * | BSP | TAB |------| |------| Enter | Space| + * | | | Esc | | PgDn | | | + * `--------------------' `---------------------' + */ +[QWRT] = LAYOUT_ergodox( + // left hand + KC_PSCR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TRNS, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, NO_ACUT, + CTL_T(NO_APOS), NO_CIRC, NO_ASTR, KC_LALT, KC_LGUI, + KC_LCTRL, KC_LALT, + NO_TILD, + KC_BSPC, KC_TAB, KC_ESC, + // right hand + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, + KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, + KC_H, KC_J, KC_K, KC_L, NO_OSLH, NO_AE, + KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSFT, + NO_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, + KC_HOME, KC_END, + KC_PGUP, + KC_PGDN, KC_ENT, KC_SPACE +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) +}; + + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + default: + break; + } + +}; diff --git a/layouts/community/ergodox/dvorak_svorak_a5/readme.md b/layouts/community/ergodox/dvorak_svorak_a5/readme.md new file mode 100644 index 0000000000..c4b9184166 --- /dev/null +++ b/layouts/community/ergodox/dvorak_svorak_a5/readme.md @@ -0,0 +1,42 @@ +# ErgoDox EZ Svorak A5 + +This layout is supposed to be an implementation of the [Svorak A5 +layout](http://aoeu.info/s/dvorak/svorak). Unfortunately, the Ergodox EZ lacks +one column for the right hand, why the three buttons furthest to the right, on +the right half, are missing. I have tried to move them around and have yet to +find a perfect position for them. + + +## Note + +The keyboard assumes that the operating system interprets your keyboard as +Swedish. If you get weird issues (like, most letters work, but not all special +characters) please make sure your operating system uses a Swedish keyboard +layout. + + +## Flashing + +In order to compile and flash your Ergodox EZ, invoke the following at the root +of the repository. + +`make ergodox_ez:dvorak_svorak_a5:teensy` + +I haven't gotten the above to work on Windows. Instead I use +[Msys2](https://www.msys2.org/) to compile the .hex-file (`make ergodox_ez:dvorak_svorak_a5`) +and [Teensy Loader](https://www.pjrc.com/teensy/loader_win10.html) to flash the +board. + + +## Changelog + +* 2018-08-09 + * Initial release +* 2018-08-10 + * Make special characters work in Windows + * Add QWERTY layer + +# Author +Erik Thorsell +erikthorsell @ github and twitter + -- cgit v1.2.3 From 6d1536db1da117345156ed36255f10f235f0b915 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Wed, 22 Aug 2018 20:16:49 -0700 Subject: Keymap: fix conditionals in userspace rules.mk (#3726) * fix conditionals in rules.mk * minor keymap change --- layouts/community/ortho_4x12/wanleg/keymap.c | 2 +- users/wanleg/rules.mk | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 43cae711ac..8773001d0a 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__0_______________, _______________Qwerty_Row__1_______________, _______________Qwerty_Row__2_______________, - KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), KC_SPC, SUPRA, KC_RGUI, KC_RALT, KC_RGUI, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), KC_SPC, SUPRA, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL ), #else [_GK] = LAYOUT_ortho_4x12_wrapper( diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 8dcc911cef..ac86769538 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -4,13 +4,8 @@ endif SRC += wanleg.c tapdances.c -ifndef TAP_DANCE_ENABLE TAP_DANCE_ENABLE = yes -endif - -ifndef MOUSEKEY_ENABLE MOUSEKEY_ENABLE = yes -endif #If using a ProMicro and it has the QMK DFU bootloader instead of Caterina, #run "make : dfu=qmk" when compiling to ensure it is flagged properly after being flashed -- cgit v1.2.3 From c6eccb39e0da150b7575b96d68366ba46f22306b Mon Sep 17 00:00:00 2001 From: zwnk Date: Thu, 23 Aug 2018 15:48:30 -0300 Subject: Keyboard: dactyl_manuform 5x7 aka Ergodox-ish added (#3691) * dactyl_manuform 5x7 aka Ergodox added * LAYOUTS = ergodox removed * README updated * README updated again * zip file removed --- keyboards/handwired/dactyl_manuform/5x6/5x6.h | 6 -- keyboards/handwired/dactyl_manuform/5x7/5x7.c | 23 ++++++ keyboards/handwired/dactyl_manuform/5x7/5x7.h | 45 ++++++++++++ keyboards/handwired/dactyl_manuform/5x7/config.h | 33 +++++++++ .../dactyl_manuform/5x7/keymaps/default/config.h | 27 +++++++ .../dactyl_manuform/5x7/keymaps/default/keymap.c | 85 ++++++++++++++++++++++ keyboards/handwired/dactyl_manuform/5x7/rules.mk | 20 +++++ .../handwired/dactyl_manuform/dactyl_manuform.h | 4 +- keyboards/handwired/dactyl_manuform/readme.md | 32 ++++---- 9 files changed, 252 insertions(+), 23 deletions(-) create mode 100644 keyboards/handwired/dactyl_manuform/5x7/5x7.c create mode 100644 keyboards/handwired/dactyl_manuform/5x7/5x7.h create mode 100644 keyboards/handwired/dactyl_manuform/5x7/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x7/keymaps/default/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/5x7/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/5x6/5x6.h b/keyboards/handwired/dactyl_manuform/5x6/5x6.h index cb225a2cf2..72045cc291 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/5x6.h +++ b/keyboards/handwired/dactyl_manuform/5x6/5x6.h @@ -1,11 +1,8 @@ #pragma once #include "dactyl_manuform.h" - -//void promicro_bootloader_jmp(bool program); #include "quantum.h" - #ifdef USE_I2C #include #ifdef __AVR__ @@ -14,9 +11,6 @@ #endif #endif -//void promicro_bootloader_jmp(bool program); - - #define LAYOUT_5x6(\ L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ diff --git a/keyboards/handwired/dactyl_manuform/5x7/5x7.c b/keyboards/handwired/dactyl_manuform/5x7/5x7.c new file mode 100644 index 0000000000..135014d655 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/5x7.c @@ -0,0 +1,23 @@ +#include "5x7.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/5x7/5x7.h b/keyboards/handwired/dactyl_manuform/5x7/5x7.h new file mode 100644 index 0000000000..95fd5bb102 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/5x7.h @@ -0,0 +1,45 @@ +#pragma once + +#include "dactyl_manuform.h" +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT_5x7( \ + L11, L12, L13, L14, L15, L16, L17, \ + L21, L22, L23, L24, L25, L26, L27, \ + L31, L32, L33, L34, L35, L36, L37, \ + L41, L42, L43, L44, L45, L46, \ + L51, L52, L53, L54, \ + L55, L56, \ + L65, L66, \ + L63, L64, \ + R11, R12, R13, R14, R15, R16, R17, \ + R21, R22, R23, R24, R25, R26, R27, \ + R31, R32, R33, R34, R35, R36, R37, \ + R42, R43, R44, R45, R46, R47, \ + R54, R55, R56, R57, \ + R52, R53, \ + R62, R63, \ + R64, R65 \ + ) \ + { \ + { L11, L12, L13, L14, L15, L16, L17 }, \ + { L21, L22, L23, L24, L25, L26, L27 }, \ + { L31, L32, L33, L34, L35, L36, L37 }, \ + { L41, L42, L43, L44, L45, L46, KC_NO }, \ + { L51, L52, L53, L54, L55, L56, KC_NO }, \ + { KC_NO, KC_NO, L63, L64, L65, L66, KC_NO }, \ + { R11, R12, R13, R14, R15, R16, R17 }, \ + { R21, R22, R23, R24, R25, R26, R27 }, \ + { R31, R32, R33, R34, R35, R36, R37 }, \ + { KC_NO, R42, R43, R44, R45, R46, R47 }, \ + { KC_NO, R52, R53, R54, R55, R56, R57 }, \ + { KC_NO, R62, R63, R64, R65, KC_NO, KC_NO } \ + } diff --git a/keyboards/handwired/dactyl_manuform/5x7/config.h b/keyboards/handwired/dactyl_manuform/5x7/config.h new file mode 100644 index 0000000000..bef48f17ea --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + + +#define PRODUCT Dactyl-Manuform (Ergodox) + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } diff --git a/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/config.h new file mode 100644 index 0000000000..29ab59ad66 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/config.h @@ -0,0 +1,27 @@ +/* +Copyright 2012 Jun Wako + +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 + + +#define USE_SERIAL + +#define MASTER_LEFT +// #define MASTER_RIGHT +//#define EE_HANDS +// Rows are doubled-up diff --git a/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c new file mode 100644 index 0000000000..8b83b538fe --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/keymaps/default/keymap.c @@ -0,0 +1,85 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _FN 1 +#define _NUMPAD 2 + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Some basic macros +#define TASK LCTL(LSFT(KC_ESC)) +#define TAB_R LCTL(KC_TAB) +#define TAB_L LCTL(LSFT(KC_TAB)) +#define TAB_RO LCTL(LSFT(KC_T)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_5x7( + // left hand + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, TAB_RO, + OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_CAPS, KC_LGUI, TAB_L, TAB_R, + TT(_FN), KC_SPC, + KC_END, KC_HOME, + KC_PSCR, TASK, + // right hand + KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_GRV, + KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + TG(_NUMPAD), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), + KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, + KC_BSPC, KC_ENT, + KC_PGUP, KC_PGDN, + KC_LCTL, KC_LALT), + +[_FN] = LAYOUT_5x7( + // left hand + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, RESET, + _______, _______, _______, _______, _______, _______, + KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, + _______, _______, + _______, _______, + _______, _______, + // right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + KC_DEL, _______, + _______, _______, + _______, _______), + +[_NUMPAD] = LAYOUT_5x7( + // left hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, + // right hand + _______, _______, KC_NLCK, _______, KC_PMNS, KC_PPLS, _______, + _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, + _______, _______, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, KC_P1, KC_P2, KC_P3, KC_PSLS, _______, + KC_P0, KC_PDOT, _______, _______, + _______, KC_PENT, + _______, _______, + _______, _______), + +}; diff --git a/keyboards/handwired/dactyl_manuform/5x7/rules.mk b/keyboards/handwired/dactyl_manuform/5x7/rules.mk new file mode 100644 index 0000000000..fc9cbcccd4 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/rules.mk @@ -0,0 +1,20 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h index 3222e6a617..8b60097bc2 100644 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h @@ -1,13 +1,13 @@ #pragma once - - #ifdef KEYBOARD_handwired_dactyl_manuform_6x6 #include "6x6.h" #elif KEYBOARD_handwired_dactyl_manuform_5x6 #include "5x6.h" #elif KEYBOARD_handwired_dactyl_manuform_4x5 #include "4x5.h" +#elif KEYBOARD_handwired_dactyl_manuform_5x7 + #include "5x7.h" #endif //void promicro_bootloader_jmp(bool program); diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md index 3f72bd6b21..00288a8768 100644 --- a/keyboards/handwired/dactyl_manuform/readme.md +++ b/keyboards/handwired/dactyl_manuform/readme.md @@ -1,11 +1,11 @@ -Dactyl Manuform (4x5, 5x6, 6x6) +Dactyl Manuform (4x5, 5x6, 5x7, 6x6) ====== the [Dactyl-Manuform](https://github.com/tshort/dactyl-keyboard) is a split curved keyboard based on the design of [adereth dactyl](https://github.com/adereth/dactyl-keyboard) and thumb cluster design of the [manuform](https://geekhack.org/index.php?topic=46015.0) keyboard, the hardware is similar to the let's split keyboard. all information needed for making one is in the first link. ![Imgur](https://i.imgur.com/7y0Vbyd.jpg) ## First Time Setup ------------------ + Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: Depending on your Layout chose one of the follwing commands: @@ -29,7 +29,7 @@ For more information on customizing keymaps, take a look at the primary document ## Keymaps ------------------ + ### [Keymaps 4x5](/keyboards/handwired/dactyl_manuform/4x5/keymaps/) #### Default @@ -44,13 +44,16 @@ Just a copy of the Impstyle keymap. Feel free to adjust it. #### Impstyle A simple QWERTY keymap with 3 Layers. Both sides are connected via serial and the Left ist the master. +### [Keymaps 5x7 aka almost Ergodox](/keyboards/handwired/dactyl_manuform/5x7/keymaps/) +#### Default +Keymap of Loligagger from geekhack. + ### [Keymaps 6x6](/keyboards/handwired/dactyl_manuform/6x6/keymaps/) #### Default Simple QWERTY layout with 3 Layers. -##Required Hardware ------------------ +## Required Hardware Apart from diodes and key switches for the keyboard matrix in each half, you will need: @@ -62,12 +65,10 @@ Alternatively, you can use any sort of cable and socket that has at least 3 wires. If you want to use I2C to communicate between halves, you will need a cable with at least 4 wires and 2x 4.7kΩ pull-up resistors -##Optional Hardware ------------------ +## Optional Hardware A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. -##Wiring ------- +## Wiring The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. PD0 on the ATmega32u4) between the two Pro Micros. @@ -89,19 +90,17 @@ unnecessary in simple use cases. You can change your configuration between serial and i2c by modifying your `config.h` file. -##Notes on Software Configuration -------------------------------- +## Notes on Software Configuration the keymaps in here are for the 4x5 layout of the keyboard only. -##Flashing -------- +## Flashing To flash your firmware take a look at: [Flashing Instructions and Bootloader Information](https://docs.qmk.fm/#/flashing) -##Choosing which board to plug the USB cable into (choosing Master) --------- +## Choosing which board to plug the USB cable into (choosing Master) + Because the two boards are identical, the firmware has logic to differentiate the left and right board. It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. @@ -111,15 +110,18 @@ The EEPROM approach requires additional setup (flashing the eeprom) but allows y The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. ### Setting the left hand as master + If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. ### Setting the right hand as master + If you always plug the usb cable into the right board, add an extra flag to your `config.h` ``` #define MASTER_RIGHT ``` ### Setting EE_hands to use either hands as master + If you define `EE_HANDS` in your `config.h`, you will need to set the EEPROM for the left and right halves. -- cgit v1.2.3 From 37d30552645dc1d1a2d8c0adba4c49b4a461c7ab Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Fri, 24 Aug 2018 17:53:03 +0200 Subject: Keyboard: Support PCBDOWN variants for Atreus keyboard (#3735) --- keyboards/atreus/readme.md | 2 ++ keyboards/atreus/rules.mk | 3 +++ 2 files changed, 5 insertions(+) diff --git a/keyboards/atreus/readme.md b/keyboards/atreus/readme.md index 6a86ff2e00..0756c186c4 100644 --- a/keyboards/atreus/readme.md +++ b/keyboards/atreus/readme.md @@ -16,4 +16,6 @@ Make example for this keyboard (after setting up your build environment): Unlike the TMK firmware, this command should be run from the root of the repository, not the directory containing this readme. +If your keyboard layout is a mirror image of what you expected (i.e. you do not get QWERTY on the left but YTREWQ on the right), then you have an A-Star powered Atreus (older than March 2016) with PCB labels facing *down* instead of up. Specify that by adding `PCBDOWN=yes` to your `make` commands. + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/atreus/rules.mk b/keyboards/atreus/rules.mk index 2c8418beb7..2488fd5e87 100644 --- a/keyboards/atreus/rules.mk +++ b/keyboards/atreus/rules.mk @@ -5,6 +5,9 @@ ifdef TEENSY2 ATREUS_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex else OPT_DEFS += -DATREUS_ASTAR +ifdef PCBDOWN + OPT_DEFS += -DPCBDOWN +endif ATREUS_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) endif -- cgit v1.2.3 From 067091d9c2711d2c8b8f5f888b05b378225ad868 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 24 Aug 2018 08:54:16 -0700 Subject: Introduce new 75_ansi standard layout (#3738) * introduce new layout 75_ansi * use the new 75_ansi layout for my octagon v2 --- keyboards/octagon/v2/keymaps/default/keymap.c | 14 ++--- keyboards/octagon/v2/rules.mk | 2 + keyboards/octagon/v2/v2.h | 16 +++++ layouts/community/75_ansi/layout.json | 6 ++ .../community/75_ansi/mechmerlin-75_ansi/keymap.c | 23 +++++++ .../community/75_ansi/mechmerlin-75_ansi/readme.md | 10 +++ layouts/community/75_ansi/readme.md | 72 ++++++++++++++++++++++ layouts/default/75_ansi/default_75_ansi/keymap.c | 12 ++++ layouts/default/75_ansi/layout.json | 6 ++ layouts/default/75_ansi/readme.md | 3 + 10 files changed, 157 insertions(+), 7 deletions(-) create mode 100644 layouts/community/75_ansi/layout.json create mode 100644 layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c create mode 100644 layouts/community/75_ansi/mechmerlin-75_ansi/readme.md create mode 100644 layouts/community/75_ansi/readme.md create mode 100644 layouts/default/75_ansi/default_75_ansi/keymap.c create mode 100644 layouts/default/75_ansi/layout.json create mode 100644 layouts/default/75_ansi/readme.md diff --git a/keyboards/octagon/v2/keymaps/default/keymap.c b/keyboards/octagon/v2/keymaps/default/keymap.c index 5f7d179abc..b3182fc239 100644 --- a/keyboards/octagon/v2/keymaps/default/keymap.c +++ b/keyboards/octagon/v2/keymaps/default/keymap.c @@ -13,24 +13,24 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "octagon.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* layer 0: qwerty */ - [0] = LAYOUT(\ + [0] = LAYOUT_75_ansi(\ 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_PAUS, KC_DEL, 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_HOME, 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_PGUP, - 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_NO, KC_ENT, KC_PGDN, - 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_END, + 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_PGDN, + KC_LSFT, 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_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - [1] = LAYOUT(\ + [1] = LAYOUT_75_ansi(\ KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; diff --git a/keyboards/octagon/v2/rules.mk b/keyboards/octagon/v2/rules.mk index d95dbd9603..37f3938d93 100644 --- a/keyboards/octagon/v2/rules.mk +++ b/keyboards/octagon/v2/rules.mk @@ -70,3 +70,5 @@ RGBLIGHT_ENABLE = yes CUSTOM_MATRIX = yes SRC += indicator_leds.c \ matrix.c + +LAYOUTS = 75_ansi diff --git a/keyboards/octagon/v2/v2.h b/keyboards/octagon/v2/v2.h index d37db4a0c7..29b03211ba 100644 --- a/keyboards/octagon/v2/v2.h +++ b/keyboards/octagon/v2/v2.h @@ -33,4 +33,20 @@ { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ } + +#define LAYOUT_75_ansi( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ + K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, K2P, KC_NO }, \ + { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ +} #endif diff --git a/layouts/community/75_ansi/layout.json b/layouts/community/75_ansi/layout.json new file mode 100644 index 0000000000..4b7c5a0d88 --- /dev/null +++ b/layouts/community/75_ansi/layout.json @@ -0,0 +1,6 @@ +[{a:7},"","","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] \ No newline at end of file diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c new file mode 100644 index 0000000000..70506da52a --- /dev/null +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c @@ -0,0 +1,23 @@ +#include QMK_KEYBOARD_H + +#define BASE 0 +#define FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[BASE] = LAYOUT_75_ansi(\ + 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_PAUS, KC_DEL, + 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_HOME, + 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_PGUP, + KC_LCTL, 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + +[FN] = LAYOUT_75_ansi(\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; \ No newline at end of file diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md b/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md new file mode 100644 index 0000000000..12c9502703 --- /dev/null +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/readme.md @@ -0,0 +1,10 @@ +# MechMerlin's Standard ANSI 75% Layout + +This is the 75% layout used by u/merlin36, host of the [MechMerlin](www.youtube.com/mechmerlin) +YouTube channel. + +It is used on his +[Duck Octagon V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/octagon/v2) + +### Build +To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-ansi`. diff --git a/layouts/community/75_ansi/readme.md b/layouts/community/75_ansi/readme.md new file mode 100644 index 0000000000..14d1a950c0 --- /dev/null +++ b/layouts/community/75_ansi/readme.md @@ -0,0 +1,72 @@ +# 75_ansi + +This is the standard 75% ANSI keyboard layout. + +One may argue that having 3 1u keys to the right of spacebar +is not desired as two 1.5u keys. However, most 75% boards that +come out have that as the standard. + +## Requirements + +### 1. Layout defined + +A keyboard's `.h` file needs to have `LAYOUT_75_ansi` defined + +```c +#define LAYOUT_75_ansi( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ + K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, K2P, KC_NO }, \ + { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ +} +) +``` + +This layout needs to match the layout defined in + + qmk_firmware/layouts/community/75_ansi/layout.json + +### 2. Configuring rules.mk + +`rules.mk` needs to have the following line: + + LAYOUTS = 75_ansi + +### 3. Defining a keymap + +A keymap must be defined at + + qmk_firmware/layouts/community/75_ansi/yourfoldername/keymap.c + +This keymap must have a `LAYOUT_75_ansi` layout defined. + +```c +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_75_ansi(\ + 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_PAUS, KC_DEL, + 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) + }; +``` + +## Usage + +To make generate a hex file, type + + make yourkeyboard:yourfoldername + +This hex file will contain a keymap with layout `LAYOUT_75_ansi` derived from + + qmk_firmware/layouts/community/75_ansi/yourfoldername/keymap.c diff --git a/layouts/default/75_ansi/default_75_ansi/keymap.c b/layouts/default/75_ansi/default_75_ansi/keymap.c new file mode 100644 index 0000000000..cba2f21c03 --- /dev/null +++ b/layouts/default/75_ansi/default_75_ansi/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_75_ansi(\ + 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_PAUS, KC_DEL, + 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) + }; \ No newline at end of file diff --git a/layouts/default/75_ansi/layout.json b/layouts/default/75_ansi/layout.json new file mode 100644 index 0000000000..72be23b486 --- /dev/null +++ b/layouts/default/75_ansi/layout.json @@ -0,0 +1,6 @@ +[{a:7},"","","","","","","","","","","","","","","",""], +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] diff --git a/layouts/default/75_ansi/readme.md b/layouts/default/75_ansi/readme.md new file mode 100644 index 0000000000..2ad7222721 --- /dev/null +++ b/layouts/default/75_ansi/readme.md @@ -0,0 +1,3 @@ +# 75_ansi + + LAYOUT_75_ansi \ No newline at end of file -- cgit v1.2.3 From 4de9ed7eb0fde3fba69a334c5ff6ee2fa6ec7f17 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 25 Aug 2018 17:45:42 +0200 Subject: Add a belgian keymap, partially based on keymap_french.h (#3737) --- quantum/keymap_extras/keymap_belgian.h | 117 +++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 quantum/keymap_extras/keymap_belgian.h diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h new file mode 100644 index 0000000000..764c561417 --- /dev/null +++ b/quantum/keymap_extras/keymap_belgian.h @@ -0,0 +1,117 @@ +/* Copyright 2015-2016 Jack Humbert + * + * 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 . + */ +#ifndef KEYMAP_BELGIAN_H +#define KEYMAP_BELGIAN_H + +#include "keymap.h" + +#define BE_LGUI KC_LALT +#define BE_LALT KC_LGUI + +// Alt gr +#ifndef ALGR +#define ALGR(kc) RALT(kc) +#endif +#define NO_ALGR KC_RALT + +// Normal characters +// Line 1 +#define BE_SUP2 KC_GRV +#define BE_AMP KC_1 +#define BE_EACU KC_2 +#define BE_QUOT KC_3 +#define BE_APOS KC_4 +#define BE_LPRN KC_5 +#define BE_PARA KC_6 +#define BE_EGRV KC_7 +#define BE_EXLM KC_8 +#define BE_CCED KC_9 +#define BE_AGRV KC_0 +#define BE_RPRN KC_MINS +#define BE_MINS KC_EQL + +// Line 2 +#define BE_A KC_Q +#define BE_Z KC_W +#define BE_CIRC KC_LBRC +#define BE_DLR KC_RBRC + +// Line 3 +#define BE_Q KC_A +#define BE_M KC_SCLN +#define BE_UGRV KC_QUOT +#define BE_MU KC_NUHS + +// Line 4 +#define BE_LESS KC_NUBS +#define BE_W KC_Z +#define BE_COMM KC_M +#define BE_SCLN KC_COMM +#define BE_COLN KC_DOT +#define BE_EQL KC_SLSH + +// Shifted characters +// Line 1 +#define BE_SUP3 KC_TILD +#define BE_1 LSFT(KC_1) +#define BE_2 LSFT(KC_2) +#define BE_3 LSFT(KC_3) +#define BE_4 LSFT(KC_4) +#define BE_5 LSFT(KC_5) +#define BE_6 LSFT(KC_6) +#define BE_7 LSFT(KC_7) +#define BE_8 LSFT(KC_8) +#define BE_9 LSFT(KC_9) +#define BE_0 LSFT(KC_0) +#define BE_OVRR KC_UNDS +#define BE_UNDS KC_PLUS + +// Line 2 +#define BE_UMLT LSFT(BE_CIRC) +#define BE_PND LSFT(BE_DLR) + +// Line 3 +#define BE_PERC LSFT(BE_UGRV) + +// Line 4 +#define BE_GRTR LSFT(BE_LESS) +#define BE_QUES LSFT(BE_COMM) +#define BE_DOT LSFT(BE_SCLN) +#define BE_SLSH LSFT(BE_COLN) +#define BE_PLUS LSFT(BE_EQL) + +// Alt Gr-ed characters +// Line 1 +#define BE_PIPE ALGR(KC_1) +#define BE_AT ALGR(KC_2) +#define BE_HASH ALGR(KC_3) +#define BE_LCBR ALGR(KC_9) +#define BE_RCBR ALGR(KC_0) + +// Line 2 +#define BE_EURO ALGR(KC_E) +#define BE_LSBR ALGR(BE_CIRC) +#define BE_RSBR ALGR(BE_DLR) + +// Line 3 +#define BE_ACUT ALGR(BE_UGRV) +#define BE_GRV ALGR(BE_MU) + +// Line 4 +#define BE_BSLS ALGR(BE_LESS) +#define BE_TILT ALGR(BE_EQL) + +#endif -- cgit v1.2.3 From b6d8524794305560e454d6b39a481d57f62f8ef1 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 25 Aug 2018 11:46:42 -0400 Subject: Keyboard: add Wavelet (#3739) * Add Wavelet keyboard * Fix build error for keyboards w/o Planck MIT layout * Add swap hands support --- keyboards/wavelet/config.h | 63 ++++++++ keyboards/wavelet/info.json | 17 ++ keyboards/wavelet/keymaps/default/keymap.c | 212 +++++++++++++++++++++++++ keyboards/wavelet/keymaps/default/rules.mk | 2 + keyboards/wavelet/readme.md | 20 +++ keyboards/wavelet/rules.mk | 30 ++++ keyboards/wavelet/wavelet.c | 29 ++++ keyboards/wavelet/wavelet.h | 37 +++++ layouts/community/ortho_4x12/guidoism/config.h | 15 ++ 9 files changed, 425 insertions(+) create mode 100644 keyboards/wavelet/config.h create mode 100644 keyboards/wavelet/info.json create mode 100644 keyboards/wavelet/keymaps/default/keymap.c create mode 100644 keyboards/wavelet/keymaps/default/rules.mk create mode 100644 keyboards/wavelet/readme.md create mode 100644 keyboards/wavelet/rules.mk create mode 100644 keyboards/wavelet/wavelet.c create mode 100644 keyboards/wavelet/wavelet.h diff --git a/keyboards/wavelet/config.h b/keyboards/wavelet/config.h new file mode 100644 index 0000000000..4e45ef8e19 --- /dev/null +++ b/keyboards/wavelet/config.h @@ -0,0 +1,63 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1046 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Keebio +#define PRODUCT Wavelet +#define DESCRIPTION 40 percent ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { F4, F5, F7, B3, D2, D1, D4, D7 } +#define MATRIX_COL_PINS { F6, B1, B2, B6, B4, E6 } + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs + +/* Backlight LEDs */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 7 + +#endif diff --git a/keyboards/wavelet/info.json b/keyboards/wavelet/info.json new file mode 100644 index 0000000000..a71058b95a --- /dev/null +++ b/keyboards/wavelet/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "Wavelet", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3} + ] + } + } +} diff --git a/keyboards/wavelet/keymaps/default/keymap.c b/keyboards/wavelet/keymaps/default/keymap.c new file mode 100644 index 0000000000..dac8068a42 --- /dev/null +++ b/keyboards/wavelet/keymaps/default/keymap.c @@ -0,0 +1,212 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/wavelet/keymaps/default/rules.mk b/keyboards/wavelet/keymaps/default/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/wavelet/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/wavelet/readme.md b/keyboards/wavelet/readme.md new file mode 100644 index 0000000000..bacd57037d --- /dev/null +++ b/keyboards/wavelet/readme.md @@ -0,0 +1,20 @@ +Wavelet +======= + +A 4x12 ortholinear keyboard using Kailh Choc Low-Profile switches made and sold by [Keebio](https://keeb.io). + +Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make wavelet:default + +Example of flashing this keyboard: + + make wavelet:default:avrdude + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) diff --git a/keyboards/wavelet/rules.mk b/keyboards/wavelet/rules.mk new file mode 100644 index 0000000000..86149c5622 --- /dev/null +++ b/keyboards/wavelet/rules.mk @@ -0,0 +1,30 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x12 diff --git a/keyboards/wavelet/wavelet.c b/keyboards/wavelet/wavelet.c new file mode 100644 index 0000000000..2bc9c65a52 --- /dev/null +++ b/keyboards/wavelet/wavelet.c @@ -0,0 +1,29 @@ +#include "wavelet.h" + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + + {{5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{5, 5}, {4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{5, 6}, {4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{5, 7}, {4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, +}; +#endif diff --git a/keyboards/wavelet/wavelet.h b/keyboards/wavelet/wavelet.h new file mode 100644 index 0000000000..69a87a70cd --- /dev/null +++ b/keyboards/wavelet/wavelet.h @@ -0,0 +1,37 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 } \ + } + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + +#define LAYOUT_ortho_4x12 LAYOUT +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc diff --git a/layouts/community/ortho_4x12/guidoism/config.h b/layouts/community/ortho_4x12/guidoism/config.h index 6075393277..19b71b07ee 100644 --- a/layouts/community/ortho_4x12/guidoism/config.h +++ b/layouts/community/ortho_4x12/guidoism/config.h @@ -26,4 +26,19 @@ along with this program. If not, see . #define IGNORE_MOD_TAP_INTERRUPT #define USB_MAX_POWER_CONSUMPTION 50 +#ifndef LAYOUT_planck_mit +#define LAYOUT_planck_mit( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ + LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b \ + ) +#endif + #endif -- cgit v1.2.3 From 80edd8a9d8d11327204ae37032caec22e55a0c37 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 25 Aug 2018 08:47:54 -0700 Subject: Keymap: Hold for MO and Tap for TG (#3742) Special thanks to Drashna for teaching me how to implement myFNX command. This allows a user to hold Fn for regular Fn and tap to toggle another layer. For now this will stay within my community layout as this is the only layout that I will be using this in. This may change in the future. --- layouts/community/60_ansi/mechmerlin-ansi/keymap.c | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c index fca8a97cdd..47316915ca 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c @@ -4,20 +4,24 @@ #define FN 1 #define ARROWS 2 +enum keycodes { + KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [BASE] = LAYOUT_60_ansi( KC_GESC, 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_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_BSLASH, \ KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), [FN] = LAYOUT_60_ansi( KC_GRV, 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_DEL, \ RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, TG(2), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [ARROWS] = LAYOUT_60_ansi( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -27,3 +31,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t fnx_layer_timer; + + switch (keycode){ + case KC_FNX: + if(record->event.pressed){ + fnx_layer_timer = timer_read(); + layer_on(FN); + } else { + layer_off(FN); + if (timer_elapsed(fnx_layer_timer) < 150) { + layer_invert(ARROWS); + } + } + return false; + } + return true; +} \ No newline at end of file -- cgit v1.2.3 From 34d01f0a7f9056cc6a50755f8a439c30cc9f746e Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 25 Aug 2018 09:00:06 -0700 Subject: Keyboard: introduce new default layout 68_ansi (#3745) --- layouts/default/68_ansi/default_68_ansi/keymap.c | 11 +++++++++++ layouts/default/68_ansi/layout.json | 5 +++++ layouts/default/68_ansi/readme.md | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 layouts/default/68_ansi/default_68_ansi/keymap.c create mode 100644 layouts/default/68_ansi/layout.json create mode 100644 layouts/default/68_ansi/readme.md diff --git a/layouts/default/68_ansi/default_68_ansi/keymap.c b/layouts/default/68_ansi/default_68_ansi/keymap.c new file mode 100644 index 0000000000..59b0ea47d0 --- /dev/null +++ b/layouts/default/68_ansi/default_68_ansi/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_68_ansi(\ + 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) + }; \ No newline at end of file diff --git a/layouts/default/68_ansi/layout.json b/layouts/default/68_ansi/layout.json new file mode 100644 index 0000000000..0fa92b0f2e --- /dev/null +++ b/layouts/default/68_ansi/layout.json @@ -0,0 +1,5 @@ +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] diff --git a/layouts/default/68_ansi/readme.md b/layouts/default/68_ansi/readme.md new file mode 100644 index 0000000000..eab8f312b2 --- /dev/null +++ b/layouts/default/68_ansi/readme.md @@ -0,0 +1,3 @@ +# 68_ansi + + LAYOUT_68_ansi \ No newline at end of file -- cgit v1.2.3 From a9b6ebcd89a239aba1d5e4e755568dbe9f663e5e Mon Sep 17 00:00:00 2001 From: Budi Dharmawan <29maret@gmail.com> Date: Sun, 26 Aug 2018 00:04:40 +0800 Subject: Keymap: update to budi's tv44 (#3587) * update to budi's tv44 * update august - budi's tv44 --- keyboards/tv44/keymaps/budi/keymap.c | 167 ++++++++++++++++++++-------------- keyboards/tv44/keymaps/budi/readme.md | 11 ++- 2 files changed, 110 insertions(+), 68 deletions(-) diff --git a/keyboards/tv44/keymaps/budi/keymap.c b/keyboards/tv44/keymaps/budi/keymap.c index 53c281acd2..baa266e635 100644 --- a/keyboards/tv44/keymaps/budi/keymap.c +++ b/keyboards/tv44/keymaps/budi/keymap.c @@ -1,7 +1,4 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "timer.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -12,17 +9,14 @@ extern keymap_config_t keymap_config; #define _DV 0 #define _NM 1 #define _NV 2 -#define _G1 3 -#define _G2 4 -#define _FN 5 +#define _MN 3 +#define _FN 4 // Requires KC_TRNS/_______ for the trigger key in the destination layer #define NM_SP LT(_NM, KC_SPC) #define NV_SP LT(_NV, KC_SPC) - -// Custom macros -#define LC_ESC LCTL_T(KC_ESC) // Tap for Esc, Hold for L-CTRL -#define RC_ENT RCTL_T(KC_ENT) // Tap for Enter, Hold for R-CTRL +#define MN_EN LT(_MN, KC_ENT) +#define FN_EX LT(_FN, KC_ESC) // Curly braces have their own keys. These are defined to make them not mess up // the grid in layer 2. @@ -41,10 +35,61 @@ extern keymap_config_t keymap_config; #define HYP8 HYPR(KC_8) #define HYP9 HYPR(KC_9) +// MEH +#define MEH0 MEH(KC_0) +#define MEH1 MEH(KC_1) +#define MEH2 MEH(KC_2) +#define MEH3 MEH(KC_3) +#define MEH4 MEH(KC_4) +#define MEH5 MEH(KC_5) +#define MEH6 MEH(KC_6) +#define MEH7 MEH(KC_7) +#define MEH8 MEH(KC_8) +#define MEH9 MEH(KC_9) + +// CAG +#define CAG0 LCAG(KC_0) +#define CAG1 LCAG(KC_1) +#define CAG2 LCAG(KC_2) +#define CAG3 LCAG(KC_3) +#define CAG4 LCAG(KC_4) +#define CAG5 LCAG(KC_5) +#define CAG6 LCAG(KC_6) +#define CAG7 LCAG(KC_7) +#define CAG8 LCAG(KC_8) +#define CAG9 LCAG(KC_9) + +// ALTS +#define ALT0 LALT(KC_0) +#define ALT1 LALT(KC_1) +#define ALT2 LALT(KC_2) +#define ALT3 LALT(KC_3) +#define ALT4 LALT(KC_4) +#define ALT5 LALT(KC_5) +#define ALT6 LALT(KC_6) +#define ALT7 LALT(KC_7) +#define ALT8 LALT(KC_8) +#define ALT9 LALT(KC_9) +#define ALTX LALT(KC_GRV) +#define ALTL LALT(KC_LEFT) +#define ALTR LALT(KC_RIGHT) +#define ALTESC LALT(KC_ESC) +#define ALTEQL LALT(KC_EQL) +#define ALTMIN LALT(KC_MINS) + +// BACK AND FORWARD +#define XBACK LGUI(LALT(KC_LEFT)) +#define XFFWD LGUI(LALT(KC_RIGHT)) + // Fillers to make layering more clear #define _______ KC_TRNS #define xxxxxxx KC_NO +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + SWTCH +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -52,18 +97,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,---------+------+------+------+------+------+------+------+------+------+------+------------. * | TAB | ' | , | . | P | Y | F | G | C | R | L | BACKSPACE | * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | A | O | E | U | I | D | H | T | N | S | ENTER | + * | LCTL | A | O | E | U | I | D | H | T | N | S | MN/ENTER | * |----------`------`------`------`------`------`------`------`------`------`------`-----------| * | LSHFT | ; | Q | J | K | X | B | M | W | V | Z | RSHFT | * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | MO FN | GUI | ALT | NM / SPACE | NV / SPACE | RALT | / | \ | ESC | + * | FN EX | GUI | ALT | NM / SPACE | NV / SPACE | RALT | - | = | ESC | * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' */ [_DV] = LAYOUT_arrow( KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MN_EN, KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - MO(_FN), KC_LGUI, KC_LALT, NM_SP, NV_SP, KC_RALT, KC_SLSH, KC_BSLS, KC_ESC + FN_EX, KC_LGUI, KC_LALT, NM_SP, NV_SP, KC_RALT, KC_MINS, KC_EQL, KC_ESC ), @@ -72,27 +117,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,---------+------+------+------+------+------+------+------+------+------+------+------------. * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DELETE | * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | ! | @ | [ | { | ( | ) | } | ] | ? | | | ENTER | + * | LCTL | ! | @ | [ | { | ( | ) | } | ] | | | ? | ENTER | * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | = | + | + * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | = | + * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | / | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | | GUI | LALT |-----TRNS-----| SPACE | RALT | - | = | \ | * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | | GUI | LALT |-----TRNS-----| SPACE | RALT | / | \ | - | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' */ [_NM] = LAYOUT_arrow( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - _______, KC_EXLM, KC_AT, KC_LBRC, L_CURB, KC_LPRN, KC_RPRN, R_CURB, KC_RBRC, KC_QUES, KC_PIPE, _______, - _______, KC_GRV, KC_TILD, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_EQL, KC_PLUS, - _______, _______, _______, _______, _______, _______, KC_SLSH, KC_BSLS, KC_MINS + _______, KC_EXLM, KC_AT, KC_LBRC, L_CURB, KC_LPRN, KC_RPRN, R_CURB, KC_RBRC, KC_PIPE, KC_QUES, _______, + _______, KC_GRV, KC_TILD, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, KC_SLSH, + _______, _______, _______, _______, KC_SPC, _______, KC_MINS, KC_EQL, KC_BSLS ), /* NAVIGATION * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ESC | MWU | MWL | MU | MWR | | | HOME | UP | END | PGUP | DELETE | + * | ESC | MWU | MWL | MU | MWR | MPRV | MNXT | HOME | UP | END | PGUP | DELETE | * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | MWD | ML | MD | MR | | | LEFT | DOWN | RIGHT| PGDN | MB2 | + * | LCTL | MWD | ML | MD | MR | MRWD | MFFD | LEFT | DOWN | RIGHT| PGDN | MB2 | * |----------`------`------`------`------`------`------`------`------`------`------`-----------| * | LSFT | HYP1 | HYP2 | HYP3 | HYP4 | HYP5 | HYP6 | HYP7 | HYP8 | HYP9 | HYP0 | VOLUP | * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| @@ -100,50 +146,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' */ [_NV] = LAYOUT_arrow( - KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, xxxxxxx, xxxxxxx, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL, - _______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, xxxxxxx, xxxxxxx, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BTN2, + KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_MPRV, KC_MNXT, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL, + _______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_MRWD, KC_MFFD, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BTN2, _______, HYP1, HYP2, HYP3, HYP4, HYP5, HYP6, HYP7, HYP8, HYP9, HYP0, KC_VOLU, _______, _______, _______, KC_BTN1, _______, KC_MUTE, KC_MPLY, KC_MSTP, KC_VOLD ), -/* GAME 1 - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | TAB | ' | , | . | P | Y | F | G | C | R | L | BACKSPACE | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | A | O | E | U | I | D | H | T | N | S | ENTER | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | ; | Q | J | K | X | B | M | W | V | Z | RSFT | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | - | = | LALT | MO G2 | SPACE | RALT | | | MO FN | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ - [_G1] = LAYOUT_arrow( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - _______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, - _______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_MINS, KC_EQL, _______, MO(_G2), KC_SPC, KC_RALT, xxxxxxx, xxxxxxx, MO(_FN) - ), - - - -/* GAME 2 +/* MODIFIED NUMBERS * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | F1 | F2 | F3 | F4 | F5 | DELETE | + * | ALTESC | CAG1 | CAG2 | CAG3 | CAG4 | CAG5 | CAG6 | CAG7 | CAG8 | CAG9 | CAG0 | SWTCH | * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | 6 | 7 | 8 | 9 | 0 | F6 | F7 | F8 | F9 | F10 | ENTER | + * | ALT ` | ALT1 | ALT2 | ALT3 | ALT4 | ALT5 | ALT6 | ALT7 | ALT8 | ALT9 | ALT0 |----TRNS---| * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | ` | / | [ | ] | \ | F11 | F12 | F13 | F14 | F15 | RSFT | + * | ALT = | MEH1 | MEH2 | MEH3 | MEH4 | MEH5 | MEH6 | MEH7 | MEH8 | MEH9 | MEH0 | | * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | MB 3 | MB 4 | LALT |----TRNS------| SPACE | MB5 | | | MO FN | + * | ALT - | | XBACK | ALT LEFT | ALT RIGHT | XFFWD | | | | * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' */ - [_G2] = LAYOUT_arrow( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_DEL, - _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, KC_GRV, KC_SLSH, KC_LBRC, KC_RBRC, KC_BSLS, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, - KC_BTN3, KC_BTN4, _______, _______, _______, KC_BTN5, xxxxxxx, xxxxxxx, _______ + [_MN] = LAYOUT_arrow( + ALTESC, CAG1, CAG2, CAG3, CAG4, CAG5, CAG6, CAG7, CAG8, CAG9, CAG0, SWTCH, + ALTX, ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7, ALT8, ALT9, ALT0, _______, + ALTEQL, MEH1, MEH2, MEH3, MEH4, MEH5, MEH6, MEH7, MEH8, MEH9, MEH0, xxxxxxx, + ALTMIN, xxxxxxx, XBACK, ALTL, ALTR, XFFWD, xxxxxxx, xxxxxxx, xxxxxxx ), @@ -154,21 +180,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |---------`------`------`------`------`------`------`------`------`------`------`------------| * | LCTL | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | _DV | _G1 | | | | | | | | | | + * | LSFT | | | | | | | | | | | | * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * |---TRNS---| CAPS | LALT | | | RALT | | RESET |--TRNS-| + * |---TRNS---| CAPS | LALT | | SWTCH | RALT | | RESET |--TRNS-| * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' */ [_FN] = LAYOUT_arrow( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, xxxxxxx, - _______, TO(_DV), TO(_G1), xxxxxxx, xxxxxxx, xxxxxxx, KC_PWR, KC_SLEP, KC_WAKE, xxxxxxx, xxxxxxx, xxxxxxx, - _______, KC_CAPS, _______, xxxxxxx, xxxxxxx, KC_RALT, xxxxxxx, RESET, _______ + _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC_PWR, KC_SLEP, KC_WAKE, xxxxxxx, xxxxxxx, xxxxxxx, + _______, KC_CAPS, _______, xxxxxxx, SWTCH, KC_RALT, xxxxxxx, RESET, _______ ) -/* Transparent +/* Transparent placeholder for more layers * ,---------+------+------+------+------+------+------+------+------+------+------+------------. * | | | | | | | | | | | | | * |---------`------`------`------`------`------`------`------`------`------`------`------------| @@ -185,12 +211,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, // _______, _______, _______, _______, _______, _______, _______, _______, _______ // ) - - - }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case SWTCH: + SEND_STRING(SS_DOWN(X_LGUI)); + SEND_STRING(SS_DOWN(X_LSHIFT)); + SEND_STRING(SS_TAP(X_ENTER)); + SEND_STRING(SS_UP(X_LSHIFT)); + SEND_STRING(SS_UP(X_LGUI)); + return false; + } + } + return true; } diff --git a/keyboards/tv44/keymaps/budi/readme.md b/keyboards/tv44/keymaps/budi/readme.md index d1ee7d8927..e5de86ef81 100644 --- a/keyboards/tv44/keymaps/budi/readme.md +++ b/keyboards/tv44/keymaps/budi/readme.md @@ -1,8 +1,17 @@ # Budi's TV44 Arrow layout - Dvorak main layer -- Somewhat easy bracket access for devs, vim-friendly :) +- Somewhat easy bracket access for easy devs, happy :) - Dedicated gaming layers cuz u don't wanna mess with apm - Mainly for windows, but with translated alt/cmd on os, it's good to go ASCII graphics shamelessly stolen from tong92's layout :) + +Updates August 2018: +- Escape both ways +- Only include QMK_KEYBOARD_H + +Updates July 2018: +- I guess I don't play games that much anymore +- SUGDW modifiers +- Somehow LALT(LSFT(KC_RET)) does not register correctly on my mac -- cgit v1.2.3 From 028a4feeedd5763e12eb037dd51155bb670b9921 Mon Sep 17 00:00:00 2001 From: Barry Huang Date: Sun, 26 Aug 2018 00:26:24 +0800 Subject: Keyboard: readme.md update (#3581) for correct site link --- keyboards/playkbtw/ca66/readme.md | 2 +- keyboards/playkbtw/pk60/readme.md | 2 +- keyboards/playkbtw/readme.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/playkbtw/ca66/readme.md b/keyboards/playkbtw/ca66/readme.md index 74f0606043..9e1ff7397e 100644 --- a/keyboards/playkbtw/ca66/readme.md +++ b/keyboards/playkbtw/ca66/readme.md @@ -5,7 +5,7 @@ Custom 65% Keyboard Maintainer: QMK Community Hardware Supported: CA66 -Hardware Availability: [Play Keyboard](http://playkeyboard.qdm.com.tw/) +Hardware Availability: [Play Keyboard](http://play-keyboard.store/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/playkbtw/pk60/readme.md b/keyboards/playkbtw/pk60/readme.md index 8b14d4021b..f4be12dd45 100644 --- a/keyboards/playkbtw/pk60/readme.md +++ b/keyboards/playkbtw/pk60/readme.md @@ -8,7 +8,7 @@ Fitted with all stock GH60 cases, with WS2812 RGB underglow. Keyboard Maintainer: [Barry Huang](https://github.com/yj7272098) Hardware Supported: Play Keyboard60 -Hardware Availability: [Play Keyboard](http://playkeyboard.qdm.com.tw/) +Hardware Availability: [Play Keyboard](http://play-keyboard.store/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/playkbtw/readme.md b/keyboards/playkbtw/readme.md index adb1ca8c87..4dd58188e2 100644 --- a/keyboards/playkbtw/readme.md +++ b/keyboards/playkbtw/readme.md @@ -1,5 +1,5 @@ # PlayKeyboardTW -[PlayKeyboardTW]((http://playkeyboard.qdm.com.tw/)) is a Taiwan based company responsible for keyboards such as the CA66 and the PK60. +[PlayKeyboardTW]((http://play-keyboard.store/)) is a Taiwan based company responsible for keyboards such as the CA66 and the PK60. This directory is a collection of all their keyboards. -- cgit v1.2.3 From 7e8c0a368b983a3eb7b47531f1ce461cfabcb2f8 Mon Sep 17 00:00:00 2001 From: Salt-Peanuts Date: Sat, 25 Aug 2018 12:29:43 -0400 Subject: Keymap: Added my keymap for Rorschach keyboard; minor updates to my Kinesis files. (#3734) * Added keymap for Rorschach * Rorschach update * Minor updates to Kinesis files * Minor fixes * Minor fixes for Rorschach --- .../kinesis/keymaps/insertsnideremarks/config.h | 1 + .../kinesis/keymaps/insertsnideremarks/keymap.c | 77 ++--- .../kinesis/keymaps/insertsnideremarks/readme.md | 8 +- .../rorschach/keymaps/insertsnideremarks/config.h | 24 ++ .../rorschach/keymaps/insertsnideremarks/keymap.c | 330 +++++++++++++++++++++ .../rorschach/keymaps/insertsnideremarks/rules.mk | 21 ++ 6 files changed, 419 insertions(+), 42 deletions(-) create mode 100644 keyboards/rorschach/keymaps/insertsnideremarks/config.h create mode 100644 keyboards/rorschach/keymaps/insertsnideremarks/keymap.c create mode 100644 keyboards/rorschach/keymaps/insertsnideremarks/rules.mk diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/config.h b/keyboards/kinesis/keymaps/insertsnideremarks/config.h index 02eed310a1..3548fa3486 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/config.h +++ b/keyboards/kinesis/keymaps/insertsnideremarks/config.h @@ -6,6 +6,7 @@ // place overrides here #define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT #define TAPPING_TERM 175 #define TAPPING_TOGGLE 2 diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c index bac5ea3ff2..bf75327f1b 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c +++ b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c @@ -5,15 +5,15 @@ extern keymap_config_t keymap_config; enum kinesis_layers { _COLEMAK, // Colemak (default layer) _QWERTY, // Qwerty + _COLEMAKGM, // Colemak gaming/vanilla (limited dual-role keys with layer access) + _QWERTYGM, // QWERTY gaming/vanilla (limited dual-role keys with layer access) _NUMBERS, // Numbers & Symbols _NUMBERS2, // Numbers & Symbols 2 (identical as _NUMBERS; basically used for tri-layer access to _ADJUST) _FUNCTION, // Function _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) _NUMPAD, // Numpad - _COLEMAKGM, // Colemak gaming/vanilla (no dual-role keys with layer access) - _QWERTYGM, // QWERTY gaming/vanilla (no dual-role keys with layer access) - _ADJUST, // Adjust layer, accessed via tri-layer feature) - _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) + _ADJUST, // Adjust layer (accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer (accessed outside of tri-layer feature) }; enum kinesis_keycodes { @@ -64,7 +64,7 @@ void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { } qk_tap_dance_action_t tap_dance_actions[] = { -[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer [LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap [RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap [EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap @@ -104,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Space | Enter |App/Alt| | RGUI | Delete| Bspc | * | / | / |-------| |-------| / | / | * | Fn | Number| Bspc | | Enter |Number2| Fn2 | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_COLEMAK] = LAYOUT( // Left Hand @@ -150,7 +150,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Space | Enter |App/Alt| | RGUI | Delete| Bspc | * | / | / |-------| |-------| / | / | * | Fn | Number| Bspc | | Enter |Number2| Fn2 | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_QWERTY] = LAYOUT( // Left Hand @@ -160,7 +160,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_INS, KC_GRV, KC_LBRC, KC_RBRC, - //Left Thumb + //Left Thumb CTLESC, ALL_T(KC_NO), ALTAPP, SPCFN, ENTNS, KC_BSPC, @@ -197,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * | | |-------| |-------| | | * | | | | | | | | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_NUMBERS] = LAYOUT( // Left Hand @@ -214,10 +214,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Right Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - _______, _______, _______, _______, + _______, _______, _______, _______, // Right Thumb _______, _______, _______, @@ -239,10 +239,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Right Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - _______, _______, _______, _______, + _______, _______, _______, _______, // Right Thumb _______, _______, _______, @@ -267,13 +267,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * | | |-------| |-------| | | * | | | | | | | | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_FUNCTION] = LAYOUT( // Left Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, _______, _______, KC_UP, _______, _______, + _______, _______, _______, KC_UP, _______, _______, _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, @@ -281,7 +281,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, - // Right Hand + // Right Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, @@ -298,7 +298,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, _______, _______, KC_UP, _______, _______, + _______, _______, _______, KC_UP, _______, _______, _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, _______, _______, _______, _______, @@ -306,7 +306,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, - // Right Hand + // Right Hand _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, @@ -338,7 +338,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * | | |-------| |-------| | | * | | | | | KP Ent| | | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_NUMPAD] = LAYOUT( // Left Hand @@ -366,7 +366,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* Colemak gaming/vanilla -* (No access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) +* (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) * ,-------------------------------------------. ,-------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| @@ -383,8 +383,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-------|-------|-------| |-------+-------+-------. * | | | LAlt | | RGUI | | | * | Space | Enter |-------| |-------| Delete| Bspc | -* | | | Bspc | | Enter | | | -* `-----------------------' `-----------------------' +* | | |Bspc/FN| | Ent/NS| | | +* `-----------------------' `-----------------------' */ [_COLEMAKGM] = LAYOUT( // Left Hand @@ -397,7 +397,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //Left Thumb CTLESC, TD(ADJ), KC_LALT, - KC_SPC, KC_ENT, KC_BSPC, + KC_SPC, KC_ENT, BSPCFN, //Right Hand KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, @@ -408,11 +408,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //Right Thumb KC_RALT, KC_RCTL, KC_RGUI, - KC_ENT, KC_DEL, KC_BSPC + ENTNS, KC_DEL, KC_BSPC ), /* QWERTY gaming/vanilla -* (No access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) +* (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) * ,-------------------------------------------. ,-------------------------------------------. * | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+------| |------+------+------+------+------+--------| @@ -429,8 +429,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-------|-------|-------| |-------+-------+-------. * | | | LAlt | | RGUI | | | * | Space | Enter |-------| |-------| Delete| Bspc | -* | | | Bspc | | Enter | | | -* `-----------------------' `-----------------------' +* | | |Bspc/FN| | Ent/NS| | | +* `-----------------------' `-----------------------' */ [_QWERTYGM] = LAYOUT( // Left Hand @@ -443,7 +443,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //Left Thumb CTLESC, TD(ADJ), KC_LALT, - KC_SPC, KC_ENT, KC_BSPC, + KC_SPC, KC_ENT, BSPCFN, //Right Hand KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, @@ -454,7 +454,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //Right Thumb KC_RALT, KC_RCTL, KC_RGUI, - KC_ENT, KC_DEL, KC_BSPC + ENTNS, KC_DEL, KC_BSPC ), /* Adjust layer @@ -476,7 +476,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * | | |-------| |-------| | | * | | | | | | | | -* `-----------------------' `-----------------------' +* `-----------------------' `-----------------------' */ [_ADJUST] = LAYOUT( // Left Hand @@ -496,7 +496,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, + _______, _______, _______, _______, // Right Thumb _______, _______, _______, @@ -521,7 +521,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, + _______, _______, _______, _______, // Right Thumb _______, _______, _______, @@ -541,9 +541,10 @@ void persistent_default_layer_set(uint16_t default_layer) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case COLEMAK: + case COLEMAK: if (record->event.pressed) { - persistent_default_layer_set(1UL << _COLEMAK); + default_layer_set(1UL << _COLEMAK); +// persistent_default_layer_set(1UL << _COLEMAK); layer_off ( _QWERTY); layer_off ( _NUMBERS); layer_off ( _NUMBERS2); @@ -559,7 +560,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case QWERTY: if (record->event.pressed) { - persistent_default_layer_set(1UL << _QWERTY); + default_layer_set(1UL << _QWERTY); +// persistent_default_layer_set(1UL << _QWERTY); layer_off ( _COLEMAK); layer_off ( _NUMBERS); layer_off ( _NUMBERS2); @@ -570,7 +572,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off ( _QWERTYGM); layer_off ( _ADJUST); layer_off ( _ADJUST2); - } return false; break; diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md index 353fca0775..f774ef444a 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md +++ b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md @@ -150,7 +150,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ### Colemak gaming/vanilla - (No access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -170,12 +170,12 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ,-------|-------|-------| |-------+-------+-------. | | | LAlt | | RGUI | | | | Space | Enter |-------| |-------| Delete| Bspc | - | | | Bspc | | Tab | | | + | | |Bspc/FN| | Ent/NS| | | `-----------------------' `-----------------------' ### QWERTY gaming/vanilla - (No access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -195,7 +195,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ,-------|-------|-------| |-------+-------+-------. | | | LAlt | | RGUI | | | | Space | Enter |-------| |-------| Delete| Bspc | - | | | Bspc | | Tab | | | + | | |Bspc/FN| | Ent/NS| | | `-----------------------' `-----------------------' ### Adjust layer diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/config.h b/keyboards/rorschach/keymaps/insertsnideremarks/config.h new file mode 100644 index 0000000000..90fb5120df --- /dev/null +++ b/keyboards/rorschach/keymaps/insertsnideremarks/config.h @@ -0,0 +1,24 @@ +#pragma once + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define PREVENT_STUCK_MODIFIERS +#define IGNORE_MOD_TAP_INTERRUPT +#define TAPPING_TERM 175 +#define TAPPING_TOGGLE 2 + +// #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/rorschach/keymaps/insertsnideremarks/keymap.c b/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c new file mode 100644 index 0000000000..5f4c26415d --- /dev/null +++ b/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c @@ -0,0 +1,330 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum rorschach_layers { + _COLEMAK, // Colemak (default layer) + _QWERTY, // Qwerty + _NUMBERS, // Numbers & Symbols + _NUMBERS2, // Numbers & Function Keys (similar to _NUMBERS; used with _NUMBERS for tri-layer access to _ADJUST) + _FUNCTION, // Function + _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) + _NUMPAD, // Numpad +// _COLEMAKGM, // Colemak gaming/vanilla (no dual-role keys with layer access) +// _QWERTYGM, // QWERTY gaming/vanilla (no dual-role keys with layer access) + _ADJUST, // Adjust layer, accessed via tri-layer feature) + _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) +}; + +enum rorschach_keycodes { + COLEMAK = SAFE_RANGE, + QWERTY, +// COLEMAKGM, +// QWERTYGM, + NUMPAD = TG(_NUMPAD), + ADJUST = MO(_ADJUST2), + SPCFN = LT(_FUNCTION, KC_SPC), + BSPCFN = LT(_FUNCTION2, KC_BSPC), + ENTNS = LT(_NUMBERS, KC_ENT), + DELNS = LT(_NUMBERS2, KC_DEL), + CTLESC = CTL_T(KC_ESC), + ALTAPP = ALT_T(KC_APP), + NKROTG = MAGIC_TOGGLE_NKRO, +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +//Tap Dance Declarations +enum { + ADJ = 0, + LBCB, + RBCB, + EQPL, + PLEQ, + MNUN, + SLAS, + GVTL, + PPLEQ, + PMNUN, + PSLPAS +}; + +void dance_LAYER_finished(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_on(_ADJUST2); + set_oneshot_layer(_ADJUST2, ONESHOT_START); + } +} +void dance_LAYER_reset(qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 2) { + layer_off(_ADJUST2); + clear_oneshot_layer_state(ONESHOT_PRESSED); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { +[ADJ] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, dance_LAYER_finished, dance_LAYER_reset), // Double-tap to activate Adjust layer via oneshot layer +[LBCB] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LCBR), // Left bracket on a single-tap, left brace on a double-tap +[RBCB] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RCBR), // Right bracket on a single-tap, right brace on a double-tap +[EQPL] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), // Plus sign on a single-tap, equal sign on a double-tap +[PLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PLUS, KC_EQL), // Equal sign on a single-tap, plus sign on a double-tap +[MNUN] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), // Minus sign on a single-tap, underscore on a double-tap +[SLAS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_ASTR), // Slash in a single-tap, asterisk in a double-tap +[GVTL] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), // Grave on a single-tap, tilde on a double-tap +[PPLEQ] = ACTION_TAP_DANCE_DOUBLE(KC_PPLS, KC_EQL), // Numpad plus sign on a single-tap, equal sign on a double-tap +[PMNUN] = ACTION_TAP_DANCE_DOUBLE(KC_PMNS, KC_UNDS), // Numpad minus sign on a single-tap, underscore on a double-tap +[PSLPAS] = ACTION_TAP_DANCE_DOUBLE(KC_PSLS, KC_PAST) // Numpad slash on a single-tap, numpad asterisk on a double-tap +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Colemak +* (Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* |Esc/Ctl| A | R | S | T | D | | H | N | E | I | O | ' | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | SC Sft| Z | X | C | V | B | | K | M | , | . | / | SC Sft| +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | Ent/NS| Bspc | | Enter |Del/NS2| +* `---------------' `---------------' +*/ +[_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* QWERTY +* (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* |Esc/Ctl| A | S | D | F | G | | H | J | K | L | ; | ' | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | SC Sft| Z | X | C | V | B | | N | M | , | . | / | SC Sft| +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | Ins | ` | [ | ] |App/Alt| Spc/FN| |Bsp/Fn2| RGUI | Left | Down | Up | Right | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | Ent/NS| Bspc | | Enter |Del/NS2| +* `---------------' `---------------' +*/ +[_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, ALTAPP, SPCFN, BSPCFN, KC_RGUI, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + ENTNS, KC_BSPC, KC_ENT, DELNS +), + +/* Number/symbol layer +* (Multiple characters: single-tap for first, double-tap for second) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_NUMBERS] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* Number/Function Key layer +* (Multiple characters: single-tap for first, double-tap for second) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | 6 | 7 | 8 | 9 | 0 | | F7 | F8 | F9 | F10 | F11 | F12 | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | 1 | 2 | 3 | 4 | 5 | | F1 | F2 | F3 | F4 | F5 | F6 | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_NUMBERS2] = LAYOUT( + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +/* Function layer +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | | | Up | | | | | | Up | Ctrl+Y| | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | Ctrl+A| Left | Down | Right |C+A+Tab| | PgUp | Right | Down | Left | Home | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | Ctrl+Z| Ctrl+X| Ctrl+C| Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | | | | | | | | | | Prev | Play | Next | Stop | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_FUNCTION] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +[_FUNCTION2] = LAYOUT( + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______ +), + +/* Numpad layer +* (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | NumLk | KP 7 | KP 8 | KP 9 | KP / | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | Tab | KP 4 | KP 5 | KP 6 | KP * | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | NumLk | KP . |KP/ KP*| KP- _ | KP+ = | | | KP 1 | KP 2 | KP 3 | KP - | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | ( | ) | [ { | ] } | | | | | KP 0 | = | KP . | KP + | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | KP Ent| | +* `---------------' `---------------' +*/ +[_NUMPAD] = LAYOUT( + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PSLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_TAB, KC_P4, KC_P5, KC_P6, KC_PAST, _______, + _______, KC_NLCK, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, KC_P0, KC_EQL, KC_PDOT, KC_PPLS, _______, + _______, _______, KC_PENT, _______ +), + +/* Adjust layer +* (Enter/Number + Delete/Number2 to access; Numpad is a toggle) +* ,-----------------------------------------------. ,-----------------------------------------------. +* | |Colemak| Qwerty| | | | | Numpad| | | Ctrl+Y| | RESET | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | | | | | | |NKROTog| | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------| +* | | | | | | | | | | | | | | +* |-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------' +* | | | | | | | | | | | | | | +* `---------------------------------------+-------+-------. ,-------+-------+---------------------------------------' +* | | | | | | +* `---------------' `---------------' +*/ +[_ADJUST] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +), + +[_ADJUST2] = LAYOUT( + _______, COLEMAK, QWERTY, _______, _______, _______, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _NUMBERS, _NUMBERS2, _ADJUST); +} + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL << _COLEMAK); + layer_off ( _QWERTY); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); +// layer_off ( _COLEMAKGM); +// layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL << _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); +// layer_off ( _COLEMAKGM); +// layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; +/* case COLEMAKGM: + if (record->event.pressed) { + default_layer_set(1UL << _COLEMAKGM); + layer_off ( _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _QWERTYGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; + case QWERTYGM: + if (record->event.pressed) { + default_layer_set(1UL << _QWERTYGM); + layer_off ( _QWERTY); + layer_off ( _COLEMAK); + layer_off ( _NUMBERS); + layer_off ( _NUMBERS2); + layer_off ( _FUNCTION); + layer_off ( _FUNCTION2); + layer_off ( _NUMPAD); + layer_off ( _COLEMAKGM); + layer_off ( _ADJUST); + layer_off ( _ADJUST2); + } + return false; + break; +*/ + } + return true; +} \ No newline at end of file diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk b/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk new file mode 100644 index 0000000000..6beaae7aee --- /dev/null +++ b/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # 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 +TAP_DANCE_ENABLE = yes # Enable Tap Dancing function + + -- cgit v1.2.3 From 26dacd51fce49d83b2dff0cda45126c327e743fa Mon Sep 17 00:00:00 2001 From: Njiall Date: Sat, 25 Aug 2018 19:35:24 +0200 Subject: Keyboard: Added gamepad layout to cospad (#3714) --- keyboards/cospad/cospad.h | 36 ++- keyboards/cospad/keymaps/detrus/keymap.c | 369 +++++++++++++++++++++++++++++++ 2 files changed, 403 insertions(+), 2 deletions(-) create mode 100644 keyboards/cospad/keymaps/detrus/keymap.c diff --git a/keyboards/cospad/cospad.h b/keyboards/cospad/cospad.h index 36c7f3367a..df42b0df1e 100644 --- a/keyboards/cospad/cospad.h +++ b/keyboards/cospad/cospad.h @@ -22,6 +22,21 @@ * `-------------------' */ +/* COSPAD gamepad matrix layout + * ,-------------------. + * | 00 | 01 | 02 | 03 | + * |----|----|----|----| + * | 10 | 11 | 12 | 13 | + * |----|----|----|----| + * | 20 | 21 | 22 | | + * |----|----|----| 23 | + * | 30 | 31 | 32 | | + * |----|----|----|----| + * | 40 | 41 | 42 | 43 | + * |----|----|----|----| + * | 50 | 51 | 52 | 53 | + * `-------------------' + */ /* COSPAD numpad matrix layout * ,-------------------. @@ -41,7 +56,7 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT_ortho_6x4( \ - k00, k01, k02, k03, \ + k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, k23, \ k30, k31, k32, k33, \ @@ -57,8 +72,25 @@ {k50, k51, k52, k53} \ } +#define LAYOUT_gamepad_6x4( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k23, \ + k40, k41, k42, k43, \ + k50, k51, k52, k53 \ +) \ +{ \ + {k00, k01, k02, k03}, \ + {k10, k11, k12, k13}, \ + {k20, k21, k22, k23}, \ + {k30, k31, k32, KC_NO}, \ + {k40, k41, k42, k43}, \ + {k50, k51, k52, k53} \ +} + #define LAYOUT_numpad_6x4( \ - k00, k01, k02, k03, \ + k00, k01, k02, k03, \ k10, k11, k12, k13, \ k20, k21, k22, \ k30, k31, k32, k23, \ diff --git a/keyboards/cospad/keymaps/detrus/keymap.c b/keyboards/cospad/keymaps/detrus/keymap.c new file mode 100644 index 0000000000..f9eddc2a87 --- /dev/null +++ b/keyboards/cospad/keymaps/detrus/keymap.c @@ -0,0 +1,369 @@ +#include QMK_KEYBOARD_H +#include "led.h" +#include + +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +#define _______ KC_TRNS + +// Each layer gets a name for readability, which is then used in the keymap matrix below. +enum cospad_layers { + _QWERTY_LAYER, + _QWERTZ_LAYER, + _COLEMA_LAYER, + _DVORAK_LAYER, + _QWERTY_LOWER_LAYER, + _QWERTZ_LOWER_LAYER, + _COLEMA_LOWER_LAYER, + _DVORAK_LOWER_LAYER, + _RAISE_LAYER, + _ALTER_LAYER, +}; + +// To switch the default layer used for the layout, there are special keycodes. +// Which onces detected below serve to switch it. +enum cospad_keycodes { + QWERTY = SAFE_RANGE, + QWERTZ, + COLEMAK, + DVORAK +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap _QWERTY_LAYER: Default layer + * ,-----------------------. + * | T | G | B | Alt | + * |-----|-----|-----|-----| + * | R | F | V | LOW | + * |-----|-----|-----|-----| + * | E | D | C | | + * |-----|-----|-----| Spc | + * | W | S | X | | + * |-----|-----|-----|-----| + * | Q | A | Z | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + * + * And it's LOWER layer + * ,-----------------------. + * | P | ; | / | Alt | + * |-----|-----|-----|-----| + * | O | L | . | LOW | + * |-----|-----|-----|-----| + * | I | K | , | | + * |-----|-----|-----| Ent | + * | U | J | M | | + * |-----|-----|-----|-----| + * | Y | H | N | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + */ + [_QWERTY_LAYER] = LAYOUT_gamepad_6x4( + KC_T, KC_G, KC_B, KC_LALT, \ + KC_R, KC_F, KC_V, MO(_QWERTY_LOWER_LAYER),\ + KC_E, KC_D, KC_C, \ + KC_W, KC_S, KC_X, KC_SPACE, \ + KC_Q, KC_A, KC_Z, MO(_RAISE_LAYER),\ + KC_GESC, KC_TAB, KC_LSFT, KC_LCTRL), + [_QWERTY_LOWER_LAYER] = LAYOUT_gamepad_6x4( + KC_P, KC_SCLN, KC_SLSH, KC_LALT, \ + KC_O, KC_L, KC_DOT, _______, \ + KC_I, KC_K, KC_COMM, \ + KC_U, KC_J, KC_M, KC_ENTER, \ + KC_Y, KC_H, KC_N, _______, \ + _______, _______, _______, _______), + + + + /* Keymap _QWERTZ_LAYER: Alternate default layer + * ,-----------------------. + * | T | G | B | Alt | + * |-----|-----|-----|-----| + * | R | F | V | LOW | + * |-----|-----|-----|-----| + * | E | D | C | | + * |-----|-----|-----| Spc | + * | W | S | X | | + * |-----|-----|-----|-----| + * | Q | A | Y | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + * + * And it's LOWER layer + * ,-----------------------. + * | P | ; | / | Alt | + * |-----|-----|-----|-----| + * | O | L | > | LOW | + * |-----|-----|-----|-----| + * | I | K | < | | + * |-----|-----|-----| Ent | + * | U | J | M | | + * |-----|-----|-----|-----| + * | Z | H | N | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + */ + [_QWERTZ_LAYER] = LAYOUT_gamepad_6x4( + KC_T, KC_G, KC_B, KC_LALT, \ + KC_R, KC_F, KC_V, MO(_QWERTZ_LOWER_LAYER),\ + KC_E, KC_D, KC_C, \ + KC_W, KC_S, KC_X, KC_SPACE, \ + KC_Q, KC_A, KC_Y, MO(_RAISE_LAYER),\ + KC_GESC, KC_TAB, KC_LSFT, KC_LCTRL), + [_QWERTZ_LOWER_LAYER] = LAYOUT_gamepad_6x4( + KC_P, KC_SCLN, KC_SLSH, KC_LALT, \ + KC_O, KC_L, KC_DOT, _______, \ + KC_I, KC_K, KC_COMM, \ + KC_U, KC_J, KC_M, KC_ENTER, \ + KC_Z, KC_H, KC_N, _______, \ + _______, _______, _______, _______), + + + + /* Keymap _COLEMA_LAYER: Alternate default layer + * ,-----------------------. + * | G | D | B | Alt | + * |-----|-----|-----|-----| + * | P | T | V | LOW | + * |-----|-----|-----|-----| + * | F | S | C | | + * |-----|-----|-----| Spc | + * | W | R | X | | + * |-----|-----|-----|-----| + * | Q | A | Z | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + * + * And it's LOWER layer + * ,-----------------------. + * | ; | O | / | Alt | + * |-----|-----|-----|-----| + * | Y | I | . | LOW | + * |-----|-----|-----|-----| + * | U | E | , | | + * |-----|-----|-----| Ent | + * | L | N | M | | + * |-----|-----|-----|-----| + * | J | H | K | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + */ + [_COLEMA_LAYER] = LAYOUT_gamepad_6x4( + KC_T, KC_D, KC_B, KC_LALT, \ + KC_R, KC_T, KC_V, MO(_COLEMA_LOWER_LAYER),\ + KC_E, KC_S, KC_C, \ + KC_W, KC_R, KC_X, KC_SPACE, \ + KC_Q, KC_A, KC_Z, MO(_RAISE_LAYER),\ + KC_GESC, KC_TAB, KC_LSFT, KC_LCTRL), + [_COLEMA_LOWER_LAYER] = LAYOUT_gamepad_6x4( + KC_SCLN, KC_O, KC_SLSH, _______, \ + KC_Y, KC_I, KC_DOT, _______, \ + KC_U, KC_E, KC_COMM, \ + KC_L, KC_N, KC_M, KC_ENTER, \ + KC_J, KC_H, KC_K, _______, \ + KC_F, KC_G, _______, _______), + + + + /* Keymap _DVORAK_LAYER: Alternate default layer + * ,-----------------------. + * | Y | I | X | Alt | + * |-----|-----|-----|-----| + * | P | U | K | LOW | + * |-----|-----|-----|-----| + * | . | E | J | | + * |-----|-----|-----| Spc | + * | , | O | Q | | + * |-----|-----|-----|-----| + * | ' | A | ; | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + * + * And it's LOWER layer + * ,-----------------------. + * | L | S | Z | Alt | + * |-----|-----|-----|-----| + * | R | N | V | LOW | + * |-----|-----|-----|-----| + * | C | T | W | | + * |-----|-----|-----| Ent | + * | G | H | M | | + * |-----|-----|-----|-----| + * | F | D | B | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + */ + [_DVORAK_LAYER] = LAYOUT_gamepad_6x4( + KC_Y, KC_I, KC_X, KC_LALT, \ + KC_P, KC_U, KC_K, MO(_DVORAK_LOWER_LAYER),\ + KC_DOT, KC_E, KC_J, \ + KC_COMM, KC_O, KC_A, KC_SPACE, \ + KC_QUOT, KC_A, KC_SCLN, MO(_RAISE_LAYER),\ + KC_GESC, KC_TAB, KC_LSFT, KC_LCTRL), + [_DVORAK_LOWER_LAYER] = LAYOUT_gamepad_6x4( + KC_L, KC_S, KC_Z, KC_LALT, \ + KC_R, KC_N, KC_V, _______, \ + KC_C, KC_T, KC_W, \ + KC_G, KC_H, KC_M, KC_ENTER,\ + KC_F, KC_D, KC_B, _______, \ + _______, _______, _______, _______), + + + + /* Keymap _RAISE_LAYER: Additional layer to access more + * ,-----------------------. + * | 5 | 0 | del | Alt | + * |-----|-----|-----|-----| + * | 4 | 9 | -> | LOW | + * |-----|-----|-----|-----| + * | 3 | 8 | <- | | + * |-----|-----|-----| Spc | + * | 2 | 7 | -> | | + * |-----|-----|-----|-----| + * | 1 | 6 | <- | RAI | + * |-----|-----|-----|-----| + * | Esc | Tab | Sft | Ctl | + * `-----------------------' + */ + [_RAISE_LAYER] = LAYOUT_gamepad_6x4( + KC_5, KC_0, KC_BSPC, _______, \ + KC_4, KC_9, KC_RIGHT, _______, \ + KC_3, KC_8, KC_UP, \ + KC_2, KC_7, KC_DOWN, _______, \ + KC_1, KC_6, KC_LEFT, _______, \ + _______, _______, _______, _______), + + + + /* Keymap _ALTER_LAYER: Function layer used to control the Leds + * and use media buttons + * ,----------------------------------------. + * | Val Dec | Bl Toggle | Qwertz | Super | + * |---------|------------|---------|-------| + * | Val Inc | Bl Off | Qwerty | | + * |---------|------------|---------|-------| + * | Sat Dec | Bl On | Colemak | | + * |---------|------------|---------| | + * | Sat Inc | RGB Toggle | Dvorak | | + * |---------|------------|---------|-------| + * | Hue Dec | RGB Next | Vol Dwn | | + * |---------|------------|---------|-------| + * | Hue Inc | RGB Prev | Vol Up | Reset | + * `----------------------------------------' + */ + [_ALTER_LAYER] = LAYOUT_gamepad_6x4( + RGB_VAD, BL_TOGG, QWERTZ, KC_LGUI, \ + RGB_VAI, BL_OFF, QWERTY, _______, \ + RGB_SAD, BL_ON, COLEMAK, \ + RGB_SAI, RGB_TOG, DVORAK, _______, \ + RGB_HUD, RGB_MOD, KC_VOLD, _______, \ + RGB_HUI, RGB_RMOD, KC_VOLU, RESET), +}; + +// Makes sure to update the good tri-layer if a layer changes +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(default_layer_state)) { + case _QWERTY_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTY_LOWER_LAYER, _ALTER_LAYER); + break; + case _QWERTZ_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTZ_LOWER_LAYER, _ALTER_LAYER); + break; + case _COLEMA_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _COLEMA_LOWER_LAYER, _ALTER_LAYER); + break; + case _DVORAK_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _DVORAK_LOWER_LAYER, _ALTER_LAYER); + break; + } + return state; +} + +// Makes the tri-layer +uint32_t default_layer_state_set_kb(uint32_t state) { + switch (biton32(state)) { + case _QWERTY_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTZ_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _COLEMA_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _DVORAK_LOWER_LAYER, _ALTER_LAYER); + layer_move(_QWERTY_LAYER); + break; + case _QWERTZ_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTY_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _COLEMA_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _DVORAK_LOWER_LAYER, _ALTER_LAYER); + layer_move(_QWERTZ_LAYER); + break; + case _COLEMA_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTY_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTZ_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _DVORAK_LOWER_LAYER, _ALTER_LAYER); + layer_move(_COLEMA_LAYER); + break; + case _DVORAK_LAYER: + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTY_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _QWERTZ_LOWER_LAYER, _ALTER_LAYER); + state = update_tri_layer_state(state, _RAISE_LAYER, _COLEMA_LOWER_LAYER, _ALTER_LAYER); + layer_move(_DVORAK_LAYER); + break; + } + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BL_TOGG: + if (record->event.pressed) { + cospad_bl_led_togg(); + } + return false; + case BL_ON: + if (record->event.pressed) { + cospad_bl_led_on(); + } + return false; + case BL_OFF: + if (record->event.pressed) { + cospad_bl_led_off(); + } + return false; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY_LAYER); + print("switched to QWERTY layout\n"); + } + return false; + break; + case QWERTZ: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTZ_LAYER); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMA_LAYER); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK_LAYER); + } + return false; + break; + default: + return true; + } +} -- cgit v1.2.3 From b806cc9eea5d3ac46d071bbb06e055ef8e7c4cfb Mon Sep 17 00:00:00 2001 From: Alvin C Date: Sun, 26 Aug 2018 04:16:05 +0900 Subject: Keyboard: add tokyo60 (#2861) * adding tokyo60 to qmk * updating readme * updating keymap and power consumption for mobile --- keyboards/tokyo60/config.h | 66 ++++++++++++++++++++++++++ keyboards/tokyo60/keymaps/default/config.h | 1 + keyboards/tokyo60/keymaps/default/keymap.c | 56 ++++++++++++++++++++++ keyboards/tokyo60/readme.md | 15 ++++++ keyboards/tokyo60/rules.mk | 75 ++++++++++++++++++++++++++++++ keyboards/tokyo60/tokyo60.c | 19 ++++++++ keyboards/tokyo60/tokyo60.h | 21 +++++++++ 7 files changed, 253 insertions(+) create mode 100644 keyboards/tokyo60/config.h create mode 100644 keyboards/tokyo60/keymaps/default/config.h create mode 100644 keyboards/tokyo60/keymaps/default/keymap.c create mode 100644 keyboards/tokyo60/readme.md create mode 100644 keyboards/tokyo60/rules.mk create mode 100644 keyboards/tokyo60/tokyo60.c create mode 100644 keyboards/tokyo60/tokyo60.h diff --git a/keyboards/tokyo60/config.h b/keyboards/tokyo60/config.h new file mode 100644 index 0000000000..6e6ab2215d --- /dev/null +++ b/keyboards/tokyo60/config.h @@ -0,0 +1,66 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Tokyo Keyboard +#define PRODUCT tokyo60 +#define DESCRIPTION q.m.k. keyboard firmware for tokyo60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 6 +//#define BACKLIGHT_ON_STATE 1 +#endif + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* Set power consumption to work with mobile devices */ +#define USB_MAX_POWER_CONSUMPTION 100 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B6, D4, B1, B2, B5, B4, D7, D6, B3 } +#define UNUSED_PINS + +/* 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 + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN F7 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 12 +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_VAL_STEP 12 +#endif + +/* For Production */ +#define QMK_ESC_OUTPUT F0 // usually COL +#define QMK_ESC_INPUT D0 // usually ROW + +#endif diff --git a/keyboards/tokyo60/keymaps/default/config.h b/keyboards/tokyo60/keymaps/default/config.h new file mode 100644 index 0000000000..a5568e400d --- /dev/null +++ b/keyboards/tokyo60/keymaps/default/config.h @@ -0,0 +1 @@ +#include "../../config.h" diff --git a/keyboards/tokyo60/keymaps/default/keymap.c b/keyboards/tokyo60/keymaps/default/keymap.c new file mode 100644 index 0000000000..64b49a7465 --- /dev/null +++ b/keyboards/tokyo60/keymaps/default/keymap.c @@ -0,0 +1,56 @@ +#include "tokyo60.h" + +/* + * Default HHKB Layout + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Default layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │█████│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Shift│█████│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │█████│Shift│ Fn │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│█████│ Gui │ Alt │█████│█████│Space│█████│█████│█████│█████│█████│ Alt │ Gui │█████│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + TOKYO_KEYMAP( + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, \ + KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT ), + /* 1: HHKB Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Pwr │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ RGB │RGBfw│RGBrv│BLtog│BLstp│ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ VoD │ VoU │ Mut │ Ejc │ │NP_* │NP_/ │Home │PgUp │Left │Right│█████│NPEnt│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │█████│ │ │ │ │ │NP_+ │NP_- │ End │PgDwn│Down │█████│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│█████│ │ │█████│█████│█████│ │█████│█████│█████│█████│ │ │█████│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ + TOKYO_KEYMAP( + KC_PWR, 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_INS, KC_DEL, \ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), +}; + +/*5 + * Fn action definition + */ +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), +}; + +void matrix_scan_user(void) { + +}; diff --git a/keyboards/tokyo60/readme.md b/keyboards/tokyo60/readme.md new file mode 100644 index 0000000000..811d0707c8 --- /dev/null +++ b/keyboards/tokyo60/readme.md @@ -0,0 +1,15 @@ +# tokyo60 +​ +![tokyo60](http://tokyokeyboard.com/wp-content/uploads/2018/02/AI7B4543_copy_page_20180215141449-1200x800.jpg) +​ +Minimal hacker style mechanical keyboard designed in Tokyo. Full aluminum hi-pro construction with integrated top-plate. Cherry MX compatible. [More Info at Tokyo Keyboard](http://tokyokeyboard.com). +​ +Keyboard Maintainer: [tokyo keyboard](http://tokyokeyboard.com) +Hardware Supported: tokyo60 rev1 +Hardware Availability: [tokyo keyboard](http://tokyokeyboard.com), [Massdrop](https://www.massdrop.com/buy/massdrop-x-tokyo-keyboard-tokyo60-keyboard-kit?mode=guest_open) +​ +Make example for this keyboard (after setting up your build environment): +​ + make tokyo60:default +​ +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/tokyo60/rules.mk b/keyboards/tokyo60/rules.mk new file mode 100644 index 0000000000..7f8cfc0a83 --- /dev/null +++ b/keyboards/tokyo60/rules.mk @@ -0,0 +1,75 @@ + + +# MCU name +#MCU = at90usb1287 +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# 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 +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes # Enable RGB light diff --git a/keyboards/tokyo60/tokyo60.c b/keyboards/tokyo60/tokyo60.c new file mode 100644 index 0000000000..d3b6279df4 --- /dev/null +++ b/keyboards/tokyo60/tokyo60.c @@ -0,0 +1,19 @@ +#include "tokyo60.h" +//#include "led.h" + +void matrix_init_kb(void) { + // Keyboard start-up code goes here + // Runs once when the firmware starts up + matrix_init_user(); + led_init_ports(); +}; + +void matrix_scan_kb(void) { + // Looping keyboard code goes here + // This runs every cycle (a lot) + matrix_scan_user(); +}; + +void led_init_ports(void) { + /* LEDs on */ +} diff --git a/keyboards/tokyo60/tokyo60.h b/keyboards/tokyo60/tokyo60.h new file mode 100644 index 0000000000..e3cfa711ba --- /dev/null +++ b/keyboards/tokyo60/tokyo60.h @@ -0,0 +1,21 @@ +#ifndef TOKYO60_H +#define TOKYO60_H + +#include "quantum.h" + +/* tokyo60 Keymap*/ +#define TOKYO_KEYMAP( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D,\ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K3D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K4D, \ + K42, K43, K46, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { KC_NO, K42, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D } \ +} + +#endif -- cgit v1.2.3 From 1e7d08d2e3b621dd27bb2b709191b3f42488c9d8 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 25 Aug 2018 13:00:09 -0700 Subject: Keyboard: Tokyo60 Cleanup: QMK Configurator support (#3749) * use LAYOUT_60_hhkb * cleanups * more minute clean ups * fix some capitilization issues * add configurator support --- keyboards/tokyo60/info.json | 12 ++++++++++++ keyboards/tokyo60/keymaps/default/config.h | 4 +++- keyboards/tokyo60/keymaps/default/keymap.c | 19 ++++++------------- keyboards/tokyo60/readme.md | 6 +++--- keyboards/tokyo60/rules.mk | 2 ++ keyboards/tokyo60/tokyo60.c | 1 - keyboards/tokyo60/tokyo60.h | 3 +-- 7 files changed, 27 insertions(+), 20 deletions(-) create mode 100644 keyboards/tokyo60/info.json diff --git a/keyboards/tokyo60/info.json b/keyboards/tokyo60/info.json new file mode 100644 index 0000000000..9431a0c077 --- /dev/null +++ b/keyboards/tokyo60/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Tokyo60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/tokyo60/keymaps/default/config.h b/keyboards/tokyo60/keymaps/default/config.h index a5568e400d..271f48d001 100644 --- a/keyboards/tokyo60/keymaps/default/config.h +++ b/keyboards/tokyo60/keymaps/default/config.h @@ -1 +1,3 @@ -#include "../../config.h" +#pragma once + +// place overrides here diff --git a/keyboards/tokyo60/keymaps/default/keymap.c b/keyboards/tokyo60/keymaps/default/keymap.c index 64b49a7465..97380784ce 100644 --- a/keyboards/tokyo60/keymaps/default/keymap.c +++ b/keyboards/tokyo60/keymaps/default/keymap.c @@ -1,5 +1,7 @@ -#include "tokyo60.h" +#include QMK_KEYBOARD_H +#define BL 0 +#define FN 1 /* * Default HHKB Layout */ @@ -17,11 +19,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │█████│ Gui │ Alt │█████│█████│Space│█████│█████│█████│█████│█████│ Alt │ Gui │█████│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - TOKYO_KEYMAP( +[BL] = LAYOUT_60_hhkb( KC_ESC, 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_BSLS, KC_GRV, \ 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_BSPC, \ KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_FN0, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \ KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT ), /* 1: HHKB Fn layer ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ @@ -36,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { │█████│ │ │█████│█████│█████│ │█████│█████│█████│█████│ │ │█████│█████│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ */ - TOKYO_KEYMAP( +[FN]= LAYOUT_60_hhkb( KC_PWR, 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_INS, KC_DEL, \ KC_CAPS, RGB_TOG, RGB_MOD, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ @@ -44,13 +46,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; -/*5 - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; -void matrix_scan_user(void) { - -}; diff --git a/keyboards/tokyo60/readme.md b/keyboards/tokyo60/readme.md index 811d0707c8..3f6b3b76b3 100644 --- a/keyboards/tokyo60/readme.md +++ b/keyboards/tokyo60/readme.md @@ -2,11 +2,11 @@ ​ ![tokyo60](http://tokyokeyboard.com/wp-content/uploads/2018/02/AI7B4543_copy_page_20180215141449-1200x800.jpg) ​ -Minimal hacker style mechanical keyboard designed in Tokyo. Full aluminum hi-pro construction with integrated top-plate. Cherry MX compatible. [More Info at Tokyo Keyboard](http://tokyokeyboard.com). +Minimal hacker style mechanical keyboard designed in Tokyo. Full aluminum hi-pro construction with integrated top-plate. Cherry MX compatible. More Info at [Tokyo Keyboard](http://tokyokeyboard.com). ​ -Keyboard Maintainer: [tokyo keyboard](http://tokyokeyboard.com) +Keyboard Maintainer: [Tokyo Keyboard](http://tokyokeyboard.com) Hardware Supported: tokyo60 rev1 -Hardware Availability: [tokyo keyboard](http://tokyokeyboard.com), [Massdrop](https://www.massdrop.com/buy/massdrop-x-tokyo-keyboard-tokyo60-keyboard-kit?mode=guest_open) +Hardware Availability: [Tokyo Keyboard](http://tokyokeyboard.com), [Massdrop](https://www.massdrop.com/buy/massdrop-x-tokyo-keyboard-tokyo60-keyboard-kit?mode=guest_open) ​ Make example for this keyboard (after setting up your build environment): ​ diff --git a/keyboards/tokyo60/rules.mk b/keyboards/tokyo60/rules.mk index 7f8cfc0a83..45f0013c16 100644 --- a/keyboards/tokyo60/rules.mk +++ b/keyboards/tokyo60/rules.mk @@ -73,3 +73,5 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality RGBLIGHT_ENABLE = yes # Enable RGB light + +LAYOUTS = 60_hhkb diff --git a/keyboards/tokyo60/tokyo60.c b/keyboards/tokyo60/tokyo60.c index d3b6279df4..2126bb612d 100644 --- a/keyboards/tokyo60/tokyo60.c +++ b/keyboards/tokyo60/tokyo60.c @@ -1,5 +1,4 @@ #include "tokyo60.h" -//#include "led.h" void matrix_init_kb(void) { // Keyboard start-up code goes here diff --git a/keyboards/tokyo60/tokyo60.h b/keyboards/tokyo60/tokyo60.h index e3cfa711ba..53f5d24a80 100644 --- a/keyboards/tokyo60/tokyo60.h +++ b/keyboards/tokyo60/tokyo60.h @@ -3,8 +3,7 @@ #include "quantum.h" -/* tokyo60 Keymap*/ -#define TOKYO_KEYMAP( \ +#define LAYOUT_60_hhkb( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D,\ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2D, \ K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K3D, \ -- cgit v1.2.3 From 0e17a44b46a6f3512774900705dd04d1ffcbfb15 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 25 Aug 2018 13:20:18 -0700 Subject: Keyboard: Change the default LAYOUT to LAYOUT_60_hhkb for tokyo60 (#3751) --- keyboards/tokyo60/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/tokyo60/info.json b/keyboards/tokyo60/info.json index 9431a0c077..b0e13c0537 100644 --- a/keyboards/tokyo60/info.json +++ b/keyboards/tokyo60/info.json @@ -5,7 +5,7 @@ "width": 15, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_60_hhkb": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] } } -- cgit v1.2.3 From f6bd5d793ac3ac311fd59fb7230fac29e734108e Mon Sep 17 00:00:00 2001 From: Luciano Malavasi Date: Sat, 25 Aug 2018 17:11:53 -0700 Subject: Keymap: PyroL Let's Split keymap + Alpha keymap modifications (#3753) * keymap + alpha * some fixes * keymap + alpha * some fixes * drashna changes * linked main Alpha repo in keyboards/alpha readme * missed a spot * there's another function called FUNC lol * keymap + alpha * some fixes * keymap + alpha * drashna changes --- keyboards/alpha/keymaps/default/keymap.c | 85 ++++------- keyboards/alpha/readme.md | 4 +- keyboards/lets_split/keymaps/pyrol/config.h | 28 ++++ keyboards/lets_split/keymaps/pyrol/keymap.c | 218 ++++++++++++++++++++++++++++ keyboards/lets_split/keymaps/pyrol/rules.mk | 1 + 5 files changed, 279 insertions(+), 57 deletions(-) create mode 100644 keyboards/lets_split/keymaps/pyrol/config.h create mode 100644 keyboards/lets_split/keymaps/pyrol/keymap.c create mode 100644 keyboards/lets_split/keymaps/pyrol/rules.mk diff --git a/keyboards/alpha/keymaps/default/keymap.c b/keyboards/alpha/keymaps/default/keymap.c index 03c47452d3..e8d04b8e7e 100755 --- a/keyboards/alpha/keymaps/default/keymap.c +++ b/keyboards/alpha/keymaps/default/keymap.c @@ -1,32 +1,18 @@ #include QMK_KEYBOARD_H -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(1), - KC_Z, KC_X, KC_C, KC_V, MT(MOD_LSFT, KC_SPC), KC_B, KC_N, KC_M), - - LAYOUT( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_BSPC, KC_ESC, KC_TAB, KC_SCLN, KC_QUOT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(2), - KC_LCTL, KC_LGUI, KC_LALT, TO(0), MT(MOD_LSFT, KC_ENT), KC_COMM, KC_DOT, KC_SLSH), - - LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, - KC_LSFT, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, TO(3), - RGB_VAI, RGB_VAD, RGB_HUI, TO(0), RGB_MOD, KC_MPLY, KC_VOLD, KC_VOLU), - LAYOUT( - RESET, 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, M(0), KC_NO, KC_NO, KC_NO), +#define HOME 0 +#define MODS 1 +#define MODS2 2 +#define OTHER 3 +enum custom_keycodes { + MACRO1 }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { switch (keycode) { - case 0: + case MACRO1: SEND_STRING("I'm so sorry... -PyroL"); return false; } @@ -34,43 +20,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [HOME] = LAYOUT( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TO(1), + KC_Z, KC_X, KC_C, KC_V, MT(MOD_LSFT, KC_SPC), KC_B, KC_N, KC_M), - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } + [MODS] = LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_BSPC, KC_ESC, KC_TAB, KC_SCLN, KC_QUOT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, TO(2), + KC_LCTL, KC_LGUI, KC_LALT, TO(0), MT(MOD_LSFT, KC_ENT), KC_COMM, KC_DOT, KC_SLSH), - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } + [MODS2] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + KC_LSFT, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_GRV, TO(3), + RGB_VAI, RGB_VAD, RGB_HUI, TO(0), RGB_MOD, KC_MPLY, KC_VOLD, KC_VOLU), - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } + [OTHER] = LAYOUT( + RESET, 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, TO(0), MACRO1, KC_NO, KC_NO, KC_NO), +}; - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } +void matrix_init_user(void) { +} +void matrix_scan_user(void) { } diff --git a/keyboards/alpha/readme.md b/keyboards/alpha/readme.md index 3a733d3658..4b5c7fc804 100644 --- a/keyboards/alpha/readme.md +++ b/keyboards/alpha/readme.md @@ -14,4 +14,6 @@ Make example for Alpha (after setting up your build environment): make alpha:default -See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/faq/build-compile-qmk) for more information. \ No newline at end of file +See [build environment setup](https://docs.qmk.fm/install-build-tools) then the [make instructions](https://docs.qmk.fm/faq/build-compile-qmk) for more information. + +Please see [PyrooL/Alpha](https://www.github.com/PyrooL/Alpha) for **build instructions**, parts lists, Gerbers, and case files. diff --git a/keyboards/lets_split/keymaps/pyrol/config.h b/keyboards/lets_split/keymaps/pyrol/config.h new file mode 100644 index 0000000000..f3502585d4 --- /dev/null +++ b/keyboards/lets_split/keymaps/pyrol/config.h @@ -0,0 +1,28 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#define USE_SERIAL + +#define MASTER_LEFT +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 diff --git a/keyboards/lets_split/keymaps/pyrol/keymap.c b/keyboards/lets_split/keymaps/pyrol/keymap.c new file mode 100644 index 0000000000..23d779232f --- /dev/null +++ b/keyboards/lets_split/keymaps/pyrol/keymap.c @@ -0,0 +1,218 @@ +#include QMK_KEYBOARD_h + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _GAME 5 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + GAME, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | OS | Alt |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT , \ + ADJUST,KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | F | P | G | J | L | U | Y | ; | Tab | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Bksp | A | R | S | T | D | H | N | E | I | O |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | OS | Alt |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_TAB, \ + KC_BSPC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT , \ + ADJUST, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_BSPC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RGB | HUE | SAT | VAL | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, KC_MPRV, KC_MNXT, \ + RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | RGB | HUE | SAT | VAL | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), +/* Game + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Ctrl | OS | Alt |Raise |Space |Space |LOWER | ' | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_GAME] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_SLSH , \ + KC_LCTRL,KC_LCTRL, KC_LGUI, KC_LALT, RAISE, KC_SPC, KC_SPC, LOWER, KC_QUOT, KC_LEFT, KC_DOWN, KC_RGHT \ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | Game | | | | | | | | |Reset | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, _______, GAME, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case GAME: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAME); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split/keymaps/pyrol/rules.mk b/keyboards/lets_split/keymaps/pyrol/rules.mk new file mode 100644 index 0000000000..6e1be51bed --- /dev/null +++ b/keyboards/lets_split/keymaps/pyrol/rules.mk @@ -0,0 +1 @@ + BOOTMAGIC_ENABLE = yes -- cgit v1.2.3 From a68057852bbffc45f783523a86a6aa2e80a03d44 Mon Sep 17 00:00:00 2001 From: Doug Raffle Date: Sat, 25 Aug 2018 20:13:07 -0400 Subject: Keymap: initial migration of raffle 1up60rgb (#3747) * initial migration of raffle 1up60rgb * updated include statement --- keyboards/1up60rgb/keymaps/raffle/keymap.c | 130 ++++++++++++++++++++++++++++ keyboards/1up60rgb/keymaps/raffle/readme.md | 43 +++++++++ 2 files changed, 173 insertions(+) create mode 100644 keyboards/1up60rgb/keymaps/raffle/keymap.c create mode 100644 keyboards/1up60rgb/keymaps/raffle/readme.md diff --git a/keyboards/1up60rgb/keymaps/raffle/keymap.c b/keyboards/1up60rgb/keymaps/raffle/keymap.c new file mode 100644 index 0000000000..c166cd0b18 --- /dev/null +++ b/keyboards/1up60rgb/keymaps/raffle/keymap.c @@ -0,0 +1,130 @@ +//****************************************************************************// +// raffle's keymap for the 1up60rgb. // +// emulates my pok3r layout and adds RGB control + firmware reset/debug // +// layers // +//****************************************************************************// + +//************************ dependencies + definitions ************************// +#include QMK_KEYBOARD_H + +// create names for layers +enum layers { + _typing, + _raise, + _rgb, + _adjust +}; + +// define layer mods +#define RAISE MO(_raise) +#define RGB MO(_rgb) + +// define mod masks for making multi-key macros +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) + +//********************************** Layers **********************************// +// define layers +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // typing layer to handle basic typing + [_typing] = LAYOUT_all + ( + KC_GESC, 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_BSPC, + 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_LCTL, 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_ENT, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL + ), + // raise layer to handle function & nav keys + [_raise] = LAYOUT_all + ( + KC_GRV, 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_DEL, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + // rgb layer for pretty backlight colors + [_rgb] = LAYOUT_all + ( + RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_VAI, RGB_HUD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_SAI, RGB_VAD,RGB_SAD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, 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 + ), + // adjust to handle firmware debug + reset mode + [_adjust] = LAYOUT_all + ( + RESET, DEBUG, 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, 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, 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 + ) +}; + +//***************************** Function bodies *****************************// +// enable tri-layer state for _raise + _rgb = _adjust +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _raise, _rgb, _adjust); +} + + +// scan matrix +void matrix_scan_user(void) { +} + +// support for standard mod state keys (caps lock, scroll lock, etc.) +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +//*********** Empty fxns from default map that I'm not modifying ***********// +// onboard macro support +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +// initialize matrix +void matrix_init_user(void) { +} + + + diff --git a/keyboards/1up60rgb/keymaps/raffle/readme.md b/keyboards/1up60rgb/keymaps/raffle/readme.md new file mode 100644 index 0000000000..c462c206ac --- /dev/null +++ b/keyboards/1up60rgb/keymaps/raffle/readme.md @@ -0,0 +1,43 @@ +## raffle's keymap +The default keymap is just enough to get started. This keymap adds a pok3r-like +raise layer, backlight RGB control layer, and firmware reset/debug adjust layer +for ANSI layouts. + +In the default layer, the following modifications are made (using standard ANSI +keys for LHS): + +- `CAPS` = `LCTRL` +- `LCTRL` = `RAISE` +- `APP` = `RGB` +- `LCTRL` + `APP` (`RAISE` + `RGB`) = `ADJUST` +- `GRV` = `ESC` + +Additionally, the pok3r's `SHIFT` + `ESC` for `~` is maintained (with either `SHIFT`). + +### Raise Layer +Emulates standard pok3r layout (without the onboard macro keys) + +Highlights: + +- `IJKL` for arrow keys +- `H`/`N` for `HOME`/`END` +- `U`/`P` for `PGUP`/`PGDN` +- `1` - `=` for `F1` - `F12` +- `Y` for calculator + +Other standard keys from the pok3r layout are carried over. See the keymap or +the pok3r documentation for details. + +### RGB Layer +Uses navigation keys from `RAISE` layer for RGB adjustment + +- `I`/`K` for Value (brightness) Increase/Decrease +- `U`/`P` for Hue (color) Increase/Decrease +- `H`/`N` for Saturation Incrase/Decrease +- `GRV` to toggle RGB on/off +- `1`-`9` to activate QMK's predefined RGB animations + +### Adjust Layer + +- `GRV` activates firmware reset for flashing +- `1` enters debug mode -- cgit v1.2.3 From e16b39f0c20c73348ae12af0e82e4b4c0d30b393 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 25 Aug 2018 18:00:20 -0700 Subject: Keyboard: Duck Jetfire QMK Support (#3752) * Initial Commit Port from xauser's jetfire code. Does not compile yet * fix up keymap from uint8 to uin16 * update rules file to contain custom matrix * Good stopping point Still lots of compile errors but I'm getting there. * fix a few more compile errors * move a few functions around to help with compiling * Finally got it all to compile * Get rid of that old KEYMAP macro * edit readme * Put my name everywhere and some minor code clean ups * start to remove that kc nonsense * fix keymap compilation issues * add reset key info * better human readable formatting * match the duck default layout * add confgurator support * clarify reset key * might be a good idea to use the correct pin * get the riight keycode for RGB * include an ALL layout * I tried to fix the formatting....sigh * add functons to ensure Configurator compile-ability * move jetfire to duck directory * Moved and renamed things as per Drashna's PR comments as his back was hurting as he reviewed this --- keyboards/duck/jetfire/backlight_led.c | 129 +++++++++++ keyboards/duck/jetfire/backlight_led.h | 18 ++ keyboards/duck/jetfire/config.h | 200 ++++++++++++++++ keyboards/duck/jetfire/info.json | 16 ++ keyboards/duck/jetfire/jetfire.c | 171 ++++++++++++++ keyboards/duck/jetfire/jetfire.h | 60 +++++ keyboards/duck/jetfire/keymaps/default/config.h | 19 ++ keyboards/duck/jetfire/keymaps/default/keymap.c | 59 +++++ keyboards/duck/jetfire/keymaps/default/readme.md | 1 + keyboards/duck/jetfire/matrix.c | 277 +++++++++++++++++++++++ keyboards/duck/jetfire/readme.md | 18 ++ keyboards/duck/jetfire/rules.mk | 74 ++++++ keyboards/duck/readme.md | 16 ++ 13 files changed, 1058 insertions(+) create mode 100644 keyboards/duck/jetfire/backlight_led.c create mode 100644 keyboards/duck/jetfire/backlight_led.h create mode 100644 keyboards/duck/jetfire/config.h create mode 100644 keyboards/duck/jetfire/info.json create mode 100644 keyboards/duck/jetfire/jetfire.c create mode 100644 keyboards/duck/jetfire/jetfire.h create mode 100644 keyboards/duck/jetfire/keymaps/default/config.h create mode 100644 keyboards/duck/jetfire/keymaps/default/keymap.c create mode 100644 keyboards/duck/jetfire/keymaps/default/readme.md create mode 100644 keyboards/duck/jetfire/matrix.c create mode 100644 keyboards/duck/jetfire/readme.md create mode 100644 keyboards/duck/jetfire/rules.mk create mode 100644 keyboards/duck/readme.md diff --git a/keyboards/duck/jetfire/backlight_led.c b/keyboards/duck/jetfire/backlight_led.c new file mode 100644 index 0000000000..7e9dca6e9f --- /dev/null +++ b/keyboards/duck/jetfire/backlight_led.c @@ -0,0 +1,129 @@ +/* +Copyright 2016 Ralf Schmitt +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 . +*/ + +#include +#include +#include +#include +#include +#include "backlight_led.h" +#include "quantum.h" +// #include "led.h" + + +#define T1H 900 +#define T1L 600 +#define T0H 400 +#define T0L 900 +#define RES 6000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +void send_bit_d4(bool bitVal) +{ + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + } +} + +void send_bit_d6(bool bitVal) +{ + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + } +} + +void show(void) +{ + _delay_us((RES / 1000UL) + 1); +} + +void send_value(uint8_t byte, enum Device device) +{ + for(uint8_t b = 0; b < 8; b++) { + if(device == Device_STATELED) { + send_bit_d4(byte & 0b10000000); + } + if(device == Device_PCBRGB) { + send_bit_d6(byte & 0b10000000); + } + byte <<= 1; + } +} + +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) +{ + send_value(g, device); + send_value(r, device); + send_value(b, device); +} diff --git a/keyboards/duck/jetfire/backlight_led.h b/keyboards/duck/jetfire/backlight_led.h new file mode 100644 index 0000000000..36d8d9aa9b --- /dev/null +++ b/keyboards/duck/jetfire/backlight_led.h @@ -0,0 +1,18 @@ +#ifndef BACKLIGHT_LED_H +#define BACKLIGHT_LED_H + +enum Device { + Device_PCBRGB, + Device_STATELED +}; + +void backlight_init_ports(void); +void backlight_set_state(bool cfg[7]); +void backlight_update_state(void); +void backlight_toggle_rgb(bool enabled); +void backlight_set_rgb(uint8_t cfg[17][3]); +void backlight_set(uint8_t level); +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); +void show(void); + +#endif diff --git a/keyboards/duck/jetfire/config.h b/keyboards/duck/jetfire/config.h new file mode 100644 index 0000000000..80b531fd52 --- /dev/null +++ b/keyboards/duck/jetfire/config.h @@ -0,0 +1,200 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Jetfire +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 20 + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + + +#define BACKLIGHT_LEVELS 1 + +#define RGB_DI_PIN D6 +// #ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 23 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/duck/jetfire/info.json b/keyboards/duck/jetfire/info.json new file mode 100644 index 0000000000..db39529ac3 --- /dev/null +++ b/keyboards/duck/jetfire/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Jetfire", + "url": "", + "maintainer": "qmk", + "width": 20.5, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"x":19.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25}, {"label":"Menu", "x":12, "y":5.25}, {"x":13, "y":5.25}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}, {"x":19.5, "y":5.25}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}] + }, + + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25, "h":2}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25, "h":2}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25, "w":1.5}, {"label":"Menu", "x":12.5, "y":5.25, "w":1.5}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/duck/jetfire/jetfire.c b/keyboards/duck/jetfire/jetfire.c new file mode 100644 index 0000000000..81bdb95ba1 --- /dev/null +++ b/keyboards/duck/jetfire/jetfire.c @@ -0,0 +1,171 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "jetfire.h" +#include "backlight_led.h" + +enum backlight_level { + BACKLIGHT_ALPHA = 0b0000001, + BACKLIGHT_MOD = 0b0000010, + BACKLIGHT_FROW = 0b0000100, + BACKLIGHT_NUMBLOCK = 0b0001000, + BACKLIGHT_RGB = 0b0010000, + BACKLIGHT_SWITCH = 0b0001111 +}; + +enum StateLed { + STATE_LED_SCROLL_LOCK, + STATE_LED_CAPS_LOCK, + STATE_LED_NUM_LOCK, + STATE_LED_LAYER_0, + STATE_LED_LAYER_1, + STATE_LED_LAYER_2, + STATE_LED_LAYER_3, + STATE_LED_LAYER_4 +}; + +uint8_t backlight_rgb_r = 255; +uint8_t backlight_rgb_g = 0; +uint8_t backlight_rgb_b = 0; +uint8_t backlight_state_led = 1<. + */ +#ifndef JETFIRE_H +#define JETFIRE_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. + +#define LAYOUT_all( \ + K5A, K5C, K5D, K5E, K5F, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, K5T, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, K4R, K4S, K4T, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, K3Q, K3R, K3S, K3T, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2Q, K2R, K2S, K2T, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, K1T, \ + K0A, K0B, K0C, K0I, K0L, K0M, K0N, K0O, K0P, K0Q, K0R, K0S, K0T \ +) { \ + { K5A, KC_NO, K5C, K5D, K5E, K5F, KC_NO, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, K5T }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, K4P, K4Q, K4R, K4S, K4T }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, K3Q, K3R, K3S, K3T }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, KC_NO, K2Q, K2R, K2S, K2T }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, K1T }, \ + { K0A, K0B, K0C, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, K0I, KC_NO,KC_NO, K0L, K0M, K0N, K0O, K0P, K0Q, K0R, K0S, K0T } \ +} + +#define LAYOUT( \ + K5A, K5C, K5D, K5E, K5F, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, K5T, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, K4Q, K4R, K4S, K4T, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, K3Q, K3R, K3S, K3T, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2Q, K2R, K2S, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1P, K1Q, K1R, K1S, K1T, \ + K0A, K0B, K0C, K0I, K0M, K0N, K0O, K0P, K0Q, K0R, K0S \ +) { \ + { K5A, KC_NO, K5C, K5D, K5E, K5F, KC_NO, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, K5T }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, K4Q, K4R, K4S, K4T }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, K3Q, K3R, K3S, K3T }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, KC_NO, K2Q, K2R, K2S, KC_NO }, \ + { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, KC_NO, K1P, K1Q, K1R, K1S, K1T }, \ + { K0A, K0B, K0C, KC_NO,KC_NO,KC_NO,KC_NO,KC_NO, K0I, KC_NO,KC_NO,KC_NO, K0M, K0N, K0O, K0P, K0Q, K0R, K0S, KC_NO } \ +} + +#endif diff --git a/keyboards/duck/jetfire/keymaps/default/config.h b/keyboards/duck/jetfire/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/duck/jetfire/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/duck/jetfire/keymaps/default/keymap.c b/keyboards/duck/jetfire/keymaps/default/keymap.c new file mode 100644 index 0000000000..da0081a75e --- /dev/null +++ b/keyboards/duck/jetfire/keymaps/default/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // layer 0: qwerty + [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, RGB_MOD, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, + 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_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_P7, KC_P8, KC_P9, KC_PPLS, + 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_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_COMM), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/duck/jetfire/keymaps/default/readme.md b/keyboards/duck/jetfire/keymaps/default/readme.md new file mode 100644 index 0000000000..8b807694bd --- /dev/null +++ b/keyboards/duck/jetfire/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for jetfire diff --git a/keyboards/duck/jetfire/matrix.c b/keyboards/duck/jetfire/matrix.c new file mode 100644 index 0000000000..51202aeb64 --- /dev/null +++ b/keyboards/duck/jetfire/matrix.c @@ -0,0 +1,277 @@ +/* +Copyright 2016 Ralf Schmitt +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 . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_ports(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void backlight_init_ports(void) +{ + DDRD |= 0b01010000; + PORTD &= 0b10101111; + DDRB |= 0b00001110; + PORTB &= 0b11110001; + DDRE |= 0b01000000; + PORTE &= 0b10111111; +} + +void matrix_init(void) +{ + backlight_init_ports(); + unselect_cols(); + init_ports(); + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } +} + +uint8_t matrix_scan(void) +{ + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + uint8_t rows = read_rows(col); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< Date: Sat, 25 Aug 2018 21:01:07 -0400 Subject: Keymap: initial migration of raffle planck (#3748) * initial migration of raffle planck * cleaned up includes per merge per drashna * removed unicode shrug attempt * cleaned up include. --- keyboards/planck/keymaps/raffle/config.h | 38 ++++ keyboards/planck/keymaps/raffle/keymap.c | 305 ++++++++++++++++++++++++++++++ keyboards/planck/keymaps/raffle/readme.md | 11 ++ keyboards/planck/keymaps/raffle/rules.mk | 1 + 4 files changed, 355 insertions(+) create mode 100644 keyboards/planck/keymaps/raffle/config.h create mode 100644 keyboards/planck/keymaps/raffle/keymap.c create mode 100644 keyboards/planck/keymaps/raffle/readme.md create mode 100644 keyboards/planck/keymaps/raffle/rules.mk diff --git a/keyboards/planck/keymaps/raffle/config.h b/keyboards/planck/keymaps/raffle/config.h new file mode 100644 index 0000000000..e8c13caac5 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/raffle/keymap.c b/keyboards/planck/keymaps/raffle/keymap.c new file mode 100644 index 0000000000..0dbab38939 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/keymap.c @@ -0,0 +1,305 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "action_layer.h" +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _NAV, + _DEV +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT, + // my macros + R_ASGN, + R_PIPE, + R_CMLN, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// my defs +#define LT_ESC LT(_NAV, KC_ESC) //tap for esc, hold for mouse nav layer +#define DEV MO(_DEV) // get to dev layer +#define KC_CAD LALT(LCTL(KC_DEL)) // because awkwardness + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CTRL | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | APP | GUI | ALT |Lower | Space |Raise | DEV | | | | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + LT_ESC, KC_APP, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, DEV, _______, _______, _______ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | END | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | DEL | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, _______, _______, + KC_DEL, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | |Pg Up |Pg Dn | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Del | | | | | | | Next | Vol- | Vol+ | Play + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PGUP, KC_PGDN, _______, _______, + KC_DEL, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Nav Layer + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | PGUP | UP | PGDN | |KC_CAD| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | HOME | LEFT | DOWN |RIGHT | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | END | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_NAV] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, _______, KC_CAD, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* DEV Layer + * ,-----------------------------------------------------------------------------------. + * | | | |R_CMLM| | | | | | | |KC_CAD| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |R_ASGN|R_PIPE| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_DEV] = LAYOUT_planck_grid( + _______, _______, _______, R_CMLN, _______, _______, _______, _______, _______, _______, _______, KC_CAD, + _______, _______, _______, _______, _______, _______, _______, R_ASGN, R_PIPE, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + // my macros + case R_ASGN: + if (record->event.pressed) { + SEND_STRING(" <- "); + } + return false; + break; + case R_PIPE: + if (record->event.pressed) { + SEND_STRING(" %>%\n"); + } + return false; + break; + case R_CMLN: + if (record->event.pressed) { + SEND_STRING("################################################################################"); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + + diff --git a/keyboards/planck/keymaps/raffle/readme.md b/keyboards/planck/keymaps/raffle/readme.md new file mode 100644 index 0000000000..4cfb312b95 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/readme.md @@ -0,0 +1,11 @@ +# Raffle's Planck Layout + +- Caps -> LCtrl +- LCtrol -> Nav Layer + + Nav uses pok3r-like nav (IJKL, H/N for home/end, U/P for pgup/pgdn) +- RArrow -> Dev layer + + handy macros for R programming + +Also removes keymaps I don't use (dvorak, etc). + + diff --git a/keyboards/planck/keymaps/raffle/rules.mk b/keyboards/planck/keymaps/raffle/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/raffle/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From eb19fb5b57487747d608fad986a70296da4deb12 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 25 Aug 2018 20:01:09 -0700 Subject: Helpful functions --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/feature_backlight.md | 19 +++++++++++++++++++ docs/ref_functions.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 docs/ref_functions.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index d439298dad..a35014dd8c 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -36,6 +36,7 @@ * [Documentation Templates](documentation_templates.md) * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) + * [Useful Functions](ref_functions.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/_summary.md b/docs/_summary.md index d439298dad..a35014dd8c 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -36,6 +36,7 @@ * [Documentation Templates](documentation_templates.md) * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) + * [Useful Functions](ref_functions.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 6140e6a0ab..8f883e08fb 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -51,3 +51,22 @@ In this way `OCRxx` essentially controls the duty cycle of the LEDs, and thus th The breathing effect is achieved by registering an interrupt handler for `TIMER1_OVF_vect` that is called whenever the counter resets, roughly 244 times per second. In this handler, the value of an incrementing counter is mapped onto a precomputed brightness curve. To turn off breathing, the interrupt handler is simply disabled, and the brightness reset to the level stored in EEPROM. + +## Backlight Functions + +|Function |Description | +|----------|----------------------------------------------------------| +|`backlight_toggle()` |Turn the backlight on or off | +|`backlight_step()` |Cycle through backlight levels | +|`backlight_increase()` |Increase the backlight level | +|`backlight_decrease()` |Decrease the backlight level | +|`backlight_level(x)` |Sets the backlight level to specified level | +|`get_backlight_level()`|Toggle backlight breathing | + +### Backlight Breathing Functions + +|Function |Description | +|----------|----------------------------------------------------------| +|`breathing_toggle()` |Turn the backlight breathing on or off | +|`breathing_enable()` |Turns on backlight breathing | +|`breathing_disable()` |Turns off backlight breathing | diff --git a/docs/ref_functions.md b/docs/ref_functions.md new file mode 100644 index 0000000000..7d0cda3227 --- /dev/null +++ b/docs/ref_functions.md @@ -0,0 +1,48 @@ +# List of Useful Core Functions To Make Your Keyboard Better + +There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. + +## (OLKB) Tri Layers + +There are actually separate functions that you can use there, depending on what you're after. + +The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. + +This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. + +The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. + +The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. + +## Setting the Persistent Default Layer + +Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. + +To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). + +This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. + +To configure the default layer sounds, you would want to define this in your `config.h` file, like this: + +```c +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +``` + + +?> There are a large number of predefined songs in [quantum/audio/song_list.h](https://github.com/qmk/qmk_firmware/blob/master/quantum/audio/song_list.h) that you can use. + +## Reseting the keyboard + +There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. + +And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader. + +## Wiping the EEPROM (Persistent Storage) + +If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. + +To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. + -- cgit v1.2.3 From 1ee545014a0415eee8cbe4a3773002fb13371d14 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 26 Aug 2018 09:30:12 -0700 Subject: Keyboard: Make a 1upkeyboards directory for visibility (#3759) --- keyboards/1up60hse/1up60hse.c | 43 ---- keyboards/1up60hse/1up60hse.h | 39 ---- keyboards/1up60hse/config.h | 224 --------------------- keyboards/1up60hse/info.json | 12 -- keyboards/1up60hse/keymaps/default/config.h | 19 -- keyboards/1up60hse/keymaps/default/keymap.c | 44 ---- keyboards/1up60hse/keymaps/default/readme.md | 6 - keyboards/1up60hse/readme.md | 15 -- keyboards/1up60hse/rules.mk | 72 ------- keyboards/1up60rgb/1up60rgb.c | 1 - keyboards/1up60rgb/1up60rgb.h | 81 -------- keyboards/1up60rgb/config.h | 58 ------ keyboards/1up60rgb/info.json | 27 --- keyboards/1up60rgb/keymaps/default/keymap.c | 72 ------- keyboards/1up60rgb/keymaps/iso/keymap.c | 72 ------- keyboards/1up60rgb/keymaps/raffle/keymap.c | 130 ------------ keyboards/1up60rgb/keymaps/raffle/readme.md | 43 ---- keyboards/1up60rgb/keymaps/tsangan/keymap.c | 72 ------- keyboards/1up60rgb/readme.md | 13 -- keyboards/1up60rgb/rules.mk | 58 ------ keyboards/1upkeyboards/1up60hse/1up60hse.c | 43 ++++ keyboards/1upkeyboards/1up60hse/1up60hse.h | 39 ++++ keyboards/1upkeyboards/1up60hse/config.h | 224 +++++++++++++++++++++ keyboards/1upkeyboards/1up60hse/info.json | 12 ++ .../1upkeyboards/1up60hse/keymaps/default/config.h | 19 ++ .../1upkeyboards/1up60hse/keymaps/default/keymap.c | 44 ++++ .../1up60hse/keymaps/default/readme.md | 6 + keyboards/1upkeyboards/1up60hse/readme.md | 15 ++ keyboards/1upkeyboards/1up60hse/rules.mk | 72 +++++++ keyboards/1upkeyboards/1up60rgb/1up60rgb.c | 1 + keyboards/1upkeyboards/1up60rgb/1up60rgb.h | 81 ++++++++ keyboards/1upkeyboards/1up60rgb/config.h | 58 ++++++ keyboards/1upkeyboards/1up60rgb/info.json | 27 +++ .../1upkeyboards/1up60rgb/keymaps/default/keymap.c | 72 +++++++ .../1upkeyboards/1up60rgb/keymaps/iso/keymap.c | 72 +++++++ .../1upkeyboards/1up60rgb/keymaps/raffle/keymap.c | 130 ++++++++++++ .../1upkeyboards/1up60rgb/keymaps/raffle/readme.md | 43 ++++ .../1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c | 72 +++++++ keyboards/1upkeyboards/1up60rgb/readme.md | 13 ++ keyboards/1upkeyboards/1up60rgb/rules.mk | 58 ++++++ keyboards/1upkeyboards/readme.md | 5 + keyboards/1upkeyboards/sweet16/config.h | 58 ++++++ keyboards/1upkeyboards/sweet16/info.json | 16 ++ .../1upkeyboards/sweet16/keymaps/default/keymap.c | 43 ++++ .../1upkeyboards/sweet16/keymaps/dlaroe/keymap.c | 38 ++++ .../1upkeyboards/sweet16/keymaps/dlaroe/readme.md | 3 + keyboards/1upkeyboards/sweet16/readme.md | 14 ++ keyboards/1upkeyboards/sweet16/rules.mk | 56 ++++++ keyboards/1upkeyboards/sweet16/sweet16.c | 1 + keyboards/1upkeyboards/sweet16/sweet16.h | 32 +++ keyboards/sweet16/config.h | 58 ------ keyboards/sweet16/info.json | 16 -- keyboards/sweet16/keymaps/default/keymap.c | 43 ---- keyboards/sweet16/keymaps/dlaroe/keymap.c | 38 ---- keyboards/sweet16/keymaps/dlaroe/readme.md | 3 - keyboards/sweet16/readme.md | 14 -- keyboards/sweet16/rules.mk | 56 ------ keyboards/sweet16/sweet16.c | 1 - keyboards/sweet16/sweet16.h | 32 --- 59 files changed, 1367 insertions(+), 1362 deletions(-) delete mode 100644 keyboards/1up60hse/1up60hse.c delete mode 100644 keyboards/1up60hse/1up60hse.h delete mode 100644 keyboards/1up60hse/config.h delete mode 100644 keyboards/1up60hse/info.json delete mode 100644 keyboards/1up60hse/keymaps/default/config.h delete mode 100644 keyboards/1up60hse/keymaps/default/keymap.c delete mode 100644 keyboards/1up60hse/keymaps/default/readme.md delete mode 100644 keyboards/1up60hse/readme.md delete mode 100644 keyboards/1up60hse/rules.mk delete mode 100644 keyboards/1up60rgb/1up60rgb.c delete mode 100644 keyboards/1up60rgb/1up60rgb.h delete mode 100644 keyboards/1up60rgb/config.h delete mode 100644 keyboards/1up60rgb/info.json delete mode 100644 keyboards/1up60rgb/keymaps/default/keymap.c delete mode 100644 keyboards/1up60rgb/keymaps/iso/keymap.c delete mode 100644 keyboards/1up60rgb/keymaps/raffle/keymap.c delete mode 100644 keyboards/1up60rgb/keymaps/raffle/readme.md delete mode 100644 keyboards/1up60rgb/keymaps/tsangan/keymap.c delete mode 100644 keyboards/1up60rgb/readme.md delete mode 100644 keyboards/1up60rgb/rules.mk create mode 100644 keyboards/1upkeyboards/1up60hse/1up60hse.c create mode 100644 keyboards/1upkeyboards/1up60hse/1up60hse.h create mode 100644 keyboards/1upkeyboards/1up60hse/config.h create mode 100644 keyboards/1upkeyboards/1up60hse/info.json create mode 100644 keyboards/1upkeyboards/1up60hse/keymaps/default/config.h create mode 100644 keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c create mode 100644 keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md create mode 100644 keyboards/1upkeyboards/1up60hse/readme.md create mode 100644 keyboards/1upkeyboards/1up60hse/rules.mk create mode 100644 keyboards/1upkeyboards/1up60rgb/1up60rgb.c create mode 100644 keyboards/1upkeyboards/1up60rgb/1up60rgb.h create mode 100644 keyboards/1upkeyboards/1up60rgb/config.h create mode 100644 keyboards/1upkeyboards/1up60rgb/info.json create mode 100644 keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c create mode 100644 keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c create mode 100644 keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c create mode 100644 keyboards/1upkeyboards/1up60rgb/keymaps/raffle/readme.md create mode 100644 keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c create mode 100644 keyboards/1upkeyboards/1up60rgb/readme.md create mode 100644 keyboards/1upkeyboards/1up60rgb/rules.mk create mode 100644 keyboards/1upkeyboards/readme.md create mode 100644 keyboards/1upkeyboards/sweet16/config.h create mode 100644 keyboards/1upkeyboards/sweet16/info.json create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md create mode 100644 keyboards/1upkeyboards/sweet16/readme.md create mode 100644 keyboards/1upkeyboards/sweet16/rules.mk create mode 100644 keyboards/1upkeyboards/sweet16/sweet16.c create mode 100644 keyboards/1upkeyboards/sweet16/sweet16.h delete mode 100644 keyboards/sweet16/config.h delete mode 100644 keyboards/sweet16/info.json delete mode 100644 keyboards/sweet16/keymaps/default/keymap.c delete mode 100644 keyboards/sweet16/keymaps/dlaroe/keymap.c delete mode 100644 keyboards/sweet16/keymaps/dlaroe/readme.md delete mode 100644 keyboards/sweet16/readme.md delete mode 100644 keyboards/sweet16/rules.mk delete mode 100644 keyboards/sweet16/sweet16.c delete mode 100644 keyboards/sweet16/sweet16.h diff --git a/keyboards/1up60hse/1up60hse.c b/keyboards/1up60hse/1up60hse.c deleted file mode 100644 index c04018d62c..0000000000 --- a/keyboards/1up60hse/1up60hse.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include "1up60hse.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/1up60hse/1up60hse.h b/keyboards/1up60hse/1up60hse.h deleted file mode 100644 index d24bbaabf6..0000000000 --- a/keyboards/1up60hse/1up60hse.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#ifndef KB_H -#define KB_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments representing the physical -// layout of the board and position of the keys -// The second converts the arguments into a two-dimensional array which -// represents the switch matrix. -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ - K40, K41, K42, K45, K49, K4A, K4B, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D } \ -} -#endif diff --git a/keyboards/1up60hse/config.h b/keyboards/1up60hse/config.h deleted file mode 100644 index c3682de43e..0000000000 --- a/keyboards/1up60hse/config.h +++ /dev/null @@ -1,224 +0,0 @@ -/* -Copyright 2018 MechMerlin - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 1upkeyboards -#define PRODUCT 1up60hse -#define DESCRIPTION A custom 60% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } -#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B7 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 5 - -#define RGB_DI_PIN F0 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/1up60hse/info.json b/keyboards/1up60hse/info.json deleted file mode 100644 index 831614bc6b..0000000000 --- a/keyboards/1up60hse/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "1up60hse", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } - } -} diff --git a/keyboards/1up60hse/keymaps/default/config.h b/keyboards/1up60hse/keymaps/default/config.h deleted file mode 100644 index a3ed4f762a..0000000000 --- a/keyboards/1up60hse/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 - -// place overrides here diff --git a/keyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1up60hse/keymaps/default/keymap.c deleted file mode 100644 index 556246a3b2..0000000000 --- a/keyboards/1up60hse/keymaps/default/keymap.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_60_ansi( - KC_ESC, 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_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, - MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), - - [1] = LAYOUT_60_ansi( - KC_GRV, 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_TRNS, - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - [2] = LAYOUT_60_ansi( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - diff --git a/keyboards/1up60hse/keymaps/default/readme.md b/keyboards/1up60hse/keymaps/default/readme.md deleted file mode 100644 index a9afa5ea6d..0000000000 --- a/keyboards/1up60hse/keymaps/default/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -# 1up60hse default keymap - -This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). - -## Notes -- Software reset key is located on `Esc` on the third layer. diff --git a/keyboards/1up60hse/readme.md b/keyboards/1up60hse/readme.md deleted file mode 100644 index 5ea040bf4a..0000000000 --- a/keyboards/1up60hse/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# 1up60hse (hot swap edition) - -![1up60hse](https://i2.wp.com/www.1upkeyboards.com/wp-content/uploads/2018/08/PCB-1up-60-hotswap-group-RGB.jpg?fit=1280%2C1280&ssl=1) - -A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a standard ANSI layout. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: 1up60hse 60% PCB. -Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) - -Make example for this keyboard (after setting up your build environment): - - make 1up60hse:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/1up60hse/rules.mk b/keyboards/1up60hse/rules.mk deleted file mode 100644 index f33e33fd9e..0000000000 --- a/keyboards/1up60hse/rules.mk +++ /dev/null @@ -1,72 +0,0 @@ -# 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 - - -# Boot Section Size in *bytes* -# 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 = no # 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes # 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) - -LAYOUTS = 60_ansi diff --git a/keyboards/1up60rgb/1up60rgb.c b/keyboards/1up60rgb/1up60rgb.c deleted file mode 100644 index 4ba631c797..0000000000 --- a/keyboards/1up60rgb/1up60rgb.c +++ /dev/null @@ -1 +0,0 @@ -#include "1up60rgb.h" diff --git a/keyboards/1up60rgb/1up60rgb.h b/keyboards/1up60rgb/1up60rgb.h deleted file mode 100644 index 6905fd2205..0000000000 --- a/keyboards/1up60rgb/1up60rgb.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef KB_H -#define KB_H - -#include "quantum.h" - -#define LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 } \ -} - - -/* ANSI variant. No extra keys for ISO */ -#define LAYOUT_60_ansi( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K013,\ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ - K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, KC_NO,\ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) - -/* ISO variant. Remove useless ANSI keys */ -#define LAYOUT_60_iso( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K013,\ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K214, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, KC_NO,\ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) - -/* HHKB Variant */ -#define LAYOUT_60_ansi_split_bs_rshift( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014,\ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ - K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314,\ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) - -/* HHKB Variant */ -#define LAYOUT_60_hhkb( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K401, K403, K406, K411, K413 \ -) LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ - K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - KC_NO,K401, K403, K406, KC_NO,K411, K413, KC_NO \ -) - -#endif diff --git a/keyboards/1up60rgb/config.h b/keyboards/1up60rgb/config.h deleted file mode 100644 index bfdf354af7..0000000000 --- a/keyboards/1up60rgb/config.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 1upkeyboards -#define PRODUCT 1UP RGB Underglow PCB -#define DESCRIPTION 60% keyboard with RGB underglow - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } -#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 5 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 16 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/1up60rgb/info.json b/keyboards/1up60rgb/info.json deleted file mode 100644 index 67f94b7fe1..0000000000 --- a/keyboards/1up60rgb/info.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "keyboard_name": "1up60rgb", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - - "LAYOUT_60_ansi": { - "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":13, "y":0, "label":"Backspace", "w":2}, {"x":0, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":13.5, "y":1, "label":"|", "w":1.5}, {"x":0, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":12.75, "y":2, "label":"Enter", "w":2.25}, {"x":0, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":12.25, "y":3, "label":"Shift", "w":2.75}, {"x":0, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.25, "y":4, "label":"Win", "w":1.25}, {"x":2.5, "y":4, "label":"Alt", "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "label":"Alt", "w":1.25}, {"x":11.25, "y":4, "label":"Win", "w":1.25}, {"x":12.5, "y":4, "label":"Menu", "w":1.25}, {"x":13.75, "y":4, "label":"Ctrl", "w":1.25}] - }, - - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - - "LAYOUT_60_ansi_split_bs_rshift": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Win", "x":11.5, "y":4}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] - }, - "LAYOUT_60_hhkb": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] - } - } -} diff --git a/keyboards/1up60rgb/keymaps/default/keymap.c b/keyboards/1up60rgb/keymaps/default/keymap.c deleted file mode 100644 index cb372e15d7..0000000000 --- a/keyboards/1up60rgb/keymaps/default/keymap.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "1up60rgb.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT_all( - KC_ESC, 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_BSPC, - 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_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_ENT, - KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), - - LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/1up60rgb/keymaps/iso/keymap.c b/keyboards/1up60rgb/keymaps/iso/keymap.c deleted file mode 100644 index 42fcb6cf9b..0000000000 --- a/keyboards/1up60rgb/keymaps/iso/keymap.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "1up60rgb.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT_all( - KC_ESC, 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_BSPC, - 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_ENT, - 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_NUHS, 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_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), - - LAYOUT_all( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/1up60rgb/keymaps/raffle/keymap.c b/keyboards/1up60rgb/keymaps/raffle/keymap.c deleted file mode 100644 index c166cd0b18..0000000000 --- a/keyboards/1up60rgb/keymaps/raffle/keymap.c +++ /dev/null @@ -1,130 +0,0 @@ -//****************************************************************************// -// raffle's keymap for the 1up60rgb. // -// emulates my pok3r layout and adds RGB control + firmware reset/debug // -// layers // -//****************************************************************************// - -//************************ dependencies + definitions ************************// -#include QMK_KEYBOARD_H - -// create names for layers -enum layers { - _typing, - _raise, - _rgb, - _adjust -}; - -// define layer mods -#define RAISE MO(_raise) -#define RGB MO(_rgb) - -// define mod masks for making multi-key macros -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) - -//********************************** Layers **********************************// -// define layers -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - // typing layer to handle basic typing - [_typing] = LAYOUT_all - ( - KC_GESC, 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_BSPC, - 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_LCTL, 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_ENT, - KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, - RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL - ), - // raise layer to handle function & nav keys - [_raise] = LAYOUT_all - ( - KC_GRV, 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_DEL, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - // rgb layer for pretty backlight colors - [_rgb] = LAYOUT_all - ( - RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_VAI, RGB_HUD, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_SAI, RGB_VAD,RGB_SAD, KC_NO, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, 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 - ), - // adjust to handle firmware debug + reset mode - [_adjust] = LAYOUT_all - ( - RESET, DEBUG, 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, 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, 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 - ) -}; - -//***************************** Function bodies *****************************// -// enable tri-layer state for _raise + _rgb = _adjust -uint32_t layer_state_set_user(uint32_t state) { - return update_tri_layer_state(state, _raise, _rgb, _adjust); -} - - -// scan matrix -void matrix_scan_user(void) { -} - -// support for standard mod state keys (caps lock, scroll lock, etc.) -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} - -//*********** Empty fxns from default map that I'm not modifying ***********// -// onboard macro support -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - -// initialize matrix -void matrix_init_user(void) { -} - - - diff --git a/keyboards/1up60rgb/keymaps/raffle/readme.md b/keyboards/1up60rgb/keymaps/raffle/readme.md deleted file mode 100644 index c462c206ac..0000000000 --- a/keyboards/1up60rgb/keymaps/raffle/readme.md +++ /dev/null @@ -1,43 +0,0 @@ -## raffle's keymap -The default keymap is just enough to get started. This keymap adds a pok3r-like -raise layer, backlight RGB control layer, and firmware reset/debug adjust layer -for ANSI layouts. - -In the default layer, the following modifications are made (using standard ANSI -keys for LHS): - -- `CAPS` = `LCTRL` -- `LCTRL` = `RAISE` -- `APP` = `RGB` -- `LCTRL` + `APP` (`RAISE` + `RGB`) = `ADJUST` -- `GRV` = `ESC` - -Additionally, the pok3r's `SHIFT` + `ESC` for `~` is maintained (with either `SHIFT`). - -### Raise Layer -Emulates standard pok3r layout (without the onboard macro keys) - -Highlights: - -- `IJKL` for arrow keys -- `H`/`N` for `HOME`/`END` -- `U`/`P` for `PGUP`/`PGDN` -- `1` - `=` for `F1` - `F12` -- `Y` for calculator - -Other standard keys from the pok3r layout are carried over. See the keymap or -the pok3r documentation for details. - -### RGB Layer -Uses navigation keys from `RAISE` layer for RGB adjustment - -- `I`/`K` for Value (brightness) Increase/Decrease -- `U`/`P` for Hue (color) Increase/Decrease -- `H`/`N` for Saturation Incrase/Decrease -- `GRV` to toggle RGB on/off -- `1`-`9` to activate QMK's predefined RGB animations - -### Adjust Layer - -- `GRV` activates firmware reset for flashing -- `1` enters debug mode diff --git a/keyboards/1up60rgb/keymaps/tsangan/keymap.c b/keyboards/1up60rgb/keymaps/tsangan/keymap.c deleted file mode 100644 index 485010eef1..0000000000 --- a/keyboards/1up60rgb/keymaps/tsangan/keymap.c +++ /dev/null @@ -1,72 +0,0 @@ -#include "1up60rgb.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT_all( - KC_ESC, 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_BSLS, KC_GRV, - 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_BSPC, - 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_ENT, - KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_RCTL), - - LAYOUT_all( - RESET, 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_TRNS, KC_DEL, - KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_UP, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_DOWN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - ; - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/1up60rgb/readme.md b/keyboards/1up60rgb/readme.md deleted file mode 100644 index a16ab7ea86..0000000000 --- a/keyboards/1up60rgb/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# 1upkeyboards 60% RGB - -Firmware for custom keyboard PCB with 60% key layout. - -Keyboard Maintainer: [rempired](https://github.com/rempired) -Hardware Supported: 1upkeyboards 60% RGB -Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/1up-rgb-underglow-pcb/) - -Make example for this keyboard (after setting up your build environment): - - make 1up60rgb:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/1up60rgb/rules.mk b/keyboards/1up60rgb/rules.mk deleted file mode 100644 index 540e4ea96c..0000000000 --- a/keyboards/1up60rgb/rules.mk +++ /dev/null @@ -1,58 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= yes - -LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb diff --git a/keyboards/1upkeyboards/1up60hse/1up60hse.c b/keyboards/1upkeyboards/1up60hse/1up60hse.c new file mode 100644 index 0000000000..c04018d62c --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/1up60hse.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "1up60hse.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/1upkeyboards/1up60hse/1up60hse.h b/keyboards/1upkeyboards/1up60hse/1up60hse.h new file mode 100644 index 0000000000..d24bbaabf6 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/1up60hse.h @@ -0,0 +1,39 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef KB_H +#define KB_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ + K40, K41, K42, K45, K49, K4A, K4B, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, KC_NO, K4D } \ +} +#endif diff --git a/keyboards/1upkeyboards/1up60hse/config.h b/keyboards/1upkeyboards/1up60hse/config.h new file mode 100644 index 0000000000..c3682de43e --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1upkeyboards +#define PRODUCT 1up60hse +#define DESCRIPTION A custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, B0, D4 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, E6, D1, D0, D2, D3, D5, D6, D7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/1upkeyboards/1up60hse/info.json b/keyboards/1upkeyboards/1up60hse/info.json new file mode 100644 index 0000000000..831614bc6b --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "1up60hse", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c new file mode 100644 index 0000000000..556246a3b2 --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + KC_ESC, 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_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, + MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), + + [1] = LAYOUT_60_ansi( + KC_GRV, 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_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [2] = LAYOUT_60_ansi( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md new file mode 100644 index 0000000000..a9afa5ea6d --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md @@ -0,0 +1,6 @@ +# 1up60hse default keymap + +This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). + +## Notes +- Software reset key is located on `Esc` on the third layer. diff --git a/keyboards/1upkeyboards/1up60hse/readme.md b/keyboards/1upkeyboards/1up60hse/readme.md new file mode 100644 index 0000000000..5ea040bf4a --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/readme.md @@ -0,0 +1,15 @@ +# 1up60hse (hot swap edition) + +![1up60hse](https://i2.wp.com/www.1upkeyboards.com/wp-content/uploads/2018/08/PCB-1up-60-hotswap-group-RGB.jpg?fit=1280%2C1280&ssl=1) + +A 60% PCB with USB C, RGB underglow, backlighting, hotswappable switches, and a standard ANSI layout. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: 1up60hse 60% PCB. +Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/controllers/1up-rgb-pcb-hse/) + +Make example for this keyboard (after setting up your build environment): + + make 1up60hse:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/1upkeyboards/1up60hse/rules.mk b/keyboards/1upkeyboards/1up60hse/rules.mk new file mode 100644 index 0000000000..f33e33fd9e --- /dev/null +++ b/keyboards/1upkeyboards/1up60hse/rules.mk @@ -0,0 +1,72 @@ +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) + +LAYOUTS = 60_ansi diff --git a/keyboards/1upkeyboards/1up60rgb/1up60rgb.c b/keyboards/1upkeyboards/1up60rgb/1up60rgb.c new file mode 100644 index 0000000000..4ba631c797 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/1up60rgb.c @@ -0,0 +1 @@ +#include "1up60rgb.h" diff --git a/keyboards/1upkeyboards/1up60rgb/1up60rgb.h b/keyboards/1upkeyboards/1up60rgb/1up60rgb.h new file mode 100644 index 0000000000..6905fd2205 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/1up60rgb.h @@ -0,0 +1,81 @@ +#ifndef KB_H +#define KB_H + +#include "quantum.h" + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 } \ +} + + +/* ANSI variant. No extra keys for ISO */ +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K013,\ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ + K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, KC_NO,\ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) + +/* ISO variant. Remove useless ANSI keys */ +#define LAYOUT_60_iso( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K013,\ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K214, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, KC_NO,\ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) + +/* HHKB Variant */ +#define LAYOUT_60_ansi_split_bs_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014,\ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ + K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314,\ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) + +/* HHKB Variant */ +#define LAYOUT_60_hhkb( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K403, K406, K411, K413 \ +) LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K214, \ + K300, KC_NO,K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + KC_NO,K401, K403, K406, KC_NO,K411, K413, KC_NO \ +) + +#endif diff --git a/keyboards/1upkeyboards/1up60rgb/config.h b/keyboards/1upkeyboards/1up60rgb/config.h new file mode 100644 index 0000000000..bfdf354af7 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1upkeyboards +#define PRODUCT 1UP RGB Underglow PCB +#define DESCRIPTION 60% keyboard with RGB underglow + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/1upkeyboards/1up60rgb/info.json b/keyboards/1upkeyboards/1up60rgb/info.json new file mode 100644 index 0000000000..67f94b7fe1 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/info.json @@ -0,0 +1,27 @@ +{ + "keyboard_name": "1up60rgb", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0, "label":"~"}, {"x":1, "y":0, "label":"!"}, {"x":2, "y":0, "label":"@"}, {"x":3, "y":0, "label":"#"}, {"x":4, "y":0, "label":"$"}, {"x":5, "y":0, "label":"%"}, {"x":6, "y":0, "label":"^"}, {"x":7, "y":0, "label":"&"}, {"x":8, "y":0, "label":"*"}, {"x":9, "y":0, "label":"("}, {"x":10, "y":0, "label":")"}, {"x":11, "y":0, "label":"_"}, {"x":12, "y":0, "label":"+"}, {"x":13, "y":0, "label":"Backspace", "w":2}, {"x":0, "y":1, "label":"Tab", "w":1.5}, {"x":1.5, "y":1, "label":"Q"}, {"x":2.5, "y":1, "label":"W"}, {"x":3.5, "y":1, "label":"E"}, {"x":4.5, "y":1, "label":"R"}, {"x":5.5, "y":1, "label":"T"}, {"x":6.5, "y":1, "label":"Y"}, {"x":7.5, "y":1, "label":"U"}, {"x":8.5, "y":1, "label":"I"}, {"x":9.5, "y":1, "label":"O"}, {"x":10.5, "y":1, "label":"P"}, {"x":11.5, "y":1, "label":"{"}, {"x":12.5, "y":1, "label":"}"}, {"x":13.5, "y":1, "label":"|", "w":1.5}, {"x":0, "y":2, "label":"Caps Lock", "w":1.75}, {"x":1.75, "y":2, "label":"A"}, {"x":2.75, "y":2, "label":"S"}, {"x":3.75, "y":2, "label":"D"}, {"x":4.75, "y":2, "label":"F"}, {"x":5.75, "y":2, "label":"G"}, {"x":6.75, "y":2, "label":"H"}, {"x":7.75, "y":2, "label":"J"}, {"x":8.75, "y":2, "label":"K"}, {"x":9.75, "y":2, "label":"L"}, {"x":10.75, "y":2, "label":":"}, {"x":11.75, "y":2, "label":"\""}, {"x":12.75, "y":2, "label":"Enter", "w":2.25}, {"x":0, "y":3, "label":"Shift", "w":2.25}, {"x":2.25, "y":3, "label":"Z"}, {"x":3.25, "y":3, "label":"X"}, {"x":4.25, "y":3, "label":"C"}, {"x":5.25, "y":3, "label":"V"}, {"x":6.25, "y":3, "label":"B"}, {"x":7.25, "y":3, "label":"N"}, {"x":8.25, "y":3, "label":"M"}, {"x":9.25, "y":3, "label":"<"}, {"x":10.25, "y":3, "label":">"}, {"x":11.25, "y":3, "label":"?"}, {"x":12.25, "y":3, "label":"Shift", "w":2.75}, {"x":0, "y":4, "label":"Ctrl", "w":1.25}, {"x":1.25, "y":4, "label":"Win", "w":1.25}, {"x":2.5, "y":4, "label":"Alt", "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "label":"Alt", "w":1.25}, {"x":11.25, "y":4, "label":"Win", "w":1.25}, {"x":12.5, "y":4, "label":"Menu", "w":1.25}, {"x":13.75, "y":4, "label":"Ctrl", "w":1.25}] + }, + + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"label":"Alt", "x":10, "y":4, "w":1.5}, {"label":"Win", "x":11.5, "y":4}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c new file mode 100644 index 0000000000..cb372e15d7 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/default/keymap.c @@ -0,0 +1,72 @@ +#include "1up60rgb.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_ESC, 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_BSPC, + 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_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_ENT, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + + LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c new file mode 100644 index 0000000000..42fcb6cf9b --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/iso/keymap.c @@ -0,0 +1,72 @@ +#include "1up60rgb.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_ESC, 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_BSPC, + 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_ENT, + 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_NUHS, 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_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + + LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c new file mode 100644 index 0000000000..c166cd0b18 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/keymap.c @@ -0,0 +1,130 @@ +//****************************************************************************// +// raffle's keymap for the 1up60rgb. // +// emulates my pok3r layout and adds RGB control + firmware reset/debug // +// layers // +//****************************************************************************// + +//************************ dependencies + definitions ************************// +#include QMK_KEYBOARD_H + +// create names for layers +enum layers { + _typing, + _raise, + _rgb, + _adjust +}; + +// define layer mods +#define RAISE MO(_raise) +#define RGB MO(_rgb) + +// define mod masks for making multi-key macros +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) + +//********************************** Layers **********************************// +// define layers +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // typing layer to handle basic typing + [_typing] = LAYOUT_all + ( + KC_GESC, 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_BSPC, + 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_LCTL, 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_ENT, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, + RAISE, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, RGB, KC_RCTL + ), + // raise layer to handle function & nav keys + [_raise] = LAYOUT_all + ( + KC_GRV, 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_DEL, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_LSCR, KC_PAUSE, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + // rgb layer for pretty backlight colors + [_rgb] = LAYOUT_all + ( + RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_M_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_HUI, RGB_VAI, RGB_HUD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_MOD, RGB_SAI, RGB_VAD,RGB_SAD, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_RMOD, 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 + ), + // adjust to handle firmware debug + reset mode + [_adjust] = LAYOUT_all + ( + RESET, DEBUG, 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, 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, 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 + ) +}; + +//***************************** Function bodies *****************************// +// enable tri-layer state for _raise + _rgb = _adjust +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _raise, _rgb, _adjust); +} + + +// scan matrix +void matrix_scan_user(void) { +} + +// support for standard mod state keys (caps lock, scroll lock, etc.) +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + +//*********** Empty fxns from default map that I'm not modifying ***********// +// onboard macro support +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +// initialize matrix +void matrix_init_user(void) { +} + + + diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/readme.md b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/readme.md new file mode 100644 index 0000000000..c462c206ac --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/raffle/readme.md @@ -0,0 +1,43 @@ +## raffle's keymap +The default keymap is just enough to get started. This keymap adds a pok3r-like +raise layer, backlight RGB control layer, and firmware reset/debug adjust layer +for ANSI layouts. + +In the default layer, the following modifications are made (using standard ANSI +keys for LHS): + +- `CAPS` = `LCTRL` +- `LCTRL` = `RAISE` +- `APP` = `RGB` +- `LCTRL` + `APP` (`RAISE` + `RGB`) = `ADJUST` +- `GRV` = `ESC` + +Additionally, the pok3r's `SHIFT` + `ESC` for `~` is maintained (with either `SHIFT`). + +### Raise Layer +Emulates standard pok3r layout (without the onboard macro keys) + +Highlights: + +- `IJKL` for arrow keys +- `H`/`N` for `HOME`/`END` +- `U`/`P` for `PGUP`/`PGDN` +- `1` - `=` for `F1` - `F12` +- `Y` for calculator + +Other standard keys from the pok3r layout are carried over. See the keymap or +the pok3r documentation for details. + +### RGB Layer +Uses navigation keys from `RAISE` layer for RGB adjustment + +- `I`/`K` for Value (brightness) Increase/Decrease +- `U`/`P` for Hue (color) Increase/Decrease +- `H`/`N` for Saturation Incrase/Decrease +- `GRV` to toggle RGB on/off +- `1`-`9` to activate QMK's predefined RGB animations + +### Adjust Layer + +- `GRV` activates firmware reset for flashing +- `1` enters debug mode diff --git a/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c b/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c new file mode 100644 index 0000000000..485010eef1 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/keymaps/tsangan/keymap.c @@ -0,0 +1,72 @@ +#include "1up60rgb.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + 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_ENT, + KC_LSFT, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_NO, KC_RALT, KC_RGUI, KC_RCTL), + + LAYOUT_all( + RESET, 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_TRNS, KC_DEL, + KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + ; + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/1upkeyboards/1up60rgb/readme.md b/keyboards/1upkeyboards/1up60rgb/readme.md new file mode 100644 index 0000000000..a16ab7ea86 --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/readme.md @@ -0,0 +1,13 @@ +# 1upkeyboards 60% RGB + +Firmware for custom keyboard PCB with 60% key layout. + +Keyboard Maintainer: [rempired](https://github.com/rempired) +Hardware Supported: 1upkeyboards 60% RGB +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/1up-rgb-underglow-pcb/) + +Make example for this keyboard (after setting up your build environment): + + make 1up60rgb:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/1upkeyboards/1up60rgb/rules.mk b/keyboards/1upkeyboards/1up60rgb/rules.mk new file mode 100644 index 0000000000..540e4ea96c --- /dev/null +++ b/keyboards/1upkeyboards/1up60rgb/rules.mk @@ -0,0 +1,58 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no # Commands for debug and configuration +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= yes + +LAYOUTS = 60_ansi 60_iso 60_ansi_split_bs_rshift 60_hhkb diff --git a/keyboards/1upkeyboards/readme.md b/keyboards/1upkeyboards/readme.md new file mode 100644 index 0000000000..4f075d8279 --- /dev/null +++ b/keyboards/1upkeyboards/readme.md @@ -0,0 +1,5 @@ +# 1UP Keyboards + +Website: [1UP Keyboards](https://www.1upkeyboards.com/) +Discord: [Server Invite](https://discordapp.com/invite/c6SYn8) +YouTube: [skiwithpete](https://www.youtube.com/user/skiwithpete) \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/config.h b/keyboards/1upkeyboards/sweet16/config.h new file mode 100644 index 0000000000..77d9e276dc --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x2010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 1up Keyboards +#define PRODUCT Sweet16 +#define DESCRIPTION 4x4 grid + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F4, F5, F6, F7 } +#define MATRIX_COL_PINS { D1, D0, D4, C6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN B1 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 1 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/info.json b/keyboards/1upkeyboards/sweet16/info.json new file mode 100644 index 0000000000..445a5909ec --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Sweet 16", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + }, + + "LAYOUT_numpad_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] + } + } +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c new file mode 100644 index 0000000000..2ddf8acb41 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/default/keymap.c @@ -0,0 +1,43 @@ +#include "sweet16.h" + +enum custom_keycodes { + UP_URL = SAFE_RANGE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_4x4( + KC_7, KC_8, KC_9, KC_ASTR, + KC_4, KC_5, KC_6, KC_SLSH, + KC_1, KC_2, KC_3, KC_MINS, + KC_0, KC_ENT, KC_DOT, KC_EQL + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case UP_URL: + if (record->event.pressed) { + SEND_STRING("http://1upkeyboards.com"); + } + return false; + break; + } + return true; +} + +void led_set_user(uint8_t usb_led) { + + /* Map RXLED to USB_LED_NUM_LOCK */ + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + /* Map TXLED to USB_LED_CAPS_LOCK */ + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } +} diff --git a/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c new file mode 100644 index 0000000000..b42c34edb7 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/keymap.c @@ -0,0 +1,38 @@ +#include "sweet16.h" + +enum layers { + num, + extra, + mouse +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [num] = LAYOUT_numpad_4x4( + KC_P7, KC_P8, KC_P9, LT(extra, KC_PPLS), + KC_P4, KC_P5, KC_P6, + KC_P1, KC_P2, KC_P3, KC_PENT, + LT(mouse, KC_P0), KC_DOT + ), + + [extra] = LAYOUT_numpad_4x4( + KC_PSLS, KC_PAST, KC_PMNS, KC_TRNS, + KC_BSPC, KC_EXECUTE, KC_DEL, + KC_LPRN, KC_RPRN, KC_PEQL, KC_PENT, + KC_TAB, KC_NLCK + ), + + +[mouse] = LAYOUT_numpad_4x4( + KC_WH_D, KC_MS_U, KC_WH_U, LT(extra, KC_PPLS), + KC_MS_L, KC_MS_D, KC_MS_R, + KC_BTN1, KC_BTN2, KC_BTN3, KC_PENT, + KC_TRNS, KC_DOT + ) + + + + +}; + diff --git a/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md new file mode 100644 index 0000000000..aabcf82c61 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/dlaroe/readme.md @@ -0,0 +1,3 @@ +# Dale's keymap for the Sweet16 + +I wanted to reuse a standard numpad keyset and have the full functionality of an larger numpad with a nod to Excel functionality. diff --git a/keyboards/1upkeyboards/sweet16/readme.md b/keyboards/1upkeyboards/sweet16/readme.md new file mode 100644 index 0000000000..435aed68cd --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/readme.md @@ -0,0 +1,14 @@ +Sweet16 +=== + +A 4x4 numpad/macro pad sold by 1up Keyboards - designed by Bishop Keyboards + +Keyboard Maintainer: QMK Community +Hardware Supported: Sweet16 Keyboard PCB +Hardware Availability: [1up Keyboards](https://1upkeyboards.com/) + +Make example for this keyboard (after setting up your build environment): + + make sweet16:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/rules.mk b/keyboards/1upkeyboards/sweet16/rules.mk new file mode 100644 index 0000000000..212e74059e --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/rules.mk @@ -0,0 +1,56 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/sweet16.c b/keyboards/1upkeyboards/sweet16/sweet16.c new file mode 100644 index 0000000000..2f116c2a37 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/sweet16.c @@ -0,0 +1 @@ +#include "sweet16.h" \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/sweet16.h b/keyboards/1upkeyboards/sweet16/sweet16.h new file mode 100644 index 0000000000..879f51fae6 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/sweet16.h @@ -0,0 +1,32 @@ +#ifndef KB_H +#define KB_H + +#include "quantum.h" + +// Any changes to the layout names and/or definitions must also be made to info.json + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} + +#define LAYOUT_numpad_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K23, \ + K31, K32 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, KC_NO }, \ + { K20, K21, K22, K23 }, \ + { KC_NO, K31, K32, KC_NO } \ +} + +#endif diff --git a/keyboards/sweet16/config.h b/keyboards/sweet16/config.h deleted file mode 100644 index 77d9e276dc..0000000000 --- a/keyboards/sweet16/config.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x2010 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 1up Keyboards -#define PRODUCT Sweet16 -#define DESCRIPTION 4x4 grid - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 4 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { F4, F5, F6, F7 } -#define MATRIX_COL_PINS { D1, D0, D4, C6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ - -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - -#define RGB_DI_PIN B1 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 1 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif \ No newline at end of file diff --git a/keyboards/sweet16/info.json b/keyboards/sweet16/info.json deleted file mode 100644 index 445a5909ec..0000000000 --- a/keyboards/sweet16/info.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "keyboard_name": "Sweet 16", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 4, - "layouts": { - "LAYOUT_ortho_4x4": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] - }, - - "LAYOUT_numpad_4x4": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] - } - } -} diff --git a/keyboards/sweet16/keymaps/default/keymap.c b/keyboards/sweet16/keymaps/default/keymap.c deleted file mode 100644 index 2ddf8acb41..0000000000 --- a/keyboards/sweet16/keymaps/default/keymap.c +++ /dev/null @@ -1,43 +0,0 @@ -#include "sweet16.h" - -enum custom_keycodes { - UP_URL = SAFE_RANGE -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ortho_4x4( - KC_7, KC_8, KC_9, KC_ASTR, - KC_4, KC_5, KC_6, KC_SLSH, - KC_1, KC_2, KC_3, KC_MINS, - KC_0, KC_ENT, KC_DOT, KC_EQL - ) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case UP_URL: - if (record->event.pressed) { - SEND_STRING("http://1upkeyboards.com"); - } - return false; - break; - } - return true; -} - -void led_set_user(uint8_t usb_led) { - - /* Map RXLED to USB_LED_NUM_LOCK */ - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRB |= (1 << 0); PORTB &= ~(1 << 0); - } else { - DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); - } - - /* Map TXLED to USB_LED_CAPS_LOCK */ - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } -} diff --git a/keyboards/sweet16/keymaps/dlaroe/keymap.c b/keyboards/sweet16/keymaps/dlaroe/keymap.c deleted file mode 100644 index b42c34edb7..0000000000 --- a/keyboards/sweet16/keymaps/dlaroe/keymap.c +++ /dev/null @@ -1,38 +0,0 @@ -#include "sweet16.h" - -enum layers { - num, - extra, - mouse -}; - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [num] = LAYOUT_numpad_4x4( - KC_P7, KC_P8, KC_P9, LT(extra, KC_PPLS), - KC_P4, KC_P5, KC_P6, - KC_P1, KC_P2, KC_P3, KC_PENT, - LT(mouse, KC_P0), KC_DOT - ), - - [extra] = LAYOUT_numpad_4x4( - KC_PSLS, KC_PAST, KC_PMNS, KC_TRNS, - KC_BSPC, KC_EXECUTE, KC_DEL, - KC_LPRN, KC_RPRN, KC_PEQL, KC_PENT, - KC_TAB, KC_NLCK - ), - - -[mouse] = LAYOUT_numpad_4x4( - KC_WH_D, KC_MS_U, KC_WH_U, LT(extra, KC_PPLS), - KC_MS_L, KC_MS_D, KC_MS_R, - KC_BTN1, KC_BTN2, KC_BTN3, KC_PENT, - KC_TRNS, KC_DOT - ) - - - - -}; - diff --git a/keyboards/sweet16/keymaps/dlaroe/readme.md b/keyboards/sweet16/keymaps/dlaroe/readme.md deleted file mode 100644 index aabcf82c61..0000000000 --- a/keyboards/sweet16/keymaps/dlaroe/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# Dale's keymap for the Sweet16 - -I wanted to reuse a standard numpad keyset and have the full functionality of an larger numpad with a nod to Excel functionality. diff --git a/keyboards/sweet16/readme.md b/keyboards/sweet16/readme.md deleted file mode 100644 index 435aed68cd..0000000000 --- a/keyboards/sweet16/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -Sweet16 -=== - -A 4x4 numpad/macro pad sold by 1up Keyboards - designed by Bishop Keyboards - -Keyboard Maintainer: QMK Community -Hardware Supported: Sweet16 Keyboard PCB -Hardware Availability: [1up Keyboards](https://1upkeyboards.com/) - -Make example for this keyboard (after setting up your build environment): - - make sweet16:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/sweet16/rules.mk b/keyboards/sweet16/rules.mk deleted file mode 100644 index 212e74059e..0000000000 --- a/keyboards/sweet16/rules.mk +++ /dev/null @@ -1,56 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB 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 -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/sweet16/sweet16.c b/keyboards/sweet16/sweet16.c deleted file mode 100644 index 2f116c2a37..0000000000 --- a/keyboards/sweet16/sweet16.c +++ /dev/null @@ -1 +0,0 @@ -#include "sweet16.h" \ No newline at end of file diff --git a/keyboards/sweet16/sweet16.h b/keyboards/sweet16/sweet16.h deleted file mode 100644 index 879f51fae6..0000000000 --- a/keyboards/sweet16/sweet16.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef KB_H -#define KB_H - -#include "quantum.h" - -// Any changes to the layout names and/or definitions must also be made to info.json - -#define LAYOUT_ortho_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, K13, \ - K20, K21, K22, K23, \ - K30, K31, K32, K33 \ -) { \ - { K00, K01, K02, K03 }, \ - { K10, K11, K12, K13 }, \ - { K20, K21, K22, K23 }, \ - { K30, K31, K32, K33 } \ -} - -#define LAYOUT_numpad_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, \ - K20, K21, K22, K23, \ - K31, K32 \ -) { \ - { K00, K01, K02, K03 }, \ - { K10, K11, K12, KC_NO }, \ - { K20, K21, K22, K23 }, \ - { KC_NO, K31, K32, KC_NO } \ -} - -#endif -- cgit v1.2.3 From a63d4774f5115b91703936183a39a4724b44b94d Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 26 Aug 2018 09:30:49 -0700 Subject: Keyboard: Putting all my ducks in a row: Lightsaver (#3758) --- keyboards/duck/lightsaver/config.h | 54 ++++ keyboards/duck/lightsaver/indicator_leds.c | 91 +++++++ keyboards/duck/lightsaver/indicator_leds.h | 1 + keyboards/duck/lightsaver/info.json | 13 + keyboards/duck/lightsaver/keymaps/default/keymap.c | 48 ++++ .../duck/lightsaver/keymaps/default/readme.md | 11 + keyboards/duck/lightsaver/keymaps/rasmus/config.h | 8 + keyboards/duck/lightsaver/keymaps/rasmus/keymap.c | 105 ++++++++ keyboards/duck/lightsaver/keymaps/rasmus/readme.md | 12 + keyboards/duck/lightsaver/keymaps/rasmus/rules.mk | 2 + keyboards/duck/lightsaver/lightsaver.c | 60 +++++ keyboards/duck/lightsaver/lightsaver.h | 40 +++ keyboards/duck/lightsaver/matrix.c | 275 +++++++++++++++++++++ keyboards/duck/lightsaver/readme.md | 19 ++ keyboards/duck/lightsaver/rules.mk | 72 ++++++ keyboards/lightsaver/config.h | 54 ---- keyboards/lightsaver/indicator_leds.c | 91 ------- keyboards/lightsaver/indicator_leds.h | 1 - keyboards/lightsaver/info.json | 13 - keyboards/lightsaver/keymaps/default/keymap.c | 48 ---- keyboards/lightsaver/keymaps/default/readme.md | 11 - keyboards/lightsaver/keymaps/rasmus/config.h | 8 - keyboards/lightsaver/keymaps/rasmus/keymap.c | 105 -------- keyboards/lightsaver/keymaps/rasmus/readme.md | 12 - keyboards/lightsaver/keymaps/rasmus/rules.mk | 2 - keyboards/lightsaver/lightsaver.c | 60 ----- keyboards/lightsaver/lightsaver.h | 40 --- keyboards/lightsaver/matrix.c | 275 --------------------- keyboards/lightsaver/readme.md | 19 -- keyboards/lightsaver/rules.mk | 72 ------ 30 files changed, 811 insertions(+), 811 deletions(-) create mode 100644 keyboards/duck/lightsaver/config.h create mode 100644 keyboards/duck/lightsaver/indicator_leds.c create mode 100644 keyboards/duck/lightsaver/indicator_leds.h create mode 100644 keyboards/duck/lightsaver/info.json create mode 100644 keyboards/duck/lightsaver/keymaps/default/keymap.c create mode 100644 keyboards/duck/lightsaver/keymaps/default/readme.md create mode 100644 keyboards/duck/lightsaver/keymaps/rasmus/config.h create mode 100644 keyboards/duck/lightsaver/keymaps/rasmus/keymap.c create mode 100644 keyboards/duck/lightsaver/keymaps/rasmus/readme.md create mode 100644 keyboards/duck/lightsaver/keymaps/rasmus/rules.mk create mode 100644 keyboards/duck/lightsaver/lightsaver.c create mode 100644 keyboards/duck/lightsaver/lightsaver.h create mode 100644 keyboards/duck/lightsaver/matrix.c create mode 100644 keyboards/duck/lightsaver/readme.md create mode 100644 keyboards/duck/lightsaver/rules.mk delete mode 100644 keyboards/lightsaver/config.h delete mode 100644 keyboards/lightsaver/indicator_leds.c delete mode 100644 keyboards/lightsaver/indicator_leds.h delete mode 100644 keyboards/lightsaver/info.json delete mode 100644 keyboards/lightsaver/keymaps/default/keymap.c delete mode 100644 keyboards/lightsaver/keymaps/default/readme.md delete mode 100644 keyboards/lightsaver/keymaps/rasmus/config.h delete mode 100644 keyboards/lightsaver/keymaps/rasmus/keymap.c delete mode 100644 keyboards/lightsaver/keymaps/rasmus/readme.md delete mode 100644 keyboards/lightsaver/keymaps/rasmus/rules.mk delete mode 100644 keyboards/lightsaver/lightsaver.c delete mode 100644 keyboards/lightsaver/lightsaver.h delete mode 100644 keyboards/lightsaver/matrix.c delete mode 100644 keyboards/lightsaver/readme.md delete mode 100644 keyboards/lightsaver/rules.mk diff --git a/keyboards/duck/lightsaver/config.h b/keyboards/duck/lightsaver/config.h new file mode 100644 index 0000000000..bc984c7e56 --- /dev/null +++ b/keyboards/duck/lightsaver/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 Rasmus Schults + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0003 +#define MANUFACTURER Duck +#define PRODUCT Lightsaver V3 +#define DESCRIPTION Duck Lightsaver V3 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 19 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 1 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/duck/lightsaver/indicator_leds.c b/keyboards/duck/lightsaver/indicator_leds.c new file mode 100644 index 0000000000..0a54e151e1 --- /dev/null +++ b/keyboards/duck/lightsaver/indicator_leds.c @@ -0,0 +1,91 @@ +/* +Copyright 2016-2017 Ralf Schmitt Rasmus Schults + +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 . +*/ +#include +#include +#include +#include + +#define T1H 900 +#define T1L 600 +#define T0H 400 +#define T0L 900 +#define RES 6000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +void send_bit_d4(bool bitVal) { + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + } +} + +void show(void) { + _delay_us((RES / 1000UL) + 1); +} + +void send_value(uint8_t byte) { + for(uint8_t b = 0; b < 8; b++) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } +} + +void send_color(uint8_t r, uint8_t g, uint8_t b) { + send_value(g); + send_value(r); + send_value(b); +} + +void indicator_leds_set(bool leds[8]) { + cli(); + send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0); + send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0); + send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0); + sei(); + show(); +} diff --git a/keyboards/duck/lightsaver/indicator_leds.h b/keyboards/duck/lightsaver/indicator_leds.h new file mode 100644 index 0000000000..fe66eef6b2 --- /dev/null +++ b/keyboards/duck/lightsaver/indicator_leds.h @@ -0,0 +1 @@ +void indicator_leds_set(bool leds[8]); diff --git a/keyboards/duck/lightsaver/info.json b/keyboards/duck/lightsaver/info.json new file mode 100644 index 0000000000..0637ef9a18 --- /dev/null +++ b/keyboards/duck/lightsaver/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Duck Lightsaver V3", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT": { + "key_count": 100, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Num
Lock", "x":14, "y":0}, {"label":"Insert", "x":15, "y":0}, {"label":"Home", "x":16, "y":0}, {"label":"PgUp", "x":17, "y":0}, {"label":"/", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Bkspc", "x":13, "y":1, "w":2}, {"label":"Delete", "x":15, "y":1}, {"label":"End", "x":16, "y":1}, {"label":"PgDn", "x":17, "y":1}, {"label":"*", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"CapsLock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] + } + } +} diff --git a/keyboards/duck/lightsaver/keymaps/default/keymap.c b/keyboards/duck/lightsaver/keymaps/default/keymap.c new file mode 100644 index 0000000000..d945ada24d --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* Copyright 2017 Rasmus Schults + * + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define KC_F1GL TD(TD_F1_GAME) +#define KC_CLFN TD(TD_CAPS_FN) + +enum custom_layers { + BASE, // Base QWERTY layer + FN = 5, // Function layer +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = 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_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ + 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_DEL, KC_END, KC_PGDN, KC_PAST, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + MO(FN), 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), \ + +[FN] = LAYOUT(\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_SLCK, RGB_TOG, RGB_MOD, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, BL_TOGG, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \ + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/duck/lightsaver/keymaps/default/readme.md b/keyboards/duck/lightsaver/keymaps/default/readme.md new file mode 100644 index 0000000000..06f9aac5a2 --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/default/readme.md @@ -0,0 +1,11 @@ +![Lightsaver Layout Image](https://i.imgur.com/vRAy2XP.png) + +# Default Lightsaver Layout + +This is the default implement layout for Duck Lightsaver V3. + + +## Features + +* Default QWERTY layer +* FN layer - Control RGB underglow and backlight. HJKL Vim style movement. diff --git a/keyboards/duck/lightsaver/keymaps/rasmus/config.h b/keyboards/duck/lightsaver/keymaps/rasmus/config.h new file mode 100644 index 0000000000..f2b5d264e7 --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/rasmus/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define FORCE_NKRO + +#endif diff --git a/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c b/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c new file mode 100644 index 0000000000..518ba2d21a --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/rasmus/keymap.c @@ -0,0 +1,105 @@ +/* Copyright 2017 Rasmus Schults + * + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define KC_F1GL TD(TD_F1_GAME) +#define KC_CLFN TD(TD_CAPS_FN) + +enum custom_layers { + BASE, // Base QWERTY layer + GAME, // Gaming layer + FN = 5, // Function layer +}; + +//Tap Dance Declarations +enum { + TD_F1_BASE, + TD_F1_GAME, + TD_CAPS_FN +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_F1_GAME] = ACTION_TAP_DANCE_DUAL_ROLE(KC_F1, GAME), + [TD_CAPS_FN] = ACTION_TAP_DANCE_DUAL_ROLE(KC_CAPS, 5) +}; + +enum macro_id { + SHRG, +}; + +#define TYPE_SHRUG MACRO( \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(A), T(F), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(5), T(C), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(5), T(F), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(2), T(8), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(3), T(0), T(C), T(4), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(2), T(9), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(5), T(F), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(2), T(F), \ + D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ + T(0), T(0), T(A), T(F), \ + T(SPACE), END \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[BASE] = LAYOUT(\ + KC_ESC, KC_F1GL, 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_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ + 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_DEL, KC_END, KC_PGDN, KC_PAST, \ + 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_P7, KC_P8, KC_P9, KC_PMNS, \ + MO(FN), 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), \ + +[GAME] = LAYOUT(\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LOCK, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CLFN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LGUI, KC_LALT, _______, KC_RALT, _______, _______, _______, _______, _______, _______ ), \ + +[FN] = LAYOUT(\ + _______, M(SHRG), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_SLCK, RGB_TOG, RGB_MOD, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \ + +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case SHRG: + return (record->event.pressed ? TYPE_SHRUG : MACRO_NONE ); + break; + } + + return MACRO_NONE; +}; diff --git a/keyboards/duck/lightsaver/keymaps/rasmus/readme.md b/keyboards/duck/lightsaver/keymaps/rasmus/readme.md new file mode 100644 index 0000000000..7670145f76 --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/rasmus/readme.md @@ -0,0 +1,12 @@ +![Lightsaver Layout Image](https://i.imgur.com/KqdZQZZ.png) + +# rasmusx's Lightsaver Layout + +Custom keymap for Lightsaver. + + +## Features + +* Default layer has ALT/SUPER switched and FN key in Caps Lock place. +* FN layer - Control RGB underglow and backlight. HJKL Vim style movement. +* Game layer - ALT/SUPER in normal positions. FN behaviour: 1 tap Caps Lock, 2 taps FN diff --git a/keyboards/duck/lightsaver/keymaps/rasmus/rules.mk b/keyboards/duck/lightsaver/keymaps/rasmus/rules.mk new file mode 100644 index 0000000000..3b11f9a9c5 --- /dev/null +++ b/keyboards/duck/lightsaver/keymaps/rasmus/rules.mk @@ -0,0 +1,2 @@ +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/duck/lightsaver/lightsaver.c b/keyboards/duck/lightsaver/lightsaver.c new file mode 100644 index 0000000000..75e35b28b2 --- /dev/null +++ b/keyboards/duck/lightsaver/lightsaver.c @@ -0,0 +1,60 @@ +/* Copyright 2017 Rasmus Schults + * + * 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 . + */ +#include "lightsaver.h" +#include "indicator_leds.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHAS = 0b00000010, // Alpha keys + BACKLIGHT_FKEYS = 0b00000100, // Function row keys + BACKLIGHT_MODNUM = 0b00001000, // Modifiers and number row + BACKLIGHT_NUMPAD = 0b01000000 // Numpad area +}; + +void backlight_set(uint8_t level) { + if (level > 0) { + // Turn on leds + PORTB &= ~BACKLIGHT_ALPHAS; + PORTB &= ~BACKLIGHT_FKEYS; + PORTB &= ~BACKLIGHT_MODNUM; + PORTE &= ~BACKLIGHT_NUMPAD; + } else { + // Turn off leds + PORTB |= BACKLIGHT_ALPHAS; + PORTB |= BACKLIGHT_FKEYS; + PORTB |= BACKLIGHT_MODNUM; + PORTE |= BACKLIGHT_NUMPAD; + } +} + +void led_set_kb(uint8_t usb_led) { + bool leds[8] = { + usb_led & (1< + * + * 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 . + */ +#ifndef LIGHTSAVER_H +#define LIGHTSAVER_H + +#include "quantum.h" + +#define NO KC_NO + +#define LAYOUT( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, K4Q, K4R, K4S, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, K3Q, K3R, K3S, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, K2Q, K2R, K2S, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O, K0P, K0Q, K0R \ +) { \ +/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 */ \ +/* 0 */ { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, }, \ +/* 1 */ { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, NO, K4O, K4P, K4Q, K4R, K4S, }, \ +/* 2 */ { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, NO, K3O, K3P, K3Q, K3R, K3S, }, \ +/* 3 */ { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, NO, NO, K2O, K2P, K2Q, K2R, K2S, }, \ +/* 4 */ { K1A, NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, NO, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, }, \ +/* 5 */ { K0A, K0B, K0C, NO, NO, NO, NO, NO, K0I, NO, K0K, NO, K0M, K0N, K0O, K0P, K0Q, K0R } \ +} + +#endif diff --git a/keyboards/duck/lightsaver/matrix.c b/keyboards/duck/lightsaver/matrix.c new file mode 100644 index 0000000000..a07cdd0d16 --- /dev/null +++ b/keyboards/duck/lightsaver/matrix.c @@ -0,0 +1,275 @@ +/* +Copyright 2016-2017 Ralf Schmitt Rasmus Schults +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 . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(void); +static uint8_t read_fwkey(void); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + + +__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) { +} + +void matrix_init(void) { + DDRD |= 0b11010000; + PORTD &= ~0b01010000; + DDRB |= 0b00011111; + PORTB &= ~0b00001110; + PORTB |= 0b00010001; + DDRE |= 0b01000000; + PORTE &= ~0b01000000; + + unselect_cols(); + init_rows(); + + 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++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(); + if(col == 0) { + rows |= read_fwkey(); + } + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1337 -#define DEVICE_VER 0x0003 -#define MANUFACTURER Duck -#define PRODUCT Lightsaver V3 -#define DESCRIPTION Duck Lightsaver V3 - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 19 - -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D6 -#define RGBLED_NUM 17 - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/lightsaver/indicator_leds.c b/keyboards/lightsaver/indicator_leds.c deleted file mode 100644 index 0a54e151e1..0000000000 --- a/keyboards/lightsaver/indicator_leds.c +++ /dev/null @@ -1,91 +0,0 @@ -/* -Copyright 2016-2017 Ralf Schmitt Rasmus Schults - -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 . -*/ -#include -#include -#include -#include - -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - -void send_bit_d4(bool bitVal) { - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); - } -} - -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { - for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; - } -} - -void send_color(uint8_t r, uint8_t g, uint8_t b) { - send_value(g); - send_value(r); - send_value(b); -} - -void indicator_leds_set(bool leds[8]) { - cli(); - send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0); - send_color(leds[4] ? 255 : 0, leds[5] ? 255 : 0, leds[3] ? 255 : 0); - send_color(leds[6] ? 255 : 0, leds[7] ? 255 : 0, 0); - sei(); - show(); -} diff --git a/keyboards/lightsaver/indicator_leds.h b/keyboards/lightsaver/indicator_leds.h deleted file mode 100644 index fe66eef6b2..0000000000 --- a/keyboards/lightsaver/indicator_leds.h +++ /dev/null @@ -1 +0,0 @@ -void indicator_leds_set(bool leds[8]); diff --git a/keyboards/lightsaver/info.json b/keyboards/lightsaver/info.json deleted file mode 100644 index 0637ef9a18..0000000000 --- a/keyboards/lightsaver/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "Duck Lightsaver V3", - "url": "", - "maintainer": "qmk", - "width": 19, - "height": 6, - "layouts": { - "LAYOUT": { - "key_count": 100, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Num
Lock", "x":14, "y":0}, {"label":"Insert", "x":15, "y":0}, {"label":"Home", "x":16, "y":0}, {"label":"PgUp", "x":17, "y":0}, {"label":"/", "x":18, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Bkspc", "x":13, "y":1, "w":2}, {"label":"Delete", "x":15, "y":1}, {"label":"End", "x":16, "y":1}, {"label":"PgDn", "x":17, "y":1}, {"label":"*", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"7", "x":15, "y":2}, {"label":"8", "x":16, "y":2}, {"label":"9", "x":17, "y":2}, {"label":"-", "x":18, "y":2}, {"label":"CapsLock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"4", "x":15, "y":3}, {"label":"5", "x":16, "y":3}, {"label":"6", "x":17, "y":3}, {"label":"+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"1", "x":15, "y":4}, {"label":"2", "x":16, "y":4}, {"label":"3", "x":17, "y":4}, {"label":"Enter", "x":18, "y":4, "h":2}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.5}, {"label":"Ctrl", "x":11.5, "y":5, "w":1.5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}, {"label":"0", "x":16, "y":5}, {"label":".", "x":17, "y":5}] - } - } -} diff --git a/keyboards/lightsaver/keymaps/default/keymap.c b/keyboards/lightsaver/keymaps/default/keymap.c deleted file mode 100644 index d945ada24d..0000000000 --- a/keyboards/lightsaver/keymaps/default/keymap.c +++ /dev/null @@ -1,48 +0,0 @@ -/* Copyright 2017 Rasmus Schults - * - * - * 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 . - */ -#include QMK_KEYBOARD_H - -#define KC_F1GL TD(TD_F1_GAME) -#define KC_CLFN TD(TD_CAPS_FN) - -enum custom_layers { - BASE, // Base QWERTY layer - FN = 5, // Function layer -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = 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_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ - 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_DEL, KC_END, KC_PGDN, KC_PAST, \ - 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_P7, KC_P8, KC_P9, KC_PMNS, \ - MO(FN), 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), \ - -[FN] = LAYOUT(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_SLCK, RGB_TOG, RGB_MOD, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, BL_TOGG, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \ - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/lightsaver/keymaps/default/readme.md b/keyboards/lightsaver/keymaps/default/readme.md deleted file mode 100644 index 06f9aac5a2..0000000000 --- a/keyboards/lightsaver/keymaps/default/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -![Lightsaver Layout Image](https://i.imgur.com/vRAy2XP.png) - -# Default Lightsaver Layout - -This is the default implement layout for Duck Lightsaver V3. - - -## Features - -* Default QWERTY layer -* FN layer - Control RGB underglow and backlight. HJKL Vim style movement. diff --git a/keyboards/lightsaver/keymaps/rasmus/config.h b/keyboards/lightsaver/keymaps/rasmus/config.h deleted file mode 100644 index f2b5d264e7..0000000000 --- a/keyboards/lightsaver/keymaps/rasmus/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define FORCE_NKRO - -#endif diff --git a/keyboards/lightsaver/keymaps/rasmus/keymap.c b/keyboards/lightsaver/keymaps/rasmus/keymap.c deleted file mode 100644 index 518ba2d21a..0000000000 --- a/keyboards/lightsaver/keymaps/rasmus/keymap.c +++ /dev/null @@ -1,105 +0,0 @@ -/* Copyright 2017 Rasmus Schults - * - * - * 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 . - */ -#include QMK_KEYBOARD_H - -#define KC_F1GL TD(TD_F1_GAME) -#define KC_CLFN TD(TD_CAPS_FN) - -enum custom_layers { - BASE, // Base QWERTY layer - GAME, // Gaming layer - FN = 5, // Function layer -}; - -//Tap Dance Declarations -enum { - TD_F1_BASE, - TD_F1_GAME, - TD_CAPS_FN -}; - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_F1_GAME] = ACTION_TAP_DANCE_DUAL_ROLE(KC_F1, GAME), - [TD_CAPS_FN] = ACTION_TAP_DANCE_DUAL_ROLE(KC_CAPS, 5) -}; - -enum macro_id { - SHRG, -}; - -#define TYPE_SHRUG MACRO( \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(A), T(F), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(5), T(C), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(5), T(F), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(2), T(8), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(3), T(0), T(C), T(4), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(2), T(9), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(5), T(F), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(2), T(F), \ - D(LCTRL), D(LSHIFT), T(U), U(LCTRL), U(LSHIFT), \ - T(0), T(0), T(A), T(F), \ - T(SPACE), END \ -) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT(\ - KC_ESC, KC_F1GL, 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_NLCK, KC_INS, KC_HOME, KC_PGUP, KC_PSLS, \ - 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_DEL, KC_END, KC_PGDN, KC_PAST, \ - 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_P7, KC_P8, KC_P9, KC_PMNS, \ - MO(FN), 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), \ - -[GAME] = LAYOUT(\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LOCK, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_CLFN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_LGUI, KC_LALT, _______, KC_RALT, _______, _______, _______, _______, _______, _______ ), \ - -[FN] = LAYOUT(\ - _______, M(SHRG), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PAUS, KC_SLCK, RGB_TOG, RGB_MOD, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), \ - -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case SHRG: - return (record->event.pressed ? TYPE_SHRUG : MACRO_NONE ); - break; - } - - return MACRO_NONE; -}; diff --git a/keyboards/lightsaver/keymaps/rasmus/readme.md b/keyboards/lightsaver/keymaps/rasmus/readme.md deleted file mode 100644 index 7670145f76..0000000000 --- a/keyboards/lightsaver/keymaps/rasmus/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -![Lightsaver Layout Image](https://i.imgur.com/KqdZQZZ.png) - -# rasmusx's Lightsaver Layout - -Custom keymap for Lightsaver. - - -## Features - -* Default layer has ALT/SUPER switched and FN key in Caps Lock place. -* FN layer - Control RGB underglow and backlight. HJKL Vim style movement. -* Game layer - ALT/SUPER in normal positions. FN behaviour: 1 tap Caps Lock, 2 taps FN diff --git a/keyboards/lightsaver/keymaps/rasmus/rules.mk b/keyboards/lightsaver/keymaps/rasmus/rules.mk deleted file mode 100644 index 3b11f9a9c5..0000000000 --- a/keyboards/lightsaver/keymaps/rasmus/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -KEY_LOCK_ENABLE = yes -TAP_DANCE_ENABLE = yes diff --git a/keyboards/lightsaver/lightsaver.c b/keyboards/lightsaver/lightsaver.c deleted file mode 100644 index 75e35b28b2..0000000000 --- a/keyboards/lightsaver/lightsaver.c +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright 2017 Rasmus Schults - * - * 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 . - */ -#include "lightsaver.h" -#include "indicator_leds.h" - -enum BACKLIGHT_AREAS { - BACKLIGHT_ALPHAS = 0b00000010, // Alpha keys - BACKLIGHT_FKEYS = 0b00000100, // Function row keys - BACKLIGHT_MODNUM = 0b00001000, // Modifiers and number row - BACKLIGHT_NUMPAD = 0b01000000 // Numpad area -}; - -void backlight_set(uint8_t level) { - if (level > 0) { - // Turn on leds - PORTB &= ~BACKLIGHT_ALPHAS; - PORTB &= ~BACKLIGHT_FKEYS; - PORTB &= ~BACKLIGHT_MODNUM; - PORTE &= ~BACKLIGHT_NUMPAD; - } else { - // Turn off leds - PORTB |= BACKLIGHT_ALPHAS; - PORTB |= BACKLIGHT_FKEYS; - PORTB |= BACKLIGHT_MODNUM; - PORTE |= BACKLIGHT_NUMPAD; - } -} - -void led_set_kb(uint8_t usb_led) { - bool leds[8] = { - usb_led & (1< - * - * 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 . - */ -#ifndef LIGHTSAVER_H -#define LIGHTSAVER_H - -#include "quantum.h" - -#define NO KC_NO - -#define LAYOUT( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, K4Q, K4R, K4S, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, K3Q, K3R, K3S, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, K2Q, K2R, K2S, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, \ - K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O, K0P, K0Q, K0R \ -) { \ -/* 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 */ \ -/* 0 */ { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, K5Q, K5R, K5S, }, \ -/* 1 */ { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, NO, K4O, K4P, K4Q, K4R, K4S, }, \ -/* 2 */ { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, NO, K3O, K3P, K3Q, K3R, K3S, }, \ -/* 3 */ { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, NO, NO, K2O, K2P, K2Q, K2R, K2S, }, \ -/* 4 */ { K1A, NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, NO, K1M, K1N, K1O, K1P, K1Q, K1R, K1S, }, \ -/* 5 */ { K0A, K0B, K0C, NO, NO, NO, NO, NO, K0I, NO, K0K, NO, K0M, K0N, K0O, K0P, K0Q, K0R } \ -} - -#endif diff --git a/keyboards/lightsaver/matrix.c b/keyboards/lightsaver/matrix.c deleted file mode 100644 index a07cdd0d16..0000000000 --- a/keyboards/lightsaver/matrix.c +++ /dev/null @@ -1,275 +0,0 @@ -/* -Copyright 2016-2017 Ralf Schmitt Rasmus Schults -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 . -*/ - -#include -#include -#include -#include "matrix.h" -#include "util.h" -#include "print.h" -#include "debug.h" - -static uint8_t debouncing = DEBOUNCING_DELAY; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(void); -static uint8_t read_fwkey(void); -static void init_rows(void); -static void unselect_cols(void); -static void select_col(uint8_t col); - - -__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) { -} - -void matrix_init(void) { - DDRD |= 0b11010000; - PORTD &= ~0b01010000; - DDRB |= 0b00011111; - PORTB &= ~0b00001110; - PORTB |= 0b00010001; - DDRE |= 0b01000000; - PORTE &= ~0b01000000; - - unselect_cols(); - init_rows(); - - 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++) { - select_col(col); - _delay_us(3); - - uint8_t rows = read_rows(); - if(col == 0) { - rows |= read_fwkey(); - } - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< Date: Sun, 26 Aug 2018 12:33:43 -0400 Subject: Keymap: Made changes to buswerks ortho_4x12 keymap (#3757) * Added buswerks keymap * cleaned up comments on buswerks keymap * Added buswerks keymap readme.md * Fixed spelling in buswerks readme.md * Removed unnecessary includes, changed process_record_user to now use set_single_persistent_default_layer(), removed deprecated functions, and moved the audio ifdef block to config.h * Changed buswerks ortho_4x12 layout to accommodate 'MIT' layout * Updated README.md to reflect layout changes --- layouts/community/ortho_4x12/buswerks/keymap.c | 28 +++++++++++++++---------- layouts/community/ortho_4x12/buswerks/readme.md | 23 ++++++++++---------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c index 776ea461b7..c05c264183 100644 --- a/layouts/community/ortho_4x12/buswerks/keymap.c +++ b/layouts/community/ortho_4x12/buswerks/keymap.c @@ -15,6 +15,7 @@ enum custom_keycodes { DVORAK, LOWER, RAISE, + NAV, ADJUST, }; @@ -29,17 +30,22 @@ enum custom_keycodes { #define KC_RASE RAISE #define KC_ADJ ADJUST +#define DESK_L LCTL(KC_LEFT) +#define DESK_R LCTL(KC_RGHT) +#define MSN_CTL LCTL(KC_UP) +#define APP_WND LCTL(KC_DOWN) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_ortho_4x12( \ // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ + ESC_CMD, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K, KC_L , KC_SCLN, KC_QUOT, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), @@ -51,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), @@ -59,21 +65,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + ESC_CMD, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_LSFT, RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), [_LOWER] = LAYOUT_ortho_4x12( \ // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TILD, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_DEL, \ + KC_TILD, _______, KC_VOLD, MSN_CTL, KC_VOLU, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_BSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ + _______, _______, DESK_L , APP_WND, DESK_R , _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, KC_CIRC, KC_ASTR, KC_UNDS, KC_EQL, KC_AMPR, _______, KC_1, KC_2, KC_3, KC_SLSH, _______, \ + KC_LBRC, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_SLSH, KC_RBRC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' @@ -81,11 +87,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ortho_4x12( \ // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_GRV, _______, _______, KC_LPRN, KC_RPRN, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, KC_DEL, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, KC_LCBR, KC_RCBR, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_BSLS, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_BSLS, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, KC_LBRC, KC_RBRC, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + KC_LCBR, KC_CIRC, KC_ASTR, KC_UNDS, KC_EQL, KC_AMPR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_RCBR, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' diff --git a/layouts/community/ortho_4x12/buswerks/readme.md b/layouts/community/ortho_4x12/buswerks/readme.md index 452116423b..43c1aaf93b 100644 --- a/layouts/community/ortho_4x12/buswerks/readme.md +++ b/layouts/community/ortho_4x12/buswerks/readme.md @@ -5,24 +5,25 @@ For use on Planck, Let's Split, and similar keyboards ### Layout Overview - Main Layer - - An additional shift key is located on the right space key (only works for grid layouts) - Enter is located on the Raise key (layer-tap) - - The left and right shift keys function as Space Cadet shift keys + - Space Cadet shift keys + - Lower + shift keys = Brackets[] + - Raise + shift keys = Braces{} - The bottom left key is the Adjust modifier - Escape is in the traditional Caps Lock position - Holding down the escape key acts as LGUI (intended for macOS use) - Lower - There is a numpad on the right hand (4, 5, and 6 are located under JKL/NEI/HTN) - Plus and minus keys are located to the right of the numpad - - All other symbols are located on the other side of the keyboard, in a somewhat logical order - - Symbols from the number row are in order, starting on the left pinky. - - Equals and underscore are in easily accessible spots, because they are more commonly used in programming - - The ampersand is less common, so it is moved to the right of the equals symbol + - There are macOS desktop navigation keys and volume controls under the left hand + - Raise - Vim-style arrow keys - - Above the arrow keys are media controls - - Below are home, end, pgup, and pgdn - - The left hand has all three types of braces - - Curly braces are under the index and middle fingers for easy access during programming, and because parentheses are already available through Space Cadet shift + - Below the arrow keys are home, end, pgup, and pgdn + - Symbols are located on the right side of the keyboard, in a somewhat logical order + - Symbols from the number row are in order, starting on the left pinky. + - Equals and underscore are in easily accessible spots, since they're commonly used in programming + - The ampersand is less common, so it's to the right of the equals symbol + - Adjust - - Function keys are located along the top row (reset is moved to accommodate this) \ No newline at end of file + - Function keys are located along the top row (reset is moved to the Colemak 'R' position) \ No newline at end of file -- cgit v1.2.3 From 95e9ef27be883cf57572ec1c8787b716fc3753da Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Sun, 26 Aug 2018 11:59:52 -0700 Subject: add linebreaks to "Keyboard Maintainer:..." blocks where missing (#3763) --- keyboards/converter/usb_usb/README.md | 4 ++-- keyboards/facew/readme.md | 4 ++-- keyboards/handwired/not_so_minidox/readme.md | 2 +- keyboards/infinity60/readme.md | 4 ++-- keyboards/jd40/readme.md | 4 ++-- keyboards/jd45/readme.md | 4 ++-- keyboards/jm60/readme.md | 4 ++-- keyboards/minidox/readme.md | 2 +- keyboards/mint60/readme.md | 2 +- keyboards/pegasushoof/README.md | 4 ++-- keyboards/phantom/readme.md | 4 ++-- keyboards/planck/readme.md | 4 ++-- keyboards/redox/readme.md | 4 ++-- keyboards/roadkit/readme.md | 4 ++-- keyboards/s60_x/readme.md | 4 ++-- keyboards/scrabblepad/readme.md | 2 +- keyboards/singa/readme.md | 4 ++-- keyboards/sx60/readme.md | 4 ++-- keyboards/the_ruler/readme.md | 4 ++-- keyboards/tv44/readme.md | 4 ++-- keyboards/v60_type_r/readme.md | 4 ++-- keyboards/vision_division/readme.md | 4 ++-- keyboards/xd60/readme.md | 4 ++-- 23 files changed, 42 insertions(+), 42 deletions(-) diff --git a/keyboards/converter/usb_usb/README.md b/keyboards/converter/usb_usb/README.md index b529fbd28d..faee7a5fd8 100644 --- a/keyboards/converter/usb_usb/README.md +++ b/keyboards/converter/usb_usb/README.md @@ -3,8 +3,8 @@ USB to USB keyboard protocol converter A small device to connect between your USB keyboard and your PC that makes (almost) every keyboard fully programmable. Original code from the [TMK firmware](https://github.com/tmk/tmk_keyboard/tree/master/converter/usb_usb). Ported to QMK by [Balz Guenat](https://github.com/BalzGuenat). -Keyboard Maintainer: [Balz Guenat](https://github.com/BalzGuenat) -Hardware Supported: [Hasu's USB-USB converter](https://geekhack.org/index.php?topic=69169.0), [Pro Micro + USB Host Shield](https://geekhack.org/index.php?topic=80421.0), maybe more +Keyboard Maintainer: [Balz Guenat](https://github.com/BalzGuenat) +Hardware Supported: [Hasu's USB-USB converter](https://geekhack.org/index.php?topic=69169.0), [Pro Micro + USB Host Shield](https://geekhack.org/index.php?topic=80421.0), maybe more Hardware Availability: [GH thread](https://geekhack.org/index.php?topic=72052.0), self-built Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/facew/readme.md b/keyboards/facew/readme.md index f948e7a46f..6d7186704b 100644 --- a/keyboards/facew/readme.md +++ b/keyboards/facew/readme.md @@ -7,8 +7,8 @@ but does have in switch LEDs. Also unlike the B.Face, it is based on ps2avru ins is designed and manufactured in Korea. It originally uses BootMapperClient for programming but can now also use QMK. -Keyboard Maintainer: [MechMerlin](www.github.com/mechmerlin) -Hardware Supported: FaceW Sprit Edition PCB +Keyboard Maintainer: [MechMerlin](www.github.com/mechmerlin) +Hardware Supported: FaceW Sprit Edition PCB Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=1352 ## Keyboard Notes diff --git a/keyboards/handwired/not_so_minidox/readme.md b/keyboards/handwired/not_so_minidox/readme.md index fbfa7b7be0..22d3558735 100644 --- a/keyboards/handwired/not_so_minidox/readme.md +++ b/keyboards/handwired/not_so_minidox/readme.md @@ -5,7 +5,7 @@ not_so_minidox A slightly larger version of the MiniDox -Keyboard Maintainer: mtdjr +Keyboard Maintainer: mtdjr Hardware Supported: None yet/ProMicro Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/infinity60/readme.md b/keyboards/infinity60/readme.md index 94f65d370f..e77abca642 100644 --- a/keyboards/infinity60/readme.md +++ b/keyboards/infinity60/readme.md @@ -3,8 +3,8 @@ Infinity 60% A compact community driven keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: Infinity 60% PCB +Keyboard Maintainer: QMK Community +Hardware Supported: Infinity 60% PCB Hardware Availability: https://input.club/devices/infinity-keyboard/ Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/jd40/readme.md b/keyboards/jd40/readme.md index c5ab42ed05..f70bd9107d 100644 --- a/keyboards/jd40/readme.md +++ b/keyboards/jd40/readme.md @@ -3,8 +3,8 @@ JD40 A compact 40% keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: JD40 PCB +Keyboard Maintainer: QMK Community +Hardware Supported: JD40 PCB Hardware Availability: [1up](https://1upkeyboards.com/jd40-mkii-1up-keyboards-logo-pcb.html) [mechanicalkeyboards.com](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=2452) [originative](https://www.originativeco.com/products/jd40-pcb) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/jd45/readme.md b/keyboards/jd45/readme.md index a2e4cf6dd4..d85a521269 100644 --- a/keyboards/jd45/readme.md +++ b/keyboards/jd45/readme.md @@ -3,8 +3,8 @@ JD45 A compact 45% keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: JD45 PCB +Keyboard Maintainer: QMK Community +Hardware Supported: JD45 PCB Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_list&c=346 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/jm60/readme.md b/keyboards/jm60/readme.md index 3ba96ed603..b513a2c4c0 100644 --- a/keyboards/jm60/readme.md +++ b/keyboards/jm60/readme.md @@ -3,8 +3,8 @@ JM60 A compact 60% keyboard with full RGB led support. -Keyboard Maintainer: QMK Community -Hardware Supported: JM60 +Keyboard Maintainer: QMK Community +Hardware Supported: JM60 Hardware Availability: https://kbdfans.myshopify.com/ (is no longer sold) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/minidox/readme.md b/keyboards/minidox/readme.md index b44d66660b..859504a43d 100644 --- a/keyboards/minidox/readme.md +++ b/keyboards/minidox/readme.md @@ -5,7 +5,7 @@ MiniDox A compact version of the ErgoDox -Keyboard Maintainer: That-Canadian +Keyboard Maintainer: That-Canadian Hardware Supported: MiniDox PCB rev1 Pro Micro Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/mint60/readme.md b/keyboards/mint60/readme.md index c425b213ba..b8ae720f5b 100644 --- a/keyboards/mint60/readme.md +++ b/keyboards/mint60/readme.md @@ -4,7 +4,7 @@ A short description of the keyboard/project -Keyboard Maintainer: [Eucalyn](https://github.com/eucalyn) [@eucalyn_](https://twitter.com/eucalyn_) +Keyboard Maintainer: [Eucalyn](https://github.com/eucalyn) [@eucalyn_](https://twitter.com/eucalyn_) Hardware Supported: The Mint60 PCBs, ProMicro supported Hardware Availability: links to where you can find this hardware diff --git a/keyboards/pegasushoof/README.md b/keyboards/pegasushoof/README.md index b57191c0f6..debf7f7372 100644 --- a/keyboards/pegasushoof/README.md +++ b/keyboards/pegasushoof/README.md @@ -1,8 +1,8 @@ Pegasus Hoof Controller === -Keyboard Maintainer: QMK Community -Hardware Supported: Pegasus Hoof +Keyboard Maintainer: QMK Community +Hardware Supported: Pegasus Hoof Hardware Availability: https://1upkeyboards.com/filco-pegasus-hoof-controller.html Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/phantom/readme.md b/keyboards/phantom/readme.md index 1ac1363270..c0cb3bc20d 100644 --- a/keyboards/phantom/readme.md +++ b/keyboards/phantom/readme.md @@ -5,8 +5,8 @@ A community-developed keyboard PCB designed to fit inside the case of a Filco Ma See the [Deskthority wiki](https://deskthority.net/wiki/Phantom) for more information. -Keyboard Maintainer: QMK Community -Hardware Supported: Phantom PCB +Keyboard Maintainer: QMK Community +Hardware Supported: Phantom PCB Hardware Availability: https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=536 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md index 08617322e3..f857c546cc 100644 --- a/keyboards/planck/readme.md +++ b/keyboards/planck/readme.md @@ -5,8 +5,8 @@ Planck A compact 40% (12x4) ortholinear keyboard kit made and sold by OLKB and Massdrop. [More info on qmk.fm](http://qmk.fm/planck/) -Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) -Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0 +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: Planck PCB rev1, rev2, rev3, rev4, Teensy 2.0 Hardware Availability: [OLKB.com](https://olkb.com), [Massdrop](https://www.massdrop.com/buy/planck-mechanical-keyboard?mode=guest_open) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/redox/readme.md b/keyboards/redox/readme.md index 6e1d980a7a..8a2fc4b04c 100644 --- a/keyboards/redox/readme.md +++ b/keyboards/redox/readme.md @@ -10,8 +10,8 @@ **Redox**: the **R**educed **E**rgo**dox** project. More information and building instruction [here](https://github.com/mattdibi/redox-keyboard). -- Keyboard Maintainer: [Mattia Dal Ben](https://github.com/mattdibi) -- Hardware Supported: Redox PCB rev1.0 w/ Pro Micro +- Keyboard Maintainer: [Mattia Dal Ben](https://github.com/mattdibi) +- Hardware Supported: Redox PCB rev1.0 w/ Pro Micro - Hardware Availability: [Falbatech](https://falba.tech/product-category/keyboard-parts/redox-parts/) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/roadkit/readme.md b/keyboards/roadkit/readme.md index 245d5242ae..691bd1f3e9 100644 --- a/keyboards/roadkit/readme.md +++ b/keyboards/roadkit/readme.md @@ -3,8 +3,8 @@ roadkit A programmable macro pad. -Keyboard Maintainer: QMK Community -Hardware Supported: Roadkit PCB +Keyboard Maintainer: QMK Community +Hardware Supported: Roadkit PCB Hardware Availability: https://thevankeyboards.com/collections/catalog/products/road-kit-diy?variant=603645345806 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/s60_x/readme.md b/keyboards/s60_x/readme.md index 1a309e4fe8..ddb0d4ba66 100644 --- a/keyboards/s60_x/readme.md +++ b/keyboards/s60_x/readme.md @@ -2,8 +2,8 @@ S60-x ===== DIY compact keyboard designed by VinnyCordeiro for Sentraq. Most of the keymaps are based on GH60 code. This is a port from TMK to QMK based on the [original S60-X Repo](https://github.com/VinnyCordeiro/tmk_keyboard). -Keyboard Maintainer: QMK Community -Hardware Supported: S60-x PCB +Keyboard Maintainer: QMK Community +Hardware Supported: S60-x PCB Hardware Availability: https://www.massdrop.com/buy/sentraq-60-diy-keyboard-kit?mode=guest_open There are two versions of this keyboard, an RGB and a non RGB one. diff --git a/keyboards/scrabblepad/readme.md b/keyboards/scrabblepad/readme.md index 6b2d2ec5e5..e434eef950 100644 --- a/keyboards/scrabblepad/readme.md +++ b/keyboards/scrabblepad/readme.md @@ -6,7 +6,7 @@ the XDA Scrabble Board sold by [Novelkeys](https://novelkeys.xyz). It uses a [Teensy++ 2.0](https://www.pjrc.com/store/teensypp.html) featuring an at90usb1286 8 bit microcontroller. Usage requires modifying the Teensy by removing the LED on pin D6. -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Donut Cables](https://donutcables.com/) +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Donut Cables](https://donutcables.com/) Hardware Supported: Teensy++ 2.0 and ScrabblePad PCB Hardware Availability: [Donut Cables](https://donutcables.com/) diff --git a/keyboards/singa/readme.md b/keyboards/singa/readme.md index 09b540722e..7a374db25c 100644 --- a/keyboards/singa/readme.md +++ b/keyboards/singa/readme.md @@ -7,8 +7,8 @@ A short description of the keyboard/project -Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287) -Hardware Supported: TGR-Elaine v1.0 PCB +Keyboard Maintainer: [amnesia0287](https://github.com/amnesia0287) +Hardware Supported: TGR-Elaine v1.0 PCB Hardware Availability: http://singakbd.com/ diff --git a/keyboards/sx60/readme.md b/keyboards/sx60/readme.md index 40f33ada2f..4b7f9e74a4 100644 --- a/keyboards/sx60/readme.md +++ b/keyboards/sx60/readme.md @@ -5,8 +5,8 @@ SX60 ![SX60](https://i.imgur.com/hZZHrRr.jpg) -Keyboard Maintainer: [amnobis](https://github.com/amnobis) -Hardware Supported: SX60 +Keyboard Maintainer: [amnobis](https://github.com/amnobis) +Hardware Supported: SX60 Hardware Availability: [geekhack.org/index.php?topic=93665.0](https://geekhack.org/index.php?topic=93665.0) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/the_ruler/readme.md b/keyboards/the_ruler/readme.md index cc1f817de5..3573514b68 100644 --- a/keyboards/the_ruler/readme.md +++ b/keyboards/the_ruler/readme.md @@ -3,8 +3,8 @@ The Ruler PCB A custom keyboard PCB ruler, that can also function as a macro pad -Keyboard Maintainer: Maple Computing -Hardware Supported: PCB Ruler V1 by That-Canadian and Bishop Keyboards +Keyboard Maintainer: Maple Computing +Hardware Supported: PCB Ruler V1 by That-Canadian and Bishop Keyboards Hardware Availability: https://www.maple-computing.com/products/pcb-ruler-v1-1 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/tv44/readme.md b/keyboards/tv44/readme.md index f23ca0da52..28185f455b 100644 --- a/keyboards/tv44/readme.md +++ b/keyboards/tv44/readme.md @@ -3,8 +3,8 @@ The Van 44 A compact 44% keyboard. -Keyboard Maintainer: QMK Community -Hardware Supported: The Van PCB +Keyboard Maintainer: QMK Community +Hardware Supported: The Van PCB Hardware Availability: https://thevankeyboards.com/collections/catalog/products/minivan-diy?variant=609138376718 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/v60_type_r/readme.md b/keyboards/v60_type_r/readme.md index 5065ca1062..c7039c2e70 100644 --- a/keyboards/v60_type_r/readme.md +++ b/keyboards/v60_type_r/readme.md @@ -28,8 +28,8 @@ Note: By default the V60 Type R uses TMK. You should know what you're doing and You will then have to use tkg-toolkit to finish the flashing -Keyboard Maintainer: QMK Community -Hardware Supported: KBP V60 Type R PCB +Keyboard Maintainer: QMK Community +Hardware Supported: KBP V60 Type R PCB Hardware Availability: [mechanicalkeyboards.com](https://mechanicalkeyboards.com/search.php?keyword=kbp+v60+type+r), [Massdrop](https://www.massdrop.com/buy/kbparadise-v60-type-r-mechanical-keyboard) Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/vision_division/readme.md b/keyboards/vision_division/readme.md index 058629db3e..350ced3340 100644 --- a/keyboards/vision_division/readme.md +++ b/keyboards/vision_division/readme.md @@ -3,8 +3,8 @@ Vision Division Full Size / Split Linear Keyboard PCB -Keyboard Maintainer: QMK Community -Hardware Supported: Vision Division PCB +Keyboard Maintainer: QMK Community +Hardware Supported: Vision Division PCB Hardware Availability: https://geekhack.org/index.php?topic=83692.msg2227856#msg2227856 Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/xd60/readme.md b/keyboards/xd60/readme.md index 389423ed0e..19c22dac64 100644 --- a/keyboards/xd60/readme.md +++ b/keyboards/xd60/readme.md @@ -5,8 +5,8 @@ Compact 60% with arrows. ![Top View of a pair of XD60 Keyboard](https://i.imgur.com/3Jq2743.jpg) -Keyboard Maintainer: QMK Community -Hardware Supported: XD60 PCB +Keyboard Maintainer: QMK Community +Hardware Supported: XD60 PCB Hardware Availability: https://www.massdrop.com/buy/xd60-xd64-custom-mechanical-keyboard-kit?mode=guest_open Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From c63d9ee0d563228f1b5b7e1f1f54a5b541a90429 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Sun, 26 Aug 2018 12:00:22 -0700 Subject: mitosis: minor readme improvements (#3762) * minor improvements to top-level mitosis keyboard readme * typo * trivial readme change --- keyboards/mitosis/keymaps/datagrok/readme.md | 2 +- keyboards/mitosis/readme.md | 25 +++++++++++++++---------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/keyboards/mitosis/keymaps/datagrok/readme.md b/keyboards/mitosis/keymaps/datagrok/readme.md index 176e0f411e..9b159b98a0 100644 --- a/keyboards/mitosis/keymaps/datagrok/readme.md +++ b/keyboards/mitosis/keymaps/datagrok/readme.md @@ -67,7 +67,7 @@ Keyboard layout editor sources: - I like the way Workman feels and some of its advantages over Colemak. Unfortunately, it was designed using a weighting system based on a standard - column-staggered keyboard so is probably not as optimal as one could achieve + row-staggered keyboard so is probably not as optimal as one could achieve on an ergonomic board like the Mitosis. Maybe run an optimizer routine after I determine good values for key difficulty on the Mitosis. diff --git a/keyboards/mitosis/readme.md b/keyboards/mitosis/readme.md index 0d5a74a1dc..e1b0711019 100644 --- a/keyboards/mitosis/readme.md +++ b/keyboards/mitosis/readme.md @@ -1,11 +1,12 @@ -Mitosis -======= +# Mitosis + +![Mitosis](https://i.imgur.com/JTzXTCD.jpg) A wireless split compact keyboard. -Keyboard Maintainer: [@reversebias](https://github.com/reversebias) -Hardware Supported: Mitosis PCB -Hardware Availability: https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/ +Keyboard Maintainer: [@reversebias](https://github.com/reversebias) +Hardware Supported: Mitosis PCB +Hardware Availability: See the [Mitosis keyboard announcement and discussion](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/) Make example for this keyboard (after setting up your build environment): @@ -13,12 +14,16 @@ Make example for this keyboard (after setting up your build environment): See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -## Mitosis Notes +## Notes + +Some circuit board manufacturers including [DirtyPCBs](https://dirtypcbs.com/) and [PCBWay](https://www.pcbway.com/) offer a steeply discounted "prototyping" rate for a small quantity of identical circuit boards less than 100x100mm in size. The Mitosis was designed to take advantage of this, so that individuals might affordably manufacture their own without waiting for a group-buy. + +These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. -These configuration files were based off the Atreus keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported. +This keyboard uses a completely different 'matrix scan' system than most other keyboards supported by QMK. Here, QMK runs in a Pro Micro on a receiver module, and communicates only with an nRF51822 microcontroller module that in turn does wireless communication. The nRF51822 maintains a matrix of keystates received from the same microcontrollers on each of the keyboard halves. The matrix.c file contains the code to make the Pro Micro poll the external wireless microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported. -Build log of the keyboard can be found [here](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/) +[Mitosis keyboard build log](https://imgur.com/a/mwTFj), including many photos and notes about the assembly process. -Hardware design files can be found [here](https://github.com/reversebias/mitosis-hardware) +[Mitosis keyboard hardware design files](https://github.com/reversebias/mitosis-hardware), including PCB schematics and manufacturing files, parts list, and a laser-cutting template for the neoprene base. -Firmware for the nordic MCUs can be found [here](https://github.com/reversebias/mitosis) +[Mitosis keyboard wireless firmware](https://github.com/reversebias/mitosis) for the Nordic microcontrollers. -- cgit v1.2.3 From 2410f023598af65a551b42f569a2703a5621bdca Mon Sep 17 00:00:00 2001 From: ishtob Date: Mon, 27 Aug 2018 17:10:22 -0400 Subject: Fixes STM32F303XC timer issue for Planck Rev 6 (#3777) * Adding my personal planck keymap * Adding readme.md to my keymap * Create my userspace add users/ishtob/ * Moved macros off keymap macros now exsists in my userspace, moved them off keyboard specific keymaps * Create my userspace add users/ishtob/ * rebase from main QMK repo * fixed compile error with planck rev6 keymap * fixed compile error with planck rev6 keymap * Revert "Merge branch 'master' of https://github.com/ishtob/qmk_firmware" This reverts commit 6c8a9a6eec7ec311802338ea361099612182465d, reversing changes made to 5c598d9a53a7f794d5be283ac40ca97631ae5578. * fixed issue where compile errors if private macro file is not present * Revert "fixed issue where compile errors if private macro file is not present" This reverts commit e0035df48ffb9a95aa94e8339c58ef539e0449cf. * Fixed STM32 timer issue with Planck Rev6 with tap mods * Revert "fixed compile error with planck rev6 keymap" This reverts commit 5c598d9a53a7f794d5be283ac40ca97631ae5578. * Revert "Revert "fixed compile error with planck rev6 keymap"" This reverts commit c36896ca718f8b9bb3c653d7532797e9129477e3. * Fixed compile issues with my personal userspace and keymap utilizing the userspace --- keyboards/planck/keymaps/ishtob/keymap.c | 2 ++ keyboards/planck/keymaps/ishtob/rule.mk | 1 - keyboards/planck/rev6/chconf.h | 4 ++-- keyboards/planck/rev6/halconf.h | 2 +- keyboards/planck/rev6/mcuconf.h | 2 +- users/ishtob/rules.mk | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index 36720c4c3e..86c5555da3 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -327,7 +327,9 @@ void matrix_init_keymap(void) { void startup_user() { + #ifdef RGB_MATRIX_ENABLE rgblight_mode(RGB_MATRIX_CYCLE_ALL); + #endif //RGB_matrix wait_ms(20); // gets rid of tick PLAY_NOTE_ARRAY(tone_startup, false, 0); } diff --git a/keyboards/planck/keymaps/ishtob/rule.mk b/keyboards/planck/keymaps/ishtob/rule.mk index c8940c3b40..c0d38aaa14 100755 --- a/keyboards/planck/keymaps/ishtob/rule.mk +++ b/keyboards/planck/keymaps/ishtob/rule.mk @@ -12,7 +12,6 @@ COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = yes # USB Nkey Rollover CUSTOM_MATRIX = yes # Custom matrix file AUDIO_ENABLE = yes -RGB_MATRIX_ENABLE = yes ENCODER_ENABLE = yes # SERIAL_LINK_ENABLE = yes diff --git a/keyboards/planck/rev6/chconf.h b/keyboards/planck/rev6/chconf.h index b52ca7d2c8..1d9f12ff1f 100644 --- a/keyboards/planck/rev6/chconf.h +++ b/keyboards/planck/rev6/chconf.h @@ -41,14 +41,14 @@ * @brief System time counter resolution. * @note Allowed values are 16 or 32 bits. */ -#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_RESOLUTION 32 /** * @brief System tick frequency. * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#define CH_CFG_ST_FREQUENCY 10000 +#define CH_CFG_ST_FREQUENCY 100000 /** * @brief Time delta constant for the tick-less mode. diff --git a/keyboards/planck/rev6/halconf.h b/keyboards/planck/rev6/halconf.h index 5e5d70219e..8fe8e0c6f5 100644 --- a/keyboards/planck/rev6/halconf.h +++ b/keyboards/planck/rev6/halconf.h @@ -111,7 +111,7 @@ * @brief Enables the PWM subsystem. */ #if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) -#define HAL_USE_PWM TRUE +#define HAL_USE_PWM FALSE #endif /** diff --git a/keyboards/planck/rev6/mcuconf.h b/keyboards/planck/rev6/mcuconf.h index 2d27bee4e6..7c3c6e570c 100644 --- a/keyboards/planck/rev6/mcuconf.h +++ b/keyboards/planck/rev6/mcuconf.h @@ -225,7 +225,7 @@ * ST driver system settings. */ #define STM32_ST_IRQ_PRIORITY 8 -#define STM32_ST_USE_TIMER 4 +#define STM32_ST_USE_TIMER 2 /* * UART driver system settings. diff --git a/users/ishtob/rules.mk b/users/ishtob/rules.mk index d19e952667..909502b50a 100755 --- a/users/ishtob/rules.mk +++ b/users/ishtob/rules.mk @@ -1,5 +1,5 @@ SRC += ishtob.c -ifneq ($(wildcard $(USER_PATH)/macros_private.c),"") +ifneq ("$(wildcard $(USER_PATH)/macros_private.c)","") SRC += macros_private.c endif ifeq ($(strip $(NO_SECRETS)), yes) -- cgit v1.2.3 From fdd0f915271f79b104aa5d216566bcc3fd134e85 Mon Sep 17 00:00:00 2001 From: yiancar Date: Tue, 28 Aug 2018 16:03:11 +0300 Subject: ISSI31FL3733 driver (#3679) * ISSI31FL3733 driver - Addapted IS31 driver for the above driver * fix my branch * ISSI31FL3733 driver - Inclusion of above ISSI led driver * IS31fl3733 driver - Added correct function for control registers * Finalized support for ISSI31fl3733 led driver - Finalized and tested driver. - Modified i2c_master for arm due to declaration mistake. - Fixed spaces/tabs in quantum.h file. - Fixed spaces/tabs in common_features.mk file. - Removed unnecessary includes from rgb_matrix.c file. - Added local definitions for MIN and MAX macros in rgb_matrix.c file. - Adjusted chevron effect. - Added necessary define (RGB_3733_MATRIX_ENABLE) for makefile. - Added necessary C define (ISSI3733) to aid with inclusion of the correct header file. - Added documentation for the new driver. * Driver structure update - Changed rule includes to be more condensed (RGB_MATRIX_ENABLE = IS31FL3731) and (RGB_MATRIX_ENABLE = IS31FL3733) - Updated documentation - Reverted to the use of differently named functions for each driver and selecting the needed ones within rgb_matrix.c * ISSI Drivers refractoring - Moved issi drivers in a dedicated folder - Updated documentation * I2C library fix I released the special pins incorrectly before. It is now fixed. --- common_features.mk | 40 +++++-- docs/feature_rgb_matrix.md | 52 ++++++++- docs/hardware_drivers.md | 6 +- drivers/arm/i2c_master.c | 13 ++- drivers/arm/i2c_master.h | 4 +- drivers/is31fl3731.c | 271 --------------------------------------------- drivers/is31fl3731.h | 214 ----------------------------------- drivers/issi/is31fl3731.c | 271 +++++++++++++++++++++++++++++++++++++++++++++ drivers/issi/is31fl3731.h | 214 +++++++++++++++++++++++++++++++++++ drivers/issi/is31fl3733.c | 253 ++++++++++++++++++++++++++++++++++++++++++ drivers/issi/is31fl3733.h | 255 ++++++++++++++++++++++++++++++++++++++++++ quantum/quantum.h | 40 +++---- quantum/rgb_matrix.c | 68 +++++++++--- quantum/rgb_matrix.h | 8 +- 14 files changed, 1169 insertions(+), 540 deletions(-) delete mode 100644 drivers/is31fl3731.c delete mode 100644 drivers/is31fl3731.h create mode 100644 drivers/issi/is31fl3731.c create mode 100644 drivers/issi/is31fl3731.h create mode 100644 drivers/issi/is31fl3733.c create mode 100644 drivers/issi/is31fl3733.h diff --git a/common_features.mk b/common_features.mk index b78f04d2a8..e0d4ca297c 100644 --- a/common_features.mk +++ b/common_features.mk @@ -61,8 +61,8 @@ endif ifeq ($(strip $(STENO_ENABLE)), yes) OPT_DEFS += -DSTENO_ENABLE - VIRTSER_ENABLE := yes - SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c + VIRTSER_ENABLE := yes + SRC += $(QUANTUM_DIR)/process_keycode/process_steno.c endif ifeq ($(strip $(VIRTSER_ENABLE)), yes) @@ -75,9 +75,9 @@ ifeq ($(strip $(FAUXCLICKY_ENABLE)), yes) endif ifeq ($(strip $(POINTING_DEVICE_ENABLE)), yes) - OPT_DEFS += -DPOINTING_DEVICE_ENABLE - OPT_DEFS += -DMOUSE_ENABLE - SRC += $(QUANTUM_DIR)/pointing_device.c + OPT_DEFS += -DPOINTING_DEVICE_ENABLE + OPT_DEFS += -DMOUSE_ENABLE + SRC += $(QUANTUM_DIR)/pointing_device.c endif ifeq ($(strip $(UCIS_ENABLE)), yes) @@ -110,12 +110,14 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) ifeq ($(strip $(RGBLIGHT_CUSTOM_DRIVER)), yes) OPT_DEFS += -DRGBLIGHT_CUSTOM_DRIVER else - SRC += ws2812.c + SRC += ws2812.c endif endif ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) OPT_DEFS += -DRGB_MATRIX_ENABLE + OPT_DEFS += -DIS31FL3731 + COMMON_VPATH += $(DRIVER_PATH)/issi SRC += is31fl3731.c SRC += i2c_master.c SRC += $(QUANTUM_DIR)/color.c @@ -123,6 +125,28 @@ ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) CIE1931_CURVE = yes endif +ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731) + OPT_DEFS += -DRGB_MATRIX_ENABLE + OPT_DEFS += -DIS31FL3731 + COMMON_VPATH += $(DRIVER_PATH)/issi + SRC += is31fl3731.c + SRC += i2c_master.c + SRC += $(QUANTUM_DIR)/color.c + SRC += $(QUANTUM_DIR)/rgb_matrix.c + CIE1931_CURVE = yes +endif + +ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) + OPT_DEFS += -DRGB_MATRIX_ENABLE + OPT_DEFS += -DIS31FL3733 + COMMON_VPATH += $(DRIVER_PATH)/issi + SRC += is31fl3733.c + SRC += i2c_master.c + SRC += $(QUANTUM_DIR)/color.c + SRC += $(QUANTUM_DIR)/rgb_matrix.c + CIE1931_CURVE = yes +endif + ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) OPT_DEFS += -DTAP_DANCE_ENABLE SRC += $(QUANTUM_DIR)/process_keycode/process_tap_dance.c @@ -169,7 +193,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) ifeq ($(strip $(VISUALIZER_ENABLE)), yes) CIE1931_CURVE = yes endif - ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) + ifeq ($(strip $(BACKLIGHT_CUSTOM_DRIVER)), yes) OPT_DEFS += -DBACKLIGHT_CUSTOM_DRIVER endif endif @@ -200,7 +224,7 @@ endif ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += drivers/avr/hd44780.c - OPT_DEFS += -DHD44780_ENABLE + OPT_DEFS += -DHD44780_ENABLE endif QUANTUM_SRC:= \ diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index ed33c7ea4e..4f827f8dc9 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -1,8 +1,12 @@ # RGB Matrix Lighting +## Driver configuration + +### IS31FL3731 + There is basic support for addressable RGB matrix lighting with the I2C IS31FL3731 RGB controller. To enable it, add this to your `rules.mk`: - RGB_MATRIX_ENABLE = yes + RGB_MATRIX_ENABLE = IS31FL3731 Configure the hardware via your `config.h`: @@ -36,7 +40,51 @@ Define these arrays listing all the LEDs in your `.c`: .... } -Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf). The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). +Where `Cx_y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3731.pdf) and the header file `drivers/issi/is31fl3731.h`. The `driver` is the index of the driver you defined in your `config.h` (`0` or `1` right now). + +### IS31FL3733 + +There is basic support for addressable RGB matrix lighting with the I2C IS31FL3733 RGB controller. To enable it, add this to your `rules.mk`: + + RGB_MATRIX_ENABLE = IS31FL3733 + +Configure the hardware via your `config.h`: + + // This is a 7-bit address, that gets left-shifted and bit 0 + // set to 0 for write, 1 for read (as per I2C protocol) + // The address will vary depending on your wiring: + // 00 <-> GND + // 01 <-> SCL + // 10 <-> SDA + // 11 <-> VCC + // ADDR1 represents A1:A0 of the 7-bit address. + // ADDR2 represents A3:A2 of the 7-bit address. + // The result is: 0b101(ADDR2)(ADDR1) + #define DRIVER_ADDR_1 0b1010000 + #define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + + #define DRIVER_COUNT 1 + #define DRIVER_1_LED_TOTAL 64 + #define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + +Currently only a single drivers is supported, but it would be trivial to support all 4 combinations. For now define `DRIVER_ADDR_2` as `DRIVER_ADDR_1` + +Define these arrays listing all the LEDs in your `.c`: + + const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { + /* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, + .... + } + +Where `X_Y` is the location of the LED in the matrix defined by [the datasheet](http://www.issi.com/WW/pdf/31FL3733.pdf) and the header file `drivers/issi/is31fl3733.h`. The `driver` is the index of the driver you defined in your `config.h` (Only `0` right now). + +From this point forward the configuration is the same for all the drivers. const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /* {row | col << 4} diff --git a/docs/hardware_drivers.md b/docs/hardware_drivers.md index 336bc908ef..4c1266f224 100644 --- a/docs/hardware_drivers.md +++ b/docs/hardware_drivers.md @@ -26,6 +26,10 @@ You can make use of uGFX within QMK to drive character and graphic LCD's, LED ar Support for WS2811/WS2812{a,b,c} LED's. For more information see the [RGB Light](feature_rgblight.md) page. -## IS31FL3731 (AVR Only) +## IS31FL3731 Support for up to 2 drivers. Each driver impliments 2 charlieplex matrices to individually address LEDs using I2C. This allows up to 144 same color LEDs or 32 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. + +## IS31FL3733 + +Support for up to a single driver with room for expansion. Each driver can control 192 individual LEDs or 64 RGB LEDs. For more information on how to setup the driver see the [RGB Matrix](feature_rgb_matrix.md) page. \ No newline at end of file diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 2fdd9f65e1..2a7badd351 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -/* This library follows the convention of the AVR i2c_master library. +/* This library is only valid for STM32 processors. + * This library follows the convention of the AVR i2c_master library. * As a result addresses are expected to be already shifted (addr << 1). * I2CD1 is the default driver which corresponds to pins B6 and B7. This * can be changed. * Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that - * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. + * STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used + * but using any other I2C pins should be trivial. */ #include "i2c_master.h" @@ -41,7 +43,7 @@ static const I2CConfig i2cconfig = { void i2c_init(void) { - palSetGroupMode(GPIOB,6,7, PAL_MODE_INPUT); // Try releasing special pins for a short time + palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time chThdSleepMilliseconds(10); palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); @@ -82,12 +84,12 @@ uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t l { complete_packet[i+1] = data[i]; } - complete_packet[0] = regaddr + complete_packet[0] = regaddr; return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout)); } -uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) +uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout) { i2c_address = devaddr; i2cStart(&I2C_DRIVER, &i2cconfig); @@ -97,7 +99,6 @@ uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t le // This is usually not needed. It releases the driver to allow pins to become GPIO again. uint8_t i2c_stop(uint16_t timeout) { - i2c_address = address; i2cStop(&I2C_DRIVER); return 0; } diff --git a/drivers/arm/i2c_master.h b/drivers/arm/i2c_master.h index 9d51245be1..591fa7f77d 100644 --- a/drivers/arm/i2c_master.h +++ b/drivers/arm/i2c_master.h @@ -35,5 +35,5 @@ uint8_t i2c_start(uint8_t address); uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); -void i2c_stop(void); +uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout); +uint8_t i2c_stop(uint16_t timeout); diff --git a/drivers/is31fl3731.c b/drivers/is31fl3731.c deleted file mode 100644 index 0524feb49f..0000000000 --- a/drivers/is31fl3731.c +++ /dev/null @@ -1,271 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * - * 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 . - */ - -#ifdef __AVR__ -#include -#include -#include -#else -#include "wait.h" -#endif - -#include "is31fl3731.h" -#include -#include "i2c_master.h" -#include "progmem.h" - -// This is a 7-bit address, that gets left-shifted and bit 0 -// set to 0 for write, 1 for read (as per I2C protocol) -// The address will vary depending on your wiring: -// 0b1110100 AD <-> GND -// 0b1110111 AD <-> VCC -// 0b1110101 AD <-> SCL -// 0b1110110 AD <-> SDA -#define ISSI_ADDR_DEFAULT 0x74 - -#define ISSI_REG_CONFIG 0x00 -#define ISSI_REG_CONFIG_PICTUREMODE 0x00 -#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 -#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 - -#define ISSI_CONF_PICTUREMODE 0x00 -#define ISSI_CONF_AUTOFRAMEMODE 0x04 -#define ISSI_CONF_AUDIOMODE 0x08 - -#define ISSI_REG_PICTUREFRAME 0x01 - -#define ISSI_REG_SHUTDOWN 0x0A -#define ISSI_REG_AUDIOSYNC 0x06 - -#define ISSI_COMMANDREGISTER 0xFD -#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' - -#ifndef ISSI_TIMEOUT - #define ISSI_TIMEOUT 100 -#endif - -#ifndef ISSI_PERSISTENCE - #define ISSI_PERSISTENCE 0 -#endif - -// Transfer buffer for TWITransmitData() -uint8_t g_twi_transfer_buffer[20]; - -// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. -// Storing them like this is optimal for I2C transfers to the registers. -// We could optimize this and take out the unused registers from these -// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's -// probably not worth the extra complexity. -uint8_t g_pwm_buffer[DRIVER_COUNT][144]; -bool g_pwm_buffer_update_required = false; - -uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; -bool g_led_control_registers_update_required = false; - -// This is the bit pattern in the LED control registers -// (for matrix A, add one to register for matrix B) -// -// reg - b7 b6 b5 b4 b3 b2 b1 b0 -// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 -// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 -// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 -// 0x06 - - , - , - , - , - ,B02,B01,B00 -// 0x08 - - , - , - , - , - , - , - , - -// 0x0A - B17,B16,B15, - , - , - , - , - -// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 -// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 -// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 - - -void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data ) -{ - g_twi_transfer_buffer[0] = reg; - g_twi_transfer_buffer[1] = data; - - #if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) - break; - } - #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); - #endif -} - -void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) -{ - // assumes bank is already selected - - // transmit PWM registers in 9 transfers of 16 bytes - // g_twi_transfer_buffer[] is 20 bytes - - // iterate over the pwm_buffer contents at 16 byte intervals - for ( int i = 0; i < 144; i += 16 ) { - // set the first register, e.g. 0x24, 0x34, 0x44, etc. - g_twi_transfer_buffer[0] = 0x24 + i; - // copy the data from i to i+15 - // device will auto-increment register for data after the first byte - // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer - for ( int j = 0; j < 16; j++ ) { - g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; - } - - #if ISSI_PERSISTENCE > 0 - for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { - if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) - break; - } - #else - i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); - #endif - } -} - -void IS31_init( uint8_t addr ) -{ - // In order to avoid the LEDs being driven with garbage data - // in the LED driver's PWM registers, first enable software shutdown, - // then set up the mode and other settings, clear the PWM registers, - // then disable software shutdown. - - // select "function register" bank - IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); - - // enable software shutdown - IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); - // this delay was copied from other drivers, might not be needed - #ifdef __AVR__ - _delay_ms( 10 ); - #else - wait_ms(10); - #endif - - // picture mode - IS31_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); - // display frame 0 - IS31_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); - // audio sync off - IS31_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); - - // select bank 0 - IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 ); - - // turn off all LEDs in the LED control register - for ( int i = 0x00; i <= 0x11; i++ ) - { - IS31_write_register( addr, i, 0x00 ); - } - - // turn off all LEDs in the blink control register (not really needed) - for ( int i = 0x12; i <= 0x23; i++ ) - { - IS31_write_register( addr, i, 0x00 ); - } - - // set PWM on all LEDs to 0 - for ( int i = 0x24; i <= 0xB3; i++ ) - { - IS31_write_register( addr, i, 0x00 ); - } - - // select "function register" bank - IS31_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); - - // disable software shutdown - IS31_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); - - // select bank 0 and leave it selected. - // most usage after initialization is just writing PWM buffers in bank 0 - // as there's not much point in double-buffering - IS31_write_register( addr, ISSI_COMMANDREGISTER, 0 ); - -} - -void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - if ( index >= 0 && index < DRIVER_LED_TOTAL ) { - is31_led led = g_is31_leds[index]; - - // Subtract 0x24 to get the second index of g_pwm_buffer - g_pwm_buffer[led.driver][led.r - 0x24] = red; - g_pwm_buffer[led.driver][led.g - 0x24] = green; - g_pwm_buffer[led.driver][led.b - 0x24] = blue; - g_pwm_buffer_update_required = true; - } -} - -void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) - { - IS31_set_color( i, red, green, blue ); - } -} - -void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) -{ - is31_led led = g_is31_leds[index]; - - uint8_t control_register_r = (led.r - 0x24) / 8; - uint8_t control_register_g = (led.g - 0x24) / 8; - uint8_t control_register_b = (led.b - 0x24) / 8; - uint8_t bit_r = (led.r - 0x24) % 8; - uint8_t bit_g = (led.g - 0x24) % 8; - uint8_t bit_b = (led.b - 0x24) % 8; - - if ( red ) { - g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); - } else { - g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); - } - if ( green ) { - g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); - } else { - g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); - } - if ( blue ) { - g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); - } else { - g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); - } - - g_led_control_registers_update_required = true; - -} - -void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) -{ - if ( g_pwm_buffer_update_required ) - { - IS31_write_pwm_buffer( addr1, g_pwm_buffer[0] ); - IS31_write_pwm_buffer( addr2, g_pwm_buffer[1] ); - } - g_pwm_buffer_update_required = false; -} - -void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) -{ - if ( g_led_control_registers_update_required ) - { - for ( int i=0; i<18; i++ ) - { - IS31_write_register(addr1, i, g_led_control_registers[0][i] ); - IS31_write_register(addr2, i, g_led_control_registers[1][i] ); - } - } -} - diff --git a/drivers/is31fl3731.h b/drivers/is31fl3731.h deleted file mode 100644 index 9e195c240e..0000000000 --- a/drivers/is31fl3731.h +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright 2017 Jason Williams - * Copyright 2018 Jack Humbert - * - * 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 . - */ - - -#ifndef IS31FL3731_DRIVER_H -#define IS31FL3731_DRIVER_H - -#include -#include - -typedef struct is31_led { - uint8_t driver:2; - uint8_t r; - uint8_t g; - uint8_t b; -} __attribute__((packed)) is31_led; - -extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; - -void IS31_init( uint8_t addr ); -void IS31_write_register( uint8_t addr, uint8_t reg, uint8_t data ); -void IS31_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); - -void IS31_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); -void IS31_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); - -void IS31_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); - -// This should not be called from an interrupt -// (eg. from a timer interrupt). -// Call this while idle (in between matrix scans). -// If the buffer is dirty, it will update the driver with the buffer. -void IS31_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); -void IS31_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); - -#define C1_1 0x24 -#define C1_2 0x25 -#define C1_3 0x26 -#define C1_4 0x27 -#define C1_5 0x28 -#define C1_6 0x29 -#define C1_7 0x2A -#define C1_8 0x2B - -#define C1_9 0x2C -#define C1_10 0x2D -#define C1_11 0x2E -#define C1_12 0x2F -#define C1_13 0x30 -#define C1_14 0x31 -#define C1_15 0x32 -#define C1_16 0x33 - -#define C2_1 0x34 -#define C2_2 0x35 -#define C2_3 0x36 -#define C2_4 0x37 -#define C2_5 0x38 -#define C2_6 0x39 -#define C2_7 0x3A -#define C2_8 0x3B - -#define C2_9 0x3C -#define C2_10 0x3D -#define C2_11 0x3E -#define C2_12 0x3F -#define C2_13 0x40 -#define C2_14 0x41 -#define C2_15 0x42 -#define C2_16 0x43 - -#define C3_1 0x44 -#define C3_2 0x45 -#define C3_3 0x46 -#define C3_4 0x47 -#define C3_5 0x48 -#define C3_6 0x49 -#define C3_7 0x4A -#define C3_8 0x4B - -#define C3_9 0x4C -#define C3_10 0x4D -#define C3_11 0x4E -#define C3_12 0x4F -#define C3_13 0x50 -#define C3_14 0x51 -#define C3_15 0x52 -#define C3_16 0x53 - -#define C4_1 0x54 -#define C4_2 0x55 -#define C4_3 0x56 -#define C4_4 0x57 -#define C4_5 0x58 -#define C4_6 0x59 -#define C4_7 0x5A -#define C4_8 0x5B - -#define C4_9 0x5C -#define C4_10 0x5D -#define C4_11 0x5E -#define C4_12 0x5F -#define C4_13 0x60 -#define C4_14 0x61 -#define C4_15 0x62 -#define C4_16 0x63 - -#define C5_1 0x64 -#define C5_2 0x65 -#define C5_3 0x66 -#define C5_4 0x67 -#define C5_5 0x68 -#define C5_6 0x69 -#define C5_7 0x6A -#define C5_8 0x6B - -#define C5_9 0x6C -#define C5_10 0x6D -#define C5_11 0x6E -#define C5_12 0x6F -#define C5_13 0x70 -#define C5_14 0x71 -#define C5_15 0x72 -#define C5_16 0x73 - -#define C6_1 0x74 -#define C6_2 0x75 -#define C6_3 0x76 -#define C6_4 0x77 -#define C6_5 0x78 -#define C6_6 0x79 -#define C6_7 0x7A -#define C6_8 0x7B - -#define C6_9 0x7C -#define C6_10 0x7D -#define C6_11 0x7E -#define C6_12 0x7F -#define C6_13 0x80 -#define C6_14 0x81 -#define C6_15 0x82 -#define C6_16 0x83 - -#define C7_1 0x84 -#define C7_2 0x85 -#define C7_3 0x86 -#define C7_4 0x87 -#define C7_5 0x88 -#define C7_6 0x89 -#define C7_7 0x8A -#define C7_8 0x8B - -#define C7_9 0x8C -#define C7_10 0x8D -#define C7_11 0x8E -#define C7_12 0x8F -#define C7_13 0x90 -#define C7_14 0x91 -#define C7_15 0x92 -#define C7_16 0x93 - -#define C8_1 0x94 -#define C8_2 0x95 -#define C8_3 0x96 -#define C8_4 0x97 -#define C8_5 0x98 -#define C8_6 0x99 -#define C8_7 0x9A -#define C8_8 0x9B - -#define C8_9 0x9C -#define C8_10 0x9D -#define C8_11 0x9E -#define C8_12 0x9F -#define C8_13 0xA0 -#define C8_14 0xA1 -#define C8_15 0xA2 -#define C8_16 0xA3 - -#define C9_1 0xA4 -#define C9_2 0xA5 -#define C9_3 0xA6 -#define C9_4 0xA7 -#define C9_5 0xA8 -#define C9_6 0xA9 -#define C9_7 0xAA -#define C9_8 0xAB - -#define C9_9 0xAC -#define C9_10 0xAD -#define C9_11 0xAE -#define C9_12 0xAF -#define C9_13 0xB0 -#define C9_14 0xB1 -#define C9_15 0xB2 -#define C9_16 0xB3 - - - -#endif // IS31FL3731_DRIVER_H diff --git a/drivers/issi/is31fl3731.c b/drivers/issi/is31fl3731.c new file mode 100644 index 0000000000..4d0d6b8a5e --- /dev/null +++ b/drivers/issi/is31fl3731.c @@ -0,0 +1,271 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * + * 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 . + */ + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include "is31fl3731.h" +#include +#include "i2c_master.h" +#include "progmem.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 0b1110100 AD <-> GND +// 0b1110111 AD <-> VCC +// 0b1110101 AD <-> SCL +// 0b1110110 AD <-> SDA +#define ISSI_ADDR_DEFAULT 0x74 + +#define ISSI_REG_CONFIG 0x00 +#define ISSI_REG_CONFIG_PICTUREMODE 0x00 +#define ISSI_REG_CONFIG_AUTOPLAYMODE 0x08 +#define ISSI_REG_CONFIG_AUDIOPLAYMODE 0x18 + +#define ISSI_CONF_PICTUREMODE 0x00 +#define ISSI_CONF_AUTOFRAMEMODE 0x04 +#define ISSI_CONF_AUDIOMODE 0x08 + +#define ISSI_REG_PICTUREFRAME 0x01 + +#define ISSI_REG_SHUTDOWN 0x0A +#define ISSI_REG_AUDIOSYNC 0x06 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_BANK_FUNCTIONREG 0x0B // helpfully called 'page nine' + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3731 PWM registers 0x24-0xB3. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3731_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][144]; +bool g_pwm_buffer_update_required = false; + +uint8_t g_led_control_registers[DRIVER_COUNT][18] = { { 0 }, { 0 } }; +bool g_led_control_registers_update_required = false; + +// This is the bit pattern in the LED control registers +// (for matrix A, add one to register for matrix B) +// +// reg - b7 b6 b5 b4 b3 b2 b1 b0 +// 0x00 - R08,R07,R06,R05,R04,R03,R02,R01 +// 0x02 - G08,G07,G06,G05,G04,G03,G02,R00 +// 0x04 - B08,B07,B06,B05,B04,B03,G01,G00 +// 0x06 - - , - , - , - , - ,B02,B01,B00 +// 0x08 - - , - , - , - , - , - , - , - +// 0x0A - B17,B16,B15, - , - , - , - , - +// 0x0C - G17,G16,B14,B13,B12,B11,B10,B09 +// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09 +// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09 + + +void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) +{ + // assumes bank is already selected + + // transmit PWM registers in 9 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for ( int i = 0; i < 144; i += 16 ) { + // set the first register, e.g. 0x24, 0x34, 0x44, etc. + g_twi_transfer_buffer[0] = 0x24 + i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x24-0x33, 0x34-0x43, etc. in one transfer + for ( int j = 0; j < 16; j++ ) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31FL3731_init( uint8_t addr ) +{ + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, first enable software shutdown, + // then set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // select "function register" bank + IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); + + // enable software shutdown + IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x00 ); + // this delay was copied from other drivers, might not be needed + #ifdef __AVR__ + _delay_ms( 10 ); + #else + wait_ms(10); + #endif + + // picture mode + IS31FL3731_write_register( addr, ISSI_REG_CONFIG, ISSI_REG_CONFIG_PICTUREMODE ); + // display frame 0 + IS31FL3731_write_register( addr, ISSI_REG_PICTUREFRAME, 0x00 ); + // audio sync off + IS31FL3731_write_register( addr, ISSI_REG_AUDIOSYNC, 0x00 ); + + // select bank 0 + IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); + + // turn off all LEDs in the LED control register + for ( int i = 0x00; i <= 0x11; i++ ) + { + IS31FL3731_write_register( addr, i, 0x00 ); + } + + // turn off all LEDs in the blink control register (not really needed) + for ( int i = 0x12; i <= 0x23; i++ ) + { + IS31FL3731_write_register( addr, i, 0x00 ); + } + + // set PWM on all LEDs to 0 + for ( int i = 0x24; i <= 0xB3; i++ ) + { + IS31FL3731_write_register( addr, i, 0x00 ); + } + + // select "function register" bank + IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, ISSI_BANK_FUNCTIONREG ); + + // disable software shutdown + IS31FL3731_write_register( addr, ISSI_REG_SHUTDOWN, 0x01 ); + + // select bank 0 and leave it selected. + // most usage after initialization is just writing PWM buffers in bank 0 + // as there's not much point in double-buffering + IS31FL3731_write_register( addr, ISSI_COMMANDREGISTER, 0 ); + +} + +void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + if ( index >= 0 && index < DRIVER_LED_TOTAL ) { + is31_led led = g_is31_leds[index]; + + // Subtract 0x24 to get the second index of g_pwm_buffer + g_pwm_buffer[led.driver][led.r - 0x24] = red; + g_pwm_buffer[led.driver][led.g - 0x24] = green; + g_pwm_buffer[led.driver][led.b - 0x24] = blue; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) + { + IS31FL3731_set_color( i, red, green, blue ); + } +} + +void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) +{ + is31_led led = g_is31_leds[index]; + + uint8_t control_register_r = (led.r - 0x24) / 8; + uint8_t control_register_g = (led.g - 0x24) / 8; + uint8_t control_register_b = (led.b - 0x24) / 8; + uint8_t bit_r = (led.r - 0x24) % 8; + uint8_t bit_g = (led.g - 0x24) % 8; + uint8_t bit_b = (led.b - 0x24) % 8; + + if ( red ) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if ( green ) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if ( blue ) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required = true; + +} + +void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_pwm_buffer_update_required ) + { + IS31FL3731_write_pwm_buffer( addr1, g_pwm_buffer[0] ); + IS31FL3731_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + } + g_pwm_buffer_update_required = false; +} + +void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_led_control_registers_update_required ) + { + for ( int i=0; i<18; i++ ) + { + IS31FL3731_write_register(addr1, i, g_led_control_registers[0][i] ); + IS31FL3731_write_register(addr2, i, g_led_control_registers[1][i] ); + } + } +} + diff --git a/drivers/issi/is31fl3731.h b/drivers/issi/is31fl3731.h new file mode 100644 index 0000000000..f354a12db2 --- /dev/null +++ b/drivers/issi/is31fl3731.h @@ -0,0 +1,214 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * + * 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 . + */ + + +#ifndef IS31FL3731_DRIVER_H +#define IS31FL3731_DRIVER_H + +#include +#include + +typedef struct is31_led { + uint8_t driver:2; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL3731_init( uint8_t addr ); +void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data ); +void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); + +void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3731_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); + +#define C1_1 0x24 +#define C1_2 0x25 +#define C1_3 0x26 +#define C1_4 0x27 +#define C1_5 0x28 +#define C1_6 0x29 +#define C1_7 0x2A +#define C1_8 0x2B + +#define C1_9 0x2C +#define C1_10 0x2D +#define C1_11 0x2E +#define C1_12 0x2F +#define C1_13 0x30 +#define C1_14 0x31 +#define C1_15 0x32 +#define C1_16 0x33 + +#define C2_1 0x34 +#define C2_2 0x35 +#define C2_3 0x36 +#define C2_4 0x37 +#define C2_5 0x38 +#define C2_6 0x39 +#define C2_7 0x3A +#define C2_8 0x3B + +#define C2_9 0x3C +#define C2_10 0x3D +#define C2_11 0x3E +#define C2_12 0x3F +#define C2_13 0x40 +#define C2_14 0x41 +#define C2_15 0x42 +#define C2_16 0x43 + +#define C3_1 0x44 +#define C3_2 0x45 +#define C3_3 0x46 +#define C3_4 0x47 +#define C3_5 0x48 +#define C3_6 0x49 +#define C3_7 0x4A +#define C3_8 0x4B + +#define C3_9 0x4C +#define C3_10 0x4D +#define C3_11 0x4E +#define C3_12 0x4F +#define C3_13 0x50 +#define C3_14 0x51 +#define C3_15 0x52 +#define C3_16 0x53 + +#define C4_1 0x54 +#define C4_2 0x55 +#define C4_3 0x56 +#define C4_4 0x57 +#define C4_5 0x58 +#define C4_6 0x59 +#define C4_7 0x5A +#define C4_8 0x5B + +#define C4_9 0x5C +#define C4_10 0x5D +#define C4_11 0x5E +#define C4_12 0x5F +#define C4_13 0x60 +#define C4_14 0x61 +#define C4_15 0x62 +#define C4_16 0x63 + +#define C5_1 0x64 +#define C5_2 0x65 +#define C5_3 0x66 +#define C5_4 0x67 +#define C5_5 0x68 +#define C5_6 0x69 +#define C5_7 0x6A +#define C5_8 0x6B + +#define C5_9 0x6C +#define C5_10 0x6D +#define C5_11 0x6E +#define C5_12 0x6F +#define C5_13 0x70 +#define C5_14 0x71 +#define C5_15 0x72 +#define C5_16 0x73 + +#define C6_1 0x74 +#define C6_2 0x75 +#define C6_3 0x76 +#define C6_4 0x77 +#define C6_5 0x78 +#define C6_6 0x79 +#define C6_7 0x7A +#define C6_8 0x7B + +#define C6_9 0x7C +#define C6_10 0x7D +#define C6_11 0x7E +#define C6_12 0x7F +#define C6_13 0x80 +#define C6_14 0x81 +#define C6_15 0x82 +#define C6_16 0x83 + +#define C7_1 0x84 +#define C7_2 0x85 +#define C7_3 0x86 +#define C7_4 0x87 +#define C7_5 0x88 +#define C7_6 0x89 +#define C7_7 0x8A +#define C7_8 0x8B + +#define C7_9 0x8C +#define C7_10 0x8D +#define C7_11 0x8E +#define C7_12 0x8F +#define C7_13 0x90 +#define C7_14 0x91 +#define C7_15 0x92 +#define C7_16 0x93 + +#define C8_1 0x94 +#define C8_2 0x95 +#define C8_3 0x96 +#define C8_4 0x97 +#define C8_5 0x98 +#define C8_6 0x99 +#define C8_7 0x9A +#define C8_8 0x9B + +#define C8_9 0x9C +#define C8_10 0x9D +#define C8_11 0x9E +#define C8_12 0x9F +#define C8_13 0xA0 +#define C8_14 0xA1 +#define C8_15 0xA2 +#define C8_16 0xA3 + +#define C9_1 0xA4 +#define C9_2 0xA5 +#define C9_3 0xA6 +#define C9_4 0xA7 +#define C9_5 0xA8 +#define C9_6 0xA9 +#define C9_7 0xAA +#define C9_8 0xAB + +#define C9_9 0xAC +#define C9_10 0xAD +#define C9_11 0xAE +#define C9_12 0xAF +#define C9_13 0xB0 +#define C9_14 0xB1 +#define C9_15 0xB2 +#define C9_16 0xB3 + + + +#endif // IS31FL3731_DRIVER_H diff --git a/drivers/issi/is31fl3733.c b/drivers/issi/is31fl3733.c new file mode 100644 index 0000000000..4098b54689 --- /dev/null +++ b/drivers/issi/is31fl3733.c @@ -0,0 +1,253 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * 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 . + */ + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include "is31fl3733.h" +#include +#include "i2c_master.h" +#include "progmem.h" + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b101(ADDR2)(ADDR1) +#define ISSI_ADDR_DEFAULT 0x50 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_INTERRUPTMASKREGISTER 0xF0 +#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 + +#define ISSI_PAGE_LEDCONTROL 0x00 //PG0 +#define ISSI_PAGE_PWM 0x01 //PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 //PG2 +#define ISSI_PAGE_FUNCTION 0x03 //PG3 + +#define ISSI_REG_CONFIGURATION 0x00 //PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 //PG3 +#define ISSI_REG_RESET 0x11// PG3 +#define ISSI_REG_SWPULLUP 0x0F //PG3 +#define ISSI_REG_CSPULLUP 0x10 //PG3 + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3733 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3733_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][192]; +bool g_pwm_buffer_update_required = false; + +uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 }, { 0 } }; +bool g_led_control_registers_update_required = false; + +void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) +{ + // assumes PG1 is already selected + + // transmit PWM registers in 12 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for ( int i = 0; i < 192; i += 16 ) { + g_twi_transfer_buffer[0] = i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer + for ( int j = 0; j < 16; j++ ) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31FL3733_init( uint8_t addr ) +{ + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // Unlock the command register. + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG0 + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + // Turn off all LEDs. + for ( int i = 0x00; i <= 0x17; i++ ) + { + IS31FL3733_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG1 + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for ( int i = 0x00; i <= 0xBF; i++ ) + { + IS31FL3733_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG3 + IS31FL3733_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION ); + // Set global current to maximum. + IS31FL3733_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF ); + // Disable software shutdown. + IS31FL3733_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 ); + + // Wait 10ms to ensure the device has woken up. + #ifdef __AVR__ + _delay_ms( 10 ); + #else + wait_ms(10); + #endif +} + +void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + if ( index >= 0 && index < DRIVER_LED_TOTAL ) { + is31_led led = g_is31_leds[index]; + + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3733_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) + { + IS31FL3733_set_color( i, red, green, blue ); + } +} + +void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) +{ + is31_led led = g_is31_leds[index]; + + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; + + if ( red ) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if ( green ) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if ( blue ) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required = true; + +} + +void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_pwm_buffer_update_required ) + { + // Firstly we need to unlock the command register and select PG1 + IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + + IS31FL3733_write_pwm_buffer( addr1, g_pwm_buffer[0] ); + //IS31FL3733_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + } + g_pwm_buffer_update_required = false; +} + +void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_led_control_registers_update_required ) + { + // Firstly we need to unlock the command register and select PG0 + IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3733_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + for ( int i=0; i<24; i++ ) + { + IS31FL3733_write_register(addr1, i, g_led_control_registers[0][i] ); + //IS31FL3733_write_register(addr2, i, g_led_control_registers[1][i] ); + } + } +} + diff --git a/drivers/issi/is31fl3733.h b/drivers/issi/is31fl3733.h new file mode 100644 index 0000000000..3d23b188aa --- /dev/null +++ b/drivers/issi/is31fl3733.h @@ -0,0 +1,255 @@ +/* Copyright 2017 Jason Williams + * Copyright 2018 Jack Humbert + * Copyright 2018 Yiancar + * + * 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 . + */ + + +#ifndef IS31FL3733_DRIVER_H +#define IS31FL3733_DRIVER_H + +#include +#include + +typedef struct is31_led { + uint8_t driver:2; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL3733_init( uint8_t addr ); +void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data ); +void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); + +void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3733_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3733_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); + +#define A_1 0x00 +#define A_2 0x01 +#define A_3 0x02 +#define A_4 0x03 +#define A_5 0x04 +#define A_6 0x05 +#define A_7 0x06 +#define A_8 0x07 +#define A_9 0x08 +#define A_10 0x09 +#define A_11 0x0A +#define A_12 0x0B +#define A_13 0x0C +#define A_14 0x0D +#define A_15 0x0E +#define A_16 0x0F + +#define B_1 0x10 +#define B_2 0x11 +#define B_3 0x12 +#define B_4 0x13 +#define B_5 0x14 +#define B_6 0x15 +#define B_7 0x16 +#define B_8 0x17 +#define B_9 0x18 +#define B_10 0x19 +#define B_11 0x1A +#define B_12 0x1B +#define B_13 0x1C +#define B_14 0x1D +#define B_15 0x1E +#define B_16 0x1F + +#define C_1 0x20 +#define C_2 0x21 +#define C_3 0x22 +#define C_4 0x23 +#define C_5 0x24 +#define C_6 0x25 +#define C_7 0x26 +#define C_8 0x27 +#define C_9 0x28 +#define C_10 0x29 +#define C_11 0x2A +#define C_12 0x2B +#define C_13 0x2C +#define C_14 0x2D +#define C_15 0x2E +#define C_16 0x2F + +#define D_1 0x30 +#define D_2 0x31 +#define D_3 0x32 +#define D_4 0x33 +#define D_5 0x34 +#define D_6 0x35 +#define D_7 0x36 +#define D_8 0x37 +#define D_9 0x38 +#define D_10 0x39 +#define D_11 0x3A +#define D_12 0x3B +#define D_13 0x3C +#define D_14 0x3D +#define D_15 0x3E +#define D_16 0x3F + +#define E_1 0x40 +#define E_2 0x41 +#define E_3 0x42 +#define E_4 0x43 +#define E_5 0x44 +#define E_6 0x45 +#define E_7 0x46 +#define E_8 0x47 +#define E_9 0x48 +#define E_10 0x49 +#define E_11 0x4A +#define E_12 0x4B +#define E_13 0x4C +#define E_14 0x4D +#define E_15 0x4E +#define E_16 0x4F + +#define F_1 0x50 +#define F_2 0x51 +#define F_3 0x52 +#define F_4 0x53 +#define F_5 0x54 +#define F_6 0x55 +#define F_7 0x56 +#define F_8 0x57 +#define F_9 0x58 +#define F_10 0x59 +#define F_11 0x5A +#define F_12 0x5B +#define F_13 0x5C +#define F_14 0x5D +#define F_15 0x5E +#define F_16 0x5F + +#define G_1 0x60 +#define G_2 0x61 +#define G_3 0x62 +#define G_4 0x63 +#define G_5 0x64 +#define G_6 0x65 +#define G_7 0x66 +#define G_8 0x67 +#define G_9 0x68 +#define G_10 0x69 +#define G_11 0x6A +#define G_12 0x6B +#define G_13 0x6C +#define G_14 0x6D +#define G_15 0x6E +#define G_16 0x6F + +#define H_1 0x70 +#define H_2 0x71 +#define H_3 0x72 +#define H_4 0x73 +#define H_5 0x74 +#define H_6 0x75 +#define H_7 0x76 +#define H_8 0x77 +#define H_9 0x78 +#define H_10 0x79 +#define H_11 0x7A +#define H_12 0x7B +#define H_13 0x7C +#define H_14 0x7D +#define H_15 0x7E +#define H_16 0x7F + +#define I_1 0x80 +#define I_2 0x81 +#define I_3 0x82 +#define I_4 0x83 +#define I_5 0x84 +#define I_6 0x85 +#define I_7 0x86 +#define I_8 0x87 +#define I_9 0x88 +#define I_10 0x89 +#define I_11 0x8A +#define I_12 0x8B +#define I_13 0x8C +#define I_14 0x8D +#define I_15 0x8E +#define I_16 0x8F + +#define J_1 0x90 +#define J_2 0x91 +#define J_3 0x92 +#define J_4 0x93 +#define J_5 0x94 +#define J_6 0x95 +#define J_7 0x96 +#define J_8 0x97 +#define J_9 0x98 +#define J_10 0x99 +#define J_11 0x9A +#define J_12 0x9B +#define J_13 0x9C +#define J_14 0x9D +#define J_15 0x9E +#define J_16 0x9F + +#define K_1 0xA0 +#define K_2 0xA1 +#define K_3 0xA2 +#define K_4 0xA3 +#define K_5 0xA4 +#define K_6 0xA5 +#define K_7 0xA6 +#define K_8 0xA7 +#define K_9 0xA8 +#define K_10 0xA9 +#define K_11 0xAA +#define K_12 0xAB +#define K_13 0xAC +#define K_14 0xAD +#define K_15 0xAE +#define K_16 0xAF + +#define L_1 0xB0 +#define L_2 0xB1 +#define L_3 0xB2 +#define L_4 0xB3 +#define L_5 0xB4 +#define L_6 0xB5 +#define L_7 0xB6 +#define L_8 0xB7 +#define L_9 0xB8 +#define L_10 0xB9 +#define L_11 0xBA +#define L_12 0xBB +#define L_13 0xBC +#define L_14 0xBD +#define L_15 0xBE +#define L_16 0xBF + +#endif // IS31FL3733_DRIVER_H diff --git a/quantum/quantum.h b/quantum/quantum.h index 1db9846f04..b4e4de1743 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -28,7 +28,7 @@ #include "backlight.h" #endif #if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) - #include "rgb.h" + #include "rgb.h" #endif #ifdef RGBLIGHT_ENABLE #include "rgblight.h" @@ -39,7 +39,7 @@ #endif #ifdef RGB_MATRIX_ENABLE - #include "rgb_matrix.h" + #include "rgb_matrix.h" #endif #include "action_layer.h" @@ -58,78 +58,78 @@ extern uint32_t default_layer_state; #ifndef NO_ACTION_LAYER - extern uint32_t layer_state; + extern uint32_t layer_state; #endif #ifdef MIDI_ENABLE #ifdef MIDI_ADVANCED - #include "process_midi.h" + #include "process_midi.h" #endif #endif // MIDI_ENABLE #ifdef AUDIO_ENABLE - #include "audio.h" - #include "process_audio.h" + #include "audio.h" + #include "process_audio.h" #ifdef AUDIO_CLICKY #include "process_clicky.h" #endif // AUDIO_CLICKY #endif #ifdef STENO_ENABLE - #include "process_steno.h" + #include "process_steno.h" #endif #if defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC)) - #include "process_music.h" + #include "process_music.h" #endif #ifndef DISABLE_LEADER - #include "process_leader.h" + #include "process_leader.h" #endif #define DISABLE_CHORDING #ifndef DISABLE_CHORDING - #include "process_chording.h" + #include "process_chording.h" #endif #ifdef UNICODE_ENABLE - #include "process_unicode.h" + #include "process_unicode.h" #endif #ifdef UCIS_ENABLE - #include "process_ucis.h" + #include "process_ucis.h" #endif #ifdef UNICODEMAP_ENABLE - #include "process_unicodemap.h" + #include "process_unicodemap.h" #endif #include "process_tap_dance.h" #ifdef PRINTING_ENABLE - #include "process_printer.h" + #include "process_printer.h" #endif #ifdef AUTO_SHIFT_ENABLE - #include "process_auto_shift.h" + #include "process_auto_shift.h" #endif #ifdef COMBO_ENABLE - #include "process_combo.h" + #include "process_combo.h" #endif #ifdef KEY_LOCK_ENABLE - #include "process_key_lock.h" + #include "process_key_lock.h" #endif #ifdef TERMINAL_ENABLE - #include "process_terminal.h" + #include "process_terminal.h" #else - #include "process_terminal_nop.h" + #include "process_terminal_nop.h" #endif #ifdef HD44780_ENABLE - #include "hd44780.h" + #include "hd44780.h" #endif #define STRINGIZE(z) #z diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 70ad1a1783..197bc1ac5e 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -1,5 +1,6 @@ /* Copyright 2017 Jason Williams * Copyright 2017 Jack Humbert + * Copyright 2018 Yiancar * * 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 @@ -17,18 +18,22 @@ #include "rgb_matrix.h" -#include #include "i2c_master.h" -#include -#include #include "progmem.h" #include "config.h" #include "eeprom.h" -#include "lufa.h" #include rgb_config_t rgb_matrix_config; +#ifndef MAX + #define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) +#endif + +#ifndef MIN + #define MIN(a,b) ((a) < (b)? (a): (b)) +#endif + #ifndef RGB_DISABLE_AFTER_TIMEOUT #define RGB_DISABLE_AFTER_TIMEOUT 0 #endif @@ -106,16 +111,29 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t } void rgb_matrix_update_pwm_buffers(void) { - IS31_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); - IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#ifdef IS31FL3731 + IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#elif defined(IS31FL3733) + IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); + IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#endif } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { - IS31_set_color( index, red, green, blue ); +#ifdef IS31FL3731 + IS31FL3731_set_color( index, red, green, blue ); +#elif defined(IS31FL3733) + IS31FL3733_set_color( index, red, green, blue ); +#endif } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { - IS31_set_color_all( red, green, blue ); +#ifdef IS31FL3731 + IS31FL3731_set_color_all( red, green, blue ); +#elif defined(IS31FL3733) + IS31FL3733_set_color_all( red, green, blue ); +#endif } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { @@ -460,7 +478,7 @@ void rgb_matrix_rainbow_moving_chevron(void) { for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; // uint8_t r = g_tick; - uint8_t r = 32; + uint8_t r = 128; hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * abs(led.point.y - 32.0)* sin(r * PI / 128) + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.x - (g_tick / 256.0 * 224)) * cos(r * PI / 128) + rgb_matrix_config.hue; rgb = hsv_to_rgb( hsv ); rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); @@ -752,16 +770,28 @@ void rgb_matrix_init(void) { void rgb_matrix_setup_drivers(void) { // Initialize TWI i2c_init(); - IS31_init( DRIVER_ADDR_1 ); - IS31_init( DRIVER_ADDR_2 ); +#ifdef IS31FL3731 + IS31FL3731_init( DRIVER_ADDR_1 ); + IS31FL3731_init( DRIVER_ADDR_2 ); +#elif defined (IS31FL3733) + IS31FL3733_init( DRIVER_ADDR_1 ); +#endif for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { bool enabled = true; // This only caches it for later - IS31_set_led_control_register( index, enabled, enabled, enabled ); +#ifdef IS31FL3731 + IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); +#elif defined (IS31FL3733) + IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); +#endif } // This actually updates the LED drivers - IS31_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#ifdef IS31FL3731 + IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#elif defined (IS31FL3733) + IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#endif } // Deals with the messy details of incrementing an integer @@ -811,11 +841,19 @@ void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue ) { { if ( i == index ) { - IS31_set_led_control_register( i, red, green, blue ); +#ifdef IS31FL3731 + IS31FL3731_set_led_control_register( i, red, green, blue ); +#elif defined (IS31FL3733) + IS31FL3733_set_led_control_register( i, red, green, blue ); +#endif } else { - IS31_set_led_control_register( i, false, false, false ); +#ifdef IS31FL3731 + IS31FL3731_set_led_control_register( i, false, false, false ); +#elif defined (IS31FL3733) + IS31FL3733_set_led_control_register( i, false, false, false ); +#endif } } } diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 5769314002..b91c9fba59 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -1,5 +1,6 @@ /* Copyright 2017 Jason Williams * Copyright 2017 Jack Humbert + * Copyright 2018 Yiancar * * 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 @@ -21,9 +22,14 @@ #include #include #include "color.h" -#include "is31fl3731.h" #include "quantum.h" +#ifdef IS31FL3731 + #include "is31fl3731.h" +#elif defined (IS31FL3733) + #include "is31fl3733.h" +#endif + typedef struct Point { uint8_t x; uint8_t y; -- cgit v1.2.3 From 444def8411d6ac67203c14ec92f8e33d77330895 Mon Sep 17 00:00:00 2001 From: Jacob Jerrell Date: Tue, 28 Aug 2018 18:48:41 -0500 Subject: Keymap: Bocaj - Create Userspace and Ergodox Layout (#3750) * Bocaj Layout Revamp * Pull in Upstream (#1) * Various tweaks for some Input:Club build processes * change KEYMAP to LAYOUT for all new keyboards made using this script * Add support for rev3 of the Atom47 (#2672) * Added support for rev3 of the Atom47 * Updated Atom47 readme's * Fix redefine error on rev2 and add maartenwut's keymap * Fix redefine error on LEdiodes keymap * Add Nyquist keymap (#2692) * nyquist * danielhklein nyquist setup * shift left controls * remove readme * cleanup before pr * ready for pr * Adds Phantom TKL support (#2696) * Add an info.json to phantom keyboard * Add layouts - KEYMAP_WINKEYLESS - KEYMAP_7BIT - KEYMAP_ISO - KEYMAP_ISO_WINKEYLESS * Add key_counts * Add 2 missing F-Row keys * Add TKC1800 info.json Created an info.json for the tkc1800. * Clueboard 60 info.json - adds - LAYOUT_60_ansi - LAYOUT_60_iso - KEYMAP_AEK - KEYMAP - LAYOUT_60_ansi_split_bs_rshift * Add the Speedo keyboard * Fix KC60 info.json file (#2707) * change KEYMAP to LAYOUT in all the KC60 files * Redo the info.json file * Small fixes to TKC1800 - adjust F-row to use 0.25 spacing - split left shift - add key_count * Fix some Configurator Warnings regarding LAYOUT vs KEYMAP (#2708) * change diverge 3 KC_KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for handwired arrow pad * change M10A to LAYOUT for m10-a * Change KC_KEYMAP to LAYOUT_kc and KEYMAP to LAYOUT for mf68 * change KC_KEYMAP to LAYOUT for nano * Refactor to LAYOUT * refactor to LAYOUT-ansi and LAYOUT_iso for s65 * LAYOUT conversions for lfkkeyboards * missed a few renames * mini1800 for lfkeyobards support of LAYOUT * Improve state/chord handling and clean up namespace Some values that can never, ever, change were held in local variables, rather than in PROGMEM. Fixed. Change "pressed" to a signed int so the test for < 0 makes sense, and to avoid possible weird failure modes in the case where a key release comes in when pressed is already zero. (Shouldn't happen, sure, but computers are weird.) A lot of things in process_steno had external linkage for no particular reason. They've been marked static. Stuff still builds. Distinguish between currently-held keys and keys that have been held, and expose these values through a nicely-named API so other code could, say, check on the current set of steno chording in order to make displays. Also in passing fix up the "state" value having external linkage so it could clash with other people's variable declarations. The API also provides hooks for key processing and steno chord events, so you can monitor those events without having to run in matrix_scan_user and recheck the values directly. Also document these. There is no path through processing a key that doesn't end with a return false, so the nested return foo() are gone and we just return false. * Pull information from config.h and rules.mk (#2711) * Pull information from config.h and rules.mk * Readd the kbd75 maintainer * Remove obsolete info.json entries (#2712) * Clean up some long-standing errors when populating the API (#2715) * More Configurator Warning Fixes (#2716) * mf68_ble did not have the correct .c and .h files * Fix JC65 KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for s60_x * Convert KEYMAP to LAYOUT for lets_split boards * Convert KEYMAP to LAYOUT * more fixes to keymap for iris * convert KEYMAP to LAYOUT for levinson keyboard * change losinggeneration's KEYMAP to LAYOUT * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for nyquist * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for viterbi * convert KEYMAP to LAYOUT * convert KEYMAP and its subsidiries to the LAYOUT standard * convert KEYMAP and its subsidiries to the new LAYOUT standard * Normacos keymap for let's split keyboard (#2691) * Cheers let's split keymap * fixed typo on norman layer of cheers keymap for let's split * fixed right handed mappings for home row * cheers keymap for let's split redefinition * updated Cheers keymap for let's split * cheers keymap for let's split updated with some terminal macros * renamed cheers let's split keymap to a more appropriate normacos * updated normacos keymap doc / removed non functional keys * reset let's split rules to default values * added more spotlight search macros * normalized keymap comments * Moved numpad on lower layer * hhkb jp personal keymap (#2698) * Add JJ40 Cockpit personal keymap (#2713) * Add JJ40 Cockpit keymap * Fix lower layer symbols * Add readme for "major" keyboards to eliminate more QMK Configurator errors (#2718) * add readme to ktype keyboard * add readme to m10a * add readme to mini1800 * add readme to parent directory * Revert "Pull in Upstream (#1)" This reverts commit eeba0cec17ccb636e4225eed88aeae72b99f5e45. * Updates to Bocaj Files - Gave up on Tap Dance for ' -> ' + Added another 'Secret' + Add ' -> ' to the Swap Hands key + Add Swap Hands to the ' -> ' key + Made Hand Swapping a momentary toggle - Removed Auto Shift + Added Layer Toggle to KC_QUOTE for the _TOOLS layer - Disabled Tap Dance * Merge remote-tracking branch 'upstream/master' * Updates to Bocaj Added Game Layers, Removed Unused Macros * Removed 'secrets.h' * Updates to Bocaj Remove 'secrets'. Remove 'sendstring_workman.h' and set related layer back to qwerty due to macro compatibility issues * Total revisioning of keymap and layout structure * Missed readme.md file * Bocaj - Permissive Hold setting enabled * Switching from ErgoDox EZ centric configuration to the layout/user approach * Bocaj - Create Userspace and Ergodox layout * Update settings.json --- keyboards/ergodox_ez/keymaps/bocaj/bocaj.h | 146 ------------ keyboards/ergodox_ez/keymaps/bocaj/config.h | 21 -- keyboards/ergodox_ez/keymaps/bocaj/keymap.c | 340 --------------------------- keyboards/ergodox_ez/keymaps/bocaj/readme.md | 48 ---- keyboards/ergodox_ez/keymaps/bocaj/rules.mk | 5 - layouts/community/ergodox/bocaj/config.h | 6 + layouts/community/ergodox/bocaj/keymap.c | 246 +++++++++++++++++++ layouts/community/ergodox/bocaj/rules.mk | 6 + users/bocaj/bocaj.c | 177 ++++++++++++++ users/bocaj/bocaj.h | 141 +++++++++++ users/bocaj/config.h | 33 +++ users/bocaj/readme.md | 14 ++ users/bocaj/rules.mk | 5 + users/bocaj/tap_dances.c | 65 +++++ users/bocaj/tap_dances.h | 7 + 15 files changed, 700 insertions(+), 560 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/bocaj/bocaj.h delete mode 100644 keyboards/ergodox_ez/keymaps/bocaj/config.h delete mode 100644 keyboards/ergodox_ez/keymaps/bocaj/keymap.c delete mode 100644 keyboards/ergodox_ez/keymaps/bocaj/readme.md delete mode 100644 keyboards/ergodox_ez/keymaps/bocaj/rules.mk create mode 100644 layouts/community/ergodox/bocaj/config.h create mode 100644 layouts/community/ergodox/bocaj/keymap.c create mode 100644 layouts/community/ergodox/bocaj/rules.mk create mode 100644 users/bocaj/bocaj.c create mode 100644 users/bocaj/bocaj.h create mode 100644 users/bocaj/config.h create mode 100644 users/bocaj/readme.md create mode 100644 users/bocaj/rules.mk create mode 100644 users/bocaj/tap_dances.c create mode 100644 users/bocaj/tap_dances.h diff --git a/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h b/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h deleted file mode 100644 index 2c41c01aa8..0000000000 --- a/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2018 Jacob Jerrell - -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 . -*/ - -#include "quantum.h" - -// Layers -enum layers { - _SWRKMN = 0, - _HWRKMN, - _LOWER, - _RAISE, - _ADJUST, - _DIABLO -}; - - - -enum custom_keycodes { - KC_EPRM = SAFE_RANGE, - KC_SWRK, - KC_HWRK, - KC_VRSN, - JJ_COPY, - JJ_PASTE, - JJ_ARRW, - MC_LOCK, - KC_DIABLO_CLEAR, - KC_NMPD -// UC_FLIP -}; - -// Space Cadet Hyper/Meh and [/] -#define HYP_LBK ALL_T(KC_LBRACKET) -#define MEH_RBK MEH_T(KC_RBRACKET) - -#define KC_LWSP LT(_LOWER, KC_SPACE) -#define KC_RSEN LT(_RAISE, KC_ENTER) -#define KC_ADJS TT(_ADJUST) - -#define XXXXXXX KC_NO -#define _______ KC_TRNS - -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 -}; -#endif // TAP_DANCE_ENABLE - -// Custom Keycodes for Diablo 3 layer -// But since TD() doesn't work when tap dance is disabled -// We use custom codes here, so we can substitute the right stuff -#ifdef TAP_DANCE_ENABLE -#define KC_D3_1 TD(TD_D3_1) -#define KC_D3_2 TD(TD_D3_2) -#define KC_D3_3 TD(TD_D3_3) -#define KC_D3_4 TD(TD_D3_4) -#else // TAP_DANCE_ENABLE -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 -#endif // TAP_DANCE_ENABLE - -//define diablo macro timer variables -extern uint16_t diablo_timer[4]; -extern uint8_t diablo_times[]; -extern uint8_t diablo_key_time[4]; - - -void run_diablo_macro_check(void); - - -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) - -/* Pretty Layout -.---------------------------------------------. .---------------------------------------------. -| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | -!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! -| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | -'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | - '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | 69 | ! 70 | ! ! - ! ! !-------! !-------! ! ! - | 71 | 72 | 73 | ! 74 | 75 | 76 | - '-----------------------' '-----------------------' -*/ - -#define ______________________NUMBER_LEFT________________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ______________________NUMBER_RIGHT_______________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define ______________________SPECIAL_LEFT_______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define ______________________SPECIAL_RIGHT______________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -#define _______________________FUNC_LEFT_________________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _______________________FUNC_RIGHT________________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - -#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G -#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B - -#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN -#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -// Hardware Driven Workman -#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G -#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V - -#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I -#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), TT(_ADJUST), XXXXXXX, KC_UP, KC_LEFT -#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, TT(_RAISE), TT(_LOWER), TT(_ADJUST) - -// LEFT | RIGHT -#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ - KC_END, KC_PGDOWN, \ - KC_LWSP,KC_BSPACE,JJ_COPY, JJ_PASTE,KC_TAB,KC_RSEN diff --git a/keyboards/ergodox_ez/keymaps/bocaj/config.h b/keyboards/ergodox_ez/keymaps/bocaj/config.h deleted file mode 100644 index 59605bc256..0000000000 --- a/keyboards/ergodox_ez/keymaps/bocaj/config.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef USERSPACE_CONFIG_H - #define USERSPACE_CONFIG_H - - #ifndef QMK_KEYS_PER_SCAN - #define QMK_KEYS_PER_SCAN 4 - #endif // QMK KEYS PER SCAN - - // this makes it possible to do rolling combos (zx) with keys that - // convert to other keys on hold (z becomes ctrl when you hold it, - // and when this option isn't enabled, z rapidly followed by x - // actually sends Ctrl-x. That's bad.) - #define IGNORE_MOD_TAP_INTERRUPT - #define PERMISSIVE_HOLD - #undef PREVENT_STUCK_MODIFIERS - - // Disable action_get_macro and fn_actions, since we don't use these - // and it saves on space in the firmware. - #define NO_ACTION_MACRO - #define NO_ACTION_FUNCTION - -#endif // !USERSPACE_CONFIG_H diff --git a/keyboards/ergodox_ez/keymaps/bocaj/keymap.c b/keyboards/ergodox_ez/keymaps/bocaj/keymap.c deleted file mode 100644 index 07117f1164..0000000000 --- a/keyboards/ergodox_ez/keymaps/bocaj/keymap.c +++ /dev/null @@ -1,340 +0,0 @@ -/* -Copyright 2018 Jacob Jerrell -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 . -*/ -#include QMK_KEYBOARD_H -#include "bocaj.h" - -#ifdef UNICODEMAP_ENABLE -#include "bocaj_unicode.h" -#endif // UNICODEMAP_ENABLE - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | ADJST | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | C | V | B | { | ! } | N | M | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! SPACE ! | END | ! PGDN | ! ENTER ! - ! / ! BSPCE !-------! !-------! TAB ! / ! - | LOWER | | COPY | ! PASTE | | RAISE | - '-----------------------' '-----------------------' -*/ - [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL, - KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS, - KC_ADJS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ - ), -/* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | ADJST | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | M | C | V | { | ! } | K | L | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | VRS | UP | LFT | .---------------. .---------------. ! RGT | DWN | RSE | LWR | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! SPACE ! | END | ! PGDN | ! ENTER ! - ! / ! BSPCE !-------! !-------! TAB ! / ! - | LOWER | | COPY | ! PASTE | | RAISE | - '-----------------------' '-----------------------' -*/ - [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, ______________________NUMBER_LEFT________________________, JJ_ARRW, KC_MINUS, ______________________NUMBER_RIGHT_______________________, KC_EQUAL, - KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS, - KC_ADJS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ - ), -/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a - .---------------------------------------------. .---------------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | | ! | F6 | F7 | F8 | F9 | F10 | | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | ` | 1 | 2 | 3 | 4 | 5 | | ! | 6 | 7 | 8 | 9 | 0 | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | |-------! !-------! | | | | | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | | | | | | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | .---------------. .---------------. ! | | | | | - '------------------------------' | | | ! | | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' -*/ - [_LOWER] = LAYOUT_ergodox_pretty_wrapper( - _______,_______________________FUNC_LEFT_________________________, _______, _______, _______________________FUNC_RIGHT________________________, _______, - KC_GRV ,______________________NUMBER_LEFT________________________, _______, _______, ______________________NUMBER_RIGHT_______________________, _______, - _______,_________________________________________________________, _________________________________________________________, _______, - _______,_________________________________________________________, _______, _______, _________________________________________________________, _______, - _________________________________________________________, _________________________________________________________, - ______________________ERGODOX_THUMBS_____________________ - ), -/* Raise - http://www.keyboard-layout-editor.com/#/gists/e0f591ec2ce9f24675a02d15c7048b25 - .---------------------------------------------. .---------------------------------------------. - | | F1 | F2 | F3 | F4 | F5 | | ! _ | F6 | F7 | F8 | F9 | F10 | | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | ~ | ! | @ | # | $ | % | | ! | ^ | & | * | ( | ) | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | |-------! !-------! | | | | | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | | | | | | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | .---------------. .---------------. ! | | | | | - '------------------------------' | | | ! | | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' -*/ - [_RAISE] = LAYOUT_ergodox_pretty_wrapper( - _______,_______________________FUNC_LEFT_________________________, _______, KC_UNDS, _______________________FUNC_RIGHT________________________, _______, - KC_TILD,______________________SPECIAL_LEFT_______________________, _______, _______, ______________________SPECIAL_RIGHT______________________, _______, - _______,_________________________________________________________, _________________________________________________________, _______, - _______,_________________________________________________________, _______, _______, _________________________________________________________, _______, - _________________________________________________________, _________________________________________________________, - ______________________ERGODOX_THUMBS_____________________ - ), - /* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 - .---------------------------------------------. .---------------------------------------------. - | | | | | | | EPRM | ! EPRM | | | | | | | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | | | | | | | | ! | | 7 | 8 | 9 | * | | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | 4 | 5 | 6 | + | SWRKM | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | 1 | 2 | 3 | - | HWRKM | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | | | | | | .---------------. .---------------. ! 0 | . | , | = | | - '------------------------------' | | | ! | | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | | ! | ! ! - ! ! !-------! !-------! ! ! - | | | | ! | | | - '-----------------------' '-----------------------' -*/ - [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX, - _______,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, KC_SWRK, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, KC_HWRK, - XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, _______, - ______________________ERGODOX_THUMBS_____________________ - ), -// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c - [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC , KC_V , KC_D ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_TAB , KC_S , KC_I , KC_F , KC_T , KC_J ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX, - KC_Q , KC_1 , KC_2 , KC_3 , KC_4 , KC_M , XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, - KC_LSFT,KC_D3_1 ,KC_D3_2 ,KC_D3_3 ,KC_D3_4 ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX, - _______,ALT_T(KC_Z) ,KC_G ,KC_Y ,XXXXXXX , KC_KP_0, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, - XXXXXXX, XXXXXXX, - KC_BTN1,KC_BTN2,KC_DIABLO_CLEAR, XXXXXXX,XXXXXXX,XXXXXXX - ) -}; - -// Defines actions for my custom keycodes -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // KC_COPY and KC_PASTE have problems with different hardware/software mappings - // e.g. If the mappings conflict, KC_COPY will send Cmd+M which minimizes the - // window and is very annoying. JJ_COPY and JJ_PASTE fix this by sending the - // raw character rather than the KC_* code - case JJ_COPY: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("c")); - } - return false; - break; - case JJ_PASTE: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("v")); - } - return false; - break; - case JJ_ARRW: - if (!record->event.pressed) { - SEND_STRING("->"); - } - return false; - break; - case KC_SWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_SWRKMN); - layer_move(_SWRKMN); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_HWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_HWRKMN); - layer_move(_HWRKMN); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_EPRM: - if (!record->event.pressed) { - ergodox_blink_all_leds(); - eeconfig_init(); - } - return false; - break; - case MC_LOCK: - if (!record->event.pressed) { - layer_move(_HWRKMN); - SEND_STRING(SS_LCTRL(SS_LGUI("q"))); - } - return false; - break; - case KC_DIABLO_CLEAR: -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } -#endif // TAP_DANCE_ENABLE - return false; - break; - } - return true; -} - -void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; - -// Diablo III Fun stuff -//define diablo macro timer variables -uint16_t diablo_timer[4]; -uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; -uint8_t diablo_key_time[4]; - -// has the correct number of seconds elapsed (as defined by diablo_times) -bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; - -// Cycle through the times for the macro, starting at 0, for disabled. -// Max of six values, so don't exceed -void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { - if (state->count >= 7) { - diablo_key_time[diablo_key] = diablo_times[0]; - reset_tap_dance(state); - } else { - diablo_key_time[diablo_key] = diablo_times[state->count - 1]; - } -} - -// Would rather have one function for all of this, but no idea how to do that... -void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } -void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } -void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } -void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // tap once to disable, and more to enable timed micros - [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), - [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), - [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), - [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), -}; - -// Sends the key press to system, but only if on the Diablo layer -void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { - switch (diablo_key) { - case 0: - tap(KC_1); break; - case 1: - tap(KC_2); break; - case 2: - tap(KC_3); break; - case 3: - tap(KC_4); break; - } - } -} - -// Checks each of the 4 timers/keys to see if enough time has elapsed -// Runs the "send string" command if enough time has passed, and resets the timer. -void run_diablo_macro_check(void) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - if (check_dtimer(dtime) && diablo_key_time[dtime]) { - diablo_timer[dtime] = timer_read(); - send_diablo_keystroke(dtime); - } - } -} - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - switch (layer) { - /* - Lights are treated as binary here for easy identification. - LED1 = 4; LED2 = 2; LED1 = 1 - This allows for up to 8 identified layers (default layers being no lights on) - Which is way more than I should ever need - */ - case _LOWER: - ergodox_right_led_3_on(); - ergodox_right_led_3_set(10); // Default brightness is deadly in a dark room - break; - case _RAISE: - ergodox_right_led_2_on(); - ergodox_right_led_2_set(10); - break; - case _ADJUST: - ergodox_right_led_2_on(); - ergodox_right_led_2_set(10); - ergodox_right_led_3_on(); - ergodox_right_led_3_set(10); - break; - case _DIABLO: - ergodox_right_led_1_on(); - ergodox_right_led_1_set(10); - break; - default: - // none - break; - } - #ifdef TAP_DANCE_ENABLE - run_diablo_macro_check(); - #endif -}; diff --git a/keyboards/ergodox_ez/keymaps/bocaj/readme.md b/keyboards/ergodox_ez/keymaps/bocaj/readme.md deleted file mode 100644 index 9d5aa60501..0000000000 --- a/keyboards/ergodox_ez/keymaps/bocaj/readme.md +++ /dev/null @@ -1,48 +0,0 @@ -# Ergodox EZ Layout by JacobJerrell - -My personal Ergodox EZ layout. - -## Summary - -Contains two base layers because I carry my keyboard between different machines and occassionally use the machines without this keyboard. A side-effect to using it in this manner (with a non-QWERTY layout) is that software/hardware mappings conflict so this allows a quick (2-buttons) to get the keyboard to a compatible layer - -## Layers - -| Layer | Purpose | -| ----- | ------- | -| 0 | [Hardware Workman](#hardware-workman) - For OS mapped to QWERTY | -| 1 | [Software Workman](#software-workman) - For OS mapped to Workman | -| 2 | [Lower](#lower) | -| 3 | [Raise](#raise) | -| 4 | [Adjust](#adjust) | -| 5 | [Diablo III](#diablo-iii) | - -### Hardware Workman - -For easy plug and play into QWERTY machines -![Hardware Workman](https://imgur.com/HHMIOEf.png) - -### Software Workman - -To switch to when I was previously using the laptop keyboard with software mapped to Workman. Or so other people can take the Ergodox for a spin. -![Software Workman](https://imgur.com/WnSci7o.png) - -### Lower - -Reveals F1-12 keys and brings numkeys down. -![Lowered](https://imgur.com/mGfjwcn.png) - -### Raise - -Reveals F1-F12 keys and gives shifted numkeys. -![Raised](https://imgur.com/NC96Jus.png) - -### Adjust - -Numpad, Wipe EEPROM, OSX Volume Control, OSX Lockscreen, and Default Layer Switching. -![Adjusted](https://imgur.com/aQtOxZU.png) - -### Diablo III - -Arranged to make playing on a laptop much more enjoyable. Credit for the D1-4 macros (as well as much of the ideas in this layout goes to Drashna) -![Diablo III](https://imgur.com/5eQcDOQ.png) diff --git a/keyboards/ergodox_ez/keymaps/bocaj/rules.mk b/keyboards/ergodox_ez/keymaps/bocaj/rules.mk deleted file mode 100644 index b667841a18..0000000000 --- a/keyboards/ergodox_ez/keymaps/bocaj/rules.mk +++ /dev/null @@ -1,5 +0,0 @@ -AUTO_SHIFT_ENABLE = no -COMMAND_ENABLE = no -SWAP_HANDS_ENABLE = no -TAP_DANCE_ENABLE = yes -EXTRAKEY_ENABLE = no diff --git a/layouts/community/ergodox/bocaj/config.h b/layouts/community/ergodox/bocaj/config.h new file mode 100644 index 0000000000..78350f6033 --- /dev/null +++ b/layouts/community/ergodox/bocaj/config.h @@ -0,0 +1,6 @@ +#pragma once + +#include QMK_KEYBOARD_CONFIG_H + +#undef PRODUCT +#define PRODUCT BocajEZ - Frankensteined ErgoDox EZ diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c new file mode 100644 index 0000000000..fbe0fca653 --- /dev/null +++ b/layouts/community/ergodox/bocaj/keymap.c @@ -0,0 +1,246 @@ +/* +Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell + +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 . +*/ +#include QMK_KEYBOARD_H +#include "bocaj.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' +*/ + [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, + KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS, + KC_NUMS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE, + KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT, + ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, + ______________________ERGODOX_THUMBS_____________________ + ), +/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' +*/ + [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, + KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS, + KC_NUMS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE, + KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT, + ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, + ______________________ERGODOX_THUMBS_____________________ + ), +/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a + .---------------------------------------------. .---------------------------------------------. + | ESC | | | | | | -> | ! - | | | | | | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | ! | @ | # | $ | % | ( | ! ) | ^ | & | * | ( | ) | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | ` | 1 | 2 | 3 | 4 | 5 |-------! !-------! 6 | 7 | 8 | 9 | 0 | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | | | | | | [ | ! ] | | | | | | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' +*/ + [_LOWER] = LAYOUT_ergodox_pretty_wrapper( + _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, + _______,_______________________SPECIAL_LEFT______________________, _______, _______, _______________________SPECIAL_RIGHT_____________________, _______, + KC_GRV ,_______________________NUMBER_LEFT_______________________, _______________________NUMBER_RIGHT______________________, _______, + _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, + _________________________________________________________, _________________________________________________________, + ______________________ERGODOX_THUMBS_____________________ + ), + /* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 + .---------------------------------------------. .---------------------------------------------. + | | | | | | | EPRM | ! EPRM | | | | | | | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | | | | | | | | ! | | | | | | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | SWRKM | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | | | ! | | | | | | HWRKM | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | .---------------. .---------------. ! | | | | | + '------------------------------' | | | ! | | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' +*/ + [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SWRK, + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HWRK, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + ______________________ERGODOX_THUMBS_____________________ + ), + [_NUMS] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, + XXXXXXX,XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX, + _______,XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, XXXXXXX, + LM_SHFT,XXXXXXX, XXXXXXX, XXXXXXX, JJ_COPY, JJ_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, XXXXXXX, + XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, XXXXXXX, + _______, _______, _______,_______, + _______, _______, + KC_LALT,KC_LGUI,_______, _______,_______,_______ + ), + [_NMOD] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, + XXXXXXX,XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, + XXXXXXX,XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, + LM_SHFT,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, _______, _______, _______, _______, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, + XXXXXXX, XXXXXXX, + KC_LALT,KC_LGUI,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX + ), +// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c + [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( + KC_ESC , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_TAB , KC_Q ,ALT_T(KC_S), KC_I , KC_F , KC_J ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LOCK, KC_1 , KC_2 , KC_3 , KC_4 ,KC_DCLR , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, KC_D3_1 , KC_D3_2 , KC_D3_3 , KC_D3_4 , KC_T ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX , XXXXXXX , XXXXXXX , KC_M , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, + XXXXXXX, XXXXXXX, + KC_BTN1,KC_BTN2,KC_ENTER, XXXXXXX,XXXXXXX,XXXXXXX + ) +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + uint8_t default_layer = 0; + default_layer = eeconfig_read_default_layer(); + switch (keycode) { + case KC_SWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_SWRKMN); + layer_move(default_layer); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_HWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_HWRKMN); + layer_move(default_layer); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_EPRM: + if (!record->event.pressed) { + ergodox_blink_all_leds(); + eeconfig_init(); + } + return false; + break; + case MC_LOCK: + if (!record->event.pressed) { + layer_move(default_layer); + SEND_STRING(SS_LCTRL(SS_LGUI("q"))); + } + return false; + break; + } + return true; +} + +void matrix_init_keymap(void) {}; + +void matrix_scan_keymap(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + /* + Lights are treated as binary here for easy identification. + LED1 = 4; LED2 = 2; LED1 = 1 + This allows for up to 8 identified layers (default layers being no lights on) + Which is way more than I should ever need + */ + case _LOWER: + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); // Default brightness is deadly in a dark room + break; + case _ADJUST: + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + break; + case _NUMS: + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); + break; + case _NMOD: + ergodox_right_led_1_on(); + ergodox_right_led_1_set(10); + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); + break; + case _DIABLO: + ergodox_right_led_1_on(); + ergodox_right_led_1_set(10); + break; + default: + // none + break; + } + /* #ifdef TAP_DANCE_ENABLE + run_diablo_macro_check(); + #endif */ +}; diff --git a/layouts/community/ergodox/bocaj/rules.mk b/layouts/community/ergodox/bocaj/rules.mk new file mode 100644 index 0000000000..037bca2b67 --- /dev/null +++ b/layouts/community/ergodox/bocaj/rules.mk @@ -0,0 +1,6 @@ +AUTO_SHIFT_ENABLE = no +COMMAND_ENABLE = no +SWAP_HANDS_ENABLE = no +TAP_DANCE_ENABLE = yes +EXTRAKEY_ENABLE = no +KEY_LOCK_ENABLE = yes diff --git a/users/bocaj/bocaj.c b/users/bocaj/bocaj.c new file mode 100644 index 0000000000..6df6e3bbfa --- /dev/null +++ b/users/bocaj/bocaj.c @@ -0,0 +1,177 @@ +#include "bocaj.h" +#include "eeprom.h" +#include "version.h" +#include "tap_dances.h" + +static uint16_t copy_paste_timer; +userspace_config_t userspace_config; + +/* *** *** *** *** * + * Helper Functions * + * *** *** *** *** */ +void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; + +// Add reconfigurable functions here, for keymap customization +// This allows for a global, userspace functions, and continued +// customization of the keymap. Use _keymap instead of _user +// functions in the keymaps +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void startup_keymap(void) {} + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + +__attribute__ ((weak)) +uint32_t default_layer_state_set_keymap (uint32_t state) { + return state; +} + +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +// Call user matrix init, set default RGB colors and then +// call the keymap's init function +void matrix_init_user(void) { + userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); + matrix_init_keymap(); +} + +void startup_user (void) { + startup_keymap(); +} + +void suspend_power_down_user(void) +{ + suspend_power_down_keymap(); +} + +void suspend_wakeup_init_user(void) +{ + suspend_wakeup_init_keymap(); + #ifdef KEYBOARD_ergodox_ez + wait_ms(10); + #endif +} + +// No global matrix scan code, so just run keymap's matrix +// scan function +void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + startup_user(); + } + +#ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. + run_diablo_macro_check(); +#endif // TAP_DANCE_ENABLE + + matrix_scan_keymap(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + /* uint8_t default_layer = 0; + default_layer = eeconfig_read_default_layer(); */ + switch (keycode) { + case JJ_COPY: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("c")); + } + return false; + break; + case JJ_PSTE: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("v")); + } + return false; + break; + case JJ_ARRW: + if (!record->event.pressed) { + SEND_STRING("->"); + } + return false; + break; /* + case KC_SWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_SWRKMN); + layer_move(default_layer); + //ergodox_blink_all_leds(); + //ergodox_blink_all_leds(); + } + return false; + break; + case KC_HWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_HWRKMN); + layer_move(default_layer); + //ergodox_blink_all_leds(); + //ergodox_blink_all_leds(); + } + return false; + break; + case KC_EPRM: + if (!record->event.pressed) { + //ergodox_blink_all_leds(); + eeconfig_init(); + } + return false; + break; + case MC_LOCK: + if (!record->event.pressed) { + layer_move(default_layer); + SEND_STRING(SS_LCTRL(SS_LGUI("q"))); + } + return false; + break; */ + case KC_DCLR: +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } +#endif // !TAP_DANCE_ENABLE + return false; + break; + case KC_CCCV: + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + SEND_STRING(SS_LGUI("c")); + } else { + SEND_STRING(SS_LGUI("v")); + } + } + return false; + break; + } + return process_record_keymap(keycode, record); +} + diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h new file mode 100644 index 0000000000..7b537397f0 --- /dev/null +++ b/users/bocaj/bocaj.h @@ -0,0 +1,141 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +/* *** *** *** *** *** * + * Define layer names * + * *** *** *** *** *** */ +enum userspace_layers { + _HWRKMN = 0, + _SWRKMN, + _LOWER, + _ADJUST, + _NUMS, + _NMOD, + _DIABLO +}; + +#define EECONFIG_USERSPACE (uint8_t *)19 +typedef union { + uint8_t raw; +} userspace_config_t; + +/* *** *** *** *** *** *** * + * Define Custom Keycodes * + * *** *** *** *** *** *** */ +enum userspace_custom_keycodes { + KC_EPRM = SAFE_RANGE, // can always be here + KC_SWRK, + KC_HWRK, + KC_VRSN, + JJ_COPY, + JJ_PSTE, + JJ_ARRW, + KC_CCCV, + MC_LOCK, + KC_DCLR, + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes +}; + +// Space Cadet Hyper/Meh and [/] +#define HYP_LBK ALL_T(KC_LBRACKET) +#define MEH_RBK MEH_T(KC_RBRACKET) + +// Layout beauti-/simpli-fication +#define KC_LWEN LT(_LOWER, KC_ENTER) +#define KC_ADJS TT(_ADJUST) +#define KC_NUMS TT(_NUMS) +#define LM_SHFT LM(_NMOD, MOD_LSFT) +#define XXXXXXX KC_NO +#define _______ KC_TRNS + +void tap(uint16_t keycode); + +/* *** *** *** *** *** *** * + * Diablo 3 Macro Handling * + * *** *** *** *** *** *** */ + +// If Tap Dancing is enabled, we manage that here. +// If it is not, then we define the KC_D3_# codes gracefully +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4, +}; + +#define KC_D3_1 TD(TD_D3_1) +#define KC_D3_2 TD(TD_D3_2) +#define KC_D3_3 TD(TD_D3_3) +#define KC_D3_4 TD(TD_D3_4) +#else // !TAP_DANCE_ENABLE +#define KC_D3_1 KC_1 +#define KC_D3_2 KC_2 +#define KC_D3_3 KC_3 +#define KC_D3_4 KC_4 +#endif // TAP_DANCE_ENABLE + +// Wrapper for handling of keymap 'blocks' +// not 100% sure what this first part does. Credit to Drashna +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +/* Pretty Layout +.---------------------------------------------. .---------------------------------------------. +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | +!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! +| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | +'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | + '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | 69 | ! 70 | ! ! + ! ! !-------! !-------! ! ! + | 71 | 72 | 73 | ! 74 | 75 | 76 | + '-----------------------' '-----------------------' +*/ + +#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G +#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B + +#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN +#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +// Hardware Driven Workman +#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G +#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V + +#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I +#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT +#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, XXXXXXX, XXXXXXX, TT(_ADJUST) + +#define _______________________NUMBER_LEFT_______________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define _______________________NUMBER_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0 + +#define _______________________SPECIAL_LEFT______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _______________________SPECIAL_RIGHT_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN + +#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO + +// LEFT | RIGHT +#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ + KC_END, KC_PGDOWN, \ + KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PSTE,KC_TAB,KC_LWEN + + +#endif // !USERSPACE diff --git a/users/bocaj/config.h b/users/bocaj/config.h new file mode 100644 index 0000000000..ce5ec65d62 --- /dev/null +++ b/users/bocaj/config.h @@ -0,0 +1,33 @@ +#pragma once + +#ifndef QMK_KEYS_PER_SCAN + #define QMK_KEYS_PER_SCAN 4 +#endif // QMK KEYS PER SCAN + +// this makes it possible to do rolling combos (zx) with keys that +// convert to other keys on hold (z becomes ctrl when you hold it, +// and when this option isn't enabled, z rapidly followed by x +// actually sends Ctrl-x. That's bad.) +#define IGNORE_MOD_TAP_INTERRUPT +#undef PERMISSIVE_HOLD +#define PREVENT_STUCK_MODIFIERS + +#ifdef TAPPING_TERM +#undef TAPPING_TERM +#endif // TAPPING_TERM +#define TAPPING_TERM 175 + +// Disable action_get_macro and fn_actions, since we don't use these +// and it saves on space in the firmware. +#ifndef NO_DEBUG +#define NO_DEBUG +#endif // !NO_DEBUG +#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) +#define NO_PRINT +#endif // !NO_PRINT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#define DISABLE_LEADER + +#define MACRO_TIMER 5 diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md new file mode 100644 index 0000000000..bab6d7337f --- /dev/null +++ b/users/bocaj/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell + +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 . diff --git a/users/bocaj/rules.mk b/users/bocaj/rules.mk new file mode 100644 index 0000000000..17d2772a7c --- /dev/null +++ b/users/bocaj/rules.mk @@ -0,0 +1,5 @@ +SRC += bocaj.c + +ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) + SRC += tap_dances.c +endif diff --git a/users/bocaj/tap_dances.c b/users/bocaj/tap_dances.c new file mode 100644 index 0000000000..10767db453 --- /dev/null +++ b/users/bocaj/tap_dances.c @@ -0,0 +1,65 @@ +#include "bocaj.h" +#include "tap_dances.h" + + +//define diablo macro timer variables +uint16_t diablo_timer[4]; +uint8_t diablo_times[] = { 0, 1, 3, 5, 10, 30 }; +uint8_t diablo_key_time[4]; + +// has the correct number of seconds elapsed (as defined by diablo_times) +bool check_dtimer(uint8_t dtimer) { return (timer_elapsed(diablo_timer[dtimer]) < (diablo_key_time[dtimer] * 1000)) ? false : true; }; + +// Cycle through the times for the macro, starting at 0, for disabled. +// Max of six values, so don't exceed +void diablo_tapdance_master(qk_tap_dance_state_t *state, void *user_data, uint8_t diablo_key) { + if (state->count >= 7) { + diablo_key_time[diablo_key] = diablo_times[0]; + reset_tap_dance(state); + } else { + diablo_key_time[diablo_key] = diablo_times[state->count - 1]; + } +} + +// Would rather have one function for all of this, but no idea how to do that... +void diablo_tapdance1(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 0); } +void diablo_tapdance2(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 1); } +void diablo_tapdance3(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 2); } +void diablo_tapdance4(qk_tap_dance_state_t *state, void *user_data) { diablo_tapdance_master(state, user_data, 3); } + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // tap once to disable, and more to enable timed micros + [TD_D3_1] = ACTION_TAP_DANCE_FN(diablo_tapdance1), + [TD_D3_2] = ACTION_TAP_DANCE_FN(diablo_tapdance2), + [TD_D3_3] = ACTION_TAP_DANCE_FN(diablo_tapdance3), + [TD_D3_4] = ACTION_TAP_DANCE_FN(diablo_tapdance4), +}; + +// Sends the key press to system, but only if on the Diablo layer +void send_diablo_keystroke(uint8_t diablo_key) { + if (biton32(layer_state) == _DIABLO) { + switch (diablo_key) { + case 0: + tap(KC_1); break; + case 1: + tap(KC_2); break; + case 2: + tap(KC_3); break; + case 3: + tap(KC_4); break; + } + } +} + +// Checks each of the 4 timers/keys to see if enough time has elapsed +// Runs the "send string" command if enough time has passed, and resets the timer. +void run_diablo_macro_check(void) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + if (check_dtimer(dtime) && diablo_key_time[dtime]) { + diablo_timer[dtime] = timer_read(); + send_diablo_keystroke(dtime); + } + } +} diff --git a/users/bocaj/tap_dances.h b/users/bocaj/tap_dances.h new file mode 100644 index 0000000000..8935753f6c --- /dev/null +++ b/users/bocaj/tap_dances.h @@ -0,0 +1,7 @@ +//define diablo macro timer variables +extern uint16_t diablo_timer[4]; +extern uint8_t diablo_times[]; +extern uint8_t diablo_key_time[4]; + + +void run_diablo_macro_check(void); -- cgit v1.2.3 From 3916b06168f39233f77a252fbf5f9cfdae3df4fe Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 28 Aug 2018 16:52:00 -0700 Subject: Putting my ducks in a row: Octagon V1/V2 (#3765) * Move octagon directory into duck diretory and fix as many compile issues as I can * fix formatting * fix layout75 matrix * edit readme for build instructions --- keyboards/duck/jetfire/readme.md | 2 +- keyboards/duck/octagon/keymaps/default/keymap.c | 37 ++++ keyboards/duck/octagon/keymaps/default/readme.md | 0 keyboards/duck/octagon/readme.md | 11 + keyboards/duck/octagon/rules.mk | 1 + keyboards/duck/octagon/v1/config.h | 54 +++++ keyboards/duck/octagon/v1/info.json | 12 ++ keyboards/duck/octagon/v1/matrix.c | 227 ++++++++++++++++++++ keyboards/duck/octagon/v1/readme.md | 28 +++ keyboards/duck/octagon/v1/rules.mk | 72 +++++++ keyboards/duck/octagon/v1/v1.c | 50 +++++ keyboards/duck/octagon/v1/v1.h | 52 +++++ keyboards/duck/octagon/v2/config.h | 54 +++++ keyboards/duck/octagon/v2/indicator_leds.c | 133 ++++++++++++ keyboards/duck/octagon/v2/indicator_leds.h | 11 + keyboards/duck/octagon/v2/info.json | 12 ++ keyboards/duck/octagon/v2/matrix.c | 258 +++++++++++++++++++++++ keyboards/duck/octagon/v2/readme.md | 28 +++ keyboards/duck/octagon/v2/rules.mk | 74 +++++++ keyboards/duck/octagon/v2/v2.c | 117 ++++++++++ keyboards/duck/octagon/v2/v2.h | 52 +++++ keyboards/octagon/octagon.c | 1 - keyboards/octagon/octagon.h | 14 -- keyboards/octagon/readme.md | 11 - keyboards/octagon/rules.mk | 1 - keyboards/octagon/v1/config.h | 54 ----- keyboards/octagon/v1/info.json | 12 -- keyboards/octagon/v1/keymaps/default/keymap.c | 39 ---- keyboards/octagon/v1/keymaps/default/readme.md | 8 - keyboards/octagon/v1/matrix.c | 227 -------------------- keyboards/octagon/v1/readme.md | 28 --- keyboards/octagon/v1/rules.mk | 72 ------- keyboards/octagon/v1/v1.c | 50 ----- keyboards/octagon/v1/v1.h | 36 ---- keyboards/octagon/v2/config.h | 54 ----- keyboards/octagon/v2/indicator_leds.c | 133 ------------ keyboards/octagon/v2/indicator_leds.h | 11 - keyboards/octagon/v2/info.json | 12 -- keyboards/octagon/v2/keymaps/default/keymap.c | 39 ---- keyboards/octagon/v2/keymaps/default/readme.md | 8 - keyboards/octagon/v2/matrix.c | 258 ----------------------- keyboards/octagon/v2/readme.md | 28 --- keyboards/octagon/v2/rules.mk | 74 ------- keyboards/octagon/v2/v2.c | 117 ---------- keyboards/octagon/v2/v2.h | 52 ----- 45 files changed, 1284 insertions(+), 1340 deletions(-) create mode 100644 keyboards/duck/octagon/keymaps/default/keymap.c create mode 100644 keyboards/duck/octagon/keymaps/default/readme.md create mode 100644 keyboards/duck/octagon/readme.md create mode 100644 keyboards/duck/octagon/rules.mk create mode 100644 keyboards/duck/octagon/v1/config.h create mode 100644 keyboards/duck/octagon/v1/info.json create mode 100644 keyboards/duck/octagon/v1/matrix.c create mode 100644 keyboards/duck/octagon/v1/readme.md create mode 100644 keyboards/duck/octagon/v1/rules.mk create mode 100644 keyboards/duck/octagon/v1/v1.c create mode 100644 keyboards/duck/octagon/v1/v1.h create mode 100644 keyboards/duck/octagon/v2/config.h create mode 100644 keyboards/duck/octagon/v2/indicator_leds.c create mode 100644 keyboards/duck/octagon/v2/indicator_leds.h create mode 100644 keyboards/duck/octagon/v2/info.json create mode 100644 keyboards/duck/octagon/v2/matrix.c create mode 100644 keyboards/duck/octagon/v2/readme.md create mode 100644 keyboards/duck/octagon/v2/rules.mk create mode 100644 keyboards/duck/octagon/v2/v2.c create mode 100644 keyboards/duck/octagon/v2/v2.h delete mode 100644 keyboards/octagon/octagon.c delete mode 100644 keyboards/octagon/octagon.h delete mode 100644 keyboards/octagon/readme.md delete mode 100644 keyboards/octagon/rules.mk delete mode 100644 keyboards/octagon/v1/config.h delete mode 100644 keyboards/octagon/v1/info.json delete mode 100644 keyboards/octagon/v1/keymaps/default/keymap.c delete mode 100644 keyboards/octagon/v1/keymaps/default/readme.md delete mode 100644 keyboards/octagon/v1/matrix.c delete mode 100644 keyboards/octagon/v1/readme.md delete mode 100644 keyboards/octagon/v1/rules.mk delete mode 100644 keyboards/octagon/v1/v1.c delete mode 100644 keyboards/octagon/v1/v1.h delete mode 100644 keyboards/octagon/v2/config.h delete mode 100644 keyboards/octagon/v2/indicator_leds.c delete mode 100644 keyboards/octagon/v2/indicator_leds.h delete mode 100644 keyboards/octagon/v2/info.json delete mode 100644 keyboards/octagon/v2/keymaps/default/keymap.c delete mode 100644 keyboards/octagon/v2/keymaps/default/readme.md delete mode 100644 keyboards/octagon/v2/matrix.c delete mode 100644 keyboards/octagon/v2/readme.md delete mode 100644 keyboards/octagon/v2/rules.mk delete mode 100644 keyboards/octagon/v2/v2.c delete mode 100644 keyboards/octagon/v2/v2.h diff --git a/keyboards/duck/jetfire/readme.md b/keyboards/duck/jetfire/readme.md index fb5baf975b..fe641e622f 100644 --- a/keyboards/duck/jetfire/readme.md +++ b/keyboards/duck/jetfire/readme.md @@ -13,6 +13,6 @@ To get into bootloader mode, hold the top top most key above the 2 navigation ke Make example for this keyboard (after setting up your build environment): - make jetfire:default + make duck/jetfire:default See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/duck/octagon/keymaps/default/keymap.c b/keyboards/duck/octagon/keymaps/default/keymap.c new file mode 100644 index 0000000000..a2029ba051 --- /dev/null +++ b/keyboards/duck/octagon/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define _BL 0 // Base Layer +#define _FL 1 // Fn Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_75_ansi(\ + 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_PAUS, KC_DEL, + 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FL), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FL] = LAYOUT_75_ansi(\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; \ No newline at end of file diff --git a/keyboards/duck/octagon/keymaps/default/readme.md b/keyboards/duck/octagon/keymaps/default/readme.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/duck/octagon/readme.md b/keyboards/duck/octagon/readme.md new file mode 100644 index 0000000000..7f5b2f7e60 --- /dev/null +++ b/keyboards/duck/octagon/readme.md @@ -0,0 +1,11 @@ +# Duck Octagon + +Non official firmware for custom Korean keyboard with 75% key layout made by Duck. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +Newest version is the [Octagon V2](http://duck0113.tistory.com/127) + +Make example for this keyboard (after setting up your build environment): + + make duck/octagon/v2:default diff --git a/keyboards/duck/octagon/rules.mk b/keyboards/duck/octagon/rules.mk new file mode 100644 index 0000000000..46bd457bb7 --- /dev/null +++ b/keyboards/duck/octagon/rules.mk @@ -0,0 +1 @@ +DEFAULT_FOLDER = duck/octagon/v2 \ No newline at end of file diff --git a/keyboards/duck/octagon/v1/config.h b/keyboards/duck/octagon/v1/config.h new file mode 100644 index 0000000000..fbbc8999bb --- /dev/null +++ b/keyboards/duck/octagon/v1/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 MechMerlin + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Octagon V1 +#define DESCRIPTION Duck Octagon V1 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 1 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/duck/octagon/v1/info.json b/keyboards/duck/octagon/v1/info.json new file mode 100644 index 0000000000..1feff95192 --- /dev/null +++ b/keyboards/duck/octagon/v1/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Octagon V1", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + } + } +} diff --git a/keyboards/duck/octagon/v1/matrix.c b/keyboards/duck/octagon/v1/matrix.c new file mode 100644 index 0000000000..8555349943 --- /dev/null +++ b/keyboards/duck/octagon/v1/matrix.c @@ -0,0 +1,227 @@ +/* +Copyright 2017 MechMerlin +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 . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + + +__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) { +} + +void backlight_init_ports(void) +{ + DDRB |= 0b00011111; // PB0 (caps), PB1 (alpha), PB2 (extra), PB3 (modnum), PB4 (caps) + DDRD |= 0b11010000; // PD4, (rgb blue), PD6 (rgb red), PD7 (rgb green) + DDRE |= 0b01000000; // PE6 (frow) +} + +void matrix_init(void) { + backlight_init_ports(); + unselect_cols(); + init_rows(); + + 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++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(col); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * 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 . + */ +#include "v1.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHA = 0b0000001, + BACKLIGHT_EXTRA = 0b0000010, + BACKLIGHT_MODNUM = 0b0000100, + BACKLIGHT_FROW = 0b0001000, + BACKLIGHT_RGB = 0b0010000, + BACKLIGHT_RGBRED = 0b0010000, + BACKLIGHT_RGBGREEN = 0b0100000, + BACKLIGHT_RGBBLUE = 0b1000000, + BACKLIGHT_SWITCH = 0b0001111 +}; + +uint8_t backlight_os_state = 0; +uint32_t backlight_layer_state = 0; + +void backlight_set(uint8_t level) { + level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); + level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); + level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); + level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); + level & BACKLIGHT_RGBRED ? (PORTD |= 0b01000000) : (PORTD &= ~0b01000000); + level & BACKLIGHT_RGBGREEN ? (PORTD |= 0b10000000) : (PORTD &= ~0b10000000); + level & BACKLIGHT_RGBBLUE ? (PORTD |= 0b00010000) : (PORTD &= ~0b00010000); +} + +void led_set_kb(uint8_t usb_led) { + backlight_os_state & (1< + * + * 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 . + */ +#ifndef V1_H +#define V1_H + +#include "quantum.h" + +#define LAYOUT( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5P, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K5O, K2N, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1P, \ + K0A, K0B, K0C, K0G, K0J, K0K, K0L, K0M, K0N, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, KC_NO, K4P }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, KC_NO, K3P }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, K2N, KC_NO, K2P }, \ + { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ +} + +#define LAYOUT_75_ansi( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2N, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1P, \ + K0A, K0B, K0C, K0G, K0J, K0K, K0L, K0M, K0N, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, KC_NO, K4P }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, KC_NO, K3P }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, K2N, KC_NO, K2P }, \ + { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ +} +#endif diff --git a/keyboards/duck/octagon/v2/config.h b/keyboards/duck/octagon/v2/config.h new file mode 100644 index 0000000000..c916a30a1e --- /dev/null +++ b/keyboards/duck/octagon/v2/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 MechMerlin + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Octagon V2 +#define DESCRIPTION Duck Octagon V2 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 1 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/duck/octagon/v2/indicator_leds.c b/keyboards/duck/octagon/v2/indicator_leds.c new file mode 100644 index 0000000000..c24509f514 --- /dev/null +++ b/keyboards/duck/octagon/v2/indicator_leds.c @@ -0,0 +1,133 @@ +/* +Copyright 2017 MechMerlin + +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 . +*/ +#include +#include +#include +#include +#include "indicator_leds.h" + +#define T1H 900 +#define T1L 600 +#define T0H 400 +#define T0L 900 +#define RES 6000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +void send_bit_d4(bool bitVal) { + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + } +} + +void send_bit_d6(bool bitVal) +{ + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (6), + [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); + } +} + +void show(void) { + _delay_us((RES / 1000UL) + 1); +} + +void send_value(uint8_t byte, enum Device device) { + for(uint8_t b = 0; b < 8; b++) { + if(device == Device_STATUSLED) { + send_bit_d4(byte & 0b10000000); + } + if(device == Device_PCBRGB) { + send_bit_d6(byte & 0b10000000); + } + byte <<= 1; + } +} + +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { + send_value(g, device); + send_value(r, device); + send_value(b, device); +} + +// Port from backlight_set_state +void indicator_leds_set(bool leds[8]) { + cli(); + send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0, Device_STATUSLED); + send_color(leds[4] ? 255 : 0, leds[3] ? 255 : 0, leds[5] ? 255 : 0, Device_STATUSLED); + leds[6] ? (PORTD &= ~0b10000000) : (PORTD |= 0b10000000); + sei(); + show(); +} diff --git a/keyboards/duck/octagon/v2/indicator_leds.h b/keyboards/duck/octagon/v2/indicator_leds.h new file mode 100644 index 0000000000..9bb2c8ced9 --- /dev/null +++ b/keyboards/duck/octagon/v2/indicator_leds.h @@ -0,0 +1,11 @@ +enum Device { + Device_PCBRGB, + Device_STATUSLED +}; + +void indicator_leds_set(bool leds[8]); +void backlight_toggle_rgb(bool enabled); +void backlight_set_rgb(uint8_t cfg[17][3]); +void backlight_init_ports(void); +void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); +void show(void); \ No newline at end of file diff --git a/keyboards/duck/octagon/v2/info.json b/keyboards/duck/octagon/v2/info.json new file mode 100644 index 0000000000..7bc0c6ef90 --- /dev/null +++ b/keyboards/duck/octagon/v2/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Octagon V2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + } + } +} diff --git a/keyboards/duck/octagon/v2/matrix.c b/keyboards/duck/octagon/v2/matrix.c new file mode 100644 index 0000000000..a63a37640f --- /dev/null +++ b/keyboards/duck/octagon/v2/matrix.c @@ -0,0 +1,258 @@ +/* +Copyright 2017 MechMerlin +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 . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + + +__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) { +} + +void backlight_init_ports(void) +{ + DDRD |= 0b11010000; + PORTD &= ~0b01010000; + PORTD |= 0b10000000; + DDRB |= 0b00011111; + PORTB &= ~0b00001110; + PORTB |= 0b00010001; + DDRE |= 0b01000000; + PORTE &= ~0b01000000; +} + +void matrix_init(void) { + backlight_init_ports(); + unselect_cols(); + init_rows(); + + 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++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(col); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * 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 . + */ +#include "v2.h" +#include "indicator_leds.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHA = 0b0000001, + BACKLIGHT_EXTRA = 0b0000010, + BACKLIGHT_MODNUM = 0b0000100, + BACKLIGHT_FROW = 0b0001000, + BACKLIGHT_RGB = 0b0010000, + BACKLIGHT_SWITCH = 0b0001111 +}; + +uint8_t backlight_rgb_r = 255; +uint8_t backlight_rgb_g = 0; +uint8_t backlight_rgb_b = 0; +uint8_t backlight_os_state = 0; +uint32_t backlight_layer_state = 0; + +void backlight_toggle_rgb(bool enabled) +{ + if(enabled) { + uint8_t rgb[17][3] = { + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, + {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b} + }; + backlight_set_rgb(rgb); + } else { + uint8_t rgb[17][3] = { + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0}, + {0, 0, 0} + }; + backlight_set_rgb(rgb); + } +} + +void backlight_set_rgb(uint8_t cfg[17][3]) +{ + cli(); + for(uint8_t i = 0; i < 17; ++i) { + send_color(cfg[i][0], cfg[i][1], cfg[i][2], Device_PCBRGB); + } + sei(); + show(); +} + +void backlight_set(uint8_t level) { + level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); + level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); + level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); + level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); + level & BACKLIGHT_RGB ? backlight_toggle_rgb(true) : backlight_toggle_rgb(false); +} + +// Port from backlight_update_state +void led_set_kb(uint8_t usb_led) { + bool status[7] = { + backlight_os_state & (1< + * + * 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 . + */ +#ifndef V2_H +#define V2_H + +#include "quantum.h" + +#define LAYOUT( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, K2P, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ + K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, KC_NO, K2O, K2P, KC_NO }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ +} + +#define LAYOUT_75_ansi( \ + K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ + K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ +) { \ + { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, K2P, KC_NO }, \ + { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ + { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ +} +#endif diff --git a/keyboards/octagon/octagon.c b/keyboards/octagon/octagon.c deleted file mode 100644 index 6eb9e73b24..0000000000 --- a/keyboards/octagon/octagon.c +++ /dev/null @@ -1 +0,0 @@ -#include "octagon.h" diff --git a/keyboards/octagon/octagon.h b/keyboards/octagon/octagon.h deleted file mode 100644 index d91da2eda8..0000000000 --- a/keyboards/octagon/octagon.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef OCTAGON_H -#define OCTAGON_H - -#include "quantum.h" - -#ifdef KEYBOARD_octagon_v1 - #include "v1.h" -#endif - -#ifdef KEYBOARD_octagon_v2 - #include "v2.h" -#endif - -#endif diff --git a/keyboards/octagon/readme.md b/keyboards/octagon/readme.md deleted file mode 100644 index 5b3169424a..0000000000 --- a/keyboards/octagon/readme.md +++ /dev/null @@ -1,11 +0,0 @@ -# Duck Octagon - -Non official firmware for custom Korean keyboard with 75% key layout made by Duck. - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -Newest version is the [Octagon V2](http://duck0113.tistory.com/127) - -Make example for this keyboard (after setting up your build environment): - - make octagon/v2:default diff --git a/keyboards/octagon/rules.mk b/keyboards/octagon/rules.mk deleted file mode 100644 index ce04362e6f..0000000000 --- a/keyboards/octagon/rules.mk +++ /dev/null @@ -1 +0,0 @@ -DEFAULT_FOLDER = octagon/v2 \ No newline at end of file diff --git a/keyboards/octagon/v1/config.h b/keyboards/octagon/v1/config.h deleted file mode 100644 index fbbc8999bb..0000000000 --- a/keyboards/octagon/v1/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 MechMerlin - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER Duck -#define PRODUCT Octagon V1 -#define DESCRIPTION Duck Octagon V1 - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 16 - -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D6 -#define RGBLED_NUM 17 - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/octagon/v1/info.json b/keyboards/octagon/v1/info.json deleted file mode 100644 index 1feff95192..0000000000 --- a/keyboards/octagon/v1/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Octagon V1", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6, - "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] - } - } -} diff --git a/keyboards/octagon/v1/keymaps/default/keymap.c b/keyboards/octagon/v1/keymaps/default/keymap.c deleted file mode 100644 index 2faf7a9fc4..0000000000 --- a/keyboards/octagon/v1/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * 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 . - */ -#include "octagon.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [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_PAUS, - 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_HOME, - 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_PGUP, - 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_NO, KC_ENT, KC_PGDN, - KC_LSFT, 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_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_NO, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), - - [1] = LAYOUT(\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/octagon/v1/keymaps/default/readme.md b/keyboards/octagon/v1/keymaps/default/readme.md deleted file mode 100644 index 3a3e3db577..0000000000 --- a/keyboards/octagon/v1/keymaps/default/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Default Octagon Layout - -This is the default implement layout for Duck Octagon V1. - - -## Features - -* Default QWERTY layer diff --git a/keyboards/octagon/v1/matrix.c b/keyboards/octagon/v1/matrix.c deleted file mode 100644 index 8555349943..0000000000 --- a/keyboards/octagon/v1/matrix.c +++ /dev/null @@ -1,227 +0,0 @@ -/* -Copyright 2017 MechMerlin -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 . -*/ - -#include -#include -#include -#include "matrix.h" -#include "util.h" -#include "print.h" -#include "debug.h" - -static uint8_t debouncing = DEBOUNCING_DELAY; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(uint8_t col); -static void init_rows(void); -static void unselect_cols(void); -static void select_col(uint8_t col); - - -__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) { -} - -void backlight_init_ports(void) -{ - DDRB |= 0b00011111; // PB0 (caps), PB1 (alpha), PB2 (extra), PB3 (modnum), PB4 (caps) - DDRD |= 0b11010000; // PD4, (rgb blue), PD6 (rgb red), PD7 (rgb green) - DDRE |= 0b01000000; // PE6 (frow) -} - -void matrix_init(void) { - backlight_init_ports(); - unselect_cols(); - init_rows(); - - 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++) { - select_col(col); - _delay_us(3); - - uint8_t rows = read_rows(col); - - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - * - * 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 . - */ -#include "v1.h" - -enum BACKLIGHT_AREAS { - BACKLIGHT_ALPHA = 0b0000001, - BACKLIGHT_EXTRA = 0b0000010, - BACKLIGHT_MODNUM = 0b0000100, - BACKLIGHT_FROW = 0b0001000, - BACKLIGHT_RGB = 0b0010000, - BACKLIGHT_RGBRED = 0b0010000, - BACKLIGHT_RGBGREEN = 0b0100000, - BACKLIGHT_RGBBLUE = 0b1000000, - BACKLIGHT_SWITCH = 0b0001111 -}; - -uint8_t backlight_os_state = 0; -uint32_t backlight_layer_state = 0; - -void backlight_set(uint8_t level) { - level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); - level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); - level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); - level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); - level & BACKLIGHT_RGBRED ? (PORTD |= 0b01000000) : (PORTD &= ~0b01000000); - level & BACKLIGHT_RGBGREEN ? (PORTD |= 0b10000000) : (PORTD &= ~0b10000000); - level & BACKLIGHT_RGBBLUE ? (PORTD |= 0b00010000) : (PORTD &= ~0b00010000); -} - -void led_set_kb(uint8_t usb_led) { - backlight_os_state & (1< - * - * 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 . - */ -#ifndef V1_H -#define V1_H - -#include "../octagon.h" - -#define LAYOUT( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5P, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4P, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, K3P, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K5O, K2N, K2P, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, K1M, K1N, K1P, \ - K0A, K0B, K0C, K0G, K0J, K0K, K0L, K0M, K0N, K0P \ -) { \ - { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5P }, \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, KC_NO, K4P }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3N, KC_NO, K3P }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, K2N, KC_NO, K2P }, \ - { K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1L, KC_NO, K1M, K1N, KC_NO, K1P }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, K0G, KC_NO, KC_NO, K0J, K0K, K0L, KC_NO, K0M, K0N, KC_NO, K0P } \ -} -#endif diff --git a/keyboards/octagon/v2/config.h b/keyboards/octagon/v2/config.h deleted file mode 100644 index c916a30a1e..0000000000 --- a/keyboards/octagon/v2/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 MechMerlin - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER Duck -#define PRODUCT Octagon V2 -#define DESCRIPTION Duck Octagon V2 - -/* key matrix size */ -#define MATRIX_ROWS 6 -#define MATRIX_COLS 17 - -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 1 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D6 -#define RGBLED_NUM 17 - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/octagon/v2/indicator_leds.c b/keyboards/octagon/v2/indicator_leds.c deleted file mode 100644 index c24509f514..0000000000 --- a/keyboards/octagon/v2/indicator_leds.c +++ /dev/null @@ -1,133 +0,0 @@ -/* -Copyright 2017 MechMerlin - -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 . -*/ -#include -#include -#include -#include -#include "indicator_leds.h" - -#define T1H 900 -#define T1L 600 -#define T0H 400 -#define T0L 900 -#define RES 6000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - -void send_bit_d4(bool bitVal) { - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); - } -} - -void send_bit_d6(bool bitVal) -{ - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (6), - [onCycles] "I" (NS_TO_CYCLES(T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(T0L) - 2)); - } -} - -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte, enum Device device) { - for(uint8_t b = 0; b < 8; b++) { - if(device == Device_STATUSLED) { - send_bit_d4(byte & 0b10000000); - } - if(device == Device_PCBRGB) { - send_bit_d6(byte & 0b10000000); - } - byte <<= 1; - } -} - -void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device) { - send_value(g, device); - send_value(r, device); - send_value(b, device); -} - -// Port from backlight_set_state -void indicator_leds_set(bool leds[8]) { - cli(); - send_color(leds[1] ? 255 : 0, leds[2] ? 255 : 0, leds[0] ? 255 : 0, Device_STATUSLED); - send_color(leds[4] ? 255 : 0, leds[3] ? 255 : 0, leds[5] ? 255 : 0, Device_STATUSLED); - leds[6] ? (PORTD &= ~0b10000000) : (PORTD |= 0b10000000); - sei(); - show(); -} diff --git a/keyboards/octagon/v2/indicator_leds.h b/keyboards/octagon/v2/indicator_leds.h deleted file mode 100644 index 9bb2c8ced9..0000000000 --- a/keyboards/octagon/v2/indicator_leds.h +++ /dev/null @@ -1,11 +0,0 @@ -enum Device { - Device_PCBRGB, - Device_STATUSLED -}; - -void indicator_leds_set(bool leds[8]); -void backlight_toggle_rgb(bool enabled); -void backlight_set_rgb(uint8_t cfg[17][3]); -void backlight_init_ports(void); -void send_color(uint8_t r, uint8_t g, uint8_t b, enum Device device); -void show(void); \ No newline at end of file diff --git a/keyboards/octagon/v2/info.json b/keyboards/octagon/v2/info.json deleted file mode 100644 index 7bc0c6ef90..0000000000 --- a/keyboards/octagon/v2/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Octagon V2", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6, - "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] - } - } -} diff --git a/keyboards/octagon/v2/keymaps/default/keymap.c b/keyboards/octagon/v2/keymaps/default/keymap.c deleted file mode 100644 index b3182fc239..0000000000 --- a/keyboards/octagon/v2/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [0] = LAYOUT_75_ansi(\ - 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_PAUS, KC_DEL, - 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_HOME, - 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_PGUP, - 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_PGDN, - KC_LSFT, 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_END, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), - - [1] = LAYOUT_75_ansi(\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) - }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; \ No newline at end of file diff --git a/keyboards/octagon/v2/keymaps/default/readme.md b/keyboards/octagon/v2/keymaps/default/readme.md deleted file mode 100644 index d52c00129f..0000000000 --- a/keyboards/octagon/v2/keymaps/default/readme.md +++ /dev/null @@ -1,8 +0,0 @@ -# Default Octagon Layout - -This is the default implement layout for Duck Octagon V2. - - -## Features - -* Default QWERTY layer \ No newline at end of file diff --git a/keyboards/octagon/v2/matrix.c b/keyboards/octagon/v2/matrix.c deleted file mode 100644 index a63a37640f..0000000000 --- a/keyboards/octagon/v2/matrix.c +++ /dev/null @@ -1,258 +0,0 @@ -/* -Copyright 2017 MechMerlin -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 . -*/ - -#include -#include -#include -#include "matrix.h" -#include "util.h" -#include "print.h" -#include "debug.h" - -static uint8_t debouncing = DEBOUNCING_DELAY; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(uint8_t col); -static void init_rows(void); -static void unselect_cols(void); -static void select_col(uint8_t col); - - -__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) { -} - -void backlight_init_ports(void) -{ - DDRD |= 0b11010000; - PORTD &= ~0b01010000; - PORTD |= 0b10000000; - DDRB |= 0b00011111; - PORTB &= ~0b00001110; - PORTB |= 0b00010001; - DDRE |= 0b01000000; - PORTE &= ~0b01000000; -} - -void matrix_init(void) { - backlight_init_ports(); - unselect_cols(); - init_rows(); - - 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++) { - select_col(col); - _delay_us(3); - - uint8_t rows = read_rows(col); - - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - * - * 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 . - */ -#include "v2.h" -#include "indicator_leds.h" - -enum BACKLIGHT_AREAS { - BACKLIGHT_ALPHA = 0b0000001, - BACKLIGHT_EXTRA = 0b0000010, - BACKLIGHT_MODNUM = 0b0000100, - BACKLIGHT_FROW = 0b0001000, - BACKLIGHT_RGB = 0b0010000, - BACKLIGHT_SWITCH = 0b0001111 -}; - -uint8_t backlight_rgb_r = 255; -uint8_t backlight_rgb_g = 0; -uint8_t backlight_rgb_b = 0; -uint8_t backlight_os_state = 0; -uint32_t backlight_layer_state = 0; - -void backlight_toggle_rgb(bool enabled) -{ - if(enabled) { - uint8_t rgb[17][3] = { - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b}, - {backlight_rgb_r, backlight_rgb_g, backlight_rgb_b} - }; - backlight_set_rgb(rgb); - } else { - uint8_t rgb[17][3] = { - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0}, - {0, 0, 0} - }; - backlight_set_rgb(rgb); - } -} - -void backlight_set_rgb(uint8_t cfg[17][3]) -{ - cli(); - for(uint8_t i = 0; i < 17; ++i) { - send_color(cfg[i][0], cfg[i][1], cfg[i][2], Device_PCBRGB); - } - sei(); - show(); -} - -void backlight_set(uint8_t level) { - level & BACKLIGHT_ALPHA ? (PORTB |= 0b00000010) : (PORTB &= ~0b00000010); - level & BACKLIGHT_EXTRA ? (PORTB |= 0b00000100) : (PORTB &= ~0b00000100); - level & BACKLIGHT_MODNUM ? (PORTB |= 0b00001000) : (PORTB &= ~0b00001000); - level & BACKLIGHT_FROW ? (PORTE |= 0b01000000) : (PORTE &= ~0b01000000); - level & BACKLIGHT_RGB ? backlight_toggle_rgb(true) : backlight_toggle_rgb(false); -} - -// Port from backlight_update_state -void led_set_kb(uint8_t usb_led) { - bool status[7] = { - backlight_os_state & (1< - * - * 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 . - */ -#ifndef V2_H -#define V2_H - -#include "../octagon.h" - -#define LAYOUT( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, K2P, \ - K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ - K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ -) { \ - { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, KC_NO, K2O, K2P, KC_NO }, \ - { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ -} - -#define LAYOUT_75_ansi( \ - K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, K5Q, \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, K4P, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, K3P, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, K2P, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, K1P, \ - K0A, K0B, K0C, K0J, K0K, K0L, K0M, K0N, K0O, K0P \ -) { \ - { K5A, K5B, K5C, K5D, K5E, K5F, K5G, K5H, K5I, K5J, K5K, K5L, K5M, K5N, K5O, KC_NO, K5Q }, \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, KC_NO, K4O, K4P, KC_NO }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, KC_NO, K3O, K3P, KC_NO }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, KC_NO, KC_NO, K2O, K2P, KC_NO }, \ - { K1A, KC_NO, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, KC_NO, K1M, K1N, K1O, K1P, KC_NO }, \ - { K0A, K0B, K0C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0J, KC_NO, K0K, K0L, K0M, K0N, K0O, K0P, KC_NO } \ -} -#endif -- cgit v1.2.3 From b1935c5e0dcd1adf32df652c65deffad35cd7405 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 28 Aug 2018 16:52:30 -0700 Subject: Putting my ducks in a row: Eagle/Viper V2 into Duck directory (#3766) * mv eagle_viper into duck * delete files * remove eagle_viper .c and .h --- keyboards/duck/eagle_viper/info.json | 19 ++ keyboards/duck/eagle_viper/readme.md | 12 + keyboards/duck/eagle_viper/rules.mk | 3 + keyboards/duck/eagle_viper/v2/config.h | 54 +++++ keyboards/duck/eagle_viper/v2/indicator_leds.c | 89 +++++++ keyboards/duck/eagle_viper/v2/indicator_leds.h | 2 + .../duck/eagle_viper/v2/keymaps/default/keymap.c | 39 ++++ .../duck/eagle_viper/v2/keymaps/default/readme.md | 10 + .../eagle_viper/v2/keymaps/profanum429/keymap.c | 39 ++++ .../eagle_viper/v2/keymaps/profanum429/readme.md | 5 + keyboards/duck/eagle_viper/v2/matrix.c | 257 +++++++++++++++++++++ keyboards/duck/eagle_viper/v2/readme.md | 30 +++ keyboards/duck/eagle_viper/v2/rules.mk | 72 ++++++ keyboards/duck/eagle_viper/v2/v2.c | 65 ++++++ keyboards/duck/eagle_viper/v2/v2.h | 81 +++++++ keyboards/eagle_viper/eagle_viper.c | 1 - keyboards/eagle_viper/eagle_viper.h | 10 - keyboards/eagle_viper/info.json | 19 -- keyboards/eagle_viper/readme.md | 12 - keyboards/eagle_viper/rules.mk | 3 - keyboards/eagle_viper/v2/config.h | 54 ----- keyboards/eagle_viper/v2/indicator_leds.c | 89 ------- keyboards/eagle_viper/v2/indicator_leds.h | 2 - keyboards/eagle_viper/v2/keymaps/default/keymap.c | 39 ---- keyboards/eagle_viper/v2/keymaps/default/readme.md | 10 - .../eagle_viper/v2/keymaps/profanum429/keymap.c | 39 ---- .../eagle_viper/v2/keymaps/profanum429/readme.md | 5 - keyboards/eagle_viper/v2/matrix.c | 257 --------------------- keyboards/eagle_viper/v2/readme.md | 30 --- keyboards/eagle_viper/v2/rules.mk | 72 ------ keyboards/eagle_viper/v2/v2.c | 65 ------ keyboards/eagle_viper/v2/v2.h | 81 ------- 32 files changed, 777 insertions(+), 788 deletions(-) create mode 100644 keyboards/duck/eagle_viper/info.json create mode 100644 keyboards/duck/eagle_viper/readme.md create mode 100644 keyboards/duck/eagle_viper/rules.mk create mode 100644 keyboards/duck/eagle_viper/v2/config.h create mode 100644 keyboards/duck/eagle_viper/v2/indicator_leds.c create mode 100644 keyboards/duck/eagle_viper/v2/indicator_leds.h create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/default/readme.md create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c create mode 100644 keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md create mode 100644 keyboards/duck/eagle_viper/v2/matrix.c create mode 100644 keyboards/duck/eagle_viper/v2/readme.md create mode 100644 keyboards/duck/eagle_viper/v2/rules.mk create mode 100644 keyboards/duck/eagle_viper/v2/v2.c create mode 100644 keyboards/duck/eagle_viper/v2/v2.h delete mode 100644 keyboards/eagle_viper/eagle_viper.c delete mode 100644 keyboards/eagle_viper/eagle_viper.h delete mode 100644 keyboards/eagle_viper/info.json delete mode 100644 keyboards/eagle_viper/readme.md delete mode 100644 keyboards/eagle_viper/rules.mk delete mode 100644 keyboards/eagle_viper/v2/config.h delete mode 100644 keyboards/eagle_viper/v2/indicator_leds.c delete mode 100644 keyboards/eagle_viper/v2/indicator_leds.h delete mode 100644 keyboards/eagle_viper/v2/keymaps/default/keymap.c delete mode 100644 keyboards/eagle_viper/v2/keymaps/default/readme.md delete mode 100644 keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c delete mode 100644 keyboards/eagle_viper/v2/keymaps/profanum429/readme.md delete mode 100644 keyboards/eagle_viper/v2/matrix.c delete mode 100644 keyboards/eagle_viper/v2/readme.md delete mode 100644 keyboards/eagle_viper/v2/rules.mk delete mode 100644 keyboards/eagle_viper/v2/v2.c delete mode 100644 keyboards/eagle_viper/v2/v2.h diff --git a/keyboards/duck/eagle_viper/info.json b/keyboards/duck/eagle_viper/info.json new file mode 100644 index 0000000000..f20babdbcf --- /dev/null +++ b/keyboards/duck/eagle_viper/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "Eagle/Viper", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"ISO#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_eagle": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_eagle_splits": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_viper": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"GUI", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"GUI", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/duck/eagle_viper/readme.md b/keyboards/duck/eagle_viper/readme.md new file mode 100644 index 0000000000..ded0fa72e9 --- /dev/null +++ b/keyboards/duck/eagle_viper/readme.md @@ -0,0 +1,12 @@ +# Duck Eagle/Viper + +Non official firmware for custom Korean keyboard with 60% key layout made by Duck. + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) + +Make example for this keyboard (after setting up your build environment): + + make duck/eagle_viper/v2:default + diff --git a/keyboards/duck/eagle_viper/rules.mk b/keyboards/duck/eagle_viper/rules.mk new file mode 100644 index 0000000000..263767d064 --- /dev/null +++ b/keyboards/duck/eagle_viper/rules.mk @@ -0,0 +1,3 @@ +DEFAULT_FOLDER = duck/eagle_viper/v2 + +LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/duck/eagle_viper/v2/config.h b/keyboards/duck/eagle_viper/v2/config.h new file mode 100644 index 0000000000..f04b4a0fd3 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2017 MechMerlin + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Duck +#define PRODUCT Eagle/Viper V2 +#define DESCRIPTION 60% Korean custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D6 +#define RGBLED_NUM 17 + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.c b/keyboards/duck/eagle_viper/v2/indicator_leds.c new file mode 100644 index 0000000000..03a93197da --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.c @@ -0,0 +1,89 @@ +/* +Copyright 2017 MechMerlin + +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 . +*/ +#include +#include +#include +#include +#include "indicator_leds.h" + +#define RES 6000 + +#define LED_T1H 600 +#define LED_T1L 650 +#define LED_T0H 250 +#define LED_T0L 1000 + +#define NS_PER_SEC (1000000000L) +#define CYCLES_PER_SEC (F_CPU) +#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) +#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) + +void send_bit_d4(bool bitVal) { + if(bitVal) { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); + } else { + asm volatile ( + "sbi %[port], %[bit] \n\t" + ".rept %[onCycles] \n\t" + "nop \n\t" + ".endr \n\t" + "cbi %[port], %[bit] \n\t" + ".rept %[offCycles] \n\t" + "nop \n\t" + ".endr \n\t" + :: + [port] "I" (_SFR_IO_ADDR(PORTD)), + [bit] "I" (4), + [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), + [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); + } +} + +void show(void) { + _delay_us((RES / 1000UL) + 1); +} + +void send_value(uint8_t byte) { + for(uint8_t b = 0; b < 8; b++) { + send_bit_d4(byte & 0b10000000); + byte <<= 1; + } +} + +// Send the LED indicators to the WS2811S chips +void indicator_leds_set(bool leds[8]) { + uint8_t led_cnt; + + cli(); + for(led_cnt = 0; led_cnt < 8; led_cnt++) + send_value(leds[led_cnt] ? 255 : 0); + sei(); + show(); +} diff --git a/keyboards/duck/eagle_viper/v2/indicator_leds.h b/keyboards/duck/eagle_viper/v2/indicator_leds.h new file mode 100644 index 0000000000..c174fa404d --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/indicator_leds.h @@ -0,0 +1,2 @@ +void indicator_leds_set(bool leds[8]); +void show(void); diff --git a/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c new file mode 100644 index 0000000000..332db66e64 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2017 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_all(\ + 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, XXXXXXX, KC_BSPC, \ + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \ + ), + + [1] = LAYOUT_all(\ + _______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md b/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md new file mode 100644 index 0000000000..834ff7cd3a --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/default/readme.md @@ -0,0 +1,10 @@ +# Default Eagle Layout + +This is the default implement layout for Duck Eagle V2. + +![Duck Eagle V2 Default Layout](https://imgur.com/mWBY3Dc.png) + + +## Features + +* Default QWERTY layer diff --git a/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c new file mode 100644 index 0000000000..a0163ad6aa --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2017 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_viper( \ + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI \ + ), + + [1] = LAYOUT_viper( \ + _______, 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_INS, KC_DEL, \ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \ + _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, \ + _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ + _______, _______, _______, _______, _______ \ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +}; diff --git a/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md new file mode 100644 index 0000000000..0f993559ea --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/keymaps/profanum429/readme.md @@ -0,0 +1,5 @@ +# Profanum429 Duck Viper V2 Layout +TODO + +## Features +TODO diff --git a/keyboards/duck/eagle_viper/v2/matrix.c b/keyboards/duck/eagle_viper/v2/matrix.c new file mode 100644 index 0000000000..7003a7ae00 --- /dev/null +++ b/keyboards/duck/eagle_viper/v2/matrix.c @@ -0,0 +1,257 @@ +/* +Copyright 2017 MechMerlin +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 . +*/ + +#include +#include +#include +#include "matrix.h" +#include "util.h" +#include "print.h" +#include "debug.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(uint8_t col); +static void init_rows(void); +static void unselect_cols(void); +static void select_col(uint8_t col); + + +__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) { +} + +void backlight_init_ports(void) +{ + DDRD |= 0b11010000; + PORTD &= ~0b01010000; + PORTD |= 0b10000000; + DDRB |= 0b00011111; + PORTB &= ~0b00001110; + PORTB |= 0b00010001; + DDRE |= 0b01000000; + PORTE &= ~0b01000000; +} + +void matrix_init(void) { + backlight_init_ports(); + unselect_cols(); + init_rows(); + + 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++) { + select_col(col); + _delay_us(3); + + uint8_t rows = read_rows(col); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * 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 . + */ +#include "v2.h" +#include "indicator_leds.h" + +enum BACKLIGHT_AREAS { + BACKLIGHT_ALPHAS = 0b00000010, + BACKLIGHT_MODNUM = 0b00001000 +}; + +void backlight_set(uint8_t level) { + switch(level) { + case 0: + PORTB |= BACKLIGHT_ALPHAS; + PORTB |= BACKLIGHT_MODNUM; + break; + case 1: + PORTB &= ~BACKLIGHT_ALPHAS; + PORTB |= BACKLIGHT_MODNUM; + break; + case 2: + PORTB |= BACKLIGHT_ALPHAS; + PORTB &= ~BACKLIGHT_MODNUM; + break; + case 3: + PORTB &= ~BACKLIGHT_ALPHAS; + PORTB &= ~BACKLIGHT_MODNUM; + break; + } +} + +// Port from backlight_update_state +void led_set_kb(uint8_t usb_led) { + bool status[8] = { + host_keyboard_leds() & (1< + * + * 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 . + */ +#ifndef V2_H +#define V2_H + +#include "quantum.h" + +#define ___ KC_NO + +#define LAYOUT_all( \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ +) { \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, ___, K2O }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ +} + +#define LAYOUT_60_ansi( \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ +) { \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, ___, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, ___ }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ +} + +#define LAYOUT_eagle_splits( \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ + K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ + K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ +) { \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ +} + +#define LAYOUT_viper( \ + K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ + K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ + K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ + K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ + K0B, K0C, K0I, K0M, K0N \ +) { \ + { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ + { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ + { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ + { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ + { ___, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, ___, ___, K0M, K0N, ___ } \ +} + +#define LAYOUT_eagle LAYOUT_60_ansi + +#endif diff --git a/keyboards/eagle_viper/eagle_viper.c b/keyboards/eagle_viper/eagle_viper.c deleted file mode 100644 index c2d44c4e7e..0000000000 --- a/keyboards/eagle_viper/eagle_viper.c +++ /dev/null @@ -1 +0,0 @@ -#include "eagle_viper.h" diff --git a/keyboards/eagle_viper/eagle_viper.h b/keyboards/eagle_viper/eagle_viper.h deleted file mode 100644 index fc34e7dde8..0000000000 --- a/keyboards/eagle_viper/eagle_viper.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef EAGLE_VIPER_H -#define EAGLE_VIPER_H - -#include "quantum.h" - -#ifdef KEYBOARD_eagle_viper_v2 - #include "v2.h" -#endif - -#endif diff --git a/keyboards/eagle_viper/info.json b/keyboards/eagle_viper/info.json deleted file mode 100644 index f20babdbcf..0000000000 --- a/keyboards/eagle_viper/info.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "keyboard_name": "Eagle/Viper", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"ISO#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"ISO\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_eagle": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_eagle_splits": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"GUI", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_viper": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"GUI", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"GUI", "x":12.5, "y":4}] - } - } -} diff --git a/keyboards/eagle_viper/readme.md b/keyboards/eagle_viper/readme.md deleted file mode 100644 index 48f4a4be33..0000000000 --- a/keyboards/eagle_viper/readme.md +++ /dev/null @@ -1,12 +0,0 @@ -# Duck Eagle/Viper - -Non official firmware for custom Korean keyboard with 60% key layout made by Duck. - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -Newest version is the [Eagle/Viper V2](http://duck0113.tistory.com/127) - -Make example for this keyboard (after setting up your build environment): - - make eagle_viper/v2:default - diff --git a/keyboards/eagle_viper/rules.mk b/keyboards/eagle_viper/rules.mk deleted file mode 100644 index ad8bd5ca14..0000000000 --- a/keyboards/eagle_viper/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -DEFAULT_FOLDER = eagle_viper/v2 - -LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/eagle_viper/v2/config.h b/keyboards/eagle_viper/v2/config.h deleted file mode 100644 index f04b4a0fd3..0000000000 --- a/keyboards/eagle_viper/v2/config.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -Copyright 2017 MechMerlin - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER Duck -#define PRODUCT Eagle/Viper V2 -#define DESCRIPTION 60% Korean custom keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D6 -#define RGBLED_NUM 17 - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/eagle_viper/v2/indicator_leds.c b/keyboards/eagle_viper/v2/indicator_leds.c deleted file mode 100644 index 03a93197da..0000000000 --- a/keyboards/eagle_viper/v2/indicator_leds.c +++ /dev/null @@ -1,89 +0,0 @@ -/* -Copyright 2017 MechMerlin - -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 . -*/ -#include -#include -#include -#include -#include "indicator_leds.h" - -#define RES 6000 - -#define LED_T1H 600 -#define LED_T1L 650 -#define LED_T0H 250 -#define LED_T0L 1000 - -#define NS_PER_SEC (1000000000L) -#define CYCLES_PER_SEC (F_CPU) -#define NS_PER_CYCLE (NS_PER_SEC / CYCLES_PER_SEC) -#define NS_TO_CYCLES(n) ((n) / NS_PER_CYCLE) - -void send_bit_d4(bool bitVal) { - if(bitVal) { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(LED_T1H) - 2), - [offCycles] "I" (NS_TO_CYCLES(LED_T1L) - 2)); - } else { - asm volatile ( - "sbi %[port], %[bit] \n\t" - ".rept %[onCycles] \n\t" - "nop \n\t" - ".endr \n\t" - "cbi %[port], %[bit] \n\t" - ".rept %[offCycles] \n\t" - "nop \n\t" - ".endr \n\t" - :: - [port] "I" (_SFR_IO_ADDR(PORTD)), - [bit] "I" (4), - [onCycles] "I" (NS_TO_CYCLES(LED_T0H) - 2), - [offCycles] "I" (NS_TO_CYCLES(LED_T0L) - 2)); - } -} - -void show(void) { - _delay_us((RES / 1000UL) + 1); -} - -void send_value(uint8_t byte) { - for(uint8_t b = 0; b < 8; b++) { - send_bit_d4(byte & 0b10000000); - byte <<= 1; - } -} - -// Send the LED indicators to the WS2811S chips -void indicator_leds_set(bool leds[8]) { - uint8_t led_cnt; - - cli(); - for(led_cnt = 0; led_cnt < 8; led_cnt++) - send_value(leds[led_cnt] ? 255 : 0); - sei(); - show(); -} diff --git a/keyboards/eagle_viper/v2/indicator_leds.h b/keyboards/eagle_viper/v2/indicator_leds.h deleted file mode 100644 index c174fa404d..0000000000 --- a/keyboards/eagle_viper/v2/indicator_leds.h +++ /dev/null @@ -1,2 +0,0 @@ -void indicator_leds_set(bool leds[8]); -void show(void); diff --git a/keyboards/eagle_viper/v2/keymaps/default/keymap.c b/keyboards/eagle_viper/v2/keymaps/default/keymap.c deleted file mode 100644 index 332db66e64..0000000000 --- a/keyboards/eagle_viper/v2/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [0] = LAYOUT_all(\ - 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, XXXXXXX, KC_BSPC, \ - 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ - KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, XXXXXXX, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RALT, KC_RGUI, KC_RCTL \ - ), - - [1] = LAYOUT_all(\ - _______, RGB_TOG, RGB_MOD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/eagle_viper/v2/keymaps/default/readme.md b/keyboards/eagle_viper/v2/keymaps/default/readme.md deleted file mode 100644 index 834ff7cd3a..0000000000 --- a/keyboards/eagle_viper/v2/keymaps/default/readme.md +++ /dev/null @@ -1,10 +0,0 @@ -# Default Eagle Layout - -This is the default implement layout for Duck Eagle V2. - -![Duck Eagle V2 Default Layout](https://imgur.com/mWBY3Dc.png) - - -## Features - -* Default QWERTY layer diff --git a/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c b/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c deleted file mode 100644 index a0163ad6aa..0000000000 --- a/keyboards/eagle_viper/v2/keymaps/profanum429/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* layer 0: qwerty */ - [0] = LAYOUT_viper( \ - KC_ESC, 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_BSLS, KC_GRV, \ - 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_BSPC, \ - KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ - KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI \ - ), - - [1] = LAYOUT_viper( \ - _______, 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_INS, KC_DEL, \ - KC_CAPS, RGB_TOG, RGB_MOD, RGB_VAI, RESET, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_BSPC, \ - _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_ENT, \ - _______, _______, _______, _______, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, \ - _______, _______, _______, _______, _______ \ - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md b/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md deleted file mode 100644 index 0f993559ea..0000000000 --- a/keyboards/eagle_viper/v2/keymaps/profanum429/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Profanum429 Duck Viper V2 Layout -TODO - -## Features -TODO diff --git a/keyboards/eagle_viper/v2/matrix.c b/keyboards/eagle_viper/v2/matrix.c deleted file mode 100644 index 7003a7ae00..0000000000 --- a/keyboards/eagle_viper/v2/matrix.c +++ /dev/null @@ -1,257 +0,0 @@ -/* -Copyright 2017 MechMerlin -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 . -*/ - -#include -#include -#include -#include "matrix.h" -#include "util.h" -#include "print.h" -#include "debug.h" - -static uint8_t debouncing = DEBOUNCING_DELAY; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(uint8_t col); -static void init_rows(void); -static void unselect_cols(void); -static void select_col(uint8_t col); - - -__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) { -} - -void backlight_init_ports(void) -{ - DDRD |= 0b11010000; - PORTD &= ~0b01010000; - PORTD |= 0b10000000; - DDRB |= 0b00011111; - PORTB &= ~0b00001110; - PORTB |= 0b00010001; - DDRE |= 0b01000000; - PORTE &= ~0b01000000; -} - -void matrix_init(void) { - backlight_init_ports(); - unselect_cols(); - init_rows(); - - 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++) { - select_col(col); - _delay_us(3); - - uint8_t rows = read_rows(col); - - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - * - * 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 . - */ -#include "v2.h" -#include "indicator_leds.h" - -enum BACKLIGHT_AREAS { - BACKLIGHT_ALPHAS = 0b00000010, - BACKLIGHT_MODNUM = 0b00001000 -}; - -void backlight_set(uint8_t level) { - switch(level) { - case 0: - PORTB |= BACKLIGHT_ALPHAS; - PORTB |= BACKLIGHT_MODNUM; - break; - case 1: - PORTB &= ~BACKLIGHT_ALPHAS; - PORTB |= BACKLIGHT_MODNUM; - break; - case 2: - PORTB |= BACKLIGHT_ALPHAS; - PORTB &= ~BACKLIGHT_MODNUM; - break; - case 3: - PORTB &= ~BACKLIGHT_ALPHAS; - PORTB &= ~BACKLIGHT_MODNUM; - break; - } -} - -// Port from backlight_update_state -void led_set_kb(uint8_t usb_led) { - bool status[8] = { - host_keyboard_leds() & (1< - * - * 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 . - */ -#ifndef V2_H -#define V2_H - -#include "../eagle_viper.h" - -#define ___ KC_NO - -#define LAYOUT_all( \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, K2O, \ - K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ -) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2M, ___, K2O }, \ - { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ - { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ -} - -#define LAYOUT_60_ansi( \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4O, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, \ - K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ -) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, ___, K4O }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ - { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, ___ }, \ - { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ -} - -#define LAYOUT_eagle_splits( \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ - K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0A, K0B, K0C, K0I, K0K, K0M, K0N, K0O \ -) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ - { K1A, K1B, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ - { K0A, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, K0K, ___, K0M, K0N, K0O } \ -} - -#define LAYOUT_viper( \ - K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O, \ - K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, K3O, \ - K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, K2O, \ - K1A, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, K1M, K1N, K1O, \ - K0B, K0C, K0I, K0M, K0N \ -) { \ - { K4A, K4B, K4C, K4D, K4E, K4F, K4G, K4H, K4I, K4J, K4K, K4L, K4M, K4N, K4O }, \ - { K3A, K3B, K3C, K3D, K3E, K3F, K3G, K3H, K3I, K3J, K3K, K3L, K3M, ___, K3O }, \ - { K2A, K2B, K2C, K2D, K2E, K2F, K2G, K2H, K2I, K2J, K2K, K2L, ___, ___, K2O }, \ - { K1A, ___, K1C, K1D, K1E, K1F, K1G, K1H, K1I, K1J, K1K, ___, K1M, K1N, K1O }, \ - { ___, K0B, K0C, ___, ___, ___, ___, ___, K0I, ___, ___, ___, K0M, K0N, ___ } \ -} - -#define LAYOUT_eagle LAYOUT_60_ansi - -#endif -- cgit v1.2.3 From 3c209830558c5911ed7446c026ba4d38fdbfe83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eduardo=20Louren=C3=A7o=20Pinto=20Neto?= Date: Tue, 28 Aug 2018 20:53:10 -0300 Subject: Keymap: Adding keymap to the XD60 (#3767) * Created keymap based on Default base layer and GK64 function layer * Update readme.md --- keyboards/xd60/keymaps/edulpn64/keymap.c | 46 +++++++++++++++++++++++++++++++ keyboards/xd60/keymaps/edulpn64/readme.md | 9 ++++++ 2 files changed, 55 insertions(+) create mode 100644 keyboards/xd60/keymaps/edulpn64/keymap.c create mode 100644 keyboards/xd60/keymaps/edulpn64/readme.md diff --git a/keyboards/xd60/keymaps/edulpn64/keymap.c b/keyboards/xd60/keymaps/edulpn64/keymap.c new file mode 100644 index 0000000000..95d80ffb77 --- /dev/null +++ b/keyboards/xd60/keymaps/edulpn64/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // 0: Base Layer + LAYOUT_all( + 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_BSPC, \ + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, 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_DEL, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, F(0) , KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT), + + // 1: Function Layer + LAYOUT_all( + 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_BSPC, KC_BSPC, \ + KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR,KC_SLCK,KC_PAUS, RGB_RMOD,RGB_MOD, RGB_VAD, RGB_VAI, \ + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_INS, KC_HOME,KC_PGUP, RGB_HUD, RGB_HUI, KC_NO, KC_ENT, \ + KC_LSFT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_END, KC_PGDN, KC_NO, KC_RSFT, KC_UP, KC_DEL, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, F(0), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RIGHT), + +}; + +// Custom Actions +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(1), // to Fn overlay +}; + +// Macros +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { register_code(KC_RSFT); } + else { unregister_code(KC_RSFT); } + break; + } + + return MACRO_NONE; +}; + +// Loop +void matrix_scan_user(void) { + // Empty +}; diff --git a/keyboards/xd60/keymaps/edulpn64/readme.md b/keyboards/xd60/keymaps/edulpn64/readme.md new file mode 100644 index 0000000000..a3208564a0 --- /dev/null +++ b/keyboards/xd60/keymaps/edulpn64/readme.md @@ -0,0 +1,9 @@ +# Edulpn64 Keymap for XIUDI's 60% XD60 PCB + +![Edulpn64 Keymap for XD60](https://dl2.pushbulletusercontent.com/K6bdlBlP5ix7jdMAr8QKes4johmpUfPI/image.png) + +## Additional Notes +This keymap uses the Default XD60 base layer, but follows the GK64 function layer (one of my XD60 boards use GK64 keycaps). + +## Build +To build the default keymap, simply run `make xd60:edulpn64`. -- cgit v1.2.3 From 3892829d74119b1fe771b4b51c665448a433da1e Mon Sep 17 00:00:00 2001 From: xton Date: Tue, 28 Aug 2018 19:54:17 -0400 Subject: Keymap: xtonhasvim updates (#3768) * cherrypicking file changes just for updates * removed unused heat foo * avoid defining own min/max * add license * formatting --- keyboards/dz60/keymaps/xtonhasvim/keymap.c | 23 ++- keyboards/niu_mini/keymaps/xtonhasvim/config.h | 10 +- keyboards/niu_mini/keymaps/xtonhasvim/keymap.c | 187 +++++++++++++++++-------- keyboards/niu_mini/keymaps/xtonhasvim/rules.mk | 2 + users/xtonhasvim/fancylighting.c | 167 ++++++++++++++++++++++ users/xtonhasvim/fancylighting.h | 35 +++++ users/xtonhasvim/rules.mk | 1 + users/xtonhasvim/xtonhasvim.c | 72 +++++++--- users/xtonhasvim/xtonhasvim.h | 9 +- 9 files changed, 398 insertions(+), 108 deletions(-) create mode 100644 users/xtonhasvim/fancylighting.c create mode 100644 users/xtonhasvim/fancylighting.h diff --git a/keyboards/dz60/keymaps/xtonhasvim/keymap.c b/keyboards/dz60/keymaps/xtonhasvim/keymap.c index 8a7419214a..34b724aaad 100644 --- a/keyboards/dz60/keymaps/xtonhasvim/keymap.c +++ b/keyboards/dz60/keymaps/xtonhasvim/keymap.c @@ -5,9 +5,13 @@ enum layers { _QWERTY, _FUN, _MOVE, - _MOUSE + _MOUSE, + _CMD }; +extern uint8_t vim_cmd_layer(void) { return _CMD; } + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT( @@ -15,21 +19,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,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_NO, - KC_LCTL, KC_LALT, KC_LGUI, VIM_START, TG(_MOUSE), KC_SPC, KC_RGUI, KC_RALT, X_____X, KC_RCTL, MO(_FUN)), + LSFT(KC_LALT), KC_LALT, KC_LGUI, VIM_START, TG(_MOUSE), KC_SPC, KC_RGUI, KC_RALT, X_____X, KC_RCTL, MO(_FUN)), [_FUN] = LAYOUT( KC_GRV, 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_DEL, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, - TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY)), [_MOVE] = LAYOUT( X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X, X_____X, _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, - TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY)), [_MOUSE] = LAYOUT( @@ -37,21 +41,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { X_____X, X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X,KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, X_____X, _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, - TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - - [_EDIT] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - TO(_QWERTY), _______, _______, VIM_START, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY)), [_CMD] = LAYOUT( X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, X_____X, X_____X, VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, X_____X, VIM_SHIFT, X_____X, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT,X_____X, - TO(_QWERTY), _______, _______, TO(_QWERTY), X_____X, X_____X, _______, _______, _______, _______, _______), + _______, _______, _______, TO(_QWERTY), X_____X, X_____X, _______, _______, _______, _______, TO(_QWERTY)), }; diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/config.h b/keyboards/niu_mini/keymaps/xtonhasvim/config.h index a22bcab0f4..aa13d7b735 100644 --- a/keyboards/niu_mini/keymaps/xtonhasvim/config.h +++ b/keyboards/niu_mini/keymaps/xtonhasvim/config.h @@ -3,7 +3,7 @@ #include "../../config.h" -#define MUSIC_MASK (keycode != KC_NO) +// #define MUSIC_MASK (keycode != KC_NO) /* * MIDI options @@ -16,7 +16,7 @@ - MIDI notes can be sent when in Music mode is on */ -#define MIDI_BASIC +// #define MIDI_BASIC /* enable advanced MIDI features: - MIDI notes can be added to the keymap @@ -32,12 +32,6 @@ // help for fast typist+dual function keys? #define PERMISSIVE_HOLD -/* disable debug print */ -#define NO_DEBUG - -/* disable print */ -#define NO_PRINT - /* speed up mousekeys a bit */ #define MOUSEKEY_DELAY 50 #define MOUSEKEY_INTERVAL 20 diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c b/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c index dd764826fe..bfda812738 100644 --- a/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c +++ b/keyboards/niu_mini/keymaps/xtonhasvim/keymap.c @@ -16,6 +16,7 @@ #include QMK_KEYBOARD_H #include "xtonhasvim.h" +#include "fancylighting.h" /************************************ * states @@ -27,7 +28,15 @@ enum layers { _RAISE, _ADJUST, _MOVE, - _MOUSE + _MOUSE, + _CMD +}; + +extern uint8_t vim_cmd_layer(void) { return _CMD; } + +enum keymap_keycodes { + RAISE = VIM_SAFE_RANGE, + LOWER }; /************************************ @@ -48,14 +57,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' * * - Ctrl acts as Esc when tapped. - * - Holding A or ; switches to movement layer. + * - Holding ; switches to movement layer. * - Raise and Lower are one-shot layers. */ [_QWERTY] = LAYOUT_planck_mit( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LCTL_T(KC_ESC), LT(_MOVE,KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), - TG(_MOUSE), X_____X, KC_LALT, KC_LGUI, OSL(_LOWER), KC_SPC, OSL(_RAISE), KC_LGUI, KC_LALT, X_____X, VIM_START + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT), + LSFT(KC_LALT), TG(_MOUSE), KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LGUI, KC_LALT, X_____X, VIM_START ), /* Lower @@ -70,10 +79,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_planck_mit( - KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, - KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, - X_____X, TO(_QWERTY), _______, _______, _______, KC_BSPC, OSL(_ADJUST), _______, _______, TO(_QWERTY), X_____X + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, + _______, TO(_QWERTY), _______, _______, _______, KC_BSPC, _______, _______, _______, TO(_QWERTY), X_____X ), /* Raise @@ -88,10 +97,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT_planck_mit( - KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, - KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, - X_____X, TO(_QWERTY), _______, _______, OSL(_ADJUST), X_____X, _______, _______, _______, TO(_QWERTY), X_____X + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, + _______, TO(_QWERTY), _______, _______, _______, KC_BSPC, _______, _______, _______, TO(_QWERTY), X_____X ), @@ -99,17 +108,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-------------------------------------------------------------------------------------. * |RGBPlain| Reset| | | | | | | | | | Del | * |--------+------+------+------+------+-------------+------+------+------+------+------| - * |RGBMode-| | |Aud on|Audoff|AGnorm|AGswap| | | | |Lite+ | + * |RGBMode-| | | | | | | | | | |Lite+ | * |--------+------+------+------+------+------|------+------+------+------+------+------| - * |RGBMode+|Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | |Lite- | + * |RGBMode+| | | | | | | Next | Vol- | Vol+ | Play |Lite- | * |--------+------+------+------+------+------+------+------+------+------+------+------| * | RGB | Bail | | | | | | | | Bail | | * `-------------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_planck_mit( RGB_MODE_PLAIN, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, - RGB_MODE_REVERSE, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, RGB_VAI, - RGB_MODE_FORWARD, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, RGB_VAD, + RGB_MODE_REVERSE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, + RGB_MODE_FORWARD, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, RGB_VAD, RGB_TOG, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X ), @@ -120,7 +129,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X, _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, - X_____X, TO(_QWERTY), _______, _______, _______, X_____X, _______, _______, _______, TO(_QWERTY), X_____X + _______, TO(_QWERTY), _______, _______, _______, X_____X, _______, _______, _______, TO(_QWERTY), X_____X ), /* mouse layer @@ -132,68 +141,124 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, TO(_QWERTY), _______, _______, _______, X_____X, _______, _______, _______, TO(_QWERTY), X_____X ), -/* vim edit mode. just has an escape -> _CMD key */ -[_EDIT] = LAYOUT_planck_mit( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - VIM_START, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), _______ -), - /* vim command layer. */ [_CMD] = LAYOUT_planck_mit( - X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, - VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, - VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, - X_____X, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X + X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, + VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, + VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, + _______, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X ) }; +#define C_RED 0xFF, 0x00, 0x00 +#define C_GRN 0x00, 0xFF, 0x00 +#define C_BLU 0x00, 0x00, 0xFF + +#define C_YAN 0x00, 0xFF, 0xFF +#define C_PRP 0x7A, 0x00, 0xFF +#define C_ORG 0xFF, 0x93, 0x00 + /** Set just 4 LEDs closest to the user. Slightly less annoying to bystanders.*/ -void rgbflag(uint8_t r, uint8_t g, uint8_t b) { - for(int i = 0; i < RGBLED_NUM; i++){ - switch(i) { - case 9 ... 12: - // rgblight_setrgb_at(r,g,b,i); - led[i].r = r; - led[i].g = g; - led[i].b = b; - break; - default: - // rgblight_setrgb_at(0,0,0,i); - led[i].r = 0; - led[i].g = 0; - led[i].b = 0; - break; +void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb) { + LED_TYPE *target_led = user_rgb_mode ? shadowed_led : led; + for (int i = 0; i < RGBLED_NUM; i++) { + switch (i) { + case 12: case 13: + target_led[i].r = r; + target_led[i].g = g; + target_led[i].b = b; + break; + case 8: case 9: + target_led[i].r = rr; + target_led[i].g = gg; + target_led[i].b = bb; + break; + default: + target_led[i].r = 0; + target_led[i].g = 0; + target_led[i].b = 0; + break; } } rgblight_set(); } -uint32_t layer_state_set_user(uint32_t state) { - if(rgblight_get_mode() == 1) { - switch (biton32(state)) { +void set_state_leds(void) { + if (rgblight_get_mode() == 1) { + switch (biton32(layer_state)) { case _RAISE: + rgbflag(C_BLU, C_GRN); + break; case _LOWER: + rgbflag(C_BLU, C_RED); + break; case _ADJUST: - rgbflag(0x00, 0x00, 0xFF); - break; + rgbflag(C_BLU, C_PRP); + break; case _MOVE: + rgbflag(C_RED, C_PRP); + break; case _MOUSE: - rgbflag(0xFF, 0x00, 0x00); - break; + rgbflag(C_RED, C_GRN); + break; case _CMD: - rgbflag(0x00, 0xFF, 0x00); - break; - case _EDIT: - rgbflag(0x7A, 0x00, 0xFF); - break; + switch(vstate) { + case VIM_V: + case VIM_VI: + case VIM_VS: + rgbflag(C_GRN, C_YAN); + break; + case VIM_C: + case VIM_CI: + rgbflag(C_GRN, C_ORG); + break; + case VIM_D: + case VIM_DI: + rgbflag(C_GRN, C_RED); + break; + case VIM_G: + rgbflag(C_GRN, C_BLU); + break; + case VIM_Y: + rgbflag(C_GRN, C_PRP); + break; + case VIM_START: + default: + rgbflag(C_GRN, C_GRN); + break; + } + break; default: // for any other layers, or the default layer - rgbflag(0x00, 0xFF, 0xFF); - break; + rgbflag(C_YAN, C_YAN); + break; } } - return state; +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; } diff --git a/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk b/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk index 3a93f9fd8c..359f94f1e4 100644 --- a/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk +++ b/keyboards/niu_mini/keymaps/xtonhasvim/rules.mk @@ -4,3 +4,5 @@ endif MOUSEKEY_ENABLE = yes BACKLIGHT_ENABLE = no +AUDIO_ENABLE = no +CONSOLE_ENABLE = no # Console for debug(+400) diff --git a/users/xtonhasvim/fancylighting.c b/users/xtonhasvim/fancylighting.c new file mode 100644 index 0000000000..f4af5ec55d --- /dev/null +++ b/users/xtonhasvim/fancylighting.c @@ -0,0 +1,167 @@ + /* Copyright 2015-2017 Christon DeWan + * + * 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 . + */ + +#ifdef RGBLIGHT_ENABLE + +#include + +#include "rgblight.h" +#include "color.h" +#include "fancylighting.h" + + +__attribute__ ((weak)) +void matrix_scan_keymap(void) { + // override me, if you want. + return; +} + +#define ABSDIFF(a,b) ((a)>(b)?(a)-(b):(b)-(a)) + +#define FADE_BACK_TIME 500 +#define BREATH_FIRE_TIME 1000 +#define ANIMATION_STEP_INTERVAL 20 +#define POWER_KEY_OFFSET (RGBLED_NUM / 2) +#define SPACE_OFFSET_MAX (RGBLED_NUM / 2) + + +uint16_t effect_start_timer = 0; +uint8_t user_rgb_mode = 0; +LED_TYPE shadowed_led[RGBLED_NUM] = {0}; + +void start_firey_return(void) { + user_rgb_mode = BREATH_FIRE; + effect_start_timer = timer_read(); + for(uint8_t i = 0; i < RGBLED_NUM; i++) { + shadowed_led[i] = led[i]; + } +} + +/** 0---max + * [___] + * [__/] + * [_/\] + * [/\_] + * [\__] + * [___] + **/ + +void set_color_for_offsets(uint16_t time_offset, uint16_t space_offset, uint8_t idx) { + float time_progress = (float)time_offset / BREATH_FIRE_TIME; + float space_progress = (float)space_offset / SPACE_OFFSET_MAX; + float progress = time_progress * 5.0 - space_progress; + if(progress > 1.0) { + progress -= 1.0; + progress /= 4.0; + progress = 1.0 - progress; + } + progress = fmax(0.0,progress); + progress *= progress; // squared! + + float alpha = (time_progress + 0.1) * 7.0 - space_progress; + alpha = fmin(1.0, alpha*alpha); + + LED_TYPE px[1] = {0}; + sethsv((uint16_t)(fmod(time_progress * 1.5 + space_progress,1.0)*360), 255, (uint8_t)(progress*255),&px[0]); + led[idx].r = alpha * px[0].r + ( 1.0 - alpha) * shadowed_led[idx].r; + led[idx].g = alpha * px[0].g + ( 1.0 - alpha) * shadowed_led[idx].g; + led[idx].b = alpha * px[0].b + ( 1.0 - alpha) * shadowed_led[idx].b; +} + +/** + * It's actually a rainbow: a fire curve didn't really look right. + * it's still cool, though! + */ +void rgb_mode_breath_fire(void) { + static uint16_t last_timer = 0; + if(!last_timer) last_timer = timer_read(); + uint16_t this_timer = timer_read(); + + // too soon. don't spam updates + if(this_timer - last_timer < ANIMATION_STEP_INTERVAL) return; + + uint16_t elapsed = this_timer - effect_start_timer; + + last_timer = this_timer; + if(elapsed >= BREATH_FIRE_TIME) { + // complete + user_rgb_mode = FADE_BACK; + effect_start_timer = this_timer; + } else { + // linear fade + for(uint16_t i = 0; i < RGBLED_NUM; i++) { + uint16_t space_offset = ABSDIFF(i,POWER_KEY_OFFSET); + if(space_offset > SPACE_OFFSET_MAX) space_offset = RGBLED_NUM - space_offset; + + set_color_for_offsets(elapsed, space_offset, i); + } + rgblight_set(); + } +} + +void rgb_mode_fade_back(void) { + static uint16_t last_timer = 0; + if(!last_timer) last_timer = timer_read(); + uint16_t this_timer = timer_read(); + + // too soon. don't spam updates + if(this_timer - last_timer < ANIMATION_STEP_INTERVAL) return; + + uint16_t elapsed = this_timer - effect_start_timer; + + last_timer = this_timer; + float progress = (float)elapsed / FADE_BACK_TIME; + progress = fmin(1.0,progress); + + for(uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = shadowed_led[i].r * progress; + led[i].g = shadowed_led[i].g * progress; + led[i].b = shadowed_led[i].b * progress; + } + rgblight_set(); + + if(elapsed >= FADE_BACK_TIME) user_rgb_mode = 0; +} + +/** called when layer state or vstate has changed */ +__attribute__ ((weak)) +void set_state_leds(void) { + return; +} + +void matrix_scan_user(void) { + static uint32_t last_layer = 0; + static uint32_t last_vstate = 0; + if(last_layer != layer_state || last_vstate != vstate) set_state_leds(); + last_layer = layer_state; + last_vstate = vstate; + + switch (user_rgb_mode) { + case BREATH_FIRE: + rgb_mode_breath_fire(); + break; + case FADE_BACK: + rgb_mode_fade_back(); + break; + } + matrix_scan_keymap(); +} + +#else + +void start_firey_return(void) {} + +#endif diff --git a/users/xtonhasvim/fancylighting.h b/users/xtonhasvim/fancylighting.h new file mode 100644 index 0000000000..982010d3d5 --- /dev/null +++ b/users/xtonhasvim/fancylighting.h @@ -0,0 +1,35 @@ +p /* Copyright 2015-2017 Christon DeWan + * + * 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 . + */ + +#ifndef _fancy_lighting_h +#define _fancy_lighting_h +#ifdef RGBLIGHT_ENABLE + +#include "xtonhasvim.h" + +extern uint8_t user_rgb_mode; +extern LED_TYPE shadowed_led[]; + +void start_firey_return(void); + +#endif //_fancy_lighting_h + +enum xtonhasvim_rgbmodes { + BREATH_FIRE = 1, + FADE_BACK +}; + +#endif //RGBLIGHT_ENABLE diff --git a/users/xtonhasvim/rules.mk b/users/xtonhasvim/rules.mk index 3777917f8f..a901bfcf67 100644 --- a/users/xtonhasvim/rules.mk +++ b/users/xtonhasvim/rules.mk @@ -1 +1,2 @@ SRC += xtonhasvim.c +SRC += fancylighting.c diff --git a/users/xtonhasvim/xtonhasvim.c b/users/xtonhasvim/xtonhasvim.c index a2ff2fa31c..5f6701830f 100644 --- a/users/xtonhasvim/xtonhasvim.c +++ b/users/xtonhasvim/xtonhasvim.c @@ -15,6 +15,7 @@ */ #include "xtonhasvim.h" +#include "fancylighting.h" /************************************ * helper foo @@ -53,13 +54,13 @@ static void ALT(uint16_t keycode) { } -static uint16_t vstate = VIM_START; +uint16_t vstate = VIM_START; static bool yank_was_lines = false; static bool SHIFTED = false; static uint32_t mod_override_layer_state = 0; static uint16_t mod_override_triggering_key = 0; -static void edit(void) { vstate = VIM_START; layer_on(_EDIT); layer_off(_CMD); } +static void edit(void) { vstate = VIM_START; layer_clear(); } #define EDIT edit() @@ -102,25 +103,54 @@ static void simple_movement(uint16_t keycode) { } } +static void comma_period(uint16_t keycode) { + switch (keycode) { + case VIM_COMMA: + if (SHIFTED) { + // indent + CMD(KC_LBRACKET); + } else { + // toggle comment + CMD(KC_SLASH); + } + break; + case VIM_PERIOD: + if (SHIFTED) { + // outdent + CMD(KC_RBRACKET); + } + break; + } +} + __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -#define PASS_THRU process_record_keymap(keycode, record) - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if(record->event.pressed && layer_state_is(_CMD) && IS_MOD(keycode)) { + /* keymap gets first whack */ + if(!process_record_keymap(keycode, record)) return false; + + /****** FIREY_RETURN *****/ + if(record->event.pressed && keycode == FIREY_RETURN) { + start_firey_return(); + TAP(KC_ENT); + } + + /****** mod passthru *****/ + if(record->event.pressed && layer_state_is(vim_cmd_layer()) && (IS_MOD(keycode) || keycode == LSFT(KC_LALT))) { mod_override_layer_state = layer_state; mod_override_triggering_key = keycode; + // TODO: change this to track key location instead layer_clear(); - return PASS_THRU; // let the event fall through... + return true; // let the event fall through... } if(mod_override_layer_state && !record->event.pressed && keycode == mod_override_triggering_key) { layer_state_set(mod_override_layer_state); mod_override_layer_state = 0; mod_override_triggering_key = 0; - return PASS_THRU; + return true; } if (VIM_START <= keycode && keycode <= VIM_ESC) { @@ -132,7 +162,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { if(keycode == VIM_START) { // entry from anywhere - layer_on(_CMD); + layer_on(vim_cmd_layer()); vstate = VIM_START; // reset state @@ -176,7 +206,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case VIM_D: if(SHIFTED) { - TAP(KC_K); + CTRL(KC_K); } else { vstate = VIM_D; } @@ -300,19 +330,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } break; case VIM_COMMA: - if(SHIFTED) { - // indent - CMD(KC_LBRACKET); - } else { - // toggle comment - CMD(KC_SLASH); - } - break; case VIM_PERIOD: - if(SHIFTED) { - // outdent - CMD(KC_RBRACKET); - } + comma_period(keycode); break; } break; @@ -483,6 +502,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { TAP(KC_RIGHT); vstate = VIM_START; break; + case VIM_COMMA: + case VIM_PERIOD: + comma_period(keycode); + break; default: // do nothing break; @@ -539,6 +562,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { TAP(KC_RIGHT); vstate = VIM_START; break; + case VIM_COMMA: + case VIM_PERIOD: + comma_period(keycode); + break; default: // do nothing break; @@ -610,6 +637,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; } else { - return PASS_THRU; + return true; } } + diff --git a/users/xtonhasvim/xtonhasvim.h b/users/xtonhasvim/xtonhasvim.h index 21b794c033..5ff4932a48 100644 --- a/users/xtonhasvim/xtonhasvim.h +++ b/users/xtonhasvim/xtonhasvim.h @@ -26,6 +26,7 @@ bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record); enum xtonhasvim_keycodes { DUMMY = SAFE_RANGE, + FIREY_RETURN, // kick off special effects VIM_START, // bookend for vim states VIM_A, VIM_B, @@ -57,10 +58,10 @@ enum xtonhasvim_keycodes { VIM_SAFE_RANGE // start other keycodes here. }; -enum xtonhasvim_layers { - _EDIT = 12, - _CMD -}; +// NOTE: YOU MUST DEFINE THIS +extern uint8_t vim_cmd_layer(void); + +extern uint16_t vstate; #endif -- cgit v1.2.3 From af5f59636eea83f66db6510f61510d31ee9dade4 Mon Sep 17 00:00:00 2001 From: Daniel Burkholder Date: Tue, 28 Aug 2018 20:06:51 -0400 Subject: Keyboard: Dactyl - Only initialize relevant variables (#3771) This small change prevents an unused variable from being initialized, throwing a warning during compilation, thus ending fatally. [07:47:10] [Daniels-MacBook-Pro-3] [dburkhol] [ /Users/dburkhol/git/qmk_firmware ] [develop ] : make handwired/dactyl:default QMK Firmware 0.6.97 Making handwired/dactyl with keymap default avr-gcc (GCC) 7.3.0 Copyright (C) 2017 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Size before: text data bss dec hex filename 0 19972 0 19972 4e04 .build/handwired_dactyl_default.hex Compiling: keyboards/handwired/dactyl/twimaster.c [OK] Compiling: keyboards/handwired/dactyl/matrix.c keyboards/handwired/dactyl/matrix.c:52:22: error: 'expander_col_pins' defined but not used [-Werror=unused-const-variable=] static const uint8_t expander_col_pins[MATRIX_COLS] = MATRIX_EXPANDER_COL_PINS; ^~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors [ERRORS] | | | make[1]: *** [.build/obj_handwired_dactyl_default/matrix.o] Error 1 make: *** [handwired/dactyl:default] Error 1 Make finished with errors --- keyboards/handwired/dactyl/matrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/handwired/dactyl/matrix.c b/keyboards/handwired/dactyl/matrix.c index 52c76fadd4..f63cf1188f 100644 --- a/keyboards/handwired/dactyl/matrix.c +++ b/keyboards/handwired/dactyl/matrix.c @@ -48,8 +48,6 @@ along with this program. If not, see . static const uint8_t onboard_row_pins[MATRIX_ROWS] = MATRIX_ONBOARD_ROW_PINS; static const uint8_t onboard_col_pins[MATRIX_COLS] = MATRIX_ONBOARD_COL_PINS; static const bool col_expanded[MATRIX_COLS] = COL_EXPANDED; -static const uint8_t expander_row_pins[MATRIX_ROWS] = MATRIX_EXPANDER_ROW_PINS; -static const uint8_t expander_col_pins[MATRIX_COLS] = MATRIX_EXPANDER_COL_PINS; #endif /* matrix state(1:on, 0:off) */ @@ -58,12 +56,14 @@ static matrix_row_t matrix[MATRIX_ROWS]; static matrix_row_t matrix_debouncing[MATRIX_ROWS]; #if (DIODE_DIRECTION == COL2ROW) + static const uint8_t expander_col_pins[MATRIX_COLS] = MATRIX_EXPANDER_COL_PINS; static void init_cols(void); static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); static void unselect_rows(void); static void select_row(uint8_t row); static void unselect_row(uint8_t row); #elif (DIODE_DIRECTION == ROW2COL) + static const uint8_t expander_row_pins[MATRIX_ROWS] = MATRIX_EXPANDER_ROW_PINS; static void init_rows(void); static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); static void unselect_cols(void); -- cgit v1.2.3 From 9bd6d6112d698ea5823b268983809fe3b8d98b26 Mon Sep 17 00:00:00 2001 From: Alex Ong Date: Wed, 29 Aug 2018 10:08:07 +1000 Subject: Keyboard: xealous (#3731) * Keyboard: HandWired/XeaL60 * Updated rules.mk * Mapping for layout was flipped * Figured out how to re-map bad pins. * Updated Keymap * Enabled audio, Forced NKRO * Added QMK_KEYS_PER_SCAN * Removed more unnecessary files, since split_keyboards are in main QMK branch already. * Simplified rules.mk in rev1 * Removed i2c from matrix.c * Re-formatted to 4 spaces per tab, * Changed note for NUMPAD * Added I2C support back! * Fixed keyboard mappings. Both sides work * Moved i2c configuration from keymaps/default/config.h to config.h * Changed SCL_CLOCK to 400000L * Added DEBUG_MATRIX_SCAN_RATE for future optimization efforts * Removed row2col code to clean up matrix.c * Scan rate from 2100 -> 4200 by using Nop instead of waiting 30us between columns. * Further optimized column reading via optimized_col_reader. * Immediate key-recognition * Switched back to own implementation of SPLIT_KEYBOARD. Will optimize so that slave interrupts master. * Moved scanrate debug messages to another file. * Made matrix_scanrate.c compile if CONSOLE_ENABLE is off. Updated to latest i2c.c * Latest i2c uses a few bytes for lighting information * Optimizations in i2c.h to determine buffer size. * Disabled a whole bunch of features. TODO: Test that keyboard still works fine. * Minimum #define NO_ACTION's with still working keyboard * Fixed matrix not working due to offsets not being respected * Added numlock button for keymap. * Use I2C_KEYMAP_START offset * Removed serial, Backlight and RGB support * Removed need for split_flags. * Added audio on and off for numlock. * Renamed from xeal60 to xealous, simplified build system. * Used more shared split_common code. * Updated audio code. * moved tone_qwerty and tone_numpad to config.h. Removed keymaps/default/config.h * Added more shortcut keys in _FN layer. Increased debounce to 6ms due to fencepost error. * DF used with incorrect argument. Custom_keycodes no longer required. * Fixed bug in update_debounce_counters which was resulting in no debouncing! * Removed unnecessary #include --- keyboards/handwired/xealous/config.h | 48 +++ keyboards/handwired/xealous/info.json | 91 +++++ .../handwired/xealous/keymaps/default/keymap.c | 105 ++++++ keyboards/handwired/xealous/matrix.c | 376 +++++++++++++++++++++ keyboards/handwired/xealous/matrix_scanrate.c | 39 +++ keyboards/handwired/xealous/matrix_scanrate.h | 4 + keyboards/handwired/xealous/readme.md | 166 +++++++++ keyboards/handwired/xealous/rev1/config.h | 90 +++++ keyboards/handwired/xealous/rev1/rev1.c | 6 + keyboards/handwired/xealous/rev1/rev1.h | 32 ++ keyboards/handwired/xealous/rev1/rules.mk | 0 keyboards/handwired/xealous/rules.mk | 73 ++++ 12 files changed, 1030 insertions(+) create mode 100644 keyboards/handwired/xealous/config.h create mode 100644 keyboards/handwired/xealous/info.json create mode 100644 keyboards/handwired/xealous/keymaps/default/keymap.c create mode 100644 keyboards/handwired/xealous/matrix.c create mode 100644 keyboards/handwired/xealous/matrix_scanrate.c create mode 100644 keyboards/handwired/xealous/matrix_scanrate.h create mode 100644 keyboards/handwired/xealous/readme.md create mode 100644 keyboards/handwired/xealous/rev1/config.h create mode 100644 keyboards/handwired/xealous/rev1/rev1.c create mode 100644 keyboards/handwired/xealous/rev1/rev1.h create mode 100644 keyboards/handwired/xealous/rev1/rules.mk create mode 100644 keyboards/handwired/xealous/rules.mk diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h new file mode 100644 index 0000000000..415a0dcf5b --- /dev/null +++ b/keyboards/handwired/xealous/config.h @@ -0,0 +1,48 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C +#define SCL_CLOCK 400000UL + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +//#define DEBUG_MATRIX_SCAN_RATE //Use this to determine scan-rate. +#define FORCE_NKRO + +#define QMK_KEYS_PER_SCAN 4 //if we press four keys simultaneously, lets process them simultaneously... +#define DIODE_DIRECTION COL2ROW + +#ifdef AUDIO_ENABLE + #define C6_AUDIO + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define NO_MUSIC_MODE + #define TONE_QWERTY SONG(Q__NOTE(_E4)); + #define TONE_NUMPAD SONG(Q__NOTE(_D4)); +#endif + diff --git a/keyboards/handwired/xealous/info.json b/keyboards/handwired/xealous/info.json new file mode 100644 index 0000000000..6d7e30f449 --- /dev/null +++ b/keyboards/handwired/xealous/info.json @@ -0,0 +1,91 @@ +{ + "keyboard_name": "Xealous", + "url": "", + "maintainer": "alex-ong", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ANSI_DEFAULT": { + "key_count": 64, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2.0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + {"label":"T", "x":5.5, "y":1}, + + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + + {"label":"CapsLock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.75}, + {"x":6.5, "y":4, "w":1.25}, + + {"x":7.75, "y":4, "w":1.25}, + {"x":9, "y":4, "w":2.0}, + {"label":"Alt", "x":11, "y":4}, + {"label":"Win", "x":12, "y":4}, + {"label":"Menu", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/xealous/keymaps/default/keymap.c b/keyboards/handwired/xealous/keymaps/default/keymap.c new file mode 100644 index 0000000000..a07e64fd70 --- /dev/null +++ b/keyboards/handwired/xealous/keymaps/default/keymap.c @@ -0,0 +1,105 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + + +// 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 _QWERTY 0 +#define _NUMPAD 1 +#define _FN 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define FN MO(_FN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |FN | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /| Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | NUM | Space | Space |Alt |FN |Menu |Ctrl | + * `-----------------------------------------------------------' + */ + /* Layer 0: Qwerty */ + [_QWERTY] = LAYOUT_split60( \ + KC_ESC, 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_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, \ + FN, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, DF(_NUMPAD), KC_SPC, KC_SPC, KC_RALT, FN, KC_APP, KC_RCTL \ + ), + +/* + * ,-----------------------------------------------------------. + * | | | | | | | |Nlck| /| *| -| | | | + * |-----------------------------------------------------------| + * | | | | | | | | 7| 8| 9| +| | | | + * |-----------------------------------------------------------| + * | | | | | | | | 4| 5| 6|Bspc| |Return | + * |-----------------------------------------------------------| + * | | | | | | | | 1| 2| 3| .| | + * |-----------------------------------------------------------| + * | | | | QWE | | 0 | . |A_ON |A_OFF| | + * `-----------------------------------------------------------' + */ + + /* Layer 1: Numpad */ + [_NUMPAD] = LAYOUT_split60( \ + _______, _______, _______, _______, _______, _______, _______, KC_NLCK, KC_PSLS, KC_PAST, KC_MINUS, _______, _______, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PLUS, _______, _______, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_BSPC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_DOT, _______, \ + _______, _______, _______,DF(_QWERTY), _______, KC_P0, KC_PDOT, AU_ON, AU_OFF, _______ \ + ), + +/* + * ,-----------------------------------------------------------. + * | ` |F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Delete| + * |-----------------------------------------------------------| + * | Caps|pUp| ^ |pDn| | | |pUp| ^ |pDn|PSR|SLK|Pau| | + * |-----------------------------------------------------------| + * | | < | v | > | |Hom|Hom| < | v | > |INS| DEL| | + * |-----------------------------------------------------------| + * | | | | | |End|End| |Vo-|Vo+|VoX| | + * |-----------------------------------------------------------| + * | | | | | | | | | | | + * `-----------------------------------------------------------' + */ + + /* Layer 2: RAISE */ + [_FN] = LAYOUT_split60( \ + KC_GRV, 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_DEL, \ + KC_CAPS, KC_PGUP, KC_UP, KC_PGDN, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, KC_HOME, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, _______, \ + _______, _______, _______, _______, _______, KC_END, KC_END, AU_TOG, KC_VOLD, KC_VOLU, KC_MUTE, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = TONE_QWERTY; +float tone_numpad[][2] = TONE_NUMPAD; + +uint32_t default_layer_state_set_kb(uint32_t state) { + if (state == 1UL<<_QWERTY) { + PLAY_SONG(tone_qwerty); + } else if (state == 1UL<<_NUMPAD) { + PLAY_SONG(tone_numpad); + } + return state; +} +#endif + +void led_set_keymap(uint8_t usb_led) { +} diff --git a/keyboards/handwired/xealous/matrix.c b/keyboards/handwired/xealous/matrix.c new file mode 100644 index 0000000000..27fad00083 --- /dev/null +++ b/keyboards/handwired/xealous/matrix.c @@ -0,0 +1,376 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" +#ifdef DEBUG_MATRIX_SCAN_RATE + #include "matrix_scanrate.h" +#endif + + + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# error "only i2c supported" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; +static matrix_row_t* debouncing_matrix_hand_offsetted; //pointer to matrix_debouncing for our hand +static matrix_row_t* matrix_hand_offsetted; // pointer to matrix for our hand + +//Debouncing counters +typedef uint8_t debounce_counter_t; +#define DEBOUNCE_COUNTER_MODULO 250 +#define DEBOUNCE_COUNTER_INACTIVE 251 +static debounce_counter_t debounce_counters[MATRIX_ROWS * MATRIX_COLS]; +static debounce_counter_t *debounce_counters_hand_offsetted; + + +#if (DIODE_DIRECTION == ROW2COL) + error "Only Col2Row supported"; +#endif +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static void unselect_row(uint8_t row); +static matrix_row_t optimized_col_reader(void); + +__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) { +} + +__attribute__ ((weak)) +void matrix_slave_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ +#ifdef DISABLE_JTAG + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1<= (b) ? (a) - (b) : (max) - (b) + (a)) +void update_debounce_counters(uint8_t current_time) +{ + debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; + for (uint8_t row = 0; row < ROWS_PER_HAND; row++) + { + for (uint8_t col = 0; col < MATRIX_COLS; col++) + { + if (*debounce_pointer != DEBOUNCE_COUNTER_INACTIVE) + { + if (TIMER_DIFF(current_time, *debounce_pointer, DEBOUNCE_COUNTER_MODULO) >= + DEBOUNCING_DELAY) { + *debounce_pointer = DEBOUNCE_COUNTER_INACTIVE; + } + } + debounce_pointer++; + } + } +} + +void transfer_matrix_values(uint8_t current_time) +{ + //upload from debounce_matrix to final matrix; + debounce_counter_t *debounce_pointer = debounce_counters_hand_offsetted; + for (uint8_t row = 0; row < ROWS_PER_HAND; row++) + { + matrix_row_t row_value = matrix_hand_offsetted[row]; + matrix_row_t debounce_value = debouncing_matrix_hand_offsetted[row]; + + for (uint8_t col = 0; col < MATRIX_COLS; col++) + { + bool final_value = debounce_value & (1 << col); + bool current_value = row_value & (1 << col); + if (*debounce_pointer == DEBOUNCE_COUNTER_INACTIVE + && (current_value != final_value)) + { + *debounce_pointer = current_time; + row_value ^= (1 << col); + } + debounce_pointer++; + } + matrix_hand_offsetted[row] = row_value; + } +} + +uint8_t _matrix_scan(void) +{ + uint8_t current_time = timer_read() % DEBOUNCE_COUNTER_MODULO; + + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { + select_row(current_row); + asm volatile ("nop"); asm volatile("nop"); + + debouncing_matrix_hand_offsetted[current_row] = optimized_col_reader(); + // Unselect row + unselect_row(current_row); + } + + update_debounce_counters(current_time); + transfer_matrix_values(current_time); + + return 1; +} + + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(I2C_KEYMAP_START); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +uint8_t matrix_scan(void) +{ +#ifdef DEBUG_MATRIX_SCAN_RATE + matrix_check_scan_rate(); + matrix_time_between_scans(); +#endif + uint8_t ret = _matrix_scan(); + + if( i2c_transaction() ) { + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; + } + + matrix_slave_scan_user(); +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +inline +static matrix_row_t optimized_col_reader(void) { + //MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } + return (PINB & (1 << 6) ? 0 : (ROW_SHIFTER << 0)) | + (PINB & (1 << 2) ? 0 : (ROW_SHIFTER << 1)) | + (PINB & (1 << 3) ? 0 : (ROW_SHIFTER << 2)) | + (PINB & (1 << 1) ? 0 : (ROW_SHIFTER << 3)) | + (PINF & (1 << 7) ? 0 : (ROW_SHIFTER << 4)) | + (PINF & (1 << 6) ? 0 : (ROW_SHIFTER << 5)) | + (PINF & (1 << 5) ? 0 : (ROW_SHIFTER << 6)) | + (PINF & (1 << 4) ? 0 : (ROW_SHIFTER << 7)); +} + + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + diff --git a/keyboards/handwired/xealous/matrix_scanrate.c b/keyboards/handwired/xealous/matrix_scanrate.c new file mode 100644 index 0000000000..f2c7cbe6e3 --- /dev/null +++ b/keyboards/handwired/xealous/matrix_scanrate.c @@ -0,0 +1,39 @@ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#ifdef CONSOLE_ENABLE +static uint16_t matrix_scan_count = 0; +static uint32_t matrix_timer = 0; +void matrix_check_scan_rate(void) { + matrix_scan_count++; + if (matrix_scan_count > 1000) { + uint32_t timer_now = timer_read32(); + uint16_t ms_per_thousand = TIMER_DIFF_32(timer_now, matrix_timer); + uint16_t rate_per_second = 1000000UL / ms_per_thousand; + print("scan_rate: "); + pdec(rate_per_second); + print("\n"); + matrix_timer = timer_now; + matrix_scan_count = 0; + } +} + +static uint32_t last_scan_time = 0; +void matrix_time_between_scans(void) { + if (timer_elapsed(last_scan_time) > 1) + { + print(">1ms elapsed since last scan: "); + pdec(timer_elapsed(last_scan_time)); + print("\n"); + } + last_scan_time = timer_read(); + +} +#endif diff --git a/keyboards/handwired/xealous/matrix_scanrate.h b/keyboards/handwired/xealous/matrix_scanrate.h new file mode 100644 index 0000000000..18d56cd5b4 --- /dev/null +++ b/keyboards/handwired/xealous/matrix_scanrate.h @@ -0,0 +1,4 @@ +__attribute__((weak)) +void matrix_check_scan_rate(void) {} +__attribute__((weak)) +void matrix_time_between_scans(void) {} diff --git a/keyboards/handwired/xealous/readme.md b/keyboards/handwired/xealous/readme.md new file mode 100644 index 0000000000..97bebbfe3a --- /dev/null +++ b/keyboards/handwired/xealous/readme.md @@ -0,0 +1,166 @@ +XeaL60 +====== + +Split keyboard firmware for Arduino Pro Micro or other ATmega32u4 +based boards. + + +## Build Guide + +A build guide for putting together the Xealous can be found here: https://github.com/alex-ong/Split60 + + +## First Time Setup + +Download or clone the `qmk_firmware` repo and navigate to its top level directory. Once your build environment is setup, you'll be able to generate the default .hex using: + +``` +$ make handwired/xeal60/rev1:default +``` + +You will see a lot of output and if everything worked correctly you will see the built hex file: + +``` +handwired_xeal60_rev1_default.hex +``` + +If you would like to use one of the alternative keymaps, or create your own, copy one of the existing [keymaps](keymaps/) and run make like so: + + +``` +$ make handwired/xeal60/rev1:YOUR_KEYMAP_NAME +``` + +If everything worked correctly you will see a file: + +``` +handwired_xeal60_rev1_YOUR_KEYMAP_NAME.hex +``` + +For more information on customizing keymaps, take a look at the primary documentation for [Customizing Your Keymap](/docs/faq_keymap.md) in the main readme.md. + + +Features +-------- + +For the full Quantum Mechanical Keyboard feature list, see [the parent readme.md](/readme.md). + +Some features supported by the firmware: + +* Either half can connect to the computer via USB, or both halves can be used + independently. +* I2C connection between the two halves if for some + reason you require a faster connection between the two halves. Note this + requires an extra wire between halves and pull-up resistors on the data lines. + +Required Hardware +----------------- + +Apart from diodes and key switches for the keyboard matrix in each half, you +will need: + +* 2 Arduino Pro Micros. You can find these on AliExpress for ≈3.50USD each. +* 2 TRRS sockets and 1 TRRS cable, or 2 TRS sockets and 1 TRS cable + +Alternatively, you can use any sort of cable and socket that has at least 4 +wires. You will need a cable with at least 4 wires and 2x 4.7kΩ pull-up resistors + +Optional Hardware +----------------- + +A speaker can be hooked-up to either side to the `5` (`C6`) pin and `GND`, and turned on via `AUDIO_ENABLE`. + +Wiring +------ + +The 3 wires of the TRS/TRRS cable need to connect GND, VCC, and digital pin 3 (i.e. +PD0 on the ATmega32u4) between the two Pro Micros. + +Next, wire your key matrix to any of the remaining 17 IO pins of the pro micro +and modify the `matrix.c` accordingly. + +The wiring for serial: + +![serial wiring](https://i.imgur.com/C3D1GAQ.png) + + +Notes on Software Configuration +------------------------------- + +Configuring the firmware is similar to any other QMK project. One thing +to note is that `MATRIX_ROWS` in `config.h` is the total number of rows between +the two halves, i.e. if your split keyboard has 5 rows in each half, then use +`MATRIX_ROWS=10`. + +Also, the current implementation assumes a maximum of 8 columns, but it would +not be very difficult to adapt it to support more if required. + +Flashing +------- +From the top level `qmk_firmware` directory run `make KEYBOARD:KEYMAP:avrdude` for automatic serial port resolution and flashing. +Example: `make handwired/xeal60/rev1:default:avrdude` + + +Choosing which board to plug the USB cable into (choosing Master) +-------- +Because the two boards are identical, the firmware has logic to differentiate the left and right board. + +It uses two strategies to figure things out: looking at the EEPROM (memory on the chip) or looking if the current board has the usb cable. + +The EEPROM approach requires additional setup (flashing the eeprom) but allows you to swap the usb cable to either side. + +The USB cable approach is easier to setup and if you just want the usb cable on the left board, you do not need to do anything extra. + +### Setting the left hand as master +If you always plug the usb cable into the left board, nothing extra is needed as this is the default. Comment out `EE_HANDS` and comment out `I2C_MASTER_RIGHT` or `MASTER_RIGHT` if for some reason it was set. + +### Setting the right hand as master +If you always plug the usb cable into the right board, add an extra flag to your `config.h` +``` + #define MASTER_RIGHT +``` + +### Setting EE_hands to use either hands as master +If you define `EE_HANDS` in your `config.h`, you will need to set the +EEPROM for the left and right halves. + +The EEPROM is used to store whether the +half is left handed or right handed. This makes it so that the same firmware +file will run on both hands instead of having to flash left and right handed +versions of the firmware to each half. To flash the EEPROM file for the left +half run: +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +// or the equivalent in dfu-programmer + +``` +and similarly for right half +``` +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +// or the equivalent in dfu-programmer +``` + +NOTE: replace `$(COM_PORT)` with the port of your device (e.g. `/dev/ttyACM0`) + +After you have flashed the EEPROM, you then need to set `EE_HANDS` in your config.h, rebuild the hex files and reflash. + +Note that you need to program both halves, but you have the option of using +different keymaps for each half. You could program the left half with a QWERTY +layout and the right half with a Colemak layout using bootmagic's default layout option. +Then if you connect the left half to a computer by USB the keyboard will use QWERTY and Colemak when the +right half is connected. + + +Notes on Using Pro Micro 3.3V +----------------------------- + +Do update the `F_CPU` parameter in `rules.mk` to `8000000` which reflects +the frequency on the 3.3V board. + +Also, if the slave board is producing weird characters in certain columns, +update the following line in `matrix.c` to the following: + +``` +// _delay_us(30); // without this wait read unstable value. +_delay_us(300); // without this wait read unstable value. +``` diff --git a/keyboards/handwired/xealous/rev1/config.h b/keyboards/handwired/xealous/rev1/config.h new file mode 100644 index 0000000000..6fc769b5f2 --- /dev/null +++ b/keyboards/handwired/xealous/rev1/config.h @@ -0,0 +1,90 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4131 +#define PRODUCT_ID 0x5141 +#define DEVICE_VER 0x0001 +#define MANUFACTURER XeaLouS +#define PRODUCT XeaL60 +#define DESCRIPTION A split keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +// wiring of each half +// Ascii art of pro micro. Pin names PD3, PD2, etc. +//Usage| Name | Label Label| Name | Usage +// PORT +// | PD3 TX0 RAW | +// | PD2 RX1 GND |SerGnd +// | GND RESET | +// | GND VCC |SerVCc +// | PD1 2 A3 PF4 | Col7 +//Ser | PD0 3 A2 PF5 | Col6 +//Row4 | PD4 4 A1 PF6 | Col5 +//AUDIO| PC6 5 A0 PF7 | Col4 +//Row3 | PD7 6 15 PB1 | Col3 +//Row2 | PE6 7 14 PB3 | Col2 +//Row1 | PB4 8 13 PB2 | Col1 +//Row0 | PB5 9 10 PB6 | Col0 + +// Note reservation of C6 for audio +#define MATRIX_ROW_PINS { B5, B4, E6, D7, D4 } +#define MATRIX_COL_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 +#define IGNORE_MOD_TAP_INTERRUPT +#endif diff --git a/keyboards/handwired/xealous/rev1/rev1.c b/keyboards/handwired/xealous/rev1/rev1.c new file mode 100644 index 0000000000..3e51421d85 --- /dev/null +++ b/keyboards/handwired/xealous/rev1/rev1.c @@ -0,0 +1,6 @@ +#include "quantum.h" +#include "rev1.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/handwired/xealous/rev1/rev1.h b/keyboards/handwired/xealous/rev1/rev1.h new file mode 100644 index 0000000000..d195af49de --- /dev/null +++ b/keyboards/handwired/xealous/rev1/rev1.h @@ -0,0 +1,32 @@ +#ifndef REV1_H +#define REV1_H + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +//void promicro_bootloader_jmp(bool program); +#define XXX KC_NO + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R06, R05, R04, R03, R02, R01, R00, \ + L10, L11, L12, L13, L14, L15, R17, R16, R15, R14, R13, R12, R11, R10, \ + L20, L21, L22, L23, L24, L25, R26, R25, R24, R23, R22, R21, R20, \ + L30, L31, L32, L33, L34, L35, R35, R34, R33, R32, R31, R30, \ + L40, L41, L42, L43, L44, R44, R43, R42, R41, R40 \ + ) \ + { \ + { XXX, L06, L05, L04, L03, L02, L01, L00 }, \ + { XXX, XXX, L15, L14, L13, L12, L11, L10 }, \ + { XXX, XXX, L25, L24, L23, L22, L21, L20 }, \ + { XXX, XXX, L35, L34, L33, L32, L31, L30 }, \ + { XXX, XXX, XXX, L44, L43, L42, L41, L40 }, \ + { R00, R01, R02, R03, R04, R05, R06, XXX }, \ + { R10, R11, R12, R13, R14, R15, R16, R17 }, \ + { R20, R21, R22, R23, R24, R25, R26, XXX }, \ + { R30, R31, R32, R33, R34, R35, XXX, XXX }, \ + { R40, R41, R42, R43, R44, XXX, XXX, XXX } \ + } + +#define LAYOUT_split60 LAYOUT + +#endif diff --git a/keyboards/handwired/xealous/rev1/rules.mk b/keyboards/handwired/xealous/rev1/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/handwired/xealous/rules.mk b/keyboards/handwired/xealous/rules.mk new file mode 100644 index 0000000000..7178959606 --- /dev/null +++ b/keyboards/handwired/xealous/rules.mk @@ -0,0 +1,73 @@ +SRC += matrix_scanrate.c matrix.c + +# MCU name +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 controls +AUDIO_ENABLE = yes # 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. +SPLIT_KEYBOARD = yes # Use shared split_common code +SUBPROJECT_rev1 = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +LAYOUTS = split60 + +DEFAULT_FOLDER = handwired/xealous/rev1 -- cgit v1.2.3 From 08c682c193f43e5d54df990680ae93fc2e06150a Mon Sep 17 00:00:00 2001 From: Evan Travers Date: Tue, 28 Aug 2018 19:35:24 -0500 Subject: Docs: Add docs for the `LAYOUT_*` macro to layouts (#3772) When moving my planck layout to my let's split, I ran into this issue because I had copied my planck layout from the default layout which just used the `{}` array form for the keymap layers. I checked the docs, but this bit wasn't clear to me. I'm sure @ishtob or @drashna helped me on discord, but this seemed to be the logical place to add a helpful hint. --- docs/feature_layouts.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/feature_layouts.md b/docs/feature_layouts.md index bfae920440..1ee8b5e35c 100644 --- a/docs/feature_layouts.md +++ b/docs/feature_layouts.md @@ -53,6 +53,8 @@ but the `LAYOUT_` variable must be defined in `.h` as well. ## Tips for Making Layouts Keyboard-Agnostic +### Includes + Instead of using `#include "planck.h"`, you can use this line to include whatever `.h` (`.h` should not be included here) file that is being compiled: #include QMK_KEYBOARD_H @@ -72,3 +74,7 @@ For example: ``` Note that the names are lowercase and match the folder/file names for the keyboard/revision exactly. + +### Keymaps + +In order to support both split and non-split keyboards with the same layout, you need to use the keyboard agnostic `LAYOUT_` macro in your keymap. For instance, in order for a Let's Split and Planck to share the same layout file, you need to use `LAYOUT_ortho_4x12` instead of `LAYOUT_planck_grid` or just `{}` for a C array. -- cgit v1.2.3 From 661ca4440cc42f3b60697e98985c44b0571ccfc1 Mon Sep 17 00:00:00 2001 From: Boy_314 <32818287+Boy-314@users.noreply.github.com> Date: Tue, 28 Aug 2018 21:17:52 -0400 Subject: Keymap: Boy_314's Preonic and XD75 Layouts (#3781) * fixed arrow keys and left control * added right shift * latest version * reverted arrow keys * edited readme * added osu layer * updated osu layout * updated osu layout * added full arrow keys to osu layout * in case i mess up creating macros * added the best meme key in the world * added plover steno layer * updated boy314 layout * removed unused layers * added boy314 xd75 layout, inspired by preonic layout * added boy314 xd75 layout, inspired by preonic layout * version 2 of boy314's xd75 layout * added readme notes * updated readme for boy314 xd75 layout * qwerty support, brackets on bottom row, caps lock underglow * fixed readme/ * small changes to allow merging * minor changes to format * fixed up default readme --- keyboards/preonic/keymaps/boy314/config.h | 38 +++++ keyboards/preonic/keymaps/boy314/keymap.c | 213 +++++++++++++++++++++++++++++ keyboards/preonic/keymaps/boy314/readme.md | 8 ++ keyboards/preonic/keymaps/boy314/rules.mk | 0 keyboards/xd75/keymaps/boy_314/config.h | 1 + keyboards/xd75/keymaps/boy_314/keymap.c | 158 +++++++++++++++++++++ keyboards/xd75/keymaps/boy_314/readme.md | 8 ++ keyboards/xd75/keymaps/boy_314/rules.mk | 0 keyboards/xd75/keymaps/default/readme.md | 2 +- 9 files changed, 427 insertions(+), 1 deletion(-) create mode 100644 keyboards/preonic/keymaps/boy314/config.h create mode 100644 keyboards/preonic/keymaps/boy314/keymap.c create mode 100644 keyboards/preonic/keymaps/boy314/readme.md create mode 100644 keyboards/preonic/keymaps/boy314/rules.mk create mode 100644 keyboards/xd75/keymaps/boy_314/config.h create mode 100644 keyboards/xd75/keymaps/boy_314/keymap.c create mode 100644 keyboards/xd75/keymaps/boy_314/readme.md create mode 100644 keyboards/xd75/keymaps/boy_314/rules.mk diff --git a/keyboards/preonic/keymaps/boy314/config.h b/keyboards/preonic/keymaps/boy314/config.h new file mode 100644 index 0000000000..b18b95477b --- /dev/null +++ b/keyboards/preonic/keymaps/boy314/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PREONIC_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + diff --git a/keyboards/preonic/keymaps/boy314/keymap.c b/keyboards/preonic/keymaps/boy314/keymap.c new file mode 100644 index 0000000000..67292bdb3e --- /dev/null +++ b/keyboards/preonic/keymaps/boy314/keymap.c @@ -0,0 +1,213 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +#define FN_CAPS LT(_FL, KC_CAPSLOCK) + +// define layers +#define _QWERTY 0 +#define _DVORAK 1 +#define _OSU 2 +#define _LOWER 10 +#define _RAISE 11 +#define _ADJUST 12 + +// macro shortcuts +#define QWERTY TO(_QWERTY) +#define DVORAK TO(_DVORAK) +#define OSU TO(_OSU) +#define LOWER M(_LOWER) +#define RAISE M(_RAISE) + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Enter| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Caps | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_preonic_grid( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT, \ + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | / | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CAPS | A | O | E | U | I | D | H | T | N | S | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Del | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + +[_DVORAK] = LAYOUT_preonic_grid( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + 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_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT, \ + KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC, \ + KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ + +[_LOWER] = LAYOUT_preonic_grid( \ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_HOME, KC_END, _______, \ + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | | | Up | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | | Left | Down |Right | | | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | |PageDn|PageUP| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = { + {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, + {KC_GRV, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, + {KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, + +[_RAISE] = LAYOUT_preonic_grid( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + KC_DEL, _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff|Dvorak| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | OSU | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_ADJUST] = LAYOUT_preonic_grid( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL, \ + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, DVORAK, _______, _______, _______, _______, \ + _______, OSU, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { + case QWERTY: + if (record->event.pressed) + { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case DVORAK: + if (record->event.pressed) + { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case OSU: + if (record->event.pressed) + { + set_single_persistent_default_layer(_OSU); + } + return false; + break; + case LOWER: + if (record->event.pressed) + { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + else + { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) + { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + else + { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/preonic/keymaps/boy314/readme.md b/keyboards/preonic/keymaps/boy314/readme.md new file mode 100644 index 0000000000..9d8a2fd117 --- /dev/null +++ b/keyboards/preonic/keymaps/boy314/readme.md @@ -0,0 +1,8 @@ +# Boy_314's XD75RE Layout +- NOTE: ONLY SUPPORTS DVORAK AT THE MOMENT, WILL UPDATE WITH QWERTY WHEN I GET THE TIME TO DO SO. +- Features many symbols and function keys in secondary layers. +- NOTE: WORK IN PROGRESS +# THINGS TO DO +- make better use of bottom row +- add numpad toggle layer +- explore rgb underglow options \ No newline at end of file diff --git a/keyboards/preonic/keymaps/boy314/rules.mk b/keyboards/preonic/keymaps/boy314/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/xd75/keymaps/boy_314/config.h b/keyboards/xd75/keymaps/boy_314/config.h new file mode 100644 index 0000000000..7b9637ef9c --- /dev/null +++ b/keyboards/xd75/keymaps/boy_314/config.h @@ -0,0 +1 @@ +#pragma once \ No newline at end of file diff --git a/keyboards/xd75/keymaps/boy_314/keymap.c b/keyboards/xd75/keymaps/boy_314/keymap.c new file mode 100644 index 0000000000..8658fde6e4 --- /dev/null +++ b/keyboards/xd75/keymaps/boy_314/keymap.c @@ -0,0 +1,158 @@ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _DV 0 +#define _QW 1 +#define _FN1 2 +#define _FN2 3 +#define _NP 4 + +#define RGBLIGHT_LIGHT_VAL 255 +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {10, 10, 10}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* DVORAK + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | ' | . | . | P | Y | [ | \ | ] | F | G | C | R | L | / | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | O | E | U | I | HOME | DEL | PG UP | D | H | T | N | S | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | ; | Q | J | K | X | END | UP | PG DN | M | W | W | V | Z | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | [ | ] | { | } | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_DV] = { /* DVORAK */ + { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_LBRC, KC_BSLS, KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH }, + { KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_HOME, KC_DEL, KC_PGUP, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, + { KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_END, KC_UP, KC_PGDN, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC }, + { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR }, + }, + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | [ | ] | { | } | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = { /* QWERTY */ + { KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT }, + { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, + { KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC }, + { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR }, + }, + +/* FUNCTION1 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ~ | ! | @ | # | $ | % | RESET |RGB HUE-|RGB HUE+| ^ | & | * | ( | ) | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | DEL | F1 | F2 | F3 | F4 | F5 | F6 |RGB SAT-|RGB SAT+| DVORAK | _ | + | { | } | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |BRIGHT- |BRIGHT+ | QWERTY | | | HOME | END | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | |RGB MODE|RGB MODE| | | PREV | VOL UP |VOL DOWN| NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN1] = { /* FUNCTION1 */ + { KC_GRV , KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC }, + { KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, RESET, RGB_HUD, RGB_HUI, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + { KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, RGB_SAD, RGB_SAI, TO(_DV), KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE }, + { _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_VAD, RGB_VAI, TO(_QW), _______, _______, KC_HOME, KC_END, _______ }, + { _______, _______, _______, _______, _______, _______, _______,RGB_RMOD, RGB_MOD, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY }, + }, + + +/* FUNCTION2 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | | | UP | | | RESET |RGB HUE-|RGB HUE+| | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | DEL | | LEFT | DOWN | RIGHT | | |RGB SAT-|RGB SAT+| DVORAK | - | = | [ | ] | \ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | |BRIGHT- |BRIGHT+ | QWERTY | | | PAGE UP| PAGE DN| | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | |RGB MODE|RGB MODE| | | PREV | VOL UP |VOL DOWN| NEXT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN2] = { /* FUNCTION2 */ + { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, + { KC_GRV, _______, _______, KC_UP, _______, _______, RESET, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, KC_DEL }, + { KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, RGB_SAD, RGB_SAI, TO(_DV), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, + { _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, TO(_QW), _______, _______, KC_PGDN, KC_PGUP, _______ }, + { _______, _______, _______, _______, _______, _______, _______,RGB_RMOD, RGB_MOD, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY }, + }, + +/* NUMPAD + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | / | * | - | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | 7 | 8 | 9 | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | 4 | 5 | 6 | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | 1 | 2 | 3 | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | 0 | 0 | . | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_NP] = { /* NUMPAD */ + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + } +}; + + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< Date: Wed, 29 Aug 2018 10:42:15 -0700 Subject: Yet another update to drashna keymaps and userspace (#3787) * Make tap function inline * Use better makefile keyboard detection * Remove Copy-Paste macro * Add F11/F12 to Iris * Minor tweaks to userspace config * Set audio clicky randomness to 1.5 * Set NO_DEBUG to only be set if console is not enabled * Move NO_MUSIC_MODE to userspace config.h * Reduce Ergodox Debounce * Add Planck Light config * Use OSM for ortho 4x12 * Music Mode changes for planck light * Cleanup do to shutdown user and other fixes in Master * Add and use 'shutdown_user' fzunction * Remove global NO_MUSIC_MODE define * Add NO_MUSIC_MODE to individual keymaps * Change layer colors * Remove NO_PRINT and NO_DEBUG from userspace config.h Since these are automatically disabled if the console isn't enabled. * Remove backlight code if backlight isn't enabled * Remove Twinkle from Ergodox * Disable RGB twinkling and enable PSM * Clean up RGB matrix code * Clean up planck light indicators * Clean up tap code * Rules cleanup for ortho 4x12 * Fix up userspace template * Revert "Clean up tap code" This reverts commit 09f64d6d67aa021c3b5ac86a9a739a5ca2b9c1ec. * Organize includes * userspace cleanup * Fix modifier spelling error * Fix userspace rules * Disable Permissive Hold again * Minor clean up * Fix Tap stuff * Viterbi Updates for file size --- keyboards/iris/keymaps/drashna/keymap.c | 22 ++- keyboards/iris/keymaps/drashna/rules.mk | 2 +- keyboards/orthodox/keymaps/drashna/config.h | 2 +- keyboards/orthodox/keymaps/drashna/rules.mk | 2 +- keyboards/viterbi/keymaps/drashna/config.h | 8 +- keyboards/viterbi/keymaps/drashna/keymap.c | 2 +- layouts/community/ergodox/drashna/config.h | 3 + layouts/community/ergodox/drashna/keymap.c | 16 +-- layouts/community/ergodox/drashna/rules.mk | 6 +- layouts/community/ortho_4x12/drashna/config.h | 9 ++ layouts/community/ortho_4x12/drashna/keymap.c | 195 ++++++++++++++------------ layouts/community/ortho_4x12/drashna/rules.mk | 14 +- users/drashna/config.h | 16 +-- users/drashna/drashna.c | 75 ++++------ users/drashna/drashna.h | 22 +-- users/drashna/rgb_stuff.c | 6 +- users/drashna/rgb_stuff.h | 1 - users/drashna/template.c | 97 +++++++++---- users/drashna/template.h | 4 +- 19 files changed, 280 insertions(+), 222 deletions(-) diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index 70d13cac21..37c3f97f54 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -2,36 +2,34 @@ #include QMK_KEYBOARD_H #include "drashna.h" -#define KC_ALAP ALT_T(KC_APP) -#define KC_OSLG OSM(MOD_LGUI) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_wrapper( KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, - KC_CCCV, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, KC_ALAP, KC_OSLG, _________________QWERTY_R3_________________, KC_MRSF, + KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, ALT_APP, OS_RGUI, _________________QWERTY_R3_________________, KC_MRSF, LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE ), [_COLEMAK] = LAYOUT_wrapper( KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS, - KC_CCCV, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, KC_ALAP, KC_OSLG, _________________COLEMAK_R3________________, KC_MRSF, + KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, + KC_MLSF, _________________COLEMAK_L3________________, ALT_APP, OS_RGUI, _________________COLEMAK_R3________________, KC_MRSF, LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE ), [_DVORAK] = LAYOUT_wrapper( KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS, - KC_CCCV, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT, - KC_MLSF, _________________DVORAK_L3_________________, KC_ALAP, KC_OSLG, _________________DVORAK_R3_________________, KC_MRSF, + KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT, + KC_MLSF, _________________DVORAK_L3_________________, ALT_APP, OS_RGUI, _________________DVORAK_R3_________________, KC_MRSF, LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE ), [_WORKMAN] = LAYOUT_wrapper( KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS, - KC_CCCV, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_MLSF, _________________WORKMAN_L3________________, KC_ALAP, KC_OSLG, _________________WORKMAN_R3________________, KC_MRSF, + KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, + KC_MLSF, _________________WORKMAN_L3________________, ALT_APP, OS_RGUI, _________________WORKMAN_R3________________, KC_MRSF, LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE ), @@ -53,7 +51,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_wrapper( - _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, _______, _______, ___________________BLANK___________________, _________________LOWER_R2__________________, KC_PIPE, _______, ___________________BLANK___________________, _______, _______, _________________LOWER_R3__________________, _______, @@ -61,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_RAISE] = LAYOUT_wrapper( - _______, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, _______, + KC_F12, _________________FUNC_LEFT_________________, _________________FUNC_RIGHT________________, KC_F11, KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, _______, _________________RAISE_L3__________________, _______, _______, _________________RAISE_R3__________________, _______, diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk index ccc33c06f3..e8035176ef 100644 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ b/keyboards/iris/keymaps/drashna/rules.mk @@ -12,6 +12,6 @@ SWAP_HANDS_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no -RGBLIGHT_TWINKLE = yes +RGBLIGHT_TWINKLE = no BOOTLOADER = qmk-dfu diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index d8ff95fcb6..2257b62fd3 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -58,7 +58,7 @@ along with this program. If not, see . #define C6_AUDIO #ifdef RGBLIGHT_ENABLE #define NO_MUSIC_MODE -#endif //RGBLIGHT_ENABLE +#endif #endif //AUDIO_ENABLE #undef PRODUCT diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index f870c3a7d6..a826c664a7 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -10,6 +10,6 @@ NKRO_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no -RGBLIGHT_TWINKLE = yes +RGBLIGHT_TWINKLE = no BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index 5bc5598ee0..687f80441a 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -35,12 +35,6 @@ along with this program. If not, see . #undef LOCKING_SUPPORT_ENABLE #undef LOCKING_RESYNC_ENABLE -#ifndef NO_DEBUG -#define NO_DEBUG -#endif // !NO_DEBUG -#ifndef NO_PRINT -#define NO_PRINT -#endif // !NO_PRINT /* disable action features */ //#define NO_ACTION_LAYER @@ -59,6 +53,8 @@ along with this program. If not, see . #define NO_MUSIC_MODE #endif +#undef PREVENT_STUCK_MODIFIERS + #define LAYOUT_ortho_5x7( \ L00, L01, L02, L03, L04, L05, L06, \ L10, L11, L12, L13, L14, L15, L16, \ diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index 68ca593db8..acda8a0d25 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -13,7 +13,7 @@ extern keymap_config_t keymap_config; #define _______ KC_TRNS #define XXXXXXX KC_NO -#define LMACRO TG(_MACROS) +#define LMACRO OSL(_MACROS) #define DIABLO TG(_DIABLO) #define GAMEPAD TG(_GAMEPAD) #define MEDIA TT(_MEDIA) diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 9e2bd74f32..3ced185932 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -13,3 +13,6 @@ #undef PRODUCT #define PRODUCT DrashnaDox - Hacked ErgoDox EZ Shine + +#undef DEBOUNCE +#define DEBOUNCE 5 diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 27d20d9289..4d7700f199 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -61,7 +61,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS, KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, KC_MLSF, _________________QWERTY_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_CCCV, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: COLEMAK layer @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS, KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, KC_MLSF, _________________COLEMAK_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_CCCV, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: DVORAK Layout @@ -125,7 +125,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH, KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_MINS, KC_MLSF, _________________DVORAK_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_CCCV, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: WORKMAN layer @@ -157,7 +157,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS, KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, KC_MLSF, _________________WORKMAN_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_CCCV, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, __________________ERGODOX_THUMB_CLUSTER_____________________ ), @@ -294,7 +294,7 @@ void matrix_init_keymap(void) { // Runs boot tasks for keyboard void matrix_scan_keymap(void) { // runs frequently to update info - uint8_t modifiders = get_mods(); + uint8_t modifiers = get_mods(); uint8_t led_usb_state = host_keyboard_leds(); uint8_t one_shot = get_oneshot_mods(); @@ -307,15 +307,15 @@ void matrix_scan_keymap(void) { // runs frequently to update info // Since we're not using the LEDs here for layer indication anymore, // then lets use them for modifier indicators. Shame we don't have 4... // Also, no "else", since we want to know each, independently. - if (modifiders & MODS_SHIFT_MASK || led_usb_state & (1<event.pressed) { register_code(KC_RSFT); @@ -170,8 +113,86 @@ bool music_mask_user(uint16_t keycode) { switch (keycode) { case RAISE: case LOWER: + case BK_LWER: + case SP_LWER: + case DL_RAIS: + case ET_RAIS: return false; default: return true; } } + +#ifdef RGB_MATRIX_ENABLE + + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { + rgb_led led; + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if (led.matrix_co.raw < 0xFF) { + if (led.modifier) { + rgb_matrix_set_color( i, red, green, blue ); + } + } + } +} + +void rgb_matrix_indicators_user(void) { + uint8_t this_mod = get_mods(); + uint8_t this_led = host_keyboard_leds(); + uint8_t this_osm = get_oneshot_mods(); + + switch (biton32(layer_state)) { + case _RAISE: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; + case _LOWER: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + case _ADJUST: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + default: + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; + case _COLEMAK: + rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; + case _DVORAK: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; + case _WORKMAN: + rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; + } + } + + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_set_color(42, 0x00, 0xFF, 0xFF); break; + case _COLEMAK: + rgb_matrix_set_color(42, 0xFF, 0x00, 0xFF); break; + case _DVORAK: + rgb_matrix_set_color(42, 0x00, 0xFF, 0x00); break; + case _WORKMAN: + rgb_matrix_set_color(42, 0xD9, 0xA5, 0x21); break; + } + + if (this_mod & MODS_SHIFT_MASK || this_led & (1<. */ #include "drashna.h" -#include "version.h" -#include "eeprom.h" #include "tap_dances.h" #include "rgb_stuff.h" - -float tone_copy[][2] = SONG(SCROLL_LOCK_ON_SOUND); -float tone_paste[][2] = SONG(SCROLL_LOCK_OFF_SOUND); - -static uint16_t copy_paste_timer; userspace_config_t userspace_config; // Helper Functions @@ -35,8 +28,14 @@ userspace_config_t userspace_config; // the same thing, but with differring text sent. bool send_game_macro(const char *str, keyrecord_t *record, bool override) { if (!record->event.pressed || override) { + uint16_t keycode; + if (userspace_config.is_overwatch) { + keycode = KC_BSPC; + } else { + keycode = KC_ENTER; + } clear_keyboard(); - tap(userspace_config.is_overwatch ? KC_BSPC : KC_ENTER); + tap(keycode); wait_ms(50); send_string_with_delay(str, MACRO_TIMER); wait_ms(50); @@ -46,8 +45,6 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { return false; } -void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; - bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed) { static uint16_t this_timer; if(pressed) { @@ -93,6 +90,9 @@ void matrix_init_keymap(void) {} __attribute__ ((weak)) void startup_keymap(void) {} +__attribute__ ((weak)) +void shutdown_keymap(void) {} + __attribute__ ((weak)) void suspend_power_down_keymap(void) {} @@ -127,6 +127,7 @@ __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} + // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { @@ -158,6 +159,24 @@ void startup_user (void) { startup_keymap(); } +void shutdown_user (void) { +#ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + rgblight_setrgb_red(); +#endif // RGBLIGHT_ENABLE +#ifdef RGB_MATRIX_ENABLE + rgb_led led; + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if (led.matrix_co.raw < 0xFF) { + rgb_matrix_set_color( i, 0xFF, 0x00, 0x00 ); + } + } +#endif //RGB_MATRIX_ENABLE + shutdown_keymap(); +} + void suspend_power_down_user(void) { suspend_power_down_keymap(); @@ -246,20 +265,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - - case KC_RESET: // Custom RESET code that sets RGBLights to RED - if (!record->event.pressed) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); -#endif // RGBLIGHT_ENABLE - reset_keyboard(); - } - return false; - break; - - case EPRM: // Resets EEPROM if (record->event.pressed) { eeconfig_init(); @@ -333,28 +338,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - case KC_CCCV: // One key copy/paste - if(record->event.pressed){ - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_code(KC_LCTL); - tap(KC_C); - unregister_code(KC_LCTL); -#ifdef AUDIO_ENABLE - PLAY_SONG(tone_copy); -#endif - } else { // Tap, paste - register_code(KC_LCTL); - tap(KC_V); - unregister_code(KC_LCTL); -#ifdef AUDIO_ENABLE - PLAY_SONG(tone_paste); -#endif - } - } - return false; - break; case CLICKY_TOGGLE: #ifdef AUDIO_CLICKY userspace_config.clicky_enable = clicky_enable; diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 3efef57046..dd0d1c0d7e 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -15,11 +15,13 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef USERSPACE -#define USERSPACE +#pragma once #include "quantum.h" - - +#include "version.h" +#include "eeprom.h" +#ifdef RGB_MATRIX_ENABLE +#include "rgb_matrix.h" +#endif // Define layer names enum userspace_layers { _QWERTY = 0, @@ -53,7 +55,7 @@ extern bool clicky_enable; void rgblight_sethsv_default_helper(uint8_t index); #endif // RGBLIGHT_ENABLE -void tap(uint16_t keycode); +inline void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); @@ -90,7 +92,6 @@ enum userspace_custom_keycodes { KC_C9, KC_GGEZ, KC_MAKE, // Run keyboard's customized make command - KC_RESET, // Resets keyboard, with red underglow KC_RGB_T, // Toggles RGB Layer Indication mode KC_SECRET_1, // test1 KC_SECRET_2, // test2 @@ -123,6 +124,7 @@ enum userspace_custom_keycodes { #define COLEMAK KC_COLEMAK #define WORKMAN KC_WORKMAN +#define KC_RESET RESET #define KC_RST KC_RESET #ifdef SWAP_HANDS_ENABLE @@ -131,6 +133,11 @@ enum userspace_custom_keycodes { #define KC_C1R3 KC_BSPC #endif // SWAP_HANDS_ENABLE +#define BK_LWER LT(_LOWER, KC_BSPC) +#define SP_LWER LT(_LOWER, KC_SPC) +#define DL_RAIS LT(_RAISE, KC_DEL) +#define ET_RAIS LT(_RAISE, KC_ENTER) + // OSM keycodes, to keep things clean and easy to change #define KC_MLSF OSM(MOD_LSFT) #define KC_MRSF OSM(MOD_RSFT) @@ -325,7 +332,7 @@ enum { #define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ _______, CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM #define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 @@ -350,4 +357,3 @@ enum { LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) -#endif // !USERSPACE diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index f2a9a47a90..03c55b1323 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -267,7 +267,7 @@ void matrix_init_rgb(void) { case _COLEMAK: rgblight_sethsv_noeeprom_magenta(); break; case _DVORAK: - rgblight_sethsv_noeeprom_green(); break; + rgblight_sethsv_noeeprom_springgreen(); break; case _WORKMAN: rgblight_sethsv_noeeprom_goldenrod(); break; default: @@ -313,7 +313,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { rgblight_mode_noeeprom(5); break; case _LOWER: - rgblight_sethsv_noeeprom_orange(); + rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(5); break; case _ADJUST: @@ -325,7 +325,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { case _COLEMAK: rgblight_sethsv_noeeprom_magenta(); break; case _DVORAK: - rgblight_sethsv_noeeprom_green(); break; + rgblight_sethsv_noeeprom_springgreen(); break; case _WORKMAN: rgblight_sethsv_noeeprom_goldenrod(); break; default: diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 6426ea266f..50c75c8c3c 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -13,4 +13,3 @@ void matrix_init_rgb(void); void matrix_scan_rgb(void); uint32_t layer_state_set_rgb(uint32_t state); - diff --git a/users/drashna/template.c b/users/drashna/template.c index 20dbb96d7f..e6b50c961b 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c @@ -1,7 +1,5 @@ -#include "drashna.h" -#include "quantum.h" -#include "action.h" -#include "version.h" +#include "template.h" + // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued @@ -10,25 +8,15 @@ __attribute__ ((weak)) void matrix_init_keymap(void) {} -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - // Call user matrix init, then call the keymap's init function void matrix_init_user(void) { matrix_init_keymap(); } + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + // No global matrix scan code, so just run keymap's matix // scan function void matrix_scan_user(void) { @@ -36,11 +24,16 @@ void matrix_scan_user(void) { } +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + // Defines actions tor my global custom keycodes. Defined in drashna.h file // Then runs the _keymap's recod handier if not processed here, // And use "NEWPLACEHOLDER" for new safe range bool process_record_user(uint16_t keycode, keyrecord_t *record) { - + switch (keycode) { case KC_MAKE: if (!record->event.pressed) { @@ -56,12 +49,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KC_RESET: - if (!record->event.pressed) { - reset_keyboard(); - } - return false; - break; + case EPRM: if (record->event.pressed) { eeconfig_init(); @@ -78,13 +66,66 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return process_record_keymap(keycode, record); } -// Runs state check and changes underglow color and animation -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check + +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + uint32_t layer_state_set_user (uint32_t state) { return layer_state_set_keymap (state); } + + +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } + + + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +void suspend_power_down_user(void) +{ + suspend_power_down_keymap(); +} + + + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +void suspend_wakeup_init_user(void) +{ + suspend_wakeup_init_keymap(); + #ifdef KEYBOARD_ergodox_ez + wait_ms(10); + #endif +} + + + +__attribute__ ((weak)) +void startup_keymap(void) {} + +void startup_user (void) { + #ifdef RGBLIGHT_ENABLE + matrix_init_rgb(); + #endif //RGBLIGHT_ENABLE + startup_keymap(); +} + + + +__attribute__ ((weak)) +void shutdown_keymap(void) {} + +void shutdown_user (void) { + shutdown_keymap(); +} + diff --git a/users/drashna/template.h b/users/drashna/template.h index d1251462b2..5b3a93de5f 100644 --- a/users/drashna/template.h +++ b/users/drashna/template.h @@ -2,8 +2,10 @@ #define USERSPACE #include "quantum.h" +#include "version.h" +#include "eeprom.h" -// Define layer names +// Define layer names #define BASE 0 enum custom_keycodes { -- cgit v1.2.3 From 74f2f855a330899bb078b1a1ba433368e0e05ea6 Mon Sep 17 00:00:00 2001 From: Jumail Date: Wed, 29 Aug 2018 10:31:22 +1000 Subject: Fixed bootloader target Fixed matching grep matches (for PRODUCT in particular) Fixed " Bootloader" concatenation for WSL (windows line-endings) --- tmk_core/avr.mk | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index cf62b0f078..2f955b18fe 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -253,12 +253,12 @@ extcoff: $(BUILD_DIR)/$(TARGET).elf bootloader: make -C lib/lufa/Bootloaders/DFU/ clean printf "#ifndef QMK_KEYBOARD\n#define QMK_KEYBOARD\n\n" > lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "MANUFACTURER" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s Bootloader\n" "`$(GREP) "PRODUCT" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_ESC_OUTPUT" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_ESC_INPUT" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_LED" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h - printf "%s\n" "`$(GREP) "QMK_SPEAKER" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s\n" "`$(GREP) "MANUFACTURER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s Bootloader\n" "`$(GREP) "PRODUCT\s" $(ALL_CONFIGS) -h | tail -1 | tr -d '\r'`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s\n" "`$(GREP) "QMK_ESC_OUTPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s\n" "`$(GREP) "QMK_ESC_INPUT\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s\n" "`$(GREP) "QMK_LED\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h + printf "%s\n" "`$(GREP) "QMK_SPEAKER\s" $(ALL_CONFIGS) -h | tail -1`" >> lib/lufa/Bootloaders/DFU/Keyboard.h printf "\n#endif" >> lib/lufa/Bootloaders/DFU/Keyboard.h make -C lib/lufa/Bootloaders/DFU/ printf "BootloaderDFU.hex copied to $(TARGET)_bootloader.hex\n" -- cgit v1.2.3 From 836efb50c6fa1be9e3189242479e7ae5bc2b3f38 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 29 Aug 2018 10:57:30 -0700 Subject: Updated templates for use by new_project.sh (#3783) * template.h file cleanup Reformatted the pre-macro comments as block comments. Updated the ps2avrgb template comment to match the avr template's comment, which was more informative. Deleted the line about the macro representing the Planck MIT layout, because the macro doesn't represent that layout anymore. * base template keymap.c refactor Deleted the deprecated TMK macro functions. Defined two custom keycodes for use as macros by process_record_user. process_record_user is now after the keymap and before matrix_init_user, where the deleted TMK functions were. * Removed an extra " from macro command per @drashna * Added BOOTLOADER rule to avr/rules.mk per @drashna * Updated Bootloader sections per @drashna * Updated links to docs at the bottom of both avr and ps2avrgb template readme.md files Corrected the links to the Build Environment Setup and the Make Instructions docs. Added direct link to the QMK Complete Newbs Guide. --- quantum/template/avr/readme.md | 2 +- quantum/template/avr/rules.mk | 25 ++++++++---- quantum/template/avr/template.h | 14 ++++--- quantum/template/base/keymaps/default/keymap.c | 54 ++++++++++++++------------ quantum/template/ps2avrgb/readme.md | 2 +- quantum/template/ps2avrgb/template.h | 12 ++++-- 6 files changed, 65 insertions(+), 44 deletions(-) diff --git a/quantum/template/avr/readme.md b/quantum/template/avr/readme.md index d9349811d0..d243c66a94 100644 --- a/quantum/template/avr/readme.md +++ b/quantum/template/avr/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make %KEYBOARD%:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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/quantum/template/avr/rules.mk b/quantum/template/avr/rules.mk index 92f3a03a92..383a3594b4 100644 --- a/quantum/template/avr/rules.mk +++ b/quantum/template/avr/rules.mk @@ -39,13 +39,24 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# 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 diff --git a/quantum/template/avr/template.h b/quantum/template/avr/template.h index 031efc9529..0d626ed50b 100644 --- a/quantum/template/avr/template.h +++ b/quantum/template/avr/template.h @@ -18,12 +18,14 @@ #include "quantum.h" -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguments representing the physical -// layout of the board and position of the keys -// The second converts the arguments into a two-dimensional array which -// represents the switch matrix. +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ #define LAYOUT( \ K00, K01, K02, \ K10, K11 \ diff --git a/quantum/template/base/keymaps/default/keymap.c b/quantum/template/base/keymaps/default/keymap.c index 14a8bc0f28..5f0730c8a9 100644 --- a/quantum/template/base/keymaps/default/keymap.c +++ b/quantum/template/base/keymaps/default/keymap.c @@ -15,32 +15,40 @@ */ #include QMK_KEYBOARD_H -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT( /* Base */ - KC_A, KC_1, KC_H, \ - KC_TAB, KC_SPC \ -), +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL }; -const uint16_t PROGMEM fn_actions[] = { - +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_A, KC_1, KC_H, \ + KC_TAB, KC_SPC \ + ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released } - return MACRO_NONE; -}; - + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} void matrix_init_user(void) { @@ -50,10 +58,6 @@ void matrix_scan_user(void) { } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - void led_set_user(uint8_t usb_led) { } diff --git a/quantum/template/ps2avrgb/readme.md b/quantum/template/ps2avrgb/readme.md index 1dcbe6e755..feec722a52 100644 --- a/quantum/template/ps2avrgb/readme.md +++ b/quantum/template/ps2avrgb/readme.md @@ -41,4 +41,4 @@ macOS: 4. Place your keyboard into reset. 5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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/quantum/template/ps2avrgb/template.h b/quantum/template/ps2avrgb/template.h index c3924ee71f..b4d6f46624 100644 --- a/quantum/template/ps2avrgb/template.h +++ b/quantum/template/ps2avrgb/template.h @@ -18,10 +18,14 @@ #include "quantum.h" -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ #define LAYOUT( \ k00, k01, k02, \ k10, k11 \ -- cgit v1.2.3 From 190fcdde2620bcd2d94b58aa29fca3f5361ef40d Mon Sep 17 00:00:00 2001 From: blindassassin111 <38090555+blindassassin111@users.noreply.github.com> Date: Wed, 29 Aug 2018 13:58:09 -0500 Subject: Keyboard: Adding the AT101 PCB (#3785) * Adding the AT101 PCB firmware * Fixed AT101 keymap error * Fixing AT101 firmware * More Fixes for AT101 firmware * Rename AT101_Blackheart.c to at101_blackheart.c * Rename AT101_Blackheart.h to at101_blackheart.h * Update readme.md * Renaming AT101 folder pt1 * Renaming AT101 folder pt2 * Fixing AT101 LED function name * Redoing AT101 folder naming pt2 Last round had issues, should be the last rename. * Fixing missing comma in at101_blackheart.h --- keyboards/at101_blackheart/at101_blackheart.c | 1 + keyboards/at101_blackheart/at101_blackheart.h | 28 ++++++++++ keyboards/at101_blackheart/config.h | 43 ++++++++++++++++ .../at101_blackheart/keymaps/default/keymap.c | 53 +++++++++++++++++++ keyboards/at101_blackheart/readme.md | 14 +++++ keyboards/at101_blackheart/rules.mk | 59 ++++++++++++++++++++++ 6 files changed, 198 insertions(+) create mode 100644 keyboards/at101_blackheart/at101_blackheart.c create mode 100644 keyboards/at101_blackheart/at101_blackheart.h create mode 100644 keyboards/at101_blackheart/config.h create mode 100644 keyboards/at101_blackheart/keymaps/default/keymap.c create mode 100644 keyboards/at101_blackheart/readme.md create mode 100644 keyboards/at101_blackheart/rules.mk diff --git a/keyboards/at101_blackheart/at101_blackheart.c b/keyboards/at101_blackheart/at101_blackheart.c new file mode 100644 index 0000000000..aa07a78643 --- /dev/null +++ b/keyboards/at101_blackheart/at101_blackheart.c @@ -0,0 +1 @@ +#include "at101_blackheart.h" diff --git a/keyboards/at101_blackheart/at101_blackheart.h b/keyboards/at101_blackheart/at101_blackheart.h new file mode 100644 index 0000000000..24ac1b7c54 --- /dev/null +++ b/keyboards/at101_blackheart/at101_blackheart.h @@ -0,0 +1,28 @@ +#ifndef at101_blackheart_H +#define at101_blackheart_H + +#include "quantum.h" + +#define LAYOUT( \ + K0000, K0100, K0001, K0101, K0002, K0102, K0003, K0103, K0004, K0104, K0005, K0105, K0006, K0106, K0007, K0107, \ + K0200, K0300, K0201, K0301, K0202, K0302, K0203, K0303, K0204, K0304, K0205, K0305, K0206, K0306, K0207, K0307, K0208, K0308, K0209, K0309, K0009, \ + K0400, K0500, K0401, K0501, K0402, K0502, K0403, K0503, K0404, K0504, K0405, K0505, K0406, K0506, K0407, K0507, K0408, K0508, K0409, K0509, K0109, \ + K0600, K0700, K0601, K0701, K0602, K0702, K0603, K0703, K0604, K0704, K0605, K0705, K0606, K0608, K0708, K0609, K0709, \ + K0800, K1101, K0900, K0801, K0901, K0802, K0902, K0803, K0903, K0804, K0904, K0805, K0905, K0806, K0807, K0808, K0908, K0809, K0909, \ + K1000, K1100, K1001, K1102, K1005, K1105, K1006, K1106, K1007, K1107, K1008, K1108, K1009 \ +) { \ + { K0000, K0001, K0002, K0003, K0004, K0005, K0006, K0007, KC_NO, K0009 }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, KC_NO, K0109 }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209 }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309 }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409 }, \ + { K0500, K0501, K0502, K0503, K0504, K0505, K0506, K0507, K0508, K0509 }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, KC_NO, K0608, K0609 }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, KC_NO, KC_NO, K0708, K0709 }, \ + { K0800, K0801, K0802, K0803, K0804, K0805, K0806, K0807, K0808, K0809 }, \ + { K0900, K0901, K0902, K0903, K0904, K0905, KC_NO, KC_NO, K0908, K0909 }, \ + { K1000, K1001, KC_NO, KC_NO, KC_NO, K1005, K1006, K1007, K1008, K1009 }, \ + { K1100, K1101, K1102, KC_NO, KC_NO, K1105, K1106, K1107, K1108, KC_NO } \ +} + +#endif diff --git a/keyboards/at101_blackheart/config.h b/keyboards/at101_blackheart/config.h new file mode 100644 index 0000000000..6a809a02f8 --- /dev/null +++ b/keyboards/at101_blackheart/config.h @@ -0,0 +1,43 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER blindassassin111 +#define PRODUCT AT101_Blackheart PCB +#define DESCRIPTION Replacement AT101 PCB + +/* key matrix size */ +#define MATRIX_ROWS 12 +#define MATRIX_COLS 10 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F0, F1, F4, D4, F6, F5, F7, B6, B5, D5, C7, C6 } +#define MATRIX_COL_PINS { D1, D0, B7, B3, B2, B1, B0, E6, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 n-key rollover*/ +#define FORCE_NKRO + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS \ No newline at end of file diff --git a/keyboards/at101_blackheart/keymaps/default/keymap.c b/keyboards/at101_blackheart/keymaps/default/keymap.c new file mode 100644 index 0000000000..086c25e1c7 --- /dev/null +++ b/keyboards/at101_blackheart/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + 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_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_PPLS, + 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_PEQL, + KC_LSFT,KC_BSLS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_LSFT,MO(1), KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI,KC_MENU, KC_RCTL, KC_LEFT,KC_DOWN, KC_RGHT, KC_P0, KC_PDOT), + + LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + DDRB |= (1 << 4); + DDRD |= (1 << 6) | (1 << 7); + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + PORTD |= (1 << 7); + } else { + PORTD &= ~(1 << 7); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + PORTB |= (1 << 4); + } else { + PORTB &= ~(1 << 4); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + PORTD |= (1 << 6); + } else { + PORTD &= ~(1 << 6); + } +} \ No newline at end of file diff --git a/keyboards/at101_blackheart/readme.md b/keyboards/at101_blackheart/readme.md new file mode 100644 index 0000000000..7b356bc753 --- /dev/null +++ b/keyboards/at101_blackheart/readme.md @@ -0,0 +1,14 @@ +AT101 Blackheart PCB +=== + +A replacement PCB for AT101 keyboards. + +Keyboard Maintainer: QMK Community and blindassassin111 +Hardware Supported: AT101 blackheart PCB +Hardware Availability: https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html + +Make example for this keyboard (after setting up your build environment): + + make at101_blackheart:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/at101_blackheart/rules.mk b/keyboards/at101_blackheart/rules.mk new file mode 100644 index 0000000000..fadff6f23b --- /dev/null +++ b/keyboards/at101_blackheart/rules.mk @@ -0,0 +1,59 @@ +# MCU name +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 +BOOTLOADER = halfkay + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file -- cgit v1.2.3 From a6c770432f1348c44bc199029ce17b1b9ff4191c Mon Sep 17 00:00:00 2001 From: frederik-h Date: Wed, 29 Aug 2018 21:01:49 +0200 Subject: Keymap: Add german layout for redox keyboard (#3695) * Add german layout for redox keyboard A german layout for the redox keyboard which tries to stay close to the default english redox layout while acommodating the umlauts at their usual position. * Fix keycodes in german redox keymap The keycode for Y was wrong. * Minor changes * Remove #ifdef include guard by #pragma once * Remove unnecessary include from rules.mk * Review changes Remove unnecessary code fragments that were pointed out in the review of PR #3695 by @drashna. --- keyboards/redox/keymaps/german/config.h | 36 +++++++++++ keyboards/redox/keymaps/german/keymap.c | 108 +++++++++++++++++++++++++++++++ keyboards/redox/keymaps/german/readme.md | 5 ++ keyboards/redox/keymaps/german/rules.mk | 1 + 4 files changed, 150 insertions(+) create mode 100644 keyboards/redox/keymaps/german/config.h create mode 100644 keyboards/redox/keymaps/german/keymap.c create mode 100644 keyboards/redox/keymaps/german/readme.md create mode 100644 keyboards/redox/keymaps/german/rules.mk diff --git a/keyboards/redox/keymaps/german/config.h b/keyboards/redox/keymaps/german/config.h new file mode 100644 index 0000000000..0eb19ab1ef --- /dev/null +++ b/keyboards/redox/keymaps/german/config.h @@ -0,0 +1,36 @@ +/* +Copyright 2018 Mattia Dal Ben + +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 + +/* Use I2C or Serial, not both */ + +// #define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +#define MASTER_LEFT +// #define EE_HANDS + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/german/keymap.c b/keyboards/redox/keymaps/german/keymap.c new file mode 100644 index 0000000000..315740f68b --- /dev/null +++ b/keyboards/redox/keymaps/german/keymap.c @@ -0,0 +1,108 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + +extern keymap_config_t keymap_config; +extern rgblight_config_t rgblight_config; + +// 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 _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Fillers to make layering more clear +#define KC_ KC_TRNS +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * |^/Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |--Lyr2| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | ` | | + | Y | U | I | O | P | = | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | Ö | Ä | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | - |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Gui | < | # |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space | Alt | Left | Down | Up | Right| + * `------------------------------------------------' `------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + LT(_NAV, DE_CIRC) , DE_1 , DE_2 , DE_3 , DE_4 , DE_5 ,MO(_SYMB), MO(_SYMB), DE_6 , DE_7 , DE_8 , DE_9 , DE_0 ,LT(_NAV, DE_SS), + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_TAB , DE_Q , DE_W , DE_E , DE_R , DE_T , DE_ACUT, DE_PLUS , DE_Z , DE_U , DE_I , DE_O , DE_P , DE_UE, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_ESC , DE_A , DE_S , DE_D , DE_F , DE_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , DE_H , DE_J , DE_K , DE_L , DE_OE , DE_AE, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_LSFT, DE_Y , DE_X , DE_C , DE_V , DE_B ,KC_PGDN, KC_HOME , DE_N , DE_M , DE_COMM, DE_DOT , DE_MINS , KC_RSFT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_LGUI , DE_LESS , DE_HASH , LALT_T(KC_KP_PLUS),LCTL_T(KC_KP_ASTERISK),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, DE_ALGR , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + +/* Symbols + * ,------------------------------------------------. ,------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | F12 | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | # | $ | [ | ] | ~ | | | | | 4 | 5 | 6 | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| % | ^ | ( | ) | ` | | | | | 1 | 2 | 3 | |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | Alt | Ctrl | | | | | | 0 | 0 | . | | | + * `------------------------------------------------' `------------------------------------------------' + */ + + [_SYMB] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, DE_EXLM, DE_AT , DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, KC_F12, + _______, DE_HASH, DE_DLR , DE_LBRC, DE_RBRC, DE_TILD, _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, + KC_LSFT, DE_PERC, DE_CIRC, DE_LPRN, DE_RPRN, DE_GRV, _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, KC_RSFT, + _______, _______, _______, KC_LALT, KC_LCTL, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX + ), + +/* Navigation + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | |MOUS_U| |WHEL_U| | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | |MOUS_L|MOUS_D|MOUS_R|WHEL_D| | | | | LEFT | DOWN | UP |RIGHT | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | |MOUS_1|MOUS_2| | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, KC_WH_U, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT,XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ), + + [_ADJUST] = LAYOUT( + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, + XXXXXXX, RESET , RGB_M_P, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, KC_DEL, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) + +}; diff --git a/keyboards/redox/keymaps/german/readme.md b/keyboards/redox/keymaps/german/readme.md new file mode 100644 index 0000000000..91bc230fca --- /dev/null +++ b/keyboards/redox/keymaps/german/readme.md @@ -0,0 +1,5 @@ +# German keymap for Redox + +The layout acommodates the German umlauts and the punctuation symbols +at their usual positions relative to the other alphabetic characters. +Apart from that it stays close to the default english redox layout. diff --git a/keyboards/redox/keymaps/german/rules.mk b/keyboards/redox/keymaps/german/rules.mk new file mode 100644 index 0000000000..1e3cebb145 --- /dev/null +++ b/keyboards/redox/keymaps/german/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes -- cgit v1.2.3 From 30680c6eb396a2bb06928afd69edae9908ac84fb Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Wed, 29 Aug 2018 15:07:52 -0400 Subject: Massdrop keyboard support (#3780) * Massdrop SAMD51 Massdrop SAMD51 keyboards initial project upload * Removing relocated files Removing files that were relocated and not deleted from previous location * LED queue fix and cleaning Cleaned some white space or comments. Fix for LED I2C command queue. Cleaned up interrupts. Added debug function for printing numbers to scope through m15 line. * Factory programmed serial usage Ability to use factory programmed serial in hub and keyboard usb descriptors * USB serial number and bugfix Added support for factory programmed serial and usage. Incorporated bootloader's conditional compiling to align project closer. Fixed issue when USB device attempted to send before enabled. General white space and comment cleanup. * Project cleanup Cleaned up project in terms of white space, commented code, and unecessary files. NKRO keyboard is now using correct setreport although KBD was fine to use. Fixed broken linkage to __xprintf for serial debug statements. * Fix for extra keys Fixed possible USB hang on extra keys report set missing * I2C cleanup I2C cleanup and file renames necessary for master branch merge * Boot tracing and clocks cleanup Added optional boot debug trace mode through debug LED codes. General clock code cleanup. * Relocate ARM/Atmel headers Moved ARM/Atmel header folder from drivers to lib and made necessary makefile changes. * Pull request changes Pull request changes * Keymap and compile flag fix Keymap fix for momentary layer. Potential compile flag fix for Travis CI failure. * va_list include fix Fix for va_list compile failure * Include file case fixes Fixes for include files with incorrect case * ctrl and alt67 keyboard readme Added ctrl and alt67 keyboard readme files --- build_keyboard.mk | 8 + keyboards/alt67/alt67.h | 24 + keyboards/alt67/config.h | 79 + keyboards/alt67/config_led.h | 178 + keyboards/alt67/keymaps/default/keymap.c | 200 + keyboards/alt67/led_programs.c | 120 + keyboards/alt67/matrix.c | 182 + keyboards/alt67/matrix.h | 77 + keyboards/alt67/readme.md | 15 + keyboards/alt67/rules.mk | 32 + keyboards/ctrl/config.h | 79 + keyboards/ctrl/config_led.h | 191 + keyboards/ctrl/ctrl.h | 32 + keyboards/ctrl/keymaps/default/keymap.c | 203 + keyboards/ctrl/led_programs.c | 120 + keyboards/ctrl/matrix.c | 182 + keyboards/ctrl/matrix.h | 77 + keyboards/ctrl/readme.md | 15 + keyboards/ctrl/rules.mk | 32 + .../packs/arm/cmsis/5.0.1/CMSIS/Include/arm_math.h | 7226 ++++++++++++++++++++ .../arm/cmsis/5.0.1/CMSIS/Include/cmsis_compiler.h | 223 + .../arm/cmsis/5.0.1/CMSIS/Include/cmsis_gcc.h | 1899 +++++ .../packs/arm/cmsis/5.0.1/CMSIS/Include/core_cm4.h | 2103 ++++++ lib/arm_atsam/packs/arm/cmsis/5.0.1/LICENSE.txt | 201 + .../SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld | 168 + .../SAMD51_DFP/1.0.70/include/component-version.h | 65 + .../atmel/SAMD51_DFP/1.0.70/include/component/ac.h | 598 ++ .../SAMD51_DFP/1.0.70/include/component/adc.h | 871 +++ .../SAMD51_DFP/1.0.70/include/component/aes.h | 375 + .../SAMD51_DFP/1.0.70/include/component/can.h | 3207 +++++++++ .../SAMD51_DFP/1.0.70/include/component/ccl.h | 228 + .../SAMD51_DFP/1.0.70/include/component/cmcc.h | 357 + .../SAMD51_DFP/1.0.70/include/component/dac.h | 544 ++ .../SAMD51_DFP/1.0.70/include/component/dmac.h | 1416 ++++ .../SAMD51_DFP/1.0.70/include/component/dsu.h | 1244 ++++ .../SAMD51_DFP/1.0.70/include/component/eic.h | 497 ++ .../SAMD51_DFP/1.0.70/include/component/evsys.h | 587 ++ .../SAMD51_DFP/1.0.70/include/component/freqm.h | 233 + .../SAMD51_DFP/1.0.70/include/component/gclk.h | 272 + .../SAMD51_DFP/1.0.70/include/component/hmatrixb.h | 84 + .../SAMD51_DFP/1.0.70/include/component/i2s.h | 747 ++ .../SAMD51_DFP/1.0.70/include/component/icm.h | 582 ++ .../SAMD51_DFP/1.0.70/include/component/mclk.h | 474 ++ .../SAMD51_DFP/1.0.70/include/component/nvmctrl.h | 861 +++ .../1.0.70/include/component/osc32kctrl.h | 303 + .../SAMD51_DFP/1.0.70/include/component/oscctrl.h | 793 +++ .../SAMD51_DFP/1.0.70/include/component/pac.h | 674 ++ .../SAMD51_DFP/1.0.70/include/component/pcc.h | 251 + .../SAMD51_DFP/1.0.70/include/component/pdec.h | 726 ++ .../atmel/SAMD51_DFP/1.0.70/include/component/pm.h | 261 + .../SAMD51_DFP/1.0.70/include/component/port.h | 414 ++ .../SAMD51_DFP/1.0.70/include/component/qspi.h | 528 ++ .../SAMD51_DFP/1.0.70/include/component/ramecc.h | 178 + .../SAMD51_DFP/1.0.70/include/component/rstc.h | 115 + .../SAMD51_DFP/1.0.70/include/component/rtc.h | 2098 ++++++ .../SAMD51_DFP/1.0.70/include/component/sdhc.h | 2599 +++++++ .../SAMD51_DFP/1.0.70/include/component/sercom.h | 1680 +++++ .../SAMD51_DFP/1.0.70/include/component/supc.h | 554 ++ .../SAMD51_DFP/1.0.70/include/component/tal.h | 1842 +++++ .../atmel/SAMD51_DFP/1.0.70/include/component/tc.h | 851 +++ .../SAMD51_DFP/1.0.70/include/component/tcc.h | 1762 +++++ .../SAMD51_DFP/1.0.70/include/component/trng.h | 172 + .../SAMD51_DFP/1.0.70/include/component/usb.h | 1777 +++++ .../SAMD51_DFP/1.0.70/include/component/wdt.h | 300 + .../atmel/SAMD51_DFP/1.0.70/include/instance/ac.h | 79 + .../SAMD51_DFP/1.0.70/include/instance/adc0.h | 99 + .../SAMD51_DFP/1.0.70/include/instance/adc1.h | 100 + .../atmel/SAMD51_DFP/1.0.70/include/instance/aes.h | 105 + .../SAMD51_DFP/1.0.70/include/instance/can0.h | 153 + .../SAMD51_DFP/1.0.70/include/instance/can1.h | 151 + .../atmel/SAMD51_DFP/1.0.70/include/instance/ccl.h | 57 + .../SAMD51_DFP/1.0.70/include/instance/cmcc.h | 61 + .../atmel/SAMD51_DFP/1.0.70/include/instance/dac.h | 88 + .../SAMD51_DFP/1.0.70/include/instance/dmac.h | 596 ++ .../atmel/SAMD51_DFP/1.0.70/include/instance/dsu.h | 121 + .../atmel/SAMD51_DFP/1.0.70/include/instance/eic.h | 73 + .../SAMD51_DFP/1.0.70/include/instance/evsys.h | 722 ++ .../SAMD51_DFP/1.0.70/include/instance/freqm.h | 59 + .../SAMD51_DFP/1.0.70/include/instance/gclk.h | 191 + .../SAMD51_DFP/1.0.70/include/instance/hmatrix.h | 133 + .../atmel/SAMD51_DFP/1.0.70/include/instance/i2s.h | 81 + .../atmel/SAMD51_DFP/1.0.70/include/instance/icm.h | 77 + .../SAMD51_DFP/1.0.70/include/instance/mclk.h | 61 + .../SAMD51_DFP/1.0.70/include/instance/nvmctrl.h | 75 + .../1.0.70/include/instance/osc32kctrl.h | 59 + .../SAMD51_DFP/1.0.70/include/instance/oscctrl.h | 130 + .../atmel/SAMD51_DFP/1.0.70/include/instance/pac.h | 69 + .../atmel/SAMD51_DFP/1.0.70/include/instance/pcc.h | 58 + .../SAMD51_DFP/1.0.70/include/instance/pdec.h | 80 + .../atmel/SAMD51_DFP/1.0.70/include/instance/pm.h | 59 + .../SAMD51_DFP/1.0.70/include/instance/port.h | 184 + .../SAMD51_DFP/1.0.70/include/instance/pukcc.h | 57 + .../SAMD51_DFP/1.0.70/include/instance/qspi.h | 72 + .../SAMD51_DFP/1.0.70/include/instance/ramecc.h | 54 + .../SAMD51_DFP/1.0.70/include/instance/rstc.h | 48 + .../atmel/SAMD51_DFP/1.0.70/include/instance/rtc.h | 156 + .../SAMD51_DFP/1.0.70/include/instance/sdhc0.h | 147 + .../SAMD51_DFP/1.0.70/include/instance/sdhc1.h | 147 + .../SAMD51_DFP/1.0.70/include/instance/sercom0.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom1.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom2.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom3.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom4.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom5.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom6.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/sercom7.h | 181 + .../SAMD51_DFP/1.0.70/include/instance/supc.h | 64 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tal.h | 541 ++ .../atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h | 109 + .../atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h | 109 + .../SAMD51_DFP/1.0.70/include/instance/tcc0.h | 125 + .../SAMD51_DFP/1.0.70/include/instance/tcc1.h | 115 + .../SAMD51_DFP/1.0.70/include/instance/tcc2.h | 106 + .../SAMD51_DFP/1.0.70/include/instance/tcc3.h | 99 + .../SAMD51_DFP/1.0.70/include/instance/tcc4.h | 99 + .../SAMD51_DFP/1.0.70/include/instance/trng.h | 51 + .../atmel/SAMD51_DFP/1.0.70/include/instance/usb.h | 343 + .../atmel/SAMD51_DFP/1.0.70/include/instance/wdt.h | 55 + .../SAMD51_DFP/1.0.70/include/pio/samd51j18a.h | 1863 +++++ .../packs/atmel/SAMD51_DFP/1.0.70/include/sam.h | 54 + .../packs/atmel/SAMD51_DFP/1.0.70/include/samd51.h | 60 + .../atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h | 1079 +++ .../SAMD51_DFP/1.0.70/include/system_samd51.h | 48 + tmk_core/arm_atsam.mk | 56 + tmk_core/common.mk | 6 + tmk_core/common/arm_atsam/bootloader.c | 19 + tmk_core/common/arm_atsam/eeprom.c | 98 + tmk_core/common/arm_atsam/printf.h | 8 + tmk_core/common/arm_atsam/suspend.c | 17 + tmk_core/common/arm_atsam/timer.c | 59 + tmk_core/common/print.h | 30 +- tmk_core/common/report.h | 5 + tmk_core/protocol/arm_atsam.mk | 26 + tmk_core/protocol/arm_atsam/adc.c | 99 + tmk_core/protocol/arm_atsam/adc.h | 37 + tmk_core/protocol/arm_atsam/arm_atsam_protocol.h | 45 + tmk_core/protocol/arm_atsam/clks.c | 439 ++ tmk_core/protocol/arm_atsam/clks.h | 90 + tmk_core/protocol/arm_atsam/d51_util.c | 165 + tmk_core/protocol/arm_atsam/d51_util.h | 185 + tmk_core/protocol/arm_atsam/i2c_master.c | 585 ++ tmk_core/protocol/arm_atsam/i2c_master.h | 108 + tmk_core/protocol/arm_atsam/issi3733_driver.h | 201 + tmk_core/protocol/arm_atsam/led_matrix.c | 509 ++ tmk_core/protocol/arm_atsam/led_matrix.h | 142 + tmk_core/protocol/arm_atsam/main_arm_atsam.c | 279 + tmk_core/protocol/arm_atsam/main_arm_atsam.h | 23 + tmk_core/protocol/arm_atsam/md_bootloader.h | 18 + tmk_core/protocol/arm_atsam/spi.c | 90 + tmk_core/protocol/arm_atsam/spi.h | 63 + tmk_core/protocol/arm_atsam/startup.c | 548 ++ tmk_core/protocol/arm_atsam/usb/compiler.h | 1177 ++++ tmk_core/protocol/arm_atsam/usb/conf_usb.h | 163 + tmk_core/protocol/arm_atsam/usb/main_usb.c | 118 + tmk_core/protocol/arm_atsam/usb/spfssf.c | 268 + tmk_core/protocol/arm_atsam/usb/spfssf.h | 57 + tmk_core/protocol/arm_atsam/usb/status_codes.h | 158 + tmk_core/protocol/arm_atsam/usb/udc.c | 1164 ++++ tmk_core/protocol/arm_atsam/usb/udc.h | 260 + tmk_core/protocol/arm_atsam/usb/udc_desc.h | 135 + tmk_core/protocol/arm_atsam/usb/udd.h | 396 ++ tmk_core/protocol/arm_atsam/usb/udi.h | 133 + tmk_core/protocol/arm_atsam/usb/udi_cdc.c | 1384 ++++ tmk_core/protocol/arm_atsam/usb/udi_cdc.h | 381 ++ tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h | 72 + tmk_core/protocol/arm_atsam/usb/udi_device_conf.h | 715 ++ .../protocol/arm_atsam/usb/udi_device_epsize.h | 32 + tmk_core/protocol/arm_atsam/usb/udi_hid.c | 162 + tmk_core/protocol/arm_atsam/usb/udi_hid.h | 85 + tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 845 +++ tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h | 109 + tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h | 60 + tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c | 179 + tmk_core/protocol/arm_atsam/usb/ui.c | 106 + tmk_core/protocol/arm_atsam/usb/ui.h | 82 + tmk_core/protocol/arm_atsam/usb/usb.c | 1144 ++++ tmk_core/protocol/arm_atsam/usb/usb.h | 492 ++ tmk_core/protocol/arm_atsam/usb/usb2422.c | 412 ++ tmk_core/protocol/arm_atsam/usb/usb2422.h | 405 ++ tmk_core/protocol/arm_atsam/usb/usb_atmel.h | 190 + tmk_core/protocol/arm_atsam/usb/usb_device_udd.c | 1097 +++ tmk_core/protocol/arm_atsam/usb/usb_main.h | 97 + tmk_core/protocol/arm_atsam/usb/usb_protocol.h | 498 ++ tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h | 193 + tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h | 319 + tmk_core/protocol/arm_atsam/usb/usb_util.c | 59 + tmk_core/protocol/arm_atsam/usb/usb_util.h | 10 + tmk_core/protocol/arm_atsam/wait_api.h | 8 + 194 files changed, 73324 insertions(+), 1 deletion(-) create mode 100644 keyboards/alt67/alt67.h create mode 100644 keyboards/alt67/config.h create mode 100644 keyboards/alt67/config_led.h create mode 100644 keyboards/alt67/keymaps/default/keymap.c create mode 100644 keyboards/alt67/led_programs.c create mode 100644 keyboards/alt67/matrix.c create mode 100644 keyboards/alt67/matrix.h create mode 100644 keyboards/alt67/readme.md create mode 100644 keyboards/alt67/rules.mk create mode 100644 keyboards/ctrl/config.h create mode 100644 keyboards/ctrl/config_led.h create mode 100644 keyboards/ctrl/ctrl.h create mode 100644 keyboards/ctrl/keymaps/default/keymap.c create mode 100644 keyboards/ctrl/led_programs.c create mode 100644 keyboards/ctrl/matrix.c create mode 100644 keyboards/ctrl/matrix.h create mode 100644 keyboards/ctrl/readme.md create mode 100644 keyboards/ctrl/rules.mk create mode 100644 lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/arm_math.h create mode 100644 lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_compiler.h create mode 100644 lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_gcc.h create mode 100644 lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/core_cm4.h create mode 100644 lib/arm_atsam/packs/arm/cmsis/5.0.1/LICENSE.txt create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component-version.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/aes.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/can.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ccl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/cmcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dmac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dsu.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/eic.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/evsys.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/freqm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/gclk.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/hmatrixb.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/i2s.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/icm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/mclk.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/nvmctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/osc32kctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/oscctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/pac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/pcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/pdec.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/pm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/port.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/qspi.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ramecc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/rstc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/rtc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sdhc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/sercom.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/supc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tal.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/tcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/trng.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/usb.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/wdt.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/ac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/adc1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/aes.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/can0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/can1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/ccl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/cmcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/dac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/dmac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/dsu.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/eic.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/evsys.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/freqm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/gclk.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/hmatrix.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/i2s.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/icm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/mclk.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/nvmctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/osc32kctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/oscctrl.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/pac.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/pcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/pdec.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/pm.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/port.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/pukcc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/qspi.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/ramecc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/rstc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/rtc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sdhc0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sdhc1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom2.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom3.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom4.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom5.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom6.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/sercom7.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/supc.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tal.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc2.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc3.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc4.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc5.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc6.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tc7.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc0.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc1.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc2.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc3.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/tcc4.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/trng.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/usb.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/wdt.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/pio/samd51j18a.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/sam.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h create mode 100644 lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/system_samd51.h create mode 100644 tmk_core/arm_atsam.mk create mode 100644 tmk_core/common/arm_atsam/bootloader.c create mode 100644 tmk_core/common/arm_atsam/eeprom.c create mode 100644 tmk_core/common/arm_atsam/printf.h create mode 100644 tmk_core/common/arm_atsam/suspend.c create mode 100644 tmk_core/common/arm_atsam/timer.c create mode 100644 tmk_core/protocol/arm_atsam.mk create mode 100644 tmk_core/protocol/arm_atsam/adc.c create mode 100644 tmk_core/protocol/arm_atsam/adc.h create mode 100644 tmk_core/protocol/arm_atsam/arm_atsam_protocol.h create mode 100644 tmk_core/protocol/arm_atsam/clks.c create mode 100644 tmk_core/protocol/arm_atsam/clks.h create mode 100644 tmk_core/protocol/arm_atsam/d51_util.c create mode 100644 tmk_core/protocol/arm_atsam/d51_util.h create mode 100644 tmk_core/protocol/arm_atsam/i2c_master.c create mode 100644 tmk_core/protocol/arm_atsam/i2c_master.h create mode 100644 tmk_core/protocol/arm_atsam/issi3733_driver.h create mode 100644 tmk_core/protocol/arm_atsam/led_matrix.c create mode 100644 tmk_core/protocol/arm_atsam/led_matrix.h create mode 100644 tmk_core/protocol/arm_atsam/main_arm_atsam.c create mode 100644 tmk_core/protocol/arm_atsam/main_arm_atsam.h create mode 100644 tmk_core/protocol/arm_atsam/md_bootloader.h create mode 100644 tmk_core/protocol/arm_atsam/spi.c create mode 100644 tmk_core/protocol/arm_atsam/spi.h create mode 100644 tmk_core/protocol/arm_atsam/startup.c create mode 100644 tmk_core/protocol/arm_atsam/usb/compiler.h create mode 100644 tmk_core/protocol/arm_atsam/usb/conf_usb.h create mode 100644 tmk_core/protocol/arm_atsam/usb/main_usb.c create mode 100644 tmk_core/protocol/arm_atsam/usb/spfssf.c create mode 100644 tmk_core/protocol/arm_atsam/usb/spfssf.h create mode 100644 tmk_core/protocol/arm_atsam/usb/status_codes.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udc.c create mode 100644 tmk_core/protocol/arm_atsam/usb/udc.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udc_desc.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udd.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_cdc.c create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_cdc.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_device_conf.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid.c create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h create mode 100644 tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c create mode 100644 tmk_core/protocol/arm_atsam/usb/ui.c create mode 100644 tmk_core/protocol/arm_atsam/usb/ui.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb.c create mode 100644 tmk_core/protocol/arm_atsam/usb/usb.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb2422.c create mode 100644 tmk_core/protocol/arm_atsam/usb/usb2422.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_atmel.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_device_udd.c create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_main.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_protocol.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_util.c create mode 100644 tmk_core/protocol/arm_atsam/usb/usb_util.h create mode 100644 tmk_core/protocol/arm_atsam/wait_api.h diff --git a/build_keyboard.mk b/build_keyboard.mk index 9f6c42ea15..a73741bb3e 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -144,6 +144,9 @@ endif ifdef MCU_FAMILY FIRMWARE_FORMAT?=bin PLATFORM=CHIBIOS +else ifdef ARM_ATSAM + PLATFORM=ARM_ATSAM + FIRMWARE_FORMAT=bin else PLATFORM=AVR FIRMWARE_FORMAT?=hex @@ -286,6 +289,11 @@ endif include $(TMK_PATH)/avr.mk endif +ifeq ($(PLATFORM),ARM_ATSAM) + include $(TMK_PATH)/arm_atsam.mk + include $(TMK_PATH)/protocol/arm_atsam.mk +endif + ifeq ($(PLATFORM),CHIBIOS) include $(TMK_PATH)/protocol/chibios.mk endif diff --git a/keyboards/alt67/alt67.h b/keyboards/alt67/alt67.h new file mode 100644 index 0000000000..387985512b --- /dev/null +++ b/keyboards/alt67/alt67.h @@ -0,0 +1,24 @@ +#pragma once + +#include "quantum.h" +#include "config_led.h" +#include "matrix.h" + +#include "i2c_master.h" +#include "led_matrix.h" //For led keycodes +#include "usb/udi_cdc.h" +#include "usb/usb2422.h" + +#define LAYOUT( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ + K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ + K61, K62, K63, K64, K65, K66, K67 \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, }, \ + { K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, }, \ + { K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, KC_NO, K43, K44, }, \ + { K45, KC_NO, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, }, \ + { K59, K60, K61, KC_NO, KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K63, K64, K65, K66, K67, }, \ +} diff --git a/keyboards/alt67/config.h b/keyboards/alt67/config.h new file mode 100644 index 0000000000..c67ae7d432 --- /dev/null +++ b/keyboards/alt67/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2015 Jun Wako + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEED3 +#define DEVICE_VER 0x0101 + +#define MANUFACTURER "Massdrop Inc." +#define PRODUCT "ALT67 Keyboard" +#define SERIAL_NUM "Unavailable" + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define PA 0 +#define PB 1 + +#define MATRIX_ROW_PORTS PA, PA, PA, PA, PA +#define MATRIX_ROW_PINS 0, 1, 2, 3, 4 + +#define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA +#define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 + +/* Print boot debug codes using debug LED when M28 and M30 shorted */ +#define DEBUG_BOOT_TRACING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Force boot in NKRO mode */ +//#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/alt67/config_led.h b/keyboards/alt67/config_led.h new file mode 100644 index 0000000000..a049e38179 --- /dev/null +++ b/keyboards/alt67/config_led.h @@ -0,0 +1,178 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _config_led_h_ +#define _config_led_h_ + +//Define number of ISSI3733 drivers being used (1...16) +#define ISSI3733_DRIVER_COUNT 2 + +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } + +//LED I2C bus speed +#define I2C_HZ 580000 + +//Count of LED bodies +#define ISSI3733_LED_COUNT 105 + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT 128 + +#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus +#define LED_GCR_STEP 10 //GCR increment/decrement value + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) + +#define ANIMATION_SPEED_STEP 1 + +#define BREATHE_MIN_STEP 0 +#define BREATHE_MAX_STEP 255 + +//LED Mapping - More practically generated from a spreadsheet program +//id: ID of the LED (Sync with PCB callouts) +//x: Physical X coordinate of LED (units do not matter) +//y: Physical Y coordinate of LED (units do not matter) +//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES +//cs: Matrix wiring CS col (1-16) +//swr: Matrix wiring SW Red row (1-12) +//swg: Matrix wiring SW Green row (1-12) +//swb: Matrix wiring SW Blue row (1-12) +//scan: Associated key scancode if any +//Note: Origin 0,0 may be located anywhere as the software will do the final layout +#define ISSI3733_LED_MAP { \ + { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ + { .id = 2, .x = 0.75, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ + { .id = 3, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ + { .id = 4, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ + { .id = 5, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 4 }, \ + { .id = 6, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ + { .id = 7, .x = 4.5, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ + { .id = 8, .x = 5.25, .y = 0, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \ + { .id = 9, .x = 6, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 8 }, \ + { .id = 10, .x = 6.75, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 9 }, \ + { .id = 11, .x = 7.5, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 10 }, \ + { .id = 12, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 11 }, \ + { .id = 13, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \ + { .id = 14, .x = 10.125, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 13 }, \ + { .id = 15, .x = 11.25, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 14 }, \ + { .id = 16, .x = 0.188, .y = -0.75, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 15 }, \ + { .id = 17, .x = 1.125, .y = -0.75, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ + { .id = 18, .x = 1.875, .y = -0.75, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ + { .id = 19, .x = 2.625, .y = -0.75, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ + { .id = 20, .x = 3.375, .y = -0.75, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ + { .id = 21, .x = 4.125, .y = -0.75, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ + { .id = 22, .x = 4.875, .y = -0.75, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ + { .id = 23, .x = 5.625, .y = -0.75, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ + { .id = 24, .x = 6.375, .y = -0.75, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \ + { .id = 25, .x = 7.125, .y = -0.75, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \ + { .id = 26, .x = 7.875, .y = -0.75, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \ + { .id = 27, .x = 8.625, .y = -0.75, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 26 }, \ + { .id = 28, .x = 9.375, .y = -0.75, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ + { .id = 29, .x = 10.313, .y = -0.75, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 28 }, \ + { .id = 30, .x = 11.25, .y = -0.75, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ + { .id = 31, .x = 0.281, .y = -1.5, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 30 }, \ + { .id = 32, .x = 1.313, .y = -1.5, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 33, .x = 2.063, .y = -1.5, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ + { .id = 34, .x = 2.813, .y = -1.5, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ + { .id = 35, .x = 3.563, .y = -1.5, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ + { .id = 36, .x = 4.313, .y = -1.5, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ + { .id = 37, .x = 5.063, .y = -1.5, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ + { .id = 38, .x = 5.813, .y = -1.5, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ + { .id = 39, .x = 6.563, .y = -1.5, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \ + { .id = 40, .x = 7.313, .y = -1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \ + { .id = 41, .x = 8.063, .y = -1.5, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ + { .id = 42, .x = 8.813, .y = -1.5, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 41 }, \ + { .id = 43, .x = 10.031, .y = -1.5, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 43 }, \ + { .id = 44, .x = 11.25, .y = -1.5, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 44 }, \ + { .id = 45, .x = 0.469, .y = -2.25, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \ + { .id = 46, .x = 1.688, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ + { .id = 47, .x = 2.438, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 48 }, \ + { .id = 48, .x = 3.188, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ + { .id = 49, .x = 3.938, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \ + { .id = 50, .x = 4.688, .y = -2.25, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ + { .id = 51, .x = 5.438, .y = -2.25, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ + { .id = 52, .x = 6.188, .y = -2.25, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \ + { .id = 53, .x = 6.938, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 54 }, \ + { .id = 54, .x = 7.688, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 55 }, \ + { .id = 55, .x = 8.438, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ + { .id = 56, .x = 9.469, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \ + { .id = 57, .x = 10.5, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \ + { .id = 58, .x = 11.25, .y = -2.25, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 59 }, \ + { .id = 59, .x = 0.094, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ + { .id = 60, .x = 1.031, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ + { .id = 61, .x = 1.969, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \ + { .id = 62, .x = 4.781, .y = -3, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 66 }, \ + { .id = 63, .x = 7.594, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 70 }, \ + { .id = 64, .x = 8.531, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 71 }, \ + { .id = 65, .x = 9.75, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 72 }, \ + { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ + { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ + { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ +}; + + +#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality +#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) + #define USB_LED_NUM_LOCK_SCANCODE 255 + #define USB_LED_CAPS_LOCK_SCANCODE 30 + #define USB_LED_SCROLL_LOCK_SCANCODE 255 + #define USB_LED_COMPOSE_SCANCODE 255 + #define USB_LED_KANA_SCANCODE 255 +#endif //USB_LED_INDICATOR_ENABLE + +#endif //_config_led_h_ diff --git a/keyboards/alt67/keymaps/default/keymap.c b/keyboards/alt67/keymaps/default/keymap.c new file mode 100644 index 0000000000..8b77da55a6 --- /dev/null +++ b/keyboards/alt67/keymaps/default/keymap.c @@ -0,0 +1,200 @@ +#include QMK_KEYBOARD_H + +enum alt67_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_TRNS, 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_TRNS, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} \ No newline at end of file diff --git a/keyboards/alt67/led_programs.c b/keyboards/alt67/led_programs.c new file mode 100644 index 0000000000..a8aab28d98 --- /dev/null +++ b/keyboards/alt67/led_programs.c @@ -0,0 +1,120 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt67.h" +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/alt67/matrix.c b/keyboards/alt67/matrix.c new file mode 100644 index 0000000000..e107b4c22c --- /dev/null +++ b/keyboards/alt67/matrix.c @@ -0,0 +1,182 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt67.h" + +#include "d51_util.h" +#include "debug.h" +#include "clks.h" +#include + +matrix_row_t mlatest[MATRIX_ROWS]; +matrix_row_t mlast[MATRIX_ROWS]; +matrix_row_t mdebounced[MATRIX_ROWS]; + +uint8_t row_ports[] = { MATRIX_ROW_PORTS }; +uint8_t row_pins[] = { MATRIX_ROW_PINS }; +uint8_t col_ports[] = { MATRIX_COL_PORTS }; +uint8_t col_pins[] = { MATRIX_COL_PINS }; +uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate + +__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) { +} + +void matrix_init(void) +{ + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + row_masks[PA] = 0; + row_masks[PB] = 0; + + uint8_t row; + for (row = 0; row < MATRIX_ROWS; row++) + { + PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input + PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable + row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask + } + + uint8_t col; + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low + } + + matrix_init_quantum(); +} + +#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) + +uint64_t mdebouncing = 0; +uint8_t matrix_scan(void) +{ + uint8_t mchanged; + uint8_t row; + uint8_t col; + uint32_t scans[2]; //PA PB + + if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active + + //m15_off; //Profiling scans + + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer + + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output + + CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + + scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data + scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data + + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output + + for (row = 0; row < MATRIX_ROWS; row++) + { + //Move scan bits from scans array into proper row bit locations + if (scans[row_ports[row]] & (1 << row_pins[row])) + mlatest[row] |= 1 << col; + } + } + + mchanged = 0; //Default to no matrix change since last + + for (row = 0; row < MATRIX_ROWS; row++) + { + if (mlast[row] != mlatest[row]) + mchanged = 1; + mlast[row] = mlatest[row]; + } + + if (!mchanged) + { + for (row = 0; row < MATRIX_ROWS; row++) + mdebounced[row] = mlatest[row]; + mdebouncing = 0; + } + else + { + //Begin or extend debounce on change + mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + } + + //m15_on; //Profiling scans + + matrix_scan_quantum(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return mdebounced[row]; +} + +void matrix_print(void) +{ + char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; + char *pbuf = buf+3; + uint32_t cols; + uint32_t rows; + matrix_row_t row; + + for (cols = 1; cols <= MATRIX_COLS; cols++) + { + *pbuf = (cols%10)+48; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + + for (rows = 1; rows <= MATRIX_ROWS; rows++) + { + row = matrix_get_row(rows-1); + if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } + else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } + for (cols = 0; cols < MATRIX_COLS; cols++) + { + if (row & 1 << cols) *pbuf = 'X'; + else *pbuf = '.'; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + } + *pbuf = 0; + dprint(buf); +} diff --git a/keyboards/alt67/matrix.h b/keyboards/alt67/matrix.h new file mode 100644 index 0000000000..3eab6dece1 --- /dev/null +++ b/keyboards/alt67/matrix.h @@ -0,0 +1,77 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ +#ifndef MATRIX_H +#define MATRIX_H + +#include +#include +#include "keyboard.h" + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEED2 +#define DEVICE_VER 0x0101 + +#define MANUFACTURER "Massdrop Inc." +#define PRODUCT "CTRL Keyboard" +#define SERIAL_NUM "Unavailable" + +/* key matrix size */ +#define MATRIX_ROWS 11 +#define MATRIX_COLS 8 + +#define PA 0 +#define PB 1 + +#define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB +#define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12 + +#define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA +#define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7 + +/* Print boot debug codes using debug LED when M28 and M30 shorted */ +#define DEBUG_BOOT_TRACING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Force boot in NKRO mode */ +//#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/ctrl/config_led.h b/keyboards/ctrl/config_led.h new file mode 100644 index 0000000000..65563daa3d --- /dev/null +++ b/keyboards/ctrl/config_led.h @@ -0,0 +1,191 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _config_led_h_ +#define _config_led_h_ + +//Define number of ISSI3733 drivers being used (1...16) +#define ISSI3733_DRIVER_COUNT 2 + +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } + +//LED I2C bus speed +#define I2C_HZ 580000 + +//Count of LED bodies +#define ISSI3733_LED_COUNT 119 + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT 128 + +#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus +#define LED_GCR_STEP 10 //GCR increment/decrement value + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) + +#define ANIMATION_SPEED_STEP 1 + +#define BREATHE_MIN_STEP 0 +#define BREATHE_MAX_STEP 255 + +//LED Mapping - More practically generated from a spreadsheet program +//id: ID of the LED (Sync with PCB callouts) +//x: Physical X coordinate of LED (units do not matter) +//y: Physical Y coordinate of LED (units do not matter) +//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES +//cs: Matrix wiring CS col (1-16) +//swr: Matrix wiring SW Red row (1-12) +//swg: Matrix wiring SW Green row (1-12) +//swb: Matrix wiring SW Blue row (1-12) +//scan: Associated key scancode if any +//Note: Origin 0,0 may be located anywhere as the software will do the final layout +#define ISSI3733_LED_MAP { \ + { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ + { .id = 2, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ + { .id = 3, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ + { .id = 4, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ + { .id = 5, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 4 }, \ + { .id = 6, .x = 4.875, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ + { .id = 7, .x = 5.625, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ + { .id = 8, .x = 6.375, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 7 }, \ + { .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 90 }, \ + { .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 91 }, \ + { .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 92 }, \ + { .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 93 }, \ + { .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 94 }, \ + { .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 95 }, \ + { .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 96 }, \ + { .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 97 }, \ + { .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \ + { .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ + { .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ + { .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ + { .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ + { .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ + { .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ + { .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ + { .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 105 }, \ + { .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 106 }, \ + { .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 107 }, \ + { .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 108 }, \ + { .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 109 }, \ + { .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 110 }, \ + { .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 111 }, \ + { .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 112 }, \ + { .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 142 }, \ + { .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \ + { .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ + { .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ + { .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ + { .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ + { .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ + { .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ + { .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 120 }, \ + { .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 121 }, \ + { .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 122 }, \ + { .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 123 }, \ + { .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 124 }, \ + { .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 125 }, \ + { .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 126 }, \ + { .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 127 }, \ + { .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 141 }, \ + { .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \ + { .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \ + { .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 47 }, \ + { .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \ + { .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ + { .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \ + { .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ + { .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ + { .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 135 }, \ + { .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 136 }, \ + { .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 137 }, \ + { .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 138 }, \ + { .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 139 }, \ + { .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 60 }, \ + { .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ + { .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \ + { .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 63 }, \ + { .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 64 }, \ + { .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 65 }, \ + { .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 66 }, \ + { .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 67 }, \ + { .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 150 }, \ + { .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 151 }, \ + { .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 152 }, \ + { .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 153 }, \ + { .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 140 }, \ + { .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \ + { .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 76 }, \ + { .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \ + { .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 78 }, \ + { .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 79 }, \ + { .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 80 }, \ + { .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 81 }, \ + { .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 82 }, \ + { .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 154 }, \ + { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 155 }, \ + { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 156 }, \ + { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 92, .x = 8.85, .y = -4.535, .adr = { .drv = 1, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 94, .x = 6.56, .y = -4.535, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 96, .x = 4.27, .y = -4.535, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 98, .x = 1.98, .y = -4.535, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 100, .x = -0.307, .y = -4.43, .adr = { .drv = 2, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 102, .x = -0.41, .y = -2.06, .adr = { .drv = 2, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 104, .x = -0.308, .y = 0.31, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 106, .x = 1.98, .y = 0.415, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 108, .x = 4.27, .y = 0.415, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 110, .x = 6.56, .y = 0.415, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 112, .x = 8.85, .y = 0.415, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 114, .x = 11.14, .y = 0.415, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 116, .x = 13.432, .y = 0.31, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 118, .x = 13.535, .y = -2.06, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ +}; + +#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality +#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) + #define USB_LED_NUM_LOCK_SCANCODE 255 + #define USB_LED_CAPS_LOCK_SCANCODE 45 + #define USB_LED_SCROLL_LOCK_SCANCODE 96 + #define USB_LED_COMPOSE_SCANCODE 255 + #define USB_LED_KANA_SCANCODE 255 +#endif //USB_LED_INDICATOR_ENABLE + +#endif //_config_led_h_ diff --git a/keyboards/ctrl/ctrl.h b/keyboards/ctrl/ctrl.h new file mode 100644 index 0000000000..dc7c7eabe5 --- /dev/null +++ b/keyboards/ctrl/ctrl.h @@ -0,0 +1,32 @@ +#pragma once + +#include "quantum.h" +#include "config_led.h" +#include "matrix.h" + +#include "i2c_master.h" +#include "led_matrix.h" //For led keycodes +#include "usb/udi_cdc.h" +#include "usb/usb2422.h" + +#define LAYOUT( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ + K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ + K61, K62, K63, K64, K65, K66, K67, K68, K69, K70, K71, K72, K73, K74, K75, \ + K76, K77, K78, K79, K80, K81, K82, K83, K84, K85, K86, K87 \ + \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K17, K18, K19, K20, K21, K22, K23, K24 }, \ + { K34, K35, K36, K37, K38, K39, K40, K41 }, \ + { K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K64, K65, K66, K67, K68, K69, K70, K71 }, \ + { K77, K78, K79, K80, K81, K82, K83, K84 }, \ + { K09, K10, K11, K12, K13, K14, K15, K16 }, \ + { K25, K26, K27, K28, K29, K30, K31, K32 }, \ + { K42, K43, K44, K45, K46, K47, K48, K49 }, \ + { K59, K60, K61, K62, K63, K76, K50, K33 }, \ + { K72, K73, K74, K75, K85, K86, K87, }, \ +} diff --git a/keyboards/ctrl/keymaps/default/keymap.c b/keyboards/ctrl/keymaps/default/keymap.c new file mode 100644 index 0000000000..8e84d4fee5 --- /dev/null +++ b/keyboards/ctrl/keymaps/default/keymap.c @@ -0,0 +1,203 @@ +#include QMK_KEYBOARD_H + +enum alt67_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +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_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_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, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} \ No newline at end of file diff --git a/keyboards/ctrl/led_programs.c b/keyboards/ctrl/led_programs.c new file mode 100644 index 0000000000..ca27016454 --- /dev/null +++ b/keyboards/ctrl/led_programs.c @@ -0,0 +1,120 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "ctrl.h" +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/ctrl/matrix.c b/keyboards/ctrl/matrix.c new file mode 100644 index 0000000000..6f306962e6 --- /dev/null +++ b/keyboards/ctrl/matrix.c @@ -0,0 +1,182 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "ctrl.h" + +#include "d51_util.h" +#include "debug.h" +#include "clks.h" +#include + +matrix_row_t mlatest[MATRIX_ROWS]; +matrix_row_t mlast[MATRIX_ROWS]; +matrix_row_t mdebounced[MATRIX_ROWS]; + +uint8_t row_ports[] = { MATRIX_ROW_PORTS }; +uint8_t row_pins[] = { MATRIX_ROW_PINS }; +uint8_t col_ports[] = { MATRIX_COL_PORTS }; +uint8_t col_pins[] = { MATRIX_COL_PINS }; +uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate + +__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) { +} + +void matrix_init(void) +{ + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + row_masks[PA] = 0; + row_masks[PB] = 0; + + uint8_t row; + for (row = 0; row < MATRIX_ROWS; row++) + { + PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input + PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable + row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask + } + + uint8_t col; + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low + } + + matrix_init_quantum(); +} + +#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) + +uint64_t mdebouncing = 0; +uint8_t matrix_scan(void) +{ + uint8_t mchanged; + uint8_t row; + uint8_t col; + uint32_t scans[2]; //PA PB + + if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active + + //m15_off; //Profiling scans + + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer + + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output + + CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + + scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data + scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data + + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output + + for (row = 0; row < MATRIX_ROWS; row++) + { + //Move scan bits from scans array into proper row bit locations + if (scans[row_ports[row]] & (1 << row_pins[row])) + mlatest[row] |= 1 << col; + } + } + + mchanged = 0; //Default to no matrix change since last + + for (row = 0; row < MATRIX_ROWS; row++) + { + if (mlast[row] != mlatest[row]) + mchanged = 1; + mlast[row] = mlatest[row]; + } + + if (!mchanged) + { + for (row = 0; row < MATRIX_ROWS; row++) + mdebounced[row] = mlatest[row]; + mdebouncing = 0; + } + else + { + //Begin or extend debounce on change + mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + } + + //m15_on; //Profiling scans + + matrix_scan_quantum(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return mdebounced[row]; +} + +void matrix_print(void) +{ + char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; + char *pbuf = buf+3; + uint32_t cols; + uint32_t rows; + matrix_row_t row; + + for (cols = 1; cols <= MATRIX_COLS; cols++) + { + *pbuf = (cols%10)+48; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + + for (rows = 1; rows <= MATRIX_ROWS; rows++) + { + row = matrix_get_row(rows-1); + if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } + else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } + for (cols = 0; cols < MATRIX_COLS; cols++) + { + if (row & 1 << cols) *pbuf = 'X'; + else *pbuf = '.'; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + } + *pbuf = 0; + dprint(buf); +} diff --git a/keyboards/ctrl/matrix.h b/keyboards/ctrl/matrix.h new file mode 100644 index 0000000000..3eab6dece1 --- /dev/null +++ b/keyboards/ctrl/matrix.h @@ -0,0 +1,77 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ +#ifndef MATRIX_H +#define MATRIX_H + +#include +#include +#include "keyboard.h" + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<Lib folder. + * - arm_cortexM7lfdp_math.lib (Cortex-M7, Little endian, Double Precision Floating Point Unit) + * - arm_cortexM7bfdp_math.lib (Cortex-M7, Big endian, Double Precision Floating Point Unit) + * - arm_cortexM7lfsp_math.lib (Cortex-M7, Little endian, Single Precision Floating Point Unit) + * - arm_cortexM7bfsp_math.lib (Cortex-M7, Big endian and Single Precision Floating Point Unit on) + * - arm_cortexM7l_math.lib (Cortex-M7, Little endian) + * - arm_cortexM7b_math.lib (Cortex-M7, Big endian) + * - arm_cortexM4lf_math.lib (Cortex-M4, Little endian, Floating Point Unit) + * - arm_cortexM4bf_math.lib (Cortex-M4, Big endian, Floating Point Unit) + * - arm_cortexM4l_math.lib (Cortex-M4, Little endian) + * - arm_cortexM4b_math.lib (Cortex-M4, Big endian) + * - arm_cortexM3l_math.lib (Cortex-M3, Little endian) + * - arm_cortexM3b_math.lib (Cortex-M3, Big endian) + * - arm_cortexM0l_math.lib (Cortex-M0 / Cortex-M0+, Little endian) + * - arm_cortexM0b_math.lib (Cortex-M0 / Cortex-M0+, Big endian) + * - arm_ARMv8MBLl_math.lib (ARMv8M Baseline, Little endian) + * - arm_ARMv8MMLl_math.lib (ARMv8M Mainline, Little endian) + * - arm_ARMv8MMLlfsp_math.lib (ARMv8M Mainline, Little endian, Single Precision Floating Point Unit) + * - arm_ARMv8MMLld_math.lib (ARMv8M Mainline, Little endian, DSP instructions) + * - arm_ARMv8MMLldfsp_math.lib (ARMv8M Mainline, Little endian, DSP instructions, Single Precision Floating Point Unit) + * + * The library functions are declared in the public file arm_math.h which is placed in the Include folder. + * Simply include this file and link the appropriate library in the application and begin calling the library functions. The Library supports single + * public header file arm_math.h for Cortex-M cores with little endian and big endian. Same header file will be used for floating point unit(FPU) variants. + * Define the appropriate pre processor MACRO ARM_MATH_CM7 or ARM_MATH_CM4 or ARM_MATH_CM3 or + * ARM_MATH_CM0 or ARM_MATH_CM0PLUS depending on the target processor in the application. + * For ARMv8M cores define pre processor MACRO ARM_MATH_ARMV8MBL or ARM_MATH_ARMV8MML. + * Set Pre processor MACRO __DSP_PRESENT if ARMv8M Mainline core supports DSP instructions. + * + * + * Examples + * -------- + * + * The library ships with a number of examples which demonstrate how to use the library functions. + * + * Toolchain Support + * ------------ + * + * The library has been developed and tested with MDK-ARM version 5.14.0.0 + * The library is being tested in GCC and IAR toolchains and updates on this activity will be made available shortly. + * + * Building the Library + * ------------ + * + * The library installer contains a project file to re build libraries on MDK-ARM Tool chain in the CMSIS\\DSP_Lib\\Source\\ARM folder. + * - arm_cortexM_math.uvprojx + * + * + * The libraries can be built by opening the arm_cortexM_math.uvprojx project in MDK-ARM, selecting a specific target, and defining the optional pre processor MACROs detailed above. + * + * Pre-processor Macros + * ------------ + * + * Each library project have differant pre-processor macros. + * + * - UNALIGNED_SUPPORT_DISABLE: + * + * Define macro UNALIGNED_SUPPORT_DISABLE, If the silicon does not support unaligned memory access + * + * - ARM_MATH_BIG_ENDIAN: + * + * Define macro ARM_MATH_BIG_ENDIAN to build the library for big endian targets. By default library builds for little endian targets. + * + * - ARM_MATH_MATRIX_CHECK: + * + * Define macro ARM_MATH_MATRIX_CHECK for checking on the input and output sizes of matrices + * + * - ARM_MATH_ROUNDING: + * + * Define macro ARM_MATH_ROUNDING for rounding on support functions + * + * - ARM_MATH_CMx: + * + * Define macro ARM_MATH_CM4 for building the library on Cortex-M4 target, ARM_MATH_CM3 for building library on Cortex-M3 target + * and ARM_MATH_CM0 for building library on Cortex-M0 target, ARM_MATH_CM0PLUS for building library on Cortex-M0+ target, and + * ARM_MATH_CM7 for building the library on cortex-M7. + * + * - ARM_MATH_ARMV8MxL: + * + * Define macro ARM_MATH_ARMV8MBL for building the library on ARMv8M Baseline target, ARM_MATH_ARMV8MBL for building library + * on ARMv8M Mainline target. + * + * - __FPU_PRESENT: + * + * Initialize macro __FPU_PRESENT = 1 when building on FPU supported Targets. Enable this macro for floating point libraries. + * + * - __DSP_PRESENT: + * + * Initialize macro __DSP_PRESENT = 1 when ARMv8M Mainline core supports DSP instructions. + * + *
+ * CMSIS-DSP in ARM::CMSIS Pack + * ----------------------------- + * + * The following files relevant to CMSIS-DSP are present in the ARM::CMSIS Pack directories: + * |File/Folder |Content | + * |------------------------------|------------------------------------------------------------------------| + * |\b CMSIS\\Documentation\\DSP | This documentation | + * |\b CMSIS\\DSP_Lib | Software license agreement (license.txt) | + * |\b CMSIS\\DSP_Lib\\Examples | Example projects demonstrating the usage of the library functions | + * |\b CMSIS\\DSP_Lib\\Source | Source files for rebuilding the library | + * + *
+ * Revision History of CMSIS-DSP + * ------------ + * Please refer to \ref ChangeLog_pg. + * + * Copyright Notice + * ------------ + * + * Copyright (C) 2010-2015 ARM Limited. All rights reserved. + */ + + +/** + * @defgroup groupMath Basic Math Functions + */ + +/** + * @defgroup groupFastMath Fast Math Functions + * This set of functions provides a fast approximation to sine, cosine, and square root. + * As compared to most of the other functions in the CMSIS math library, the fast math functions + * operate on individual values and not arrays. + * There are separate functions for Q15, Q31, and floating-point data. + * + */ + +/** + * @defgroup groupCmplxMath Complex Math Functions + * This set of functions operates on complex data vectors. + * The data in the complex arrays is stored in an interleaved fashion + * (real, imag, real, imag, ...). + * In the API functions, the number of samples in a complex array refers + * to the number of complex values; the array contains twice this number of + * real values. + */ + +/** + * @defgroup groupFilters Filtering Functions + */ + +/** + * @defgroup groupMatrix Matrix Functions + * + * This set of functions provides basic matrix math operations. + * The functions operate on matrix data structures. For example, + * the type + * definition for the floating-point matrix structure is shown + * below: + *
+ *     typedef struct
+ *     {
+ *       uint16_t numRows;     // number of rows of the matrix.
+ *       uint16_t numCols;     // number of columns of the matrix.
+ *       float32_t *pData;     // points to the data of the matrix.
+ *     } arm_matrix_instance_f32;
+ * 
+ * There are similar definitions for Q15 and Q31 data types. + * + * The structure specifies the size of the matrix and then points to + * an array of data. The array is of size numRows X numCols + * and the values are arranged in row order. That is, the + * matrix element (i, j) is stored at: + *
+ *     pData[i*numCols + j]
+ * 
+ * + * \par Init Functions + * There is an associated initialization function for each type of matrix + * data structure. + * The initialization function sets the values of the internal structure fields. + * Refer to the function arm_mat_init_f32(), arm_mat_init_q31() + * and arm_mat_init_q15() for floating-point, Q31 and Q15 types, respectively. + * + * \par + * Use of the initialization function is optional. However, if initialization function is used + * then the instance structure cannot be placed into a const data section. + * To place the instance structure in a const data + * section, manually initialize the data structure. For example: + *
+ * arm_matrix_instance_f32 S = {nRows, nColumns, pData};
+ * arm_matrix_instance_q31 S = {nRows, nColumns, pData};
+ * arm_matrix_instance_q15 S = {nRows, nColumns, pData};
+ * 
+ * where nRows specifies the number of rows, nColumns + * specifies the number of columns, and pData points to the + * data array. + * + * \par Size Checking + * By default all of the matrix functions perform size checking on the input and + * output matrices. For example, the matrix addition function verifies that the + * two input matrices and the output matrix all have the same number of rows and + * columns. If the size check fails the functions return: + *
+ *     ARM_MATH_SIZE_MISMATCH
+ * 
+ * Otherwise the functions return + *
+ *     ARM_MATH_SUCCESS
+ * 
+ * There is some overhead associated with this matrix size checking. + * The matrix size checking is enabled via the \#define + *
+ *     ARM_MATH_MATRIX_CHECK
+ * 
+ * within the library project settings. By default this macro is defined + * and size checking is enabled. By changing the project settings and + * undefining this macro size checking is eliminated and the functions + * run a bit faster. With size checking disabled the functions always + * return ARM_MATH_SUCCESS. + */ + +/** + * @defgroup groupTransforms Transform Functions + */ + +/** + * @defgroup groupController Controller Functions + */ + +/** + * @defgroup groupStats Statistics Functions + */ +/** + * @defgroup groupSupport Support Functions + */ + +/** + * @defgroup groupInterpolation Interpolation Functions + * These functions perform 1- and 2-dimensional interpolation of data. + * Linear interpolation is used for 1-dimensional data and + * bilinear interpolation is used for 2-dimensional data. + */ + +/** + * @defgroup groupExamples Examples + */ +#ifndef _ARM_MATH_H +#define _ARM_MATH_H + +/* ignore some GCC warnings */ +#if defined ( __GNUC__ ) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" +#endif + +#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ + +#if defined(ARM_MATH_CM7) + #include "core_cm7.h" + #define ARM_MATH_DSP +#elif defined (ARM_MATH_CM4) + #include "core_cm4.h" + #define ARM_MATH_DSP +#elif defined (ARM_MATH_CM3) + #include "core_cm3.h" +#elif defined (ARM_MATH_CM0) + #include "core_cm0.h" + #define ARM_MATH_CM0_FAMILY +#elif defined (ARM_MATH_CM0PLUS) + #include "core_cm0plus.h" + #define ARM_MATH_CM0_FAMILY +#elif defined (ARM_MATH_ARMV8MBL) + #include "core_armv8mbl.h" + #define ARM_MATH_CM0_FAMILY +#elif defined (ARM_MATH_ARMV8MML) + #include "core_armv8mml.h" + #if (defined (__DSP_PRESENT) && (__DSP_PRESENT == 1)) + #define ARM_MATH_DSP + #endif +#else + #error "Define according the used Cortex core ARM_MATH_CM7, ARM_MATH_CM4, ARM_MATH_CM3, ARM_MATH_CM0PLUS, ARM_MATH_CM0, ARM_MATH_ARMV8MBL, ARM_MATH_ARMV8MML" +#endif + +#undef __CMSIS_GENERIC /* enable NVIC and Systick functions */ +#include "string.h" +#include "math.h" +#ifdef __cplusplus +extern "C" +{ +#endif + + + /** + * @brief Macros required for reciprocal calculation in Normalized LMS + */ + +#define DELTA_Q31 (0x100) +#define DELTA_Q15 0x5 +#define INDEX_MASK 0x0000003F +#ifndef PI + #define PI 3.14159265358979f +#endif + + /** + * @brief Macros required for SINE and COSINE Fast math approximations + */ + +#define FAST_MATH_TABLE_SIZE 512 +#define FAST_MATH_Q31_SHIFT (32 - 10) +#define FAST_MATH_Q15_SHIFT (16 - 10) +#define CONTROLLER_Q31_SHIFT (32 - 9) +#define TABLE_SPACING_Q31 0x400000 +#define TABLE_SPACING_Q15 0x80 + + /** + * @brief Macros required for SINE and COSINE Controller functions + */ + /* 1.31(q31) Fixed value of 2/360 */ + /* -1 to +1 is divided into 360 values so total spacing is (2/360) */ +#define INPUT_SPACING 0xB60B61 + + /** + * @brief Macro for Unaligned Support + */ +#ifndef UNALIGNED_SUPPORT_DISABLE + #define ALIGN4 +#else + #if defined (__GNUC__) + #define ALIGN4 __attribute__((aligned(4))) + #else + #define ALIGN4 __align(4) + #endif +#endif /* #ifndef UNALIGNED_SUPPORT_DISABLE */ + + /** + * @brief Error status returned by some functions in the library. + */ + + typedef enum + { + ARM_MATH_SUCCESS = 0, /**< No error */ + ARM_MATH_ARGUMENT_ERROR = -1, /**< One or more arguments are incorrect */ + ARM_MATH_LENGTH_ERROR = -2, /**< Length of data buffer is incorrect */ + ARM_MATH_SIZE_MISMATCH = -3, /**< Size of matrices is not compatible with the operation. */ + ARM_MATH_NANINF = -4, /**< Not-a-number (NaN) or infinity is generated */ + ARM_MATH_SINGULAR = -5, /**< Generated by matrix inversion if the input matrix is singular and cannot be inverted. */ + ARM_MATH_TEST_FAILURE = -6 /**< Test Failed */ + } arm_status; + + /** + * @brief 8-bit fractional data type in 1.7 format. + */ + typedef int8_t q7_t; + + /** + * @brief 16-bit fractional data type in 1.15 format. + */ + typedef int16_t q15_t; + + /** + * @brief 32-bit fractional data type in 1.31 format. + */ + typedef int32_t q31_t; + + /** + * @brief 64-bit fractional data type in 1.63 format. + */ + typedef int64_t q63_t; + + /** + * @brief 32-bit floating-point type definition. + */ + typedef float float32_t; + + /** + * @brief 64-bit floating-point type definition. + */ + typedef double float64_t; + + /** + * @brief definition to read/write two 16 bit values. + */ +#if defined ( __CC_ARM ) + #define __SIMD32_TYPE int32_t __packed + #define CMSIS_UNUSED __attribute__((unused)) + #define CMSIS_INLINE __attribute__((always_inline)) + +#elif defined ( __ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) + #define __SIMD32_TYPE int32_t + #define CMSIS_UNUSED __attribute__((unused)) + #define CMSIS_INLINE __attribute__((always_inline)) + +#elif defined ( __GNUC__ ) + #define __SIMD32_TYPE int32_t + #define CMSIS_UNUSED __attribute__((unused)) + #define CMSIS_INLINE __attribute__((always_inline)) + +#elif defined ( __ICCARM__ ) + #define __SIMD32_TYPE int32_t __packed + #define CMSIS_UNUSED + #define CMSIS_INLINE + +#elif defined ( __TI_ARM__ ) + #define __SIMD32_TYPE int32_t + #define CMSIS_UNUSED __attribute__((unused)) + #define CMSIS_INLINE + +#elif defined ( __CSMC__ ) + #define __SIMD32_TYPE int32_t + #define CMSIS_UNUSED + #define CMSIS_INLINE + +#elif defined ( __TASKING__ ) + #define __SIMD32_TYPE __unaligned int32_t + #define CMSIS_UNUSED + #define CMSIS_INLINE + +#else + #error Unknown compiler +#endif + +#define __SIMD32(addr) (*(__SIMD32_TYPE **) & (addr)) +#define __SIMD32_CONST(addr) ((__SIMD32_TYPE *)(addr)) +#define _SIMD32_OFFSET(addr) (*(__SIMD32_TYPE *) (addr)) +#define __SIMD64(addr) (*(int64_t **) & (addr)) + +/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ +#if !defined (ARM_MATH_DSP) + /** + * @brief definition to pack two 16 bit values. + */ +#define __PKHBT(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0x0000FFFF) | \ + (((int32_t)(ARG2) << ARG3) & (int32_t)0xFFFF0000) ) +#define __PKHTB(ARG1, ARG2, ARG3) ( (((int32_t)(ARG1) << 0) & (int32_t)0xFFFF0000) | \ + (((int32_t)(ARG2) >> ARG3) & (int32_t)0x0000FFFF) ) + +/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ +#endif /* !defined (ARM_MATH_DSP) */ + + /** + * @brief definition to pack four 8 bit values. + */ +#ifndef ARM_MATH_BIG_ENDIAN + +#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v0) << 0) & (int32_t)0x000000FF) | \ + (((int32_t)(v1) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v2) << 16) & (int32_t)0x00FF0000) | \ + (((int32_t)(v3) << 24) & (int32_t)0xFF000000) ) +#else + +#define __PACKq7(v0,v1,v2,v3) ( (((int32_t)(v3) << 0) & (int32_t)0x000000FF) | \ + (((int32_t)(v2) << 8) & (int32_t)0x0000FF00) | \ + (((int32_t)(v1) << 16) & (int32_t)0x00FF0000) | \ + (((int32_t)(v0) << 24) & (int32_t)0xFF000000) ) + +#endif + + + /** + * @brief Clips Q63 to Q31 values. + */ + CMSIS_INLINE __STATIC_INLINE q31_t clip_q63_to_q31( + q63_t x) + { + return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? + ((0x7FFFFFFF ^ ((q31_t) (x >> 63)))) : (q31_t) x; + } + + /** + * @brief Clips Q63 to Q15 values. + */ + CMSIS_INLINE __STATIC_INLINE q15_t clip_q63_to_q15( + q63_t x) + { + return ((q31_t) (x >> 32) != ((q31_t) x >> 31)) ? + ((0x7FFF ^ ((q15_t) (x >> 63)))) : (q15_t) (x >> 15); + } + + /** + * @brief Clips Q31 to Q7 values. + */ + CMSIS_INLINE __STATIC_INLINE q7_t clip_q31_to_q7( + q31_t x) + { + return ((q31_t) (x >> 24) != ((q31_t) x >> 23)) ? + ((0x7F ^ ((q7_t) (x >> 31)))) : (q7_t) x; + } + + /** + * @brief Clips Q31 to Q15 values. + */ + CMSIS_INLINE __STATIC_INLINE q15_t clip_q31_to_q15( + q31_t x) + { + return ((q31_t) (x >> 16) != ((q31_t) x >> 15)) ? + ((0x7FFF ^ ((q15_t) (x >> 31)))) : (q15_t) x; + } + + /** + * @brief Multiplies 32 X 64 and returns 32 bit result in 2.30 format. + */ + + CMSIS_INLINE __STATIC_INLINE q63_t mult32x64( + q63_t x, + q31_t y) + { + return ((((q63_t) (x & 0x00000000FFFFFFFF) * y) >> 32) + + (((q63_t) (x >> 32) * y))); + } + +/* + #if defined (ARM_MATH_CM0_FAMILY) && defined ( __CC_ARM ) + #define __CLZ __clz + #endif + */ +/* note: function can be removed when all toolchain support __CLZ for Cortex-M0 */ +#if defined (ARM_MATH_CM0_FAMILY) && ((defined (__ICCARM__)) ) + CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( + q31_t data); + + CMSIS_INLINE __STATIC_INLINE uint32_t __CLZ( + q31_t data) + { + uint32_t count = 0; + uint32_t mask = 0x80000000; + + while ((data & mask) == 0) + { + count += 1u; + mask = mask >> 1u; + } + + return (count); + } +#endif + + /** + * @brief Function to Calculates 1/in (reciprocal) value of Q31 Data type. + */ + + CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q31( + q31_t in, + q31_t * dst, + q31_t * pRecipTable) + { + q31_t out; + uint32_t tempVal; + uint32_t index, i; + uint32_t signBits; + + if (in > 0) + { + signBits = ((uint32_t) (__CLZ( in) - 1)); + } + else + { + signBits = ((uint32_t) (__CLZ(-in) - 1)); + } + + /* Convert input sample to 1.31 format */ + in = (in << signBits); + + /* calculation of index for initial approximated Val */ + index = (uint32_t)(in >> 24); + index = (index & INDEX_MASK); + + /* 1.31 with exp 1 */ + out = pRecipTable[index]; + + /* calculation of reciprocal value */ + /* running approximation for two iterations */ + for (i = 0u; i < 2u; i++) + { + tempVal = (uint32_t) (((q63_t) in * out) >> 31); + tempVal = 0x7FFFFFFFu - tempVal; + /* 1.31 with exp 1 */ + /* out = (q31_t) (((q63_t) out * tempVal) >> 30); */ + out = clip_q63_to_q31(((q63_t) out * tempVal) >> 30); + } + + /* write output */ + *dst = out; + + /* return num of signbits of out = 1/in value */ + return (signBits + 1u); + } + + + /** + * @brief Function to Calculates 1/in (reciprocal) value of Q15 Data type. + */ + CMSIS_INLINE __STATIC_INLINE uint32_t arm_recip_q15( + q15_t in, + q15_t * dst, + q15_t * pRecipTable) + { + q15_t out = 0; + uint32_t tempVal = 0; + uint32_t index = 0, i = 0; + uint32_t signBits = 0; + + if (in > 0) + { + signBits = ((uint32_t)(__CLZ( in) - 17)); + } + else + { + signBits = ((uint32_t)(__CLZ(-in) - 17)); + } + + /* Convert input sample to 1.15 format */ + in = (in << signBits); + + /* calculation of index for initial approximated Val */ + index = (uint32_t)(in >> 8); + index = (index & INDEX_MASK); + + /* 1.15 with exp 1 */ + out = pRecipTable[index]; + + /* calculation of reciprocal value */ + /* running approximation for two iterations */ + for (i = 0u; i < 2u; i++) + { + tempVal = (uint32_t) (((q31_t) in * out) >> 15); + tempVal = 0x7FFFu - tempVal; + /* 1.15 with exp 1 */ + out = (q15_t) (((q31_t) out * tempVal) >> 14); + /* out = clip_q31_to_q15(((q31_t) out * tempVal) >> 14); */ + } + + /* write output */ + *dst = out; + + /* return num of signbits of out = 1/in value */ + return (signBits + 1); + } + + + /* + * @brief C custom defined intrinisic function for only M0 processors + */ +#if defined(ARM_MATH_CM0_FAMILY) + CMSIS_INLINE __STATIC_INLINE q31_t __SSAT( + q31_t x, + uint32_t y) + { + int32_t posMax, negMin; + uint32_t i; + + posMax = 1; + for (i = 0; i < (y - 1); i++) + { + posMax = posMax * 2; + } + + if (x > 0) + { + posMax = (posMax - 1); + + if (x > posMax) + { + x = posMax; + } + } + else + { + negMin = -posMax; + + if (x < negMin) + { + x = negMin; + } + } + return (x); + } +#endif /* end of ARM_MATH_CM0_FAMILY */ + + + /* + * @brief C custom defined intrinsic function for M3 and M0 processors + */ +/* #if defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ +#if !defined (ARM_MATH_DSP) + + /* + * @brief C custom defined QADD8 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QADD8( + uint32_t x, + uint32_t y) + { + q31_t r, s, t, u; + + r = __SSAT(((((q31_t)x << 24) >> 24) + (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; + s = __SSAT(((((q31_t)x << 16) >> 24) + (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; + t = __SSAT(((((q31_t)x << 8) >> 24) + (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; + u = __SSAT(((((q31_t)x ) >> 24) + (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; + + return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); + } + + + /* + * @brief C custom defined QSUB8 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB8( + uint32_t x, + uint32_t y) + { + q31_t r, s, t, u; + + r = __SSAT(((((q31_t)x << 24) >> 24) - (((q31_t)y << 24) >> 24)), 8) & (int32_t)0x000000FF; + s = __SSAT(((((q31_t)x << 16) >> 24) - (((q31_t)y << 16) >> 24)), 8) & (int32_t)0x000000FF; + t = __SSAT(((((q31_t)x << 8) >> 24) - (((q31_t)y << 8) >> 24)), 8) & (int32_t)0x000000FF; + u = __SSAT(((((q31_t)x ) >> 24) - (((q31_t)y ) >> 24)), 8) & (int32_t)0x000000FF; + + return ((uint32_t)((u << 24) | (t << 16) | (s << 8) | (r ))); + } + + + /* + * @brief C custom defined QADD16 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QADD16( + uint32_t x, + uint32_t y) + { +/* q31_t r, s; without initialisation 'arm_offset_q15 test' fails but 'intrinsic' tests pass! for armCC */ + q31_t r = 0, s = 0; + + r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; + s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined SHADD16 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SHADD16( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = (((((q31_t)x << 16) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; + s = (((((q31_t)x ) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined QSUB16 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QSUB16( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; + s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined SHSUB16 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SHSUB16( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = (((((q31_t)x << 16) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; + s = (((((q31_t)x ) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined QASX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QASX( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = __SSAT(((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; + s = __SSAT(((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined SHASX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SHASX( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = (((((q31_t)x << 16) >> 16) - (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; + s = (((((q31_t)x ) >> 16) + (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined QSAX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __QSAX( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = __SSAT(((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)), 16) & (int32_t)0x0000FFFF; + s = __SSAT(((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)), 16) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined SHSAX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SHSAX( + uint32_t x, + uint32_t y) + { + q31_t r, s; + + r = (((((q31_t)x << 16) >> 16) + (((q31_t)y ) >> 16)) >> 1) & (int32_t)0x0000FFFF; + s = (((((q31_t)x ) >> 16) - (((q31_t)y << 16) >> 16)) >> 1) & (int32_t)0x0000FFFF; + + return ((uint32_t)((s << 16) | (r ))); + } + + + /* + * @brief C custom defined SMUSDX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSDX( + uint32_t x, + uint32_t y) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - + ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); + } + + /* + * @brief C custom defined SMUADX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMUADX( + uint32_t x, + uint32_t y) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) )); + } + + + /* + * @brief C custom defined QADD for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE int32_t __QADD( + int32_t x, + int32_t y) + { + return ((int32_t)(clip_q63_to_q31((q63_t)x + (q31_t)y))); + } + + + /* + * @brief C custom defined QSUB for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE int32_t __QSUB( + int32_t x, + int32_t y) + { + return ((int32_t)(clip_q63_to_q31((q63_t)x - (q31_t)y))); + } + + + /* + * @brief C custom defined SMLAD for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMLAD( + uint32_t x, + uint32_t y, + uint32_t sum) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + + ( ((q31_t)sum ) ) )); + } + + + /* + * @brief C custom defined SMLADX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMLADX( + uint32_t x, + uint32_t y, + uint32_t sum) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + + ( ((q31_t)sum ) ) )); + } + + + /* + * @brief C custom defined SMLSDX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMLSDX( + uint32_t x, + uint32_t y, + uint32_t sum) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) - + ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + + ( ((q31_t)sum ) ) )); + } + + + /* + * @brief C custom defined SMLALD for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALD( + uint32_t x, + uint32_t y, + uint64_t sum) + { +/* return (sum + ((q15_t) (x >> 16) * (q15_t) (y >> 16)) + ((q15_t) x * (q15_t) y)); */ + return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) + + ( ((q63_t)sum ) ) )); + } + + + /* + * @brief C custom defined SMLALDX for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint64_t __SMLALDX( + uint32_t x, + uint32_t y, + uint64_t sum) + { +/* return (sum + ((q15_t) (x >> 16) * (q15_t) y)) + ((q15_t) x * (q15_t) (y >> 16)); */ + return ((uint64_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y ) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y << 16) >> 16)) + + ( ((q63_t)sum ) ) )); + } + + + /* + * @brief C custom defined SMUAD for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMUAD( + uint32_t x, + uint32_t y) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) + + ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); + } + + + /* + * @brief C custom defined SMUSD for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SMUSD( + uint32_t x, + uint32_t y) + { + return ((uint32_t)(((((q31_t)x << 16) >> 16) * (((q31_t)y << 16) >> 16)) - + ((((q31_t)x ) >> 16) * (((q31_t)y ) >> 16)) )); + } + + + /* + * @brief C custom defined SXTB16 for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __SXTB16( + uint32_t x) + { + return ((uint32_t)(((((q31_t)x << 24) >> 24) & (q31_t)0x0000FFFF) | + ((((q31_t)x << 8) >> 8) & (q31_t)0xFFFF0000) )); + } + + /* + * @brief C custom defined SMMLA for M3 and M0 processors + */ + CMSIS_INLINE __STATIC_INLINE int32_t __SMMLA( + int32_t x, + int32_t y, + int32_t sum) + { + return (sum + (int32_t) (((int64_t) x * y) >> 32)); + } + +#if 0 + /* + * @brief C custom defined PKHBT for unavailable DSP extension + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __PKHBT( + uint32_t x, + uint32_t y, + uint32_t leftshift) + { + return ( ((x ) & 0x0000FFFFUL) | + ((y << leftshift) & 0xFFFF0000UL) ); + } + + /* + * @brief C custom defined PKHTB for unavailable DSP extension + */ + CMSIS_INLINE __STATIC_INLINE uint32_t __PKHTB( + uint32_t x, + uint32_t y, + uint32_t rightshift) + { + return ( ((x ) & 0xFFFF0000UL) | + ((y >> rightshift) & 0x0000FFFFUL) ); + } +#endif + +/* #endif // defined (ARM_MATH_CM3) || defined (ARM_MATH_CM0_FAMILY) */ +#endif /* !defined (ARM_MATH_DSP) */ + + + /** + * @brief Instance structure for the Q7 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q7_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + } arm_fir_instance_q7; + + /** + * @brief Instance structure for the Q15 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + } arm_fir_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + } arm_fir_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of filter coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + } arm_fir_instance_f32; + + + /** + * @brief Processing function for the Q7 FIR filter. + * @param[in] S points to an instance of the Q7 FIR filter structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_q7( + const arm_fir_instance_q7 * S, + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q7 FIR filter. + * @param[in,out] S points to an instance of the Q7 FIR structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of samples that are processed. + */ + void arm_fir_init_q7( + arm_fir_instance_q7 * S, + uint16_t numTaps, + q7_t * pCoeffs, + q7_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 FIR filter. + * @param[in] S points to an instance of the Q15 FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_q15( + const arm_fir_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the fast Q15 FIR filter for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q15 FIR filter structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_fast_q15( + const arm_fir_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 FIR filter. + * @param[in,out] S points to an instance of the Q15 FIR filter structure. + * @param[in] numTaps Number of filter coefficients in the filter. Must be even and greater than or equal to 4. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + * @return The function returns ARM_MATH_SUCCESS if initialization was successful or ARM_MATH_ARGUMENT_ERROR if + * numTaps is not a supported value. + */ + arm_status arm_fir_init_q15( + arm_fir_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 FIR filter. + * @param[in] S points to an instance of the Q31 FIR filter structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_q31( + const arm_fir_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the fast Q31 FIR filter for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q31 FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_fast_q31( + const arm_fir_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 FIR filter. + * @param[in,out] S points to an instance of the Q31 FIR structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + */ + void arm_fir_init_q31( + arm_fir_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the floating-point FIR filter. + * @param[in] S points to an instance of the floating-point FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_f32( + const arm_fir_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point FIR filter. + * @param[in,out] S points to an instance of the floating-point FIR filter structure. + * @param[in] numTaps Number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of samples that are processed at a time. + */ + void arm_fir_init_f32( + arm_fir_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 Biquad cascade filter. + */ + typedef struct + { + int8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q15_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + q15_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + int8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ + } arm_biquad_casd_df1_inst_q15; + + /** + * @brief Instance structure for the Q31 Biquad cascade filter. + */ + typedef struct + { + uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q31_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + q31_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + uint8_t postShift; /**< Additional shift, in bits, applied to each output sample. */ + } arm_biquad_casd_df1_inst_q31; + + /** + * @brief Instance structure for the floating-point Biquad cascade filter. + */ + typedef struct + { + uint32_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float32_t *pState; /**< Points to the array of state coefficients. The array is of length 4*numStages. */ + float32_t *pCoeffs; /**< Points to the array of coefficients. The array is of length 5*numStages. */ + } arm_biquad_casd_df1_inst_f32; + + + /** + * @brief Processing function for the Q15 Biquad cascade filter. + * @param[in] S points to an instance of the Q15 Biquad cascade structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df1_q15( + const arm_biquad_casd_df1_inst_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 Biquad cascade filter. + * @param[in,out] S points to an instance of the Q15 Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format + */ + void arm_biquad_cascade_df1_init_q15( + arm_biquad_casd_df1_inst_q15 * S, + uint8_t numStages, + q15_t * pCoeffs, + q15_t * pState, + int8_t postShift); + + + /** + * @brief Fast but less precise processing function for the Q15 Biquad cascade filter for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q15 Biquad cascade structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df1_fast_q15( + const arm_biquad_casd_df1_inst_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 Biquad cascade filter + * @param[in] S points to an instance of the Q31 Biquad cascade structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df1_q31( + const arm_biquad_casd_df1_inst_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Fast but less precise processing function for the Q31 Biquad cascade filter for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q31 Biquad cascade structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df1_fast_q31( + const arm_biquad_casd_df1_inst_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 Biquad cascade filter. + * @param[in,out] S points to an instance of the Q31 Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] postShift Shift to be applied to the output. Varies according to the coefficients format + */ + void arm_biquad_cascade_df1_init_q31( + arm_biquad_casd_df1_inst_q31 * S, + uint8_t numStages, + q31_t * pCoeffs, + q31_t * pState, + int8_t postShift); + + + /** + * @brief Processing function for the floating-point Biquad cascade filter. + * @param[in] S points to an instance of the floating-point Biquad cascade structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df1_f32( + const arm_biquad_casd_df1_inst_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point Biquad cascade filter. + * @param[in,out] S points to an instance of the floating-point Biquad cascade structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + */ + void arm_biquad_cascade_df1_init_f32( + arm_biquad_casd_df1_inst_f32 * S, + uint8_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + /** + * @brief Instance structure for the floating-point matrix structure. + */ + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + float32_t *pData; /**< points to the data of the matrix. */ + } arm_matrix_instance_f32; + + + /** + * @brief Instance structure for the floating-point matrix structure. + */ + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + float64_t *pData; /**< points to the data of the matrix. */ + } arm_matrix_instance_f64; + + /** + * @brief Instance structure for the Q15 matrix structure. + */ + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + q15_t *pData; /**< points to the data of the matrix. */ + } arm_matrix_instance_q15; + + /** + * @brief Instance structure for the Q31 matrix structure. + */ + typedef struct + { + uint16_t numRows; /**< number of rows of the matrix. */ + uint16_t numCols; /**< number of columns of the matrix. */ + q31_t *pData; /**< points to the data of the matrix. */ + } arm_matrix_instance_q31; + + + /** + * @brief Floating-point matrix addition. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_add_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix addition. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_add_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst); + + + /** + * @brief Q31 matrix addition. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_add_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point, complex, matrix multiplication. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_cmplx_mult_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15, complex, matrix multiplication. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_cmplx_mult_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pScratch); + + + /** + * @brief Q31, complex, matrix multiplication. + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_cmplx_mult_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix transpose. + * @param[in] pSrc points to the input matrix + * @param[out] pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_trans_f32( + const arm_matrix_instance_f32 * pSrc, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix transpose. + * @param[in] pSrc points to the input matrix + * @param[out] pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_trans_q15( + const arm_matrix_instance_q15 * pSrc, + arm_matrix_instance_q15 * pDst); + + + /** + * @brief Q31 matrix transpose. + * @param[in] pSrc points to the input matrix + * @param[out] pDst points to the output matrix + * @return The function returns either ARM_MATH_SIZE_MISMATCH + * or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_trans_q31( + const arm_matrix_instance_q31 * pSrc, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix multiplication + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_mult_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix multiplication + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @param[in] pState points to the array for storing intermediate results + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_mult_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pState); + + + /** + * @brief Q15 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @param[in] pState points to the array for storing intermediate results + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_mult_fast_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst, + q15_t * pState); + + + /** + * @brief Q31 matrix multiplication + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_mult_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Q31 matrix multiplication (fast variant) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_mult_fast_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix subtraction + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_sub_f32( + const arm_matrix_instance_f32 * pSrcA, + const arm_matrix_instance_f32 * pSrcB, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix subtraction + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_sub_q15( + const arm_matrix_instance_q15 * pSrcA, + const arm_matrix_instance_q15 * pSrcB, + arm_matrix_instance_q15 * pDst); + + + /** + * @brief Q31 matrix subtraction + * @param[in] pSrcA points to the first input matrix structure + * @param[in] pSrcB points to the second input matrix structure + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_sub_q31( + const arm_matrix_instance_q31 * pSrcA, + const arm_matrix_instance_q31 * pSrcB, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Floating-point matrix scaling. + * @param[in] pSrc points to the input matrix + * @param[in] scale scale factor + * @param[out] pDst points to the output matrix + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_scale_f32( + const arm_matrix_instance_f32 * pSrc, + float32_t scale, + arm_matrix_instance_f32 * pDst); + + + /** + * @brief Q15 matrix scaling. + * @param[in] pSrc points to input matrix + * @param[in] scaleFract fractional portion of the scale factor + * @param[in] shift number of bits to shift the result by + * @param[out] pDst points to output matrix + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_scale_q15( + const arm_matrix_instance_q15 * pSrc, + q15_t scaleFract, + int32_t shift, + arm_matrix_instance_q15 * pDst); + + + /** + * @brief Q31 matrix scaling. + * @param[in] pSrc points to input matrix + * @param[in] scaleFract fractional portion of the scale factor + * @param[in] shift number of bits to shift the result by + * @param[out] pDst points to output matrix structure + * @return The function returns either + * ARM_MATH_SIZE_MISMATCH or ARM_MATH_SUCCESS based on the outcome of size checking. + */ + arm_status arm_mat_scale_q31( + const arm_matrix_instance_q31 * pSrc, + q31_t scaleFract, + int32_t shift, + arm_matrix_instance_q31 * pDst); + + + /** + * @brief Q31 matrix initialization. + * @param[in,out] S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] pData points to the matrix data array. + */ + void arm_mat_init_q31( + arm_matrix_instance_q31 * S, + uint16_t nRows, + uint16_t nColumns, + q31_t * pData); + + + /** + * @brief Q15 matrix initialization. + * @param[in,out] S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] pData points to the matrix data array. + */ + void arm_mat_init_q15( + arm_matrix_instance_q15 * S, + uint16_t nRows, + uint16_t nColumns, + q15_t * pData); + + + /** + * @brief Floating-point matrix initialization. + * @param[in,out] S points to an instance of the floating-point matrix structure. + * @param[in] nRows number of rows in the matrix. + * @param[in] nColumns number of columns in the matrix. + * @param[in] pData points to the matrix data array. + */ + void arm_mat_init_f32( + arm_matrix_instance_f32 * S, + uint16_t nRows, + uint16_t nColumns, + float32_t * pData); + + + + /** + * @brief Instance structure for the Q15 PID Control. + */ + typedef struct + { + q15_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ +#if !defined (ARM_MATH_DSP) + q15_t A1; + q15_t A2; +#else + q31_t A1; /**< The derived gain A1 = -Kp - 2Kd | Kd.*/ +#endif + q15_t state[3]; /**< The state array of length 3. */ + q15_t Kp; /**< The proportional gain. */ + q15_t Ki; /**< The integral gain. */ + q15_t Kd; /**< The derivative gain. */ + } arm_pid_instance_q15; + + /** + * @brief Instance structure for the Q31 PID Control. + */ + typedef struct + { + q31_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ + q31_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ + q31_t A2; /**< The derived gain, A2 = Kd . */ + q31_t state[3]; /**< The state array of length 3. */ + q31_t Kp; /**< The proportional gain. */ + q31_t Ki; /**< The integral gain. */ + q31_t Kd; /**< The derivative gain. */ + } arm_pid_instance_q31; + + /** + * @brief Instance structure for the floating-point PID Control. + */ + typedef struct + { + float32_t A0; /**< The derived gain, A0 = Kp + Ki + Kd . */ + float32_t A1; /**< The derived gain, A1 = -Kp - 2Kd. */ + float32_t A2; /**< The derived gain, A2 = Kd . */ + float32_t state[3]; /**< The state array of length 3. */ + float32_t Kp; /**< The proportional gain. */ + float32_t Ki; /**< The integral gain. */ + float32_t Kd; /**< The derivative gain. */ + } arm_pid_instance_f32; + + + + /** + * @brief Initialization function for the floating-point PID Control. + * @param[in,out] S points to an instance of the PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + */ + void arm_pid_init_f32( + arm_pid_instance_f32 * S, + int32_t resetStateFlag); + + + /** + * @brief Reset function for the floating-point PID Control. + * @param[in,out] S is an instance of the floating-point PID Control structure + */ + void arm_pid_reset_f32( + arm_pid_instance_f32 * S); + + + /** + * @brief Initialization function for the Q31 PID Control. + * @param[in,out] S points to an instance of the Q15 PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + */ + void arm_pid_init_q31( + arm_pid_instance_q31 * S, + int32_t resetStateFlag); + + + /** + * @brief Reset function for the Q31 PID Control. + * @param[in,out] S points to an instance of the Q31 PID Control structure + */ + + void arm_pid_reset_q31( + arm_pid_instance_q31 * S); + + + /** + * @brief Initialization function for the Q15 PID Control. + * @param[in,out] S points to an instance of the Q15 PID structure. + * @param[in] resetStateFlag flag to reset the state. 0 = no change in state 1 = reset the state. + */ + void arm_pid_init_q15( + arm_pid_instance_q15 * S, + int32_t resetStateFlag); + + + /** + * @brief Reset function for the Q15 PID Control. + * @param[in,out] S points to an instance of the q15 PID Control structure + */ + void arm_pid_reset_q15( + arm_pid_instance_q15 * S); + + + /** + * @brief Instance structure for the floating-point Linear Interpolate function. + */ + typedef struct + { + uint32_t nValues; /**< nValues */ + float32_t x1; /**< x1 */ + float32_t xSpacing; /**< xSpacing */ + float32_t *pYData; /**< pointer to the table of Y values */ + } arm_linear_interp_instance_f32; + + /** + * @brief Instance structure for the floating-point bilinear interpolation function. + */ + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + float32_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_f32; + + /** + * @brief Instance structure for the Q31 bilinear interpolation function. + */ + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q31_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q31; + + /** + * @brief Instance structure for the Q15 bilinear interpolation function. + */ + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q15_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q15; + + /** + * @brief Instance structure for the Q15 bilinear interpolation function. + */ + typedef struct + { + uint16_t numRows; /**< number of rows in the data table. */ + uint16_t numCols; /**< number of columns in the data table. */ + q7_t *pData; /**< points to the data table. */ + } arm_bilinear_interp_instance_q7; + + + /** + * @brief Q7 vector multiplication. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_mult_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q15 vector multiplication. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_mult_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q31 vector multiplication. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_mult_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Floating-point vector multiplication. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_mult_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q15_t *pTwiddle; /**< points to the Sin twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix2_instance_q15; + +/* Deprecated */ + arm_status arm_cfft_radix2_init_q15( + arm_cfft_radix2_instance_q15 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + +/* Deprecated */ + void arm_cfft_radix2_q15( + const arm_cfft_radix2_instance_q15 * S, + q15_t * pSrc); + + + /** + * @brief Instance structure for the Q15 CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q15_t *pTwiddle; /**< points to the twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix4_instance_q15; + +/* Deprecated */ + arm_status arm_cfft_radix4_init_q15( + arm_cfft_radix4_instance_q15 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + +/* Deprecated */ + void arm_cfft_radix4_q15( + const arm_cfft_radix4_instance_q15 * S, + q15_t * pSrc); + + /** + * @brief Instance structure for the Radix-2 Q31 CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q31_t *pTwiddle; /**< points to the Twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix2_instance_q31; + +/* Deprecated */ + arm_status arm_cfft_radix2_init_q31( + arm_cfft_radix2_instance_q31 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + +/* Deprecated */ + void arm_cfft_radix2_q31( + const arm_cfft_radix2_instance_q31 * S, + q31_t * pSrc); + + /** + * @brief Instance structure for the Q31 CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + q31_t *pTwiddle; /**< points to the twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + } arm_cfft_radix4_instance_q31; + +/* Deprecated */ + void arm_cfft_radix4_q31( + const arm_cfft_radix4_instance_q31 * S, + q31_t * pSrc); + +/* Deprecated */ + arm_status arm_cfft_radix4_init_q31( + arm_cfft_radix4_instance_q31 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Instance structure for the floating-point CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + float32_t *pTwiddle; /**< points to the Twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + float32_t onebyfftLen; /**< value of 1/fftLen. */ + } arm_cfft_radix2_instance_f32; + +/* Deprecated */ + arm_status arm_cfft_radix2_init_f32( + arm_cfft_radix2_instance_f32 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + +/* Deprecated */ + void arm_cfft_radix2_f32( + const arm_cfft_radix2_instance_f32 * S, + float32_t * pSrc); + + /** + * @brief Instance structure for the floating-point CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + uint8_t ifftFlag; /**< flag that selects forward (ifftFlag=0) or inverse (ifftFlag=1) transform. */ + uint8_t bitReverseFlag; /**< flag that enables (bitReverseFlag=1) or disables (bitReverseFlag=0) bit reversal of output. */ + float32_t *pTwiddle; /**< points to the Twiddle factor table. */ + uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t twidCoefModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + uint16_t bitRevFactor; /**< bit reversal modifier that supports different size FFTs with the same bit reversal table. */ + float32_t onebyfftLen; /**< value of 1/fftLen. */ + } arm_cfft_radix4_instance_f32; + +/* Deprecated */ + arm_status arm_cfft_radix4_init_f32( + arm_cfft_radix4_instance_f32 * S, + uint16_t fftLen, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + +/* Deprecated */ + void arm_cfft_radix4_f32( + const arm_cfft_radix4_instance_f32 * S, + float32_t * pSrc); + + /** + * @brief Instance structure for the fixed-point CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + const q15_t *pTwiddle; /**< points to the Twiddle factor table. */ + const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t bitRevLength; /**< bit reversal table length. */ + } arm_cfft_instance_q15; + +void arm_cfft_q15( + const arm_cfft_instance_q15 * S, + q15_t * p1, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Instance structure for the fixed-point CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + const q31_t *pTwiddle; /**< points to the Twiddle factor table. */ + const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t bitRevLength; /**< bit reversal table length. */ + } arm_cfft_instance_q31; + +void arm_cfft_q31( + const arm_cfft_instance_q31 * S, + q31_t * p1, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Instance structure for the floating-point CFFT/CIFFT function. + */ + typedef struct + { + uint16_t fftLen; /**< length of the FFT. */ + const float32_t *pTwiddle; /**< points to the Twiddle factor table. */ + const uint16_t *pBitRevTable; /**< points to the bit reversal table. */ + uint16_t bitRevLength; /**< bit reversal table length. */ + } arm_cfft_instance_f32; + + void arm_cfft_f32( + const arm_cfft_instance_f32 * S, + float32_t * p1, + uint8_t ifftFlag, + uint8_t bitReverseFlag); + + /** + * @brief Instance structure for the Q15 RFFT/RIFFT function. + */ + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + q15_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + q15_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + const arm_cfft_instance_q15 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_q15; + + arm_status arm_rfft_init_q15( + arm_rfft_instance_q15 * S, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + void arm_rfft_q15( + const arm_rfft_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst); + + /** + * @brief Instance structure for the Q31 RFFT/RIFFT function. + */ + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + q31_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + q31_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + const arm_cfft_instance_q31 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_q31; + + arm_status arm_rfft_init_q31( + arm_rfft_instance_q31 * S, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + void arm_rfft_q31( + const arm_rfft_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst); + + /** + * @brief Instance structure for the floating-point RFFT/RIFFT function. + */ + typedef struct + { + uint32_t fftLenReal; /**< length of the real FFT. */ + uint16_t fftLenBy2; /**< length of the complex FFT. */ + uint8_t ifftFlagR; /**< flag that selects forward (ifftFlagR=0) or inverse (ifftFlagR=1) transform. */ + uint8_t bitReverseFlagR; /**< flag that enables (bitReverseFlagR=1) or disables (bitReverseFlagR=0) bit reversal of output. */ + uint32_t twidCoefRModifier; /**< twiddle coefficient modifier that supports different size FFTs with the same twiddle factor table. */ + float32_t *pTwiddleAReal; /**< points to the real twiddle factor table. */ + float32_t *pTwiddleBReal; /**< points to the imag twiddle factor table. */ + arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ + } arm_rfft_instance_f32; + + arm_status arm_rfft_init_f32( + arm_rfft_instance_f32 * S, + arm_cfft_radix4_instance_f32 * S_CFFT, + uint32_t fftLenReal, + uint32_t ifftFlagR, + uint32_t bitReverseFlag); + + void arm_rfft_f32( + const arm_rfft_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst); + + /** + * @brief Instance structure for the floating-point RFFT/RIFFT function. + */ +typedef struct + { + arm_cfft_instance_f32 Sint; /**< Internal CFFT structure. */ + uint16_t fftLenRFFT; /**< length of the real sequence */ + float32_t * pTwiddleRFFT; /**< Twiddle factors real stage */ + } arm_rfft_fast_instance_f32 ; + +arm_status arm_rfft_fast_init_f32 ( + arm_rfft_fast_instance_f32 * S, + uint16_t fftLen); + +void arm_rfft_fast_f32( + arm_rfft_fast_instance_f32 * S, + float32_t * p, float32_t * pOut, + uint8_t ifftFlag); + + /** + * @brief Instance structure for the floating-point DCT4/IDCT4 function. + */ + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + float32_t normalize; /**< normalizing factor. */ + float32_t *pTwiddle; /**< points to the twiddle factor table. */ + float32_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_f32 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_f32 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_f32; + + + /** + * @brief Initialization function for the floating-point DCT4/IDCT4. + * @param[in,out] S points to an instance of floating-point DCT4/IDCT4 structure. + * @param[in] S_RFFT points to an instance of floating-point RFFT/RIFFT structure. + * @param[in] S_CFFT points to an instance of floating-point CFFT/CIFFT structure. + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if fftLenReal is not a supported transform length. + */ + arm_status arm_dct4_init_f32( + arm_dct4_instance_f32 * S, + arm_rfft_instance_f32 * S_RFFT, + arm_cfft_radix4_instance_f32 * S_CFFT, + uint16_t N, + uint16_t Nby2, + float32_t normalize); + + + /** + * @brief Processing function for the floating-point DCT4/IDCT4. + * @param[in] S points to an instance of the floating-point DCT4/IDCT4 structure. + * @param[in] pState points to state buffer. + * @param[in,out] pInlineBuffer points to the in-place input and output buffer. + */ + void arm_dct4_f32( + const arm_dct4_instance_f32 * S, + float32_t * pState, + float32_t * pInlineBuffer); + + + /** + * @brief Instance structure for the Q31 DCT4/IDCT4 function. + */ + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + q31_t normalize; /**< normalizing factor. */ + q31_t *pTwiddle; /**< points to the twiddle factor table. */ + q31_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_q31 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_q31 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_q31; + + + /** + * @brief Initialization function for the Q31 DCT4/IDCT4. + * @param[in,out] S points to an instance of Q31 DCT4/IDCT4 structure. + * @param[in] S_RFFT points to an instance of Q31 RFFT/RIFFT structure + * @param[in] S_CFFT points to an instance of Q31 CFFT/CIFFT structure + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. + */ + arm_status arm_dct4_init_q31( + arm_dct4_instance_q31 * S, + arm_rfft_instance_q31 * S_RFFT, + arm_cfft_radix4_instance_q31 * S_CFFT, + uint16_t N, + uint16_t Nby2, + q31_t normalize); + + + /** + * @brief Processing function for the Q31 DCT4/IDCT4. + * @param[in] S points to an instance of the Q31 DCT4 structure. + * @param[in] pState points to state buffer. + * @param[in,out] pInlineBuffer points to the in-place input and output buffer. + */ + void arm_dct4_q31( + const arm_dct4_instance_q31 * S, + q31_t * pState, + q31_t * pInlineBuffer); + + + /** + * @brief Instance structure for the Q15 DCT4/IDCT4 function. + */ + typedef struct + { + uint16_t N; /**< length of the DCT4. */ + uint16_t Nby2; /**< half of the length of the DCT4. */ + q15_t normalize; /**< normalizing factor. */ + q15_t *pTwiddle; /**< points to the twiddle factor table. */ + q15_t *pCosFactor; /**< points to the cosFactor table. */ + arm_rfft_instance_q15 *pRfft; /**< points to the real FFT instance. */ + arm_cfft_radix4_instance_q15 *pCfft; /**< points to the complex FFT instance. */ + } arm_dct4_instance_q15; + + + /** + * @brief Initialization function for the Q15 DCT4/IDCT4. + * @param[in,out] S points to an instance of Q15 DCT4/IDCT4 structure. + * @param[in] S_RFFT points to an instance of Q15 RFFT/RIFFT structure. + * @param[in] S_CFFT points to an instance of Q15 CFFT/CIFFT structure. + * @param[in] N length of the DCT4. + * @param[in] Nby2 half of the length of the DCT4. + * @param[in] normalize normalizing factor. + * @return arm_status function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_ARGUMENT_ERROR if N is not a supported transform length. + */ + arm_status arm_dct4_init_q15( + arm_dct4_instance_q15 * S, + arm_rfft_instance_q15 * S_RFFT, + arm_cfft_radix4_instance_q15 * S_CFFT, + uint16_t N, + uint16_t Nby2, + q15_t normalize); + + + /** + * @brief Processing function for the Q15 DCT4/IDCT4. + * @param[in] S points to an instance of the Q15 DCT4 structure. + * @param[in] pState points to state buffer. + * @param[in,out] pInlineBuffer points to the in-place input and output buffer. + */ + void arm_dct4_q15( + const arm_dct4_instance_q15 * S, + q15_t * pState, + q15_t * pInlineBuffer); + + + /** + * @brief Floating-point vector addition. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_add_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q7 vector addition. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_add_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q15 vector addition. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_add_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q31 vector addition. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_add_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Floating-point vector subtraction. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_sub_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q7 vector subtraction. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_sub_q7( + q7_t * pSrcA, + q7_t * pSrcB, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q15 vector subtraction. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_sub_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q31 vector subtraction. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in each vector + */ + void arm_sub_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Multiplies a floating-point vector by a scalar. + * @param[in] pSrc points to the input vector + * @param[in] scale scale factor to be applied + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_scale_f32( + float32_t * pSrc, + float32_t scale, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Multiplies a Q7 vector by a scalar. + * @param[in] pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_scale_q7( + q7_t * pSrc, + q7_t scaleFract, + int8_t shift, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Multiplies a Q15 vector by a scalar. + * @param[in] pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_scale_q15( + q15_t * pSrc, + q15_t scaleFract, + int8_t shift, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Multiplies a Q31 vector by a scalar. + * @param[in] pSrc points to the input vector + * @param[in] scaleFract fractional portion of the scale value + * @param[in] shift number of bits to shift the result by + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_scale_q31( + q31_t * pSrc, + q31_t scaleFract, + int8_t shift, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q7 vector absolute value. + * @param[in] pSrc points to the input buffer + * @param[out] pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + */ + void arm_abs_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Floating-point vector absolute value. + * @param[in] pSrc points to the input buffer + * @param[out] pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + */ + void arm_abs_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q15 vector absolute value. + * @param[in] pSrc points to the input buffer + * @param[out] pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + */ + void arm_abs_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Q31 vector absolute value. + * @param[in] pSrc points to the input buffer + * @param[out] pDst points to the output buffer + * @param[in] blockSize number of samples in each vector + */ + void arm_abs_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Dot product of floating-point vectors. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] result output result returned here + */ + void arm_dot_prod_f32( + float32_t * pSrcA, + float32_t * pSrcB, + uint32_t blockSize, + float32_t * result); + + + /** + * @brief Dot product of Q7 vectors. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] result output result returned here + */ + void arm_dot_prod_q7( + q7_t * pSrcA, + q7_t * pSrcB, + uint32_t blockSize, + q31_t * result); + + + /** + * @brief Dot product of Q15 vectors. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] result output result returned here + */ + void arm_dot_prod_q15( + q15_t * pSrcA, + q15_t * pSrcB, + uint32_t blockSize, + q63_t * result); + + + /** + * @brief Dot product of Q31 vectors. + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] blockSize number of samples in each vector + * @param[out] result output result returned here + */ + void arm_dot_prod_q31( + q31_t * pSrcA, + q31_t * pSrcB, + uint32_t blockSize, + q63_t * result); + + + /** + * @brief Shifts the elements of a Q7 vector a specified number of bits. + * @param[in] pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_shift_q7( + q7_t * pSrc, + int8_t shiftBits, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Shifts the elements of a Q15 vector a specified number of bits. + * @param[in] pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_shift_q15( + q15_t * pSrc, + int8_t shiftBits, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Shifts the elements of a Q31 vector a specified number of bits. + * @param[in] pSrc points to the input vector + * @param[in] shiftBits number of bits to shift. A positive value shifts left; a negative value shifts right. + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_shift_q31( + q31_t * pSrc, + int8_t shiftBits, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Adds a constant offset to a floating-point vector. + * @param[in] pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_offset_f32( + float32_t * pSrc, + float32_t offset, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Adds a constant offset to a Q7 vector. + * @param[in] pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_offset_q7( + q7_t * pSrc, + q7_t offset, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Adds a constant offset to a Q15 vector. + * @param[in] pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_offset_q15( + q15_t * pSrc, + q15_t offset, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Adds a constant offset to a Q31 vector. + * @param[in] pSrc points to the input vector + * @param[in] offset is the offset to be added + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_offset_q31( + q31_t * pSrc, + q31_t offset, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Negates the elements of a floating-point vector. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_negate_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Negates the elements of a Q7 vector. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_negate_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Negates the elements of a Q15 vector. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_negate_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Negates the elements of a Q31 vector. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] blockSize number of samples in the vector + */ + void arm_negate_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Copies the elements of a floating-point vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_copy_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Copies the elements of a Q7 vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_copy_q7( + q7_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Copies the elements of a Q15 vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_copy_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Copies the elements of a Q31 vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_copy_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Fills a constant value into a floating-point vector. + * @param[in] value input value to be filled + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_fill_f32( + float32_t value, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Fills a constant value into a Q7 vector. + * @param[in] value input value to be filled + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_fill_q7( + q7_t value, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Fills a constant value into a Q15 vector. + * @param[in] value input value to be filled + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_fill_q15( + q15_t value, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Fills a constant value into a Q31 vector. + * @param[in] value input value to be filled + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_fill_q31( + q31_t value, + q31_t * pDst, + uint32_t blockSize); + + +/** + * @brief Convolution of floating-point sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. + */ + void arm_conv_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst); + + + /** + * @brief Convolution of Q15 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). + */ + void arm_conv_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + q15_t * pScratch1, + q15_t * pScratch2); + + +/** + * @brief Convolution of Q15 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the location where the output result is written. Length srcALen+srcBLen-1. + */ + void arm_conv_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + + /** + * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + */ + void arm_conv_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + + /** + * @brief Convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). + */ + void arm_conv_fast_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + q15_t * pScratch1, + q15_t * pScratch2); + + + /** + * @brief Convolution of Q31 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + */ + void arm_conv_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + + /** + * @brief Convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + */ + void arm_conv_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + + /** + * @brief Convolution of Q7 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). + */ + void arm_conv_opt_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst, + q15_t * pScratch1, + q15_t * pScratch2); + + + /** + * @brief Convolution of Q7 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length srcALen+srcBLen-1. + */ + void arm_conv_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst); + + + /** + * @brief Partial convolution of floating-point sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q15 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints, + q15_t * pScratch1, + q15_t * pScratch2); + + + /** + * @brief Partial convolution of Q15 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @param[in] pScratch1 points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer of size min(srcALen, srcBLen). + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_fast_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + uint32_t firstIndex, + uint32_t numPoints, + q15_t * pScratch1, + q15_t * pScratch2); + + + /** + * @brief Partial convolution of Q31 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Partial convolution of Q7 sequences + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_opt_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst, + uint32_t firstIndex, + uint32_t numPoints, + q15_t * pScratch1, + q15_t * pScratch2); + + +/** + * @brief Partial convolution of Q7 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data + * @param[in] firstIndex is the first output sample to start with. + * @param[in] numPoints is the number of output points to be computed. + * @return Returns either ARM_MATH_SUCCESS if the function completed correctly or ARM_MATH_ARGUMENT_ERROR if the requested subset is not in the range [0 srcALen+srcBLen-2]. + */ + arm_status arm_conv_partial_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst, + uint32_t firstIndex, + uint32_t numPoints); + + + /** + * @brief Instance structure for the Q15 FIR decimator. + */ + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + } arm_fir_decimate_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR decimator. + */ + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + } arm_fir_decimate_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR decimator. + */ + typedef struct + { + uint8_t M; /**< decimation factor. */ + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + } arm_fir_decimate_instance_f32; + + + /** + * @brief Processing function for the floating-point FIR decimator. + * @param[in] S points to an instance of the floating-point FIR decimator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_decimate_f32( + const arm_fir_decimate_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point FIR decimator. + * @param[in,out] S points to an instance of the floating-point FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + arm_status arm_fir_decimate_init_f32( + arm_fir_decimate_instance_f32 * S, + uint16_t numTaps, + uint8_t M, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 FIR decimator. + * @param[in] S points to an instance of the Q15 FIR decimator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_decimate_q15( + const arm_fir_decimate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q15 FIR decimator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_decimate_fast_q15( + const arm_fir_decimate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 FIR decimator. + * @param[in,out] S points to an instance of the Q15 FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + arm_status arm_fir_decimate_init_q15( + arm_fir_decimate_instance_q15 * S, + uint16_t numTaps, + uint8_t M, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 FIR decimator. + * @param[in] S points to an instance of the Q31 FIR decimator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_decimate_q31( + const arm_fir_decimate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + /** + * @brief Processing function for the Q31 FIR decimator (fast variant) for Cortex-M3 and Cortex-M4. + * @param[in] S points to an instance of the Q31 FIR decimator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_decimate_fast_q31( + arm_fir_decimate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 FIR decimator. + * @param[in,out] S points to an instance of the Q31 FIR decimator structure. + * @param[in] numTaps number of coefficients in the filter. + * @param[in] M decimation factor. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * blockSize is not a multiple of M. + */ + arm_status arm_fir_decimate_init_q31( + arm_fir_decimate_instance_q31 * S, + uint16_t numTaps, + uint8_t M, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 FIR interpolator. + */ + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + q15_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ + } arm_fir_interpolate_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR interpolator. + */ + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + q31_t *pState; /**< points to the state variable array. The array is of length blockSize+phaseLength-1. */ + } arm_fir_interpolate_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR interpolator. + */ + typedef struct + { + uint8_t L; /**< upsample factor. */ + uint16_t phaseLength; /**< length of each polyphase filter component. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length L*phaseLength. */ + float32_t *pState; /**< points to the state variable array. The array is of length phaseLength+numTaps-1. */ + } arm_fir_interpolate_instance_f32; + + + /** + * @brief Processing function for the Q15 FIR interpolator. + * @param[in] S points to an instance of the Q15 FIR interpolator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_interpolate_q15( + const arm_fir_interpolate_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 FIR interpolator. + * @param[in,out] S points to an instance of the Q15 FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficient buffer. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + arm_status arm_fir_interpolate_init_q15( + arm_fir_interpolate_instance_q15 * S, + uint8_t L, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 FIR interpolator. + * @param[in] S points to an instance of the Q15 FIR interpolator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_interpolate_q31( + const arm_fir_interpolate_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 FIR interpolator. + * @param[in,out] S points to an instance of the Q31 FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficient buffer. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + arm_status arm_fir_interpolate_init_q31( + arm_fir_interpolate_instance_q31 * S, + uint8_t L, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the floating-point FIR interpolator. + * @param[in] S points to an instance of the floating-point FIR interpolator structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_interpolate_f32( + const arm_fir_interpolate_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point FIR interpolator. + * @param[in,out] S points to an instance of the floating-point FIR interpolator structure. + * @param[in] L upsample factor. + * @param[in] numTaps number of filter coefficients in the filter. + * @param[in] pCoeffs points to the filter coefficient buffer. + * @param[in] pState points to the state buffer. + * @param[in] blockSize number of input samples to process per call. + * @return The function returns ARM_MATH_SUCCESS if initialization is successful or ARM_MATH_LENGTH_ERROR if + * the filter length numTaps is not a multiple of the interpolation factor L. + */ + arm_status arm_fir_interpolate_init_f32( + arm_fir_interpolate_instance_f32 * S, + uint8_t L, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + uint32_t blockSize); + + + /** + * @brief Instance structure for the high precision Q31 Biquad cascade filter. + */ + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + q63_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ + q31_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + uint8_t postShift; /**< additional shift, in bits, applied to each output sample. */ + } arm_biquad_cas_df1_32x64_ins_q31; + + + /** + * @param[in] S points to an instance of the high precision Q31 Biquad cascade filter structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cas_df1_32x64_q31( + const arm_biquad_cas_df1_32x64_ins_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @param[in,out] S points to an instance of the high precision Q31 Biquad cascade filter structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] postShift shift to be applied to the output. Varies according to the coefficients format + */ + void arm_biquad_cas_df1_32x64_init_q31( + arm_biquad_cas_df1_32x64_ins_q31 * S, + uint8_t numStages, + q31_t * pCoeffs, + q63_t * pState, + uint8_t postShift); + + + /** + * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. + */ + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float32_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ + float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + } arm_biquad_cascade_df2T_instance_f32; + + /** + * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. + */ + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float32_t *pState; /**< points to the array of state coefficients. The array is of length 4*numStages. */ + float32_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + } arm_biquad_cascade_stereo_df2T_instance_f32; + + /** + * @brief Instance structure for the floating-point transposed direct form II Biquad cascade filter. + */ + typedef struct + { + uint8_t numStages; /**< number of 2nd order stages in the filter. Overall order is 2*numStages. */ + float64_t *pState; /**< points to the array of state coefficients. The array is of length 2*numStages. */ + float64_t *pCoeffs; /**< points to the array of coefficients. The array is of length 5*numStages. */ + } arm_biquad_cascade_df2T_instance_f64; + + + /** + * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in] S points to an instance of the filter data structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df2T_f32( + const arm_biquad_cascade_df2T_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. 2 channels + * @param[in] S points to an instance of the filter data structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_stereo_df2T_f32( + const arm_biquad_cascade_stereo_df2T_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Processing function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in] S points to an instance of the filter data structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_biquad_cascade_df2T_f64( + const arm_biquad_cascade_df2T_instance_f64 * S, + float64_t * pSrc, + float64_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in,out] S points to an instance of the filter data structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + */ + void arm_biquad_cascade_df2T_init_f32( + arm_biquad_cascade_df2T_instance_f32 * S, + uint8_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + /** + * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in,out] S points to an instance of the filter data structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + */ + void arm_biquad_cascade_stereo_df2T_init_f32( + arm_biquad_cascade_stereo_df2T_instance_f32 * S, + uint8_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + /** + * @brief Initialization function for the floating-point transposed direct form II Biquad cascade filter. + * @param[in,out] S points to an instance of the filter data structure. + * @param[in] numStages number of 2nd order stages in the filter. + * @param[in] pCoeffs points to the filter coefficients. + * @param[in] pState points to the state buffer. + */ + void arm_biquad_cascade_df2T_init_f64( + arm_biquad_cascade_df2T_instance_f64 * S, + uint8_t numStages, + float64_t * pCoeffs, + float64_t * pState); + + + /** + * @brief Instance structure for the Q15 FIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + q15_t *pState; /**< points to the state variable array. The array is of length numStages. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_q15; + + /** + * @brief Instance structure for the Q31 FIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + q31_t *pState; /**< points to the state variable array. The array is of length numStages. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_q31; + + /** + * @brief Instance structure for the floating-point FIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of filter stages. */ + float32_t *pState; /**< points to the state variable array. The array is of length numStages. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numStages. */ + } arm_fir_lattice_instance_f32; + + + /** + * @brief Initialization function for the Q15 FIR lattice filter. + * @param[in] S points to an instance of the Q15 FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] pState points to the state buffer. The array is of length numStages. + */ + void arm_fir_lattice_init_q15( + arm_fir_lattice_instance_q15 * S, + uint16_t numStages, + q15_t * pCoeffs, + q15_t * pState); + + + /** + * @brief Processing function for the Q15 FIR lattice filter. + * @param[in] S points to an instance of the Q15 FIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_fir_lattice_q15( + const arm_fir_lattice_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 FIR lattice filter. + * @param[in] S points to an instance of the Q31 FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] pState points to the state buffer. The array is of length numStages. + */ + void arm_fir_lattice_init_q31( + arm_fir_lattice_instance_q31 * S, + uint16_t numStages, + q31_t * pCoeffs, + q31_t * pState); + + + /** + * @brief Processing function for the Q31 FIR lattice filter. + * @param[in] S points to an instance of the Q31 FIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_fir_lattice_q31( + const arm_fir_lattice_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + +/** + * @brief Initialization function for the floating-point FIR lattice filter. + * @param[in] S points to an instance of the floating-point FIR lattice structure. + * @param[in] numStages number of filter stages. + * @param[in] pCoeffs points to the coefficient buffer. The array is of length numStages. + * @param[in] pState points to the state buffer. The array is of length numStages. + */ + void arm_fir_lattice_init_f32( + arm_fir_lattice_instance_f32 * S, + uint16_t numStages, + float32_t * pCoeffs, + float32_t * pState); + + + /** + * @brief Processing function for the floating-point FIR lattice filter. + * @param[in] S points to an instance of the floating-point FIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] blockSize number of samples to process. + */ + void arm_fir_lattice_f32( + const arm_fir_lattice_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + q15_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + q15_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_q15; + + /** + * @brief Instance structure for the Q31 IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + q31_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + q31_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_q31; + + /** + * @brief Instance structure for the floating-point IIR lattice filter. + */ + typedef struct + { + uint16_t numStages; /**< number of stages in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numStages+blockSize. */ + float32_t *pkCoeffs; /**< points to the reflection coefficient array. The array is of length numStages. */ + float32_t *pvCoeffs; /**< points to the ladder coefficient array. The array is of length numStages+1. */ + } arm_iir_lattice_instance_f32; + + + /** + * @brief Processing function for the floating-point IIR lattice filter. + * @param[in] S points to an instance of the floating-point IIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_iir_lattice_f32( + const arm_iir_lattice_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point IIR lattice filter. + * @param[in] S points to an instance of the floating-point IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. + * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. + * @param[in] pState points to the state buffer. The array is of length numStages+blockSize-1. + * @param[in] blockSize number of samples to process. + */ + void arm_iir_lattice_init_f32( + arm_iir_lattice_instance_f32 * S, + uint16_t numStages, + float32_t * pkCoeffs, + float32_t * pvCoeffs, + float32_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 IIR lattice filter. + * @param[in] S points to an instance of the Q31 IIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_iir_lattice_q31( + const arm_iir_lattice_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 IIR lattice filter. + * @param[in] S points to an instance of the Q31 IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. + * @param[in] pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. + * @param[in] pState points to the state buffer. The array is of length numStages+blockSize. + * @param[in] blockSize number of samples to process. + */ + void arm_iir_lattice_init_q31( + arm_iir_lattice_instance_q31 * S, + uint16_t numStages, + q31_t * pkCoeffs, + q31_t * pvCoeffs, + q31_t * pState, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 IIR lattice filter. + * @param[in] S points to an instance of the Q15 IIR lattice structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data. + * @param[in] blockSize number of samples to process. + */ + void arm_iir_lattice_q15( + const arm_iir_lattice_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + +/** + * @brief Initialization function for the Q15 IIR lattice filter. + * @param[in] S points to an instance of the fixed-point Q15 IIR lattice structure. + * @param[in] numStages number of stages in the filter. + * @param[in] pkCoeffs points to reflection coefficient buffer. The array is of length numStages. + * @param[in] pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. + * @param[in] pState points to state buffer. The array is of length numStages+blockSize. + * @param[in] blockSize number of samples to process per call. + */ + void arm_iir_lattice_init_q15( + arm_iir_lattice_instance_q15 * S, + uint16_t numStages, + q15_t * pkCoeffs, + q15_t * pvCoeffs, + q15_t * pState, + uint32_t blockSize); + + + /** + * @brief Instance structure for the floating-point LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + float32_t mu; /**< step size that controls filter coefficient updates. */ + } arm_lms_instance_f32; + + + /** + * @brief Processing function for floating-point LMS filter. + * @param[in] S points to an instance of the floating-point LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_f32( + const arm_lms_instance_f32 * S, + float32_t * pSrc, + float32_t * pRef, + float32_t * pOut, + float32_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for floating-point LMS filter. + * @param[in] S points to an instance of the floating-point LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to the coefficient buffer. + * @param[in] pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_init_f32( + arm_lms_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + float32_t mu, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q15 LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q15_t mu; /**< step size that controls filter coefficient updates. */ + uint32_t postShift; /**< bit shift applied to coefficients. */ + } arm_lms_instance_q15; + + + /** + * @brief Initialization function for the Q15 LMS filter. + * @param[in] S points to an instance of the Q15 LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to the coefficient buffer. + * @param[in] pState points to the state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + */ + void arm_lms_init_q15( + arm_lms_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + q15_t mu, + uint32_t blockSize, + uint32_t postShift); + + + /** + * @brief Processing function for Q15 LMS filter. + * @param[in] S points to an instance of the Q15 LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_q15( + const arm_lms_instance_q15 * S, + q15_t * pSrc, + q15_t * pRef, + q15_t * pOut, + q15_t * pErr, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q31 LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q31_t mu; /**< step size that controls filter coefficient updates. */ + uint32_t postShift; /**< bit shift applied to coefficients. */ + } arm_lms_instance_q31; + + + /** + * @brief Processing function for Q31 LMS filter. + * @param[in] S points to an instance of the Q15 LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_q31( + const arm_lms_instance_q31 * S, + q31_t * pSrc, + q31_t * pRef, + q31_t * pOut, + q31_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for Q31 LMS filter. + * @param[in] S points to an instance of the Q31 LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to coefficient buffer. + * @param[in] pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + */ + void arm_lms_init_q31( + arm_lms_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + q31_t mu, + uint32_t blockSize, + uint32_t postShift); + + + /** + * @brief Instance structure for the floating-point normalized LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + float32_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + float32_t mu; /**< step size that control filter coefficient updates. */ + float32_t energy; /**< saves previous frame energy. */ + float32_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_f32; + + + /** + * @brief Processing function for floating-point normalized LMS filter. + * @param[in] S points to an instance of the floating-point normalized LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_norm_f32( + arm_lms_norm_instance_f32 * S, + float32_t * pSrc, + float32_t * pRef, + float32_t * pOut, + float32_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for floating-point normalized LMS filter. + * @param[in] S points to an instance of the floating-point LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to coefficient buffer. + * @param[in] pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_norm_init_f32( + arm_lms_norm_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + float32_t mu, + uint32_t blockSize); + + + /** + * @brief Instance structure for the Q31 normalized LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + q31_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q31_t mu; /**< step size that controls filter coefficient updates. */ + uint8_t postShift; /**< bit shift applied to coefficients. */ + q31_t *recipTable; /**< points to the reciprocal initial value table. */ + q31_t energy; /**< saves previous frame energy. */ + q31_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_q31; + + + /** + * @brief Processing function for Q31 normalized LMS filter. + * @param[in] S points to an instance of the Q31 normalized LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_norm_q31( + arm_lms_norm_instance_q31 * S, + q31_t * pSrc, + q31_t * pRef, + q31_t * pOut, + q31_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for Q31 normalized LMS filter. + * @param[in] S points to an instance of the Q31 normalized LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to coefficient buffer. + * @param[in] pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + */ + void arm_lms_norm_init_q31( + arm_lms_norm_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + q31_t mu, + uint32_t blockSize, + uint8_t postShift); + + + /** + * @brief Instance structure for the Q15 normalized LMS filter. + */ + typedef struct + { + uint16_t numTaps; /**< Number of coefficients in the filter. */ + q15_t *pState; /**< points to the state variable array. The array is of length numTaps+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps. */ + q15_t mu; /**< step size that controls filter coefficient updates. */ + uint8_t postShift; /**< bit shift applied to coefficients. */ + q15_t *recipTable; /**< Points to the reciprocal initial value table. */ + q15_t energy; /**< saves previous frame energy. */ + q15_t x0; /**< saves previous input sample. */ + } arm_lms_norm_instance_q15; + + + /** + * @brief Processing function for Q15 normalized LMS filter. + * @param[in] S points to an instance of the Q15 normalized LMS filter structure. + * @param[in] pSrc points to the block of input data. + * @param[in] pRef points to the block of reference data. + * @param[out] pOut points to the block of output data. + * @param[out] pErr points to the block of error data. + * @param[in] blockSize number of samples to process. + */ + void arm_lms_norm_q15( + arm_lms_norm_instance_q15 * S, + q15_t * pSrc, + q15_t * pRef, + q15_t * pOut, + q15_t * pErr, + uint32_t blockSize); + + + /** + * @brief Initialization function for Q15 normalized LMS filter. + * @param[in] S points to an instance of the Q15 normalized LMS filter structure. + * @param[in] numTaps number of filter coefficients. + * @param[in] pCoeffs points to coefficient buffer. + * @param[in] pState points to state buffer. + * @param[in] mu step size that controls filter coefficient updates. + * @param[in] blockSize number of samples to process. + * @param[in] postShift bit shift applied to coefficients. + */ + void arm_lms_norm_init_q15( + arm_lms_norm_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + q15_t mu, + uint32_t blockSize, + uint8_t postShift); + + + /** + * @brief Correlation of floating-point sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + void arm_correlate_f32( + float32_t * pSrcA, + uint32_t srcALen, + float32_t * pSrcB, + uint32_t srcBLen, + float32_t * pDst); + + + /** + * @brief Correlation of Q15 sequences + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + */ + void arm_correlate_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + q15_t * pScratch); + + + /** + * @brief Correlation of Q15 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + + void arm_correlate_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + + /** + * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + + void arm_correlate_fast_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst); + + + /** + * @brief Correlation of Q15 sequences (fast version) for Cortex-M3 and Cortex-M4. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @param[in] pScratch points to scratch buffer of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + */ + void arm_correlate_fast_opt_q15( + q15_t * pSrcA, + uint32_t srcALen, + q15_t * pSrcB, + uint32_t srcBLen, + q15_t * pDst, + q15_t * pScratch); + + + /** + * @brief Correlation of Q31 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + void arm_correlate_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + + /** + * @brief Correlation of Q31 sequences (fast version) for Cortex-M3 and Cortex-M4 + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + void arm_correlate_fast_q31( + q31_t * pSrcA, + uint32_t srcALen, + q31_t * pSrcB, + uint32_t srcBLen, + q31_t * pDst); + + + /** + * @brief Correlation of Q7 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + * @param[in] pScratch1 points to scratch buffer(of type q15_t) of size max(srcALen, srcBLen) + 2*min(srcALen, srcBLen) - 2. + * @param[in] pScratch2 points to scratch buffer (of type q15_t) of size min(srcALen, srcBLen). + */ + void arm_correlate_opt_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst, + q15_t * pScratch1, + q15_t * pScratch2); + + + /** + * @brief Correlation of Q7 sequences. + * @param[in] pSrcA points to the first input sequence. + * @param[in] srcALen length of the first input sequence. + * @param[in] pSrcB points to the second input sequence. + * @param[in] srcBLen length of the second input sequence. + * @param[out] pDst points to the block of output data Length 2 * max(srcALen, srcBLen) - 1. + */ + void arm_correlate_q7( + q7_t * pSrcA, + uint32_t srcALen, + q7_t * pSrcB, + uint32_t srcBLen, + q7_t * pDst); + + + /** + * @brief Instance structure for the floating-point sparse FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + float32_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + float32_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_f32; + + /** + * @brief Instance structure for the Q31 sparse FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q31_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q31_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q31; + + /** + * @brief Instance structure for the Q15 sparse FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q15_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q15_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q15; + + /** + * @brief Instance structure for the Q7 sparse FIR filter. + */ + typedef struct + { + uint16_t numTaps; /**< number of coefficients in the filter. */ + uint16_t stateIndex; /**< state buffer index. Points to the oldest sample in the state buffer. */ + q7_t *pState; /**< points to the state buffer array. The array is of length maxDelay+blockSize-1. */ + q7_t *pCoeffs; /**< points to the coefficient array. The array is of length numTaps.*/ + uint16_t maxDelay; /**< maximum offset specified by the pTapDelay array. */ + int32_t *pTapDelay; /**< points to the array of delay values. The array is of length numTaps. */ + } arm_fir_sparse_instance_q7; + + + /** + * @brief Processing function for the floating-point sparse FIR filter. + * @param[in] S points to an instance of the floating-point sparse FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] pScratchIn points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_sparse_f32( + arm_fir_sparse_instance_f32 * S, + float32_t * pSrc, + float32_t * pDst, + float32_t * pScratchIn, + uint32_t blockSize); + + + /** + * @brief Initialization function for the floating-point sparse FIR filter. + * @param[in,out] S points to an instance of the floating-point sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] pCoeffs points to the array of filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + */ + void arm_fir_sparse_init_f32( + arm_fir_sparse_instance_f32 * S, + uint16_t numTaps, + float32_t * pCoeffs, + float32_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q31 sparse FIR filter. + * @param[in] S points to an instance of the Q31 sparse FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] pScratchIn points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_sparse_q31( + arm_fir_sparse_instance_q31 * S, + q31_t * pSrc, + q31_t * pDst, + q31_t * pScratchIn, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q31 sparse FIR filter. + * @param[in,out] S points to an instance of the Q31 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] pCoeffs points to the array of filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + */ + void arm_fir_sparse_init_q31( + arm_fir_sparse_instance_q31 * S, + uint16_t numTaps, + q31_t * pCoeffs, + q31_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q15 sparse FIR filter. + * @param[in] S points to an instance of the Q15 sparse FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] pScratchIn points to a temporary buffer of size blockSize. + * @param[in] pScratchOut points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_sparse_q15( + arm_fir_sparse_instance_q15 * S, + q15_t * pSrc, + q15_t * pDst, + q15_t * pScratchIn, + q31_t * pScratchOut, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q15 sparse FIR filter. + * @param[in,out] S points to an instance of the Q15 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] pCoeffs points to the array of filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + */ + void arm_fir_sparse_init_q15( + arm_fir_sparse_instance_q15 * S, + uint16_t numTaps, + q15_t * pCoeffs, + q15_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + + /** + * @brief Processing function for the Q7 sparse FIR filter. + * @param[in] S points to an instance of the Q7 sparse FIR structure. + * @param[in] pSrc points to the block of input data. + * @param[out] pDst points to the block of output data + * @param[in] pScratchIn points to a temporary buffer of size blockSize. + * @param[in] pScratchOut points to a temporary buffer of size blockSize. + * @param[in] blockSize number of input samples to process per call. + */ + void arm_fir_sparse_q7( + arm_fir_sparse_instance_q7 * S, + q7_t * pSrc, + q7_t * pDst, + q7_t * pScratchIn, + q31_t * pScratchOut, + uint32_t blockSize); + + + /** + * @brief Initialization function for the Q7 sparse FIR filter. + * @param[in,out] S points to an instance of the Q7 sparse FIR structure. + * @param[in] numTaps number of nonzero coefficients in the filter. + * @param[in] pCoeffs points to the array of filter coefficients. + * @param[in] pState points to the state buffer. + * @param[in] pTapDelay points to the array of offset times. + * @param[in] maxDelay maximum offset time supported. + * @param[in] blockSize number of samples that will be processed per block. + */ + void arm_fir_sparse_init_q7( + arm_fir_sparse_instance_q7 * S, + uint16_t numTaps, + q7_t * pCoeffs, + q7_t * pState, + int32_t * pTapDelay, + uint16_t maxDelay, + uint32_t blockSize); + + + /** + * @brief Floating-point sin_cos function. + * @param[in] theta input value in degrees + * @param[out] pSinVal points to the processed sine output. + * @param[out] pCosVal points to the processed cos output. + */ + void arm_sin_cos_f32( + float32_t theta, + float32_t * pSinVal, + float32_t * pCosVal); + + + /** + * @brief Q31 sin_cos function. + * @param[in] theta scaled input value in degrees + * @param[out] pSinVal points to the processed sine output. + * @param[out] pCosVal points to the processed cosine output. + */ + void arm_sin_cos_q31( + q31_t theta, + q31_t * pSinVal, + q31_t * pCosVal); + + + /** + * @brief Floating-point complex conjugate. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_conj_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + /** + * @brief Q31 complex conjugate. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_conj_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q15 complex conjugate. + * @param[in] pSrc points to the input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_conj_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + + /** + * @brief Floating-point complex magnitude squared + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_squared_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q31 complex magnitude squared + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_squared_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q15 complex magnitude squared + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_squared_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + + /** + * @ingroup groupController + */ + + /** + * @defgroup PID PID Motor Control + * + * A Proportional Integral Derivative (PID) controller is a generic feedback control + * loop mechanism widely used in industrial control systems. + * A PID controller is the most commonly used type of feedback controller. + * + * This set of functions implements (PID) controllers + * for Q15, Q31, and floating-point data types. The functions operate on a single sample + * of data and each call to the function returns a single processed value. + * S points to an instance of the PID control data structure. in + * is the input sample value. The functions return the output value. + * + * \par Algorithm: + *
+   *    y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2]
+   *    A0 = Kp + Ki + Kd
+   *    A1 = (-Kp ) - (2 * Kd )
+   *    A2 = Kd  
+ * + * \par + * where \c Kp is proportional constant, \c Ki is Integral constant and \c Kd is Derivative constant + * + * \par + * \image html PID.gif "Proportional Integral Derivative Controller" + * + * \par + * The PID controller calculates an "error" value as the difference between + * the measured output and the reference input. + * The controller attempts to minimize the error by adjusting the process control inputs. + * The proportional value determines the reaction to the current error, + * the integral value determines the reaction based on the sum of recent errors, + * and the derivative value determines the reaction based on the rate at which the error has been changing. + * + * \par Instance Structure + * The Gains A0, A1, A2 and state variables for a PID controller are stored together in an instance data structure. + * A separate instance structure must be defined for each PID Controller. + * There are separate instance structure declarations for each of the 3 supported data types. + * + * \par Reset Functions + * There is also an associated reset function for each data type which clears the state array. + * + * \par Initialization Functions + * There is also an associated initialization function for each data type. + * The initialization function performs the following operations: + * - Initializes the Gains A0, A1, A2 from Kp,Ki, Kd gains. + * - Zeros out the values in the state buffer. + * + * \par + * Instance structure cannot be placed into a const data section and it is recommended to use the initialization function. + * + * \par Fixed-Point Behavior + * Care must be taken when using the fixed-point versions of the PID Controller functions. + * In particular, the overflow and saturation behavior of the accumulator used in each function must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup PID + * @{ + */ + + /** + * @brief Process function for the floating-point PID Control. + * @param[in,out] S is an instance of the floating-point PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + */ + CMSIS_INLINE __STATIC_INLINE float32_t arm_pid_f32( + arm_pid_instance_f32 * S, + float32_t in) + { + float32_t out; + + /* y[n] = y[n-1] + A0 * x[n] + A1 * x[n-1] + A2 * x[n-2] */ + out = (S->A0 * in) + + (S->A1 * S->state[0]) + (S->A2 * S->state[1]) + (S->state[2]); + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + + } + + /** + * @brief Process function for the Q31 PID Control. + * @param[in,out] S points to an instance of the Q31 PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 64-bit accumulator. + * The accumulator has a 2.62 format and maintains full precision of the intermediate multiplication results but provides only a single guard bit. + * Thus, if the accumulator result overflows it wraps around rather than clip. + * In order to avoid overflows completely the input signal must be scaled down by 2 bits as there are four additions. + * After all multiply-accumulates are performed, the 2.62 accumulator is truncated to 1.32 format and then saturated to 1.31 format. + */ + CMSIS_INLINE __STATIC_INLINE q31_t arm_pid_q31( + arm_pid_instance_q31 * S, + q31_t in) + { + q63_t acc; + q31_t out; + + /* acc = A0 * x[n] */ + acc = (q63_t) S->A0 * in; + + /* acc += A1 * x[n-1] */ + acc += (q63_t) S->A1 * S->state[0]; + + /* acc += A2 * x[n-2] */ + acc += (q63_t) S->A2 * S->state[1]; + + /* convert output to 1.31 format to add y[n-1] */ + out = (q31_t) (acc >> 31u); + + /* out += y[n-1] */ + out += S->state[2]; + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + } + + + /** + * @brief Process function for the Q15 PID Control. + * @param[in,out] S points to an instance of the Q15 PID Control structure + * @param[in] in input sample to process + * @return out processed output sample. + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using a 64-bit internal accumulator. + * Both Gains and state variables are represented in 1.15 format and multiplications yield a 2.30 result. + * The 2.30 intermediate results are accumulated in a 64-bit accumulator in 34.30 format. + * There is no risk of internal overflow with this approach and the full precision of intermediate multiplications is preserved. + * After all additions have been performed, the accumulator is truncated to 34.15 format by discarding low 15 bits. + * Lastly, the accumulator is saturated to yield a result in 1.15 format. + */ + CMSIS_INLINE __STATIC_INLINE q15_t arm_pid_q15( + arm_pid_instance_q15 * S, + q15_t in) + { + q63_t acc; + q15_t out; + +#if defined (ARM_MATH_DSP) + __SIMD32_TYPE *vstate; + + /* Implementation of PID controller */ + + /* acc = A0 * x[n] */ + acc = (q31_t) __SMUAD((uint32_t)S->A0, (uint32_t)in); + + /* acc += A1 * x[n-1] + A2 * x[n-2] */ + vstate = __SIMD32_CONST(S->state); + acc = (q63_t)__SMLALD((uint32_t)S->A1, (uint32_t)*vstate, (uint64_t)acc); +#else + /* acc = A0 * x[n] */ + acc = ((q31_t) S->A0) * in; + + /* acc += A1 * x[n-1] + A2 * x[n-2] */ + acc += (q31_t) S->A1 * S->state[0]; + acc += (q31_t) S->A2 * S->state[1]; +#endif + + /* acc += y[n-1] */ + acc += (q31_t) S->state[2] << 15; + + /* saturate the output */ + out = (q15_t) (__SSAT((acc >> 15), 16)); + + /* Update state */ + S->state[1] = S->state[0]; + S->state[0] = in; + S->state[2] = out; + + /* return to application */ + return (out); + } + + /** + * @} end of PID group + */ + + + /** + * @brief Floating-point matrix inverse. + * @param[in] src points to the instance of the input floating-point matrix structure. + * @param[out] dst points to the instance of the output floating-point matrix structure. + * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. + * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. + */ + arm_status arm_mat_inverse_f32( + const arm_matrix_instance_f32 * src, + arm_matrix_instance_f32 * dst); + + + /** + * @brief Floating-point matrix inverse. + * @param[in] src points to the instance of the input floating-point matrix structure. + * @param[out] dst points to the instance of the output floating-point matrix structure. + * @return The function returns ARM_MATH_SIZE_MISMATCH, if the dimensions do not match. + * If the input matrix is singular (does not have an inverse), then the algorithm terminates and returns error status ARM_MATH_SINGULAR. + */ + arm_status arm_mat_inverse_f64( + const arm_matrix_instance_f64 * src, + arm_matrix_instance_f64 * dst); + + + + /** + * @ingroup groupController + */ + + /** + * @defgroup clarke Vector Clarke Transform + * Forward Clarke transform converts the instantaneous stator phases into a two-coordinate time invariant vector. + * Generally the Clarke transform uses three-phase currents Ia, Ib and Ic to calculate currents + * in the two-phase orthogonal stator axis Ialpha and Ibeta. + * When Ialpha is superposed with Ia as shown in the figure below + * \image html clarke.gif Stator current space vector and its components in (a,b). + * and Ia + Ib + Ic = 0, in this condition Ialpha and Ibeta + * can be calculated using only Ia and Ib. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html clarkeFormula.gif + * where Ia and Ib are the instantaneous stator phases and + * pIalpha and pIbeta are the two coordinates of time invariant vector. + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Clarke transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup clarke + * @{ + */ + + /** + * + * @brief Floating-point Clarke transform + * @param[in] Ia input three-phase coordinate a + * @param[in] Ib input three-phase coordinate b + * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] pIbeta points to output two-phase orthogonal vector axis beta + */ + CMSIS_INLINE __STATIC_INLINE void arm_clarke_f32( + float32_t Ia, + float32_t Ib, + float32_t * pIalpha, + float32_t * pIbeta) + { + /* Calculate pIalpha using the equation, pIalpha = Ia */ + *pIalpha = Ia; + + /* Calculate pIbeta using the equation, pIbeta = (1/sqrt(3)) * Ia + (2/sqrt(3)) * Ib */ + *pIbeta = ((float32_t) 0.57735026919 * Ia + (float32_t) 1.15470053838 * Ib); + } + + + /** + * @brief Clarke transform for Q31 version + * @param[in] Ia input three-phase coordinate a + * @param[in] Ib input three-phase coordinate b + * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] pIbeta points to output two-phase orthogonal vector axis beta + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition, hence there is no risk of overflow. + */ + CMSIS_INLINE __STATIC_INLINE void arm_clarke_q31( + q31_t Ia, + q31_t Ib, + q31_t * pIalpha, + q31_t * pIbeta) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + + /* Calculating pIalpha from Ia by equation pIalpha = Ia */ + *pIalpha = Ia; + + /* Intermediate product is calculated by (1/(sqrt(3)) * Ia) */ + product1 = (q31_t) (((q63_t) Ia * 0x24F34E8B) >> 30); + + /* Intermediate product is calculated by (2/sqrt(3) * Ib) */ + product2 = (q31_t) (((q63_t) Ib * 0x49E69D16) >> 30); + + /* pIbeta is calculated by adding the intermediate products */ + *pIbeta = __QADD(product1, product2); + } + + /** + * @} end of clarke group + */ + + /** + * @brief Converts the elements of the Q7 vector to Q31 vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_q7_to_q31( + q7_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + + /** + * @ingroup groupController + */ + + /** + * @defgroup inv_clarke Vector Inverse Clarke Transform + * Inverse Clarke transform converts the two-coordinate time invariant vector into instantaneous stator phases. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html clarkeInvFormula.gif + * where pIa and pIb are the instantaneous stator phases and + * Ialpha and Ibeta are the two coordinates of time invariant vector. + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Clarke transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup inv_clarke + * @{ + */ + + /** + * @brief Floating-point Inverse Clarke transform + * @param[in] Ialpha input two-phase orthogonal vector axis alpha + * @param[in] Ibeta input two-phase orthogonal vector axis beta + * @param[out] pIa points to output three-phase coordinate a + * @param[out] pIb points to output three-phase coordinate b + */ + CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_f32( + float32_t Ialpha, + float32_t Ibeta, + float32_t * pIa, + float32_t * pIb) + { + /* Calculating pIa from Ialpha by equation pIa = Ialpha */ + *pIa = Ialpha; + + /* Calculating pIb from Ialpha and Ibeta by equation pIb = -(1/2) * Ialpha + (sqrt(3)/2) * Ibeta */ + *pIb = -0.5f * Ialpha + 0.8660254039f * Ibeta; + } + + + /** + * @brief Inverse Clarke transform for Q31 version + * @param[in] Ialpha input two-phase orthogonal vector axis alpha + * @param[in] Ibeta input two-phase orthogonal vector axis beta + * @param[out] pIa points to output three-phase coordinate a + * @param[out] pIb points to output three-phase coordinate b + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the subtraction, hence there is no risk of overflow. + */ + CMSIS_INLINE __STATIC_INLINE void arm_inv_clarke_q31( + q31_t Ialpha, + q31_t Ibeta, + q31_t * pIa, + q31_t * pIb) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + + /* Calculating pIa from Ialpha by equation pIa = Ialpha */ + *pIa = Ialpha; + + /* Intermediate product is calculated by (1/(2*sqrt(3)) * Ia) */ + product1 = (q31_t) (((q63_t) (Ialpha) * (0x40000000)) >> 31); + + /* Intermediate product is calculated by (1/sqrt(3) * pIb) */ + product2 = (q31_t) (((q63_t) (Ibeta) * (0x6ED9EBA1)) >> 31); + + /* pIb is calculated by subtracting the products */ + *pIb = __QSUB(product2, product1); + } + + /** + * @} end of inv_clarke group + */ + + /** + * @brief Converts the elements of the Q7 vector to Q15 vector. + * @param[in] pSrc input pointer + * @param[out] pDst output pointer + * @param[in] blockSize number of samples to process + */ + void arm_q7_to_q15( + q7_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + + /** + * @ingroup groupController + */ + + /** + * @defgroup park Vector Park Transform + * + * Forward Park transform converts the input two-coordinate vector to flux and torque components. + * The Park transform can be used to realize the transformation of the Ialpha and the Ibeta currents + * from the stationary to the moving reference frame and control the spatial relationship between + * the stator vector current and rotor flux vector. + * If we consider the d axis aligned with the rotor flux, the diagram below shows the + * current vector and the relationship from the two reference frames: + * \image html park.gif "Stator current space vector and its component in (a,b) and in the d,q rotating reference frame" + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html parkFormula.gif + * where Ialpha and Ibeta are the stator vector components, + * pId and pIq are rotor vector components and cosVal and sinVal are the + * cosine and sine values of theta (rotor flux position). + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Park transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup park + * @{ + */ + + /** + * @brief Floating-point Park transform + * @param[in] Ialpha input two-phase vector coordinate alpha + * @param[in] Ibeta input two-phase vector coordinate beta + * @param[out] pId points to output rotor reference frame d + * @param[out] pIq points to output rotor reference frame q + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * + * The function implements the forward Park transform. + * + */ + CMSIS_INLINE __STATIC_INLINE void arm_park_f32( + float32_t Ialpha, + float32_t Ibeta, + float32_t * pId, + float32_t * pIq, + float32_t sinVal, + float32_t cosVal) + { + /* Calculate pId using the equation, pId = Ialpha * cosVal + Ibeta * sinVal */ + *pId = Ialpha * cosVal + Ibeta * sinVal; + + /* Calculate pIq using the equation, pIq = - Ialpha * sinVal + Ibeta * cosVal */ + *pIq = -Ialpha * sinVal + Ibeta * cosVal; + } + + + /** + * @brief Park transform for Q31 version + * @param[in] Ialpha input two-phase vector coordinate alpha + * @param[in] Ibeta input two-phase vector coordinate beta + * @param[out] pId points to output rotor reference frame d + * @param[out] pIq points to output rotor reference frame q + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition and subtraction, hence there is no risk of overflow. + */ + CMSIS_INLINE __STATIC_INLINE void arm_park_q31( + q31_t Ialpha, + q31_t Ibeta, + q31_t * pId, + q31_t * pIq, + q31_t sinVal, + q31_t cosVal) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + q31_t product3, product4; /* Temporary variables used to store intermediate results */ + + /* Intermediate product is calculated by (Ialpha * cosVal) */ + product1 = (q31_t) (((q63_t) (Ialpha) * (cosVal)) >> 31); + + /* Intermediate product is calculated by (Ibeta * sinVal) */ + product2 = (q31_t) (((q63_t) (Ibeta) * (sinVal)) >> 31); + + + /* Intermediate product is calculated by (Ialpha * sinVal) */ + product3 = (q31_t) (((q63_t) (Ialpha) * (sinVal)) >> 31); + + /* Intermediate product is calculated by (Ibeta * cosVal) */ + product4 = (q31_t) (((q63_t) (Ibeta) * (cosVal)) >> 31); + + /* Calculate pId by adding the two intermediate products 1 and 2 */ + *pId = __QADD(product1, product2); + + /* Calculate pIq by subtracting the two intermediate products 3 from 4 */ + *pIq = __QSUB(product4, product3); + } + + /** + * @} end of park group + */ + + /** + * @brief Converts the elements of the Q7 vector to floating-point vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q7_to_float( + q7_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @ingroup groupController + */ + + /** + * @defgroup inv_park Vector Inverse Park transform + * Inverse Park transform converts the input flux and torque components to two-coordinate vector. + * + * The function operates on a single sample of data and each call to the function returns the processed output. + * The library provides separate functions for Q31 and floating-point data types. + * \par Algorithm + * \image html parkInvFormula.gif + * where pIalpha and pIbeta are the stator vector components, + * Id and Iq are rotor vector components and cosVal and sinVal are the + * cosine and sine values of theta (rotor flux position). + * \par Fixed-Point Behavior + * Care must be taken when using the Q31 version of the Park transform. + * In particular, the overflow and saturation behavior of the accumulator used must be considered. + * Refer to the function specific documentation below for usage guidelines. + */ + + /** + * @addtogroup inv_park + * @{ + */ + + /** + * @brief Floating-point Inverse Park transform + * @param[in] Id input coordinate of rotor reference frame d + * @param[in] Iq input coordinate of rotor reference frame q + * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] pIbeta points to output two-phase orthogonal vector axis beta + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + */ + CMSIS_INLINE __STATIC_INLINE void arm_inv_park_f32( + float32_t Id, + float32_t Iq, + float32_t * pIalpha, + float32_t * pIbeta, + float32_t sinVal, + float32_t cosVal) + { + /* Calculate pIalpha using the equation, pIalpha = Id * cosVal - Iq * sinVal */ + *pIalpha = Id * cosVal - Iq * sinVal; + + /* Calculate pIbeta using the equation, pIbeta = Id * sinVal + Iq * cosVal */ + *pIbeta = Id * sinVal + Iq * cosVal; + } + + + /** + * @brief Inverse Park transform for Q31 version + * @param[in] Id input coordinate of rotor reference frame d + * @param[in] Iq input coordinate of rotor reference frame q + * @param[out] pIalpha points to output two-phase orthogonal vector axis alpha + * @param[out] pIbeta points to output two-phase orthogonal vector axis beta + * @param[in] sinVal sine value of rotation angle theta + * @param[in] cosVal cosine value of rotation angle theta + * + * Scaling and Overflow Behavior: + * \par + * The function is implemented using an internal 32-bit accumulator. + * The accumulator maintains 1.31 format by truncating lower 31 bits of the intermediate multiplication in 2.62 format. + * There is saturation on the addition, hence there is no risk of overflow. + */ + CMSIS_INLINE __STATIC_INLINE void arm_inv_park_q31( + q31_t Id, + q31_t Iq, + q31_t * pIalpha, + q31_t * pIbeta, + q31_t sinVal, + q31_t cosVal) + { + q31_t product1, product2; /* Temporary variables used to store intermediate results */ + q31_t product3, product4; /* Temporary variables used to store intermediate results */ + + /* Intermediate product is calculated by (Id * cosVal) */ + product1 = (q31_t) (((q63_t) (Id) * (cosVal)) >> 31); + + /* Intermediate product is calculated by (Iq * sinVal) */ + product2 = (q31_t) (((q63_t) (Iq) * (sinVal)) >> 31); + + + /* Intermediate product is calculated by (Id * sinVal) */ + product3 = (q31_t) (((q63_t) (Id) * (sinVal)) >> 31); + + /* Intermediate product is calculated by (Iq * cosVal) */ + product4 = (q31_t) (((q63_t) (Iq) * (cosVal)) >> 31); + + /* Calculate pIalpha by using the two intermediate products 1 and 2 */ + *pIalpha = __QSUB(product1, product2); + + /* Calculate pIbeta by using the two intermediate products 3 and 4 */ + *pIbeta = __QADD(product4, product3); + } + + /** + * @} end of Inverse park group + */ + + + /** + * @brief Converts the elements of the Q31 vector to floating-point vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q31_to_float( + q31_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + /** + * @ingroup groupInterpolation + */ + + /** + * @defgroup LinearInterpolate Linear Interpolation + * + * Linear interpolation is a method of curve fitting using linear polynomials. + * Linear interpolation works by effectively drawing a straight line between two neighboring samples and returning the appropriate point along that line + * + * \par + * \image html LinearInterp.gif "Linear interpolation" + * + * \par + * A Linear Interpolate function calculates an output value(y), for the input(x) + * using linear interpolation of the input values x0, x1( nearest input values) and the output values y0 and y1(nearest output values) + * + * \par Algorithm: + *
+   *       y = y0 + (x - x0) * ((y1 - y0)/(x1-x0))
+   *       where x0, x1 are nearest values of input x
+   *             y0, y1 are nearest values to output y
+   * 
+ * + * \par + * This set of functions implements Linear interpolation process + * for Q7, Q15, Q31, and floating-point data types. The functions operate on a single + * sample of data and each call to the function returns a single processed value. + * S points to an instance of the Linear Interpolate function data structure. + * x is the input sample value. The functions returns the output value. + * + * \par + * if x is outside of the table boundary, Linear interpolation returns first value of the table + * if x is below input range and returns last value of table if x is above range. + */ + + /** + * @addtogroup LinearInterpolate + * @{ + */ + + /** + * @brief Process function for the floating-point Linear Interpolation Function. + * @param[in,out] S is an instance of the floating-point Linear Interpolation structure + * @param[in] x input sample to process + * @return y processed output sample. + * + */ + CMSIS_INLINE __STATIC_INLINE float32_t arm_linear_interp_f32( + arm_linear_interp_instance_f32 * S, + float32_t x) + { + float32_t y; + float32_t x0, x1; /* Nearest input values */ + float32_t y0, y1; /* Nearest output values */ + float32_t xSpacing = S->xSpacing; /* spacing between input values */ + int32_t i; /* Index variable */ + float32_t *pYData = S->pYData; /* pointer to output table */ + + /* Calculation of index */ + i = (int32_t) ((x - S->x1) / xSpacing); + + if (i < 0) + { + /* Iniatilize output for below specified range as least output value of table */ + y = pYData[0]; + } + else if ((uint32_t)i >= S->nValues) + { + /* Iniatilize output for above specified range as last output value of table */ + y = pYData[S->nValues - 1]; + } + else + { + /* Calculation of nearest input values */ + x0 = S->x1 + i * xSpacing; + x1 = S->x1 + (i + 1) * xSpacing; + + /* Read of nearest output values */ + y0 = pYData[i]; + y1 = pYData[i + 1]; + + /* Calculation of output */ + y = y0 + (x - x0) * ((y1 - y0) / (x1 - x0)); + + } + + /* returns output value */ + return (y); + } + + + /** + * + * @brief Process function for the Q31 Linear Interpolation Function. + * @param[in] pYData pointer to Q31 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + * + */ + CMSIS_INLINE __STATIC_INLINE q31_t arm_linear_interp_q31( + q31_t * pYData, + q31_t x, + uint32_t nValues) + { + q31_t y; /* output */ + q31_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + int32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + index = ((x & (q31_t)0xFFF00000) >> 20); + + if (index >= (int32_t)(nValues - 1)) + { + return (pYData[nValues - 1]); + } + else if (index < 0) + { + return (pYData[0]); + } + else + { + /* 20 bits for the fractional part */ + /* shift left by 11 to keep fract in 1.31 format */ + fract = (x & 0x000FFFFF) << 11; + + /* Read two nearest output values from the index in 1.31(q31) format */ + y0 = pYData[index]; + y1 = pYData[index + 1]; + + /* Calculation of y0 * (1-fract) and y is in 2.30 format */ + y = ((q31_t) ((q63_t) y0 * (0x7FFFFFFF - fract) >> 32)); + + /* Calculation of y0 * (1-fract) + y1 *fract and y is in 2.30 format */ + y += ((q31_t) (((q63_t) y1 * fract) >> 32)); + + /* Convert y to 1.31 format */ + return (y << 1u); + } + } + + + /** + * + * @brief Process function for the Q15 Linear Interpolation Function. + * @param[in] pYData pointer to Q15 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + * + */ + CMSIS_INLINE __STATIC_INLINE q15_t arm_linear_interp_q15( + q15_t * pYData, + q31_t x, + uint32_t nValues) + { + q63_t y; /* output */ + q15_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + int32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + index = ((x & (int32_t)0xFFF00000) >> 20); + + if (index >= (int32_t)(nValues - 1)) + { + return (pYData[nValues - 1]); + } + else if (index < 0) + { + return (pYData[0]); + } + else + { + /* 20 bits for the fractional part */ + /* fract is in 12.20 format */ + fract = (x & 0x000FFFFF); + + /* Read two nearest output values from the index */ + y0 = pYData[index]; + y1 = pYData[index + 1]; + + /* Calculation of y0 * (1-fract) and y is in 13.35 format */ + y = ((q63_t) y0 * (0xFFFFF - fract)); + + /* Calculation of (y0 * (1-fract) + y1 * fract) and y is in 13.35 format */ + y += ((q63_t) y1 * (fract)); + + /* convert y to 1.15 format */ + return (q15_t) (y >> 20); + } + } + + + /** + * + * @brief Process function for the Q7 Linear Interpolation Function. + * @param[in] pYData pointer to Q7 Linear Interpolation table + * @param[in] x input sample to process + * @param[in] nValues number of table values + * @return y processed output sample. + * + * \par + * Input sample x is in 12.20 format which contains 12 bits for table index and 20 bits for fractional part. + * This function can support maximum of table size 2^12. + */ + CMSIS_INLINE __STATIC_INLINE q7_t arm_linear_interp_q7( + q7_t * pYData, + q31_t x, + uint32_t nValues) + { + q31_t y; /* output */ + q7_t y0, y1; /* Nearest output values */ + q31_t fract; /* fractional part */ + uint32_t index; /* Index to read nearest output values */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + if (x < 0) + { + return (pYData[0]); + } + index = (x >> 20) & 0xfff; + + if (index >= (nValues - 1)) + { + return (pYData[nValues - 1]); + } + else + { + /* 20 bits for the fractional part */ + /* fract is in 12.20 format */ + fract = (x & 0x000FFFFF); + + /* Read two nearest output values from the index and are in 1.7(q7) format */ + y0 = pYData[index]; + y1 = pYData[index + 1]; + + /* Calculation of y0 * (1-fract ) and y is in 13.27(q27) format */ + y = ((y0 * (0xFFFFF - fract))); + + /* Calculation of y1 * fract + y0 * (1-fract) and y is in 13.27(q27) format */ + y += (y1 * fract); + + /* convert y to 1.7(q7) format */ + return (q7_t) (y >> 20); + } + } + + /** + * @} end of LinearInterpolate group + */ + + /** + * @brief Fast approximation to the trigonometric sine function for floating-point data. + * @param[in] x input value in radians. + * @return sin(x). + */ + float32_t arm_sin_f32( + float32_t x); + + + /** + * @brief Fast approximation to the trigonometric sine function for Q31 data. + * @param[in] x Scaled input value in radians. + * @return sin(x). + */ + q31_t arm_sin_q31( + q31_t x); + + + /** + * @brief Fast approximation to the trigonometric sine function for Q15 data. + * @param[in] x Scaled input value in radians. + * @return sin(x). + */ + q15_t arm_sin_q15( + q15_t x); + + + /** + * @brief Fast approximation to the trigonometric cosine function for floating-point data. + * @param[in] x input value in radians. + * @return cos(x). + */ + float32_t arm_cos_f32( + float32_t x); + + + /** + * @brief Fast approximation to the trigonometric cosine function for Q31 data. + * @param[in] x Scaled input value in radians. + * @return cos(x). + */ + q31_t arm_cos_q31( + q31_t x); + + + /** + * @brief Fast approximation to the trigonometric cosine function for Q15 data. + * @param[in] x Scaled input value in radians. + * @return cos(x). + */ + q15_t arm_cos_q15( + q15_t x); + + + /** + * @ingroup groupFastMath + */ + + + /** + * @defgroup SQRT Square Root + * + * Computes the square root of a number. + * There are separate functions for Q15, Q31, and floating-point data types. + * The square root function is computed using the Newton-Raphson algorithm. + * This is an iterative algorithm of the form: + *
+   *      x1 = x0 - f(x0)/f'(x0)
+   * 
+ * where x1 is the current estimate, + * x0 is the previous estimate, and + * f'(x0) is the derivative of f() evaluated at x0. + * For the square root function, the algorithm reduces to: + *
+   *     x0 = in/2                         [initial guess]
+   *     x1 = 1/2 * ( x0 + in / x0)        [each iteration]
+   * 
+ */ + + + /** + * @addtogroup SQRT + * @{ + */ + + /** + * @brief Floating-point square root function. + * @param[in] in input value. + * @param[out] pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + CMSIS_INLINE __STATIC_INLINE arm_status arm_sqrt_f32( + float32_t in, + float32_t * pOut) + { + if (in >= 0.0f) + { + +#if (__FPU_USED == 1) && defined ( __CC_ARM ) + *pOut = __sqrtf(in); +#elif (__FPU_USED == 1) && (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) + *pOut = __builtin_sqrtf(in); +#elif (__FPU_USED == 1) && defined(__GNUC__) + *pOut = __builtin_sqrtf(in); +#elif (__FPU_USED == 1) && defined ( __ICCARM__ ) && (__VER__ >= 6040000) + __ASM("VSQRT.F32 %0,%1" : "=t"(*pOut) : "t"(in)); +#else + *pOut = sqrtf(in); +#endif + + return (ARM_MATH_SUCCESS); + } + else + { + *pOut = 0.0f; + return (ARM_MATH_ARGUMENT_ERROR); + } + } + + + /** + * @brief Q31 square root function. + * @param[in] in input value. The range of the input value is [0 +1) or 0x00000000 to 0x7FFFFFFF. + * @param[out] pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + arm_status arm_sqrt_q31( + q31_t in, + q31_t * pOut); + + + /** + * @brief Q15 square root function. + * @param[in] in input value. The range of the input value is [0 +1) or 0x0000 to 0x7FFF. + * @param[out] pOut square root of input value. + * @return The function returns ARM_MATH_SUCCESS if input value is positive value or ARM_MATH_ARGUMENT_ERROR if + * in is negative value and returns zero output for negative values. + */ + arm_status arm_sqrt_q15( + q15_t in, + q15_t * pOut); + + /** + * @} end of SQRT group + */ + + + /** + * @brief floating-point Circular write function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_f32( + int32_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const int32_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if (wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = (uint16_t)wOffset; + } + + + + /** + * @brief floating-point Circular Read function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularRead_f32( + int32_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + int32_t * dst, + int32_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if (dst == (int32_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update rOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if (rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + + /** + * @brief Q15 Circular write function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q15( + q15_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const q15_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if (wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = (uint16_t)wOffset; + } + + + /** + * @brief Q15 Circular Read function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q15( + q15_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + q15_t * dst, + q15_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if (dst == (q15_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update wOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if (rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + + /** + * @brief Q7 Circular write function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularWrite_q7( + q7_t * circBuffer, + int32_t L, + uint16_t * writeOffset, + int32_t bufferInc, + const q7_t * src, + int32_t srcInc, + uint32_t blockSize) + { + uint32_t i = 0u; + int32_t wOffset; + + /* Copy the value of Index pointer that points + * to the current location where the input samples to be copied */ + wOffset = *writeOffset; + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the input sample to the circular buffer */ + circBuffer[wOffset] = *src; + + /* Update the input pointer */ + src += srcInc; + + /* Circularly update wOffset. Watch out for positive and negative value */ + wOffset += bufferInc; + if (wOffset >= L) + wOffset -= L; + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *writeOffset = (uint16_t)wOffset; + } + + + /** + * @brief Q7 Circular Read function. + */ + CMSIS_INLINE __STATIC_INLINE void arm_circularRead_q7( + q7_t * circBuffer, + int32_t L, + int32_t * readOffset, + int32_t bufferInc, + q7_t * dst, + q7_t * dst_base, + int32_t dst_length, + int32_t dstInc, + uint32_t blockSize) + { + uint32_t i = 0; + int32_t rOffset, dst_end; + + /* Copy the value of Index pointer that points + * to the current location from where the input samples to be read */ + rOffset = *readOffset; + + dst_end = (int32_t) (dst_base + dst_length); + + /* Loop over the blockSize */ + i = blockSize; + + while (i > 0u) + { + /* copy the sample from the circular buffer to the destination buffer */ + *dst = circBuffer[rOffset]; + + /* Update the input pointer */ + dst += dstInc; + + if (dst == (q7_t *) dst_end) + { + dst = dst_base; + } + + /* Circularly update rOffset. Watch out for positive and negative value */ + rOffset += bufferInc; + + if (rOffset >= L) + { + rOffset -= L; + } + + /* Decrement the loop counter */ + i--; + } + + /* Update the index pointer */ + *readOffset = rOffset; + } + + + /** + * @brief Sum of the squares of the elements of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_power_q31( + q31_t * pSrc, + uint32_t blockSize, + q63_t * pResult); + + + /** + * @brief Sum of the squares of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_power_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Sum of the squares of the elements of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_power_q15( + q15_t * pSrc, + uint32_t blockSize, + q63_t * pResult); + + + /** + * @brief Sum of the squares of the elements of a Q7 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_power_q7( + q7_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + + /** + * @brief Mean value of a Q7 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_mean_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult); + + + /** + * @brief Mean value of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_mean_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + + /** + * @brief Mean value of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_mean_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + + /** + * @brief Mean value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_mean_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Variance of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_var_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Variance of the elements of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_var_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + + /** + * @brief Variance of the elements of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_var_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + + /** + * @brief Root Mean Square of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_rms_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Root Mean Square of the elements of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_rms_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + + /** + * @brief Root Mean Square of the elements of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_rms_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + + /** + * @brief Standard deviation of the elements of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_std_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult); + + + /** + * @brief Standard deviation of the elements of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_std_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult); + + + /** + * @brief Standard deviation of the elements of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output value. + */ + void arm_std_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult); + + + /** + * @brief Floating-point complex magnitude + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_f32( + float32_t * pSrc, + float32_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q31 complex magnitude + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_q31( + q31_t * pSrc, + q31_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q15 complex magnitude + * @param[in] pSrc points to the complex input vector + * @param[out] pDst points to the real output vector + * @param[in] numSamples number of complex samples in the input vector + */ + void arm_cmplx_mag_q15( + q15_t * pSrc, + q15_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q15 complex dot product + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] realResult real part of the result returned here + * @param[out] imagResult imaginary part of the result returned here + */ + void arm_cmplx_dot_prod_q15( + q15_t * pSrcA, + q15_t * pSrcB, + uint32_t numSamples, + q31_t * realResult, + q31_t * imagResult); + + + /** + * @brief Q31 complex dot product + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] realResult real part of the result returned here + * @param[out] imagResult imaginary part of the result returned here + */ + void arm_cmplx_dot_prod_q31( + q31_t * pSrcA, + q31_t * pSrcB, + uint32_t numSamples, + q63_t * realResult, + q63_t * imagResult); + + + /** + * @brief Floating-point complex dot product + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[in] numSamples number of complex samples in each vector + * @param[out] realResult real part of the result returned here + * @param[out] imagResult imaginary part of the result returned here + */ + void arm_cmplx_dot_prod_f32( + float32_t * pSrcA, + float32_t * pSrcB, + uint32_t numSamples, + float32_t * realResult, + float32_t * imagResult); + + + /** + * @brief Q15 complex-by-real multiplication + * @param[in] pSrcCmplx points to the complex input vector + * @param[in] pSrcReal points to the real input vector + * @param[out] pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + */ + void arm_cmplx_mult_real_q15( + q15_t * pSrcCmplx, + q15_t * pSrcReal, + q15_t * pCmplxDst, + uint32_t numSamples); + + + /** + * @brief Q31 complex-by-real multiplication + * @param[in] pSrcCmplx points to the complex input vector + * @param[in] pSrcReal points to the real input vector + * @param[out] pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + */ + void arm_cmplx_mult_real_q31( + q31_t * pSrcCmplx, + q31_t * pSrcReal, + q31_t * pCmplxDst, + uint32_t numSamples); + + + /** + * @brief Floating-point complex-by-real multiplication + * @param[in] pSrcCmplx points to the complex input vector + * @param[in] pSrcReal points to the real input vector + * @param[out] pCmplxDst points to the complex output vector + * @param[in] numSamples number of samples in each vector + */ + void arm_cmplx_mult_real_f32( + float32_t * pSrcCmplx, + float32_t * pSrcReal, + float32_t * pCmplxDst, + uint32_t numSamples); + + + /** + * @brief Minimum value of a Q7 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] result is output pointer + * @param[in] index is the array index of the minimum value in the input buffer. + */ + void arm_min_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * result, + uint32_t * index); + + + /** + * @brief Minimum value of a Q15 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[in] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_min_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + + + /** + * @brief Minimum value of a Q31 vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_min_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + + + /** + * @brief Minimum value of a floating-point vector. + * @param[in] pSrc is input pointer + * @param[in] blockSize is the number of samples to process + * @param[out] pResult is output pointer + * @param[out] pIndex is the array index of the minimum value in the input buffer. + */ + void arm_min_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + + +/** + * @brief Maximum value of a Q7 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_max_q7( + q7_t * pSrc, + uint32_t blockSize, + q7_t * pResult, + uint32_t * pIndex); + + +/** + * @brief Maximum value of a Q15 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_max_q15( + q15_t * pSrc, + uint32_t blockSize, + q15_t * pResult, + uint32_t * pIndex); + + +/** + * @brief Maximum value of a Q31 vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_max_q31( + q31_t * pSrc, + uint32_t blockSize, + q31_t * pResult, + uint32_t * pIndex); + + +/** + * @brief Maximum value of a floating-point vector. + * @param[in] pSrc points to the input buffer + * @param[in] blockSize length of the input vector + * @param[out] pResult maximum value returned here + * @param[out] pIndex index of maximum value returned here + */ + void arm_max_f32( + float32_t * pSrc, + uint32_t blockSize, + float32_t * pResult, + uint32_t * pIndex); + + + /** + * @brief Q15 complex-by-complex multiplication + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_mult_cmplx_q15( + q15_t * pSrcA, + q15_t * pSrcB, + q15_t * pDst, + uint32_t numSamples); + + + /** + * @brief Q31 complex-by-complex multiplication + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_mult_cmplx_q31( + q31_t * pSrcA, + q31_t * pSrcB, + q31_t * pDst, + uint32_t numSamples); + + + /** + * @brief Floating-point complex-by-complex multiplication + * @param[in] pSrcA points to the first input vector + * @param[in] pSrcB points to the second input vector + * @param[out] pDst points to the output vector + * @param[in] numSamples number of complex samples in each vector + */ + void arm_cmplx_mult_cmplx_f32( + float32_t * pSrcA, + float32_t * pSrcB, + float32_t * pDst, + uint32_t numSamples); + + + /** + * @brief Converts the elements of the floating-point vector to Q31 vector. + * @param[in] pSrc points to the floating-point input vector + * @param[out] pDst points to the Q31 output vector + * @param[in] blockSize length of the input vector + */ + void arm_float_to_q31( + float32_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the floating-point vector to Q15 vector. + * @param[in] pSrc points to the floating-point input vector + * @param[out] pDst points to the Q15 output vector + * @param[in] blockSize length of the input vector + */ + void arm_float_to_q15( + float32_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the floating-point vector to Q7 vector. + * @param[in] pSrc points to the floating-point input vector + * @param[out] pDst points to the Q7 output vector + * @param[in] blockSize length of the input vector + */ + void arm_float_to_q7( + float32_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q31 vector to Q15 vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q31_to_q15( + q31_t * pSrc, + q15_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q31 vector to Q7 vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q31_to_q7( + q31_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q15 vector to floating-point vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q15_to_float( + q15_t * pSrc, + float32_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q15 vector to Q31 vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q15_to_q31( + q15_t * pSrc, + q31_t * pDst, + uint32_t blockSize); + + + /** + * @brief Converts the elements of the Q15 vector to Q7 vector. + * @param[in] pSrc is input pointer + * @param[out] pDst is output pointer + * @param[in] blockSize is the number of samples to process + */ + void arm_q15_to_q7( + q15_t * pSrc, + q7_t * pDst, + uint32_t blockSize); + + + /** + * @ingroup groupInterpolation + */ + + /** + * @defgroup BilinearInterpolate Bilinear Interpolation + * + * Bilinear interpolation is an extension of linear interpolation applied to a two dimensional grid. + * The underlying function f(x, y) is sampled on a regular grid and the interpolation process + * determines values between the grid points. + * Bilinear interpolation is equivalent to two step linear interpolation, first in the x-dimension and then in the y-dimension. + * Bilinear interpolation is often used in image processing to rescale images. + * The CMSIS DSP library provides bilinear interpolation functions for Q7, Q15, Q31, and floating-point data types. + * + * Algorithm + * \par + * The instance structure used by the bilinear interpolation functions describes a two dimensional data table. + * For floating-point, the instance structure is defined as: + *
+   *   typedef struct
+   *   {
+   *     uint16_t numRows;
+   *     uint16_t numCols;
+   *     float32_t *pData;
+   * } arm_bilinear_interp_instance_f32;
+   * 
+ * + * \par + * where numRows specifies the number of rows in the table; + * numCols specifies the number of columns in the table; + * and pData points to an array of size numRows*numCols values. + * The data table pTable is organized in row order and the supplied data values fall on integer indexes. + * That is, table element (x,y) is located at pTable[x + y*numCols] where x and y are integers. + * + * \par + * Let (x, y) specify the desired interpolation point. Then define: + *
+   *     XF = floor(x)
+   *     YF = floor(y)
+   * 
+ * \par + * The interpolated output point is computed as: + *
+   *  f(x, y) = f(XF, YF) * (1-(x-XF)) * (1-(y-YF))
+   *           + f(XF+1, YF) * (x-XF)*(1-(y-YF))
+   *           + f(XF, YF+1) * (1-(x-XF))*(y-YF)
+   *           + f(XF+1, YF+1) * (x-XF)*(y-YF)
+   * 
+ * Note that the coordinates (x, y) contain integer and fractional components. + * The integer components specify which portion of the table to use while the + * fractional components control the interpolation processor. + * + * \par + * if (x,y) are outside of the table boundary, Bilinear interpolation returns zero output. + */ + + /** + * @addtogroup BilinearInterpolate + * @{ + */ + + + /** + * + * @brief Floating-point bilinear interpolation. + * @param[in,out] S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate. + * @param[in] Y interpolation coordinate. + * @return out interpolated value. + */ + CMSIS_INLINE __STATIC_INLINE float32_t arm_bilinear_interp_f32( + const arm_bilinear_interp_instance_f32 * S, + float32_t X, + float32_t Y) + { + float32_t out; + float32_t f00, f01, f10, f11; + float32_t *pData = S->pData; + int32_t xIndex, yIndex, index; + float32_t xdiff, ydiff; + float32_t b1, b2, b3, b4; + + xIndex = (int32_t) X; + yIndex = (int32_t) Y; + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if (xIndex < 0 || xIndex > (S->numRows - 1) || yIndex < 0 || yIndex > (S->numCols - 1)) + { + return (0); + } + + /* Calculation of index for two nearest points in X-direction */ + index = (xIndex - 1) + (yIndex - 1) * S->numCols; + + + /* Read two nearest points in X-direction */ + f00 = pData[index]; + f01 = pData[index + 1]; + + /* Calculation of index for two nearest points in Y-direction */ + index = (xIndex - 1) + (yIndex) * S->numCols; + + + /* Read two nearest points in Y-direction */ + f10 = pData[index]; + f11 = pData[index + 1]; + + /* Calculation of intermediate values */ + b1 = f00; + b2 = f01 - f00; + b3 = f10 - f00; + b4 = f00 - f01 - f10 + f11; + + /* Calculation of fractional part in X */ + xdiff = X - xIndex; + + /* Calculation of fractional part in Y */ + ydiff = Y - yIndex; + + /* Calculation of bi-linear interpolated output */ + out = b1 + b2 * xdiff + b3 * ydiff + b4 * xdiff * ydiff; + + /* return to application */ + return (out); + } + + + /** + * + * @brief Q31 bilinear interpolation. + * @param[in,out] S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + CMSIS_INLINE __STATIC_INLINE q31_t arm_bilinear_interp_q31( + arm_bilinear_interp_instance_q31 * S, + q31_t X, + q31_t Y) + { + q31_t out; /* Temporary output */ + q31_t acc = 0; /* output */ + q31_t xfract, yfract; /* X, Y fractional parts */ + q31_t x1, x2, y1, y2; /* Nearest output values */ + int32_t rI, cI; /* Row and column indices */ + q31_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & (q31_t)0xFFF00000) >> 20); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & (q31_t)0xFFF00000) >> 20); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + { + return (0); + } + + /* 20 bits for the fractional part */ + /* shift left xfract by 11 to keep 1.31 format */ + xfract = (X & 0x000FFFFF) << 11u; + + /* Read two nearest output values from the index */ + x1 = pYData[(rI) + (int32_t)nCols * (cI) ]; + x2 = pYData[(rI) + (int32_t)nCols * (cI) + 1]; + + /* 20 bits for the fractional part */ + /* shift left yfract by 11 to keep 1.31 format */ + yfract = (Y & 0x000FFFFF) << 11u; + + /* Read two nearest output values from the index */ + y1 = pYData[(rI) + (int32_t)nCols * (cI + 1) ]; + y2 = pYData[(rI) + (int32_t)nCols * (cI + 1) + 1]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 3.29(q29) format */ + out = ((q31_t) (((q63_t) x1 * (0x7FFFFFFF - xfract)) >> 32)); + acc = ((q31_t) (((q63_t) out * (0x7FFFFFFF - yfract)) >> 32)); + + /* x2 * (xfract) * (1-yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) x2 * (0x7FFFFFFF - yfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (xfract) >> 32)); + + /* y1 * (1 - xfract) * (yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) y1 * (0x7FFFFFFF - xfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); + + /* y2 * (xfract) * (yfract) in 3.29(q29) and adding to acc */ + out = ((q31_t) ((q63_t) y2 * (xfract) >> 32)); + acc += ((q31_t) ((q63_t) out * (yfract) >> 32)); + + /* Convert acc to 1.31(q31) format */ + return ((q31_t)(acc << 2)); + } + + + /** + * @brief Q15 bilinear interpolation. + * @param[in,out] S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + CMSIS_INLINE __STATIC_INLINE q15_t arm_bilinear_interp_q15( + arm_bilinear_interp_instance_q15 * S, + q31_t X, + q31_t Y) + { + q63_t acc = 0; /* output */ + q31_t out; /* Temporary output */ + q15_t x1, x2, y1, y2; /* Nearest output values */ + q31_t xfract, yfract; /* X, Y fractional parts */ + int32_t rI, cI; /* Row and column indices */ + q15_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & (q31_t)0xFFF00000) >> 20); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & (q31_t)0xFFF00000) >> 20); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + { + return (0); + } + + /* 20 bits for the fractional part */ + /* xfract should be in 12.20 format */ + xfract = (X & 0x000FFFFF); + + /* Read two nearest output values from the index */ + x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; + x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; + + /* 20 bits for the fractional part */ + /* yfract should be in 12.20 format */ + yfract = (Y & 0x000FFFFF); + + /* Read two nearest output values from the index */ + y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; + y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 13.51 format */ + + /* x1 is in 1.15(q15), xfract in 12.20 format and out is in 13.35 format */ + /* convert 13.35 to 13.31 by right shifting and out is in 1.31 */ + out = (q31_t) (((q63_t) x1 * (0xFFFFF - xfract)) >> 4u); + acc = ((q63_t) out * (0xFFFFF - yfract)); + + /* x2 * (xfract) * (1-yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) x2 * (0xFFFFF - yfract)) >> 4u); + acc += ((q63_t) out * (xfract)); + + /* y1 * (1 - xfract) * (yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) y1 * (0xFFFFF - xfract)) >> 4u); + acc += ((q63_t) out * (yfract)); + + /* y2 * (xfract) * (yfract) in 1.51 and adding to acc */ + out = (q31_t) (((q63_t) y2 * (xfract)) >> 4u); + acc += ((q63_t) out * (yfract)); + + /* acc is in 13.51 format and down shift acc by 36 times */ + /* Convert out to 1.15 format */ + return ((q15_t)(acc >> 36)); + } + + + /** + * @brief Q7 bilinear interpolation. + * @param[in,out] S points to an instance of the interpolation structure. + * @param[in] X interpolation coordinate in 12.20 format. + * @param[in] Y interpolation coordinate in 12.20 format. + * @return out interpolated value. + */ + CMSIS_INLINE __STATIC_INLINE q7_t arm_bilinear_interp_q7( + arm_bilinear_interp_instance_q7 * S, + q31_t X, + q31_t Y) + { + q63_t acc = 0; /* output */ + q31_t out; /* Temporary output */ + q31_t xfract, yfract; /* X, Y fractional parts */ + q7_t x1, x2, y1, y2; /* Nearest output values */ + int32_t rI, cI; /* Row and column indices */ + q7_t *pYData = S->pData; /* pointer to output table values */ + uint32_t nCols = S->numCols; /* num of rows */ + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + rI = ((X & (q31_t)0xFFF00000) >> 20); + + /* Input is in 12.20 format */ + /* 12 bits for the table index */ + /* Index value calculation */ + cI = ((Y & (q31_t)0xFFF00000) >> 20); + + /* Care taken for table outside boundary */ + /* Returns zero output when values are outside table boundary */ + if (rI < 0 || rI > (S->numRows - 1) || cI < 0 || cI > (S->numCols - 1)) + { + return (0); + } + + /* 20 bits for the fractional part */ + /* xfract should be in 12.20 format */ + xfract = (X & (q31_t)0x000FFFFF); + + /* Read two nearest output values from the index */ + x1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) ]; + x2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI) + 1]; + + /* 20 bits for the fractional part */ + /* yfract should be in 12.20 format */ + yfract = (Y & (q31_t)0x000FFFFF); + + /* Read two nearest output values from the index */ + y1 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) ]; + y2 = pYData[((uint32_t)rI) + nCols * ((uint32_t)cI + 1) + 1]; + + /* Calculation of x1 * (1-xfract ) * (1-yfract) and acc is in 16.47 format */ + out = ((x1 * (0xFFFFF - xfract))); + acc = (((q63_t) out * (0xFFFFF - yfract))); + + /* x2 * (xfract) * (1-yfract) in 2.22 and adding to acc */ + out = ((x2 * (0xFFFFF - yfract))); + acc += (((q63_t) out * (xfract))); + + /* y1 * (1 - xfract) * (yfract) in 2.22 and adding to acc */ + out = ((y1 * (0xFFFFF - xfract))); + acc += (((q63_t) out * (yfract))); + + /* y2 * (xfract) * (yfract) in 2.22 and adding to acc */ + out = ((y2 * (yfract))); + acc += (((q63_t) out * (xfract))); + + /* acc in 16.47 format and down shift by 40 to convert to 1.7 format */ + return ((q7_t)(acc >> 40)); + } + + /** + * @} end of BilinearInterpolate group + */ + + +/* SMMLAR */ +#define multAcc_32x32_keep32_R(a, x, y) \ + a = (q31_t) (((((q63_t) a) << 32) + ((q63_t) x * y) + 0x80000000LL ) >> 32) + +/* SMMLSR */ +#define multSub_32x32_keep32_R(a, x, y) \ + a = (q31_t) (((((q63_t) a) << 32) - ((q63_t) x * y) + 0x80000000LL ) >> 32) + +/* SMMULR */ +#define mult_32x32_keep32_R(a, x, y) \ + a = (q31_t) (((q63_t) x * y + 0x80000000LL ) >> 32) + +/* SMMLA */ +#define multAcc_32x32_keep32(a, x, y) \ + a += (q31_t) (((q63_t) x * y) >> 32) + +/* SMMLS */ +#define multSub_32x32_keep32(a, x, y) \ + a -= (q31_t) (((q63_t) x * y) >> 32) + +/* SMMUL */ +#define mult_32x32_keep32(a, x, y) \ + a = (q31_t) (((q63_t) x * y ) >> 32) + + +#if defined ( __CC_ARM ) + /* Enter low optimization region - place directly above function definition */ + #if defined( ARM_MATH_CM4 ) || defined( ARM_MATH_CM7) + #define LOW_OPTIMIZATION_ENTER \ + _Pragma ("push") \ + _Pragma ("O1") + #else + #define LOW_OPTIMIZATION_ENTER + #endif + + /* Exit low optimization region - place directly after end of function definition */ + #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) + #define LOW_OPTIMIZATION_EXIT \ + _Pragma ("pop") + #else + #define LOW_OPTIMIZATION_EXIT + #endif + + /* Enter low optimization region - place directly above function definition */ + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + + /* Exit low optimization region - place directly after end of function definition */ + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined (__ARMCC_VERSION ) && ( __ARMCC_VERSION >= 6010050 ) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __GNUC__ ) + #define LOW_OPTIMIZATION_ENTER \ + __attribute__(( optimize("-O1") )) + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __ICCARM__ ) + /* Enter low optimization region - place directly above function definition */ + #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) + #define LOW_OPTIMIZATION_ENTER \ + _Pragma ("optimize=low") + #else + #define LOW_OPTIMIZATION_ENTER + #endif + + /* Exit low optimization region - place directly after end of function definition */ + #define LOW_OPTIMIZATION_EXIT + + /* Enter low optimization region - place directly above function definition */ + #if defined ( ARM_MATH_CM4 ) || defined ( ARM_MATH_CM7 ) + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER \ + _Pragma ("optimize=low") + #else + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #endif + + /* Exit low optimization region - place directly after end of function definition */ + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __TI_ARM__ ) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __CSMC__ ) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#elif defined ( __TASKING__ ) + #define LOW_OPTIMIZATION_ENTER + #define LOW_OPTIMIZATION_EXIT + #define IAR_ONLY_LOW_OPTIMIZATION_ENTER + #define IAR_ONLY_LOW_OPTIMIZATION_EXIT + +#endif + + +#ifdef __cplusplus +} +#endif + + +#if defined ( __GNUC__ ) +#pragma GCC diagnostic pop +#endif + +#endif /* _ARM_MATH_H */ + +/** + * + * End of file. + */ diff --git a/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_compiler.h b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_compiler.h new file mode 100644 index 0000000000..8b989f851a --- /dev/null +++ b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_compiler.h @@ -0,0 +1,223 @@ +/**************************************************************************//** + * @file cmsis_compiler.h + * @brief CMSIS compiler generic header file + * @version V5.0.1 + * @date 30. January 2017 + ******************************************************************************/ +/* + * Copyright (c) 2009-2017 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_COMPILER_H +#define __CMSIS_COMPILER_H + +#include + +/* + * ARM Compiler 4/5 + */ +#if defined ( __CC_ARM ) + #include "cmsis_armcc.h" + + +/* + * ARM Compiler 6 (armclang) + */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #include "cmsis_armclang.h" + + +/* + * GNU Compiler + */ +#elif defined ( __GNUC__ ) + #include "cmsis_gcc.h" + + +/* + * IAR Compiler + */ +#elif defined ( __ICCARM__ ) + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + + #include + + #ifndef __NO_RETURN + #define __NO_RETURN __noreturn + #endif + #ifndef __USED + #define __USED __root + #endif + #ifndef __WEAK + #define __WEAK __weak + #endif + #ifndef __UNALIGNED_UINT32 + __packed struct T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __ALIGNED + #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. + #define __ALIGNED(x) + #endif + #ifndef __PACKED + #define __PACKED __packed + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT __packed struct + #endif + + +/* + * TI ARM Compiler + */ +#elif defined ( __TI_ARM__ ) + #include + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __UNALIGNED_UINT32 + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) + #endif + #ifndef __PACKED + #define __PACKED __attribute__((packed)) + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed)) + #endif + + +/* + * TASKING Compiler + */ +#elif defined ( __TASKING__ ) + /* + * The CMSIS functions have been implemented as intrinsics in the compiler. + * Please use "carm -?i" to get an up to date list of all intrinsics, + * Including the CMSIS ones. + */ + + #ifndef __ASM + #define __ASM __asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) + #endif + #ifndef __USED + #define __USED __attribute__((used)) + #endif + #ifndef __WEAK + #define __WEAK __attribute__((weak)) + #endif + #ifndef __UNALIGNED_UINT32 + struct __packed__ T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __ALIGNED + #define __ALIGNED(x) __align(x) + #endif + #ifndef __PACKED + #define __PACKED __packed__ + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __packed__ + #endif + + +/* + * COSMIC Compiler + */ +#elif defined ( __CSMC__ ) + #include + + #ifndef __ASM + #define __ASM _asm + #endif + #ifndef __INLINE + #define __INLINE inline + #endif + #ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline + #endif + #ifndef __NO_RETURN + // NO RETURN is automatically detected hence no warning here + #define __NO_RETURN + #endif + #ifndef __USED + #warning No compiler specific solution for __USED. __USED is ignored. + #define __USED + #endif + #ifndef __WEAK + #define __WEAK __weak + #endif + #ifndef __UNALIGNED_UINT32 + @packed struct T_UINT32 { uint32_t v; }; + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) + #endif + #ifndef __ALIGNED + #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. + #define __ALIGNED(x) + #endif + #ifndef __PACKED + #define __PACKED @packed + #endif + #ifndef __PACKED_STRUCT + #define __PACKED_STRUCT @packed struct + #endif + + +#else + #error Unknown compiler. +#endif + + +#endif /* __CMSIS_COMPILER_H */ + diff --git a/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_gcc.h b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_gcc.h new file mode 100644 index 0000000000..074cd7ab32 --- /dev/null +++ b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/cmsis_gcc.h @@ -0,0 +1,1899 @@ +/**************************************************************************//** + * @file cmsis_gcc.h + * @brief CMSIS compiler GCC header file + * @version V5.0.1 + * @date 02. February 2017 + ******************************************************************************/ +/* + * Copyright (c) 2009-2017 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __CMSIS_GCC_H +#define __CMSIS_GCC_H + +/* ignore some GCC warnings */ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wsign-conversion" +#pragma GCC diagnostic ignored "-Wconversion" +#pragma GCC diagnostic ignored "-Wunused-parameter" + +/* CMSIS compiler specific defines */ +#ifndef __ASM + #define __ASM __asm +#endif +#ifndef __INLINE + #define __INLINE inline +#endif +#ifndef __STATIC_INLINE + #define __STATIC_INLINE static inline +#endif +#ifndef __NO_RETURN + #define __NO_RETURN __attribute__((noreturn)) +#endif +#ifndef __USED + #define __USED __attribute__((used)) +#endif +#ifndef __WEAK + #define __WEAK __attribute__((weak)) +#endif +#ifndef __UNALIGNED_UINT32 +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpacked" +#pragma GCC diagnostic ignored "-Wattributes" + struct __attribute__((packed)) T_UINT32 { uint32_t v; }; +#pragma GCC diagnostic pop + #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) +#endif +#ifndef __ALIGNED + #define __ALIGNED(x) __attribute__((aligned(x))) +#endif +#ifndef __PACKED + #define __PACKED __attribute__((packed, aligned(1))) +#endif +#ifndef __PACKED_STRUCT + #define __PACKED_STRUCT struct __attribute__((packed, aligned(1))) +#endif + + +/* ########################### Core Function Access ########################### */ +/** \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions + @{ + */ + +/** + \brief Enable IRQ Interrupts + \details Enables IRQ interrupts by clearing the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__((always_inline)) __STATIC_INLINE void __enable_irq(void) +{ + __ASM volatile ("cpsie i" : : : "memory"); +} + + +/** + \brief Disable IRQ Interrupts + \details Disables IRQ interrupts by setting the I-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__((always_inline)) __STATIC_INLINE void __disable_irq(void) +{ + __ASM volatile ("cpsid i" : : : "memory"); +} + + +/** + \brief Get Control Register + \details Returns the content of the Control Register. + \return Control Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_CONTROL(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Control Register (non-secure) + \details Returns the content of the non-secure Control Register when in secure mode. + \return non-secure Control Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_CONTROL_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, control_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Control Register + \details Writes the given value to the Control Register. + \param [in] control Control Register value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_CONTROL(uint32_t control) +{ + __ASM volatile ("MSR control, %0" : : "r" (control) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Control Register (non-secure) + \details Writes the given value to the non-secure Control Register when in secure state. + \param [in] control Control Register value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_CONTROL_NS(uint32_t control) +{ + __ASM volatile ("MSR control_ns, %0" : : "r" (control) : "memory"); +} +#endif + + +/** + \brief Get IPSR Register + \details Returns the content of the IPSR Register. + \return IPSR Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_IPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, ipsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get APSR Register + \details Returns the content of the APSR Register. + \return APSR Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_APSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, apsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get xPSR Register + \details Returns the content of the xPSR Register. + \return xPSR Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_xPSR(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, xpsr" : "=r" (result) ); + return(result); +} + + +/** + \brief Get Process Stack Pointer + \details Returns the current value of the Process Stack Pointer (PSP). + \return PSP Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Process Stack Pointer (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer (PSP) when in secure state. + \return PSP Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSP_NS(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer + \details Assigns the given value to the Process Stack Pointer (PSP). + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp, %0" : : "r" (topOfProcStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer (PSP) when in secure state. + \param [in] topOfProcStack Process Stack Pointer value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSP_NS(uint32_t topOfProcStack) +{ + __ASM volatile ("MSR psp_ns, %0" : : "r" (topOfProcStack) : ); +} +#endif + + +/** + \brief Get Main Stack Pointer + \details Returns the current value of the Main Stack Pointer (MSP). + \return MSP Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSP(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msp" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Main Stack Pointer (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer (MSP) when in secure state. + \return MSP Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSP_NS(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msp_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer + \details Assigns the given value to the Main Stack Pointer (MSP). + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp, %0" : : "r" (topOfMainStack) : ); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Main Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer (MSP) when in secure state. + \param [in] topOfMainStack Main Stack Pointer value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSP_NS(uint32_t topOfMainStack) +{ + __ASM volatile ("MSR msp_ns, %0" : : "r" (topOfMainStack) : ); +} +#endif + + +/** + \brief Get Priority Mask + \details Returns the current state of the priority mask bit from the Priority Mask Register. + \return Priority Mask value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PRIMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Priority Mask (non-secure) + \details Returns the current state of the non-secure priority mask bit from the Priority Mask Register when in secure state. + \return Priority Mask value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PRIMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, primask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Priority Mask + \details Assigns the given value to the Priority Mask Register. + \param [in] priMask Priority Mask + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_PRIMASK(uint32_t priMask) +{ + __ASM volatile ("MSR primask, %0" : : "r" (priMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Priority Mask (non-secure) + \details Assigns the given value to the non-secure Priority Mask Register when in secure state. + \param [in] priMask Priority Mask + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PRIMASK_NS(uint32_t priMask) +{ + __ASM volatile ("MSR primask_ns, %0" : : "r" (priMask) : "memory"); +} +#endif + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Enable FIQ + \details Enables FIQ interrupts by clearing the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__((always_inline)) __STATIC_INLINE void __enable_fault_irq(void) +{ + __ASM volatile ("cpsie f" : : : "memory"); +} + + +/** + \brief Disable FIQ + \details Disables FIQ interrupts by setting the F-bit in the CPSR. + Can only be executed in Privileged modes. + */ +__attribute__((always_inline)) __STATIC_INLINE void __disable_fault_irq(void) +{ + __ASM volatile ("cpsid f" : : : "memory"); +} + + +/** + \brief Get Base Priority + \details Returns the current value of the Base Priority register. + \return Base Priority register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_BASEPRI(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Base Priority (non-secure) + \details Returns the current value of the non-secure Base Priority register when in secure state. + \return Base Priority register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_BASEPRI_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, basepri_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Base Priority + \details Assigns the given value to the Base Priority register. + \param [in] basePri Base Priority value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI(uint32_t basePri) +{ + __ASM volatile ("MSR basepri, %0" : : "r" (basePri) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Base Priority (non-secure) + \details Assigns the given value to the non-secure Base Priority register when in secure state. + \param [in] basePri Base Priority value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_BASEPRI_NS(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_ns, %0" : : "r" (basePri) : "memory"); +} +#endif + + +/** + \brief Set Base Priority with condition + \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, + or the new value increases the BASEPRI priority level. + \param [in] basePri Base Priority value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) +{ + __ASM volatile ("MSR basepri_max, %0" : : "r" (basePri) : "memory"); +} + + +/** + \brief Get Fault Mask + \details Returns the current value of the Fault Mask register. + \return Fault Mask register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FAULTMASK(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask" : "=r" (result) ); + return(result); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Get Fault Mask (non-secure) + \details Returns the current value of the non-secure Fault Mask register when in secure state. + \return Fault Mask register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_FAULTMASK_NS(void) +{ + uint32_t result; + + __ASM volatile ("MRS %0, faultmask_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Fault Mask + \details Assigns the given value to the Fault Mask register. + \param [in] faultMask Fault Mask value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) : "memory"); +} + + +#if (defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) +/** + \brief Set Fault Mask (non-secure) + \details Assigns the given value to the non-secure Fault Mask register when in secure state. + \param [in] faultMask Fault Mask value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_FAULTMASK_NS(uint32_t faultMask) +{ + __ASM volatile ("MSR faultmask_ns, %0" : : "r" (faultMask) : "memory"); +} +#endif + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) + +/** + \brief Get Process Stack Pointer Limit + \details Returns the current value of the Process Stack Pointer Limit (PSPLIM). + \return PSPLIM Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_PSPLIM(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psplim" : "=r" (result) ); + return(result); +} + + +#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ + (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Get Process Stack Pointer Limit (non-secure) + \details Returns the current value of the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \return PSPLIM Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_PSPLIM_NS(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, psplim_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Process Stack Pointer Limit + \details Assigns the given value to the Process Stack Pointer Limit (PSPLIM). + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_PSPLIM(uint32_t ProcStackPtrLimit) +{ + __ASM volatile ("MSR psplim, %0" : : "r" (ProcStackPtrLimit)); +} + + +#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ + (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Set Process Stack Pointer (non-secure) + \details Assigns the given value to the non-secure Process Stack Pointer Limit (PSPLIM) when in secure state. + \param [in] ProcStackPtrLimit Process Stack Pointer Limit value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_PSPLIM_NS(uint32_t ProcStackPtrLimit) +{ + __ASM volatile ("MSR psplim_ns, %0\n" : : "r" (ProcStackPtrLimit)); +} +#endif + + +/** + \brief Get Main Stack Pointer Limit + \details Returns the current value of the Main Stack Pointer Limit (MSPLIM). + \return MSPLIM Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_MSPLIM(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msplim" : "=r" (result) ); + + return(result); +} + + +#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ + (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Get Main Stack Pointer Limit (non-secure) + \details Returns the current value of the non-secure Main Stack Pointer Limit(MSPLIM) when in secure state. + \return MSPLIM Register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __TZ_get_MSPLIM_NS(void) +{ + register uint32_t result; + + __ASM volatile ("MRS %0, msplim_ns" : "=r" (result) ); + return(result); +} +#endif + + +/** + \brief Set Main Stack Pointer Limit + \details Assigns the given value to the Main Stack Pointer Limit (MSPLIM). + \param [in] MainStackPtrLimit Main Stack Pointer Limit value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_MSPLIM(uint32_t MainStackPtrLimit) +{ + __ASM volatile ("MSR msplim, %0" : : "r" (MainStackPtrLimit)); +} + + +#if ((defined (__ARM_FEATURE_CMSE ) && (__ARM_FEATURE_CMSE == 3)) && \ + (defined (__ARM_ARCH_8M_MAIN__) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Set Main Stack Pointer Limit (non-secure) + \details Assigns the given value to the non-secure Main Stack Pointer Limit (MSPLIM) when in secure state. + \param [in] MainStackPtrLimit Main Stack Pointer value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __TZ_set_MSPLIM_NS(uint32_t MainStackPtrLimit) +{ + __ASM volatile ("MSR msplim_ns, %0" : : "r" (MainStackPtrLimit)); +} +#endif + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + +/** + \brief Get FPSCR + \details Returns the current value of the Floating Point Status/Control register. + \return Floating Point Status/Control register value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __get_FPSCR(void) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + uint32_t result; + + __ASM volatile ("VMRS %0, fpscr" : "=r" (result) ); + return(result); +#else + return(0U); +#endif +} + + +/** + \brief Set FPSCR + \details Assigns the given value to the Floating Point Status/Control register. + \param [in] fpscr Floating Point Status/Control value to set + */ +__attribute__((always_inline)) __STATIC_INLINE void __set_FPSCR(uint32_t fpscr) +{ +#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ + (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) + __ASM volatile ("VMSR fpscr, %0" : : "r" (fpscr) : "vfpcc", "memory"); +#else + (void)fpscr; +#endif +} + +#endif /* ((defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + + +/*@} end of CMSIS_Core_RegAccFunctions */ + + +/* ########################## Core Instruction Access ######################### */ +/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface + Access to dedicated instructions + @{ +*/ + +/* Define macros for porting to both thumb1 and thumb2. + * For thumb1, use low register (r0-r7), specified by constraint "l" + * Otherwise, use general registers, specified by constraint "r" */ +#if defined (__thumb__) && !defined (__thumb2__) +#define __CMSIS_GCC_OUT_REG(r) "=l" (r) +#define __CMSIS_GCC_RW_REG(r) "+l" (r) +#define __CMSIS_GCC_USE_REG(r) "l" (r) +#else +#define __CMSIS_GCC_OUT_REG(r) "=r" (r) +#define __CMSIS_GCC_RW_REG(r) "+r" (r) +#define __CMSIS_GCC_USE_REG(r) "r" (r) +#endif + +/** + \brief No Operation + \details No Operation does nothing. This instruction can be used for code alignment purposes. + */ +//__attribute__((always_inline)) __STATIC_INLINE void __NOP(void) +//{ +// __ASM volatile ("nop"); +//} +#define __NOP() __ASM volatile ("nop") /* This implementation generates debug information */ + +/** + \brief Wait For Interrupt + \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. + */ +//__attribute__((always_inline)) __STATIC_INLINE void __WFI(void) +//{ +// __ASM volatile ("wfi"); +//} +#define __WFI() __ASM volatile ("wfi") /* This implementation generates debug information */ + + +/** + \brief Wait For Event + \details Wait For Event is a hint instruction that permits the processor to enter + a low-power state until one of a number of events occurs. + */ +//__attribute__((always_inline)) __STATIC_INLINE void __WFE(void) +//{ +// __ASM volatile ("wfe"); +//} +#define __WFE() __ASM volatile ("wfe") /* This implementation generates debug information */ + + +/** + \brief Send Event + \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. + */ +//__attribute__((always_inline)) __STATIC_INLINE void __SEV(void) +//{ +// __ASM volatile ("sev"); +//} +#define __SEV() __ASM volatile ("sev") /* This implementation generates debug information */ + + +/** + \brief Instruction Synchronization Barrier + \details Instruction Synchronization Barrier flushes the pipeline in the processor, + so that all instructions following the ISB are fetched from cache or memory, + after the instruction has been completed. + */ +__attribute__((always_inline)) __STATIC_INLINE void __ISB(void) +{ + __ASM volatile ("isb 0xF":::"memory"); +} + + +/** + \brief Data Synchronization Barrier + \details Acts as a special kind of Data Memory Barrier. + It completes when all explicit memory accesses before this instruction complete. + */ +__attribute__((always_inline)) __STATIC_INLINE void __DSB(void) +{ + __ASM volatile ("dsb 0xF":::"memory"); +} + + +/** + \brief Data Memory Barrier + \details Ensures the apparent order of the explicit memory operations before + and after the instruction, without ensuring their completion. + */ +__attribute__((always_inline)) __STATIC_INLINE void __DMB(void) +{ + __ASM volatile ("dmb 0xF":::"memory"); +} + + +/** + \brief Reverse byte order (32 bit) + \details Reverses the byte order in integer value. + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV(uint32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5) + return __builtin_bswap32(value); +#else + uint32_t result; + + __ASM volatile ("rev %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +#endif +} + + +/** + \brief Reverse byte order (16 bit) + \details Reverses the byte order in two unsigned short values. + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __REV16(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rev16 %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief Reverse byte order in signed short value + \details Reverses the byte order in a signed short value with sign extension to integer. + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((always_inline)) __STATIC_INLINE int32_t __REVSH(int32_t value) +{ +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + return (short)__builtin_bswap16(value); +#else + int32_t result; + + __ASM volatile ("revsh %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +#endif +} + + +/** + \brief Rotate Right in unsigned value (32 bit) + \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. + \param [in] op1 Value to rotate + \param [in] op2 Number of Bits to rotate + \return Rotated value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __ROR(uint32_t op1, uint32_t op2) +{ + return (op1 >> op2) | (op1 << (32U - op2)); +} + + +/** + \brief Breakpoint + \details Causes the processor to enter Debug state. + Debug tools can use this to investigate system state when the instruction at a particular address is reached. + \param [in] value is ignored by the processor. + If required, a debugger can use it to store additional information about the breakpoint. + */ +#define __BKPT(value) __ASM volatile ("bkpt "#value) + + +/** + \brief Reverse bit order of value + \details Reverses the bit order of the given value. + \param [in] value Value to reverse + \return Reversed value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) +{ + uint32_t result; + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) + __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) ); +#else + int32_t s = (4 /*sizeof(v)*/ * 8) - 1; /* extra shift needed at end */ + + result = value; /* r will be reversed bits of v; first get LSB of v */ + for (value >>= 1U; value; value >>= 1U) + { + result <<= 1U; + result |= value & 1U; + s--; + } + result <<= s; /* shift when v's highest bits are zero */ +#endif + return(result); +} + + +/** + \brief Count leading zeros + \details Counts the number of leading zeros of a data value. + \param [in] value Value to count the leading zeros + \return number of leading zeros in value + */ +#define __CLZ __builtin_clz + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief LDR Exclusive (8 bit) + \details Executes a exclusive LDR instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDREXB(volatile uint8_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexb %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (16 bit) + \details Executes a exclusive LDR instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDREXH(volatile uint16_t *addr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrexh %0, %1" : "=r" (result) : "Q" (*addr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDR Exclusive (32 bit) + \details Executes a exclusive LDR instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDREXW(volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("ldrex %0, %1" : "=r" (result) : "Q" (*addr) ); + return(result); +} + + +/** + \brief STR Exclusive (8 bit) + \details Executes a exclusive STR instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXB(uint8_t value, volatile uint8_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexb %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (16 bit) + \details Executes a exclusive STR instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXH(uint16_t value, volatile uint16_t *addr) +{ + uint32_t result; + + __ASM volatile ("strexh %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief STR Exclusive (32 bit) + \details Executes a exclusive STR instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STREXW(uint32_t value, volatile uint32_t *addr) +{ + uint32_t result; + + __ASM volatile ("strex %0, %2, %1" : "=&r" (result), "=Q" (*addr) : "r" (value) ); + return(result); +} + + +/** + \brief Remove the exclusive lock + \details Removes the exclusive lock which is created by LDREX. + */ +__attribute__((always_inline)) __STATIC_INLINE void __CLREX(void) +{ + __ASM volatile ("clrex" ::: "memory"); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) +/** + \brief Signed Saturate + \details Saturates a signed value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (1..32) + \return Saturated value + */ +#define __SSAT(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Unsigned Saturate + \details Saturates an unsigned value. + \param [in] value Value to be saturated + \param [in] sat Bit position to saturate to (0..31) + \return Saturated value + */ +#define __USAT(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + + +/** + \brief Rotate Right with Extend (32 bit) + \details Moves each bit of a bitstring right by one bit. + The carry input is shifted in at the left end of the bitstring. + \param [in] value Value to rotate + \return Rotated value + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __RRX(uint32_t value) +{ + uint32_t result; + + __ASM volatile ("rrx %0, %1" : __CMSIS_GCC_OUT_REG (result) : __CMSIS_GCC_USE_REG (value) ); + return(result); +} + + +/** + \brief LDRT Unprivileged (8 bit) + \details Executes a Unprivileged LDRT instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDRBT(volatile uint8_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrbt %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrbt %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint8_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (16 bit) + \details Executes a Unprivileged LDRT instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDRHT(volatile uint16_t *ptr) +{ + uint32_t result; + +#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8) + __ASM volatile ("ldrht %0, %1" : "=r" (result) : "Q" (*ptr) ); +#else + /* Prior to GCC 4.8, "Q" will be expanded to [rx, #0] which is not + accepted by assembler. So has to use following less efficient pattern. + */ + __ASM volatile ("ldrht %0, [%1]" : "=r" (result) : "r" (ptr) : "memory" ); +#endif + return ((uint16_t) result); /* Add explicit type cast here */ +} + + +/** + \brief LDRT Unprivileged (32 bit) + \details Executes a Unprivileged LDRT instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDRT(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldrt %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief STRT Unprivileged (8 bit) + \details Executes a Unprivileged STRT instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STRBT(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("strbt %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (16 bit) + \details Executes a Unprivileged STRT instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STRHT(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("strht %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief STRT Unprivileged (32 bit) + \details Executes a Unprivileged STRT instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STRT(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("strt %1, %0" : "=Q" (*ptr) : "r" (value) ); +} + +#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ + (defined (__ARM_ARCH_7EM__ ) && (__ARM_ARCH_7EM__ == 1)) || \ + (defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) ) */ + + +#if ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) +/** + \brief Load-Acquire (8 bit) + \details Executes a LDAB instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDAB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldab %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire (16 bit) + \details Executes a LDAH instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDAH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldah %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire (32 bit) + \details Executes a LDA instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDA(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("lda %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release (8 bit) + \details Executes a STLB instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STLB(uint8_t value, volatile uint8_t *ptr) +{ + __ASM volatile ("stlb %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (16 bit) + \details Executes a STLH instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STLH(uint16_t value, volatile uint16_t *ptr) +{ + __ASM volatile ("stlh %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Store-Release (32 bit) + \details Executes a STL instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + */ +__attribute__((always_inline)) __STATIC_INLINE void __STL(uint32_t value, volatile uint32_t *ptr) +{ + __ASM volatile ("stl %1, %0" : "=Q" (*ptr) : "r" ((uint32_t)value) ); +} + + +/** + \brief Load-Acquire Exclusive (8 bit) + \details Executes a LDAB exclusive instruction for 8 bit value. + \param [in] ptr Pointer to data + \return value of type uint8_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint8_t __LDAEXB(volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexb %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint8_t) result); +} + + +/** + \brief Load-Acquire Exclusive (16 bit) + \details Executes a LDAH exclusive instruction for 16 bit values. + \param [in] ptr Pointer to data + \return value of type uint16_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint16_t __LDAEXH(volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaexh %0, %1" : "=r" (result) : "Q" (*ptr) ); + return ((uint16_t) result); +} + + +/** + \brief Load-Acquire Exclusive (32 bit) + \details Executes a LDA exclusive instruction for 32 bit values. + \param [in] ptr Pointer to data + \return value of type uint32_t at (*ptr) + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __LDAEX(volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("ldaex %0, %1" : "=r" (result) : "Q" (*ptr) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (8 bit) + \details Executes a STLB exclusive instruction for 8 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STLEXB(uint8_t value, volatile uint8_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexb %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (16 bit) + \details Executes a STLH exclusive instruction for 16 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STLEXH(uint16_t value, volatile uint16_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlexh %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + + +/** + \brief Store-Release Exclusive (32 bit) + \details Executes a STL exclusive instruction for 32 bit values. + \param [in] value Value to store + \param [in] ptr Pointer to location + \return 0 Function succeeded + \return 1 Function failed + */ +__attribute__((always_inline)) __STATIC_INLINE uint32_t __STLEX(uint32_t value, volatile uint32_t *ptr) +{ + uint32_t result; + + __ASM volatile ("stlex %0, %2, %1" : "=&r" (result), "=Q" (*ptr) : "r" ((uint32_t)value) ); + return(result); +} + +#endif /* ((defined (__ARM_ARCH_8M_MAIN__ ) && (__ARM_ARCH_8M_MAIN__ == 1)) || \ + (defined (__ARM_ARCH_8M_BASE__ ) && (__ARM_ARCH_8M_BASE__ == 1)) ) */ + +/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ + + +/* ################### Compiler specific Intrinsics ########################### */ +/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics + Access to dedicated SIMD instructions + @{ +*/ + +#if (__ARM_FEATURE_DSP == 1) /* ToDo ARMCLANG: This should be ARCH >= ARMv7-M + SIMD */ + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHADD16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhadd16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSUB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsub16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHASX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhasx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("ssax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __QSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("qsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("shsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UQSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uqsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UHSAX(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uhsax %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAD8(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("usad8 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __USADA8(uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("usada8 %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#define __SSAT16(ARG1,ARG2) \ +({ \ + int32_t __RES, __ARG1 = (ARG1); \ + __ASM ("ssat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +#define __USAT16(ARG1,ARG2) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1); \ + __ASM ("usat16 %0, %1, %2" : "=r" (__RES) : "I" (ARG2), "r" (__ARG1) ); \ + __RES; \ + }) + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("uxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __UXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("uxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTB16(uint32_t op1) +{ + uint32_t result; + + __ASM volatile ("sxtb16 %0, %1" : "=r" (result) : "r" (op1)); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SXTAB16(uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sxtab16 %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUAD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuad %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUADX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smuadx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLAD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlad %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLADX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smladx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlald %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLALDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlaldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSD (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMUSDX (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("smusdx %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSD (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsd %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SMLSDX (uint32_t op1, uint32_t op2, uint32_t op3) +{ + uint32_t result; + + __ASM volatile ("smlsdx %0, %1, %2, %3" : "=r" (result) : "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLD (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsld %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__attribute__((always_inline)) __STATIC_INLINE uint64_t __SMLSLDX (uint32_t op1, uint32_t op2, uint64_t acc) +{ + union llreg_u{ + uint32_t w32[2]; + uint64_t w64; + } llr; + llr.w64 = acc; + +#ifndef __ARMEB__ /* Little endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[0]), "=r" (llr.w32[1]): "r" (op1), "r" (op2) , "0" (llr.w32[0]), "1" (llr.w32[1]) ); +#else /* Big endian */ + __ASM volatile ("smlsldx %0, %1, %2, %3" : "=r" (llr.w32[1]), "=r" (llr.w32[0]): "r" (op1), "r" (op2) , "0" (llr.w32[1]), "1" (llr.w32[0]) ); +#endif + + return(llr.w64); +} + +__attribute__((always_inline)) __STATIC_INLINE uint32_t __SEL (uint32_t op1, uint32_t op2) +{ + uint32_t result; + + __ASM volatile ("sel %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE int32_t __QADD( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qadd %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +__attribute__((always_inline)) __STATIC_INLINE int32_t __QSUB( int32_t op1, int32_t op2) +{ + int32_t result; + + __ASM volatile ("qsub %0, %1, %2" : "=r" (result) : "r" (op1), "r" (op2) ); + return(result); +} + +#if 0 +#define __PKHBT(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + __ASM ("pkhbt %0, %1, %2, lsl %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) + +#define __PKHTB(ARG1,ARG2,ARG3) \ +({ \ + uint32_t __RES, __ARG1 = (ARG1), __ARG2 = (ARG2); \ + if (ARG3 == 0) \ + __ASM ("pkhtb %0, %1, %2" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2) ); \ + else \ + __ASM ("pkhtb %0, %1, %2, asr %3" : "=r" (__RES) : "r" (__ARG1), "r" (__ARG2), "I" (ARG3) ); \ + __RES; \ + }) +#endif + +#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ + ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) + +#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ + ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) + +__attribute__((always_inline)) __STATIC_INLINE int32_t __SMMLA (int32_t op1, int32_t op2, int32_t op3) +{ + int32_t result; + + __ASM volatile ("smmla %0, %1, %2, %3" : "=r" (result): "r" (op1), "r" (op2), "r" (op3) ); + return(result); +} + +#endif /* (__ARM_FEATURE_DSP == 1) */ +/*@} end of group CMSIS_SIMD_intrinsics */ + + +#pragma GCC diagnostic pop + +#endif /* __CMSIS_GCC_H */ diff --git a/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/core_cm4.h b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/core_cm4.h new file mode 100644 index 0000000000..2da78d3983 --- /dev/null +++ b/lib/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include/core_cm4.h @@ -0,0 +1,2103 @@ +/**************************************************************************//** + * @file core_cm4.h + * @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File + * @version V5.0.1 + * @date 30. January 2017 + ******************************************************************************/ +/* + * Copyright (c) 2009-2016 ARM Limited. All rights reserved. + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the License); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#if defined ( __ICCARM__ ) + #pragma system_include /* treat file as system include file for MISRA check */ +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #pragma clang system_header /* treat file as system include file */ +#endif + +#ifndef __CORE_CM4_H_GENERIC +#define __CORE_CM4_H_GENERIC + +#include + +#ifdef __cplusplus + extern "C" { +#endif + +/** + \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions + CMSIS violates the following MISRA-C:2004 rules: + + \li Required Rule 8.5, object/function definition in header file.
+ Function definitions in header files are used to allow 'inlining'. + + \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
+ Unions are used for effective representation of core registers. + + \li Advisory Rule 19.7, Function-like macro defined.
+ Function-like macros are used to allow more efficient code. + */ + + +/******************************************************************************* + * CMSIS definitions + ******************************************************************************/ +/** + \ingroup Cortex_M4 + @{ + */ + +/* CMSIS CM4 definitions */ +#define __CM4_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB ( 0U) /*!< [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16U) | \ + __CM4_CMSIS_VERSION_SUB ) /*!< CMSIS HAL version number */ + +#define __CORTEX_M (4U) /*!< Cortex-M Core */ + +/** __FPU_USED indicates whether an FPU is used or not. + For this, __FPU_PRESENT has to be checked prior to making use of FPU specific registers and functions. +*/ +#if defined ( __CC_ARM ) + #if defined __TARGET_FPU_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) + #if defined __ARM_PCS_VFP + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #warning "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __GNUC__ ) + #if defined (__VFP_FP__) && !defined(__SOFTFP__) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __ICCARM__ ) + #if defined __ARMVFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TI_ARM__ ) + #if defined __TI_VFP_SUPPORT__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __TASKING__ ) + #if defined __FPU_VFP__ + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#elif defined ( __CSMC__ ) + #if ( __CSMC__ & 0x400U) + #if defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U) + #define __FPU_USED 1U + #else + #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" + #define __FPU_USED 0U + #endif + #else + #define __FPU_USED 0U + #endif + +#endif + +#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_GENERIC */ + +#ifndef __CMSIS_GENERIC + +#ifndef __CORE_CM4_H_DEPENDANT +#define __CORE_CM4_H_DEPENDANT + +#ifdef __cplusplus + extern "C" { +#endif + +/* check device defines and use defaults */ +#if defined __CHECK_DEVICE_DEFINES + #ifndef __CM4_REV + #define __CM4_REV 0x0000U + #warning "__CM4_REV not defined in device header file; using default!" + #endif + + #ifndef __FPU_PRESENT + #define __FPU_PRESENT 0U + #warning "__FPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __MPU_PRESENT + #define __MPU_PRESENT 0U + #warning "__MPU_PRESENT not defined in device header file; using default!" + #endif + + #ifndef __NVIC_PRIO_BITS + #define __NVIC_PRIO_BITS 3U + #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" + #endif + + #ifndef __Vendor_SysTickConfig + #define __Vendor_SysTickConfig 0U + #warning "__Vendor_SysTickConfig not defined in device header file; using default!" + #endif +#endif + +/* IO definitions (access restrictions to peripheral registers) */ +/** + \defgroup CMSIS_glob_defs CMSIS Global Defines + + IO Type Qualifiers are used + \li to specify the access to peripheral variables. + \li for automatic generation of peripheral register debug information. +*/ +#ifdef __cplusplus + #define __I volatile /*!< Defines 'read only' permissions */ +#else + #define __I volatile const /*!< Defines 'read only' permissions */ +#endif +#define __O volatile /*!< Defines 'write only' permissions */ +#define __IO volatile /*!< Defines 'read / write' permissions */ + +/* following defines should be used for structure members */ +#define __IM volatile const /*! Defines 'read only' structure member permissions */ +#define __OM volatile /*! Defines 'write only' structure member permissions */ +#define __IOM volatile /*! Defines 'read / write' structure member permissions */ + +/*@} end of group Cortex_M4 */ + + + +/******************************************************************************* + * Register Abstraction + Core Register contain: + - Core Register + - Core NVIC Register + - Core SCB Register + - Core SysTick Register + - Core Debug Register + - Core MPU Register + - Core FPU Register + ******************************************************************************/ +/** + \defgroup CMSIS_core_register Defines and Type Definitions + \brief Type definitions and defines for Cortex-M processor based devices. +*/ + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CORE Status and Control Registers + \brief Core Register type definitions. + @{ + */ + +/** + \brief Union type to access the Application Program Status Register (APSR). + */ +typedef union +{ + struct + { + uint32_t _reserved0:16; /*!< bit: 0..15 Reserved */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:7; /*!< bit: 20..26 Reserved */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} APSR_Type; + +/* APSR Register Definitions */ +#define APSR_N_Pos 31U /*!< APSR: N Position */ +#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ + +#define APSR_Z_Pos 30U /*!< APSR: Z Position */ +#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ + +#define APSR_C_Pos 29U /*!< APSR: C Position */ +#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ + +#define APSR_V_Pos 28U /*!< APSR: V Position */ +#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ + +#define APSR_Q_Pos 27U /*!< APSR: Q Position */ +#define APSR_Q_Msk (1UL << APSR_Q_Pos) /*!< APSR: Q Mask */ + +#define APSR_GE_Pos 16U /*!< APSR: GE Position */ +#define APSR_GE_Msk (0xFUL << APSR_GE_Pos) /*!< APSR: GE Mask */ + + +/** + \brief Union type to access the Interrupt Program Status Register (IPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} IPSR_Type; + +/* IPSR Register Definitions */ +#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ +#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ + + +/** + \brief Union type to access the Special-Purpose Program Status Registers (xPSR). + */ +typedef union +{ + struct + { + uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ + uint32_t _reserved0:1; /*!< bit: 9 Reserved */ + uint32_t ICI_IT_1:6; /*!< bit: 10..15 ICI/IT part 1 */ + uint32_t GE:4; /*!< bit: 16..19 Greater than or Equal flags */ + uint32_t _reserved1:4; /*!< bit: 20..23 Reserved */ + uint32_t T:1; /*!< bit: 24 Thumb bit */ + uint32_t ICI_IT_2:2; /*!< bit: 25..26 ICI/IT part 2 */ + uint32_t Q:1; /*!< bit: 27 Saturation condition flag */ + uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ + uint32_t C:1; /*!< bit: 29 Carry condition code flag */ + uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ + uint32_t N:1; /*!< bit: 31 Negative condition code flag */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} xPSR_Type; + +/* xPSR Register Definitions */ +#define xPSR_N_Pos 31U /*!< xPSR: N Position */ +#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ + +#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ +#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ + +#define xPSR_C_Pos 29U /*!< xPSR: C Position */ +#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ + +#define xPSR_V_Pos 28U /*!< xPSR: V Position */ +#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ + +#define xPSR_Q_Pos 27U /*!< xPSR: Q Position */ +#define xPSR_Q_Msk (1UL << xPSR_Q_Pos) /*!< xPSR: Q Mask */ + +#define xPSR_ICI_IT_2_Pos 25U /*!< xPSR: ICI/IT part 2 Position */ +#define xPSR_ICI_IT_2_Msk (3UL << xPSR_ICI_IT_2_Pos) /*!< xPSR: ICI/IT part 2 Mask */ + +#define xPSR_T_Pos 24U /*!< xPSR: T Position */ +#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ + +#define xPSR_GE_Pos 16U /*!< xPSR: GE Position */ +#define xPSR_GE_Msk (0xFUL << xPSR_GE_Pos) /*!< xPSR: GE Mask */ + +#define xPSR_ICI_IT_1_Pos 10U /*!< xPSR: ICI/IT part 1 Position */ +#define xPSR_ICI_IT_1_Msk (0x3FUL << xPSR_ICI_IT_1_Pos) /*!< xPSR: ICI/IT part 1 Mask */ + +#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ +#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ + + +/** + \brief Union type to access the Control Registers (CONTROL). + */ +typedef union +{ + struct + { + uint32_t nPRIV:1; /*!< bit: 0 Execution privilege in Thread mode */ + uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ + uint32_t FPCA:1; /*!< bit: 2 FP extension active flag */ + uint32_t _reserved0:29; /*!< bit: 3..31 Reserved */ + } b; /*!< Structure used for bit access */ + uint32_t w; /*!< Type used for word access */ +} CONTROL_Type; + +/* CONTROL Register Definitions */ +#define CONTROL_FPCA_Pos 2U /*!< CONTROL: FPCA Position */ +#define CONTROL_FPCA_Msk (1UL << CONTROL_FPCA_Pos) /*!< CONTROL: FPCA Mask */ + +#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ +#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ + +#define CONTROL_nPRIV_Pos 0U /*!< CONTROL: nPRIV Position */ +#define CONTROL_nPRIV_Msk (1UL /*<< CONTROL_nPRIV_Pos*/) /*!< CONTROL: nPRIV Mask */ + +/*@} end of group CMSIS_CORE */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) + \brief Type definitions for the NVIC Registers + @{ + */ + +/** + \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). + */ +typedef struct +{ + __IOM uint32_t ISER[8U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ + uint32_t RESERVED0[24U]; + __IOM uint32_t ICER[8U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ + uint32_t RSERVED1[24U]; + __IOM uint32_t ISPR[8U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ + uint32_t RESERVED2[24U]; + __IOM uint32_t ICPR[8U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ + uint32_t RESERVED3[24U]; + __IOM uint32_t IABR[8U]; /*!< Offset: 0x200 (R/W) Interrupt Active bit Register */ + uint32_t RESERVED4[56U]; + __IOM uint8_t IP[240U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register (8Bit wide) */ + uint32_t RESERVED5[644U]; + __OM uint32_t STIR; /*!< Offset: 0xE00 ( /W) Software Trigger Interrupt Register */ +} NVIC_Type; + +/* Software Triggered Interrupt Register Definitions */ +#define NVIC_STIR_INTID_Pos 0U /*!< STIR: INTLINESNUM Position */ +#define NVIC_STIR_INTID_Msk (0x1FFUL /*<< NVIC_STIR_INTID_Pos*/) /*!< STIR: INTLINESNUM Mask */ + +/*@} end of group CMSIS_NVIC */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCB System Control Block (SCB) + \brief Type definitions for the System Control Block Registers + @{ + */ + +/** + \brief Structure type to access the System Control Block (SCB). + */ +typedef struct +{ + __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ + __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ + __IOM uint32_t VTOR; /*!< Offset: 0x008 (R/W) Vector Table Offset Register */ + __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ + __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ + __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ + __IOM uint8_t SHP[12U]; /*!< Offset: 0x018 (R/W) System Handlers Priority Registers (4-7, 8-11, 12-15) */ + __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ + __IOM uint32_t CFSR; /*!< Offset: 0x028 (R/W) Configurable Fault Status Register */ + __IOM uint32_t HFSR; /*!< Offset: 0x02C (R/W) HardFault Status Register */ + __IOM uint32_t DFSR; /*!< Offset: 0x030 (R/W) Debug Fault Status Register */ + __IOM uint32_t MMFAR; /*!< Offset: 0x034 (R/W) MemManage Fault Address Register */ + __IOM uint32_t BFAR; /*!< Offset: 0x038 (R/W) BusFault Address Register */ + __IOM uint32_t AFSR; /*!< Offset: 0x03C (R/W) Auxiliary Fault Status Register */ + __IM uint32_t PFR[2U]; /*!< Offset: 0x040 (R/ ) Processor Feature Register */ + __IM uint32_t DFR; /*!< Offset: 0x048 (R/ ) Debug Feature Register */ + __IM uint32_t ADR; /*!< Offset: 0x04C (R/ ) Auxiliary Feature Register */ + __IM uint32_t MMFR[4U]; /*!< Offset: 0x050 (R/ ) Memory Model Feature Register */ + __IM uint32_t ISAR[5U]; /*!< Offset: 0x060 (R/ ) Instruction Set Attributes Register */ + uint32_t RESERVED0[5U]; + __IOM uint32_t CPACR; /*!< Offset: 0x088 (R/W) Coprocessor Access Control Register */ +} SCB_Type; + +/* SCB CPUID Register Definitions */ +#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ +#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ + +#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ +#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ + +#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ +#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ + +#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ +#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ + +#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ +#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ + +/* SCB Interrupt Control State Register Definitions */ +#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ +#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ + +#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ +#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ + +#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ +#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ + +#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ +#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ + +#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ +#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ + +#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ +#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ + +#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ +#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ + +#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ +#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ + +#define SCB_ICSR_RETTOBASE_Pos 11U /*!< SCB ICSR: RETTOBASE Position */ +#define SCB_ICSR_RETTOBASE_Msk (1UL << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */ + +#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ +#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ + +/* SCB Vector Table Offset Register Definitions */ +#define SCB_VTOR_TBLOFF_Pos 7U /*!< SCB VTOR: TBLOFF Position */ +#define SCB_VTOR_TBLOFF_Msk (0x1FFFFFFUL << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */ + +/* SCB Application Interrupt and Reset Control Register Definitions */ +#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ +#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ + +#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ +#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ + +#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ +#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ + +#define SCB_AIRCR_PRIGROUP_Pos 8U /*!< SCB AIRCR: PRIGROUP Position */ +#define SCB_AIRCR_PRIGROUP_Msk (7UL << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */ + +#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ +#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ + +#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ +#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ + +#define SCB_AIRCR_VECTRESET_Pos 0U /*!< SCB AIRCR: VECTRESET Position */ +#define SCB_AIRCR_VECTRESET_Msk (1UL /*<< SCB_AIRCR_VECTRESET_Pos*/) /*!< SCB AIRCR: VECTRESET Mask */ + +/* SCB System Control Register Definitions */ +#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ +#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ + +#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ +#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ + +#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ +#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ + +/* SCB Configuration Control Register Definitions */ +#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ +#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ + +#define SCB_CCR_BFHFNMIGN_Pos 8U /*!< SCB CCR: BFHFNMIGN Position */ +#define SCB_CCR_BFHFNMIGN_Msk (1UL << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */ + +#define SCB_CCR_DIV_0_TRP_Pos 4U /*!< SCB CCR: DIV_0_TRP Position */ +#define SCB_CCR_DIV_0_TRP_Msk (1UL << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */ + +#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ +#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ + +#define SCB_CCR_USERSETMPEND_Pos 1U /*!< SCB CCR: USERSETMPEND Position */ +#define SCB_CCR_USERSETMPEND_Msk (1UL << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */ + +#define SCB_CCR_NONBASETHRDENA_Pos 0U /*!< SCB CCR: NONBASETHRDENA Position */ +#define SCB_CCR_NONBASETHRDENA_Msk (1UL /*<< SCB_CCR_NONBASETHRDENA_Pos*/) /*!< SCB CCR: NONBASETHRDENA Mask */ + +/* SCB System Handler Control and State Register Definitions */ +#define SCB_SHCSR_USGFAULTENA_Pos 18U /*!< SCB SHCSR: USGFAULTENA Position */ +#define SCB_SHCSR_USGFAULTENA_Msk (1UL << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */ + +#define SCB_SHCSR_BUSFAULTENA_Pos 17U /*!< SCB SHCSR: BUSFAULTENA Position */ +#define SCB_SHCSR_BUSFAULTENA_Msk (1UL << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */ + +#define SCB_SHCSR_MEMFAULTENA_Pos 16U /*!< SCB SHCSR: MEMFAULTENA Position */ +#define SCB_SHCSR_MEMFAULTENA_Msk (1UL << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */ + +#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ +#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ + +#define SCB_SHCSR_BUSFAULTPENDED_Pos 14U /*!< SCB SHCSR: BUSFAULTPENDED Position */ +#define SCB_SHCSR_BUSFAULTPENDED_Msk (1UL << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */ + +#define SCB_SHCSR_MEMFAULTPENDED_Pos 13U /*!< SCB SHCSR: MEMFAULTPENDED Position */ +#define SCB_SHCSR_MEMFAULTPENDED_Msk (1UL << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */ + +#define SCB_SHCSR_USGFAULTPENDED_Pos 12U /*!< SCB SHCSR: USGFAULTPENDED Position */ +#define SCB_SHCSR_USGFAULTPENDED_Msk (1UL << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */ + +#define SCB_SHCSR_SYSTICKACT_Pos 11U /*!< SCB SHCSR: SYSTICKACT Position */ +#define SCB_SHCSR_SYSTICKACT_Msk (1UL << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */ + +#define SCB_SHCSR_PENDSVACT_Pos 10U /*!< SCB SHCSR: PENDSVACT Position */ +#define SCB_SHCSR_PENDSVACT_Msk (1UL << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */ + +#define SCB_SHCSR_MONITORACT_Pos 8U /*!< SCB SHCSR: MONITORACT Position */ +#define SCB_SHCSR_MONITORACT_Msk (1UL << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */ + +#define SCB_SHCSR_SVCALLACT_Pos 7U /*!< SCB SHCSR: SVCALLACT Position */ +#define SCB_SHCSR_SVCALLACT_Msk (1UL << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */ + +#define SCB_SHCSR_USGFAULTACT_Pos 3U /*!< SCB SHCSR: USGFAULTACT Position */ +#define SCB_SHCSR_USGFAULTACT_Msk (1UL << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */ + +#define SCB_SHCSR_BUSFAULTACT_Pos 1U /*!< SCB SHCSR: BUSFAULTACT Position */ +#define SCB_SHCSR_BUSFAULTACT_Msk (1UL << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */ + +#define SCB_SHCSR_MEMFAULTACT_Pos 0U /*!< SCB SHCSR: MEMFAULTACT Position */ +#define SCB_SHCSR_MEMFAULTACT_Msk (1UL /*<< SCB_SHCSR_MEMFAULTACT_Pos*/) /*!< SCB SHCSR: MEMFAULTACT Mask */ + +/* SCB Configurable Fault Status Register Definitions */ +#define SCB_CFSR_USGFAULTSR_Pos 16U /*!< SCB CFSR: Usage Fault Status Register Position */ +#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFUL << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */ + +#define SCB_CFSR_BUSFAULTSR_Pos 8U /*!< SCB CFSR: Bus Fault Status Register Position */ +#define SCB_CFSR_BUSFAULTSR_Msk (0xFFUL << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */ + +#define SCB_CFSR_MEMFAULTSR_Pos 0U /*!< SCB CFSR: Memory Manage Fault Status Register Position */ +#define SCB_CFSR_MEMFAULTSR_Msk (0xFFUL /*<< SCB_CFSR_MEMFAULTSR_Pos*/) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */ + +/* MemManage Fault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_MMARVALID_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 7U) /*!< SCB CFSR (MMFSR): MMARVALID Position */ +#define SCB_CFSR_MMARVALID_Msk (1UL << SCB_CFSR_MMARVALID_Pos) /*!< SCB CFSR (MMFSR): MMARVALID Mask */ + +#define SCB_CFSR_MLSPERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 5U) /*!< SCB CFSR (MMFSR): MLSPERR Position */ +#define SCB_CFSR_MLSPERR_Msk (1UL << SCB_CFSR_MLSPERR_Pos) /*!< SCB CFSR (MMFSR): MLSPERR Mask */ + +#define SCB_CFSR_MSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 4U) /*!< SCB CFSR (MMFSR): MSTKERR Position */ +#define SCB_CFSR_MSTKERR_Msk (1UL << SCB_CFSR_MSTKERR_Pos) /*!< SCB CFSR (MMFSR): MSTKERR Mask */ + +#define SCB_CFSR_MUNSTKERR_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 3U) /*!< SCB CFSR (MMFSR): MUNSTKERR Position */ +#define SCB_CFSR_MUNSTKERR_Msk (1UL << SCB_CFSR_MUNSTKERR_Pos) /*!< SCB CFSR (MMFSR): MUNSTKERR Mask */ + +#define SCB_CFSR_DACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 1U) /*!< SCB CFSR (MMFSR): DACCVIOL Position */ +#define SCB_CFSR_DACCVIOL_Msk (1UL << SCB_CFSR_DACCVIOL_Pos) /*!< SCB CFSR (MMFSR): DACCVIOL Mask */ + +#define SCB_CFSR_IACCVIOL_Pos (SCB_SHCSR_MEMFAULTACT_Pos + 0U) /*!< SCB CFSR (MMFSR): IACCVIOL Position */ +#define SCB_CFSR_IACCVIOL_Msk (1UL /*<< SCB_CFSR_IACCVIOL_Pos*/) /*!< SCB CFSR (MMFSR): IACCVIOL Mask */ + +/* BusFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_BFARVALID_Pos (SCB_CFSR_BUSFAULTSR_Pos + 7U) /*!< SCB CFSR (BFSR): BFARVALID Position */ +#define SCB_CFSR_BFARVALID_Msk (1UL << SCB_CFSR_BFARVALID_Pos) /*!< SCB CFSR (BFSR): BFARVALID Mask */ + +#define SCB_CFSR_LSPERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 5U) /*!< SCB CFSR (BFSR): LSPERR Position */ +#define SCB_CFSR_LSPERR_Msk (1UL << SCB_CFSR_LSPERR_Pos) /*!< SCB CFSR (BFSR): LSPERR Mask */ + +#define SCB_CFSR_STKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 4U) /*!< SCB CFSR (BFSR): STKERR Position */ +#define SCB_CFSR_STKERR_Msk (1UL << SCB_CFSR_STKERR_Pos) /*!< SCB CFSR (BFSR): STKERR Mask */ + +#define SCB_CFSR_UNSTKERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 3U) /*!< SCB CFSR (BFSR): UNSTKERR Position */ +#define SCB_CFSR_UNSTKERR_Msk (1UL << SCB_CFSR_UNSTKERR_Pos) /*!< SCB CFSR (BFSR): UNSTKERR Mask */ + +#define SCB_CFSR_IMPRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 2U) /*!< SCB CFSR (BFSR): IMPRECISERR Position */ +#define SCB_CFSR_IMPRECISERR_Msk (1UL << SCB_CFSR_IMPRECISERR_Pos) /*!< SCB CFSR (BFSR): IMPRECISERR Mask */ + +#define SCB_CFSR_PRECISERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 1U) /*!< SCB CFSR (BFSR): PRECISERR Position */ +#define SCB_CFSR_PRECISERR_Msk (1UL << SCB_CFSR_PRECISERR_Pos) /*!< SCB CFSR (BFSR): PRECISERR Mask */ + +#define SCB_CFSR_IBUSERR_Pos (SCB_CFSR_BUSFAULTSR_Pos + 0U) /*!< SCB CFSR (BFSR): IBUSERR Position */ +#define SCB_CFSR_IBUSERR_Msk (1UL << SCB_CFSR_IBUSERR_Pos) /*!< SCB CFSR (BFSR): IBUSERR Mask */ + +/* UsageFault Status Register (part of SCB Configurable Fault Status Register) */ +#define SCB_CFSR_DIVBYZERO_Pos (SCB_CFSR_USGFAULTSR_Pos + 9U) /*!< SCB CFSR (UFSR): DIVBYZERO Position */ +#define SCB_CFSR_DIVBYZERO_Msk (1UL << SCB_CFSR_DIVBYZERO_Pos) /*!< SCB CFSR (UFSR): DIVBYZERO Mask */ + +#define SCB_CFSR_UNALIGNED_Pos (SCB_CFSR_USGFAULTSR_Pos + 8U) /*!< SCB CFSR (UFSR): UNALIGNED Position */ +#define SCB_CFSR_UNALIGNED_Msk (1UL << SCB_CFSR_UNALIGNED_Pos) /*!< SCB CFSR (UFSR): UNALIGNED Mask */ + +#define SCB_CFSR_NOCP_Pos (SCB_CFSR_USGFAULTSR_Pos + 3U) /*!< SCB CFSR (UFSR): NOCP Position */ +#define SCB_CFSR_NOCP_Msk (1UL << SCB_CFSR_NOCP_Pos) /*!< SCB CFSR (UFSR): NOCP Mask */ + +#define SCB_CFSR_INVPC_Pos (SCB_CFSR_USGFAULTSR_Pos + 2U) /*!< SCB CFSR (UFSR): INVPC Position */ +#define SCB_CFSR_INVPC_Msk (1UL << SCB_CFSR_INVPC_Pos) /*!< SCB CFSR (UFSR): INVPC Mask */ + +#define SCB_CFSR_INVSTATE_Pos (SCB_CFSR_USGFAULTSR_Pos + 1U) /*!< SCB CFSR (UFSR): INVSTATE Position */ +#define SCB_CFSR_INVSTATE_Msk (1UL << SCB_CFSR_INVSTATE_Pos) /*!< SCB CFSR (UFSR): INVSTATE Mask */ + +#define SCB_CFSR_UNDEFINSTR_Pos (SCB_CFSR_USGFAULTSR_Pos + 0U) /*!< SCB CFSR (UFSR): UNDEFINSTR Position */ +#define SCB_CFSR_UNDEFINSTR_Msk (1UL << SCB_CFSR_UNDEFINSTR_Pos) /*!< SCB CFSR (UFSR): UNDEFINSTR Mask */ + +/* SCB Hard Fault Status Register Definitions */ +#define SCB_HFSR_DEBUGEVT_Pos 31U /*!< SCB HFSR: DEBUGEVT Position */ +#define SCB_HFSR_DEBUGEVT_Msk (1UL << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */ + +#define SCB_HFSR_FORCED_Pos 30U /*!< SCB HFSR: FORCED Position */ +#define SCB_HFSR_FORCED_Msk (1UL << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */ + +#define SCB_HFSR_VECTTBL_Pos 1U /*!< SCB HFSR: VECTTBL Position */ +#define SCB_HFSR_VECTTBL_Msk (1UL << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */ + +/* SCB Debug Fault Status Register Definitions */ +#define SCB_DFSR_EXTERNAL_Pos 4U /*!< SCB DFSR: EXTERNAL Position */ +#define SCB_DFSR_EXTERNAL_Msk (1UL << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */ + +#define SCB_DFSR_VCATCH_Pos 3U /*!< SCB DFSR: VCATCH Position */ +#define SCB_DFSR_VCATCH_Msk (1UL << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */ + +#define SCB_DFSR_DWTTRAP_Pos 2U /*!< SCB DFSR: DWTTRAP Position */ +#define SCB_DFSR_DWTTRAP_Msk (1UL << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */ + +#define SCB_DFSR_BKPT_Pos 1U /*!< SCB DFSR: BKPT Position */ +#define SCB_DFSR_BKPT_Msk (1UL << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */ + +#define SCB_DFSR_HALTED_Pos 0U /*!< SCB DFSR: HALTED Position */ +#define SCB_DFSR_HALTED_Msk (1UL /*<< SCB_DFSR_HALTED_Pos*/) /*!< SCB DFSR: HALTED Mask */ + +/*@} end of group CMSIS_SCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SCnSCB System Controls not in SCB (SCnSCB) + \brief Type definitions for the System Control and ID Register not in the SCB + @{ + */ + +/** + \brief Structure type to access the System Control and ID Register not in the SCB. + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IM uint32_t ICTR; /*!< Offset: 0x004 (R/ ) Interrupt Controller Type Register */ + __IOM uint32_t ACTLR; /*!< Offset: 0x008 (R/W) Auxiliary Control Register */ +} SCnSCB_Type; + +/* Interrupt Controller Type Register Definitions */ +#define SCnSCB_ICTR_INTLINESNUM_Pos 0U /*!< ICTR: INTLINESNUM Position */ +#define SCnSCB_ICTR_INTLINESNUM_Msk (0xFUL /*<< SCnSCB_ICTR_INTLINESNUM_Pos*/) /*!< ICTR: INTLINESNUM Mask */ + +/* Auxiliary Control Register Definitions */ +#define SCnSCB_ACTLR_DISOOFP_Pos 9U /*!< ACTLR: DISOOFP Position */ +#define SCnSCB_ACTLR_DISOOFP_Msk (1UL << SCnSCB_ACTLR_DISOOFP_Pos) /*!< ACTLR: DISOOFP Mask */ + +#define SCnSCB_ACTLR_DISFPCA_Pos 8U /*!< ACTLR: DISFPCA Position */ +#define SCnSCB_ACTLR_DISFPCA_Msk (1UL << SCnSCB_ACTLR_DISFPCA_Pos) /*!< ACTLR: DISFPCA Mask */ + +#define SCnSCB_ACTLR_DISFOLD_Pos 2U /*!< ACTLR: DISFOLD Position */ +#define SCnSCB_ACTLR_DISFOLD_Msk (1UL << SCnSCB_ACTLR_DISFOLD_Pos) /*!< ACTLR: DISFOLD Mask */ + +#define SCnSCB_ACTLR_DISDEFWBUF_Pos 1U /*!< ACTLR: DISDEFWBUF Position */ +#define SCnSCB_ACTLR_DISDEFWBUF_Msk (1UL << SCnSCB_ACTLR_DISDEFWBUF_Pos) /*!< ACTLR: DISDEFWBUF Mask */ + +#define SCnSCB_ACTLR_DISMCYCINT_Pos 0U /*!< ACTLR: DISMCYCINT Position */ +#define SCnSCB_ACTLR_DISMCYCINT_Msk (1UL /*<< SCnSCB_ACTLR_DISMCYCINT_Pos*/) /*!< ACTLR: DISMCYCINT Mask */ + +/*@} end of group CMSIS_SCnotSCB */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_SysTick System Tick Timer (SysTick) + \brief Type definitions for the System Timer Registers. + @{ + */ + +/** + \brief Structure type to access the System Timer (SysTick). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ + __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; + +/* SysTick Control / Status Register Definitions */ +#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ +#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ + +#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ +#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ + +#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ +#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ + +#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ +#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ + +/* SysTick Reload Register Definitions */ +#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ +#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ + +/* SysTick Current Register Definitions */ +#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ +#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ + +/* SysTick Calibration Register Definitions */ +#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ +#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ + +#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ +#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ + +#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ +#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ + +/*@} end of group CMSIS_SysTick */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_ITM Instrumentation Trace Macrocell (ITM) + \brief Type definitions for the Instrumentation Trace Macrocell (ITM) + @{ + */ + +/** + \brief Structure type to access the Instrumentation Trace Macrocell Register (ITM). + */ +typedef struct +{ + __OM union + { + __OM uint8_t u8; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 8-bit */ + __OM uint16_t u16; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 16-bit */ + __OM uint32_t u32; /*!< Offset: 0x000 ( /W) ITM Stimulus Port 32-bit */ + } PORT [32U]; /*!< Offset: 0x000 ( /W) ITM Stimulus Port Registers */ + uint32_t RESERVED0[864U]; + __IOM uint32_t TER; /*!< Offset: 0xE00 (R/W) ITM Trace Enable Register */ + uint32_t RESERVED1[15U]; + __IOM uint32_t TPR; /*!< Offset: 0xE40 (R/W) ITM Trace Privilege Register */ + uint32_t RESERVED2[15U]; + __IOM uint32_t TCR; /*!< Offset: 0xE80 (R/W) ITM Trace Control Register */ + uint32_t RESERVED3[29U]; + __OM uint32_t IWR; /*!< Offset: 0xEF8 ( /W) ITM Integration Write Register */ + __IM uint32_t IRR; /*!< Offset: 0xEFC (R/ ) ITM Integration Read Register */ + __IOM uint32_t IMCR; /*!< Offset: 0xF00 (R/W) ITM Integration Mode Control Register */ + uint32_t RESERVED4[43U]; + __OM uint32_t LAR; /*!< Offset: 0xFB0 ( /W) ITM Lock Access Register */ + __IM uint32_t LSR; /*!< Offset: 0xFB4 (R/ ) ITM Lock Status Register */ + uint32_t RESERVED5[6U]; + __IM uint32_t PID4; /*!< Offset: 0xFD0 (R/ ) ITM Peripheral Identification Register #4 */ + __IM uint32_t PID5; /*!< Offset: 0xFD4 (R/ ) ITM Peripheral Identification Register #5 */ + __IM uint32_t PID6; /*!< Offset: 0xFD8 (R/ ) ITM Peripheral Identification Register #6 */ + __IM uint32_t PID7; /*!< Offset: 0xFDC (R/ ) ITM Peripheral Identification Register #7 */ + __IM uint32_t PID0; /*!< Offset: 0xFE0 (R/ ) ITM Peripheral Identification Register #0 */ + __IM uint32_t PID1; /*!< Offset: 0xFE4 (R/ ) ITM Peripheral Identification Register #1 */ + __IM uint32_t PID2; /*!< Offset: 0xFE8 (R/ ) ITM Peripheral Identification Register #2 */ + __IM uint32_t PID3; /*!< Offset: 0xFEC (R/ ) ITM Peripheral Identification Register #3 */ + __IM uint32_t CID0; /*!< Offset: 0xFF0 (R/ ) ITM Component Identification Register #0 */ + __IM uint32_t CID1; /*!< Offset: 0xFF4 (R/ ) ITM Component Identification Register #1 */ + __IM uint32_t CID2; /*!< Offset: 0xFF8 (R/ ) ITM Component Identification Register #2 */ + __IM uint32_t CID3; /*!< Offset: 0xFFC (R/ ) ITM Component Identification Register #3 */ +} ITM_Type; + +/* ITM Trace Privilege Register Definitions */ +#define ITM_TPR_PRIVMASK_Pos 0U /*!< ITM TPR: PRIVMASK Position */ +#define ITM_TPR_PRIVMASK_Msk (0xFUL /*<< ITM_TPR_PRIVMASK_Pos*/) /*!< ITM TPR: PRIVMASK Mask */ + +/* ITM Trace Control Register Definitions */ +#define ITM_TCR_BUSY_Pos 23U /*!< ITM TCR: BUSY Position */ +#define ITM_TCR_BUSY_Msk (1UL << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */ + +#define ITM_TCR_TraceBusID_Pos 16U /*!< ITM TCR: ATBID Position */ +#define ITM_TCR_TraceBusID_Msk (0x7FUL << ITM_TCR_TraceBusID_Pos) /*!< ITM TCR: ATBID Mask */ + +#define ITM_TCR_GTSFREQ_Pos 10U /*!< ITM TCR: Global timestamp frequency Position */ +#define ITM_TCR_GTSFREQ_Msk (3UL << ITM_TCR_GTSFREQ_Pos) /*!< ITM TCR: Global timestamp frequency Mask */ + +#define ITM_TCR_TSPrescale_Pos 8U /*!< ITM TCR: TSPrescale Position */ +#define ITM_TCR_TSPrescale_Msk (3UL << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */ + +#define ITM_TCR_SWOENA_Pos 4U /*!< ITM TCR: SWOENA Position */ +#define ITM_TCR_SWOENA_Msk (1UL << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */ + +#define ITM_TCR_DWTENA_Pos 3U /*!< ITM TCR: DWTENA Position */ +#define ITM_TCR_DWTENA_Msk (1UL << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */ + +#define ITM_TCR_SYNCENA_Pos 2U /*!< ITM TCR: SYNCENA Position */ +#define ITM_TCR_SYNCENA_Msk (1UL << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */ + +#define ITM_TCR_TSENA_Pos 1U /*!< ITM TCR: TSENA Position */ +#define ITM_TCR_TSENA_Msk (1UL << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */ + +#define ITM_TCR_ITMENA_Pos 0U /*!< ITM TCR: ITM Enable bit Position */ +#define ITM_TCR_ITMENA_Msk (1UL /*<< ITM_TCR_ITMENA_Pos*/) /*!< ITM TCR: ITM Enable bit Mask */ + +/* ITM Integration Write Register Definitions */ +#define ITM_IWR_ATVALIDM_Pos 0U /*!< ITM IWR: ATVALIDM Position */ +#define ITM_IWR_ATVALIDM_Msk (1UL /*<< ITM_IWR_ATVALIDM_Pos*/) /*!< ITM IWR: ATVALIDM Mask */ + +/* ITM Integration Read Register Definitions */ +#define ITM_IRR_ATREADYM_Pos 0U /*!< ITM IRR: ATREADYM Position */ +#define ITM_IRR_ATREADYM_Msk (1UL /*<< ITM_IRR_ATREADYM_Pos*/) /*!< ITM IRR: ATREADYM Mask */ + +/* ITM Integration Mode Control Register Definitions */ +#define ITM_IMCR_INTEGRATION_Pos 0U /*!< ITM IMCR: INTEGRATION Position */ +#define ITM_IMCR_INTEGRATION_Msk (1UL /*<< ITM_IMCR_INTEGRATION_Pos*/) /*!< ITM IMCR: INTEGRATION Mask */ + +/* ITM Lock Status Register Definitions */ +#define ITM_LSR_ByteAcc_Pos 2U /*!< ITM LSR: ByteAcc Position */ +#define ITM_LSR_ByteAcc_Msk (1UL << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */ + +#define ITM_LSR_Access_Pos 1U /*!< ITM LSR: Access Position */ +#define ITM_LSR_Access_Msk (1UL << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */ + +#define ITM_LSR_Present_Pos 0U /*!< ITM LSR: Present Position */ +#define ITM_LSR_Present_Msk (1UL /*<< ITM_LSR_Present_Pos*/) /*!< ITM LSR: Present Mask */ + +/*@}*/ /* end of group CMSIS_ITM */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_DWT Data Watchpoint and Trace (DWT) + \brief Type definitions for the Data Watchpoint and Trace (DWT) + @{ + */ + +/** + \brief Structure type to access the Data Watchpoint and Trace Register (DWT). + */ +typedef struct +{ + __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + __IOM uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ + __IOM uint32_t CPICNT; /*!< Offset: 0x008 (R/W) CPI Count Register */ + __IOM uint32_t EXCCNT; /*!< Offset: 0x00C (R/W) Exception Overhead Count Register */ + __IOM uint32_t SLEEPCNT; /*!< Offset: 0x010 (R/W) Sleep Count Register */ + __IOM uint32_t LSUCNT; /*!< Offset: 0x014 (R/W) LSU Count Register */ + __IOM uint32_t FOLDCNT; /*!< Offset: 0x018 (R/W) Folded-instruction Count Register */ + __IM uint32_t PCSR; /*!< Offset: 0x01C (R/ ) Program Counter Sample Register */ + __IOM uint32_t COMP0; /*!< Offset: 0x020 (R/W) Comparator Register 0 */ + __IOM uint32_t MASK0; /*!< Offset: 0x024 (R/W) Mask Register 0 */ + __IOM uint32_t FUNCTION0; /*!< Offset: 0x028 (R/W) Function Register 0 */ + uint32_t RESERVED0[1U]; + __IOM uint32_t COMP1; /*!< Offset: 0x030 (R/W) Comparator Register 1 */ + __IOM uint32_t MASK1; /*!< Offset: 0x034 (R/W) Mask Register 1 */ + __IOM uint32_t FUNCTION1; /*!< Offset: 0x038 (R/W) Function Register 1 */ + uint32_t RESERVED1[1U]; + __IOM uint32_t COMP2; /*!< Offset: 0x040 (R/W) Comparator Register 2 */ + __IOM uint32_t MASK2; /*!< Offset: 0x044 (R/W) Mask Register 2 */ + __IOM uint32_t FUNCTION2; /*!< Offset: 0x048 (R/W) Function Register 2 */ + uint32_t RESERVED2[1U]; + __IOM uint32_t COMP3; /*!< Offset: 0x050 (R/W) Comparator Register 3 */ + __IOM uint32_t MASK3; /*!< Offset: 0x054 (R/W) Mask Register 3 */ + __IOM uint32_t FUNCTION3; /*!< Offset: 0x058 (R/W) Function Register 3 */ +} DWT_Type; + +/* DWT Control Register Definitions */ +#define DWT_CTRL_NUMCOMP_Pos 28U /*!< DWT CTRL: NUMCOMP Position */ +#define DWT_CTRL_NUMCOMP_Msk (0xFUL << DWT_CTRL_NUMCOMP_Pos) /*!< DWT CTRL: NUMCOMP Mask */ + +#define DWT_CTRL_NOTRCPKT_Pos 27U /*!< DWT CTRL: NOTRCPKT Position */ +#define DWT_CTRL_NOTRCPKT_Msk (0x1UL << DWT_CTRL_NOTRCPKT_Pos) /*!< DWT CTRL: NOTRCPKT Mask */ + +#define DWT_CTRL_NOEXTTRIG_Pos 26U /*!< DWT CTRL: NOEXTTRIG Position */ +#define DWT_CTRL_NOEXTTRIG_Msk (0x1UL << DWT_CTRL_NOEXTTRIG_Pos) /*!< DWT CTRL: NOEXTTRIG Mask */ + +#define DWT_CTRL_NOCYCCNT_Pos 25U /*!< DWT CTRL: NOCYCCNT Position */ +#define DWT_CTRL_NOCYCCNT_Msk (0x1UL << DWT_CTRL_NOCYCCNT_Pos) /*!< DWT CTRL: NOCYCCNT Mask */ + +#define DWT_CTRL_NOPRFCNT_Pos 24U /*!< DWT CTRL: NOPRFCNT Position */ +#define DWT_CTRL_NOPRFCNT_Msk (0x1UL << DWT_CTRL_NOPRFCNT_Pos) /*!< DWT CTRL: NOPRFCNT Mask */ + +#define DWT_CTRL_CYCEVTENA_Pos 22U /*!< DWT CTRL: CYCEVTENA Position */ +#define DWT_CTRL_CYCEVTENA_Msk (0x1UL << DWT_CTRL_CYCEVTENA_Pos) /*!< DWT CTRL: CYCEVTENA Mask */ + +#define DWT_CTRL_FOLDEVTENA_Pos 21U /*!< DWT CTRL: FOLDEVTENA Position */ +#define DWT_CTRL_FOLDEVTENA_Msk (0x1UL << DWT_CTRL_FOLDEVTENA_Pos) /*!< DWT CTRL: FOLDEVTENA Mask */ + +#define DWT_CTRL_LSUEVTENA_Pos 20U /*!< DWT CTRL: LSUEVTENA Position */ +#define DWT_CTRL_LSUEVTENA_Msk (0x1UL << DWT_CTRL_LSUEVTENA_Pos) /*!< DWT CTRL: LSUEVTENA Mask */ + +#define DWT_CTRL_SLEEPEVTENA_Pos 19U /*!< DWT CTRL: SLEEPEVTENA Position */ +#define DWT_CTRL_SLEEPEVTENA_Msk (0x1UL << DWT_CTRL_SLEEPEVTENA_Pos) /*!< DWT CTRL: SLEEPEVTENA Mask */ + +#define DWT_CTRL_EXCEVTENA_Pos 18U /*!< DWT CTRL: EXCEVTENA Position */ +#define DWT_CTRL_EXCEVTENA_Msk (0x1UL << DWT_CTRL_EXCEVTENA_Pos) /*!< DWT CTRL: EXCEVTENA Mask */ + +#define DWT_CTRL_CPIEVTENA_Pos 17U /*!< DWT CTRL: CPIEVTENA Position */ +#define DWT_CTRL_CPIEVTENA_Msk (0x1UL << DWT_CTRL_CPIEVTENA_Pos) /*!< DWT CTRL: CPIEVTENA Mask */ + +#define DWT_CTRL_EXCTRCENA_Pos 16U /*!< DWT CTRL: EXCTRCENA Position */ +#define DWT_CTRL_EXCTRCENA_Msk (0x1UL << DWT_CTRL_EXCTRCENA_Pos) /*!< DWT CTRL: EXCTRCENA Mask */ + +#define DWT_CTRL_PCSAMPLENA_Pos 12U /*!< DWT CTRL: PCSAMPLENA Position */ +#define DWT_CTRL_PCSAMPLENA_Msk (0x1UL << DWT_CTRL_PCSAMPLENA_Pos) /*!< DWT CTRL: PCSAMPLENA Mask */ + +#define DWT_CTRL_SYNCTAP_Pos 10U /*!< DWT CTRL: SYNCTAP Position */ +#define DWT_CTRL_SYNCTAP_Msk (0x3UL << DWT_CTRL_SYNCTAP_Pos) /*!< DWT CTRL: SYNCTAP Mask */ + +#define DWT_CTRL_CYCTAP_Pos 9U /*!< DWT CTRL: CYCTAP Position */ +#define DWT_CTRL_CYCTAP_Msk (0x1UL << DWT_CTRL_CYCTAP_Pos) /*!< DWT CTRL: CYCTAP Mask */ + +#define DWT_CTRL_POSTINIT_Pos 5U /*!< DWT CTRL: POSTINIT Position */ +#define DWT_CTRL_POSTINIT_Msk (0xFUL << DWT_CTRL_POSTINIT_Pos) /*!< DWT CTRL: POSTINIT Mask */ + +#define DWT_CTRL_POSTPRESET_Pos 1U /*!< DWT CTRL: POSTPRESET Position */ +#define DWT_CTRL_POSTPRESET_Msk (0xFUL << DWT_CTRL_POSTPRESET_Pos) /*!< DWT CTRL: POSTPRESET Mask */ + +#define DWT_CTRL_CYCCNTENA_Pos 0U /*!< DWT CTRL: CYCCNTENA Position */ +#define DWT_CTRL_CYCCNTENA_Msk (0x1UL /*<< DWT_CTRL_CYCCNTENA_Pos*/) /*!< DWT CTRL: CYCCNTENA Mask */ + +/* DWT CPI Count Register Definitions */ +#define DWT_CPICNT_CPICNT_Pos 0U /*!< DWT CPICNT: CPICNT Position */ +#define DWT_CPICNT_CPICNT_Msk (0xFFUL /*<< DWT_CPICNT_CPICNT_Pos*/) /*!< DWT CPICNT: CPICNT Mask */ + +/* DWT Exception Overhead Count Register Definitions */ +#define DWT_EXCCNT_EXCCNT_Pos 0U /*!< DWT EXCCNT: EXCCNT Position */ +#define DWT_EXCCNT_EXCCNT_Msk (0xFFUL /*<< DWT_EXCCNT_EXCCNT_Pos*/) /*!< DWT EXCCNT: EXCCNT Mask */ + +/* DWT Sleep Count Register Definitions */ +#define DWT_SLEEPCNT_SLEEPCNT_Pos 0U /*!< DWT SLEEPCNT: SLEEPCNT Position */ +#define DWT_SLEEPCNT_SLEEPCNT_Msk (0xFFUL /*<< DWT_SLEEPCNT_SLEEPCNT_Pos*/) /*!< DWT SLEEPCNT: SLEEPCNT Mask */ + +/* DWT LSU Count Register Definitions */ +#define DWT_LSUCNT_LSUCNT_Pos 0U /*!< DWT LSUCNT: LSUCNT Position */ +#define DWT_LSUCNT_LSUCNT_Msk (0xFFUL /*<< DWT_LSUCNT_LSUCNT_Pos*/) /*!< DWT LSUCNT: LSUCNT Mask */ + +/* DWT Folded-instruction Count Register Definitions */ +#define DWT_FOLDCNT_FOLDCNT_Pos 0U /*!< DWT FOLDCNT: FOLDCNT Position */ +#define DWT_FOLDCNT_FOLDCNT_Msk (0xFFUL /*<< DWT_FOLDCNT_FOLDCNT_Pos*/) /*!< DWT FOLDCNT: FOLDCNT Mask */ + +/* DWT Comparator Mask Register Definitions */ +#define DWT_MASK_MASK_Pos 0U /*!< DWT MASK: MASK Position */ +#define DWT_MASK_MASK_Msk (0x1FUL /*<< DWT_MASK_MASK_Pos*/) /*!< DWT MASK: MASK Mask */ + +/* DWT Comparator Function Register Definitions */ +#define DWT_FUNCTION_MATCHED_Pos 24U /*!< DWT FUNCTION: MATCHED Position */ +#define DWT_FUNCTION_MATCHED_Msk (0x1UL << DWT_FUNCTION_MATCHED_Pos) /*!< DWT FUNCTION: MATCHED Mask */ + +#define DWT_FUNCTION_DATAVADDR1_Pos 16U /*!< DWT FUNCTION: DATAVADDR1 Position */ +#define DWT_FUNCTION_DATAVADDR1_Msk (0xFUL << DWT_FUNCTION_DATAVADDR1_Pos) /*!< DWT FUNCTION: DATAVADDR1 Mask */ + +#define DWT_FUNCTION_DATAVADDR0_Pos 12U /*!< DWT FUNCTION: DATAVADDR0 Position */ +#define DWT_FUNCTION_DATAVADDR0_Msk (0xFUL << DWT_FUNCTION_DATAVADDR0_Pos) /*!< DWT FUNCTION: DATAVADDR0 Mask */ + +#define DWT_FUNCTION_DATAVSIZE_Pos 10U /*!< DWT FUNCTION: DATAVSIZE Position */ +#define DWT_FUNCTION_DATAVSIZE_Msk (0x3UL << DWT_FUNCTION_DATAVSIZE_Pos) /*!< DWT FUNCTION: DATAVSIZE Mask */ + +#define DWT_FUNCTION_LNK1ENA_Pos 9U /*!< DWT FUNCTION: LNK1ENA Position */ +#define DWT_FUNCTION_LNK1ENA_Msk (0x1UL << DWT_FUNCTION_LNK1ENA_Pos) /*!< DWT FUNCTION: LNK1ENA Mask */ + +#define DWT_FUNCTION_DATAVMATCH_Pos 8U /*!< DWT FUNCTION: DATAVMATCH Position */ +#define DWT_FUNCTION_DATAVMATCH_Msk (0x1UL << DWT_FUNCTION_DATAVMATCH_Pos) /*!< DWT FUNCTION: DATAVMATCH Mask */ + +#define DWT_FUNCTION_CYCMATCH_Pos 7U /*!< DWT FUNCTION: CYCMATCH Position */ +#define DWT_FUNCTION_CYCMATCH_Msk (0x1UL << DWT_FUNCTION_CYCMATCH_Pos) /*!< DWT FUNCTION: CYCMATCH Mask */ + +#define DWT_FUNCTION_EMITRANGE_Pos 5U /*!< DWT FUNCTION: EMITRANGE Position */ +#define DWT_FUNCTION_EMITRANGE_Msk (0x1UL << DWT_FUNCTION_EMITRANGE_Pos) /*!< DWT FUNCTION: EMITRANGE Mask */ + +#define DWT_FUNCTION_FUNCTION_Pos 0U /*!< DWT FUNCTION: FUNCTION Position */ +#define DWT_FUNCTION_FUNCTION_Msk (0xFUL /*<< DWT_FUNCTION_FUNCTION_Pos*/) /*!< DWT FUNCTION: FUNCTION Mask */ + +/*@}*/ /* end of group CMSIS_DWT */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_TPI Trace Port Interface (TPI) + \brief Type definitions for the Trace Port Interface (TPI) + @{ + */ + +/** + \brief Structure type to access the Trace Port Interface Register (TPI). + */ +typedef struct +{ + __IOM uint32_t SSPSR; /*!< Offset: 0x000 (R/ ) Supported Parallel Port Size Register */ + __IOM uint32_t CSPSR; /*!< Offset: 0x004 (R/W) Current Parallel Port Size Register */ + uint32_t RESERVED0[2U]; + __IOM uint32_t ACPR; /*!< Offset: 0x010 (R/W) Asynchronous Clock Prescaler Register */ + uint32_t RESERVED1[55U]; + __IOM uint32_t SPPR; /*!< Offset: 0x0F0 (R/W) Selected Pin Protocol Register */ + uint32_t RESERVED2[131U]; + __IM uint32_t FFSR; /*!< Offset: 0x300 (R/ ) Formatter and Flush Status Register */ + __IOM uint32_t FFCR; /*!< Offset: 0x304 (R/W) Formatter and Flush Control Register */ + __IM uint32_t FSCR; /*!< Offset: 0x308 (R/ ) Formatter Synchronization Counter Register */ + uint32_t RESERVED3[759U]; + __IM uint32_t TRIGGER; /*!< Offset: 0xEE8 (R/ ) TRIGGER */ + __IM uint32_t FIFO0; /*!< Offset: 0xEEC (R/ ) Integration ETM Data */ + __IM uint32_t ITATBCTR2; /*!< Offset: 0xEF0 (R/ ) ITATBCTR2 */ + uint32_t RESERVED4[1U]; + __IM uint32_t ITATBCTR0; /*!< Offset: 0xEF8 (R/ ) ITATBCTR0 */ + __IM uint32_t FIFO1; /*!< Offset: 0xEFC (R/ ) Integration ITM Data */ + __IOM uint32_t ITCTRL; /*!< Offset: 0xF00 (R/W) Integration Mode Control */ + uint32_t RESERVED5[39U]; + __IOM uint32_t CLAIMSET; /*!< Offset: 0xFA0 (R/W) Claim tag set */ + __IOM uint32_t CLAIMCLR; /*!< Offset: 0xFA4 (R/W) Claim tag clear */ + uint32_t RESERVED7[8U]; + __IM uint32_t DEVID; /*!< Offset: 0xFC8 (R/ ) TPIU_DEVID */ + __IM uint32_t DEVTYPE; /*!< Offset: 0xFCC (R/ ) TPIU_DEVTYPE */ +} TPI_Type; + +/* TPI Asynchronous Clock Prescaler Register Definitions */ +#define TPI_ACPR_PRESCALER_Pos 0U /*!< TPI ACPR: PRESCALER Position */ +#define TPI_ACPR_PRESCALER_Msk (0x1FFFUL /*<< TPI_ACPR_PRESCALER_Pos*/) /*!< TPI ACPR: PRESCALER Mask */ + +/* TPI Selected Pin Protocol Register Definitions */ +#define TPI_SPPR_TXMODE_Pos 0U /*!< TPI SPPR: TXMODE Position */ +#define TPI_SPPR_TXMODE_Msk (0x3UL /*<< TPI_SPPR_TXMODE_Pos*/) /*!< TPI SPPR: TXMODE Mask */ + +/* TPI Formatter and Flush Status Register Definitions */ +#define TPI_FFSR_FtNonStop_Pos 3U /*!< TPI FFSR: FtNonStop Position */ +#define TPI_FFSR_FtNonStop_Msk (0x1UL << TPI_FFSR_FtNonStop_Pos) /*!< TPI FFSR: FtNonStop Mask */ + +#define TPI_FFSR_TCPresent_Pos 2U /*!< TPI FFSR: TCPresent Position */ +#define TPI_FFSR_TCPresent_Msk (0x1UL << TPI_FFSR_TCPresent_Pos) /*!< TPI FFSR: TCPresent Mask */ + +#define TPI_FFSR_FtStopped_Pos 1U /*!< TPI FFSR: FtStopped Position */ +#define TPI_FFSR_FtStopped_Msk (0x1UL << TPI_FFSR_FtStopped_Pos) /*!< TPI FFSR: FtStopped Mask */ + +#define TPI_FFSR_FlInProg_Pos 0U /*!< TPI FFSR: FlInProg Position */ +#define TPI_FFSR_FlInProg_Msk (0x1UL /*<< TPI_FFSR_FlInProg_Pos*/) /*!< TPI FFSR: FlInProg Mask */ + +/* TPI Formatter and Flush Control Register Definitions */ +#define TPI_FFCR_TrigIn_Pos 8U /*!< TPI FFCR: TrigIn Position */ +#define TPI_FFCR_TrigIn_Msk (0x1UL << TPI_FFCR_TrigIn_Pos) /*!< TPI FFCR: TrigIn Mask */ + +#define TPI_FFCR_EnFCont_Pos 1U /*!< TPI FFCR: EnFCont Position */ +#define TPI_FFCR_EnFCont_Msk (0x1UL << TPI_FFCR_EnFCont_Pos) /*!< TPI FFCR: EnFCont Mask */ + +/* TPI TRIGGER Register Definitions */ +#define TPI_TRIGGER_TRIGGER_Pos 0U /*!< TPI TRIGGER: TRIGGER Position */ +#define TPI_TRIGGER_TRIGGER_Msk (0x1UL /*<< TPI_TRIGGER_TRIGGER_Pos*/) /*!< TPI TRIGGER: TRIGGER Mask */ + +/* TPI Integration ETM Data Register Definitions (FIFO0) */ +#define TPI_FIFO0_ITM_ATVALID_Pos 29U /*!< TPI FIFO0: ITM_ATVALID Position */ +#define TPI_FIFO0_ITM_ATVALID_Msk (0x3UL << TPI_FIFO0_ITM_ATVALID_Pos) /*!< TPI FIFO0: ITM_ATVALID Mask */ + +#define TPI_FIFO0_ITM_bytecount_Pos 27U /*!< TPI FIFO0: ITM_bytecount Position */ +#define TPI_FIFO0_ITM_bytecount_Msk (0x3UL << TPI_FIFO0_ITM_bytecount_Pos) /*!< TPI FIFO0: ITM_bytecount Mask */ + +#define TPI_FIFO0_ETM_ATVALID_Pos 26U /*!< TPI FIFO0: ETM_ATVALID Position */ +#define TPI_FIFO0_ETM_ATVALID_Msk (0x3UL << TPI_FIFO0_ETM_ATVALID_Pos) /*!< TPI FIFO0: ETM_ATVALID Mask */ + +#define TPI_FIFO0_ETM_bytecount_Pos 24U /*!< TPI FIFO0: ETM_bytecount Position */ +#define TPI_FIFO0_ETM_bytecount_Msk (0x3UL << TPI_FIFO0_ETM_bytecount_Pos) /*!< TPI FIFO0: ETM_bytecount Mask */ + +#define TPI_FIFO0_ETM2_Pos 16U /*!< TPI FIFO0: ETM2 Position */ +#define TPI_FIFO0_ETM2_Msk (0xFFUL << TPI_FIFO0_ETM2_Pos) /*!< TPI FIFO0: ETM2 Mask */ + +#define TPI_FIFO0_ETM1_Pos 8U /*!< TPI FIFO0: ETM1 Position */ +#define TPI_FIFO0_ETM1_Msk (0xFFUL << TPI_FIFO0_ETM1_Pos) /*!< TPI FIFO0: ETM1 Mask */ + +#define TPI_FIFO0_ETM0_Pos 0U /*!< TPI FIFO0: ETM0 Position */ +#define TPI_FIFO0_ETM0_Msk (0xFFUL /*<< TPI_FIFO0_ETM0_Pos*/) /*!< TPI FIFO0: ETM0 Mask */ + +/* TPI ITATBCTR2 Register Definitions */ +#define TPI_ITATBCTR2_ATREADY_Pos 0U /*!< TPI ITATBCTR2: ATREADY Position */ +#define TPI_ITATBCTR2_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR2_ATREADY_Pos*/) /*!< TPI ITATBCTR2: ATREADY Mask */ + +/* TPI Integration ITM Data Register Definitions (FIFO1) */ +#define TPI_FIFO1_ITM_ATVALID_Pos 29U /*!< TPI FIFO1: ITM_ATVALID Position */ +#define TPI_FIFO1_ITM_ATVALID_Msk (0x3UL << TPI_FIFO1_ITM_ATVALID_Pos) /*!< TPI FIFO1: ITM_ATVALID Mask */ + +#define TPI_FIFO1_ITM_bytecount_Pos 27U /*!< TPI FIFO1: ITM_bytecount Position */ +#define TPI_FIFO1_ITM_bytecount_Msk (0x3UL << TPI_FIFO1_ITM_bytecount_Pos) /*!< TPI FIFO1: ITM_bytecount Mask */ + +#define TPI_FIFO1_ETM_ATVALID_Pos 26U /*!< TPI FIFO1: ETM_ATVALID Position */ +#define TPI_FIFO1_ETM_ATVALID_Msk (0x3UL << TPI_FIFO1_ETM_ATVALID_Pos) /*!< TPI FIFO1: ETM_ATVALID Mask */ + +#define TPI_FIFO1_ETM_bytecount_Pos 24U /*!< TPI FIFO1: ETM_bytecount Position */ +#define TPI_FIFO1_ETM_bytecount_Msk (0x3UL << TPI_FIFO1_ETM_bytecount_Pos) /*!< TPI FIFO1: ETM_bytecount Mask */ + +#define TPI_FIFO1_ITM2_Pos 16U /*!< TPI FIFO1: ITM2 Position */ +#define TPI_FIFO1_ITM2_Msk (0xFFUL << TPI_FIFO1_ITM2_Pos) /*!< TPI FIFO1: ITM2 Mask */ + +#define TPI_FIFO1_ITM1_Pos 8U /*!< TPI FIFO1: ITM1 Position */ +#define TPI_FIFO1_ITM1_Msk (0xFFUL << TPI_FIFO1_ITM1_Pos) /*!< TPI FIFO1: ITM1 Mask */ + +#define TPI_FIFO1_ITM0_Pos 0U /*!< TPI FIFO1: ITM0 Position */ +#define TPI_FIFO1_ITM0_Msk (0xFFUL /*<< TPI_FIFO1_ITM0_Pos*/) /*!< TPI FIFO1: ITM0 Mask */ + +/* TPI ITATBCTR0 Register Definitions */ +#define TPI_ITATBCTR0_ATREADY_Pos 0U /*!< TPI ITATBCTR0: ATREADY Position */ +#define TPI_ITATBCTR0_ATREADY_Msk (0x1UL /*<< TPI_ITATBCTR0_ATREADY_Pos*/) /*!< TPI ITATBCTR0: ATREADY Mask */ + +/* TPI Integration Mode Control Register Definitions */ +#define TPI_ITCTRL_Mode_Pos 0U /*!< TPI ITCTRL: Mode Position */ +#define TPI_ITCTRL_Mode_Msk (0x1UL /*<< TPI_ITCTRL_Mode_Pos*/) /*!< TPI ITCTRL: Mode Mask */ + +/* TPI DEVID Register Definitions */ +#define TPI_DEVID_NRZVALID_Pos 11U /*!< TPI DEVID: NRZVALID Position */ +#define TPI_DEVID_NRZVALID_Msk (0x1UL << TPI_DEVID_NRZVALID_Pos) /*!< TPI DEVID: NRZVALID Mask */ + +#define TPI_DEVID_MANCVALID_Pos 10U /*!< TPI DEVID: MANCVALID Position */ +#define TPI_DEVID_MANCVALID_Msk (0x1UL << TPI_DEVID_MANCVALID_Pos) /*!< TPI DEVID: MANCVALID Mask */ + +#define TPI_DEVID_PTINVALID_Pos 9U /*!< TPI DEVID: PTINVALID Position */ +#define TPI_DEVID_PTINVALID_Msk (0x1UL << TPI_DEVID_PTINVALID_Pos) /*!< TPI DEVID: PTINVALID Mask */ + +#define TPI_DEVID_MinBufSz_Pos 6U /*!< TPI DEVID: MinBufSz Position */ +#define TPI_DEVID_MinBufSz_Msk (0x7UL << TPI_DEVID_MinBufSz_Pos) /*!< TPI DEVID: MinBufSz Mask */ + +#define TPI_DEVID_AsynClkIn_Pos 5U /*!< TPI DEVID: AsynClkIn Position */ +#define TPI_DEVID_AsynClkIn_Msk (0x1UL << TPI_DEVID_AsynClkIn_Pos) /*!< TPI DEVID: AsynClkIn Mask */ + +#define TPI_DEVID_NrTraceInput_Pos 0U /*!< TPI DEVID: NrTraceInput Position */ +#define TPI_DEVID_NrTraceInput_Msk (0x1FUL /*<< TPI_DEVID_NrTraceInput_Pos*/) /*!< TPI DEVID: NrTraceInput Mask */ + +/* TPI DEVTYPE Register Definitions */ +#define TPI_DEVTYPE_MajorType_Pos 4U /*!< TPI DEVTYPE: MajorType Position */ +#define TPI_DEVTYPE_MajorType_Msk (0xFUL << TPI_DEVTYPE_MajorType_Pos) /*!< TPI DEVTYPE: MajorType Mask */ + +#define TPI_DEVTYPE_SubType_Pos 0U /*!< TPI DEVTYPE: SubType Position */ +#define TPI_DEVTYPE_SubType_Msk (0xFUL /*<< TPI_DEVTYPE_SubType_Pos*/) /*!< TPI DEVTYPE: SubType Mask */ + +/*@}*/ /* end of group CMSIS_TPI */ + + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_MPU Memory Protection Unit (MPU) + \brief Type definitions for the Memory Protection Unit (MPU) + @{ + */ + +/** + \brief Structure type to access the Memory Protection Unit (MPU). + */ +typedef struct +{ + __IM uint32_t TYPE; /*!< Offset: 0x000 (R/ ) MPU Type Register */ + __IOM uint32_t CTRL; /*!< Offset: 0x004 (R/W) MPU Control Register */ + __IOM uint32_t RNR; /*!< Offset: 0x008 (R/W) MPU Region RNRber Register */ + __IOM uint32_t RBAR; /*!< Offset: 0x00C (R/W) MPU Region Base Address Register */ + __IOM uint32_t RASR; /*!< Offset: 0x010 (R/W) MPU Region Attribute and Size Register */ + __IOM uint32_t RBAR_A1; /*!< Offset: 0x014 (R/W) MPU Alias 1 Region Base Address Register */ + __IOM uint32_t RASR_A1; /*!< Offset: 0x018 (R/W) MPU Alias 1 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A2; /*!< Offset: 0x01C (R/W) MPU Alias 2 Region Base Address Register */ + __IOM uint32_t RASR_A2; /*!< Offset: 0x020 (R/W) MPU Alias 2 Region Attribute and Size Register */ + __IOM uint32_t RBAR_A3; /*!< Offset: 0x024 (R/W) MPU Alias 3 Region Base Address Register */ + __IOM uint32_t RASR_A3; /*!< Offset: 0x028 (R/W) MPU Alias 3 Region Attribute and Size Register */ +} MPU_Type; + +/* MPU Type Register Definitions */ +#define MPU_TYPE_IREGION_Pos 16U /*!< MPU TYPE: IREGION Position */ +#define MPU_TYPE_IREGION_Msk (0xFFUL << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */ + +#define MPU_TYPE_DREGION_Pos 8U /*!< MPU TYPE: DREGION Position */ +#define MPU_TYPE_DREGION_Msk (0xFFUL << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */ + +#define MPU_TYPE_SEPARATE_Pos 0U /*!< MPU TYPE: SEPARATE Position */ +#define MPU_TYPE_SEPARATE_Msk (1UL /*<< MPU_TYPE_SEPARATE_Pos*/) /*!< MPU TYPE: SEPARATE Mask */ + +/* MPU Control Register Definitions */ +#define MPU_CTRL_PRIVDEFENA_Pos 2U /*!< MPU CTRL: PRIVDEFENA Position */ +#define MPU_CTRL_PRIVDEFENA_Msk (1UL << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */ + +#define MPU_CTRL_HFNMIENA_Pos 1U /*!< MPU CTRL: HFNMIENA Position */ +#define MPU_CTRL_HFNMIENA_Msk (1UL << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */ + +#define MPU_CTRL_ENABLE_Pos 0U /*!< MPU CTRL: ENABLE Position */ +#define MPU_CTRL_ENABLE_Msk (1UL /*<< MPU_CTRL_ENABLE_Pos*/) /*!< MPU CTRL: ENABLE Mask */ + +/* MPU Region Number Register Definitions */ +#define MPU_RNR_REGION_Pos 0U /*!< MPU RNR: REGION Position */ +#define MPU_RNR_REGION_Msk (0xFFUL /*<< MPU_RNR_REGION_Pos*/) /*!< MPU RNR: REGION Mask */ + +/* MPU Region Base Address Register Definitions */ +#define MPU_RBAR_ADDR_Pos 5U /*!< MPU RBAR: ADDR Position */ +#define MPU_RBAR_ADDR_Msk (0x7FFFFFFUL << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */ + +#define MPU_RBAR_VALID_Pos 4U /*!< MPU RBAR: VALID Position */ +#define MPU_RBAR_VALID_Msk (1UL << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */ + +#define MPU_RBAR_REGION_Pos 0U /*!< MPU RBAR: REGION Position */ +#define MPU_RBAR_REGION_Msk (0xFUL /*<< MPU_RBAR_REGION_Pos*/) /*!< MPU RBAR: REGION Mask */ + +/* MPU Region Attribute and Size Register Definitions */ +#define MPU_RASR_ATTRS_Pos 16U /*!< MPU RASR: MPU Region Attribute field Position */ +#define MPU_RASR_ATTRS_Msk (0xFFFFUL << MPU_RASR_ATTRS_Pos) /*!< MPU RASR: MPU Region Attribute field Mask */ + +#define MPU_RASR_XN_Pos 28U /*!< MPU RASR: ATTRS.XN Position */ +#define MPU_RASR_XN_Msk (1UL << MPU_RASR_XN_Pos) /*!< MPU RASR: ATTRS.XN Mask */ + +#define MPU_RASR_AP_Pos 24U /*!< MPU RASR: ATTRS.AP Position */ +#define MPU_RASR_AP_Msk (0x7UL << MPU_RASR_AP_Pos) /*!< MPU RASR: ATTRS.AP Mask */ + +#define MPU_RASR_TEX_Pos 19U /*!< MPU RASR: ATTRS.TEX Position */ +#define MPU_RASR_TEX_Msk (0x7UL << MPU_RASR_TEX_Pos) /*!< MPU RASR: ATTRS.TEX Mask */ + +#define MPU_RASR_S_Pos 18U /*!< MPU RASR: ATTRS.S Position */ +#define MPU_RASR_S_Msk (1UL << MPU_RASR_S_Pos) /*!< MPU RASR: ATTRS.S Mask */ + +#define MPU_RASR_C_Pos 17U /*!< MPU RASR: ATTRS.C Position */ +#define MPU_RASR_C_Msk (1UL << MPU_RASR_C_Pos) /*!< MPU RASR: ATTRS.C Mask */ + +#define MPU_RASR_B_Pos 16U /*!< MPU RASR: ATTRS.B Position */ +#define MPU_RASR_B_Msk (1UL << MPU_RASR_B_Pos) /*!< MPU RASR: ATTRS.B Mask */ + +#define MPU_RASR_SRD_Pos 8U /*!< MPU RASR: Sub-Region Disable Position */ +#define MPU_RASR_SRD_Msk (0xFFUL << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */ + +#define MPU_RASR_SIZE_Pos 1U /*!< MPU RASR: Region Size Field Position */ +#define MPU_RASR_SIZE_Msk (0x1FUL << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */ + +#define MPU_RASR_ENABLE_Pos 0U /*!< MPU RASR: Region enable bit Position */ +#define MPU_RASR_ENABLE_Msk (1UL /*<< MPU_RASR_ENABLE_Pos*/) /*!< MPU RASR: Region enable bit Disable Mask */ + +/*@} end of group CMSIS_MPU */ +#endif /* defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_FPU Floating Point Unit (FPU) + \brief Type definitions for the Floating Point Unit (FPU) + @{ + */ + +/** + \brief Structure type to access the Floating Point Unit (FPU). + */ +typedef struct +{ + uint32_t RESERVED0[1U]; + __IOM uint32_t FPCCR; /*!< Offset: 0x004 (R/W) Floating-Point Context Control Register */ + __IOM uint32_t FPCAR; /*!< Offset: 0x008 (R/W) Floating-Point Context Address Register */ + __IOM uint32_t FPDSCR; /*!< Offset: 0x00C (R/W) Floating-Point Default Status Control Register */ + __IM uint32_t MVFR0; /*!< Offset: 0x010 (R/ ) Media and FP Feature Register 0 */ + __IM uint32_t MVFR1; /*!< Offset: 0x014 (R/ ) Media and FP Feature Register 1 */ +} FPU_Type; + +/* Floating-Point Context Control Register Definitions */ +#define FPU_FPCCR_ASPEN_Pos 31U /*!< FPCCR: ASPEN bit Position */ +#define FPU_FPCCR_ASPEN_Msk (1UL << FPU_FPCCR_ASPEN_Pos) /*!< FPCCR: ASPEN bit Mask */ + +#define FPU_FPCCR_LSPEN_Pos 30U /*!< FPCCR: LSPEN Position */ +#define FPU_FPCCR_LSPEN_Msk (1UL << FPU_FPCCR_LSPEN_Pos) /*!< FPCCR: LSPEN bit Mask */ + +#define FPU_FPCCR_MONRDY_Pos 8U /*!< FPCCR: MONRDY Position */ +#define FPU_FPCCR_MONRDY_Msk (1UL << FPU_FPCCR_MONRDY_Pos) /*!< FPCCR: MONRDY bit Mask */ + +#define FPU_FPCCR_BFRDY_Pos 6U /*!< FPCCR: BFRDY Position */ +#define FPU_FPCCR_BFRDY_Msk (1UL << FPU_FPCCR_BFRDY_Pos) /*!< FPCCR: BFRDY bit Mask */ + +#define FPU_FPCCR_MMRDY_Pos 5U /*!< FPCCR: MMRDY Position */ +#define FPU_FPCCR_MMRDY_Msk (1UL << FPU_FPCCR_MMRDY_Pos) /*!< FPCCR: MMRDY bit Mask */ + +#define FPU_FPCCR_HFRDY_Pos 4U /*!< FPCCR: HFRDY Position */ +#define FPU_FPCCR_HFRDY_Msk (1UL << FPU_FPCCR_HFRDY_Pos) /*!< FPCCR: HFRDY bit Mask */ + +#define FPU_FPCCR_THREAD_Pos 3U /*!< FPCCR: processor mode bit Position */ +#define FPU_FPCCR_THREAD_Msk (1UL << FPU_FPCCR_THREAD_Pos) /*!< FPCCR: processor mode active bit Mask */ + +#define FPU_FPCCR_USER_Pos 1U /*!< FPCCR: privilege level bit Position */ +#define FPU_FPCCR_USER_Msk (1UL << FPU_FPCCR_USER_Pos) /*!< FPCCR: privilege level bit Mask */ + +#define FPU_FPCCR_LSPACT_Pos 0U /*!< FPCCR: Lazy state preservation active bit Position */ +#define FPU_FPCCR_LSPACT_Msk (1UL /*<< FPU_FPCCR_LSPACT_Pos*/) /*!< FPCCR: Lazy state preservation active bit Mask */ + +/* Floating-Point Context Address Register Definitions */ +#define FPU_FPCAR_ADDRESS_Pos 3U /*!< FPCAR: ADDRESS bit Position */ +#define FPU_FPCAR_ADDRESS_Msk (0x1FFFFFFFUL << FPU_FPCAR_ADDRESS_Pos) /*!< FPCAR: ADDRESS bit Mask */ + +/* Floating-Point Default Status Control Register Definitions */ +#define FPU_FPDSCR_AHP_Pos 26U /*!< FPDSCR: AHP bit Position */ +#define FPU_FPDSCR_AHP_Msk (1UL << FPU_FPDSCR_AHP_Pos) /*!< FPDSCR: AHP bit Mask */ + +#define FPU_FPDSCR_DN_Pos 25U /*!< FPDSCR: DN bit Position */ +#define FPU_FPDSCR_DN_Msk (1UL << FPU_FPDSCR_DN_Pos) /*!< FPDSCR: DN bit Mask */ + +#define FPU_FPDSCR_FZ_Pos 24U /*!< FPDSCR: FZ bit Position */ +#define FPU_FPDSCR_FZ_Msk (1UL << FPU_FPDSCR_FZ_Pos) /*!< FPDSCR: FZ bit Mask */ + +#define FPU_FPDSCR_RMode_Pos 22U /*!< FPDSCR: RMode bit Position */ +#define FPU_FPDSCR_RMode_Msk (3UL << FPU_FPDSCR_RMode_Pos) /*!< FPDSCR: RMode bit Mask */ + +/* Media and FP Feature Register 0 Definitions */ +#define FPU_MVFR0_FP_rounding_modes_Pos 28U /*!< MVFR0: FP rounding modes bits Position */ +#define FPU_MVFR0_FP_rounding_modes_Msk (0xFUL << FPU_MVFR0_FP_rounding_modes_Pos) /*!< MVFR0: FP rounding modes bits Mask */ + +#define FPU_MVFR0_Short_vectors_Pos 24U /*!< MVFR0: Short vectors bits Position */ +#define FPU_MVFR0_Short_vectors_Msk (0xFUL << FPU_MVFR0_Short_vectors_Pos) /*!< MVFR0: Short vectors bits Mask */ + +#define FPU_MVFR0_Square_root_Pos 20U /*!< MVFR0: Square root bits Position */ +#define FPU_MVFR0_Square_root_Msk (0xFUL << FPU_MVFR0_Square_root_Pos) /*!< MVFR0: Square root bits Mask */ + +#define FPU_MVFR0_Divide_Pos 16U /*!< MVFR0: Divide bits Position */ +#define FPU_MVFR0_Divide_Msk (0xFUL << FPU_MVFR0_Divide_Pos) /*!< MVFR0: Divide bits Mask */ + +#define FPU_MVFR0_FP_excep_trapping_Pos 12U /*!< MVFR0: FP exception trapping bits Position */ +#define FPU_MVFR0_FP_excep_trapping_Msk (0xFUL << FPU_MVFR0_FP_excep_trapping_Pos) /*!< MVFR0: FP exception trapping bits Mask */ + +#define FPU_MVFR0_Double_precision_Pos 8U /*!< MVFR0: Double-precision bits Position */ +#define FPU_MVFR0_Double_precision_Msk (0xFUL << FPU_MVFR0_Double_precision_Pos) /*!< MVFR0: Double-precision bits Mask */ + +#define FPU_MVFR0_Single_precision_Pos 4U /*!< MVFR0: Single-precision bits Position */ +#define FPU_MVFR0_Single_precision_Msk (0xFUL << FPU_MVFR0_Single_precision_Pos) /*!< MVFR0: Single-precision bits Mask */ + +#define FPU_MVFR0_A_SIMD_registers_Pos 0U /*!< MVFR0: A_SIMD registers bits Position */ +#define FPU_MVFR0_A_SIMD_registers_Msk (0xFUL /*<< FPU_MVFR0_A_SIMD_registers_Pos*/) /*!< MVFR0: A_SIMD registers bits Mask */ + +/* Media and FP Feature Register 1 Definitions */ +#define FPU_MVFR1_FP_fused_MAC_Pos 28U /*!< MVFR1: FP fused MAC bits Position */ +#define FPU_MVFR1_FP_fused_MAC_Msk (0xFUL << FPU_MVFR1_FP_fused_MAC_Pos) /*!< MVFR1: FP fused MAC bits Mask */ + +#define FPU_MVFR1_FP_HPFP_Pos 24U /*!< MVFR1: FP HPFP bits Position */ +#define FPU_MVFR1_FP_HPFP_Msk (0xFUL << FPU_MVFR1_FP_HPFP_Pos) /*!< MVFR1: FP HPFP bits Mask */ + +#define FPU_MVFR1_D_NaN_mode_Pos 4U /*!< MVFR1: D_NaN mode bits Position */ +#define FPU_MVFR1_D_NaN_mode_Msk (0xFUL << FPU_MVFR1_D_NaN_mode_Pos) /*!< MVFR1: D_NaN mode bits Mask */ + +#define FPU_MVFR1_FtZ_mode_Pos 0U /*!< MVFR1: FtZ mode bits Position */ +#define FPU_MVFR1_FtZ_mode_Msk (0xFUL /*<< FPU_MVFR1_FtZ_mode_Pos*/) /*!< MVFR1: FtZ mode bits Mask */ + +/*@} end of group CMSIS_FPU */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) + \brief Type definitions for the Core Debug Registers + @{ + */ + +/** + \brief Structure type to access the Core Debug Register (CoreDebug). + */ +typedef struct +{ + __IOM uint32_t DHCSR; /*!< Offset: 0x000 (R/W) Debug Halting Control and Status Register */ + __OM uint32_t DCRSR; /*!< Offset: 0x004 ( /W) Debug Core Register Selector Register */ + __IOM uint32_t DCRDR; /*!< Offset: 0x008 (R/W) Debug Core Register Data Register */ + __IOM uint32_t DEMCR; /*!< Offset: 0x00C (R/W) Debug Exception and Monitor Control Register */ +} CoreDebug_Type; + +/* Debug Halting Control and Status Register Definitions */ +#define CoreDebug_DHCSR_DBGKEY_Pos 16U /*!< CoreDebug DHCSR: DBGKEY Position */ +#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFUL << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */ + +#define CoreDebug_DHCSR_S_RESET_ST_Pos 25U /*!< CoreDebug DHCSR: S_RESET_ST Position */ +#define CoreDebug_DHCSR_S_RESET_ST_Msk (1UL << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */ + +#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24U /*!< CoreDebug DHCSR: S_RETIRE_ST Position */ +#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1UL << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */ + +#define CoreDebug_DHCSR_S_LOCKUP_Pos 19U /*!< CoreDebug DHCSR: S_LOCKUP Position */ +#define CoreDebug_DHCSR_S_LOCKUP_Msk (1UL << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */ + +#define CoreDebug_DHCSR_S_SLEEP_Pos 18U /*!< CoreDebug DHCSR: S_SLEEP Position */ +#define CoreDebug_DHCSR_S_SLEEP_Msk (1UL << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */ + +#define CoreDebug_DHCSR_S_HALT_Pos 17U /*!< CoreDebug DHCSR: S_HALT Position */ +#define CoreDebug_DHCSR_S_HALT_Msk (1UL << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */ + +#define CoreDebug_DHCSR_S_REGRDY_Pos 16U /*!< CoreDebug DHCSR: S_REGRDY Position */ +#define CoreDebug_DHCSR_S_REGRDY_Msk (1UL << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */ + +#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5U /*!< CoreDebug DHCSR: C_SNAPSTALL Position */ +#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1UL << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */ + +#define CoreDebug_DHCSR_C_MASKINTS_Pos 3U /*!< CoreDebug DHCSR: C_MASKINTS Position */ +#define CoreDebug_DHCSR_C_MASKINTS_Msk (1UL << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */ + +#define CoreDebug_DHCSR_C_STEP_Pos 2U /*!< CoreDebug DHCSR: C_STEP Position */ +#define CoreDebug_DHCSR_C_STEP_Msk (1UL << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */ + +#define CoreDebug_DHCSR_C_HALT_Pos 1U /*!< CoreDebug DHCSR: C_HALT Position */ +#define CoreDebug_DHCSR_C_HALT_Msk (1UL << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */ + +#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0U /*!< CoreDebug DHCSR: C_DEBUGEN Position */ +#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1UL /*<< CoreDebug_DHCSR_C_DEBUGEN_Pos*/) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */ + +/* Debug Core Register Selector Register Definitions */ +#define CoreDebug_DCRSR_REGWnR_Pos 16U /*!< CoreDebug DCRSR: REGWnR Position */ +#define CoreDebug_DCRSR_REGWnR_Msk (1UL << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */ + +#define CoreDebug_DCRSR_REGSEL_Pos 0U /*!< CoreDebug DCRSR: REGSEL Position */ +#define CoreDebug_DCRSR_REGSEL_Msk (0x1FUL /*<< CoreDebug_DCRSR_REGSEL_Pos*/) /*!< CoreDebug DCRSR: REGSEL Mask */ + +/* Debug Exception and Monitor Control Register Definitions */ +#define CoreDebug_DEMCR_TRCENA_Pos 24U /*!< CoreDebug DEMCR: TRCENA Position */ +#define CoreDebug_DEMCR_TRCENA_Msk (1UL << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */ + +#define CoreDebug_DEMCR_MON_REQ_Pos 19U /*!< CoreDebug DEMCR: MON_REQ Position */ +#define CoreDebug_DEMCR_MON_REQ_Msk (1UL << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */ + +#define CoreDebug_DEMCR_MON_STEP_Pos 18U /*!< CoreDebug DEMCR: MON_STEP Position */ +#define CoreDebug_DEMCR_MON_STEP_Msk (1UL << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */ + +#define CoreDebug_DEMCR_MON_PEND_Pos 17U /*!< CoreDebug DEMCR: MON_PEND Position */ +#define CoreDebug_DEMCR_MON_PEND_Msk (1UL << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */ + +#define CoreDebug_DEMCR_MON_EN_Pos 16U /*!< CoreDebug DEMCR: MON_EN Position */ +#define CoreDebug_DEMCR_MON_EN_Msk (1UL << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */ + +#define CoreDebug_DEMCR_VC_HARDERR_Pos 10U /*!< CoreDebug DEMCR: VC_HARDERR Position */ +#define CoreDebug_DEMCR_VC_HARDERR_Msk (1UL << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */ + +#define CoreDebug_DEMCR_VC_INTERR_Pos 9U /*!< CoreDebug DEMCR: VC_INTERR Position */ +#define CoreDebug_DEMCR_VC_INTERR_Msk (1UL << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */ + +#define CoreDebug_DEMCR_VC_BUSERR_Pos 8U /*!< CoreDebug DEMCR: VC_BUSERR Position */ +#define CoreDebug_DEMCR_VC_BUSERR_Msk (1UL << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */ + +#define CoreDebug_DEMCR_VC_STATERR_Pos 7U /*!< CoreDebug DEMCR: VC_STATERR Position */ +#define CoreDebug_DEMCR_VC_STATERR_Msk (1UL << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */ + +#define CoreDebug_DEMCR_VC_CHKERR_Pos 6U /*!< CoreDebug DEMCR: VC_CHKERR Position */ +#define CoreDebug_DEMCR_VC_CHKERR_Msk (1UL << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */ + +#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5U /*!< CoreDebug DEMCR: VC_NOCPERR Position */ +#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1UL << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */ + +#define CoreDebug_DEMCR_VC_MMERR_Pos 4U /*!< CoreDebug DEMCR: VC_MMERR Position */ +#define CoreDebug_DEMCR_VC_MMERR_Msk (1UL << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */ + +#define CoreDebug_DEMCR_VC_CORERESET_Pos 0U /*!< CoreDebug DEMCR: VC_CORERESET Position */ +#define CoreDebug_DEMCR_VC_CORERESET_Msk (1UL /*<< CoreDebug_DEMCR_VC_CORERESET_Pos*/) /*!< CoreDebug DEMCR: VC_CORERESET Mask */ + +/*@} end of group CMSIS_CoreDebug */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_bitfield Core register bit field macros + \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). + @{ + */ + +/** + \brief Mask and shift a bit field value for use in a register bit range. + \param[in] field Name of the register bit field. + \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. + \return Masked and shifted value. +*/ +#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) + +/** + \brief Mask and shift a register value to extract a bit filed value. + \param[in] field Name of the register bit field. + \param[in] value Value of register. This parameter is interpreted as an uint32_t type. + \return Masked and shifted bit field value. +*/ +#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) + +/*@} end of group CMSIS_core_bitfield */ + + +/** + \ingroup CMSIS_core_register + \defgroup CMSIS_core_base Core Definitions + \brief Definitions for base addresses, unions, and structures. + @{ + */ + +/* Memory mapping of Core Hardware */ +#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ +#define ITM_BASE (0xE0000000UL) /*!< ITM Base Address */ +#define DWT_BASE (0xE0001000UL) /*!< DWT Base Address */ +#define TPI_BASE (0xE0040000UL) /*!< TPI Base Address */ +#define CoreDebug_BASE (0xE000EDF0UL) /*!< Core Debug Base Address */ +#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ +#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ +#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ + +#define SCnSCB ((SCnSCB_Type *) SCS_BASE ) /*!< System control Register not in SCB */ +#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ +#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ +#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ +#define ITM ((ITM_Type *) ITM_BASE ) /*!< ITM configuration struct */ +#define DWT ((DWT_Type *) DWT_BASE ) /*!< DWT configuration struct */ +#define TPI ((TPI_Type *) TPI_BASE ) /*!< TPI configuration struct */ +#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */ + +#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) + #define MPU_BASE (SCS_BASE + 0x0D90UL) /*!< Memory Protection Unit */ + #define MPU ((MPU_Type *) MPU_BASE ) /*!< Memory Protection Unit */ +#endif + +#define FPU_BASE (SCS_BASE + 0x0F30UL) /*!< Floating Point Unit */ +#define FPU ((FPU_Type *) FPU_BASE ) /*!< Floating Point Unit */ + +/*@} */ + + + +/******************************************************************************* + * Hardware Abstraction Layer + Core Function Interface contains: + - Core NVIC Functions + - Core SysTick Functions + - Core Debug Functions + - Core Register Access Functions + ******************************************************************************/ +/** + \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference +*/ + + + +/* ########################## NVIC functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_NVICFunctions NVIC Functions + \brief Functions that manage interrupts and exceptions via the NVIC. + @{ + */ + +#ifdef CMSIS_NVIC_VIRTUAL + #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE + #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" + #endif + #include CMSIS_NVIC_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping + #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping + #define NVIC_EnableIRQ __NVIC_EnableIRQ + #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ + #define NVIC_DisableIRQ __NVIC_DisableIRQ + #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ + #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ + #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ + #define NVIC_GetActive __NVIC_GetActive + #define NVIC_SetPriority __NVIC_SetPriority + #define NVIC_GetPriority __NVIC_GetPriority + #define NVIC_SystemReset __NVIC_SystemReset +#endif /* CMSIS_NVIC_VIRTUAL */ + +#ifdef CMSIS_VECTAB_VIRTUAL + #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE + #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" + #endif + #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE +#else + #define NVIC_SetVector __NVIC_SetVector + #define NVIC_GetVector __NVIC_GetVector +#endif /* (CMSIS_VECTAB_VIRTUAL) */ + +#define NVIC_USER_IRQ_OFFSET 16 + + + +/** + \brief Set Priority Grouping + \details Sets the priority grouping field using the required unlock sequence. + The parameter PriorityGroup is assigned to the field SCB->AIRCR [10:8] PRIGROUP field. + Only values from 0..7 are used. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Priority grouping field. + */ +__STATIC_INLINE void __NVIC_SetPriorityGrouping(uint32_t PriorityGroup) +{ + uint32_t reg_value; + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + + reg_value = SCB->AIRCR; /* read old register configuration */ + reg_value &= ~((uint32_t)(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk)); /* clear bits to change */ + reg_value = (reg_value | + ((uint32_t)0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (PriorityGroupTmp << 8U) ); /* Insert write key and priorty group */ + SCB->AIRCR = reg_value; +} + + +/** + \brief Get Priority Grouping + \details Reads the priority grouping field from the NVIC Interrupt Controller. + \return Priority grouping field (SCB->AIRCR [10:8] PRIGROUP field). + */ +__STATIC_INLINE uint32_t __NVIC_GetPriorityGrouping(void) +{ + return ((uint32_t)((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos)); +} + + +/** + \brief Enable Interrupt + \details Enables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Interrupt Enable status + \details Returns a device specific interrupt enable status from the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt is not enabled. + \return 1 Interrupt is enabled. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISER[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Disable Interrupt + \details Disables a device specific interrupt in the NVIC interrupt controller. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICER[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); + __DSB(); + __ISB(); + } +} + + +/** + \brief Get Pending Interrupt + \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not pending. + \return 1 Interrupt status is pending. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Pending Interrupt + \details Sets the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ISPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Clear Pending Interrupt + \details Clears the pending bit of a device specific interrupt in the NVIC pending register. + \param [in] IRQn Device specific interrupt number. + \note IRQn must not be negative. + */ +__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->ICPR[(((uint32_t)(int32_t)IRQn) >> 5UL)] = (uint32_t)(1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL)); + } +} + + +/** + \brief Get Active Interrupt + \details Reads the active register in the NVIC and returns the active bit for the device specific interrupt. + \param [in] IRQn Device specific interrupt number. + \return 0 Interrupt status is not active. + \return 1 Interrupt status is active. + \note IRQn must not be negative. + */ +__STATIC_INLINE uint32_t __NVIC_GetActive(IRQn_Type IRQn) +{ + if ((int32_t)(IRQn) >= 0) + { + return((uint32_t)(((NVIC->IABR[(((uint32_t)(int32_t)IRQn) >> 5UL)] & (1UL << (((uint32_t)(int32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); + } + else + { + return(0U); + } +} + + +/** + \brief Set Interrupt Priority + \details Sets the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \param [in] priority Priority to set. + \note The priority cannot be set for every processor exception. + */ +__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) +{ + if ((int32_t)(IRQn) >= 0) + { + NVIC->IP[((uint32_t)(int32_t)IRQn)] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } + else + { + SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] = (uint8_t)((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL); + } +} + + +/** + \brief Get Interrupt Priority + \details Reads the priority of a device specific interrupt or a processor exception. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Interrupt Priority. + Value is aligned automatically to the implemented priority bits of the microcontroller. + */ +__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) +{ + + if ((int32_t)(IRQn) >= 0) + { + return(((uint32_t)NVIC->IP[((uint32_t)(int32_t)IRQn)] >> (8U - __NVIC_PRIO_BITS))); + } + else + { + return(((uint32_t)SCB->SHP[(((uint32_t)(int32_t)IRQn) & 0xFUL)-4UL] >> (8U - __NVIC_PRIO_BITS))); + } +} + + +/** + \brief Encode Priority + \details Encodes the priority for an interrupt with the given priority group, + preemptive priority value, and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. + \param [in] PriorityGroup Used priority group. + \param [in] PreemptPriority Preemptive priority value (starting from 0). + \param [in] SubPriority Subpriority value (starting from 0). + \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). + */ +__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + return ( + ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | + ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) + ); +} + + +/** + \brief Decode Priority + \details Decodes an interrupt priority value with a given priority group to + preemptive priority value and subpriority value. + In case of a conflict between priority grouping and available + priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. + \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). + \param [in] PriorityGroup Used priority group. + \param [out] pPreemptPriority Preemptive priority value (starting from 0). + \param [out] pSubPriority Subpriority value (starting from 0). + */ +__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) +{ + uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ + uint32_t PreemptPriorityBits; + uint32_t SubPriorityBits; + + PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); + SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); + + *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); + *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); +} + + +/** + \brief Set Interrupt Vector + \details Sets an interrupt vector in SRAM based interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + VTOR must been relocated to SRAM before. + \param [in] IRQn Interrupt number + \param [in] vector Address of interrupt handler function + */ +__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET] = vector; +} + + +/** + \brief Get Interrupt Vector + \details Reads an interrupt vector from interrupt vector table. + The interrupt number can be positive to specify a device specific interrupt, + or negative to specify a processor exception. + \param [in] IRQn Interrupt number. + \return Address of interrupt handler function + */ +__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) +{ + uint32_t *vectors = (uint32_t *)SCB->VTOR; + return vectors[(int32_t)IRQn + NVIC_USER_IRQ_OFFSET]; +} + + +/** + \brief System Reset + \details Initiates a system reset request to reset the MCU. + */ +__STATIC_INLINE void __NVIC_SystemReset(void) +{ + __DSB(); /* Ensure all outstanding memory accesses included + buffered write are completed before reset */ + SCB->AIRCR = (uint32_t)((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | + (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) | + SCB_AIRCR_SYSRESETREQ_Msk ); /* Keep priority group unchanged */ + __DSB(); /* Ensure completion of memory access */ + + for(;;) /* wait until reset */ + { + __NOP(); + } +} + +/*@} end of CMSIS_Core_NVICFunctions */ + + +/* ########################## FPU functions #################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_FpuFunctions FPU Functions + \brief Function that provides FPU type. + @{ + */ + +/** + \brief get FPU type + \details returns the FPU type + \returns + - \b 0: No FPU + - \b 1: Single precision FPU + - \b 2: Double + Single precision FPU + */ +__STATIC_INLINE uint32_t SCB_GetFPUType(void) +{ + uint32_t mvfr0; + + mvfr0 = FPU->MVFR0; + if ((mvfr0 & (FPU_MVFR0_Single_precision_Msk | FPU_MVFR0_Double_precision_Msk)) == 0x020U) + { + return 1U; /* Single precision FPU */ + } + else + { + return 0U; /* No FPU */ + } +} + + +/*@} end of CMSIS_Core_FpuFunctions */ + + + +/* ################################## SysTick function ############################################ */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_Core_SysTickFunctions SysTick Functions + \brief Functions that configure the System. + @{ + */ + +#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) + +/** + \brief System Tick Configuration + \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. + Counter is in free running mode to generate periodic interrupts. + \param [in] ticks Number of ticks between two interrupts. + \return 0 Function succeeded. + \return 1 Function failed. + \note When the variable __Vendor_SysTickConfig is set to 1, then the + function SysTick_Config is not included. In this case, the file device.h + must contain a vendor-specific implementation of this function. + */ +__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) +{ + if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) + { + return (1UL); /* Reload value impossible */ + } + + SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ + NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ + SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ + SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | + SysTick_CTRL_TICKINT_Msk | + SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ + return (0UL); /* Function successful */ +} + +#endif + +/*@} end of CMSIS_Core_SysTickFunctions */ + + + +/* ##################################### Debug In/Output function ########################################### */ +/** + \ingroup CMSIS_Core_FunctionInterface + \defgroup CMSIS_core_DebugFunctions ITM Functions + \brief Functions that access the ITM debug interface. + @{ + */ + +extern volatile int32_t ITM_RxBuffer; /*!< External variable to receive characters. */ +#define ITM_RXBUFFER_EMPTY ((int32_t)0x5AA55AA5U) /*!< Value identifying \ref ITM_RxBuffer is ready for next character. */ + + +/** + \brief ITM Send Character + \details Transmits a character via the ITM channel 0, and + \li Just returns when no debugger is connected that has booked the output. + \li Is blocking when a debugger is connected, but the previous character sent has not been transmitted. + \param [in] ch Character to transmit. + \returns Character to transmit. + */ +__STATIC_INLINE uint32_t ITM_SendChar (uint32_t ch) +{ + if (((ITM->TCR & ITM_TCR_ITMENA_Msk) != 0UL) && /* ITM enabled */ + ((ITM->TER & 1UL ) != 0UL) ) /* ITM Port #0 enabled */ + { + while (ITM->PORT[0U].u32 == 0UL) + { + __NOP(); + } + ITM->PORT[0U].u8 = (uint8_t)ch; + } + return (ch); +} + + +/** + \brief ITM Receive Character + \details Inputs a character via the external variable \ref ITM_RxBuffer. + \return Received character. + \return -1 No character pending. + */ +__STATIC_INLINE int32_t ITM_ReceiveChar (void) +{ + int32_t ch = -1; /* no character available */ + + if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) + { + ch = ITM_RxBuffer; + ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */ + } + + return (ch); +} + + +/** + \brief ITM Check Character + \details Checks whether a character is pending for reading in the variable \ref ITM_RxBuffer. + \return 0 No character available. + \return 1 Character available. + */ +__STATIC_INLINE int32_t ITM_CheckChar (void) +{ + + if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) + { + return (0); /* no character available */ + } + else + { + return (1); /* character available */ + } +} + +/*@} end of CMSIS_core_DebugFunctions */ + + + + +#ifdef __cplusplus +} +#endif + +#endif /* __CORE_CM4_H_DEPENDANT */ + +#endif /* __CMSIS_GENERIC */ diff --git a/lib/arm_atsam/packs/arm/cmsis/5.0.1/LICENSE.txt b/lib/arm_atsam/packs/arm/cmsis/5.0.1/LICENSE.txt new file mode 100644 index 0000000000..8dada3edaf --- /dev/null +++ b/lib/arm_atsam/packs/arm/cmsis/5.0.1/LICENSE.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright {yyyy} {name of copyright owner} + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld new file mode 100644 index 0000000000..3d114f5b7b --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld @@ -0,0 +1,168 @@ +/** + * \file + * + * \brief Linker script for running in internal FLASH on the SAMD51J18A + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +SEARCH_DIR(.) + +/* Memory Spaces Definitions */ +MEMORY +{ + //rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + rom (rx) : ORIGIN = 0x00004000, LENGTH = 0x0003C000 + ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000 + bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000 + qspi (rwx) : ORIGIN = 0x04000000, LENGTH = 0x01000000 +} + +/* The stack size used by the application. NOTE: you need to adjust according to your application. */ +STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x8000; + +_srom = ORIGIN(rom); +_lrom = LENGTH(rom); +_erom = ORIGIN(rom) + LENGTH(rom); + +/* Section Definitions */ +SECTIONS +{ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors .vectors.*)) + *(.text .text.* .gnu.linkonce.t.*) + *(.glue_7t) *(.glue_7) + *(.rodata .rodata* .gnu.linkonce.r.*) + *(.ARM.extab* .gnu.linkonce.armextab.*) + + /* Support C constructors, and C destructors in both user code + and the C library. This also provides support for C++ code. */ + . = ALIGN(4); + KEEP(*(.init)) + . = ALIGN(4); + __preinit_array_start = .; + KEEP (*(.preinit_array)) + __preinit_array_end = .; + + . = ALIGN(4); + __init_array_start = .; + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array)) + __init_array_end = .; + + . = ALIGN(4); + KEEP (*crtbegin.o(.ctors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) + KEEP (*(SORT(.ctors.*))) + KEEP (*crtend.o(.ctors)) + + . = ALIGN(4); + KEEP(*(.fini)) + + . = ALIGN(4); + __fini_array_start = .; + KEEP (*(.fini_array)) + KEEP (*(SORT(.fini_array.*))) + __fini_array_end = .; + + KEEP (*crtbegin.o(.dtors)) + KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP (*(SORT(.dtors.*))) + KEEP (*crtend.o(.dtors)) + + . = ALIGN(4); + _efixed = .; /* End of text section */ + } > rom + + /* .ARM.exidx is sorted, so has to go in its own output section. */ + PROVIDE_HIDDEN (__exidx_start = .); + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > rom + PROVIDE_HIDDEN (__exidx_end = .); + + . = ALIGN(4); + _etext = .; + + .relocate : AT (_etext) + { + . = ALIGN(4); + _srelocate = .; + *(.ramfunc .ramfunc.*); + *(.data .data.*); + . = ALIGN(4); + _erelocate = .; + } > ram + + .bkupram (NOLOAD): + { + . = ALIGN(8); + _sbkupram = .; + *(.bkupram .bkupram.*); + . = ALIGN(8); + _ebkupram = .; + } > bkupram + + .qspi (NOLOAD): + { + . = ALIGN(8); + _sqspi = .; + *(.qspi .qspi.*); + . = ALIGN(8); + _eqspi = .; + } > qspi + + /* .bss section which is used for uninitialized data */ + .bss (NOLOAD) : + { + . = ALIGN(4); + _sbss = . ; + _szero = .; + *(.bss .bss.*) + *(COMMON) + . = ALIGN(4); + _ebss = . ; + _ezero = .; + } > ram + + /* stack section */ + .stack (NOLOAD): + { + . = ALIGN(8); + _sstack = .; + . = . + STACK_SIZE; + . = ALIGN(8); + _estack = .; + } > ram + + . = ALIGN(4); + _end = . ; +} diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component-version.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component-version.h new file mode 100644 index 0000000000..80801fc128 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component-version.h @@ -0,0 +1,65 @@ +/** + * \file + * + * \brief Component version header file + * + * Copyright (c) 2017 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc. + * + * \license_start + * + * \page License + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \license_stop + * + */ + +#ifndef _COMPONENT_VERSION_H_INCLUDED +#define _COMPONENT_VERSION_H_INCLUDED + +#define COMPONENT_VERSION_MAJOR 1 +#define COMPONENT_VERSION_MINOR 0 + +// +// The COMPONENT_VERSION define is composed of the major and the minor version number. +// +// The last four digits of the COMPONENT_VERSION is the minor version with leading zeros. +// The rest of the COMPONENT_VERSION is the major version, with leading zeros. The COMPONENT_VERSION +// is at least 8 digits long. +// +#define COMPONENT_VERSION 00010000 + +// +// The build number does not refer to the component, but to the build number +// of the device pack that provides the component. +// +#define BUILD_NUMBER 70 + +// +// The COMPONENT_VERSION_STRING is a string (enclosed in ") that can be used for logging or embedding. +// +#define COMPONENT_VERSION_STRING "1.0" + +// +// The COMPONENT_DATE_STRING contains a timestamp of when the pack was generated. +// +// The COMPONENT_DATE_STRING is written out using the following strftime pattern. +// +// "%Y-%m-%d %H:%M:%S" +// +// +#define COMPONENT_DATE_STRING "2017-08-09 09:59:41" + +#endif/* #ifndef _COMPONENT_VERSION_H_INCLUDED */ + diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ac.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ac.h new file mode 100644 index 0000000000..24623d00ac --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ac.h @@ -0,0 +1,598 @@ +/** + * \file + * + * \brief Component description for AC + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_AC_COMPONENT_ +#define _SAMD51_AC_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR AC */ +/* ========================================================================== */ +/** \addtogroup SAMD51_AC Analog Comparators */ +/*@{*/ + +#define AC_U2501 +#define REV_AC 0x100 + +/* -------- AC_CTRLA : (AC Offset: 0x00) (R/W 8) Control A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SWRST:1; /*!< bit: 0 Software Reset */ + uint8_t ENABLE:1; /*!< bit: 1 Enable */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AC_CTRLA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_CTRLA_OFFSET 0x00 /**< \brief (AC_CTRLA offset) Control A */ +#define AC_CTRLA_RESETVALUE _U_(0x00) /**< \brief (AC_CTRLA reset_value) Control A */ + +#define AC_CTRLA_SWRST_Pos 0 /**< \brief (AC_CTRLA) Software Reset */ +#define AC_CTRLA_SWRST (_U_(0x1) << AC_CTRLA_SWRST_Pos) +#define AC_CTRLA_ENABLE_Pos 1 /**< \brief (AC_CTRLA) Enable */ +#define AC_CTRLA_ENABLE (_U_(0x1) << AC_CTRLA_ENABLE_Pos) +#define AC_CTRLA_MASK _U_(0x03) /**< \brief (AC_CTRLA) MASK Register */ + +/* -------- AC_CTRLB : (AC Offset: 0x01) ( /W 8) Control B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t START0:1; /*!< bit: 0 Comparator 0 Start Comparison */ + uint8_t START1:1; /*!< bit: 1 Comparator 1 Start Comparison */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t START:2; /*!< bit: 0.. 1 Comparator x Start Comparison */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_CTRLB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_CTRLB_OFFSET 0x01 /**< \brief (AC_CTRLB offset) Control B */ +#define AC_CTRLB_RESETVALUE _U_(0x00) /**< \brief (AC_CTRLB reset_value) Control B */ + +#define AC_CTRLB_START0_Pos 0 /**< \brief (AC_CTRLB) Comparator 0 Start Comparison */ +#define AC_CTRLB_START0 (_U_(1) << AC_CTRLB_START0_Pos) +#define AC_CTRLB_START1_Pos 1 /**< \brief (AC_CTRLB) Comparator 1 Start Comparison */ +#define AC_CTRLB_START1 (_U_(1) << AC_CTRLB_START1_Pos) +#define AC_CTRLB_START_Pos 0 /**< \brief (AC_CTRLB) Comparator x Start Comparison */ +#define AC_CTRLB_START_Msk (_U_(0x3) << AC_CTRLB_START_Pos) +#define AC_CTRLB_START(value) (AC_CTRLB_START_Msk & ((value) << AC_CTRLB_START_Pos)) +#define AC_CTRLB_MASK _U_(0x03) /**< \brief (AC_CTRLB) MASK Register */ + +/* -------- AC_EVCTRL : (AC Offset: 0x02) (R/W 16) Event Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t COMPEO0:1; /*!< bit: 0 Comparator 0 Event Output Enable */ + uint16_t COMPEO1:1; /*!< bit: 1 Comparator 1 Event Output Enable */ + uint16_t :2; /*!< bit: 2.. 3 Reserved */ + uint16_t WINEO0:1; /*!< bit: 4 Window 0 Event Output Enable */ + uint16_t :3; /*!< bit: 5.. 7 Reserved */ + uint16_t COMPEI0:1; /*!< bit: 8 Comparator 0 Event Input Enable */ + uint16_t COMPEI1:1; /*!< bit: 9 Comparator 1 Event Input Enable */ + uint16_t :2; /*!< bit: 10..11 Reserved */ + uint16_t INVEI0:1; /*!< bit: 12 Comparator 0 Input Event Invert Enable */ + uint16_t INVEI1:1; /*!< bit: 13 Comparator 1 Input Event Invert Enable */ + uint16_t :2; /*!< bit: 14..15 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint16_t COMPEO:2; /*!< bit: 0.. 1 Comparator x Event Output Enable */ + uint16_t :2; /*!< bit: 2.. 3 Reserved */ + uint16_t WINEO:1; /*!< bit: 4 Window x Event Output Enable */ + uint16_t :3; /*!< bit: 5.. 7 Reserved */ + uint16_t COMPEI:2; /*!< bit: 8.. 9 Comparator x Event Input Enable */ + uint16_t :2; /*!< bit: 10..11 Reserved */ + uint16_t INVEI:2; /*!< bit: 12..13 Comparator x Input Event Invert Enable */ + uint16_t :2; /*!< bit: 14..15 Reserved */ + } vec; /*!< Structure used for vec access */ + uint16_t reg; /*!< Type used for register access */ +} AC_EVCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_EVCTRL_OFFSET 0x02 /**< \brief (AC_EVCTRL offset) Event Control */ +#define AC_EVCTRL_RESETVALUE _U_(0x0000) /**< \brief (AC_EVCTRL reset_value) Event Control */ + +#define AC_EVCTRL_COMPEO0_Pos 0 /**< \brief (AC_EVCTRL) Comparator 0 Event Output Enable */ +#define AC_EVCTRL_COMPEO0 (_U_(1) << AC_EVCTRL_COMPEO0_Pos) +#define AC_EVCTRL_COMPEO1_Pos 1 /**< \brief (AC_EVCTRL) Comparator 1 Event Output Enable */ +#define AC_EVCTRL_COMPEO1 (_U_(1) << AC_EVCTRL_COMPEO1_Pos) +#define AC_EVCTRL_COMPEO_Pos 0 /**< \brief (AC_EVCTRL) Comparator x Event Output Enable */ +#define AC_EVCTRL_COMPEO_Msk (_U_(0x3) << AC_EVCTRL_COMPEO_Pos) +#define AC_EVCTRL_COMPEO(value) (AC_EVCTRL_COMPEO_Msk & ((value) << AC_EVCTRL_COMPEO_Pos)) +#define AC_EVCTRL_WINEO0_Pos 4 /**< \brief (AC_EVCTRL) Window 0 Event Output Enable */ +#define AC_EVCTRL_WINEO0 (_U_(1) << AC_EVCTRL_WINEO0_Pos) +#define AC_EVCTRL_WINEO_Pos 4 /**< \brief (AC_EVCTRL) Window x Event Output Enable */ +#define AC_EVCTRL_WINEO_Msk (_U_(0x1) << AC_EVCTRL_WINEO_Pos) +#define AC_EVCTRL_WINEO(value) (AC_EVCTRL_WINEO_Msk & ((value) << AC_EVCTRL_WINEO_Pos)) +#define AC_EVCTRL_COMPEI0_Pos 8 /**< \brief (AC_EVCTRL) Comparator 0 Event Input Enable */ +#define AC_EVCTRL_COMPEI0 (_U_(1) << AC_EVCTRL_COMPEI0_Pos) +#define AC_EVCTRL_COMPEI1_Pos 9 /**< \brief (AC_EVCTRL) Comparator 1 Event Input Enable */ +#define AC_EVCTRL_COMPEI1 (_U_(1) << AC_EVCTRL_COMPEI1_Pos) +#define AC_EVCTRL_COMPEI_Pos 8 /**< \brief (AC_EVCTRL) Comparator x Event Input Enable */ +#define AC_EVCTRL_COMPEI_Msk (_U_(0x3) << AC_EVCTRL_COMPEI_Pos) +#define AC_EVCTRL_COMPEI(value) (AC_EVCTRL_COMPEI_Msk & ((value) << AC_EVCTRL_COMPEI_Pos)) +#define AC_EVCTRL_INVEI0_Pos 12 /**< \brief (AC_EVCTRL) Comparator 0 Input Event Invert Enable */ +#define AC_EVCTRL_INVEI0 (_U_(1) << AC_EVCTRL_INVEI0_Pos) +#define AC_EVCTRL_INVEI1_Pos 13 /**< \brief (AC_EVCTRL) Comparator 1 Input Event Invert Enable */ +#define AC_EVCTRL_INVEI1 (_U_(1) << AC_EVCTRL_INVEI1_Pos) +#define AC_EVCTRL_INVEI_Pos 12 /**< \brief (AC_EVCTRL) Comparator x Input Event Invert Enable */ +#define AC_EVCTRL_INVEI_Msk (_U_(0x3) << AC_EVCTRL_INVEI_Pos) +#define AC_EVCTRL_INVEI(value) (AC_EVCTRL_INVEI_Msk & ((value) << AC_EVCTRL_INVEI_Pos)) +#define AC_EVCTRL_MASK _U_(0x3313) /**< \brief (AC_EVCTRL) MASK Register */ + +/* -------- AC_INTENCLR : (AC Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t COMP0:1; /*!< bit: 0 Comparator 0 Interrupt Enable */ + uint8_t COMP1:1; /*!< bit: 1 Comparator 1 Interrupt Enable */ + uint8_t :2; /*!< bit: 2.. 3 Reserved */ + uint8_t WIN0:1; /*!< bit: 4 Window 0 Interrupt Enable */ + uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x Interrupt Enable */ + uint8_t :2; /*!< bit: 2.. 3 Reserved */ + uint8_t WIN:1; /*!< bit: 4 Window x Interrupt Enable */ + uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_INTENCLR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_INTENCLR_OFFSET 0x04 /**< \brief (AC_INTENCLR offset) Interrupt Enable Clear */ +#define AC_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (AC_INTENCLR reset_value) Interrupt Enable Clear */ + +#define AC_INTENCLR_COMP0_Pos 0 /**< \brief (AC_INTENCLR) Comparator 0 Interrupt Enable */ +#define AC_INTENCLR_COMP0 (_U_(1) << AC_INTENCLR_COMP0_Pos) +#define AC_INTENCLR_COMP1_Pos 1 /**< \brief (AC_INTENCLR) Comparator 1 Interrupt Enable */ +#define AC_INTENCLR_COMP1 (_U_(1) << AC_INTENCLR_COMP1_Pos) +#define AC_INTENCLR_COMP_Pos 0 /**< \brief (AC_INTENCLR) Comparator x Interrupt Enable */ +#define AC_INTENCLR_COMP_Msk (_U_(0x3) << AC_INTENCLR_COMP_Pos) +#define AC_INTENCLR_COMP(value) (AC_INTENCLR_COMP_Msk & ((value) << AC_INTENCLR_COMP_Pos)) +#define AC_INTENCLR_WIN0_Pos 4 /**< \brief (AC_INTENCLR) Window 0 Interrupt Enable */ +#define AC_INTENCLR_WIN0 (_U_(1) << AC_INTENCLR_WIN0_Pos) +#define AC_INTENCLR_WIN_Pos 4 /**< \brief (AC_INTENCLR) Window x Interrupt Enable */ +#define AC_INTENCLR_WIN_Msk (_U_(0x1) << AC_INTENCLR_WIN_Pos) +#define AC_INTENCLR_WIN(value) (AC_INTENCLR_WIN_Msk & ((value) << AC_INTENCLR_WIN_Pos)) +#define AC_INTENCLR_MASK _U_(0x13) /**< \brief (AC_INTENCLR) MASK Register */ + +/* -------- AC_INTENSET : (AC Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t COMP0:1; /*!< bit: 0 Comparator 0 Interrupt Enable */ + uint8_t COMP1:1; /*!< bit: 1 Comparator 1 Interrupt Enable */ + uint8_t :2; /*!< bit: 2.. 3 Reserved */ + uint8_t WIN0:1; /*!< bit: 4 Window 0 Interrupt Enable */ + uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x Interrupt Enable */ + uint8_t :2; /*!< bit: 2.. 3 Reserved */ + uint8_t WIN:1; /*!< bit: 4 Window x Interrupt Enable */ + uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_INTENSET_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_INTENSET_OFFSET 0x05 /**< \brief (AC_INTENSET offset) Interrupt Enable Set */ +#define AC_INTENSET_RESETVALUE _U_(0x00) /**< \brief (AC_INTENSET reset_value) Interrupt Enable Set */ + +#define AC_INTENSET_COMP0_Pos 0 /**< \brief (AC_INTENSET) Comparator 0 Interrupt Enable */ +#define AC_INTENSET_COMP0 (_U_(1) << AC_INTENSET_COMP0_Pos) +#define AC_INTENSET_COMP1_Pos 1 /**< \brief (AC_INTENSET) Comparator 1 Interrupt Enable */ +#define AC_INTENSET_COMP1 (_U_(1) << AC_INTENSET_COMP1_Pos) +#define AC_INTENSET_COMP_Pos 0 /**< \brief (AC_INTENSET) Comparator x Interrupt Enable */ +#define AC_INTENSET_COMP_Msk (_U_(0x3) << AC_INTENSET_COMP_Pos) +#define AC_INTENSET_COMP(value) (AC_INTENSET_COMP_Msk & ((value) << AC_INTENSET_COMP_Pos)) +#define AC_INTENSET_WIN0_Pos 4 /**< \brief (AC_INTENSET) Window 0 Interrupt Enable */ +#define AC_INTENSET_WIN0 (_U_(1) << AC_INTENSET_WIN0_Pos) +#define AC_INTENSET_WIN_Pos 4 /**< \brief (AC_INTENSET) Window x Interrupt Enable */ +#define AC_INTENSET_WIN_Msk (_U_(0x1) << AC_INTENSET_WIN_Pos) +#define AC_INTENSET_WIN(value) (AC_INTENSET_WIN_Msk & ((value) << AC_INTENSET_WIN_Pos)) +#define AC_INTENSET_MASK _U_(0x13) /**< \brief (AC_INTENSET) MASK Register */ + +/* -------- AC_INTFLAG : (AC Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { // __I to avoid read-modify-write on write-to-clear register + struct { + __I uint8_t COMP0:1; /*!< bit: 0 Comparator 0 */ + __I uint8_t COMP1:1; /*!< bit: 1 Comparator 1 */ + __I uint8_t :2; /*!< bit: 2.. 3 Reserved */ + __I uint8_t WIN0:1; /*!< bit: 4 Window 0 */ + __I uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + __I uint8_t COMP:2; /*!< bit: 0.. 1 Comparator x */ + __I uint8_t :2; /*!< bit: 2.. 3 Reserved */ + __I uint8_t WIN:1; /*!< bit: 4 Window x */ + __I uint8_t :3; /*!< bit: 5.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_INTFLAG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_INTFLAG_OFFSET 0x06 /**< \brief (AC_INTFLAG offset) Interrupt Flag Status and Clear */ +#define AC_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (AC_INTFLAG reset_value) Interrupt Flag Status and Clear */ + +#define AC_INTFLAG_COMP0_Pos 0 /**< \brief (AC_INTFLAG) Comparator 0 */ +#define AC_INTFLAG_COMP0 (_U_(1) << AC_INTFLAG_COMP0_Pos) +#define AC_INTFLAG_COMP1_Pos 1 /**< \brief (AC_INTFLAG) Comparator 1 */ +#define AC_INTFLAG_COMP1 (_U_(1) << AC_INTFLAG_COMP1_Pos) +#define AC_INTFLAG_COMP_Pos 0 /**< \brief (AC_INTFLAG) Comparator x */ +#define AC_INTFLAG_COMP_Msk (_U_(0x3) << AC_INTFLAG_COMP_Pos) +#define AC_INTFLAG_COMP(value) (AC_INTFLAG_COMP_Msk & ((value) << AC_INTFLAG_COMP_Pos)) +#define AC_INTFLAG_WIN0_Pos 4 /**< \brief (AC_INTFLAG) Window 0 */ +#define AC_INTFLAG_WIN0 (_U_(1) << AC_INTFLAG_WIN0_Pos) +#define AC_INTFLAG_WIN_Pos 4 /**< \brief (AC_INTFLAG) Window x */ +#define AC_INTFLAG_WIN_Msk (_U_(0x1) << AC_INTFLAG_WIN_Pos) +#define AC_INTFLAG_WIN(value) (AC_INTFLAG_WIN_Msk & ((value) << AC_INTFLAG_WIN_Pos)) +#define AC_INTFLAG_MASK _U_(0x13) /**< \brief (AC_INTFLAG) MASK Register */ + +/* -------- AC_STATUSA : (AC Offset: 0x07) (R/ 8) Status A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t STATE0:1; /*!< bit: 0 Comparator 0 Current State */ + uint8_t STATE1:1; /*!< bit: 1 Comparator 1 Current State */ + uint8_t :2; /*!< bit: 2.. 3 Reserved */ + uint8_t WSTATE0:2; /*!< bit: 4.. 5 Window 0 Current State */ + uint8_t :2; /*!< bit: 6.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t STATE:2; /*!< bit: 0.. 1 Comparator x Current State */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_STATUSA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_STATUSA_OFFSET 0x07 /**< \brief (AC_STATUSA offset) Status A */ +#define AC_STATUSA_RESETVALUE _U_(0x00) /**< \brief (AC_STATUSA reset_value) Status A */ + +#define AC_STATUSA_STATE0_Pos 0 /**< \brief (AC_STATUSA) Comparator 0 Current State */ +#define AC_STATUSA_STATE0 (_U_(1) << AC_STATUSA_STATE0_Pos) +#define AC_STATUSA_STATE1_Pos 1 /**< \brief (AC_STATUSA) Comparator 1 Current State */ +#define AC_STATUSA_STATE1 (_U_(1) << AC_STATUSA_STATE1_Pos) +#define AC_STATUSA_STATE_Pos 0 /**< \brief (AC_STATUSA) Comparator x Current State */ +#define AC_STATUSA_STATE_Msk (_U_(0x3) << AC_STATUSA_STATE_Pos) +#define AC_STATUSA_STATE(value) (AC_STATUSA_STATE_Msk & ((value) << AC_STATUSA_STATE_Pos)) +#define AC_STATUSA_WSTATE0_Pos 4 /**< \brief (AC_STATUSA) Window 0 Current State */ +#define AC_STATUSA_WSTATE0_Msk (_U_(0x3) << AC_STATUSA_WSTATE0_Pos) +#define AC_STATUSA_WSTATE0(value) (AC_STATUSA_WSTATE0_Msk & ((value) << AC_STATUSA_WSTATE0_Pos)) +#define AC_STATUSA_WSTATE0_ABOVE_Val _U_(0x0) /**< \brief (AC_STATUSA) Signal is above window */ +#define AC_STATUSA_WSTATE0_INSIDE_Val _U_(0x1) /**< \brief (AC_STATUSA) Signal is inside window */ +#define AC_STATUSA_WSTATE0_BELOW_Val _U_(0x2) /**< \brief (AC_STATUSA) Signal is below window */ +#define AC_STATUSA_WSTATE0_ABOVE (AC_STATUSA_WSTATE0_ABOVE_Val << AC_STATUSA_WSTATE0_Pos) +#define AC_STATUSA_WSTATE0_INSIDE (AC_STATUSA_WSTATE0_INSIDE_Val << AC_STATUSA_WSTATE0_Pos) +#define AC_STATUSA_WSTATE0_BELOW (AC_STATUSA_WSTATE0_BELOW_Val << AC_STATUSA_WSTATE0_Pos) +#define AC_STATUSA_MASK _U_(0x33) /**< \brief (AC_STATUSA) MASK Register */ + +/* -------- AC_STATUSB : (AC Offset: 0x08) (R/ 8) Status B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t READY0:1; /*!< bit: 0 Comparator 0 Ready */ + uint8_t READY1:1; /*!< bit: 1 Comparator 1 Ready */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t READY:2; /*!< bit: 0.. 1 Comparator x Ready */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} AC_STATUSB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_STATUSB_OFFSET 0x08 /**< \brief (AC_STATUSB offset) Status B */ +#define AC_STATUSB_RESETVALUE _U_(0x00) /**< \brief (AC_STATUSB reset_value) Status B */ + +#define AC_STATUSB_READY0_Pos 0 /**< \brief (AC_STATUSB) Comparator 0 Ready */ +#define AC_STATUSB_READY0 (_U_(1) << AC_STATUSB_READY0_Pos) +#define AC_STATUSB_READY1_Pos 1 /**< \brief (AC_STATUSB) Comparator 1 Ready */ +#define AC_STATUSB_READY1 (_U_(1) << AC_STATUSB_READY1_Pos) +#define AC_STATUSB_READY_Pos 0 /**< \brief (AC_STATUSB) Comparator x Ready */ +#define AC_STATUSB_READY_Msk (_U_(0x3) << AC_STATUSB_READY_Pos) +#define AC_STATUSB_READY(value) (AC_STATUSB_READY_Msk & ((value) << AC_STATUSB_READY_Pos)) +#define AC_STATUSB_MASK _U_(0x03) /**< \brief (AC_STATUSB) MASK Register */ + +/* -------- AC_DBGCTRL : (AC Offset: 0x09) (R/W 8) Debug Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DBGRUN:1; /*!< bit: 0 Debug Run */ + uint8_t :7; /*!< bit: 1.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AC_DBGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_DBGCTRL_OFFSET 0x09 /**< \brief (AC_DBGCTRL offset) Debug Control */ +#define AC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (AC_DBGCTRL reset_value) Debug Control */ + +#define AC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (AC_DBGCTRL) Debug Run */ +#define AC_DBGCTRL_DBGRUN (_U_(0x1) << AC_DBGCTRL_DBGRUN_Pos) +#define AC_DBGCTRL_MASK _U_(0x01) /**< \brief (AC_DBGCTRL) MASK Register */ + +/* -------- AC_WINCTRL : (AC Offset: 0x0A) (R/W 8) Window Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t WEN0:1; /*!< bit: 0 Window 0 Mode Enable */ + uint8_t WINTSEL0:2; /*!< bit: 1.. 2 Window 0 Interrupt Selection */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AC_WINCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_WINCTRL_OFFSET 0x0A /**< \brief (AC_WINCTRL offset) Window Control */ +#define AC_WINCTRL_RESETVALUE _U_(0x00) /**< \brief (AC_WINCTRL reset_value) Window Control */ + +#define AC_WINCTRL_WEN0_Pos 0 /**< \brief (AC_WINCTRL) Window 0 Mode Enable */ +#define AC_WINCTRL_WEN0 (_U_(0x1) << AC_WINCTRL_WEN0_Pos) +#define AC_WINCTRL_WINTSEL0_Pos 1 /**< \brief (AC_WINCTRL) Window 0 Interrupt Selection */ +#define AC_WINCTRL_WINTSEL0_Msk (_U_(0x3) << AC_WINCTRL_WINTSEL0_Pos) +#define AC_WINCTRL_WINTSEL0(value) (AC_WINCTRL_WINTSEL0_Msk & ((value) << AC_WINCTRL_WINTSEL0_Pos)) +#define AC_WINCTRL_WINTSEL0_ABOVE_Val _U_(0x0) /**< \brief (AC_WINCTRL) Interrupt on signal above window */ +#define AC_WINCTRL_WINTSEL0_INSIDE_Val _U_(0x1) /**< \brief (AC_WINCTRL) Interrupt on signal inside window */ +#define AC_WINCTRL_WINTSEL0_BELOW_Val _U_(0x2) /**< \brief (AC_WINCTRL) Interrupt on signal below window */ +#define AC_WINCTRL_WINTSEL0_OUTSIDE_Val _U_(0x3) /**< \brief (AC_WINCTRL) Interrupt on signal outside window */ +#define AC_WINCTRL_WINTSEL0_ABOVE (AC_WINCTRL_WINTSEL0_ABOVE_Val << AC_WINCTRL_WINTSEL0_Pos) +#define AC_WINCTRL_WINTSEL0_INSIDE (AC_WINCTRL_WINTSEL0_INSIDE_Val << AC_WINCTRL_WINTSEL0_Pos) +#define AC_WINCTRL_WINTSEL0_BELOW (AC_WINCTRL_WINTSEL0_BELOW_Val << AC_WINCTRL_WINTSEL0_Pos) +#define AC_WINCTRL_WINTSEL0_OUTSIDE (AC_WINCTRL_WINTSEL0_OUTSIDE_Val << AC_WINCTRL_WINTSEL0_Pos) +#define AC_WINCTRL_MASK _U_(0x07) /**< \brief (AC_WINCTRL) MASK Register */ + +/* -------- AC_SCALER : (AC Offset: 0x0C) (R/W 8) Scaler n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t VALUE:6; /*!< bit: 0.. 5 Scaler Value */ + uint8_t :2; /*!< bit: 6.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AC_SCALER_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_SCALER_OFFSET 0x0C /**< \brief (AC_SCALER offset) Scaler n */ +#define AC_SCALER_RESETVALUE _U_(0x00) /**< \brief (AC_SCALER reset_value) Scaler n */ + +#define AC_SCALER_VALUE_Pos 0 /**< \brief (AC_SCALER) Scaler Value */ +#define AC_SCALER_VALUE_Msk (_U_(0x3F) << AC_SCALER_VALUE_Pos) +#define AC_SCALER_VALUE(value) (AC_SCALER_VALUE_Msk & ((value) << AC_SCALER_VALUE_Pos)) +#define AC_SCALER_MASK _U_(0x3F) /**< \brief (AC_SCALER) MASK Register */ + +/* -------- AC_COMPCTRL : (AC Offset: 0x10) (R/W 32) Comparator Control n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :1; /*!< bit: 0 Reserved */ + uint32_t ENABLE:1; /*!< bit: 1 Enable */ + uint32_t SINGLE:1; /*!< bit: 2 Single-Shot Mode */ + uint32_t INTSEL:2; /*!< bit: 3.. 4 Interrupt Selection */ + uint32_t :1; /*!< bit: 5 Reserved */ + uint32_t RUNSTDBY:1; /*!< bit: 6 Run in Standby */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t MUXNEG:3; /*!< bit: 8..10 Negative Input Mux Selection */ + uint32_t :1; /*!< bit: 11 Reserved */ + uint32_t MUXPOS:3; /*!< bit: 12..14 Positive Input Mux Selection */ + uint32_t SWAP:1; /*!< bit: 15 Swap Inputs and Invert */ + uint32_t SPEED:2; /*!< bit: 16..17 Speed Selection */ + uint32_t :1; /*!< bit: 18 Reserved */ + uint32_t HYSTEN:1; /*!< bit: 19 Hysteresis Enable */ + uint32_t HYST:2; /*!< bit: 20..21 Hysteresis Level */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t FLEN:3; /*!< bit: 24..26 Filter Length */ + uint32_t :1; /*!< bit: 27 Reserved */ + uint32_t OUT:2; /*!< bit: 28..29 Output */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} AC_COMPCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_COMPCTRL_OFFSET 0x10 /**< \brief (AC_COMPCTRL offset) Comparator Control n */ +#define AC_COMPCTRL_RESETVALUE _U_(0x00000000) /**< \brief (AC_COMPCTRL reset_value) Comparator Control n */ + +#define AC_COMPCTRL_ENABLE_Pos 1 /**< \brief (AC_COMPCTRL) Enable */ +#define AC_COMPCTRL_ENABLE (_U_(0x1) << AC_COMPCTRL_ENABLE_Pos) +#define AC_COMPCTRL_SINGLE_Pos 2 /**< \brief (AC_COMPCTRL) Single-Shot Mode */ +#define AC_COMPCTRL_SINGLE (_U_(0x1) << AC_COMPCTRL_SINGLE_Pos) +#define AC_COMPCTRL_INTSEL_Pos 3 /**< \brief (AC_COMPCTRL) Interrupt Selection */ +#define AC_COMPCTRL_INTSEL_Msk (_U_(0x3) << AC_COMPCTRL_INTSEL_Pos) +#define AC_COMPCTRL_INTSEL(value) (AC_COMPCTRL_INTSEL_Msk & ((value) << AC_COMPCTRL_INTSEL_Pos)) +#define AC_COMPCTRL_INTSEL_TOGGLE_Val _U_(0x0) /**< \brief (AC_COMPCTRL) Interrupt on comparator output toggle */ +#define AC_COMPCTRL_INTSEL_RISING_Val _U_(0x1) /**< \brief (AC_COMPCTRL) Interrupt on comparator output rising */ +#define AC_COMPCTRL_INTSEL_FALLING_Val _U_(0x2) /**< \brief (AC_COMPCTRL) Interrupt on comparator output falling */ +#define AC_COMPCTRL_INTSEL_EOC_Val _U_(0x3) /**< \brief (AC_COMPCTRL) Interrupt on end of comparison (single-shot mode only) */ +#define AC_COMPCTRL_INTSEL_TOGGLE (AC_COMPCTRL_INTSEL_TOGGLE_Val << AC_COMPCTRL_INTSEL_Pos) +#define AC_COMPCTRL_INTSEL_RISING (AC_COMPCTRL_INTSEL_RISING_Val << AC_COMPCTRL_INTSEL_Pos) +#define AC_COMPCTRL_INTSEL_FALLING (AC_COMPCTRL_INTSEL_FALLING_Val << AC_COMPCTRL_INTSEL_Pos) +#define AC_COMPCTRL_INTSEL_EOC (AC_COMPCTRL_INTSEL_EOC_Val << AC_COMPCTRL_INTSEL_Pos) +#define AC_COMPCTRL_RUNSTDBY_Pos 6 /**< \brief (AC_COMPCTRL) Run in Standby */ +#define AC_COMPCTRL_RUNSTDBY (_U_(0x1) << AC_COMPCTRL_RUNSTDBY_Pos) +#define AC_COMPCTRL_MUXNEG_Pos 8 /**< \brief (AC_COMPCTRL) Negative Input Mux Selection */ +#define AC_COMPCTRL_MUXNEG_Msk (_U_(0x7) << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG(value) (AC_COMPCTRL_MUXNEG_Msk & ((value) << AC_COMPCTRL_MUXNEG_Pos)) +#define AC_COMPCTRL_MUXNEG_PIN0_Val _U_(0x0) /**< \brief (AC_COMPCTRL) I/O pin 0 */ +#define AC_COMPCTRL_MUXNEG_PIN1_Val _U_(0x1) /**< \brief (AC_COMPCTRL) I/O pin 1 */ +#define AC_COMPCTRL_MUXNEG_PIN2_Val _U_(0x2) /**< \brief (AC_COMPCTRL) I/O pin 2 */ +#define AC_COMPCTRL_MUXNEG_PIN3_Val _U_(0x3) /**< \brief (AC_COMPCTRL) I/O pin 3 */ +#define AC_COMPCTRL_MUXNEG_GND_Val _U_(0x4) /**< \brief (AC_COMPCTRL) Ground */ +#define AC_COMPCTRL_MUXNEG_VSCALE_Val _U_(0x5) /**< \brief (AC_COMPCTRL) VDD scaler */ +#define AC_COMPCTRL_MUXNEG_BANDGAP_Val _U_(0x6) /**< \brief (AC_COMPCTRL) Internal bandgap voltage */ +#define AC_COMPCTRL_MUXNEG_DAC_Val _U_(0x7) /**< \brief (AC_COMPCTRL) DAC output */ +#define AC_COMPCTRL_MUXNEG_PIN0 (AC_COMPCTRL_MUXNEG_PIN0_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_PIN1 (AC_COMPCTRL_MUXNEG_PIN1_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_PIN2 (AC_COMPCTRL_MUXNEG_PIN2_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_PIN3 (AC_COMPCTRL_MUXNEG_PIN3_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_GND (AC_COMPCTRL_MUXNEG_GND_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_VSCALE (AC_COMPCTRL_MUXNEG_VSCALE_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_BANDGAP (AC_COMPCTRL_MUXNEG_BANDGAP_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXNEG_DAC (AC_COMPCTRL_MUXNEG_DAC_Val << AC_COMPCTRL_MUXNEG_Pos) +#define AC_COMPCTRL_MUXPOS_Pos 12 /**< \brief (AC_COMPCTRL) Positive Input Mux Selection */ +#define AC_COMPCTRL_MUXPOS_Msk (_U_(0x7) << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_MUXPOS(value) (AC_COMPCTRL_MUXPOS_Msk & ((value) << AC_COMPCTRL_MUXPOS_Pos)) +#define AC_COMPCTRL_MUXPOS_PIN0_Val _U_(0x0) /**< \brief (AC_COMPCTRL) I/O pin 0 */ +#define AC_COMPCTRL_MUXPOS_PIN1_Val _U_(0x1) /**< \brief (AC_COMPCTRL) I/O pin 1 */ +#define AC_COMPCTRL_MUXPOS_PIN2_Val _U_(0x2) /**< \brief (AC_COMPCTRL) I/O pin 2 */ +#define AC_COMPCTRL_MUXPOS_PIN3_Val _U_(0x3) /**< \brief (AC_COMPCTRL) I/O pin 3 */ +#define AC_COMPCTRL_MUXPOS_VSCALE_Val _U_(0x4) /**< \brief (AC_COMPCTRL) VDD Scaler */ +#define AC_COMPCTRL_MUXPOS_PIN0 (AC_COMPCTRL_MUXPOS_PIN0_Val << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_MUXPOS_PIN1 (AC_COMPCTRL_MUXPOS_PIN1_Val << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_MUXPOS_PIN2 (AC_COMPCTRL_MUXPOS_PIN2_Val << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_MUXPOS_PIN3 (AC_COMPCTRL_MUXPOS_PIN3_Val << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_MUXPOS_VSCALE (AC_COMPCTRL_MUXPOS_VSCALE_Val << AC_COMPCTRL_MUXPOS_Pos) +#define AC_COMPCTRL_SWAP_Pos 15 /**< \brief (AC_COMPCTRL) Swap Inputs and Invert */ +#define AC_COMPCTRL_SWAP (_U_(0x1) << AC_COMPCTRL_SWAP_Pos) +#define AC_COMPCTRL_SPEED_Pos 16 /**< \brief (AC_COMPCTRL) Speed Selection */ +#define AC_COMPCTRL_SPEED_Msk (_U_(0x3) << AC_COMPCTRL_SPEED_Pos) +#define AC_COMPCTRL_SPEED(value) (AC_COMPCTRL_SPEED_Msk & ((value) << AC_COMPCTRL_SPEED_Pos)) +#define AC_COMPCTRL_SPEED_HIGH_Val _U_(0x3) /**< \brief (AC_COMPCTRL) High speed */ +#define AC_COMPCTRL_SPEED_HIGH (AC_COMPCTRL_SPEED_HIGH_Val << AC_COMPCTRL_SPEED_Pos) +#define AC_COMPCTRL_HYSTEN_Pos 19 /**< \brief (AC_COMPCTRL) Hysteresis Enable */ +#define AC_COMPCTRL_HYSTEN (_U_(0x1) << AC_COMPCTRL_HYSTEN_Pos) +#define AC_COMPCTRL_HYST_Pos 20 /**< \brief (AC_COMPCTRL) Hysteresis Level */ +#define AC_COMPCTRL_HYST_Msk (_U_(0x3) << AC_COMPCTRL_HYST_Pos) +#define AC_COMPCTRL_HYST(value) (AC_COMPCTRL_HYST_Msk & ((value) << AC_COMPCTRL_HYST_Pos)) +#define AC_COMPCTRL_HYST_HYST50_Val _U_(0x0) /**< \brief (AC_COMPCTRL) 50mV */ +#define AC_COMPCTRL_HYST_HYST100_Val _U_(0x1) /**< \brief (AC_COMPCTRL) 100mV */ +#define AC_COMPCTRL_HYST_HYST150_Val _U_(0x2) /**< \brief (AC_COMPCTRL) 150mV */ +#define AC_COMPCTRL_HYST_HYST50 (AC_COMPCTRL_HYST_HYST50_Val << AC_COMPCTRL_HYST_Pos) +#define AC_COMPCTRL_HYST_HYST100 (AC_COMPCTRL_HYST_HYST100_Val << AC_COMPCTRL_HYST_Pos) +#define AC_COMPCTRL_HYST_HYST150 (AC_COMPCTRL_HYST_HYST150_Val << AC_COMPCTRL_HYST_Pos) +#define AC_COMPCTRL_FLEN_Pos 24 /**< \brief (AC_COMPCTRL) Filter Length */ +#define AC_COMPCTRL_FLEN_Msk (_U_(0x7) << AC_COMPCTRL_FLEN_Pos) +#define AC_COMPCTRL_FLEN(value) (AC_COMPCTRL_FLEN_Msk & ((value) << AC_COMPCTRL_FLEN_Pos)) +#define AC_COMPCTRL_FLEN_OFF_Val _U_(0x0) /**< \brief (AC_COMPCTRL) No filtering */ +#define AC_COMPCTRL_FLEN_MAJ3_Val _U_(0x1) /**< \brief (AC_COMPCTRL) 3-bit majority function (2 of 3) */ +#define AC_COMPCTRL_FLEN_MAJ5_Val _U_(0x2) /**< \brief (AC_COMPCTRL) 5-bit majority function (3 of 5) */ +#define AC_COMPCTRL_FLEN_OFF (AC_COMPCTRL_FLEN_OFF_Val << AC_COMPCTRL_FLEN_Pos) +#define AC_COMPCTRL_FLEN_MAJ3 (AC_COMPCTRL_FLEN_MAJ3_Val << AC_COMPCTRL_FLEN_Pos) +#define AC_COMPCTRL_FLEN_MAJ5 (AC_COMPCTRL_FLEN_MAJ5_Val << AC_COMPCTRL_FLEN_Pos) +#define AC_COMPCTRL_OUT_Pos 28 /**< \brief (AC_COMPCTRL) Output */ +#define AC_COMPCTRL_OUT_Msk (_U_(0x3) << AC_COMPCTRL_OUT_Pos) +#define AC_COMPCTRL_OUT(value) (AC_COMPCTRL_OUT_Msk & ((value) << AC_COMPCTRL_OUT_Pos)) +#define AC_COMPCTRL_OUT_OFF_Val _U_(0x0) /**< \brief (AC_COMPCTRL) The output of COMPn is not routed to the COMPn I/O port */ +#define AC_COMPCTRL_OUT_ASYNC_Val _U_(0x1) /**< \brief (AC_COMPCTRL) The asynchronous output of COMPn is routed to the COMPn I/O port */ +#define AC_COMPCTRL_OUT_SYNC_Val _U_(0x2) /**< \brief (AC_COMPCTRL) The synchronous output (including filtering) of COMPn is routed to the COMPn I/O port */ +#define AC_COMPCTRL_OUT_OFF (AC_COMPCTRL_OUT_OFF_Val << AC_COMPCTRL_OUT_Pos) +#define AC_COMPCTRL_OUT_ASYNC (AC_COMPCTRL_OUT_ASYNC_Val << AC_COMPCTRL_OUT_Pos) +#define AC_COMPCTRL_OUT_SYNC (AC_COMPCTRL_OUT_SYNC_Val << AC_COMPCTRL_OUT_Pos) +#define AC_COMPCTRL_MASK _U_(0x373BF75E) /**< \brief (AC_COMPCTRL) MASK Register */ + +/* -------- AC_SYNCBUSY : (AC Offset: 0x20) (R/ 32) Synchronization Busy -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 Software Reset Synchronization Busy */ + uint32_t ENABLE:1; /*!< bit: 1 Enable Synchronization Busy */ + uint32_t WINCTRL:1; /*!< bit: 2 WINCTRL Synchronization Busy */ + uint32_t COMPCTRL0:1; /*!< bit: 3 COMPCTRL 0 Synchronization Busy */ + uint32_t COMPCTRL1:1; /*!< bit: 4 COMPCTRL 1 Synchronization Busy */ + uint32_t :27; /*!< bit: 5..31 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t :3; /*!< bit: 0.. 2 Reserved */ + uint32_t COMPCTRL:2; /*!< bit: 3.. 4 COMPCTRL x Synchronization Busy */ + uint32_t :27; /*!< bit: 5..31 Reserved */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} AC_SYNCBUSY_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_SYNCBUSY_OFFSET 0x20 /**< \brief (AC_SYNCBUSY offset) Synchronization Busy */ +#define AC_SYNCBUSY_RESETVALUE _U_(0x00000000) /**< \brief (AC_SYNCBUSY reset_value) Synchronization Busy */ + +#define AC_SYNCBUSY_SWRST_Pos 0 /**< \brief (AC_SYNCBUSY) Software Reset Synchronization Busy */ +#define AC_SYNCBUSY_SWRST (_U_(0x1) << AC_SYNCBUSY_SWRST_Pos) +#define AC_SYNCBUSY_ENABLE_Pos 1 /**< \brief (AC_SYNCBUSY) Enable Synchronization Busy */ +#define AC_SYNCBUSY_ENABLE (_U_(0x1) << AC_SYNCBUSY_ENABLE_Pos) +#define AC_SYNCBUSY_WINCTRL_Pos 2 /**< \brief (AC_SYNCBUSY) WINCTRL Synchronization Busy */ +#define AC_SYNCBUSY_WINCTRL (_U_(0x1) << AC_SYNCBUSY_WINCTRL_Pos) +#define AC_SYNCBUSY_COMPCTRL0_Pos 3 /**< \brief (AC_SYNCBUSY) COMPCTRL 0 Synchronization Busy */ +#define AC_SYNCBUSY_COMPCTRL0 (_U_(1) << AC_SYNCBUSY_COMPCTRL0_Pos) +#define AC_SYNCBUSY_COMPCTRL1_Pos 4 /**< \brief (AC_SYNCBUSY) COMPCTRL 1 Synchronization Busy */ +#define AC_SYNCBUSY_COMPCTRL1 (_U_(1) << AC_SYNCBUSY_COMPCTRL1_Pos) +#define AC_SYNCBUSY_COMPCTRL_Pos 3 /**< \brief (AC_SYNCBUSY) COMPCTRL x Synchronization Busy */ +#define AC_SYNCBUSY_COMPCTRL_Msk (_U_(0x3) << AC_SYNCBUSY_COMPCTRL_Pos) +#define AC_SYNCBUSY_COMPCTRL(value) (AC_SYNCBUSY_COMPCTRL_Msk & ((value) << AC_SYNCBUSY_COMPCTRL_Pos)) +#define AC_SYNCBUSY_MASK _U_(0x0000001F) /**< \brief (AC_SYNCBUSY) MASK Register */ + +/* -------- AC_CALIB : (AC Offset: 0x24) (R/W 16) Calibration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t BIAS0:2; /*!< bit: 0.. 1 COMP0/1 Bias Scaling */ + uint16_t :14; /*!< bit: 2..15 Reserved */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} AC_CALIB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AC_CALIB_OFFSET 0x24 /**< \brief (AC_CALIB offset) Calibration */ +#define AC_CALIB_RESETVALUE _U_(0x0101) /**< \brief (AC_CALIB reset_value) Calibration */ + +#define AC_CALIB_BIAS0_Pos 0 /**< \brief (AC_CALIB) COMP0/1 Bias Scaling */ +#define AC_CALIB_BIAS0_Msk (_U_(0x3) << AC_CALIB_BIAS0_Pos) +#define AC_CALIB_BIAS0(value) (AC_CALIB_BIAS0_Msk & ((value) << AC_CALIB_BIAS0_Pos)) +#define AC_CALIB_MASK _U_(0x0003) /**< \brief (AC_CALIB) MASK Register */ + +/** \brief AC hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO AC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 8) Control A */ + __O AC_CTRLB_Type CTRLB; /**< \brief Offset: 0x01 ( /W 8) Control B */ + __IO AC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x02 (R/W 16) Event Control */ + __IO AC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x04 (R/W 8) Interrupt Enable Clear */ + __IO AC_INTENSET_Type INTENSET; /**< \brief Offset: 0x05 (R/W 8) Interrupt Enable Set */ + __IO AC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */ + __I AC_STATUSA_Type STATUSA; /**< \brief Offset: 0x07 (R/ 8) Status A */ + __I AC_STATUSB_Type STATUSB; /**< \brief Offset: 0x08 (R/ 8) Status B */ + __IO AC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x09 (R/W 8) Debug Control */ + __IO AC_WINCTRL_Type WINCTRL; /**< \brief Offset: 0x0A (R/W 8) Window Control */ + RoReg8 Reserved1[0x1]; + __IO AC_SCALER_Type SCALER[2]; /**< \brief Offset: 0x0C (R/W 8) Scaler n */ + RoReg8 Reserved2[0x2]; + __IO AC_COMPCTRL_Type COMPCTRL[2]; /**< \brief Offset: 0x10 (R/W 32) Comparator Control n */ + RoReg8 Reserved3[0x8]; + __I AC_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x20 (R/ 32) Synchronization Busy */ + __IO AC_CALIB_Type CALIB; /**< \brief Offset: 0x24 (R/W 16) Calibration */ +} Ac; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_AC_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h new file mode 100644 index 0000000000..33c38ae3f8 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/adc.h @@ -0,0 +1,871 @@ +/** + * \file + * + * \brief Component description for ADC + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_ADC_COMPONENT_ +#define _SAMD51_ADC_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR ADC */ +/* ========================================================================== */ +/** \addtogroup SAMD51_ADC Analog Digital Converter */ +/*@{*/ + +#define ADC_U2500 +#define REV_ADC 0x100 + +/* -------- ADC_CTRLA : (ADC Offset: 0x00) (R/W 16) Control A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t SWRST:1; /*!< bit: 0 Software Reset */ + uint16_t ENABLE:1; /*!< bit: 1 Enable */ + uint16_t :1; /*!< bit: 2 Reserved */ + uint16_t DUALSEL:2; /*!< bit: 3.. 4 Dual Mode Trigger Selection */ + uint16_t SLAVEEN:1; /*!< bit: 5 Slave Enable */ + uint16_t RUNSTDBY:1; /*!< bit: 6 Run in Standby */ + uint16_t ONDEMAND:1; /*!< bit: 7 On Demand Control */ + uint16_t PRESCALER:3; /*!< bit: 8..10 Prescaler Configuration */ + uint16_t :4; /*!< bit: 11..14 Reserved */ + uint16_t R2R:1; /*!< bit: 15 Rail to Rail Operation Enable */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_CTRLA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_CTRLA_OFFSET 0x00 /**< \brief (ADC_CTRLA offset) Control A */ +#define ADC_CTRLA_RESETVALUE _U_(0x0000) /**< \brief (ADC_CTRLA reset_value) Control A */ + +#define ADC_CTRLA_SWRST_Pos 0 /**< \brief (ADC_CTRLA) Software Reset */ +#define ADC_CTRLA_SWRST (_U_(0x1) << ADC_CTRLA_SWRST_Pos) +#define ADC_CTRLA_ENABLE_Pos 1 /**< \brief (ADC_CTRLA) Enable */ +#define ADC_CTRLA_ENABLE (_U_(0x1) << ADC_CTRLA_ENABLE_Pos) +#define ADC_CTRLA_DUALSEL_Pos 3 /**< \brief (ADC_CTRLA) Dual Mode Trigger Selection */ +#define ADC_CTRLA_DUALSEL_Msk (_U_(0x3) << ADC_CTRLA_DUALSEL_Pos) +#define ADC_CTRLA_DUALSEL(value) (ADC_CTRLA_DUALSEL_Msk & ((value) << ADC_CTRLA_DUALSEL_Pos)) +#define ADC_CTRLA_DUALSEL_BOTH_Val _U_(0x0) /**< \brief (ADC_CTRLA) Start event or software trigger will start a conversion on both ADCs */ +#define ADC_CTRLA_DUALSEL_INTERLEAVE_Val _U_(0x1) /**< \brief (ADC_CTRLA) START event or software trigger will alternatingly start a conversion on ADC0 and ADC1 */ +#define ADC_CTRLA_DUALSEL_BOTH (ADC_CTRLA_DUALSEL_BOTH_Val << ADC_CTRLA_DUALSEL_Pos) +#define ADC_CTRLA_DUALSEL_INTERLEAVE (ADC_CTRLA_DUALSEL_INTERLEAVE_Val << ADC_CTRLA_DUALSEL_Pos) +#define ADC_CTRLA_SLAVEEN_Pos 5 /**< \brief (ADC_CTRLA) Slave Enable */ +#define ADC_CTRLA_SLAVEEN (_U_(0x1) << ADC_CTRLA_SLAVEEN_Pos) +#define ADC_CTRLA_RUNSTDBY_Pos 6 /**< \brief (ADC_CTRLA) Run in Standby */ +#define ADC_CTRLA_RUNSTDBY (_U_(0x1) << ADC_CTRLA_RUNSTDBY_Pos) +#define ADC_CTRLA_ONDEMAND_Pos 7 /**< \brief (ADC_CTRLA) On Demand Control */ +#define ADC_CTRLA_ONDEMAND (_U_(0x1) << ADC_CTRLA_ONDEMAND_Pos) +#define ADC_CTRLA_PRESCALER_Pos 8 /**< \brief (ADC_CTRLA) Prescaler Configuration */ +#define ADC_CTRLA_PRESCALER_Msk (_U_(0x7) << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER(value) (ADC_CTRLA_PRESCALER_Msk & ((value) << ADC_CTRLA_PRESCALER_Pos)) +#define ADC_CTRLA_PRESCALER_DIV2_Val _U_(0x0) /**< \brief (ADC_CTRLA) Peripheral clock divided by 2 */ +#define ADC_CTRLA_PRESCALER_DIV4_Val _U_(0x1) /**< \brief (ADC_CTRLA) Peripheral clock divided by 4 */ +#define ADC_CTRLA_PRESCALER_DIV8_Val _U_(0x2) /**< \brief (ADC_CTRLA) Peripheral clock divided by 8 */ +#define ADC_CTRLA_PRESCALER_DIV16_Val _U_(0x3) /**< \brief (ADC_CTRLA) Peripheral clock divided by 16 */ +#define ADC_CTRLA_PRESCALER_DIV32_Val _U_(0x4) /**< \brief (ADC_CTRLA) Peripheral clock divided by 32 */ +#define ADC_CTRLA_PRESCALER_DIV64_Val _U_(0x5) /**< \brief (ADC_CTRLA) Peripheral clock divided by 64 */ +#define ADC_CTRLA_PRESCALER_DIV128_Val _U_(0x6) /**< \brief (ADC_CTRLA) Peripheral clock divided by 128 */ +#define ADC_CTRLA_PRESCALER_DIV256_Val _U_(0x7) /**< \brief (ADC_CTRLA) Peripheral clock divided by 256 */ +#define ADC_CTRLA_PRESCALER_DIV2 (ADC_CTRLA_PRESCALER_DIV2_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV4 (ADC_CTRLA_PRESCALER_DIV4_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV8 (ADC_CTRLA_PRESCALER_DIV8_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV16 (ADC_CTRLA_PRESCALER_DIV16_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV32 (ADC_CTRLA_PRESCALER_DIV32_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV64 (ADC_CTRLA_PRESCALER_DIV64_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV128 (ADC_CTRLA_PRESCALER_DIV128_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_PRESCALER_DIV256 (ADC_CTRLA_PRESCALER_DIV256_Val << ADC_CTRLA_PRESCALER_Pos) +#define ADC_CTRLA_R2R_Pos 15 /**< \brief (ADC_CTRLA) Rail to Rail Operation Enable */ +#define ADC_CTRLA_R2R (_U_(0x1) << ADC_CTRLA_R2R_Pos) +#define ADC_CTRLA_MASK _U_(0x87FB) /**< \brief (ADC_CTRLA) MASK Register */ + +/* -------- ADC_EVCTRL : (ADC Offset: 0x02) (R/W 8) Event Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t FLUSHEI:1; /*!< bit: 0 Flush Event Input Enable */ + uint8_t STARTEI:1; /*!< bit: 1 Start Conversion Event Input Enable */ + uint8_t FLUSHINV:1; /*!< bit: 2 Flush Event Invert Enable */ + uint8_t STARTINV:1; /*!< bit: 3 Start Conversion Event Invert Enable */ + uint8_t RESRDYEO:1; /*!< bit: 4 Result Ready Event Out */ + uint8_t WINMONEO:1; /*!< bit: 5 Window Monitor Event Out */ + uint8_t :2; /*!< bit: 6.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_EVCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_EVCTRL_OFFSET 0x02 /**< \brief (ADC_EVCTRL offset) Event Control */ +#define ADC_EVCTRL_RESETVALUE _U_(0x00) /**< \brief (ADC_EVCTRL reset_value) Event Control */ + +#define ADC_EVCTRL_FLUSHEI_Pos 0 /**< \brief (ADC_EVCTRL) Flush Event Input Enable */ +#define ADC_EVCTRL_FLUSHEI (_U_(0x1) << ADC_EVCTRL_FLUSHEI_Pos) +#define ADC_EVCTRL_STARTEI_Pos 1 /**< \brief (ADC_EVCTRL) Start Conversion Event Input Enable */ +#define ADC_EVCTRL_STARTEI (_U_(0x1) << ADC_EVCTRL_STARTEI_Pos) +#define ADC_EVCTRL_FLUSHINV_Pos 2 /**< \brief (ADC_EVCTRL) Flush Event Invert Enable */ +#define ADC_EVCTRL_FLUSHINV (_U_(0x1) << ADC_EVCTRL_FLUSHINV_Pos) +#define ADC_EVCTRL_STARTINV_Pos 3 /**< \brief (ADC_EVCTRL) Start Conversion Event Invert Enable */ +#define ADC_EVCTRL_STARTINV (_U_(0x1) << ADC_EVCTRL_STARTINV_Pos) +#define ADC_EVCTRL_RESRDYEO_Pos 4 /**< \brief (ADC_EVCTRL) Result Ready Event Out */ +#define ADC_EVCTRL_RESRDYEO (_U_(0x1) << ADC_EVCTRL_RESRDYEO_Pos) +#define ADC_EVCTRL_WINMONEO_Pos 5 /**< \brief (ADC_EVCTRL) Window Monitor Event Out */ +#define ADC_EVCTRL_WINMONEO (_U_(0x1) << ADC_EVCTRL_WINMONEO_Pos) +#define ADC_EVCTRL_MASK _U_(0x3F) /**< \brief (ADC_EVCTRL) MASK Register */ + +/* -------- ADC_DBGCTRL : (ADC Offset: 0x03) (R/W 8) Debug Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DBGRUN:1; /*!< bit: 0 Debug Run */ + uint8_t :7; /*!< bit: 1.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_DBGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_DBGCTRL_OFFSET 0x03 /**< \brief (ADC_DBGCTRL offset) Debug Control */ +#define ADC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (ADC_DBGCTRL reset_value) Debug Control */ + +#define ADC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (ADC_DBGCTRL) Debug Run */ +#define ADC_DBGCTRL_DBGRUN (_U_(0x1) << ADC_DBGCTRL_DBGRUN_Pos) +#define ADC_DBGCTRL_MASK _U_(0x01) /**< \brief (ADC_DBGCTRL) MASK Register */ + +/* -------- ADC_INPUTCTRL : (ADC Offset: 0x04) (R/W 16) Input Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t MUXPOS:5; /*!< bit: 0.. 4 Positive Mux Input Selection */ + uint16_t :2; /*!< bit: 5.. 6 Reserved */ + uint16_t DIFFMODE:1; /*!< bit: 7 Differential Mode */ + uint16_t MUXNEG:5; /*!< bit: 8..12 Negative Mux Input Selection */ + uint16_t :2; /*!< bit: 13..14 Reserved */ + uint16_t DSEQSTOP:1; /*!< bit: 15 Stop DMA Sequencing */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_INPUTCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_INPUTCTRL_OFFSET 0x04 /**< \brief (ADC_INPUTCTRL offset) Input Control */ +#define ADC_INPUTCTRL_RESETVALUE _U_(0x0000) /**< \brief (ADC_INPUTCTRL reset_value) Input Control */ + +#define ADC_INPUTCTRL_MUXPOS_Pos 0 /**< \brief (ADC_INPUTCTRL) Positive Mux Input Selection */ +#define ADC_INPUTCTRL_MUXPOS_Msk (_U_(0x1F) << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS(value) (ADC_INPUTCTRL_MUXPOS_Msk & ((value) << ADC_INPUTCTRL_MUXPOS_Pos)) +#define ADC_INPUTCTRL_MUXPOS_AIN0_Val _U_(0x0) /**< \brief (ADC_INPUTCTRL) ADC AIN0 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN1_Val _U_(0x1) /**< \brief (ADC_INPUTCTRL) ADC AIN1 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN2_Val _U_(0x2) /**< \brief (ADC_INPUTCTRL) ADC AIN2 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN3_Val _U_(0x3) /**< \brief (ADC_INPUTCTRL) ADC AIN3 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN4_Val _U_(0x4) /**< \brief (ADC_INPUTCTRL) ADC AIN4 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN5_Val _U_(0x5) /**< \brief (ADC_INPUTCTRL) ADC AIN5 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN6_Val _U_(0x6) /**< \brief (ADC_INPUTCTRL) ADC AIN6 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN7_Val _U_(0x7) /**< \brief (ADC_INPUTCTRL) ADC AIN7 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN8_Val _U_(0x8) /**< \brief (ADC_INPUTCTRL) ADC AIN8 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN9_Val _U_(0x9) /**< \brief (ADC_INPUTCTRL) ADC AIN9 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN10_Val _U_(0xA) /**< \brief (ADC_INPUTCTRL) ADC AIN10 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN11_Val _U_(0xB) /**< \brief (ADC_INPUTCTRL) ADC AIN11 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN12_Val _U_(0xC) /**< \brief (ADC_INPUTCTRL) ADC AIN12 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN13_Val _U_(0xD) /**< \brief (ADC_INPUTCTRL) ADC AIN13 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN14_Val _U_(0xE) /**< \brief (ADC_INPUTCTRL) ADC AIN14 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN15_Val _U_(0xF) /**< \brief (ADC_INPUTCTRL) ADC AIN15 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN16_Val _U_(0x10) /**< \brief (ADC_INPUTCTRL) ADC AIN16 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN17_Val _U_(0x11) /**< \brief (ADC_INPUTCTRL) ADC AIN17 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN18_Val _U_(0x12) /**< \brief (ADC_INPUTCTRL) ADC AIN18 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN19_Val _U_(0x13) /**< \brief (ADC_INPUTCTRL) ADC AIN19 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN20_Val _U_(0x14) /**< \brief (ADC_INPUTCTRL) ADC AIN20 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN21_Val _U_(0x15) /**< \brief (ADC_INPUTCTRL) ADC AIN21 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN22_Val _U_(0x16) /**< \brief (ADC_INPUTCTRL) ADC AIN22 Pin */ +#define ADC_INPUTCTRL_MUXPOS_AIN23_Val _U_(0x17) /**< \brief (ADC_INPUTCTRL) ADC AIN23 Pin */ +#define ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC_Val _U_(0x18) /**< \brief (ADC_INPUTCTRL) 1/4 Scaled Core Supply */ +#define ADC_INPUTCTRL_MUXPOS_SCALEDVBAT_Val _U_(0x19) /**< \brief (ADC_INPUTCTRL) 1/4 Scaled VBAT Supply */ +#define ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC_Val _U_(0x1A) /**< \brief (ADC_INPUTCTRL) 1/4 Scaled I/O Supply */ +#define ADC_INPUTCTRL_MUXPOS_BANDGAP_Val _U_(0x1B) /**< \brief (ADC_INPUTCTRL) Bandgap Voltage */ +#define ADC_INPUTCTRL_MUXPOS_PTAT_Val _U_(0x1C) /**< \brief (ADC_INPUTCTRL) Temperature Sensor */ +#define ADC_INPUTCTRL_MUXPOS_CTAT_Val _U_(0x1D) /**< \brief (ADC_INPUTCTRL) Temperature Sensor */ +#define ADC_INPUTCTRL_MUXPOS_DAC_Val _U_(0x1E) /**< \brief (ADC_INPUTCTRL) DAC Output */ +#define ADC_INPUTCTRL_MUXPOS_PTC_Val _U_(0x1F) /**< \brief (ADC_INPUTCTRL) PTC output (only on ADC0) */ +#define ADC_INPUTCTRL_MUXPOS_AIN0 (ADC_INPUTCTRL_MUXPOS_AIN0_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN1 (ADC_INPUTCTRL_MUXPOS_AIN1_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN2 (ADC_INPUTCTRL_MUXPOS_AIN2_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN3 (ADC_INPUTCTRL_MUXPOS_AIN3_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN4 (ADC_INPUTCTRL_MUXPOS_AIN4_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN5 (ADC_INPUTCTRL_MUXPOS_AIN5_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN6 (ADC_INPUTCTRL_MUXPOS_AIN6_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN7 (ADC_INPUTCTRL_MUXPOS_AIN7_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN8 (ADC_INPUTCTRL_MUXPOS_AIN8_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN9 (ADC_INPUTCTRL_MUXPOS_AIN9_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN10 (ADC_INPUTCTRL_MUXPOS_AIN10_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN11 (ADC_INPUTCTRL_MUXPOS_AIN11_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN12 (ADC_INPUTCTRL_MUXPOS_AIN12_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN13 (ADC_INPUTCTRL_MUXPOS_AIN13_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN14 (ADC_INPUTCTRL_MUXPOS_AIN14_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN15 (ADC_INPUTCTRL_MUXPOS_AIN15_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN16 (ADC_INPUTCTRL_MUXPOS_AIN16_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN17 (ADC_INPUTCTRL_MUXPOS_AIN17_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN18 (ADC_INPUTCTRL_MUXPOS_AIN18_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN19 (ADC_INPUTCTRL_MUXPOS_AIN19_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN20 (ADC_INPUTCTRL_MUXPOS_AIN20_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN21 (ADC_INPUTCTRL_MUXPOS_AIN21_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN22 (ADC_INPUTCTRL_MUXPOS_AIN22_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_AIN23 (ADC_INPUTCTRL_MUXPOS_AIN23_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC (ADC_INPUTCTRL_MUXPOS_SCALEDCOREVCC_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_SCALEDVBAT (ADC_INPUTCTRL_MUXPOS_SCALEDVBAT_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC (ADC_INPUTCTRL_MUXPOS_SCALEDIOVCC_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_BANDGAP (ADC_INPUTCTRL_MUXPOS_BANDGAP_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_PTAT (ADC_INPUTCTRL_MUXPOS_PTAT_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_CTAT (ADC_INPUTCTRL_MUXPOS_CTAT_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_DAC (ADC_INPUTCTRL_MUXPOS_DAC_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_MUXPOS_PTC (ADC_INPUTCTRL_MUXPOS_PTC_Val << ADC_INPUTCTRL_MUXPOS_Pos) +#define ADC_INPUTCTRL_DIFFMODE_Pos 7 /**< \brief (ADC_INPUTCTRL) Differential Mode */ +#define ADC_INPUTCTRL_DIFFMODE (_U_(0x1) << ADC_INPUTCTRL_DIFFMODE_Pos) +#define ADC_INPUTCTRL_MUXNEG_Pos 8 /**< \brief (ADC_INPUTCTRL) Negative Mux Input Selection */ +#define ADC_INPUTCTRL_MUXNEG_Msk (_U_(0x1F) << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG(value) (ADC_INPUTCTRL_MUXNEG_Msk & ((value) << ADC_INPUTCTRL_MUXNEG_Pos)) +#define ADC_INPUTCTRL_MUXNEG_AIN0_Val _U_(0x0) /**< \brief (ADC_INPUTCTRL) ADC AIN0 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN1_Val _U_(0x1) /**< \brief (ADC_INPUTCTRL) ADC AIN1 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN2_Val _U_(0x2) /**< \brief (ADC_INPUTCTRL) ADC AIN2 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN3_Val _U_(0x3) /**< \brief (ADC_INPUTCTRL) ADC AIN3 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN4_Val _U_(0x4) /**< \brief (ADC_INPUTCTRL) ADC AIN4 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN5_Val _U_(0x5) /**< \brief (ADC_INPUTCTRL) ADC AIN5 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN6_Val _U_(0x6) /**< \brief (ADC_INPUTCTRL) ADC AIN6 Pin */ +#define ADC_INPUTCTRL_MUXNEG_AIN7_Val _U_(0x7) /**< \brief (ADC_INPUTCTRL) ADC AIN7 Pin */ +#define ADC_INPUTCTRL_MUXNEG_GND_Val _U_(0x18) /**< \brief (ADC_INPUTCTRL) Internal Ground */ +#define ADC_INPUTCTRL_MUXNEG_AIN0 (ADC_INPUTCTRL_MUXNEG_AIN0_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN1 (ADC_INPUTCTRL_MUXNEG_AIN1_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN2 (ADC_INPUTCTRL_MUXNEG_AIN2_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN3 (ADC_INPUTCTRL_MUXNEG_AIN3_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN4 (ADC_INPUTCTRL_MUXNEG_AIN4_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN5 (ADC_INPUTCTRL_MUXNEG_AIN5_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN6 (ADC_INPUTCTRL_MUXNEG_AIN6_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_AIN7 (ADC_INPUTCTRL_MUXNEG_AIN7_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_MUXNEG_GND (ADC_INPUTCTRL_MUXNEG_GND_Val << ADC_INPUTCTRL_MUXNEG_Pos) +#define ADC_INPUTCTRL_DSEQSTOP_Pos 15 /**< \brief (ADC_INPUTCTRL) Stop DMA Sequencing */ +#define ADC_INPUTCTRL_DSEQSTOP (_U_(0x1) << ADC_INPUTCTRL_DSEQSTOP_Pos) +#define ADC_INPUTCTRL_MASK _U_(0x9F9F) /**< \brief (ADC_INPUTCTRL) MASK Register */ + +/* -------- ADC_CTRLB : (ADC Offset: 0x06) (R/W 16) Control B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t LEFTADJ:1; /*!< bit: 0 Left-Adjusted Result */ + uint16_t FREERUN:1; /*!< bit: 1 Free Running Mode */ + uint16_t CORREN:1; /*!< bit: 2 Digital Correction Logic Enable */ + uint16_t RESSEL:2; /*!< bit: 3.. 4 Conversion Result Resolution */ + uint16_t :3; /*!< bit: 5.. 7 Reserved */ + uint16_t WINMODE:3; /*!< bit: 8..10 Window Monitor Mode */ + uint16_t WINSS:1; /*!< bit: 11 Window Single Sample */ + uint16_t :4; /*!< bit: 12..15 Reserved */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_CTRLB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_CTRLB_OFFSET 0x06 /**< \brief (ADC_CTRLB offset) Control B */ +#define ADC_CTRLB_RESETVALUE _U_(0x0000) /**< \brief (ADC_CTRLB reset_value) Control B */ + +#define ADC_CTRLB_LEFTADJ_Pos 0 /**< \brief (ADC_CTRLB) Left-Adjusted Result */ +#define ADC_CTRLB_LEFTADJ (_U_(0x1) << ADC_CTRLB_LEFTADJ_Pos) +#define ADC_CTRLB_FREERUN_Pos 1 /**< \brief (ADC_CTRLB) Free Running Mode */ +#define ADC_CTRLB_FREERUN (_U_(0x1) << ADC_CTRLB_FREERUN_Pos) +#define ADC_CTRLB_CORREN_Pos 2 /**< \brief (ADC_CTRLB) Digital Correction Logic Enable */ +#define ADC_CTRLB_CORREN (_U_(0x1) << ADC_CTRLB_CORREN_Pos) +#define ADC_CTRLB_RESSEL_Pos 3 /**< \brief (ADC_CTRLB) Conversion Result Resolution */ +#define ADC_CTRLB_RESSEL_Msk (_U_(0x3) << ADC_CTRLB_RESSEL_Pos) +#define ADC_CTRLB_RESSEL(value) (ADC_CTRLB_RESSEL_Msk & ((value) << ADC_CTRLB_RESSEL_Pos)) +#define ADC_CTRLB_RESSEL_12BIT_Val _U_(0x0) /**< \brief (ADC_CTRLB) 12-bit result */ +#define ADC_CTRLB_RESSEL_16BIT_Val _U_(0x1) /**< \brief (ADC_CTRLB) For averaging mode output */ +#define ADC_CTRLB_RESSEL_10BIT_Val _U_(0x2) /**< \brief (ADC_CTRLB) 10-bit result */ +#define ADC_CTRLB_RESSEL_8BIT_Val _U_(0x3) /**< \brief (ADC_CTRLB) 8-bit result */ +#define ADC_CTRLB_RESSEL_12BIT (ADC_CTRLB_RESSEL_12BIT_Val << ADC_CTRLB_RESSEL_Pos) +#define ADC_CTRLB_RESSEL_16BIT (ADC_CTRLB_RESSEL_16BIT_Val << ADC_CTRLB_RESSEL_Pos) +#define ADC_CTRLB_RESSEL_10BIT (ADC_CTRLB_RESSEL_10BIT_Val << ADC_CTRLB_RESSEL_Pos) +#define ADC_CTRLB_RESSEL_8BIT (ADC_CTRLB_RESSEL_8BIT_Val << ADC_CTRLB_RESSEL_Pos) +#define ADC_CTRLB_WINMODE_Pos 8 /**< \brief (ADC_CTRLB) Window Monitor Mode */ +#define ADC_CTRLB_WINMODE_Msk (_U_(0x7) << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINMODE(value) (ADC_CTRLB_WINMODE_Msk & ((value) << ADC_CTRLB_WINMODE_Pos)) +#define ADC_CTRLB_WINMODE_DISABLE_Val _U_(0x0) /**< \brief (ADC_CTRLB) No window mode (default) */ +#define ADC_CTRLB_WINMODE_MODE1_Val _U_(0x1) /**< \brief (ADC_CTRLB) RESULT > WINLT */ +#define ADC_CTRLB_WINMODE_MODE2_Val _U_(0x2) /**< \brief (ADC_CTRLB) RESULT < WINUT */ +#define ADC_CTRLB_WINMODE_MODE3_Val _U_(0x3) /**< \brief (ADC_CTRLB) WINLT < RESULT < WINUT */ +#define ADC_CTRLB_WINMODE_MODE4_Val _U_(0x4) /**< \brief (ADC_CTRLB) !(WINLT < RESULT < WINUT) */ +#define ADC_CTRLB_WINMODE_DISABLE (ADC_CTRLB_WINMODE_DISABLE_Val << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINMODE_MODE1 (ADC_CTRLB_WINMODE_MODE1_Val << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINMODE_MODE2 (ADC_CTRLB_WINMODE_MODE2_Val << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINMODE_MODE3 (ADC_CTRLB_WINMODE_MODE3_Val << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINMODE_MODE4 (ADC_CTRLB_WINMODE_MODE4_Val << ADC_CTRLB_WINMODE_Pos) +#define ADC_CTRLB_WINSS_Pos 11 /**< \brief (ADC_CTRLB) Window Single Sample */ +#define ADC_CTRLB_WINSS (_U_(0x1) << ADC_CTRLB_WINSS_Pos) +#define ADC_CTRLB_MASK _U_(0x0F1F) /**< \brief (ADC_CTRLB) MASK Register */ + +/* -------- ADC_REFCTRL : (ADC Offset: 0x08) (R/W 8) Reference Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t REFSEL:4; /*!< bit: 0.. 3 Reference Selection */ + uint8_t :3; /*!< bit: 4.. 6 Reserved */ + uint8_t REFCOMP:1; /*!< bit: 7 Reference Buffer Offset Compensation Enable */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_REFCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_REFCTRL_OFFSET 0x08 /**< \brief (ADC_REFCTRL offset) Reference Control */ +#define ADC_REFCTRL_RESETVALUE _U_(0x00) /**< \brief (ADC_REFCTRL reset_value) Reference Control */ + +#define ADC_REFCTRL_REFSEL_Pos 0 /**< \brief (ADC_REFCTRL) Reference Selection */ +#define ADC_REFCTRL_REFSEL_Msk (_U_(0xF) << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL(value) (ADC_REFCTRL_REFSEL_Msk & ((value) << ADC_REFCTRL_REFSEL_Pos)) +#define ADC_REFCTRL_REFSEL_INTREF_Val _U_(0x0) /**< \brief (ADC_REFCTRL) Internal Bandgap Reference */ +#define ADC_REFCTRL_REFSEL_INTVCC0_Val _U_(0x2) /**< \brief (ADC_REFCTRL) 1/2 VDDANA */ +#define ADC_REFCTRL_REFSEL_INTVCC1_Val _U_(0x3) /**< \brief (ADC_REFCTRL) VDDANA */ +#define ADC_REFCTRL_REFSEL_AREFA_Val _U_(0x4) /**< \brief (ADC_REFCTRL) External Reference */ +#define ADC_REFCTRL_REFSEL_AREFB_Val _U_(0x5) /**< \brief (ADC_REFCTRL) External Reference */ +#define ADC_REFCTRL_REFSEL_AREFC_Val _U_(0x6) /**< \brief (ADC_REFCTRL) External Reference (only on ADC1) */ +#define ADC_REFCTRL_REFSEL_INTREF (ADC_REFCTRL_REFSEL_INTREF_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL_INTVCC0 (ADC_REFCTRL_REFSEL_INTVCC0_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL_INTVCC1 (ADC_REFCTRL_REFSEL_INTVCC1_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL_AREFA (ADC_REFCTRL_REFSEL_AREFA_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL_AREFB (ADC_REFCTRL_REFSEL_AREFB_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFSEL_AREFC (ADC_REFCTRL_REFSEL_AREFC_Val << ADC_REFCTRL_REFSEL_Pos) +#define ADC_REFCTRL_REFCOMP_Pos 7 /**< \brief (ADC_REFCTRL) Reference Buffer Offset Compensation Enable */ +#define ADC_REFCTRL_REFCOMP (_U_(0x1) << ADC_REFCTRL_REFCOMP_Pos) +#define ADC_REFCTRL_MASK _U_(0x8F) /**< \brief (ADC_REFCTRL) MASK Register */ + +/* -------- ADC_AVGCTRL : (ADC Offset: 0x0A) (R/W 8) Average Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SAMPLENUM:4; /*!< bit: 0.. 3 Number of Samples to be Collected */ + uint8_t ADJRES:3; /*!< bit: 4.. 6 Adjusting Result / Division Coefficient */ + uint8_t :1; /*!< bit: 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_AVGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_AVGCTRL_OFFSET 0x0A /**< \brief (ADC_AVGCTRL offset) Average Control */ +#define ADC_AVGCTRL_RESETVALUE _U_(0x00) /**< \brief (ADC_AVGCTRL reset_value) Average Control */ + +#define ADC_AVGCTRL_SAMPLENUM_Pos 0 /**< \brief (ADC_AVGCTRL) Number of Samples to be Collected */ +#define ADC_AVGCTRL_SAMPLENUM_Msk (_U_(0xF) << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM(value) (ADC_AVGCTRL_SAMPLENUM_Msk & ((value) << ADC_AVGCTRL_SAMPLENUM_Pos)) +#define ADC_AVGCTRL_SAMPLENUM_1_Val _U_(0x0) /**< \brief (ADC_AVGCTRL) 1 sample */ +#define ADC_AVGCTRL_SAMPLENUM_2_Val _U_(0x1) /**< \brief (ADC_AVGCTRL) 2 samples */ +#define ADC_AVGCTRL_SAMPLENUM_4_Val _U_(0x2) /**< \brief (ADC_AVGCTRL) 4 samples */ +#define ADC_AVGCTRL_SAMPLENUM_8_Val _U_(0x3) /**< \brief (ADC_AVGCTRL) 8 samples */ +#define ADC_AVGCTRL_SAMPLENUM_16_Val _U_(0x4) /**< \brief (ADC_AVGCTRL) 16 samples */ +#define ADC_AVGCTRL_SAMPLENUM_32_Val _U_(0x5) /**< \brief (ADC_AVGCTRL) 32 samples */ +#define ADC_AVGCTRL_SAMPLENUM_64_Val _U_(0x6) /**< \brief (ADC_AVGCTRL) 64 samples */ +#define ADC_AVGCTRL_SAMPLENUM_128_Val _U_(0x7) /**< \brief (ADC_AVGCTRL) 128 samples */ +#define ADC_AVGCTRL_SAMPLENUM_256_Val _U_(0x8) /**< \brief (ADC_AVGCTRL) 256 samples */ +#define ADC_AVGCTRL_SAMPLENUM_512_Val _U_(0x9) /**< \brief (ADC_AVGCTRL) 512 samples */ +#define ADC_AVGCTRL_SAMPLENUM_1024_Val _U_(0xA) /**< \brief (ADC_AVGCTRL) 1024 samples */ +#define ADC_AVGCTRL_SAMPLENUM_1 (ADC_AVGCTRL_SAMPLENUM_1_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_2 (ADC_AVGCTRL_SAMPLENUM_2_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_4 (ADC_AVGCTRL_SAMPLENUM_4_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_8 (ADC_AVGCTRL_SAMPLENUM_8_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_16 (ADC_AVGCTRL_SAMPLENUM_16_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_32 (ADC_AVGCTRL_SAMPLENUM_32_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_64 (ADC_AVGCTRL_SAMPLENUM_64_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_128 (ADC_AVGCTRL_SAMPLENUM_128_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_256 (ADC_AVGCTRL_SAMPLENUM_256_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_512 (ADC_AVGCTRL_SAMPLENUM_512_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_SAMPLENUM_1024 (ADC_AVGCTRL_SAMPLENUM_1024_Val << ADC_AVGCTRL_SAMPLENUM_Pos) +#define ADC_AVGCTRL_ADJRES_Pos 4 /**< \brief (ADC_AVGCTRL) Adjusting Result / Division Coefficient */ +#define ADC_AVGCTRL_ADJRES_Msk (_U_(0x7) << ADC_AVGCTRL_ADJRES_Pos) +#define ADC_AVGCTRL_ADJRES(value) (ADC_AVGCTRL_ADJRES_Msk & ((value) << ADC_AVGCTRL_ADJRES_Pos)) +#define ADC_AVGCTRL_MASK _U_(0x7F) /**< \brief (ADC_AVGCTRL) MASK Register */ + +/* -------- ADC_SAMPCTRL : (ADC Offset: 0x0B) (R/W 8) Sample Time Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SAMPLEN:6; /*!< bit: 0.. 5 Sampling Time Length */ + uint8_t :1; /*!< bit: 6 Reserved */ + uint8_t OFFCOMP:1; /*!< bit: 7 Comparator Offset Compensation Enable */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_SAMPCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_SAMPCTRL_OFFSET 0x0B /**< \brief (ADC_SAMPCTRL offset) Sample Time Control */ +#define ADC_SAMPCTRL_RESETVALUE _U_(0x00) /**< \brief (ADC_SAMPCTRL reset_value) Sample Time Control */ + +#define ADC_SAMPCTRL_SAMPLEN_Pos 0 /**< \brief (ADC_SAMPCTRL) Sampling Time Length */ +#define ADC_SAMPCTRL_SAMPLEN_Msk (_U_(0x3F) << ADC_SAMPCTRL_SAMPLEN_Pos) +#define ADC_SAMPCTRL_SAMPLEN(value) (ADC_SAMPCTRL_SAMPLEN_Msk & ((value) << ADC_SAMPCTRL_SAMPLEN_Pos)) +#define ADC_SAMPCTRL_OFFCOMP_Pos 7 /**< \brief (ADC_SAMPCTRL) Comparator Offset Compensation Enable */ +#define ADC_SAMPCTRL_OFFCOMP (_U_(0x1) << ADC_SAMPCTRL_OFFCOMP_Pos) +#define ADC_SAMPCTRL_MASK _U_(0xBF) /**< \brief (ADC_SAMPCTRL) MASK Register */ + +/* -------- ADC_WINLT : (ADC Offset: 0x0C) (R/W 16) Window Monitor Lower Threshold -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t WINLT:16; /*!< bit: 0..15 Window Lower Threshold */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_WINLT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_WINLT_OFFSET 0x0C /**< \brief (ADC_WINLT offset) Window Monitor Lower Threshold */ +#define ADC_WINLT_RESETVALUE _U_(0x0000) /**< \brief (ADC_WINLT reset_value) Window Monitor Lower Threshold */ + +#define ADC_WINLT_WINLT_Pos 0 /**< \brief (ADC_WINLT) Window Lower Threshold */ +#define ADC_WINLT_WINLT_Msk (_U_(0xFFFF) << ADC_WINLT_WINLT_Pos) +#define ADC_WINLT_WINLT(value) (ADC_WINLT_WINLT_Msk & ((value) << ADC_WINLT_WINLT_Pos)) +#define ADC_WINLT_MASK _U_(0xFFFF) /**< \brief (ADC_WINLT) MASK Register */ + +/* -------- ADC_WINUT : (ADC Offset: 0x0E) (R/W 16) Window Monitor Upper Threshold -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t WINUT:16; /*!< bit: 0..15 Window Upper Threshold */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_WINUT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_WINUT_OFFSET 0x0E /**< \brief (ADC_WINUT offset) Window Monitor Upper Threshold */ +#define ADC_WINUT_RESETVALUE _U_(0x0000) /**< \brief (ADC_WINUT reset_value) Window Monitor Upper Threshold */ + +#define ADC_WINUT_WINUT_Pos 0 /**< \brief (ADC_WINUT) Window Upper Threshold */ +#define ADC_WINUT_WINUT_Msk (_U_(0xFFFF) << ADC_WINUT_WINUT_Pos) +#define ADC_WINUT_WINUT(value) (ADC_WINUT_WINUT_Msk & ((value) << ADC_WINUT_WINUT_Pos)) +#define ADC_WINUT_MASK _U_(0xFFFF) /**< \brief (ADC_WINUT) MASK Register */ + +/* -------- ADC_GAINCORR : (ADC Offset: 0x10) (R/W 16) Gain Correction -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t GAINCORR:12; /*!< bit: 0..11 Gain Correction Value */ + uint16_t :4; /*!< bit: 12..15 Reserved */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_GAINCORR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_GAINCORR_OFFSET 0x10 /**< \brief (ADC_GAINCORR offset) Gain Correction */ +#define ADC_GAINCORR_RESETVALUE _U_(0x0000) /**< \brief (ADC_GAINCORR reset_value) Gain Correction */ + +#define ADC_GAINCORR_GAINCORR_Pos 0 /**< \brief (ADC_GAINCORR) Gain Correction Value */ +#define ADC_GAINCORR_GAINCORR_Msk (_U_(0xFFF) << ADC_GAINCORR_GAINCORR_Pos) +#define ADC_GAINCORR_GAINCORR(value) (ADC_GAINCORR_GAINCORR_Msk & ((value) << ADC_GAINCORR_GAINCORR_Pos)) +#define ADC_GAINCORR_MASK _U_(0x0FFF) /**< \brief (ADC_GAINCORR) MASK Register */ + +/* -------- ADC_OFFSETCORR : (ADC Offset: 0x12) (R/W 16) Offset Correction -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t OFFSETCORR:12; /*!< bit: 0..11 Offset Correction Value */ + uint16_t :4; /*!< bit: 12..15 Reserved */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_OFFSETCORR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_OFFSETCORR_OFFSET 0x12 /**< \brief (ADC_OFFSETCORR offset) Offset Correction */ +#define ADC_OFFSETCORR_RESETVALUE _U_(0x0000) /**< \brief (ADC_OFFSETCORR reset_value) Offset Correction */ + +#define ADC_OFFSETCORR_OFFSETCORR_Pos 0 /**< \brief (ADC_OFFSETCORR) Offset Correction Value */ +#define ADC_OFFSETCORR_OFFSETCORR_Msk (_U_(0xFFF) << ADC_OFFSETCORR_OFFSETCORR_Pos) +#define ADC_OFFSETCORR_OFFSETCORR(value) (ADC_OFFSETCORR_OFFSETCORR_Msk & ((value) << ADC_OFFSETCORR_OFFSETCORR_Pos)) +#define ADC_OFFSETCORR_MASK _U_(0x0FFF) /**< \brief (ADC_OFFSETCORR) MASK Register */ + +/* -------- ADC_SWTRIG : (ADC Offset: 0x14) (R/W 8) Software Trigger -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t FLUSH:1; /*!< bit: 0 ADC Conversion Flush */ + uint8_t START:1; /*!< bit: 1 Start ADC Conversion */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_SWTRIG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_SWTRIG_OFFSET 0x14 /**< \brief (ADC_SWTRIG offset) Software Trigger */ +#define ADC_SWTRIG_RESETVALUE _U_(0x00) /**< \brief (ADC_SWTRIG reset_value) Software Trigger */ + +#define ADC_SWTRIG_FLUSH_Pos 0 /**< \brief (ADC_SWTRIG) ADC Conversion Flush */ +#define ADC_SWTRIG_FLUSH (_U_(0x1) << ADC_SWTRIG_FLUSH_Pos) +#define ADC_SWTRIG_START_Pos 1 /**< \brief (ADC_SWTRIG) Start ADC Conversion */ +#define ADC_SWTRIG_START (_U_(0x1) << ADC_SWTRIG_START_Pos) +#define ADC_SWTRIG_MASK _U_(0x03) /**< \brief (ADC_SWTRIG) MASK Register */ + +/* -------- ADC_INTENCLR : (ADC Offset: 0x2C) (R/W 8) Interrupt Enable Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t RESRDY:1; /*!< bit: 0 Result Ready Interrupt Disable */ + uint8_t OVERRUN:1; /*!< bit: 1 Overrun Interrupt Disable */ + uint8_t WINMON:1; /*!< bit: 2 Window Monitor Interrupt Disable */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_INTENCLR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_INTENCLR_OFFSET 0x2C /**< \brief (ADC_INTENCLR offset) Interrupt Enable Clear */ +#define ADC_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (ADC_INTENCLR reset_value) Interrupt Enable Clear */ + +#define ADC_INTENCLR_RESRDY_Pos 0 /**< \brief (ADC_INTENCLR) Result Ready Interrupt Disable */ +#define ADC_INTENCLR_RESRDY (_U_(0x1) << ADC_INTENCLR_RESRDY_Pos) +#define ADC_INTENCLR_OVERRUN_Pos 1 /**< \brief (ADC_INTENCLR) Overrun Interrupt Disable */ +#define ADC_INTENCLR_OVERRUN (_U_(0x1) << ADC_INTENCLR_OVERRUN_Pos) +#define ADC_INTENCLR_WINMON_Pos 2 /**< \brief (ADC_INTENCLR) Window Monitor Interrupt Disable */ +#define ADC_INTENCLR_WINMON (_U_(0x1) << ADC_INTENCLR_WINMON_Pos) +#define ADC_INTENCLR_MASK _U_(0x07) /**< \brief (ADC_INTENCLR) MASK Register */ + +/* -------- ADC_INTENSET : (ADC Offset: 0x2D) (R/W 8) Interrupt Enable Set -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t RESRDY:1; /*!< bit: 0 Result Ready Interrupt Enable */ + uint8_t OVERRUN:1; /*!< bit: 1 Overrun Interrupt Enable */ + uint8_t WINMON:1; /*!< bit: 2 Window Monitor Interrupt Enable */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_INTENSET_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_INTENSET_OFFSET 0x2D /**< \brief (ADC_INTENSET offset) Interrupt Enable Set */ +#define ADC_INTENSET_RESETVALUE _U_(0x00) /**< \brief (ADC_INTENSET reset_value) Interrupt Enable Set */ + +#define ADC_INTENSET_RESRDY_Pos 0 /**< \brief (ADC_INTENSET) Result Ready Interrupt Enable */ +#define ADC_INTENSET_RESRDY (_U_(0x1) << ADC_INTENSET_RESRDY_Pos) +#define ADC_INTENSET_OVERRUN_Pos 1 /**< \brief (ADC_INTENSET) Overrun Interrupt Enable */ +#define ADC_INTENSET_OVERRUN (_U_(0x1) << ADC_INTENSET_OVERRUN_Pos) +#define ADC_INTENSET_WINMON_Pos 2 /**< \brief (ADC_INTENSET) Window Monitor Interrupt Enable */ +#define ADC_INTENSET_WINMON (_U_(0x1) << ADC_INTENSET_WINMON_Pos) +#define ADC_INTENSET_MASK _U_(0x07) /**< \brief (ADC_INTENSET) MASK Register */ + +/* -------- ADC_INTFLAG : (ADC Offset: 0x2E) (R/W 8) Interrupt Flag Status and Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { // __I to avoid read-modify-write on write-to-clear register + struct { + __I uint8_t RESRDY:1; /*!< bit: 0 Result Ready Interrupt Flag */ + __I uint8_t OVERRUN:1; /*!< bit: 1 Overrun Interrupt Flag */ + __I uint8_t WINMON:1; /*!< bit: 2 Window Monitor Interrupt Flag */ + __I uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_INTFLAG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_INTFLAG_OFFSET 0x2E /**< \brief (ADC_INTFLAG offset) Interrupt Flag Status and Clear */ +#define ADC_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (ADC_INTFLAG reset_value) Interrupt Flag Status and Clear */ + +#define ADC_INTFLAG_RESRDY_Pos 0 /**< \brief (ADC_INTFLAG) Result Ready Interrupt Flag */ +#define ADC_INTFLAG_RESRDY (_U_(0x1) << ADC_INTFLAG_RESRDY_Pos) +#define ADC_INTFLAG_OVERRUN_Pos 1 /**< \brief (ADC_INTFLAG) Overrun Interrupt Flag */ +#define ADC_INTFLAG_OVERRUN (_U_(0x1) << ADC_INTFLAG_OVERRUN_Pos) +#define ADC_INTFLAG_WINMON_Pos 2 /**< \brief (ADC_INTFLAG) Window Monitor Interrupt Flag */ +#define ADC_INTFLAG_WINMON (_U_(0x1) << ADC_INTFLAG_WINMON_Pos) +#define ADC_INTFLAG_MASK _U_(0x07) /**< \brief (ADC_INTFLAG) MASK Register */ + +/* -------- ADC_STATUS : (ADC Offset: 0x2F) (R/ 8) Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t ADCBUSY:1; /*!< bit: 0 ADC Busy Status */ + uint8_t :1; /*!< bit: 1 Reserved */ + uint8_t WCC:6; /*!< bit: 2.. 7 Window Comparator Counter */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} ADC_STATUS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_STATUS_OFFSET 0x2F /**< \brief (ADC_STATUS offset) Status */ +#define ADC_STATUS_RESETVALUE _U_(0x00) /**< \brief (ADC_STATUS reset_value) Status */ + +#define ADC_STATUS_ADCBUSY_Pos 0 /**< \brief (ADC_STATUS) ADC Busy Status */ +#define ADC_STATUS_ADCBUSY (_U_(0x1) << ADC_STATUS_ADCBUSY_Pos) +#define ADC_STATUS_WCC_Pos 2 /**< \brief (ADC_STATUS) Window Comparator Counter */ +#define ADC_STATUS_WCC_Msk (_U_(0x3F) << ADC_STATUS_WCC_Pos) +#define ADC_STATUS_WCC(value) (ADC_STATUS_WCC_Msk & ((value) << ADC_STATUS_WCC_Pos)) +#define ADC_STATUS_MASK _U_(0xFD) /**< \brief (ADC_STATUS) MASK Register */ + +/* -------- ADC_SYNCBUSY : (ADC Offset: 0x30) (R/ 32) Synchronization Busy -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 SWRST Synchronization Busy */ + uint32_t ENABLE:1; /*!< bit: 1 ENABLE Synchronization Busy */ + uint32_t INPUTCTRL:1; /*!< bit: 2 Input Control Synchronization Busy */ + uint32_t CTRLB:1; /*!< bit: 3 Control B Synchronization Busy */ + uint32_t REFCTRL:1; /*!< bit: 4 Reference Control Synchronization Busy */ + uint32_t AVGCTRL:1; /*!< bit: 5 Average Control Synchronization Busy */ + uint32_t SAMPCTRL:1; /*!< bit: 6 Sampling Time Control Synchronization Busy */ + uint32_t WINLT:1; /*!< bit: 7 Window Monitor Lower Threshold Synchronization Busy */ + uint32_t WINUT:1; /*!< bit: 8 Window Monitor Upper Threshold Synchronization Busy */ + uint32_t GAINCORR:1; /*!< bit: 9 Gain Correction Synchronization Busy */ + uint32_t OFFSETCORR:1; /*!< bit: 10 Offset Correction Synchronization Busy */ + uint32_t SWTRIG:1; /*!< bit: 11 Software Trigger Synchronization Busy */ + uint32_t :20; /*!< bit: 12..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} ADC_SYNCBUSY_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_SYNCBUSY_OFFSET 0x30 /**< \brief (ADC_SYNCBUSY offset) Synchronization Busy */ +#define ADC_SYNCBUSY_RESETVALUE _U_(0x00000000) /**< \brief (ADC_SYNCBUSY reset_value) Synchronization Busy */ + +#define ADC_SYNCBUSY_SWRST_Pos 0 /**< \brief (ADC_SYNCBUSY) SWRST Synchronization Busy */ +#define ADC_SYNCBUSY_SWRST (_U_(0x1) << ADC_SYNCBUSY_SWRST_Pos) +#define ADC_SYNCBUSY_ENABLE_Pos 1 /**< \brief (ADC_SYNCBUSY) ENABLE Synchronization Busy */ +#define ADC_SYNCBUSY_ENABLE (_U_(0x1) << ADC_SYNCBUSY_ENABLE_Pos) +#define ADC_SYNCBUSY_INPUTCTRL_Pos 2 /**< \brief (ADC_SYNCBUSY) Input Control Synchronization Busy */ +#define ADC_SYNCBUSY_INPUTCTRL (_U_(0x1) << ADC_SYNCBUSY_INPUTCTRL_Pos) +#define ADC_SYNCBUSY_CTRLB_Pos 3 /**< \brief (ADC_SYNCBUSY) Control B Synchronization Busy */ +#define ADC_SYNCBUSY_CTRLB (_U_(0x1) << ADC_SYNCBUSY_CTRLB_Pos) +#define ADC_SYNCBUSY_REFCTRL_Pos 4 /**< \brief (ADC_SYNCBUSY) Reference Control Synchronization Busy */ +#define ADC_SYNCBUSY_REFCTRL (_U_(0x1) << ADC_SYNCBUSY_REFCTRL_Pos) +#define ADC_SYNCBUSY_AVGCTRL_Pos 5 /**< \brief (ADC_SYNCBUSY) Average Control Synchronization Busy */ +#define ADC_SYNCBUSY_AVGCTRL (_U_(0x1) << ADC_SYNCBUSY_AVGCTRL_Pos) +#define ADC_SYNCBUSY_SAMPCTRL_Pos 6 /**< \brief (ADC_SYNCBUSY) Sampling Time Control Synchronization Busy */ +#define ADC_SYNCBUSY_SAMPCTRL (_U_(0x1) << ADC_SYNCBUSY_SAMPCTRL_Pos) +#define ADC_SYNCBUSY_WINLT_Pos 7 /**< \brief (ADC_SYNCBUSY) Window Monitor Lower Threshold Synchronization Busy */ +#define ADC_SYNCBUSY_WINLT (_U_(0x1) << ADC_SYNCBUSY_WINLT_Pos) +#define ADC_SYNCBUSY_WINUT_Pos 8 /**< \brief (ADC_SYNCBUSY) Window Monitor Upper Threshold Synchronization Busy */ +#define ADC_SYNCBUSY_WINUT (_U_(0x1) << ADC_SYNCBUSY_WINUT_Pos) +#define ADC_SYNCBUSY_GAINCORR_Pos 9 /**< \brief (ADC_SYNCBUSY) Gain Correction Synchronization Busy */ +#define ADC_SYNCBUSY_GAINCORR (_U_(0x1) << ADC_SYNCBUSY_GAINCORR_Pos) +#define ADC_SYNCBUSY_OFFSETCORR_Pos 10 /**< \brief (ADC_SYNCBUSY) Offset Correction Synchronization Busy */ +#define ADC_SYNCBUSY_OFFSETCORR (_U_(0x1) << ADC_SYNCBUSY_OFFSETCORR_Pos) +#define ADC_SYNCBUSY_SWTRIG_Pos 11 /**< \brief (ADC_SYNCBUSY) Software Trigger Synchronization Busy */ +#define ADC_SYNCBUSY_SWTRIG (_U_(0x1) << ADC_SYNCBUSY_SWTRIG_Pos) +#define ADC_SYNCBUSY_MASK _U_(0x00000FFF) /**< \brief (ADC_SYNCBUSY) MASK Register */ + +/* -------- ADC_DSEQDATA : (ADC Offset: 0x34) ( /W 32) DMA Sequencial Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DATA:32; /*!< bit: 0..31 DMA Sequential Data */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} ADC_DSEQDATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_DSEQDATA_OFFSET 0x34 /**< \brief (ADC_DSEQDATA offset) DMA Sequencial Data */ +#define ADC_DSEQDATA_RESETVALUE _U_(0x00000000) /**< \brief (ADC_DSEQDATA reset_value) DMA Sequencial Data */ + +#define ADC_DSEQDATA_DATA_Pos 0 /**< \brief (ADC_DSEQDATA) DMA Sequential Data */ +#define ADC_DSEQDATA_DATA_Msk (_U_(0xFFFFFFFF) << ADC_DSEQDATA_DATA_Pos) +#define ADC_DSEQDATA_DATA(value) (ADC_DSEQDATA_DATA_Msk & ((value) << ADC_DSEQDATA_DATA_Pos)) +#define ADC_DSEQDATA_MASK _U_(0xFFFFFFFF) /**< \brief (ADC_DSEQDATA) MASK Register */ + +/* -------- ADC_DSEQCTRL : (ADC Offset: 0x38) (R/W 32) DMA Sequential Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t INPUTCTRL:1; /*!< bit: 0 Input Control */ + uint32_t CTRLB:1; /*!< bit: 1 Control B */ + uint32_t REFCTRL:1; /*!< bit: 2 Reference Control */ + uint32_t AVGCTRL:1; /*!< bit: 3 Average Control */ + uint32_t SAMPCTRL:1; /*!< bit: 4 Sampling Time Control */ + uint32_t WINLT:1; /*!< bit: 5 Window Monitor Lower Threshold */ + uint32_t WINUT:1; /*!< bit: 6 Window Monitor Upper Threshold */ + uint32_t GAINCORR:1; /*!< bit: 7 Gain Correction */ + uint32_t OFFSETCORR:1; /*!< bit: 8 Offset Correction */ + uint32_t :22; /*!< bit: 9..30 Reserved */ + uint32_t AUTOSTART:1; /*!< bit: 31 ADC Auto-Start Conversion */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} ADC_DSEQCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_DSEQCTRL_OFFSET 0x38 /**< \brief (ADC_DSEQCTRL offset) DMA Sequential Control */ +#define ADC_DSEQCTRL_RESETVALUE _U_(0x00000000) /**< \brief (ADC_DSEQCTRL reset_value) DMA Sequential Control */ + +#define ADC_DSEQCTRL_INPUTCTRL_Pos 0 /**< \brief (ADC_DSEQCTRL) Input Control */ +#define ADC_DSEQCTRL_INPUTCTRL (_U_(0x1) << ADC_DSEQCTRL_INPUTCTRL_Pos) +#define ADC_DSEQCTRL_CTRLB_Pos 1 /**< \brief (ADC_DSEQCTRL) Control B */ +#define ADC_DSEQCTRL_CTRLB (_U_(0x1) << ADC_DSEQCTRL_CTRLB_Pos) +#define ADC_DSEQCTRL_REFCTRL_Pos 2 /**< \brief (ADC_DSEQCTRL) Reference Control */ +#define ADC_DSEQCTRL_REFCTRL (_U_(0x1) << ADC_DSEQCTRL_REFCTRL_Pos) +#define ADC_DSEQCTRL_AVGCTRL_Pos 3 /**< \brief (ADC_DSEQCTRL) Average Control */ +#define ADC_DSEQCTRL_AVGCTRL (_U_(0x1) << ADC_DSEQCTRL_AVGCTRL_Pos) +#define ADC_DSEQCTRL_SAMPCTRL_Pos 4 /**< \brief (ADC_DSEQCTRL) Sampling Time Control */ +#define ADC_DSEQCTRL_SAMPCTRL (_U_(0x1) << ADC_DSEQCTRL_SAMPCTRL_Pos) +#define ADC_DSEQCTRL_WINLT_Pos 5 /**< \brief (ADC_DSEQCTRL) Window Monitor Lower Threshold */ +#define ADC_DSEQCTRL_WINLT (_U_(0x1) << ADC_DSEQCTRL_WINLT_Pos) +#define ADC_DSEQCTRL_WINUT_Pos 6 /**< \brief (ADC_DSEQCTRL) Window Monitor Upper Threshold */ +#define ADC_DSEQCTRL_WINUT (_U_(0x1) << ADC_DSEQCTRL_WINUT_Pos) +#define ADC_DSEQCTRL_GAINCORR_Pos 7 /**< \brief (ADC_DSEQCTRL) Gain Correction */ +#define ADC_DSEQCTRL_GAINCORR (_U_(0x1) << ADC_DSEQCTRL_GAINCORR_Pos) +#define ADC_DSEQCTRL_OFFSETCORR_Pos 8 /**< \brief (ADC_DSEQCTRL) Offset Correction */ +#define ADC_DSEQCTRL_OFFSETCORR (_U_(0x1) << ADC_DSEQCTRL_OFFSETCORR_Pos) +#define ADC_DSEQCTRL_AUTOSTART_Pos 31 /**< \brief (ADC_DSEQCTRL) ADC Auto-Start Conversion */ +#define ADC_DSEQCTRL_AUTOSTART (_U_(0x1) << ADC_DSEQCTRL_AUTOSTART_Pos) +#define ADC_DSEQCTRL_MASK _U_(0x800001FF) /**< \brief (ADC_DSEQCTRL) MASK Register */ + +/* -------- ADC_DSEQSTAT : (ADC Offset: 0x3C) (R/ 32) DMA Sequencial Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t INPUTCTRL:1; /*!< bit: 0 Input Control */ + uint32_t CTRLB:1; /*!< bit: 1 Control B */ + uint32_t REFCTRL:1; /*!< bit: 2 Reference Control */ + uint32_t AVGCTRL:1; /*!< bit: 3 Average Control */ + uint32_t SAMPCTRL:1; /*!< bit: 4 Sampling Time Control */ + uint32_t WINLT:1; /*!< bit: 5 Window Monitor Lower Threshold */ + uint32_t WINUT:1; /*!< bit: 6 Window Monitor Upper Threshold */ + uint32_t GAINCORR:1; /*!< bit: 7 Gain Correction */ + uint32_t OFFSETCORR:1; /*!< bit: 8 Offset Correction */ + uint32_t :22; /*!< bit: 9..30 Reserved */ + uint32_t BUSY:1; /*!< bit: 31 DMA Sequencing Busy */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} ADC_DSEQSTAT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_DSEQSTAT_OFFSET 0x3C /**< \brief (ADC_DSEQSTAT offset) DMA Sequencial Status */ +#define ADC_DSEQSTAT_RESETVALUE _U_(0x00000000) /**< \brief (ADC_DSEQSTAT reset_value) DMA Sequencial Status */ + +#define ADC_DSEQSTAT_INPUTCTRL_Pos 0 /**< \brief (ADC_DSEQSTAT) Input Control */ +#define ADC_DSEQSTAT_INPUTCTRL (_U_(0x1) << ADC_DSEQSTAT_INPUTCTRL_Pos) +#define ADC_DSEQSTAT_CTRLB_Pos 1 /**< \brief (ADC_DSEQSTAT) Control B */ +#define ADC_DSEQSTAT_CTRLB (_U_(0x1) << ADC_DSEQSTAT_CTRLB_Pos) +#define ADC_DSEQSTAT_REFCTRL_Pos 2 /**< \brief (ADC_DSEQSTAT) Reference Control */ +#define ADC_DSEQSTAT_REFCTRL (_U_(0x1) << ADC_DSEQSTAT_REFCTRL_Pos) +#define ADC_DSEQSTAT_AVGCTRL_Pos 3 /**< \brief (ADC_DSEQSTAT) Average Control */ +#define ADC_DSEQSTAT_AVGCTRL (_U_(0x1) << ADC_DSEQSTAT_AVGCTRL_Pos) +#define ADC_DSEQSTAT_SAMPCTRL_Pos 4 /**< \brief (ADC_DSEQSTAT) Sampling Time Control */ +#define ADC_DSEQSTAT_SAMPCTRL (_U_(0x1) << ADC_DSEQSTAT_SAMPCTRL_Pos) +#define ADC_DSEQSTAT_WINLT_Pos 5 /**< \brief (ADC_DSEQSTAT) Window Monitor Lower Threshold */ +#define ADC_DSEQSTAT_WINLT (_U_(0x1) << ADC_DSEQSTAT_WINLT_Pos) +#define ADC_DSEQSTAT_WINUT_Pos 6 /**< \brief (ADC_DSEQSTAT) Window Monitor Upper Threshold */ +#define ADC_DSEQSTAT_WINUT (_U_(0x1) << ADC_DSEQSTAT_WINUT_Pos) +#define ADC_DSEQSTAT_GAINCORR_Pos 7 /**< \brief (ADC_DSEQSTAT) Gain Correction */ +#define ADC_DSEQSTAT_GAINCORR (_U_(0x1) << ADC_DSEQSTAT_GAINCORR_Pos) +#define ADC_DSEQSTAT_OFFSETCORR_Pos 8 /**< \brief (ADC_DSEQSTAT) Offset Correction */ +#define ADC_DSEQSTAT_OFFSETCORR (_U_(0x1) << ADC_DSEQSTAT_OFFSETCORR_Pos) +#define ADC_DSEQSTAT_BUSY_Pos 31 /**< \brief (ADC_DSEQSTAT) DMA Sequencing Busy */ +#define ADC_DSEQSTAT_BUSY (_U_(0x1) << ADC_DSEQSTAT_BUSY_Pos) +#define ADC_DSEQSTAT_MASK _U_(0x800001FF) /**< \brief (ADC_DSEQSTAT) MASK Register */ + +/* -------- ADC_RESULT : (ADC Offset: 0x40) (R/ 16) Result Conversion Value -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t RESULT:16; /*!< bit: 0..15 Result Conversion Value */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_RESULT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_RESULT_OFFSET 0x40 /**< \brief (ADC_RESULT offset) Result Conversion Value */ +#define ADC_RESULT_RESETVALUE _U_(0x0000) /**< \brief (ADC_RESULT reset_value) Result Conversion Value */ + +#define ADC_RESULT_RESULT_Pos 0 /**< \brief (ADC_RESULT) Result Conversion Value */ +#define ADC_RESULT_RESULT_Msk (_U_(0xFFFF) << ADC_RESULT_RESULT_Pos) +#define ADC_RESULT_RESULT(value) (ADC_RESULT_RESULT_Msk & ((value) << ADC_RESULT_RESULT_Pos)) +#define ADC_RESULT_MASK _U_(0xFFFF) /**< \brief (ADC_RESULT) MASK Register */ + +/* -------- ADC_RESS : (ADC Offset: 0x44) (R/ 16) Last Sample Result -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t RESS:16; /*!< bit: 0..15 Last ADC conversion result */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_RESS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_RESS_OFFSET 0x44 /**< \brief (ADC_RESS offset) Last Sample Result */ +#define ADC_RESS_RESETVALUE _U_(0x0000) /**< \brief (ADC_RESS reset_value) Last Sample Result */ + +#define ADC_RESS_RESS_Pos 0 /**< \brief (ADC_RESS) Last ADC conversion result */ +#define ADC_RESS_RESS_Msk (_U_(0xFFFF) << ADC_RESS_RESS_Pos) +#define ADC_RESS_RESS(value) (ADC_RESS_RESS_Msk & ((value) << ADC_RESS_RESS_Pos)) +#define ADC_RESS_MASK _U_(0xFFFF) /**< \brief (ADC_RESS) MASK Register */ + +/* -------- ADC_CALIB : (ADC Offset: 0x48) (R/W 16) Calibration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t BIASCOMP:3; /*!< bit: 0.. 2 Bias Comparator Scaling */ + uint16_t :1; /*!< bit: 3 Reserved */ + uint16_t BIASR2R:3; /*!< bit: 4.. 6 Bias R2R Ampli scaling */ + uint16_t :1; /*!< bit: 7 Reserved */ + uint16_t BIASREFBUF:3; /*!< bit: 8..10 Bias Reference Buffer Scaling */ + uint16_t :5; /*!< bit: 11..15 Reserved */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} ADC_CALIB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define ADC_CALIB_OFFSET 0x48 /**< \brief (ADC_CALIB offset) Calibration */ +#define ADC_CALIB_RESETVALUE _U_(0x0000) /**< \brief (ADC_CALIB reset_value) Calibration */ + +#define ADC_CALIB_BIASCOMP_Pos 0 /**< \brief (ADC_CALIB) Bias Comparator Scaling */ +#define ADC_CALIB_BIASCOMP_Msk (_U_(0x7) << ADC_CALIB_BIASCOMP_Pos) +#define ADC_CALIB_BIASCOMP(value) (ADC_CALIB_BIASCOMP_Msk & ((value) << ADC_CALIB_BIASCOMP_Pos)) +#define ADC_CALIB_BIASR2R_Pos 4 /**< \brief (ADC_CALIB) Bias R2R Ampli scaling */ +#define ADC_CALIB_BIASR2R_Msk (_U_(0x7) << ADC_CALIB_BIASR2R_Pos) +#define ADC_CALIB_BIASR2R(value) (ADC_CALIB_BIASR2R_Msk & ((value) << ADC_CALIB_BIASR2R_Pos)) +#define ADC_CALIB_BIASREFBUF_Pos 8 /**< \brief (ADC_CALIB) Bias Reference Buffer Scaling */ +#define ADC_CALIB_BIASREFBUF_Msk (_U_(0x7) << ADC_CALIB_BIASREFBUF_Pos) +#define ADC_CALIB_BIASREFBUF(value) (ADC_CALIB_BIASREFBUF_Msk & ((value) << ADC_CALIB_BIASREFBUF_Pos)) +#define ADC_CALIB_MASK _U_(0x0777) /**< \brief (ADC_CALIB) MASK Register */ + +/** \brief ADC hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO ADC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 16) Control A */ + __IO ADC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x02 (R/W 8) Event Control */ + __IO ADC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x03 (R/W 8) Debug Control */ + __IO ADC_INPUTCTRL_Type INPUTCTRL; /**< \brief Offset: 0x04 (R/W 16) Input Control */ + __IO ADC_CTRLB_Type CTRLB; /**< \brief Offset: 0x06 (R/W 16) Control B */ + __IO ADC_REFCTRL_Type REFCTRL; /**< \brief Offset: 0x08 (R/W 8) Reference Control */ + RoReg8 Reserved1[0x1]; + __IO ADC_AVGCTRL_Type AVGCTRL; /**< \brief Offset: 0x0A (R/W 8) Average Control */ + __IO ADC_SAMPCTRL_Type SAMPCTRL; /**< \brief Offset: 0x0B (R/W 8) Sample Time Control */ + __IO ADC_WINLT_Type WINLT; /**< \brief Offset: 0x0C (R/W 16) Window Monitor Lower Threshold */ + __IO ADC_WINUT_Type WINUT; /**< \brief Offset: 0x0E (R/W 16) Window Monitor Upper Threshold */ + __IO ADC_GAINCORR_Type GAINCORR; /**< \brief Offset: 0x10 (R/W 16) Gain Correction */ + __IO ADC_OFFSETCORR_Type OFFSETCORR; /**< \brief Offset: 0x12 (R/W 16) Offset Correction */ + __IO ADC_SWTRIG_Type SWTRIG; /**< \brief Offset: 0x14 (R/W 8) Software Trigger */ + RoReg8 Reserved2[0x17]; + __IO ADC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x2C (R/W 8) Interrupt Enable Clear */ + __IO ADC_INTENSET_Type INTENSET; /**< \brief Offset: 0x2D (R/W 8) Interrupt Enable Set */ + __IO ADC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x2E (R/W 8) Interrupt Flag Status and Clear */ + __I ADC_STATUS_Type STATUS; /**< \brief Offset: 0x2F (R/ 8) Status */ + __I ADC_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x30 (R/ 32) Synchronization Busy */ + __O ADC_DSEQDATA_Type DSEQDATA; /**< \brief Offset: 0x34 ( /W 32) DMA Sequencial Data */ + __IO ADC_DSEQCTRL_Type DSEQCTRL; /**< \brief Offset: 0x38 (R/W 32) DMA Sequential Control */ + __I ADC_DSEQSTAT_Type DSEQSTAT; /**< \brief Offset: 0x3C (R/ 32) DMA Sequencial Status */ + __I ADC_RESULT_Type RESULT; /**< \brief Offset: 0x40 (R/ 16) Result Conversion Value */ + RoReg8 Reserved3[0x2]; + __I ADC_RESS_Type RESS; /**< \brief Offset: 0x44 (R/ 16) Last Sample Result */ + RoReg8 Reserved4[0x2]; + __IO ADC_CALIB_Type CALIB; /**< \brief Offset: 0x48 (R/W 16) Calibration */ +} Adc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_ADC_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/aes.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/aes.h new file mode 100644 index 0000000000..5a74eac28b --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/aes.h @@ -0,0 +1,375 @@ +/** + * \file + * + * \brief Component description for AES + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_AES_COMPONENT_ +#define _SAMD51_AES_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR AES */ +/* ========================================================================== */ +/** \addtogroup SAMD51_AES Advanced Encryption Standard */ +/*@{*/ + +#define AES_U2238 +#define REV_AES 0x220 + +/* -------- AES_CTRLA : (AES Offset: 0x00) (R/W 32) Control A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 Software Reset */ + uint32_t ENABLE:1; /*!< bit: 1 Enable */ + uint32_t AESMODE:3; /*!< bit: 2.. 4 AES Modes of operation */ + uint32_t CFBS:3; /*!< bit: 5.. 7 Cipher Feedback Block Size */ + uint32_t KEYSIZE:2; /*!< bit: 8.. 9 Encryption Key Size */ + uint32_t CIPHER:1; /*!< bit: 10 Cipher Mode */ + uint32_t STARTMODE:1; /*!< bit: 11 Start Mode Select */ + uint32_t LOD:1; /*!< bit: 12 Last Output Data Mode */ + uint32_t KEYGEN:1; /*!< bit: 13 Last Key Generation */ + uint32_t XORKEY:1; /*!< bit: 14 XOR Key Operation */ + uint32_t :1; /*!< bit: 15 Reserved */ + uint32_t CTYPE:4; /*!< bit: 16..19 Counter Measure Type */ + uint32_t :12; /*!< bit: 20..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} AES_CTRLA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_CTRLA_OFFSET 0x00 /**< \brief (AES_CTRLA offset) Control A */ +#define AES_CTRLA_RESETVALUE _U_(0x00000000) /**< \brief (AES_CTRLA reset_value) Control A */ + +#define AES_CTRLA_SWRST_Pos 0 /**< \brief (AES_CTRLA) Software Reset */ +#define AES_CTRLA_SWRST (_U_(0x1) << AES_CTRLA_SWRST_Pos) +#define AES_CTRLA_ENABLE_Pos 1 /**< \brief (AES_CTRLA) Enable */ +#define AES_CTRLA_ENABLE (_U_(0x1) << AES_CTRLA_ENABLE_Pos) +#define AES_CTRLA_AESMODE_Pos 2 /**< \brief (AES_CTRLA) AES Modes of operation */ +#define AES_CTRLA_AESMODE_Msk (_U_(0x7) << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE(value) (AES_CTRLA_AESMODE_Msk & ((value) << AES_CTRLA_AESMODE_Pos)) +#define AES_CTRLA_AESMODE_ECB_Val _U_(0x0) /**< \brief (AES_CTRLA) Electronic code book mode */ +#define AES_CTRLA_AESMODE_CBC_Val _U_(0x1) /**< \brief (AES_CTRLA) Cipher block chaining mode */ +#define AES_CTRLA_AESMODE_OFB_Val _U_(0x2) /**< \brief (AES_CTRLA) Output feedback mode */ +#define AES_CTRLA_AESMODE_CFB_Val _U_(0x3) /**< \brief (AES_CTRLA) Cipher feedback mode */ +#define AES_CTRLA_AESMODE_COUNTER_Val _U_(0x4) /**< \brief (AES_CTRLA) Counter mode */ +#define AES_CTRLA_AESMODE_CCM_Val _U_(0x5) /**< \brief (AES_CTRLA) CCM mode */ +#define AES_CTRLA_AESMODE_GCM_Val _U_(0x6) /**< \brief (AES_CTRLA) Galois counter mode */ +#define AES_CTRLA_AESMODE_ECB (AES_CTRLA_AESMODE_ECB_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_CBC (AES_CTRLA_AESMODE_CBC_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_OFB (AES_CTRLA_AESMODE_OFB_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_CFB (AES_CTRLA_AESMODE_CFB_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_COUNTER (AES_CTRLA_AESMODE_COUNTER_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_CCM (AES_CTRLA_AESMODE_CCM_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_AESMODE_GCM (AES_CTRLA_AESMODE_GCM_Val << AES_CTRLA_AESMODE_Pos) +#define AES_CTRLA_CFBS_Pos 5 /**< \brief (AES_CTRLA) Cipher Feedback Block Size */ +#define AES_CTRLA_CFBS_Msk (_U_(0x7) << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_CFBS(value) (AES_CTRLA_CFBS_Msk & ((value) << AES_CTRLA_CFBS_Pos)) +#define AES_CTRLA_CFBS_128BIT_Val _U_(0x0) /**< \brief (AES_CTRLA) 128-bit Input data block for Encryption/Decryption in Cipher Feedback mode */ +#define AES_CTRLA_CFBS_64BIT_Val _U_(0x1) /**< \brief (AES_CTRLA) 64-bit Input data block for Encryption/Decryption in Cipher Feedback mode */ +#define AES_CTRLA_CFBS_32BIT_Val _U_(0x2) /**< \brief (AES_CTRLA) 32-bit Input data block for Encryption/Decryption in Cipher Feedback mode */ +#define AES_CTRLA_CFBS_16BIT_Val _U_(0x3) /**< \brief (AES_CTRLA) 16-bit Input data block for Encryption/Decryption in Cipher Feedback mode */ +#define AES_CTRLA_CFBS_8BIT_Val _U_(0x4) /**< \brief (AES_CTRLA) 8-bit Input data block for Encryption/Decryption in Cipher Feedback mode */ +#define AES_CTRLA_CFBS_128BIT (AES_CTRLA_CFBS_128BIT_Val << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_CFBS_64BIT (AES_CTRLA_CFBS_64BIT_Val << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_CFBS_32BIT (AES_CTRLA_CFBS_32BIT_Val << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_CFBS_16BIT (AES_CTRLA_CFBS_16BIT_Val << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_CFBS_8BIT (AES_CTRLA_CFBS_8BIT_Val << AES_CTRLA_CFBS_Pos) +#define AES_CTRLA_KEYSIZE_Pos 8 /**< \brief (AES_CTRLA) Encryption Key Size */ +#define AES_CTRLA_KEYSIZE_Msk (_U_(0x3) << AES_CTRLA_KEYSIZE_Pos) +#define AES_CTRLA_KEYSIZE(value) (AES_CTRLA_KEYSIZE_Msk & ((value) << AES_CTRLA_KEYSIZE_Pos)) +#define AES_CTRLA_KEYSIZE_128BIT_Val _U_(0x0) /**< \brief (AES_CTRLA) 128-bit Key for Encryption / Decryption */ +#define AES_CTRLA_KEYSIZE_192BIT_Val _U_(0x1) /**< \brief (AES_CTRLA) 192-bit Key for Encryption / Decryption */ +#define AES_CTRLA_KEYSIZE_256BIT_Val _U_(0x2) /**< \brief (AES_CTRLA) 256-bit Key for Encryption / Decryption */ +#define AES_CTRLA_KEYSIZE_128BIT (AES_CTRLA_KEYSIZE_128BIT_Val << AES_CTRLA_KEYSIZE_Pos) +#define AES_CTRLA_KEYSIZE_192BIT (AES_CTRLA_KEYSIZE_192BIT_Val << AES_CTRLA_KEYSIZE_Pos) +#define AES_CTRLA_KEYSIZE_256BIT (AES_CTRLA_KEYSIZE_256BIT_Val << AES_CTRLA_KEYSIZE_Pos) +#define AES_CTRLA_CIPHER_Pos 10 /**< \brief (AES_CTRLA) Cipher Mode */ +#define AES_CTRLA_CIPHER (_U_(0x1) << AES_CTRLA_CIPHER_Pos) +#define AES_CTRLA_CIPHER_DEC_Val _U_(0x0) /**< \brief (AES_CTRLA) Decryption */ +#define AES_CTRLA_CIPHER_ENC_Val _U_(0x1) /**< \brief (AES_CTRLA) Encryption */ +#define AES_CTRLA_CIPHER_DEC (AES_CTRLA_CIPHER_DEC_Val << AES_CTRLA_CIPHER_Pos) +#define AES_CTRLA_CIPHER_ENC (AES_CTRLA_CIPHER_ENC_Val << AES_CTRLA_CIPHER_Pos) +#define AES_CTRLA_STARTMODE_Pos 11 /**< \brief (AES_CTRLA) Start Mode Select */ +#define AES_CTRLA_STARTMODE (_U_(0x1) << AES_CTRLA_STARTMODE_Pos) +#define AES_CTRLA_STARTMODE_MANUAL_Val _U_(0x0) /**< \brief (AES_CTRLA) Start Encryption / Decryption in Manual mode */ +#define AES_CTRLA_STARTMODE_AUTO_Val _U_(0x1) /**< \brief (AES_CTRLA) Start Encryption / Decryption in Auto mode */ +#define AES_CTRLA_STARTMODE_MANUAL (AES_CTRLA_STARTMODE_MANUAL_Val << AES_CTRLA_STARTMODE_Pos) +#define AES_CTRLA_STARTMODE_AUTO (AES_CTRLA_STARTMODE_AUTO_Val << AES_CTRLA_STARTMODE_Pos) +#define AES_CTRLA_LOD_Pos 12 /**< \brief (AES_CTRLA) Last Output Data Mode */ +#define AES_CTRLA_LOD (_U_(0x1) << AES_CTRLA_LOD_Pos) +#define AES_CTRLA_LOD_NONE_Val _U_(0x0) /**< \brief (AES_CTRLA) No effect */ +#define AES_CTRLA_LOD_LAST_Val _U_(0x1) /**< \brief (AES_CTRLA) Start encryption in Last Output Data mode */ +#define AES_CTRLA_LOD_NONE (AES_CTRLA_LOD_NONE_Val << AES_CTRLA_LOD_Pos) +#define AES_CTRLA_LOD_LAST (AES_CTRLA_LOD_LAST_Val << AES_CTRLA_LOD_Pos) +#define AES_CTRLA_KEYGEN_Pos 13 /**< \brief (AES_CTRLA) Last Key Generation */ +#define AES_CTRLA_KEYGEN (_U_(0x1) << AES_CTRLA_KEYGEN_Pos) +#define AES_CTRLA_KEYGEN_NONE_Val _U_(0x0) /**< \brief (AES_CTRLA) No effect */ +#define AES_CTRLA_KEYGEN_LAST_Val _U_(0x1) /**< \brief (AES_CTRLA) Start Computation of the last NK words of the expanded key */ +#define AES_CTRLA_KEYGEN_NONE (AES_CTRLA_KEYGEN_NONE_Val << AES_CTRLA_KEYGEN_Pos) +#define AES_CTRLA_KEYGEN_LAST (AES_CTRLA_KEYGEN_LAST_Val << AES_CTRLA_KEYGEN_Pos) +#define AES_CTRLA_XORKEY_Pos 14 /**< \brief (AES_CTRLA) XOR Key Operation */ +#define AES_CTRLA_XORKEY (_U_(0x1) << AES_CTRLA_XORKEY_Pos) +#define AES_CTRLA_XORKEY_NONE_Val _U_(0x0) /**< \brief (AES_CTRLA) No effect */ +#define AES_CTRLA_XORKEY_XOR_Val _U_(0x1) /**< \brief (AES_CTRLA) The user keyword gets XORed with the previous keyword register content. */ +#define AES_CTRLA_XORKEY_NONE (AES_CTRLA_XORKEY_NONE_Val << AES_CTRLA_XORKEY_Pos) +#define AES_CTRLA_XORKEY_XOR (AES_CTRLA_XORKEY_XOR_Val << AES_CTRLA_XORKEY_Pos) +#define AES_CTRLA_CTYPE_Pos 16 /**< \brief (AES_CTRLA) Counter Measure Type */ +#define AES_CTRLA_CTYPE_Msk (_U_(0xF) << AES_CTRLA_CTYPE_Pos) +#define AES_CTRLA_CTYPE(value) (AES_CTRLA_CTYPE_Msk & ((value) << AES_CTRLA_CTYPE_Pos)) +#define AES_CTRLA_MASK _U_(0x000F7FFF) /**< \brief (AES_CTRLA) MASK Register */ + +/* -------- AES_CTRLB : (AES Offset: 0x04) (R/W 8) Control B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t START:1; /*!< bit: 0 Start Encryption/Decryption */ + uint8_t NEWMSG:1; /*!< bit: 1 New message */ + uint8_t EOM:1; /*!< bit: 2 End of message */ + uint8_t GFMUL:1; /*!< bit: 3 GF Multiplication */ + uint8_t :4; /*!< bit: 4.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_CTRLB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_CTRLB_OFFSET 0x04 /**< \brief (AES_CTRLB offset) Control B */ +#define AES_CTRLB_RESETVALUE _U_(0x00) /**< \brief (AES_CTRLB reset_value) Control B */ + +#define AES_CTRLB_START_Pos 0 /**< \brief (AES_CTRLB) Start Encryption/Decryption */ +#define AES_CTRLB_START (_U_(0x1) << AES_CTRLB_START_Pos) +#define AES_CTRLB_NEWMSG_Pos 1 /**< \brief (AES_CTRLB) New message */ +#define AES_CTRLB_NEWMSG (_U_(0x1) << AES_CTRLB_NEWMSG_Pos) +#define AES_CTRLB_EOM_Pos 2 /**< \brief (AES_CTRLB) End of message */ +#define AES_CTRLB_EOM (_U_(0x1) << AES_CTRLB_EOM_Pos) +#define AES_CTRLB_GFMUL_Pos 3 /**< \brief (AES_CTRLB) GF Multiplication */ +#define AES_CTRLB_GFMUL (_U_(0x1) << AES_CTRLB_GFMUL_Pos) +#define AES_CTRLB_MASK _U_(0x0F) /**< \brief (AES_CTRLB) MASK Register */ + +/* -------- AES_INTENCLR : (AES Offset: 0x05) (R/W 8) Interrupt Enable Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t ENCCMP:1; /*!< bit: 0 Encryption Complete Interrupt Enable */ + uint8_t GFMCMP:1; /*!< bit: 1 GF Multiplication Complete Interrupt Enable */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_INTENCLR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_INTENCLR_OFFSET 0x05 /**< \brief (AES_INTENCLR offset) Interrupt Enable Clear */ +#define AES_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (AES_INTENCLR reset_value) Interrupt Enable Clear */ + +#define AES_INTENCLR_ENCCMP_Pos 0 /**< \brief (AES_INTENCLR) Encryption Complete Interrupt Enable */ +#define AES_INTENCLR_ENCCMP (_U_(0x1) << AES_INTENCLR_ENCCMP_Pos) +#define AES_INTENCLR_GFMCMP_Pos 1 /**< \brief (AES_INTENCLR) GF Multiplication Complete Interrupt Enable */ +#define AES_INTENCLR_GFMCMP (_U_(0x1) << AES_INTENCLR_GFMCMP_Pos) +#define AES_INTENCLR_MASK _U_(0x03) /**< \brief (AES_INTENCLR) MASK Register */ + +/* -------- AES_INTENSET : (AES Offset: 0x06) (R/W 8) Interrupt Enable Set -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t ENCCMP:1; /*!< bit: 0 Encryption Complete Interrupt Enable */ + uint8_t GFMCMP:1; /*!< bit: 1 GF Multiplication Complete Interrupt Enable */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_INTENSET_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_INTENSET_OFFSET 0x06 /**< \brief (AES_INTENSET offset) Interrupt Enable Set */ +#define AES_INTENSET_RESETVALUE _U_(0x00) /**< \brief (AES_INTENSET reset_value) Interrupt Enable Set */ + +#define AES_INTENSET_ENCCMP_Pos 0 /**< \brief (AES_INTENSET) Encryption Complete Interrupt Enable */ +#define AES_INTENSET_ENCCMP (_U_(0x1) << AES_INTENSET_ENCCMP_Pos) +#define AES_INTENSET_GFMCMP_Pos 1 /**< \brief (AES_INTENSET) GF Multiplication Complete Interrupt Enable */ +#define AES_INTENSET_GFMCMP (_U_(0x1) << AES_INTENSET_GFMCMP_Pos) +#define AES_INTENSET_MASK _U_(0x03) /**< \brief (AES_INTENSET) MASK Register */ + +/* -------- AES_INTFLAG : (AES Offset: 0x07) (R/W 8) Interrupt Flag Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { // __I to avoid read-modify-write on write-to-clear register + struct { + __I uint8_t ENCCMP:1; /*!< bit: 0 Encryption Complete */ + __I uint8_t GFMCMP:1; /*!< bit: 1 GF Multiplication Complete */ + __I uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_INTFLAG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_INTFLAG_OFFSET 0x07 /**< \brief (AES_INTFLAG offset) Interrupt Flag Status */ +#define AES_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (AES_INTFLAG reset_value) Interrupt Flag Status */ + +#define AES_INTFLAG_ENCCMP_Pos 0 /**< \brief (AES_INTFLAG) Encryption Complete */ +#define AES_INTFLAG_ENCCMP (_U_(0x1) << AES_INTFLAG_ENCCMP_Pos) +#define AES_INTFLAG_GFMCMP_Pos 1 /**< \brief (AES_INTFLAG) GF Multiplication Complete */ +#define AES_INTFLAG_GFMCMP (_U_(0x1) << AES_INTFLAG_GFMCMP_Pos) +#define AES_INTFLAG_MASK _U_(0x03) /**< \brief (AES_INTFLAG) MASK Register */ + +/* -------- AES_DATABUFPTR : (AES Offset: 0x08) (R/W 8) Data buffer pointer -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t INDATAPTR:2; /*!< bit: 0.. 1 Input Data Pointer */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_DATABUFPTR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_DATABUFPTR_OFFSET 0x08 /**< \brief (AES_DATABUFPTR offset) Data buffer pointer */ +#define AES_DATABUFPTR_RESETVALUE _U_(0x00) /**< \brief (AES_DATABUFPTR reset_value) Data buffer pointer */ + +#define AES_DATABUFPTR_INDATAPTR_Pos 0 /**< \brief (AES_DATABUFPTR) Input Data Pointer */ +#define AES_DATABUFPTR_INDATAPTR_Msk (_U_(0x3) << AES_DATABUFPTR_INDATAPTR_Pos) +#define AES_DATABUFPTR_INDATAPTR(value) (AES_DATABUFPTR_INDATAPTR_Msk & ((value) << AES_DATABUFPTR_INDATAPTR_Pos)) +#define AES_DATABUFPTR_MASK _U_(0x03) /**< \brief (AES_DATABUFPTR) MASK Register */ + +/* -------- AES_DBGCTRL : (AES Offset: 0x09) (R/W 8) Debug control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DBGRUN:1; /*!< bit: 0 Debug Run */ + uint8_t :7; /*!< bit: 1.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} AES_DBGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_DBGCTRL_OFFSET 0x09 /**< \brief (AES_DBGCTRL offset) Debug control */ +#define AES_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (AES_DBGCTRL reset_value) Debug control */ + +#define AES_DBGCTRL_DBGRUN_Pos 0 /**< \brief (AES_DBGCTRL) Debug Run */ +#define AES_DBGCTRL_DBGRUN (_U_(0x1) << AES_DBGCTRL_DBGRUN_Pos) +#define AES_DBGCTRL_MASK _U_(0x01) /**< \brief (AES_DBGCTRL) MASK Register */ + +/* -------- AES_KEYWORD : (AES Offset: 0x0C) ( /W 32) Keyword n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_KEYWORD_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_KEYWORD_OFFSET 0x0C /**< \brief (AES_KEYWORD offset) Keyword n */ +#define AES_KEYWORD_RESETVALUE _U_(0x00000000) /**< \brief (AES_KEYWORD reset_value) Keyword n */ +#define AES_KEYWORD_MASK _U_(0xFFFFFFFF) /**< \brief (AES_KEYWORD) MASK Register */ + +/* -------- AES_INDATA : (AES Offset: 0x38) (R/W 32) Indata -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_INDATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_INDATA_OFFSET 0x38 /**< \brief (AES_INDATA offset) Indata */ +#define AES_INDATA_RESETVALUE _U_(0x00000000) /**< \brief (AES_INDATA reset_value) Indata */ +#define AES_INDATA_MASK _U_(0xFFFFFFFF) /**< \brief (AES_INDATA) MASK Register */ + +/* -------- AES_INTVECTV : (AES Offset: 0x3C) ( /W 32) Initialisation Vector n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_INTVECTV_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_INTVECTV_OFFSET 0x3C /**< \brief (AES_INTVECTV offset) Initialisation Vector n */ +#define AES_INTVECTV_RESETVALUE _U_(0x00000000) /**< \brief (AES_INTVECTV reset_value) Initialisation Vector n */ +#define AES_INTVECTV_MASK _U_(0xFFFFFFFF) /**< \brief (AES_INTVECTV) MASK Register */ + +/* -------- AES_HASHKEY : (AES Offset: 0x5C) (R/W 32) Hash key n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_HASHKEY_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_HASHKEY_OFFSET 0x5C /**< \brief (AES_HASHKEY offset) Hash key n */ +#define AES_HASHKEY_RESETVALUE _U_(0x00000000) /**< \brief (AES_HASHKEY reset_value) Hash key n */ +#define AES_HASHKEY_MASK _U_(0xFFFFFFFF) /**< \brief (AES_HASHKEY) MASK Register */ + +/* -------- AES_GHASH : (AES Offset: 0x6C) (R/W 32) Galois Hash n -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_GHASH_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_GHASH_OFFSET 0x6C /**< \brief (AES_GHASH offset) Galois Hash n */ +#define AES_GHASH_RESETVALUE _U_(0x00000000) /**< \brief (AES_GHASH reset_value) Galois Hash n */ +#define AES_GHASH_MASK _U_(0xFFFFFFFF) /**< \brief (AES_GHASH) MASK Register */ + +/* -------- AES_CIPLEN : (AES Offset: 0x80) (R/W 32) Cipher Length -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_CIPLEN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_CIPLEN_OFFSET 0x80 /**< \brief (AES_CIPLEN offset) Cipher Length */ +#define AES_CIPLEN_RESETVALUE _U_(0x00000000) /**< \brief (AES_CIPLEN reset_value) Cipher Length */ +#define AES_CIPLEN_MASK _U_(0xFFFFFFFF) /**< \brief (AES_CIPLEN) MASK Register */ + +/* -------- AES_RANDSEED : (AES Offset: 0x84) (R/W 32) Random Seed -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + uint32_t reg; /*!< Type used for register access */ +} AES_RANDSEED_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define AES_RANDSEED_OFFSET 0x84 /**< \brief (AES_RANDSEED offset) Random Seed */ +#define AES_RANDSEED_RESETVALUE _U_(0x00000000) /**< \brief (AES_RANDSEED reset_value) Random Seed */ +#define AES_RANDSEED_MASK _U_(0xFFFFFFFF) /**< \brief (AES_RANDSEED) MASK Register */ + +/** \brief AES hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO AES_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 32) Control A */ + __IO AES_CTRLB_Type CTRLB; /**< \brief Offset: 0x04 (R/W 8) Control B */ + __IO AES_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x05 (R/W 8) Interrupt Enable Clear */ + __IO AES_INTENSET_Type INTENSET; /**< \brief Offset: 0x06 (R/W 8) Interrupt Enable Set */ + __IO AES_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x07 (R/W 8) Interrupt Flag Status */ + __IO AES_DATABUFPTR_Type DATABUFPTR; /**< \brief Offset: 0x08 (R/W 8) Data buffer pointer */ + __IO AES_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x09 (R/W 8) Debug control */ + RoReg8 Reserved1[0x2]; + __O AES_KEYWORD_Type KEYWORD[8]; /**< \brief Offset: 0x0C ( /W 32) Keyword n */ + RoReg8 Reserved2[0xC]; + __IO AES_INDATA_Type INDATA; /**< \brief Offset: 0x38 (R/W 32) Indata */ + __O AES_INTVECTV_Type INTVECTV[4]; /**< \brief Offset: 0x3C ( /W 32) Initialisation Vector n */ + RoReg8 Reserved3[0x10]; + __IO AES_HASHKEY_Type HASHKEY[4]; /**< \brief Offset: 0x5C (R/W 32) Hash key n */ + __IO AES_GHASH_Type GHASH[4]; /**< \brief Offset: 0x6C (R/W 32) Galois Hash n */ + RoReg8 Reserved4[0x4]; + __IO AES_CIPLEN_Type CIPLEN; /**< \brief Offset: 0x80 (R/W 32) Cipher Length */ + __IO AES_RANDSEED_Type RANDSEED; /**< \brief Offset: 0x84 (R/W 32) Random Seed */ +} Aes; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_AES_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/can.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/can.h new file mode 100644 index 0000000000..9d6754998c --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/can.h @@ -0,0 +1,3207 @@ +/** + * \file + * + * \brief Component description for CAN + * + * Copyright (c) 2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_CAN_COMPONENT_ +#define _SAMD51_CAN_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR CAN */ +/* ========================================================================== */ +/** \addtogroup SAMD51_CAN Control Area Network */ +/*@{*/ + +#define CAN_U2003 +#define REV_CAN 0x321 + +/* -------- CAN_CREL : (CAN Offset: 0x00) (R/ 32) Core Release -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :20; /*!< bit: 0..19 Reserved */ + uint32_t SUBSTEP:4; /*!< bit: 20..23 Sub-step of Core Release */ + uint32_t STEP:4; /*!< bit: 24..27 Step of Core Release */ + uint32_t REL:4; /*!< bit: 28..31 Core Release */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_CREL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_CREL_OFFSET 0x00 /**< \brief (CAN_CREL offset) Core Release */ +#define CAN_CREL_RESETVALUE 0x32100000u /**< \brief (CAN_CREL reset_value) Core Release */ + +#define CAN_CREL_SUBSTEP_Pos 20 /**< \brief (CAN_CREL) Sub-step of Core Release */ +#define CAN_CREL_SUBSTEP_Msk (0xFu << CAN_CREL_SUBSTEP_Pos) +#define CAN_CREL_SUBSTEP(value) (CAN_CREL_SUBSTEP_Msk & ((value) << CAN_CREL_SUBSTEP_Pos)) +#define CAN_CREL_STEP_Pos 24 /**< \brief (CAN_CREL) Step of Core Release */ +#define CAN_CREL_STEP_Msk (0xFu << CAN_CREL_STEP_Pos) +#define CAN_CREL_STEP(value) (CAN_CREL_STEP_Msk & ((value) << CAN_CREL_STEP_Pos)) +#define CAN_CREL_REL_Pos 28 /**< \brief (CAN_CREL) Core Release */ +#define CAN_CREL_REL_Msk (0xFu << CAN_CREL_REL_Pos) +#define CAN_CREL_REL(value) (CAN_CREL_REL_Msk & ((value) << CAN_CREL_REL_Pos)) +#define CAN_CREL_MASK 0xFFF00000u /**< \brief (CAN_CREL) MASK Register */ + +/* -------- CAN_ENDN : (CAN Offset: 0x04) (R/ 32) Endian -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ETV:32; /*!< bit: 0..31 Endianness Test Value */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_ENDN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_ENDN_OFFSET 0x04 /**< \brief (CAN_ENDN offset) Endian */ +#define CAN_ENDN_RESETVALUE 0x87654321u /**< \brief (CAN_ENDN reset_value) Endian */ + +#define CAN_ENDN_ETV_Pos 0 /**< \brief (CAN_ENDN) Endianness Test Value */ +#define CAN_ENDN_ETV_Msk (0xFFFFFFFFu << CAN_ENDN_ETV_Pos) +#define CAN_ENDN_ETV(value) (CAN_ENDN_ETV_Msk & ((value) << CAN_ENDN_ETV_Pos)) +#define CAN_ENDN_MASK 0xFFFFFFFFu /**< \brief (CAN_ENDN) MASK Register */ + +/* -------- CAN_MRCFG : (CAN Offset: 0x08) (R/W 32) Message RAM Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t QOS:2; /*!< bit: 0.. 1 Quality of Service */ + uint32_t :30; /*!< bit: 2..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_MRCFG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_MRCFG_OFFSET 0x08 /**< \brief (CAN_MRCFG offset) Message RAM Configuration */ +#define CAN_MRCFG_RESETVALUE 0x00000002u /**< \brief (CAN_MRCFG reset_value) Message RAM Configuration */ + +#define CAN_MRCFG_QOS_Pos 0 /**< \brief (CAN_MRCFG) Quality of Service */ +#define CAN_MRCFG_QOS_Msk (0x3u << CAN_MRCFG_QOS_Pos) +#define CAN_MRCFG_QOS(value) (CAN_MRCFG_QOS_Msk & ((value) << CAN_MRCFG_QOS_Pos)) +#define CAN_MRCFG_QOS_DISABLE_Val 0x0u /**< \brief (CAN_MRCFG) Background (no sensitive operation) */ +#define CAN_MRCFG_QOS_LOW_Val 0x1u /**< \brief (CAN_MRCFG) Sensitive Bandwidth */ +#define CAN_MRCFG_QOS_MEDIUM_Val 0x2u /**< \brief (CAN_MRCFG) Sensitive Latency */ +#define CAN_MRCFG_QOS_HIGH_Val 0x3u /**< \brief (CAN_MRCFG) Critical Latency */ +#define CAN_MRCFG_QOS_DISABLE (CAN_MRCFG_QOS_DISABLE_Val << CAN_MRCFG_QOS_Pos) +#define CAN_MRCFG_QOS_LOW (CAN_MRCFG_QOS_LOW_Val << CAN_MRCFG_QOS_Pos) +#define CAN_MRCFG_QOS_MEDIUM (CAN_MRCFG_QOS_MEDIUM_Val << CAN_MRCFG_QOS_Pos) +#define CAN_MRCFG_QOS_HIGH (CAN_MRCFG_QOS_HIGH_Val << CAN_MRCFG_QOS_Pos) +#define CAN_MRCFG_MASK 0x00000003u /**< \brief (CAN_MRCFG) MASK Register */ + +/* -------- CAN_DBTP : (CAN Offset: 0x0C) (R/W 32) Fast Bit Timing and Prescaler -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DSJW:4; /*!< bit: 0.. 3 Data (Re)Synchronization Jump Width */ + uint32_t DTSEG2:4; /*!< bit: 4.. 7 Data time segment after sample point */ + uint32_t DTSEG1:5; /*!< bit: 8..12 Data time segment before sample point */ + uint32_t :3; /*!< bit: 13..15 Reserved */ + uint32_t DBRP:5; /*!< bit: 16..20 Data Baud Rate Prescaler */ + uint32_t :2; /*!< bit: 21..22 Reserved */ + uint32_t TDC:1; /*!< bit: 23 Tranceiver Delay Compensation */ + uint32_t :8; /*!< bit: 24..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_DBTP_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_DBTP_OFFSET 0x0C /**< \brief (CAN_DBTP offset) Fast Bit Timing and Prescaler */ +#define CAN_DBTP_RESETVALUE 0x00000A33u /**< \brief (CAN_DBTP reset_value) Fast Bit Timing and Prescaler */ + +#define CAN_DBTP_DSJW_Pos 0 /**< \brief (CAN_DBTP) Data (Re)Synchronization Jump Width */ +#define CAN_DBTP_DSJW_Msk (0xFu << CAN_DBTP_DSJW_Pos) +#define CAN_DBTP_DSJW(value) (CAN_DBTP_DSJW_Msk & ((value) << CAN_DBTP_DSJW_Pos)) +#define CAN_DBTP_DTSEG2_Pos 4 /**< \brief (CAN_DBTP) Data time segment after sample point */ +#define CAN_DBTP_DTSEG2_Msk (0xFu << CAN_DBTP_DTSEG2_Pos) +#define CAN_DBTP_DTSEG2(value) (CAN_DBTP_DTSEG2_Msk & ((value) << CAN_DBTP_DTSEG2_Pos)) +#define CAN_DBTP_DTSEG1_Pos 8 /**< \brief (CAN_DBTP) Data time segment before sample point */ +#define CAN_DBTP_DTSEG1_Msk (0x1Fu << CAN_DBTP_DTSEG1_Pos) +#define CAN_DBTP_DTSEG1(value) (CAN_DBTP_DTSEG1_Msk & ((value) << CAN_DBTP_DTSEG1_Pos)) +#define CAN_DBTP_DBRP_Pos 16 /**< \brief (CAN_DBTP) Data Baud Rate Prescaler */ +#define CAN_DBTP_DBRP_Msk (0x1Fu << CAN_DBTP_DBRP_Pos) +#define CAN_DBTP_DBRP(value) (CAN_DBTP_DBRP_Msk & ((value) << CAN_DBTP_DBRP_Pos)) +#define CAN_DBTP_TDC_Pos 23 /**< \brief (CAN_DBTP) Tranceiver Delay Compensation */ +#define CAN_DBTP_TDC (0x1u << CAN_DBTP_TDC_Pos) +#define CAN_DBTP_MASK 0x009F1FFFu /**< \brief (CAN_DBTP) MASK Register */ + +/* -------- CAN_TEST : (CAN Offset: 0x10) (R/W 32) Test -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :4; /*!< bit: 0.. 3 Reserved */ + uint32_t LBCK:1; /*!< bit: 4 Loop Back Mode */ + uint32_t TX:2; /*!< bit: 5.. 6 Control of Transmit Pin */ + uint32_t RX:1; /*!< bit: 7 Receive Pin */ + uint32_t :24; /*!< bit: 8..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TEST_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TEST_OFFSET 0x10 /**< \brief (CAN_TEST offset) Test */ +#define CAN_TEST_RESETVALUE 0x00000000u /**< \brief (CAN_TEST reset_value) Test */ + +#define CAN_TEST_LBCK_Pos 4 /**< \brief (CAN_TEST) Loop Back Mode */ +#define CAN_TEST_LBCK (0x1u << CAN_TEST_LBCK_Pos) +#define CAN_TEST_TX_Pos 5 /**< \brief (CAN_TEST) Control of Transmit Pin */ +#define CAN_TEST_TX_Msk (0x3u << CAN_TEST_TX_Pos) +#define CAN_TEST_TX(value) (CAN_TEST_TX_Msk & ((value) << CAN_TEST_TX_Pos)) +#define CAN_TEST_TX_CORE_Val 0x0u /**< \brief (CAN_TEST) TX controlled by CAN core */ +#define CAN_TEST_TX_SAMPLE_Val 0x1u /**< \brief (CAN_TEST) TX monitoring sample point */ +#define CAN_TEST_TX_DOMINANT_Val 0x2u /**< \brief (CAN_TEST) Dominant (0) level at pin CAN_TX */ +#define CAN_TEST_TX_RECESSIVE_Val 0x3u /**< \brief (CAN_TEST) Recessive (1) level at pin CAN_TX */ +#define CAN_TEST_TX_CORE (CAN_TEST_TX_CORE_Val << CAN_TEST_TX_Pos) +#define CAN_TEST_TX_SAMPLE (CAN_TEST_TX_SAMPLE_Val << CAN_TEST_TX_Pos) +#define CAN_TEST_TX_DOMINANT (CAN_TEST_TX_DOMINANT_Val << CAN_TEST_TX_Pos) +#define CAN_TEST_TX_RECESSIVE (CAN_TEST_TX_RECESSIVE_Val << CAN_TEST_TX_Pos) +#define CAN_TEST_RX_Pos 7 /**< \brief (CAN_TEST) Receive Pin */ +#define CAN_TEST_RX (0x1u << CAN_TEST_RX_Pos) +#define CAN_TEST_MASK 0x000000F0u /**< \brief (CAN_TEST) MASK Register */ + +/* -------- CAN_RWD : (CAN Offset: 0x14) (R/W 32) RAM Watchdog -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t WDC:8; /*!< bit: 0.. 7 Watchdog Configuration */ + uint32_t WDV:8; /*!< bit: 8..15 Watchdog Value */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RWD_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RWD_OFFSET 0x14 /**< \brief (CAN_RWD offset) RAM Watchdog */ +#define CAN_RWD_RESETVALUE 0x00000000u /**< \brief (CAN_RWD reset_value) RAM Watchdog */ + +#define CAN_RWD_WDC_Pos 0 /**< \brief (CAN_RWD) Watchdog Configuration */ +#define CAN_RWD_WDC_Msk (0xFFu << CAN_RWD_WDC_Pos) +#define CAN_RWD_WDC(value) (CAN_RWD_WDC_Msk & ((value) << CAN_RWD_WDC_Pos)) +#define CAN_RWD_WDV_Pos 8 /**< \brief (CAN_RWD) Watchdog Value */ +#define CAN_RWD_WDV_Msk (0xFFu << CAN_RWD_WDV_Pos) +#define CAN_RWD_WDV(value) (CAN_RWD_WDV_Msk & ((value) << CAN_RWD_WDV_Pos)) +#define CAN_RWD_MASK 0x0000FFFFu /**< \brief (CAN_RWD) MASK Register */ + +/* -------- CAN_CCCR : (CAN Offset: 0x18) (R/W 32) CC Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t INIT:1; /*!< bit: 0 Initialization */ + uint32_t CCE:1; /*!< bit: 1 Configuration Change Enable */ + uint32_t ASM:1; /*!< bit: 2 ASM Restricted Operation Mode */ + uint32_t CSA:1; /*!< bit: 3 Clock Stop Acknowledge */ + uint32_t CSR:1; /*!< bit: 4 Clock Stop Request */ + uint32_t MON:1; /*!< bit: 5 Bus Monitoring Mode */ + uint32_t DAR:1; /*!< bit: 6 Disable Automatic Retransmission */ + uint32_t TEST:1; /*!< bit: 7 Test Mode Enable */ + uint32_t FDOE:1; /*!< bit: 8 FD Operation Enable */ + uint32_t BRSE:1; /*!< bit: 9 Bit Rate Switch Enable */ + uint32_t :2; /*!< bit: 10..11 Reserved */ + uint32_t PXHD:1; /*!< bit: 12 Protocol Exception Handling Disable */ + uint32_t EFBI:1; /*!< bit: 13 Edge Filtering during Bus Integration */ + uint32_t TXP:1; /*!< bit: 14 Transmit Pause */ + uint32_t NISO:1; /*!< bit: 15 Non ISO Operation */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_CCCR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_CCCR_OFFSET 0x18 /**< \brief (CAN_CCCR offset) CC Control */ +#define CAN_CCCR_RESETVALUE 0x00000001u /**< \brief (CAN_CCCR reset_value) CC Control */ + +#define CAN_CCCR_INIT_Pos 0 /**< \brief (CAN_CCCR) Initialization */ +#define CAN_CCCR_INIT (0x1u << CAN_CCCR_INIT_Pos) +#define CAN_CCCR_CCE_Pos 1 /**< \brief (CAN_CCCR) Configuration Change Enable */ +#define CAN_CCCR_CCE (0x1u << CAN_CCCR_CCE_Pos) +#define CAN_CCCR_ASM_Pos 2 /**< \brief (CAN_CCCR) ASM Restricted Operation Mode */ +#define CAN_CCCR_ASM (0x1u << CAN_CCCR_ASM_Pos) +#define CAN_CCCR_CSA_Pos 3 /**< \brief (CAN_CCCR) Clock Stop Acknowledge */ +#define CAN_CCCR_CSA (0x1u << CAN_CCCR_CSA_Pos) +#define CAN_CCCR_CSR_Pos 4 /**< \brief (CAN_CCCR) Clock Stop Request */ +#define CAN_CCCR_CSR (0x1u << CAN_CCCR_CSR_Pos) +#define CAN_CCCR_MON_Pos 5 /**< \brief (CAN_CCCR) Bus Monitoring Mode */ +#define CAN_CCCR_MON (0x1u << CAN_CCCR_MON_Pos) +#define CAN_CCCR_DAR_Pos 6 /**< \brief (CAN_CCCR) Disable Automatic Retransmission */ +#define CAN_CCCR_DAR (0x1u << CAN_CCCR_DAR_Pos) +#define CAN_CCCR_TEST_Pos 7 /**< \brief (CAN_CCCR) Test Mode Enable */ +#define CAN_CCCR_TEST (0x1u << CAN_CCCR_TEST_Pos) +#define CAN_CCCR_FDOE_Pos 8 /**< \brief (CAN_CCCR) FD Operation Enable */ +#define CAN_CCCR_FDOE (0x1u << CAN_CCCR_FDOE_Pos) +#define CAN_CCCR_BRSE_Pos 9 /**< \brief (CAN_CCCR) Bit Rate Switch Enable */ +#define CAN_CCCR_BRSE (0x1u << CAN_CCCR_BRSE_Pos) +#define CAN_CCCR_PXHD_Pos 12 /**< \brief (CAN_CCCR) Protocol Exception Handling Disable */ +#define CAN_CCCR_PXHD (0x1u << CAN_CCCR_PXHD_Pos) +#define CAN_CCCR_EFBI_Pos 13 /**< \brief (CAN_CCCR) Edge Filtering during Bus Integration */ +#define CAN_CCCR_EFBI (0x1u << CAN_CCCR_EFBI_Pos) +#define CAN_CCCR_TXP_Pos 14 /**< \brief (CAN_CCCR) Transmit Pause */ +#define CAN_CCCR_TXP (0x1u << CAN_CCCR_TXP_Pos) +#define CAN_CCCR_NISO_Pos 15 /**< \brief (CAN_CCCR) Non ISO Operation */ +#define CAN_CCCR_NISO (0x1u << CAN_CCCR_NISO_Pos) +#define CAN_CCCR_MASK 0x0000F3FFu /**< \brief (CAN_CCCR) MASK Register */ + +/* -------- CAN_NBTP : (CAN Offset: 0x1C) (R/W 32) Nominal Bit Timing and Prescaler -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t NTSEG2:7; /*!< bit: 0.. 6 Nominal Time segment after sample point */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t NTSEG1:8; /*!< bit: 8..15 Nominal Time segment before sample point */ + uint32_t NBRP:9; /*!< bit: 16..24 Nominal Baud Rate Prescaler */ + uint32_t NSJW:7; /*!< bit: 25..31 Nominal (Re)Synchronization Jump Width */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_NBTP_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_NBTP_OFFSET 0x1C /**< \brief (CAN_NBTP offset) Nominal Bit Timing and Prescaler */ +#define CAN_NBTP_RESETVALUE 0x06000A03u /**< \brief (CAN_NBTP reset_value) Nominal Bit Timing and Prescaler */ + +#define CAN_NBTP_NTSEG2_Pos 0 /**< \brief (CAN_NBTP) Nominal Time segment after sample point */ +#define CAN_NBTP_NTSEG2_Msk (0x7Fu << CAN_NBTP_NTSEG2_Pos) +#define CAN_NBTP_NTSEG2(value) (CAN_NBTP_NTSEG2_Msk & ((value) << CAN_NBTP_NTSEG2_Pos)) +#define CAN_NBTP_NTSEG1_Pos 8 /**< \brief (CAN_NBTP) Nominal Time segment before sample point */ +#define CAN_NBTP_NTSEG1_Msk (0xFFu << CAN_NBTP_NTSEG1_Pos) +#define CAN_NBTP_NTSEG1(value) (CAN_NBTP_NTSEG1_Msk & ((value) << CAN_NBTP_NTSEG1_Pos)) +#define CAN_NBTP_NBRP_Pos 16 /**< \brief (CAN_NBTP) Nominal Baud Rate Prescaler */ +#define CAN_NBTP_NBRP_Msk (0x1FFu << CAN_NBTP_NBRP_Pos) +#define CAN_NBTP_NBRP(value) (CAN_NBTP_NBRP_Msk & ((value) << CAN_NBTP_NBRP_Pos)) +#define CAN_NBTP_NSJW_Pos 25 /**< \brief (CAN_NBTP) Nominal (Re)Synchronization Jump Width */ +#define CAN_NBTP_NSJW_Msk (0x7Fu << CAN_NBTP_NSJW_Pos) +#define CAN_NBTP_NSJW(value) (CAN_NBTP_NSJW_Msk & ((value) << CAN_NBTP_NSJW_Pos)) +#define CAN_NBTP_MASK 0xFFFFFF7Fu /**< \brief (CAN_NBTP) MASK Register */ + +/* -------- CAN_TSCC : (CAN Offset: 0x20) (R/W 32) Timestamp Counter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TSS:2; /*!< bit: 0.. 1 Timestamp Select */ + uint32_t :14; /*!< bit: 2..15 Reserved */ + uint32_t TCP:4; /*!< bit: 16..19 Timestamp Counter Prescaler */ + uint32_t :12; /*!< bit: 20..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TSCC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TSCC_OFFSET 0x20 /**< \brief (CAN_TSCC offset) Timestamp Counter Configuration */ +#define CAN_TSCC_RESETVALUE 0x00000000u /**< \brief (CAN_TSCC reset_value) Timestamp Counter Configuration */ + +#define CAN_TSCC_TSS_Pos 0 /**< \brief (CAN_TSCC) Timestamp Select */ +#define CAN_TSCC_TSS_Msk (0x3u << CAN_TSCC_TSS_Pos) +#define CAN_TSCC_TSS(value) (CAN_TSCC_TSS_Msk & ((value) << CAN_TSCC_TSS_Pos)) +#define CAN_TSCC_TSS_ZERO_Val 0x0u /**< \brief (CAN_TSCC) Timestamp counter value always 0x0000 */ +#define CAN_TSCC_TSS_INC_Val 0x1u /**< \brief (CAN_TSCC) Timestamp counter value incremented by TCP */ +#define CAN_TSCC_TSS_EXT_Val 0x2u /**< \brief (CAN_TSCC) External timestamp counter value used */ +#define CAN_TSCC_TSS_ZERO (CAN_TSCC_TSS_ZERO_Val << CAN_TSCC_TSS_Pos) +#define CAN_TSCC_TSS_INC (CAN_TSCC_TSS_INC_Val << CAN_TSCC_TSS_Pos) +#define CAN_TSCC_TSS_EXT (CAN_TSCC_TSS_EXT_Val << CAN_TSCC_TSS_Pos) +#define CAN_TSCC_TCP_Pos 16 /**< \brief (CAN_TSCC) Timestamp Counter Prescaler */ +#define CAN_TSCC_TCP_Msk (0xFu << CAN_TSCC_TCP_Pos) +#define CAN_TSCC_TCP(value) (CAN_TSCC_TCP_Msk & ((value) << CAN_TSCC_TCP_Pos)) +#define CAN_TSCC_MASK 0x000F0003u /**< \brief (CAN_TSCC) MASK Register */ + +/* -------- CAN_TSCV : (CAN Offset: 0x24) (R/ 32) Timestamp Counter Value -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TSC:16; /*!< bit: 0..15 Timestamp Counter */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TSCV_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TSCV_OFFSET 0x24 /**< \brief (CAN_TSCV offset) Timestamp Counter Value */ +#define CAN_TSCV_RESETVALUE 0x00000000u /**< \brief (CAN_TSCV reset_value) Timestamp Counter Value */ + +#define CAN_TSCV_TSC_Pos 0 /**< \brief (CAN_TSCV) Timestamp Counter */ +#define CAN_TSCV_TSC_Msk (0xFFFFu << CAN_TSCV_TSC_Pos) +#define CAN_TSCV_TSC(value) (CAN_TSCV_TSC_Msk & ((value) << CAN_TSCV_TSC_Pos)) +#define CAN_TSCV_MASK 0x0000FFFFu /**< \brief (CAN_TSCV) MASK Register */ + +/* -------- CAN_TOCC : (CAN Offset: 0x28) (R/W 32) Timeout Counter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ETOC:1; /*!< bit: 0 Enable Timeout Counter */ + uint32_t TOS:2; /*!< bit: 1.. 2 Timeout Select */ + uint32_t :13; /*!< bit: 3..15 Reserved */ + uint32_t TOP:16; /*!< bit: 16..31 Timeout Period */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TOCC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TOCC_OFFSET 0x28 /**< \brief (CAN_TOCC offset) Timeout Counter Configuration */ +#define CAN_TOCC_RESETVALUE 0xFFFF0000u /**< \brief (CAN_TOCC reset_value) Timeout Counter Configuration */ + +#define CAN_TOCC_ETOC_Pos 0 /**< \brief (CAN_TOCC) Enable Timeout Counter */ +#define CAN_TOCC_ETOC (0x1u << CAN_TOCC_ETOC_Pos) +#define CAN_TOCC_TOS_Pos 1 /**< \brief (CAN_TOCC) Timeout Select */ +#define CAN_TOCC_TOS_Msk (0x3u << CAN_TOCC_TOS_Pos) +#define CAN_TOCC_TOS(value) (CAN_TOCC_TOS_Msk & ((value) << CAN_TOCC_TOS_Pos)) +#define CAN_TOCC_TOS_CONT_Val 0x0u /**< \brief (CAN_TOCC) Continuout operation */ +#define CAN_TOCC_TOS_TXEF_Val 0x1u /**< \brief (CAN_TOCC) Timeout controlled by TX Event FIFO */ +#define CAN_TOCC_TOS_RXF0_Val 0x2u /**< \brief (CAN_TOCC) Timeout controlled by Rx FIFO 0 */ +#define CAN_TOCC_TOS_RXF1_Val 0x3u /**< \brief (CAN_TOCC) Timeout controlled by Rx FIFO 1 */ +#define CAN_TOCC_TOS_CONT (CAN_TOCC_TOS_CONT_Val << CAN_TOCC_TOS_Pos) +#define CAN_TOCC_TOS_TXEF (CAN_TOCC_TOS_TXEF_Val << CAN_TOCC_TOS_Pos) +#define CAN_TOCC_TOS_RXF0 (CAN_TOCC_TOS_RXF0_Val << CAN_TOCC_TOS_Pos) +#define CAN_TOCC_TOS_RXF1 (CAN_TOCC_TOS_RXF1_Val << CAN_TOCC_TOS_Pos) +#define CAN_TOCC_TOP_Pos 16 /**< \brief (CAN_TOCC) Timeout Period */ +#define CAN_TOCC_TOP_Msk (0xFFFFu << CAN_TOCC_TOP_Pos) +#define CAN_TOCC_TOP(value) (CAN_TOCC_TOP_Msk & ((value) << CAN_TOCC_TOP_Pos)) +#define CAN_TOCC_MASK 0xFFFF0007u /**< \brief (CAN_TOCC) MASK Register */ + +/* -------- CAN_TOCV : (CAN Offset: 0x2C) (R/W 32) Timeout Counter Value -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TOC:16; /*!< bit: 0..15 Timeout Counter */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TOCV_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TOCV_OFFSET 0x2C /**< \brief (CAN_TOCV offset) Timeout Counter Value */ +#define CAN_TOCV_RESETVALUE 0x0000FFFFu /**< \brief (CAN_TOCV reset_value) Timeout Counter Value */ + +#define CAN_TOCV_TOC_Pos 0 /**< \brief (CAN_TOCV) Timeout Counter */ +#define CAN_TOCV_TOC_Msk (0xFFFFu << CAN_TOCV_TOC_Pos) +#define CAN_TOCV_TOC(value) (CAN_TOCV_TOC_Msk & ((value) << CAN_TOCV_TOC_Pos)) +#define CAN_TOCV_MASK 0x0000FFFFu /**< \brief (CAN_TOCV) MASK Register */ + +/* -------- CAN_ECR : (CAN Offset: 0x40) (R/ 32) Error Counter -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TEC:8; /*!< bit: 0.. 7 Transmit Error Counter */ + uint32_t REC:7; /*!< bit: 8..14 Receive Error Counter */ + uint32_t RP:1; /*!< bit: 15 Receive Error Passive */ + uint32_t CEL:8; /*!< bit: 16..23 CAN Error Logging */ + uint32_t :8; /*!< bit: 24..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_ECR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_ECR_OFFSET 0x40 /**< \brief (CAN_ECR offset) Error Counter */ +#define CAN_ECR_RESETVALUE 0x00000000u /**< \brief (CAN_ECR reset_value) Error Counter */ + +#define CAN_ECR_TEC_Pos 0 /**< \brief (CAN_ECR) Transmit Error Counter */ +#define CAN_ECR_TEC_Msk (0xFFu << CAN_ECR_TEC_Pos) +#define CAN_ECR_TEC(value) (CAN_ECR_TEC_Msk & ((value) << CAN_ECR_TEC_Pos)) +#define CAN_ECR_REC_Pos 8 /**< \brief (CAN_ECR) Receive Error Counter */ +#define CAN_ECR_REC_Msk (0x7Fu << CAN_ECR_REC_Pos) +#define CAN_ECR_REC(value) (CAN_ECR_REC_Msk & ((value) << CAN_ECR_REC_Pos)) +#define CAN_ECR_RP_Pos 15 /**< \brief (CAN_ECR) Receive Error Passive */ +#define CAN_ECR_RP (0x1u << CAN_ECR_RP_Pos) +#define CAN_ECR_CEL_Pos 16 /**< \brief (CAN_ECR) CAN Error Logging */ +#define CAN_ECR_CEL_Msk (0xFFu << CAN_ECR_CEL_Pos) +#define CAN_ECR_CEL(value) (CAN_ECR_CEL_Msk & ((value) << CAN_ECR_CEL_Pos)) +#define CAN_ECR_MASK 0x00FFFFFFu /**< \brief (CAN_ECR) MASK Register */ + +/* -------- CAN_PSR : (CAN Offset: 0x44) (R/ 32) Protocol Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t LEC:3; /*!< bit: 0.. 2 Last Error Code */ + uint32_t ACT:2; /*!< bit: 3.. 4 Activity */ + uint32_t EP:1; /*!< bit: 5 Error Passive */ + uint32_t EW:1; /*!< bit: 6 Warning Status */ + uint32_t BO:1; /*!< bit: 7 Bus_Off Status */ + uint32_t DLEC:3; /*!< bit: 8..10 Data Phase Last Error Code */ + uint32_t RESI:1; /*!< bit: 11 ESI flag of last received CAN FD Message */ + uint32_t RBRS:1; /*!< bit: 12 BRS flag of last received CAN FD Message */ + uint32_t RFDF:1; /*!< bit: 13 Received a CAN FD Message */ + uint32_t PXE:1; /*!< bit: 14 Protocol Exception Event */ + uint32_t :1; /*!< bit: 15 Reserved */ + uint32_t TDCV:7; /*!< bit: 16..22 Transmitter Delay Compensation Value */ + uint32_t :9; /*!< bit: 23..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_PSR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_PSR_OFFSET 0x44 /**< \brief (CAN_PSR offset) Protocol Status */ +#define CAN_PSR_RESETVALUE 0x00000707u /**< \brief (CAN_PSR reset_value) Protocol Status */ + +#define CAN_PSR_LEC_Pos 0 /**< \brief (CAN_PSR) Last Error Code */ +#define CAN_PSR_LEC_Msk (0x7u << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC(value) (CAN_PSR_LEC_Msk & ((value) << CAN_PSR_LEC_Pos)) +#define CAN_PSR_LEC_NONE_Val 0x0u /**< \brief (CAN_PSR) No Error */ +#define CAN_PSR_LEC_STUFF_Val 0x1u /**< \brief (CAN_PSR) Stuff Error */ +#define CAN_PSR_LEC_FORM_Val 0x2u /**< \brief (CAN_PSR) Form Error */ +#define CAN_PSR_LEC_ACK_Val 0x3u /**< \brief (CAN_PSR) Ack Error */ +#define CAN_PSR_LEC_BIT1_Val 0x4u /**< \brief (CAN_PSR) Bit1 Error */ +#define CAN_PSR_LEC_BIT0_Val 0x5u /**< \brief (CAN_PSR) Bit0 Error */ +#define CAN_PSR_LEC_CRC_Val 0x6u /**< \brief (CAN_PSR) CRC Error */ +#define CAN_PSR_LEC_NC_Val 0x7u /**< \brief (CAN_PSR) No Change */ +#define CAN_PSR_LEC_NONE (CAN_PSR_LEC_NONE_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_STUFF (CAN_PSR_LEC_STUFF_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_FORM (CAN_PSR_LEC_FORM_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_ACK (CAN_PSR_LEC_ACK_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_BIT1 (CAN_PSR_LEC_BIT1_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_BIT0 (CAN_PSR_LEC_BIT0_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_CRC (CAN_PSR_LEC_CRC_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_LEC_NC (CAN_PSR_LEC_NC_Val << CAN_PSR_LEC_Pos) +#define CAN_PSR_ACT_Pos 3 /**< \brief (CAN_PSR) Activity */ +#define CAN_PSR_ACT_Msk (0x3u << CAN_PSR_ACT_Pos) +#define CAN_PSR_ACT(value) (CAN_PSR_ACT_Msk & ((value) << CAN_PSR_ACT_Pos)) +#define CAN_PSR_ACT_SYNC_Val 0x0u /**< \brief (CAN_PSR) Node is synchronizing on CAN communication */ +#define CAN_PSR_ACT_IDLE_Val 0x1u /**< \brief (CAN_PSR) Node is neither receiver nor transmitter */ +#define CAN_PSR_ACT_RX_Val 0x2u /**< \brief (CAN_PSR) Node is operating as receiver */ +#define CAN_PSR_ACT_TX_Val 0x3u /**< \brief (CAN_PSR) Node is operating as transmitter */ +#define CAN_PSR_ACT_SYNC (CAN_PSR_ACT_SYNC_Val << CAN_PSR_ACT_Pos) +#define CAN_PSR_ACT_IDLE (CAN_PSR_ACT_IDLE_Val << CAN_PSR_ACT_Pos) +#define CAN_PSR_ACT_RX (CAN_PSR_ACT_RX_Val << CAN_PSR_ACT_Pos) +#define CAN_PSR_ACT_TX (CAN_PSR_ACT_TX_Val << CAN_PSR_ACT_Pos) +#define CAN_PSR_EP_Pos 5 /**< \brief (CAN_PSR) Error Passive */ +#define CAN_PSR_EP (0x1u << CAN_PSR_EP_Pos) +#define CAN_PSR_EW_Pos 6 /**< \brief (CAN_PSR) Warning Status */ +#define CAN_PSR_EW (0x1u << CAN_PSR_EW_Pos) +#define CAN_PSR_BO_Pos 7 /**< \brief (CAN_PSR) Bus_Off Status */ +#define CAN_PSR_BO (0x1u << CAN_PSR_BO_Pos) +#define CAN_PSR_DLEC_Pos 8 /**< \brief (CAN_PSR) Data Phase Last Error Code */ +#define CAN_PSR_DLEC_Msk (0x7u << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC(value) (CAN_PSR_DLEC_Msk & ((value) << CAN_PSR_DLEC_Pos)) +#define CAN_PSR_DLEC_NONE_Val 0x0u /**< \brief (CAN_PSR) No Error */ +#define CAN_PSR_DLEC_STUFF_Val 0x1u /**< \brief (CAN_PSR) Stuff Error */ +#define CAN_PSR_DLEC_FORM_Val 0x2u /**< \brief (CAN_PSR) Form Error */ +#define CAN_PSR_DLEC_ACK_Val 0x3u /**< \brief (CAN_PSR) Ack Error */ +#define CAN_PSR_DLEC_BIT1_Val 0x4u /**< \brief (CAN_PSR) Bit1 Error */ +#define CAN_PSR_DLEC_BIT0_Val 0x5u /**< \brief (CAN_PSR) Bit0 Error */ +#define CAN_PSR_DLEC_CRC_Val 0x6u /**< \brief (CAN_PSR) CRC Error */ +#define CAN_PSR_DLEC_NC_Val 0x7u /**< \brief (CAN_PSR) No Change */ +#define CAN_PSR_DLEC_NONE (CAN_PSR_DLEC_NONE_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_STUFF (CAN_PSR_DLEC_STUFF_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_FORM (CAN_PSR_DLEC_FORM_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_ACK (CAN_PSR_DLEC_ACK_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_BIT1 (CAN_PSR_DLEC_BIT1_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_BIT0 (CAN_PSR_DLEC_BIT0_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_CRC (CAN_PSR_DLEC_CRC_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_DLEC_NC (CAN_PSR_DLEC_NC_Val << CAN_PSR_DLEC_Pos) +#define CAN_PSR_RESI_Pos 11 /**< \brief (CAN_PSR) ESI flag of last received CAN FD Message */ +#define CAN_PSR_RESI (0x1u << CAN_PSR_RESI_Pos) +#define CAN_PSR_RBRS_Pos 12 /**< \brief (CAN_PSR) BRS flag of last received CAN FD Message */ +#define CAN_PSR_RBRS (0x1u << CAN_PSR_RBRS_Pos) +#define CAN_PSR_RFDF_Pos 13 /**< \brief (CAN_PSR) Received a CAN FD Message */ +#define CAN_PSR_RFDF (0x1u << CAN_PSR_RFDF_Pos) +#define CAN_PSR_PXE_Pos 14 /**< \brief (CAN_PSR) Protocol Exception Event */ +#define CAN_PSR_PXE (0x1u << CAN_PSR_PXE_Pos) +#define CAN_PSR_TDCV_Pos 16 /**< \brief (CAN_PSR) Transmitter Delay Compensation Value */ +#define CAN_PSR_TDCV_Msk (0x7Fu << CAN_PSR_TDCV_Pos) +#define CAN_PSR_TDCV(value) (CAN_PSR_TDCV_Msk & ((value) << CAN_PSR_TDCV_Pos)) +#define CAN_PSR_MASK 0x007F7FFFu /**< \brief (CAN_PSR) MASK Register */ + +/* -------- CAN_TDCR : (CAN Offset: 0x48) (R/W 32) Extended ID Filter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TDCF:7; /*!< bit: 0.. 6 Transmitter Delay Compensation Filter Length */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t TDCO:7; /*!< bit: 8..14 Transmitter Delay Compensation Offset */ + uint32_t :17; /*!< bit: 15..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TDCR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TDCR_OFFSET 0x48 /**< \brief (CAN_TDCR offset) Extended ID Filter Configuration */ +#define CAN_TDCR_RESETVALUE 0x00000000u /**< \brief (CAN_TDCR reset_value) Extended ID Filter Configuration */ + +#define CAN_TDCR_TDCF_Pos 0 /**< \brief (CAN_TDCR) Transmitter Delay Compensation Filter Length */ +#define CAN_TDCR_TDCF_Msk (0x7Fu << CAN_TDCR_TDCF_Pos) +#define CAN_TDCR_TDCF(value) (CAN_TDCR_TDCF_Msk & ((value) << CAN_TDCR_TDCF_Pos)) +#define CAN_TDCR_TDCO_Pos 8 /**< \brief (CAN_TDCR) Transmitter Delay Compensation Offset */ +#define CAN_TDCR_TDCO_Msk (0x7Fu << CAN_TDCR_TDCO_Pos) +#define CAN_TDCR_TDCO(value) (CAN_TDCR_TDCO_Msk & ((value) << CAN_TDCR_TDCO_Pos)) +#define CAN_TDCR_MASK 0x00007F7Fu /**< \brief (CAN_TDCR) MASK Register */ + +/* -------- CAN_IR : (CAN Offset: 0x50) (R/W 32) Interrupt -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RF0N:1; /*!< bit: 0 Rx FIFO 0 New Message */ + uint32_t RF0W:1; /*!< bit: 1 Rx FIFO 0 Watermark Reached */ + uint32_t RF0F:1; /*!< bit: 2 Rx FIFO 0 Full */ + uint32_t RF0L:1; /*!< bit: 3 Rx FIFO 0 Message Lost */ + uint32_t RF1N:1; /*!< bit: 4 Rx FIFO 1 New Message */ + uint32_t RF1W:1; /*!< bit: 5 Rx FIFO 1 Watermark Reached */ + uint32_t RF1F:1; /*!< bit: 6 Rx FIFO 1 FIFO Full */ + uint32_t RF1L:1; /*!< bit: 7 Rx FIFO 1 Message Lost */ + uint32_t HPM:1; /*!< bit: 8 High Priority Message */ + uint32_t TC:1; /*!< bit: 9 Timestamp Completed */ + uint32_t TCF:1; /*!< bit: 10 Transmission Cancellation Finished */ + uint32_t TFE:1; /*!< bit: 11 Tx FIFO Empty */ + uint32_t TEFN:1; /*!< bit: 12 Tx Event FIFO New Entry */ + uint32_t TEFW:1; /*!< bit: 13 Tx Event FIFO Watermark Reached */ + uint32_t TEFF:1; /*!< bit: 14 Tx Event FIFO Full */ + uint32_t TEFL:1; /*!< bit: 15 Tx Event FIFO Element Lost */ + uint32_t TSW:1; /*!< bit: 16 Timestamp Wraparound */ + uint32_t MRAF:1; /*!< bit: 17 Message RAM Access Failure */ + uint32_t TOO:1; /*!< bit: 18 Timeout Occurred */ + uint32_t DRX:1; /*!< bit: 19 Message stored to Dedicated Rx Buffer */ + uint32_t BEC:1; /*!< bit: 20 Bit Error Corrected */ + uint32_t BEU:1; /*!< bit: 21 Bit Error Uncorrected */ + uint32_t ELO:1; /*!< bit: 22 Error Logging Overflow */ + uint32_t EP:1; /*!< bit: 23 Error Passive */ + uint32_t EW:1; /*!< bit: 24 Warning Status */ + uint32_t BO:1; /*!< bit: 25 Bus_Off Status */ + uint32_t WDI:1; /*!< bit: 26 Watchdog Interrupt */ + uint32_t PEA:1; /*!< bit: 27 Protocol Error in Arbitration Phase */ + uint32_t PED:1; /*!< bit: 28 Protocol Error in Data Phase */ + uint32_t ARA:1; /*!< bit: 29 Access to Reserved Address */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_IR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_IR_OFFSET 0x50 /**< \brief (CAN_IR offset) Interrupt */ +#define CAN_IR_RESETVALUE 0x00000000u /**< \brief (CAN_IR reset_value) Interrupt */ + +#define CAN_IR_RF0N_Pos 0 /**< \brief (CAN_IR) Rx FIFO 0 New Message */ +#define CAN_IR_RF0N (0x1u << CAN_IR_RF0N_Pos) +#define CAN_IR_RF0W_Pos 1 /**< \brief (CAN_IR) Rx FIFO 0 Watermark Reached */ +#define CAN_IR_RF0W (0x1u << CAN_IR_RF0W_Pos) +#define CAN_IR_RF0F_Pos 2 /**< \brief (CAN_IR) Rx FIFO 0 Full */ +#define CAN_IR_RF0F (0x1u << CAN_IR_RF0F_Pos) +#define CAN_IR_RF0L_Pos 3 /**< \brief (CAN_IR) Rx FIFO 0 Message Lost */ +#define CAN_IR_RF0L (0x1u << CAN_IR_RF0L_Pos) +#define CAN_IR_RF1N_Pos 4 /**< \brief (CAN_IR) Rx FIFO 1 New Message */ +#define CAN_IR_RF1N (0x1u << CAN_IR_RF1N_Pos) +#define CAN_IR_RF1W_Pos 5 /**< \brief (CAN_IR) Rx FIFO 1 Watermark Reached */ +#define CAN_IR_RF1W (0x1u << CAN_IR_RF1W_Pos) +#define CAN_IR_RF1F_Pos 6 /**< \brief (CAN_IR) Rx FIFO 1 FIFO Full */ +#define CAN_IR_RF1F (0x1u << CAN_IR_RF1F_Pos) +#define CAN_IR_RF1L_Pos 7 /**< \brief (CAN_IR) Rx FIFO 1 Message Lost */ +#define CAN_IR_RF1L (0x1u << CAN_IR_RF1L_Pos) +#define CAN_IR_HPM_Pos 8 /**< \brief (CAN_IR) High Priority Message */ +#define CAN_IR_HPM (0x1u << CAN_IR_HPM_Pos) +#define CAN_IR_TC_Pos 9 /**< \brief (CAN_IR) Timestamp Completed */ +#define CAN_IR_TC (0x1u << CAN_IR_TC_Pos) +#define CAN_IR_TCF_Pos 10 /**< \brief (CAN_IR) Transmission Cancellation Finished */ +#define CAN_IR_TCF (0x1u << CAN_IR_TCF_Pos) +#define CAN_IR_TFE_Pos 11 /**< \brief (CAN_IR) Tx FIFO Empty */ +#define CAN_IR_TFE (0x1u << CAN_IR_TFE_Pos) +#define CAN_IR_TEFN_Pos 12 /**< \brief (CAN_IR) Tx Event FIFO New Entry */ +#define CAN_IR_TEFN (0x1u << CAN_IR_TEFN_Pos) +#define CAN_IR_TEFW_Pos 13 /**< \brief (CAN_IR) Tx Event FIFO Watermark Reached */ +#define CAN_IR_TEFW (0x1u << CAN_IR_TEFW_Pos) +#define CAN_IR_TEFF_Pos 14 /**< \brief (CAN_IR) Tx Event FIFO Full */ +#define CAN_IR_TEFF (0x1u << CAN_IR_TEFF_Pos) +#define CAN_IR_TEFL_Pos 15 /**< \brief (CAN_IR) Tx Event FIFO Element Lost */ +#define CAN_IR_TEFL (0x1u << CAN_IR_TEFL_Pos) +#define CAN_IR_TSW_Pos 16 /**< \brief (CAN_IR) Timestamp Wraparound */ +#define CAN_IR_TSW (0x1u << CAN_IR_TSW_Pos) +#define CAN_IR_MRAF_Pos 17 /**< \brief (CAN_IR) Message RAM Access Failure */ +#define CAN_IR_MRAF (0x1u << CAN_IR_MRAF_Pos) +#define CAN_IR_TOO_Pos 18 /**< \brief (CAN_IR) Timeout Occurred */ +#define CAN_IR_TOO (0x1u << CAN_IR_TOO_Pos) +#define CAN_IR_DRX_Pos 19 /**< \brief (CAN_IR) Message stored to Dedicated Rx Buffer */ +#define CAN_IR_DRX (0x1u << CAN_IR_DRX_Pos) +#define CAN_IR_BEC_Pos 20 /**< \brief (CAN_IR) Bit Error Corrected */ +#define CAN_IR_BEC (0x1u << CAN_IR_BEC_Pos) +#define CAN_IR_BEU_Pos 21 /**< \brief (CAN_IR) Bit Error Uncorrected */ +#define CAN_IR_BEU (0x1u << CAN_IR_BEU_Pos) +#define CAN_IR_ELO_Pos 22 /**< \brief (CAN_IR) Error Logging Overflow */ +#define CAN_IR_ELO (0x1u << CAN_IR_ELO_Pos) +#define CAN_IR_EP_Pos 23 /**< \brief (CAN_IR) Error Passive */ +#define CAN_IR_EP (0x1u << CAN_IR_EP_Pos) +#define CAN_IR_EW_Pos 24 /**< \brief (CAN_IR) Warning Status */ +#define CAN_IR_EW (0x1u << CAN_IR_EW_Pos) +#define CAN_IR_BO_Pos 25 /**< \brief (CAN_IR) Bus_Off Status */ +#define CAN_IR_BO (0x1u << CAN_IR_BO_Pos) +#define CAN_IR_WDI_Pos 26 /**< \brief (CAN_IR) Watchdog Interrupt */ +#define CAN_IR_WDI (0x1u << CAN_IR_WDI_Pos) +#define CAN_IR_PEA_Pos 27 /**< \brief (CAN_IR) Protocol Error in Arbitration Phase */ +#define CAN_IR_PEA (0x1u << CAN_IR_PEA_Pos) +#define CAN_IR_PED_Pos 28 /**< \brief (CAN_IR) Protocol Error in Data Phase */ +#define CAN_IR_PED (0x1u << CAN_IR_PED_Pos) +#define CAN_IR_ARA_Pos 29 /**< \brief (CAN_IR) Access to Reserved Address */ +#define CAN_IR_ARA (0x1u << CAN_IR_ARA_Pos) +#define CAN_IR_MASK 0x3FFFFFFFu /**< \brief (CAN_IR) MASK Register */ + +/* -------- CAN_IE : (CAN Offset: 0x54) (R/W 32) Interrupt Enable -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RF0NE:1; /*!< bit: 0 Rx FIFO 0 New Message Interrupt Enable */ + uint32_t RF0WE:1; /*!< bit: 1 Rx FIFO 0 Watermark Reached Interrupt Enable */ + uint32_t RF0FE:1; /*!< bit: 2 Rx FIFO 0 Full Interrupt Enable */ + uint32_t RF0LE:1; /*!< bit: 3 Rx FIFO 0 Message Lost Interrupt Enable */ + uint32_t RF1NE:1; /*!< bit: 4 Rx FIFO 1 New Message Interrupt Enable */ + uint32_t RF1WE:1; /*!< bit: 5 Rx FIFO 1 Watermark Reached Interrupt Enable */ + uint32_t RF1FE:1; /*!< bit: 6 Rx FIFO 1 FIFO Full Interrupt Enable */ + uint32_t RF1LE:1; /*!< bit: 7 Rx FIFO 1 Message Lost Interrupt Enable */ + uint32_t HPME:1; /*!< bit: 8 High Priority Message Interrupt Enable */ + uint32_t TCE:1; /*!< bit: 9 Timestamp Completed Interrupt Enable */ + uint32_t TCFE:1; /*!< bit: 10 Transmission Cancellation Finished Interrupt Enable */ + uint32_t TFEE:1; /*!< bit: 11 Tx FIFO Empty Interrupt Enable */ + uint32_t TEFNE:1; /*!< bit: 12 Tx Event FIFO New Entry Interrupt Enable */ + uint32_t TEFWE:1; /*!< bit: 13 Tx Event FIFO Watermark Reached Interrupt Enable */ + uint32_t TEFFE:1; /*!< bit: 14 Tx Event FIFO Full Interrupt Enable */ + uint32_t TEFLE:1; /*!< bit: 15 Tx Event FIFO Element Lost Interrupt Enable */ + uint32_t TSWE:1; /*!< bit: 16 Timestamp Wraparound Interrupt Enable */ + uint32_t MRAFE:1; /*!< bit: 17 Message RAM Access Failure Interrupt Enable */ + uint32_t TOOE:1; /*!< bit: 18 Timeout Occurred Interrupt Enable */ + uint32_t DRXE:1; /*!< bit: 19 Message stored to Dedicated Rx Buffer Interrupt Enable */ + uint32_t BECE:1; /*!< bit: 20 Bit Error Corrected Interrupt Enable */ + uint32_t BEUE:1; /*!< bit: 21 Bit Error Uncorrected Interrupt Enable */ + uint32_t ELOE:1; /*!< bit: 22 Error Logging Overflow Interrupt Enable */ + uint32_t EPE:1; /*!< bit: 23 Error Passive Interrupt Enable */ + uint32_t EWE:1; /*!< bit: 24 Warning Status Interrupt Enable */ + uint32_t BOE:1; /*!< bit: 25 Bus_Off Status Interrupt Enable */ + uint32_t WDIE:1; /*!< bit: 26 Watchdog Interrupt Interrupt Enable */ + uint32_t PEAE:1; /*!< bit: 27 Protocol Error in Arbitration Phase Enable */ + uint32_t PEDE:1; /*!< bit: 28 Protocol Error in Data Phase Enable */ + uint32_t ARAE:1; /*!< bit: 29 Access to Reserved Address Enable */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_IE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_IE_OFFSET 0x54 /**< \brief (CAN_IE offset) Interrupt Enable */ +#define CAN_IE_RESETVALUE 0x00000000u /**< \brief (CAN_IE reset_value) Interrupt Enable */ + +#define CAN_IE_RF0NE_Pos 0 /**< \brief (CAN_IE) Rx FIFO 0 New Message Interrupt Enable */ +#define CAN_IE_RF0NE (0x1u << CAN_IE_RF0NE_Pos) +#define CAN_IE_RF0WE_Pos 1 /**< \brief (CAN_IE) Rx FIFO 0 Watermark Reached Interrupt Enable */ +#define CAN_IE_RF0WE (0x1u << CAN_IE_RF0WE_Pos) +#define CAN_IE_RF0FE_Pos 2 /**< \brief (CAN_IE) Rx FIFO 0 Full Interrupt Enable */ +#define CAN_IE_RF0FE (0x1u << CAN_IE_RF0FE_Pos) +#define CAN_IE_RF0LE_Pos 3 /**< \brief (CAN_IE) Rx FIFO 0 Message Lost Interrupt Enable */ +#define CAN_IE_RF0LE (0x1u << CAN_IE_RF0LE_Pos) +#define CAN_IE_RF1NE_Pos 4 /**< \brief (CAN_IE) Rx FIFO 1 New Message Interrupt Enable */ +#define CAN_IE_RF1NE (0x1u << CAN_IE_RF1NE_Pos) +#define CAN_IE_RF1WE_Pos 5 /**< \brief (CAN_IE) Rx FIFO 1 Watermark Reached Interrupt Enable */ +#define CAN_IE_RF1WE (0x1u << CAN_IE_RF1WE_Pos) +#define CAN_IE_RF1FE_Pos 6 /**< \brief (CAN_IE) Rx FIFO 1 FIFO Full Interrupt Enable */ +#define CAN_IE_RF1FE (0x1u << CAN_IE_RF1FE_Pos) +#define CAN_IE_RF1LE_Pos 7 /**< \brief (CAN_IE) Rx FIFO 1 Message Lost Interrupt Enable */ +#define CAN_IE_RF1LE (0x1u << CAN_IE_RF1LE_Pos) +#define CAN_IE_HPME_Pos 8 /**< \brief (CAN_IE) High Priority Message Interrupt Enable */ +#define CAN_IE_HPME (0x1u << CAN_IE_HPME_Pos) +#define CAN_IE_TCE_Pos 9 /**< \brief (CAN_IE) Timestamp Completed Interrupt Enable */ +#define CAN_IE_TCE (0x1u << CAN_IE_TCE_Pos) +#define CAN_IE_TCFE_Pos 10 /**< \brief (CAN_IE) Transmission Cancellation Finished Interrupt Enable */ +#define CAN_IE_TCFE (0x1u << CAN_IE_TCFE_Pos) +#define CAN_IE_TFEE_Pos 11 /**< \brief (CAN_IE) Tx FIFO Empty Interrupt Enable */ +#define CAN_IE_TFEE (0x1u << CAN_IE_TFEE_Pos) +#define CAN_IE_TEFNE_Pos 12 /**< \brief (CAN_IE) Tx Event FIFO New Entry Interrupt Enable */ +#define CAN_IE_TEFNE (0x1u << CAN_IE_TEFNE_Pos) +#define CAN_IE_TEFWE_Pos 13 /**< \brief (CAN_IE) Tx Event FIFO Watermark Reached Interrupt Enable */ +#define CAN_IE_TEFWE (0x1u << CAN_IE_TEFWE_Pos) +#define CAN_IE_TEFFE_Pos 14 /**< \brief (CAN_IE) Tx Event FIFO Full Interrupt Enable */ +#define CAN_IE_TEFFE (0x1u << CAN_IE_TEFFE_Pos) +#define CAN_IE_TEFLE_Pos 15 /**< \brief (CAN_IE) Tx Event FIFO Element Lost Interrupt Enable */ +#define CAN_IE_TEFLE (0x1u << CAN_IE_TEFLE_Pos) +#define CAN_IE_TSWE_Pos 16 /**< \brief (CAN_IE) Timestamp Wraparound Interrupt Enable */ +#define CAN_IE_TSWE (0x1u << CAN_IE_TSWE_Pos) +#define CAN_IE_MRAFE_Pos 17 /**< \brief (CAN_IE) Message RAM Access Failure Interrupt Enable */ +#define CAN_IE_MRAFE (0x1u << CAN_IE_MRAFE_Pos) +#define CAN_IE_TOOE_Pos 18 /**< \brief (CAN_IE) Timeout Occurred Interrupt Enable */ +#define CAN_IE_TOOE (0x1u << CAN_IE_TOOE_Pos) +#define CAN_IE_DRXE_Pos 19 /**< \brief (CAN_IE) Message stored to Dedicated Rx Buffer Interrupt Enable */ +#define CAN_IE_DRXE (0x1u << CAN_IE_DRXE_Pos) +#define CAN_IE_BECE_Pos 20 /**< \brief (CAN_IE) Bit Error Corrected Interrupt Enable */ +#define CAN_IE_BECE (0x1u << CAN_IE_BECE_Pos) +#define CAN_IE_BEUE_Pos 21 /**< \brief (CAN_IE) Bit Error Uncorrected Interrupt Enable */ +#define CAN_IE_BEUE (0x1u << CAN_IE_BEUE_Pos) +#define CAN_IE_ELOE_Pos 22 /**< \brief (CAN_IE) Error Logging Overflow Interrupt Enable */ +#define CAN_IE_ELOE (0x1u << CAN_IE_ELOE_Pos) +#define CAN_IE_EPE_Pos 23 /**< \brief (CAN_IE) Error Passive Interrupt Enable */ +#define CAN_IE_EPE (0x1u << CAN_IE_EPE_Pos) +#define CAN_IE_EWE_Pos 24 /**< \brief (CAN_IE) Warning Status Interrupt Enable */ +#define CAN_IE_EWE (0x1u << CAN_IE_EWE_Pos) +#define CAN_IE_BOE_Pos 25 /**< \brief (CAN_IE) Bus_Off Status Interrupt Enable */ +#define CAN_IE_BOE (0x1u << CAN_IE_BOE_Pos) +#define CAN_IE_WDIE_Pos 26 /**< \brief (CAN_IE) Watchdog Interrupt Interrupt Enable */ +#define CAN_IE_WDIE (0x1u << CAN_IE_WDIE_Pos) +#define CAN_IE_PEAE_Pos 27 /**< \brief (CAN_IE) Protocol Error in Arbitration Phase Enable */ +#define CAN_IE_PEAE (0x1u << CAN_IE_PEAE_Pos) +#define CAN_IE_PEDE_Pos 28 /**< \brief (CAN_IE) Protocol Error in Data Phase Enable */ +#define CAN_IE_PEDE (0x1u << CAN_IE_PEDE_Pos) +#define CAN_IE_ARAE_Pos 29 /**< \brief (CAN_IE) Access to Reserved Address Enable */ +#define CAN_IE_ARAE (0x1u << CAN_IE_ARAE_Pos) +#define CAN_IE_MASK 0x3FFFFFFFu /**< \brief (CAN_IE) MASK Register */ + +/* -------- CAN_ILS : (CAN Offset: 0x58) (R/W 32) Interrupt Line Select -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RF0NL:1; /*!< bit: 0 Rx FIFO 0 New Message Interrupt Line */ + uint32_t RF0WL:1; /*!< bit: 1 Rx FIFO 0 Watermark Reached Interrupt Line */ + uint32_t RF0FL:1; /*!< bit: 2 Rx FIFO 0 Full Interrupt Line */ + uint32_t RF0LL:1; /*!< bit: 3 Rx FIFO 0 Message Lost Interrupt Line */ + uint32_t RF1NL:1; /*!< bit: 4 Rx FIFO 1 New Message Interrupt Line */ + uint32_t RF1WL:1; /*!< bit: 5 Rx FIFO 1 Watermark Reached Interrupt Line */ + uint32_t RF1FL:1; /*!< bit: 6 Rx FIFO 1 FIFO Full Interrupt Line */ + uint32_t RF1LL:1; /*!< bit: 7 Rx FIFO 1 Message Lost Interrupt Line */ + uint32_t HPML:1; /*!< bit: 8 High Priority Message Interrupt Line */ + uint32_t TCL:1; /*!< bit: 9 Timestamp Completed Interrupt Line */ + uint32_t TCFL:1; /*!< bit: 10 Transmission Cancellation Finished Interrupt Line */ + uint32_t TFEL:1; /*!< bit: 11 Tx FIFO Empty Interrupt Line */ + uint32_t TEFNL:1; /*!< bit: 12 Tx Event FIFO New Entry Interrupt Line */ + uint32_t TEFWL:1; /*!< bit: 13 Tx Event FIFO Watermark Reached Interrupt Line */ + uint32_t TEFFL:1; /*!< bit: 14 Tx Event FIFO Full Interrupt Line */ + uint32_t TEFLL:1; /*!< bit: 15 Tx Event FIFO Element Lost Interrupt Line */ + uint32_t TSWL:1; /*!< bit: 16 Timestamp Wraparound Interrupt Line */ + uint32_t MRAFL:1; /*!< bit: 17 Message RAM Access Failure Interrupt Line */ + uint32_t TOOL:1; /*!< bit: 18 Timeout Occurred Interrupt Line */ + uint32_t DRXL:1; /*!< bit: 19 Message stored to Dedicated Rx Buffer Interrupt Line */ + uint32_t BECL:1; /*!< bit: 20 Bit Error Corrected Interrupt Line */ + uint32_t BEUL:1; /*!< bit: 21 Bit Error Uncorrected Interrupt Line */ + uint32_t ELOL:1; /*!< bit: 22 Error Logging Overflow Interrupt Line */ + uint32_t EPL:1; /*!< bit: 23 Error Passive Interrupt Line */ + uint32_t EWL:1; /*!< bit: 24 Warning Status Interrupt Line */ + uint32_t BOL:1; /*!< bit: 25 Bus_Off Status Interrupt Line */ + uint32_t WDIL:1; /*!< bit: 26 Watchdog Interrupt Interrupt Line */ + uint32_t PEAL:1; /*!< bit: 27 Protocol Error in Arbitration Phase Line */ + uint32_t PEDL:1; /*!< bit: 28 Protocol Error in Data Phase Line */ + uint32_t ARAL:1; /*!< bit: 29 Access to Reserved Address Line */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_ILS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_ILS_OFFSET 0x58 /**< \brief (CAN_ILS offset) Interrupt Line Select */ +#define CAN_ILS_RESETVALUE 0x00000000u /**< \brief (CAN_ILS reset_value) Interrupt Line Select */ + +#define CAN_ILS_RF0NL_Pos 0 /**< \brief (CAN_ILS) Rx FIFO 0 New Message Interrupt Line */ +#define CAN_ILS_RF0NL (0x1u << CAN_ILS_RF0NL_Pos) +#define CAN_ILS_RF0WL_Pos 1 /**< \brief (CAN_ILS) Rx FIFO 0 Watermark Reached Interrupt Line */ +#define CAN_ILS_RF0WL (0x1u << CAN_ILS_RF0WL_Pos) +#define CAN_ILS_RF0FL_Pos 2 /**< \brief (CAN_ILS) Rx FIFO 0 Full Interrupt Line */ +#define CAN_ILS_RF0FL (0x1u << CAN_ILS_RF0FL_Pos) +#define CAN_ILS_RF0LL_Pos 3 /**< \brief (CAN_ILS) Rx FIFO 0 Message Lost Interrupt Line */ +#define CAN_ILS_RF0LL (0x1u << CAN_ILS_RF0LL_Pos) +#define CAN_ILS_RF1NL_Pos 4 /**< \brief (CAN_ILS) Rx FIFO 1 New Message Interrupt Line */ +#define CAN_ILS_RF1NL (0x1u << CAN_ILS_RF1NL_Pos) +#define CAN_ILS_RF1WL_Pos 5 /**< \brief (CAN_ILS) Rx FIFO 1 Watermark Reached Interrupt Line */ +#define CAN_ILS_RF1WL (0x1u << CAN_ILS_RF1WL_Pos) +#define CAN_ILS_RF1FL_Pos 6 /**< \brief (CAN_ILS) Rx FIFO 1 FIFO Full Interrupt Line */ +#define CAN_ILS_RF1FL (0x1u << CAN_ILS_RF1FL_Pos) +#define CAN_ILS_RF1LL_Pos 7 /**< \brief (CAN_ILS) Rx FIFO 1 Message Lost Interrupt Line */ +#define CAN_ILS_RF1LL (0x1u << CAN_ILS_RF1LL_Pos) +#define CAN_ILS_HPML_Pos 8 /**< \brief (CAN_ILS) High Priority Message Interrupt Line */ +#define CAN_ILS_HPML (0x1u << CAN_ILS_HPML_Pos) +#define CAN_ILS_TCL_Pos 9 /**< \brief (CAN_ILS) Timestamp Completed Interrupt Line */ +#define CAN_ILS_TCL (0x1u << CAN_ILS_TCL_Pos) +#define CAN_ILS_TCFL_Pos 10 /**< \brief (CAN_ILS) Transmission Cancellation Finished Interrupt Line */ +#define CAN_ILS_TCFL (0x1u << CAN_ILS_TCFL_Pos) +#define CAN_ILS_TFEL_Pos 11 /**< \brief (CAN_ILS) Tx FIFO Empty Interrupt Line */ +#define CAN_ILS_TFEL (0x1u << CAN_ILS_TFEL_Pos) +#define CAN_ILS_TEFNL_Pos 12 /**< \brief (CAN_ILS) Tx Event FIFO New Entry Interrupt Line */ +#define CAN_ILS_TEFNL (0x1u << CAN_ILS_TEFNL_Pos) +#define CAN_ILS_TEFWL_Pos 13 /**< \brief (CAN_ILS) Tx Event FIFO Watermark Reached Interrupt Line */ +#define CAN_ILS_TEFWL (0x1u << CAN_ILS_TEFWL_Pos) +#define CAN_ILS_TEFFL_Pos 14 /**< \brief (CAN_ILS) Tx Event FIFO Full Interrupt Line */ +#define CAN_ILS_TEFFL (0x1u << CAN_ILS_TEFFL_Pos) +#define CAN_ILS_TEFLL_Pos 15 /**< \brief (CAN_ILS) Tx Event FIFO Element Lost Interrupt Line */ +#define CAN_ILS_TEFLL (0x1u << CAN_ILS_TEFLL_Pos) +#define CAN_ILS_TSWL_Pos 16 /**< \brief (CAN_ILS) Timestamp Wraparound Interrupt Line */ +#define CAN_ILS_TSWL (0x1u << CAN_ILS_TSWL_Pos) +#define CAN_ILS_MRAFL_Pos 17 /**< \brief (CAN_ILS) Message RAM Access Failure Interrupt Line */ +#define CAN_ILS_MRAFL (0x1u << CAN_ILS_MRAFL_Pos) +#define CAN_ILS_TOOL_Pos 18 /**< \brief (CAN_ILS) Timeout Occurred Interrupt Line */ +#define CAN_ILS_TOOL (0x1u << CAN_ILS_TOOL_Pos) +#define CAN_ILS_DRXL_Pos 19 /**< \brief (CAN_ILS) Message stored to Dedicated Rx Buffer Interrupt Line */ +#define CAN_ILS_DRXL (0x1u << CAN_ILS_DRXL_Pos) +#define CAN_ILS_BECL_Pos 20 /**< \brief (CAN_ILS) Bit Error Corrected Interrupt Line */ +#define CAN_ILS_BECL (0x1u << CAN_ILS_BECL_Pos) +#define CAN_ILS_BEUL_Pos 21 /**< \brief (CAN_ILS) Bit Error Uncorrected Interrupt Line */ +#define CAN_ILS_BEUL (0x1u << CAN_ILS_BEUL_Pos) +#define CAN_ILS_ELOL_Pos 22 /**< \brief (CAN_ILS) Error Logging Overflow Interrupt Line */ +#define CAN_ILS_ELOL (0x1u << CAN_ILS_ELOL_Pos) +#define CAN_ILS_EPL_Pos 23 /**< \brief (CAN_ILS) Error Passive Interrupt Line */ +#define CAN_ILS_EPL (0x1u << CAN_ILS_EPL_Pos) +#define CAN_ILS_EWL_Pos 24 /**< \brief (CAN_ILS) Warning Status Interrupt Line */ +#define CAN_ILS_EWL (0x1u << CAN_ILS_EWL_Pos) +#define CAN_ILS_BOL_Pos 25 /**< \brief (CAN_ILS) Bus_Off Status Interrupt Line */ +#define CAN_ILS_BOL (0x1u << CAN_ILS_BOL_Pos) +#define CAN_ILS_WDIL_Pos 26 /**< \brief (CAN_ILS) Watchdog Interrupt Interrupt Line */ +#define CAN_ILS_WDIL (0x1u << CAN_ILS_WDIL_Pos) +#define CAN_ILS_PEAL_Pos 27 /**< \brief (CAN_ILS) Protocol Error in Arbitration Phase Line */ +#define CAN_ILS_PEAL (0x1u << CAN_ILS_PEAL_Pos) +#define CAN_ILS_PEDL_Pos 28 /**< \brief (CAN_ILS) Protocol Error in Data Phase Line */ +#define CAN_ILS_PEDL (0x1u << CAN_ILS_PEDL_Pos) +#define CAN_ILS_ARAL_Pos 29 /**< \brief (CAN_ILS) Access to Reserved Address Line */ +#define CAN_ILS_ARAL (0x1u << CAN_ILS_ARAL_Pos) +#define CAN_ILS_MASK 0x3FFFFFFFu /**< \brief (CAN_ILS) MASK Register */ + +/* -------- CAN_ILE : (CAN Offset: 0x5C) (R/W 32) Interrupt Line Enable -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EINT0:1; /*!< bit: 0 Enable Interrupt Line 0 */ + uint32_t EINT1:1; /*!< bit: 1 Enable Interrupt Line 1 */ + uint32_t :30; /*!< bit: 2..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_ILE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_ILE_OFFSET 0x5C /**< \brief (CAN_ILE offset) Interrupt Line Enable */ +#define CAN_ILE_RESETVALUE 0x00000000u /**< \brief (CAN_ILE reset_value) Interrupt Line Enable */ + +#define CAN_ILE_EINT0_Pos 0 /**< \brief (CAN_ILE) Enable Interrupt Line 0 */ +#define CAN_ILE_EINT0 (0x1u << CAN_ILE_EINT0_Pos) +#define CAN_ILE_EINT1_Pos 1 /**< \brief (CAN_ILE) Enable Interrupt Line 1 */ +#define CAN_ILE_EINT1 (0x1u << CAN_ILE_EINT1_Pos) +#define CAN_ILE_MASK 0x00000003u /**< \brief (CAN_ILE) MASK Register */ + +/* -------- CAN_GFC : (CAN Offset: 0x80) (R/W 32) Global Filter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RRFE:1; /*!< bit: 0 Reject Remote Frames Extended */ + uint32_t RRFS:1; /*!< bit: 1 Reject Remote Frames Standard */ + uint32_t ANFE:2; /*!< bit: 2.. 3 Accept Non-matching Frames Extended */ + uint32_t ANFS:2; /*!< bit: 4.. 5 Accept Non-matching Frames Standard */ + uint32_t :26; /*!< bit: 6..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_GFC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_GFC_OFFSET 0x80 /**< \brief (CAN_GFC offset) Global Filter Configuration */ +#define CAN_GFC_RESETVALUE 0x00000000u /**< \brief (CAN_GFC reset_value) Global Filter Configuration */ + +#define CAN_GFC_RRFE_Pos 0 /**< \brief (CAN_GFC) Reject Remote Frames Extended */ +#define CAN_GFC_RRFE (0x1u << CAN_GFC_RRFE_Pos) +#define CAN_GFC_RRFS_Pos 1 /**< \brief (CAN_GFC) Reject Remote Frames Standard */ +#define CAN_GFC_RRFS (0x1u << CAN_GFC_RRFS_Pos) +#define CAN_GFC_ANFE_Pos 2 /**< \brief (CAN_GFC) Accept Non-matching Frames Extended */ +#define CAN_GFC_ANFE_Msk (0x3u << CAN_GFC_ANFE_Pos) +#define CAN_GFC_ANFE(value) (CAN_GFC_ANFE_Msk & ((value) << CAN_GFC_ANFE_Pos)) +#define CAN_GFC_ANFE_RXF0_Val 0x0u /**< \brief (CAN_GFC) Accept in Rx FIFO 0 */ +#define CAN_GFC_ANFE_RXF1_Val 0x1u /**< \brief (CAN_GFC) Accept in Rx FIFO 1 */ +#define CAN_GFC_ANFE_REJECT_Val 0x2u /**< \brief (CAN_GFC) Reject */ +#define CAN_GFC_ANFE_RXF0 (CAN_GFC_ANFE_RXF0_Val << CAN_GFC_ANFE_Pos) +#define CAN_GFC_ANFE_RXF1 (CAN_GFC_ANFE_RXF1_Val << CAN_GFC_ANFE_Pos) +#define CAN_GFC_ANFE_REJECT (CAN_GFC_ANFE_REJECT_Val << CAN_GFC_ANFE_Pos) +#define CAN_GFC_ANFS_Pos 4 /**< \brief (CAN_GFC) Accept Non-matching Frames Standard */ +#define CAN_GFC_ANFS_Msk (0x3u << CAN_GFC_ANFS_Pos) +#define CAN_GFC_ANFS(value) (CAN_GFC_ANFS_Msk & ((value) << CAN_GFC_ANFS_Pos)) +#define CAN_GFC_ANFS_RXF0_Val 0x0u /**< \brief (CAN_GFC) Accept in Rx FIFO 0 */ +#define CAN_GFC_ANFS_RXF1_Val 0x1u /**< \brief (CAN_GFC) Accept in Rx FIFO 1 */ +#define CAN_GFC_ANFS_REJECT_Val 0x2u /**< \brief (CAN_GFC) Reject */ +#define CAN_GFC_ANFS_RXF0 (CAN_GFC_ANFS_RXF0_Val << CAN_GFC_ANFS_Pos) +#define CAN_GFC_ANFS_RXF1 (CAN_GFC_ANFS_RXF1_Val << CAN_GFC_ANFS_Pos) +#define CAN_GFC_ANFS_REJECT (CAN_GFC_ANFS_REJECT_Val << CAN_GFC_ANFS_Pos) +#define CAN_GFC_MASK 0x0000003Fu /**< \brief (CAN_GFC) MASK Register */ + +/* -------- CAN_SIDFC : (CAN Offset: 0x84) (R/W 32) Standard ID Filter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t FLSSA:16; /*!< bit: 0..15 Filter List Standard Start Address */ + uint32_t LSS:8; /*!< bit: 16..23 List Size Standard */ + uint32_t :8; /*!< bit: 24..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_SIDFC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_SIDFC_OFFSET 0x84 /**< \brief (CAN_SIDFC offset) Standard ID Filter Configuration */ +#define CAN_SIDFC_RESETVALUE 0x00000000u /**< \brief (CAN_SIDFC reset_value) Standard ID Filter Configuration */ + +#define CAN_SIDFC_FLSSA_Pos 0 /**< \brief (CAN_SIDFC) Filter List Standard Start Address */ +#define CAN_SIDFC_FLSSA_Msk (0xFFFFu << CAN_SIDFC_FLSSA_Pos) +#define CAN_SIDFC_FLSSA(value) (CAN_SIDFC_FLSSA_Msk & ((value) << CAN_SIDFC_FLSSA_Pos)) +#define CAN_SIDFC_LSS_Pos 16 /**< \brief (CAN_SIDFC) List Size Standard */ +#define CAN_SIDFC_LSS_Msk (0xFFu << CAN_SIDFC_LSS_Pos) +#define CAN_SIDFC_LSS(value) (CAN_SIDFC_LSS_Msk & ((value) << CAN_SIDFC_LSS_Pos)) +#define CAN_SIDFC_MASK 0x00FFFFFFu /**< \brief (CAN_SIDFC) MASK Register */ + +/* -------- CAN_XIDFC : (CAN Offset: 0x88) (R/W 32) Extended ID Filter Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t FLESA:16; /*!< bit: 0..15 Filter List Extended Start Address */ + uint32_t LSE:7; /*!< bit: 16..22 List Size Extended */ + uint32_t :9; /*!< bit: 23..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_XIDFC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_XIDFC_OFFSET 0x88 /**< \brief (CAN_XIDFC offset) Extended ID Filter Configuration */ +#define CAN_XIDFC_RESETVALUE 0x00000000u /**< \brief (CAN_XIDFC reset_value) Extended ID Filter Configuration */ + +#define CAN_XIDFC_FLESA_Pos 0 /**< \brief (CAN_XIDFC) Filter List Extended Start Address */ +#define CAN_XIDFC_FLESA_Msk (0xFFFFu << CAN_XIDFC_FLESA_Pos) +#define CAN_XIDFC_FLESA(value) (CAN_XIDFC_FLESA_Msk & ((value) << CAN_XIDFC_FLESA_Pos)) +#define CAN_XIDFC_LSE_Pos 16 /**< \brief (CAN_XIDFC) List Size Extended */ +#define CAN_XIDFC_LSE_Msk (0x7Fu << CAN_XIDFC_LSE_Pos) +#define CAN_XIDFC_LSE(value) (CAN_XIDFC_LSE_Msk & ((value) << CAN_XIDFC_LSE_Pos)) +#define CAN_XIDFC_MASK 0x007FFFFFu /**< \brief (CAN_XIDFC) MASK Register */ + +/* -------- CAN_XIDAM : (CAN Offset: 0x90) (R/W 32) Extended ID AND Mask -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EIDM:29; /*!< bit: 0..28 Extended ID Mask */ + uint32_t :3; /*!< bit: 29..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_XIDAM_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_XIDAM_OFFSET 0x90 /**< \brief (CAN_XIDAM offset) Extended ID AND Mask */ +#define CAN_XIDAM_RESETVALUE 0x1FFFFFFFu /**< \brief (CAN_XIDAM reset_value) Extended ID AND Mask */ + +#define CAN_XIDAM_EIDM_Pos 0 /**< \brief (CAN_XIDAM) Extended ID Mask */ +#define CAN_XIDAM_EIDM_Msk (0x1FFFFFFFu << CAN_XIDAM_EIDM_Pos) +#define CAN_XIDAM_EIDM(value) (CAN_XIDAM_EIDM_Msk & ((value) << CAN_XIDAM_EIDM_Pos)) +#define CAN_XIDAM_MASK 0x1FFFFFFFu /**< \brief (CAN_XIDAM) MASK Register */ + +/* -------- CAN_HPMS : (CAN Offset: 0x94) (R/ 32) High Priority Message Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t BIDX:6; /*!< bit: 0.. 5 Buffer Index */ + uint32_t MSI:2; /*!< bit: 6.. 7 Message Storage Indicator */ + uint32_t FIDX:7; /*!< bit: 8..14 Filter Index */ + uint32_t FLST:1; /*!< bit: 15 Filter List */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_HPMS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_HPMS_OFFSET 0x94 /**< \brief (CAN_HPMS offset) High Priority Message Status */ +#define CAN_HPMS_RESETVALUE 0x00000000u /**< \brief (CAN_HPMS reset_value) High Priority Message Status */ + +#define CAN_HPMS_BIDX_Pos 0 /**< \brief (CAN_HPMS) Buffer Index */ +#define CAN_HPMS_BIDX_Msk (0x3Fu << CAN_HPMS_BIDX_Pos) +#define CAN_HPMS_BIDX(value) (CAN_HPMS_BIDX_Msk & ((value) << CAN_HPMS_BIDX_Pos)) +#define CAN_HPMS_MSI_Pos 6 /**< \brief (CAN_HPMS) Message Storage Indicator */ +#define CAN_HPMS_MSI_Msk (0x3u << CAN_HPMS_MSI_Pos) +#define CAN_HPMS_MSI(value) (CAN_HPMS_MSI_Msk & ((value) << CAN_HPMS_MSI_Pos)) +#define CAN_HPMS_MSI_NONE_Val 0x0u /**< \brief (CAN_HPMS) No FIFO selected */ +#define CAN_HPMS_MSI_LOST_Val 0x1u /**< \brief (CAN_HPMS) FIFO message lost */ +#define CAN_HPMS_MSI_FIFO0_Val 0x2u /**< \brief (CAN_HPMS) Message stored in FIFO 0 */ +#define CAN_HPMS_MSI_FIFO1_Val 0x3u /**< \brief (CAN_HPMS) Message stored in FIFO 1 */ +#define CAN_HPMS_MSI_NONE (CAN_HPMS_MSI_NONE_Val << CAN_HPMS_MSI_Pos) +#define CAN_HPMS_MSI_LOST (CAN_HPMS_MSI_LOST_Val << CAN_HPMS_MSI_Pos) +#define CAN_HPMS_MSI_FIFO0 (CAN_HPMS_MSI_FIFO0_Val << CAN_HPMS_MSI_Pos) +#define CAN_HPMS_MSI_FIFO1 (CAN_HPMS_MSI_FIFO1_Val << CAN_HPMS_MSI_Pos) +#define CAN_HPMS_FIDX_Pos 8 /**< \brief (CAN_HPMS) Filter Index */ +#define CAN_HPMS_FIDX_Msk (0x7Fu << CAN_HPMS_FIDX_Pos) +#define CAN_HPMS_FIDX(value) (CAN_HPMS_FIDX_Msk & ((value) << CAN_HPMS_FIDX_Pos)) +#define CAN_HPMS_FLST_Pos 15 /**< \brief (CAN_HPMS) Filter List */ +#define CAN_HPMS_FLST (0x1u << CAN_HPMS_FLST_Pos) +#define CAN_HPMS_MASK 0x0000FFFFu /**< \brief (CAN_HPMS) MASK Register */ + +/* -------- CAN_NDAT1 : (CAN Offset: 0x98) (R/W 32) New Data 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ND0:1; /*!< bit: 0 New Data 0 */ + uint32_t ND1:1; /*!< bit: 1 New Data 1 */ + uint32_t ND2:1; /*!< bit: 2 New Data 2 */ + uint32_t ND3:1; /*!< bit: 3 New Data 3 */ + uint32_t ND4:1; /*!< bit: 4 New Data 4 */ + uint32_t ND5:1; /*!< bit: 5 New Data 5 */ + uint32_t ND6:1; /*!< bit: 6 New Data 6 */ + uint32_t ND7:1; /*!< bit: 7 New Data 7 */ + uint32_t ND8:1; /*!< bit: 8 New Data 8 */ + uint32_t ND9:1; /*!< bit: 9 New Data 9 */ + uint32_t ND10:1; /*!< bit: 10 New Data 10 */ + uint32_t ND11:1; /*!< bit: 11 New Data 11 */ + uint32_t ND12:1; /*!< bit: 12 New Data 12 */ + uint32_t ND13:1; /*!< bit: 13 New Data 13 */ + uint32_t ND14:1; /*!< bit: 14 New Data 14 */ + uint32_t ND15:1; /*!< bit: 15 New Data 15 */ + uint32_t ND16:1; /*!< bit: 16 New Data 16 */ + uint32_t ND17:1; /*!< bit: 17 New Data 17 */ + uint32_t ND18:1; /*!< bit: 18 New Data 18 */ + uint32_t ND19:1; /*!< bit: 19 New Data 19 */ + uint32_t ND20:1; /*!< bit: 20 New Data 20 */ + uint32_t ND21:1; /*!< bit: 21 New Data 21 */ + uint32_t ND22:1; /*!< bit: 22 New Data 22 */ + uint32_t ND23:1; /*!< bit: 23 New Data 23 */ + uint32_t ND24:1; /*!< bit: 24 New Data 24 */ + uint32_t ND25:1; /*!< bit: 25 New Data 25 */ + uint32_t ND26:1; /*!< bit: 26 New Data 26 */ + uint32_t ND27:1; /*!< bit: 27 New Data 27 */ + uint32_t ND28:1; /*!< bit: 28 New Data 28 */ + uint32_t ND29:1; /*!< bit: 29 New Data 29 */ + uint32_t ND30:1; /*!< bit: 30 New Data 30 */ + uint32_t ND31:1; /*!< bit: 31 New Data 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_NDAT1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_NDAT1_OFFSET 0x98 /**< \brief (CAN_NDAT1 offset) New Data 1 */ +#define CAN_NDAT1_RESETVALUE 0x00000000u /**< \brief (CAN_NDAT1 reset_value) New Data 1 */ + +#define CAN_NDAT1_ND0_Pos 0 /**< \brief (CAN_NDAT1) New Data 0 */ +#define CAN_NDAT1_ND0 (0x1u << CAN_NDAT1_ND0_Pos) +#define CAN_NDAT1_ND1_Pos 1 /**< \brief (CAN_NDAT1) New Data 1 */ +#define CAN_NDAT1_ND1 (0x1u << CAN_NDAT1_ND1_Pos) +#define CAN_NDAT1_ND2_Pos 2 /**< \brief (CAN_NDAT1) New Data 2 */ +#define CAN_NDAT1_ND2 (0x1u << CAN_NDAT1_ND2_Pos) +#define CAN_NDAT1_ND3_Pos 3 /**< \brief (CAN_NDAT1) New Data 3 */ +#define CAN_NDAT1_ND3 (0x1u << CAN_NDAT1_ND3_Pos) +#define CAN_NDAT1_ND4_Pos 4 /**< \brief (CAN_NDAT1) New Data 4 */ +#define CAN_NDAT1_ND4 (0x1u << CAN_NDAT1_ND4_Pos) +#define CAN_NDAT1_ND5_Pos 5 /**< \brief (CAN_NDAT1) New Data 5 */ +#define CAN_NDAT1_ND5 (0x1u << CAN_NDAT1_ND5_Pos) +#define CAN_NDAT1_ND6_Pos 6 /**< \brief (CAN_NDAT1) New Data 6 */ +#define CAN_NDAT1_ND6 (0x1u << CAN_NDAT1_ND6_Pos) +#define CAN_NDAT1_ND7_Pos 7 /**< \brief (CAN_NDAT1) New Data 7 */ +#define CAN_NDAT1_ND7 (0x1u << CAN_NDAT1_ND7_Pos) +#define CAN_NDAT1_ND8_Pos 8 /**< \brief (CAN_NDAT1) New Data 8 */ +#define CAN_NDAT1_ND8 (0x1u << CAN_NDAT1_ND8_Pos) +#define CAN_NDAT1_ND9_Pos 9 /**< \brief (CAN_NDAT1) New Data 9 */ +#define CAN_NDAT1_ND9 (0x1u << CAN_NDAT1_ND9_Pos) +#define CAN_NDAT1_ND10_Pos 10 /**< \brief (CAN_NDAT1) New Data 10 */ +#define CAN_NDAT1_ND10 (0x1u << CAN_NDAT1_ND10_Pos) +#define CAN_NDAT1_ND11_Pos 11 /**< \brief (CAN_NDAT1) New Data 11 */ +#define CAN_NDAT1_ND11 (0x1u << CAN_NDAT1_ND11_Pos) +#define CAN_NDAT1_ND12_Pos 12 /**< \brief (CAN_NDAT1) New Data 12 */ +#define CAN_NDAT1_ND12 (0x1u << CAN_NDAT1_ND12_Pos) +#define CAN_NDAT1_ND13_Pos 13 /**< \brief (CAN_NDAT1) New Data 13 */ +#define CAN_NDAT1_ND13 (0x1u << CAN_NDAT1_ND13_Pos) +#define CAN_NDAT1_ND14_Pos 14 /**< \brief (CAN_NDAT1) New Data 14 */ +#define CAN_NDAT1_ND14 (0x1u << CAN_NDAT1_ND14_Pos) +#define CAN_NDAT1_ND15_Pos 15 /**< \brief (CAN_NDAT1) New Data 15 */ +#define CAN_NDAT1_ND15 (0x1u << CAN_NDAT1_ND15_Pos) +#define CAN_NDAT1_ND16_Pos 16 /**< \brief (CAN_NDAT1) New Data 16 */ +#define CAN_NDAT1_ND16 (0x1u << CAN_NDAT1_ND16_Pos) +#define CAN_NDAT1_ND17_Pos 17 /**< \brief (CAN_NDAT1) New Data 17 */ +#define CAN_NDAT1_ND17 (0x1u << CAN_NDAT1_ND17_Pos) +#define CAN_NDAT1_ND18_Pos 18 /**< \brief (CAN_NDAT1) New Data 18 */ +#define CAN_NDAT1_ND18 (0x1u << CAN_NDAT1_ND18_Pos) +#define CAN_NDAT1_ND19_Pos 19 /**< \brief (CAN_NDAT1) New Data 19 */ +#define CAN_NDAT1_ND19 (0x1u << CAN_NDAT1_ND19_Pos) +#define CAN_NDAT1_ND20_Pos 20 /**< \brief (CAN_NDAT1) New Data 20 */ +#define CAN_NDAT1_ND20 (0x1u << CAN_NDAT1_ND20_Pos) +#define CAN_NDAT1_ND21_Pos 21 /**< \brief (CAN_NDAT1) New Data 21 */ +#define CAN_NDAT1_ND21 (0x1u << CAN_NDAT1_ND21_Pos) +#define CAN_NDAT1_ND22_Pos 22 /**< \brief (CAN_NDAT1) New Data 22 */ +#define CAN_NDAT1_ND22 (0x1u << CAN_NDAT1_ND22_Pos) +#define CAN_NDAT1_ND23_Pos 23 /**< \brief (CAN_NDAT1) New Data 23 */ +#define CAN_NDAT1_ND23 (0x1u << CAN_NDAT1_ND23_Pos) +#define CAN_NDAT1_ND24_Pos 24 /**< \brief (CAN_NDAT1) New Data 24 */ +#define CAN_NDAT1_ND24 (0x1u << CAN_NDAT1_ND24_Pos) +#define CAN_NDAT1_ND25_Pos 25 /**< \brief (CAN_NDAT1) New Data 25 */ +#define CAN_NDAT1_ND25 (0x1u << CAN_NDAT1_ND25_Pos) +#define CAN_NDAT1_ND26_Pos 26 /**< \brief (CAN_NDAT1) New Data 26 */ +#define CAN_NDAT1_ND26 (0x1u << CAN_NDAT1_ND26_Pos) +#define CAN_NDAT1_ND27_Pos 27 /**< \brief (CAN_NDAT1) New Data 27 */ +#define CAN_NDAT1_ND27 (0x1u << CAN_NDAT1_ND27_Pos) +#define CAN_NDAT1_ND28_Pos 28 /**< \brief (CAN_NDAT1) New Data 28 */ +#define CAN_NDAT1_ND28 (0x1u << CAN_NDAT1_ND28_Pos) +#define CAN_NDAT1_ND29_Pos 29 /**< \brief (CAN_NDAT1) New Data 29 */ +#define CAN_NDAT1_ND29 (0x1u << CAN_NDAT1_ND29_Pos) +#define CAN_NDAT1_ND30_Pos 30 /**< \brief (CAN_NDAT1) New Data 30 */ +#define CAN_NDAT1_ND30 (0x1u << CAN_NDAT1_ND30_Pos) +#define CAN_NDAT1_ND31_Pos 31 /**< \brief (CAN_NDAT1) New Data 31 */ +#define CAN_NDAT1_ND31 (0x1u << CAN_NDAT1_ND31_Pos) +#define CAN_NDAT1_MASK 0xFFFFFFFFu /**< \brief (CAN_NDAT1) MASK Register */ + +/* -------- CAN_NDAT2 : (CAN Offset: 0x9C) (R/W 32) New Data 2 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ND32:1; /*!< bit: 0 New Data 32 */ + uint32_t ND33:1; /*!< bit: 1 New Data 33 */ + uint32_t ND34:1; /*!< bit: 2 New Data 34 */ + uint32_t ND35:1; /*!< bit: 3 New Data 35 */ + uint32_t ND36:1; /*!< bit: 4 New Data 36 */ + uint32_t ND37:1; /*!< bit: 5 New Data 37 */ + uint32_t ND38:1; /*!< bit: 6 New Data 38 */ + uint32_t ND39:1; /*!< bit: 7 New Data 39 */ + uint32_t ND40:1; /*!< bit: 8 New Data 40 */ + uint32_t ND41:1; /*!< bit: 9 New Data 41 */ + uint32_t ND42:1; /*!< bit: 10 New Data 42 */ + uint32_t ND43:1; /*!< bit: 11 New Data 43 */ + uint32_t ND44:1; /*!< bit: 12 New Data 44 */ + uint32_t ND45:1; /*!< bit: 13 New Data 45 */ + uint32_t ND46:1; /*!< bit: 14 New Data 46 */ + uint32_t ND47:1; /*!< bit: 15 New Data 47 */ + uint32_t ND48:1; /*!< bit: 16 New Data 48 */ + uint32_t ND49:1; /*!< bit: 17 New Data 49 */ + uint32_t ND50:1; /*!< bit: 18 New Data 50 */ + uint32_t ND51:1; /*!< bit: 19 New Data 51 */ + uint32_t ND52:1; /*!< bit: 20 New Data 52 */ + uint32_t ND53:1; /*!< bit: 21 New Data 53 */ + uint32_t ND54:1; /*!< bit: 22 New Data 54 */ + uint32_t ND55:1; /*!< bit: 23 New Data 55 */ + uint32_t ND56:1; /*!< bit: 24 New Data 56 */ + uint32_t ND57:1; /*!< bit: 25 New Data 57 */ + uint32_t ND58:1; /*!< bit: 26 New Data 58 */ + uint32_t ND59:1; /*!< bit: 27 New Data 59 */ + uint32_t ND60:1; /*!< bit: 28 New Data 60 */ + uint32_t ND61:1; /*!< bit: 29 New Data 61 */ + uint32_t ND62:1; /*!< bit: 30 New Data 62 */ + uint32_t ND63:1; /*!< bit: 31 New Data 63 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_NDAT2_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_NDAT2_OFFSET 0x9C /**< \brief (CAN_NDAT2 offset) New Data 2 */ +#define CAN_NDAT2_RESETVALUE 0x00000000u /**< \brief (CAN_NDAT2 reset_value) New Data 2 */ + +#define CAN_NDAT2_ND32_Pos 0 /**< \brief (CAN_NDAT2) New Data 32 */ +#define CAN_NDAT2_ND32 (0x1u << CAN_NDAT2_ND32_Pos) +#define CAN_NDAT2_ND33_Pos 1 /**< \brief (CAN_NDAT2) New Data 33 */ +#define CAN_NDAT2_ND33 (0x1u << CAN_NDAT2_ND33_Pos) +#define CAN_NDAT2_ND34_Pos 2 /**< \brief (CAN_NDAT2) New Data 34 */ +#define CAN_NDAT2_ND34 (0x1u << CAN_NDAT2_ND34_Pos) +#define CAN_NDAT2_ND35_Pos 3 /**< \brief (CAN_NDAT2) New Data 35 */ +#define CAN_NDAT2_ND35 (0x1u << CAN_NDAT2_ND35_Pos) +#define CAN_NDAT2_ND36_Pos 4 /**< \brief (CAN_NDAT2) New Data 36 */ +#define CAN_NDAT2_ND36 (0x1u << CAN_NDAT2_ND36_Pos) +#define CAN_NDAT2_ND37_Pos 5 /**< \brief (CAN_NDAT2) New Data 37 */ +#define CAN_NDAT2_ND37 (0x1u << CAN_NDAT2_ND37_Pos) +#define CAN_NDAT2_ND38_Pos 6 /**< \brief (CAN_NDAT2) New Data 38 */ +#define CAN_NDAT2_ND38 (0x1u << CAN_NDAT2_ND38_Pos) +#define CAN_NDAT2_ND39_Pos 7 /**< \brief (CAN_NDAT2) New Data 39 */ +#define CAN_NDAT2_ND39 (0x1u << CAN_NDAT2_ND39_Pos) +#define CAN_NDAT2_ND40_Pos 8 /**< \brief (CAN_NDAT2) New Data 40 */ +#define CAN_NDAT2_ND40 (0x1u << CAN_NDAT2_ND40_Pos) +#define CAN_NDAT2_ND41_Pos 9 /**< \brief (CAN_NDAT2) New Data 41 */ +#define CAN_NDAT2_ND41 (0x1u << CAN_NDAT2_ND41_Pos) +#define CAN_NDAT2_ND42_Pos 10 /**< \brief (CAN_NDAT2) New Data 42 */ +#define CAN_NDAT2_ND42 (0x1u << CAN_NDAT2_ND42_Pos) +#define CAN_NDAT2_ND43_Pos 11 /**< \brief (CAN_NDAT2) New Data 43 */ +#define CAN_NDAT2_ND43 (0x1u << CAN_NDAT2_ND43_Pos) +#define CAN_NDAT2_ND44_Pos 12 /**< \brief (CAN_NDAT2) New Data 44 */ +#define CAN_NDAT2_ND44 (0x1u << CAN_NDAT2_ND44_Pos) +#define CAN_NDAT2_ND45_Pos 13 /**< \brief (CAN_NDAT2) New Data 45 */ +#define CAN_NDAT2_ND45 (0x1u << CAN_NDAT2_ND45_Pos) +#define CAN_NDAT2_ND46_Pos 14 /**< \brief (CAN_NDAT2) New Data 46 */ +#define CAN_NDAT2_ND46 (0x1u << CAN_NDAT2_ND46_Pos) +#define CAN_NDAT2_ND47_Pos 15 /**< \brief (CAN_NDAT2) New Data 47 */ +#define CAN_NDAT2_ND47 (0x1u << CAN_NDAT2_ND47_Pos) +#define CAN_NDAT2_ND48_Pos 16 /**< \brief (CAN_NDAT2) New Data 48 */ +#define CAN_NDAT2_ND48 (0x1u << CAN_NDAT2_ND48_Pos) +#define CAN_NDAT2_ND49_Pos 17 /**< \brief (CAN_NDAT2) New Data 49 */ +#define CAN_NDAT2_ND49 (0x1u << CAN_NDAT2_ND49_Pos) +#define CAN_NDAT2_ND50_Pos 18 /**< \brief (CAN_NDAT2) New Data 50 */ +#define CAN_NDAT2_ND50 (0x1u << CAN_NDAT2_ND50_Pos) +#define CAN_NDAT2_ND51_Pos 19 /**< \brief (CAN_NDAT2) New Data 51 */ +#define CAN_NDAT2_ND51 (0x1u << CAN_NDAT2_ND51_Pos) +#define CAN_NDAT2_ND52_Pos 20 /**< \brief (CAN_NDAT2) New Data 52 */ +#define CAN_NDAT2_ND52 (0x1u << CAN_NDAT2_ND52_Pos) +#define CAN_NDAT2_ND53_Pos 21 /**< \brief (CAN_NDAT2) New Data 53 */ +#define CAN_NDAT2_ND53 (0x1u << CAN_NDAT2_ND53_Pos) +#define CAN_NDAT2_ND54_Pos 22 /**< \brief (CAN_NDAT2) New Data 54 */ +#define CAN_NDAT2_ND54 (0x1u << CAN_NDAT2_ND54_Pos) +#define CAN_NDAT2_ND55_Pos 23 /**< \brief (CAN_NDAT2) New Data 55 */ +#define CAN_NDAT2_ND55 (0x1u << CAN_NDAT2_ND55_Pos) +#define CAN_NDAT2_ND56_Pos 24 /**< \brief (CAN_NDAT2) New Data 56 */ +#define CAN_NDAT2_ND56 (0x1u << CAN_NDAT2_ND56_Pos) +#define CAN_NDAT2_ND57_Pos 25 /**< \brief (CAN_NDAT2) New Data 57 */ +#define CAN_NDAT2_ND57 (0x1u << CAN_NDAT2_ND57_Pos) +#define CAN_NDAT2_ND58_Pos 26 /**< \brief (CAN_NDAT2) New Data 58 */ +#define CAN_NDAT2_ND58 (0x1u << CAN_NDAT2_ND58_Pos) +#define CAN_NDAT2_ND59_Pos 27 /**< \brief (CAN_NDAT2) New Data 59 */ +#define CAN_NDAT2_ND59 (0x1u << CAN_NDAT2_ND59_Pos) +#define CAN_NDAT2_ND60_Pos 28 /**< \brief (CAN_NDAT2) New Data 60 */ +#define CAN_NDAT2_ND60 (0x1u << CAN_NDAT2_ND60_Pos) +#define CAN_NDAT2_ND61_Pos 29 /**< \brief (CAN_NDAT2) New Data 61 */ +#define CAN_NDAT2_ND61 (0x1u << CAN_NDAT2_ND61_Pos) +#define CAN_NDAT2_ND62_Pos 30 /**< \brief (CAN_NDAT2) New Data 62 */ +#define CAN_NDAT2_ND62 (0x1u << CAN_NDAT2_ND62_Pos) +#define CAN_NDAT2_ND63_Pos 31 /**< \brief (CAN_NDAT2) New Data 63 */ +#define CAN_NDAT2_ND63 (0x1u << CAN_NDAT2_ND63_Pos) +#define CAN_NDAT2_MASK 0xFFFFFFFFu /**< \brief (CAN_NDAT2) MASK Register */ + +/* -------- CAN_RXF0C : (CAN Offset: 0xA0) (R/W 32) Rx FIFO 0 Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F0SA:16; /*!< bit: 0..15 Rx FIFO 0 Start Address */ + uint32_t F0S:7; /*!< bit: 16..22 Rx FIFO 0 Size */ + uint32_t :1; /*!< bit: 23 Reserved */ + uint32_t F0WM:7; /*!< bit: 24..30 Rx FIFO 0 Watermark */ + uint32_t F0OM:1; /*!< bit: 31 FIFO 0 Operation Mode */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0C_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0C_OFFSET 0xA0 /**< \brief (CAN_RXF0C offset) Rx FIFO 0 Configuration */ +#define CAN_RXF0C_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0C reset_value) Rx FIFO 0 Configuration */ + +#define CAN_RXF0C_F0SA_Pos 0 /**< \brief (CAN_RXF0C) Rx FIFO 0 Start Address */ +#define CAN_RXF0C_F0SA_Msk (0xFFFFu << CAN_RXF0C_F0SA_Pos) +#define CAN_RXF0C_F0SA(value) (CAN_RXF0C_F0SA_Msk & ((value) << CAN_RXF0C_F0SA_Pos)) +#define CAN_RXF0C_F0S_Pos 16 /**< \brief (CAN_RXF0C) Rx FIFO 0 Size */ +#define CAN_RXF0C_F0S_Msk (0x7Fu << CAN_RXF0C_F0S_Pos) +#define CAN_RXF0C_F0S(value) (CAN_RXF0C_F0S_Msk & ((value) << CAN_RXF0C_F0S_Pos)) +#define CAN_RXF0C_F0WM_Pos 24 /**< \brief (CAN_RXF0C) Rx FIFO 0 Watermark */ +#define CAN_RXF0C_F0WM_Msk (0x7Fu << CAN_RXF0C_F0WM_Pos) +#define CAN_RXF0C_F0WM(value) (CAN_RXF0C_F0WM_Msk & ((value) << CAN_RXF0C_F0WM_Pos)) +#define CAN_RXF0C_F0OM_Pos 31 /**< \brief (CAN_RXF0C) FIFO 0 Operation Mode */ +#define CAN_RXF0C_F0OM (0x1u << CAN_RXF0C_F0OM_Pos) +#define CAN_RXF0C_MASK 0xFF7FFFFFu /**< \brief (CAN_RXF0C) MASK Register */ + +/* -------- CAN_RXF0S : (CAN Offset: 0xA4) (R/ 32) Rx FIFO 0 Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F0FL:7; /*!< bit: 0.. 6 Rx FIFO 0 Fill Level */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t F0GI:6; /*!< bit: 8..13 Rx FIFO 0 Get Index */ + uint32_t :2; /*!< bit: 14..15 Reserved */ + uint32_t F0PI:6; /*!< bit: 16..21 Rx FIFO 0 Put Index */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t F0F:1; /*!< bit: 24 Rx FIFO 0 Full */ + uint32_t RF0L:1; /*!< bit: 25 Rx FIFO 0 Message Lost */ + uint32_t :6; /*!< bit: 26..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0S_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0S_OFFSET 0xA4 /**< \brief (CAN_RXF0S offset) Rx FIFO 0 Status */ +#define CAN_RXF0S_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0S reset_value) Rx FIFO 0 Status */ + +#define CAN_RXF0S_F0FL_Pos 0 /**< \brief (CAN_RXF0S) Rx FIFO 0 Fill Level */ +#define CAN_RXF0S_F0FL_Msk (0x7Fu << CAN_RXF0S_F0FL_Pos) +#define CAN_RXF0S_F0FL(value) (CAN_RXF0S_F0FL_Msk & ((value) << CAN_RXF0S_F0FL_Pos)) +#define CAN_RXF0S_F0GI_Pos 8 /**< \brief (CAN_RXF0S) Rx FIFO 0 Get Index */ +#define CAN_RXF0S_F0GI_Msk (0x3Fu << CAN_RXF0S_F0GI_Pos) +#define CAN_RXF0S_F0GI(value) (CAN_RXF0S_F0GI_Msk & ((value) << CAN_RXF0S_F0GI_Pos)) +#define CAN_RXF0S_F0PI_Pos 16 /**< \brief (CAN_RXF0S) Rx FIFO 0 Put Index */ +#define CAN_RXF0S_F0PI_Msk (0x3Fu << CAN_RXF0S_F0PI_Pos) +#define CAN_RXF0S_F0PI(value) (CAN_RXF0S_F0PI_Msk & ((value) << CAN_RXF0S_F0PI_Pos)) +#define CAN_RXF0S_F0F_Pos 24 /**< \brief (CAN_RXF0S) Rx FIFO 0 Full */ +#define CAN_RXF0S_F0F (0x1u << CAN_RXF0S_F0F_Pos) +#define CAN_RXF0S_RF0L_Pos 25 /**< \brief (CAN_RXF0S) Rx FIFO 0 Message Lost */ +#define CAN_RXF0S_RF0L (0x1u << CAN_RXF0S_RF0L_Pos) +#define CAN_RXF0S_MASK 0x033F3F7Fu /**< \brief (CAN_RXF0S) MASK Register */ + +/* -------- CAN_RXF0A : (CAN Offset: 0xA8) (R/W 32) Rx FIFO 0 Acknowledge -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F0AI:6; /*!< bit: 0.. 5 Rx FIFO 0 Acknowledge Index */ + uint32_t :26; /*!< bit: 6..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0A_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0A_OFFSET 0xA8 /**< \brief (CAN_RXF0A offset) Rx FIFO 0 Acknowledge */ +#define CAN_RXF0A_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0A reset_value) Rx FIFO 0 Acknowledge */ + +#define CAN_RXF0A_F0AI_Pos 0 /**< \brief (CAN_RXF0A) Rx FIFO 0 Acknowledge Index */ +#define CAN_RXF0A_F0AI_Msk (0x3Fu << CAN_RXF0A_F0AI_Pos) +#define CAN_RXF0A_F0AI(value) (CAN_RXF0A_F0AI_Msk & ((value) << CAN_RXF0A_F0AI_Pos)) +#define CAN_RXF0A_MASK 0x0000003Fu /**< \brief (CAN_RXF0A) MASK Register */ + +/* -------- CAN_RXBC : (CAN Offset: 0xAC) (R/W 32) Rx Buffer Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RBSA:16; /*!< bit: 0..15 Rx Buffer Start Address */ + uint32_t :16; /*!< bit: 16..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXBC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXBC_OFFSET 0xAC /**< \brief (CAN_RXBC offset) Rx Buffer Configuration */ +#define CAN_RXBC_RESETVALUE 0x00000000u /**< \brief (CAN_RXBC reset_value) Rx Buffer Configuration */ + +#define CAN_RXBC_RBSA_Pos 0 /**< \brief (CAN_RXBC) Rx Buffer Start Address */ +#define CAN_RXBC_RBSA_Msk (0xFFFFu << CAN_RXBC_RBSA_Pos) +#define CAN_RXBC_RBSA(value) (CAN_RXBC_RBSA_Msk & ((value) << CAN_RXBC_RBSA_Pos)) +#define CAN_RXBC_MASK 0x0000FFFFu /**< \brief (CAN_RXBC) MASK Register */ + +/* -------- CAN_RXF1C : (CAN Offset: 0xB0) (R/W 32) Rx FIFO 1 Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F1SA:16; /*!< bit: 0..15 Rx FIFO 1 Start Address */ + uint32_t F1S:7; /*!< bit: 16..22 Rx FIFO 1 Size */ + uint32_t :1; /*!< bit: 23 Reserved */ + uint32_t F1WM:7; /*!< bit: 24..30 Rx FIFO 1 Watermark */ + uint32_t F1OM:1; /*!< bit: 31 FIFO 1 Operation Mode */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1C_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1C_OFFSET 0xB0 /**< \brief (CAN_RXF1C offset) Rx FIFO 1 Configuration */ +#define CAN_RXF1C_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1C reset_value) Rx FIFO 1 Configuration */ + +#define CAN_RXF1C_F1SA_Pos 0 /**< \brief (CAN_RXF1C) Rx FIFO 1 Start Address */ +#define CAN_RXF1C_F1SA_Msk (0xFFFFu << CAN_RXF1C_F1SA_Pos) +#define CAN_RXF1C_F1SA(value) (CAN_RXF1C_F1SA_Msk & ((value) << CAN_RXF1C_F1SA_Pos)) +#define CAN_RXF1C_F1S_Pos 16 /**< \brief (CAN_RXF1C) Rx FIFO 1 Size */ +#define CAN_RXF1C_F1S_Msk (0x7Fu << CAN_RXF1C_F1S_Pos) +#define CAN_RXF1C_F1S(value) (CAN_RXF1C_F1S_Msk & ((value) << CAN_RXF1C_F1S_Pos)) +#define CAN_RXF1C_F1WM_Pos 24 /**< \brief (CAN_RXF1C) Rx FIFO 1 Watermark */ +#define CAN_RXF1C_F1WM_Msk (0x7Fu << CAN_RXF1C_F1WM_Pos) +#define CAN_RXF1C_F1WM(value) (CAN_RXF1C_F1WM_Msk & ((value) << CAN_RXF1C_F1WM_Pos)) +#define CAN_RXF1C_F1OM_Pos 31 /**< \brief (CAN_RXF1C) FIFO 1 Operation Mode */ +#define CAN_RXF1C_F1OM (0x1u << CAN_RXF1C_F1OM_Pos) +#define CAN_RXF1C_MASK 0xFF7FFFFFu /**< \brief (CAN_RXF1C) MASK Register */ + +/* -------- CAN_RXF1S : (CAN Offset: 0xB4) (R/ 32) Rx FIFO 1 Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F1FL:7; /*!< bit: 0.. 6 Rx FIFO 1 Fill Level */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t F1GI:6; /*!< bit: 8..13 Rx FIFO 1 Get Index */ + uint32_t :2; /*!< bit: 14..15 Reserved */ + uint32_t F1PI:6; /*!< bit: 16..21 Rx FIFO 1 Put Index */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t F1F:1; /*!< bit: 24 Rx FIFO 1 Full */ + uint32_t RF1L:1; /*!< bit: 25 Rx FIFO 1 Message Lost */ + uint32_t :4; /*!< bit: 26..29 Reserved */ + uint32_t DMS:2; /*!< bit: 30..31 Debug Message Status */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1S_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1S_OFFSET 0xB4 /**< \brief (CAN_RXF1S offset) Rx FIFO 1 Status */ +#define CAN_RXF1S_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1S reset_value) Rx FIFO 1 Status */ + +#define CAN_RXF1S_F1FL_Pos 0 /**< \brief (CAN_RXF1S) Rx FIFO 1 Fill Level */ +#define CAN_RXF1S_F1FL_Msk (0x7Fu << CAN_RXF1S_F1FL_Pos) +#define CAN_RXF1S_F1FL(value) (CAN_RXF1S_F1FL_Msk & ((value) << CAN_RXF1S_F1FL_Pos)) +#define CAN_RXF1S_F1GI_Pos 8 /**< \brief (CAN_RXF1S) Rx FIFO 1 Get Index */ +#define CAN_RXF1S_F1GI_Msk (0x3Fu << CAN_RXF1S_F1GI_Pos) +#define CAN_RXF1S_F1GI(value) (CAN_RXF1S_F1GI_Msk & ((value) << CAN_RXF1S_F1GI_Pos)) +#define CAN_RXF1S_F1PI_Pos 16 /**< \brief (CAN_RXF1S) Rx FIFO 1 Put Index */ +#define CAN_RXF1S_F1PI_Msk (0x3Fu << CAN_RXF1S_F1PI_Pos) +#define CAN_RXF1S_F1PI(value) (CAN_RXF1S_F1PI_Msk & ((value) << CAN_RXF1S_F1PI_Pos)) +#define CAN_RXF1S_F1F_Pos 24 /**< \brief (CAN_RXF1S) Rx FIFO 1 Full */ +#define CAN_RXF1S_F1F (0x1u << CAN_RXF1S_F1F_Pos) +#define CAN_RXF1S_RF1L_Pos 25 /**< \brief (CAN_RXF1S) Rx FIFO 1 Message Lost */ +#define CAN_RXF1S_RF1L (0x1u << CAN_RXF1S_RF1L_Pos) +#define CAN_RXF1S_DMS_Pos 30 /**< \brief (CAN_RXF1S) Debug Message Status */ +#define CAN_RXF1S_DMS_Msk (0x3u << CAN_RXF1S_DMS_Pos) +#define CAN_RXF1S_DMS(value) (CAN_RXF1S_DMS_Msk & ((value) << CAN_RXF1S_DMS_Pos)) +#define CAN_RXF1S_DMS_IDLE_Val 0x0u /**< \brief (CAN_RXF1S) Idle state */ +#define CAN_RXF1S_DMS_DBGA_Val 0x1u /**< \brief (CAN_RXF1S) Debug message A received */ +#define CAN_RXF1S_DMS_DBGB_Val 0x2u /**< \brief (CAN_RXF1S) Debug message A/B received */ +#define CAN_RXF1S_DMS_DBGC_Val 0x3u /**< \brief (CAN_RXF1S) Debug message A/B/C received, DMA request set */ +#define CAN_RXF1S_DMS_IDLE (CAN_RXF1S_DMS_IDLE_Val << CAN_RXF1S_DMS_Pos) +#define CAN_RXF1S_DMS_DBGA (CAN_RXF1S_DMS_DBGA_Val << CAN_RXF1S_DMS_Pos) +#define CAN_RXF1S_DMS_DBGB (CAN_RXF1S_DMS_DBGB_Val << CAN_RXF1S_DMS_Pos) +#define CAN_RXF1S_DMS_DBGC (CAN_RXF1S_DMS_DBGC_Val << CAN_RXF1S_DMS_Pos) +#define CAN_RXF1S_MASK 0xC33F3F7Fu /**< \brief (CAN_RXF1S) MASK Register */ + +/* -------- CAN_RXF1A : (CAN Offset: 0xB8) (R/W 32) Rx FIFO 1 Acknowledge -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F1AI:6; /*!< bit: 0.. 5 Rx FIFO 1 Acknowledge Index */ + uint32_t :26; /*!< bit: 6..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1A_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1A_OFFSET 0xB8 /**< \brief (CAN_RXF1A offset) Rx FIFO 1 Acknowledge */ +#define CAN_RXF1A_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1A reset_value) Rx FIFO 1 Acknowledge */ + +#define CAN_RXF1A_F1AI_Pos 0 /**< \brief (CAN_RXF1A) Rx FIFO 1 Acknowledge Index */ +#define CAN_RXF1A_F1AI_Msk (0x3Fu << CAN_RXF1A_F1AI_Pos) +#define CAN_RXF1A_F1AI(value) (CAN_RXF1A_F1AI_Msk & ((value) << CAN_RXF1A_F1AI_Pos)) +#define CAN_RXF1A_MASK 0x0000003Fu /**< \brief (CAN_RXF1A) MASK Register */ + +/* -------- CAN_RXESC : (CAN Offset: 0xBC) (R/W 32) Rx Buffer / FIFO Element Size Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t F0DS:3; /*!< bit: 0.. 2 Rx FIFO 0 Data Field Size */ + uint32_t :1; /*!< bit: 3 Reserved */ + uint32_t F1DS:3; /*!< bit: 4.. 6 Rx FIFO 1 Data Field Size */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t RBDS:3; /*!< bit: 8..10 Rx Buffer Data Field Size */ + uint32_t :21; /*!< bit: 11..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXESC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXESC_OFFSET 0xBC /**< \brief (CAN_RXESC offset) Rx Buffer / FIFO Element Size Configuration */ +#define CAN_RXESC_RESETVALUE 0x00000000u /**< \brief (CAN_RXESC reset_value) Rx Buffer / FIFO Element Size Configuration */ + +#define CAN_RXESC_F0DS_Pos 0 /**< \brief (CAN_RXESC) Rx FIFO 0 Data Field Size */ +#define CAN_RXESC_F0DS_Msk (0x7u << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS(value) (CAN_RXESC_F0DS_Msk & ((value) << CAN_RXESC_F0DS_Pos)) +#define CAN_RXESC_F0DS_DATA8_Val 0x0u /**< \brief (CAN_RXESC) 8 byte data field */ +#define CAN_RXESC_F0DS_DATA12_Val 0x1u /**< \brief (CAN_RXESC) 12 byte data field */ +#define CAN_RXESC_F0DS_DATA16_Val 0x2u /**< \brief (CAN_RXESC) 16 byte data field */ +#define CAN_RXESC_F0DS_DATA20_Val 0x3u /**< \brief (CAN_RXESC) 20 byte data field */ +#define CAN_RXESC_F0DS_DATA24_Val 0x4u /**< \brief (CAN_RXESC) 24 byte data field */ +#define CAN_RXESC_F0DS_DATA32_Val 0x5u /**< \brief (CAN_RXESC) 32 byte data field */ +#define CAN_RXESC_F0DS_DATA48_Val 0x6u /**< \brief (CAN_RXESC) 48 byte data field */ +#define CAN_RXESC_F0DS_DATA64_Val 0x7u /**< \brief (CAN_RXESC) 64 byte data field */ +#define CAN_RXESC_F0DS_DATA8 (CAN_RXESC_F0DS_DATA8_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA12 (CAN_RXESC_F0DS_DATA12_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA16 (CAN_RXESC_F0DS_DATA16_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA20 (CAN_RXESC_F0DS_DATA20_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA24 (CAN_RXESC_F0DS_DATA24_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA32 (CAN_RXESC_F0DS_DATA32_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA48 (CAN_RXESC_F0DS_DATA48_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F0DS_DATA64 (CAN_RXESC_F0DS_DATA64_Val << CAN_RXESC_F0DS_Pos) +#define CAN_RXESC_F1DS_Pos 4 /**< \brief (CAN_RXESC) Rx FIFO 1 Data Field Size */ +#define CAN_RXESC_F1DS_Msk (0x7u << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS(value) (CAN_RXESC_F1DS_Msk & ((value) << CAN_RXESC_F1DS_Pos)) +#define CAN_RXESC_F1DS_DATA8_Val 0x0u /**< \brief (CAN_RXESC) 8 byte data field */ +#define CAN_RXESC_F1DS_DATA12_Val 0x1u /**< \brief (CAN_RXESC) 12 byte data field */ +#define CAN_RXESC_F1DS_DATA16_Val 0x2u /**< \brief (CAN_RXESC) 16 byte data field */ +#define CAN_RXESC_F1DS_DATA20_Val 0x3u /**< \brief (CAN_RXESC) 20 byte data field */ +#define CAN_RXESC_F1DS_DATA24_Val 0x4u /**< \brief (CAN_RXESC) 24 byte data field */ +#define CAN_RXESC_F1DS_DATA32_Val 0x5u /**< \brief (CAN_RXESC) 32 byte data field */ +#define CAN_RXESC_F1DS_DATA48_Val 0x6u /**< \brief (CAN_RXESC) 48 byte data field */ +#define CAN_RXESC_F1DS_DATA64_Val 0x7u /**< \brief (CAN_RXESC) 64 byte data field */ +#define CAN_RXESC_F1DS_DATA8 (CAN_RXESC_F1DS_DATA8_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA12 (CAN_RXESC_F1DS_DATA12_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA16 (CAN_RXESC_F1DS_DATA16_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA20 (CAN_RXESC_F1DS_DATA20_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA24 (CAN_RXESC_F1DS_DATA24_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA32 (CAN_RXESC_F1DS_DATA32_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA48 (CAN_RXESC_F1DS_DATA48_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_F1DS_DATA64 (CAN_RXESC_F1DS_DATA64_Val << CAN_RXESC_F1DS_Pos) +#define CAN_RXESC_RBDS_Pos 8 /**< \brief (CAN_RXESC) Rx Buffer Data Field Size */ +#define CAN_RXESC_RBDS_Msk (0x7u << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS(value) (CAN_RXESC_RBDS_Msk & ((value) << CAN_RXESC_RBDS_Pos)) +#define CAN_RXESC_RBDS_DATA8_Val 0x0u /**< \brief (CAN_RXESC) 8 byte data field */ +#define CAN_RXESC_RBDS_DATA12_Val 0x1u /**< \brief (CAN_RXESC) 12 byte data field */ +#define CAN_RXESC_RBDS_DATA16_Val 0x2u /**< \brief (CAN_RXESC) 16 byte data field */ +#define CAN_RXESC_RBDS_DATA20_Val 0x3u /**< \brief (CAN_RXESC) 20 byte data field */ +#define CAN_RXESC_RBDS_DATA24_Val 0x4u /**< \brief (CAN_RXESC) 24 byte data field */ +#define CAN_RXESC_RBDS_DATA32_Val 0x5u /**< \brief (CAN_RXESC) 32 byte data field */ +#define CAN_RXESC_RBDS_DATA48_Val 0x6u /**< \brief (CAN_RXESC) 48 byte data field */ +#define CAN_RXESC_RBDS_DATA64_Val 0x7u /**< \brief (CAN_RXESC) 64 byte data field */ +#define CAN_RXESC_RBDS_DATA8 (CAN_RXESC_RBDS_DATA8_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA12 (CAN_RXESC_RBDS_DATA12_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA16 (CAN_RXESC_RBDS_DATA16_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA20 (CAN_RXESC_RBDS_DATA20_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA24 (CAN_RXESC_RBDS_DATA24_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA32 (CAN_RXESC_RBDS_DATA32_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA48 (CAN_RXESC_RBDS_DATA48_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_RBDS_DATA64 (CAN_RXESC_RBDS_DATA64_Val << CAN_RXESC_RBDS_Pos) +#define CAN_RXESC_MASK 0x00000777u /**< \brief (CAN_RXESC) MASK Register */ + +/* -------- CAN_TXBC : (CAN Offset: 0xC0) (R/W 32) Tx Buffer Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TBSA:16; /*!< bit: 0..15 Tx Buffers Start Address */ + uint32_t NDTB:6; /*!< bit: 16..21 Number of Dedicated Transmit Buffers */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t TFQS:6; /*!< bit: 24..29 Transmit FIFO/Queue Size */ + uint32_t TFQM:1; /*!< bit: 30 Tx FIFO/Queue Mode */ + uint32_t :1; /*!< bit: 31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBC_OFFSET 0xC0 /**< \brief (CAN_TXBC offset) Tx Buffer Configuration */ +#define CAN_TXBC_RESETVALUE 0x00000000u /**< \brief (CAN_TXBC reset_value) Tx Buffer Configuration */ + +#define CAN_TXBC_TBSA_Pos 0 /**< \brief (CAN_TXBC) Tx Buffers Start Address */ +#define CAN_TXBC_TBSA_Msk (0xFFFFu << CAN_TXBC_TBSA_Pos) +#define CAN_TXBC_TBSA(value) (CAN_TXBC_TBSA_Msk & ((value) << CAN_TXBC_TBSA_Pos)) +#define CAN_TXBC_NDTB_Pos 16 /**< \brief (CAN_TXBC) Number of Dedicated Transmit Buffers */ +#define CAN_TXBC_NDTB_Msk (0x3Fu << CAN_TXBC_NDTB_Pos) +#define CAN_TXBC_NDTB(value) (CAN_TXBC_NDTB_Msk & ((value) << CAN_TXBC_NDTB_Pos)) +#define CAN_TXBC_TFQS_Pos 24 /**< \brief (CAN_TXBC) Transmit FIFO/Queue Size */ +#define CAN_TXBC_TFQS_Msk (0x3Fu << CAN_TXBC_TFQS_Pos) +#define CAN_TXBC_TFQS(value) (CAN_TXBC_TFQS_Msk & ((value) << CAN_TXBC_TFQS_Pos)) +#define CAN_TXBC_TFQM_Pos 30 /**< \brief (CAN_TXBC) Tx FIFO/Queue Mode */ +#define CAN_TXBC_TFQM (0x1u << CAN_TXBC_TFQM_Pos) +#define CAN_TXBC_MASK 0x7F3FFFFFu /**< \brief (CAN_TXBC) MASK Register */ + +/* -------- CAN_TXFQS : (CAN Offset: 0xC4) (R/ 32) Tx FIFO / Queue Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TFFL:6; /*!< bit: 0.. 5 Tx FIFO Free Level */ + uint32_t :2; /*!< bit: 6.. 7 Reserved */ + uint32_t TFGI:5; /*!< bit: 8..12 Tx FIFO Get Index */ + uint32_t :3; /*!< bit: 13..15 Reserved */ + uint32_t TFQPI:5; /*!< bit: 16..20 Tx FIFO/Queue Put Index */ + uint32_t TFQF:1; /*!< bit: 21 Tx FIFO/Queue Full */ + uint32_t :10; /*!< bit: 22..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXFQS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXFQS_OFFSET 0xC4 /**< \brief (CAN_TXFQS offset) Tx FIFO / Queue Status */ +#define CAN_TXFQS_RESETVALUE 0x00000000u /**< \brief (CAN_TXFQS reset_value) Tx FIFO / Queue Status */ + +#define CAN_TXFQS_TFFL_Pos 0 /**< \brief (CAN_TXFQS) Tx FIFO Free Level */ +#define CAN_TXFQS_TFFL_Msk (0x3Fu << CAN_TXFQS_TFFL_Pos) +#define CAN_TXFQS_TFFL(value) (CAN_TXFQS_TFFL_Msk & ((value) << CAN_TXFQS_TFFL_Pos)) +#define CAN_TXFQS_TFGI_Pos 8 /**< \brief (CAN_TXFQS) Tx FIFO Get Index */ +#define CAN_TXFQS_TFGI_Msk (0x1Fu << CAN_TXFQS_TFGI_Pos) +#define CAN_TXFQS_TFGI(value) (CAN_TXFQS_TFGI_Msk & ((value) << CAN_TXFQS_TFGI_Pos)) +#define CAN_TXFQS_TFQPI_Pos 16 /**< \brief (CAN_TXFQS) Tx FIFO/Queue Put Index */ +#define CAN_TXFQS_TFQPI_Msk (0x1Fu << CAN_TXFQS_TFQPI_Pos) +#define CAN_TXFQS_TFQPI(value) (CAN_TXFQS_TFQPI_Msk & ((value) << CAN_TXFQS_TFQPI_Pos)) +#define CAN_TXFQS_TFQF_Pos 21 /**< \brief (CAN_TXFQS) Tx FIFO/Queue Full */ +#define CAN_TXFQS_TFQF (0x1u << CAN_TXFQS_TFQF_Pos) +#define CAN_TXFQS_MASK 0x003F1F3Fu /**< \brief (CAN_TXFQS) MASK Register */ + +/* -------- CAN_TXESC : (CAN Offset: 0xC8) (R/W 32) Tx Buffer Element Size Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TBDS:3; /*!< bit: 0.. 2 Tx Buffer Data Field Size */ + uint32_t :29; /*!< bit: 3..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXESC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXESC_OFFSET 0xC8 /**< \brief (CAN_TXESC offset) Tx Buffer Element Size Configuration */ +#define CAN_TXESC_RESETVALUE 0x00000000u /**< \brief (CAN_TXESC reset_value) Tx Buffer Element Size Configuration */ + +#define CAN_TXESC_TBDS_Pos 0 /**< \brief (CAN_TXESC) Tx Buffer Data Field Size */ +#define CAN_TXESC_TBDS_Msk (0x7u << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS(value) (CAN_TXESC_TBDS_Msk & ((value) << CAN_TXESC_TBDS_Pos)) +#define CAN_TXESC_TBDS_DATA8_Val 0x0u /**< \brief (CAN_TXESC) 8 byte data field */ +#define CAN_TXESC_TBDS_DATA12_Val 0x1u /**< \brief (CAN_TXESC) 12 byte data field */ +#define CAN_TXESC_TBDS_DATA16_Val 0x2u /**< \brief (CAN_TXESC) 16 byte data field */ +#define CAN_TXESC_TBDS_DATA20_Val 0x3u /**< \brief (CAN_TXESC) 20 byte data field */ +#define CAN_TXESC_TBDS_DATA24_Val 0x4u /**< \brief (CAN_TXESC) 24 byte data field */ +#define CAN_TXESC_TBDS_DATA32_Val 0x5u /**< \brief (CAN_TXESC) 32 byte data field */ +#define CAN_TXESC_TBDS_DATA48_Val 0x6u /**< \brief (CAN_TXESC) 48 byte data field */ +#define CAN_TXESC_TBDS_DATA64_Val 0x7u /**< \brief (CAN_TXESC) 64 byte data field */ +#define CAN_TXESC_TBDS_DATA8 (CAN_TXESC_TBDS_DATA8_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA12 (CAN_TXESC_TBDS_DATA12_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA16 (CAN_TXESC_TBDS_DATA16_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA20 (CAN_TXESC_TBDS_DATA20_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA24 (CAN_TXESC_TBDS_DATA24_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA32 (CAN_TXESC_TBDS_DATA32_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA48 (CAN_TXESC_TBDS_DATA48_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_TBDS_DATA64 (CAN_TXESC_TBDS_DATA64_Val << CAN_TXESC_TBDS_Pos) +#define CAN_TXESC_MASK 0x00000007u /**< \brief (CAN_TXESC) MASK Register */ + +/* -------- CAN_TXBRP : (CAN Offset: 0xCC) (R/ 32) Tx Buffer Request Pending -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TRP0:1; /*!< bit: 0 Transmission Request Pending 0 */ + uint32_t TRP1:1; /*!< bit: 1 Transmission Request Pending 1 */ + uint32_t TRP2:1; /*!< bit: 2 Transmission Request Pending 2 */ + uint32_t TRP3:1; /*!< bit: 3 Transmission Request Pending 3 */ + uint32_t TRP4:1; /*!< bit: 4 Transmission Request Pending 4 */ + uint32_t TRP5:1; /*!< bit: 5 Transmission Request Pending 5 */ + uint32_t TRP6:1; /*!< bit: 6 Transmission Request Pending 6 */ + uint32_t TRP7:1; /*!< bit: 7 Transmission Request Pending 7 */ + uint32_t TRP8:1; /*!< bit: 8 Transmission Request Pending 8 */ + uint32_t TRP9:1; /*!< bit: 9 Transmission Request Pending 9 */ + uint32_t TRP10:1; /*!< bit: 10 Transmission Request Pending 10 */ + uint32_t TRP11:1; /*!< bit: 11 Transmission Request Pending 11 */ + uint32_t TRP12:1; /*!< bit: 12 Transmission Request Pending 12 */ + uint32_t TRP13:1; /*!< bit: 13 Transmission Request Pending 13 */ + uint32_t TRP14:1; /*!< bit: 14 Transmission Request Pending 14 */ + uint32_t TRP15:1; /*!< bit: 15 Transmission Request Pending 15 */ + uint32_t TRP16:1; /*!< bit: 16 Transmission Request Pending 16 */ + uint32_t TRP17:1; /*!< bit: 17 Transmission Request Pending 17 */ + uint32_t TRP18:1; /*!< bit: 18 Transmission Request Pending 18 */ + uint32_t TRP19:1; /*!< bit: 19 Transmission Request Pending 19 */ + uint32_t TRP20:1; /*!< bit: 20 Transmission Request Pending 20 */ + uint32_t TRP21:1; /*!< bit: 21 Transmission Request Pending 21 */ + uint32_t TRP22:1; /*!< bit: 22 Transmission Request Pending 22 */ + uint32_t TRP23:1; /*!< bit: 23 Transmission Request Pending 23 */ + uint32_t TRP24:1; /*!< bit: 24 Transmission Request Pending 24 */ + uint32_t TRP25:1; /*!< bit: 25 Transmission Request Pending 25 */ + uint32_t TRP26:1; /*!< bit: 26 Transmission Request Pending 26 */ + uint32_t TRP27:1; /*!< bit: 27 Transmission Request Pending 27 */ + uint32_t TRP28:1; /*!< bit: 28 Transmission Request Pending 28 */ + uint32_t TRP29:1; /*!< bit: 29 Transmission Request Pending 29 */ + uint32_t TRP30:1; /*!< bit: 30 Transmission Request Pending 30 */ + uint32_t TRP31:1; /*!< bit: 31 Transmission Request Pending 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBRP_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBRP_OFFSET 0xCC /**< \brief (CAN_TXBRP offset) Tx Buffer Request Pending */ +#define CAN_TXBRP_RESETVALUE 0x00000000u /**< \brief (CAN_TXBRP reset_value) Tx Buffer Request Pending */ + +#define CAN_TXBRP_TRP0_Pos 0 /**< \brief (CAN_TXBRP) Transmission Request Pending 0 */ +#define CAN_TXBRP_TRP0 (0x1u << CAN_TXBRP_TRP0_Pos) +#define CAN_TXBRP_TRP1_Pos 1 /**< \brief (CAN_TXBRP) Transmission Request Pending 1 */ +#define CAN_TXBRP_TRP1 (0x1u << CAN_TXBRP_TRP1_Pos) +#define CAN_TXBRP_TRP2_Pos 2 /**< \brief (CAN_TXBRP) Transmission Request Pending 2 */ +#define CAN_TXBRP_TRP2 (0x1u << CAN_TXBRP_TRP2_Pos) +#define CAN_TXBRP_TRP3_Pos 3 /**< \brief (CAN_TXBRP) Transmission Request Pending 3 */ +#define CAN_TXBRP_TRP3 (0x1u << CAN_TXBRP_TRP3_Pos) +#define CAN_TXBRP_TRP4_Pos 4 /**< \brief (CAN_TXBRP) Transmission Request Pending 4 */ +#define CAN_TXBRP_TRP4 (0x1u << CAN_TXBRP_TRP4_Pos) +#define CAN_TXBRP_TRP5_Pos 5 /**< \brief (CAN_TXBRP) Transmission Request Pending 5 */ +#define CAN_TXBRP_TRP5 (0x1u << CAN_TXBRP_TRP5_Pos) +#define CAN_TXBRP_TRP6_Pos 6 /**< \brief (CAN_TXBRP) Transmission Request Pending 6 */ +#define CAN_TXBRP_TRP6 (0x1u << CAN_TXBRP_TRP6_Pos) +#define CAN_TXBRP_TRP7_Pos 7 /**< \brief (CAN_TXBRP) Transmission Request Pending 7 */ +#define CAN_TXBRP_TRP7 (0x1u << CAN_TXBRP_TRP7_Pos) +#define CAN_TXBRP_TRP8_Pos 8 /**< \brief (CAN_TXBRP) Transmission Request Pending 8 */ +#define CAN_TXBRP_TRP8 (0x1u << CAN_TXBRP_TRP8_Pos) +#define CAN_TXBRP_TRP9_Pos 9 /**< \brief (CAN_TXBRP) Transmission Request Pending 9 */ +#define CAN_TXBRP_TRP9 (0x1u << CAN_TXBRP_TRP9_Pos) +#define CAN_TXBRP_TRP10_Pos 10 /**< \brief (CAN_TXBRP) Transmission Request Pending 10 */ +#define CAN_TXBRP_TRP10 (0x1u << CAN_TXBRP_TRP10_Pos) +#define CAN_TXBRP_TRP11_Pos 11 /**< \brief (CAN_TXBRP) Transmission Request Pending 11 */ +#define CAN_TXBRP_TRP11 (0x1u << CAN_TXBRP_TRP11_Pos) +#define CAN_TXBRP_TRP12_Pos 12 /**< \brief (CAN_TXBRP) Transmission Request Pending 12 */ +#define CAN_TXBRP_TRP12 (0x1u << CAN_TXBRP_TRP12_Pos) +#define CAN_TXBRP_TRP13_Pos 13 /**< \brief (CAN_TXBRP) Transmission Request Pending 13 */ +#define CAN_TXBRP_TRP13 (0x1u << CAN_TXBRP_TRP13_Pos) +#define CAN_TXBRP_TRP14_Pos 14 /**< \brief (CAN_TXBRP) Transmission Request Pending 14 */ +#define CAN_TXBRP_TRP14 (0x1u << CAN_TXBRP_TRP14_Pos) +#define CAN_TXBRP_TRP15_Pos 15 /**< \brief (CAN_TXBRP) Transmission Request Pending 15 */ +#define CAN_TXBRP_TRP15 (0x1u << CAN_TXBRP_TRP15_Pos) +#define CAN_TXBRP_TRP16_Pos 16 /**< \brief (CAN_TXBRP) Transmission Request Pending 16 */ +#define CAN_TXBRP_TRP16 (0x1u << CAN_TXBRP_TRP16_Pos) +#define CAN_TXBRP_TRP17_Pos 17 /**< \brief (CAN_TXBRP) Transmission Request Pending 17 */ +#define CAN_TXBRP_TRP17 (0x1u << CAN_TXBRP_TRP17_Pos) +#define CAN_TXBRP_TRP18_Pos 18 /**< \brief (CAN_TXBRP) Transmission Request Pending 18 */ +#define CAN_TXBRP_TRP18 (0x1u << CAN_TXBRP_TRP18_Pos) +#define CAN_TXBRP_TRP19_Pos 19 /**< \brief (CAN_TXBRP) Transmission Request Pending 19 */ +#define CAN_TXBRP_TRP19 (0x1u << CAN_TXBRP_TRP19_Pos) +#define CAN_TXBRP_TRP20_Pos 20 /**< \brief (CAN_TXBRP) Transmission Request Pending 20 */ +#define CAN_TXBRP_TRP20 (0x1u << CAN_TXBRP_TRP20_Pos) +#define CAN_TXBRP_TRP21_Pos 21 /**< \brief (CAN_TXBRP) Transmission Request Pending 21 */ +#define CAN_TXBRP_TRP21 (0x1u << CAN_TXBRP_TRP21_Pos) +#define CAN_TXBRP_TRP22_Pos 22 /**< \brief (CAN_TXBRP) Transmission Request Pending 22 */ +#define CAN_TXBRP_TRP22 (0x1u << CAN_TXBRP_TRP22_Pos) +#define CAN_TXBRP_TRP23_Pos 23 /**< \brief (CAN_TXBRP) Transmission Request Pending 23 */ +#define CAN_TXBRP_TRP23 (0x1u << CAN_TXBRP_TRP23_Pos) +#define CAN_TXBRP_TRP24_Pos 24 /**< \brief (CAN_TXBRP) Transmission Request Pending 24 */ +#define CAN_TXBRP_TRP24 (0x1u << CAN_TXBRP_TRP24_Pos) +#define CAN_TXBRP_TRP25_Pos 25 /**< \brief (CAN_TXBRP) Transmission Request Pending 25 */ +#define CAN_TXBRP_TRP25 (0x1u << CAN_TXBRP_TRP25_Pos) +#define CAN_TXBRP_TRP26_Pos 26 /**< \brief (CAN_TXBRP) Transmission Request Pending 26 */ +#define CAN_TXBRP_TRP26 (0x1u << CAN_TXBRP_TRP26_Pos) +#define CAN_TXBRP_TRP27_Pos 27 /**< \brief (CAN_TXBRP) Transmission Request Pending 27 */ +#define CAN_TXBRP_TRP27 (0x1u << CAN_TXBRP_TRP27_Pos) +#define CAN_TXBRP_TRP28_Pos 28 /**< \brief (CAN_TXBRP) Transmission Request Pending 28 */ +#define CAN_TXBRP_TRP28 (0x1u << CAN_TXBRP_TRP28_Pos) +#define CAN_TXBRP_TRP29_Pos 29 /**< \brief (CAN_TXBRP) Transmission Request Pending 29 */ +#define CAN_TXBRP_TRP29 (0x1u << CAN_TXBRP_TRP29_Pos) +#define CAN_TXBRP_TRP30_Pos 30 /**< \brief (CAN_TXBRP) Transmission Request Pending 30 */ +#define CAN_TXBRP_TRP30 (0x1u << CAN_TXBRP_TRP30_Pos) +#define CAN_TXBRP_TRP31_Pos 31 /**< \brief (CAN_TXBRP) Transmission Request Pending 31 */ +#define CAN_TXBRP_TRP31 (0x1u << CAN_TXBRP_TRP31_Pos) +#define CAN_TXBRP_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBRP) MASK Register */ + +/* -------- CAN_TXBAR : (CAN Offset: 0xD0) (R/W 32) Tx Buffer Add Request -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t AR0:1; /*!< bit: 0 Add Request 0 */ + uint32_t AR1:1; /*!< bit: 1 Add Request 1 */ + uint32_t AR2:1; /*!< bit: 2 Add Request 2 */ + uint32_t AR3:1; /*!< bit: 3 Add Request 3 */ + uint32_t AR4:1; /*!< bit: 4 Add Request 4 */ + uint32_t AR5:1; /*!< bit: 5 Add Request 5 */ + uint32_t AR6:1; /*!< bit: 6 Add Request 6 */ + uint32_t AR7:1; /*!< bit: 7 Add Request 7 */ + uint32_t AR8:1; /*!< bit: 8 Add Request 8 */ + uint32_t AR9:1; /*!< bit: 9 Add Request 9 */ + uint32_t AR10:1; /*!< bit: 10 Add Request 10 */ + uint32_t AR11:1; /*!< bit: 11 Add Request 11 */ + uint32_t AR12:1; /*!< bit: 12 Add Request 12 */ + uint32_t AR13:1; /*!< bit: 13 Add Request 13 */ + uint32_t AR14:1; /*!< bit: 14 Add Request 14 */ + uint32_t AR15:1; /*!< bit: 15 Add Request 15 */ + uint32_t AR16:1; /*!< bit: 16 Add Request 16 */ + uint32_t AR17:1; /*!< bit: 17 Add Request 17 */ + uint32_t AR18:1; /*!< bit: 18 Add Request 18 */ + uint32_t AR19:1; /*!< bit: 19 Add Request 19 */ + uint32_t AR20:1; /*!< bit: 20 Add Request 20 */ + uint32_t AR21:1; /*!< bit: 21 Add Request 21 */ + uint32_t AR22:1; /*!< bit: 22 Add Request 22 */ + uint32_t AR23:1; /*!< bit: 23 Add Request 23 */ + uint32_t AR24:1; /*!< bit: 24 Add Request 24 */ + uint32_t AR25:1; /*!< bit: 25 Add Request 25 */ + uint32_t AR26:1; /*!< bit: 26 Add Request 26 */ + uint32_t AR27:1; /*!< bit: 27 Add Request 27 */ + uint32_t AR28:1; /*!< bit: 28 Add Request 28 */ + uint32_t AR29:1; /*!< bit: 29 Add Request 29 */ + uint32_t AR30:1; /*!< bit: 30 Add Request 30 */ + uint32_t AR31:1; /*!< bit: 31 Add Request 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBAR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBAR_OFFSET 0xD0 /**< \brief (CAN_TXBAR offset) Tx Buffer Add Request */ +#define CAN_TXBAR_RESETVALUE 0x00000000u /**< \brief (CAN_TXBAR reset_value) Tx Buffer Add Request */ + +#define CAN_TXBAR_AR0_Pos 0 /**< \brief (CAN_TXBAR) Add Request 0 */ +#define CAN_TXBAR_AR0 (0x1u << CAN_TXBAR_AR0_Pos) +#define CAN_TXBAR_AR1_Pos 1 /**< \brief (CAN_TXBAR) Add Request 1 */ +#define CAN_TXBAR_AR1 (0x1u << CAN_TXBAR_AR1_Pos) +#define CAN_TXBAR_AR2_Pos 2 /**< \brief (CAN_TXBAR) Add Request 2 */ +#define CAN_TXBAR_AR2 (0x1u << CAN_TXBAR_AR2_Pos) +#define CAN_TXBAR_AR3_Pos 3 /**< \brief (CAN_TXBAR) Add Request 3 */ +#define CAN_TXBAR_AR3 (0x1u << CAN_TXBAR_AR3_Pos) +#define CAN_TXBAR_AR4_Pos 4 /**< \brief (CAN_TXBAR) Add Request 4 */ +#define CAN_TXBAR_AR4 (0x1u << CAN_TXBAR_AR4_Pos) +#define CAN_TXBAR_AR5_Pos 5 /**< \brief (CAN_TXBAR) Add Request 5 */ +#define CAN_TXBAR_AR5 (0x1u << CAN_TXBAR_AR5_Pos) +#define CAN_TXBAR_AR6_Pos 6 /**< \brief (CAN_TXBAR) Add Request 6 */ +#define CAN_TXBAR_AR6 (0x1u << CAN_TXBAR_AR6_Pos) +#define CAN_TXBAR_AR7_Pos 7 /**< \brief (CAN_TXBAR) Add Request 7 */ +#define CAN_TXBAR_AR7 (0x1u << CAN_TXBAR_AR7_Pos) +#define CAN_TXBAR_AR8_Pos 8 /**< \brief (CAN_TXBAR) Add Request 8 */ +#define CAN_TXBAR_AR8 (0x1u << CAN_TXBAR_AR8_Pos) +#define CAN_TXBAR_AR9_Pos 9 /**< \brief (CAN_TXBAR) Add Request 9 */ +#define CAN_TXBAR_AR9 (0x1u << CAN_TXBAR_AR9_Pos) +#define CAN_TXBAR_AR10_Pos 10 /**< \brief (CAN_TXBAR) Add Request 10 */ +#define CAN_TXBAR_AR10 (0x1u << CAN_TXBAR_AR10_Pos) +#define CAN_TXBAR_AR11_Pos 11 /**< \brief (CAN_TXBAR) Add Request 11 */ +#define CAN_TXBAR_AR11 (0x1u << CAN_TXBAR_AR11_Pos) +#define CAN_TXBAR_AR12_Pos 12 /**< \brief (CAN_TXBAR) Add Request 12 */ +#define CAN_TXBAR_AR12 (0x1u << CAN_TXBAR_AR12_Pos) +#define CAN_TXBAR_AR13_Pos 13 /**< \brief (CAN_TXBAR) Add Request 13 */ +#define CAN_TXBAR_AR13 (0x1u << CAN_TXBAR_AR13_Pos) +#define CAN_TXBAR_AR14_Pos 14 /**< \brief (CAN_TXBAR) Add Request 14 */ +#define CAN_TXBAR_AR14 (0x1u << CAN_TXBAR_AR14_Pos) +#define CAN_TXBAR_AR15_Pos 15 /**< \brief (CAN_TXBAR) Add Request 15 */ +#define CAN_TXBAR_AR15 (0x1u << CAN_TXBAR_AR15_Pos) +#define CAN_TXBAR_AR16_Pos 16 /**< \brief (CAN_TXBAR) Add Request 16 */ +#define CAN_TXBAR_AR16 (0x1u << CAN_TXBAR_AR16_Pos) +#define CAN_TXBAR_AR17_Pos 17 /**< \brief (CAN_TXBAR) Add Request 17 */ +#define CAN_TXBAR_AR17 (0x1u << CAN_TXBAR_AR17_Pos) +#define CAN_TXBAR_AR18_Pos 18 /**< \brief (CAN_TXBAR) Add Request 18 */ +#define CAN_TXBAR_AR18 (0x1u << CAN_TXBAR_AR18_Pos) +#define CAN_TXBAR_AR19_Pos 19 /**< \brief (CAN_TXBAR) Add Request 19 */ +#define CAN_TXBAR_AR19 (0x1u << CAN_TXBAR_AR19_Pos) +#define CAN_TXBAR_AR20_Pos 20 /**< \brief (CAN_TXBAR) Add Request 20 */ +#define CAN_TXBAR_AR20 (0x1u << CAN_TXBAR_AR20_Pos) +#define CAN_TXBAR_AR21_Pos 21 /**< \brief (CAN_TXBAR) Add Request 21 */ +#define CAN_TXBAR_AR21 (0x1u << CAN_TXBAR_AR21_Pos) +#define CAN_TXBAR_AR22_Pos 22 /**< \brief (CAN_TXBAR) Add Request 22 */ +#define CAN_TXBAR_AR22 (0x1u << CAN_TXBAR_AR22_Pos) +#define CAN_TXBAR_AR23_Pos 23 /**< \brief (CAN_TXBAR) Add Request 23 */ +#define CAN_TXBAR_AR23 (0x1u << CAN_TXBAR_AR23_Pos) +#define CAN_TXBAR_AR24_Pos 24 /**< \brief (CAN_TXBAR) Add Request 24 */ +#define CAN_TXBAR_AR24 (0x1u << CAN_TXBAR_AR24_Pos) +#define CAN_TXBAR_AR25_Pos 25 /**< \brief (CAN_TXBAR) Add Request 25 */ +#define CAN_TXBAR_AR25 (0x1u << CAN_TXBAR_AR25_Pos) +#define CAN_TXBAR_AR26_Pos 26 /**< \brief (CAN_TXBAR) Add Request 26 */ +#define CAN_TXBAR_AR26 (0x1u << CAN_TXBAR_AR26_Pos) +#define CAN_TXBAR_AR27_Pos 27 /**< \brief (CAN_TXBAR) Add Request 27 */ +#define CAN_TXBAR_AR27 (0x1u << CAN_TXBAR_AR27_Pos) +#define CAN_TXBAR_AR28_Pos 28 /**< \brief (CAN_TXBAR) Add Request 28 */ +#define CAN_TXBAR_AR28 (0x1u << CAN_TXBAR_AR28_Pos) +#define CAN_TXBAR_AR29_Pos 29 /**< \brief (CAN_TXBAR) Add Request 29 */ +#define CAN_TXBAR_AR29 (0x1u << CAN_TXBAR_AR29_Pos) +#define CAN_TXBAR_AR30_Pos 30 /**< \brief (CAN_TXBAR) Add Request 30 */ +#define CAN_TXBAR_AR30 (0x1u << CAN_TXBAR_AR30_Pos) +#define CAN_TXBAR_AR31_Pos 31 /**< \brief (CAN_TXBAR) Add Request 31 */ +#define CAN_TXBAR_AR31 (0x1u << CAN_TXBAR_AR31_Pos) +#define CAN_TXBAR_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBAR) MASK Register */ + +/* -------- CAN_TXBCR : (CAN Offset: 0xD4) (R/W 32) Tx Buffer Cancellation Request -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CR0:1; /*!< bit: 0 Cancellation Request 0 */ + uint32_t CR1:1; /*!< bit: 1 Cancellation Request 1 */ + uint32_t CR2:1; /*!< bit: 2 Cancellation Request 2 */ + uint32_t CR3:1; /*!< bit: 3 Cancellation Request 3 */ + uint32_t CR4:1; /*!< bit: 4 Cancellation Request 4 */ + uint32_t CR5:1; /*!< bit: 5 Cancellation Request 5 */ + uint32_t CR6:1; /*!< bit: 6 Cancellation Request 6 */ + uint32_t CR7:1; /*!< bit: 7 Cancellation Request 7 */ + uint32_t CR8:1; /*!< bit: 8 Cancellation Request 8 */ + uint32_t CR9:1; /*!< bit: 9 Cancellation Request 9 */ + uint32_t CR10:1; /*!< bit: 10 Cancellation Request 10 */ + uint32_t CR11:1; /*!< bit: 11 Cancellation Request 11 */ + uint32_t CR12:1; /*!< bit: 12 Cancellation Request 12 */ + uint32_t CR13:1; /*!< bit: 13 Cancellation Request 13 */ + uint32_t CR14:1; /*!< bit: 14 Cancellation Request 14 */ + uint32_t CR15:1; /*!< bit: 15 Cancellation Request 15 */ + uint32_t CR16:1; /*!< bit: 16 Cancellation Request 16 */ + uint32_t CR17:1; /*!< bit: 17 Cancellation Request 17 */ + uint32_t CR18:1; /*!< bit: 18 Cancellation Request 18 */ + uint32_t CR19:1; /*!< bit: 19 Cancellation Request 19 */ + uint32_t CR20:1; /*!< bit: 20 Cancellation Request 20 */ + uint32_t CR21:1; /*!< bit: 21 Cancellation Request 21 */ + uint32_t CR22:1; /*!< bit: 22 Cancellation Request 22 */ + uint32_t CR23:1; /*!< bit: 23 Cancellation Request 23 */ + uint32_t CR24:1; /*!< bit: 24 Cancellation Request 24 */ + uint32_t CR25:1; /*!< bit: 25 Cancellation Request 25 */ + uint32_t CR26:1; /*!< bit: 26 Cancellation Request 26 */ + uint32_t CR27:1; /*!< bit: 27 Cancellation Request 27 */ + uint32_t CR28:1; /*!< bit: 28 Cancellation Request 28 */ + uint32_t CR29:1; /*!< bit: 29 Cancellation Request 29 */ + uint32_t CR30:1; /*!< bit: 30 Cancellation Request 30 */ + uint32_t CR31:1; /*!< bit: 31 Cancellation Request 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBCR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBCR_OFFSET 0xD4 /**< \brief (CAN_TXBCR offset) Tx Buffer Cancellation Request */ +#define CAN_TXBCR_RESETVALUE 0x00000000u /**< \brief (CAN_TXBCR reset_value) Tx Buffer Cancellation Request */ + +#define CAN_TXBCR_CR0_Pos 0 /**< \brief (CAN_TXBCR) Cancellation Request 0 */ +#define CAN_TXBCR_CR0 (0x1u << CAN_TXBCR_CR0_Pos) +#define CAN_TXBCR_CR1_Pos 1 /**< \brief (CAN_TXBCR) Cancellation Request 1 */ +#define CAN_TXBCR_CR1 (0x1u << CAN_TXBCR_CR1_Pos) +#define CAN_TXBCR_CR2_Pos 2 /**< \brief (CAN_TXBCR) Cancellation Request 2 */ +#define CAN_TXBCR_CR2 (0x1u << CAN_TXBCR_CR2_Pos) +#define CAN_TXBCR_CR3_Pos 3 /**< \brief (CAN_TXBCR) Cancellation Request 3 */ +#define CAN_TXBCR_CR3 (0x1u << CAN_TXBCR_CR3_Pos) +#define CAN_TXBCR_CR4_Pos 4 /**< \brief (CAN_TXBCR) Cancellation Request 4 */ +#define CAN_TXBCR_CR4 (0x1u << CAN_TXBCR_CR4_Pos) +#define CAN_TXBCR_CR5_Pos 5 /**< \brief (CAN_TXBCR) Cancellation Request 5 */ +#define CAN_TXBCR_CR5 (0x1u << CAN_TXBCR_CR5_Pos) +#define CAN_TXBCR_CR6_Pos 6 /**< \brief (CAN_TXBCR) Cancellation Request 6 */ +#define CAN_TXBCR_CR6 (0x1u << CAN_TXBCR_CR6_Pos) +#define CAN_TXBCR_CR7_Pos 7 /**< \brief (CAN_TXBCR) Cancellation Request 7 */ +#define CAN_TXBCR_CR7 (0x1u << CAN_TXBCR_CR7_Pos) +#define CAN_TXBCR_CR8_Pos 8 /**< \brief (CAN_TXBCR) Cancellation Request 8 */ +#define CAN_TXBCR_CR8 (0x1u << CAN_TXBCR_CR8_Pos) +#define CAN_TXBCR_CR9_Pos 9 /**< \brief (CAN_TXBCR) Cancellation Request 9 */ +#define CAN_TXBCR_CR9 (0x1u << CAN_TXBCR_CR9_Pos) +#define CAN_TXBCR_CR10_Pos 10 /**< \brief (CAN_TXBCR) Cancellation Request 10 */ +#define CAN_TXBCR_CR10 (0x1u << CAN_TXBCR_CR10_Pos) +#define CAN_TXBCR_CR11_Pos 11 /**< \brief (CAN_TXBCR) Cancellation Request 11 */ +#define CAN_TXBCR_CR11 (0x1u << CAN_TXBCR_CR11_Pos) +#define CAN_TXBCR_CR12_Pos 12 /**< \brief (CAN_TXBCR) Cancellation Request 12 */ +#define CAN_TXBCR_CR12 (0x1u << CAN_TXBCR_CR12_Pos) +#define CAN_TXBCR_CR13_Pos 13 /**< \brief (CAN_TXBCR) Cancellation Request 13 */ +#define CAN_TXBCR_CR13 (0x1u << CAN_TXBCR_CR13_Pos) +#define CAN_TXBCR_CR14_Pos 14 /**< \brief (CAN_TXBCR) Cancellation Request 14 */ +#define CAN_TXBCR_CR14 (0x1u << CAN_TXBCR_CR14_Pos) +#define CAN_TXBCR_CR15_Pos 15 /**< \brief (CAN_TXBCR) Cancellation Request 15 */ +#define CAN_TXBCR_CR15 (0x1u << CAN_TXBCR_CR15_Pos) +#define CAN_TXBCR_CR16_Pos 16 /**< \brief (CAN_TXBCR) Cancellation Request 16 */ +#define CAN_TXBCR_CR16 (0x1u << CAN_TXBCR_CR16_Pos) +#define CAN_TXBCR_CR17_Pos 17 /**< \brief (CAN_TXBCR) Cancellation Request 17 */ +#define CAN_TXBCR_CR17 (0x1u << CAN_TXBCR_CR17_Pos) +#define CAN_TXBCR_CR18_Pos 18 /**< \brief (CAN_TXBCR) Cancellation Request 18 */ +#define CAN_TXBCR_CR18 (0x1u << CAN_TXBCR_CR18_Pos) +#define CAN_TXBCR_CR19_Pos 19 /**< \brief (CAN_TXBCR) Cancellation Request 19 */ +#define CAN_TXBCR_CR19 (0x1u << CAN_TXBCR_CR19_Pos) +#define CAN_TXBCR_CR20_Pos 20 /**< \brief (CAN_TXBCR) Cancellation Request 20 */ +#define CAN_TXBCR_CR20 (0x1u << CAN_TXBCR_CR20_Pos) +#define CAN_TXBCR_CR21_Pos 21 /**< \brief (CAN_TXBCR) Cancellation Request 21 */ +#define CAN_TXBCR_CR21 (0x1u << CAN_TXBCR_CR21_Pos) +#define CAN_TXBCR_CR22_Pos 22 /**< \brief (CAN_TXBCR) Cancellation Request 22 */ +#define CAN_TXBCR_CR22 (0x1u << CAN_TXBCR_CR22_Pos) +#define CAN_TXBCR_CR23_Pos 23 /**< \brief (CAN_TXBCR) Cancellation Request 23 */ +#define CAN_TXBCR_CR23 (0x1u << CAN_TXBCR_CR23_Pos) +#define CAN_TXBCR_CR24_Pos 24 /**< \brief (CAN_TXBCR) Cancellation Request 24 */ +#define CAN_TXBCR_CR24 (0x1u << CAN_TXBCR_CR24_Pos) +#define CAN_TXBCR_CR25_Pos 25 /**< \brief (CAN_TXBCR) Cancellation Request 25 */ +#define CAN_TXBCR_CR25 (0x1u << CAN_TXBCR_CR25_Pos) +#define CAN_TXBCR_CR26_Pos 26 /**< \brief (CAN_TXBCR) Cancellation Request 26 */ +#define CAN_TXBCR_CR26 (0x1u << CAN_TXBCR_CR26_Pos) +#define CAN_TXBCR_CR27_Pos 27 /**< \brief (CAN_TXBCR) Cancellation Request 27 */ +#define CAN_TXBCR_CR27 (0x1u << CAN_TXBCR_CR27_Pos) +#define CAN_TXBCR_CR28_Pos 28 /**< \brief (CAN_TXBCR) Cancellation Request 28 */ +#define CAN_TXBCR_CR28 (0x1u << CAN_TXBCR_CR28_Pos) +#define CAN_TXBCR_CR29_Pos 29 /**< \brief (CAN_TXBCR) Cancellation Request 29 */ +#define CAN_TXBCR_CR29 (0x1u << CAN_TXBCR_CR29_Pos) +#define CAN_TXBCR_CR30_Pos 30 /**< \brief (CAN_TXBCR) Cancellation Request 30 */ +#define CAN_TXBCR_CR30 (0x1u << CAN_TXBCR_CR30_Pos) +#define CAN_TXBCR_CR31_Pos 31 /**< \brief (CAN_TXBCR) Cancellation Request 31 */ +#define CAN_TXBCR_CR31 (0x1u << CAN_TXBCR_CR31_Pos) +#define CAN_TXBCR_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBCR) MASK Register */ + +/* -------- CAN_TXBTO : (CAN Offset: 0xD8) (R/ 32) Tx Buffer Transmission Occurred -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TO0:1; /*!< bit: 0 Transmission Occurred 0 */ + uint32_t TO1:1; /*!< bit: 1 Transmission Occurred 1 */ + uint32_t TO2:1; /*!< bit: 2 Transmission Occurred 2 */ + uint32_t TO3:1; /*!< bit: 3 Transmission Occurred 3 */ + uint32_t TO4:1; /*!< bit: 4 Transmission Occurred 4 */ + uint32_t TO5:1; /*!< bit: 5 Transmission Occurred 5 */ + uint32_t TO6:1; /*!< bit: 6 Transmission Occurred 6 */ + uint32_t TO7:1; /*!< bit: 7 Transmission Occurred 7 */ + uint32_t TO8:1; /*!< bit: 8 Transmission Occurred 8 */ + uint32_t TO9:1; /*!< bit: 9 Transmission Occurred 9 */ + uint32_t TO10:1; /*!< bit: 10 Transmission Occurred 10 */ + uint32_t TO11:1; /*!< bit: 11 Transmission Occurred 11 */ + uint32_t TO12:1; /*!< bit: 12 Transmission Occurred 12 */ + uint32_t TO13:1; /*!< bit: 13 Transmission Occurred 13 */ + uint32_t TO14:1; /*!< bit: 14 Transmission Occurred 14 */ + uint32_t TO15:1; /*!< bit: 15 Transmission Occurred 15 */ + uint32_t TO16:1; /*!< bit: 16 Transmission Occurred 16 */ + uint32_t TO17:1; /*!< bit: 17 Transmission Occurred 17 */ + uint32_t TO18:1; /*!< bit: 18 Transmission Occurred 18 */ + uint32_t TO19:1; /*!< bit: 19 Transmission Occurred 19 */ + uint32_t TO20:1; /*!< bit: 20 Transmission Occurred 20 */ + uint32_t TO21:1; /*!< bit: 21 Transmission Occurred 21 */ + uint32_t TO22:1; /*!< bit: 22 Transmission Occurred 22 */ + uint32_t TO23:1; /*!< bit: 23 Transmission Occurred 23 */ + uint32_t TO24:1; /*!< bit: 24 Transmission Occurred 24 */ + uint32_t TO25:1; /*!< bit: 25 Transmission Occurred 25 */ + uint32_t TO26:1; /*!< bit: 26 Transmission Occurred 26 */ + uint32_t TO27:1; /*!< bit: 27 Transmission Occurred 27 */ + uint32_t TO28:1; /*!< bit: 28 Transmission Occurred 28 */ + uint32_t TO29:1; /*!< bit: 29 Transmission Occurred 29 */ + uint32_t TO30:1; /*!< bit: 30 Transmission Occurred 30 */ + uint32_t TO31:1; /*!< bit: 31 Transmission Occurred 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBTO_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBTO_OFFSET 0xD8 /**< \brief (CAN_TXBTO offset) Tx Buffer Transmission Occurred */ +#define CAN_TXBTO_RESETVALUE 0x00000000u /**< \brief (CAN_TXBTO reset_value) Tx Buffer Transmission Occurred */ + +#define CAN_TXBTO_TO0_Pos 0 /**< \brief (CAN_TXBTO) Transmission Occurred 0 */ +#define CAN_TXBTO_TO0 (0x1u << CAN_TXBTO_TO0_Pos) +#define CAN_TXBTO_TO1_Pos 1 /**< \brief (CAN_TXBTO) Transmission Occurred 1 */ +#define CAN_TXBTO_TO1 (0x1u << CAN_TXBTO_TO1_Pos) +#define CAN_TXBTO_TO2_Pos 2 /**< \brief (CAN_TXBTO) Transmission Occurred 2 */ +#define CAN_TXBTO_TO2 (0x1u << CAN_TXBTO_TO2_Pos) +#define CAN_TXBTO_TO3_Pos 3 /**< \brief (CAN_TXBTO) Transmission Occurred 3 */ +#define CAN_TXBTO_TO3 (0x1u << CAN_TXBTO_TO3_Pos) +#define CAN_TXBTO_TO4_Pos 4 /**< \brief (CAN_TXBTO) Transmission Occurred 4 */ +#define CAN_TXBTO_TO4 (0x1u << CAN_TXBTO_TO4_Pos) +#define CAN_TXBTO_TO5_Pos 5 /**< \brief (CAN_TXBTO) Transmission Occurred 5 */ +#define CAN_TXBTO_TO5 (0x1u << CAN_TXBTO_TO5_Pos) +#define CAN_TXBTO_TO6_Pos 6 /**< \brief (CAN_TXBTO) Transmission Occurred 6 */ +#define CAN_TXBTO_TO6 (0x1u << CAN_TXBTO_TO6_Pos) +#define CAN_TXBTO_TO7_Pos 7 /**< \brief (CAN_TXBTO) Transmission Occurred 7 */ +#define CAN_TXBTO_TO7 (0x1u << CAN_TXBTO_TO7_Pos) +#define CAN_TXBTO_TO8_Pos 8 /**< \brief (CAN_TXBTO) Transmission Occurred 8 */ +#define CAN_TXBTO_TO8 (0x1u << CAN_TXBTO_TO8_Pos) +#define CAN_TXBTO_TO9_Pos 9 /**< \brief (CAN_TXBTO) Transmission Occurred 9 */ +#define CAN_TXBTO_TO9 (0x1u << CAN_TXBTO_TO9_Pos) +#define CAN_TXBTO_TO10_Pos 10 /**< \brief (CAN_TXBTO) Transmission Occurred 10 */ +#define CAN_TXBTO_TO10 (0x1u << CAN_TXBTO_TO10_Pos) +#define CAN_TXBTO_TO11_Pos 11 /**< \brief (CAN_TXBTO) Transmission Occurred 11 */ +#define CAN_TXBTO_TO11 (0x1u << CAN_TXBTO_TO11_Pos) +#define CAN_TXBTO_TO12_Pos 12 /**< \brief (CAN_TXBTO) Transmission Occurred 12 */ +#define CAN_TXBTO_TO12 (0x1u << CAN_TXBTO_TO12_Pos) +#define CAN_TXBTO_TO13_Pos 13 /**< \brief (CAN_TXBTO) Transmission Occurred 13 */ +#define CAN_TXBTO_TO13 (0x1u << CAN_TXBTO_TO13_Pos) +#define CAN_TXBTO_TO14_Pos 14 /**< \brief (CAN_TXBTO) Transmission Occurred 14 */ +#define CAN_TXBTO_TO14 (0x1u << CAN_TXBTO_TO14_Pos) +#define CAN_TXBTO_TO15_Pos 15 /**< \brief (CAN_TXBTO) Transmission Occurred 15 */ +#define CAN_TXBTO_TO15 (0x1u << CAN_TXBTO_TO15_Pos) +#define CAN_TXBTO_TO16_Pos 16 /**< \brief (CAN_TXBTO) Transmission Occurred 16 */ +#define CAN_TXBTO_TO16 (0x1u << CAN_TXBTO_TO16_Pos) +#define CAN_TXBTO_TO17_Pos 17 /**< \brief (CAN_TXBTO) Transmission Occurred 17 */ +#define CAN_TXBTO_TO17 (0x1u << CAN_TXBTO_TO17_Pos) +#define CAN_TXBTO_TO18_Pos 18 /**< \brief (CAN_TXBTO) Transmission Occurred 18 */ +#define CAN_TXBTO_TO18 (0x1u << CAN_TXBTO_TO18_Pos) +#define CAN_TXBTO_TO19_Pos 19 /**< \brief (CAN_TXBTO) Transmission Occurred 19 */ +#define CAN_TXBTO_TO19 (0x1u << CAN_TXBTO_TO19_Pos) +#define CAN_TXBTO_TO20_Pos 20 /**< \brief (CAN_TXBTO) Transmission Occurred 20 */ +#define CAN_TXBTO_TO20 (0x1u << CAN_TXBTO_TO20_Pos) +#define CAN_TXBTO_TO21_Pos 21 /**< \brief (CAN_TXBTO) Transmission Occurred 21 */ +#define CAN_TXBTO_TO21 (0x1u << CAN_TXBTO_TO21_Pos) +#define CAN_TXBTO_TO22_Pos 22 /**< \brief (CAN_TXBTO) Transmission Occurred 22 */ +#define CAN_TXBTO_TO22 (0x1u << CAN_TXBTO_TO22_Pos) +#define CAN_TXBTO_TO23_Pos 23 /**< \brief (CAN_TXBTO) Transmission Occurred 23 */ +#define CAN_TXBTO_TO23 (0x1u << CAN_TXBTO_TO23_Pos) +#define CAN_TXBTO_TO24_Pos 24 /**< \brief (CAN_TXBTO) Transmission Occurred 24 */ +#define CAN_TXBTO_TO24 (0x1u << CAN_TXBTO_TO24_Pos) +#define CAN_TXBTO_TO25_Pos 25 /**< \brief (CAN_TXBTO) Transmission Occurred 25 */ +#define CAN_TXBTO_TO25 (0x1u << CAN_TXBTO_TO25_Pos) +#define CAN_TXBTO_TO26_Pos 26 /**< \brief (CAN_TXBTO) Transmission Occurred 26 */ +#define CAN_TXBTO_TO26 (0x1u << CAN_TXBTO_TO26_Pos) +#define CAN_TXBTO_TO27_Pos 27 /**< \brief (CAN_TXBTO) Transmission Occurred 27 */ +#define CAN_TXBTO_TO27 (0x1u << CAN_TXBTO_TO27_Pos) +#define CAN_TXBTO_TO28_Pos 28 /**< \brief (CAN_TXBTO) Transmission Occurred 28 */ +#define CAN_TXBTO_TO28 (0x1u << CAN_TXBTO_TO28_Pos) +#define CAN_TXBTO_TO29_Pos 29 /**< \brief (CAN_TXBTO) Transmission Occurred 29 */ +#define CAN_TXBTO_TO29 (0x1u << CAN_TXBTO_TO29_Pos) +#define CAN_TXBTO_TO30_Pos 30 /**< \brief (CAN_TXBTO) Transmission Occurred 30 */ +#define CAN_TXBTO_TO30 (0x1u << CAN_TXBTO_TO30_Pos) +#define CAN_TXBTO_TO31_Pos 31 /**< \brief (CAN_TXBTO) Transmission Occurred 31 */ +#define CAN_TXBTO_TO31 (0x1u << CAN_TXBTO_TO31_Pos) +#define CAN_TXBTO_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBTO) MASK Register */ + +/* -------- CAN_TXBCF : (CAN Offset: 0xDC) (R/ 32) Tx Buffer Cancellation Finished -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CF0:1; /*!< bit: 0 Tx Buffer Cancellation Finished 0 */ + uint32_t CF1:1; /*!< bit: 1 Tx Buffer Cancellation Finished 1 */ + uint32_t CF2:1; /*!< bit: 2 Tx Buffer Cancellation Finished 2 */ + uint32_t CF3:1; /*!< bit: 3 Tx Buffer Cancellation Finished 3 */ + uint32_t CF4:1; /*!< bit: 4 Tx Buffer Cancellation Finished 4 */ + uint32_t CF5:1; /*!< bit: 5 Tx Buffer Cancellation Finished 5 */ + uint32_t CF6:1; /*!< bit: 6 Tx Buffer Cancellation Finished 6 */ + uint32_t CF7:1; /*!< bit: 7 Tx Buffer Cancellation Finished 7 */ + uint32_t CF8:1; /*!< bit: 8 Tx Buffer Cancellation Finished 8 */ + uint32_t CF9:1; /*!< bit: 9 Tx Buffer Cancellation Finished 9 */ + uint32_t CF10:1; /*!< bit: 10 Tx Buffer Cancellation Finished 10 */ + uint32_t CF11:1; /*!< bit: 11 Tx Buffer Cancellation Finished 11 */ + uint32_t CF12:1; /*!< bit: 12 Tx Buffer Cancellation Finished 12 */ + uint32_t CF13:1; /*!< bit: 13 Tx Buffer Cancellation Finished 13 */ + uint32_t CF14:1; /*!< bit: 14 Tx Buffer Cancellation Finished 14 */ + uint32_t CF15:1; /*!< bit: 15 Tx Buffer Cancellation Finished 15 */ + uint32_t CF16:1; /*!< bit: 16 Tx Buffer Cancellation Finished 16 */ + uint32_t CF17:1; /*!< bit: 17 Tx Buffer Cancellation Finished 17 */ + uint32_t CF18:1; /*!< bit: 18 Tx Buffer Cancellation Finished 18 */ + uint32_t CF19:1; /*!< bit: 19 Tx Buffer Cancellation Finished 19 */ + uint32_t CF20:1; /*!< bit: 20 Tx Buffer Cancellation Finished 20 */ + uint32_t CF21:1; /*!< bit: 21 Tx Buffer Cancellation Finished 21 */ + uint32_t CF22:1; /*!< bit: 22 Tx Buffer Cancellation Finished 22 */ + uint32_t CF23:1; /*!< bit: 23 Tx Buffer Cancellation Finished 23 */ + uint32_t CF24:1; /*!< bit: 24 Tx Buffer Cancellation Finished 24 */ + uint32_t CF25:1; /*!< bit: 25 Tx Buffer Cancellation Finished 25 */ + uint32_t CF26:1; /*!< bit: 26 Tx Buffer Cancellation Finished 26 */ + uint32_t CF27:1; /*!< bit: 27 Tx Buffer Cancellation Finished 27 */ + uint32_t CF28:1; /*!< bit: 28 Tx Buffer Cancellation Finished 28 */ + uint32_t CF29:1; /*!< bit: 29 Tx Buffer Cancellation Finished 29 */ + uint32_t CF30:1; /*!< bit: 30 Tx Buffer Cancellation Finished 30 */ + uint32_t CF31:1; /*!< bit: 31 Tx Buffer Cancellation Finished 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBCF_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBCF_OFFSET 0xDC /**< \brief (CAN_TXBCF offset) Tx Buffer Cancellation Finished */ +#define CAN_TXBCF_RESETVALUE 0x00000000u /**< \brief (CAN_TXBCF reset_value) Tx Buffer Cancellation Finished */ + +#define CAN_TXBCF_CF0_Pos 0 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 0 */ +#define CAN_TXBCF_CF0 (0x1u << CAN_TXBCF_CF0_Pos) +#define CAN_TXBCF_CF1_Pos 1 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 1 */ +#define CAN_TXBCF_CF1 (0x1u << CAN_TXBCF_CF1_Pos) +#define CAN_TXBCF_CF2_Pos 2 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 2 */ +#define CAN_TXBCF_CF2 (0x1u << CAN_TXBCF_CF2_Pos) +#define CAN_TXBCF_CF3_Pos 3 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 3 */ +#define CAN_TXBCF_CF3 (0x1u << CAN_TXBCF_CF3_Pos) +#define CAN_TXBCF_CF4_Pos 4 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 4 */ +#define CAN_TXBCF_CF4 (0x1u << CAN_TXBCF_CF4_Pos) +#define CAN_TXBCF_CF5_Pos 5 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 5 */ +#define CAN_TXBCF_CF5 (0x1u << CAN_TXBCF_CF5_Pos) +#define CAN_TXBCF_CF6_Pos 6 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 6 */ +#define CAN_TXBCF_CF6 (0x1u << CAN_TXBCF_CF6_Pos) +#define CAN_TXBCF_CF7_Pos 7 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 7 */ +#define CAN_TXBCF_CF7 (0x1u << CAN_TXBCF_CF7_Pos) +#define CAN_TXBCF_CF8_Pos 8 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 8 */ +#define CAN_TXBCF_CF8 (0x1u << CAN_TXBCF_CF8_Pos) +#define CAN_TXBCF_CF9_Pos 9 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 9 */ +#define CAN_TXBCF_CF9 (0x1u << CAN_TXBCF_CF9_Pos) +#define CAN_TXBCF_CF10_Pos 10 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 10 */ +#define CAN_TXBCF_CF10 (0x1u << CAN_TXBCF_CF10_Pos) +#define CAN_TXBCF_CF11_Pos 11 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 11 */ +#define CAN_TXBCF_CF11 (0x1u << CAN_TXBCF_CF11_Pos) +#define CAN_TXBCF_CF12_Pos 12 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 12 */ +#define CAN_TXBCF_CF12 (0x1u << CAN_TXBCF_CF12_Pos) +#define CAN_TXBCF_CF13_Pos 13 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 13 */ +#define CAN_TXBCF_CF13 (0x1u << CAN_TXBCF_CF13_Pos) +#define CAN_TXBCF_CF14_Pos 14 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 14 */ +#define CAN_TXBCF_CF14 (0x1u << CAN_TXBCF_CF14_Pos) +#define CAN_TXBCF_CF15_Pos 15 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 15 */ +#define CAN_TXBCF_CF15 (0x1u << CAN_TXBCF_CF15_Pos) +#define CAN_TXBCF_CF16_Pos 16 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 16 */ +#define CAN_TXBCF_CF16 (0x1u << CAN_TXBCF_CF16_Pos) +#define CAN_TXBCF_CF17_Pos 17 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 17 */ +#define CAN_TXBCF_CF17 (0x1u << CAN_TXBCF_CF17_Pos) +#define CAN_TXBCF_CF18_Pos 18 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 18 */ +#define CAN_TXBCF_CF18 (0x1u << CAN_TXBCF_CF18_Pos) +#define CAN_TXBCF_CF19_Pos 19 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 19 */ +#define CAN_TXBCF_CF19 (0x1u << CAN_TXBCF_CF19_Pos) +#define CAN_TXBCF_CF20_Pos 20 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 20 */ +#define CAN_TXBCF_CF20 (0x1u << CAN_TXBCF_CF20_Pos) +#define CAN_TXBCF_CF21_Pos 21 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 21 */ +#define CAN_TXBCF_CF21 (0x1u << CAN_TXBCF_CF21_Pos) +#define CAN_TXBCF_CF22_Pos 22 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 22 */ +#define CAN_TXBCF_CF22 (0x1u << CAN_TXBCF_CF22_Pos) +#define CAN_TXBCF_CF23_Pos 23 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 23 */ +#define CAN_TXBCF_CF23 (0x1u << CAN_TXBCF_CF23_Pos) +#define CAN_TXBCF_CF24_Pos 24 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 24 */ +#define CAN_TXBCF_CF24 (0x1u << CAN_TXBCF_CF24_Pos) +#define CAN_TXBCF_CF25_Pos 25 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 25 */ +#define CAN_TXBCF_CF25 (0x1u << CAN_TXBCF_CF25_Pos) +#define CAN_TXBCF_CF26_Pos 26 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 26 */ +#define CAN_TXBCF_CF26 (0x1u << CAN_TXBCF_CF26_Pos) +#define CAN_TXBCF_CF27_Pos 27 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 27 */ +#define CAN_TXBCF_CF27 (0x1u << CAN_TXBCF_CF27_Pos) +#define CAN_TXBCF_CF28_Pos 28 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 28 */ +#define CAN_TXBCF_CF28 (0x1u << CAN_TXBCF_CF28_Pos) +#define CAN_TXBCF_CF29_Pos 29 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 29 */ +#define CAN_TXBCF_CF29 (0x1u << CAN_TXBCF_CF29_Pos) +#define CAN_TXBCF_CF30_Pos 30 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 30 */ +#define CAN_TXBCF_CF30 (0x1u << CAN_TXBCF_CF30_Pos) +#define CAN_TXBCF_CF31_Pos 31 /**< \brief (CAN_TXBCF) Tx Buffer Cancellation Finished 31 */ +#define CAN_TXBCF_CF31 (0x1u << CAN_TXBCF_CF31_Pos) +#define CAN_TXBCF_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBCF) MASK Register */ + +/* -------- CAN_TXBTIE : (CAN Offset: 0xE0) (R/W 32) Tx Buffer Transmission Interrupt Enable -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TIE0:1; /*!< bit: 0 Transmission Interrupt Enable 0 */ + uint32_t TIE1:1; /*!< bit: 1 Transmission Interrupt Enable 1 */ + uint32_t TIE2:1; /*!< bit: 2 Transmission Interrupt Enable 2 */ + uint32_t TIE3:1; /*!< bit: 3 Transmission Interrupt Enable 3 */ + uint32_t TIE4:1; /*!< bit: 4 Transmission Interrupt Enable 4 */ + uint32_t TIE5:1; /*!< bit: 5 Transmission Interrupt Enable 5 */ + uint32_t TIE6:1; /*!< bit: 6 Transmission Interrupt Enable 6 */ + uint32_t TIE7:1; /*!< bit: 7 Transmission Interrupt Enable 7 */ + uint32_t TIE8:1; /*!< bit: 8 Transmission Interrupt Enable 8 */ + uint32_t TIE9:1; /*!< bit: 9 Transmission Interrupt Enable 9 */ + uint32_t TIE10:1; /*!< bit: 10 Transmission Interrupt Enable 10 */ + uint32_t TIE11:1; /*!< bit: 11 Transmission Interrupt Enable 11 */ + uint32_t TIE12:1; /*!< bit: 12 Transmission Interrupt Enable 12 */ + uint32_t TIE13:1; /*!< bit: 13 Transmission Interrupt Enable 13 */ + uint32_t TIE14:1; /*!< bit: 14 Transmission Interrupt Enable 14 */ + uint32_t TIE15:1; /*!< bit: 15 Transmission Interrupt Enable 15 */ + uint32_t TIE16:1; /*!< bit: 16 Transmission Interrupt Enable 16 */ + uint32_t TIE17:1; /*!< bit: 17 Transmission Interrupt Enable 17 */ + uint32_t TIE18:1; /*!< bit: 18 Transmission Interrupt Enable 18 */ + uint32_t TIE19:1; /*!< bit: 19 Transmission Interrupt Enable 19 */ + uint32_t TIE20:1; /*!< bit: 20 Transmission Interrupt Enable 20 */ + uint32_t TIE21:1; /*!< bit: 21 Transmission Interrupt Enable 21 */ + uint32_t TIE22:1; /*!< bit: 22 Transmission Interrupt Enable 22 */ + uint32_t TIE23:1; /*!< bit: 23 Transmission Interrupt Enable 23 */ + uint32_t TIE24:1; /*!< bit: 24 Transmission Interrupt Enable 24 */ + uint32_t TIE25:1; /*!< bit: 25 Transmission Interrupt Enable 25 */ + uint32_t TIE26:1; /*!< bit: 26 Transmission Interrupt Enable 26 */ + uint32_t TIE27:1; /*!< bit: 27 Transmission Interrupt Enable 27 */ + uint32_t TIE28:1; /*!< bit: 28 Transmission Interrupt Enable 28 */ + uint32_t TIE29:1; /*!< bit: 29 Transmission Interrupt Enable 29 */ + uint32_t TIE30:1; /*!< bit: 30 Transmission Interrupt Enable 30 */ + uint32_t TIE31:1; /*!< bit: 31 Transmission Interrupt Enable 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBTIE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBTIE_OFFSET 0xE0 /**< \brief (CAN_TXBTIE offset) Tx Buffer Transmission Interrupt Enable */ +#define CAN_TXBTIE_RESETVALUE 0x00000000u /**< \brief (CAN_TXBTIE reset_value) Tx Buffer Transmission Interrupt Enable */ + +#define CAN_TXBTIE_TIE0_Pos 0 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 0 */ +#define CAN_TXBTIE_TIE0 (0x1u << CAN_TXBTIE_TIE0_Pos) +#define CAN_TXBTIE_TIE1_Pos 1 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 1 */ +#define CAN_TXBTIE_TIE1 (0x1u << CAN_TXBTIE_TIE1_Pos) +#define CAN_TXBTIE_TIE2_Pos 2 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 2 */ +#define CAN_TXBTIE_TIE2 (0x1u << CAN_TXBTIE_TIE2_Pos) +#define CAN_TXBTIE_TIE3_Pos 3 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 3 */ +#define CAN_TXBTIE_TIE3 (0x1u << CAN_TXBTIE_TIE3_Pos) +#define CAN_TXBTIE_TIE4_Pos 4 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 4 */ +#define CAN_TXBTIE_TIE4 (0x1u << CAN_TXBTIE_TIE4_Pos) +#define CAN_TXBTIE_TIE5_Pos 5 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 5 */ +#define CAN_TXBTIE_TIE5 (0x1u << CAN_TXBTIE_TIE5_Pos) +#define CAN_TXBTIE_TIE6_Pos 6 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 6 */ +#define CAN_TXBTIE_TIE6 (0x1u << CAN_TXBTIE_TIE6_Pos) +#define CAN_TXBTIE_TIE7_Pos 7 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 7 */ +#define CAN_TXBTIE_TIE7 (0x1u << CAN_TXBTIE_TIE7_Pos) +#define CAN_TXBTIE_TIE8_Pos 8 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 8 */ +#define CAN_TXBTIE_TIE8 (0x1u << CAN_TXBTIE_TIE8_Pos) +#define CAN_TXBTIE_TIE9_Pos 9 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 9 */ +#define CAN_TXBTIE_TIE9 (0x1u << CAN_TXBTIE_TIE9_Pos) +#define CAN_TXBTIE_TIE10_Pos 10 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 10 */ +#define CAN_TXBTIE_TIE10 (0x1u << CAN_TXBTIE_TIE10_Pos) +#define CAN_TXBTIE_TIE11_Pos 11 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 11 */ +#define CAN_TXBTIE_TIE11 (0x1u << CAN_TXBTIE_TIE11_Pos) +#define CAN_TXBTIE_TIE12_Pos 12 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 12 */ +#define CAN_TXBTIE_TIE12 (0x1u << CAN_TXBTIE_TIE12_Pos) +#define CAN_TXBTIE_TIE13_Pos 13 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 13 */ +#define CAN_TXBTIE_TIE13 (0x1u << CAN_TXBTIE_TIE13_Pos) +#define CAN_TXBTIE_TIE14_Pos 14 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 14 */ +#define CAN_TXBTIE_TIE14 (0x1u << CAN_TXBTIE_TIE14_Pos) +#define CAN_TXBTIE_TIE15_Pos 15 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 15 */ +#define CAN_TXBTIE_TIE15 (0x1u << CAN_TXBTIE_TIE15_Pos) +#define CAN_TXBTIE_TIE16_Pos 16 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 16 */ +#define CAN_TXBTIE_TIE16 (0x1u << CAN_TXBTIE_TIE16_Pos) +#define CAN_TXBTIE_TIE17_Pos 17 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 17 */ +#define CAN_TXBTIE_TIE17 (0x1u << CAN_TXBTIE_TIE17_Pos) +#define CAN_TXBTIE_TIE18_Pos 18 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 18 */ +#define CAN_TXBTIE_TIE18 (0x1u << CAN_TXBTIE_TIE18_Pos) +#define CAN_TXBTIE_TIE19_Pos 19 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 19 */ +#define CAN_TXBTIE_TIE19 (0x1u << CAN_TXBTIE_TIE19_Pos) +#define CAN_TXBTIE_TIE20_Pos 20 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 20 */ +#define CAN_TXBTIE_TIE20 (0x1u << CAN_TXBTIE_TIE20_Pos) +#define CAN_TXBTIE_TIE21_Pos 21 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 21 */ +#define CAN_TXBTIE_TIE21 (0x1u << CAN_TXBTIE_TIE21_Pos) +#define CAN_TXBTIE_TIE22_Pos 22 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 22 */ +#define CAN_TXBTIE_TIE22 (0x1u << CAN_TXBTIE_TIE22_Pos) +#define CAN_TXBTIE_TIE23_Pos 23 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 23 */ +#define CAN_TXBTIE_TIE23 (0x1u << CAN_TXBTIE_TIE23_Pos) +#define CAN_TXBTIE_TIE24_Pos 24 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 24 */ +#define CAN_TXBTIE_TIE24 (0x1u << CAN_TXBTIE_TIE24_Pos) +#define CAN_TXBTIE_TIE25_Pos 25 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 25 */ +#define CAN_TXBTIE_TIE25 (0x1u << CAN_TXBTIE_TIE25_Pos) +#define CAN_TXBTIE_TIE26_Pos 26 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 26 */ +#define CAN_TXBTIE_TIE26 (0x1u << CAN_TXBTIE_TIE26_Pos) +#define CAN_TXBTIE_TIE27_Pos 27 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 27 */ +#define CAN_TXBTIE_TIE27 (0x1u << CAN_TXBTIE_TIE27_Pos) +#define CAN_TXBTIE_TIE28_Pos 28 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 28 */ +#define CAN_TXBTIE_TIE28 (0x1u << CAN_TXBTIE_TIE28_Pos) +#define CAN_TXBTIE_TIE29_Pos 29 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 29 */ +#define CAN_TXBTIE_TIE29 (0x1u << CAN_TXBTIE_TIE29_Pos) +#define CAN_TXBTIE_TIE30_Pos 30 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 30 */ +#define CAN_TXBTIE_TIE30 (0x1u << CAN_TXBTIE_TIE30_Pos) +#define CAN_TXBTIE_TIE31_Pos 31 /**< \brief (CAN_TXBTIE) Transmission Interrupt Enable 31 */ +#define CAN_TXBTIE_TIE31 (0x1u << CAN_TXBTIE_TIE31_Pos) +#define CAN_TXBTIE_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBTIE) MASK Register */ + +/* -------- CAN_TXBCIE : (CAN Offset: 0xE4) (R/W 32) Tx Buffer Cancellation Finished Interrupt Enable -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CFIE0:1; /*!< bit: 0 Cancellation Finished Interrupt Enable 0 */ + uint32_t CFIE1:1; /*!< bit: 1 Cancellation Finished Interrupt Enable 1 */ + uint32_t CFIE2:1; /*!< bit: 2 Cancellation Finished Interrupt Enable 2 */ + uint32_t CFIE3:1; /*!< bit: 3 Cancellation Finished Interrupt Enable 3 */ + uint32_t CFIE4:1; /*!< bit: 4 Cancellation Finished Interrupt Enable 4 */ + uint32_t CFIE5:1; /*!< bit: 5 Cancellation Finished Interrupt Enable 5 */ + uint32_t CFIE6:1; /*!< bit: 6 Cancellation Finished Interrupt Enable 6 */ + uint32_t CFIE7:1; /*!< bit: 7 Cancellation Finished Interrupt Enable 7 */ + uint32_t CFIE8:1; /*!< bit: 8 Cancellation Finished Interrupt Enable 8 */ + uint32_t CFIE9:1; /*!< bit: 9 Cancellation Finished Interrupt Enable 9 */ + uint32_t CFIE10:1; /*!< bit: 10 Cancellation Finished Interrupt Enable 10 */ + uint32_t CFIE11:1; /*!< bit: 11 Cancellation Finished Interrupt Enable 11 */ + uint32_t CFIE12:1; /*!< bit: 12 Cancellation Finished Interrupt Enable 12 */ + uint32_t CFIE13:1; /*!< bit: 13 Cancellation Finished Interrupt Enable 13 */ + uint32_t CFIE14:1; /*!< bit: 14 Cancellation Finished Interrupt Enable 14 */ + uint32_t CFIE15:1; /*!< bit: 15 Cancellation Finished Interrupt Enable 15 */ + uint32_t CFIE16:1; /*!< bit: 16 Cancellation Finished Interrupt Enable 16 */ + uint32_t CFIE17:1; /*!< bit: 17 Cancellation Finished Interrupt Enable 17 */ + uint32_t CFIE18:1; /*!< bit: 18 Cancellation Finished Interrupt Enable 18 */ + uint32_t CFIE19:1; /*!< bit: 19 Cancellation Finished Interrupt Enable 19 */ + uint32_t CFIE20:1; /*!< bit: 20 Cancellation Finished Interrupt Enable 20 */ + uint32_t CFIE21:1; /*!< bit: 21 Cancellation Finished Interrupt Enable 21 */ + uint32_t CFIE22:1; /*!< bit: 22 Cancellation Finished Interrupt Enable 22 */ + uint32_t CFIE23:1; /*!< bit: 23 Cancellation Finished Interrupt Enable 23 */ + uint32_t CFIE24:1; /*!< bit: 24 Cancellation Finished Interrupt Enable 24 */ + uint32_t CFIE25:1; /*!< bit: 25 Cancellation Finished Interrupt Enable 25 */ + uint32_t CFIE26:1; /*!< bit: 26 Cancellation Finished Interrupt Enable 26 */ + uint32_t CFIE27:1; /*!< bit: 27 Cancellation Finished Interrupt Enable 27 */ + uint32_t CFIE28:1; /*!< bit: 28 Cancellation Finished Interrupt Enable 28 */ + uint32_t CFIE29:1; /*!< bit: 29 Cancellation Finished Interrupt Enable 29 */ + uint32_t CFIE30:1; /*!< bit: 30 Cancellation Finished Interrupt Enable 30 */ + uint32_t CFIE31:1; /*!< bit: 31 Cancellation Finished Interrupt Enable 31 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBCIE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBCIE_OFFSET 0xE4 /**< \brief (CAN_TXBCIE offset) Tx Buffer Cancellation Finished Interrupt Enable */ +#define CAN_TXBCIE_RESETVALUE 0x00000000u /**< \brief (CAN_TXBCIE reset_value) Tx Buffer Cancellation Finished Interrupt Enable */ + +#define CAN_TXBCIE_CFIE0_Pos 0 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 0 */ +#define CAN_TXBCIE_CFIE0 (0x1u << CAN_TXBCIE_CFIE0_Pos) +#define CAN_TXBCIE_CFIE1_Pos 1 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 1 */ +#define CAN_TXBCIE_CFIE1 (0x1u << CAN_TXBCIE_CFIE1_Pos) +#define CAN_TXBCIE_CFIE2_Pos 2 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 2 */ +#define CAN_TXBCIE_CFIE2 (0x1u << CAN_TXBCIE_CFIE2_Pos) +#define CAN_TXBCIE_CFIE3_Pos 3 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 3 */ +#define CAN_TXBCIE_CFIE3 (0x1u << CAN_TXBCIE_CFIE3_Pos) +#define CAN_TXBCIE_CFIE4_Pos 4 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 4 */ +#define CAN_TXBCIE_CFIE4 (0x1u << CAN_TXBCIE_CFIE4_Pos) +#define CAN_TXBCIE_CFIE5_Pos 5 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 5 */ +#define CAN_TXBCIE_CFIE5 (0x1u << CAN_TXBCIE_CFIE5_Pos) +#define CAN_TXBCIE_CFIE6_Pos 6 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 6 */ +#define CAN_TXBCIE_CFIE6 (0x1u << CAN_TXBCIE_CFIE6_Pos) +#define CAN_TXBCIE_CFIE7_Pos 7 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 7 */ +#define CAN_TXBCIE_CFIE7 (0x1u << CAN_TXBCIE_CFIE7_Pos) +#define CAN_TXBCIE_CFIE8_Pos 8 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 8 */ +#define CAN_TXBCIE_CFIE8 (0x1u << CAN_TXBCIE_CFIE8_Pos) +#define CAN_TXBCIE_CFIE9_Pos 9 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 9 */ +#define CAN_TXBCIE_CFIE9 (0x1u << CAN_TXBCIE_CFIE9_Pos) +#define CAN_TXBCIE_CFIE10_Pos 10 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 10 */ +#define CAN_TXBCIE_CFIE10 (0x1u << CAN_TXBCIE_CFIE10_Pos) +#define CAN_TXBCIE_CFIE11_Pos 11 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 11 */ +#define CAN_TXBCIE_CFIE11 (0x1u << CAN_TXBCIE_CFIE11_Pos) +#define CAN_TXBCIE_CFIE12_Pos 12 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 12 */ +#define CAN_TXBCIE_CFIE12 (0x1u << CAN_TXBCIE_CFIE12_Pos) +#define CAN_TXBCIE_CFIE13_Pos 13 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 13 */ +#define CAN_TXBCIE_CFIE13 (0x1u << CAN_TXBCIE_CFIE13_Pos) +#define CAN_TXBCIE_CFIE14_Pos 14 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 14 */ +#define CAN_TXBCIE_CFIE14 (0x1u << CAN_TXBCIE_CFIE14_Pos) +#define CAN_TXBCIE_CFIE15_Pos 15 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 15 */ +#define CAN_TXBCIE_CFIE15 (0x1u << CAN_TXBCIE_CFIE15_Pos) +#define CAN_TXBCIE_CFIE16_Pos 16 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 16 */ +#define CAN_TXBCIE_CFIE16 (0x1u << CAN_TXBCIE_CFIE16_Pos) +#define CAN_TXBCIE_CFIE17_Pos 17 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 17 */ +#define CAN_TXBCIE_CFIE17 (0x1u << CAN_TXBCIE_CFIE17_Pos) +#define CAN_TXBCIE_CFIE18_Pos 18 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 18 */ +#define CAN_TXBCIE_CFIE18 (0x1u << CAN_TXBCIE_CFIE18_Pos) +#define CAN_TXBCIE_CFIE19_Pos 19 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 19 */ +#define CAN_TXBCIE_CFIE19 (0x1u << CAN_TXBCIE_CFIE19_Pos) +#define CAN_TXBCIE_CFIE20_Pos 20 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 20 */ +#define CAN_TXBCIE_CFIE20 (0x1u << CAN_TXBCIE_CFIE20_Pos) +#define CAN_TXBCIE_CFIE21_Pos 21 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 21 */ +#define CAN_TXBCIE_CFIE21 (0x1u << CAN_TXBCIE_CFIE21_Pos) +#define CAN_TXBCIE_CFIE22_Pos 22 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 22 */ +#define CAN_TXBCIE_CFIE22 (0x1u << CAN_TXBCIE_CFIE22_Pos) +#define CAN_TXBCIE_CFIE23_Pos 23 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 23 */ +#define CAN_TXBCIE_CFIE23 (0x1u << CAN_TXBCIE_CFIE23_Pos) +#define CAN_TXBCIE_CFIE24_Pos 24 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 24 */ +#define CAN_TXBCIE_CFIE24 (0x1u << CAN_TXBCIE_CFIE24_Pos) +#define CAN_TXBCIE_CFIE25_Pos 25 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 25 */ +#define CAN_TXBCIE_CFIE25 (0x1u << CAN_TXBCIE_CFIE25_Pos) +#define CAN_TXBCIE_CFIE26_Pos 26 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 26 */ +#define CAN_TXBCIE_CFIE26 (0x1u << CAN_TXBCIE_CFIE26_Pos) +#define CAN_TXBCIE_CFIE27_Pos 27 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 27 */ +#define CAN_TXBCIE_CFIE27 (0x1u << CAN_TXBCIE_CFIE27_Pos) +#define CAN_TXBCIE_CFIE28_Pos 28 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 28 */ +#define CAN_TXBCIE_CFIE28 (0x1u << CAN_TXBCIE_CFIE28_Pos) +#define CAN_TXBCIE_CFIE29_Pos 29 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 29 */ +#define CAN_TXBCIE_CFIE29 (0x1u << CAN_TXBCIE_CFIE29_Pos) +#define CAN_TXBCIE_CFIE30_Pos 30 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 30 */ +#define CAN_TXBCIE_CFIE30 (0x1u << CAN_TXBCIE_CFIE30_Pos) +#define CAN_TXBCIE_CFIE31_Pos 31 /**< \brief (CAN_TXBCIE) Cancellation Finished Interrupt Enable 31 */ +#define CAN_TXBCIE_CFIE31 (0x1u << CAN_TXBCIE_CFIE31_Pos) +#define CAN_TXBCIE_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBCIE) MASK Register */ + +/* -------- CAN_TXEFC : (CAN Offset: 0xF0) (R/W 32) Tx Event FIFO Configuration -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EFSA:16; /*!< bit: 0..15 Event FIFO Start Address */ + uint32_t EFS:6; /*!< bit: 16..21 Event FIFO Size */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t EFWM:6; /*!< bit: 24..29 Event FIFO Watermark */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXEFC_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXEFC_OFFSET 0xF0 /**< \brief (CAN_TXEFC offset) Tx Event FIFO Configuration */ +#define CAN_TXEFC_RESETVALUE 0x00000000u /**< \brief (CAN_TXEFC reset_value) Tx Event FIFO Configuration */ + +#define CAN_TXEFC_EFSA_Pos 0 /**< \brief (CAN_TXEFC) Event FIFO Start Address */ +#define CAN_TXEFC_EFSA_Msk (0xFFFFu << CAN_TXEFC_EFSA_Pos) +#define CAN_TXEFC_EFSA(value) (CAN_TXEFC_EFSA_Msk & ((value) << CAN_TXEFC_EFSA_Pos)) +#define CAN_TXEFC_EFS_Pos 16 /**< \brief (CAN_TXEFC) Event FIFO Size */ +#define CAN_TXEFC_EFS_Msk (0x3Fu << CAN_TXEFC_EFS_Pos) +#define CAN_TXEFC_EFS(value) (CAN_TXEFC_EFS_Msk & ((value) << CAN_TXEFC_EFS_Pos)) +#define CAN_TXEFC_EFWM_Pos 24 /**< \brief (CAN_TXEFC) Event FIFO Watermark */ +#define CAN_TXEFC_EFWM_Msk (0x3Fu << CAN_TXEFC_EFWM_Pos) +#define CAN_TXEFC_EFWM(value) (CAN_TXEFC_EFWM_Msk & ((value) << CAN_TXEFC_EFWM_Pos)) +#define CAN_TXEFC_MASK 0x3F3FFFFFu /**< \brief (CAN_TXEFC) MASK Register */ + +/* -------- CAN_TXEFS : (CAN Offset: 0xF4) (R/ 32) Tx Event FIFO Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EFFL:6; /*!< bit: 0.. 5 Event FIFO Fill Level */ + uint32_t :2; /*!< bit: 6.. 7 Reserved */ + uint32_t EFGI:5; /*!< bit: 8..12 Event FIFO Get Index */ + uint32_t :3; /*!< bit: 13..15 Reserved */ + uint32_t EFPI:5; /*!< bit: 16..20 Event FIFO Put Index */ + uint32_t :3; /*!< bit: 21..23 Reserved */ + uint32_t EFF:1; /*!< bit: 24 Event FIFO Full */ + uint32_t TEFL:1; /*!< bit: 25 Tx Event FIFO Element Lost */ + uint32_t :6; /*!< bit: 26..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXEFS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXEFS_OFFSET 0xF4 /**< \brief (CAN_TXEFS offset) Tx Event FIFO Status */ +#define CAN_TXEFS_RESETVALUE 0x00000000u /**< \brief (CAN_TXEFS reset_value) Tx Event FIFO Status */ + +#define CAN_TXEFS_EFFL_Pos 0 /**< \brief (CAN_TXEFS) Event FIFO Fill Level */ +#define CAN_TXEFS_EFFL_Msk (0x3Fu << CAN_TXEFS_EFFL_Pos) +#define CAN_TXEFS_EFFL(value) (CAN_TXEFS_EFFL_Msk & ((value) << CAN_TXEFS_EFFL_Pos)) +#define CAN_TXEFS_EFGI_Pos 8 /**< \brief (CAN_TXEFS) Event FIFO Get Index */ +#define CAN_TXEFS_EFGI_Msk (0x1Fu << CAN_TXEFS_EFGI_Pos) +#define CAN_TXEFS_EFGI(value) (CAN_TXEFS_EFGI_Msk & ((value) << CAN_TXEFS_EFGI_Pos)) +#define CAN_TXEFS_EFPI_Pos 16 /**< \brief (CAN_TXEFS) Event FIFO Put Index */ +#define CAN_TXEFS_EFPI_Msk (0x1Fu << CAN_TXEFS_EFPI_Pos) +#define CAN_TXEFS_EFPI(value) (CAN_TXEFS_EFPI_Msk & ((value) << CAN_TXEFS_EFPI_Pos)) +#define CAN_TXEFS_EFF_Pos 24 /**< \brief (CAN_TXEFS) Event FIFO Full */ +#define CAN_TXEFS_EFF (0x1u << CAN_TXEFS_EFF_Pos) +#define CAN_TXEFS_TEFL_Pos 25 /**< \brief (CAN_TXEFS) Tx Event FIFO Element Lost */ +#define CAN_TXEFS_TEFL (0x1u << CAN_TXEFS_TEFL_Pos) +#define CAN_TXEFS_MASK 0x031F1F3Fu /**< \brief (CAN_TXEFS) MASK Register */ + +/* -------- CAN_TXEFA : (CAN Offset: 0xF8) (R/W 32) Tx Event FIFO Acknowledge -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EFAI:5; /*!< bit: 0.. 4 Event FIFO Acknowledge Index */ + uint32_t :27; /*!< bit: 5..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXEFA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXEFA_OFFSET 0xF8 /**< \brief (CAN_TXEFA offset) Tx Event FIFO Acknowledge */ +#define CAN_TXEFA_RESETVALUE 0x00000000u /**< \brief (CAN_TXEFA reset_value) Tx Event FIFO Acknowledge */ + +#define CAN_TXEFA_EFAI_Pos 0 /**< \brief (CAN_TXEFA) Event FIFO Acknowledge Index */ +#define CAN_TXEFA_EFAI_Msk (0x1Fu << CAN_TXEFA_EFAI_Pos) +#define CAN_TXEFA_EFAI(value) (CAN_TXEFA_EFAI_Msk & ((value) << CAN_TXEFA_EFAI_Pos)) +#define CAN_TXEFA_MASK 0x0000001Fu /**< \brief (CAN_TXEFA) MASK Register */ + +/* -------- CAN_RXBE_0 : (CAN Offset: 0x00) (R/W 32) Rx Buffer Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ID:29; /*!< bit: 0..28 Identifier */ + uint32_t RTR:1; /*!< bit: 29 Remote Transmission Request */ + uint32_t XTD:1; /*!< bit: 30 Extended Identifier */ + uint32_t ESI:1; /*!< bit: 31 Error State Indicator */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXBE_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXBE_0_OFFSET 0x00 /**< \brief (CAN_RXBE_0 offset) Rx Buffer Element 0 */ +#define CAN_RXBE_0_RESETVALUE 0x00000000u /**< \brief (CAN_RXBE_0 reset_value) Rx Buffer Element 0 */ + +#define CAN_RXBE_0_ID_Pos 0 /**< \brief (CAN_RXBE_0) Identifier */ +#define CAN_RXBE_0_ID_Msk (0x1FFFFFFFu << CAN_RXBE_0_ID_Pos) +#define CAN_RXBE_0_ID(value) (CAN_RXBE_0_ID_Msk & ((value) << CAN_RXBE_0_ID_Pos)) +#define CAN_RXBE_0_RTR_Pos 29 /**< \brief (CAN_RXBE_0) Remote Transmission Request */ +#define CAN_RXBE_0_RTR (0x1u << CAN_RXBE_0_RTR_Pos) +#define CAN_RXBE_0_XTD_Pos 30 /**< \brief (CAN_RXBE_0) Extended Identifier */ +#define CAN_RXBE_0_XTD (0x1u << CAN_RXBE_0_XTD_Pos) +#define CAN_RXBE_0_ESI_Pos 31 /**< \brief (CAN_RXBE_0) Error State Indicator */ +#define CAN_RXBE_0_ESI (0x1u << CAN_RXBE_0_ESI_Pos) +#define CAN_RXBE_0_MASK 0xFFFFFFFFu /**< \brief (CAN_RXBE_0) MASK Register */ + +/* -------- CAN_RXBE_1 : (CAN Offset: 0x04) (R/W 32) Rx Buffer Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RXTS:16; /*!< bit: 0..15 Rx Timestamp */ + uint32_t DLC:4; /*!< bit: 16..19 Data Length Code */ + uint32_t BRS:1; /*!< bit: 20 Bit Rate Search */ + uint32_t FDF:1; /*!< bit: 21 FD Format */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t FIDX:7; /*!< bit: 24..30 Filter Index */ + uint32_t ANMF:1; /*!< bit: 31 Accepted Non-matching Frame */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXBE_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXBE_1_OFFSET 0x04 /**< \brief (CAN_RXBE_1 offset) Rx Buffer Element 1 */ +#define CAN_RXBE_1_RESETVALUE 0x00000000u /**< \brief (CAN_RXBE_1 reset_value) Rx Buffer Element 1 */ + +#define CAN_RXBE_1_RXTS_Pos 0 /**< \brief (CAN_RXBE_1) Rx Timestamp */ +#define CAN_RXBE_1_RXTS_Msk (0xFFFFu << CAN_RXBE_1_RXTS_Pos) +#define CAN_RXBE_1_RXTS(value) (CAN_RXBE_1_RXTS_Msk & ((value) << CAN_RXBE_1_RXTS_Pos)) +#define CAN_RXBE_1_DLC_Pos 16 /**< \brief (CAN_RXBE_1) Data Length Code */ +#define CAN_RXBE_1_DLC_Msk (0xFu << CAN_RXBE_1_DLC_Pos) +#define CAN_RXBE_1_DLC(value) (CAN_RXBE_1_DLC_Msk & ((value) << CAN_RXBE_1_DLC_Pos)) +#define CAN_RXBE_1_BRS_Pos 20 /**< \brief (CAN_RXBE_1) Bit Rate Search */ +#define CAN_RXBE_1_BRS (0x1u << CAN_RXBE_1_BRS_Pos) +#define CAN_RXBE_1_FDF_Pos 21 /**< \brief (CAN_RXBE_1) FD Format */ +#define CAN_RXBE_1_FDF (0x1u << CAN_RXBE_1_FDF_Pos) +#define CAN_RXBE_1_FIDX_Pos 24 /**< \brief (CAN_RXBE_1) Filter Index */ +#define CAN_RXBE_1_FIDX_Msk (0x7Fu << CAN_RXBE_1_FIDX_Pos) +#define CAN_RXBE_1_FIDX(value) (CAN_RXBE_1_FIDX_Msk & ((value) << CAN_RXBE_1_FIDX_Pos)) +#define CAN_RXBE_1_ANMF_Pos 31 /**< \brief (CAN_RXBE_1) Accepted Non-matching Frame */ +#define CAN_RXBE_1_ANMF (0x1u << CAN_RXBE_1_ANMF_Pos) +#define CAN_RXBE_1_MASK 0xFF3FFFFFu /**< \brief (CAN_RXBE_1) MASK Register */ + +/* -------- CAN_RXBE_DATA : (CAN Offset: 0x08) (R/W 32) Rx Buffer Element Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DB0:8; /*!< bit: 0.. 7 Data Byte 0 */ + uint32_t DB1:8; /*!< bit: 8..15 Data Byte 1 */ + uint32_t DB2:8; /*!< bit: 16..23 Data Byte 2 */ + uint32_t DB3:8; /*!< bit: 24..31 Data Byte 3 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXBE_DATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXBE_DATA_OFFSET 0x08 /**< \brief (CAN_RXBE_DATA offset) Rx Buffer Element Data */ +#define CAN_RXBE_DATA_RESETVALUE 0x00000000u /**< \brief (CAN_RXBE_DATA reset_value) Rx Buffer Element Data */ + +#define CAN_RXBE_DATA_DB0_Pos 0 /**< \brief (CAN_RXBE_DATA) Data Byte 0 */ +#define CAN_RXBE_DATA_DB0_Msk (0xFFu << CAN_RXBE_DATA_DB0_Pos) +#define CAN_RXBE_DATA_DB0(value) (CAN_RXBE_DATA_DB0_Msk & ((value) << CAN_RXBE_DATA_DB0_Pos)) +#define CAN_RXBE_DATA_DB1_Pos 8 /**< \brief (CAN_RXBE_DATA) Data Byte 1 */ +#define CAN_RXBE_DATA_DB1_Msk (0xFFu << CAN_RXBE_DATA_DB1_Pos) +#define CAN_RXBE_DATA_DB1(value) (CAN_RXBE_DATA_DB1_Msk & ((value) << CAN_RXBE_DATA_DB1_Pos)) +#define CAN_RXBE_DATA_DB2_Pos 16 /**< \brief (CAN_RXBE_DATA) Data Byte 2 */ +#define CAN_RXBE_DATA_DB2_Msk (0xFFu << CAN_RXBE_DATA_DB2_Pos) +#define CAN_RXBE_DATA_DB2(value) (CAN_RXBE_DATA_DB2_Msk & ((value) << CAN_RXBE_DATA_DB2_Pos)) +#define CAN_RXBE_DATA_DB3_Pos 24 /**< \brief (CAN_RXBE_DATA) Data Byte 3 */ +#define CAN_RXBE_DATA_DB3_Msk (0xFFu << CAN_RXBE_DATA_DB3_Pos) +#define CAN_RXBE_DATA_DB3(value) (CAN_RXBE_DATA_DB3_Msk & ((value) << CAN_RXBE_DATA_DB3_Pos)) +#define CAN_RXBE_DATA_MASK 0xFFFFFFFFu /**< \brief (CAN_RXBE_DATA) MASK Register */ + +/* -------- CAN_RXF0E_0 : (CAN Offset: 0x00) (R/W 32) Rx FIFO 0 Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ID:29; /*!< bit: 0..28 Identifier */ + uint32_t RTR:1; /*!< bit: 29 Remote Transmission Request */ + uint32_t XTD:1; /*!< bit: 30 Extended Identifier */ + uint32_t ESI:1; /*!< bit: 31 Error State Indicator */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0E_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0E_0_OFFSET 0x00 /**< \brief (CAN_RXF0E_0 offset) Rx FIFO 0 Element 0 */ +#define CAN_RXF0E_0_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0E_0 reset_value) Rx FIFO 0 Element 0 */ + +#define CAN_RXF0E_0_ID_Pos 0 /**< \brief (CAN_RXF0E_0) Identifier */ +#define CAN_RXF0E_0_ID_Msk (0x1FFFFFFFu << CAN_RXF0E_0_ID_Pos) +#define CAN_RXF0E_0_ID(value) (CAN_RXF0E_0_ID_Msk & ((value) << CAN_RXF0E_0_ID_Pos)) +#define CAN_RXF0E_0_RTR_Pos 29 /**< \brief (CAN_RXF0E_0) Remote Transmission Request */ +#define CAN_RXF0E_0_RTR (0x1u << CAN_RXF0E_0_RTR_Pos) +#define CAN_RXF0E_0_XTD_Pos 30 /**< \brief (CAN_RXF0E_0) Extended Identifier */ +#define CAN_RXF0E_0_XTD (0x1u << CAN_RXF0E_0_XTD_Pos) +#define CAN_RXF0E_0_ESI_Pos 31 /**< \brief (CAN_RXF0E_0) Error State Indicator */ +#define CAN_RXF0E_0_ESI (0x1u << CAN_RXF0E_0_ESI_Pos) +#define CAN_RXF0E_0_MASK 0xFFFFFFFFu /**< \brief (CAN_RXF0E_0) MASK Register */ + +/* -------- CAN_RXF0E_1 : (CAN Offset: 0x04) (R/W 32) Rx FIFO 0 Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RXTS:16; /*!< bit: 0..15 Rx Timestamp */ + uint32_t DLC:4; /*!< bit: 16..19 Data Length Code */ + uint32_t BRS:1; /*!< bit: 20 Bit Rate Search */ + uint32_t FDF:1; /*!< bit: 21 FD Format */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t FIDX:7; /*!< bit: 24..30 Filter Index */ + uint32_t ANMF:1; /*!< bit: 31 Accepted Non-matching Frame */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0E_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0E_1_OFFSET 0x04 /**< \brief (CAN_RXF0E_1 offset) Rx FIFO 0 Element 1 */ +#define CAN_RXF0E_1_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0E_1 reset_value) Rx FIFO 0 Element 1 */ + +#define CAN_RXF0E_1_RXTS_Pos 0 /**< \brief (CAN_RXF0E_1) Rx Timestamp */ +#define CAN_RXF0E_1_RXTS_Msk (0xFFFFu << CAN_RXF0E_1_RXTS_Pos) +#define CAN_RXF0E_1_RXTS(value) (CAN_RXF0E_1_RXTS_Msk & ((value) << CAN_RXF0E_1_RXTS_Pos)) +#define CAN_RXF0E_1_DLC_Pos 16 /**< \brief (CAN_RXF0E_1) Data Length Code */ +#define CAN_RXF0E_1_DLC_Msk (0xFu << CAN_RXF0E_1_DLC_Pos) +#define CAN_RXF0E_1_DLC(value) (CAN_RXF0E_1_DLC_Msk & ((value) << CAN_RXF0E_1_DLC_Pos)) +#define CAN_RXF0E_1_BRS_Pos 20 /**< \brief (CAN_RXF0E_1) Bit Rate Search */ +#define CAN_RXF0E_1_BRS (0x1u << CAN_RXF0E_1_BRS_Pos) +#define CAN_RXF0E_1_FDF_Pos 21 /**< \brief (CAN_RXF0E_1) FD Format */ +#define CAN_RXF0E_1_FDF (0x1u << CAN_RXF0E_1_FDF_Pos) +#define CAN_RXF0E_1_FIDX_Pos 24 /**< \brief (CAN_RXF0E_1) Filter Index */ +#define CAN_RXF0E_1_FIDX_Msk (0x7Fu << CAN_RXF0E_1_FIDX_Pos) +#define CAN_RXF0E_1_FIDX(value) (CAN_RXF0E_1_FIDX_Msk & ((value) << CAN_RXF0E_1_FIDX_Pos)) +#define CAN_RXF0E_1_ANMF_Pos 31 /**< \brief (CAN_RXF0E_1) Accepted Non-matching Frame */ +#define CAN_RXF0E_1_ANMF (0x1u << CAN_RXF0E_1_ANMF_Pos) +#define CAN_RXF0E_1_MASK 0xFF3FFFFFu /**< \brief (CAN_RXF0E_1) MASK Register */ + +/* -------- CAN_RXF0E_DATA : (CAN Offset: 0x08) (R/W 32) Rx FIFO 0 Element Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DB0:8; /*!< bit: 0.. 7 Data Byte 0 */ + uint32_t DB1:8; /*!< bit: 8..15 Data Byte 1 */ + uint32_t DB2:8; /*!< bit: 16..23 Data Byte 2 */ + uint32_t DB3:8; /*!< bit: 24..31 Data Byte 3 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF0E_DATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF0E_DATA_OFFSET 0x08 /**< \brief (CAN_RXF0E_DATA offset) Rx FIFO 0 Element Data */ +#define CAN_RXF0E_DATA_RESETVALUE 0x00000000u /**< \brief (CAN_RXF0E_DATA reset_value) Rx FIFO 0 Element Data */ + +#define CAN_RXF0E_DATA_DB0_Pos 0 /**< \brief (CAN_RXF0E_DATA) Data Byte 0 */ +#define CAN_RXF0E_DATA_DB0_Msk (0xFFu << CAN_RXF0E_DATA_DB0_Pos) +#define CAN_RXF0E_DATA_DB0(value) (CAN_RXF0E_DATA_DB0_Msk & ((value) << CAN_RXF0E_DATA_DB0_Pos)) +#define CAN_RXF0E_DATA_DB1_Pos 8 /**< \brief (CAN_RXF0E_DATA) Data Byte 1 */ +#define CAN_RXF0E_DATA_DB1_Msk (0xFFu << CAN_RXF0E_DATA_DB1_Pos) +#define CAN_RXF0E_DATA_DB1(value) (CAN_RXF0E_DATA_DB1_Msk & ((value) << CAN_RXF0E_DATA_DB1_Pos)) +#define CAN_RXF0E_DATA_DB2_Pos 16 /**< \brief (CAN_RXF0E_DATA) Data Byte 2 */ +#define CAN_RXF0E_DATA_DB2_Msk (0xFFu << CAN_RXF0E_DATA_DB2_Pos) +#define CAN_RXF0E_DATA_DB2(value) (CAN_RXF0E_DATA_DB2_Msk & ((value) << CAN_RXF0E_DATA_DB2_Pos)) +#define CAN_RXF0E_DATA_DB3_Pos 24 /**< \brief (CAN_RXF0E_DATA) Data Byte 3 */ +#define CAN_RXF0E_DATA_DB3_Msk (0xFFu << CAN_RXF0E_DATA_DB3_Pos) +#define CAN_RXF0E_DATA_DB3(value) (CAN_RXF0E_DATA_DB3_Msk & ((value) << CAN_RXF0E_DATA_DB3_Pos)) +#define CAN_RXF0E_DATA_MASK 0xFFFFFFFFu /**< \brief (CAN_RXF0E_DATA) MASK Register */ + +/* -------- CAN_RXF1E_0 : (CAN Offset: 0x00) (R/W 32) Rx FIFO 1 Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ID:29; /*!< bit: 0..28 Identifier */ + uint32_t RTR:1; /*!< bit: 29 Remote Transmission Request */ + uint32_t XTD:1; /*!< bit: 30 Extended Identifier */ + uint32_t ESI:1; /*!< bit: 31 Error State Indicator */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1E_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1E_0_OFFSET 0x00 /**< \brief (CAN_RXF1E_0 offset) Rx FIFO 1 Element 0 */ +#define CAN_RXF1E_0_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1E_0 reset_value) Rx FIFO 1 Element 0 */ + +#define CAN_RXF1E_0_ID_Pos 0 /**< \brief (CAN_RXF1E_0) Identifier */ +#define CAN_RXF1E_0_ID_Msk (0x1FFFFFFFu << CAN_RXF1E_0_ID_Pos) +#define CAN_RXF1E_0_ID(value) (CAN_RXF1E_0_ID_Msk & ((value) << CAN_RXF1E_0_ID_Pos)) +#define CAN_RXF1E_0_RTR_Pos 29 /**< \brief (CAN_RXF1E_0) Remote Transmission Request */ +#define CAN_RXF1E_0_RTR (0x1u << CAN_RXF1E_0_RTR_Pos) +#define CAN_RXF1E_0_XTD_Pos 30 /**< \brief (CAN_RXF1E_0) Extended Identifier */ +#define CAN_RXF1E_0_XTD (0x1u << CAN_RXF1E_0_XTD_Pos) +#define CAN_RXF1E_0_ESI_Pos 31 /**< \brief (CAN_RXF1E_0) Error State Indicator */ +#define CAN_RXF1E_0_ESI (0x1u << CAN_RXF1E_0_ESI_Pos) +#define CAN_RXF1E_0_MASK 0xFFFFFFFFu /**< \brief (CAN_RXF1E_0) MASK Register */ + +/* -------- CAN_RXF1E_1 : (CAN Offset: 0x04) (R/W 32) Rx FIFO 1 Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t RXTS:16; /*!< bit: 0..15 Rx Timestamp */ + uint32_t DLC:4; /*!< bit: 16..19 Data Length Code */ + uint32_t BRS:1; /*!< bit: 20 Bit Rate Search */ + uint32_t FDF:1; /*!< bit: 21 FD Format */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t FIDX:7; /*!< bit: 24..30 Filter Index */ + uint32_t ANMF:1; /*!< bit: 31 Accepted Non-matching Frame */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1E_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1E_1_OFFSET 0x04 /**< \brief (CAN_RXF1E_1 offset) Rx FIFO 1 Element 1 */ +#define CAN_RXF1E_1_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1E_1 reset_value) Rx FIFO 1 Element 1 */ + +#define CAN_RXF1E_1_RXTS_Pos 0 /**< \brief (CAN_RXF1E_1) Rx Timestamp */ +#define CAN_RXF1E_1_RXTS_Msk (0xFFFFu << CAN_RXF1E_1_RXTS_Pos) +#define CAN_RXF1E_1_RXTS(value) (CAN_RXF1E_1_RXTS_Msk & ((value) << CAN_RXF1E_1_RXTS_Pos)) +#define CAN_RXF1E_1_DLC_Pos 16 /**< \brief (CAN_RXF1E_1) Data Length Code */ +#define CAN_RXF1E_1_DLC_Msk (0xFu << CAN_RXF1E_1_DLC_Pos) +#define CAN_RXF1E_1_DLC(value) (CAN_RXF1E_1_DLC_Msk & ((value) << CAN_RXF1E_1_DLC_Pos)) +#define CAN_RXF1E_1_BRS_Pos 20 /**< \brief (CAN_RXF1E_1) Bit Rate Search */ +#define CAN_RXF1E_1_BRS (0x1u << CAN_RXF1E_1_BRS_Pos) +#define CAN_RXF1E_1_FDF_Pos 21 /**< \brief (CAN_RXF1E_1) FD Format */ +#define CAN_RXF1E_1_FDF (0x1u << CAN_RXF1E_1_FDF_Pos) +#define CAN_RXF1E_1_FIDX_Pos 24 /**< \brief (CAN_RXF1E_1) Filter Index */ +#define CAN_RXF1E_1_FIDX_Msk (0x7Fu << CAN_RXF1E_1_FIDX_Pos) +#define CAN_RXF1E_1_FIDX(value) (CAN_RXF1E_1_FIDX_Msk & ((value) << CAN_RXF1E_1_FIDX_Pos)) +#define CAN_RXF1E_1_ANMF_Pos 31 /**< \brief (CAN_RXF1E_1) Accepted Non-matching Frame */ +#define CAN_RXF1E_1_ANMF (0x1u << CAN_RXF1E_1_ANMF_Pos) +#define CAN_RXF1E_1_MASK 0xFF3FFFFFu /**< \brief (CAN_RXF1E_1) MASK Register */ + +/* -------- CAN_RXF1E_DATA : (CAN Offset: 0x08) (R/W 32) Rx FIFO 1 Element Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DB0:8; /*!< bit: 0.. 7 Data Byte 0 */ + uint32_t DB1:8; /*!< bit: 8..15 Data Byte 1 */ + uint32_t DB2:8; /*!< bit: 16..23 Data Byte 2 */ + uint32_t DB3:8; /*!< bit: 24..31 Data Byte 3 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_RXF1E_DATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_RXF1E_DATA_OFFSET 0x08 /**< \brief (CAN_RXF1E_DATA offset) Rx FIFO 1 Element Data */ +#define CAN_RXF1E_DATA_RESETVALUE 0x00000000u /**< \brief (CAN_RXF1E_DATA reset_value) Rx FIFO 1 Element Data */ + +#define CAN_RXF1E_DATA_DB0_Pos 0 /**< \brief (CAN_RXF1E_DATA) Data Byte 0 */ +#define CAN_RXF1E_DATA_DB0_Msk (0xFFu << CAN_RXF1E_DATA_DB0_Pos) +#define CAN_RXF1E_DATA_DB0(value) (CAN_RXF1E_DATA_DB0_Msk & ((value) << CAN_RXF1E_DATA_DB0_Pos)) +#define CAN_RXF1E_DATA_DB1_Pos 8 /**< \brief (CAN_RXF1E_DATA) Data Byte 1 */ +#define CAN_RXF1E_DATA_DB1_Msk (0xFFu << CAN_RXF1E_DATA_DB1_Pos) +#define CAN_RXF1E_DATA_DB1(value) (CAN_RXF1E_DATA_DB1_Msk & ((value) << CAN_RXF1E_DATA_DB1_Pos)) +#define CAN_RXF1E_DATA_DB2_Pos 16 /**< \brief (CAN_RXF1E_DATA) Data Byte 2 */ +#define CAN_RXF1E_DATA_DB2_Msk (0xFFu << CAN_RXF1E_DATA_DB2_Pos) +#define CAN_RXF1E_DATA_DB2(value) (CAN_RXF1E_DATA_DB2_Msk & ((value) << CAN_RXF1E_DATA_DB2_Pos)) +#define CAN_RXF1E_DATA_DB3_Pos 24 /**< \brief (CAN_RXF1E_DATA) Data Byte 3 */ +#define CAN_RXF1E_DATA_DB3_Msk (0xFFu << CAN_RXF1E_DATA_DB3_Pos) +#define CAN_RXF1E_DATA_DB3(value) (CAN_RXF1E_DATA_DB3_Msk & ((value) << CAN_RXF1E_DATA_DB3_Pos)) +#define CAN_RXF1E_DATA_MASK 0xFFFFFFFFu /**< \brief (CAN_RXF1E_DATA) MASK Register */ + +/* -------- CAN_SIDFE_0 : (CAN Offset: 0x00) (R/W 32) Standard Message ID Filter Element -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SFID2:11; /*!< bit: 0..10 Standard Filter ID 2 */ + uint32_t :5; /*!< bit: 11..15 Reserved */ + uint32_t SFID1:11; /*!< bit: 16..26 Standard Filter ID 1 */ + uint32_t SFEC:3; /*!< bit: 27..29 Standard Filter Element Configuration */ + uint32_t SFT:2; /*!< bit: 30..31 Standard Filter Type */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_SIDFE_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_SIDFE_0_OFFSET 0x00 /**< \brief (CAN_SIDFE_0 offset) Standard Message ID Filter Element */ +#define CAN_SIDFE_0_RESETVALUE 0x00000000u /**< \brief (CAN_SIDFE_0 reset_value) Standard Message ID Filter Element */ + +#define CAN_SIDFE_0_SFID2_Pos 0 /**< \brief (CAN_SIDFE_0) Standard Filter ID 2 */ +#define CAN_SIDFE_0_SFID2_Msk (0x7FFu << CAN_SIDFE_0_SFID2_Pos) +#define CAN_SIDFE_0_SFID2(value) (CAN_SIDFE_0_SFID2_Msk & ((value) << CAN_SIDFE_0_SFID2_Pos)) +#define CAN_SIDFE_0_SFID1_Pos 16 /**< \brief (CAN_SIDFE_0) Standard Filter ID 1 */ +#define CAN_SIDFE_0_SFID1_Msk (0x7FFu << CAN_SIDFE_0_SFID1_Pos) +#define CAN_SIDFE_0_SFID1(value) (CAN_SIDFE_0_SFID1_Msk & ((value) << CAN_SIDFE_0_SFID1_Pos)) +#define CAN_SIDFE_0_SFEC_Pos 27 /**< \brief (CAN_SIDFE_0) Standard Filter Element Configuration */ +#define CAN_SIDFE_0_SFEC_Msk (0x7u << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC(value) (CAN_SIDFE_0_SFEC_Msk & ((value) << CAN_SIDFE_0_SFEC_Pos)) +#define CAN_SIDFE_0_SFEC_DISABLE_Val 0x0u /**< \brief (CAN_SIDFE_0) Disable filter element */ +#define CAN_SIDFE_0_SFEC_STF0M_Val 0x1u /**< \brief (CAN_SIDFE_0) Store in Rx FIFO 0 if filter match */ +#define CAN_SIDFE_0_SFEC_STF1M_Val 0x2u /**< \brief (CAN_SIDFE_0) Store in Rx FIFO 1 if filter match */ +#define CAN_SIDFE_0_SFEC_REJECT_Val 0x3u /**< \brief (CAN_SIDFE_0) Reject ID if filter match */ +#define CAN_SIDFE_0_SFEC_PRIORITY_Val 0x4u /**< \brief (CAN_SIDFE_0) Set priority if filter match */ +#define CAN_SIDFE_0_SFEC_PRIF0M_Val 0x5u /**< \brief (CAN_SIDFE_0) Set priority and store in FIFO 0 if filter match */ +#define CAN_SIDFE_0_SFEC_PRIF1M_Val 0x6u /**< \brief (CAN_SIDFE_0) Set priority and store in FIFO 1 if filter match */ +#define CAN_SIDFE_0_SFEC_STRXBUF_Val 0x7u /**< \brief (CAN_SIDFE_0) Store into Rx Buffer */ +#define CAN_SIDFE_0_SFEC_DISABLE (CAN_SIDFE_0_SFEC_DISABLE_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_STF0M (CAN_SIDFE_0_SFEC_STF0M_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_STF1M (CAN_SIDFE_0_SFEC_STF1M_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_REJECT (CAN_SIDFE_0_SFEC_REJECT_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_PRIORITY (CAN_SIDFE_0_SFEC_PRIORITY_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_PRIF0M (CAN_SIDFE_0_SFEC_PRIF0M_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_PRIF1M (CAN_SIDFE_0_SFEC_PRIF1M_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFEC_STRXBUF (CAN_SIDFE_0_SFEC_STRXBUF_Val << CAN_SIDFE_0_SFEC_Pos) +#define CAN_SIDFE_0_SFT_Pos 30 /**< \brief (CAN_SIDFE_0) Standard Filter Type */ +#define CAN_SIDFE_0_SFT_Msk (0x3u << CAN_SIDFE_0_SFT_Pos) +#define CAN_SIDFE_0_SFT(value) (CAN_SIDFE_0_SFT_Msk & ((value) << CAN_SIDFE_0_SFT_Pos)) +#define CAN_SIDFE_0_SFT_RANGE_Val 0x0u /**< \brief (CAN_SIDFE_0) Range filter from SFID1 to SFID2 */ +#define CAN_SIDFE_0_SFT_DUAL_Val 0x1u /**< \brief (CAN_SIDFE_0) Dual ID filter for SFID1 or SFID2 */ +#define CAN_SIDFE_0_SFT_CLASSIC_Val 0x2u /**< \brief (CAN_SIDFE_0) Classic filter */ +#define CAN_SIDFE_0_SFT_RANGE (CAN_SIDFE_0_SFT_RANGE_Val << CAN_SIDFE_0_SFT_Pos) +#define CAN_SIDFE_0_SFT_DUAL (CAN_SIDFE_0_SFT_DUAL_Val << CAN_SIDFE_0_SFT_Pos) +#define CAN_SIDFE_0_SFT_CLASSIC (CAN_SIDFE_0_SFT_CLASSIC_Val << CAN_SIDFE_0_SFT_Pos) +#define CAN_SIDFE_0_MASK 0xFFFF07FFu /**< \brief (CAN_SIDFE_0) MASK Register */ + +/* -------- CAN_TXBE_0 : (CAN Offset: 0x00) (R/W 32) Tx Buffer Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ID:29; /*!< bit: 0..28 Identifier */ + uint32_t RTR:1; /*!< bit: 29 Remote Transmission Request */ + uint32_t XTD:1; /*!< bit: 30 Extended Identifier */ + uint32_t ESI:1; /*!< bit: 31 Error State Indicator */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBE_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBE_0_OFFSET 0x00 /**< \brief (CAN_TXBE_0 offset) Tx Buffer Element 0 */ +#define CAN_TXBE_0_RESETVALUE 0x00000000u /**< \brief (CAN_TXBE_0 reset_value) Tx Buffer Element 0 */ + +#define CAN_TXBE_0_ID_Pos 0 /**< \brief (CAN_TXBE_0) Identifier */ +#define CAN_TXBE_0_ID_Msk (0x1FFFFFFFu << CAN_TXBE_0_ID_Pos) +#define CAN_TXBE_0_ID(value) (CAN_TXBE_0_ID_Msk & ((value) << CAN_TXBE_0_ID_Pos)) +#define CAN_TXBE_0_RTR_Pos 29 /**< \brief (CAN_TXBE_0) Remote Transmission Request */ +#define CAN_TXBE_0_RTR (0x1u << CAN_TXBE_0_RTR_Pos) +#define CAN_TXBE_0_XTD_Pos 30 /**< \brief (CAN_TXBE_0) Extended Identifier */ +#define CAN_TXBE_0_XTD (0x1u << CAN_TXBE_0_XTD_Pos) +#define CAN_TXBE_0_ESI_Pos 31 /**< \brief (CAN_TXBE_0) Error State Indicator */ +#define CAN_TXBE_0_ESI (0x1u << CAN_TXBE_0_ESI_Pos) +#define CAN_TXBE_0_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBE_0) MASK Register */ + +/* -------- CAN_TXBE_1 : (CAN Offset: 0x04) (R/W 32) Tx Buffer Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :16; /*!< bit: 0..15 Reserved */ + uint32_t DLC:4; /*!< bit: 16..19 Identifier */ + uint32_t BRS:1; /*!< bit: 20 Bit Rate Search */ + uint32_t FDF:1; /*!< bit: 21 FD Format */ + uint32_t :1; /*!< bit: 22 Reserved */ + uint32_t EFC:1; /*!< bit: 23 Event FIFO Control */ + uint32_t MM:8; /*!< bit: 24..31 Message Marker */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBE_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBE_1_OFFSET 0x04 /**< \brief (CAN_TXBE_1 offset) Tx Buffer Element 1 */ +#define CAN_TXBE_1_RESETVALUE 0x00000000u /**< \brief (CAN_TXBE_1 reset_value) Tx Buffer Element 1 */ + +#define CAN_TXBE_1_DLC_Pos 16 /**< \brief (CAN_TXBE_1) Identifier */ +#define CAN_TXBE_1_DLC_Msk (0xFu << CAN_TXBE_1_DLC_Pos) +#define CAN_TXBE_1_DLC(value) (CAN_TXBE_1_DLC_Msk & ((value) << CAN_TXBE_1_DLC_Pos)) +#define CAN_TXBE_1_BRS_Pos 20 /**< \brief (CAN_TXBE_1) Bit Rate Search */ +#define CAN_TXBE_1_BRS (0x1u << CAN_TXBE_1_BRS_Pos) +#define CAN_TXBE_1_FDF_Pos 21 /**< \brief (CAN_TXBE_1) FD Format */ +#define CAN_TXBE_1_FDF (0x1u << CAN_TXBE_1_FDF_Pos) +#define CAN_TXBE_1_EFC_Pos 23 /**< \brief (CAN_TXBE_1) Event FIFO Control */ +#define CAN_TXBE_1_EFC (0x1u << CAN_TXBE_1_EFC_Pos) +#define CAN_TXBE_1_MM_Pos 24 /**< \brief (CAN_TXBE_1) Message Marker */ +#define CAN_TXBE_1_MM_Msk (0xFFu << CAN_TXBE_1_MM_Pos) +#define CAN_TXBE_1_MM(value) (CAN_TXBE_1_MM_Msk & ((value) << CAN_TXBE_1_MM_Pos)) +#define CAN_TXBE_1_MASK 0xFFBF0000u /**< \brief (CAN_TXBE_1) MASK Register */ + +/* -------- CAN_TXBE_DATA : (CAN Offset: 0x08) (R/W 32) Tx Buffer Element Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t DB0:8; /*!< bit: 0.. 7 Data Byte 0 */ + uint32_t DB1:8; /*!< bit: 8..15 Data Byte 1 */ + uint32_t DB2:8; /*!< bit: 16..23 Data Byte 2 */ + uint32_t DB3:8; /*!< bit: 24..31 Data Byte 3 */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXBE_DATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXBE_DATA_OFFSET 0x08 /**< \brief (CAN_TXBE_DATA offset) Tx Buffer Element Data */ +#define CAN_TXBE_DATA_RESETVALUE 0x00000000u /**< \brief (CAN_TXBE_DATA reset_value) Tx Buffer Element Data */ + +#define CAN_TXBE_DATA_DB0_Pos 0 /**< \brief (CAN_TXBE_DATA) Data Byte 0 */ +#define CAN_TXBE_DATA_DB0_Msk (0xFFu << CAN_TXBE_DATA_DB0_Pos) +#define CAN_TXBE_DATA_DB0(value) (CAN_TXBE_DATA_DB0_Msk & ((value) << CAN_TXBE_DATA_DB0_Pos)) +#define CAN_TXBE_DATA_DB1_Pos 8 /**< \brief (CAN_TXBE_DATA) Data Byte 1 */ +#define CAN_TXBE_DATA_DB1_Msk (0xFFu << CAN_TXBE_DATA_DB1_Pos) +#define CAN_TXBE_DATA_DB1(value) (CAN_TXBE_DATA_DB1_Msk & ((value) << CAN_TXBE_DATA_DB1_Pos)) +#define CAN_TXBE_DATA_DB2_Pos 16 /**< \brief (CAN_TXBE_DATA) Data Byte 2 */ +#define CAN_TXBE_DATA_DB2_Msk (0xFFu << CAN_TXBE_DATA_DB2_Pos) +#define CAN_TXBE_DATA_DB2(value) (CAN_TXBE_DATA_DB2_Msk & ((value) << CAN_TXBE_DATA_DB2_Pos)) +#define CAN_TXBE_DATA_DB3_Pos 24 /**< \brief (CAN_TXBE_DATA) Data Byte 3 */ +#define CAN_TXBE_DATA_DB3_Msk (0xFFu << CAN_TXBE_DATA_DB3_Pos) +#define CAN_TXBE_DATA_DB3(value) (CAN_TXBE_DATA_DB3_Msk & ((value) << CAN_TXBE_DATA_DB3_Pos)) +#define CAN_TXBE_DATA_MASK 0xFFFFFFFFu /**< \brief (CAN_TXBE_DATA) MASK Register */ + +/* -------- CAN_TXEFE_0 : (CAN Offset: 0x00) (R/W 32) Tx Event FIFO Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t ID:29; /*!< bit: 0..28 Identifier */ + uint32_t RTR:1; /*!< bit: 29 Remote Transmission Request */ + uint32_t XTD:1; /*!< bit: 30 Extended Indentifier */ + uint32_t ESI:1; /*!< bit: 31 Error State Indicator */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXEFE_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXEFE_0_OFFSET 0x00 /**< \brief (CAN_TXEFE_0 offset) Tx Event FIFO Element 0 */ +#define CAN_TXEFE_0_RESETVALUE 0x00000000u /**< \brief (CAN_TXEFE_0 reset_value) Tx Event FIFO Element 0 */ + +#define CAN_TXEFE_0_ID_Pos 0 /**< \brief (CAN_TXEFE_0) Identifier */ +#define CAN_TXEFE_0_ID_Msk (0x1FFFFFFFu << CAN_TXEFE_0_ID_Pos) +#define CAN_TXEFE_0_ID(value) (CAN_TXEFE_0_ID_Msk & ((value) << CAN_TXEFE_0_ID_Pos)) +#define CAN_TXEFE_0_RTR_Pos 29 /**< \brief (CAN_TXEFE_0) Remote Transmission Request */ +#define CAN_TXEFE_0_RTR (0x1u << CAN_TXEFE_0_RTR_Pos) +#define CAN_TXEFE_0_XTD_Pos 30 /**< \brief (CAN_TXEFE_0) Extended Indentifier */ +#define CAN_TXEFE_0_XTD (0x1u << CAN_TXEFE_0_XTD_Pos) +#define CAN_TXEFE_0_ESI_Pos 31 /**< \brief (CAN_TXEFE_0) Error State Indicator */ +#define CAN_TXEFE_0_ESI (0x1u << CAN_TXEFE_0_ESI_Pos) +#define CAN_TXEFE_0_MASK 0xFFFFFFFFu /**< \brief (CAN_TXEFE_0) MASK Register */ + +/* -------- CAN_TXEFE_1 : (CAN Offset: 0x04) (R/W 32) Tx Event FIFO Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t TXTS:16; /*!< bit: 0..15 Tx Timestamp */ + uint32_t DLC:4; /*!< bit: 16..19 Data Length Code */ + uint32_t BRS:1; /*!< bit: 20 Bit Rate Search */ + uint32_t FDF:1; /*!< bit: 21 FD Format */ + uint32_t ET:2; /*!< bit: 22..23 Event Type */ + uint32_t MM:8; /*!< bit: 24..31 Message Marker */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_TXEFE_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_TXEFE_1_OFFSET 0x04 /**< \brief (CAN_TXEFE_1 offset) Tx Event FIFO Element 1 */ +#define CAN_TXEFE_1_RESETVALUE 0x00000000u /**< \brief (CAN_TXEFE_1 reset_value) Tx Event FIFO Element 1 */ + +#define CAN_TXEFE_1_TXTS_Pos 0 /**< \brief (CAN_TXEFE_1) Tx Timestamp */ +#define CAN_TXEFE_1_TXTS_Msk (0xFFFFu << CAN_TXEFE_1_TXTS_Pos) +#define CAN_TXEFE_1_TXTS(value) (CAN_TXEFE_1_TXTS_Msk & ((value) << CAN_TXEFE_1_TXTS_Pos)) +#define CAN_TXEFE_1_DLC_Pos 16 /**< \brief (CAN_TXEFE_1) Data Length Code */ +#define CAN_TXEFE_1_DLC_Msk (0xFu << CAN_TXEFE_1_DLC_Pos) +#define CAN_TXEFE_1_DLC(value) (CAN_TXEFE_1_DLC_Msk & ((value) << CAN_TXEFE_1_DLC_Pos)) +#define CAN_TXEFE_1_BRS_Pos 20 /**< \brief (CAN_TXEFE_1) Bit Rate Search */ +#define CAN_TXEFE_1_BRS (0x1u << CAN_TXEFE_1_BRS_Pos) +#define CAN_TXEFE_1_FDF_Pos 21 /**< \brief (CAN_TXEFE_1) FD Format */ +#define CAN_TXEFE_1_FDF (0x1u << CAN_TXEFE_1_FDF_Pos) +#define CAN_TXEFE_1_ET_Pos 22 /**< \brief (CAN_TXEFE_1) Event Type */ +#define CAN_TXEFE_1_ET_Msk (0x3u << CAN_TXEFE_1_ET_Pos) +#define CAN_TXEFE_1_ET(value) (CAN_TXEFE_1_ET_Msk & ((value) << CAN_TXEFE_1_ET_Pos)) +#define CAN_TXEFE_1_ET_TXE_Val 0x1u /**< \brief (CAN_TXEFE_1) Tx event */ +#define CAN_TXEFE_1_ET_TXC_Val 0x2u /**< \brief (CAN_TXEFE_1) Transmission in spite of cancellation */ +#define CAN_TXEFE_1_ET_TXE (CAN_TXEFE_1_ET_TXE_Val << CAN_TXEFE_1_ET_Pos) +#define CAN_TXEFE_1_ET_TXC (CAN_TXEFE_1_ET_TXC_Val << CAN_TXEFE_1_ET_Pos) +#define CAN_TXEFE_1_MM_Pos 24 /**< \brief (CAN_TXEFE_1) Message Marker */ +#define CAN_TXEFE_1_MM_Msk (0xFFu << CAN_TXEFE_1_MM_Pos) +#define CAN_TXEFE_1_MM(value) (CAN_TXEFE_1_MM_Msk & ((value) << CAN_TXEFE_1_MM_Pos)) +#define CAN_TXEFE_1_MASK 0xFFFFFFFFu /**< \brief (CAN_TXEFE_1) MASK Register */ + +/* -------- CAN_XIDFE_0 : (CAN Offset: 0x00) (R/W 32) Extended Message ID Filter Element 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EFID1:29; /*!< bit: 0..28 Extended Filter ID 1 */ + uint32_t EFEC:3; /*!< bit: 29..31 Extended Filter Element Configuration */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_XIDFE_0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_XIDFE_0_OFFSET 0x00 /**< \brief (CAN_XIDFE_0 offset) Extended Message ID Filter Element 0 */ +#define CAN_XIDFE_0_RESETVALUE 0x00000000u /**< \brief (CAN_XIDFE_0 reset_value) Extended Message ID Filter Element 0 */ + +#define CAN_XIDFE_0_EFID1_Pos 0 /**< \brief (CAN_XIDFE_0) Extended Filter ID 1 */ +#define CAN_XIDFE_0_EFID1_Msk (0x1FFFFFFFu << CAN_XIDFE_0_EFID1_Pos) +#define CAN_XIDFE_0_EFID1(value) (CAN_XIDFE_0_EFID1_Msk & ((value) << CAN_XIDFE_0_EFID1_Pos)) +#define CAN_XIDFE_0_EFEC_Pos 29 /**< \brief (CAN_XIDFE_0) Extended Filter Element Configuration */ +#define CAN_XIDFE_0_EFEC_Msk (0x7u << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC(value) (CAN_XIDFE_0_EFEC_Msk & ((value) << CAN_XIDFE_0_EFEC_Pos)) +#define CAN_XIDFE_0_EFEC_DISABLE_Val 0x0u /**< \brief (CAN_XIDFE_0) Disable filter element */ +#define CAN_XIDFE_0_EFEC_STF0M_Val 0x1u /**< \brief (CAN_XIDFE_0) Store in Rx FIFO 0 if filter match */ +#define CAN_XIDFE_0_EFEC_STF1M_Val 0x2u /**< \brief (CAN_XIDFE_0) Store in Rx FIFO 1 if filter match */ +#define CAN_XIDFE_0_EFEC_REJECT_Val 0x3u /**< \brief (CAN_XIDFE_0) Reject ID if filter match */ +#define CAN_XIDFE_0_EFEC_PRIORITY_Val 0x4u /**< \brief (CAN_XIDFE_0) Set priority if filter match */ +#define CAN_XIDFE_0_EFEC_PRIF0M_Val 0x5u /**< \brief (CAN_XIDFE_0) Set priority and store in FIFO 0 if filter match */ +#define CAN_XIDFE_0_EFEC_PRIF1M_Val 0x6u /**< \brief (CAN_XIDFE_0) Set priority and store in FIFO 1 if filter match */ +#define CAN_XIDFE_0_EFEC_STRXBUF_Val 0x7u /**< \brief (CAN_XIDFE_0) Store into Rx Buffer */ +#define CAN_XIDFE_0_EFEC_DISABLE (CAN_XIDFE_0_EFEC_DISABLE_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_STF0M (CAN_XIDFE_0_EFEC_STF0M_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_STF1M (CAN_XIDFE_0_EFEC_STF1M_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_REJECT (CAN_XIDFE_0_EFEC_REJECT_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_PRIORITY (CAN_XIDFE_0_EFEC_PRIORITY_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_PRIF0M (CAN_XIDFE_0_EFEC_PRIF0M_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_PRIF1M (CAN_XIDFE_0_EFEC_PRIF1M_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_EFEC_STRXBUF (CAN_XIDFE_0_EFEC_STRXBUF_Val << CAN_XIDFE_0_EFEC_Pos) +#define CAN_XIDFE_0_MASK 0xFFFFFFFFu /**< \brief (CAN_XIDFE_0) MASK Register */ + +/* -------- CAN_XIDFE_1 : (CAN Offset: 0x04) (R/W 32) Extended Message ID Filter Element 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EFID2:29; /*!< bit: 0..28 Extended Filter ID 2 */ + uint32_t :1; /*!< bit: 29 Reserved */ + uint32_t EFT:2; /*!< bit: 30..31 Extended Filter Type */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CAN_XIDFE_1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CAN_XIDFE_1_OFFSET 0x04 /**< \brief (CAN_XIDFE_1 offset) Extended Message ID Filter Element 1 */ +#define CAN_XIDFE_1_RESETVALUE 0x00000000u /**< \brief (CAN_XIDFE_1 reset_value) Extended Message ID Filter Element 1 */ + +#define CAN_XIDFE_1_EFID2_Pos 0 /**< \brief (CAN_XIDFE_1) Extended Filter ID 2 */ +#define CAN_XIDFE_1_EFID2_Msk (0x1FFFFFFFu << CAN_XIDFE_1_EFID2_Pos) +#define CAN_XIDFE_1_EFID2(value) (CAN_XIDFE_1_EFID2_Msk & ((value) << CAN_XIDFE_1_EFID2_Pos)) +#define CAN_XIDFE_1_EFT_Pos 30 /**< \brief (CAN_XIDFE_1) Extended Filter Type */ +#define CAN_XIDFE_1_EFT_Msk (0x3u << CAN_XIDFE_1_EFT_Pos) +#define CAN_XIDFE_1_EFT(value) (CAN_XIDFE_1_EFT_Msk & ((value) << CAN_XIDFE_1_EFT_Pos)) +#define CAN_XIDFE_1_EFT_RANGEM_Val 0x0u /**< \brief (CAN_XIDFE_1) Range filter from EFID1 to EFID2 */ +#define CAN_XIDFE_1_EFT_DUAL_Val 0x1u /**< \brief (CAN_XIDFE_1) Dual ID filter for EFID1 or EFID2 */ +#define CAN_XIDFE_1_EFT_CLASSIC_Val 0x2u /**< \brief (CAN_XIDFE_1) Classic filter */ +#define CAN_XIDFE_1_EFT_RANGE_Val 0x3u /**< \brief (CAN_XIDFE_1) Range filter from EFID1 to EFID2 with no XIDAM mask */ +#define CAN_XIDFE_1_EFT_RANGEM (CAN_XIDFE_1_EFT_RANGEM_Val << CAN_XIDFE_1_EFT_Pos) +#define CAN_XIDFE_1_EFT_DUAL (CAN_XIDFE_1_EFT_DUAL_Val << CAN_XIDFE_1_EFT_Pos) +#define CAN_XIDFE_1_EFT_CLASSIC (CAN_XIDFE_1_EFT_CLASSIC_Val << CAN_XIDFE_1_EFT_Pos) +#define CAN_XIDFE_1_EFT_RANGE (CAN_XIDFE_1_EFT_RANGE_Val << CAN_XIDFE_1_EFT_Pos) +#define CAN_XIDFE_1_MASK 0xDFFFFFFFu /**< \brief (CAN_XIDFE_1) MASK Register */ + +/** \brief CAN APB hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __I CAN_CREL_Type CREL; /**< \brief Offset: 0x00 (R/ 32) Core Release */ + __I CAN_ENDN_Type ENDN; /**< \brief Offset: 0x04 (R/ 32) Endian */ + __IO CAN_MRCFG_Type MRCFG; /**< \brief Offset: 0x08 (R/W 32) Message RAM Configuration */ + __IO CAN_DBTP_Type DBTP; /**< \brief Offset: 0x0C (R/W 32) Fast Bit Timing and Prescaler */ + __IO CAN_TEST_Type TEST; /**< \brief Offset: 0x10 (R/W 32) Test */ + __IO CAN_RWD_Type RWD; /**< \brief Offset: 0x14 (R/W 32) RAM Watchdog */ + __IO CAN_CCCR_Type CCCR; /**< \brief Offset: 0x18 (R/W 32) CC Control */ + __IO CAN_NBTP_Type NBTP; /**< \brief Offset: 0x1C (R/W 32) Nominal Bit Timing and Prescaler */ + __IO CAN_TSCC_Type TSCC; /**< \brief Offset: 0x20 (R/W 32) Timestamp Counter Configuration */ + __I CAN_TSCV_Type TSCV; /**< \brief Offset: 0x24 (R/ 32) Timestamp Counter Value */ + __IO CAN_TOCC_Type TOCC; /**< \brief Offset: 0x28 (R/W 32) Timeout Counter Configuration */ + __IO CAN_TOCV_Type TOCV; /**< \brief Offset: 0x2C (R/W 32) Timeout Counter Value */ + RoReg8 Reserved1[0x10]; + __I CAN_ECR_Type ECR; /**< \brief Offset: 0x40 (R/ 32) Error Counter */ + __I CAN_PSR_Type PSR; /**< \brief Offset: 0x44 (R/ 32) Protocol Status */ + __IO CAN_TDCR_Type TDCR; /**< \brief Offset: 0x48 (R/W 32) Extended ID Filter Configuration */ + RoReg8 Reserved2[0x4]; + __IO CAN_IR_Type IR; /**< \brief Offset: 0x50 (R/W 32) Interrupt */ + __IO CAN_IE_Type IE; /**< \brief Offset: 0x54 (R/W 32) Interrupt Enable */ + __IO CAN_ILS_Type ILS; /**< \brief Offset: 0x58 (R/W 32) Interrupt Line Select */ + __IO CAN_ILE_Type ILE; /**< \brief Offset: 0x5C (R/W 32) Interrupt Line Enable */ + RoReg8 Reserved3[0x20]; + __IO CAN_GFC_Type GFC; /**< \brief Offset: 0x80 (R/W 32) Global Filter Configuration */ + __IO CAN_SIDFC_Type SIDFC; /**< \brief Offset: 0x84 (R/W 32) Standard ID Filter Configuration */ + __IO CAN_XIDFC_Type XIDFC; /**< \brief Offset: 0x88 (R/W 32) Extended ID Filter Configuration */ + RoReg8 Reserved4[0x4]; + __IO CAN_XIDAM_Type XIDAM; /**< \brief Offset: 0x90 (R/W 32) Extended ID AND Mask */ + __I CAN_HPMS_Type HPMS; /**< \brief Offset: 0x94 (R/ 32) High Priority Message Status */ + __IO CAN_NDAT1_Type NDAT1; /**< \brief Offset: 0x98 (R/W 32) New Data 1 */ + __IO CAN_NDAT2_Type NDAT2; /**< \brief Offset: 0x9C (R/W 32) New Data 2 */ + __IO CAN_RXF0C_Type RXF0C; /**< \brief Offset: 0xA0 (R/W 32) Rx FIFO 0 Configuration */ + __I CAN_RXF0S_Type RXF0S; /**< \brief Offset: 0xA4 (R/ 32) Rx FIFO 0 Status */ + __IO CAN_RXF0A_Type RXF0A; /**< \brief Offset: 0xA8 (R/W 32) Rx FIFO 0 Acknowledge */ + __IO CAN_RXBC_Type RXBC; /**< \brief Offset: 0xAC (R/W 32) Rx Buffer Configuration */ + __IO CAN_RXF1C_Type RXF1C; /**< \brief Offset: 0xB0 (R/W 32) Rx FIFO 1 Configuration */ + __I CAN_RXF1S_Type RXF1S; /**< \brief Offset: 0xB4 (R/ 32) Rx FIFO 1 Status */ + __IO CAN_RXF1A_Type RXF1A; /**< \brief Offset: 0xB8 (R/W 32) Rx FIFO 1 Acknowledge */ + __IO CAN_RXESC_Type RXESC; /**< \brief Offset: 0xBC (R/W 32) Rx Buffer / FIFO Element Size Configuration */ + __IO CAN_TXBC_Type TXBC; /**< \brief Offset: 0xC0 (R/W 32) Tx Buffer Configuration */ + __I CAN_TXFQS_Type TXFQS; /**< \brief Offset: 0xC4 (R/ 32) Tx FIFO / Queue Status */ + __IO CAN_TXESC_Type TXESC; /**< \brief Offset: 0xC8 (R/W 32) Tx Buffer Element Size Configuration */ + __I CAN_TXBRP_Type TXBRP; /**< \brief Offset: 0xCC (R/ 32) Tx Buffer Request Pending */ + __IO CAN_TXBAR_Type TXBAR; /**< \brief Offset: 0xD0 (R/W 32) Tx Buffer Add Request */ + __IO CAN_TXBCR_Type TXBCR; /**< \brief Offset: 0xD4 (R/W 32) Tx Buffer Cancellation Request */ + __I CAN_TXBTO_Type TXBTO; /**< \brief Offset: 0xD8 (R/ 32) Tx Buffer Transmission Occurred */ + __I CAN_TXBCF_Type TXBCF; /**< \brief Offset: 0xDC (R/ 32) Tx Buffer Cancellation Finished */ + __IO CAN_TXBTIE_Type TXBTIE; /**< \brief Offset: 0xE0 (R/W 32) Tx Buffer Transmission Interrupt Enable */ + __IO CAN_TXBCIE_Type TXBCIE; /**< \brief Offset: 0xE4 (R/W 32) Tx Buffer Cancellation Finished Interrupt Enable */ + RoReg8 Reserved5[0x8]; + __IO CAN_TXEFC_Type TXEFC; /**< \brief Offset: 0xF0 (R/W 32) Tx Event FIFO Configuration */ + __I CAN_TXEFS_Type TXEFS; /**< \brief Offset: 0xF4 (R/ 32) Tx Event FIFO Status */ + __IO CAN_TXEFA_Type TXEFA; /**< \brief Offset: 0xF8 (R/W 32) Tx Event FIFO Acknowledge */ +} Can; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_rxbe hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_RXBE_0_Type RXBE_0; /**< \brief Offset: 0x00 (R/W 32) Rx Buffer Element 0 */ + __IO CAN_RXBE_1_Type RXBE_1; /**< \brief Offset: 0x04 (R/W 32) Rx Buffer Element 1 */ + __IO CAN_RXBE_DATA_Type RXBE_DATA[16]; /**< \brief Offset: 0x08 (R/W 32) Rx Buffer Element Data */ +} CanMramRxbe +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_rxf0e hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_RXF0E_0_Type RXF0E_0; /**< \brief Offset: 0x00 (R/W 32) Rx FIFO 0 Element 0 */ + __IO CAN_RXF0E_1_Type RXF0E_1; /**< \brief Offset: 0x04 (R/W 32) Rx FIFO 0 Element 1 */ + __IO CAN_RXF0E_DATA_Type RXF0E_DATA[16]; /**< \brief Offset: 0x08 (R/W 32) Rx FIFO 0 Element Data */ +} CanMramRxf0e +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_rxf1e hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_RXF1E_0_Type RXF1E_0; /**< \brief Offset: 0x00 (R/W 32) Rx FIFO 1 Element 0 */ + __IO CAN_RXF1E_1_Type RXF1E_1; /**< \brief Offset: 0x04 (R/W 32) Rx FIFO 1 Element 1 */ + __IO CAN_RXF1E_DATA_Type RXF1E_DATA[16]; /**< \brief Offset: 0x08 (R/W 32) Rx FIFO 1 Element Data */ +} CanMramRxf1e +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_sidfe hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_SIDFE_0_Type SIDFE_0; /**< \brief Offset: 0x00 (R/W 32) Standard Message ID Filter Element */ +} CanMramSidfe +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_txbe hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_TXBE_0_Type TXBE_0; /**< \brief Offset: 0x00 (R/W 32) Tx Buffer Element 0 */ + __IO CAN_TXBE_1_Type TXBE_1; /**< \brief Offset: 0x04 (R/W 32) Tx Buffer Element 1 */ + __IO CAN_TXBE_DATA_Type TXBE_DATA[16]; /**< \brief Offset: 0x08 (R/W 32) Tx Buffer Element Data */ +} CanMramTxbe +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_txefe hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_TXEFE_0_Type TXEFE_0; /**< \brief Offset: 0x00 (R/W 32) Tx Event FIFO Element 0 */ + __IO CAN_TXEFE_1_Type TXEFE_1; /**< \brief Offset: 0x04 (R/W 32) Tx Event FIFO Element 1 */ +} CanMramTxefe +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief CAN Mram_xifde hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CAN_XIDFE_0_Type XIDFE_0; /**< \brief Offset: 0x00 (R/W 32) Extended Message ID Filter Element 0 */ + __IO CAN_XIDFE_1_Type XIDFE_1; /**< \brief Offset: 0x04 (R/W 32) Extended Message ID Filter Element 1 */ +} CanMramXifde +#ifdef __GNUC__ + __attribute__ ((aligned (4))) +#endif +; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define SECTION_CAN_MRAM_RXBE + +#define SECTION_CAN_MRAM_RXF0E + +#define SECTION_CAN_MRAM_RXF1E + +#define SECTION_CAN_MRAM_SIDFE + +#define SECTION_CAN_MRAM_TXBE + +#define SECTION_CAN_MRAM_TXEFE + +#define SECTION_CAN_MRAM_XIFDE + +/*@}*/ + +#endif /* _SAMD51_CAN_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ccl.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ccl.h new file mode 100644 index 0000000000..890e81edf6 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/ccl.h @@ -0,0 +1,228 @@ +/** + * \file + * + * \brief Component description for CCL + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_CCL_COMPONENT_ +#define _SAMD51_CCL_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR CCL */ +/* ========================================================================== */ +/** \addtogroup SAMD51_CCL Configurable Custom Logic */ +/*@{*/ + +#define CCL_U2225 +#define REV_CCL 0x110 + +/* -------- CCL_CTRL : (CCL Offset: 0x0) (R/W 8) Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SWRST:1; /*!< bit: 0 Software Reset */ + uint8_t ENABLE:1; /*!< bit: 1 Enable */ + uint8_t :4; /*!< bit: 2.. 5 Reserved */ + uint8_t RUNSTDBY:1; /*!< bit: 6 Run in Standby */ + uint8_t :1; /*!< bit: 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} CCL_CTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CCL_CTRL_OFFSET 0x0 /**< \brief (CCL_CTRL offset) Control */ +#define CCL_CTRL_RESETVALUE _U_(0x00) /**< \brief (CCL_CTRL reset_value) Control */ + +#define CCL_CTRL_SWRST_Pos 0 /**< \brief (CCL_CTRL) Software Reset */ +#define CCL_CTRL_SWRST (_U_(0x1) << CCL_CTRL_SWRST_Pos) +#define CCL_CTRL_ENABLE_Pos 1 /**< \brief (CCL_CTRL) Enable */ +#define CCL_CTRL_ENABLE (_U_(0x1) << CCL_CTRL_ENABLE_Pos) +#define CCL_CTRL_RUNSTDBY_Pos 6 /**< \brief (CCL_CTRL) Run in Standby */ +#define CCL_CTRL_RUNSTDBY (_U_(0x1) << CCL_CTRL_RUNSTDBY_Pos) +#define CCL_CTRL_MASK _U_(0x43) /**< \brief (CCL_CTRL) MASK Register */ + +/* -------- CCL_SEQCTRL : (CCL Offset: 0x4) (R/W 8) SEQ Control x -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SEQSEL:4; /*!< bit: 0.. 3 Sequential Selection */ + uint8_t :4; /*!< bit: 4.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} CCL_SEQCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CCL_SEQCTRL_OFFSET 0x4 /**< \brief (CCL_SEQCTRL offset) SEQ Control x */ +#define CCL_SEQCTRL_RESETVALUE _U_(0x00) /**< \brief (CCL_SEQCTRL reset_value) SEQ Control x */ + +#define CCL_SEQCTRL_SEQSEL_Pos 0 /**< \brief (CCL_SEQCTRL) Sequential Selection */ +#define CCL_SEQCTRL_SEQSEL_Msk (_U_(0xF) << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_SEQSEL(value) (CCL_SEQCTRL_SEQSEL_Msk & ((value) << CCL_SEQCTRL_SEQSEL_Pos)) +#define CCL_SEQCTRL_SEQSEL_DISABLE_Val _U_(0x0) /**< \brief (CCL_SEQCTRL) Sequential logic is disabled */ +#define CCL_SEQCTRL_SEQSEL_DFF_Val _U_(0x1) /**< \brief (CCL_SEQCTRL) D flip flop */ +#define CCL_SEQCTRL_SEQSEL_JK_Val _U_(0x2) /**< \brief (CCL_SEQCTRL) JK flip flop */ +#define CCL_SEQCTRL_SEQSEL_LATCH_Val _U_(0x3) /**< \brief (CCL_SEQCTRL) D latch */ +#define CCL_SEQCTRL_SEQSEL_RS_Val _U_(0x4) /**< \brief (CCL_SEQCTRL) RS latch */ +#define CCL_SEQCTRL_SEQSEL_DISABLE (CCL_SEQCTRL_SEQSEL_DISABLE_Val << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_SEQSEL_DFF (CCL_SEQCTRL_SEQSEL_DFF_Val << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_SEQSEL_JK (CCL_SEQCTRL_SEQSEL_JK_Val << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_SEQSEL_LATCH (CCL_SEQCTRL_SEQSEL_LATCH_Val << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_SEQSEL_RS (CCL_SEQCTRL_SEQSEL_RS_Val << CCL_SEQCTRL_SEQSEL_Pos) +#define CCL_SEQCTRL_MASK _U_(0x0F) /**< \brief (CCL_SEQCTRL) MASK Register */ + +/* -------- CCL_LUTCTRL : (CCL Offset: 0x8) (R/W 32) LUT Control x -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :1; /*!< bit: 0 Reserved */ + uint32_t ENABLE:1; /*!< bit: 1 LUT Enable */ + uint32_t :2; /*!< bit: 2.. 3 Reserved */ + uint32_t FILTSEL:2; /*!< bit: 4.. 5 Filter Selection */ + uint32_t :1; /*!< bit: 6 Reserved */ + uint32_t EDGESEL:1; /*!< bit: 7 Edge Selection */ + uint32_t INSEL0:4; /*!< bit: 8..11 Input Selection 0 */ + uint32_t INSEL1:4; /*!< bit: 12..15 Input Selection 1 */ + uint32_t INSEL2:4; /*!< bit: 16..19 Input Selection 2 */ + uint32_t INVEI:1; /*!< bit: 20 Inverted Event Input Enable */ + uint32_t LUTEI:1; /*!< bit: 21 LUT Event Input Enable */ + uint32_t LUTEO:1; /*!< bit: 22 LUT Event Output Enable */ + uint32_t :1; /*!< bit: 23 Reserved */ + uint32_t TRUTH:8; /*!< bit: 24..31 Truth Value */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CCL_LUTCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CCL_LUTCTRL_OFFSET 0x8 /**< \brief (CCL_LUTCTRL offset) LUT Control x */ +#define CCL_LUTCTRL_RESETVALUE _U_(0x00000000) /**< \brief (CCL_LUTCTRL reset_value) LUT Control x */ + +#define CCL_LUTCTRL_ENABLE_Pos 1 /**< \brief (CCL_LUTCTRL) LUT Enable */ +#define CCL_LUTCTRL_ENABLE (_U_(0x1) << CCL_LUTCTRL_ENABLE_Pos) +#define CCL_LUTCTRL_FILTSEL_Pos 4 /**< \brief (CCL_LUTCTRL) Filter Selection */ +#define CCL_LUTCTRL_FILTSEL_Msk (_U_(0x3) << CCL_LUTCTRL_FILTSEL_Pos) +#define CCL_LUTCTRL_FILTSEL(value) (CCL_LUTCTRL_FILTSEL_Msk & ((value) << CCL_LUTCTRL_FILTSEL_Pos)) +#define CCL_LUTCTRL_FILTSEL_DISABLE_Val _U_(0x0) /**< \brief (CCL_LUTCTRL) Filter disabled */ +#define CCL_LUTCTRL_FILTSEL_SYNCH_Val _U_(0x1) /**< \brief (CCL_LUTCTRL) Synchronizer enabled */ +#define CCL_LUTCTRL_FILTSEL_FILTER_Val _U_(0x2) /**< \brief (CCL_LUTCTRL) Filter enabled */ +#define CCL_LUTCTRL_FILTSEL_DISABLE (CCL_LUTCTRL_FILTSEL_DISABLE_Val << CCL_LUTCTRL_FILTSEL_Pos) +#define CCL_LUTCTRL_FILTSEL_SYNCH (CCL_LUTCTRL_FILTSEL_SYNCH_Val << CCL_LUTCTRL_FILTSEL_Pos) +#define CCL_LUTCTRL_FILTSEL_FILTER (CCL_LUTCTRL_FILTSEL_FILTER_Val << CCL_LUTCTRL_FILTSEL_Pos) +#define CCL_LUTCTRL_EDGESEL_Pos 7 /**< \brief (CCL_LUTCTRL) Edge Selection */ +#define CCL_LUTCTRL_EDGESEL (_U_(0x1) << CCL_LUTCTRL_EDGESEL_Pos) +#define CCL_LUTCTRL_INSEL0_Pos 8 /**< \brief (CCL_LUTCTRL) Input Selection 0 */ +#define CCL_LUTCTRL_INSEL0_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0(value) (CCL_LUTCTRL_INSEL0_Msk & ((value) << CCL_LUTCTRL_INSEL0_Pos)) +#define CCL_LUTCTRL_INSEL0_MASK_Val _U_(0x0) /**< \brief (CCL_LUTCTRL) Masked input */ +#define CCL_LUTCTRL_INSEL0_FEEDBACK_Val _U_(0x1) /**< \brief (CCL_LUTCTRL) Feedback input source */ +#define CCL_LUTCTRL_INSEL0_LINK_Val _U_(0x2) /**< \brief (CCL_LUTCTRL) Linked LUT input source */ +#define CCL_LUTCTRL_INSEL0_EVENT_Val _U_(0x3) /**< \brief (CCL_LUTCTRL) Event input source */ +#define CCL_LUTCTRL_INSEL0_IO_Val _U_(0x4) /**< \brief (CCL_LUTCTRL) I/O pin input source */ +#define CCL_LUTCTRL_INSEL0_AC_Val _U_(0x5) /**< \brief (CCL_LUTCTRL) AC input source */ +#define CCL_LUTCTRL_INSEL0_TC_Val _U_(0x6) /**< \brief (CCL_LUTCTRL) TC input source */ +#define CCL_LUTCTRL_INSEL0_ALTTC_Val _U_(0x7) /**< \brief (CCL_LUTCTRL) Alternate TC input source */ +#define CCL_LUTCTRL_INSEL0_TCC_Val _U_(0x8) /**< \brief (CCL_LUTCTRL) TCC input source */ +#define CCL_LUTCTRL_INSEL0_SERCOM_Val _U_(0x9) /**< \brief (CCL_LUTCTRL) SERCOM input source */ +#define CCL_LUTCTRL_INSEL0_MASK (CCL_LUTCTRL_INSEL0_MASK_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_FEEDBACK (CCL_LUTCTRL_INSEL0_FEEDBACK_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_LINK (CCL_LUTCTRL_INSEL0_LINK_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_EVENT (CCL_LUTCTRL_INSEL0_EVENT_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_IO (CCL_LUTCTRL_INSEL0_IO_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_AC (CCL_LUTCTRL_INSEL0_AC_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_TC (CCL_LUTCTRL_INSEL0_TC_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_ALTTC (CCL_LUTCTRL_INSEL0_ALTTC_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_TCC (CCL_LUTCTRL_INSEL0_TCC_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL0_SERCOM (CCL_LUTCTRL_INSEL0_SERCOM_Val << CCL_LUTCTRL_INSEL0_Pos) +#define CCL_LUTCTRL_INSEL1_Pos 12 /**< \brief (CCL_LUTCTRL) Input Selection 1 */ +#define CCL_LUTCTRL_INSEL1_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1(value) (CCL_LUTCTRL_INSEL1_Msk & ((value) << CCL_LUTCTRL_INSEL1_Pos)) +#define CCL_LUTCTRL_INSEL1_MASK_Val _U_(0x0) /**< \brief (CCL_LUTCTRL) Masked input */ +#define CCL_LUTCTRL_INSEL1_FEEDBACK_Val _U_(0x1) /**< \brief (CCL_LUTCTRL) Feedback input source */ +#define CCL_LUTCTRL_INSEL1_LINK_Val _U_(0x2) /**< \brief (CCL_LUTCTRL) Linked LUT input source */ +#define CCL_LUTCTRL_INSEL1_EVENT_Val _U_(0x3) /**< \brief (CCL_LUTCTRL) Event input source */ +#define CCL_LUTCTRL_INSEL1_IO_Val _U_(0x4) /**< \brief (CCL_LUTCTRL) I/O pin input source */ +#define CCL_LUTCTRL_INSEL1_AC_Val _U_(0x5) /**< \brief (CCL_LUTCTRL) AC input source */ +#define CCL_LUTCTRL_INSEL1_TC_Val _U_(0x6) /**< \brief (CCL_LUTCTRL) TC input source */ +#define CCL_LUTCTRL_INSEL1_ALTTC_Val _U_(0x7) /**< \brief (CCL_LUTCTRL) Alternate TC input source */ +#define CCL_LUTCTRL_INSEL1_TCC_Val _U_(0x8) /**< \brief (CCL_LUTCTRL) TCC input source */ +#define CCL_LUTCTRL_INSEL1_SERCOM_Val _U_(0x9) /**< \brief (CCL_LUTCTRL) SERCOM input source */ +#define CCL_LUTCTRL_INSEL1_MASK (CCL_LUTCTRL_INSEL1_MASK_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_FEEDBACK (CCL_LUTCTRL_INSEL1_FEEDBACK_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_LINK (CCL_LUTCTRL_INSEL1_LINK_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_EVENT (CCL_LUTCTRL_INSEL1_EVENT_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_IO (CCL_LUTCTRL_INSEL1_IO_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_AC (CCL_LUTCTRL_INSEL1_AC_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_TC (CCL_LUTCTRL_INSEL1_TC_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_ALTTC (CCL_LUTCTRL_INSEL1_ALTTC_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_TCC (CCL_LUTCTRL_INSEL1_TCC_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL1_SERCOM (CCL_LUTCTRL_INSEL1_SERCOM_Val << CCL_LUTCTRL_INSEL1_Pos) +#define CCL_LUTCTRL_INSEL2_Pos 16 /**< \brief (CCL_LUTCTRL) Input Selection 2 */ +#define CCL_LUTCTRL_INSEL2_Msk (_U_(0xF) << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2(value) (CCL_LUTCTRL_INSEL2_Msk & ((value) << CCL_LUTCTRL_INSEL2_Pos)) +#define CCL_LUTCTRL_INSEL2_MASK_Val _U_(0x0) /**< \brief (CCL_LUTCTRL) Masked input */ +#define CCL_LUTCTRL_INSEL2_FEEDBACK_Val _U_(0x1) /**< \brief (CCL_LUTCTRL) Feedback input source */ +#define CCL_LUTCTRL_INSEL2_LINK_Val _U_(0x2) /**< \brief (CCL_LUTCTRL) Linked LUT input source */ +#define CCL_LUTCTRL_INSEL2_EVENT_Val _U_(0x3) /**< \brief (CCL_LUTCTRL) Event input source */ +#define CCL_LUTCTRL_INSEL2_IO_Val _U_(0x4) /**< \brief (CCL_LUTCTRL) I/O pin input source */ +#define CCL_LUTCTRL_INSEL2_AC_Val _U_(0x5) /**< \brief (CCL_LUTCTRL) AC input source */ +#define CCL_LUTCTRL_INSEL2_TC_Val _U_(0x6) /**< \brief (CCL_LUTCTRL) TC input source */ +#define CCL_LUTCTRL_INSEL2_ALTTC_Val _U_(0x7) /**< \brief (CCL_LUTCTRL) Alternate TC input source */ +#define CCL_LUTCTRL_INSEL2_TCC_Val _U_(0x8) /**< \brief (CCL_LUTCTRL) TCC input source */ +#define CCL_LUTCTRL_INSEL2_SERCOM_Val _U_(0x9) /**< \brief (CCL_LUTCTRL) SERCOM input source */ +#define CCL_LUTCTRL_INSEL2_MASK (CCL_LUTCTRL_INSEL2_MASK_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_FEEDBACK (CCL_LUTCTRL_INSEL2_FEEDBACK_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_LINK (CCL_LUTCTRL_INSEL2_LINK_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_EVENT (CCL_LUTCTRL_INSEL2_EVENT_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_IO (CCL_LUTCTRL_INSEL2_IO_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_AC (CCL_LUTCTRL_INSEL2_AC_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_TC (CCL_LUTCTRL_INSEL2_TC_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_ALTTC (CCL_LUTCTRL_INSEL2_ALTTC_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_TCC (CCL_LUTCTRL_INSEL2_TCC_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INSEL2_SERCOM (CCL_LUTCTRL_INSEL2_SERCOM_Val << CCL_LUTCTRL_INSEL2_Pos) +#define CCL_LUTCTRL_INVEI_Pos 20 /**< \brief (CCL_LUTCTRL) Inverted Event Input Enable */ +#define CCL_LUTCTRL_INVEI (_U_(0x1) << CCL_LUTCTRL_INVEI_Pos) +#define CCL_LUTCTRL_LUTEI_Pos 21 /**< \brief (CCL_LUTCTRL) LUT Event Input Enable */ +#define CCL_LUTCTRL_LUTEI (_U_(0x1) << CCL_LUTCTRL_LUTEI_Pos) +#define CCL_LUTCTRL_LUTEO_Pos 22 /**< \brief (CCL_LUTCTRL) LUT Event Output Enable */ +#define CCL_LUTCTRL_LUTEO (_U_(0x1) << CCL_LUTCTRL_LUTEO_Pos) +#define CCL_LUTCTRL_TRUTH_Pos 24 /**< \brief (CCL_LUTCTRL) Truth Value */ +#define CCL_LUTCTRL_TRUTH_Msk (_U_(0xFF) << CCL_LUTCTRL_TRUTH_Pos) +#define CCL_LUTCTRL_TRUTH(value) (CCL_LUTCTRL_TRUTH_Msk & ((value) << CCL_LUTCTRL_TRUTH_Pos)) +#define CCL_LUTCTRL_MASK _U_(0xFF7FFFB2) /**< \brief (CCL_LUTCTRL) MASK Register */ + +/** \brief CCL hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO CCL_CTRL_Type CTRL; /**< \brief Offset: 0x0 (R/W 8) Control */ + RoReg8 Reserved1[0x3]; + __IO CCL_SEQCTRL_Type SEQCTRL[2]; /**< \brief Offset: 0x4 (R/W 8) SEQ Control x */ + RoReg8 Reserved2[0x2]; + __IO CCL_LUTCTRL_Type LUTCTRL[4]; /**< \brief Offset: 0x8 (R/W 32) LUT Control x */ +} Ccl; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_CCL_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/cmcc.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/cmcc.h new file mode 100644 index 0000000000..92fa6813ef --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/cmcc.h @@ -0,0 +1,357 @@ +/** + * \file + * + * \brief Component description for CMCC + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_CMCC_COMPONENT_ +#define _SAMD51_CMCC_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR CMCC */ +/* ========================================================================== */ +/** \addtogroup SAMD51_CMCC Cortex M Cache Controller */ +/*@{*/ + +#define CMCC_U2015 +#define REV_CMCC 0x600 + +/* -------- CMCC_TYPE : (CMCC Offset: 0x00) (R/ 32) Cache Type Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :1; /*!< bit: 0 Reserved */ + uint32_t GCLK:1; /*!< bit: 1 dynamic Clock Gating supported */ + uint32_t :2; /*!< bit: 2.. 3 Reserved */ + uint32_t RRP:1; /*!< bit: 4 Round Robin Policy supported */ + uint32_t WAYNUM:2; /*!< bit: 5.. 6 Number of Way */ + uint32_t LCKDOWN:1; /*!< bit: 7 Lock Down supported */ + uint32_t CSIZE:3; /*!< bit: 8..10 Cache Size */ + uint32_t CLSIZE:3; /*!< bit: 11..13 Cache Line Size */ + uint32_t :18; /*!< bit: 14..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_TYPE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_TYPE_OFFSET 0x00 /**< \brief (CMCC_TYPE offset) Cache Type Register */ +#define CMCC_TYPE_RESETVALUE _U_(0x000012D2) /**< \brief (CMCC_TYPE reset_value) Cache Type Register */ + +#define CMCC_TYPE_GCLK_Pos 1 /**< \brief (CMCC_TYPE) dynamic Clock Gating supported */ +#define CMCC_TYPE_GCLK (_U_(0x1) << CMCC_TYPE_GCLK_Pos) +#define CMCC_TYPE_RRP_Pos 4 /**< \brief (CMCC_TYPE) Round Robin Policy supported */ +#define CMCC_TYPE_RRP (_U_(0x1) << CMCC_TYPE_RRP_Pos) +#define CMCC_TYPE_WAYNUM_Pos 5 /**< \brief (CMCC_TYPE) Number of Way */ +#define CMCC_TYPE_WAYNUM_Msk (_U_(0x3) << CMCC_TYPE_WAYNUM_Pos) +#define CMCC_TYPE_WAYNUM(value) (CMCC_TYPE_WAYNUM_Msk & ((value) << CMCC_TYPE_WAYNUM_Pos)) +#define CMCC_TYPE_WAYNUM_DMAPPED_Val _U_(0x0) /**< \brief (CMCC_TYPE) Direct Mapped Cache */ +#define CMCC_TYPE_WAYNUM_ARCH2WAY_Val _U_(0x1) /**< \brief (CMCC_TYPE) 2-WAY set associative */ +#define CMCC_TYPE_WAYNUM_ARCH4WAY_Val _U_(0x2) /**< \brief (CMCC_TYPE) 4-WAY set associative */ +#define CMCC_TYPE_WAYNUM_DMAPPED (CMCC_TYPE_WAYNUM_DMAPPED_Val << CMCC_TYPE_WAYNUM_Pos) +#define CMCC_TYPE_WAYNUM_ARCH2WAY (CMCC_TYPE_WAYNUM_ARCH2WAY_Val << CMCC_TYPE_WAYNUM_Pos) +#define CMCC_TYPE_WAYNUM_ARCH4WAY (CMCC_TYPE_WAYNUM_ARCH4WAY_Val << CMCC_TYPE_WAYNUM_Pos) +#define CMCC_TYPE_LCKDOWN_Pos 7 /**< \brief (CMCC_TYPE) Lock Down supported */ +#define CMCC_TYPE_LCKDOWN (_U_(0x1) << CMCC_TYPE_LCKDOWN_Pos) +#define CMCC_TYPE_CSIZE_Pos 8 /**< \brief (CMCC_TYPE) Cache Size */ +#define CMCC_TYPE_CSIZE_Msk (_U_(0x7) << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE(value) (CMCC_TYPE_CSIZE_Msk & ((value) << CMCC_TYPE_CSIZE_Pos)) +#define CMCC_TYPE_CSIZE_CSIZE_1KB_Val _U_(0x0) /**< \brief (CMCC_TYPE) Cache Size is 1 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_2KB_Val _U_(0x1) /**< \brief (CMCC_TYPE) Cache Size is 2 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_4KB_Val _U_(0x2) /**< \brief (CMCC_TYPE) Cache Size is 4 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_8KB_Val _U_(0x3) /**< \brief (CMCC_TYPE) Cache Size is 8 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_16KB_Val _U_(0x4) /**< \brief (CMCC_TYPE) Cache Size is 16 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_32KB_Val _U_(0x5) /**< \brief (CMCC_TYPE) Cache Size is 32 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_64KB_Val _U_(0x6) /**< \brief (CMCC_TYPE) Cache Size is 64 KB */ +#define CMCC_TYPE_CSIZE_CSIZE_1KB (CMCC_TYPE_CSIZE_CSIZE_1KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_2KB (CMCC_TYPE_CSIZE_CSIZE_2KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_4KB (CMCC_TYPE_CSIZE_CSIZE_4KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_8KB (CMCC_TYPE_CSIZE_CSIZE_8KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_16KB (CMCC_TYPE_CSIZE_CSIZE_16KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_32KB (CMCC_TYPE_CSIZE_CSIZE_32KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CSIZE_CSIZE_64KB (CMCC_TYPE_CSIZE_CSIZE_64KB_Val << CMCC_TYPE_CSIZE_Pos) +#define CMCC_TYPE_CLSIZE_Pos 11 /**< \brief (CMCC_TYPE) Cache Line Size */ +#define CMCC_TYPE_CLSIZE_Msk (_U_(0x7) << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE(value) (CMCC_TYPE_CLSIZE_Msk & ((value) << CMCC_TYPE_CLSIZE_Pos)) +#define CMCC_TYPE_CLSIZE_CLSIZE_4B_Val _U_(0x0) /**< \brief (CMCC_TYPE) Cache Line Size is 4 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_8B_Val _U_(0x1) /**< \brief (CMCC_TYPE) Cache Line Size is 8 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_16B_Val _U_(0x2) /**< \brief (CMCC_TYPE) Cache Line Size is 16 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_32B_Val _U_(0x3) /**< \brief (CMCC_TYPE) Cache Line Size is 32 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_64B_Val _U_(0x4) /**< \brief (CMCC_TYPE) Cache Line Size is 64 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_128B_Val _U_(0x5) /**< \brief (CMCC_TYPE) Cache Line Size is 128 bytes */ +#define CMCC_TYPE_CLSIZE_CLSIZE_4B (CMCC_TYPE_CLSIZE_CLSIZE_4B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE_CLSIZE_8B (CMCC_TYPE_CLSIZE_CLSIZE_8B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE_CLSIZE_16B (CMCC_TYPE_CLSIZE_CLSIZE_16B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE_CLSIZE_32B (CMCC_TYPE_CLSIZE_CLSIZE_32B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE_CLSIZE_64B (CMCC_TYPE_CLSIZE_CLSIZE_64B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_CLSIZE_CLSIZE_128B (CMCC_TYPE_CLSIZE_CLSIZE_128B_Val << CMCC_TYPE_CLSIZE_Pos) +#define CMCC_TYPE_MASK _U_(0x00003FF2) /**< \brief (CMCC_TYPE) MASK Register */ + +/* -------- CMCC_CFG : (CMCC Offset: 0x04) (R/W 32) Cache Configuration Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :1; /*!< bit: 0 Reserved */ + uint32_t ICDIS:1; /*!< bit: 1 Instruction Cache Disable */ + uint32_t DCDIS:1; /*!< bit: 2 Data Cache Disable */ + uint32_t :1; /*!< bit: 3 Reserved */ + uint32_t CSIZESW:3; /*!< bit: 4.. 6 Cache size configured by software */ + uint32_t :25; /*!< bit: 7..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_CFG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_CFG_OFFSET 0x04 /**< \brief (CMCC_CFG offset) Cache Configuration Register */ +#define CMCC_CFG_RESETVALUE _U_(0x00000020) /**< \brief (CMCC_CFG reset_value) Cache Configuration Register */ + +#define CMCC_CFG_ICDIS_Pos 1 /**< \brief (CMCC_CFG) Instruction Cache Disable */ +#define CMCC_CFG_ICDIS (_U_(0x1) << CMCC_CFG_ICDIS_Pos) +#define CMCC_CFG_DCDIS_Pos 2 /**< \brief (CMCC_CFG) Data Cache Disable */ +#define CMCC_CFG_DCDIS (_U_(0x1) << CMCC_CFG_DCDIS_Pos) +#define CMCC_CFG_CSIZESW_Pos 4 /**< \brief (CMCC_CFG) Cache size configured by software */ +#define CMCC_CFG_CSIZESW_Msk (_U_(0x7) << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW(value) (CMCC_CFG_CSIZESW_Msk & ((value) << CMCC_CFG_CSIZESW_Pos)) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_1KB_Val _U_(0x0) /**< \brief (CMCC_CFG) the Cache Size is configured to 1KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_2KB_Val _U_(0x1) /**< \brief (CMCC_CFG) the Cache Size is configured to 2KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_4KB_Val _U_(0x2) /**< \brief (CMCC_CFG) the Cache Size is configured to 4KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_8KB_Val _U_(0x3) /**< \brief (CMCC_CFG) the Cache Size is configured to 8KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_16KB_Val _U_(0x4) /**< \brief (CMCC_CFG) the Cache Size is configured to 16KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_32KB_Val _U_(0x5) /**< \brief (CMCC_CFG) the Cache Size is configured to 32KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_64KB_Val _U_(0x6) /**< \brief (CMCC_CFG) the Cache Size is configured to 64KB */ +#define CMCC_CFG_CSIZESW_CONF_CSIZE_1KB (CMCC_CFG_CSIZESW_CONF_CSIZE_1KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_2KB (CMCC_CFG_CSIZESW_CONF_CSIZE_2KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_4KB (CMCC_CFG_CSIZESW_CONF_CSIZE_4KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_8KB (CMCC_CFG_CSIZESW_CONF_CSIZE_8KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_16KB (CMCC_CFG_CSIZESW_CONF_CSIZE_16KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_32KB (CMCC_CFG_CSIZESW_CONF_CSIZE_32KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_CSIZESW_CONF_CSIZE_64KB (CMCC_CFG_CSIZESW_CONF_CSIZE_64KB_Val << CMCC_CFG_CSIZESW_Pos) +#define CMCC_CFG_MASK _U_(0x00000076) /**< \brief (CMCC_CFG) MASK Register */ + +/* -------- CMCC_CTRL : (CMCC Offset: 0x08) ( /W 32) Cache Control Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CEN:1; /*!< bit: 0 Cache Controller Enable */ + uint32_t :31; /*!< bit: 1..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_CTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_CTRL_OFFSET 0x08 /**< \brief (CMCC_CTRL offset) Cache Control Register */ +#define CMCC_CTRL_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_CTRL reset_value) Cache Control Register */ + +#define CMCC_CTRL_CEN_Pos 0 /**< \brief (CMCC_CTRL) Cache Controller Enable */ +#define CMCC_CTRL_CEN (_U_(0x1) << CMCC_CTRL_CEN_Pos) +#define CMCC_CTRL_MASK _U_(0x00000001) /**< \brief (CMCC_CTRL) MASK Register */ + +/* -------- CMCC_SR : (CMCC Offset: 0x0C) (R/ 32) Cache Status Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CSTS:1; /*!< bit: 0 Cache Controller Status */ + uint32_t :31; /*!< bit: 1..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_SR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_SR_OFFSET 0x0C /**< \brief (CMCC_SR offset) Cache Status Register */ +#define CMCC_SR_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_SR reset_value) Cache Status Register */ + +#define CMCC_SR_CSTS_Pos 0 /**< \brief (CMCC_SR) Cache Controller Status */ +#define CMCC_SR_CSTS (_U_(0x1) << CMCC_SR_CSTS_Pos) +#define CMCC_SR_MASK _U_(0x00000001) /**< \brief (CMCC_SR) MASK Register */ + +/* -------- CMCC_LCKWAY : (CMCC Offset: 0x10) (R/W 32) Cache Lock per Way Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t LCKWAY:4; /*!< bit: 0.. 3 Lockdown way Register */ + uint32_t :28; /*!< bit: 4..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_LCKWAY_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_LCKWAY_OFFSET 0x10 /**< \brief (CMCC_LCKWAY offset) Cache Lock per Way Register */ +#define CMCC_LCKWAY_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_LCKWAY reset_value) Cache Lock per Way Register */ + +#define CMCC_LCKWAY_LCKWAY_Pos 0 /**< \brief (CMCC_LCKWAY) Lockdown way Register */ +#define CMCC_LCKWAY_LCKWAY_Msk (_U_(0xF) << CMCC_LCKWAY_LCKWAY_Pos) +#define CMCC_LCKWAY_LCKWAY(value) (CMCC_LCKWAY_LCKWAY_Msk & ((value) << CMCC_LCKWAY_LCKWAY_Pos)) +#define CMCC_LCKWAY_MASK _U_(0x0000000F) /**< \brief (CMCC_LCKWAY) MASK Register */ + +/* -------- CMCC_MAINT0 : (CMCC Offset: 0x20) ( /W 32) Cache Maintenance Register 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t INVALL:1; /*!< bit: 0 Cache Controller invalidate All */ + uint32_t :31; /*!< bit: 1..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MAINT0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MAINT0_OFFSET 0x20 /**< \brief (CMCC_MAINT0 offset) Cache Maintenance Register 0 */ +#define CMCC_MAINT0_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MAINT0 reset_value) Cache Maintenance Register 0 */ + +#define CMCC_MAINT0_INVALL_Pos 0 /**< \brief (CMCC_MAINT0) Cache Controller invalidate All */ +#define CMCC_MAINT0_INVALL (_U_(0x1) << CMCC_MAINT0_INVALL_Pos) +#define CMCC_MAINT0_MASK _U_(0x00000001) /**< \brief (CMCC_MAINT0) MASK Register */ + +/* -------- CMCC_MAINT1 : (CMCC Offset: 0x24) ( /W 32) Cache Maintenance Register 1 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t :4; /*!< bit: 0.. 3 Reserved */ + uint32_t INDEX:8; /*!< bit: 4..11 Invalidate Index */ + uint32_t :16; /*!< bit: 12..27 Reserved */ + uint32_t WAY:4; /*!< bit: 28..31 Invalidate Way */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MAINT1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MAINT1_OFFSET 0x24 /**< \brief (CMCC_MAINT1 offset) Cache Maintenance Register 1 */ +#define CMCC_MAINT1_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MAINT1 reset_value) Cache Maintenance Register 1 */ + +#define CMCC_MAINT1_INDEX_Pos 4 /**< \brief (CMCC_MAINT1) Invalidate Index */ +#define CMCC_MAINT1_INDEX_Msk (_U_(0xFF) << CMCC_MAINT1_INDEX_Pos) +#define CMCC_MAINT1_INDEX(value) (CMCC_MAINT1_INDEX_Msk & ((value) << CMCC_MAINT1_INDEX_Pos)) +#define CMCC_MAINT1_WAY_Pos 28 /**< \brief (CMCC_MAINT1) Invalidate Way */ +#define CMCC_MAINT1_WAY_Msk (_U_(0xF) << CMCC_MAINT1_WAY_Pos) +#define CMCC_MAINT1_WAY(value) (CMCC_MAINT1_WAY_Msk & ((value) << CMCC_MAINT1_WAY_Pos)) +#define CMCC_MAINT1_WAY_WAY0_Val _U_(0x0) /**< \brief (CMCC_MAINT1) Way 0 is selection for index invalidation */ +#define CMCC_MAINT1_WAY_WAY1_Val _U_(0x1) /**< \brief (CMCC_MAINT1) Way 1 is selection for index invalidation */ +#define CMCC_MAINT1_WAY_WAY2_Val _U_(0x2) /**< \brief (CMCC_MAINT1) Way 2 is selection for index invalidation */ +#define CMCC_MAINT1_WAY_WAY3_Val _U_(0x3) /**< \brief (CMCC_MAINT1) Way 3 is selection for index invalidation */ +#define CMCC_MAINT1_WAY_WAY0 (CMCC_MAINT1_WAY_WAY0_Val << CMCC_MAINT1_WAY_Pos) +#define CMCC_MAINT1_WAY_WAY1 (CMCC_MAINT1_WAY_WAY1_Val << CMCC_MAINT1_WAY_Pos) +#define CMCC_MAINT1_WAY_WAY2 (CMCC_MAINT1_WAY_WAY2_Val << CMCC_MAINT1_WAY_Pos) +#define CMCC_MAINT1_WAY_WAY3 (CMCC_MAINT1_WAY_WAY3_Val << CMCC_MAINT1_WAY_Pos) +#define CMCC_MAINT1_MASK _U_(0xF0000FF0) /**< \brief (CMCC_MAINT1) MASK Register */ + +/* -------- CMCC_MCFG : (CMCC Offset: 0x28) (R/W 32) Cache Monitor Configuration Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t MODE:2; /*!< bit: 0.. 1 Cache Controller Monitor Counter Mode */ + uint32_t :30; /*!< bit: 2..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MCFG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MCFG_OFFSET 0x28 /**< \brief (CMCC_MCFG offset) Cache Monitor Configuration Register */ +#define CMCC_MCFG_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MCFG reset_value) Cache Monitor Configuration Register */ + +#define CMCC_MCFG_MODE_Pos 0 /**< \brief (CMCC_MCFG) Cache Controller Monitor Counter Mode */ +#define CMCC_MCFG_MODE_Msk (_U_(0x3) << CMCC_MCFG_MODE_Pos) +#define CMCC_MCFG_MODE(value) (CMCC_MCFG_MODE_Msk & ((value) << CMCC_MCFG_MODE_Pos)) +#define CMCC_MCFG_MODE_CYCLE_COUNT_Val _U_(0x0) /**< \brief (CMCC_MCFG) cycle counter */ +#define CMCC_MCFG_MODE_IHIT_COUNT_Val _U_(0x1) /**< \brief (CMCC_MCFG) instruction hit counter */ +#define CMCC_MCFG_MODE_DHIT_COUNT_Val _U_(0x2) /**< \brief (CMCC_MCFG) data hit counter */ +#define CMCC_MCFG_MODE_CYCLE_COUNT (CMCC_MCFG_MODE_CYCLE_COUNT_Val << CMCC_MCFG_MODE_Pos) +#define CMCC_MCFG_MODE_IHIT_COUNT (CMCC_MCFG_MODE_IHIT_COUNT_Val << CMCC_MCFG_MODE_Pos) +#define CMCC_MCFG_MODE_DHIT_COUNT (CMCC_MCFG_MODE_DHIT_COUNT_Val << CMCC_MCFG_MODE_Pos) +#define CMCC_MCFG_MASK _U_(0x00000003) /**< \brief (CMCC_MCFG) MASK Register */ + +/* -------- CMCC_MEN : (CMCC Offset: 0x2C) (R/W 32) Cache Monitor Enable Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t MENABLE:1; /*!< bit: 0 Cache Controller Monitor Enable */ + uint32_t :31; /*!< bit: 1..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MEN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MEN_OFFSET 0x2C /**< \brief (CMCC_MEN offset) Cache Monitor Enable Register */ +#define CMCC_MEN_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MEN reset_value) Cache Monitor Enable Register */ + +#define CMCC_MEN_MENABLE_Pos 0 /**< \brief (CMCC_MEN) Cache Controller Monitor Enable */ +#define CMCC_MEN_MENABLE (_U_(0x1) << CMCC_MEN_MENABLE_Pos) +#define CMCC_MEN_MASK _U_(0x00000001) /**< \brief (CMCC_MEN) MASK Register */ + +/* -------- CMCC_MCTRL : (CMCC Offset: 0x30) ( /W 32) Cache Monitor Control Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 Cache Controller Software Reset */ + uint32_t :31; /*!< bit: 1..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MCTRL_OFFSET 0x30 /**< \brief (CMCC_MCTRL offset) Cache Monitor Control Register */ +#define CMCC_MCTRL_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MCTRL reset_value) Cache Monitor Control Register */ + +#define CMCC_MCTRL_SWRST_Pos 0 /**< \brief (CMCC_MCTRL) Cache Controller Software Reset */ +#define CMCC_MCTRL_SWRST (_U_(0x1) << CMCC_MCTRL_SWRST_Pos) +#define CMCC_MCTRL_MASK _U_(0x00000001) /**< \brief (CMCC_MCTRL) MASK Register */ + +/* -------- CMCC_MSR : (CMCC Offset: 0x34) (R/ 32) Cache Monitor Status Register -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t EVENT_CNT:32; /*!< bit: 0..31 Monitor Event Counter */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} CMCC_MSR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define CMCC_MSR_OFFSET 0x34 /**< \brief (CMCC_MSR offset) Cache Monitor Status Register */ +#define CMCC_MSR_RESETVALUE _U_(0x00000000) /**< \brief (CMCC_MSR reset_value) Cache Monitor Status Register */ + +#define CMCC_MSR_EVENT_CNT_Pos 0 /**< \brief (CMCC_MSR) Monitor Event Counter */ +#define CMCC_MSR_EVENT_CNT_Msk (_U_(0xFFFFFFFF) << CMCC_MSR_EVENT_CNT_Pos) +#define CMCC_MSR_EVENT_CNT(value) (CMCC_MSR_EVENT_CNT_Msk & ((value) << CMCC_MSR_EVENT_CNT_Pos)) +#define CMCC_MSR_MASK _U_(0xFFFFFFFF) /**< \brief (CMCC_MSR) MASK Register */ + +/** \brief CMCC APB hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __I CMCC_TYPE_Type TYPE; /**< \brief Offset: 0x00 (R/ 32) Cache Type Register */ + __IO CMCC_CFG_Type CFG; /**< \brief Offset: 0x04 (R/W 32) Cache Configuration Register */ + __O CMCC_CTRL_Type CTRL; /**< \brief Offset: 0x08 ( /W 32) Cache Control Register */ + __I CMCC_SR_Type SR; /**< \brief Offset: 0x0C (R/ 32) Cache Status Register */ + __IO CMCC_LCKWAY_Type LCKWAY; /**< \brief Offset: 0x10 (R/W 32) Cache Lock per Way Register */ + RoReg8 Reserved1[0xC]; + __O CMCC_MAINT0_Type MAINT0; /**< \brief Offset: 0x20 ( /W 32) Cache Maintenance Register 0 */ + __O CMCC_MAINT1_Type MAINT1; /**< \brief Offset: 0x24 ( /W 32) Cache Maintenance Register 1 */ + __IO CMCC_MCFG_Type MCFG; /**< \brief Offset: 0x28 (R/W 32) Cache Monitor Configuration Register */ + __IO CMCC_MEN_Type MEN; /**< \brief Offset: 0x2C (R/W 32) Cache Monitor Enable Register */ + __O CMCC_MCTRL_Type MCTRL; /**< \brief Offset: 0x30 ( /W 32) Cache Monitor Control Register */ + __I CMCC_MSR_Type MSR; /**< \brief Offset: 0x34 (R/ 32) Cache Monitor Status Register */ +} Cmcc; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_CMCC_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dac.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dac.h new file mode 100644 index 0000000000..c67efda303 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dac.h @@ -0,0 +1,544 @@ +/** + * \file + * + * \brief Component description for DAC + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_DAC_COMPONENT_ +#define _SAMD51_DAC_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR DAC */ +/* ========================================================================== */ +/** \addtogroup SAMD51_DAC Digital-to-Analog Converter */ +/*@{*/ + +#define DAC_U2502 +#define REV_DAC 0x100 + +/* -------- DAC_CTRLA : (DAC Offset: 0x00) (R/W 8) Control A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SWRST:1; /*!< bit: 0 Software Reset */ + uint8_t ENABLE:1; /*!< bit: 1 Enable DAC Controller */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_CTRLA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_CTRLA_OFFSET 0x00 /**< \brief (DAC_CTRLA offset) Control A */ +#define DAC_CTRLA_RESETVALUE _U_(0x00) /**< \brief (DAC_CTRLA reset_value) Control A */ + +#define DAC_CTRLA_SWRST_Pos 0 /**< \brief (DAC_CTRLA) Software Reset */ +#define DAC_CTRLA_SWRST (_U_(0x1) << DAC_CTRLA_SWRST_Pos) +#define DAC_CTRLA_ENABLE_Pos 1 /**< \brief (DAC_CTRLA) Enable DAC Controller */ +#define DAC_CTRLA_ENABLE (_U_(0x1) << DAC_CTRLA_ENABLE_Pos) +#define DAC_CTRLA_MASK _U_(0x03) /**< \brief (DAC_CTRLA) MASK Register */ + +/* -------- DAC_CTRLB : (DAC Offset: 0x01) (R/W 8) Control B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DIFF:1; /*!< bit: 0 Differential mode enable */ + uint8_t REFSEL:2; /*!< bit: 1.. 2 Reference Selection for DAC0/1 */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_CTRLB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_CTRLB_OFFSET 0x01 /**< \brief (DAC_CTRLB offset) Control B */ +#define DAC_CTRLB_RESETVALUE _U_(0x02) /**< \brief (DAC_CTRLB reset_value) Control B */ + +#define DAC_CTRLB_DIFF_Pos 0 /**< \brief (DAC_CTRLB) Differential mode enable */ +#define DAC_CTRLB_DIFF (_U_(0x1) << DAC_CTRLB_DIFF_Pos) +#define DAC_CTRLB_REFSEL_Pos 1 /**< \brief (DAC_CTRLB) Reference Selection for DAC0/1 */ +#define DAC_CTRLB_REFSEL_Msk (_U_(0x3) << DAC_CTRLB_REFSEL_Pos) +#define DAC_CTRLB_REFSEL(value) (DAC_CTRLB_REFSEL_Msk & ((value) << DAC_CTRLB_REFSEL_Pos)) +#define DAC_CTRLB_REFSEL_VREFPU_Val _U_(0x0) /**< \brief (DAC_CTRLB) External reference unbuffered */ +#define DAC_CTRLB_REFSEL_VDDANA_Val _U_(0x1) /**< \brief (DAC_CTRLB) Analog supply */ +#define DAC_CTRLB_REFSEL_VREFPB_Val _U_(0x2) /**< \brief (DAC_CTRLB) External reference buffered */ +#define DAC_CTRLB_REFSEL_INTREF_Val _U_(0x3) /**< \brief (DAC_CTRLB) Internal bandgap reference */ +#define DAC_CTRLB_REFSEL_VREFPU (DAC_CTRLB_REFSEL_VREFPU_Val << DAC_CTRLB_REFSEL_Pos) +#define DAC_CTRLB_REFSEL_VDDANA (DAC_CTRLB_REFSEL_VDDANA_Val << DAC_CTRLB_REFSEL_Pos) +#define DAC_CTRLB_REFSEL_VREFPB (DAC_CTRLB_REFSEL_VREFPB_Val << DAC_CTRLB_REFSEL_Pos) +#define DAC_CTRLB_REFSEL_INTREF (DAC_CTRLB_REFSEL_INTREF_Val << DAC_CTRLB_REFSEL_Pos) +#define DAC_CTRLB_MASK _U_(0x07) /**< \brief (DAC_CTRLB) MASK Register */ + +/* -------- DAC_EVCTRL : (DAC Offset: 0x02) (R/W 8) Event Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t STARTEI0:1; /*!< bit: 0 Start Conversion Event Input DAC 0 */ + uint8_t STARTEI1:1; /*!< bit: 1 Start Conversion Event Input DAC 1 */ + uint8_t EMPTYEO0:1; /*!< bit: 2 Data Buffer Empty Event Output DAC 0 */ + uint8_t EMPTYEO1:1; /*!< bit: 3 Data Buffer Empty Event Output DAC 1 */ + uint8_t INVEI0:1; /*!< bit: 4 Enable Invertion of DAC 0 input event */ + uint8_t INVEI1:1; /*!< bit: 5 Enable Invertion of DAC 1 input event */ + uint8_t RESRDYEO0:1; /*!< bit: 6 Result Ready Event Output 0 */ + uint8_t RESRDYEO1:1; /*!< bit: 7 Result Ready Event Output 1 */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t STARTEI:2; /*!< bit: 0.. 1 Start Conversion Event Input DAC x */ + uint8_t EMPTYEO:2; /*!< bit: 2.. 3 Data Buffer Empty Event Output DAC x */ + uint8_t INVEI:2; /*!< bit: 4.. 5 Enable Invertion of DAC x input event */ + uint8_t RESRDYEO:2; /*!< bit: 6.. 7 Result Ready Event Output x */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_EVCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_EVCTRL_OFFSET 0x02 /**< \brief (DAC_EVCTRL offset) Event Control */ +#define DAC_EVCTRL_RESETVALUE _U_(0x00) /**< \brief (DAC_EVCTRL reset_value) Event Control */ + +#define DAC_EVCTRL_STARTEI0_Pos 0 /**< \brief (DAC_EVCTRL) Start Conversion Event Input DAC 0 */ +#define DAC_EVCTRL_STARTEI0 (_U_(1) << DAC_EVCTRL_STARTEI0_Pos) +#define DAC_EVCTRL_STARTEI1_Pos 1 /**< \brief (DAC_EVCTRL) Start Conversion Event Input DAC 1 */ +#define DAC_EVCTRL_STARTEI1 (_U_(1) << DAC_EVCTRL_STARTEI1_Pos) +#define DAC_EVCTRL_STARTEI_Pos 0 /**< \brief (DAC_EVCTRL) Start Conversion Event Input DAC x */ +#define DAC_EVCTRL_STARTEI_Msk (_U_(0x3) << DAC_EVCTRL_STARTEI_Pos) +#define DAC_EVCTRL_STARTEI(value) (DAC_EVCTRL_STARTEI_Msk & ((value) << DAC_EVCTRL_STARTEI_Pos)) +#define DAC_EVCTRL_EMPTYEO0_Pos 2 /**< \brief (DAC_EVCTRL) Data Buffer Empty Event Output DAC 0 */ +#define DAC_EVCTRL_EMPTYEO0 (_U_(1) << DAC_EVCTRL_EMPTYEO0_Pos) +#define DAC_EVCTRL_EMPTYEO1_Pos 3 /**< \brief (DAC_EVCTRL) Data Buffer Empty Event Output DAC 1 */ +#define DAC_EVCTRL_EMPTYEO1 (_U_(1) << DAC_EVCTRL_EMPTYEO1_Pos) +#define DAC_EVCTRL_EMPTYEO_Pos 2 /**< \brief (DAC_EVCTRL) Data Buffer Empty Event Output DAC x */ +#define DAC_EVCTRL_EMPTYEO_Msk (_U_(0x3) << DAC_EVCTRL_EMPTYEO_Pos) +#define DAC_EVCTRL_EMPTYEO(value) (DAC_EVCTRL_EMPTYEO_Msk & ((value) << DAC_EVCTRL_EMPTYEO_Pos)) +#define DAC_EVCTRL_INVEI0_Pos 4 /**< \brief (DAC_EVCTRL) Enable Invertion of DAC 0 input event */ +#define DAC_EVCTRL_INVEI0 (_U_(1) << DAC_EVCTRL_INVEI0_Pos) +#define DAC_EVCTRL_INVEI1_Pos 5 /**< \brief (DAC_EVCTRL) Enable Invertion of DAC 1 input event */ +#define DAC_EVCTRL_INVEI1 (_U_(1) << DAC_EVCTRL_INVEI1_Pos) +#define DAC_EVCTRL_INVEI_Pos 4 /**< \brief (DAC_EVCTRL) Enable Invertion of DAC x input event */ +#define DAC_EVCTRL_INVEI_Msk (_U_(0x3) << DAC_EVCTRL_INVEI_Pos) +#define DAC_EVCTRL_INVEI(value) (DAC_EVCTRL_INVEI_Msk & ((value) << DAC_EVCTRL_INVEI_Pos)) +#define DAC_EVCTRL_RESRDYEO0_Pos 6 /**< \brief (DAC_EVCTRL) Result Ready Event Output 0 */ +#define DAC_EVCTRL_RESRDYEO0 (_U_(1) << DAC_EVCTRL_RESRDYEO0_Pos) +#define DAC_EVCTRL_RESRDYEO1_Pos 7 /**< \brief (DAC_EVCTRL) Result Ready Event Output 1 */ +#define DAC_EVCTRL_RESRDYEO1 (_U_(1) << DAC_EVCTRL_RESRDYEO1_Pos) +#define DAC_EVCTRL_RESRDYEO_Pos 6 /**< \brief (DAC_EVCTRL) Result Ready Event Output x */ +#define DAC_EVCTRL_RESRDYEO_Msk (_U_(0x3) << DAC_EVCTRL_RESRDYEO_Pos) +#define DAC_EVCTRL_RESRDYEO(value) (DAC_EVCTRL_RESRDYEO_Msk & ((value) << DAC_EVCTRL_RESRDYEO_Pos)) +#define DAC_EVCTRL_MASK _U_(0xFF) /**< \brief (DAC_EVCTRL) MASK Register */ + +/* -------- DAC_INTENCLR : (DAC Offset: 0x04) (R/W 8) Interrupt Enable Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t UNDERRUN0:1; /*!< bit: 0 Underrun 0 Interrupt Enable */ + uint8_t UNDERRUN1:1; /*!< bit: 1 Underrun 1 Interrupt Enable */ + uint8_t EMPTY0:1; /*!< bit: 2 Data Buffer 0 Empty Interrupt Enable */ + uint8_t EMPTY1:1; /*!< bit: 3 Data Buffer 1 Empty Interrupt Enable */ + uint8_t RESRDY0:1; /*!< bit: 4 Result 0 Ready Interrupt Enable */ + uint8_t RESRDY1:1; /*!< bit: 5 Result 1 Ready Interrupt Enable */ + uint8_t OVERRUN0:1; /*!< bit: 6 Overrun 0 Interrupt Enable */ + uint8_t OVERRUN1:1; /*!< bit: 7 Overrun 1 Interrupt Enable */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t UNDERRUN:2; /*!< bit: 0.. 1 Underrun x Interrupt Enable */ + uint8_t EMPTY:2; /*!< bit: 2.. 3 Data Buffer x Empty Interrupt Enable */ + uint8_t RESRDY:2; /*!< bit: 4.. 5 Result x Ready Interrupt Enable */ + uint8_t OVERRUN:2; /*!< bit: 6.. 7 Overrun x Interrupt Enable */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_INTENCLR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_INTENCLR_OFFSET 0x04 /**< \brief (DAC_INTENCLR offset) Interrupt Enable Clear */ +#define DAC_INTENCLR_RESETVALUE _U_(0x00) /**< \brief (DAC_INTENCLR reset_value) Interrupt Enable Clear */ + +#define DAC_INTENCLR_UNDERRUN0_Pos 0 /**< \brief (DAC_INTENCLR) Underrun 0 Interrupt Enable */ +#define DAC_INTENCLR_UNDERRUN0 (_U_(1) << DAC_INTENCLR_UNDERRUN0_Pos) +#define DAC_INTENCLR_UNDERRUN1_Pos 1 /**< \brief (DAC_INTENCLR) Underrun 1 Interrupt Enable */ +#define DAC_INTENCLR_UNDERRUN1 (_U_(1) << DAC_INTENCLR_UNDERRUN1_Pos) +#define DAC_INTENCLR_UNDERRUN_Pos 0 /**< \brief (DAC_INTENCLR) Underrun x Interrupt Enable */ +#define DAC_INTENCLR_UNDERRUN_Msk (_U_(0x3) << DAC_INTENCLR_UNDERRUN_Pos) +#define DAC_INTENCLR_UNDERRUN(value) (DAC_INTENCLR_UNDERRUN_Msk & ((value) << DAC_INTENCLR_UNDERRUN_Pos)) +#define DAC_INTENCLR_EMPTY0_Pos 2 /**< \brief (DAC_INTENCLR) Data Buffer 0 Empty Interrupt Enable */ +#define DAC_INTENCLR_EMPTY0 (_U_(1) << DAC_INTENCLR_EMPTY0_Pos) +#define DAC_INTENCLR_EMPTY1_Pos 3 /**< \brief (DAC_INTENCLR) Data Buffer 1 Empty Interrupt Enable */ +#define DAC_INTENCLR_EMPTY1 (_U_(1) << DAC_INTENCLR_EMPTY1_Pos) +#define DAC_INTENCLR_EMPTY_Pos 2 /**< \brief (DAC_INTENCLR) Data Buffer x Empty Interrupt Enable */ +#define DAC_INTENCLR_EMPTY_Msk (_U_(0x3) << DAC_INTENCLR_EMPTY_Pos) +#define DAC_INTENCLR_EMPTY(value) (DAC_INTENCLR_EMPTY_Msk & ((value) << DAC_INTENCLR_EMPTY_Pos)) +#define DAC_INTENCLR_RESRDY0_Pos 4 /**< \brief (DAC_INTENCLR) Result 0 Ready Interrupt Enable */ +#define DAC_INTENCLR_RESRDY0 (_U_(1) << DAC_INTENCLR_RESRDY0_Pos) +#define DAC_INTENCLR_RESRDY1_Pos 5 /**< \brief (DAC_INTENCLR) Result 1 Ready Interrupt Enable */ +#define DAC_INTENCLR_RESRDY1 (_U_(1) << DAC_INTENCLR_RESRDY1_Pos) +#define DAC_INTENCLR_RESRDY_Pos 4 /**< \brief (DAC_INTENCLR) Result x Ready Interrupt Enable */ +#define DAC_INTENCLR_RESRDY_Msk (_U_(0x3) << DAC_INTENCLR_RESRDY_Pos) +#define DAC_INTENCLR_RESRDY(value) (DAC_INTENCLR_RESRDY_Msk & ((value) << DAC_INTENCLR_RESRDY_Pos)) +#define DAC_INTENCLR_OVERRUN0_Pos 6 /**< \brief (DAC_INTENCLR) Overrun 0 Interrupt Enable */ +#define DAC_INTENCLR_OVERRUN0 (_U_(1) << DAC_INTENCLR_OVERRUN0_Pos) +#define DAC_INTENCLR_OVERRUN1_Pos 7 /**< \brief (DAC_INTENCLR) Overrun 1 Interrupt Enable */ +#define DAC_INTENCLR_OVERRUN1 (_U_(1) << DAC_INTENCLR_OVERRUN1_Pos) +#define DAC_INTENCLR_OVERRUN_Pos 6 /**< \brief (DAC_INTENCLR) Overrun x Interrupt Enable */ +#define DAC_INTENCLR_OVERRUN_Msk (_U_(0x3) << DAC_INTENCLR_OVERRUN_Pos) +#define DAC_INTENCLR_OVERRUN(value) (DAC_INTENCLR_OVERRUN_Msk & ((value) << DAC_INTENCLR_OVERRUN_Pos)) +#define DAC_INTENCLR_MASK _U_(0xFF) /**< \brief (DAC_INTENCLR) MASK Register */ + +/* -------- DAC_INTENSET : (DAC Offset: 0x05) (R/W 8) Interrupt Enable Set -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t UNDERRUN0:1; /*!< bit: 0 Underrun 0 Interrupt Enable */ + uint8_t UNDERRUN1:1; /*!< bit: 1 Underrun 1 Interrupt Enable */ + uint8_t EMPTY0:1; /*!< bit: 2 Data Buffer 0 Empty Interrupt Enable */ + uint8_t EMPTY1:1; /*!< bit: 3 Data Buffer 1 Empty Interrupt Enable */ + uint8_t RESRDY0:1; /*!< bit: 4 Result 0 Ready Interrupt Enable */ + uint8_t RESRDY1:1; /*!< bit: 5 Result 1 Ready Interrupt Enable */ + uint8_t OVERRUN0:1; /*!< bit: 6 Overrun 0 Interrupt Enable */ + uint8_t OVERRUN1:1; /*!< bit: 7 Overrun 1 Interrupt Enable */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t UNDERRUN:2; /*!< bit: 0.. 1 Underrun x Interrupt Enable */ + uint8_t EMPTY:2; /*!< bit: 2.. 3 Data Buffer x Empty Interrupt Enable */ + uint8_t RESRDY:2; /*!< bit: 4.. 5 Result x Ready Interrupt Enable */ + uint8_t OVERRUN:2; /*!< bit: 6.. 7 Overrun x Interrupt Enable */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_INTENSET_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_INTENSET_OFFSET 0x05 /**< \brief (DAC_INTENSET offset) Interrupt Enable Set */ +#define DAC_INTENSET_RESETVALUE _U_(0x00) /**< \brief (DAC_INTENSET reset_value) Interrupt Enable Set */ + +#define DAC_INTENSET_UNDERRUN0_Pos 0 /**< \brief (DAC_INTENSET) Underrun 0 Interrupt Enable */ +#define DAC_INTENSET_UNDERRUN0 (_U_(1) << DAC_INTENSET_UNDERRUN0_Pos) +#define DAC_INTENSET_UNDERRUN1_Pos 1 /**< \brief (DAC_INTENSET) Underrun 1 Interrupt Enable */ +#define DAC_INTENSET_UNDERRUN1 (_U_(1) << DAC_INTENSET_UNDERRUN1_Pos) +#define DAC_INTENSET_UNDERRUN_Pos 0 /**< \brief (DAC_INTENSET) Underrun x Interrupt Enable */ +#define DAC_INTENSET_UNDERRUN_Msk (_U_(0x3) << DAC_INTENSET_UNDERRUN_Pos) +#define DAC_INTENSET_UNDERRUN(value) (DAC_INTENSET_UNDERRUN_Msk & ((value) << DAC_INTENSET_UNDERRUN_Pos)) +#define DAC_INTENSET_EMPTY0_Pos 2 /**< \brief (DAC_INTENSET) Data Buffer 0 Empty Interrupt Enable */ +#define DAC_INTENSET_EMPTY0 (_U_(1) << DAC_INTENSET_EMPTY0_Pos) +#define DAC_INTENSET_EMPTY1_Pos 3 /**< \brief (DAC_INTENSET) Data Buffer 1 Empty Interrupt Enable */ +#define DAC_INTENSET_EMPTY1 (_U_(1) << DAC_INTENSET_EMPTY1_Pos) +#define DAC_INTENSET_EMPTY_Pos 2 /**< \brief (DAC_INTENSET) Data Buffer x Empty Interrupt Enable */ +#define DAC_INTENSET_EMPTY_Msk (_U_(0x3) << DAC_INTENSET_EMPTY_Pos) +#define DAC_INTENSET_EMPTY(value) (DAC_INTENSET_EMPTY_Msk & ((value) << DAC_INTENSET_EMPTY_Pos)) +#define DAC_INTENSET_RESRDY0_Pos 4 /**< \brief (DAC_INTENSET) Result 0 Ready Interrupt Enable */ +#define DAC_INTENSET_RESRDY0 (_U_(1) << DAC_INTENSET_RESRDY0_Pos) +#define DAC_INTENSET_RESRDY1_Pos 5 /**< \brief (DAC_INTENSET) Result 1 Ready Interrupt Enable */ +#define DAC_INTENSET_RESRDY1 (_U_(1) << DAC_INTENSET_RESRDY1_Pos) +#define DAC_INTENSET_RESRDY_Pos 4 /**< \brief (DAC_INTENSET) Result x Ready Interrupt Enable */ +#define DAC_INTENSET_RESRDY_Msk (_U_(0x3) << DAC_INTENSET_RESRDY_Pos) +#define DAC_INTENSET_RESRDY(value) (DAC_INTENSET_RESRDY_Msk & ((value) << DAC_INTENSET_RESRDY_Pos)) +#define DAC_INTENSET_OVERRUN0_Pos 6 /**< \brief (DAC_INTENSET) Overrun 0 Interrupt Enable */ +#define DAC_INTENSET_OVERRUN0 (_U_(1) << DAC_INTENSET_OVERRUN0_Pos) +#define DAC_INTENSET_OVERRUN1_Pos 7 /**< \brief (DAC_INTENSET) Overrun 1 Interrupt Enable */ +#define DAC_INTENSET_OVERRUN1 (_U_(1) << DAC_INTENSET_OVERRUN1_Pos) +#define DAC_INTENSET_OVERRUN_Pos 6 /**< \brief (DAC_INTENSET) Overrun x Interrupt Enable */ +#define DAC_INTENSET_OVERRUN_Msk (_U_(0x3) << DAC_INTENSET_OVERRUN_Pos) +#define DAC_INTENSET_OVERRUN(value) (DAC_INTENSET_OVERRUN_Msk & ((value) << DAC_INTENSET_OVERRUN_Pos)) +#define DAC_INTENSET_MASK _U_(0xFF) /**< \brief (DAC_INTENSET) MASK Register */ + +/* -------- DAC_INTFLAG : (DAC Offset: 0x06) (R/W 8) Interrupt Flag Status and Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { // __I to avoid read-modify-write on write-to-clear register + struct { + __I uint8_t UNDERRUN0:1; /*!< bit: 0 Result 0 Underrun */ + __I uint8_t UNDERRUN1:1; /*!< bit: 1 Result 1 Underrun */ + __I uint8_t EMPTY0:1; /*!< bit: 2 Data Buffer 0 Empty */ + __I uint8_t EMPTY1:1; /*!< bit: 3 Data Buffer 1 Empty */ + __I uint8_t RESRDY0:1; /*!< bit: 4 Result 0 Ready */ + __I uint8_t RESRDY1:1; /*!< bit: 5 Result 1 Ready */ + __I uint8_t OVERRUN0:1; /*!< bit: 6 Result 0 Overrun */ + __I uint8_t OVERRUN1:1; /*!< bit: 7 Result 1 Overrun */ + } bit; /*!< Structure used for bit access */ + struct { + __I uint8_t UNDERRUN:2; /*!< bit: 0.. 1 Result x Underrun */ + __I uint8_t EMPTY:2; /*!< bit: 2.. 3 Data Buffer x Empty */ + __I uint8_t RESRDY:2; /*!< bit: 4.. 5 Result x Ready */ + __I uint8_t OVERRUN:2; /*!< bit: 6.. 7 Result x Overrun */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_INTFLAG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_INTFLAG_OFFSET 0x06 /**< \brief (DAC_INTFLAG offset) Interrupt Flag Status and Clear */ +#define DAC_INTFLAG_RESETVALUE _U_(0x00) /**< \brief (DAC_INTFLAG reset_value) Interrupt Flag Status and Clear */ + +#define DAC_INTFLAG_UNDERRUN0_Pos 0 /**< \brief (DAC_INTFLAG) Result 0 Underrun */ +#define DAC_INTFLAG_UNDERRUN0 (_U_(1) << DAC_INTFLAG_UNDERRUN0_Pos) +#define DAC_INTFLAG_UNDERRUN1_Pos 1 /**< \brief (DAC_INTFLAG) Result 1 Underrun */ +#define DAC_INTFLAG_UNDERRUN1 (_U_(1) << DAC_INTFLAG_UNDERRUN1_Pos) +#define DAC_INTFLAG_UNDERRUN_Pos 0 /**< \brief (DAC_INTFLAG) Result x Underrun */ +#define DAC_INTFLAG_UNDERRUN_Msk (_U_(0x3) << DAC_INTFLAG_UNDERRUN_Pos) +#define DAC_INTFLAG_UNDERRUN(value) (DAC_INTFLAG_UNDERRUN_Msk & ((value) << DAC_INTFLAG_UNDERRUN_Pos)) +#define DAC_INTFLAG_EMPTY0_Pos 2 /**< \brief (DAC_INTFLAG) Data Buffer 0 Empty */ +#define DAC_INTFLAG_EMPTY0 (_U_(1) << DAC_INTFLAG_EMPTY0_Pos) +#define DAC_INTFLAG_EMPTY1_Pos 3 /**< \brief (DAC_INTFLAG) Data Buffer 1 Empty */ +#define DAC_INTFLAG_EMPTY1 (_U_(1) << DAC_INTFLAG_EMPTY1_Pos) +#define DAC_INTFLAG_EMPTY_Pos 2 /**< \brief (DAC_INTFLAG) Data Buffer x Empty */ +#define DAC_INTFLAG_EMPTY_Msk (_U_(0x3) << DAC_INTFLAG_EMPTY_Pos) +#define DAC_INTFLAG_EMPTY(value) (DAC_INTFLAG_EMPTY_Msk & ((value) << DAC_INTFLAG_EMPTY_Pos)) +#define DAC_INTFLAG_RESRDY0_Pos 4 /**< \brief (DAC_INTFLAG) Result 0 Ready */ +#define DAC_INTFLAG_RESRDY0 (_U_(1) << DAC_INTFLAG_RESRDY0_Pos) +#define DAC_INTFLAG_RESRDY1_Pos 5 /**< \brief (DAC_INTFLAG) Result 1 Ready */ +#define DAC_INTFLAG_RESRDY1 (_U_(1) << DAC_INTFLAG_RESRDY1_Pos) +#define DAC_INTFLAG_RESRDY_Pos 4 /**< \brief (DAC_INTFLAG) Result x Ready */ +#define DAC_INTFLAG_RESRDY_Msk (_U_(0x3) << DAC_INTFLAG_RESRDY_Pos) +#define DAC_INTFLAG_RESRDY(value) (DAC_INTFLAG_RESRDY_Msk & ((value) << DAC_INTFLAG_RESRDY_Pos)) +#define DAC_INTFLAG_OVERRUN0_Pos 6 /**< \brief (DAC_INTFLAG) Result 0 Overrun */ +#define DAC_INTFLAG_OVERRUN0 (_U_(1) << DAC_INTFLAG_OVERRUN0_Pos) +#define DAC_INTFLAG_OVERRUN1_Pos 7 /**< \brief (DAC_INTFLAG) Result 1 Overrun */ +#define DAC_INTFLAG_OVERRUN1 (_U_(1) << DAC_INTFLAG_OVERRUN1_Pos) +#define DAC_INTFLAG_OVERRUN_Pos 6 /**< \brief (DAC_INTFLAG) Result x Overrun */ +#define DAC_INTFLAG_OVERRUN_Msk (_U_(0x3) << DAC_INTFLAG_OVERRUN_Pos) +#define DAC_INTFLAG_OVERRUN(value) (DAC_INTFLAG_OVERRUN_Msk & ((value) << DAC_INTFLAG_OVERRUN_Pos)) +#define DAC_INTFLAG_MASK _U_(0xFF) /**< \brief (DAC_INTFLAG) MASK Register */ + +/* -------- DAC_STATUS : (DAC Offset: 0x07) (R/ 8) Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t READY0:1; /*!< bit: 0 DAC 0 Startup Ready */ + uint8_t READY1:1; /*!< bit: 1 DAC 1 Startup Ready */ + uint8_t EOC0:1; /*!< bit: 2 DAC 0 End of Conversion */ + uint8_t EOC1:1; /*!< bit: 3 DAC 1 End of Conversion */ + uint8_t :4; /*!< bit: 4.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint8_t READY:2; /*!< bit: 0.. 1 DAC x Startup Ready */ + uint8_t EOC:2; /*!< bit: 2.. 3 DAC x End of Conversion */ + uint8_t :4; /*!< bit: 4.. 7 Reserved */ + } vec; /*!< Structure used for vec access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_STATUS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_STATUS_OFFSET 0x07 /**< \brief (DAC_STATUS offset) Status */ +#define DAC_STATUS_RESETVALUE _U_(0x00) /**< \brief (DAC_STATUS reset_value) Status */ + +#define DAC_STATUS_READY0_Pos 0 /**< \brief (DAC_STATUS) DAC 0 Startup Ready */ +#define DAC_STATUS_READY0 (_U_(1) << DAC_STATUS_READY0_Pos) +#define DAC_STATUS_READY1_Pos 1 /**< \brief (DAC_STATUS) DAC 1 Startup Ready */ +#define DAC_STATUS_READY1 (_U_(1) << DAC_STATUS_READY1_Pos) +#define DAC_STATUS_READY_Pos 0 /**< \brief (DAC_STATUS) DAC x Startup Ready */ +#define DAC_STATUS_READY_Msk (_U_(0x3) << DAC_STATUS_READY_Pos) +#define DAC_STATUS_READY(value) (DAC_STATUS_READY_Msk & ((value) << DAC_STATUS_READY_Pos)) +#define DAC_STATUS_EOC0_Pos 2 /**< \brief (DAC_STATUS) DAC 0 End of Conversion */ +#define DAC_STATUS_EOC0 (_U_(1) << DAC_STATUS_EOC0_Pos) +#define DAC_STATUS_EOC1_Pos 3 /**< \brief (DAC_STATUS) DAC 1 End of Conversion */ +#define DAC_STATUS_EOC1 (_U_(1) << DAC_STATUS_EOC1_Pos) +#define DAC_STATUS_EOC_Pos 2 /**< \brief (DAC_STATUS) DAC x End of Conversion */ +#define DAC_STATUS_EOC_Msk (_U_(0x3) << DAC_STATUS_EOC_Pos) +#define DAC_STATUS_EOC(value) (DAC_STATUS_EOC_Msk & ((value) << DAC_STATUS_EOC_Pos)) +#define DAC_STATUS_MASK _U_(0x0F) /**< \brief (DAC_STATUS) MASK Register */ + +/* -------- DAC_SYNCBUSY : (DAC Offset: 0x08) (R/ 32) Synchronization Busy -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 Software Reset */ + uint32_t ENABLE:1; /*!< bit: 1 DAC Enable Status */ + uint32_t DATA0:1; /*!< bit: 2 Data DAC 0 */ + uint32_t DATA1:1; /*!< bit: 3 Data DAC 1 */ + uint32_t DATABUF0:1; /*!< bit: 4 Data Buffer DAC 0 */ + uint32_t DATABUF1:1; /*!< bit: 5 Data Buffer DAC 1 */ + uint32_t :26; /*!< bit: 6..31 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t :2; /*!< bit: 0.. 1 Reserved */ + uint32_t DATA:2; /*!< bit: 2.. 3 Data DAC x */ + uint32_t DATABUF:2; /*!< bit: 4.. 5 Data Buffer DAC x */ + uint32_t :26; /*!< bit: 6..31 Reserved */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DAC_SYNCBUSY_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_SYNCBUSY_OFFSET 0x08 /**< \brief (DAC_SYNCBUSY offset) Synchronization Busy */ +#define DAC_SYNCBUSY_RESETVALUE _U_(0x00000000) /**< \brief (DAC_SYNCBUSY reset_value) Synchronization Busy */ + +#define DAC_SYNCBUSY_SWRST_Pos 0 /**< \brief (DAC_SYNCBUSY) Software Reset */ +#define DAC_SYNCBUSY_SWRST (_U_(0x1) << DAC_SYNCBUSY_SWRST_Pos) +#define DAC_SYNCBUSY_ENABLE_Pos 1 /**< \brief (DAC_SYNCBUSY) DAC Enable Status */ +#define DAC_SYNCBUSY_ENABLE (_U_(0x1) << DAC_SYNCBUSY_ENABLE_Pos) +#define DAC_SYNCBUSY_DATA0_Pos 2 /**< \brief (DAC_SYNCBUSY) Data DAC 0 */ +#define DAC_SYNCBUSY_DATA0 (_U_(1) << DAC_SYNCBUSY_DATA0_Pos) +#define DAC_SYNCBUSY_DATA1_Pos 3 /**< \brief (DAC_SYNCBUSY) Data DAC 1 */ +#define DAC_SYNCBUSY_DATA1 (_U_(1) << DAC_SYNCBUSY_DATA1_Pos) +#define DAC_SYNCBUSY_DATA_Pos 2 /**< \brief (DAC_SYNCBUSY) Data DAC x */ +#define DAC_SYNCBUSY_DATA_Msk (_U_(0x3) << DAC_SYNCBUSY_DATA_Pos) +#define DAC_SYNCBUSY_DATA(value) (DAC_SYNCBUSY_DATA_Msk & ((value) << DAC_SYNCBUSY_DATA_Pos)) +#define DAC_SYNCBUSY_DATABUF0_Pos 4 /**< \brief (DAC_SYNCBUSY) Data Buffer DAC 0 */ +#define DAC_SYNCBUSY_DATABUF0 (_U_(1) << DAC_SYNCBUSY_DATABUF0_Pos) +#define DAC_SYNCBUSY_DATABUF1_Pos 5 /**< \brief (DAC_SYNCBUSY) Data Buffer DAC 1 */ +#define DAC_SYNCBUSY_DATABUF1 (_U_(1) << DAC_SYNCBUSY_DATABUF1_Pos) +#define DAC_SYNCBUSY_DATABUF_Pos 4 /**< \brief (DAC_SYNCBUSY) Data Buffer DAC x */ +#define DAC_SYNCBUSY_DATABUF_Msk (_U_(0x3) << DAC_SYNCBUSY_DATABUF_Pos) +#define DAC_SYNCBUSY_DATABUF(value) (DAC_SYNCBUSY_DATABUF_Msk & ((value) << DAC_SYNCBUSY_DATABUF_Pos)) +#define DAC_SYNCBUSY_MASK _U_(0x0000003F) /**< \brief (DAC_SYNCBUSY) MASK Register */ + +/* -------- DAC_DACCTRL : (DAC Offset: 0x0C) (R/W 16) DAC n Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t LEFTADJ:1; /*!< bit: 0 Left Adjusted Data */ + uint16_t ENABLE:1; /*!< bit: 1 Enable DAC0 */ + uint16_t CCTRL:2; /*!< bit: 2.. 3 Current Control */ + uint16_t :1; /*!< bit: 4 Reserved */ + uint16_t FEXT:1; /*!< bit: 5 Standalone Filter */ + uint16_t RUNSTDBY:1; /*!< bit: 6 Run in Standby */ + uint16_t DITHER:1; /*!< bit: 7 Dithering Mode */ + uint16_t REFRESH:4; /*!< bit: 8..11 Refresh period */ + uint16_t :1; /*!< bit: 12 Reserved */ + uint16_t OSR:3; /*!< bit: 13..15 Sampling Rate */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DAC_DACCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_DACCTRL_OFFSET 0x0C /**< \brief (DAC_DACCTRL offset) DAC n Control */ +#define DAC_DACCTRL_RESETVALUE _U_(0x0000) /**< \brief (DAC_DACCTRL reset_value) DAC n Control */ + +#define DAC_DACCTRL_LEFTADJ_Pos 0 /**< \brief (DAC_DACCTRL) Left Adjusted Data */ +#define DAC_DACCTRL_LEFTADJ (_U_(0x1) << DAC_DACCTRL_LEFTADJ_Pos) +#define DAC_DACCTRL_ENABLE_Pos 1 /**< \brief (DAC_DACCTRL) Enable DAC0 */ +#define DAC_DACCTRL_ENABLE (_U_(0x1) << DAC_DACCTRL_ENABLE_Pos) +#define DAC_DACCTRL_CCTRL_Pos 2 /**< \brief (DAC_DACCTRL) Current Control */ +#define DAC_DACCTRL_CCTRL_Msk (_U_(0x3) << DAC_DACCTRL_CCTRL_Pos) +#define DAC_DACCTRL_CCTRL(value) (DAC_DACCTRL_CCTRL_Msk & ((value) << DAC_DACCTRL_CCTRL_Pos)) +#define DAC_DACCTRL_CCTRL_CC100K_Val _U_(0x0) /**< \brief (DAC_DACCTRL) GCLK_DAC ≤ 1.2MHz (100kSPS) */ +#define DAC_DACCTRL_CCTRL_CC1M_Val _U_(0x1) /**< \brief (DAC_DACCTRL) 1.2MHz < GCLK_DAC ≤ 6MHz (500kSPS) */ +#define DAC_DACCTRL_CCTRL_CC12M_Val _U_(0x2) /**< \brief (DAC_DACCTRL) 6MHz < GCLK_DAC ≤ 12MHz (1MSPS) */ +#define DAC_DACCTRL_CCTRL_CC100K (DAC_DACCTRL_CCTRL_CC100K_Val << DAC_DACCTRL_CCTRL_Pos) +#define DAC_DACCTRL_CCTRL_CC1M (DAC_DACCTRL_CCTRL_CC1M_Val << DAC_DACCTRL_CCTRL_Pos) +#define DAC_DACCTRL_CCTRL_CC12M (DAC_DACCTRL_CCTRL_CC12M_Val << DAC_DACCTRL_CCTRL_Pos) +#define DAC_DACCTRL_FEXT_Pos 5 /**< \brief (DAC_DACCTRL) Standalone Filter */ +#define DAC_DACCTRL_FEXT (_U_(0x1) << DAC_DACCTRL_FEXT_Pos) +#define DAC_DACCTRL_RUNSTDBY_Pos 6 /**< \brief (DAC_DACCTRL) Run in Standby */ +#define DAC_DACCTRL_RUNSTDBY (_U_(0x1) << DAC_DACCTRL_RUNSTDBY_Pos) +#define DAC_DACCTRL_DITHER_Pos 7 /**< \brief (DAC_DACCTRL) Dithering Mode */ +#define DAC_DACCTRL_DITHER (_U_(0x1) << DAC_DACCTRL_DITHER_Pos) +#define DAC_DACCTRL_REFRESH_Pos 8 /**< \brief (DAC_DACCTRL) Refresh period */ +#define DAC_DACCTRL_REFRESH_Msk (_U_(0xF) << DAC_DACCTRL_REFRESH_Pos) +#define DAC_DACCTRL_REFRESH(value) (DAC_DACCTRL_REFRESH_Msk & ((value) << DAC_DACCTRL_REFRESH_Pos)) +#define DAC_DACCTRL_OSR_Pos 13 /**< \brief (DAC_DACCTRL) Sampling Rate */ +#define DAC_DACCTRL_OSR_Msk (_U_(0x7) << DAC_DACCTRL_OSR_Pos) +#define DAC_DACCTRL_OSR(value) (DAC_DACCTRL_OSR_Msk & ((value) << DAC_DACCTRL_OSR_Pos)) +#define DAC_DACCTRL_MASK _U_(0xEFEF) /**< \brief (DAC_DACCTRL) MASK Register */ + +/* -------- DAC_DATA : (DAC Offset: 0x10) ( /W 16) DAC n Data -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t DATA:16; /*!< bit: 0..15 DAC0 Data */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DAC_DATA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_DATA_OFFSET 0x10 /**< \brief (DAC_DATA offset) DAC n Data */ +#define DAC_DATA_RESETVALUE _U_(0x0000) /**< \brief (DAC_DATA reset_value) DAC n Data */ + +#define DAC_DATA_DATA_Pos 0 /**< \brief (DAC_DATA) DAC0 Data */ +#define DAC_DATA_DATA_Msk (_U_(0xFFFF) << DAC_DATA_DATA_Pos) +#define DAC_DATA_DATA(value) (DAC_DATA_DATA_Msk & ((value) << DAC_DATA_DATA_Pos)) +#define DAC_DATA_MASK _U_(0xFFFF) /**< \brief (DAC_DATA) MASK Register */ + +/* -------- DAC_DATABUF : (DAC Offset: 0x14) ( /W 16) DAC n Data Buffer -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t DATABUF:16; /*!< bit: 0..15 DAC0 Data Buffer */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DAC_DATABUF_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_DATABUF_OFFSET 0x14 /**< \brief (DAC_DATABUF offset) DAC n Data Buffer */ +#define DAC_DATABUF_RESETVALUE _U_(0x0000) /**< \brief (DAC_DATABUF reset_value) DAC n Data Buffer */ + +#define DAC_DATABUF_DATABUF_Pos 0 /**< \brief (DAC_DATABUF) DAC0 Data Buffer */ +#define DAC_DATABUF_DATABUF_Msk (_U_(0xFFFF) << DAC_DATABUF_DATABUF_Pos) +#define DAC_DATABUF_DATABUF(value) (DAC_DATABUF_DATABUF_Msk & ((value) << DAC_DATABUF_DATABUF_Pos)) +#define DAC_DATABUF_MASK _U_(0xFFFF) /**< \brief (DAC_DATABUF) MASK Register */ + +/* -------- DAC_DBGCTRL : (DAC Offset: 0x18) (R/W 8) Debug Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DBGRUN:1; /*!< bit: 0 Debug Run */ + uint8_t :7; /*!< bit: 1.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DAC_DBGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_DBGCTRL_OFFSET 0x18 /**< \brief (DAC_DBGCTRL offset) Debug Control */ +#define DAC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (DAC_DBGCTRL reset_value) Debug Control */ + +#define DAC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (DAC_DBGCTRL) Debug Run */ +#define DAC_DBGCTRL_DBGRUN (_U_(0x1) << DAC_DBGCTRL_DBGRUN_Pos) +#define DAC_DBGCTRL_MASK _U_(0x01) /**< \brief (DAC_DBGCTRL) MASK Register */ + +/* -------- DAC_RESULT : (DAC Offset: 0x1C) (R/ 16) Filter Result -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t RESULT:16; /*!< bit: 0..15 Filter Result */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DAC_RESULT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DAC_RESULT_OFFSET 0x1C /**< \brief (DAC_RESULT offset) Filter Result */ +#define DAC_RESULT_RESETVALUE _U_(0x0000) /**< \brief (DAC_RESULT reset_value) Filter Result */ + +#define DAC_RESULT_RESULT_Pos 0 /**< \brief (DAC_RESULT) Filter Result */ +#define DAC_RESULT_RESULT_Msk (_U_(0xFFFF) << DAC_RESULT_RESULT_Pos) +#define DAC_RESULT_RESULT(value) (DAC_RESULT_RESULT_Msk & ((value) << DAC_RESULT_RESULT_Pos)) +#define DAC_RESULT_MASK _U_(0xFFFF) /**< \brief (DAC_RESULT) MASK Register */ + +/** \brief DAC hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + __IO DAC_CTRLA_Type CTRLA; /**< \brief Offset: 0x00 (R/W 8) Control A */ + __IO DAC_CTRLB_Type CTRLB; /**< \brief Offset: 0x01 (R/W 8) Control B */ + __IO DAC_EVCTRL_Type EVCTRL; /**< \brief Offset: 0x02 (R/W 8) Event Control */ + RoReg8 Reserved1[0x1]; + __IO DAC_INTENCLR_Type INTENCLR; /**< \brief Offset: 0x04 (R/W 8) Interrupt Enable Clear */ + __IO DAC_INTENSET_Type INTENSET; /**< \brief Offset: 0x05 (R/W 8) Interrupt Enable Set */ + __IO DAC_INTFLAG_Type INTFLAG; /**< \brief Offset: 0x06 (R/W 8) Interrupt Flag Status and Clear */ + __I DAC_STATUS_Type STATUS; /**< \brief Offset: 0x07 (R/ 8) Status */ + __I DAC_SYNCBUSY_Type SYNCBUSY; /**< \brief Offset: 0x08 (R/ 32) Synchronization Busy */ + __IO DAC_DACCTRL_Type DACCTRL[2]; /**< \brief Offset: 0x0C (R/W 16) DAC n Control */ + __O DAC_DATA_Type DATA[2]; /**< \brief Offset: 0x10 ( /W 16) DAC n Data */ + __O DAC_DATABUF_Type DATABUF[2]; /**< \brief Offset: 0x14 ( /W 16) DAC n Data Buffer */ + __IO DAC_DBGCTRL_Type DBGCTRL; /**< \brief Offset: 0x18 (R/W 8) Debug Control */ + RoReg8 Reserved2[0x3]; + __I DAC_RESULT_Type RESULT[2]; /**< \brief Offset: 0x1C (R/ 16) Filter Result */ +} Dac; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/*@}*/ + +#endif /* _SAMD51_DAC_COMPONENT_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dmac.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dmac.h new file mode 100644 index 0000000000..295b31fe48 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/component/dmac.h @@ -0,0 +1,1416 @@ +/** + * \file + * + * \brief Component description for DMAC + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_DMAC_COMPONENT_ +#define _SAMD51_DMAC_COMPONENT_ + +/* ========================================================================== */ +/** SOFTWARE API DEFINITION FOR DMAC */ +/* ========================================================================== */ +/** \addtogroup SAMD51_DMAC Direct Memory Access Controller */ +/*@{*/ + +#define DMAC_U2503 +#define REV_DMAC 0x100 + +/* -------- DMAC_CTRL : (DMAC Offset: 0x00) (R/W 16) Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t SWRST:1; /*!< bit: 0 Software Reset */ + uint16_t DMAENABLE:1; /*!< bit: 1 DMA Enable */ + uint16_t :6; /*!< bit: 2.. 7 Reserved */ + uint16_t LVLEN0:1; /*!< bit: 8 Priority Level 0 Enable */ + uint16_t LVLEN1:1; /*!< bit: 9 Priority Level 1 Enable */ + uint16_t LVLEN2:1; /*!< bit: 10 Priority Level 2 Enable */ + uint16_t LVLEN3:1; /*!< bit: 11 Priority Level 3 Enable */ + uint16_t :4; /*!< bit: 12..15 Reserved */ + } bit; /*!< Structure used for bit access */ + struct { + uint16_t :8; /*!< bit: 0.. 7 Reserved */ + uint16_t LVLEN:4; /*!< bit: 8..11 Priority Level x Enable */ + uint16_t :4; /*!< bit: 12..15 Reserved */ + } vec; /*!< Structure used for vec access */ + uint16_t reg; /*!< Type used for register access */ +} DMAC_CTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CTRL_OFFSET 0x00 /**< \brief (DMAC_CTRL offset) Control */ +#define DMAC_CTRL_RESETVALUE _U_(0x0000) /**< \brief (DMAC_CTRL reset_value) Control */ + +#define DMAC_CTRL_SWRST_Pos 0 /**< \brief (DMAC_CTRL) Software Reset */ +#define DMAC_CTRL_SWRST (_U_(0x1) << DMAC_CTRL_SWRST_Pos) +#define DMAC_CTRL_DMAENABLE_Pos 1 /**< \brief (DMAC_CTRL) DMA Enable */ +#define DMAC_CTRL_DMAENABLE (_U_(0x1) << DMAC_CTRL_DMAENABLE_Pos) +#define DMAC_CTRL_LVLEN0_Pos 8 /**< \brief (DMAC_CTRL) Priority Level 0 Enable */ +#define DMAC_CTRL_LVLEN0 (_U_(1) << DMAC_CTRL_LVLEN0_Pos) +#define DMAC_CTRL_LVLEN1_Pos 9 /**< \brief (DMAC_CTRL) Priority Level 1 Enable */ +#define DMAC_CTRL_LVLEN1 (_U_(1) << DMAC_CTRL_LVLEN1_Pos) +#define DMAC_CTRL_LVLEN2_Pos 10 /**< \brief (DMAC_CTRL) Priority Level 2 Enable */ +#define DMAC_CTRL_LVLEN2 (_U_(1) << DMAC_CTRL_LVLEN2_Pos) +#define DMAC_CTRL_LVLEN3_Pos 11 /**< \brief (DMAC_CTRL) Priority Level 3 Enable */ +#define DMAC_CTRL_LVLEN3 (_U_(1) << DMAC_CTRL_LVLEN3_Pos) +#define DMAC_CTRL_LVLEN_Pos 8 /**< \brief (DMAC_CTRL) Priority Level x Enable */ +#define DMAC_CTRL_LVLEN_Msk (_U_(0xF) << DMAC_CTRL_LVLEN_Pos) +#define DMAC_CTRL_LVLEN(value) (DMAC_CTRL_LVLEN_Msk & ((value) << DMAC_CTRL_LVLEN_Pos)) +#define DMAC_CTRL_MASK _U_(0x0F03) /**< \brief (DMAC_CTRL) MASK Register */ + +/* -------- DMAC_CRCCTRL : (DMAC Offset: 0x02) (R/W 16) CRC Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t CRCBEATSIZE:2; /*!< bit: 0.. 1 CRC Beat Size */ + uint16_t CRCPOLY:2; /*!< bit: 2.. 3 CRC Polynomial Type */ + uint16_t :4; /*!< bit: 4.. 7 Reserved */ + uint16_t CRCSRC:6; /*!< bit: 8..13 CRC Input Source */ + uint16_t CRCMODE:2; /*!< bit: 14..15 CRC Operating Mode */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DMAC_CRCCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CRCCTRL_OFFSET 0x02 /**< \brief (DMAC_CRCCTRL offset) CRC Control */ +#define DMAC_CRCCTRL_RESETVALUE _U_(0x0000) /**< \brief (DMAC_CRCCTRL reset_value) CRC Control */ + +#define DMAC_CRCCTRL_CRCBEATSIZE_Pos 0 /**< \brief (DMAC_CRCCTRL) CRC Beat Size */ +#define DMAC_CRCCTRL_CRCBEATSIZE_Msk (_U_(0x3) << DMAC_CRCCTRL_CRCBEATSIZE_Pos) +#define DMAC_CRCCTRL_CRCBEATSIZE(value) (DMAC_CRCCTRL_CRCBEATSIZE_Msk & ((value) << DMAC_CRCCTRL_CRCBEATSIZE_Pos)) +#define DMAC_CRCCTRL_CRCBEATSIZE_BYTE_Val _U_(0x0) /**< \brief (DMAC_CRCCTRL) 8-bit bus transfer */ +#define DMAC_CRCCTRL_CRCBEATSIZE_HWORD_Val _U_(0x1) /**< \brief (DMAC_CRCCTRL) 16-bit bus transfer */ +#define DMAC_CRCCTRL_CRCBEATSIZE_WORD_Val _U_(0x2) /**< \brief (DMAC_CRCCTRL) 32-bit bus transfer */ +#define DMAC_CRCCTRL_CRCBEATSIZE_BYTE (DMAC_CRCCTRL_CRCBEATSIZE_BYTE_Val << DMAC_CRCCTRL_CRCBEATSIZE_Pos) +#define DMAC_CRCCTRL_CRCBEATSIZE_HWORD (DMAC_CRCCTRL_CRCBEATSIZE_HWORD_Val << DMAC_CRCCTRL_CRCBEATSIZE_Pos) +#define DMAC_CRCCTRL_CRCBEATSIZE_WORD (DMAC_CRCCTRL_CRCBEATSIZE_WORD_Val << DMAC_CRCCTRL_CRCBEATSIZE_Pos) +#define DMAC_CRCCTRL_CRCPOLY_Pos 2 /**< \brief (DMAC_CRCCTRL) CRC Polynomial Type */ +#define DMAC_CRCCTRL_CRCPOLY_Msk (_U_(0x3) << DMAC_CRCCTRL_CRCPOLY_Pos) +#define DMAC_CRCCTRL_CRCPOLY(value) (DMAC_CRCCTRL_CRCPOLY_Msk & ((value) << DMAC_CRCCTRL_CRCPOLY_Pos)) +#define DMAC_CRCCTRL_CRCPOLY_CRC16_Val _U_(0x0) /**< \brief (DMAC_CRCCTRL) CRC-16 (CRC-CCITT) */ +#define DMAC_CRCCTRL_CRCPOLY_CRC32_Val _U_(0x1) /**< \brief (DMAC_CRCCTRL) CRC32 (IEEE 802.3) */ +#define DMAC_CRCCTRL_CRCPOLY_CRC16 (DMAC_CRCCTRL_CRCPOLY_CRC16_Val << DMAC_CRCCTRL_CRCPOLY_Pos) +#define DMAC_CRCCTRL_CRCPOLY_CRC32 (DMAC_CRCCTRL_CRCPOLY_CRC32_Val << DMAC_CRCCTRL_CRCPOLY_Pos) +#define DMAC_CRCCTRL_CRCSRC_Pos 8 /**< \brief (DMAC_CRCCTRL) CRC Input Source */ +#define DMAC_CRCCTRL_CRCSRC_Msk (_U_(0x3F) << DMAC_CRCCTRL_CRCSRC_Pos) +#define DMAC_CRCCTRL_CRCSRC(value) (DMAC_CRCCTRL_CRCSRC_Msk & ((value) << DMAC_CRCCTRL_CRCSRC_Pos)) +#define DMAC_CRCCTRL_CRCSRC_DISABLE_Val _U_(0x0) /**< \brief (DMAC_CRCCTRL) CRC Disabled */ +#define DMAC_CRCCTRL_CRCSRC_IO_Val _U_(0x1) /**< \brief (DMAC_CRCCTRL) I/O interface */ +#define DMAC_CRCCTRL_CRCSRC_DISABLE (DMAC_CRCCTRL_CRCSRC_DISABLE_Val << DMAC_CRCCTRL_CRCSRC_Pos) +#define DMAC_CRCCTRL_CRCSRC_IO (DMAC_CRCCTRL_CRCSRC_IO_Val << DMAC_CRCCTRL_CRCSRC_Pos) +#define DMAC_CRCCTRL_CRCMODE_Pos 14 /**< \brief (DMAC_CRCCTRL) CRC Operating Mode */ +#define DMAC_CRCCTRL_CRCMODE_Msk (_U_(0x3) << DMAC_CRCCTRL_CRCMODE_Pos) +#define DMAC_CRCCTRL_CRCMODE(value) (DMAC_CRCCTRL_CRCMODE_Msk & ((value) << DMAC_CRCCTRL_CRCMODE_Pos)) +#define DMAC_CRCCTRL_CRCMODE_DEFAULT_Val _U_(0x0) /**< \brief (DMAC_CRCCTRL) Default operating mode */ +#define DMAC_CRCCTRL_CRCMODE_CRCMON_Val _U_(0x2) /**< \brief (DMAC_CRCCTRL) Memory CRC monitor operating mode */ +#define DMAC_CRCCTRL_CRCMODE_CRCGEN_Val _U_(0x3) /**< \brief (DMAC_CRCCTRL) Memory CRC generation operating mode */ +#define DMAC_CRCCTRL_CRCMODE_DEFAULT (DMAC_CRCCTRL_CRCMODE_DEFAULT_Val << DMAC_CRCCTRL_CRCMODE_Pos) +#define DMAC_CRCCTRL_CRCMODE_CRCMON (DMAC_CRCCTRL_CRCMODE_CRCMON_Val << DMAC_CRCCTRL_CRCMODE_Pos) +#define DMAC_CRCCTRL_CRCMODE_CRCGEN (DMAC_CRCCTRL_CRCMODE_CRCGEN_Val << DMAC_CRCCTRL_CRCMODE_Pos) +#define DMAC_CRCCTRL_MASK _U_(0xFF0F) /**< \brief (DMAC_CRCCTRL) MASK Register */ + +/* -------- DMAC_CRCDATAIN : (DMAC Offset: 0x04) (R/W 32) CRC Data Input -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CRCDATAIN:32; /*!< bit: 0..31 CRC Data Input */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_CRCDATAIN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CRCDATAIN_OFFSET 0x04 /**< \brief (DMAC_CRCDATAIN offset) CRC Data Input */ +#define DMAC_CRCDATAIN_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_CRCDATAIN reset_value) CRC Data Input */ + +#define DMAC_CRCDATAIN_CRCDATAIN_Pos 0 /**< \brief (DMAC_CRCDATAIN) CRC Data Input */ +#define DMAC_CRCDATAIN_CRCDATAIN_Msk (_U_(0xFFFFFFFF) << DMAC_CRCDATAIN_CRCDATAIN_Pos) +#define DMAC_CRCDATAIN_CRCDATAIN(value) (DMAC_CRCDATAIN_CRCDATAIN_Msk & ((value) << DMAC_CRCDATAIN_CRCDATAIN_Pos)) +#define DMAC_CRCDATAIN_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_CRCDATAIN) MASK Register */ + +/* -------- DMAC_CRCCHKSUM : (DMAC Offset: 0x08) (R/W 32) CRC Checksum -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CRCCHKSUM:32; /*!< bit: 0..31 CRC Checksum */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_CRCCHKSUM_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CRCCHKSUM_OFFSET 0x08 /**< \brief (DMAC_CRCCHKSUM offset) CRC Checksum */ +#define DMAC_CRCCHKSUM_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_CRCCHKSUM reset_value) CRC Checksum */ + +#define DMAC_CRCCHKSUM_CRCCHKSUM_Pos 0 /**< \brief (DMAC_CRCCHKSUM) CRC Checksum */ +#define DMAC_CRCCHKSUM_CRCCHKSUM_Msk (_U_(0xFFFFFFFF) << DMAC_CRCCHKSUM_CRCCHKSUM_Pos) +#define DMAC_CRCCHKSUM_CRCCHKSUM(value) (DMAC_CRCCHKSUM_CRCCHKSUM_Msk & ((value) << DMAC_CRCCHKSUM_CRCCHKSUM_Pos)) +#define DMAC_CRCCHKSUM_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_CRCCHKSUM) MASK Register */ + +/* -------- DMAC_CRCSTATUS : (DMAC Offset: 0x0C) (R/W 8) CRC Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t CRCBUSY:1; /*!< bit: 0 CRC Module Busy */ + uint8_t CRCZERO:1; /*!< bit: 1 CRC Zero */ + uint8_t CRCERR:1; /*!< bit: 2 CRC Error */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CRCSTATUS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CRCSTATUS_OFFSET 0x0C /**< \brief (DMAC_CRCSTATUS offset) CRC Status */ +#define DMAC_CRCSTATUS_RESETVALUE _U_(0x00) /**< \brief (DMAC_CRCSTATUS reset_value) CRC Status */ + +#define DMAC_CRCSTATUS_CRCBUSY_Pos 0 /**< \brief (DMAC_CRCSTATUS) CRC Module Busy */ +#define DMAC_CRCSTATUS_CRCBUSY (_U_(0x1) << DMAC_CRCSTATUS_CRCBUSY_Pos) +#define DMAC_CRCSTATUS_CRCZERO_Pos 1 /**< \brief (DMAC_CRCSTATUS) CRC Zero */ +#define DMAC_CRCSTATUS_CRCZERO (_U_(0x1) << DMAC_CRCSTATUS_CRCZERO_Pos) +#define DMAC_CRCSTATUS_CRCERR_Pos 2 /**< \brief (DMAC_CRCSTATUS) CRC Error */ +#define DMAC_CRCSTATUS_CRCERR (_U_(0x1) << DMAC_CRCSTATUS_CRCERR_Pos) +#define DMAC_CRCSTATUS_MASK _U_(0x07) /**< \brief (DMAC_CRCSTATUS) MASK Register */ + +/* -------- DMAC_DBGCTRL : (DMAC Offset: 0x0D) (R/W 8) Debug Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t DBGRUN:1; /*!< bit: 0 Debug Run */ + uint8_t :7; /*!< bit: 1.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_DBGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_DBGCTRL_OFFSET 0x0D /**< \brief (DMAC_DBGCTRL offset) Debug Control */ +#define DMAC_DBGCTRL_RESETVALUE _U_(0x00) /**< \brief (DMAC_DBGCTRL reset_value) Debug Control */ + +#define DMAC_DBGCTRL_DBGRUN_Pos 0 /**< \brief (DMAC_DBGCTRL) Debug Run */ +#define DMAC_DBGCTRL_DBGRUN (_U_(0x1) << DMAC_DBGCTRL_DBGRUN_Pos) +#define DMAC_DBGCTRL_MASK _U_(0x01) /**< \brief (DMAC_DBGCTRL) MASK Register */ + +/* -------- DMAC_SWTRIGCTRL : (DMAC Offset: 0x10) (R/W 32) Software Trigger Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWTRIG0:1; /*!< bit: 0 Channel 0 Software Trigger */ + uint32_t SWTRIG1:1; /*!< bit: 1 Channel 1 Software Trigger */ + uint32_t SWTRIG2:1; /*!< bit: 2 Channel 2 Software Trigger */ + uint32_t SWTRIG3:1; /*!< bit: 3 Channel 3 Software Trigger */ + uint32_t SWTRIG4:1; /*!< bit: 4 Channel 4 Software Trigger */ + uint32_t SWTRIG5:1; /*!< bit: 5 Channel 5 Software Trigger */ + uint32_t SWTRIG6:1; /*!< bit: 6 Channel 6 Software Trigger */ + uint32_t SWTRIG7:1; /*!< bit: 7 Channel 7 Software Trigger */ + uint32_t SWTRIG8:1; /*!< bit: 8 Channel 8 Software Trigger */ + uint32_t SWTRIG9:1; /*!< bit: 9 Channel 9 Software Trigger */ + uint32_t SWTRIG10:1; /*!< bit: 10 Channel 10 Software Trigger */ + uint32_t SWTRIG11:1; /*!< bit: 11 Channel 11 Software Trigger */ + uint32_t SWTRIG12:1; /*!< bit: 12 Channel 12 Software Trigger */ + uint32_t SWTRIG13:1; /*!< bit: 13 Channel 13 Software Trigger */ + uint32_t SWTRIG14:1; /*!< bit: 14 Channel 14 Software Trigger */ + uint32_t SWTRIG15:1; /*!< bit: 15 Channel 15 Software Trigger */ + uint32_t SWTRIG16:1; /*!< bit: 16 Channel 16 Software Trigger */ + uint32_t SWTRIG17:1; /*!< bit: 17 Channel 17 Software Trigger */ + uint32_t SWTRIG18:1; /*!< bit: 18 Channel 18 Software Trigger */ + uint32_t SWTRIG19:1; /*!< bit: 19 Channel 19 Software Trigger */ + uint32_t SWTRIG20:1; /*!< bit: 20 Channel 20 Software Trigger */ + uint32_t SWTRIG21:1; /*!< bit: 21 Channel 21 Software Trigger */ + uint32_t SWTRIG22:1; /*!< bit: 22 Channel 22 Software Trigger */ + uint32_t SWTRIG23:1; /*!< bit: 23 Channel 23 Software Trigger */ + uint32_t SWTRIG24:1; /*!< bit: 24 Channel 24 Software Trigger */ + uint32_t SWTRIG25:1; /*!< bit: 25 Channel 25 Software Trigger */ + uint32_t SWTRIG26:1; /*!< bit: 26 Channel 26 Software Trigger */ + uint32_t SWTRIG27:1; /*!< bit: 27 Channel 27 Software Trigger */ + uint32_t SWTRIG28:1; /*!< bit: 28 Channel 28 Software Trigger */ + uint32_t SWTRIG29:1; /*!< bit: 29 Channel 29 Software Trigger */ + uint32_t SWTRIG30:1; /*!< bit: 30 Channel 30 Software Trigger */ + uint32_t SWTRIG31:1; /*!< bit: 31 Channel 31 Software Trigger */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t SWTRIG:32; /*!< bit: 0..31 Channel x Software Trigger */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_SWTRIGCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_SWTRIGCTRL_OFFSET 0x10 /**< \brief (DMAC_SWTRIGCTRL offset) Software Trigger Control */ +#define DMAC_SWTRIGCTRL_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_SWTRIGCTRL reset_value) Software Trigger Control */ + +#define DMAC_SWTRIGCTRL_SWTRIG0_Pos 0 /**< \brief (DMAC_SWTRIGCTRL) Channel 0 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG0 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG0_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG1_Pos 1 /**< \brief (DMAC_SWTRIGCTRL) Channel 1 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG1 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG1_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG2_Pos 2 /**< \brief (DMAC_SWTRIGCTRL) Channel 2 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG2 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG2_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG3_Pos 3 /**< \brief (DMAC_SWTRIGCTRL) Channel 3 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG3 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG3_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG4_Pos 4 /**< \brief (DMAC_SWTRIGCTRL) Channel 4 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG4 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG4_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG5_Pos 5 /**< \brief (DMAC_SWTRIGCTRL) Channel 5 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG5 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG5_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG6_Pos 6 /**< \brief (DMAC_SWTRIGCTRL) Channel 6 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG6 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG6_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG7_Pos 7 /**< \brief (DMAC_SWTRIGCTRL) Channel 7 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG7 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG7_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG8_Pos 8 /**< \brief (DMAC_SWTRIGCTRL) Channel 8 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG8 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG8_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG9_Pos 9 /**< \brief (DMAC_SWTRIGCTRL) Channel 9 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG9 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG9_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG10_Pos 10 /**< \brief (DMAC_SWTRIGCTRL) Channel 10 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG10 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG10_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG11_Pos 11 /**< \brief (DMAC_SWTRIGCTRL) Channel 11 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG11 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG11_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG12_Pos 12 /**< \brief (DMAC_SWTRIGCTRL) Channel 12 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG12 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG12_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG13_Pos 13 /**< \brief (DMAC_SWTRIGCTRL) Channel 13 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG13 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG13_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG14_Pos 14 /**< \brief (DMAC_SWTRIGCTRL) Channel 14 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG14 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG14_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG15_Pos 15 /**< \brief (DMAC_SWTRIGCTRL) Channel 15 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG15 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG15_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG16_Pos 16 /**< \brief (DMAC_SWTRIGCTRL) Channel 16 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG16 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG16_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG17_Pos 17 /**< \brief (DMAC_SWTRIGCTRL) Channel 17 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG17 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG17_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG18_Pos 18 /**< \brief (DMAC_SWTRIGCTRL) Channel 18 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG18 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG18_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG19_Pos 19 /**< \brief (DMAC_SWTRIGCTRL) Channel 19 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG19 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG19_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG20_Pos 20 /**< \brief (DMAC_SWTRIGCTRL) Channel 20 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG20 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG20_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG21_Pos 21 /**< \brief (DMAC_SWTRIGCTRL) Channel 21 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG21 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG21_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG22_Pos 22 /**< \brief (DMAC_SWTRIGCTRL) Channel 22 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG22 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG22_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG23_Pos 23 /**< \brief (DMAC_SWTRIGCTRL) Channel 23 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG23 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG23_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG24_Pos 24 /**< \brief (DMAC_SWTRIGCTRL) Channel 24 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG24 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG24_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG25_Pos 25 /**< \brief (DMAC_SWTRIGCTRL) Channel 25 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG25 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG25_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG26_Pos 26 /**< \brief (DMAC_SWTRIGCTRL) Channel 26 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG26 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG26_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG27_Pos 27 /**< \brief (DMAC_SWTRIGCTRL) Channel 27 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG27 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG27_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG28_Pos 28 /**< \brief (DMAC_SWTRIGCTRL) Channel 28 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG28 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG28_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG29_Pos 29 /**< \brief (DMAC_SWTRIGCTRL) Channel 29 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG29 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG29_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG30_Pos 30 /**< \brief (DMAC_SWTRIGCTRL) Channel 30 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG30 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG30_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG31_Pos 31 /**< \brief (DMAC_SWTRIGCTRL) Channel 31 Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG31 (_U_(1) << DMAC_SWTRIGCTRL_SWTRIG31_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG_Pos 0 /**< \brief (DMAC_SWTRIGCTRL) Channel x Software Trigger */ +#define DMAC_SWTRIGCTRL_SWTRIG_Msk (_U_(0xFFFFFFFF) << DMAC_SWTRIGCTRL_SWTRIG_Pos) +#define DMAC_SWTRIGCTRL_SWTRIG(value) (DMAC_SWTRIGCTRL_SWTRIG_Msk & ((value) << DMAC_SWTRIGCTRL_SWTRIG_Pos)) +#define DMAC_SWTRIGCTRL_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_SWTRIGCTRL) MASK Register */ + +/* -------- DMAC_PRICTRL0 : (DMAC Offset: 0x14) (R/W 32) Priority Control 0 -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t LVLPRI0:5; /*!< bit: 0.. 4 Level 0 Channel Priority Number */ + uint32_t QOS0:2; /*!< bit: 5.. 6 Level 0 Quality of Service */ + uint32_t RRLVLEN0:1; /*!< bit: 7 Level 0 Round-Robin Scheduling Enable */ + uint32_t LVLPRI1:5; /*!< bit: 8..12 Level 1 Channel Priority Number */ + uint32_t QOS1:2; /*!< bit: 13..14 Level 1 Quality of Service */ + uint32_t RRLVLEN1:1; /*!< bit: 15 Level 1 Round-Robin Scheduling Enable */ + uint32_t LVLPRI2:5; /*!< bit: 16..20 Level 2 Channel Priority Number */ + uint32_t QOS2:2; /*!< bit: 21..22 Level 2 Quality of Service */ + uint32_t RRLVLEN2:1; /*!< bit: 23 Level 2 Round-Robin Scheduling Enable */ + uint32_t LVLPRI3:5; /*!< bit: 24..28 Level 3 Channel Priority Number */ + uint32_t QOS3:2; /*!< bit: 29..30 Level 3 Quality of Service */ + uint32_t RRLVLEN3:1; /*!< bit: 31 Level 3 Round-Robin Scheduling Enable */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_PRICTRL0_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_PRICTRL0_OFFSET 0x14 /**< \brief (DMAC_PRICTRL0 offset) Priority Control 0 */ +#define DMAC_PRICTRL0_RESETVALUE _U_(0x40404040) /**< \brief (DMAC_PRICTRL0 reset_value) Priority Control 0 */ + +#define DMAC_PRICTRL0_LVLPRI0_Pos 0 /**< \brief (DMAC_PRICTRL0) Level 0 Channel Priority Number */ +#define DMAC_PRICTRL0_LVLPRI0_Msk (_U_(0x1F) << DMAC_PRICTRL0_LVLPRI0_Pos) +#define DMAC_PRICTRL0_LVLPRI0(value) (DMAC_PRICTRL0_LVLPRI0_Msk & ((value) << DMAC_PRICTRL0_LVLPRI0_Pos)) +#define DMAC_PRICTRL0_QOS0_Pos 5 /**< \brief (DMAC_PRICTRL0) Level 0 Quality of Service */ +#define DMAC_PRICTRL0_QOS0_Msk (_U_(0x3) << DMAC_PRICTRL0_QOS0_Pos) +#define DMAC_PRICTRL0_QOS0(value) (DMAC_PRICTRL0_QOS0_Msk & ((value) << DMAC_PRICTRL0_QOS0_Pos)) +#define DMAC_PRICTRL0_QOS0_REGULAR_Val _U_(0x0) /**< \brief (DMAC_PRICTRL0) Regular delivery */ +#define DMAC_PRICTRL0_QOS0_SHORTAGE_Val _U_(0x1) /**< \brief (DMAC_PRICTRL0) Bandwidth shortage */ +#define DMAC_PRICTRL0_QOS0_SENSITIVE_Val _U_(0x2) /**< \brief (DMAC_PRICTRL0) Latency sensitive */ +#define DMAC_PRICTRL0_QOS0_CRITICAL_Val _U_(0x3) /**< \brief (DMAC_PRICTRL0) Latency critical */ +#define DMAC_PRICTRL0_QOS0_REGULAR (DMAC_PRICTRL0_QOS0_REGULAR_Val << DMAC_PRICTRL0_QOS0_Pos) +#define DMAC_PRICTRL0_QOS0_SHORTAGE (DMAC_PRICTRL0_QOS0_SHORTAGE_Val << DMAC_PRICTRL0_QOS0_Pos) +#define DMAC_PRICTRL0_QOS0_SENSITIVE (DMAC_PRICTRL0_QOS0_SENSITIVE_Val << DMAC_PRICTRL0_QOS0_Pos) +#define DMAC_PRICTRL0_QOS0_CRITICAL (DMAC_PRICTRL0_QOS0_CRITICAL_Val << DMAC_PRICTRL0_QOS0_Pos) +#define DMAC_PRICTRL0_RRLVLEN0_Pos 7 /**< \brief (DMAC_PRICTRL0) Level 0 Round-Robin Scheduling Enable */ +#define DMAC_PRICTRL0_RRLVLEN0 (_U_(0x1) << DMAC_PRICTRL0_RRLVLEN0_Pos) +#define DMAC_PRICTRL0_LVLPRI1_Pos 8 /**< \brief (DMAC_PRICTRL0) Level 1 Channel Priority Number */ +#define DMAC_PRICTRL0_LVLPRI1_Msk (_U_(0x1F) << DMAC_PRICTRL0_LVLPRI1_Pos) +#define DMAC_PRICTRL0_LVLPRI1(value) (DMAC_PRICTRL0_LVLPRI1_Msk & ((value) << DMAC_PRICTRL0_LVLPRI1_Pos)) +#define DMAC_PRICTRL0_QOS1_Pos 13 /**< \brief (DMAC_PRICTRL0) Level 1 Quality of Service */ +#define DMAC_PRICTRL0_QOS1_Msk (_U_(0x3) << DMAC_PRICTRL0_QOS1_Pos) +#define DMAC_PRICTRL0_QOS1(value) (DMAC_PRICTRL0_QOS1_Msk & ((value) << DMAC_PRICTRL0_QOS1_Pos)) +#define DMAC_PRICTRL0_QOS1_REGULAR_Val _U_(0x0) /**< \brief (DMAC_PRICTRL0) Regular delivery */ +#define DMAC_PRICTRL0_QOS1_SHORTAGE_Val _U_(0x1) /**< \brief (DMAC_PRICTRL0) Bandwidth shortage */ +#define DMAC_PRICTRL0_QOS1_SENSITIVE_Val _U_(0x2) /**< \brief (DMAC_PRICTRL0) Latency sensitive */ +#define DMAC_PRICTRL0_QOS1_CRITICAL_Val _U_(0x3) /**< \brief (DMAC_PRICTRL0) Latency critical */ +#define DMAC_PRICTRL0_QOS1_REGULAR (DMAC_PRICTRL0_QOS1_REGULAR_Val << DMAC_PRICTRL0_QOS1_Pos) +#define DMAC_PRICTRL0_QOS1_SHORTAGE (DMAC_PRICTRL0_QOS1_SHORTAGE_Val << DMAC_PRICTRL0_QOS1_Pos) +#define DMAC_PRICTRL0_QOS1_SENSITIVE (DMAC_PRICTRL0_QOS1_SENSITIVE_Val << DMAC_PRICTRL0_QOS1_Pos) +#define DMAC_PRICTRL0_QOS1_CRITICAL (DMAC_PRICTRL0_QOS1_CRITICAL_Val << DMAC_PRICTRL0_QOS1_Pos) +#define DMAC_PRICTRL0_RRLVLEN1_Pos 15 /**< \brief (DMAC_PRICTRL0) Level 1 Round-Robin Scheduling Enable */ +#define DMAC_PRICTRL0_RRLVLEN1 (_U_(0x1) << DMAC_PRICTRL0_RRLVLEN1_Pos) +#define DMAC_PRICTRL0_LVLPRI2_Pos 16 /**< \brief (DMAC_PRICTRL0) Level 2 Channel Priority Number */ +#define DMAC_PRICTRL0_LVLPRI2_Msk (_U_(0x1F) << DMAC_PRICTRL0_LVLPRI2_Pos) +#define DMAC_PRICTRL0_LVLPRI2(value) (DMAC_PRICTRL0_LVLPRI2_Msk & ((value) << DMAC_PRICTRL0_LVLPRI2_Pos)) +#define DMAC_PRICTRL0_QOS2_Pos 21 /**< \brief (DMAC_PRICTRL0) Level 2 Quality of Service */ +#define DMAC_PRICTRL0_QOS2_Msk (_U_(0x3) << DMAC_PRICTRL0_QOS2_Pos) +#define DMAC_PRICTRL0_QOS2(value) (DMAC_PRICTRL0_QOS2_Msk & ((value) << DMAC_PRICTRL0_QOS2_Pos)) +#define DMAC_PRICTRL0_QOS2_REGULAR_Val _U_(0x0) /**< \brief (DMAC_PRICTRL0) Regular delivery */ +#define DMAC_PRICTRL0_QOS2_SHORTAGE_Val _U_(0x1) /**< \brief (DMAC_PRICTRL0) Bandwidth shortage */ +#define DMAC_PRICTRL0_QOS2_SENSITIVE_Val _U_(0x2) /**< \brief (DMAC_PRICTRL0) Latency sensitive */ +#define DMAC_PRICTRL0_QOS2_CRITICAL_Val _U_(0x3) /**< \brief (DMAC_PRICTRL0) Latency critical */ +#define DMAC_PRICTRL0_QOS2_REGULAR (DMAC_PRICTRL0_QOS2_REGULAR_Val << DMAC_PRICTRL0_QOS2_Pos) +#define DMAC_PRICTRL0_QOS2_SHORTAGE (DMAC_PRICTRL0_QOS2_SHORTAGE_Val << DMAC_PRICTRL0_QOS2_Pos) +#define DMAC_PRICTRL0_QOS2_SENSITIVE (DMAC_PRICTRL0_QOS2_SENSITIVE_Val << DMAC_PRICTRL0_QOS2_Pos) +#define DMAC_PRICTRL0_QOS2_CRITICAL (DMAC_PRICTRL0_QOS2_CRITICAL_Val << DMAC_PRICTRL0_QOS2_Pos) +#define DMAC_PRICTRL0_RRLVLEN2_Pos 23 /**< \brief (DMAC_PRICTRL0) Level 2 Round-Robin Scheduling Enable */ +#define DMAC_PRICTRL0_RRLVLEN2 (_U_(0x1) << DMAC_PRICTRL0_RRLVLEN2_Pos) +#define DMAC_PRICTRL0_LVLPRI3_Pos 24 /**< \brief (DMAC_PRICTRL0) Level 3 Channel Priority Number */ +#define DMAC_PRICTRL0_LVLPRI3_Msk (_U_(0x1F) << DMAC_PRICTRL0_LVLPRI3_Pos) +#define DMAC_PRICTRL0_LVLPRI3(value) (DMAC_PRICTRL0_LVLPRI3_Msk & ((value) << DMAC_PRICTRL0_LVLPRI3_Pos)) +#define DMAC_PRICTRL0_QOS3_Pos 29 /**< \brief (DMAC_PRICTRL0) Level 3 Quality of Service */ +#define DMAC_PRICTRL0_QOS3_Msk (_U_(0x3) << DMAC_PRICTRL0_QOS3_Pos) +#define DMAC_PRICTRL0_QOS3(value) (DMAC_PRICTRL0_QOS3_Msk & ((value) << DMAC_PRICTRL0_QOS3_Pos)) +#define DMAC_PRICTRL0_QOS3_REGULAR_Val _U_(0x0) /**< \brief (DMAC_PRICTRL0) Regular delivery */ +#define DMAC_PRICTRL0_QOS3_SHORTAGE_Val _U_(0x1) /**< \brief (DMAC_PRICTRL0) Bandwidth shortage */ +#define DMAC_PRICTRL0_QOS3_SENSITIVE_Val _U_(0x2) /**< \brief (DMAC_PRICTRL0) Latency sensitive */ +#define DMAC_PRICTRL0_QOS3_CRITICAL_Val _U_(0x3) /**< \brief (DMAC_PRICTRL0) Latency critical */ +#define DMAC_PRICTRL0_QOS3_REGULAR (DMAC_PRICTRL0_QOS3_REGULAR_Val << DMAC_PRICTRL0_QOS3_Pos) +#define DMAC_PRICTRL0_QOS3_SHORTAGE (DMAC_PRICTRL0_QOS3_SHORTAGE_Val << DMAC_PRICTRL0_QOS3_Pos) +#define DMAC_PRICTRL0_QOS3_SENSITIVE (DMAC_PRICTRL0_QOS3_SENSITIVE_Val << DMAC_PRICTRL0_QOS3_Pos) +#define DMAC_PRICTRL0_QOS3_CRITICAL (DMAC_PRICTRL0_QOS3_CRITICAL_Val << DMAC_PRICTRL0_QOS3_Pos) +#define DMAC_PRICTRL0_RRLVLEN3_Pos 31 /**< \brief (DMAC_PRICTRL0) Level 3 Round-Robin Scheduling Enable */ +#define DMAC_PRICTRL0_RRLVLEN3 (_U_(0x1) << DMAC_PRICTRL0_RRLVLEN3_Pos) +#define DMAC_PRICTRL0_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_PRICTRL0) MASK Register */ + +/* -------- DMAC_INTPEND : (DMAC Offset: 0x20) (R/W 16) Interrupt Pending -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t ID:5; /*!< bit: 0.. 4 Channel ID */ + uint16_t :3; /*!< bit: 5.. 7 Reserved */ + uint16_t TERR:1; /*!< bit: 8 Transfer Error */ + uint16_t TCMPL:1; /*!< bit: 9 Transfer Complete */ + uint16_t SUSP:1; /*!< bit: 10 Channel Suspend */ + uint16_t :1; /*!< bit: 11 Reserved */ + uint16_t CRCERR:1; /*!< bit: 12 CRC Error */ + uint16_t FERR:1; /*!< bit: 13 Fetch Error */ + uint16_t BUSY:1; /*!< bit: 14 Busy */ + uint16_t PEND:1; /*!< bit: 15 Pending */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DMAC_INTPEND_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_INTPEND_OFFSET 0x20 /**< \brief (DMAC_INTPEND offset) Interrupt Pending */ +#define DMAC_INTPEND_RESETVALUE _U_(0x0000) /**< \brief (DMAC_INTPEND reset_value) Interrupt Pending */ + +#define DMAC_INTPEND_ID_Pos 0 /**< \brief (DMAC_INTPEND) Channel ID */ +#define DMAC_INTPEND_ID_Msk (_U_(0x1F) << DMAC_INTPEND_ID_Pos) +#define DMAC_INTPEND_ID(value) (DMAC_INTPEND_ID_Msk & ((value) << DMAC_INTPEND_ID_Pos)) +#define DMAC_INTPEND_TERR_Pos 8 /**< \brief (DMAC_INTPEND) Transfer Error */ +#define DMAC_INTPEND_TERR (_U_(0x1) << DMAC_INTPEND_TERR_Pos) +#define DMAC_INTPEND_TCMPL_Pos 9 /**< \brief (DMAC_INTPEND) Transfer Complete */ +#define DMAC_INTPEND_TCMPL (_U_(0x1) << DMAC_INTPEND_TCMPL_Pos) +#define DMAC_INTPEND_SUSP_Pos 10 /**< \brief (DMAC_INTPEND) Channel Suspend */ +#define DMAC_INTPEND_SUSP (_U_(0x1) << DMAC_INTPEND_SUSP_Pos) +#define DMAC_INTPEND_CRCERR_Pos 12 /**< \brief (DMAC_INTPEND) CRC Error */ +#define DMAC_INTPEND_CRCERR (_U_(0x1) << DMAC_INTPEND_CRCERR_Pos) +#define DMAC_INTPEND_FERR_Pos 13 /**< \brief (DMAC_INTPEND) Fetch Error */ +#define DMAC_INTPEND_FERR (_U_(0x1) << DMAC_INTPEND_FERR_Pos) +#define DMAC_INTPEND_BUSY_Pos 14 /**< \brief (DMAC_INTPEND) Busy */ +#define DMAC_INTPEND_BUSY (_U_(0x1) << DMAC_INTPEND_BUSY_Pos) +#define DMAC_INTPEND_PEND_Pos 15 /**< \brief (DMAC_INTPEND) Pending */ +#define DMAC_INTPEND_PEND (_U_(0x1) << DMAC_INTPEND_PEND_Pos) +#define DMAC_INTPEND_MASK _U_(0xF71F) /**< \brief (DMAC_INTPEND) MASK Register */ + +/* -------- DMAC_INTSTATUS : (DMAC Offset: 0x24) (R/ 32) Interrupt Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t CHINT0:1; /*!< bit: 0 Channel 0 Pending Interrupt */ + uint32_t CHINT1:1; /*!< bit: 1 Channel 1 Pending Interrupt */ + uint32_t CHINT2:1; /*!< bit: 2 Channel 2 Pending Interrupt */ + uint32_t CHINT3:1; /*!< bit: 3 Channel 3 Pending Interrupt */ + uint32_t CHINT4:1; /*!< bit: 4 Channel 4 Pending Interrupt */ + uint32_t CHINT5:1; /*!< bit: 5 Channel 5 Pending Interrupt */ + uint32_t CHINT6:1; /*!< bit: 6 Channel 6 Pending Interrupt */ + uint32_t CHINT7:1; /*!< bit: 7 Channel 7 Pending Interrupt */ + uint32_t CHINT8:1; /*!< bit: 8 Channel 8 Pending Interrupt */ + uint32_t CHINT9:1; /*!< bit: 9 Channel 9 Pending Interrupt */ + uint32_t CHINT10:1; /*!< bit: 10 Channel 10 Pending Interrupt */ + uint32_t CHINT11:1; /*!< bit: 11 Channel 11 Pending Interrupt */ + uint32_t CHINT12:1; /*!< bit: 12 Channel 12 Pending Interrupt */ + uint32_t CHINT13:1; /*!< bit: 13 Channel 13 Pending Interrupt */ + uint32_t CHINT14:1; /*!< bit: 14 Channel 14 Pending Interrupt */ + uint32_t CHINT15:1; /*!< bit: 15 Channel 15 Pending Interrupt */ + uint32_t CHINT16:1; /*!< bit: 16 Channel 16 Pending Interrupt */ + uint32_t CHINT17:1; /*!< bit: 17 Channel 17 Pending Interrupt */ + uint32_t CHINT18:1; /*!< bit: 18 Channel 18 Pending Interrupt */ + uint32_t CHINT19:1; /*!< bit: 19 Channel 19 Pending Interrupt */ + uint32_t CHINT20:1; /*!< bit: 20 Channel 20 Pending Interrupt */ + uint32_t CHINT21:1; /*!< bit: 21 Channel 21 Pending Interrupt */ + uint32_t CHINT22:1; /*!< bit: 22 Channel 22 Pending Interrupt */ + uint32_t CHINT23:1; /*!< bit: 23 Channel 23 Pending Interrupt */ + uint32_t CHINT24:1; /*!< bit: 24 Channel 24 Pending Interrupt */ + uint32_t CHINT25:1; /*!< bit: 25 Channel 25 Pending Interrupt */ + uint32_t CHINT26:1; /*!< bit: 26 Channel 26 Pending Interrupt */ + uint32_t CHINT27:1; /*!< bit: 27 Channel 27 Pending Interrupt */ + uint32_t CHINT28:1; /*!< bit: 28 Channel 28 Pending Interrupt */ + uint32_t CHINT29:1; /*!< bit: 29 Channel 29 Pending Interrupt */ + uint32_t CHINT30:1; /*!< bit: 30 Channel 30 Pending Interrupt */ + uint32_t CHINT31:1; /*!< bit: 31 Channel 31 Pending Interrupt */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t CHINT:32; /*!< bit: 0..31 Channel x Pending Interrupt */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_INTSTATUS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_INTSTATUS_OFFSET 0x24 /**< \brief (DMAC_INTSTATUS offset) Interrupt Status */ +#define DMAC_INTSTATUS_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_INTSTATUS reset_value) Interrupt Status */ + +#define DMAC_INTSTATUS_CHINT0_Pos 0 /**< \brief (DMAC_INTSTATUS) Channel 0 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT0 (_U_(1) << DMAC_INTSTATUS_CHINT0_Pos) +#define DMAC_INTSTATUS_CHINT1_Pos 1 /**< \brief (DMAC_INTSTATUS) Channel 1 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT1 (_U_(1) << DMAC_INTSTATUS_CHINT1_Pos) +#define DMAC_INTSTATUS_CHINT2_Pos 2 /**< \brief (DMAC_INTSTATUS) Channel 2 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT2 (_U_(1) << DMAC_INTSTATUS_CHINT2_Pos) +#define DMAC_INTSTATUS_CHINT3_Pos 3 /**< \brief (DMAC_INTSTATUS) Channel 3 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT3 (_U_(1) << DMAC_INTSTATUS_CHINT3_Pos) +#define DMAC_INTSTATUS_CHINT4_Pos 4 /**< \brief (DMAC_INTSTATUS) Channel 4 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT4 (_U_(1) << DMAC_INTSTATUS_CHINT4_Pos) +#define DMAC_INTSTATUS_CHINT5_Pos 5 /**< \brief (DMAC_INTSTATUS) Channel 5 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT5 (_U_(1) << DMAC_INTSTATUS_CHINT5_Pos) +#define DMAC_INTSTATUS_CHINT6_Pos 6 /**< \brief (DMAC_INTSTATUS) Channel 6 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT6 (_U_(1) << DMAC_INTSTATUS_CHINT6_Pos) +#define DMAC_INTSTATUS_CHINT7_Pos 7 /**< \brief (DMAC_INTSTATUS) Channel 7 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT7 (_U_(1) << DMAC_INTSTATUS_CHINT7_Pos) +#define DMAC_INTSTATUS_CHINT8_Pos 8 /**< \brief (DMAC_INTSTATUS) Channel 8 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT8 (_U_(1) << DMAC_INTSTATUS_CHINT8_Pos) +#define DMAC_INTSTATUS_CHINT9_Pos 9 /**< \brief (DMAC_INTSTATUS) Channel 9 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT9 (_U_(1) << DMAC_INTSTATUS_CHINT9_Pos) +#define DMAC_INTSTATUS_CHINT10_Pos 10 /**< \brief (DMAC_INTSTATUS) Channel 10 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT10 (_U_(1) << DMAC_INTSTATUS_CHINT10_Pos) +#define DMAC_INTSTATUS_CHINT11_Pos 11 /**< \brief (DMAC_INTSTATUS) Channel 11 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT11 (_U_(1) << DMAC_INTSTATUS_CHINT11_Pos) +#define DMAC_INTSTATUS_CHINT12_Pos 12 /**< \brief (DMAC_INTSTATUS) Channel 12 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT12 (_U_(1) << DMAC_INTSTATUS_CHINT12_Pos) +#define DMAC_INTSTATUS_CHINT13_Pos 13 /**< \brief (DMAC_INTSTATUS) Channel 13 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT13 (_U_(1) << DMAC_INTSTATUS_CHINT13_Pos) +#define DMAC_INTSTATUS_CHINT14_Pos 14 /**< \brief (DMAC_INTSTATUS) Channel 14 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT14 (_U_(1) << DMAC_INTSTATUS_CHINT14_Pos) +#define DMAC_INTSTATUS_CHINT15_Pos 15 /**< \brief (DMAC_INTSTATUS) Channel 15 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT15 (_U_(1) << DMAC_INTSTATUS_CHINT15_Pos) +#define DMAC_INTSTATUS_CHINT16_Pos 16 /**< \brief (DMAC_INTSTATUS) Channel 16 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT16 (_U_(1) << DMAC_INTSTATUS_CHINT16_Pos) +#define DMAC_INTSTATUS_CHINT17_Pos 17 /**< \brief (DMAC_INTSTATUS) Channel 17 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT17 (_U_(1) << DMAC_INTSTATUS_CHINT17_Pos) +#define DMAC_INTSTATUS_CHINT18_Pos 18 /**< \brief (DMAC_INTSTATUS) Channel 18 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT18 (_U_(1) << DMAC_INTSTATUS_CHINT18_Pos) +#define DMAC_INTSTATUS_CHINT19_Pos 19 /**< \brief (DMAC_INTSTATUS) Channel 19 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT19 (_U_(1) << DMAC_INTSTATUS_CHINT19_Pos) +#define DMAC_INTSTATUS_CHINT20_Pos 20 /**< \brief (DMAC_INTSTATUS) Channel 20 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT20 (_U_(1) << DMAC_INTSTATUS_CHINT20_Pos) +#define DMAC_INTSTATUS_CHINT21_Pos 21 /**< \brief (DMAC_INTSTATUS) Channel 21 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT21 (_U_(1) << DMAC_INTSTATUS_CHINT21_Pos) +#define DMAC_INTSTATUS_CHINT22_Pos 22 /**< \brief (DMAC_INTSTATUS) Channel 22 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT22 (_U_(1) << DMAC_INTSTATUS_CHINT22_Pos) +#define DMAC_INTSTATUS_CHINT23_Pos 23 /**< \brief (DMAC_INTSTATUS) Channel 23 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT23 (_U_(1) << DMAC_INTSTATUS_CHINT23_Pos) +#define DMAC_INTSTATUS_CHINT24_Pos 24 /**< \brief (DMAC_INTSTATUS) Channel 24 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT24 (_U_(1) << DMAC_INTSTATUS_CHINT24_Pos) +#define DMAC_INTSTATUS_CHINT25_Pos 25 /**< \brief (DMAC_INTSTATUS) Channel 25 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT25 (_U_(1) << DMAC_INTSTATUS_CHINT25_Pos) +#define DMAC_INTSTATUS_CHINT26_Pos 26 /**< \brief (DMAC_INTSTATUS) Channel 26 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT26 (_U_(1) << DMAC_INTSTATUS_CHINT26_Pos) +#define DMAC_INTSTATUS_CHINT27_Pos 27 /**< \brief (DMAC_INTSTATUS) Channel 27 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT27 (_U_(1) << DMAC_INTSTATUS_CHINT27_Pos) +#define DMAC_INTSTATUS_CHINT28_Pos 28 /**< \brief (DMAC_INTSTATUS) Channel 28 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT28 (_U_(1) << DMAC_INTSTATUS_CHINT28_Pos) +#define DMAC_INTSTATUS_CHINT29_Pos 29 /**< \brief (DMAC_INTSTATUS) Channel 29 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT29 (_U_(1) << DMAC_INTSTATUS_CHINT29_Pos) +#define DMAC_INTSTATUS_CHINT30_Pos 30 /**< \brief (DMAC_INTSTATUS) Channel 30 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT30 (_U_(1) << DMAC_INTSTATUS_CHINT30_Pos) +#define DMAC_INTSTATUS_CHINT31_Pos 31 /**< \brief (DMAC_INTSTATUS) Channel 31 Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT31 (_U_(1) << DMAC_INTSTATUS_CHINT31_Pos) +#define DMAC_INTSTATUS_CHINT_Pos 0 /**< \brief (DMAC_INTSTATUS) Channel x Pending Interrupt */ +#define DMAC_INTSTATUS_CHINT_Msk (_U_(0xFFFFFFFF) << DMAC_INTSTATUS_CHINT_Pos) +#define DMAC_INTSTATUS_CHINT(value) (DMAC_INTSTATUS_CHINT_Msk & ((value) << DMAC_INTSTATUS_CHINT_Pos)) +#define DMAC_INTSTATUS_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_INTSTATUS) MASK Register */ + +/* -------- DMAC_BUSYCH : (DMAC Offset: 0x28) (R/ 32) Busy Channels -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t BUSYCH0:1; /*!< bit: 0 Busy Channel 0 */ + uint32_t BUSYCH1:1; /*!< bit: 1 Busy Channel 1 */ + uint32_t BUSYCH2:1; /*!< bit: 2 Busy Channel 2 */ + uint32_t BUSYCH3:1; /*!< bit: 3 Busy Channel 3 */ + uint32_t BUSYCH4:1; /*!< bit: 4 Busy Channel 4 */ + uint32_t BUSYCH5:1; /*!< bit: 5 Busy Channel 5 */ + uint32_t BUSYCH6:1; /*!< bit: 6 Busy Channel 6 */ + uint32_t BUSYCH7:1; /*!< bit: 7 Busy Channel 7 */ + uint32_t BUSYCH8:1; /*!< bit: 8 Busy Channel 8 */ + uint32_t BUSYCH9:1; /*!< bit: 9 Busy Channel 9 */ + uint32_t BUSYCH10:1; /*!< bit: 10 Busy Channel 10 */ + uint32_t BUSYCH11:1; /*!< bit: 11 Busy Channel 11 */ + uint32_t BUSYCH12:1; /*!< bit: 12 Busy Channel 12 */ + uint32_t BUSYCH13:1; /*!< bit: 13 Busy Channel 13 */ + uint32_t BUSYCH14:1; /*!< bit: 14 Busy Channel 14 */ + uint32_t BUSYCH15:1; /*!< bit: 15 Busy Channel 15 */ + uint32_t BUSYCH16:1; /*!< bit: 16 Busy Channel 16 */ + uint32_t BUSYCH17:1; /*!< bit: 17 Busy Channel 17 */ + uint32_t BUSYCH18:1; /*!< bit: 18 Busy Channel 18 */ + uint32_t BUSYCH19:1; /*!< bit: 19 Busy Channel 19 */ + uint32_t BUSYCH20:1; /*!< bit: 20 Busy Channel 20 */ + uint32_t BUSYCH21:1; /*!< bit: 21 Busy Channel 21 */ + uint32_t BUSYCH22:1; /*!< bit: 22 Busy Channel 22 */ + uint32_t BUSYCH23:1; /*!< bit: 23 Busy Channel 23 */ + uint32_t BUSYCH24:1; /*!< bit: 24 Busy Channel 24 */ + uint32_t BUSYCH25:1; /*!< bit: 25 Busy Channel 25 */ + uint32_t BUSYCH26:1; /*!< bit: 26 Busy Channel 26 */ + uint32_t BUSYCH27:1; /*!< bit: 27 Busy Channel 27 */ + uint32_t BUSYCH28:1; /*!< bit: 28 Busy Channel 28 */ + uint32_t BUSYCH29:1; /*!< bit: 29 Busy Channel 29 */ + uint32_t BUSYCH30:1; /*!< bit: 30 Busy Channel 30 */ + uint32_t BUSYCH31:1; /*!< bit: 31 Busy Channel 31 */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t BUSYCH:32; /*!< bit: 0..31 Busy Channel x */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_BUSYCH_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_BUSYCH_OFFSET 0x28 /**< \brief (DMAC_BUSYCH offset) Busy Channels */ +#define DMAC_BUSYCH_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_BUSYCH reset_value) Busy Channels */ + +#define DMAC_BUSYCH_BUSYCH0_Pos 0 /**< \brief (DMAC_BUSYCH) Busy Channel 0 */ +#define DMAC_BUSYCH_BUSYCH0 (_U_(1) << DMAC_BUSYCH_BUSYCH0_Pos) +#define DMAC_BUSYCH_BUSYCH1_Pos 1 /**< \brief (DMAC_BUSYCH) Busy Channel 1 */ +#define DMAC_BUSYCH_BUSYCH1 (_U_(1) << DMAC_BUSYCH_BUSYCH1_Pos) +#define DMAC_BUSYCH_BUSYCH2_Pos 2 /**< \brief (DMAC_BUSYCH) Busy Channel 2 */ +#define DMAC_BUSYCH_BUSYCH2 (_U_(1) << DMAC_BUSYCH_BUSYCH2_Pos) +#define DMAC_BUSYCH_BUSYCH3_Pos 3 /**< \brief (DMAC_BUSYCH) Busy Channel 3 */ +#define DMAC_BUSYCH_BUSYCH3 (_U_(1) << DMAC_BUSYCH_BUSYCH3_Pos) +#define DMAC_BUSYCH_BUSYCH4_Pos 4 /**< \brief (DMAC_BUSYCH) Busy Channel 4 */ +#define DMAC_BUSYCH_BUSYCH4 (_U_(1) << DMAC_BUSYCH_BUSYCH4_Pos) +#define DMAC_BUSYCH_BUSYCH5_Pos 5 /**< \brief (DMAC_BUSYCH) Busy Channel 5 */ +#define DMAC_BUSYCH_BUSYCH5 (_U_(1) << DMAC_BUSYCH_BUSYCH5_Pos) +#define DMAC_BUSYCH_BUSYCH6_Pos 6 /**< \brief (DMAC_BUSYCH) Busy Channel 6 */ +#define DMAC_BUSYCH_BUSYCH6 (_U_(1) << DMAC_BUSYCH_BUSYCH6_Pos) +#define DMAC_BUSYCH_BUSYCH7_Pos 7 /**< \brief (DMAC_BUSYCH) Busy Channel 7 */ +#define DMAC_BUSYCH_BUSYCH7 (_U_(1) << DMAC_BUSYCH_BUSYCH7_Pos) +#define DMAC_BUSYCH_BUSYCH8_Pos 8 /**< \brief (DMAC_BUSYCH) Busy Channel 8 */ +#define DMAC_BUSYCH_BUSYCH8 (_U_(1) << DMAC_BUSYCH_BUSYCH8_Pos) +#define DMAC_BUSYCH_BUSYCH9_Pos 9 /**< \brief (DMAC_BUSYCH) Busy Channel 9 */ +#define DMAC_BUSYCH_BUSYCH9 (_U_(1) << DMAC_BUSYCH_BUSYCH9_Pos) +#define DMAC_BUSYCH_BUSYCH10_Pos 10 /**< \brief (DMAC_BUSYCH) Busy Channel 10 */ +#define DMAC_BUSYCH_BUSYCH10 (_U_(1) << DMAC_BUSYCH_BUSYCH10_Pos) +#define DMAC_BUSYCH_BUSYCH11_Pos 11 /**< \brief (DMAC_BUSYCH) Busy Channel 11 */ +#define DMAC_BUSYCH_BUSYCH11 (_U_(1) << DMAC_BUSYCH_BUSYCH11_Pos) +#define DMAC_BUSYCH_BUSYCH12_Pos 12 /**< \brief (DMAC_BUSYCH) Busy Channel 12 */ +#define DMAC_BUSYCH_BUSYCH12 (_U_(1) << DMAC_BUSYCH_BUSYCH12_Pos) +#define DMAC_BUSYCH_BUSYCH13_Pos 13 /**< \brief (DMAC_BUSYCH) Busy Channel 13 */ +#define DMAC_BUSYCH_BUSYCH13 (_U_(1) << DMAC_BUSYCH_BUSYCH13_Pos) +#define DMAC_BUSYCH_BUSYCH14_Pos 14 /**< \brief (DMAC_BUSYCH) Busy Channel 14 */ +#define DMAC_BUSYCH_BUSYCH14 (_U_(1) << DMAC_BUSYCH_BUSYCH14_Pos) +#define DMAC_BUSYCH_BUSYCH15_Pos 15 /**< \brief (DMAC_BUSYCH) Busy Channel 15 */ +#define DMAC_BUSYCH_BUSYCH15 (_U_(1) << DMAC_BUSYCH_BUSYCH15_Pos) +#define DMAC_BUSYCH_BUSYCH16_Pos 16 /**< \brief (DMAC_BUSYCH) Busy Channel 16 */ +#define DMAC_BUSYCH_BUSYCH16 (_U_(1) << DMAC_BUSYCH_BUSYCH16_Pos) +#define DMAC_BUSYCH_BUSYCH17_Pos 17 /**< \brief (DMAC_BUSYCH) Busy Channel 17 */ +#define DMAC_BUSYCH_BUSYCH17 (_U_(1) << DMAC_BUSYCH_BUSYCH17_Pos) +#define DMAC_BUSYCH_BUSYCH18_Pos 18 /**< \brief (DMAC_BUSYCH) Busy Channel 18 */ +#define DMAC_BUSYCH_BUSYCH18 (_U_(1) << DMAC_BUSYCH_BUSYCH18_Pos) +#define DMAC_BUSYCH_BUSYCH19_Pos 19 /**< \brief (DMAC_BUSYCH) Busy Channel 19 */ +#define DMAC_BUSYCH_BUSYCH19 (_U_(1) << DMAC_BUSYCH_BUSYCH19_Pos) +#define DMAC_BUSYCH_BUSYCH20_Pos 20 /**< \brief (DMAC_BUSYCH) Busy Channel 20 */ +#define DMAC_BUSYCH_BUSYCH20 (_U_(1) << DMAC_BUSYCH_BUSYCH20_Pos) +#define DMAC_BUSYCH_BUSYCH21_Pos 21 /**< \brief (DMAC_BUSYCH) Busy Channel 21 */ +#define DMAC_BUSYCH_BUSYCH21 (_U_(1) << DMAC_BUSYCH_BUSYCH21_Pos) +#define DMAC_BUSYCH_BUSYCH22_Pos 22 /**< \brief (DMAC_BUSYCH) Busy Channel 22 */ +#define DMAC_BUSYCH_BUSYCH22 (_U_(1) << DMAC_BUSYCH_BUSYCH22_Pos) +#define DMAC_BUSYCH_BUSYCH23_Pos 23 /**< \brief (DMAC_BUSYCH) Busy Channel 23 */ +#define DMAC_BUSYCH_BUSYCH23 (_U_(1) << DMAC_BUSYCH_BUSYCH23_Pos) +#define DMAC_BUSYCH_BUSYCH24_Pos 24 /**< \brief (DMAC_BUSYCH) Busy Channel 24 */ +#define DMAC_BUSYCH_BUSYCH24 (_U_(1) << DMAC_BUSYCH_BUSYCH24_Pos) +#define DMAC_BUSYCH_BUSYCH25_Pos 25 /**< \brief (DMAC_BUSYCH) Busy Channel 25 */ +#define DMAC_BUSYCH_BUSYCH25 (_U_(1) << DMAC_BUSYCH_BUSYCH25_Pos) +#define DMAC_BUSYCH_BUSYCH26_Pos 26 /**< \brief (DMAC_BUSYCH) Busy Channel 26 */ +#define DMAC_BUSYCH_BUSYCH26 (_U_(1) << DMAC_BUSYCH_BUSYCH26_Pos) +#define DMAC_BUSYCH_BUSYCH27_Pos 27 /**< \brief (DMAC_BUSYCH) Busy Channel 27 */ +#define DMAC_BUSYCH_BUSYCH27 (_U_(1) << DMAC_BUSYCH_BUSYCH27_Pos) +#define DMAC_BUSYCH_BUSYCH28_Pos 28 /**< \brief (DMAC_BUSYCH) Busy Channel 28 */ +#define DMAC_BUSYCH_BUSYCH28 (_U_(1) << DMAC_BUSYCH_BUSYCH28_Pos) +#define DMAC_BUSYCH_BUSYCH29_Pos 29 /**< \brief (DMAC_BUSYCH) Busy Channel 29 */ +#define DMAC_BUSYCH_BUSYCH29 (_U_(1) << DMAC_BUSYCH_BUSYCH29_Pos) +#define DMAC_BUSYCH_BUSYCH30_Pos 30 /**< \brief (DMAC_BUSYCH) Busy Channel 30 */ +#define DMAC_BUSYCH_BUSYCH30 (_U_(1) << DMAC_BUSYCH_BUSYCH30_Pos) +#define DMAC_BUSYCH_BUSYCH31_Pos 31 /**< \brief (DMAC_BUSYCH) Busy Channel 31 */ +#define DMAC_BUSYCH_BUSYCH31 (_U_(1) << DMAC_BUSYCH_BUSYCH31_Pos) +#define DMAC_BUSYCH_BUSYCH_Pos 0 /**< \brief (DMAC_BUSYCH) Busy Channel x */ +#define DMAC_BUSYCH_BUSYCH_Msk (_U_(0xFFFFFFFF) << DMAC_BUSYCH_BUSYCH_Pos) +#define DMAC_BUSYCH_BUSYCH(value) (DMAC_BUSYCH_BUSYCH_Msk & ((value) << DMAC_BUSYCH_BUSYCH_Pos)) +#define DMAC_BUSYCH_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_BUSYCH) MASK Register */ + +/* -------- DMAC_PENDCH : (DMAC Offset: 0x2C) (R/ 32) Pending Channels -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t PENDCH0:1; /*!< bit: 0 Pending Channel 0 */ + uint32_t PENDCH1:1; /*!< bit: 1 Pending Channel 1 */ + uint32_t PENDCH2:1; /*!< bit: 2 Pending Channel 2 */ + uint32_t PENDCH3:1; /*!< bit: 3 Pending Channel 3 */ + uint32_t PENDCH4:1; /*!< bit: 4 Pending Channel 4 */ + uint32_t PENDCH5:1; /*!< bit: 5 Pending Channel 5 */ + uint32_t PENDCH6:1; /*!< bit: 6 Pending Channel 6 */ + uint32_t PENDCH7:1; /*!< bit: 7 Pending Channel 7 */ + uint32_t PENDCH8:1; /*!< bit: 8 Pending Channel 8 */ + uint32_t PENDCH9:1; /*!< bit: 9 Pending Channel 9 */ + uint32_t PENDCH10:1; /*!< bit: 10 Pending Channel 10 */ + uint32_t PENDCH11:1; /*!< bit: 11 Pending Channel 11 */ + uint32_t PENDCH12:1; /*!< bit: 12 Pending Channel 12 */ + uint32_t PENDCH13:1; /*!< bit: 13 Pending Channel 13 */ + uint32_t PENDCH14:1; /*!< bit: 14 Pending Channel 14 */ + uint32_t PENDCH15:1; /*!< bit: 15 Pending Channel 15 */ + uint32_t PENDCH16:1; /*!< bit: 16 Pending Channel 16 */ + uint32_t PENDCH17:1; /*!< bit: 17 Pending Channel 17 */ + uint32_t PENDCH18:1; /*!< bit: 18 Pending Channel 18 */ + uint32_t PENDCH19:1; /*!< bit: 19 Pending Channel 19 */ + uint32_t PENDCH20:1; /*!< bit: 20 Pending Channel 20 */ + uint32_t PENDCH21:1; /*!< bit: 21 Pending Channel 21 */ + uint32_t PENDCH22:1; /*!< bit: 22 Pending Channel 22 */ + uint32_t PENDCH23:1; /*!< bit: 23 Pending Channel 23 */ + uint32_t PENDCH24:1; /*!< bit: 24 Pending Channel 24 */ + uint32_t PENDCH25:1; /*!< bit: 25 Pending Channel 25 */ + uint32_t PENDCH26:1; /*!< bit: 26 Pending Channel 26 */ + uint32_t PENDCH27:1; /*!< bit: 27 Pending Channel 27 */ + uint32_t PENDCH28:1; /*!< bit: 28 Pending Channel 28 */ + uint32_t PENDCH29:1; /*!< bit: 29 Pending Channel 29 */ + uint32_t PENDCH30:1; /*!< bit: 30 Pending Channel 30 */ + uint32_t PENDCH31:1; /*!< bit: 31 Pending Channel 31 */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t PENDCH:32; /*!< bit: 0..31 Pending Channel x */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_PENDCH_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_PENDCH_OFFSET 0x2C /**< \brief (DMAC_PENDCH offset) Pending Channels */ +#define DMAC_PENDCH_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_PENDCH reset_value) Pending Channels */ + +#define DMAC_PENDCH_PENDCH0_Pos 0 /**< \brief (DMAC_PENDCH) Pending Channel 0 */ +#define DMAC_PENDCH_PENDCH0 (_U_(1) << DMAC_PENDCH_PENDCH0_Pos) +#define DMAC_PENDCH_PENDCH1_Pos 1 /**< \brief (DMAC_PENDCH) Pending Channel 1 */ +#define DMAC_PENDCH_PENDCH1 (_U_(1) << DMAC_PENDCH_PENDCH1_Pos) +#define DMAC_PENDCH_PENDCH2_Pos 2 /**< \brief (DMAC_PENDCH) Pending Channel 2 */ +#define DMAC_PENDCH_PENDCH2 (_U_(1) << DMAC_PENDCH_PENDCH2_Pos) +#define DMAC_PENDCH_PENDCH3_Pos 3 /**< \brief (DMAC_PENDCH) Pending Channel 3 */ +#define DMAC_PENDCH_PENDCH3 (_U_(1) << DMAC_PENDCH_PENDCH3_Pos) +#define DMAC_PENDCH_PENDCH4_Pos 4 /**< \brief (DMAC_PENDCH) Pending Channel 4 */ +#define DMAC_PENDCH_PENDCH4 (_U_(1) << DMAC_PENDCH_PENDCH4_Pos) +#define DMAC_PENDCH_PENDCH5_Pos 5 /**< \brief (DMAC_PENDCH) Pending Channel 5 */ +#define DMAC_PENDCH_PENDCH5 (_U_(1) << DMAC_PENDCH_PENDCH5_Pos) +#define DMAC_PENDCH_PENDCH6_Pos 6 /**< \brief (DMAC_PENDCH) Pending Channel 6 */ +#define DMAC_PENDCH_PENDCH6 (_U_(1) << DMAC_PENDCH_PENDCH6_Pos) +#define DMAC_PENDCH_PENDCH7_Pos 7 /**< \brief (DMAC_PENDCH) Pending Channel 7 */ +#define DMAC_PENDCH_PENDCH7 (_U_(1) << DMAC_PENDCH_PENDCH7_Pos) +#define DMAC_PENDCH_PENDCH8_Pos 8 /**< \brief (DMAC_PENDCH) Pending Channel 8 */ +#define DMAC_PENDCH_PENDCH8 (_U_(1) << DMAC_PENDCH_PENDCH8_Pos) +#define DMAC_PENDCH_PENDCH9_Pos 9 /**< \brief (DMAC_PENDCH) Pending Channel 9 */ +#define DMAC_PENDCH_PENDCH9 (_U_(1) << DMAC_PENDCH_PENDCH9_Pos) +#define DMAC_PENDCH_PENDCH10_Pos 10 /**< \brief (DMAC_PENDCH) Pending Channel 10 */ +#define DMAC_PENDCH_PENDCH10 (_U_(1) << DMAC_PENDCH_PENDCH10_Pos) +#define DMAC_PENDCH_PENDCH11_Pos 11 /**< \brief (DMAC_PENDCH) Pending Channel 11 */ +#define DMAC_PENDCH_PENDCH11 (_U_(1) << DMAC_PENDCH_PENDCH11_Pos) +#define DMAC_PENDCH_PENDCH12_Pos 12 /**< \brief (DMAC_PENDCH) Pending Channel 12 */ +#define DMAC_PENDCH_PENDCH12 (_U_(1) << DMAC_PENDCH_PENDCH12_Pos) +#define DMAC_PENDCH_PENDCH13_Pos 13 /**< \brief (DMAC_PENDCH) Pending Channel 13 */ +#define DMAC_PENDCH_PENDCH13 (_U_(1) << DMAC_PENDCH_PENDCH13_Pos) +#define DMAC_PENDCH_PENDCH14_Pos 14 /**< \brief (DMAC_PENDCH) Pending Channel 14 */ +#define DMAC_PENDCH_PENDCH14 (_U_(1) << DMAC_PENDCH_PENDCH14_Pos) +#define DMAC_PENDCH_PENDCH15_Pos 15 /**< \brief (DMAC_PENDCH) Pending Channel 15 */ +#define DMAC_PENDCH_PENDCH15 (_U_(1) << DMAC_PENDCH_PENDCH15_Pos) +#define DMAC_PENDCH_PENDCH16_Pos 16 /**< \brief (DMAC_PENDCH) Pending Channel 16 */ +#define DMAC_PENDCH_PENDCH16 (_U_(1) << DMAC_PENDCH_PENDCH16_Pos) +#define DMAC_PENDCH_PENDCH17_Pos 17 /**< \brief (DMAC_PENDCH) Pending Channel 17 */ +#define DMAC_PENDCH_PENDCH17 (_U_(1) << DMAC_PENDCH_PENDCH17_Pos) +#define DMAC_PENDCH_PENDCH18_Pos 18 /**< \brief (DMAC_PENDCH) Pending Channel 18 */ +#define DMAC_PENDCH_PENDCH18 (_U_(1) << DMAC_PENDCH_PENDCH18_Pos) +#define DMAC_PENDCH_PENDCH19_Pos 19 /**< \brief (DMAC_PENDCH) Pending Channel 19 */ +#define DMAC_PENDCH_PENDCH19 (_U_(1) << DMAC_PENDCH_PENDCH19_Pos) +#define DMAC_PENDCH_PENDCH20_Pos 20 /**< \brief (DMAC_PENDCH) Pending Channel 20 */ +#define DMAC_PENDCH_PENDCH20 (_U_(1) << DMAC_PENDCH_PENDCH20_Pos) +#define DMAC_PENDCH_PENDCH21_Pos 21 /**< \brief (DMAC_PENDCH) Pending Channel 21 */ +#define DMAC_PENDCH_PENDCH21 (_U_(1) << DMAC_PENDCH_PENDCH21_Pos) +#define DMAC_PENDCH_PENDCH22_Pos 22 /**< \brief (DMAC_PENDCH) Pending Channel 22 */ +#define DMAC_PENDCH_PENDCH22 (_U_(1) << DMAC_PENDCH_PENDCH22_Pos) +#define DMAC_PENDCH_PENDCH23_Pos 23 /**< \brief (DMAC_PENDCH) Pending Channel 23 */ +#define DMAC_PENDCH_PENDCH23 (_U_(1) << DMAC_PENDCH_PENDCH23_Pos) +#define DMAC_PENDCH_PENDCH24_Pos 24 /**< \brief (DMAC_PENDCH) Pending Channel 24 */ +#define DMAC_PENDCH_PENDCH24 (_U_(1) << DMAC_PENDCH_PENDCH24_Pos) +#define DMAC_PENDCH_PENDCH25_Pos 25 /**< \brief (DMAC_PENDCH) Pending Channel 25 */ +#define DMAC_PENDCH_PENDCH25 (_U_(1) << DMAC_PENDCH_PENDCH25_Pos) +#define DMAC_PENDCH_PENDCH26_Pos 26 /**< \brief (DMAC_PENDCH) Pending Channel 26 */ +#define DMAC_PENDCH_PENDCH26 (_U_(1) << DMAC_PENDCH_PENDCH26_Pos) +#define DMAC_PENDCH_PENDCH27_Pos 27 /**< \brief (DMAC_PENDCH) Pending Channel 27 */ +#define DMAC_PENDCH_PENDCH27 (_U_(1) << DMAC_PENDCH_PENDCH27_Pos) +#define DMAC_PENDCH_PENDCH28_Pos 28 /**< \brief (DMAC_PENDCH) Pending Channel 28 */ +#define DMAC_PENDCH_PENDCH28 (_U_(1) << DMAC_PENDCH_PENDCH28_Pos) +#define DMAC_PENDCH_PENDCH29_Pos 29 /**< \brief (DMAC_PENDCH) Pending Channel 29 */ +#define DMAC_PENDCH_PENDCH29 (_U_(1) << DMAC_PENDCH_PENDCH29_Pos) +#define DMAC_PENDCH_PENDCH30_Pos 30 /**< \brief (DMAC_PENDCH) Pending Channel 30 */ +#define DMAC_PENDCH_PENDCH30 (_U_(1) << DMAC_PENDCH_PENDCH30_Pos) +#define DMAC_PENDCH_PENDCH31_Pos 31 /**< \brief (DMAC_PENDCH) Pending Channel 31 */ +#define DMAC_PENDCH_PENDCH31 (_U_(1) << DMAC_PENDCH_PENDCH31_Pos) +#define DMAC_PENDCH_PENDCH_Pos 0 /**< \brief (DMAC_PENDCH) Pending Channel x */ +#define DMAC_PENDCH_PENDCH_Msk (_U_(0xFFFFFFFF) << DMAC_PENDCH_PENDCH_Pos) +#define DMAC_PENDCH_PENDCH(value) (DMAC_PENDCH_PENDCH_Msk & ((value) << DMAC_PENDCH_PENDCH_Pos)) +#define DMAC_PENDCH_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_PENDCH) MASK Register */ + +/* -------- DMAC_ACTIVE : (DMAC Offset: 0x30) (R/ 32) Active Channel and Levels -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t LVLEX0:1; /*!< bit: 0 Level 0 Channel Trigger Request Executing */ + uint32_t LVLEX1:1; /*!< bit: 1 Level 1 Channel Trigger Request Executing */ + uint32_t LVLEX2:1; /*!< bit: 2 Level 2 Channel Trigger Request Executing */ + uint32_t LVLEX3:1; /*!< bit: 3 Level 3 Channel Trigger Request Executing */ + uint32_t :4; /*!< bit: 4.. 7 Reserved */ + uint32_t ID:5; /*!< bit: 8..12 Active Channel ID */ + uint32_t :2; /*!< bit: 13..14 Reserved */ + uint32_t ABUSY:1; /*!< bit: 15 Active Channel Busy */ + uint32_t BTCNT:16; /*!< bit: 16..31 Active Channel Block Transfer Count */ + } bit; /*!< Structure used for bit access */ + struct { + uint32_t LVLEX:4; /*!< bit: 0.. 3 Level x Channel Trigger Request Executing */ + uint32_t :28; /*!< bit: 4..31 Reserved */ + } vec; /*!< Structure used for vec access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_ACTIVE_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_ACTIVE_OFFSET 0x30 /**< \brief (DMAC_ACTIVE offset) Active Channel and Levels */ +#define DMAC_ACTIVE_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_ACTIVE reset_value) Active Channel and Levels */ + +#define DMAC_ACTIVE_LVLEX0_Pos 0 /**< \brief (DMAC_ACTIVE) Level 0 Channel Trigger Request Executing */ +#define DMAC_ACTIVE_LVLEX0 (_U_(1) << DMAC_ACTIVE_LVLEX0_Pos) +#define DMAC_ACTIVE_LVLEX1_Pos 1 /**< \brief (DMAC_ACTIVE) Level 1 Channel Trigger Request Executing */ +#define DMAC_ACTIVE_LVLEX1 (_U_(1) << DMAC_ACTIVE_LVLEX1_Pos) +#define DMAC_ACTIVE_LVLEX2_Pos 2 /**< \brief (DMAC_ACTIVE) Level 2 Channel Trigger Request Executing */ +#define DMAC_ACTIVE_LVLEX2 (_U_(1) << DMAC_ACTIVE_LVLEX2_Pos) +#define DMAC_ACTIVE_LVLEX3_Pos 3 /**< \brief (DMAC_ACTIVE) Level 3 Channel Trigger Request Executing */ +#define DMAC_ACTIVE_LVLEX3 (_U_(1) << DMAC_ACTIVE_LVLEX3_Pos) +#define DMAC_ACTIVE_LVLEX_Pos 0 /**< \brief (DMAC_ACTIVE) Level x Channel Trigger Request Executing */ +#define DMAC_ACTIVE_LVLEX_Msk (_U_(0xF) << DMAC_ACTIVE_LVLEX_Pos) +#define DMAC_ACTIVE_LVLEX(value) (DMAC_ACTIVE_LVLEX_Msk & ((value) << DMAC_ACTIVE_LVLEX_Pos)) +#define DMAC_ACTIVE_ID_Pos 8 /**< \brief (DMAC_ACTIVE) Active Channel ID */ +#define DMAC_ACTIVE_ID_Msk (_U_(0x1F) << DMAC_ACTIVE_ID_Pos) +#define DMAC_ACTIVE_ID(value) (DMAC_ACTIVE_ID_Msk & ((value) << DMAC_ACTIVE_ID_Pos)) +#define DMAC_ACTIVE_ABUSY_Pos 15 /**< \brief (DMAC_ACTIVE) Active Channel Busy */ +#define DMAC_ACTIVE_ABUSY (_U_(0x1) << DMAC_ACTIVE_ABUSY_Pos) +#define DMAC_ACTIVE_BTCNT_Pos 16 /**< \brief (DMAC_ACTIVE) Active Channel Block Transfer Count */ +#define DMAC_ACTIVE_BTCNT_Msk (_U_(0xFFFF) << DMAC_ACTIVE_BTCNT_Pos) +#define DMAC_ACTIVE_BTCNT(value) (DMAC_ACTIVE_BTCNT_Msk & ((value) << DMAC_ACTIVE_BTCNT_Pos)) +#define DMAC_ACTIVE_MASK _U_(0xFFFF9F0F) /**< \brief (DMAC_ACTIVE) MASK Register */ + +/* -------- DMAC_BASEADDR : (DMAC Offset: 0x34) (R/W 32) Descriptor Memory Section Base Address -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t BASEADDR:32; /*!< bit: 0..31 Descriptor Memory Base Address */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_BASEADDR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_BASEADDR_OFFSET 0x34 /**< \brief (DMAC_BASEADDR offset) Descriptor Memory Section Base Address */ +#define DMAC_BASEADDR_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_BASEADDR reset_value) Descriptor Memory Section Base Address */ + +#define DMAC_BASEADDR_BASEADDR_Pos 0 /**< \brief (DMAC_BASEADDR) Descriptor Memory Base Address */ +#define DMAC_BASEADDR_BASEADDR_Msk (_U_(0xFFFFFFFF) << DMAC_BASEADDR_BASEADDR_Pos) +#define DMAC_BASEADDR_BASEADDR(value) (DMAC_BASEADDR_BASEADDR_Msk & ((value) << DMAC_BASEADDR_BASEADDR_Pos)) +#define DMAC_BASEADDR_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_BASEADDR) MASK Register */ + +/* -------- DMAC_WRBADDR : (DMAC Offset: 0x38) (R/W 32) Write-Back Memory Section Base Address -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t WRBADDR:32; /*!< bit: 0..31 Write-Back Memory Base Address */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_WRBADDR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_WRBADDR_OFFSET 0x38 /**< \brief (DMAC_WRBADDR offset) Write-Back Memory Section Base Address */ +#define DMAC_WRBADDR_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_WRBADDR reset_value) Write-Back Memory Section Base Address */ + +#define DMAC_WRBADDR_WRBADDR_Pos 0 /**< \brief (DMAC_WRBADDR) Write-Back Memory Base Address */ +#define DMAC_WRBADDR_WRBADDR_Msk (_U_(0xFFFFFFFF) << DMAC_WRBADDR_WRBADDR_Pos) +#define DMAC_WRBADDR_WRBADDR(value) (DMAC_WRBADDR_WRBADDR_Msk & ((value) << DMAC_WRBADDR_WRBADDR_Pos)) +#define DMAC_WRBADDR_MASK _U_(0xFFFFFFFF) /**< \brief (DMAC_WRBADDR) MASK Register */ + +/* -------- DMAC_CHCTRLA : (DMAC Offset: 0x40) (R/W 32) CHANNEL Channel n Control A -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint32_t SWRST:1; /*!< bit: 0 Channel Software Reset */ + uint32_t ENABLE:1; /*!< bit: 1 Channel Enable */ + uint32_t :4; /*!< bit: 2.. 5 Reserved */ + uint32_t RUNSTDBY:1; /*!< bit: 6 Channel Run in Standby */ + uint32_t :1; /*!< bit: 7 Reserved */ + uint32_t TRIGSRC:7; /*!< bit: 8..14 Trigger Source */ + uint32_t :5; /*!< bit: 15..19 Reserved */ + uint32_t TRIGACT:2; /*!< bit: 20..21 Trigger Action */ + uint32_t :2; /*!< bit: 22..23 Reserved */ + uint32_t BURSTLEN:4; /*!< bit: 24..27 Burst Length */ + uint32_t THRESHOLD:2; /*!< bit: 28..29 FIFO Threshold */ + uint32_t :2; /*!< bit: 30..31 Reserved */ + } bit; /*!< Structure used for bit access */ + uint32_t reg; /*!< Type used for register access */ +} DMAC_CHCTRLA_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHCTRLA_OFFSET 0x40 /**< \brief (DMAC_CHCTRLA offset) Channel n Control A */ +#define DMAC_CHCTRLA_RESETVALUE _U_(0x00000000) /**< \brief (DMAC_CHCTRLA reset_value) Channel n Control A */ + +#define DMAC_CHCTRLA_SWRST_Pos 0 /**< \brief (DMAC_CHCTRLA) Channel Software Reset */ +#define DMAC_CHCTRLA_SWRST (_U_(0x1) << DMAC_CHCTRLA_SWRST_Pos) +#define DMAC_CHCTRLA_ENABLE_Pos 1 /**< \brief (DMAC_CHCTRLA) Channel Enable */ +#define DMAC_CHCTRLA_ENABLE (_U_(0x1) << DMAC_CHCTRLA_ENABLE_Pos) +#define DMAC_CHCTRLA_RUNSTDBY_Pos 6 /**< \brief (DMAC_CHCTRLA) Channel Run in Standby */ +#define DMAC_CHCTRLA_RUNSTDBY (_U_(0x1) << DMAC_CHCTRLA_RUNSTDBY_Pos) +#define DMAC_CHCTRLA_TRIGSRC_Pos 8 /**< \brief (DMAC_CHCTRLA) Trigger Source */ +#define DMAC_CHCTRLA_TRIGSRC_Msk (_U_(0x7F) << DMAC_CHCTRLA_TRIGSRC_Pos) +#define DMAC_CHCTRLA_TRIGSRC(value) (DMAC_CHCTRLA_TRIGSRC_Msk & ((value) << DMAC_CHCTRLA_TRIGSRC_Pos)) +#define DMAC_CHCTRLA_TRIGSRC_DISABLE_Val _U_(0x0) /**< \brief (DMAC_CHCTRLA) Only software/event triggers */ +#define DMAC_CHCTRLA_TRIGSRC_DISABLE (DMAC_CHCTRLA_TRIGSRC_DISABLE_Val << DMAC_CHCTRLA_TRIGSRC_Pos) +#define DMAC_CHCTRLA_TRIGACT_Pos 20 /**< \brief (DMAC_CHCTRLA) Trigger Action */ +#define DMAC_CHCTRLA_TRIGACT_Msk (_U_(0x3) << DMAC_CHCTRLA_TRIGACT_Pos) +#define DMAC_CHCTRLA_TRIGACT(value) (DMAC_CHCTRLA_TRIGACT_Msk & ((value) << DMAC_CHCTRLA_TRIGACT_Pos)) +#define DMAC_CHCTRLA_TRIGACT_BLOCK_Val _U_(0x0) /**< \brief (DMAC_CHCTRLA) One trigger required for each block transfer */ +#define DMAC_CHCTRLA_TRIGACT_BURST_Val _U_(0x2) /**< \brief (DMAC_CHCTRLA) One trigger required for each burst transfer */ +#define DMAC_CHCTRLA_TRIGACT_TRANSACTION_Val _U_(0x3) /**< \brief (DMAC_CHCTRLA) One trigger required for each transaction */ +#define DMAC_CHCTRLA_TRIGACT_BLOCK (DMAC_CHCTRLA_TRIGACT_BLOCK_Val << DMAC_CHCTRLA_TRIGACT_Pos) +#define DMAC_CHCTRLA_TRIGACT_BURST (DMAC_CHCTRLA_TRIGACT_BURST_Val << DMAC_CHCTRLA_TRIGACT_Pos) +#define DMAC_CHCTRLA_TRIGACT_TRANSACTION (DMAC_CHCTRLA_TRIGACT_TRANSACTION_Val << DMAC_CHCTRLA_TRIGACT_Pos) +#define DMAC_CHCTRLA_BURSTLEN_Pos 24 /**< \brief (DMAC_CHCTRLA) Burst Length */ +#define DMAC_CHCTRLA_BURSTLEN_Msk (_U_(0xF) << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN(value) (DMAC_CHCTRLA_BURSTLEN_Msk & ((value) << DMAC_CHCTRLA_BURSTLEN_Pos)) +#define DMAC_CHCTRLA_BURSTLEN_SINGLE_Val _U_(0x0) /**< \brief (DMAC_CHCTRLA) Single-beat burst length */ +#define DMAC_CHCTRLA_BURSTLEN_2BEAT_Val _U_(0x1) /**< \brief (DMAC_CHCTRLA) 2-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_3BEAT_Val _U_(0x2) /**< \brief (DMAC_CHCTRLA) 3-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_4BEAT_Val _U_(0x3) /**< \brief (DMAC_CHCTRLA) 4-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_5BEAT_Val _U_(0x4) /**< \brief (DMAC_CHCTRLA) 5-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_6BEAT_Val _U_(0x5) /**< \brief (DMAC_CHCTRLA) 6-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_7BEAT_Val _U_(0x6) /**< \brief (DMAC_CHCTRLA) 7-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_8BEAT_Val _U_(0x7) /**< \brief (DMAC_CHCTRLA) 8-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_9BEAT_Val _U_(0x8) /**< \brief (DMAC_CHCTRLA) 9-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_10BEAT_Val _U_(0x9) /**< \brief (DMAC_CHCTRLA) 10-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_11BEAT_Val _U_(0xA) /**< \brief (DMAC_CHCTRLA) 11-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_12BEAT_Val _U_(0xB) /**< \brief (DMAC_CHCTRLA) 12-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_13BEAT_Val _U_(0xC) /**< \brief (DMAC_CHCTRLA) 13-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_14BEAT_Val _U_(0xD) /**< \brief (DMAC_CHCTRLA) 14-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_15BEAT_Val _U_(0xE) /**< \brief (DMAC_CHCTRLA) 15-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_16BEAT_Val _U_(0xF) /**< \brief (DMAC_CHCTRLA) 16-beats burst length */ +#define DMAC_CHCTRLA_BURSTLEN_SINGLE (DMAC_CHCTRLA_BURSTLEN_SINGLE_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_2BEAT (DMAC_CHCTRLA_BURSTLEN_2BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_3BEAT (DMAC_CHCTRLA_BURSTLEN_3BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_4BEAT (DMAC_CHCTRLA_BURSTLEN_4BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_5BEAT (DMAC_CHCTRLA_BURSTLEN_5BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_6BEAT (DMAC_CHCTRLA_BURSTLEN_6BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_7BEAT (DMAC_CHCTRLA_BURSTLEN_7BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_8BEAT (DMAC_CHCTRLA_BURSTLEN_8BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_9BEAT (DMAC_CHCTRLA_BURSTLEN_9BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_10BEAT (DMAC_CHCTRLA_BURSTLEN_10BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_11BEAT (DMAC_CHCTRLA_BURSTLEN_11BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_12BEAT (DMAC_CHCTRLA_BURSTLEN_12BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_13BEAT (DMAC_CHCTRLA_BURSTLEN_13BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_14BEAT (DMAC_CHCTRLA_BURSTLEN_14BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_15BEAT (DMAC_CHCTRLA_BURSTLEN_15BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_BURSTLEN_16BEAT (DMAC_CHCTRLA_BURSTLEN_16BEAT_Val << DMAC_CHCTRLA_BURSTLEN_Pos) +#define DMAC_CHCTRLA_THRESHOLD_Pos 28 /**< \brief (DMAC_CHCTRLA) FIFO Threshold */ +#define DMAC_CHCTRLA_THRESHOLD_Msk (_U_(0x3) << DMAC_CHCTRLA_THRESHOLD_Pos) +#define DMAC_CHCTRLA_THRESHOLD(value) (DMAC_CHCTRLA_THRESHOLD_Msk & ((value) << DMAC_CHCTRLA_THRESHOLD_Pos)) +#define DMAC_CHCTRLA_THRESHOLD_1BEAT_Val _U_(0x0) /**< \brief (DMAC_CHCTRLA) Destination write starts after each beat source address read */ +#define DMAC_CHCTRLA_THRESHOLD_2BEATS_Val _U_(0x1) /**< \brief (DMAC_CHCTRLA) Destination write starts after 2-beats source address read */ +#define DMAC_CHCTRLA_THRESHOLD_4BEATS_Val _U_(0x2) /**< \brief (DMAC_CHCTRLA) Destination write starts after 4-beats source address read */ +#define DMAC_CHCTRLA_THRESHOLD_8BEATS_Val _U_(0x3) /**< \brief (DMAC_CHCTRLA) Destination write starts after 8-beats source address read */ +#define DMAC_CHCTRLA_THRESHOLD_1BEAT (DMAC_CHCTRLA_THRESHOLD_1BEAT_Val << DMAC_CHCTRLA_THRESHOLD_Pos) +#define DMAC_CHCTRLA_THRESHOLD_2BEATS (DMAC_CHCTRLA_THRESHOLD_2BEATS_Val << DMAC_CHCTRLA_THRESHOLD_Pos) +#define DMAC_CHCTRLA_THRESHOLD_4BEATS (DMAC_CHCTRLA_THRESHOLD_4BEATS_Val << DMAC_CHCTRLA_THRESHOLD_Pos) +#define DMAC_CHCTRLA_THRESHOLD_8BEATS (DMAC_CHCTRLA_THRESHOLD_8BEATS_Val << DMAC_CHCTRLA_THRESHOLD_Pos) +#define DMAC_CHCTRLA_MASK _U_(0x3F307F43) /**< \brief (DMAC_CHCTRLA) MASK Register */ + +/* -------- DMAC_CHCTRLB : (DMAC Offset: 0x44) (R/W 8) CHANNEL Channel n Control B -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t CMD:2; /*!< bit: 0.. 1 Software Command */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHCTRLB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHCTRLB_OFFSET 0x44 /**< \brief (DMAC_CHCTRLB offset) Channel n Control B */ +#define DMAC_CHCTRLB_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHCTRLB reset_value) Channel n Control B */ + +#define DMAC_CHCTRLB_CMD_Pos 0 /**< \brief (DMAC_CHCTRLB) Software Command */ +#define DMAC_CHCTRLB_CMD_Msk (_U_(0x3) << DMAC_CHCTRLB_CMD_Pos) +#define DMAC_CHCTRLB_CMD(value) (DMAC_CHCTRLB_CMD_Msk & ((value) << DMAC_CHCTRLB_CMD_Pos)) +#define DMAC_CHCTRLB_CMD_NOACT_Val _U_(0x0) /**< \brief (DMAC_CHCTRLB) No action */ +#define DMAC_CHCTRLB_CMD_SUSPEND_Val _U_(0x1) /**< \brief (DMAC_CHCTRLB) Channel suspend operation */ +#define DMAC_CHCTRLB_CMD_RESUME_Val _U_(0x2) /**< \brief (DMAC_CHCTRLB) Channel resume operation */ +#define DMAC_CHCTRLB_CMD_NOACT (DMAC_CHCTRLB_CMD_NOACT_Val << DMAC_CHCTRLB_CMD_Pos) +#define DMAC_CHCTRLB_CMD_SUSPEND (DMAC_CHCTRLB_CMD_SUSPEND_Val << DMAC_CHCTRLB_CMD_Pos) +#define DMAC_CHCTRLB_CMD_RESUME (DMAC_CHCTRLB_CMD_RESUME_Val << DMAC_CHCTRLB_CMD_Pos) +#define DMAC_CHCTRLB_MASK _U_(0x03) /**< \brief (DMAC_CHCTRLB) MASK Register */ + +/* -------- DMAC_CHPRILVL : (DMAC Offset: 0x45) (R/W 8) CHANNEL Channel n Priority Level -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t PRILVL:2; /*!< bit: 0.. 1 Channel Priority Level */ + uint8_t :6; /*!< bit: 2.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHPRILVL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHPRILVL_OFFSET 0x45 /**< \brief (DMAC_CHPRILVL offset) Channel n Priority Level */ +#define DMAC_CHPRILVL_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHPRILVL reset_value) Channel n Priority Level */ + +#define DMAC_CHPRILVL_PRILVL_Pos 0 /**< \brief (DMAC_CHPRILVL) Channel Priority Level */ +#define DMAC_CHPRILVL_PRILVL_Msk (_U_(0x3) << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL(value) (DMAC_CHPRILVL_PRILVL_Msk & ((value) << DMAC_CHPRILVL_PRILVL_Pos)) +#define DMAC_CHPRILVL_PRILVL_LVL0_Val _U_(0x0) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 0 (Lowest Level) */ +#define DMAC_CHPRILVL_PRILVL_LVL1_Val _U_(0x1) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 1 */ +#define DMAC_CHPRILVL_PRILVL_LVL2_Val _U_(0x2) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 2 */ +#define DMAC_CHPRILVL_PRILVL_LVL3_Val _U_(0x3) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 3 */ +#define DMAC_CHPRILVL_PRILVL_LVL4_Val _U_(0x4) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 4 */ +#define DMAC_CHPRILVL_PRILVL_LVL5_Val _U_(0x5) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 5 */ +#define DMAC_CHPRILVL_PRILVL_LVL6_Val _U_(0x6) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 6 */ +#define DMAC_CHPRILVL_PRILVL_LVL7_Val _U_(0x7) /**< \brief (DMAC_CHPRILVL) Channel Priority Level 7 (Highest Level) */ +#define DMAC_CHPRILVL_PRILVL_LVL0 (DMAC_CHPRILVL_PRILVL_LVL0_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL1 (DMAC_CHPRILVL_PRILVL_LVL1_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL2 (DMAC_CHPRILVL_PRILVL_LVL2_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL3 (DMAC_CHPRILVL_PRILVL_LVL3_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL4 (DMAC_CHPRILVL_PRILVL_LVL4_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL5 (DMAC_CHPRILVL_PRILVL_LVL5_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL6 (DMAC_CHPRILVL_PRILVL_LVL6_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_PRILVL_LVL7 (DMAC_CHPRILVL_PRILVL_LVL7_Val << DMAC_CHPRILVL_PRILVL_Pos) +#define DMAC_CHPRILVL_MASK _U_(0x03) /**< \brief (DMAC_CHPRILVL) MASK Register */ + +/* -------- DMAC_CHEVCTRL : (DMAC Offset: 0x46) (R/W 8) CHANNEL Channel n Event Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t EVACT:3; /*!< bit: 0.. 2 Channel Event Input Action */ + uint8_t :1; /*!< bit: 3 Reserved */ + uint8_t EVOMODE:2; /*!< bit: 4.. 5 Channel Event Output Mode */ + uint8_t EVIE:1; /*!< bit: 6 Channel Event Input Enable */ + uint8_t EVOE:1; /*!< bit: 7 Channel Event Output Enable */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHEVCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHEVCTRL_OFFSET 0x46 /**< \brief (DMAC_CHEVCTRL offset) Channel n Event Control */ +#define DMAC_CHEVCTRL_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHEVCTRL reset_value) Channel n Event Control */ + +#define DMAC_CHEVCTRL_EVACT_Pos 0 /**< \brief (DMAC_CHEVCTRL) Channel Event Input Action */ +#define DMAC_CHEVCTRL_EVACT_Msk (_U_(0x7) << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT(value) (DMAC_CHEVCTRL_EVACT_Msk & ((value) << DMAC_CHEVCTRL_EVACT_Pos)) +#define DMAC_CHEVCTRL_EVACT_NOACT_Val _U_(0x0) /**< \brief (DMAC_CHEVCTRL) No action */ +#define DMAC_CHEVCTRL_EVACT_TRIG_Val _U_(0x1) /**< \brief (DMAC_CHEVCTRL) Transfer and periodic transfer trigger */ +#define DMAC_CHEVCTRL_EVACT_CTRIG_Val _U_(0x2) /**< \brief (DMAC_CHEVCTRL) Conditional transfer trigger */ +#define DMAC_CHEVCTRL_EVACT_CBLOCK_Val _U_(0x3) /**< \brief (DMAC_CHEVCTRL) Conditional block transfer */ +#define DMAC_CHEVCTRL_EVACT_SUSPEND_Val _U_(0x4) /**< \brief (DMAC_CHEVCTRL) Channel suspend operation */ +#define DMAC_CHEVCTRL_EVACT_RESUME_Val _U_(0x5) /**< \brief (DMAC_CHEVCTRL) Channel resume operation */ +#define DMAC_CHEVCTRL_EVACT_SSKIP_Val _U_(0x6) /**< \brief (DMAC_CHEVCTRL) Skip next block suspend action */ +#define DMAC_CHEVCTRL_EVACT_INCPRI_Val _U_(0x7) /**< \brief (DMAC_CHEVCTRL) Increase priority */ +#define DMAC_CHEVCTRL_EVACT_NOACT (DMAC_CHEVCTRL_EVACT_NOACT_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_TRIG (DMAC_CHEVCTRL_EVACT_TRIG_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_CTRIG (DMAC_CHEVCTRL_EVACT_CTRIG_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_CBLOCK (DMAC_CHEVCTRL_EVACT_CBLOCK_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_SUSPEND (DMAC_CHEVCTRL_EVACT_SUSPEND_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_RESUME (DMAC_CHEVCTRL_EVACT_RESUME_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_SSKIP (DMAC_CHEVCTRL_EVACT_SSKIP_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVACT_INCPRI (DMAC_CHEVCTRL_EVACT_INCPRI_Val << DMAC_CHEVCTRL_EVACT_Pos) +#define DMAC_CHEVCTRL_EVOMODE_Pos 4 /**< \brief (DMAC_CHEVCTRL) Channel Event Output Mode */ +#define DMAC_CHEVCTRL_EVOMODE_Msk (_U_(0x3) << DMAC_CHEVCTRL_EVOMODE_Pos) +#define DMAC_CHEVCTRL_EVOMODE(value) (DMAC_CHEVCTRL_EVOMODE_Msk & ((value) << DMAC_CHEVCTRL_EVOMODE_Pos)) +#define DMAC_CHEVCTRL_EVOMODE_DEFAULT_Val _U_(0x0) /**< \brief (DMAC_CHEVCTRL) Block event output selection. Refer to BTCTRL.EVOSEL for available selections. */ +#define DMAC_CHEVCTRL_EVOMODE_TRIGACT_Val _U_(0x1) /**< \brief (DMAC_CHEVCTRL) Ongoing trigger action */ +#define DMAC_CHEVCTRL_EVOMODE_DEFAULT (DMAC_CHEVCTRL_EVOMODE_DEFAULT_Val << DMAC_CHEVCTRL_EVOMODE_Pos) +#define DMAC_CHEVCTRL_EVOMODE_TRIGACT (DMAC_CHEVCTRL_EVOMODE_TRIGACT_Val << DMAC_CHEVCTRL_EVOMODE_Pos) +#define DMAC_CHEVCTRL_EVIE_Pos 6 /**< \brief (DMAC_CHEVCTRL) Channel Event Input Enable */ +#define DMAC_CHEVCTRL_EVIE (_U_(0x1) << DMAC_CHEVCTRL_EVIE_Pos) +#define DMAC_CHEVCTRL_EVOE_Pos 7 /**< \brief (DMAC_CHEVCTRL) Channel Event Output Enable */ +#define DMAC_CHEVCTRL_EVOE (_U_(0x1) << DMAC_CHEVCTRL_EVOE_Pos) +#define DMAC_CHEVCTRL_MASK _U_(0xF7) /**< \brief (DMAC_CHEVCTRL) MASK Register */ + +/* -------- DMAC_CHINTENCLR : (DMAC Offset: 0x4C) (R/W 8) CHANNEL Channel n Interrupt Enable Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t TERR:1; /*!< bit: 0 Channel Transfer Error Interrupt Enable */ + uint8_t TCMPL:1; /*!< bit: 1 Channel Transfer Complete Interrupt Enable */ + uint8_t SUSP:1; /*!< bit: 2 Channel Suspend Interrupt Enable */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHINTENCLR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHINTENCLR_OFFSET 0x4C /**< \brief (DMAC_CHINTENCLR offset) Channel n Interrupt Enable Clear */ +#define DMAC_CHINTENCLR_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHINTENCLR reset_value) Channel n Interrupt Enable Clear */ + +#define DMAC_CHINTENCLR_TERR_Pos 0 /**< \brief (DMAC_CHINTENCLR) Channel Transfer Error Interrupt Enable */ +#define DMAC_CHINTENCLR_TERR (_U_(0x1) << DMAC_CHINTENCLR_TERR_Pos) +#define DMAC_CHINTENCLR_TCMPL_Pos 1 /**< \brief (DMAC_CHINTENCLR) Channel Transfer Complete Interrupt Enable */ +#define DMAC_CHINTENCLR_TCMPL (_U_(0x1) << DMAC_CHINTENCLR_TCMPL_Pos) +#define DMAC_CHINTENCLR_SUSP_Pos 2 /**< \brief (DMAC_CHINTENCLR) Channel Suspend Interrupt Enable */ +#define DMAC_CHINTENCLR_SUSP (_U_(0x1) << DMAC_CHINTENCLR_SUSP_Pos) +#define DMAC_CHINTENCLR_MASK _U_(0x07) /**< \brief (DMAC_CHINTENCLR) MASK Register */ + +/* -------- DMAC_CHINTENSET : (DMAC Offset: 0x4D) (R/W 8) CHANNEL Channel n Interrupt Enable Set -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t TERR:1; /*!< bit: 0 Channel Transfer Error Interrupt Enable */ + uint8_t TCMPL:1; /*!< bit: 1 Channel Transfer Complete Interrupt Enable */ + uint8_t SUSP:1; /*!< bit: 2 Channel Suspend Interrupt Enable */ + uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHINTENSET_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHINTENSET_OFFSET 0x4D /**< \brief (DMAC_CHINTENSET offset) Channel n Interrupt Enable Set */ +#define DMAC_CHINTENSET_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHINTENSET reset_value) Channel n Interrupt Enable Set */ + +#define DMAC_CHINTENSET_TERR_Pos 0 /**< \brief (DMAC_CHINTENSET) Channel Transfer Error Interrupt Enable */ +#define DMAC_CHINTENSET_TERR (_U_(0x1) << DMAC_CHINTENSET_TERR_Pos) +#define DMAC_CHINTENSET_TCMPL_Pos 1 /**< \brief (DMAC_CHINTENSET) Channel Transfer Complete Interrupt Enable */ +#define DMAC_CHINTENSET_TCMPL (_U_(0x1) << DMAC_CHINTENSET_TCMPL_Pos) +#define DMAC_CHINTENSET_SUSP_Pos 2 /**< \brief (DMAC_CHINTENSET) Channel Suspend Interrupt Enable */ +#define DMAC_CHINTENSET_SUSP (_U_(0x1) << DMAC_CHINTENSET_SUSP_Pos) +#define DMAC_CHINTENSET_MASK _U_(0x07) /**< \brief (DMAC_CHINTENSET) MASK Register */ + +/* -------- DMAC_CHINTFLAG : (DMAC Offset: 0x4E) (R/W 8) CHANNEL Channel n Interrupt Flag Status and Clear -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { // __I to avoid read-modify-write on write-to-clear register + struct { + __I uint8_t TERR:1; /*!< bit: 0 Channel Transfer Error */ + __I uint8_t TCMPL:1; /*!< bit: 1 Channel Transfer Complete */ + __I uint8_t SUSP:1; /*!< bit: 2 Channel Suspend */ + __I uint8_t :5; /*!< bit: 3.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHINTFLAG_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHINTFLAG_OFFSET 0x4E /**< \brief (DMAC_CHINTFLAG offset) Channel n Interrupt Flag Status and Clear */ +#define DMAC_CHINTFLAG_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHINTFLAG reset_value) Channel n Interrupt Flag Status and Clear */ + +#define DMAC_CHINTFLAG_TERR_Pos 0 /**< \brief (DMAC_CHINTFLAG) Channel Transfer Error */ +#define DMAC_CHINTFLAG_TERR (_U_(0x1) << DMAC_CHINTFLAG_TERR_Pos) +#define DMAC_CHINTFLAG_TCMPL_Pos 1 /**< \brief (DMAC_CHINTFLAG) Channel Transfer Complete */ +#define DMAC_CHINTFLAG_TCMPL (_U_(0x1) << DMAC_CHINTFLAG_TCMPL_Pos) +#define DMAC_CHINTFLAG_SUSP_Pos 2 /**< \brief (DMAC_CHINTFLAG) Channel Suspend */ +#define DMAC_CHINTFLAG_SUSP (_U_(0x1) << DMAC_CHINTFLAG_SUSP_Pos) +#define DMAC_CHINTFLAG_MASK _U_(0x07) /**< \brief (DMAC_CHINTFLAG) MASK Register */ + +/* -------- DMAC_CHSTATUS : (DMAC Offset: 0x4F) (R/W 8) CHANNEL Channel n Status -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t PEND:1; /*!< bit: 0 Channel Pending */ + uint8_t BUSY:1; /*!< bit: 1 Channel Busy */ + uint8_t FERR:1; /*!< bit: 2 Channel Fetch Error */ + uint8_t CRCERR:1; /*!< bit: 3 Channel CRC Error */ + uint8_t :4; /*!< bit: 4.. 7 Reserved */ + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} DMAC_CHSTATUS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_CHSTATUS_OFFSET 0x4F /**< \brief (DMAC_CHSTATUS offset) Channel n Status */ +#define DMAC_CHSTATUS_RESETVALUE _U_(0x00) /**< \brief (DMAC_CHSTATUS reset_value) Channel n Status */ + +#define DMAC_CHSTATUS_PEND_Pos 0 /**< \brief (DMAC_CHSTATUS) Channel Pending */ +#define DMAC_CHSTATUS_PEND (_U_(0x1) << DMAC_CHSTATUS_PEND_Pos) +#define DMAC_CHSTATUS_BUSY_Pos 1 /**< \brief (DMAC_CHSTATUS) Channel Busy */ +#define DMAC_CHSTATUS_BUSY (_U_(0x1) << DMAC_CHSTATUS_BUSY_Pos) +#define DMAC_CHSTATUS_FERR_Pos 2 /**< \brief (DMAC_CHSTATUS) Channel Fetch Error */ +#define DMAC_CHSTATUS_FERR (_U_(0x1) << DMAC_CHSTATUS_FERR_Pos) +#define DMAC_CHSTATUS_CRCERR_Pos 3 /**< \brief (DMAC_CHSTATUS) Channel CRC Error */ +#define DMAC_CHSTATUS_CRCERR (_U_(0x1) << DMAC_CHSTATUS_CRCERR_Pos) +#define DMAC_CHSTATUS_MASK _U_(0x0F) /**< \brief (DMAC_CHSTATUS) MASK Register */ + +/* -------- DMAC_BTCTRL : (DMAC Offset: 0x00) (R/W 16) Block Transfer Control -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t VALID:1; /*!< bit: 0 Descriptor Valid */ + uint16_t EVOSEL:2; /*!< bit: 1.. 2 Block Event Output Selection */ + uint16_t BLOCKACT:2; /*!< bit: 3.. 4 Block Action */ + uint16_t :3; /*!< bit: 5.. 7 Reserved */ + uint16_t BEATSIZE:2; /*!< bit: 8.. 9 Beat Size */ + uint16_t SRCINC:1; /*!< bit: 10 Source Address Increment Enable */ + uint16_t DSTINC:1; /*!< bit: 11 Destination Address Increment Enable */ + uint16_t STEPSEL:1; /*!< bit: 12 Step Selection */ + uint16_t STEPSIZE:3; /*!< bit: 13..15 Address Increment Step Size */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} DMAC_BTCTRL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +#define DMAC_BTCTRL_OFFSET 0x00 /**< \brief (DMAC_BTCTRL offset) Block Transfer Control */ +#define DMAC_BTCTRL_RESETVALUE _U_(0x0000) /**< \brief (DMAC_BTCTRL reset_value) Block Transfer Control */ + +#define DMAC_BTCTRL_VALID_Pos 0 /**< \brief (DMAC_BTCTRL) Descriptor Valid */ +#define DMAC_BTCTRL_VALID (_U_(0x1) << DMAC_BTCTRL_VALID_Pos) +#define DMAC_BTCTRL_EVOSEL_Pos 1 /**< \brief (DMAC_BTCTRL) Block Event Output Selection */ +#define DMAC_BTCTRL_EVOSEL_Msk (_U_(0x3) << DMAC_BTCTRL_EVOSEL_Pos) +#define DMAC_BTCTRL_EVOSEL(value) (DMAC_BTCTRL_EVOSEL_Msk & ((value) << DMAC_BTCTRL_EVOSEL_Pos)) +#define DMAC_BTCTRL_EVOSEL_DISABLE_Val _U_(0x0) /**< \brief (DMAC_BTCTRL) Event generation disabled */ +#define DMAC_BTCTRL_EVOSEL_BLOCK_Val _U_(0x1) /**< \brief (DMAC_BTCTRL) Block event strobe */ +#define DMAC_BTCTRL_EVOSEL_BURST_Val _U_(0x3) /**< \brief (DMAC_BTCTRL) Burst event strobe */ +#define DMAC_BTCTRL_EVOSEL_DISABLE (DMAC_BTCTRL_EVOSEL_DISABLE_Val << DMAC_BTCTRL_EVOSEL_Pos) +#define DMAC_BTCTRL_EVOSEL_BLOCK (DMAC_BTCTRL_EVOSEL_BLOCK_Val << DMAC_BTCTRL_EVOSEL_Pos) +#define DMAC_BTCTRL_EVOSEL_BURST (DMAC_BTCTRL_EVOSEL_BURST_Val << DMAC_BTCTRL_EVOSEL_Pos) +#define DMAC_BTCTRL_BLOCKACT_Pos 3 /**< \brief (DMAC_BTCTRL) Block Action */ +#define DMAC_BTCTRL_BLOCKACT_Msk (_U_(0x3) << DMAC_BTCTRL_BLOCKACT_Pos) +#define DMAC_BTCTRL_BLOCKACT(value) (DMAC_BTCTRL_BLOCKACT_Msk & ((value) << DMAC_BTCTRL_BLOCKACT_Pos)) +#define DMAC_BTCTRL_BLOCKACT_NOACT_Val _U_(0x0) /**< \brief (DMAC_BTCTRL) Channel will be disabled if it is the last block transfer in the transaction */ +#define DMAC_BTCTRL_BLOCKACT_INT_Val _U_(0x1) /**< \brief (DMAC_BTCTRL) Channel will be disabled if it is the last block transfer in the transaction and block interrupt */ +#define DMAC_BTCTRL_BLOCKACT_SUSPEND_Val _U_(0x2) /**< \brief (DMAC_BTCTRL) Channel suspend operation is completed */ +#define DMAC_BTCTRL_BLOCKACT_BOTH_Val _U_(0x3) /**< \brief (DMAC_BTCTRL) Both channel suspend operation and block interrupt */ +#define DMAC_BTCTRL_BLOCKACT_NOACT (DMAC_BTCTRL_BLOCKACT_NOACT_Val << DMAC_BTCTRL_BLOCKACT_Pos) +#define DMAC_BTCTRL_BLOCKACT_INT (DMAC_BTCTRL_BLOCKACT_INT_Val << DMAC_BTCTRL_BLOCKACT_Pos) +#define DMAC_BTCTRL_BLOCKACT_SUSPEND (DMAC_BTCTRL_BLOCKACT_SUSPEND_Val << DMAC_BTCTRL_BLOCKACT_Pos) +#define DMAC_BTCTRL_BLOCKACT_BOTH (DMAC_BTCTRL_BLOCKACT_BOTH_Val << DMAC_BTCTRL_BLOCKACT_Pos) +#define DMAC_BTCTRL_BEATSIZE_Pos 8 /**< \brief (DMAC_BTCTRL) Beat Size */ +#define DMAC_BTCTRL_BEATSIZE_Msk (_U_(0x3) << DMAC_BTCTRL_BEATSIZE_Pos) +#define DMAC_BTCTRL_BEATSIZE(value) (DMAC_BTCTRL_BEATSIZE_Msk & ((value) << DMAC_BTCTRL_BEATSIZE_Pos)) +#define DMAC_BTCTRL_BEATSIZE_BYTE_Val _U_(0x0) /**< \brief (DMAC_BTCTRL) 8-bit bus transfer */ +#define DMAC_BTCTRL_BEATSIZE_HWORD_Val _U_(0x1) /**< \brief (DMAC_BTCTRL) 16-bit bus transfer */ +#define DMAC_BTCTRL_BEATSIZE_WORD_Val _U_(0x2) /**< \brief (DMAC_BTCTRL) 32-bit bus transfer */ +#define DMAC_BTCTRL_BEATSIZE_BYTE (DMAC_BTCTRL_BEATSIZE_BYTE_Val << DMAC_BTCTRL_BEATSIZE_Pos) +#define DMAC_BTCTRL_BEATSIZE_HWORD (DMAC_BTCTRL_BEATSIZE_HWORD_Val << DMAC_BTCTRL_BEATSIZE_Pos) +#define DMAC_BTCTRL_BEATSIZE_WORD (DMAC_BTCTRL_BEATSIZE_WORD_Val << DMAC_BTCTRL_BEATSIZE_Pos) +#define DMAC_BTCTRL_SRCINC_Pos 10 /**< \brief (DMAC_BTCTRL) Source Address Increment Enable */ +#define DMAC_BTCTRL_SRCINC (_U_(0x1) << DMAC_BTCTRL_SRCINC_Pos) +#define DMAC_BTCTRL_DSTINC_Pos 11 /**< \brief (DMAC_BTCTRL) Destination Address Increment Enable */ +#define DMAC_BTCTRL_DSTINC (_U_(0x1) << DMAC_BTCTRL_DSTINC_Pos) +#define DMAC_BTCTRL_STEPSEL_Pos 12 /**< \brief (DMAC_BTCTRL) Step Selection */ +#define DMAC_BTCTRL_STEPSEL (_U_(0x1) << DMAC_BTCTRL_STEPSEL_Pos) +#define DMAC_BTCTRL_STEPSEL_DST_Val _U_(0x0) /**< \brief (DMAC_BTCTRL) Step size settings apply to the destination address */ +#define DMAC_BTCTRL_STEPSEL_SRC_Val _U_(0x1) /**< \brief (DMAC_BTCTRL) Step size settings apply to the source address */ +#define DMAC_BTCTRL_STEPSEL_DST (DMAC_BTCTRL_STEPSEL_DST_Val << DMAC_BTCTRL_STEPSEL_Pos) +#define DMAC_BTCTRL_STEPSEL_SRC (DMAC_BTCTRL_STEPSEL_SRC_Val << DMAC_BTCTRL_STEPSEL_Pos) +#define DMAC_BTCTRL_STEPSIZE_Pos 13 /**< \brief (DMAC_BTCTRL) Address Increment Step Size */ +#define DMAC_BTCTRL_STEPSIZE_Msk (_U_(0x7) << DMAC_BTCTRL_STEPSIZE_Pos) +#define DMAC_BTCTRL_STEPSIZE(value) (DMAC_BTCTRL_STEPSIZE_Msk & ((value) << DMAC_BTCTRL_STEPSIZE_Pos)) +#define DMAC_BTCTRL_STEPSIZE_X1_Val _U_(0x0) /**< \brief (DMAC_BTCTRL) Next ADDR = ADDR + (1< 8 bits, 1 -> 16 bits +#define USB_EPNUM 8 // parameter for rtl : max of ENDPOINT and PIPE NUM +#define USB_EPT_NUM 8 // Number of USB end points +#define USB_GCLK_ID 10 // Index of Generic Clock +#define USB_INITIAL_CONTROL_QOS 3 // CONTROL QOS RESET value +#define USB_INITIAL_DATA_QOS 3 // DATA QOS RESET value +#define USB_MISSING_SOF_DET_IMPLEMENTED 1 // 48 mHz xPLL feature implemented +#define USB_PIPE_NUM 8 // Number of USB pipes +#define USB_SYSTEM_CLOCK_IS_CKUSB 0 // Dual (1'b0) or Single (1'b1) clock system +#define USB_USB_2_AHB_FIFO_DEPTH 4 // bytes number, should be at least 2, and 2^n (4,8,16 ...) +#define USB_USB_2_AHB_RD_DATA_BITS 16 // 8, 16 or 32, here : 8-bits is required as UTMI interface should work in 8-bits mode +#define USB_USB_2_AHB_RD_THRESHOLD 2 // as soon as there are 16 bytes-free inside the fifo, ahb read transfer is requested +#define USB_USB_2_AHB_WR_DATA_BITS 8 // 8, 16 or 32 : here : 8-bits is required as UTMI interface should work in 8-bits mode + +#endif /* _SAMD51_USB_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/wdt.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/wdt.h new file mode 100644 index 0000000000..98a2ca13d7 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/instance/wdt.h @@ -0,0 +1,55 @@ +/** + * \file + * + * \brief Instance description for WDT + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_WDT_INSTANCE_ +#define _SAMD51_WDT_INSTANCE_ + +/* ========== Register definition for WDT peripheral ========== */ +#if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +#define REG_WDT_CTRLA (0x40002000) /**< \brief (WDT) Control */ +#define REG_WDT_CONFIG (0x40002001) /**< \brief (WDT) Configuration */ +#define REG_WDT_EWCTRL (0x40002002) /**< \brief (WDT) Early Warning Interrupt Control */ +#define REG_WDT_INTENCLR (0x40002004) /**< \brief (WDT) Interrupt Enable Clear */ +#define REG_WDT_INTENSET (0x40002005) /**< \brief (WDT) Interrupt Enable Set */ +#define REG_WDT_INTFLAG (0x40002006) /**< \brief (WDT) Interrupt Flag Status and Clear */ +#define REG_WDT_SYNCBUSY (0x40002008) /**< \brief (WDT) Synchronization Busy */ +#define REG_WDT_CLEAR (0x4000200C) /**< \brief (WDT) Clear */ +#else +#define REG_WDT_CTRLA (*(RwReg8 *)0x40002000UL) /**< \brief (WDT) Control */ +#define REG_WDT_CONFIG (*(RwReg8 *)0x40002001UL) /**< \brief (WDT) Configuration */ +#define REG_WDT_EWCTRL (*(RwReg8 *)0x40002002UL) /**< \brief (WDT) Early Warning Interrupt Control */ +#define REG_WDT_INTENCLR (*(RwReg8 *)0x40002004UL) /**< \brief (WDT) Interrupt Enable Clear */ +#define REG_WDT_INTENSET (*(RwReg8 *)0x40002005UL) /**< \brief (WDT) Interrupt Enable Set */ +#define REG_WDT_INTFLAG (*(RwReg8 *)0x40002006UL) /**< \brief (WDT) Interrupt Flag Status and Clear */ +#define REG_WDT_SYNCBUSY (*(RoReg *)0x40002008UL) /**< \brief (WDT) Synchronization Busy */ +#define REG_WDT_CLEAR (*(WoReg8 *)0x4000200CUL) /**< \brief (WDT) Clear */ +#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + + +#endif /* _SAMD51_WDT_INSTANCE_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/pio/samd51j18a.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/pio/samd51j18a.h new file mode 100644 index 0000000000..d8fa56d5ba --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/pio/samd51j18a.h @@ -0,0 +1,1863 @@ +/** + * \file + * + * \brief Peripheral I/O description for SAMD51J18A + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51J18A_PIO_ +#define _SAMD51J18A_PIO_ + +#define PIN_PA00 0 /**< \brief Pin Number for PA00 */ +#define PORT_PA00 (_UL_(1) << 0) /**< \brief PORT Mask for PA00 */ +#define PIN_PA01 1 /**< \brief Pin Number for PA01 */ +#define PORT_PA01 (_UL_(1) << 1) /**< \brief PORT Mask for PA01 */ +#define PIN_PA02 2 /**< \brief Pin Number for PA02 */ +#define PORT_PA02 (_UL_(1) << 2) /**< \brief PORT Mask for PA02 */ +#define PIN_PA03 3 /**< \brief Pin Number for PA03 */ +#define PORT_PA03 (_UL_(1) << 3) /**< \brief PORT Mask for PA03 */ +#define PIN_PA04 4 /**< \brief Pin Number for PA04 */ +#define PORT_PA04 (_UL_(1) << 4) /**< \brief PORT Mask for PA04 */ +#define PIN_PA05 5 /**< \brief Pin Number for PA05 */ +#define PORT_PA05 (_UL_(1) << 5) /**< \brief PORT Mask for PA05 */ +#define PIN_PA06 6 /**< \brief Pin Number for PA06 */ +#define PORT_PA06 (_UL_(1) << 6) /**< \brief PORT Mask for PA06 */ +#define PIN_PA07 7 /**< \brief Pin Number for PA07 */ +#define PORT_PA07 (_UL_(1) << 7) /**< \brief PORT Mask for PA07 */ +#define PIN_PA08 8 /**< \brief Pin Number for PA08 */ +#define PORT_PA08 (_UL_(1) << 8) /**< \brief PORT Mask for PA08 */ +#define PIN_PA09 9 /**< \brief Pin Number for PA09 */ +#define PORT_PA09 (_UL_(1) << 9) /**< \brief PORT Mask for PA09 */ +#define PIN_PA10 10 /**< \brief Pin Number for PA10 */ +#define PORT_PA10 (_UL_(1) << 10) /**< \brief PORT Mask for PA10 */ +#define PIN_PA11 11 /**< \brief Pin Number for PA11 */ +#define PORT_PA11 (_UL_(1) << 11) /**< \brief PORT Mask for PA11 */ +#define PIN_PA12 12 /**< \brief Pin Number for PA12 */ +#define PORT_PA12 (_UL_(1) << 12) /**< \brief PORT Mask for PA12 */ +#define PIN_PA13 13 /**< \brief Pin Number for PA13 */ +#define PORT_PA13 (_UL_(1) << 13) /**< \brief PORT Mask for PA13 */ +#define PIN_PA14 14 /**< \brief Pin Number for PA14 */ +#define PORT_PA14 (_UL_(1) << 14) /**< \brief PORT Mask for PA14 */ +#define PIN_PA15 15 /**< \brief Pin Number for PA15 */ +#define PORT_PA15 (_UL_(1) << 15) /**< \brief PORT Mask for PA15 */ +#define PIN_PA16 16 /**< \brief Pin Number for PA16 */ +#define PORT_PA16 (_UL_(1) << 16) /**< \brief PORT Mask for PA16 */ +#define PIN_PA17 17 /**< \brief Pin Number for PA17 */ +#define PORT_PA17 (_UL_(1) << 17) /**< \brief PORT Mask for PA17 */ +#define PIN_PA18 18 /**< \brief Pin Number for PA18 */ +#define PORT_PA18 (_UL_(1) << 18) /**< \brief PORT Mask for PA18 */ +#define PIN_PA19 19 /**< \brief Pin Number for PA19 */ +#define PORT_PA19 (_UL_(1) << 19) /**< \brief PORT Mask for PA19 */ +#define PIN_PA20 20 /**< \brief Pin Number for PA20 */ +#define PORT_PA20 (_UL_(1) << 20) /**< \brief PORT Mask for PA20 */ +#define PIN_PA21 21 /**< \brief Pin Number for PA21 */ +#define PORT_PA21 (_UL_(1) << 21) /**< \brief PORT Mask for PA21 */ +#define PIN_PA22 22 /**< \brief Pin Number for PA22 */ +#define PORT_PA22 (_UL_(1) << 22) /**< \brief PORT Mask for PA22 */ +#define PIN_PA23 23 /**< \brief Pin Number for PA23 */ +#define PORT_PA23 (_UL_(1) << 23) /**< \brief PORT Mask for PA23 */ +#define PIN_PA24 24 /**< \brief Pin Number for PA24 */ +#define PORT_PA24 (_UL_(1) << 24) /**< \brief PORT Mask for PA24 */ +#define PIN_PA25 25 /**< \brief Pin Number for PA25 */ +#define PORT_PA25 (_UL_(1) << 25) /**< \brief PORT Mask for PA25 */ +#define PIN_PA27 27 /**< \brief Pin Number for PA27 */ +#define PORT_PA27 (_UL_(1) << 27) /**< \brief PORT Mask for PA27 */ +#define PIN_PA30 30 /**< \brief Pin Number for PA30 */ +#define PORT_PA30 (_UL_(1) << 30) /**< \brief PORT Mask for PA30 */ +#define PIN_PA31 31 /**< \brief Pin Number for PA31 */ +#define PORT_PA31 (_UL_(1) << 31) /**< \brief PORT Mask for PA31 */ +#define PIN_PB00 32 /**< \brief Pin Number for PB00 */ +#define PORT_PB00 (_UL_(1) << 0) /**< \brief PORT Mask for PB00 */ +#define PIN_PB01 33 /**< \brief Pin Number for PB01 */ +#define PORT_PB01 (_UL_(1) << 1) /**< \brief PORT Mask for PB01 */ +#define PIN_PB02 34 /**< \brief Pin Number for PB02 */ +#define PORT_PB02 (_UL_(1) << 2) /**< \brief PORT Mask for PB02 */ +#define PIN_PB03 35 /**< \brief Pin Number for PB03 */ +#define PORT_PB03 (_UL_(1) << 3) /**< \brief PORT Mask for PB03 */ +#define PIN_PB04 36 /**< \brief Pin Number for PB04 */ +#define PORT_PB04 (_UL_(1) << 4) /**< \brief PORT Mask for PB04 */ +#define PIN_PB05 37 /**< \brief Pin Number for PB05 */ +#define PORT_PB05 (_UL_(1) << 5) /**< \brief PORT Mask for PB05 */ +#define PIN_PB06 38 /**< \brief Pin Number for PB06 */ +#define PORT_PB06 (_UL_(1) << 6) /**< \brief PORT Mask for PB06 */ +#define PIN_PB07 39 /**< \brief Pin Number for PB07 */ +#define PORT_PB07 (_UL_(1) << 7) /**< \brief PORT Mask for PB07 */ +#define PIN_PB08 40 /**< \brief Pin Number for PB08 */ +#define PORT_PB08 (_UL_(1) << 8) /**< \brief PORT Mask for PB08 */ +#define PIN_PB09 41 /**< \brief Pin Number for PB09 */ +#define PORT_PB09 (_UL_(1) << 9) /**< \brief PORT Mask for PB09 */ +#define PIN_PB10 42 /**< \brief Pin Number for PB10 */ +#define PORT_PB10 (_UL_(1) << 10) /**< \brief PORT Mask for PB10 */ +#define PIN_PB11 43 /**< \brief Pin Number for PB11 */ +#define PORT_PB11 (_UL_(1) << 11) /**< \brief PORT Mask for PB11 */ +#define PIN_PB12 44 /**< \brief Pin Number for PB12 */ +#define PORT_PB12 (_UL_(1) << 12) /**< \brief PORT Mask for PB12 */ +#define PIN_PB13 45 /**< \brief Pin Number for PB13 */ +#define PORT_PB13 (_UL_(1) << 13) /**< \brief PORT Mask for PB13 */ +#define PIN_PB14 46 /**< \brief Pin Number for PB14 */ +#define PORT_PB14 (_UL_(1) << 14) /**< \brief PORT Mask for PB14 */ +#define PIN_PB15 47 /**< \brief Pin Number for PB15 */ +#define PORT_PB15 (_UL_(1) << 15) /**< \brief PORT Mask for PB15 */ +#define PIN_PB16 48 /**< \brief Pin Number for PB16 */ +#define PORT_PB16 (_UL_(1) << 16) /**< \brief PORT Mask for PB16 */ +#define PIN_PB17 49 /**< \brief Pin Number for PB17 */ +#define PORT_PB17 (_UL_(1) << 17) /**< \brief PORT Mask for PB17 */ +#define PIN_PB22 54 /**< \brief Pin Number for PB22 */ +#define PORT_PB22 (_UL_(1) << 22) /**< \brief PORT Mask for PB22 */ +#define PIN_PB23 55 /**< \brief Pin Number for PB23 */ +#define PORT_PB23 (_UL_(1) << 23) /**< \brief PORT Mask for PB23 */ +#define PIN_PB30 62 /**< \brief Pin Number for PB30 */ +#define PORT_PB30 (_UL_(1) << 30) /**< \brief PORT Mask for PB30 */ +#define PIN_PB31 63 /**< \brief Pin Number for PB31 */ +#define PORT_PB31 (_UL_(1) << 31) /**< \brief PORT Mask for PB31 */ +/* ========== PORT definition for CM4 peripheral ========== */ +#define PIN_PA30H_CM4_SWCLK _L_(30) /**< \brief CM4 signal: SWCLK on PA30 mux H */ +#define MUX_PA30H_CM4_SWCLK _L_(7) +#define PINMUX_PA30H_CM4_SWCLK ((PIN_PA30H_CM4_SWCLK << 16) | MUX_PA30H_CM4_SWCLK) +#define PORT_PA30H_CM4_SWCLK (_UL_(1) << 30) +#define PIN_PB30H_CM4_SWO _L_(62) /**< \brief CM4 signal: SWO on PB30 mux H */ +#define MUX_PB30H_CM4_SWO _L_(7) +#define PINMUX_PB30H_CM4_SWO ((PIN_PB30H_CM4_SWO << 16) | MUX_PB30H_CM4_SWO) +#define PORT_PB30H_CM4_SWO (_UL_(1) << 30) +/* ========== PORT definition for ANAREF peripheral ========== */ +#define PIN_PA03B_ANAREF_VREF0 _L_(3) /**< \brief ANAREF signal: VREF0 on PA03 mux B */ +#define MUX_PA03B_ANAREF_VREF0 _L_(1) +#define PINMUX_PA03B_ANAREF_VREF0 ((PIN_PA03B_ANAREF_VREF0 << 16) | MUX_PA03B_ANAREF_VREF0) +#define PORT_PA03B_ANAREF_VREF0 (_UL_(1) << 3) +#define PIN_PA04B_ANAREF_VREF1 _L_(4) /**< \brief ANAREF signal: VREF1 on PA04 mux B */ +#define MUX_PA04B_ANAREF_VREF1 _L_(1) +#define PINMUX_PA04B_ANAREF_VREF1 ((PIN_PA04B_ANAREF_VREF1 << 16) | MUX_PA04B_ANAREF_VREF1) +#define PORT_PA04B_ANAREF_VREF1 (_UL_(1) << 4) +#define PIN_PA06B_ANAREF_VREF2 _L_(6) /**< \brief ANAREF signal: VREF2 on PA06 mux B */ +#define MUX_PA06B_ANAREF_VREF2 _L_(1) +#define PINMUX_PA06B_ANAREF_VREF2 ((PIN_PA06B_ANAREF_VREF2 << 16) | MUX_PA06B_ANAREF_VREF2) +#define PORT_PA06B_ANAREF_VREF2 (_UL_(1) << 6) +/* ========== PORT definition for GCLK peripheral ========== */ +#define PIN_PA30M_GCLK_IO0 _L_(30) /**< \brief GCLK signal: IO0 on PA30 mux M */ +#define MUX_PA30M_GCLK_IO0 _L_(12) +#define PINMUX_PA30M_GCLK_IO0 ((PIN_PA30M_GCLK_IO0 << 16) | MUX_PA30M_GCLK_IO0) +#define PORT_PA30M_GCLK_IO0 (_UL_(1) << 30) +#define PIN_PB14M_GCLK_IO0 _L_(46) /**< \brief GCLK signal: IO0 on PB14 mux M */ +#define MUX_PB14M_GCLK_IO0 _L_(12) +#define PINMUX_PB14M_GCLK_IO0 ((PIN_PB14M_GCLK_IO0 << 16) | MUX_PB14M_GCLK_IO0) +#define PORT_PB14M_GCLK_IO0 (_UL_(1) << 14) +#define PIN_PA14M_GCLK_IO0 _L_(14) /**< \brief GCLK signal: IO0 on PA14 mux M */ +#define MUX_PA14M_GCLK_IO0 _L_(12) +#define PINMUX_PA14M_GCLK_IO0 ((PIN_PA14M_GCLK_IO0 << 16) | MUX_PA14M_GCLK_IO0) +#define PORT_PA14M_GCLK_IO0 (_UL_(1) << 14) +#define PIN_PB22M_GCLK_IO0 _L_(54) /**< \brief GCLK signal: IO0 on PB22 mux M */ +#define MUX_PB22M_GCLK_IO0 _L_(12) +#define PINMUX_PB22M_GCLK_IO0 ((PIN_PB22M_GCLK_IO0 << 16) | MUX_PB22M_GCLK_IO0) +#define PORT_PB22M_GCLK_IO0 (_UL_(1) << 22) +#define PIN_PB15M_GCLK_IO1 _L_(47) /**< \brief GCLK signal: IO1 on PB15 mux M */ +#define MUX_PB15M_GCLK_IO1 _L_(12) +#define PINMUX_PB15M_GCLK_IO1 ((PIN_PB15M_GCLK_IO1 << 16) | MUX_PB15M_GCLK_IO1) +#define PORT_PB15M_GCLK_IO1 (_UL_(1) << 15) +#define PIN_PA15M_GCLK_IO1 _L_(15) /**< \brief GCLK signal: IO1 on PA15 mux M */ +#define MUX_PA15M_GCLK_IO1 _L_(12) +#define PINMUX_PA15M_GCLK_IO1 ((PIN_PA15M_GCLK_IO1 << 16) | MUX_PA15M_GCLK_IO1) +#define PORT_PA15M_GCLK_IO1 (_UL_(1) << 15) +#define PIN_PB23M_GCLK_IO1 _L_(55) /**< \brief GCLK signal: IO1 on PB23 mux M */ +#define MUX_PB23M_GCLK_IO1 _L_(12) +#define PINMUX_PB23M_GCLK_IO1 ((PIN_PB23M_GCLK_IO1 << 16) | MUX_PB23M_GCLK_IO1) +#define PORT_PB23M_GCLK_IO1 (_UL_(1) << 23) +#define PIN_PA27M_GCLK_IO1 _L_(27) /**< \brief GCLK signal: IO1 on PA27 mux M */ +#define MUX_PA27M_GCLK_IO1 _L_(12) +#define PINMUX_PA27M_GCLK_IO1 ((PIN_PA27M_GCLK_IO1 << 16) | MUX_PA27M_GCLK_IO1) +#define PORT_PA27M_GCLK_IO1 (_UL_(1) << 27) +#define PIN_PA16M_GCLK_IO2 _L_(16) /**< \brief GCLK signal: IO2 on PA16 mux M */ +#define MUX_PA16M_GCLK_IO2 _L_(12) +#define PINMUX_PA16M_GCLK_IO2 ((PIN_PA16M_GCLK_IO2 << 16) | MUX_PA16M_GCLK_IO2) +#define PORT_PA16M_GCLK_IO2 (_UL_(1) << 16) +#define PIN_PB16M_GCLK_IO2 _L_(48) /**< \brief GCLK signal: IO2 on PB16 mux M */ +#define MUX_PB16M_GCLK_IO2 _L_(12) +#define PINMUX_PB16M_GCLK_IO2 ((PIN_PB16M_GCLK_IO2 << 16) | MUX_PB16M_GCLK_IO2) +#define PORT_PB16M_GCLK_IO2 (_UL_(1) << 16) +#define PIN_PA17M_GCLK_IO3 _L_(17) /**< \brief GCLK signal: IO3 on PA17 mux M */ +#define MUX_PA17M_GCLK_IO3 _L_(12) +#define PINMUX_PA17M_GCLK_IO3 ((PIN_PA17M_GCLK_IO3 << 16) | MUX_PA17M_GCLK_IO3) +#define PORT_PA17M_GCLK_IO3 (_UL_(1) << 17) +#define PIN_PB17M_GCLK_IO3 _L_(49) /**< \brief GCLK signal: IO3 on PB17 mux M */ +#define MUX_PB17M_GCLK_IO3 _L_(12) +#define PINMUX_PB17M_GCLK_IO3 ((PIN_PB17M_GCLK_IO3 << 16) | MUX_PB17M_GCLK_IO3) +#define PORT_PB17M_GCLK_IO3 (_UL_(1) << 17) +#define PIN_PA10M_GCLK_IO4 _L_(10) /**< \brief GCLK signal: IO4 on PA10 mux M */ +#define MUX_PA10M_GCLK_IO4 _L_(12) +#define PINMUX_PA10M_GCLK_IO4 ((PIN_PA10M_GCLK_IO4 << 16) | MUX_PA10M_GCLK_IO4) +#define PORT_PA10M_GCLK_IO4 (_UL_(1) << 10) +#define PIN_PB10M_GCLK_IO4 _L_(42) /**< \brief GCLK signal: IO4 on PB10 mux M */ +#define MUX_PB10M_GCLK_IO4 _L_(12) +#define PINMUX_PB10M_GCLK_IO4 ((PIN_PB10M_GCLK_IO4 << 16) | MUX_PB10M_GCLK_IO4) +#define PORT_PB10M_GCLK_IO4 (_UL_(1) << 10) +#define PIN_PA11M_GCLK_IO5 _L_(11) /**< \brief GCLK signal: IO5 on PA11 mux M */ +#define MUX_PA11M_GCLK_IO5 _L_(12) +#define PINMUX_PA11M_GCLK_IO5 ((PIN_PA11M_GCLK_IO5 << 16) | MUX_PA11M_GCLK_IO5) +#define PORT_PA11M_GCLK_IO5 (_UL_(1) << 11) +#define PIN_PB11M_GCLK_IO5 _L_(43) /**< \brief GCLK signal: IO5 on PB11 mux M */ +#define MUX_PB11M_GCLK_IO5 _L_(12) +#define PINMUX_PB11M_GCLK_IO5 ((PIN_PB11M_GCLK_IO5 << 16) | MUX_PB11M_GCLK_IO5) +#define PORT_PB11M_GCLK_IO5 (_UL_(1) << 11) +#define PIN_PB12M_GCLK_IO6 _L_(44) /**< \brief GCLK signal: IO6 on PB12 mux M */ +#define MUX_PB12M_GCLK_IO6 _L_(12) +#define PINMUX_PB12M_GCLK_IO6 ((PIN_PB12M_GCLK_IO6 << 16) | MUX_PB12M_GCLK_IO6) +#define PORT_PB12M_GCLK_IO6 (_UL_(1) << 12) +#define PIN_PB13M_GCLK_IO7 _L_(45) /**< \brief GCLK signal: IO7 on PB13 mux M */ +#define MUX_PB13M_GCLK_IO7 _L_(12) +#define PINMUX_PB13M_GCLK_IO7 ((PIN_PB13M_GCLK_IO7 << 16) | MUX_PB13M_GCLK_IO7) +#define PORT_PB13M_GCLK_IO7 (_UL_(1) << 13) +/* ========== PORT definition for EIC peripheral ========== */ +#define PIN_PA00A_EIC_EXTINT0 _L_(0) /**< \brief EIC signal: EXTINT0 on PA00 mux A */ +#define MUX_PA00A_EIC_EXTINT0 _L_(0) +#define PINMUX_PA00A_EIC_EXTINT0 ((PIN_PA00A_EIC_EXTINT0 << 16) | MUX_PA00A_EIC_EXTINT0) +#define PORT_PA00A_EIC_EXTINT0 (_UL_(1) << 0) +#define PIN_PA00A_EIC_EXTINT_NUM _L_(0) /**< \brief EIC signal: PIN_PA00 External Interrupt Line */ +#define PIN_PA16A_EIC_EXTINT0 _L_(16) /**< \brief EIC signal: EXTINT0 on PA16 mux A */ +#define MUX_PA16A_EIC_EXTINT0 _L_(0) +#define PINMUX_PA16A_EIC_EXTINT0 ((PIN_PA16A_EIC_EXTINT0 << 16) | MUX_PA16A_EIC_EXTINT0) +#define PORT_PA16A_EIC_EXTINT0 (_UL_(1) << 16) +#define PIN_PA16A_EIC_EXTINT_NUM _L_(0) /**< \brief EIC signal: PIN_PA16 External Interrupt Line */ +#define PIN_PB00A_EIC_EXTINT0 _L_(32) /**< \brief EIC signal: EXTINT0 on PB00 mux A */ +#define MUX_PB00A_EIC_EXTINT0 _L_(0) +#define PINMUX_PB00A_EIC_EXTINT0 ((PIN_PB00A_EIC_EXTINT0 << 16) | MUX_PB00A_EIC_EXTINT0) +#define PORT_PB00A_EIC_EXTINT0 (_UL_(1) << 0) +#define PIN_PB00A_EIC_EXTINT_NUM _L_(0) /**< \brief EIC signal: PIN_PB00 External Interrupt Line */ +#define PIN_PB16A_EIC_EXTINT0 _L_(48) /**< \brief EIC signal: EXTINT0 on PB16 mux A */ +#define MUX_PB16A_EIC_EXTINT0 _L_(0) +#define PINMUX_PB16A_EIC_EXTINT0 ((PIN_PB16A_EIC_EXTINT0 << 16) | MUX_PB16A_EIC_EXTINT0) +#define PORT_PB16A_EIC_EXTINT0 (_UL_(1) << 16) +#define PIN_PB16A_EIC_EXTINT_NUM _L_(0) /**< \brief EIC signal: PIN_PB16 External Interrupt Line */ +#define PIN_PA01A_EIC_EXTINT1 _L_(1) /**< \brief EIC signal: EXTINT1 on PA01 mux A */ +#define MUX_PA01A_EIC_EXTINT1 _L_(0) +#define PINMUX_PA01A_EIC_EXTINT1 ((PIN_PA01A_EIC_EXTINT1 << 16) | MUX_PA01A_EIC_EXTINT1) +#define PORT_PA01A_EIC_EXTINT1 (_UL_(1) << 1) +#define PIN_PA01A_EIC_EXTINT_NUM _L_(1) /**< \brief EIC signal: PIN_PA01 External Interrupt Line */ +#define PIN_PA17A_EIC_EXTINT1 _L_(17) /**< \brief EIC signal: EXTINT1 on PA17 mux A */ +#define MUX_PA17A_EIC_EXTINT1 _L_(0) +#define PINMUX_PA17A_EIC_EXTINT1 ((PIN_PA17A_EIC_EXTINT1 << 16) | MUX_PA17A_EIC_EXTINT1) +#define PORT_PA17A_EIC_EXTINT1 (_UL_(1) << 17) +#define PIN_PA17A_EIC_EXTINT_NUM _L_(1) /**< \brief EIC signal: PIN_PA17 External Interrupt Line */ +#define PIN_PB01A_EIC_EXTINT1 _L_(33) /**< \brief EIC signal: EXTINT1 on PB01 mux A */ +#define MUX_PB01A_EIC_EXTINT1 _L_(0) +#define PINMUX_PB01A_EIC_EXTINT1 ((PIN_PB01A_EIC_EXTINT1 << 16) | MUX_PB01A_EIC_EXTINT1) +#define PORT_PB01A_EIC_EXTINT1 (_UL_(1) << 1) +#define PIN_PB01A_EIC_EXTINT_NUM _L_(1) /**< \brief EIC signal: PIN_PB01 External Interrupt Line */ +#define PIN_PB17A_EIC_EXTINT1 _L_(49) /**< \brief EIC signal: EXTINT1 on PB17 mux A */ +#define MUX_PB17A_EIC_EXTINT1 _L_(0) +#define PINMUX_PB17A_EIC_EXTINT1 ((PIN_PB17A_EIC_EXTINT1 << 16) | MUX_PB17A_EIC_EXTINT1) +#define PORT_PB17A_EIC_EXTINT1 (_UL_(1) << 17) +#define PIN_PB17A_EIC_EXTINT_NUM _L_(1) /**< \brief EIC signal: PIN_PB17 External Interrupt Line */ +#define PIN_PA02A_EIC_EXTINT2 _L_(2) /**< \brief EIC signal: EXTINT2 on PA02 mux A */ +#define MUX_PA02A_EIC_EXTINT2 _L_(0) +#define PINMUX_PA02A_EIC_EXTINT2 ((PIN_PA02A_EIC_EXTINT2 << 16) | MUX_PA02A_EIC_EXTINT2) +#define PORT_PA02A_EIC_EXTINT2 (_UL_(1) << 2) +#define PIN_PA02A_EIC_EXTINT_NUM _L_(2) /**< \brief EIC signal: PIN_PA02 External Interrupt Line */ +#define PIN_PA18A_EIC_EXTINT2 _L_(18) /**< \brief EIC signal: EXTINT2 on PA18 mux A */ +#define MUX_PA18A_EIC_EXTINT2 _L_(0) +#define PINMUX_PA18A_EIC_EXTINT2 ((PIN_PA18A_EIC_EXTINT2 << 16) | MUX_PA18A_EIC_EXTINT2) +#define PORT_PA18A_EIC_EXTINT2 (_UL_(1) << 18) +#define PIN_PA18A_EIC_EXTINT_NUM _L_(2) /**< \brief EIC signal: PIN_PA18 External Interrupt Line */ +#define PIN_PB02A_EIC_EXTINT2 _L_(34) /**< \brief EIC signal: EXTINT2 on PB02 mux A */ +#define MUX_PB02A_EIC_EXTINT2 _L_(0) +#define PINMUX_PB02A_EIC_EXTINT2 ((PIN_PB02A_EIC_EXTINT2 << 16) | MUX_PB02A_EIC_EXTINT2) +#define PORT_PB02A_EIC_EXTINT2 (_UL_(1) << 2) +#define PIN_PB02A_EIC_EXTINT_NUM _L_(2) /**< \brief EIC signal: PIN_PB02 External Interrupt Line */ +#define PIN_PA03A_EIC_EXTINT3 _L_(3) /**< \brief EIC signal: EXTINT3 on PA03 mux A */ +#define MUX_PA03A_EIC_EXTINT3 _L_(0) +#define PINMUX_PA03A_EIC_EXTINT3 ((PIN_PA03A_EIC_EXTINT3 << 16) | MUX_PA03A_EIC_EXTINT3) +#define PORT_PA03A_EIC_EXTINT3 (_UL_(1) << 3) +#define PIN_PA03A_EIC_EXTINT_NUM _L_(3) /**< \brief EIC signal: PIN_PA03 External Interrupt Line */ +#define PIN_PA19A_EIC_EXTINT3 _L_(19) /**< \brief EIC signal: EXTINT3 on PA19 mux A */ +#define MUX_PA19A_EIC_EXTINT3 _L_(0) +#define PINMUX_PA19A_EIC_EXTINT3 ((PIN_PA19A_EIC_EXTINT3 << 16) | MUX_PA19A_EIC_EXTINT3) +#define PORT_PA19A_EIC_EXTINT3 (_UL_(1) << 19) +#define PIN_PA19A_EIC_EXTINT_NUM _L_(3) /**< \brief EIC signal: PIN_PA19 External Interrupt Line */ +#define PIN_PB03A_EIC_EXTINT3 _L_(35) /**< \brief EIC signal: EXTINT3 on PB03 mux A */ +#define MUX_PB03A_EIC_EXTINT3 _L_(0) +#define PINMUX_PB03A_EIC_EXTINT3 ((PIN_PB03A_EIC_EXTINT3 << 16) | MUX_PB03A_EIC_EXTINT3) +#define PORT_PB03A_EIC_EXTINT3 (_UL_(1) << 3) +#define PIN_PB03A_EIC_EXTINT_NUM _L_(3) /**< \brief EIC signal: PIN_PB03 External Interrupt Line */ +#define PIN_PA04A_EIC_EXTINT4 _L_(4) /**< \brief EIC signal: EXTINT4 on PA04 mux A */ +#define MUX_PA04A_EIC_EXTINT4 _L_(0) +#define PINMUX_PA04A_EIC_EXTINT4 ((PIN_PA04A_EIC_EXTINT4 << 16) | MUX_PA04A_EIC_EXTINT4) +#define PORT_PA04A_EIC_EXTINT4 (_UL_(1) << 4) +#define PIN_PA04A_EIC_EXTINT_NUM _L_(4) /**< \brief EIC signal: PIN_PA04 External Interrupt Line */ +#define PIN_PA20A_EIC_EXTINT4 _L_(20) /**< \brief EIC signal: EXTINT4 on PA20 mux A */ +#define MUX_PA20A_EIC_EXTINT4 _L_(0) +#define PINMUX_PA20A_EIC_EXTINT4 ((PIN_PA20A_EIC_EXTINT4 << 16) | MUX_PA20A_EIC_EXTINT4) +#define PORT_PA20A_EIC_EXTINT4 (_UL_(1) << 20) +#define PIN_PA20A_EIC_EXTINT_NUM _L_(4) /**< \brief EIC signal: PIN_PA20 External Interrupt Line */ +#define PIN_PB04A_EIC_EXTINT4 _L_(36) /**< \brief EIC signal: EXTINT4 on PB04 mux A */ +#define MUX_PB04A_EIC_EXTINT4 _L_(0) +#define PINMUX_PB04A_EIC_EXTINT4 ((PIN_PB04A_EIC_EXTINT4 << 16) | MUX_PB04A_EIC_EXTINT4) +#define PORT_PB04A_EIC_EXTINT4 (_UL_(1) << 4) +#define PIN_PB04A_EIC_EXTINT_NUM _L_(4) /**< \brief EIC signal: PIN_PB04 External Interrupt Line */ +#define PIN_PA05A_EIC_EXTINT5 _L_(5) /**< \brief EIC signal: EXTINT5 on PA05 mux A */ +#define MUX_PA05A_EIC_EXTINT5 _L_(0) +#define PINMUX_PA05A_EIC_EXTINT5 ((PIN_PA05A_EIC_EXTINT5 << 16) | MUX_PA05A_EIC_EXTINT5) +#define PORT_PA05A_EIC_EXTINT5 (_UL_(1) << 5) +#define PIN_PA05A_EIC_EXTINT_NUM _L_(5) /**< \brief EIC signal: PIN_PA05 External Interrupt Line */ +#define PIN_PA21A_EIC_EXTINT5 _L_(21) /**< \brief EIC signal: EXTINT5 on PA21 mux A */ +#define MUX_PA21A_EIC_EXTINT5 _L_(0) +#define PINMUX_PA21A_EIC_EXTINT5 ((PIN_PA21A_EIC_EXTINT5 << 16) | MUX_PA21A_EIC_EXTINT5) +#define PORT_PA21A_EIC_EXTINT5 (_UL_(1) << 21) +#define PIN_PA21A_EIC_EXTINT_NUM _L_(5) /**< \brief EIC signal: PIN_PA21 External Interrupt Line */ +#define PIN_PB05A_EIC_EXTINT5 _L_(37) /**< \brief EIC signal: EXTINT5 on PB05 mux A */ +#define MUX_PB05A_EIC_EXTINT5 _L_(0) +#define PINMUX_PB05A_EIC_EXTINT5 ((PIN_PB05A_EIC_EXTINT5 << 16) | MUX_PB05A_EIC_EXTINT5) +#define PORT_PB05A_EIC_EXTINT5 (_UL_(1) << 5) +#define PIN_PB05A_EIC_EXTINT_NUM _L_(5) /**< \brief EIC signal: PIN_PB05 External Interrupt Line */ +#define PIN_PA06A_EIC_EXTINT6 _L_(6) /**< \brief EIC signal: EXTINT6 on PA06 mux A */ +#define MUX_PA06A_EIC_EXTINT6 _L_(0) +#define PINMUX_PA06A_EIC_EXTINT6 ((PIN_PA06A_EIC_EXTINT6 << 16) | MUX_PA06A_EIC_EXTINT6) +#define PORT_PA06A_EIC_EXTINT6 (_UL_(1) << 6) +#define PIN_PA06A_EIC_EXTINT_NUM _L_(6) /**< \brief EIC signal: PIN_PA06 External Interrupt Line */ +#define PIN_PA22A_EIC_EXTINT6 _L_(22) /**< \brief EIC signal: EXTINT6 on PA22 mux A */ +#define MUX_PA22A_EIC_EXTINT6 _L_(0) +#define PINMUX_PA22A_EIC_EXTINT6 ((PIN_PA22A_EIC_EXTINT6 << 16) | MUX_PA22A_EIC_EXTINT6) +#define PORT_PA22A_EIC_EXTINT6 (_UL_(1) << 22) +#define PIN_PA22A_EIC_EXTINT_NUM _L_(6) /**< \brief EIC signal: PIN_PA22 External Interrupt Line */ +#define PIN_PB06A_EIC_EXTINT6 _L_(38) /**< \brief EIC signal: EXTINT6 on PB06 mux A */ +#define MUX_PB06A_EIC_EXTINT6 _L_(0) +#define PINMUX_PB06A_EIC_EXTINT6 ((PIN_PB06A_EIC_EXTINT6 << 16) | MUX_PB06A_EIC_EXTINT6) +#define PORT_PB06A_EIC_EXTINT6 (_UL_(1) << 6) +#define PIN_PB06A_EIC_EXTINT_NUM _L_(6) /**< \brief EIC signal: PIN_PB06 External Interrupt Line */ +#define PIN_PB22A_EIC_EXTINT6 _L_(54) /**< \brief EIC signal: EXTINT6 on PB22 mux A */ +#define MUX_PB22A_EIC_EXTINT6 _L_(0) +#define PINMUX_PB22A_EIC_EXTINT6 ((PIN_PB22A_EIC_EXTINT6 << 16) | MUX_PB22A_EIC_EXTINT6) +#define PORT_PB22A_EIC_EXTINT6 (_UL_(1) << 22) +#define PIN_PB22A_EIC_EXTINT_NUM _L_(6) /**< \brief EIC signal: PIN_PB22 External Interrupt Line */ +#define PIN_PA07A_EIC_EXTINT7 _L_(7) /**< \brief EIC signal: EXTINT7 on PA07 mux A */ +#define MUX_PA07A_EIC_EXTINT7 _L_(0) +#define PINMUX_PA07A_EIC_EXTINT7 ((PIN_PA07A_EIC_EXTINT7 << 16) | MUX_PA07A_EIC_EXTINT7) +#define PORT_PA07A_EIC_EXTINT7 (_UL_(1) << 7) +#define PIN_PA07A_EIC_EXTINT_NUM _L_(7) /**< \brief EIC signal: PIN_PA07 External Interrupt Line */ +#define PIN_PA23A_EIC_EXTINT7 _L_(23) /**< \brief EIC signal: EXTINT7 on PA23 mux A */ +#define MUX_PA23A_EIC_EXTINT7 _L_(0) +#define PINMUX_PA23A_EIC_EXTINT7 ((PIN_PA23A_EIC_EXTINT7 << 16) | MUX_PA23A_EIC_EXTINT7) +#define PORT_PA23A_EIC_EXTINT7 (_UL_(1) << 23) +#define PIN_PA23A_EIC_EXTINT_NUM _L_(7) /**< \brief EIC signal: PIN_PA23 External Interrupt Line */ +#define PIN_PB07A_EIC_EXTINT7 _L_(39) /**< \brief EIC signal: EXTINT7 on PB07 mux A */ +#define MUX_PB07A_EIC_EXTINT7 _L_(0) +#define PINMUX_PB07A_EIC_EXTINT7 ((PIN_PB07A_EIC_EXTINT7 << 16) | MUX_PB07A_EIC_EXTINT7) +#define PORT_PB07A_EIC_EXTINT7 (_UL_(1) << 7) +#define PIN_PB07A_EIC_EXTINT_NUM _L_(7) /**< \brief EIC signal: PIN_PB07 External Interrupt Line */ +#define PIN_PB23A_EIC_EXTINT7 _L_(55) /**< \brief EIC signal: EXTINT7 on PB23 mux A */ +#define MUX_PB23A_EIC_EXTINT7 _L_(0) +#define PINMUX_PB23A_EIC_EXTINT7 ((PIN_PB23A_EIC_EXTINT7 << 16) | MUX_PB23A_EIC_EXTINT7) +#define PORT_PB23A_EIC_EXTINT7 (_UL_(1) << 23) +#define PIN_PB23A_EIC_EXTINT_NUM _L_(7) /**< \brief EIC signal: PIN_PB23 External Interrupt Line */ +#define PIN_PA24A_EIC_EXTINT8 _L_(24) /**< \brief EIC signal: EXTINT8 on PA24 mux A */ +#define MUX_PA24A_EIC_EXTINT8 _L_(0) +#define PINMUX_PA24A_EIC_EXTINT8 ((PIN_PA24A_EIC_EXTINT8 << 16) | MUX_PA24A_EIC_EXTINT8) +#define PORT_PA24A_EIC_EXTINT8 (_UL_(1) << 24) +#define PIN_PA24A_EIC_EXTINT_NUM _L_(8) /**< \brief EIC signal: PIN_PA24 External Interrupt Line */ +#define PIN_PB08A_EIC_EXTINT8 _L_(40) /**< \brief EIC signal: EXTINT8 on PB08 mux A */ +#define MUX_PB08A_EIC_EXTINT8 _L_(0) +#define PINMUX_PB08A_EIC_EXTINT8 ((PIN_PB08A_EIC_EXTINT8 << 16) | MUX_PB08A_EIC_EXTINT8) +#define PORT_PB08A_EIC_EXTINT8 (_UL_(1) << 8) +#define PIN_PB08A_EIC_EXTINT_NUM _L_(8) /**< \brief EIC signal: PIN_PB08 External Interrupt Line */ +#define PIN_PA09A_EIC_EXTINT9 _L_(9) /**< \brief EIC signal: EXTINT9 on PA09 mux A */ +#define MUX_PA09A_EIC_EXTINT9 _L_(0) +#define PINMUX_PA09A_EIC_EXTINT9 ((PIN_PA09A_EIC_EXTINT9 << 16) | MUX_PA09A_EIC_EXTINT9) +#define PORT_PA09A_EIC_EXTINT9 (_UL_(1) << 9) +#define PIN_PA09A_EIC_EXTINT_NUM _L_(9) /**< \brief EIC signal: PIN_PA09 External Interrupt Line */ +#define PIN_PA25A_EIC_EXTINT9 _L_(25) /**< \brief EIC signal: EXTINT9 on PA25 mux A */ +#define MUX_PA25A_EIC_EXTINT9 _L_(0) +#define PINMUX_PA25A_EIC_EXTINT9 ((PIN_PA25A_EIC_EXTINT9 << 16) | MUX_PA25A_EIC_EXTINT9) +#define PORT_PA25A_EIC_EXTINT9 (_UL_(1) << 25) +#define PIN_PA25A_EIC_EXTINT_NUM _L_(9) /**< \brief EIC signal: PIN_PA25 External Interrupt Line */ +#define PIN_PB09A_EIC_EXTINT9 _L_(41) /**< \brief EIC signal: EXTINT9 on PB09 mux A */ +#define MUX_PB09A_EIC_EXTINT9 _L_(0) +#define PINMUX_PB09A_EIC_EXTINT9 ((PIN_PB09A_EIC_EXTINT9 << 16) | MUX_PB09A_EIC_EXTINT9) +#define PORT_PB09A_EIC_EXTINT9 (_UL_(1) << 9) +#define PIN_PB09A_EIC_EXTINT_NUM _L_(9) /**< \brief EIC signal: PIN_PB09 External Interrupt Line */ +#define PIN_PA10A_EIC_EXTINT10 _L_(10) /**< \brief EIC signal: EXTINT10 on PA10 mux A */ +#define MUX_PA10A_EIC_EXTINT10 _L_(0) +#define PINMUX_PA10A_EIC_EXTINT10 ((PIN_PA10A_EIC_EXTINT10 << 16) | MUX_PA10A_EIC_EXTINT10) +#define PORT_PA10A_EIC_EXTINT10 (_UL_(1) << 10) +#define PIN_PA10A_EIC_EXTINT_NUM _L_(10) /**< \brief EIC signal: PIN_PA10 External Interrupt Line */ +#define PIN_PB10A_EIC_EXTINT10 _L_(42) /**< \brief EIC signal: EXTINT10 on PB10 mux A */ +#define MUX_PB10A_EIC_EXTINT10 _L_(0) +#define PINMUX_PB10A_EIC_EXTINT10 ((PIN_PB10A_EIC_EXTINT10 << 16) | MUX_PB10A_EIC_EXTINT10) +#define PORT_PB10A_EIC_EXTINT10 (_UL_(1) << 10) +#define PIN_PB10A_EIC_EXTINT_NUM _L_(10) /**< \brief EIC signal: PIN_PB10 External Interrupt Line */ +#define PIN_PA11A_EIC_EXTINT11 _L_(11) /**< \brief EIC signal: EXTINT11 on PA11 mux A */ +#define MUX_PA11A_EIC_EXTINT11 _L_(0) +#define PINMUX_PA11A_EIC_EXTINT11 ((PIN_PA11A_EIC_EXTINT11 << 16) | MUX_PA11A_EIC_EXTINT11) +#define PORT_PA11A_EIC_EXTINT11 (_UL_(1) << 11) +#define PIN_PA11A_EIC_EXTINT_NUM _L_(11) /**< \brief EIC signal: PIN_PA11 External Interrupt Line */ +#define PIN_PA27A_EIC_EXTINT11 _L_(27) /**< \brief EIC signal: EXTINT11 on PA27 mux A */ +#define MUX_PA27A_EIC_EXTINT11 _L_(0) +#define PINMUX_PA27A_EIC_EXTINT11 ((PIN_PA27A_EIC_EXTINT11 << 16) | MUX_PA27A_EIC_EXTINT11) +#define PORT_PA27A_EIC_EXTINT11 (_UL_(1) << 27) +#define PIN_PA27A_EIC_EXTINT_NUM _L_(11) /**< \brief EIC signal: PIN_PA27 External Interrupt Line */ +#define PIN_PB11A_EIC_EXTINT11 _L_(43) /**< \brief EIC signal: EXTINT11 on PB11 mux A */ +#define MUX_PB11A_EIC_EXTINT11 _L_(0) +#define PINMUX_PB11A_EIC_EXTINT11 ((PIN_PB11A_EIC_EXTINT11 << 16) | MUX_PB11A_EIC_EXTINT11) +#define PORT_PB11A_EIC_EXTINT11 (_UL_(1) << 11) +#define PIN_PB11A_EIC_EXTINT_NUM _L_(11) /**< \brief EIC signal: PIN_PB11 External Interrupt Line */ +#define PIN_PA12A_EIC_EXTINT12 _L_(12) /**< \brief EIC signal: EXTINT12 on PA12 mux A */ +#define MUX_PA12A_EIC_EXTINT12 _L_(0) +#define PINMUX_PA12A_EIC_EXTINT12 ((PIN_PA12A_EIC_EXTINT12 << 16) | MUX_PA12A_EIC_EXTINT12) +#define PORT_PA12A_EIC_EXTINT12 (_UL_(1) << 12) +#define PIN_PA12A_EIC_EXTINT_NUM _L_(12) /**< \brief EIC signal: PIN_PA12 External Interrupt Line */ +#define PIN_PB12A_EIC_EXTINT12 _L_(44) /**< \brief EIC signal: EXTINT12 on PB12 mux A */ +#define MUX_PB12A_EIC_EXTINT12 _L_(0) +#define PINMUX_PB12A_EIC_EXTINT12 ((PIN_PB12A_EIC_EXTINT12 << 16) | MUX_PB12A_EIC_EXTINT12) +#define PORT_PB12A_EIC_EXTINT12 (_UL_(1) << 12) +#define PIN_PB12A_EIC_EXTINT_NUM _L_(12) /**< \brief EIC signal: PIN_PB12 External Interrupt Line */ +#define PIN_PA13A_EIC_EXTINT13 _L_(13) /**< \brief EIC signal: EXTINT13 on PA13 mux A */ +#define MUX_PA13A_EIC_EXTINT13 _L_(0) +#define PINMUX_PA13A_EIC_EXTINT13 ((PIN_PA13A_EIC_EXTINT13 << 16) | MUX_PA13A_EIC_EXTINT13) +#define PORT_PA13A_EIC_EXTINT13 (_UL_(1) << 13) +#define PIN_PA13A_EIC_EXTINT_NUM _L_(13) /**< \brief EIC signal: PIN_PA13 External Interrupt Line */ +#define PIN_PB13A_EIC_EXTINT13 _L_(45) /**< \brief EIC signal: EXTINT13 on PB13 mux A */ +#define MUX_PB13A_EIC_EXTINT13 _L_(0) +#define PINMUX_PB13A_EIC_EXTINT13 ((PIN_PB13A_EIC_EXTINT13 << 16) | MUX_PB13A_EIC_EXTINT13) +#define PORT_PB13A_EIC_EXTINT13 (_UL_(1) << 13) +#define PIN_PB13A_EIC_EXTINT_NUM _L_(13) /**< \brief EIC signal: PIN_PB13 External Interrupt Line */ +#define PIN_PA30A_EIC_EXTINT14 _L_(30) /**< \brief EIC signal: EXTINT14 on PA30 mux A */ +#define MUX_PA30A_EIC_EXTINT14 _L_(0) +#define PINMUX_PA30A_EIC_EXTINT14 ((PIN_PA30A_EIC_EXTINT14 << 16) | MUX_PA30A_EIC_EXTINT14) +#define PORT_PA30A_EIC_EXTINT14 (_UL_(1) << 30) +#define PIN_PA30A_EIC_EXTINT_NUM _L_(14) /**< \brief EIC signal: PIN_PA30 External Interrupt Line */ +#define PIN_PB14A_EIC_EXTINT14 _L_(46) /**< \brief EIC signal: EXTINT14 on PB14 mux A */ +#define MUX_PB14A_EIC_EXTINT14 _L_(0) +#define PINMUX_PB14A_EIC_EXTINT14 ((PIN_PB14A_EIC_EXTINT14 << 16) | MUX_PB14A_EIC_EXTINT14) +#define PORT_PB14A_EIC_EXTINT14 (_UL_(1) << 14) +#define PIN_PB14A_EIC_EXTINT_NUM _L_(14) /**< \brief EIC signal: PIN_PB14 External Interrupt Line */ +#define PIN_PB30A_EIC_EXTINT14 _L_(62) /**< \brief EIC signal: EXTINT14 on PB30 mux A */ +#define MUX_PB30A_EIC_EXTINT14 _L_(0) +#define PINMUX_PB30A_EIC_EXTINT14 ((PIN_PB30A_EIC_EXTINT14 << 16) | MUX_PB30A_EIC_EXTINT14) +#define PORT_PB30A_EIC_EXTINT14 (_UL_(1) << 30) +#define PIN_PB30A_EIC_EXTINT_NUM _L_(14) /**< \brief EIC signal: PIN_PB30 External Interrupt Line */ +#define PIN_PA14A_EIC_EXTINT14 _L_(14) /**< \brief EIC signal: EXTINT14 on PA14 mux A */ +#define MUX_PA14A_EIC_EXTINT14 _L_(0) +#define PINMUX_PA14A_EIC_EXTINT14 ((PIN_PA14A_EIC_EXTINT14 << 16) | MUX_PA14A_EIC_EXTINT14) +#define PORT_PA14A_EIC_EXTINT14 (_UL_(1) << 14) +#define PIN_PA14A_EIC_EXTINT_NUM _L_(14) /**< \brief EIC signal: PIN_PA14 External Interrupt Line */ +#define PIN_PA15A_EIC_EXTINT15 _L_(15) /**< \brief EIC signal: EXTINT15 on PA15 mux A */ +#define MUX_PA15A_EIC_EXTINT15 _L_(0) +#define PINMUX_PA15A_EIC_EXTINT15 ((PIN_PA15A_EIC_EXTINT15 << 16) | MUX_PA15A_EIC_EXTINT15) +#define PORT_PA15A_EIC_EXTINT15 (_UL_(1) << 15) +#define PIN_PA15A_EIC_EXTINT_NUM _L_(15) /**< \brief EIC signal: PIN_PA15 External Interrupt Line */ +#define PIN_PA31A_EIC_EXTINT15 _L_(31) /**< \brief EIC signal: EXTINT15 on PA31 mux A */ +#define MUX_PA31A_EIC_EXTINT15 _L_(0) +#define PINMUX_PA31A_EIC_EXTINT15 ((PIN_PA31A_EIC_EXTINT15 << 16) | MUX_PA31A_EIC_EXTINT15) +#define PORT_PA31A_EIC_EXTINT15 (_UL_(1) << 31) +#define PIN_PA31A_EIC_EXTINT_NUM _L_(15) /**< \brief EIC signal: PIN_PA31 External Interrupt Line */ +#define PIN_PB15A_EIC_EXTINT15 _L_(47) /**< \brief EIC signal: EXTINT15 on PB15 mux A */ +#define MUX_PB15A_EIC_EXTINT15 _L_(0) +#define PINMUX_PB15A_EIC_EXTINT15 ((PIN_PB15A_EIC_EXTINT15 << 16) | MUX_PB15A_EIC_EXTINT15) +#define PORT_PB15A_EIC_EXTINT15 (_UL_(1) << 15) +#define PIN_PB15A_EIC_EXTINT_NUM _L_(15) /**< \brief EIC signal: PIN_PB15 External Interrupt Line */ +#define PIN_PB31A_EIC_EXTINT15 _L_(63) /**< \brief EIC signal: EXTINT15 on PB31 mux A */ +#define MUX_PB31A_EIC_EXTINT15 _L_(0) +#define PINMUX_PB31A_EIC_EXTINT15 ((PIN_PB31A_EIC_EXTINT15 << 16) | MUX_PB31A_EIC_EXTINT15) +#define PORT_PB31A_EIC_EXTINT15 (_UL_(1) << 31) +#define PIN_PB31A_EIC_EXTINT_NUM _L_(15) /**< \brief EIC signal: PIN_PB31 External Interrupt Line */ +#define PIN_PA08A_EIC_NMI _L_(8) /**< \brief EIC signal: NMI on PA08 mux A */ +#define MUX_PA08A_EIC_NMI _L_(0) +#define PINMUX_PA08A_EIC_NMI ((PIN_PA08A_EIC_NMI << 16) | MUX_PA08A_EIC_NMI) +#define PORT_PA08A_EIC_NMI (_UL_(1) << 8) +/* ========== PORT definition for SERCOM0 peripheral ========== */ +#define PIN_PA04D_SERCOM0_PAD0 _L_(4) /**< \brief SERCOM0 signal: PAD0 on PA04 mux D */ +#define MUX_PA04D_SERCOM0_PAD0 _L_(3) +#define PINMUX_PA04D_SERCOM0_PAD0 ((PIN_PA04D_SERCOM0_PAD0 << 16) | MUX_PA04D_SERCOM0_PAD0) +#define PORT_PA04D_SERCOM0_PAD0 (_UL_(1) << 4) +#define PIN_PA08C_SERCOM0_PAD0 _L_(8) /**< \brief SERCOM0 signal: PAD0 on PA08 mux C */ +#define MUX_PA08C_SERCOM0_PAD0 _L_(2) +#define PINMUX_PA08C_SERCOM0_PAD0 ((PIN_PA08C_SERCOM0_PAD0 << 16) | MUX_PA08C_SERCOM0_PAD0) +#define PORT_PA08C_SERCOM0_PAD0 (_UL_(1) << 8) +#define PIN_PA05D_SERCOM0_PAD1 _L_(5) /**< \brief SERCOM0 signal: PAD1 on PA05 mux D */ +#define MUX_PA05D_SERCOM0_PAD1 _L_(3) +#define PINMUX_PA05D_SERCOM0_PAD1 ((PIN_PA05D_SERCOM0_PAD1 << 16) | MUX_PA05D_SERCOM0_PAD1) +#define PORT_PA05D_SERCOM0_PAD1 (_UL_(1) << 5) +#define PIN_PA09C_SERCOM0_PAD1 _L_(9) /**< \brief SERCOM0 signal: PAD1 on PA09 mux C */ +#define MUX_PA09C_SERCOM0_PAD1 _L_(2) +#define PINMUX_PA09C_SERCOM0_PAD1 ((PIN_PA09C_SERCOM0_PAD1 << 16) | MUX_PA09C_SERCOM0_PAD1) +#define PORT_PA09C_SERCOM0_PAD1 (_UL_(1) << 9) +#define PIN_PA06D_SERCOM0_PAD2 _L_(6) /**< \brief SERCOM0 signal: PAD2 on PA06 mux D */ +#define MUX_PA06D_SERCOM0_PAD2 _L_(3) +#define PINMUX_PA06D_SERCOM0_PAD2 ((PIN_PA06D_SERCOM0_PAD2 << 16) | MUX_PA06D_SERCOM0_PAD2) +#define PORT_PA06D_SERCOM0_PAD2 (_UL_(1) << 6) +#define PIN_PA10C_SERCOM0_PAD2 _L_(10) /**< \brief SERCOM0 signal: PAD2 on PA10 mux C */ +#define MUX_PA10C_SERCOM0_PAD2 _L_(2) +#define PINMUX_PA10C_SERCOM0_PAD2 ((PIN_PA10C_SERCOM0_PAD2 << 16) | MUX_PA10C_SERCOM0_PAD2) +#define PORT_PA10C_SERCOM0_PAD2 (_UL_(1) << 10) +#define PIN_PA07D_SERCOM0_PAD3 _L_(7) /**< \brief SERCOM0 signal: PAD3 on PA07 mux D */ +#define MUX_PA07D_SERCOM0_PAD3 _L_(3) +#define PINMUX_PA07D_SERCOM0_PAD3 ((PIN_PA07D_SERCOM0_PAD3 << 16) | MUX_PA07D_SERCOM0_PAD3) +#define PORT_PA07D_SERCOM0_PAD3 (_UL_(1) << 7) +#define PIN_PA11C_SERCOM0_PAD3 _L_(11) /**< \brief SERCOM0 signal: PAD3 on PA11 mux C */ +#define MUX_PA11C_SERCOM0_PAD3 _L_(2) +#define PINMUX_PA11C_SERCOM0_PAD3 ((PIN_PA11C_SERCOM0_PAD3 << 16) | MUX_PA11C_SERCOM0_PAD3) +#define PORT_PA11C_SERCOM0_PAD3 (_UL_(1) << 11) +/* ========== PORT definition for SERCOM1 peripheral ========== */ +#define PIN_PA00D_SERCOM1_PAD0 _L_(0) /**< \brief SERCOM1 signal: PAD0 on PA00 mux D */ +#define MUX_PA00D_SERCOM1_PAD0 _L_(3) +#define PINMUX_PA00D_SERCOM1_PAD0 ((PIN_PA00D_SERCOM1_PAD0 << 16) | MUX_PA00D_SERCOM1_PAD0) +#define PORT_PA00D_SERCOM1_PAD0 (_UL_(1) << 0) +#define PIN_PA16C_SERCOM1_PAD0 _L_(16) /**< \brief SERCOM1 signal: PAD0 on PA16 mux C */ +#define MUX_PA16C_SERCOM1_PAD0 _L_(2) +#define PINMUX_PA16C_SERCOM1_PAD0 ((PIN_PA16C_SERCOM1_PAD0 << 16) | MUX_PA16C_SERCOM1_PAD0) +#define PORT_PA16C_SERCOM1_PAD0 (_UL_(1) << 16) +#define PIN_PA01D_SERCOM1_PAD1 _L_(1) /**< \brief SERCOM1 signal: PAD1 on PA01 mux D */ +#define MUX_PA01D_SERCOM1_PAD1 _L_(3) +#define PINMUX_PA01D_SERCOM1_PAD1 ((PIN_PA01D_SERCOM1_PAD1 << 16) | MUX_PA01D_SERCOM1_PAD1) +#define PORT_PA01D_SERCOM1_PAD1 (_UL_(1) << 1) +#define PIN_PA17C_SERCOM1_PAD1 _L_(17) /**< \brief SERCOM1 signal: PAD1 on PA17 mux C */ +#define MUX_PA17C_SERCOM1_PAD1 _L_(2) +#define PINMUX_PA17C_SERCOM1_PAD1 ((PIN_PA17C_SERCOM1_PAD1 << 16) | MUX_PA17C_SERCOM1_PAD1) +#define PORT_PA17C_SERCOM1_PAD1 (_UL_(1) << 17) +#define PIN_PA30D_SERCOM1_PAD2 _L_(30) /**< \brief SERCOM1 signal: PAD2 on PA30 mux D */ +#define MUX_PA30D_SERCOM1_PAD2 _L_(3) +#define PINMUX_PA30D_SERCOM1_PAD2 ((PIN_PA30D_SERCOM1_PAD2 << 16) | MUX_PA30D_SERCOM1_PAD2) +#define PORT_PA30D_SERCOM1_PAD2 (_UL_(1) << 30) +#define PIN_PA18C_SERCOM1_PAD2 _L_(18) /**< \brief SERCOM1 signal: PAD2 on PA18 mux C */ +#define MUX_PA18C_SERCOM1_PAD2 _L_(2) +#define PINMUX_PA18C_SERCOM1_PAD2 ((PIN_PA18C_SERCOM1_PAD2 << 16) | MUX_PA18C_SERCOM1_PAD2) +#define PORT_PA18C_SERCOM1_PAD2 (_UL_(1) << 18) +#define PIN_PB22C_SERCOM1_PAD2 _L_(54) /**< \brief SERCOM1 signal: PAD2 on PB22 mux C */ +#define MUX_PB22C_SERCOM1_PAD2 _L_(2) +#define PINMUX_PB22C_SERCOM1_PAD2 ((PIN_PB22C_SERCOM1_PAD2 << 16) | MUX_PB22C_SERCOM1_PAD2) +#define PORT_PB22C_SERCOM1_PAD2 (_UL_(1) << 22) +#define PIN_PA31D_SERCOM1_PAD3 _L_(31) /**< \brief SERCOM1 signal: PAD3 on PA31 mux D */ +#define MUX_PA31D_SERCOM1_PAD3 _L_(3) +#define PINMUX_PA31D_SERCOM1_PAD3 ((PIN_PA31D_SERCOM1_PAD3 << 16) | MUX_PA31D_SERCOM1_PAD3) +#define PORT_PA31D_SERCOM1_PAD3 (_UL_(1) << 31) +#define PIN_PA19C_SERCOM1_PAD3 _L_(19) /**< \brief SERCOM1 signal: PAD3 on PA19 mux C */ +#define MUX_PA19C_SERCOM1_PAD3 _L_(2) +#define PINMUX_PA19C_SERCOM1_PAD3 ((PIN_PA19C_SERCOM1_PAD3 << 16) | MUX_PA19C_SERCOM1_PAD3) +#define PORT_PA19C_SERCOM1_PAD3 (_UL_(1) << 19) +#define PIN_PB23C_SERCOM1_PAD3 _L_(55) /**< \brief SERCOM1 signal: PAD3 on PB23 mux C */ +#define MUX_PB23C_SERCOM1_PAD3 _L_(2) +#define PINMUX_PB23C_SERCOM1_PAD3 ((PIN_PB23C_SERCOM1_PAD3 << 16) | MUX_PB23C_SERCOM1_PAD3) +#define PORT_PB23C_SERCOM1_PAD3 (_UL_(1) << 23) +/* ========== PORT definition for TC0 peripheral ========== */ +#define PIN_PA04E_TC0_WO0 _L_(4) /**< \brief TC0 signal: WO0 on PA04 mux E */ +#define MUX_PA04E_TC0_WO0 _L_(4) +#define PINMUX_PA04E_TC0_WO0 ((PIN_PA04E_TC0_WO0 << 16) | MUX_PA04E_TC0_WO0) +#define PORT_PA04E_TC0_WO0 (_UL_(1) << 4) +#define PIN_PA08E_TC0_WO0 _L_(8) /**< \brief TC0 signal: WO0 on PA08 mux E */ +#define MUX_PA08E_TC0_WO0 _L_(4) +#define PINMUX_PA08E_TC0_WO0 ((PIN_PA08E_TC0_WO0 << 16) | MUX_PA08E_TC0_WO0) +#define PORT_PA08E_TC0_WO0 (_UL_(1) << 8) +#define PIN_PB30E_TC0_WO0 _L_(62) /**< \brief TC0 signal: WO0 on PB30 mux E */ +#define MUX_PB30E_TC0_WO0 _L_(4) +#define PINMUX_PB30E_TC0_WO0 ((PIN_PB30E_TC0_WO0 << 16) | MUX_PB30E_TC0_WO0) +#define PORT_PB30E_TC0_WO0 (_UL_(1) << 30) +#define PIN_PA05E_TC0_WO1 _L_(5) /**< \brief TC0 signal: WO1 on PA05 mux E */ +#define MUX_PA05E_TC0_WO1 _L_(4) +#define PINMUX_PA05E_TC0_WO1 ((PIN_PA05E_TC0_WO1 << 16) | MUX_PA05E_TC0_WO1) +#define PORT_PA05E_TC0_WO1 (_UL_(1) << 5) +#define PIN_PA09E_TC0_WO1 _L_(9) /**< \brief TC0 signal: WO1 on PA09 mux E */ +#define MUX_PA09E_TC0_WO1 _L_(4) +#define PINMUX_PA09E_TC0_WO1 ((PIN_PA09E_TC0_WO1 << 16) | MUX_PA09E_TC0_WO1) +#define PORT_PA09E_TC0_WO1 (_UL_(1) << 9) +#define PIN_PB31E_TC0_WO1 _L_(63) /**< \brief TC0 signal: WO1 on PB31 mux E */ +#define MUX_PB31E_TC0_WO1 _L_(4) +#define PINMUX_PB31E_TC0_WO1 ((PIN_PB31E_TC0_WO1 << 16) | MUX_PB31E_TC0_WO1) +#define PORT_PB31E_TC0_WO1 (_UL_(1) << 31) +/* ========== PORT definition for TC1 peripheral ========== */ +#define PIN_PA06E_TC1_WO0 _L_(6) /**< \brief TC1 signal: WO0 on PA06 mux E */ +#define MUX_PA06E_TC1_WO0 _L_(4) +#define PINMUX_PA06E_TC1_WO0 ((PIN_PA06E_TC1_WO0 << 16) | MUX_PA06E_TC1_WO0) +#define PORT_PA06E_TC1_WO0 (_UL_(1) << 6) +#define PIN_PA10E_TC1_WO0 _L_(10) /**< \brief TC1 signal: WO0 on PA10 mux E */ +#define MUX_PA10E_TC1_WO0 _L_(4) +#define PINMUX_PA10E_TC1_WO0 ((PIN_PA10E_TC1_WO0 << 16) | MUX_PA10E_TC1_WO0) +#define PORT_PA10E_TC1_WO0 (_UL_(1) << 10) +#define PIN_PA07E_TC1_WO1 _L_(7) /**< \brief TC1 signal: WO1 on PA07 mux E */ +#define MUX_PA07E_TC1_WO1 _L_(4) +#define PINMUX_PA07E_TC1_WO1 ((PIN_PA07E_TC1_WO1 << 16) | MUX_PA07E_TC1_WO1) +#define PORT_PA07E_TC1_WO1 (_UL_(1) << 7) +#define PIN_PA11E_TC1_WO1 _L_(11) /**< \brief TC1 signal: WO1 on PA11 mux E */ +#define MUX_PA11E_TC1_WO1 _L_(4) +#define PINMUX_PA11E_TC1_WO1 ((PIN_PA11E_TC1_WO1 << 16) | MUX_PA11E_TC1_WO1) +#define PORT_PA11E_TC1_WO1 (_UL_(1) << 11) +/* ========== PORT definition for USB peripheral ========== */ +#define PIN_PA24H_USB_DM _L_(24) /**< \brief USB signal: DM on PA24 mux H */ +#define MUX_PA24H_USB_DM _L_(7) +#define PINMUX_PA24H_USB_DM ((PIN_PA24H_USB_DM << 16) | MUX_PA24H_USB_DM) +#define PORT_PA24H_USB_DM (_UL_(1) << 24) +#define PIN_PA25H_USB_DP _L_(25) /**< \brief USB signal: DP on PA25 mux H */ +#define MUX_PA25H_USB_DP _L_(7) +#define PINMUX_PA25H_USB_DP ((PIN_PA25H_USB_DP << 16) | MUX_PA25H_USB_DP) +#define PORT_PA25H_USB_DP (_UL_(1) << 25) +#define PIN_PA23H_USB_SOF_1KHZ _L_(23) /**< \brief USB signal: SOF_1KHZ on PA23 mux H */ +#define MUX_PA23H_USB_SOF_1KHZ _L_(7) +#define PINMUX_PA23H_USB_SOF_1KHZ ((PIN_PA23H_USB_SOF_1KHZ << 16) | MUX_PA23H_USB_SOF_1KHZ) +#define PORT_PA23H_USB_SOF_1KHZ (_UL_(1) << 23) +#define PIN_PB22H_USB_SOF_1KHZ _L_(54) /**< \brief USB signal: SOF_1KHZ on PB22 mux H */ +#define MUX_PB22H_USB_SOF_1KHZ _L_(7) +#define PINMUX_PB22H_USB_SOF_1KHZ ((PIN_PB22H_USB_SOF_1KHZ << 16) | MUX_PB22H_USB_SOF_1KHZ) +#define PORT_PB22H_USB_SOF_1KHZ (_UL_(1) << 22) +/* ========== PORT definition for SERCOM2 peripheral ========== */ +#define PIN_PA09D_SERCOM2_PAD0 _L_(9) /**< \brief SERCOM2 signal: PAD0 on PA09 mux D */ +#define MUX_PA09D_SERCOM2_PAD0 _L_(3) +#define PINMUX_PA09D_SERCOM2_PAD0 ((PIN_PA09D_SERCOM2_PAD0 << 16) | MUX_PA09D_SERCOM2_PAD0) +#define PORT_PA09D_SERCOM2_PAD0 (_UL_(1) << 9) +#define PIN_PA12C_SERCOM2_PAD0 _L_(12) /**< \brief SERCOM2 signal: PAD0 on PA12 mux C */ +#define MUX_PA12C_SERCOM2_PAD0 _L_(2) +#define PINMUX_PA12C_SERCOM2_PAD0 ((PIN_PA12C_SERCOM2_PAD0 << 16) | MUX_PA12C_SERCOM2_PAD0) +#define PORT_PA12C_SERCOM2_PAD0 (_UL_(1) << 12) +#define PIN_PA08D_SERCOM2_PAD1 _L_(8) /**< \brief SERCOM2 signal: PAD1 on PA08 mux D */ +#define MUX_PA08D_SERCOM2_PAD1 _L_(3) +#define PINMUX_PA08D_SERCOM2_PAD1 ((PIN_PA08D_SERCOM2_PAD1 << 16) | MUX_PA08D_SERCOM2_PAD1) +#define PORT_PA08D_SERCOM2_PAD1 (_UL_(1) << 8) +#define PIN_PA13C_SERCOM2_PAD1 _L_(13) /**< \brief SERCOM2 signal: PAD1 on PA13 mux C */ +#define MUX_PA13C_SERCOM2_PAD1 _L_(2) +#define PINMUX_PA13C_SERCOM2_PAD1 ((PIN_PA13C_SERCOM2_PAD1 << 16) | MUX_PA13C_SERCOM2_PAD1) +#define PORT_PA13C_SERCOM2_PAD1 (_UL_(1) << 13) +#define PIN_PA10D_SERCOM2_PAD2 _L_(10) /**< \brief SERCOM2 signal: PAD2 on PA10 mux D */ +#define MUX_PA10D_SERCOM2_PAD2 _L_(3) +#define PINMUX_PA10D_SERCOM2_PAD2 ((PIN_PA10D_SERCOM2_PAD2 << 16) | MUX_PA10D_SERCOM2_PAD2) +#define PORT_PA10D_SERCOM2_PAD2 (_UL_(1) << 10) +#define PIN_PA14C_SERCOM2_PAD2 _L_(14) /**< \brief SERCOM2 signal: PAD2 on PA14 mux C */ +#define MUX_PA14C_SERCOM2_PAD2 _L_(2) +#define PINMUX_PA14C_SERCOM2_PAD2 ((PIN_PA14C_SERCOM2_PAD2 << 16) | MUX_PA14C_SERCOM2_PAD2) +#define PORT_PA14C_SERCOM2_PAD2 (_UL_(1) << 14) +#define PIN_PA11D_SERCOM2_PAD3 _L_(11) /**< \brief SERCOM2 signal: PAD3 on PA11 mux D */ +#define MUX_PA11D_SERCOM2_PAD3 _L_(3) +#define PINMUX_PA11D_SERCOM2_PAD3 ((PIN_PA11D_SERCOM2_PAD3 << 16) | MUX_PA11D_SERCOM2_PAD3) +#define PORT_PA11D_SERCOM2_PAD3 (_UL_(1) << 11) +#define PIN_PA15C_SERCOM2_PAD3 _L_(15) /**< \brief SERCOM2 signal: PAD3 on PA15 mux C */ +#define MUX_PA15C_SERCOM2_PAD3 _L_(2) +#define PINMUX_PA15C_SERCOM2_PAD3 ((PIN_PA15C_SERCOM2_PAD3 << 16) | MUX_PA15C_SERCOM2_PAD3) +#define PORT_PA15C_SERCOM2_PAD3 (_UL_(1) << 15) +/* ========== PORT definition for SERCOM3 peripheral ========== */ +#define PIN_PA17D_SERCOM3_PAD0 _L_(17) /**< \brief SERCOM3 signal: PAD0 on PA17 mux D */ +#define MUX_PA17D_SERCOM3_PAD0 _L_(3) +#define PINMUX_PA17D_SERCOM3_PAD0 ((PIN_PA17D_SERCOM3_PAD0 << 16) | MUX_PA17D_SERCOM3_PAD0) +#define PORT_PA17D_SERCOM3_PAD0 (_UL_(1) << 17) +#define PIN_PA22C_SERCOM3_PAD0 _L_(22) /**< \brief SERCOM3 signal: PAD0 on PA22 mux C */ +#define MUX_PA22C_SERCOM3_PAD0 _L_(2) +#define PINMUX_PA22C_SERCOM3_PAD0 ((PIN_PA22C_SERCOM3_PAD0 << 16) | MUX_PA22C_SERCOM3_PAD0) +#define PORT_PA22C_SERCOM3_PAD0 (_UL_(1) << 22) +#define PIN_PA16D_SERCOM3_PAD1 _L_(16) /**< \brief SERCOM3 signal: PAD1 on PA16 mux D */ +#define MUX_PA16D_SERCOM3_PAD1 _L_(3) +#define PINMUX_PA16D_SERCOM3_PAD1 ((PIN_PA16D_SERCOM3_PAD1 << 16) | MUX_PA16D_SERCOM3_PAD1) +#define PORT_PA16D_SERCOM3_PAD1 (_UL_(1) << 16) +#define PIN_PA23C_SERCOM3_PAD1 _L_(23) /**< \brief SERCOM3 signal: PAD1 on PA23 mux C */ +#define MUX_PA23C_SERCOM3_PAD1 _L_(2) +#define PINMUX_PA23C_SERCOM3_PAD1 ((PIN_PA23C_SERCOM3_PAD1 << 16) | MUX_PA23C_SERCOM3_PAD1) +#define PORT_PA23C_SERCOM3_PAD1 (_UL_(1) << 23) +#define PIN_PA18D_SERCOM3_PAD2 _L_(18) /**< \brief SERCOM3 signal: PAD2 on PA18 mux D */ +#define MUX_PA18D_SERCOM3_PAD2 _L_(3) +#define PINMUX_PA18D_SERCOM3_PAD2 ((PIN_PA18D_SERCOM3_PAD2 << 16) | MUX_PA18D_SERCOM3_PAD2) +#define PORT_PA18D_SERCOM3_PAD2 (_UL_(1) << 18) +#define PIN_PA20D_SERCOM3_PAD2 _L_(20) /**< \brief SERCOM3 signal: PAD2 on PA20 mux D */ +#define MUX_PA20D_SERCOM3_PAD2 _L_(3) +#define PINMUX_PA20D_SERCOM3_PAD2 ((PIN_PA20D_SERCOM3_PAD2 << 16) | MUX_PA20D_SERCOM3_PAD2) +#define PORT_PA20D_SERCOM3_PAD2 (_UL_(1) << 20) +#define PIN_PA24C_SERCOM3_PAD2 _L_(24) /**< \brief SERCOM3 signal: PAD2 on PA24 mux C */ +#define MUX_PA24C_SERCOM3_PAD2 _L_(2) +#define PINMUX_PA24C_SERCOM3_PAD2 ((PIN_PA24C_SERCOM3_PAD2 << 16) | MUX_PA24C_SERCOM3_PAD2) +#define PORT_PA24C_SERCOM3_PAD2 (_UL_(1) << 24) +#define PIN_PA19D_SERCOM3_PAD3 _L_(19) /**< \brief SERCOM3 signal: PAD3 on PA19 mux D */ +#define MUX_PA19D_SERCOM3_PAD3 _L_(3) +#define PINMUX_PA19D_SERCOM3_PAD3 ((PIN_PA19D_SERCOM3_PAD3 << 16) | MUX_PA19D_SERCOM3_PAD3) +#define PORT_PA19D_SERCOM3_PAD3 (_UL_(1) << 19) +#define PIN_PA21D_SERCOM3_PAD3 _L_(21) /**< \brief SERCOM3 signal: PAD3 on PA21 mux D */ +#define MUX_PA21D_SERCOM3_PAD3 _L_(3) +#define PINMUX_PA21D_SERCOM3_PAD3 ((PIN_PA21D_SERCOM3_PAD3 << 16) | MUX_PA21D_SERCOM3_PAD3) +#define PORT_PA21D_SERCOM3_PAD3 (_UL_(1) << 21) +#define PIN_PA25C_SERCOM3_PAD3 _L_(25) /**< \brief SERCOM3 signal: PAD3 on PA25 mux C */ +#define MUX_PA25C_SERCOM3_PAD3 _L_(2) +#define PINMUX_PA25C_SERCOM3_PAD3 ((PIN_PA25C_SERCOM3_PAD3 << 16) | MUX_PA25C_SERCOM3_PAD3) +#define PORT_PA25C_SERCOM3_PAD3 (_UL_(1) << 25) +/* ========== PORT definition for TCC0 peripheral ========== */ +#define PIN_PA20G_TCC0_WO0 _L_(20) /**< \brief TCC0 signal: WO0 on PA20 mux G */ +#define MUX_PA20G_TCC0_WO0 _L_(6) +#define PINMUX_PA20G_TCC0_WO0 ((PIN_PA20G_TCC0_WO0 << 16) | MUX_PA20G_TCC0_WO0) +#define PORT_PA20G_TCC0_WO0 (_UL_(1) << 20) +#define PIN_PB12G_TCC0_WO0 _L_(44) /**< \brief TCC0 signal: WO0 on PB12 mux G */ +#define MUX_PB12G_TCC0_WO0 _L_(6) +#define PINMUX_PB12G_TCC0_WO0 ((PIN_PB12G_TCC0_WO0 << 16) | MUX_PB12G_TCC0_WO0) +#define PORT_PB12G_TCC0_WO0 (_UL_(1) << 12) +#define PIN_PA08F_TCC0_WO0 _L_(8) /**< \brief TCC0 signal: WO0 on PA08 mux F */ +#define MUX_PA08F_TCC0_WO0 _L_(5) +#define PINMUX_PA08F_TCC0_WO0 ((PIN_PA08F_TCC0_WO0 << 16) | MUX_PA08F_TCC0_WO0) +#define PORT_PA08F_TCC0_WO0 (_UL_(1) << 8) +#define PIN_PA21G_TCC0_WO1 _L_(21) /**< \brief TCC0 signal: WO1 on PA21 mux G */ +#define MUX_PA21G_TCC0_WO1 _L_(6) +#define PINMUX_PA21G_TCC0_WO1 ((PIN_PA21G_TCC0_WO1 << 16) | MUX_PA21G_TCC0_WO1) +#define PORT_PA21G_TCC0_WO1 (_UL_(1) << 21) +#define PIN_PB13G_TCC0_WO1 _L_(45) /**< \brief TCC0 signal: WO1 on PB13 mux G */ +#define MUX_PB13G_TCC0_WO1 _L_(6) +#define PINMUX_PB13G_TCC0_WO1 ((PIN_PB13G_TCC0_WO1 << 16) | MUX_PB13G_TCC0_WO1) +#define PORT_PB13G_TCC0_WO1 (_UL_(1) << 13) +#define PIN_PA09F_TCC0_WO1 _L_(9) /**< \brief TCC0 signal: WO1 on PA09 mux F */ +#define MUX_PA09F_TCC0_WO1 _L_(5) +#define PINMUX_PA09F_TCC0_WO1 ((PIN_PA09F_TCC0_WO1 << 16) | MUX_PA09F_TCC0_WO1) +#define PORT_PA09F_TCC0_WO1 (_UL_(1) << 9) +#define PIN_PA22G_TCC0_WO2 _L_(22) /**< \brief TCC0 signal: WO2 on PA22 mux G */ +#define MUX_PA22G_TCC0_WO2 _L_(6) +#define PINMUX_PA22G_TCC0_WO2 ((PIN_PA22G_TCC0_WO2 << 16) | MUX_PA22G_TCC0_WO2) +#define PORT_PA22G_TCC0_WO2 (_UL_(1) << 22) +#define PIN_PB14G_TCC0_WO2 _L_(46) /**< \brief TCC0 signal: WO2 on PB14 mux G */ +#define MUX_PB14G_TCC0_WO2 _L_(6) +#define PINMUX_PB14G_TCC0_WO2 ((PIN_PB14G_TCC0_WO2 << 16) | MUX_PB14G_TCC0_WO2) +#define PORT_PB14G_TCC0_WO2 (_UL_(1) << 14) +#define PIN_PA10F_TCC0_WO2 _L_(10) /**< \brief TCC0 signal: WO2 on PA10 mux F */ +#define MUX_PA10F_TCC0_WO2 _L_(5) +#define PINMUX_PA10F_TCC0_WO2 ((PIN_PA10F_TCC0_WO2 << 16) | MUX_PA10F_TCC0_WO2) +#define PORT_PA10F_TCC0_WO2 (_UL_(1) << 10) +#define PIN_PA23G_TCC0_WO3 _L_(23) /**< \brief TCC0 signal: WO3 on PA23 mux G */ +#define MUX_PA23G_TCC0_WO3 _L_(6) +#define PINMUX_PA23G_TCC0_WO3 ((PIN_PA23G_TCC0_WO3 << 16) | MUX_PA23G_TCC0_WO3) +#define PORT_PA23G_TCC0_WO3 (_UL_(1) << 23) +#define PIN_PB15G_TCC0_WO3 _L_(47) /**< \brief TCC0 signal: WO3 on PB15 mux G */ +#define MUX_PB15G_TCC0_WO3 _L_(6) +#define PINMUX_PB15G_TCC0_WO3 ((PIN_PB15G_TCC0_WO3 << 16) | MUX_PB15G_TCC0_WO3) +#define PORT_PB15G_TCC0_WO3 (_UL_(1) << 15) +#define PIN_PA11F_TCC0_WO3 _L_(11) /**< \brief TCC0 signal: WO3 on PA11 mux F */ +#define MUX_PA11F_TCC0_WO3 _L_(5) +#define PINMUX_PA11F_TCC0_WO3 ((PIN_PA11F_TCC0_WO3 << 16) | MUX_PA11F_TCC0_WO3) +#define PORT_PA11F_TCC0_WO3 (_UL_(1) << 11) +#define PIN_PA16G_TCC0_WO4 _L_(16) /**< \brief TCC0 signal: WO4 on PA16 mux G */ +#define MUX_PA16G_TCC0_WO4 _L_(6) +#define PINMUX_PA16G_TCC0_WO4 ((PIN_PA16G_TCC0_WO4 << 16) | MUX_PA16G_TCC0_WO4) +#define PORT_PA16G_TCC0_WO4 (_UL_(1) << 16) +#define PIN_PB16G_TCC0_WO4 _L_(48) /**< \brief TCC0 signal: WO4 on PB16 mux G */ +#define MUX_PB16G_TCC0_WO4 _L_(6) +#define PINMUX_PB16G_TCC0_WO4 ((PIN_PB16G_TCC0_WO4 << 16) | MUX_PB16G_TCC0_WO4) +#define PORT_PB16G_TCC0_WO4 (_UL_(1) << 16) +#define PIN_PB10F_TCC0_WO4 _L_(42) /**< \brief TCC0 signal: WO4 on PB10 mux F */ +#define MUX_PB10F_TCC0_WO4 _L_(5) +#define PINMUX_PB10F_TCC0_WO4 ((PIN_PB10F_TCC0_WO4 << 16) | MUX_PB10F_TCC0_WO4) +#define PORT_PB10F_TCC0_WO4 (_UL_(1) << 10) +#define PIN_PA17G_TCC0_WO5 _L_(17) /**< \brief TCC0 signal: WO5 on PA17 mux G */ +#define MUX_PA17G_TCC0_WO5 _L_(6) +#define PINMUX_PA17G_TCC0_WO5 ((PIN_PA17G_TCC0_WO5 << 16) | MUX_PA17G_TCC0_WO5) +#define PORT_PA17G_TCC0_WO5 (_UL_(1) << 17) +#define PIN_PB17G_TCC0_WO5 _L_(49) /**< \brief TCC0 signal: WO5 on PB17 mux G */ +#define MUX_PB17G_TCC0_WO5 _L_(6) +#define PINMUX_PB17G_TCC0_WO5 ((PIN_PB17G_TCC0_WO5 << 16) | MUX_PB17G_TCC0_WO5) +#define PORT_PB17G_TCC0_WO5 (_UL_(1) << 17) +#define PIN_PB11F_TCC0_WO5 _L_(43) /**< \brief TCC0 signal: WO5 on PB11 mux F */ +#define MUX_PB11F_TCC0_WO5 _L_(5) +#define PINMUX_PB11F_TCC0_WO5 ((PIN_PB11F_TCC0_WO5 << 16) | MUX_PB11F_TCC0_WO5) +#define PORT_PB11F_TCC0_WO5 (_UL_(1) << 11) +#define PIN_PA18G_TCC0_WO6 _L_(18) /**< \brief TCC0 signal: WO6 on PA18 mux G */ +#define MUX_PA18G_TCC0_WO6 _L_(6) +#define PINMUX_PA18G_TCC0_WO6 ((PIN_PA18G_TCC0_WO6 << 16) | MUX_PA18G_TCC0_WO6) +#define PORT_PA18G_TCC0_WO6 (_UL_(1) << 18) +#define PIN_PB30G_TCC0_WO6 _L_(62) /**< \brief TCC0 signal: WO6 on PB30 mux G */ +#define MUX_PB30G_TCC0_WO6 _L_(6) +#define PINMUX_PB30G_TCC0_WO6 ((PIN_PB30G_TCC0_WO6 << 16) | MUX_PB30G_TCC0_WO6) +#define PORT_PB30G_TCC0_WO6 (_UL_(1) << 30) +#define PIN_PA12F_TCC0_WO6 _L_(12) /**< \brief TCC0 signal: WO6 on PA12 mux F */ +#define MUX_PA12F_TCC0_WO6 _L_(5) +#define PINMUX_PA12F_TCC0_WO6 ((PIN_PA12F_TCC0_WO6 << 16) | MUX_PA12F_TCC0_WO6) +#define PORT_PA12F_TCC0_WO6 (_UL_(1) << 12) +#define PIN_PA19G_TCC0_WO7 _L_(19) /**< \brief TCC0 signal: WO7 on PA19 mux G */ +#define MUX_PA19G_TCC0_WO7 _L_(6) +#define PINMUX_PA19G_TCC0_WO7 ((PIN_PA19G_TCC0_WO7 << 16) | MUX_PA19G_TCC0_WO7) +#define PORT_PA19G_TCC0_WO7 (_UL_(1) << 19) +#define PIN_PB31G_TCC0_WO7 _L_(63) /**< \brief TCC0 signal: WO7 on PB31 mux G */ +#define MUX_PB31G_TCC0_WO7 _L_(6) +#define PINMUX_PB31G_TCC0_WO7 ((PIN_PB31G_TCC0_WO7 << 16) | MUX_PB31G_TCC0_WO7) +#define PORT_PB31G_TCC0_WO7 (_UL_(1) << 31) +#define PIN_PA13F_TCC0_WO7 _L_(13) /**< \brief TCC0 signal: WO7 on PA13 mux F */ +#define MUX_PA13F_TCC0_WO7 _L_(5) +#define PINMUX_PA13F_TCC0_WO7 ((PIN_PA13F_TCC0_WO7 << 16) | MUX_PA13F_TCC0_WO7) +#define PORT_PA13F_TCC0_WO7 (_UL_(1) << 13) +/* ========== PORT definition for TCC1 peripheral ========== */ +#define PIN_PB10G_TCC1_WO0 _L_(42) /**< \brief TCC1 signal: WO0 on PB10 mux G */ +#define MUX_PB10G_TCC1_WO0 _L_(6) +#define PINMUX_PB10G_TCC1_WO0 ((PIN_PB10G_TCC1_WO0 << 16) | MUX_PB10G_TCC1_WO0) +#define PORT_PB10G_TCC1_WO0 (_UL_(1) << 10) +#define PIN_PA16F_TCC1_WO0 _L_(16) /**< \brief TCC1 signal: WO0 on PA16 mux F */ +#define MUX_PA16F_TCC1_WO0 _L_(5) +#define PINMUX_PA16F_TCC1_WO0 ((PIN_PA16F_TCC1_WO0 << 16) | MUX_PA16F_TCC1_WO0) +#define PORT_PA16F_TCC1_WO0 (_UL_(1) << 16) +#define PIN_PB11G_TCC1_WO1 _L_(43) /**< \brief TCC1 signal: WO1 on PB11 mux G */ +#define MUX_PB11G_TCC1_WO1 _L_(6) +#define PINMUX_PB11G_TCC1_WO1 ((PIN_PB11G_TCC1_WO1 << 16) | MUX_PB11G_TCC1_WO1) +#define PORT_PB11G_TCC1_WO1 (_UL_(1) << 11) +#define PIN_PA17F_TCC1_WO1 _L_(17) /**< \brief TCC1 signal: WO1 on PA17 mux F */ +#define MUX_PA17F_TCC1_WO1 _L_(5) +#define PINMUX_PA17F_TCC1_WO1 ((PIN_PA17F_TCC1_WO1 << 16) | MUX_PA17F_TCC1_WO1) +#define PORT_PA17F_TCC1_WO1 (_UL_(1) << 17) +#define PIN_PA12G_TCC1_WO2 _L_(12) /**< \brief TCC1 signal: WO2 on PA12 mux G */ +#define MUX_PA12G_TCC1_WO2 _L_(6) +#define PINMUX_PA12G_TCC1_WO2 ((PIN_PA12G_TCC1_WO2 << 16) | MUX_PA12G_TCC1_WO2) +#define PORT_PA12G_TCC1_WO2 (_UL_(1) << 12) +#define PIN_PA14G_TCC1_WO2 _L_(14) /**< \brief TCC1 signal: WO2 on PA14 mux G */ +#define MUX_PA14G_TCC1_WO2 _L_(6) +#define PINMUX_PA14G_TCC1_WO2 ((PIN_PA14G_TCC1_WO2 << 16) | MUX_PA14G_TCC1_WO2) +#define PORT_PA14G_TCC1_WO2 (_UL_(1) << 14) +#define PIN_PA18F_TCC1_WO2 _L_(18) /**< \brief TCC1 signal: WO2 on PA18 mux F */ +#define MUX_PA18F_TCC1_WO2 _L_(5) +#define PINMUX_PA18F_TCC1_WO2 ((PIN_PA18F_TCC1_WO2 << 16) | MUX_PA18F_TCC1_WO2) +#define PORT_PA18F_TCC1_WO2 (_UL_(1) << 18) +#define PIN_PA13G_TCC1_WO3 _L_(13) /**< \brief TCC1 signal: WO3 on PA13 mux G */ +#define MUX_PA13G_TCC1_WO3 _L_(6) +#define PINMUX_PA13G_TCC1_WO3 ((PIN_PA13G_TCC1_WO3 << 16) | MUX_PA13G_TCC1_WO3) +#define PORT_PA13G_TCC1_WO3 (_UL_(1) << 13) +#define PIN_PA15G_TCC1_WO3 _L_(15) /**< \brief TCC1 signal: WO3 on PA15 mux G */ +#define MUX_PA15G_TCC1_WO3 _L_(6) +#define PINMUX_PA15G_TCC1_WO3 ((PIN_PA15G_TCC1_WO3 << 16) | MUX_PA15G_TCC1_WO3) +#define PORT_PA15G_TCC1_WO3 (_UL_(1) << 15) +#define PIN_PA19F_TCC1_WO3 _L_(19) /**< \brief TCC1 signal: WO3 on PA19 mux F */ +#define MUX_PA19F_TCC1_WO3 _L_(5) +#define PINMUX_PA19F_TCC1_WO3 ((PIN_PA19F_TCC1_WO3 << 16) | MUX_PA19F_TCC1_WO3) +#define PORT_PA19F_TCC1_WO3 (_UL_(1) << 19) +#define PIN_PA08G_TCC1_WO4 _L_(8) /**< \brief TCC1 signal: WO4 on PA08 mux G */ +#define MUX_PA08G_TCC1_WO4 _L_(6) +#define PINMUX_PA08G_TCC1_WO4 ((PIN_PA08G_TCC1_WO4 << 16) | MUX_PA08G_TCC1_WO4) +#define PORT_PA08G_TCC1_WO4 (_UL_(1) << 8) +#define PIN_PA20F_TCC1_WO4 _L_(20) /**< \brief TCC1 signal: WO4 on PA20 mux F */ +#define MUX_PA20F_TCC1_WO4 _L_(5) +#define PINMUX_PA20F_TCC1_WO4 ((PIN_PA20F_TCC1_WO4 << 16) | MUX_PA20F_TCC1_WO4) +#define PORT_PA20F_TCC1_WO4 (_UL_(1) << 20) +#define PIN_PA09G_TCC1_WO5 _L_(9) /**< \brief TCC1 signal: WO5 on PA09 mux G */ +#define MUX_PA09G_TCC1_WO5 _L_(6) +#define PINMUX_PA09G_TCC1_WO5 ((PIN_PA09G_TCC1_WO5 << 16) | MUX_PA09G_TCC1_WO5) +#define PORT_PA09G_TCC1_WO5 (_UL_(1) << 9) +#define PIN_PA21F_TCC1_WO5 _L_(21) /**< \brief TCC1 signal: WO5 on PA21 mux F */ +#define MUX_PA21F_TCC1_WO5 _L_(5) +#define PINMUX_PA21F_TCC1_WO5 ((PIN_PA21F_TCC1_WO5 << 16) | MUX_PA21F_TCC1_WO5) +#define PORT_PA21F_TCC1_WO5 (_UL_(1) << 21) +#define PIN_PA10G_TCC1_WO6 _L_(10) /**< \brief TCC1 signal: WO6 on PA10 mux G */ +#define MUX_PA10G_TCC1_WO6 _L_(6) +#define PINMUX_PA10G_TCC1_WO6 ((PIN_PA10G_TCC1_WO6 << 16) | MUX_PA10G_TCC1_WO6) +#define PORT_PA10G_TCC1_WO6 (_UL_(1) << 10) +#define PIN_PA22F_TCC1_WO6 _L_(22) /**< \brief TCC1 signal: WO6 on PA22 mux F */ +#define MUX_PA22F_TCC1_WO6 _L_(5) +#define PINMUX_PA22F_TCC1_WO6 ((PIN_PA22F_TCC1_WO6 << 16) | MUX_PA22F_TCC1_WO6) +#define PORT_PA22F_TCC1_WO6 (_UL_(1) << 22) +#define PIN_PA11G_TCC1_WO7 _L_(11) /**< \brief TCC1 signal: WO7 on PA11 mux G */ +#define MUX_PA11G_TCC1_WO7 _L_(6) +#define PINMUX_PA11G_TCC1_WO7 ((PIN_PA11G_TCC1_WO7 << 16) | MUX_PA11G_TCC1_WO7) +#define PORT_PA11G_TCC1_WO7 (_UL_(1) << 11) +#define PIN_PA23F_TCC1_WO7 _L_(23) /**< \brief TCC1 signal: WO7 on PA23 mux F */ +#define MUX_PA23F_TCC1_WO7 _L_(5) +#define PINMUX_PA23F_TCC1_WO7 ((PIN_PA23F_TCC1_WO7 << 16) | MUX_PA23F_TCC1_WO7) +#define PORT_PA23F_TCC1_WO7 (_UL_(1) << 23) +/* ========== PORT definition for TC2 peripheral ========== */ +#define PIN_PA12E_TC2_WO0 _L_(12) /**< \brief TC2 signal: WO0 on PA12 mux E */ +#define MUX_PA12E_TC2_WO0 _L_(4) +#define PINMUX_PA12E_TC2_WO0 ((PIN_PA12E_TC2_WO0 << 16) | MUX_PA12E_TC2_WO0) +#define PORT_PA12E_TC2_WO0 (_UL_(1) << 12) +#define PIN_PA16E_TC2_WO0 _L_(16) /**< \brief TC2 signal: WO0 on PA16 mux E */ +#define MUX_PA16E_TC2_WO0 _L_(4) +#define PINMUX_PA16E_TC2_WO0 ((PIN_PA16E_TC2_WO0 << 16) | MUX_PA16E_TC2_WO0) +#define PORT_PA16E_TC2_WO0 (_UL_(1) << 16) +#define PIN_PA00E_TC2_WO0 _L_(0) /**< \brief TC2 signal: WO0 on PA00 mux E */ +#define MUX_PA00E_TC2_WO0 _L_(4) +#define PINMUX_PA00E_TC2_WO0 ((PIN_PA00E_TC2_WO0 << 16) | MUX_PA00E_TC2_WO0) +#define PORT_PA00E_TC2_WO0 (_UL_(1) << 0) +#define PIN_PA01E_TC2_WO1 _L_(1) /**< \brief TC2 signal: WO1 on PA01 mux E */ +#define MUX_PA01E_TC2_WO1 _L_(4) +#define PINMUX_PA01E_TC2_WO1 ((PIN_PA01E_TC2_WO1 << 16) | MUX_PA01E_TC2_WO1) +#define PORT_PA01E_TC2_WO1 (_UL_(1) << 1) +#define PIN_PA13E_TC2_WO1 _L_(13) /**< \brief TC2 signal: WO1 on PA13 mux E */ +#define MUX_PA13E_TC2_WO1 _L_(4) +#define PINMUX_PA13E_TC2_WO1 ((PIN_PA13E_TC2_WO1 << 16) | MUX_PA13E_TC2_WO1) +#define PORT_PA13E_TC2_WO1 (_UL_(1) << 13) +#define PIN_PA17E_TC2_WO1 _L_(17) /**< \brief TC2 signal: WO1 on PA17 mux E */ +#define MUX_PA17E_TC2_WO1 _L_(4) +#define PINMUX_PA17E_TC2_WO1 ((PIN_PA17E_TC2_WO1 << 16) | MUX_PA17E_TC2_WO1) +#define PORT_PA17E_TC2_WO1 (_UL_(1) << 17) +/* ========== PORT definition for TC3 peripheral ========== */ +#define PIN_PA18E_TC3_WO0 _L_(18) /**< \brief TC3 signal: WO0 on PA18 mux E */ +#define MUX_PA18E_TC3_WO0 _L_(4) +#define PINMUX_PA18E_TC3_WO0 ((PIN_PA18E_TC3_WO0 << 16) | MUX_PA18E_TC3_WO0) +#define PORT_PA18E_TC3_WO0 (_UL_(1) << 18) +#define PIN_PA14E_TC3_WO0 _L_(14) /**< \brief TC3 signal: WO0 on PA14 mux E */ +#define MUX_PA14E_TC3_WO0 _L_(4) +#define PINMUX_PA14E_TC3_WO0 ((PIN_PA14E_TC3_WO0 << 16) | MUX_PA14E_TC3_WO0) +#define PORT_PA14E_TC3_WO0 (_UL_(1) << 14) +#define PIN_PA15E_TC3_WO1 _L_(15) /**< \brief TC3 signal: WO1 on PA15 mux E */ +#define MUX_PA15E_TC3_WO1 _L_(4) +#define PINMUX_PA15E_TC3_WO1 ((PIN_PA15E_TC3_WO1 << 16) | MUX_PA15E_TC3_WO1) +#define PORT_PA15E_TC3_WO1 (_UL_(1) << 15) +#define PIN_PA19E_TC3_WO1 _L_(19) /**< \brief TC3 signal: WO1 on PA19 mux E */ +#define MUX_PA19E_TC3_WO1 _L_(4) +#define PINMUX_PA19E_TC3_WO1 ((PIN_PA19E_TC3_WO1 << 16) | MUX_PA19E_TC3_WO1) +#define PORT_PA19E_TC3_WO1 (_UL_(1) << 19) +/* ========== PORT definition for TAL peripheral ========== */ +#define PIN_PA27H_TAL_BRK _L_(27) /**< \brief TAL signal: BRK on PA27 mux H */ +#define MUX_PA27H_TAL_BRK _L_(7) +#define PINMUX_PA27H_TAL_BRK ((PIN_PA27H_TAL_BRK << 16) | MUX_PA27H_TAL_BRK) +#define PORT_PA27H_TAL_BRK (_UL_(1) << 27) +#define PIN_PB31H_TAL_BRK _L_(63) /**< \brief TAL signal: BRK on PB31 mux H */ +#define MUX_PB31H_TAL_BRK _L_(7) +#define PINMUX_PB31H_TAL_BRK ((PIN_PB31H_TAL_BRK << 16) | MUX_PB31H_TAL_BRK) +#define PORT_PB31H_TAL_BRK (_UL_(1) << 31) +/* ========== PORT definition for TCC2 peripheral ========== */ +#define PIN_PA14F_TCC2_WO0 _L_(14) /**< \brief TCC2 signal: WO0 on PA14 mux F */ +#define MUX_PA14F_TCC2_WO0 _L_(5) +#define PINMUX_PA14F_TCC2_WO0 ((PIN_PA14F_TCC2_WO0 << 16) | MUX_PA14F_TCC2_WO0) +#define PORT_PA14F_TCC2_WO0 (_UL_(1) << 14) +#define PIN_PA30F_TCC2_WO0 _L_(30) /**< \brief TCC2 signal: WO0 on PA30 mux F */ +#define MUX_PA30F_TCC2_WO0 _L_(5) +#define PINMUX_PA30F_TCC2_WO0 ((PIN_PA30F_TCC2_WO0 << 16) | MUX_PA30F_TCC2_WO0) +#define PORT_PA30F_TCC2_WO0 (_UL_(1) << 30) +#define PIN_PA15F_TCC2_WO1 _L_(15) /**< \brief TCC2 signal: WO1 on PA15 mux F */ +#define MUX_PA15F_TCC2_WO1 _L_(5) +#define PINMUX_PA15F_TCC2_WO1 ((PIN_PA15F_TCC2_WO1 << 16) | MUX_PA15F_TCC2_WO1) +#define PORT_PA15F_TCC2_WO1 (_UL_(1) << 15) +#define PIN_PA31F_TCC2_WO1 _L_(31) /**< \brief TCC2 signal: WO1 on PA31 mux F */ +#define MUX_PA31F_TCC2_WO1 _L_(5) +#define PINMUX_PA31F_TCC2_WO1 ((PIN_PA31F_TCC2_WO1 << 16) | MUX_PA31F_TCC2_WO1) +#define PORT_PA31F_TCC2_WO1 (_UL_(1) << 31) +#define PIN_PA24F_TCC2_WO2 _L_(24) /**< \brief TCC2 signal: WO2 on PA24 mux F */ +#define MUX_PA24F_TCC2_WO2 _L_(5) +#define PINMUX_PA24F_TCC2_WO2 ((PIN_PA24F_TCC2_WO2 << 16) | MUX_PA24F_TCC2_WO2) +#define PORT_PA24F_TCC2_WO2 (_UL_(1) << 24) +#define PIN_PB02F_TCC2_WO2 _L_(34) /**< \brief TCC2 signal: WO2 on PB02 mux F */ +#define MUX_PB02F_TCC2_WO2 _L_(5) +#define PINMUX_PB02F_TCC2_WO2 ((PIN_PB02F_TCC2_WO2 << 16) | MUX_PB02F_TCC2_WO2) +#define PORT_PB02F_TCC2_WO2 (_UL_(1) << 2) +/* ========== PORT definition for TCC3 peripheral ========== */ +#define PIN_PB12F_TCC3_WO0 _L_(44) /**< \brief TCC3 signal: WO0 on PB12 mux F */ +#define MUX_PB12F_TCC3_WO0 _L_(5) +#define PINMUX_PB12F_TCC3_WO0 ((PIN_PB12F_TCC3_WO0 << 16) | MUX_PB12F_TCC3_WO0) +#define PORT_PB12F_TCC3_WO0 (_UL_(1) << 12) +#define PIN_PB16F_TCC3_WO0 _L_(48) /**< \brief TCC3 signal: WO0 on PB16 mux F */ +#define MUX_PB16F_TCC3_WO0 _L_(5) +#define PINMUX_PB16F_TCC3_WO0 ((PIN_PB16F_TCC3_WO0 << 16) | MUX_PB16F_TCC3_WO0) +#define PORT_PB16F_TCC3_WO0 (_UL_(1) << 16) +#define PIN_PB13F_TCC3_WO1 _L_(45) /**< \brief TCC3 signal: WO1 on PB13 mux F */ +#define MUX_PB13F_TCC3_WO1 _L_(5) +#define PINMUX_PB13F_TCC3_WO1 ((PIN_PB13F_TCC3_WO1 << 16) | MUX_PB13F_TCC3_WO1) +#define PORT_PB13F_TCC3_WO1 (_UL_(1) << 13) +#define PIN_PB17F_TCC3_WO1 _L_(49) /**< \brief TCC3 signal: WO1 on PB17 mux F */ +#define MUX_PB17F_TCC3_WO1 _L_(5) +#define PINMUX_PB17F_TCC3_WO1 ((PIN_PB17F_TCC3_WO1 << 16) | MUX_PB17F_TCC3_WO1) +#define PORT_PB17F_TCC3_WO1 (_UL_(1) << 17) +/* ========== PORT definition for TC4 peripheral ========== */ +#define PIN_PA22E_TC4_WO0 _L_(22) /**< \brief TC4 signal: WO0 on PA22 mux E */ +#define MUX_PA22E_TC4_WO0 _L_(4) +#define PINMUX_PA22E_TC4_WO0 ((PIN_PA22E_TC4_WO0 << 16) | MUX_PA22E_TC4_WO0) +#define PORT_PA22E_TC4_WO0 (_UL_(1) << 22) +#define PIN_PB08E_TC4_WO0 _L_(40) /**< \brief TC4 signal: WO0 on PB08 mux E */ +#define MUX_PB08E_TC4_WO0 _L_(4) +#define PINMUX_PB08E_TC4_WO0 ((PIN_PB08E_TC4_WO0 << 16) | MUX_PB08E_TC4_WO0) +#define PORT_PB08E_TC4_WO0 (_UL_(1) << 8) +#define PIN_PB12E_TC4_WO0 _L_(44) /**< \brief TC4 signal: WO0 on PB12 mux E */ +#define MUX_PB12E_TC4_WO0 _L_(4) +#define PINMUX_PB12E_TC4_WO0 ((PIN_PB12E_TC4_WO0 << 16) | MUX_PB12E_TC4_WO0) +#define PORT_PB12E_TC4_WO0 (_UL_(1) << 12) +#define PIN_PA23E_TC4_WO1 _L_(23) /**< \brief TC4 signal: WO1 on PA23 mux E */ +#define MUX_PA23E_TC4_WO1 _L_(4) +#define PINMUX_PA23E_TC4_WO1 ((PIN_PA23E_TC4_WO1 << 16) | MUX_PA23E_TC4_WO1) +#define PORT_PA23E_TC4_WO1 (_UL_(1) << 23) +#define PIN_PB09E_TC4_WO1 _L_(41) /**< \brief TC4 signal: WO1 on PB09 mux E */ +#define MUX_PB09E_TC4_WO1 _L_(4) +#define PINMUX_PB09E_TC4_WO1 ((PIN_PB09E_TC4_WO1 << 16) | MUX_PB09E_TC4_WO1) +#define PORT_PB09E_TC4_WO1 (_UL_(1) << 9) +#define PIN_PB13E_TC4_WO1 _L_(45) /**< \brief TC4 signal: WO1 on PB13 mux E */ +#define MUX_PB13E_TC4_WO1 _L_(4) +#define PINMUX_PB13E_TC4_WO1 ((PIN_PB13E_TC4_WO1 << 16) | MUX_PB13E_TC4_WO1) +#define PORT_PB13E_TC4_WO1 (_UL_(1) << 13) +/* ========== PORT definition for TC5 peripheral ========== */ +#define PIN_PA24E_TC5_WO0 _L_(24) /**< \brief TC5 signal: WO0 on PA24 mux E */ +#define MUX_PA24E_TC5_WO0 _L_(4) +#define PINMUX_PA24E_TC5_WO0 ((PIN_PA24E_TC5_WO0 << 16) | MUX_PA24E_TC5_WO0) +#define PORT_PA24E_TC5_WO0 (_UL_(1) << 24) +#define PIN_PB10E_TC5_WO0 _L_(42) /**< \brief TC5 signal: WO0 on PB10 mux E */ +#define MUX_PB10E_TC5_WO0 _L_(4) +#define PINMUX_PB10E_TC5_WO0 ((PIN_PB10E_TC5_WO0 << 16) | MUX_PB10E_TC5_WO0) +#define PORT_PB10E_TC5_WO0 (_UL_(1) << 10) +#define PIN_PB14E_TC5_WO0 _L_(46) /**< \brief TC5 signal: WO0 on PB14 mux E */ +#define MUX_PB14E_TC5_WO0 _L_(4) +#define PINMUX_PB14E_TC5_WO0 ((PIN_PB14E_TC5_WO0 << 16) | MUX_PB14E_TC5_WO0) +#define PORT_PB14E_TC5_WO0 (_UL_(1) << 14) +#define PIN_PA25E_TC5_WO1 _L_(25) /**< \brief TC5 signal: WO1 on PA25 mux E */ +#define MUX_PA25E_TC5_WO1 _L_(4) +#define PINMUX_PA25E_TC5_WO1 ((PIN_PA25E_TC5_WO1 << 16) | MUX_PA25E_TC5_WO1) +#define PORT_PA25E_TC5_WO1 (_UL_(1) << 25) +#define PIN_PB11E_TC5_WO1 _L_(43) /**< \brief TC5 signal: WO1 on PB11 mux E */ +#define MUX_PB11E_TC5_WO1 _L_(4) +#define PINMUX_PB11E_TC5_WO1 ((PIN_PB11E_TC5_WO1 << 16) | MUX_PB11E_TC5_WO1) +#define PORT_PB11E_TC5_WO1 (_UL_(1) << 11) +#define PIN_PB15E_TC5_WO1 _L_(47) /**< \brief TC5 signal: WO1 on PB15 mux E */ +#define MUX_PB15E_TC5_WO1 _L_(4) +#define PINMUX_PB15E_TC5_WO1 ((PIN_PB15E_TC5_WO1 << 16) | MUX_PB15E_TC5_WO1) +#define PORT_PB15E_TC5_WO1 (_UL_(1) << 15) +/* ========== PORT definition for PDEC peripheral ========== */ +#define PIN_PB23G_PDEC_QDI0 _L_(55) /**< \brief PDEC signal: QDI0 on PB23 mux G */ +#define MUX_PB23G_PDEC_QDI0 _L_(6) +#define PINMUX_PB23G_PDEC_QDI0 ((PIN_PB23G_PDEC_QDI0 << 16) | MUX_PB23G_PDEC_QDI0) +#define PORT_PB23G_PDEC_QDI0 (_UL_(1) << 23) +#define PIN_PA24G_PDEC_QDI0 _L_(24) /**< \brief PDEC signal: QDI0 on PA24 mux G */ +#define MUX_PA24G_PDEC_QDI0 _L_(6) +#define PINMUX_PA24G_PDEC_QDI0 ((PIN_PA24G_PDEC_QDI0 << 16) | MUX_PA24G_PDEC_QDI0) +#define PORT_PA24G_PDEC_QDI0 (_UL_(1) << 24) +#define PIN_PA25G_PDEC_QDI1 _L_(25) /**< \brief PDEC signal: QDI1 on PA25 mux G */ +#define MUX_PA25G_PDEC_QDI1 _L_(6) +#define PINMUX_PA25G_PDEC_QDI1 ((PIN_PA25G_PDEC_QDI1 << 16) | MUX_PA25G_PDEC_QDI1) +#define PORT_PA25G_PDEC_QDI1 (_UL_(1) << 25) +#define PIN_PB22G_PDEC_QDI2 _L_(54) /**< \brief PDEC signal: QDI2 on PB22 mux G */ +#define MUX_PB22G_PDEC_QDI2 _L_(6) +#define PINMUX_PB22G_PDEC_QDI2 ((PIN_PB22G_PDEC_QDI2 << 16) | MUX_PB22G_PDEC_QDI2) +#define PORT_PB22G_PDEC_QDI2 (_UL_(1) << 22) +/* ========== PORT definition for AC peripheral ========== */ +#define PIN_PA04B_AC_AIN0 _L_(4) /**< \brief AC signal: AIN0 on PA04 mux B */ +#define MUX_PA04B_AC_AIN0 _L_(1) +#define PINMUX_PA04B_AC_AIN0 ((PIN_PA04B_AC_AIN0 << 16) | MUX_PA04B_AC_AIN0) +#define PORT_PA04B_AC_AIN0 (_UL_(1) << 4) +#define PIN_PA05B_AC_AIN1 _L_(5) /**< \brief AC signal: AIN1 on PA05 mux B */ +#define MUX_PA05B_AC_AIN1 _L_(1) +#define PINMUX_PA05B_AC_AIN1 ((PIN_PA05B_AC_AIN1 << 16) | MUX_PA05B_AC_AIN1) +#define PORT_PA05B_AC_AIN1 (_UL_(1) << 5) +#define PIN_PA06B_AC_AIN2 _L_(6) /**< \brief AC signal: AIN2 on PA06 mux B */ +#define MUX_PA06B_AC_AIN2 _L_(1) +#define PINMUX_PA06B_AC_AIN2 ((PIN_PA06B_AC_AIN2 << 16) | MUX_PA06B_AC_AIN2) +#define PORT_PA06B_AC_AIN2 (_UL_(1) << 6) +#define PIN_PA07B_AC_AIN3 _L_(7) /**< \brief AC signal: AIN3 on PA07 mux B */ +#define MUX_PA07B_AC_AIN3 _L_(1) +#define PINMUX_PA07B_AC_AIN3 ((PIN_PA07B_AC_AIN3 << 16) | MUX_PA07B_AC_AIN3) +#define PORT_PA07B_AC_AIN3 (_UL_(1) << 7) +#define PIN_PA12M_AC_CMP0 _L_(12) /**< \brief AC signal: CMP0 on PA12 mux M */ +#define MUX_PA12M_AC_CMP0 _L_(12) +#define PINMUX_PA12M_AC_CMP0 ((PIN_PA12M_AC_CMP0 << 16) | MUX_PA12M_AC_CMP0) +#define PORT_PA12M_AC_CMP0 (_UL_(1) << 12) +#define PIN_PA18M_AC_CMP0 _L_(18) /**< \brief AC signal: CMP0 on PA18 mux M */ +#define MUX_PA18M_AC_CMP0 _L_(12) +#define PINMUX_PA18M_AC_CMP0 ((PIN_PA18M_AC_CMP0 << 16) | MUX_PA18M_AC_CMP0) +#define PORT_PA18M_AC_CMP0 (_UL_(1) << 18) +#define PIN_PA13M_AC_CMP1 _L_(13) /**< \brief AC signal: CMP1 on PA13 mux M */ +#define MUX_PA13M_AC_CMP1 _L_(12) +#define PINMUX_PA13M_AC_CMP1 ((PIN_PA13M_AC_CMP1 << 16) | MUX_PA13M_AC_CMP1) +#define PORT_PA13M_AC_CMP1 (_UL_(1) << 13) +#define PIN_PA19M_AC_CMP1 _L_(19) /**< \brief AC signal: CMP1 on PA19 mux M */ +#define MUX_PA19M_AC_CMP1 _L_(12) +#define PINMUX_PA19M_AC_CMP1 ((PIN_PA19M_AC_CMP1 << 16) | MUX_PA19M_AC_CMP1) +#define PORT_PA19M_AC_CMP1 (_UL_(1) << 19) +/* ========== PORT definition for QSPI peripheral ========== */ +#define PIN_PB11H_QSPI_CS _L_(43) /**< \brief QSPI signal: CS on PB11 mux H */ +#define MUX_PB11H_QSPI_CS _L_(7) +#define PINMUX_PB11H_QSPI_CS ((PIN_PB11H_QSPI_CS << 16) | MUX_PB11H_QSPI_CS) +#define PORT_PB11H_QSPI_CS (_UL_(1) << 11) +#define PIN_PA08H_QSPI_DATA0 _L_(8) /**< \brief QSPI signal: DATA0 on PA08 mux H */ +#define MUX_PA08H_QSPI_DATA0 _L_(7) +#define PINMUX_PA08H_QSPI_DATA0 ((PIN_PA08H_QSPI_DATA0 << 16) | MUX_PA08H_QSPI_DATA0) +#define PORT_PA08H_QSPI_DATA0 (_UL_(1) << 8) +#define PIN_PA09H_QSPI_DATA1 _L_(9) /**< \brief QSPI signal: DATA1 on PA09 mux H */ +#define MUX_PA09H_QSPI_DATA1 _L_(7) +#define PINMUX_PA09H_QSPI_DATA1 ((PIN_PA09H_QSPI_DATA1 << 16) | MUX_PA09H_QSPI_DATA1) +#define PORT_PA09H_QSPI_DATA1 (_UL_(1) << 9) +#define PIN_PA10H_QSPI_DATA2 _L_(10) /**< \brief QSPI signal: DATA2 on PA10 mux H */ +#define MUX_PA10H_QSPI_DATA2 _L_(7) +#define PINMUX_PA10H_QSPI_DATA2 ((PIN_PA10H_QSPI_DATA2 << 16) | MUX_PA10H_QSPI_DATA2) +#define PORT_PA10H_QSPI_DATA2 (_UL_(1) << 10) +#define PIN_PA11H_QSPI_DATA3 _L_(11) /**< \brief QSPI signal: DATA3 on PA11 mux H */ +#define MUX_PA11H_QSPI_DATA3 _L_(7) +#define PINMUX_PA11H_QSPI_DATA3 ((PIN_PA11H_QSPI_DATA3 << 16) | MUX_PA11H_QSPI_DATA3) +#define PORT_PA11H_QSPI_DATA3 (_UL_(1) << 11) +#define PIN_PB10H_QSPI_SCK _L_(42) /**< \brief QSPI signal: SCK on PB10 mux H */ +#define MUX_PB10H_QSPI_SCK _L_(7) +#define PINMUX_PB10H_QSPI_SCK ((PIN_PB10H_QSPI_SCK << 16) | MUX_PB10H_QSPI_SCK) +#define PORT_PB10H_QSPI_SCK (_UL_(1) << 10) +/* ========== PORT definition for CCL peripheral ========== */ +#define PIN_PA04N_CCL_IN0 _L_(4) /**< \brief CCL signal: IN0 on PA04 mux N */ +#define MUX_PA04N_CCL_IN0 _L_(13) +#define PINMUX_PA04N_CCL_IN0 ((PIN_PA04N_CCL_IN0 << 16) | MUX_PA04N_CCL_IN0) +#define PORT_PA04N_CCL_IN0 (_UL_(1) << 4) +#define PIN_PA16N_CCL_IN0 _L_(16) /**< \brief CCL signal: IN0 on PA16 mux N */ +#define MUX_PA16N_CCL_IN0 _L_(13) +#define PINMUX_PA16N_CCL_IN0 ((PIN_PA16N_CCL_IN0 << 16) | MUX_PA16N_CCL_IN0) +#define PORT_PA16N_CCL_IN0 (_UL_(1) << 16) +#define PIN_PB22N_CCL_IN0 _L_(54) /**< \brief CCL signal: IN0 on PB22 mux N */ +#define MUX_PB22N_CCL_IN0 _L_(13) +#define PINMUX_PB22N_CCL_IN0 ((PIN_PB22N_CCL_IN0 << 16) | MUX_PB22N_CCL_IN0) +#define PORT_PB22N_CCL_IN0 (_UL_(1) << 22) +#define PIN_PA05N_CCL_IN1 _L_(5) /**< \brief CCL signal: IN1 on PA05 mux N */ +#define MUX_PA05N_CCL_IN1 _L_(13) +#define PINMUX_PA05N_CCL_IN1 ((PIN_PA05N_CCL_IN1 << 16) | MUX_PA05N_CCL_IN1) +#define PORT_PA05N_CCL_IN1 (_UL_(1) << 5) +#define PIN_PA17N_CCL_IN1 _L_(17) /**< \brief CCL signal: IN1 on PA17 mux N */ +#define MUX_PA17N_CCL_IN1 _L_(13) +#define PINMUX_PA17N_CCL_IN1 ((PIN_PA17N_CCL_IN1 << 16) | MUX_PA17N_CCL_IN1) +#define PORT_PA17N_CCL_IN1 (_UL_(1) << 17) +#define PIN_PB00N_CCL_IN1 _L_(32) /**< \brief CCL signal: IN1 on PB00 mux N */ +#define MUX_PB00N_CCL_IN1 _L_(13) +#define PINMUX_PB00N_CCL_IN1 ((PIN_PB00N_CCL_IN1 << 16) | MUX_PB00N_CCL_IN1) +#define PORT_PB00N_CCL_IN1 (_UL_(1) << 0) +#define PIN_PA06N_CCL_IN2 _L_(6) /**< \brief CCL signal: IN2 on PA06 mux N */ +#define MUX_PA06N_CCL_IN2 _L_(13) +#define PINMUX_PA06N_CCL_IN2 ((PIN_PA06N_CCL_IN2 << 16) | MUX_PA06N_CCL_IN2) +#define PORT_PA06N_CCL_IN2 (_UL_(1) << 6) +#define PIN_PA18N_CCL_IN2 _L_(18) /**< \brief CCL signal: IN2 on PA18 mux N */ +#define MUX_PA18N_CCL_IN2 _L_(13) +#define PINMUX_PA18N_CCL_IN2 ((PIN_PA18N_CCL_IN2 << 16) | MUX_PA18N_CCL_IN2) +#define PORT_PA18N_CCL_IN2 (_UL_(1) << 18) +#define PIN_PB01N_CCL_IN2 _L_(33) /**< \brief CCL signal: IN2 on PB01 mux N */ +#define MUX_PB01N_CCL_IN2 _L_(13) +#define PINMUX_PB01N_CCL_IN2 ((PIN_PB01N_CCL_IN2 << 16) | MUX_PB01N_CCL_IN2) +#define PORT_PB01N_CCL_IN2 (_UL_(1) << 1) +#define PIN_PA08N_CCL_IN3 _L_(8) /**< \brief CCL signal: IN3 on PA08 mux N */ +#define MUX_PA08N_CCL_IN3 _L_(13) +#define PINMUX_PA08N_CCL_IN3 ((PIN_PA08N_CCL_IN3 << 16) | MUX_PA08N_CCL_IN3) +#define PORT_PA08N_CCL_IN3 (_UL_(1) << 8) +#define PIN_PA30N_CCL_IN3 _L_(30) /**< \brief CCL signal: IN3 on PA30 mux N */ +#define MUX_PA30N_CCL_IN3 _L_(13) +#define PINMUX_PA30N_CCL_IN3 ((PIN_PA30N_CCL_IN3 << 16) | MUX_PA30N_CCL_IN3) +#define PORT_PA30N_CCL_IN3 (_UL_(1) << 30) +#define PIN_PA09N_CCL_IN4 _L_(9) /**< \brief CCL signal: IN4 on PA09 mux N */ +#define MUX_PA09N_CCL_IN4 _L_(13) +#define PINMUX_PA09N_CCL_IN4 ((PIN_PA09N_CCL_IN4 << 16) | MUX_PA09N_CCL_IN4) +#define PORT_PA09N_CCL_IN4 (_UL_(1) << 9) +#define PIN_PA10N_CCL_IN5 _L_(10) /**< \brief CCL signal: IN5 on PA10 mux N */ +#define MUX_PA10N_CCL_IN5 _L_(13) +#define PINMUX_PA10N_CCL_IN5 ((PIN_PA10N_CCL_IN5 << 16) | MUX_PA10N_CCL_IN5) +#define PORT_PA10N_CCL_IN5 (_UL_(1) << 10) +#define PIN_PA22N_CCL_IN6 _L_(22) /**< \brief CCL signal: IN6 on PA22 mux N */ +#define MUX_PA22N_CCL_IN6 _L_(13) +#define PINMUX_PA22N_CCL_IN6 ((PIN_PA22N_CCL_IN6 << 16) | MUX_PA22N_CCL_IN6) +#define PORT_PA22N_CCL_IN6 (_UL_(1) << 22) +#define PIN_PB06N_CCL_IN6 _L_(38) /**< \brief CCL signal: IN6 on PB06 mux N */ +#define MUX_PB06N_CCL_IN6 _L_(13) +#define PINMUX_PB06N_CCL_IN6 ((PIN_PB06N_CCL_IN6 << 16) | MUX_PB06N_CCL_IN6) +#define PORT_PB06N_CCL_IN6 (_UL_(1) << 6) +#define PIN_PA23N_CCL_IN7 _L_(23) /**< \brief CCL signal: IN7 on PA23 mux N */ +#define MUX_PA23N_CCL_IN7 _L_(13) +#define PINMUX_PA23N_CCL_IN7 ((PIN_PA23N_CCL_IN7 << 16) | MUX_PA23N_CCL_IN7) +#define PORT_PA23N_CCL_IN7 (_UL_(1) << 23) +#define PIN_PB07N_CCL_IN7 _L_(39) /**< \brief CCL signal: IN7 on PB07 mux N */ +#define MUX_PB07N_CCL_IN7 _L_(13) +#define PINMUX_PB07N_CCL_IN7 ((PIN_PB07N_CCL_IN7 << 16) | MUX_PB07N_CCL_IN7) +#define PORT_PB07N_CCL_IN7 (_UL_(1) << 7) +#define PIN_PA24N_CCL_IN8 _L_(24) /**< \brief CCL signal: IN8 on PA24 mux N */ +#define MUX_PA24N_CCL_IN8 _L_(13) +#define PINMUX_PA24N_CCL_IN8 ((PIN_PA24N_CCL_IN8 << 16) | MUX_PA24N_CCL_IN8) +#define PORT_PA24N_CCL_IN8 (_UL_(1) << 24) +#define PIN_PB08N_CCL_IN8 _L_(40) /**< \brief CCL signal: IN8 on PB08 mux N */ +#define MUX_PB08N_CCL_IN8 _L_(13) +#define PINMUX_PB08N_CCL_IN8 ((PIN_PB08N_CCL_IN8 << 16) | MUX_PB08N_CCL_IN8) +#define PORT_PB08N_CCL_IN8 (_UL_(1) << 8) +#define PIN_PB14N_CCL_IN9 _L_(46) /**< \brief CCL signal: IN9 on PB14 mux N */ +#define MUX_PB14N_CCL_IN9 _L_(13) +#define PINMUX_PB14N_CCL_IN9 ((PIN_PB14N_CCL_IN9 << 16) | MUX_PB14N_CCL_IN9) +#define PORT_PB14N_CCL_IN9 (_UL_(1) << 14) +#define PIN_PB15N_CCL_IN10 _L_(47) /**< \brief CCL signal: IN10 on PB15 mux N */ +#define MUX_PB15N_CCL_IN10 _L_(13) +#define PINMUX_PB15N_CCL_IN10 ((PIN_PB15N_CCL_IN10 << 16) | MUX_PB15N_CCL_IN10) +#define PORT_PB15N_CCL_IN10 (_UL_(1) << 15) +#define PIN_PB10N_CCL_IN11 _L_(42) /**< \brief CCL signal: IN11 on PB10 mux N */ +#define MUX_PB10N_CCL_IN11 _L_(13) +#define PINMUX_PB10N_CCL_IN11 ((PIN_PB10N_CCL_IN11 << 16) | MUX_PB10N_CCL_IN11) +#define PORT_PB10N_CCL_IN11 (_UL_(1) << 10) +#define PIN_PB16N_CCL_IN11 _L_(48) /**< \brief CCL signal: IN11 on PB16 mux N */ +#define MUX_PB16N_CCL_IN11 _L_(13) +#define PINMUX_PB16N_CCL_IN11 ((PIN_PB16N_CCL_IN11 << 16) | MUX_PB16N_CCL_IN11) +#define PORT_PB16N_CCL_IN11 (_UL_(1) << 16) +#define PIN_PA07N_CCL_OUT0 _L_(7) /**< \brief CCL signal: OUT0 on PA07 mux N */ +#define MUX_PA07N_CCL_OUT0 _L_(13) +#define PINMUX_PA07N_CCL_OUT0 ((PIN_PA07N_CCL_OUT0 << 16) | MUX_PA07N_CCL_OUT0) +#define PORT_PA07N_CCL_OUT0 (_UL_(1) << 7) +#define PIN_PA19N_CCL_OUT0 _L_(19) /**< \brief CCL signal: OUT0 on PA19 mux N */ +#define MUX_PA19N_CCL_OUT0 _L_(13) +#define PINMUX_PA19N_CCL_OUT0 ((PIN_PA19N_CCL_OUT0 << 16) | MUX_PA19N_CCL_OUT0) +#define PORT_PA19N_CCL_OUT0 (_UL_(1) << 19) +#define PIN_PB02N_CCL_OUT0 _L_(34) /**< \brief CCL signal: OUT0 on PB02 mux N */ +#define MUX_PB02N_CCL_OUT0 _L_(13) +#define PINMUX_PB02N_CCL_OUT0 ((PIN_PB02N_CCL_OUT0 << 16) | MUX_PB02N_CCL_OUT0) +#define PORT_PB02N_CCL_OUT0 (_UL_(1) << 2) +#define PIN_PB23N_CCL_OUT0 _L_(55) /**< \brief CCL signal: OUT0 on PB23 mux N */ +#define MUX_PB23N_CCL_OUT0 _L_(13) +#define PINMUX_PB23N_CCL_OUT0 ((PIN_PB23N_CCL_OUT0 << 16) | MUX_PB23N_CCL_OUT0) +#define PORT_PB23N_CCL_OUT0 (_UL_(1) << 23) +#define PIN_PA11N_CCL_OUT1 _L_(11) /**< \brief CCL signal: OUT1 on PA11 mux N */ +#define MUX_PA11N_CCL_OUT1 _L_(13) +#define PINMUX_PA11N_CCL_OUT1 ((PIN_PA11N_CCL_OUT1 << 16) | MUX_PA11N_CCL_OUT1) +#define PORT_PA11N_CCL_OUT1 (_UL_(1) << 11) +#define PIN_PA31N_CCL_OUT1 _L_(31) /**< \brief CCL signal: OUT1 on PA31 mux N */ +#define MUX_PA31N_CCL_OUT1 _L_(13) +#define PINMUX_PA31N_CCL_OUT1 ((PIN_PA31N_CCL_OUT1 << 16) | MUX_PA31N_CCL_OUT1) +#define PORT_PA31N_CCL_OUT1 (_UL_(1) << 31) +#define PIN_PB11N_CCL_OUT1 _L_(43) /**< \brief CCL signal: OUT1 on PB11 mux N */ +#define MUX_PB11N_CCL_OUT1 _L_(13) +#define PINMUX_PB11N_CCL_OUT1 ((PIN_PB11N_CCL_OUT1 << 16) | MUX_PB11N_CCL_OUT1) +#define PORT_PB11N_CCL_OUT1 (_UL_(1) << 11) +#define PIN_PA25N_CCL_OUT2 _L_(25) /**< \brief CCL signal: OUT2 on PA25 mux N */ +#define MUX_PA25N_CCL_OUT2 _L_(13) +#define PINMUX_PA25N_CCL_OUT2 ((PIN_PA25N_CCL_OUT2 << 16) | MUX_PA25N_CCL_OUT2) +#define PORT_PA25N_CCL_OUT2 (_UL_(1) << 25) +#define PIN_PB09N_CCL_OUT2 _L_(41) /**< \brief CCL signal: OUT2 on PB09 mux N */ +#define MUX_PB09N_CCL_OUT2 _L_(13) +#define PINMUX_PB09N_CCL_OUT2 ((PIN_PB09N_CCL_OUT2 << 16) | MUX_PB09N_CCL_OUT2) +#define PORT_PB09N_CCL_OUT2 (_UL_(1) << 9) +#define PIN_PB17N_CCL_OUT3 _L_(49) /**< \brief CCL signal: OUT3 on PB17 mux N */ +#define MUX_PB17N_CCL_OUT3 _L_(13) +#define PINMUX_PB17N_CCL_OUT3 ((PIN_PB17N_CCL_OUT3 << 16) | MUX_PB17N_CCL_OUT3) +#define PORT_PB17N_CCL_OUT3 (_UL_(1) << 17) +/* ========== PORT definition for SERCOM4 peripheral ========== */ +#define PIN_PA13D_SERCOM4_PAD0 _L_(13) /**< \brief SERCOM4 signal: PAD0 on PA13 mux D */ +#define MUX_PA13D_SERCOM4_PAD0 _L_(3) +#define PINMUX_PA13D_SERCOM4_PAD0 ((PIN_PA13D_SERCOM4_PAD0 << 16) | MUX_PA13D_SERCOM4_PAD0) +#define PORT_PA13D_SERCOM4_PAD0 (_UL_(1) << 13) +#define PIN_PB08D_SERCOM4_PAD0 _L_(40) /**< \brief SERCOM4 signal: PAD0 on PB08 mux D */ +#define MUX_PB08D_SERCOM4_PAD0 _L_(3) +#define PINMUX_PB08D_SERCOM4_PAD0 ((PIN_PB08D_SERCOM4_PAD0 << 16) | MUX_PB08D_SERCOM4_PAD0) +#define PORT_PB08D_SERCOM4_PAD0 (_UL_(1) << 8) +#define PIN_PB12C_SERCOM4_PAD0 _L_(44) /**< \brief SERCOM4 signal: PAD0 on PB12 mux C */ +#define MUX_PB12C_SERCOM4_PAD0 _L_(2) +#define PINMUX_PB12C_SERCOM4_PAD0 ((PIN_PB12C_SERCOM4_PAD0 << 16) | MUX_PB12C_SERCOM4_PAD0) +#define PORT_PB12C_SERCOM4_PAD0 (_UL_(1) << 12) +#define PIN_PA12D_SERCOM4_PAD1 _L_(12) /**< \brief SERCOM4 signal: PAD1 on PA12 mux D */ +#define MUX_PA12D_SERCOM4_PAD1 _L_(3) +#define PINMUX_PA12D_SERCOM4_PAD1 ((PIN_PA12D_SERCOM4_PAD1 << 16) | MUX_PA12D_SERCOM4_PAD1) +#define PORT_PA12D_SERCOM4_PAD1 (_UL_(1) << 12) +#define PIN_PB09D_SERCOM4_PAD1 _L_(41) /**< \brief SERCOM4 signal: PAD1 on PB09 mux D */ +#define MUX_PB09D_SERCOM4_PAD1 _L_(3) +#define PINMUX_PB09D_SERCOM4_PAD1 ((PIN_PB09D_SERCOM4_PAD1 << 16) | MUX_PB09D_SERCOM4_PAD1) +#define PORT_PB09D_SERCOM4_PAD1 (_UL_(1) << 9) +#define PIN_PB13C_SERCOM4_PAD1 _L_(45) /**< \brief SERCOM4 signal: PAD1 on PB13 mux C */ +#define MUX_PB13C_SERCOM4_PAD1 _L_(2) +#define PINMUX_PB13C_SERCOM4_PAD1 ((PIN_PB13C_SERCOM4_PAD1 << 16) | MUX_PB13C_SERCOM4_PAD1) +#define PORT_PB13C_SERCOM4_PAD1 (_UL_(1) << 13) +#define PIN_PA14D_SERCOM4_PAD2 _L_(14) /**< \brief SERCOM4 signal: PAD2 on PA14 mux D */ +#define MUX_PA14D_SERCOM4_PAD2 _L_(3) +#define PINMUX_PA14D_SERCOM4_PAD2 ((PIN_PA14D_SERCOM4_PAD2 << 16) | MUX_PA14D_SERCOM4_PAD2) +#define PORT_PA14D_SERCOM4_PAD2 (_UL_(1) << 14) +#define PIN_PB10D_SERCOM4_PAD2 _L_(42) /**< \brief SERCOM4 signal: PAD2 on PB10 mux D */ +#define MUX_PB10D_SERCOM4_PAD2 _L_(3) +#define PINMUX_PB10D_SERCOM4_PAD2 ((PIN_PB10D_SERCOM4_PAD2 << 16) | MUX_PB10D_SERCOM4_PAD2) +#define PORT_PB10D_SERCOM4_PAD2 (_UL_(1) << 10) +#define PIN_PB14C_SERCOM4_PAD2 _L_(46) /**< \brief SERCOM4 signal: PAD2 on PB14 mux C */ +#define MUX_PB14C_SERCOM4_PAD2 _L_(2) +#define PINMUX_PB14C_SERCOM4_PAD2 ((PIN_PB14C_SERCOM4_PAD2 << 16) | MUX_PB14C_SERCOM4_PAD2) +#define PORT_PB14C_SERCOM4_PAD2 (_UL_(1) << 14) +#define PIN_PB11D_SERCOM4_PAD3 _L_(43) /**< \brief SERCOM4 signal: PAD3 on PB11 mux D */ +#define MUX_PB11D_SERCOM4_PAD3 _L_(3) +#define PINMUX_PB11D_SERCOM4_PAD3 ((PIN_PB11D_SERCOM4_PAD3 << 16) | MUX_PB11D_SERCOM4_PAD3) +#define PORT_PB11D_SERCOM4_PAD3 (_UL_(1) << 11) +#define PIN_PA15D_SERCOM4_PAD3 _L_(15) /**< \brief SERCOM4 signal: PAD3 on PA15 mux D */ +#define MUX_PA15D_SERCOM4_PAD3 _L_(3) +#define PINMUX_PA15D_SERCOM4_PAD3 ((PIN_PA15D_SERCOM4_PAD3 << 16) | MUX_PA15D_SERCOM4_PAD3) +#define PORT_PA15D_SERCOM4_PAD3 (_UL_(1) << 15) +#define PIN_PB15C_SERCOM4_PAD3 _L_(47) /**< \brief SERCOM4 signal: PAD3 on PB15 mux C */ +#define MUX_PB15C_SERCOM4_PAD3 _L_(2) +#define PINMUX_PB15C_SERCOM4_PAD3 ((PIN_PB15C_SERCOM4_PAD3 << 16) | MUX_PB15C_SERCOM4_PAD3) +#define PORT_PB15C_SERCOM4_PAD3 (_UL_(1) << 15) +/* ========== PORT definition for SERCOM5 peripheral ========== */ +#define PIN_PA23D_SERCOM5_PAD0 _L_(23) /**< \brief SERCOM5 signal: PAD0 on PA23 mux D */ +#define MUX_PA23D_SERCOM5_PAD0 _L_(3) +#define PINMUX_PA23D_SERCOM5_PAD0 ((PIN_PA23D_SERCOM5_PAD0 << 16) | MUX_PA23D_SERCOM5_PAD0) +#define PORT_PA23D_SERCOM5_PAD0 (_UL_(1) << 23) +#define PIN_PB02D_SERCOM5_PAD0 _L_(34) /**< \brief SERCOM5 signal: PAD0 on PB02 mux D */ +#define MUX_PB02D_SERCOM5_PAD0 _L_(3) +#define PINMUX_PB02D_SERCOM5_PAD0 ((PIN_PB02D_SERCOM5_PAD0 << 16) | MUX_PB02D_SERCOM5_PAD0) +#define PORT_PB02D_SERCOM5_PAD0 (_UL_(1) << 2) +#define PIN_PB31D_SERCOM5_PAD0 _L_(63) /**< \brief SERCOM5 signal: PAD0 on PB31 mux D */ +#define MUX_PB31D_SERCOM5_PAD0 _L_(3) +#define PINMUX_PB31D_SERCOM5_PAD0 ((PIN_PB31D_SERCOM5_PAD0 << 16) | MUX_PB31D_SERCOM5_PAD0) +#define PORT_PB31D_SERCOM5_PAD0 (_UL_(1) << 31) +#define PIN_PB16C_SERCOM5_PAD0 _L_(48) /**< \brief SERCOM5 signal: PAD0 on PB16 mux C */ +#define MUX_PB16C_SERCOM5_PAD0 _L_(2) +#define PINMUX_PB16C_SERCOM5_PAD0 ((PIN_PB16C_SERCOM5_PAD0 << 16) | MUX_PB16C_SERCOM5_PAD0) +#define PORT_PB16C_SERCOM5_PAD0 (_UL_(1) << 16) +#define PIN_PA22D_SERCOM5_PAD1 _L_(22) /**< \brief SERCOM5 signal: PAD1 on PA22 mux D */ +#define MUX_PA22D_SERCOM5_PAD1 _L_(3) +#define PINMUX_PA22D_SERCOM5_PAD1 ((PIN_PA22D_SERCOM5_PAD1 << 16) | MUX_PA22D_SERCOM5_PAD1) +#define PORT_PA22D_SERCOM5_PAD1 (_UL_(1) << 22) +#define PIN_PB03D_SERCOM5_PAD1 _L_(35) /**< \brief SERCOM5 signal: PAD1 on PB03 mux D */ +#define MUX_PB03D_SERCOM5_PAD1 _L_(3) +#define PINMUX_PB03D_SERCOM5_PAD1 ((PIN_PB03D_SERCOM5_PAD1 << 16) | MUX_PB03D_SERCOM5_PAD1) +#define PORT_PB03D_SERCOM5_PAD1 (_UL_(1) << 3) +#define PIN_PB30D_SERCOM5_PAD1 _L_(62) /**< \brief SERCOM5 signal: PAD1 on PB30 mux D */ +#define MUX_PB30D_SERCOM5_PAD1 _L_(3) +#define PINMUX_PB30D_SERCOM5_PAD1 ((PIN_PB30D_SERCOM5_PAD1 << 16) | MUX_PB30D_SERCOM5_PAD1) +#define PORT_PB30D_SERCOM5_PAD1 (_UL_(1) << 30) +#define PIN_PB17C_SERCOM5_PAD1 _L_(49) /**< \brief SERCOM5 signal: PAD1 on PB17 mux C */ +#define MUX_PB17C_SERCOM5_PAD1 _L_(2) +#define PINMUX_PB17C_SERCOM5_PAD1 ((PIN_PB17C_SERCOM5_PAD1 << 16) | MUX_PB17C_SERCOM5_PAD1) +#define PORT_PB17C_SERCOM5_PAD1 (_UL_(1) << 17) +#define PIN_PA24D_SERCOM5_PAD2 _L_(24) /**< \brief SERCOM5 signal: PAD2 on PA24 mux D */ +#define MUX_PA24D_SERCOM5_PAD2 _L_(3) +#define PINMUX_PA24D_SERCOM5_PAD2 ((PIN_PA24D_SERCOM5_PAD2 << 16) | MUX_PA24D_SERCOM5_PAD2) +#define PORT_PA24D_SERCOM5_PAD2 (_UL_(1) << 24) +#define PIN_PB00D_SERCOM5_PAD2 _L_(32) /**< \brief SERCOM5 signal: PAD2 on PB00 mux D */ +#define MUX_PB00D_SERCOM5_PAD2 _L_(3) +#define PINMUX_PB00D_SERCOM5_PAD2 ((PIN_PB00D_SERCOM5_PAD2 << 16) | MUX_PB00D_SERCOM5_PAD2) +#define PORT_PB00D_SERCOM5_PAD2 (_UL_(1) << 0) +#define PIN_PB22D_SERCOM5_PAD2 _L_(54) /**< \brief SERCOM5 signal: PAD2 on PB22 mux D */ +#define MUX_PB22D_SERCOM5_PAD2 _L_(3) +#define PINMUX_PB22D_SERCOM5_PAD2 ((PIN_PB22D_SERCOM5_PAD2 << 16) | MUX_PB22D_SERCOM5_PAD2) +#define PORT_PB22D_SERCOM5_PAD2 (_UL_(1) << 22) +#define PIN_PA20C_SERCOM5_PAD2 _L_(20) /**< \brief SERCOM5 signal: PAD2 on PA20 mux C */ +#define MUX_PA20C_SERCOM5_PAD2 _L_(2) +#define PINMUX_PA20C_SERCOM5_PAD2 ((PIN_PA20C_SERCOM5_PAD2 << 16) | MUX_PA20C_SERCOM5_PAD2) +#define PORT_PA20C_SERCOM5_PAD2 (_UL_(1) << 20) +#define PIN_PA25D_SERCOM5_PAD3 _L_(25) /**< \brief SERCOM5 signal: PAD3 on PA25 mux D */ +#define MUX_PA25D_SERCOM5_PAD3 _L_(3) +#define PINMUX_PA25D_SERCOM5_PAD3 ((PIN_PA25D_SERCOM5_PAD3 << 16) | MUX_PA25D_SERCOM5_PAD3) +#define PORT_PA25D_SERCOM5_PAD3 (_UL_(1) << 25) +#define PIN_PB01D_SERCOM5_PAD3 _L_(33) /**< \brief SERCOM5 signal: PAD3 on PB01 mux D */ +#define MUX_PB01D_SERCOM5_PAD3 _L_(3) +#define PINMUX_PB01D_SERCOM5_PAD3 ((PIN_PB01D_SERCOM5_PAD3 << 16) | MUX_PB01D_SERCOM5_PAD3) +#define PORT_PB01D_SERCOM5_PAD3 (_UL_(1) << 1) +#define PIN_PB23D_SERCOM5_PAD3 _L_(55) /**< \brief SERCOM5 signal: PAD3 on PB23 mux D */ +#define MUX_PB23D_SERCOM5_PAD3 _L_(3) +#define PINMUX_PB23D_SERCOM5_PAD3 ((PIN_PB23D_SERCOM5_PAD3 << 16) | MUX_PB23D_SERCOM5_PAD3) +#define PORT_PB23D_SERCOM5_PAD3 (_UL_(1) << 23) +#define PIN_PA21C_SERCOM5_PAD3 _L_(21) /**< \brief SERCOM5 signal: PAD3 on PA21 mux C */ +#define MUX_PA21C_SERCOM5_PAD3 _L_(2) +#define PINMUX_PA21C_SERCOM5_PAD3 ((PIN_PA21C_SERCOM5_PAD3 << 16) | MUX_PA21C_SERCOM5_PAD3) +#define PORT_PA21C_SERCOM5_PAD3 (_UL_(1) << 21) +/* ========== PORT definition for TCC4 peripheral ========== */ +#define PIN_PB14F_TCC4_WO0 _L_(46) /**< \brief TCC4 signal: WO0 on PB14 mux F */ +#define MUX_PB14F_TCC4_WO0 _L_(5) +#define PINMUX_PB14F_TCC4_WO0 ((PIN_PB14F_TCC4_WO0 << 16) | MUX_PB14F_TCC4_WO0) +#define PORT_PB14F_TCC4_WO0 (_UL_(1) << 14) +#define PIN_PB30F_TCC4_WO0 _L_(62) /**< \brief TCC4 signal: WO0 on PB30 mux F */ +#define MUX_PB30F_TCC4_WO0 _L_(5) +#define PINMUX_PB30F_TCC4_WO0 ((PIN_PB30F_TCC4_WO0 << 16) | MUX_PB30F_TCC4_WO0) +#define PORT_PB30F_TCC4_WO0 (_UL_(1) << 30) +#define PIN_PB15F_TCC4_WO1 _L_(47) /**< \brief TCC4 signal: WO1 on PB15 mux F */ +#define MUX_PB15F_TCC4_WO1 _L_(5) +#define PINMUX_PB15F_TCC4_WO1 ((PIN_PB15F_TCC4_WO1 << 16) | MUX_PB15F_TCC4_WO1) +#define PORT_PB15F_TCC4_WO1 (_UL_(1) << 15) +#define PIN_PB31F_TCC4_WO1 _L_(63) /**< \brief TCC4 signal: WO1 on PB31 mux F */ +#define MUX_PB31F_TCC4_WO1 _L_(5) +#define PINMUX_PB31F_TCC4_WO1 ((PIN_PB31F_TCC4_WO1 << 16) | MUX_PB31F_TCC4_WO1) +#define PORT_PB31F_TCC4_WO1 (_UL_(1) << 31) +/* ========== PORT definition for ADC0 peripheral ========== */ +#define PIN_PA02B_ADC0_AIN0 _L_(2) /**< \brief ADC0 signal: AIN0 on PA02 mux B */ +#define MUX_PA02B_ADC0_AIN0 _L_(1) +#define PINMUX_PA02B_ADC0_AIN0 ((PIN_PA02B_ADC0_AIN0 << 16) | MUX_PA02B_ADC0_AIN0) +#define PORT_PA02B_ADC0_AIN0 (_UL_(1) << 2) +#define PIN_PA03B_ADC0_AIN1 _L_(3) /**< \brief ADC0 signal: AIN1 on PA03 mux B */ +#define MUX_PA03B_ADC0_AIN1 _L_(1) +#define PINMUX_PA03B_ADC0_AIN1 ((PIN_PA03B_ADC0_AIN1 << 16) | MUX_PA03B_ADC0_AIN1) +#define PORT_PA03B_ADC0_AIN1 (_UL_(1) << 3) +#define PIN_PB08B_ADC0_AIN2 _L_(40) /**< \brief ADC0 signal: AIN2 on PB08 mux B */ +#define MUX_PB08B_ADC0_AIN2 _L_(1) +#define PINMUX_PB08B_ADC0_AIN2 ((PIN_PB08B_ADC0_AIN2 << 16) | MUX_PB08B_ADC0_AIN2) +#define PORT_PB08B_ADC0_AIN2 (_UL_(1) << 8) +#define PIN_PB09B_ADC0_AIN3 _L_(41) /**< \brief ADC0 signal: AIN3 on PB09 mux B */ +#define MUX_PB09B_ADC0_AIN3 _L_(1) +#define PINMUX_PB09B_ADC0_AIN3 ((PIN_PB09B_ADC0_AIN3 << 16) | MUX_PB09B_ADC0_AIN3) +#define PORT_PB09B_ADC0_AIN3 (_UL_(1) << 9) +#define PIN_PA04B_ADC0_AIN4 _L_(4) /**< \brief ADC0 signal: AIN4 on PA04 mux B */ +#define MUX_PA04B_ADC0_AIN4 _L_(1) +#define PINMUX_PA04B_ADC0_AIN4 ((PIN_PA04B_ADC0_AIN4 << 16) | MUX_PA04B_ADC0_AIN4) +#define PORT_PA04B_ADC0_AIN4 (_UL_(1) << 4) +#define PIN_PA05B_ADC0_AIN5 _L_(5) /**< \brief ADC0 signal: AIN5 on PA05 mux B */ +#define MUX_PA05B_ADC0_AIN5 _L_(1) +#define PINMUX_PA05B_ADC0_AIN5 ((PIN_PA05B_ADC0_AIN5 << 16) | MUX_PA05B_ADC0_AIN5) +#define PORT_PA05B_ADC0_AIN5 (_UL_(1) << 5) +#define PIN_PA06B_ADC0_AIN6 _L_(6) /**< \brief ADC0 signal: AIN6 on PA06 mux B */ +#define MUX_PA06B_ADC0_AIN6 _L_(1) +#define PINMUX_PA06B_ADC0_AIN6 ((PIN_PA06B_ADC0_AIN6 << 16) | MUX_PA06B_ADC0_AIN6) +#define PORT_PA06B_ADC0_AIN6 (_UL_(1) << 6) +#define PIN_PA07B_ADC0_AIN7 _L_(7) /**< \brief ADC0 signal: AIN7 on PA07 mux B */ +#define MUX_PA07B_ADC0_AIN7 _L_(1) +#define PINMUX_PA07B_ADC0_AIN7 ((PIN_PA07B_ADC0_AIN7 << 16) | MUX_PA07B_ADC0_AIN7) +#define PORT_PA07B_ADC0_AIN7 (_UL_(1) << 7) +#define PIN_PA08B_ADC0_AIN8 _L_(8) /**< \brief ADC0 signal: AIN8 on PA08 mux B */ +#define MUX_PA08B_ADC0_AIN8 _L_(1) +#define PINMUX_PA08B_ADC0_AIN8 ((PIN_PA08B_ADC0_AIN8 << 16) | MUX_PA08B_ADC0_AIN8) +#define PORT_PA08B_ADC0_AIN8 (_UL_(1) << 8) +#define PIN_PA09B_ADC0_AIN9 _L_(9) /**< \brief ADC0 signal: AIN9 on PA09 mux B */ +#define MUX_PA09B_ADC0_AIN9 _L_(1) +#define PINMUX_PA09B_ADC0_AIN9 ((PIN_PA09B_ADC0_AIN9 << 16) | MUX_PA09B_ADC0_AIN9) +#define PORT_PA09B_ADC0_AIN9 (_UL_(1) << 9) +#define PIN_PA10B_ADC0_AIN10 _L_(10) /**< \brief ADC0 signal: AIN10 on PA10 mux B */ +#define MUX_PA10B_ADC0_AIN10 _L_(1) +#define PINMUX_PA10B_ADC0_AIN10 ((PIN_PA10B_ADC0_AIN10 << 16) | MUX_PA10B_ADC0_AIN10) +#define PORT_PA10B_ADC0_AIN10 (_UL_(1) << 10) +#define PIN_PA11B_ADC0_AIN11 _L_(11) /**< \brief ADC0 signal: AIN11 on PA11 mux B */ +#define MUX_PA11B_ADC0_AIN11 _L_(1) +#define PINMUX_PA11B_ADC0_AIN11 ((PIN_PA11B_ADC0_AIN11 << 16) | MUX_PA11B_ADC0_AIN11) +#define PORT_PA11B_ADC0_AIN11 (_UL_(1) << 11) +#define PIN_PB00B_ADC0_AIN12 _L_(32) /**< \brief ADC0 signal: AIN12 on PB00 mux B */ +#define MUX_PB00B_ADC0_AIN12 _L_(1) +#define PINMUX_PB00B_ADC0_AIN12 ((PIN_PB00B_ADC0_AIN12 << 16) | MUX_PB00B_ADC0_AIN12) +#define PORT_PB00B_ADC0_AIN12 (_UL_(1) << 0) +#define PIN_PB01B_ADC0_AIN13 _L_(33) /**< \brief ADC0 signal: AIN13 on PB01 mux B */ +#define MUX_PB01B_ADC0_AIN13 _L_(1) +#define PINMUX_PB01B_ADC0_AIN13 ((PIN_PB01B_ADC0_AIN13 << 16) | MUX_PB01B_ADC0_AIN13) +#define PORT_PB01B_ADC0_AIN13 (_UL_(1) << 1) +#define PIN_PB02B_ADC0_AIN14 _L_(34) /**< \brief ADC0 signal: AIN14 on PB02 mux B */ +#define MUX_PB02B_ADC0_AIN14 _L_(1) +#define PINMUX_PB02B_ADC0_AIN14 ((PIN_PB02B_ADC0_AIN14 << 16) | MUX_PB02B_ADC0_AIN14) +#define PORT_PB02B_ADC0_AIN14 (_UL_(1) << 2) +#define PIN_PB03B_ADC0_AIN15 _L_(35) /**< \brief ADC0 signal: AIN15 on PB03 mux B */ +#define MUX_PB03B_ADC0_AIN15 _L_(1) +#define PINMUX_PB03B_ADC0_AIN15 ((PIN_PB03B_ADC0_AIN15 << 16) | MUX_PB03B_ADC0_AIN15) +#define PORT_PB03B_ADC0_AIN15 (_UL_(1) << 3) +#define PIN_PA03O_ADC0_DRV0 _L_(3) /**< \brief ADC0 signal: DRV0 on PA03 mux O */ +#define MUX_PA03O_ADC0_DRV0 _L_(14) +#define PINMUX_PA03O_ADC0_DRV0 ((PIN_PA03O_ADC0_DRV0 << 16) | MUX_PA03O_ADC0_DRV0) +#define PORT_PA03O_ADC0_DRV0 (_UL_(1) << 3) +#define PIN_PB08O_ADC0_DRV1 _L_(40) /**< \brief ADC0 signal: DRV1 on PB08 mux O */ +#define MUX_PB08O_ADC0_DRV1 _L_(14) +#define PINMUX_PB08O_ADC0_DRV1 ((PIN_PB08O_ADC0_DRV1 << 16) | MUX_PB08O_ADC0_DRV1) +#define PORT_PB08O_ADC0_DRV1 (_UL_(1) << 8) +#define PIN_PB09O_ADC0_DRV2 _L_(41) /**< \brief ADC0 signal: DRV2 on PB09 mux O */ +#define MUX_PB09O_ADC0_DRV2 _L_(14) +#define PINMUX_PB09O_ADC0_DRV2 ((PIN_PB09O_ADC0_DRV2 << 16) | MUX_PB09O_ADC0_DRV2) +#define PORT_PB09O_ADC0_DRV2 (_UL_(1) << 9) +#define PIN_PA04O_ADC0_DRV3 _L_(4) /**< \brief ADC0 signal: DRV3 on PA04 mux O */ +#define MUX_PA04O_ADC0_DRV3 _L_(14) +#define PINMUX_PA04O_ADC0_DRV3 ((PIN_PA04O_ADC0_DRV3 << 16) | MUX_PA04O_ADC0_DRV3) +#define PORT_PA04O_ADC0_DRV3 (_UL_(1) << 4) +#define PIN_PA06O_ADC0_DRV4 _L_(6) /**< \brief ADC0 signal: DRV4 on PA06 mux O */ +#define MUX_PA06O_ADC0_DRV4 _L_(14) +#define PINMUX_PA06O_ADC0_DRV4 ((PIN_PA06O_ADC0_DRV4 << 16) | MUX_PA06O_ADC0_DRV4) +#define PORT_PA06O_ADC0_DRV4 (_UL_(1) << 6) +#define PIN_PA07O_ADC0_DRV5 _L_(7) /**< \brief ADC0 signal: DRV5 on PA07 mux O */ +#define MUX_PA07O_ADC0_DRV5 _L_(14) +#define PINMUX_PA07O_ADC0_DRV5 ((PIN_PA07O_ADC0_DRV5 << 16) | MUX_PA07O_ADC0_DRV5) +#define PORT_PA07O_ADC0_DRV5 (_UL_(1) << 7) +#define PIN_PA08O_ADC0_DRV6 _L_(8) /**< \brief ADC0 signal: DRV6 on PA08 mux O */ +#define MUX_PA08O_ADC0_DRV6 _L_(14) +#define PINMUX_PA08O_ADC0_DRV6 ((PIN_PA08O_ADC0_DRV6 << 16) | MUX_PA08O_ADC0_DRV6) +#define PORT_PA08O_ADC0_DRV6 (_UL_(1) << 8) +#define PIN_PA09O_ADC0_DRV7 _L_(9) /**< \brief ADC0 signal: DRV7 on PA09 mux O */ +#define MUX_PA09O_ADC0_DRV7 _L_(14) +#define PINMUX_PA09O_ADC0_DRV7 ((PIN_PA09O_ADC0_DRV7 << 16) | MUX_PA09O_ADC0_DRV7) +#define PORT_PA09O_ADC0_DRV7 (_UL_(1) << 9) +#define PIN_PA10O_ADC0_DRV8 _L_(10) /**< \brief ADC0 signal: DRV8 on PA10 mux O */ +#define MUX_PA10O_ADC0_DRV8 _L_(14) +#define PINMUX_PA10O_ADC0_DRV8 ((PIN_PA10O_ADC0_DRV8 << 16) | MUX_PA10O_ADC0_DRV8) +#define PORT_PA10O_ADC0_DRV8 (_UL_(1) << 10) +#define PIN_PA11O_ADC0_DRV9 _L_(11) /**< \brief ADC0 signal: DRV9 on PA11 mux O */ +#define MUX_PA11O_ADC0_DRV9 _L_(14) +#define PINMUX_PA11O_ADC0_DRV9 ((PIN_PA11O_ADC0_DRV9 << 16) | MUX_PA11O_ADC0_DRV9) +#define PORT_PA11O_ADC0_DRV9 (_UL_(1) << 11) +#define PIN_PA16O_ADC0_DRV10 _L_(16) /**< \brief ADC0 signal: DRV10 on PA16 mux O */ +#define MUX_PA16O_ADC0_DRV10 _L_(14) +#define PINMUX_PA16O_ADC0_DRV10 ((PIN_PA16O_ADC0_DRV10 << 16) | MUX_PA16O_ADC0_DRV10) +#define PORT_PA16O_ADC0_DRV10 (_UL_(1) << 16) +#define PIN_PA17O_ADC0_DRV11 _L_(17) /**< \brief ADC0 signal: DRV11 on PA17 mux O */ +#define MUX_PA17O_ADC0_DRV11 _L_(14) +#define PINMUX_PA17O_ADC0_DRV11 ((PIN_PA17O_ADC0_DRV11 << 16) | MUX_PA17O_ADC0_DRV11) +#define PORT_PA17O_ADC0_DRV11 (_UL_(1) << 17) +#define PIN_PA18O_ADC0_DRV12 _L_(18) /**< \brief ADC0 signal: DRV12 on PA18 mux O */ +#define MUX_PA18O_ADC0_DRV12 _L_(14) +#define PINMUX_PA18O_ADC0_DRV12 ((PIN_PA18O_ADC0_DRV12 << 16) | MUX_PA18O_ADC0_DRV12) +#define PORT_PA18O_ADC0_DRV12 (_UL_(1) << 18) +#define PIN_PA19O_ADC0_DRV13 _L_(19) /**< \brief ADC0 signal: DRV13 on PA19 mux O */ +#define MUX_PA19O_ADC0_DRV13 _L_(14) +#define PINMUX_PA19O_ADC0_DRV13 ((PIN_PA19O_ADC0_DRV13 << 16) | MUX_PA19O_ADC0_DRV13) +#define PORT_PA19O_ADC0_DRV13 (_UL_(1) << 19) +#define PIN_PA20O_ADC0_DRV14 _L_(20) /**< \brief ADC0 signal: DRV14 on PA20 mux O */ +#define MUX_PA20O_ADC0_DRV14 _L_(14) +#define PINMUX_PA20O_ADC0_DRV14 ((PIN_PA20O_ADC0_DRV14 << 16) | MUX_PA20O_ADC0_DRV14) +#define PORT_PA20O_ADC0_DRV14 (_UL_(1) << 20) +#define PIN_PA21O_ADC0_DRV15 _L_(21) /**< \brief ADC0 signal: DRV15 on PA21 mux O */ +#define MUX_PA21O_ADC0_DRV15 _L_(14) +#define PINMUX_PA21O_ADC0_DRV15 ((PIN_PA21O_ADC0_DRV15 << 16) | MUX_PA21O_ADC0_DRV15) +#define PORT_PA21O_ADC0_DRV15 (_UL_(1) << 21) +#define PIN_PA22O_ADC0_DRV16 _L_(22) /**< \brief ADC0 signal: DRV16 on PA22 mux O */ +#define MUX_PA22O_ADC0_DRV16 _L_(14) +#define PINMUX_PA22O_ADC0_DRV16 ((PIN_PA22O_ADC0_DRV16 << 16) | MUX_PA22O_ADC0_DRV16) +#define PORT_PA22O_ADC0_DRV16 (_UL_(1) << 22) +#define PIN_PA23O_ADC0_DRV17 _L_(23) /**< \brief ADC0 signal: DRV17 on PA23 mux O */ +#define MUX_PA23O_ADC0_DRV17 _L_(14) +#define PINMUX_PA23O_ADC0_DRV17 ((PIN_PA23O_ADC0_DRV17 << 16) | MUX_PA23O_ADC0_DRV17) +#define PORT_PA23O_ADC0_DRV17 (_UL_(1) << 23) +#define PIN_PA27O_ADC0_DRV18 _L_(27) /**< \brief ADC0 signal: DRV18 on PA27 mux O */ +#define MUX_PA27O_ADC0_DRV18 _L_(14) +#define PINMUX_PA27O_ADC0_DRV18 ((PIN_PA27O_ADC0_DRV18 << 16) | MUX_PA27O_ADC0_DRV18) +#define PORT_PA27O_ADC0_DRV18 (_UL_(1) << 27) +#define PIN_PA30O_ADC0_DRV19 _L_(30) /**< \brief ADC0 signal: DRV19 on PA30 mux O */ +#define MUX_PA30O_ADC0_DRV19 _L_(14) +#define PINMUX_PA30O_ADC0_DRV19 ((PIN_PA30O_ADC0_DRV19 << 16) | MUX_PA30O_ADC0_DRV19) +#define PORT_PA30O_ADC0_DRV19 (_UL_(1) << 30) +#define PIN_PB02O_ADC0_DRV20 _L_(34) /**< \brief ADC0 signal: DRV20 on PB02 mux O */ +#define MUX_PB02O_ADC0_DRV20 _L_(14) +#define PINMUX_PB02O_ADC0_DRV20 ((PIN_PB02O_ADC0_DRV20 << 16) | MUX_PB02O_ADC0_DRV20) +#define PORT_PB02O_ADC0_DRV20 (_UL_(1) << 2) +#define PIN_PB03O_ADC0_DRV21 _L_(35) /**< \brief ADC0 signal: DRV21 on PB03 mux O */ +#define MUX_PB03O_ADC0_DRV21 _L_(14) +#define PINMUX_PB03O_ADC0_DRV21 ((PIN_PB03O_ADC0_DRV21 << 16) | MUX_PB03O_ADC0_DRV21) +#define PORT_PB03O_ADC0_DRV21 (_UL_(1) << 3) +#define PIN_PB04O_ADC0_DRV22 _L_(36) /**< \brief ADC0 signal: DRV22 on PB04 mux O */ +#define MUX_PB04O_ADC0_DRV22 _L_(14) +#define PINMUX_PB04O_ADC0_DRV22 ((PIN_PB04O_ADC0_DRV22 << 16) | MUX_PB04O_ADC0_DRV22) +#define PORT_PB04O_ADC0_DRV22 (_UL_(1) << 4) +#define PIN_PB05O_ADC0_DRV23 _L_(37) /**< \brief ADC0 signal: DRV23 on PB05 mux O */ +#define MUX_PB05O_ADC0_DRV23 _L_(14) +#define PINMUX_PB05O_ADC0_DRV23 ((PIN_PB05O_ADC0_DRV23 << 16) | MUX_PB05O_ADC0_DRV23) +#define PORT_PB05O_ADC0_DRV23 (_UL_(1) << 5) +#define PIN_PB06O_ADC0_DRV24 _L_(38) /**< \brief ADC0 signal: DRV24 on PB06 mux O */ +#define MUX_PB06O_ADC0_DRV24 _L_(14) +#define PINMUX_PB06O_ADC0_DRV24 ((PIN_PB06O_ADC0_DRV24 << 16) | MUX_PB06O_ADC0_DRV24) +#define PORT_PB06O_ADC0_DRV24 (_UL_(1) << 6) +#define PIN_PB07O_ADC0_DRV25 _L_(39) /**< \brief ADC0 signal: DRV25 on PB07 mux O */ +#define MUX_PB07O_ADC0_DRV25 _L_(14) +#define PINMUX_PB07O_ADC0_DRV25 ((PIN_PB07O_ADC0_DRV25 << 16) | MUX_PB07O_ADC0_DRV25) +#define PORT_PB07O_ADC0_DRV25 (_UL_(1) << 7) +#define PIN_PB12O_ADC0_DRV26 _L_(44) /**< \brief ADC0 signal: DRV26 on PB12 mux O */ +#define MUX_PB12O_ADC0_DRV26 _L_(14) +#define PINMUX_PB12O_ADC0_DRV26 ((PIN_PB12O_ADC0_DRV26 << 16) | MUX_PB12O_ADC0_DRV26) +#define PORT_PB12O_ADC0_DRV26 (_UL_(1) << 12) +#define PIN_PB13O_ADC0_DRV27 _L_(45) /**< \brief ADC0 signal: DRV27 on PB13 mux O */ +#define MUX_PB13O_ADC0_DRV27 _L_(14) +#define PINMUX_PB13O_ADC0_DRV27 ((PIN_PB13O_ADC0_DRV27 << 16) | MUX_PB13O_ADC0_DRV27) +#define PORT_PB13O_ADC0_DRV27 (_UL_(1) << 13) +#define PIN_PB14O_ADC0_DRV28 _L_(46) /**< \brief ADC0 signal: DRV28 on PB14 mux O */ +#define MUX_PB14O_ADC0_DRV28 _L_(14) +#define PINMUX_PB14O_ADC0_DRV28 ((PIN_PB14O_ADC0_DRV28 << 16) | MUX_PB14O_ADC0_DRV28) +#define PORT_PB14O_ADC0_DRV28 (_UL_(1) << 14) +#define PIN_PB15O_ADC0_DRV29 _L_(47) /**< \brief ADC0 signal: DRV29 on PB15 mux O */ +#define MUX_PB15O_ADC0_DRV29 _L_(14) +#define PINMUX_PB15O_ADC0_DRV29 ((PIN_PB15O_ADC0_DRV29 << 16) | MUX_PB15O_ADC0_DRV29) +#define PORT_PB15O_ADC0_DRV29 (_UL_(1) << 15) +#define PIN_PB00O_ADC0_DRV30 _L_(32) /**< \brief ADC0 signal: DRV30 on PB00 mux O */ +#define MUX_PB00O_ADC0_DRV30 _L_(14) +#define PINMUX_PB00O_ADC0_DRV30 ((PIN_PB00O_ADC0_DRV30 << 16) | MUX_PB00O_ADC0_DRV30) +#define PORT_PB00O_ADC0_DRV30 (_UL_(1) << 0) +#define PIN_PB01O_ADC0_DRV31 _L_(33) /**< \brief ADC0 signal: DRV31 on PB01 mux O */ +#define MUX_PB01O_ADC0_DRV31 _L_(14) +#define PINMUX_PB01O_ADC0_DRV31 ((PIN_PB01O_ADC0_DRV31 << 16) | MUX_PB01O_ADC0_DRV31) +#define PORT_PB01O_ADC0_DRV31 (_UL_(1) << 1) +#define PIN_PA03B_ADC0_PTCXY0 _L_(3) /**< \brief ADC0 signal: PTCXY0 on PA03 mux B */ +#define MUX_PA03B_ADC0_PTCXY0 _L_(1) +#define PINMUX_PA03B_ADC0_PTCXY0 ((PIN_PA03B_ADC0_PTCXY0 << 16) | MUX_PA03B_ADC0_PTCXY0) +#define PORT_PA03B_ADC0_PTCXY0 (_UL_(1) << 3) +#define PIN_PB08B_ADC0_PTCXY1 _L_(40) /**< \brief ADC0 signal: PTCXY1 on PB08 mux B */ +#define MUX_PB08B_ADC0_PTCXY1 _L_(1) +#define PINMUX_PB08B_ADC0_PTCXY1 ((PIN_PB08B_ADC0_PTCXY1 << 16) | MUX_PB08B_ADC0_PTCXY1) +#define PORT_PB08B_ADC0_PTCXY1 (_UL_(1) << 8) +#define PIN_PB09B_ADC0_PTCXY2 _L_(41) /**< \brief ADC0 signal: PTCXY2 on PB09 mux B */ +#define MUX_PB09B_ADC0_PTCXY2 _L_(1) +#define PINMUX_PB09B_ADC0_PTCXY2 ((PIN_PB09B_ADC0_PTCXY2 << 16) | MUX_PB09B_ADC0_PTCXY2) +#define PORT_PB09B_ADC0_PTCXY2 (_UL_(1) << 9) +#define PIN_PA04B_ADC0_PTCXY3 _L_(4) /**< \brief ADC0 signal: PTCXY3 on PA04 mux B */ +#define MUX_PA04B_ADC0_PTCXY3 _L_(1) +#define PINMUX_PA04B_ADC0_PTCXY3 ((PIN_PA04B_ADC0_PTCXY3 << 16) | MUX_PA04B_ADC0_PTCXY3) +#define PORT_PA04B_ADC0_PTCXY3 (_UL_(1) << 4) +#define PIN_PA06B_ADC0_PTCXY4 _L_(6) /**< \brief ADC0 signal: PTCXY4 on PA06 mux B */ +#define MUX_PA06B_ADC0_PTCXY4 _L_(1) +#define PINMUX_PA06B_ADC0_PTCXY4 ((PIN_PA06B_ADC0_PTCXY4 << 16) | MUX_PA06B_ADC0_PTCXY4) +#define PORT_PA06B_ADC0_PTCXY4 (_UL_(1) << 6) +#define PIN_PA07B_ADC0_PTCXY5 _L_(7) /**< \brief ADC0 signal: PTCXY5 on PA07 mux B */ +#define MUX_PA07B_ADC0_PTCXY5 _L_(1) +#define PINMUX_PA07B_ADC0_PTCXY5 ((PIN_PA07B_ADC0_PTCXY5 << 16) | MUX_PA07B_ADC0_PTCXY5) +#define PORT_PA07B_ADC0_PTCXY5 (_UL_(1) << 7) +#define PIN_PA08B_ADC0_PTCXY6 _L_(8) /**< \brief ADC0 signal: PTCXY6 on PA08 mux B */ +#define MUX_PA08B_ADC0_PTCXY6 _L_(1) +#define PINMUX_PA08B_ADC0_PTCXY6 ((PIN_PA08B_ADC0_PTCXY6 << 16) | MUX_PA08B_ADC0_PTCXY6) +#define PORT_PA08B_ADC0_PTCXY6 (_UL_(1) << 8) +#define PIN_PA09B_ADC0_PTCXY7 _L_(9) /**< \brief ADC0 signal: PTCXY7 on PA09 mux B */ +#define MUX_PA09B_ADC0_PTCXY7 _L_(1) +#define PINMUX_PA09B_ADC0_PTCXY7 ((PIN_PA09B_ADC0_PTCXY7 << 16) | MUX_PA09B_ADC0_PTCXY7) +#define PORT_PA09B_ADC0_PTCXY7 (_UL_(1) << 9) +#define PIN_PA10B_ADC0_PTCXY8 _L_(10) /**< \brief ADC0 signal: PTCXY8 on PA10 mux B */ +#define MUX_PA10B_ADC0_PTCXY8 _L_(1) +#define PINMUX_PA10B_ADC0_PTCXY8 ((PIN_PA10B_ADC0_PTCXY8 << 16) | MUX_PA10B_ADC0_PTCXY8) +#define PORT_PA10B_ADC0_PTCXY8 (_UL_(1) << 10) +#define PIN_PA11B_ADC0_PTCXY9 _L_(11) /**< \brief ADC0 signal: PTCXY9 on PA11 mux B */ +#define MUX_PA11B_ADC0_PTCXY9 _L_(1) +#define PINMUX_PA11B_ADC0_PTCXY9 ((PIN_PA11B_ADC0_PTCXY9 << 16) | MUX_PA11B_ADC0_PTCXY9) +#define PORT_PA11B_ADC0_PTCXY9 (_UL_(1) << 11) +#define PIN_PA16B_ADC0_PTCXY10 _L_(16) /**< \brief ADC0 signal: PTCXY10 on PA16 mux B */ +#define MUX_PA16B_ADC0_PTCXY10 _L_(1) +#define PINMUX_PA16B_ADC0_PTCXY10 ((PIN_PA16B_ADC0_PTCXY10 << 16) | MUX_PA16B_ADC0_PTCXY10) +#define PORT_PA16B_ADC0_PTCXY10 (_UL_(1) << 16) +#define PIN_PA17B_ADC0_PTCXY11 _L_(17) /**< \brief ADC0 signal: PTCXY11 on PA17 mux B */ +#define MUX_PA17B_ADC0_PTCXY11 _L_(1) +#define PINMUX_PA17B_ADC0_PTCXY11 ((PIN_PA17B_ADC0_PTCXY11 << 16) | MUX_PA17B_ADC0_PTCXY11) +#define PORT_PA17B_ADC0_PTCXY11 (_UL_(1) << 17) +#define PIN_PA19B_ADC0_PTCXY13 _L_(19) /**< \brief ADC0 signal: PTCXY13 on PA19 mux B */ +#define MUX_PA19B_ADC0_PTCXY13 _L_(1) +#define PINMUX_PA19B_ADC0_PTCXY13 ((PIN_PA19B_ADC0_PTCXY13 << 16) | MUX_PA19B_ADC0_PTCXY13) +#define PORT_PA19B_ADC0_PTCXY13 (_UL_(1) << 19) +#define PIN_PA20B_ADC0_PTCXY14 _L_(20) /**< \brief ADC0 signal: PTCXY14 on PA20 mux B */ +#define MUX_PA20B_ADC0_PTCXY14 _L_(1) +#define PINMUX_PA20B_ADC0_PTCXY14 ((PIN_PA20B_ADC0_PTCXY14 << 16) | MUX_PA20B_ADC0_PTCXY14) +#define PORT_PA20B_ADC0_PTCXY14 (_UL_(1) << 20) +#define PIN_PA21B_ADC0_PTCXY15 _L_(21) /**< \brief ADC0 signal: PTCXY15 on PA21 mux B */ +#define MUX_PA21B_ADC0_PTCXY15 _L_(1) +#define PINMUX_PA21B_ADC0_PTCXY15 ((PIN_PA21B_ADC0_PTCXY15 << 16) | MUX_PA21B_ADC0_PTCXY15) +#define PORT_PA21B_ADC0_PTCXY15 (_UL_(1) << 21) +#define PIN_PA22B_ADC0_PTCXY16 _L_(22) /**< \brief ADC0 signal: PTCXY16 on PA22 mux B */ +#define MUX_PA22B_ADC0_PTCXY16 _L_(1) +#define PINMUX_PA22B_ADC0_PTCXY16 ((PIN_PA22B_ADC0_PTCXY16 << 16) | MUX_PA22B_ADC0_PTCXY16) +#define PORT_PA22B_ADC0_PTCXY16 (_UL_(1) << 22) +#define PIN_PA23B_ADC0_PTCXY17 _L_(23) /**< \brief ADC0 signal: PTCXY17 on PA23 mux B */ +#define MUX_PA23B_ADC0_PTCXY17 _L_(1) +#define PINMUX_PA23B_ADC0_PTCXY17 ((PIN_PA23B_ADC0_PTCXY17 << 16) | MUX_PA23B_ADC0_PTCXY17) +#define PORT_PA23B_ADC0_PTCXY17 (_UL_(1) << 23) +#define PIN_PA27B_ADC0_PTCXY18 _L_(27) /**< \brief ADC0 signal: PTCXY18 on PA27 mux B */ +#define MUX_PA27B_ADC0_PTCXY18 _L_(1) +#define PINMUX_PA27B_ADC0_PTCXY18 ((PIN_PA27B_ADC0_PTCXY18 << 16) | MUX_PA27B_ADC0_PTCXY18) +#define PORT_PA27B_ADC0_PTCXY18 (_UL_(1) << 27) +#define PIN_PA30B_ADC0_PTCXY19 _L_(30) /**< \brief ADC0 signal: PTCXY19 on PA30 mux B */ +#define MUX_PA30B_ADC0_PTCXY19 _L_(1) +#define PINMUX_PA30B_ADC0_PTCXY19 ((PIN_PA30B_ADC0_PTCXY19 << 16) | MUX_PA30B_ADC0_PTCXY19) +#define PORT_PA30B_ADC0_PTCXY19 (_UL_(1) << 30) +#define PIN_PB02B_ADC0_PTCXY20 _L_(34) /**< \brief ADC0 signal: PTCXY20 on PB02 mux B */ +#define MUX_PB02B_ADC0_PTCXY20 _L_(1) +#define PINMUX_PB02B_ADC0_PTCXY20 ((PIN_PB02B_ADC0_PTCXY20 << 16) | MUX_PB02B_ADC0_PTCXY20) +#define PORT_PB02B_ADC0_PTCXY20 (_UL_(1) << 2) +#define PIN_PB03B_ADC0_PTCXY21 _L_(35) /**< \brief ADC0 signal: PTCXY21 on PB03 mux B */ +#define MUX_PB03B_ADC0_PTCXY21 _L_(1) +#define PINMUX_PB03B_ADC0_PTCXY21 ((PIN_PB03B_ADC0_PTCXY21 << 16) | MUX_PB03B_ADC0_PTCXY21) +#define PORT_PB03B_ADC0_PTCXY21 (_UL_(1) << 3) +#define PIN_PB04B_ADC0_PTCXY22 _L_(36) /**< \brief ADC0 signal: PTCXY22 on PB04 mux B */ +#define MUX_PB04B_ADC0_PTCXY22 _L_(1) +#define PINMUX_PB04B_ADC0_PTCXY22 ((PIN_PB04B_ADC0_PTCXY22 << 16) | MUX_PB04B_ADC0_PTCXY22) +#define PORT_PB04B_ADC0_PTCXY22 (_UL_(1) << 4) +#define PIN_PB05B_ADC0_PTCXY23 _L_(37) /**< \brief ADC0 signal: PTCXY23 on PB05 mux B */ +#define MUX_PB05B_ADC0_PTCXY23 _L_(1) +#define PINMUX_PB05B_ADC0_PTCXY23 ((PIN_PB05B_ADC0_PTCXY23 << 16) | MUX_PB05B_ADC0_PTCXY23) +#define PORT_PB05B_ADC0_PTCXY23 (_UL_(1) << 5) +#define PIN_PB06B_ADC0_PTCXY24 _L_(38) /**< \brief ADC0 signal: PTCXY24 on PB06 mux B */ +#define MUX_PB06B_ADC0_PTCXY24 _L_(1) +#define PINMUX_PB06B_ADC0_PTCXY24 ((PIN_PB06B_ADC0_PTCXY24 << 16) | MUX_PB06B_ADC0_PTCXY24) +#define PORT_PB06B_ADC0_PTCXY24 (_UL_(1) << 6) +#define PIN_PB07B_ADC0_PTCXY25 _L_(39) /**< \brief ADC0 signal: PTCXY25 on PB07 mux B */ +#define MUX_PB07B_ADC0_PTCXY25 _L_(1) +#define PINMUX_PB07B_ADC0_PTCXY25 ((PIN_PB07B_ADC0_PTCXY25 << 16) | MUX_PB07B_ADC0_PTCXY25) +#define PORT_PB07B_ADC0_PTCXY25 (_UL_(1) << 7) +#define PIN_PB12B_ADC0_PTCXY26 _L_(44) /**< \brief ADC0 signal: PTCXY26 on PB12 mux B */ +#define MUX_PB12B_ADC0_PTCXY26 _L_(1) +#define PINMUX_PB12B_ADC0_PTCXY26 ((PIN_PB12B_ADC0_PTCXY26 << 16) | MUX_PB12B_ADC0_PTCXY26) +#define PORT_PB12B_ADC0_PTCXY26 (_UL_(1) << 12) +#define PIN_PB13B_ADC0_PTCXY27 _L_(45) /**< \brief ADC0 signal: PTCXY27 on PB13 mux B */ +#define MUX_PB13B_ADC0_PTCXY27 _L_(1) +#define PINMUX_PB13B_ADC0_PTCXY27 ((PIN_PB13B_ADC0_PTCXY27 << 16) | MUX_PB13B_ADC0_PTCXY27) +#define PORT_PB13B_ADC0_PTCXY27 (_UL_(1) << 13) +#define PIN_PB14B_ADC0_PTCXY28 _L_(46) /**< \brief ADC0 signal: PTCXY28 on PB14 mux B */ +#define MUX_PB14B_ADC0_PTCXY28 _L_(1) +#define PINMUX_PB14B_ADC0_PTCXY28 ((PIN_PB14B_ADC0_PTCXY28 << 16) | MUX_PB14B_ADC0_PTCXY28) +#define PORT_PB14B_ADC0_PTCXY28 (_UL_(1) << 14) +#define PIN_PB15B_ADC0_PTCXY29 _L_(47) /**< \brief ADC0 signal: PTCXY29 on PB15 mux B */ +#define MUX_PB15B_ADC0_PTCXY29 _L_(1) +#define PINMUX_PB15B_ADC0_PTCXY29 ((PIN_PB15B_ADC0_PTCXY29 << 16) | MUX_PB15B_ADC0_PTCXY29) +#define PORT_PB15B_ADC0_PTCXY29 (_UL_(1) << 15) +#define PIN_PB00B_ADC0_PTCXY30 _L_(32) /**< \brief ADC0 signal: PTCXY30 on PB00 mux B */ +#define MUX_PB00B_ADC0_PTCXY30 _L_(1) +#define PINMUX_PB00B_ADC0_PTCXY30 ((PIN_PB00B_ADC0_PTCXY30 << 16) | MUX_PB00B_ADC0_PTCXY30) +#define PORT_PB00B_ADC0_PTCXY30 (_UL_(1) << 0) +#define PIN_PB01B_ADC0_PTCXY31 _L_(33) /**< \brief ADC0 signal: PTCXY31 on PB01 mux B */ +#define MUX_PB01B_ADC0_PTCXY31 _L_(1) +#define PINMUX_PB01B_ADC0_PTCXY31 ((PIN_PB01B_ADC0_PTCXY31 << 16) | MUX_PB01B_ADC0_PTCXY31) +#define PORT_PB01B_ADC0_PTCXY31 (_UL_(1) << 1) +/* ========== PORT definition for ADC1 peripheral ========== */ +#define PIN_PB08B_ADC1_AIN0 _L_(40) /**< \brief ADC1 signal: AIN0 on PB08 mux B */ +#define MUX_PB08B_ADC1_AIN0 _L_(1) +#define PINMUX_PB08B_ADC1_AIN0 ((PIN_PB08B_ADC1_AIN0 << 16) | MUX_PB08B_ADC1_AIN0) +#define PORT_PB08B_ADC1_AIN0 (_UL_(1) << 8) +#define PIN_PB09B_ADC1_AIN1 _L_(41) /**< \brief ADC1 signal: AIN1 on PB09 mux B */ +#define MUX_PB09B_ADC1_AIN1 _L_(1) +#define PINMUX_PB09B_ADC1_AIN1 ((PIN_PB09B_ADC1_AIN1 << 16) | MUX_PB09B_ADC1_AIN1) +#define PORT_PB09B_ADC1_AIN1 (_UL_(1) << 9) +#define PIN_PA08B_ADC1_AIN2 _L_(8) /**< \brief ADC1 signal: AIN2 on PA08 mux B */ +#define MUX_PA08B_ADC1_AIN2 _L_(1) +#define PINMUX_PA08B_ADC1_AIN2 ((PIN_PA08B_ADC1_AIN2 << 16) | MUX_PA08B_ADC1_AIN2) +#define PORT_PA08B_ADC1_AIN2 (_UL_(1) << 8) +#define PIN_PA09B_ADC1_AIN3 _L_(9) /**< \brief ADC1 signal: AIN3 on PA09 mux B */ +#define MUX_PA09B_ADC1_AIN3 _L_(1) +#define PINMUX_PA09B_ADC1_AIN3 ((PIN_PA09B_ADC1_AIN3 << 16) | MUX_PA09B_ADC1_AIN3) +#define PORT_PA09B_ADC1_AIN3 (_UL_(1) << 9) +#define PIN_PB04B_ADC1_AIN6 _L_(36) /**< \brief ADC1 signal: AIN6 on PB04 mux B */ +#define MUX_PB04B_ADC1_AIN6 _L_(1) +#define PINMUX_PB04B_ADC1_AIN6 ((PIN_PB04B_ADC1_AIN6 << 16) | MUX_PB04B_ADC1_AIN6) +#define PORT_PB04B_ADC1_AIN6 (_UL_(1) << 4) +#define PIN_PB05B_ADC1_AIN7 _L_(37) /**< \brief ADC1 signal: AIN7 on PB05 mux B */ +#define MUX_PB05B_ADC1_AIN7 _L_(1) +#define PINMUX_PB05B_ADC1_AIN7 ((PIN_PB05B_ADC1_AIN7 << 16) | MUX_PB05B_ADC1_AIN7) +#define PORT_PB05B_ADC1_AIN7 (_UL_(1) << 5) +#define PIN_PB06B_ADC1_AIN8 _L_(38) /**< \brief ADC1 signal: AIN8 on PB06 mux B */ +#define MUX_PB06B_ADC1_AIN8 _L_(1) +#define PINMUX_PB06B_ADC1_AIN8 ((PIN_PB06B_ADC1_AIN8 << 16) | MUX_PB06B_ADC1_AIN8) +#define PORT_PB06B_ADC1_AIN8 (_UL_(1) << 6) +#define PIN_PB07B_ADC1_AIN9 _L_(39) /**< \brief ADC1 signal: AIN9 on PB07 mux B */ +#define MUX_PB07B_ADC1_AIN9 _L_(1) +#define PINMUX_PB07B_ADC1_AIN9 ((PIN_PB07B_ADC1_AIN9 << 16) | MUX_PB07B_ADC1_AIN9) +#define PORT_PB07B_ADC1_AIN9 (_UL_(1) << 7) +/* ========== PORT definition for DAC peripheral ========== */ +#define PIN_PA02B_DAC_VOUT0 _L_(2) /**< \brief DAC signal: VOUT0 on PA02 mux B */ +#define MUX_PA02B_DAC_VOUT0 _L_(1) +#define PINMUX_PA02B_DAC_VOUT0 ((PIN_PA02B_DAC_VOUT0 << 16) | MUX_PA02B_DAC_VOUT0) +#define PORT_PA02B_DAC_VOUT0 (_UL_(1) << 2) +#define PIN_PA05B_DAC_VOUT1 _L_(5) /**< \brief DAC signal: VOUT1 on PA05 mux B */ +#define MUX_PA05B_DAC_VOUT1 _L_(1) +#define PINMUX_PA05B_DAC_VOUT1 ((PIN_PA05B_DAC_VOUT1 << 16) | MUX_PA05B_DAC_VOUT1) +#define PORT_PA05B_DAC_VOUT1 (_UL_(1) << 5) +/* ========== PORT definition for I2S peripheral ========== */ +#define PIN_PA09J_I2S_FS0 _L_(9) /**< \brief I2S signal: FS0 on PA09 mux J */ +#define MUX_PA09J_I2S_FS0 _L_(9) +#define PINMUX_PA09J_I2S_FS0 ((PIN_PA09J_I2S_FS0 << 16) | MUX_PA09J_I2S_FS0) +#define PORT_PA09J_I2S_FS0 (_UL_(1) << 9) +#define PIN_PA20J_I2S_FS0 _L_(20) /**< \brief I2S signal: FS0 on PA20 mux J */ +#define MUX_PA20J_I2S_FS0 _L_(9) +#define PINMUX_PA20J_I2S_FS0 ((PIN_PA20J_I2S_FS0 << 16) | MUX_PA20J_I2S_FS0) +#define PORT_PA20J_I2S_FS0 (_UL_(1) << 20) +#define PIN_PA23J_I2S_FS1 _L_(23) /**< \brief I2S signal: FS1 on PA23 mux J */ +#define MUX_PA23J_I2S_FS1 _L_(9) +#define PINMUX_PA23J_I2S_FS1 ((PIN_PA23J_I2S_FS1 << 16) | MUX_PA23J_I2S_FS1) +#define PORT_PA23J_I2S_FS1 (_UL_(1) << 23) +#define PIN_PB11J_I2S_FS1 _L_(43) /**< \brief I2S signal: FS1 on PB11 mux J */ +#define MUX_PB11J_I2S_FS1 _L_(9) +#define PINMUX_PB11J_I2S_FS1 ((PIN_PB11J_I2S_FS1 << 16) | MUX_PB11J_I2S_FS1) +#define PORT_PB11J_I2S_FS1 (_UL_(1) << 11) +#define PIN_PA08J_I2S_MCK0 _L_(8) /**< \brief I2S signal: MCK0 on PA08 mux J */ +#define MUX_PA08J_I2S_MCK0 _L_(9) +#define PINMUX_PA08J_I2S_MCK0 ((PIN_PA08J_I2S_MCK0 << 16) | MUX_PA08J_I2S_MCK0) +#define PORT_PA08J_I2S_MCK0 (_UL_(1) << 8) +#define PIN_PB17J_I2S_MCK0 _L_(49) /**< \brief I2S signal: MCK0 on PB17 mux J */ +#define MUX_PB17J_I2S_MCK0 _L_(9) +#define PINMUX_PB17J_I2S_MCK0 ((PIN_PB17J_I2S_MCK0 << 16) | MUX_PB17J_I2S_MCK0) +#define PORT_PB17J_I2S_MCK0 (_UL_(1) << 17) +#define PIN_PB13J_I2S_MCK1 _L_(45) /**< \brief I2S signal: MCK1 on PB13 mux J */ +#define MUX_PB13J_I2S_MCK1 _L_(9) +#define PINMUX_PB13J_I2S_MCK1 ((PIN_PB13J_I2S_MCK1 << 16) | MUX_PB13J_I2S_MCK1) +#define PORT_PB13J_I2S_MCK1 (_UL_(1) << 13) +#define PIN_PA10J_I2S_SCK0 _L_(10) /**< \brief I2S signal: SCK0 on PA10 mux J */ +#define MUX_PA10J_I2S_SCK0 _L_(9) +#define PINMUX_PA10J_I2S_SCK0 ((PIN_PA10J_I2S_SCK0 << 16) | MUX_PA10J_I2S_SCK0) +#define PORT_PA10J_I2S_SCK0 (_UL_(1) << 10) +#define PIN_PB16J_I2S_SCK0 _L_(48) /**< \brief I2S signal: SCK0 on PB16 mux J */ +#define MUX_PB16J_I2S_SCK0 _L_(9) +#define PINMUX_PB16J_I2S_SCK0 ((PIN_PB16J_I2S_SCK0 << 16) | MUX_PB16J_I2S_SCK0) +#define PORT_PB16J_I2S_SCK0 (_UL_(1) << 16) +#define PIN_PB12J_I2S_SCK1 _L_(44) /**< \brief I2S signal: SCK1 on PB12 mux J */ +#define MUX_PB12J_I2S_SCK1 _L_(9) +#define PINMUX_PB12J_I2S_SCK1 ((PIN_PB12J_I2S_SCK1 << 16) | MUX_PB12J_I2S_SCK1) +#define PORT_PB12J_I2S_SCK1 (_UL_(1) << 12) +#define PIN_PA22J_I2S_SDI _L_(22) /**< \brief I2S signal: SDI on PA22 mux J */ +#define MUX_PA22J_I2S_SDI _L_(9) +#define PINMUX_PA22J_I2S_SDI ((PIN_PA22J_I2S_SDI << 16) | MUX_PA22J_I2S_SDI) +#define PORT_PA22J_I2S_SDI (_UL_(1) << 22) +#define PIN_PB10J_I2S_SDI _L_(42) /**< \brief I2S signal: SDI on PB10 mux J */ +#define MUX_PB10J_I2S_SDI _L_(9) +#define PINMUX_PB10J_I2S_SDI ((PIN_PB10J_I2S_SDI << 16) | MUX_PB10J_I2S_SDI) +#define PORT_PB10J_I2S_SDI (_UL_(1) << 10) +#define PIN_PA11J_I2S_SDO _L_(11) /**< \brief I2S signal: SDO on PA11 mux J */ +#define MUX_PA11J_I2S_SDO _L_(9) +#define PINMUX_PA11J_I2S_SDO ((PIN_PA11J_I2S_SDO << 16) | MUX_PA11J_I2S_SDO) +#define PORT_PA11J_I2S_SDO (_UL_(1) << 11) +#define PIN_PA21J_I2S_SDO _L_(21) /**< \brief I2S signal: SDO on PA21 mux J */ +#define MUX_PA21J_I2S_SDO _L_(9) +#define PINMUX_PA21J_I2S_SDO ((PIN_PA21J_I2S_SDO << 16) | MUX_PA21J_I2S_SDO) +#define PORT_PA21J_I2S_SDO (_UL_(1) << 21) +/* ========== PORT definition for PCC peripheral ========== */ +#define PIN_PA14K_PCC_CLK _L_(14) /**< \brief PCC signal: CLK on PA14 mux K */ +#define MUX_PA14K_PCC_CLK _L_(10) +#define PINMUX_PA14K_PCC_CLK ((PIN_PA14K_PCC_CLK << 16) | MUX_PA14K_PCC_CLK) +#define PORT_PA14K_PCC_CLK (_UL_(1) << 14) +#define PIN_PA16K_PCC_DATA0 _L_(16) /**< \brief PCC signal: DATA0 on PA16 mux K */ +#define MUX_PA16K_PCC_DATA0 _L_(10) +#define PINMUX_PA16K_PCC_DATA0 ((PIN_PA16K_PCC_DATA0 << 16) | MUX_PA16K_PCC_DATA0) +#define PORT_PA16K_PCC_DATA0 (_UL_(1) << 16) +#define PIN_PA17K_PCC_DATA1 _L_(17) /**< \brief PCC signal: DATA1 on PA17 mux K */ +#define MUX_PA17K_PCC_DATA1 _L_(10) +#define PINMUX_PA17K_PCC_DATA1 ((PIN_PA17K_PCC_DATA1 << 16) | MUX_PA17K_PCC_DATA1) +#define PORT_PA17K_PCC_DATA1 (_UL_(1) << 17) +#define PIN_PA18K_PCC_DATA2 _L_(18) /**< \brief PCC signal: DATA2 on PA18 mux K */ +#define MUX_PA18K_PCC_DATA2 _L_(10) +#define PINMUX_PA18K_PCC_DATA2 ((PIN_PA18K_PCC_DATA2 << 16) | MUX_PA18K_PCC_DATA2) +#define PORT_PA18K_PCC_DATA2 (_UL_(1) << 18) +#define PIN_PA19K_PCC_DATA3 _L_(19) /**< \brief PCC signal: DATA3 on PA19 mux K */ +#define MUX_PA19K_PCC_DATA3 _L_(10) +#define PINMUX_PA19K_PCC_DATA3 ((PIN_PA19K_PCC_DATA3 << 16) | MUX_PA19K_PCC_DATA3) +#define PORT_PA19K_PCC_DATA3 (_UL_(1) << 19) +#define PIN_PA20K_PCC_DATA4 _L_(20) /**< \brief PCC signal: DATA4 on PA20 mux K */ +#define MUX_PA20K_PCC_DATA4 _L_(10) +#define PINMUX_PA20K_PCC_DATA4 ((PIN_PA20K_PCC_DATA4 << 16) | MUX_PA20K_PCC_DATA4) +#define PORT_PA20K_PCC_DATA4 (_UL_(1) << 20) +#define PIN_PA21K_PCC_DATA5 _L_(21) /**< \brief PCC signal: DATA5 on PA21 mux K */ +#define MUX_PA21K_PCC_DATA5 _L_(10) +#define PINMUX_PA21K_PCC_DATA5 ((PIN_PA21K_PCC_DATA5 << 16) | MUX_PA21K_PCC_DATA5) +#define PORT_PA21K_PCC_DATA5 (_UL_(1) << 21) +#define PIN_PA22K_PCC_DATA6 _L_(22) /**< \brief PCC signal: DATA6 on PA22 mux K */ +#define MUX_PA22K_PCC_DATA6 _L_(10) +#define PINMUX_PA22K_PCC_DATA6 ((PIN_PA22K_PCC_DATA6 << 16) | MUX_PA22K_PCC_DATA6) +#define PORT_PA22K_PCC_DATA6 (_UL_(1) << 22) +#define PIN_PA23K_PCC_DATA7 _L_(23) /**< \brief PCC signal: DATA7 on PA23 mux K */ +#define MUX_PA23K_PCC_DATA7 _L_(10) +#define PINMUX_PA23K_PCC_DATA7 ((PIN_PA23K_PCC_DATA7 << 16) | MUX_PA23K_PCC_DATA7) +#define PORT_PA23K_PCC_DATA7 (_UL_(1) << 23) +#define PIN_PB14K_PCC_DATA8 _L_(46) /**< \brief PCC signal: DATA8 on PB14 mux K */ +#define MUX_PB14K_PCC_DATA8 _L_(10) +#define PINMUX_PB14K_PCC_DATA8 ((PIN_PB14K_PCC_DATA8 << 16) | MUX_PB14K_PCC_DATA8) +#define PORT_PB14K_PCC_DATA8 (_UL_(1) << 14) +#define PIN_PB15K_PCC_DATA9 _L_(47) /**< \brief PCC signal: DATA9 on PB15 mux K */ +#define MUX_PB15K_PCC_DATA9 _L_(10) +#define PINMUX_PB15K_PCC_DATA9 ((PIN_PB15K_PCC_DATA9 << 16) | MUX_PB15K_PCC_DATA9) +#define PORT_PB15K_PCC_DATA9 (_UL_(1) << 15) +#define PIN_PA12K_PCC_DEN1 _L_(12) /**< \brief PCC signal: DEN1 on PA12 mux K */ +#define MUX_PA12K_PCC_DEN1 _L_(10) +#define PINMUX_PA12K_PCC_DEN1 ((PIN_PA12K_PCC_DEN1 << 16) | MUX_PA12K_PCC_DEN1) +#define PORT_PA12K_PCC_DEN1 (_UL_(1) << 12) +#define PIN_PA13K_PCC_DEN2 _L_(13) /**< \brief PCC signal: DEN2 on PA13 mux K */ +#define MUX_PA13K_PCC_DEN2 _L_(10) +#define PINMUX_PA13K_PCC_DEN2 ((PIN_PA13K_PCC_DEN2 << 16) | MUX_PA13K_PCC_DEN2) +#define PORT_PA13K_PCC_DEN2 (_UL_(1) << 13) +/* ========== PORT definition for SDHC0 peripheral ========== */ +#define PIN_PA06I_SDHC0_SDCD _L_(6) /**< \brief SDHC0 signal: SDCD on PA06 mux I */ +#define MUX_PA06I_SDHC0_SDCD _L_(8) +#define PINMUX_PA06I_SDHC0_SDCD ((PIN_PA06I_SDHC0_SDCD << 16) | MUX_PA06I_SDHC0_SDCD) +#define PORT_PA06I_SDHC0_SDCD (_UL_(1) << 6) +#define PIN_PA12I_SDHC0_SDCD _L_(12) /**< \brief SDHC0 signal: SDCD on PA12 mux I */ +#define MUX_PA12I_SDHC0_SDCD _L_(8) +#define PINMUX_PA12I_SDHC0_SDCD ((PIN_PA12I_SDHC0_SDCD << 16) | MUX_PA12I_SDHC0_SDCD) +#define PORT_PA12I_SDHC0_SDCD (_UL_(1) << 12) +#define PIN_PB12I_SDHC0_SDCD _L_(44) /**< \brief SDHC0 signal: SDCD on PB12 mux I */ +#define MUX_PB12I_SDHC0_SDCD _L_(8) +#define PINMUX_PB12I_SDHC0_SDCD ((PIN_PB12I_SDHC0_SDCD << 16) | MUX_PB12I_SDHC0_SDCD) +#define PORT_PB12I_SDHC0_SDCD (_UL_(1) << 12) +#define PIN_PB11I_SDHC0_SDCK _L_(43) /**< \brief SDHC0 signal: SDCK on PB11 mux I */ +#define MUX_PB11I_SDHC0_SDCK _L_(8) +#define PINMUX_PB11I_SDHC0_SDCK ((PIN_PB11I_SDHC0_SDCK << 16) | MUX_PB11I_SDHC0_SDCK) +#define PORT_PB11I_SDHC0_SDCK (_UL_(1) << 11) +#define PIN_PA08I_SDHC0_SDCMD _L_(8) /**< \brief SDHC0 signal: SDCMD on PA08 mux I */ +#define MUX_PA08I_SDHC0_SDCMD _L_(8) +#define PINMUX_PA08I_SDHC0_SDCMD ((PIN_PA08I_SDHC0_SDCMD << 16) | MUX_PA08I_SDHC0_SDCMD) +#define PORT_PA08I_SDHC0_SDCMD (_UL_(1) << 8) +#define PIN_PA09I_SDHC0_SDDAT0 _L_(9) /**< \brief SDHC0 signal: SDDAT0 on PA09 mux I */ +#define MUX_PA09I_SDHC0_SDDAT0 _L_(8) +#define PINMUX_PA09I_SDHC0_SDDAT0 ((PIN_PA09I_SDHC0_SDDAT0 << 16) | MUX_PA09I_SDHC0_SDDAT0) +#define PORT_PA09I_SDHC0_SDDAT0 (_UL_(1) << 9) +#define PIN_PA10I_SDHC0_SDDAT1 _L_(10) /**< \brief SDHC0 signal: SDDAT1 on PA10 mux I */ +#define MUX_PA10I_SDHC0_SDDAT1 _L_(8) +#define PINMUX_PA10I_SDHC0_SDDAT1 ((PIN_PA10I_SDHC0_SDDAT1 << 16) | MUX_PA10I_SDHC0_SDDAT1) +#define PORT_PA10I_SDHC0_SDDAT1 (_UL_(1) << 10) +#define PIN_PA11I_SDHC0_SDDAT2 _L_(11) /**< \brief SDHC0 signal: SDDAT2 on PA11 mux I */ +#define MUX_PA11I_SDHC0_SDDAT2 _L_(8) +#define PINMUX_PA11I_SDHC0_SDDAT2 ((PIN_PA11I_SDHC0_SDDAT2 << 16) | MUX_PA11I_SDHC0_SDDAT2) +#define PORT_PA11I_SDHC0_SDDAT2 (_UL_(1) << 11) +#define PIN_PB10I_SDHC0_SDDAT3 _L_(42) /**< \brief SDHC0 signal: SDDAT3 on PB10 mux I */ +#define MUX_PB10I_SDHC0_SDDAT3 _L_(8) +#define PINMUX_PB10I_SDHC0_SDDAT3 ((PIN_PB10I_SDHC0_SDDAT3 << 16) | MUX_PB10I_SDHC0_SDDAT3) +#define PORT_PB10I_SDHC0_SDDAT3 (_UL_(1) << 10) +#define PIN_PA07I_SDHC0_SDWP _L_(7) /**< \brief SDHC0 signal: SDWP on PA07 mux I */ +#define MUX_PA07I_SDHC0_SDWP _L_(8) +#define PINMUX_PA07I_SDHC0_SDWP ((PIN_PA07I_SDHC0_SDWP << 16) | MUX_PA07I_SDHC0_SDWP) +#define PORT_PA07I_SDHC0_SDWP (_UL_(1) << 7) +#define PIN_PA13I_SDHC0_SDWP _L_(13) /**< \brief SDHC0 signal: SDWP on PA13 mux I */ +#define MUX_PA13I_SDHC0_SDWP _L_(8) +#define PINMUX_PA13I_SDHC0_SDWP ((PIN_PA13I_SDHC0_SDWP << 16) | MUX_PA13I_SDHC0_SDWP) +#define PORT_PA13I_SDHC0_SDWP (_UL_(1) << 13) +#define PIN_PB13I_SDHC0_SDWP _L_(45) /**< \brief SDHC0 signal: SDWP on PB13 mux I */ +#define MUX_PB13I_SDHC0_SDWP _L_(8) +#define PINMUX_PB13I_SDHC0_SDWP ((PIN_PB13I_SDHC0_SDWP << 16) | MUX_PB13I_SDHC0_SDWP) +#define PORT_PB13I_SDHC0_SDWP (_UL_(1) << 13) + +#endif /* _SAMD51J18A_PIO_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/sam.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/sam.h new file mode 100644 index 0000000000..9009b6d653 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/sam.h @@ -0,0 +1,54 @@ +/** + * \file + * + * \brief Top level header file + * + * Copyright (c) 2017 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc. + * + * \license_start + * + * \page License + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \license_stop + * + */ + +#ifndef _SAM_ +#define _SAM_ + +#if defined(__SAMD51G18A__) || defined(__ATSAMD51G18A__) + #include "samd51g18a.h" +#elif defined(__SAMD51G19A__) || defined(__ATSAMD51G19A__) + #include "samd51g19a.h" +#elif defined(__SAMD51J18A__) || defined(__ATSAMD51J18A__) + #include "samd51j18a.h" +#elif defined(__SAMD51J19A__) || defined(__ATSAMD51J19A__) + #include "samd51j19a.h" +#elif defined(__SAMD51J20A__) || defined(__ATSAMD51J20A__) + #include "samd51j20a.h" +#elif defined(__SAMD51N19A__) || defined(__ATSAMD51N19A__) + #include "samd51n19a.h" +#elif defined(__SAMD51N20A__) || defined(__ATSAMD51N20A__) + #include "samd51n20a.h" +#elif defined(__SAMD51P19A__) || defined(__ATSAMD51P19A__) + #include "samd51p19a.h" +#elif defined(__SAMD51P20A__) || defined(__ATSAMD51P20A__) + #include "samd51p20a.h" +#else + #error Library does not support the specified device +#endif + +#endif /* _SAM_ */ + diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51.h new file mode 100644 index 0000000000..d08ac64cb8 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51.h @@ -0,0 +1,60 @@ +/** + * \file + * + * \brief Top header file for SAMD51 + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51_ +#define _SAMD51_ + +/** + * \defgroup SAMD51_definitions SAMD51 Device Definitions + * \brief SAMD51 CMSIS Definitions. + */ + +#if defined(__SAMD51G18A__) || defined(__ATSAMD51G18A__) + #include "samd51g18a.h" +#elif defined(__SAMD51G19A__) || defined(__ATSAMD51G19A__) + #include "samd51g19a.h" +#elif defined(__SAMD51J18A__) || defined(__ATSAMD51J18A__) + #include "samd51j18a.h" +#elif defined(__SAMD51J19A__) || defined(__ATSAMD51J19A__) + #include "samd51j19a.h" +#elif defined(__SAMD51J20A__) || defined(__ATSAMD51J20A__) + #include "samd51j20a.h" +#elif defined(__SAMD51N19A__) || defined(__ATSAMD51N19A__) + #include "samd51n19a.h" +#elif defined(__SAMD51N20A__) || defined(__ATSAMD51N20A__) + #include "samd51n20a.h" +#elif defined(__SAMD51P19A__) || defined(__ATSAMD51P19A__) + #include "samd51p19a.h" +#elif defined(__SAMD51P20A__) || defined(__ATSAMD51P20A__) + #include "samd51p20a.h" +#else + #error Library does not support the specified device. +#endif + +#endif /* _SAMD51_ */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h new file mode 100644 index 0000000000..5cfccdfc84 --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/samd51j18a.h @@ -0,0 +1,1079 @@ +/** + * \file + * + * \brief Header file for SAMD51J18A + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SAMD51J18A_ +#define _SAMD51J18A_ + +/** + * \ingroup SAMD51_definitions + * \addtogroup SAMD51J18A_definitions SAMD51J18A definitions + * This file defines all structures and symbols for SAMD51J18A: + * - registers and bitfields + * - peripheral base address + * - peripheral ID + * - PIO definitions +*/ +/*@{*/ + +#ifdef __cplusplus + extern "C" { +#endif + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +#include +#ifndef __cplusplus +typedef volatile const uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */ +typedef volatile const uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */ +typedef volatile const uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */ +#else +typedef volatile uint32_t RoReg; /**< Read only 32-bit register (volatile const unsigned int) */ +typedef volatile uint16_t RoReg16; /**< Read only 16-bit register (volatile const unsigned int) */ +typedef volatile uint8_t RoReg8; /**< Read only 8-bit register (volatile const unsigned int) */ +#endif +typedef volatile uint32_t WoReg; /**< Write only 32-bit register (volatile unsigned int) */ +typedef volatile uint16_t WoReg16; /**< Write only 16-bit register (volatile unsigned int) */ +typedef volatile uint8_t WoReg8; /**< Write only 8-bit register (volatile unsigned int) */ +typedef volatile uint32_t RwReg; /**< Read-Write 32-bit register (volatile unsigned int) */ +typedef volatile uint16_t RwReg16; /**< Read-Write 16-bit register (volatile unsigned int) */ +typedef volatile uint8_t RwReg8; /**< Read-Write 8-bit register (volatile unsigned int) */ +#endif + +#if !defined(SKIP_INTEGER_LITERALS) +#if defined(_U_) || defined(_L_) || defined(_UL_) + #error "Integer Literals macros already defined elsewhere" +#endif + +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +/* Macros that deal with adding suffixes to integer literal constants for C/C++ */ +#define _U_(x) x ## U /**< C code: Unsigned integer literal constant value */ +#define _L_(x) x ## L /**< C code: Long integer literal constant value */ +#define _UL_(x) x ## UL /**< C code: Unsigned Long integer literal constant value */ +#else /* Assembler */ +#define _U_(x) x /**< Assembler: Unsigned integer literal constant value */ +#define _L_(x) x /**< Assembler: Long integer literal constant value */ +#define _UL_(x) x /**< Assembler: Unsigned Long integer literal constant value */ +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +#endif /* SKIP_INTEGER_LITERALS */ + +/* ************************************************************************** */ +/** CMSIS DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_cmsis CMSIS Definitions */ +/*@{*/ + +/** Interrupt Number Definition */ +typedef enum IRQn +{ + /****** Cortex-M4 Processor Exceptions Numbers ******************************/ + NonMaskableInt_IRQn = -14,/**< 2 Non Maskable Interrupt */ + HardFault_IRQn = -13,/**< 3 Cortex-M4 Hard Fault Interrupt */ + MemoryManagement_IRQn = -12,/**< 4 Cortex-M4 Memory Management Interrupt */ + BusFault_IRQn = -11,/**< 5 Cortex-M4 Bus Fault Interrupt */ + UsageFault_IRQn = -10,/**< 6 Cortex-M4 Usage Fault Interrupt */ + SVCall_IRQn = -5, /**< 11 Cortex-M4 SV Call Interrupt */ + DebugMonitor_IRQn = -4, /**< 12 Cortex-M4 Debug Monitor Interrupt */ + PendSV_IRQn = -2, /**< 14 Cortex-M4 Pend SV Interrupt */ + SysTick_IRQn = -1, /**< 15 Cortex-M4 System Tick Interrupt */ + /****** SAMD51J18A-specific Interrupt Numbers ***********************/ + PM_IRQn = 0, /**< 0 SAMD51J18A Power Manager (PM) */ + MCLK_IRQn = 1, /**< 1 SAMD51J18A Main Clock (MCLK) */ + OSCCTRL_0_IRQn = 2, /**< 2 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */ + OSCCTRL_1_IRQn = 3, /**< 3 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */ + OSCCTRL_2_IRQn = 4, /**< 4 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */ + OSCCTRL_3_IRQn = 5, /**< 5 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */ + OSCCTRL_4_IRQn = 6, /**< 6 SAMD51J18A Oscillators Control (OSCCTRL): OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */ + OSC32KCTRL_IRQn = 7, /**< 7 SAMD51J18A 32kHz Oscillators Control (OSC32KCTRL) */ + SUPC_0_IRQn = 8, /**< 8 SAMD51J18A Supply Controller (SUPC): SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */ + SUPC_1_IRQn = 9, /**< 9 SAMD51J18A Supply Controller (SUPC): SUPC_BOD12DET, SUPC_BOD33DET */ + WDT_IRQn = 10, /**< 10 SAMD51J18A Watchdog Timer (WDT) */ + RTC_IRQn = 11, /**< 11 SAMD51J18A Real-Time Counter (RTC) */ + EIC_0_IRQn = 12, /**< 12 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_0 */ + EIC_1_IRQn = 13, /**< 13 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_1 */ + EIC_2_IRQn = 14, /**< 14 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_2 */ + EIC_3_IRQn = 15, /**< 15 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_3 */ + EIC_4_IRQn = 16, /**< 16 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_4 */ + EIC_5_IRQn = 17, /**< 17 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_5 */ + EIC_6_IRQn = 18, /**< 18 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_6 */ + EIC_7_IRQn = 19, /**< 19 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_7 */ + EIC_8_IRQn = 20, /**< 20 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_8 */ + EIC_9_IRQn = 21, /**< 21 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_9 */ + EIC_10_IRQn = 22, /**< 22 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_10 */ + EIC_11_IRQn = 23, /**< 23 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_11 */ + EIC_12_IRQn = 24, /**< 24 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_12 */ + EIC_13_IRQn = 25, /**< 25 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_13 */ + EIC_14_IRQn = 26, /**< 26 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_14 */ + EIC_15_IRQn = 27, /**< 27 SAMD51J18A External Interrupt Controller (EIC): EIC_EXTINT_15 */ + FREQM_IRQn = 28, /**< 28 SAMD51J18A Frequency Meter (FREQM) */ + NVMCTRL_0_IRQn = 29, /**< 29 SAMD51J18A Non-Volatile Memory Controller (NVMCTRL): NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */ + NVMCTRL_1_IRQn = 30, /**< 30 SAMD51J18A Non-Volatile Memory Controller (NVMCTRL): NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */ + DMAC_0_IRQn = 31, /**< 31 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */ + DMAC_1_IRQn = 32, /**< 32 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */ + DMAC_2_IRQn = 33, /**< 33 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */ + DMAC_3_IRQn = 34, /**< 34 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */ + DMAC_4_IRQn = 35, /**< 35 SAMD51J18A Direct Memory Access Controller (DMAC): DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */ + EVSYS_0_IRQn = 36, /**< 36 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_0, EVSYS_OVR_0 */ + EVSYS_1_IRQn = 37, /**< 37 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_1, EVSYS_OVR_1 */ + EVSYS_2_IRQn = 38, /**< 38 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_2, EVSYS_OVR_2 */ + EVSYS_3_IRQn = 39, /**< 39 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_3, EVSYS_OVR_3 */ + EVSYS_4_IRQn = 40, /**< 40 SAMD51J18A Event System Interface (EVSYS): EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */ + PAC_IRQn = 41, /**< 41 SAMD51J18A Peripheral Access Controller (PAC) */ + TAL_0_IRQn = 42, /**< 42 SAMD51J18A Trigger Allocator (TAL): TAL_BRK */ + TAL_1_IRQn = 43, /**< 43 SAMD51J18A Trigger Allocator (TAL): TAL_IPS_0, TAL_IPS_1 */ + RAMECC_IRQn = 45, /**< 45 SAMD51J18A RAM ECC (RAMECC) */ + SERCOM0_0_IRQn = 46, /**< 46 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_0 */ + SERCOM0_1_IRQn = 47, /**< 47 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_1 */ + SERCOM0_2_IRQn = 48, /**< 48 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_2 */ + SERCOM0_3_IRQn = 49, /**< 49 SAMD51J18A Serial Communication Interface 0 (SERCOM0): SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */ + SERCOM1_0_IRQn = 50, /**< 50 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_0 */ + SERCOM1_1_IRQn = 51, /**< 51 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_1 */ + SERCOM1_2_IRQn = 52, /**< 52 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_2 */ + SERCOM1_3_IRQn = 53, /**< 53 SAMD51J18A Serial Communication Interface 1 (SERCOM1): SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */ + SERCOM2_0_IRQn = 54, /**< 54 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_0 */ + SERCOM2_1_IRQn = 55, /**< 55 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_1 */ + SERCOM2_2_IRQn = 56, /**< 56 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_2 */ + SERCOM2_3_IRQn = 57, /**< 57 SAMD51J18A Serial Communication Interface 2 (SERCOM2): SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */ + SERCOM3_0_IRQn = 58, /**< 58 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_0 */ + SERCOM3_1_IRQn = 59, /**< 59 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_1 */ + SERCOM3_2_IRQn = 60, /**< 60 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_2 */ + SERCOM3_3_IRQn = 61, /**< 61 SAMD51J18A Serial Communication Interface 3 (SERCOM3): SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */ + SERCOM4_0_IRQn = 62, /**< 62 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_0 */ + SERCOM4_1_IRQn = 63, /**< 63 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_1 */ + SERCOM4_2_IRQn = 64, /**< 64 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_2 */ + SERCOM4_3_IRQn = 65, /**< 65 SAMD51J18A Serial Communication Interface 4 (SERCOM4): SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */ + SERCOM5_0_IRQn = 66, /**< 66 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_0 */ + SERCOM5_1_IRQn = 67, /**< 67 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_1 */ + SERCOM5_2_IRQn = 68, /**< 68 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_2 */ + SERCOM5_3_IRQn = 69, /**< 69 SAMD51J18A Serial Communication Interface 5 (SERCOM5): SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */ + USB_0_IRQn = 80, /**< 80 SAMD51J18A Universal Serial Bus (USB): USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */ + USB_1_IRQn = 81, /**< 81 SAMD51J18A Universal Serial Bus (USB): USB_SOF_HSOF */ + USB_2_IRQn = 82, /**< 82 SAMD51J18A Universal Serial Bus (USB): USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */ + USB_3_IRQn = 83, /**< 83 SAMD51J18A Universal Serial Bus (USB): USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */ + TCC0_0_IRQn = 85, /**< 85 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */ + TCC0_1_IRQn = 86, /**< 86 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_0 */ + TCC0_2_IRQn = 87, /**< 87 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_1 */ + TCC0_3_IRQn = 88, /**< 88 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_2 */ + TCC0_4_IRQn = 89, /**< 89 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_3 */ + TCC0_5_IRQn = 90, /**< 90 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_4 */ + TCC0_6_IRQn = 91, /**< 91 SAMD51J18A Timer Counter Control 0 (TCC0): TCC0_MC_5 */ + TCC1_0_IRQn = 92, /**< 92 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */ + TCC1_1_IRQn = 93, /**< 93 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_0 */ + TCC1_2_IRQn = 94, /**< 94 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_1 */ + TCC1_3_IRQn = 95, /**< 95 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_2 */ + TCC1_4_IRQn = 96, /**< 96 SAMD51J18A Timer Counter Control 1 (TCC1): TCC1_MC_3 */ + TCC2_0_IRQn = 97, /**< 97 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */ + TCC2_1_IRQn = 98, /**< 98 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_0 */ + TCC2_2_IRQn = 99, /**< 99 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_1 */ + TCC2_3_IRQn = 100, /**< 100 SAMD51J18A Timer Counter Control 2 (TCC2): TCC2_MC_2 */ + TCC3_0_IRQn = 101, /**< 101 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */ + TCC3_1_IRQn = 102, /**< 102 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_MC_0 */ + TCC3_2_IRQn = 103, /**< 103 SAMD51J18A Timer Counter Control 3 (TCC3): TCC3_MC_1 */ + TCC4_0_IRQn = 104, /**< 104 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */ + TCC4_1_IRQn = 105, /**< 105 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_MC_0 */ + TCC4_2_IRQn = 106, /**< 106 SAMD51J18A Timer Counter Control 4 (TCC4): TCC4_MC_1 */ + TC0_IRQn = 107, /**< 107 SAMD51J18A Basic Timer Counter 0 (TC0) */ + TC1_IRQn = 108, /**< 108 SAMD51J18A Basic Timer Counter 1 (TC1) */ + TC2_IRQn = 109, /**< 109 SAMD51J18A Basic Timer Counter 2 (TC2) */ + TC3_IRQn = 110, /**< 110 SAMD51J18A Basic Timer Counter 3 (TC3) */ + TC4_IRQn = 111, /**< 111 SAMD51J18A Basic Timer Counter 4 (TC4) */ + TC5_IRQn = 112, /**< 112 SAMD51J18A Basic Timer Counter 5 (TC5) */ + PDEC_0_IRQn = 115, /**< 115 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */ + PDEC_1_IRQn = 116, /**< 116 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_MC_0 */ + PDEC_2_IRQn = 117, /**< 117 SAMD51J18A Quadrature Decodeur (PDEC): PDEC_MC_1 */ + ADC0_0_IRQn = 118, /**< 118 SAMD51J18A Analog Digital Converter 0 (ADC0): ADC0_OVERRUN, ADC0_WINMON */ + ADC0_1_IRQn = 119, /**< 119 SAMD51J18A Analog Digital Converter 0 (ADC0): ADC0_RESRDY */ + ADC1_0_IRQn = 120, /**< 120 SAMD51J18A Analog Digital Converter 1 (ADC1): ADC1_OVERRUN, ADC1_WINMON */ + ADC1_1_IRQn = 121, /**< 121 SAMD51J18A Analog Digital Converter 1 (ADC1): ADC1_RESRDY */ + AC_IRQn = 122, /**< 122 SAMD51J18A Analog Comparators (AC) */ + DAC_0_IRQn = 123, /**< 123 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */ + DAC_1_IRQn = 124, /**< 124 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_EMPTY_0 */ + DAC_2_IRQn = 125, /**< 125 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_EMPTY_1 */ + DAC_3_IRQn = 126, /**< 126 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_RESRDY_0 */ + DAC_4_IRQn = 127, /**< 127 SAMD51J18A Digital-to-Analog Converter (DAC): DAC_RESRDY_1 */ + I2S_IRQn = 128, /**< 128 SAMD51J18A Inter-IC Sound Interface (I2S) */ + PCC_IRQn = 129, /**< 129 SAMD51J18A Parallel Capture Controller (PCC) */ + AES_IRQn = 130, /**< 130 SAMD51J18A Advanced Encryption Standard (AES) */ + TRNG_IRQn = 131, /**< 131 SAMD51J18A True Random Generator (TRNG) */ + ICM_IRQn = 132, /**< 132 SAMD51J18A Integrity Check Monitor (ICM) */ + PUKCC_IRQn = 133, /**< 133 SAMD51J18A PUblic-Key Cryptography Controller (PUKCC) */ + QSPI_IRQn = 134, /**< 134 SAMD51J18A Quad SPI interface (QSPI) */ + SDHC0_IRQn = 135, /**< 135 SAMD51J18A SD/MMC Host Controller 0 (SDHC0) */ + + PERIPH_COUNT_IRQn = 137 /**< Number of peripheral IDs */ +} IRQn_Type; + +typedef struct _DeviceVectors +{ + /* Stack pointer */ + void* pvStack; + + /* Cortex-M handlers */ + void* pfnReset_Handler; + void* pfnNMI_Handler; + void* pfnHardFault_Handler; + void* pfnMemManage_Handler; + void* pfnBusFault_Handler; + void* pfnUsageFault_Handler; + void* pvReservedM9; + void* pvReservedM8; + void* pvReservedM7; + void* pvReservedM6; + void* pfnSVC_Handler; + void* pfnDebugMon_Handler; + void* pvReservedM3; + void* pfnPendSV_Handler; + void* pfnSysTick_Handler; + + /* Peripheral handlers */ + void* pfnPM_Handler; /* 0 Power Manager */ + void* pfnMCLK_Handler; /* 1 Main Clock */ + void* pfnOSCCTRL_0_Handler; /* 2 Oscillators Control IRQ 0 */ + void* pfnOSCCTRL_1_Handler; /* 3 Oscillators Control IRQ 1 */ + void* pfnOSCCTRL_2_Handler; /* 4 Oscillators Control IRQ 2 */ + void* pfnOSCCTRL_3_Handler; /* 5 Oscillators Control IRQ 3 */ + void* pfnOSCCTRL_4_Handler; /* 6 Oscillators Control IRQ 4 */ + void* pfnOSC32KCTRL_Handler; /* 7 32kHz Oscillators Control */ + void* pfnSUPC_0_Handler; /* 8 Supply Controller IRQ 0 */ + void* pfnSUPC_1_Handler; /* 9 Supply Controller IRQ 1 */ + void* pfnWDT_Handler; /* 10 Watchdog Timer */ + void* pfnRTC_Handler; /* 11 Real-Time Counter */ + void* pfnEIC_0_Handler; /* 12 External Interrupt Controller IRQ 0 */ + void* pfnEIC_1_Handler; /* 13 External Interrupt Controller IRQ 1 */ + void* pfnEIC_2_Handler; /* 14 External Interrupt Controller IRQ 2 */ + void* pfnEIC_3_Handler; /* 15 External Interrupt Controller IRQ 3 */ + void* pfnEIC_4_Handler; /* 16 External Interrupt Controller IRQ 4 */ + void* pfnEIC_5_Handler; /* 17 External Interrupt Controller IRQ 5 */ + void* pfnEIC_6_Handler; /* 18 External Interrupt Controller IRQ 6 */ + void* pfnEIC_7_Handler; /* 19 External Interrupt Controller IRQ 7 */ + void* pfnEIC_8_Handler; /* 20 External Interrupt Controller IRQ 8 */ + void* pfnEIC_9_Handler; /* 21 External Interrupt Controller IRQ 9 */ + void* pfnEIC_10_Handler; /* 22 External Interrupt Controller IRQ 10 */ + void* pfnEIC_11_Handler; /* 23 External Interrupt Controller IRQ 11 */ + void* pfnEIC_12_Handler; /* 24 External Interrupt Controller IRQ 12 */ + void* pfnEIC_13_Handler; /* 25 External Interrupt Controller IRQ 13 */ + void* pfnEIC_14_Handler; /* 26 External Interrupt Controller IRQ 14 */ + void* pfnEIC_15_Handler; /* 27 External Interrupt Controller IRQ 15 */ + void* pfnFREQM_Handler; /* 28 Frequency Meter */ + void* pfnNVMCTRL_0_Handler; /* 29 Non-Volatile Memory Controller IRQ 0 */ + void* pfnNVMCTRL_1_Handler; /* 30 Non-Volatile Memory Controller IRQ 1 */ + void* pfnDMAC_0_Handler; /* 31 Direct Memory Access Controller IRQ 0 */ + void* pfnDMAC_1_Handler; /* 32 Direct Memory Access Controller IRQ 1 */ + void* pfnDMAC_2_Handler; /* 33 Direct Memory Access Controller IRQ 2 */ + void* pfnDMAC_3_Handler; /* 34 Direct Memory Access Controller IRQ 3 */ + void* pfnDMAC_4_Handler; /* 35 Direct Memory Access Controller IRQ 4 */ + void* pfnEVSYS_0_Handler; /* 36 Event System Interface IRQ 0 */ + void* pfnEVSYS_1_Handler; /* 37 Event System Interface IRQ 1 */ + void* pfnEVSYS_2_Handler; /* 38 Event System Interface IRQ 2 */ + void* pfnEVSYS_3_Handler; /* 39 Event System Interface IRQ 3 */ + void* pfnEVSYS_4_Handler; /* 40 Event System Interface IRQ 4 */ + void* pfnPAC_Handler; /* 41 Peripheral Access Controller */ + void* pfnTAL_0_Handler; /* 42 Trigger Allocator IRQ 0 */ + void* pfnTAL_1_Handler; /* 43 Trigger Allocator IRQ 1 */ + void* pvReserved44; + void* pfnRAMECC_Handler; /* 45 RAM ECC */ + void* pfnSERCOM0_0_Handler; /* 46 Serial Communication Interface 0 IRQ 0 */ + void* pfnSERCOM0_1_Handler; /* 47 Serial Communication Interface 0 IRQ 1 */ + void* pfnSERCOM0_2_Handler; /* 48 Serial Communication Interface 0 IRQ 2 */ + void* pfnSERCOM0_3_Handler; /* 49 Serial Communication Interface 0 IRQ 3 */ + void* pfnSERCOM1_0_Handler; /* 50 Serial Communication Interface 1 IRQ 0 */ + void* pfnSERCOM1_1_Handler; /* 51 Serial Communication Interface 1 IRQ 1 */ + void* pfnSERCOM1_2_Handler; /* 52 Serial Communication Interface 1 IRQ 2 */ + void* pfnSERCOM1_3_Handler; /* 53 Serial Communication Interface 1 IRQ 3 */ + void* pfnSERCOM2_0_Handler; /* 54 Serial Communication Interface 2 IRQ 0 */ + void* pfnSERCOM2_1_Handler; /* 55 Serial Communication Interface 2 IRQ 1 */ + void* pfnSERCOM2_2_Handler; /* 56 Serial Communication Interface 2 IRQ 2 */ + void* pfnSERCOM2_3_Handler; /* 57 Serial Communication Interface 2 IRQ 3 */ + void* pfnSERCOM3_0_Handler; /* 58 Serial Communication Interface 3 IRQ 0 */ + void* pfnSERCOM3_1_Handler; /* 59 Serial Communication Interface 3 IRQ 1 */ + void* pfnSERCOM3_2_Handler; /* 60 Serial Communication Interface 3 IRQ 2 */ + void* pfnSERCOM3_3_Handler; /* 61 Serial Communication Interface 3 IRQ 3 */ + void* pfnSERCOM4_0_Handler; /* 62 Serial Communication Interface 4 IRQ 0 */ + void* pfnSERCOM4_1_Handler; /* 63 Serial Communication Interface 4 IRQ 1 */ + void* pfnSERCOM4_2_Handler; /* 64 Serial Communication Interface 4 IRQ 2 */ + void* pfnSERCOM4_3_Handler; /* 65 Serial Communication Interface 4 IRQ 3 */ + void* pfnSERCOM5_0_Handler; /* 66 Serial Communication Interface 5 IRQ 0 */ + void* pfnSERCOM5_1_Handler; /* 67 Serial Communication Interface 5 IRQ 1 */ + void* pfnSERCOM5_2_Handler; /* 68 Serial Communication Interface 5 IRQ 2 */ + void* pfnSERCOM5_3_Handler; /* 69 Serial Communication Interface 5 IRQ 3 */ + void* pvReserved70; + void* pvReserved71; + void* pvReserved72; + void* pvReserved73; + void* pvReserved74; + void* pvReserved75; + void* pvReserved76; + void* pvReserved77; + void* pvReserved78; + void* pvReserved79; + void* pfnUSB_0_Handler; /* 80 Universal Serial Bus IRQ 0 */ + void* pfnUSB_1_Handler; /* 81 Universal Serial Bus IRQ 1 */ + void* pfnUSB_2_Handler; /* 82 Universal Serial Bus IRQ 2 */ + void* pfnUSB_3_Handler; /* 83 Universal Serial Bus IRQ 3 */ + void* pvReserved84; + void* pfnTCC0_0_Handler; /* 85 Timer Counter Control 0 IRQ 0 */ + void* pfnTCC0_1_Handler; /* 86 Timer Counter Control 0 IRQ 1 */ + void* pfnTCC0_2_Handler; /* 87 Timer Counter Control 0 IRQ 2 */ + void* pfnTCC0_3_Handler; /* 88 Timer Counter Control 0 IRQ 3 */ + void* pfnTCC0_4_Handler; /* 89 Timer Counter Control 0 IRQ 4 */ + void* pfnTCC0_5_Handler; /* 90 Timer Counter Control 0 IRQ 5 */ + void* pfnTCC0_6_Handler; /* 91 Timer Counter Control 0 IRQ 6 */ + void* pfnTCC1_0_Handler; /* 92 Timer Counter Control 1 IRQ 0 */ + void* pfnTCC1_1_Handler; /* 93 Timer Counter Control 1 IRQ 1 */ + void* pfnTCC1_2_Handler; /* 94 Timer Counter Control 1 IRQ 2 */ + void* pfnTCC1_3_Handler; /* 95 Timer Counter Control 1 IRQ 3 */ + void* pfnTCC1_4_Handler; /* 96 Timer Counter Control 1 IRQ 4 */ + void* pfnTCC2_0_Handler; /* 97 Timer Counter Control 2 IRQ 0 */ + void* pfnTCC2_1_Handler; /* 98 Timer Counter Control 2 IRQ 1 */ + void* pfnTCC2_2_Handler; /* 99 Timer Counter Control 2 IRQ 2 */ + void* pfnTCC2_3_Handler; /* 100 Timer Counter Control 2 IRQ 3 */ + void* pfnTCC3_0_Handler; /* 101 Timer Counter Control 3 IRQ 0 */ + void* pfnTCC3_1_Handler; /* 102 Timer Counter Control 3 IRQ 1 */ + void* pfnTCC3_2_Handler; /* 103 Timer Counter Control 3 IRQ 2 */ + void* pfnTCC4_0_Handler; /* 104 Timer Counter Control 4 IRQ 0 */ + void* pfnTCC4_1_Handler; /* 105 Timer Counter Control 4 IRQ 1 */ + void* pfnTCC4_2_Handler; /* 106 Timer Counter Control 4 IRQ 2 */ + void* pfnTC0_Handler; /* 107 Basic Timer Counter 0 */ + void* pfnTC1_Handler; /* 108 Basic Timer Counter 1 */ + void* pfnTC2_Handler; /* 109 Basic Timer Counter 2 */ + void* pfnTC3_Handler; /* 110 Basic Timer Counter 3 */ + void* pfnTC4_Handler; /* 111 Basic Timer Counter 4 */ + void* pfnTC5_Handler; /* 112 Basic Timer Counter 5 */ + void* pvReserved113; + void* pvReserved114; + void* pfnPDEC_0_Handler; /* 115 Quadrature Decodeur IRQ 0 */ + void* pfnPDEC_1_Handler; /* 116 Quadrature Decodeur IRQ 1 */ + void* pfnPDEC_2_Handler; /* 117 Quadrature Decodeur IRQ 2 */ + void* pfnADC0_0_Handler; /* 118 Analog Digital Converter 0 IRQ 0 */ + void* pfnADC0_1_Handler; /* 119 Analog Digital Converter 0 IRQ 1 */ + void* pfnADC1_0_Handler; /* 120 Analog Digital Converter 1 IRQ 0 */ + void* pfnADC1_1_Handler; /* 121 Analog Digital Converter 1 IRQ 1 */ + void* pfnAC_Handler; /* 122 Analog Comparators */ + void* pfnDAC_0_Handler; /* 123 Digital-to-Analog Converter IRQ 0 */ + void* pfnDAC_1_Handler; /* 124 Digital-to-Analog Converter IRQ 1 */ + void* pfnDAC_2_Handler; /* 125 Digital-to-Analog Converter IRQ 2 */ + void* pfnDAC_3_Handler; /* 126 Digital-to-Analog Converter IRQ 3 */ + void* pfnDAC_4_Handler; /* 127 Digital-to-Analog Converter IRQ 4 */ + void* pfnI2S_Handler; /* 128 Inter-IC Sound Interface */ + void* pfnPCC_Handler; /* 129 Parallel Capture Controller */ + void* pfnAES_Handler; /* 130 Advanced Encryption Standard */ + void* pfnTRNG_Handler; /* 131 True Random Generator */ + void* pfnICM_Handler; /* 132 Integrity Check Monitor */ + void* pfnPUKCC_Handler; /* 133 PUblic-Key Cryptography Controller */ + void* pfnQSPI_Handler; /* 134 Quad SPI interface */ + void* pfnSDHC0_Handler; /* 135 SD/MMC Host Controller 0 */ + void* pvReserved136; +} DeviceVectors; + +/* Cortex-M4 processor handlers */ +void Reset_Handler ( void ); +void NMI_Handler ( void ); +void HardFault_Handler ( void ); +void MemManage_Handler ( void ); +void BusFault_Handler ( void ); +void UsageFault_Handler ( void ); +void SVC_Handler ( void ); +void DebugMon_Handler ( void ); +void PendSV_Handler ( void ); +void SysTick_Handler ( void ); + +/* Peripherals handlers */ +void PM_Handler ( void ); +void MCLK_Handler ( void ); +void OSCCTRL_0_Handler ( void ); +void OSCCTRL_1_Handler ( void ); +void OSCCTRL_2_Handler ( void ); +void OSCCTRL_3_Handler ( void ); +void OSCCTRL_4_Handler ( void ); +void OSC32KCTRL_Handler ( void ); +void SUPC_0_Handler ( void ); +void SUPC_1_Handler ( void ); +void WDT_Handler ( void ); +void RTC_Handler ( void ); +void EIC_0_Handler ( void ); +void EIC_1_Handler ( void ); +void EIC_2_Handler ( void ); +void EIC_3_Handler ( void ); +void EIC_4_Handler ( void ); +void EIC_5_Handler ( void ); +void EIC_6_Handler ( void ); +void EIC_7_Handler ( void ); +void EIC_8_Handler ( void ); +void EIC_9_Handler ( void ); +void EIC_10_Handler ( void ); +void EIC_11_Handler ( void ); +void EIC_12_Handler ( void ); +void EIC_13_Handler ( void ); +void EIC_14_Handler ( void ); +void EIC_15_Handler ( void ); +void FREQM_Handler ( void ); +void NVMCTRL_0_Handler ( void ); +void NVMCTRL_1_Handler ( void ); +void DMAC_0_Handler ( void ); +void DMAC_1_Handler ( void ); +void DMAC_2_Handler ( void ); +void DMAC_3_Handler ( void ); +void DMAC_4_Handler ( void ); +void EVSYS_0_Handler ( void ); +void EVSYS_1_Handler ( void ); +void EVSYS_2_Handler ( void ); +void EVSYS_3_Handler ( void ); +void EVSYS_4_Handler ( void ); +void PAC_Handler ( void ); +void TAL_0_Handler ( void ); +void TAL_1_Handler ( void ); +void RAMECC_Handler ( void ); +void SERCOM0_0_Handler ( void ); +void SERCOM0_1_Handler ( void ); +void SERCOM0_2_Handler ( void ); +void SERCOM0_3_Handler ( void ); +void SERCOM1_0_Handler ( void ); +void SERCOM1_1_Handler ( void ); +void SERCOM1_2_Handler ( void ); +void SERCOM1_3_Handler ( void ); +void SERCOM2_0_Handler ( void ); +void SERCOM2_1_Handler ( void ); +void SERCOM2_2_Handler ( void ); +void SERCOM2_3_Handler ( void ); +void SERCOM3_0_Handler ( void ); +void SERCOM3_1_Handler ( void ); +void SERCOM3_2_Handler ( void ); +void SERCOM3_3_Handler ( void ); +void SERCOM4_0_Handler ( void ); +void SERCOM4_1_Handler ( void ); +void SERCOM4_2_Handler ( void ); +void SERCOM4_3_Handler ( void ); +void SERCOM5_0_Handler ( void ); +void SERCOM5_1_Handler ( void ); +void SERCOM5_2_Handler ( void ); +void SERCOM5_3_Handler ( void ); +void USB_0_Handler ( void ); +void USB_1_Handler ( void ); +void USB_2_Handler ( void ); +void USB_3_Handler ( void ); +void TCC0_0_Handler ( void ); +void TCC0_1_Handler ( void ); +void TCC0_2_Handler ( void ); +void TCC0_3_Handler ( void ); +void TCC0_4_Handler ( void ); +void TCC0_5_Handler ( void ); +void TCC0_6_Handler ( void ); +void TCC1_0_Handler ( void ); +void TCC1_1_Handler ( void ); +void TCC1_2_Handler ( void ); +void TCC1_3_Handler ( void ); +void TCC1_4_Handler ( void ); +void TCC2_0_Handler ( void ); +void TCC2_1_Handler ( void ); +void TCC2_2_Handler ( void ); +void TCC2_3_Handler ( void ); +void TCC3_0_Handler ( void ); +void TCC3_1_Handler ( void ); +void TCC3_2_Handler ( void ); +void TCC4_0_Handler ( void ); +void TCC4_1_Handler ( void ); +void TCC4_2_Handler ( void ); +void TC0_Handler ( void ); +void TC1_Handler ( void ); +void TC2_Handler ( void ); +void TC3_Handler ( void ); +void TC4_Handler ( void ); +void TC5_Handler ( void ); +void PDEC_0_Handler ( void ); +void PDEC_1_Handler ( void ); +void PDEC_2_Handler ( void ); +void ADC0_0_Handler ( void ); +void ADC0_1_Handler ( void ); +void ADC1_0_Handler ( void ); +void ADC1_1_Handler ( void ); +void AC_Handler ( void ); +void DAC_0_Handler ( void ); +void DAC_1_Handler ( void ); +void DAC_2_Handler ( void ); +void DAC_3_Handler ( void ); +void DAC_4_Handler ( void ); +void I2S_Handler ( void ); +void PCC_Handler ( void ); +void AES_Handler ( void ); +void TRNG_Handler ( void ); +void ICM_Handler ( void ); +void PUKCC_Handler ( void ); +void QSPI_Handler ( void ); +void SDHC0_Handler ( void ); + +/* + * \brief Configuration of the Cortex-M4 Processor and Core Peripherals + */ + +#define LITTLE_ENDIAN 1 +#define __CM4_REV 1 /*!< Core revision r0p1 */ +#define __DEBUG_LVL 3 /*!< Full debug plus DWT data matching */ +#define __FPU_PRESENT 1 /*!< FPU present or not */ +#define __MPU_PRESENT 1 /*!< MPU present or not */ +#define __NVIC_PRIO_BITS 3 /*!< Number of bits used for Priority Levels */ +#define __TRACE_LVL 2 /*!< Full trace: ITM, DWT triggers and counters, ETM */ +#define __VTOR_PRESENT 1 /*!< VTOR present or not */ +#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */ + +/** + * \brief CMSIS includes + */ + +#include +#if !defined DONT_USE_CMSIS_INIT +#include "system_samd51.h" +#endif /* DONT_USE_CMSIS_INIT */ + +/*@}*/ + +/* ************************************************************************** */ +/** SOFTWARE PERIPHERAL API DEFINITION FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_api Peripheral Software API */ +/*@{*/ + +#include "component/ac.h" +#include "component/adc.h" +#include "component/aes.h" +#include "component/ccl.h" +#include "component/cmcc.h" +#include "component/dac.h" +#include "component/dmac.h" +#include "component/dsu.h" +#include "component/eic.h" +#include "component/evsys.h" +#include "component/freqm.h" +#include "component/gclk.h" +#include "component/hmatrixb.h" +#include "component/icm.h" +#include "component/i2s.h" +#include "component/mclk.h" +#include "component/nvmctrl.h" +#include "component/oscctrl.h" +#include "component/osc32kctrl.h" +#include "component/pac.h" +#include "component/pcc.h" +#include "component/pdec.h" +#include "component/pm.h" +#include "component/port.h" +#include "component/qspi.h" +#include "component/ramecc.h" +#include "component/rstc.h" +#include "component/rtc.h" +#include "component/sdhc.h" +#include "component/sercom.h" +#include "component/supc.h" +#include "component/tal.h" +#include "component/tc.h" +#include "component/tcc.h" +#include "component/trng.h" +#include "component/usb.h" +#include "component/wdt.h" +/*@}*/ + +/* ************************************************************************** */ +/** REGISTERS ACCESS DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_reg Registers Access Definitions */ +/*@{*/ + +#include "instance/ac.h" +#include "instance/adc0.h" +#include "instance/adc1.h" +#include "instance/aes.h" +#include "instance/ccl.h" +#include "instance/cmcc.h" +#include "instance/dac.h" +#include "instance/dmac.h" +#include "instance/dsu.h" +#include "instance/eic.h" +#include "instance/evsys.h" +#include "instance/freqm.h" +#include "instance/gclk.h" +#include "instance/hmatrix.h" +#include "instance/icm.h" +#include "instance/i2s.h" +#include "instance/mclk.h" +#include "instance/nvmctrl.h" +#include "instance/oscctrl.h" +#include "instance/osc32kctrl.h" +#include "instance/pac.h" +#include "instance/pcc.h" +#include "instance/pdec.h" +#include "instance/pm.h" +#include "instance/port.h" +#include "instance/qspi.h" +#include "instance/ramecc.h" +#include "instance/rstc.h" +#include "instance/rtc.h" +#include "instance/sdhc0.h" +#include "instance/sercom0.h" +#include "instance/sercom1.h" +#include "instance/sercom2.h" +#include "instance/sercom3.h" +#include "instance/sercom4.h" +#include "instance/sercom5.h" +#include "instance/supc.h" +#include "instance/tal.h" +#include "instance/tc0.h" +#include "instance/tc1.h" +#include "instance/tc2.h" +#include "instance/tc3.h" +#include "instance/tc4.h" +#include "instance/tc5.h" +#include "instance/tcc0.h" +#include "instance/tcc1.h" +#include "instance/tcc2.h" +#include "instance/tcc3.h" +#include "instance/tcc4.h" +#include "instance/trng.h" +#include "instance/usb.h" +#include "instance/wdt.h" +/*@}*/ + +/* ************************************************************************** */ +/** PERIPHERAL ID DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_id Peripheral Ids Definitions */ +/*@{*/ + +// Peripheral instances on HPB0 bridge +#define ID_PAC 0 /**< \brief Peripheral Access Controller (PAC) */ +#define ID_PM 1 /**< \brief Power Manager (PM) */ +#define ID_MCLK 2 /**< \brief Main Clock (MCLK) */ +#define ID_RSTC 3 /**< \brief Reset Controller (RSTC) */ +#define ID_OSCCTRL 4 /**< \brief Oscillators Control (OSCCTRL) */ +#define ID_OSC32KCTRL 5 /**< \brief 32kHz Oscillators Control (OSC32KCTRL) */ +#define ID_SUPC 6 /**< \brief Supply Controller (SUPC) */ +#define ID_GCLK 7 /**< \brief Generic Clock Generator (GCLK) */ +#define ID_WDT 8 /**< \brief Watchdog Timer (WDT) */ +#define ID_RTC 9 /**< \brief Real-Time Counter (RTC) */ +#define ID_EIC 10 /**< \brief External Interrupt Controller (EIC) */ +#define ID_FREQM 11 /**< \brief Frequency Meter (FREQM) */ +#define ID_SERCOM0 12 /**< \brief Serial Communication Interface 0 (SERCOM0) */ +#define ID_SERCOM1 13 /**< \brief Serial Communication Interface 1 (SERCOM1) */ +#define ID_TC0 14 /**< \brief Basic Timer Counter 0 (TC0) */ +#define ID_TC1 15 /**< \brief Basic Timer Counter 1 (TC1) */ + +// Peripheral instances on HPB1 bridge +#define ID_USB 32 /**< \brief Universal Serial Bus (USB) */ +#define ID_DSU 33 /**< \brief Device Service Unit (DSU) */ +#define ID_NVMCTRL 34 /**< \brief Non-Volatile Memory Controller (NVMCTRL) */ +#define ID_CMCC 35 /**< \brief Cortex M Cache Controller (CMCC) */ +#define ID_PORT 36 /**< \brief Port Module (PORT) */ +#define ID_DMAC 37 /**< \brief Direct Memory Access Controller (DMAC) */ +#define ID_HMATRIX 38 /**< \brief HSB Matrix (HMATRIX) */ +#define ID_EVSYS 39 /**< \brief Event System Interface (EVSYS) */ +#define ID_SERCOM2 41 /**< \brief Serial Communication Interface 2 (SERCOM2) */ +#define ID_SERCOM3 42 /**< \brief Serial Communication Interface 3 (SERCOM3) */ +#define ID_TCC0 43 /**< \brief Timer Counter Control 0 (TCC0) */ +#define ID_TCC1 44 /**< \brief Timer Counter Control 1 (TCC1) */ +#define ID_TC2 45 /**< \brief Basic Timer Counter 2 (TC2) */ +#define ID_TC3 46 /**< \brief Basic Timer Counter 3 (TC3) */ +#define ID_TAL 47 /**< \brief Trigger Allocator (TAL) */ +#define ID_RAMECC 48 /**< \brief RAM ECC (RAMECC) */ +#define ID_TCC2 67 /**< \brief Timer Counter Control 2 (TCC2) */ +#define ID_TCC3 68 /**< \brief Timer Counter Control 3 (TCC3) */ +#define ID_TC4 69 /**< \brief Basic Timer Counter 4 (TC4) */ +#define ID_TC5 70 /**< \brief Basic Timer Counter 5 (TC5) */ +#define ID_PDEC 71 /**< \brief Quadrature Decodeur (PDEC) */ +#define ID_AC 72 /**< \brief Analog Comparators (AC) */ +#define ID_AES 73 /**< \brief Advanced Encryption Standard (AES) */ +#define ID_TRNG 74 /**< \brief True Random Generator (TRNG) */ +#define ID_ICM 75 /**< \brief Integrity Check Monitor (ICM) */ +#define ID_PUKCC 76 /**< \brief PUblic-Key Cryptography Controller (PUKCC) */ +#define ID_QSPI 77 /**< \brief Quad SPI interface (QSPI) */ +#define ID_CCL 78 /**< \brief Configurable Custom Logic (CCL) */ + +// Peripheral instances on HPB3 bridge +#define ID_SERCOM4 96 /**< \brief Serial Communication Interface 4 (SERCOM4) */ +#define ID_SERCOM5 97 /**< \brief Serial Communication Interface 5 (SERCOM5) */ +#define ID_TCC4 100 /**< \brief Timer Counter Control 4 (TCC4) */ +#define ID_ADC0 103 /**< \brief Analog Digital Converter 0 (ADC0) */ +#define ID_ADC1 104 /**< \brief Analog Digital Converter 1 (ADC1) */ +#define ID_DAC 105 /**< \brief Digital-to-Analog Converter (DAC) */ +#define ID_I2S 106 /**< \brief Inter-IC Sound Interface (I2S) */ +#define ID_PCC 107 /**< \brief Parallel Capture Controller (PCC) */ + +// Peripheral instances on AHB (as if on bridge 4) +#define ID_SDHC0 128 /**< \brief SD/MMC Host Controller (SDHC0) */ + +#define ID_PERIPH_COUNT 129 /**< \brief Max number of peripheral IDs */ +/*@}*/ + +/* ************************************************************************** */ +/** BASE ADDRESS DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_base Peripheral Base Address Definitions */ +/*@{*/ + +#if defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__) +#define AC (0x42002000) /**< \brief (AC) APB Base Address */ +#define ADC0 (0x43001C00) /**< \brief (ADC0) APB Base Address */ +#define ADC1 (0x43002000) /**< \brief (ADC1) APB Base Address */ +#define AES (0x42002400) /**< \brief (AES) APB Base Address */ +#define CCL (0x42003800) /**< \brief (CCL) APB Base Address */ +#define CMCC (0x41006000) /**< \brief (CMCC) APB Base Address */ +#define CMCC_AHB (0x03000000) /**< \brief (CMCC) AHB Base Address */ +#define DAC (0x43002400) /**< \brief (DAC) APB Base Address */ +#define DMAC (0x4100A000) /**< \brief (DMAC) APB Base Address */ +#define DSU (0x41002000) /**< \brief (DSU) APB Base Address */ +#define EIC (0x40002800) /**< \brief (EIC) APB Base Address */ +#define EVSYS (0x4100E000) /**< \brief (EVSYS) APB Base Address */ +#define FREQM (0x40002C00) /**< \brief (FREQM) APB Base Address */ +#define GCLK (0x40001C00) /**< \brief (GCLK) APB Base Address */ +#define HMATRIX (0x4100C000) /**< \brief (HMATRIX) APB Base Address */ +#define ICM (0x42002C00) /**< \brief (ICM) APB Base Address */ +#define I2S (0x43002800) /**< \brief (I2S) APB Base Address */ +#define MCLK (0x40000800) /**< \brief (MCLK) APB Base Address */ +#define NVMCTRL (0x41004000) /**< \brief (NVMCTRL) APB Base Address */ +#define NVMCTRL_CB (0x00800000) /**< \brief (NVMCTRL) CB Base Address */ +#define NVMCTRL_CBW0 (0x00800000) /**< \brief (NVMCTRL) CBW0 Base Address */ +#define NVMCTRL_CBW1 (0x00800010) /**< \brief (NVMCTRL) CBW1 Base Address */ +#define NVMCTRL_CBW2 (0x00800020) /**< \brief (NVMCTRL) CBW2 Base Address */ +#define NVMCTRL_CBW3 (0x00800030) /**< \brief (NVMCTRL) CBW3 Base Address */ +#define NVMCTRL_CBW4 (0x00800040) /**< \brief (NVMCTRL) CBW4 Base Address */ +#define NVMCTRL_CBW5 (0x00800050) /**< \brief (NVMCTRL) CBW5 Base Address */ +#define NVMCTRL_CBW6 (0x00800060) /**< \brief (NVMCTRL) CBW6 Base Address */ +#define NVMCTRL_CBW7 (0x00800070) /**< \brief (NVMCTRL) CBW7 Base Address */ +#define NVMCTRL_FS (0x00806000) /**< \brief (NVMCTRL) FS Base Address */ +#define NVMCTRL_SW0 (0x00800080) /**< \brief (NVMCTRL) SW0 Base Address */ +#define NVMCTRL_SW1 (0x00800090) /**< \brief (NVMCTRL) SW1 Base Address */ +#define NVMCTRL_SW2 (0x008000A0) /**< \brief (NVMCTRL) SW2 Base Address */ +#define NVMCTRL_SW3 (0x008000B0) /**< \brief (NVMCTRL) SW3 Base Address */ +#define NVMCTRL_SW4 (0x008000C0) /**< \brief (NVMCTRL) SW4 Base Address */ +#define NVMCTRL_SW5 (0x008000D0) /**< \brief (NVMCTRL) SW5 Base Address */ +#define NVMCTRL_SW6 (0x008000E0) /**< \brief (NVMCTRL) SW6 Base Address */ +#define NVMCTRL_SW7 (0x008000F0) /**< \brief (NVMCTRL) SW7 Base Address */ +#define NVMCTRL_TEMP_LOG (0x00800100) /**< \brief (NVMCTRL) TEMP_LOG Base Address */ +#define NVMCTRL_TEMP_LOG_W0 (0x00800100) /**< \brief (NVMCTRL) TEMP_LOG_W0 Base Address */ +#define NVMCTRL_TEMP_LOG_W1 (0x00800110) /**< \brief (NVMCTRL) TEMP_LOG_W1 Base Address */ +#define NVMCTRL_TEMP_LOG_W2 (0x00800120) /**< \brief (NVMCTRL) TEMP_LOG_W2 Base Address */ +#define NVMCTRL_TEMP_LOG_W3 (0x00800130) /**< \brief (NVMCTRL) TEMP_LOG_W3 Base Address */ +#define NVMCTRL_TEMP_LOG_W4 (0x00800140) /**< \brief (NVMCTRL) TEMP_LOG_W4 Base Address */ +#define NVMCTRL_TEMP_LOG_W5 (0x00800150) /**< \brief (NVMCTRL) TEMP_LOG_W5 Base Address */ +#define NVMCTRL_TEMP_LOG_W6 (0x00800160) /**< \brief (NVMCTRL) TEMP_LOG_W6 Base Address */ +#define NVMCTRL_TEMP_LOG_W7 (0x00800170) /**< \brief (NVMCTRL) TEMP_LOG_W7 Base Address */ +#define NVMCTRL_TLATCH (0x00802000) /**< \brief (NVMCTRL) TLATCH Base Address */ +#define NVMCTRL_USER (0x00804000) /**< \brief (NVMCTRL) USER Base Address */ +#define OSCCTRL (0x40001000) /**< \brief (OSCCTRL) APB Base Address */ +#define OSC32KCTRL (0x40001400) /**< \brief (OSC32KCTRL) APB Base Address */ +#define PAC (0x40000000) /**< \brief (PAC) APB Base Address */ +#define PCC (0x43002C00) /**< \brief (PCC) APB Base Address */ +#define PDEC (0x42001C00) /**< \brief (PDEC) APB Base Address */ +#define PM (0x40000400) /**< \brief (PM) APB Base Address */ +#define PORT (0x41008000) /**< \brief (PORT) APB Base Address */ +#define PUKCC (0x42003000) /**< \brief (PUKCC) APB Base Address */ +#define PUKCC_AHB (0x02000000) /**< \brief (PUKCC) AHB Base Address */ +#define QSPI (0x42003400) /**< \brief (QSPI) APB Base Address */ +#define QSPI_AHB (0x04000000) /**< \brief (QSPI) AHB Base Address */ +#define RAMECC (0x41020000) /**< \brief (RAMECC) APB Base Address */ +#define RSTC (0x40000C00) /**< \brief (RSTC) APB Base Address */ +#define RTC (0x40002400) /**< \brief (RTC) APB Base Address */ +#define SDHC0 (0x45000000) /**< \brief (SDHC0) AHB Base Address */ +#define SERCOM0 (0x40003000) /**< \brief (SERCOM0) APB Base Address */ +#define SERCOM1 (0x40003400) /**< \brief (SERCOM1) APB Base Address */ +#define SERCOM2 (0x41012000) /**< \brief (SERCOM2) APB Base Address */ +#define SERCOM3 (0x41014000) /**< \brief (SERCOM3) APB Base Address */ +#define SERCOM4 (0x43000000) /**< \brief (SERCOM4) APB Base Address */ +#define SERCOM5 (0x43000400) /**< \brief (SERCOM5) APB Base Address */ +#define SUPC (0x40001800) /**< \brief (SUPC) APB Base Address */ +#define TAL (0x4101E000) /**< \brief (TAL) APB Base Address */ +#define TC0 (0x40003800) /**< \brief (TC0) APB Base Address */ +#define TC1 (0x40003C00) /**< \brief (TC1) APB Base Address */ +#define TC2 (0x4101A000) /**< \brief (TC2) APB Base Address */ +#define TC3 (0x4101C000) /**< \brief (TC3) APB Base Address */ +#define TC4 (0x42001400) /**< \brief (TC4) APB Base Address */ +#define TC5 (0x42001800) /**< \brief (TC5) APB Base Address */ +#define TCC0 (0x41016000) /**< \brief (TCC0) APB Base Address */ +#define TCC1 (0x41018000) /**< \brief (TCC1) APB Base Address */ +#define TCC2 (0x42000C00) /**< \brief (TCC2) APB Base Address */ +#define TCC3 (0x42001000) /**< \brief (TCC3) APB Base Address */ +#define TCC4 (0x43001000) /**< \brief (TCC4) APB Base Address */ +#define TRNG (0x42002800) /**< \brief (TRNG) APB Base Address */ +#define USB (0x41000000) /**< \brief (USB) APB Base Address */ +#define WDT (0x40002000) /**< \brief (WDT) APB Base Address */ +#else +#define AC ((Ac *)0x42002000UL) /**< \brief (AC) APB Base Address */ +#define AC_INST_NUM 1 /**< \brief (AC) Number of instances */ +#define AC_INSTS { AC } /**< \brief (AC) Instances List */ + +#define ADC0 ((Adc *)0x43001C00UL) /**< \brief (ADC0) APB Base Address */ +#define ADC1 ((Adc *)0x43002000UL) /**< \brief (ADC1) APB Base Address */ +#define ADC_INST_NUM 2 /**< \brief (ADC) Number of instances */ +#define ADC_INSTS { ADC0, ADC1 } /**< \brief (ADC) Instances List */ + +#define AES ((Aes *)0x42002400UL) /**< \brief (AES) APB Base Address */ +#define AES_INST_NUM 1 /**< \brief (AES) Number of instances */ +#define AES_INSTS { AES } /**< \brief (AES) Instances List */ + +#define CCL ((Ccl *)0x42003800UL) /**< \brief (CCL) APB Base Address */ +#define CCL_INST_NUM 1 /**< \brief (CCL) Number of instances */ +#define CCL_INSTS { CCL } /**< \brief (CCL) Instances List */ + +#define CMCC ((Cmcc *)0x41006000UL) /**< \brief (CMCC) APB Base Address */ +#define CMCC_AHB (0x03000000UL) /**< \brief (CMCC) AHB Base Address */ +#define CMCC_INST_NUM 1 /**< \brief (CMCC) Number of instances */ +#define CMCC_INSTS { CMCC } /**< \brief (CMCC) Instances List */ + +#define DAC ((Dac *)0x43002400UL) /**< \brief (DAC) APB Base Address */ +#define DAC_INST_NUM 1 /**< \brief (DAC) Number of instances */ +#define DAC_INSTS { DAC } /**< \brief (DAC) Instances List */ + +#define DMAC ((Dmac *)0x4100A000UL) /**< \brief (DMAC) APB Base Address */ +#define DMAC_INST_NUM 1 /**< \brief (DMAC) Number of instances */ +#define DMAC_INSTS { DMAC } /**< \brief (DMAC) Instances List */ + +#define DSU ((Dsu *)0x41002000UL) /**< \brief (DSU) APB Base Address */ +#define DSU_INST_NUM 1 /**< \brief (DSU) Number of instances */ +#define DSU_INSTS { DSU } /**< \brief (DSU) Instances List */ + +#define EIC ((Eic *)0x40002800UL) /**< \brief (EIC) APB Base Address */ +#define EIC_INST_NUM 1 /**< \brief (EIC) Number of instances */ +#define EIC_INSTS { EIC } /**< \brief (EIC) Instances List */ + +#define EVSYS ((Evsys *)0x4100E000UL) /**< \brief (EVSYS) APB Base Address */ +#define EVSYS_INST_NUM 1 /**< \brief (EVSYS) Number of instances */ +#define EVSYS_INSTS { EVSYS } /**< \brief (EVSYS) Instances List */ + +#define FREQM ((Freqm *)0x40002C00UL) /**< \brief (FREQM) APB Base Address */ +#define FREQM_INST_NUM 1 /**< \brief (FREQM) Number of instances */ +#define FREQM_INSTS { FREQM } /**< \brief (FREQM) Instances List */ + +#define GCLK ((Gclk *)0x40001C00UL) /**< \brief (GCLK) APB Base Address */ +#define GCLK_INST_NUM 1 /**< \brief (GCLK) Number of instances */ +#define GCLK_INSTS { GCLK } /**< \brief (GCLK) Instances List */ + +#define HMATRIX ((Hmatrixb *)0x4100C000UL) /**< \brief (HMATRIX) APB Base Address */ +#define HMATRIXB_INST_NUM 1 /**< \brief (HMATRIXB) Number of instances */ +#define HMATRIXB_INSTS { HMATRIX } /**< \brief (HMATRIXB) Instances List */ + +#define ICM ((Icm *)0x42002C00UL) /**< \brief (ICM) APB Base Address */ +#define ICM_INST_NUM 1 /**< \brief (ICM) Number of instances */ +#define ICM_INSTS { ICM } /**< \brief (ICM) Instances List */ + +#define I2S ((I2s *)0x43002800UL) /**< \brief (I2S) APB Base Address */ +#define I2S_INST_NUM 1 /**< \brief (I2S) Number of instances */ +#define I2S_INSTS { I2S } /**< \brief (I2S) Instances List */ + +#define MCLK ((Mclk *)0x40000800UL) /**< \brief (MCLK) APB Base Address */ +#define MCLK_INST_NUM 1 /**< \brief (MCLK) Number of instances */ +#define MCLK_INSTS { MCLK } /**< \brief (MCLK) Instances List */ + +#define NVMCTRL ((Nvmctrl *)0x41004000UL) /**< \brief (NVMCTRL) APB Base Address */ +#define NVMCTRL_CB (0x00800000UL) /**< \brief (NVMCTRL) CB Base Address */ +#define NVMCTRL_CBW0 (0x00800000UL) /**< \brief (NVMCTRL) CBW0 Base Address */ +#define NVMCTRL_CBW1 (0x00800010UL) /**< \brief (NVMCTRL) CBW1 Base Address */ +#define NVMCTRL_CBW2 (0x00800020UL) /**< \brief (NVMCTRL) CBW2 Base Address */ +#define NVMCTRL_CBW3 (0x00800030UL) /**< \brief (NVMCTRL) CBW3 Base Address */ +#define NVMCTRL_CBW4 (0x00800040UL) /**< \brief (NVMCTRL) CBW4 Base Address */ +#define NVMCTRL_CBW5 (0x00800050UL) /**< \brief (NVMCTRL) CBW5 Base Address */ +#define NVMCTRL_CBW6 (0x00800060UL) /**< \brief (NVMCTRL) CBW6 Base Address */ +#define NVMCTRL_CBW7 (0x00800070UL) /**< \brief (NVMCTRL) CBW7 Base Address */ +#define NVMCTRL_FS (0x00806000UL) /**< \brief (NVMCTRL) FS Base Address */ +#define NVMCTRL_SW0 (0x00800080UL) /**< \brief (NVMCTRL) SW0 Base Address */ +#define NVMCTRL_SW1 (0x00800090UL) /**< \brief (NVMCTRL) SW1 Base Address */ +#define NVMCTRL_SW2 (0x008000A0UL) /**< \brief (NVMCTRL) SW2 Base Address */ +#define NVMCTRL_SW3 (0x008000B0UL) /**< \brief (NVMCTRL) SW3 Base Address */ +#define NVMCTRL_SW4 (0x008000C0UL) /**< \brief (NVMCTRL) SW4 Base Address */ +#define NVMCTRL_SW5 (0x008000D0UL) /**< \brief (NVMCTRL) SW5 Base Address */ +#define NVMCTRL_SW6 (0x008000E0UL) /**< \brief (NVMCTRL) SW6 Base Address */ +#define NVMCTRL_SW7 (0x008000F0UL) /**< \brief (NVMCTRL) SW7 Base Address */ +#define NVMCTRL_TEMP_LOG (0x00800100UL) /**< \brief (NVMCTRL) TEMP_LOG Base Address */ +#define NVMCTRL_TEMP_LOG_W0 (0x00800100UL) /**< \brief (NVMCTRL) TEMP_LOG_W0 Base Address */ +#define NVMCTRL_TEMP_LOG_W1 (0x00800110UL) /**< \brief (NVMCTRL) TEMP_LOG_W1 Base Address */ +#define NVMCTRL_TEMP_LOG_W2 (0x00800120UL) /**< \brief (NVMCTRL) TEMP_LOG_W2 Base Address */ +#define NVMCTRL_TEMP_LOG_W3 (0x00800130UL) /**< \brief (NVMCTRL) TEMP_LOG_W3 Base Address */ +#define NVMCTRL_TEMP_LOG_W4 (0x00800140UL) /**< \brief (NVMCTRL) TEMP_LOG_W4 Base Address */ +#define NVMCTRL_TEMP_LOG_W5 (0x00800150UL) /**< \brief (NVMCTRL) TEMP_LOG_W5 Base Address */ +#define NVMCTRL_TEMP_LOG_W6 (0x00800160UL) /**< \brief (NVMCTRL) TEMP_LOG_W6 Base Address */ +#define NVMCTRL_TEMP_LOG_W7 (0x00800170UL) /**< \brief (NVMCTRL) TEMP_LOG_W7 Base Address */ +#define NVMCTRL_TLATCH (0x00802000UL) /**< \brief (NVMCTRL) TLATCH Base Address */ +#define NVMCTRL_USER (0x00804000UL) /**< \brief (NVMCTRL) USER Base Address */ +#define NVMCTRL_INST_NUM 1 /**< \brief (NVMCTRL) Number of instances */ +#define NVMCTRL_INSTS { NVMCTRL } /**< \brief (NVMCTRL) Instances List */ + +#define OSCCTRL ((Oscctrl *)0x40001000UL) /**< \brief (OSCCTRL) APB Base Address */ +#define OSCCTRL_INST_NUM 1 /**< \brief (OSCCTRL) Number of instances */ +#define OSCCTRL_INSTS { OSCCTRL } /**< \brief (OSCCTRL) Instances List */ + +#define OSC32KCTRL ((Osc32kctrl *)0x40001400UL) /**< \brief (OSC32KCTRL) APB Base Address */ +#define OSC32KCTRL_INST_NUM 1 /**< \brief (OSC32KCTRL) Number of instances */ +#define OSC32KCTRL_INSTS { OSC32KCTRL } /**< \brief (OSC32KCTRL) Instances List */ + +#define PAC ((Pac *)0x40000000UL) /**< \brief (PAC) APB Base Address */ +#define PAC_INST_NUM 1 /**< \brief (PAC) Number of instances */ +#define PAC_INSTS { PAC } /**< \brief (PAC) Instances List */ + +#define PCC ((Pcc *)0x43002C00UL) /**< \brief (PCC) APB Base Address */ +#define PCC_INST_NUM 1 /**< \brief (PCC) Number of instances */ +#define PCC_INSTS { PCC } /**< \brief (PCC) Instances List */ + +#define PDEC ((Pdec *)0x42001C00UL) /**< \brief (PDEC) APB Base Address */ +#define PDEC_INST_NUM 1 /**< \brief (PDEC) Number of instances */ +#define PDEC_INSTS { PDEC } /**< \brief (PDEC) Instances List */ + +#define PM ((Pm *)0x40000400UL) /**< \brief (PM) APB Base Address */ +#define PM_INST_NUM 1 /**< \brief (PM) Number of instances */ +#define PM_INSTS { PM } /**< \brief (PM) Instances List */ + +#define PORT ((Port *)0x41008000UL) /**< \brief (PORT) APB Base Address */ +#define PORT_INST_NUM 1 /**< \brief (PORT) Number of instances */ +#define PORT_INSTS { PORT } /**< \brief (PORT) Instances List */ + +#define PUKCC ((void *)0x42003000UL) /**< \brief (PUKCC) APB Base Address */ +#define PUKCC_AHB ((void *)0x02000000UL) /**< \brief (PUKCC) AHB Base Address */ +#define PUKCC_INST_NUM 1 /**< \brief (PUKCC) Number of instances */ +#define PUKCC_INSTS { PUKCC } /**< \brief (PUKCC) Instances List */ + +#define QSPI ((Qspi *)0x42003400UL) /**< \brief (QSPI) APB Base Address */ +#define QSPI_AHB (0x04000000UL) /**< \brief (QSPI) AHB Base Address */ +#define QSPI_INST_NUM 1 /**< \brief (QSPI) Number of instances */ +#define QSPI_INSTS { QSPI } /**< \brief (QSPI) Instances List */ + +#define RAMECC ((Ramecc *)0x41020000UL) /**< \brief (RAMECC) APB Base Address */ +#define RAMECC_INST_NUM 1 /**< \brief (RAMECC) Number of instances */ +#define RAMECC_INSTS { RAMECC } /**< \brief (RAMECC) Instances List */ + +#define RSTC ((Rstc *)0x40000C00UL) /**< \brief (RSTC) APB Base Address */ +#define RSTC_INST_NUM 1 /**< \brief (RSTC) Number of instances */ +#define RSTC_INSTS { RSTC } /**< \brief (RSTC) Instances List */ + +#define RTC ((Rtc *)0x40002400UL) /**< \brief (RTC) APB Base Address */ +#define RTC_INST_NUM 1 /**< \brief (RTC) Number of instances */ +#define RTC_INSTS { RTC } /**< \brief (RTC) Instances List */ + +#define SDHC0 ((Sdhc *)0x45000000UL) /**< \brief (SDHC0) AHB Base Address */ +#define SDHC_INST_NUM 1 /**< \brief (SDHC) Number of instances */ +#define SDHC_INSTS { SDHC0 } /**< \brief (SDHC) Instances List */ + +#define SERCOM0 ((Sercom *)0x40003000UL) /**< \brief (SERCOM0) APB Base Address */ +#define SERCOM1 ((Sercom *)0x40003400UL) /**< \brief (SERCOM1) APB Base Address */ +#define SERCOM2 ((Sercom *)0x41012000UL) /**< \brief (SERCOM2) APB Base Address */ +#define SERCOM3 ((Sercom *)0x41014000UL) /**< \brief (SERCOM3) APB Base Address */ +#define SERCOM4 ((Sercom *)0x43000000UL) /**< \brief (SERCOM4) APB Base Address */ +#define SERCOM5 ((Sercom *)0x43000400UL) /**< \brief (SERCOM5) APB Base Address */ +#define SERCOM_INST_NUM 6 /**< \brief (SERCOM) Number of instances */ +#define SERCOM_INSTS { SERCOM0, SERCOM1, SERCOM2, SERCOM3, SERCOM4, SERCOM5 } /**< \brief (SERCOM) Instances List */ + +#define SUPC ((Supc *)0x40001800UL) /**< \brief (SUPC) APB Base Address */ +#define SUPC_INST_NUM 1 /**< \brief (SUPC) Number of instances */ +#define SUPC_INSTS { SUPC } /**< \brief (SUPC) Instances List */ + +#define TAL ((Tal *)0x4101E000UL) /**< \brief (TAL) APB Base Address */ +#define TAL_INST_NUM 1 /**< \brief (TAL) Number of instances */ +#define TAL_INSTS { TAL } /**< \brief (TAL) Instances List */ + +#define TC0 ((Tc *)0x40003800UL) /**< \brief (TC0) APB Base Address */ +#define TC1 ((Tc *)0x40003C00UL) /**< \brief (TC1) APB Base Address */ +#define TC2 ((Tc *)0x4101A000UL) /**< \brief (TC2) APB Base Address */ +#define TC3 ((Tc *)0x4101C000UL) /**< \brief (TC3) APB Base Address */ +#define TC4 ((Tc *)0x42001400UL) /**< \brief (TC4) APB Base Address */ +#define TC5 ((Tc *)0x42001800UL) /**< \brief (TC5) APB Base Address */ +#define TC_INST_NUM 6 /**< \brief (TC) Number of instances */ +#define TC_INSTS { TC0, TC1, TC2, TC3, TC4, TC5 } /**< \brief (TC) Instances List */ + +#define TCC0 ((Tcc *)0x41016000UL) /**< \brief (TCC0) APB Base Address */ +#define TCC1 ((Tcc *)0x41018000UL) /**< \brief (TCC1) APB Base Address */ +#define TCC2 ((Tcc *)0x42000C00UL) /**< \brief (TCC2) APB Base Address */ +#define TCC3 ((Tcc *)0x42001000UL) /**< \brief (TCC3) APB Base Address */ +#define TCC4 ((Tcc *)0x43001000UL) /**< \brief (TCC4) APB Base Address */ +#define TCC_INST_NUM 5 /**< \brief (TCC) Number of instances */ +#define TCC_INSTS { TCC0, TCC1, TCC2, TCC3, TCC4 } /**< \brief (TCC) Instances List */ + +#define TRNG ((Trng *)0x42002800UL) /**< \brief (TRNG) APB Base Address */ +#define TRNG_INST_NUM 1 /**< \brief (TRNG) Number of instances */ +#define TRNG_INSTS { TRNG } /**< \brief (TRNG) Instances List */ + +#define USB ((Usb *)0x41000000UL) /**< \brief (USB) APB Base Address */ +#define USB_INST_NUM 1 /**< \brief (USB) Number of instances */ +#define USB_INSTS { USB } /**< \brief (USB) Instances List */ + +#define WDT ((Wdt *)0x40002000UL) /**< \brief (WDT) APB Base Address */ +#define WDT_INST_NUM 1 /**< \brief (WDT) Number of instances */ +#define WDT_INSTS { WDT } /**< \brief (WDT) Instances List */ + +#endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +/*@}*/ + +/* ************************************************************************** */ +/** PORT DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ +/** \defgroup SAMD51J18A_port PORT Definitions */ +/*@{*/ + +#include "pio/samd51j18a.h" +/*@}*/ + +/* ************************************************************************** */ +/** MEMORY MAPPING DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ + +#define HSRAM_SIZE _UL_(0x00020000) /* 128 kB */ +#define FLASH_SIZE _UL_(0x00040000) /* 256 kB */ +#define FLASH_PAGE_SIZE 512 +#define FLASH_NB_OF_PAGES 512 +#define FLASH_USER_PAGE_SIZE 512 +#define BKUPRAM_SIZE _UL_(0x00002000) /* 8 kB */ +#define QSPI_SIZE _UL_(0x01000000) /* 16384 kB */ + +#define FLASH_ADDR _UL_(0x00000000) /**< FLASH base address */ +#define CMCC_DATARAM_ADDR _UL_(0x03000000) /**< CMCC_DATARAM base address */ +#define CMCC_DATARAM_SIZE _UL_(0x00001000) /**< CMCC_DATARAM size */ +#define CMCC_TAGRAM_ADDR _UL_(0x03001000) /**< CMCC_TAGRAM base address */ +#define CMCC_TAGRAM_SIZE _UL_(0x00000400) /**< CMCC_TAGRAM size */ +#define CMCC_VALIDRAM_ADDR _UL_(0x03002000) /**< CMCC_VALIDRAM base address */ +#define CMCC_VALIDRAM_SIZE _UL_(0x00000040) /**< CMCC_VALIDRAM size */ +#define HSRAM_ADDR _UL_(0x20000000) /**< HSRAM base address */ +#define HSRAM_ETB_ADDR _UL_(0x20000000) /**< HSRAM_ETB base address */ +#define HSRAM_ETB_SIZE _UL_(0x00008000) /**< HSRAM_ETB size */ +#define HSRAM_RET1_ADDR _UL_(0x20000000) /**< HSRAM_RET1 base address */ +#define HSRAM_RET1_SIZE _UL_(0x00008000) /**< HSRAM_RET1 size */ +#define HPB0_ADDR _UL_(0x40000000) /**< HPB0 base address */ +#define HPB1_ADDR _UL_(0x41000000) /**< HPB1 base address */ +#define HPB2_ADDR _UL_(0x42000000) /**< HPB2 base address */ +#define HPB3_ADDR _UL_(0x43000000) /**< HPB3 base address */ +#define SEEPROM_ADDR _UL_(0x44000000) /**< SEEPROM base address */ +#define BKUPRAM_ADDR _UL_(0x47000000) /**< BKUPRAM base address */ +#define PPB_ADDR _UL_(0xE0000000) /**< PPB base address */ + +#define DSU_DID_RESETVALUE _UL_(0x60060006) +#define ADC0_TOUCH_LINES_NUM 32 +#define PORT_GROUPS 2 + +/* ************************************************************************** */ +/** ELECTRICAL DEFINITIONS FOR SAMD51J18A */ +/* ************************************************************************** */ + + +#ifdef __cplusplus +} +#endif + +/*@}*/ + +#endif /* SAMD51J18A_H */ diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/system_samd51.h b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/system_samd51.h new file mode 100644 index 0000000000..cfbd2b921b --- /dev/null +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include/system_samd51.h @@ -0,0 +1,48 @@ +/** + * \file + * + * \brief Low-level initialization functions called upon chip startup + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#ifndef _SYSTEM_SAMD51_H_INCLUDED_ +#define _SYSTEM_SAMD51_H_INCLUDED_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ + +void SystemInit(void); +void SystemCoreClockUpdate(void); + +#ifdef __cplusplus +} +#endif + +#endif /* SYSTEM_SAMD51_H_INCLUDED */ diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk new file mode 100644 index 0000000000..ef412d59d6 --- /dev/null +++ b/tmk_core/arm_atsam.mk @@ -0,0 +1,56 @@ +# Hey Emacs, this is a -*- makefile -*- +############################################################################## +# Compiler settings +# +CC = arm-none-eabi-gcc +OBJCOPY = arm-none-eabi-objcopy +OBJDUMP = arm-none-eabi-objdump +SIZE = arm-none-eabi-size +AR = arm-none-eabi-ar rcs +NM = arm-none-eabi-nm +HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature +EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) +BIN = + +COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/include +COMMON_VPATH += $(LIB_PATH)/arm_atsam/packs/arm/cmsis/5.0.1/CMSIS/Include + +COMPILEFLAGS += -funsigned-char +COMPILEFLAGS += -funsigned-bitfields +COMPILEFLAGS += -ffunction-sections +COMPILEFLAGS += -fshort-enums +COMPILEFLAGS += -fno-inline-small-functions +COMPILEFLAGS += -fno-strict-aliasing +COMPILEFLAGS += -mfloat-abi=hard +COMPILEFLAGS += -mfpu=fpv4-sp-d16 +COMPILEFLAGS += -mthumb + +#ALLOW_WARNINGS = yes + +CFLAGS += $(COMPILEFLAGS) + +CPPFLAGS += $(COMPILEFLAGS) +CPPFLAGS += -fno-exceptions -std=c++11 + +LDFLAGS +=-Wl,--gc-sections +LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map" +LDFLAGS += -Wl,--start-group +LDFLAGS += -Wl,--end-group +LDFLAGS += -Wl,--gc-sections +LDFLAGS += -T$(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld + +OPT_DEFS += -DPROTOCOL_ARM_ATSAM + +MCUFLAGS = -mcpu=$(MCU) +MCUFLAGS += -D__$(ARM_ATSAM)__ + +# List any extra directories to look for libraries here. +# Each directory must be seperated by a space. +# Use forward slashes for directory separators. +# For a directory that has spaces, enclose it in quotes. +EXTRALIBDIRS = + +# Convert hex to bin. +bin: $(BUILD_DIR)/$(TARGET).hex + $(OBJCOPY) -Iihex -Obinary $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin + $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 3e407f1573..fd91d29dce 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -3,6 +3,8 @@ ifeq ($(PLATFORM),AVR) PLATFORM_COMMON_DIR = $(COMMON_DIR)/avr else ifeq ($(PLATFORM),CHIBIOS) PLATFORM_COMMON_DIR = $(COMMON_DIR)/chibios +else ifeq ($(PLATFORM),ARM_ATSAM) + PLATFORM_COMMON_DIR = $(COMMON_DIR)/arm_atsam else PLATFORM_COMMON_DIR = $(COMMON_DIR)/test endif @@ -35,6 +37,10 @@ ifeq ($(PLATFORM),CHIBIOS) endif endif +ifeq ($(PLATFORM),ARM_ATSAM) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c +endif + ifeq ($(PLATFORM),TEST) TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c endif diff --git a/tmk_core/common/arm_atsam/bootloader.c b/tmk_core/common/arm_atsam/bootloader.c new file mode 100644 index 0000000000..5155d9ff04 --- /dev/null +++ b/tmk_core/common/arm_atsam/bootloader.c @@ -0,0 +1,19 @@ +/* Copyright 2017 Fred Sundvik + * + * 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 . + */ + +#include "bootloader.h" + +void bootloader_jump(void) {} diff --git a/tmk_core/common/arm_atsam/eeprom.c b/tmk_core/common/arm_atsam/eeprom.c new file mode 100644 index 0000000000..61cc039efa --- /dev/null +++ b/tmk_core/common/arm_atsam/eeprom.c @@ -0,0 +1,98 @@ +/* Copyright 2017 Fred Sundvik + * + * 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 . + */ + +#include "eeprom.h" + +#define EEPROM_SIZE 32 + +static uint8_t buffer[EEPROM_SIZE]; + +uint8_t eeprom_read_byte(const uint8_t *addr) { + uintptr_t offset = (uintptr_t)addr; + return buffer[offset]; +} + +void eeprom_write_byte(uint8_t *addr, uint8_t value) { + uintptr_t offset = (uintptr_t)addr; + buffer[offset] = value; +} + +uint16_t eeprom_read_word(const uint16_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8); +} + +uint32_t eeprom_read_dword(const uint32_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8) + | (eeprom_read_byte(p+2) << 16) | (eeprom_read_byte(p+3) << 24); +} + +void eeprom_read_block(void *buf, const void *addr, uint32_t len) { + const uint8_t *p = (const uint8_t *)addr; + uint8_t *dest = (uint8_t *)buf; + while (len--) { + *dest++ = eeprom_read_byte(p++); + } +} + +void eeprom_write_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_write_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_write_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} + +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} + +void eeprom_update_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_update_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_update_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} diff --git a/tmk_core/common/arm_atsam/printf.h b/tmk_core/common/arm_atsam/printf.h new file mode 100644 index 0000000000..582c83bf54 --- /dev/null +++ b/tmk_core/common/arm_atsam/printf.h @@ -0,0 +1,8 @@ +#ifndef _PRINTF_H_ +#define _PRINTF_H_ + +#define __xprintf dpf +int dpf(const char *_Format, ...); + +#endif //_PRINTF_H_ + diff --git a/tmk_core/common/arm_atsam/suspend.c b/tmk_core/common/arm_atsam/suspend.c new file mode 100644 index 0000000000..01d1930ea5 --- /dev/null +++ b/tmk_core/common/arm_atsam/suspend.c @@ -0,0 +1,17 @@ +/* Copyright 2017 Fred Sundvik + * + * 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 . + */ + + diff --git a/tmk_core/common/arm_atsam/timer.c b/tmk_core/common/arm_atsam/timer.c new file mode 100644 index 0000000000..bcfe5002c3 --- /dev/null +++ b/tmk_core/common/arm_atsam/timer.c @@ -0,0 +1,59 @@ +#include "samd51j18a.h" +#include "timer.h" +#include "tmk_core/protocol/arm_atsam/clks.h" + +void set_time(uint64_t tset) +{ + ms_clk = tset; +} + +void timer_init(void) +{ + ms_clk = 0; +} + +uint16_t timer_read(void) +{ + return (uint16_t)ms_clk; +} + +uint32_t timer_read32(void) +{ + return (uint32_t)ms_clk; +} + +uint64_t timer_read64(void) +{ + return ms_clk; +} + +uint16_t timer_elapsed(uint16_t tlast) +{ + return TIMER_DIFF_16(timer_read(), tlast); +} + +uint32_t timer_elapsed32(uint32_t tlast) +{ + return TIMER_DIFF_32(timer_read32(), tlast); +} + +uint32_t timer_elapsed64(uint32_t tlast) +{ + uint64_t tnow = timer_read64(); + return (tnow >= tlast ? tnow - tlast : UINT64_MAX - tlast + tnow); +} + +void timer_clear(void) +{ + ms_clk = 0; +} + +void wait_ms(uint64_t msec) +{ + CLK_delay_ms(msec); +} + +void wait_us(uint16_t usec) +{ + CLK_delay_us(usec); +} diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 8836c0fc7c..9cbe67bad6 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -99,6 +99,34 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); # endif /* USER_PRINT / NORMAL PRINT */ +#elif defined(PROTOCOL_ARM_ATSAM) /* PROTOCOL_ARM_ATSAM */ + +# include "arm_atsam/printf.h" + +# ifdef USER_PRINT /* USER_PRINT */ + +// Remove normal print defines +# define print(s) +# define println(s) +# define xprintf(fmt, ...) + +// Create user print defines +# define uprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) +# define uprint(s) xprintf(s) +# define uprintln(s) xprintf(s "\r\n") + +# else /* NORMAL PRINT */ + +// Create user & normal print defines +# define xprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) +# define print(s) xprintf(s) +# define println(s) xprintf(s "\r\n") +# define uprint(s) print(s) +# define uprintln(s) println(s) +# define uprintf(fmt, ...) xprintf(fmt, ...) + +# endif /* USER_PRINT / NORMAL PRINT */ + #elif defined(__arm__) /* __arm__ */ # include "mbed/xprintf.h" @@ -130,7 +158,7 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); /* TODO: to select output destinations: UART/USBSerial */ # define print_set_sendchar(func) -#endif /* __AVR__ / PROTOCOL_CHIBIOS / __arm__ */ +#endif /* __AVR__ / PROTOCOL_CHIBIOS / PROTOCOL_ARM_ATSAM / __arm__ */ // User print disables the normal print messages in the body of QMK/TMK code and // is meant as a lightweight alternative to NOPRINT. Use it when you only want to do diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 6c27eb9dc6..167f382751 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -84,6 +84,11 @@ along with this program. If not, see . #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #elif defined(PROTOCOL_ARM_ATSAM) + #include "protocol/arm_atsam/usb/udi_device_epsize.h" + #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE + #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) + #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) #else #error "NKRO not supported with this protocol" #endif diff --git a/tmk_core/protocol/arm_atsam.mk b/tmk_core/protocol/arm_atsam.mk new file mode 100644 index 0000000000..d535b64cd7 --- /dev/null +++ b/tmk_core/protocol/arm_atsam.mk @@ -0,0 +1,26 @@ +ARM_ATSAM_DIR = protocol/arm_atsam + +SRC += $(ARM_ATSAM_DIR)/adc.c +SRC += $(ARM_ATSAM_DIR)/clks.c +SRC += $(ARM_ATSAM_DIR)/d51_util.c +SRC += $(ARM_ATSAM_DIR)/i2c_master.c +SRC += $(ARM_ATSAM_DIR)/led_matrix.c +SRC += $(ARM_ATSAM_DIR)/main_arm_atsam.c +SRC += $(ARM_ATSAM_DIR)/spi.c +SRC += $(ARM_ATSAM_DIR)/startup.c + +SRC += $(ARM_ATSAM_DIR)/usb/main_usb.c +SRC += $(ARM_ATSAM_DIR)/usb/spfssf.c +SRC += $(ARM_ATSAM_DIR)/usb/udc.c +SRC += $(ARM_ATSAM_DIR)/usb/udi_cdc.c +SRC += $(ARM_ATSAM_DIR)/usb/udi_hid.c +SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd.c +SRC += $(ARM_ATSAM_DIR)/usb/udi_hid_kbd_desc.c +SRC += $(ARM_ATSAM_DIR)/usb/ui.c +SRC += $(ARM_ATSAM_DIR)/usb/usb2422.c +SRC += $(ARM_ATSAM_DIR)/usb/usb.c +SRC += $(ARM_ATSAM_DIR)/usb/usb_device_udd.c +SRC += $(ARM_ATSAM_DIR)/usb/usb_util.c + +# Search Path +VPATH += $(TMK_DIR)/$(ARM_ATSAM_DIR) diff --git a/tmk_core/protocol/arm_atsam/adc.c b/tmk_core/protocol/arm_atsam/adc.c new file mode 100644 index 0000000000..ab77f92402 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/adc.c @@ -0,0 +1,99 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" + +uint16_t v_5v; +uint16_t v_5v_avg; +uint16_t v_con_1; +uint16_t v_con_2; +uint16_t v_con_1_boot; +uint16_t v_con_2_boot; + +void ADC0_clock_init(void) +{ + DBGC(DC_ADC0_CLOCK_INIT_BEGIN); + + MCLK->APBDMASK.bit.ADC0_ = 1; //ADC0 Clock Enable + + GCLK->PCHCTRL[ADC0_GCLK_ID].bit.GEN = GEN_OSC0; //Select generator clock + GCLK->PCHCTRL[ADC0_GCLK_ID].bit.CHEN = 1; //Enable peripheral clock + + DBGC(DC_ADC0_CLOCK_INIT_COMPLETE); +} + +void ADC0_init(void) +{ + DBGC(DC_ADC0_INIT_BEGIN); + + //MCU + PORT->Group[1].DIRCLR.reg = 1 << 0; //PB00 as input 5V + PORT->Group[1].DIRCLR.reg = 1 << 1; //PB01 as input CON2 + PORT->Group[1].DIRCLR.reg = 1 << 2; //PB02 as input CON1 + PORT->Group[1].PMUX[0].bit.PMUXE = 1; //PB00 mux select B ADC 5V + PORT->Group[1].PMUX[0].bit.PMUXO = 1; //PB01 mux select B ADC CON2 + PORT->Group[1].PMUX[1].bit.PMUXE = 1; //PB02 mux select B ADC CON1 + PORT->Group[1].PINCFG[0].bit.PMUXEN = 1; //PB01 mux ADC Enable 5V + PORT->Group[1].PINCFG[1].bit.PMUXEN = 1; //PB01 mux ADC Enable CON2 + PORT->Group[1].PINCFG[2].bit.PMUXEN = 1; //PB02 mux ADC Enable CON1 + + //ADC + ADC0->CTRLA.bit.SWRST = 1; + while (ADC0->SYNCBUSY.bit.SWRST) { DBGC(DC_ADC0_SWRST_SYNCING_1); } + while (ADC0->CTRLA.bit.SWRST) { DBGC(DC_ADC0_SWRST_SYNCING_2); } + + //Clock divide + ADC0->CTRLA.bit.PRESCALER = ADC_CTRLA_PRESCALER_DIV2_Val; + + //Averaging + ADC0->AVGCTRL.bit.SAMPLENUM = ADC_AVGCTRL_SAMPLENUM_4_Val; + while (ADC0->SYNCBUSY.bit.AVGCTRL) { DBGC(DC_ADC0_AVGCTRL_SYNCING_1); } + if (ADC0->AVGCTRL.bit.SAMPLENUM == ADC_AVGCTRL_SAMPLENUM_1_Val) ADC0->AVGCTRL.bit.ADJRES = 0; + else if (ADC0->AVGCTRL.bit.SAMPLENUM == ADC_AVGCTRL_SAMPLENUM_2_Val) ADC0->AVGCTRL.bit.ADJRES = 1; + else if (ADC0->AVGCTRL.bit.SAMPLENUM == ADC_AVGCTRL_SAMPLENUM_4_Val) ADC0->AVGCTRL.bit.ADJRES = 2; + else if (ADC0->AVGCTRL.bit.SAMPLENUM == ADC_AVGCTRL_SAMPLENUM_8_Val) ADC0->AVGCTRL.bit.ADJRES = 3; + else ADC0->AVGCTRL.bit.ADJRES = 4; + while (ADC0->SYNCBUSY.bit.AVGCTRL) { DBGC(DC_ADC0_AVGCTRL_SYNCING_2); } + + //Settling + ADC0->SAMPCTRL.bit.SAMPLEN = 45; //Sampling Time Length: 1-63, 1 ADC CLK per + while (ADC0->SYNCBUSY.bit.SAMPCTRL) { DBGC(DC_ADC0_SAMPCTRL_SYNCING_1); } + + //Load factory calibration data + ADC0->CALIB.bit.BIASCOMP = (ADC0_FUSES_BIASCOMP_ADDR >> ADC0_FUSES_BIASCOMP_Pos) & ADC0_FUSES_BIASCOMP_Msk; + ADC0->CALIB.bit.BIASR2R = (ADC0_FUSES_BIASR2R_ADDR >> ADC0_FUSES_BIASR2R_Pos) & ADC0_FUSES_BIASR2R_Msk; + ADC0->CALIB.bit.BIASREFBUF = (ADC0_FUSES_BIASREFBUF_ADDR >> ADC0_FUSES_BIASREFBUF_Pos) & ADC0_FUSES_BIASREFBUF_Msk; + + //Enable + ADC0->CTRLA.bit.ENABLE = 1; + while (ADC0->SYNCBUSY.bit.ENABLE) { DBGC(DC_ADC0_ENABLE_SYNCING_1); } + + DBGC(DC_ADC0_INIT_COMPLETE); +} + +uint16_t adc_get(uint8_t muxpos) +{ + ADC0->INPUTCTRL.bit.MUXPOS = muxpos; + while (ADC0->SYNCBUSY.bit.INPUTCTRL) {} + + ADC0->SWTRIG.bit.START = 1; + while (ADC0->SYNCBUSY.bit.SWTRIG) {} + while (!ADC0->INTFLAG.bit.RESRDY) {} + + return ADC0->RESULT.reg; +} + diff --git a/tmk_core/protocol/arm_atsam/adc.h b/tmk_core/protocol/arm_atsam/adc.h new file mode 100644 index 0000000000..5a90ece3fe --- /dev/null +++ b/tmk_core/protocol/arm_atsam/adc.h @@ -0,0 +1,37 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _ADC_H_ +#define _ADC_H_ + +#define ADC_5V_START_LEVEL 2365 + +#define ADC_5V ADC_INPUTCTRL_MUXPOS_AIN12_Val +#define ADC_CON1 ADC_INPUTCTRL_MUXPOS_AIN14_Val +#define ADC_CON2 ADC_INPUTCTRL_MUXPOS_AIN13_Val + +extern uint16_t v_5v; +extern uint16_t v_5v_avg; +extern uint16_t v_con_1; +extern uint16_t v_con_2; +extern uint16_t v_con_1_boot; +extern uint16_t v_con_2_boot; + +void ADC0_clock_init(void); +void ADC0_init(void); + +#endif //_ADC_H_ diff --git a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h new file mode 100644 index 0000000000..be73beccd7 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h @@ -0,0 +1,45 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _ARM_ATSAM_PROTOCOL_H_ +#define _ARM_ATSAM_PROTOCOL_H_ + +#include "samd51j18a.h" +#include "md_bootloader.h" + +#include "d51_util.h" +#include "clks.h" +#include "adc.h" +#include "i2c_master.h" +#include "spi.h" + +#include "./usb/usb2422.h" + +#ifndef MD_BOOTLOADER + +#include "main_arm_atsam.h" +#include "led_matrix.h" +#include "issi3733_driver.h" +#include "./usb/compiler.h" +#include "./usb/udc.h" +#include "./usb/spfssf.h" +#include "./usb/udi_cdc.h" + +#endif //MD_BOOTLOADER + +#endif //_ARM_ATSAM_PROTOCOL_H_ + diff --git a/tmk_core/protocol/arm_atsam/clks.c b/tmk_core/protocol/arm_atsam/clks.c new file mode 100644 index 0000000000..8768d0a99e --- /dev/null +++ b/tmk_core/protocol/arm_atsam/clks.c @@ -0,0 +1,439 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" + +#include + +volatile clk_t system_clks; +volatile uint64_t ms_clk; + +volatile uint8_t us_delay_done; + +const uint32_t sercom_apbbase[] = {(uint32_t)SERCOM0,(uint32_t)SERCOM1,(uint32_t)SERCOM2,(uint32_t)SERCOM3,(uint32_t)SERCOM4,(uint32_t)SERCOM5}; +const uint8_t sercom_pchan[] = {7, 8, 23, 24, 34, 35}; + +#define USE_DPLL_IND 0 +#define USE_DPLL_DEF GCLK_SOURCE_DPLL0 + +void CLK_oscctrl_init(void) +{ + Oscctrl *posctrl = OSCCTRL; + Gclk *pgclk = GCLK; + + DBGC(DC_CLK_OSC_INIT_BEGIN); + + //default setup on por + system_clks.freq_dfll = FREQ_DFLL_DEFAULT; + system_clks.freq_gclk[0] = system_clks.freq_dfll; + + //configure and startup 16MHz xosc0 + posctrl->XOSCCTRL[0].bit.ENABLE = 0; + posctrl->XOSCCTRL[0].bit.STARTUP = 0xD; + posctrl->XOSCCTRL[0].bit.ENALC = 1; + posctrl->XOSCCTRL[0].bit.IMULT = 5; + posctrl->XOSCCTRL[0].bit.IPTAT = 3; + posctrl->XOSCCTRL[0].bit.ONDEMAND = 0; + posctrl->XOSCCTRL[0].bit.XTALEN = 1; + posctrl->XOSCCTRL[0].bit.ENABLE = 1; + while (posctrl->STATUS.bit.XOSCRDY0 == 0) { DBGC(DC_CLK_OSC_INIT_XOSC0_SYNC); } + system_clks.freq_xosc0 = FREQ_XOSC0; + + //configure and startup DPLL + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLA.bit.ENABLE = 0; + while (posctrl->Dpll[USE_DPLL_IND].DPLLSYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_OSC_INIT_DPLL_SYNC_DISABLE); } + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.REFCLK = 2; //select XOSC0 (16MHz) + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.DIV = 7; //16 MHz / (2 * (7 + 1)) = 1 MHz + posctrl->Dpll[USE_DPLL_IND].DPLLRATIO.bit.LDR = PLL_RATIO; //1 MHz * (PLL_RATIO(47) + 1) = 48MHz + while (posctrl->Dpll[USE_DPLL_IND].DPLLSYNCBUSY.bit.DPLLRATIO) { DBGC(DC_CLK_OSC_INIT_DPLL_SYNC_RATIO); } + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLA.bit.ONDEMAND = 0; + posctrl->Dpll[USE_DPLL_IND].DPLLCTRLA.bit.ENABLE = 1; + while (posctrl->Dpll[USE_DPLL_IND].DPLLSYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_OSC_INIT_DPLL_SYNC_ENABLE); } + while (posctrl->Dpll[USE_DPLL_IND].DPLLSTATUS.bit.LOCK == 0) { DBGC(DC_CLK_OSC_INIT_DPLL_WAIT_LOCK); } + while (posctrl->Dpll[USE_DPLL_IND].DPLLSTATUS.bit.CLKRDY == 0) { DBGC(DC_CLK_OSC_INIT_DPLL_WAIT_CLKRDY); } + system_clks.freq_dpll[0] = (system_clks.freq_xosc0 / 2 / (posctrl->Dpll[USE_DPLL_IND].DPLLCTRLB.bit.DIV + 1)) * (posctrl->Dpll[USE_DPLL_IND].DPLLRATIO.bit.LDR + 1); + + //change gclk0 to DPLL + pgclk->GENCTRL[GEN_DPLL0].bit.SRC = USE_DPLL_DEF; + while (pgclk->SYNCBUSY.bit.GENCTRL0) { DBGC(DC_CLK_OSC_INIT_GCLK_SYNC_GENCTRL0); } + + system_clks.freq_gclk[0] = system_clks.freq_dpll[0]; + + DBGC(DC_CLK_OSC_INIT_COMPLETE); +} + +//configure for 1MHz (1 usec timebase) +//call CLK_set_gclk_freq(GEN_TC45, FREQ_TC45_DEFAULT); +uint32_t CLK_set_gclk_freq(uint8_t gclkn, uint32_t freq) +{ + Gclk *pgclk = GCLK; + + DBGC(DC_CLK_SET_GCLK_FREQ_BEGIN); + + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_SET_GCLK_FREQ_SYNC_1); } + pgclk->GENCTRL[gclkn].bit.SRC = USE_DPLL_DEF; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_SET_GCLK_FREQ_SYNC_2); } + pgclk->GENCTRL[gclkn].bit.DIV = (uint8_t)(system_clks.freq_dpll[0] / freq); + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_SET_GCLK_FREQ_SYNC_3); } + pgclk->GENCTRL[gclkn].bit.DIVSEL = 0; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_SET_GCLK_FREQ_SYNC_4); } + pgclk->GENCTRL[gclkn].bit.GENEN = 1; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_SET_GCLK_FREQ_SYNC_5); } + system_clks.freq_gclk[gclkn] = system_clks.freq_dpll[0] / pgclk->GENCTRL[gclkn].bit.DIV; + + DBGC(DC_CLK_SET_GCLK_FREQ_COMPLETE); + + return system_clks.freq_gclk[gclkn]; +} + +void CLK_init_osc(void) +{ + uint8_t gclkn = GEN_OSC0; + Gclk *pgclk = GCLK; + + DBGC(DC_CLK_INIT_OSC_BEGIN); + + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_INIT_OSC_SYNC_1); } + pgclk->GENCTRL[gclkn].bit.SRC = GCLK_SOURCE_XOSC0; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_INIT_OSC_SYNC_2); } + pgclk->GENCTRL[gclkn].bit.DIV = 1; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_INIT_OSC_SYNC_3); } + pgclk->GENCTRL[gclkn].bit.DIVSEL = 0; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_INIT_OSC_SYNC_4); } + pgclk->GENCTRL[gclkn].bit.GENEN = 1; + while (pgclk->SYNCBUSY.vec.GENCTRL) { DBGC(DC_CLK_INIT_OSC_SYNC_5); } + system_clks.freq_gclk[gclkn] = system_clks.freq_xosc0; + + DBGC(DC_CLK_INIT_OSC_COMPLETE); +} + +void CLK_reset_time(void) +{ + Tc *ptc4 = TC4; + Tc *ptc0 = TC0; + + ms_clk = 0; + + DBGC(DC_CLK_RESET_TIME_BEGIN); + + //stop counters + ptc4->COUNT16.CTRLA.bit.ENABLE = 0; + while (ptc4->COUNT16.SYNCBUSY.bit.ENABLE) {} + ptc0->COUNT32.CTRLA.bit.ENABLE = 0; + while (ptc0->COUNT32.SYNCBUSY.bit.ENABLE) {} + //zero counters + ptc4->COUNT16.COUNT.reg = 0; + while (ptc4->COUNT16.SYNCBUSY.bit.COUNT) {} + ptc0->COUNT32.COUNT.reg = 0; + while (ptc0->COUNT32.SYNCBUSY.bit.COUNT) {} + //start counters + ptc0->COUNT32.CTRLA.bit.ENABLE = 1; + while (ptc0->COUNT32.SYNCBUSY.bit.ENABLE) {} + ptc4->COUNT16.CTRLA.bit.ENABLE = 1; + while (ptc4->COUNT16.SYNCBUSY.bit.ENABLE) {} + + DBGC(DC_CLK_RESET_TIME_COMPLETE); +} + +void TC4_Handler() +{ + if (TC4->COUNT16.INTFLAG.bit.MC0) + { + TC4->COUNT16.INTFLAG.reg = TC_INTENCLR_MC0; + ms_clk++; + } +} + +void TC5_Handler() +{ + if (TC5->COUNT16.INTFLAG.bit.MC0) + { + TC5->COUNT16.INTFLAG.reg = TC_INTENCLR_MC0; + us_delay_done = 1; + TC5->COUNT16.CTRLA.bit.ENABLE = 0; + while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} + } +} + +uint32_t CLK_enable_timebase(void) +{ + Gclk *pgclk = GCLK; + Mclk *pmclk = MCLK; + Tc *ptc4 = TC4; + Tc *ptc5 = TC5; + Tc *ptc0 = TC0; + Evsys *pevsys = EVSYS; + + DBGC(DC_CLK_ENABLE_TIMEBASE_BEGIN); + + //gclk2 highspeed time base + CLK_set_gclk_freq(GEN_TC45, FREQ_TC45_DEFAULT); + CLK_init_osc(); + + //unmask TC4, sourcegclk2 to TC4 + pmclk->APBCMASK.bit.TC4_ = 1; + pgclk->PCHCTRL[TC4_GCLK_ID].bit.GEN = GEN_TC45; + pgclk->PCHCTRL[TC4_GCLK_ID].bit.CHEN = 1; + + //unmask TC5 sourcegclk2 to TC5 + pmclk->APBCMASK.bit.TC5_ = 1; + pgclk->PCHCTRL[TC5_GCLK_ID].bit.GEN = GEN_TC45; + pgclk->PCHCTRL[TC5_GCLK_ID].bit.CHEN = 1; + + //configure TC4 + DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_BEGIN); + ptc4->COUNT16.CTRLA.bit.ENABLE = 0; + while (ptc4->COUNT16.SYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_DISABLE); } + ptc4->COUNT16.CTRLA.bit.SWRST = 1; + while (ptc4->COUNT16.SYNCBUSY.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_SWRST_1); } + while (ptc4->COUNT16.CTRLA.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_SWRST_2); } + + //CTRLA defaults + //CTRLB as default, counting up + ptc4->COUNT16.CTRLBCLR.reg = 5; + while (ptc4->COUNT16.SYNCBUSY.bit.CTRLB) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_CLTRB); } + ptc4->COUNT16.CC[0].reg = 999; + while (ptc4->COUNT16.SYNCBUSY.bit.CC0) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_CC0); } + //ptc4->COUNT16.DBGCTRL.bit.DBGRUN = 1; + + //wave mode + ptc4->COUNT16.WAVE.bit.WAVEGEN = 1; //MFRQ match frequency mode, toggle each CC match + //generate event for next stage + ptc4->COUNT16.EVCTRL.bit.MCEO0 = 1; + + NVIC_EnableIRQ(TC4_IRQn); + ptc4->COUNT16.INTENSET.bit.MC0 = 1; + + DBGC(DC_CLK_ENABLE_TIMEBASE_TC4_COMPLETE); + + //configure TC5 + DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_BEGIN); + ptc5->COUNT16.CTRLA.bit.ENABLE = 0; + while (ptc5->COUNT16.SYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_DISABLE); } + ptc5->COUNT16.CTRLA.bit.SWRST = 1; + while (ptc5->COUNT16.SYNCBUSY.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_1); } + while (ptc5->COUNT16.CTRLA.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_2); } + + //CTRLA defaults + //CTRLB as default, counting up + ptc5->COUNT16.CTRLBCLR.reg = 5; + while (ptc5->COUNT16.SYNCBUSY.bit.CTRLB) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_CLTRB); } + //ptc5->COUNT16.DBGCTRL.bit.DBGRUN = 1; + + //wave mode + ptc5->COUNT16.WAVE.bit.WAVEGEN = 1; //MFRQ match frequency mode, toggle each CC match + //generate event for next stage + ptc5->COUNT16.EVCTRL.bit.MCEO0 = 1; + + NVIC_EnableIRQ(TC5_IRQn); + ptc5->COUNT16.INTENSET.bit.MC0 = 1; + + DBGC(DC_CLK_ENABLE_TIMEBASE_TC5_COMPLETE); + + //unmask TC0,1, sourcegclk2 to TC0,1 + pmclk->APBAMASK.bit.TC0_ = 1; + pgclk->PCHCTRL[TC0_GCLK_ID].bit.GEN = GEN_TC45; + pgclk->PCHCTRL[TC0_GCLK_ID].bit.CHEN = 1; + + pmclk->APBAMASK.bit.TC1_ = 1; + pgclk->PCHCTRL[TC1_GCLK_ID].bit.GEN = GEN_TC45; + pgclk->PCHCTRL[TC1_GCLK_ID].bit.CHEN = 1; + + //configure TC0 + DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_BEGIN); + ptc0->COUNT32.CTRLA.bit.ENABLE = 0; + while (ptc0->COUNT32.SYNCBUSY.bit.ENABLE) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_DISABLE); } + ptc0->COUNT32.CTRLA.bit.SWRST = 1; + while (ptc0->COUNT32.SYNCBUSY.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_SWRST_1); } + while (ptc0->COUNT32.CTRLA.bit.SWRST) { DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_SWRST_2); } + //CTRLA as default + ptc0->COUNT32.CTRLA.bit.MODE = 2; //32 bit mode + ptc0->COUNT32.EVCTRL.bit.TCEI = 1; //enable incoming events + ptc0->COUNT32.EVCTRL.bit.EVACT = 2 ; //count events + + DBGC(DC_CLK_ENABLE_TIMEBASE_TC0_COMPLETE); + + DBGC(DC_CLK_ENABLE_TIMEBASE_EVSYS_BEGIN); + + //configure event system + pmclk->APBBMASK.bit.EVSYS_ = 1; + pgclk->PCHCTRL[EVSYS_GCLK_ID_0].bit.GEN = GEN_TC45; + pgclk->PCHCTRL[EVSYS_GCLK_ID_0].bit.CHEN = 1; + pevsys->USER[44].reg = EVSYS_ID_USER_PORT_EV_0; //TC0 will get event channel 0 + pevsys->Channel[0].CHANNEL.bit.EDGSEL = EVSYS_CHANNEL_EDGSEL_RISING_EDGE_Val; //Rising edge + pevsys->Channel[0].CHANNEL.bit.PATH = EVSYS_CHANNEL_PATH_SYNCHRONOUS_Val; //Synchronous + pevsys->Channel[0].CHANNEL.bit.EVGEN = EVSYS_ID_GEN_TC4_MCX_0; //TC4 MC0 + + DBGC(DC_CLK_ENABLE_TIMEBASE_EVSYS_COMPLETE); + + CLK_reset_time(); + + ADC0_clock_init(); + + DBGC(DC_CLK_ENABLE_TIMEBASE_COMPLETE); + + return 0; +} + +uint32_t CLK_get_ms(void) +{ + return ms_clk; +} + +void CLK_delay_us(uint16_t usec) +{ + us_delay_done = 0; + + if (TC5->COUNT16.CTRLA.bit.ENABLE) + { + TC5->COUNT16.CTRLA.bit.ENABLE = 0; + while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} + } + + if (usec < 10) usec = 0; + else usec -= 10; + + TC5->COUNT16.CC[0].reg = usec; + while (TC5->COUNT16.SYNCBUSY.bit.CC0) {} + + TC5->COUNT16.CTRLA.bit.ENABLE = 1; + while (TC5->COUNT16.SYNCBUSY.bit.ENABLE) {} + + while (!us_delay_done) {} +} + +void CLK_delay_ms(uint64_t msec) +{ + msec += CLK_get_ms(); + while (msec > CLK_get_ms()) {} +} + +void clk_enable_sercom_apbmask(int sercomn) +{ + Mclk *pmclk = MCLK; + switch (sercomn) + { + case 0: + pmclk->APBAMASK.bit.SERCOM0_ = 1; + break; + case 1: + pmclk->APBAMASK.bit.SERCOM1_ = 1; + break; + case 2: + pmclk->APBBMASK.bit.SERCOM2_ = 1; + break; + case 3: + pmclk->APBBMASK.bit.SERCOM3_ = 1; + break; + default: + break; + } +} + +//call CLK_oscctrl_init first +//call CLK_set_spi_freq(CHAN_SERCOM_SPI, FREQ_SPI_DEFAULT); +uint32_t CLK_set_spi_freq(uint8_t sercomn, uint32_t freq) +{ + DBGC(DC_CLK_SET_SPI_FREQ_BEGIN); + + Gclk *pgclk = GCLK; + Sercom *psercom = (Sercom *)sercom_apbbase[sercomn]; + clk_enable_sercom_apbmask(sercomn); + + //all gclk0 for now + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.GEN = 0; + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.CHEN = 1; + + psercom->I2CM.CTRLA.bit.SWRST = 1; + while (psercom->I2CM.SYNCBUSY.bit.SWRST) {} + while (psercom->I2CM.CTRLA.bit.SWRST) {} + + psercom->SPI.BAUD.reg = (uint8_t) (system_clks.freq_gclk[0]/2/freq-1); + system_clks.freq_spi = system_clks.freq_gclk[0]/2/(psercom->SPI.BAUD.reg+1); + system_clks.freq_sercom[sercomn] = system_clks.freq_spi; + + DBGC(DC_CLK_SET_SPI_FREQ_COMPLETE); + + return system_clks.freq_spi; +} + +//call CLK_oscctrl_init first +//call CLK_set_i2c0_freq(CHAN_SERCOM_I2C0, FREQ_I2C0_DEFAULT); +uint32_t CLK_set_i2c0_freq(uint8_t sercomn, uint32_t freq) +{ + DBGC(DC_CLK_SET_I2C0_FREQ_BEGIN); + + Gclk *pgclk = GCLK; + Sercom *psercom = (Sercom *)sercom_apbbase[sercomn]; + clk_enable_sercom_apbmask(sercomn); + + //all gclk0 for now + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.GEN = 0; + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.CHEN = 1; + + psercom->I2CM.CTRLA.bit.SWRST = 1; + while (psercom->I2CM.SYNCBUSY.bit.SWRST) {} + while (psercom->I2CM.CTRLA.bit.SWRST) {} + + psercom->I2CM.BAUD.bit.BAUD = (uint8_t) (system_clks.freq_gclk[0]/2/freq-1); + system_clks.freq_i2c0 = system_clks.freq_gclk[0]/2/(psercom->I2CM.BAUD.bit.BAUD+1); + system_clks.freq_sercom[sercomn] = system_clks.freq_i2c0; + + DBGC(DC_CLK_SET_I2C0_FREQ_COMPLETE); + + return system_clks.freq_i2c0; +} + +//call CLK_oscctrl_init first +//call CLK_set_i2c1_freq(CHAN_SERCOM_I2C1, FREQ_I2C1_DEFAULT); +uint32_t CLK_set_i2c1_freq(uint8_t sercomn, uint32_t freq) +{ + DBGC(DC_CLK_SET_I2C1_FREQ_BEGIN); + + Gclk *pgclk = GCLK; + Sercom *psercom = (Sercom *)sercom_apbbase[sercomn]; + clk_enable_sercom_apbmask(sercomn); + + //all gclk0 for now + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.GEN = 0; + pgclk->PCHCTRL[sercom_pchan[sercomn]].bit.CHEN = 1; + + psercom->I2CM.CTRLA.bit.SWRST = 1; + while (psercom->I2CM.SYNCBUSY.bit.SWRST) {} + while (psercom->I2CM.CTRLA.bit.SWRST) {} + + psercom->I2CM.BAUD.bit.BAUD = (uint8_t) (system_clks.freq_gclk[0]/2/freq-10); + system_clks.freq_i2c1 = system_clks.freq_gclk[0]/2/(psercom->I2CM.BAUD.bit.BAUD+10); + system_clks.freq_sercom[sercomn] = system_clks.freq_i2c1; + + DBGC(DC_CLK_SET_I2C1_FREQ_COMPLETE); + + return system_clks.freq_i2c1; +} + +void CLK_init(void) +{ + DBGC(DC_CLK_INIT_BEGIN); + + memset((void *)&system_clks,0,sizeof(system_clks)); + + CLK_oscctrl_init(); + CLK_enable_timebase(); + + DBGC(DC_CLK_INIT_COMPLETE); +} + diff --git a/tmk_core/protocol/arm_atsam/clks.h b/tmk_core/protocol/arm_atsam/clks.h new file mode 100644 index 0000000000..96819bfdd0 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/clks.h @@ -0,0 +1,90 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _CLKS_H_ +#define _CLKS_H_ + +#ifndef MD_BOOTLOADER + +//From keyboard +#include "config_led.h" +#include "config.h" + +#endif //MD_BOOTLOADER + +#define PLL_RATIO 47 //mcu frequency ((X+1)MHz) +#define FREQ_DFLL_DEFAULT 48000000 //DFLL frequency / usb clock +#define FREQ_SPI_DEFAULT 1000000 //spi to 595 shift regs +#define FREQ_I2C0_DEFAULT 100000 //i2c to hub +#define FREQ_I2C1_DEFAULT I2C_HZ //i2c to LED drivers +#define FREQ_TC45_DEFAULT 1000000 //1 usec resolution + +//I2C1 Set ~Result PWM Time (2x Drivers) +// 1000000 1090000 +// 900000 1000000 3.82ms +// 800000 860000 +// 700000 750000 +// 600000 630000 +// 580000 615000 6.08ms +// 500000 522000 + +#define FREQ_XOSC0 16000000 + +#define CHAN_SERCOM_SPI 2 //shift regs +#define CHAN_SERCOM_I2C0 0 //hub +#define CHAN_SERCOM_I2C1 1 //led drivers +#define CHAN_SERCOM_UART 3 //debug util + +//Generator clock channels +#define GEN_DPLL0 0 +#define GEN_OSC0 1 +#define GEN_TC45 2 + +#define SERCOM_COUNT 5 +#define GCLK_COUNT 12 + +typedef struct clk_s { + uint32_t freq_dfll; + uint32_t freq_dpll[2]; + uint32_t freq_sercom[SERCOM_COUNT]; + uint32_t freq_gclk[GCLK_COUNT]; + uint32_t freq_xosc0; + uint32_t freq_spi; + uint32_t freq_i2c0; + uint32_t freq_i2c1; + uint32_t freq_uart; + uint32_t freq_adc0; +} clk_t; + +extern volatile clk_t system_clks; +extern volatile uint64_t ms_clk; + +void CLK_oscctrl_init(void); +void CLK_reset_time(void); +uint32_t CLK_set_gclk_freq(uint8_t gclkn, uint32_t freq); +uint32_t CLK_enable_timebase(void); +uint32_t CLK_get_ms(void); +uint64_t CLK_get_us(void); +void CLK_delay_us(uint16_t usec); +void CLK_delay_ms(uint64_t msec); + +uint32_t CLK_set_spi_freq(uint8_t sercomn, uint32_t freq); +uint32_t CLK_set_i2c0_freq(uint8_t sercomn, uint32_t freq); +uint32_t CLK_set_i2c1_freq(uint8_t sercomn, uint32_t freq); +void CLK_init(void); + +#endif // _CLKS_H_ diff --git a/tmk_core/protocol/arm_atsam/d51_util.c b/tmk_core/protocol/arm_atsam/d51_util.c new file mode 100644 index 0000000000..91b58757cf --- /dev/null +++ b/tmk_core/protocol/arm_atsam/d51_util.c @@ -0,0 +1,165 @@ +#include "d51_util.h" + +//Display unsigned 32-bit number through m15 +//Read as follows: 1230 = || ||| |||| | (note always ending toggle) +void m15_print(uint32_t x) +{ + int8_t t; + uint32_t n; + uint32_t p, p2; + + if (x < 10) t = 0; + else if (x < 100) t = 1; + else if (x < 1000) t = 2; + else if (x < 10000) t = 3; + else if (x < 100000) t = 4; + else if (x < 1000000) t = 5; + else if (x < 10000000) t = 6; + else if (x < 100000000) t = 7; + else if (x < 1000000000) t = 8; + else t = 9; + + while (t >= 0) + { + p2 = t; + p = 1; + while (p2--) p *= 10; + n = x / p; + x -= n * p; + while (n > 0) + { + m15_on; + n--; + m15_off; + } + //Will always end with an extra toggle + m15_on; + t--; + m15_off; + } +} + +//Display unsigned 32-bit number through debug led +//Read as follows: 1230 = [*] [* *] [* * *] [**] (note zero is fast double flash) +#define DLED_ONTIME 600000 +#define DLED_PAUSE 1000000 +volatile uint32_t w; +void dled_print(uint32_t x, uint8_t long_pause) +{ + int8_t t; + uint32_t n; + uint32_t p, p2; + + if (x < 10) t = 0; + else if (x < 100) t = 1; + else if (x < 1000) t = 2; + else if (x < 10000) t = 3; + else if (x < 100000) t = 4; + else if (x < 1000000) t = 5; + else if (x < 10000000) t = 6; + else if (x < 100000000) t = 7; + else if (x < 1000000000) t = 8; + else t = 9; + + while (t >= 0) + { + p2 = t; + p = 1; + while (p2--) p *= 10; + n = x / p; + x -= n * p; + if (!n) + { + led_on; + for (w = DLED_ONTIME / 4; w; w--); + led_off; + for (w = DLED_ONTIME / 4; w; w--); + led_on; + for (w = DLED_ONTIME / 4; w; w--); + led_off; + for (w = DLED_ONTIME / 4; w; w--); + n--; + } + else + { + while (n > 0) + { + led_on; + for (w = DLED_ONTIME; w; w--); + led_off; + for (w = DLED_ONTIME / 2; w; w--); + n--; + } + } + + for (w = DLED_PAUSE; w; w--); + t--; + } + + if (long_pause) + { + for (w = DLED_PAUSE * 4; w; w--); + } +} + +#ifdef DEBUG_BOOT_TRACING + +volatile uint32_t debug_code; + +void EIC_15_Handler() +{ + //This is only for non-functional keyboard troubleshooting and should be disabled after boot + //Intention is to lock up the keyboard here with repeating debug led code + while (1) + { + dled_print(debug_code, 1); + } +} + +void debug_code_init(void) +{ + DBGC(DC_UNSET); + + //Configure Ports for EIC on PB31 + PORT->Group[1].DIRCLR.reg = 1 << 31; //Input + PORT->Group[1].OUTSET.reg = 1 << 31; //High + PORT->Group[1].PINCFG[31].bit.INEN = 1; //Input Enable + PORT->Group[1].PINCFG[31].bit.PULLEN = 1; //Pull Enable + PORT->Group[1].PINCFG[31].bit.PMUXEN = 1; //Mux Enable + PORT->Group[1].PMUX[15].bit.PMUXO = 0; //Mux A + + //Enable CLK_EIC_APB + MCLK->APBAMASK.bit.EIC_ = 1; + + //Configure EIC + EIC->CTRLA.bit.SWRST = 1; + while (EIC->SYNCBUSY.bit.SWRST) {} + EIC->ASYNCH.reg = 1 << 15; + EIC->INTENSET.reg = 1 << 15; + EIC->CONFIG[1].bit.SENSE7 = 2; + EIC->CTRLA.bit.ENABLE = 1; + while (EIC->SYNCBUSY.bit.ENABLE) {} + + //Enable EIC IRQ + NVIC_EnableIRQ(EIC_15_IRQn); +} + +void debug_code_disable(void) +{ + //Disable EIC IRQ + NVIC_DisableIRQ(EIC_15_IRQn); + + //Disable EIC + EIC->CTRLA.bit.ENABLE = 0; + while (EIC->SYNCBUSY.bit.ENABLE) {} + + //Disable CLK_EIC_APB + MCLK->APBAMASK.bit.EIC_ = 0; +} + +#else + +void debug_code_init(void) {} +void debug_code_disable(void) {} + +#endif //DEBUG_BOOT_TRACING diff --git a/tmk_core/protocol/arm_atsam/d51_util.h b/tmk_core/protocol/arm_atsam/d51_util.h new file mode 100644 index 0000000000..465889c7cb --- /dev/null +++ b/tmk_core/protocol/arm_atsam/d51_util.h @@ -0,0 +1,185 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _D51_UTIL_H_ +#define _D51_UTIL_H_ + +#include "samd51j18a.h" + +//TODO: PS: Should bring these ports out to keyboard level configuration + +//Debug LED PA27 +#define led_ena REG_PORT_DIRSET0 = 0x08000000 //PA27 Output +#define led_on REG_PORT_OUTSET0 = 0x08000000 //PA27 High +#define led_off REG_PORT_OUTCLR0 = 0x08000000 //PA27 Low + +//Debug Port PB30 +#define m15_ena REG_PORT_DIRSET1 = 0x40000000 //PB30 Output +#define m15_on REG_PORT_OUTSET1 = 0x40000000 //PB30 High +#define m15_off REG_PORT_OUTCLR1 = 0x40000000 //PB30 Low + +#define m15_loop(M15X) {uint8_t M15L=M15X; while(M15L--){m15_on;CLK_delay_us(1);m15_off;}} + +void m15_print(uint32_t x); +void dled_print(uint32_t x, uint8_t long_pause); + +void debug_code_init(void); +void debug_code_disable(void); + +#ifdef DEBUG_BOOT_TRACING + +#define DBGC(n) debug_code = n + +extern volatile uint32_t debug_code; + +enum debug_code_list { + DC_UNSET = 0, + DC_CLK_INIT_BEGIN, + DC_CLK_INIT_COMPLETE, + DC_CLK_SET_I2C1_FREQ_BEGIN, + DC_CLK_SET_I2C1_FREQ_COMPLETE, + DC_CLK_SET_I2C0_FREQ_BEGIN, + DC_CLK_SET_I2C0_FREQ_COMPLETE, + DC_CLK_SET_SPI_FREQ_BEGIN, + DC_CLK_SET_SPI_FREQ_COMPLETE, + DC_CLK_ENABLE_TIMEBASE_BEGIN, + DC_CLK_ENABLE_TIMEBASE_SYNC_ENABLE, + DC_CLK_ENABLE_TIMEBASE_SYNC_SWRST_1, + DC_CLK_ENABLE_TIMEBASE_SYNC_SWRST_2, + DC_CLK_ENABLE_TIMEBASE_TC4_BEGIN, + DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_DISABLE, + DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_SWRST_1, + DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_SWRST_2, + DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_CLTRB, + DC_CLK_ENABLE_TIMEBASE_TC4_SYNC_CC0, + DC_CLK_ENABLE_TIMEBASE_TC4_COMPLETE, + DC_CLK_ENABLE_TIMEBASE_TC5_BEGIN, + DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_DISABLE, + DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_1, + DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_SWRST_2, + DC_CLK_ENABLE_TIMEBASE_TC5_SYNC_CLTRB, + DC_CLK_ENABLE_TIMEBASE_TC5_COMPLETE, + DC_CLK_ENABLE_TIMEBASE_TC0_BEGIN, + DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_DISABLE, + DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_SWRST_1, + DC_CLK_ENABLE_TIMEBASE_TC0_SYNC_SWRST_2, + DC_CLK_ENABLE_TIMEBASE_TC0_COMPLETE, + DC_CLK_ENABLE_TIMEBASE_EVSYS_BEGIN, + DC_CLK_ENABLE_TIMEBASE_EVSYS_COMPLETE, + DC_CLK_ENABLE_TIMEBASE_COMPLETE, + DC_CLK_SET_GCLK_FREQ_BEGIN, + DC_CLK_SET_GCLK_FREQ_SYNC_1, + DC_CLK_SET_GCLK_FREQ_SYNC_2, + DC_CLK_SET_GCLK_FREQ_SYNC_3, + DC_CLK_SET_GCLK_FREQ_SYNC_4, + DC_CLK_SET_GCLK_FREQ_SYNC_5, + DC_CLK_SET_GCLK_FREQ_COMPLETE, + DC_CLK_INIT_OSC_BEGIN, + DC_CLK_INIT_OSC_SYNC_1, + DC_CLK_INIT_OSC_SYNC_2, + DC_CLK_INIT_OSC_SYNC_3, + DC_CLK_INIT_OSC_SYNC_4, + DC_CLK_INIT_OSC_SYNC_5, + DC_CLK_INIT_OSC_COMPLETE, + DC_CLK_RESET_TIME_BEGIN, + DC_CLK_RESET_TIME_COMPLETE, + DC_CLK_OSC_INIT_BEGIN, + DC_CLK_OSC_INIT_XOSC0_SYNC, + DC_CLK_OSC_INIT_DPLL_SYNC_DISABLE, + DC_CLK_OSC_INIT_DPLL_SYNC_RATIO, + DC_CLK_OSC_INIT_DPLL_SYNC_ENABLE, + DC_CLK_OSC_INIT_DPLL_WAIT_LOCK, + DC_CLK_OSC_INIT_DPLL_WAIT_CLKRDY, + DC_CLK_OSC_INIT_GCLK_SYNC_GENCTRL0, + DC_CLK_OSC_INIT_COMPLETE, + DC_SPI_INIT_BEGIN, + DC_SPI_WRITE_DRE, + DC_SPI_WRITE_TXC_1, + DC_SPI_WRITE_TXC_2, + DC_SPI_SYNC_ENABLING, + DC_SPI_INIT_COMPLETE, + DC_PORT_DETECT_INIT_BEGIN, + DC_PORT_DETECT_INIT_FAILED, + DC_PORT_DETECT_INIT_COMPLETE, + DC_USB_RESET_BEGIN, + DC_USB_RESET_COMPLETE, + DC_USB_SET_HOST_BY_VOLTAGE_BEGIN, + DC_USB_SET_HOST_5V_LOW_WAITING, + DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE, + DC_USB_CONFIGURE_BEGIN, + DC_USB_CONFIGURE_GET_SERIAL, + DC_USB_CONFIGURE_COMPLETE, + DC_USB_WRITE2422_BLOCK_BEGIN, + DC_USB_WRITE2422_BLOCK_SYNC_SYSOP, + DC_USB_WRITE2422_BLOCK_COMPLETE, + DC_ADC0_CLOCK_INIT_BEGIN, + DC_ADC0_CLOCK_INIT_COMPLETE, + DC_ADC0_INIT_BEGIN, + DC_ADC0_SWRST_SYNCING_1, + DC_ADC0_SWRST_SYNCING_2, + DC_ADC0_AVGCTRL_SYNCING_1, + DC_ADC0_AVGCTRL_SYNCING_2, + DC_ADC0_SAMPCTRL_SYNCING_1, + DC_ADC0_ENABLE_SYNCING_1, + DC_ADC0_INIT_COMPLETE, + DC_I2C0_INIT_BEGIN, + DC_I2C0_INIT_SYNC_ENABLING, + DC_I2C0_INIT_SYNC_SYSOP, + DC_I2C0_INIT_WAIT_IDLE, + DC_I2C0_INIT_COMPLETE, + DC_I2C1_INIT_BEGIN, + DC_I2C1_INIT_SYNC_ENABLING, + DC_I2C1_INIT_SYNC_SYSOP, + DC_I2C1_INIT_WAIT_IDLE, + DC_I2C1_INIT_COMPLETE, + DC_I2C3733_INIT_CONTROL_BEGIN, + DC_I2C3733_INIT_CONTROL_COMPLETE, + DC_I2C3733_INIT_DRIVERS_BEGIN, + DC_I2C3733_INIT_DRIVERS_COMPLETE, + DC_I2C_DMAC_LED_INIT_BEGIN, + DC_I2C_DMAC_LED_INIT_COMPLETE, + DC_I2C3733_CONTROL_SET_BEGIN, + DC_I2C3733_CONTROL_SET_COMPLETE, + DC_LED_MATRIX_INIT_BEGIN, + DC_LED_MATRIX_INIT_COMPLETE, + DC_USB2422_INIT_BEGIN, + DC_USB2422_INIT_WAIT_5V_LOW, + DC_USB2422_INIT_OSC_SYNC_DISABLING, + DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_1, + DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_2, + DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_3, + DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_4, + DC_USB2422_INIT_OSC_SYNC_DFLLMUL, + DC_USB2422_INIT_OSC_SYNC_ENABLING, + DC_USB2422_INIT_USB_SYNC_SWRST, + DC_USB2422_INIT_USB_WAIT_SWRST, + DC_USB2422_INIT_USB_SYNC_ENABLING, + DC_USB2422_INIT_COMPLETE, + DC_MAIN_UDC_START_BEGIN, + DC_MAIN_UDC_START_COMPLETE, + DC_MAIN_CDC_INIT_BEGIN, + DC_MAIN_CDC_INIT_COMPLETE, + /* Never change the order of error codes! Only add codes to end! */ +}; + +#else + +#define DBGC(n) {} + +#endif //DEBUG_BOOT_TRACING + +#endif //_D51_UTIL_H_ diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c new file mode 100644 index 0000000000..bbe909e9bb --- /dev/null +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -0,0 +1,585 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" + +#ifndef MD_BOOTLOADER + +#include + +//From keyboard +#include "config.h" +#include "config_led.h" +#include "matrix.h" + +#define I2C_LED_USE_DMA 1 //Set 1 to use background DMA transfers for leds, Set 0 to use inline software transfers + +static uint8_t i2c_led_q[I2C_Q_SIZE]; //I2C queue circular buffer +static uint8_t i2c_led_q_s; //Start of circular buffer +static uint8_t i2c_led_q_e; //End of circular buffer +static uint8_t i2c_led_q_full; //Queue full counter for reset + +static uint8_t dma_sendbuf[I2C_DMA_MAX_SEND]; //Data being written to I2C + +volatile uint8_t i2c_led_q_running; + +#endif //MD_BOOTLOADER + +void i2c0_init(void) +{ + DBGC(DC_I2C0_INIT_BEGIN); + + CLK_set_i2c0_freq(CHAN_SERCOM_I2C0, FREQ_I2C0_DEFAULT); + + //MCU + PORT->Group[0].PMUX[4].bit.PMUXE = 2; + PORT->Group[0].PMUX[4].bit.PMUXO = 2; + PORT->Group[0].PINCFG[8].bit.PMUXEN = 1; + PORT->Group[0].PINCFG[9].bit.PMUXEN = 1; + + //I2C + //Note: SW Reset handled in CLK_set_i2c0_freq clks.c + + SERCOM0->I2CM.CTRLA.bit.MODE = 5; //Set master mode + + SERCOM0->I2CM.CTRLA.bit.SPEED = 0; //Set to 1 for Fast-mode Plus (FM+) up to 1 MHz + SERCOM0->I2CM.CTRLA.bit.RUNSTDBY = 1; //Enabled + + SERCOM0->I2CM.CTRLA.bit.ENABLE = 1; //Enable the device + while (SERCOM0->I2CM.SYNCBUSY.bit.ENABLE) { DBGC(DC_I2C0_INIT_SYNC_ENABLING); } //Wait for SYNCBUSY.ENABLE to clear + + SERCOM0->I2CM.STATUS.bit.BUSSTATE = 1; //Force into IDLE state + while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_I2C0_INIT_SYNC_SYSOP); } + while (SERCOM0->I2CM.STATUS.bit.BUSSTATE != 1) { DBGC(DC_I2C0_INIT_WAIT_IDLE); } //Wait while not idle + + DBGC(DC_I2C0_INIT_COMPLETE); +} + +uint8_t i2c0_start(uint8_t address) +{ + SERCOM0->I2CM.ADDR.bit.ADDR = address; + while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP) {} + while (SERCOM0->I2CM.INTFLAG.bit.MB == 0) {} + while (SERCOM0->I2CM.STATUS.bit.RXNACK) {} + + return 1; +} + +uint8_t i2c0_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout) +{ + if (!length) return 0; + + i2c0_start(address); + + while (length) + { + SERCOM0->I2CM.DATA.bit.DATA = *data; + while (SERCOM0->I2CM.INTFLAG.bit.MB == 0) {} + while (SERCOM0->I2CM.STATUS.bit.RXNACK) {} + + data++; + length--; + } + + i2c0_stop(); + + return 1; +} + +void i2c0_stop(void) +{ + if (SERCOM0->I2CM.STATUS.bit.CLKHOLD || SERCOM0->I2CM.INTFLAG.bit.MB == 1 || SERCOM0->I2CM.STATUS.bit.BUSSTATE != 1) + { + SERCOM0->I2CM.CTRLB.bit.CMD = 3; + while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP); + while (SERCOM0->I2CM.STATUS.bit.CLKHOLD); + while (SERCOM0->I2CM.INTFLAG.bit.MB); + while (SERCOM0->I2CM.STATUS.bit.BUSSTATE != 1); + } +} + +#ifndef MD_BOOTLOADER +void i2c1_init(void) +{ + DBGC(DC_I2C1_INIT_BEGIN); + + CLK_set_i2c1_freq(CHAN_SERCOM_I2C1, FREQ_I2C1_DEFAULT); + + /* MCU */ + PORT->Group[0].PMUX[8].bit.PMUXE = 2; + PORT->Group[0].PMUX[8].bit.PMUXO = 2; + PORT->Group[0].PINCFG[16].bit.PMUXEN = 1; + PORT->Group[0].PINCFG[17].bit.PMUXEN = 1; + + /* I2C */ + //Note: SW Reset handled in CLK_set_i2c1_freq clks.c + + SERCOM1->I2CM.CTRLA.bit.MODE = 5; //MODE: Set master mode (No sync) + SERCOM1->I2CM.CTRLA.bit.SPEED = 1; //SPEED: Fm+ up to 1MHz (No sync) + SERCOM1->I2CM.CTRLA.bit.RUNSTDBY = 1; //RUNSTBY: Enabled (No sync) + + SERCOM1->I2CM.CTRLB.bit.SMEN = 1; //SMEN: Smart mode enabled (For DMA)(No sync) + + NVIC_EnableIRQ(SERCOM1_0_IRQn); + SERCOM1->I2CM.INTENSET.bit.ERROR = 1; + + SERCOM1->I2CM.CTRLA.bit.ENABLE = 1; //ENABLE: Enable the device (sync SYNCBUSY.ENABLE) + while (SERCOM1->I2CM.SYNCBUSY.bit.ENABLE) { DBGC(DC_I2C1_INIT_SYNC_ENABLING); } //Wait for SYNCBUSY.ENABLE to clear + + SERCOM1->I2CM.STATUS.bit.BUSSTATE = 1; //BUSSTATE: Force into IDLE state (sync SYNCBUSY.SYSOP) + while (SERCOM1->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_I2C1_INIT_SYNC_SYSOP); } + while (SERCOM1->I2CM.STATUS.bit.BUSSTATE != 1) { DBGC(DC_I2C1_INIT_WAIT_IDLE); } //Wait while not idle + + DBGC(DC_I2C1_INIT_COMPLETE); +} + +uint8_t i2c1_start(uint8_t address) +{ + SERCOM1->I2CM.ADDR.bit.ADDR = address; + while (SERCOM1->I2CM.SYNCBUSY.bit.SYSOP) {} + while (SERCOM1->I2CM.INTFLAG.bit.MB == 0) {} + while (SERCOM1->I2CM.STATUS.bit.RXNACK) {} + + return 1; +} + +uint8_t i2c1_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout) +{ + if (!length) return 0; + + i2c1_start(address); + + while (length) + { + SERCOM1->I2CM.DATA.bit.DATA = *data; + while (SERCOM1->I2CM.INTFLAG.bit.MB == 0) {} + while (SERCOM1->I2CM.STATUS.bit.RXNACK) {} + + data++; + length--; + } + + i2c1_stop(); + + return 1; +} + +void i2c1_stop(void) +{ + if (SERCOM1->I2CM.STATUS.bit.CLKHOLD || SERCOM1->I2CM.INTFLAG.bit.MB == 1 || SERCOM1->I2CM.STATUS.bit.BUSSTATE != 1) + { + SERCOM1->I2CM.CTRLB.bit.CMD = 3; + while (SERCOM1->I2CM.SYNCBUSY.bit.SYSOP); + while (SERCOM1->I2CM.STATUS.bit.CLKHOLD); + while (SERCOM1->I2CM.INTFLAG.bit.MB); + while (SERCOM1->I2CM.STATUS.bit.BUSSTATE != 1); + } +} + +void i2c_led_send_CRWL(uint8_t drvid) +{ + uint8_t i2cdata[] = { ISSI3733_CMDRWL, ISSI3733_CMDRWL_WRITE_ENABLE_ONCE }; + i2c1_transmit(issidrv[drvid].addr, i2cdata, sizeof(i2cdata), 0); +} + +void i2c_led_select_page(uint8_t drvid, uint8_t pageno) +{ + uint8_t i2cdata[] = { ISSI3733_CMDR, pageno }; + i2c1_transmit(issidrv[drvid].addr, i2cdata, sizeof(i2cdata), 0); +} + +void i2c_led_send_GCR(uint8_t drvid) +{ + uint8_t i2cdata[] = { ISSI3733_GCCR, 0x00 }; + + if (gcr_actual > LED_GCR_MAX) gcr_actual = LED_GCR_MAX; + i2cdata[1] = gcr_actual; + + i2c1_transmit(issidrv[drvid].addr, i2cdata, sizeof(i2cdata), 0); +} + +void i2c_led_send_onoff(uint8_t drvid) +{ +#if I2C_LED_USE_DMA != 1 + if (!i2c_led_q_running) + { +#endif + i2c_led_send_CRWL(drvid); + i2c_led_select_page(drvid, 0); +#if I2C_LED_USE_DMA != 1 + } +#endif + + *issidrv[drvid].onoff = 0; //Force start location offset to zero + i2c1_transmit(issidrv[drvid].addr, issidrv[drvid].onoff, ISSI3733_PG0_BYTES, 0); +} + +void i2c_led_send_mode_op_gcr(uint8_t drvid, uint8_t mode, uint8_t operation) +{ + uint8_t i2cdata[] = { ISSI3733_CR, mode | operation, gcr_actual}; + i2c1_transmit(issidrv[drvid].addr, i2cdata, sizeof(i2cdata), 0); +} + +void i2c_led_send_pur_pdr(uint8_t drvid, uint8_t pur, uint8_t pdr) +{ + uint8_t i2cdata[] = { ISSI3733_SWYR_PUR, pur, pdr }; + + i2c1_transmit(issidrv[drvid].addr, i2cdata, sizeof(i2cdata), 0); +} + +void i2c_led_send_pwm(uint8_t drvid) +{ +#if I2C_LED_USE_DMA != 1 + if (!i2c_led_q_running) + { +#endif + i2c_led_send_CRWL(drvid); + i2c_led_select_page(drvid, 0); +#if I2C_LED_USE_DMA != 1 + } +#endif + + *issidrv[drvid].pwm = 0; //Force start location offset to zero + i2c1_transmit(issidrv[drvid].addr, issidrv[drvid].pwm, ISSI3733_PG1_BYTES, 0); +} + +uint8_t I2C3733_Init_Control(void) +{ + DBGC(DC_I2C3733_INIT_CONTROL_BEGIN); + + srdata.bit.SDB_N = 1; + SPI_WriteSRData(); + + CLK_delay_ms(1); + + srdata.bit.IRST = 0; + SPI_WriteSRData(); + + CLK_delay_ms(1); + + DBGC(DC_I2C3733_INIT_CONTROL_COMPLETE); + + return 1; +} + +uint8_t I2C3733_Init_Drivers(void) +{ + DBGC(DC_I2C3733_INIT_DRIVERS_BEGIN); + + gcr_actual = ISSI3733_GCR_DEFAULT; + gcr_actual_last = gcr_actual; + + if (gcr_actual > LED_GCR_MAX) gcr_actual = LED_GCR_MAX; + gcr_desired = gcr_actual; + + //Set up master device + i2c_led_send_CRWL(0); + i2c_led_select_page(0, 3); + i2c_led_send_mode_op_gcr(0, ISSI3733_CR_SYNC_MASTER, ISSI3733_CR_SSD_NORMAL); + + //Set up slave device + i2c_led_send_CRWL(1); + i2c_led_select_page(1, 3); + i2c_led_send_mode_op_gcr(1, ISSI3733_CR_SYNC_SLAVE, ISSI3733_CR_SSD_NORMAL); + + i2c_led_send_CRWL(0); + i2c_led_select_page(0, 3); + i2c_led_send_pur_pdr(0, ISSI3733_SWYR_PUR_8000, ISSI3733_CSXR_PDR_8000); + + i2c_led_send_CRWL(1); + i2c_led_select_page(1, 3); + i2c_led_send_pur_pdr(1, ISSI3733_SWYR_PUR_8000, ISSI3733_CSXR_PDR_8000); + + DBGC(DC_I2C3733_INIT_DRIVERS_COMPLETE); + + return 1; +} + +void I2C_DMAC_LED_Init(void) +{ + Dmac *dmac = DMAC; + + DBGC(DC_I2C_DMAC_LED_INIT_BEGIN); + + //Disable device + dmac->CTRL.bit.DMAENABLE = 0; //Disable DMAC + while (dmac->CTRL.bit.DMAENABLE) {} //Wait for disabled state in case of ongoing transfers + dmac->CTRL.bit.SWRST = 1; //Software Reset DMAC + while (dmac->CTRL.bit.SWRST) {} //Wait for software reset to complete + + //Configure device + dmac->BASEADDR.reg = (uint32_t)&dmac_desc; //Set descriptor base address + dmac->WRBADDR.reg = (uint32_t)&dmac_desc_wb; //Set descriptor write back address + dmac->CTRL.reg |= 0x0f00; //Handle all priorities (LVL0-3) + + //Disable channel + dmac->Channel[0].CHCTRLA.bit.ENABLE = 0; //Disable the channel + while (dmac->Channel[0].CHCTRLA.bit.ENABLE) {} //Wait for disabled state in case of ongoing transfers + dmac->Channel[0].CHCTRLA.bit.SWRST = 1; //Software Reset the channel + while (dmac->Channel[0].CHCTRLA.bit.SWRST) {} //Wait for software reset to complete + + //Configure channel + dmac->Channel[0].CHCTRLA.bit.THRESHOLD = 0; //1BEAT + dmac->Channel[0].CHCTRLA.bit.BURSTLEN = 0; //SINGLE + dmac->Channel[0].CHCTRLA.bit.TRIGACT = 2; //BURST + dmac->Channel[0].CHCTRLA.bit.TRIGSRC = SERCOM1_DMAC_ID_TX; //Trigger source + dmac->Channel[0].CHCTRLA.bit.RUNSTDBY = 1; //Run in standby + + NVIC_EnableIRQ(DMAC_0_IRQn); + dmac->Channel[0].CHINTENSET.bit.TCMPL = 1; + dmac->Channel[0].CHINTENSET.bit.TERR = 1; + + //Enable device + dmac->CTRL.bit.DMAENABLE = 1; //Enable DMAC + while (dmac->CTRL.bit.DMAENABLE == 0) {} //Wait for enable state + + DBGC(DC_I2C_DMAC_LED_INIT_COMPLETE); +} + +//state = 1 enable +//state = 0 disable +void I2C3733_Control_Set(uint8_t state) +{ + DBGC(DC_I2C3733_CONTROL_SET_BEGIN); + + srdata.bit.SDB_N = (state == 1 ? 1 : 0); + SPI_WriteSRData(); + + DBGC(DC_I2C3733_CONTROL_SET_COMPLETE); +} + +void i2c_led_desc_defaults(void) +{ + dmac_desc.BTCTRL.bit.STEPSIZE = 0; //SRCINC used in favor for auto 1 inc + dmac_desc.BTCTRL.bit.STEPSEL = 0; //SRCINC used in favor for auto 1 inc + dmac_desc.BTCTRL.bit.DSTINC = 0; //The Destination Address Increment is disabled + dmac_desc.BTCTRL.bit.SRCINC = 1; //The Source Address Increment is enabled (Inc by 1) + dmac_desc.BTCTRL.bit.BEATSIZE = 0; //8-bit bus transfer + dmac_desc.BTCTRL.bit.BLOCKACT = 0; //Channel will be disabled if it is the last block transfer in the transaction + dmac_desc.BTCTRL.bit.EVOSEL = 0; //Event generation disabled + dmac_desc.BTCTRL.bit.VALID = 1; //Set dmac valid +} + +void i2c_led_prepare_send_dma(uint8_t *data, uint8_t len) +{ + i2c_led_desc_defaults(); + + dmac_desc.BTCNT.reg = len; + dmac_desc.SRCADDR.reg = (uint32_t)data + len; + dmac_desc.DSTADDR.reg = (uint32_t)&SERCOM1->I2CM.DATA.reg; + dmac_desc.DESCADDR.reg = 0; +} + +void i2c_led_begin_dma(uint8_t drvid) +{ + DMAC->Channel[0].CHCTRLA.bit.ENABLE = 1; //Enable the channel + + SERCOM1->I2CM.ADDR.reg = (dmac_desc.BTCNT.reg << 16) | 0x2000 | issidrv[drvid].addr; //Begin transfer +} + +void i2c_led_send_CRWL_dma(uint8_t drvid) +{ + *(dma_sendbuf+0) = ISSI3733_CMDRWL; + *(dma_sendbuf+1) = ISSI3733_CMDRWL_WRITE_ENABLE_ONCE; + i2c_led_prepare_send_dma(dma_sendbuf, 2); + + i2c_led_begin_dma(drvid); +} + +void i2c_led_select_page_dma(uint8_t drvid, uint8_t pageno) +{ + *(dma_sendbuf+0) = ISSI3733_CMDR; + *(dma_sendbuf+1) = pageno; + i2c_led_prepare_send_dma(dma_sendbuf, 2); + + i2c_led_begin_dma(drvid); +} + +void i2c_led_send_GCR_dma(uint8_t drvid) +{ + *(dma_sendbuf+0) = ISSI3733_GCCR; + *(dma_sendbuf+1) = gcr_actual; + i2c_led_prepare_send_dma(dma_sendbuf, 2); + + i2c_led_begin_dma(drvid); +} + +void i2c_led_send_pwm_dma(uint8_t drvid) +{ + //Note: This copies the CURRENT pwm buffer, which may be getting modified + memcpy(dma_sendbuf, issidrv[drvid].pwm, ISSI3733_PG1_BYTES); + *dma_sendbuf = 0; //Force start location offset to zero + i2c_led_prepare_send_dma(dma_sendbuf, ISSI3733_PG1_BYTES); + + i2c_led_begin_dma(drvid); +} + +void i2c_led_send_onoff_dma(uint8_t drvid) +{ + //Note: This copies the CURRENT onoff buffer, which may be getting modified + memcpy(dma_sendbuf, issidrv[drvid].onoff, ISSI3733_PG0_BYTES); + *dma_sendbuf = 0; //Force start location offset to zero + i2c_led_prepare_send_dma(dma_sendbuf, ISSI3733_PG0_BYTES); + + i2c_led_begin_dma(drvid); +} + +void i2c_led_q_init(void) +{ + memset(i2c_led_q, 0, I2C_Q_SIZE); + i2c_led_q_s = 0; + i2c_led_q_e = 0; + i2c_led_q_running = 0; + i2c_led_q_full = 0; +} + +uint8_t i2c_led_q_isempty(void) +{ + return i2c_led_q_s == i2c_led_q_e; +} + +uint8_t i2c_led_q_size(void) +{ + return (i2c_led_q_e - i2c_led_q_s) % I2C_Q_SIZE; +} + +uint8_t i2c_led_q_available(void) +{ + return I2C_Q_SIZE - i2c_led_q_size() - 1; //Never allow end to meet start +} + +void i2c_led_q_add(uint8_t cmd) +{ + //WARNING: Always request room before adding commands! + + //Assign command + i2c_led_q[i2c_led_q_e] = cmd; + + i2c_led_q_e = (i2c_led_q_e + 1) % I2C_Q_SIZE; //Move end up one or wrap +} + +void i2c_led_q_s_advance(void) +{ + i2c_led_q_s = (i2c_led_q_s + 1) % I2C_Q_SIZE; //Move start up one or wrap +} + +//Always request room before adding commands +//PS: In case the queue somehow gets filled, it will reset if it can not clear up +//PS: Could only get this to happen through unrealistic timings to overload the I2C bus +uint8_t i2c_led_q_request_room(uint8_t request_size) +{ + if (request_size > i2c_led_q_available()) + { + i2c_led_q_full++; + + if (i2c_led_q_full >= 100) //Give the queue a chance to clear up + { + led_on; + I2C_DMAC_LED_Init(); + i2c_led_q_init(); + return 1; + } + + return 0; + } + + i2c_led_q_full = 0; + + return 1; +} + +uint8_t i2c_led_q_run(void) +{ + if (i2c_led_q_isempty()) + { + i2c_led_q_running = 0; + return 0; + } + + if (i2c_led_q_running) return 1; + + i2c_led_q_running = 1; + +#if I2C_LED_USE_DMA != 1 + while (!i2c_led_q_isempty()) + { +#endif + //run command + if (i2c_led_q[i2c_led_q_s] == I2C_Q_CRWL) + { + i2c_led_q_s_advance(); + uint8_t drvid = i2c_led_q[i2c_led_q_s]; +#if I2C_LED_USE_DMA == 1 + i2c_led_send_CRWL_dma(drvid); +#else + i2c_led_send_CRWL(drvid); +#endif + } + else if (i2c_led_q[i2c_led_q_s] == I2C_Q_PAGE_SELECT) + { + i2c_led_q_s_advance(); + uint8_t drvid = i2c_led_q[i2c_led_q_s]; + i2c_led_q_s_advance(); + uint8_t page = i2c_led_q[i2c_led_q_s]; +#if I2C_LED_USE_DMA == 1 + i2c_led_select_page_dma(drvid, page); +#else + i2c_led_select_page(drvid, page); +#endif + } + else if (i2c_led_q[i2c_led_q_s] == I2C_Q_PWM) + { + i2c_led_q_s_advance(); + uint8_t drvid = i2c_led_q[i2c_led_q_s]; +#if I2C_LED_USE_DMA == 1 + i2c_led_send_pwm_dma(drvid); +#else + i2c_led_send_pwm(drvid); +#endif + } + else if (i2c_led_q[i2c_led_q_s] == I2C_Q_GCR) + { + i2c_led_q_s_advance(); + uint8_t drvid = i2c_led_q[i2c_led_q_s]; +#if I2C_LED_USE_DMA == 1 + i2c_led_send_GCR_dma(drvid); +#else + i2c_led_send_GCR(drvid); +#endif + } + else if (i2c_led_q[i2c_led_q_s] == I2C_Q_ONOFF) + { + i2c_led_q_s_advance(); + uint8_t drvid = i2c_led_q[i2c_led_q_s]; +#if I2C_LED_USE_DMA == 1 + i2c_led_send_onoff_dma(drvid); +#else + i2c_led_send_onoff(drvid); +#endif + } + + i2c_led_q_s_advance(); //Advance last run command or if the command byte was not serviced + +#if I2C_LED_USE_DMA != 1 + } + + i2c_led_q_running = 0; +#endif + + return 1; +} +#endif //MD_BOOTLOADER diff --git a/tmk_core/protocol/arm_atsam/i2c_master.h b/tmk_core/protocol/arm_atsam/i2c_master.h new file mode 100644 index 0000000000..99481366a5 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/i2c_master.h @@ -0,0 +1,108 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _I2C_MASTER_H_ +#define _I2C_MASTER_H_ + +#ifndef MD_BOOTLOADER + +#include "samd51j18a.h" +#include "issi3733_driver.h" +#include "config.h" + +__attribute__((__aligned__(16))) +DmacDescriptor dmac_desc; +__attribute__((__aligned__(16))) +DmacDescriptor dmac_desc_wb; + +uint8_t I2C3733_Init_Control(void); +uint8_t I2C3733_Init_Drivers(void); +void I2C3733_Control_Set(uint8_t state); +void I2C_DMAC_LED_Init(void); + +#define I2C_Q_SIZE 100 + +#define I2C_Q_NA 100 +#define I2C_Q_CRWL 101 +#define I2C_Q_PAGE_SELECT 102 +#define I2C_Q_PWM 103 +#define I2C_Q_GCR 104 +#define I2C_Q_ONOFF 105 + +#define I2C_DMA_MAX_SEND 255 + +extern volatile uint8_t i2c_led_q_running; + +#define I2C_LED_Q_PWM(a) { \ + if (i2c_led_q_request_room(7)) \ + { \ + i2c_led_q_add(I2C_Q_CRWL); \ + i2c_led_q_add(a); \ + i2c_led_q_add(I2C_Q_PAGE_SELECT); \ + i2c_led_q_add(a); \ + i2c_led_q_add(ISSI3733_PG_PWM); \ + i2c_led_q_add(I2C_Q_PWM); \ + i2c_led_q_add(a); \ + } \ + } + +#define I2C_LED_Q_GCR(a) { \ + if (i2c_led_q_request_room(7)) \ + { \ + i2c_led_q_add(I2C_Q_CRWL); \ + i2c_led_q_add(a); \ + i2c_led_q_add(I2C_Q_PAGE_SELECT); \ + i2c_led_q_add(a); \ + i2c_led_q_add(ISSI3733_PG_FN); \ + i2c_led_q_add(I2C_Q_GCR); \ + i2c_led_q_add(a); \ + } \ + } + +#define I2C_LED_Q_ONOFF(a) { \ + if (i2c_led_q_request_room(7)) \ + { \ + i2c_led_q_add(I2C_Q_CRWL); \ + i2c_led_q_add(a); \ + i2c_led_q_add(I2C_Q_PAGE_SELECT); \ + i2c_led_q_add(a); \ + i2c_led_q_add(ISSI3733_PG_ONOFF); \ + i2c_led_q_add(I2C_Q_ONOFF); \ + i2c_led_q_add(a); \ + } \ + } + + +void i2c_led_q_init(void); +void i2c_led_q_add(uint8_t cmd); +void i2c_led_q_s_advance(void); +uint8_t i2c_led_q_size(void); +uint8_t i2c_led_q_request_room(uint8_t request_size); +uint8_t i2c_led_q_run(void); + +void i2c1_init(void); +uint8_t i2c1_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout); +void i2c1_stop(void); + +#endif //MD_BOOTLOADER + +void i2c0_init(void); +uint8_t i2c0_transmit(uint8_t address, uint8_t *data, uint16_t length, uint16_t timeout); +void i2c0_stop(void); + +#endif // _I2C_MASTER_H_ + diff --git a/tmk_core/protocol/arm_atsam/issi3733_driver.h b/tmk_core/protocol/arm_atsam/issi3733_driver.h new file mode 100644 index 0000000000..a537029f0e --- /dev/null +++ b/tmk_core/protocol/arm_atsam/issi3733_driver.h @@ -0,0 +1,201 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _ISSI3733_DRIVER_H_ +#define _ISSI3733_DRIVER_H_ + +//ISII3733 Registers + +#define ISSI3733_CMDR 0xFD //Command Register (Write Only) + +#define ISSI3733_CMDRWL 0xFE //Command Register Write Lock (Read/Write) +#define ISSI3733_CMDRWL_WRITE_DISABLE 0x00 //Lock register +#define ISSI3733_CMDRWL_WRITE_ENABLE_ONCE 0xC5 //Enable one write to register then reset to locked + +#define ISSI3733_IMR 0xF0 //Interrupt Mask Register (Write Only) +#define ISSI3733_IMR_IAC_ON 0x08 //Auto Clear Interrupt Bit - Interrupt auto clear when INTB stay low exceeds 8ms +#define ISSI3733_IMR_IAB_ON 0x04 //Auto Breath Interrupt Bit - Enable auto breath loop finish interrupt +#define ISSI3733_IMR_IS_ON 0x02 //Dot Short Interrupt Bit - Enable dot short interrupt +#define ISSI3733_IMR_IO_ON 0x01 //Dot Open Interrupt Bit - Enable dot open interrupt + +#define ISSI3733_ISR 0xF1 //Interrupt Status Register (Read Only) +#define ISSI3733_ISR_ABM3_FINISH 0x10 //Auto Breath Mode 3 Finish Bit - ABM3 finished +#define ISSI3733_ISR_ABM2_FINISH 0x08 //Auto Breath Mode 2 Finish Bit - ABM2 finished +#define ISSI3733_ISR_ABM1_FINISH 0x04 //Auto Breath Mode 1 Finish Bit - ABM1 finished +#define ISSI3733_ISR_SB 0x02 //Short Bit - Shorted +#define ISSI3733_ISR_OB 0x01 //Open Bit - Opened + +#define ISSI3733_PG0 0x00 //LED Control Register +#define ISSI3733_PG1 0x01 //PWM Register +#define ISSI3733_PG2 0x02 //Auto Breath Mode Register +#define ISSI3733_PG3 0x03 //Function Register + +#define ISSI3733_PG_ONOFF ISSI3733_PG0 +#define ISSI3733_PG_OR ISSI3733_PG0 +#define ISSI3733_PG_SR ISSI3733_PG0 +#define ISSI3733_PG_PWM ISSI3733_PG1 +#define ISSI3733_PG_ABM ISSI3733_PG2 +#define ISSI3733_PG_FN ISSI3733_PG3 + +#define ISSI3733_CR 0x00 //Configuration Register + +//PG3: Configuration Register: Synchronize Configuration +#define ISSI3733_CR_SYNC_MASTER 0x40 //Master +#define ISSI3733_CR_SYNC_SLAVE 0x80 //Slave +#define ISSI3733_CR_SYNC_HIGH_IMP 0xC0 //High Impedance + +//PG3: Configuration Register: Open/Short Detection Enable Bit +//#define ISSI3733_CR_OSD_DISABLE 0x00 //Disable open/short detection +#define ISSI3733_CR_OSD_ENABLE 0x04 //Enable open/short detection + +//PG3: Configuration Register: Auto Breath Enable +//#define ISSI3733_CR_B_EN_PWM 0x00 //PWM Mode Enable +#define ISSI3733_CR_B_EN_AUTO 0x02 //Auto Breath Mode Enable + +//PG3: Configuration Register: Software Shutdown Control +//#define ISSI3733_CR_SSD_SHUTDOWN 0x00 //Software shutdown +#define ISSI3733_CR_SSD_NORMAL 0x01 //Normal operation + +#define ISSI3733_GCCR 0x01 //Global Current Control Register + +//1 Byte, Iout = (GCC / 256) * (840 / Rext) +//TODO: Give user define for Rext + +//PG3: Auto Breath Control Register 1 +#define ISSI3733_ABCR1_ABM1 0x02 //Auto Breath Control Register 1 of ABM-1 +#define ISSI3733_ABCR1_ABM2 0x06 //Auto Breath Control Register 1 of ABM-2 +#define ISSI3733_ABCR1_ABM3 0x0A //Auto Breath Control Register 1 of ABM-3 + +//Rise time +#define ISSI3733_ABCR1_T1_0021 0x00 //0.21s +#define ISSI3733_ABCR1_T1_0042 0x20 //0.42s +#define ISSI3733_ABCR1_T1_0084 0x40 //0.84s +#define ISSI3733_ABCR1_T1_0168 0x60 //1.68s +#define ISSI3733_ABCR1_T1_0336 0x80 //3.36s +#define ISSI3733_ABCR1_T1_0672 0xA0 //6.72s +#define ISSI3733_ABCR1_T1_1344 0xC0 //13.44s +#define ISSI3733_ABCR1_T1_2688 0xE0 //26.88s + +//Max value time +#define ISSI3733_ABCR1_T2_0000 0x00 //0s +#define ISSI3733_ABCR1_T2_0021 0x02 //0.21s +#define ISSI3733_ABCR1_T2_0042 0x04 //0.42s +#define ISSI3733_ABCR1_T2_0084 0x06 //0.84s +#define ISSI3733_ABCR1_T2_0168 0x08 //1.68s +#define ISSI3733_ABCR1_T2_0336 0x0A //3.36s +#define ISSI3733_ABCR1_T2_0672 0x0C //6.72s +#define ISSI3733_ABCR1_T2_1344 0x0E //13.44s +#define ISSI3733_ABCR1_T2_2688 0x10 //26.88s + +//PG3: Auto Breath Control Register 2 +#define ISSI3733_ABCR2_ABM1 0x03 //Auto Breath Control Register 2 of ABM-1 +#define ISSI3733_ABCR2_ABM2 0x07 //Auto Breath Control Register 2 of ABM-2 +#define ISSI3733_ABCR2_ABM3 0x0B //Auto Breath Control Register 2 of ABM-3 + +//Fall time +#define ISSI3733_ABCR2_T3_0021 0x00 //0.21s +#define ISSI3733_ABCR2_T3_0042 0x20 //0.42s +#define ISSI3733_ABCR2_T3_0084 0x40 //0.84s +#define ISSI3733_ABCR2_T3_0168 0x60 //1.68s +#define ISSI3733_ABCR2_T3_0336 0x80 //3.36s +#define ISSI3733_ABCR2_T3_0672 0xA0 //6.72s +#define ISSI3733_ABCR2_T3_1344 0xC0 //13.44s +#define ISSI3733_ABCR2_T3_2688 0xE0 //26.88s + +//Min value time +#define ISSI3733_ABCR2_T4_0000 0x00 //0s +#define ISSI3733_ABCR2_T4_0021 0x02 //0.21s +#define ISSI3733_ABCR2_T4_0042 0x04 //0.42s +#define ISSI3733_ABCR2_T4_0084 0x06 //0.84s +#define ISSI3733_ABCR2_T4_0168 0x08 //1.68s +#define ISSI3733_ABCR2_T4_0336 0x0A //3.36s +#define ISSI3733_ABCR2_T4_0672 0x0C //6.72s +#define ISSI3733_ABCR2_T4_1344 0x0E //13.44s +#define ISSI3733_ABCR2_T4_2688 0x10 //26.88s +#define ISSI3733_ABCR2_T4_5376 0x12 //53.76s +#define ISSI3733_ABCR2_T4_10752 0x14 //107.52s + +//PG3: Auto Breath Control Register 3 +#define ISSI3733_ABCR3_ABM1 0x04 //Auto Breath Control Register 3 of ABM-1 +#define ISSI3733_ABCR3_ABM2 0x08 //Auto Breath Control Register 3 of ABM-2 +#define ISSI3733_ABCR3_ABM3 0x0C //Auto Breath Control Register 3 of ABM-3 + +#define ISSI3733_ABCR3_LTA_LOOP_ENDLESS 0x00 +#define ISSI3733_ABCR3_LTA_LOOP_1 0x01 +#define ISSI3733_ABCR3_LTA_LOOP_2 0x02 +#define ISSI3733_ABCR3_LTA_LOOP_3 0x03 +#define ISSI3733_ABCR3_LTA_LOOP_4 0x04 +#define ISSI3733_ABCR3_LTA_LOOP_5 0x05 +#define ISSI3733_ABCR3_LTA_LOOP_6 0x06 +#define ISSI3733_ABCR3_LTA_LOOP_7 0x07 +#define ISSI3733_ABCR3_LTA_LOOP_8 0x08 +#define ISSI3733_ABCR3_LTA_LOOP_9 0x09 +#define ISSI3733_ABCR3_LTA_LOOP_10 0x0A +#define ISSI3733_ABCR3_LTA_LOOP_11 0x0B +#define ISSI3733_ABCR3_LTA_LOOP_12 0x0C +#define ISSI3733_ABCR3_LTA_LOOP_13 0x0D +#define ISSI3733_ABCR3_LTA_LOOP_14 0x0E +#define ISSI3733_ABCR3_LTA_LOOP_15 0x0F + +//Loop Begin +#define ISSI3733_ABCR3_LB_T1 0x00 +#define ISSI3733_ABCR3_LB_T2 0x10 +#define ISSI3733_ABCR3_LB_T3 0x20 +#define ISSI3733_ABCR3_LB_T4 0x30 + +//Loop End +#define ISSI3733_ABCR3_LE_T3 0x00 //End at Off state +#define ISSI3733_ABCR3_LE_T1 0x40 //End at On State + +//PG3: Auto Breath Control Register 4 +#define ISSI3733_ABCR4_ABM1 0x05 //Auto Breath Control Register 4 of ABM-1 +#define ISSI3733_ABCR4_ABM2 0x09 //Auto Breath Control Register 4 of ABM-2 +#define ISSI3733_ABCR4_ABM3 0x0D //Auto Breath Control Register 4 of ABM-3 + +#define ISSI3733_ABCR4_LTB_LOOP_ENDLESS 0x00 +//Or 8bit loop times + +//PG3: Time Update Register +#define ISSI3733_TUR 0x0E +#define ISSI3733_TUR_UPDATE 0x00 //Write to update 02h~0Dh time registers after configuring + +//PG3: SWy Pull-Up Resistor Selection Register +#define ISSI3733_SWYR_PUR 0x0F +#define ISSI3733_SWYR_PUR_NONE 0x00 //No pull-up resistor +#define ISSI3733_SWYR_PUR_500 0x01 //0.5k Ohm +#define ISSI3733_SWYR_PUR_1000 0x02 //1.0k Ohm +#define ISSI3733_SWYR_PUR_2000 0x03 //2.0k Ohm +#define ISSI3733_SWYR_PUR_4000 0x04 //4.0k Ohm +#define ISSI3733_SWYR_PUR_8000 0x05 //8.0k Ohm +#define ISSI3733_SWYR_PUR_16000 0x06 //16k Ohm +#define ISSI3733_SWYR_PUR_32000 0x07 //32k Ohm + +//PG3: CSx Pull-Down Resistor Selection Register +#define ISSI3733_CSXR_PDR 0x10 +#define ISSI3733_CSXR_PDR_NONE 0x00 //No pull-down resistor +#define ISSI3733_CSXR_PDR_500 0x01 //0.5k Ohm +#define ISSI3733_CSXR_PDR_1000 0x02 //1.0k Ohm +#define ISSI3733_CSXR_PDR_2000 0x03 //2.0k Ohm +#define ISSI3733_CSXR_PDR_4000 0x04 //4.0k Ohm +#define ISSI3733_CSXR_PDR_8000 0x05 //8.0k Ohm +#define ISSI3733_CSXR_PDR_16000 0x06 //16k Ohm +#define ISSI3733_CSXR_PDR_32000 0x07 //32k Ohm + +//PG3: Reset Register +#define ISSI3733_RR 0x11 //Read to reset all registers to default values + +#endif //_ISSI3733_DRIVER_H_ diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c new file mode 100644 index 0000000000..7ee1dad224 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -0,0 +1,509 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" +#include "tmk_core/common/led.h" +#include + +void SERCOM1_0_Handler( void ) +{ + if (SERCOM1->I2CM.INTFLAG.bit.ERROR) + { + SERCOM1->I2CM.INTFLAG.reg = SERCOM_I2CM_INTENCLR_ERROR; + } +} + +void DMAC_0_Handler( void ) +{ + if (DMAC->Channel[0].CHINTFLAG.bit.TCMPL) + { + DMAC->Channel[0].CHINTFLAG.reg = DMAC_CHINTENCLR_TCMPL; + + i2c1_stop(); + + i2c_led_q_running = 0; + + i2c_led_q_run(); + + return; + } + + if (DMAC->Channel[0].CHINTFLAG.bit.TERR) + { + DMAC->Channel[0].CHINTFLAG.reg = DMAC_CHINTENCLR_TERR; + } +} + +issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; + +issi3733_led_t led_map[ISSI3733_LED_COUNT+1] = ISSI3733_LED_MAP; +issi3733_led_t *lede = led_map + ISSI3733_LED_COUNT; //End pointer of mapping + +uint8_t gcr_desired; +uint8_t gcr_breathe; +uint8_t gcr_use; +uint8_t gcr_actual; +uint8_t gcr_actual_last; + +#define ACT_GCR_NONE 0 +#define ACT_GCR_INC 1 +#define ACT_GCR_DEC 2 + +#define LED_GCR_STEP_AUTO 2 + +static uint8_t gcr_min_counter; +static uint8_t v_5v_cat_hit; + +//WARNING: Automatic GCR is in place to prevent USB shutdown and LED driver overloading +void gcr_compute(void) +{ + uint8_t action = ACT_GCR_NONE; + + if (led_animation_breathing) + gcr_use = gcr_breathe; + else + gcr_use = gcr_desired; + + //If the 5v takes a catastrophic hit, disable the LED drivers briefly, assert auto gcr mode, min gcr and let the auto take over + if (v_5v < V5_CAT) + { + I2C3733_Control_Set(0); + //CDC_print("USB: WARNING: 5V catastrophic level reached! Disabling LED drivers!\r\n"); //Blocking print is bad here! + v_5v_cat_hit = 20; //~100ms recover + gcr_actual = 0; //Minimize GCR + usb_gcr_auto = 1; //Force auto mode enabled + return; + } + else if (v_5v_cat_hit > 1) + { + v_5v_cat_hit--; + return; + } + else if (v_5v_cat_hit == 1) + { + I2C3733_Control_Set(1); + CDC_print("USB: WARNING: Re-enabling LED drivers\r\n"); + v_5v_cat_hit = 0; + return; + } + + if (usb_gcr_auto) + { + if (v_5v_avg < V5_LOW) action = ACT_GCR_DEC; + else if (v_5v_avg > V5_HIGH && gcr_actual < gcr_use) action = ACT_GCR_INC; + else if (gcr_actual > gcr_use) action = ACT_GCR_DEC; + } + else + { + if (gcr_actual < gcr_use) action = ACT_GCR_INC; + else if (gcr_actual > gcr_use) action = ACT_GCR_DEC; + } + + if (action == ACT_GCR_NONE) + { + gcr_min_counter = 0; + } + else if (action == ACT_GCR_INC) + { + if (LED_GCR_STEP_AUTO > LED_GCR_MAX - gcr_actual) gcr_actual = LED_GCR_MAX; //Obey max and prevent wrapping + else gcr_actual += LED_GCR_STEP_AUTO; + gcr_min_counter = 0; + } + else if (action == ACT_GCR_DEC) + { + if (LED_GCR_STEP_AUTO > gcr_actual) //Prevent wrapping + { + gcr_actual = 0; + //At this point, power can no longer be cut from the LED drivers, so focus on cutting out extra port if active + if (usb_extra_state != USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) //If not in a wait for replug state + { + if (usb_extra_state == USB_EXTRA_STATE_ENABLED) //If extra usb is enabled + { + gcr_min_counter++; + if (gcr_min_counter > 200) //5ms per check = 1s delay + { + USB_ExtraSetState(USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG); + usb_extra_manual = 0; //Force disable manual mode of extra port + if (usb_extra_manual) CDC_print("USB: Disabling extra port until replug and manual mode toggle!\r\n"); + else CDC_print("USB: Disabling extra port until replug!\r\n"); + } + } + } + } + else + { + //Power successfully cut back from LED drivers + gcr_actual -= LED_GCR_STEP_AUTO; + gcr_min_counter = 0; + + //If breathe mode is active, the top end can fluctuate if the host can not supply enough current + //So set the breathe GCR to where it becomes stable + if (led_animation_breathing == 1) + { + gcr_breathe = gcr_actual; + //PS: At this point, setting breathing to exhale makes a noticebly shorter cycle + // and the same would happen maybe one or two more times. Therefore I'm favoring + // powering through one full breathe and letting gcr settle completely + } + } + } +} + +led_disp_t disp; + +void issi3733_prepare_arrays(void) +{ + memset(issidrv,0,sizeof(issi3733_driver_t) * ISSI3733_DRIVER_COUNT); + + int i; + uint8_t addrs[ISSI3733_DRIVER_COUNT] = ISSI3773_DRIVER_ADDRESSES; + + for (i=0;irgb.g = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swg-1)*16 + (cur->adr.cs-1)); + cur->rgb.r = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swr-1)*16 + (cur->adr.cs-1)); + cur->rgb.b = issidrv[cur->adr.drv-1].pwm + 1 + ((cur->adr.swb-1)*16 + (cur->adr.cs-1)); + + //BYTE: 1 + (SW-1)*2 + (CS-1)/8 + //BIT: (CS-1)%8 + *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swg-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); + *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swr-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); + *(issidrv[cur->adr.drv-1].onoff + 1 + (cur->adr.swb-1)*2+(cur->adr.cs-1)/8) |= (1<<((cur->adr.cs-1)%8)); + + cur++; + } +} + +void disp_calc_extents(void) +{ + issi3733_led_t *cur = led_map; + + disp.left = 1e10; + disp.right = -1e10; + disp.top = -1e10; + disp.bottom = 1e10; + + while (cur < lede) + { + if (cur->x < disp.left) disp.left = cur->x; + if (cur->x > disp.right) disp.right = cur->x; + if (cur->y < disp.bottom) disp.bottom = cur->y; + if (cur->y > disp.top) disp.top = cur->y; + + cur++; + } + + disp.width = disp.right - disp.left; + disp.height = disp.top - disp.bottom; +} + +void disp_pixel_setup(void) +{ + issi3733_led_t *cur = led_map; + + while (cur < lede) + { + cur->px = (cur->x - disp.left) / disp.width * 100; + cur->py = (cur->y - disp.top) / disp.height * 100; + *cur->rgb.r = 0; + *cur->rgb.g = 0; + *cur->rgb.b = 0; + + cur++; + } +} + +void led_matrix_prepare(void) +{ + disp_calc_extents(); + disp_pixel_setup(); +} + +uint8_t led_enabled; +float led_animation_speed; +uint8_t led_animation_direction; +uint8_t led_animation_breathing; +uint8_t led_animation_breathe_cur; +uint8_t breathe_step; +uint8_t breathe_dir; +uint64_t led_next_run; + +uint8_t led_animation_id; +uint8_t led_lighting_mode; + +issi3733_led_t *led_cur; +uint8_t led_per_run = 15; +float breathe_mult; + +void led_matrix_run(led_setup_t *f) +{ + float ro; + float go; + float bo; + float px; + uint8_t led_this_run = 0; + + if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing + { + led_cur = led_map; + + disp.frame += 1; + + breathe_mult = 1; + + if (led_animation_breathing) + { + led_animation_breathe_cur += breathe_step * breathe_dir; + + if (led_animation_breathe_cur >= BREATHE_MAX_STEP) + breathe_dir = -1; + else if (led_animation_breathe_cur <= BREATHE_MIN_STEP) + breathe_dir = 1; + + //Brightness curve created for 256 steps, 0 - ~98% + breathe_mult = 0.000015 * led_animation_breathe_cur * led_animation_breathe_cur; + if (breathe_mult > 1) breathe_mult = 1; + else if (breathe_mult < 0) breathe_mult = 0; + } + } + + uint8_t fcur = 0; + uint8_t fmax = 0; + + //Frames setup + while (f[fcur].end != 1) + { + fcur++; //Count frames + } + + fmax = fcur; //Store total frames count + + while (led_cur < lede && led_this_run < led_per_run) + { + ro = 0; + go = 0; + bo = 0; + + if (led_lighting_mode == LED_MODE_KEYS_ONLY && led_cur->scan == 255) + { + //Do not act on this LED + } + else if (led_lighting_mode == LED_MODE_NON_KEYS_ONLY && led_cur->scan != 255) + { + //Do not act on this LED + } + else if (led_lighting_mode == LED_MODE_INDICATORS_ONLY) + { + //Do not act on this LED (Only show indicators) + } + else + { + //Act on LED + for (fcur = 0; fcur < fmax; fcur++) + { + px = led_cur->px; + float pxmod; + pxmod = (float)(disp.frame % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; + + //Add in any moving effects + if ((!led_animation_direction && f[fcur].ef & EF_SCR_R) || (led_animation_direction && (f[fcur].ef & EF_SCR_L))) + { + pxmod *= 100.0f; + pxmod = (uint32_t)pxmod % 10000; + pxmod /= 100.0f; + + px -= pxmod; + + if (px > 100) px -= 100; + else if (px < 0) px += 100; + } + else if ((!led_animation_direction && f[fcur].ef & EF_SCR_L) || (led_animation_direction && (f[fcur].ef & EF_SCR_R))) + { + pxmod *= 100.0f; + pxmod = (uint32_t)pxmod % 10000; + pxmod /= 100.0f; + px += pxmod; + + if (px > 100) px -= 100; + else if (px < 0) px += 100; + } + + //Check if LED's px is in current frame + if (px < f[fcur].hs) continue; + if (px > f[fcur].he) continue; + //note: < 0 or > 100 continue + + //Calculate the px within the start-stop percentage for color blending + px = (px - f[fcur].hs) / (f[fcur].he - f[fcur].hs); + + //Add in any color effects + if (f[fcur].ef & EF_OVER) + { + ro = (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go = (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo = (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + else if (f[fcur].ef & EF_SUBTRACT) + { + ro -= (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go -= (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo -= (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + else + { + ro += (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go += (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo += (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + } + } + } + + //Clamp values 0-255 + if (ro > 255) ro = 255; else if (ro < 0) ro = 0; + if (go > 255) go = 255; else if (go < 0) go = 0; + if (bo > 255) bo = 255; else if (bo < 0) bo = 0; + + if (led_animation_breathing) + { + ro *= breathe_mult; + go *= breathe_mult; + bo *= breathe_mult; + } + + *led_cur->rgb.r = (uint8_t)ro; + *led_cur->rgb.g = (uint8_t)go; + *led_cur->rgb.b = (uint8_t)bo; + +#ifdef USB_LED_INDICATOR_ENABLE + if (keyboard_leds()) + { + uint8_t kbled = keyboard_leds(); + if ( + #if USB_LED_NUM_LOCK_SCANCODE != 255 + (led_cur->scan == USB_LED_NUM_LOCK_SCANCODE && kbled & (1<scan == USB_LED_CAPS_LOCK_SCANCODE && kbled & (1<scan == USB_LED_SCROLL_LOCK_SCANCODE && kbled & (1<scan == USB_LED_COMPOSE_SCANCODE && kbled & (1<scan == USB_LED_KANA_SCANCODE && kbled & (1<rgb.r > 127) *led_cur->rgb.r = 0; + else *led_cur->rgb.r = 255; + if (*led_cur->rgb.g > 127) *led_cur->rgb.g = 0; + else *led_cur->rgb.g = 255; + if (*led_cur->rgb.b > 127) *led_cur->rgb.b = 0; + else *led_cur->rgb.b = 255; + } + } +#endif //USB_LED_INDICATOR_ENABLE + + led_cur++; + led_this_run++; + } +} + +uint8_t led_matrix_init(void) +{ + DBGC(DC_LED_MATRIX_INIT_BEGIN); + + issi3733_prepare_arrays(); + + led_matrix_prepare(); + + disp.frame = 0; + led_next_run = 0; + + led_enabled = 1; + led_animation_id = 0; + led_lighting_mode = LED_MODE_NORMAL; + led_animation_speed = 4.0f; + led_animation_direction = 0; + led_animation_breathing = 0; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_step = 1; + breathe_dir = 1; + + gcr_min_counter = 0; + v_5v_cat_hit = 0; + + //Run led matrix code once for initial LED coloring + led_cur = 0; + led_matrix_run((led_setup_t*)led_setups[led_animation_id]); + + DBGC(DC_LED_MATRIX_INIT_COMPLETE); + + return 0; +} + +#define LED_UPDATE_RATE 10 //ms + +//led data processing can take time, so process data in chunks to free up the processor +//this is done through led_cur and lede +void led_matrix_task(void) +{ + if (led_enabled) + { + //If an update may run and frame processing has completed + if (CLK_get_ms() >= led_next_run && led_cur == lede) + { + uint8_t drvid; + + led_next_run = CLK_get_ms() + LED_UPDATE_RATE; //Set next frame update time + + //NOTE: GCR does not need to be timed with LED processing, but there is really no harm + if (gcr_actual != gcr_actual_last) + { + for (drvid=0;drvid. +*/ + +#ifndef _LED_MATRIX_H_ +#define _LED_MATRIX_H_ + +//From keyboard +#include "config_led.h" + +//CS1-CS16 Current Source "Col" +#define ISSI3733_CS_COUNT 16 + +//SW1-SW12 Switch "Row" +#define ISSI3733_SW_COUNT 12 + +#define ISSI3733_LED_RGB_COUNT ISSI3733_CS_COUNT * ISSI3733_SW_COUNT +#define ISSI3733_PG0_BYTES ISSI3733_LED_RGB_COUNT / 8 + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG1_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG2_BYTES ISSI3733_LED_RGB_COUNT + 1 //+1 for first byte being memory start offset for I2C transfer +#define ISSI3733_PG3_BYTES 18 + 1 //+1 for first byte being memory start offset for I2C transfer + +#define ISSI3733_PG_ONOFF_BYTES ISSI3733_PG0_BYTES +#define ISSI3733_PG_OR_BYTES ISSI3733_PG0_BYTES +#define ISSI3733_PG_SR_BYTES ISSI3733_PG0_BYTES +#define ISSI3733_PG_PWM_BYTES ISSI3733_PG1_BYTES +#define ISSI3733_PG_ABM_BYTES ISSI3733_PG2_BYTES +#define ISSI3733_PG_FN_BYTES ISSI3733_PG3_BYTES + +typedef struct issi3733_driver_s { + uint8_t addr; //Address of the driver according to wiring "ISSI3733: Table 1 Slave Address" + uint8_t onoff[ISSI3733_PG_ONOFF_BYTES]; //PG0 - LED Control Register - LED On/Off Register + uint8_t open[ISSI3733_PG_OR_BYTES]; //PG0 - LED Control Register - LED Open Register + uint8_t shrt[ISSI3733_PG_SR_BYTES]; //PG0 - LED Control Register - LED Short Register + uint8_t pwm[ISSI3733_PG_PWM_BYTES]; //PG1 - PWM Register + uint8_t abm[ISSI3733_PG_ABM_BYTES]; //PG2 - Auto Breath Mode Register + uint8_t conf[ISSI3733_PG_FN_BYTES]; //PG3 - Function Register +} issi3733_driver_t; + +typedef struct issi3733_rgb_s { + uint8_t *r; //Direct access into PWM data + uint8_t *g; //Direct access into PWM data + uint8_t *b; //Direct access into PWM data +} issi3733_rgb_t; + +typedef struct issi3733_rgb_adr_s { + uint8_t drv; //Driver from given list + uint8_t cs; //CS + uint8_t swr; //SW Red + uint8_t swg; //SW Green + uint8_t swb; //SW Blue +} issi3733_rgb_adr_t; + +typedef struct issi3733_led_s { + uint8_t id; //According to PCB ref + issi3733_rgb_t rgb; //PWM settings of R G B + issi3733_rgb_adr_t adr; //Hardware addresses + float x; //Physical position X + float y; //Physical position Y + float px; //Physical position X in percent + float py; //Physical position Y in percent + uint8_t scan; //Key scan code from wiring (set 0xFF if no key) +} issi3733_led_t; + +typedef struct led_disp_s { + uint64_t frame; + float left; + float right; + float top; + float bottom; + float width; + float height; +} led_disp_t; + +uint8_t led_matrix_init(void); + +#define LED_MODE_NORMAL 0 //Must be 0 +#define LED_MODE_KEYS_ONLY 1 +#define LED_MODE_NON_KEYS_ONLY 2 +#define LED_MODE_INDICATORS_ONLY 3 +#define LED_MODE_MAX_INDEX LED_MODE_INDICATORS_ONLY //Must be highest value + +#define EF_NONE 0x00000000 //No effect +#define EF_OVER 0x00000001 //Overwrite any previous color information with new +#define EF_SCR_L 0x00000002 //Scroll left +#define EF_SCR_R 0x00000004 //Scroll right +#define EF_SUBTRACT 0x00000008 //Subtract color values + +typedef struct led_setup_s { + float hs; //Band begin at percent + float he; //Band end at percent + uint8_t rs; //Red start value + uint8_t re; //Red end value + uint8_t gs; //Green start value + uint8_t ge; //Green end value + uint8_t bs; //Blue start value + uint8_t be; //Blue end value + uint32_t ef; //Animation and color effects + uint8_t end; //Set to signal end of the setup +} led_setup_t; + +extern issi3733_driver_t issidrv[ISSI3733_DRIVER_COUNT]; + +extern uint8_t gcr_desired; +extern uint8_t gcr_breathe; +extern uint8_t gcr_actual; +extern uint8_t gcr_actual_last; + +extern uint8_t led_animation_id; +extern uint8_t led_enabled; +extern float led_animation_speed; +extern uint8_t led_lighting_mode; +extern uint8_t led_animation_direction; +extern uint8_t led_animation_breathing; +extern uint8_t led_animation_breathe_cur; +extern uint8_t breathe_dir; +extern const uint8_t led_setups_count; + +extern void *led_setups[]; + +extern issi3733_led_t *led_cur; +extern issi3733_led_t *lede; + +void led_matrix_run(led_setup_t *f); +void led_matrix_task(void); + +void gcr_compute(void); + +#endif //_LED_MATRIX_H_ diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c new file mode 100644 index 0000000000..e9514730ec --- /dev/null +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -0,0 +1,279 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "samd51j18a.h" +#include "tmk_core/common/keyboard.h" + +#include "report.h" +#include "host.h" +#include "host_driver.h" +#include "keycode_config.h" +#include +#include "quantum.h" + +//From protocol directory +#include "arm_atsam_protocol.h" + +//From keyboard's directory +#include "config_led.h" + +uint8_t keyboard_leds(void); +void send_keyboard(report_keyboard_t *report); +void send_mouse(report_mouse_t *report); +void send_system(uint16_t data); +void send_consumer(uint16_t data); + +host_driver_t arm_atsam_driver = { + keyboard_leds, + send_keyboard, + send_mouse, + send_system, + send_consumer +}; + +uint8_t led_states; + +uint8_t keyboard_leds(void) +{ +#ifdef NKRO_ENABLE + if (keymap_config.nkro) + return udi_hid_nkro_report_set; + else +#endif //NKRO_ENABLE + return udi_hid_kbd_report_set; +} + +void send_keyboard(report_keyboard_t *report) +{ + uint32_t irqflags; + +#ifdef NKRO_ENABLE + if (!keymap_config.nkro) + { +#endif //NKRO_ENABLE + dprint("s-kbd\r\n"); + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + memcpy(udi_hid_kbd_report, report->raw, UDI_HID_KBD_REPORT_SIZE); + udi_hid_kbd_b_report_valid = 1; + udi_hid_kbd_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#ifdef NKRO_ENABLE + } + else + { + dprint("s-nkro\r\n"); + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + memcpy(udi_hid_nkro_report, report->raw, UDI_HID_NKRO_REPORT_SIZE); + udi_hid_nkro_b_report_valid = 1; + udi_hid_nkro_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); + } +#endif //NKRO_ENABLE +} + +void send_mouse(report_mouse_t *report) +{ +#ifdef MOUSEKEY_ENABLE + uint32_t irqflags; + + dprint("s-mou\r\n"); + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + memcpy(udi_hid_mou_report, report, UDI_HID_MOU_REPORT_SIZE); + udi_hid_mou_b_report_valid = 1; + udi_hid_mou_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#endif //MOUSEKEY_ENABLE +} + +void send_system(uint16_t data) +{ +#ifdef EXTRAKEY_ENABLE + dprintf("s-exks %i\r\n", data); + + uint32_t irqflags; + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + udi_hid_exk_report.desc.report_id = REPORT_ID_SYSTEM; + if (data != 0) data = data - SYSTEM_POWER_DOWN + 1; + udi_hid_exk_report.desc.report_data = data; + udi_hid_exk_b_report_valid = 1; + udi_hid_exk_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#endif //EXTRAKEY_ENABLE +} + +void send_consumer(uint16_t data) +{ +#ifdef EXTRAKEY_ENABLE + dprintf("s-exkc %i\r\n",data); + + uint32_t irqflags; + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + udi_hid_exk_report.desc.report_id = REPORT_ID_CONSUMER; + udi_hid_exk_report.desc.report_data = data; + udi_hid_exk_b_report_valid = 1; + udi_hid_exk_send_report(); + + __DMB(); + __set_PRIMASK(irqflags); +#endif //EXTRAKEY_ENABLE +} + +int main(void) +{ + led_ena; + m15_ena; + + debug_code_init(); + + CLK_init(); + + ADC0_init(); + + SPI_Init(); + + i2c1_init(); + + matrix_init(); + + USB2422_init(); + + DBGC(DC_MAIN_UDC_START_BEGIN); + udc_start(); + DBGC(DC_MAIN_UDC_START_COMPLETE); + + DBGC(DC_MAIN_CDC_INIT_BEGIN); + CDC_init(); + DBGC(DC_MAIN_CDC_INIT_COMPLETE); + + while (USB2422_Port_Detect_Init() == 0) {} + + led_off; + m15_off; + + led_matrix_init(); + + while (I2C3733_Init_Control() != 1) {} + while (I2C3733_Init_Drivers() != 1) {} + + I2C_DMAC_LED_Init(); + + i2c_led_q_init(); + + uint8_t drvid; + for (drvid=0;drvid next_5v_checkup) + { + next_5v_checkup = CLK_get_ms() + 5; + + v_5v = adc_get(ADC_5V); + v_5v_avg = 0.9 * v_5v_avg + 0.1 * v_5v; + + gcr_compute(); + } + + if (CLK_get_ms() > next_usb_checkup) + { + next_usb_checkup = CLK_get_ms() + 10; + + USB_HandleExtraDevice(); + } + +#ifdef VIRTSER_ENABLE + if (CLK_get_ms() > next_print) + { + next_print = CLK_get_ms() + 250; + //dpf("5v=%i 5vu=%i dlow=%i dhi=%i gca=%i gcd=%i\r\n",v_5v,v_5v_avg,v_5v_avg-V5_LOW,v_5v_avg-V5_HIGH,gcr_actual,gcr_desired); + } +#endif //VIRTSER_ENABLE + } + + return 1; +} + diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.h b/tmk_core/protocol/arm_atsam/main_arm_atsam.h new file mode 100644 index 0000000000..78205e2e1b --- /dev/null +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.h @@ -0,0 +1,23 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _MAIN_ARM_ATSAM_H_ +#define _MAIN_ARM_ATSAM_H_ + +uint8_t keyboard_leds(void); + +#endif //_MAIN_ARM_ATSAM_H_ diff --git a/tmk_core/protocol/arm_atsam/md_bootloader.h b/tmk_core/protocol/arm_atsam/md_bootloader.h new file mode 100644 index 0000000000..1316876c84 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/md_bootloader.h @@ -0,0 +1,18 @@ +#ifndef _MD_BOOTLOADER_H_ +#define _MD_BOOTLOADER_H_ + +extern uint32_t _srom; +extern uint32_t _lrom; +extern uint32_t _erom; + +#define BOOTLOADER_SERIAL_MAX_SIZE 20 //DO NOT MODIFY! + +#ifdef MD_BOOTLOADER + +#define MCU_HZ 48000000 +#define I2C_HZ 0 //Not used + +#endif //MD_BOOTLOADER + +#endif //_MD_BOOTLOADER_H_ + diff --git a/tmk_core/protocol/arm_atsam/spi.c b/tmk_core/protocol/arm_atsam/spi.c new file mode 100644 index 0000000000..6036a92204 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/spi.c @@ -0,0 +1,90 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" + +Srdata_t srdata; + +void SPI_WriteSRData(void) +{ + uint16_t timeout; + + SC2_RCLCK_LO; + + timeout = 50000; + while (!(SCSPI->SPI.INTFLAG.bit.DRE) && --timeout) { DBGC(DC_SPI_WRITE_DRE); } + + SCSPI->SPI.DATA.bit.DATA = srdata.reg & 0xFF; //Shift in bits 7-0 + timeout = 50000; + while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_1); } + + SCSPI->SPI.DATA.bit.DATA = (srdata.reg >> 8) & 0xFF; //Shift in bits 15-8 + timeout = 50000; + while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_2); } + + SC2_RCLCK_HI; +} + +void SPI_Init(void) +{ + uint32_t timeout; + + DBGC(DC_SPI_INIT_BEGIN); + + CLK_set_spi_freq(CHAN_SERCOM_SPI, FREQ_SPI_DEFAULT); + + PORT->Group[0].PMUX[6].bit.PMUXE = 2; + PORT->Group[0].PMUX[6].bit.PMUXO = 2; + PORT->Group[0].PINCFG[12].bit.PMUXEN = 1; + PORT->Group[0].PINCFG[13].bit.PMUXEN = 1; + + //Configure Shift Registers + SC2_DIRSET; + SC2_RCLCK_HI; + SC2_OE_DIS; + + SCSPI->SPI.CTRLA.bit.DORD = 1; + SCSPI->SPI.CTRLA.bit.CPOL = 1; + SCSPI->SPI.CTRLA.bit.CPHA = 1; + SCSPI->SPI.CTRLA.bit.DIPO = 3; + SCSPI->SPI.CTRLA.bit.MODE = 3; //master + + SCSPI->SPI.CTRLA.bit.ENABLE = 1; + timeout = 50000; + while (SCSPI->SPI.SYNCBUSY.bit.ENABLE && timeout--) { DBGC(DC_SPI_SYNC_ENABLING); } + + srdata.reg = 0; + srdata.bit.HUB_CONNECT = 0; + srdata.bit.HUB_RESET_N = 0; + srdata.bit.S_UP = 0; + srdata.bit.E_UP_N = 1; + srdata.bit.S_DN1 = 1; + srdata.bit.E_DN1_N = 1; + srdata.bit.E_VBUS_1 = 0; + srdata.bit.E_VBUS_2 = 0; + srdata.bit.SRC_1 = 1; + srdata.bit.SRC_2 = 1; + srdata.bit.IRST = 1; + srdata.bit.SDB_N = 0; + SPI_WriteSRData(); + + //Enable register output + SC2_OE_ENA; + + DBGC(DC_SPI_INIT_COMPLETE); +} + diff --git a/tmk_core/protocol/arm_atsam/spi.h b/tmk_core/protocol/arm_atsam/spi.h new file mode 100644 index 0000000000..3412dfc364 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/spi.h @@ -0,0 +1,63 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _SPI_H_ +#define _SPI_H_ + +//TODO: PS: Should bring ports to keyboard configuration + +#define SCSPI SERCOM2 + +#define P14_DIR 0x00004000 /* PIN14 DIR Bit */ +#define P14_OUT 0x00004000 /* PIN14 OUT Bit */ +#define P15_DIR 0x00008000 /* PIN15 DIR Bit */ +#define P15_OUT 0x00008000 /* PIN15 OUT Bit */ + +#define SC2_RCLCK_LO REG_PORT_OUTCLR1 = P14_OUT /* PB14 Low, SC2_RCLCK Low */ +#define SC2_RCLCK_HI REG_PORT_OUTSET1 = P14_OUT /* PB14 High, SC2_RCLCK High */ +#define SC2_OE_ENA REG_PORT_OUTCLR1 = P15_OUT /* PB15 Low, SC2_OE_N Low (Shift register enabled) */ +#define SC2_OE_DIS REG_PORT_OUTSET1 = P15_OUT /* PB15 High, SC2_OE_N High (Shift register disabled) */ +#define SC2_DIRSET REG_PORT_DIRSET1 = P14_DIR | P15_DIR; /* PB14 PB15 OUT */ + +typedef union { + struct { + uint16_t RSVD4:1; /*!< bit: 0 */ + uint16_t RSVD3:1; /*!< bit: 1 */ + uint16_t RSVD2:1; /*!< bit: 2 */ + uint16_t RSVD1:1; /*!< bit: 3 */ + uint16_t SDB_N:1; /*!< bit: 4 SHUTDOWN THE CHIP WHEN 0, RUN WHEN 1 */ + uint16_t IRST:1; /*!< bit: 5 RESET THE IS3733 I2C WHEN 1, RUN WHEN 0 */ + uint16_t SRC_2:1; /*!< bit: 6 ADVERTISE A SOURCE TO USBC-2 CC */ + uint16_t SRC_1:1; /*!< bit: 7 ADVERTISE A SOURCE TO USBC-1 CC */ + uint16_t E_VBUS_2:1; /*!< bit: 8 ENABLE 5V OUT TO USBC-2 WHEN 1 */ + uint16_t E_VBUS_1:1; /*!< bit: 9 ENABLE 5V OUT TO USBC-1 WHEN 1 */ + uint16_t E_DN1_N:1; /*!< bit: 10 ENABLE DN1 1:2 MUX WHEN 0 */ + uint16_t S_DN1:1; /*!< bit: 11 SELECT DN1 PATH 0:USBC-1, 1:USBC-2 */ + uint16_t E_UP_N:1; /*!< bit: 12 ENABLE SUP 1:2 MUX WHEN 0 */ + uint16_t S_UP:1; /*!< bit: 13 SELECT UP PATH 0:USBC-1, 1:USBC-2 */ + uint16_t HUB_RESET_N:1; /*!< bit: 14 RESET USB HUB WHEN 0, RUN WHEN 1 */ + uint16_t HUB_CONNECT:1; /*!< bit: 15 SIGNAL VBUS CONNECT TO USB HUB WHEN 1 */ + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} Srdata_t; + +extern Srdata_t srdata; + +void SPI_WriteSRData(void); +void SPI_Init(void); + +#endif //_SPI_H_ diff --git a/tmk_core/protocol/arm_atsam/startup.c b/tmk_core/protocol/arm_atsam/startup.c new file mode 100644 index 0000000000..a62d02f1ca --- /dev/null +++ b/tmk_core/protocol/arm_atsam/startup.c @@ -0,0 +1,548 @@ +/** + * \file + * + * \brief gcc starttup file for SAMD51 + * + * Copyright (c) 2017 Microchip Technology Inc. + * + * \asf_license_start + * + * \page License + * + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the Licence at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * \asf_license_stop + * + */ + +#include "samd51.h" + +/* Initialize segments */ +extern uint32_t _sfixed; +extern uint32_t _efixed; +extern uint32_t _etext; +extern uint32_t _srelocate; +extern uint32_t _erelocate; +extern uint32_t _szero; +extern uint32_t _ezero; +extern uint32_t _sstack; +extern uint32_t _estack; + +/** \cond DOXYGEN_SHOULD_SKIP_THIS */ +int main(void); +/** \endcond */ + +void __libc_init_array(void); + +/* Default empty handler */ +void Dummy_Handler(void); + +/* Cortex-M4 core handlers */ +void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void MemManage_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DebugMon_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SysTick_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); + +/* Peripherals handlers */ +void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void MCLK_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */ +void OSCCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */ +void OSCCTRL_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */ +void OSCCTRL_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */ +void OSCCTRL_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */ +void OSC32KCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SUPC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */ +void SUPC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SUPC_BOD12DET, SUPC_BOD33DET */ +void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_0 */ +void EIC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_1 */ +void EIC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_2 */ +void EIC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_3 */ +void EIC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_4 */ +void EIC_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_5 */ +void EIC_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_6 */ +void EIC_7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_7 */ +void EIC_8_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_8 */ +void EIC_9_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_9 */ +void EIC_10_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_10 */ +void EIC_11_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_11 */ +void EIC_12_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_12 */ +void EIC_13_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_13 */ +void EIC_14_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_14 */ +void EIC_15_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EIC_EXTINT_15 */ +void FREQM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void NVMCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */ +void NVMCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */ +void DMAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */ +void DMAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */ +void DMAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */ +void DMAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */ +void DMAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */ +void EVSYS_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_0, EVSYS_OVR_0 */ +void EVSYS_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_1, EVSYS_OVR_1 */ +void EVSYS_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_2, EVSYS_OVR_2 */ +void EVSYS_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_3, EVSYS_OVR_3 */ +void EVSYS_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */ +void PAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TAL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TAL_BRK */ +void TAL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TAL_IPS_0, TAL_IPS_1 */ +void RAMECC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_0 */ +void SERCOM0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_1 */ +void SERCOM0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_2 */ +void SERCOM0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */ +void SERCOM1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_0 */ +void SERCOM1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_1 */ +void SERCOM1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_2 */ +void SERCOM1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */ +void SERCOM2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_0 */ +void SERCOM2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_1 */ +void SERCOM2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_2 */ +void SERCOM2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */ +void SERCOM3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_0 */ +void SERCOM3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_1 */ +void SERCOM3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_2 */ +void SERCOM3_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */ +#ifdef ID_SERCOM4 +void SERCOM4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_0 */ +void SERCOM4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_1 */ +void SERCOM4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_2 */ +void SERCOM4_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */ +#endif +#ifdef ID_SERCOM5 +void SERCOM5_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_0 */ +void SERCOM5_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_1 */ +void SERCOM5_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_2 */ +void SERCOM5_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */ +#endif +#ifdef ID_SERCOM6 +void SERCOM6_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_0 */ +void SERCOM6_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_1 */ +void SERCOM6_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_2 */ +void SERCOM6_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */ +#endif +#ifdef ID_SERCOM7 +void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_0 */ +void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_1 */ +void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_2 */ +void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */ +#endif +#ifdef ID_CAN0 +void CAN0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_CAN1 +void CAN1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_USB +void USB_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */ +void USB_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_SOF_HSOF */ +void USB_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */ +void USB_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */ +#endif +#ifdef ID_GMAC +void GMAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +void TCC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */ +void TCC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_0 */ +void TCC0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_1 */ +void TCC0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_2 */ +void TCC0_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_3 */ +void TCC0_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_4 */ +void TCC0_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC0_MC_5 */ +void TCC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */ +void TCC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_0 */ +void TCC1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_1 */ +void TCC1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_2 */ +void TCC1_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC1_MC_3 */ +void TCC2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */ +void TCC2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_0 */ +void TCC2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_1 */ +void TCC2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC2_MC_2 */ +#ifdef ID_TCC3 +void TCC3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */ +void TCC3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_0 */ +void TCC3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC3_MC_1 */ +#endif +#ifdef ID_TCC4 +void TCC4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */ +void TCC4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_0 */ +void TCC4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* TCC4_MC_1 */ +#endif +void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#ifdef ID_TC4 +void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_TC5 +void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_TC6 +void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_TC7 +void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +void PDEC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */ +void PDEC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_0 */ +void PDEC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* PDEC_MC_1 */ +void ADC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_OVERRUN, ADC0_WINMON */ +void ADC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC0_RESRDY */ +void ADC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_OVERRUN, ADC1_WINMON */ +void ADC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* ADC1_RESRDY */ +void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */ +void DAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_0 */ +void DAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_EMPTY_1 */ +void DAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_0 */ +void DAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); /* DAC_RESRDY_1 */ +#ifdef ID_I2S +void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +void PCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void AES_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TRNG_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#ifdef ID_ICM +void ICM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_PUKCC +void PUKCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +void QSPI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#ifdef ID_SDHC0 +void SDHC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif +#ifdef ID_SDHC1 +void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +#endif + +/* Exception Table */ +__attribute__ ((section(".vectors"))) +const DeviceVectors exception_table = { + + /* Configure Initial Stack Pointer, using linker-generated symbols */ + .pvStack = (void*) (&_estack), + + .pfnReset_Handler = (void*) Reset_Handler, + .pfnNMI_Handler = (void*) NMI_Handler, + .pfnHardFault_Handler = (void*) HardFault_Handler, + .pfnMemManage_Handler = (void*) MemManage_Handler, + .pfnBusFault_Handler = (void*) BusFault_Handler, + .pfnUsageFault_Handler = (void*) UsageFault_Handler, + .pvReservedM9 = (void*) (0UL), /* Reserved */ + .pvReservedM8 = (void*) (0UL), /* Reserved */ + .pvReservedM7 = (void*) (0UL), /* Reserved */ + .pvReservedM6 = (void*) (0UL), /* Reserved */ + .pfnSVC_Handler = (void*) SVC_Handler, + .pfnDebugMon_Handler = (void*) DebugMon_Handler, + .pvReservedM3 = (void*) (0UL), /* Reserved */ + .pfnPendSV_Handler = (void*) PendSV_Handler, + .pfnSysTick_Handler = (void*) SysTick_Handler, + + /* Configurable interrupts */ + .pfnPM_Handler = (void*) PM_Handler, /* 0 Power Manager */ + .pfnMCLK_Handler = (void*) MCLK_Handler, /* 1 Main Clock */ + .pfnOSCCTRL_0_Handler = (void*) OSCCTRL_0_Handler, /* 2 OSCCTRL_XOSCFAIL_0, OSCCTRL_XOSCRDY_0 */ + .pfnOSCCTRL_1_Handler = (void*) OSCCTRL_1_Handler, /* 3 OSCCTRL_XOSCFAIL_1, OSCCTRL_XOSCRDY_1 */ + .pfnOSCCTRL_2_Handler = (void*) OSCCTRL_2_Handler, /* 4 OSCCTRL_DFLLLOCKC, OSCCTRL_DFLLLOCKF, OSCCTRL_DFLLOOB, OSCCTRL_DFLLRCS, OSCCTRL_DFLLRDY */ + .pfnOSCCTRL_3_Handler = (void*) OSCCTRL_3_Handler, /* 5 OSCCTRL_DPLLLCKF_0, OSCCTRL_DPLLLCKR_0, OSCCTRL_DPLLLDRTO_0, OSCCTRL_DPLLLTO_0 */ + .pfnOSCCTRL_4_Handler = (void*) OSCCTRL_4_Handler, /* 6 OSCCTRL_DPLLLCKF_1, OSCCTRL_DPLLLCKR_1, OSCCTRL_DPLLLDRTO_1, OSCCTRL_DPLLLTO_1 */ + .pfnOSC32KCTRL_Handler = (void*) OSC32KCTRL_Handler, /* 7 32kHz Oscillators Control */ + .pfnSUPC_0_Handler = (void*) SUPC_0_Handler, /* 8 SUPC_B12SRDY, SUPC_B33SRDY, SUPC_BOD12RDY, SUPC_BOD33RDY, SUPC_VCORERDY, SUPC_VREGRDY */ + .pfnSUPC_1_Handler = (void*) SUPC_1_Handler, /* 9 SUPC_BOD12DET, SUPC_BOD33DET */ + .pfnWDT_Handler = (void*) WDT_Handler, /* 10 Watchdog Timer */ + .pfnRTC_Handler = (void*) RTC_Handler, /* 11 Real-Time Counter */ + .pfnEIC_0_Handler = (void*) EIC_0_Handler, /* 12 EIC_EXTINT_0 */ + .pfnEIC_1_Handler = (void*) EIC_1_Handler, /* 13 EIC_EXTINT_1 */ + .pfnEIC_2_Handler = (void*) EIC_2_Handler, /* 14 EIC_EXTINT_2 */ + .pfnEIC_3_Handler = (void*) EIC_3_Handler, /* 15 EIC_EXTINT_3 */ + .pfnEIC_4_Handler = (void*) EIC_4_Handler, /* 16 EIC_EXTINT_4 */ + .pfnEIC_5_Handler = (void*) EIC_5_Handler, /* 17 EIC_EXTINT_5 */ + .pfnEIC_6_Handler = (void*) EIC_6_Handler, /* 18 EIC_EXTINT_6 */ + .pfnEIC_7_Handler = (void*) EIC_7_Handler, /* 19 EIC_EXTINT_7 */ + .pfnEIC_8_Handler = (void*) EIC_8_Handler, /* 20 EIC_EXTINT_8 */ + .pfnEIC_9_Handler = (void*) EIC_9_Handler, /* 21 EIC_EXTINT_9 */ + .pfnEIC_10_Handler = (void*) EIC_10_Handler, /* 22 EIC_EXTINT_10 */ + .pfnEIC_11_Handler = (void*) EIC_11_Handler, /* 23 EIC_EXTINT_11 */ + .pfnEIC_12_Handler = (void*) EIC_12_Handler, /* 24 EIC_EXTINT_12 */ + .pfnEIC_13_Handler = (void*) EIC_13_Handler, /* 25 EIC_EXTINT_13 */ + .pfnEIC_14_Handler = (void*) EIC_14_Handler, /* 26 EIC_EXTINT_14 */ + .pfnEIC_15_Handler = (void*) EIC_15_Handler, /* 27 EIC_EXTINT_15 */ + .pfnFREQM_Handler = (void*) FREQM_Handler, /* 28 Frequency Meter */ + .pfnNVMCTRL_0_Handler = (void*) NVMCTRL_0_Handler, /* 29 NVMCTRL_0, NVMCTRL_1, NVMCTRL_2, NVMCTRL_3, NVMCTRL_4, NVMCTRL_5, NVMCTRL_6, NVMCTRL_7 */ + .pfnNVMCTRL_1_Handler = (void*) NVMCTRL_1_Handler, /* 30 NVMCTRL_10, NVMCTRL_8, NVMCTRL_9 */ + .pfnDMAC_0_Handler = (void*) DMAC_0_Handler, /* 31 DMAC_SUSP_0, DMAC_TCMPL_0, DMAC_TERR_0 */ + .pfnDMAC_1_Handler = (void*) DMAC_1_Handler, /* 32 DMAC_SUSP_1, DMAC_TCMPL_1, DMAC_TERR_1 */ + .pfnDMAC_2_Handler = (void*) DMAC_2_Handler, /* 33 DMAC_SUSP_2, DMAC_TCMPL_2, DMAC_TERR_2 */ + .pfnDMAC_3_Handler = (void*) DMAC_3_Handler, /* 34 DMAC_SUSP_3, DMAC_TCMPL_3, DMAC_TERR_3 */ + .pfnDMAC_4_Handler = (void*) DMAC_4_Handler, /* 35 DMAC_SUSP_10, DMAC_SUSP_11, DMAC_SUSP_12, DMAC_SUSP_13, DMAC_SUSP_14, DMAC_SUSP_15, DMAC_SUSP_16, DMAC_SUSP_17, DMAC_SUSP_18, DMAC_SUSP_19, DMAC_SUSP_20, DMAC_SUSP_21, DMAC_SUSP_22, DMAC_SUSP_23, DMAC_SUSP_24, DMAC_SUSP_25, DMAC_SUSP_26, DMAC_SUSP_27, DMAC_SUSP_28, DMAC_SUSP_29, DMAC_SUSP_30, DMAC_SUSP_31, DMAC_SUSP_4, DMAC_SUSP_5, DMAC_SUSP_6, DMAC_SUSP_7, DMAC_SUSP_8, DMAC_SUSP_9, DMAC_TCMPL_10, DMAC_TCMPL_11, DMAC_TCMPL_12, DMAC_TCMPL_13, DMAC_TCMPL_14, DMAC_TCMPL_15, DMAC_TCMPL_16, DMAC_TCMPL_17, DMAC_TCMPL_18, DMAC_TCMPL_19, DMAC_TCMPL_20, DMAC_TCMPL_21, DMAC_TCMPL_22, DMAC_TCMPL_23, DMAC_TCMPL_24, DMAC_TCMPL_25, DMAC_TCMPL_26, DMAC_TCMPL_27, DMAC_TCMPL_28, DMAC_TCMPL_29, DMAC_TCMPL_30, DMAC_TCMPL_31, DMAC_TCMPL_4, DMAC_TCMPL_5, DMAC_TCMPL_6, DMAC_TCMPL_7, DMAC_TCMPL_8, DMAC_TCMPL_9, DMAC_TERR_10, DMAC_TERR_11, DMAC_TERR_12, DMAC_TERR_13, DMAC_TERR_14, DMAC_TERR_15, DMAC_TERR_16, DMAC_TERR_17, DMAC_TERR_18, DMAC_TERR_19, DMAC_TERR_20, DMAC_TERR_21, DMAC_TERR_22, DMAC_TERR_23, DMAC_TERR_24, DMAC_TERR_25, DMAC_TERR_26, DMAC_TERR_27, DMAC_TERR_28, DMAC_TERR_29, DMAC_TERR_30, DMAC_TERR_31, DMAC_TERR_4, DMAC_TERR_5, DMAC_TERR_6, DMAC_TERR_7, DMAC_TERR_8, DMAC_TERR_9 */ + .pfnEVSYS_0_Handler = (void*) EVSYS_0_Handler, /* 36 EVSYS_EVD_0, EVSYS_OVR_0 */ + .pfnEVSYS_1_Handler = (void*) EVSYS_1_Handler, /* 37 EVSYS_EVD_1, EVSYS_OVR_1 */ + .pfnEVSYS_2_Handler = (void*) EVSYS_2_Handler, /* 38 EVSYS_EVD_2, EVSYS_OVR_2 */ + .pfnEVSYS_3_Handler = (void*) EVSYS_3_Handler, /* 39 EVSYS_EVD_3, EVSYS_OVR_3 */ + .pfnEVSYS_4_Handler = (void*) EVSYS_4_Handler, /* 40 EVSYS_EVD_10, EVSYS_EVD_11, EVSYS_EVD_4, EVSYS_EVD_5, EVSYS_EVD_6, EVSYS_EVD_7, EVSYS_EVD_8, EVSYS_EVD_9, EVSYS_OVR_10, EVSYS_OVR_11, EVSYS_OVR_4, EVSYS_OVR_5, EVSYS_OVR_6, EVSYS_OVR_7, EVSYS_OVR_8, EVSYS_OVR_9 */ + .pfnPAC_Handler = (void*) PAC_Handler, /* 41 Peripheral Access Controller */ + .pfnTAL_0_Handler = (void*) TAL_0_Handler, /* 42 TAL_BRK */ + .pfnTAL_1_Handler = (void*) TAL_1_Handler, /* 43 TAL_IPS_0, TAL_IPS_1 */ + .pvReserved44 = (void*) (0UL), /* 44 Reserved */ + .pfnRAMECC_Handler = (void*) RAMECC_Handler, /* 45 RAM ECC */ + .pfnSERCOM0_0_Handler = (void*) SERCOM0_0_Handler, /* 46 SERCOM0_0 */ + .pfnSERCOM0_1_Handler = (void*) SERCOM0_1_Handler, /* 47 SERCOM0_1 */ + .pfnSERCOM0_2_Handler = (void*) SERCOM0_2_Handler, /* 48 SERCOM0_2 */ + .pfnSERCOM0_3_Handler = (void*) SERCOM0_3_Handler, /* 49 SERCOM0_3, SERCOM0_4, SERCOM0_5, SERCOM0_6 */ + .pfnSERCOM1_0_Handler = (void*) SERCOM1_0_Handler, /* 50 SERCOM1_0 */ + .pfnSERCOM1_1_Handler = (void*) SERCOM1_1_Handler, /* 51 SERCOM1_1 */ + .pfnSERCOM1_2_Handler = (void*) SERCOM1_2_Handler, /* 52 SERCOM1_2 */ + .pfnSERCOM1_3_Handler = (void*) SERCOM1_3_Handler, /* 53 SERCOM1_3, SERCOM1_4, SERCOM1_5, SERCOM1_6 */ + .pfnSERCOM2_0_Handler = (void*) SERCOM2_0_Handler, /* 54 SERCOM2_0 */ + .pfnSERCOM2_1_Handler = (void*) SERCOM2_1_Handler, /* 55 SERCOM2_1 */ + .pfnSERCOM2_2_Handler = (void*) SERCOM2_2_Handler, /* 56 SERCOM2_2 */ + .pfnSERCOM2_3_Handler = (void*) SERCOM2_3_Handler, /* 57 SERCOM2_3, SERCOM2_4, SERCOM2_5, SERCOM2_6 */ + .pfnSERCOM3_0_Handler = (void*) SERCOM3_0_Handler, /* 58 SERCOM3_0 */ + .pfnSERCOM3_1_Handler = (void*) SERCOM3_1_Handler, /* 59 SERCOM3_1 */ + .pfnSERCOM3_2_Handler = (void*) SERCOM3_2_Handler, /* 60 SERCOM3_2 */ + .pfnSERCOM3_3_Handler = (void*) SERCOM3_3_Handler, /* 61 SERCOM3_3, SERCOM3_4, SERCOM3_5, SERCOM3_6 */ +#ifdef ID_SERCOM4 + .pfnSERCOM4_0_Handler = (void*) SERCOM4_0_Handler, /* 62 SERCOM4_0 */ + .pfnSERCOM4_1_Handler = (void*) SERCOM4_1_Handler, /* 63 SERCOM4_1 */ + .pfnSERCOM4_2_Handler = (void*) SERCOM4_2_Handler, /* 64 SERCOM4_2 */ + .pfnSERCOM4_3_Handler = (void*) SERCOM4_3_Handler, /* 65 SERCOM4_3, SERCOM4_4, SERCOM4_5, SERCOM4_6 */ +#else + .pvReserved62 = (void*) (0UL), /* 62 Reserved */ + .pvReserved63 = (void*) (0UL), /* 63 Reserved */ + .pvReserved64 = (void*) (0UL), /* 64 Reserved */ + .pvReserved65 = (void*) (0UL), /* 65 Reserved */ +#endif +#ifdef ID_SERCOM5 + .pfnSERCOM5_0_Handler = (void*) SERCOM5_0_Handler, /* 66 SERCOM5_0 */ + .pfnSERCOM5_1_Handler = (void*) SERCOM5_1_Handler, /* 67 SERCOM5_1 */ + .pfnSERCOM5_2_Handler = (void*) SERCOM5_2_Handler, /* 68 SERCOM5_2 */ + .pfnSERCOM5_3_Handler = (void*) SERCOM5_3_Handler, /* 69 SERCOM5_3, SERCOM5_4, SERCOM5_5, SERCOM5_6 */ +#else + .pvReserved66 = (void*) (0UL), /* 66 Reserved */ + .pvReserved67 = (void*) (0UL), /* 67 Reserved */ + .pvReserved68 = (void*) (0UL), /* 68 Reserved */ + .pvReserved69 = (void*) (0UL), /* 69 Reserved */ +#endif +#ifdef ID_SERCOM6 + .pfnSERCOM6_0_Handler = (void*) SERCOM6_0_Handler, /* 70 SERCOM6_0 */ + .pfnSERCOM6_1_Handler = (void*) SERCOM6_1_Handler, /* 71 SERCOM6_1 */ + .pfnSERCOM6_2_Handler = (void*) SERCOM6_2_Handler, /* 72 SERCOM6_2 */ + .pfnSERCOM6_3_Handler = (void*) SERCOM6_3_Handler, /* 73 SERCOM6_3, SERCOM6_4, SERCOM6_5, SERCOM6_6 */ +#else + .pvReserved70 = (void*) (0UL), /* 70 Reserved */ + .pvReserved71 = (void*) (0UL), /* 71 Reserved */ + .pvReserved72 = (void*) (0UL), /* 72 Reserved */ + .pvReserved73 = (void*) (0UL), /* 73 Reserved */ +#endif +#ifdef ID_SERCOM7 + .pfnSERCOM7_0_Handler = (void*) SERCOM7_0_Handler, /* 74 SERCOM7_0 */ + .pfnSERCOM7_1_Handler = (void*) SERCOM7_1_Handler, /* 75 SERCOM7_1 */ + .pfnSERCOM7_2_Handler = (void*) SERCOM7_2_Handler, /* 76 SERCOM7_2 */ + .pfnSERCOM7_3_Handler = (void*) SERCOM7_3_Handler, /* 77 SERCOM7_3, SERCOM7_4, SERCOM7_5, SERCOM7_6 */ +#else + .pvReserved74 = (void*) (0UL), /* 74 Reserved */ + .pvReserved75 = (void*) (0UL), /* 75 Reserved */ + .pvReserved76 = (void*) (0UL), /* 76 Reserved */ + .pvReserved77 = (void*) (0UL), /* 77 Reserved */ +#endif +#ifdef ID_CAN0 + .pfnCAN0_Handler = (void*) CAN0_Handler, /* 78 Control Area Network 0 */ +#else + .pvReserved78 = (void*) (0UL), /* 78 Reserved */ +#endif +#ifdef ID_CAN1 + .pfnCAN1_Handler = (void*) CAN1_Handler, /* 79 Control Area Network 1 */ +#else + .pvReserved79 = (void*) (0UL), /* 79 Reserved */ +#endif +#ifdef ID_USB + .pfnUSB_0_Handler = (void*) USB_0_Handler, /* 80 USB_EORSM_DNRSM, USB_EORST_RST, USB_LPMSUSP_DDISC, USB_LPM_DCONN, USB_MSOF, USB_RAMACER, USB_RXSTP_TXSTP_0, USB_RXSTP_TXSTP_1, USB_RXSTP_TXSTP_2, USB_RXSTP_TXSTP_3, USB_RXSTP_TXSTP_4, USB_RXSTP_TXSTP_5, USB_RXSTP_TXSTP_6, USB_RXSTP_TXSTP_7, USB_STALL0_STALL_0, USB_STALL0_STALL_1, USB_STALL0_STALL_2, USB_STALL0_STALL_3, USB_STALL0_STALL_4, USB_STALL0_STALL_5, USB_STALL0_STALL_6, USB_STALL0_STALL_7, USB_STALL1_0, USB_STALL1_1, USB_STALL1_2, USB_STALL1_3, USB_STALL1_4, USB_STALL1_5, USB_STALL1_6, USB_STALL1_7, USB_SUSPEND, USB_TRFAIL0_TRFAIL_0, USB_TRFAIL0_TRFAIL_1, USB_TRFAIL0_TRFAIL_2, USB_TRFAIL0_TRFAIL_3, USB_TRFAIL0_TRFAIL_4, USB_TRFAIL0_TRFAIL_5, USB_TRFAIL0_TRFAIL_6, USB_TRFAIL0_TRFAIL_7, USB_TRFAIL1_PERR_0, USB_TRFAIL1_PERR_1, USB_TRFAIL1_PERR_2, USB_TRFAIL1_PERR_3, USB_TRFAIL1_PERR_4, USB_TRFAIL1_PERR_5, USB_TRFAIL1_PERR_6, USB_TRFAIL1_PERR_7, USB_UPRSM, USB_WAKEUP */ + .pfnUSB_1_Handler = (void*) USB_1_Handler, /* 81 USB_SOF_HSOF */ + .pfnUSB_2_Handler = (void*) USB_2_Handler, /* 82 USB_TRCPT0_0, USB_TRCPT0_1, USB_TRCPT0_2, USB_TRCPT0_3, USB_TRCPT0_4, USB_TRCPT0_5, USB_TRCPT0_6, USB_TRCPT0_7 */ + .pfnUSB_3_Handler = (void*) USB_3_Handler, /* 83 USB_TRCPT1_0, USB_TRCPT1_1, USB_TRCPT1_2, USB_TRCPT1_3, USB_TRCPT1_4, USB_TRCPT1_5, USB_TRCPT1_6, USB_TRCPT1_7 */ +#else + .pvReserved80 = (void*) (0UL), /* 80 Reserved */ + .pvReserved81 = (void*) (0UL), /* 81 Reserved */ + .pvReserved82 = (void*) (0UL), /* 82 Reserved */ + .pvReserved83 = (void*) (0UL), /* 83 Reserved */ +#endif +#ifdef ID_GMAC + .pfnGMAC_Handler = (void*) GMAC_Handler, /* 84 Ethernet MAC */ +#else + .pvReserved84 = (void*) (0UL), /* 84 Reserved */ +#endif + .pfnTCC0_0_Handler = (void*) TCC0_0_Handler, /* 85 TCC0_CNT_A, TCC0_DFS_A, TCC0_ERR_A, TCC0_FAULT0_A, TCC0_FAULT1_A, TCC0_FAULTA_A, TCC0_FAULTB_A, TCC0_OVF, TCC0_TRG, TCC0_UFS_A */ + .pfnTCC0_1_Handler = (void*) TCC0_1_Handler, /* 86 TCC0_MC_0 */ + .pfnTCC0_2_Handler = (void*) TCC0_2_Handler, /* 87 TCC0_MC_1 */ + .pfnTCC0_3_Handler = (void*) TCC0_3_Handler, /* 88 TCC0_MC_2 */ + .pfnTCC0_4_Handler = (void*) TCC0_4_Handler, /* 89 TCC0_MC_3 */ + .pfnTCC0_5_Handler = (void*) TCC0_5_Handler, /* 90 TCC0_MC_4 */ + .pfnTCC0_6_Handler = (void*) TCC0_6_Handler, /* 91 TCC0_MC_5 */ + .pfnTCC1_0_Handler = (void*) TCC1_0_Handler, /* 92 TCC1_CNT_A, TCC1_DFS_A, TCC1_ERR_A, TCC1_FAULT0_A, TCC1_FAULT1_A, TCC1_FAULTA_A, TCC1_FAULTB_A, TCC1_OVF, TCC1_TRG, TCC1_UFS_A */ + .pfnTCC1_1_Handler = (void*) TCC1_1_Handler, /* 93 TCC1_MC_0 */ + .pfnTCC1_2_Handler = (void*) TCC1_2_Handler, /* 94 TCC1_MC_1 */ + .pfnTCC1_3_Handler = (void*) TCC1_3_Handler, /* 95 TCC1_MC_2 */ + .pfnTCC1_4_Handler = (void*) TCC1_4_Handler, /* 96 TCC1_MC_3 */ + .pfnTCC2_0_Handler = (void*) TCC2_0_Handler, /* 97 TCC2_CNT_A, TCC2_DFS_A, TCC2_ERR_A, TCC2_FAULT0_A, TCC2_FAULT1_A, TCC2_FAULTA_A, TCC2_FAULTB_A, TCC2_OVF, TCC2_TRG, TCC2_UFS_A */ + .pfnTCC2_1_Handler = (void*) TCC2_1_Handler, /* 98 TCC2_MC_0 */ + .pfnTCC2_2_Handler = (void*) TCC2_2_Handler, /* 99 TCC2_MC_1 */ + .pfnTCC2_3_Handler = (void*) TCC2_3_Handler, /* 100 TCC2_MC_2 */ +#ifdef ID_TCC3 + .pfnTCC3_0_Handler = (void*) TCC3_0_Handler, /* 101 TCC3_CNT_A, TCC3_DFS_A, TCC3_ERR_A, TCC3_FAULT0_A, TCC3_FAULT1_A, TCC3_FAULTA_A, TCC3_FAULTB_A, TCC3_OVF, TCC3_TRG, TCC3_UFS_A */ + .pfnTCC3_1_Handler = (void*) TCC3_1_Handler, /* 102 TCC3_MC_0 */ + .pfnTCC3_2_Handler = (void*) TCC3_2_Handler, /* 103 TCC3_MC_1 */ +#else + .pvReserved101 = (void*) (0UL), /* 101 Reserved */ + .pvReserved102 = (void*) (0UL), /* 102 Reserved */ + .pvReserved103 = (void*) (0UL), /* 103 Reserved */ +#endif +#ifdef ID_TCC4 + .pfnTCC4_0_Handler = (void*) TCC4_0_Handler, /* 104 TCC4_CNT_A, TCC4_DFS_A, TCC4_ERR_A, TCC4_FAULT0_A, TCC4_FAULT1_A, TCC4_FAULTA_A, TCC4_FAULTB_A, TCC4_OVF, TCC4_TRG, TCC4_UFS_A */ + .pfnTCC4_1_Handler = (void*) TCC4_1_Handler, /* 105 TCC4_MC_0 */ + .pfnTCC4_2_Handler = (void*) TCC4_2_Handler, /* 106 TCC4_MC_1 */ +#else + .pvReserved104 = (void*) (0UL), /* 104 Reserved */ + .pvReserved105 = (void*) (0UL), /* 105 Reserved */ + .pvReserved106 = (void*) (0UL), /* 106 Reserved */ +#endif + .pfnTC0_Handler = (void*) TC0_Handler, /* 107 Basic Timer Counter 0 */ + .pfnTC1_Handler = (void*) TC1_Handler, /* 108 Basic Timer Counter 1 */ + .pfnTC2_Handler = (void*) TC2_Handler, /* 109 Basic Timer Counter 2 */ + .pfnTC3_Handler = (void*) TC3_Handler, /* 110 Basic Timer Counter 3 */ +#ifdef ID_TC4 + .pfnTC4_Handler = (void*) TC4_Handler, /* 111 Basic Timer Counter 4 */ +#else + .pvReserved111 = (void*) (0UL), /* 111 Reserved */ +#endif +#ifdef ID_TC5 + .pfnTC5_Handler = (void*) TC5_Handler, /* 112 Basic Timer Counter 5 */ +#else + .pvReserved112 = (void*) (0UL), /* 112 Reserved */ +#endif +#ifdef ID_TC6 + .pfnTC6_Handler = (void*) TC6_Handler, /* 113 Basic Timer Counter 6 */ +#else + .pvReserved113 = (void*) (0UL), /* 113 Reserved */ +#endif +#ifdef ID_TC7 + .pfnTC7_Handler = (void*) TC7_Handler, /* 114 Basic Timer Counter 7 */ +#else + .pvReserved114 = (void*) (0UL), /* 114 Reserved */ +#endif + .pfnPDEC_0_Handler = (void*) PDEC_0_Handler, /* 115 PDEC_DIR_A, PDEC_ERR_A, PDEC_OVF, PDEC_VLC_A */ + .pfnPDEC_1_Handler = (void*) PDEC_1_Handler, /* 116 PDEC_MC_0 */ + .pfnPDEC_2_Handler = (void*) PDEC_2_Handler, /* 117 PDEC_MC_1 */ + .pfnADC0_0_Handler = (void*) ADC0_0_Handler, /* 118 ADC0_OVERRUN, ADC0_WINMON */ + .pfnADC0_1_Handler = (void*) ADC0_1_Handler, /* 119 ADC0_RESRDY */ + .pfnADC1_0_Handler = (void*) ADC1_0_Handler, /* 120 ADC1_OVERRUN, ADC1_WINMON */ + .pfnADC1_1_Handler = (void*) ADC1_1_Handler, /* 121 ADC1_RESRDY */ + .pfnAC_Handler = (void*) AC_Handler, /* 122 Analog Comparators */ + .pfnDAC_0_Handler = (void*) DAC_0_Handler, /* 123 DAC_OVERRUN_A_0, DAC_OVERRUN_A_1, DAC_UNDERRUN_A_0, DAC_UNDERRUN_A_1 */ + .pfnDAC_1_Handler = (void*) DAC_1_Handler, /* 124 DAC_EMPTY_0 */ + .pfnDAC_2_Handler = (void*) DAC_2_Handler, /* 125 DAC_EMPTY_1 */ + .pfnDAC_3_Handler = (void*) DAC_3_Handler, /* 126 DAC_RESRDY_0 */ + .pfnDAC_4_Handler = (void*) DAC_4_Handler, /* 127 DAC_RESRDY_1 */ +#ifdef ID_I2S + .pfnI2S_Handler = (void*) I2S_Handler, /* 128 Inter-IC Sound Interface */ +#else + .pvReserved128 = (void*) (0UL), /* 128 Reserved */ +#endif + .pfnPCC_Handler = (void*) PCC_Handler, /* 129 Parallel Capture Controller */ + .pfnAES_Handler = (void*) AES_Handler, /* 130 Advanced Encryption Standard */ + .pfnTRNG_Handler = (void*) TRNG_Handler, /* 131 True Random Generator */ +#ifdef ID_ICM + .pfnICM_Handler = (void*) ICM_Handler, /* 132 Integrity Check Monitor */ +#else + .pvReserved132 = (void*) (0UL), /* 132 Reserved */ +#endif +#ifdef ID_PUKCC + .pfnPUKCC_Handler = (void*) PUKCC_Handler, /* 133 PUblic-Key Cryptography Controller */ +#else + .pvReserved133 = (void*) (0UL), /* 133 Reserved */ +#endif + .pfnQSPI_Handler = (void*) QSPI_Handler, /* 134 Quad SPI interface */ +#ifdef ID_SDHC0 + .pfnSDHC0_Handler = (void*) SDHC0_Handler, /* 135 SD/MMC Host Controller 0 */ +#else + .pvReserved135 = (void*) (0UL), /* 135 Reserved */ +#endif +#ifdef ID_SDHC1 + .pfnSDHC1_Handler = (void*) SDHC1_Handler /* 136 SD/MMC Host Controller 1 */ +#else + .pvReserved136 = (void*) (0UL) /* 136 Reserved */ +#endif +}; + +/** + * \brief This is the code that gets called on processor reset. + * To initialize the device, and call the main() routine. + */ +void Reset_Handler(void) +{ + uint32_t *pSrc, *pDest; + + /* Initialize the relocate segment */ + pSrc = &_etext; + pDest = &_srelocate; + + if (pSrc != pDest) { + for (; pDest < &_erelocate;) { + *pDest++ = *pSrc++; + } + } + + /* Clear the zero segment */ + for (pDest = &_szero; pDest < &_ezero;) { + *pDest++ = 0; + } + + /* Set the vector table base address */ + pSrc = (uint32_t *) & _sfixed; + SCB->VTOR = ((uint32_t) pSrc & SCB_VTOR_TBLOFF_Msk); + +#if __FPU_USED + /* Enable FPU */ + SCB->CPACR |= (0xFu << 20); + __DSB(); + __ISB(); +#endif + + /* Initialize the C library */ + __libc_init_array(); + + /* Branch to main function */ + main(); + + /* Infinite loop */ + while (1); +} + +/** + * \brief Default interrupt handler for unused IRQs. + */ +void Dummy_Handler(void) +{ + while (1) { + } +} diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h new file mode 100644 index 0000000000..d338439867 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -0,0 +1,1177 @@ +/** + * \file + * + * \brief Commonly used includes, types and macros. + * + * Copyright (C) 2012-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef UTILS_COMPILER_H_INCLUDED +#define UTILS_COMPILER_H_INCLUDED + +/** + * \defgroup group_sam0_utils Compiler abstraction layer and code utilities + * + * Compiler abstraction layer and code utilities for Cortex-M0+ based Atmel SAM devices. + * This module provides various abstraction layers and utilities to make code compatible between different compilers. + * + * @{ + */ + +#if (defined __ICCARM__) +# include +#endif + +#include +//#include +//#include +//#include +//#include + +#ifndef __ASSEMBLY__ + +#include +#include +#include +#include + +/** + * \def UNUSED + * \brief Marking \a v as a unused parameter or value. + */ +#define UNUSED(v) (void)(v) + +/** + * \def barrier + * \brief Memory barrier + */ +#ifdef __GNUC__ +# define barrier() asm volatile("" ::: "memory") +#else +# define barrier() asm ("") +#endif + +/** + * \brief Emit the compiler pragma \a arg. + * + * \param[in] arg The pragma directive as it would appear after \e \#pragma + * (i.e. not stringified). + */ +#define COMPILER_PRAGMA(arg) _Pragma(#arg) + +/** + * \def COMPILER_PACK_SET(alignment) + * \brief Set maximum alignment for subsequent struct and union definitions to \a alignment. + */ +#define COMPILER_PACK_SET(alignment) COMPILER_PRAGMA(pack(alignment)) + +/** + * \def COMPILER_PACK_RESET() + * \brief Set default alignment for subsequent struct and union definitions. + */ +#define COMPILER_PACK_RESET() COMPILER_PRAGMA(pack()) + + +/** + * \brief Set aligned boundary. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define COMPILER_ALIGNED(a) __attribute__((__aligned__(a))) +#elif (defined __ICCARM__) +# define COMPILER_ALIGNED(a) COMPILER_PRAGMA(data_alignment = a) +#endif + +/** + * \brief Set word-aligned boundary. + */ +#if (defined __GNUC__) || defined(__CC_ARM) +#define COMPILER_WORD_ALIGNED __attribute__((__aligned__(4))) +#elif (defined __ICCARM__) +#define COMPILER_WORD_ALIGNED COMPILER_PRAGMA(data_alignment = 4) +#endif + +/** + * \def __always_inline + * \brief The function should always be inlined. + * + * This annotation instructs the compiler to ignore its inlining + * heuristics and inline the function no matter how big it thinks it + * becomes. + */ +#if defined(__CC_ARM) +# define __always_inline __forceinline +#elif (defined __GNUC__) +# define __always_inline __attribute__((__always_inline__)) +#elif (defined __ICCARM__) +# define __always_inline _Pragma("inline=forced") +#endif + +/** + * \def __no_inline + * \brief The function should never be inlined + * + * This annotation instructs the compiler to ignore its inlining + * heuristics and not inline the function no matter how small it thinks it + * becomes. + */ +#if defined(__CC_ARM) +# define __no_inline __attribute__((noinline)) +#elif (defined __GNUC__) +# define __no_inline __attribute__((noinline)) +#elif (defined __ICCARM__) +# define __no_inline _Pragma("inline=never") +#endif + + +/** \brief This macro is used to test fatal errors. + * + * The macro tests if the expression is false. If it is, a fatal error is + * detected and the application hangs up. If \c TEST_SUITE_DEFINE_ASSERT_MACRO + * is defined, a unit test version of the macro is used, to allow execution + * of further tests after a false expression. + * + * \param[in] expr Expression to evaluate and supposed to be nonzero. + */ +#if defined(_ASSERT_ENABLE_) +# if defined(TEST_SUITE_DEFINE_ASSERT_MACRO) +# include "unit_test/suite.h" +# else +# undef TEST_SUITE_DEFINE_ASSERT_MACRO +# define Assert(expr) \ + {\ + if (!(expr)) asm("BKPT #0");\ + } +# endif +#else +# define Assert(expr) ((void) 0) +#endif + +/* Define WEAK attribute */ +#if defined ( __CC_ARM ) +# define WEAK __attribute__ ((weak)) +#elif defined ( __ICCARM__ ) +# define WEAK __weak +#elif defined ( __GNUC__ ) +# define WEAK __attribute__ ((weak)) +#endif + +/* Define NO_INIT attribute */ +#if defined ( __CC_ARM ) +# define NO_INIT __attribute__((zero_init)) +#elif defined ( __ICCARM__ ) +# define NO_INIT __no_init +#elif defined ( __GNUC__ ) +# define NO_INIT __attribute__((section(".no_init"))) +#endif + +//#include "interrupt.h" + +/** \name Usual Types + * @{ */ +#ifndef __cplusplus +# if !defined(__bool_true_false_are_defined) +typedef unsigned char bool; +# endif +#endif +typedef uint16_t le16_t; +typedef uint16_t be16_t; +typedef uint32_t le32_t; +typedef uint32_t be32_t; +typedef uint32_t iram_size_t; +/** @} */ + +/** \name Aliasing Aggregate Types + * @{ */ + +/** 16-bit union. */ +typedef union +{ + int16_t s16; + uint16_t u16; + int8_t s8[2]; + uint8_t u8[2]; +} Union16; + +/** 32-bit union. */ +typedef union +{ + int32_t s32; + uint32_t u32; + int16_t s16[2]; + uint16_t u16[2]; + int8_t s8[4]; + uint8_t u8[4]; +} Union32; + +/** 64-bit union. */ +typedef union +{ + int64_t s64; + uint64_t u64; + int32_t s32[2]; + uint32_t u32[2]; + int16_t s16[4]; + uint16_t u16[4]; + int8_t s8[8]; + uint8_t u8[8]; +} Union64; + +/** Union of pointers to 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef union +{ + int64_t *s64ptr; + uint64_t *u64ptr; + int32_t *s32ptr; + uint32_t *u32ptr; + int16_t *s16ptr; + uint16_t *u16ptr; + int8_t *s8ptr; + uint8_t *u8ptr; +} UnionPtr; + +/** Union of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef union +{ + volatile int64_t *s64ptr; + volatile uint64_t *u64ptr; + volatile int32_t *s32ptr; + volatile uint32_t *u32ptr; + volatile int16_t *s16ptr; + volatile uint16_t *u16ptr; + volatile int8_t *s8ptr; + volatile uint8_t *u8ptr; +} UnionVPtr; + +/** Union of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef union +{ + const int64_t *s64ptr; + const uint64_t *u64ptr; + const int32_t *s32ptr; + const uint32_t *u32ptr; + const int16_t *s16ptr; + const uint16_t *u16ptr; + const int8_t *s8ptr; + const uint8_t *u8ptr; +} UnionCPtr; + +/** Union of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef union +{ + const volatile int64_t *s64ptr; + const volatile uint64_t *u64ptr; + const volatile int32_t *s32ptr; + const volatile uint32_t *u32ptr; + const volatile int16_t *s16ptr; + const volatile uint16_t *u16ptr; + const volatile int8_t *s8ptr; + const volatile uint8_t *u8ptr; +} UnionCVPtr; + +/** Structure of pointers to 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef struct +{ + int64_t *s64ptr; + uint64_t *u64ptr; + int32_t *s32ptr; + uint32_t *u32ptr; + int16_t *s16ptr; + uint16_t *u16ptr; + int8_t *s8ptr; + uint8_t *u8ptr; +} StructPtr; + +/** Structure of pointers to volatile 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef struct +{ + volatile int64_t *s64ptr; + volatile uint64_t *u64ptr; + volatile int32_t *s32ptr; + volatile uint32_t *u32ptr; + volatile int16_t *s16ptr; + volatile uint16_t *u16ptr; + volatile int8_t *s8ptr; + volatile uint8_t *u8ptr; +} StructVPtr; + +/** Structure of pointers to constant 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef struct +{ + const int64_t *s64ptr; + const uint64_t *u64ptr; + const int32_t *s32ptr; + const uint32_t *u32ptr; + const int16_t *s16ptr; + const uint16_t *u16ptr; + const int8_t *s8ptr; + const uint8_t *u8ptr; +} StructCPtr; + +/** Structure of pointers to constant volatile 64-, 32-, 16- and 8-bit unsigned integers. */ +typedef struct +{ + const volatile int64_t *s64ptr; + const volatile uint64_t *u64ptr; + const volatile int32_t *s32ptr; + const volatile uint32_t *u32ptr; + const volatile int16_t *s16ptr; + const volatile uint16_t *u16ptr; + const volatile int8_t *s8ptr; + const volatile uint8_t *u8ptr; +} StructCVPtr; + +/** @} */ + +#endif /* #ifndef __ASSEMBLY__ */ + +/** \name Usual Constants + * @{ */ +//kmod #define DISABLE 0 +//kmod #define ENABLE 1 + +#ifndef __cplusplus +# if !defined(__bool_true_false_are_defined) +# define false 0 +# define true 1 +# endif +#endif +/** @} */ + +#ifndef __ASSEMBLY__ + +/** \name Optimization Control + * @{ */ + +/** + * \def likely(exp) + * \brief The expression \a exp is likely to be true + */ +#if !defined(likely) || defined(__DOXYGEN__) +# define likely(exp) (exp) +#endif + +/** + * \def unlikely(exp) + * \brief The expression \a exp is unlikely to be true + */ +#if !defined(unlikely) || defined(__DOXYGEN__) +# define unlikely(exp) (exp) +#endif + +/** + * \def is_constant(exp) + * \brief Determine if an expression evaluates to a constant value. + * + * \param[in] exp Any expression + * + * \return true if \a exp is constant, false otherwise. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define is_constant(exp) __builtin_constant_p(exp) +#else +# define is_constant(exp) (0) +#endif + +/** @} */ + +/** \name Bit-Field Handling + * @{ */ + +/** \brief Reads the bits of a value specified by a given bit-mask. + * + * \param[in] value Value to read bits from. + * \param[in] mask Bit-mask indicating bits to read. + * + * \return Read bits. + */ +#define Rd_bits( value, mask) ((value) & (mask)) + +/** \brief Writes the bits of a C lvalue specified by a given bit-mask. + * + * \param[in] lvalue C lvalue to write bits to. + * \param[in] mask Bit-mask indicating bits to write. + * \param[in] bits Bits to write. + * + * \return Resulting value with written bits. + */ +#define Wr_bits(lvalue, mask, bits) ((lvalue) = ((lvalue) & ~(mask)) |\ + ((bits ) & (mask))) + +/** \brief Tests the bits of a value specified by a given bit-mask. + * + * \param[in] value Value of which to test bits. + * \param[in] mask Bit-mask indicating bits to test. + * + * \return \c 1 if at least one of the tested bits is set, else \c 0. + */ +#define Tst_bits( value, mask) (Rd_bits(value, mask) != 0) + +/** \brief Clears the bits of a C lvalue specified by a given bit-mask. + * + * \param[in] lvalue C lvalue of which to clear bits. + * \param[in] mask Bit-mask indicating bits to clear. + * + * \return Resulting value with cleared bits. + */ +#define Clr_bits(lvalue, mask) ((lvalue) &= ~(mask)) + +/** \brief Sets the bits of a C lvalue specified by a given bit-mask. + * + * \param[in] lvalue C lvalue of which to set bits. + * \param[in] mask Bit-mask indicating bits to set. + * + * \return Resulting value with set bits. + */ +#define Set_bits(lvalue, mask) ((lvalue) |= (mask)) + +/** \brief Toggles the bits of a C lvalue specified by a given bit-mask. + * + * \param[in] lvalue C lvalue of which to toggle bits. + * \param[in] mask Bit-mask indicating bits to toggle. + * + * \return Resulting value with toggled bits. + */ +#define Tgl_bits(lvalue, mask) ((lvalue) ^= (mask)) + +/** \brief Reads the bit-field of a value specified by a given bit-mask. + * + * \param[in] value Value to read a bit-field from. + * \param[in] mask Bit-mask indicating the bit-field to read. + * + * \return Read bit-field. + */ +#define Rd_bitfield( value, mask) (Rd_bits( value, mask) >> ctz(mask)) + +/** \brief Writes the bit-field of a C lvalue specified by a given bit-mask. + * + * \param[in] lvalue C lvalue to write a bit-field to. + * \param[in] mask Bit-mask indicating the bit-field to write. + * \param[in] bitfield Bit-field to write. + * + * \return Resulting value with written bit-field. + */ +#define Wr_bitfield(lvalue, mask, bitfield) (Wr_bits(lvalue, mask, (uint32_t)(bitfield) << ctz(mask))) + +/** @} */ + + +/** \name Zero-Bit Counting + * + * Under GCC, __builtin_clz and __builtin_ctz behave like macros when + * applied to constant expressions (values known at compile time), so they are + * more optimized than the use of the corresponding assembly instructions and + * they can be used as constant expressions e.g. to initialize objects having + * static storage duration, and like the corresponding assembly instructions + * when applied to non-constant expressions (values unknown at compile time), so + * they are more optimized than an assembly periphrasis. Hence, clz and ctz + * ensure a possible and optimized behavior for both constant and non-constant + * expressions. + * + * @{ */ + +/** \brief Counts the leading zero bits of the given value considered as a 32-bit integer. + * + * \param[in] u Value of which to count the leading zero bits. + * + * \return The count of leading zero bits in \a u. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define clz(u) ((u) ? __builtin_clz(u) : 32) +#else +# define clz(u) (((u) == 0) ? 32 : \ + ((u) & (1ul << 31)) ? 0 : \ + ((u) & (1ul << 30)) ? 1 : \ + ((u) & (1ul << 29)) ? 2 : \ + ((u) & (1ul << 28)) ? 3 : \ + ((u) & (1ul << 27)) ? 4 : \ + ((u) & (1ul << 26)) ? 5 : \ + ((u) & (1ul << 25)) ? 6 : \ + ((u) & (1ul << 24)) ? 7 : \ + ((u) & (1ul << 23)) ? 8 : \ + ((u) & (1ul << 22)) ? 9 : \ + ((u) & (1ul << 21)) ? 10 : \ + ((u) & (1ul << 20)) ? 11 : \ + ((u) & (1ul << 19)) ? 12 : \ + ((u) & (1ul << 18)) ? 13 : \ + ((u) & (1ul << 17)) ? 14 : \ + ((u) & (1ul << 16)) ? 15 : \ + ((u) & (1ul << 15)) ? 16 : \ + ((u) & (1ul << 14)) ? 17 : \ + ((u) & (1ul << 13)) ? 18 : \ + ((u) & (1ul << 12)) ? 19 : \ + ((u) & (1ul << 11)) ? 20 : \ + ((u) & (1ul << 10)) ? 21 : \ + ((u) & (1ul << 9)) ? 22 : \ + ((u) & (1ul << 8)) ? 23 : \ + ((u) & (1ul << 7)) ? 24 : \ + ((u) & (1ul << 6)) ? 25 : \ + ((u) & (1ul << 5)) ? 26 : \ + ((u) & (1ul << 4)) ? 27 : \ + ((u) & (1ul << 3)) ? 28 : \ + ((u) & (1ul << 2)) ? 29 : \ + ((u) & (1ul << 1)) ? 30 : \ + 31) +#endif + +/** \brief Counts the trailing zero bits of the given value considered as a 32-bit integer. + * + * \param[in] u Value of which to count the trailing zero bits. + * + * \return The count of trailing zero bits in \a u. + */ +#if (defined __GNUC__) || (defined __CC_ARM) +# define ctz(u) ((u) ? __builtin_ctz(u) : 32) +#else +# define ctz(u) ((u) & (1ul << 0) ? 0 : \ + (u) & (1ul << 1) ? 1 : \ + (u) & (1ul << 2) ? 2 : \ + (u) & (1ul << 3) ? 3 : \ + (u) & (1ul << 4) ? 4 : \ + (u) & (1ul << 5) ? 5 : \ + (u) & (1ul << 6) ? 6 : \ + (u) & (1ul << 7) ? 7 : \ + (u) & (1ul << 8) ? 8 : \ + (u) & (1ul << 9) ? 9 : \ + (u) & (1ul << 10) ? 10 : \ + (u) & (1ul << 11) ? 11 : \ + (u) & (1ul << 12) ? 12 : \ + (u) & (1ul << 13) ? 13 : \ + (u) & (1ul << 14) ? 14 : \ + (u) & (1ul << 15) ? 15 : \ + (u) & (1ul << 16) ? 16 : \ + (u) & (1ul << 17) ? 17 : \ + (u) & (1ul << 18) ? 18 : \ + (u) & (1ul << 19) ? 19 : \ + (u) & (1ul << 20) ? 20 : \ + (u) & (1ul << 21) ? 21 : \ + (u) & (1ul << 22) ? 22 : \ + (u) & (1ul << 23) ? 23 : \ + (u) & (1ul << 24) ? 24 : \ + (u) & (1ul << 25) ? 25 : \ + (u) & (1ul << 26) ? 26 : \ + (u) & (1ul << 27) ? 27 : \ + (u) & (1ul << 28) ? 28 : \ + (u) & (1ul << 29) ? 29 : \ + (u) & (1ul << 30) ? 30 : \ + (u) & (1ul << 31) ? 31 : \ + 32) +#endif + +/** @} */ + + +/** \name Bit Reversing + * @{ */ + +/** \brief Reverses the bits of \a u8. + * + * \param[in] u8 U8 of which to reverse the bits. + * + * \return Value resulting from \a u8 with reversed bits. + */ +#define bit_reverse8(u8) ((U8)(bit_reverse32((U8)(u8)) >> 24)) + +/** \brief Reverses the bits of \a u16. + * + * \param[in] u16 U16 of which to reverse the bits. + * + * \return Value resulting from \a u16 with reversed bits. + */ +#define bit_reverse16(u16) ((uint16_t)(bit_reverse32((uint16_t)(u16)) >> 16)) + +/** \brief Reverses the bits of \a u32. + * + * \param[in] u32 U32 of which to reverse the bits. + * + * \return Value resulting from \a u32 with reversed bits. + */ +#define bit_reverse32(u32) __RBIT(u32) + +/** \brief Reverses the bits of \a u64. + * + * \param[in] u64 U64 of which to reverse the bits. + * + * \return Value resulting from \a u64 with reversed bits. + */ +#define bit_reverse64(u64) ((uint64_t)(((uint64_t)bit_reverse32((uint64_t)(u64) >> 32)) |\ + ((uint64_t)bit_reverse32((uint64_t)(u64)) << 32))) + +/** @} */ + + +/** \name Alignment + * @{ */ + +/** \brief Tests alignment of the number \a val with the \a n boundary. + * + * \param[in] val Input value. + * \param[in] n Boundary. + * + * \return \c 1 if the number \a val is aligned with the \a n boundary, else \c 0. + */ +#define Test_align(val, n) (!Tst_bits( val, (n) - 1 ) ) + +/** \brief Gets alignment of the number \a val with respect to the \a n boundary. + * + * \param[in] val Input value. + * \param[in] n Boundary. + * + * \return Alignment of the number \a val with respect to the \a n boundary. + */ +#define Get_align(val, n) ( Rd_bits( val, (n) - 1 ) ) + +/** \brief Sets alignment of the lvalue number \a lval to \a alg with respect to the \a n boundary. + * + * \param[in] lval Input/output lvalue. + * \param[in] n Boundary. + * \param[in] alg Alignment. + * + * \return New value of \a lval resulting from its alignment set to \a alg with respect to the \a n boundary. + */ +#define Set_align(lval, n, alg) ( Wr_bits(lval, (n) - 1, alg) ) + +/** \brief Aligns the number \a val with the upper \a n boundary. + * + * \param[in] val Input value. + * \param[in] n Boundary. + * + * \return Value resulting from the number \a val aligned with the upper \a n boundary. + */ +#define Align_up( val, n) (((val) + ((n) - 1)) & ~((n) - 1)) + +/** \brief Aligns the number \a val with the lower \a n boundary. + * + * \param[in] val Input value. + * \param[in] n Boundary. + * + * \return Value resulting from the number \a val aligned with the lower \a n boundary. + */ +#define Align_down(val, n) ( (val) & ~((n) - 1)) + +/** @} */ + + +/** \name Mathematics + * + * The same considerations as for clz and ctz apply here but GCC does not + * provide built-in functions to access the assembly instructions abs, min and + * max and it does not produce them by itself in most cases, so two sets of + * macros are defined here: + * - Abs, Min and Max to apply to constant expressions (values known at + * compile time); + * - abs, min and max to apply to non-constant expressions (values unknown at + * compile time), abs is found in stdlib.h. + * + * @{ */ + +/** \brief Takes the absolute value of \a a. + * + * \param[in] a Input value. + * + * \return Absolute value of \a a. + * + * \note More optimized if only used with values known at compile time. + */ +#define Abs(a) (((a) < 0 ) ? -(a) : (a)) + +#ifndef __cplusplus +/** \brief Takes the minimal value of \a a and \a b. + * + * \param[in] a Input value. + * \param[in] b Input value. + * + * \return Minimal value of \a a and \a b. + * + * \note More optimized if only used with values known at compile time. + */ +#define Min(a, b) (((a) < (b)) ? (a) : (b)) + +/** \brief Takes the maximal value of \a a and \a b. + * + * \param[in] a Input value. + * \param[in] b Input value. + * + * \return Maximal value of \a a and \a b. + * + * \note More optimized if only used with values known at compile time. + */ +#define Max(a, b) (((a) > (b)) ? (a) : (b)) + +/** \brief Takes the minimal value of \a a and \a b. + * + * \param[in] a Input value. + * \param[in] b Input value. + * + * \return Minimal value of \a a and \a b. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define min(a, b) Min(a, b) + +/** \brief Takes the maximal value of \a a and \a b. + * + * \param[in] a Input value. + * \param[in] b Input value. + * + * \return Maximal value of \a a and \a b. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define max(a, b) Max(a, b) +#endif + +/** @} */ + + +/** \brief Calls the routine at address \a addr. + * + * It generates a long call opcode. + * + * For example, `Long_call(0x80000000)' generates a software reset on a UC3 if + * it is invoked from the CPU supervisor mode. + * + * \param[in] addr Address of the routine to call. + * + * \note It may be used as a long jump opcode in some special cases. + */ +#define Long_call(addr) ((*(void (*)(void))(addr))()) + + +/** \name MCU Endianism Handling + * ARM is MCU little endian. + * + * @{ */ +#define BE16(x) swap16(x) +#define LE16(x) (x) + +#define le16_to_cpu(x) (x) +#define cpu_to_le16(x) (x) +#define LE16_TO_CPU(x) (x) +#define CPU_TO_LE16(x) (x) + +#define be16_to_cpu(x) swap16(x) +#define cpu_to_be16(x) swap16(x) +#define BE16_TO_CPU(x) swap16(x) +#define CPU_TO_BE16(x) swap16(x) + +#define le32_to_cpu(x) (x) +#define cpu_to_le32(x) (x) +#define LE32_TO_CPU(x) (x) +#define CPU_TO_LE32(x) (x) + +#define be32_to_cpu(x) swap32(x) +#define cpu_to_be32(x) swap32(x) +#define BE32_TO_CPU(x) swap32(x) +#define CPU_TO_BE32(x) swap32(x) +/** @} */ + + +/** \name Endianism Conversion + * + * The same considerations as for clz and ctz apply here but GCC's + * __builtin_bswap_32 and __builtin_bswap_64 do not behave like macros when + * applied to constant expressions, so two sets of macros are defined here: + * - Swap16, Swap32 and Swap64 to apply to constant expressions (values known + * at compile time); + * - swap16, swap32 and swap64 to apply to non-constant expressions (values + * unknown at compile time). + * + * @{ */ + +/** \brief Toggles the endianism of \a u16 (by swapping its bytes). + * + * \param[in] u16 U16 of which to toggle the endianism. + * + * \return Value resulting from \a u16 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap16(u16) ((uint16_t)(((uint16_t)(u16) >> 8) |\ + ((uint16_t)(u16) << 8))) + +/** \brief Toggles the endianism of \a u32 (by swapping its bytes). + * + * \param[in] u32 U32 of which to toggle the endianism. + * + * \return Value resulting from \a u32 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap32(u32) ((uint32_t)(((uint32_t)Swap16((uint32_t)(u32) >> 16)) |\ + ((uint32_t)Swap16((uint32_t)(u32)) << 16))) + +/** \brief Toggles the endianism of \a u64 (by swapping its bytes). + * + * \param[in] u64 U64 of which to toggle the endianism. + * + * \return Value resulting from \a u64 with toggled endianism. + * + * \note More optimized if only used with values known at compile time. + */ +#define Swap64(u64) ((uint64_t)(((uint64_t)Swap32((uint64_t)(u64) >> 32)) |\ + ((uint64_t)Swap32((uint64_t)(u64)) << 32))) + +/** \brief Toggles the endianism of \a u16 (by swapping its bytes). + * + * \param[in] u16 U16 of which to toggle the endianism. + * + * \return Value resulting from \a u16 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#define swap16(u16) Swap16(u16) + +/** \brief Toggles the endianism of \a u32 (by swapping its bytes). + * + * \param[in] u32 U32 of which to toggle the endianism. + * + * \return Value resulting from \a u32 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#if (defined __GNUC__) +# define swap32(u32) ((uint32_t)__builtin_bswap32((uint32_t)(u32))) +#else +# define swap32(u32) Swap32(u32) +#endif + +/** \brief Toggles the endianism of \a u64 (by swapping its bytes). + * + * \param[in] u64 U64 of which to toggle the endianism. + * + * \return Value resulting from \a u64 with toggled endianism. + * + * \note More optimized if only used with values unknown at compile time. + */ +#if (defined __GNUC__) +# define swap64(u64) ((uint64_t)__builtin_bswap64((uint64_t)(u64))) +#else +# define swap64(u64) ((uint64_t)(((uint64_t)swap32((uint64_t)(u64) >> 32)) |\ + ((uint64_t)swap32((uint64_t)(u64)) << 32))) +#endif + +/** @} */ + + +/** \name Target Abstraction + * + * @{ */ + +#define _GLOBEXT_ extern /**< extern storage-class specifier. */ +#define _CONST_TYPE_ const /**< const type qualifier. */ +#define _MEM_TYPE_SLOW_ /**< Slow memory type. */ +#define _MEM_TYPE_MEDFAST_ /**< Fairly fast memory type. */ +#define _MEM_TYPE_FAST_ /**< Fast memory type. */ + +#define memcmp_ram2ram memcmp /**< Target-specific memcmp of RAM to RAM. */ +#define memcmp_code2ram memcmp /**< Target-specific memcmp of RAM to NVRAM. */ +#define memcpy_ram2ram memcpy /**< Target-specific memcpy from RAM to RAM. */ +#define memcpy_code2ram memcpy /**< Target-specific memcpy from NVRAM to RAM. */ + +/** @} */ + +/** + * \brief Calculate \f$ \left\lceil \frac{a}{b} \right\rceil \f$ using + * integer arithmetic. + * + * \param[in] a An integer + * \param[in] b Another integer + * + * \return (\a a / \a b) rounded up to the nearest integer. + */ +#define div_ceil(a, b) (((a) + (b) - 1) / (b)) + +#endif /* #ifndef __ASSEMBLY__ */ +#ifdef __ICCARM__ +/** \name Compiler Keywords + * + * Port of some keywords from GCC to IAR Embedded Workbench. + * + * @{ */ + +#define __asm__ asm +#define __inline__ inline +#define __volatile__ + +/** @} */ + +#endif + +#define FUNC_PTR void * +/** + * \def unused + * \brief Marking \a v as a unused parameter or value. + */ +#define unused(v) do { (void)(v); } while(0) + +/* Define RAMFUNC attribute */ +#if defined ( __CC_ARM ) /* Keil uVision 4 */ +# define RAMFUNC __attribute__ ((section(".ramfunc"))) +#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ +# define RAMFUNC __ramfunc +#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ +# define RAMFUNC __attribute__ ((section(".ramfunc"))) +#endif + +/* Define OPTIMIZE_HIGH attribute */ +#if defined ( __CC_ARM ) /* Keil uVision 4 */ +# define OPTIMIZE_HIGH _Pragma("O3") +#elif defined ( __ICCARM__ ) /* IAR Ewarm 5.41+ */ +# define OPTIMIZE_HIGH _Pragma("optimize=high") +#elif defined ( __GNUC__ ) /* GCC CS3 2009q3-68 */ +# define OPTIMIZE_HIGH __attribute__((optimize("s"))) +#endif +//kmod #define PASS 0 +//kmod #define FAIL 1 +//kmod #define LOW 0 +//kmod #define HIGH 1 + +typedef int8_t S8 ; //!< 8-bit signed integer. +typedef uint8_t U8 ; //!< 8-bit unsigned integer. +typedef int16_t S16; //!< 16-bit signed integer. +typedef uint16_t U16; //!< 16-bit unsigned integer. +typedef int32_t S32; //!< 32-bit signed integer. +typedef uint32_t U32; //!< 32-bit unsigned integer. +typedef int64_t S64; //!< 64-bit signed integer. +typedef uint64_t U64; //!< 64-bit unsigned integer. +typedef float F32; //!< 32-bit floating-point number. +typedef double F64; //!< 64-bit floating-point number. + +#define MSB(u16) (((U8 *)&(u16))[1]) //!< Most significant byte of \a u16. +#define LSB(u16) (((U8 *)&(u16))[0]) //!< Least significant byte of \a u16. + +#define MSH(u32) (((U16 *)&(u32))[1]) //!< Most significant half-word of \a u32. +#define LSH(u32) (((U16 *)&(u32))[0]) //!< Least significant half-word of \a u32. +#define MSB0W(u32) (((U8 *)&(u32))[3]) //!< Most significant byte of 1st rank of \a u32. +#define MSB1W(u32) (((U8 *)&(u32))[2]) //!< Most significant byte of 2nd rank of \a u32. +#define MSB2W(u32) (((U8 *)&(u32))[1]) //!< Most significant byte of 3rd rank of \a u32. +#define MSB3W(u32) (((U8 *)&(u32))[0]) //!< Most significant byte of 4th rank of \a u32. +#define LSB3W(u32) MSB0W(u32) //!< Least significant byte of 4th rank of \a u32. +#define LSB2W(u32) MSB1W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB1W(u32) MSB2W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB0W(u32) MSB3W(u32) //!< Least significant byte of 1st rank of \a u32. + +#define MSW(u64) (((U32 *)&(u64))[1]) //!< Most significant word of \a u64. +#define LSW(u64) (((U32 *)&(u64))[0]) //!< Least significant word of \a u64. +#define MSH0(u64) (((U16 *)&(u64))[3]) //!< Most significant half-word of 1st rank of \a u64. +#define MSH1(u64) (((U16 *)&(u64))[2]) //!< Most significant half-word of 2nd rank of \a u64. +#define MSH2(u64) (((U16 *)&(u64))[1]) //!< Most significant half-word of 3rd rank of \a u64. +#define MSH3(u64) (((U16 *)&(u64))[0]) //!< Most significant half-word of 4th rank of \a u64. +#define LSH3(u64) MSH0(u64) //!< Least significant half-word of 4th rank of \a u64. +#define LSH2(u64) MSH1(u64) //!< Least significant half-word of 3rd rank of \a u64. +#define LSH1(u64) MSH2(u64) //!< Least significant half-word of 2nd rank of \a u64. +#define LSH0(u64) MSH3(u64) //!< Least significant half-word of 1st rank of \a u64. +#define MSB0D(u64) (((U8 *)&(u64))[7]) //!< Most significant byte of 1st rank of \a u64. +#define MSB1D(u64) (((U8 *)&(u64))[6]) //!< Most significant byte of 2nd rank of \a u64. +#define MSB2D(u64) (((U8 *)&(u64))[5]) //!< Most significant byte of 3rd rank of \a u64. +#define MSB3D(u64) (((U8 *)&(u64))[4]) //!< Most significant byte of 4th rank of \a u64. +#define MSB4D(u64) (((U8 *)&(u64))[3]) //!< Most significant byte of 5th rank of \a u64. +#define MSB5D(u64) (((U8 *)&(u64))[2]) //!< Most significant byte of 6th rank of \a u64. +#define MSB6D(u64) (((U8 *)&(u64))[1]) //!< Most significant byte of 7th rank of \a u64. +#define MSB7D(u64) (((U8 *)&(u64))[0]) //!< Most significant byte of 8th rank of \a u64. +#define LSB7D(u64) MSB0D(u64) //!< Least significant byte of 8th rank of \a u64. +#define LSB6D(u64) MSB1D(u64) //!< Least significant byte of 7th rank of \a u64. +#define LSB5D(u64) MSB2D(u64) //!< Least significant byte of 6th rank of \a u64. +#define LSB4D(u64) MSB3D(u64) //!< Least significant byte of 5th rank of \a u64. +#define LSB3D(u64) MSB4D(u64) //!< Least significant byte of 4th rank of \a u64. +#define LSB2D(u64) MSB5D(u64) //!< Least significant byte of 3rd rank of \a u64. +#define LSB1D(u64) MSB6D(u64) //!< Least significant byte of 2nd rank of \a u64. +#define LSB0D(u64) MSB7D(u64) //!< Least significant byte of 1st rank of \a u64. + +#define LSB0(u32) LSB0W(u32) //!< Least significant byte of 1st rank of \a u32. +#define LSB1(u32) LSB1W(u32) //!< Least significant byte of 2nd rank of \a u32. +#define LSB2(u32) LSB2W(u32) //!< Least significant byte of 3rd rank of \a u32. +#define LSB3(u32) LSB3W(u32) //!< Least significant byte of 4th rank of \a u32. +#define MSB3(u32) MSB3W(u32) //!< Most significant byte of 4th rank of \a u32. +#define MSB2(u32) MSB2W(u32) //!< Most significant byte of 3rd rank of \a u32. +#define MSB1(u32) MSB1W(u32) //!< Most significant byte of 2nd rank of \a u32. +#define MSB0(u32) MSB0W(u32) //!< Most significant byte of 1st rank of \a u32. + +#if defined(__ICCARM__) +#define SHORTENUM __packed +#elif defined(__GNUC__) +#define SHORTENUM __attribute__((packed)) +#endif + +/* No operation */ +#if defined(__ICCARM__) +#define nop() __no_operation() +#elif defined(__GNUC__) +#define nop() (__NOP()) +#endif + +#define FLASH_DECLARE(x) const x +#define FLASH_EXTERN(x) extern const x +#define PGM_READ_BYTE(x) *(x) +#define PGM_READ_WORD(x) *(x) +#define MEMCPY_ENDIAN memcpy +#define PGM_READ_BLOCK(dst, src, len) memcpy((dst), (src), (len)) + +/*Defines the Flash Storage for the request and response of MAC*/ +#define CMD_ID_OCTET (0) + +/* Converting of values from CPU endian to little endian. */ +#define CPU_ENDIAN_TO_LE16(x) (x) +#define CPU_ENDIAN_TO_LE32(x) (x) +#define CPU_ENDIAN_TO_LE64(x) (x) + +/* Converting of values from little endian to CPU endian. */ +#define LE16_TO_CPU_ENDIAN(x) (x) +#define LE32_TO_CPU_ENDIAN(x) (x) +#define LE64_TO_CPU_ENDIAN(x) (x) + +/* Converting of constants from little endian to CPU endian. */ +#define CLE16_TO_CPU_ENDIAN(x) (x) +#define CLE32_TO_CPU_ENDIAN(x) (x) +#define CLE64_TO_CPU_ENDIAN(x) (x) + +/* Converting of constants from CPU endian to little endian. */ +#define CCPU_ENDIAN_TO_LE16(x) (x) +#define CCPU_ENDIAN_TO_LE32(x) (x) +#define CCPU_ENDIAN_TO_LE64(x) (x) + +#define ADDR_COPY_DST_SRC_16(dst, src) ((dst) = (src)) +#define ADDR_COPY_DST_SRC_64(dst, src) ((dst) = (src)) + +/** + * @brief Converts a 64-Bit value into a 8 Byte array + * + * @param[in] value 64-Bit value + * @param[out] data Pointer to the 8 Byte array to be updated with 64-Bit value + * @ingroup apiPalApi + */ +static inline void convert_64_bit_to_byte_array(uint64_t value, uint8_t *data) +{ + uint8_t index = 0; + + while (index < 8) + { + data[index++] = value & 0xFF; + value = value >> 8; + } +} + +/** + * @brief Converts a 16-Bit value into a 2 Byte array + * + * @param[in] value 16-Bit value + * @param[out] data Pointer to the 2 Byte array to be updated with 16-Bit value + * @ingroup apiPalApi + */ +static inline void convert_16_bit_to_byte_array(uint16_t value, uint8_t *data) +{ + data[0] = value & 0xFF; + data[1] = (value >> 8) & 0xFF; +} + +/* Converts a 16-Bit value into a 2 Byte array */ +static inline void convert_spec_16_bit_to_byte_array(uint16_t value, uint8_t *data) +{ + data[0] = value & 0xFF; + data[1] = (value >> 8) & 0xFF; +} + +/* Converts a 16-Bit value into a 2 Byte array */ +static inline void convert_16_bit_to_byte_address(uint16_t value, uint8_t *data) +{ + data[0] = value & 0xFF; + data[1] = (value >> 8) & 0xFF; +} + +/* + * @brief Converts a 2 Byte array into a 16-Bit value + * + * @param data Specifies the pointer to the 2 Byte array + * + * @return 16-Bit value + * @ingroup apiPalApi + */ +static inline uint16_t convert_byte_array_to_16_bit(uint8_t *data) +{ + return (data[0] | ((uint16_t)data[1] << 8)); +} + +/* Converts a 4 Byte array into a 32-Bit value */ +static inline uint32_t convert_byte_array_to_32_bit(uint8_t *data) +{ + union + { + uint32_t u32; + uint8_t u8[4]; + } long_addr; + + uint8_t index; + + for (index = 0; index < 4; index++) + { + long_addr.u8[index] = *data++; + } + + return long_addr.u32; +} + +/** + * @brief Converts a 8 Byte array into a 64-Bit value + * + * @param data Specifies the pointer to the 8 Byte array + * + * @return 64-Bit value + * @ingroup apiPalApi + */ +static inline uint64_t convert_byte_array_to_64_bit(uint8_t *data) +{ + union + { + uint64_t u64; + uint8_t u8[8]; + } long_addr; + + uint8_t index; + + for (index = 0; index < 8; index++) + { + long_addr.u8[index] = *data++; + } + + return long_addr.u64; +} + +/** @} */ + +#endif /* UTILS_COMPILER_H_INCLUDED */ diff --git a/tmk_core/protocol/arm_atsam/usb/conf_usb.h b/tmk_core/protocol/arm_atsam/usb/conf_usb.h new file mode 100644 index 0000000000..8f0f472687 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/conf_usb.h @@ -0,0 +1,163 @@ +/** + * \file + * + * \brief USB configuration file + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _CONF_USB_H_ +#define _CONF_USB_H_ + +#include "compiler.h" +#include "udi_device_conf.h" + +#define UDI_CDC_DEFAULT_RATE 115200 +#define UDI_CDC_DEFAULT_STOPBITS CDC_STOP_BITS_1 +#define UDI_CDC_DEFAULT_PARITY CDC_PAR_NONE +#define UDI_CDC_DEFAULT_DATABITS 8 + +//! Device definition (mandatory) +#define USB_DEVICE_VENDOR_ID VENDOR_ID +#define USB_DEVICE_PRODUCT_ID PRODUCT_ID +#define USB_DEVICE_VERSION DEVICE_VER +#define USB_DEVICE_POWER 500 // Consumption on Vbus line (mA) +#define USB_DEVICE_ATTR (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) +// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_BUS_POWERED) +// (USB_CONFIG_ATTR_REMOTE_WAKEUP|USB_CONFIG_ATTR_SELF_POWERED) +// (USB_CONFIG_ATTR_SELF_POWERED) +// (USB_CONFIG_ATTR_BUS_POWERED) + +//! USB Device string definitions (Optional) +#define USB_DEVICE_MANUFACTURE_NAME MANUFACTURER +#define USB_DEVICE_PRODUCT_NAME PRODUCT +#define USB_DEVICE_SERIAL_NAME SERIAL_NUM + +//Comment out USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL to prevent ROM lookup of factory programmed serial number +#define USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL + +/** + * Device speeds support + * @{ + */ +//! To define a Low speed device +//#define USB_DEVICE_LOW_SPEED + +//! To authorize the High speed +#if (UC3A3||UC3A4) +//#define USB_DEVICE_HS_SUPPORT +#elif (SAM3XA||SAM3U) +//#define USB_DEVICE_HS_SUPPORT +#endif +//@} + +/** + * USB Device Callbacks definitions (Optional) + * @{ + */ +#define UDC_VBUS_EVENT(b_vbus_high) +#define UDC_SOF_EVENT() main_sof_action() +#define UDC_SUSPEND_EVENT() main_suspend_action() +#define UDC_RESUME_EVENT() main_resume_action() +//! Mandatory when USB_DEVICE_ATTR authorizes remote wakeup feature +#define UDC_REMOTEWAKEUP_ENABLE() main_remotewakeup_enable() +#define UDC_REMOTEWAKEUP_DISABLE() main_remotewakeup_disable() +//! When a extra string descriptor must be supported +//! other than manufacturer, product and serial string +// #define UDC_GET_EXTRA_STRING() +//@} + +//@} + + +/** + * USB Interface Configuration + * @{ + */ +/** + * Configuration of HID Keyboard interface + * @{ + */ +//! Interface callback definition +#ifdef KBD +#define UDI_HID_KBD_ENABLE_EXT() main_kbd_enable() +#define UDI_HID_KBD_DISABLE_EXT() main_kbd_disable() +//#define UDI_HID_KBD_CHANGE_LED(value) ui_kbd_led(value) +#endif + +#ifdef NKRO +#define UDI_HID_NKRO_ENABLE_EXT() main_nkro_enable() +#define UDI_HID_NKRO_DISABLE_EXT() main_nkro_disable() +//#define UDI_HID_NKRO_CHANGE_LED(value) ui_kbd_led(value) +#endif + +#ifdef EXK +#define UDI_HID_EXK_ENABLE_EXT() main_exk_enable() +#define UDI_HID_EXK_DISABLE_EXT() main_exk_disable() +#endif + +#ifdef MOU +#define UDI_HID_MOU_ENABLE_EXT() main_mou_enable() +#define UDI_HID_MOU_DISABLE_EXT() main_mou_disable() +#endif + +#ifdef RAW +#define UDI_HID_RAW_ENABLE_EXT() main_raw_enable() +#define UDI_HID_RAW_DISABLE_EXT() main_raw_disable() +#endif + + +//@} +//@} + + +/** + * USB Device Driver Configuration + * @{ + */ +//@} + +//! The includes of classes and other headers must be done at the end of this file to avoid compile error +#include "udi_hid_kbd_conf.h" +#include "usb_main.h" +#include "ui.h" + +#endif // _CONF_USB_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/main_usb.c b/tmk_core/protocol/arm_atsam/usb/main_usb.c new file mode 100644 index 0000000000..e943cbcdcd --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/main_usb.c @@ -0,0 +1,118 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "samd51j18a.h" +#include "conf_usb.h" +#include "udd.h" + +uint8_t keyboard_protocol = 1; + +void main_suspend_action(void) +{ + ui_powerdown(); +} + +void main_resume_action(void) +{ + ui_wakeup(); +} + +void main_sof_action(void) +{ + ui_process(udd_get_frame_number()); +} + +void main_remotewakeup_enable(void) +{ + ui_wakeup_enable(); +} + +void main_remotewakeup_disable(void) +{ + ui_wakeup_disable(); +} + +#ifdef KBD +volatile bool main_b_kbd_enable = false; +bool main_kbd_enable(void) +{ + main_b_kbd_enable = true; + return true; +} + +void main_kbd_disable(void) +{ + main_b_kbd_enable = false; +} +#endif + +#ifdef NKRO +volatile bool main_b_nkro_enable = false; +bool main_nkro_enable(void) +{ + main_b_nkro_enable = true; + return true; +} + +void main_nkro_disable(void) +{ + main_b_nkro_enable = false; +} +#endif + +#ifdef EXK +volatile bool main_b_exk_enable = false; +bool main_exk_enable(void) +{ + main_b_exk_enable = true; + return true; +} + +void main_exk_disable(void) +{ + main_b_exk_enable = false; +} +#endif + +#ifdef MOU +volatile bool main_b_mou_enable = false; +bool main_mou_enable(void) +{ + main_b_mou_enable = true; + return true; +} + +void main_mou_disable(void) +{ + main_b_mou_enable = false; +} +#endif + +#ifdef RAW +volatile bool main_b_raw_enable = false; +bool main_raw_enable(void) +{ + main_b_raw_enable = true; + return true; +} + +void main_raw_disable(void) +{ + main_b_raw_enable = false; +} +#endif + diff --git a/tmk_core/protocol/arm_atsam/usb/spfssf.c b/tmk_core/protocol/arm_atsam/usb/spfssf.c new file mode 100644 index 0000000000..449a8bb7d0 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/spfssf.c @@ -0,0 +1,268 @@ +#include "samd51j18a.h" +#include "stdarg.h" +#include "spfssf.h" +#include "usb_util.h" + +int vspf(char *_Dest, const char *_Format, va_list va) +{ + //va_list va; //Variable argument list variable + char *d = _Dest; //Pointer to dest + + //va_start(va,_Format); //Initialize the variable argument list + while (*_Format) //While not end of format string + { + if (*_Format == SPF_SPEC_START) //If current format string character is the specifier start character + { + _Format++; //Skip over the character + while (*_Format && *_Format <= 64) _Format++; //Forward past any options + if (*_Format == SPF_SPEC_START) *d++ = *_Format; //If the character is the specifier start character, output the character and advance dest + else if (*_Format == SPF_SPEC_LONG) //If the character is the long type + { + _Format++; //Skip over the character + if (*_Format == SPF_SPEC_DECIMAL) //If the character is the decimal type + { + int64_t buf = va_arg(va,int64_t); //Get the next value from the va list + //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and invert number + //spf_uint2str_32_3t(&d,buf,32); //Perform the conversion + d += UTIL_ltoa_radix(buf, d, 10); + } + else if (*_Format == SPF_SPEC_UNSIGNED) //If the character is the unsigned type + { + uint64_t num = va_arg(va,uint64_t); //Get the next value from the va list + //spf_uint2str_32_3t(&d,num,32); //Perform the conversion + d += UTIL_ltoa_radix(num, d, 10); + } + else if (*_Format == SPF_SPEC_UHINT || *_Format == SPF_SPEC_UHINT_UP) //If the character is the unsigned type + { + uint64_t buf = va_arg(va,uint64_t); //Get the next value from the va list + //spf_uint2hex_32(&d,(unsigned long) buf); + d += UTIL_ltoa_radix(buf, d, 16); + } + else //If the character was not a known type + { + *d++ = SPF_SPEC_START; //Output the start specifier + *d++ = SPF_SPEC_LONG; //Output the long type + *d++ = *_Format; //Output the unknown type + } + } + else if (*_Format == SPF_SPEC_DECIMAL) //If the character is the decimal type + { + int buf = va_arg(va,int); //Get the next value from the va list + //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and invert number + //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion + d += UTIL_itoa(buf, d); + } + else if (*_Format == SPF_SPEC_INT) //If the character is the integer type + { + int buf = va_arg(va,int); //Get the next value from the va list + //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and inverted number + //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion + d += UTIL_itoa(buf, d); + } + else if (*_Format == SPF_SPEC_UINT) //If the character is the unsigned integer type + { + int buf = va_arg(va,int); //Get the next value from the va list + //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion + d += UTIL_utoa(buf, d); + } + else if (*_Format == SPF_SPEC_STRING) //If the character is the string type + { + char *buf = va_arg(va,char*); //Get the next value from the va list + while (*buf) *d++ = *buf++; //Perform the conversion (simply output characters and adcance pointers) + } + else if (*_Format == SPF_SPEC_UHINT || *_Format == SPF_SPEC_UHINT_UP) //If the character is the short type + { + int buf = va_arg(va,unsigned int); //Get the next value from the va list + //spf_uint2hex_32(&d,(unsigned long) buf); //Perform the conversion + d += UTIL_utoa(buf, d); + } + else //If the character type is unknown + { + *d++ = SPF_SPEC_START; //Output the start specifier + *d++ = *_Format; //Output the unknown type + } + } + else *d++ = *_Format; //If the character is unknown, output it to dest and advance dest + _Format++; //Advance the format buffer pointer to next character + } + //va_end(va); //End the variable argument list + + *d = '\0'; //Cap off the destination string with a zero + + return d - _Dest; //Return the length of the destintion buffer +} + +int spf(char *_Dest, const char *_Format, ...) +{ + va_list va; //Variable argument list variable + int result; + + va_start(va,_Format); //Initialize the variable argument list + result = vspf(_Dest, _Format, va); + va_end(va); + return result; +} + +//sscanf string to number (integer types) +int64_t ssf_ston(const char **_Src, uint32_t count, uint32_t *conv_count) +{ + int64_t value = 0; //Return value accumulator + uint32_t counter=count; //Counter to keep track of numbers converted + const char* p; //Pointer to first non space character + + while (*(*_Src) == SSF_SKIP_SPACE) (*_Src)++; //Forward through the whitespace to next non whitespace + + p = (*_Src); //Set pointer to first non space character + if (*p == '+' || *p == '-') (*_Src)++; //Skip over sign if any + while (*(*_Src) >= ASCII_NUM_START && + *(*_Src) <= ASCII_NUM_END && + counter) //While the source character is a digit and counter is not zero + { + value *= 10; //Multiply result by 10 to make room for next 1's place number + value += *(*_Src)++ - ASCII_NUM_START; //Add source number to value + counter--; //Decrement counter + } + if (counter - count == 0) return 0; //If no number conversion were performed, return 0 + if (*p == '-') value = -value; //If the number given was negative, make the result negative + + if (conv_count) (*conv_count)++; //Increment the converted count + return value; //Return the value +} + +uint64_t ssf_hton(const char **_Src, uint32_t count,uint32_t *conv_count) +{ + int64_t value=0; //Return value accumulator + uint32_t counter=count; //Counter to keep track of numbers converted + //const char* p; //Pointer to first non space character + char c; + + while (*(*_Src) == SSF_SKIP_SPACE) (*_Src)++; //Forward through the whitespace to next non whitespace + + //p = (*_Src); //Set pointer to first non space character + + while (counter) + { + c = *(*_Src)++; + if (c >= 'a' && c <= 'f') c -= ('a'-'A'); //toupper + if (c < '0' || (c > '9' && c < 'A') || c > 'F') break; + value *= 16; //Multiply result by 10 to make room for next 1's place number + c = c - '0'; + if (c > 9) c -= 7; + value += c; //Add source number to value + counter--; //Decrement counter + } + + if (counter - count == 0) return 0; //If no number conversion were performed, return 0 + //if (*p == '-') value = -value; //If the number given was negative, make the result negative + + if (conv_count) (*conv_count)++; //Increment the converted count + return value; +} + +//sscanf +int ssf(const char *_Src, const char *_Format, ...) +{ + va_list va; //Variable argument list variable + unsigned char looking_for=0; //Static char specified in format to be found in source + uint32_t conv_count=0; //Count of conversions made + + va_start(va,_Format); //Initialize the variable argument list + while (*_Format) //While the format string has not been fully read + { + if (looking_for != 0) //If we are looking for a matching character in the source string + { + while (*_Src != looking_for && *_Src) _Src++; //While the character is not found in the source string and not the end of the source + // string, increment the pointer position + if (*_Src == looking_for) _Src++; //If the character was found, step over it + else break; //Else the end was reached and the scan is now invalid (Could not find static character) + looking_for = 0; //Clear the looking for character + } + if (*_Format == SSF_SPEC_START) //If the current format character is the specifier start character + { + _Format++; //Step over the specifier start character + if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found + { + int *value=va_arg(va,int*); //User given destination address + //*value = (int)ssf_ston(&_Src,5,&conv_count); //Run conversion + *value = (int)ssf_ston(&_Src,10,&conv_count); //Run conversion + } + else if (*_Format == SSF_SPEC_LONG) //If the long specifier type is found + { + _Format++; //Skip over the specifier type + if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found + { + int64_t *value=va_arg(va,int64_t*); //User given destination address + //*value = (int64_t)ssf_ston(&_Src,10,&conv_count); //Run conversion + *value = (int64_t)ssf_ston(&_Src,19,&conv_count); //Run conversion + } + else if (*_Format == SSF_SPEC_UHINT) //If the decimal specifier type is found + { + uint64_t *value=va_arg(va,uint64_t *); //User given destination address + //*value = (uint64_t int)ssf_hton(&_Src,12,&conv_count); //Run conversion + *value = (uint64_t)ssf_hton(&_Src,16,&conv_count); //Run conversion + } + } + else if (*_Format == SSF_SPEC_SHORTINT) //If the short int specifier type is found + { + _Format++; //Skip over the specifier type + if (*_Format == SSF_SPEC_SHORTINT) //If the short int specifier type is found + { + _Format++; //Skip over the specifier type + if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found + { + unsigned char *value=va_arg(va,unsigned char*); //User given destination address + //*value = (unsigned char)ssf_ston(&_Src,3,&conv_count); //Run conversion + *value = (unsigned char)ssf_ston(&_Src,5,&conv_count); //Run conversion + } + } + } + else if (*_Format == SSF_SPEC_STRING) //If the specifier type is string + { + char *value=va_arg(va,char*); //User given destination address, max chars read pointer + while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace + while (*_Src != SSF_SKIP_SPACE && *_Src) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest + *value = 0; //Cap off the string pointer with zero + conv_count++; //Increment the converted count + } + else if (*_Format == SSF_SPEC_VERSION) //If the specifier type is string + { + char *value=va_arg(va,char*); //User given destination address, max chars read pointer + while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace + while (*_Src != SSF_DELIM_COMMA && *_Src) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest + *value = 0; //Cap off the string pointer with zero + conv_count++; //Increment the converted count + } + else if (*_Format >= ASCII_NUM_START && *_Format <= ASCII_NUM_END) + { + uint32_t len = (uint32_t)ssf_ston(&_Format,3,NULL); //Convert the given length + if (*_Format == SSF_SPEC_STRING) //If the specifier type is string + { + char *value=va_arg(va,char*),*e; //User given destination address, max chars read pointer + while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace + e = (char*)_Src+len; //Set a maximum length pointer location + while (*_Src != SSF_SKIP_SPACE && *_Src && _Src != e) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest + *value = 0; //Cap off the string pointer with zero + conv_count++; //Increment the converted count + } + else if (*_Format == SSF_SPEC_VERSION) //If the specifier type is string + { + char *value=va_arg(va,char*),*e; //User given destination address, max chars read pointer + while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace + e = (char*)_Src+len; //Set a maximum length pointer location + while (*_Src != SSF_DELIM_COMMA && *_Src && _Src != e) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest + *value = 0; //Cap off the string pointer with zero + conv_count++; //Increment the converted count + } + } + else if (*_Format == SSF_SPEC_START) looking_for = *_Format; //If another start specifier character is found, output a specifier character + else break; //Scan is now invalid (Uknown type specified) + } + else if (*_Format == SSF_SKIP_SPACE) { } //If a space is found, ignore it + else looking_for = *_Format; //If any other character is found, it is static and should be found in src as well + _Format++; //Skip over current format character + } + + va_end(va); //End the variable argument list + return conv_count; //Return the number of conversions made +} + diff --git a/tmk_core/protocol/arm_atsam/usb/spfssf.h b/tmk_core/protocol/arm_atsam/usb/spfssf.h new file mode 100644 index 0000000000..337a904dfe --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/spfssf.h @@ -0,0 +1,57 @@ +#ifndef ____spfssf_h +#define ____spfssf_h + +#include + +#define sprintf spf +#define sscanf ssf + +#define SIZEOF_OFFSET 1 + +#ifndef NULL +#define NULL 0 +#endif + +#define SPF_NONE 0 + +#define SPF_SPEC_START 37 //% +#define SPF_SPEC_DECIMAL 100 //d 16bit dec signed (-32767 to 32767) DONE same as i +#define SPF_SPEC_INT 105 //i 16bit dec signed (-32767 to 32767) DONE same as d +#define SPF_SPEC_UINT 117 //u 16bit dec unsigned (0 to 65535) DONE +#define SPF_SPEC_STRING 115 //s variable length (abcd...) DONE +#define SPF_SPEC_UHINT 120 //x 16bit hex lwrc (7fa) DONE +#define SPF_SPEC_UHINT_UP 88 //x 16bit hex lwrc (7fa) DONE +#define SPF_SPEC_LONG 108 //l start of either ld or lu DONE +#define SPF_SPEC_DECIMAL 100 //ld 32bit dec signed (-2147483647 to 2147483647) DONE +#define SPF_SPEC_UNSIGNED 117 //lu 32bit dec unsigned (0 to 4294967295) DONE +#define SPF_SPEC_UHINT 120 //lx 32bit hex unsigned (0 to ffffffff) DONE + +#define SSF_SPEC_START 37 //% +#define SSF_SPEC_SHORTINT 104 //h 8bit dec signed (-127 to 127) DONE +#define SSF_LEN_SHORTINT 3 //hhd +#define SSF_SPEC_DECIMAL 100 //d 16bit dec signed (-32767 to 32767) DONE +#define SSF_LEN_DECIMAL 5 //32767 +#define SSF_SPEC_INT 105 //i 16bit dec signed (-32767 to 32767) DONE +#define SSF_LEN_INT 5 //32767 +#define SSF_SPEC_LONG 108 //l start of either ld or lu DONE +#define SSF_SPEC_DECIMAL 100 //ld 32bit dec signed (-2147483647 to 2147483647) DONE +#define SSF_SPEC_UHINT 120 //lx 32bit hex unsigned DONE +#define SSF_LEN_LDECIMAL 10 //2147483647 +#define SSF_SPEC_STRING 115 //s variable length (abcd...) DONE +#define SSF_SKIP_SPACE 32 //space + +#define SSF_SPEC_VERSION 118 //v collect to comma delimiter - special +#define SSF_DELIM_COMMA 44 //, + +#define ASCII_NUM_START 48 //0 +#define ASCII_NUM_END 58 //9 + +#define T_UINT32_0_LIMIT 14 +#define T_UINT32_1_LIMIT 27 + +int vspf(char *_Dest, const char *_Format, va_list va); +int spf(char *_Dest, const char *_Format, ...); +int ssf(const char *_Src, const char *_Format, ...); + +#endif //____spfssf_h + diff --git a/tmk_core/protocol/arm_atsam/usb/status_codes.h b/tmk_core/protocol/arm_atsam/usb/status_codes.h new file mode 100644 index 0000000000..f56d2faed1 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/status_codes.h @@ -0,0 +1,158 @@ +/** + * \file + * + * \brief Status code definitions. + * + * This file defines various status codes returned by functions, + * indicating success or failure as well as what kind of failure. + * + * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef STATUS_CODES_H_INCLUDED +#define STATUS_CODES_H_INCLUDED + +#include + +/** + * \defgroup group_sam0_utils_status_codes Status Codes + * + * \ingroup group_sam0_utils + * + * @{ + */ + +/** Mask to retrieve the error category of a status code. */ +#define STATUS_CATEGORY_MASK 0xF0 + +/** Mask to retrieve the error code within the category of a status code. */ +#define STATUS_ERROR_MASK 0x0F + +/** Status code error categories. */ +enum status_categories { + STATUS_CATEGORY_OK = 0x00, + STATUS_CATEGORY_COMMON = 0x10, + STATUS_CATEGORY_ANALOG = 0x30, + STATUS_CATEGORY_COM = 0x40, + STATUS_CATEGORY_IO = 0x50, +}; + +/** + * Status code that may be returned by shell commands and protocol + * implementations. + * + * \note Any change to these status codes and the corresponding + * message strings is strictly forbidden. New codes can be added, + * however, but make sure that any message string tables are updated + * at the same time. + */ +enum status_code { + STATUS_OK = STATUS_CATEGORY_OK | 0x00, + STATUS_VALID_DATA = STATUS_CATEGORY_OK | 0x01, + STATUS_NO_CHANGE = STATUS_CATEGORY_OK | 0x02, + STATUS_ABORTED = STATUS_CATEGORY_OK | 0x04, + STATUS_BUSY = STATUS_CATEGORY_OK | 0x05, + STATUS_SUSPEND = STATUS_CATEGORY_OK | 0x06, + + STATUS_ERR_IO = STATUS_CATEGORY_COMMON | 0x00, + STATUS_ERR_REQ_FLUSHED = STATUS_CATEGORY_COMMON | 0x01, + STATUS_ERR_TIMEOUT = STATUS_CATEGORY_COMMON | 0x02, + STATUS_ERR_BAD_DATA = STATUS_CATEGORY_COMMON | 0x03, + STATUS_ERR_NOT_FOUND = STATUS_CATEGORY_COMMON | 0x04, + STATUS_ERR_UNSUPPORTED_DEV = STATUS_CATEGORY_COMMON | 0x05, + STATUS_ERR_NO_MEMORY = STATUS_CATEGORY_COMMON | 0x06, + STATUS_ERR_INVALID_ARG = STATUS_CATEGORY_COMMON | 0x07, + STATUS_ERR_BAD_ADDRESS = STATUS_CATEGORY_COMMON | 0x08, + STATUS_ERR_BAD_FORMAT = STATUS_CATEGORY_COMMON | 0x0A, + STATUS_ERR_BAD_FRQ = STATUS_CATEGORY_COMMON | 0x0B, + STATUS_ERR_DENIED = STATUS_CATEGORY_COMMON | 0x0c, + STATUS_ERR_ALREADY_INITIALIZED = STATUS_CATEGORY_COMMON | 0x0d, + STATUS_ERR_OVERFLOW = STATUS_CATEGORY_COMMON | 0x0e, + STATUS_ERR_NOT_INITIALIZED = STATUS_CATEGORY_COMMON | 0x0f, + + STATUS_ERR_SAMPLERATE_UNAVAILABLE = STATUS_CATEGORY_ANALOG | 0x00, + STATUS_ERR_RESOLUTION_UNAVAILABLE = STATUS_CATEGORY_ANALOG | 0x01, + + STATUS_ERR_BAUDRATE_UNAVAILABLE = STATUS_CATEGORY_COM | 0x00, + STATUS_ERR_PACKET_COLLISION = STATUS_CATEGORY_COM | 0x01, + STATUS_ERR_PROTOCOL = STATUS_CATEGORY_COM | 0x02, + + STATUS_ERR_PIN_MUX_INVALID = STATUS_CATEGORY_IO | 0x00, +}; +typedef enum status_code status_code_genare_t; + +/** + Status codes used by MAC stack. + */ +enum status_code_wireless { + //STATUS_OK = 0, //!< Success + ERR_IO_ERROR = -1, //!< I/O error + ERR_FLUSHED = -2, //!< Request flushed from queue + ERR_TIMEOUT = -3, //!< Operation timed out + ERR_BAD_DATA = -4, //!< Data integrity check failed + ERR_PROTOCOL = -5, //!< Protocol error + ERR_UNSUPPORTED_DEV = -6, //!< Unsupported device + ERR_NO_MEMORY = -7, //!< Insufficient memory + ERR_INVALID_ARG = -8, //!< Invalid argument + ERR_BAD_ADDRESS = -9, //!< Bad address + ERR_BUSY = -10, //!< Resource is busy + ERR_BAD_FORMAT = -11, //!< Data format not recognized + ERR_NO_TIMER = -12, //!< No timer available + ERR_TIMER_ALREADY_RUNNING = -13, //!< Timer already running + ERR_TIMER_NOT_RUNNING = -14, //!< Timer not running + + /** + * \brief Operation in progress + * + * This status code is for driver-internal use when an operation + * is currently being performed. + * + * \note Drivers should never return this status code to any + * callers. It is strictly for internal use. + */ + OPERATION_IN_PROGRESS = -128, +}; + +typedef enum status_code_wireless status_code_t; + +/** @} */ + +#endif /* STATUS_CODES_H_INCLUDED */ diff --git a/tmk_core/protocol/arm_atsam/usb/udc.c b/tmk_core/protocol/arm_atsam/usb/udc.c new file mode 100644 index 0000000000..12444d3059 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udc.c @@ -0,0 +1,1164 @@ +/** + * \file + * + * \brief USB Device Controller (UDC) + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udd.h" +#include "udc_desc.h" +#include "udi_device_conf.h" +#include "udi.h" +#include "udc.h" +#include "md_bootloader.h" + +/** + * \ingroup udc_group + * \defgroup udc_group_interne Implementation of UDC + * + * Internal implementation + * @{ + */ + +//! \name Internal variables to manage the USB device +//! @{ + +//! Device status state (see enum usb_device_status in usb_protocol.h) +static le16_t udc_device_status; + +COMPILER_WORD_ALIGNED +//! Device interface setting value +static uint8_t udc_iface_setting = 0; + +//! Device Configuration number selected by the USB host +COMPILER_WORD_ALIGNED +static uint8_t udc_num_configuration = 0; + +//! Pointer on the selected speed device configuration +static udc_config_speed_t UDC_DESC_STORAGE *udc_ptr_conf; + +//! Pointer on interface descriptor used by SETUP request. +static usb_iface_desc_t UDC_DESC_STORAGE *udc_ptr_iface; + +//! @} + + +//! \name Internal structure to store the USB device main strings +//! @{ + +/** + * \brief Language ID of USB device (US ID by default) + */ +COMPILER_WORD_ALIGNED +static UDC_DESC_STORAGE usb_str_lgid_desc_t udc_string_desc_languageid = { + .desc.bLength = sizeof(usb_str_lgid_desc_t), + .desc.bDescriptorType = USB_DT_STRING, + .string = {LE16(USB_LANGID_EN_US)} +}; + +/** + * \brief USB device manufacture name storage + * String is allocated only if USB_DEVICE_MANUFACTURE_NAME is declared + * by usb application configuration + */ +#ifdef USB_DEVICE_MANUFACTURE_NAME +static uint8_t udc_string_manufacturer_name[] = USB_DEVICE_MANUFACTURE_NAME; +#define USB_DEVICE_MANUFACTURE_NAME_SIZE (sizeof(udc_string_manufacturer_name)-1) +#else +#define USB_DEVICE_MANUFACTURE_NAME_SIZE 0 +#endif + +/** + * \brief USB device product name storage + * String is allocated only if USB_DEVICE_PRODUCT_NAME is declared + * by usb application configuration + */ +#ifdef USB_DEVICE_PRODUCT_NAME +static uint8_t udc_string_product_name[] = USB_DEVICE_PRODUCT_NAME; +#define USB_DEVICE_PRODUCT_NAME_SIZE (sizeof(udc_string_product_name)-1) +#else +#define USB_DEVICE_PRODUCT_NAME_SIZE 0 +#endif + +#if defined USB_DEVICE_SERIAL_NAME +#define USB_DEVICE_SERIAL_NAME_SIZE (sizeof(USB_DEVICE_SERIAL_NAME)-1) +#else +#define USB_DEVICE_SERIAL_NAME_SIZE 0 +#endif + +uint8_t usb_device_serial_name_size = 0; +#if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL +uint8_t bootloader_serial_number[BOOTLOADER_SERIAL_MAX_SIZE+1]=""; +#endif +static const uint8_t *udc_get_string_serial_name(void) +{ +#if defined USB_DEVICE_SERIAL_USE_BOOTLOADER_SERIAL + uint32_t serial_ptrloc = (uint32_t)&_srom - 4; + uint32_t serial_address = *(uint32_t *)serial_ptrloc; //Address of bootloader's serial number if available + + if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) //Check for factory programmed serial address + { + if ((serial_address & 0xFF) % 4 == 0) //Check alignment + { + uint16_t *serial_use = (uint16_t *)(serial_address); //Point to address of string in rom + uint8_t serial_length = 0; + + while ((*(serial_use + serial_length) > 32 && *(serial_use + serial_length) < 127) && + serial_length < BOOTLOADER_SERIAL_MAX_SIZE) + { + bootloader_serial_number[serial_length] = *(serial_use + serial_length) & 0xFF; + serial_length++; + } + bootloader_serial_number[serial_length] = 0; + + usb_device_serial_name_size = serial_length; + + return bootloader_serial_number; //Use serial programmed into bootloader rom + } + } +#endif + + usb_device_serial_name_size = USB_DEVICE_SERIAL_NAME_SIZE; + +#if defined USB_DEVICE_SERIAL_NAME + return (const uint8_t *)USB_DEVICE_SERIAL_NAME; //Use serial supplied by keyboard's config.h +#else + return 0; //No serial supplied +#endif +} + +/** + * \brief USB device string descriptor + * Structure used to transfer ASCII strings to USB String descriptor structure. + */ +#ifndef BOOTLOADER_SERIAL_MAX_SIZE +#define BOOTLOADER_SERIAL_MAX_SIZE 0 +#endif //BOOTLOADER_SERIAL_MAX_SIZE +struct udc_string_desc_t { + usb_str_desc_t header; + le16_t string[Max(Max(Max(USB_DEVICE_MANUFACTURE_NAME_SIZE, \ + USB_DEVICE_PRODUCT_NAME_SIZE), USB_DEVICE_SERIAL_NAME_SIZE), \ + BOOTLOADER_SERIAL_MAX_SIZE)]; +}; +COMPILER_WORD_ALIGNED +static UDC_DESC_STORAGE struct udc_string_desc_t udc_string_desc = { + .header.bDescriptorType = USB_DT_STRING +}; +//! @} + +usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void) +{ + return udc_ptr_iface; +} + +/** + * \brief Returns a value to check the end of USB Configuration descriptor + * + * \return address after the last byte of USB Configuration descriptor + */ +static usb_conf_desc_t UDC_DESC_STORAGE *udc_get_eof_conf(void) +{ + return (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) + udc_ptr_conf->desc + + le16_to_cpu(udc_ptr_conf->desc->wTotalLength)); +} + +#if (0!=USB_DEVICE_MAX_EP) +/** + * \brief Search specific descriptor in global interface descriptor + * + * \param desc Address of interface descriptor + * or previous specific descriptor found + * \param desc_id Descriptor ID to search + * + * \return address of specific descriptor found + * \return NULL if it is the end of global interface descriptor + */ +static usb_conf_desc_t UDC_DESC_STORAGE *udc_next_desc_in_iface(usb_conf_desc_t + UDC_DESC_STORAGE * desc, uint8_t desc_id) +{ + usb_conf_desc_t UDC_DESC_STORAGE *ptr_eof_desc; + + ptr_eof_desc = udc_get_eof_conf(); + // Go to next descriptor + desc = (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) desc + + desc->bLength); + // Check the end of configuration descriptor + while (ptr_eof_desc > desc) { + // If new interface descriptor is found, + // then it is the end of the current global interface descriptor + if (USB_DT_INTERFACE == desc->bDescriptorType) { + break; // End of global interface descriptor + } + if (desc_id == desc->bDescriptorType) { + return desc; // Specific descriptor found + } + // Go to next descriptor + desc = (UDC_DESC_STORAGE usb_conf_desc_t *) ((uint8_t *) desc + + desc->bLength); + } + return NULL; // No specific descriptor found +} +#endif + +/** + * \brief Search an interface descriptor + * This routine updates the internal pointer udc_ptr_iface. + * + * \param iface_num Interface number to find in Configuration Descriptor + * \param setting_num Setting number of interface to find + * + * \return 1 if found or 0 if not found + */ +static bool udc_update_iface_desc(uint8_t iface_num, uint8_t setting_num) +{ + usb_conf_desc_t UDC_DESC_STORAGE *ptr_end_desc; + + if (0 == udc_num_configuration) { + return false; + } + + if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { + return false; + } + + // Start at the beginning of configuration descriptor + udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *) + udc_ptr_conf->desc; + + // Check the end of configuration descriptor + ptr_end_desc = udc_get_eof_conf(); + while (ptr_end_desc > + (UDC_DESC_STORAGE usb_conf_desc_t *) udc_ptr_iface) { + if (USB_DT_INTERFACE == udc_ptr_iface->bDescriptorType) { + // A interface descriptor is found + // Check interface and alternate setting number + if ((iface_num == udc_ptr_iface->bInterfaceNumber) && + (setting_num == + udc_ptr_iface->bAlternateSetting)) { + return true; // Interface found + } + } + // Go to next descriptor + udc_ptr_iface = (UDC_DESC_STORAGE usb_iface_desc_t *) ( + (uint8_t *) udc_ptr_iface + + udc_ptr_iface->bLength); + } + return false; // Interface not found +} + +/** + * \brief Disables an usb device interface (UDI) + * This routine call the UDI corresponding to interface number + * + * \param iface_num Interface number to disable + * + * \return 1 if it is done or 0 if interface is not found + */ +static bool udc_iface_disable(uint8_t iface_num) +{ + udi_api_t UDC_DESC_STORAGE *udi_api; + + // Select first alternate setting of the interface + // to update udc_ptr_iface before call iface->getsetting() + if (!udc_update_iface_desc(iface_num, 0)) { + return false; + } + + // Select the interface with the current alternate setting + udi_api = udc_ptr_conf->udi_apis[iface_num]; + +#if (0!=USB_DEVICE_MAX_EP) + if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { + return false; + } + + // Start at the beginning of interface descriptor + { + usb_ep_desc_t UDC_DESC_STORAGE *ep_desc; + ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) udc_ptr_iface; + while (1) { + // Search Endpoint descriptor included in global interface descriptor + ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) + udc_next_desc_in_iface((UDC_DESC_STORAGE + usb_conf_desc_t *) + ep_desc, USB_DT_ENDPOINT); + if (NULL == ep_desc) { + break; + } + // Free the endpoint used by the interface + udd_ep_free(ep_desc->bEndpointAddress); + } + } +#endif + + // Disable interface + udi_api->disable(); + return true; +} + +/** + * \brief Enables an usb device interface (UDI) + * This routine calls the UDI corresponding + * to the interface and setting number. + * + * \param iface_num Interface number to enable + * \param setting_num Setting number to enable + * + * \return 1 if it is done or 0 if interface is not found + */ +static bool udc_iface_enable(uint8_t iface_num, uint8_t setting_num) +{ + // Select the interface descriptor + if (!udc_update_iface_desc(iface_num, setting_num)) { + return false; + } + +#if (0!=USB_DEVICE_MAX_EP) + usb_ep_desc_t UDC_DESC_STORAGE *ep_desc; + + // Start at the beginning of the global interface descriptor + ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) udc_ptr_iface; + while (1) { + // Search Endpoint descriptor included in the global interface descriptor + ep_desc = (UDC_DESC_STORAGE usb_ep_desc_t *) + udc_next_desc_in_iface((UDC_DESC_STORAGE + usb_conf_desc_t *) ep_desc, + USB_DT_ENDPOINT); + if (NULL == ep_desc) + break; + // Alloc the endpoint used by the interface + if (!udd_ep_alloc(ep_desc->bEndpointAddress, + ep_desc->bmAttributes, + le16_to_cpu + (ep_desc->wMaxPacketSize))) { + return false; + } + } +#endif + // Enable the interface + return udc_ptr_conf->udi_apis[iface_num]->enable(); +} + +/*! \brief Start the USB Device stack + */ +void udc_start(void) +{ + udd_enable(); +} + +/*! \brief Stop the USB Device stack + */ +void udc_stop(void) +{ + udd_disable(); + udc_reset(); +} + +/** + * \brief Reset the current configuration of the USB device, + * This routines can be called by UDD when a RESET on the USB line occurs. + */ +void udc_reset(void) +{ + uint8_t iface_num; + + if (udc_num_configuration) { + for (iface_num = 0; + iface_num < udc_ptr_conf->desc->bNumInterfaces; + iface_num++) { + udc_iface_disable(iface_num); + } + } + udc_num_configuration = 0; +#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ + == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) + if (CPU_TO_LE16(USB_DEV_STATUS_REMOTEWAKEUP) & udc_device_status) { + // Remote wakeup is enabled then disable it + UDC_REMOTEWAKEUP_DISABLE(); + } +#endif + udc_device_status = +#if (USB_DEVICE_ATTR & USB_CONFIG_ATTR_SELF_POWERED) + CPU_TO_LE16(USB_DEV_STATUS_SELF_POWERED); +#else + CPU_TO_LE16(USB_DEV_STATUS_BUS_POWERED); +#endif +} + +void udc_sof_notify(void) +{ + uint8_t iface_num; + + if (udc_num_configuration) { + for (iface_num = 0; + iface_num < udc_ptr_conf->desc->bNumInterfaces; + iface_num++) { + if (udc_ptr_conf->udi_apis[iface_num]->sof_notify != NULL) { + udc_ptr_conf->udi_apis[iface_num]->sof_notify(); + } + } + } +} + +/** + * \brief Standard device request to get device status + * + * \return true if success + */ +static bool udc_req_std_dev_get_status(void) +{ + if (udd_g_ctrlreq.req.wLength != sizeof(udc_device_status)) { + return false; + } + + udd_set_setup_payload( (uint8_t *) & udc_device_status, + sizeof(udc_device_status)); + return true; +} + +#if (0!=USB_DEVICE_MAX_EP) +/** + * \brief Standard endpoint request to get endpoint status + * + * \return true if success + */ +static bool udc_req_std_ep_get_status(void) +{ + static le16_t udc_ep_status; + + if (udd_g_ctrlreq.req.wLength != sizeof(udc_ep_status)) { + return false; + } + + udc_ep_status = udd_ep_is_halted(udd_g_ctrlreq.req. + wIndex & 0xFF) ? CPU_TO_LE16(USB_EP_STATUS_HALTED) : 0; + + udd_set_setup_payload( (uint8_t *) & udc_ep_status, + sizeof(udc_ep_status)); + return true; +} +#endif + +/** + * \brief Standard device request to change device status + * + * \return true if success + */ +static bool udc_req_std_dev_clear_feature(void) +{ + if (udd_g_ctrlreq.req.wLength) { + return false; + } + + if (udd_g_ctrlreq.req.wValue == USB_DEV_FEATURE_REMOTE_WAKEUP) { + udc_device_status &= CPU_TO_LE16(~(uint32_t)USB_DEV_STATUS_REMOTEWAKEUP); +#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ + == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) + UDC_REMOTEWAKEUP_DISABLE(); +#endif + return true; + } + return false; +} + +#if (0!=USB_DEVICE_MAX_EP) +/** + * \brief Standard endpoint request to clear endpoint feature + * + * \return true if success + */ +static bool udc_req_std_ep_clear_feature(void) +{ + if (udd_g_ctrlreq.req.wLength) { + return false; + } + + if (udd_g_ctrlreq.req.wValue == USB_EP_FEATURE_HALT) { + return udd_ep_clear_halt(udd_g_ctrlreq.req.wIndex & 0xFF); + } + return false; +} +#endif + +/** + * \brief Standard device request to set a feature + * + * \return true if success + */ +static bool udc_req_std_dev_set_feature(void) +{ + if (udd_g_ctrlreq.req.wLength) { + return false; + } + + switch (udd_g_ctrlreq.req.wValue) { + + case USB_DEV_FEATURE_REMOTE_WAKEUP: +#if (USB_CONFIG_ATTR_REMOTE_WAKEUP \ + == (USB_DEVICE_ATTR & USB_CONFIG_ATTR_REMOTE_WAKEUP)) + udc_device_status |= CPU_TO_LE16(USB_DEV_STATUS_REMOTEWAKEUP); + UDC_REMOTEWAKEUP_ENABLE(); + return true; +#else + return false; +#endif + +#ifdef USB_DEVICE_HS_SUPPORT + case USB_DEV_FEATURE_TEST_MODE: + if (!udd_is_high_speed()) { + break; + } + if (udd_g_ctrlreq.req.wIndex & 0xff) { + break; + } + // Unconfigure the device, terminating all ongoing requests + udc_reset(); + switch ((udd_g_ctrlreq.req.wIndex >> 8) & 0xFF) { + case USB_DEV_TEST_MODE_J: + udd_g_ctrlreq.callback = udd_test_mode_j; + return true; + + case USB_DEV_TEST_MODE_K: + udd_g_ctrlreq.callback = udd_test_mode_k; + return true; + + case USB_DEV_TEST_MODE_SE0_NAK: + udd_g_ctrlreq.callback = udd_test_mode_se0_nak; + return true; + + case USB_DEV_TEST_MODE_PACKET: + udd_g_ctrlreq.callback = udd_test_mode_packet; + return true; + + case USB_DEV_TEST_MODE_FORCE_ENABLE: // Only for downstream facing hub ports + default: + break; + } + break; +#endif + default: + break; + } + return false; +} + +/** + * \brief Standard endpoint request to halt an endpoint + * + * \return true if success + */ +#if (0!=USB_DEVICE_MAX_EP) +static bool udc_req_std_ep_set_feature(void) +{ + if (udd_g_ctrlreq.req.wLength) { + return false; + } + if (udd_g_ctrlreq.req.wValue == USB_EP_FEATURE_HALT) { + udd_ep_abort(udd_g_ctrlreq.req.wIndex & 0xFF); + return udd_ep_set_halt(udd_g_ctrlreq.req.wIndex & 0xFF); + } + return false; +} +#endif + +/** + * \brief Change the address of device + * Callback called at the end of request set address + */ +static void udc_valid_address(void) +{ + udd_set_address(udd_g_ctrlreq.req.wValue & 0x7F); +} + +/** + * \brief Standard device request to set device address + * + * \return true if success + */ +static bool udc_req_std_dev_set_address(void) +{ + if (udd_g_ctrlreq.req.wLength) { + return false; + } + + // The address must be changed at the end of setup request after the handshake + // then we use a callback to change address + udd_g_ctrlreq.callback = udc_valid_address; + return true; +} + +/** + * \brief Standard device request to get device string descriptor + * + * \return true if success + */ +static bool udc_req_std_dev_get_str_desc(void) +{ + uint8_t i; + const uint8_t *str; + uint8_t str_length = 0; + + // Link payload pointer to the string corresponding at request + switch (udd_g_ctrlreq.req.wValue & 0xff) { + case 0: + udd_set_setup_payload((uint8_t *) &udc_string_desc_languageid, + sizeof(udc_string_desc_languageid)); + break; + +#ifdef USB_DEVICE_MANUFACTURE_NAME + case 1: + str_length = USB_DEVICE_MANUFACTURE_NAME_SIZE; + str = udc_string_manufacturer_name; + break; +#endif +#ifdef USB_DEVICE_PRODUCT_NAME + case 2: + str_length = USB_DEVICE_PRODUCT_NAME_SIZE; + str = udc_string_product_name; + break; +#endif + case 3: + str = udc_get_string_serial_name(); + str_length = usb_device_serial_name_size; + break; + default: +#ifdef UDC_GET_EXTRA_STRING + if (UDC_GET_EXTRA_STRING()) { + break; + } +#endif + return false; + } + + if (str_length) { + for(i = 0; i < str_length; i++) { + udc_string_desc.string[i] = cpu_to_le16((le16_t)str[i]); + } + + udc_string_desc.header.bLength = 2 + (str_length) * 2; + udd_set_setup_payload( + (uint8_t *) &udc_string_desc, + udc_string_desc.header.bLength); + } + + return true; +} + +/** + * \brief Standard device request to get descriptors about USB device + * + * \return true if success + */ +static bool udc_req_std_dev_get_descriptor(void) +{ + uint8_t conf_num; + + conf_num = udd_g_ctrlreq.req.wValue & 0xff; + + // Check descriptor ID + switch ((uint8_t) (udd_g_ctrlreq.req.wValue >> 8)) { + case USB_DT_DEVICE: + // Device descriptor requested +#ifdef USB_DEVICE_HS_SUPPORT + if (!udd_is_high_speed()) { + udd_set_setup_payload( + (uint8_t *) udc_config.confdev_hs, + udc_config.confdev_hs->bLength); + } else +#endif + { + udd_set_setup_payload( + (uint8_t *) udc_config.confdev_lsfs, + udc_config.confdev_lsfs->bLength); + } + break; + + case USB_DT_CONFIGURATION: + // Configuration descriptor requested +#ifdef USB_DEVICE_HS_SUPPORT + if (udd_is_high_speed()) { + // HS descriptor + if (conf_num >= udc_config.confdev_hs->bNumConfigurations) { + return false; + } + udd_set_setup_payload( + (uint8_t *)udc_config.conf_hs[conf_num].desc, + le16_to_cpu(udc_config.conf_hs[conf_num].desc->wTotalLength)); + } else +#endif + { + // FS descriptor + if (conf_num >= udc_config.confdev_lsfs->bNumConfigurations) { + return false; + } + udd_set_setup_payload( + (uint8_t *)udc_config.conf_lsfs[conf_num].desc, + le16_to_cpu(udc_config.conf_lsfs[conf_num].desc->wTotalLength)); + } + ((usb_conf_desc_t *) udd_g_ctrlreq.payload)->bDescriptorType = + USB_DT_CONFIGURATION; + break; + +#ifdef USB_DEVICE_HS_SUPPORT + case USB_DT_DEVICE_QUALIFIER: + // Device qualifier descriptor requested + udd_set_setup_payload( (uint8_t *) udc_config.qualifier, + udc_config.qualifier->bLength); + break; + + case USB_DT_OTHER_SPEED_CONFIGURATION: + // Other configuration descriptor requested + if (!udd_is_high_speed()) { + // HS descriptor + if (conf_num >= udc_config.confdev_hs->bNumConfigurations) { + return false; + } + udd_set_setup_payload( + (uint8_t *)udc_config.conf_hs[conf_num].desc, + le16_to_cpu(udc_config.conf_hs[conf_num].desc->wTotalLength)); + } else { + // FS descriptor + if (conf_num >= udc_config.confdev_lsfs->bNumConfigurations) { + return false; + } + udd_set_setup_payload( + (uint8_t *)udc_config.conf_lsfs[conf_num].desc, + le16_to_cpu(udc_config.conf_lsfs[conf_num].desc->wTotalLength)); + } + ((usb_conf_desc_t *) udd_g_ctrlreq.payload)->bDescriptorType = + USB_DT_OTHER_SPEED_CONFIGURATION; + break; +#endif + + case USB_DT_BOS: + // Device BOS descriptor requested + if (udc_config.conf_bos == NULL) { + return false; + } + udd_set_setup_payload( (uint8_t *) udc_config.conf_bos, + udc_config.conf_bos->wTotalLength); + break; + + case USB_DT_STRING: + // String descriptor requested + if (!udc_req_std_dev_get_str_desc()) { + return false; + } + break; + + default: + // Unknown descriptor requested + return false; + } + // if the descriptor is larger than length requested, then reduce it + if (udd_g_ctrlreq.req.wLength < udd_g_ctrlreq.payload_size) { + udd_g_ctrlreq.payload_size = udd_g_ctrlreq.req.wLength; + } + return true; +} + +/** + * \brief Standard device request to get configuration number + * + * \return true if success + */ +static bool udc_req_std_dev_get_configuration(void) +{ + if (udd_g_ctrlreq.req.wLength != 1) { + return false; + } + + udd_set_setup_payload(&udc_num_configuration,1); + return true; +} + +/** + * \brief Standard device request to enable a configuration + * + * \return true if success + */ +static bool udc_req_std_dev_set_configuration(void) +{ + uint8_t iface_num; + + // Check request length + if (udd_g_ctrlreq.req.wLength) { + return false; + } + // Authorize configuration only if the address is valid + if (!udd_getaddress()) { + return false; + } + // Check the configuration number requested +#ifdef USB_DEVICE_HS_SUPPORT + if (udd_is_high_speed()) { + // HS descriptor + if ((udd_g_ctrlreq.req.wValue & 0xFF) > + udc_config.confdev_hs->bNumConfigurations) { + return false; + } + } else +#endif + { + // FS descriptor + if ((udd_g_ctrlreq.req.wValue & 0xFF) > + udc_config.confdev_lsfs->bNumConfigurations) { + return false; + } + } + + // Reset current configuration + udc_reset(); + + // Enable new configuration + udc_num_configuration = udd_g_ctrlreq.req.wValue & 0xFF; + if (udc_num_configuration == 0) { + return true; // Default empty configuration requested + } + // Update pointer of the configuration descriptor +#ifdef USB_DEVICE_HS_SUPPORT + if (udd_is_high_speed()) { + // HS descriptor + udc_ptr_conf = &udc_config.conf_hs[udc_num_configuration - 1]; + } else +#endif + { + // FS descriptor + udc_ptr_conf = &udc_config.conf_lsfs[udc_num_configuration - 1]; + } + // Enable all interfaces of the selected configuration + for (iface_num = 0; iface_num < udc_ptr_conf->desc->bNumInterfaces; + iface_num++) { + if (!udc_iface_enable(iface_num, 0)) { + return false; + } + } + return true; +} + +/** + * \brief Standard interface request + * to get the alternate setting number of an interface + * + * \return true if success + */ +static bool udc_req_std_iface_get_setting(void) +{ + uint8_t iface_num; + udi_api_t UDC_DESC_STORAGE *udi_api; + + if (udd_g_ctrlreq.req.wLength != 1) { + return false; // Error in request + } + if (!udc_num_configuration) { + return false; // The device is not is configured state yet + } + + // Check the interface number included in the request + iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; + if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { + return false; + } + + // Select first alternate setting of the interface to update udc_ptr_iface + // before call iface->getsetting() + if (!udc_update_iface_desc(iface_num, 0)) { + return false; + } + // Get alternate setting from UDI + udi_api = udc_ptr_conf->udi_apis[iface_num]; + udc_iface_setting = udi_api->getsetting(); + + // Link value to payload pointer of request + udd_set_setup_payload(&udc_iface_setting,1); + return true; +} + +/** + * \brief Standard interface request + * to set an alternate setting of an interface + * + * \return true if success + */ +static bool udc_req_std_iface_set_setting(void) +{ + uint8_t iface_num, setting_num; + + if (udd_g_ctrlreq.req.wLength) { + return false; // Error in request + } + if (!udc_num_configuration) { + return false; // The device is not is configured state yet + } + + iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; + setting_num = udd_g_ctrlreq.req.wValue & 0xFF; + + // Disable current setting + if (!udc_iface_disable(iface_num)) { + return false; + } + + // Enable new setting + return udc_iface_enable(iface_num, setting_num); +} + +/** + * \brief Main routine to manage the standard USB SETUP request + * + * \return true if the request is supported + */ +static bool udc_reqstd(void) +{ + if (Udd_setup_is_in()) { + // GET Standard Requests + if (udd_g_ctrlreq.req.wLength == 0) { + return false; // Error for USB host + } + + if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { + // Standard Get Device request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_GET_STATUS: + return udc_req_std_dev_get_status(); + case USB_REQ_GET_DESCRIPTOR: + return udc_req_std_dev_get_descriptor(); + case USB_REQ_GET_CONFIGURATION: + return udc_req_std_dev_get_configuration(); + default: + break; + } + } + + if (USB_REQ_RECIP_INTERFACE == Udd_setup_recipient()) { + // Standard Get Interface request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_GET_INTERFACE: + return udc_req_std_iface_get_setting(); + default: + break; + } + } +#if (0!=USB_DEVICE_MAX_EP) + if (USB_REQ_RECIP_ENDPOINT == Udd_setup_recipient()) { + // Standard Get Endpoint request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_GET_STATUS: + return udc_req_std_ep_get_status(); + default: + break; + } + } +#endif + } else { + // SET Standard Requests + if (USB_REQ_RECIP_DEVICE == Udd_setup_recipient()) { + // Standard Set Device request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_SET_ADDRESS: + return udc_req_std_dev_set_address(); + case USB_REQ_CLEAR_FEATURE: + return udc_req_std_dev_clear_feature(); + case USB_REQ_SET_FEATURE: + return udc_req_std_dev_set_feature(); + case USB_REQ_SET_CONFIGURATION: + return udc_req_std_dev_set_configuration(); + case USB_REQ_SET_DESCRIPTOR: + /* Not supported (defined as optional by the USB 2.0 spec) */ + break; + default: + break; + } + } + + if (USB_REQ_RECIP_INTERFACE == Udd_setup_recipient()) { + // Standard Set Interface request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_SET_INTERFACE: + return udc_req_std_iface_set_setting(); + default: + break; + } + } +#if (0!=USB_DEVICE_MAX_EP) + if (USB_REQ_RECIP_ENDPOINT == Udd_setup_recipient()) { + // Standard Set Endpoint request + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_CLEAR_FEATURE: + return udc_req_std_ep_clear_feature(); + case USB_REQ_SET_FEATURE: + return udc_req_std_ep_set_feature(); + default: + break; + } + } +#endif + } + return false; +} + +/** + * \brief Send the SETUP interface request to UDI + * + * \return true if the request is supported + */ +static bool udc_req_iface(void) +{ + uint8_t iface_num; + udi_api_t UDC_DESC_STORAGE *udi_api; + + if (0 == udc_num_configuration) { + return false; // The device is not is configured state yet + } + // Check interface number + iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; + if (iface_num >= udc_ptr_conf->desc->bNumInterfaces) { + return false; + } + + //* To update udc_ptr_iface with the selected interface in request + // Select first alternate setting of interface to update udc_ptr_iface + // before calling udi_api->getsetting() + if (!udc_update_iface_desc(iface_num, 0)) { + return false; + } + // Select the interface with the current alternate setting + udi_api = udc_ptr_conf->udi_apis[iface_num]; + if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { + return false; + } + + // Send the SETUP request to the UDI corresponding to the interface number + return udi_api->setup(); +} + +/** + * \brief Send the SETUP interface request to UDI + * + * \return true if the request is supported + */ +static bool udc_req_ep(void) +{ + uint8_t iface_num; + udi_api_t UDC_DESC_STORAGE *udi_api; + + if (0 == udc_num_configuration) { + return false; // The device is not is configured state yet + } + // Send this request on all enabled interfaces + iface_num = udd_g_ctrlreq.req.wIndex & 0xFF; + for (iface_num = 0; iface_num < udc_ptr_conf->desc->bNumInterfaces; + iface_num++) { + // Select the interface with the current alternate setting + udi_api = udc_ptr_conf->udi_apis[iface_num]; + if (!udc_update_iface_desc(iface_num, udi_api->getsetting())) { + return false; + } + + // Send the SETUP request to the UDI + if (udi_api->setup()) { + return true; + } + } + return false; +} + +/** + * \brief Main routine to manage the USB SETUP request. + * + * This function parses a USB SETUP request and submits an appropriate + * response back to the host or, in the case of SETUP OUT requests + * with data, sets up a buffer for receiving the data payload. + * + * The main standard requests defined by the USB 2.0 standard are handled + * internally. The interface requests are sent to UDI, and the specific request + * sent to a specific application callback. + * + * \return true if the request is supported, else the request is stalled by UDD + */ +bool udc_process_setup(void) +{ + // By default no data (receive/send) and no callbacks registered + udd_g_ctrlreq.payload_size = 0; + udd_g_ctrlreq.callback = NULL; + udd_g_ctrlreq.over_under_run = NULL; + + if (Udd_setup_is_in()) { + if (udd_g_ctrlreq.req.wLength == 0) { + return false; // Error from USB host + } + } + + // If standard request then try to decode it in UDC + if (Udd_setup_type() == USB_REQ_TYPE_STANDARD) { + if (udc_reqstd()) { + return true; + } + } + + // If interface request then try to decode it in UDI + if (Udd_setup_recipient() == USB_REQ_RECIP_INTERFACE) { + if (udc_req_iface()) { + return true; + } + } + + // If endpoint request then try to decode it in UDI + if (Udd_setup_recipient() == USB_REQ_RECIP_ENDPOINT) { + if (udc_req_ep()) { + return true; + } + } + + // Here SETUP request unknown by UDC and UDIs +#ifdef USB_DEVICE_SPECIFIC_REQUEST + // Try to decode it in specific callback + return USB_DEVICE_SPECIFIC_REQUEST(); // Ex: Vendor request,... +#else + return false; +#endif +} + +//! @} diff --git a/tmk_core/protocol/arm_atsam/usb/udc.h b/tmk_core/protocol/arm_atsam/usb/udc.h new file mode 100644 index 0000000000..c88a442cb6 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udc.h @@ -0,0 +1,260 @@ +/** + * \file + * + * \brief Interface of the USB Device Controller (UDC) + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDC_H_ +#define _UDC_H_ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udc_desc.h" +#include "udd.h" + +#if USB_DEVICE_VENDOR_ID == 0 +# error USB_DEVICE_VENDOR_ID cannot be equal to 0 +#endif + +#if USB_DEVICE_PRODUCT_ID == 0 +# error USB_DEVICE_PRODUCT_ID cannot be equal to 0 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup usb_device_group + * \defgroup udc_group USB Device Controller (UDC) + * + * The UDC provides a high-level abstraction of the usb device. + * You can use these functions to control the main device state + * (start/attach/wakeup). + * + * \section USB_DEVICE_CONF USB Device Custom configuration + * The following USB Device configuration must be included in the conf_usb.h + * file of the application. + * + * USB_DEVICE_VENDOR_ID (Word)
+ * Vendor ID provided by USB org (ATMEL 0x03EB). + * + * USB_DEVICE_PRODUCT_ID (Word)
+ * Product ID (Referenced in usb_atmel.h). + * + * USB_DEVICE_MAJOR_VERSION (Byte)
+ * Major version of the device + * + * USB_DEVICE_MINOR_VERSION (Byte)
+ * Minor version of the device + * + * USB_DEVICE_MANUFACTURE_NAME (string)
+ * ASCII name for the manufacture + * + * USB_DEVICE_PRODUCT_NAME (string)
+ * ASCII name for the product + * + * USB_DEVICE_SERIAL_NAME (string)
+ * ASCII name to enable and set a serial number + * + * USB_DEVICE_POWER (Numeric)
+ * (unit mA) Maximum device power + * + * USB_DEVICE_ATTR (Byte)
+ * USB attributes available: + * - USB_CONFIG_ATTR_SELF_POWERED + * - USB_CONFIG_ATTR_REMOTE_WAKEUP + * Note: if remote wake enabled then defines remotewakeup callbacks, + * see Table 5-2. External API from UDC - Callback + * + * USB_DEVICE_LOW_SPEED (Only defined)
+ * Force the USB Device to run in low speed + * + * USB_DEVICE_HS_SUPPORT (Only defined)
+ * Authorize the USB Device to run in high speed + * + * USB_DEVICE_MAX_EP (Byte)
+ * Define the maximum endpoint number used by the USB Device.
+ * This one is already defined in UDI default configuration. + * Ex: + * - When endpoint control 0x00, endpoint 0x01 and + * endpoint 0x82 is used then USB_DEVICE_MAX_EP=2 + * - When only endpoint control 0x00 is used then USB_DEVICE_MAX_EP=0 + * - When endpoint 0x01 and endpoint 0x81 is used then USB_DEVICE_MAX_EP=1
+ * (configuration not possible on USBB interface) + * @{ + */ + +/** + * \brief Authorizes the VBUS event + * + * \return true, if the VBUS monitoring is possible. + * + * \section udc_vbus_monitoring VBus monitoring used cases + * + * The VBus monitoring is used only for USB SELF Power application. + * + * - By default the USB device is automatically attached when Vbus is high + * or when USB is start for devices without internal Vbus monitoring. + * conf_usb.h file does not contains define USB_DEVICE_ATTACH_AUTO_DISABLE. + * \code //#define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode + * + * - Add custom VBUS monitoring. conf_usb.h file contains define + * USB_DEVICE_ATTACH_AUTO_DISABLE: + * \code #define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode + * User C file contains: + * \code + // Authorize VBUS monitoring + if (!udc_include_vbus_monitoring()) { + // Implement custom VBUS monitoring via GPIO or other + } + Event_VBUS_present() // VBUS interrupt or GPIO interrupt or other + { + // Attach USB Device + udc_attach(); + } +\endcode + * + * - Case of battery charging. conf_usb.h file contains define + * USB_DEVICE_ATTACH_AUTO_DISABLE: + * \code #define USB_DEVICE_ATTACH_AUTO_DISABLE \endcode + * User C file contains: + * \code + Event VBUS present() // VBUS interrupt or GPIO interrupt or .. + { + // Authorize battery charging, but wait key press to start USB. + } + Event Key press() + { + // Stop batteries charging + // Start USB + udc_attach(); + } +\endcode + */ +static inline bool udc_include_vbus_monitoring(void) +{ + return udd_include_vbus_monitoring(); +} + +/*! \brief Start the USB Device stack + */ +void udc_start(void); + +/*! \brief Stop the USB Device stack + */ +void udc_stop(void); + +/** + * \brief Attach device to the bus when possible + * + * \warning If a VBus control is included in driver, + * then it will attach device when an acceptable Vbus + * level from the host is detected. + */ +static inline void udc_attach(void) +{ + udd_attach(); +} + +/** + * \brief Detaches the device from the bus + * + * The driver must remove pull-up on USB line D- or D+. + */ +static inline void udc_detach(void) +{ + udd_detach(); +} + +/*! \brief The USB driver sends a resume signal called \e "Upstream Resume" + * This is authorized only when the remote wakeup feature is enabled by host. + */ +static inline void udc_remotewakeup(void) +{ + udd_send_remotewakeup(); +} + +/** + * \brief Returns a pointer on the current interface descriptor + * + * \return pointer on the current interface descriptor. + */ +usb_iface_desc_t UDC_DESC_STORAGE *udc_get_interface_desc(void); + +//@} + +/** + * \ingroup usb_group + * \defgroup usb_device_group USB Stack Device + * + * This module includes USB Stack Device implementation. + * The stack is divided in three parts: + * - USB Device Controller (UDC) provides USB chapter 9 compliance + * - USB Device Interface (UDI) provides USB Class compliance + * - USB Device Driver (UDD) provides USB Driver for each Atmel MCU + + * Many USB Device applications can be implemented on Atmel MCU. + * Atmel provides many application notes for different applications: + * - AVR4900, provides general information about Device Stack + * - AVR4901, explains how to create a new class + * - AVR4902, explains how to create a composite device + * - AVR49xx, all device classes provided in ASF have an application note + * + * A basic USB knowledge is required to understand the USB Device + * Class application notes (HID,MS,CDC,PHDC,...). + * Then, to create an USB device with + * only one class provided by ASF, refer directly to the application note + * corresponding to this USB class. The USB Device application note for + * New Class and Composite is dedicated to advanced USB users. + * + * @{ + */ + +//! @} + +#ifdef __cplusplus +} +#endif + +#endif // _UDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udc_desc.h b/tmk_core/protocol/arm_atsam/usb/udc_desc.h new file mode 100644 index 0000000000..9cab03dcb3 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udc_desc.h @@ -0,0 +1,135 @@ +/** + * \file + * + * \brief Common API for USB Device Interface + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDC_DESC_H_ +#define _UDC_DESC_H_ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup udc_group + * \defgroup udc_desc_group USB Device Descriptor + * + * @{ + */ + +/** + * \brief Defines the memory's location of USB descriptors + * + * By default the Descriptor is stored in RAM + * (UDC_DESC_STORAGE is defined empty). + * + * If you have need to free RAM space, + * it is possible to put descriptor in flash in following case: + * - USB driver authorize flash transfer (USBB on UC3 and USB on Mega) + * - USB Device is not high speed (UDC no need to change USB descriptors) + * + * For UC3 application used "const". + * + * For Mega application used "code". + */ +#define UDC_DESC_STORAGE + // Descriptor storage in internal RAM +#if (defined UDC_DATA_USE_HRAM_SUPPORT) +#if defined(__GNUC__) +#define UDC_DATA(x) COMPILER_WORD_ALIGNED __attribute__((__section__(".data_hram0"))) +#define UDC_BSS(x) COMPILER_ALIGNED(x) __attribute__((__section__(".bss_hram0"))) +#elif defined(__ICCAVR32__) +#define UDC_DATA(x) COMPILER_ALIGNED(x) __data32 +#define UDC_BSS(x) COMPILER_ALIGNED(x) __data32 +#endif +#else +#define UDC_DATA(x) COMPILER_ALIGNED(x) +#define UDC_BSS(x) COMPILER_ALIGNED(x) +#endif + + + +/** + * \brief Configuration descriptor and UDI link for one USB speed + */ +typedef struct { + //! USB configuration descriptor + usb_conf_desc_t UDC_DESC_STORAGE *desc; + //! Array of UDI API pointer + udi_api_t UDC_DESC_STORAGE *UDC_DESC_STORAGE * udi_apis; +} udc_config_speed_t; + + +/** + * \brief All information about the USB Device + */ +typedef struct { + //! USB device descriptor for low or full speed + usb_dev_desc_t UDC_DESC_STORAGE *confdev_lsfs; + //! USB configuration descriptor and UDI API pointers for low or full speed + udc_config_speed_t UDC_DESC_STORAGE *conf_lsfs; +#ifdef USB_DEVICE_HS_SUPPORT + //! USB device descriptor for high speed + usb_dev_desc_t UDC_DESC_STORAGE *confdev_hs; + //! USB device qualifier, only use in high speed mode + usb_dev_qual_desc_t UDC_DESC_STORAGE *qualifier; + //! USB configuration descriptor and UDI API pointers for high speed + udc_config_speed_t UDC_DESC_STORAGE *conf_hs; +#endif + usb_dev_bos_desc_t UDC_DESC_STORAGE *conf_bos; +} udc_config_t; + +//! Global variables of USB Device Descriptor and UDI links +extern UDC_DESC_STORAGE udc_config_t udc_config; + +//@} + +#ifdef __cplusplus +} +#endif +#endif // _UDC_DESC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udd.h b/tmk_core/protocol/arm_atsam/usb/udd.h new file mode 100644 index 0000000000..b580e58479 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udd.h @@ -0,0 +1,396 @@ +/** + * \file + * + * \brief Common API for USB Device Drivers (UDD) + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDD_H_ +#define _UDD_H_ + +#include "usb_protocol.h" +#include "udc_desc.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup usb_device_group + * \defgroup udd_group USB Device Driver (UDD) + * + * The UDD driver provides a low-level abstraction of the device + * controller hardware. Most events coming from the hardware such as + * interrupts, which may cause the UDD to call into the UDC and UDI. + * + * @{ + */ + +//! \brief Endpoint identifier +typedef uint8_t udd_ep_id_t; + +//! \brief Endpoint transfer status +//! Returned in parameters of callback register via udd_ep_run routine. +typedef enum { + UDD_EP_TRANSFER_OK = 0, + UDD_EP_TRANSFER_ABORT = 1, +} udd_ep_status_t; + +/** + * \brief Global variable to give and record information of the setup request management + * + * This global variable allows to decode and response a setup request. + * It can be updated by udc_process_setup() from UDC or *setup() from UDIs. + */ +typedef struct { + //! Data received in USB SETUP packet + //! Note: The swap of "req.wValues" from uin16_t to le16_t is done by UDD. + usb_setup_req_t req; + + //! Point to buffer to send or fill with data following SETUP packet + //! This buffer must be word align for DATA IN phase (use prefix COMPILER_WORD_ALIGNED for buffer) + uint8_t *payload; + + //! Size of buffer to send or fill, and content the number of byte transfered + uint16_t payload_size; + + //! Callback called after reception of ZLP from setup request + void (*callback) (void); + + //! Callback called when the buffer given (.payload) is full or empty. + //! This one return false to abort data transfer, or true with a new buffer in .payload. + bool(*over_under_run) (void); +} udd_ctrl_request_t; +extern udd_ctrl_request_t udd_g_ctrlreq; + +//! Return true if the setup request \a udd_g_ctrlreq indicates IN data transfer +#define Udd_setup_is_in() \ + (USB_REQ_DIR_IN == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK)) + +//! Return true if the setup request \a udd_g_ctrlreq indicates OUT data transfer +#define Udd_setup_is_out() \ + (USB_REQ_DIR_OUT == (udd_g_ctrlreq.req.bmRequestType & USB_REQ_DIR_MASK)) + +//! Return the type of the SETUP request \a udd_g_ctrlreq. \see usb_reqtype. +#define Udd_setup_type() \ + (udd_g_ctrlreq.req.bmRequestType & USB_REQ_TYPE_MASK) + +//! Return the recipient of the SETUP request \a udd_g_ctrlreq. \see usb_recipient +#define Udd_setup_recipient() \ + (udd_g_ctrlreq.req.bmRequestType & USB_REQ_RECIP_MASK) + +/** + * \brief End of halt callback function type. + * Registered by routine udd_ep_wait_stall_clear() + * Callback called when endpoint stall is cleared. + */ +typedef void (*udd_callback_halt_cleared_t) (void); + +/** + * \brief End of transfer callback function type. + * Registered by routine udd_ep_run() + * Callback called by USB interrupt after data transfer or abort (reset,...). + * + * \param status UDD_EP_TRANSFER_OK, if transfer is complete + * \param status UDD_EP_TRANSFER_ABORT, if transfer is aborted + * \param n number of data transfered + */ +typedef void (*udd_callback_trans_t) (udd_ep_status_t status, + iram_size_t nb_transfered, udd_ep_id_t ep); + +/** + * \brief Authorizes the VBUS event + * + * \return true, if the VBUS monitoring is possible. + */ +bool udd_include_vbus_monitoring(void); + +/** + * \brief Enables the USB Device mode + */ +void udd_enable(void); + +/** + * \brief Disables the USB Device mode + */ +void udd_disable(void); + +/** + * \brief Attach device to the bus when possible + * + * \warning If a VBus control is included in driver, + * then it will attach device when an acceptable Vbus + * level from the host is detected. + */ +void udd_attach(void); + +/** + * \brief Detaches the device from the bus + * + * The driver must remove pull-up on USB line D- or D+. + */ +void udd_detach(void); + +/** + * \brief Test whether the USB Device Controller is running at high + * speed or not. + * + * \return \c true if the Device is running at high speed mode, otherwise \c false. + */ +bool udd_is_high_speed(void); + +/** + * \brief Changes the USB address of device + * + * \param address New USB address + */ +void udd_set_address(uint8_t address); + +/** + * \brief Returns the USB address of device + * + * \return USB address + */ +uint8_t udd_getaddress(void); + +/** + * \brief Returns the current start of frame number + * + * \return current start of frame number. + */ +uint16_t udd_get_frame_number(void); + +/** + * \brief Returns the current micro start of frame number + * + * \return current micro start of frame number required in high speed mode. + */ +uint16_t udd_get_micro_frame_number(void); + +/*! \brief The USB driver sends a resume signal called Upstream Resume + */ +void udd_send_remotewakeup(void); + +/** + * \brief Load setup payload + * + * \param payload Pointer on payload + * \param payload_size Size of payload + */ +void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size ); + + +/** + * \name Endpoint Management + * + * The following functions allow drivers to create and remove + * endpoints, as well as set, clear and query their "halted" and + * "wedged" states. + */ +//@{ + +#if (USB_DEVICE_MAX_EP != 0) + +/** + * \brief Configures and enables an endpoint + * + * \param ep Endpoint number including direction (USB_EP_DIR_IN/USB_EP_DIR_OUT). + * \param bmAttributes Attributes of endpoint declared in the descriptor. + * \param MaxEndpointSize Endpoint maximum size + * + * \return \c 1 if the endpoint is enabled, otherwise \c 0. + */ +bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, + uint16_t MaxEndpointSize); + +/** + * \brief Disables an endpoint + * + * \param ep Endpoint number including direction (USB_EP_DIR_IN/USB_EP_DIR_OUT). + */ +void udd_ep_free(udd_ep_id_t ep); + +/** + * \brief Check if the endpoint \a ep is halted. + * + * \param ep The ID of the endpoint to check. + * + * \return \c 1 if \a ep is halted, otherwise \c 0. + */ +bool udd_ep_is_halted(udd_ep_id_t ep); + +/** + * \brief Set the halted state of the endpoint \a ep + * + * After calling this function, any transaction on \a ep will result + * in a STALL handshake being sent. Any pending transactions will be + * performed first, however. + * + * \param ep The ID of the endpoint to be halted + * + * \return \c 1 if \a ep is halted, otherwise \c 0. + */ +bool udd_ep_set_halt(udd_ep_id_t ep); + +/** + * \brief Clear the halted state of the endpoint \a ep + * + * After calling this function, any transaction on \a ep will + * be handled normally, i.e. a STALL handshake will not be sent, and + * the data toggle sequence will start at DATA0. + * + * \param ep The ID of the endpoint to be un-halted + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +bool udd_ep_clear_halt(udd_ep_id_t ep); + +/** + * \brief Registers a callback to call when endpoint halt is cleared + * + * \param ep The ID of the endpoint to use + * \param callback NULL or function to call when endpoint halt is cleared + * + * \warning if the endpoint is not halted then the \a callback is called immediately. + * + * \return \c 1 if the register is accepted, otherwise \c 0. + */ +bool udd_ep_wait_stall_clear(udd_ep_id_t ep, + udd_callback_halt_cleared_t callback); + +/** + * \brief Allows to receive or send data on an endpoint + * + * The driver uses a specific DMA USB to transfer data + * from internal RAM to endpoint, if this one is available. + * When the transfer is finished or aborted (stall, reset, ...), the \a callback is called. + * The \a callback returns the transfer status and eventually the number of byte transfered. + * Note: The control endpoint is not authorized. + * + * \param ep The ID of the endpoint to use + * \param b_shortpacket Enabled automatic short packet + * \param buf Buffer on Internal RAM to send or fill. + * It must be align, then use COMPILER_WORD_ALIGNED. + * \param buf_size Buffer size to send or fill + * \param callback NULL or function to call at the end of transfer + * + * \warning About \a b_shortpacket, for IN endpoint it means that a short packet + * (or a Zero Length Packet) will be sent to the USB line to properly close the usb + * transfer at the end of the data transfer. + * For Bulk and Interrupt OUT endpoint, it will automatically stop the transfer + * at the end of the data transfer (received short packet). + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, + uint8_t *buf, iram_size_t buf_size, + udd_callback_trans_t callback); +/** + * \brief Aborts transfer on going on endpoint + * + * If a transfer is on going, then it is stopped and + * the callback registered is called to signal the end of transfer. + * Note: The control endpoint is not authorized. + * + * \param ep Endpoint to abort + */ +void udd_ep_abort(udd_ep_id_t ep); + +#endif + +//@} + + +/** + * \name High speed test mode management + * + * The following functions allow the device to jump to a specific test mode required in high speed mode. + */ +//@{ +void udd_test_mode_j(void); +void udd_test_mode_k(void); +void udd_test_mode_se0_nak(void); +void udd_test_mode_packet(void); +//@} + + +/** + * \name UDC callbacks to provide for UDD + * + * The following callbacks are used by UDD. + */ +//@{ + +/** + * \brief Decodes and manages a setup request + * + * The driver call it when a SETUP packet is received. + * The \c udd_g_ctrlreq contains the data of SETUP packet. + * If this callback accepts the setup request then it must + * return \c 1 and eventually update \c udd_g_ctrlreq to send or receive data. + * + * \return \c 1 if the request is accepted, otherwise \c 0. + */ +extern bool udc_process_setup(void); + +/** + * \brief Reset the UDC + * + * The UDC must reset all configuration. + */ +extern void udc_reset(void); + +/** + * \brief To signal that a SOF is occurred + * + * The UDC must send the signal to all UDIs enabled + */ +extern void udc_sof_notify(void); + +//@} + +//@} + +#ifdef __cplusplus +} +#endif +#endif // _UDD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi.h b/tmk_core/protocol/arm_atsam/usb/udi.h new file mode 100644 index 0000000000..9e4d4baf7f --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi.h @@ -0,0 +1,133 @@ +/** + * \file + * + * \brief Common API for USB Device Interface + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDI_H_ +#define _UDI_H_ + +#include "conf_usb.h" +#include "usb_protocol.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup usb_device_group + * \defgroup udi_group USB Device Interface (UDI) + * The UDI provides a common API for all classes, + * and this is used by UDC for the main control of USB Device interface. + * @{ + */ + +/** + * \brief UDI API. + * + * The callbacks within this structure are called only by + * USB Device Controller (UDC) + * + * The udc_get_interface_desc() can be use by UDI to know the interface descriptor + * selected by UDC. + */ +typedef struct { + /** + * \brief Enable the interface. + * + * This function is called when the host selects a configuration + * to which this interface belongs through a Set Configuration + * request, and when the host selects an alternate setting of + * this interface through a Set Interface request. + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ + bool(*enable) (void); + + /** + * \brief Disable the interface. + * + * This function is called when this interface is currently + * active, and + * - the host selects any configuration through a Set + * Configuration request, or + * - the host issues a USB reset, or + * - the device is detached from the host (i.e. Vbus is no + * longer present) + */ + void (*disable) (void); + + /** + * \brief Handle a control request directed at an interface. + * + * This function is called when this interface is currently + * active and the host sends a SETUP request + * with this interface as the recipient. + * + * Use udd_g_ctrlreq to decode and response to SETUP request. + * + * \return \c 1 if this interface supports the SETUP request, otherwise \c 0. + */ + bool(*setup) (void); + + /** + * \brief Returns the current setting of the selected interface. + * + * This function is called when UDC when know alternate setting of selected interface. + * + * \return alternate setting of selected interface + */ + uint8_t(*getsetting) (void); + + /** + * \brief To signal that a SOF is occurred + */ + void(*sof_notify) (void); +} udi_api_t; + +//@} + +#ifdef __cplusplus +} +#endif +#endif // _UDI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c new file mode 100644 index 0000000000..b4159d3251 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -0,0 +1,1384 @@ +/** + * \file + * + * \brief USB Device Communication Device Class (CDC) interface. + * + * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "samd51j18a.h" +#include "conf_usb.h" +#include "usb_protocol.h" +#include "usb_protocol_cdc.h" +#include "udd.h" +#include "udc.h" +#include "udi_cdc.h" +#include +#include "udi_cdc_conf.h" +#include "udi_device_conf.h" +#include "spfssf.h" +#include "stdarg.h" +#include "tmk_core/protocol/arm_atsam/clks.h" + +#ifdef CDC + +#ifdef UDI_CDC_LOW_RATE +# ifdef USB_DEVICE_HS_SUPPORT +# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) +# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) +# else +# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_FS_SIZE) +# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_FS_SIZE) +# endif +#else +# ifdef USB_DEVICE_HS_SUPPORT +# define UDI_CDC_TX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) +# define UDI_CDC_RX_BUFFERS (UDI_CDC_DATA_EPS_HS_SIZE) +# else +# define UDI_CDC_TX_BUFFERS (5*UDI_CDC_DATA_EPS_FS_SIZE) +# define UDI_CDC_RX_BUFFERS (5*UDI_CDC_DATA_EPS_FS_SIZE) +# endif +#endif + +#ifndef UDI_CDC_TX_EMPTY_NOTIFY +# define UDI_CDC_TX_EMPTY_NOTIFY(port) +#endif + +/** + * \ingroup udi_cdc_group + * \defgroup udi_cdc_group_udc Interface with USB Device Core (UDC) + * + * Structures and functions required by UDC. + * + * @{ + */ +bool udi_cdc_comm_enable(void); +void udi_cdc_comm_disable(void); +bool udi_cdc_comm_setup(void); +bool udi_cdc_data_enable(void); +void udi_cdc_data_disable(void); +bool udi_cdc_data_setup(void); +uint8_t udi_cdc_getsetting(void); +void udi_cdc_data_sof_notify(void); +UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm = { + .enable = udi_cdc_comm_enable, + .disable = udi_cdc_comm_disable, + .setup = udi_cdc_comm_setup, + .getsetting = udi_cdc_getsetting, + .sof_notify = NULL +}; +UDC_DESC_STORAGE udi_api_t udi_api_cdc_data = { + .enable = udi_cdc_data_enable, + .disable = udi_cdc_data_disable, + .setup = udi_cdc_data_setup, + .getsetting = udi_cdc_getsetting, + .sof_notify = udi_cdc_data_sof_notify, +}; +//@} + +/** + * \ingroup udi_cdc_group + * \defgroup udi_cdc_group_internal Implementation of UDI CDC + * + * Class internal implementation + * @{ + */ + +/** + * \name Internal routines + */ +//@{ + +/** + * \name Routines to control serial line + */ +//@{ + +/** + * \brief Returns the port number corresponding at current setup request + * + * \return port number + */ +static uint8_t udi_cdc_setup_to_port(void); + +/** + * \brief Sends line coding to application + * + * Called after SETUP request when line coding data is received. + */ +static void udi_cdc_line_coding_received(void); + +/** + * \brief Records new state + * + * \param port Communication port number to manage + * \param b_set State is enabled if true, else disabled + * \param bit_mask Field to process (see CDC_SERIAL_STATE_ defines) + */ +static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask); + +/** + * \brief Check and eventually notify the USB host of new state + * + * \param port Communication port number to manage + * \param ep Port communication endpoint + */ +static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep); + +/** + * \brief Ack sent of serial state message + * Callback called after serial state message sent + * + * \param status UDD_EP_TRANSFER_OK, if transfer finished + * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted + * \param n number of data transfered + */ +static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); + +//@} + +/** + * \name Routines to process data transfer + */ +//@{ + +/** + * \brief Enable the reception of data from the USB host + * + * The value udi_cdc_rx_trans_sel indicate the RX buffer to fill. + * + * \param port Communication port number to manage + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +static bool udi_cdc_rx_start(uint8_t port); + +/** + * \brief Update rx buffer management with a new data + * Callback called after data reception on USB line + * + * \param status UDD_EP_TRANSFER_OK, if transfer finish + * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted + * \param n number of data received + */ +static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); + +/** + * \brief Ack sent of tx buffer + * Callback called after data transfer on USB line + * + * \param status UDD_EP_TRANSFER_OK, if transfer finished + * \param status UDD_EP_TRANSFER_ABORT, if transfer aborted + * \param n number of data transfered + */ +static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep); + +/** + * \brief Send buffer on line or wait a SOF event + * + * \param port Communication port number to manage + */ +static void udi_cdc_tx_send(uint8_t port); + +//@} + +//@} + +/** + * \name Information about configuration of communication line + */ +//@{ +COMPILER_WORD_ALIGNED +static usb_cdc_line_coding_t udi_cdc_line_coding[UDI_CDC_PORT_NB]; +static bool udi_cdc_serial_state_msg_ongoing[UDI_CDC_PORT_NB]; +static volatile le16_t udi_cdc_state[UDI_CDC_PORT_NB]; +COMPILER_WORD_ALIGNED static usb_cdc_notify_serial_state_t uid_cdc_state_msg[UDI_CDC_PORT_NB]; + +//! Status of CDC COMM interfaces +static volatile uint8_t udi_cdc_nb_comm_enabled = 0; +//@} + +/** + * \name Variables to manage RX/TX transfer requests + * Two buffers for each sense are used to optimize the speed. + */ +//@{ + +//! Status of CDC DATA interfaces +static volatile uint8_t udi_cdc_nb_data_enabled = 0; +static volatile bool udi_cdc_data_running = false; +//! Buffer to receive data +COMPILER_WORD_ALIGNED static uint8_t udi_cdc_rx_buf[UDI_CDC_PORT_NB][2][UDI_CDC_RX_BUFFERS]; +//! Data available in RX buffers +static volatile uint16_t udi_cdc_rx_buf_nb[UDI_CDC_PORT_NB][2]; +//! Give the current RX buffer used (rx0 if 0, rx1 if 1) +static volatile uint8_t udi_cdc_rx_buf_sel[UDI_CDC_PORT_NB]; +//! Read position in current RX buffer +static volatile uint16_t udi_cdc_rx_pos[UDI_CDC_PORT_NB]; +//! Signal a transfer on-going +static volatile bool udi_cdc_rx_trans_ongoing[UDI_CDC_PORT_NB]; + +//! Define a transfer halted +#define UDI_CDC_TRANS_HALTED 2 + +//! Buffer to send data +COMPILER_WORD_ALIGNED static uint8_t udi_cdc_tx_buf[UDI_CDC_PORT_NB][2][UDI_CDC_TX_BUFFERS]; +//! Data available in TX buffers +static uint16_t udi_cdc_tx_buf_nb[UDI_CDC_PORT_NB][2]; +//! Give current TX buffer used (tx0 if 0, tx1 if 1) +static volatile uint8_t udi_cdc_tx_buf_sel[UDI_CDC_PORT_NB]; +//! Value of SOF during last TX transfer +static uint16_t udi_cdc_tx_sof_num[UDI_CDC_PORT_NB]; +//! Signal a transfer on-going +static volatile bool udi_cdc_tx_trans_ongoing[UDI_CDC_PORT_NB]; +//! Signal that both buffer content data to send +static volatile bool udi_cdc_tx_both_buf_to_send[UDI_CDC_PORT_NB]; + +//@} + +bool udi_cdc_comm_enable(void) +{ + uint8_t port; + uint8_t iface_comm_num; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; + udi_cdc_nb_comm_enabled = 0; +//#else +// if (udi_cdc_nb_comm_enabled > UDI_CDC_PORT_NB) { +// udi_cdc_nb_comm_enabled = 0; +// } +// port = udi_cdc_nb_comm_enabled; +//#endif + + // Initialize control signal management + udi_cdc_state[port] = CPU_TO_LE16(0); + + uid_cdc_state_msg[port].header.bmRequestType = + USB_REQ_DIR_IN | USB_REQ_TYPE_CLASS | + USB_REQ_RECIP_INTERFACE; + uid_cdc_state_msg[port].header.bNotification = USB_REQ_CDC_NOTIFY_SERIAL_STATE; + uid_cdc_state_msg[port].header.wValue = LE16(0); + + /* + switch (port) { + #define UDI_CDC_PORT_TO_IFACE_COMM(index, unused) \ + case index: \ + iface_comm_num = UDI_CDC_COMM_IFACE_NUMBER_##index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_IFACE_COMM, ~) + #undef UDI_CDC_PORT_TO_IFACE_COMM + default: + iface_comm_num = UDI_CDC_COMM_IFACE_NUMBER_0; + break; + } + */ + iface_comm_num = UDI_CDC_COMM_IFACE_NUMBER_0; + + uid_cdc_state_msg[port].header.wIndex = LE16(iface_comm_num); + uid_cdc_state_msg[port].header.wLength = LE16(2); + uid_cdc_state_msg[port].value = CPU_TO_LE16(0); + + udi_cdc_line_coding[port].dwDTERate = CPU_TO_LE32(UDI_CDC_DEFAULT_RATE); + udi_cdc_line_coding[port].bCharFormat = UDI_CDC_DEFAULT_STOPBITS; + udi_cdc_line_coding[port].bParityType = UDI_CDC_DEFAULT_PARITY; + udi_cdc_line_coding[port].bDataBits = UDI_CDC_DEFAULT_DATABITS; + // Call application callback + // to initialize memories or indicate that interface is enabled +#if 0 + UDI_CDC_SET_CODING_EXT(port,(&udi_cdc_line_coding[port])); + if (!UDI_CDC_ENABLE_EXT(port)) { + return false; + } +#endif + udi_cdc_nb_comm_enabled++; + return true; +} + +bool udi_cdc_data_enable(void) +{ + uint8_t port; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; + udi_cdc_nb_data_enabled = 0; +//#else +// if (udi_cdc_nb_data_enabled > UDI_CDC_PORT_NB) { +// udi_cdc_nb_data_enabled = 0; +// } +// port = udi_cdc_nb_data_enabled; +//#endif + + // Initialize TX management + udi_cdc_tx_trans_ongoing[port] = false; + udi_cdc_tx_both_buf_to_send[port] = false; + udi_cdc_tx_buf_sel[port] = 0; + udi_cdc_tx_buf_nb[port][0] = 0; + udi_cdc_tx_buf_nb[port][1] = 0; + udi_cdc_tx_sof_num[port] = 0; + udi_cdc_tx_send(port); + + // Initialize RX management + udi_cdc_rx_trans_ongoing[port] = false; + udi_cdc_rx_buf_sel[port] = 0; + udi_cdc_rx_buf_nb[port][0] = 0; + udi_cdc_rx_buf_nb[port][1] = 0; + udi_cdc_rx_pos[port] = 0; + if (!udi_cdc_rx_start(port)) { + return false; + } + udi_cdc_nb_data_enabled++; + if (udi_cdc_nb_data_enabled == UDI_CDC_PORT_NB) { + udi_cdc_data_running = true; + } + return true; +} + +void udi_cdc_comm_disable(void) +{ + Assert(udi_cdc_nb_comm_enabled != 0); + udi_cdc_nb_comm_enabled--; +} + +void udi_cdc_data_disable(void) +{ +// uint8_t port; + + Assert(udi_cdc_nb_data_enabled != 0); + udi_cdc_nb_data_enabled--; +// port = udi_cdc_nb_data_enabled; +// UDI_CDC_DISABLE_EXT(port); + udi_cdc_data_running = false; +} + +bool udi_cdc_comm_setup(void) +{ + uint8_t port = udi_cdc_setup_to_port(); + + if (Udd_setup_is_in()) { + // GET Interface Requests + if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { + // Requests Class Interface Get + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_CDC_GET_LINE_CODING: + // Get configuration of CDC line + if (sizeof(usb_cdc_line_coding_t) != + udd_g_ctrlreq.req.wLength) + return false; // Error for USB host + udd_g_ctrlreq.payload = + (uint8_t *) & + udi_cdc_line_coding[port]; + udd_g_ctrlreq.payload_size = + sizeof(usb_cdc_line_coding_t); + return true; + } + } + } + if (Udd_setup_is_out()) { + // SET Interface Requests + if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { + // Requests Class Interface Set + switch (udd_g_ctrlreq.req.bRequest) { + case USB_REQ_CDC_SET_LINE_CODING: + // Change configuration of CDC line + if (sizeof(usb_cdc_line_coding_t) != + udd_g_ctrlreq.req.wLength) + return false; // Error for USB host + udd_g_ctrlreq.callback = + udi_cdc_line_coding_received; + udd_g_ctrlreq.payload = + (uint8_t *) & + udi_cdc_line_coding[port]; + udd_g_ctrlreq.payload_size = + sizeof(usb_cdc_line_coding_t); + return true; + case USB_REQ_CDC_SET_CONTROL_LINE_STATE: + // According cdc spec 1.1 chapter 6.2.14 +// UDI_CDC_SET_DTR_EXT(port, (0 != +// (udd_g_ctrlreq.req.wValue +// & CDC_CTRL_SIGNAL_DTE_PRESENT))); +// UDI_CDC_SET_RTS_EXT(port, (0 != +// (udd_g_ctrlreq.req.wValue +// & CDC_CTRL_SIGNAL_ACTIVATE_CARRIER))); + return true; + } + } + } + return false; // request Not supported +} + +bool udi_cdc_data_setup(void) +{ + return false; // request Not supported +} + +uint8_t udi_cdc_getsetting(void) +{ + return 0; // CDC don't have multiple alternate setting +} + +void udi_cdc_data_sof_notify(void) +{ + static uint8_t port_notify = 0; + + // A call of udi_cdc_data_sof_notify() is done for each port + udi_cdc_tx_send(port_notify); + /* +#if UDI_CDC_PORT_NB != 1 // To optimize code + port_notify++; + if (port_notify >= UDI_CDC_PORT_NB) { + port_notify = 0; + } +#endif + */ +} + + +//------------------------------------------------- +//------- Internal routines to control serial line + +static uint8_t udi_cdc_setup_to_port(void) +{ + uint8_t port; + + /* + switch (udd_g_ctrlreq.req.wIndex & 0xFF) { +#define UDI_CDC_IFACE_COMM_TO_PORT(iface, unused) \ + case UDI_CDC_COMM_IFACE_NUMBER_##iface: \ + port = iface; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_IFACE_COMM_TO_PORT, ~) +#undef UDI_CDC_IFACE_COMM_TO_PORT + default: + port = 0; + break; + } + */ + port = 0; + + return port; +} + +static void udi_cdc_line_coding_received(void) +{ + uint8_t port = udi_cdc_setup_to_port(); + UNUSED(port); + +// UDI_CDC_SET_CODING_EXT(port, (&udi_cdc_line_coding[port])); +} + +static void udi_cdc_ctrl_state_change(uint8_t port, bool b_set, le16_t bit_mask) +{ + udd_ep_id_t ep_comm; + uint32_t irqflags; //irqflags_t + + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + // Update state + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + if (b_set) { + udi_cdc_state[port] |= bit_mask; + } else { + udi_cdc_state[port] &= ~(unsigned)bit_mask; + } + __DMB(); + __set_PRIMASK(irqflags); + + /* + // Send it if possible and state changed + switch (port) { +#define UDI_CDC_PORT_TO_COMM_EP(index, unused) \ + case index: \ + ep_comm = UDI_CDC_COMM_EP_##index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_COMM_EP, ~) +#undef UDI_CDC_PORT_TO_COMM_EP + default: + ep_comm = UDI_CDC_COMM_EP_0; + break; + } + */ + ep_comm = UDI_CDC_COMM_EP_0; + + udi_cdc_ctrl_state_notify(port, ep_comm); +} + + +static void udi_cdc_ctrl_state_notify(uint8_t port, udd_ep_id_t ep) +{ +#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +#endif + + // Send it if possible and state changed + if ((!udi_cdc_serial_state_msg_ongoing[port]) + && (udi_cdc_state[port] != uid_cdc_state_msg[port].value)) { + // Fill notification message + uid_cdc_state_msg[port].value = udi_cdc_state[port]; + // Send notification message + udi_cdc_serial_state_msg_ongoing[port] = + udd_ep_run(ep, + false, + (uint8_t *) & uid_cdc_state_msg[port], + sizeof(uid_cdc_state_msg[0]), + udi_cdc_serial_state_msg_sent); + } +} + + +static void udi_cdc_serial_state_msg_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) +{ + uint8_t port; + UNUSED(n); + UNUSED(status); + + /* + switch (ep) { +#define UDI_CDC_GET_PORT_FROM_COMM_EP(iface, unused) \ + case UDI_CDC_COMM_EP_##iface: \ + port = iface; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_GET_PORT_FROM_COMM_EP, ~) +#undef UDI_CDC_GET_PORT_FROM_COMM_EP + default: + port = 0; + break; + } + */ + port = 0; + + udi_cdc_serial_state_msg_ongoing[port] = false; + + // For the irregular signals like break, the incoming ring signal, + // or the overrun error state, this will reset their values to zero + // and again will not send another notification until their state changes. + udi_cdc_state[port] &= ~(CDC_SERIAL_STATE_BREAK | + CDC_SERIAL_STATE_RING | + CDC_SERIAL_STATE_FRAMING | + CDC_SERIAL_STATE_PARITY | CDC_SERIAL_STATE_OVERRUN); + uid_cdc_state_msg[port].value &= ~(CDC_SERIAL_STATE_BREAK | + CDC_SERIAL_STATE_RING | + CDC_SERIAL_STATE_FRAMING | + CDC_SERIAL_STATE_PARITY | CDC_SERIAL_STATE_OVERRUN); + // Send it if possible and state changed + udi_cdc_ctrl_state_notify(port, ep); +} + +//------------------------------------------------- +//------- Internal routines to process data transfer + +static bool udi_cdc_rx_start(uint8_t port) +{ + uint32_t irqflags; //irqflags_t + uint8_t buf_sel_trans; + udd_ep_id_t ep; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + buf_sel_trans = udi_cdc_rx_buf_sel[port]; + if (udi_cdc_rx_trans_ongoing[port] || + (udi_cdc_rx_pos[port] < udi_cdc_rx_buf_nb[port][buf_sel_trans])) { + // Transfer already on-going or current buffer no empty + __DMB(); + __set_PRIMASK(irqflags); + return false; + } + + // Change current buffer + udi_cdc_rx_pos[port] = 0; + udi_cdc_rx_buf_sel[port] = (buf_sel_trans==0)?1:0; + + // Start transfer on RX + udi_cdc_rx_trans_ongoing[port] = true; + __DMB(); + __set_PRIMASK(irqflags); + + if (udi_cdc_multi_is_rx_ready(port)) { +// UDI_CDC_RX_NOTIFY(port); + } + + /* + // Send the buffer with enable of short packet + switch (port) { +#define UDI_CDC_PORT_TO_DATA_EP_OUT(index, unused) \ + case index: \ + ep = UDI_CDC_DATA_EP_OUT_##index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_OUT, ~) +#undef UDI_CDC_PORT_TO_DATA_EP_OUT + default: + ep = UDI_CDC_DATA_EP_OUT_0; + break; + } + */ + ep = UDI_CDC_DATA_EP_OUT_0; + + return udd_ep_run(ep, + true, + udi_cdc_rx_buf[port][buf_sel_trans], + UDI_CDC_RX_BUFFERS, + udi_cdc_data_received); +} + +static void udi_cdc_data_received(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) +{ + uint8_t buf_sel_trans; + uint8_t port; + + /* + switch (ep) { +#define UDI_CDC_DATA_EP_OUT_TO_PORT(index, unused) \ + case UDI_CDC_DATA_EP_OUT_##index: \ + port = index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DATA_EP_OUT_TO_PORT, ~) +#undef UDI_CDC_DATA_EP_OUT_TO_PORT + default: + port = 0; + break; + } + */ + port = 0; + + if (UDD_EP_TRANSFER_OK != status) { + // Abort reception + return; + } + + buf_sel_trans = (udi_cdc_rx_buf_sel[port]==0)?1:0; + + if (!n) { + udd_ep_run( ep, + true, + udi_cdc_rx_buf[port][buf_sel_trans], + UDI_CDC_RX_BUFFERS, + udi_cdc_data_received); + return; + } + + udi_cdc_rx_buf_nb[port][buf_sel_trans] = n; + udi_cdc_rx_trans_ongoing[port] = false; + udi_cdc_rx_start(port); +} + +static void udi_cdc_data_sent(udd_ep_status_t status, iram_size_t n, udd_ep_id_t ep) +{ + uint8_t port; + UNUSED(n); + + /* + switch (ep) { +#define UDI_CDC_DATA_EP_IN_TO_PORT(index, unused) \ + case UDI_CDC_DATA_EP_IN_##index: \ + port = index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_DATA_EP_IN_TO_PORT, ~) +#undef UDI_CDC_DATA_EP_IN_TO_PORT + default: + port = 0; + break; + } + */ + port = 0; + + if (UDD_EP_TRANSFER_OK != status) { + // Abort transfer + return; + } + + udi_cdc_tx_buf_nb[port][(udi_cdc_tx_buf_sel[port]==0)?1:0] = 0; + udi_cdc_tx_both_buf_to_send[port] = false; + udi_cdc_tx_trans_ongoing[port] = false; + + if (n != 0) { + UDI_CDC_TX_EMPTY_NOTIFY(port); + } + + udi_cdc_tx_send(port); +} + +static void udi_cdc_tx_send(uint8_t port) +{ + uint32_t irqflags; //irqflags_t + uint8_t buf_sel_trans; + bool b_short_packet; + udd_ep_id_t ep; + static uint16_t sof_zlp_counter = 0; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + if (udi_cdc_tx_trans_ongoing[port]) { + return; // Already on going or wait next SOF to send next data + } + if (udd_is_high_speed()) { + if (udi_cdc_tx_sof_num[port] == udd_get_micro_frame_number()) { + return; // Wait next SOF to send next data + } + }else{ + if (udi_cdc_tx_sof_num[port] == udd_get_frame_number()) { + return; // Wait next SOF to send next data + } + } + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + buf_sel_trans = udi_cdc_tx_buf_sel[port]; + if (udi_cdc_tx_buf_nb[port][buf_sel_trans] == 0) { + sof_zlp_counter++; + if (((!udd_is_high_speed()) && (sof_zlp_counter < 100)) + || (udd_is_high_speed() && (sof_zlp_counter < 800))) { + __DMB(); + __set_PRIMASK(irqflags); + return; + } + } + sof_zlp_counter = 0; + + if (!udi_cdc_tx_both_buf_to_send[port]) { + // Send current Buffer + // and switch the current buffer + udi_cdc_tx_buf_sel[port] = (buf_sel_trans==0)?1:0; + }else{ + // Send the other Buffer + // and no switch the current buffer + buf_sel_trans = (buf_sel_trans==0)?1:0; + } + udi_cdc_tx_trans_ongoing[port] = true; + __DMB(); + __set_PRIMASK(irqflags); + + b_short_packet = (udi_cdc_tx_buf_nb[port][buf_sel_trans] != UDI_CDC_TX_BUFFERS); + if (b_short_packet) { + if (udd_is_high_speed()) { + udi_cdc_tx_sof_num[port] = udd_get_micro_frame_number(); + }else{ + udi_cdc_tx_sof_num[port] = udd_get_frame_number(); + } + }else{ + udi_cdc_tx_sof_num[port] = 0; // Force next transfer without wait SOF + } + + /* + // Send the buffer with enable of short packet + switch (port) { +#define UDI_CDC_PORT_TO_DATA_EP_IN(index, unused) \ + case index: \ + ep = UDI_CDC_DATA_EP_IN_##index; \ + break; + MREPEAT(UDI_CDC_PORT_NB, UDI_CDC_PORT_TO_DATA_EP_IN, ~) +#undef UDI_CDC_PORT_TO_DATA_EP_IN + default: + ep = UDI_CDC_DATA_EP_IN_0; + break; + } + */ + ep = UDI_CDC_DATA_EP_IN_0; + + udd_ep_run( ep, + b_short_packet, + udi_cdc_tx_buf[port][buf_sel_trans], + udi_cdc_tx_buf_nb[port][buf_sel_trans], + udi_cdc_data_sent); +} + +//--------------------------------------------- +//------- Application interface + +void udi_cdc_ctrl_signal_dcd(bool b_set) +{ + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DCD); +} + +void udi_cdc_ctrl_signal_dsr(bool b_set) +{ + udi_cdc_ctrl_state_change(0, b_set, CDC_SERIAL_STATE_DSR); +} + +void udi_cdc_signal_framing_error(void) +{ + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_FRAMING); +} + +void udi_cdc_signal_parity_error(void) +{ + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_PARITY); +} + +void udi_cdc_signal_overrun(void) +{ + udi_cdc_ctrl_state_change(0, true, CDC_SERIAL_STATE_OVERRUN); +} + +void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set) +{ + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DCD); +} + +void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set) +{ + udi_cdc_ctrl_state_change(port, b_set, CDC_SERIAL_STATE_DSR); +} + +void udi_cdc_multi_signal_framing_error(uint8_t port) +{ + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_FRAMING); +} + +void udi_cdc_multi_signal_parity_error(uint8_t port) +{ + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_PARITY); +} + +void udi_cdc_multi_signal_overrun(uint8_t port) +{ + udi_cdc_ctrl_state_change(port, true, CDC_SERIAL_STATE_OVERRUN); +} + +iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port) +{ + uint32_t irqflags; //irqflags_t + uint16_t pos; + iram_size_t nb_received; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + pos = udi_cdc_rx_pos[port]; + nb_received = udi_cdc_rx_buf_nb[port][udi_cdc_rx_buf_sel[port]] - pos; + __DMB(); + __set_PRIMASK(irqflags); + return nb_received; +} + +iram_size_t udi_cdc_get_nb_received_data(void) +{ + return udi_cdc_multi_get_nb_received_data(0); +} + +bool udi_cdc_multi_is_rx_ready(uint8_t port) +{ + return (udi_cdc_multi_get_nb_received_data(port) > 0); +} + +bool udi_cdc_is_rx_ready(void) +{ + return udi_cdc_multi_is_rx_ready(0); +} + +int udi_cdc_multi_getc(uint8_t port) +{ + uint32_t irqflags; //irqflags_t + int rx_data = 0; + bool b_databit_9; + uint16_t pos; + uint8_t buf_sel; + bool again; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + b_databit_9 = (9 == udi_cdc_line_coding[port].bDataBits); + +udi_cdc_getc_process_one_byte: + // Check available data + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + pos = udi_cdc_rx_pos[port]; + buf_sel = udi_cdc_rx_buf_sel[port]; + again = pos >= udi_cdc_rx_buf_nb[port][buf_sel]; + __DMB(); + __set_PRIMASK(irqflags); + while (again) { + if (!udi_cdc_data_running) { + return 0; + } + goto udi_cdc_getc_process_one_byte; + } + + // Read data + rx_data |= udi_cdc_rx_buf[port][buf_sel][pos]; + udi_cdc_rx_pos[port] = pos+1; + + udi_cdc_rx_start(port); + + if (b_databit_9) { + // Receive MSB + b_databit_9 = false; + rx_data = rx_data << 8; + goto udi_cdc_getc_process_one_byte; + } + return rx_data; +} + +int udi_cdc_getc(void) +{ + return udi_cdc_multi_getc(0); +} + +iram_size_t udi_cdc_multi_read_buf(uint8_t port, void* buf, iram_size_t size) +{ + uint32_t irqflags; //irqflags_t + uint8_t *ptr_buf = (uint8_t *)buf; + iram_size_t copy_nb; + uint16_t pos; + uint8_t buf_sel; + bool again; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + +udi_cdc_read_buf_loop_wait: + // Check available data + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); pos = udi_cdc_rx_pos[port]; + buf_sel = udi_cdc_rx_buf_sel[port]; + again = pos >= udi_cdc_rx_buf_nb[port][buf_sel]; + __DMB(); + __set_PRIMASK(irqflags); + while (again) { + if (!udi_cdc_data_running) { + return size; + } + goto udi_cdc_read_buf_loop_wait; + } + + // Read data + copy_nb = udi_cdc_rx_buf_nb[port][buf_sel] - pos; + if (copy_nb>size) { + copy_nb = size; + } + memcpy(ptr_buf, &udi_cdc_rx_buf[port][buf_sel][pos], copy_nb); + udi_cdc_rx_pos[port] += copy_nb; + ptr_buf += copy_nb; + size -= copy_nb; + udi_cdc_rx_start(port); + + if (size) { + goto udi_cdc_read_buf_loop_wait; + } + return 0; +} + +static iram_size_t udi_cdc_multi_read_no_polling(uint8_t port, void* buf, iram_size_t size) +{ + uint8_t *ptr_buf = (uint8_t *)buf; + iram_size_t nb_avail_data; + uint16_t pos; + uint8_t buf_sel; + uint32_t irqflags; //irqflags_t + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + //Data interface not started... exit + if (!udi_cdc_data_running) { + return 0; + } + + //Get number of available data + // Check available data + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + pos = udi_cdc_rx_pos[port]; + buf_sel = udi_cdc_rx_buf_sel[port]; + nb_avail_data = udi_cdc_rx_buf_nb[port][buf_sel] - pos; + __DMB(); + __set_PRIMASK(irqflags); + //If the buffer contains less than the requested number of data, + //adjust read size + if(nb_avail_data0) { + memcpy(ptr_buf, &udi_cdc_rx_buf[port][buf_sel][pos], size); + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + udi_cdc_rx_pos[port] += size; + __DMB(); + __set_PRIMASK(irqflags); + ptr_buf += size; + udi_cdc_rx_start(port); + } + return(nb_avail_data); +} + +iram_size_t udi_cdc_read_no_polling(void* buf, iram_size_t size) +{ + return udi_cdc_multi_read_no_polling(0, buf, size); +} + +iram_size_t udi_cdc_read_buf(void* buf, iram_size_t size) +{ + return udi_cdc_multi_read_buf(0, buf, size); +} + +iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port) +{ + uint32_t irqflags; //irqflags_t + iram_size_t buf_sel_nb, retval; + uint8_t buf_sel; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + buf_sel = udi_cdc_tx_buf_sel[port]; + buf_sel_nb = udi_cdc_tx_buf_nb[port][buf_sel]; + if (buf_sel_nb == UDI_CDC_TX_BUFFERS) { + if ((!udi_cdc_tx_trans_ongoing[port]) + && (!udi_cdc_tx_both_buf_to_send[port])) { + /* One buffer is full, but the other buffer is not used. + * (not used = transfer on-going) + * then move to the other buffer to store data */ + udi_cdc_tx_both_buf_to_send[port] = true; + udi_cdc_tx_buf_sel[port] = (buf_sel == 0)? 1 : 0; + buf_sel_nb = 0; + } + } + retval = UDI_CDC_TX_BUFFERS - buf_sel_nb; + __DMB(); + __set_PRIMASK(irqflags); + return retval; +} + +iram_size_t udi_cdc_get_free_tx_buffer(void) +{ + return udi_cdc_multi_get_free_tx_buffer(0); +} + +bool udi_cdc_multi_is_tx_ready(uint8_t port) +{ + return (udi_cdc_multi_get_free_tx_buffer(port) != 0); +} + +bool udi_cdc_is_tx_ready(void) +{ + return udi_cdc_multi_is_tx_ready(0); +} + +int udi_cdc_multi_putc(uint8_t port, int value) +{ + uint32_t irqflags; //irqflags_t + bool b_databit_9; + uint8_t buf_sel; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + b_databit_9 = (9 == udi_cdc_line_coding[port].bDataBits); + +udi_cdc_putc_process_one_byte: + // Check available space + if (!udi_cdc_multi_is_tx_ready(port)) { + if (!udi_cdc_data_running) { + return false; + } + goto udi_cdc_putc_process_one_byte; + } + + // Write value + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + buf_sel = udi_cdc_tx_buf_sel[port]; + udi_cdc_tx_buf[port][buf_sel][udi_cdc_tx_buf_nb[port][buf_sel]++] = value; + __DMB(); + __set_PRIMASK(irqflags); + + if (b_databit_9) { + // Send MSB + b_databit_9 = false; + value = value >> 8; + goto udi_cdc_putc_process_one_byte; + } + return true; +} + +int udi_cdc_putc(int value) +{ + return udi_cdc_multi_putc(0, value); +} + +iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t size) +{ + uint32_t irqflags; //irqflags_t + uint8_t buf_sel; + uint16_t buf_nb; + iram_size_t copy_nb; + uint8_t *ptr_buf = (uint8_t *)buf; + +//#if UDI_CDC_PORT_NB == 1 // To optimize code + port = 0; +//#endif + + if (9 == udi_cdc_line_coding[port].bDataBits) { + size *=2; + } + + udi_cdc_write_buf_loop_wait: + + // Check available space + if (!udi_cdc_multi_is_tx_ready(port)) { + if (!udi_cdc_data_running) { + return size; + } + goto udi_cdc_write_buf_loop_wait; + } + + // Write values + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + buf_sel = udi_cdc_tx_buf_sel[port]; + buf_nb = udi_cdc_tx_buf_nb[port][buf_sel]; + copy_nb = UDI_CDC_TX_BUFFERS - buf_nb; + if (copy_nb > size) { + copy_nb = size; + } + memcpy(&udi_cdc_tx_buf[port][buf_sel][buf_nb], ptr_buf, copy_nb); + udi_cdc_tx_buf_nb[port][buf_sel] = buf_nb + copy_nb; + __DMB(); + __set_PRIMASK(irqflags); + + // Update buffer pointer + ptr_buf = ptr_buf + copy_nb; + size -= copy_nb; + + if (size) { + goto udi_cdc_write_buf_loop_wait; + } + + return 0; +} + +iram_size_t udi_cdc_write_buf(const void* buf, iram_size_t size) +{ + return udi_cdc_multi_write_buf(0, buf, size); +} + +#define MAX_PRINT 256 +#define CDC_SEND_INTERVAL 2 +uint32_t cdc_tx_send_time_next; + +void CDC_send(void) +{ + while (CLK_get_ms() < cdc_tx_send_time_next); + udi_cdc_tx_send(0); + cdc_tx_send_time_next = CLK_get_ms() + CDC_SEND_INTERVAL; +} + +uint32_t CDC_print(char *printbuf) +{ + uint32_t count=0; + char *buf = printbuf; + char c; + + if (CLK_get_ms() < 5000) return 0; + + while ((c = *buf++) != 0 && !(count >= MAX_PRINT)) + { + count++; + if (!udi_cdc_is_tx_ready()) return 0; + udi_cdc_putc(c); + if (count >= UDI_CDC_TX_BUFFERS) + { + count = 0; + CDC_send(); + } + } + if (count) + { + CDC_send(); + } + return 1; +} + + +char printbuf[CDC_PRINTBUF_SIZE]; + +int dpf(const char *_Format, ...) +{ + va_list va; //Variable argument list variable + int result; + + va_start(va,_Format); //Initialize the variable argument list + result = vspf(printbuf, _Format, va); + va_end(va); + + CDC_print(printbuf); + + return result; +} + +//global "inbuf" if desired +inbuf_t inbuf; + +uint32_t CDC_input_buf(inbuf_t inbuf, uint32_t inbuf_size) +{ + int RXChar; + int entered = 0; + + if (!udi_cdc_is_rx_ready()) return 0; + udi_cdc_get_nb_received_data(); + RXChar = udi_cdc_getc(); + + if (RXChar) + { + switch (RXChar) + { + case '\t': //tab - repeat last + inbuf.count=inbuf.lastcount; + inbuf.buf[inbuf.count+1] = 0; + CDC_print(inbuf.buf); + break; + case '\r': //enter + inbuf.buf[inbuf.count]=0; + inbuf.lastcount = inbuf.count; + inbuf.count = 0; + entered = 1; + break; + case '\b': //backspace + if (inbuf.count > 0) { + inbuf.count -= 1; + CDC_print("\b \b\0"); + } + else + CDC_print("\a\0"); + break; + default: + if ((RXChar >= 32) && (RXChar <= 126)) + { + if (inbuf.count < inbuf_size-1) + { + inbuf.buf[inbuf.count] = RXChar; + inbuf.buf[inbuf.count+1] = 0; + CDC_print(&inbuf.buf[inbuf.count]); + inbuf.count += 1; + } + else + CDC_print("\a\0"); + } + break; + } + RXChar = 0; + } + return entered; +} + +uint32_t CDC_input() +{ + return CDC_input_buf(inbuf, CDC_INBUF_SIZE); +} + +void CDC_init(void) +{ + inbuf.count = 0; + inbuf.lastcount = 0; + printbuf[0] = 0; + cdc_tx_send_time_next = CLK_get_ms() + CDC_SEND_INTERVAL; +} + +#else //CDC line 62 + +char printbuf[CDC_PRINTBUF_SIZE]; + +void CDC_send(void) +{ + return; +} + +uint32_t CDC_print(char *printbuf) +{ + return 0; +} + +int dpf(const char *_Format, ...) +{ + return 0; +} + +inbuf_t inbuf; + +uint32_t CDC_input(void) +{ + return 0; +} + +void CDC_init(void) +{ + inbuf.count = 0; + inbuf.lastcount = 0; + printbuf[0]=0; +} + +char printbuf[CDC_PRINTBUF_SIZE]; + +#endif //CDC line 62 + +//@} diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h new file mode 100644 index 0000000000..6b70e96d0e --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h @@ -0,0 +1,381 @@ +/** + * \file + * + * \brief USB Device Communication Device Class (CDC) interface definitions. + * + * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDI_CDC_H_ +#define _UDI_CDC_H_ + +#ifdef CDC + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "usb_protocol_cdc.h" +#include "udd.h" +#include "udc_desc.h" +#include "udi.h" + +// Check the number of port +#ifndef UDI_CDC_PORT_NB +# define UDI_CDC_PORT_NB 1 +#endif +#if (UDI_CDC_PORT_NB > 1) +# error UDI_CDC_PORT_NB must be at most 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \addtogroup udi_cdc_group_udc + * @{ + */ + +//! Global structure which contains standard UDI API for UDC +extern UDC_DESC_STORAGE udi_api_t udi_api_cdc_comm; +extern UDC_DESC_STORAGE udi_api_t udi_api_cdc_data; +//@} + +//#define CDC_ACM_SIZE 64 see usb_protocol_cdc.h +//#define CDC_RX_SIZE 64 + +//! CDC communication endpoints size for all speeds +#define UDI_CDC_COMM_EP_SIZE CDC_ACM_SIZE +//! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) +#define UDI_CDC_DATA_EPS_FS_SIZE CDC_RX_SIZE + +#define CDC_PRINT_BUF_SIZE 256 +extern char printbuf[CDC_PRINT_BUF_SIZE]; + +//@} + +/** + * \ingroup udi_group + * \defgroup udi_cdc_group USB Device Interface (UDI) for Communication Class Device (CDC) + * + * Common APIs used by high level application to use this USB class. + * + * These routines are used to transfer and control data + * to/from USB CDC endpoint. + * + * See \ref udi_cdc_quickstart. + * @{ + */ + +/** + * \name Interface for application with single CDC interface support + */ +//@{ + +/** + * \brief Notify a state change of DCD signal + * + * \param b_set DCD is enabled if true, else disabled + */ +void udi_cdc_ctrl_signal_dcd(bool b_set); + +/** + * \brief Notify a state change of DSR signal + * + * \param b_set DSR is enabled if true, else disabled + */ +void udi_cdc_ctrl_signal_dsr(bool b_set); + +/** + * \brief Notify a framing error + */ +void udi_cdc_signal_framing_error(void); + +/** + * \brief Notify a parity error + */ +void udi_cdc_signal_parity_error(void); + +/** + * \brief Notify a overrun + */ +void udi_cdc_signal_overrun(void); + +/** + * \brief Gets the number of byte received + * + * \return the number of data available + */ +iram_size_t udi_cdc_get_nb_received_data(void); + +/** + * \brief This function checks if a character has been received on the CDC line + * + * \return \c 1 if a byte is ready to be read. + */ +bool udi_cdc_is_rx_ready(void); + +/** + * \brief Waits and gets a value on CDC line + * + * \return value read on CDC line + */ +int udi_cdc_getc(void); + +/** + * \brief Reads a RAM buffer on CDC line + * + * \param buf Values read + * \param size Number of value read + * + * \return the number of data remaining + */ +iram_size_t udi_cdc_read_buf(void* buf, iram_size_t size); + +/** + * \brief Non polling reads of a up to 'size' data from CDC line + * + * \param port Communication port number to manage + * \param buf Buffer where to store read data + * \param size Maximum number of data to read (size of buffer) + * + * \return the number of data effectively read + */ +iram_size_t udi_cdc_read_no_polling(void* buf, iram_size_t size); + +/** + * \brief Gets the number of free byte in TX buffer + * + * \return the number of free byte in TX buffer + */ +iram_size_t udi_cdc_get_free_tx_buffer(void); + +/** + * \brief This function checks if a new character sent is possible + * The type int is used to support scanf redirection from compiler LIB. + * + * \return \c 1 if a new character can be sent + */ +bool udi_cdc_is_tx_ready(void); + +/** + * \brief Puts a byte on CDC line + * The type int is used to support printf redirection from compiler LIB. + * + * \param value Value to put + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +int udi_cdc_putc(int value); + +/** + * \brief Writes a RAM buffer on CDC line + * + * \param buf Values to write + * \param size Number of value to write + * + * \return the number of data remaining + */ +iram_size_t udi_cdc_write_buf(const void* buf, iram_size_t size); +//@} + +/** + * \name Interface for application with multi CDC interfaces support + */ +//@{ + +/** + * \brief Notify a state change of DCD signal + * + * \param port Communication port number to manage + * \param b_set DCD is enabled if true, else disabled + */ +void udi_cdc_multi_ctrl_signal_dcd(uint8_t port, bool b_set); + +/** + * \brief Notify a state change of DSR signal + * + * \param port Communication port number to manage + * \param b_set DSR is enabled if true, else disabled + */ +void udi_cdc_multi_ctrl_signal_dsr(uint8_t port, bool b_set); + +/** + * \brief Notify a framing error + * + * \param port Communication port number to manage + */ +void udi_cdc_multi_signal_framing_error(uint8_t port); + +/** + * \brief Notify a parity error + * + * \param port Communication port number to manage + */ +void udi_cdc_multi_signal_parity_error(uint8_t port); + +/** + * \brief Notify a overrun + * + * \param port Communication port number to manage + */ +void udi_cdc_multi_signal_overrun(uint8_t port); + +/** + * \brief Gets the number of byte received + * + * \param port Communication port number to manage + * + * \return the number of data available + */ +iram_size_t udi_cdc_multi_get_nb_received_data(uint8_t port); + +/** + * \brief This function checks if a character has been received on the CDC line + * + * \param port Communication port number to manage + * + * \return \c 1 if a byte is ready to be read. + */ +bool udi_cdc_multi_is_rx_ready(uint8_t port); + +/** + * \brief Waits and gets a value on CDC line + * + * \param port Communication port number to manage + * + * \return value read on CDC line + */ +int udi_cdc_multi_getc(uint8_t port); + +/** + * \brief Reads a RAM buffer on CDC line + * + * \param port Communication port number to manage + * \param buf Values read + * \param size Number of values read + * + * \return the number of data remaining + */ +iram_size_t udi_cdc_multi_read_buf(uint8_t port, void* buf, iram_size_t size); + +/** + * \brief Gets the number of free byte in TX buffer + * + * \param port Communication port number to manage + * + * \return the number of free byte in TX buffer + */ +iram_size_t udi_cdc_multi_get_free_tx_buffer(uint8_t port); + +/** + * \brief This function checks if a new character sent is possible + * The type int is used to support scanf redirection from compiler LIB. + * + * \param port Communication port number to manage + * + * \return \c 1 if a new character can be sent + */ +bool udi_cdc_multi_is_tx_ready(uint8_t port); + +/** + * \brief Puts a byte on CDC line + * The type int is used to support printf redirection from compiler LIB. + * + * \param port Communication port number to manage + * \param value Value to put + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +int udi_cdc_multi_putc(uint8_t port, int value); + +/** + * \brief Writes a RAM buffer on CDC line + * + * \param port Communication port number to manage + * \param buf Values to write + * \param size Number of value to write + * + * \return the number of data remaining + */ +iram_size_t udi_cdc_multi_write_buf(uint8_t port, const void* buf, iram_size_t size); +//@} + +#define CDC_PRINTBUF_SIZE 256 +extern char printbuf[CDC_PRINTBUF_SIZE]; + +#define CDC_INBUF_SIZE 256 + +typedef struct { + uint32_t count; + uint32_t lastcount; + char buf[CDC_INBUF_SIZE]; +} inbuf_t; + +#else //CDC + +// keep these to accommodate calls if remaining +#define CDC_PRINTBUF_SIZE 1 +extern char printbuf[CDC_PRINTBUF_SIZE]; + +#define CDC_INBUF_SIZE 1 + +typedef struct { + uint32_t count; + uint32_t lastcount; + char buf[CDC_INBUF_SIZE]; +} inbuf_t; + +extern inbuf_t inbuf; + +#endif //CDC + +uint32_t CDC_print(char *printbuf); +uint32_t CDC_input(void); +void CDC_init(void); + +#define __xprintf dpf +int dpf(const char *_Format, ...); + +#ifdef __cplusplus +} +#endif + +#endif // _UDI_CDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h new file mode 100644 index 0000000000..2db61fab54 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc_conf.h @@ -0,0 +1,72 @@ +/** + * \file + * + * \brief Default CDC configuration for a USB Device with a single interface + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDI_CDC_CONF_H_ +#define _UDI_CDC_CONF_H_ + +#include "usb_protocol_cdc.h" +#include "conf_usb.h" +#include "udi_device_conf.h" + +#ifndef UDI_CDC_PORT_NB +#define UDI_CDC_PORT_NB 1 +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#define UDI_CDC_DATA_EP_IN_0 ((CDC_TX_ENDPOINT) | (USB_EP_DIR_IN)) //TX +#define UDI_CDC_DATA_EP_OUT_0 ((CDC_RX_ENDPOINT) | (USB_EP_DIR_OUT)) // RX +#define UDI_CDC_COMM_EP_0 ((CDC_ACM_ENDPOINT) | (USB_EP_DIR_IN)) // Notify endpoint + +#define UDI_CDC_COMM_IFACE_NUMBER_0 (CDC_STATUS_INTERFACE) +#define UDI_CDC_DATA_IFACE_NUMBER_0 (CDC_DATA_INTERFACE) + +#ifdef __cplusplus +} +#endif +#endif // _UDI_CDC_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h new file mode 100644 index 0000000000..c787262340 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -0,0 +1,715 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _UDI_DEVICE_CONF_H_ +#define _UDI_DEVICE_CONF_H_ + +#include "udi_device_epsize.h" +#include "usb_protocol.h" +#include "compiler.h" +#include "usb_protocol_hid.h" + +#define DEVICE_CLASS 0 +#define DEVICE_SUBCLASS 0 +#define DEVICE_PROTOCOL 0 + +#define KBD + +//#define MOUSE_ENABLE //rules.mk +#ifdef MOUSE_ENABLE +#define MOU +#endif + +//#define EXTRAKEY_ENABLE //rules.mk +#ifdef EXTRAKEY_ENABLE +#define EXK +#endif + +//#define RAW_ENABLE //rules.mk +#ifdef RAW_ENABLE +#define RAW +#endif + +//#define CONSOLE_ENABLE //deferred implementation +//#ifdef CONSOLE_ENABLE +//#define CON +//#endif + +//#define NKRO_ENABLE //rules.mk +#ifdef NKRO_ENABLE +#define NKRO +#endif + +//#define MIDI_ENABLE //deferred implementation +//#ifdef MIDI_ENABLE +//#define MIDI +//#endif + +//#define VIRTSER_ENABLE //rules.mk +#ifdef VIRTSER_ENABLE +#define CDC +//because CDC uses IAD (interface association descriptor +//per USB Interface Association Descriptor Device Class Code and Use Model 7/23/2003 Rev 1.0) +#undef DEVICE_CLASS +#define DEVICE_CLASS 0xEF +#undef DEVICE_SUBCLASS +#define DEVICE_SUBCLASS 0x02 +#undef DEVICE_PROTOCOL +#define DEVICE_PROTOCOL 0x01 +#endif + +/* number of interfaces */ +#define NEXT_INTERFACE_0 0 + +#ifdef KBD +#define KEYBOARD_INTERFACE NEXT_INTERFACE_0 +#define NEXT_INTERFACE_1 (KEYBOARD_INTERFACE + 1) +#define UDI_HID_KBD_IFACE_NUMBER KEYBOARD_INTERFACE +#else +#define NEXT_INTERFACE_1 NEXT_INTERFACE_0 +#endif + +// It is important that the Raw HID interface is at a constant +// interface number, to support Linux/OSX platforms and chrome.hid +// If Raw HID is enabled, let it be always 1. +#ifdef RAW +#define RAW_INTERFACE NEXT_INTERFACE_1 +#define NEXT_INTERFACE_2 (RAW_INTERFACE + 1) +#else +#define NEXT_INTERFACE_2 NEXT_INTERFACE_1 +#endif + +#ifdef MOU +#define MOUSE_INTERFACE NEXT_INTERFACE_2 +#define UDI_HID_MOU_IFACE_NUMBER MOUSE_INTERFACE +#define NEXT_INTERFACE_3 (MOUSE_INTERFACE + 1) +#else +#define NEXT_INTERFACE_3 NEXT_INTERFACE_2 +#endif + +#ifdef EXK +#define EXTRAKEY_INTERFACE NEXT_INTERFACE_3 +#define NEXT_INTERFACE_4 (EXTRAKEY_INTERFACE + 1) +#define UDI_HID_EXK_IFACE_NUMBER EXTRAKEY_INTERFACE +#else +#define NEXT_INTERFACE_4 NEXT_INTERFACE_3 +#endif + +#ifdef CON +#define CONSOLE_INTERFACE NEXT_INTERFACE_4 +#define NEXT_INTERFACE_5 (CONSOLE_INTERFACE + 1) +#else +#define NEXT_INTERFACE_5 NEXT_INTERFACE_4 +#endif + +#ifdef NKRO +#define NKRO_INTERFACE NEXT_INTERFACE_5 +#define NEXT_INTERFACE_6 (NKRO_INTERFACE + 1) +#define UDI_HID_NKRO_IFACE_NUMBER NKRO_INTERFACE +#else +#define NEXT_INTERFACE_6 NEXT_INTERFACE_5 +#endif + +#ifdef MIDI +#define AC_INTERFACE NEXT_INTERFACE_6 +#define AS_INTERFACE (AC_INTERFACE + 1) +#define NEXT_INTERFACE_7 (AS_INTERFACE + 1) +#else +#define NEXT_INTERFACE_7 NEXT_INTERFACE_6 +#endif + +#ifdef CDC +#define CCI_INTERFACE NEXT_INTERFACE_7 +#define CDI_INTERFACE (CCI_INTERFACE + 1) +#define NEXT_INTERFACE_8 (CDI_INTERFACE + 1) +#define CDC_STATUS_INTERFACE CCI_INTERFACE +#define CDC_DATA_INTERFACE CDI_INTERFACE +#else +#define NEXT_INTERFACE_8 NEXT_INTERFACE_7 +#endif + +/* nubmer of interfaces */ +#define TOTAL_INTERFACES NEXT_INTERFACE_8 +#define USB_DEVICE_NB_INTERFACE TOTAL_INTERFACES + + +// ********************************************************************** +// Endopoint number and size +// ********************************************************************** +#define USB_DEVICE_EP_CTRL_SIZE 8 + +#define NEXT_IN_EPNUM_0 1 +#define NEXT_OUT_EPNUM_0 1 + +#ifdef KBD +#define KEYBOARD_IN_EPNUM NEXT_IN_EPNUM_0 +#define UDI_HID_KBD_EP_IN KEYBOARD_IN_EPNUM +#define NEXT_IN_EPNUM_1 (KEYBOARD_IN_EPNUM + 1) +#define UDI_HID_KBD_EP_SIZE KEYBOARD_EPSIZE +#define KBD_POLLING_INTERVAL 10 +#ifndef UDI_HID_KBD_STRING_ID +#define UDI_HID_KBD_STRING_ID 0 +#endif +#else +#define NEXT_IN_EPNUM_1 NEXT_IN_EPNUM_0 +#endif + +#ifdef MOU +#define MOUSE_IN_EPNUM NEXT_IN_EPNUM_1 +#define NEXT_IN_EPNUM_2 (MOUSE_IN_EPNUM + 1) +#define UDI_HID_MOU_EP_IN MOUSE_IN_EPNUM +#define UDI_HID_MOU_EP_SIZE MOUSE_EPSIZE +#define MOU_POLLING_INTERVAL 10 +#ifndef UDI_HID_MOU_STRING_ID +#define UDI_HID_MOU_STRING_ID 0 +#endif +#else +#define NEXT_IN_EPNUM_2 NEXT_IN_EPNUM_1 +#endif + +#ifdef EXK +#define EXTRAKEY_IN_EPNUM NEXT_IN_EPNUM_2 +#define UDI_HID_EXK_EP_IN EXTRAKEY_IN_EPNUM +#define NEXT_IN_EPNUM_3 (EXTRAKEY_IN_EPNUM + 1) +#define UDI_HID_EXK_EP_SIZE EXTRAKEY_EPSIZE +#define EXTRAKEY_POLLING_INTERVAL 10 +#ifndef UDI_HID_EXK_STRING_ID +#define UDI_HID_EXK_STRING_ID 0 +#endif +#else +#define NEXT_IN_EPNUM_3 NEXT_IN_EPNUM_2 +#endif + +#ifdef RAW +#define RAW_IN_EPNUM NEXT_IN_EPNUM_3 +#define UDI_HID_RAW_EP_IN RAW_IN_EPNUM +#define NEXT_IN_EPNUM_4 (RAW_IN_EPNUM + 1) +#define RAW_OUT_EPNUM NEXT_OUT_EPNUM_0 +#define UDI_HID_RAW_EP_OUT RAW_OUT_EPNUM +#define NEXT_OUT_EPNUM_1 (RAW_OUT_EPNUM + 1) +#define RAW_POLLING_INTERVAL 1 +#ifndef UDI_HID_RAW_STRING_ID +#define UDI_HID_RAW_STRING_ID 0 +#endif +#else +#define NEXT_IN_EPNUM_4 NEXT_IN_EPNUM_3 +#define NEXT_OUT_EPNUM_1 NEXT_OUT_EPNUM_0 +#endif + +#ifdef CON +#define CONSOLE_IN_EPNUM NEXT_IN_EPNUM_4 +#define NEXT_IN_EPNUM_5 (CONSOLE_IN_EPNUM + 1) +#define CONSOLE_OUT_EPNUM NEXT_OUT_EPNUM_1 +#define NEXT_OUT_EPNUM_2 (CONSOLE_OUT_EPNUM + 1) +#define CONSOLE_POLLING_INTERVAL 1 +#else +#define NEXT_IN_EPNUM_5 NEXT_IN_EPNUM_4 +#define NEXT_OUT_EPNUM_2 NEXT_OUT_EPNUM_1 +#endif + +#ifdef NKRO +#define NKRO_IN_EPNUM NEXT_IN_EPNUM_5 +#define UDI_HID_NKRO_EP_IN NKRO_IN_EPNUM +#define NEXT_IN_EPNUM_6 (NKRO_IN_EPNUM + 1) +#define UDI_HID_NKRO_EP_SIZE NKRO_EPSIZE +#define NKRO_POLLING_INTERVAL 1 +#ifndef UDI_HID_NKRO_STRING_ID +#define UDI_HID_NKRO_STRING_ID 0 +#endif +#else +#define NEXT_IN_EPNUM_6 NEXT_IN_EPNUM_5 +#endif + +#ifdef MIDI +#define MIDI_STREAM_IN_EPNUM NEXT_IN_EPNUM_6 +#define NEXT_IN_EPNUM_7 (MIDI_STREAM_IN_EPNUM + 1) +#define MIDI_STREAM_OUT_EPNUM NEXT_OUT_EPNUM_2 +#define NEXT_OUT_EPNUM_3 (MIDI_STREAM_OUT_EPNUM + 1) +#define MIDI_POLLING_INTERVAL 5 +#else +#define NEXT_IN_EPNUM_7 NEXT_IN_EPNUM_6 +#define NEXT_OUT_EPNUM_3 NEXT_OUT_EPNUM_2 +#endif + +#ifdef CDC +#define CDC_NOTIFICATION_EPNUM NEXT_IN_EPNUM_7 +#define CDC_ACM_ENDPOINT CDC_NOTIFICATION_EPNUM +#define CDC_TX_ENDPOINT (CDC_NOTIFICATION_EPNUM + 1) +#define NEXT_IN_EPNUM_8 (CDC_TX_ENDPOINT + 1) + +#define CDC_OUT_EPNUM NEXT_OUT_EPNUM_3 +#define CDC_RX_ENDPOINT CDC_OUT_EPNUM +#define NEXT_OUT_EPNUM_4 (CDC_OUT_EPNUM + 1) + +#define CDC_ACM_SIZE CDC_NOTIFICATION_EPSIZE +#define CDC_RX_SIZE CDC_EPSIZE //KFSMOD was 64 +#define CDC_TX_SIZE CDC_RX_SIZE +#define CDC_ACM_POLLING_INTERVAL 255 +#define CDC_EP_INTERVAL_STATUS CDC_ACM_POLLING_INTERVAL +#define CDC_DATA_POLLING_INTERVAL 5 +#define CDC_EP_INTERVAL_DATA CDC_DATA_POLLING_INTERVAL +#define CDC_STATUS_NAME L"Virtual Serial Port - Status" +#define CDC_DATA_NAME L"Virtual Serial Port - Data" +#else +#define NEXT_IN_EPNUM_8 NEXT_IN_EPNUM_7 +#define NEXT_OUT_EPNUM_4 NEXT_OUT_EPNUM_3 +#endif + +#define TOTAL_OUT_EP NEXT_OUT_EPNUM_4 +#define TOTAL_IN_EP NEXT_IN_EPNUM_8 +#define USB_DEVICE_MAX_EP (max(NEXT_OUT_EPNUM_4, NEXT_IN_EPNUM_8)) + +#if USB_DEVICE_MAX_EP > 8 +#error "There are not enough available endpoints to support all functions. Remove some in the rules.mk file.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, VIRTSER)" +#endif + + +// ********************************************************************** +// KBD Descriptor structure and content +// ********************************************************************** +#ifdef KBD + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep; +} udi_hid_kbd_desc_t; + +typedef struct { + uint8_t array[59]; +} udi_hid_kbd_report_desc_t; + +#define UDI_HID_KBD_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = UDI_HID_KBD_IFACE_NUMBER,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 1,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_BOOT,\ + .iface.bInterfaceProtocol = HID_PROTOCOL_KEYBOARD,\ + .iface.iInterface = UDI_HID_KBD_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_kbd_report_desc_t)),\ + .ep.bLength = sizeof(usb_ep_desc_t),\ + .ep.bDescriptorType = USB_DT_ENDPOINT,\ + .ep.bEndpointAddress = UDI_HID_KBD_EP_IN | USB_EP_DIR_IN,\ + .ep.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep.wMaxPacketSize = LE16(UDI_HID_KBD_EP_SIZE),\ + .ep.bInterval = KBD_POLLING_INTERVAL,\ +} + +//set report buffer (from host) +extern uint8_t udi_hid_kbd_report_set; + +//report buffer (to host) +#define UDI_HID_KBD_REPORT_SIZE 8 +extern uint8_t udi_hid_kbd_report[UDI_HID_KBD_REPORT_SIZE]; + +COMPILER_PACK_RESET() + +#endif //KBD + +// ********************************************************************** +// EXK Descriptor structure and content +// ********************************************************************** +#ifdef EXK + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep; +} udi_hid_exk_desc_t; + +typedef struct { + uint8_t array[54]; +} udi_hid_exk_report_desc_t; + +#define UDI_HID_EXK_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = UDI_HID_EXK_IFACE_NUMBER,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 1,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_BOOT,\ + .iface.bInterfaceProtocol = HID_PROTOCOL_GENERIC,\ + .iface.iInterface = UDI_HID_EXK_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_exk_report_desc_t)),\ + .ep.bLength = sizeof(usb_ep_desc_t),\ + .ep.bDescriptorType = USB_DT_ENDPOINT,\ + .ep.bEndpointAddress = UDI_HID_EXK_EP_IN | USB_EP_DIR_IN,\ + .ep.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep.wMaxPacketSize = LE16(UDI_HID_EXK_EP_SIZE),\ + .ep.bInterval = EXTRAKEY_POLLING_INTERVAL,\ +} + +//set report buffer (from host) +extern uint8_t udi_hid_exk_report_set; + +//report buffer +#define UDI_HID_EXK_REPORT_SIZE 3 + +typedef union { + struct { + uint8_t report_id; + uint16_t report_data; + } desc; + uint8_t raw[UDI_HID_EXK_REPORT_SIZE]; +} udi_hid_exk_report_t; + +extern udi_hid_exk_report_t udi_hid_exk_report; + +COMPILER_PACK_RESET() + +#endif //EXK + +// ********************************************************************** +// NKRO Descriptor structure and content +// ********************************************************************** +#ifdef NKRO + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep; +} udi_hid_nkro_desc_t; + +typedef struct { + uint8_t array[57]; +} udi_hid_nkro_report_desc_t; + +#define UDI_HID_NKRO_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = UDI_HID_NKRO_IFACE_NUMBER,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 1,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_NOBOOT,\ + .iface.bInterfaceProtocol = HID_PROTOCOL_KEYBOARD,\ + .iface.iInterface = UDI_HID_NKRO_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_nkro_report_desc_t)),\ + .ep.bLength = sizeof(usb_ep_desc_t),\ + .ep.bDescriptorType = USB_DT_ENDPOINT,\ + .ep.bEndpointAddress = UDI_HID_NKRO_EP_IN | USB_EP_DIR_IN,\ + .ep.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep.wMaxPacketSize = LE16(UDI_HID_NKRO_EP_SIZE),\ + .ep.bInterval = NKRO_POLLING_INTERVAL,\ +} + +//set report buffer +extern uint8_t udi_hid_nkro_report_set; + +//report buffer +#define UDI_HID_NKRO_REPORT_SIZE 32 +extern uint8_t udi_hid_nkro_report[UDI_HID_NKRO_REPORT_SIZE]; + +COMPILER_PACK_RESET() + +#endif //NKRO + +// ********************************************************************** +// MOU Descriptor structure and content +// ********************************************************************** +#ifdef MOU + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep; +} udi_hid_mou_desc_t; + +typedef struct { + uint8_t array[77];//MOU PDS +} udi_hid_mou_report_desc_t; + +#define UDI_HID_MOU_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = MOUSE_INTERFACE,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 1,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_BOOT,\ + .iface.bInterfaceProtocol = HID_PROTOCOL_MOUSE,\ + .iface.iInterface = UDI_HID_MOU_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_mou_report_desc_t)),\ + .ep.bLength = sizeof(usb_ep_desc_t),\ + .ep.bDescriptorType = USB_DT_ENDPOINT,\ + .ep.bEndpointAddress = UDI_HID_MOU_EP_IN | USB_EP_DIR_IN,\ + .ep.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep.wMaxPacketSize = LE16(UDI_HID_MOU_EP_SIZE),\ + .ep.bInterval = MOU_POLLING_INTERVAL,\ +} + +//no set report buffer + +//report buffer +#define UDI_HID_MOU_REPORT_SIZE 5 //MOU PDS +extern uint8_t udi_hid_mou_report[UDI_HID_MOU_REPORT_SIZE]; + +COMPILER_PACK_RESET() + +#endif //MOU + +// ********************************************************************** +// RAW Descriptor structure and content +// ********************************************************************** +#ifdef RAW + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep_out; + usb_ep_desc_t ep_in; +} udi_hid_raw_desc_t; + +typedef struct { + uint8_t array[27]; +} udi_hid_raw_report_desc_t; + +#define UDI_HID_RAW_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = RAW_INTERFACE,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 2,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_NOBOOT,\ + .iface.bInterfaceProtocol = HID_SUB_CLASS_NOBOOT,\ + .iface.iInterface = UDI_HID_RAW_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_raw_report_desc_t)),\ + .ep_out.bLength = sizeof(usb_ep_desc_t),\ + .ep_out.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_out.bEndpointAddress = UDI_HID_RAW_EP_OUT | USB_EP_DIR_OUT,\ + .ep_out.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep_out.wMaxPacketSize = LE16(RAW_EPSIZE),\ + .ep_out.bInterval = RAW_POLLING_INTERVAL,\ + .ep_in.bLength = sizeof(usb_ep_desc_t),\ + .ep_in.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_in.bEndpointAddress = UDI_HID_RAW_EP_IN | USB_EP_DIR_IN,\ + .ep_in.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep_in.wMaxPacketSize = LE16(RAW_EPSIZE),\ + .ep_in.bInterval = RAW_POLLING_INTERVAL,\ +} + +#define UDI_HID_RAW_REPORT_SIZE RAW_EPSIZE + +extern uint8_t udi_hid_raw_report_set[UDI_HID_RAW_REPORT_SIZE]; + +//report buffer +extern uint8_t udi_hid_raw_report[UDI_HID_RAW_REPORT_SIZE]; + +COMPILER_PACK_RESET() + +#endif //RAW + +// ********************************************************************** +// CDC Descriptor structure and content +// ********************************************************************** +#ifdef CDC + +COMPILER_PACK_SET(1) + +typedef struct { + uint8_t bFunctionLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubtype; + le16_t bcdCDC; +} usb_cdc_hdr_desc_t; + +typedef struct { + uint8_t bFunctionLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubtype; + uint8_t bmCapabilities; + uint8_t bDataInterface; +} usb_cdc_call_mgmt_desc_t; + +typedef struct { + uint8_t bFunctionLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubtype; + uint8_t bmCapabilities; +} usb_cdc_acm_desc_t; + +typedef struct { + uint8_t bFunctionLength; + uint8_t bDescriptorType; + uint8_t bDescriptorSubtype; + uint8_t bMasterInterface; + uint8_t bSlaveInterface0; +} usb_cdc_union_desc_t; + +typedef struct { + usb_association_desc_t iaface; + usb_iface_desc_t iface_c; + usb_cdc_hdr_desc_t fd; + usb_cdc_call_mgmt_desc_t mfd; + usb_cdc_acm_desc_t acmd; + usb_cdc_union_desc_t ufd; + usb_ep_desc_t ep_c; + usb_iface_desc_t iface_d; + usb_ep_desc_t ep_tx; + usb_ep_desc_t ep_rx; +} udi_cdc_desc_t; + +#define CDC_DESCRIPTOR {\ + .iaface.bLength = sizeof(usb_association_desc_t),\ + .iaface.bDescriptorType = USB_DT_IAD,\ + .iaface.bFirstInterface = CDC_STATUS_INTERFACE,\ + .iaface.bInterfaceCount = 2,\ + .iaface.bFunctionClass = CDC_CLASS_DEVICE,\ + .iaface.bFunctionSubClass = CDC_SUBCLASS_ACM,\ + .iaface.bFunctionProtocol = CDC_PROTOCOL_V25TER,\ + .iaface.iFunction = 0,\ + .iface_c.bLength = sizeof(usb_iface_desc_t),\ + .iface_c.bDescriptorType = USB_DT_INTERFACE,\ + .iface_c.bInterfaceNumber = CDC_STATUS_INTERFACE,\ + .iface_c.bAlternateSetting = 0,\ + .iface_c.bNumEndpoints = 1,\ + .iface_c.bInterfaceClass = 0x02,\ + .iface_c.bInterfaceSubClass = 0x02,\ + .iface_c.bInterfaceProtocol = CDC_PROTOCOL_V25TER,\ + .iface_c.iInterface = 0,\ + .fd.bFunctionLength = sizeof(usb_cdc_hdr_desc_t),\ + .fd.bDescriptorType = CDC_CS_INTERFACE,\ + .fd.bDescriptorSubtype = CDC_SCS_HEADER,\ + .fd.bcdCDC = 0x0110,\ + .mfd.bFunctionLength = sizeof(usb_cdc_call_mgmt_desc_t),\ + .mfd.bDescriptorType = CDC_CS_INTERFACE,\ + .mfd.bDescriptorSubtype = CDC_SCS_CALL_MGMT,\ + .mfd.bmCapabilities = CDC_CALL_MGMT_SUPPORTED,\ + .mfd.bDataInterface = CDC_DATA_INTERFACE,\ + .acmd.bFunctionLength = sizeof(usb_cdc_acm_desc_t),\ + .acmd.bDescriptorType = CDC_CS_INTERFACE,\ + .acmd.bDescriptorSubtype = CDC_SCS_ACM,\ + .acmd.bmCapabilities = CDC_ACM_SUPPORT_LINE_REQUESTS,\ + .ufd.bFunctionLength = sizeof(usb_cdc_union_desc_t),\ + .ufd.bDescriptorType = CDC_CS_INTERFACE,\ + .ufd.bDescriptorSubtype = CDC_SCS_UNION,\ + .ufd.bMasterInterface = CDC_STATUS_INTERFACE,\ + .ufd.bSlaveInterface0 = CDC_DATA_INTERFACE,\ + .ep_c.bLength = sizeof(usb_ep_desc_t),\ + .ep_c.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_c.bEndpointAddress = CDC_ACM_ENDPOINT | USB_EP_DIR_IN,\ + .ep_c.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep_c.wMaxPacketSize = LE16(CDC_ACM_SIZE),\ + .ep_c.bInterval = CDC_EP_INTERVAL_STATUS,\ + .iface_d.bLength = sizeof(usb_iface_desc_t),\ + .iface_d.bDescriptorType = USB_DT_INTERFACE,\ + .iface_d.bInterfaceNumber = CDC_DATA_INTERFACE,\ + .iface_d.bAlternateSetting = 0,\ + .iface_d.bNumEndpoints = 2,\ + .iface_d.bInterfaceClass = CDC_CLASS_DATA,\ + .iface_d.bInterfaceSubClass = 0,\ + .iface_d.bInterfaceProtocol = 0,\ + .iface_d.iInterface = 0,\ + .ep_rx.bLength = sizeof(usb_ep_desc_t),\ + .ep_rx.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_rx.bEndpointAddress = CDC_RX_ENDPOINT | USB_EP_DIR_OUT,\ + .ep_rx.bmAttributes = USB_EP_TYPE_BULK,\ + .ep_rx.wMaxPacketSize = LE16(CDC_RX_SIZE),\ + .ep_rx.bInterval = CDC_EP_INTERVAL_DATA,\ + .ep_tx.bLength = sizeof(usb_ep_desc_t),\ + .ep_tx.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_tx.bEndpointAddress = CDC_TX_ENDPOINT | USB_EP_DIR_IN,\ + .ep_tx.bmAttributes = USB_EP_TYPE_BULK,\ + .ep_tx.wMaxPacketSize = LE16(CDC_TX_SIZE),\ + .ep_tx.bInterval = CDC_EP_INTERVAL_DATA,\ +} + +COMPILER_PACK_RESET() + +#endif //CDC + +// ********************************************************************** +// CONFIGURATION Descriptor structure and content +// ********************************************************************** +COMPILER_PACK_SET(1) + +typedef struct { + usb_conf_desc_t conf; +#ifdef KBD + udi_hid_kbd_desc_t hid_kbd; +#endif +#ifdef MOU + udi_hid_mou_desc_t hid_mou; +#endif +#ifdef EXK + udi_hid_exk_desc_t hid_exk; +#endif +#ifdef RAW + udi_hid_raw_desc_t hid_raw; +#endif +#ifdef CON + udi_hid_con_desc_t hid_con; +#endif +#ifdef NKRO + udi_hid_nkro_desc_t hid_nkro; +#endif +#ifdef MIDI + udi_hid_midi_desc_t hid_midi; +#endif +#ifdef CDC + udi_cdc_desc_t cdc_serial; +#endif +} udc_desc_t; + +COMPILER_PACK_RESET() + +#endif //_UDI_DEVICE_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h new file mode 100644 index 0000000000..96d03c2869 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_epsize.h @@ -0,0 +1,32 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _UDI_DEVICE_EPSIZE_H_ +#define _UDI_DEVICE_EPSIZE_H_ + +#define KEYBOARD_EPSIZE 8 +#define MOUSE_EPSIZE 8 +#define EXTRAKEY_EPSIZE 8 +#define RAW_EPSIZE 64 +#define CONSOLE_EPSIZE 32 +#define NKRO_EPSIZE 32 +#define MIDI_STREAM_EPSIZE 64 +#define CDC_NOTIFICATION_EPSIZE 8 +#define CDC_EPSIZE 16 + +#endif //_UDI_DEVICE_EPSIZE_H_ + diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.c b/tmk_core/protocol/arm_atsam/usb/udi_hid.c new file mode 100644 index 0000000000..131b7a0ece --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.c @@ -0,0 +1,162 @@ +/** + * \file + * + * \brief USB Device Human Interface Device (HID) interface. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udd.h" +#include "udc.h" +#include "udi_hid.h" + + +/** + * \ingroup udi_hid_group + * \defgroup udi_hid_group_internal Implementation of HID common library + * @{ + */ + +/** + * \brief Send the specific descriptors requested by SETUP request + * + * \retval true if the descriptor is supported + */ +static bool udi_hid_reqstdifaceget_descriptor(uint8_t *report_desc); + +bool udi_hid_setup( uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool (*setup_report)(void) ) +{ + if (Udd_setup_is_in()) { + // Requests Interface GET + if (Udd_setup_type() == USB_REQ_TYPE_STANDARD) { + // Requests Standard Interface Get + switch (udd_g_ctrlreq.req.bRequest) { + + case USB_REQ_GET_DESCRIPTOR: + return udi_hid_reqstdifaceget_descriptor(report_desc); + } + } + if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { + // Requests Class Interface Get + switch (udd_g_ctrlreq.req.bRequest) { + + case USB_REQ_HID_GET_REPORT: + return setup_report(); + + case USB_REQ_HID_GET_IDLE: + udd_g_ctrlreq.payload = rate; + udd_g_ctrlreq.payload_size = 1; + return true; + + case USB_REQ_HID_GET_PROTOCOL: + udd_g_ctrlreq.payload = protocol; + udd_g_ctrlreq.payload_size = 1; + return true; + } + } + } + if (Udd_setup_is_out()) { + // Requests Interface SET + if (Udd_setup_type() == USB_REQ_TYPE_CLASS) { + // Requests Class Interface Set + switch (udd_g_ctrlreq.req.bRequest) { + + case USB_REQ_HID_SET_REPORT: + return setup_report(); + + case USB_REQ_HID_SET_IDLE: + *rate = udd_g_ctrlreq.req.wValue >> 8; + return true; + + case USB_REQ_HID_SET_PROTOCOL: + if (0 != udd_g_ctrlreq.req.wLength) + return false; + *protocol = udd_g_ctrlreq.req.wValue; + return true; + } + } + } + return false; // Request not supported +} + +//--------------------------------------------- +//------- Internal routines + +static bool udi_hid_reqstdifaceget_descriptor(uint8_t *report_desc) +{ + usb_hid_descriptor_t UDC_DESC_STORAGE *ptr_hid_desc; + + // Get the USB descriptor which is located after the interface descriptor + // This descriptor must be the HID descriptor + ptr_hid_desc = (usb_hid_descriptor_t UDC_DESC_STORAGE *) ((uint8_t *) + udc_get_interface_desc() + sizeof(usb_iface_desc_t)); + if (USB_DT_HID != ptr_hid_desc->bDescriptorType) + return false; + + // The SETUP request can ask for: + // - an USB_DT_HID descriptor + // - or USB_DT_HID_REPORT descriptor + // - or USB_DT_HID_PHYSICAL descriptor + if (USB_DT_HID == (uint8_t) (udd_g_ctrlreq.req.wValue >> 8)) { + // USB_DT_HID descriptor requested then send it + udd_g_ctrlreq.payload = (uint8_t *) ptr_hid_desc; + udd_g_ctrlreq.payload_size = + min(udd_g_ctrlreq.req.wLength, + ptr_hid_desc->bLength); + return true; + } + // The HID_X descriptor requested must correspond to report type + // included in the HID descriptor + if (ptr_hid_desc->bRDescriptorType == + (uint8_t) (udd_g_ctrlreq.req.wValue >> 8)) { + // Send HID Report descriptor given by high level + udd_g_ctrlreq.payload = report_desc; + udd_g_ctrlreq.payload_size = + min(udd_g_ctrlreq.req.wLength, + le16_to_cpu(ptr_hid_desc->wDescriptorLength)); + return true; + } + return false; +} + +//@} diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid.h b/tmk_core/protocol/arm_atsam/usb/udi_hid.h new file mode 100644 index 0000000000..0edb09c1c3 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid.h @@ -0,0 +1,85 @@ +/** + * \file + * + * \brief USB Device Human Interface Device (HID) interface definitions. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDI_HID_H_ +#define _UDI_HID_H_ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "usb_protocol_hid.h" +#include "udd.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \ingroup udi_group + * \defgroup udi_hid_group USB Device Interface (UDI) for Human Interface Device (HID) + * + * Common library for all Human Interface Device (HID) implementation. + * + * @{ + */ + +/** + * \brief Decode HID setup request + * + * \param rate Pointer on rate of current HID interface + * \param protocol Pointer on protocol of current HID interface + * \param report_desc Pointer on report descriptor of current HID interface + * \param set_report Pointer on set_report callback of current HID interface + * + * \return \c 1 if function was successfully done, otherwise \c 0. + */ +bool udi_hid_setup( uint8_t *rate, uint8_t *protocol, uint8_t *report_desc, bool (*setup_report)(void) ); + +//@} + +#ifdef __cplusplus +} +#endif +#endif // _UDI_HID_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c new file mode 100644 index 0000000000..18f69350c0 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -0,0 +1,845 @@ +/** + * \file + * + * \brief USB Device Human Interface Device (HID) keyboard interface. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "samd51j18a.h" +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udd.h" +#include "udc.h" +#include "udi_device_conf.h" +#include "udi_hid.h" +#include "udi_hid_kbd.h" +#include + +//*************************************************************************** +// KBD +//*************************************************************************** +#ifdef KBD + +bool udi_hid_kbd_enable(void); +void udi_hid_kbd_disable(void); +bool udi_hid_kbd_setup(void); +uint8_t udi_hid_kbd_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_kbd = { + .enable = (bool(*)(void))udi_hid_kbd_enable, + .disable = (void (*)(void))udi_hid_kbd_disable, + .setup = (bool(*)(void))udi_hid_kbd_setup, + .getsetting = (uint8_t(*)(void))udi_hid_kbd_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_kbd_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_kbd_protocol; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_kbd_report_set; + +bool udi_hid_kbd_b_report_valid; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_kbd_report[UDI_HID_KBD_REPORT_SIZE]; + +static bool udi_hid_kbd_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_kbd_report_trans[UDI_HID_KBD_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_kbd_report_desc_t udi_hid_kbd_report_desc = { + { + 0x05, 0x01, // Usage Page (Generic Desktop) + 0x09, 0x06, // Usage (Keyboard) + 0xA1, 0x01, // Collection (Application) + 0x05, 0x07, // Usage Page (Keyboard) + 0x19, 0xE0, // Usage Minimum (224) + 0x29, 0xE7, // Usage Maximum (231) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x75, 0x01, // Report Size (1) + 0x95, 0x08, // Report Count (8) + 0x81, 0x02, // Input (Data, Variable, Absolute) + 0x81, 0x01, // Input (Constant) + 0x19, 0x00, // Usage Minimum (0) + 0x29, 0x65, // Usage Maximum (101) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x65, // Logical Maximum (101) + 0x75, 0x08, // Report Size (8) + 0x95, 0x06, // Report Count (6) + 0x81, 0x00, // Input (Data, Array) + 0x05, 0x08, // Usage Page (LED) + 0x19, 0x01, // Usage Minimum (1) + 0x29, 0x05, // Usage Maximum (5) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0x01, // Logical Maximum (1) + 0x75, 0x01, // Report Size (1) + 0x95, 0x05, // Report Count (5) + 0x91, 0x02, // Output (Data, Variable, Absolute) + 0x95, 0x03, // Report Count (3) + 0x91, 0x01, // Output (Constant) + 0xC0 // End Collection + } +}; + +static bool udi_hid_kbd_setreport(void); + +static void udi_hid_kbd_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +static void udi_hid_kbd_setreport_valid(void); + +bool udi_hid_kbd_enable(void) +{ + // Initialize internal values + udi_hid_kbd_rate = 0; + udi_hid_kbd_protocol = 0; + udi_hid_kbd_b_report_trans_ongoing = false; + memset(udi_hid_kbd_report, 0, UDI_HID_KBD_REPORT_SIZE); + udi_hid_kbd_b_report_valid = false; + return UDI_HID_KBD_ENABLE_EXT(); +} + +void udi_hid_kbd_disable(void) +{ + UDI_HID_KBD_DISABLE_EXT(); +} + +bool udi_hid_kbd_setup(void) +{ + return udi_hid_setup(&udi_hid_kbd_rate, + &udi_hid_kbd_protocol, + (uint8_t *) &udi_hid_kbd_report_desc, + udi_hid_kbd_setreport); +} + +uint8_t udi_hid_kbd_getsetting(void) +{ + return 0; +} + +static bool udi_hid_kbd_setreport(void) +{ + if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) + && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) + && (1 == udd_g_ctrlreq.req.wLength)) { + // Report OUT type on report ID 0 from USB Host + udd_g_ctrlreq.payload = &udi_hid_kbd_report_set; + udd_g_ctrlreq.callback = udi_hid_kbd_setreport_valid; + udd_g_ctrlreq.payload_size = 1; + return true; + } + return false; +} + +bool udi_hid_kbd_send_report(void) +{ + if (!main_b_kbd_enable) { + return false; + } + + if (udi_hid_kbd_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_kbd_report_trans, udi_hid_kbd_report, + UDI_HID_KBD_REPORT_SIZE); + udi_hid_kbd_b_report_valid = false; + udi_hid_kbd_b_report_trans_ongoing = + udd_ep_run(UDI_HID_KBD_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_kbd_report_trans, + UDI_HID_KBD_REPORT_SIZE, + udi_hid_kbd_report_sent); + + return udi_hid_kbd_b_report_trans_ongoing; +} + +static void udi_hid_kbd_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_kbd_b_report_trans_ongoing = false; + if (udi_hid_kbd_b_report_valid) { + udi_hid_kbd_send_report(); + } +} + +static void udi_hid_kbd_setreport_valid(void) +{ + //UDI_HID_KBD_CHANGE_LED(udi_hid_kbd_report_set); +} + +#endif //KBD + +//******************************************************************************************** +// NKRO Keyboard +//******************************************************************************************** +#ifdef NKRO + +bool udi_hid_nkro_enable(void); +void udi_hid_nkro_disable(void); +bool udi_hid_nkro_setup(void); +uint8_t udi_hid_nkro_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_nkro = { + .enable = (bool(*)(void))udi_hid_nkro_enable, + .disable = (void (*)(void))udi_hid_nkro_disable, + .setup = (bool(*)(void))udi_hid_nkro_setup, + .getsetting = (uint8_t(*)(void))udi_hid_nkro_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_nkro_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_nkro_protocol; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_nkro_report_set; + +bool udi_hid_nkro_b_report_valid; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_nkro_report[UDI_HID_NKRO_REPORT_SIZE]; + +static bool udi_hid_nkro_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_nkro_report_trans[UDI_HID_NKRO_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_nkro_report_desc_t udi_hid_nkro_report_desc = { + { + 0x05, 0x01, // Usage Page (Generic Desktop), + 0x09, 0x06, // Usage (Keyboard), + 0xA1, 0x01, // Collection (Application) - Keyboard, + + //Mods + 0x75, 0x01, // Report Size (1), + 0x95, 0x08, // Report Count (8), + 0x15, 0x00, // Logical Minimum (0), + 0x25, 0x01, // Logical Maximum (1), + 0x05, 0x07, // Usage Page (Key Codes), + 0x19, 0xE0, // Usage Minimum (224), + 0x29, 0xE7, // Usage Maximum (231), + 0x81, 0x02, // Input (Data, Variable, Absolute), + + //LED Report + 0x75, 0x01, // Report Size (1), + 0x95, 0x05, // Report Count (5), + 0x05, 0x08, // Usage Page (LEDs), + 0x19, 0x01, // Usage Minimum (1), + 0x29, 0x05, // Usage Maximum (5), + 0x91, 0x02, // Output (Data, Variable, Absolute), + + //LED Report Padding + 0x75, 0x03, // Report Size (3), + 0x95, 0x01, // Report Count (1), + 0x91, 0x03, // Output (Constant), + + //Main keys + 0x75, 0x01, // Report Size (1), + 0x95, 0xF8, // Report Count (248), + 0x15, 0x00, // Logical Minimum (0), + 0x25, 0x01, // Logical Maximum (1), + 0x05, 0x07, // Usage Page (Key Codes), + 0x19, 0x00, // Usage Minimum (0), + 0x29, 0xF7, // Usage Maximum (247), + 0x81, 0x02, // Input (Data, Variable, Absolute, Bitfield), + 0xc0, // End Collection - Keyboard + } +}; + +static bool udi_hid_nkro_setreport(void); +static void udi_hid_nkro_setreport_valid(void); +static void udi_hid_nkro_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +bool udi_hid_nkro_enable(void) +{ + // Initialize internal values + udi_hid_nkro_rate = 0; + udi_hid_nkro_protocol = 0; + udi_hid_nkro_b_report_trans_ongoing = false; + memset(udi_hid_nkro_report, 0, UDI_HID_NKRO_REPORT_SIZE); + udi_hid_nkro_b_report_valid = false; + return UDI_HID_NKRO_ENABLE_EXT(); +} + +void udi_hid_nkro_disable(void) +{ + UDI_HID_NKRO_DISABLE_EXT(); +} + +bool udi_hid_nkro_setup(void) +{ + return udi_hid_setup(&udi_hid_nkro_rate, + &udi_hid_nkro_protocol, + (uint8_t *) &udi_hid_nkro_report_desc, + udi_hid_nkro_setreport); +} + +uint8_t udi_hid_nkro_getsetting(void) +{ + return 0; +} + +//keyboard receives LED report here +static bool udi_hid_nkro_setreport(void) +{ + if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) + && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) + && (1 == udd_g_ctrlreq.req.wLength)) { + // Report OUT type on report ID 0 from USB Host + udd_g_ctrlreq.payload = &udi_hid_nkro_report_set; + udd_g_ctrlreq.callback = udi_hid_nkro_setreport_valid; //must call routine to transform setreport to LED state + udd_g_ctrlreq.payload_size = 1; + return true; + } + return false; +} + +bool udi_hid_nkro_send_report(void) +{ + if (!main_b_nkro_enable) { + return false; + } + + if (udi_hid_nkro_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_nkro_report_trans, udi_hid_nkro_report,UDI_HID_NKRO_REPORT_SIZE); + udi_hid_nkro_b_report_valid = false; + udi_hid_nkro_b_report_trans_ongoing = + udd_ep_run(UDI_HID_NKRO_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_nkro_report_trans, + UDI_HID_NKRO_REPORT_SIZE, + udi_hid_nkro_report_sent); + + return udi_hid_nkro_b_report_trans_ongoing; +} + +static void udi_hid_nkro_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_nkro_b_report_trans_ongoing = false; + if (udi_hid_nkro_b_report_valid) { + udi_hid_nkro_send_report(); + } +} + +static void udi_hid_nkro_setreport_valid(void) +{ + //UDI_HID_NKRO_CHANGE_LED(udi_hid_nkro_report_set); +} + +#endif //NKRO + +//******************************************************************************************** +// EXK (extra-keys) SYS-CTRL Keyboard +//******************************************************************************************** +#ifdef EXK + +bool udi_hid_exk_enable(void); +void udi_hid_exk_disable(void); +bool udi_hid_exk_setup(void); +uint8_t udi_hid_exk_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_exk = { + .enable = (bool(*)(void))udi_hid_exk_enable, + .disable = (void (*)(void))udi_hid_exk_disable, + .setup = (bool(*)(void))udi_hid_exk_setup, + .getsetting = (uint8_t(*)(void))udi_hid_exk_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_exk_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_exk_protocol; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_exk_report_set; + +bool udi_hid_exk_b_report_valid; + +COMPILER_WORD_ALIGNED +udi_hid_exk_report_t udi_hid_exk_report; + +static bool udi_hid_exk_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_exk_report_trans[UDI_HID_EXK_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = { + { + // System Control Collection (8 bits) + + 0x05, 0x01, // Usage Page (Generic Desktop), + 0x09, 0x80, // Usage (System Control), + 0xA1, 0x01, // Collection (Application), + 0x85, 0x02, // Report ID (2) (System), + 0x16, 0x01, 0x00, // Logical Minimum (1), + 0x26, 0x03, 0x00, // Logical Maximum (3), + 0x1A, 0x81, 0x00, // Usage Minimum (81) (System Power Down), + 0x2A, 0x83, 0x00, // Usage Maximum (83) (System Wake Up), + 0x75, 0x10, // Report Size (16), + 0x95, 0x01, // Report Count (1), + 0x81, 0x00, // Input (Data, Array), + 0xC0, // End Collection - System Control + + // Consumer Control Collection - Media Keys (16 bits) + + 0x05, 0x0C, // Usage Page (Consumer), + 0x09, 0x01, // Usage (Consumer Control), + 0xA1, 0x01, // Collection (Application), + 0x85, 0x03, // Report ID (3) (Consumer), + 0x16, 0x01, 0x00, // Logical Minimum (1), + 0x26, 0x9C, 0x02, // Logical Maximum (668), + 0x1A, 0x01, 0x00, // Usage Minimum (1), + 0x2A, 0x9C, 0x02, // Usage Maximum (668), + 0x75, 0x10, // Report Size (16), + 0x95, 0x01, // Report Count (1), + 0x81, 0x00, // Input (Data, Array), + 0xC0, // End Collection - Consumer Control + } +}; + +static bool udi_hid_exk_setreport(void); + +static void udi_hid_exk_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +static void udi_hid_exk_setreport_valid(void); + +bool udi_hid_exk_enable(void) +{ + // Initialize internal values + udi_hid_exk_rate = 0; + udi_hid_exk_protocol = 0; + udi_hid_exk_b_report_trans_ongoing = false; + memset(udi_hid_exk_report.raw, 0, UDI_HID_EXK_REPORT_SIZE); + udi_hid_exk_b_report_valid = false; + return UDI_HID_EXK_ENABLE_EXT(); +} + +void udi_hid_exk_disable(void) +{ + UDI_HID_EXK_DISABLE_EXT(); +} + +bool udi_hid_exk_setup(void) +{ + return udi_hid_setup(&udi_hid_exk_rate, + &udi_hid_exk_protocol, + (uint8_t *) &udi_hid_exk_report_desc, + udi_hid_exk_setreport); +} + +uint8_t udi_hid_exk_getsetting(void) +{ + return 0; +} + +static bool udi_hid_exk_setreport(void) +{ + if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) + && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) + && (1 == udd_g_ctrlreq.req.wLength)) { + // Report OUT type on report ID 0 from USB Host + udd_g_ctrlreq.payload = &udi_hid_exk_report_set; + udd_g_ctrlreq.callback = udi_hid_exk_setreport_valid; + udd_g_ctrlreq.payload_size = 1; + return true; + } + return false; +} + +bool udi_hid_exk_send_report(void) +{ + if (!main_b_exk_enable) { + return false; + } + + if (udi_hid_exk_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_exk_report_trans, udi_hid_exk_report.raw, UDI_HID_EXK_REPORT_SIZE); + udi_hid_exk_b_report_valid = false; + udi_hid_exk_b_report_trans_ongoing = + udd_ep_run(UDI_HID_EXK_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_exk_report_trans, + UDI_HID_EXK_REPORT_SIZE, + udi_hid_exk_report_sent); + + return udi_hid_exk_b_report_trans_ongoing; +} + +static void udi_hid_exk_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_exk_b_report_trans_ongoing = false; + if (udi_hid_exk_b_report_valid) { + udi_hid_exk_send_report(); + } +} + +static void udi_hid_exk_setreport_valid(void) +{ + +} + +#endif //EXK + +//******************************************************************************************** +// MOU Mouse +//******************************************************************************************** +#ifdef MOU + +bool udi_hid_mou_enable(void); +void udi_hid_mou_disable(void); +bool udi_hid_mou_setup(void); +uint8_t udi_hid_mou_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_mou = { + .enable = (bool(*)(void))udi_hid_mou_enable, + .disable = (void (*)(void))udi_hid_mou_disable, + .setup = (bool(*)(void))udi_hid_mou_setup, + .getsetting = (uint8_t(*)(void))udi_hid_mou_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_mou_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_mou_protocol; + +//COMPILER_WORD_ALIGNED +//uint8_t udi_hid_mou_report_set; //No set report + +bool udi_hid_mou_b_report_valid; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_mou_report[UDI_HID_MOU_REPORT_SIZE]; + +static bool udi_hid_mou_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_mou_report_trans[UDI_HID_MOU_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_mou_report_desc_t udi_hid_mou_report_desc = { + { + 0x05, 0x01, // Usage Page (Generic Desktop), + 0x09, 0x02, // Usage (Mouse), + 0xA1, 0x01, // Collection (Application), + 0x09, 0x01, // Usage (Pointer), + 0xA1, 0x00, // Collection (Physical), + 0x05, 0x09, // Usage Page (Buttons), + 0x19, 0x01, // Usage Minimum (01), + 0x29, 0x05, // Usage Maximun (05), + 0x15, 0x00, // Logical Minimum (0), + 0x25, 0x01, // Logical Maximum (1), + 0x95, 0x05, // Report Count (5), + 0x75, 0x01, // Report Size (1), + 0x81, 0x02, // Input (Data, Variable, Absolute), ;5 button bits + 0x95, 0x01, // Report Count (1), + 0x75, 0x03, // Report Size (3), + 0x81, 0x01, // Input (Constant), ;3 bit padding, + + 0x05, 0x01, // Usage Page (Generic Desktop), + 0x09, 0x30, // Usage (X), + 0x09, 0x31, // Usage (Y), + 0x15, 0x81, // Logical Minimum (-127), + 0x25, 0x7F, // Logical Maximum (127), + 0x95, 0x02, // Report Count (2), + 0x75, 0x08, // Report Size (8), + 0x81, 0x06, // Input (Data, Variable, Relative), ;2 position bytes (X & Y), + + 0x09, 0x38, // Usage (Wheel), + 0x15, 0x81, // Logical Minimum (-127), + 0x25, 0x7F, // Logical Maximum (127), + 0x95, 0x01, // Report Count (1), + 0x75, 0x08, // Report Size (8), + 0x81, 0x06, // Input (Data, Variable, Relative), + + 0x05, 0x0C, // Usage Page (Consumer), + 0x0A, 0x38, 0x02, // Usage (AC Pan (Horizontal wheel)), + 0x15, 0x81, // Logical Minimum (-127), + 0x25, 0x7F, // Logical Maximum (127), + 0x95, 0x01, // Report Count (1), + 0x75, 0x08, // Report Size (8), + 0x81, 0x06, // Input (Data, Variable, Relative), + + 0xC0, // End Collection, + 0xC0, // End Collection + } +}; + +static void udi_hid_mou_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +bool udi_hid_mou_enable(void) +{ + // Initialize internal values + udi_hid_mou_rate = 0; + udi_hid_mou_protocol = 0; + udi_hid_mou_b_report_trans_ongoing = false; + memset(udi_hid_mou_report, 0, UDI_HID_MOU_REPORT_SIZE); + udi_hid_mou_b_report_valid = false; + return UDI_HID_MOU_ENABLE_EXT(); +} + +void udi_hid_mou_disable(void) +{ + UDI_HID_MOU_DISABLE_EXT(); +} + +bool udi_hid_mou_setup(void) +{ + return udi_hid_setup(&udi_hid_mou_rate, + &udi_hid_mou_protocol, + (uint8_t *) &udi_hid_mou_report_desc, + NULL); +} + +uint8_t udi_hid_mou_getsetting(void) +{ + return 0; +} + +bool udi_hid_mou_send_report(void) +{ + if (!main_b_mou_enable) { + return false; + } + + if (udi_hid_mou_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_mou_report_trans, udi_hid_mou_report, UDI_HID_MOU_REPORT_SIZE); + udi_hid_mou_b_report_valid = false; + udi_hid_mou_b_report_trans_ongoing = + udd_ep_run(UDI_HID_MOU_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_mou_report_trans, + UDI_HID_MOU_REPORT_SIZE, + udi_hid_mou_report_sent); + + return udi_hid_mou_b_report_trans_ongoing; +} + +static void udi_hid_mou_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_mou_b_report_trans_ongoing = false; + if (udi_hid_mou_b_report_valid) { + udi_hid_mou_send_report(); + } +} + +#endif //MOU + +//******************************************************************************************** +// RAW +//******************************************************************************************** +#ifdef RAW + +bool udi_hid_raw_enable(void); +void udi_hid_raw_disable(void); +bool udi_hid_raw_setup(void); +uint8_t udi_hid_raw_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_raw = { + .enable = (bool(*)(void))udi_hid_raw_enable, + .disable = (void (*)(void))udi_hid_raw_disable, + .setup = (bool(*)(void))udi_hid_raw_setup, + .getsetting = (uint8_t(*)(void))udi_hid_raw_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_raw_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_raw_protocol; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_raw_report_set[UDI_HID_RAW_REPORT_SIZE]; + +static bool udi_hid_raw_b_report_valid; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_raw_report[UDI_HID_RAW_REPORT_SIZE]; + +static bool udi_hid_raw_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_raw_report_trans[UDI_HID_RAW_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_raw_report_desc_t udi_hid_raw_report_desc = { + { + 0x06, // Usage Page (Vendor Defined) + 0xFF, 0xFF, + 0x0A, // Usage (Mouse) + 0xFF, 0xFF, + 0xA1, 0x01, // Collection (Application) + 0x75, 0x08, // Report Size (8) + 0x15, 0x00, // Logical Minimum (0) + 0x25, 0xFF, // Logical Maximum (255) + 0x95, 0x40, // Report Count + 0x09, 0x01, // Usage (Input) + 0x81, 0x02, // Input (Data + 0x95, 0x40, // Report Count + 0x09, 0x02, // Usage (Output) + 0x91, 0x02, // Output (Data + 0xC0, // End Collection - Consumer Control + } +}; + +static bool udi_hid_raw_setreport(void); +static void udi_hid_raw_setreport_valid(void); + +static void udi_hid_raw_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +bool udi_hid_raw_enable(void) +{ + // Initialize internal values + udi_hid_raw_rate = 0; + udi_hid_raw_protocol = 0; + udi_hid_raw_b_report_trans_ongoing = false; + memset(udi_hid_raw_report, 0, UDI_HID_RAW_REPORT_SIZE); + udi_hid_raw_b_report_valid = false; + return UDI_HID_RAW_ENABLE_EXT(); +} + +void udi_hid_raw_disable(void) +{ + UDI_HID_RAW_DISABLE_EXT(); +} + +bool udi_hid_raw_setup(void) +{ + return udi_hid_setup(&udi_hid_raw_rate, + &udi_hid_raw_protocol, + (uint8_t *) &udi_hid_raw_report_desc, + udi_hid_raw_setreport); +} + +uint8_t udi_hid_raw_getsetting(void) +{ + return 0; +} + +static bool udi_hid_raw_setreport(void) +{ + if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) + && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) + && (UDI_HID_RAW_REPORT_SIZE == udd_g_ctrlreq.req.wLength)) { + // Report OUT type on report ID 0 from USB Host + udd_g_ctrlreq.payload = udi_hid_raw_report_set; + udd_g_ctrlreq.callback = udi_hid_raw_setreport_valid; //must call routine to transform setreport to LED state + udd_g_ctrlreq.payload_size = UDI_HID_RAW_REPORT_SIZE; + return true; + } + return false; +} + +bool udi_hid_raw_send_report(void) +{ + if (!main_b_raw_enable) { + return false; + } + + if (udi_hid_raw_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_raw_report_trans, udi_hid_raw_report,UDI_HID_RAW_REPORT_SIZE); + udi_hid_raw_b_report_valid = false; + udi_hid_raw_b_report_trans_ongoing = + udd_ep_run(UDI_HID_RAW_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_raw_report_trans, + UDI_HID_RAW_REPORT_SIZE, + udi_hid_raw_report_sent); + + return udi_hid_raw_b_report_trans_ongoing; +} + +static void udi_hid_raw_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_raw_b_report_trans_ongoing = false; + if (udi_hid_raw_b_report_valid) { + udi_hid_raw_send_report(); + } +} + +static void udi_hid_raw_setreport_valid(void) +{ + +} + +#endif //RAW diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h new file mode 100644 index 0000000000..9a2741534d --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -0,0 +1,109 @@ +/** + * \file + * + * \brief USB Device Human Interface Device (HID) keyboard interface. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDC_HID_KBD_H_ +#define _UDC_HID_KBD_H_ + +#include "udc_desc.h" +#include "udi.h" + +#ifdef __cplusplus +extern "C" { +#endif + +//****************************************************************************** +// Keyboard interface definitions +//****************************************************************************** +#ifdef KBD +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_kbd; +extern bool udi_hid_kbd_b_report_valid; +extern uint8_t udi_hid_kbd_report_set; +bool udi_hid_kbd_send_report(void); +#endif //KBD + +//******************************************************************************************** +// NKRO Keyboard +//******************************************************************************************** +#ifdef NKRO +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_nkro; +extern bool udi_hid_nkro_b_report_valid; +bool udi_hid_nkro_send_report(void); +#endif //NKRO + +//******************************************************************************************** +// SYS-CTRL interface +//******************************************************************************************** +#ifdef EXK +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_exk; +extern bool udi_hid_exk_b_report_valid; +extern uint8_t udi_hid_exk_report_set; +bool udi_hid_exk_send_report(void); +#endif //EXK + +//******************************************************************************************** +// MOU Mouse +//******************************************************************************************** +#ifdef MOU +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_mou; +extern bool udi_hid_mou_b_report_valid; +bool udi_hid_mou_send_report(void); +#endif //MOU + +//******************************************************************************************** +// RAW Raw +//******************************************************************************************** +#ifdef RAW +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_raw; +bool udi_hid_raw_send_report(void); +#endif //RAW + +//@} + +#ifdef __cplusplus +} +#endif + +#endif // _UDC_HID_KBD_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h new file mode 100644 index 0000000000..db5db17ed5 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_conf.h @@ -0,0 +1,60 @@ +/** + * \file + * + * \brief Default HID keyboard configuration for a USB Device + * with a single interface HID keyboard + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UDI_HID_KBD_CONF_H_ +#define _UDI_HID_KBD_CONF_H_ + +/** + * \addtogroup udi_hid_keyboard_group_single_desc + * @{ + */ + +#include "udi_device_conf.h" + +#include "udi_hid_kbd.h" + +#endif // _UDI_HID_KBD_CONF_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c new file mode 100644 index 0000000000..16bd4e514c --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c @@ -0,0 +1,179 @@ +/** + * \file + * + * \brief Default descriptors for a USB Device + * with a single interface HID keyboard + * + * Copyright (c) 2009-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#include "conf_usb.h" +#include "usb_protocol.h" +#include "udc_desc.h" +#include "udi_device_conf.h" +#include "udi_hid_kbd.h" +#include "udi_cdc.h" + +/** + * \ingroup udi_hid_keyboard_group + * \defgroup udi_hid_keyboard_group_single_desc USB device descriptors for a single interface + * + * The following structures provide the USB device descriptors required + * for USB Device with a single interface HID keyboard. + * + * It is ready to use and do not require more definition. + * @{ + */ + +//! USB Device Descriptor +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE usb_dev_desc_t udc_device_desc = { + .bLength = sizeof(usb_dev_desc_t), + .bDescriptorType = USB_DT_DEVICE, + .bcdUSB = LE16(USB_V2_0), + .bDeviceClass = DEVICE_CLASS, + .bDeviceSubClass = DEVICE_SUBCLASS, + .bDeviceProtocol = DEVICE_PROTOCOL, + .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, + .idVendor = LE16(USB_DEVICE_VENDOR_ID), + .idProduct = LE16(USB_DEVICE_PRODUCT_ID), + .bcdDevice = LE16(USB_DEVICE_VERSION), +#ifdef USB_DEVICE_MANUFACTURE_NAME + .iManufacturer = 1, +#else + .iManufacturer = 0, // No manufacture string +#endif +#ifdef USB_DEVICE_PRODUCT_NAME + .iProduct = 2, +#else + .iProduct = 0, // No product string +#endif +#if (defined USB_DEVICE_SERIAL_NAME || defined USB_DEVICE_GET_SERIAL_NAME_POINTER) + .iSerialNumber = 3, +#else + .iSerialNumber = 0, // No serial string +#endif + .bNumConfigurations = 1 +}; + +#if 0 +#ifdef USB_DEVICE_HS_SUPPORT +//! USB Device Qualifier Descriptor for HS +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE usb_dev_qual_desc_t udc_device_qual = { + .bLength = sizeof(usb_dev_qual_desc_t), + .bDescriptorType = USB_DT_DEVICE_QUALIFIER, + .bcdUSB = LE16(USB_V2_0), + .bDeviceClass = 0, + .bDeviceSubClass = 0, + .bDeviceProtocol = 0, + .bMaxPacketSize0 = USB_DEVICE_EP_CTRL_SIZE, + .bNumConfigurations = 1 +}; +#endif +#endif + +//! USB Device Configuration Descriptor filled for FS and HS +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udc_desc_t udc_desc = { + .conf.bLength = sizeof(usb_conf_desc_t), + .conf.bDescriptorType = USB_DT_CONFIGURATION, + .conf.wTotalLength = LE16(sizeof(udc_desc_t)), + .conf.bNumInterfaces = USB_DEVICE_NB_INTERFACE, + .conf.bConfigurationValue = 1, + .conf.iConfiguration = 0, + .conf.bmAttributes = /* USB_CONFIG_ATTR_MUST_SET | */ USB_DEVICE_ATTR, + .conf.bMaxPower = USB_CONFIG_MAX_POWER(USB_DEVICE_POWER), +#ifdef KBD + .hid_kbd = UDI_HID_KBD_DESC, +#endif +#ifdef RAW + .hid_raw = UDI_HID_RAW_DESC, +#endif +#ifdef MOU + .hid_mou = UDI_HID_MOU_DESC, +#endif +#ifdef EXK + .hid_exk = UDI_HID_EXK_DESC, +#endif +#ifdef NKRO + .hid_nkro = UDI_HID_NKRO_DESC, +#endif +#ifdef CDC + .cdc_serial = CDC_DESCRIPTOR, +#endif +}; + +UDC_DESC_STORAGE udi_api_t *udi_apis[USB_DEVICE_NB_INTERFACE] = { + #ifdef KBD + &udi_api_hid_kbd, + #endif + #ifdef RAW + &udi_api_hid_raw, + #endif + #ifdef MOU + &udi_api_hid_mou, + #endif + #ifdef EXK + &udi_api_hid_exk, + #endif + #ifdef NKRO + &udi_api_hid_nkro, + #endif + #ifdef CDC + &udi_api_cdc_comm, &udi_api_cdc_data, + #endif +}; + +//! Add UDI with USB Descriptors FS & HS +UDC_DESC_STORAGE udc_config_speed_t udc_config_fshs[1] = {{ + .desc = (usb_conf_desc_t UDC_DESC_STORAGE*)&udc_desc, + .udi_apis = udi_apis, +}}; + +//! Add all information about USB Device in global structure for UDC +UDC_DESC_STORAGE udc_config_t udc_config = { + .confdev_lsfs = &udc_device_desc, + .conf_lsfs = udc_config_fshs, +}; + +//@} +//@} diff --git a/tmk_core/protocol/arm_atsam/usb/ui.c b/tmk_core/protocol/arm_atsam/usb/ui.c new file mode 100644 index 0000000000..031678b643 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/ui.c @@ -0,0 +1,106 @@ +/** + * \file + * + * \brief User Interface + * + * Copyright (c) 2014-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef ARM_MATH_CM4 + #define ARM_MATH_CM4 +#endif + +#undef LITTLE_ENDIAN //redefined in samd51j18a.h +#include "samd51j18a.h" +#include "ui.h" + +volatile uint8_t usb_state; + +//! Sequence process running each \c SEQUENCE_PERIOD ms +#define SEQUENCE_PERIOD 150 + +#if 0 +/* Interrupt on "pin change" from push button to do wakeup on USB + * Note: + * This interrupt is enable when the USB host enable remote wakeup feature + * This interrupt wakeup the CPU if this one is in idle mode + */ +static void ui_wakeup_handler(void) +{ + /* It is a wakeup then send wakeup USB */ + udc_remotewakeup(); +} +#endif + +void ui_init(void) +{ + usb_state = USB_STATE_POWERUP; +} + +void ui_powerdown(void) +{ + usb_state = USB_STATE_POWERDOWN; +} + +void ui_wakeup_enable(void) +{ + +} + +void ui_wakeup_disable(void) +{ + +} + +void ui_wakeup(void) +{ + usb_state = USB_STATE_POWERUP; +} + +void ui_process(uint16_t framenumber) +{ + +} + +void ui_kbd_led(uint8_t value) +{ + +} diff --git a/tmk_core/protocol/arm_atsam/usb/ui.h b/tmk_core/protocol/arm_atsam/usb/ui.h new file mode 100644 index 0000000000..3d899e6694 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/ui.h @@ -0,0 +1,82 @@ +/** + * \file + * + * \brief Common User Interface for HID Keyboard application + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _UI_H_ +#define _UI_H_ + +extern volatile uint8_t usb_state; + +#define USB_STATE_UNKNOWN 0 +#define USB_STATE_POWERDOWN 1 +#define USB_STATE_POWERUP 2 + +//! \brief Initializes the user interface +void ui_init(void); + +//! \brief Enters the user interface in power down mode +void ui_powerdown(void); + +//! \brief Enables the asynchronous interrupts of the user interface +void ui_wakeup_enable(void); + +//! \brief Disables the asynchronous interrupts of the user interface +void ui_wakeup_disable(void); + +//! \brief Exits the user interface of power down mode +void ui_wakeup(void); + +/*! \brief This process is called each 1ms + * It is called only if the USB interface is enabled. + * + * \param framenumber Current frame number + */ +void ui_process(uint16_t framenumber); + +/*! \brief Turn on or off the keyboard LEDs + */ +void ui_kbd_led(uint8_t value); + +#endif // _UI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb.c b/tmk_core/protocol/arm_atsam/usb/usb.c new file mode 100644 index 0000000000..d30d76dd11 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb.c @@ -0,0 +1,1144 @@ +/** + * \file + * + * \brief SAM USB Driver. + * + * Copyright (C) 2014-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#define DEVICE_MODE_ONLY true +#define SAMD11 DEVICE_MODE_ONLY + +#ifndef ARM_MATH_CM4 + #define ARM_MATH_CM4 +#endif + +#include "compiler.h" +#undef LITTLE_ENDIAN //redefined in samd51j18a.h +#include "samd51j18a.h" +#include +#include +#include "arm_math.h" +#include "status_codes.h" +#include "usb.h" + +/** Fields definition from a LPM TOKEN */ +#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) +#define USB_LPM_ATTRIBUT_HIRD_MASK (0xF << 4) +#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) +#define USB_LPM_ATTRIBUT_BLINKSTATE(value) ((value & 0xF) << 0) +#define USB_LPM_ATTRIBUT_HIRD(value) ((value & 0xF) << 4) +#define USB_LPM_ATTRIBUT_REMOTEWAKE(value) ((value & 1) << 8) +#define USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) + +/** + * \brief Mask selecting the index part of an endpoint address + */ +#define USB_EP_ADDR_MASK 0x0f + +/** + * \brief Endpoint transfer direction is IN + */ +#define USB_EP_DIR_IN 0x80 + +/** + * \brief Endpoint transfer direction is OUT + */ +#define USB_EP_DIR_OUT 0x00 + +/** + * \name USB SRAM data containing pipe descriptor table + * The content of the USB SRAM can be : + * - modified by USB hardware interface to update pipe status. + * Thereby, it is read by software. + * - modified by USB software to control pipe. + * Thereby, it is read by hardware. + * This data section is volatile. + * + * @{ + */ +COMPILER_PACK_SET(1) +COMPILER_WORD_ALIGNED +union { + UsbDeviceDescriptor usb_endpoint_table[USB_EPT_NUM]; +} usb_descriptor_table; +COMPILER_PACK_RESET() +/** @} */ + +/** + * \brief Local USB module instance + */ +static struct usb_module *_usb_instances; + +/* Device LPM callback variable */ +static uint32_t device_callback_lpm_wakeup_enable; + +/** + * \brief Device endpoint callback parameter variable, used to transfer info to UDD wrapper layer + */ +static struct usb_endpoint_callback_parameter ep_callback_para; + +/** + * \internal USB Device IRQ Mask Bits Map + */ +static const uint16_t _usb_device_irq_bits[USB_DEVICE_CALLBACK_N] = { + USB_DEVICE_INTFLAG_SOF, + USB_DEVICE_INTFLAG_EORST, + USB_DEVICE_INTFLAG_WAKEUP | USB_DEVICE_INTFLAG_EORSM | USB_DEVICE_INTFLAG_UPRSM, + USB_DEVICE_INTFLAG_RAMACER, + USB_DEVICE_INTFLAG_SUSPEND, + USB_DEVICE_INTFLAG_LPMNYET, + USB_DEVICE_INTFLAG_LPMSUSP, +}; + +/** + * \internal USB Device IRQ Mask Bits Map + */ +static const uint8_t _usb_endpoint_irq_bits[USB_DEVICE_EP_CALLBACK_N] = { + USB_DEVICE_EPINTFLAG_TRCPT_Msk, + USB_DEVICE_EPINTFLAG_TRFAIL_Msk, + USB_DEVICE_EPINTFLAG_RXSTP, + USB_DEVICE_EPINTFLAG_STALL_Msk +}; + +/** + * \brief Registers a USB device callback + * + * Registers a callback function which is implemented by the user. + * + * \note The callback must be enabled by \ref usb_device_enable_callback, + * in order for the interrupt handler to call it when the conditions for the + * callback type is met. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] callback_type Callback type given by an enum + * \param[in] callback_func Pointer to callback function + * + * \return Status of the registration operation. + * \retval STATUS_OK The callback was registered successfully. + */ +enum status_code usb_device_register_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type, + usb_device_callback_t callback_func) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(callback_func); + + /* Register callback function */ + module_inst->device_callback[callback_type] = callback_func; + + /* Set the bit corresponding to the callback_type */ + module_inst->device_registered_callback_mask |= _usb_device_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Unregisters a USB device callback + * + * Unregisters an asynchronous callback implemented by the user. Removing it + * from the internal callback registration table. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the de-registration operation. + * \retval STATUS_OK The callback was unregistered successfully. + */ +enum status_code usb_device_unregister_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + + /* Unregister callback function */ + module_inst->device_callback[callback_type] = NULL; + + /* Clear the bit corresponding to the callback_type */ + module_inst->device_registered_callback_mask &= ~_usb_device_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Enables USB device callback generation for a given type. + * + * Enables asynchronous callbacks for a given logical type. + * This must be called before USB device generate callback events. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the callback enable operation. + * \retval STATUS_OK The callback was enabled successfully. + */ +enum status_code usb_device_enable_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + /* clear related flag */ + module_inst->hw->DEVICE.INTFLAG.reg = _usb_device_irq_bits[callback_type]; + + /* Enable callback */ + module_inst->device_enabled_callback_mask |= _usb_device_irq_bits[callback_type]; + + module_inst->hw->DEVICE.INTENSET.reg = _usb_device_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Disables USB device callback generation for a given type. + * + * Disables asynchronous callbacks for a given logical type. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the callback disable operation. + * \retval STATUS_OK The callback was disabled successfully. + */ +enum status_code usb_device_disable_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + /* Disable callback */ + module_inst->device_enabled_callback_mask &= ~_usb_device_irq_bits[callback_type]; + + module_inst->hw->DEVICE.INTENCLR.reg = _usb_device_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Registers a USB device endpoint callback + * + * Registers a callback function which is implemented by the user. + * + * \note The callback must be enabled by \ref usb_device_endpoint_enable_callback, + * in order for the interrupt handler to call it when the conditions for the + * callback type is met. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] ep_num Endpoint to configure + * \param[in] callback_type Callback type given by an enum + * \param[in] callback_func Pointer to callback function + * + * \return Status of the registration operation. + * \retval STATUS_OK The callback was registered successfully. + */ +enum status_code usb_device_endpoint_register_callback( + struct usb_module *module_inst, uint8_t ep_num, + enum usb_device_endpoint_callback callback_type, + usb_device_endpoint_callback_t callback_func) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(ep_num < USB_EPT_NUM); + Assert(callback_func); + + /* Register callback function */ + module_inst->device_endpoint_callback[ep_num][callback_type] = callback_func; + + /* Set the bit corresponding to the callback_type */ + module_inst->device_endpoint_registered_callback_mask[ep_num] |= _usb_endpoint_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Unregisters a USB device endpoint callback + * + * Unregisters an callback implemented by the user. Removing it + * from the internal callback registration table. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] ep_num Endpoint to configure + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the de-registration operation. + * \retval STATUS_OK The callback was unregistered successfully. + */ +enum status_code usb_device_endpoint_unregister_callback( + struct usb_module *module_inst, uint8_t ep_num, + enum usb_device_endpoint_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(ep_num < USB_EPT_NUM); + + /* Unregister callback function */ + module_inst->device_endpoint_callback[ep_num][callback_type] = NULL; + + /* Clear the bit corresponding to the callback_type */ + module_inst->device_endpoint_registered_callback_mask[ep_num] &= ~_usb_endpoint_irq_bits[callback_type]; + + return STATUS_OK; +} + +/** + * \brief Enables USB device endpoint callback generation for a given type. + * + * Enables callbacks for a given logical type. + * This must be called before USB device pipe generate callback events. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] ep Endpoint to configure + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the callback enable operation. + * \retval STATUS_OK The callback was enabled successfully. + */ +enum status_code usb_device_endpoint_enable_callback( + struct usb_module *module_inst, uint8_t ep, + enum usb_device_endpoint_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + Assert(ep_num < USB_EPT_NUM); + + /* Enable callback */ + module_inst->device_endpoint_enabled_callback_mask[ep_num] |= _usb_endpoint_irq_bits[callback_type]; + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRCPT) { + if (ep_num == 0) { // control endpoint + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT0 | USB_DEVICE_EPINTENSET_TRCPT1; + } else if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRCPT0; + } + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL) { + if (ep_num == 0) { // control endpoint + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRFAIL0 | USB_DEVICE_EPINTENSET_TRFAIL1; + } else if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRFAIL1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_TRFAIL0; + } + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_RXSTP) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_RXSTP; + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_STALL) { + if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_STALL1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENSET.reg = USB_DEVICE_EPINTENSET_STALL0; + } + } + + return STATUS_OK; +} + +/** + * \brief Disables USB device endpoint callback generation for a given type. + * + * Disables callbacks for a given logical type. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] ep Endpoint to configure + * \param[in] callback_type Callback type given by an enum + * + * \return Status of the callback disable operation. + * \retval STATUS_OK The callback was disabled successfully. + */ +enum status_code usb_device_endpoint_disable_callback( + struct usb_module *module_inst, uint8_t ep, + enum usb_device_endpoint_callback callback_type) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + Assert(ep_num < USB_EPT_NUM); + + /* Enable callback */ + module_inst->device_endpoint_enabled_callback_mask[ep_num] &= ~_usb_endpoint_irq_bits[callback_type]; + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRCPT) { + if (ep_num == 0) { // control endpoint + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRCPT0 | USB_DEVICE_EPINTENCLR_TRCPT1; + } else if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRCPT1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRCPT0; + } + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL) { + if (ep_num == 0) { // control endpoint + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRFAIL0 | USB_DEVICE_EPINTENCLR_TRFAIL1; + } else if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRFAIL1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_TRFAIL0; + } + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_RXSTP) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_RXSTP; + } + + if (callback_type == USB_DEVICE_ENDPOINT_CALLBACK_STALL) { + if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_STALL1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTENCLR.reg = USB_DEVICE_EPINTENCLR_STALL0; + } + } + + return STATUS_OK; +} + +/** + * \brief Initializes an USB device endpoint configuration structure to defaults. + * + * Initializes a given USB device endpoint configuration structure to a + * set of known default values. This function should be called on all new + * instances of these configuration structures before being modified by the + * user application. + * + * The default configuration is as follows: + * \li endpoint address is 0 + * \li endpoint size is 8 bytes + * \li auto_zlp is false + * \li endpoint type is control + * + * \param[out] ep_config Configuration structure to initialize to default values + */ +void usb_device_endpoint_get_config_defaults(struct usb_device_endpoint_config *ep_config) +{ + /* Sanity check arguments */ + Assert(ep_config); + + /* Write default config to config struct */ + ep_config->ep_address = 0; + ep_config->ep_size = USB_ENDPOINT_8_BYTE; + ep_config->auto_zlp = false; + ep_config->ep_type = USB_DEVICE_ENDPOINT_TYPE_CONTROL; +} + +/** + * \brief Writes an USB device endpoint configuration to the hardware module. + * + * Writes out a given configuration of an USB device endpoint + * configuration to the hardware module. If the pipe is already configured, + * the new configuration will replace the existing one. + * + * \param[in] module_inst Pointer to USB software instance struct + * \param[in] ep_config Configuration settings for the endpoint + * + * \return Status of the device endpoint configuration operation + * \retval STATUS_OK The device endpoint was configured successfully + * \retval STATUS_ERR_DENIED The endpoint address is already configured + */ +enum status_code usb_device_endpoint_set_config(struct usb_module *module_inst, + struct usb_device_endpoint_config *ep_config) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(ep_config); + + uint8_t ep_num = ep_config->ep_address & USB_EP_ADDR_MASK; + uint8_t ep_bank = (ep_config->ep_address & USB_EP_DIR_IN) ? 1 : 0; + + switch (ep_config->ep_type) { + case USB_DEVICE_ENDPOINT_TYPE_DISABLE: + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg = USB_DEVICE_EPCFG_EPTYPE0(0) | USB_DEVICE_EPCFG_EPTYPE1(0); + return STATUS_OK; + + case USB_DEVICE_ENDPOINT_TYPE_CONTROL: + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE0_Msk) == 0 && \ + (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE1_Msk) == 0) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg = USB_DEVICE_EPCFG_EPTYPE0(1) | USB_DEVICE_EPCFG_EPTYPE1(1); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK0RDY; + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK1RDY; + } else { + return STATUS_ERR_DENIED; + } + if (true == ep_config->auto_zlp) { + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].PCKSIZE.reg |= USB_DEVICE_PCKSIZE_AUTO_ZLP; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.reg |= USB_DEVICE_PCKSIZE_AUTO_ZLP; + } else { + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].PCKSIZE.reg &= ~USB_DEVICE_PCKSIZE_AUTO_ZLP; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.reg &= ~USB_DEVICE_PCKSIZE_AUTO_ZLP; + } + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].PCKSIZE.bit.SIZE = ep_config->ep_size; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.bit.SIZE = ep_config->ep_size; + return STATUS_OK; + + case USB_DEVICE_ENDPOINT_TYPE_ISOCHRONOUS: + if (ep_bank) { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE1_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE1(2); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK1RDY; + } else { + return STATUS_ERR_DENIED; + } + } else { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE0_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE0(2); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK0RDY; + } else { + return STATUS_ERR_DENIED; + } + } + break; + + case USB_DEVICE_ENDPOINT_TYPE_BULK: + if (ep_bank) { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE1_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE1(3); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK1RDY; + } else { + return STATUS_ERR_DENIED; + } + } else { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE0_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE0(3); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK0RDY; + } else { + return STATUS_ERR_DENIED; + } + } + break; + + case USB_DEVICE_ENDPOINT_TYPE_INTERRUPT: + if (ep_bank) { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE1_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE1(4); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK1RDY; + } else { + return STATUS_ERR_DENIED; + } + } else { + if ((module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg & USB_DEVICE_EPCFG_EPTYPE0_Msk) == 0){ + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.reg |= USB_DEVICE_EPCFG_EPTYPE0(4); + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK0RDY; + } else { + return STATUS_ERR_DENIED; + } + } + break; + + default: + break; + } + + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[ep_bank].PCKSIZE.bit.SIZE = ep_config->ep_size; + + if (true == ep_config->auto_zlp) { + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[ep_bank].PCKSIZE.reg |= USB_DEVICE_PCKSIZE_AUTO_ZLP; + } else { + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[ep_bank].PCKSIZE.reg &= ~USB_DEVICE_PCKSIZE_AUTO_ZLP; + } + + return STATUS_OK; +} + +/** + * \brief Check if current endpoint is configured + * + * \param module_inst Pointer to USB software instance struct + * \param ep Endpoint address (direction & number) + * + * \return \c true if endpoint is configured and ready to use + */ +bool usb_device_endpoint_is_configured(struct usb_module *module_inst, uint8_t ep) +{ + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + uint8_t flag; + + if (ep & USB_EP_DIR_IN) { + flag = (uint8_t)(module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.bit.EPTYPE1); + } else { + flag = (uint8_t)(module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.bit.EPTYPE0); + } + return ((enum usb_device_endpoint_type)(flag) != USB_DEVICE_ENDPOINT_TYPE_DISABLE); +} + + +/** + * \brief Abort ongoing job on the endpoint + * + * \param module_inst Pointer to USB software instance struct + * \param ep Endpoint address + */ +void usb_device_endpoint_abort_job(struct usb_module *module_inst, uint8_t ep) +{ + uint8_t ep_num; + ep_num = ep & USB_EP_ADDR_MASK; + + // Stop transfer + if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK1RDY; + // Eventually ack a transfer occur during abort + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK0RDY; + // Eventually ack a transfer occur during abort + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT0; + } +} + +/** + * \brief Check if endpoint is halted + * + * \param module_inst Pointer to USB software instance struct + * \param ep Endpoint address + * + * \return \c true if the endpoint is halted + */ +bool usb_device_endpoint_is_halted(struct usb_module *module_inst, uint8_t ep) +{ + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + if (ep & USB_EP_DIR_IN) { + return (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ1); + } else { + return (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ0); + } +} + +/** + * \brief Halt the endpoint (send STALL) + * + * \param module_inst Pointer to USB software instance struct + * \param ep Endpoint address + */ +void usb_device_endpoint_set_halt(struct usb_module *module_inst, uint8_t ep) +{ + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + // Stall endpoint + if (ep & USB_EP_DIR_IN) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ1; + } else { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ0; + } +} + +/** + * \brief Clear endpoint halt state + * + * \param module_inst Pointer to USB software instance struct + * \param ep Endpoint address + */ +void usb_device_endpoint_clear_halt(struct usb_module *module_inst, uint8_t ep) +{ + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + if (ep & USB_EP_DIR_IN) { + if (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ1) { + // Remove stall request + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ1; + if (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL1) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL1; + // The Stall has occurred, then reset data toggle + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSSET_DTGLIN; + } + } + } else { + if (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUS.reg & USB_DEVICE_EPSTATUSSET_STALLRQ0) { + // Remove stall request + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_STALLRQ0; + if (module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL0) { + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL0; + // The Stall has occurred, then reset data toggle + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSSET_DTGLOUT; + } + } + } +} + +/** + * \brief Start write buffer job on a endpoint + * + * \param module_inst Pointer to USB module instance + * \param ep_num Endpoint number + * \param pbuf Pointer to buffer + * \param buf_size Size of buffer + * + * \return Status of procedure + * \retval STATUS_OK Job started successfully + * \retval STATUS_ERR_DENIED Endpoint is not ready + */ +enum status_code usb_device_endpoint_write_buffer_job(struct usb_module *module_inst,uint8_t ep_num, + uint8_t* pbuf, uint32_t buf_size) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + Assert(ep_num < USB_EPT_NUM); + + uint8_t flag; + flag = (uint8_t)(module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.bit.EPTYPE1); + if ((enum usb_device_endpoint_type)(flag) == USB_DEVICE_ENDPOINT_TYPE_DISABLE) { + return STATUS_ERR_DENIED; + }; + + /* get endpoint configuration from setting register */ + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].ADDR.reg = (uint32_t)pbuf; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.bit.MULTI_PACKET_SIZE = 0; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT = buf_size; + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_BK1RDY; + + return STATUS_OK; +} + +/** + * \brief Start read buffer job on a endpoint + * + * \param module_inst Pointer to USB module instance + * \param ep_num Endpoint number + * \param pbuf Pointer to buffer + * \param buf_size Size of buffer + * + * \return Status of procedure + * \retval STATUS_OK Job started successfully + * \retval STATUS_ERR_DENIED Endpoint is not ready + */ +enum status_code usb_device_endpoint_read_buffer_job(struct usb_module *module_inst,uint8_t ep_num, + uint8_t* pbuf, uint32_t buf_size) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + Assert(ep_num < USB_EPT_NUM); + + uint8_t flag; + flag = (uint8_t)(module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPCFG.bit.EPTYPE0); + if ((enum usb_device_endpoint_type)(flag) == USB_DEVICE_ENDPOINT_TYPE_DISABLE) { + return STATUS_ERR_DENIED; + }; + + /* get endpoint configuration from setting register */ + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].ADDR.reg = (uint32_t)pbuf; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = buf_size; + usb_descriptor_table.usb_endpoint_table[ep_num].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT = 0; + module_inst->hw->DEVICE.DeviceEndpoint[ep_num].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK0RDY; + + return STATUS_OK; +} + +/** + * \brief Start setup packet read job on a endpoint + * + * \param module_inst Pointer to USB device module instance + * \param pbuf Pointer to buffer + * + * \return Status of procedure + * \retval STATUS_OK Job started successfully + * \retval STATUS_ERR_DENIED Endpoint is not ready + */ +enum status_code usb_device_endpoint_setup_buffer_job(struct usb_module *module_inst, + uint8_t* pbuf) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + /* get endpoint configuration from setting register */ + usb_descriptor_table.usb_endpoint_table[0].DeviceDescBank[0].ADDR.reg = (uint32_t)pbuf; + usb_descriptor_table.usb_endpoint_table[0].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = 8; + usb_descriptor_table.usb_endpoint_table[0].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT = 0; + module_inst->hw->DEVICE.DeviceEndpoint[0].EPSTATUSCLR.reg = USB_DEVICE_EPSTATUSCLR_BK0RDY; + + return STATUS_OK; +} + +static void _usb_device_interrupt_handler(void) +{ + uint16_t ep_inst; + uint16_t flags, flags_run; + ep_inst = _usb_instances->hw->DEVICE.EPINTSMRY.reg; + + /* device interrupt */ + if (0 == ep_inst) { + int i; + + /* get interrupt flags */ + flags = _usb_instances->hw->DEVICE.INTFLAG.reg; + flags_run = flags & + _usb_instances->device_enabled_callback_mask & + _usb_instances->device_registered_callback_mask; + + for (i = 0; i < USB_DEVICE_CALLBACK_N; i ++) { + if (flags & _usb_device_irq_bits[i]) { + _usb_instances->hw->DEVICE.INTFLAG.reg = + _usb_device_irq_bits[i]; + } + if (flags_run & _usb_device_irq_bits[i]) { + if (i == USB_DEVICE_CALLBACK_LPMSUSP) { + device_callback_lpm_wakeup_enable = + usb_descriptor_table.usb_endpoint_table[0].DeviceDescBank[0].EXTREG.bit.VARIABLE + & USB_LPM_ATTRIBUT_REMOTEWAKE_MASK; + } + (_usb_instances->device_callback[i])(_usb_instances, &device_callback_lpm_wakeup_enable); + } + } + + } else { + /* endpoint interrupt */ + + for (uint8_t i = 0; i < USB_EPT_NUM; i++) { + + if (ep_inst & (1 << i)) { + flags = _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg; + flags_run = flags & + _usb_instances->device_endpoint_enabled_callback_mask[i] & + _usb_instances->device_endpoint_registered_callback_mask[i]; + + // endpoint transfer stall interrupt + if (flags & USB_DEVICE_EPINTFLAG_STALL_Msk) { + if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL1) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL1; + ep_callback_para.endpoint_address = USB_EP_DIR_IN | i; + } else if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_STALL0) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL0; + ep_callback_para.endpoint_address = USB_EP_DIR_OUT | i; + } + + if (flags_run & USB_DEVICE_EPINTFLAG_STALL_Msk) { + (_usb_instances->device_endpoint_callback[i][USB_DEVICE_ENDPOINT_CALLBACK_STALL])(_usb_instances,&ep_callback_para); + } + return; + } + + // endpoint received setup interrupt + if (flags & USB_DEVICE_EPINTFLAG_RXSTP) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_RXSTP; + if(_usb_instances->device_endpoint_enabled_callback_mask[i] & _usb_endpoint_irq_bits[USB_DEVICE_ENDPOINT_CALLBACK_RXSTP]) { + ep_callback_para.received_bytes = (uint16_t)(usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT); + (_usb_instances->device_endpoint_callback[i][USB_DEVICE_ENDPOINT_CALLBACK_RXSTP])(_usb_instances,&ep_callback_para); + } + return; + } + + // endpoint transfer complete interrupt + if (flags & USB_DEVICE_EPINTFLAG_TRCPT_Msk) { + if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT1) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT1; + ep_callback_para.endpoint_address = USB_EP_DIR_IN | i; + ep_callback_para.sent_bytes = (uint16_t)(usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT); + + } else if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT0) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT0; + ep_callback_para.endpoint_address = USB_EP_DIR_OUT | i; + ep_callback_para.received_bytes = (uint16_t)(usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT); + ep_callback_para.out_buffer_size = (uint16_t)(usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE); + } + if(flags_run & USB_DEVICE_EPINTFLAG_TRCPT_Msk) { + (_usb_instances->device_endpoint_callback[i][USB_DEVICE_ENDPOINT_CALLBACK_TRCPT])(_usb_instances,&ep_callback_para); + } + return; + } + + // endpoint transfer fail interrupt + if (flags & USB_DEVICE_EPINTFLAG_TRFAIL_Msk) { + if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRFAIL1) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRFAIL1; + if (usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[1].STATUS_BK.reg & USB_DEVICE_STATUS_BK_ERRORFLOW) { + usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[1].STATUS_BK.reg &= ~USB_DEVICE_STATUS_BK_ERRORFLOW; + } + ep_callback_para.endpoint_address = USB_EP_DIR_IN | i; + if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT1) { + return; + } + } else if(_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRFAIL0) { + _usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRFAIL0; + if (usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[0].STATUS_BK.reg & USB_DEVICE_STATUS_BK_ERRORFLOW) { + usb_descriptor_table.usb_endpoint_table[i].DeviceDescBank[0].STATUS_BK.reg &= ~USB_DEVICE_STATUS_BK_ERRORFLOW; + } + ep_callback_para.endpoint_address = USB_EP_DIR_OUT | i; + if (_usb_instances->hw->DEVICE.DeviceEndpoint[i].EPINTFLAG.reg & USB_DEVICE_EPINTFLAG_TRCPT0) { + return; + } + } + + if(flags_run & USB_DEVICE_EPINTFLAG_TRFAIL_Msk) { + (_usb_instances->device_endpoint_callback[i][USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL])(_usb_instances,&ep_callback_para); + } + return; + } + } + } + } +} + +/** + * \brief Enable the USB module peripheral + * + * \param module_inst pointer to USB module instance + */ +void usb_enable(struct usb_module *module_inst) +{ + Assert(module_inst); + Assert(module_inst->hw); + + module_inst->hw->DEVICE.CTRLA.reg |= USB_CTRLA_ENABLE; + while (module_inst->hw->DEVICE.SYNCBUSY.reg == USB_SYNCBUSY_ENABLE); +} + +/** + * \brief Disable the USB module peripheral + * + * \param module_inst pointer to USB module instance + */ +void usb_disable(struct usb_module *module_inst) +{ + Assert(module_inst); + Assert(module_inst->hw); + + module_inst->hw->DEVICE.INTENCLR.reg = USB_DEVICE_INTENCLR_MASK; + module_inst->hw->DEVICE.INTFLAG.reg = USB_DEVICE_INTFLAG_MASK; + module_inst->hw->DEVICE.CTRLA.reg &= ~USB_CTRLA_ENABLE; + while (module_inst->hw->DEVICE.SYNCBUSY.reg == USB_SYNCBUSY_ENABLE); +} + +/** + * \brief Interrupt handler for the USB module. + */ +void USB_0_Handler(void) +{ + if (_usb_instances->hw->DEVICE.CTRLA.bit.MODE) { + + } else { + /*device mode ISR */ + _usb_device_interrupt_handler(); + } +} + +void USB_1_Handler(void) +{ + _usb_device_interrupt_handler(); +} + +void USB_2_Handler(void) +{ + _usb_device_interrupt_handler(); +} + +void USB_3_Handler(void) +{ + _usb_device_interrupt_handler(); +} + +/** + * \brief Get the default USB module settings + * + * \param[out] module_config Configuration structure to initialize to default values + */ +void usb_get_config_defaults(struct usb_config *module_config) +{ + Assert(module_config); + + /* Sanity check arguments */ + Assert(module_config); + /* Write default configuration to config struct */ + module_config->select_host_mode = 0; + module_config->run_in_standby = 1; + module_config->source_generator = 0; + module_config->speed_mode = USB_SPEED_FULL; +} + +#define NVM_USB_PAD_TRANSN_POS 45 +#define NVM_USB_PAD_TRANSN_SIZE 5 +#define NVM_USB_PAD_TRANSP_POS 50 +#define NVM_USB_PAD_TRANSP_SIZE 5 +#define NVM_USB_PAD_TRIM_POS 55 +#define NVM_USB_PAD_TRIM_SIZE 3 + +/** + * \brief Initializes USB module instance + * + * Enables the clock and initializes the USB module, based on the given + * configuration values. + * + * \param[in,out] module_inst Pointer to the software module instance struct + * \param[in] hw Pointer to the USB hardware module + * \param[in] module_config Pointer to the USB configuration options struct + * + * \return Status of the initialization procedure. + * + * \retval STATUS_OK The module was initialized successfully + */ + +#define GCLK_USB 10 + +enum status_code usb_init(struct usb_module *module_inst, Usb *const hw, + struct usb_config *module_config) +{ + /* Sanity check arguments */ + Assert(hw); + Assert(module_inst); + Assert(module_config); + + uint32_t i,j; + uint32_t pad_transn, pad_transp, pad_trim; + + Gclk *pgclk = GCLK; + Mclk *pmclk = MCLK; + Port *pport = PORT; + Oscctrl *posc = OSCCTRL; + + _usb_instances = module_inst; + + /* Associate the software module instance with the hardware module */ + module_inst->hw = hw; + + //setup peripheral and synchronous bus clocks to USB + pmclk->AHBMASK.bit.USB_ = 1; + pmclk->APBBMASK.bit.USB_ = 1; + + /* Set up the USB DP/DN pins */ + pport->Group[0].PMUX[12].reg = 0x77; //PA24, PA25, function column H for USB D-, D+ + pport->Group[0].PINCFG[24].bit.PMUXEN = 1; + pport->Group[0].PINCFG[25].bit.PMUXEN = 1; + pport->Group[1].PMUX[11].bit.PMUXE = 7; //PB22, function column H for USB SOF_1KHz output + pport->Group[1].PINCFG[22].bit.PMUXEN = 1; + + //configure and enable DFLL for USB clock recovery mode at 48MHz + posc->DFLLCTRLA.bit.ENABLE = 0; + while (posc->DFLLSYNC.bit.ENABLE); + while (posc->DFLLSYNC.bit.DFLLCTRLB); + posc->DFLLCTRLB.bit.USBCRM = 1; + while (posc->DFLLSYNC.bit.DFLLCTRLB); + posc->DFLLCTRLB.bit.MODE = 1; + while (posc->DFLLSYNC.bit.DFLLCTRLB); + posc->DFLLCTRLB.bit.QLDIS = 0; + while (posc->DFLLSYNC.bit.DFLLCTRLB); + posc->DFLLCTRLB.bit.CCDIS = 1; + posc->DFLLMUL.bit.MUL = 0xbb80; //4800 x 1KHz + while (posc->DFLLSYNC.bit.DFLLMUL); + posc->DFLLCTRLA.bit.ENABLE = 1; + while (posc->DFLLSYNC.bit.ENABLE); + + /* Setup clock for module */ + pgclk->PCHCTRL[GCLK_USB].bit.GEN = 0; + pgclk->PCHCTRL[GCLK_USB].bit.CHEN = 1; + + /* Reset */ + hw->DEVICE.CTRLA.bit.SWRST = 1; + while (hw->DEVICE.SYNCBUSY.bit.SWRST) { + /* Sync wait */ + } + + /* Change QOS values to have the best performance and correct USB behaviour */ + USB->DEVICE.QOSCTRL.bit.CQOS = 2; + USB->DEVICE.QOSCTRL.bit.DQOS = 2; + + /* Load Pad Calibration */ + + pad_transn = (USB_FUSES_TRANSN_ADDR >> USB_FUSES_TRANSN_Pos) & USB_FUSES_TRANSN_Msk; + if (pad_transn == 0x1F) { + pad_transn = 5; + } + + hw->DEVICE.PADCAL.bit.TRANSN = pad_transn; + + pad_transp = (USB_FUSES_TRANSP_ADDR >> USB_FUSES_TRANSP_Pos) & USB_FUSES_TRANSP_Msk; + if (pad_transp == 0x1F) { + pad_transp = 29; + } + + hw->DEVICE.PADCAL.bit.TRANSP = pad_transp; + + pad_trim = (USB_FUSES_TRIM_ADDR >> USB_FUSES_TRIM_Pos) & USB_FUSES_TRIM_Msk; + if (pad_trim == 0x07) { + pad_trim = 3; + } + + hw->DEVICE.PADCAL.bit.TRIM = pad_trim; + + /* Set the configuration */ + hw->DEVICE.CTRLA.bit.MODE = module_config->select_host_mode; + hw->DEVICE.CTRLA.bit.RUNSTDBY = module_config->run_in_standby; + hw->DEVICE.DESCADD.reg = (uint32_t)(&usb_descriptor_table.usb_endpoint_table[0]); + if (USB_SPEED_FULL == module_config->speed_mode) { + module_inst->hw->DEVICE.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; + } else if(USB_SPEED_LOW == module_config->speed_mode) { + module_inst->hw->DEVICE.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_LS_Val; + } + + memset((uint8_t *)(&usb_descriptor_table.usb_endpoint_table[0]), 0, + sizeof(usb_descriptor_table.usb_endpoint_table)); + + /* device callback related */ + for (i = 0; i < USB_DEVICE_CALLBACK_N; i++) { + module_inst->device_callback[i] = NULL; + } + for (i = 0; i < USB_EPT_NUM; i++) { + for(j = 0; j < USB_DEVICE_EP_CALLBACK_N; j++) { + module_inst->device_endpoint_callback[i][j] = NULL; + } + } + module_inst->device_registered_callback_mask = 0; + module_inst->device_enabled_callback_mask = 0; + for (j = 0; j < USB_EPT_NUM; j++) { + module_inst->device_endpoint_registered_callback_mask[j] = 0; + module_inst->device_endpoint_enabled_callback_mask[j] = 0; + } + + /* Enable interrupts for this USB module */ + NVIC_EnableIRQ(USB_0_IRQn); + NVIC_EnableIRQ(USB_2_IRQn); + NVIC_EnableIRQ(USB_3_IRQn); + + return STATUS_OK; +} + diff --git a/tmk_core/protocol/arm_atsam/usb/usb.h b/tmk_core/protocol/arm_atsam/usb/usb.h new file mode 100644 index 0000000000..9a452881a7 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb.h @@ -0,0 +1,492 @@ +/** + * \file + * + * \brief SAM USB Driver + * + * Copyright (C) 2014-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ +#ifndef USB_H_INCLUDED +#define USB_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \defgroup asfdoc_sam0_usb_group SAM Universal Serial Bus (USB) + * + * The Universal Serial Bus (USB) module complies with the USB 2.1 specification. + * + * The following peripherals are used by this module: + * - USB (Universal Serial Bus) + * + * The following devices can use this module: + * - Atmel | SMART SAM D51 + * + * The USB module covers following mode: + * \if USB_DEVICE_MODE + * - USB Device Mode + * \endif + * \if USB_HOST_MODE + * - USB Host Mode + * \endif + * + * The USB module covers following speed: + * \if USB_HS_MODE + * - USB High Speed (480Mbit/s) + * \endif + * - USB Full Speed (12Mbit/s) + * \if USB_LS_MODE + * - USB Low Speed (1.5Mbit/s) + * \endif + * + * \if USB_LPM_MODE + * The USB module supports Link Power Management (LPM-L1) protocol. + * \endif + * + * USB support needs whole set of enumeration process, to make the device + * recognizable and usable. The USB driver is designed to interface to the + * USB Stack in Atmel Software Framework (ASF). + * + * \if USB_DEVICE_MODE + * \section asfdoc_sam0_usb_device USB Device Mode + * The ASF USB Device Stack has defined the USB Device Driver (UDD) interface, + * to support USB device operations. The USB module device driver complies with + * this interface, so that the USB Device Stack can work based on the + * USB module. + * + * Refer to + * "ASF - USB Device Stack" for more details. + * \endif + * + * \if USB_HOST_MODE + * \section adfdoc_sam0_usb_host USB Host Mode + * The ASF USB Host Stack has defined the USB Host Driver (UHD) interface, + * to support USB host operations. The USB module host driver complies with + * this interface, so that the USB Host Stack can work based on the USB module. + * + * Refer to + * "ASF - USB Host Stack" for more details. + * \endif + */ + +/** Enum for the speed status for the USB module */ +enum usb_speed { + USB_SPEED_LOW, + USB_SPEED_FULL, +}; + +/** Enum for the possible callback types for the USB in host module */ +enum usb_host_callback { + USB_HOST_CALLBACK_SOF, + USB_HOST_CALLBACK_RESET, + USB_HOST_CALLBACK_WAKEUP, + USB_HOST_CALLBACK_DNRSM, + USB_HOST_CALLBACK_UPRSM, + USB_HOST_CALLBACK_RAMACER, + USB_HOST_CALLBACK_CONNECT, + USB_HOST_CALLBACK_DISCONNECT, + USB_HOST_CALLBACK_N, +}; + +/** Enum for the possible callback types for the USB pipe in host module */ +enum usb_host_pipe_callback { + USB_HOST_PIPE_CALLBACK_TRANSFER_COMPLETE, + USB_HOST_PIPE_CALLBACK_ERROR, + USB_HOST_PIPE_CALLBACK_SETUP, + USB_HOST_PIPE_CALLBACK_STALL, + USB_HOST_PIPE_CALLBACK_N, +}; + +/** + * \brief Host pipe types. + */ +enum usb_host_pipe_type { + USB_HOST_PIPE_TYPE_DISABLE, + USB_HOST_PIPE_TYPE_CONTROL, + USB_HOST_PIPE_TYPE_ISO, + USB_HOST_PIPE_TYPE_BULK, + USB_HOST_PIPE_TYPE_INTERRUPT, + USB_HOST_PIPE_TYPE_EXTENDED, +}; + +/** + * \brief Host pipe token types. + */ +enum usb_host_pipe_token { + USB_HOST_PIPE_TOKEN_SETUP, + USB_HOST_PIPE_TOKEN_IN, + USB_HOST_PIPE_TOKEN_OUT, +}; + +/** + * \brief Enumeration for the possible callback types for the USB in device module + */ +enum usb_device_callback { + USB_DEVICE_CALLBACK_SOF, + USB_DEVICE_CALLBACK_RESET, + USB_DEVICE_CALLBACK_WAKEUP, + USB_DEVICE_CALLBACK_RAMACER, + USB_DEVICE_CALLBACK_SUSPEND, + USB_DEVICE_CALLBACK_LPMNYET, + USB_DEVICE_CALLBACK_LPMSUSP, + USB_DEVICE_CALLBACK_N, +}; + +/** + * \brief Enumeration for the possible callback types for the USB endpoint in device module + */ +enum usb_device_endpoint_callback { + USB_DEVICE_ENDPOINT_CALLBACK_TRCPT, + USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL, + USB_DEVICE_ENDPOINT_CALLBACK_RXSTP, + USB_DEVICE_ENDPOINT_CALLBACK_STALL, + USB_DEVICE_EP_CALLBACK_N, +}; + +/** + * \brief Device Endpoint types. + */ +enum usb_device_endpoint_type { + USB_DEVICE_ENDPOINT_TYPE_DISABLE, + USB_DEVICE_ENDPOINT_TYPE_CONTROL, + USB_DEVICE_ENDPOINT_TYPE_ISOCHRONOUS, + USB_DEVICE_ENDPOINT_TYPE_BULK, + USB_DEVICE_ENDPOINT_TYPE_INTERRUPT, +}; + +/** + * \brief Endpoint Size + */ +enum usb_endpoint_size { + USB_ENDPOINT_8_BYTE, + USB_ENDPOINT_16_BYTE, + USB_ENDPOINT_32_BYTE, + USB_ENDPOINT_64_BYTE, + USB_ENDPOINT_128_BYTE, + USB_ENDPOINT_256_BYTE, + USB_ENDPOINT_512_BYTE, + USB_ENDPOINT_1023_BYTE, +}; + +/** + * \brief Link Power Management Handshake. + */ +enum usb_device_lpm_mode { + USB_DEVICE_LPM_NOT_SUPPORT, + USB_DEVICE_LPM_ACK, + USB_DEVICE_LPM_NYET, +}; + +/** + * \brief Module structure + */ +struct usb_module; + +/** + * \name Host Callback Functions Types + * @{ + */ +typedef void (*usb_host_callback_t)(struct usb_module *module_inst); +typedef void (*usb_host_pipe_callback_t)(struct usb_module *module_inst, void *); +/** @} */ + +/** + * \name Device Callback Functions Types + * @{ + */ +typedef void (*usb_device_callback_t)(struct usb_module *module_inst, void* pointer); +typedef void (*usb_device_endpoint_callback_t)(struct usb_module *module_inst, void* pointer); +/** @} */ + +/** USB configurations */ +struct usb_config { + /** \c true for host, \c false for device. */ + bool select_host_mode; + /** When \c true the module is enabled during standby. */ + bool run_in_standby; + /** Generic Clock Generator source channel. */ + // enum gclk_generator source_generator; + uint8_t source_generator; + /** Speed mode */ + //enum usb_speed speed_mode; + uint8_t speed_mode; +}; + +/** + * \brief USB software module instance structure. + * + * USB software module instance structure, used to retain software state + * information of an associated hardware module instance. + * + */ +struct usb_module { + /** Hardware module pointer of the associated USB peripheral. */ + Usb *hw; + + /** Array to store device related callback functions */ + usb_device_callback_t device_callback[USB_DEVICE_CALLBACK_N]; + usb_device_endpoint_callback_t device_endpoint_callback[USB_EPT_NUM][USB_DEVICE_EP_CALLBACK_N]; + /** Bit mask for device callbacks registered */ + uint16_t device_registered_callback_mask; + /** Bit mask for device callbacks enabled */ + uint16_t device_enabled_callback_mask; + /** Bit mask for device endpoint callbacks registered */ + uint8_t device_endpoint_registered_callback_mask[USB_EPT_NUM]; + /** Bit mask for device endpoint callbacks enabled */ + uint8_t device_endpoint_enabled_callback_mask[USB_EPT_NUM]; +}; + +/** USB device endpoint configurations */ +struct usb_device_endpoint_config { + /** device address */ + uint8_t ep_address; + /** endpoint size */ + enum usb_endpoint_size ep_size; + /** automatic zero length packet mode, \c true to enable */ + bool auto_zlp; + /** type of endpoint with Bank */ + enum usb_device_endpoint_type ep_type; +}; + +/** USB device endpoint callback status parameter structure */ +struct usb_endpoint_callback_parameter { + uint16_t received_bytes; + uint16_t sent_bytes; + uint16_t out_buffer_size; + uint8_t endpoint_address; +}; + +void usb_enable(struct usb_module *module_inst); +void usb_disable(struct usb_module *module_inst); + +/** + * \brief Get the status of USB module's state machine + * + * \param module_inst Pointer to USB module instance + */ +static inline uint8_t usb_get_state_machine_status(struct usb_module *module_inst) +{ + /* Sanity check arguments */ + Assert(module_inst); + Assert(module_inst->hw); + + return module_inst->hw->DEVICE.FSMSTATUS.reg; +} + +void usb_get_config_defaults(struct usb_config *module_config); +enum status_code usb_init(struct usb_module *module_inst, Usb *const hw, + struct usb_config *module_config); + +/** + * \brief Attach USB device to the bus + * + * \param module_inst Pointer to USB device module instance + */ +static inline void usb_device_attach(struct usb_module *module_inst) +{ + module_inst->hw->DEVICE.CTRLB.reg &= ~USB_DEVICE_CTRLB_DETACH; +} + +/** + * \brief Detach USB device from the bus + * + * \param module_inst Pointer to USB device module instance + */ +static inline void usb_device_detach(struct usb_module *module_inst) +{ + module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_DETACH; +} + +/** + * \brief Get the speed mode of USB device + * + * \param module_inst Pointer to USB device module instance + * \return USB Speed mode (\ref usb_speed). + */ +static inline enum usb_speed usb_device_get_speed(struct usb_module *module_inst) +{ + if (!(module_inst->hw->DEVICE.STATUS.reg & USB_DEVICE_STATUS_SPEED_Msk)) { + return USB_SPEED_FULL; + } else { + return USB_SPEED_LOW; + } +} + +/** + * \brief Get the address of USB device + * + * \param module_inst Pointer to USB device module instance + * \return USB device address value. + */ +static inline uint8_t usb_device_get_address(struct usb_module *module_inst) +{ + return ((uint8_t)(module_inst->hw->DEVICE.DADD.bit.DADD)); +} + +/** + * \brief Set the speed mode of USB device + * + * \param module_inst Pointer to USB device module instance + * \param address USB device address value + */ +static inline void usb_device_set_address(struct usb_module *module_inst, uint8_t address) +{ + module_inst->hw->DEVICE.DADD.reg = USB_DEVICE_DADD_ADDEN | address; +} + +/** + * \brief Get the frame number of USB device + * + * \param module_inst Pointer to USB device module instance + * \return USB device frame number value. + */ +static inline uint16_t usb_device_get_frame_number(struct usb_module *module_inst) +{ + return ((uint16_t)(module_inst->hw->DEVICE.FNUM.bit.FNUM)); +} + +/** + * \brief Get the micro-frame number of USB device + * + * \param module_inst Pointer to USB device module instance + * \return USB device micro-frame number value. + */ +static inline uint16_t usb_device_get_micro_frame_number(struct usb_module *module_inst) +{ + return ((uint16_t)(module_inst->hw->DEVICE.FNUM.reg)); +} + +/** + * \brief USB device send the resume wakeup + * + * \param module_inst Pointer to USB device module instance + */ +static inline void usb_device_send_remote_wake_up(struct usb_module *module_inst) +{ + module_inst->hw->DEVICE.CTRLB.reg |= USB_DEVICE_CTRLB_UPRSM; +} + +/** + * \brief USB device set the LPM mode + * + * \param module_inst Pointer to USB device module instance + * \param lpm_mode LPM mode + */ +static inline void usb_device_set_lpm_mode(struct usb_module *module_inst, + enum usb_device_lpm_mode lpm_mode) +{ + module_inst->hw->DEVICE.CTRLB.bit.LPMHDSK = lpm_mode; +} + +/** + * \name USB Device Callback Management + * @{ + */ +enum status_code usb_device_register_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type, + usb_device_callback_t callback_func); +enum status_code usb_device_unregister_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type); +enum status_code usb_device_enable_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type); +enum status_code usb_device_disable_callback(struct usb_module *module_inst, + enum usb_device_callback callback_type); +/** @} */ + +/** + * \name USB Device Endpoint Configuration + * @{ + */ +void usb_device_endpoint_get_config_defaults(struct usb_device_endpoint_config *ep_config); +enum status_code usb_device_endpoint_set_config(struct usb_module *module_inst, + struct usb_device_endpoint_config *ep_config); +bool usb_device_endpoint_is_configured(struct usb_module *module_inst, uint8_t ep); +/** @} */ + +/** + * \name USB Device Endpoint Callback Management + * @{ + */ +enum status_code usb_device_endpoint_register_callback( + struct usb_module *module_inst, uint8_t ep_num, + enum usb_device_endpoint_callback callback_type, + usb_device_endpoint_callback_t callback_func); +enum status_code usb_device_endpoint_unregister_callback( + struct usb_module *module_inst, uint8_t ep_num, + enum usb_device_endpoint_callback callback_type); +enum status_code usb_device_endpoint_enable_callback( + struct usb_module *module_inst, uint8_t ep, + enum usb_device_endpoint_callback callback_type); +enum status_code usb_device_endpoint_disable_callback( + struct usb_module *module_inst, uint8_t ep, + enum usb_device_endpoint_callback callback_type); +/** @} */ + +/** + * \name USB Device Endpoint Job Management + * @{ + */ +enum status_code usb_device_endpoint_write_buffer_job(struct usb_module *module_inst,uint8_t ep_num, + uint8_t* pbuf, uint32_t buf_size); +enum status_code usb_device_endpoint_read_buffer_job(struct usb_module *module_inst,uint8_t ep_num, + uint8_t* pbuf, uint32_t buf_size); +enum status_code usb_device_endpoint_setup_buffer_job(struct usb_module *module_inst, + uint8_t* pbuf); +void usb_device_endpoint_abort_job(struct usb_module *module_inst, uint8_t ep); +/** @} */ + +/** + * \name USB Device Endpoint Operations + * @{ + */ + +bool usb_device_endpoint_is_halted(struct usb_module *module_inst, uint8_t ep); +void usb_device_endpoint_set_halt(struct usb_module *module_inst, uint8_t ep); +void usb_device_endpoint_clear_halt(struct usb_module *module_inst, uint8_t ep); + +/** @} */ + +#ifdef __cplusplus +} +#endif + +#endif /* USB_H_INCLUDED */ diff --git a/tmk_core/protocol/arm_atsam/usb/usb2422.c b/tmk_core/protocol/arm_atsam/usb/usb2422.c new file mode 100644 index 0000000000..7c78e41d49 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb2422.c @@ -0,0 +1,412 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "arm_atsam_protocol.h" +#include + +Usb2422 USB2422_shadow; +unsigned char i2c0_buf[34]; + +const uint16_t MFRNAME[] = { 'M','a','s','s','d','r','o','p',' ','I','n','c','.' }; //Massdrop Inc. +const uint16_t PRDNAME[] = { 'M','a','s','s','d','r','o','p',' ','H','u','b' }; //Massdrop Hub +#ifndef MD_BOOTLOADER +//Serial number reported stops before first found space character or at last found character +const uint16_t SERNAME[] = { 'U','n','a','v','a','i','l','a','b','l','e' }; //Unavailable +#else +//In production, this field is found, modified, and offset noted as the last 32-bit word in the bootloader space +//The offset allows the application to use the factory programmed serial (which may differ from the physical serial label) +//Serial number reported stops before first found space character or when max size is reached +__attribute__((__aligned__(4))) +const uint16_t SERNAME[BOOTLOADER_SERIAL_MAX_SIZE] = { 'M','D','H','U','B','B','O','O','T','L','0','0','0','0','0','0','0','0','0','0' }; +//NOTE: Serial replacer will not write a string longer than given here as a precaution, so give enough +// space as needed and adjust BOOTLOADER_SERIAL_MAX_SIZE to match amount given +#endif //MD_BOOTLOADER + +uint8_t usb_host_port; + +#ifndef MD_BOOTLOADER + +uint8_t usb_extra_state; +uint8_t usb_extra_manual; +uint8_t usb_gcr_auto; + +#endif //MD_BOOTLOADER + +uint16_t adc_extra; + +void USB_write2422_block(void) +{ + unsigned char *dest = i2c0_buf; + unsigned char *src; + unsigned char *base = (unsigned char *)&USB2422_shadow; + + DBGC(DC_USB_WRITE2422_BLOCK_BEGIN); + + for (src = base; src < base + 256; src += 32) + { + dest[0] = src - base; + dest[1] = 32; + memcpy(&dest[2], src, 32); + i2c0_transmit(USB2422_ADDR, dest, 34, 50000); + SERCOM0->I2CM.CTRLB.bit.CMD = 0x03; + while (SERCOM0->I2CM.SYNCBUSY.bit.SYSOP) { DBGC(DC_USB_WRITE2422_BLOCK_SYNC_SYSOP); } + CLK_delay_us(100); + } + + DBGC(DC_USB_WRITE2422_BLOCK_COMPLETE); +} + +void USB2422_init(void) +{ + Gclk *pgclk = GCLK; + Mclk *pmclk = MCLK; + Port *pport = PORT; + Oscctrl *posc = OSCCTRL; + Usb *pusb = USB; + Srdata_t *pspi = &srdata; + + DBGC(DC_USB2422_INIT_BEGIN); + + while ((v_5v = adc_get(ADC_5V)) < ADC_5V_START_LEVEL) { DBGC(DC_USB2422_INIT_WAIT_5V_LOW); } + + //setup peripheral and synchronous bus clocks to USB + pgclk->PCHCTRL[10].bit.GEN = 0; + pgclk->PCHCTRL[10].bit.CHEN = 1; + pmclk->AHBMASK.bit.USB_ = 1; + pmclk->APBBMASK.bit.USB_ = 1; + + //setup port pins for D-, D+, and SOF_1KHZ + pport->Group[0].PMUX[12].reg = 0x77; //PA24, PA25, function column H for USB D-, D+ + pport->Group[0].PINCFG[24].bit.PMUXEN = 1; + pport->Group[0].PINCFG[25].bit.PMUXEN = 1; + pport->Group[1].PMUX[11].bit.PMUXE = 7; //PB22, function column H for USB SOF_1KHz output + pport->Group[1].PINCFG[22].bit.PMUXEN = 1; + + //configure and enable DFLL for USB clock recovery mode at 48MHz + posc->DFLLCTRLA.bit.ENABLE = 0; + while (posc->DFLLSYNC.bit.ENABLE) { DBGC(DC_USB2422_INIT_OSC_SYNC_DISABLING); } + while (posc->DFLLSYNC.bit.DFLLCTRLB) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_1); } + posc->DFLLCTRLB.bit.USBCRM = 1; + while (posc->DFLLSYNC.bit.DFLLCTRLB) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_2); } + posc->DFLLCTRLB.bit.MODE = 1; + while (posc->DFLLSYNC.bit.DFLLCTRLB) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_3); } + posc->DFLLCTRLB.bit.QLDIS = 0; + while (posc->DFLLSYNC.bit.DFLLCTRLB) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLCTRLB_4); } + posc->DFLLCTRLB.bit.CCDIS = 1; + posc->DFLLMUL.bit.MUL = 0xBB80; //4800 x 1KHz + while (posc->DFLLSYNC.bit.DFLLMUL) { DBGC(DC_USB2422_INIT_OSC_SYNC_DFLLMUL); } + posc->DFLLCTRLA.bit.ENABLE = 1; + while (posc->DFLLSYNC.bit.ENABLE) { DBGC(DC_USB2422_INIT_OSC_SYNC_ENABLING); } + + pusb->DEVICE.CTRLA.bit.SWRST = 1; + while (pusb->DEVICE.SYNCBUSY.bit.SWRST) { DBGC(DC_USB2422_INIT_USB_SYNC_SWRST); } + while (pusb->DEVICE.CTRLA.bit.SWRST) { DBGC(DC_USB2422_INIT_USB_WAIT_SWRST); } + //calibration from factory presets + pusb->DEVICE.PADCAL.bit.TRANSN = (USB_FUSES_TRANSN_ADDR >> USB_FUSES_TRANSN_Pos) & USB_FUSES_TRANSN_Msk; + pusb->DEVICE.PADCAL.bit.TRANSP = (USB_FUSES_TRANSP_ADDR >> USB_FUSES_TRANSP_Pos) & USB_FUSES_TRANSP_Msk; + pusb->DEVICE.PADCAL.bit.TRIM = (USB_FUSES_TRIM_ADDR >> USB_FUSES_TRIM_Pos) & USB_FUSES_TRIM_Msk; + //device mode, enabled + pusb->DEVICE.CTRLB.bit.SPDCONF = 0; //full speed + pusb->DEVICE.CTRLA.bit.MODE = 0; + pusb->DEVICE.CTRLA.bit.ENABLE = 1; + while (pusb->DEVICE.SYNCBUSY.bit.ENABLE) { DBGC(DC_USB2422_INIT_USB_SYNC_ENABLING); } + + pusb->DEVICE.QOSCTRL.bit.DQOS = 2; + pusb->DEVICE.QOSCTRL.bit.CQOS = 2; + + pport->Group[USB2422_HUB_ACTIVE_GROUP].PINCFG[USB2422_HUB_ACTIVE_PIN].bit.INEN = 1; + + i2c0_init(); //IC2 clk must be high at USB2422 reset release time to signal SMB configuration + + pspi->bit.HUB_CONNECT = 1; //connect signal + pspi->bit.HUB_RESET_N = 1; //reset high + SPI_WriteSRData(); + + CLK_delay_us(100); + +#ifndef MD_BOOTLOADER + + usb_extra_manual = 0; + usb_gcr_auto = 1; + +#endif //MD_BOOTLOADER + + DBGC(DC_USB2422_INIT_COMPLETE); +} + +void USB_reset(void) +{ + Srdata_t *pspi = &srdata; + + DBGC(DC_USB_RESET_BEGIN); + + //pulse reset for at least 1 usec + pspi->bit.HUB_RESET_N = 0; //reset low + SPI_WriteSRData(); + CLK_delay_us(1); + pspi->bit.HUB_RESET_N = 1; //reset high to run + SPI_WriteSRData(); + CLK_delay_us(1); + + DBGC(DC_USB_RESET_COMPLETE); +} + +void USB_configure(void) +{ + Usb2422 *pusb2422 = &USB2422_shadow; + memset(pusb2422, 0, sizeof(Usb2422)); + + uint16_t *serial_use = (uint16_t *)SERNAME; //Default to use SERNAME from this file + uint8_t serial_length = sizeof(SERNAME) / sizeof(uint16_t); //Default to use SERNAME from this file +#ifndef MD_BOOTLOADER + uint32_t serial_ptrloc = (uint32_t)&_srom - 4; +#else //MD_BOOTLOADER + uint32_t serial_ptrloc = (uint32_t)&_erom - 4; +#endif //MD_BOOTLOADER + uint32_t serial_address = *(uint32_t *)serial_ptrloc; //Address of bootloader's serial number if available + + DBGC(DC_USB_CONFIGURE_BEGIN); + + if (serial_address != 0xFFFFFFFF && serial_address < serial_ptrloc) //Check for factory programmed serial address + { + if ((serial_address & 0xFF) % 4 == 0) //Check alignment + { + serial_use = (uint16_t *)(serial_address); + serial_length = 0; + while ((*(serial_use + serial_length) > 32 && *(serial_use + serial_length) < 127) && + serial_length < BOOTLOADER_SERIAL_MAX_SIZE) + { + serial_length++; + DBGC(DC_USB_CONFIGURE_GET_SERIAL); + } + } + } + + //configure Usb2422 registers + pusb2422->VID.reg = 0x04D8; // from Microchip 4/19/2018 + pusb2422->PID.reg = 0xEEC5; // from Microchip 4/19/2018 = Massdrop, Inc. USB Hub + pusb2422->DID.reg = 0x0101; // BCD 01.01 + pusb2422->CFG1.bit.SELF_BUS_PWR = 1; // self powered for now + pusb2422->CFG1.bit.HS_DISABLE = 1; // full or high speed + //pusb2422->CFG2.bit.COMPOUND = 0; // compound device + pusb2422->CFG3.bit.STRING_EN = 1; // strings enabled + //pusb2422->NRD.bit.PORT2_NR = 0; // MCU is non-removable + pusb2422->MAXPB.reg = 20; // 0mA + pusb2422->HCMCB.reg = 20; // 0mA + pusb2422->MFRSL.reg = sizeof(MFRNAME) / sizeof(uint16_t); + pusb2422->PRDSL.reg = sizeof(PRDNAME) / sizeof(uint16_t); + pusb2422->SERSL.reg = serial_length; + memcpy(pusb2422->MFRSTR, MFRNAME, sizeof(MFRNAME)); + memcpy(pusb2422->PRDSTR, PRDNAME, sizeof(PRDNAME)); + memcpy(pusb2422->SERSTR, serial_use, serial_length * sizeof(uint16_t)); + //pusb2422->BOOSTUP.bit.BOOST=3; //upstream port + //pusb2422->BOOSTDOWN.bit.BOOST1=0; // extra port + //pusb2422->BOOSTDOWN.bit.BOOST2=2; //MCU is close + pusb2422->STCD.bit.USB_ATTACH = 1; + USB_write2422_block(); + + adc_extra = 0; + + DBGC(DC_USB_CONFIGURE_COMPLETE); +} + +uint16_t USB_active(void) +{ + return (PORT->Group[USB2422_HUB_ACTIVE_GROUP].IN.reg & (1 << USB2422_HUB_ACTIVE_PIN)) != 0; +} + +void USB_set_host_by_voltage(void) +{ + //UP is upstream device (HOST) + //DN1 is downstream device (EXTRA) + //DN2 is keyboard (KEYB) + + DBGC(DC_USB_SET_HOST_BY_VOLTAGE_BEGIN); + + usb_host_port = USB_HOST_PORT_UNKNOWN; +#ifndef MD_BOOTLOADER + usb_extra_state = USB_EXTRA_STATE_UNKNOWN; +#endif //MD_BOOTLOADER + srdata.bit.SRC_1 = 1; //USBC-1 available for test + srdata.bit.SRC_2 = 1; //USBC-2 available for test + srdata.bit.E_UP_N = 1; //HOST disable + srdata.bit.E_DN1_N = 1; //EXTRA disable + srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + + SPI_WriteSRData(); + + CLK_delay_ms(250); + + while ((v_5v = adc_get(ADC_5V)) < ADC_5V_START_LEVEL) { DBGC(DC_USB_SET_HOST_5V_LOW_WAITING); } + + v_con_1 = adc_get(ADC_CON1); + v_con_2 = adc_get(ADC_CON2); + + v_con_1_boot = v_con_1; + v_con_2_boot = v_con_2; + + if (v_con_1 > v_con_2) + { + srdata.bit.S_UP = 0; //HOST to USBC-1 + srdata.bit.S_DN1 = 1; //EXTRA to USBC-2 + srdata.bit.SRC_1 = 1; //HOST on USBC-1 + srdata.bit.SRC_2 = 0; //EXTRA available on USBC-2 + + srdata.bit.E_VBUS_1 = 1; //USBC-1 enable full power I/O + srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + + SPI_WriteSRData(); + + srdata.bit.E_UP_N = 0; //HOST enable + + SPI_WriteSRData(); + + usb_host_port = USB_HOST_PORT_1; + } + else + { + srdata.bit.S_UP = 1; //EXTRA to USBC-1 + srdata.bit.S_DN1 = 0; //HOST to USBC-2 + srdata.bit.SRC_1 = 0; //EXTRA available on USBC-1 + srdata.bit.SRC_2 = 1; //HOST on USBC-2 + + srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + srdata.bit.E_VBUS_2 = 1; //USBC-2 enable full power I/O + + SPI_WriteSRData(); + + srdata.bit.E_UP_N = 0; //HOST enable + + SPI_WriteSRData(); + + usb_host_port = USB_HOST_PORT_2; + } + +#ifndef MD_BOOTLOADER + usb_extra_state = USB_EXTRA_STATE_DISABLED; +#endif //MD_BOOTLOADER + + USB_reset(); + USB_configure(); + + DBGC(DC_USB_SET_HOST_BY_VOLTAGE_COMPLETE); +} + +uint8_t USB2422_Port_Detect_Init(void) +{ + uint32_t port_detect_retry_ms; + uint32_t tmod; + + DBGC(DC_PORT_DETECT_INIT_BEGIN); + + USB_set_host_by_voltage(); + + port_detect_retry_ms = CLK_get_ms() + PORT_DETECT_RETRY_INTERVAL; + + while (!USB_active()) + { + tmod = CLK_get_ms() % PORT_DETECT_RETRY_INTERVAL; + + if (v_con_1 > v_con_2) //Values updated from USB_set_host_by_voltage(); + { + //1 flash for port 1 detected + if (tmod > 500 && tmod < 600) { led_on; } + else { led_off; } + } + else if (v_con_2 > v_con_1) //Values updated from USB_set_host_by_voltage(); + { + //2 flash for port 2 detected + if (tmod > 500 && tmod < 600) { led_on; } + else if (tmod > 700 && tmod < 800) { led_on; } + else { led_off; } + } + + if (CLK_get_ms() > port_detect_retry_ms) + { + DBGC(DC_PORT_DETECT_INIT_FAILED); + return 0; + } + } + + DBGC(DC_PORT_DETECT_INIT_COMPLETE); + + return 1; +} + +#ifndef MD_BOOTLOADER + +void USB_ExtraSetState(uint8_t state) +{ + uint8_t state_save = state; + + if (state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) + state = USB_EXTRA_STATE_DISABLED; + + if (usb_host_port == USB_HOST_PORT_1) srdata.bit.E_VBUS_2 = state; + else if (usb_host_port == USB_HOST_PORT_2) srdata.bit.E_VBUS_1 = state; + else return; + + srdata.bit.E_DN1_N = !state; + SPI_WriteSRData(); + + usb_extra_state = state_save; + + if (usb_extra_state == USB_EXTRA_STATE_ENABLED) CDC_print("USB: Extra enabled\r\n"); + else if (usb_extra_state == USB_EXTRA_STATE_DISABLED) + { + CDC_print("USB: Extra disabled\r\n"); + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + else if (usb_extra_state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) CDC_print("USB: Extra disabled until replug\r\n"); + else CDC_print("USB: Extra state unknown\r\n"); +} + +void USB_HandleExtraDevice(void) +{ + uint16_t adcval; + + if (usb_host_port == USB_HOST_PORT_1) adcval = adc_get(ADC_CON2); + else if (usb_host_port == USB_HOST_PORT_2) adcval = adc_get(ADC_CON1); + else return; + + adc_extra = adc_extra * 0.9 + adcval * 0.1; + + //Check for a forced disable state (such as overload prevention) + if (usb_extra_state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) + { + //Detect unplug and reset state to disabled + if (adc_extra > USB_EXTRA_ADC_THRESHOLD) usb_extra_state = USB_EXTRA_STATE_DISABLED; + + return; //Return even if unplug detected + } + + if (usb_extra_manual) + { + if (usb_extra_state == USB_EXTRA_STATE_DISABLED) + USB_ExtraSetState(USB_EXTRA_STATE_ENABLED); + + return; + } + + //dpf("a %i %i\r\n",adcval, adc_extra); + if (usb_extra_state == USB_EXTRA_STATE_DISABLED && adc_extra < USB_EXTRA_ADC_THRESHOLD) USB_ExtraSetState(USB_EXTRA_STATE_ENABLED); + else if (usb_extra_state == USB_EXTRA_STATE_ENABLED && adc_extra > USB_EXTRA_ADC_THRESHOLD) USB_ExtraSetState(USB_EXTRA_STATE_DISABLED); +} + +#endif //MD_BOOTLOADER + diff --git a/tmk_core/protocol/arm_atsam/usb/usb2422.h b/tmk_core/protocol/arm_atsam/usb/usb2422.h new file mode 100644 index 0000000000..6c763dd8c5 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb2422.h @@ -0,0 +1,405 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _USB2422_H_ +#define _USB2422_H_ + +#define USB2422_ALT67_1P0 +#define REV_USB2422 0x100 + +#define USB2422_ADDR 0x58 //I2C device address, one instance + +#define USB2422_HUB_ACTIVE_GROUP 0 //PA +#define USB2422_HUB_ACTIVE_PIN 18 //18 + +/* -------- USB2422_VID : (USB2422L Offset: 0x00) (R/W 16) Vendor ID -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t VID_LSB : 8; + uint16_t VID_MSB : 8; + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} USB2422_VID_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PID : (USB2422L Offset: 0x02) (R/W 16) Product ID -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t PID_LSB : 8; + uint16_t PID_MSB : 8; + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} USB2422_PID_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_DID : (USB2422L Offset: 0x04) (R/W 16) Device ID -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint16_t DID_LSB : 8; + uint16_t DID_MSB : 8; + } bit; /*!< Structure used for bit access */ + uint16_t reg; /*!< Type used for register access */ +} USB2422_DID_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_CFG1 : (USB2422L Offset: 0x06) (R/W 8) Configuration Data Byte 1-------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t PORT_PWR : 1; + uint8_t CURRENT_SNS : 2; + uint8_t EOP_DISABLE : 1; + uint8_t MTT_ENABLE : 1; + uint8_t HS_DISABLE :1; + uint8_t :1; + uint8_t SELF_BUS_PWR : 1; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_CFG1_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_CFG2 : (USB2422L Offset: 0x07) (R/W 8) Configuration Data Byte 2-------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 3; + uint8_t COMPOUND : 1; + uint8_t OC_TIMER :2; + uint8_t :1; + uint8_t DYNAMIC : 1; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_CFG2_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_CFG3 : (USB2422L Offset: 0x08) (R/W 16) Configuration Data Byte 3-------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t STRING_EN : 1; + uint8_t :2; + uint8_t PRTMAP_EN :1; + uint8_t : 4; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_CFG3_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_NRD : (USB2422L Offset: 0x09) (R/W 8) Non Removable Device -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 5; + uint8_t PORT2_NR :1; + uint8_t PORT1_NR :1; + uint8_t : 1; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_NRD_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PDS : (USB2422L Offset: 0x0A) (R/W 8) Port Diable for Self-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 1; + uint8_t PORT1_DIS :1; + uint8_t PORT2_DIS :1; + uint8_t : 5; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PDS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PDB : (USB2422L Offset: 0x0B) (R/W 8) Port Diable for Bus-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 1; + uint8_t PORT1_DIS :1; + uint8_t PORT2_DIS :1; + uint8_t : 5; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PDB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_MAXPS : (USB2422L Offset: 0x0C) (R/W 8) Max Power for Self-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t MAX_PWR_SP : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_MAXPS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_MAXPB : (USB2422L Offset: 0x0D) (R/W 8) Max Power for Bus-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t MAX_PWR_BP : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_MAXPB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_HCMCS : (USB2422L Offset: 0x0E) (R/W 8) Hub Controller Max Current for Self-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t HC_MAX_C_SP : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_HCMCS_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_HCMCB : (USB2422L Offset: 0x0F) (R/W 8) Hub Controller Max Current for Bus-Powered Operation -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t HC_MAX_C_BP : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_HCMCB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PWRT : (USB2422L Offset: 0x10) (R/W 8) Power On Time -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t POWER_ON_TIME : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PWRT_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_LANGID LSB : (USB2422L Offset: 0x11) (R/W 16) Language ID -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t LANGID_LSB : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_LANGID_LSB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_LANGID MSB : (USB2422L Offset: 0x12) (R/W 16) Language ID -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t LANGID_MSB : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_LANGID_MSB_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + + +/* -------- USB2422_MFRSL : (USB2422L Offset: 0x13) (R/W 8) Manufacturer String Length -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t MFR_STR_LEN : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_MFRSL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PRDSL : (USB2422L Offset: 0x14) (R/W 8) Product String Length -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t PRD_STR_LEN : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PRDSL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_SERSL : (USB2422L Offset: 0x15) (R/W 8) Serial String Length -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t SER_STR_LEN : 8; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_SERSL_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_MFRSTR : (USB2422L Offset: 0x16-53) (R/W 8) Maufacturer String -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef uint16_t USB2422_MFRSTR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PRDSTR : (USB2422L Offset: 0x54-91) (R/W 8) Product String -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef uint16_t USB2422_PRDSTR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_SERSTR : (USB2422L Offset: 0x92-CF) (R/W 8) Serial String -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef uint16_t USB2422_SERSTR_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_BCEN : (USB2422L Offset: 0xD0) (R/W 8) Battery Charging Enable -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 1; + uint8_t PORT1_BCE :1; + uint8_t PORT2_BCE :1; + uint8_t : 5; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_BCEN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_BOOSTUP : (USB2422L Offset: 0xF6) (R/W 8) Boost Upstream -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t BOOST :2; + uint8_t : 6; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_BOOSTUP_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_BOOSTDOWN : (USB2422L Offset: 0xF8) (R/W 8) Boost Downstream -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t BOOST1 :2; + uint8_t BOOST2 :2; + uint8_t : 4; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_BOOSTDOWN_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PRTSP : (USB2422L Offset: 0xFA) (R/W 8) Port Swap -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t : 1; + uint8_t PORT1_SP :1; + uint8_t PORT2_SP :1; + uint8_t : 5; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PRTSP_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/* -------- USB2422_PRTR12 : (USB2422L Offset: 0xFB) (R/W 8) Port 1/2 Remap -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t PORT1_REMAP: 4; + uint8_t PORT2_REMAP: 4; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_PRTR12_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ +#define USB2422_PRTR12_DISABLE 0 +#define USB2422_PRT12_P2TOL1 1 +#define USB2422_PRT12_P2XTOL2 2 +#define USB2422_PRT12_P1TOL1 1 +#define USB2422_PRT12_P1XTOL2 2 + +/* -------- USB2422_STCD : (USB2422L Offset: 0xFF) (R/W 8) Status Command -------- */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef union { + struct { + uint8_t USB_ATTACH: 1; + uint8_t RESET: 1; + uint8_t INTF_PWRDN: 1; + uint8_t : 5; + } bit; /*!< Structure used for bit access */ + uint8_t reg; /*!< Type used for register access */ +} USB2422_STCD_Type; +#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */ + +/** \brief USB2422 device hardware registers */ +#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) +typedef struct { + USB2422_VID_Type VID; /**< \brief Offset: 0x00*/ + USB2422_PID_Type PID; /**< \brief Offset: 0x02*/ + USB2422_DID_Type DID; /**< \brief Offset: 0x04*/ + USB2422_CFG1_Type CFG1; /**< \brief Offset: 0x06*/ + USB2422_CFG2_Type CFG2; /**< \brief Offset: 0x07*/ + USB2422_CFG3_Type CFG3; /**< \brief Offset: 0x08*/ + USB2422_NRD_Type NRD; /**< \brief Offset: 0x09*/ + USB2422_PDS_Type PDS; /**< \brief Offset: 0x0A*/ + USB2422_PDB_Type PDB; /**< \brief Offset: 0x0B*/ + USB2422_MAXPS_Type MAXPS; /**< \brief Offset: 0x0C*/ + USB2422_MAXPB_Type MAXPB; /**< \brief Offset: 0x0D*/ + USB2422_HCMCS_Type HCMCS; /**< \brief Offset: 0x0E*/ + USB2422_HCMCB_Type HCMCB; /**< \brief Offset: 0x0F*/ + USB2422_PWRT_Type PWRT; /**< \brief Offset: 0x10*/ + USB2422_LANGID_LSB_Type LANGID_LSB; /**< \brief Offset: 0x11*/ + USB2422_LANGID_MSB_Type LANGID_MSB; /**< \brief Offset: 0x12*/ + USB2422_MFRSL_Type MFRSL; /**< \brief Offset: 0x13*/ + USB2422_PRDSL_Type PRDSL; /**< \brief Offset: 0x14*/ + USB2422_SERSL_Type SERSL; /**< \brief Offset: 0x15*/ + USB2422_MFRSTR_Type MFRSTR[31]; /**< \brief Offset: 0x16*/ + USB2422_PRDSTR_Type PRDSTR[31]; /**< \brief Offset: 0x54*/ + USB2422_SERSTR_Type SERSTR[31]; /**< \brief Offset: 0x92*/ + USB2422_BCEN_Type BCEN; /**< \brief Offset: 0xD0*/ + uint8_t Reserved1[0x25]; + USB2422_BOOSTUP_Type BOOSTUP; /**< \brief Offset: 0xF6*/ + uint8_t Reserved2[0x1]; + USB2422_BOOSTDOWN_Type BOOSTDOWN; /**< \brief Offset: 0xF8*/ + uint8_t Reserved3[0x1]; + USB2422_PRTSP_Type PRTSP; /**< \brief Offset: 0xFA*/ + USB2422_PRTR12_Type PRTR12; /**< \brief Offset: 0xFB*/ + uint8_t Reserved4[0x3]; + USB2422_STCD_Type STCD; /**< \brief Offset: 0xFF*/ +} Usb2422; +#endif + +#define PORT_DETECT_RETRY_INTERVAL 2000 + +#define USB_EXTRA_ADC_THRESHOLD 900 + +#define USB_EXTRA_STATE_DISABLED 0 +#define USB_EXTRA_STATE_ENABLED 1 +#define USB_EXTRA_STATE_UNKNOWN 2 +#define USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG 3 + +#define USB_HOST_PORT_1 0 +#define USB_HOST_PORT_2 1 +#define USB_HOST_PORT_UNKNOWN 2 + +extern uint8_t usb_host_port; +extern uint8_t usb_extra_state; +extern uint8_t usb_extra_manual; +extern uint8_t usb_gcr_auto; + +void USB2422_init(void); +void USB_reset(void); +void USB_configure(void); +uint16_t USB_active(void); +void USB_set_host_by_voltage(void); +uint16_t adc_get(uint8_t muxpos); +uint8_t USB2422_Port_Detect_Init(void); +void USB_HandleExtraDevice(void); +void USB_ExtraSetState(uint8_t state); + +#endif //_USB2422_H_ + diff --git a/tmk_core/protocol/arm_atsam/usb/usb_atmel.h b/tmk_core/protocol/arm_atsam/usb/usb_atmel.h new file mode 100644 index 0000000000..7febdc9ece --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_atmel.h @@ -0,0 +1,190 @@ +/** + * \file + * + * \brief All USB VIDs and PIDs from Atmel USB applications + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _USB_ATMEL_H_ +#define _USB_ATMEL_H_ + +/** + * \defgroup usb_group USB Stack + * + * This stack includes the USB Device Stack, USB Host Stack and common + * definitions. + * @{ + */ + +//! @} + +/** + * \ingroup usb_group + * \defgroup usb_atmel_ids_group Atmel USB Identifiers + * + * This module defines Atmel PID and VIDs constants. + * + * @{ + */ + +//! \name Vendor Identifier assigned by USB org to ATMEL +#define USB_VID_ATMEL 0x03EB + +//! \name Product Identifier assigned by ATMEL to AVR applications +//! @{ + +//! \name The range from 2000h to 20FFh is reserved to the old PID for C51, MEGA, and others. +//! @{ +#define USB_PID_ATMEL_MEGA_HIDGENERIC 0x2013 +#define USB_PID_ATMEL_MEGA_HIDKEYBOARD 0x2017 +#define USB_PID_ATMEL_MEGA_CDC 0x2018 +#define USB_PID_ATMEL_MEGA_AUDIO_IN 0x2019 +#define USB_PID_ATMEL_MEGA_MS 0x201A +#define USB_PID_ATMEL_MEGA_AUDIO_IN_OUT 0x201B +#define USB_PID_ATMEL_MEGA_HIDMOUSE 0x201C +#define USB_PID_ATMEL_MEGA_HIDMOUSE_CERTIF_U4 0x201D +#define USB_PID_ATMEL_MEGA_CDC_MULTI 0x201E +#define USB_PID_ATMEL_MEGA_MS_HIDMS_HID_USBKEY 0x2022 +#define USB_PID_ATMEL_MEGA_MS_HIDMS_HID_STK525 0x2023 +#define USB_PID_ATMEL_MEGA_MS_2 0x2029 +#define USB_PID_ATMEL_MEGA_MS_HIDMS 0x202A +#define USB_PID_ATMEL_MEGA_MS_3 0x2032 +#define USB_PID_ATMEL_MEGA_LIBUSB 0x2050 +//! @} + +//! \name The range 2100h to 21FFh is reserved to PIDs for AVR Tools. +//! @{ +#define USB_PID_ATMEL_XPLAINED 0x2122 +#define USB_PID_ATMEL_XMEGA_USB_ZIGBIT_2_4GHZ 0x214A +#define USB_PID_ATMEL_XMEGA_USB_ZIGBIT_SUBGHZ 0x214B +//! @} + +//! \name The range 2300h to 23FFh is reserved to PIDs for demo from ASF1.7=> +//! @{ +#define USB_PID_ATMEL_UC3_ENUM 0x2300 +#define USB_PID_ATMEL_UC3_MS 0x2301 +#define USB_PID_ATMEL_UC3_MS_SDRAM_LOADER 0x2302 +#define USB_PID_ATMEL_UC3_EVK1100_CTRLPANEL 0x2303 +#define USB_PID_ATMEL_UC3_HID 0x2304 +#define USB_PID_ATMEL_UC3_EVK1101_CTRLPANEL_HID 0x2305 +#define USB_PID_ATMEL_UC3_EVK1101_CTRLPANEL_HID_MS 0x2306 +#define USB_PID_ATMEL_UC3_CDC 0x2307 +#define USB_PID_ATMEL_UC3_AUDIO_MICRO 0x2308 +#define USB_PID_ATMEL_UC3_CDC_DEBUG 0x2310 // Virtual Com (debug interface) on EVK11xx +#define USB_PID_ATMEL_UC3_AUDIO_SPEAKER_MICRO 0x2311 +#define USB_PID_ATMEL_UC3_CDC_MSC 0x2312 +//! @} + +//! \name The range 2400h to 24FFh is reserved to PIDs for ASF applications +//! @{ +#define USB_PID_ATMEL_ASF_HIDMOUSE 0x2400 +#define USB_PID_ATMEL_ASF_HIDKEYBOARD 0x2401 +#define USB_PID_ATMEL_ASF_HIDGENERIC 0x2402 +#define USB_PID_ATMEL_ASF_MSC 0x2403 +#define USB_PID_ATMEL_ASF_CDC 0x2404 +#define USB_PID_ATMEL_ASF_PHDC 0x2405 +#define USB_PID_ATMEL_ASF_HIDMTOUCH 0x2406 +#define USB_PID_ATMEL_ASF_MSC_HIDMOUSE 0x2420 +#define USB_PID_ATMEL_ASF_MSC_HIDS_CDC 0x2421 +#define USB_PID_ATMEL_ASF_MSC_HIDKEYBOARD 0x2422 +#define USB_PID_ATMEL_ASF_VENDOR_CLASS 0x2423 +#define USB_PID_ATMEL_ASF_MSC_CDC 0x2424 +#define USB_PID_ATMEL_ASF_TWO_CDC 0x2425 +#define USB_PID_ATMEL_ASF_SEVEN_CDC 0x2426 +#define USB_PID_ATMEL_ASF_XPLAIN_BC_POWERONLY 0x2430 +#define USB_PID_ATMEL_ASF_XPLAIN_BC_TERMINAL 0x2431 +#define USB_PID_ATMEL_ASF_XPLAIN_BC_TOUCH 0x2432 +#define USB_PID_ATMEL_ASF_AUDIO_SPEAKER 0x2433 +#define USB_PID_ATMEL_ASF_XMEGA_B1_XPLAINED 0x2434 +//! @} + +//! \name The range 2F00h to 2FFFh is reserved to official PIDs for AVR bootloaders +//! Note, !!!! don't use this range for demos or examples !!!! +//! @{ +#define USB_PID_ATMEL_DFU_ATXMEGA64C3 0x2FD6 +#define USB_PID_ATMEL_DFU_ATXMEGA128C3 0x2FD7 +#define USB_PID_ATMEL_DFU_ATXMEGA16C4 0x2FD8 +#define USB_PID_ATMEL_DFU_ATXMEGA32C4 0x2FD9 +#define USB_PID_ATMEL_DFU_ATXMEGA256C3 0x2FDA +#define USB_PID_ATMEL_DFU_ATXMEGA384C3 0x2FDB +#define USB_PID_ATMEL_DFU_ATUCL3_L4 0x2FDC +#define USB_PID_ATMEL_DFU_ATXMEGA64A4U 0x2FDD +#define USB_PID_ATMEL_DFU_ATXMEGA128A4U 0x2FDE + +#define USB_PID_ATMEL_DFU_ATXMEGA64B3 0x2FDF +#define USB_PID_ATMEL_DFU_ATXMEGA128B3 0x2FE0 +#define USB_PID_ATMEL_DFU_ATXMEGA64B1 0x2FE1 +#define USB_PID_ATMEL_DFU_ATXMEGA256A3BU 0x2FE2 +#define USB_PID_ATMEL_DFU_ATXMEGA16A4U 0x2FE3 +#define USB_PID_ATMEL_DFU_ATXMEGA32A4U 0x2FE4 +#define USB_PID_ATMEL_DFU_ATXMEGA64A3U 0x2FE5 +#define USB_PID_ATMEL_DFU_ATXMEGA128A3U 0x2FE6 +#define USB_PID_ATMEL_DFU_ATXMEGA192A3U 0x2FE7 +#define USB_PID_ATMEL_DFU_ATXMEGA64A1U 0x2FE8 +#define USB_PID_ATMEL_DFU_ATUC3D 0x2FE9 +#define USB_PID_ATMEL_DFU_ATXMEGA128B1 0x2FEA +#define USB_PID_ATMEL_DFU_AT32UC3C 0x2FEB +#define USB_PID_ATMEL_DFU_ATXMEGA256A3U 0x2FEC +#define USB_PID_ATMEL_DFU_ATXMEGA128A1U 0x2FED +#define USB_PID_ATMEL_DFU_ATMEGA8U2 0x2FEE +#define USB_PID_ATMEL_DFU_ATMEGA16U2 0x2FEF +#define USB_PID_ATMEL_DFU_ATMEGA32U2 0x2FF0 +#define USB_PID_ATMEL_DFU_AT32UC3A3 0x2FF1 +#define USB_PID_ATMEL_DFU_ATMEGA32U6 0x2FF2 +#define USB_PID_ATMEL_DFU_ATMEGA16U4 0x2FF3 +#define USB_PID_ATMEL_DFU_ATMEGA32U4 0x2FF4 +#define USB_PID_ATMEL_DFU_AT32AP7200 0x2FF5 +#define USB_PID_ATMEL_DFU_AT32UC3B 0x2FF6 +#define USB_PID_ATMEL_DFU_AT90USB82 0x2FF7 +#define USB_PID_ATMEL_DFU_AT32UC3A 0x2FF8 +#define USB_PID_ATMEL_DFU_AT90USB64 0x2FF9 +#define USB_PID_ATMEL_DFU_AT90USB162 0x2FFA +#define USB_PID_ATMEL_DFU_AT90USB128 0x2FFB +// 2FFCh to 2FFFh used by C51 family products +//! @} + +//! @} + +//! @} + + +#endif // _USB_ATMEL_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c new file mode 100644 index 0000000000..b31256df7c --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_device_udd.c @@ -0,0 +1,1097 @@ +/** + * \file + * + * \brief USB Device wrapper layer for compliance with common driver UDD + * + * Copyright (C) 2014-2016 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ +#include "samd51j18a.h" +#include +#include + +// Get USB device configuration +#include "conf_usb.h" +#include "udd.h" +#include "usb.h" +#include "status_codes.h" + +/** + * \ingroup usb_device_group + * \defgroup usb_device_udd_group USB Device Driver Implement (UDD) + * USB low-level driver for USB device mode + * @{ + */ +// Check USB device configuration +#ifdef USB_DEVICE_HS_SUPPORT +# error The High speed mode is not supported on this part, please remove USB_DEVICE_HS_SUPPORT in conf_usb.h +#endif + +//Note: This driver is adapted for SAMD51 + +#ifndef UDC_REMOTEWAKEUP_LPM_ENABLE +#define UDC_REMOTEWAKEUP_LPM_ENABLE() +#endif +#ifndef UDC_REMOTEWAKEUP_LPM_DISABLE +#define UDC_REMOTEWAKEUP_LPM_DISABLE() +#endif +#ifndef UDC_SUSPEND_LPM_EVENT +#define UDC_SUSPEND_LPM_EVENT() +#endif + +/* for debug text */ +#ifdef USB_DEBUG +# define dbg_print printf +#else +# define dbg_print(...) +#endif + +/** Maximum size of a transfer in multi-packet mode */ +#define UDD_ENDPOINT_MAX_TRANS ((8*1024)-1) + +/** USB software device instance structure */ +struct usb_module usb_device; + +/** + * \name Clock management + * + * @{ + */ + +#define UDD_CLOCK_GEN 0 + +static inline void udd_wait_clock_ready(void) +{ + +} + +/** + * \name Power management + * + * @{ + */ +#define udd_sleep_mode(arg) +/** @} */ + +/** + * \name Control endpoint low level management routine. + * + * This function performs control endpoint management. + * It handles the SETUP/DATA/HANDSHAKE phases of a control transaction. + * + * @{ + */ + +/** + * \brief Buffer to store the data received on control endpoint (SETUP/OUT endpoint 0) + * + * Used to avoid a RAM buffer overflow in case of the payload buffer + * is smaller than control endpoint size + */ +UDC_BSS(4) +uint8_t udd_ctrl_buffer[USB_DEVICE_EP_CTRL_SIZE]; + +/** Bit definitions about endpoint control state machine for udd_ep_control_state */ +typedef enum { + UDD_EPCTRL_SETUP = 0, //!< Wait a SETUP packet + UDD_EPCTRL_DATA_OUT = 1, //!< Wait a OUT data packet + UDD_EPCTRL_DATA_IN = 2, //!< Wait a IN data packet + UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP = 3, //!< Wait a IN ZLP packet + UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP = 4, //!< Wait a OUT ZLP packet + UDD_EPCTRL_STALL_REQ = 5, //!< STALL enabled on IN & OUT packet +} udd_ctrl_ep_state_t; + +/** Global variable to give and record information of the set up request management */ +udd_ctrl_request_t udd_g_ctrlreq; + +/** State of the endpoint control management */ +static udd_ctrl_ep_state_t udd_ep_control_state; + +/** Total number of data received/sent during data packet phase with previous payload buffers */ +static uint16_t udd_ctrl_prev_payload_nb_trans; + +/** Number of data received/sent to/from udd_g_ctrlreq.payload buffer */ +static uint16_t udd_ctrl_payload_nb_trans; + +/** @} */ + +/** + * \name Management of bulk/interrupt/isochronous endpoints + * + * The UDD manages the data transfer on endpoints: + * - Start data transfer on endpoint with USB Device DMA + * - Send a ZLP packet if requested + * - Call callback registered to signal end of transfer + * The transfer abort and stall feature are supported. + * + * @{ + */ + +/** + * \brief Buffer to store the data received on bulk/interrupt endpoints + * + * Used to avoid a RAM buffer overflow in case of the user buffer + * is smaller than endpoint size + * + * \warning The protected interrupt endpoint size is 512 bytes maximum. + * \warning The isochronous and endpoint is not protected by this system and + * the user must always use a buffer corresponding at endpoint size. + */ + +#if (defined USB_DEVICE_LOW_SPEED) +UDC_BSS(4) uint8_t udd_ep_out_cache_buffer[USB_DEVICE_MAX_EP][8]; +#elif (defined USB_DEVICE_HS_SUPPORT) +UDC_BSS(4) uint8_t udd_ep_out_cache_buffer[USB_DEVICE_MAX_EP][512]; +#else +UDC_BSS(4) uint8_t udd_ep_out_cache_buffer[USB_DEVICE_MAX_EP][64]; +#endif + +/** Structure definition about job registered on an endpoint */ +typedef struct { + union { + //! Callback to call at the end of transfer + udd_callback_trans_t call_trans; + //! Callback to call when the endpoint halt is cleared + udd_callback_halt_cleared_t call_nohalt; + }; + //! Buffer located in internal RAM to send or fill during job + uint8_t *buf; + //! Size of buffer to send or fill + iram_size_t buf_size; + //! Total number of data transferred on endpoint + iram_size_t nb_trans; + //! Endpoint size + uint16_t ep_size; + //! A job is registered on this endpoint + uint8_t busy:1; + //! A short packet is requested for this job on endpoint IN + uint8_t b_shortpacket:1; + //! The cache buffer is currently used on endpoint OUT + uint8_t b_use_out_cache_buffer:1; +} udd_ep_job_t; + +/** Array to register a job on bulk/interrupt/isochronous endpoint */ +static udd_ep_job_t udd_ep_job[2 * USB_DEVICE_MAX_EP]; + +/** @} */ + +/** + * \brief Get the detailed job by endpoint number + * \param[in] ep Endpoint Address + * \retval pointer to an udd_ep_job_t structure instance + */ +static udd_ep_job_t* udd_ep_get_job(udd_ep_id_t ep) +{ + if ((ep == 0) || (ep == 0x80)) { + return NULL; + } else { + return &udd_ep_job[(2 * (ep & USB_EP_ADDR_MASK) + ((ep & USB_EP_DIR_IN) ? 1 : 0)) - 2]; + } +} + +/** + * \brief Endpoint IN process, continue to send packets or zero length packet + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ep_trans_in_next(void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + udd_ep_id_t ep = ep_callback_para->endpoint_address; + uint16_t ep_size, nb_trans; + uint16_t next_trans; + udd_ep_id_t ep_num; + udd_ep_job_t *ptr_job; + + ptr_job = udd_ep_get_job(ep); + ep_num = ep & USB_EP_ADDR_MASK; + + ep_size = ptr_job->ep_size; + /* Update number of data transferred */ + nb_trans = ep_callback_para->sent_bytes; + ptr_job->nb_trans += nb_trans; + + /* Need to send other data */ + if (ptr_job->nb_trans != ptr_job->buf_size) { + next_trans = ptr_job->buf_size - ptr_job->nb_trans; + if (UDD_ENDPOINT_MAX_TRANS < next_trans) { + /* The USB hardware support a maximum + * transfer size of UDD_ENDPOINT_MAX_TRANS Bytes */ + next_trans = UDD_ENDPOINT_MAX_TRANS -(UDD_ENDPOINT_MAX_TRANS % ep_size); + } + /* Need ZLP, if requested and last packet is not a short packet */ + ptr_job->b_shortpacket = ptr_job->b_shortpacket && (0 == (next_trans % ep_size)); + usb_device_endpoint_write_buffer_job(&usb_device,ep_num,&ptr_job->buf[ptr_job->nb_trans],next_trans); + return; + } + + /* Need to send a ZLP after all data transfer */ + if (ptr_job->b_shortpacket) { + ptr_job->b_shortpacket = false; + /* Start new transfer */ + usb_device_endpoint_write_buffer_job(&usb_device,ep_num,&ptr_job->buf[ptr_job->nb_trans],0); + return; + } + + /* Job complete then call callback */ + ptr_job->busy = false; + if (NULL != ptr_job->call_trans) { + ptr_job->call_trans(UDD_EP_TRANSFER_OK, ptr_job->nb_trans, ep); + } +} + +/** + * \brief Endpoint OUT process, continue to receive packets or zero length packet + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ep_trans_out_next(void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + udd_ep_id_t ep = ep_callback_para->endpoint_address; + uint16_t ep_size, nb_trans; + uint16_t next_trans; + udd_ep_id_t ep_num; + udd_ep_job_t *ptr_job; + + ptr_job = udd_ep_get_job(ep); + ep_num = ep & USB_EP_ADDR_MASK; + + ep_size = ptr_job->ep_size; + /* Update number of data transferred */ + nb_trans = ep_callback_para->received_bytes; + + /* Can be necessary to copy data receive from cache buffer to user buffer */ + if (ptr_job->b_use_out_cache_buffer) { + memcpy(&ptr_job->buf[ptr_job->nb_trans], udd_ep_out_cache_buffer[ep_num - 1], ptr_job->buf_size % ep_size); + } + + /* Update number of data transferred */ + ptr_job->nb_trans += nb_trans; + if (ptr_job->nb_trans > ptr_job->buf_size) { + ptr_job->nb_trans = ptr_job->buf_size; + } + + /* If all previous data requested are received and user buffer not full + * then need to receive other data */ + if ((nb_trans == ep_callback_para->out_buffer_size) && (ptr_job->nb_trans != ptr_job->buf_size)) { + next_trans = ptr_job->buf_size - ptr_job->nb_trans; + if (UDD_ENDPOINT_MAX_TRANS < next_trans) { + /* The USB hardware support a maximum transfer size + * of UDD_ENDPOINT_MAX_TRANS Bytes */ + next_trans = UDD_ENDPOINT_MAX_TRANS - (UDD_ENDPOINT_MAX_TRANS % ep_size); + } else { + next_trans -= next_trans % ep_size; + } + + if (next_trans < ep_size) { + /* Use the cache buffer for Bulk or Interrupt size endpoint */ + ptr_job->b_use_out_cache_buffer = true; + usb_device_endpoint_read_buffer_job(&usb_device,ep_num,udd_ep_out_cache_buffer[ep_num - 1],ep_size); + } else { + usb_device_endpoint_read_buffer_job(&usb_device,ep_num,&ptr_job->buf[ptr_job->nb_trans],next_trans); + } + return; + } + + /* Job complete then call callback */ + ptr_job->busy = false; + if (NULL != ptr_job->call_trans) { + ptr_job->call_trans(UDD_EP_TRANSFER_OK, ptr_job->nb_trans, ep); + } +} + +/** + * \brief Endpoint Transfer Complete callback function, to do the next transfer depends on the direction(IN or OUT) + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ep_transfer_process(struct usb_module *module_inst, void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + udd_ep_id_t ep = ep_callback_para->endpoint_address; + + if (ep & USB_EP_DIR_IN) { + udd_ep_trans_in_next(pointer); + } else { + udd_ep_trans_out_next(pointer); + } +} + +void udd_ep_abort(udd_ep_id_t ep) +{ + udd_ep_job_t *ptr_job; + + usb_device_endpoint_abort_job(&usb_device, ep); + + /* Job complete then call callback */ + ptr_job = udd_ep_get_job(ep); + if (!ptr_job->busy) { + return; + } + ptr_job->busy = false; + if (NULL != ptr_job->call_trans) { + /* It can be a Transfer or stall callback */ + ptr_job->call_trans(UDD_EP_TRANSFER_ABORT, ptr_job->nb_trans, ep); + } +} + +bool udd_is_high_speed(void) +{ + return false; +} + +uint16_t udd_get_frame_number(void) +{ + return usb_device_get_frame_number(&usb_device); +} + +uint16_t udd_get_micro_frame_number(void) +{ + return usb_device_get_micro_frame_number(&usb_device); +} + +void udd_ep_free(udd_ep_id_t ep) +{ + struct usb_device_endpoint_config config_ep; + usb_device_endpoint_get_config_defaults(&config_ep); + + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + udd_ep_abort(ep); + + config_ep.ep_address = ep; + config_ep.ep_type = USB_DEVICE_ENDPOINT_TYPE_DISABLE; + usb_device_endpoint_set_config(&usb_device, &config_ep); + usb_device_endpoint_unregister_callback(&usb_device,ep_num,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT); + usb_device_endpoint_disable_callback(&usb_device,ep,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT); +} + +bool udd_ep_alloc(udd_ep_id_t ep, uint8_t bmAttributes, uint16_t MaxEndpointSize) +{ + struct usb_device_endpoint_config config_ep; + usb_device_endpoint_get_config_defaults(&config_ep); + + config_ep.ep_address = ep; + + if(MaxEndpointSize <= 8) { + config_ep.ep_size = USB_ENDPOINT_8_BYTE; + } else if(MaxEndpointSize <= 16) { + config_ep.ep_size = USB_ENDPOINT_16_BYTE; + } else if(MaxEndpointSize <= 32) { + config_ep.ep_size = USB_ENDPOINT_32_BYTE; + } else if(MaxEndpointSize <= 64) { + config_ep.ep_size = USB_ENDPOINT_64_BYTE; + } else if(MaxEndpointSize <= 128) { + config_ep.ep_size = USB_ENDPOINT_128_BYTE; + } else if(MaxEndpointSize <= 256) { + config_ep.ep_size = USB_ENDPOINT_256_BYTE; + } else if(MaxEndpointSize <= 512) { + config_ep.ep_size = USB_ENDPOINT_512_BYTE; + } else if(MaxEndpointSize <= 1023) { + config_ep.ep_size = USB_ENDPOINT_1023_BYTE; + } else { + return false; + } + udd_ep_job_t *ptr_job = udd_ep_get_job(ep); + ptr_job->ep_size = MaxEndpointSize; + + bmAttributes = bmAttributes & USB_EP_TYPE_MASK; + + /* Check endpoint type */ + if(USB_EP_TYPE_ISOCHRONOUS == bmAttributes) { + config_ep.ep_type = USB_DEVICE_ENDPOINT_TYPE_ISOCHRONOUS; + } else if (USB_EP_TYPE_BULK == bmAttributes) { + config_ep.ep_type = USB_DEVICE_ENDPOINT_TYPE_BULK; + } else if (USB_EP_TYPE_INTERRUPT == bmAttributes) { + config_ep.ep_type = USB_DEVICE_ENDPOINT_TYPE_INTERRUPT; + } else { + return false; + } + + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + if (STATUS_OK != usb_device_endpoint_set_config(&usb_device, &config_ep)) { + return false; + } + usb_device_endpoint_register_callback(&usb_device,ep_num,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT,udd_ep_transfer_process); + usb_device_endpoint_enable_callback(&usb_device,ep,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT); + usb_device_endpoint_enable_callback(&usb_device,ep,USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL); + + return true; +} + +bool udd_ep_is_halted(udd_ep_id_t ep) +{ + return usb_device_endpoint_is_halted(&usb_device, ep); +} + +bool udd_ep_set_halt(udd_ep_id_t ep) +{ + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + if (USB_DEVICE_MAX_EP < ep_num) { + return false; + } + + usb_device_endpoint_set_halt(&usb_device, ep); + + udd_ep_abort(ep); + return true; +} + +bool udd_ep_clear_halt(udd_ep_id_t ep) +{ + udd_ep_job_t *ptr_job; + uint8_t ep_num = ep & USB_EP_ADDR_MASK; + + if (USB_DEVICE_MAX_EP < ep_num) { + return false; + } + ptr_job = udd_ep_get_job(ep); + + usb_device_endpoint_clear_halt(&usb_device, ep); + + /* If a job is register on clear halt action then execute callback */ + if (ptr_job->busy == true) { + ptr_job->busy = false; + ptr_job->call_nohalt(); + } + + return true; +} + +bool udd_ep_wait_stall_clear(udd_ep_id_t ep, udd_callback_halt_cleared_t callback) +{ + udd_ep_id_t ep_num; + udd_ep_job_t *ptr_job; + + ep_num = ep & USB_EP_ADDR_MASK; + if (USB_DEVICE_MAX_EP < ep_num) { + return false; + } + + ptr_job = udd_ep_get_job(ep); + if (ptr_job->busy == true) { + return false; /* Job already on going */ + } + + /* Wait clear halt endpoint */ + if (usb_device_endpoint_is_halted(&usb_device, ep)) { + /* Endpoint halted then registers the callback */ + ptr_job->busy = true; + ptr_job->call_nohalt = callback; + return true; + } else if (usb_device_endpoint_is_configured(&usb_device, ep)) { + callback(); /* Endpoint not halted then call directly callback */ + return true; + } else { + return false; + } +} + +/** + * \brief Control Endpoint stall sending data + */ +static void udd_ctrl_stall_data(void) +{ + udd_ep_control_state = UDD_EPCTRL_STALL_REQ; + + usb_device_endpoint_set_halt(&usb_device, USB_EP_DIR_IN); + usb_device_endpoint_clear_halt(&usb_device, USB_EP_DIR_OUT); +} + +bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, uint8_t *buf, iram_size_t buf_size, udd_callback_trans_t callback) +{ + udd_ep_id_t ep_num; + udd_ep_job_t *ptr_job; + uint32_t irqflags; + + ep_num = ep & USB_EP_ADDR_MASK; + + if ((USB_DEVICE_MAX_EP < ep_num) || (udd_ep_is_halted(ep))) { + return false; + } + + ptr_job = udd_ep_get_job(ep); + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + if (ptr_job->busy == true) { + __DMB(); + __set_PRIMASK(irqflags); + return false; /* Job already on going */ + } + + ptr_job->busy = true; + __DMB(); + __set_PRIMASK(irqflags); + + /* No job running, set up a new one */ + ptr_job->buf = buf; + ptr_job->buf_size = buf_size; + ptr_job->nb_trans = 0; + ptr_job->call_trans = callback; + ptr_job->b_shortpacket = b_shortpacket; + ptr_job->b_use_out_cache_buffer = false; + + /* Initialize value to simulate a empty transfer */ + uint16_t next_trans; + + if (ep & USB_EP_DIR_IN) { + if (0 != ptr_job->buf_size) { + next_trans = ptr_job->buf_size; + if (UDD_ENDPOINT_MAX_TRANS < next_trans) { + next_trans = UDD_ENDPOINT_MAX_TRANS - (UDD_ENDPOINT_MAX_TRANS % ptr_job->ep_size); + } + ptr_job->b_shortpacket = ptr_job->b_shortpacket && (0 == (next_trans % ptr_job->ep_size)); + } else if (true == ptr_job->b_shortpacket) { + ptr_job->b_shortpacket = false; /* avoid to send zero length packet again */ + next_trans = 0; + } else { + ptr_job->busy = false; + if (NULL != ptr_job->call_trans) { + ptr_job->call_trans(UDD_EP_TRANSFER_OK, 0, ep); + } + return true; + } + return (STATUS_OK == + usb_device_endpoint_write_buffer_job(&usb_device, + ep_num,&ptr_job->buf[0],next_trans)); + } else { + if (0 != ptr_job->buf_size) { + next_trans = ptr_job->buf_size; + if (UDD_ENDPOINT_MAX_TRANS < next_trans) { + /* The USB hardware support a maximum transfer size + * of UDD_ENDPOINT_MAX_TRANS Bytes */ + next_trans = UDD_ENDPOINT_MAX_TRANS - + (UDD_ENDPOINT_MAX_TRANS % ptr_job->ep_size); + } else { + next_trans -= next_trans % ptr_job->ep_size; + } + if (next_trans < ptr_job->ep_size) { + ptr_job->b_use_out_cache_buffer = true; + return (STATUS_OK == + usb_device_endpoint_read_buffer_job(&usb_device, ep_num, + udd_ep_out_cache_buffer[ep_num - 1], + ptr_job->ep_size)); + } else { + return (STATUS_OK == + usb_device_endpoint_read_buffer_job(&usb_device, ep_num, + &ptr_job->buf[0],next_trans)); + } + } else { + ptr_job->busy = false; + if (NULL != ptr_job->call_trans) { + ptr_job->call_trans(UDD_EP_TRANSFER_OK, 0, ep); + } + return true; + } + } +} + +void udd_set_address(uint8_t address) +{ + usb_device_set_address(&usb_device,address); +} + +uint8_t udd_getaddress(void) +{ + return usb_device_get_address(&usb_device); +} + +void udd_send_remotewakeup(void) +{ + uint32_t try = 5; + udd_wait_clock_ready(); + udd_sleep_mode(UDD_STATE_IDLE); + while(2 != usb_get_state_machine_status(&usb_device) && try --) { + usb_device_send_remote_wake_up(&usb_device); + } +} + +void udd_set_setup_payload( uint8_t *payload, uint16_t payload_size ) +{ + udd_g_ctrlreq.payload = payload; + udd_g_ctrlreq.payload_size = payload_size; +} + +/** + * \brief Control Endpoint translate the data in buffer into Device Request Struct + */ +static void udd_ctrl_fetch_ram(void) +{ + udd_g_ctrlreq.req.bmRequestType = udd_ctrl_buffer[0]; + udd_g_ctrlreq.req.bRequest = udd_ctrl_buffer[1]; + udd_g_ctrlreq.req.wValue = ((uint16_t)(udd_ctrl_buffer[3]) << 8) + udd_ctrl_buffer[2]; + udd_g_ctrlreq.req.wIndex = ((uint16_t)(udd_ctrl_buffer[5]) << 8) + udd_ctrl_buffer[4]; + udd_g_ctrlreq.req.wLength = ((uint16_t)(udd_ctrl_buffer[7]) << 8) + udd_ctrl_buffer[6]; +} + +/** + * \brief Control Endpoint send out zero length packet + */ +static void udd_ctrl_send_zlp_in(void) +{ + udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP; + usb_device_endpoint_setup_buffer_job(&usb_device,udd_ctrl_buffer); + usb_device_endpoint_write_buffer_job(&usb_device,0,udd_g_ctrlreq.payload,0); +} + +/** + * \brief Process control endpoint IN transaction + */ +static void udd_ctrl_in_sent(void) +{ + static bool b_shortpacket = false; + uint16_t nb_remain; + + nb_remain = udd_g_ctrlreq.payload_size - udd_ctrl_payload_nb_trans; + + if (0 == nb_remain) { + /* All content of current buffer payload are sent Update number of total data sending by previous payload buffer */ + udd_ctrl_prev_payload_nb_trans += udd_ctrl_payload_nb_trans; + if ((udd_g_ctrlreq.req.wLength == udd_ctrl_prev_payload_nb_trans) || b_shortpacket) { + /* All data requested are transferred or a short packet has been sent, then it is the end of data phase. + * Generate an OUT ZLP for handshake phase */ + udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP; + usb_device_endpoint_setup_buffer_job(&usb_device,udd_ctrl_buffer); + return; + } + /* Need of new buffer because the data phase is not complete */ + if ((!udd_g_ctrlreq.over_under_run) || (!udd_g_ctrlreq.over_under_run())) { + /* Under run then send zlp on IN + * Here nb_remain=0, this allows to send a IN ZLP */ + } else { + /* A new payload buffer is given */ + udd_ctrl_payload_nb_trans = 0; + nb_remain = udd_g_ctrlreq.payload_size; + } + } + + /* Continue transfer and send next data */ + if (nb_remain >= USB_DEVICE_EP_CTRL_SIZE) { + nb_remain = USB_DEVICE_EP_CTRL_SIZE; + b_shortpacket = false; + } else { + b_shortpacket = true; + } + + /* Link payload buffer directly on USB hardware */ + usb_device_endpoint_write_buffer_job(&usb_device,0,udd_g_ctrlreq.payload + udd_ctrl_payload_nb_trans,nb_remain); + + udd_ctrl_payload_nb_trans += nb_remain; +} + +/** + * \brief Process control endpoint OUT transaction + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ctrl_out_received(void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + + uint16_t nb_data; + nb_data = ep_callback_para->received_bytes; /* Read data received during OUT phase */ + + if (udd_g_ctrlreq.payload_size < (udd_ctrl_payload_nb_trans + nb_data)) { + /* Payload buffer too small */ + nb_data = udd_g_ctrlreq.payload_size - udd_ctrl_payload_nb_trans; + } + + memcpy((uint8_t *) (udd_g_ctrlreq.payload + udd_ctrl_payload_nb_trans), udd_ctrl_buffer, nb_data); + udd_ctrl_payload_nb_trans += nb_data; + + if ((USB_DEVICE_EP_CTRL_SIZE != nb_data) || \ + (udd_g_ctrlreq.req.wLength <= (udd_ctrl_prev_payload_nb_trans + udd_ctrl_payload_nb_trans))) { + /* End of reception because it is a short packet + * or all data are transferred */ + + /* Before send ZLP, call intermediate callback + * in case of data receive generate a stall */ + udd_g_ctrlreq.payload_size = udd_ctrl_payload_nb_trans; + if (NULL != udd_g_ctrlreq.over_under_run) { + if (!udd_g_ctrlreq.over_under_run()) { + /* Stall ZLP */ + udd_ep_control_state = UDD_EPCTRL_STALL_REQ; + /* Stall all packets on IN & OUT control endpoint */ + udd_ep_set_halt(0); + /* Ack reception of OUT to replace NAK by a STALL */ + return; + } + } + /* Send IN ZLP to ACK setup request */ + udd_ctrl_send_zlp_in(); + return; + } + + if (udd_g_ctrlreq.payload_size == udd_ctrl_payload_nb_trans) { + /* Overrun then request a new payload buffer */ + if (!udd_g_ctrlreq.over_under_run) { + /* No callback available to request a new payload buffer + * Stall ZLP */ + udd_ep_control_state = UDD_EPCTRL_STALL_REQ; + /* Stall all packets on IN & OUT control endpoint */ + udd_ep_set_halt(0); + return; + } + if (!udd_g_ctrlreq.over_under_run()) { + /* No new payload buffer delivered + * Stall ZLP */ + udd_ep_control_state = UDD_EPCTRL_STALL_REQ; + /* Stall all packets on IN & OUT control endpoint */ + udd_ep_set_halt(0); + return; + } + /* New payload buffer available + * Update number of total data received */ + udd_ctrl_prev_payload_nb_trans += udd_ctrl_payload_nb_trans; + + /* Reinitialize reception on payload buffer */ + udd_ctrl_payload_nb_trans = 0; + } + usb_device_endpoint_read_buffer_job(&usb_device,0,udd_ctrl_buffer,USB_DEVICE_EP_CTRL_SIZE); +} + +/** + * \internal + * \brief Endpoint 0 (control) SETUP received callback + * \param[in] module_inst pointer to USB module instance + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void _usb_ep0_on_setup(struct usb_module *module_inst, void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + + if (UDD_EPCTRL_SETUP != udd_ep_control_state) { + if (NULL != udd_g_ctrlreq.callback) { + udd_g_ctrlreq.callback(); + } + udd_ep_control_state = UDD_EPCTRL_SETUP; + } + if ( 8 != ep_callback_para->received_bytes) { + udd_ctrl_stall_data(); + return; + } else { + udd_ctrl_fetch_ram(); + if (false == udc_process_setup()) { + udd_ctrl_stall_data(); + return; + } else if (Udd_setup_is_in()) { + udd_ctrl_prev_payload_nb_trans = 0; + udd_ctrl_payload_nb_trans = 0; + udd_ep_control_state = UDD_EPCTRL_DATA_IN; + usb_device_endpoint_read_buffer_job(&usb_device,0,udd_ctrl_buffer,USB_DEVICE_EP_CTRL_SIZE); + udd_ctrl_in_sent(); + } else { + if(0 == udd_g_ctrlreq.req.wLength) { + udd_ctrl_send_zlp_in(); + return; + } else { + udd_ctrl_prev_payload_nb_trans = 0; + udd_ctrl_payload_nb_trans = 0; + udd_ep_control_state = UDD_EPCTRL_DATA_OUT; + /* Initialize buffer size and enable OUT bank */ + usb_device_endpoint_read_buffer_job(&usb_device,0,udd_ctrl_buffer,USB_DEVICE_EP_CTRL_SIZE); + } + } + } +} + +/** + * \brief Control Endpoint Process when underflow condition has occurred + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ctrl_underflow(void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + + if (UDD_EPCTRL_DATA_OUT == udd_ep_control_state) { + /* Host want to stop OUT transaction + * then stop to wait OUT data phase and wait IN ZLP handshake */ + udd_ctrl_send_zlp_in(); + } else if (UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP == udd_ep_control_state) { + /* A OUT handshake is waiting by device, + * but host want extra IN data then stall extra IN data */ + usb_device_endpoint_set_halt(&usb_device, ep_callback_para->endpoint_address); + } +} + +/** + * \brief Control Endpoint Process when overflow condition has occurred + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void udd_ctrl_overflow(void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + + if (UDD_EPCTRL_DATA_IN == udd_ep_control_state) { + /* Host want to stop IN transaction + * then stop to wait IN data phase and wait OUT ZLP handshake */ + udd_ep_control_state = UDD_EPCTRL_HANDSHAKE_WAIT_OUT_ZLP; + } else if (UDD_EPCTRL_HANDSHAKE_WAIT_IN_ZLP == udd_ep_control_state) { + /* A IN handshake is waiting by device, + * but host want extra OUT data then stall extra OUT data and following status stage */ + usb_device_endpoint_set_halt(&usb_device, ep_callback_para->endpoint_address); + } +} + +/** + * \internal + * \brief Control endpoint transfer fail callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void _usb_ep0_on_tansfer_fail(struct usb_module *module_inst, void* pointer) +{ + struct usb_endpoint_callback_parameter *ep_callback_para = (struct usb_endpoint_callback_parameter*)pointer; + + if(ep_callback_para->endpoint_address & USB_EP_DIR_IN) { + udd_ctrl_underflow(pointer); + } else { + udd_ctrl_overflow(pointer); + } +} + +/** + * \internal + * \brief Control endpoint transfer complete callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the endpoint transfer status parameter struct from driver layer. + */ +static void _usb_ep0_on_tansfer_ok(struct usb_module *module_inst, void *pointer) +{ + if (UDD_EPCTRL_DATA_OUT == udd_ep_control_state) { /* handshake Out for status stage */ + udd_ctrl_out_received(pointer); + } else if (UDD_EPCTRL_DATA_IN == udd_ep_control_state) { /* handshake In for status stage */ + udd_ctrl_in_sent(); + } else { + if (NULL != udd_g_ctrlreq.callback) { + udd_g_ctrlreq.callback(); + } + udd_ep_control_state = UDD_EPCTRL_SETUP; + } +} + +/** + * \brief Enable Control Endpoint + * \param[in] module_inst Pointer to USB module instance + */ +static void udd_ctrl_ep_enable(struct usb_module *module_inst) +{ + /* USB Device Endpoint0 Configuration */ + struct usb_device_endpoint_config config_ep0; + + usb_device_endpoint_get_config_defaults(&config_ep0); + config_ep0.ep_size = (enum usb_endpoint_size)(32 - clz(((uint32_t)Min(Max(USB_DEVICE_EP_CTRL_SIZE, 8), 1024) << 1) - 1) - 1 - 3); + usb_device_endpoint_set_config(module_inst,&config_ep0); + + usb_device_endpoint_setup_buffer_job(module_inst,udd_ctrl_buffer); + + usb_device_endpoint_register_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_RXSTP, _usb_ep0_on_setup ); + usb_device_endpoint_register_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT,_usb_ep0_on_tansfer_ok ); + usb_device_endpoint_register_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL,_usb_ep0_on_tansfer_fail ); + usb_device_endpoint_enable_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_RXSTP); + usb_device_endpoint_enable_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_TRCPT); + usb_device_endpoint_enable_callback(module_inst,0,USB_DEVICE_ENDPOINT_CALLBACK_TRFAIL); + +#ifdef USB_DEVICE_LPM_SUPPORT + // Enable LPM feature + usb_device_set_lpm_mode(module_inst, USB_DEVICE_LPM_ACK); +#endif + + udd_ep_control_state = UDD_EPCTRL_SETUP; +} + +/** + * \internal + * \brief Control endpoint Suspend callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the callback parameter from driver layer. + */ +static void _usb_on_suspend(struct usb_module *module_inst, void *pointer) +{ + usb_device_disable_callback(&usb_device, USB_DEVICE_CALLBACK_SUSPEND); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP); + udd_sleep_mode(UDD_STATE_SUSPEND); +#ifdef UDC_SUSPEND_EVENT + UDC_SUSPEND_EVENT(); +#endif +} + +#ifdef USB_DEVICE_LPM_SUPPORT +static void _usb_device_lpm_suspend(struct usb_module *module_inst, void *pointer) +{ + dbg_print("LPM_SUSP\n"); + + uint32_t *lpm_wakeup_enable; + lpm_wakeup_enable = (uint32_t *)pointer; + + usb_device_disable_callback(&usb_device, USB_DEVICE_CALLBACK_LPMSUSP); + usb_device_disable_callback(&usb_device, USB_DEVICE_CALLBACK_SUSPEND); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP); + +//#warning Here the sleep mode must be choose to have a DFLL startup time < bmAttribut.HIRD + udd_sleep_mode(UDD_STATE_SUSPEND_LPM); // Enter in LPM SUSPEND mode + if ((*lpm_wakeup_enable)) { + UDC_REMOTEWAKEUP_LPM_ENABLE(); + } + if (!(*lpm_wakeup_enable)) { + UDC_REMOTEWAKEUP_LPM_DISABLE(); + } + UDC_SUSPEND_LPM_EVENT(); +} +#endif + +/** + * \internal + * \brief Control endpoint SOF callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the callback parameter from driver layer. + */ +static void _usb_on_sof_notify(struct usb_module *module_inst, void *pointer) +{ + udc_sof_notify(); +#ifdef UDC_SOF_EVENT + UDC_SOF_EVENT(); +#endif +} + +/** + * \internal + * \brief Control endpoint Reset callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the callback parameter from driver layer. + */ +static void _usb_on_bus_reset(struct usb_module *module_inst, void *pointer) +{ + // Reset USB Device Stack Core + udc_reset(); + usb_device_set_address(module_inst,0); + udd_ctrl_ep_enable(module_inst); +} + +/** + * \internal + * \brief Control endpoint Wakeup callback function + * \param[in] module_inst Pointer to USB module instance + * \param[in] pointer Pointer to the callback parameter from driver layer. + */ +static void _usb_on_wakeup(struct usb_module *module_inst, void *pointer) +{ + udd_wait_clock_ready(); + + usb_device_disable_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_SUSPEND); +#ifdef USB_DEVICE_LPM_SUPPORT + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_LPMSUSP, _usb_device_lpm_suspend); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_LPMSUSP); +#endif + udd_sleep_mode(UDD_STATE_IDLE); +#ifdef UDC_RESUME_EVENT + UDC_RESUME_EVENT(); +#endif +} + +void udd_detach(void) +{ + usb_device_detach(&usb_device); + udd_sleep_mode(UDD_STATE_SUSPEND); +} + +void udd_attach(void) +{ + udd_sleep_mode(UDD_STATE_IDLE); + usb_device_attach(&usb_device); + + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_SUSPEND, _usb_on_suspend); + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_SOF, _usb_on_sof_notify); + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_RESET, _usb_on_bus_reset); + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP, _usb_on_wakeup); + + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_SUSPEND); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_SOF); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_RESET); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_WAKEUP); +#ifdef USB_DEVICE_LPM_SUPPORT + usb_device_register_callback(&usb_device, USB_DEVICE_CALLBACK_LPMSUSP, _usb_device_lpm_suspend); + usb_device_enable_callback(&usb_device, USB_DEVICE_CALLBACK_LPMSUSP); +#endif +} + +void udd_enable(void) +{ + uint32_t irqflags; + + /* To avoid USB interrupt before end of initialization */ + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + struct usb_config config_usb; + + /* USB Module configuration */ + usb_get_config_defaults(&config_usb); + config_usb.source_generator = UDD_CLOCK_GEN; + usb_init(&usb_device, USB, &config_usb); + + /* USB Module Enable */ + usb_enable(&usb_device); + + /* Check clock after enable module, request the clock */ + udd_wait_clock_ready(); + + udd_sleep_mode(UDD_STATE_SUSPEND); + + // No VBus detect, assume always high +#ifndef USB_DEVICE_ATTACH_AUTO_DISABLE + udd_attach(); +#endif + + __DMB(); + __set_PRIMASK(irqflags); +} + +void udd_disable(void) +{ + udd_detach(); + + udd_sleep_mode(UDD_STATE_OFF); +} +/** @} */ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_main.h b/tmk_core/protocol/arm_atsam/usb/usb_main.h new file mode 100644 index 0000000000..b7adaa1a72 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_main.h @@ -0,0 +1,97 @@ +/** + * \file + * + * \brief Declaration of main function used by HID keyboard example + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _MAIN_H_ +#define _MAIN_H_ + +//Enters the application in low power mode +//Callback called when USB host sets USB line in suspend state +void main_suspend_action(void); + +//Called by UDD when the USB line exit of suspend state +void main_resume_action(void); + +//Called when a start of frame is received on USB line +void main_sof_action(void); + +//Called by UDC when USB Host request to enable remote wakeup +void main_remotewakeup_enable(void); + +//Called by UDC when USB Host request to disable remote wakeup +void main_remotewakeup_disable(void); + + +#ifdef KBD +extern volatile bool main_b_kbd_enable; +bool main_kbd_enable(void); +void main_kbd_disable(void); +#endif //KBD + +#ifdef NKRO +extern volatile bool main_b_nkro_enable; +bool main_nkro_enable(void); +void main_nkro_disable(void); +#endif //NKRO + +#ifdef EXK +extern volatile bool main_b_exk_enable; +bool main_exk_enable(void); +void main_exk_disable(void); +#endif //EXK + +#ifdef MOU +extern volatile bool main_b_mou_enable; +bool main_mou_enable(void); +void main_mou_disable(void); +#endif //MOU + +#ifdef RAW +extern volatile bool main_b_raw_enable; +bool main_raw_enable(void); +void main_raw_disable(void); +#endif //RAW + +#endif // _MAIN_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol.h new file mode 100644 index 0000000000..892a7d3a5a --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol.h @@ -0,0 +1,498 @@ +/** + * \file + * + * \brief USB protocol definitions. + * + * This file contains the USB definitions and data structures provided by the + * USB 2.0 specification. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _USB_PROTOCOL_H_ +#define _USB_PROTOCOL_H_ + +#include "usb_atmel.h" + +/** + * \ingroup usb_group + * \defgroup usb_protocol_group USB Protocol Definitions + * + * This module defines constants and data structures provided by the USB + * 2.0 specification. + * + * @{ + */ + +//! Value for field bcdUSB +#define USB_V2_0 0x0200 //!< USB Specification version 2.00 +#define USB_V2_1 0x0201 //!< USB Specification version 2.01 + +/*! \name Generic definitions (Class, subclass and protocol) + */ +//! @{ +#define NO_CLASS 0x00 +#define CLASS_VENDOR_SPECIFIC 0xFF +#define NO_SUBCLASS 0x00 +#define NO_PROTOCOL 0x00 +//! @} + +//! \name IAD (Interface Association Descriptor) constants +//! @{ +#define CLASS_IAD 0xEF +#define SUB_CLASS_IAD 0x02 +#define PROTOCOL_IAD 0x01 +//! @} + +/** + * \brief USB request data transfer direction (bmRequestType) + */ +#define USB_REQ_DIR_OUT (0<<7) //!< Host to device +#define USB_REQ_DIR_IN (1<<7) //!< Device to host +#define USB_REQ_DIR_MASK (1<<7) //!< Mask + +/** + * \brief USB request types (bmRequestType) + */ +#define USB_REQ_TYPE_STANDARD (0<<5) //!< Standard request +#define USB_REQ_TYPE_CLASS (1<<5) //!< Class-specific request +#define USB_REQ_TYPE_VENDOR (2<<5) //!< Vendor-specific request +#define USB_REQ_TYPE_MASK (3<<5) //!< Mask + +/** + * \brief USB recipient codes (bmRequestType) + */ +#define USB_REQ_RECIP_DEVICE (0<<0) //!< Recipient device +#define USB_REQ_RECIP_INTERFACE (1<<0) //!< Recipient interface +#define USB_REQ_RECIP_ENDPOINT (2<<0) //!< Recipient endpoint +#define USB_REQ_RECIP_OTHER (3<<0) //!< Recipient other +#define USB_REQ_RECIP_MASK (0x1F) //!< Mask + +/** + * \brief Standard USB requests (bRequest) + */ +enum usb_reqid { + USB_REQ_GET_STATUS = 0, + USB_REQ_CLEAR_FEATURE = 1, + USB_REQ_SET_FEATURE = 3, + USB_REQ_SET_ADDRESS = 5, + USB_REQ_GET_DESCRIPTOR = 6, + USB_REQ_SET_DESCRIPTOR = 7, + USB_REQ_GET_CONFIGURATION = 8, + USB_REQ_SET_CONFIGURATION = 9, + USB_REQ_GET_INTERFACE = 10, + USB_REQ_SET_INTERFACE = 11, + USB_REQ_SYNCH_FRAME = 12, +}; + +/** + * \brief Standard USB device status flags + * + */ +enum usb_device_status { + USB_DEV_STATUS_BUS_POWERED = 0, + USB_DEV_STATUS_SELF_POWERED = 1, + USB_DEV_STATUS_REMOTEWAKEUP = 2 +}; + +/** + * \brief Standard USB Interface status flags + * + */ +enum usb_interface_status { + USB_IFACE_STATUS_RESERVED = 0 +}; + +/** + * \brief Standard USB endpoint status flags + * + */ +enum usb_endpoint_status { + USB_EP_STATUS_HALTED = 1, +}; + +/** + * \brief Standard USB device feature flags + * + * \note valid for SetFeature request. + */ +enum usb_device_feature { + USB_DEV_FEATURE_REMOTE_WAKEUP = 1, //!< Remote wakeup enabled + USB_DEV_FEATURE_TEST_MODE = 2, //!< USB test mode + USB_DEV_FEATURE_OTG_B_HNP_ENABLE = 3, + USB_DEV_FEATURE_OTG_A_HNP_SUPPORT = 4, + USB_DEV_FEATURE_OTG_A_ALT_HNP_SUPPORT = 5 +}; + +/** + * \brief Test Mode possible on HS USB device + * + * \note valid for USB_DEV_FEATURE_TEST_MODE request. + */ +enum usb_device_hs_test_mode { + USB_DEV_TEST_MODE_J = 1, + USB_DEV_TEST_MODE_K = 2, + USB_DEV_TEST_MODE_SE0_NAK = 3, + USB_DEV_TEST_MODE_PACKET = 4, + USB_DEV_TEST_MODE_FORCE_ENABLE = 5, +}; + +/** + * \brief Standard USB endpoint feature/status flags + */ +enum usb_endpoint_feature { + USB_EP_FEATURE_HALT = 0, +}; + +/** + * \brief Standard USB Test Mode Selectors + */ +enum usb_test_mode_selector { + USB_TEST_J = 0x01, + USB_TEST_K = 0x02, + USB_TEST_SE0_NAK = 0x03, + USB_TEST_PACKET = 0x04, + USB_TEST_FORCE_ENABLE = 0x05, +}; + +/** + * \brief Standard USB descriptor types + */ +enum usb_descriptor_type { + USB_DT_DEVICE = 1, + USB_DT_CONFIGURATION = 2, + USB_DT_STRING = 3, + USB_DT_INTERFACE = 4, + USB_DT_ENDPOINT = 5, + USB_DT_DEVICE_QUALIFIER = 6, + USB_DT_OTHER_SPEED_CONFIGURATION = 7, + USB_DT_INTERFACE_POWER = 8, + USB_DT_OTG = 9, + USB_DT_IAD = 0x0B, + USB_DT_BOS = 0x0F, + USB_DT_DEVICE_CAPABILITY = 0x10, +}; + +/** + * \brief USB Device Capability types + */ +enum usb_capability_type { + USB_DC_USB20_EXTENSION = 0x02, +}; + +/** + * \brief USB Device Capability - USB 2.0 Extension + * To fill bmAttributes field of usb_capa_ext_desc_t structure. + */ +enum usb_capability_extension_attr { + USB_DC_EXT_LPM = 0x00000002, +}; + +#define HIRD_50_US 0 +#define HIRD_125_US 1 +#define HIRD_200_US 2 +#define HIRD_275_US 3 +#define HIRD_350_US 4 +#define HIRD_425_US 5 +#define HIRD_500_US 6 +#define HIRD_575_US 7 +#define HIRD_650_US 8 +#define HIRD_725_US 9 +#define HIRD_800_US 10 +#define HIRD_875_US 11 +#define HIRD_950_US 12 +#define HIRD_1025_US 13 +#define HIRD_1100_US 14 +#define HIRD_1175_US 15 + +/** Fields definition from a LPM TOKEN */ +#define USB_LPM_ATTRIBUT_BLINKSTATE_MASK (0xF << 0) +#define USB_LPM_ATTRIBUT_FIRD_MASK (0xF << 4) +#define USB_LPM_ATTRIBUT_REMOTEWAKE_MASK (1 << 8) +#define USB_LPM_ATTRIBUT_BLINKSTATE(value) ((value & 0xF) << 0) +#define USB_LPM_ATTRIBUT_FIRD(value) ((value & 0xF) << 4) +#define USB_LPM_ATTRIBUT_REMOTEWAKE(value) ((value & 1) << 8) +#define USB_LPM_ATTRIBUT_BLINKSTATE_L1 USB_LPM_ATTRIBUT_BLINKSTATE(1) + +/** + * \brief Standard USB endpoint transfer types + */ +enum usb_ep_type { + USB_EP_TYPE_CONTROL = 0x00, + USB_EP_TYPE_ISOCHRONOUS = 0x01, + USB_EP_TYPE_BULK = 0x02, + USB_EP_TYPE_INTERRUPT = 0x03, + USB_EP_TYPE_MASK = 0x03, +}; + +/** + * \brief Standard USB language IDs for string descriptors + */ +enum usb_langid { + USB_LANGID_EN_US = 0x0409, //!< English (United States) +}; + +/** + * \brief Mask selecting the index part of an endpoint address + */ +#define USB_EP_ADDR_MASK 0x0f + +//! \brief USB address identifier +typedef uint8_t usb_add_t; + +/** + * \brief Endpoint transfer direction is IN + */ +#define USB_EP_DIR_IN 0x80 + +/** + * \brief Endpoint transfer direction is OUT + */ +#define USB_EP_DIR_OUT 0x00 + +//! \brief Endpoint identifier +typedef uint8_t usb_ep_t; + +/** + * \brief Maximum length in bytes of a USB descriptor + * + * The maximum length of a USB descriptor is limited by the 8-bit + * bLength field. + */ +#define USB_MAX_DESC_LEN 255 + +/* + * 2-byte alignment requested for all USB structures. + */ +COMPILER_PACK_SET(1) + +/** + * \brief A USB Device SETUP request + * + * The data payload of SETUP packets always follows this structure. + */ +typedef struct { + uint8_t bmRequestType; + uint8_t bRequest; + le16_t wValue; + le16_t wIndex; + le16_t wLength; +} usb_setup_req_t; + +/** + * \brief Standard USB device descriptor structure + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + le16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + le16_t idVendor; + le16_t idProduct; + le16_t bcdDevice; + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; +} usb_dev_desc_t; + +/** + * \brief Standard USB device qualifier descriptor structure + * + * This descriptor contains information about the device when running at + * the "other" speed (i.e. if the device is currently operating at high + * speed, this descriptor can be used to determine what would change if + * the device was operating at full speed.) + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + le16_t bcdUSB; + uint8_t bDeviceClass; + uint8_t bDeviceSubClass; + uint8_t bDeviceProtocol; + uint8_t bMaxPacketSize0; + uint8_t bNumConfigurations; + uint8_t bReserved; +} usb_dev_qual_desc_t; + +/** + * \brief USB Device BOS descriptor structure + * + * The BOS descriptor (Binary device Object Store) defines a root + * descriptor that is similar to the configuration descriptor, and is + * the base descriptor for accessing a family of related descriptors. + * A host can read a BOS descriptor and learn from the wTotalLength field + * the entire size of the device-level descriptor set, or it can read in + * the entire BOS descriptor set of device capabilities. + * The host accesses this descriptor using the GetDescriptor() request. + * The descriptor type in the GetDescriptor() request is set to BOS. + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + le16_t wTotalLength; + uint8_t bNumDeviceCaps; +} usb_dev_bos_desc_t; + + +/** + * \brief USB Device Capabilities - USB 2.0 Extension Descriptor structure + * + * Defines the set of USB 1.1-specific device level capabilities. + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bDevCapabilityType; + le32_t bmAttributes; +} usb_dev_capa_ext_desc_t; + +/** + * \brief USB Device LPM Descriptor structure + * + * The BOS descriptor and capabilities descriptors for LPM. + */ +typedef struct { + usb_dev_bos_desc_t bos; + usb_dev_capa_ext_desc_t capa_ext; +} usb_dev_lpm_desc_t; + +/** + * \brief Standard USB Interface Association Descriptor structure + */ +typedef struct { + uint8_t bLength; //!< size of this descriptor in bytes + uint8_t bDescriptorType; //!< INTERFACE descriptor type + uint8_t bFirstInterface; //!< Number of interface + uint8_t bInterfaceCount; //!< value to select alternate setting + uint8_t bFunctionClass; //!< Class code assigned by the USB + uint8_t bFunctionSubClass;//!< Sub-class code assigned by the USB + uint8_t bFunctionProtocol;//!< Protocol code assigned by the USB + uint8_t iFunction; //!< Index of string descriptor +} usb_association_desc_t; + + +/** + * \brief Standard USB configuration descriptor structure + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + le16_t wTotalLength; + uint8_t bNumInterfaces; + uint8_t bConfigurationValue; + uint8_t iConfiguration; + uint8_t bmAttributes; + uint8_t bMaxPower; +} usb_conf_desc_t; + + +#define USB_CONFIG_ATTR_MUST_SET (1 << 7) //!< Must always be set +#define USB_CONFIG_ATTR_BUS_POWERED (0 << 6) //!< Bus-powered +#define USB_CONFIG_ATTR_SELF_POWERED (1 << 6) //!< Self-powered +#define USB_CONFIG_ATTR_REMOTE_WAKEUP (1 << 5) //!< remote wakeup supported + +#define USB_CONFIG_MAX_POWER(ma) (((ma) + 1) / 2) //!< Max power in mA + +/** + * \brief Standard USB association descriptor structure + */ +typedef struct { + uint8_t bLength; //!< Size of this descriptor in bytes + uint8_t bDescriptorType; //!< Interface descriptor type + uint8_t bFirstInterface; //!< Number of interface + uint8_t bInterfaceCount; //!< value to select alternate setting + uint8_t bFunctionClass; //!< Class code assigned by the USB + uint8_t bFunctionSubClass; //!< Sub-class code assigned by the USB + uint8_t bFunctionProtocol; //!< Protocol code assigned by the USB + uint8_t iFunction; //!< Index of string descriptor +} usb_iad_desc_t; + +/** + * \brief Standard USB interface descriptor structure + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bInterfaceNumber; + uint8_t bAlternateSetting; + uint8_t bNumEndpoints; + uint8_t bInterfaceClass; + uint8_t bInterfaceSubClass; + uint8_t bInterfaceProtocol; + uint8_t iInterface; +} usb_iface_desc_t; + +/** + * \brief Standard USB endpoint descriptor structure + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; + uint8_t bEndpointAddress; + uint8_t bmAttributes; + le16_t wMaxPacketSize; + uint8_t bInterval; +} usb_ep_desc_t; + + +/** + * \brief A standard USB string descriptor structure + */ +typedef struct { + uint8_t bLength; + uint8_t bDescriptorType; +} usb_str_desc_t; + +typedef struct { + usb_str_desc_t desc; + le16_t string[1]; +} usb_str_lgid_desc_t; + +COMPILER_PACK_RESET() + +//! @} + +#endif /* _USB_PROTOCOL_H_ */ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h new file mode 100644 index 0000000000..479f25d4e3 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol_cdc.h @@ -0,0 +1,193 @@ +/** + * \file + * + * \brief USB Communication Device Class (CDC) protocol definitions + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ +#ifndef _USB_PROTOCOL_CDC_H_ +#define _USB_PROTOCOL_CDC_H_ + +#include "compiler.h" + +#ifdef CDC + +#define CDC_CLASS_DEVICE 0x02 //!< USB Communication Device Class +#define CDC_CLASS_COMM 0x02 //!< CDC Communication Class Interface +#define CDC_CLASS_DATA 0x0A //!< CDC Data Class Interface + +#define CDC_SUBCLASS_DLCM 0x01 //!< Direct Line Control Model +#define CDC_SUBCLASS_ACM 0x02 //!< Abstract Control Model +#define CDC_SUBCLASS_TCM 0x03 //!< Telephone Control Model +#define CDC_SUBCLASS_MCCM 0x04 //!< Multi-Channel Control Model +#define CDC_SUBCLASS_CCM 0x05 //!< CAPI Control Model +#define CDC_SUBCLASS_ETH 0x06 //!< Ethernet Networking Control Model +#define CDC_SUBCLASS_ATM 0x07 //!< ATM Networking Control Model + +#define CDC_PROTOCOL_V25TER 0x01 //!< Common AT commands + +#define CDC_PROTOCOL_I430 0x30 //!< ISDN BRI +#define CDC_PROTOCOL_HDLC 0x31 //!< HDLC +#define CDC_PROTOCOL_TRANS 0x32 //!< Transparent +#define CDC_PROTOCOL_Q921M 0x50 //!< Q.921 management protocol +#define CDC_PROTOCOL_Q921 0x51 //!< Q.931 [sic] Data link protocol +#define CDC_PROTOCOL_Q921TM 0x52 //!< Q.921 TEI-multiplexor +#define CDC_PROTOCOL_V42BIS 0x90 //!< Data compression procedures +#define CDC_PROTOCOL_Q931 0x91 //!< Euro-ISDN protocol control +#define CDC_PROTOCOL_V120 0x92 //!< V.24 rate adaption to ISDN +#define CDC_PROTOCOL_CAPI20 0x93 //!< CAPI Commands +#define CDC_PROTOCOL_HOST 0xFD //!< Host based driver + +#define CDC_PROTOCOL_PUFD 0xFE + +#define CDC_CS_INTERFACE 0x24 //!< Interface Functional Descriptor +#define CDC_CS_ENDPOINT 0x25 //!< Endpoint Functional Descriptor + +#define CDC_SCS_HEADER 0x00 //!< Header Functional Descriptor +#define CDC_SCS_CALL_MGMT 0x01 //!< Call Management +#define CDC_SCS_ACM 0x02 //!< Abstract Control Management +#define CDC_SCS_UNION 0x06 //!< Union Functional Descriptor + +#define USB_REQ_CDC_SEND_ENCAPSULATED_COMMAND 0x00 +#define USB_REQ_CDC_GET_ENCAPSULATED_RESPONSE 0x01 +#define USB_REQ_CDC_SET_COMM_FEATURE 0x02 +#define USB_REQ_CDC_GET_COMM_FEATURE 0x03 +#define USB_REQ_CDC_CLEAR_COMM_FEATURE 0x04 +#define USB_REQ_CDC_SET_AUX_LINE_STATE 0x10 +#define USB_REQ_CDC_SET_HOOK_STATE 0x11 +#define USB_REQ_CDC_PULSE_SETUP 0x12 +#define USB_REQ_CDC_SEND_PULSE 0x13 +#define USB_REQ_CDC_SET_PULSE_TIME 0x14 +#define USB_REQ_CDC_RING_AUX_JACK 0x15 +#define USB_REQ_CDC_SET_LINE_CODING 0x20 +#define USB_REQ_CDC_GET_LINE_CODING 0x21 +#define USB_REQ_CDC_SET_CONTROL_LINE_STATE 0x22 +#define USB_REQ_CDC_SEND_BREAK 0x23 +#define USB_REQ_CDC_SET_RINGER_PARMS 0x30 +#define USB_REQ_CDC_GET_RINGER_PARMS 0x31 +#define USB_REQ_CDC_SET_OPERATION_PARMS 0x32 +#define USB_REQ_CDC_GET_OPERATION_PARMS 0x33 +#define USB_REQ_CDC_SET_LINE_PARMS 0x34 +#define USB_REQ_CDC_GET_LINE_PARMS 0x35 +#define USB_REQ_CDC_DIAL_DIGITS 0x36 +#define USB_REQ_CDC_SET_UNIT_PARAMETER 0x37 +#define USB_REQ_CDC_GET_UNIT_PARAMETER 0x38 +#define USB_REQ_CDC_CLEAR_UNIT_PARAMETER 0x39 +#define USB_REQ_CDC_GET_PROFILE 0x3A +#define USB_REQ_CDC_SET_ETHERNET_MULTICAST_FILTERS 0x40 +#define USB_REQ_CDC_SET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x41 +#define USB_REQ_CDC_GET_ETHERNET_POWER_MANAGEMENT_PATTERNFILTER 0x42 +#define USB_REQ_CDC_SET_ETHERNET_PACKET_FILTER 0x43 +#define USB_REQ_CDC_GET_ETHERNET_STATISTIC 0x44 +#define USB_REQ_CDC_SET_ATM_DATA_FORMAT 0x50 +#define USB_REQ_CDC_GET_ATM_DEVICE_STATISTICS 0x51 +#define USB_REQ_CDC_SET_ATM_DEFAULT_VC 0x52 +#define USB_REQ_CDC_GET_ATM_VC_STATISTICS 0x53 +// Added bNotification codes according cdc spec 1.1 chapter 6.3 +#define USB_REQ_CDC_NOTIFY_RING_DETECT 0x09 +#define USB_REQ_CDC_NOTIFY_SERIAL_STATE 0x20 +#define USB_REQ_CDC_NOTIFY_CALL_STATE_CHANGE 0x28 +#define USB_REQ_CDC_NOTIFY_LINE_STATE_CHANGE 0x29 + + +#define CDC_CALL_MGMT_SUPPORTED (1 << 0) +#define CDC_CALL_MGMT_OVER_DCI (1 << 1) +#define CDC_ACM_SUPPORT_FEATURE_REQUESTS (1 << 0) +#define CDC_ACM_SUPPORT_LINE_REQUESTS (1 << 1) +#define CDC_ACM_SUPPORT_SENDBREAK_REQUESTS (1 << 2) +#define CDC_ACM_SUPPORT_NOTIFY_REQUESTS (1 << 3) + +#pragma pack(push,1) +typedef struct { + le32_t dwDTERate; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; +} usb_cdc_line_coding_t; +#pragma pack(pop) + +enum cdc_char_format { + CDC_STOP_BITS_1 = 0, //!< 1 stop bit + CDC_STOP_BITS_1_5 = 1, //!< 1.5 stop bits + CDC_STOP_BITS_2 = 2, //!< 2 stop bits +}; + +enum cdc_parity { + CDC_PAR_NONE = 0, //!< No parity + CDC_PAR_ODD = 1, //!< Odd parity + CDC_PAR_EVEN = 2, //!< Even parity + CDC_PAR_MARK = 3, //!< Parity forced to 0 (space) + CDC_PAR_SPACE = 4, //!< Parity forced to 1 (mark) +}; + + +typedef struct { + uint16_t value; +} usb_cdc_control_signal_t; + +#define CDC_CTRL_SIGNAL_ACTIVATE_CARRIER (1 << 1) +#define CDC_CTRL_SIGNAL_DTE_PRESENT (1 << 0) + + +typedef struct { + uint8_t bmRequestType; + uint8_t bNotification; + le16_t wValue; + le16_t wIndex; + le16_t wLength; +} usb_cdc_notify_msg_t; + +typedef struct { + usb_cdc_notify_msg_t header; + le16_t value; +} usb_cdc_notify_serial_state_t; + +#define CDC_SERIAL_STATE_DCD CPU_TO_LE16((1<<0)) +#define CDC_SERIAL_STATE_DSR CPU_TO_LE16((1<<1)) +#define CDC_SERIAL_STATE_BREAK CPU_TO_LE16((1<<2)) +#define CDC_SERIAL_STATE_RING CPU_TO_LE16((1<<3)) +#define CDC_SERIAL_STATE_FRAMING CPU_TO_LE16((1<<4)) +#define CDC_SERIAL_STATE_PARITY CPU_TO_LE16((1<<5)) +#define CDC_SERIAL_STATE_OVERRUN CPU_TO_LE16((1<<6)) + +#endif + +#endif // _USB_PROTOCOL_CDC_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h b/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h new file mode 100644 index 0000000000..c482e9c069 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_protocol_hid.h @@ -0,0 +1,319 @@ +/** + * \file + * + * \brief USB Human Interface Device (HID) protocol definitions. + * + * Copyright (c) 2009-2015 Atmel Corporation. All rights reserved. + * + * \asf_license_start + * + * \page License + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. The name of Atmel may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * 4. This software may only be redistributed and used in connection with an + * Atmel microcontroller product. + * + * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE + * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * \asf_license_stop + * + */ +/* + * Support and FAQ: visit Atmel Support + */ + +#ifndef _USB_PROTOCOL_HID_H_ +#define _USB_PROTOCOL_HID_H_ + +/** + * \ingroup usb_protocol_group + * \defgroup usb_hid_protocol USB Human Interface Device (HID) + * protocol definitions + * \brief USB Human Interface Device (HID) protocol definitions + * + * @{ + */ + +//! \name Possible Class value +//@{ +#define HID_CLASS 0x03 +//@} + +//! \name Possible SubClass value +//@{ +//! Interface subclass NO support BOOT protocol +#define HID_SUB_CLASS_NOBOOT 0x00 +//! Interface subclass support BOOT protocol +#define HID_SUB_CLASS_BOOT 0x01 +//@} + +//! \name Possible protocol value +//@{ +//! Protocol generic standard +#define HID_PROTOCOL_GENERIC 0x00 +//! Protocol keyboard standard +#define HID_PROTOCOL_KEYBOARD 0x01 +//! Protocol mouse standard +#define HID_PROTOCOL_MOUSE 0x02 +//@} + + +//! \brief Hid USB requests (bRequest) +enum usb_reqid_hid { + USB_REQ_HID_GET_REPORT = 0x01, + USB_REQ_HID_GET_IDLE = 0x02, + USB_REQ_HID_GET_PROTOCOL = 0x03, + USB_REQ_HID_SET_REPORT = 0x09, + USB_REQ_HID_SET_IDLE = 0x0A, + USB_REQ_HID_SET_PROTOCOL = 0x0B, +}; + +//! \brief HID USB descriptor types +enum usb_descriptor_type_hid { + USB_DT_HID = 0x21, + USB_DT_HID_REPORT = 0x22, + USB_DT_HID_PHYSICAL = 0x23, +}; + +//! \brief HID Type for report descriptor +enum usb_hid_item_report_type { + USB_HID_ITEM_REPORT_TYPE_MAIN = 0, + USB_HID_ITEM_REPORT_TYPE_GLOBAL = 1, + USB_HID_ITEM_REPORT_TYPE_LOCAL = 2, + USB_HID_ITEM_REPORT_TYPE_LONG = 3, +}; + +//! \brief HID report type +enum usb_hid_report_type { + USB_HID_REPORT_TYPE_INPUT = 1, + USB_HID_REPORT_TYPE_OUTPUT = 2, + USB_HID_REPORT_TYPE_FEATURE = 3, +}; + + +//! \brief HID protocol +enum usb_hid_protocol { + USB_HID_PROCOTOL_BOOT = 0, + USB_HID_PROCOTOL_REPORT = 1, +}; + +COMPILER_PACK_SET(1) + +//! \brief HID Descriptor +typedef struct { + uint8_t bLength; //!< Size of this descriptor in bytes + uint8_t bDescriptorType; //!< HID descriptor type + le16_t bcdHID; //!< Binary Coded Decimal Spec. release + uint8_t bCountryCode; //!< Hardware target country + uint8_t bNumDescriptors; //!< Number of HID class descriptors to follow + uint8_t bRDescriptorType; //!< Report descriptor type + le16_t wDescriptorLength; //!< Total length of Report descriptor +} usb_hid_descriptor_t; + +COMPILER_PACK_RESET() + + //! \name HID Report type + //! Used by SETUP_HID_GET_REPORT & SETUP_HID_SET_REPORT + //! @{ +#define REPORT_TYPE_INPUT 0x01 +#define REPORT_TYPE_OUTPUT 0x02 +#define REPORT_TYPE_FEATURE 0x03 + //! @} + + //! \name Constants of field DESCRIPTOR_HID + //! @{ +//! Numeric expression identifying the HID Class +//! Specification release (here V1.11) +#define USB_HID_BDC_V1_11 0x0111 +//! Numeric expression specifying the number of class descriptors +//! Note: Always at least one i.e. Report descriptor. +#define USB_HID_NUM_DESC 0x01 + + //! \name Country code + //! @{ +#define USB_HID_NO_COUNTRY_CODE 0 // Not Supported +#define USB_HID_COUNTRY_ARABIC 1 // Arabic +#define USB_HID_COUNTRY_BELGIAN 2 // Belgian +#define USB_HID_COUNTRY_CANADIAN_BILINGUAL 3 // Canadian-Bilingual +#define USB_HID_COUNTRY_CANADIAN_FRENCH 4 // Canadian-French +#define USB_HID_COUNTRY_CZECH_REPUBLIC 5 // Czech Republic +#define USB_HID_COUNTRY_DANISH 6 // Danish +#define USB_HID_COUNTRY_FINNISH 7 // Finnish +#define USB_HID_COUNTRY_FRENCH 8 // French +#define USB_HID_COUNTRY_GERMAN 9 // German +#define USB_HID_COUNTRY_GREEK 10 // Greek +#define USB_HID_COUNTRY_HEBREW 11 // Hebrew +#define USB_HID_COUNTRY_HUNGARY 12 // Hungary +#define USB_HID_COUNTRY_INTERNATIONAL_ISO 13 // International (ISO) +#define USB_HID_COUNTRY_ITALIAN 14 // Italian +#define USB_HID_COUNTRY_JAPAN_KATAKANA 15 // Japan (Katakana) +#define USB_HID_COUNTRY_KOREAN 16 // Korean +#define USB_HID_COUNTRY_LATIN_AMERICAN 17 // Latin American +#define USB_HID_COUNTRY_NETHERLANDS_DUTCH 18 // Netherlands/Dutch +#define USB_HID_COUNTRY_NORWEGIAN 19 // Norwegian +#define USB_HID_COUNTRY_PERSIAN_FARSI 20 // Persian (Farsi) +#define USB_HID_COUNTRY_POLAND 21 // Poland +#define USB_HID_COUNTRY_PORTUGUESE 22 // Portuguese +#define USB_HID_COUNTRY_RUSSIA 23 // Russia +#define USB_HID_COUNTRY_SLOVAKIA 24 // Slovakia +#define USB_HID_COUNTRY_SPANISH 25 // Spanish +#define USB_HID_COUNTRY_SWEDISH 26 // Swedish +#define USB_HID_COUNTRY_SWISS_FRENCH 27 // Swiss/French +#define USB_HID_COUNTRY_SWISS_GERMAN 28 // Swiss/German +#define USB_HID_COUNTRY_SWITZERLAND 29 // Switzerland +#define USB_HID_COUNTRY_TAIWAN 30 // Taiwan +#define USB_HID_COUNTRY_TURKISH_Q 31 // Turkish-Q +#define USB_HID_COUNTRY_UK 32 // UK +#define USB_HID_COUNTRY_US 33 // US +#define USB_HID_COUNTRY_YUGOSLAVIA 34 // Yugoslavia +#define USB_HID_COUNTRY_TURKISH_F 35 // Turkish-F + //! @} + //! @} +//! @} + + +//! \name HID KEYS values +//! @{ +#define HID_A 0x04 +#define HID_B 0x05 +#define HID_C 0x06 +#define HID_D 0x07 +#define HID_E 0x08 +#define HID_F 0x09 +#define HID_G 0x0A +#define HID_H 0x0B +#define HID_I 0x0C +#define HID_J 0x0D +#define HID_K 0x0E +#define HID_L 0x0F +#define HID_M 0x10 +#define HID_N 0x11 +#define HID_O 0x12 +#define HID_P 0x13 +#define HID_Q 0x14 +#define HID_R 0x15 +#define HID_S 0x16 +#define HID_T 0x17 +#define HID_U 0x18 +#define HID_V 0x19 +#define HID_W 0x1A +#define HID_X 0x1B +#define HID_Y 0x1C +#define HID_Z 0x1D +#define HID_1 30 +#define HID_2 31 +#define HID_3 32 +#define HID_4 33 +#define HID_5 34 +#define HID_6 35 +#define HID_7 36 +#define HID_8 37 +#define HID_9 38 +#define HID_0 39 +#define HID_ENTER 40 +#define HID_ESCAPE 41 +#define HID_BACKSPACE 42 +#define HID_TAB 43 +#define HID_SPACEBAR 44 +#define HID_UNDERSCORE 45 +#define HID_PLUS 46 +#define HID_OPEN_BRACKET 47 // { +#define HID_CLOSE_BRACKET 48 // } +#define HID_BACKSLASH 49 +#define HID_ASH 50 // # ~ +#define HID_COLON 51 // ; : +#define HID_QUOTE 52 // ' " +#define HID_TILDE 53 +#define HID_COMMA 54 +#define HID_DOT 55 +#define HID_SLASH 56 +#define HID_CAPS_LOCK 57 +#define HID_F1 58 +#define HID_F2 59 +#define HID_F3 60 +#define HID_F4 61 +#define HID_F5 62 +#define HID_F6 63 +#define HID_F7 64 +#define HID_F8 65 +#define HID_F9 66 +#define HID_F10 67 +#define HID_F11 68 +#define HID_F12 69 +#define HID_PRINTSCREEN 70 +#define HID_SCROLL_LOCK 71 +#define HID_PAUSE 72 +#define HID_INSERT 73 +#define HID_HOME 74 +#define HID_PAGEUP 75 +#define HID_DELETE 76 +#define HID_END 77 +#define HID_PAGEDOWN 78 +#define HID_RIGHT 79 +#define HID_LEFT 80 +#define HID_DOWN 81 +#define HID_UP 82 +#define HID_KEYPAD_NUM_LOCK 83 +#define HID_KEYPAD_DIVIDE 84 +#define HID_KEYPAD_AT 85 +#define HID_KEYPAD_MULTIPLY 85 +#define HID_KEYPAD_MINUS 86 +#define HID_KEYPAD_PLUS 87 +#define HID_KEYPAD_ENTER 88 +#define HID_KEYPAD_1 89 +#define HID_KEYPAD_2 90 +#define HID_KEYPAD_3 91 +#define HID_KEYPAD_4 92 +#define HID_KEYPAD_5 93 +#define HID_KEYPAD_6 94 +#define HID_KEYPAD_7 95 +#define HID_KEYPAD_8 96 +#define HID_KEYPAD_9 97 +#define HID_KEYPAD_0 98 + + //! \name HID modifier values + //! @{ +#define HID_MODIFIER_NONE 0x00 +#define HID_MODIFIER_LEFT_CTRL 0x01 +#define HID_MODIFIER_LEFT_SHIFT 0x02 +#define HID_MODIFIER_LEFT_ALT 0x04 +#define HID_MODIFIER_LEFT_UI 0x08 +#define HID_MODIFIER_RIGHT_CTRL 0x10 +#define HID_MODIFIER_RIGHT_SHIFT 0x20 +#define HID_MODIFIER_RIGHT_ALT 0x40 +#define HID_MODIFIER_RIGHT_UI 0x80 + //! @} +//! @} + +//! \name HID KEYS values +//! @{ +#define HID_LED_NUM_LOCK (1<<0) +#define HID_LED_CAPS_LOCK (1<<1) +#define HID_LED_SCROLL_LOCK (1<<2) +#define HID_LED_COMPOSE (1<<3) +#define HID_LED_KANA (1<<4) +//! @} + +#endif // _USB_PROTOCOL_HID_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb_util.c b/tmk_core/protocol/arm_atsam/usb/usb_util.c new file mode 100644 index 0000000000..58b349362e --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_util.c @@ -0,0 +1,59 @@ +#include "samd51j18a.h" +#include "string.h" +#include "usb_util.h" + +char digit(int d, int radix) +{ + if (d < 10) + { + return d + '0'; + } + else + { + return d - 10 + 'A'; + } +} + +int UTIL_ltoa_radix(int64_t value, char *dest, int radix) +{ + int64_t original = value; //save original value + char buf[25] = ""; + int c = sizeof(buf)-1; + int last = c; + int d; + int size; + + if (value < 0) //if it's negative, take the absolute value + value = -value; + + do //write least significant digit of value that's left + { + d = (value % radix); + buf[--c] = digit(d, radix); + value /= radix; + } while (value); + + if (original < 0) + buf[--c] = '-'; + + size = last - c + 1; //includes null at end + memcpy(dest, &buf[c], last - c + 1); + + return (size - 1); //without null termination +} + +int UTIL_ltoa(int64_t value, char *dest) +{ + return UTIL_ltoa_radix(value, dest, 10); +} + +int UTIL_itoa(int value, char *dest) +{ + return UTIL_ltoa_radix((int64_t)value, dest, 10); +} + +int UTIL_utoa(uint32_t value, char *dest) +{ + return UTIL_ltoa_radix((int64_t)value, dest, 10); +} + diff --git a/tmk_core/protocol/arm_atsam/usb/usb_util.h b/tmk_core/protocol/arm_atsam/usb/usb_util.h new file mode 100644 index 0000000000..2134d5d279 --- /dev/null +++ b/tmk_core/protocol/arm_atsam/usb/usb_util.h @@ -0,0 +1,10 @@ +#ifndef _USB_UTIL_H_ +#define _USB_UTIL_H_ + +int UTIL_ltoa_radix(int64_t value, char *dest, int radix); +int UTIL_ltoa(int64_t value, char *dest); +int UTIL_itoa(int value, char *dest); +int UTIL_utoa(uint32_t value, char *dest); + +#endif //_USB_UTIL_H_ + diff --git a/tmk_core/protocol/arm_atsam/wait_api.h b/tmk_core/protocol/arm_atsam/wait_api.h new file mode 100644 index 0000000000..424fbb53bb --- /dev/null +++ b/tmk_core/protocol/arm_atsam/wait_api.h @@ -0,0 +1,8 @@ +#ifndef _wait_api_h_ +#define _wait_api_h_ + +void wait_ms(uint64_t msec); +void wait_us(uint16_t usec); + +#endif + -- cgit v1.2.3 From 621ce29a53e9e94e085fbd86c0b7134e9df4bfe5 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 29 Aug 2018 23:14:49 +0300 Subject: STM32 EEPROM Emulation (#3741) * STM32 EEPROM Emulation - Added EEPROM emulation libaries from libmaple and Arduino_STM32. https://github.com/rogerclarkmelbourne/Arduino_STM32 and https://github.com/leaflabs/libmaple. - Renamed teensy EEPROM library and added conditional selection of library. - Remapped EEPROM memory map for 16 byte blocks (as is with STM32f3xx MCUs). - Added EEPROM initialization in main.c of Chibios. - Added EEPROM format to clear the emulated pages when EEPROM is marked as invalid. * Fixed ifdef --- tmk_core/common.mk | 7 +- tmk_core/common/chibios/eeprom.c | 632 ------------------------------ tmk_core/common/chibios/eeprom_stm32.c | 673 ++++++++++++++++++++++++++++++++ tmk_core/common/chibios/eeprom_stm32.h | 89 +++++ tmk_core/common/chibios/eeprom_teensy.c | 632 ++++++++++++++++++++++++++++++ tmk_core/common/chibios/flash_stm32.c | 180 +++++++++ tmk_core/common/chibios/flash_stm32.h | 53 +++ tmk_core/common/eeconfig.c | 11 + tmk_core/common/eeconfig.h | 16 + tmk_core/protocol/chibios/main.c | 7 + 10 files changed, 1667 insertions(+), 633 deletions(-) delete mode 100644 tmk_core/common/chibios/eeprom.c create mode 100755 tmk_core/common/chibios/eeprom_stm32.c create mode 100755 tmk_core/common/chibios/eeprom_stm32.h create mode 100644 tmk_core/common/chibios/eeprom_teensy.c create mode 100755 tmk_core/common/chibios/flash_stm32.c create mode 100755 tmk_core/common/chibios/flash_stm32.h diff --git a/tmk_core/common.mk b/tmk_core/common.mk index fd91d29dce..319d196aec 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -31,7 +31,12 @@ endif ifeq ($(PLATFORM),CHIBIOS) TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c - TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c + ifeq ($(MCU_SERIES), STM32F3xx) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + else + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c +endif ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c endif diff --git a/tmk_core/common/chibios/eeprom.c b/tmk_core/common/chibios/eeprom.c deleted file mode 100644 index 9061b790c4..0000000000 --- a/tmk_core/common/chibios/eeprom.c +++ /dev/null @@ -1,632 +0,0 @@ -#include "ch.h" -#include "hal.h" - -#include "eeconfig.h" - -/*************************************/ -/* Hardware backend */ -/* */ -/* Code from PJRC/Teensyduino */ -/*************************************/ - -/* Teensyduino Core Library - * http://www.pjrc.com/teensy/ - * Copyright (c) 2013 PJRC.COM, LLC. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * 1. The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * 2. If the Software is incorporated into a build system that allows - * selection among a list of target devices, then similar target - * devices manufactured by PJRC.COM must be included in the list of - * target devices and selectable in the same manner. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - */ - - -#if defined(K20x) /* chip selection */ -/* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ - -// The EEPROM is really RAM with a hardware-based backup system to -// flash memory. Selecting a smaller size EEPROM allows more wear -// leveling, for higher write endurance. If you edit this file, -// set this to the smallest size your application can use. Also, -// due to Freescale's implementation, writing 16 or 32 bit words -// (aligned to 2 or 4 byte boundaries) has twice the endurance -// compared to writing 8 bit bytes. -// -#define EEPROM_SIZE 32 - -// Writing unaligned 16 or 32 bit data is handled automatically when -// this is defined, but at a cost of extra code size. Without this, -// any unaligned write will cause a hard fault exception! If you're -// absolutely sure all 16 and 32 bit writes will be aligned, you can -// remove the extra unnecessary code. -// -#define HANDLE_UNALIGNED_WRITES - -// Minimum EEPROM Endurance -// ------------------------ -#if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word - #define EEESIZE 0x33 -#elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word - #define EEESIZE 0x34 -#elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word - #define EEESIZE 0x35 -#elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word - #define EEESIZE 0x36 -#elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word - #define EEESIZE 0x37 -#elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word - #define EEESIZE 0x38 -#elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word - #define EEESIZE 0x39 -#endif - -/** \brief eeprom initialization - * - * FIXME: needs doc - */ -void eeprom_initialize(void) -{ - uint32_t count=0; - uint16_t do_flash_cmd[] = { - 0xf06f, 0x037f, 0x7003, 0x7803, - 0xf013, 0x0f80, 0xd0fb, 0x4770}; - uint8_t status; - - if (FTFL->FCNFG & FTFL_FCNFG_RAMRDY) { - // FlexRAM is configured as traditional RAM - // We need to reconfigure for EEPROM usage - FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command - FTFL->FCCOB4 = EEESIZE; // EEPROM Size - FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup - __disable_irq(); - // do_flash_cmd() must execute from RAM. Luckily the C syntax is simple... - (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFL->FSTAT)); - __enable_irq(); - status = FTFL->FSTAT; - if (status & (FTFL_FSTAT_RDCOLERR|FTFL_FSTAT_ACCERR|FTFL_FSTAT_FPVIOL)) { - FTFL->FSTAT = (status & (FTFL_FSTAT_RDCOLERR|FTFL_FSTAT_ACCERR|FTFL_FSTAT_FPVIOL)); - return; // error - } - } - // wait for eeprom to become ready (is this really necessary?) - while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { - if (++count > 20000) break; - } -} - -#define FlexRAM ((uint8_t *)0x14000000) - -/** \brief eeprom read byte - * - * FIXME: needs doc - */ -uint8_t eeprom_read_byte(const uint8_t *addr) -{ - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return FlexRAM[offset]; -} - -/** \brief eeprom read word - * - * FIXME: needs doc - */ -uint16_t eeprom_read_word(const uint16_t *addr) -{ - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE-1) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return *(uint16_t *)(&FlexRAM[offset]); -} - -/** \brief eeprom read dword - * - * FIXME: needs doc - */ -uint32_t eeprom_read_dword(const uint32_t *addr) -{ - uint32_t offset = (uint32_t)addr; - if (offset >= EEPROM_SIZE-3) return 0; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - return *(uint32_t *)(&FlexRAM[offset]); -} - -/** \brief eeprom read block - * - * FIXME: needs doc - */ -void eeprom_read_block(void *buf, const void *addr, uint32_t len) -{ - uint32_t offset = (uint32_t)addr; - uint8_t *dest = (uint8_t *)buf; - uint32_t end = offset + len; - - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (end > EEPROM_SIZE) end = EEPROM_SIZE; - while (offset < end) { - *dest++ = FlexRAM[offset++]; - } -} - -/** \brief eeprom is ready - * - * FIXME: needs doc - */ -int eeprom_is_ready(void) -{ - return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; -} - -/** \brief flexram wait - * - * FIXME: needs doc - */ -static void flexram_wait(void) -{ - while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { - // TODO: timeout - } -} - -/** \brief eeprom_write_byte - * - * FIXME: needs doc - */ -void eeprom_write_byte(uint8_t *addr, uint8_t value) -{ - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } -} - -/** \brief eeprom write word - * - * FIXME: needs doc - */ -void eeprom_write_word(uint16_t *addr, uint16_t value) -{ - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE-1) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); -#ifdef HANDLE_UNALIGNED_WRITES - if ((offset & 1) == 0) { -#endif - if (*(uint16_t *)(&FlexRAM[offset]) != value) { - *(uint16_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } -#ifdef HANDLE_UNALIGNED_WRITES - } else { - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } - if (FlexRAM[offset + 1] != (value >> 8)) { - FlexRAM[offset + 1] = value >> 8; - flexram_wait(); - } - } -#endif -} - -/** \brief eeprom write dword - * - * FIXME: needs doc - */ -void eeprom_write_dword(uint32_t *addr, uint32_t value) -{ - uint32_t offset = (uint32_t)addr; - - if (offset >= EEPROM_SIZE-3) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); -#ifdef HANDLE_UNALIGNED_WRITES - switch (offset & 3) { - case 0: -#endif - if (*(uint32_t *)(&FlexRAM[offset]) != value) { - *(uint32_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } - return; -#ifdef HANDLE_UNALIGNED_WRITES - case 2: - if (*(uint16_t *)(&FlexRAM[offset]) != value) { - *(uint16_t *)(&FlexRAM[offset]) = value; - flexram_wait(); - } - if (*(uint16_t *)(&FlexRAM[offset + 2]) != (value >> 16)) { - *(uint16_t *)(&FlexRAM[offset + 2]) = value >> 16; - flexram_wait(); - } - return; - default: - if (FlexRAM[offset] != value) { - FlexRAM[offset] = value; - flexram_wait(); - } - if (*(uint16_t *)(&FlexRAM[offset + 1]) != (value >> 8)) { - *(uint16_t *)(&FlexRAM[offset + 1]) = value >> 8; - flexram_wait(); - } - if (FlexRAM[offset + 3] != (value >> 24)) { - FlexRAM[offset + 3] = value >> 24; - flexram_wait(); - } - } -#endif -} - -/** \brief eeprom write block - * - * FIXME: needs doc - */ -void eeprom_write_block(const void *buf, void *addr, uint32_t len) -{ - uint32_t offset = (uint32_t)addr; - const uint8_t *src = (const uint8_t *)buf; - - if (offset >= EEPROM_SIZE) return; - if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); - if (len >= EEPROM_SIZE) len = EEPROM_SIZE; - if (offset + len >= EEPROM_SIZE) len = EEPROM_SIZE - offset; - while (len > 0) { - uint32_t lsb = offset & 3; - if (lsb == 0 && len >= 4) { - // write aligned 32 bits - uint32_t val32; - val32 = *src++; - val32 |= (*src++ << 8); - val32 |= (*src++ << 16); - val32 |= (*src++ << 24); - if (*(uint32_t *)(&FlexRAM[offset]) != val32) { - *(uint32_t *)(&FlexRAM[offset]) = val32; - flexram_wait(); - } - offset += 4; - len -= 4; - } else if ((lsb == 0 || lsb == 2) && len >= 2) { - // write aligned 16 bits - uint16_t val16; - val16 = *src++; - val16 |= (*src++ << 8); - if (*(uint16_t *)(&FlexRAM[offset]) != val16) { - *(uint16_t *)(&FlexRAM[offset]) = val16; - flexram_wait(); - } - offset += 2; - len -= 2; - } else { - // write 8 bits - uint8_t val8 = *src++; - if (FlexRAM[offset] != val8) { - FlexRAM[offset] = val8; - flexram_wait(); - } - offset++; - len--; - } - } -} - -/* -void do_flash_cmd(volatile uint8_t *fstat) -{ - *fstat = 0x80; - while ((*fstat & 0x80) == 0) ; // wait -} -00000000 : - 0: f06f 037f mvn.w r3, #127 ; 0x7f - 4: 7003 strb r3, [r0, #0] - 6: 7803 ldrb r3, [r0, #0] - 8: f013 0f80 tst.w r3, #128 ; 0x80 - c: d0fb beq.n 6 - e: 4770 bx lr -*/ - -#elif defined(KL2x) /* chip selection */ -/* Teensy LC (emulated) */ - -#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) - -extern uint32_t __eeprom_workarea_start__; -extern uint32_t __eeprom_workarea_end__; - -#define EEPROM_SIZE 128 - -static uint32_t flashend = 0; - -void eeprom_initialize(void) -{ - const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); - - do { - if (*p++ == 0xFFFF) { - flashend = (uint32_t)(p - 2); - return; - } - } while (p < (uint16_t *)SYMVAL(__eeprom_workarea_end__)); - flashend = (uint32_t)((uint16_t *)SYMVAL(__eeprom_workarea_end__) - 1); -} - -uint8_t eeprom_read_byte(const uint8_t *addr) -{ - uint32_t offset = (uint32_t)addr; - const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); - const uint16_t *end = (const uint16_t *)((uint32_t)flashend); - uint16_t val; - uint8_t data=0xFF; - - if (!end) { - eeprom_initialize(); - end = (const uint16_t *)((uint32_t)flashend); - } - if (offset < EEPROM_SIZE) { - while (p <= end) { - val = *p++; - if ((val & 255) == offset) data = val >> 8; - } - } - return data; -} - -static void flash_write(const uint16_t *code, uint32_t addr, uint32_t data) -{ - // with great power comes great responsibility.... - uint32_t stat; - *(uint32_t *)&(FTFA->FCCOB3) = 0x06000000 | (addr & 0x00FFFFFC); - *(uint32_t *)&(FTFA->FCCOB7) = data; - __disable_irq(); - (*((void (*)(volatile uint8_t *))((uint32_t)code | 1)))(&(FTFA->FSTAT)); - __enable_irq(); - stat = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR|FTFA_FSTAT_ACCERR|FTFA_FSTAT_FPVIOL); - if (stat) { - FTFA->FSTAT = stat; - } - MCM->PLACR |= MCM_PLACR_CFCC; -} - -void eeprom_write_byte(uint8_t *addr, uint8_t data) -{ - uint32_t offset = (uint32_t)addr; - const uint16_t *p, *end = (const uint16_t *)((uint32_t)flashend); - uint32_t i, val, flashaddr; - uint16_t do_flash_cmd[] = { - 0x2380, 0x7003, 0x7803, 0xb25b, 0x2b00, 0xdafb, 0x4770}; - uint8_t buf[EEPROM_SIZE]; - - if (offset >= EEPROM_SIZE) return; - if (!end) { - eeprom_initialize(); - end = (const uint16_t *)((uint32_t)flashend); - } - if (++end < (uint16_t *)SYMVAL(__eeprom_workarea_end__)) { - val = (data << 8) | offset; - flashaddr = (uint32_t)end; - flashend = flashaddr; - if ((flashaddr & 2) == 0) { - val |= 0xFFFF0000; - } else { - val <<= 16; - val |= 0x0000FFFF; - } - flash_write(do_flash_cmd, flashaddr, val); - } else { - for (i=0; i < EEPROM_SIZE; i++) { - buf[i] = 0xFF; - } - val = 0; - for (p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); p < (uint16_t *)SYMVAL(__eeprom_workarea_end__); p++) { - val = *p; - if ((val & 255) < EEPROM_SIZE) { - buf[val & 255] = val >> 8; - } - } - buf[offset] = data; - for (flashaddr=(uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); flashaddr < (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_end__); flashaddr += 1024) { - *(uint32_t *)&(FTFA->FCCOB3) = 0x09000000 | flashaddr; - __disable_irq(); - (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFA->FSTAT)); - __enable_irq(); - val = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR|FTFA_FSTAT_ACCERR|FTFA_FSTAT_FPVIOL);; - if (val) FTFA->FSTAT = val; - MCM->PLACR |= MCM_PLACR_CFCC; - } - flashaddr=(uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); - for (i=0; i < EEPROM_SIZE; i++) { - if (buf[i] == 0xFF) continue; - if ((flashaddr & 2) == 0) { - val = (buf[i] << 8) | i; - } else { - val = val | (buf[i] << 24) | (i << 16); - flash_write(do_flash_cmd, flashaddr, val); - } - flashaddr += 2; - } - flashend = flashaddr; - if ((flashaddr & 2)) { - val |= 0xFFFF0000; - flash_write(do_flash_cmd, flashaddr, val); - } - } -} - -/* -void do_flash_cmd(volatile uint8_t *fstat) -{ - *fstat = 0x80; - while ((*fstat & 0x80) == 0) ; // wait -} -00000000 : - 0: 2380 movs r3, #128 ; 0x80 - 2: 7003 strb r3, [r0, #0] - 4: 7803 ldrb r3, [r0, #0] - 6: b25b sxtb r3, r3 - 8: 2b00 cmp r3, #0 - a: dafb bge.n 4 - c: 4770 bx lr -*/ - - -uint16_t eeprom_read_word(const uint16_t *addr) -{ - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8); -} - -uint32_t eeprom_read_dword(const uint32_t *addr) -{ - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8) - | (eeprom_read_byte(p+2) << 16) | (eeprom_read_byte(p+3) << 24); -} - -void eeprom_read_block(void *buf, const void *addr, uint32_t len) -{ - const uint8_t *p = (const uint8_t *)addr; - uint8_t *dest = (uint8_t *)buf; - while (len--) { - *dest++ = eeprom_read_byte(p++); - } -} - -int eeprom_is_ready(void) -{ - return 1; -} - -void eeprom_write_word(uint16_t *addr, uint16_t value) -{ - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_write_dword(uint32_t *addr, uint32_t value) -{ - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_write_block(const void *buf, void *addr, uint32_t len) -{ - uint8_t *p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} - -#else -// No EEPROM supported, so emulate it - -#define EEPROM_SIZE 32 -static uint8_t buffer[EEPROM_SIZE]; - -uint8_t eeprom_read_byte(const uint8_t *addr) { - uint32_t offset = (uint32_t)addr; - return buffer[offset]; -} - -void eeprom_write_byte(uint8_t *addr, uint8_t value) { - uint32_t offset = (uint32_t)addr; - buffer[offset] = value; -} - -uint16_t eeprom_read_word(const uint16_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8); -} - -uint32_t eeprom_read_dword(const uint32_t *addr) { - const uint8_t *p = (const uint8_t *)addr; - return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8) - | (eeprom_read_byte(p+2) << 16) | (eeprom_read_byte(p+3) << 24); -} - -void eeprom_read_block(void *buf, const void *addr, uint32_t len) { - const uint8_t *p = (const uint8_t *)addr; - uint8_t *dest = (uint8_t *)buf; - while (len--) { - *dest++ = eeprom_read_byte(p++); - } -} - -void eeprom_write_word(uint16_t *addr, uint16_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_write_dword(uint32_t *addr, uint32_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_write_block(const void *buf, void *addr, uint32_t len) { - uint8_t *p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} - -#endif /* chip selection */ -// The update functions just calls write for now, but could probably be optimized - -void eeprom_update_byte(uint8_t *addr, uint8_t value) { - eeprom_write_byte(addr, value); -} - -void eeprom_update_word(uint16_t *addr, uint16_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p, value >> 8); -} - -void eeprom_update_dword(uint32_t *addr, uint32_t value) { - uint8_t *p = (uint8_t *)addr; - eeprom_write_byte(p++, value); - eeprom_write_byte(p++, value >> 8); - eeprom_write_byte(p++, value >> 16); - eeprom_write_byte(p, value >> 24); -} - -void eeprom_update_block(const void *buf, void *addr, uint32_t len) { - uint8_t *p = (uint8_t *)addr; - const uint8_t *src = (const uint8_t *)buf; - while (len--) { - eeprom_write_byte(p++, *src++); - } -} diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/tmk_core/common/chibios/eeprom_stm32.c new file mode 100755 index 0000000000..3c19451223 --- /dev/null +++ b/tmk_core/common/chibios/eeprom_stm32.c @@ -0,0 +1,673 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +#include "eeprom_stm32.h" + + FLASH_Status EE_ErasePage(uint32_t); + + uint16_t EE_CheckPage(uint32_t, uint16_t); + uint16_t EE_CheckErasePage(uint32_t, uint16_t); + uint16_t EE_Format(void); + uint32_t EE_FindValidPage(void); + uint16_t EE_GetVariablesCount(uint32_t, uint16_t); + uint16_t EE_PageTransfer(uint32_t, uint32_t, uint16_t); + uint16_t EE_VerifyPageFullWriteVariable(uint16_t, uint16_t); + + uint32_t PageBase0 = EEPROM_PAGE0_BASE; + uint32_t PageBase1 = EEPROM_PAGE1_BASE; + uint32_t PageSize = EEPROM_PAGE_SIZE; + uint16_t Status = EEPROM_NOT_INIT; + +// See http://www.st.com/web/en/resource/technical/document/application_note/CD00165693.pdf + +/** + * @brief Check page for blank + * @param page base address + * @retval Success or error + * EEPROM_BAD_FLASH: page not empty after erase + * EEPROM_OK: page blank + */ +uint16_t EE_CheckPage(uint32_t pageBase, uint16_t status) +{ + uint32_t pageEnd = pageBase + (uint32_t)PageSize; + + // Page Status not EEPROM_ERASED and not a "state" + if ((*(__IO uint16_t*)pageBase) != EEPROM_ERASED && (*(__IO uint16_t*)pageBase) != status) + return EEPROM_BAD_FLASH; + for(pageBase += 4; pageBase < pageEnd; pageBase += 4) + if ((*(__IO uint32_t*)pageBase) != 0xFFFFFFFF) // Verify if slot is empty + return EEPROM_BAD_FLASH; + return EEPROM_OK; +} + +/** + * @brief Erase page with increment erase counter (page + 2) + * @param page base address + * @retval Success or error + * FLASH_COMPLETE: success erase + * - Flash error code: on write Flash error + */ +FLASH_Status EE_ErasePage(uint32_t pageBase) +{ + FLASH_Status FlashStatus; + uint16_t data = (*(__IO uint16_t*)(pageBase)); + if ((data == EEPROM_ERASED) || (data == EEPROM_VALID_PAGE) || (data == EEPROM_RECEIVE_DATA)) + data = (*(__IO uint16_t*)(pageBase + 2)) + 1; + else + data = 0; + + FlashStatus = FLASH_ErasePage(pageBase); + if (FlashStatus == FLASH_COMPLETE) + FlashStatus = FLASH_ProgramHalfWord(pageBase + 2, data); + + return FlashStatus; +} + +/** + * @brief Check page for blank and erase it + * @param page base address + * @retval Success or error + * - Flash error code: on write Flash error + * - EEPROM_BAD_FLASH: page not empty after erase + * - EEPROM_OK: page blank + */ +uint16_t EE_CheckErasePage(uint32_t pageBase, uint16_t status) +{ + uint16_t FlashStatus; + if (EE_CheckPage(pageBase, status) != EEPROM_OK) + { + FlashStatus = EE_ErasePage(pageBase); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + return EE_CheckPage(pageBase, status); + } + return EEPROM_OK; +} + +/** + * @brief Find valid Page for write or read operation + * @param Page0: Page0 base address + * Page1: Page1 base address + * @retval Valid page address (PAGE0 or PAGE1) or NULL in case of no valid page was found + */ +uint32_t EE_FindValidPage(void) +{ + uint16_t status0 = (*(__IO uint16_t*)PageBase0); // Get Page0 actual status + uint16_t status1 = (*(__IO uint16_t*)PageBase1); // Get Page1 actual status + + if (status0 == EEPROM_VALID_PAGE && status1 == EEPROM_ERASED) + return PageBase0; + if (status1 == EEPROM_VALID_PAGE && status0 == EEPROM_ERASED) + return PageBase1; + + return 0; +} + +/** + * @brief Calculate unique variables in EEPROM + * @param start: address of first slot to check (page + 4) + * @param end: page end address + * @param address: 16 bit virtual address of the variable to excluse (or 0XFFFF) + * @retval count of variables + */ +uint16_t EE_GetVariablesCount(uint32_t pageBase, uint16_t skipAddress) +{ + uint16_t varAddress, nextAddress; + uint32_t idx; + uint32_t pageEnd = pageBase + (uint32_t)PageSize; + uint16_t count = 0; + + for (pageBase += 6; pageBase < pageEnd; pageBase += 4) + { + varAddress = (*(__IO uint16_t*)pageBase); + if (varAddress == 0xFFFF || varAddress == skipAddress) + continue; + + count++; + for(idx = pageBase + 4; idx < pageEnd; idx += 4) + { + nextAddress = (*(__IO uint16_t*)idx); + if (nextAddress == varAddress) + { + count--; + break; + } + } + } + return count; +} + +/** + * @brief Transfers last updated variables data from the full Page to an empty one. + * @param newPage: new page base address + * @param oldPage: old page base address + * @param SkipAddress: 16 bit virtual address of the variable (or 0xFFFF) + * @retval Success or error status: + * - FLASH_COMPLETE: on success + * - EEPROM_OUT_SIZE: if valid new page is full + * - Flash error code: on write Flash error + */ +uint16_t EE_PageTransfer(uint32_t newPage, uint32_t oldPage, uint16_t SkipAddress) +{ + uint32_t oldEnd, newEnd; + uint32_t oldIdx, newIdx, idx; + uint16_t address, data, found; + FLASH_Status FlashStatus; + + // Transfer process: transfer variables from old to the new active page + newEnd = newPage + ((uint32_t)PageSize); + + // Find first free element in new page + for (newIdx = newPage + 4; newIdx < newEnd; newIdx += 4) + if ((*(__IO uint32_t*)newIdx) == 0xFFFFFFFF) // Verify if element + break; // contents are 0xFFFFFFFF + if (newIdx >= newEnd) + return EEPROM_OUT_SIZE; + + oldEnd = oldPage + 4; + oldIdx = oldPage + (uint32_t)(PageSize - 2); + + for (; oldIdx > oldEnd; oldIdx -= 4) + { + address = *(__IO uint16_t*)oldIdx; + if (address == 0xFFFF || address == SkipAddress) + continue; // it's means that power off after write data + + found = 0; + for (idx = newPage + 6; idx < newIdx; idx += 4) + if ((*(__IO uint16_t*)(idx)) == address) + { + found = 1; + break; + } + + if (found) + continue; + + if (newIdx < newEnd) + { + data = (*(__IO uint16_t*)(oldIdx - 2)); + + FlashStatus = FLASH_ProgramHalfWord(newIdx, data); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + FlashStatus = FLASH_ProgramHalfWord(newIdx + 2, address); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + newIdx += 4; + } + else + return EEPROM_OUT_SIZE; + } + + // Erase the old Page: Set old Page status to EEPROM_EEPROM_ERASED status + data = EE_CheckErasePage(oldPage, EEPROM_ERASED); + if (data != EEPROM_OK) + return data; + + // Set new Page status + FlashStatus = FLASH_ProgramHalfWord(newPage, EEPROM_VALID_PAGE); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + return EEPROM_OK; +} + +/** + * @brief Verify if active page is full and Writes variable in EEPROM. + * @param Address: 16 bit virtual address of the variable + * @param Data: 16 bit data to be written as variable value + * @retval Success or error status: + * - FLASH_COMPLETE: on success + * - EEPROM_PAGE_FULL: if valid page is full (need page transfer) + * - EEPROM_NO_VALID_PAGE: if no valid page was found + * - EEPROM_OUT_SIZE: if EEPROM size exceeded + * - Flash error code: on write Flash error + */ +uint16_t EE_VerifyPageFullWriteVariable(uint16_t Address, uint16_t Data) +{ + FLASH_Status FlashStatus; + uint32_t idx, pageBase, pageEnd, newPage; + uint16_t count; + + // Get valid Page for write operation + pageBase = EE_FindValidPage(); + if (pageBase == 0) + return EEPROM_NO_VALID_PAGE; + + // Get the valid Page end Address + pageEnd = pageBase + PageSize; // Set end of page + + for (idx = pageEnd - 2; idx > pageBase; idx -= 4) + { + if ((*(__IO uint16_t*)idx) == Address) // Find last value for address + { + count = (*(__IO uint16_t*)(idx - 2)); // Read last data + if (count == Data) + return EEPROM_OK; + if (count == 0xFFFF) + { + FlashStatus = FLASH_ProgramHalfWord(idx - 2, Data); // Set variable data + if (FlashStatus == FLASH_COMPLETE) + return EEPROM_OK; + } + break; + } + } + + // Check each active page address starting from begining + for (idx = pageBase + 4; idx < pageEnd; idx += 4) + if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element + { // contents are 0xFFFFFFFF + FlashStatus = FLASH_ProgramHalfWord(idx, Data); // Set variable data + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + FlashStatus = FLASH_ProgramHalfWord(idx + 2, Address); // Set variable virtual address + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + return EEPROM_OK; + } + + // Empty slot not found, need page transfer + // Calculate unique variables in page + count = EE_GetVariablesCount(pageBase, Address) + 1; + if (count >= (PageSize / 4 - 1)) + return EEPROM_OUT_SIZE; + + if (pageBase == PageBase1) + newPage = PageBase0; // New page address where variable will be moved to + else + newPage = PageBase1; + + // Set the new Page status to RECEIVE_DATA status + FlashStatus = FLASH_ProgramHalfWord(newPage, EEPROM_RECEIVE_DATA); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + // Write the variable passed as parameter in the new active page + FlashStatus = FLASH_ProgramHalfWord(newPage + 4, Data); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + FlashStatus = FLASH_ProgramHalfWord(newPage + 6, Address); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + + return EE_PageTransfer(newPage, pageBase, Address); +} + +/*EEPROMClass::EEPROMClass(void) +{ + PageBase0 = EEPROM_PAGE0_BASE; + PageBase1 = EEPROM_PAGE1_BASE; + PageSize = EEPROM_PAGE_SIZE; + Status = EEPROM_NOT_INIT; +}*/ +/* +uint16_t EEPROM_init(uint32_t pageBase0, uint32_t pageBase1, uint32_t pageSize) +{ + PageBase0 = pageBase0; + PageBase1 = pageBase1; + PageSize = pageSize; + return EEPROM_init(); +}*/ + +uint16_t EEPROM_init(void) +{ + uint16_t status0 = 6, status1 = 6; + FLASH_Status FlashStatus; + + FLASH_Unlock(); + Status = EEPROM_NO_VALID_PAGE; + + status0 = (*(__IO uint16_t *)PageBase0); + status1 = (*(__IO uint16_t *)PageBase1); + + switch (status0) + { +/* + Page0 Page1 + ----- ----- + EEPROM_ERASED EEPROM_VALID_PAGE Page1 valid, Page0 erased + EEPROM_RECEIVE_DATA Page1 need set to valid, Page0 erased + EEPROM_ERASED make EE_Format + any Error: EEPROM_NO_VALID_PAGE +*/ + case EEPROM_ERASED: + if (status1 == EEPROM_VALID_PAGE) // Page0 erased, Page1 valid + Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); + else if (status1 == EEPROM_RECEIVE_DATA) // Page0 erased, Page1 receive + { + FlashStatus = FLASH_ProgramHalfWord(PageBase1, EEPROM_VALID_PAGE); + if (FlashStatus != FLASH_COMPLETE) + Status = FlashStatus; + else + Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); + } + else if (status1 == EEPROM_ERASED) // Both in erased state so format EEPROM + Status = EEPROM_format(); + break; +/* + Page0 Page1 + ----- ----- + EEPROM_RECEIVE_DATA EEPROM_VALID_PAGE Transfer Page1 to Page0 + EEPROM_ERASED Page0 need set to valid, Page1 erased + any EEPROM_NO_VALID_PAGE +*/ + case EEPROM_RECEIVE_DATA: + if (status1 == EEPROM_VALID_PAGE) // Page0 receive, Page1 valid + Status = EE_PageTransfer(PageBase0, PageBase1, 0xFFFF); + else if (status1 == EEPROM_ERASED) // Page0 receive, Page1 erased + { + Status = EE_CheckErasePage(PageBase1, EEPROM_ERASED); + if (Status == EEPROM_OK) + { + FlashStatus = FLASH_ProgramHalfWord(PageBase0, EEPROM_VALID_PAGE); + if (FlashStatus != FLASH_COMPLETE) + Status = FlashStatus; + else + Status = EEPROM_OK; + } + } + break; +/* + Page0 Page1 + ----- ----- + EEPROM_VALID_PAGE EEPROM_VALID_PAGE Error: EEPROM_NO_VALID_PAGE + EEPROM_RECEIVE_DATA Transfer Page0 to Page1 + any Page0 valid, Page1 erased +*/ + case EEPROM_VALID_PAGE: + if (status1 == EEPROM_VALID_PAGE) // Both pages valid + Status = EEPROM_NO_VALID_PAGE; + else if (status1 == EEPROM_RECEIVE_DATA) + Status = EE_PageTransfer(PageBase1, PageBase0, 0xFFFF); + else + Status = EE_CheckErasePage(PageBase1, EEPROM_ERASED); + break; +/* + Page0 Page1 + ----- ----- + any EEPROM_VALID_PAGE Page1 valid, Page0 erased + EEPROM_RECEIVE_DATA Page1 valid, Page0 erased + any EEPROM_NO_VALID_PAGE +*/ + default: + if (status1 == EEPROM_VALID_PAGE) + Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); // Check/Erase Page0 + else if (status1 == EEPROM_RECEIVE_DATA) + { + FlashStatus = FLASH_ProgramHalfWord(PageBase1, EEPROM_VALID_PAGE); + if (FlashStatus != FLASH_COMPLETE) + Status = FlashStatus; + else + Status = EE_CheckErasePage(PageBase0, EEPROM_ERASED); + } + break; + } + return Status; +} + +/** + * @brief Erases PAGE0 and PAGE1 and writes EEPROM_VALID_PAGE / 0 header to PAGE0 + * @param PAGE0 and PAGE1 base addresses + * @retval Status of the last operation (Flash write or erase) done during EEPROM formating + */ +uint16_t EEPROM_format(void) +{ + uint16_t status; + FLASH_Status FlashStatus; + + FLASH_Unlock(); + + // Erase Page0 + status = EE_CheckErasePage(PageBase0, EEPROM_VALID_PAGE); + if (status != EEPROM_OK) + return status; + if ((*(__IO uint16_t*)PageBase0) == EEPROM_ERASED) + { + // Set Page0 as valid page: Write VALID_PAGE at Page0 base address + FlashStatus = FLASH_ProgramHalfWord(PageBase0, EEPROM_VALID_PAGE); + if (FlashStatus != FLASH_COMPLETE) + return FlashStatus; + } + // Erase Page1 + return EE_CheckErasePage(PageBase1, EEPROM_ERASED); +} + +/** + * @brief Returns the erase counter for current page + * @param Data: Global variable contains the read variable value + * @retval Success or error status: + * - EEPROM_OK: if erases counter return. + * - EEPROM_NO_VALID_PAGE: if no valid page was found. + */ +uint16_t EEPROM_erases(uint16_t *Erases) +{ + uint32_t pageBase; + if (Status != EEPROM_OK) + if (EEPROM_init() != EEPROM_OK) + return Status; + + // Get active Page for read operation + pageBase = EE_FindValidPage(); + if (pageBase == 0) + return EEPROM_NO_VALID_PAGE; + + *Erases = (*(__IO uint16_t*)pageBase+2); + return EEPROM_OK; +} + +/** + * @brief Returns the last stored variable data, if found, + * which correspond to the passed virtual address + * @param Address: Variable virtual address + * @retval Data for variable or EEPROM_DEFAULT_DATA, if any errors + */ +/* +uint16_t EEPROM_read (uint16_t Address) +{ + uint16_t data; + EEPROM_read(Address, &data); + return data; +}*/ + +/** + * @brief Returns the last stored variable data, if found, + * which correspond to the passed virtual address + * @param Address: Variable virtual address + * @param Data: Pointer to data variable + * @retval Success or error status: + * - EEPROM_OK: if variable was found + * - EEPROM_BAD_ADDRESS: if the variable was not found + * - EEPROM_NO_VALID_PAGE: if no valid page was found. + */ +uint16_t EEPROM_read(uint16_t Address, uint16_t *Data) +{ + uint32_t pageBase, pageEnd; + + // Set default data (empty EEPROM) + *Data = EEPROM_DEFAULT_DATA; + + if (Status == EEPROM_NOT_INIT) + if (EEPROM_init() != EEPROM_OK) + return Status; + + // Get active Page for read operation + pageBase = EE_FindValidPage(); + if (pageBase == 0) + return EEPROM_NO_VALID_PAGE; + + // Get the valid Page end Address + pageEnd = pageBase + ((uint32_t)(PageSize - 2)); + + // Check each active page address starting from end + for (pageBase += 6; pageEnd >= pageBase; pageEnd -= 4) + if ((*(__IO uint16_t*)pageEnd) == Address) // Compare the read address with the virtual address + { + *Data = (*(__IO uint16_t*)(pageEnd - 2)); // Get content of Address-2 which is variable value + return EEPROM_OK; + } + + // Return ReadStatus value: (0: variable exist, 1: variable doesn't exist) + return EEPROM_BAD_ADDRESS; +} + +/** + * @brief Writes/upadtes variable data in EEPROM. + * @param VirtAddress: Variable virtual address + * @param Data: 16 bit data to be written + * @retval Success or error status: + * - FLASH_COMPLETE: on success + * - EEPROM_BAD_ADDRESS: if address = 0xFFFF + * - EEPROM_PAGE_FULL: if valid page is full + * - EEPROM_NO_VALID_PAGE: if no valid page was found + * - EEPROM_OUT_SIZE: if no empty EEPROM variables + * - Flash error code: on write Flash error + */ +uint16_t EEPROM_write(uint16_t Address, uint16_t Data) +{ + if (Status == EEPROM_NOT_INIT) + if (EEPROM_init() != EEPROM_OK) + return Status; + + if (Address == 0xFFFF) + return EEPROM_BAD_ADDRESS; + + // Write the variable virtual address and value in the EEPROM + uint16_t status = EE_VerifyPageFullWriteVariable(Address, Data); + return status; +} + +/** + * @brief Writes/upadtes variable data in EEPROM. + The value is written only if differs from the one already saved at the same address. + * @param VirtAddress: Variable virtual address + * @param Data: 16 bit data to be written + * @retval Success or error status: + * - EEPROM_SAME_VALUE: If new Data matches existing EEPROM Data + * - FLASH_COMPLETE: on success + * - EEPROM_BAD_ADDRESS: if address = 0xFFFF + * - EEPROM_PAGE_FULL: if valid page is full + * - EEPROM_NO_VALID_PAGE: if no valid page was found + * - EEPROM_OUT_SIZE: if no empty EEPROM variables + * - Flash error code: on write Flash error + */ +uint16_t EEPROM_update(uint16_t Address, uint16_t Data) +{ + uint16_t temp; + EEPROM_read(Address, &temp); + if (Address == Data) + return EEPROM_SAME_VALUE; + else + return EEPROM_write(Address, Data); +} + +/** + * @brief Return number of variable + * @retval Number of variables + */ +uint16_t EEPROM_count(uint16_t *Count) +{ + if (Status == EEPROM_NOT_INIT) + if (EEPROM_init() != EEPROM_OK) + return Status; + + // Get valid Page for write operation + uint32_t pageBase = EE_FindValidPage(); + if (pageBase == 0) + return EEPROM_NO_VALID_PAGE; // No valid page, return max. numbers + + *Count = EE_GetVariablesCount(pageBase, 0xFFFF); + return EEPROM_OK; +} + +uint16_t EEPROM_maxcount(void) +{ + return ((PageSize / 4)-1); +} + + +uint8_t eeprom_read_byte (const uint8_t *Address) +{ + const uint16_t p = (const uint32_t) Address; + uint16_t temp; + EEPROM_read(p, &temp); + return (uint8_t) temp; +} + +void eeprom_write_byte (uint8_t *Address, uint8_t Value) +{ + uint16_t p = (uint32_t) Address; + EEPROM_write(p, (uint16_t) Value); +} + +void eeprom_update_byte (uint8_t *Address, uint8_t Value) +{ + uint16_t p = (uint32_t) Address; + EEPROM_update(p, (uint16_t) Value); +} + +uint16_t eeprom_read_word (const uint16_t *Address) +{ + const uint16_t p = (const uint32_t) Address; + uint16_t temp; + EEPROM_read(p, &temp); + return temp; +} + +void eeprom_write_word (uint16_t *Address, uint16_t Value) +{ + uint16_t p = (uint32_t) Address; + EEPROM_write(p, Value); +} + +void eeprom_update_word (uint16_t *Address, uint16_t Value) +{ + uint16_t p = (uint32_t) Address; + EEPROM_update(p, Value); +} + +uint32_t eeprom_read_dword (const uint32_t *Address) +{ + const uint16_t p = (const uint32_t) Address; + uint16_t temp1, temp2; + EEPROM_read(p, &temp1); + EEPROM_read(p + 1, &temp2); + return temp1 | (temp2 << 16); +} + +void eeprom_write_dword (uint32_t *Address, uint32_t Value) +{ + uint16_t temp = (uint16_t) Value; + uint16_t p = (uint32_t) Address; + EEPROM_write(p, temp); + temp = (uint16_t) (Value >> 16); + EEPROM_write(p + 1, temp); +} + +void eeprom_update_dword (uint32_t *Address, uint32_t Value) +{ + uint16_t temp = (uint16_t) Value; + uint16_t p = (uint32_t) Address; + EEPROM_update(p, temp); + temp = (uint16_t) (Value >> 16); + EEPROM_update(p + 1, temp); +} diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h new file mode 100755 index 0000000000..d06d302665 --- /dev/null +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -0,0 +1,89 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +// This file must be modified if the MCU is not defined below. +// This library also assumes that the pages are not used by the firmware. + +#ifndef __EEPROM_H +#define __EEPROM_H + +#include "ch.h" +#include "hal.h" +#include "flash_stm32.h" + +// HACK ALERT. This definition may not match your processor +// To Do. Work out correct value for EEPROM_PAGE_SIZE on the STM32F103CT6 etc +#define MCU_STM32F303CC + +#ifndef EEPROM_PAGE_SIZE + #if defined (MCU_STM32F103RB) + #define EEPROM_PAGE_SIZE (uint16_t)0x400 /* Page size = 1KByte */ + #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) + #define EEPROM_PAGE_SIZE (uint16_t)0x800 /* Page size = 2KByte */ + #else + #error "No MCU type specified. Add something like -DMCU_STM32F103RB to your compiler arguments (probably in a Makefile)." + #endif +#endif + +#ifndef EEPROM_START_ADDRESS + #if defined (MCU_STM32F103RB) + #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 128 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) + #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 512 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #elif defined (MCU_STM32F103RD) + #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 384 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #elif defined (MCU_STM32F303CC) + #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 250 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #else + #error "No MCU type specified. Add something like -DMCU_STM32F103RB to your compiler arguments (probably in a Makefile)." + #endif +#endif + +/* Pages 0 and 1 base and end addresses */ +#define EEPROM_PAGE0_BASE ((uint32_t)(EEPROM_START_ADDRESS + 0x000)) +#define EEPROM_PAGE1_BASE ((uint32_t)(EEPROM_START_ADDRESS + EEPROM_PAGE_SIZE)) + +/* Page status definitions */ +#define EEPROM_ERASED ((uint16_t)0xFFFF) /* PAGE is empty */ +#define EEPROM_RECEIVE_DATA ((uint16_t)0xEEEE) /* PAGE is marked to receive data */ +#define EEPROM_VALID_PAGE ((uint16_t)0x0000) /* PAGE containing valid data */ + +/* Page full define */ +enum uint16_t + { + EEPROM_OK = ((uint16_t)0x0000), + EEPROM_OUT_SIZE = ((uint16_t)0x0081), + EEPROM_BAD_ADDRESS = ((uint16_t)0x0082), + EEPROM_BAD_FLASH = ((uint16_t)0x0083), + EEPROM_NOT_INIT = ((uint16_t)0x0084), + EEPROM_SAME_VALUE = ((uint16_t)0x0085), + EEPROM_NO_VALID_PAGE = ((uint16_t)0x00AB) + }; + +#define EEPROM_DEFAULT_DATA 0xFFFF + + uint16_t EEPROM_init(void); + uint16_t EEPROM_format(void); + uint16_t EEPROM_erases(uint16_t *); + uint16_t EEPROM_read (uint16_t address, uint16_t *data); + uint16_t EEPROM_write(uint16_t address, uint16_t data); + uint16_t EEPROM_update(uint16_t address, uint16_t data); + uint16_t EEPROM_count(uint16_t *); + uint16_t EEPROM_maxcount(void); + +#endif /* __EEPROM_H */ diff --git a/tmk_core/common/chibios/eeprom_teensy.c b/tmk_core/common/chibios/eeprom_teensy.c new file mode 100644 index 0000000000..9061b790c4 --- /dev/null +++ b/tmk_core/common/chibios/eeprom_teensy.c @@ -0,0 +1,632 @@ +#include "ch.h" +#include "hal.h" + +#include "eeconfig.h" + +/*************************************/ +/* Hardware backend */ +/* */ +/* Code from PJRC/Teensyduino */ +/*************************************/ + +/* Teensyduino Core Library + * http://www.pjrc.com/teensy/ + * Copyright (c) 2013 PJRC.COM, LLC. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * 1. The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * 2. If the Software is incorporated into a build system that allows + * selection among a list of target devices, then similar target + * devices manufactured by PJRC.COM must be included in the list of + * target devices and selectable in the same manner. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + + +#if defined(K20x) /* chip selection */ +/* Teensy 3.0, 3.1, 3.2; mchck; infinity keyboard */ + +// The EEPROM is really RAM with a hardware-based backup system to +// flash memory. Selecting a smaller size EEPROM allows more wear +// leveling, for higher write endurance. If you edit this file, +// set this to the smallest size your application can use. Also, +// due to Freescale's implementation, writing 16 or 32 bit words +// (aligned to 2 or 4 byte boundaries) has twice the endurance +// compared to writing 8 bit bytes. +// +#define EEPROM_SIZE 32 + +// Writing unaligned 16 or 32 bit data is handled automatically when +// this is defined, but at a cost of extra code size. Without this, +// any unaligned write will cause a hard fault exception! If you're +// absolutely sure all 16 and 32 bit writes will be aligned, you can +// remove the extra unnecessary code. +// +#define HANDLE_UNALIGNED_WRITES + +// Minimum EEPROM Endurance +// ------------------------ +#if (EEPROM_SIZE == 2048) // 35000 writes/byte or 70000 writes/word + #define EEESIZE 0x33 +#elif (EEPROM_SIZE == 1024) // 75000 writes/byte or 150000 writes/word + #define EEESIZE 0x34 +#elif (EEPROM_SIZE == 512) // 155000 writes/byte or 310000 writes/word + #define EEESIZE 0x35 +#elif (EEPROM_SIZE == 256) // 315000 writes/byte or 630000 writes/word + #define EEESIZE 0x36 +#elif (EEPROM_SIZE == 128) // 635000 writes/byte or 1270000 writes/word + #define EEESIZE 0x37 +#elif (EEPROM_SIZE == 64) // 1275000 writes/byte or 2550000 writes/word + #define EEESIZE 0x38 +#elif (EEPROM_SIZE == 32) // 2555000 writes/byte or 5110000 writes/word + #define EEESIZE 0x39 +#endif + +/** \brief eeprom initialization + * + * FIXME: needs doc + */ +void eeprom_initialize(void) +{ + uint32_t count=0; + uint16_t do_flash_cmd[] = { + 0xf06f, 0x037f, 0x7003, 0x7803, + 0xf013, 0x0f80, 0xd0fb, 0x4770}; + uint8_t status; + + if (FTFL->FCNFG & FTFL_FCNFG_RAMRDY) { + // FlexRAM is configured as traditional RAM + // We need to reconfigure for EEPROM usage + FTFL->FCCOB0 = 0x80; // PGMPART = Program Partition Command + FTFL->FCCOB4 = EEESIZE; // EEPROM Size + FTFL->FCCOB5 = 0x03; // 0K for Dataflash, 32K for EEPROM backup + __disable_irq(); + // do_flash_cmd() must execute from RAM. Luckily the C syntax is simple... + (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFL->FSTAT)); + __enable_irq(); + status = FTFL->FSTAT; + if (status & (FTFL_FSTAT_RDCOLERR|FTFL_FSTAT_ACCERR|FTFL_FSTAT_FPVIOL)) { + FTFL->FSTAT = (status & (FTFL_FSTAT_RDCOLERR|FTFL_FSTAT_ACCERR|FTFL_FSTAT_FPVIOL)); + return; // error + } + } + // wait for eeprom to become ready (is this really necessary?) + while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { + if (++count > 20000) break; + } +} + +#define FlexRAM ((uint8_t *)0x14000000) + +/** \brief eeprom read byte + * + * FIXME: needs doc + */ +uint8_t eeprom_read_byte(const uint8_t *addr) +{ + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return FlexRAM[offset]; +} + +/** \brief eeprom read word + * + * FIXME: needs doc + */ +uint16_t eeprom_read_word(const uint16_t *addr) +{ + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE-1) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return *(uint16_t *)(&FlexRAM[offset]); +} + +/** \brief eeprom read dword + * + * FIXME: needs doc + */ +uint32_t eeprom_read_dword(const uint32_t *addr) +{ + uint32_t offset = (uint32_t)addr; + if (offset >= EEPROM_SIZE-3) return 0; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + return *(uint32_t *)(&FlexRAM[offset]); +} + +/** \brief eeprom read block + * + * FIXME: needs doc + */ +void eeprom_read_block(void *buf, const void *addr, uint32_t len) +{ + uint32_t offset = (uint32_t)addr; + uint8_t *dest = (uint8_t *)buf; + uint32_t end = offset + len; + + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (end > EEPROM_SIZE) end = EEPROM_SIZE; + while (offset < end) { + *dest++ = FlexRAM[offset++]; + } +} + +/** \brief eeprom is ready + * + * FIXME: needs doc + */ +int eeprom_is_ready(void) +{ + return (FTFL->FCNFG & FTFL_FCNFG_EEERDY) ? 1 : 0; +} + +/** \brief flexram wait + * + * FIXME: needs doc + */ +static void flexram_wait(void) +{ + while (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) { + // TODO: timeout + } +} + +/** \brief eeprom_write_byte + * + * FIXME: needs doc + */ +void eeprom_write_byte(uint8_t *addr, uint8_t value) +{ + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } +} + +/** \brief eeprom write word + * + * FIXME: needs doc + */ +void eeprom_write_word(uint16_t *addr, uint16_t value) +{ + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE-1) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); +#ifdef HANDLE_UNALIGNED_WRITES + if ((offset & 1) == 0) { +#endif + if (*(uint16_t *)(&FlexRAM[offset]) != value) { + *(uint16_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } +#ifdef HANDLE_UNALIGNED_WRITES + } else { + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } + if (FlexRAM[offset + 1] != (value >> 8)) { + FlexRAM[offset + 1] = value >> 8; + flexram_wait(); + } + } +#endif +} + +/** \brief eeprom write dword + * + * FIXME: needs doc + */ +void eeprom_write_dword(uint32_t *addr, uint32_t value) +{ + uint32_t offset = (uint32_t)addr; + + if (offset >= EEPROM_SIZE-3) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); +#ifdef HANDLE_UNALIGNED_WRITES + switch (offset & 3) { + case 0: +#endif + if (*(uint32_t *)(&FlexRAM[offset]) != value) { + *(uint32_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } + return; +#ifdef HANDLE_UNALIGNED_WRITES + case 2: + if (*(uint16_t *)(&FlexRAM[offset]) != value) { + *(uint16_t *)(&FlexRAM[offset]) = value; + flexram_wait(); + } + if (*(uint16_t *)(&FlexRAM[offset + 2]) != (value >> 16)) { + *(uint16_t *)(&FlexRAM[offset + 2]) = value >> 16; + flexram_wait(); + } + return; + default: + if (FlexRAM[offset] != value) { + FlexRAM[offset] = value; + flexram_wait(); + } + if (*(uint16_t *)(&FlexRAM[offset + 1]) != (value >> 8)) { + *(uint16_t *)(&FlexRAM[offset + 1]) = value >> 8; + flexram_wait(); + } + if (FlexRAM[offset + 3] != (value >> 24)) { + FlexRAM[offset + 3] = value >> 24; + flexram_wait(); + } + } +#endif +} + +/** \brief eeprom write block + * + * FIXME: needs doc + */ +void eeprom_write_block(const void *buf, void *addr, uint32_t len) +{ + uint32_t offset = (uint32_t)addr; + const uint8_t *src = (const uint8_t *)buf; + + if (offset >= EEPROM_SIZE) return; + if (!(FTFL->FCNFG & FTFL_FCNFG_EEERDY)) eeprom_initialize(); + if (len >= EEPROM_SIZE) len = EEPROM_SIZE; + if (offset + len >= EEPROM_SIZE) len = EEPROM_SIZE - offset; + while (len > 0) { + uint32_t lsb = offset & 3; + if (lsb == 0 && len >= 4) { + // write aligned 32 bits + uint32_t val32; + val32 = *src++; + val32 |= (*src++ << 8); + val32 |= (*src++ << 16); + val32 |= (*src++ << 24); + if (*(uint32_t *)(&FlexRAM[offset]) != val32) { + *(uint32_t *)(&FlexRAM[offset]) = val32; + flexram_wait(); + } + offset += 4; + len -= 4; + } else if ((lsb == 0 || lsb == 2) && len >= 2) { + // write aligned 16 bits + uint16_t val16; + val16 = *src++; + val16 |= (*src++ << 8); + if (*(uint16_t *)(&FlexRAM[offset]) != val16) { + *(uint16_t *)(&FlexRAM[offset]) = val16; + flexram_wait(); + } + offset += 2; + len -= 2; + } else { + // write 8 bits + uint8_t val8 = *src++; + if (FlexRAM[offset] != val8) { + FlexRAM[offset] = val8; + flexram_wait(); + } + offset++; + len--; + } + } +} + +/* +void do_flash_cmd(volatile uint8_t *fstat) +{ + *fstat = 0x80; + while ((*fstat & 0x80) == 0) ; // wait +} +00000000 : + 0: f06f 037f mvn.w r3, #127 ; 0x7f + 4: 7003 strb r3, [r0, #0] + 6: 7803 ldrb r3, [r0, #0] + 8: f013 0f80 tst.w r3, #128 ; 0x80 + c: d0fb beq.n 6 + e: 4770 bx lr +*/ + +#elif defined(KL2x) /* chip selection */ +/* Teensy LC (emulated) */ + +#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0)) + +extern uint32_t __eeprom_workarea_start__; +extern uint32_t __eeprom_workarea_end__; + +#define EEPROM_SIZE 128 + +static uint32_t flashend = 0; + +void eeprom_initialize(void) +{ + const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); + + do { + if (*p++ == 0xFFFF) { + flashend = (uint32_t)(p - 2); + return; + } + } while (p < (uint16_t *)SYMVAL(__eeprom_workarea_end__)); + flashend = (uint32_t)((uint16_t *)SYMVAL(__eeprom_workarea_end__) - 1); +} + +uint8_t eeprom_read_byte(const uint8_t *addr) +{ + uint32_t offset = (uint32_t)addr; + const uint16_t *p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); + const uint16_t *end = (const uint16_t *)((uint32_t)flashend); + uint16_t val; + uint8_t data=0xFF; + + if (!end) { + eeprom_initialize(); + end = (const uint16_t *)((uint32_t)flashend); + } + if (offset < EEPROM_SIZE) { + while (p <= end) { + val = *p++; + if ((val & 255) == offset) data = val >> 8; + } + } + return data; +} + +static void flash_write(const uint16_t *code, uint32_t addr, uint32_t data) +{ + // with great power comes great responsibility.... + uint32_t stat; + *(uint32_t *)&(FTFA->FCCOB3) = 0x06000000 | (addr & 0x00FFFFFC); + *(uint32_t *)&(FTFA->FCCOB7) = data; + __disable_irq(); + (*((void (*)(volatile uint8_t *))((uint32_t)code | 1)))(&(FTFA->FSTAT)); + __enable_irq(); + stat = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR|FTFA_FSTAT_ACCERR|FTFA_FSTAT_FPVIOL); + if (stat) { + FTFA->FSTAT = stat; + } + MCM->PLACR |= MCM_PLACR_CFCC; +} + +void eeprom_write_byte(uint8_t *addr, uint8_t data) +{ + uint32_t offset = (uint32_t)addr; + const uint16_t *p, *end = (const uint16_t *)((uint32_t)flashend); + uint32_t i, val, flashaddr; + uint16_t do_flash_cmd[] = { + 0x2380, 0x7003, 0x7803, 0xb25b, 0x2b00, 0xdafb, 0x4770}; + uint8_t buf[EEPROM_SIZE]; + + if (offset >= EEPROM_SIZE) return; + if (!end) { + eeprom_initialize(); + end = (const uint16_t *)((uint32_t)flashend); + } + if (++end < (uint16_t *)SYMVAL(__eeprom_workarea_end__)) { + val = (data << 8) | offset; + flashaddr = (uint32_t)end; + flashend = flashaddr; + if ((flashaddr & 2) == 0) { + val |= 0xFFFF0000; + } else { + val <<= 16; + val |= 0x0000FFFF; + } + flash_write(do_flash_cmd, flashaddr, val); + } else { + for (i=0; i < EEPROM_SIZE; i++) { + buf[i] = 0xFF; + } + val = 0; + for (p = (uint16_t *)SYMVAL(__eeprom_workarea_start__); p < (uint16_t *)SYMVAL(__eeprom_workarea_end__); p++) { + val = *p; + if ((val & 255) < EEPROM_SIZE) { + buf[val & 255] = val >> 8; + } + } + buf[offset] = data; + for (flashaddr=(uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); flashaddr < (uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_end__); flashaddr += 1024) { + *(uint32_t *)&(FTFA->FCCOB3) = 0x09000000 | flashaddr; + __disable_irq(); + (*((void (*)(volatile uint8_t *))((uint32_t)do_flash_cmd | 1)))(&(FTFA->FSTAT)); + __enable_irq(); + val = FTFA->FSTAT & (FTFA_FSTAT_RDCOLERR|FTFA_FSTAT_ACCERR|FTFA_FSTAT_FPVIOL);; + if (val) FTFA->FSTAT = val; + MCM->PLACR |= MCM_PLACR_CFCC; + } + flashaddr=(uint32_t)(uint16_t *)SYMVAL(__eeprom_workarea_start__); + for (i=0; i < EEPROM_SIZE; i++) { + if (buf[i] == 0xFF) continue; + if ((flashaddr & 2) == 0) { + val = (buf[i] << 8) | i; + } else { + val = val | (buf[i] << 24) | (i << 16); + flash_write(do_flash_cmd, flashaddr, val); + } + flashaddr += 2; + } + flashend = flashaddr; + if ((flashaddr & 2)) { + val |= 0xFFFF0000; + flash_write(do_flash_cmd, flashaddr, val); + } + } +} + +/* +void do_flash_cmd(volatile uint8_t *fstat) +{ + *fstat = 0x80; + while ((*fstat & 0x80) == 0) ; // wait +} +00000000 : + 0: 2380 movs r3, #128 ; 0x80 + 2: 7003 strb r3, [r0, #0] + 4: 7803 ldrb r3, [r0, #0] + 6: b25b sxtb r3, r3 + 8: 2b00 cmp r3, #0 + a: dafb bge.n 4 + c: 4770 bx lr +*/ + + +uint16_t eeprom_read_word(const uint16_t *addr) +{ + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8); +} + +uint32_t eeprom_read_dword(const uint32_t *addr) +{ + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8) + | (eeprom_read_byte(p+2) << 16) | (eeprom_read_byte(p+3) << 24); +} + +void eeprom_read_block(void *buf, const void *addr, uint32_t len) +{ + const uint8_t *p = (const uint8_t *)addr; + uint8_t *dest = (uint8_t *)buf; + while (len--) { + *dest++ = eeprom_read_byte(p++); + } +} + +int eeprom_is_ready(void) +{ + return 1; +} + +void eeprom_write_word(uint16_t *addr, uint16_t value) +{ + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_write_dword(uint32_t *addr, uint32_t value) +{ + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_write_block(const void *buf, void *addr, uint32_t len) +{ + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} + +#else +// No EEPROM supported, so emulate it + +#define EEPROM_SIZE 32 +static uint8_t buffer[EEPROM_SIZE]; + +uint8_t eeprom_read_byte(const uint8_t *addr) { + uint32_t offset = (uint32_t)addr; + return buffer[offset]; +} + +void eeprom_write_byte(uint8_t *addr, uint8_t value) { + uint32_t offset = (uint32_t)addr; + buffer[offset] = value; +} + +uint16_t eeprom_read_word(const uint16_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8); +} + +uint32_t eeprom_read_dword(const uint32_t *addr) { + const uint8_t *p = (const uint8_t *)addr; + return eeprom_read_byte(p) | (eeprom_read_byte(p+1) << 8) + | (eeprom_read_byte(p+2) << 16) | (eeprom_read_byte(p+3) << 24); +} + +void eeprom_read_block(void *buf, const void *addr, uint32_t len) { + const uint8_t *p = (const uint8_t *)addr; + uint8_t *dest = (uint8_t *)buf; + while (len--) { + *dest++ = eeprom_read_byte(p++); + } +} + +void eeprom_write_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_write_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_write_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} + +#endif /* chip selection */ +// The update functions just calls write for now, but could probably be optimized + +void eeprom_update_byte(uint8_t *addr, uint8_t value) { + eeprom_write_byte(addr, value); +} + +void eeprom_update_word(uint16_t *addr, uint16_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p, value >> 8); +} + +void eeprom_update_dword(uint32_t *addr, uint32_t value) { + uint8_t *p = (uint8_t *)addr; + eeprom_write_byte(p++, value); + eeprom_write_byte(p++, value >> 8); + eeprom_write_byte(p++, value >> 16); + eeprom_write_byte(p, value >> 24); +} + +void eeprom_update_block(const void *buf, void *addr, uint32_t len) { + uint8_t *p = (uint8_t *)addr; + const uint8_t *src = (const uint8_t *)buf; + while (len--) { + eeprom_write_byte(p++, *src++); + } +} diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c new file mode 100755 index 0000000000..e7199ac7b1 --- /dev/null +++ b/tmk_core/common/chibios/flash_stm32.c @@ -0,0 +1,180 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +#define STM32F303xC + +#include "stm32f3xx.h" +#include "flash_stm32.h" + +#define FLASH_KEY1 ((uint32_t)0x45670123) +#define FLASH_KEY2 ((uint32_t)0xCDEF89AB) + +/* Delay definition */ +#define EraseTimeout ((uint32_t)0x00000FFF) +#define ProgramTimeout ((uint32_t)0x0000001F) + +#define ASSERT(exp) (void)((0)) + +/** + * @brief Inserts a time delay. + * @param None + * @retval None + */ +static void delay(void) +{ + __IO uint32_t i = 0; + for(i = 0xFF; i != 0; i--) { } +} + +/** + * @brief Returns the FLASH Status. + * @param None + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP or FLASH_COMPLETE + */ +FLASH_Status FLASH_GetStatus(void) +{ + if ((FLASH->SR & FLASH_SR_BSY) == FLASH_SR_BSY) + return FLASH_BUSY; + + if ((FLASH->SR & FLASH_SR_PGERR) != 0) + return FLASH_ERROR_PG; + + if ((FLASH->SR & FLASH_SR_WRPERR) != 0 ) + return FLASH_ERROR_WRP; + + if ((FLASH->SR & FLASH_OBR_OPTERR) != 0 ) + return FLASH_ERROR_OPT; + + return FLASH_COMPLETE; +} + +/** + * @brief Waits for a Flash operation to complete or a TIMEOUT to occur. + * @param Timeout: FLASH progamming Timeout + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) +{ + FLASH_Status status; + + /* Check for the Flash Status */ + status = FLASH_GetStatus(); + /* Wait for a Flash operation to complete or a TIMEOUT to occur */ + while ((status == FLASH_BUSY) && (Timeout != 0x00)) + { + delay(); + status = FLASH_GetStatus(); + Timeout--; + } + if (Timeout == 0) + status = FLASH_TIMEOUT; + /* Return the operation status */ + return status; +} + +/** + * @brief Erases a specified FLASH page. + * @param Page_Address: The page address to be erased. + * @retval FLASH Status: The returned value can be: FLASH_BUSY, FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ErasePage(uint32_t Page_Address) +{ + FLASH_Status status = FLASH_COMPLETE; + /* Check the parameters */ + ASSERT(IS_FLASH_ADDRESS(Page_Address)); + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to erase the page */ + FLASH->CR |= FLASH_CR_PER; + FLASH->AR = Page_Address; + FLASH->CR |= FLASH_CR_STRT; + + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(EraseTimeout); + if(status != FLASH_TIMEOUT) + { + /* if the erase operation is completed, disable the PER Bit */ + FLASH->CR &= ~FLASH_CR_PER; + } + FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); + } + /* Return the Erase Status */ + return status; +} + +/** + * @brief Programs a half word at a specified address. + * @param Address: specifies the address to be programmed. + * @param Data: specifies the data to be programmed. + * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + */ +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) +{ + FLASH_Status status = FLASH_BAD_ADDRESS; + + if (IS_FLASH_ADDRESS(Address)) + { + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if(status == FLASH_COMPLETE) + { + /* if the previous operation is completed, proceed to program the new data */ + FLASH->CR |= FLASH_CR_PG; + *(__IO uint16_t*)Address = Data; + /* Wait for last operation to be completed */ + status = FLASH_WaitForLastOperation(ProgramTimeout); + if(status != FLASH_TIMEOUT) + { + /* if the program operation is completed, disable the PG Bit */ + FLASH->CR &= ~FLASH_CR_PG; + } + FLASH->SR = (FLASH_SR_EOP | FLASH_SR_PGERR | FLASH_SR_WRPERR); + } + } + return status; +} + +/** + * @brief Unlocks the FLASH Program Erase Controller. + * @param None + * @retval None + */ +void FLASH_Unlock(void) +{ + /* Authorize the FPEC Access */ + FLASH->KEYR = FLASH_KEY1; + FLASH->KEYR = FLASH_KEY2; +} + +/** + * @brief Locks the FLASH Program Erase Controller. + * @param None + * @retval None + */ +void FLASH_Lock(void) +{ + /* Set the Lock Bit to lock the FPEC and the FCR */ + FLASH->CR |= FLASH_CR_LOCK; +} diff --git a/tmk_core/common/chibios/flash_stm32.h b/tmk_core/common/chibios/flash_stm32.h new file mode 100755 index 0000000000..cc065cbca2 --- /dev/null +++ b/tmk_core/common/chibios/flash_stm32.h @@ -0,0 +1,53 @@ +/* + * This software is experimental and a work in progress. + * Under no circumstances should these files be used in relation to any critical system(s). + * Use of these files is at your own risk. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR + * PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + * + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * https://github.com/leaflabs/libmaple + * + * Modifications for QMK and STM32F303 by Yiancar + */ + +#ifndef __FLASH_STM32_H +#define __FLASH_STM32_H + +#ifdef __cplusplus + extern "C" { +#endif + +#include "ch.h" +#include "hal.h" + +typedef enum + { + FLASH_BUSY = 1, + FLASH_ERROR_PG, + FLASH_ERROR_WRP, + FLASH_ERROR_OPT, + FLASH_COMPLETE, + FLASH_TIMEOUT, + FLASH_BAD_ADDRESS + } FLASH_Status; + +#define IS_FLASH_ADDRESS(ADDRESS) (((ADDRESS) >= 0x08000000) && ((ADDRESS) < 0x0807FFFF)) + +FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout); +FLASH_Status FLASH_ErasePage(uint32_t Page_Address); +FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data); + +void FLASH_Unlock(void); +void FLASH_Lock(void); + +#ifdef __cplusplus +} +#endif + +#endif /* __FLASH_STM32_H */ diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 3e5987ee3b..35de574a96 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c @@ -3,12 +3,20 @@ #include "eeprom.h" #include "eeconfig.h" +#ifdef STM32F303xC +#include "hal.h" +#include "eeprom_stm32.h" +#endif + /** \brief eeconfig initialization * * FIXME: needs doc */ void eeconfig_init(void) { +#ifdef STM32F303xC + EEPROM_format(); +#endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); eeprom_update_byte(EECONFIG_DEBUG, 0); eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); @@ -43,6 +51,9 @@ void eeconfig_enable(void) */ void eeconfig_disable(void) { +#ifdef STM32F303xC + EEPROM_format(); +#endif eeprom_update_word(EECONFIG_MAGIC, 0xFFFF); } diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 1397a90c79..fa498df48c 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -25,6 +25,7 @@ along with this program. If not, see . #define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEED /* eeprom parameteter address */ +#if !defined(STM32F303xC) #define EECONFIG_MAGIC (uint16_t *)0 #define EECONFIG_DEBUG (uint8_t *)2 #define EECONFIG_DEFAULT_LAYER (uint8_t *)3 @@ -38,6 +39,21 @@ along with this program. If not, see . // EEHANDS for two handed boards #define EECONFIG_HANDEDNESS (uint8_t *)14 +#else +/* STM32F3 uses 16byte block. Reconfigure memory map */ +#define EECONFIG_MAGIC (uint16_t *)0 +#define EECONFIG_DEBUG (uint8_t *)1 +#define EECONFIG_DEFAULT_LAYER (uint8_t *)2 +#define EECONFIG_KEYMAP (uint8_t *)3 +#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)4 +#define EECONFIG_BACKLIGHT (uint8_t *)5 +#define EECONFIG_AUDIO (uint8_t *)6 +#define EECONFIG_RGBLIGHT (uint32_t *)7 +#define EECONFIG_UNICODEMODE (uint8_t *)9 +#define EECONFIG_STENOMODE (uint8_t *)10 +// EEHANDS for two handed boards +#define EECONFIG_HANDEDNESS (uint8_t *)11 +#endif /* debug bit */ #define EECONFIG_DEBUG_ENABLE (1<<0) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index f2abc438d4..568c1edb28 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -44,6 +44,9 @@ #ifdef MIDI_ENABLE #include "qmk_midi.h" #endif +#ifdef STM32F303xC +#include "eeprom_stm32.h" +#endif #include "suspend.h" #include "wait.h" @@ -109,6 +112,10 @@ int main(void) { halInit(); chSysInit(); +#ifdef STM32F303xC + EEPROM_init(); +#endif + // TESTING // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); -- cgit v1.2.3 From 6794a5c9dcf12c7b528c46dfd48d8f7157bc585f Mon Sep 17 00:00:00 2001 From: mechmerlin Date: Wed, 29 Aug 2018 13:27:03 -0700 Subject: move massdrop boards into its own directory for configurator visibility --- keyboards/alt67/alt67.h | 24 --- keyboards/alt67/config.h | 79 --------- keyboards/alt67/config_led.h | 178 ------------------- keyboards/alt67/keymaps/default/keymap.c | 200 --------------------- keyboards/alt67/led_programs.c | 120 ------------- keyboards/alt67/matrix.c | 182 ------------------- keyboards/alt67/matrix.h | 77 -------- keyboards/alt67/readme.md | 15 -- keyboards/alt67/rules.mk | 32 ---- keyboards/ctrl/config.h | 79 --------- keyboards/ctrl/config_led.h | 191 -------------------- keyboards/ctrl/ctrl.h | 32 ---- keyboards/ctrl/keymaps/default/keymap.c | 203 ---------------------- keyboards/ctrl/led_programs.c | 120 ------------- keyboards/ctrl/matrix.c | 182 ------------------- keyboards/ctrl/matrix.h | 77 -------- keyboards/ctrl/readme.md | 15 -- keyboards/ctrl/rules.mk | 32 ---- keyboards/massdrop/alt67/alt67.h | 24 +++ keyboards/massdrop/alt67/config.h | 79 +++++++++ keyboards/massdrop/alt67/config_led.h | 178 +++++++++++++++++++ keyboards/massdrop/alt67/keymaps/default/keymap.c | 200 +++++++++++++++++++++ keyboards/massdrop/alt67/led_programs.c | 120 +++++++++++++ keyboards/massdrop/alt67/matrix.c | 182 +++++++++++++++++++ keyboards/massdrop/alt67/matrix.h | 77 ++++++++ keyboards/massdrop/alt67/readme.md | 15 ++ keyboards/massdrop/alt67/rules.mk | 32 ++++ keyboards/massdrop/ctrl/config.h | 79 +++++++++ keyboards/massdrop/ctrl/config_led.h | 191 ++++++++++++++++++++ keyboards/massdrop/ctrl/ctrl.h | 32 ++++ keyboards/massdrop/ctrl/keymaps/default/keymap.c | 203 ++++++++++++++++++++++ keyboards/massdrop/ctrl/led_programs.c | 120 +++++++++++++ keyboards/massdrop/ctrl/matrix.c | 182 +++++++++++++++++++ keyboards/massdrop/ctrl/matrix.h | 77 ++++++++ keyboards/massdrop/ctrl/readme.md | 15 ++ keyboards/massdrop/ctrl/rules.mk | 32 ++++ 36 files changed, 1838 insertions(+), 1838 deletions(-) delete mode 100644 keyboards/alt67/alt67.h delete mode 100644 keyboards/alt67/config.h delete mode 100644 keyboards/alt67/config_led.h delete mode 100644 keyboards/alt67/keymaps/default/keymap.c delete mode 100644 keyboards/alt67/led_programs.c delete mode 100644 keyboards/alt67/matrix.c delete mode 100644 keyboards/alt67/matrix.h delete mode 100644 keyboards/alt67/readme.md delete mode 100644 keyboards/alt67/rules.mk delete mode 100644 keyboards/ctrl/config.h delete mode 100644 keyboards/ctrl/config_led.h delete mode 100644 keyboards/ctrl/ctrl.h delete mode 100644 keyboards/ctrl/keymaps/default/keymap.c delete mode 100644 keyboards/ctrl/led_programs.c delete mode 100644 keyboards/ctrl/matrix.c delete mode 100644 keyboards/ctrl/matrix.h delete mode 100644 keyboards/ctrl/readme.md delete mode 100644 keyboards/ctrl/rules.mk create mode 100644 keyboards/massdrop/alt67/alt67.h create mode 100644 keyboards/massdrop/alt67/config.h create mode 100644 keyboards/massdrop/alt67/config_led.h create mode 100644 keyboards/massdrop/alt67/keymaps/default/keymap.c create mode 100644 keyboards/massdrop/alt67/led_programs.c create mode 100644 keyboards/massdrop/alt67/matrix.c create mode 100644 keyboards/massdrop/alt67/matrix.h create mode 100644 keyboards/massdrop/alt67/readme.md create mode 100644 keyboards/massdrop/alt67/rules.mk create mode 100644 keyboards/massdrop/ctrl/config.h create mode 100644 keyboards/massdrop/ctrl/config_led.h create mode 100644 keyboards/massdrop/ctrl/ctrl.h create mode 100644 keyboards/massdrop/ctrl/keymaps/default/keymap.c create mode 100644 keyboards/massdrop/ctrl/led_programs.c create mode 100644 keyboards/massdrop/ctrl/matrix.c create mode 100644 keyboards/massdrop/ctrl/matrix.h create mode 100644 keyboards/massdrop/ctrl/readme.md create mode 100644 keyboards/massdrop/ctrl/rules.mk diff --git a/keyboards/alt67/alt67.h b/keyboards/alt67/alt67.h deleted file mode 100644 index 387985512b..0000000000 --- a/keyboards/alt67/alt67.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "config_led.h" -#include "matrix.h" - -#include "i2c_master.h" -#include "led_matrix.h" //For led keycodes -#include "usb/udi_cdc.h" -#include "usb/usb2422.h" - -#define LAYOUT( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ - K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ - K61, K62, K63, K64, K65, K66, K67 \ -) { \ - { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, }, \ - { K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, }, \ - { K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, KC_NO, K43, K44, }, \ - { K45, KC_NO, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, }, \ - { K59, K60, K61, KC_NO, KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K63, K64, K65, K66, K67, }, \ -} diff --git a/keyboards/alt67/config.h b/keyboards/alt67/config.h deleted file mode 100644 index c67ae7d432..0000000000 --- a/keyboards/alt67/config.h +++ /dev/null @@ -1,79 +0,0 @@ -/* -Copyright 2015 Jun Wako - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x04D8 -#define PRODUCT_ID 0xEED3 -#define DEVICE_VER 0x0101 - -#define MANUFACTURER "Massdrop Inc." -#define PRODUCT "ALT67 Keyboard" -#define SERIAL_NUM "Unavailable" - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -#define PA 0 -#define PB 1 - -#define MATRIX_ROW_PORTS PA, PA, PA, PA, PA -#define MATRIX_ROW_PINS 0, 1, 2, 3, 4 - -#define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA -#define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 - -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Force boot in NKRO mode */ -//#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/alt67/config_led.h b/keyboards/alt67/config_led.h deleted file mode 100644 index a049e38179..0000000000 --- a/keyboards/alt67/config_led.h +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#ifndef _config_led_h_ -#define _config_led_h_ - -//Define number of ISSI3733 drivers being used (1...16) -#define ISSI3733_DRIVER_COUNT 2 - -//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) -#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } - -//LED I2C bus speed -#define I2C_HZ 580000 - -//Count of LED bodies -#define ISSI3733_LED_COUNT 105 - -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - -#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus -#define LED_GCR_STEP 10 //GCR increment/decrement value - -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - -#define ANIMATION_SPEED_STEP 1 - -#define BREATHE_MIN_STEP 0 -#define BREATHE_MAX_STEP 255 - -//LED Mapping - More practically generated from a spreadsheet program -//id: ID of the LED (Sync with PCB callouts) -//x: Physical X coordinate of LED (units do not matter) -//y: Physical Y coordinate of LED (units do not matter) -//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES -//cs: Matrix wiring CS col (1-16) -//swr: Matrix wiring SW Red row (1-12) -//swg: Matrix wiring SW Green row (1-12) -//swb: Matrix wiring SW Blue row (1-12) -//scan: Associated key scancode if any -//Note: Origin 0,0 may be located anywhere as the software will do the final layout -#define ISSI3733_LED_MAP { \ - { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ - { .id = 2, .x = 0.75, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ - { .id = 3, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ - { .id = 4, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ - { .id = 5, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 4 }, \ - { .id = 6, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ - { .id = 7, .x = 4.5, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ - { .id = 8, .x = 5.25, .y = 0, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \ - { .id = 9, .x = 6, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 8 }, \ - { .id = 10, .x = 6.75, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 9 }, \ - { .id = 11, .x = 7.5, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 10 }, \ - { .id = 12, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 11 }, \ - { .id = 13, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \ - { .id = 14, .x = 10.125, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 13 }, \ - { .id = 15, .x = 11.25, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 14 }, \ - { .id = 16, .x = 0.188, .y = -0.75, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 15 }, \ - { .id = 17, .x = 1.125, .y = -0.75, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ - { .id = 18, .x = 1.875, .y = -0.75, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ - { .id = 19, .x = 2.625, .y = -0.75, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ - { .id = 20, .x = 3.375, .y = -0.75, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ - { .id = 21, .x = 4.125, .y = -0.75, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ - { .id = 22, .x = 4.875, .y = -0.75, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ - { .id = 23, .x = 5.625, .y = -0.75, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ - { .id = 24, .x = 6.375, .y = -0.75, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \ - { .id = 25, .x = 7.125, .y = -0.75, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \ - { .id = 26, .x = 7.875, .y = -0.75, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \ - { .id = 27, .x = 8.625, .y = -0.75, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 26 }, \ - { .id = 28, .x = 9.375, .y = -0.75, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ - { .id = 29, .x = 10.313, .y = -0.75, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 28 }, \ - { .id = 30, .x = 11.25, .y = -0.75, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ - { .id = 31, .x = 0.281, .y = -1.5, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 30 }, \ - { .id = 32, .x = 1.313, .y = -1.5, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ - { .id = 33, .x = 2.063, .y = -1.5, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ - { .id = 34, .x = 2.813, .y = -1.5, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ - { .id = 35, .x = 3.563, .y = -1.5, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ - { .id = 36, .x = 4.313, .y = -1.5, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ - { .id = 37, .x = 5.063, .y = -1.5, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ - { .id = 38, .x = 5.813, .y = -1.5, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ - { .id = 39, .x = 6.563, .y = -1.5, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \ - { .id = 40, .x = 7.313, .y = -1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \ - { .id = 41, .x = 8.063, .y = -1.5, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ - { .id = 42, .x = 8.813, .y = -1.5, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 41 }, \ - { .id = 43, .x = 10.031, .y = -1.5, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 43 }, \ - { .id = 44, .x = 11.25, .y = -1.5, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 44 }, \ - { .id = 45, .x = 0.469, .y = -2.25, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \ - { .id = 46, .x = 1.688, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ - { .id = 47, .x = 2.438, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 48 }, \ - { .id = 48, .x = 3.188, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ - { .id = 49, .x = 3.938, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \ - { .id = 50, .x = 4.688, .y = -2.25, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ - { .id = 51, .x = 5.438, .y = -2.25, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ - { .id = 52, .x = 6.188, .y = -2.25, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \ - { .id = 53, .x = 6.938, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 54 }, \ - { .id = 54, .x = 7.688, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 55 }, \ - { .id = 55, .x = 8.438, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ - { .id = 56, .x = 9.469, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \ - { .id = 57, .x = 10.5, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \ - { .id = 58, .x = 11.25, .y = -2.25, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 59 }, \ - { .id = 59, .x = 0.094, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ - { .id = 60, .x = 1.031, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ - { .id = 61, .x = 1.969, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \ - { .id = 62, .x = 4.781, .y = -3, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 66 }, \ - { .id = 63, .x = 7.594, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 70 }, \ - { .id = 64, .x = 8.531, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 71 }, \ - { .id = 65, .x = 9.75, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 72 }, \ - { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ - { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ - { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ -}; - - -#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality -#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) - #define USB_LED_NUM_LOCK_SCANCODE 255 - #define USB_LED_CAPS_LOCK_SCANCODE 30 - #define USB_LED_SCROLL_LOCK_SCANCODE 255 - #define USB_LED_COMPOSE_SCANCODE 255 - #define USB_LED_KANA_SCANCODE 255 -#endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/alt67/keymaps/default/keymap.c b/keyboards/alt67/keymaps/default/keymap.c deleted file mode 100644 index 8b77da55a6..0000000000 --- a/keyboards/alt67/keymaps/default/keymap.c +++ /dev/null @@ -1,200 +0,0 @@ -#include QMK_KEYBOARD_H - -enum alt67_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints -}; - -#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode - -keymap_config_t keymap_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, 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_DEL, \ - 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_HOME, \ - 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_PGUP, \ - KC_LSFT, 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_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - [1] = LAYOUT( - KC_TRNS, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ - ), - /* - [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - */ -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; - -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; - case U_T_AUTO: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case U_T_AGCR: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_TOG: - if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MTRX: - if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_KBD: - if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MOU: - if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - default: - return true; //Process all other keycodes normally - } -} \ No newline at end of file diff --git a/keyboards/alt67/led_programs.c b/keyboards/alt67/led_programs.c deleted file mode 100644 index a8aab28d98..0000000000 --- a/keyboards/alt67/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "alt67.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/alt67/matrix.c b/keyboards/alt67/matrix.c deleted file mode 100644 index e107b4c22c..0000000000 --- a/keyboards/alt67/matrix.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "alt67.h" - -#include "d51_util.h" -#include "debug.h" -#include "clks.h" -#include - -matrix_row_t mlatest[MATRIX_ROWS]; -matrix_row_t mlast[MATRIX_ROWS]; -matrix_row_t mdebounced[MATRIX_ROWS]; - -uint8_t row_ports[] = { MATRIX_ROW_PORTS }; -uint8_t row_pins[] = { MATRIX_ROW_PINS }; -uint8_t col_ports[] = { MATRIX_COL_PORTS }; -uint8_t col_pins[] = { MATRIX_COL_PINS }; -uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate - -__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) { -} - -void matrix_init(void) -{ - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - - row_masks[PA] = 0; - row_masks[PB] = 0; - - uint8_t row; - for (row = 0; row < MATRIX_ROWS; row++) - { - PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input - PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable - row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask - } - - uint8_t col; - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low - } - - matrix_init_quantum(); -} - -#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) - -uint64_t mdebouncing = 0; -uint8_t matrix_scan(void) -{ - uint8_t mchanged; - uint8_t row; - uint8_t col; - uint32_t scans[2]; //PA PB - - if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - - //m15_off; //Profiling scans - - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer - - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output - - CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output - - scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data - scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data - - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output - - for (row = 0; row < MATRIX_ROWS; row++) - { - //Move scan bits from scans array into proper row bit locations - if (scans[row_ports[row]] & (1 << row_pins[row])) - mlatest[row] |= 1 << col; - } - } - - mchanged = 0; //Default to no matrix change since last - - for (row = 0; row < MATRIX_ROWS; row++) - { - if (mlast[row] != mlatest[row]) - mchanged = 1; - mlast[row] = mlatest[row]; - } - - if (!mchanged) - { - for (row = 0; row < MATRIX_ROWS; row++) - mdebounced[row] = mlatest[row]; - mdebouncing = 0; - } - else - { - //Begin or extend debounce on change - mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; - } - - //m15_on; //Profiling scans - - matrix_scan_quantum(); - - return 1; -} - -matrix_row_t matrix_get_row(uint8_t row) -{ - return mdebounced[row]; -} - -void matrix_print(void) -{ - char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; - char *pbuf = buf+3; - uint32_t cols; - uint32_t rows; - matrix_row_t row; - - for (cols = 1; cols <= MATRIX_COLS; cols++) - { - *pbuf = (cols%10)+48; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - - for (rows = 1; rows <= MATRIX_ROWS; rows++) - { - row = matrix_get_row(rows-1); - if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } - else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } - for (cols = 0; cols < MATRIX_COLS; cols++) - { - if (row & 1 << cols) *pbuf = 'X'; - else *pbuf = '.'; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - } - *pbuf = 0; - dprint(buf); -} diff --git a/keyboards/alt67/matrix.h b/keyboards/alt67/matrix.h deleted file mode 100644 index 3eab6dece1..0000000000 --- a/keyboards/alt67/matrix.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2011 Jun Wako - -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 . -*/ -#ifndef MATRIX_H -#define MATRIX_H - -#include -#include -#include "keyboard.h" - -#if (MATRIX_COLS <= 8) -typedef uint8_t matrix_row_t; -#elif (MATRIX_COLS <= 16) -typedef uint16_t matrix_row_t; -#elif (MATRIX_COLS <= 32) -typedef uint32_t matrix_row_t; -#else -#error "MATRIX_COLS: invalid value" -#endif - -#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x04D8 -#define PRODUCT_ID 0xEED2 -#define DEVICE_VER 0x0101 - -#define MANUFACTURER "Massdrop Inc." -#define PRODUCT "CTRL Keyboard" -#define SERIAL_NUM "Unavailable" - -/* key matrix size */ -#define MATRIX_ROWS 11 -#define MATRIX_COLS 8 - -#define PA 0 -#define PB 1 - -#define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB -#define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12 - -#define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA -#define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7 - -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Force boot in NKRO mode */ -//#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/ctrl/config_led.h b/keyboards/ctrl/config_led.h deleted file mode 100644 index 65563daa3d..0000000000 --- a/keyboards/ctrl/config_led.h +++ /dev/null @@ -1,191 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#ifndef _config_led_h_ -#define _config_led_h_ - -//Define number of ISSI3733 drivers being used (1...16) -#define ISSI3733_DRIVER_COUNT 2 - -//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) -#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } - -//LED I2C bus speed -#define I2C_HZ 580000 - -//Count of LED bodies -#define ISSI3733_LED_COUNT 119 - -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - -#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus -#define LED_GCR_STEP 10 //GCR increment/decrement value - -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - -#define ANIMATION_SPEED_STEP 1 - -#define BREATHE_MIN_STEP 0 -#define BREATHE_MAX_STEP 255 - -//LED Mapping - More practically generated from a spreadsheet program -//id: ID of the LED (Sync with PCB callouts) -//x: Physical X coordinate of LED (units do not matter) -//y: Physical Y coordinate of LED (units do not matter) -//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES -//cs: Matrix wiring CS col (1-16) -//swr: Matrix wiring SW Red row (1-12) -//swg: Matrix wiring SW Green row (1-12) -//swb: Matrix wiring SW Blue row (1-12) -//scan: Associated key scancode if any -//Note: Origin 0,0 may be located anywhere as the software will do the final layout -#define ISSI3733_LED_MAP { \ - { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ - { .id = 2, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ - { .id = 3, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ - { .id = 4, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ - { .id = 5, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 4 }, \ - { .id = 6, .x = 4.875, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ - { .id = 7, .x = 5.625, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ - { .id = 8, .x = 6.375, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 7 }, \ - { .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 90 }, \ - { .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 91 }, \ - { .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 92 }, \ - { .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 93 }, \ - { .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 94 }, \ - { .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 95 }, \ - { .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 96 }, \ - { .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 97 }, \ - { .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \ - { .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ - { .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ - { .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ - { .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ - { .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ - { .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ - { .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ - { .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 105 }, \ - { .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 106 }, \ - { .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 107 }, \ - { .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 108 }, \ - { .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 109 }, \ - { .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 110 }, \ - { .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 111 }, \ - { .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 112 }, \ - { .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 142 }, \ - { .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \ - { .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ - { .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ - { .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ - { .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ - { .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ - { .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ - { .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ - { .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 120 }, \ - { .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 121 }, \ - { .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 122 }, \ - { .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 123 }, \ - { .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 124 }, \ - { .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 125 }, \ - { .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 126 }, \ - { .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 127 }, \ - { .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 141 }, \ - { .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \ - { .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \ - { .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 47 }, \ - { .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \ - { .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ - { .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \ - { .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ - { .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ - { .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 135 }, \ - { .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 136 }, \ - { .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 137 }, \ - { .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 138 }, \ - { .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 139 }, \ - { .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 60 }, \ - { .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ - { .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \ - { .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 63 }, \ - { .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 64 }, \ - { .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 65 }, \ - { .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 66 }, \ - { .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 67 }, \ - { .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 150 }, \ - { .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 151 }, \ - { .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 152 }, \ - { .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 153 }, \ - { .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 140 }, \ - { .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \ - { .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 76 }, \ - { .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \ - { .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 78 }, \ - { .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 79 }, \ - { .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 80 }, \ - { .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 81 }, \ - { .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 82 }, \ - { .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 154 }, \ - { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 155 }, \ - { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 156 }, \ - { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 92, .x = 8.85, .y = -4.535, .adr = { .drv = 1, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 94, .x = 6.56, .y = -4.535, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 96, .x = 4.27, .y = -4.535, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 98, .x = 1.98, .y = -4.535, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 100, .x = -0.307, .y = -4.43, .adr = { .drv = 2, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 102, .x = -0.41, .y = -2.06, .adr = { .drv = 2, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 104, .x = -0.308, .y = 0.31, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 106, .x = 1.98, .y = 0.415, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 108, .x = 4.27, .y = 0.415, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 110, .x = 6.56, .y = 0.415, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 112, .x = 8.85, .y = 0.415, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 114, .x = 11.14, .y = 0.415, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 116, .x = 13.432, .y = 0.31, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 118, .x = 13.535, .y = -2.06, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ -}; - -#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality -#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) - #define USB_LED_NUM_LOCK_SCANCODE 255 - #define USB_LED_CAPS_LOCK_SCANCODE 45 - #define USB_LED_SCROLL_LOCK_SCANCODE 96 - #define USB_LED_COMPOSE_SCANCODE 255 - #define USB_LED_KANA_SCANCODE 255 -#endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/ctrl/ctrl.h b/keyboards/ctrl/ctrl.h deleted file mode 100644 index dc7c7eabe5..0000000000 --- a/keyboards/ctrl/ctrl.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "quantum.h" -#include "config_led.h" -#include "matrix.h" - -#include "i2c_master.h" -#include "led_matrix.h" //For led keycodes -#include "usb/udi_cdc.h" -#include "usb/usb2422.h" - -#define LAYOUT( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ - K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ - K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ - K61, K62, K63, K64, K65, K66, K67, K68, K69, K70, K71, K72, K73, K74, K75, \ - K76, K77, K78, K79, K80, K81, K82, K83, K84, K85, K86, K87 \ - \ -) { \ - { K01, K02, K03, K04, K05, K06, K07, K08 }, \ - { K17, K18, K19, K20, K21, K22, K23, K24 }, \ - { K34, K35, K36, K37, K38, K39, K40, K41 }, \ - { K51, K52, K53, K54, K55, K56, K57, K58 }, \ - { K64, K65, K66, K67, K68, K69, K70, K71 }, \ - { K77, K78, K79, K80, K81, K82, K83, K84 }, \ - { K09, K10, K11, K12, K13, K14, K15, K16 }, \ - { K25, K26, K27, K28, K29, K30, K31, K32 }, \ - { K42, K43, K44, K45, K46, K47, K48, K49 }, \ - { K59, K60, K61, K62, K63, K76, K50, K33 }, \ - { K72, K73, K74, K75, K85, K86, K87, }, \ -} diff --git a/keyboards/ctrl/keymaps/default/keymap.c b/keyboards/ctrl/keymaps/default/keymap.c deleted file mode 100644 index 8e84d4fee5..0000000000 --- a/keyboards/ctrl/keymaps/default/keymap.c +++ /dev/null @@ -1,203 +0,0 @@ -#include QMK_KEYBOARD_H - -enum alt67_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints -}; - -#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode - -keymap_config_t keymap_config; - -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_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_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, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ - ), - [1] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - /* - [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - */ -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; - -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; - case U_T_AUTO: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case U_T_AGCR: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_TOG: - if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MTRX: - if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_KBD: - if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MOU: - if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - default: - return true; //Process all other keycodes normally - } -} \ No newline at end of file diff --git a/keyboards/ctrl/led_programs.c b/keyboards/ctrl/led_programs.c deleted file mode 100644 index ca27016454..0000000000 --- a/keyboards/ctrl/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "ctrl.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/ctrl/matrix.c b/keyboards/ctrl/matrix.c deleted file mode 100644 index 6f306962e6..0000000000 --- a/keyboards/ctrl/matrix.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "ctrl.h" - -#include "d51_util.h" -#include "debug.h" -#include "clks.h" -#include - -matrix_row_t mlatest[MATRIX_ROWS]; -matrix_row_t mlast[MATRIX_ROWS]; -matrix_row_t mdebounced[MATRIX_ROWS]; - -uint8_t row_ports[] = { MATRIX_ROW_PORTS }; -uint8_t row_pins[] = { MATRIX_ROW_PINS }; -uint8_t col_ports[] = { MATRIX_COL_PORTS }; -uint8_t col_pins[] = { MATRIX_COL_PINS }; -uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate - -__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) { -} - -void matrix_init(void) -{ - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - - row_masks[PA] = 0; - row_masks[PB] = 0; - - uint8_t row; - for (row = 0; row < MATRIX_ROWS; row++) - { - PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input - PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable - row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask - } - - uint8_t col; - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low - } - - matrix_init_quantum(); -} - -#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) - -uint64_t mdebouncing = 0; -uint8_t matrix_scan(void) -{ - uint8_t mchanged; - uint8_t row; - uint8_t col; - uint32_t scans[2]; //PA PB - - if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - - //m15_off; //Profiling scans - - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer - - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output - - CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output - - scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data - scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data - - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output - - for (row = 0; row < MATRIX_ROWS; row++) - { - //Move scan bits from scans array into proper row bit locations - if (scans[row_ports[row]] & (1 << row_pins[row])) - mlatest[row] |= 1 << col; - } - } - - mchanged = 0; //Default to no matrix change since last - - for (row = 0; row < MATRIX_ROWS; row++) - { - if (mlast[row] != mlatest[row]) - mchanged = 1; - mlast[row] = mlatest[row]; - } - - if (!mchanged) - { - for (row = 0; row < MATRIX_ROWS; row++) - mdebounced[row] = mlatest[row]; - mdebouncing = 0; - } - else - { - //Begin or extend debounce on change - mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; - } - - //m15_on; //Profiling scans - - matrix_scan_quantum(); - - return 1; -} - -matrix_row_t matrix_get_row(uint8_t row) -{ - return mdebounced[row]; -} - -void matrix_print(void) -{ - char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; - char *pbuf = buf+3; - uint32_t cols; - uint32_t rows; - matrix_row_t row; - - for (cols = 1; cols <= MATRIX_COLS; cols++) - { - *pbuf = (cols%10)+48; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - - for (rows = 1; rows <= MATRIX_ROWS; rows++) - { - row = matrix_get_row(rows-1); - if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } - else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } - for (cols = 0; cols < MATRIX_COLS; cols++) - { - if (row & 1 << cols) *pbuf = 'X'; - else *pbuf = '.'; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - } - *pbuf = 0; - dprint(buf); -} diff --git a/keyboards/ctrl/matrix.h b/keyboards/ctrl/matrix.h deleted file mode 100644 index 3eab6dece1..0000000000 --- a/keyboards/ctrl/matrix.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2011 Jun Wako - -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 . -*/ -#ifndef MATRIX_H -#define MATRIX_H - -#include -#include -#include "keyboard.h" - -#if (MATRIX_COLS <= 8) -typedef uint8_t matrix_row_t; -#elif (MATRIX_COLS <= 16) -typedef uint16_t matrix_row_t; -#elif (MATRIX_COLS <= 32) -typedef uint32_t matrix_row_t; -#else -#error "MATRIX_COLS: invalid value" -#endif - -#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEED3 +#define DEVICE_VER 0x0101 + +#define MANUFACTURER "Massdrop Inc." +#define PRODUCT "ALT67 Keyboard" +#define SERIAL_NUM "Unavailable" + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define PA 0 +#define PB 1 + +#define MATRIX_ROW_PORTS PA, PA, PA, PA, PA +#define MATRIX_ROW_PINS 0, 1, 2, 3, 4 + +#define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA +#define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 + +/* Print boot debug codes using debug LED when M28 and M30 shorted */ +#define DEBUG_BOOT_TRACING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Force boot in NKRO mode */ +//#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/massdrop/alt67/config_led.h b/keyboards/massdrop/alt67/config_led.h new file mode 100644 index 0000000000..a049e38179 --- /dev/null +++ b/keyboards/massdrop/alt67/config_led.h @@ -0,0 +1,178 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _config_led_h_ +#define _config_led_h_ + +//Define number of ISSI3733 drivers being used (1...16) +#define ISSI3733_DRIVER_COUNT 2 + +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } + +//LED I2C bus speed +#define I2C_HZ 580000 + +//Count of LED bodies +#define ISSI3733_LED_COUNT 105 + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT 128 + +#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus +#define LED_GCR_STEP 10 //GCR increment/decrement value + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) + +#define ANIMATION_SPEED_STEP 1 + +#define BREATHE_MIN_STEP 0 +#define BREATHE_MAX_STEP 255 + +//LED Mapping - More practically generated from a spreadsheet program +//id: ID of the LED (Sync with PCB callouts) +//x: Physical X coordinate of LED (units do not matter) +//y: Physical Y coordinate of LED (units do not matter) +//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES +//cs: Matrix wiring CS col (1-16) +//swr: Matrix wiring SW Red row (1-12) +//swg: Matrix wiring SW Green row (1-12) +//swb: Matrix wiring SW Blue row (1-12) +//scan: Associated key scancode if any +//Note: Origin 0,0 may be located anywhere as the software will do the final layout +#define ISSI3733_LED_MAP { \ + { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ + { .id = 2, .x = 0.75, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ + { .id = 3, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ + { .id = 4, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ + { .id = 5, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 4 }, \ + { .id = 6, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ + { .id = 7, .x = 4.5, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ + { .id = 8, .x = 5.25, .y = 0, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \ + { .id = 9, .x = 6, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 8 }, \ + { .id = 10, .x = 6.75, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 9 }, \ + { .id = 11, .x = 7.5, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 10 }, \ + { .id = 12, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 11 }, \ + { .id = 13, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \ + { .id = 14, .x = 10.125, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 13 }, \ + { .id = 15, .x = 11.25, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 14 }, \ + { .id = 16, .x = 0.188, .y = -0.75, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 15 }, \ + { .id = 17, .x = 1.125, .y = -0.75, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ + { .id = 18, .x = 1.875, .y = -0.75, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ + { .id = 19, .x = 2.625, .y = -0.75, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ + { .id = 20, .x = 3.375, .y = -0.75, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ + { .id = 21, .x = 4.125, .y = -0.75, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ + { .id = 22, .x = 4.875, .y = -0.75, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ + { .id = 23, .x = 5.625, .y = -0.75, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ + { .id = 24, .x = 6.375, .y = -0.75, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \ + { .id = 25, .x = 7.125, .y = -0.75, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \ + { .id = 26, .x = 7.875, .y = -0.75, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \ + { .id = 27, .x = 8.625, .y = -0.75, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 26 }, \ + { .id = 28, .x = 9.375, .y = -0.75, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ + { .id = 29, .x = 10.313, .y = -0.75, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 28 }, \ + { .id = 30, .x = 11.25, .y = -0.75, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ + { .id = 31, .x = 0.281, .y = -1.5, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 30 }, \ + { .id = 32, .x = 1.313, .y = -1.5, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 33, .x = 2.063, .y = -1.5, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ + { .id = 34, .x = 2.813, .y = -1.5, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ + { .id = 35, .x = 3.563, .y = -1.5, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ + { .id = 36, .x = 4.313, .y = -1.5, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ + { .id = 37, .x = 5.063, .y = -1.5, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ + { .id = 38, .x = 5.813, .y = -1.5, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ + { .id = 39, .x = 6.563, .y = -1.5, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \ + { .id = 40, .x = 7.313, .y = -1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \ + { .id = 41, .x = 8.063, .y = -1.5, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ + { .id = 42, .x = 8.813, .y = -1.5, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 41 }, \ + { .id = 43, .x = 10.031, .y = -1.5, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 43 }, \ + { .id = 44, .x = 11.25, .y = -1.5, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 44 }, \ + { .id = 45, .x = 0.469, .y = -2.25, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \ + { .id = 46, .x = 1.688, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ + { .id = 47, .x = 2.438, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 48 }, \ + { .id = 48, .x = 3.188, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ + { .id = 49, .x = 3.938, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \ + { .id = 50, .x = 4.688, .y = -2.25, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ + { .id = 51, .x = 5.438, .y = -2.25, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ + { .id = 52, .x = 6.188, .y = -2.25, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \ + { .id = 53, .x = 6.938, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 54 }, \ + { .id = 54, .x = 7.688, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 55 }, \ + { .id = 55, .x = 8.438, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ + { .id = 56, .x = 9.469, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \ + { .id = 57, .x = 10.5, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \ + { .id = 58, .x = 11.25, .y = -2.25, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 59 }, \ + { .id = 59, .x = 0.094, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ + { .id = 60, .x = 1.031, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ + { .id = 61, .x = 1.969, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \ + { .id = 62, .x = 4.781, .y = -3, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 66 }, \ + { .id = 63, .x = 7.594, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 70 }, \ + { .id = 64, .x = 8.531, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 71 }, \ + { .id = 65, .x = 9.75, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 72 }, \ + { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ + { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ + { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ +}; + + +#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality +#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) + #define USB_LED_NUM_LOCK_SCANCODE 255 + #define USB_LED_CAPS_LOCK_SCANCODE 30 + #define USB_LED_SCROLL_LOCK_SCANCODE 255 + #define USB_LED_COMPOSE_SCANCODE 255 + #define USB_LED_KANA_SCANCODE 255 +#endif //USB_LED_INDICATOR_ENABLE + +#endif //_config_led_h_ diff --git a/keyboards/massdrop/alt67/keymaps/default/keymap.c b/keyboards/massdrop/alt67/keymaps/default/keymap.c new file mode 100644 index 0000000000..8b77da55a6 --- /dev/null +++ b/keyboards/massdrop/alt67/keymaps/default/keymap.c @@ -0,0 +1,200 @@ +#include QMK_KEYBOARD_H + +enum alt67_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_TRNS, 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_TRNS, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} \ No newline at end of file diff --git a/keyboards/massdrop/alt67/led_programs.c b/keyboards/massdrop/alt67/led_programs.c new file mode 100644 index 0000000000..a8aab28d98 --- /dev/null +++ b/keyboards/massdrop/alt67/led_programs.c @@ -0,0 +1,120 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt67.h" +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/alt67/matrix.c b/keyboards/massdrop/alt67/matrix.c new file mode 100644 index 0000000000..e107b4c22c --- /dev/null +++ b/keyboards/massdrop/alt67/matrix.c @@ -0,0 +1,182 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt67.h" + +#include "d51_util.h" +#include "debug.h" +#include "clks.h" +#include + +matrix_row_t mlatest[MATRIX_ROWS]; +matrix_row_t mlast[MATRIX_ROWS]; +matrix_row_t mdebounced[MATRIX_ROWS]; + +uint8_t row_ports[] = { MATRIX_ROW_PORTS }; +uint8_t row_pins[] = { MATRIX_ROW_PINS }; +uint8_t col_ports[] = { MATRIX_COL_PORTS }; +uint8_t col_pins[] = { MATRIX_COL_PINS }; +uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate + +__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) { +} + +void matrix_init(void) +{ + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + row_masks[PA] = 0; + row_masks[PB] = 0; + + uint8_t row; + for (row = 0; row < MATRIX_ROWS; row++) + { + PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input + PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable + row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask + } + + uint8_t col; + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low + } + + matrix_init_quantum(); +} + +#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) + +uint64_t mdebouncing = 0; +uint8_t matrix_scan(void) +{ + uint8_t mchanged; + uint8_t row; + uint8_t col; + uint32_t scans[2]; //PA PB + + if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active + + //m15_off; //Profiling scans + + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer + + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output + + CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + + scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data + scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data + + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output + + for (row = 0; row < MATRIX_ROWS; row++) + { + //Move scan bits from scans array into proper row bit locations + if (scans[row_ports[row]] & (1 << row_pins[row])) + mlatest[row] |= 1 << col; + } + } + + mchanged = 0; //Default to no matrix change since last + + for (row = 0; row < MATRIX_ROWS; row++) + { + if (mlast[row] != mlatest[row]) + mchanged = 1; + mlast[row] = mlatest[row]; + } + + if (!mchanged) + { + for (row = 0; row < MATRIX_ROWS; row++) + mdebounced[row] = mlatest[row]; + mdebouncing = 0; + } + else + { + //Begin or extend debounce on change + mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + } + + //m15_on; //Profiling scans + + matrix_scan_quantum(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return mdebounced[row]; +} + +void matrix_print(void) +{ + char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; + char *pbuf = buf+3; + uint32_t cols; + uint32_t rows; + matrix_row_t row; + + for (cols = 1; cols <= MATRIX_COLS; cols++) + { + *pbuf = (cols%10)+48; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + + for (rows = 1; rows <= MATRIX_ROWS; rows++) + { + row = matrix_get_row(rows-1); + if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } + else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } + for (cols = 0; cols < MATRIX_COLS; cols++) + { + if (row & 1 << cols) *pbuf = 'X'; + else *pbuf = '.'; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + } + *pbuf = 0; + dprint(buf); +} diff --git a/keyboards/massdrop/alt67/matrix.h b/keyboards/massdrop/alt67/matrix.h new file mode 100644 index 0000000000..3eab6dece1 --- /dev/null +++ b/keyboards/massdrop/alt67/matrix.h @@ -0,0 +1,77 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ +#ifndef MATRIX_H +#define MATRIX_H + +#include +#include +#include "keyboard.h" + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEED2 +#define DEVICE_VER 0x0101 + +#define MANUFACTURER "Massdrop Inc." +#define PRODUCT "CTRL Keyboard" +#define SERIAL_NUM "Unavailable" + +/* key matrix size */ +#define MATRIX_ROWS 11 +#define MATRIX_COLS 8 + +#define PA 0 +#define PB 1 + +#define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB +#define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12 + +#define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA +#define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7 + +/* Print boot debug codes using debug LED when M28 and M30 shorted */ +#define DEBUG_BOOT_TRACING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Force boot in NKRO mode */ +//#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/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h new file mode 100644 index 0000000000..65563daa3d --- /dev/null +++ b/keyboards/massdrop/ctrl/config_led.h @@ -0,0 +1,191 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _config_led_h_ +#define _config_led_h_ + +//Define number of ISSI3733 drivers being used (1...16) +#define ISSI3733_DRIVER_COUNT 2 + +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } + +//LED I2C bus speed +#define I2C_HZ 580000 + +//Count of LED bodies +#define ISSI3733_LED_COUNT 119 + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT 128 + +#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus +#define LED_GCR_STEP 10 //GCR increment/decrement value + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) + +#define ANIMATION_SPEED_STEP 1 + +#define BREATHE_MIN_STEP 0 +#define BREATHE_MAX_STEP 255 + +//LED Mapping - More practically generated from a spreadsheet program +//id: ID of the LED (Sync with PCB callouts) +//x: Physical X coordinate of LED (units do not matter) +//y: Physical Y coordinate of LED (units do not matter) +//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES +//cs: Matrix wiring CS col (1-16) +//swr: Matrix wiring SW Red row (1-12) +//swg: Matrix wiring SW Green row (1-12) +//swb: Matrix wiring SW Blue row (1-12) +//scan: Associated key scancode if any +//Note: Origin 0,0 may be located anywhere as the software will do the final layout +#define ISSI3733_LED_MAP { \ + { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ + { .id = 2, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ + { .id = 3, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ + { .id = 4, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ + { .id = 5, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 4 }, \ + { .id = 6, .x = 4.875, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ + { .id = 7, .x = 5.625, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ + { .id = 8, .x = 6.375, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 7 }, \ + { .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 90 }, \ + { .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 91 }, \ + { .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 92 }, \ + { .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 93 }, \ + { .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 94 }, \ + { .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 95 }, \ + { .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 96 }, \ + { .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 97 }, \ + { .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \ + { .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ + { .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ + { .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ + { .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ + { .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ + { .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ + { .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ + { .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 105 }, \ + { .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 106 }, \ + { .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 107 }, \ + { .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 108 }, \ + { .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 109 }, \ + { .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 110 }, \ + { .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 111 }, \ + { .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 112 }, \ + { .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 142 }, \ + { .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \ + { .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ + { .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ + { .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ + { .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ + { .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ + { .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ + { .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 120 }, \ + { .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 121 }, \ + { .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 122 }, \ + { .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 123 }, \ + { .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 124 }, \ + { .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 125 }, \ + { .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 126 }, \ + { .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 127 }, \ + { .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 141 }, \ + { .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \ + { .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \ + { .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 47 }, \ + { .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \ + { .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ + { .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \ + { .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ + { .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ + { .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 135 }, \ + { .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 136 }, \ + { .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 137 }, \ + { .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 138 }, \ + { .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 139 }, \ + { .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 60 }, \ + { .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ + { .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \ + { .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 63 }, \ + { .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 64 }, \ + { .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 65 }, \ + { .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 66 }, \ + { .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 67 }, \ + { .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 150 }, \ + { .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 151 }, \ + { .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 152 }, \ + { .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 153 }, \ + { .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 140 }, \ + { .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \ + { .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 76 }, \ + { .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \ + { .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 78 }, \ + { .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 79 }, \ + { .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 80 }, \ + { .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 81 }, \ + { .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 82 }, \ + { .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 154 }, \ + { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 155 }, \ + { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 156 }, \ + { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 91, .x = 9.995, .y = -4.535, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 92, .x = 8.85, .y = -4.535, .adr = { .drv = 1, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 93, .x = 7.705, .y = -4.535, .adr = { .drv = 1, .cs = 16, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 94, .x = 6.56, .y = -4.535, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 95, .x = 5.415, .y = -4.535, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 96, .x = 4.27, .y = -4.535, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 97, .x = 3.125, .y = -4.535, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 98, .x = 1.98, .y = -4.535, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 99, .x = 0.835, .y = -4.535, .adr = { .drv = 2, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 100, .x = -0.307, .y = -4.43, .adr = { .drv = 2, .cs = 15, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 101, .x = -0.41, .y = -3.245, .adr = { .drv = 2, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 102, .x = -0.41, .y = -2.06, .adr = { .drv = 2, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 103, .x = -0.41, .y = -0.875, .adr = { .drv = 2, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 104, .x = -0.308, .y = 0.31, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 105, .x = 0.835, .y = 0.415, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 106, .x = 1.98, .y = 0.415, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 107, .x = 3.125, .y = 0.415, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 108, .x = 4.27, .y = 0.415, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 109, .x = 5.415, .y = 0.415, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 110, .x = 6.56, .y = 0.415, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 111, .x = 7.705, .y = 0.415, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 112, .x = 8.85, .y = 0.415, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 113, .x = 9.995, .y = 0.415, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 114, .x = 11.14, .y = 0.415, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 115, .x = 12.285, .y = 0.415, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 116, .x = 13.432, .y = 0.31, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 117, .x = 13.535, .y = -0.875, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 118, .x = 13.535, .y = -2.06, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 119, .x = 13.535, .y = -3.245, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ +}; + +#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality +#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) + #define USB_LED_NUM_LOCK_SCANCODE 255 + #define USB_LED_CAPS_LOCK_SCANCODE 45 + #define USB_LED_SCROLL_LOCK_SCANCODE 96 + #define USB_LED_COMPOSE_SCANCODE 255 + #define USB_LED_KANA_SCANCODE 255 +#endif //USB_LED_INDICATOR_ENABLE + +#endif //_config_led_h_ diff --git a/keyboards/massdrop/ctrl/ctrl.h b/keyboards/massdrop/ctrl/ctrl.h new file mode 100644 index 0000000000..dc7c7eabe5 --- /dev/null +++ b/keyboards/massdrop/ctrl/ctrl.h @@ -0,0 +1,32 @@ +#pragma once + +#include "quantum.h" +#include "config_led.h" +#include "matrix.h" + +#include "i2c_master.h" +#include "led_matrix.h" //For led keycodes +#include "usb/udi_cdc.h" +#include "usb/usb2422.h" + +#define LAYOUT( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ + K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ + K61, K62, K63, K64, K65, K66, K67, K68, K69, K70, K71, K72, K73, K74, K75, \ + K76, K77, K78, K79, K80, K81, K82, K83, K84, K85, K86, K87 \ + \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K17, K18, K19, K20, K21, K22, K23, K24 }, \ + { K34, K35, K36, K37, K38, K39, K40, K41 }, \ + { K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K64, K65, K66, K67, K68, K69, K70, K71 }, \ + { K77, K78, K79, K80, K81, K82, K83, K84 }, \ + { K09, K10, K11, K12, K13, K14, K15, K16 }, \ + { K25, K26, K27, K28, K29, K30, K31, K32 }, \ + { K42, K43, K44, K45, K46, K47, K48, K49 }, \ + { K59, K60, K61, K62, K63, K76, K50, K33 }, \ + { K72, K73, K74, K75, K85, K86, K87, }, \ +} diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c new file mode 100644 index 0000000000..8e84d4fee5 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -0,0 +1,203 @@ +#include QMK_KEYBOARD_H + +enum alt67_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +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_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_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, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} \ No newline at end of file diff --git a/keyboards/massdrop/ctrl/led_programs.c b/keyboards/massdrop/ctrl/led_programs.c new file mode 100644 index 0000000000..ca27016454 --- /dev/null +++ b/keyboards/massdrop/ctrl/led_programs.c @@ -0,0 +1,120 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "ctrl.h" +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/ctrl/matrix.c b/keyboards/massdrop/ctrl/matrix.c new file mode 100644 index 0000000000..6f306962e6 --- /dev/null +++ b/keyboards/massdrop/ctrl/matrix.c @@ -0,0 +1,182 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "ctrl.h" + +#include "d51_util.h" +#include "debug.h" +#include "clks.h" +#include + +matrix_row_t mlatest[MATRIX_ROWS]; +matrix_row_t mlast[MATRIX_ROWS]; +matrix_row_t mdebounced[MATRIX_ROWS]; + +uint8_t row_ports[] = { MATRIX_ROW_PORTS }; +uint8_t row_pins[] = { MATRIX_ROW_PINS }; +uint8_t col_ports[] = { MATRIX_COL_PORTS }; +uint8_t col_pins[] = { MATRIX_COL_PINS }; +uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate + +__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) { +} + +void matrix_init(void) +{ + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + row_masks[PA] = 0; + row_masks[PB] = 0; + + uint8_t row; + for (row = 0; row < MATRIX_ROWS; row++) + { + PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input + PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable + row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask + } + + uint8_t col; + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low + } + + matrix_init_quantum(); +} + +#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) + +uint64_t mdebouncing = 0; +uint8_t matrix_scan(void) +{ + uint8_t mchanged; + uint8_t row; + uint8_t col; + uint32_t scans[2]; //PA PB + + if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active + + //m15_off; //Profiling scans + + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer + + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output + + CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + + scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data + scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data + + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output + + for (row = 0; row < MATRIX_ROWS; row++) + { + //Move scan bits from scans array into proper row bit locations + if (scans[row_ports[row]] & (1 << row_pins[row])) + mlatest[row] |= 1 << col; + } + } + + mchanged = 0; //Default to no matrix change since last + + for (row = 0; row < MATRIX_ROWS; row++) + { + if (mlast[row] != mlatest[row]) + mchanged = 1; + mlast[row] = mlatest[row]; + } + + if (!mchanged) + { + for (row = 0; row < MATRIX_ROWS; row++) + mdebounced[row] = mlatest[row]; + mdebouncing = 0; + } + else + { + //Begin or extend debounce on change + mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + } + + //m15_on; //Profiling scans + + matrix_scan_quantum(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return mdebounced[row]; +} + +void matrix_print(void) +{ + char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; + char *pbuf = buf+3; + uint32_t cols; + uint32_t rows; + matrix_row_t row; + + for (cols = 1; cols <= MATRIX_COLS; cols++) + { + *pbuf = (cols%10)+48; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + + for (rows = 1; rows <= MATRIX_ROWS; rows++) + { + row = matrix_get_row(rows-1); + if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } + else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } + for (cols = 0; cols < MATRIX_COLS; cols++) + { + if (row & 1 << cols) *pbuf = 'X'; + else *pbuf = '.'; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + } + *pbuf = 0; + dprint(buf); +} diff --git a/keyboards/massdrop/ctrl/matrix.h b/keyboards/massdrop/ctrl/matrix.h new file mode 100644 index 0000000000..3eab6dece1 --- /dev/null +++ b/keyboards/massdrop/ctrl/matrix.h @@ -0,0 +1,77 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ +#ifndef MATRIX_H +#define MATRIX_H + +#include +#include +#include "keyboard.h" + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< Date: Wed, 29 Aug 2018 17:11:58 -0400 Subject: Massdrop keyboards readme update (#3791) Massdrop keyboards readme update for flashing instructions --- keyboards/massdrop/alt67/readme.md | 5 +++++ keyboards/massdrop/ctrl/readme.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/keyboards/massdrop/alt67/readme.md b/keyboards/massdrop/alt67/readme.md index 27a7a64daf..1632d8b574 100644 --- a/keyboards/massdrop/alt67/readme.md +++ b/keyboards/massdrop/alt67/readme.md @@ -12,4 +12,9 @@ Make example for this keyboard (after setting up your build environment): make alt67:default +For information on flashing this keyboard, visit the following links: + +[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) +[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) + 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). \ No newline at end of file diff --git a/keyboards/massdrop/ctrl/readme.md b/keyboards/massdrop/ctrl/readme.md index 54157c3da2..4a57095c5e 100644 --- a/keyboards/massdrop/ctrl/readme.md +++ b/keyboards/massdrop/ctrl/readme.md @@ -12,4 +12,9 @@ Make example for this keyboard (after setting up your build environment): make ctrl:default +For information on flashing this keyboard, visit the following links: + +[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) +[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) + 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). \ No newline at end of file -- cgit v1.2.3 From d12d058baeb1f26a05077f88406bc3222f185129 Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Sun, 26 Aug 2018 13:12:41 -0400 Subject: Autodetect lack of screen presence This is the simplest, most efficient way I could come up with to silence the "Failed to start write 60" error that occurs when QMK tries to talk to a screen that doesn't exist. iota_gfx_init passes a success boolean. We catch that into a global bool (we could rewrite multiple functions to pass this as an argument, but given the number of keyboards using this code it seemed less disruptive this way) and then use that as a conditional on running the iota_gfx_task in matrix_scan_user. Tl;dr: if the screen doesn't init, the screen write code doesn't run. --- keyboards/tkc1800/keymaps/default/keymap.c | 10 ++++++++-- keyboards/tkc1800/keymaps/wkl/keymap.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/keyboards/tkc1800/keymaps/default/keymap.c b/keyboards/tkc1800/keymaps/default/keymap.c index 3a11aed2ff..cc19de3bda 100644 --- a/keyboards/tkc1800/keymaps/default/keymap.c +++ b/keyboards/tkc1800/keymaps/default/keymap.c @@ -34,6 +34,8 @@ enum { FUNCTION, }; +bool screenWorks = 0; + //13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() static char layer_lookup[][14] = {"Base","Function"}; @@ -93,7 +95,9 @@ void matrix_init_user(void) { // calls code for the SSD1306 OLED _delay_ms(400); TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display + if(iota_gfx_init()){ // turns on the display + screenWorks = 1; + } #endif #endif #ifdef AUDIO_ENABLE @@ -103,7 +107,9 @@ void matrix_init_user(void) { void matrix_scan_user(void) { #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously + if(screenWorks){ + iota_gfx_task(); // this is what updates the display continuously + }; #endif } diff --git a/keyboards/tkc1800/keymaps/wkl/keymap.c b/keyboards/tkc1800/keymaps/wkl/keymap.c index 40d2e5fad0..e04c4d5c17 100644 --- a/keyboards/tkc1800/keymaps/wkl/keymap.c +++ b/keyboards/tkc1800/keymaps/wkl/keymap.c @@ -34,6 +34,8 @@ enum { FUNCTION, }; +bool screenWorks = 0; + //13 characters max without re-writing the "Layer: " format in iota_gfx_task_user() static char layer_lookup[][14] = {"Base","Function"}; @@ -93,7 +95,9 @@ void matrix_init_user(void) { // calls code for the SSD1306 OLED _delay_ms(400); TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display + if(iota_gfx_init()){ // turns on the display + screenWorks = 1; + } #endif #endif #ifdef AUDIO_ENABLE @@ -103,7 +107,9 @@ void matrix_init_user(void) { void matrix_scan_user(void) { #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously + if(screenWorks){ + iota_gfx_task(); // this is what updates the display continuously + }; #endif } -- cgit v1.2.3 From 097f1a299f2d0e0e5afe174b8cfc1eea1b00c7cf Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 30 Aug 2018 11:05:02 +1000 Subject: Mask off keycode/layer/mod where possible in LT(), MT(), etc. (#3430) * Mask off keycode/layer/mod where possible in LT(), MT(), etc. * Don't need these parentheses * Put back parentheses for order of operations --- docs/feature_advanced_keycodes.md | 10 ++--- quantum/quantum_keycodes.h | 88 +++++++++++++++++++-------------------- 2 files changed, 48 insertions(+), 50 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f93b8033a5..5713234be1 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -13,9 +13,11 @@ People often define custom names using `#define`. For example: This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable. -### Limits of These Aliases +### Caveats -Currently, the keycodes able to used with these functions are limited to the [Basic Keycodes](keycodes_basic.md), meaning you can't use keycodes like `KC_TILD`, or anything greater than 0xFF. For a full list of the keycodes able to be used see [Basic Keycodes](keycodes_basic.md). +Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. + +Additionally, if at least one right-handed modifier is specified in a Mod Tap or Layer Tap, it will cause all modifiers specified to become right-handed, so it is not possible to mix and match the two. # Switching and Toggling Layers @@ -103,10 +105,6 @@ We've added shortcuts to make common modifier/tap (mod-tap) mappings more compac * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. -?> Due to the way that keycodes are structured, any modifiers specified as part of `kc`, such as `LCTL()` or `KC_LPRN`, will only activate when held instead of tapped. - -?> Additionally, if there is at least one right-handed modifier, any other modifiers in a chain of functions will turn into their right-handed equivalents, so it is not possible to "mix and match" the two. - # One Shot Keys One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys". diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index f2cdb8a3bf..0ecc293a82 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -459,27 +459,27 @@ enum quantum_keycodes { }; // Ability to use mods in layouts -#define LCTL(kc) (kc | QK_LCTL) -#define LSFT(kc) (kc | QK_LSFT) -#define LALT(kc) (kc | QK_LALT) -#define LGUI(kc) (kc | QK_LGUI) +#define LCTL(kc) (QK_LCTL | (kc)) +#define LSFT(kc) (QK_LSFT | (kc)) +#define LALT(kc) (QK_LALT | (kc)) +#define LGUI(kc) (QK_LGUI | (kc)) #define LCMD(kc) LGUI(kc) #define LWIN(kc) LGUI(kc) -#define RCTL(kc) (kc | QK_RCTL) -#define RSFT(kc) (kc | QK_RSFT) -#define RALT(kc) (kc | QK_RALT) -#define RGUI(kc) (kc | QK_RGUI) +#define RCTL(kc) (QK_RCTL | (kc)) +#define RSFT(kc) (QK_RSFT | (kc)) +#define RALT(kc) (QK_RALT | (kc)) +#define RGUI(kc) (QK_RGUI | (kc)) #define RCMD(kc) RGUI(kc) #define RWIN(kc) RGUI(kc) -#define HYPR(kc) (kc | QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI) -#define MEH(kc) (kc | QK_LCTL | QK_LSFT | QK_LALT) -#define LCAG(kc) (kc | QK_LCTL | QK_LALT | QK_LGUI) -#define ALTG(kc) (kc | QK_RCTL | QK_RALT) -#define SGUI(kc) (kc | QK_LGUI | QK_LSFT) +#define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc)) +#define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc)) +#define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc)) +#define ALTG(kc) (QK_RCTL | QK_RALT | (kc)) +#define SGUI(kc) (QK_LGUI | QK_LSFT | (kc)) #define SCMD(kc) SGUI(kc) #define SWIN(kc) SGUI(kc) -#define LCA(kc) (kc | QK_LCTL | QK_LALT) +#define LCA(kc) (QK_LCTL | QK_LALT | (kc)) #define MOD_HYPR 0xf #define MOD_MEH 0x7 @@ -557,15 +557,15 @@ enum quantum_keycodes { #define KC_DELT KC_DELETE // Del key (four letter code) // Alias for function layers than expand past FN31 -#define FUNC(kc) (kc | QK_FUNCTION) +#define FUNC(kc) (QK_FUNCTION | (kc)) // Aliases #define S(kc) LSFT(kc) #define F(kc) FUNC(kc) -#define M(kc) (kc | QK_MACRO) +#define M(kc) (QK_MACRO | (kc)) -#define MACROTAP(kc) (kc | QK_MACRO | FUNC_TAP<<8) +#define MACROTAP(kc) (QK_MACRO | (FUNC_TAP << 8) | (kc)) #define MACRODOWN(...) (record->event.pressed ? MACRO(__VA_ARGS__) : MACRO_NONE) #define KC_GESC GRAVE_ESC @@ -590,7 +590,7 @@ enum quantum_keycodes { #define RGB_M_T RGB_MODE_RGBTEST // L-ayer, T-ap - 256 keycode max, 16 layer max -#define LT(layer, kc) (kc | QK_LAYER_TAP | ((layer & 0xF) << 8)) +#define LT(layer, kc) (QK_LAYER_TAP | ((layer & 0xF) << 8) | ((kc) & 0xFF)) #define AG_SWAP MAGIC_SWAP_ALT_GUI #define AG_NORM MAGIC_UNSWAP_ALT_GUI @@ -602,32 +602,32 @@ enum quantum_keycodes { // Unless you have a good reason not to do so, prefer ON_PRESS (1) as your default. // In fact, we changed it to assume ON_PRESS for sanity/simplicity. If needed, you can add your own // keycode modeled after the old version, kept below for this. -/* #define TO(layer, when) (layer | QK_TO | (when << 0x4)) */ -#define TO(layer) (layer | QK_TO | (ON_PRESS << 0x4)) +/* #define TO(layer, when) (QK_TO | (when << 0x4) | (layer & 0xFF)) */ +#define TO(layer) (QK_TO | (ON_PRESS << 0x4) | (layer & 0xFF)) // Momentary switch layer - 256 layer max -#define MO(layer) (layer | QK_MOMENTARY) +#define MO(layer) (QK_MOMENTARY | (layer & 0xFF)) // Set default layer - 256 layer max -#define DF(layer) (layer | QK_DEF_LAYER) +#define DF(layer) (QK_DEF_LAYER | (layer & 0xFF)) // Toggle to layer - 256 layer max -#define TG(layer) (layer | QK_TOGGLE_LAYER) +#define TG(layer) (QK_TOGGLE_LAYER | (layer & 0xFF)) // One-shot layer - 256 layer max -#define OSL(layer) (layer | QK_ONE_SHOT_LAYER) +#define OSL(layer) (QK_ONE_SHOT_LAYER | (layer & 0xFF)) // L-ayer M-od: Momentary switch layer with modifiers active - 16 layer max, left mods only -#define LM(layer, mod) (QK_LAYER_MOD | (((layer) & 0xF) << 4) | ((mod) & 0xF)) +#define LM(layer, mod) (QK_LAYER_MOD | ((layer & 0xF) << 4) | ((mod) & 0xF)) // One-shot mod -#define OSM(mod) ((mod) | QK_ONE_SHOT_MOD) +#define OSM(mod) (QK_ONE_SHOT_MOD | ((mod) & 0xFF)) // Layer tap-toggle -#define TT(layer) (layer | QK_LAYER_TAP_TOGGLE) +#define TT(layer) (QK_LAYER_TAP_TOGGLE | (layer & 0xFF)) // M-od, T-ap - 256 keycode max -#define MT(mod, kc) (kc | QK_MOD_TAP | (((mod) & 0x1F) << 8)) +#define MT(mod, kc) (QK_MOD_TAP | (((mod) & 0x1F) << 8) | ((kc) & 0xFF)) #define CTL_T(kc) MT(MOD_LCTL, kc) #define LCTL_T(kc) MT(MOD_LCTL, kc) @@ -652,15 +652,15 @@ enum quantum_keycodes { #define RCMD_T(kc) RGUI_T(kc) #define RWIN_T(kc) RGUI_T(kc) -#define C_S_T(kc) MT((MOD_LCTL | MOD_LSFT), kc) // Control + Shift e.g. for gnome-terminal -#define MEH_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT), kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl -#define LCAG_T(kc) MT((MOD_LCTL | MOD_LALT | MOD_LGUI), kc) // Left control alt and gui -#define RCAG_T(kc) MT((MOD_RCTL | MOD_RALT | MOD_RGUI), kc) // Right control alt and gui -#define ALL_T(kc) MT((MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI), kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ -#define SGUI_T(kc) MT((MOD_LGUI | MOD_LSFT), kc) +#define C_S_T(kc) MT(MOD_LCTL | MOD_LSFT, kc) // Control + Shift e.g. for gnome-terminal +#define MEH_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT, kc) // Meh is a less hyper version of the Hyper key -- doesn't include Win or Cmd, so just alt+shift+ctrl +#define LCAG_T(kc) MT(MOD_LCTL | MOD_LALT | MOD_LGUI, kc) // Left control alt and gui +#define RCAG_T(kc) MT(MOD_RCTL | MOD_RALT | MOD_RGUI, kc) // Right control alt and gui +#define ALL_T(kc) MT(MOD_LCTL | MOD_LSFT | MOD_LALT | MOD_LGUI, kc) // see http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/ +#define SGUI_T(kc) MT(MOD_LGUI | MOD_LSFT, kc) #define SCMD_T(kc) SGUI_T(kc) #define SWIN_T(kc) SGUI_T(kc) -#define LCA_T(kc) MT((MOD_LCTL | MOD_LALT), kc) // Left control and left alt +#define LCA_T(kc) MT(MOD_LCTL | MOD_LALT, kc) // Left control and left alt // Dedicated keycode versions for Hyper and Meh, if you want to use them as standalone keys rather than mod-tap #define KC_HYPR HYPR(KC_NO) @@ -670,22 +670,22 @@ enum quantum_keycodes { // For sending unicode codes. // You may not send codes over 7FFF -- this supports most of UTF8. // To have a key that sends out Œ, go UC(0x0152) - #define UNICODE(n) (n | QK_UNICODE) + #define UNICODE(n) (QK_UNICODE | (n)) #define UC(n) UNICODE(n) #endif #ifdef UNICODEMAP_ENABLE - #define X(n) (n | QK_UNICODE_MAP) + #define X(n) (QK_UNICODE_MAP | (n)) #endif #ifdef SWAP_HANDS_ENABLE - #define SH_T(key) (QK_SWAP_HANDS | key) - #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) - #define SH_TT (QK_SWAP_HANDS | OP_SH_TAP_TOGGLE) - #define SH_MON (QK_SWAP_HANDS | OP_SH_ON_OFF) - #define SH_MOFF (QK_SWAP_HANDS | OP_SH_OFF_ON) - #define SH_ON (QK_SWAP_HANDS | OP_SH_ON) - #define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF) + #define SH_T(kc) (QK_SWAP_HANDS | (kc)) + #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) + #define SH_TT (QK_SWAP_HANDS | OP_SH_TAP_TOGGLE) + #define SH_MON (QK_SWAP_HANDS | OP_SH_ON_OFF) + #define SH_MOFF (QK_SWAP_HANDS | OP_SH_OFF_ON) + #define SH_ON (QK_SWAP_HANDS | OP_SH_ON) + #define SH_OFF (QK_SWAP_HANDS | OP_SH_OFF) #endif #endif // QUANTUM_KEYCODES_H -- cgit v1.2.3 From 3cafc4e7c6c3f38e86f3673336d28657e95287d7 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Wed, 29 Aug 2018 21:11:32 -0400 Subject: Keyboard: Update CTRL and ALT keyboard readme (#3796) * Massdrop keyboards readme update Massdrop keyboards readme update for flashing instructions * ctrl and alt keyboard readme update Updating make command in Massdrop CTRL and ALT keyboard readme files to reflect directory change --- keyboards/massdrop/alt67/readme.md | 7 ++++++- keyboards/massdrop/ctrl/readme.md | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/keyboards/massdrop/alt67/readme.md b/keyboards/massdrop/alt67/readme.md index 1632d8b574..cc33349c94 100644 --- a/keyboards/massdrop/alt67/readme.md +++ b/keyboards/massdrop/alt67/readme.md @@ -10,7 +10,12 @@ Hardware Availability: [Massdrop ALT Mechanical Keyboard](https://www.massdrop.c Make example for this keyboard (after setting up your build environment): - make alt67:default + make massdrop/alt67:default + +For information on flashing this keyboard, visit the following links: + +[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) +[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) For information on flashing this keyboard, visit the following links: diff --git a/keyboards/massdrop/ctrl/readme.md b/keyboards/massdrop/ctrl/readme.md index 4a57095c5e..5e504d96d4 100644 --- a/keyboards/massdrop/ctrl/readme.md +++ b/keyboards/massdrop/ctrl/readme.md @@ -10,7 +10,12 @@ Hardware Availability: [Massdrop CTRL Mechanical Keyboard](https://www.massdrop. Make example for this keyboard (after setting up your build environment): - make ctrl:default + make massdrop/ctrl:default + +For information on flashing this keyboard, visit the following links: + +[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) +[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) For information on flashing this keyboard, visit the following links: -- cgit v1.2.3 From 97d09ef8fabed45fb409b0b620f3ae3867d5ed50 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Thu, 30 Aug 2018 10:12:09 +0900 Subject: Keyboard: remove old comment from keyboards/helix/rules.mk (#3795) remove 2 lines from keyboards/helix/rules.mk | -# if firmware size over limit, try this option | -# CFLAGS += -flto | - see keyboards/helix/[rev2|pico]/keymaps/EACH_MAP/rules.mk: | Link_Time_Optimization = no # if firmware size over limit, try this option : : : | ifeq ($(strip $(Link_Time_Optimization)),yes) | EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization | endif --- keyboards/helix/rules.mk | 3 --- 1 file changed, 3 deletions(-) diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk index e42f92cf8a..7c1d56527a 100644 --- a/keyboards/helix/rules.mk +++ b/keyboards/helix/rules.mk @@ -2,9 +2,6 @@ SRC += i2c.c SRC += serial.c SRC += ssd1306.c -# if firmware size over limit, try this option -# CFLAGS += -flto - # MCU name #MCU = at90usb1287 MCU = atmega32u4 -- cgit v1.2.3 From 11f49d638895e4035698574df63e44118e23c393 Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 30 Aug 2018 03:19:43 +0200 Subject: Keymap: Update keymap including LAYOUT_planck_grid (#3779) * Update keymap including LAYOUT_planck_grid * Change include --- keyboards/planck/keymaps/sascha/keymap.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/keyboards/planck/keymaps/sascha/keymap.c b/keyboards/planck/keymaps/sascha/keymap.c index afa73e2123..93787599c8 100644 --- a/keyboards/planck/keymaps/sascha/keymap.c +++ b/keyboards/planck/keymaps/sascha/keymap.c @@ -1,9 +1,8 @@ #include "backlight.h" -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = { +[0] = LAYOUT_planck_grid( /* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ * │ Esc │ Q │ W │ E │ R │ T │ Z │ U │ I │ O │ P │ Bksp │ * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ @@ -11,15 +10,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ * │ Shft │ Y │ X │ C │ V │ B │ N │ M │ , < │ . > │ / ? │ ' " │ * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ - * │ Ctrl │ Alt │ GUI │ - _ │ = + │ Spce │ \ | │ ( │ ) │ [ { │ ] } │ Lr 1 │ + * │ Ctrl │ Alt │ ` ~ │ - _ │ = + │ Spce │ \ | │ ( │ ) │ [ { │ ] } │ Lr 1 │ * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ */ - { KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Z , KC_U , KC_I , KC_O , KC_P , KC_BSPC } , - { KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT } , - { KC_LSFT , KC_Y , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT } , - { KC_LCTL , KC_LALT , KC_LGUI , KC_MINS , KC_EQL , KC_SPC , KC_BSLS , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , MO(1) } - }, -[1] = { + KC_ESC , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Z , KC_U , KC_I , KC_O , KC_P , KC_BSPC, + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT, + KC_LSFT , KC_Y , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT, + KC_LCTL , KC_LALT , KC_GRV , KC_MINS , KC_EQL , KC_SPC , KC_BSLS , KC_LPRN , KC_RPRN , KC_LBRC , KC_RBRC , MO(1) + ), +[1] = LAYOUT_planck_grid( /* ┌──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┬──────┐ * │ ~ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ DEL │ * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ @@ -30,11 +29,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * │ Powr │ Rset │ BLSt │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ */ - { KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL } , - { KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä') } , - { S(KC_INS) , UC(L'♥') , UC(L'≈') , UC(L'✓') , UC(L'✗') , UC(L'←') , UC(L'→') , UC(L'€') , UC(L'ß') , UC(L'Ü') , UC(L'Ö') , UC(L'Ä') } , - { KC_PWR , RESET , BL_STEP , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS } - } + KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL, + KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä'), + S(KC_INS) , UC(L'♥') , UC(L'≈') , UC(L'✓') , UC(L'✗') , UC(L'←') , UC(L'→') , UC(L'€') , UC(L'ß') , UC(L'Ü') , UC(L'Ö') , UC(L'Ä'), + KC_PWR , RESET , BL_STEP , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS + ) }; void matrix_init_user(void) { -- cgit v1.2.3 From 4cd4e1ded686f2799cfd87750200fcd6fba445ee Mon Sep 17 00:00:00 2001 From: arlenk <33534303+arlenk@users.noreply.github.com> Date: Wed, 29 Aug 2018 21:20:41 -0400 Subject: Docs: add process_terminal() and update links to other functions (#3778) * add process_terminal() and update links to other functions * convert links to permalinks and add a few missing process_* functions * update links in main text as well --- docs/understanding_qmk.md | 53 ++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index 4544cb2602..bf695d008d 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -12,7 +12,7 @@ You can think of QMK as no different from any other computer program. It is star The reason for this is the different platforms that QMK supports. The most common platform is `lufa`, which runs on AVR processors such at the atmega32u4. We also support `chibios` and `vusb`. -We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1129). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/protocol/lufa/lufa.c#L1182). This is [The Main Loop](#the_main_loop). +We'll focus on AVR processors for the moment, which use the `lufa` platform. You can find the `main()` function in [tmk_core/protocol/lufa/lufa.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1019). If you browse through that function you'll find that it initializes any hardware that has been configured (including USB to the host) and then it starts the core part of the program with a [`while(1)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/protocol/lufa/lufa.c#L1060). This is [The Main Loop](#the-main-loop). ## The Main Loop @@ -22,7 +22,7 @@ This section of code is called "The Main Loop" because it's responsible for loop keyboard_task(); ``` -This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/keyboard.c#L154), and it is responsible for detecting changes in the matrix and turning status LED's on and off. +This is where all the keyboard specific functionality is dispatched. The source code for `keyboard_task()` can be found in [tmk_core/common/keyboard.c](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/tmk_core/common/keyboard.c#L206), and it is responsible for detecting changes in the matrix and turning status LED's on and off. Within `keyboard_task()` you'll find code to handle: @@ -77,7 +77,7 @@ At the keyboard level we define a C macro (typically named `KEYMAP()`) which map Notice how the second block of our `KEYMAP()` macro matches the Matrix Scanning array above? This macro is what will map the matrix scanning array to keycodes. However, if you look at a 17 key numpad you'll notice that it has 3 places where the matrix could have a switch but doesn't, due to larger keys. We have populated those spaces with `KC_NO` so that our keymap definition doesn't have to. -You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. +You can also use this macro to handle unusual matrix layouts, for example the [Clueboard rev 2](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/keyboards/clueboard/66/rev2/rev2.h). Explaining that is outside the scope of this document. ##### Keycode Assignment @@ -129,27 +129,32 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he ##### Process Record - -The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is described below, using cluecard whenever we need to look at the keyboard/keymap level functions. - -* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L128) - * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L140) - * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L143) - * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/card/card.c#L20) - * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/keyboards/clueboard/card/keymaps/default/keymap.c#L58) - * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_midi.c#L102) - * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_audio.c#L10) - * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_music.c#L69) - * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_tap_dance.c#L75) - * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_leader.c#L32) - * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_chording.c#L41) - * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_combo.c#L115) - * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode.c#L22) - * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c#L91) - * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_printer.c#L77) - * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_auto_shift.c#L47) - * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicodemap.c#L47) - * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/master/quantum/quantum.c#L211) +The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in rule.mk or elsewhere, only a subset of the functions below will be included in final firmware. + +* [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/tmk_core/common/action.c#L172) + * [`bool process_record_quantum(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L193) + * [Map this record to a keycode](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/quantum.c#L213) + * [`void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_tap_dance.c#L115) + * [`bool process_key_lock(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_key_lock.c#L62) + * [`bool process_clicky(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/quantum/process_keycode/process_clicky.c#L44) + * [`bool process_record_kb(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/card.c#L20) + * [`bool process_record_user(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/keyboards/clueboard/card/keymaps/default/keymap.c#L58) + * [`bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/fdd0f915271f79b104aa5d216566bcc3fd134e85/quantum/rgb_matrix.c#L139) + * [`bool process_midi(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_midi.c#L81) + * [`bool process_audio(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_audio.c#L19) + * [`bool process_steno(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_steno.c#L160) + * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_music.c#L114) + * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_tap_dance.c#L136) + * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_leader.c#L38) + * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_chording.c#L41) + * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_combo.c#L115) + * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicode.c#L22) + * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_ucis.c#L91) + * [`bool process_printer(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_printer.c#L77) + * [`bool process_auto_shift(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_auto_shift.c#L94) + * [`bool process_unicode_map(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicodemap.c#L47) + * [`bool process_terminal(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_terminal.c#L264) + * [Identify and process quantum specific keycodes](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/quantum.c#L287) At any step during this chain of events a function (such as `process_record_kb()`) can `return false` to halt all further processing. -- cgit v1.2.3 From 1acaf2b2c22eb6bd77374b93101480207829db04 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Thu, 30 Aug 2018 16:22:29 +1000 Subject: Tweak the wording in "Becoming a QMK Collaborator" --- docs/becoming_a_qmk_collaborator.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/becoming_a_qmk_collaborator.md b/docs/becoming_a_qmk_collaborator.md index 3cac63c97b..16ae0d569e 100644 --- a/docs/becoming_a_qmk_collaborator.md +++ b/docs/becoming_a_qmk_collaborator.md @@ -1,7 +1,9 @@ -A QMK collaborator is a keyboard maker/designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users/customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: +# Becoming a QMK Collaborator -* **Have a PCB available for sale** - unfortunately there's just too much variation and complications with handwired keyboards. -* **Maintain the your keyboard's directory** - this may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core. -* **Approve and merge your keyboard's keymap pull requests** - we like to encourage users to contribute their keymaps for others to see and work from when creating their own. +A QMK collaborator is a keyboard maker or designer that is interested in helping QMK grow and fully support their keyboard(s), and encouraging their users and customers to submit features, ideas, and keymaps. We're always looking to add more keyboards and collaborators, but we ask that they fulfill these requirements: + +* **Have a PCB available for sale.** Unfortunately there's just too much variation and complications with handwired keyboards. +* **Maintain your keyboard in QMK.** This may just require an initial setup to get your keyboard working, but it could also include accommodating changes made to QMK's core that might break or render any custom code redundant. +* **Approve and merge keymap pull requests for your keyboard.** We like to encourage users to contribute their keymaps for others to see and work from when creating their own. If you feel you meet these requirements, shoot us an email at hello@qmk.fm with an introduction and some links to your keyboard! -- cgit v1.2.3 From 2b707f3470afd10f2db9db17d096dda836535444 Mon Sep 17 00:00:00 2001 From: Lars Herbach Date: Thu, 30 Aug 2018 18:23:33 +0200 Subject: Keymap: Added new tada68 keymap (#3788) * Initial Commit * Removed duplicate lines --- keyboards/tada68/keymaps/laas/config.h | 1 + keyboards/tada68/keymaps/laas/keymap.c | 53 +++++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/laas/readme.md | 12 ++++++++ keyboards/tada68/keymaps/laas/rules.mk | 5 ++++ 4 files changed, 71 insertions(+) create mode 100755 keyboards/tada68/keymaps/laas/config.h create mode 100755 keyboards/tada68/keymaps/laas/keymap.c create mode 100755 keyboards/tada68/keymaps/laas/readme.md create mode 100755 keyboards/tada68/keymaps/laas/rules.mk diff --git a/keyboards/tada68/keymaps/laas/config.h b/keyboards/tada68/keymaps/laas/config.h new file mode 100755 index 0000000000..6f70f09bee --- /dev/null +++ b/keyboards/tada68/keymaps/laas/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/tada68/keymaps/laas/keymap.c b/keyboards/tada68/keymaps/laas/keymap.c new file mode 100755 index 0000000000..25b990a72a --- /dev/null +++ b/keyboards/tada68/keymaps/laas/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL 1 +#define _______ KC_TRNS + +LEADER_EXTERNS(); + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_ansi( + KC_ESC, 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_GRV, + 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_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_PGUP, + KC_LSFT, 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |VMU | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| | | | | | | |VU-|End | + * |----------------------------------------------------------------| + * | | | | Play/Pause | | | |Rwd|VU+|Fwd | + * `----------------------------------------------------------------' + */ + [_FL] = LAYOUT_ansi( + _______, 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_DEL, KC_INS, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, KC_VOLU, KC_END, + _______, _______, _______, KC_MPLY, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), +}; diff --git a/keyboards/tada68/keymaps/laas/readme.md b/keyboards/tada68/keymaps/laas/readme.md new file mode 100755 index 0000000000..48497062c9 --- /dev/null +++ b/keyboards/tada68/keymaps/laas/readme.md @@ -0,0 +1,12 @@ +# laas' TADA68 layout + +* Disabled mouse controls +* Fn + PgUp -> Home +* Fn + PgDown -> End +* Media control for Windows: + * Fn + Left: Previous track + * Fn + Right: Next track + * Fn + Up: Volume up + * Fn + Down: Volume down + * Fn + Delete: Mute + * Fn + Space: Play/pause diff --git a/keyboards/tada68/keymaps/laas/rules.mk b/keyboards/tada68/keymaps/laas/rules.mk new file mode 100755 index 0000000000..dbaa9045e7 --- /dev/null +++ b/keyboards/tada68/keymaps/laas/rules.mk @@ -0,0 +1,5 @@ +# 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 +# +CONSOLE_ENABLE = no # Console for debug(+400) -- cgit v1.2.3 From 2fcfd5cff7089338385c40a630315939a7a9ebbc Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Thu, 30 Aug 2018 09:34:14 -0700 Subject: Keymap: Wanleg updates (#3794) * various edits and minor additions * updates * updates * updates * lets_split LEDs off instructions * lets_split LEDs off instructions * turn off lets_split LEDs in userspace * one-hand setup for right side --- keyboards/4x4/rules.mk | 2 +- keyboards/5x5/info.json | 0 keyboards/5x5/rules.mk | 2 +- layouts/community/ortho_4x12/wanleg/config.h | 7 +++++ layouts/community/ortho_4x12/wanleg/keymap.c | 2 +- layouts/community/ortho_4x12/wanleg/readme.md | 40 +++++++++++++++++++++++---- layouts/community/ortho_4x12/wanleg/rules.mk | 4 +++ layouts/community/ortho_5x10/layout.json | 5 ++++ layouts/community/ortho_5x10/readme.md | 3 ++ layouts/community/ortho_5x10/wanleg/config.h | 9 ++++++ layouts/community/ortho_5x10/wanleg/keymap.c | 38 +++++++++++++++++++++++++ layouts/community/ortho_5x10/wanleg/rules.mk | 3 ++ users/wanleg/wanleg.c | 21 ++++++++++++++ users/wanleg/wanleg.h | 7 +++-- 14 files changed, 132 insertions(+), 11 deletions(-) delete mode 100644 keyboards/5x5/info.json create mode 100644 layouts/community/ortho_5x10/layout.json create mode 100644 layouts/community/ortho_5x10/readme.md create mode 100644 layouts/community/ortho_5x10/wanleg/config.h create mode 100644 layouts/community/ortho_5x10/wanleg/keymap.c create mode 100644 layouts/community/ortho_5x10/wanleg/rules.mk diff --git a/keyboards/4x4/rules.mk b/keyboards/4x4/rules.mk index 3ea4476dbe..b8b4bccc42 100644 --- a/keyboards/4x4/rules.mk +++ b/keyboards/4x4/rules.mk @@ -71,4 +71,4 @@ 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) -LAYOUT = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 +LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/5x5/info.json b/keyboards/5x5/info.json deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/keyboards/5x5/rules.mk b/keyboards/5x5/rules.mk index b04e4a527c..24e0e020fd 100644 --- a/keyboards/5x5/rules.mk +++ b/keyboards/5x5/rules.mk @@ -71,4 +71,4 @@ 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) -LAYOUT = ortho_5x5 ortho_5x10 ortho_5x15 +LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 2c6fcc75f0..0d2cc591e3 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -12,4 +12,11 @@ #define EE_HANDS #endif +// set top left key as bootloader mode escape key on 4x4 48key layout +#if defined(KEYBOARD_4x4) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT C6 // usually COL +#define QMK_ESC_INPUT B2 // usually ROW +#endif + #endif diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 8773001d0a..f6030469c0 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -13,7 +13,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__0_______________, _______________Qwerty_Row__1_______________, _______________Qwerty_Row__2_______________, - KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), KC_SPC, SUPRA, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL ), #else [_GK] = LAYOUT_ortho_4x12_wrapper( diff --git a/layouts/community/ortho_4x12/wanleg/readme.md b/layouts/community/ortho_4x12/wanleg/readme.md index 2f89d1de61..1cd41d116d 100644 --- a/layouts/community/ortho_4x12/wanleg/readme.md +++ b/layouts/community/ortho_4x12/wanleg/readme.md @@ -16,9 +16,39 @@ Change `comPORT` to whatever port is used by the Arduino (e.g. `com11` in Window ## Using QMK DFU Once QMK DFU is burned to your ProMicro, you can then flash subsequent hex files with `make lets_split/rev2::dfu dfu=qmk` -The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` +The `dfu=qmk` conditional will set `BOOTLOADER = qmk-dfu` instead of `BOOTLOADER = caterina` ---- -# JJ40 -## To Do -- [ ] Mousekeys not working with Userspace for some reason (jj40 only) \ No newline at end of file +# Let's Split LEDs +In `qmk_firmware/keyboards/lets_split/rev2/rev2.c`, replace contents with +``` +#include "lets_split.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + //turn off LEDs on ProMicro + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); + + matrix_init_user(); +}; +``` +to turn off LEDs diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index 79929689cb..69f377a015 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -3,4 +3,8 @@ SWAP_HANDS_ENABLE = yes ifeq ($(strip $(KEYBOARD)), jj40) SWAP_HANDS_ENABLE = no +endif + +ifeq ($(strip $(KEYBOARD)), 4x4) + SWAP_HANDS_ENABLE = no endif \ No newline at end of file diff --git a/layouts/community/ortho_5x10/layout.json b/layouts/community/ortho_5x10/layout.json new file mode 100644 index 0000000000..00d8479523 --- /dev/null +++ b/layouts/community/ortho_5x10/layout.json @@ -0,0 +1,5 @@ +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""] diff --git a/layouts/community/ortho_5x10/readme.md b/layouts/community/ortho_5x10/readme.md new file mode 100644 index 0000000000..5c94f8eca8 --- /dev/null +++ b/layouts/community/ortho_5x10/readme.md @@ -0,0 +1,3 @@ +# ortho_5x10 + + LAYOUT_ortho_5x10 diff --git a/layouts/community/ortho_5x10/wanleg/config.h b/layouts/community/ortho_5x10/wanleg/config.h new file mode 100644 index 0000000000..2d24f2771b --- /dev/null +++ b/layouts/community/ortho_5x10/wanleg/config.h @@ -0,0 +1,9 @@ +#pragma once + +//QMK DFU settings (ProMicro boards) +// set top left key as bootloader mode escape key on Gherkin +#if defined(KEYBOARD_5x5) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B2 // usually ROW +#endif diff --git a/layouts/community/ortho_5x10/wanleg/keymap.c b/layouts/community/ortho_5x10/wanleg/keymap.c new file mode 100644 index 0000000000..5d06e53ae4 --- /dev/null +++ b/layouts/community/ortho_5x10/wanleg/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[gGK] = LAYOUT_ortho_5x10_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________, + _______, _______, _______, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, _______, _______ +), + + +[gNUM] = LAYOUT_ortho_5x10_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ +), + +[gDIR] = LAYOUT_ortho_5x10_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[gETC] = LAYOUT_ortho_5x10_wrapper( + _______________Gherkin_NUM_0_______________, + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ +), + +}; diff --git a/layouts/community/ortho_5x10/wanleg/rules.mk b/layouts/community/ortho_5x10/wanleg/rules.mk new file mode 100644 index 0000000000..90841d2abe --- /dev/null +++ b/layouts/community/ortho_5x10/wanleg/rules.mk @@ -0,0 +1,3 @@ +SWAP_HANDS_ENABLE = no + +BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 0175ae2010..931546c153 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -156,3 +156,24 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return true; } + +/// Turn off LEDs on ProMicros of Let's Split /// +// LEDs only on by default on Let's Split +// Add reconfigurable functions here, for keymap customization +// This allows for a global, userspace functions, and continued +// customization of the keymap. Use _keymap instead of _user +// functions in the keymaps +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +// Call user matrix init, then call the keymap's init function +void matrix_init_user(void) { +#if defined(KEYBOARD_lets_split_rev2) + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +#endif + matrix_init_keymap(); +} \ No newline at end of file diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index da14dcdf5a..5cec82e605 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -119,6 +119,7 @@ enum { #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) +#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) @@ -204,7 +205,7 @@ enum { #define _______________GherkinLike_1_______________ KC_TAB, _______________Gherkin_Row_1_______________, KC_QUOT #define _______________GherkinLike_2_______________ TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V),LT(ETC, KC_B),KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT) #define _______________GherkinLike_3_______________ KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL -#define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL +#define _______________GherkinLike_3_OneHand_______ KC_LCTL, KC_LGUI, KC_LALT, ONEHAND, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, ONEHAND, KC_RCTL /* Qwerty * .-------------------------------------------------------------------------------------. @@ -257,7 +258,7 @@ enum { /* Gherkin Numbers * .-----------------------------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -267,7 +268,7 @@ enum { * | | | | | | | ENTER | SHIFT | RGUI | | | | * '-----------------------------------------------------------------------------------------------------------' */ -#define _______________NUMBERS_Row_0_______________ _______, _______________Gherkin_NUM_0_______________, KC_DEL +#define _______________NUMBERS_Row_0_______________ _______, _______________Gherkin_NUM_0_______________, KC_BSPC #define _______________NUMBERS_Row_1_______________ _______, _______________Gherkin_NUM_1_______________, _______ #define _______________NUMBERS_Row_2_______________ _______, _______________Gherkin_NUM_2_______________, _______ #define _______________NUMBERS_Row_3_______________ _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______, _______ -- cgit v1.2.3 From ce3ccd3f4a5e8ff8ac391887f3357dd8e985a452 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 31 Aug 2018 02:37:05 +1000 Subject: Docs: Tabulate Modifier & Mod-Tap keycode listings in advanced keycodes docs (#3799) --- docs/feature_advanced_keycodes.md | 114 ++++++++++++++++++++++---------------- docs/keycodes.md | 4 +- 2 files changed, 69 insertions(+), 49 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 5713234be1..5f30359e0d 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -57,53 +57,73 @@ Sometimes, you might want to switch between layers in a macro or as part of a ta # Modifier Keys -These functions allow you to combine a mod with a keycode. When pressed the keydown for the mod will be sent first, and then *kc* will be sent. When released the keyup for *kc* will be sent and then the mod will be sent. - -* `LSFT(kc)` or `S(kc)` - applies left Shift to *kc* (keycode) -* `RSFT(kc)` - applies right Shift to *kc* -* `LCTL(kc)` - applies left Control to *kc* -* `RCTL(kc)` - applies right Control to *kc* -* `LALT(kc)` - applies left Alt to *kc* -* `RALT(kc)` - applies right Alt to *kc* -* `LGUI(kc)` - applies left GUI (command/win) to *kc* -* `RGUI(kc)` - applies right GUI (command/win) to *kc* -* `HYPR(kc)` - applies Hyper (all modifiers) to *kc* -* `MEH(kc)` - applies Meh (all modifiers except Win/Cmd) to *kc* -* `LCAG(kc)` - applies CtrlAltGui to *kc* - -You can also chain these, like this: - - LALT(LCTL(KC_DEL)) -- this makes a key that sends Alt, Control, and Delete in a single keypress. - -# Mod Tap - -`MT(mod, kc)` - is *mod* (modifier key - MOD_LCTL, MOD_LSFT) when held, and *kc* when tapped. In other words, you can have a key that sends Esc (or the letter O or whatever) when you tap it, but works as a Control key or a Shift key when you hold it down. - -These are the values you can use for the `mod` in `MT()` and `OSM()`: - - * MOD_LCTL - * MOD_LSFT - * MOD_LALT - * MOD_LGUI - * MOD_RCTL - * MOD_RSFT - * MOD_RALT - * MOD_RGUI - * MOD_HYPR - * MOD_MEH - -These can also be combined like `MOD_LCTL | MOD_LSFT` e.g. `MT(MOD_LCTL | MOD_LSFT, KC_ESC)` which would activate Control and Shift when held, and send Escape when tapped. - -We've added shortcuts to make common modifier/tap (mod-tap) mappings more compact: - - * `CTL_T(kc)` - is LCTL when held and *kc* when tapped - * `SFT_T(kc)` - is LSFT when held and *kc* when tapped - * `ALT_T(kc)` - is LALT when held and *kc* when tapped - * `ALGR_T(kc)` - is AltGr when held and *kc* when tapped - * `GUI_T(kc)` - is LGUI when held and *kc* when tapped - * `ALL_T(kc)` - is Hyper (all mods) when held and *kc* when tapped. To read more about what you can do with a Hyper key, see [this blog post by Brett Terpstra](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) - * `LCAG_T(kc)` - is CtrlAltGui when held and *kc* when tapped - * `MEH_T(kc)` - is like Hyper, but not as cool -- does not include the Cmd/Win key, so just sends Alt+Ctrl+Shift. +These allow you to combine a modifier with a keycode. When pressed, the keydown event for the modifier, then `kc` will be sent. On release, the keyup event for `kc`, then the modifier will be sent. + +|Key |Aliases |Description | +|----------|----------------------|----------------------------------------------------| +|`LCTL(kc)`| |Hold Left Control and press `kc` | +|`LSFT(kc)`|`S(kc)` |Hold Left Shift and press `kc` | +|`LALT(kc)`| |Hold Left Alt and press `kc` | +|`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | +|`RCTL(kc)`| |Hold Right Control and press `kc` | +|`RSFT(kc)`| |Hold Right Shift and press `kc` | +|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | +|`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| +|`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | +|`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | +|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | +|`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | +|`LCA(kc)` | |Hold Left Control and Alt and press `kc` | + +You can also chain them, for example `LCTL(LALT(KC_DEL))` makes a key that sends Control+Alt+Delete with a single keypress. + +# Mod-Tap + +The Mod-Tap key `MT(mod, kc)` acts like a modifier when held, and a regular keycode when tapped. In other words, you can have a key that sends Escape when you tap it, but functions as a Control or Shift key when you hold it down. + +The modifiers this keycode and `OSM()` accept are prefixed with `MOD_`, not `KC_`: + +|Modifier |Description | +|----------|----------------------------------------| +|`MOD_LCTL`|Left Control | +|`MOD_LSFT`|Left Shift | +|`MOD_LALT`|Left Alt | +|`MOD_LGUI`|Left GUI (Windows/Command/Meta key) | +|`MOD_RCTL`|Right Control | +|`MOD_RSFT`|Right Shift | +|`MOD_RALT`|Right Alt | +|`MOD_RGUI`|Right GUI (Windows/Command/Meta key) | +|`MOD_HYPR`|Hyper (Left Control, Shift, Alt and GUI)| +|`MOD_MEH` |Meh (Left Control, Shift, and Alt) | + +You can combine these by ORing them together like so: + +```c +MT(MOD_LCTL | MOD_LSFT, KC_ESC) +``` + +This key would activate Left Control and Left Shift when held, and send Escape when tapped. + +For convenience, QMK includes some Mod-Tap shortcuts to make common combinations more compact in your keymap: + +|Key |Aliases |Description | +|------------|---------------------------------------|-------------------------------------------------------| +|`LCTL_T(kc)`|`CTL_T(kc)` |Left Control when held, `kc` when tapped | +|`RCTL_T(kc)`| |Right Control when held, `kc` when tapped | +|`LSFT_T(kc)`|`SFT_T(kc)` |Left Shift when held, `kc` when tapped | +|`RSFT_T(kc)`| |Right Shift when held, `kc` when tapped | +|`LALT_T(kc)`|`ALT_T(kc)` |Left Alt when held, `kc` when tapped | +|`RALT_T(kc)`|`ALGR_T(kc)` |Right Alt when held, `kc` when tapped | +|`LGUI_T(kc)`|`LCMD_T(kc)`, `RWIN_T(kc)`, `GUI_T(kc)`|Left GUI when held, `kc` when tapped | +|`RGUI_T(kc)`|`RCMD_T(kc)`, `RWIN_T(kc)` |Right GUI when held, `kc` when tapped | +|`C_S_T(kc)` | |Left Control and Shift when held, `kc` when tapped | +|`MEH_T(kc)` | |Left Control, Shift and Alt when held, `kc` when tapped| +|`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | +|`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | +|`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| +|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | # One Shot Keys diff --git a/docs/keycodes.md b/docs/keycodes.md index fd3776bb72..c344a75283 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -318,7 +318,7 @@ This is a reference only. Each group of keys links to the page documenting their ## [Modifiers](feature_advanced_keycodes.md#modifier-keys) |Key |Aliases |Description | -|----------|---------- |----------------------------------------------------| +|----------|----------------------|----------------------------------------------------| |`KC_HYPR` | |Hold Left Control, Shift, Alt and GUI | |`KC_MEH` | |Hold Left Control, Shift and Alt | |`LCTL(kc)`| |Hold Left Control and press `kc` | @@ -353,7 +353,7 @@ This is a reference only. Each group of keys links to the page documenting their |`LCAG_T(kc)`| |Left Control, Alt and GUI when held, `kc` when tapped | |`RCAG_T(kc)`| |Right Control, Alt and GUI when held, `kc` when tapped | |`ALL_T(kc)` | |Left Control, Shift, Alt and GUI when held, `kc` when tapped - more info [here](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/)| -|`SCMD_T(kc)`|`SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | +|`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | ## [RGB Lighting](feature_rgblight.md) -- cgit v1.2.3 From b61653739b791cc18dd6516337ed8b2daa8663fc Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Thu, 30 Aug 2018 16:49:17 -0400 Subject: Keyboard: CTRL and ALT updates (#3810) Update to CTRL and ALT keyboard files --- keyboards/massdrop/alt67/info.json | 80 +++++++++++++++++ keyboards/massdrop/alt67/keymaps/default/keymap.c | 2 +- keyboards/massdrop/alt67/readme.md | 5 -- keyboards/massdrop/ctrl/info.json | 100 ++++++++++++++++++++++ keyboards/massdrop/ctrl/readme.md | 5 -- 5 files changed, 181 insertions(+), 11 deletions(-) create mode 100644 keyboards/massdrop/alt67/info.json create mode 100644 keyboards/massdrop/ctrl/info.json diff --git a/keyboards/massdrop/alt67/info.json b/keyboards/massdrop/alt67/info.json new file mode 100644 index 0000000000..eca47ac4ec --- /dev/null +++ b/keyboards/massdrop/alt67/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "ALT", + "url": "https://www.massdrop.com/buy/massdrop-alt-mechanical-keyboard", + "maintainer": "Massdrop", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"ESCAPE", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"MINUS", "x":11, "y":0}, + {"label":"EQUALS", "x":12, "y":0}, + {"label":"BACKSPACE", "x":13, "y":0, "w":2}, + {"label":"DELETE", "x":15, "y":0}, + {"label":"TAB", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"LEFT BRACKET", "x":11.5, "y":1}, + {"label":"RIGHT BRACKET", "x":12.5, "y":1}, + {"label":"BACK SLASH", "x":13.5, "y":1, "w":1.5}, + {"label":"HOME", "x":15, "y":1}, + {"label":"CAPS LOCK", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"SEMICOLON", "x":10.75, "y":2}, + {"label":"SINGLE TICK", "x":11.75, "y":2}, + {"label":"ENTER", "x":12.75, "y":2, "w":2.25}, + {"label":"PAGE UP", "x":15, "y":2}, + {"label":"LEFT SHIFT", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"COMMA", "x":9.25, "y":3}, + {"label":"PERIOD", "x":10.25, "y":3}, + {"label":"FORWARD SLASH", "x":11.25, "y":3}, + {"label":"RIGHT SHIFT", "x":12.25, "y":3, "w":1.75}, + {"label":"UP ARROW", "x":14, "y":3}, + {"label":"PAGE DOWN", "x":15, "y":3}, + {"label":"LEFT CTRL", "x":0, "y":4, "w":1.25}, + {"label":"LEFT WIN", "x":1.25, "y":4, "w":1.25}, + {"label":"LEFT ALT", "x":2.5, "y":4, "w":1.25}, + {"label":"SPACEBAR", "x":3.75, "y":4, "w":6.25}, + {"label":"RIGHT ALT", "x":10, "y":4, "w":1.25}, + {"label":"FN", "x":11.25, "y":4, "w":1.25}, + {"label":"LEFT ARROW", "x":13, "y":4}, + {"label":"DOWN ARROW", "x":14, "y":4}, + {"label":"RIGHT ARROW", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/massdrop/alt67/keymaps/default/keymap.c b/keyboards/massdrop/alt67/keymaps/default/keymap.c index 8b77da55a6..b8d0b6c03c 100644 --- a/keyboards/massdrop/alt67/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt67/keymaps/default/keymap.c @@ -34,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( - KC_TRNS, 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_TRNS, KC_MUTE, \ + KC_GRV, 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_TRNS, KC_MUTE, \ L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ diff --git a/keyboards/massdrop/alt67/readme.md b/keyboards/massdrop/alt67/readme.md index cc33349c94..551c10c208 100644 --- a/keyboards/massdrop/alt67/readme.md +++ b/keyboards/massdrop/alt67/readme.md @@ -17,9 +17,4 @@ For information on flashing this keyboard, visit the following links: [Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) [Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) -For information on flashing this keyboard, visit the following links: - -[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) -[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) - 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). \ No newline at end of file diff --git a/keyboards/massdrop/ctrl/info.json b/keyboards/massdrop/ctrl/info.json new file mode 100644 index 0000000000..5eac2937b5 --- /dev/null +++ b/keyboards/massdrop/ctrl/info.json @@ -0,0 +1,100 @@ +{ + "keyboard_name": "CTRL", + "url": "https://www.massdrop.com/buy/massdrop-ctrl-mechanical-keyboard", + "maintainer": "Massdrop", + "width": 18.5, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"ESCAPE", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PRINT SCREEN", "x":15.5, "y":0}, + {"label":"SCROLL LOCK", "x":16.5, "y":0}, + {"label":"PAUSE BREAK", "x":17.5, "y":0}, + {"label":"BACKTICK", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"MINUS", "x":11, "y":1.5}, + {"label":"EQUALS", "x":12, "y":1.5}, + {"label":"BACKSPACE", "x":13, "y":1.5, "w":2}, + {"label":"INSERT", "x":15.5, "y":1.5}, + {"label":"HOME", "x":16.5, "y":1.5}, + {"label":"PAGE UP", "x":17.5, "y":1.5}, + {"label":"TAB", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"LEFT BRACKET", "x":11.5, "y":2.5}, + {"label":"RIGHT BRACKET", "x":12.5, "y":2.5}, + {"label":"BACK SLASH", "x":13.5, "y":2.5, "w":1.5}, + {"label":"DELETE", "x":15.5, "y":2.5}, + {"label":"END", "x":16.5, "y":2.5}, + {"label":"PAGE DOWN", "x":17.5, "y":2.5}, + {"label":"CAPS LOCK", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":"SEMICOLON", "x":10.75, "y":3.5}, + {"label":"SINGLE TICK", "x":11.75, "y":3.5}, + {"label":"ENTER", "x":12.75, "y":3.5, "w":2.25}, + {"label":"LEFT SHIFT", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"COMMA", "x":9.25, "y":4.5}, + {"label":"PERIOD", "x":10.25, "y":4.5}, + {"label":"FORWARD SLASH", "x":11.25, "y":4.5}, + {"label":"RIGHT SHIFT", "x":12.25, "y":4.5, "w":2.75}, + {"label":"UP ARROW", "x":16.5, "y":4.5}, + {"label":"LEFT CTRL", "x":0.005, "y":5.5, "w":1.24}, + {"label":"LEFT WIN", "x":1.255, "y":5.5, "w":1.24}, + {"label":"LEFT ALT", "x":2.505, "y":5.5, "w":1.24}, + {"label":"SPACEBAR", "x":3.75, "y":5.5, "w":6.25}, + {"label":"RIGHT ALT", "x":10, "y":5.5, "w":1.25}, + {"label":"FN", "x":11.25, "y":5.5, "w":1.25}, + {"label":"MENU", "x":12.5, "y":5.5, "w":1.25}, + {"label":"RIGHT CTRL", "x":13.75, "y":5.5, "w":1.25}, + {"label":"LEFT ARROW", "x":15.5, "y":5.5}, + {"label":"DOWN ARROW", "x":16.5, "y":5.5}, + {"label":"RIGHT ARROW", "x":17.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/massdrop/ctrl/readme.md b/keyboards/massdrop/ctrl/readme.md index 5e504d96d4..656ef9ac9f 100644 --- a/keyboards/massdrop/ctrl/readme.md +++ b/keyboards/massdrop/ctrl/readme.md @@ -17,9 +17,4 @@ For information on flashing this keyboard, visit the following links: [Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) [Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) -For information on flashing this keyboard, visit the following links: - -[Massdrop Loader Releases](https://github.com/Massdrop/mdloader/releases/tag/0.0.1) -[Massdrop Loader Repository and Instructions](https://github.com/Massdrop/mdloader) - 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). \ No newline at end of file -- cgit v1.2.3 From be94e5e59138e5357632b84734476a574e9f0d1a Mon Sep 17 00:00:00 2001 From: Salt-Peanuts Date: Thu, 30 Aug 2018 18:38:31 -0400 Subject: Keymap: Updated keymap with the "pretty" layout (#3812) --- .../kinesis/keymaps/insertsnideremarks/keymap.c | 697 +++++++++------------ .../kinesis/keymaps/insertsnideremarks/readme.md | 18 +- .../kinesis/keymaps/insertsnideremarks/rules.mk | 2 +- 3 files changed, 295 insertions(+), 422 deletions(-) diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c index bf75327f1b..78defea237 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c +++ b/keyboards/kinesis/keymaps/insertsnideremarks/keymap.c @@ -78,454 +78,327 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Fundtion Row Keys -/ (Identical across layers, unless otherwise noted; Numpad is a toggle; Adjust is mometary) -* ,-----------------------------------------------------------------------------------------------------------. -* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| -* `-----------------------------------------------------------------------------------------------------------' -*/ - /* Colemak -* (Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) -* ,-------------------------------------------. ,-------------------------------------------. -* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* |Esc/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* |SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | Ins | ` | [ | ] | | Left | Down | Up | Right| -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* |Esc/Ctl| Hyper | | RAlt | RCtl | -* ,-------|-------|-------| |-------+-------+-------. -* | Space | Enter |App/Alt| | RGUI | Delete| Bspc | -* | / | / |-------| |-------| / | / | -* | Fn | Number| Bspc | | Enter |Number2| Fn2 | -* `-----------------------' `-----------------------' + (Defauit layer; keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |Esc/Ctrl| A | R | S | T | D | | H | N | E | I | O | ' | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |SC Shift| Z | X | C | V | B | | K | M | , | . | / |SC Shift| + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right| + `---------------------------' `---------------------------' + ,---------------. ,---------------. + |Esc/Ctl| Hyper | | RAlt | RCtl | + ,-------|-------|-------| |-------+-------+-------. + | Space | Enter |App/Alt| | RGUI | Delete| Bspc | + | / | / |-------| |-------| / | / | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | + `-----------------------' `-----------------------' */ -[_COLEMAK] = LAYOUT( - // Left Hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, - CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, - //Left Thumb - CTLESC, ALL_T(KC_NO), - ALTAPP, - SPCFN, ENTNS, KC_BSPC, - //Right Hand - KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - //Right Thumb - KC_RALT, KC_RCTL, - KC_RGUI, - KC_ENT, DELNS, BSPCFN +[_COLEMAK] = LAYOUT_pretty( + 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, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + CTLESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, ALL_T(KC_NO), KC_RALT, KC_RCTL, + ALTAPP, KC_RGUI, + SPCFN, ENTNS, KC_BSPC, KC_ENT, DELNS, BSPCFN ), /* QWERTY -* (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) -* ,-------------------------------------------. ,-------------------------------------------. -* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* |Esc/Ctrl| A | S | D | F | G | | H | J | K | L | ; | ' | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* |SC Shift| Z | X | C | V | B | | N | M | , | . | / |SC Shift| -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | Ins | ` | [ | ] | | Left | Down | Up | Right| -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* |Esc/Ctl| Hyper | | RAlt | RCtl | -* ,-------|-------|-------| |-------+-------+-------. -* | Space | Enter |App/Alt| | RGUI | Delete| Bspc | -* | / | / |-------| |-------| / | / | -* | Fn | Number| Bspc | | Enter |Number2| Fn2 | -* `-----------------------' `-----------------------' + (Keys separated by /: tap for first, hold for second; uses Space Cadet Shifts) + ,-----------------------------------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |Esc/Ctrl| A | S | D | F | G | | H | J | K | L | ; | ' | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + |SC Shift| Z | X | C | V | B | | N | M | , | . | / |SC Shift| + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right| + `---------------------------' `---------------------------' + ,---------------. ,---------------. + |Esc/Ctl| Hyper | | RAlt | RCtl | + ,-------|-------|-------| |-------+-------+-------. + | Space | Enter |App/Alt| | RGUI | Delete| Bspc | + | / | / |-------| |-------| / | / | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | + `-----------------------' `-----------------------' */ -[_QWERTY] = LAYOUT( - // Left Hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, - CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, - //Left Thumb - CTLESC, ALL_T(KC_NO), - ALTAPP, - SPCFN, ENTNS, KC_BSPC, - - //Right Hand - KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - //Right Thumb - KC_RALT, KC_RCTL, - KC_RGUI, - KC_ENT, DELNS, BSPCFN +[_QWERTY] = LAYOUT_pretty( + 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, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + CTLESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, ALL_T(KC_NO), KC_RALT, KC_RCTL, + ALTAPP, KC_RGUI, + SPCFN, ENTNS, KC_BSPC, KC_ENT, DELNS, BSPCFN ), /* Number/symbol layer -* (Multiple characters: single-tap for first, double-tap for second) -* ,-------------------------------------------. ,-------------------------------------------. -* | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | ( | ) | [ { | ] } | | | | | | -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* | | | | | | -* ,-------|-------|-------| |-------+-------+-------. -* | | | | | | | | -* | | |-------| |-------| | | -* | | | | | | | | -* `-----------------------' `-----------------------' + (Multiple characters: single-tap for first, double-tap for second) + ,-----------------------------------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | 6 | 7 | 8 | 9 | 0 | | ^ | & | * | ( | ) | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | 1 | 2 | 3 | 4 | 5 | | ! | @ | # | $ | % | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | . | / * | - _ | + = | | ` ~ | [ { | ] } | | | | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | ( | ) | [ { | ] } | | | | | | + `---------------------------' `---------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------|-------|-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' */ -[_NUMBERS] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, KC_6, KC_7, KC_8, KC_9, KC_0, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, - _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, - TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - _______, _______, _______, _______, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_NUMBERS] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -[_NUMBERS2] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, KC_6, KC_7, KC_8, KC_9, KC_0, - _______, KC_1, KC_2, KC_3, KC_4, KC_5, - _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, - TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, - _______, _______, _______, _______, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_NUMBERS2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, + _______, _______, KC_DOT, TD(SLAS), TD(MNUN), TD(PLEQ), TD(GVTL), TD(LBCB), TD(RBCB), _______, _______, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), /* Function layer -* ,-------------------------------------------. ,-------------------------------------------. -* | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | | Up | | | | | | Up |Ctrl+Y| | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | |Ctrl+A| Left | Down | Right|C+A+Tb| | PgUp | Right| Down | Left | Home | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | |Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | | | | | | Prev | Play | Next | Stop | -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* | | | | | | -* ,-------|-------|-------| |-------+-------+-------. -* | | | | | | | | -* | | |-------| |-------| | | -* | | | | | | | | -* `-----------------------' `-----------------------' + ,-----------------------------------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | F12 | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | | Up | | | | | | Up |Ctrl+Y| | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | |Ctrl+A| Left | Down | Right|C+A+Tb| | PgUp | Right| Down | Left | Home | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | |Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | | | | | | Prev | Play | Next | Stop | + `---------------------------' `---------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------|-------|-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' */ -[_FUNCTION] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, _______, _______, KC_UP, _______, _______, - _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), - _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, - _______, _______, _______, _______, - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, _______, KC_UP, LCTL(KC_Y), _______, _______, - KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, - KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, - KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_FUNCTION] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -[_FUNCTION2] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, - _______, _______, _______, KC_UP, _______, _______, - _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), - _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, - _______, _______, _______, _______, - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, _______, KC_UP, LCTL(KC_Y), _______, _______, - KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, - KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, - KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_FUNCTION2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, _______, _______, KC_UP, _______, _______, _______, _______, KC_UP, LCTL(KC_Y), _______, _______, + _______, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RGHT, LCA(KC_TAB), KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, KC_HOME, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), KC_BSPC, KC_PGDN, KC_MUTE, KC_VOLD, KC_VOLU, KC_END, _______, + _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), /* Numpad layer -* (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) -* ,-------------------------------------------. ,-------------------------------------------. -* | | NumLk| | | | | | Tab | NumLk| KP / | KP * | KP - | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | KP 7 | KP 8 | KP 9 | KP + | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | KP 4 | KP 5 | KP 6 | = | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | KP . |KP/KP*| KP- _| KP+ =| | | KP 1 | KP 2 | KP 3 |KP Ent| | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | ( | ) | [ { | ] } | | KP 0 | , | KP . |KP Ent| -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* | | | | | | -* ,-------|-------|-------| |-------+-------+-------. -* | | | | | | | | -* | | |-------| |-------| | | -* | | | | | KP Ent| | | -* `-----------------------' `-----------------------' + (Left side duplicates layout from the Numbers layer, just with numpad output; right side layout close to PC numpad layout) + ,-----------------------------------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | | NumLk| | | | | | Tab | NumLk| KP / | KP * | KP - | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | KP 6 | KP 7 | KP 8 | KP 9 | KP 0 | | | KP 7 | KP 8 | KP 9 | KP + | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | KP 1 | KP 2 | KP 3 | KP 4 | KP 5 | | | KP 4 | KP 5 | KP 6 | = | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | KP . |KP/KP*| KP- _| KP+ =| | | KP 1 | KP 2 | KP 3 |KP Ent| | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | ( | ) | [ { | ] } | | KP 0 | , | KP . |KP Ent| + `---------------------------' `---------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------|-------|-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' */ -[_NUMPAD] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_NLCK, _______, _______, _______, _______, - _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, - _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, - _______, _______, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), - KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, - _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, - _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, - _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, - KC_P0, KC_COMM, KC_PDOT, KC_PENT, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_NUMPAD] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NLCK, _______, _______, _______, _______, KC_TAB, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + _______, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, _______, KC_P7, KC_P8, KC_P9, KC_PPLS, _______, + _______, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, _______, KC_P4, KC_P5, KC_P6, KC_EQL, _______, + _______, _______, KC_PDOT, TD(PSLPAS), TD(PMNUN), TD(PPLEQ), _______, KC_P1, KC_P2, KC_P3, KC_PENT, _______, + KC_LPRN, KC_RPRN, TD(LBCB), TD(RBCB), KC_P0, KC_COMM, KC_PDOT, KC_PENT, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), /* Colemak gaming/vanilla -* (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) -* ,-------------------------------------------. ,-------------------------------------------. -* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Shift | Z | X | C | V | B | | K | M | , | . | / | Shift | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | Ins | ` | [ | ] | | Left | Down | Up | Right| -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | -* ,-------|-------|-------| |-------+-------+-------. -* | | | LAlt | | RGUI | | | -* | Space | Enter |-------| |-------| Delete| Bspc | -* | | |Bspc/FN| | Ent/NS| | | -* `-----------------------' `-----------------------' + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + ,-----------------------------------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | \ | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Shift | Z | X | C | V | B | | K | M | , | . | / | Shift | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right| + `---------------------------' `---------------------------' + ,---------------. ,---------------. + |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + ,-------|-------|-------| |-------+-------+-------. + | | | LAlt | | RGUI | | | + | Space | Enter |-------| |-------| Delete| Bspc | + | | |Bspc/FN| | Ent/NS| | | + `-----------------------' `-----------------------' */ -[_COLEMAKGM] = LAYOUT( - // Left Hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, - //Left Thumb - CTLESC, TD(ADJ), - KC_LALT, - KC_SPC, KC_ENT, BSPCFN, - //Right Hand - KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, - KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - //Right Thumb - KC_RALT, KC_RCTL, - KC_RGUI, - ENTNS, KC_DEL, KC_BSPC +[_COLEMAKGM] = LAYOUT_pretty( + 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, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, TD(ADJ), KC_RALT, KC_RCTL, + KC_LALT, KC_RGUI, + KC_SPC, KC_ENT, BSPCFN, ENTNS, KC_DEL, KC_BSPC ), /* QWERTY gaming/vanilla -* (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) -* ,-------------------------------------------. ,-------------------------------------------. -* | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | Ins | ` | [ | ] | | Left | Down | Up | Right| -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | -* ,-------|-------|-------| |-------+-------+-------. -* | | | LAlt | | RGUI | | | -* | Space | Enter |-------| |-------| Delete| Bspc | -* | | |Bspc/FN| | Ent/NS| | | -* `-----------------------' `-----------------------' + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) + ,-----------------------------------------------------------------------------------------------------------. + | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | = | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Tab | Q | W | E | R | T | | Y | U | I | O | P | \ | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | Shift | Z | X | C | V | B | | N | M | , | . | / | Shift | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | Ins | ` | [ | ] | | Left | Down | Up | Right| + `---------------------------' `---------------------------' + ,---------------. ,---------------. + |Esc/Ctl|TD(ADJ)| | RAlt | RCtl | + ,-------|-------|-------| |-------+-------+-------. + | | | LAlt | | RGUI | | | + | Space | Enter |-------| |-------| Delete| Bspc | + | | |Bspc/FN| | Ent/NS| | | + `-----------------------' `-----------------------' */ -[_QWERTYGM] = LAYOUT( - // Left Hand - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, - KC_INS, KC_GRV, KC_LBRC, KC_RBRC, - //Left Thumb - CTLESC, TD(ADJ), - KC_LALT, - KC_SPC, KC_ENT, BSPCFN, - //Right Hand - KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, NUMPAD, ADJUST, - KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, - //Right Thumb - KC_RALT, KC_RCTL, - KC_RGUI, - ENTNS, KC_DEL, KC_BSPC +[_QWERTYGM] = LAYOUT_pretty( + 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, NUMPAD, ADJUST, + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_INS, KC_GRV, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, + CTLESC, TD(ADJ), KC_RALT, KC_RCTL, + KC_LALT, KC_RGUI, + KC_SPC, KC_ENT, BSPCFN, ENTNS, KC_DEL, KC_BSPC ), /* Adjust layer -* (Enter/Number + Delete/Number2 under non-gaming/vanilla layers; Numpad is a toggle) -* ,-------------------------------------------. ,-------------------------------------------. -* | |Colmak|Qwerty| |ClmkGM| QWGM | |Numpad| | | | | RESET | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | | | | | | | | | | | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | | | | | | |NKROTG| | | | | -* |--------+------+------+------+------+------| |------+------+------+------+------+--------| -* | | | | | | | | | | | | | | -* `--------+------+------+------+------+------' `------+------+------+------+------+--------' -* | | | | | | | | | | -* `---------------------------' `---------------------------' -* ,---------------. ,---------------. -* | | | | | | -* ,-------|-------|-------| |-------+-------+-------. -* | | | | | | | | -* | | |-------| |-------| | | -* | | | | | | | | -* `-----------------------' `-----------------------' + (Enter/Number + Delete/Number2 under non-gaming/vanilla layers or press & hold Adjust key on function row; Numpad is a toggle) + ,-----------------------------------------------------------------------------------------------------------. + | | | | | | | | | | | | | | | | | | | + `-----------------------------------------------------------------------------------------------------------' + ,-------------------------------------------. ,-------------------------------------------. + | |Colmak|Qwerty| |ClmkGM| QWGM | |Numpad| | | | | RESET | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | | | | | | | | | | | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | | | | | | | NKRO | | | | | + |--------+------+------+------+------+------| |------+------+------+------+------+--------| + | | | | | | | | | | | | | | + `--------+------+------+------+------+------' `------+------+------+------+------+--------' + | | | | | | | | | | + `---------------------------' `---------------------------' + ,---------------. ,---------------. + | | | | | | + ,-------|-------|-------| |-------+-------+-------. + | | | | | | | | + | | |-------| |-------| | | + | | | | | | | | + `-----------------------' `-----------------------' */ -[_ADJUST] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - NUMPAD, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, - _______, NKROTG, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_ADJUST] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -[_ADJUST2] = LAYOUT( - // Left Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - // Left Thumb - _______, _______, - _______, - _______, _______, _______, - // Right Hand - _______, _______, _______, _______, _______, _______, _______, _______, _______, - NUMPAD, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, _______, _______, - _______, NKROTG, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, - // Right Thumb - _______, _______, - _______, - _______, _______, _______ +[_ADJUST2] = LAYOUT_pretty( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, COLEMAK, QWERTY, _______, COLEMAKGM, QWERTYGM, NUMPAD, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, NKROTG, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md index f774ef444a..7a146c7a29 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/readme.md +++ b/keyboards/kinesis/keymaps/insertsnideremarks/readme.md @@ -14,7 +14,7 @@ I've largely left the function keys untouched, with the intension of not using t I use Colemak as my default layout. I've included QWERTY here as well. -Additionally, I've added gaming/vanilla version of Colemak and QWERTY layouts. These layouts have no access to the Function or Numbers layers, thus no dual-role keys with layer access, and are mainly used for gaming. +Additionally, I've added gaming/vanilla version of Colemak and QWERTY layouts. These layouts have limited access to the Function or Numbers layers, and are mainly used for gaming. Persistent default layer has been enabled for Colemak and QWERTY. The gaming/vanilla Colemak and QWERTY can be set as default layer, but will not be persistent. @@ -46,7 +46,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ,-------|-------|-------| |-------+-------+-------. | Space | Enter |App/Alt| | RGUI | Delete| Bspc | | / | / |-------| |-------| / | / | - | Fn | Number| Bspc | | Tab |Number2| Fn2 | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | `-----------------------' `-----------------------' @@ -71,7 +71,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ,-------|-------|-------| |-------+-------+-------. | Space | Enter |App/Alt| | RGUI | Delete| Bspc | | / | / |-------| |-------| / | / | - | Fn | Number| Bspc | | Tab |Number2| Fn2 | + | Fn | Number| Bspc | | Enter |Number2| Fn2 | `-----------------------' `-----------------------' @@ -109,9 +109,9 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va |--------+------+------+------+------+------| |------+------+------+------+------+--------| | | | | Up | | | | | | Up |Ctrl+Y| | | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | |Ctrl+A| Left | Down | Right| | | PgUp | Right| Down | Left | Home | | + | |Ctrl+A| Left | Down | Right|C+A+Tb| | PgUp | Right| Down | Left | Home | | |--------+------+------+------+------+------| |------+------+------+------+------+--------| - | |Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V| | | PgDn | Mute | Vol- | Vol+ | End | | + | |Ctrl+Z|Ctrl+X|Ctrl+C|Ctrl+V| Bspc | | PgDn | Mute | Vol- | Vol+ | End | | `--------+------+------+------+------+------' `------+------+------+------+------+--------' | | | | | | Prev | Play | Next | Stop | `---------------------------' `---------------------------' @@ -120,7 +120,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ,-------|-------|-------| |-------+-------+-------. | | | | | | | | | | |-------| |-------| | | - | | | | |C+A+Tab| | | + | | | | | | | | `-----------------------' `-----------------------' @@ -150,7 +150,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ### Colemak gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -175,7 +175,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va ### QWERTY gaming/vanilla - (Limited access to Function or Numbers layers; mainly used for gaming; double-tap TD(ADJ) for one shot access to Adjust layer) + (Limited access to Function or Numbers layers; mainly used for gaming; double-tap and hold TD(ADJ) above LAlt to access Adjust layer) ,-----------------------------------------------------------------------------------------------------------. | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr| SLck| Paus|Numpd|Adjst| `-----------------------------------------------------------------------------------------------------------' @@ -199,7 +199,7 @@ Persistent default layer has been enabled for Colemak and QWERTY. The gaming/va `-----------------------' `-----------------------' ### Adjust layer - (Press Enter/Number + Delete/Number2 together under non-gaming/vanilla layers; Numpad is a toggle) + (Press Enter/Number + Delete/Number2 under non-gaming/vanilla layers or press & hold Adjust key on function row; Numpad is a toggle) ,-----------------------------------------------------------------------------------------------------------. | | | | | | | | | | | | | | | | | | | `-----------------------------------------------------------------------------------------------------------' diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk index e1af05cb44..8e4a8ffada 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk +++ b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk @@ -5,7 +5,7 @@ DEFAULT_FOLDER = kinesis/stapelberg BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration -- cgit v1.2.3 From 94f92cedef54403b2d6df9ce7a2715d3c4732378 Mon Sep 17 00:00:00 2001 From: ishtob Date: Fri, 31 Aug 2018 10:37:13 -0400 Subject: Fix emulated EEPROM start address on STM32F303 (#3819) MCU has 254 flash, changed 250 to 254. tested working on a planck rev6 --- tmk_core/common/chibios/eeprom_stm32.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h index d06d302665..68aa14f6d4 100755 --- a/tmk_core/common/chibios/eeprom_stm32.h +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -48,7 +48,7 @@ #elif defined (MCU_STM32F103RD) #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 384 * 1024 - 2 * EEPROM_PAGE_SIZE)) #elif defined (MCU_STM32F303CC) - #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 250 * 1024 - 2 * EEPROM_PAGE_SIZE)) + #define EEPROM_START_ADDRESS ((uint32_t)(0x8000000 + 256 * 1024 - 2 * EEPROM_PAGE_SIZE)) #else #error "No MCU type specified. Add something like -DMCU_STM32F103RB to your compiler arguments (probably in a Makefile)." #endif -- cgit v1.2.3 From 2cd80f84a416153cb17bc4543477be0d708e6f0f Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 31 Aug 2018 10:38:06 -0400 Subject: Keyboard: CTRL and ALT keyboard json fix (#3816) Fixed incorrect layout names --- keyboards/massdrop/alt67/info.json | 2 +- keyboards/massdrop/ctrl/info.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/massdrop/alt67/info.json b/keyboards/massdrop/alt67/info.json index eca47ac4ec..8f85bece21 100644 --- a/keyboards/massdrop/alt67/info.json +++ b/keyboards/massdrop/alt67/info.json @@ -5,7 +5,7 @@ "width": 16, "height": 5, "layouts": { - "LAYOUT_all": { + "LAYOUT": { "layout": [ {"label":"ESCAPE", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, diff --git a/keyboards/massdrop/ctrl/info.json b/keyboards/massdrop/ctrl/info.json index 5eac2937b5..2212540e52 100644 --- a/keyboards/massdrop/ctrl/info.json +++ b/keyboards/massdrop/ctrl/info.json @@ -5,7 +5,7 @@ "width": 18.5, "height": 6.5, "layouts": { - "LAYOUT_all": { + "LAYOUT": { "layout": [ {"label":"ESCAPE", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, -- cgit v1.2.3 From f9eedd7ce741f15a1d5ff7327cb44d3979a46e35 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 31 Aug 2018 16:12:37 +0100 Subject: Keymap: Add backlight controls for Planck Light in dshields keymap (#3801) --- keyboards/planck/keymaps/dshields/keymap.c | 10 +++++++++- keyboards/planck/keymaps/dshields/rules.mk | 16 +++++++++++----- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index 86443d6716..a39dc5e776 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -8,6 +8,14 @@ enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE }; #include "dynamic_macro.h" +#ifdef KEYBOARD_planck_light + #define LGT_TOG RGB_TOG + #define LGT_MOD RGB_MOD +#else + #define LGT_TOG BL_TOGG + #define LGT_MOD BL_STEP +#endif + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Default * ,-----------------------------------------------------------------------------------. @@ -74,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [FUN] = LAYOUT_planck_grid( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 , KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, - BL_TOGG, BL_STEP, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, + LGT_TOG, LGT_MOD, _______, _______, _______, DM_STRT, DM_STOP, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R ) }; diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index a084c67de8..8799c78f06 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -3,11 +3,17 @@ ifndef QUANTUM_DIR endif MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -AUDIO_ENABLE = no API_SYSEX_ENABLE = no -BOOTLOADER = qmk-dfu + +ifneq (,$(findstring planck/light,$(KEYBOARD))) + AUDIO_ENABLE = yes + BACKLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes +else + AUDIO_ENABLE = no + BACKLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no +endif -- cgit v1.2.3 From 4e45119796049f1c2f9e0c99a0ad6f0f932691b5 Mon Sep 17 00:00:00 2001 From: blindassassin111 <38090555+blindassassin111@users.noreply.github.com> Date: Fri, 31 Aug 2018 10:15:09 -0500 Subject: Keyboard: Adding Z-150 PCB firmware (#3793) * Adding the AT101 PCB firmware * Fixed AT101 keymap error * Fixing AT101 firmware * More Fixes for AT101 firmware * Rename AT101_Blackheart.c to at101_blackheart.c * Rename AT101_Blackheart.h to at101_blackheart.h * Update readme.md * Renaming AT101 folder pt1 * Renaming AT101 folder pt2 * Fixing AT101 LED function name * Redoing AT101 folder naming pt2 Last round had issues, should be the last rename. * Fixing missing comma in at101_blackheart.h * Adding Z-150 PCB * Adding Z-150 readme file * Fixing Z-150 firmware errors * Fixing Z-150 layout error * Fixing Z-150 firmware errors * Fixing Z-150 Issues Still unsure where the extra "\" is that through the error. * Fixing more Z-150 errors * Finally fixing the Z-150 error * Fixed Z-150 layout naming * Removed Z-150 layout fillers --- keyboards/z150_blackheart/config.h | 52 ++++++++++++++++ keyboards/z150_blackheart/keymaps/default/keymap.c | 69 ++++++++++++++++++++++ keyboards/z150_blackheart/readme.md | 14 +++++ keyboards/z150_blackheart/rules.mk | 58 ++++++++++++++++++ keyboards/z150_blackheart/z150_blackheart.c | 1 + keyboards/z150_blackheart/z150_blackheart.h | 34 +++++++++++ 6 files changed, 228 insertions(+) create mode 100644 keyboards/z150_blackheart/config.h create mode 100644 keyboards/z150_blackheart/keymaps/default/keymap.c create mode 100644 keyboards/z150_blackheart/readme.md create mode 100644 keyboards/z150_blackheart/rules.mk create mode 100644 keyboards/z150_blackheart/z150_blackheart.c create mode 100644 keyboards/z150_blackheart/z150_blackheart.h diff --git a/keyboards/z150_blackheart/config.h b/keyboards/z150_blackheart/config.h new file mode 100644 index 0000000000..d2fce9aeef --- /dev/null +++ b/keyboards/z150_blackheart/config.h @@ -0,0 +1,52 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER blindassassin111 +#define PRODUCT Z-150 PCB +#define DESCRIPTION Replacement for Zenith Z-150 PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 20 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { C3, C2, C1, C0, E1 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D4, D5, D7, E0, C7, C6, C5, C4, F0, F1, F2, F3, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 n-key rollover*/ +#define FORCE_NKRO + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif \ No newline at end of file diff --git a/keyboards/z150_blackheart/keymaps/default/keymap.c b/keyboards/z150_blackheart/keymaps/default/keymap.c new file mode 100644 index 0000000000..e93802052a --- /dev/null +++ b/keyboards/z150_blackheart/keymaps/default/keymap.c @@ -0,0 +1,69 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_F1, KC_F2, KC_ESC, 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_NLCK, KC_SLCK, MO(1), + KC_F3, KC_F4, 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_ENT, KC_P7, KC_P8, KC_P9, KC_PAST, + KC_F5, KC_F6, KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_F7, KC_F8, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH, KC_RSFT, KC_BSLS, KC_P1, KC_P2, KC_P3, KC_PPLS, + KC_F9, KC_F10, KC_LALT, KC_GRV, KC_SPC, KC_CAPS, KC_P0, KC_PDOT + ), + + LAYOUT( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + + LAYOUT_z150_tkl( + KC_F1, KC_F2, KC_ESC, 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_F3, KC_F4, 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_F5, KC_F6, 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, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_LSFT, KC_BSLS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, MO(1), XXXXXXX, KC_UP, XXXXXXX, + KC_F9, KC_F10, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + LAYOUT_z150_tkl( + _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + DDRB |= (1 << 0); + DDRE |= (1 << 6) | (1 << 7); + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + PORTE |= (1 << 7); + } else { + PORTE &= ~(1 << 7); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + PORTB |= (1 << 0); + } else { + PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + PORTE |= (1 << 6); + } else { + PORTE &= ~(1 << 6); + } +} \ No newline at end of file diff --git a/keyboards/z150_blackheart/readme.md b/keyboards/z150_blackheart/readme.md new file mode 100644 index 0000000000..5e87b6c8f3 --- /dev/null +++ b/keyboards/z150_blackheart/readme.md @@ -0,0 +1,14 @@ +Z-150 Blackheart PCB +=== + +A replacement PCB for Zenith Z-150 keyboards. + +Keyboard Maintainer: QMK Community and blindassassin111 +Hardware Supported: Z-150 blackheart PCB +Hardware Availability: https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html + +Make example for this keyboard (after setting up your build environment): + + make z150_blackheart: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/z150_blackheart/rules.mk b/keyboards/z150_blackheart/rules.mk new file mode 100644 index 0000000000..b258bf35fd --- /dev/null +++ b/keyboards/z150_blackheart/rules.mk @@ -0,0 +1,58 @@ +# MCU name +MCU = at90usb1286 + +# 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 +BOOTLOADER = halfkay + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/z150_blackheart/z150_blackheart.c b/keyboards/z150_blackheart/z150_blackheart.c new file mode 100644 index 0000000000..10f388cf62 --- /dev/null +++ b/keyboards/z150_blackheart/z150_blackheart.c @@ -0,0 +1 @@ +#include "z150_blackheart.h" diff --git a/keyboards/z150_blackheart/z150_blackheart.h b/keyboards/z150_blackheart/z150_blackheart.h new file mode 100644 index 0000000000..baf187fd2d --- /dev/null +++ b/keyboards/z150_blackheart/z150_blackheart.h @@ -0,0 +1,34 @@ +#ifndef z150_blackheart_H +#define z150_blackheart_H + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, K019, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, K216, K217, K218, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, \ + K400, K401, K402, K403, K407, K414, K415, K417 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K016, K017, KC_NO, K019 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, K117, K118, K119 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215, K216, K217, K218, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, K316, K317, K318, KC_NO }, \ + { K400, K401, K402, K403, KC_NO, KC_NO, KC_NO, K407, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K414, K415, KC_NO, K417, KC_NO, KC_NO } \ +} + +#define LAYOUT_z150_tkl( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, K017, K018, K019, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K117, K118, K119, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K216, K217, K218, \ + K300, K301, K302, K405, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K316, K317, K318, \ + K400, K401, K402, K403, K404, K407, K412, K413, K414, K415, K416, K417, K418 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, KC_NO, K017, K018, K019 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, KC_NO, K117, K118, K119 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, KC_NO, K216, K217, K218, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, KC_NO, K316, K317, K318, KC_NO }, \ + { K400, K401, K402, K403, K404, K405, KC_NO, K407, KC_NO, KC_NO, KC_NO, KC_NO, K412, K413, K414, K415, K416, K417, K418, KC_NO } \ +} + +#endif \ No newline at end of file -- cgit v1.2.3 From 78ef62764bfba2b7cb1fb34e477953c16c7a926d Mon Sep 17 00:00:00 2001 From: Christon DeWan Date: Fri, 31 Aug 2018 11:28:14 -0400 Subject: Keymap: I got my intern a KBParadise V60 Type R... (#3813) * new mode for v60 xtonhasvim. still working on it: - need to get indicator lights going - and fun layer properly fleshed out. * status lighting, proper fun layer copied fun layout from keycaps to maximize accessibility * enable power return * support brightness adjustment for indicators * refined brightness setting. is saved in eeprom now * readme. and fixed tilde * more modifiers fall through fun layer * i mean, this kinda works.. * much more reliable way of restoring lights * responded to feedback --- keyboards/v60_type_r/keymaps/xtonhasvim/config.h | 24 +++ keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c | 196 ++++++++++++++++++++++ keyboards/v60_type_r/keymaps/xtonhasvim/readme.md | 20 +++ keyboards/v60_type_r/keymaps/xtonhasvim/rules.mk | 5 + keyboards/v60_type_r/rules.mk | 2 +- users/xtonhasvim/fancylighting.c | 7 +- users/xtonhasvim/fancylighting.h | 9 +- users/xtonhasvim/xtonhasvim.h | 6 +- 8 files changed, 259 insertions(+), 10 deletions(-) create mode 100644 keyboards/v60_type_r/keymaps/xtonhasvim/config.h create mode 100644 keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c create mode 100644 keyboards/v60_type_r/keymaps/xtonhasvim/readme.md create mode 100644 keyboards/v60_type_r/keymaps/xtonhasvim/rules.mk diff --git a/keyboards/v60_type_r/keymaps/xtonhasvim/config.h b/keyboards/v60_type_r/keymaps/xtonhasvim/config.h new file mode 100644 index 0000000000..997802a56e --- /dev/null +++ b/keyboards/v60_type_r/keymaps/xtonhasvim/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Christon DeWan (Xton) + * + * 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 + +#define V60_POLESTAR + +#define PERMISSIVE_HOLD + + diff --git a/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c b/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c new file mode 100644 index 0000000000..ec337bb22e --- /dev/null +++ b/keyboards/v60_type_r/keymaps/xtonhasvim/keymap.c @@ -0,0 +1,196 @@ +/* Copyright 2018 Christon DeWan (Xton) + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#include "xtonhasvim.h" +#include "fancylighting.h" + +#define _______ KC_TRNS +#define X_____X KC_NO + +enum layers { + _QWERTY, + _FUN, + _MOVE, + _CMD +}; + +enum layout_key_codes { + IND_BRI = VIM_SAFE_RANGE, + IND_DIM +}; + +extern uint8_t vim_cmd_layer(void) { return _CMD; } + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_all( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, X_____X, KC_BSPC, \ + 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, \ + LT(_MOVE, 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, X_____X, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, X_____X, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, VIM_START, MO(_FUN)), + + + [_MOVE] = LAYOUT_all( + X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, + X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, X_____X, X_____X, + _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, X_____X, X_____X, VIM_START, + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, + _______, _______, _______, _______, _______, _______, _______, _______), + + + [_FUN] = LAYOUT_all( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, KC_DEL, \ + X_____X, X_____X, KC_UP, RGB_TOG, IND_BRI, X_____X, X_____X, X_____X, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, X_____X, KC_INS, \ + X_____X, KC_LEFT, KC_DOWN, KC_RIGHT, IND_DIM, X_____X, X_____X, X_____X, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, FIREY_RETURN, \ + _______, X_____X, BL_INC, BL_STEP, BL_DEC, X_____X, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, _______, X_____X, \ + _______, _______, _______, X_____X, _______, _______, X_____X, _______ + ), + + [_CMD] = LAYOUT_all( + VIM_ESC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, + X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, X_____X, X_____X, + _______, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, X_____X, + VIM_SHIFT, X_____X, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT,X_____X, + _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY) + ) +}; + + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<event.pressed) { + switch(keycode) { + case IND_BRI: + if (rgblight_config.val + RGBLIGHT_VAL_STEP > RGBLIGHT_LIMIT_VAL) { + rgblight_config.val = RGBLIGHT_LIMIT_VAL; + } else { + rgblight_config.val = rgblight_config.val + RGBLIGHT_VAL_STEP; + } + eeconfig_update_rgblight(rgblight_config.raw); + set_state_leds(); + break; + case IND_DIM: + if (rgblight_config.val - RGBLIGHT_VAL_STEP < RGBLIGHT_BASE_VAL) { + rgblight_config.val = RGBLIGHT_BASE_VAL; + } else { + rgblight_config.val = rgblight_config.val - RGBLIGHT_VAL_STEP; + } + eeconfig_update_rgblight(rgblight_config.raw); + set_state_leds(); + break; + } + } + return true; +} + +void suspend_power_down_user(void) +{ + // rgb + rgblight_config.enable = false; + rgblight_set(); + + // backlight + /** I don't know why, but 3 means "off" and down is up */ + backlight_config.level = 3; + backlight_config.enable = false; + backlight_set(3); +} + +void suspend_wakeup_init_user(void) +{ + rgblight_config.raw = eeconfig_read_rgblight(); + backlight_config.raw = eeconfig_read_backlight(); + + backlight_set(backlight_config.level); + rgblight_set(); +} + diff --git a/keyboards/v60_type_r/keymaps/xtonhasvim/readme.md b/keyboards/v60_type_r/keymaps/xtonhasvim/readme.md new file mode 100644 index 0000000000..541faed2ba --- /dev/null +++ b/keyboards/v60_type_r/keymaps/xtonhasvim/readme.md @@ -0,0 +1,20 @@ +KB Paradise V60 Type R Xton Has Vim! Layout +====================== + +If you don't look closely, this layout mimics the default layout fairly well. Care +is taken to match the FN layer to the keycaps that the TypeR comes with. I wrote this layout +for a keyboard that I'm giving my intern as a parting gift and wanted it to be as easy to learn +as possible. + +The key differences: + +- Holding capslock down activates the movement layer, much like the vimouse layout except that I'm using the xtonhasvim movement layer. +- Capslock+return (or right-control) activates vim mode! + +## Keymap Notes + +- Alternate underglow modes are not supported. Instead the underglow is used to indicate state. It can be turned off and dimmed. Polestar underglow LEDs are not individually addressable, sadly. + +### Build + +To build this keymap, simply run `make v60_type_r:xtonhasvim` from the root project directory. Flash using QMK Toolbox diff --git a/keyboards/v60_type_r/keymaps/xtonhasvim/rules.mk b/keyboards/v60_type_r/keymaps/xtonhasvim/rules.mk new file mode 100644 index 0000000000..6f9d7cc39e --- /dev/null +++ b/keyboards/v60_type_r/keymaps/xtonhasvim/rules.mk @@ -0,0 +1,5 @@ +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = no +CONSOLE_ENABLE = no # Console for debug(+400) +DEBUG_ENABLE = no diff --git a/keyboards/v60_type_r/rules.mk b/keyboards/v60_type_r/rules.mk index afd65cd1a4..30038d5624 100644 --- a/keyboards/v60_type_r/rules.mk +++ b/keyboards/v60_type_r/rules.mk @@ -68,4 +68,4 @@ 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 -LAYOUTS = 60_ansi \ No newline at end of file +LAYOUTS = 60_ansi diff --git a/users/xtonhasvim/fancylighting.c b/users/xtonhasvim/fancylighting.c index f4af5ec55d..dc13df03f7 100644 --- a/users/xtonhasvim/fancylighting.c +++ b/users/xtonhasvim/fancylighting.c @@ -34,9 +34,14 @@ void matrix_scan_keymap(void) { #define FADE_BACK_TIME 500 #define BREATH_FIRE_TIME 1000 #define ANIMATION_STEP_INTERVAL 20 + +#if RGBLED_NUM >= 2 #define POWER_KEY_OFFSET (RGBLED_NUM / 2) #define SPACE_OFFSET_MAX (RGBLED_NUM / 2) - +#else +#define POWER_KEY_OFFSET 1 +#define SPACE_OFFSET_MAX 1 +#endif uint16_t effect_start_timer = 0; uint8_t user_rgb_mode = 0; diff --git a/users/xtonhasvim/fancylighting.h b/users/xtonhasvim/fancylighting.h index 982010d3d5..02fb58b84a 100644 --- a/users/xtonhasvim/fancylighting.h +++ b/users/xtonhasvim/fancylighting.h @@ -1,4 +1,4 @@ -p /* Copyright 2015-2017 Christon DeWan +/* Copyright 2015-2017 Christon DeWan * * 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 @@ -20,16 +20,17 @@ p /* Copyright 2015-2017 Christon DeWan #include "xtonhasvim.h" + extern uint8_t user_rgb_mode; extern LED_TYPE shadowed_led[]; -void start_firey_return(void); -#endif //_fancy_lighting_h +#endif //RGBLIGHT_ENABLE +void start_firey_return(void); enum xtonhasvim_rgbmodes { BREATH_FIRE = 1, FADE_BACK }; -#endif //RGBLIGHT_ENABLE +#endif //_fancy_lighting_h diff --git a/users/xtonhasvim/xtonhasvim.h b/users/xtonhasvim/xtonhasvim.h index 5ff4932a48..2d6670a5e6 100644 --- a/users/xtonhasvim/xtonhasvim.h +++ b/users/xtonhasvim/xtonhasvim.h @@ -22,11 +22,9 @@ #define X_____X KC_NO -bool process_record_xtonhasvim(uint16_t keycode, keyrecord_t *record); - enum xtonhasvim_keycodes { - DUMMY = SAFE_RANGE, - FIREY_RETURN, // kick off special effects + // 20: give keyboard-specific codes some room + FIREY_RETURN = SAFE_RANGE + 20, // kick off special effects VIM_START, // bookend for vim states VIM_A, VIM_B, -- cgit v1.2.3 From c51b2266a06aeac767c41e6f0f8054db531a156f Mon Sep 17 00:00:00 2001 From: rschardt <42609861+rschardt@users.noreply.github.com> Date: Fri, 31 Aug 2018 17:44:15 +0200 Subject: Keymap: Adding adnw_puq-Layout for Ergodox (#3723) * added adnw_p_u_q-Layout * changed link * 3723 - outsource definitions to config.h * added TAPPING_TERM * changed defines and added colors * removed debug- and action_layer-Header --- layouts/community/ergodox/adnw_p_u_q/config.h | 9 + layouts/community/ergodox/adnw_p_u_q/keymap.c | 335 ++++++++++++++++++++++ layouts/community/ergodox/adnw_p_u_q/readme.md | 17 ++ layouts/community/ergodox/adnw_p_u_q/visualizer.c | 34 +++ 4 files changed, 395 insertions(+) create mode 100644 layouts/community/ergodox/adnw_p_u_q/config.h create mode 100644 layouts/community/ergodox/adnw_p_u_q/keymap.c create mode 100644 layouts/community/ergodox/adnw_p_u_q/readme.md create mode 100644 layouts/community/ergodox/adnw_p_u_q/visualizer.c diff --git a/layouts/community/ergodox/adnw_p_u_q/config.h b/layouts/community/ergodox/adnw_p_u_q/config.h new file mode 100644 index 0000000000..b1170aa78c --- /dev/null +++ b/layouts/community/ergodox/adnw_p_u_q/config.h @@ -0,0 +1,9 @@ +#pragma once + +// This is the ideal value for me but find your own +#undef TAPPING_TERM +#define TAPPING_TERM 145 + +// more options here: https://docs.qmk.fm/config_options.html +#define FORCE_NKRO +#define PERMISSIVE_HOLD // tab/hold-Keys should work better with that diff --git a/layouts/community/ergodox/adnw_p_u_q/keymap.c b/layouts/community/ergodox/adnw_p_u_q/keymap.c new file mode 100644 index 0000000000..a90fcbc2c7 --- /dev/null +++ b/layouts/community/ergodox/adnw_p_u_q/keymap.c @@ -0,0 +1,335 @@ +#include QMK_KEYBOARD_H +#include "keymap_german.h" + + +#define BASE 0 // default layer / VIM +#define ARW 1 // arrow layer / Terminal +#define DIAK 2 // diakritika layer +#define BRACK 3 // brackets layer +#define SYMBOLS 4 // symbols +#define MEDIA 5 // media keys / Mouse-Navigation + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer / VIM + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Media | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | P | U | Dia-L| , | Q | | | | V | C | L | M | B | | + * |--------+------+------+------+------+------| G | | gg |------+------+------+------+------+--------| + * | Symbols| H | I | E | A | O |------| |------| D | T | R | N | S | ARW | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | LShift | K | Y | . | ' | X |str-D | |str-U | J | G | Z | W | F | RShift | + * * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | Ctrl | Alt | | | | | H | J | K | L | Ctrl | + * `----------------------------------' `----------------------------------' + * LShift is Tab on Click + * + * ,-------------. ,-------------. + * | ^ | / | | ? | $ | + * ,------|------|------| |------+--------+------. + * | | |str+a | |str+c | | | + * | Brack| Space|------| |------| Enter |BSpace| + * | -Lay |/shift| Tab/ | | | | | + * | | | GUI | | ESC | | | + * `--------------------' `----------------------' + * GUI is one shot + * str + a is for tmux etc. + * str + c is for stopping programs + */ +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, + TG(SYMBOLS), DE_P, DE_U, OSL(DIAK), DE_COMM, DE_Q, LSFT(DE_G), + OSL(SYMBOLS), DE_H, DE_I, DE_E, DE_A, DE_O, + SFT_T(KC_TAB), DE_K, DE_Y, DE_DOT, DE_QUOT, DE_X, LCTL(DE_D), + KC_LCTRL, KC_LALT, KC_NO, KC_NO, KC_NO, + + + // left hand thumb-cluster + DE_CIRC, DE_SLSH, + LCTL(DE_A), + OSL(BRACK), SFT_T(KC_SPACE), GUI_T(KC_TAB), + + + // right hand + KC_NO, KC_6, KC_7, KC_8, KC_9, KC_0, TG(MEDIA), + DE_G, DE_V, DE_C, DE_L, DE_M, DE_B, KC_NO, + DE_D, DE_T, DE_R, DE_N, DE_S, TG(ARW), + LCTL(DE_U), DE_J, DE_G, DE_Z, DE_W, DE_F, KC_RSFT, + KC_H, KC_J, KC_K, KC_L, KC_RCTRL, + + // right thumb-cluster + DE_QST, DE_DLR, + LCTL(DE_C), + KC_ESCAPE, KC_ENTER, KC_BSPACE +), + + +/* Keymap 1: Arrow Layer / Terminal + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |P-Down| |P-Up | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | Left | Bot | Top | Right| | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Home | | | | End | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Arrows +[ARW] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDOWN, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_HOME, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, + KC_TRNS, KC_END, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + + +/* Keymap 2: Diakritika Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Ü | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | Ä | Ö |------| |------| | | | | ß | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Diakritika +[DIAK] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, DE_UE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_AE, DE_OE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, DE_SS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + + +/* Keymap 3: Brackets Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | ( | { | [ | |------| |------| | ] | } | ) | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// BRACK +[BRACK] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, DE_LPRN, DE_LCBR, DE_LBRC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, DE_RBRC, DE_RCBR, DE_RPRN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + + +/* Keymap 4: Symbol Layer + * + * + * Original: + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | ² | ° | ~ | @ | ! | | | | ? | & | § | " | ³ | | + * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| + * | | ´ | ' | : | ^ | < |------| |------| > | $ | ; | | | ` | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | € | + | = | * | / | { | | } | \ | % | # | - | _ | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + */ +// SYMBOLS +[SYMBOLS] = LAYOUT_ergodox( + // left hand + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, //DE_LBRC, + KC_TRNS,DE_SQ2, DE_RING, DE_TILD, DE_AT, DE_EXLM, DE_LPRN, + KC_TRNS,DE_ACUT,DE_QUOT, DE_COLN, DE_CIRC, DE_LESS, + KC_TRNS,DE_EURO,DE_PLUS, DE_EQL, DE_ASTR, DE_SLSH, DE_LCBR, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + + KC_TRNS,KC_TRNS, + KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS, + + // right hand + //DE_RBRC, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, + DE_RPRN, DE_QST, DE_AMPR, DE_PARA, DE_DQOT, DE_SQ3, KC_TRNS, + DE_MORE, DE_DLR, DE_SCLN, DE_PIPE, DE_GRV, KC_TRNS, + DE_RCBR, DE_BSLS, DE_PERC, DE_HASH, DE_MINS, DE_UNDS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + +/* Keymap 5: Numbers + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | Num | / | * | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | | 7 | 8 | 9 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | |------| |------| | | 4 | 5 | 6 | + | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | 1 | 2 | 3 | Enter | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | , | | | Enter| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' +// NUMBERS +[NUMBERS] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, KC_TRNS, + KC_TRNS, KC_TRNS, KC_4, KC_5, KC_8, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_TRNS, + KC_0, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), + + +*/ + +/* Keymap 6: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | Sleep| | | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | Wake | | | | |------| |------| |MsLeft|MsDown| MsUp |MsRght| | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | Mute| VolDn| VolUp| | Play| Prev | Next | Stop | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | Lclk|------| |------|Rclk | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MEDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_SLEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_WAKE, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_BTN1, KC_TRNS, + // right hand + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_BTN2, KC_TRNS +), +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user_keyboard(void) { + ergodox_board_led_on(); + ergodox_led_all_on(); +} diff --git a/layouts/community/ergodox/adnw_p_u_q/readme.md b/layouts/community/ergodox/adnw_p_u_q/readme.md new file mode 100644 index 0000000000..dc914a0aa2 --- /dev/null +++ b/layouts/community/ergodox/adnw_p_u_q/readme.md @@ -0,0 +1,17 @@ +This is a fork of the adnw_k_o_y-Layout + +Features: +- Diakritika-Layer for ADNW-PUQ-Layout +- all basic-symbols of the german-layout can be found in the Symbol- and Diakritika-Layer +- Symbol-Layer: Symbols are mirrored -- left = < and right = > +- Basic-Layer-Keys which always be present in any Layer and allow the movement between layers +- HJKL-Keys and Arrow-Keys can be switched, necessary for working with a terminal and vim +- Number-Layer for Numpad-Emulation +- Brackets-Layer for easier programming +- Media-Layer for Mouse-Navigation + +Notes: +- adnw is a layout optimised for usage with german and english language +- PUQ is a variant of adnw: http://www.adnw.de/index.php?n=Main.OptimierungF%C3%BCrDieGeradeTastaturMitDaumen-Shift +- This implementation is optimised for my workflow with vim/tmux/xmonad and ergodox +- The OS must use the de_DE layout diff --git a/layouts/community/ergodox/adnw_p_u_q/visualizer.c b/layouts/community/ergodox/adnw_p_u_q/visualizer.c new file mode 100644 index 0000000000..9a4d485387 --- /dev/null +++ b/layouts/community/ergodox/adnw_p_u_q/visualizer.c @@ -0,0 +1,34 @@ +/* +Note: this is a modified copy of ../default/visualizer.c, originally licensed GPL. +*/ + +#include "simple_visualizer.h" + +// This function should be implemented by the keymap visualizer +// Don't change anything else than state->target_lcd_color and state->layer_text as that's the only thing +// that the simple_visualizer assumes that you are updating +// Also make sure that the buffer passed to state->layer_text remains valid until the previous animation is +// stopped. This can be done by either double buffering it or by using constant strings +static void get_visualizer_layer_and_color(visualizer_state_t* state) { + + if (state->status.layer & 0x20) { + state->target_lcd_color = LCD_COLOR(127, 0xFF, 0xFF); + state->layer_text = "Mouse"; + } else if (state->status.layer & 0x10) { + state->target_lcd_color = LCD_COLOR(85, 0xFF, 0xFF); + state->layer_text = "Symbol"; + } else if (state->status.layer & 0x8) { + state->target_lcd_color = LCD_COLOR(64, 0xFF, 0xFF); + state->layer_text = "Brackets"; + } else if (state->status.layer & 0x4) { + state->target_lcd_color = LCD_COLOR(42, 0xFF, 0xFF); + state->layer_text = "Diak"; + } else if (state->status.layer & 0x2) { + state->target_lcd_color = LCD_COLOR(21, 0xFF, 0xFF); + state->layer_text = "Terminal"; + } else { + state->target_lcd_color = LCD_COLOR(192, 0xFF, 0xFF); + state->layer_text = "Vim"; + } +} + -- cgit v1.2.3 From acc06a0848380fbeb2688d18bc19fee07797046c Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 31 Aug 2018 14:13:55 -0400 Subject: Keyboard: Add Tragicforce 68 (#3807) * Fork MF68 to Tragicforce 68 * Set pinouts and key layout * Reformat keymap, update comments/notes * Cleanup rules.mk --- keyboards/tragicforce68/README.md | 18 +++++++ keyboards/tragicforce68/config.h | 69 ++++++++++++++++++++++++ keyboards/tragicforce68/info.json | 12 +++++ keyboards/tragicforce68/keymaps/default/keymap.c | 34 ++++++++++++ keyboards/tragicforce68/rules.mk | 26 +++++++++ keyboards/tragicforce68/tragicforce68.c | 8 +++ keyboards/tragicforce68/tragicforce68.h | 56 +++++++++++++++++++ 7 files changed, 223 insertions(+) create mode 100644 keyboards/tragicforce68/README.md create mode 100644 keyboards/tragicforce68/config.h create mode 100644 keyboards/tragicforce68/info.json create mode 100644 keyboards/tragicforce68/keymaps/default/keymap.c create mode 100644 keyboards/tragicforce68/rules.mk create mode 100644 keyboards/tragicforce68/tragicforce68.c create mode 100644 keyboards/tragicforce68/tragicforce68.h diff --git a/keyboards/tragicforce68/README.md b/keyboards/tragicforce68/README.md new file mode 100644 index 0000000000..c7a6cc77da --- /dev/null +++ b/keyboards/tragicforce68/README.md @@ -0,0 +1,18 @@ +Tragicforce 68 +=============== + +Magicforce 68 with [Tragicforce 68 replacement PCB](https://keeb.io/products/mf68-magicforce-68-pcb-replacement-kit) from Keebio. + +Keyboard Maintainer: [Keebio](https://keeb.io) +Hardware Supported: Pro Micro +Hardware Availability: [Keebio](https://keeb.io) + +Make example for this keyboard (after setting up your build environment): + + make tragicforce68:default + +Example of flashing this keyboard: + + make tragicforce68:default:avrdude + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/tragicforce68/config.h b/keyboards/tragicforce68/config.h new file mode 100644 index 0000000000..9afdca6140 --- /dev/null +++ b/keyboards/tragicforce68/config.h @@ -0,0 +1,69 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0510 +#define DEVICE_VER 0x0101 +#define MANUFACTURER Keebio +#define PRODUCT Tragicforce 68 +#define DESCRIPTION Programmable PCB replacement for Magicforce 68 + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, B4, E6, C6, D7, D4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 7 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif diff --git a/keyboards/tragicforce68/info.json b/keyboards/tragicforce68/info.json new file mode 100644 index 0000000000..f3e3d6adad --- /dev/null +++ b/keyboards/tragicforce68/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Tragicforce 68", + "url": "https://keeb.io", + "maintainer": "Keebio", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] + } + } +} diff --git a/keyboards/tragicforce68/keymaps/default/keymap.c b/keyboards/tragicforce68/keymaps/default/keymap.c new file mode 100644 index 0000000000..69255e080b --- /dev/null +++ b/keyboards/tragicforce68/keymaps/default/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_ESC, 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_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_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_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + KC_LSFT, 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_SPACE, MO(_FN1), KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ), + + [_FN1] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_GRV, 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_HOME, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, BL_STEP, KC_BSLS, _______, KC_END, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, KC_HOME, KC_QUOT, KC_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + _______, _______, KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_END, _______, BL_INC, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + _______, _______, _______, _______, _______, _______, KC_MENU, BL_BRTG, BL_DEC, BL_TOGG + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ) +}; diff --git a/keyboards/tragicforce68/rules.mk b/keyboards/tragicforce68/rules.mk new file mode 100644 index 0000000000..a652f1fac6 --- /dev/null +++ b/keyboards/tragicforce68/rules.mk @@ -0,0 +1,26 @@ +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +BOOTLOADER = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/tragicforce68/tragicforce68.c b/keyboards/tragicforce68/tragicforce68.c new file mode 100644 index 0000000000..327197d254 --- /dev/null +++ b/keyboards/tragicforce68/tragicforce68.c @@ -0,0 +1,8 @@ +#include "tragicforce68.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/tragicforce68/tragicforce68.h b/keyboards/tragicforce68/tragicforce68.h new file mode 100644 index 0000000000..e1b2a038d0 --- /dev/null +++ b/keyboards/tragicforce68/tragicforce68.h @@ -0,0 +1,56 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J5, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ + { J1, J2, J3, KC_NO, J5, KC_NO, J7, J8 } \ +} + +#define LAYOUT_split_space( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J4, J5, J6, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, KC_NO, KC_NO }, \ + { J1, J2, J3, J4, J5, J6, J7, J8 } \ +} + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) LAYOUT( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ + KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ + KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ + KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ + KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ +) -- cgit v1.2.3 From fb79015049ebd1309cd4f69a7584db614f50d1db Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 31 Aug 2018 14:49:18 -0700 Subject: Keymap: Merlin Learns to QMK (#3820) * Fix up my keymaps to use more QMK features * update 60_ansi readme * add the start of my userspace * begin to use my new userspace * use more of my userspace * spread userspace love to my clueboard * spread userspace love to 75 layout * add a fairly vanilla readme * put the FNX into a userspace incase I ever want to use it for something else * respond to drashna's code review comments --- layouts/community/60_ansi/mechmerlin-ansi/keymap.c | 38 ++++------------------ .../community/60_ansi/mechmerlin-ansi/readme.md | 4 +-- layouts/community/60_ansi/mechmerlin-ansi/rules.mk | 1 + .../mechmerlin-split/keymap.c | 17 ++++------ .../mechmerlin-split/rules.mk | 1 + layouts/community/66_ansi/mechmerlin/keymap.c | 15 ++------- layouts/community/66_ansi/mechmerlin/rules.mk | 1 + .../community/75_ansi/mechmerlin-75_ansi/keymap.c | 12 +++---- .../community/75_ansi/mechmerlin-75_ansi/rules.mk | 1 + users/mechmerlin/mechmerlin.c | 20 ++++++++++++ users/mechmerlin/mechmerlin.h | 17 ++++++++++ users/mechmerlin/readme.md | 3 ++ users/mechmerlin/rules.mk | 1 + 13 files changed, 68 insertions(+), 63 deletions(-) create mode 100644 layouts/community/60_ansi/mechmerlin-ansi/rules.mk create mode 100644 layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk create mode 100644 layouts/community/66_ansi/mechmerlin/rules.mk create mode 100644 layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk create mode 100644 users/mechmerlin/mechmerlin.c create mode 100644 users/mechmerlin/mechmerlin.h create mode 100644 users/mechmerlin/readme.md create mode 100644 users/mechmerlin/rules.mk diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c index 47316915ca..e48fddea46 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c @@ -1,29 +1,22 @@ #include QMK_KEYBOARD_H - -#define BASE 0 -#define FN 1 -#define ARROWS 2 - -enum keycodes { - KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. -}; +#include "mechmerlin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_60_ansi( +[_BL] = LAYOUT_60_ansi( KC_GESC, 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_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_BSLASH, \ - KC_LCTL, 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_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), -[FN] = LAYOUT_60_ansi( +[_FL] = LAYOUT_60_ansi( KC_GRV, 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_DEL, \ RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[ARROWS] = LAYOUT_60_ansi( +[_AL] = LAYOUT_60_ansi( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ @@ -31,22 +24,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - static uint16_t fnx_layer_timer; - - switch (keycode){ - case KC_FNX: - if(record->event.pressed){ - fnx_layer_timer = timer_read(); - layer_on(FN); - } else { - layer_off(FN); - if (timer_elapsed(fnx_layer_timer) < 150) { - layer_invert(ARROWS); - } - } - return false; - } - return true; -} \ No newline at end of file diff --git a/layouts/community/60_ansi/mechmerlin-ansi/readme.md b/layouts/community/60_ansi/mechmerlin-ansi/readme.md index c81a126d5d..1c40def2a2 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/readme.md +++ b/layouts/community/60_ansi/mechmerlin-ansi/readme.md @@ -10,8 +10,8 @@ It is used on his [NPKC KC60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kc60) ## Keymap Notes -- Highly influenced by the KBP V60 and WKL B.Face standard layouts -- Arrow toggle switch is FN + Space +- Arrow toggle switch is tapping the `FN` key once. +- `Caps Lock` can be held to act as a `Left Control` ### Build To build the firmware file associated with this keymap, simply run `make your_keyboard:mechmerlin-ansi`. diff --git a/layouts/community/60_ansi/mechmerlin-ansi/rules.mk b/layouts/community/60_ansi/mechmerlin-ansi/rules.mk new file mode 100644 index 0000000000..e2ce3d7731 --- /dev/null +++ b/layouts/community/60_ansi/mechmerlin-ansi/rules.mk @@ -0,0 +1 @@ +USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c index 4c6458c9b4..5ec005162f 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c @@ -1,25 +1,22 @@ #include QMK_KEYBOARD_H - -#define BASE 0 -#define FN 1 -#define ARROWS 2 +#include "mechmerlin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_60_ansi_split_bs_rshift( +[_BL] = LAYOUT_60_ansi_split_bs_rshift( KC_GESC, 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_NO, KC_BSPC, \ 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_BSLASH, \ - KC_LCTL, 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_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL), -[FN] = LAYOUT_60_ansi_split_bs_rshift( - KC_GRV, 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_NO, KC_DEL, \ +[_FL] = LAYOUT_60_ansi_split_bs_rshift( + KC_GRV, 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_NO, KC_DEL, \ RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -[ARROWS] = LAYOUT_60_ansi_split_bs_rshift( +[_AL] = LAYOUT_60_ansi_split_bs_rshift( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk new file mode 100644 index 0000000000..e2ce3d7731 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/rules.mk @@ -0,0 +1 @@ +USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/66_ansi/mechmerlin/keymap.c b/layouts/community/66_ansi/mechmerlin/keymap.c index b8142f9674..ea2e923b1c 100644 --- a/layouts/community/66_ansi/mechmerlin/keymap.c +++ b/layouts/community/66_ansi/mechmerlin/keymap.c @@ -1,32 +1,23 @@ #include QMK_KEYBOARD_H +#include "mechmerlin.h" -// 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. -#define _BL 0 -#define _FL 1 #define _CL 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap _BL: Base Layer (Default Layer) - */ [_BL] = LAYOUT_66_ansi( KC_GESC,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_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_PGDN, \ - KC_LCTL,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_CTCP,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_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, MO(_FL),KC_RGUI,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT), - /* Keymap _FL: Function Layer - */ [_FL] = LAYOUT_66_ansi( KC_GRV, 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_DEL, KC_VOLU, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_MUTE, KC_VOLD, \ - KC_CAPS,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,MO(_CL),_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ _______, _______,_______,_______,_______,_______,_______,KC_MUTE,KC_VOLU,KC_VOLD,_______, _______, KC_PGUP, \ _______,_______,_______, _______, _______,_______,_______,KC_HOME,KC_PGDN,KC_END), - /* Keymap _CL: Control layer - */ [_CL] = LAYOUT_66_ansi( BL_STEP,RGB_M_P,RGB_M_B,RGB_M_R,RGB_M_SW,RGB_M_SN,RGB_M_K,RGB_M_X,RGB_M_G,_______,_______,_______,_______, _______, RGB_VAI, \ RGB_TOG,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, RGB_VAD, \ diff --git a/layouts/community/66_ansi/mechmerlin/rules.mk b/layouts/community/66_ansi/mechmerlin/rules.mk new file mode 100644 index 0000000000..e2ce3d7731 --- /dev/null +++ b/layouts/community/66_ansi/mechmerlin/rules.mk @@ -0,0 +1 @@ +USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c index 70506da52a..ec3286b097 100644 --- a/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/keymap.c @@ -1,23 +1,21 @@ #include QMK_KEYBOARD_H - -#define BASE 0 -#define FN 1 +#include "mechmerlin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[BASE] = LAYOUT_75_ansi(\ +[_BL] = LAYOUT_75_ansi(\ 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_PAUS, KC_DEL, 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_HOME, 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_PGUP, - KC_LCTL, 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_PGDN, + KC_CTCP, 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_PGDN, KC_LSFT, 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_END, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), -[FN] = LAYOUT_75_ansi(\ +[_FL] = LAYOUT_75_ansi(\ KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; \ No newline at end of file diff --git a/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk b/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk new file mode 100644 index 0000000000..e2ce3d7731 --- /dev/null +++ b/layouts/community/75_ansi/mechmerlin-75_ansi/rules.mk @@ -0,0 +1 @@ +USER_NAME := mechmerlin \ No newline at end of file diff --git a/users/mechmerlin/mechmerlin.c b/users/mechmerlin/mechmerlin.c new file mode 100644 index 0000000000..8d6cecd18b --- /dev/null +++ b/users/mechmerlin/mechmerlin.c @@ -0,0 +1,20 @@ +#include "mechmerlin.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint16_t fnx_layer_timer; + + switch (keycode){ + case KC_FNX: + if(record->event.pressed){ + fnx_layer_timer = timer_read(); + layer_on(_FL); + } else { + layer_off(_FL); + if (timer_elapsed(fnx_layer_timer) < 150) { + layer_invert(_AL); + } + } + return false; + } + return true; +} \ No newline at end of file diff --git a/users/mechmerlin/mechmerlin.h b/users/mechmerlin/mechmerlin.h new file mode 100644 index 0000000000..c140ac70c9 --- /dev/null +++ b/users/mechmerlin/mechmerlin.h @@ -0,0 +1,17 @@ +#pragma once + +#include "quantum.h" + +enum userspace_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _AL // Arrow Layer +}; + +// Enum of custom keycodes defined in process_record_user +enum keycodes { + KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. +}; + +// Custom #defined keycodes +#define KC_CTCP MT(KC_LCTL, KC_CAPS) diff --git a/users/mechmerlin/readme.md b/users/mechmerlin/readme.md new file mode 100644 index 0000000000..6a76dd2a9d --- /dev/null +++ b/users/mechmerlin/readme.md @@ -0,0 +1,3 @@ +# MechMerlin's Userspace + +This is a collection of my most commonly used QMK functions diff --git a/users/mechmerlin/rules.mk b/users/mechmerlin/rules.mk new file mode 100644 index 0000000000..70c20ec71e --- /dev/null +++ b/users/mechmerlin/rules.mk @@ -0,0 +1 @@ +SRC += mechmerlin.c \ No newline at end of file -- cgit v1.2.3 From 2aa27f0c78871ebea58559bb847d97d09de01078 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Sat, 1 Sep 2018 12:21:48 -0400 Subject: Keyboard: Rename alt67 to alt (#3824) Renamed keyboard alt67 to alt and adjusted necessary files where alt67 appeared. CTRL keymap fixed enum structure name. usb2422 removed stray define no longer used. --- keyboards/massdrop/alt/alt.h | 24 +++ keyboards/massdrop/alt/config.h | 79 +++++++++ keyboards/massdrop/alt/config_led.h | 178 +++++++++++++++++++ keyboards/massdrop/alt/info.json | 80 +++++++++ keyboards/massdrop/alt/keymaps/default/keymap.c | 200 ++++++++++++++++++++++ keyboards/massdrop/alt/led_programs.c | 120 +++++++++++++ keyboards/massdrop/alt/matrix.c | 182 ++++++++++++++++++++ keyboards/massdrop/alt/matrix.h | 77 +++++++++ keyboards/massdrop/alt/readme.md | 20 +++ keyboards/massdrop/alt/rules.mk | 32 ++++ keyboards/massdrop/alt67/alt67.h | 24 --- keyboards/massdrop/alt67/config.h | 79 --------- keyboards/massdrop/alt67/config_led.h | 178 ------------------- keyboards/massdrop/alt67/info.json | 80 --------- keyboards/massdrop/alt67/keymaps/default/keymap.c | 200 ---------------------- keyboards/massdrop/alt67/led_programs.c | 120 ------------- keyboards/massdrop/alt67/matrix.c | 182 -------------------- keyboards/massdrop/alt67/matrix.h | 77 --------- keyboards/massdrop/alt67/readme.md | 20 --- keyboards/massdrop/alt67/rules.mk | 32 ---- keyboards/massdrop/ctrl/keymaps/default/keymap.c | 2 +- tmk_core/protocol/arm_atsam/usb/usb2422.h | 1 - 22 files changed, 993 insertions(+), 994 deletions(-) create mode 100644 keyboards/massdrop/alt/alt.h create mode 100644 keyboards/massdrop/alt/config.h create mode 100644 keyboards/massdrop/alt/config_led.h create mode 100644 keyboards/massdrop/alt/info.json create mode 100644 keyboards/massdrop/alt/keymaps/default/keymap.c create mode 100644 keyboards/massdrop/alt/led_programs.c create mode 100644 keyboards/massdrop/alt/matrix.c create mode 100644 keyboards/massdrop/alt/matrix.h create mode 100644 keyboards/massdrop/alt/readme.md create mode 100644 keyboards/massdrop/alt/rules.mk delete mode 100644 keyboards/massdrop/alt67/alt67.h delete mode 100644 keyboards/massdrop/alt67/config.h delete mode 100644 keyboards/massdrop/alt67/config_led.h delete mode 100644 keyboards/massdrop/alt67/info.json delete mode 100644 keyboards/massdrop/alt67/keymaps/default/keymap.c delete mode 100644 keyboards/massdrop/alt67/led_programs.c delete mode 100644 keyboards/massdrop/alt67/matrix.c delete mode 100644 keyboards/massdrop/alt67/matrix.h delete mode 100644 keyboards/massdrop/alt67/readme.md delete mode 100644 keyboards/massdrop/alt67/rules.mk diff --git a/keyboards/massdrop/alt/alt.h b/keyboards/massdrop/alt/alt.h new file mode 100644 index 0000000000..387985512b --- /dev/null +++ b/keyboards/massdrop/alt/alt.h @@ -0,0 +1,24 @@ +#pragma once + +#include "quantum.h" +#include "config_led.h" +#include "matrix.h" + +#include "i2c_master.h" +#include "led_matrix.h" //For led keycodes +#include "usb/udi_cdc.h" +#include "usb/usb2422.h" + +#define LAYOUT( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, \ + K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, \ + K61, K62, K63, K64, K65, K66, K67 \ +) { \ + { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, }, \ + { K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, }, \ + { K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, KC_NO, K43, K44, }, \ + { K45, KC_NO, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, }, \ + { K59, K60, K61, KC_NO, KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K63, K64, K65, K66, K67, }, \ +} diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h new file mode 100644 index 0000000000..a486f34a0c --- /dev/null +++ b/keyboards/massdrop/alt/config.h @@ -0,0 +1,79 @@ +/* +Copyright 2015 Jun Wako + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x04D8 +#define PRODUCT_ID 0xEED3 +#define DEVICE_VER 0x0101 + +#define MANUFACTURER "Massdrop Inc." +#define PRODUCT "ALT Keyboard" +#define SERIAL_NUM "Unavailable" + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define PA 0 +#define PB 1 + +#define MATRIX_ROW_PORTS PA, PA, PA, PA, PA +#define MATRIX_ROW_PINS 0, 1, 2, 3, 4 + +#define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA +#define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 + +/* Print boot debug codes using debug LED when M28 and M30 shorted */ +#define DEBUG_BOOT_TRACING + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Force boot in NKRO mode */ +//#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/massdrop/alt/config_led.h b/keyboards/massdrop/alt/config_led.h new file mode 100644 index 0000000000..a049e38179 --- /dev/null +++ b/keyboards/massdrop/alt/config_led.h @@ -0,0 +1,178 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifndef _config_led_h_ +#define _config_led_h_ + +//Define number of ISSI3733 drivers being used (1...16) +#define ISSI3733_DRIVER_COUNT 2 + +//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) +#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } + +//LED I2C bus speed +#define I2C_HZ 580000 + +//Count of LED bodies +#define ISSI3733_LED_COUNT 105 + +//Default Global Current Register value (Default brightness 0 - 255) +#define ISSI3733_GCR_DEFAULT 128 + +#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus +#define LED_GCR_STEP 10 //GCR increment/decrement value + +//Automatic power rollback and recovery +#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) +#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) +#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) + +#define ANIMATION_SPEED_STEP 1 + +#define BREATHE_MIN_STEP 0 +#define BREATHE_MAX_STEP 255 + +//LED Mapping - More practically generated from a spreadsheet program +//id: ID of the LED (Sync with PCB callouts) +//x: Physical X coordinate of LED (units do not matter) +//y: Physical Y coordinate of LED (units do not matter) +//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES +//cs: Matrix wiring CS col (1-16) +//swr: Matrix wiring SW Red row (1-12) +//swg: Matrix wiring SW Green row (1-12) +//swb: Matrix wiring SW Blue row (1-12) +//scan: Associated key scancode if any +//Note: Origin 0,0 may be located anywhere as the software will do the final layout +#define ISSI3733_LED_MAP { \ + { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ + { .id = 2, .x = 0.75, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ + { .id = 3, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ + { .id = 4, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ + { .id = 5, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 4 }, \ + { .id = 6, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ + { .id = 7, .x = 4.5, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ + { .id = 8, .x = 5.25, .y = 0, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \ + { .id = 9, .x = 6, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 8 }, \ + { .id = 10, .x = 6.75, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 9 }, \ + { .id = 11, .x = 7.5, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 10 }, \ + { .id = 12, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 11 }, \ + { .id = 13, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \ + { .id = 14, .x = 10.125, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 13 }, \ + { .id = 15, .x = 11.25, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 14 }, \ + { .id = 16, .x = 0.188, .y = -0.75, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 15 }, \ + { .id = 17, .x = 1.125, .y = -0.75, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ + { .id = 18, .x = 1.875, .y = -0.75, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ + { .id = 19, .x = 2.625, .y = -0.75, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ + { .id = 20, .x = 3.375, .y = -0.75, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ + { .id = 21, .x = 4.125, .y = -0.75, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ + { .id = 22, .x = 4.875, .y = -0.75, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ + { .id = 23, .x = 5.625, .y = -0.75, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ + { .id = 24, .x = 6.375, .y = -0.75, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \ + { .id = 25, .x = 7.125, .y = -0.75, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \ + { .id = 26, .x = 7.875, .y = -0.75, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \ + { .id = 27, .x = 8.625, .y = -0.75, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 26 }, \ + { .id = 28, .x = 9.375, .y = -0.75, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ + { .id = 29, .x = 10.313, .y = -0.75, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 28 }, \ + { .id = 30, .x = 11.25, .y = -0.75, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ + { .id = 31, .x = 0.281, .y = -1.5, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 30 }, \ + { .id = 32, .x = 1.313, .y = -1.5, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 33, .x = 2.063, .y = -1.5, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ + { .id = 34, .x = 2.813, .y = -1.5, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ + { .id = 35, .x = 3.563, .y = -1.5, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ + { .id = 36, .x = 4.313, .y = -1.5, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ + { .id = 37, .x = 5.063, .y = -1.5, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ + { .id = 38, .x = 5.813, .y = -1.5, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ + { .id = 39, .x = 6.563, .y = -1.5, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \ + { .id = 40, .x = 7.313, .y = -1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \ + { .id = 41, .x = 8.063, .y = -1.5, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ + { .id = 42, .x = 8.813, .y = -1.5, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 41 }, \ + { .id = 43, .x = 10.031, .y = -1.5, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 43 }, \ + { .id = 44, .x = 11.25, .y = -1.5, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 44 }, \ + { .id = 45, .x = 0.469, .y = -2.25, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \ + { .id = 46, .x = 1.688, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ + { .id = 47, .x = 2.438, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 48 }, \ + { .id = 48, .x = 3.188, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ + { .id = 49, .x = 3.938, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \ + { .id = 50, .x = 4.688, .y = -2.25, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ + { .id = 51, .x = 5.438, .y = -2.25, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ + { .id = 52, .x = 6.188, .y = -2.25, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \ + { .id = 53, .x = 6.938, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 54 }, \ + { .id = 54, .x = 7.688, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 55 }, \ + { .id = 55, .x = 8.438, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ + { .id = 56, .x = 9.469, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \ + { .id = 57, .x = 10.5, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \ + { .id = 58, .x = 11.25, .y = -2.25, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 59 }, \ + { .id = 59, .x = 0.094, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ + { .id = 60, .x = 1.031, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ + { .id = 61, .x = 1.969, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \ + { .id = 62, .x = 4.781, .y = -3, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 66 }, \ + { .id = 63, .x = 7.594, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 70 }, \ + { .id = 64, .x = 8.531, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 71 }, \ + { .id = 65, .x = 9.75, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 72 }, \ + { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ + { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ + { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ + { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ + { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ + { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ + { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ +}; + + +#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality +#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) + #define USB_LED_NUM_LOCK_SCANCODE 255 + #define USB_LED_CAPS_LOCK_SCANCODE 30 + #define USB_LED_SCROLL_LOCK_SCANCODE 255 + #define USB_LED_COMPOSE_SCANCODE 255 + #define USB_LED_KANA_SCANCODE 255 +#endif //USB_LED_INDICATOR_ENABLE + +#endif //_config_led_h_ diff --git a/keyboards/massdrop/alt/info.json b/keyboards/massdrop/alt/info.json new file mode 100644 index 0000000000..8f85bece21 --- /dev/null +++ b/keyboards/massdrop/alt/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "ALT", + "url": "https://www.massdrop.com/buy/massdrop-alt-mechanical-keyboard", + "maintainer": "Massdrop", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ESCAPE", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"MINUS", "x":11, "y":0}, + {"label":"EQUALS", "x":12, "y":0}, + {"label":"BACKSPACE", "x":13, "y":0, "w":2}, + {"label":"DELETE", "x":15, "y":0}, + {"label":"TAB", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"LEFT BRACKET", "x":11.5, "y":1}, + {"label":"RIGHT BRACKET", "x":12.5, "y":1}, + {"label":"BACK SLASH", "x":13.5, "y":1, "w":1.5}, + {"label":"HOME", "x":15, "y":1}, + {"label":"CAPS LOCK", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"SEMICOLON", "x":10.75, "y":2}, + {"label":"SINGLE TICK", "x":11.75, "y":2}, + {"label":"ENTER", "x":12.75, "y":2, "w":2.25}, + {"label":"PAGE UP", "x":15, "y":2}, + {"label":"LEFT SHIFT", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"COMMA", "x":9.25, "y":3}, + {"label":"PERIOD", "x":10.25, "y":3}, + {"label":"FORWARD SLASH", "x":11.25, "y":3}, + {"label":"RIGHT SHIFT", "x":12.25, "y":3, "w":1.75}, + {"label":"UP ARROW", "x":14, "y":3}, + {"label":"PAGE DOWN", "x":15, "y":3}, + {"label":"LEFT CTRL", "x":0, "y":4, "w":1.25}, + {"label":"LEFT WIN", "x":1.25, "y":4, "w":1.25}, + {"label":"LEFT ALT", "x":2.5, "y":4, "w":1.25}, + {"label":"SPACEBAR", "x":3.75, "y":4, "w":6.25}, + {"label":"RIGHT ALT", "x":10, "y":4, "w":1.25}, + {"label":"FN", "x":11.25, "y":4, "w":1.25}, + {"label":"LEFT ARROW", "x":13, "y":4}, + {"label":"DOWN ARROW", "x":14, "y":4}, + {"label":"RIGHT ARROW", "x":15, "y":4} + ] + } + } +} diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c new file mode 100644 index 0000000000..3f0b84e387 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -0,0 +1,200 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_TRNS, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} \ No newline at end of file diff --git a/keyboards/massdrop/alt/led_programs.c b/keyboards/massdrop/alt/led_programs.c new file mode 100644 index 0000000000..b3b7a7e90e --- /dev/null +++ b/keyboards/massdrop/alt/led_programs.c @@ -0,0 +1,120 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt.h" +#include "led_matrix.h" + +//Teal <-> Salmon +led_setup_t leds_teal_salmon[] = { + { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, + { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, + { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Yellow +led_setup_t leds_yellow[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Off +led_setup_t leds_off[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Red +led_setup_t leds_red[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Green +led_setup_t leds_green[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, + { .end = 1 }, +}; + +//Blue +led_setup_t leds_blue[] = { + { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White +led_setup_t leds_white[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .end = 1 }, +}; + +//White with moving red stripe +led_setup_t leds_white_with_red_stripe[] = { + { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, + { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, + { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, + { .end = 1 }, +}; + +//Black with moving red stripe +led_setup_t leds_black_with_red_stripe[] = { + { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, + { .end = 1 }, +}; + +//Rainbow no scrolling +led_setup_t leds_rainbow_ns[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, + { .end = 1 }, +}; + +//Rainbow scrolling +led_setup_t leds_rainbow_s[] = { + { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, + { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, + { .end = 1 }, +}; + +//Add new LED animations here using one from above as example +//The last entry must be { .end = 1 } +//Add the new animation name to the list below following its format + +void *led_setups[] = { + leds_rainbow_s, + leds_rainbow_ns, + leds_teal_salmon, + leds_yellow, + leds_red, + leds_green, + leds_blue, + leds_white, + leds_white_with_red_stripe, + leds_black_with_red_stripe, + leds_off +}; + +const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/alt/matrix.c b/keyboards/massdrop/alt/matrix.c new file mode 100644 index 0000000000..75a4d62b99 --- /dev/null +++ b/keyboards/massdrop/alt/matrix.c @@ -0,0 +1,182 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#include "alt.h" + +#include "d51_util.h" +#include "debug.h" +#include "clks.h" +#include + +matrix_row_t mlatest[MATRIX_ROWS]; +matrix_row_t mlast[MATRIX_ROWS]; +matrix_row_t mdebounced[MATRIX_ROWS]; + +uint8_t row_ports[] = { MATRIX_ROW_PORTS }; +uint8_t row_pins[] = { MATRIX_ROW_PINS }; +uint8_t col_ports[] = { MATRIX_COL_PORTS }; +uint8_t col_pins[] = { MATRIX_COL_PINS }; +uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate + +__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) { +} + +void matrix_init(void) +{ + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + + row_masks[PA] = 0; + row_masks[PB] = 0; + + uint8_t row; + for (row = 0; row < MATRIX_ROWS; row++) + { + PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input + PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, + PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable + row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask + } + + uint8_t col; + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low + } + + matrix_init_quantum(); +} + +#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) + +uint64_t mdebouncing = 0; +uint8_t matrix_scan(void) +{ + uint8_t mchanged; + uint8_t row; + uint8_t col; + uint32_t scans[2]; //PA PB + + if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active + + //m15_off; //Profiling scans + + memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer + + for (col = 0; col < MATRIX_COLS; col++) + { + PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output + + CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output + + scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data + scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data + + PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output + + for (row = 0; row < MATRIX_ROWS; row++) + { + //Move scan bits from scans array into proper row bit locations + if (scans[row_ports[row]] & (1 << row_pins[row])) + mlatest[row] |= 1 << col; + } + } + + mchanged = 0; //Default to no matrix change since last + + for (row = 0; row < MATRIX_ROWS; row++) + { + if (mlast[row] != mlatest[row]) + mchanged = 1; + mlast[row] = mlatest[row]; + } + + if (!mchanged) + { + for (row = 0; row < MATRIX_ROWS; row++) + mdebounced[row] = mlatest[row]; + mdebouncing = 0; + } + else + { + //Begin or extend debounce on change + mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; + } + + //m15_on; //Profiling scans + + matrix_scan_quantum(); + + return 1; +} + +matrix_row_t matrix_get_row(uint8_t row) +{ + return mdebounced[row]; +} + +void matrix_print(void) +{ + char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; + char *pbuf = buf+3; + uint32_t cols; + uint32_t rows; + matrix_row_t row; + + for (cols = 1; cols <= MATRIX_COLS; cols++) + { + *pbuf = (cols%10)+48; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + + for (rows = 1; rows <= MATRIX_ROWS; rows++) + { + row = matrix_get_row(rows-1); + if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } + else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } + for (cols = 0; cols < MATRIX_COLS; cols++) + { + if (row & 1 << cols) *pbuf = 'X'; + else *pbuf = '.'; + pbuf++; + } + *pbuf = '\r'; pbuf++; + *pbuf = '\n'; pbuf++; + } + *pbuf = 0; + dprint(buf); +} diff --git a/keyboards/massdrop/alt/matrix.h b/keyboards/massdrop/alt/matrix.h new file mode 100644 index 0000000000..3eab6dece1 --- /dev/null +++ b/keyboards/massdrop/alt/matrix.h @@ -0,0 +1,77 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ +#ifndef MATRIX_H +#define MATRIX_H + +#include +#include +#include "keyboard.h" + +#if (MATRIX_COLS <= 8) +typedef uint8_t matrix_row_t; +#elif (MATRIX_COLS <= 16) +typedef uint16_t matrix_row_t; +#elif (MATRIX_COLS <= 32) +typedef uint32_t matrix_row_t; +#else +#error "MATRIX_COLS: invalid value" +#endif + +#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1< - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0x04D8 -#define PRODUCT_ID 0xEED3 -#define DEVICE_VER 0x0101 - -#define MANUFACTURER "Massdrop Inc." -#define PRODUCT "ALT67 Keyboard" -#define SERIAL_NUM "Unavailable" - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -#define PA 0 -#define PB 1 - -#define MATRIX_ROW_PORTS PA, PA, PA, PA, PA -#define MATRIX_ROW_PINS 0, 1, 2, 3, 4 - -#define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA -#define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 - -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Force boot in NKRO mode */ -//#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/massdrop/alt67/config_led.h b/keyboards/massdrop/alt67/config_led.h deleted file mode 100644 index a049e38179..0000000000 --- a/keyboards/massdrop/alt67/config_led.h +++ /dev/null @@ -1,178 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#ifndef _config_led_h_ -#define _config_led_h_ - -//Define number of ISSI3733 drivers being used (1...16) -#define ISSI3733_DRIVER_COUNT 2 - -//Hardware address of each driver (Refer to ISSI3733 pdf "Table 1 Slave Address" and keyboard schematic) -#define ISSI3773_DRIVER_ADDRESSES { 0xA0, 0xBE } - -//LED I2C bus speed -#define I2C_HZ 580000 - -//Count of LED bodies -#define ISSI3733_LED_COUNT 105 - -//Default Global Current Register value (Default brightness 0 - 255) -#define ISSI3733_GCR_DEFAULT 128 - -#define LED_GCR_MAX 165 //Max GCR value (0 - 255) WARNING: Raising this value may overload the LED drivers and USB bus -#define LED_GCR_STEP 10 //GCR increment/decrement value - -//Automatic power rollback and recovery -#define V5_HIGH 2540 //5V high level (After low power detect, point at which LEDs are allowed to use more power ) -#define V5_LOW 2480 //5V low level (LED power rolled back to stay above this limit) -#define V5_CAT 2200 //5V catastrophic level (Host USB port potential to shut down) - -#define ANIMATION_SPEED_STEP 1 - -#define BREATHE_MIN_STEP 0 -#define BREATHE_MAX_STEP 255 - -//LED Mapping - More practically generated from a spreadsheet program -//id: ID of the LED (Sync with PCB callouts) -//x: Physical X coordinate of LED (units do not matter) -//y: Physical Y coordinate of LED (units do not matter) -//drv: 1-Based index of ISSI3773_DRIVER_ADDRESSES -//cs: Matrix wiring CS col (1-16) -//swr: Matrix wiring SW Red row (1-12) -//swg: Matrix wiring SW Green row (1-12) -//swb: Matrix wiring SW Blue row (1-12) -//scan: Associated key scancode if any -//Note: Origin 0,0 may be located anywhere as the software will do the final layout -#define ISSI3733_LED_MAP { \ - { .id = 1, .x = 0, .y = 0, .adr = { .drv = 2, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 0 }, \ - { .id = 2, .x = 0.75, .y = 0, .adr = { .drv = 2, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 1 }, \ - { .id = 3, .x = 1.5, .y = 0, .adr = { .drv = 2, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 2 }, \ - { .id = 4, .x = 2.25, .y = 0, .adr = { .drv = 2, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 3 }, \ - { .id = 5, .x = 3, .y = 0, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 4 }, \ - { .id = 6, .x = 3.75, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ - { .id = 7, .x = 4.5, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ - { .id = 8, .x = 5.25, .y = 0, .adr = { .drv = 2, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 7 }, \ - { .id = 9, .x = 6, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 8 }, \ - { .id = 10, .x = 6.75, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 9 }, \ - { .id = 11, .x = 7.5, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 10 }, \ - { .id = 12, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 11 }, \ - { .id = 13, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 12 }, \ - { .id = 14, .x = 10.125, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 13 }, \ - { .id = 15, .x = 11.25, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 14 }, \ - { .id = 16, .x = 0.188, .y = -0.75, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 15 }, \ - { .id = 17, .x = 1.125, .y = -0.75, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ - { .id = 18, .x = 1.875, .y = -0.75, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ - { .id = 19, .x = 2.625, .y = -0.75, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ - { .id = 20, .x = 3.375, .y = -0.75, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ - { .id = 21, .x = 4.125, .y = -0.75, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ - { .id = 22, .x = 4.875, .y = -0.75, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ - { .id = 23, .x = 5.625, .y = -0.75, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ - { .id = 24, .x = 6.375, .y = -0.75, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 23 }, \ - { .id = 25, .x = 7.125, .y = -0.75, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 24 }, \ - { .id = 26, .x = 7.875, .y = -0.75, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 25 }, \ - { .id = 27, .x = 8.625, .y = -0.75, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 26 }, \ - { .id = 28, .x = 9.375, .y = -0.75, .adr = { .drv = 1, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ - { .id = 29, .x = 10.313, .y = -0.75, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 28 }, \ - { .id = 30, .x = 11.25, .y = -0.75, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ - { .id = 31, .x = 0.281, .y = -1.5, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 30 }, \ - { .id = 32, .x = 1.313, .y = -1.5, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ - { .id = 33, .x = 2.063, .y = -1.5, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ - { .id = 34, .x = 2.813, .y = -1.5, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ - { .id = 35, .x = 3.563, .y = -1.5, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ - { .id = 36, .x = 4.313, .y = -1.5, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ - { .id = 37, .x = 5.063, .y = -1.5, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ - { .id = 38, .x = 5.813, .y = -1.5, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ - { .id = 39, .x = 6.563, .y = -1.5, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 38 }, \ - { .id = 40, .x = 7.313, .y = -1.5, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 39 }, \ - { .id = 41, .x = 8.063, .y = -1.5, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ - { .id = 42, .x = 8.813, .y = -1.5, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 41 }, \ - { .id = 43, .x = 10.031, .y = -1.5, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 43 }, \ - { .id = 44, .x = 11.25, .y = -1.5, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 44 }, \ - { .id = 45, .x = 0.469, .y = -2.25, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 45 }, \ - { .id = 46, .x = 1.688, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ - { .id = 47, .x = 2.438, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 48 }, \ - { .id = 48, .x = 3.188, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ - { .id = 49, .x = 3.938, .y = -2.25, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 50 }, \ - { .id = 50, .x = 4.688, .y = -2.25, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ - { .id = 51, .x = 5.438, .y = -2.25, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ - { .id = 52, .x = 6.188, .y = -2.25, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 53 }, \ - { .id = 53, .x = 6.938, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 54 }, \ - { .id = 54, .x = 7.688, .y = -2.25, .adr = { .drv = 1, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 55 }, \ - { .id = 55, .x = 8.438, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ - { .id = 56, .x = 9.469, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 57 }, \ - { .id = 57, .x = 10.5, .y = -2.25, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 58 }, \ - { .id = 58, .x = 11.25, .y = -2.25, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 59 }, \ - { .id = 59, .x = 0.094, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ - { .id = 60, .x = 1.031, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ - { .id = 61, .x = 1.969, .y = -3, .adr = { .drv = 2, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 62 }, \ - { .id = 62, .x = 4.781, .y = -3, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 66 }, \ - { .id = 63, .x = 7.594, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 70 }, \ - { .id = 64, .x = 8.531, .y = -3, .adr = { .drv = 1, .cs = 10, .swr = 2, .swg = 1, .swb = 3 }, .scan = 71 }, \ - { .id = 65, .x = 9.75, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 72 }, \ - { .id = 66, .x = 10.5, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 73 }, \ - { .id = 67, .x = 11.25, .y = -3, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 74 }, \ - { .id = 68, .x = -0.338, .y = -3.338, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 69, .x = 0.39, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 70, .x = 1.263, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 71, .x = 2.135, .y = -3.443, .adr = { .drv = 2, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 72, .x = 3.008, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 73, .x = 3.88, .y = -3.443, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 74, .x = 4.753, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 75, .x = 5.625, .y = -3.443, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 76, .x = 6.497, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 77, .x = 7.37, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 78, .x = 8.242, .y = -3.443, .adr = { .drv = 1, .cs = 9, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 79, .x = 9.115, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 80, .x = 9.987, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 81, .x = 10.86, .y = -3.443, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 82, .x = 11.588, .y = -3.338, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 83, .x = 11.693, .y = -2.623, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 84, .x = 11.693, .y = -1.873, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 85, .x = 11.693, .y = -1.123, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 86, .x = 11.693, .y = -0.373, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 87, .x = 11.588, .y = 0.338, .adr = { .drv = 1, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 88, .x = 9.908, .y = 0.443, .adr = { .drv = 1, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 89, .x = 9.288, .y = 0.443, .adr = { .drv = 1, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 90, .x = 8.625, .y = 0.443, .adr = { .drv = 1, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 91, .x = 7.875, .y = 0.443, .adr = { .drv = 1, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 92, .x = 7.125, .y = 0.443, .adr = { .drv = 1, .cs = 2, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 93, .x = 6.375, .y = 0.443, .adr = { .drv = 1, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 94, .x = 5.625, .y = 0.443, .adr = { .drv = 1, .cs = 14, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 95, .x = 4.875, .y = 0.443, .adr = { .drv = 2, .cs = 8, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 96, .x = 4.125, .y = 0.443, .adr = { .drv = 2, .cs = 7, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 97, .x = 3.375, .y = 0.443, .adr = { .drv = 2, .cs = 6, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 98, .x = 2.625, .y = 0.443, .adr = { .drv = 2, .cs = 5, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 99, .x = 1.875, .y = 0.443, .adr = { .drv = 2, .cs = 4, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 100, .x = 1.125, .y = 0.443, .adr = { .drv = 2, .cs = 3, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 101, .x = -0.338, .y = 0.338, .adr = { .drv = 2, .cs = 1, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ - { .id = 102, .x = -0.443, .y = -0.373, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 255 }, \ - { .id = 103, .x = -0.443, .y = -1.123, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 255 }, \ - { .id = 104, .x = -0.443, .y = -1.873, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ - { .id = 105, .x = -0.443, .y = -2.623, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 255 }, \ -}; - - -#define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality -#ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) - #define USB_LED_NUM_LOCK_SCANCODE 255 - #define USB_LED_CAPS_LOCK_SCANCODE 30 - #define USB_LED_SCROLL_LOCK_SCANCODE 255 - #define USB_LED_COMPOSE_SCANCODE 255 - #define USB_LED_KANA_SCANCODE 255 -#endif //USB_LED_INDICATOR_ENABLE - -#endif //_config_led_h_ diff --git a/keyboards/massdrop/alt67/info.json b/keyboards/massdrop/alt67/info.json deleted file mode 100644 index 8f85bece21..0000000000 --- a/keyboards/massdrop/alt67/info.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "keyboard_name": "ALT", - "url": "https://www.massdrop.com/buy/massdrop-alt-mechanical-keyboard", - "maintainer": "Massdrop", - "width": 16, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [ - {"label":"ESCAPE", "x":0, "y":0}, - {"label":"1", "x":1, "y":0}, - {"label":"2", "x":2, "y":0}, - {"label":"3", "x":3, "y":0}, - {"label":"4", "x":4, "y":0}, - {"label":"5", "x":5, "y":0}, - {"label":"6", "x":6, "y":0}, - {"label":"7", "x":7, "y":0}, - {"label":"8", "x":8, "y":0}, - {"label":"9", "x":9, "y":0}, - {"label":"0", "x":10, "y":0}, - {"label":"MINUS", "x":11, "y":0}, - {"label":"EQUALS", "x":12, "y":0}, - {"label":"BACKSPACE", "x":13, "y":0, "w":2}, - {"label":"DELETE", "x":15, "y":0}, - {"label":"TAB", "x":0, "y":1, "w":1.5}, - {"label":"Q", "x":1.5, "y":1}, - {"label":"W", "x":2.5, "y":1}, - {"label":"E", "x":3.5, "y":1}, - {"label":"R", "x":4.5, "y":1}, - {"label":"T", "x":5.5, "y":1}, - {"label":"Y", "x":6.5, "y":1}, - {"label":"U", "x":7.5, "y":1}, - {"label":"I", "x":8.5, "y":1}, - {"label":"O", "x":9.5, "y":1}, - {"label":"P", "x":10.5, "y":1}, - {"label":"LEFT BRACKET", "x":11.5, "y":1}, - {"label":"RIGHT BRACKET", "x":12.5, "y":1}, - {"label":"BACK SLASH", "x":13.5, "y":1, "w":1.5}, - {"label":"HOME", "x":15, "y":1}, - {"label":"CAPS LOCK", "x":0, "y":2, "w":1.75}, - {"label":"A", "x":1.75, "y":2}, - {"label":"S", "x":2.75, "y":2}, - {"label":"D", "x":3.75, "y":2}, - {"label":"F", "x":4.75, "y":2}, - {"label":"G", "x":5.75, "y":2}, - {"label":"H", "x":6.75, "y":2}, - {"label":"J", "x":7.75, "y":2}, - {"label":"K", "x":8.75, "y":2}, - {"label":"L", "x":9.75, "y":2}, - {"label":"SEMICOLON", "x":10.75, "y":2}, - {"label":"SINGLE TICK", "x":11.75, "y":2}, - {"label":"ENTER", "x":12.75, "y":2, "w":2.25}, - {"label":"PAGE UP", "x":15, "y":2}, - {"label":"LEFT SHIFT", "x":0, "y":3, "w":2.25}, - {"label":"Z", "x":2.25, "y":3}, - {"label":"X", "x":3.25, "y":3}, - {"label":"C", "x":4.25, "y":3}, - {"label":"V", "x":5.25, "y":3}, - {"label":"B", "x":6.25, "y":3}, - {"label":"N", "x":7.25, "y":3}, - {"label":"M", "x":8.25, "y":3}, - {"label":"COMMA", "x":9.25, "y":3}, - {"label":"PERIOD", "x":10.25, "y":3}, - {"label":"FORWARD SLASH", "x":11.25, "y":3}, - {"label":"RIGHT SHIFT", "x":12.25, "y":3, "w":1.75}, - {"label":"UP ARROW", "x":14, "y":3}, - {"label":"PAGE DOWN", "x":15, "y":3}, - {"label":"LEFT CTRL", "x":0, "y":4, "w":1.25}, - {"label":"LEFT WIN", "x":1.25, "y":4, "w":1.25}, - {"label":"LEFT ALT", "x":2.5, "y":4, "w":1.25}, - {"label":"SPACEBAR", "x":3.75, "y":4, "w":6.25}, - {"label":"RIGHT ALT", "x":10, "y":4, "w":1.25}, - {"label":"FN", "x":11.25, "y":4, "w":1.25}, - {"label":"LEFT ARROW", "x":13, "y":4}, - {"label":"DOWN ARROW", "x":14, "y":4}, - {"label":"RIGHT ARROW", "x":15, "y":4} - ] - } - } -} diff --git a/keyboards/massdrop/alt67/keymaps/default/keymap.c b/keyboards/massdrop/alt67/keymaps/default/keymap.c deleted file mode 100644 index b8d0b6c03c..0000000000 --- a/keyboards/massdrop/alt67/keymaps/default/keymap.c +++ /dev/null @@ -1,200 +0,0 @@ -#include QMK_KEYBOARD_H - -enum alt67_keycodes { - L_BRI = SAFE_RANGE, //LED Brightness Increase - L_BRD, //LED Brightness Decrease - L_PTN, //LED Pattern Select Next - L_PTP, //LED Pattern Select Previous - L_PSI, //LED Pattern Speed Increase - L_PSD, //LED Pattern Speed Decrease - L_T_MD, //LED Toggle Mode - L_T_ONF, //LED Toggle On / Off - L_ON, //LED On - L_OFF, //LED Off - L_T_BR, //LED Toggle Breath Effect - L_T_PTD, //LED Toggle Scrolling Pattern Direction - U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active - U_T_AGCR, //USB Toggle Automatic GCR control - DBG_TOG, //DEBUG Toggle On / Off - DBG_MTRX, //DEBUG Toggle Matrix Prints - DBG_KBD, //DEBUG Toggle Keyboard Prints - DBG_MOU, //DEBUG Toggle Mouse Prints -}; - -#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode - -keymap_config_t keymap_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, 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_DEL, \ - 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_HOME, \ - 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_PGUP, \ - KC_LSFT, 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_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ - ), - [1] = LAYOUT( - KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ - L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ - ), - /* - [X] = LAYOUT( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - */ -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { -}; - -#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) -#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case L_BRI: - if (record->event.pressed) { - if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; - else gcr_desired += LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_BRD: - if (record->event.pressed) { - if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; - else gcr_desired -= LED_GCR_STEP; - if (led_animation_breathing) gcr_breathe = gcr_desired; - } - return false; - case L_PTN: - if (record->event.pressed) { - if (led_animation_id == led_setups_count - 1) led_animation_id = 0; - else led_animation_id++; - } - return false; - case L_PTP: - if (record->event.pressed) { - if (led_animation_id == 0) led_animation_id = led_setups_count - 1; - else led_animation_id--; - } - return false; - case L_PSI: - if (record->event.pressed) { - led_animation_speed += ANIMATION_SPEED_STEP; - } - return false; - case L_PSD: - if (record->event.pressed) { - led_animation_speed -= ANIMATION_SPEED_STEP; - if (led_animation_speed < 0) led_animation_speed = 0; - } - return false; - case L_T_MD: - if (record->event.pressed) { - led_lighting_mode++; - if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; - } - return false; - case L_T_ONF: - if (record->event.pressed) { - led_enabled = !led_enabled; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_ON: - if (record->event.pressed) { - led_enabled = 1; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_OFF: - if (record->event.pressed) { - led_enabled = 0; - I2C3733_Control_Set(led_enabled); - } - return false; - case L_T_BR: - if (record->event.pressed) { - led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { - gcr_breathe = gcr_desired; - led_animation_breathe_cur = BREATHE_MIN_STEP; - breathe_dir = 1; - } - } - return false; - case L_T_PTD: - if (record->event.pressed) { - led_animation_direction = !led_animation_direction; - } - return false; - case U_T_AUTO: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case U_T_AGCR: - if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_TOG: - if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MTRX: - if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_KBD: - if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - case DBG_MOU: - if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); - } - return false; - default: - return true; //Process all other keycodes normally - } -} \ No newline at end of file diff --git a/keyboards/massdrop/alt67/led_programs.c b/keyboards/massdrop/alt67/led_programs.c deleted file mode 100644 index a8aab28d98..0000000000 --- a/keyboards/massdrop/alt67/led_programs.c +++ /dev/null @@ -1,120 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "alt67.h" -#include "led_matrix.h" - -//Teal <-> Salmon -led_setup_t leds_teal_salmon[] = { - { .hs = 0, .he = 33, .rs = 24, .re = 24, .gs = 215, .ge = 215, .bs = 204, .be = 204, .ef = EF_NONE }, - { .hs = 33, .he = 66, .rs = 24, .re = 255, .gs = 215, .ge = 114, .bs = 204, .be = 118, .ef = EF_NONE }, - { .hs = 66, .he = 100, .rs = 255, .re = 255, .gs = 114, .ge = 114, .bs = 118, .be = 118, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Yellow -led_setup_t leds_yellow[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Off -led_setup_t leds_off[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Red -led_setup_t leds_red[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Green -led_setup_t leds_green[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_NONE }, - { .end = 1 }, -}; - -//Blue -led_setup_t leds_blue[] = { - { .hs = 0, .he = 100, .rs = 0, .re = 0, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White -led_setup_t leds_white[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .end = 1 }, -}; - -//White with moving red stripe -led_setup_t leds_white_with_red_stripe[] = { - { .hs = 0, .he = 100, .rs = 255, .re = 255, .gs = 255, .ge = 255, .bs = 255, .be = 255, .ef = EF_NONE }, - { .hs = 0, .he = 15, .rs = 0, .re = 0, .gs = 0, .ge = 255, .bs = 0, .be = 255, .ef = EF_SCR_R | EF_SUBTRACT }, - { .hs = 15, .he = 30, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 0, .ef = EF_SCR_R | EF_SUBTRACT }, - { .end = 1 }, -}; - -//Black with moving red stripe -led_setup_t leds_black_with_red_stripe[] = { - { .hs = 0, .he = 15, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .hs = 15, .he = 30, .rs = 255, .re = 0, .gs = 0, .ge = 0, .bs = 0, .be = 0, .ef = EF_SCR_R }, - { .end = 1 }, -}; - -//Rainbow no scrolling -led_setup_t leds_rainbow_ns[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER }, - { .end = 1 }, -}; - -//Rainbow scrolling -led_setup_t leds_rainbow_s[] = { - { .hs = 0, .he = 16.67, .rs = 255, .re = 255, .gs = 0, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 16.67, .he = 33.33, .rs = 255, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .hs = 33.33, .he = 50, .rs = 0, .re = 0, .gs = 255, .ge = 255, .bs = 0, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 50, .he = 66.67, .rs = 0, .re = 0, .gs = 255, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 66.67, .he = 83.33, .rs = 0, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 255, .ef = EF_OVER | EF_SCR_R }, - { .hs = 83.33, .he = 100, .rs = 255, .re = 255, .gs = 0, .ge = 0, .bs = 255, .be = 0, .ef = EF_OVER | EF_SCR_R }, - { .end = 1 }, -}; - -//Add new LED animations here using one from above as example -//The last entry must be { .end = 1 } -//Add the new animation name to the list below following its format - -void *led_setups[] = { - leds_rainbow_s, - leds_rainbow_ns, - leds_teal_salmon, - leds_yellow, - leds_red, - leds_green, - leds_blue, - leds_white, - leds_white_with_red_stripe, - leds_black_with_red_stripe, - leds_off -}; - -const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); diff --git a/keyboards/massdrop/alt67/matrix.c b/keyboards/massdrop/alt67/matrix.c deleted file mode 100644 index e107b4c22c..0000000000 --- a/keyboards/massdrop/alt67/matrix.c +++ /dev/null @@ -1,182 +0,0 @@ -/* -Copyright 2018 Massdrop Inc. - -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 . -*/ - -#include "alt67.h" - -#include "d51_util.h" -#include "debug.h" -#include "clks.h" -#include - -matrix_row_t mlatest[MATRIX_ROWS]; -matrix_row_t mlast[MATRIX_ROWS]; -matrix_row_t mdebounced[MATRIX_ROWS]; - -uint8_t row_ports[] = { MATRIX_ROW_PORTS }; -uint8_t row_pins[] = { MATRIX_ROW_PINS }; -uint8_t col_ports[] = { MATRIX_COL_PORTS }; -uint8_t col_pins[] = { MATRIX_COL_PINS }; -uint32_t row_masks[2]; //NOTE: If more than PA PB used in the future, adjust code to accomodate - -__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) { -} - -void matrix_init(void) -{ - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mlast, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - memset(mdebounced, 0, MATRIX_ROWS * sizeof(matrix_row_t)); - - row_masks[PA] = 0; - row_masks[PB] = 0; - - uint8_t row; - for (row = 0; row < MATRIX_ROWS; row++) - { - PORT->Group[row_ports[row]].DIRCLR.reg = 1 << row_pins[row]; //Input - PORT->Group[row_ports[row]].OUTCLR.reg = 1 << row_pins[row]; //Low - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.INEN = 1; //Input Enable, - PORT->Group[row_ports[row]].PINCFG[row_pins[row]].bit.PULLEN = 1; //Pull Enable - row_masks[row_ports[row]] |= 1 << row_pins[row]; //Add pin to proper row mask - } - - uint8_t col; - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low - } - - matrix_init_quantum(); -} - -#define MATRIX_SCAN_DELAY 10 //Delay after setting a col to output (in us) - -uint64_t mdebouncing = 0; -uint8_t matrix_scan(void) -{ - uint8_t mchanged; - uint8_t row; - uint8_t col; - uint32_t scans[2]; //PA PB - - if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - - //m15_off; //Profiling scans - - memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer - - for (col = 0; col < MATRIX_COLS; col++) - { - PORT->Group[col_ports[col]].OUTSET.reg = 1 << col_pins[col]; //Set col output - - CLK_delay_us(MATRIX_SCAN_DELAY); //Delay for output - - scans[PA] = PORT->Group[PA].IN.reg & row_masks[PA]; //Read PA row pins data - scans[PB] = PORT->Group[PB].IN.reg & row_masks[PB]; //Read PB row pins data - - PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Clear col output - - for (row = 0; row < MATRIX_ROWS; row++) - { - //Move scan bits from scans array into proper row bit locations - if (scans[row_ports[row]] & (1 << row_pins[row])) - mlatest[row] |= 1 << col; - } - } - - mchanged = 0; //Default to no matrix change since last - - for (row = 0; row < MATRIX_ROWS; row++) - { - if (mlast[row] != mlatest[row]) - mchanged = 1; - mlast[row] = mlatest[row]; - } - - if (!mchanged) - { - for (row = 0; row < MATRIX_ROWS; row++) - mdebounced[row] = mlatest[row]; - mdebouncing = 0; - } - else - { - //Begin or extend debounce on change - mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; - } - - //m15_on; //Profiling scans - - matrix_scan_quantum(); - - return 1; -} - -matrix_row_t matrix_get_row(uint8_t row) -{ - return mdebounced[row]; -} - -void matrix_print(void) -{ - char buf[(MATRIX_COLS+8)*(MATRIX_ROWS+1)] = "R C"; - char *pbuf = buf+3; - uint32_t cols; - uint32_t rows; - matrix_row_t row; - - for (cols = 1; cols <= MATRIX_COLS; cols++) - { - *pbuf = (cols%10)+48; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - - for (rows = 1; rows <= MATRIX_ROWS; rows++) - { - row = matrix_get_row(rows-1); - if (rows < 10) { *pbuf = rows+48; pbuf++; *pbuf = ' '; pbuf++; *pbuf = ' '; pbuf++; } - else { *pbuf = (rows/10)+48; pbuf++; *pbuf = (rows%10)+48; pbuf++; *pbuf = ' '; pbuf++; } - for (cols = 0; cols < MATRIX_COLS; cols++) - { - if (row & 1 << cols) *pbuf = 'X'; - else *pbuf = '.'; - pbuf++; - } - *pbuf = '\r'; pbuf++; - *pbuf = '\n'; pbuf++; - } - *pbuf = 0; - dprint(buf); -} diff --git a/keyboards/massdrop/alt67/matrix.h b/keyboards/massdrop/alt67/matrix.h deleted file mode 100644 index 3eab6dece1..0000000000 --- a/keyboards/massdrop/alt67/matrix.h +++ /dev/null @@ -1,77 +0,0 @@ -/* -Copyright 2011 Jun Wako - -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 . -*/ -#ifndef MATRIX_H -#define MATRIX_H - -#include -#include -#include "keyboard.h" - -#if (MATRIX_COLS <= 8) -typedef uint8_t matrix_row_t; -#elif (MATRIX_COLS <= 16) -typedef uint16_t matrix_row_t; -#elif (MATRIX_COLS <= 32) -typedef uint32_t matrix_row_t; -#else -#error "MATRIX_COLS: invalid value" -#endif - -#define MATRIX_IS_ON(row, col) (matrix_get_row(row) && (1<. #ifndef _USB2422_H_ #define _USB2422_H_ -#define USB2422_ALT67_1P0 #define REV_USB2422 0x100 #define USB2422_ADDR 0x58 //I2C device address, one instance -- cgit v1.2.3 From dedffb5f6dcf3519f787692aca69851cb4049708 Mon Sep 17 00:00:00 2001 From: Salt-Peanuts Date: Sat, 1 Sep 2018 12:22:21 -0400 Subject: Keymap: Cleaned up Rorschach keymap (#3823) --- .../rorschach/keymaps/insertsnideremarks/keymap.c | 41 ---------------------- 1 file changed, 41 deletions(-) diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c b/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c index 5f4c26415d..5d93e2f057 100644 --- a/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c +++ b/keyboards/rorschach/keymaps/insertsnideremarks/keymap.c @@ -10,8 +10,6 @@ enum rorschach_layers { _FUNCTION, // Function _FUNCTION2, // Function 2 (identical as _FUNCTION; used to allow for easier use of space and backspace while using function layer arrows) _NUMPAD, // Numpad -// _COLEMAKGM, // Colemak gaming/vanilla (no dual-role keys with layer access) -// _QWERTYGM, // QWERTY gaming/vanilla (no dual-role keys with layer access) _ADJUST, // Adjust layer, accessed via tri-layer feature) _ADJUST2 // Second Adjust layer, accessed outside of tri-layer feature) }; @@ -19,8 +17,6 @@ enum rorschach_layers { enum rorschach_keycodes { COLEMAK = SAFE_RANGE, QWERTY, -// COLEMAKGM, -// QWERTYGM, NUMPAD = TG(_NUMPAD), ADJUST = MO(_ADJUST2), SPCFN = LT(_FUNCTION, KC_SPC), @@ -269,8 +265,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off ( _FUNCTION); layer_off ( _FUNCTION2); layer_off ( _NUMPAD); -// layer_off ( _COLEMAKGM); -// layer_off ( _QWERTYGM); layer_off ( _ADJUST); layer_off ( _ADJUST2); } @@ -285,46 +279,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off ( _FUNCTION); layer_off ( _FUNCTION2); layer_off ( _NUMPAD); -// layer_off ( _COLEMAKGM); -// layer_off ( _QWERTYGM); layer_off ( _ADJUST); layer_off ( _ADJUST2); } return false; break; -/* case COLEMAKGM: - if (record->event.pressed) { - default_layer_set(1UL << _COLEMAKGM); - layer_off ( _QWERTY); - layer_off ( _COLEMAK); - layer_off ( _NUMBERS); - layer_off ( _NUMBERS2); - layer_off ( _FUNCTION); - layer_off ( _FUNCTION2); - layer_off ( _NUMPAD); - layer_off ( _QWERTYGM); - layer_off ( _ADJUST); - layer_off ( _ADJUST2); - } - return false; - break; - case QWERTYGM: - if (record->event.pressed) { - default_layer_set(1UL << _QWERTYGM); - layer_off ( _QWERTY); - layer_off ( _COLEMAK); - layer_off ( _NUMBERS); - layer_off ( _NUMBERS2); - layer_off ( _FUNCTION); - layer_off ( _FUNCTION2); - layer_off ( _NUMPAD); - layer_off ( _COLEMAKGM); - layer_off ( _ADJUST); - layer_off ( _ADJUST2); - } - return false; - break; -*/ } return true; } \ No newline at end of file -- cgit v1.2.3 From 8eb674b257147efa4ba7829fb294254497aec7c6 Mon Sep 17 00:00:00 2001 From: Jon Olsson Date: Sat, 1 Sep 2018 18:23:10 +0200 Subject: Keymap: Nojjan atreus (#3822) * Add support for my Falbatech Atreus This is currently the default Atreus keyboard layout, but I will eventually customize it to match my Ergodox layout. * Address review comments * More review comments fixed * More review comments fixed --- keyboards/atreus/keymaps/nojjan/config.h | 10 ++++++ keyboards/atreus/keymaps/nojjan/keymap.c | 61 ++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 keyboards/atreus/keymaps/nojjan/config.h create mode 100644 keyboards/atreus/keymaps/nojjan/keymap.c diff --git a/keyboards/atreus/keymaps/nojjan/config.h b/keyboards/atreus/keymaps/nojjan/config.h new file mode 100644 index 0000000000..90b7c4a6c6 --- /dev/null +++ b/keyboards/atreus/keymaps/nojjan/config.h @@ -0,0 +1,10 @@ +#pragma once + +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#undef UNUSED_PINS + +// Pin configuration for falbatech atreus +#define MATRIX_ROW_PINS { D0, D1, D3, D2 } +#define MATRIX_COL_PINS { D7, C6, B5, B4, E6, D4, B6, F6, F7, D6, B7 } +#define UNUSED_PINS diff --git a/keyboards/atreus/keymaps/nojjan/keymap.c b/keyboards/atreus/keymaps/nojjan/keymap.c new file mode 100644 index 0000000000..8f56e57467 --- /dev/null +++ b/keyboards/atreus/keymaps/nojjan/keymap.c @@ -0,0 +1,61 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// 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 _QW 0 +#define _RS 1 +#define _LW 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = LAYOUT( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P , + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN , + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , + KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT ), +/* + * ! @ up { } || pgup 7 8 9 * + * # left down right $ || pgdn 4 5 6 + + * [ ] ( ) & || ` 1 2 3 \ + * lower insert super shift bksp ctrl || alt space fn . 0 = + */ +[_RS] = LAYOUT( /* [> RAISE <] */ + KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR , + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , + KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , + TG(_LW), KC_INS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL ), +/* + * insert home up end pgup || up F7 F8 F9 F10 + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift bksp ctrl || alt space L0 prtsc scroll pause + */ +[_LW] = LAYOUT( /* [> LOWER <] */ + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , + KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12 , + KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; -- cgit v1.2.3 From ffc2dc0359ee3eee4eea8605082cfc210b1bc53d Mon Sep 17 00:00:00 2001 From: Yasuhiro Shimizu Date: Sun, 2 Sep 2018 01:38:29 +0900 Subject: Keymap: add yshrsmz keymaps (#3770) * add ergo42 keymap * add helix keymap * add keymap for lets_split * Add keymap for nyquist * update keymaps to address review comments - remove unneeded include - use `#pragma once` --- keyboards/ergo42/keymaps/yshrsmz/config.h | 36 ++ keyboards/ergo42/keymaps/yshrsmz/keymap.c | 166 ++++++++ keyboards/ergo42/keymaps/yshrsmz/rules.mk | 4 + keyboards/helix/rev2/keymaps/yshrsmz/config.h | 23 + keyboards/helix/rev2/keymaps/yshrsmz/keymap.c | 558 +++++++++++++++++++++++++ keyboards/helix/rev2/keymaps/yshrsmz/readme.md | 25 ++ keyboards/helix/rev2/keymaps/yshrsmz/rules.mk | 121 ++++++ keyboards/lets_split/keymaps/yshrsmz/config.h | 35 ++ keyboards/lets_split/keymaps/yshrsmz/keymap.c | 180 ++++++++ keyboards/lets_split/keymaps/yshrsmz/rules.mk | 1 + keyboards/nyquist/keymaps/yshrsmz/config.h | 39 ++ keyboards/nyquist/keymaps/yshrsmz/keymap.c | 195 +++++++++ keyboards/nyquist/keymaps/yshrsmz/rules.mk | 1 + 13 files changed, 1384 insertions(+) create mode 100644 keyboards/ergo42/keymaps/yshrsmz/config.h create mode 100644 keyboards/ergo42/keymaps/yshrsmz/keymap.c create mode 100644 keyboards/ergo42/keymaps/yshrsmz/rules.mk create mode 100644 keyboards/helix/rev2/keymaps/yshrsmz/config.h create mode 100644 keyboards/helix/rev2/keymaps/yshrsmz/keymap.c create mode 100644 keyboards/helix/rev2/keymaps/yshrsmz/readme.md create mode 100644 keyboards/helix/rev2/keymaps/yshrsmz/rules.mk create mode 100644 keyboards/lets_split/keymaps/yshrsmz/config.h create mode 100644 keyboards/lets_split/keymaps/yshrsmz/keymap.c create mode 100644 keyboards/lets_split/keymaps/yshrsmz/rules.mk create mode 100644 keyboards/nyquist/keymaps/yshrsmz/config.h create mode 100644 keyboards/nyquist/keymaps/yshrsmz/keymap.c create mode 100644 keyboards/nyquist/keymaps/yshrsmz/rules.mk diff --git a/keyboards/ergo42/keymaps/yshrsmz/config.h b/keyboards/ergo42/keymaps/yshrsmz/config.h new file mode 100644 index 0000000000..1892ef6529 --- /dev/null +++ b/keyboards/ergo42/keymaps/yshrsmz/config.h @@ -0,0 +1,36 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +/* auto shift config */ +#define AUTO_SHIFT_TIMEOUT 150 + diff --git a/keyboards/ergo42/keymaps/yshrsmz/keymap.c b/keyboards/ergo42/keymaps/yshrsmz/keymap.c new file mode 100644 index 0000000000..a4a83a2e1b --- /dev/null +++ b/keyboards/ergo42/keymaps/yshrsmz/keymap.c @@ -0,0 +1,166 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _META 1 +#define _SYMB 2 +#define _GAME 3 + + +enum custom_keycodes { + BASE = SAFE_RANGE, + META, + SYMB, + GAME, + EISU, + KANA +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BASE + * ,------------------------------------------------. ,------------------------------------------------. + * | = | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | - | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | ( | | ) | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | EISU | Ctrl | Alt | GUI | ESC/ |Del |Back | |Enter |Space | META | GUI |=>GAME|=>SYMB| KANA | + * | | | | | SYMB | |Space | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[_BASE] = LAYOUT( \ + KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LPRN, KC_RPRN, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, \ + EISU, KC_LCTRL, KC_LALT, KC_LGUI, LT(_SYMB, KC_ESC),KC_DEL, KC_BSPC, KC_ENT, KC_SPC, META, KC_LGUI, TG(_GAME), TG(_SYMB), KANA \ +), + +/* META + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | PgUp | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Home | End |Alt+← |Alt+→ | PgDn | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |Reset | | | | + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[_META] = LAYOUT( \ + 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ +), + +/* SYMB + * ,------------------------------------------------. ,------------------------------------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | - | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | PgUp | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Home | End |Alt+← |Alt+→ | PgDn | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |Reset | | | | + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + +[_SYMB] = LAYOUT( \ + KC_TILD, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), _______, _______, S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ +), + +/* GAME + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc | ESC |Space |Tab | |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | | | | | |Space | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ +[_GAME] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \ +) + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BASE: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_BASE); + } + return false; + break; + case META: + if (record->event.pressed) { + layer_on(_META); + update_tri_layer(_META, _SYMB, _GAME); + } else { + layer_off(_META); + update_tri_layer(_META, _SYMB, _GAME); + } + return false; + break; + case SYMB: + if (record->event.pressed) { + layer_on(_SYMB); + update_tri_layer(_META, _SYMB, _GAME); + } else { + layer_off(_SYMB); + update_tri_layer(_META, _SYMB, _GAME); + } + return false; + break; + case GAME: + if (record->event.pressed) { + layer_on(_GAME); + } else { + layer_off(_GAME); + } + return false; + break; + case EISU: + if (record->event.pressed) { + register_code(KC_LANG2); + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + register_code(KC_LANG1); + } else { + unregister_code(KC_LANG1); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergo42/keymaps/yshrsmz/rules.mk b/keyboards/ergo42/keymaps/yshrsmz/rules.mk new file mode 100644 index 0000000000..a779882fad --- /dev/null +++ b/keyboards/ergo42/keymaps/yshrsmz/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + +AUTO_SHIFT_ENABLE = yes diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/config.h b/keyboards/helix/rev2/keymaps/yshrsmz/config.h new file mode 100644 index 0000000000..a1cd126eef --- /dev/null +++ b/keyboards/helix/rev2/keymaps/yshrsmz/config.h @@ -0,0 +1,23 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* auto shift config */ +#define AUTO_SHIFT_TIMEOUT 150 diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c new file mode 100644 index 0000000000..cce28796e6 --- /dev/null +++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c @@ -0,0 +1,558 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _FUNC, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + FUNC, + ADJUST, + EISU, + KANA +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +#if HELIX_ROWS == 5 +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ESC | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Shift | Z | X | C | V | B | Fn | Fn | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | EISU | Ctrl | Alt | GUI |Lower |Space | Bksp |Enter |Space |Raise | GUI | Alt | Ctrl | KANA | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, FUNC, FUNC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + EISU, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KANA \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Func + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | LEFT | DOWN | UP |RIGHT | PGUP | | + * |------+------+------+------+------+------|------+------|------+------+------+------+------+------| + * | | | | | | | | | HOME | END |Alt+← |Alt+→ | PGDN | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_FUNC] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty| | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#elif HELIX_ROWS == 4 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | = | Q | W | E | R | T | | Y | U | I | O | P | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | EISU | Ctrl | Alt | GUI |ESC/Lower | Func | Bksp |Enter |Space |Raise | GUI | Alt | Ctrl | KANA | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( \ + KC_EQL, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + EISU, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_ESC), FUNC, KC_BSPC, KC_ENT, KC_SPC, RAISE, KC_RGUI, KC_RALT, KC_RCTL, KANA \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Func + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | LEFT | DOWN | UP |RIGHT | PGUP | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | HOME | END |Alt+← |Alt+→ | PGDN | | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------------------' + */ + [_FUNC] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|Audoff| Mac | | Win |Qwerty| | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | |RGB ON| HUE+ | SAT+ | VAL+ | + * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | | | | | | | | | MODE | HUE- | SAT- | VAL- | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + ) +}; + +#else +#error "undefined keymaps" +#endif + + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_scan_user(void) { + led_test_init(); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_FUNC (1<<_FUNC) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(matrix, PSTR("Lower")); + break; + case L_FUNC: + matrix_write_P(matrix, PSTR("Func")); + break; + case L_ADJUST: + case L_ADJUST_TRI: + matrix_write_P(matrix, PSTR("Adjust")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< helix:defualt +## option= oled | back | under | na | ios +## ex. +## make HELIX=oled helix:defualt +## make HELIX=oled,back helix:defualt +## make HELIX=oled,under helix:defualt +## make HELIX=oled,back,na helix:defualt +## make HELIX=oled,back,ios helix:defualt +## +ifneq ($(strip $(HELIX)),) + ifeq ($(findstring oled,$(HELIX)), oled) + OLED_ENABLE = yes + endif + ifeq ($(findstring back,$(HELIX)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(HELIX)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(HELIX)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(HELIX)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(info ) +endif + +# Uncomment these for checking +# jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 +# $(eval $(call HELIX_CUSTOMISE_MSG)) +# $(info ) + +ifneq ($(strip $(HELIX_ROWS)), 4) + ifneq ($(strip $(HELIX_ROWS)), 5) + $(error HELIX_ROWS = $(strip $(HELIX_ROWS)) is unexpected value) + endif +endif +OPT_DEFS += -DHELIX_ROWS=$(strip $(HELIX_ROWS)) + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DRGBLIGHT_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +AUTO_SHIFT_ENABLE = yes + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/lets_split/keymaps/yshrsmz/config.h b/keyboards/lets_split/keymaps/yshrsmz/config.h new file mode 100644 index 0000000000..301f1ffc60 --- /dev/null +++ b/keyboards/lets_split/keymaps/yshrsmz/config.h @@ -0,0 +1,35 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* auto shift config */ +#define AUTO_SHIFT_TIMEOUT 150 + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define _MASTER_RIGHT +// #define EE_HANDS diff --git a/keyboards/lets_split/keymaps/yshrsmz/keymap.c b/keyboards/lets_split/keymaps/yshrsmz/keymap.c new file mode 100644 index 0000000000..52a0d2b834 --- /dev/null +++ b/keyboards/lets_split/keymaps/yshrsmz/keymap.c @@ -0,0 +1,180 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _FUNC 3 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + FUNC, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | GUI |Shift |Adjust| Fn | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + FUNC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RSFT, ADJUST, FUNC \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F11 | F12 | | | | LEFT | DOWN | UP |RIGHT | PGUP | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | HOME | END |Alt+← |Alt+→ | PGDN | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT_ortho_4x12( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, \ + _______, KC_F11, KC_F12, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, LALT(KC_LEFT), LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split/keymaps/yshrsmz/rules.mk b/keyboards/lets_split/keymaps/yshrsmz/rules.mk new file mode 100644 index 0000000000..c9383ab8db --- /dev/null +++ b/keyboards/lets_split/keymaps/yshrsmz/rules.mk @@ -0,0 +1 @@ +AUTO_SHIFT_ENABLE = yes diff --git a/keyboards/nyquist/keymaps/yshrsmz/config.h b/keyboards/nyquist/keymaps/yshrsmz/config.h new file mode 100644 index 0000000000..5cbe3b7010 --- /dev/null +++ b/keyboards/nyquist/keymaps/yshrsmz/config.h @@ -0,0 +1,39 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* auto shift config */ +#define AUTO_SHIFT_TIMEOUT 140 + +/* 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/nyquist/keymaps/yshrsmz/keymap.c b/keyboards/nyquist/keymaps/yshrsmz/keymap.c new file mode 100644 index 0000000000..78070279d1 --- /dev/null +++ b/keyboards/nyquist/keymaps/yshrsmz/keymap.c @@ -0,0 +1,195 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _FUNC 3 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + FUNC, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | = | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | - | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | GUI |Shift |Adjust| Fn | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + FUNC, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_RGUI, KC_RSFT, ADJUST, FUNC \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* FUNC + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ` | F1 | F2 | F3 | F4 | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F5 | F6 | F7 | F8 | | LEFT | DOWN | UP |RIGHT | PGUP | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F9 | F10 | F11 | F12 | | HOME | END |Alt+← |Alt+→ | PGDN | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNC] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_PGUP, _______, \ + _______, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_HOME, KC_END, LALT(KC_LEFT),LALT(KC_RGHT), KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case FUNC: + if (record->event.pressed) { + layer_on(_FUNC); + } else { + layer_off(_FUNC); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/nyquist/keymaps/yshrsmz/rules.mk b/keyboards/nyquist/keymaps/yshrsmz/rules.mk new file mode 100644 index 0000000000..c9383ab8db --- /dev/null +++ b/keyboards/nyquist/keymaps/yshrsmz/rules.mk @@ -0,0 +1 @@ +AUTO_SHIFT_ENABLE = yes -- cgit v1.2.3 From 0dcd60eeedbd3254d29e8bdf33719222a598f085 Mon Sep 17 00:00:00 2001 From: Brad Date: Sat, 1 Sep 2018 11:59:20 -0500 Subject: Keymap: added keys to broswen keymap (#3825) * added PGUP and PGDN to my keymap * added VOLU VOLD and MUTE to keymap --- keyboards/iris/keymaps/broswen/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/iris/keymaps/broswen/keymap.c b/keyboards/iris/keymaps/broswen/keymap.c index 7453a9eef9..6d783142e4 100644 --- a/keyboards/iris/keymaps/broswen/keymap.c +++ b/keyboards/iris/keymaps/broswen/keymap.c @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. , , , , , , , , , , , , //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , + , , , , , , ,PGDN,PGUP, , , , //|----+----+----+----+----+----| |----+----+----+----+----+----| ,TILD,PIPE,MINS,PLUS, , LEFT,DOWN, UP ,RGHT, , , //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| @@ -59,9 +59,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , + , , , , , , , , , , ,F12 , //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , + , , , , , , MUTE,VOLD,VOLU, , , , //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| , , , , , , , , , , , , , , //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' -- cgit v1.2.3 From 7e5a0def3ac5632770151f40fc52e8e0c291a78a Mon Sep 17 00:00:00 2001 From: Pranav Singh Date: Sat, 1 Sep 2018 13:02:10 -0400 Subject: Keymap: new planck keymap (#3809) * Add files via upload * new planck keymap * new planck keymap * readme file updated * deleted files from qmkfirmware folder * re-added readme file to /qmk_firmware * Fix main readme (hopefully) --- keyboards/planck/keymaps/vaire/config.h | 37 ++++++++ keyboards/planck/keymaps/vaire/keymap.c | 150 +++++++++++++++++++++++++++++++ keyboards/planck/keymaps/vaire/readme.md | 6 ++ keyboards/planck/keymaps/vaire/rules.mk | 82 +++++++++++++++++ 4 files changed, 275 insertions(+) create mode 100644 keyboards/planck/keymaps/vaire/config.h create mode 100644 keyboards/planck/keymaps/vaire/keymap.c create mode 100644 keyboards/planck/keymaps/vaire/readme.md create mode 100644 keyboards/planck/keymaps/vaire/rules.mk diff --git a/keyboards/planck/keymaps/vaire/config.h b/keyboards/planck/keymaps/vaire/config.h new file mode 100644 index 0000000000..96a13cc427 --- /dev/null +++ b/keyboards/planck/keymaps/vaire/config.h @@ -0,0 +1,37 @@ +#pragma + + + + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + + +#define MIDI_BASIC + +#define BACKLIGHT_BREATHING + + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 diff --git a/keyboards/planck/keymaps/vaire/keymap.c b/keyboards/planck/keymaps/vaire/keymap.c new file mode 100644 index 0000000000..71cbcd8bd0 --- /dev/null +++ b/keyboards/planck/keymaps/vaire/keymap.c @@ -0,0 +1,150 @@ +#include QMK_KEYBOARD_H + #include "action_layer.h" + + +extern keymap_config_t keymap_config; + +#define EXCEL_HOME LALT(KC_H) +#define EXCEL_COL LCTL(KC_SPC) +#define EXCEL_ROW LSFT(KC_SPC) +#define DESK_LEFT LCTL(LGUI(KC_LEFT)) +#define WIN_LEFT LSFT(KC_TAB) +#define WIN_CLOSE LALT(KC_F4) +#define WIN_RIGHT KC_TAB +#define DESK_RIGHT LCTL(LGUI(KC_RGHT)) +#define DOCS LGUI(KC_E) +#define SNAP_RIGHT LGUI(KC_RGHT) +#define SNAP_UP LGUI(KC_UP) +#define SNAP_LEFT LGUI(KC_LEFT) +#define SNAP_DOWN LGUI(KC_DOWN) +#define COPY LCTL(KC_C) +#define PASTE LCTL(KC_V) +#define CUT LCTL(KC_X) +#define UNDO LCTL(KC_Z) +#define FIND LCTL(KC_F) + + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + + + LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_T(KC_ENT), + MO(1), KC_LCTL, KC_LALT, KC_LGUI, MO(2), LT(5,KC_ENT), LT(4,KC_SPC), MO(3), KC_SLSH, KC_LEFT, KC_DOWN, CTL_T(KC_RGHT)), + + LAYOUT_planck_grid( + KC_ESC, KC_NLCK, LCTL(KC_SPC), KC_UP, LSFT(KC_SPC), KC_DLR, KC_EQL, KC_P7, KC_P8, KC_P9, KC_PPLS, LCTL(KC_BSPC), + KC_TAB, FIND, KC_LEFT, KC_DOWN, KC_RGHT, KC_PERC, KC_CIRC, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_BSLS, + KC_LSFT, UNDO, CUT, COPY, PASTE, EXCEL_HOME, KC_PSCR, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_LSFT, + KC_TRNS, KC_LCTL, KC_LALT, KC_LGUI, TO(1), KC_ENT, KC_SPC, KC_PENT, KC_P0, KC_PDOT, KC_PAST, KC_LCTL), + + LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LT, KC_GT, KC_LPRN, + KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE, KC_MPLY, KC_MNXT, KC_PGUP, SFT_T(KC_VOLU), + TO(0), KC_LCTL, KC_LALT, KC_LGUI, KC_TRNS, KC_ENT, KC_SPC, MO(3), KC_PSCR, KC_MPRV, KC_PGDOWN, CTL_T(KC_VOLD)), + + LAYOUT_planck_grid( + KC_TILD, DESK_LEFT, WIN_LEFT, KC_F4, WIN_RIGHT, DESK_RIGHT, DOCS, SNAP_LEFT, SNAP_UP, SNAP_RIGHT, SNAP_DOWN, KC_DEL, + KC_CAPS, KC_QUOT, KC_LBRC, KC_LCBR, KC_LPRN, KC_BSLS, KC_SLSH, KC_RPRN, KC_RCBR, KC_RBRC, KC_DQUO, KC_QUOT, + KC_PWR, KC_SLEP, KC_WAKE, KC_HOME, BL_BRTG, BL_STEP, KC_TRNS, KC_CALC, KC_LT, KC_GT, KC_COLON, KC_LSFT, + TO(0), KC_LCTL, KC_LALT, KC_LGUI, KC_LALT, KC_LCTL, KC_TRNS, KC_TRNS, AU_TOG, MU_TOG, MU_MOD, LCTL(KC_RGHT)), + + LAYOUT_planck_grid( + TO(0), KC_LSCR, WIN_LEFT, KC_MS_WH_UP, WIN_RIGHT, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, KC_TRNS, KC_TRNS, + KC_TRNS, KC_INS, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, + RESET, KC_APP, KC_MS_ACCEL0, KC_MS_ACCEL0, KC_MS_ACCEL0, KC_TRNS, KC_TRNS, TO(0), TO(1), TO(2), TO(3), TO(4), + TO(0), KC_MENU, KC_TRNS, KC_TRNS, KC_LALT, KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RCTL), + + LAYOUT_planck_grid( + KC_BSPC, KC_P, KC_O, KC_I, KC_U, KC_Y, KC_T, KC_R, KC_E, KC_W, KC_Q, KC_BSPC, + KC_TAB, KC_SCLN, KC_L, KC_K, KC_J, KC_H, KC_G, KC_F, KC_D, KC_S, KC_A, KC_QUOT, + KC_LSFT, KC_ENT, KC_DOT, KC_COMM, KC_M, KC_N, KC_B, KC_V, KC_C, KC_X, KC_Z, SFT_T(KC_ENT), + TO(0), KC_LCTL, KC_LALT, KC_LGUI, MO(2), KC_TRNS, KC_TRNS, MO(3), KC_SLSH, KC_LEFT, KC_DOWN, LCTL(KC_RGHT)), + + + +}; + + +#ifdef AUDIO_ENABLE + +void matrix_init_user(void) +{ + set_voice(default_voice); + startup_user(); + println("Matrix Init"); +} + +void led_set_user(uint8_t usb_led) +{ + static uint8_t old_usb_led = 0; + + _delay_ms(10); // gets rid of tick + + if (!is_playing_notes()) + { + if ((usb_led & (1< Date: Sun, 2 Sep 2018 08:29:13 -0700 Subject: Fix bad key label in ascii art (#3830) Just fixed a key that was wrong in the Tokyo60 ASCII art --- keyboards/tokyo60/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/tokyo60/keymaps/default/keymap.c b/keyboards/tokyo60/keymaps/default/keymap.c index 97380784ce..a3e27bdd81 100644 --- a/keyboards/tokyo60/keymaps/default/keymap.c +++ b/keyboards/tokyo60/keymaps/default/keymap.c @@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ Fn3 │ ' │█████│Enter│█████│ +│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │█████│Enter│█████│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │Shift│█████│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │█████│Shift│ Fn │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -- cgit v1.2.3 From 479bf78f3eb3b0eec31c4c14ca853d3c80d2f9c6 Mon Sep 17 00:00:00 2001 From: Damien Date: Sun, 2 Sep 2018 17:35:04 +0200 Subject: Keymap: Added personal layout for FC660C (#3834) * - Fixed DK60 version in config.h * - Updated dk60 readme with new QMK rules * - Fixed wording in readme * Added dbroqua layout for DZ60 I've also updated dz60.h to add "true HHKD" keymap definition (6U spacebar). With the default HHKB definition r_alt was not mapped and when I pressed r_menu it was r_alt. Regards * Updated dbroqua layout for HHKB keyboard Added default configuration and alternate (swap gui/alt keys). Save user choice in keyboard memory (like plank, thanks for this feature!). * Added dbroqua layout for Iris keyboard * Updated layout and fixed includes * Added personal layout for FC660C --- keyboards/fc660c/keymaps/dbroqua/keymap.c | 47 +++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 keyboards/fc660c/keymaps/dbroqua/keymap.c diff --git a/keyboards/fc660c/keymaps/dbroqua/keymap.c b/keyboards/fc660c/keymaps/dbroqua/keymap.c new file mode 100644 index 0000000000..ef6f471aa4 --- /dev/null +++ b/keyboards/fc660c/keymaps/dbroqua/keymap.c @@ -0,0 +1,47 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* BASE layer: Default Layer + * ,--------------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | Ins | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |--------------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | + * +--------------------------------------------------------------------------------------------+-----+ + * | Ctrl | Gui | Alt | Space | Alt | Gui | Fn | Left| Down|Right| + * `--------------------------------------------------------------------------------------------------´ + */ + [0] = LAYOUT( + KC_ESC, 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_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_LCTL,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_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_RCTL,MO(1), KC_LEFT,KC_DOWN,KC_RGHT + ), + /* FN layer + * ,--------------------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | | | | | | | | |PrtSc| Slck| Paus| | | | | | + * |-----------------------------------------------------------------------------------------+ +-----+ + * | | Vol-| Vol+| Mute|Eject| | | | Home| PgUp| | | | + * |--------------------------------------------------------------------------------------------+ + * | | Prev| Play| Next| | | | | End | PgDn| | | | + * +--------------------------------------------------------------------------------------------+-----+ + * | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------´ + */ + [1] = LAYOUT( + KC_GRV, 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_VOLD,KC_VOLU,KC_MUTE,KC_EJCT,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______, + _______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,_______,KC_END, KC_PGDN,_______,_______, _______, + _______,_______,_______, _______, _______,_______,MO(1), _______,_______,_______ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; -- cgit v1.2.3 From 04bea9ef742827f2784401bd976b53fc29158d3d Mon Sep 17 00:00:00 2001 From: leico Date: Mon, 3 Sep 2018 01:46:52 +0900 Subject: Keymap: share my ortho_4x12 layout symbolic (#3833) * add ortho_4x12 symbolic layout * delete trash * modify little bit * fixed doesn't requires replace `#ifndef ... #endif` to `#pragma ones` in config.h delete `QMK_KEYBOARD_CONFIG_H` in config.h delete `action_layer.h` and `eeconfig.h` in keymap.c --- layouts/community/ortho_4x12/symbolic/README.md | 70 ++++++++++ layouts/community/ortho_4x12/symbolic/config.h | 47 +++++++ layouts/community/ortho_4x12/symbolic/keymap.c | 171 ++++++++++++++++++++++++ 3 files changed, 288 insertions(+) create mode 100644 layouts/community/ortho_4x12/symbolic/README.md create mode 100644 layouts/community/ortho_4x12/symbolic/config.h create mode 100644 layouts/community/ortho_4x12/symbolic/keymap.c diff --git a/layouts/community/ortho_4x12/symbolic/README.md b/layouts/community/ortho_4x12/symbolic/README.md new file mode 100644 index 0000000000..37fbcd56a4 --- /dev/null +++ b/layouts/community/ortho_4x12/symbolic/README.md @@ -0,0 +1,70 @@ +# Symbolic ortho 4x12 layout + +## Features + +### QWERTY based + +![QWERTY layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/QWERTY.png) + +* Default keymap +* QWERTY layout +* Hold and tap + * `Shift` and `Space` + * `Left Ctrl` and `Tab` +* Symmetric Modifiers + * `Shift` + * `Raise Layer` + * `Lower Layer` + * `GUI` + * `Reset` + +### symbol charactor layer + +![Raise layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Raise.png) + +* Raise Layer +* assigned symbolic(punctuation) characters +* as could as possible, related neighbor keys + * brackets + * quotes + * operators + * slashes +* related default layer keys + * colons + * exclamation and question +* thus above features, easy learn keymapping +* transparent all modifiers + +### numbers and allows layer + +![Lower layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Lower.png) + +* Lower Layer +* entrust vim style arrows +* also numkeys +* additional, computer volume keys +* transparent all modifiers + +### Numpads and F key layer + +![Neutral layout](https://gist.githubusercontent.com/leico/cb50ecd12eb8ad906a69678f265cd52c/raw/4597497ecd00790312f1a3928b2e2c5cf17a6ac1/Neutral.png) + +* visibled when Raise and Lower layer visibled +* F keys assigned left hand side +* Numpads assigned right hand side + * for that reason, override `RGUI` key +* transparent mostly modifiers + + +### Goals + +* release a right little finger from symbols +* entrust more symbols for a left hand +* simple, minimal, easy learn +* as soon as possible, don't disable any shortcuts + + +### suggestions or find issues + +[post issues for my fork](https://github.com/leico/qmk_firmware/issues) + diff --git a/layouts/community/ortho_4x12/symbolic/config.h b/layouts/community/ortho_4x12/symbolic/config.h new file mode 100644 index 0000000000..702c9226c6 --- /dev/null +++ b/layouts/community/ortho_4x12/symbolic/config.h @@ -0,0 +1,47 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +// prevent stuck modifiers +#define PREVENT_STUCK_MODIFIERS + + +// hold & tapping delay setting +#define TAPPING_TERM 100 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +//#define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#ifdef AUDIO_ENABLE + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(COLEMAK_SOUND) \ + } +#endif + diff --git a/layouts/community/ortho_4x12/symbolic/keymap.c b/layouts/community/ortho_4x12/symbolic/keymap.c new file mode 100644 index 0000000000..d4c0892368 --- /dev/null +++ b/layouts/community/ortho_4x12/symbolic/keymap.c @@ -0,0 +1,171 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _NEUTRAL 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + L_LOWER, + R_LOWER, + L_RAISE, + R_RAISE +}; + + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------------------------------------------------------------------------------------. + * | | | | | | || | | | | | | + * | Esc | Q | W | E | R | T || Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * |LCTL_T| | | | | || | | | | | | + * | Tab | A | S | D | F | G || H | J | K | L | ; |Enter | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | | || | | | | | | + * | | Z | X | C | V | B || N | M | , | . | ! | | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | |LSFT_T||RSFT_T| | | | | | + * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * `------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_EXLM, XXXXXXX, \ + RESET, KC_LALT, KC_LGUI, L_LOWER, L_RAISE, LSFT_T( KC_SPC ), RSFT_T( KC_SPC ), R_RAISE, R_LOWER, KC_RGUI, KC_DEL, RESET \ +), + +/* Raise + * ,------------------------------------------------------------------------------------. + * | | | | | | || | | | | | | + * | Esc | | & | { | } | % || \ | [ | ] | # | | Bksp | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * |LCTL_T| | | | | || | | | | | | + * | Tab | ~ | | | ( | ) | * || / | < | > | ' | : |Enter | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | | || | | | | | | + * | | ` | ^ | @ | $ | + || - | = | _ | " | ? | | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | |LSFT_T||RSFT_T| | | | | | + * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * `------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + _______, XXXXXXX, KC_AMPR, KC_LCBR, KC_RCBR, KC_PERC, KC_BSLS, KC_LBRC, KC_RBRC, KC_HASH, XXXXXXX, _______, \ + _______, KC_TILD, KC_PIPE, KC_LPRN, KC_RPRN, KC_ASTR, KC_SLSH, KC_LABK, KC_RABK, KC_QUOT, KC_COLN, _______, \ + _______, KC_GRV, KC_CIRC, KC_AT, KC_DLR, KC_PLUS, KC_MINS, KC_EQL, KC_UNDS, KC_DQUO, KC_QUES, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), +/* Lower + * ,------------------------------------------------------------------------------------. + * | | | | | | || | | | | | | + * | Esc | 1 | 2 | 3 | 4 | 5 || 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * |LCTL_T| | | | | || | | | | | | + * | Tab | |VolDn |VolUp | Mute | || Left | Down | Up |Right | |Enter | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | | || | | | | | | + * | | | | | | || | | | | | | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | |LSFT_T||RSFT_T| | | | | | + * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| GUI | Del |Reset | + * `------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Neutral + * ,------------------------------------------------------------------------------------. + * | | | | | | || | | | | | | + * | Esc | F1 | F2 | F3 | F4 | || + | - | 1 | 2 | 3 | Bksp | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * |LCTL_T| | | | | || | | | | | | + * | Tab | F5 | F6 | F7 | F8 | || * | / | 4 | 5 | 6 |Enter | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | | || | | | | | | + * | | F9 | F10 | F11 | F12 | || . | , | 7 | 8 | 9 | | + * |------+------+------+------+------+------++------+------+------+------+------+------| + * | | | | | |LSFT_T||RSFT_T| | | | | | + * |Reset | Alt | GUI |LLower|LRaise|Space ||Space |RRaise|RLower| 0 | Del |Reset | + * `------------------------------------------------------------------------------------' + */ +[_NEUTRAL] = LAYOUT_ortho_4x12( \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PPLS, KC_PMNS, KC_P1, KC_P2, KC_P3, _______, \ + _______, KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PAST, KC_PSLS, KC_P4, KC_P5, KC_P6, _______, \ + _______, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_PDOT, KC_COMM, KC_P7, KC_P8, KC_P9, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, _______, _______ \ +) + + +}; + + +void DualKeyPressed ( bool brother_state, uint8_t target ){ + + if( brother_state ) return; + + layer_on( target ); + return; +} + +void DualKeyReleased ( bool brother_state, uint8_t target1 ){ + + if( brother_state ) return ; + + layer_off( target1 ); + return ; +} + +bool LayerSwitch ( keyrecord_t *record, bool *key_state, bool brother, uint8_t layer ){ + if ( record -> event.pressed ) { + *key_state = true; + DualKeyPressed( brother, layer ); + } + else { + *key_state = false; + DualKeyReleased( brother, layer ); + } + + update_tri_layer(_LOWER, _RAISE, _NEUTRAL ); + return false; + + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + static bool l_lower = false; + static bool r_lower = false; + + static bool l_raise = false; + static bool r_raise = false; + + switch (keycode) { + + + case L_LOWER : return LayerSwitch( record, &l_lower, r_lower, _LOWER ); break; + case R_LOWER : return LayerSwitch( record, &r_lower, l_lower, _LOWER ); break; + case L_RAISE : return LayerSwitch( record, &l_raise, r_raise, _RAISE ); break; + case R_RAISE : return LayerSwitch( record, &r_raise, l_raise, _RAISE ); break; + + } + return true; +} -- cgit v1.2.3 From fa1ee47cf2293d06693b86e8dd188d9fbc9338c4 Mon Sep 17 00:00:00 2001 From: Steven Liu Date: Tue, 4 Sep 2018 00:18:37 +0100 Subject: Enable mouse keys in register_code and unregister_code This allows for macros to be assigned to press two mouse directions at same time, which allows for one key diagonals. --- tmk_core/common/action.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f7c039f457..76c150b404 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -773,6 +773,9 @@ void register_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } + else if IS_MOUSEKEY(code) { + mousekey_on(code); + } } /** \brief Utilities for actions. (FIXME: Needs better description) @@ -832,6 +835,9 @@ void unregister_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(0); } + else if IS_MOUSEKEY(code) { + mousekey_off(code); + } } /** \brief Utilities for actions. (FIXME: Needs better description) -- cgit v1.2.3 From 35efcc9f398a1a2493b482dd1bd7c859f93ef450 Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Tue, 4 Sep 2018 08:34:16 +0900 Subject: Keyboard: Improvement of crkbd communication functions (based on helix-keyboard) (#3798) * improvement of crkbd communication functions (based on helix-keyboard) * Removed unnecessary code. * Changed read restriction from #define to #pragma once. * Changed from sizeof to defined size. * moved lib folder to crkbdroot. removed warning of ws2812.d --- keyboards/crkbd/config.h | 13 +- keyboards/crkbd/crkbd.h | 5 +- keyboards/crkbd/i2c.c | 2 +- keyboards/crkbd/i2c.h | 7 +- keyboards/crkbd/keymaps/default/keymap.c | 2 - keyboards/crkbd/keymaps/default/rules.mk | 14 +- .../crkbd/keymaps/lib/host_led_state_reader.c | 15 - keyboards/crkbd/keymaps/lib/keylogger.c | 45 -- keyboards/crkbd/keymaps/lib/layer_state_reader.c | 35 -- keyboards/crkbd/keymaps/lib/logo_reader.c | 11 - keyboards/crkbd/keymaps/lib/mode_icon_reader.c | 15 - keyboards/crkbd/keymaps/lib/rgb_state_reader.c | 15 - keyboards/crkbd/keymaps/lib/timelogger.c | 16 - keyboards/crkbd/keymaps/like_jis/keymap.c | 2 - keyboards/crkbd/keymaps/like_jis/rules.mk | 14 +- keyboards/crkbd/lib/host_led_state_reader.c | 15 + keyboards/crkbd/lib/keylogger.c | 45 ++ keyboards/crkbd/lib/layer_state_reader.c | 35 ++ keyboards/crkbd/lib/logo_reader.c | 11 + keyboards/crkbd/lib/mode_icon_reader.c | 15 + keyboards/crkbd/lib/rgb_state_reader.c | 15 + keyboards/crkbd/lib/timelogger.c | 16 + keyboards/crkbd/pro_micro.h | 6 +- keyboards/crkbd/rev1/config.h | 8 +- keyboards/crkbd/rev1/matrix.c | 59 +-- keyboards/crkbd/rev1/rev1.h | 5 +- keyboards/crkbd/rev1/rules.mk | 5 +- keyboards/crkbd/rev1/serial_config.h | 10 + keyboards/crkbd/rev1/serial_config_simpleapi.h | 5 + keyboards/crkbd/rev1/split_scomm.c | 73 ++++ keyboards/crkbd/rev1/split_scomm.h | 21 + keyboards/crkbd/rev1/split_util.c | 70 ++++ keyboards/crkbd/rev1/split_util.h | 16 + keyboards/crkbd/rules.mk | 10 +- keyboards/crkbd/serial.c | 452 +++++++++++++++------ keyboards/crkbd/serial.h | 83 +++- keyboards/crkbd/split_util.c | 71 ---- keyboards/crkbd/split_util.h | 19 - keyboards/crkbd/ssd1306.c | 1 + keyboards/crkbd/ssd1306.h | 8 +- 40 files changed, 816 insertions(+), 469 deletions(-) delete mode 100644 keyboards/crkbd/keymaps/lib/host_led_state_reader.c delete mode 100644 keyboards/crkbd/keymaps/lib/keylogger.c delete mode 100644 keyboards/crkbd/keymaps/lib/layer_state_reader.c delete mode 100644 keyboards/crkbd/keymaps/lib/logo_reader.c delete mode 100644 keyboards/crkbd/keymaps/lib/mode_icon_reader.c delete mode 100644 keyboards/crkbd/keymaps/lib/rgb_state_reader.c delete mode 100644 keyboards/crkbd/keymaps/lib/timelogger.c create mode 100644 keyboards/crkbd/lib/host_led_state_reader.c create mode 100644 keyboards/crkbd/lib/keylogger.c create mode 100644 keyboards/crkbd/lib/layer_state_reader.c create mode 100644 keyboards/crkbd/lib/logo_reader.c create mode 100644 keyboards/crkbd/lib/mode_icon_reader.c create mode 100644 keyboards/crkbd/lib/rgb_state_reader.c create mode 100644 keyboards/crkbd/lib/timelogger.c create mode 100644 keyboards/crkbd/rev1/serial_config.h create mode 100644 keyboards/crkbd/rev1/serial_config_simpleapi.h create mode 100644 keyboards/crkbd/rev1/split_scomm.c create mode 100644 keyboards/crkbd/rev1/split_scomm.h create mode 100644 keyboards/crkbd/rev1/split_util.c create mode 100644 keyboards/crkbd/rev1/split_util.h delete mode 100644 keyboards/crkbd/split_util.c delete mode 100644 keyboards/crkbd/split_util.h diff --git a/keyboards/crkbd/config.h b/keyboards/crkbd/config.h index c910d8f24f..64fee75457 100644 --- a/keyboards/crkbd/config.h +++ b/keyboards/crkbd/config.h @@ -16,9 +16,16 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" +#include -#endif +#ifdef USE_Link_Time_Optimization + // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), + // so just disable them + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION + + #define DISABLE_LEADER +#endif // USE_Link_Time_Optimization diff --git a/keyboards/crkbd/crkbd.h b/keyboards/crkbd/crkbd.h index 889bcb9ae3..73f2a3f074 100644 --- a/keyboards/crkbd/crkbd.h +++ b/keyboards/crkbd/crkbd.h @@ -1,8 +1,5 @@ -#ifndef CRKBD_H -#define CRKBD_H +#pragma once #ifdef KEYBOARD_crkbd_rev1 #include "rev1.h" #endif - -#endif diff --git a/keyboards/crkbd/i2c.c b/keyboards/crkbd/i2c.c index 084c890c40..4bee5c6398 100644 --- a/keyboards/crkbd/i2c.c +++ b/keyboards/crkbd/i2c.c @@ -34,7 +34,7 @@ void i2c_delay(void) { // _delay_us(100); } -// Setup twi to run at 100kHz +// Setup twi to run at 100kHz or 400kHz (see ./i2c.h SCL_CLOCK) void i2c_master_init(void) { // no prescaler TWSR = 0; diff --git a/keyboards/crkbd/i2c.h b/keyboards/crkbd/i2c.h index c15b6bc506..710662c7ab 100644 --- a/keyboards/crkbd/i2c.h +++ b/keyboards/crkbd/i2c.h @@ -1,5 +1,4 @@ -#ifndef I2C_H -#define I2C_H +#pragma once #include @@ -15,7 +14,7 @@ #define SLAVE_BUFFER_SIZE 0x10 -// i2c SCL clock frequency +// i2c SCL clock frequency 400kHz #define SCL_CLOCK 400000L extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; @@ -45,5 +44,3 @@ extern unsigned char i2c_readNak(void); extern unsigned char i2c_read(unsigned char ack); #define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c index 87661d3451..e92fbdebfa 100644 --- a/keyboards/crkbd/keymaps/default/keymap.c +++ b/keyboards/crkbd/keymaps/default/keymap.c @@ -5,7 +5,6 @@ #include "split_util.h" #endif #ifdef SSD1306OLED - #include "LUFA/Drivers/Peripheral/TWI.h" #include "ssd1306.h" #endif @@ -130,7 +129,6 @@ void matrix_init_user(void) { #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); iota_gfx_init(!has_usb()); // turns on the display #endif } diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk index 6570e2f5cb..0edf1181f0 100644 --- a/keyboards/crkbd/keymaps/default/rules.mk +++ b/keyboards/crkbd/keymaps/default/rules.mk @@ -21,10 +21,10 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # If you want to change the display of OLED, you need to change here -SRC += ../lib/rgb_state_reader.c \ - ../lib/layer_state_reader.c \ - ../lib/logo_reader.c \ - ../lib/keylogger.c \ - # ../lib/mode_icon_reader.c \ - # ../lib/host_led_state_reader.c \ - # ../lib/timelogger.c \ +SRC += ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/keymaps/lib/host_led_state_reader.c b/keyboards/crkbd/keymaps/lib/host_led_state_reader.c deleted file mode 100644 index 41ac55dc2b..0000000000 --- a/keyboards/crkbd/keymaps/lib/host_led_state_reader.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "crkbd.h" - -char host_led_state_str[24]; - -const char *read_host_led_state(void) -{ - uint8_t leds = host_keyboard_leds(); - snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", - (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", - (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", - (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); - - return host_led_state_str; -} diff --git a/keyboards/crkbd/keymaps/lib/keylogger.c b/keyboards/crkbd/keymaps/lib/keylogger.c deleted file mode 100644 index 8f2a8ce3cc..0000000000 --- a/keyboards/crkbd/keymaps/lib/keylogger.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include "crkbd.h" - -char keylog_str[24] = {}; -char keylogs_str[21] = {}; -int keylogs_str_idx = 0; - -const char code_to_name[60] = { - ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', - 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', - 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', - '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', - 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', - ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; - -void set_keylog(uint16_t keycode, keyrecord_t *record) { - char name = ' '; - if (keycode < 60) { - name = code_to_name[keycode]; - } - - // update keylog - snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", - record->event.key.row, record->event.key.col, - keycode, name); - - // update keylogs - if (keylogs_str_idx == sizeof(keylogs_str) - 1) { - keylogs_str_idx = 0; - for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { - keylogs_str[i] = ' '; - } - } - - keylogs_str[keylogs_str_idx] = name; - keylogs_str_idx++; -} - -const char *read_keylog(void) { - return keylog_str; -} - -const char *read_keylogs(void) { - return keylogs_str; -} diff --git a/keyboards/crkbd/keymaps/lib/layer_state_reader.c b/keyboards/crkbd/keymaps/lib/layer_state_reader.c deleted file mode 100644 index eddb71337e..0000000000 --- a/keyboards/crkbd/keymaps/lib/layer_state_reader.c +++ /dev/null @@ -1,35 +0,0 @@ - -#include QMK_KEYBOARD_H -#include -#include "crkbd.h" - -#define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_ADJUST 65536 -#define L_ADJUST_TRI 65560 - -char layer_state_str[24]; - -const char *read_layer_state(void) { - switch (layer_state) - { - case L_BASE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); - break; - case L_RAISE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); - break; - case L_LOWER: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); - break; - case L_ADJUST: - case L_ADJUST_TRI: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); - break; - default: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); - } - - return layer_state_str; -} diff --git a/keyboards/crkbd/keymaps/lib/logo_reader.c b/keyboards/crkbd/keymaps/lib/logo_reader.c deleted file mode 100644 index 1bc1503a60..0000000000 --- a/keyboards/crkbd/keymaps/lib/logo_reader.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "crkbd.h" - -const char *read_logo(void) { - static char logo[] = { - 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, - 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, - 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, - 0}; - - return logo; -} diff --git a/keyboards/crkbd/keymaps/lib/mode_icon_reader.c b/keyboards/crkbd/keymaps/lib/mode_icon_reader.c deleted file mode 100644 index 04c226506a..0000000000 --- a/keyboards/crkbd/keymaps/lib/mode_icon_reader.c +++ /dev/null @@ -1,15 +0,0 @@ -#include -#include "crkbd.h" - -char mode_icon[24]; - -const char *read_mode_icon(bool swap) { - static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; - if (swap == false) { - snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); - } else { - snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); - } - - return mode_icon; -} diff --git a/keyboards/crkbd/keymaps/lib/rgb_state_reader.c b/keyboards/crkbd/keymaps/lib/rgb_state_reader.c deleted file mode 100644 index e0efe2e528..0000000000 --- a/keyboards/crkbd/keymaps/lib/rgb_state_reader.c +++ /dev/null @@ -1,15 +0,0 @@ -#ifdef RGBLIGHT_ENABLE - -#include QMK_KEYBOARD_H -#include - -extern rgblight_config_t rgblight_config; -char rbf_info_str[24]; -const char *read_rgb_info(void) { - - snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", - rgblight_config.enable ? "on" : "- ", rgblight_config.mode, - rgblight_config.hue, rgblight_config.sat, rgblight_config.val); - return rbf_info_str; -} -#endif diff --git a/keyboards/crkbd/keymaps/lib/timelogger.c b/keyboards/crkbd/keymaps/lib/timelogger.c deleted file mode 100644 index 69828a3a08..0000000000 --- a/keyboards/crkbd/keymaps/lib/timelogger.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include "crkbd.h" - -char timelog_str[24] = {}; -int last_time = 0; -int elapsed_time = 0; - -void set_timelog(void) { - elapsed_time = timer_elapsed(last_time); - last_time = timer_read(); - snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); -} - -const char *read_timelog(void) { - return timelog_str; -} diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 31b5230b10..90e5b7ec17 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -5,7 +5,6 @@ #include "split_util.h" #endif #ifdef SSD1306OLED - #include "LUFA/Drivers/Peripheral/TWI.h" #include "ssd1306.h" #endif @@ -124,7 +123,6 @@ void matrix_init_user(void) { #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); iota_gfx_init(!has_usb()); // turns on the display #endif } diff --git a/keyboards/crkbd/keymaps/like_jis/rules.mk b/keyboards/crkbd/keymaps/like_jis/rules.mk index 6570e2f5cb..0edf1181f0 100644 --- a/keyboards/crkbd/keymaps/like_jis/rules.mk +++ b/keyboards/crkbd/keymaps/like_jis/rules.mk @@ -21,10 +21,10 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # If you want to change the display of OLED, you need to change here -SRC += ../lib/rgb_state_reader.c \ - ../lib/layer_state_reader.c \ - ../lib/logo_reader.c \ - ../lib/keylogger.c \ - # ../lib/mode_icon_reader.c \ - # ../lib/host_led_state_reader.c \ - # ../lib/timelogger.c \ +SRC += ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/keyboards/crkbd/lib/host_led_state_reader.c b/keyboards/crkbd/lib/host_led_state_reader.c new file mode 100644 index 0000000000..41ac55dc2b --- /dev/null +++ b/keyboards/crkbd/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "crkbd.h" + +char host_led_state_str[24]; + +const char *read_host_led_state(void) +{ + uint8_t leds = host_keyboard_leds(); + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- "); + + return host_led_state_str; +} diff --git a/keyboards/crkbd/lib/keylogger.c b/keyboards/crkbd/lib/keylogger.c new file mode 100644 index 0000000000..8f2a8ce3cc --- /dev/null +++ b/keyboards/crkbd/lib/keylogger.c @@ -0,0 +1,45 @@ +#include +#include "crkbd.h" + +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', ' ', ' ', ' ', ' ', ' ', + ' ', ';', '\'', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} diff --git a/keyboards/crkbd/lib/layer_state_reader.c b/keyboards/crkbd/lib/layer_state_reader.c new file mode 100644 index 0000000000..eddb71337e --- /dev/null +++ b/keyboards/crkbd/lib/layer_state_reader.c @@ -0,0 +1,35 @@ + +#include QMK_KEYBOARD_H +#include +#include "crkbd.h" + +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_ADJUST 65536 +#define L_ADJUST_TRI 65560 + +char layer_state_str[24]; + +const char *read_layer_state(void) { + switch (layer_state) + { + case L_BASE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Default"); + break; + case L_RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case L_LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case L_ADJUST: + case L_ADJUST_TRI: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} diff --git a/keyboards/crkbd/lib/logo_reader.c b/keyboards/crkbd/lib/logo_reader.c new file mode 100644 index 0000000000..1bc1503a60 --- /dev/null +++ b/keyboards/crkbd/lib/logo_reader.c @@ -0,0 +1,11 @@ +#include "crkbd.h" + +const char *read_logo(void) { + static char logo[] = { + 0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f, 0x90, 0x91, 0x92, 0x93, 0x94, + 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, + 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, + 0}; + + return logo; +} diff --git a/keyboards/crkbd/lib/mode_icon_reader.c b/keyboards/crkbd/lib/mode_icon_reader.c new file mode 100644 index 0000000000..04c226506a --- /dev/null +++ b/keyboards/crkbd/lib/mode_icon_reader.c @@ -0,0 +1,15 @@ +#include +#include "crkbd.h" + +char mode_icon[24]; + +const char *read_mode_icon(bool swap) { + static char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + if (swap == false) { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[0][0], logo[0][1]); + } else { + snprintf(mode_icon, sizeof(mode_icon), "%s\n%s", logo[1][0], logo[1][1]); + } + + return mode_icon; +} diff --git a/keyboards/crkbd/lib/rgb_state_reader.c b/keyboards/crkbd/lib/rgb_state_reader.c new file mode 100644 index 0000000000..e0efe2e528 --- /dev/null +++ b/keyboards/crkbd/lib/rgb_state_reader.c @@ -0,0 +1,15 @@ +#ifdef RGBLIGHT_ENABLE + +#include QMK_KEYBOARD_H +#include + +extern rgblight_config_t rgblight_config; +char rbf_info_str[24]; +const char *read_rgb_info(void) { + + snprintf(rbf_info_str, sizeof(rbf_info_str), "%s %2d h%3d s%3d v%3d", + rgblight_config.enable ? "on" : "- ", rgblight_config.mode, + rgblight_config.hue, rgblight_config.sat, rgblight_config.val); + return rbf_info_str; +} +#endif diff --git a/keyboards/crkbd/lib/timelogger.c b/keyboards/crkbd/lib/timelogger.c new file mode 100644 index 0000000000..69828a3a08 --- /dev/null +++ b/keyboards/crkbd/lib/timelogger.c @@ -0,0 +1,16 @@ +#include +#include "crkbd.h" + +char timelog_str[24] = {}; +int last_time = 0; +int elapsed_time = 0; + +void set_timelog(void) { + elapsed_time = timer_elapsed(last_time); + last_time = timer_read(); + snprintf(timelog_str, sizeof(timelog_str), "lt:%5d, et:%5d", last_time, elapsed_time); +} + +const char *read_timelog(void) { + return timelog_str; +} diff --git a/keyboards/crkbd/pro_micro.h b/keyboards/crkbd/pro_micro.h index f9e7ed75d9..3666333727 100644 --- a/keyboards/crkbd/pro_micro.h +++ b/keyboards/crkbd/pro_micro.h @@ -21,9 +21,7 @@ $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ */ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h +#pragma once #include @@ -358,5 +356,3 @@ const uint8_t PROGMEM analog_pin_to_channel_PGM[] = { #define SERIAL_PORT_USBVIRTUAL Serial #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1 - -#endif /* Pins_Arduino_h */ diff --git a/keyboards/crkbd/rev1/config.h b/keyboards/crkbd/rev1/config.h index 6321136a73..efce13a490 100644 --- a/keyboards/crkbd/rev1/config.h +++ b/keyboards/crkbd/rev1/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "../config.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -82,6 +79,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/crkbd/rev1/matrix.c b/keyboards/crkbd/rev1/matrix.c index 117ff8d37f..718cc57448 100644 --- a/keyboards/crkbd/rev1/matrix.c +++ b/keyboards/crkbd/rev1/matrix.c @@ -20,6 +20,7 @@ along with this program. If not, see . */ #include #include +#include #include #include #include @@ -30,12 +31,11 @@ along with this program. If not, see . #include "matrix.h" #include "split_util.h" #include "pro_micro.h" -#include "config.h" #ifdef USE_MATRIX_I2C # include "i2c.h" #else // USE_SERIAL -# include "serial.h" +# include "split_scomm.h" #endif #ifndef DEBOUNCE @@ -103,6 +103,8 @@ void matrix_init(void) init_cols(); TX_RX_LED_INIT; + TXLED0; + RXLED0; // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { @@ -179,17 +181,20 @@ i2c_error: // the cable is disconnceted, or something else went wrong #else // USE_SERIAL -int serial_transaction(void) { +int serial_transaction(int master_changed) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else int ret=serial_update_buffers(); +#endif if (ret ) { - if(ret==2)RXLED1; + if(ret==2) RXLED1; return 1; } -RXLED0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, SERIAL_SLAVE_BUFFER_LENGTH); return 0; } #endif @@ -200,19 +205,9 @@ uint8_t matrix_scan(void) matrix_master_scan(); }else{ matrix_slave_scan(); - -// if(serial_slave_DATA_CORRUPT()){ -// TXLED0; - int offset = (isLeftHand) ? ROWS_PER_HAND : 0; - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[offset+i] = serial_master_buffer[i]; - } - -// }else{ -// TXLED1; -// } - + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, SERIAL_MASTER_BUFFER_LENGTH); matrix_scan_quantum(); } return 1; @@ -222,6 +217,7 @@ uint8_t matrix_scan(void) uint8_t matrix_master_scan(void) { int ret = _matrix_scan(); + int mchanged = 1; int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; @@ -231,15 +227,18 @@ uint8_t matrix_master_scan(void) { // i2c_slave_buffer[i] = matrix[offset+i]; // } #else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_master_buffer[i] = matrix[offset+i]; - } + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], SERIAL_MASTER_BUFFER_LENGTH); #endif #ifdef USE_MATRIX_I2C if( i2c_transaction() ) { #else // USE_SERIAL - if( serial_transaction() ) { + if( serial_transaction(mchanged) ) { #endif // turn on the indicator led when halves are disconnected TXLED1; @@ -273,9 +272,19 @@ void matrix_slave_scan(void) { i2c_slave_buffer[i] = matrix[offset+i]; } #else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif serial_slave_buffer[i] = matrix[offset+i]; } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif #endif } diff --git a/keyboards/crkbd/rev1/rev1.h b/keyboards/crkbd/rev1/rev1.h index d02c51f30e..cdd61d2bf9 100644 --- a/keyboards/crkbd/rev1/rev1.h +++ b/keyboards/crkbd/rev1/rev1.h @@ -1,5 +1,4 @@ -#ifndef REV1_H -#define REV1_CONFIG_H +#pragma once #include "../crkbd.h" @@ -49,5 +48,3 @@ KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ KC_##L30, KC_##L31, KC_##L32, KC_##R30, KC_##R31, KC_##R32 \ ) - -#endif diff --git a/keyboards/crkbd/rev1/rules.mk b/keyboards/crkbd/rev1/rules.mk index 7af7ffdb8a..6028b5a5b9 100644 --- a/keyboards/crkbd/rev1/rules.mk +++ b/keyboards/crkbd/rev1/rules.mk @@ -1,2 +1,3 @@ -SRC += rev1/matrix.c \ - ws2812.c +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c diff --git a/keyboards/crkbd/rev1/serial_config.h b/keyboards/crkbd/rev1/serial_config.h new file mode 100644 index 0000000000..671ed821d2 --- /dev/null +++ b/keyboards/crkbd/rev1/serial_config.h @@ -0,0 +1,10 @@ +#pragma once + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_USE_MULTI_TRANSACTION diff --git a/keyboards/crkbd/rev1/serial_config_simpleapi.h b/keyboards/crkbd/rev1/serial_config_simpleapi.h new file mode 100644 index 0000000000..0e1dd9e4ac --- /dev/null +++ b/keyboards/crkbd/rev1/serial_config_simpleapi.h @@ -0,0 +1,5 @@ +#pragma once + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 diff --git a/keyboards/crkbd/rev1/split_scomm.c b/keyboards/crkbd/rev1/split_scomm.c new file mode 100644 index 0000000000..9719eb22ea --- /dev/null +++ b/keyboards/crkbd/rev1/split_scomm.c @@ -0,0 +1,73 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef SERIAL_DEBUG_MODE +#include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status; + static int need_retry = 0; + if( s_change_old != slave_buffer_change_count ) { + status = soft_serial_transaction(GET_SLAVE_BUFFER); + if( status == TRANSACTION_END ) + s_change_old = slave_buffer_change_count; + } + if( !master_update && !need_retry) + status = soft_serial_transaction(GET_SLAVE_STATUS); + else + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + need_retry = ( status == TRANSACTION_END ) ? 0 : 1; + return status; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/crkbd/rev1/split_scomm.h b/keyboards/crkbd/rev1/split_scomm.h new file mode 100644 index 0000000000..16887eb74f --- /dev/null +++ b/keyboards/crkbd/rev1/split_scomm.h @@ -0,0 +1,21 @@ +#pragma once + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif diff --git a/keyboards/crkbd/rev1/split_util.c b/keyboards/crkbd/rev1/split_util.c new file mode 100644 index 0000000000..e1ff8b4379 --- /dev/null +++ b/keyboards/crkbd/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); diff --git a/keyboards/crkbd/rules.mk b/keyboards/crkbd/rules.mk index d88daebf3a..6396b115de 100644 --- a/keyboards/crkbd/rules.mk +++ b/keyboards/crkbd/rules.mk @@ -1,7 +1,9 @@ -SRC += i2c.c \ - serial.c \ - split_util.c \ - ssd1306.c +SRC += i2c.c +SRC += serial.c +SRC += ssd1306.c + +# if firmware size over limit, try this option +# CFLAGS += -flto # MCU name #MCU = at90usb1287 diff --git a/keyboards/crkbd/serial.c b/keyboards/crkbd/serial.c index e918ab6ee6..11ceff0b37 100644 --- a/keyboards/crkbd/serial.c +++ b/keyboards/crkbd/serial.c @@ -9,36 +9,128 @@ #include #include #include +#include #include #include "serial.h" +//#include #ifdef USE_SERIAL -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions); } -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +void serial_slave_init(void) +{ soft_serial_target_init(transactions); } -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ return soft_serial_transaction(); } + +#endif // Simple API (OLD API, compatible with let's split serial.c) + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define TID_SEND_ADJUST 14 + +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#else +#error Illegal Serial Speed +#endif + + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } -void serial_delay_short(void) { - _delay_us(SERIAL_DELAY-1); + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); } + +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static -void serial_input(void) { +void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } @@ -48,191 +140,305 @@ uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void serial_master_init(void) { - serial_output(); - serial_high(); +void soft_serial_initiator_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_output(); + serial_high(); } -void serial_slave_init(void) { - serial_input(); - -#ifndef USE_SERIAL_PD2 - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +void soft_serial_target_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_input_with_pullup(); + +#if SERIAL_PIN_MASK == _BV(PD0) + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#elif SERIAL_PIN_MASK == _BV(PD2) + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); #else - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + #error unknown SERIAL_PIN_MASK value #endif } -// Used by the master to synchronize timing with the slave. +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; static void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. while (!serial_read_pin()); - //serial_delay(); - _delay_us(SERIAL_DELAY-5); } -// Used by the slave to send a synchronization signal to the master. +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void)NO_INLINE; static void sync_send(void) { - serial_output(); - serial_low(); serial_delay(); - serial_high(); } // Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; return byte; } // Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } serial_delay(); - } -} -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); + serial_low(); // sync_send() / senc_recv() need raise edge +} - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; sync_send(); - checksum += serial_slave_buffer[i]; + serial_write_chunk(data,8); } - serial_write_byte(checksum); - sync_send(); +} - // wait for the sync to finish sending - serial_delay(); +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} - serial_input(); // end transaction +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid; + uint8_t pecount = 0; + sync_recv(); + tid = serial_read_chunk(&pecount,4); + if(pecount> 0) + return; + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } } else { - status &= ~SLAVE_DATA_CORRUPT; + *trans->status = TRANSACTION_ACCEPTED; } -} -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; + sync_recv(); //weit initiator output to high } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) // // Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif cli(); - // signal to the slave that we want to start a transaction + // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(1); + _delay_us(SLAVE_INT_WIDTH_US); - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); - // check if the slave is present + // check if the target is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return 1; + return TRANSACTION_NO_RESPONSE; } - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; +#else + // send transaction table index + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(sstd_index, 4); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - if (checksum_computed != checksum_received) { - sei(); - return 2; + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } +#endif - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); } - serial_write_byte(checksum); - sync_recv(); // always, release the line when not in use - serial_output(); - serial_high(); + sync_send(); + *trans->status = TRANSACTION_END; sei(); - return 0; + return TRANSACTION_END; } +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + #endif diff --git a/keyboards/crkbd/serial.h b/keyboards/crkbd/serial.h index 43e51f7fa4..76c6aaa043 100644 --- a/keyboards/crkbd/serial.h +++ b/keyboards/crkbd/serial.h @@ -1,32 +1,77 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H +#pragma once -#include "config.h" #include -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// -#ifndef USE_SERIAL_PD2 -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect -#else -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect -#endif - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 -// Buffers for master - slave communication +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif void serial_master_init(void); void serial_slave_init(void); int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x4 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); #endif diff --git a/keyboards/crkbd/split_util.c b/keyboards/crkbd/split_util.c deleted file mode 100644 index 8bc064174e..0000000000 --- a/keyboards/crkbd/split_util.c +++ /dev/null @@ -1,71 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" - -#ifdef USE_MATRIX_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_master_init(); -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - -#ifdef USE_MATRIX_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); - -void matrix_master_OLED_init (void); - -#endif diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index d079001199..b8f9512e3f 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -123,6 +123,7 @@ static int8_t capture_sendchar(uint8_t c) { bool iota_gfx_init(bool rotate) { bool success = false; + i2c_master_init(); send_cmd1(DisplayOff); send_cmd2(SetDisplayClockDiv, 0x80); send_cmd2(SetMultiPlex, DisplayHeight - 1); diff --git a/keyboards/crkbd/ssd1306.h b/keyboards/crkbd/ssd1306.h index 59d31c9f32..76dd6a2a72 100644 --- a/keyboards/crkbd/ssd1306.h +++ b/keyboards/crkbd/ssd1306.h @@ -1,10 +1,8 @@ -#ifndef SSD1306_H -#define SSD1306_H +#pragma once #include #include #include "pincontrol.h" -#include "config.h" enum ssd1306_cmds { DisplayOff = 0xAE, @@ -88,7 +86,3 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); - - - -#endif -- cgit v1.2.3 From dd29b642564896f3753721db364b6413e501e6c1 Mon Sep 17 00:00:00 2001 From: Christon DeWan Date: Mon, 3 Sep 2018 16:35:27 -0700 Subject: Keyboard: Add support for Diverge TM2 (#3829) * pulling in diverge tm2 from staging branch * cleaned up comments, docs, licenses * refactored apparent grid to make 2u spacebars more obvious * various delinting from noroadsleft review * most of drashna's feedback responded to - lots of lint swept - used more modern tri-layer functions - still need to adopt modern split support. * switch to common split code. remove comment cruft * tapping force hold makes LT way more usable for rapid , sequences --- keyboards/divergetm2/config.h | 79 +++++++++ keyboards/divergetm2/divergetm2.c | 17 ++ keyboards/divergetm2/divergetm2.h | 74 ++++++++ keyboards/divergetm2/keymaps/default/config.h | 23 +++ keyboards/divergetm2/keymaps/default/keymap.c | 200 ++++++++++++++++++++++ keyboards/divergetm2/keymaps/default/readme.md | 5 + keyboards/divergetm2/keymaps/default/rules.mk | 0 keyboards/divergetm2/keymaps/xtonhasvim/config.h | 23 +++ keyboards/divergetm2/keymaps/xtonhasvim/keymap.c | 155 +++++++++++++++++ keyboards/divergetm2/keymaps/xtonhasvim/readme.md | 9 + keyboards/divergetm2/keymaps/xtonhasvim/rules.mk | 3 + keyboards/divergetm2/readme.md | 21 +++ keyboards/divergetm2/rules.mk | 75 ++++++++ 13 files changed, 684 insertions(+) create mode 100644 keyboards/divergetm2/config.h create mode 100644 keyboards/divergetm2/divergetm2.c create mode 100644 keyboards/divergetm2/divergetm2.h create mode 100644 keyboards/divergetm2/keymaps/default/config.h create mode 100644 keyboards/divergetm2/keymaps/default/keymap.c create mode 100644 keyboards/divergetm2/keymaps/default/readme.md create mode 100644 keyboards/divergetm2/keymaps/default/rules.mk create mode 100644 keyboards/divergetm2/keymaps/xtonhasvim/config.h create mode 100644 keyboards/divergetm2/keymaps/xtonhasvim/keymap.c create mode 100644 keyboards/divergetm2/keymaps/xtonhasvim/readme.md create mode 100644 keyboards/divergetm2/keymaps/xtonhasvim/rules.mk create mode 100644 keyboards/divergetm2/readme.md create mode 100644 keyboards/divergetm2/rules.mk diff --git a/keyboards/divergetm2/config.h b/keyboards/divergetm2/config.h new file mode 100644 index 0000000000..8bc9d2c803 --- /dev/null +++ b/keyboards/divergetm2/config.h @@ -0,0 +1,79 @@ +/* Copyright 2018 Christon DeWan (xton) + * Copyright 2017 IslandMan93 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0001 +#define MANUFACTURER UniKeyboard +#define PRODUCT diverge tm2 +#define DESCRIPTION Split 46 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + diff --git a/keyboards/divergetm2/divergetm2.c b/keyboards/divergetm2/divergetm2.c new file mode 100644 index 0000000000..61ea45416c --- /dev/null +++ b/keyboards/divergetm2/divergetm2.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Christon DeWan (xton) + * Copyright 2017 IslandMan93 + * + * 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 . + */ +#include "divergetm2.h" diff --git a/keyboards/divergetm2/divergetm2.h b/keyboards/divergetm2/divergetm2.h new file mode 100644 index 0000000000..50144b1d2b --- /dev/null +++ b/keyboards/divergetm2/divergetm2.h @@ -0,0 +1,74 @@ +/* Copyright 2018 Christon DeWan (xton) + * Copyright 2017 IslandMan93 + * + * 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 + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, KC_NO }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, KC_NO } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, KC_NO }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { KC_NO, R31, R32, R33, R34, R35 } \ + } +#endif + +#define LAYOUT_ortho_4x12_2x2u LAYOUT diff --git a/keyboards/divergetm2/keymaps/default/config.h b/keyboards/divergetm2/keymaps/default/config.h new file mode 100644 index 0000000000..ccd00621fd --- /dev/null +++ b/keyboards/divergetm2/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 Christon DeWan (xton) + * Copyright 2017 IslandMan93 + * + * 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 + +// place overrides here +#define MASTER_RIGHT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 diff --git a/keyboards/divergetm2/keymaps/default/keymap.c b/keyboards/divergetm2/keymaps/default/keymap.c new file mode 100644 index 0000000000..068705970c --- /dev/null +++ b/keyboards/divergetm2/keymaps/default/keymap.c @@ -0,0 +1,200 @@ +/* Copyright 2018 Christon DeWan (xton) + * Copyright 2017 IslandMan93 + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + RESET, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12_2x2u( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | GUI | Lower | Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12_2x2u( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + KC_NO, KC_LCTL, KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE,KC_SPC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12_2x2u( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + BL_STEP, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, MO(_RAISE), KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12_2x2u( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, MO(_LOWER), _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +#ifdef AUDIO_ENABLE +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + +#define SPACE_WAIT 100 +uint16_t rl_start_time = 0; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(rl_start_time && record->event.pressed) rl_start_time = 0; + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + set_single_persistent_default_layer(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + set_single_persistent_default_layer(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + set_single_persistent_default_layer(1UL<<_DVORAK); + } + return false; + break; + } + return true; +} + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} diff --git a/keyboards/divergetm2/keymaps/default/readme.md b/keyboards/divergetm2/keymaps/default/readme.md new file mode 100644 index 0000000000..dceb4f8a95 --- /dev/null +++ b/keyboards/divergetm2/keymaps/default/readme.md @@ -0,0 +1,5 @@ +# A default-ish keymap for diverge tm2 + +Actually it's a Planck layout, but I needed something for the default. :-D + +The 2u spacebars are space when tapped, raise/lower when held. diff --git a/keyboards/divergetm2/keymaps/default/rules.mk b/keyboards/divergetm2/keymaps/default/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/config.h b/keyboards/divergetm2/keymaps/xtonhasvim/config.h new file mode 100644 index 0000000000..4ba4a57165 --- /dev/null +++ b/keyboards/divergetm2/keymaps/xtonhasvim/config.h @@ -0,0 +1,23 @@ +#pragma once + +// help for fast typist+dual function keys? +#define PERMISSIVE_HOLD +// Let me type `ls -l` more quickly. +#define TAPPING_FORCE_HOLD + +// where is the cord plugged in? +#define MASTER_RIGHT + +/* speed up mousekeys a bit */ +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 8 +#define MOUSEKEY_TIME_TO_MAX 30 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 + +// because I'm lazy and didn't case out the rgb support +#define RGBLED_NUM 2 + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 3 diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c b/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c new file mode 100644 index 0000000000..9d5135baa3 --- /dev/null +++ b/keyboards/divergetm2/keymaps/xtonhasvim/keymap.c @@ -0,0 +1,155 @@ + /* Copyright 2018 Christon DeWan + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "xtonhasvim.h" + +/************************************ + * states + ************************************/ + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _MOVE, + _MOUSE, + _CMD +}; + +extern uint8_t vim_cmd_layer(void) { return _CMD; } + +enum keymap_keycodes { + RAISE = VIM_SAFE_RANGE, + LOWER +}; + +/************************************ + * keymaps! + ************************************/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl*| A | S | D | F | G | H | J | K | L | ;* | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | chkwm| | Alt | GUI | Lower* | Raise* | SPC | GUI | | Vim | + * `-----------------------------------------------------------------------------------' + * + * - Ctrl acts as Esc when tapped. + * - Holding ; switches to movement layer. + * - Tapping raise or lower produces space. + */ +[_QWERTY] = LAYOUT_ortho_4x12_2x2u( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , \ + LSFT(KC_LALT), MO(_MOVE), KC_LALT, KC_LGUI, LT(_LOWER, KC_SPC), LT(_RAISE, KC_SPC), KC_RGUI, KC_RALT, MO(_MOVE), VIM_START \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Bail | | | | Raise | | | Bail | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12_2x2u( \ + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, \ + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \ + RESET, TO(_QWERTY), _______, _______, _______, MO(_RAISE), _______, _______, TO(_QWERTY), X_____X \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Bail | | | Lower | | | | Bail | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12_2x2u( \ + KC_GRV, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \ + X_____X, TO(_QWERTY), _______, _______, MO(_LOWER), _______, _______, _______, TO(_QWERTY), RESET \ +), + + +/* Adjust (Lower + Raise) + * ,-------------------------------------------------------------------------------------. + * |BL Raise| | | | | | | | | | | | + * |--------+------+------+------+------+-------------+------+------+------+------+------| + * |BL Lower| | | | | | | | | | | | + * |--------+------+------+------+------+------|------+------+------+------+------+------| + * |BL STEP | | | | | | | Next | Vol- | Vol+ | Play | | + * |--------+------+------+------+------+------+------+------+------+------+------+------| + * |Backlite| Mouse| | | | | | | Bail | | + * `-------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12_2x2u( \ + BL_INC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \ + BL_DEC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, \ + BL_STEP, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, X_____X, \ + BL_TOGG, TO(_MOUSE), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \ +), + + +/* movement layer (hold semicolon) */ +[_MOVE] = LAYOUT_ortho_4x12_2x2u( \ + TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, \ + _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, X_____X, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, X_____X \ +), + +/* mouse layer + */ +[_MOUSE] = LAYOUT_ortho_4x12_2x2u( \ + TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X , \ + _______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \ + _______, TO(_QWERTY), _______, _______, _______, _______, _______, _______, TO(_QWERTY), X_____X \ +), + +/* vim command layer. + */ +[_CMD] = LAYOUT_ortho_4x12_2x2u( \ + X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, \ + VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, \ + VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, \ + _______, TO(_QWERTY), _______, _______, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X \ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/readme.md b/keyboards/divergetm2/keymaps/xtonhasvim/readme.md new file mode 100644 index 0000000000..9ff4ce1f19 --- /dev/null +++ b/keyboards/divergetm2/keymaps/xtonhasvim/readme.md @@ -0,0 +1,9 @@ +# Xton has a tiny keyboard! With Vim! + +Based on the standard Planck layout with a few changes: + +* Escape moved to dual-function with control. +* Dedicated movement and mouse layers. +* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys. +* Vim layers! See `users/xtonhasvim`. + diff --git a/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk b/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk new file mode 100644 index 0000000000..ede4e02b64 --- /dev/null +++ b/keyboards/divergetm2/keymaps/xtonhasvim/rules.mk @@ -0,0 +1,3 @@ +MOUSEKEY_ENABLE = yes +# BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no diff --git a/keyboards/divergetm2/readme.md b/keyboards/divergetm2/readme.md new file mode 100644 index 0000000000..893b82cb5c --- /dev/null +++ b/keyboards/divergetm2/readme.md @@ -0,0 +1,21 @@ +# diverge tm2 + +A 4x6x2 split ortholinear keyboard with 2u spacebars like the Levinson (similar to Let's Split). Made by [Unikeyboard](https://unikeyboard.io). + +Keyboard Maintainer: [IslandMan93](https://github.com/islandman93) and [xton](https://github.com/xton) +Hardware Supported: Pro Micro +Hardware Availability: [Diverge TM2](https://unikeyboard.io/product/diverge-tm/) + +Make example for this keyboard (after setting up your build environment): + + make divergetm2: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). + +# Flashing the first time + +Disassemble the case so you have access to each Pro Micro. Flash each half with QMK Toolbox by connecting the USB cable and shorting RST and GND. After that, just use the soft reset key on your respective layout to reflash both halves. + +# Reflashing Animus + +Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST) during the upload step. Then reapply your keymap through Arbites. diff --git a/keyboards/divergetm2/rules.mk b/keyboards/divergetm2/rules.mk new file mode 100644 index 0000000000..2be853a2a6 --- /dev/null +++ b/keyboards/divergetm2/rules.mk @@ -0,0 +1,75 @@ + + +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +# must specify this to enable soft-reset +BOOTLOADER = caterina -- cgit v1.2.3 From 07fac2fbbff871827b17eba3a3740b8991e8c5d3 Mon Sep 17 00:00:00 2001 From: Christon DeWan Date: Mon, 3 Sep 2018 16:50:11 -0700 Subject: Keymap: xtonhasvim Levinson (#3837) * pulled in levinson from staging. * simplified trilayer handling and some other linting that bit me in the last code review * formatting --- keyboards/levinson/keymaps/xtonhasvim/config.h | 35 ++++ keyboards/levinson/keymaps/xtonhasvim/keymap.c | 237 ++++++++++++++++++++++++ keyboards/levinson/keymaps/xtonhasvim/readme.md | 9 + keyboards/levinson/keymaps/xtonhasvim/rules.mk | 5 + 4 files changed, 286 insertions(+) create mode 100644 keyboards/levinson/keymaps/xtonhasvim/config.h create mode 100644 keyboards/levinson/keymaps/xtonhasvim/keymap.c create mode 100644 keyboards/levinson/keymaps/xtonhasvim/readme.md create mode 100644 keyboards/levinson/keymaps/xtonhasvim/rules.mk diff --git a/keyboards/levinson/keymaps/xtonhasvim/config.h b/keyboards/levinson/keymaps/xtonhasvim/config.h new file mode 100644 index 0000000000..bcd2220ce0 --- /dev/null +++ b/keyboards/levinson/keymaps/xtonhasvim/config.h @@ -0,0 +1,35 @@ +#pragma once + +#define USE_SERIAL + +// #define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +// #define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// help for fast typist+dual function keys? +#define PERMISSIVE_HOLD + +// where is the cord plugged in? +#define MASTER_LEFT diff --git a/keyboards/levinson/keymaps/xtonhasvim/keymap.c b/keyboards/levinson/keymaps/xtonhasvim/keymap.c new file mode 100644 index 0000000000..b9341ff35a --- /dev/null +++ b/keyboards/levinson/keymaps/xtonhasvim/keymap.c @@ -0,0 +1,237 @@ + /* Copyright 2015-2017 Christon DeWan + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "xtonhasvim.h" +#include "fancylighting.h" + +/************************************ + * states + ************************************/ + +enum layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _MOVE, + _MOUSE, + _CMD +}; + +extern uint8_t vim_cmd_layer(void) { return _CMD; } + +/************************************ + * keymaps! + ************************************/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl*| A* | S | D | F | G | H | J | K | L | ;* | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | chkwm| | Alt | GUI |Lower*| Sp|ace |Raise*| SPC | GUI | | Vim | + * `-----------------------------------------------------------------------------------' + * + * - Ctrl acts as Esc when tapped. + * - Holding A or ; switches to movement layer. + * - Raise and Lower are one-shot layers. + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MOVE,KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT) , \ + LSFT(KC_LALT), MO(_MOVE), KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_RGUI, KC_RALT, MO(_MOVE), VIM_START \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Bail | | | | | |Raise | | | Bail | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_BSPC, \ + KC_DEL, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \ + RESET, TO(_QWERTY), _______, _______, _______, _______, _______, MO(_RAISE), _______, _______, TO(_QWERTY), X_____X \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Next | Vol- | Vol+ | Play | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Bail | | |Lower | | | | | | Bail | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSPC, \ + KC_DEL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, FIREY_RETURN, \ + X_____X, TO(_QWERTY), _______, _______, MO(_LOWER), _______, _______, _______, _______, _______, TO(_QWERTY), RESET \ +), + + +/* Adjust (Lower + Raise) + * ,-------------------------------------------------------------------------------------. + * |BL Raise| | | | | | | | | | | | + * |--------+------+------+------+------+-------------+------+------+------+------+------| + * |BL Lower| | | | | | | | | | | | + * |--------+------+------+------+------+------|------+------+------+------+------+------| + * |BL STEP | | | | | | | Next | Vol- | Vol+ | Play | | + * |--------+------+------+------+------+------+------+------+------+------+------+------| + * |Backlite| Bail | | | | | | | | | Bail | | + * `-------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + BL_INC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, RGB_MODE_PLAIN, \ + BL_DEC, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, RGB_MODE_REVERSE, \ + BL_STEP, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, RGB_MODE_FORWARD, \ + BL_TOGG, TO(_MOUSE), _______, _______, _______, _______, _______, _______, _______, _______, TO(_QWERTY), RGB_TOG \ +), + + +/* movement layer (hold semicolon) */ +[_MOVE] = LAYOUT_ortho_4x12( \ + TO(_QWERTY), X_____X, X_____X, X_____X, X_____X, X_____X, KC_HOME, KC_PGDN, KC_PGUP, KC_END, X_____X, X_____X, \ + _______, X_____X, LGUI(KC_LBRC), LGUI(LSFT(KC_LBRC)), LGUI(LSFT(KC_RBRC)), LGUI(KC_RBRC), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, X_____X, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \ + _______, _______, _______, _______, _______, X_____X, X_____X, _______, _______, _______, _______, X_____X \ +), + +/* mouse layer + */ +[_MOUSE] = LAYOUT_ortho_4x12( \ + TO(_QWERTY), X_____X, X_____X, KC_MS_UP, X_____X, X_____X, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_UP, KC_MS_WH_RIGHT, X_____X, X_____X, \ + _______, X_____X, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, X_____X, X_____X, KC_MS_BTN1, KC_MS_BTN2, KC_MS_BTN3, X_____X, X_____X, \ + _______, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, X_____X, _______, \ + _______, TO(_QWERTY), _______, _______, _______, X_____X, X_____X, _______, _______, _______, TO(_QWERTY), X_____X \ +), + +/* vim command layer. + */ +[_CMD] = LAYOUT_ortho_4x12( \ + X_____X, X_____X, VIM_W, VIM_E, X_____X, X_____X, VIM_Y, VIM_U, VIM_I, VIM_O, VIM_P, X_____X, \ + VIM_ESC, VIM_A, VIM_S, VIM_D, X_____X, VIM_G, VIM_H, VIM_J, VIM_K, VIM_L, X_____X, X_____X, \ + VIM_SHIFT, X_____X, VIM_X, VIM_C, VIM_V, VIM_B, X_____X, X_____X, VIM_COMMA, VIM_PERIOD, X_____X, VIM_SHIFT, \ + _______, TO(_QWERTY), _______, _______, X_____X, X_____X, X_____X, X_____X, _______, _______, TO(_QWERTY), X_____X \ +) + +}; + + + +#define C_RED 0xFF, 0x00, 0x00 +#define C_GRN 0x00, 0xFF, 0x00 +#define C_BLU 0x00, 0x00, 0xFF + +#define C_YAN 0x00, 0xFF, 0xFF +#define C_PRP 0x7A, 0x00, 0xFF +#define C_ORG 0xFF, 0x93, 0x00 + +void rgbflag(uint8_t r, uint8_t g, uint8_t b, uint8_t rr, uint8_t gg, uint8_t bb) { + LED_TYPE *target_led = user_rgb_mode ? shadowed_led : led; + for (int i = 0; i < RGBLED_NUM; i++) { + switch (i) { + case 10: case 11: + target_led[i].r = r; + target_led[i].g = g; + target_led[i].b = b; + break; + case 0: case 1: + target_led[i].r = rr; + target_led[i].g = gg; + target_led[i].b = bb; + break; + default: + target_led[i].r = 0; + target_led[i].g = 0; + target_led[i].b = 0; + break; + } + } + rgblight_set(); +} + +void set_state_leds(void) { + if (rgblight_get_mode() == 1) { + switch (biton32(layer_state)) { + case _RAISE: + rgbflag(C_BLU, C_GRN); + break; + case _LOWER: + rgbflag(C_BLU, C_RED); + break; + case _ADJUST: + rgbflag(C_BLU, C_PRP); + break; + case _MOVE: + rgbflag(C_RED, C_PRP); + break; + case _MOUSE: + rgbflag(C_RED, C_GRN); + break; + case _CMD: + switch(vstate) { + case VIM_V: + case VIM_VI: + case VIM_VS: + rgbflag(C_GRN, C_YAN); + break; + case VIM_C: + case VIM_CI: + rgbflag(C_GRN, C_ORG); + break; + case VIM_D: + case VIM_DI: + rgbflag(C_GRN, C_RED); + break; + case VIM_G: + rgbflag(C_GRN, C_BLU); + break; + case VIM_Y: + rgbflag(C_GRN, C_PRP); + break; + case VIM_START: + default: + rgbflag(C_GRN, C_GRN); + break; + } + break; + default: // for any other layers, or the default layer + rgbflag(C_YAN, C_YAN); + break; + } + } +} + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} diff --git a/keyboards/levinson/keymaps/xtonhasvim/readme.md b/keyboards/levinson/keymaps/xtonhasvim/readme.md new file mode 100644 index 0000000000..9ff4ce1f19 --- /dev/null +++ b/keyboards/levinson/keymaps/xtonhasvim/readme.md @@ -0,0 +1,9 @@ +# Xton has a tiny keyboard! With Vim! + +Based on the standard Planck layout with a few changes: + +* Escape moved to dual-function with control. +* Dedicated movement and mouse layers. +* Top and middle row swapped in `_RAISE` and `_LOWER` because I never use F-keys. +* Vim layers! See `users/xtonhasvim`. + diff --git a/keyboards/levinson/keymaps/xtonhasvim/rules.mk b/keyboards/levinson/keymaps/xtonhasvim/rules.mk new file mode 100644 index 0000000000..ad5466991c --- /dev/null +++ b/keyboards/levinson/keymaps/xtonhasvim/rules.mk @@ -0,0 +1,5 @@ +# MOUSEKEY_ENABLE = yes +# BACKLIGHT_ENABLE = yes +# AUDIO_ENABLE = no + +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. -- cgit v1.2.3 From aa795dc33ee1c854a3ea5a3cb3d15e7e68be89d6 Mon Sep 17 00:00:00 2001 From: Xin-Xin Wang Date: Mon, 3 Sep 2018 19:55:06 -0400 Subject: Keymap: Fix missing braces around initializer error on older gcc (#3840) --- users/xtonhasvim/fancylighting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/users/xtonhasvim/fancylighting.c b/users/xtonhasvim/fancylighting.c index dc13df03f7..a88ca4beb3 100644 --- a/users/xtonhasvim/fancylighting.c +++ b/users/xtonhasvim/fancylighting.c @@ -45,7 +45,7 @@ void matrix_scan_keymap(void) { uint16_t effect_start_timer = 0; uint8_t user_rgb_mode = 0; -LED_TYPE shadowed_led[RGBLED_NUM] = {0}; +LED_TYPE shadowed_led[RGBLED_NUM] = {{0}}; void start_firey_return(void) { user_rgb_mode = BREATH_FIRE; @@ -79,7 +79,7 @@ void set_color_for_offsets(uint16_t time_offset, uint16_t space_offset, uint8_t float alpha = (time_progress + 0.1) * 7.0 - space_progress; alpha = fmin(1.0, alpha*alpha); - LED_TYPE px[1] = {0}; + LED_TYPE px[1] = {{0}}; sethsv((uint16_t)(fmod(time_progress * 1.5 + space_progress,1.0)*360), 255, (uint8_t)(progress*255),&px[0]); led[idx].r = alpha * px[0].r + ( 1.0 - alpha) * shadowed_led[idx].r; led[idx].g = alpha * px[0].g + ( 1.0 - alpha) * shadowed_led[idx].g; -- cgit v1.2.3 From f48e20c1eb52d7281276025fd1cbaa81e1856f83 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Mon, 3 Sep 2018 16:57:06 -0700 Subject: Keymap: Updates to xyverz keymaps (#3841) * fixing ortho_4x12 configs * Using upstream/master version instead * Additions and Corrections Corrected the Kinesis/Stapelberg's .c file to allow LEDs to work Removed excess cruft from my Kinesis keymap to reflect this change Other minor tweaks and adjustments to my ortho_4x12 and 5x12 layouts * Rules for vitamins_included Added a section to disable RGB underglow for the Let's Split Vitamins Included board. * fixing ortho_4x12 configs * Using upstream/master version instead * Additions and Corrections Corrected the Kinesis/Stapelberg's .c file to allow LEDs to work Removed excess cruft from my Kinesis keymap to reflect this change Other minor tweaks and adjustments to my ortho_4x12 and 5x12 layouts * Creating my own userspace * Added Rorschach keymap * renamed userspace folder I renamed my userspace folder since I'm not ready to start using it just yet, and I want to get my keyboards programmed. This is a temporary thing and will be fixed later as I get time. * adding files in "new" folder * Disabling LEDs on Pro Micro * Modifications to Kinesis keymap * More kinesis tweaks * removed userspace from master Created a new branch for my userspace stuff. I'll work on it there. * Moved keymap to separate branch Moved the Rorschach keymap I was working on to a separate branch for development purposes. Not ready to push it up to upstream master. --- keyboards/atreus62/keymaps/xyverz/keymap.c | 11 +++++++- keyboards/kinesis/keymaps/xyverz/keymap.c | 43 +++++++++++++++++------------- keyboards/kinesis/keymaps/xyverz/readme.md | 20 +++++++------- keyboards/kinesis/keymaps/xyverz/rules.mk | 6 ++--- 4 files changed, 46 insertions(+), 34 deletions(-) diff --git a/keyboards/atreus62/keymaps/xyverz/keymap.c b/keyboards/atreus62/keymaps/xyverz/keymap.c index 3788317378..0f2e8ea08f 100644 --- a/keyboards/atreus62/keymaps/xyverz/keymap.c +++ b/keyboards/atreus62/keymaps/xyverz/keymap.c @@ -127,8 +127,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { +void matrix_init_user(void) { +#ifdef BOOTLOADER_CATERINA + // This will disable the red LEDs on the ProMicros + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +#endif +}; +const uint16_t PROGMEM fn_actions[] = { }; void persistent_default_layer_set(uint16_t default_layer) { diff --git a/keyboards/kinesis/keymaps/xyverz/keymap.c b/keyboards/kinesis/keymaps/xyverz/keymap.c index 1025df0769..2eab62a2bc 100644 --- a/keyboards/kinesis/keymaps/xyverz/keymap.c +++ b/keyboards/kinesis/keymaps/xyverz/keymap.c @@ -20,6 +20,11 @@ enum custom_keycodes { #define _______ KC_TRNS #define XXXXXXX KC_NO +// Aliases to make the keymap more uniform +#define GUI_END GUI_T(KC_END) +#define MED_DEL LT(_MEDIA, KC_DEL) +#define KPD_ENT LT(_KEYPAD, KC_ENT) + /* Function Keys on All Layers (Keypad toggles): @@ -96,9 +101,9 @@ enum custom_keycodes { |--------+------+------+------+------+------||------+------+------+------+------+--------| | | | | | | || | | | | | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || | Mute | Vol- | Vol+ | | | + | | | Mute | Vol- | Vol+ | || | | | | | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || Stop | Prev | Play | Next | Sel | | + | | Stop | Prev | Play | Next | Sel || | | | | | | `--------+------+------+------+------+------'`------+------+------+------+------+--------' | | | | | | | | | | `---------------------------' `---------------------------' @@ -116,12 +121,12 @@ enum custom_keycodes { |--------+------+------+------+------+------||------+------+------+------+------+--------| | Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | | + | Wake | | Mute | Vol- | Vol+ | || | KP 4 | KP 5 | KP 6 | KP + | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| | + | | Stop | Prev | Play | Next | Sel || | KP 1 | KP 2 | KP 3 |KP Ent| | `--------+------+------+------+------+------'`------+------+------+------+------+--------' - | | | | | | | | KP . |KP Ent| | - `---------------------------' `----------------------------------' + | |QWERTY|Colemk|Dvorak| | | | KP . |KP Ent| + `---------------------------' `---------------------------' ,-------------.,-------------. | | || | | ,------|------|------||------+------+------. @@ -144,7 +149,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Thumb KC_LCTL, KC_LALT, KC_HOME, - KC_BSPC, LT(_MEDIA, KC_DEL), KC_END, + KC_BSPC, MED_DEL, GUI_END, // Right Hand KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET, @@ -156,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Right Thumb KC_RGUI, KC_RCTL, KC_PGUP, - KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC + KC_PGDN, KPD_ENT, KC_SPC ), [_QWERTY] = LAYOUT ( @@ -170,7 +175,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Thumb KC_LCTL, KC_LALT, KC_HOME, - KC_BSPC, LT(_MEDIA, KC_DEL), KC_END, + KC_BSPC, MED_DEL, KC_END, // Right Hand KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET, @@ -182,7 +187,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Right Thumb KC_RGUI, KC_RCTL, KC_PGUP, - KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC + KC_PGDN, KPD_ENT, KC_SPC ), [_COLEMAK] = LAYOUT ( @@ -196,7 +201,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Left Thumb KC_LCTL, KC_LALT, KC_HOME, - KC_BSPC, LT(_MEDIA, KC_DEL), KC_END, + KC_BSPC, MED_DEL, KC_END, // Right Hand KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_SLCK, KC_PAUS, TG(_KEYPAD), RESET, @@ -208,7 +213,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Right Thumb KC_RGUI, KC_RCTL, KC_PGUP, - KC_PGDN, LT(_KEYPAD, KC_ENT), KC_SPC + KC_PGDN, KPD_ENT, KC_SPC ), [_MEDIA] = LAYOUT ( @@ -216,8 +221,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, + _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, + _______, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______, _______, _______, _______, // Left Thumb _______, _______, @@ -228,8 +233,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, _______, _______, _______, _______, _______, _______, - _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, - KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, // Right Thumb _______, _______, @@ -242,9 +247,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PWR, _______, _______, _______, _______, _______, KC_SLEP, _______, _______, _______, _______, _______, - KC_WAKE, _______, QWERTY, COLEMAK, DVORAK, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, + KC_WAKE, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, + _______, KC_MSTP, KC_MPRV, KC_MPLY, KC_MNXT, KC_MSEL, + _______, QWERTY, COLEMAK, DVORAK, // Left Thumb _______, _______, _______, diff --git a/keyboards/kinesis/keymaps/xyverz/readme.md b/keyboards/kinesis/keymaps/xyverz/readme.md index 4f270445d8..b55100d25b 100644 --- a/keyboards/kinesis/keymaps/xyverz/readme.md +++ b/keyboards/kinesis/keymaps/xyverz/readme.md @@ -4,19 +4,17 @@ The Dvorak layout shown here stems from my early Kinesis years, using the Contour PS/2 with a Dvorak software layout. Because of this, the RBRC and LBRC were on opposite sides of the board in the corner keys. I've decided to continue using this layout with my QMK Kinesis. -~~After a year of using a planck, I've become accustomed to my / and ? being above the - key, so I've decided to move my [, ], and = to the normal Advantage location and set the two keys above the - to new locations. I'll play with it for a while and see how I like it.~~ I didn't like it, so I've switched back. - The QWERTY layout shown here is based entirely on the Kinesis Advantage layout. The Colemak layout is merely an adaptation of that. I've enabled persistent keymaps for Qwerty, Dvorak and Colemak layers, similar to the default Planck layouts. -As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Lock LEDs work for me. The Scroll Lock LED does work on my keyboard, but I can't get it to work when I use the Scroll Lock key on my keyboard. I also have no idea how to get the Num Pad LED working when I switch to the Numpad layer. +Depending on the OS, most of the LEDs are now working in this keymap, but I still have yet to get the Num Pad LED working when switching to the Numpad layer. ## Still to do: - * Figure out how to make the Numpad and ScrLck LEDs work properly. + * Figure out how to make the Numpad LED work properly. -### Function Keys on All Layers (keypad toggles): +### Function Keys on All Layers (`keypad` toggles to the keypad layer): ,-----------------------------------------------------------------. | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | `-----------------------------------------------------------------' @@ -94,9 +92,9 @@ As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Loc |--------+------+------+------+------+------||------+------+------+------+------+--------| | | | | | | || | | | | | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || | Mute | Vol- | Vol+ | | | + | | | Mute | Vol- | Vol+ | || | | | | | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || Stop | Prev | Play | Next | Sel | | + | | Stop | Prev | Play | Next | Sel || | | | | | | `--------+------+------+------+------+------'`------+------+------+------+------+--------' | | | | | | | | | | `---------------------------' `---------------------------' @@ -117,12 +115,12 @@ As of August 4 2018, I've got the LEDs working ... mostly. Caps Lock and Num Loc |--------+------+------+------+------+------||------+------+------+------+------+--------| | Sleep | | | | | || | KP 7 | KP 8 | KP 9 | KP - | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | Wake | |QWERTY|Colemk|Dvorak| || | KP 4 | KP 5 | KP 6 | KP + | | + | Wake | | Mute | Vol- | Vol+ | || | KP 4 | KP 5 | KP 6 | KP + | | |--------+------+------+------+------+------||------+------+------+------+------+--------| - | | | | | | || | KP 1 | KP 2 | KP 3 |KP Ent| | + | | Stop | Prev | Play | Next | Sel || | KP 1 | KP 2 | KP 3 |KP Ent| | `--------+------+------+------+------+------'`------+------+------+------+------+--------' - | | | | | | | | KP . |KP Ent| | - `---------------------------' `----------------------------------' + | |QWERTY|Colemk|Dvorak| | | | KP . |KP Ent| + `---------------------------' `---------------------------' ,-------------.,-------------. | | || | | ,------|------|------||------+------+------. diff --git a/keyboards/kinesis/keymaps/xyverz/rules.mk b/keyboards/kinesis/keymaps/xyverz/rules.mk index 1da780b841..c21f8aea67 100644 --- a/keyboards/kinesis/keymaps/xyverz/rules.mk +++ b/keyboards/kinesis/keymaps/xyverz/rules.mk @@ -2,11 +2,11 @@ # 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 # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # 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 controls -- cgit v1.2.3 From 714c82cc2ee493b1b2d234c9900ff6d04cc39f62 Mon Sep 17 00:00:00 2001 From: Elisiano Petrini Date: Tue, 4 Sep 2018 01:57:57 +0200 Subject: Keymap: Massdrop CTRL: add basic MacOS support (#3842) * swap KC_LALT with KC_LGUI * replace KC_RALT with KC_RGUI This makes the keyboard more mac friendly out of the box (I'm aware this that this could partially be done in software with the preferences but hey, where's the fun in that). --- keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 203 +++++++++++++++++++++++++++ 1 file changed, 203 insertions(+) create mode 100644 keyboards/massdrop/ctrl/keymaps/mac/keymap.c diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c new file mode 100644 index 0000000000..116aaa9a12 --- /dev/null +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -0,0 +1,203 @@ +#include QMK_KEYBOARD_H + +enum ctrl_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +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_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_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_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + default: + return true; //Process all other keycodes normally + } +} -- cgit v1.2.3 From a14eb01883cd135105cebd4d5570337250cc76cb Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Mon, 3 Sep 2018 19:48:09 -0400 Subject: fix mousekey call --- tmk_core/common/action.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 76c150b404..ae08647496 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -773,9 +773,12 @@ void register_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(KEYCODE2CONSUMER(code)); } - else if IS_MOUSEKEY(code) { - mousekey_on(code); - } + + #ifdef MOUSEKEY_ENABLE + else if IS_MOUSEKEY(code) { + mousekey_on(code); + } + #endif } /** \brief Utilities for actions. (FIXME: Needs better description) @@ -835,9 +838,11 @@ void unregister_code(uint8_t code) else if IS_CONSUMER(code) { host_consumer_send(0); } - else if IS_MOUSEKEY(code) { - mousekey_off(code); - } + #ifdef MOUSEKEY_ENABLE + else if IS_MOUSEKEY(code) { + mousekey_off(code); + } + #endif } /** \brief Utilities for actions. (FIXME: Needs better description) -- cgit v1.2.3 From 0533ea4a2042365e1970345243f2fc0333fb082c Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Wed, 5 Sep 2018 00:52:00 +0900 Subject: Keymap: Added a keymap like a JIS keyboard for JJ 40. (#3847) --- keyboards/jj40/keymaps/like_jis/config.h | 49 ++++++++ keyboards/jj40/keymaps/like_jis/keymap.c | 200 +++++++++++++++++++++++++++++++ keyboards/jj40/keymaps/like_jis/rules.mk | 5 + 3 files changed, 254 insertions(+) create mode 100644 keyboards/jj40/keymaps/like_jis/config.h create mode 100644 keyboards/jj40/keymaps/like_jis/keymap.c create mode 100644 keyboards/jj40/keymaps/like_jis/rules.mk diff --git a/keyboards/jj40/keymaps/like_jis/config.h b/keyboards/jj40/keymaps/like_jis/config.h new file mode 100644 index 0000000000..cd9709272c --- /dev/null +++ b/keyboards/jj40/keymaps/like_jis/config.h @@ -0,0 +1,49 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +// place overrides here + +#define TAPPING_TERM 200 + +#ifdef MOUSEKEY_ENABLE + #undef MOUSEKEY_INTERVAL + #define MOUSEKEY_INTERVAL 5 + + #undef MOUSEKEY_TIME_TO_MAX + #define MOUSEKEY_TIME_TO_MAX 150 + + #undef MOUSEKEY_MAX_SPEED + #define MOUSEKEY_MAX_SPEED 3 + + #undef MOUSEKEY_MOVE_DELTA + #define MOUSEKEY_MOVE_DELTA 3 + + #undef MOUSEKEY_DELAY + #define MOUSEKEY_DELAY 0 +#endif + +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 15 +// #undef BACKLIGHT_LEVELS +// #define BACKLIGHT_BREATHING +// #undef BREATHING_PERIOD +// #define BREATHING_PERIOD 4 diff --git a/keyboards/jj40/keymaps/like_jis/keymap.c b/keyboards/jj40/keymaps/like_jis/keymap.c new file mode 100644 index 0000000000..4724933eab --- /dev/null +++ b/keyboards/jj40/keymaps/like_jis/keymap.c @@ -0,0 +1,200 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + LOWER = SAFE_RANGE, + RAISE, + ADJUST, + RGBRST +}; + +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_KANJI KC_GRV + +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_ADJST ADJUST + +#define KC_RST RESET + +#define KC_LRST RGBRST +#define KC_LTOG RGB_TOG +#define KC_LHUI RGB_HUI +#define KC_LHUD RGB_HUD +#define KC_LSAI RGB_SAI +#define KC_LSAD RGB_SAD +#define KC_LVAI RGB_VAI +#define KC_LVAD RGB_VAD +#define KC_LSMOD RGB_SMOD +#define KC_BTOG BL_TOGG +#define KC_BINC BL_INC +#define KC_BDEC BL_DEC +// #define KC_BRTG BL_BRTG + +#define KC_KNRM AG_NORM +#define KC_KSWP AG_SWAP + +// Layer Mode aliases +// #define KC_L_LO MO(_LOWER) +// #define KC_L_RA MO(_RAISE) +// #define KC_L_AD MO(_ADJUST) +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +// #define KC_GUAP LALT_T(KC_APP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = KC_LAYOUT_ortho_4x12( \ + //,-----------------------------------------------------------------------------------. + ESC, Q, W, E, R, T, Y, U, I, O, P, MINS,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + TBSF, A, S, D, F, G, H, J, K, L, SCLN, ENT,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + LSFT, Z, X, C, V, B, N, M, COMM, DOT, UP, RSFT,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + LCTRL, LALT, LGUI, ADJST, LOWER, BSPC, SPC, RAISE, APP, LEFT, DOWN, RGHT \ + //|------+------+------+------+------+-------------+------+------+------+------+------| + ), + + [_LOWER] = KC_LAYOUT_ortho_4x12( \ + //,-----------------------------------------------------------------------------------. + TAB, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + _____, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, SCLN, QUOT, BSLS,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + _____, F11, F12, XXXXX, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ + //|------+------+------+------+------+-------------+------+------+------+------+------| + _____, _____, _____, _____, _____, DEL, _____, _____, _____, _____, _____, _____ \ + //|------+------+------+------+------+-------------+------+------+------+------+------| + ), + + [_RAISE] = KC_LAYOUT_ortho_4x12( \ + //,-----------------------------------------------------------------------------------. + _____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 4, 5, 6, QUOT, PLUS,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, SLSH,\ + //|------+------+------+------+------+-------------+------+------+------+------+------| + _____, _____, _____, _____, _____, BSPC, _____, _____, _____, _____, _____, _____ \ + //|------+------+------+------+------+-------------+------+------+------+------+------| + ), + + [_ADJUST] = KC_LAYOUT_ortho_4x12( \ + //,-----------------------------------------------------------------------------------. + XXXXX, RST, LRST, KNRM, KSWP, XXXXX, XXXXX, WH_L, WH_U, HOME, PGUP, XXXXX,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + XXXXX, LTOG, LHUI, LSAI, LVAI, BTOG, BINC, WH_R, WH_D, END, PGDN, XXXXX,\ + //|------+------+------+------+------+------|------+------+------+------+------+------| + XXXXX, LSMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ + //|------+------+------+------+------+-------------+------+------+------+------+------| + _____, _____, _____, _____, _____, XXXXX, XXXXX, _____, _____, MS_L, MS_D, MS_R \ + //|------+------+------+------+------+-------------+------+------+------+------+------| + ) +}; + + +#ifdef BACKLIGHT_ENABLE + extern backlight_config_t backlight_config; + + inline void enable_backright(bool on) { + backlight_config.enable = on; + if (backlight_config.raw == 1) // enabled but level = 0 + backlight_config.level = 1; + eeconfig_update_backlight(backlight_config.raw); + // dprintf("backlight toggle: %u\n", backlight_config.enable); + backlight_set(backlight_config.enable ? backlight_config.level : 0); + } + + uint8_t bl_breath_count; + uint8_t bl_breath_speed = 10; + int8_t bl_breath_updown = 1; + bool bl_breath_on; + backlight_config_t bl_breath_backup; + + void bl_breath_start(uint8_t speed) { + + bl_breath_on = true; + bl_breath_speed = speed; + bl_breath_backup = backlight_config; + } + + void bl_breath_end(void) { + + bl_breath_on = false; + backlight_config = bl_breath_backup; + eeconfig_update_backlight(backlight_config.raw); + backlight_set(backlight_config.enable ? backlight_config.level : 0); + } + + void bl_breath_update(void) { + + if (bl_breath_on) { + ++bl_breath_count; + if (bl_breath_count > bl_breath_speed) { + bl_breath_count = 0; + + backlight_config.level += bl_breath_updown; + bl_breath_updown = (backlight_config.level > BACKLIGHT_LEVELS) ? -1 : + (backlight_config.level <= 0) ? 1 : + bl_breath_updown; + enable_backright(true); + } + } + } + + #define BL_BREATH_START bl_breath_start + #define BL_BREATH_END bl_breath_end + #define BL_BREATH_UPDATE bl_breath_update + +#else + + #define BL_BREATH_START(a) + #define BL_BREATH_END() + #define BL_BREATH_UPDATE() +#endif + +// Loop +void matrix_scan_user(void) { + + BL_BREATH_UPDATE(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case LOWER: + if (record->event.pressed) { + BL_BREATH_START(50); + layer_on(_LOWER); + } else { + BL_BREATH_END(); + layer_off(_LOWER); + } + break; + case RAISE: + if (record->event.pressed) { + BL_BREATH_START(100); + layer_on(_RAISE); + } else { + BL_BREATH_END(); + layer_off(_RAISE); + } + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + default: + return true; + } + + return false; +} diff --git a/keyboards/jj40/keymaps/like_jis/rules.mk b/keyboards/jj40/keymaps/like_jis/rules.mk new file mode 100644 index 0000000000..0103be5f4a --- /dev/null +++ b/keyboards/jj40/keymaps/like_jis/rules.mk @@ -0,0 +1,5 @@ +MOUSEKEY_ENABLE = yes +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 40718d2ca3590b34c3d41b8988fc055dc6b55add Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Em=C4=ABls=20Delle?= Date: Tue, 4 Sep 2018 18:52:52 +0300 Subject: Keymap: Create ISO HHKB keymapping for GH60 (#3832) * Create ISO HHKB keymapping for GH60 * Add media controls to Fn layer * Use M(x) instead of F(x), add Copyright text --- keyboards/gh60/keymaps/emiilsd/keymap.c | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 keyboards/gh60/keymaps/emiilsd/keymap.c diff --git a/keyboards/gh60/keymaps/emiilsd/keymap.c b/keyboards/gh60/keymaps/emiilsd/keymap.c new file mode 100644 index 0000000000..0fbfe38c23 --- /dev/null +++ b/keyboards/gh60/keymaps/emiilsd/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2018 Funderburker + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Fillers to make layering more clear +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + ISO HHKB layout: + + * 2u Backspace + * ISO Enter + * split left Shift + * split right Shift + * Caps as Control + * 1u/1.5u/7u/1.5u//1u bottom row + */ + + /* 0: QWERTY */ + [0] = LAYOUT( + KC_ESC, 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_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_NO, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, KC_ENT, + KC_LSFT, KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1), KC_RSFT, + KC_NO, KC_LALT, KC_LGUI, KC_SPC, KC_NO, KC_NO, KC_RALT, KC_CAPSLOCK, KC_NO + ), + + /* 1: Fn layer */ + [1] = 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_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, KC_UP, _______, _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, _______, KC_PGUP, KC_LEFT, KC_RGHT, _______, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_DOWN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; -- cgit v1.2.3 From 224b4dea9805412d0f4b677dc22c1c4fca79a9de Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Tue, 4 Sep 2018 08:55:31 -0700 Subject: mitosis:datagrok add layer select, more layouts (#3835) * mitosis:datagrok: fix typo'd inconsistent brace arrangement (thank you @cari66ean) * mitosis:datagrok: add makefile argument MITOSIS_DATAGROK_SLOWUART * mitosis:datagrok: return backspace to opposite space, use TT(), more - move backspace back to its position opposite space - move del to red+backspace - move tab back to tap-leftshift - move printscreen/scrolllock/pause to blue+left pinky column - use TT() instead of MO() to stick a layer on if wanted - indentation that my text editor wants - default to no audio; i can enable it at compile time. * mitosis:datagrok: modularize features, add default layer rotator key * mitosis: add MITOSIS_DATAGROK_BOTTOMSPACE makefile argument * mitosis:datagrok: README improvements; document new features * mitosis:datagrok: dot. not "number pad dot." in numbers layer * mitosis:datagrok remove unnecessary _user audio code * mitosis:datagrok: return to MO() for red/blue, keep TT() for purple in this way, the LED still updates quickly when red or blue is pressed, but we can still lock the purple layer on for 10-key numpad operation with red+tapping blue. * mitosis:datagrok: add colemak and dvorak default layers * mitosis:datagrok update readme re: available default layouts * mitosis: remove unneeded code that was overriding led_set_user also, add some comments * mitosis:datagrok: updated led setting code for new layers also, place into led_set_user where it belongs, not matrix_scan_user. * mitosis:datagrok: update LEDs when setting the default layer maybe this should go into default_layer_set? * mitosis:datagrok update readme with new imgur links + other improvements * mitosis:datagrok fix typo in image urls * mitosis:datagrok remove useless #include (ty @drashna) * mitosis:datagrok undo unnecessary change to quantum/quantum.h i can put the extern float definition in my own keymap code. (ty @drashna) * mitosis:datagrok move customized layout to my keymap no need to modify keyboard-level mitosis.h. (ty @drashna) * mitosis:datagrok update comment describing my led indicator logic * datagrok:mitosis update readme to document LED indicator. --- keyboards/mitosis/keymaps/datagrok/config.h | 41 ++++- keyboards/mitosis/keymaps/datagrok/keymap.c | 233 +++++++++++++++++---------- keyboards/mitosis/keymaps/datagrok/readme.md | 145 +++++++++++------ keyboards/mitosis/keymaps/datagrok/rules.mk | 25 ++- keyboards/mitosis/mitosis.c | 19 +-- keyboards/mitosis/mitosis.h | 19 ++- 6 files changed, 319 insertions(+), 163 deletions(-) diff --git a/keyboards/mitosis/keymaps/datagrok/config.h b/keyboards/mitosis/keymaps/datagrok/config.h index 9edb950cf1..1c70a3791a 100644 --- a/keyboards/mitosis/keymaps/datagrok/config.h +++ b/keyboards/mitosis/keymaps/datagrok/config.h @@ -1,12 +1,21 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#include "../../config.h" +#ifdef MITOSIS_DATAGROK_SLOWUART +// This is the highest possible baud rate that a pro micro clocked at 8Mhz can +// support without errors. I don't notice any difference in behavior at this +// slower speed. (So I think it should maybe be the default, to allow a single +// codebase to support both available flavors of pro micro.) This requires a +// corresponding change to the wireless module firmware; see +// https://github.com/reversebias/mitosis/pull/10 +#undef SERIAL_UART_BAUD // avoids redefinition warning +#define SERIAL_UART_BAUD 250000 +#endif // I want to place an underscore as tap behavior on the right shift key. But // RSFT_T(KC_UNDS) doesn't work; mod-tap doesn't work with pre-shifted keys. So -// instead we take advantage of Space Cadet Shift that does something similar -// and just tweak it to use the -_ key instead of 0) See +// instead I take advantage of Space Cadet Shift that does something similar +// and just tweak it to use the -/_ key instead of 0/). See // https://github.com/qmk/qmk_firmware/pull/2055 #define RSPC_KEY KC_MINS @@ -18,11 +27,12 @@ //#define NO_ACTION_FUNCTION #ifdef AUDIO_ENABLE -#define STARTUP_SONG SONG(PLANCK_SOUND) -// #define STARTUP_SONG SONG(NO_SOUND) -#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ +#define STARTUP_SONG SONG(MARIO_MUSHROOM) +#define DEFAULT_LAYER_SONGS { \ + SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND), \ + SONG(ZELDA_TREASURE), \ } #define AUDIO_VOICES #define AUDIO_CLICKY @@ -30,3 +40,18 @@ #endif #endif + +#define LAYOUT_bottomspace( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ + k31, k32, k33, k34, k35, k36, k37, k38, \ + k41, k42, k43, k44, k45, k46, k47, k48 \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \ + { KC_NO, k31, k32, k43, k44, k45, k46, k37, k38, KC_NO }, \ + { KC_NO, k41, k42, k33, k34, k35, k36, k47, k48, KC_NO } \ + } diff --git a/keyboards/mitosis/keymaps/datagrok/keymap.c b/keyboards/mitosis/keymaps/datagrok/keymap.c index 4fda3f839f..ae3b954700 100644 --- a/keyboards/mitosis/keymaps/datagrok/keymap.c +++ b/keyboards/mitosis/keymaps/datagrok/keymap.c @@ -1,16 +1,34 @@ #include QMK_KEYBOARD_H + #ifdef AUDIO_ENABLE #include "audio.h" +#ifdef DEFAULT_LAYER_SONGS +extern float default_layer_songs[][][]; +#endif #endif enum mitosis_layers -{ + { _xQ, // qwerty + _xC, // colemak + _xD, // dvorak _xW, // workman _xS, // symbols _xN, // numbers _xF // functions -}; + }; + +enum mitosis_keycodes + { + KC_LAYO = SAFE_RANGE + }; + +// Setting MITOSIS_DATAGROK_BOTTOMSPACE in rules.mk will swap the upper and +// lower center four thumb-keys. See keymaps/datagrok/rules.mk. +#ifdef MITOSIS_DATAGROK_BOTTOMSPACE +#undef LAYOUT +#define LAYOUT LAYOUT_bottomspace +#endif // Fillers to make layering more clear #define _______ KC_TRNS // Transparent @@ -31,58 +49,125 @@ enum mitosis_layers const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_xQ] = LAYOUT( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, - /*, */ KC_LGUI, KC_LCTL, MO(_xS), KC_TAB, KC_SPC, MO(_xS), KC_RCTL, KC_RGUI, - /*, */ KC_HENK, KC_LALT, MO(_xN), KC_LSFT, KC_RSPC, MO(_xN), KC_RALT, KC_MHEN), + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_QUOT, + /*, */ KC_LGUI, KC_LCTL, MO(_xS), KC_BSPC, KC_SPC, MO(_xS), KC_RCTL, KC_RGUI, + /*, */ KC_HENK, KC_LALT, MO(_xN), LSFT_T(KC_TAB), KC_RSPC, MO(_xN), KC_RALT, KC_MHEN), + [_xC] = LAYOUT( + KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, + KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_QUOT, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), + [_xD] = LAYOUT( + KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, + KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, + KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), [_xW] = LAYOUT( - KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, - KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, - KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_QUOT, - /*, */ _______, _______, _______, _______, _______, _______, _______, _______, - /*, */ _______, _______, _______, _______, _______, _______, _______, _______), + KC_Q, KC_D, KC_R, KC_W, KC_B, KC_J, KC_F, KC_U, KC_P, KC_SCLN, + KC_A, KC_S, KC_H, KC_T, KC_G, KC_Y, KC_N, KC_E, KC_O, KC_I, + KC_Z, KC_X, KC_M, KC_C, KC_V, KC_K, KC_L, KC_COMM, KC_DOT, KC_QUOT, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), [_xS] = LAYOUT( - KC_ESC, KC_GRV , KC_UP, KC_EQL , KC_TILD, KC_PLUS, KC_CIRC, KC_AMPR, KC_PERC, KC_MINS, - KC_BSPC, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PIPE, KC_AT, KC_DLR, KC_HASH, KC_ENT, - KC_BSLS, KC_LABK, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RCBR, KC_RPRN, KC_RABK, KC_SLSH, - /*, */ _______, _______, _______, _______, _______, _______, _______, _______, - /*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), _______, _______), + KC_ESC, KC_GRV , KC_UP, KC_EQL , KC_TILD, KC_PLUS, KC_CIRC, KC_AMPR, KC_PERC, KC_MINS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_PIPE, KC_AT, KC_DLR, KC_HASH, KC_ENT, + KC_BSLS, KC_LABK, KC_LCBR, KC_LPRN, KC_LBRC, KC_RBRC, KC_RPRN, KC_RCBR, KC_RABK, KC_SLSH, + /*, */ _______, _______, _______, KC_DEL, _______, _______, _______, _______, + /*, */ _______, _______, TT(_xF), _______, _______, TT(_xF), _______, _______), [_xN] = LAYOUT( - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_PPLS, KC_7, KC_8, KC_9, KC_PMNS, - _______, KC_F4, KC_F5, KC_F6, KC_F11, KC_NLCK, KC_4, KC_5, KC_6, KC_PENT, - _______, KC_F1, KC_F2, KC_F3, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_PSLS, - /*, */ _______, _______, MO(_xF), _______, _______, MO(_xF), KC_0, KC_PDOT, - /*, */ _______, _______, _______, _______, _______, _______, _______, _______), + KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_PPLS, KC_7, KC_8, KC_9, KC_PMNS, + KC_SLCK, KC_F4, KC_F5, KC_F6, KC_F11, KC_NLCK, KC_4, KC_5, KC_6, KC_PENT, + KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_PSLS, + /*, */ _______, _______, TT(_xF), _______, _______, TT(_xF), KC_0, KC_DOT, + /*, */ _______, _______, _______, _______, _______, _______, _______, _______), [_xF] = LAYOUT( - RESET, KC_INS, KC_PGUP, KC_DEL, KC_VOLU, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PMNS, - CK_TOGG, KC_HOME, KC_PGDN, KC_END, KC_VOLD, KC_NLCK, KC_P4, KC_P5, KC_P6, KC_PENT, - TG(_xW), KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS, - /*, */ CK_UP, MU_TOG, _______, _______, _______, _______, KC_P0, KC_PDOT, - /*, */ CK_DOWN, MU_MOD, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS), + RESET, KC_INS, KC_PGUP, DEBUG, KC_VOLU, KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + CK_TOGG, KC_HOME, KC_PGDN, KC_END, KC_VOLD, KC_NLCK, KC_P4, KC_P5, KC_P6, KC_PENT, + KC_LAYO, KC_MPRV, KC_MPLY, KC_MNXT, KC_MUTE, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS, + /*, */ CK_UP, MU_TOG, _______, _______, _______, _______, KC_P0, KC_PDOT, + /*, */ CK_DOWN, MU_MOD, _______, _______, _______, _______, _______, _______), }; +const bool defaultlayers[] = { + [_xQ] = true, + [_xC] = true, + [_xD] = true, + [_xW] = true, + [_xS] = false, + [_xN] = false, + [_xF] = false, +}; +const size_t defaultlayers_n = sizeof(defaultlayers) / sizeof(defaultlayers[0]); + +// New keycode KC_LAYO rotates between available default layers (for e.g., +// selecting a base layout). Shift+KC_LAYO makes the current one persistent. +bool process_record_layout(uint16_t keycode, keyrecord_t *record) { + uint32_t default_layer; + uint8_t i; + #if defined(AUDIO_ENABLE) + float saved_song[][2] = SONG(COIN_SOUND); + #endif + + if (keycode != KC_LAYO || !record->event.pressed) { + return true; + } -// This is a hack to place on and on and on , when using an operating system configured for a // US/qwerty layout. +// cdeq = "comma dot exclamation question" bool comm_shifted = false; bool ques_shifted = false; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_cdeq(uint16_t keycode, keyrecord_t *record) { uint8_t shifted; uint16_t s_keycode; bool *k_shifted; switch (keycode) { - case KC_COMM: - s_keycode = KC_SLSH; - k_shifted = &comm_shifted; - break; - case KC_DOT: - s_keycode = KC_1; - k_shifted = &ques_shifted; - break; - default: - return true; + case KC_COMM: + s_keycode = KC_SLSH; + k_shifted = &comm_shifted; + break; + case KC_DOT: + s_keycode = KC_1; + k_shifted = &ques_shifted; + break; + default: + return true; } shifted = get_mods() & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); @@ -104,47 +189,29 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND); -float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND); -float tone_fnpc[][2] = SONG(PLOVER_SOUND); -float tone_fnmac[][2] = SONG(PLOVER_GOODBYE_SOUND); - -void startup_user() -{ - float tone_startup[][2] = SONG(STARTUP_SOUND); - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{ - float tone_goodbye[][2] = SONG(GOODBYE_SOUND); - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - PLAY_SONG(music_scale); +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return \ + process_record_cdeq(keycode, record) && \ + process_record_layout(keycode, record); } -#endif - // Set the bits of A selected by MASK to the corresponding bits of B #define setbits(A, B, MASK) A = (A & (B | ~MASK)) | (B & MASK) -void matrix_scan_user(void) { + +void led_set_user(uint8_t usb_leds) { + // A simple (but technically inaccurate) model of the momentary layer state: + // Red layer active -> indicator = red + // Blue layer active -> indicator = blue + // Purple layer active -> indicator = purple + // the Pro Micro tx LED displays Num Lock status. // + // Workman layout active -> indicator = green + // Workman red layer -> indicator = yellow (red + green) + // Workman blue layer -> indicator = cyan (blue + green) + // Workman purple layer -> indicator = white (red + blue + green) + // Bit # 7 6 5 4 3 2 1 0 - // layer_state: [ | | | _xF | _xN | _xS | _xQ | _xW ] + // layer_state: [ | _xF | _xN | _xS | _xW | _xD | _xC | _xQ ] // usb_led [ | | |kana |cmps |scrl |caps | num ] // PORTB: [ NC | 10 | 9 | 8 | 14 | 16 | 15 |rxled] // PORTC: [ NC | 5 | | | | | | ] @@ -158,16 +225,16 @@ void matrix_scan_user(void) { // board. Each may be connected to an LED by way of a resistor (4.7k to // match the others) for a total of 14 additional indicators. - // A simple (but technically inaccurate) model of the momentary layer state: - // Fn1 key makes _xS active; indicator = red - // Fn2 key makes _xN active; indicator = blue - // Both keys make _xF active; indicator = purple - // Toggling QWERTY mode makes indicator include green, so (red/blue/purple becomes yellow/cyan/white) - + uint32_t portf_bits = \ + ((layer_state|default_layer_state)&0b01100000)>>1 | \ + ((layer_state|default_layer_state)&0b00010000)<<1 | \ + ((layer_state|default_layer_state)&0b01000000)>>2; + uint32_t portd_bits = \ + (usb_leds&0b1)<<5 | \ + ((layer_state|default_layer_state)&0b1000)>>2; // negated because for ports 0=LED on. - uint32_t portf_bits = ~(layer_state|layer_state<<1|(layer_state&0b100)<<3); - setbits(PORTF, portf_bits, 0b00110000); - setbits(PORTD, ~layer_state, 0b00000010); + setbits(PORTF, ~portf_bits, 0b00110000); + setbits(PORTD, ~portd_bits, 0b00100010); } // vim: set sw=2 et: diff --git a/keyboards/mitosis/keymaps/datagrok/readme.md b/keyboards/mitosis/keymaps/datagrok/readme.md index 9b159b98a0..22d7f4d2fc 100644 --- a/keyboards/mitosis/keymaps/datagrok/readme.md +++ b/keyboards/mitosis/keymaps/datagrok/readme.md @@ -1,54 +1,59 @@ # a layout for the Mitosis - Emphasis on momentary modifiers, all usable from either hand, arranged symmetrically, but left/right distinguishable by the OS. - Shift, Red ("Lower"), Blue ("Raise"), Super ("Windows"), Meta ("Alt"), Hyper (actually Henkan/Muhenkan). + I place left- and right-versions of Shift, GUI ("Super"), and Alt ("Meta"), and Henkan/Muhenkan (which I plan to overload for "Hyper"). + I'm going for a [Space Cadet](https://en.wikipedia.org/wiki/Space-cadet_keyboard) aesthetic; I want a keyboard that can (even just in theory) make use of all the bucky bits my operating system can support. -- Red and Blue are used to momentary-enable (like a shift key) one of three layers: +- Red key and Blue key momentary-enable (like a shift key) one of three layers: - Red: Symbols layer - Blue: Numbers layer - "Purple" (both Red and Blue): Functions layer + + This tri-state layer mechanism is a bit similar to Planck and Preonic's "Raise," "Lower," and "Adjust." - The base layer is QWERTY. - A slight variant of [Workman][] may be toggled using `Red`+`Blue`+`Z`. + [Colemak][], [Dvorak][], and [Workman][] may be toggled using `Red`+`Blue`+`Z`. + When you find the one you like, save it with `Shift`+`Red`+`Blue`+`Z`. - Minimize hand travel, so as not to lose orientation with home row. -- `?` and `!` are moved to take the place of `<` and `>`. Rationale: unmodded - and shifted keys should be for prose, while symbols useful for programming - should be colocated on their own layer. +- `?` and `!` are moved to take the place of `<` and `>`. + Rationale: unmodded and shifted keys should be for prose, while symbols useful for programming should be colocated on their own layer. - Key positions chosen for mnemonics. For example, you can distinguish between alphanumeric numerals and keypad numerals, but they occupy the same key positions. ## Layout Images -![mitosis:datagrok layout base layer](https://imgur.com/9LoLQUk.png) +![mitosis:datagrok layout base layer](https://i.imgur.com/tap5Pjf.png) Base layer. Notes: - customized comma and period, which have exclamation point and question mark on their shift layer. -- tap right-shift for underscore +- tap right-shift for underscore, tap left-shift for tab. -![mitosis:datagrok layout red layer](https://imgur.com/B5bnPGM.png) +![mitosis:datagrok layout red layer](https://i.imgur.com/sMGr34T.png) Red layer. Intended for common navigation and programming symbols. Notes: - symmetric layout of paired braces/brackets/slashes for easier memorization - arrows placed directly on home position -![mitosis:datagrok layout blue layer](https://imgur.com/HGJ4G1U.png) +![mitosis:datagrok layout blue layer](https://i.imgur.com/dDb2563.png) Blue layer. Intended for "number pad." Notes: -- Keycodes generated for numbers, enter key, and mathematical symbols are from the alphanumeric keys, not keypad. This way they are not influenced by the state of Num Lock. If you want to send the keypad equivalents, just use Red and Blue modifiers simultaneously. +- Keycodes generated for numbers, enter key, and mathematical symbols are from the alphanumeric keys, not keypad. + This way they are not influenced by the state of Num Lock. + If you want to send the keypad equivalents, just press Blue as well to access keypad numbers in the same positions in the Purple layer. -![mitosis:datagrok layout purple layer](https://imgur.com/lNsKDtA.png) +![mitosis:datagrok layout purple layer](https://i.imgur.com/pESzy2u.png) Purple (Red+Blue) layer. Intended for "true keypad" and various functions. Notes: - Numbers on this layer send Keypad codes, so the result will be affected by the state of Num Lock. -- "Switch Layout" toggles the alphabet keys between QWERTY and Workman -- Page Up / Page Down / Home / End are placed on similar arrows -- To press Print Screen it is necessary to use the left-side Red and Blue modifiers. +- "Switch Layout" toggles the alphabet keys between QWERTY, Colemak, Dvorak, and Workman. + Shift + "Switch Layout" stores the currently selected alphabet layout in eeprom, so the selection persists across reboots and computers. +- Page Up / Page Down / Home / End are placed on corresponding arrow keys. Keyboard layout editor sources: [base](http://www.keyboard-layout-editor.com/#/gists/bc2d06a3203d1bc3a14ed2245cf39643) @@ -56,14 +61,41 @@ Keyboard layout editor sources: [blue](http://www.keyboard-layout-editor.com/#/gists/240e807f3d7e1d3ddabe1b69ee675048) [purple](http://www.keyboard-layout-editor.com/#/gists/9559f0f8bb1ee47677c8f2b4d766829d) -[Imgur album](https://imgur.com/a/KSoVgPx) +[Imgur album](https://imgur.com/a/hm4bbdM) + +## Indicators + +- When Red layer is active, the RGB indicator turns red. +- When Blue layer is active, the RGB indicator turns blue. +- When Purple layer is active, the RGB indicator turns purple. +- When the Workman layer is active, the RGB indicator turns green. + Currently, this means that activating the Red layer while using the Workman layout will make the indicator show yellow. (red + green.) +- The Num Lock status is shown on the Pro Micro tx LED. +- If you attach a speaker to PC6 (pin 5) and compile with AUDIO_ENABLE=yes, music will be played at startup, when switching default layers, and when saving the default layer. + +## Variants + +Some additional compile-time options for this layout are available by editing rules.mk or compiling like so: + +Normal compilation: + +```make mitosis:datagrok``` + +Swap Space onto bottom thumb row: swaps Red/Backspace/Space/Red with Blue/Shift/Shift/Blue: + +```make mitosis:datagrok MITOSIS_DATAGROK_BOTTOMSPACE=yes``` + +Lower baud UART. Useful when using an 8Mhz pro micro; corresponding changes required in wireless firmware. See rules.mk for details. + +```make mitosis:datagrok MITOSIS_DATAGROK_SLOWUART=yes``` ## Design notes ### Workman layout -- I'm learning a new physical key placement, so I might as well go all-out and - use an optimal non-QWERTY layout. +- I'm learning a new physical key placement, so I might as well go all-out and use an optimal non-QWERTY layout. + Bonus: it's easy to switch back to QWERTY on a traditional row-staggered keyboard. + The designer of the Mitosis had [a similar experience](https://www.reddit.com/r/MechanicalKeyboards/comments/66588f/wireless_split_qmk_mitosis/dgfr22q/). - I like the way Workman feels and some of its advantages over Colemak. Unfortunately, it was designed using a weighting system based on a standard @@ -78,14 +110,10 @@ Keyboard layout editor sources: The next fastest baudrate that works without errors is 250k baud. So if you want to do the same: - - Set the Pro Micro clock rate correctly in `rules.mk`: + - Set the Pro Micro clock and baud rate correctly in `rules.mk`: ``` F_CPU = 800000 - ``` - - Configure it to communicate at 250k baud in `config.h`: - ``` - #undef SERIAL_UART_BAUD // avoids redefinition warning - #define SERIAL_UART_BAUD 250000 + MITOSIS_DATAGROK_SLOWUART = yes ``` - Configure the receiver's wireless module to communicate at 250k baud in `main.c`. See https://github.com/reversebias/mitosis/pull/10 ``` @@ -99,7 +127,7 @@ Keyboard layout editor sources: - Arrow keys are in the home position on the Red layer. - - Blue+Arrows = PgUp/PgDn/Home/End, which is intuitive for me. + - Blue+Arrows = PgUp/PgDn/Home/End, which is intuitive for me and similar to what is done on Apple and some Dell keyboards. - The number pad: I placed the ten-key number pad on the Blue layer. However, this would do the wrong thing when Num Lock was not enabled. @@ -111,11 +139,7 @@ Keyboard layout editor sources: - The Function-keys are arranged to mimic the order of the ten-key pad. - Enter is now in a more qwerty-familiar location, and may be activated with one hand. - Numpad Enter is in the same position. - -- Rather than place Backspace opposite Space, I intentionally place it on a layer where it takes some effort to activate. - Backspace is one of the keys I most dislike on a QWERTY keyboard because it moves me away from homerow and I need to use it so often. - Rather than make it easier to strike, I want to discourage myself from using it by learning to type more accurately. + Numpad Enter is in the same position for mnemonics. - Why do I dislike [snake\_case](https://en.wikipedia.org/wiki/Snake_case) (`__variable_names_that_use_underscores_`)? Maybe because it's hard to type all those underscores requiring the shift key? @@ -126,6 +150,22 @@ Keyboard layout editor sources: ### Current +- Discard "intentionally difficult backspace" idea. + Tab returns to left-shift. + Del returns to Red+Backspace +- "High Profile mode:" Swap Red/Backspace/Space/Red with Blue/Shift/Shift/Blue (placing space on lower thumb keys) using `MITOSIS_DATAGROK_BOTTOMSPACE=yes` when compiling. +- Move Print Screen / Scroll Lock / Pause to pinky column on Blue layer. +- Let's try using TT instead of MO so we can e.g. lock-on the keypad. + - We still use MO for first modifier, so e.g. Red + tapping Blue will lock purple. + So far it feels a bit janky, we'll see. +- One key `KC_LAYO` to cycle through available base layers instead of a dedicated key for each; + Shift + `KC_LAYO` stores current base layer selection in eeprom so it comes back after disconnecting or a reset. +- Added Colemak and Dvorak as default layers that may be selected. +- Set UART to 250kbaud with make argument `MITOSIS_DATAGROK_SLOWUART=yes`, for use with 8Mhz Pro Micros. +- Display Num Lock status on tx LED + +### 0.6.60 + - Experiment: no-modifier underscore on right shift key. - New combined numbers + keypad arrangement. No more worrying about Num Lock key. @@ -168,27 +208,33 @@ Keyboard layout editor sources: ### Abandoned ideas -- "Since QWERTY and Workman keep angle brackets together, place other - enclosing symbols on the same keys. This informs the numbers placement, - which informs the function-key placement." +- Abandoned: intentionally-difficult backspace. + "Backspace is one of the keys I most dislike on a QWERTY keyboard because it moves me away from homerow and I need to use it so often. + Rather than make it easier to strike, I want to discourage myself from using it and train myself to type more accurately." + + - Many other people like an easy-to-reach backspace. + - Many other split-spacebar ergo boards place backspace at the thumbs. + - I can still train myself to type well with it in an easy location. + - I couldn't think of anything really better to put opposite space. - - I tried this and it was bad. I don't like having to pick the right - modifier to get the right flavor of bracket. Instead, now, one modifier - activates a symbols layer where all brackets are easily accessible. +- Abandoned: pile all brackets onto one pair of keys. + "Since QWERTY and Workman keep angle brackets together, place other enclosing symbols on the same keys." -- Space/Enter to the left of layer select for Enter + - I didn't like having to pick the right modifier to get the right flavor of bracket. + Instead, now, one modifier activates a symbols layer where all brackets are easily accessible. - - Doesn't work well; I always trigger space first when mashing the keys +- Abandoned: chorded Enter without proper chording detection + + - I tried to make Red+Space = Enter with the intention that I could hit both with my thumb. + That didn't work well; I always trigger space first when mashing the keys simultaneously. ~~This might not continue to be true if I change the angle at which I strike the keys e.g. with a neoprene base or a wrist support.~~ Even with a wrist rest or low-profile, this is hard to do with one hand. Need to adjust the firmware to understand chorded thumb keys. -- I used to have Blue on ring finger, but that was too hard to use in - conjunction with shift. - ## To do +- Ctrl+'+' doesn't seem to work; fix. - **Shared Layouts.** Figure out how to make use of QMK's common `layouts/` - **Chorded Combos.** @@ -203,16 +249,23 @@ Keyboard layout editor sources: Do any of my applications use it? Should I have the firmware ensure it is set how I want it? Maybe cause it to be momentary active with Blue? - See [@drashna's comment](https://github.com/qmk/qmk_firmware/pull/2366#issuecomment-404951953) -- Store default base layer in eeprom? + See [@drashna's comment](https://github.com/qmk/qmk_firmware/pull/2366#issuecomment-404951953) for code to force it always-on, which I don't know if I want. +- ~~Store default layer in eeprom?~~ +- Allow "!? on ,." to be easily toggled-off. +- Modularize "!? on ,." so it can be easily used on any QMK keyboard. (about half done) - See if the henkan/muhenkan placement is at all useful for Japanese speakers, or abuse different keysyms for Left/Right Hyper. (Original space cadet used scancodes 145/175. 145 is LANG2, 175 is "reserved" in USB HID spec.) - Implement "layer lock" key +- Feature parity with popular boards e.g. Planck? + - Layers for ~~Dvorak, Coleman,~~ Plover + - More music and midi stuff + - Macros? - Improve tri-layer behavior -- Find a better location for PrintScr/SysRq, Scroll Lock, Pause/Break, Caps Lock. -- ~~Figure out where to place non-numpad numbers so we don't need num lock turned - on to type them?~~ +- Find out what `update_tri_layer_state` offers that my simple layers arrangement lacks. +- ~~Find a better location for Caps Lock, PrintScr/SysRq, Scroll Lock, Pause/Break,~~. + Placed on Blue layer. Caps will be Shift+"Layer Lock," once I get that working. +- ~~Figure out where to place non-numpad numbers so we don't need num lock turned on to type them?~~ - ~~Add Insert, PrintScr, Pause/Break~~ - ~~Make QWERTY base layer for people who customize layout in software?~~ I default to QWERTY now. diff --git a/keyboards/mitosis/keymaps/datagrok/rules.mk b/keyboards/mitosis/keymaps/datagrok/rules.mk index a321a67b28..215e58a7d1 100644 --- a/keyboards/mitosis/keymaps/datagrok/rules.mk +++ b/keyboards/mitosis/keymaps/datagrok/rules.mk @@ -1,4 +1,19 @@ -AUDIO_ENABLE = yes # audio output +# Space and "Red" modifier are keys I want in the easiest-to-reach position in +# the thumb row. Depending on the angle and height of the Mitosis and the type +# of keycaps you use, the upper row or the lower row of thumb keys might be more +# comfortable for you. I put red/space on the upper row and blue/shift on the +# lower, but to swap that, set MITOSIS_DATAGROK_BOTTOMSPACE = yes. This has the +# effect of swapping only the four center keys on the upper row of thumb keys with that +# of the lower row of thumb keys. +MITOSIS_DATAGROK_BOTTOMSPACE = no + +# I used to use a pro micro clocked at 8Mhz. It can't reach the same baud rate +# that the standard 16Mhz-clocked pro micro can, so the baud rate needs to be +# lowered. Set this to "yes" to do that. See also +# https://github.com/reversebias/mitosis/pull/10 +MITOSIS_DATAGROK_SLOWUART = no + +AUDIO_ENABLE = no # audio output FAUXCLICKY_ENABLE = no BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) @@ -9,4 +24,12 @@ UNICODE_ENABLE = no # Unicode BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID MIDI_ENABLE = no # MIDI controls + +ifeq ($(strip $(MITOSIS_DATAGROK_BOTTOMSPACE)), yes) + OPT_DEFS += -DMITOSIS_DATAGROK_BOTTOMSPACE +endif +ifeq ($(strip $(MITOSIS_DATAGROK_SLOWUART)), yes) + OPT_DEFS += -DMITOSIS_DATAGROK_SLOWUART +endif + # vim: set ts=8 noet: diff --git a/keyboards/mitosis/mitosis.c b/keyboards/mitosis/mitosis.c index f965f2a048..1ca7276e41 100644 --- a/keyboards/mitosis/mitosis.c +++ b/keyboards/mitosis/mitosis.c @@ -5,13 +5,12 @@ void uart_init(void) { } void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); + DDRD |= (1<<1); // Pin to green, set as output + PORTD |= (1<<1); // Turn it off + DDRF |= (1<<4) | (1<<5); // Pins to red and blue, set as output + PORTF |= (1<<4) | (1<<5); // Turn them off } - void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up @@ -20,16 +19,6 @@ void matrix_init_kb(void) { led_init(); } -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -} - -void led_set_kb(uint8_t usb_led) { - -} - #ifdef SWAP_HANDS_ENABLE __attribute__ ((weak)) const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/mitosis/mitosis.h b/keyboards/mitosis/mitosis.h index 5dd7cc778d..4b73f0407a 100644 --- a/keyboards/mitosis/mitosis.h +++ b/keyboards/mitosis/mitosis.h @@ -53,15 +53,14 @@ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ - k31, k32, k33, k34, k35, k36, k37, k38, \ - k41, k42, k43, k44, k45, k46, k47, k48 \ + k31, k32, k33, k34, k35, k36, k37, k38, \ + k41, k42, k43, k44, k45, k46, k47, k48 \ ) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \ - { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO }, \ - { KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO } \ -} - + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29 }, \ + { KC_NO, k31, k32, k33, k34, k35, k36, k37, k38, KC_NO }, \ + { KC_NO, k41, k42, k43, k44, k45, k46, k47, k48, KC_NO } \ + } #endif -- cgit v1.2.3 From 1a907a1627796468c5d93c091168fede5893bbc7 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 4 Sep 2018 13:29:58 -0700 Subject: Keyboard: formatting changes for readme and enable bootmagic (#3851) --- keyboards/kbd6x/readme.md | 3 ++- keyboards/kbd6x/rules.mk | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/keyboards/kbd6x/readme.md b/keyboards/kbd6x/readme.md index 625ec8968b..b50646ace1 100644 --- a/keyboards/kbd6x/readme.md +++ b/keyboards/kbd6x/readme.md @@ -4,7 +4,8 @@ A WKL Hot Swap Double USB C 60% Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) Hardware Supported: KBD6x PCB -Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb) +Hardware Availability: [KBDFans](https://kbdfans.cn/products/kbd6x-wkl-hot-swap-60-double-type-c-pcb) + Make example for this keyboard (after setting up your build environment): make kbd6x:default diff --git a/keyboards/kbd6x/rules.mk b/keyboards/kbd6x/rules.mk index b8acb7ad99..5c7a3877ee 100644 --- a/keyboards/kbd6x/rules.mk +++ b/keyboards/kbd6x/rules.mk @@ -51,7 +51,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = yes # Console for debug(+400) -- cgit v1.2.3 From 73a3399d0ef7e06db70fc2964a3f2a35e9aca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 24 Aug 2018 15:38:31 +0300 Subject: Add the ability to disable the USB startup check for Chibios - Added support for NO_USB_STARTUP_CHECK. This allows the keyboard do function and not get stuck in a SUSPENDED state loop in case of no USB connection. - Added support for WAIT_FOR_USB. In LUFA no keyboard has this flag enable therefor no keyboard waits for usb to be active. - Added documentation for both configuration flags as they were missing. --- docs/config_options.md | 4 ++++ tmk_core/protocol/chibios/main.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/docs/config_options.md b/docs/config_options.md index e978bcce82..eaaa59872c 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -248,3 +248,7 @@ Use these to enable or disable building certain features. The more you have enab * Enable Bluetooth with the Adafruit EZ-Key HID * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common +* `WAIT_FOR_USB` + * Forces the keyboard to wait for a USB connection to be established before it starts up +* `NO_USB_STARTUP_CHECK` + * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 568c1edb28..dcc6d9d076 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -142,10 +142,15 @@ int main(void) { /* Wait until the USB or serial link is active */ while (true) { +#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE) if(USB_DRIVER.state == USB_ACTIVE) { driver = &chibios_driver; break; } +#else + driver = &chibios_driver; + break; +#endif #ifdef SERIAL_LINK_ENABLE if(is_serial_link_connected()) { driver = get_serial_link_driver(); @@ -178,6 +183,7 @@ int main(void) { /* Main loop */ while(true) { +#if !defined(NO_USB_STARTUP_CHECK) if(USB_DRIVER.state == USB_SUSPENDED) { print("[s]"); #ifdef VISUALIZER_ENABLE @@ -205,6 +211,7 @@ int main(void) { visualizer_resume(); #endif } +#endif keyboard_task(); #ifdef CONSOLE_ENABLE -- cgit v1.2.3 From e5465e1c57f1ae6b71e1e665e4afd5f5e3909a89 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Wed, 5 Sep 2018 12:25:47 -0400 Subject: CTRL and ALT updates Added support to enter bootloader from software (bootloader version must be newer than "v2.18Jun 22 2018 17:28:08" until workaround for older is created). Updated CTRL and ALT keymaps for entering bootloader with Fn+b held for >500ms. Added basic MacOS keymap for ALT. USB sleep LED indicator now turns off after 1 second. Slowed down debug LED code printing. --- keyboards/massdrop/alt/keymaps/default/keymap.c | 14 +- keyboards/massdrop/alt/keymaps/mac/keymap.c | 212 +++++++++++++++++++++++ keyboards/massdrop/ctrl/keymaps/default/keymap.c | 16 +- keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 12 ++ tmk_core/common/arm_atsam/bootloader.c | 32 +++- tmk_core/protocol/arm_atsam/d51_util.c | 4 +- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 7 +- 7 files changed, 290 insertions(+), 7 deletions(-) create mode 100644 keyboards/massdrop/alt/keymaps/mac/keymap.c diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index 3f0b84e387..9d8387bb72 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -19,6 +19,7 @@ enum alt_keycodes { DBG_MTRX, //DEBUG Toggle Matrix Prints DBG_KBD, //DEBUG Toggle Keyboard Prints DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -37,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, 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_TRNS, KC_MUTE, \ L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ ), /* @@ -68,6 +69,8 @@ void matrix_scan_user(void) { #define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + switch (keycode) { case L_BRI: if (record->event.pressed) { @@ -194,6 +197,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { CDC_print("\r\n"); } return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c new file mode 100644 index 0000000000..a8adbd3c8d --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -0,0 +1,212 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_TRNS, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) + { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_extra_manual = !usb_extra_manual; + CDC_print("USB extra port manual mode "); + CDC_print(usb_extra_manual ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + usb_gcr_auto = !usb_gcr_auto; + CDC_print("USB GCR auto mode "); + CDC_print(usb_gcr_auto ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + debug_enable = !debug_enable; + CDC_print("Debug mode "); + CDC_print(debug_enable ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + debug_matrix = !debug_matrix; + CDC_print("Debug matrix "); + CDC_print(debug_matrix ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + debug_keyboard = !debug_keyboard; + CDC_print("Debug keyboard "); + CDC_print(debug_keyboard ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + debug_mouse = !debug_mouse; + CDC_print("Debug mouse "); + CDC_print(debug_mouse ? "enabled" : "disabled"); + CDC_print("\r\n"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index ac58f336e3..9bfb7fec58 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -19,6 +19,7 @@ enum ctrl_keycodes { DBG_MTRX, //DEBUG Toggle Matrix Prints DBG_KBD, //DEBUG Toggle Keyboard Prints DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -39,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), /* @@ -71,6 +72,8 @@ void matrix_scan_user(void) { #define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + switch (keycode) { case L_BRI: if (record->event.pressed) { @@ -197,7 +200,16 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { CDC_print("\r\n"); } return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; default: return true; //Process all other keycodes normally } -} \ No newline at end of file +} diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index 116aaa9a12..a03f891e8c 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -19,6 +19,7 @@ enum ctrl_keycodes { DBG_MTRX, //DEBUG Toggle Matrix Prints DBG_KBD, //DEBUG Toggle Keyboard Prints DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout }; #define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode @@ -71,6 +72,8 @@ void matrix_scan_user(void) { #define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + switch (keycode) { case L_BRI: if (record->event.pressed) { @@ -197,6 +200,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { CDC_print("\r\n"); } return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; default: return true; //Process all other keycodes normally } diff --git a/tmk_core/common/arm_atsam/bootloader.c b/tmk_core/common/arm_atsam/bootloader.c index 5155d9ff04..9701a62196 100644 --- a/tmk_core/common/arm_atsam/bootloader.c +++ b/tmk_core/common/arm_atsam/bootloader.c @@ -15,5 +15,35 @@ */ #include "bootloader.h" +#include "samd51j18a.h" -void bootloader_jump(void) {} +//Set watchdog timer to reset. Directs the bootloader to stay in programming mode. +void bootloader_jump(void) +{ + //Keyboards released with certain bootloader can not enter bootloader from app until workaround is created + uint8_t ver_no_jump[] = "v2.18Jun 22 2018 17:28:08"; + uint8_t *ver_check = ver_no_jump; + uint8_t *boot_check = (uint8_t *)0x21A0; + while (*ver_check && *boot_check == *ver_check) + { + ver_check++; + boot_check++; + } + if (!*ver_check) + { + //Version match + //Software workaround would go here + return; //No software restart method implemented... must use hardware reset button + } + + WDT->CTRLA.bit.ENABLE = 0; + while (WDT->SYNCBUSY.bit.ENABLE) {} + while (WDT->CTRLA.bit.ENABLE) {} + WDT->CONFIG.bit.WINDOW = 0; + WDT->CONFIG.bit.PER = 0; + WDT->EWCTRL.bit.EWOFFSET = 0; + WDT->CTRLA.bit.ENABLE = 1; + while (WDT->SYNCBUSY.bit.ENABLE) {} + while (!WDT->CTRLA.bit.ENABLE) {} + while (1) {} //Wait on timeout +} diff --git a/tmk_core/protocol/arm_atsam/d51_util.c b/tmk_core/protocol/arm_atsam/d51_util.c index 91b58757cf..bb63a94814 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.c +++ b/tmk_core/protocol/arm_atsam/d51_util.c @@ -41,8 +41,8 @@ void m15_print(uint32_t x) //Display unsigned 32-bit number through debug led //Read as follows: 1230 = [*] [* *] [* * *] [**] (note zero is fast double flash) -#define DLED_ONTIME 600000 -#define DLED_PAUSE 1000000 +#define DLED_ONTIME 1000000 +#define DLED_PAUSE 1500000 volatile uint32_t w; void dled_print(uint32_t x, uint8_t long_pause) { diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index e9514730ec..8cc7767038 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -225,6 +225,8 @@ int main(void) { if (usb_state == USB_STATE_POWERDOWN) { + uint32_t timer_led = timer_read32(); + led_on; if (led_enabled) { @@ -233,7 +235,10 @@ int main(void) I2C3733_Control_Set(0); } } - while (usb_state == USB_STATE_POWERDOWN) {} + while (usb_state == USB_STATE_POWERDOWN) + { + if (timer_read32() - timer_led > 1000) led_off; //Good to indicate went to sleep, but only for a second + } if (led_enabled) { for (drvid=0;drvid Date: Wed, 5 Sep 2018 22:41:27 +0200 Subject: Keymap: Add am keymap (#3843) * Add am keymap * Add configuration to play nice with stuck modifiers This is in particular useful with emacs since its easy to get ctrl stuck * Deactivate mouse keys and backlight * Add control/esc and shift/enter taps * Remove DVORAK and PLOVER I won't be using this soon, so getting some free space * Raiser and Lower ideas from jeebak * Add cursor and mouse layers * Enable mouse keys * Switch underscore with minus * Disable audio and fix warnings * Update to the upstream changes * VIM line motion symbols on the raise layer * Enable sound and freeup some media keys on layers * Fix whitespace on keymap * Code review changes * Improve keymap documentation * Improve keymap to match to the default one * Restore DEFAULT_FOLDER to the default value * Fix config.h unescaped line --- keyboards/planck/keymaps/am/config.h | 41 +++++++ keyboards/planck/keymaps/am/keymap.c | 204 ++++++++++++++++++++++++++++++++++ keyboards/planck/keymaps/am/readme.md | 17 +++ keyboards/planck/keymaps/am/rules.mk | 10 ++ 4 files changed, 272 insertions(+) create mode 100644 keyboards/planck/keymaps/am/config.h create mode 100644 keyboards/planck/keymaps/am/keymap.c create mode 100644 keyboards/planck/keymaps/am/readme.md create mode 100644 keyboards/planck/keymaps/am/rules.mk diff --git a/keyboards/planck/keymaps/am/config.h b/keyboards/planck/keymaps/am/config.h new file mode 100644 index 0000000000..b2b87045b8 --- /dev/null +++ b/keyboards/planck/keymaps/am/config.h @@ -0,0 +1,41 @@ +#pragma once + +/* Prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND) \ + } +#endif + +#define MUSIC_MASK (keycode != KC_NO) + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/am/keymap.c b/keyboards/planck/keymaps/am/keymap.c new file mode 100644 index 0000000000..c1fa3925fb --- /dev/null +++ b/keyboards/planck/keymaps/am/keymap.c @@ -0,0 +1,204 @@ +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, +// this is the style you want to emulate. + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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. +enum planck_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _TOUCHCURSOR, + _MOUSE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// Taps +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctr +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_ML LT(_MOUSE, KC_A) // L-ayer T-ap M-ouse C-ursor (on A) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,--------------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |--------+------+------+------+------+-------------+------+------+------+------+-------| + * |Ctrl/Esc| ML/A | S | D | F | G | H | J | K | L | ; | " | + * |--------+------+------+------+------+------|------+------+------+------+------+-------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| + * |--------+------+------+------+------+------+------+------+------+------+------+-------| + * | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_ESC, LT_ML, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + KC_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Colemak + * ,-------------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |--------+------+------+------+------+-------------+------+------+------+------+------| + * |Ctrl/Esc| ML/A | R | S | T | D | H | N | E | I | O | " | + * |--------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Enter | + * |--------+------+------+------+------+------+------+------+------+------+------+------| + * | Power | ~ | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play | + * `-------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_ESC, LT_ML, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + KC_CAPS, KC_TILD, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + ), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | { | } | ` | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | \ | F7 | F8 | F9 | F10 | F11 | F12 | _ | = | [ | ] | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Sleep | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_PIPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_PLUS, KC_LCBR, KC_RCBR, KC_GRV, + KC_BSLS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_SLSH, + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ^ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | - | $ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | . |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Sleep | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_CIRC, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_DLR, + KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_DOT, KC_ENT, + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,-----------------------------------------------------------------------------------. + * | | | |Shift | GUI | ~ |Insert| Home | Up | End | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = LAYOUT_planck_grid( + _______, _______, _______, KC_LSFT, KC_LGUI, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, + _______, KC_LALT, KC_SPC, _______, KC_FIND,KC_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, KC_UNDO, KC_CUT, KC_COPY, KC_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Mouse Layer + * ,-----------------------------------------------------------------------------------. + * | | |ACCL0 |ACCL1 |ACCL2 |ACCL2 | |WHL_L | Up |WHL_R | BTN2 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | BTN3 | BTN1 | BTN4 |WHL_Up| Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | BTN2 | BTN5 |WHL_Dn| BTN1 | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_MOUSE] = LAYOUT_planck_grid( + _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, KC_ACL2, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______, + _______, _______, _______, KC_BTN3, KC_BTN1, KC_BTN4, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, + _______, _______, _______, _______, KC_BTN2, KC_BTN5, KC_WH_D, KC_BTN1, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/am/readme.md b/keyboards/planck/keymaps/am/readme.md new file mode 100644 index 0000000000..6e0601bf22 --- /dev/null +++ b/keyboards/planck/keymaps/am/readme.md @@ -0,0 +1,17 @@ +# The Am Planck Layout + +Heavily inspired by other layouts out there, and fine tuned to work well on emacs (most recently spacemacs with vim bindings). + +It features: + +- Media keys (bottom right) +- Focused on Qwerty and Colemak +- Number pads (normal and reversed) +- TouchCursor layer +- Mouse layer + +## Build + +Making planck/rev4 with keymap am and target dfu + + make planck/rev4:am:dfu diff --git a/keyboards/planck/keymaps/am/rules.mk b/keyboards/planck/keymaps/am/rules.mk new file mode 100644 index 0000000000..696abda39d --- /dev/null +++ b/keyboards/planck/keymaps/am/rules.mk @@ -0,0 +1,10 @@ +# 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 +# +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +AUDIO_ENABLE = yes # Audio output on port C6 -- cgit v1.2.3 From 155850187de7897dcd8f216d704fecce446f0a68 Mon Sep 17 00:00:00 2001 From: Luke Stanley Date: Wed, 5 Sep 2018 15:45:19 -0500 Subject: Keyboard: Add IBM 122-key Terminal keyboard and my Ergodox EZ keymap (Programmer's Dvorak + Gaming/QWERTY layer) (#3850) * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * Add keyboard information and separated my custom layout from the default * Add readme to Lukaus' Ergodox EZ keymap * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * Add keyboard information and separated my custom layout from the default * Add readme to Lukaus' Ergodox EZ keymap * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * Fix merge conflict again? * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * Add keyboard information and separated my custom layout from the default * Add readme to Lukaus' Ergodox EZ keymap * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * added my lukaus keymap (programmers dvorak with QWERTY, function, and mouse/keypad layers) * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * updated ergodox_ez keymap and initial commit for IBM Model M 122 key * Add keyboard information and separated my custom layout from the default * update keymap * Update rules.mk to remove redundant commented line * Fix missing key on default layout for IBM Model M 122 key * Fix issues identified by drashna and noroadsleft * Update readme for IBM 122 key --- keyboards/ergodox_ez/keymaps/lukaus/config.h | 16 + keyboards/ergodox_ez/keymaps/lukaus/keymap.c | 843 +++++++++++++++++++++ keyboards/ergodox_ez/keymaps/lukaus/readme.md | 3 + keyboards/ergodox_ez/keymaps/lukaus/rules.mk | 1 + keyboards/handwired/ibm122m/config.h | 190 +++++ keyboards/handwired/ibm122m/ibm122m.c | 43 ++ keyboards/handwired/ibm122m/ibm122m.h | 42 + keyboards/handwired/ibm122m/info.json | 0 .../handwired/ibm122m/keymaps/default/config.h | 19 + .../handwired/ibm122m/keymaps/default/keymap.c | 46 ++ .../handwired/ibm122m/keymaps/default/readme.md | 2 + .../handwired/ibm122m/keymaps/lukaus/config.h | 19 + .../handwired/ibm122m/keymaps/lukaus/keymap.c | 587 ++++++++++++++ .../handwired/ibm122m/keymaps/lukaus/readme.md | 2 + keyboards/handwired/ibm122m/readme.md | 16 + keyboards/handwired/ibm122m/rules.mk | 67 ++ 16 files changed, 1896 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/lukaus/config.h create mode 100644 keyboards/ergodox_ez/keymaps/lukaus/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/lukaus/readme.md create mode 100644 keyboards/ergodox_ez/keymaps/lukaus/rules.mk create mode 100644 keyboards/handwired/ibm122m/config.h create mode 100644 keyboards/handwired/ibm122m/ibm122m.c create mode 100644 keyboards/handwired/ibm122m/ibm122m.h create mode 100644 keyboards/handwired/ibm122m/info.json create mode 100644 keyboards/handwired/ibm122m/keymaps/default/config.h create mode 100644 keyboards/handwired/ibm122m/keymaps/default/keymap.c create mode 100644 keyboards/handwired/ibm122m/keymaps/default/readme.md create mode 100644 keyboards/handwired/ibm122m/keymaps/lukaus/config.h create mode 100644 keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c create mode 100644 keyboards/handwired/ibm122m/keymaps/lukaus/readme.md create mode 100644 keyboards/handwired/ibm122m/readme.md create mode 100644 keyboards/handwired/ibm122m/rules.mk diff --git a/keyboards/ergodox_ez/keymaps/lukaus/config.h b/keyboards/ergodox_ez/keymaps/lukaus/config.h new file mode 100644 index 0000000000..2b93445378 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/lukaus/config.h @@ -0,0 +1,16 @@ +#pragma once +#define CONFIG_USER_H + +#define TAPPING_TERM 200 + +#ifdef RGBLIGHT_ENABLE +#undef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 12 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 +#endif // RGBLIGHT_ENABLE + +#define FORCE_NKRO + +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) diff --git a/keyboards/ergodox_ez/keymaps/lukaus/keymap.c b/keyboards/ergodox_ez/keymaps/lukaus/keymap.c new file mode 100644 index 0000000000..40156b3ff3 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/lukaus/keymap.c @@ -0,0 +1,843 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#include "keymap_german.h" + +#include "keymap_nordic.h" + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + + // Programmer's Dvorak "macros" : + // To be paired with get_mods to enable both + // Shift functionality and Programmer's Dvorak + + DVP_ESC, // Grave escape basically i think + DVP_AMPR, + DVP_LBRACKET, + DVP_LCBR, + DVP_RCBR, + DVP_LPRN, + DVP_AT, + + DVP_EQUAL, + DVP_ASTERISK, + DVP_RPRN, + DVP_PLUS, + DVP_RBRACKET, + DVP_EXLM, + DVP_HASH, + + RU_2, + RU_3, + RU_4, + RU_6, + RU_7, + RU_DOT, + + SHFT_COMMA, + SHFT_DOT, + + RGB_SLD, + RGB_FF0000, + RGB_008000, + RGB_0000FF, + RGB_FFFFFF, + RGB_800080 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Programmer's Dvorak layer + [0] = LAYOUT_ergodox( + DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_AT, + KC_TAB, KC_SCOLON, KC_COMMA, KC_DOT, KC_P, KC_Y, MO(4), + MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, + KC_LSHIFT, KC_QUOTE, KC_Q, KC_J, KC_K, KC_X, KC_HYPR, + KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_C), LCTL(KC_V), + + KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, MO(4), KC_END, + + DVP_EQUAL, DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, + TT(4), KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLASH, + KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, + KC_MEH, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(3), + KC_DELETE, KC_BSLASH, KC_RGUI, KC_RCTL, LCTL(KC_F), + + KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE + ), + // Gaming QWERTY layer + [1] = LAYOUT_ergodox( + KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F14, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_F23, + MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F24, + KC_LCTL, KC_F8, KC_LALT, KC_F14, KC_F13, + + KC_HOME, TO(0), KC_F15, KC_SPACE, KC_LCTL, KC_LALT, + + KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, + KC_F24, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, + KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOTE, + KC_F17, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT, + KC_DELETE, KC_F19, KC_LGUI, KC_F21, KC_F22, + + KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE + ), + [2] = LAYOUT_ergodox( + KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_C, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TO(0), + MO(3), KC_1, KC_2, KC_3, KC_4, KC_5, + KC_LSHIFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO, + KC_LCTL, KC_F8, KC_LALT, KC_I, KC_S, + + KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END, + + KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_NO, KC_NO, + TO(0), KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_NO, KC_NO, + KC_KP_4, KC_KP_5, KC_KP_6, KC_EQUAL, KC_NO, KC_NO, + KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_NO, KC_NO, + KC_KP_0, KC_KP_DOT, KC_NO, KC_NO, KC_NO, + + TO(0), KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE + ), + // Function Layer + [3] = LAYOUT_ergodox( + KC_DLR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRANSPARENT, + KC_TRANSPARENT, KC_TRANSPARENT, KC_MEDIA_PREV_TRACK,KC_MEDIA_PLAY_PAUSE,KC_MEDIA_NEXT_TRACK,KC_NO, TT(4), + KC_TRANSPARENT, KC_TRANSPARENT, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_TRANSPARENT, + KC_LSHIFT, LALT(KC_Z), KC_TRANSPARENT, KC_TRANSPARENT, KC_F12, KC_TRANSPARENT, ALL_T(KC_NO), + KC_LCTL, KC_LALT, KC_LGUI, KC_CAPSLOCK, LSFT(KC_F12), + + KC_PSCREEN, KC_PGUP, KC_PGDOWN, KC_SPACE, KC_LSHIFT, KC_INSERT, + + KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + KC_NO, KC_HOME, KC_TRANSPARENT, KC_PSCREEN, KC_SLCK, KC_TRANSPARENT, KC_TRANSPARENT, + KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRANSPARENT, KC_TRANSPARENT, + MEH_T(KC_NO), KC_CALCULATOR, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_RSHIFT, + KC_DELETE, KC_INSERT, KC_TRANSPARENT, KC_F19, KC_RCTL, + + TO(2),KC_TRANSPARENT,KC_TRANSPARENT,LALT(KC_F10),KC_ENTER,KC_BSPACE + ), + // Keypad, Lighting, and Mouse emulation layer + ///* + [4] = LAYOUT_ergodox( + KC_ESCAPE, KC_NO, KC_NO, KC_MS_BTN3, KC_NO, KC_NO, KC_NO, + KC_TAB, KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_WH_UP, TO(0), + KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, + KC_LSHIFT, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, TO(5), + KC_LCTL, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, + + KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END, + + KC_NO, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_CALCULATOR, KC_NO, RGB_VAI, + TO(0), KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS, KC_NO, RGB_VAD, + KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_NO, RGB_HUI, + KC_NO, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, RGB_SLD, RGB_HUD, + KC_KP_0, KC_KP_DOT, KC_KP_ENTER, RGB_MOD, RGB_TOG, + + KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE + ) + //*/ + /* + // Keypad, Lighting, and Mouse emulation layer + [4] = KEYMAP( + KC_ESCAPE, KC_NO, KC_NO, KC_MS_BTN3, KC_NO, KC_NO, KC_NO, + KC_TAB, KC_NO, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_WH_UP, TO(0), + KC_NO, KC_NO, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_DOWN, + KC_LSHIFT, KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, TO(5), + KC_LCTL, KC_NO, KC_LEFT, KC_DOWN, KC_RIGHT, + + KC_MS_BTN3, TO(1), KC_HOME, KC_SPACE, KC_LSHIFT, KC_END, + + KC_NO, KC_I, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_CALCULATOR, RGB_VAI, + TO(0), KC_G, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_MINUS, RGB_VAD, + SHFT_COMMA, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, RGB_HUI, + KC_NO, SHFT_DOT, KC_KP_1, KC_KP_2, KC_KP_3, KC_EQUAL, RGB_HUD, + KC_NO, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, RGB_TOG, + + KC_F17, KC_F18, KC_PGUP, KC_PGDOWN, KC_ENTER, KC_BSPACE + ) + */ + +}; + +void led_set_keymap(uint8_t usb_led) { + +} + +void matrix_init_user (void) { + +} + + +bool left_shift_down = false; +bool right_shift_down = false; + +bool numlock = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case KC_LSHIFT: + if (record->event.pressed) + { + left_shift_down = true; + return true; + } + else + { + left_shift_down = false; + return true; + } + break; + case KC_RSHIFT: + + if (record->event.pressed) + { + right_shift_down = true; + return true; + } + else + { + right_shift_down = false; + return true; + } + break; + case KC_NUMLOCK: + + if (record->event.pressed) + { + numlock = !numlock; + } + break; + + case DVP_ESC: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + SEND_STRING("~"); + return false; + } + else + { + if(record->event.pressed) + SEND_STRING(SS_DOWN(X_ESCAPE)); + else + SEND_STRING(SS_UP(X_ESCAPE)); + return false; + } + break; + + case DVP_AMPR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + SEND_STRING("%"); + + } + } + else + { + if(record->event.pressed) + SEND_STRING("&"); + } + return false; + + break; + + case SHFT_DOT: + if(record->event.pressed) + SEND_STRING(">"); + break; + + case SHFT_COMMA: + if(record->event.pressed) + SEND_STRING("<"); + break; + + case DVP_LBRACKET: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_7); + unregister_code(KC_7); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("["); + } + return false; + + return false; + break; + + case DVP_LCBR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_5); + unregister_code(KC_5); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("{"); + } + return false; + break; + + case DVP_RCBR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_3); + unregister_code(KC_3); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("}"); + } + return false; + break; + + case DVP_LPRN: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_1); + unregister_code(KC_1); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("("); + } + return false; + break; + + case DVP_AT: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_LSHIFT); + register_code(KC_6); + unregister_code(KC_6); + unregister_code(KC_LSHIFT); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("@"); + } + return false; + break; + + + case DVP_EQUAL: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_9); + unregister_code(KC_9); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("="); + } + return false; + break; + + case DVP_ASTERISK: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_0); + unregister_code(KC_0); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("*"); + } + return false; + break; + + case DVP_RPRN: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_2); + unregister_code(KC_2); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING(")"); + } + return false; + break; + + case DVP_PLUS: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_4); + unregister_code(KC_4); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("+"); + } + return false; + break; + + case DVP_RBRACKET: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_6); + unregister_code(KC_6); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("]"); + } + return false; + break; + + case DVP_EXLM: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_8); + unregister_code(KC_8); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("!"); + } + return false; + break; + + case DVP_HASH: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; + + // Russian + case RU_2: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; +case RU_3: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; +case RU_4: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; +case RU_6: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; +case RU_7: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; + + case RU_DOT: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; + + + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + break; + + case RGB_FF0000: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff,0x00,0x00); + #endif + } + return false; + break; + + case RGB_008000: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0x00,0x80,0x00); + #endif + } + return false; + break; + + case RGB_0000FF: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0x00,0x00,0xff); + #endif + } + return false; + break; + + case RGB_FFFFFF: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0xff,0xff,0xff); + #endif + } + return false; + break; + + case RGB_800080: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_setrgb(0x80,0x00,0x80); + #endif + } + return false; + break; + + } + return true; +} + +uint32_t layer_state_set_user(uint32_t state) { + + uint8_t layer = biton32(state); + + // ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 0: + break; + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + case 3: + ergodox_right_led_3_on(); + break; + case 4: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + break; + default: + break; + } + return state; + +}; diff --git a/keyboards/ergodox_ez/keymaps/lukaus/readme.md b/keyboards/ergodox_ez/keymaps/lukaus/readme.md new file mode 100644 index 0000000000..af091bb1b9 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/lukaus/readme.md @@ -0,0 +1,3 @@ +# Lukaus' keymap + +Programmer's Dvorak as default layer with Qwerty gaming layer and two function layers diff --git a/keyboards/ergodox_ez/keymaps/lukaus/rules.mk b/keyboards/ergodox_ez/keymaps/lukaus/rules.mk new file mode 100644 index 0000000000..fe05f599b9 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/lukaus/rules.mk @@ -0,0 +1 @@ +#UNICODE_ENABLE = yes diff --git a/keyboards/handwired/ibm122m/config.h b/keyboards/handwired/ibm122m/config.h new file mode 100644 index 0000000000..1c8e0587dc --- /dev/null +++ b/keyboards/handwired/ibm122m/config.h @@ -0,0 +1,190 @@ +/* +Copyright 2018 REPLACE_WITH_YOUR_NAME + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER IBM +#define PRODUCT IBM Model M 122 key +#define DESCRIPTION Mapping by github.com/lukexorz + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 20 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_COL_PINS { E6, B7, D0, D1, D2, D3, D4, D5, D6, D7, E0, E1, C0, C1, C2, C3, C4, C5, C7, F1 } +#define MATRIX_ROW_PINS { F0, B5, B4, B3, B2, B1, B0, E7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 15 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define B6_AUDIO +#define C6_AUDIO + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 diff --git a/keyboards/handwired/ibm122m/ibm122m.c b/keyboards/handwired/ibm122m/ibm122m.c new file mode 100644 index 0000000000..1c52b94ec6 --- /dev/null +++ b/keyboards/handwired/ibm122m/ibm122m.c @@ -0,0 +1,43 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 . + */ +#include "ibm122m.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/ibm122m/ibm122m.h b/keyboards/handwired/ibm122m/ibm122m.h new file mode 100644 index 0000000000..93e18b4e60 --- /dev/null +++ b/keyboards/handwired/ibm122m/ibm122m.h @@ -0,0 +1,42 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k09, k19, k1A, k29, k39, k3A, k49, k59, k5A, k69, k79, k7A, k3G, k3H, k2G, \ + k0A, k0B, k1B, k2A, k2B, k3B, k4A, k4B, k5B, k6A, k6B, k7B, k1G, k5G, k4G, \ +k31, k32, k34, k24, k25, k26, k27, k37, k38, k28, k2C, k2D, k2E, k3E, k3C, k3F, k2F, k2H, k2I, k20, \ +k21, k41, k42, k44, k45, k46, k47, k57, k58, k48, k4C, k4D, k4E, k5E, k5C, k6F, k4F, k4H, k4I, k40, \ +k51, k52, k62, k14, k15, k16, k17, k07, k08, k18, k1C, k1D, k1E, k0E, k6E, k1F, k1H, k1I, k10, \ +k11, k12, k73, k74, k64, k65, k66, k67, k77, k78, k68, k6C, k6D, k7E, k63, k0G, k61, k6H, k6I, k7J, \ +k02, k01, k00, k70, k71, k03, k72, k60, k0J, k1J, k7H, k7I, \ + k0F \ +) \ +{ \ + { k00, k01, k02, k03, KC_NO, KC_NO, KC_NO, k07, k08, k09, k0A, k0B, KC_NO, KC_NO, k0E, k0F, k0G, KC_NO, KC_NO, k0J }, \ + { k10, k11, k12, KC_NO, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1J }, \ + { k20, k21, KC_NO, KC_NO, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, KC_NO }, \ + { KC_NO, k31, k32, KC_NO, k34, KC_NO, KC_NO, k37, k38, k39, k3A, k3B, k3C, KC_NO, k3E, k3F, k3G, k3H, KC_NO, KC_NO }, \ + { k40, k41, k42, KC_NO, k44, k45, k46, k47, k48, k49, k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, KC_NO }, \ + { KC_NO, k51, k52, KC_NO, KC_NO, KC_NO, KC_NO, k57, k58, k59, k5A, k5B, k5C, KC_NO, k5E, KC_NO, k5G, KC_NO, KC_NO, KC_NO }, \ + { k60, k61, k62, k63, k64, k65, k66, k67, k68, k69, k6A, k6B, k6C, k6D, k6E, k6F, KC_NO, k6H, k6I, KC_NO }, \ + { k70, k71, k72, k73, k74, KC_NO, KC_NO, k77, k78, k79, k7A, k7B, KC_NO, KC_NO, k7E, KC_NO, KC_NO, k7H, k7I, k7J }, \ +} diff --git a/keyboards/handwired/ibm122m/info.json b/keyboards/handwired/ibm122m/info.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/handwired/ibm122m/keymaps/default/config.h b/keyboards/handwired/ibm122m/keymaps/default/config.h new file mode 100644 index 0000000000..0453a72580 --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 + +// place overrides below diff --git a/keyboards/handwired/ibm122m/keymaps/default/keymap.c b/keyboards/handwired/ibm122m/keymaps/default/keymap.c new file mode 100644 index 0000000000..633df106e9 --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Original Layer +[0] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +KC_ESC, KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +KC_NO, KC_NO, 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, +KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, +KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, +KC_NO, KC_NO, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_NO, KC_RIGHT,KC_P0, KC_PDOT, + KC_DOWN), +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/ibm122m/keymaps/default/readme.md b/keyboards/handwired/ibm122m/keymaps/default/readme.md new file mode 100644 index 0000000000..aa592c9739 --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The default keymap for ibm122m2 +The 10 keys to the left of the alphanumerics are unbound (other than Escape on the top-left one) as I have no idea what is supposed to go there. diff --git a/keyboards/handwired/ibm122m/keymaps/lukaus/config.h b/keyboards/handwired/ibm122m/keymaps/lukaus/config.h new file mode 100644 index 0000000000..bf338e196d --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/lukaus/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 +// place overrides here + diff --git a/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c new file mode 100644 index 0000000000..02b69bacf0 --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c @@ -0,0 +1,587 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 . + */ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, + + DVP_ESC, // Grave escape basically i think + DVP_AMPR, + DVP_LBRACKET, + DVP_LCBR, + DVP_RCBR, + DVP_LPRN, + DVP_AT, + DVP_EQUAL, + DVP_ASTERISK, + DVP_RPRN, + DVP_PLUS, + DVP_RBRACKET, + DVP_EXLM, + DVP_HASH, + SHFT_DOT, + SHFT_COMMA +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Programmer's Dvorak +[0] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, +KC_NO, KC_NO, MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_P4, KC_P5, KC_P6, MO(4), +LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_ESC, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, +LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_P0, KC_PDOT, + KC_DOWN +), + +// Qwerty layer + function +[1] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +KC_ESC, TO(0), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +KC_NO, KC_NO, 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, +KC_NO, KC_NO, MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, +KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, +KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT, + KC_DOWN +), +// Orirginal Layer +[2] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +KC_ESC, TO(1), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +KC_NO, TO(0), 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, +KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, +KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, +KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT, + KC_DOWN +), + +// Function Layer +[3] = LAYOUT( + 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_INS, KC_HOME, KC_PGUP, + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_DEL, KC_END, KC_PGDN, +MU_TOG, KC_NO, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +MU_MOD, KC_NO, KC_TAB, KC_NO, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, KC_NO, KC_PGUP, KC_DEL, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS, +KC_NO, KC_NO, KC_TRNS, KC_NO, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_SCOLON, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, +KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, +KC_NO, KC_NO, KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_CAPS, KC_LEFT, KC_WH_D, KC_RIGHT,LSFT(KC_A), KC_PDOT, + KC_DOWN +), +// Literally just the numpad is different +[4] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NO, KC_NO, KC_NO, KC_NO, +KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, +KC_NO, KC_NO, TO(0), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_MS_L, KC_NO, KC_MS_R, KC_TRNS, +LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_NO, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_GT, KC_MS_D, KC_GT, KC_PENT, +LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_BTN1, KC_PDOT, + KC_DOWN +), +/* +[4] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, + 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_DEL, KC_END, KC_PGDN, +MU_TOG, TO(0), KC_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, +MU_MOD, KC_NO, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS, +KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, +KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, +KC_NO, KC_LGUI, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT, LSFT(KC_A), KC_PDOT, + KC_DOWN +),*/ +/*[0] = LAYOUT( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_NO,TO(1),KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, TO(2),KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, + KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, + KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_BSPC,KC_4,KC_4,KC_4, KC_4, + KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, + KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, + KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, + KC_8, KC_SPC,KC_8,KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, TO(1) + +), +[1] = LAYOUT( + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, TO(0),KC_NO,KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, TO(2),KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_BSPC,KC_Q,KC_R,KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_SPC,KC_C,KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, TO(0) +), +[2] = LAYOUT( + KC_LCTRL, KC_LALT, KC_C, KC_RALT, KC_E, KC_F, KC_G, KC_G, KC_H, KC_J, TO(0), TO(1), KC_M, KC_N, KC_QUOT, KC_DOWN, KC_UP, KC_R, KC_S, KC_ENTER, + KC_PPLS, KC_B, KC_C, KC_D, KC_A, KC_S, KC_D, KC_F, KC_J, KC_J, KC_K, KC_NO, KC_K, KC_L, KC_SCOLON, KC_P4, KC_DEL, KC_P5, KC_P6, KC_RIGHT, + KC_PMNS, KC_1, KC_C, KC_D, KC_1, KC_2, KC_3, KC_4, KC_7, KC_J, KC_K, KC_L, KC_8, KC_9, KC_0, KC_NLCK, KC_PGUP,KC_PSLS, KC_PAST, KC_T, + KC_A, KC_ESC, TO(0),KC_D, KC_GRV, KC_F, KC_G, KC_5, KC_6, KC_J, KC_K, KC_L, KC_EQL, KC_N, KC_MINUS, KC_BSPC, KC_INS, KC_HOME, KC_S, KC_T, + KC_PPLS, KC_NO, KC_TAB, KC_D, KC_Q, KC_W, KC_E, KC_R, KC_U, KC_J, KC_K, KC_L, KC_I, KC_O, KC_P, KC_P7, KC_PGDN,KC_P8, KC_P9, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_T, KC_Y, KC_J, KC_K, KC_L, KC_RBRC, KC_N, KC_LBRC, KC_P, KC_END, KC_R, KC_S, KC_T, + KC_LEFT, KC_P1, KC_CAPS, KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_J, KC_K, KC_L, KC_COMMA, KC_DOT, KC_BSLS, KC_PENT, KC_Q, KC_P2, KC_P3, KC_T, + KC_LGUI, KC_SPACE, KC_RCTRL, KC_LSHIFT, KC_E, KC_F, KC_G, KC_B, KC_N, KC_J, KC_K, KC_L, KC_M, KC_N, KC_SLSH, KC_P, KC_Q, KC_P0, KC_PDOT, KC_KP_ENTER + ),*/ +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool left_shift_down = false; +bool right_shift_down = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSHIFT: + if (record->event.pressed) + { + left_shift_down = true; + return true; + } + else + { + left_shift_down = false; + return true; + } + break; + case KC_RSHIFT: + + if (record->event.pressed) + { + right_shift_down = true; + return true; + } + else + { + right_shift_down = false; + return true; + } + break; + + + case DVP_ESC: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + SEND_STRING("~"); + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("$"); + return false; + } + break; + + case DVP_AMPR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + SEND_STRING("%"); + + } + } + else + { + if(record->event.pressed) + SEND_STRING("&"); + return false; + } + break; + + case DVP_LBRACKET: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_7); + unregister_code(KC_7); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("["); + return false; + } + break; + + case DVP_LCBR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_5); + unregister_code(KC_5); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("{"); + return false; + } + break; + + case DVP_RCBR: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_3); + unregister_code(KC_3); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("}"); + return false; + } + break; + + + case DVP_LPRN: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_1); + unregister_code(KC_1); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("("); + return false; + } + break; +// + case DVP_AT: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_LSHIFT); + register_code(KC_6); + unregister_code(KC_6); + unregister_code(KC_LSHIFT); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("@"); + return false; + } + break; + + + case DVP_EQUAL: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_9); + unregister_code(KC_9); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("="); + return false; + } + break; + + case DVP_ASTERISK: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_0); + unregister_code(KC_0); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING("*"); + return false; + } + break; + + case DVP_RPRN: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_2); + unregister_code(KC_2); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + return false; + } + else + { + if(record->event.pressed) + SEND_STRING(")"); + return false; + } + break; + + case DVP_PLUS: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_4); + unregister_code(KC_4); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("+"); + } + return false; + break; + + case DVP_RBRACKET: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_6); + unregister_code(KC_6); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("]"); + } + return false; + break; + + case DVP_EXLM: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_8); + unregister_code(KC_8); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("!"); + } + return false; + break; + + case DVP_HASH: + if (left_shift_down || right_shift_down) + { + if(record->event.pressed) + { + if(left_shift_down) + unregister_code(KC_LSHIFT); + if(right_shift_down) + unregister_code(KC_RSHIFT); + + register_code(KC_GRAVE); + unregister_code(KC_GRAVE); + + if(left_shift_down) + register_code(KC_LSHIFT); + if(right_shift_down) + register_code(KC_RSHIFT); + } + } + else + { + if(record->event.pressed) + SEND_STRING("#"); + } + return false; + break; + case SHFT_DOT: + if(record->event.pressed) + SEND_STRING(">"); + break; + + case SHFT_COMMA: + if(record->event.pressed) + SEND_STRING("<"); + break; + + } + + + + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/ibm122m/keymaps/lukaus/readme.md b/keyboards/handwired/ibm122m/keymaps/lukaus/readme.md new file mode 100644 index 0000000000..5d3f6abe15 --- /dev/null +++ b/keyboards/handwired/ibm122m/keymaps/lukaus/readme.md @@ -0,0 +1,2 @@ +# Lukaus' for ibm122m2 +Programmer's Dvorak as the default layer with a Qwerty layer that can access a function layer. Also includes the default layout, slightly modified diff --git a/keyboards/handwired/ibm122m/readme.md b/keyboards/handwired/ibm122m/readme.md new file mode 100644 index 0000000000..09dac49c0d --- /dev/null +++ b/keyboards/handwired/ibm122m/readme.md @@ -0,0 +1,16 @@ +# ibm122m + +![IBM Model M 122 key](https://i.imgur.com/Oo3Ozqz.jpg) + +This is a keymap for the IBM Model M 122 key terminal keyboard running on a Teensy 2.0++ +I wired it to weird pins on mine (mainly to accomodate speakers), so make sure to update the pin arrays. + +Keyboard Maintainer: [Luke Stanley](https://github.com/lukexorz) +Hardware Supported: Teensy 2.0++ +Hardware Availability: https://www.pjrc.com/store/teensypp.html + +Make example for this keyboard (after setting up your build environment): + + make handwired/ibm122m:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/handwired/ibm122m/rules.mk b/keyboards/handwired/ibm122m/rules.mk new file mode 100644 index 0000000000..ba4be67667 --- /dev/null +++ b/keyboards/handwired/ibm122m/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = at90usb1286 +BOOTLOADER = halfKay + +# 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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 + + +# 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 +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 = yes # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches -- cgit v1.2.3 From e72d07c22b858cf0613f0e340e2ef11bb3fa5c92 Mon Sep 17 00:00:00 2001 From: "Michael F. Lamb" Date: Wed, 5 Sep 2018 13:52:29 -0700 Subject: Keymap: mitosis/datagrok: bug fix (#3854) I don't know how this slipped past the test suite in the last merge, but this syntax I tried is invalid and doesn't compile. Fixed. --- keyboards/mitosis/keymaps/datagrok/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/mitosis/keymaps/datagrok/keymap.c b/keyboards/mitosis/keymaps/datagrok/keymap.c index ae3b954700..d8c20bc439 100644 --- a/keyboards/mitosis/keymaps/datagrok/keymap.c +++ b/keyboards/mitosis/keymaps/datagrok/keymap.c @@ -3,7 +3,7 @@ #ifdef AUDIO_ENABLE #include "audio.h" #ifdef DEFAULT_LAYER_SONGS -extern float default_layer_songs[][][]; +extern float default_layer_songs[][16][2]; #endif #endif -- cgit v1.2.3 From c3b3f33c6a861fb2e84627333d1b4d69487fce44 Mon Sep 17 00:00:00 2001 From: Matthew Treadwell Date: Wed, 5 Sep 2018 16:39:00 -0700 Subject: Keymap: Update personal keymap (#3855) * Updated personal keymap * simplified keymap based on suggestions --- keyboards/levinson/keymaps/treadwell/config.h | 6 +++ keyboards/levinson/keymaps/treadwell/keymap.c | 60 ++++++++------------------- 2 files changed, 24 insertions(+), 42 deletions(-) diff --git a/keyboards/levinson/keymaps/treadwell/config.h b/keyboards/levinson/keymaps/treadwell/config.h index e6648db144..69783937b2 100644 --- a/keyboards/levinson/keymaps/treadwell/config.h +++ b/keyboards/levinson/keymaps/treadwell/config.h @@ -16,6 +16,12 @@ #define TAPPING_TERM 150 +/* default layer sounds */ +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(GAME_SOUND), \ + SONG(COLEMAK_SOUND) \ + } + //#undef RGBLED_NUM //#define RGBLIGHT_ANIMATIONS //#define RGBLED_NUM 12 diff --git a/keyboards/levinson/keymaps/treadwell/keymap.c b/keyboards/levinson/keymaps/treadwell/keymap.c index f930ebb795..bcc744a6dd 100644 --- a/keyboards/levinson/keymaps/treadwell/keymap.c +++ b/keyboards/levinson/keymaps/treadwell/keymap.c @@ -4,7 +4,7 @@ extern keymap_config_t keymap_config; #define _QWERTY 0 #define _COLEMAK 1 -#define _DVORAK 2 +#define _GAME 2 #define _NUMB 3 #define _CODE 4 #define _SYS 5 @@ -14,7 +14,7 @@ extern keymap_config_t keymap_config; enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK, + GAME, NUMB, CODE, SYS, @@ -25,13 +25,9 @@ enum custom_keycodes { #define KC_ KC_TRNS #define _______ KC_TRNS -#define KC_CAPW LGUI(LSFT(KC_3)) // Capture whole screen -#define KC_CPYW LGUI(LSFT(LCTL(KC_3))) // Copy whole screen -#define KC_CAPP LGUI(LSFT(KC_4)) // Capture portion of screen -#define KC_CPYP LGUI(LSFT(LCTL(KC_4))) // Copy portion of screen #define KC_X1 CODE #define KC_X2 NUMB -#define KC_X3 SYS +#define KC_X3 MO(_SYS) #define KC_X4 MT(MOD_LSFT, KC_ENT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -60,25 +56,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //`----+----+----+----+----+----' `----+----+----+----+----+----' ), - [_DVORAK] = LAYOUT_kc( + [_GAME] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, //|----+----+----+----+----+----| |----+----+----+----+----+----| - BSPC, A , O , E , U , I , D , H , T , N , S ,SLSH, + ESC , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , + LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , //|----+----+----+----+----+----| |----+----+----+----+----+----| - X3 ,LCTL,LALT,LGUI, X1 ,LALT, SPC , X2 ,LEFT,DOWN, UP ,RGHT + X3 ,LCTL,LALT,LGUI, X2 , SPC, SPC , X1 ,LEFT,DOWN, UP ,RGHT //`----+----+----+----+----+----' `----+----+----+----+----+----' ), [_NUMB] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,PMNS, + TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, DEL, //|----+----+----+----+----+----| |----+----+----+----+----+----| GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,UNDS, //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,MPRV,MPLY,MNXT, , ,VOLD,VOLU,MUTE, , , + , ,MPRV,MNXT,MPLY, , ,VOLD,VOLU,MUTE, , , //|----+----+----+----+----+----| |----+----+----+----+----+----| , , , , ,LALT, , , , , , //`----+----+----+----+----+----' `----+----+----+----+----+----' @@ -90,7 +86,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+------+----+----+----+----| |----+----+----+----+----+----| CAPS,SELECT,LEFT,DOWN,RGHT,DEL , PGDN, END,LBRC,RBRC,MINS,UNDS, //|----+------+----+----+----+----| |----+----+----+----+----+----| - , UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL, + LSFT, UNDO ,CUT ,COPY,PASTE, , LEFT,RGHT,LCBR,RCBR,PLUS,PEQL, //|----+------+----+----+----+----| |----+----+----+----+----+----| , , , , ,LALT, , , , , , //`----+------+----+----+----+----' `----+----+----+----+----+----' @@ -98,9 +94,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_SYS] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , - //|----+----+----+----+----+----| |----+----+----+----+----+----| , , , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , //|----+----+----+----+----+----| |----+----+----+----+----+----| , , , , , , , , , , , , //|----+----+----+----+----+----| |----+----+----+----+----+----| @@ -121,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT_ortho_4x12( \ _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, GAME , _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) @@ -129,43 +125,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); } return false; break; case COLEMAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); + set_single_persistent_default_layer(_COLEMAK); } return false; break; - case DVORAK: + case GAME: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); + set_single_persistent_default_layer(_GAME); } return false; break; -- cgit v1.2.3 From e0c9f1d9b94f66f2cb8ddab0c041dbea24c87e0f Mon Sep 17 00:00:00 2001 From: TheOneTrueTrench <38593283+TheOneTrueTrench@users.noreply.github.com> Date: Thu, 6 Sep 2018 15:08:16 +0000 Subject: Keymap: Added new Marianas keymap for DZ60 (#3858) * Added new Marianas keymap for DZ60 * Included suggestions to remove unnecessary line regarding MODS_CTRL_MASK, and added names for layers. Added enum to define names for layers, and removed unused #DEFINE --- keyboards/dz60/keymaps/marianas/keymap.c | 71 ++++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 keyboards/dz60/keymaps/marianas/keymap.c diff --git a/keyboards/dz60/keymaps/marianas/keymap.c b/keyboards/dz60/keymaps/marianas/keymap.c new file mode 100644 index 0000000000..dfc83fb508 --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/keymap.c @@ -0,0 +1,71 @@ +#include QMK_KEYBOARD_H + +enum marianas_layers { + BASE, + NAV_CLUSTER, + RGB, + MOUSE, + GAMING, + FN_LAYER, + LAYER_SEL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE]= + LAYOUT( + KC_ESC, 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_NO, KC_BSPC, + 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, + MO(FN_LAYER), 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_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_LGUI, KC_NO, KC_APP, KC_RCTL), + + [NAV_CLUSTER]= + LAYOUT( + KC_TRNS, KC_PSCREEN, KC_SCROLLLOCK, KC_PAUSE, KC_INSERT, KC_HOME, KC_PGUP, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_UP, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, KC_TRNS, KC_TRNS), + + [RGB]= + LAYOUT( + KC_TRNS, RGB_TOG, RGB_MOD, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [MOUSE]= + LAYOUT( + KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [GAMING]= + LAYOUT( + KC_ESC, 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_NO, KC_BSPC, + 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_TRNS, 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_LSHIFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_NO, + KC_LCTL, KC_NO, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_NO, KC_NO, TO(BASE)), + + [FN_LAYER]= + LAYOUT( + KC_GRV, 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_TRNS, KC_DEL, + KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, KC_TRNS, + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, MO(LAYER_SEL), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, KC_TRNS, KC_MEH, KC_TRNS), + + [LAYER_SEL]= + LAYOUT( + TO(BASE), TO(NAV_CLUSTER), TO(RGB), TO(MOUSE), TO(GAMING), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + +}; -- cgit v1.2.3 From 7f7c278c3eef4739f2f0f99faa17f3467f8b534a Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 6 Sep 2018 15:49:13 -0400 Subject: Keyboard: Add support for Quefrency 65% right half (#3865) * Add support for Quefrency 65% right half * Add support for additional thumb key on Rev. 1.1 PCB --- keyboards/quefrency/keymaps/default/keymap.c | 4 +-- keyboards/quefrency/keymaps/default65/config.h | 27 ++++++++++++++++++++ keyboards/quefrency/keymaps/default65/keymap.c | 35 ++++++++++++++++++++++++++ keyboards/quefrency/keymaps/default65/rules.mk | 0 keyboards/quefrency/rev1/config.h | 6 ++--- keyboards/quefrency/rev1/rev1.h | 28 +++++++++++++++++++-- 6 files changed, 93 insertions(+), 7 deletions(-) create mode 100644 keyboards/quefrency/keymaps/default65/config.h create mode 100644 keyboards/quefrency/keymaps/default65/keymap.c create mode 100644 keyboards/quefrency/keymaps/default65/rules.mk diff --git a/keyboards/quefrency/keymaps/default/keymap.c b/keyboards/quefrency/keymaps/default/keymap.c index e6aba1a276..964a997dd9 100644 --- a/keyboards/quefrency/keymaps/default/keymap.c +++ b/keyboards/quefrency/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_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_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_BSPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), [_FN1] = LAYOUT( @@ -30,6 +30,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______,\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/quefrency/keymaps/default65/config.h b/keyboards/quefrency/keymaps/default65/config.h new file mode 100644 index 0000000000..f9efe78c5b --- /dev/null +++ b/keyboards/quefrency/keymaps/default65/config.h @@ -0,0 +1,27 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C diff --git a/keyboards/quefrency/keymaps/default65/keymap.c b/keyboards/quefrency/keymaps/default65/keymap.c new file mode 100644 index 0000000000..b660b5d86b --- /dev/null +++ b/keyboards/quefrency/keymaps/default65/keymap.c @@ -0,0 +1,35 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( + KC_GESC, 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_DEL, KC_BSPC, 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_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_HOME, \ + KC_LSFT, 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_END, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_FN1] = LAYOUT_65( + KC_GESC, 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_DEL, KC_BSPC, _______, \ + RGB_TOG, RGB_MOD, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_TILD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/quefrency/keymaps/default65/rules.mk b/keyboards/quefrency/keymaps/default65/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/quefrency/rev1/config.h b/keyboards/quefrency/rev1/config.h index 895ee03789..1074590ff5 100644 --- a/keyboards/quefrency/rev1/config.h +++ b/keyboards/quefrency/rev1/config.h @@ -26,15 +26,15 @@ along with this program. If not, see . #define DEVICE_VER 0x0100 #define MANUFACTURER Keebio #define PRODUCT Quefrency -#define DESCRIPTION Split 60 percent staggered keyboard +#define DESCRIPTION Split 60/65 percent staggered keyboard /* key matrix size */ // Rows are doubled-up -#define MATRIX_ROWS 10 +#define MATRIX_ROWS 12 #define MATRIX_COLS 8 // wiring of each half -#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4 } +#define MATRIX_ROW_PINS { F4, D4, D7, E6, B4, B5 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6, C6 } #define SPLIT_HAND_PIN D2 diff --git a/keyboards/quefrency/rev1/rev1.h b/keyboards/quefrency/rev1/rev1.h index 14e0f9bbf5..c7dcaa9fe3 100644 --- a/keyboards/quefrency/rev1/rev1.h +++ b/keyboards/quefrency/rev1/rev1.h @@ -18,7 +18,7 @@ LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, \ LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, \ LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, \ - LE1, LE2, LE3, LE5, LE7, RE1, RE4, RE5, RE6, RE7, RE8 \ + LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8 \ ) \ { \ { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ @@ -26,9 +26,33 @@ { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ { RC1, RC2, RC3, RC4, RC5, RC6, KC_NO, RC8 }, \ { RD1, RD2, RD3, RD4, KC_NO, RD6, RD7, RD8 }, \ - { RE1, KC_NO, KC_NO, RE4, RE5, RE6, RE7, RE8 } \ + { RE1, RE2, KC_NO, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ + } + +#define LAYOUT_65( \ + LA1, LA2, LA3, LA4, LA5, LA6, LA7, RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8, RA9, \ + LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8, RB9, \ + LC1, LC2, LC3, LC4, LC5, LC6, RC1, RC2, RC3, RC4, RC5, RC6, RC8, RC9, \ + LD1, LD3, LD4, LD5, LD6, LD7, RD1, RD2, RD3, RD4, RD6, RD7, RD8, RD9, \ + LE1, LE2, LE3, LE5, LE7, RE1, RE2, RE4, RE5, RE6, RE7, RE8, RE9 \ + ) \ + { \ + { LA1, LA2, LA3, LA4, LA5, LA6, LA7, KC_NO }, \ + { LB1, LB2, LB3, LB4, LB5, LB6, KC_NO, KC_NO }, \ + { LC1, LC2, LC3, LC4, LC5, LC6, KC_NO, KC_NO }, \ + { LD1, KC_NO, LD3, LD4, LD5, LD6, LD7, KC_NO }, \ + { LE1, LE2, LE3, KC_NO, LE5, KC_NO, LE7, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { RA1, RA2, RA3, RA4, RA5, RA6, RA7, RA8 }, \ + { RB1, RB2, RB3, RB4, RB5, RB6, RB7, RB8 }, \ + { RC1, RC2, RC3, RC4, RC5, RC6, RC9, RC8 }, \ + { RD1, RD2, RD3, RD4, RD9, RD6, RD7, RD8 }, \ + { RE1, RE2, RE9, RE4, RE5, RE6, RE7, RE8 }, \ + { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RA9, RB9 } \ } -- cgit v1.2.3 From e68c8f2ac6cb2db1192591059c91bc6757ccbe47 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 7 Sep 2018 17:22:12 -0400 Subject: Keyboard: CTRL LED scan code mapping fix (#3867) * CTRL LED scan code mapping fix Fixed scan codes to properly align with key wiring * Update scan codes for caps and scroll lock lighting Update scan codes for caps and scroll lock lighting according to previous scan code mapping update --- keyboards/massdrop/ctrl/config_led.h | 162 +++++++++++++++++------------------ 1 file changed, 81 insertions(+), 81 deletions(-) diff --git a/keyboards/massdrop/ctrl/config_led.h b/keyboards/massdrop/ctrl/config_led.h index 65563daa3d..471ab7007d 100644 --- a/keyboards/massdrop/ctrl/config_led.h +++ b/keyboards/massdrop/ctrl/config_led.h @@ -66,85 +66,85 @@ along with this program. If not, see . { .id = 6, .x = 4.875, .y = 0, .adr = { .drv = 2, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 5 }, \ { .id = 7, .x = 5.625, .y = 0, .adr = { .drv = 2, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 6 }, \ { .id = 8, .x = 6.375, .y = 0, .adr = { .drv = 1, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 7 }, \ - { .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 90 }, \ - { .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 91 }, \ - { .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 92 }, \ - { .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 93 }, \ - { .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 94 }, \ - { .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 95 }, \ - { .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 96 }, \ - { .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 97 }, \ - { .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \ - { .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 16 }, \ - { .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 17 }, \ - { .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 18 }, \ - { .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 19 }, \ - { .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 20 }, \ - { .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 21 }, \ - { .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 22 }, \ - { .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 105 }, \ - { .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 106 }, \ - { .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 107 }, \ - { .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 108 }, \ - { .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 109 }, \ - { .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 110 }, \ - { .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 111 }, \ - { .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 112 }, \ - { .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 142 }, \ - { .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \ - { .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ - { .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 32 }, \ - { .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 33 }, \ - { .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 34 }, \ - { .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 35 }, \ - { .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 36 }, \ - { .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 37 }, \ - { .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 120 }, \ - { .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 121 }, \ - { .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 122 }, \ - { .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 123 }, \ - { .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 124 }, \ - { .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 125 }, \ - { .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 126 }, \ - { .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 127 }, \ - { .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 141 }, \ - { .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \ - { .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \ - { .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 47 }, \ - { .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 48 }, \ - { .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 49 }, \ - { .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \ - { .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 51 }, \ - { .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 52 }, \ - { .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 135 }, \ - { .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 136 }, \ - { .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 137 }, \ - { .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 138 }, \ - { .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 139 }, \ - { .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 60 }, \ - { .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 61 }, \ - { .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \ - { .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 63 }, \ - { .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 64 }, \ - { .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 65 }, \ - { .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 66 }, \ - { .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 67 }, \ - { .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 150 }, \ - { .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 151 }, \ - { .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 152 }, \ - { .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 153 }, \ - { .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 140 }, \ - { .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \ - { .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 76 }, \ - { .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \ - { .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 78 }, \ - { .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 79 }, \ - { .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 80 }, \ - { .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 81 }, \ - { .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 82 }, \ - { .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 154 }, \ - { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 155 }, \ - { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 156 }, \ + { .id = 9, .x = 7.125, .y = 0, .adr = { .drv = 1, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 48 }, \ + { .id = 10, .x = 8.25, .y = 0, .adr = { .drv = 1, .cs = 3, .swr = 5, .swg = 4, .swb = 6 }, .scan = 49 }, \ + { .id = 11, .x = 9, .y = 0, .adr = { .drv = 1, .cs = 4, .swr = 5, .swg = 4, .swb = 6 }, .scan = 50 }, \ + { .id = 12, .x = 9.75, .y = 0, .adr = { .drv = 1, .cs = 5, .swr = 5, .swg = 4, .swb = 6 }, .scan = 51 }, \ + { .id = 13, .x = 10.5, .y = 0, .adr = { .drv = 1, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 52 }, \ + { .id = 14, .x = 11.625, .y = 0, .adr = { .drv = 1, .cs = 7, .swr = 5, .swg = 4, .swb = 6 }, .scan = 53 }, \ + { .id = 15, .x = 12.375, .y = 0, .adr = { .drv = 1, .cs = 8, .swr = 5, .swg = 4, .swb = 6 }, .scan = 54 }, \ + { .id = 16, .x = 13.125, .y = 0, .adr = { .drv = 1, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 55 }, \ + { .id = 17, .x = 0, .y = -1.125, .adr = { .drv = 2, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 8 }, \ + { .id = 18, .x = 0.75, .y = -1.125, .adr = { .drv = 2, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 9 }, \ + { .id = 19, .x = 1.5, .y = -1.125, .adr = { .drv = 2, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 10 }, \ + { .id = 20, .x = 2.25, .y = -1.125, .adr = { .drv = 2, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 11 }, \ + { .id = 21, .x = 3, .y = -1.125, .adr = { .drv = 2, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 12 }, \ + { .id = 22, .x = 3.75, .y = -1.125, .adr = { .drv = 2, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 13 }, \ + { .id = 23, .x = 4.5, .y = -1.125, .adr = { .drv = 2, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 14 }, \ + { .id = 24, .x = 5.25, .y = -1.125, .adr = { .drv = 2, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 15 }, \ + { .id = 25, .x = 6, .y = -1.125, .adr = { .drv = 1, .cs = 1, .swr = 8, .swg = 7, .swb = 9 }, .scan = 56 }, \ + { .id = 26, .x = 6.75, .y = -1.125, .adr = { .drv = 1, .cs = 2, .swr = 8, .swg = 7, .swb = 9 }, .scan = 57 }, \ + { .id = 27, .x = 7.5, .y = -1.125, .adr = { .drv = 1, .cs = 3, .swr = 8, .swg = 7, .swb = 9 }, .scan = 58 }, \ + { .id = 28, .x = 8.25, .y = -1.125, .adr = { .drv = 1, .cs = 4, .swr = 8, .swg = 7, .swb = 9 }, .scan = 59 }, \ + { .id = 29, .x = 9, .y = -1.125, .adr = { .drv = 1, .cs = 5, .swr = 8, .swg = 7, .swb = 9 }, .scan = 60 }, \ + { .id = 30, .x = 10.125, .y = -1.125, .adr = { .drv = 1, .cs = 6, .swr = 8, .swg = 7, .swb = 9 }, .scan = 61 }, \ + { .id = 31, .x = 11.625, .y = -1.125, .adr = { .drv = 1, .cs = 7, .swr = 8, .swg = 7, .swb = 9 }, .scan = 62 }, \ + { .id = 32, .x = 12.375, .y = -1.125, .adr = { .drv = 1, .cs = 8, .swr = 8, .swg = 7, .swb = 9 }, .scan = 63 }, \ + { .id = 33, .x = 13.125, .y = -1.125, .adr = { .drv = 1, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 79 }, \ + { .id = 34, .x = 0.188, .y = -1.875, .adr = { .drv = 2, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 16 }, \ + { .id = 35, .x = 1.125, .y = -1.875, .adr = { .drv = 2, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 17 }, \ + { .id = 36, .x = 1.875, .y = -1.875, .adr = { .drv = 2, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 18 }, \ + { .id = 37, .x = 2.625, .y = -1.875, .adr = { .drv = 2, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 19 }, \ + { .id = 38, .x = 3.375, .y = -1.875, .adr = { .drv = 2, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 20 }, \ + { .id = 39, .x = 4.125, .y = -1.875, .adr = { .drv = 2, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 21 }, \ + { .id = 40, .x = 4.875, .y = -1.875, .adr = { .drv = 2, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 22 }, \ + { .id = 41, .x = 5.625, .y = -1.875, .adr = { .drv = 2, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 23 }, \ + { .id = 42, .x = 6.375, .y = -1.875, .adr = { .drv = 1, .cs = 1, .swr = 11, .swg = 10, .swb = 12 }, .scan = 64 }, \ + { .id = 43, .x = 7.125, .y = -1.875, .adr = { .drv = 1, .cs = 2, .swr = 11, .swg = 10, .swb = 12 }, .scan = 65 }, \ + { .id = 44, .x = 7.875, .y = -1.875, .adr = { .drv = 1, .cs = 3, .swr = 11, .swg = 10, .swb = 12 }, .scan = 66 }, \ + { .id = 45, .x = 8.625, .y = -1.875, .adr = { .drv = 1, .cs = 4, .swr = 11, .swg = 10, .swb = 12 }, .scan = 67 }, \ + { .id = 46, .x = 9.375, .y = -1.875, .adr = { .drv = 1, .cs = 5, .swr = 11, .swg = 10, .swb = 12 }, .scan = 68 }, \ + { .id = 47, .x = 10.312, .y = -1.875, .adr = { .drv = 1, .cs = 6, .swr = 11, .swg = 10, .swb = 12 }, .scan = 69 }, \ + { .id = 48, .x = 11.625, .y = -1.875, .adr = { .drv = 1, .cs = 7, .swr = 11, .swg = 10, .swb = 12 }, .scan = 70 }, \ + { .id = 49, .x = 12.375, .y = -1.875, .adr = { .drv = 1, .cs = 8, .swr = 11, .swg = 10, .swb = 12 }, .scan = 71 }, \ + { .id = 50, .x = 13.125, .y = -1.875, .adr = { .drv = 1, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 78 }, \ + { .id = 51, .x = 0.281, .y = -2.625, .adr = { .drv = 2, .cs = 1, .swr = 5, .swg = 4, .swb = 6 }, .scan = 24 }, \ + { .id = 52, .x = 1.313, .y = -2.625, .adr = { .drv = 2, .cs = 2, .swr = 5, .swg = 4, .swb = 6 }, .scan = 25 }, \ + { .id = 53, .x = 2.063, .y = -2.625, .adr = { .drv = 2, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 26 }, \ + { .id = 54, .x = 2.812, .y = -2.625, .adr = { .drv = 2, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 27 }, \ + { .id = 55, .x = 3.562, .y = -2.625, .adr = { .drv = 2, .cs = 11, .swr = 11, .swg = 10, .swb = 12 }, .scan = 28 }, \ + { .id = 56, .x = 4.312, .y = -2.625, .adr = { .drv = 2, .cs = 6, .swr = 5, .swg = 4, .swb = 6 }, .scan = 29 }, \ + { .id = 57, .x = 5.062, .y = -2.625, .adr = { .drv = 2, .cs = 10, .swr = 11, .swg = 10, .swb = 12 }, .scan = 30 }, \ + { .id = 58, .x = 5.812, .y = -2.625, .adr = { .drv = 2, .cs = 9, .swr = 11, .swg = 10, .swb = 12 }, .scan = 31 }, \ + { .id = 59, .x = 6.562, .y = -2.625, .adr = { .drv = 1, .cs = 16, .swr = 11, .swg = 10, .swb = 12 }, .scan = 72 }, \ + { .id = 60, .x = 7.312, .y = -2.625, .adr = { .drv = 1, .cs = 15, .swr = 11, .swg = 10, .swb = 12 }, .scan = 73 }, \ + { .id = 61, .x = 8.062, .y = -2.625, .adr = { .drv = 1, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 74 }, \ + { .id = 62, .x = 8.812, .y = -2.625, .adr = { .drv = 1, .cs = 13, .swr = 11, .swg = 10, .swb = 12 }, .scan = 75 }, \ + { .id = 63, .x = 10.031, .y = -2.625, .adr = { .drv = 1, .cs = 12, .swr = 11, .swg = 10, .swb = 12 }, .scan = 76 }, \ + { .id = 64, .x = 0.469, .y = -3.375, .adr = { .drv = 2, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 32 }, \ + { .id = 65, .x = 1.688, .y = -3.375, .adr = { .drv = 2, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 33 }, \ + { .id = 66, .x = 2.438, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 34 }, \ + { .id = 67, .x = 3.188, .y = -3.375, .adr = { .drv = 2, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 35 }, \ + { .id = 68, .x = 3.938, .y = -3.375, .adr = { .drv = 2, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 36 }, \ + { .id = 69, .x = 4.688, .y = -3.375, .adr = { .drv = 2, .cs = 10, .swr = 5, .swg = 4, .swb = 6 }, .scan = 37 }, \ + { .id = 70, .x = 5.438, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 5, .swg = 4, .swb = 6 }, .scan = 38 }, \ + { .id = 71, .x = 6.188, .y = -3.375, .adr = { .drv = 2, .cs = 9, .swr = 8, .swg = 7, .swb = 9 }, .scan = 39 }, \ + { .id = 72, .x = 6.938, .y = -3.375, .adr = { .drv = 1, .cs = 16, .swr = 8, .swg = 7, .swb = 9 }, .scan = 80 }, \ + { .id = 73, .x = 7.688, .y = -3.375, .adr = { .drv = 1, .cs = 15, .swr = 8, .swg = 7, .swb = 9 }, .scan = 81 }, \ + { .id = 74, .x = 8.438, .y = -3.375, .adr = { .drv = 1, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 82 }, \ + { .id = 75, .x = 9.844, .y = -3.375, .adr = { .drv = 1, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 83 }, \ + { .id = 76, .x = 12.375, .y = -3.375, .adr = { .drv = 1, .cs = 11, .swr = 8, .swg = 7, .swb = 9 }, .scan = 77 }, \ + { .id = 77, .x = 0.094, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 11, .swg = 10, .swb = 12 }, .scan = 40 }, \ + { .id = 78, .x = 1.031, .y = -4.125, .adr = { .drv = 2, .cs = 14, .swr = 8, .swg = 7, .swb = 9 }, .scan = 41 }, \ + { .id = 79, .x = 1.969, .y = -4.125, .adr = { .drv = 2, .cs = 13, .swr = 8, .swg = 7, .swb = 9 }, .scan = 42 }, \ + { .id = 80, .x = 4.781, .y = -4.125, .adr = { .drv = 2, .cs = 10, .swr = 8, .swg = 7, .swb = 9 }, .scan = 43 }, \ + { .id = 81, .x = 7.594, .y = -4.125, .adr = { .drv = 1, .cs = 16, .swr = 5, .swg = 4, .swb = 6 }, .scan = 44 }, \ + { .id = 82, .x = 8.531, .y = -4.125, .adr = { .drv = 1, .cs = 15, .swr = 5, .swg = 4, .swb = 6 }, .scan = 45 }, \ + { .id = 83, .x = 9.469, .y = -4.125, .adr = { .drv = 1, .cs = 14, .swr = 5, .swg = 4, .swb = 6 }, .scan = 46 }, \ + { .id = 84, .x = 10.406, .y = -4.125, .adr = { .drv = 1, .cs = 13, .swr = 5, .swg = 4, .swb = 6 }, .scan = 47 }, \ + { .id = 85, .x = 11.625, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 8, .swg = 7, .swb = 9 }, .scan = 84 }, \ + { .id = 86, .x = 12.375, .y = -4.125, .adr = { .drv = 1, .cs = 12, .swr = 5, .swg = 4, .swb = 6 }, .scan = 85 }, \ + { .id = 87, .x = 13.125, .y = -4.125, .adr = { .drv = 1, .cs = 11, .swr = 5, .swg = 4, .swb = 6 }, .scan = 86 }, \ { .id = 88, .x = 13.433, .y = -4.43, .adr = { .drv = 1, .cs = 11, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ { .id = 89, .x = 12.285, .y = -4.535, .adr = { .drv = 1, .cs = 12, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ { .id = 90, .x = 11.14, .y = -4.535, .adr = { .drv = 1, .cs = 13, .swr = 2, .swg = 1, .swb = 3 }, .scan = 255 }, \ @@ -182,8 +182,8 @@ along with this program. If not, see . #define USB_LED_INDICATOR_ENABLE //Comment out to disable indicator functionality #ifdef USB_LED_INDICATOR_ENABLE //Scan codes refer to actual key matrix codes, not KC_* (255 to disable) #define USB_LED_NUM_LOCK_SCANCODE 255 - #define USB_LED_CAPS_LOCK_SCANCODE 45 - #define USB_LED_SCROLL_LOCK_SCANCODE 96 + #define USB_LED_CAPS_LOCK_SCANCODE 24 + #define USB_LED_SCROLL_LOCK_SCANCODE 54 #define USB_LED_COMPOSE_SCANCODE 255 #define USB_LED_KANA_SCANCODE 255 #endif //USB_LED_INDICATOR_ENABLE -- cgit v1.2.3 From 17fffc3a51f0a1abb1576de2badb67303165e0ae Mon Sep 17 00:00:00 2001 From: Josh Date: Sun, 9 Sep 2018 22:09:53 -0400 Subject: Keymap: Initial PR for contributing my ortho_4x12 community layout. (#3853) * Initial keymap with no BL and with Ctrl and Enter on the home row. * Removing alternative layouts (Dvorak etc.). * Putting Enter back in the default position, moving Esc next to Alt. * Replacing grave with del. * Adding a numpad layer. * Adding operators and a triple zero to the numpad layer. * Swapping Alt and Win. * Updating to use new audio macros. * Removing numpad layer and changing left space to MOD_HYPR on hold. * Adding configurable 'clicky keys' feature. * Cleaning up clicky conditional logic. * Turning on backlight support and mapping backlight keys in the adjust layer. * Enabling backlight functionality. * Adding Adventure time theme song; increasing fake clicky randomness. * Cleaning up layer constants in my Planck keymap. * Initial implementation of porting my Planck keymap to a Let's Split. * Updating keyboards/planck/keymaps/josh to use declarations from new work on master. * Updating keyboards/lets_split/keymaps/josh to use declarations from new work on master. * Work in progress migrating Planck and Let's Split keymaps to a community keymap. Everything is working but Planck backlight. * Fixing rules.mk to enable backlight & audio correctly on Planck PCBs. Cleanup. * Tweaks to get Let's Split working with my community layout. * Switching to use EE_HANDS in my Let's Split build. * Adding vitamins_included makefile options to my ortho_4x12 layout. * Fixing planck/rev6 build -- backlight must be disabled. * Removing I2C from my rules.mk and addressing it in the config.h instead. * Moving community layout directory to my reddit username. :D * Adding a test encoder function; making lower left a media key and moving esc to a mod tap on ctrl. * Commenting out -flto in the compiler flags for the vitamins_included keyboard (couldn't figure out how else to turn it off). * Changing rotary encoder to control media volume. * Changing backlight and clicky defaults to max brightness no breathing and a low pitch click. * Initial implementation of backlight flickering. * Updating my README.md * Adding LINK_TIME_OPTIMIZATION to the vitamins_included/rev1 as a rules.mk feature. * Reverting keyboards/vitamins_included/rules.mk to master and using 'filter_out' in my layout instead. * Adding tested boards to the readme for my layout. * Per drashna, removing redundant clicky implementation and cleaning up headers. * Removing an extra include from my keymap. --- layouts/community/ortho_4x12/mindsound/config.h | 33 ++++ layouts/community/ortho_4x12/mindsound/flicker.h | 5 + layouts/community/ortho_4x12/mindsound/keymap.c | 230 +++++++++++++++++++++++ layouts/community/ortho_4x12/mindsound/readme.md | 19 ++ layouts/community/ortho_4x12/mindsound/rules.mk | 26 +++ 5 files changed, 313 insertions(+) create mode 100644 layouts/community/ortho_4x12/mindsound/config.h create mode 100644 layouts/community/ortho_4x12/mindsound/flicker.h create mode 100644 layouts/community/ortho_4x12/mindsound/keymap.c create mode 100644 layouts/community/ortho_4x12/mindsound/readme.md create mode 100644 layouts/community/ortho_4x12/mindsound/rules.mk diff --git a/layouts/community/ortho_4x12/mindsound/config.h b/layouts/community/ortho_4x12/mindsound/config.h new file mode 100644 index 0000000000..76e7da2049 --- /dev/null +++ b/layouts/community/ortho_4x12/mindsound/config.h @@ -0,0 +1,33 @@ +#pragma once + +#define ADVENTURE_TIME \ + H__NOTE(_F5), \ + Q__NOTE(_F5), \ + H__NOTE(_F5), \ + H__NOTE(_G5), \ + H__NOTE(_E5), \ + H__NOTE(_E5), \ + H__NOTE(_D5), \ + H__NOTE(_C5), \ + HD_NOTE(_C6), + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(ADVENTURE_TIME) + #define AUDIO_CLICKY + #define AUDIO_CLICKY_ON + #define AUDIO_CLICKY_FREQ_MAX 2500.0f + #define AUDIO_CLICKY_FREQ_RANDOMNESS 0.2f + #define AUDIO_CLICKY_FREQ_DEFAULT 110.0f +#endif + +// for some reason the LSvi rev1 disables action tapping... +#ifdef NO_ACTION_TAPPING + #undef NO_ACTION_TAPPING +#endif + +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 15 + +// let's split configuration: +#define USE_I2C +#define EE_HANDS diff --git a/layouts/community/ortho_4x12/mindsound/flicker.h b/layouts/community/ortho_4x12/mindsound/flicker.h new file mode 100644 index 0000000000..a982f19aed --- /dev/null +++ b/layouts/community/ortho_4x12/mindsound/flicker.h @@ -0,0 +1,5 @@ +#pragma once + +void flicker_toggle(void); +void flicker_keydown(void); +void flicker_keyup(void); diff --git a/layouts/community/ortho_4x12/mindsound/keymap.c b/layouts/community/ortho_4x12/mindsound/keymap.c new file mode 100644 index 0000000000..2c9ceaf690 --- /dev/null +++ b/layouts/community/ortho_4x12/mindsound/keymap.c @@ -0,0 +1,230 @@ +#include QMK_KEYBOARD_H + +#ifdef BACKLIGHT_ENABLE +#include "flicker.h" +#endif + +extern keymap_config_t keymap_config; + +// 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. + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +// keycodes custom to this keymap: +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BL_FLICKER +}; + +// flicker state: +#ifdef BACKLIGHT_ENABLE +bool flicker_enable = true; +bool flicker_isdown = false; +const uint8_t flicker_min_levels = 2; +const uint8_t flicker_max_levels = 7; +uint8_t flicker_restore_level = 0; +#endif + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// mod tap definitions: +#define CTRL_ESC MT(MOD_LCTL, KC_ESC) +#define HYPR_SPC MT(MOD_HYPR, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Del | GUI | Alt |Lower |HyprSp|Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + CTRL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_MPLY, KC_DEL, KC_LGUI, KC_LALT, LOWER, HYPR_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Clicky|ClkDn |ClkUp |ClkRst| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_TOGG, BL_DEC, BL_INC, BL_FLICKER, \ + _______, _______, _______, _______, _______, _______, _______, _______, CLICKY_TOGGLE, CLICKY_DOWN, CLICKY_UP, CLICKY_RESET \ +), + +}; // end keymaps + +// if backlighting is enabled, configure it on boot +#ifdef BACKLIGHT_ENABLE +void matrix_init_user(void) { + // set to max + backlight_level(BACKLIGHT_LEVELS); + flicker_restore_level = get_backlight_level(); + + // if breathing happens to be compiled in, turn it off +#ifdef BACKLIGHT_BREATHING + breathing_disable(); +#endif +} +#endif + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + return MACRO_NONE; +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + // handle the _ADJUST layer and custom keycodes: + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; +#ifdef BACKLIGHT_ENABLE + case BL_FLICKER: + if (record->event.pressed) { + flicker_toggle(); + } + return false; + break; +#endif + } // end switch case over custom keycodes + +#ifdef BACKLIGHT_ENABLE + if (flicker_enable) { + if (record->event.pressed) { + flicker_keydown(); + } else { + flicker_keyup(); + } + } +#endif + + return true; +} + +void encoder_update(bool clockwise) { + if (clockwise) { + register_code(KC_VOLU); + unregister_code(KC_VOLU); + } else { + register_code(KC_VOLD); + unregister_code(KC_VOLD); + } +} + +// flicker implementation: +#ifdef BACKLIGHT_ENABLE +void flicker_toggle(void) { + flicker_enable = !flicker_enable; +} + +void flicker_keydown(void) { + // guard condition: only set the level to restore if the flicker is NOT already down + if (!flicker_isdown) { + flicker_restore_level = get_backlight_level(); + flicker_isdown = true; + } + + // calculate a random flicker level between min and max + uint8_t flicker_level = (rand() % (flicker_max_levels - flicker_min_levels)) + flicker_min_levels; + uint8_t level_to_set = flicker_level <= flicker_restore_level ? flicker_restore_level - flicker_level : 0; + backlight_level(level_to_set); +} + +void flicker_keyup(void) { + backlight_level(flicker_restore_level); + flicker_isdown = false; +} +#endif diff --git a/layouts/community/ortho_4x12/mindsound/readme.md b/layouts/community/ortho_4x12/mindsound/readme.md new file mode 100644 index 0000000000..e9db480494 --- /dev/null +++ b/layouts/community/ortho_4x12/mindsound/readme.md @@ -0,0 +1,19 @@ +# Josh's 4x12 layout + +Notable features: + +* Esc is Ctrl on hold +* Left space is `MOD_HYPER` on hold +* Backspace is still backspace on `RAISE` and `LOWER` +* Faux clicky controls are on the arrow keys on the `ADJUST` layer, and the backlight controls are directly above that +* Backlight breathing is disabled; backlight flickering is implemented instead +* Colemak and other layouts are thoroughly disabled +* Rotary encoder controls media volume on base layer + +This layout has been tested on: + +* Let's Split (rev 2) +* Let's Split Vitamins Included (rev 1) +* Planck (rev 4) + +It builds for the Planck rev 6 but has not been tested yet. diff --git a/layouts/community/ortho_4x12/mindsound/rules.mk b/layouts/community/ortho_4x12/mindsound/rules.mk new file mode 100644 index 0000000000..c01a1ddb58 --- /dev/null +++ b/layouts/community/ortho_4x12/mindsound/rules.mk @@ -0,0 +1,26 @@ +# none of my keyboards need LTO and it screws up I2C on my LSVI: +EXTRAFLAGS:=$(filter-out -flto,$(EXTRAFLAGS)) + +# turning off backlighting and audio for the split keebs +ifneq (,$(findstring lets_split,$(KEYBOARD))) + BACKLIGHT_ENABLE = no + BACKLIGHT_BREATHING = no + AUDIO_ENABLE = no +endif +ifneq (,$(findstring vitamins_included,$(KEYBOARD))) + BACKLIGHT_ENABLE = no + BACKLIGHT_BREATHING = no + AUDIO_ENABLE = no +endif + +# both my plancks use audio but only the rev4 has backlighting +ifneq (,$(findstring planck,$(KEYBOARD))) + ifneq (,$(findstring rev4,$(KEYBOARD))) + BACKLIGHT_ENABLE = yes + BACKLIGHT_BREATHING = no + else + BACKLIGHT_ENABLE = no + BACKLIGHT_BREATHING = no + endif + AUDIO_ENABLE = yes +endif -- cgit v1.2.3 From 93b5c98fbbceb6648e1dc562c375f224d626aab5 Mon Sep 17 00:00:00 2001 From: Yasuhiro Shimizu Date: Mon, 10 Sep 2018 11:23:24 +0900 Subject: Keymap: remove unnecessary readme from my helix keymap (#3860) --- keyboards/helix/rev2/keymaps/yshrsmz/readme.md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 keyboards/helix/rev2/keymaps/yshrsmz/readme.md diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/readme.md b/keyboards/helix/rev2/keymaps/yshrsmz/readme.md deleted file mode 100644 index 02888855b8..0000000000 --- a/keyboards/helix/rev2/keymaps/yshrsmz/readme.md +++ /dev/null @@ -1,25 +0,0 @@ -SSD1306 OLED Display via I2C -====== - -Features --------- - -Some features supported by the firmware: - - -* I2C connection between the two halves is required as the OLED display will use this connection as well. Note this - requires pull-up resistors on the data and clock lines. -* OLED display will connect from either side - - -Wiring ------- - - -Work in progress... - - -OLED Configuration -------------------------------- - -Work in progress... -- cgit v1.2.3 From 38c916a3686bfd1af762a1de4ccdaf7eb1123f2e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 9 Sep 2018 19:33:30 -0700 Subject: Keyboard: Updated readmes for 1upkeyboards (#3864) Corrected the make examples by adding the parent directory. Updated the QMK Docs links for the build environment setup and the make instructions. Added links to the Newbs Guide. --- keyboards/1upkeyboards/1up60hse/readme.md | 4 ++-- keyboards/1upkeyboards/1up60rgb/readme.md | 4 ++-- keyboards/1upkeyboards/sweet16/readme.md | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/1upkeyboards/1up60hse/readme.md b/keyboards/1upkeyboards/1up60hse/readme.md index 5ea040bf4a..2865768b60 100644 --- a/keyboards/1upkeyboards/1up60hse/readme.md +++ b/keyboards/1upkeyboards/1up60hse/readme.md @@ -10,6 +10,6 @@ Hardware Availability: [1upkeyboards.com](https://www.1upkeyboards.com/shop/cont Make example for this keyboard (after setting up your build environment): - make 1up60hse:default + make 1upkeyboards/1up60hse:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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/1upkeyboards/1up60rgb/readme.md b/keyboards/1upkeyboards/1up60rgb/readme.md index a16ab7ea86..de3ad98b73 100644 --- a/keyboards/1upkeyboards/1up60rgb/readme.md +++ b/keyboards/1upkeyboards/1up60rgb/readme.md @@ -8,6 +8,6 @@ Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controll Make example for this keyboard (after setting up your build environment): - make 1up60rgb:default + make 1upkeyboards/1up60rgb:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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/1upkeyboards/sweet16/readme.md b/keyboards/1upkeyboards/sweet16/readme.md index 435aed68cd..3b7b1d6f0b 100644 --- a/keyboards/1upkeyboards/sweet16/readme.md +++ b/keyboards/1upkeyboards/sweet16/readme.md @@ -9,6 +9,6 @@ Hardware Availability: [1up Keyboards](https://1upkeyboards.com/) Make example for this keyboard (after setting up your build environment): - make sweet16:default + make 1upkeyboards/sweet16:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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). -- cgit v1.2.3 From 3dbdfbd99a9efd12275abdcdcf2abe843e300f6b Mon Sep 17 00:00:00 2001 From: Danny Date: Sun, 9 Sep 2018 22:42:46 -0400 Subject: Add support for a different pinout on Split boards (#3869) * Add support for a different pinout for the right half of a split keyboard (number of cols/rows still has to be the same) --- quantum/split_common/matrix.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 4af90209f6..3d2983f2ef 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -71,8 +71,8 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static uint8_t error_count = 0; -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -137,6 +137,21 @@ void matrix_init(void) debug_enable = true; debug_matrix = true; debug_mouse = true; + + // Set pinout for right half if pinout for that half is defined + if (!isLeftHand) { +#ifdef MATRIX_ROW_PINS_RIGHT + const uint8_t row_pins_right[MATRIX_ROWS] = MATRIX_ROW_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_ROWS; i++) + row_pins[i] = row_pins_right[i]; +#endif +#ifdef MATRIX_COL_PINS_RIGHT + const uint8_t col_pins_right[MATRIX_COLS] = MATRIX_COL_PINS_RIGHT; + for (uint8_t i = 0; i < MATRIX_COLS; i++) + col_pins[i] = col_pins_right[i]; +#endif + } + // initialize row and col #if (DIODE_DIRECTION == COL2ROW) unselect_rows(); -- cgit v1.2.3 From 7b8e5d4555f524895721d2e8055a5e4ac866aeb5 Mon Sep 17 00:00:00 2001 From: Damien Date: Mon, 10 Sep 2018 04:43:45 +0200 Subject: Keymap: Updated my FC660C config (#3870) * - Fixed DK60 version in config.h * - Updated dk60 readme with new QMK rules * - Fixed wording in readme * Added dbroqua layout for DZ60 I've also updated dz60.h to add "true HHKD" keymap definition (6U spacebar). With the default HHKB definition r_alt was not mapped and when I pressed r_menu it was r_alt. Regards * Updated dbroqua layout for HHKB keyboard Added default configuration and alternate (swap gui/alt keys). Save user choice in keyboard memory (like plank, thanks for this feature!). * Added dbroqua layout for Iris keyboard * Updated layout and fixed includes * Added personal layout for FC660C * Inverted ESC & GRV --- keyboards/fc660c/keymaps/dbroqua/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/fc660c/keymaps/dbroqua/keymap.c b/keyboards/fc660c/keymaps/dbroqua/keymap.c index ef6f471aa4..62ef234c75 100644 --- a/keyboards/fc660c/keymaps/dbroqua/keymap.c +++ b/keyboards/fc660c/keymaps/dbroqua/keymap.c @@ -3,7 +3,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BASE layer: Default Layer * ,--------------------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | Ins | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | | Ins | * |-----------------------------------------------------------------------------------------+ +-----+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | | Del | * |-----------------------------------------------------------------------------------------+ +-----+ @@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------------------------------------------------------------´ */ [0] = LAYOUT( - KC_ESC, 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_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_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_LCTL,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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, KC_UP, @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* FN layer * ,--------------------------------------------------------------------------------------------------. - * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | + * | Esc| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | * |-----------------------------------------------------------------------------------------+ +-----+ * | | | | | | | | |PrtSc| Slck| Paus| | | | | | * |-----------------------------------------------------------------------------------------+ +-----+ @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------------------------------------------------------------´ */ [1] = LAYOUT( - KC_GRV, 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_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_VOLD,KC_VOLU,KC_MUTE,KC_EJCT,_______,_______,_______,KC_HOME,KC_PGUP,_______,_______, _______, _______,KC_MPRV,KC_MPLY,KC_MNXT,_______,_______,_______,_______,KC_END, KC_PGDN,_______,_______, _______, -- cgit v1.2.3 From fa1e674bbbb92f70e2baaea88d3c4c38e10aac72 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 9 Sep 2018 19:45:59 -0700 Subject: 65% and 68 key community layouts (#3872) * rename 68_ansi layout to 65_ansi layout * more renames and readme change * add company names * add community layouts for 68_ansi * add 68_ansi support for mf68 type boards * update readme --- keyboards/mf68/mf68.h | 4 ++-- keyboards/mf68/rules.mk | 2 ++ keyboards/mf68_ble/mf68_ble.h | 4 ++-- layouts/community/68_ansi/layout.json | 5 +++++ layouts/community/68_ansi/mechmerlin/keymap.c | 18 ++++++++++++++++++ layouts/community/68_ansi/mechmerlin/rules.mk | 1 + layouts/community/68_ansi/readme.md | 5 +++++ layouts/default/65_ansi/default_65_ansi/keymap.c | 11 +++++++++++ layouts/default/65_ansi/layout.json | 5 +++++ layouts/default/65_ansi/readme.md | 5 +++++ layouts/default/68_ansi/default_68_ansi/keymap.c | 8 ++++---- layouts/default/68_ansi/layout.json | 10 +++++----- layouts/default/68_ansi/readme.md | 4 +++- 13 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 layouts/community/68_ansi/layout.json create mode 100644 layouts/community/68_ansi/mechmerlin/keymap.c create mode 100644 layouts/community/68_ansi/mechmerlin/rules.mk create mode 100644 layouts/community/68_ansi/readme.md create mode 100644 layouts/default/65_ansi/default_65_ansi/keymap.c create mode 100644 layouts/default/65_ansi/layout.json create mode 100644 layouts/default/65_ansi/readme.md diff --git a/keyboards/mf68/mf68.h b/keyboards/mf68/mf68.h index a7aefc6479..a55c1d60b0 100644 --- a/keyboards/mf68/mf68.h +++ b/keyboards/mf68/mf68.h @@ -3,7 +3,7 @@ #include "quantum.h" -#define LAYOUT( \ +#define LAYOUT_68_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ @@ -26,7 +26,7 @@ K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT( \ +) LAYOUT_68_ansi( \ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ diff --git a/keyboards/mf68/rules.mk b/keyboards/mf68/rules.mk index a535a9d0e5..9f6445686d 100644 --- a/keyboards/mf68/rules.mk +++ b/keyboards/mf68/rules.mk @@ -64,3 +64,5 @@ MIDI_ENABLE ?= no # MIDI controls UNICODE_ENABLE ?= no # Unicode BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE ?= no # Audio output on port C6 + +LAYOUTS = 68_ansi \ No newline at end of file diff --git a/keyboards/mf68_ble/mf68_ble.h b/keyboards/mf68_ble/mf68_ble.h index fa17a93903..8ef14c98d4 100644 --- a/keyboards/mf68_ble/mf68_ble.h +++ b/keyboards/mf68_ble/mf68_ble.h @@ -3,7 +3,7 @@ #include "quantum.h" -#define LAYOUT( \ +#define LAYOUT_68_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ @@ -26,7 +26,7 @@ K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT( \ +) LAYOUT_68_ansi( \ KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ diff --git a/layouts/community/68_ansi/layout.json b/layouts/community/68_ansi/layout.json new file mode 100644 index 0000000000..f81ee0bcbf --- /dev/null +++ b/layouts/community/68_ansi/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},"",{x:0.25},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.5},"","",""] diff --git a/layouts/community/68_ansi/mechmerlin/keymap.c b/layouts/community/68_ansi/mechmerlin/keymap.c new file mode 100644 index 0000000000..5059bd7d83 --- /dev/null +++ b/layouts/community/68_ansi/mechmerlin/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H +#include "mechmerlin.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_68_ansi(\ + KC_GESC, 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_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_PGDN, + KC_CTCP, 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_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, MO(_FL), KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FL] = LAYOUT_68_ansi(\ + KC_GRV, 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_DEL, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; \ No newline at end of file diff --git a/layouts/community/68_ansi/mechmerlin/rules.mk b/layouts/community/68_ansi/mechmerlin/rules.mk new file mode 100644 index 0000000000..e2ce3d7731 --- /dev/null +++ b/layouts/community/68_ansi/mechmerlin/rules.mk @@ -0,0 +1 @@ +USER_NAME := mechmerlin \ No newline at end of file diff --git a/layouts/community/68_ansi/readme.md b/layouts/community/68_ansi/readme.md new file mode 100644 index 0000000000..2180973de8 --- /dev/null +++ b/layouts/community/68_ansi/readme.md @@ -0,0 +1,5 @@ +# 68_ansi + + LAYOUT_68_ansi + +This is the 68 key ANSI layout made popular by boards such as the Magicforce 68 and Varmilo VA68M. \ No newline at end of file diff --git a/layouts/default/65_ansi/default_65_ansi/keymap.c b/layouts/default/65_ansi/default_65_ansi/keymap.c new file mode 100644 index 0000000000..69fcccd632 --- /dev/null +++ b/layouts/default/65_ansi/default_65_ansi/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* layer 0: qwerty */ + [0] = LAYOUT_65_ansi(\ + 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) + }; \ No newline at end of file diff --git a/layouts/default/65_ansi/layout.json b/layouts/default/65_ansi/layout.json new file mode 100644 index 0000000000..0fa92b0f2e --- /dev/null +++ b/layouts/default/65_ansi/layout.json @@ -0,0 +1,5 @@ +["","","","","","","","","","","","","",{w:2},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] diff --git a/layouts/default/65_ansi/readme.md b/layouts/default/65_ansi/readme.md new file mode 100644 index 0000000000..0cde8e727e --- /dev/null +++ b/layouts/default/65_ansi/readme.md @@ -0,0 +1,5 @@ +# 65_ansi + + LAYOUT_65_ansi + +This is the 65% ANSI layout made popular by boards such as the [Input Club Whitefox](https://github.com/qmk/qmk_firmware/tree/master/keyboards/whitefox) and [RAMA M65-A](https://github.com/qmk/qmk_firmware/tree/master/keyboards/jc65). \ No newline at end of file diff --git a/layouts/default/68_ansi/default_68_ansi/keymap.c b/layouts/default/68_ansi/default_68_ansi/keymap.c index 59b0ea47d0..544f9c156a 100644 --- a/layouts/default/68_ansi/default_68_ansi/keymap.c +++ b/layouts/default/68_ansi/default_68_ansi/keymap.c @@ -3,9 +3,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* layer 0: qwerty */ [0] = LAYOUT_68_ansi(\ - 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_HOME, - 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_PGUP, - 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_PGDN, - KC_LSFT, 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_END, + 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_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_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_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, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT) }; \ No newline at end of file diff --git a/layouts/default/68_ansi/layout.json b/layouts/default/68_ansi/layout.json index 0fa92b0f2e..f81ee0bcbf 100644 --- a/layouts/default/68_ansi/layout.json +++ b/layouts/default/68_ansi/layout.json @@ -1,5 +1,5 @@ -["","","","","","","","","","","","","",{w:2},"",""], -[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",""], -[{w:1.75},"","","","","","","","","","","","",{w:2.25},"",""], -[{w:2.25},"","","","","","","","","","","",{w:1.75},"","",""], -[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"","","","","","",""] +[{a:7},"","","","","","","","","","","","","",{w:2},"",{x:0.25},"",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},"",{x:0.25},"",""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},"",{x:0.25},""], +[{w:1.25},"",{w:1.25},"",{w:1.25},"",{w:6.25},"",{w:1.25},"",{w:1.25},"",{w:1.25},"",{x:0.5},"","",""] diff --git a/layouts/default/68_ansi/readme.md b/layouts/default/68_ansi/readme.md index eab8f312b2..2180973de8 100644 --- a/layouts/default/68_ansi/readme.md +++ b/layouts/default/68_ansi/readme.md @@ -1,3 +1,5 @@ # 68_ansi - LAYOUT_68_ansi \ No newline at end of file + LAYOUT_68_ansi + +This is the 68 key ANSI layout made popular by boards such as the Magicforce 68 and Varmilo VA68M. \ No newline at end of file -- cgit v1.2.3 From 63852e7a683d1fb3634beb45a8a57da4ee7a34e9 Mon Sep 17 00:00:00 2001 From: sK0pe Date: Mon, 10 Sep 2018 10:47:14 +0800 Subject: Keymap: Adjusted keymaps for standardisation (#3874) * Added HHKB with 7U space bar There are backlight changers on the function Z, X and C, mediat controls have been removed. * Fixed the default layout and added a keymap GUI and ALT keys were swapped. My own keymap which adds calculator, removes power, removes eject. * Adjusted naming convention of hhkb layout layer Fixed as per required from code review. * Updated for qmk configurator I didn't realise that there was a new standardisation across all the keymaps to accommodate the configurator. Hopefully fixed now. --- keyboards/satan/keymaps/hhkb_7u/keymap.c | 56 ++++++++++++++++++++++ keyboards/satan/keymaps/hhkb_7u/readme.md | 9 ++++ .../tokyo60/keymaps/swappedBottomRow/config.h | 3 ++ .../tokyo60/keymaps/swappedBottomRow/keymap.c | 47 ++++++++++++++++++ 4 files changed, 115 insertions(+) create mode 100644 keyboards/satan/keymaps/hhkb_7u/keymap.c create mode 100644 keyboards/satan/keymaps/hhkb_7u/readme.md create mode 100644 keyboards/tokyo60/keymaps/swappedBottomRow/config.h create mode 100644 keyboards/tokyo60/keymaps/swappedBottomRow/keymap.c diff --git a/keyboards/satan/keymaps/hhkb_7u/keymap.c b/keyboards/satan/keymaps/hhkb_7u/keymap.c new file mode 100644 index 0000000000..b0bc48b455 --- /dev/null +++ b/keyboards/satan/keymaps/hhkb_7u/keymap.c @@ -0,0 +1,56 @@ +#include QMK_KEYBOARD_H +#include "action_layer.h" + +#define _DEFAULT 0 +#define _FN 1 + +enum planck_keycodes { + DEFAULT = SAFE_RANGE +}; + +// Fillers to make layering more clear +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty gui/alt/space/alt/gui + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | FN | + * |-----------------------------------------------------------------------------------------+ + * |LGUI | LAlt | 7U Space | RAlt |RGUI | + * `-----------------------------------------------------------------' + */ + [_DEFAULT] = LAYOUT_60_hhkb( /* Basic QWERTY */ + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), \ + ______, KC_LGUI,KC_LALT, KC_SPC, ______,KC_RALT, KC_RGUI, ______ \ + ), + +/* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------+ + * | CAPS | | | | | | | | Psc | Slck| Paus| Up | | | + * |-----------------------------------------------------------------------------------------+ + * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | + * |-----------------------------------------------------------------------------------------+ + * | | BL | BL- | BL+ | | | + | - | End |PgDn| Down| | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `-----------------------------------------------------------------' + */ + [_FN] = LAYOUT_60_hhkb( /* Layer 1 */ + ______, 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_INS, KC_DEL, \ + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, ______, \ + ______, KC_VOLD,KC_VOLU,KC_MUTE,______, ______, KC_PAST,KC_PSLS,KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, \ + ______, BL_DEC,BL_INC,BL_TOGG,______, ______, KC_PPLS,KC_PMNS,KC_END, KC_PGDN, KC_DOWN, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______ \ + ) +}; diff --git a/keyboards/satan/keymaps/hhkb_7u/readme.md b/keyboards/satan/keymaps/hhkb_7u/readme.md new file mode 100644 index 0000000000..39e71beedd --- /dev/null +++ b/keyboards/satan/keymaps/hhkb_7u/readme.md @@ -0,0 +1,9 @@ +# Dbroqua HHKB like Layout + +Like the HHKB but with a Satan GH60 PCB :D. + +# Programming Instructions: +Enter into programming mode and run the following command. +``` +$ sudo KEYMAP=dbroqua_hhkb make dfu +``` \ No newline at end of file diff --git a/keyboards/tokyo60/keymaps/swappedBottomRow/config.h b/keyboards/tokyo60/keymaps/swappedBottomRow/config.h new file mode 100644 index 0000000000..271f48d001 --- /dev/null +++ b/keyboards/tokyo60/keymaps/swappedBottomRow/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/tokyo60/keymaps/swappedBottomRow/keymap.c b/keyboards/tokyo60/keymaps/swappedBottomRow/keymap.c new file mode 100644 index 0000000000..54b68f5825 --- /dev/null +++ b/keyboards/tokyo60/keymaps/swappedBottomRow/keymap.c @@ -0,0 +1,47 @@ +#include QMK_KEYBOARD_H + +#define BL 0 +#define FN 1 +/* + * Default HHKB Layout + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Default layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ Esc │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │BkSpc│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Ctrl │ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │█████│Enter│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Shift│█████│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │█████│Shift│ Fn │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│█████│ Gui │ Alt │█████│█████│Space│█████│█████│█████│█████│█████│ Alt │ Gui │█████│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ +[BL] = LAYOUT_60_hhkb( + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(FN), \ + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI ), + /* 1: HHKB Fn layer +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ Ins │ Del │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│Caps │ RGB │RGBfw│RGBrv│BLtog│BLstp│ │ │ Psc │ Slk │ Pus │ Up │ │ │█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ VoD │ VoU │ Mut │ │ │NP_* │NP_/ │Home │PgUp │Left │Right│█████│NPEnt│█████│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │█████│ │ │Calc │ │ │NP_+ │NP_- │ End │PgDwn│Down │█████│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│█████│ │ │█████│█████│█████│ │█████│█████│█████│█████│ │ │█████│█████│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + */ +[FN]= LAYOUT_60_hhkb( + KC_TRNS, 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_INS, KC_DEL, \ + KC_CAPS, RGB_TOG, RGB_MOD, RGB_RMOD, BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_PENT, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), +}; -- cgit v1.2.3 From 7d8f680b507ab16fdb1172a01a72a601694ba20a Mon Sep 17 00:00:00 2001 From: Peter Nguyen Date: Mon, 10 Sep 2018 04:49:26 +0200 Subject: Fix typo in keymap_swedish.h (#3877) * Fix typo in keymap_swedish.h * Update keymap_swedish.h --- quantum/keymap_extras/keymap_swedish.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quantum/keymap_extras/keymap_swedish.h b/quantum/keymap_extras/keymap_swedish.h index 9044bb74e7..d1a0f4f227 100644 --- a/quantum/keymap_extras/keymap_swedish.h +++ b/quantum/keymap_extras/keymap_swedish.h @@ -41,8 +41,8 @@ #define NO_DLR_MAC LSFT(KC_4) // $ #define NO_GRV_MAC ALGR(NO_BSLS) // ` #define NO_GRTR_MAC LSFT(KC_GRV) // > -#define NO_LCBR_MAC ALGR(LSFT(KC_8)) // } -#define NO_LESS_MAC KC_GRV // > +#define NO_LCBR_MAC ALGR(LSFT(KC_8)) // { +#define NO_LESS_MAC KC_GRV // < #define NO_PIPE_MAC ALGR(KC_7) // | #define NO_RCBR_MAC ALGR(LSFT(KC_9)) // } -- cgit v1.2.3 From e11e4a91ac18862e1f23efb070859663ffc242b6 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Mon, 10 Sep 2018 16:39:05 +0200 Subject: Keymap: Redox: add a new Colemak keymap, macOS oriented. (#3861) * Add my own keymap to the list of available Redox keymaps. This keymap is a Colemak keymap, and is meant to be used on Mac OS. More information can be found in the readme. * Fix "macOS" typo and remove mention of the license. This directory inherits the project's license. * Add missing custom keycode. * Address feedback from PR review - Remove deprecated code - Remove RGB logic since it is overwritten by code running later. --- keyboards/redox/keymaps/jeherve/config.h | 40 +++++ keyboards/redox/keymaps/jeherve/keymap.c | 282 ++++++++++++++++++++++++++++++ keyboards/redox/keymaps/jeherve/readme.md | 37 ++++ keyboards/redox/keymaps/jeherve/rules.mk | 3 + 4 files changed, 362 insertions(+) create mode 100644 keyboards/redox/keymaps/jeherve/config.h create mode 100644 keyboards/redox/keymaps/jeherve/keymap.c create mode 100644 keyboards/redox/keymaps/jeherve/readme.md create mode 100644 keyboards/redox/keymaps/jeherve/rules.mk diff --git a/keyboards/redox/keymaps/jeherve/config.h b/keyboards/redox/keymaps/jeherve/config.h new file mode 100644 index 0000000000..939d0c8d83 --- /dev/null +++ b/keyboards/redox/keymaps/jeherve/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2018 Jeremy Herve + +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 + +/* Use I2C or Serial, not both */ + +/* Change the default tapping toggle value (normally 5) */ +#define TAPPING_TOGGLE 2 + +#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 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP diff --git a/keyboards/redox/keymaps/jeherve/keymap.c b/keyboards/redox/keymaps/jeherve/keymap.c new file mode 100644 index 0000000000..d298fa9a31 --- /dev/null +++ b/keyboards/redox/keymaps/jeherve/keymap.c @@ -0,0 +1,282 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _COLEMAK 0 +#define _SYMB 1 +#define _NAV 2 +#define _INTER 3 +#define _ADJUST 4 + +enum custom_keycodes { + COLEMAK = SAFE_RANGE, + SYMB, + NAV, + INTER, + ADJUST, + // These use process_record_user() + M_BRACKET_LEFT, + M_BRACKET_RIGHT, + SHRUG, + WAVE, + YOSHI, + THUMB_UP, + NBSP +}; + +// Fillers to make layering more clear +#define KC_ KC_TRNS +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Make macros a bit simpler with this shortcut. +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + +// Is shift being held? Let's store this in a bool. +static bool shift_held = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case SHRUG: + if (record->event.pressed) { + unicode_input_start(); register_hex(0xaf); unicode_input_finish(); + TAP_ONCE (KC_BSLS); + register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); + unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); + register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); + TAP_ONCE (KC_SLSH); + unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + } + return false; + break; + case YOSHI: + if (record->event.pressed) { + SEND_STRING(":yellow_yoshi:"); + } + return false; + break; + case THUMB_UP: + if (record->event.pressed) { + SEND_STRING(SS_LALT("D83D+DC4D")); + } + return false; + break; + case WAVE: + if (record->event.pressed) { + SEND_STRING(SS_LALT("D83D+DC4B")); + } + return false; + break; + case NBSP: + if (record->event.pressed) { + SEND_STRING(" "); + } + return false; + break; + case KC_LSFT: + shift_held = record->event.pressed; + return true; + break; + case KC_RSFT: + shift_held = record->event.pressed; + return true; + break; + case M_BRACKET_LEFT: { + if (record->event.pressed) { + if (shift_held) { + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + register_code(KC_LBRC); + } else { + register_code(KC_LSFT); + register_code(KC_9); + } + } else { // Release the key + unregister_code(KC_LBRC); + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + unregister_code(KC_9); + } + return false; + break; + } + case M_BRACKET_RIGHT: { + if (record->event.pressed) { + if (shift_held) { + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + register_code(KC_RBRC); + } else { + register_code(KC_LSFT); + register_code(KC_0); + } + } else { // Release the key + unregister_code(KC_RBRC); + unregister_code(KC_LSFT); + unregister_code(KC_RSFT); + unregister_code(KC_0); + } + return false; + break; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* COLEMAK + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | Exp | 6 | 7 | 8 | 9 | 0 | = | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Tab | Q | W | F | P | G | ( | | ) | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Lay1 | A | R | S | T | D | Lay2 | | Lay2 | H | N | E | I | O |'/Lay1| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | Lay1 | | Lay1 | K | M | , | . | / |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Lay3 | Ctrl | Hyper| Alt | Cmd |Bcksp | Ctrl | |Enter |Space | Cmd | Lay4 | Hyper| Ctrl | Lay3 | + * `------------------------------------------------' `------------------------------------------------' + */ + [_COLEMAK] = LAYOUT( + //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. + KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,KC_ESC, LCTL(KC_DOWN), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_EQL, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , M_BRACKET_LEFT, M_BRACKET_RIGHT , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSLS, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + MO(_SYMB) , KC_A , KC_R , KC_S , KC_T , KC_D ,TT(_NAV), TT(_NAV) , KC_H , KC_N , KC_E , KC_I , KC_O , LT(_SYMB,KC_QUOT), + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B ,TT(_SYMB), TT(_SYMB) , KC_K , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT, + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| + MO(_INTER),KC_LCTL,KC_HYPR,KC_LALT, KC_LCMD, KC_BSPC,KC_LCTL, KC_ENT,KC_SPC , KC_RCMD , TT(_ADJUST),KC_HYPR,KC_RCTL,MO(_INTER) + //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + ), + +/* Symbols + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | ! | @ | # | $ | % | | | | ^ | & | * | - | _ | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + + [_SYMB] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_LCBR, KC_RCBR, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, + _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_UNDS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* Navigation + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |VOLDOW|VOL UP| MUTE | | | | LEFT | DOWN | UP |RIGHT | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_NAV] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + ), + +/* i18n + emoji +* ,------------------------------------------------. ,------------------------------------------------. +* | | | | | | | | | | | | | | | | +* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| +* | | à | 👋 | | | | | | | | ü | è | YOSHI| ö | | +* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| +* | | á | |SHRUG | 👍 | | | | | | ú | é | í | ó | | +* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| +* | | â | | ç | | | | | | | ű | ê | | ő | | +* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| +* | | | | | | | | | | | | | | | | +* `------------------------------------------------' `------------------------------------------------' +*/ + [_INTER] = LAYOUT( + XXXXXXX, _______ , _______, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, + XXXXXXX, UC(0x00E0), WAVE , XXXXXXX , XXXXXXX , XXXXXXX, _______, _______, XXXXXXX, UC(0x00FC), UC(0x00E8), YOSHI, UC(0x00F6), XXXXXXX, + _______, UC(0x00E1), XXXXXXX, SHRUG , THUMB_UP, XXXXXXX, _______, _______, XXXXXXX, UC(0x00F9), UC(0x00E9), UC(0x00ED) , UC(0x00F3), _______, + XXXXXXX, UC(0x00E2), XXXXXXX, UC(0x00E7), XXXXXXX , XXXXXXX, _______, _______, XXXXXXX, UC(0x0171), UC(0x00EA), XXXXXXX, UC(0x0151), XXXXXXX, + _______, XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, _______, _______, NBSP, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + ), + +/* Adjust keyboard settings + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | RGB- | RGB+ |RGB ON| | | | | | RESET| DEBUG|AUD ON| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_ADJUST] = LAYOUT( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, RGB_VAD, RGB_VAI, RGB_TOG, XXXXXXX, _______, _______, XXXXXXX, RESET , DEBUG , AU_TOG , XXXXXXX, _______, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + ) + +}; + +#ifdef AUDIO_ENABLE +float tone_colemak[][2] = SONG(ZELDA_TREASURE); +#endif + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +// Set unicode in Mac OS. +void matrix_init_user(void) { + set_unicode_input_mode(UC_OSX); +}; + +// Change LED colors depending on the layer. +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _SYMB: + rgblight_setrgb_orange(); + break; + case _NAV: + rgblight_setrgb_springgreen(); + break; + case _INTER: + rgblight_setrgb_teal(); + break; + case _ADJUST: + rgblight_setrgb_red(); + break; + default: // for any other layers, or the default layer + rgblight_setrgb_yellow(); + break; + } + return state; +}; diff --git a/keyboards/redox/keymaps/jeherve/readme.md b/keyboards/redox/keymaps/jeherve/readme.md new file mode 100644 index 0000000000..5afad5530a --- /dev/null +++ b/keyboards/redox/keymaps/jeherve/readme.md @@ -0,0 +1,37 @@ +# A Colemak keymap for the Redox keyboard + +---- +![jeherve-redox-layout-3](https://user-images.githubusercontent.com/426388/45171716-69888200-b203-11e8-822d-7bc91f9f6c07.jpg) + +---- + +This keymap is **a work in progress**, and is meant to be used on macOS, with the "Unicode Hex Input" keyboard input. + +![macOS keyboard input setting](https://user-images.githubusercontent.com/426388/43962498-1ee9e3fc-9cb8-11e8-88e3-dbb068ec5c67.png) + +I may change a lot of the keys over the next few months, and will update this repo when I do so. + +[View on KLE](http://www.keyboard-layout-editor.com/#/gists/3d5368842d87a8462c8f95d4382c4a19) + +## Layers + +My keymap uses 5 layers: + +1. The default base layer, using [Colemak](https://colemak.com/). +2. A Symbol layer, so all symbols can be accessed from the home row. (top right legends) +3. A Navigation / Media layer, with both sound control and arrows on the home row. (bottom right legends) +4. An international / Emoji layer so I can type accented characters commonly used in France and in Hungary, as well as a few Emoji I often use. (top center legends) +5. A keyboard control layer, not pictured above, allowing me to control the LED lighting as well as the keyboard debug functions. + +## Changelog + +- 2018.09.06 + - Initial submission to QMK. It's alive! ⌨️ + +## Credits + +- Redox keyboard design by [Mattia Dal Ben](https://github.com/mattdibi/redox-keyboard). +- This keymap is based off the default keymap for the Redox keyboard, available [here](https://github.com/qmk/qmk_firmware/tree/master/keyboards/redox) and also build by Mattia Dal Ben (thank you!). +- This layout uses [QMK keyboard controller firmware](https://github.com/qmk/qmk_firmware/). + +I've also read posts by [Gergely Nagy](https://asylum.madhouse-project.org/blog/2016/10/15/multi-purpose-keys/), [Rebecca Le](https://sevenseacat.net/posts/2018/unicode-in-qmk-on-osx/), and [Justin Rogers](https://implementsblog.com/2016/10/16/my-ergodox-ezs-custom-layout/#comments) for inspiration. diff --git a/keyboards/redox/keymaps/jeherve/rules.mk b/keyboards/redox/keymaps/jeherve/rules.mk new file mode 100644 index 0000000000..ac2496b8c9 --- /dev/null +++ b/keyboards/redox/keymaps/jeherve/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +UNICODE_ENABLE = yes +AUDIO_ENABLE = yes -- cgit v1.2.3 From 2e0c63e0afcc128ae3865864d33f01a4e94ab218 Mon Sep 17 00:00:00 2001 From: leico Date: Tue, 11 Sep 2018 08:21:54 +0900 Subject: improve looks like hang up when first time execute make git-submodule (#3846) --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0dd77d403e..45e47c0037 100644 --- a/Makefile +++ b/Makefile @@ -578,7 +578,7 @@ lib/%: git-submodule: git submodule sync --recursive - git submodule update --init --recursive + git submodule update --init --recursive --progress ifdef SKIP_VERSION SKIP_GIT := yes -- cgit v1.2.3 From 265eca0f7c473a5b6f4b2ab6cec6f751506cf49c Mon Sep 17 00:00:00 2001 From: Thomas Vandaele Date: Mon, 27 Aug 2018 21:07:30 +0200 Subject: Add manjaro asn arch-based distro --- util/linux_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 0703db8f16..942c658134 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -9,7 +9,7 @@ elif grep ID /etc/os-release | grep -q debian; then sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \ dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ libnewlib-arm-none-eabi -elif grep ID /etc/os-release | grep -q arch; then +elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then sudo pacman -S gcc unzip wget zip avr-gcc avr-binutils avr-libc \ dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \ arm-none-eabi-newlib -- cgit v1.2.3 From e9a67f8fde0ecd7528b8ad0c8bfca85dc848eebe Mon Sep 17 00:00:00 2001 From: Miguel Garcia Rodriguez Date: Mon, 27 Aug 2018 19:56:02 +0200 Subject: Fix installation for linux finding ID:fedora in os_release --- util/linux_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 942c658134..d5da59e827 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -1,5 +1,5 @@ #!/bin/sh -if grep ID /etc/os-release | grep -q rhel; then +if grep ID /etc/os-release | grep -qE "rhel|fedora"; then # RPM based OS sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \ avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \ -- cgit v1.2.3 From c7e1b53913707487b0218b984367d32fb4466aaa Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 17 Jun 2018 15:44:28 +1000 Subject: Remove unneccesary ATTR_CONST from stub functions (thanks to NicoHood). --- lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h index ca63511b20..920281be59 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -377,7 +377,7 @@ #if !defined(__DOXYGEN__) /* Function Prototypes: */ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) - void Audio_Device_Event_Stub(void) ATTR_CONST; + void Audio_Device_Event_Stub(void); void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h index 9d5c4e5a0a..f9a53851a5 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -362,7 +362,7 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Device_Event_Stub(void) ATTR_CONST; + void CDC_Device_Event_Stub(void); void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h index 802c5912d3..5ac5279351 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h @@ -273,7 +273,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void PRNT_Device_Event_Stub(void) ATTR_CONST; + void PRNT_Device_Event_Stub(void); void EVENT_PRNT_Device_SoftReset(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(PRNT_Device_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h index 86ce6def38..f5cc4906ba 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -360,7 +360,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Host_Event_Stub(void) ATTR_CONST; + void CDC_Host_Event_Stub(void); void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub); -- cgit v1.2.3 From df8e417032bace12d69b5d75aebf257ea5dadb86 Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Sun, 17 Jun 2018 16:06:07 +1000 Subject: Fix mismatched aliased event and event stub function prototypes. --- .../Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c | 6 ++++-- lib/lufa/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c | 2 ++ .../VirtualSerialMassStorage/VirtualSerialMassStorage.c | 2 ++ .../Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c | 2 ++ lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c | 7 ++++++- lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h | 5 +++-- lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.c | 2 +- lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h | 2 +- lib/lufa/LUFA/Drivers/USB/Core/Events.c | 9 +++++++++ lib/lufa/LUFA/Drivers/USB/Core/Events.h | 6 ++++-- 14 files changed, 38 insertions(+), 13 deletions(-) diff --git a/lib/lufa/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c b/lib/lufa/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c index 9a7ff4725e..0210ff55c0 100644 --- a/lib/lufa/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c +++ b/lib/lufa/Demos/Device/ClassDriver/DualVirtualSerial/DualVirtualSerial.c @@ -231,12 +231,14 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t *const C */ bool HostReady = (CDCInterfaceInfo->State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) != 0; + (void)HostReady; + if (CDCInterfaceInfo == &VirtualSerial1_CDC_Interface) { - // CDC interface 1's host is ready to send/receive data + // CDC interface 1's host is ready to send/receive data if HostReady is true } else { - // CDC interface 2's host is ready to send/receive data + // CDC interface 2's host is ready to send/receive data if HostReady is true } } diff --git a/lib/lufa/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c b/lib/lufa/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c index a3d419ae5c..3a943e8c18 100644 --- a/lib/lufa/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c +++ b/lib/lufa/Demos/Device/ClassDriver/VirtualSerial/VirtualSerial.c @@ -199,4 +199,6 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t *const C in the pending data from the USB endpoints. */ bool HostReady = (CDCInterfaceInfo->State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) != 0; + + (void)HostReady; } diff --git a/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c b/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c index f298e39cb8..c8b1dfd2dc 100644 --- a/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c +++ b/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMassStorage/VirtualSerialMassStorage.c @@ -238,6 +238,8 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t *const C in the pending data from the USB endpoints. */ bool HostReady = (CDCInterfaceInfo->State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) != 0; + + (void)HostReady; } /** Mass Storage class driver callback function the reception of SCSI commands from the host, which must be processed. diff --git a/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c b/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c index 1349580604..c299723bb3 100644 --- a/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c +++ b/lib/lufa/Demos/Device/ClassDriver/VirtualSerialMouse/VirtualSerialMouse.c @@ -279,4 +279,6 @@ void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t *const C in the pending data from the USB endpoints. */ bool HostReady = (CDCInterfaceInfo->State.ControlLineStates.HostToDevice & CDC_CONTROL_LINE_OUT_DTR) != 0; + + (void)HostReady; } diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c index 08cbeb7061..eb3aa57108 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.c @@ -188,7 +188,7 @@ bool Audio_Device_ConfigureEndpoints(USB_ClassInfo_Audio_Device_t* const AudioIn return true; } -void Audio_Device_Event_Stub(void) +void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) { } diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h index 920281be59..91938af8cc 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/AudioClassDevice.h @@ -377,7 +377,7 @@ #if !defined(__DOXYGEN__) /* Function Prototypes: */ #if defined(__INCLUDE_FROM_AUDIO_DEVICE_C) - void Audio_Device_Event_Stub(void); + void Audio_Device_Event_Stub(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo); void EVENT_Audio_Device_StreamStartStop(USB_ClassInfo_Audio_Device_t* const AudioInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(Audio_Device_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c index 867548c00b..93930bc99e 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.c @@ -353,10 +353,15 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) } #endif -void CDC_Device_Event_Stub(void) +void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) { } +void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1) +{ + CDC_Device_Event_Stub(CDCInterfaceInfo); +} + #endif diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h index f9a53851a5..55dbbc7266 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/CDCClassDevice.h @@ -362,7 +362,8 @@ static int CDC_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Device_Event_Stub(void); + void CDC_Device_Event_Stub(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); + void CDC_Device_Event_Stub_2(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t _1); void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); @@ -370,7 +371,7 @@ ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Device_Event_Stub); void EVENT_CDC_Device_BreakSent(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo, const uint8_t Duration) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) - ATTR_ALIAS(CDC_Device_Event_Stub); + ATTR_ALIAS(CDC_Device_Event_Stub_2); #endif #endif diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c index 7209c452dc..668b138b7b 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.c @@ -305,7 +305,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) } #endif -void PRNT_Device_Event_Stub(void) +void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) { } diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h index 5ac5279351..d850842d84 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Device/PrinterClassDevice.h @@ -273,7 +273,7 @@ static int PRNT_Device_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void PRNT_Device_Event_Stub(void); + void PRNT_Device_Event_Stub(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo); void EVENT_PRNT_Device_SoftReset(USB_ClassInfo_PRNT_Device_t* const PRNTInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(PRNT_Device_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.c b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.c index af9ed96e24..cc93f96010 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.c +++ b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.c @@ -503,7 +503,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) } #endif -void CDC_Host_Event_Stub(void) +void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) { } diff --git a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h index f5cc4906ba..8d0d89a03e 100644 --- a/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h +++ b/lib/lufa/LUFA/Drivers/USB/Class/Host/CDCClassHost.h @@ -360,7 +360,7 @@ static int CDC_Host_getchar_Blocking(FILE* Stream) ATTR_NON_NULL_PTR_ARG(1); #endif - void CDC_Host_Event_Stub(void); + void CDC_Host_Event_Stub(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo); void EVENT_CDC_Host_ControLineStateChanged(USB_ClassInfo_CDC_Host_t* const CDCInterfaceInfo) ATTR_WEAK ATTR_NON_NULL_PTR_ARG(1) ATTR_ALIAS(CDC_Host_Event_Stub); diff --git a/lib/lufa/LUFA/Drivers/USB/Core/Events.c b/lib/lufa/LUFA/Drivers/USB/Core/Events.c index 186557956a..e05fd74194 100644 --- a/lib/lufa/LUFA/Drivers/USB/Core/Events.c +++ b/lib/lufa/LUFA/Drivers/USB/Core/Events.c @@ -37,3 +37,12 @@ void USB_Event_Stub(void) } +void USB_Event_Stub_2(const uint8_t _1) +{ + USB_Event_Stub(); +} + +void USB_Event_Stub_3(const uint8_t _1, const uint8_t _2) +{ + USB_Event_Stub(); +} diff --git a/lib/lufa/LUFA/Drivers/USB/Core/Events.h b/lib/lufa/LUFA/Drivers/USB/Core/Events.h index 91fb31b620..d37bb3065a 100644 --- a/lib/lufa/LUFA/Drivers/USB/Core/Events.h +++ b/lib/lufa/LUFA/Drivers/USB/Core/Events.h @@ -332,19 +332,21 @@ /* Function Prototypes: */ #if defined(__INCLUDE_FROM_EVENTS_C) void USB_Event_Stub(void); + void USB_Event_Stub_2(const uint8_t _1); + void USB_Event_Stub_3(const uint8_t _1, const uint8_t _2); #if defined(USB_CAN_BE_BOTH) void EVENT_USB_UIDChange(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif #if defined(USB_CAN_BE_HOST) - void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + void EVENT_USB_Host_HostError(const uint8_t ErrorCode) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub_2); void EVENT_USB_Host_DeviceAttached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceUnattached(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceEnumerationComplete(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); void EVENT_USB_Host_DeviceEnumerationFailed(const uint8_t ErrorCode, const uint8_t SubErrorCode) - ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); + ATTR_WEAK ATTR_ALIAS(USB_Event_Stub_3); void EVENT_USB_Host_StartOfFrame(void) ATTR_WEAK ATTR_ALIAS(USB_Event_Stub); #endif -- cgit v1.2.3 From 32ff7be266793967b820da80ae6f3fca0a1688b4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 21 Jul 2018 14:16:14 -0700 Subject: Fix RG Sleep issues for Teensy Controllers Appearenly, teensy controllers have some issues with waking up. If the rgblight is called "too soon", it will cause the controller to lock up, intermittently. Adding a 10 ms delay seems to fix this issue, as it lets it have enough time to handle things properly. This has been tested extensively on my Ergodox EZ, and can be seen in the @drashna userspace, under the "suspend_wakeup_init_user" function. --- tmk_core/common/avr/suspend.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 3d4a48439b..73fdda6cc0 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -189,6 +189,9 @@ void suspend_wakeup_init(void) #endif led_set(host_keyboard_leds()); #if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE) +#ifdef BOOTLOADER_TEENSY + wait_ms(10); +#endif rgblight_enable_noeeprom(); #ifdef RGBLIGHT_ANIMATIONS rgblight_timer_enable(); -- cgit v1.2.3 From 7551e0bbc705c9b67b27a080db2bb483c3ac22e8 Mon Sep 17 00:00:00 2001 From: Xyverz Date: Tue, 11 Sep 2018 14:22:18 -0700 Subject: Keymap: Fixed my ortho_5x12 layout (#3881) * Fixed my ortho_5x12 layout I've fixed the config.h file for my 5x12 ortho layout so that I can now use it with my Nyquist. * Update config.h * Update config.h --- layouts/community/ortho_5x12/xyverz/config.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/layouts/community/ortho_5x12/xyverz/config.h b/layouts/community/ortho_5x12/xyverz/config.h index 0481aa8142..4489c6e5f5 100644 --- a/layouts/community/ortho_5x12/xyverz/config.h +++ b/layouts/community/ortho_5x12/xyverz/config.h @@ -7,16 +7,18 @@ /* ws2812 RGB LED */ #undef RGB_DI_PIN -#define RGB_DI_PIN B3 -#undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 11 // Number of LEDs -#undef RGBLIGHT_HUE_STEP -#define RGBLIGHT_HUE_STEP 8 -#undef RGBLIGHT_SAT_STEP -#define RGBLIGHT_SAT_STEP 8 -#undef RGBLIGHT_VAL_STEP -#define RGBLIGHT_VAL_STEP 8 +#if defined(KEYBOARD_preonic_rev2) + #define RGB_DI_PIN B3 + #undef RGBLED_NUM + #define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 11 // Number of LEDs + #undef RGBLIGHT_HUE_STEP + #define RGBLIGHT_HUE_STEP 8 + #undef RGBLIGHT_SAT_STEP + #define RGBLIGHT_SAT_STEP 8 + #undef RGBLIGHT_VAL_STEP + #define RGBLIGHT_VAL_STEP 8 +#endif // for the split boards // #define USE_SERIAL -- cgit v1.2.3 From 5dd4b2af5381ee2d95fbcf45c4b3ad11285c3dec Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 13 Sep 2018 09:04:55 -0700 Subject: Keyboard: Updated info.json for Duck Jetfire (#3866) * Updated info.json for Duck Jetfire Generated a new info.json file. @mechmerlin asked my help in debugging this file. Firmware works as expected if built from source, but not if built from the Configurator. * Corrected the position of the arrow keys in LAYOUT_all --- keyboards/duck/jetfire/info.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/duck/jetfire/info.json b/keyboards/duck/jetfire/info.json index db39529ac3..ec88a23ac8 100644 --- a/keyboards/duck/jetfire/info.json +++ b/keyboards/duck/jetfire/info.json @@ -1,16 +1,16 @@ { - "keyboard_name": "Jetfire", - "url": "", - "maintainer": "qmk", - "width": 20.5, - "height": 6.5, + "keyboard_name": "Jetfire", + "url": "", + "maintainer": "qmk", + "width": 20.5, + "height": 6.5, "layouts": { "LAYOUT_all": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"x":13, "y":1.25}, {"x":14, "y":1.25}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"x":19.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":1.25}, {"x":1.25, "y":4.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25}, {"label":"Menu", "x":12, "y":5.25}, {"x":13, "y":5.25}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}, {"x":19.5, "y":5.25}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}] + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Back Space", "x":13, "y":1.25}, {"x":14, "y":1.25}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"x":19.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":1.25}, {"label":"ISO \\", "x":1.25, "y":4.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"x":14, "y":4.25}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":6.25}, {"label":"Alt", "x":10.25, "y":5.25, "w":1.25}, {"x":11.5, "y":5.25, "w":1.25}, {"label":"Ctrl", "x":12.75, "y":5.25, "w":1.25}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}, {"x":19.5, "y":5.25}] }, "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25, "h":2}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25, "h":2}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25, "w":1.5}, {"label":"Menu", "x":12.5, "y":5.25, "w":1.5}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}] + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"x":15.25, "y":0}, {"label":"PrtSc", "x":16.5, "y":0}, {"label":"Scroll Lock", "x":17.5, "y":0}, {"label":"Pause", "x":18.5, "y":0}, {"x":19.5, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Insert", "x":15.25, "y":1.25}, {"label":"Num Lock", "x":16.5, "y":1.25}, {"label":"/", "x":17.5, "y":1.25}, {"label":"*", "x":18.5, "y":1.25}, {"label":"-", "x":19.5, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.25}, {"label":"7", "x":16.5, "y":2.25}, {"label":"8", "x":17.5, "y":2.25}, {"label":"9", "x":18.5, "y":2.25}, {"label":"+", "x":19.5, "y":2.25, "h":2}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"4", "x":16.5, "y":3.25}, {"label":"5", "x":17.5, "y":3.25}, {"label":"6", "x":18.5, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":2.75}, {"label":"\u2191", "x":15.25, "y":4.5}, {"label":"1", "x":16.5, "y":4.25}, {"label":"2", "x":17.5, "y":4.25}, {"label":"3", "x":18.5, "y":4.25}, {"label":"Enter", "x":19.5, "y":4.25, "h":2}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.5}, {"label":"Win", "x":1.5, "y":5.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.5}, {"x":4, "y":5.25, "w":7}, {"label":"Alt", "x":11, "y":5.25, "w":1.5}, {"label":"Ctrl", "x":12.5, "y":5.25, "w":1.5}, {"label":"\u2190", "x":14.25, "y":5.5}, {"label":"\u2193", "x":15.25, "y":5.5}, {"label":"\u2192", "x":16.25, "y":5.5}, {"label":"0", "x":17.5, "y":5.25}, {"label":".", "x":18.5, "y":5.25}] } } -} \ No newline at end of file +} -- cgit v1.2.3 From f1612b7fa19995064ad107f447932a416dbfe09b Mon Sep 17 00:00:00 2001 From: Erovia Date: Thu, 13 Sep 2018 18:07:21 +0200 Subject: Keymap: Add Contra keymap with QWERTY and COLEMAK Mod-DH (#3883) * Add own personal Contra layout * Enable auto-shifting * Enable tap dancing and implement Space Cadet-like shift with LSHIFT and ENTER * Implement Colemak Mod-DH layout, clean up Adjust layer * Implement keyboard and keymap refactor More info: https://github.com/qmk/qmk_firmware/pull/3191 * Update the readme.md and keymap.c files for Colemak * Add include guard, make layout description cleaner --- keyboards/contra/keymaps/erovia/config.h | 7 ++ keyboards/contra/keymaps/erovia/keymap.c | 163 ++++++++++++++++++++++++++++++ keyboards/contra/keymaps/erovia/readme.md | 76 ++++++++++++++ keyboards/contra/keymaps/erovia/rules.mk | 2 + 4 files changed, 248 insertions(+) create mode 100644 keyboards/contra/keymaps/erovia/config.h create mode 100644 keyboards/contra/keymaps/erovia/keymap.c create mode 100644 keyboards/contra/keymaps/erovia/readme.md create mode 100755 keyboards/contra/keymaps/erovia/rules.mk diff --git a/keyboards/contra/keymaps/erovia/config.h b/keyboards/contra/keymaps/erovia/config.h new file mode 100644 index 0000000000..11d6a2c1ae --- /dev/null +++ b/keyboards/contra/keymaps/erovia/config.h @@ -0,0 +1,7 @@ +#pragma once + +#define AUTO_SHIFT_TIMEOUT 150 +#define NO_AUTO_SHIFT_SPECIAL +#define NO_AUTO_SHIFT_NUMERIC + +#define TAPPING_TERM 200 diff --git a/keyboards/contra/keymaps/erovia/keymap.c b/keyboards/contra/keymaps/erovia/keymap.c new file mode 100644 index 0000000000..9b72e57332 --- /dev/null +++ b/keyboards/contra/keymaps/erovia/keymap.c @@ -0,0 +1,163 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE +}; + +enum { + TD_SPACE_CADET_SHIFT = 0, + TD_SPACE_CADET_ENTER = 1 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SPACE_CADET_SHIFT] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_LPRN), + [TD_SPACE_CADET_ENTER] = ACTION_TAP_DANCE_DOUBLE(KC_ENT, KC_RPRN) +}; + +#define TD_SHFT TD(TD_SPACE_CADET_SHIFT) +#define TD_ENTR TD(TD_SPACE_CADET_ENTER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | GUI |Lower | Tab |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + TD_SHFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, TD_ENTR, + KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI, LOWER, KC_TAB, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | ` | Q | W | F | P | B | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Ctrl | A | R | S | T | G | M | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | D | V | K | H | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | GUI |Lower | Tab |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( + KC_GRV, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + TD(TD_SPACE_CADET_SHIFT), KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, TD(TD_SPACE_CADET_ENTER), + KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI, LOWER, KC_TAB, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Prev | Vol- | Mute | Stop | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MUTE, KC_MSTP +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|Colemk| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | AuSh | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ASTG +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/contra/keymaps/erovia/readme.md b/keyboards/contra/keymaps/erovia/readme.md new file mode 100644 index 0000000000..34cbdf0a18 --- /dev/null +++ b/keyboards/contra/keymaps/erovia/readme.md @@ -0,0 +1,76 @@ +# Erovia's Contra Keymap + +My personal Contra keymap based on the *basic* keymap. + +**Features** + +* Qwerty and Colemak Mod-DH support +* autoshifting +* double tap LSHIFT and ENTER for quick access to ( and ) + +## QWERTY (Normal) Layer +``` +,-----------------------------------------------------------------------------------. +| ` | Q | W | E | R | T | Y | U | I | O | P | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Esc | A | S | D | F | G | H | J | K | L | ; | ' | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | V | B | N | M | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | GUI | Alt | GUI |Lower | Tab |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Colemak Layer +Switch from `Adjust` layer. +``` +,-----------------------------------------------------------------------------------. +| ` | Q | W | F | P | B | J | L | U | Y | ; | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Ctrl | A | R | S | T | G | M | N | E | I | O | ' | +|------+------+------+------+------+------|------+------+------+------+------+------| +| Shift| Z | X | C | D | V | K | H | , | . | / |Enter | +|------+------+------+------+------+------+------+------+------+------+------+------| +| Ctrl | GUI | Alt | GUI |Lower | Tab |Space |Raise | Left | Down | Up |Right | +`-----------------------------------------------------------------------------------' +``` + +## Lower +``` +,-----------------------------------------------------------------------------------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Next | Vol- | Vol+ | Play | +`-----------------------------------------------------------------------------------' +``` + +## Raise +``` +,-----------------------------------------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | +|------+------+------+------+------+-------------+------+------+------+------+------| +| Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | Prev | Vol- | Mute | Stop | +`-----------------------------------------------------------------------------------' +``` + +## Adjust +`AuSh` toggles autoshifting. +``` +,-----------------------------------------------------------------------------------. +| | | | | | | | | | | | | +|------+------+------+------+------+-------------+------+------+------+------+------| +| | | | | | | |Qwerty|Colemk| | | | +|------+------+------+------+------+------|------+------+------+------+------+------| +| | | | | | | | | | | | | +|------+------+------+------+------+------+------+------+------+------+------+------| +| | | | | | | | | | | AuSh | +`-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/contra/keymaps/erovia/rules.mk b/keyboards/contra/keymaps/erovia/rules.mk new file mode 100755 index 0000000000..97999d9cb0 --- /dev/null +++ b/keyboards/contra/keymaps/erovia/rules.mk @@ -0,0 +1,2 @@ +AUTO_SHIFT_ENABLE = yes +TAP_DANCE_ENABLE = yes -- cgit v1.2.3 From 87faf55b012bb33265801e9fecae105a23c2d57e Mon Sep 17 00:00:00 2001 From: lucwastiaux Date: Fri, 14 Sep 2018 00:12:03 +0800 Subject: Keymap: Cleanups on the ergodox EZ / atreus dvorak 42 key layouts (#3887) * add SCREEN_NAV layer for copy/pasting within screen * working readreg/paste macros * working read reg / paste macros * write log and tran patterns, and expand * add ls -la shortcut, add tab on combined layer * put delete word on the right pinky key on shell_nav layer * add TAB on the right side, add reset key * added Cloud9 macros * add cloud9 shortcuts to atreus layout * added BROWSER_CONTROL layer * finalized browser control layer * adding comment * add browser control layer to atreus * add flashing command line * remove the tab on combined layer * remove the tomouse * remove mouse layer, change log/tran expand patterns, cleanups * add dumptlog macro * add "delete to home" shortcut * fix conflict * remove unneeded mouse layer * add meh shortcuts on the browser_control layer * add/modify some macros * explain the various layers * putty paste is right mouse button --- keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c index 94d035c6b9..dd5ee28979 100644 --- a/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c +++ b/keyboards/ergodox_ez/keymaps/dvorak_42_key/keymap.c @@ -230,7 +230,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, SHELL_EXPAND_OE_TRANPATTERN, RCTL(KC_L), RCTL(KC_W), KC_HOME, KC_UP, KC_END, KC_TRNS, SHELL_EXPAND_OE_LOGPATTERN, LALT(KC_B), KC_LEFT, KC_DOWN, KC_RIGHT, LALT(KC_F), RCTL(KC_W), - RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), MEH(KC_V), RCTL(KC_K), SHELL_DUMPTLOG, + RCTL(KC_C), RCTL(KC_U), LALT(KC_DOT), RCTL(KC_R), KC_BTN2, RCTL(KC_K), SHELL_DUMPTLOG, // bottom row (match functionality of base layer) KC_BSPC, RCTL(KC_W), KC_DELETE, LALT(KC_D), RCTL(KC_U), // thumb cluster -- cgit v1.2.3 From 132c44bab132c63fa7994e0801e0ca37f53bd792 Mon Sep 17 00:00:00 2001 From: Stephen Tudor Date: Thu, 13 Sep 2018 12:16:39 -0400 Subject: Keymap: Fix Dvorak mapping for left/right brace (#3889) --- keyboards/tkc1800/keymaps/smt/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/tkc1800/keymaps/smt/keymap.c b/keyboards/tkc1800/keymaps/smt/keymap.c index ffaaef2973..6683416e36 100644 --- a/keyboards/tkc1800/keymaps/smt/keymap.c +++ b/keyboards/tkc1800/keymaps/smt/keymap.c @@ -117,7 +117,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [DVORAK] = 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_INS, KC_HOME, KC_PGUP, KC_PSCR, \ KC_DEL, KC_END, KC_PGDN, KC_SLCK, \ - 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_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ + 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_BSLS, KC_GRV, KC_NLCK, KC_PSLS, KC_PAST, KC_PAUS, \ HPR_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_BSPC, KC_P7, KC_P8, KC_P9, KC_PMNS, \ CTL_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS, XXXXXX, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ KC_LSFT, XXXXXX, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXX, \ -- cgit v1.2.3 From b8a0d3de3dcd39558195a8a201e859a0d4ef924d Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Thu, 13 Sep 2018 12:17:26 -0400 Subject: Keyboard: ALT keymap update and LED driver brightness mismatch fix (#3890) * ALT keymap update Added additional End key on layer 1 to match key cap * LED driver update addressing PR #3871 Update sync between IS31FL3733 drivers is causing varying behavior in keyboards including brightness mismatch and slight flicker at very low rgb values. Visually, disabling sync is not noticeable. Ref PR #3871 by guarnacciaa. --- keyboards/massdrop/alt/keymaps/default/keymap.c | 2 +- keyboards/massdrop/alt/keymaps/mac/keymap.c | 2 +- tmk_core/protocol/arm_atsam/i2c_master.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index 9d8387bb72..0cbce86293 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [1] = LAYOUT( KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index a8adbd3c8d..e886290e7e 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -36,7 +36,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [1] = LAYOUT( KC_GRV, 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_TRNS, KC_MUTE, \ - L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index bbe909e9bb..4f5a79e89f 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -289,12 +289,12 @@ uint8_t I2C3733_Init_Drivers(void) //Set up master device i2c_led_send_CRWL(0); i2c_led_select_page(0, 3); - i2c_led_send_mode_op_gcr(0, ISSI3733_CR_SYNC_MASTER, ISSI3733_CR_SSD_NORMAL); + i2c_led_send_mode_op_gcr(0, 0, ISSI3733_CR_SSD_NORMAL); //No SYNC due to brightness mismatch with second driver //Set up slave device i2c_led_send_CRWL(1); i2c_led_select_page(1, 3); - i2c_led_send_mode_op_gcr(1, ISSI3733_CR_SYNC_SLAVE, ISSI3733_CR_SSD_NORMAL); + i2c_led_send_mode_op_gcr(1, 0, ISSI3733_CR_SSD_NORMAL); //No SYNC due to brightness mismatch with first driver and slight flicker at rgb values 1,2 i2c_led_send_CRWL(0); i2c_led_select_page(0, 3); -- cgit v1.2.3 From 7ff4faf3be32675b8f57af81b22593df286a3bc9 Mon Sep 17 00:00:00 2001 From: blindassassin111 <38090555+blindassassin111@users.noreply.github.com> Date: Thu, 13 Sep 2018 11:19:37 -0500 Subject: Keyboard: Fixing Omnikey lock light issue (#3891) --- keyboards/omnikey_blackheart/keymaps/default/keymap.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/keyboards/omnikey_blackheart/keymaps/default/keymap.c b/keyboards/omnikey_blackheart/keymaps/default/keymap.c index 3316218700..e4865adde3 100644 --- a/keyboards/omnikey_blackheart/keymaps/default/keymap.c +++ b/keyboards/omnikey_blackheart/keymaps/default/keymap.c @@ -1,9 +1,5 @@ #include QMK_KEYBOARD_H -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT(\ @@ -26,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -void led_set_kb(uint8_t usb_led) { +void led_set_user(uint8_t usb_led) { DDRB |= (1 << 4) | (1 << 5) | (1 << 6); if (usb_led & (1 << USB_LED_NUM_LOCK)) { @@ -46,4 +42,4 @@ void led_set_kb(uint8_t usb_led) { } else { PORTB &= ~(1 << 6); } -} \ No newline at end of file +} -- cgit v1.2.3 From cd3518b802071a915ff11659a32bf0a124687ea3 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 13 Sep 2018 09:21:02 -0700 Subject: Keyboard: Reorganize Alf keyboards into Alf Directory (#3892) * rename alf_x2 to alf * rename to x2 * rename dependencies * Fix readme * moved x2 into alf directory * update readme for make instructions * move dc60 to alf directory * update dc60 readme for make instructions * change readme txt as per noroadsleft PR comment --- keyboards/alf/dc60/config.h | 224 +++++++++++++++++++++++++++ keyboards/alf/dc60/dc60.c | 49 ++++++ keyboards/alf/dc60/dc60.h | 42 +++++ keyboards/alf/dc60/info.json | 12 ++ keyboards/alf/dc60/keymaps/default/config.h | 19 +++ keyboards/alf/dc60/keymaps/default/keymap.c | 70 +++++++++ keyboards/alf/dc60/keymaps/default/readme.md | 1 + keyboards/alf/dc60/readme.md | 15 ++ keyboards/alf/dc60/rules.mk | 70 +++++++++ keyboards/alf/x2/config.h | 58 +++++++ keyboards/alf/x2/info.json | 32 ++++ keyboards/alf/x2/keymaps/default/keymap.c | 42 +++++ keyboards/alf/x2/keymaps/hhkb_60/keymap.c | 42 +++++ keyboards/alf/x2/readme.md | 15 ++ keyboards/alf/x2/rules.mk | 56 +++++++ keyboards/alf/x2/x2.c | 1 + keyboards/alf/x2/x2.h | 98 ++++++++++++ keyboards/alf_x2/alf_x2.c | 1 - keyboards/alf_x2/alf_x2.h | 98 ------------ keyboards/alf_x2/config.h | 58 ------- keyboards/alf_x2/info.json | 32 ---- keyboards/alf_x2/keymaps/default/keymap.c | 42 ----- keyboards/alf_x2/keymaps/hhkb_60/keymap.c | 42 ----- keyboards/alf_x2/readme.md | 15 -- keyboards/alf_x2/rules.mk | 56 ------- keyboards/dc60/config.h | 224 --------------------------- keyboards/dc60/dc60.c | 49 ------ keyboards/dc60/dc60.h | 42 ----- keyboards/dc60/info.json | 12 -- keyboards/dc60/keymaps/default/config.h | 19 --- keyboards/dc60/keymaps/default/keymap.c | 70 --------- keyboards/dc60/keymaps/default/readme.md | 1 - keyboards/dc60/readme.md | 15 -- keyboards/dc60/rules.mk | 70 --------- 34 files changed, 846 insertions(+), 846 deletions(-) create mode 100644 keyboards/alf/dc60/config.h create mode 100644 keyboards/alf/dc60/dc60.c create mode 100644 keyboards/alf/dc60/dc60.h create mode 100644 keyboards/alf/dc60/info.json create mode 100644 keyboards/alf/dc60/keymaps/default/config.h create mode 100644 keyboards/alf/dc60/keymaps/default/keymap.c create mode 100644 keyboards/alf/dc60/keymaps/default/readme.md create mode 100644 keyboards/alf/dc60/readme.md create mode 100644 keyboards/alf/dc60/rules.mk create mode 100644 keyboards/alf/x2/config.h create mode 100644 keyboards/alf/x2/info.json create mode 100644 keyboards/alf/x2/keymaps/default/keymap.c create mode 100644 keyboards/alf/x2/keymaps/hhkb_60/keymap.c create mode 100644 keyboards/alf/x2/readme.md create mode 100644 keyboards/alf/x2/rules.mk create mode 100644 keyboards/alf/x2/x2.c create mode 100644 keyboards/alf/x2/x2.h delete mode 100644 keyboards/alf_x2/alf_x2.c delete mode 100644 keyboards/alf_x2/alf_x2.h delete mode 100644 keyboards/alf_x2/config.h delete mode 100644 keyboards/alf_x2/info.json delete mode 100644 keyboards/alf_x2/keymaps/default/keymap.c delete mode 100644 keyboards/alf_x2/keymaps/hhkb_60/keymap.c delete mode 100644 keyboards/alf_x2/readme.md delete mode 100644 keyboards/alf_x2/rules.mk delete mode 100644 keyboards/dc60/config.h delete mode 100644 keyboards/dc60/dc60.c delete mode 100644 keyboards/dc60/dc60.h delete mode 100644 keyboards/dc60/info.json delete mode 100644 keyboards/dc60/keymaps/default/config.h delete mode 100644 keyboards/dc60/keymaps/default/keymap.c delete mode 100644 keyboards/dc60/keymaps/default/readme.md delete mode 100644 keyboards/dc60/readme.md delete mode 100644 keyboards/dc60/rules.mk diff --git a/keyboards/alf/dc60/config.h b/keyboards/alf/dc60/config.h new file mode 100644 index 0000000000..f6e527119f --- /dev/null +++ b/keyboards/alf/dc60/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Alf +#define PRODUCT dc60 +#define DESCRIPTION custom 60% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 20 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/alf/dc60/dc60.c b/keyboards/alf/dc60/dc60.c new file mode 100644 index 0000000000..70979adf4e --- /dev/null +++ b/keyboards/alf/dc60/dc60.c @@ -0,0 +1,49 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "dc60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 7); + PORTB &= ~(1 << 7); + } else { + DDRB &= ~(1 << 7); + PORTB &= ~(1 << 7); + } + + led_set_user(usb_led); +} diff --git a/keyboards/alf/dc60/dc60.h b/keyboards/alf/dc60/dc60.h new file mode 100644 index 0000000000..30e05b31f0 --- /dev/null +++ b/keyboards/alf/dc60/dc60.h @@ -0,0 +1,42 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef DC60_H +#define DC60_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments representing the physical +// layout of the board and position of the keys +// The second converts the arguments into a two-dimensional array which +// represents the switch matrix. +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ + { K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ +} + +#endif diff --git a/keyboards/alf/dc60/info.json b/keyboards/alf/dc60/info.json new file mode 100644 index 0000000000..3929545205 --- /dev/null +++ b/keyboards/alf/dc60/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "dc60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/alf/dc60/keymaps/default/config.h b/keyboards/alf/dc60/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/alf/dc60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/alf/dc60/keymaps/default/keymap.c b/keyboards/alf/dc60/keymaps/default/keymap.c new file mode 100644 index 0000000000..b7425178bc --- /dev/null +++ b/keyboards/alf/dc60/keymaps/default/keymap.c @@ -0,0 +1,70 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_BSPC, + 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_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_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_RGUI, KC_RGUI, KC_RCTL + ), + + [1] = 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/alf/dc60/keymaps/default/readme.md b/keyboards/alf/dc60/keymaps/default/readme.md new file mode 100644 index 0000000000..85bef5fc7b --- /dev/null +++ b/keyboards/alf/dc60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for dc60 diff --git a/keyboards/alf/dc60/readme.md b/keyboards/alf/dc60/readme.md new file mode 100644 index 0000000000..d8e20a8f4f --- /dev/null +++ b/keyboards/alf/dc60/readme.md @@ -0,0 +1,15 @@ +# dc60 + +![dc60](imgur.com image replace me!) + +A 60% PCB sold with the Alf DC60. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: DC60 PCB +Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=96616.0) + +Make example for this keyboard (after setting up your build environment): + + make alf/dc60: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/alf/dc60/rules.mk b/keyboards/alf/dc60/rules.mk new file mode 100644 index 0000000000..9ad6d7875e --- /dev/null +++ b/keyboards/alf/dc60/rules.mk @@ -0,0 +1,70 @@ +# 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 + + +# Boot Section Size in *bytes* +# 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 = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) diff --git a/keyboards/alf/x2/config.h b/keyboards/alf/x2/config.h new file mode 100644 index 0000000000..31212ce336 --- /dev/null +++ b/keyboards/alf/x2/config.h @@ -0,0 +1,58 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ALF +#define PRODUCT X2 +#define DESCRIPTION ALF X2 60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 4 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif \ No newline at end of file diff --git a/keyboards/alf/x2/info.json b/keyboards/alf/x2/info.json new file mode 100644 index 0000000000..85db6d69ae --- /dev/null +++ b/keyboards/alf/x2/info.json @@ -0,0 +1,32 @@ +{ + "keyboard_name": "ALF X2", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"x":0, "y":4}, {"x":1, "y":4}, {"label":"Z", "x":2, "y":4}, {"label":"X", "x":3, "y":4}, {"label":"C", "x":4, "y":4}, {"label":"V", "x":5, "y":4}, {"label":"B", "x":6, "y":4}, {"label":"N", "x":7, "y":4}, {"label":"M", "x":8, "y":4}, {"label":"<", "x":9, "y":4}, {"label":">", "x":10, "y":4}, {"label":"?", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] + }, + + "LAYOUT_std_ansi": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":2.75}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}] + }, + + "LAYOUT_std_splits": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}] + }, + + "LAYOUT_hhkb": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"label":"Win", "x":1.5, "y":5, "w":1.25}, {"label":"Alt", "x":2.75, "y":5, "w":1.5}, {"x":4.25, "y":5, "w":6.25}, {"label":"Alt", "x":10.5, "y":5, "w":1.5}, {"label":"Win", "x":12, "y":5, "w":1.25}] + }, + + "LAYOUT_split_arrows": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4, "w":1.75}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] + }, + + "LAYOUT_2u_split_arrows": { + "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4}, {"x":1, "y":4}, {"label":"Z", "x":2, "y":4}, {"label":"X", "x":3, "y":4}, {"label":"C", "x":4, "y":4}, {"label":"V", "x":5, "y":4}, {"label":"B", "x":6, "y":4}, {"label":"N", "x":7, "y":4}, {"label":"M", "x":8, "y":4}, {"label":"<", "x":9, "y":4}, {"label":">", "x":10, "y":4}, {"label":"?", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] + } + } +} \ No newline at end of file diff --git a/keyboards/alf/x2/keymaps/default/keymap.c b/keyboards/alf/x2/keymaps/default/keymap.c new file mode 100644 index 0000000000..9470e38b56 --- /dev/null +++ b/keyboards/alf/x2/keymaps/default/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_VOLU, KC_VOLD, + KC_ESC, 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_NO, KC_BSPC, + 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_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_NO, KC_RSFT, KC_NO, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL), + + LAYOUT( + KC_MNXT, KC_MPRV, + KC_GRV, 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_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } +} diff --git a/keyboards/alf/x2/keymaps/hhkb_60/keymap.c b/keyboards/alf/x2/keymaps/hhkb_60/keymap.c new file mode 100644 index 0000000000..8baba1ae9d --- /dev/null +++ b/keyboards/alf/x2/keymaps/hhkb_60/keymap.c @@ -0,0 +1,42 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_VOLU, KC_VOLD, + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_NO, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL), + + LAYOUT( + KC_MNXT, KC_MPRV, + KC_NO, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } +} \ No newline at end of file diff --git a/keyboards/alf/x2/readme.md b/keyboards/alf/x2/readme.md new file mode 100644 index 0000000000..b171b5c793 --- /dev/null +++ b/keyboards/alf/x2/readme.md @@ -0,0 +1,15 @@ +# X2 + +![x2](https://cdn.shopify.com/s/files/1/1674/0405/products/1_088c2862-1f68-4fdd-a346-965208c3a3de_1024x1024.png?v=1511296076) + +A customizable 60% keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: ALF X2 60% +Hardware Availability: [zFrontier](https://en.zfrontier.com/products/group-buy-alf-x2-60) + +Make example for this keyboard (after setting up your build environment): + + make alf/x2: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/alf/x2/rules.mk b/keyboards/alf/x2/rules.mk new file mode 100644 index 0000000000..9c4082da29 --- /dev/null +++ b/keyboards/alf/x2/rules.mk @@ -0,0 +1,56 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/alf/x2/x2.c b/keyboards/alf/x2/x2.c new file mode 100644 index 0000000000..111712f0b5 --- /dev/null +++ b/keyboards/alf/x2/x2.c @@ -0,0 +1 @@ +#include "x2.h" diff --git a/keyboards/alf/x2/x2.h b/keyboards/alf/x2/x2.h new file mode 100644 index 0000000000..c6c587aea9 --- /dev/null +++ b/keyboards/alf/x2/x2.h @@ -0,0 +1,98 @@ +#ifndef X2_H +#define X2_H + +#include "quantum.h" + +// K404 and K408 are the microswitches at the top of the PCB + +#define LAYOUT( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K403, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ +} + +#define LAYOUT_std_ansi( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ +} + +#define LAYOUT_std_splits( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K403, K406, K410, K411, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ +} + +#define LAYOUT_hhkb( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K401, K403, K406, K410, K411 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { KC_NO, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, KC_NO, KC_NO } \ +} + +#define LAYOUT_2u_split_arrows( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K403, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ +} + +#define LAYOUT_split_arrows( \ + K404, K408, \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ + K400, K401, K403, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ +} + +#endif diff --git a/keyboards/alf_x2/alf_x2.c b/keyboards/alf_x2/alf_x2.c deleted file mode 100644 index cc22d872a5..0000000000 --- a/keyboards/alf_x2/alf_x2.c +++ /dev/null @@ -1 +0,0 @@ -#include "alf_x2.h" diff --git a/keyboards/alf_x2/alf_x2.h b/keyboards/alf_x2/alf_x2.h deleted file mode 100644 index 4ff20cc919..0000000000 --- a/keyboards/alf_x2/alf_x2.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef ALF_X2_H -#define ALF_X2_H - -#include "quantum.h" - -// K404 and K408 are the microswitches at the top of the PCB - -#define LAYOUT( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ -} - -#define LAYOUT_std_ansi( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ -} - -#define LAYOUT_std_splits( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ -} - -#define LAYOUT_hhkb( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K401, K403, K406, K410, K411 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { KC_NO, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, KC_NO, KC_NO } \ -} - -#define LAYOUT_2u_split_arrows( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ -} - -#define LAYOUT_split_arrows( \ - K404, K408, \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ -} - -#endif \ No newline at end of file diff --git a/keyboards/alf_x2/config.h b/keyboards/alf_x2/config.h deleted file mode 100644 index 31212ce336..0000000000 --- a/keyboards/alf_x2/config.h +++ /dev/null @@ -1,58 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER ALF -#define PRODUCT X2 -#define DESCRIPTION ALF X2 60 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } -#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - -#define RGB_DI_PIN E2 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 4 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif \ No newline at end of file diff --git a/keyboards/alf_x2/info.json b/keyboards/alf_x2/info.json deleted file mode 100644 index 85db6d69ae..0000000000 --- a/keyboards/alf_x2/info.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "keyboard_name": "ALF X2", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 6, - "layouts": { - "LAYOUT": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"x":0, "y":4}, {"x":1, "y":4}, {"label":"Z", "x":2, "y":4}, {"label":"X", "x":3, "y":4}, {"label":"C", "x":4, "y":4}, {"label":"V", "x":5, "y":4}, {"label":"B", "x":6, "y":4}, {"label":"N", "x":7, "y":4}, {"label":"M", "x":8, "y":4}, {"label":"<", "x":9, "y":4}, {"label":">", "x":10, "y":4}, {"label":"?", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] - }, - - "LAYOUT_std_ansi": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":2.75}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}] - }, - - "LAYOUT_std_splits": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5, "w":1.25}, {"label":"Win", "x":11.25, "y":5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5, "w":1.25}] - }, - - "LAYOUT_hhkb": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"label":"Win", "x":1.5, "y":5, "w":1.25}, {"label":"Alt", "x":2.75, "y":5, "w":1.5}, {"x":4.25, "y":5, "w":6.25}, {"label":"Alt", "x":10.5, "y":5, "w":1.5}, {"label":"Win", "x":12, "y":5, "w":1.25}] - }, - - "LAYOUT_split_arrows": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4, "w":1.75}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] - }, - - "LAYOUT_2u_split_arrows": { - "layout": [{"x":1.5, "y":0}, {"x":2.5, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"Shift", "x":0, "y":4}, {"x":1, "y":4}, {"label":"Z", "x":2, "y":4}, {"label":"X", "x":3, "y":4}, {"label":"C", "x":4, "y":4}, {"label":"V", "x":5, "y":4}, {"label":"B", "x":6, "y":4}, {"label":"N", "x":7, "y":4}, {"label":"M", "x":8, "y":4}, {"label":"<", "x":9, "y":4}, {"label":">", "x":10, "y":4}, {"label":"?", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Menu", "x":12, "y":5}, {"label":"Ctrl", "x":13, "y":5}, {"x":14, "y":5}] - } - } -} \ No newline at end of file diff --git a/keyboards/alf_x2/keymaps/default/keymap.c b/keyboards/alf_x2/keymaps/default/keymap.c deleted file mode 100644 index 9470e38b56..0000000000 --- a/keyboards/alf_x2/keymaps/default/keymap.c +++ /dev/null @@ -1,42 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_VOLU, KC_VOLD, - KC_ESC, 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_NO, KC_BSPC, - 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_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_NO, KC_RSFT, KC_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_NO, KC_APP, KC_RCTL), - - LAYOUT( - KC_MNXT, KC_MPRV, - KC_GRV, 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_TRNS, KC_DEL, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_DOWN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} diff --git a/keyboards/alf_x2/keymaps/hhkb_60/keymap.c b/keyboards/alf_x2/keymaps/hhkb_60/keymap.c deleted file mode 100644 index 8baba1ae9d..0000000000 --- a/keyboards/alf_x2/keymaps/hhkb_60/keymap.c +++ /dev/null @@ -1,42 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - LAYOUT( - KC_VOLU, KC_VOLD, - KC_ESC, 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_BSLS, KC_GRV, - 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_BSPC, - KC_LCTL, 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_NO, KC_RSFT, MO(1), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL), - - LAYOUT( - KC_MNXT, KC_MPRV, - KC_NO, 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_INS, KC_DEL, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, - KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_DOWN, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); - } else { - DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); - } -} \ No newline at end of file diff --git a/keyboards/alf_x2/readme.md b/keyboards/alf_x2/readme.md deleted file mode 100644 index ece339fa96..0000000000 --- a/keyboards/alf_x2/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ALF X2 - -![alf_x2](https://cdn.shopify.com/s/files/1/1674/0405/products/1_088c2862-1f68-4fdd-a346-965208c3a3de_1024x1024.png?v=1511296076) - -A customizable 60% keyboard. - -Keyboard Maintainer: QMK Community -Hardware Supported: ALF X2 60% -Hardware Availability: [zFrontier](https://en.zfrontier.com/products/group-buy-alf-x2-60) - -Make example for this keyboard (after setting up your build environment): - - make alf_x2:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/alf_x2/rules.mk b/keyboards/alf_x2/rules.mk deleted file mode 100644 index 9c4082da29..0000000000 --- a/keyboards/alf_x2/rules.mk +++ /dev/null @@ -1,56 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes \ No newline at end of file diff --git a/keyboards/dc60/config.h b/keyboards/dc60/config.h deleted file mode 100644 index f6e527119f..0000000000 --- a/keyboards/dc60/config.h +++ /dev/null @@ -1,224 +0,0 @@ -/* -Copyright 2018 MechMerlin - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Alf -#define PRODUCT dc60 -#define DESCRIPTION custom 60% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } -#define MATRIX_COL_PINS { B5, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B6 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 5 - -#define RGB_DI_PIN E6 -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 20 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/dc60/dc60.c b/keyboards/dc60/dc60.c deleted file mode 100644 index 70979adf4e..0000000000 --- a/keyboards/dc60/dc60.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include "dc60.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 7); - PORTB &= ~(1 << 7); - } else { - DDRB &= ~(1 << 7); - PORTB &= ~(1 << 7); - } - - led_set_user(usb_led); -} diff --git a/keyboards/dc60/dc60.h b/keyboards/dc60/dc60.h deleted file mode 100644 index 30e05b31f0..0000000000 --- a/keyboards/dc60/dc60.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#ifndef DC60_H -#define DC60_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -// The following is an example using the Planck MIT layout -// The first section contains all of the arguments representing the physical -// layout of the board and position of the keys -// The second converts the arguments into a two-dimensional array which -// represents the switch matrix. -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE, \ - K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ - K40, K42, K43, K45, K47, K48, K4A, K4B, K4C, K4D, K4E \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KOD, KOE }, \ - { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ - { K40, KC_NO, K42, K43, KC_NO, K45, KC_NO, K47, K48, KC_NO, K4A, K4B, K4C, K4D, K4E }, \ -} - -#endif diff --git a/keyboards/dc60/info.json b/keyboards/dc60/info.json deleted file mode 100644 index 3929545205..0000000000 --- a/keyboards/dc60/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "dc60", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] - } - } -} \ No newline at end of file diff --git a/keyboards/dc60/keymaps/default/config.h b/keyboards/dc60/keymaps/default/config.h deleted file mode 100644 index a3ed4f762a..0000000000 --- a/keyboards/dc60/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 - -// place overrides here diff --git a/keyboards/dc60/keymaps/default/keymap.c b/keyboards/dc60/keymaps/default/keymap.c deleted file mode 100644 index b7425178bc..0000000000 --- a/keyboards/dc60/keymaps/default/keymap.c +++ /dev/null @@ -1,70 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, 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_BSPC, - 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_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_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_SPACE, KC_SPACE, KC_RALT, MO(1), KC_RGUI, KC_RGUI, KC_RCTL - ), - - [1] = 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/dc60/keymaps/default/readme.md b/keyboards/dc60/keymaps/default/readme.md deleted file mode 100644 index 85bef5fc7b..0000000000 --- a/keyboards/dc60/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for dc60 diff --git a/keyboards/dc60/readme.md b/keyboards/dc60/readme.md deleted file mode 100644 index 9d70143199..0000000000 --- a/keyboards/dc60/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# dc60 - -![dc60](imgur.com image replace me!) - -A 60% PCB sold with the Alf DC60. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: DC60 PCB -Hardware Availability: [Geekhack GB](https://geekhack.org/index.php?topic=96616.0) - -Make example for this keyboard (after setting up your build environment): - - make dc60:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/dc60/rules.mk b/keyboards/dc60/rules.mk deleted file mode 100644 index 9ad6d7875e..0000000000 --- a/keyboards/dc60/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# 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 - - -# Boot Section Size in *bytes* -# 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 = no # 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default -RGBLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From ce122c4981c71d33a85db94c787d5ec7a823acc6 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 13 Sep 2018 09:40:43 -0700 Subject: Keyboard: Shuffle keyboards into thevankeyboards directory (#3895) * move tv44 to thevankeyboards directory * move bananasplit to thevankeyboards * move roadkit to thevankeyboards directory * add a basic readme * update readmes to correct the make instructions and add more help text * rename tv44 to minivan as per Jack's suggestions * update readme * rename tv44 to minivan * update tv44 to minivan * change includes for tv44 to minivan * remove extra includes --- keyboards/bananasplit/README.md | 15 - keyboards/bananasplit/bananasplit.c | 28 -- keyboards/bananasplit/bananasplit.h | 142 ------- keyboards/bananasplit/config.h | 84 ---- keyboards/bananasplit/info.json | 32 -- keyboards/bananasplit/keymaps/0010/config.h | 24 -- keyboards/bananasplit/keymaps/0010/keymap.c | 73 ---- keyboards/bananasplit/keymaps/0010/rules.mk | 37 -- .../bananasplit/keymaps/coloneljesus/config.h | 27 -- .../bananasplit/keymaps/coloneljesus/keymap.c | 96 ----- .../bananasplit/keymaps/coloneljesus/readme.md | 33 -- .../bananasplit/keymaps/coloneljesus/rules.mk | 37 -- keyboards/bananasplit/keymaps/default/config.h | 24 -- keyboards/bananasplit/keymaps/default/keymap.c | 25 -- keyboards/bananasplit/keymaps/default/readme.md | 1 - keyboards/bananasplit/keymaps/default/rules.mk | 37 -- keyboards/bananasplit/keymaps/hhkbanana/keymap.c | 25 -- .../bananasplit/keymaps/jockyxu1122_ansi/keymap.c | 92 ----- .../bananasplit/keymaps/jockyxu1122_ansi/readme.md | 66 ---- .../bananasplit/keymaps/jockyxu1122_iso/keymap.c | 105 ----- .../bananasplit/keymaps/jockyxu1122_iso/readme.md | 61 --- keyboards/bananasplit/keymaps/kamon/config.h | 25 -- keyboards/bananasplit/keymaps/kamon/keymap.c | 96 ----- keyboards/bananasplit/keymaps/kamon/readme.md | 34 -- keyboards/bananasplit/keymaps/kamon/rules.mk | 37 -- keyboards/bananasplit/keymaps/nic/keymap.c | 45 --- keyboards/bananasplit/keymaps/rask/README.md | 53 --- keyboards/bananasplit/keymaps/rask/keymap.c | 72 ---- keyboards/bananasplit/keymaps/talljoe/config.h | 23 -- keyboards/bananasplit/keymaps/talljoe/keymap.c | 1 - keyboards/bananasplit/rules.mk | 66 ---- keyboards/roadkit/config.h | 162 -------- keyboards/roadkit/info.json | 15 - keyboards/roadkit/keymaps/default/config.h | 8 - keyboards/roadkit/keymaps/default/keymap.c | 48 --- keyboards/roadkit/keymaps/default/readme.md | 1 - keyboards/roadkit/keymaps/default/rules.mk | 21 - keyboards/roadkit/keymaps/flipphone/config.h | 8 - keyboards/roadkit/keymaps/flipphone/keymap.c | 219 ----------- keyboards/roadkit/keymaps/flipphone/readme.md | 26 -- keyboards/roadkit/keymaps/flipphone/rules.mk | 21 - keyboards/roadkit/keymaps/khord/config.h | 15 - keyboards/roadkit/keymaps/khord/keymap.c | 112 ------ keyboards/roadkit/keymaps/khord/rules.mk | 22 -- keyboards/roadkit/keymaps/mjt/config.h | 8 - keyboards/roadkit/keymaps/mjt/keymap.c | 239 ------------ keyboards/roadkit/keymaps/mjt/readme.md | 22 -- keyboards/roadkit/keymaps/mjt/rules.mk | 21 - keyboards/roadkit/keymaps/singles/config.h | 8 - keyboards/roadkit/keymaps/singles/keymap.c | 61 --- keyboards/roadkit/keymaps/singles/readme.md | 3 - keyboards/roadkit/keymaps/singles/rules.mk | 21 - keyboards/roadkit/keymaps/singlesBrent/config.h | 15 - keyboards/roadkit/keymaps/singlesBrent/keymap.c | 242 ------------ keyboards/roadkit/keymaps/singlesBrent/readme.md | 3 - keyboards/roadkit/keymaps/singlesBrent/rules.mk | 22 -- keyboards/roadkit/readme.md | 14 - keyboards/roadkit/roadkit.c | 28 -- keyboards/roadkit/roadkit.h | 33 -- keyboards/roadkit/rules.mk | 71 ---- keyboards/thevankeyboards/bananasplit/README.md | 14 + .../thevankeyboards/bananasplit/bananasplit.c | 28 ++ .../thevankeyboards/bananasplit/bananasplit.h | 142 +++++++ keyboards/thevankeyboards/bananasplit/config.h | 84 ++++ keyboards/thevankeyboards/bananasplit/info.json | 32 ++ .../bananasplit/keymaps/0010/config.h | 24 ++ .../bananasplit/keymaps/0010/keymap.c | 73 ++++ .../bananasplit/keymaps/0010/rules.mk | 37 ++ .../bananasplit/keymaps/coloneljesus/config.h | 27 ++ .../bananasplit/keymaps/coloneljesus/keymap.c | 96 +++++ .../bananasplit/keymaps/coloneljesus/readme.md | 33 ++ .../bananasplit/keymaps/coloneljesus/rules.mk | 37 ++ .../bananasplit/keymaps/default/config.h | 24 ++ .../bananasplit/keymaps/default/keymap.c | 25 ++ .../bananasplit/keymaps/default/readme.md | 1 + .../bananasplit/keymaps/default/rules.mk | 37 ++ .../bananasplit/keymaps/hhkbanana/keymap.c | 25 ++ .../bananasplit/keymaps/jockyxu1122_ansi/keymap.c | 92 +++++ .../bananasplit/keymaps/jockyxu1122_ansi/readme.md | 66 ++++ .../bananasplit/keymaps/jockyxu1122_iso/keymap.c | 105 +++++ .../bananasplit/keymaps/jockyxu1122_iso/readme.md | 61 +++ .../bananasplit/keymaps/kamon/config.h | 25 ++ .../bananasplit/keymaps/kamon/keymap.c | 96 +++++ .../bananasplit/keymaps/kamon/readme.md | 34 ++ .../bananasplit/keymaps/kamon/rules.mk | 37 ++ .../bananasplit/keymaps/nic/keymap.c | 45 +++ .../bananasplit/keymaps/rask/README.md | 53 +++ .../bananasplit/keymaps/rask/keymap.c | 72 ++++ .../bananasplit/keymaps/talljoe/config.h | 23 ++ .../bananasplit/keymaps/talljoe/keymap.c | 1 + keyboards/thevankeyboards/bananasplit/rules.mk | 66 ++++ keyboards/thevankeyboards/minivan/config.h | 162 ++++++++ keyboards/thevankeyboards/minivan/info.json | 24 ++ .../thevankeyboards/minivan/keymaps/belak/config.h | 8 + .../thevankeyboards/minivan/keymaps/belak/keymap.c | 102 +++++ .../minivan/keymaps/belak/readme.md | 14 + .../thevankeyboards/minivan/keymaps/belak/rules.mk | 12 + .../thevankeyboards/minivan/keymaps/budi/config.h | 22 ++ .../thevankeyboards/minivan/keymaps/budi/keymap.c | 229 +++++++++++ .../thevankeyboards/minivan/keymaps/budi/readme.md | 17 + .../thevankeyboards/minivan/keymaps/core/keymap.c | 32 ++ .../thevankeyboards/minivan/keymaps/core/readme.md | 18 + .../thevankeyboards/minivan/keymaps/core/rules.mk | 3 + .../minivan/keymaps/default/config.h | 8 + .../minivan/keymaps/default/keymap.c | 99 +++++ .../minivan/keymaps/default/readme.md | 1 + .../minivan/keymaps/default/rules.mk | 21 + .../minivan/keymaps/jeebak/keymap.c | 423 ++++++++++++++++++++ .../minivan/keymaps/jeebak/readme.md | 129 +++++++ .../minivan/keymaps/jeebak/rules.mk | 21 + .../minivan/keymaps/jetpacktuxedo/config.h | 7 + .../minivan/keymaps/jetpacktuxedo/keymap.c | 39 ++ .../minivan/keymaps/jetpacktuxedo/readme.md | 49 +++ .../minivan/keymaps/jetpacktuxedo/rules.mk | 17 + .../thevankeyboards/minivan/keymaps/mjt/config.h | 14 + .../thevankeyboards/minivan/keymaps/mjt/keymap.c | 197 ++++++++++ .../thevankeyboards/minivan/keymaps/mjt/readme.md | 26 ++ .../thevankeyboards/minivan/keymaps/mjt/rules.mk | 21 + .../thevankeyboards/minivan/keymaps/smt/keymap.c | 230 +++++++++++ .../thevankeyboards/minivan/keymaps/smt/readme.md | 126 ++++++ .../thevankeyboards/minivan/keymaps/smt/rules.mk | 21 + .../minivan/keymaps/tong92/config.h | 12 + .../minivan/keymaps/tong92/keymap.c | 203 ++++++++++ .../minivan/keymaps/tong92/readme.md | 52 +++ .../minivan/keymaps/tong92/rules.mk | 21 + .../minivan/keymaps/xyverz/config.h | 8 + .../minivan/keymaps/xyverz/keymap.c | 124 ++++++ .../minivan/keymaps/xyverz/readme.md | 1 + .../minivan/keymaps/xyverz/rules.mk | 21 + keyboards/thevankeyboards/minivan/minivan.c | 28 ++ keyboards/thevankeyboards/minivan/minivan.h | 67 ++++ keyboards/thevankeyboards/minivan/readme.md | 13 + keyboards/thevankeyboards/minivan/rules.mk | 69 ++++ keyboards/thevankeyboards/readme.md | 3 + keyboards/thevankeyboards/roadkit/config.h | 162 ++++++++ keyboards/thevankeyboards/roadkit/info.json | 15 + .../roadkit/keymaps/default/config.h | 8 + .../roadkit/keymaps/default/keymap.c | 48 +++ .../roadkit/keymaps/default/readme.md | 1 + .../roadkit/keymaps/default/rules.mk | 21 + .../roadkit/keymaps/flipphone/config.h | 8 + .../roadkit/keymaps/flipphone/keymap.c | 219 +++++++++++ .../roadkit/keymaps/flipphone/readme.md | 26 ++ .../roadkit/keymaps/flipphone/rules.mk | 21 + .../thevankeyboards/roadkit/keymaps/khord/config.h | 15 + .../thevankeyboards/roadkit/keymaps/khord/keymap.c | 112 ++++++ .../thevankeyboards/roadkit/keymaps/khord/rules.mk | 22 ++ .../thevankeyboards/roadkit/keymaps/mjt/config.h | 8 + .../thevankeyboards/roadkit/keymaps/mjt/keymap.c | 239 ++++++++++++ .../thevankeyboards/roadkit/keymaps/mjt/readme.md | 22 ++ .../thevankeyboards/roadkit/keymaps/mjt/rules.mk | 21 + .../roadkit/keymaps/singles/config.h | 8 + .../roadkit/keymaps/singles/keymap.c | 61 +++ .../roadkit/keymaps/singles/readme.md | 3 + .../roadkit/keymaps/singles/rules.mk | 21 + .../roadkit/keymaps/singlesBrent/config.h | 15 + .../roadkit/keymaps/singlesBrent/keymap.c | 242 ++++++++++++ .../roadkit/keymaps/singlesBrent/readme.md | 3 + .../roadkit/keymaps/singlesBrent/rules.mk | 22 ++ keyboards/thevankeyboards/roadkit/readme.md | 13 + keyboards/thevankeyboards/roadkit/roadkit.c | 28 ++ keyboards/thevankeyboards/roadkit/roadkit.h | 33 ++ keyboards/thevankeyboards/roadkit/rules.mk | 71 ++++ keyboards/tv44/config.h | 162 -------- keyboards/tv44/info.json | 24 -- keyboards/tv44/keymaps/belak/config.h | 8 - keyboards/tv44/keymaps/belak/keymap.c | 105 ----- keyboards/tv44/keymaps/belak/readme.md | 14 - keyboards/tv44/keymaps/belak/rules.mk | 12 - keyboards/tv44/keymaps/budi/config.h | 22 -- keyboards/tv44/keymaps/budi/keymap.c | 229 ----------- keyboards/tv44/keymaps/budi/readme.md | 17 - keyboards/tv44/keymaps/core/keymap.c | 34 -- keyboards/tv44/keymaps/core/readme.md | 18 - keyboards/tv44/keymaps/core/rules.mk | 3 - keyboards/tv44/keymaps/default/config.h | 8 - keyboards/tv44/keymaps/default/keymap.c | 101 ----- keyboards/tv44/keymaps/default/readme.md | 1 - keyboards/tv44/keymaps/default/rules.mk | 21 - keyboards/tv44/keymaps/jeebak/keymap.c | 425 --------------------- keyboards/tv44/keymaps/jeebak/readme.md | 129 ------- keyboards/tv44/keymaps/jeebak/rules.mk | 21 - keyboards/tv44/keymaps/jetpacktuxedo/config.h | 7 - keyboards/tv44/keymaps/jetpacktuxedo/keymap.c | 39 -- keyboards/tv44/keymaps/jetpacktuxedo/readme.md | 49 --- keyboards/tv44/keymaps/jetpacktuxedo/rules.mk | 17 - keyboards/tv44/keymaps/mjt/config.h | 14 - keyboards/tv44/keymaps/mjt/keymap.c | 199 ---------- keyboards/tv44/keymaps/mjt/readme.md | 26 -- keyboards/tv44/keymaps/mjt/rules.mk | 21 - keyboards/tv44/keymaps/smt/keymap.c | 232 ----------- keyboards/tv44/keymaps/smt/readme.md | 126 ------ keyboards/tv44/keymaps/smt/rules.mk | 21 - keyboards/tv44/keymaps/tong92/config.h | 12 - keyboards/tv44/keymaps/tong92/keymap.c | 205 ---------- keyboards/tv44/keymaps/tong92/readme.md | 52 --- keyboards/tv44/keymaps/tong92/rules.mk | 21 - keyboards/tv44/keymaps/xyverz/config.h | 8 - keyboards/tv44/keymaps/xyverz/keymap.c | 126 ------ keyboards/tv44/keymaps/xyverz/readme.md | 1 - keyboards/tv44/keymaps/xyverz/rules.mk | 21 - keyboards/tv44/readme.md | 14 - keyboards/tv44/rules.mk | 69 ---- keyboards/tv44/tv44.c | 28 -- keyboards/tv44/tv44.h | 67 ---- 205 files changed, 5717 insertions(+), 5734 deletions(-) delete mode 100644 keyboards/bananasplit/README.md delete mode 100644 keyboards/bananasplit/bananasplit.c delete mode 100644 keyboards/bananasplit/bananasplit.h delete mode 100644 keyboards/bananasplit/config.h delete mode 100644 keyboards/bananasplit/info.json delete mode 100644 keyboards/bananasplit/keymaps/0010/config.h delete mode 100644 keyboards/bananasplit/keymaps/0010/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/0010/rules.mk delete mode 100644 keyboards/bananasplit/keymaps/coloneljesus/config.h delete mode 100644 keyboards/bananasplit/keymaps/coloneljesus/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/coloneljesus/readme.md delete mode 100644 keyboards/bananasplit/keymaps/coloneljesus/rules.mk delete mode 100644 keyboards/bananasplit/keymaps/default/config.h delete mode 100644 keyboards/bananasplit/keymaps/default/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/default/readme.md delete mode 100644 keyboards/bananasplit/keymaps/default/rules.mk delete mode 100644 keyboards/bananasplit/keymaps/hhkbanana/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md delete mode 100644 keyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md delete mode 100644 keyboards/bananasplit/keymaps/kamon/config.h delete mode 100644 keyboards/bananasplit/keymaps/kamon/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/kamon/readme.md delete mode 100644 keyboards/bananasplit/keymaps/kamon/rules.mk delete mode 100644 keyboards/bananasplit/keymaps/nic/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/rask/README.md delete mode 100644 keyboards/bananasplit/keymaps/rask/keymap.c delete mode 100644 keyboards/bananasplit/keymaps/talljoe/config.h delete mode 100644 keyboards/bananasplit/keymaps/talljoe/keymap.c delete mode 100644 keyboards/bananasplit/rules.mk delete mode 100644 keyboards/roadkit/config.h delete mode 100644 keyboards/roadkit/info.json delete mode 100644 keyboards/roadkit/keymaps/default/config.h delete mode 100644 keyboards/roadkit/keymaps/default/keymap.c delete mode 100644 keyboards/roadkit/keymaps/default/readme.md delete mode 100644 keyboards/roadkit/keymaps/default/rules.mk delete mode 100644 keyboards/roadkit/keymaps/flipphone/config.h delete mode 100644 keyboards/roadkit/keymaps/flipphone/keymap.c delete mode 100644 keyboards/roadkit/keymaps/flipphone/readme.md delete mode 100644 keyboards/roadkit/keymaps/flipphone/rules.mk delete mode 100644 keyboards/roadkit/keymaps/khord/config.h delete mode 100644 keyboards/roadkit/keymaps/khord/keymap.c delete mode 100644 keyboards/roadkit/keymaps/khord/rules.mk delete mode 100644 keyboards/roadkit/keymaps/mjt/config.h delete mode 100644 keyboards/roadkit/keymaps/mjt/keymap.c delete mode 100644 keyboards/roadkit/keymaps/mjt/readme.md delete mode 100644 keyboards/roadkit/keymaps/mjt/rules.mk delete mode 100644 keyboards/roadkit/keymaps/singles/config.h delete mode 100644 keyboards/roadkit/keymaps/singles/keymap.c delete mode 100644 keyboards/roadkit/keymaps/singles/readme.md delete mode 100644 keyboards/roadkit/keymaps/singles/rules.mk delete mode 100644 keyboards/roadkit/keymaps/singlesBrent/config.h delete mode 100644 keyboards/roadkit/keymaps/singlesBrent/keymap.c delete mode 100644 keyboards/roadkit/keymaps/singlesBrent/readme.md delete mode 100644 keyboards/roadkit/keymaps/singlesBrent/rules.mk delete mode 100644 keyboards/roadkit/readme.md delete mode 100644 keyboards/roadkit/roadkit.c delete mode 100644 keyboards/roadkit/roadkit.h delete mode 100644 keyboards/roadkit/rules.mk create mode 100644 keyboards/thevankeyboards/bananasplit/README.md create mode 100644 keyboards/thevankeyboards/bananasplit/bananasplit.c create mode 100644 keyboards/thevankeyboards/bananasplit/bananasplit.h create mode 100644 keyboards/thevankeyboards/bananasplit/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/info.json create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/0010/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/readme.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/default/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/default/readme.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/kamon/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/kamon/readme.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/rask/README.md create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/rask/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h create mode 100644 keyboards/thevankeyboards/bananasplit/keymaps/talljoe/keymap.c create mode 100644 keyboards/thevankeyboards/bananasplit/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/config.h create mode 100644 keyboards/thevankeyboards/minivan/info.json create mode 100644 keyboards/thevankeyboards/minivan/keymaps/belak/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/belak/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/budi/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/budi/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/core/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/core/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/core/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/default/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/default/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/default/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/default/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jeebak/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/mjt/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/mjt/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/smt/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/tong92/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/tong92/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/keymaps/xyverz/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/xyverz/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk create mode 100644 keyboards/thevankeyboards/minivan/minivan.c create mode 100644 keyboards/thevankeyboards/minivan/minivan.h create mode 100644 keyboards/thevankeyboards/minivan/readme.md create mode 100644 keyboards/thevankeyboards/minivan/rules.mk create mode 100644 keyboards/thevankeyboards/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/config.h create mode 100644 keyboards/thevankeyboards/roadkit/info.json create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/default/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/default/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/flipphone/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/flipphone/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/khord/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/mjt/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/mjt/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singles/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singles/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/config.h create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk create mode 100644 keyboards/thevankeyboards/roadkit/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/roadkit.c create mode 100644 keyboards/thevankeyboards/roadkit/roadkit.h create mode 100644 keyboards/thevankeyboards/roadkit/rules.mk delete mode 100644 keyboards/tv44/config.h delete mode 100644 keyboards/tv44/info.json delete mode 100644 keyboards/tv44/keymaps/belak/config.h delete mode 100644 keyboards/tv44/keymaps/belak/keymap.c delete mode 100644 keyboards/tv44/keymaps/belak/readme.md delete mode 100644 keyboards/tv44/keymaps/belak/rules.mk delete mode 100644 keyboards/tv44/keymaps/budi/config.h delete mode 100644 keyboards/tv44/keymaps/budi/keymap.c delete mode 100644 keyboards/tv44/keymaps/budi/readme.md delete mode 100644 keyboards/tv44/keymaps/core/keymap.c delete mode 100644 keyboards/tv44/keymaps/core/readme.md delete mode 100644 keyboards/tv44/keymaps/core/rules.mk delete mode 100644 keyboards/tv44/keymaps/default/config.h delete mode 100644 keyboards/tv44/keymaps/default/keymap.c delete mode 100644 keyboards/tv44/keymaps/default/readme.md delete mode 100644 keyboards/tv44/keymaps/default/rules.mk delete mode 100644 keyboards/tv44/keymaps/jeebak/keymap.c delete mode 100644 keyboards/tv44/keymaps/jeebak/readme.md delete mode 100644 keyboards/tv44/keymaps/jeebak/rules.mk delete mode 100644 keyboards/tv44/keymaps/jetpacktuxedo/config.h delete mode 100644 keyboards/tv44/keymaps/jetpacktuxedo/keymap.c delete mode 100644 keyboards/tv44/keymaps/jetpacktuxedo/readme.md delete mode 100644 keyboards/tv44/keymaps/jetpacktuxedo/rules.mk delete mode 100644 keyboards/tv44/keymaps/mjt/config.h delete mode 100644 keyboards/tv44/keymaps/mjt/keymap.c delete mode 100644 keyboards/tv44/keymaps/mjt/readme.md delete mode 100644 keyboards/tv44/keymaps/mjt/rules.mk delete mode 100644 keyboards/tv44/keymaps/smt/keymap.c delete mode 100644 keyboards/tv44/keymaps/smt/readme.md delete mode 100644 keyboards/tv44/keymaps/smt/rules.mk delete mode 100644 keyboards/tv44/keymaps/tong92/config.h delete mode 100644 keyboards/tv44/keymaps/tong92/keymap.c delete mode 100644 keyboards/tv44/keymaps/tong92/readme.md delete mode 100644 keyboards/tv44/keymaps/tong92/rules.mk delete mode 100644 keyboards/tv44/keymaps/xyverz/config.h delete mode 100644 keyboards/tv44/keymaps/xyverz/keymap.c delete mode 100644 keyboards/tv44/keymaps/xyverz/readme.md delete mode 100644 keyboards/tv44/keymaps/xyverz/rules.mk delete mode 100644 keyboards/tv44/readme.md delete mode 100644 keyboards/tv44/rules.mk delete mode 100644 keyboards/tv44/tv44.c delete mode 100644 keyboards/tv44/tv44.h diff --git a/keyboards/bananasplit/README.md b/keyboards/bananasplit/README.md deleted file mode 100644 index cd1e15d775..0000000000 --- a/keyboards/bananasplit/README.md +++ /dev/null @@ -1,15 +0,0 @@ -BananaSplit60 -=== - -A 60% PCB featuring a split spacebar. - -Keyboard Maintainer: QMK Community -Hardware Supported: BananaSplit60 PCB -Hardware Availability: https://thevankeyboards.com/products/gb-bananasplit-60-keyboard-kit?variant=42149104910 - -Make example for this keyboard (after setting up your build environment): - - make bananasplit:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - diff --git a/keyboards/bananasplit/bananasplit.c b/keyboards/bananasplit/bananasplit.c deleted file mode 100644 index 1aa8fb1745..0000000000 --- a/keyboards/bananasplit/bananasplit.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "bananasplit.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/bananasplit/bananasplit.h b/keyboards/bananasplit/bananasplit.h deleted file mode 100644 index 8d545c1f99..0000000000 --- a/keyboards/bananasplit/bananasplit.h +++ /dev/null @@ -1,142 +0,0 @@ -/* -Copyright 2012,2013 Jun Wako - -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 . -*/ -#ifndef BANANASPLIT_H -#define BANANASPLIT_H - -#include "quantum.h" - -/* -------------------------------------------------------------------------------------------- -| K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | -------------------------------------------------------------------------------------------- -| K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | -------------------------------------------------------------------------------------------- -| K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | K29 | K2A | K2B | K2C | -------------------------------------------------------------------------------------------- -| K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | K3D | -------------------------------------------------------------------------------------------- -| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C | -------------------------------------------------------------------------------------------- -*/ -#define LAYOUT_base( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ -} -/* Here is the above keymap filled with KC_TRNS. It's a useful starting point when defining layers. -KEYMAP( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) -*/ - -#define LAYOUT_hhkbanana( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ - { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ -} - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K45, K48, K49, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \ -} - -#define LAYOUT_60_iso( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K41, K42, K45, K48, K49, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \ -} - -/* -------------------------------------------------------------------------------------------- -| K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | K2D | -------------------------------------------------------------------------------------------- -| K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | -------------------------------------------------------------------------------------------- -| K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | K29 | K2A | K2B | K2C | -------------------------------------------------------------------------------------------- -| K30 | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | K3D | -------------------------------------------------------------------------------------------- -| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C | -------------------------------------------------------------------------------------------- -*/ -#define LAYOUT_all( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ -} - -#define LAYOUT_hhkb_arrow( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D,\ - K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ -} - - -#endif diff --git a/keyboards/bananasplit/config.h b/keyboards/bananasplit/config.h deleted file mode 100644 index 5649ab4aa6..0000000000 --- a/keyboards/bananasplit/config.h +++ /dev/null @@ -1,84 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEAE -#define PRODUCT_ID 0x8870 -#define DEVICE_VER 0x0001 -#define MANUFACTURER TheVan Keyboards -#define PRODUCT BananaSplit 60 -#define DESCRIPTION keyboard firmware for BananaSplit 60 - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -#define MATRIX_ROW_PINS { B0, B2, B4, B5, B6 } -#define MATRIX_COL_PINS { F5, B1, F0, F1, F4, B3, D7, D6, D4, D5, D3, D2, D1, D0 } -#define UNUSED_PINS - -#define DIODE_DIRECTION ROW2COL - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* mapping backlight LEDs to correct Pin */ -#define BACKLIGHT_PIN B7 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 5 -#define TAPPING_TERM 175 - -/* 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - - -/* - * 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 - -#endif diff --git a/keyboards/bananasplit/info.json b/keyboards/bananasplit/info.json deleted file mode 100644 index 6741c6cdb0..0000000000 --- a/keyboards/bananasplit/info.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "keyboard_name": "bananasplit", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_base": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] - }, - - "LAYOUT_hhkbanana": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] - }, - - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - - "LAYOUT_all": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] - }, - - "LAYOUT_hhkb_arrow": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] - } - } -} \ No newline at end of file diff --git a/keyboards/bananasplit/keymaps/0010/config.h b/keyboards/bananasplit/keymaps/0010/config.h deleted file mode 100644 index 060f5922f2..0000000000 --- a/keyboards/bananasplit/keymaps/0010/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/bananasplit/keymaps/0010/keymap.c b/keyboards/bananasplit/keymaps/0010/keymap.c deleted file mode 100644 index 617812149c..0000000000 --- a/keyboards/bananasplit/keymaps/0010/keymap.c +++ /dev/null @@ -1,73 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ - -#include QMK_KEYBOARD_H - -#define ______ KC_TRNS - -/* - This switch layout is ANSI with the following modifications: - Split right shift - 225 125 275 spacebar - Bottom right singles -*/ - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -------------------------------------------------------------------------------------------- -|Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | -------------------------------------------------------------------------------------------- -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -------------------------------------------------------------------------------------------- -| Cpslock | A | S | D | F | G | H | J | K | L | ; | ' | Enter | -------------------------------------------------------------------------------------------- -| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | -------------------------------------------------------------------------------------------- -| Ctrl | GUI | Alt | L1(Space) | LED | Space | Home | End | Left |Rght |Down | -------------------------------------------------------------------------------------------- -*/ -[0] = LAYOUT_base( \ - KC_ESC, 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_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_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_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, LT(1,KC_SPACE), BL_TOGG, KC_SPC, KC_HOME, KC_END, KC_LEFT, KC_RGHT, KC_DOWN \ -), -/* -------------------------------------------------------------------------------------------- -| ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | -------------------------------------------------------------------------------------------- -| | | UP | | | | | | | | | | | PrtSc | -------------------------------------------------------------------------------------------- -| |Left | Down |Right | | | | | | | | | | SLEEP | -------------------------------------------------------------------------------------------- -| | | | | | | | | | | | | | | -------------------------------------------------------------------------------------------- -| | | | | Reset | | | | | | -------------------------------------------------------------------------------------------- -*/ -[1] = LAYOUT_base( \ - KC_GRV, 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_DEL, \ - ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, \ - ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, KC_SLEP, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, \ - ______, ______, ______, ______, RESET, ______, ______, ______, ______, ______, KC_PGDN \ -), -}; - - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/bananasplit/keymaps/0010/rules.mk b/keyboards/bananasplit/keymaps/0010/rules.mk deleted file mode 100644 index 7d09c322e5..0000000000 --- a/keyboards/bananasplit/keymaps/0010/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Balz Guenat -# -# 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 . - - -# 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 = no # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = no # 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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bananasplit/keymaps/coloneljesus/config.h b/keyboards/bananasplit/keymaps/coloneljesus/config.h deleted file mode 100644 index 92a67f647c..0000000000 --- a/keyboards/bananasplit/keymaps/coloneljesus/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here -#define GRAVE_ESC_CTRL_OVERRIDE -#define BACKLIGHT_BREATHING -#define BREATHING_PERIOD 8 - -#endif diff --git a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c b/keyboards/bananasplit/keymaps/coloneljesus/keymap.c deleted file mode 100644 index 275bfe32a1..0000000000 --- a/keyboards/bananasplit/keymaps/coloneljesus/keymap.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ -#include QMK_KEYBOARD_H - -enum custom_keycodes { - WIN_SWITCH_LAYOUT = SAFE_RANGE, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -------------------------------------------------------------------------------------------- -|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | -------------------------------------------------------------------------------------------- -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -------------------------------------------------------------------------------------------- -| Fn1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | -------------------------------------------------------------------------------------------- -| Shift | Z | X | C | V | B | N | M | , | . | / | Shift |M(0) | -------------------------------------------------------------------------------------------- -| Ctrl | GUI | Alt | Space | Fn1 | Space | Alt | GUI | App | Ctrl | -------------------------------------------------------------------------------------------- -*/ -[0] = LAYOUT_base( \ - KC_GESC, 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_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, \ - MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, WIN_SWITCH_LAYOUT,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL \ -), -/* -------------------------------------------------------------------------------------------- -| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | -------------------------------------------------------------------------------------------- -| CpsLck |Prev |Vol+ |Next |PgUp | Ins |Home |WrdL |WrdR | End | | | | PrtSc | -------------------------------------------------------------------------------------------- -| TRNS |Mute |Vol- |Play |PgDn | Del |Left |Down | Up |Right| | | | -------------------------------------------------------------------------------------------- -| | | | | | |DelWL|DelWR| | | | | | -------------------------------------------------------------------------------------------- -| | | | | TRNS | | | | | Reset | -------------------------------------------------------------------------------------------- -*/ -[1] = LAYOUT_base( \ - _______, 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_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, _______, _______, _______, KC_PSCR, \ - _______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \ - _______, BL_STEP, BL_BRTG, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, RESET \ -), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - - case WIN_SWITCH_LAYOUT: { - // Sends Alt+Shift on both key down and key up. - // Designed to switch between two keyboard layouts on Windows using a locking switch. - // Does nothing if right shift is pressed for easy resync. - if (!(get_mods() & MOD_BIT(KC_RSFT))) - SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_LSHIFT)SS_UP(X_LALT)); - return false; - } - - default: - return true; - } -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/bananasplit/keymaps/coloneljesus/readme.md b/keyboards/bananasplit/keymaps/coloneljesus/readme.md deleted file mode 100644 index b9ce5f44a1..0000000000 --- a/keyboards/bananasplit/keymaps/coloneljesus/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# /u/Coloneljesus's keymap for the Bananasplit - -Default layer: - -``` -------------------------------------------------------------------------------------------- -|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | -------------------------------------------------------------------------------------------- -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -------------------------------------------------------------------------------------------- -| Fn1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | -------------------------------------------------------------------------------------------- -| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | -------------------------------------------------------------------------------------------- -| Ctrl | GUI | Alt | Space | Fn1 | Space | Alt | GUI | App | Ctrl | -------------------------------------------------------------------------------------------- -``` - -Fn1 layer: - -``` -------------------------------------------------------------------------------------------- -| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | -------------------------------------------------------------------------------------------- -| CpsLck |Prev |Vol+ |Next |PgUp | Ins |Home |WrdL |WrdR | End | | | | PrtSc | -------------------------------------------------------------------------------------------- -| TRNS |Mute |Vol- |Play |PgDn | Del |Left |Down | Up |Right| | | | -------------------------------------------------------------------------------------------- -| | | | | | |DelWL|DelWR| | | | | -------------------------------------------------------------------------------------------- -| | | | | TRNS | | | | | Reset | -------------------------------------------------------------------------------------------- -``` \ No newline at end of file diff --git a/keyboards/bananasplit/keymaps/coloneljesus/rules.mk b/keyboards/bananasplit/keymaps/coloneljesus/rules.mk deleted file mode 100644 index 7d09c322e5..0000000000 --- a/keyboards/bananasplit/keymaps/coloneljesus/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Balz Guenat -# -# 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 . - - -# 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 = no # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = no # 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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bananasplit/keymaps/default/config.h b/keyboards/bananasplit/keymaps/default/config.h deleted file mode 100644 index 060f5922f2..0000000000 --- a/keyboards/bananasplit/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/bananasplit/keymaps/default/keymap.c b/keyboards/bananasplit/keymaps/default/keymap.c deleted file mode 100644 index dcef38bca1..0000000000 --- a/keyboards/bananasplit/keymaps/default/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -#define DEFAULT_LAYER 0 -#define LAYER_1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEFAULT_LAYER] = LAYOUT_base( - KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, _______, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(LAYER_1), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT - ), - - [LAYER_1] = LAYOUT_base( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/bananasplit/keymaps/default/readme.md b/keyboards/bananasplit/keymaps/default/readme.md deleted file mode 100644 index aaf6daa08c..0000000000 --- a/keyboards/bananasplit/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for the Bananasplit diff --git a/keyboards/bananasplit/keymaps/default/rules.mk b/keyboards/bananasplit/keymaps/default/rules.mk deleted file mode 100644 index 7d09c322e5..0000000000 --- a/keyboards/bananasplit/keymaps/default/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Balz Guenat -# -# 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 . - - -# 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 = no # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = no # 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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bananasplit/keymaps/hhkbanana/keymap.c b/keyboards/bananasplit/keymaps/hhkbanana/keymap.c deleted file mode 100644 index f2f829f93e..0000000000 --- a/keyboards/bananasplit/keymaps/hhkbanana/keymap.c +++ /dev/null @@ -1,25 +0,0 @@ -#include QMK_KEYBOARD_H - -#define DEFAULT_LAYER 0 -#define LAYER_1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEFAULT_LAYER] = LAYOUT_hhkbanana( \ - KC_ESC, 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_BSLS, KC_PSCR, \ - 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_BSPC, \ - 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(LAYER_1), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT \ - ), - - [LAYER_1] = LAYOUT_hhkbanana( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c b/keyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c deleted file mode 100644 index 89e275daf7..0000000000 --- a/keyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c +++ /dev/null @@ -1,92 +0,0 @@ -/* - Author: jockyxu1122 - - Hightlight: split backspace, split space, arrows on bottom right, - and backlighting support (capslock's backlighting cannot be controlled separately). - - Note that "Previous track" and "next track" might only work with Windows. -*/ - -#include QMK_KEYBOARD_H - -#define DEFAULT_LAYER 0 -#define LAYER_1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - ------------------------------------------------------------- - |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| - ------------------------------------------------------------- - | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | - ------------------------------------------------------------- - | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | - ------------------------------------------------------------- - | Shift | Z | X | C | V | B | N | M | , | . | / | Shift| Up| - ------------------------------------------------------------- - |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| - ------------------------------------------------------------- - Hm: Home - MoL1: Mo(L1) - */ - [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( - // row 1 - KC_ESC, 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_GRV, \ - KC_DEL, \ - // row 2 - 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, \ - // row 3 - 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, \ - // row 4 - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ - // row 5 - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(LAYER_1), KC_BSPC, KC_HOME, KC_END, KC_LEFT, KC_DOWN, \ - KC_RIGHT - ), - - /* - ------------------------------------------------------------- - |LED| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| - ------------------------------------------------------------- - | | | | @ | | | | | | | |BDn|BUp| | - ------------------------------------------------------------- - | | | | | | | | | | | | | | - ------------------------------------------------------------- - | | | |Cal| |www| |Mut| | | | |VUp| - ------------------------------------------------------------- - | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| - ------------------------------------------------------------- - @: Email - BDn: LED brightness down - BUp: LED brightness up - Cal: Calculator - Ins: Insert - Mut: Mute - NTk: Next track - PDn: Page down - PTk: Previous track - PUp: Page up - VDn: Volume down - VUp: Volume up - www: Browser home page - */ - [LAYER_1] = LAYOUT_hhkb_arrow( - // row 1 - BL_TOGG, 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_TRNS, KC_INS, \ - // row 2 - KC_TRNS, KC_TRNS, KC_TRNS, KC_MAIL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, BL_DEC, BL_INC, KC_TRNS, \ - // row 3 - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, \ - // row 4 - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_WHOM, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_VOLU, \ - // row 5 - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_MPRV, KC_VOLD, \ - KC_MNXT - ) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md b/keyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md deleted file mode 100644 index 664a0a0483..0000000000 --- a/keyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md +++ /dev/null @@ -1,66 +0,0 @@ -Yida's keymap for BananaSplit -=== - -Hightlight: split backspace, split space, arrows on bottom right, and -backlighting support (capslock's backlighting cannot be controlled separately). - -Note that "Previous track" and "next track" might only work with Windows. - -Default layer: - -``` - ------------------------------------------------------------- - |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| - ------------------------------------------------------------- - | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | - ------------------------------------------------------------- - | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | - ------------------------------------------------------------- - | Shift | Z | X | C | V | B | N | M | , | . | / | Shift| Up| - ------------------------------------------------------------- - |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| - ------------------------------------------------------------- - Hm: Home - MoL1: Mo(L1) -``` - -Layer_1: - -``` - ------------------------------------------------------------- - |LED| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| - ------------------------------------------------------------- - | | | | @ | | | | | | | |BDn|BUp| | - ------------------------------------------------------------- - | | | | | | | | | | | | | | - ------------------------------------------------------------- - | | | |Cal| |www| |Mut| | | | |VUp| - ------------------------------------------------------------- - | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| - ------------------------------------------------------------- - @: Email - BDn: LED brightness down - BUp: LED brightness up - Cal: Calculator - Ins: Insert - Mut: Mute - NTk: Next track - PDn: Page down - PTk: Previous track - PUp: Page up - VDn: Volume down - VUp: Volume up - www: Browser home page -``` - -Compile and flash: - -`cd` to `/qmk_firmware` folder, then -``` -make bananasplit:jockyxu1122_ansi -``` - -A .hex file will be generated under `/qmk_firmware` folder. - - -To flash, use QMK Toolbox. diff --git a/keyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c b/keyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c deleted file mode 100644 index 859944991b..0000000000 --- a/keyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c +++ /dev/null @@ -1,105 +0,0 @@ -/* - Author: jockyxu1122 - - Hightlight: split backspace, ISO Enter, split space, arrows on bottom right, - and toggable capslock backlight. - - Note that "Previous track" and "next track" might only work with Windows. -*/ - -#include QMK_KEYBOARD_H - -#define DEFAULT_LAYER 0 -#define LAYER_1 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - ------------------------------------------------------------- - |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| - ------------------------------------------------------------- - | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Ent | - -------------------------------------------------------- - - | Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | - ------------------------------------------------------------- - | Shift | Z | X | C | V | B | N | M | , | . | Shift| Up| / | - ------------------------------------------------------------- - |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| - ------------------------------------------------------------- - Hm: Home - MoL1: Mo(L1) - */ - [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( - // row 1 - KC_ESC, 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_GRV, \ - KC_DEL, \ - // row 2 - 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_ENT, \ - // row 3 - 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_BSLS, \ - // row 4 - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, \ - // row 5 - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(LAYER_1), KC_BSPC, KC_HOME, KC_END, KC_LEFT, KC_DOWN, \ - KC_RIGHT - ), - - /* - ------------------------------------------------------------- - | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| - ------------------------------------------------------------- - | | | | @ | | | | | | | | | | | - -------------------------------------------------------- - - | | | | | | | | | | | | | | | - ------------------------------------------------------------- - | | | |Cal| |www| |Mut| | | |VUp| | - ------------------------------------------------------------- - | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| - ------------------------------------------------------------- - @: Email - Cal: Calculator - Ins: Insert - Mut: Mute - NTk: Next track - PDn: Page down - PTk: Previous track - PUp: Page up - VDn: Volume down - VUp: Volume up - www: Browser home page - */ - [LAYER_1] = LAYOUT_hhkb_arrow( - // row 1 - KC_TRNS, 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_TRNS, KC_INS, \ - // row 2 - KC_TRNS, KC_TRNS, KC_TRNS, KC_MAIL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - // row 3 - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, \ - // row 4 - KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_WHOM, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_VOLU, KC_TRNS, \ - // row 5 - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_MPRV, KC_VOLD, \ - KC_MNXT - ) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; - -/* -Capslock's led cannot be controlled separately on bananasplit and you can only turn on/off all - leds at once. If you only install led for capslock, it will look like capslock has toggable - backlight. -*/ -void led_set_user(uint8_t usb_led) { - if (usb_led && (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 7); - PORTB |= (1 << 7); - } else { - DDRB &= ~(1 << 7); - PORTB &= ~(1 << 7); - } -} diff --git a/keyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md b/keyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md deleted file mode 100644 index e135f73e3a..0000000000 --- a/keyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md +++ /dev/null @@ -1,61 +0,0 @@ -Yida's keymap for BananaSplit -=== - -Hightlight: split backspace, ISO Enter, split space, arrows on bottom right, and toggable capslock backlight. - -Note that "Previous track" and "next track" might only work with Windows. - -Default layer: -``` - ------------------------------------------------------------- - |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| - ------------------------------------------------------------- - | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Ent | - -------------------------------------------------------- - - | Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | - ------------------------------------------------------------- - | Shift | Z | X | C | V | B | N | M | , | . | Shift| Up| / | - ------------------------------------------------------------- - |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| - ------------------------------------------------------------- - Hm: Home - MoL1: Mo(L1) -``` - -Layer_1: -``` - ------------------------------------------------------------- - | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| - ------------------------------------------------------------- - | | | | @ | | | | | | | | | | | - -------------------------------------------------------- - - | | | | | | | | | | | | | | | - ------------------------------------------------------------- - | | | |Cal| |www| |Mut| | | |VUp| | - ------------------------------------------------------------- - | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| - ------------------------------------------------------------- - @: Email - Cal: Calculator - Ins: Insert - Mut: Mute - NTk: Next track - PDn: Page down - PTk: Previous track - PUp: Page up - VDn: Volume down - VUp: Volume up - www: Browser home page -``` - -Compile and flash: - -`cd` to `/qmk_firmware` folder, then -``` -make bananasplit:jockyxu1122_iso -``` - -A .hex file will be generated under `/qmk_firmware` folder. - - -To flash, use QMK Toolbox. diff --git a/keyboards/bananasplit/keymaps/kamon/config.h b/keyboards/bananasplit/keymaps/kamon/config.h deleted file mode 100644 index af6cf8ef1f..0000000000 --- a/keyboards/bananasplit/keymaps/kamon/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#define GRAVE_ESC_CTRL_OVERRIDE - -#endif diff --git a/keyboards/bananasplit/keymaps/kamon/keymap.c b/keyboards/bananasplit/keymaps/kamon/keymap.c deleted file mode 100644 index 34306e1830..0000000000 --- a/keyboards/bananasplit/keymaps/kamon/keymap.c +++ /dev/null @@ -1,96 +0,0 @@ -/* Copyright 2017 Balz Guenat - * - * 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 . - */ -#include QMK_KEYBOARD_H - -#define ______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -------------------------------------------------------------------------------------------- -|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | -------------------------------------------------------------------------------------------- -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -------------------------------------------------------------------------------------------- -| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | -------------------------------------------------------------------------------------------- -| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | -------------------------------------------------------------------------------------------- -| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | -------------------------------------------------------------------------------------------- -*/ -[0] = LAYOUT_base( \ - KC_GESC, 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_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_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, M(0),\ - MO(1), KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, MO(1), KC_RCTL \ -), -/* -------------------------------------------------------------------------------------------- -| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | -------------------------------------------------------------------------------------------- -| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | -------------------------------------------------------------------------------------------- -| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | -------------------------------------------------------------------------------------------- -| Shift | | | | | | | | | | | Shift | | -------------------------------------------------------------------------------------------- -| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | -------------------------------------------------------------------------------------------- -*/ -[1] = LAYOUT_base( \ - KC_GRV, 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_DEL, \ - KC_TAB, KC_HOME, KC_UP, KC_END, KC_PGUP, ______, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, \ - KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, \ - KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_RSFT, ______, \ - ______, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, ______, ______, ______, KC_RCTL \ -), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: - // Sends Alt+Shift on both key down and key up. - // Fesigned to switch between two keyboard layouts on Windows using a locking switch. - // Does nothing if right shift is pressed for easier resync. - if (!(get_mods() & MOD_BIT(KC_RSFT))) - return MACRO(D(LALT), T(LSFT), U(LALT), END); - else - return MACRO_NONE; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/bananasplit/keymaps/kamon/readme.md b/keyboards/bananasplit/keymaps/kamon/readme.md deleted file mode 100644 index a08bea519f..0000000000 --- a/keyboards/bananasplit/keymaps/kamon/readme.md +++ /dev/null @@ -1,34 +0,0 @@ -# Kamon's keymap for the Bananasplit -A simple layout to get you started with the BananaSplit60. - -Default layer: - -``` -------------------------------------------------------------------------------------------- -|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | -------------------------------------------------------------------------------------------- -| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | -------------------------------------------------------------------------------------------- -| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | -------------------------------------------------------------------------------------------- -| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | -------------------------------------------------------------------------------------------- -| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | -------------------------------------------------------------------------------------------- -``` - -Fn1 layer: - -``` -------------------------------------------------------------------------------------------- -| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | -------------------------------------------------------------------------------------------- -| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | -------------------------------------------------------------------------------------------- -| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | -------------------------------------------------------------------------------------------- -| Shift | | | | | | | | | | | Shift | | -------------------------------------------------------------------------------------------- -| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | -------------------------------------------------------------------------------------------- -``` \ No newline at end of file diff --git a/keyboards/bananasplit/keymaps/kamon/rules.mk b/keyboards/bananasplit/keymaps/kamon/rules.mk deleted file mode 100644 index 7d09c322e5..0000000000 --- a/keyboards/bananasplit/keymaps/kamon/rules.mk +++ /dev/null @@ -1,37 +0,0 @@ -# Copyright 2017 Balz Guenat -# -# 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 . - - -# 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 = no # Virtual DIP switch configuration(+1000) -# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -# CONSOLE_ENABLE = no # 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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bananasplit/keymaps/nic/keymap.c b/keyboards/bananasplit/keymaps/nic/keymap.c deleted file mode 100644 index 5ed1c65e99..0000000000 --- a/keyboards/bananasplit/keymaps/nic/keymap.c +++ /dev/null @@ -1,45 +0,0 @@ -#include QMK_KEYBOARD_H - -#define DEFAULT_LAYER 0 -#define THUMB_LAYER 1 -#define NORMAN_LAYER 2 -#define MOD_LAYER 3 - -#define HYPER_TAB ALL_T(KC_TAB) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( \ - 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_BSLS, KC_DEL, \ - HYPER_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_BSPC, \ - 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, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, TG(NORMAN_LAYER), \ - KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, MO(THUMB_LAYER), KC_SPC, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_RIGHT \ - ), - - [THUMB_LAYER] = LAYOUT_hhkb_arrow( \ - MO(MOD_LAYER), 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_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - - [NORMAN_LAYER] = LAYOUT_hhkb_arrow( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_SCLN, _______, _______, _______, \ - _______, _______, _______, KC_E, KC_T, _______, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, \ - _______, _______, _______, _______, _______, _______, KC_P, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - - [MOD_LAYER] = LAYOUT_hhkb_arrow( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/bananasplit/keymaps/rask/README.md b/keyboards/bananasplit/keymaps/rask/README.md deleted file mode 100644 index ec19d3935b..0000000000 --- a/keyboards/bananasplit/keymaps/rask/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# rask's BananaSplit60 - -![BS60 layout](http://i.imgur.com/Q7so1py.png) - -## Notes - -### Layers - -Base layer is a regular HHKBish ANSI layer. Toggling the -alternate base layer (Fn3) makes it simpler to play games with -the left space being set to be an actual Space. - -Layer 1 (Fn1) contains usual 60% functionalities such as the -F-row, while Layer 2 (Fn2) contains media controls. - -The final layer (Fn4) is a special layer that acts as a lock -layer, meaning the keyboard is locked while the layer -is active. This firmware assumes a lock switch (read below). - -### Lock switches - -1.25u between the split space halves and the 1u key right -left of LeftArrow are to be operated with a lock switch. -If you don't have lock switches you should swap the `MO()` -calls with `TG()` calls to make the layer toggles work -with regular non/locking switches. - -## How to make and flash - -(These instructions are for Linux-based operating systems -with `dfu-programmer` available.) - -`cd` into the `bananasplit` keyboard's directory and run - - make rask - -which should result in a file called `bananasplit_rask.hex` appearing -in your QMK root directory. - -Now plug in your BananaSplit60 keyboard via USB. Verify -with `lsusb` that it appears. At least my PCB did not have -anything preflashed so you should see `atmega32u4` or similar -in the `lsusb` output. - -Now you can flash the firmware by - - $ sudo dfu-programmer atmega32u4 erase - $ cd /qmk_firmware/root/directory - $ sudo dfu-programmer atmega32u4 flash bananasplit_rask.hex - -_If_ you happen to have some other `atmega32u4` based device -I suggest you plug it out before flashing your BS60 just to -prevent accidentally flashing your old device. diff --git a/keyboards/bananasplit/keymaps/rask/keymap.c b/keyboards/bananasplit/keymaps/rask/keymap.c deleted file mode 100644 index 6c7544cc8b..0000000000 --- a/keyboards/bananasplit/keymaps/rask/keymap.c +++ /dev/null @@ -1,72 +0,0 @@ -#include QMK_KEYBOARD_H - -// rask's BananaSplit60 layout - -#define L_BASE 0 -#define L_BASE_ALT 1 -#define L_ONE 2 -#define L_TWO 3 -#define L_LOCK 4 - -#define ______ KC_TRNS -#define XXXXXX KC_NO - -// L_BASE -// Initial layer with default keymap -// -// L_BASE_ALT -// Layer with some standardisation e.g. make -// space key "full" to make gaming less of a -// chore -// -// L_ONE -// General things like F-row and navigation -// -// L_TWO -// Media controls and more exotic keybinds -// -// L_LOCK -// Lock the keyboard, release to unlock - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [L_BASE] = LAYOUT_hhkb_arrow( \ - 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_BSLS, KC_DEL, \ - 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_BSPC, \ - MO(L_ONE), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_SLSH), KC_UP, MO(L_TWO), \ - KC_LCTRL, KC_LGUI, KC_LALT, KC_BSPC, MO(L_BASE_ALT), KC_SPACE, KC_RALT, MO(L_LOCK), KC_LEFT, KC_DOWN, KC_RIGHT \ - ), - - [L_BASE_ALT] = LAYOUT_hhkb_arrow( \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, KC_SPACE, ______, ______, ______, ______, ______, ______, ______ \ - ), - - [L_ONE] = LAYOUT_hhkb_arrow( \ - 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_INS, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, KC_HOME, KC_PGDN, KC_END \ - - ), - - [L_TWO] = LAYOUT_hhkb_arrow( \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, \ - KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, \ - ______, ______, ______, ______, ______, ______, ______, ______, KC_MSTP, ______, ______, ______, ______, \ - ______, KC_APP, ______, ______, ______, ______, ______, ______, ______, ______, ______ \ - ), - - [L_LOCK] = LAYOUT_hhkb_arrow( \ - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ - XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, ______, XXXXXX, XXXXXX, XXXXXX \ - ), -}; diff --git a/keyboards/bananasplit/keymaps/talljoe/config.h b/keyboards/bananasplit/keymaps/talljoe/config.h deleted file mode 100644 index bb2aadfa69..0000000000 --- a/keyboards/bananasplit/keymaps/talljoe/config.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#define PREVENT_STUCK_MODIFIERS -#define SPACE_COUNT 3 - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO }\ -} - -#endif diff --git a/keyboards/bananasplit/keymaps/talljoe/keymap.c b/keyboards/bananasplit/keymaps/talljoe/keymap.c deleted file mode 100644 index 7812add812..0000000000 --- a/keyboards/bananasplit/keymaps/talljoe/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/keyboards/bananasplit/rules.mk b/keyboards/bananasplit/rules.mk deleted file mode 100644 index 81570c493a..0000000000 --- a/keyboards/bananasplit/rules.mk +++ /dev/null @@ -1,66 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # 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 -#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -BACKLIGHT_ENABLE = yes - - -# Optimize size but this may cause error "relocation truncated to fit" -#EXTRALDFLAGS = -Wl,--relax - -LAYOUTS = 60_ansi 60_iso diff --git a/keyboards/roadkit/config.h b/keyboards/roadkit/config.h deleted file mode 100644 index 9596f7f3b2..0000000000 --- a/keyboards/roadkit/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEAE -#define PRODUCT_ID 0x8846 -#define DEVICE_VER 0x0001 -#define MANUFACTURER TheVan Keyboards -#define PRODUCT Roadkit Micro -#define DESCRIPTION keyboard firmware for Roadkit Micro - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 4 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { F0, F5, D7, B4 } -#define MATRIX_COL_PINS { F1, F4, D6, D4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/roadkit/info.json b/keyboards/roadkit/info.json deleted file mode 100644 index 839ac73fbf..0000000000 --- a/keyboards/roadkit/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "keyboard_name": "Roadkit", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 4, - "layouts": { - "LAYOUT_numpad_4x4": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] - }, - "LAYOUT_ortho_4x4": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] - } - } -} diff --git a/keyboards/roadkit/keymaps/default/config.h b/keyboards/roadkit/keymaps/default/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/roadkit/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/default/keymap.c b/keyboards/roadkit/keymaps/default/keymap.c deleted file mode 100644 index 4ec0f6cfdc..0000000000 --- a/keyboards/roadkit/keymaps/default/keymap.c +++ /dev/null @@ -1,48 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _NP 0 - -// Macro name shortcuts -#define NUMPAD M(_NP) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NP] = LAYOUT_numpad_4x4( /* Numpad */ - KC_P7, KC_P8, KC_P9, KC_PPLS, \ - KC_P4, KC_P5, KC_P6, \ - KC_P1, KC_P2, KC_P3, KC_PENT, \ - KC_P0, KC_PDOT \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _NP: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_NP); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/roadkit/keymaps/default/readme.md b/keyboards/roadkit/keymaps/default/readme.md deleted file mode 100644 index 5984a71d1a..0000000000 --- a/keyboards/roadkit/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for roadkit diff --git a/keyboards/roadkit/keymaps/default/rules.mk b/keyboards/roadkit/keymaps/default/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/roadkit/keymaps/default/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/flipphone/config.h b/keyboards/roadkit/keymaps/flipphone/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/roadkit/keymaps/flipphone/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/flipphone/keymap.c b/keyboards/roadkit/keymaps/flipphone/keymap.c deleted file mode 100644 index fed9d02706..0000000000 --- a/keyboards/roadkit/keymaps/flipphone/keymap.c +++ /dev/null @@ -1,219 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif - -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -void backlight_toggle(void){ -}; - -enum roadkit_layers { - _NUMPAD, - _FPH, - _FPHNOISY, - _ADJUST, - _DYN -}; - -enum roadkit_keycodes { - NUMPAD = SAFE_RANGE, - FPH_1, - FPH_2, - FPH_3, - FPH_4, - FPH_5, - FPH_6, - FPH_7, - FPH_8, - FPH_9, - FN_0, - BACKLIT, - MACSLEEP, - DYNAMIC_MACRO_RANGE, -}; - -#include "dynamic_macro.h" - -// Fillers to make keymaps cleaner looking -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ - KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ - KC_KP_4, KC_KP_5, KC_KP_6, \ - KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \ - LT(_ADJUST, KC_KP_0), KC_KP_DOT \ - ), - [_FPH] = LAYOUT_numpad_4x4( /* Quiet T9 */ - FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \ - FPH_4, FPH_5, FPH_6, \ - FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \ - LT(_ADJUST, KC_SPACE), KC_KP_DOT \ - ), - [_FPHNOISY] = LAYOUT_numpad_4x4( /* Noisy T9 */ - FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \ - FPH_4, FPH_5, FPH_6, \ - FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \ - LT(_ADJUST, KC_SPACE), KC_KP_DOT \ - ), - [_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */ - KC_NUMLOCK, TG(_FPHNOISY), TG(_FPH), TG(_NUMPAD), \ - KC_BSPC, BACKLIT, KC_DEL, \ - MACSLEEP, _______, _______, _______, \ - _______, MO(_DYN) \ - ), - [_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */ - DYN_REC_START1, DYN_REC_START2, _______, DYN_REC_STOP, \ - _______, _______, _______, \ - DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \ - _______, _______ \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -uint16_t fph_tap_qty = false; -uint16_t fph_keycode = 0; // stores which spacebar was used, either raise or lower... - -uint16_t get_render_keycode(uint16_t keycode, uint16_t tap_qty){ // maybe replace shift with "mods" - tap_qty--; // reduce by one to match array indexes. - switch(keycode){ - case FPH_2: - {uint16_t kc[] = {KC_A, KC_B, KC_C}; - if(tap_qty % 6 > 2) - return LSFT(kc[tap_qty % 3]); - return kc[tap_qty % 3];} - break; - case FPH_3: - {uint16_t kc[] = {KC_D, KC_E, KC_F}; - if(tap_qty % 6 > 2) - return LSFT(kc[tap_qty % 3]); - return kc[tap_qty % 3];} - break; - case FPH_4: - {uint16_t kc[] = {KC_G, KC_H, KC_I}; - if(tap_qty % 6 > 2) - return LSFT(kc[tap_qty % 3]); - return kc[tap_qty % 3];} - break; - case FPH_5: - {uint16_t kc[] = {KC_J, KC_K, KC_L}; - if(tap_qty % 6 > 2) - return LSFT(kc[tap_qty % 3]); - return kc[tap_qty % 3];} - break; - case FPH_6: - {uint16_t kc[] = {KC_M, KC_N, KC_O}; - if(tap_qty % 6 > 2) - return LSFT(kc[tap_qty % 3]); - return kc[tap_qty % 3];} - break; - case FPH_7: - {uint16_t kc[] = {KC_P, KC_Q, KC_R, KC_S}; - if(tap_qty % 8 > 2) - return LSFT(kc[tap_qty % 4]); - return kc[tap_qty % 4];} - break; - case FPH_8: - {uint16_t kc[] = {KC_T, KC_U, KC_V}; - if(tap_qty % 8 > 2) - return LSFT(kc[tap_qty % 4]); - return kc[tap_qty % 4];} - break; - case FPH_9: - {uint16_t kc[] = {KC_W, KC_X, KC_Y, KC_Z}; - if(tap_qty % 8 > 2) - return LSFT(kc[tap_qty % 4]); - return kc[tap_qty % 4];} - break; - case FPH_1: - {uint16_t kc[] = {KC_COMM, LSFT(KC_SLSH), KC_EXLM, KC_AT, KC_MINS, KC_UNDS, KC_PLUS, \ - KC_SCLN, LSFT(KC_SCLN), KC_QUOT, LSFT(KC_QUOT), KC_TILD, \ - KC_PIPE, KC_BSLS, KC_HASH, LSFT(KC_4), KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, \ - KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, LSFT(KC_COMM), LSFT(KC_DOT)}; - return kc[tap_qty % 26];} - } - return KC_NO; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } - uint8_t layer; - layer = biton32(layer_state); - - switch (keycode) { - case FPH_1 ... FPH_9: - if(layer == _FPHNOISY){ - if (record->event.pressed) { - if(fph_keycode != keycode) { // key change - fph_tap_qty = 0; - fph_keycode = keycode; - } else { // same key tapped again so erase and increment. - register_code(KC_BSPC); - unregister_code(KC_BSPC); - fph_tap_qty++; - } - uint16_t render_keycode = get_render_keycode(keycode, fph_tap_qty); - // find mods? Apply mods.. - register_code(render_keycode); - unregister_code(render_keycode); - } else { - // do we need to do anything on key-release? - } - } else { // not noisy, be demure . - if (record->event.pressed) { - if(fph_keycode != keycode) { // key change, kill everything. - uint16_t render_keycode = get_render_keycode(fph_keycode, fph_tap_qty); - // find mods? Apply mods.. - register_code(render_keycode); - unregister_code(render_keycode); - fph_keycode = keycode; - fph_tap_qty = 0; - } else { // same key tapped again so increment counter silently - fph_tap_qty++; - } - } else { - // do we need to do anything on key-release? - // maybe start a timer on this one? - } - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } - return false; - break; - case MACSLEEP: - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} diff --git a/keyboards/roadkit/keymaps/flipphone/readme.md b/keyboards/roadkit/keymaps/flipphone/readme.md deleted file mode 100644 index ad630be195..0000000000 --- a/keyboards/roadkit/keymaps/flipphone/readme.md +++ /dev/null @@ -1,26 +0,0 @@ -# Flip Phone layout for Roadkit - -BEWARE, THIS DOES NOT WORK YET. - -Uses the numpad with classic cellular phone style letters assigned to the numbers. - -# LAYERS - -* Numpad - The layer that matches the caps mostly -* FPH - Base layer for text -* FPHNOISY - Text layer that outputs every character and then backspaces as they're replaced -* DYN - dynamic macro layer for recording and playing macros - -## FPH - -Poke the "2" key twice and it makes "B". - -## FPHNOISY - -Poke the "2" key twice and it makes "A"+backspace+"B" so you can see it cycle through. - -## MACROS - -May be able to record macros with the T9 layer because the "KC_*"s are only sent -at the end. Trying to do a macro with T9NOISY would probably fill up the buffer -in just a few characters. diff --git a/keyboards/roadkit/keymaps/flipphone/rules.mk b/keyboards/roadkit/keymaps/flipphone/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/roadkit/keymaps/flipphone/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/khord/config.h b/keyboards/roadkit/keymaps/khord/config.h deleted file mode 100644 index da6ed7189c..0000000000 --- a/keyboards/roadkit/keymaps/khord/config.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#define TAPPING_TERM 175 - -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B5 - #define BACKLIGHT_LEVELS 3 - #define BACKLIGHT_ON_STATE 0 -#endif - -#endif diff --git a/keyboards/roadkit/keymaps/khord/keymap.c b/keyboards/roadkit/keymaps/khord/keymap.c deleted file mode 100644 index 9111f4f898..0000000000 --- a/keyboards/roadkit/keymaps/khord/keymap.c +++ /dev/null @@ -1,112 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#define _NP 0 -#define _L1 1 -#define _L2 2 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -enum custom_keycodes { - NUMPAD = SAFE_RANGE, - ADMIN, - SMSPC1, - STR192, - STR255 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Numpad - * ,-----------------------. - * | 7 | 8 | 9 |Bksp | - * |-----`-----`-----`-----| - * | 4 | 5 | 6 | Tab | - * |-----`-----`-----`-----| - * | 1 | 2 | 3 |Enter| - * |-----`-----`-----`-----| - * | 0 |Space| . | / | - * `-----`-----`-----`-----' - * | L1 | L2 | | | Layer hold - */ - [_NP] = LAYOUT_ortho_4x4( /* Numpad */ - KC_P7, KC_P8, KC_P9, KC_BSPC, \ - KC_P4, KC_P5, KC_P6, KC_TAB, \ - KC_P1, KC_P2, KC_P3, KC_PENT, \ - LT(1, KC_P0), LT(2, KC_SPC), KC_PDOT, KC_PSLS - ), - - /* L1 - * ,-----------------------. - * |Reset| | | Del | - * |-----`-----`-----`-----| - * | Left| Down| Up |Right| - * |-----`-----`-----`-----| - * | 192.| 255 | | | - * |-----`-----`-----`-----| - * |_____| LED | . | | - * `-----`-----`-----`-----' - */ - [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ - RESET, XXXXXXX, XXXXXXX, KC_DEL, \ - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \ - STR192, STR255, XXXXXXX, XXXXXXX, \ - _______, BL_STEP, _______, XXXXXXX - ), - - /* L2 - * ,-----------------------. - * | | | str | str | - * |-----`-----`-----`-----| - * | | | | | - * |-----`-----`-----`-----| - * | | | | | - * |-----`-----`-----`-----| - * | |_____| | | - * `-----`-----`-----`-----' - */ - [_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */ - XXXXXXX, XXXXXXX, ADMIN, SMSPC1, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, _______, XXXXXXX, XXXXXXX - ) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case ADMIN: - if (record->event.pressed) { - SEND_STRING("Administrator"); - } - return false; - break; - case SMSPC1: - if (record->event.pressed) { - SEND_STRING("Simspace1!"); - } - return false; - break; - case STR192: - if (record->event.pressed) { - SEND_STRING("192.168."); - } - return false; - break; - case STR255: - if (record->event.pressed) { - SEND_STRING("255"); - } - return false; - break; - } - return true; -}; diff --git a/keyboards/roadkit/keymaps/khord/rules.mk b/keyboards/roadkit/keymaps/khord/rules.mk deleted file mode 100644 index 9f3c958bd8..0000000000 --- a/keyboards/roadkit/keymaps/khord/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -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 -TAP_DANCE_ENABLE = no # Enable Tap Dance functionality - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/roadkit/keymaps/mjt/config.h b/keyboards/roadkit/keymaps/mjt/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/roadkit/keymaps/mjt/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/mjt/keymap.c b/keyboards/roadkit/keymaps/mjt/keymap.c deleted file mode 100644 index a1af5b1f28..0000000000 --- a/keyboards/roadkit/keymaps/mjt/keymap.c +++ /dev/null @@ -1,239 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif - -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -void backlight_toggle(void){ -}; - -enum roadkit_layers { - _NUMPAD, - _NAVIGATION, - _EXCEL, - _ADJUST, - _DYN -}; - -enum minivan_keycodes { - NUMPAD = SAFE_RANGE, - NAVIGATION, - EXCEL, - NUMPAD_LOCK, - NAVIGATION_LOCK, - EXCEL_LOCK, - PARENS, - BRACKETS, - BRACES, - BACKLIT, - MACSLEEP, - DYNAMIC_MACRO_RANGE, -}; - -#include "dynamic_macro.h" - -// Fillers to make keymaps cleaner looking -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ - KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ - KC_KP_4, KC_KP_5, KC_KP_6, \ - KC_KP_1, KC_KP_2, KC_KP_3, NAVIGATION, \ - EXCEL, KC_KP_DOT - ), - [_EXCEL] = LAYOUT_numpad_4x4( /* Excel related */ - KC_KP_SLASH, KC_KP_ASTERISK, KC_MINS, KC_TAB, \ - KC_QUOT, KC_KP_EQUAL, PARENS, \ - KC_DQT, BRACKETS, BRACES, _______, \ - _______, MO(_DYN) - ), - [_NAVIGATION] = LAYOUT_numpad_4x4( /* Navigation */ - KC_HOME, _______, KC_PGUP, KC_TAB, \ - KC_END, KC_UP, KC_PGDN, \ - KC_LEFT, KC_DOWN, KC_RIGHT, _______, \ - _______, MO(_DYN) - ), - [_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */ - KC_NUMLOCK, MACSLEEP, BACKLIT, _______, \ - KC_BSPC, _______, KC_DEL, \ - EXCEL_LOCK, NUMPAD_LOCK, NAVIGATION_LOCK, _______, \ - _______, _______ - ), - [_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */ - DYN_REC_START1, DYN_REC_START2, _______, _______, \ - _______, _______, _______, \ - DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \ - _______, _______ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_numpad[][2] = SONG(QWERTY_SOUND); -float tone_excel[][2] = SONG(DVORAK_SOUND); -float tone_navigation[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool fn_tap_used = false; // sets to false when space is pressed, - // sets to true when any other key is pressed, - //when space is lifted, if another key was prssed, don't send space. -uint16_t fn_keycode = 0; // stores which spacebar was used, either raise or lower... - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_dynamic_macro(keycode, record)) { - return false; - } - - switch (keycode) { - case NAVIGATION: // This key is enter if tapped, navigation if held - if (record->event.pressed) { - fn_keycode = NAVIGATION; // these two lines figure out if the next action is - fn_tap_used = false; - layer_on(_NAVIGATION); - update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); - } else { - layer_off(_NAVIGATION); - update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); - if(!fn_tap_used && fn_keycode == NAVIGATION ){ - register_code(KC_KP_ENTER); - unregister_code(KC_KP_ENTER); - fn_keycode = 0; - fn_tap_used = false; - } - } - return false; - break; - case EXCEL: - if (record->event.pressed) { - fn_keycode = EXCEL; - fn_tap_used = false; - layer_on(_EXCEL); - update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); - } else { - layer_off(_EXCEL); - update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); - if(!fn_tap_used && fn_keycode == EXCEL ){ - register_code(KC_KP_0); - unregister_code(KC_KP_0); - fn_keycode = 0; - fn_tap_used = false; - } - } - return false; - break; - default: - fn_tap_used = true; - break; // don't return because this just handles the spacebars. - } - // this is the normal keycode processing switch from Planck default layout. - switch (keycode) { - case NUMPAD_LOCK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_numpad, false, 0); - #endif - persistant_default_layer_set(1UL<<_NUMPAD); - } - return false; - break; - case NAVIGATION_LOCK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_navigation, false, 0); - #endif - persistant_default_layer_set(1UL<<_NAVIGATION); - } - return false; - break; - case EXCEL_LOCK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_excel, false, 0); - #endif - persistant_default_layer_set(1UL<<_EXCEL); - } - return false; - break; - case PARENS: - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_9); - unregister_code(KC_9); - register_code(KC_0); - unregister_code(KC_0); - register_code(KC_RSFT); - register_code(KC_LEFT); - unregister_code(KC_LEFT); - } - return false; - break; - case BRACKETS: - if (record->event.pressed) { - register_code(KC_LBRC); - unregister_code(KC_LBRC); - register_code(KC_RBRC); - unregister_code(KC_RBRC); - register_code(KC_LEFT); - unregister_code(KC_LEFT); - } - return false; - break; - case BRACES: - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_LBRC); - unregister_code(KC_LBRC); - register_code(KC_RBRC); - unregister_code(KC_RBRC); - unregister_code(KC_RSFT); - register_code(KC_LEFT); - unregister_code(KC_LEFT); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } - return false; - break; - case MACSLEEP: - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} diff --git a/keyboards/roadkit/keymaps/mjt/readme.md b/keyboards/roadkit/keymaps/mjt/readme.md deleted file mode 100644 index 80c0e5240e..0000000000 --- a/keyboards/roadkit/keymaps/mjt/readme.md +++ /dev/null @@ -1,22 +0,0 @@ -# Mike's custom keymap for roadkit - -Based on the 13 key layout. - -## LAYERS - -* Numpad - The layer that matches the caps -* Excel - / * - = and () [] {} macros -* Navigation - arrow keys and home/end -* ADJUST - just like planck adjust, lets you set default layer. -* DYN - dynamic macro layer for recording and playing macros - -## MACROS - -Sadly, the dynamic macros are probably going worthless because they keys that -they record have to be pressed on this keyboard. This keyboard doesn't have -most letters... - -## LEADER KEYS - -This board would probably be better with the user of leader keys instead of -complex layers with a raise/lower setup... Something to look into for later. diff --git a/keyboards/roadkit/keymaps/mjt/rules.mk b/keyboards/roadkit/keymaps/mjt/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/roadkit/keymaps/mjt/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/singles/config.h b/keyboards/roadkit/keymaps/singles/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/roadkit/keymaps/singles/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/singles/keymap.c b/keyboards/roadkit/keymaps/singles/keymap.c deleted file mode 100644 index 4c246f5136..0000000000 --- a/keyboards/roadkit/keymaps/singles/keymap.c +++ /dev/null @@ -1,61 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _NP 0 -#define _L1 1 - -// Macro name shortcuts -#define NUMPAD M(_NP) -#define LAYER1 M(_L1) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_NP] = LAYOUT_ortho_4x4( /* Numpad */ - KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ - KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, \ - KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \ - KC_KP_0, KC_KP_DOT, TG(_L1), KC_BSPC - ), - [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ - KC_NUMLOCK, _______, _______, KC_VOLU, \ - _______, KC_UP, _______, KC_VOLD, \ - KC_LEFT, KC_DOWN, KC_RIGHT, _______, \ - _______, _______, _______, _______ - ) -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _L1: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_L1); - } - break; - case _NP: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_NP); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/roadkit/keymaps/singles/readme.md b/keyboards/roadkit/keymaps/singles/readme.md deleted file mode 100644 index 48ea4a8b35..0000000000 --- a/keyboards/roadkit/keymaps/singles/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# The singles keymap for roadkit - -This keymap has a base layer with numpad functionality, and then a second layer with some additional keys. The user is encouraged to develop their own keymap using this as a starting point. diff --git a/keyboards/roadkit/keymaps/singles/rules.mk b/keyboards/roadkit/keymaps/singles/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/roadkit/keymaps/singles/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/singlesBrent/config.h b/keyboards/roadkit/keymaps/singlesBrent/config.h deleted file mode 100644 index 57468e122a..0000000000 --- a/keyboards/roadkit/keymaps/singlesBrent/config.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#define TAPPING_TERM 175 - -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B5 - #define BACKLIGHT_LEVELS 3 - #define BACKLIGHT_ON_STATE 0 -#endif - -#endif \ No newline at end of file diff --git a/keyboards/roadkit/keymaps/singlesBrent/keymap.c b/keyboards/roadkit/keymaps/singlesBrent/keymap.c deleted file mode 100644 index b4da80e284..0000000000 --- a/keyboards/roadkit/keymaps/singlesBrent/keymap.c +++ /dev/null @@ -1,242 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _NP 0 -#define _L1 1 -#define _L2 2 -#define _L3 3 - -// Macro name shortcuts -#define NUMPAD M(_NP) -#define LAYER1 M(_L1) -#define LAYER2 M(_L2) -#define LAYER3 M(_L3) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -void matrix_init_user(void) { - backlight_level(4); -} - - - -//Tap Dance Declarations - -enum { - - TD_EQUAL_NP = 0, - TD_KP_PLUS_L1, - TD_DOT_L2, - TD_0_L3 - -}; - -//Tap Dance Definitions - - - //TD equal to turn on layer NP -void _td_equal_tg_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code(KC_EQUAL); - } else if (state->count == 2) { - backlight_set(3); - layer_on(_NP); - layer_off(_L1); - layer_off(_L2); - layer_off(_L3); - } -} - -void _td_equal_tg_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code(KC_EQUAL); - } -} - - - //TD kp plus to toggle layer 1 -void _td_kp_plus_tg_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code(KC_KP_PLUS); - } else if (state->count == 2) { -// layer_invert(_L1); - backlight_set(2); - layer_on(_L1); - layer_off(_L2); - layer_off(_L3); - } -} - -void _td_kp_plus_tg_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code(KC_KP_PLUS); - } -} - - - //TD dot to toggle layer 2 -void _td_dot_tg_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code(KC_DOT); - } else if (state->count == 2) { - backlight_set(1); - layer_on(_L2); - layer_off(_L1); - layer_off(_L3); - } -} - -void _td_dot_tg_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code(KC_DOT); - } -} - - //TD 0 to toggle layer 3 -void _td_0_tg_finished (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - register_code(KC_0); - } else if (state->count == 2) { - backlight_set(0); - layer_on(_L3); - layer_off(_L1); - layer_off(_L2); - } -} - -void _td_0_tg_reset (qk_tap_dance_state_t *state, void *user_data) { - if (state->count == 1) { - unregister_code(KC_0); - } -} - -//TD Actions -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_EQUAL_NP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_equal_tg_finished, _td_equal_tg_reset), - [TD_KP_PLUS_L1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_kp_plus_tg_finished, _td_kp_plus_tg_reset), - [TD_DOT_L2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_dot_tg_finished, _td_dot_tg_reset), - [TD_0_L3] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_0_tg_finished, _td_0_tg_reset) -}; - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Numberpad - * ,-----------------------. - * | 7 | 8 | 9 | / | - * |-----`-----`-----`-----| - * | 4 | 5 | 6 | * | - * |-----`-----`-----`-----| - * | 1 | 2 | 3 | - | - * |-----`-----`-----`-----| - * | 0 | . | + | = | - * `-----`-----`-----`-----' - * Tapdances: - * | L3 | L2 | L1 | NP | - * `-----`-----`-----`-----' - */ - [_NP] = LAYOUT_ortho_4x4( /* Numpad */ - KC_7, KC_8, KC_9, KC_SLASH, \ - KC_4, KC_5, KC_6, KC_KP_ASTERISK, \ - KC_1, KC_2, KC_3, KC_MINUS, \ - TD(TD_0_L3), TD(TD_DOT_L2), TD(TD_KP_PLUS_L1), TD(TD_EQUAL_NP) - ), - - /* L1 - * ,-----------------------. - * | Esc |Bksp |Home |PgUp | - * |-----`-----`-----`-----| - * | Tab | Up | End |PgDn | - * |-----`-----`-----`-----| - * |Left |Down |Right|Enter| - * |-----`-----`-----`-----| - * | 0 | . | + | = | - * `-----`-----`-----`-----' - */ - [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ - KC_ESCAPE, KC_BSPACE, KC_HOME, KC_PGUP, \ - KC_TAB, KC_UP, KC_END, KC_PGDOWN, \ - KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER, \ - _______, _______, _______, _______ - ), - - /* L2 - * ,-----------------------. - * |Sleep|LClik|RClik|VolUp| - * |-----`-----`-----`-----| - * |AltF4| F11 |WinTb|VolDn| - * |-----`-----`-----`-----| - * |PrvTk|Play |NxtTk|Mute | - * |-----`-----`-----`-----| - * | 0 | . | + | = | - * `-----`-----`-----`-----' - */ - [_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */ - KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \ - LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \ - KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \ - _______, _______, _______, _______ - ), - - /* L3 needs cut, copy, paste, undo, again (redo), find, calc, www back, www forward, F5 - * ,-----------------------. - * |WBack|WHome|WFor | F5 | - * |-----`-----`-----`-----| - * |Calc |Undo |Redo |WSrch| - * |-----`-----`-----`-----| - * | Cut |Copy |Paste|Find | - * |-----`-----`-----`-----| - * | 0 | . | + | = | - * `-----`-----`-----`-----' - */ - [_L3] = LAYOUT_ortho_4x4( /* LAYER 3 */ - KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \ - LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \ - KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \ - _______, _______, _______, _______ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t * action_get_macro(keyrecord_t * record, uint8_t id, uint8_t opt) { - switch (id) { - case _L3: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_L3); - } - break; - case _L2: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_L2); - } - break; - case _L1: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_L1); - } - break; - case _NP: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_NP); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/roadkit/keymaps/singlesBrent/readme.md b/keyboards/roadkit/keymaps/singlesBrent/readme.md deleted file mode 100644 index 48ea4a8b35..0000000000 --- a/keyboards/roadkit/keymaps/singlesBrent/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# The singles keymap for roadkit - -This keymap has a base layer with numpad functionality, and then a second layer with some additional keys. The user is encouraged to develop their own keymap using this as a starting point. diff --git a/keyboards/roadkit/keymaps/singlesBrent/rules.mk b/keyboards/roadkit/keymaps/singlesBrent/rules.mk deleted file mode 100644 index b61d6cca2c..0000000000 --- a/keyboards/roadkit/keymaps/singlesBrent/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -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 -TAP_DANCE_ENABLE = yes # Enable Tap Dance functionality - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/roadkit/readme.md b/keyboards/roadkit/readme.md deleted file mode 100644 index 691bd1f3e9..0000000000 --- a/keyboards/roadkit/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -roadkit -======= - -A programmable macro pad. - -Keyboard Maintainer: QMK Community -Hardware Supported: Roadkit PCB -Hardware Availability: https://thevankeyboards.com/collections/catalog/products/road-kit-diy?variant=603645345806 - -Make example for this keyboard (after setting up your build environment): - - make roadkit:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/roadkit/roadkit.c b/keyboards/roadkit/roadkit.c deleted file mode 100644 index 26e0c51ec5..0000000000 --- a/keyboards/roadkit/roadkit.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "roadkit.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/roadkit/roadkit.h b/keyboards/roadkit/roadkit.h deleted file mode 100644 index 62cfabc5eb..0000000000 --- a/keyboards/roadkit/roadkit.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef ROADKIT_H -#define ROADKIT_H - -#include "quantum.h" - -// This is a shortcut to help you visually see your layout. -#define LAYOUT_numpad_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, \ - K20, K21, K22, K23, \ - K30, K32 \ -) \ -{ \ - { K00, K01, K02, K03 }, \ - { K10, K11, K12, KC_NO }, \ - { K20, K21, K22, K23 }, \ - { K30, KC_NO, K32, KC_NO } \ -} - -#define LAYOUT_ortho_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, K13, \ - K20, K21, K22, K23, \ - K30, K31, K32, K33 \ -) \ -{ \ - { K00, K01, K02, K03 }, \ - { K10, K11, K12, K13 }, \ - { K20, K21, K22, K23 }, \ - { K30, K31, K32, K33 } \ -} - -#endif diff --git a/keyboards/roadkit/rules.mk b/keyboards/roadkit/rules.mk deleted file mode 100644 index d15a5541bb..0000000000 --- a/keyboards/roadkit/rules.mk +++ /dev/null @@ -1,71 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -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 - - -# Boot Section Size in *bytes* -# 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 = yes # 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 -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - -LAYOUTS = numpad_4x4 ortho_4x4 diff --git a/keyboards/thevankeyboards/bananasplit/README.md b/keyboards/thevankeyboards/bananasplit/README.md new file mode 100644 index 0000000000..41d0d407db --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/README.md @@ -0,0 +1,14 @@ +# BananaSplit60 + +A 60% PCB featuring a split spacebar. + +Keyboard Maintainer: QMK Community +Hardware Supported: BananaSplit60 PCB +Hardware Availability: https://thevankeyboards.com/products/gb-bananasplit-60-keyboard-kit?variant=42149104910 + +Make example for this keyboard (after setting up your build environment): + + make thevankeyboards/bananasplit: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/thevankeyboards/bananasplit/bananasplit.c b/keyboards/thevankeyboards/bananasplit/bananasplit.c new file mode 100644 index 0000000000..1aa8fb1745 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/bananasplit.c @@ -0,0 +1,28 @@ +#include "bananasplit.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/thevankeyboards/bananasplit/bananasplit.h b/keyboards/thevankeyboards/bananasplit/bananasplit.h new file mode 100644 index 0000000000..8d545c1f99 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/bananasplit.h @@ -0,0 +1,142 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ +#ifndef BANANASPLIT_H +#define BANANASPLIT_H + +#include "quantum.h" + +/* +------------------------------------------------------------------------------------------- +| K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | +------------------------------------------------------------------------------------------- +| K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | +------------------------------------------------------------------------------------------- +| K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | K29 | K2A | K2B | K2C | +------------------------------------------------------------------------------------------- +| K30 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | K3D | +------------------------------------------------------------------------------------------- +| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C | +------------------------------------------------------------------------------------------- +*/ +#define LAYOUT_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ +} +/* Here is the above keymap filled with KC_TRNS. It's a useful starting point when defining layers. +KEYMAP( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) +*/ + +#define LAYOUT_hhkbanana( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K45, K48, K49, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \ +} + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K45, K48, K49, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO } \ +} + +/* +------------------------------------------------------------------------------------------- +| K00 | K01 | K02 | K03 | K04 | K05 | K06 | K07 | K08 | K09 | K0A | K0B | K0C | K0D | K2D | +------------------------------------------------------------------------------------------- +| K10 | K11 | K12 | K13 | K14 | K15 | K16 | K17 | K18 | K19 | K1A | K1B | K1C | K1D | +------------------------------------------------------------------------------------------- +| K20 | K21 | K22 | K23 | K24 | K25 | K26 | K27 | K28 | K29 | K2A | K2B | K2C | +------------------------------------------------------------------------------------------- +| K30 | K31 | K32 | K33 | K34 | K35 | K36 | K37 | K38 | K39 | K3A | K3B | K3C | K3D | +------------------------------------------------------------------------------------------- +| K40 | K41 | K42 | K44 | K45 | K46 | K48 | K49 | K4A | K4B | K4C | +------------------------------------------------------------------------------------------- +*/ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ +} + +#define LAYOUT_hhkb_arrow( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D,\ + K40, K41, K42, K44, K45, K46, K48, K49, K4A, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, K4A, K4B, K4C, KC_NO } \ +} + + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/config.h b/keyboards/thevankeyboards/bananasplit/config.h new file mode 100644 index 0000000000..5649ab4aa6 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/config.h @@ -0,0 +1,84 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEAE +#define PRODUCT_ID 0x8870 +#define DEVICE_VER 0x0001 +#define MANUFACTURER TheVan Keyboards +#define PRODUCT BananaSplit 60 +#define DESCRIPTION keyboard firmware for BananaSplit 60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_ROW_PINS { B0, B2, B4, B5, B6 } +#define MATRIX_COL_PINS { F5, B1, F0, F1, F4, B3, D7, D6, D4, D5, D3, D2, D1, D0 } +#define UNUSED_PINS + +#define DIODE_DIRECTION ROW2COL + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* mapping backlight LEDs to correct Pin */ +#define BACKLIGHT_PIN B7 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 +#define TAPPING_TERM 175 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + + +/* + * 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 + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/info.json b/keyboards/thevankeyboards/bananasplit/info.json new file mode 100644 index 0000000000..6741c6cdb0 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/info.json @@ -0,0 +1,32 @@ +{ + "keyboard_name": "bananasplit", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_base": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + }, + + "LAYOUT_hhkbanana": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_all": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + }, + + "LAYOUT_hhkb_arrow": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"label":"Alt", "x":10, "y":4}, {"x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/0010/config.h new file mode 100644 index 0000000000..060f5922f2 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c new file mode 100644 index 0000000000..617812149c --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/keymap.c @@ -0,0 +1,73 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +#define ______ KC_TRNS + +/* + This switch layout is ANSI with the following modifications: + Split right shift + 225 125 275 spacebar + Bottom right singles +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +------------------------------------------------------------------------------------------- +|Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Cpslock | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | Up | +------------------------------------------------------------------------------------------- +| Ctrl | GUI | Alt | L1(Space) | LED | Space | Home | End | Left |Rght |Down | +------------------------------------------------------------------------------------------- +*/ +[0] = LAYOUT_base( \ + KC_ESC, 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_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_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_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, LT(1,KC_SPACE), BL_TOGG, KC_SPC, KC_HOME, KC_END, KC_LEFT, KC_RGHT, KC_DOWN \ +), +/* +------------------------------------------------------------------------------------------- +| ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | +------------------------------------------------------------------------------------------- +| | | UP | | | | | | | | | | | PrtSc | +------------------------------------------------------------------------------------------- +| |Left | Down |Right | | | | | | | | | | SLEEP | +------------------------------------------------------------------------------------------- +| | | | | | | | | | | | | | | +------------------------------------------------------------------------------------------- +| | | | | Reset | | | | | | +------------------------------------------------------------------------------------------- +*/ +[1] = LAYOUT_base( \ + KC_GRV, 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_DEL, \ + ______, ______, KC_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, \ + ______, KC_LEFT, KC_DOWN, KC_RGHT, ______, ______, ______, ______, ______, ______, ______, ______, KC_SLEP, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, \ + ______, ______, ______, ______, RESET, ______, ______, ______, ______, ______, KC_PGDN \ +), +}; + + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk new file mode 100644 index 0000000000..7d09c322e5 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2017 Balz Guenat +# +# 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 . + + +# 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 = no # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = no # 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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/config.h new file mode 100644 index 0000000000..92a67f647c --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/config.h @@ -0,0 +1,27 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here +#define GRAVE_ESC_CTRL_OVERRIDE +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 8 + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c new file mode 100644 index 0000000000..275bfe32a1 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + WIN_SWITCH_LAYOUT = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Fn1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift |M(0) | +------------------------------------------------------------------------------------------- +| Ctrl | GUI | Alt | Space | Fn1 | Space | Alt | GUI | App | Ctrl | +------------------------------------------------------------------------------------------- +*/ +[0] = LAYOUT_base( \ + KC_GESC, 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_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, \ + MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, WIN_SWITCH_LAYOUT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_SPC, KC_RALT, KC_RGUI, KC_NO, KC_APP, KC_RCTL \ +), +/* +------------------------------------------------------------------------------------------- +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | +------------------------------------------------------------------------------------------- +| CpsLck |Prev |Vol+ |Next |PgUp | Ins |Home |WrdL |WrdR | End | | | | PrtSc | +------------------------------------------------------------------------------------------- +| TRNS |Mute |Vol- |Play |PgDn | Del |Left |Down | Up |Right| | | | +------------------------------------------------------------------------------------------- +| | | | | | |DelWL|DelWR| | | | | | +------------------------------------------------------------------------------------------- +| | | | | TRNS | | | | | Reset | +------------------------------------------------------------------------------------------- +*/ +[1] = LAYOUT_base( \ + _______, 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_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, KC_PGUP, KC_INS, KC_HOME, LCTL(KC_LEFT), LCTL(KC_RGHT), KC_END, _______, _______, _______, KC_PSCR, \ + _______, KC_MUTE, KC_VOLD, KC_MPLY, KC_PGDN, KC_DEL, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, \ + _______, BL_STEP, BL_BRTG, _______, _______,_______, LCTL(KC_BSPC), LCTL(KC_DEL), _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, RESET \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + + case WIN_SWITCH_LAYOUT: { + // Sends Alt+Shift on both key down and key up. + // Designed to switch between two keyboard layouts on Windows using a locking switch. + // Does nothing if right shift is pressed for easy resync. + if (!(get_mods() & MOD_BIT(KC_RSFT))) + SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_LSHIFT)SS_UP(X_LALT)); + return false; + } + + default: + return true; + } +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/readme.md new file mode 100644 index 0000000000..b9ce5f44a1 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/readme.md @@ -0,0 +1,33 @@ +# /u/Coloneljesus's keymap for the Bananasplit + +Default layer: + +``` +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Fn1 | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | +------------------------------------------------------------------------------------------- +| Ctrl | GUI | Alt | Space | Fn1 | Space | Alt | GUI | App | Ctrl | +------------------------------------------------------------------------------------------- +``` + +Fn1 layer: + +``` +------------------------------------------------------------------------------------------- +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | +------------------------------------------------------------------------------------------- +| CpsLck |Prev |Vol+ |Next |PgUp | Ins |Home |WrdL |WrdR | End | | | | PrtSc | +------------------------------------------------------------------------------------------- +| TRNS |Mute |Vol- |Play |PgDn | Del |Left |Down | Up |Right| | | | +------------------------------------------------------------------------------------------- +| | | | | | |DelWL|DelWR| | | | | +------------------------------------------------------------------------------------------- +| | | | | TRNS | | | | | Reset | +------------------------------------------------------------------------------------------- +``` \ No newline at end of file diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk new file mode 100644 index 0000000000..7d09c322e5 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2017 Balz Guenat +# +# 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 . + + +# 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 = no # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = no # 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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h new file mode 100644 index 0000000000..060f5922f2 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c new file mode 100644 index 0000000000..dcef38bca1 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define LAYER_1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT_LAYER] = LAYOUT_base( + KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, _______, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(LAYER_1), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [LAYER_1] = LAYOUT_base( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/default/readme.md new file mode 100644 index 0000000000..aaf6daa08c --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for the Bananasplit diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk new file mode 100644 index 0000000000..7d09c322e5 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2017 Balz Guenat +# +# 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 . + + +# 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 = no # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = no # 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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c new file mode 100644 index 0000000000..f2f829f93e --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/hhkbanana/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define LAYER_1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT_LAYER] = LAYOUT_hhkbanana( \ + KC_ESC, 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_BSLS, KC_PSCR, \ + 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_BSPC, \ + 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_ENT, MO(LAYER_1), KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + + [LAYER_1] = LAYOUT_hhkbanana( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c new file mode 100644 index 0000000000..89e275daf7 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/keymap.c @@ -0,0 +1,92 @@ +/* + Author: jockyxu1122 + + Hightlight: split backspace, split space, arrows on bottom right, + and backlighting support (capslock's backlighting cannot be controlled separately). + + Note that "Previous track" and "next track" might only work with Windows. +*/ + +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define LAYER_1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + ------------------------------------------------------------- + |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| + ------------------------------------------------------------- + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + ------------------------------------------------------------- + | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + ------------------------------------------------------------- + | Shift | Z | X | C | V | B | N | M | , | . | / | Shift| Up| + ------------------------------------------------------------- + |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| + ------------------------------------------------------------- + Hm: Home + MoL1: Mo(L1) + */ + [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( + // row 1 + KC_ESC, 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_GRV, \ + KC_DEL, \ + // row 2 + 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, \ + // row 3 + 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, \ + // row 4 + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, \ + // row 5 + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(LAYER_1), KC_BSPC, KC_HOME, KC_END, KC_LEFT, KC_DOWN, \ + KC_RIGHT + ), + + /* + ------------------------------------------------------------- + |LED| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| + ------------------------------------------------------------- + | | | | @ | | | | | | | |BDn|BUp| | + ------------------------------------------------------------- + | | | | | | | | | | | | | | + ------------------------------------------------------------- + | | | |Cal| |www| |Mut| | | | |VUp| + ------------------------------------------------------------- + | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| + ------------------------------------------------------------- + @: Email + BDn: LED brightness down + BUp: LED brightness up + Cal: Calculator + Ins: Insert + Mut: Mute + NTk: Next track + PDn: Page down + PTk: Previous track + PUp: Page up + VDn: Volume down + VUp: Volume up + www: Browser home page + */ + [LAYER_1] = LAYOUT_hhkb_arrow( + // row 1 + BL_TOGG, 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_TRNS, KC_INS, \ + // row 2 + KC_TRNS, KC_TRNS, KC_TRNS, KC_MAIL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, BL_DEC, BL_INC, KC_TRNS, \ + // row 3 + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, \ + // row 4 + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_WHOM, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_VOLU, \ + // row 5 + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_MPRV, KC_VOLD, \ + KC_MNXT + ) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md new file mode 100644 index 0000000000..664a0a0483 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_ansi/readme.md @@ -0,0 +1,66 @@ +Yida's keymap for BananaSplit +=== + +Hightlight: split backspace, split space, arrows on bottom right, and +backlighting support (capslock's backlighting cannot be controlled separately). + +Note that "Previous track" and "next track" might only work with Windows. + +Default layer: + +``` + ------------------------------------------------------------- + |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| + ------------------------------------------------------------- + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + ------------------------------------------------------------- + | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + ------------------------------------------------------------- + | Shift | Z | X | C | V | B | N | M | , | . | / | Shift| Up| + ------------------------------------------------------------- + |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| + ------------------------------------------------------------- + Hm: Home + MoL1: Mo(L1) +``` + +Layer_1: + +``` + ------------------------------------------------------------- + |LED| F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| + ------------------------------------------------------------- + | | | | @ | | | | | | | |BDn|BUp| | + ------------------------------------------------------------- + | | | | | | | | | | | | | | + ------------------------------------------------------------- + | | | |Cal| |www| |Mut| | | | |VUp| + ------------------------------------------------------------- + | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| + ------------------------------------------------------------- + @: Email + BDn: LED brightness down + BUp: LED brightness up + Cal: Calculator + Ins: Insert + Mut: Mute + NTk: Next track + PDn: Page down + PTk: Previous track + PUp: Page up + VDn: Volume down + VUp: Volume up + www: Browser home page +``` + +Compile and flash: + +`cd` to `/qmk_firmware` folder, then +``` +make bananasplit:jockyxu1122_ansi +``` + +A .hex file will be generated under `/qmk_firmware` folder. + + +To flash, use QMK Toolbox. diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c new file mode 100644 index 0000000000..859944991b --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/keymap.c @@ -0,0 +1,105 @@ +/* + Author: jockyxu1122 + + Hightlight: split backspace, ISO Enter, split space, arrows on bottom right, + and toggable capslock backlight. + + Note that "Previous track" and "next track" might only work with Windows. +*/ + +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define LAYER_1 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + ------------------------------------------------------------- + |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| + ------------------------------------------------------------- + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Ent | + -------------------------------------------------------- - + | Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | + ------------------------------------------------------------- + | Shift | Z | X | C | V | B | N | M | , | . | Shift| Up| / | + ------------------------------------------------------------- + |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| + ------------------------------------------------------------- + Hm: Home + MoL1: Mo(L1) + */ + [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( + // row 1 + KC_ESC, 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_GRV, \ + KC_DEL, \ + // row 2 + 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_ENT, \ + // row 3 + 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_BSLS, \ + // row 4 + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_SLSH, \ + // row 5 + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(LAYER_1), KC_BSPC, KC_HOME, KC_END, KC_LEFT, KC_DOWN, \ + KC_RIGHT + ), + + /* + ------------------------------------------------------------- + | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| + ------------------------------------------------------------- + | | | | @ | | | | | | | | | | | + -------------------------------------------------------- - + | | | | | | | | | | | | | | | + ------------------------------------------------------------- + | | | |Cal| |www| |Mut| | | |VUp| | + ------------------------------------------------------------- + | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| + ------------------------------------------------------------- + @: Email + Cal: Calculator + Ins: Insert + Mut: Mute + NTk: Next track + PDn: Page down + PTk: Previous track + PUp: Page up + VDn: Volume down + VUp: Volume up + www: Browser home page + */ + [LAYER_1] = LAYOUT_hhkb_arrow( + // row 1 + KC_TRNS, 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_TRNS, KC_INS, \ + // row 2 + KC_TRNS, KC_TRNS, KC_TRNS, KC_MAIL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + // row 3 + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, \ + // row 4 + KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC, KC_TRNS, KC_WHOM, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_VOLU, KC_TRNS, \ + // row 5 + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, KC_PGUP, KC_PGDN, KC_MPRV, KC_VOLD, \ + KC_MNXT + ) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; + +/* +Capslock's led cannot be controlled separately on bananasplit and you can only turn on/off all + leds at once. If you only install led for capslock, it will look like capslock has toggable + backlight. +*/ +void led_set_user(uint8_t usb_led) { + if (usb_led && (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 7); + PORTB |= (1 << 7); + } else { + DDRB &= ~(1 << 7); + PORTB &= ~(1 << 7); + } +} diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md new file mode 100644 index 0000000000..e135f73e3a --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/jockyxu1122_iso/readme.md @@ -0,0 +1,61 @@ +Yida's keymap for BananaSplit +=== + +Hightlight: split backspace, ISO Enter, split space, arrows on bottom right, and toggable capslock backlight. + +Note that "Previous track" and "next track" might only work with Windows. + +Default layer: +``` + ------------------------------------------------------------- + |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | ` |Del| + ------------------------------------------------------------- + | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | Ent | + -------------------------------------------------------- - + | Caps | A | S | D | F | G | H | J | K | L | ; | ' | \ | | + ------------------------------------------------------------- + | Shift | Z | X | C | V | B | N | M | , | . | Shift| Up| / | + ------------------------------------------------------------- + |Ctrl| GUI| Alt| Space |MoL1| Backspc| Hm|End| <-|Dwn| ->| + ------------------------------------------------------------- + Hm: Home + MoL1: Mo(L1) +``` + +Layer_1: +``` + ------------------------------------------------------------- + | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |Ins| + ------------------------------------------------------------- + | | | | @ | | | | | | | | | | | + -------------------------------------------------------- - + | | | | | | | | | | | | | | | + ------------------------------------------------------------- + | | | |Cal| |www| |Mut| | | |VUp| | + ------------------------------------------------------------- + | | | | Pause | | |PUp|PDn|PTk|VDn|NTk| + ------------------------------------------------------------- + @: Email + Cal: Calculator + Ins: Insert + Mut: Mute + NTk: Next track + PDn: Page down + PTk: Previous track + PUp: Page up + VDn: Volume down + VUp: Volume up + www: Browser home page +``` + +Compile and flash: + +`cd` to `/qmk_firmware` folder, then +``` +make bananasplit:jockyxu1122_iso +``` + +A .hex file will be generated under `/qmk_firmware` folder. + + +To flash, use QMK Toolbox. diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/config.h new file mode 100644 index 0000000000..af6cf8ef1f --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/config.h @@ -0,0 +1,25 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#define GRAVE_ESC_CTRL_OVERRIDE + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c new file mode 100644 index 0000000000..34306e1830 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/keymap.c @@ -0,0 +1,96 @@ +/* Copyright 2017 Balz Guenat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define ______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | +------------------------------------------------------------------------------------------- +*/ +[0] = LAYOUT_base( \ + KC_GESC, 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_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_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, M(0),\ + MO(1), KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_NO, MO(1), KC_RCTL \ +), +/* +------------------------------------------------------------------------------------------- +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | +------------------------------------------------------------------------------------------- +| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | +------------------------------------------------------------------------------------------- +| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | +------------------------------------------------------------------------------------------- +| Shift | | | | | | | | | | | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | +------------------------------------------------------------------------------------------- +*/ +[1] = LAYOUT_base( \ + KC_GRV, 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_DEL, \ + KC_TAB, KC_HOME, KC_UP, KC_END, KC_PGUP, ______, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, \ + KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, ______, ______, ______, ______, ______, ______, ______, ______, \ + KC_LSFT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_RSFT, ______, \ + ______, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, ______, ______, ______, KC_RCTL \ +), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case 0: + // Sends Alt+Shift on both key down and key up. + // Fesigned to switch between two keyboard layouts on Windows using a locking switch. + // Does nothing if right shift is pressed for easier resync. + if (!(get_mods() & MOD_BIT(KC_RSFT))) + return MACRO(D(LALT), T(LSFT), U(LALT), END); + else + return MACRO_NONE; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/readme.md b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/readme.md new file mode 100644 index 0000000000..a08bea519f --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/readme.md @@ -0,0 +1,34 @@ +# Kamon's keymap for the Bananasplit +A simple layout to get you started with the BananaSplit60. + +Default layer: + +``` +------------------------------------------------------------------------------------------- +|GvEsc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +------------------------------------------------------------------------------------------- +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +------------------------------------------------------------------------------------------- +| Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +------------------------------------------------------------------------------------------- +| Shift | Z | X | C | V | B | N | M | , | . | / | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | Fn1 | Fn1 | Ctrl | +------------------------------------------------------------------------------------------- +``` + +Fn1 layer: + +``` +------------------------------------------------------------------------------------------- +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Delete | +------------------------------------------------------------------------------------------- +| TAB |Home | Up | End |PgUp | | | | | | | | | PrtSc | +------------------------------------------------------------------------------------------- +| Ctrl |Left |Down |Right |PgDn | | | | | | | | Enter | +------------------------------------------------------------------------------------------- +| Shift | | | | | | | | | | | Shift | | +------------------------------------------------------------------------------------------- +| Fn1 | GUI | Alt | Space | Space | Space | Alt | | | Ctrl | +------------------------------------------------------------------------------------------- +``` \ No newline at end of file diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk new file mode 100644 index 0000000000..7d09c322e5 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk @@ -0,0 +1,37 @@ +# Copyright 2017 Balz Guenat +# +# 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 . + + +# 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 = no # Virtual DIP switch configuration(+1000) +# MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +# EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +# CONSOLE_ENABLE = no # 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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c new file mode 100644 index 0000000000..5ed1c65e99 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/nic/keymap.c @@ -0,0 +1,45 @@ +#include QMK_KEYBOARD_H + +#define DEFAULT_LAYER 0 +#define THUMB_LAYER 1 +#define NORMAN_LAYER 2 +#define MOD_LAYER 3 + +#define HYPER_TAB ALL_T(KC_TAB) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT_LAYER] = LAYOUT_hhkb_arrow( \ + 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_BSLS, KC_DEL, \ + HYPER_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_BSPC, \ + 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, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, RSFT_T(KC_SLSH), KC_UP, TG(NORMAN_LAYER), \ + KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, MO(THUMB_LAYER), KC_SPC, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + + [THUMB_LAYER] = LAYOUT_hhkb_arrow( \ + MO(MOD_LAYER), 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_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + [NORMAN_LAYER] = LAYOUT_hhkb_arrow( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, KC_D, KC_F, KC_K, KC_J, KC_U, KC_R, KC_L, KC_SCLN, _______, _______, _______, \ + _______, _______, _______, KC_E, KC_T, _______, KC_Y, KC_N, KC_I, KC_O, KC_H, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_P, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + [MOD_LAYER] = LAYOUT_hhkb_arrow( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/rask/README.md b/keyboards/thevankeyboards/bananasplit/keymaps/rask/README.md new file mode 100644 index 0000000000..ec19d3935b --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/rask/README.md @@ -0,0 +1,53 @@ +# rask's BananaSplit60 + +![BS60 layout](http://i.imgur.com/Q7so1py.png) + +## Notes + +### Layers + +Base layer is a regular HHKBish ANSI layer. Toggling the +alternate base layer (Fn3) makes it simpler to play games with +the left space being set to be an actual Space. + +Layer 1 (Fn1) contains usual 60% functionalities such as the +F-row, while Layer 2 (Fn2) contains media controls. + +The final layer (Fn4) is a special layer that acts as a lock +layer, meaning the keyboard is locked while the layer +is active. This firmware assumes a lock switch (read below). + +### Lock switches + +1.25u between the split space halves and the 1u key right +left of LeftArrow are to be operated with a lock switch. +If you don't have lock switches you should swap the `MO()` +calls with `TG()` calls to make the layer toggles work +with regular non/locking switches. + +## How to make and flash + +(These instructions are for Linux-based operating systems +with `dfu-programmer` available.) + +`cd` into the `bananasplit` keyboard's directory and run + + make rask + +which should result in a file called `bananasplit_rask.hex` appearing +in your QMK root directory. + +Now plug in your BananaSplit60 keyboard via USB. Verify +with `lsusb` that it appears. At least my PCB did not have +anything preflashed so you should see `atmega32u4` or similar +in the `lsusb` output. + +Now you can flash the firmware by + + $ sudo dfu-programmer atmega32u4 erase + $ cd /qmk_firmware/root/directory + $ sudo dfu-programmer atmega32u4 flash bananasplit_rask.hex + +_If_ you happen to have some other `atmega32u4` based device +I suggest you plug it out before flashing your BS60 just to +prevent accidentally flashing your old device. diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/rask/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/rask/keymap.c new file mode 100644 index 0000000000..6c7544cc8b --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/rask/keymap.c @@ -0,0 +1,72 @@ +#include QMK_KEYBOARD_H + +// rask's BananaSplit60 layout + +#define L_BASE 0 +#define L_BASE_ALT 1 +#define L_ONE 2 +#define L_TWO 3 +#define L_LOCK 4 + +#define ______ KC_TRNS +#define XXXXXX KC_NO + +// L_BASE +// Initial layer with default keymap +// +// L_BASE_ALT +// Layer with some standardisation e.g. make +// space key "full" to make gaming less of a +// chore +// +// L_ONE +// General things like F-row and navigation +// +// L_TWO +// Media controls and more exotic keybinds +// +// L_LOCK +// Lock the keyboard, release to unlock + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [L_BASE] = LAYOUT_hhkb_arrow( \ + 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_BSLS, KC_DEL, \ + 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_BSPC, \ + MO(L_ONE), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_SLSH), KC_UP, MO(L_TWO), \ + KC_LCTRL, KC_LGUI, KC_LALT, KC_BSPC, MO(L_BASE_ALT), KC_SPACE, KC_RALT, MO(L_LOCK), KC_LEFT, KC_DOWN, KC_RIGHT \ + ), + + [L_BASE_ALT] = LAYOUT_hhkb_arrow( \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, KC_SPACE, ______, ______, ______, ______, ______, ______, ______ \ + ), + + [L_ONE] = LAYOUT_hhkb_arrow( \ + 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_INS, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_PGUP, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, KC_HOME, KC_PGDN, KC_END \ + + ), + + [L_TWO] = LAYOUT_hhkb_arrow( \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, \ + KC_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, \ + ______, ______, ______, ______, ______, ______, ______, ______, KC_MSTP, ______, ______, ______, ______, \ + ______, KC_APP, ______, ______, ______, ______, ______, ______, ______, ______, ______ \ + ), + + [L_LOCK] = LAYOUT_hhkb_arrow( \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, \ + XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, XXXXXX, ______, XXXXXX, XXXXXX, XXXXXX \ + ), +}; diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h new file mode 100644 index 0000000000..bb2aadfa69 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h @@ -0,0 +1,23 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define PREVENT_STUCK_MODIFIERS +#define SPACE_COUNT 3 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, KC_NO, K44, K45, K46, KC_NO, K48, K49, KC_NO, K4B, K4C, KC_NO }\ +} + +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/keymap.c b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/keymap.c new file mode 100644 index 0000000000..7812add812 --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/keymap.c @@ -0,0 +1 @@ +// This space intentionally left blank diff --git a/keyboards/thevankeyboards/bananasplit/rules.mk b/keyboards/thevankeyboards/bananasplit/rules.mk new file mode 100644 index 0000000000..81570c493a --- /dev/null +++ b/keyboards/thevankeyboards/bananasplit/rules.mk @@ -0,0 +1,66 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # 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 +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +BACKLIGHT_ENABLE = yes + + +# Optimize size but this may cause error "relocation truncated to fit" +#EXTRALDFLAGS = -Wl,--relax + +LAYOUTS = 60_ansi 60_iso diff --git a/keyboards/thevankeyboards/minivan/config.h b/keyboards/thevankeyboards/minivan/config.h new file mode 100644 index 0000000000..726768e0ec --- /dev/null +++ b/keyboards/thevankeyboards/minivan/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEAE +#define PRODUCT_ID 0x8844 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Evan Sailer +#define PRODUCT Minivan +#define DESCRIPTION keyboard firmware for Minivan + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, B5, F7, D4 } +#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/thevankeyboards/minivan/info.json b/keyboards/thevankeyboards/minivan/info.json new file mode 100644 index 0000000000..355701feec --- /dev/null +++ b/keyboards/thevankeyboards/minivan/info.json @@ -0,0 +1,24 @@ +{ + "keyboard_name": "tv44", + "url": "", + "maintainer": "qmk", + "width": 12.75, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"Win", "x":1.25, "y":3, "w":1.5}, {"label":"Alt", "x":2.75, "y":3, "w":1.25}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"label":"Alt", "x":8.25, "y":3, "w":1.25}, {"label":"Win", "x":9.5, "y":3, "w":1.5}, {"label":"Menu", "x":11, "y":3, "w":1.75}] + }, + + "LAYOUT_arrow": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"Win", "x":1.25, "y":3, "w":1.5}, {"label":"Alt", "x":2.75, "y":3, "w":1.25}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3}, {"label":"Win", "x":10.75, "y":3}, {"label":"Menu", "x":11.75, "y":3}] + }, + + "LAYOUT_command": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Win", "x":1, "y":3}, {"label":"Alt", "x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3, "w":1.5}, {"label":"Win", "x":11.25, "y":3, "w":1.5}] + }, + + "LAYOUT_arrow_command": { + "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Win", "x":1, "y":3}, {"label":"Alt", "x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3}, {"label":"Win", "x":10.75, "y":3}, {"label":"Menu", "x":11.75, "y":3}] + } + } +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/config.h b/keyboards/thevankeyboards/minivan/keymaps/belak/config.h new file mode 100644 index 0000000000..47d96a29d8 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define TAPPING_TERM 500 + +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c new file mode 100644 index 0000000000..19051574a5 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/keymap.c @@ -0,0 +1,102 @@ +#include QMK_KEYBOARD_H + +// Layer names. We stick to 3 letters if possible so MO(NAME) fits in 7 +// characters and doesn't mess with the grid. +#define _QW 0 +#define _L1 1 +#define _L2 2 +#define _L3 3 + +// Curly braces have their own keys. These are defined so they don't mess up the +// grid in layer 2. +#define L_CURBR LSFT(KC_LBRC) +#define R_CURBR LSFT(KC_RBRC) + +#define L1_TAB LT(_L1, KC_TAB) +#define L2_ESC LT(_L2, KC_ESC) +#define L2_SLSH LT(_L2, KC_SLSH) +#define L3_QUOT LT(_L3, KC_QUOT) + +// Tap dance magic +#define TD_LGUI TD(BE_TD_GUI) +#define TD_LCTL TD(BE_TD_CTL) +#define TD_LALT TD(BE_TD_ALT) + +enum belak_td { + BE_TD_GUI = 0, + BE_TD_CTL, + BE_TD_ALT, +}; + +void mod_tap_fn(qk_tap_dance_state_t *state, void *user_data); +void mod_reset_fn(qk_tap_dance_state_t *state, void *user_data); + +qk_tap_dance_action_t tap_dance_actions[] = { + [BE_TD_GUI] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), + [BE_TD_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), + [BE_TD_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), +}; + +uint16_t tap_dance_keys[] = { + [BE_TD_GUI] = KC_LGUI, + [BE_TD_CTL] = KC_LCTL, + [BE_TD_ALT] = KC_LALT, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT_arrow_command( /* Qwerty */ + L2_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + L1_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, L2_SLSH, + TD_LCTL, MO(_L3), TD_LALT, TD_LGUI, KC_SPC, KC_SPC, MO(_L1), KC_LEFT, KC_DOWN, KC_RGHT + ), + [_L1] = LAYOUT_arrow_command( /* LAYER 1 */ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_QUOT, + _______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT, + _______, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_L2] = LAYOUT_arrow_command( /* LAYER 2 */ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, L_CURBR, R_CURBR, KC_4, KC_5, KC_6, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______, + _______, _______, _______, _______, _______, _______, KC_RALT, _______, _______, _______ + ), + [_L3] = LAYOUT_arrow_command( /* LAYER 3 */ + _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, + KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, + _______, _______, _______, _______, _______, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_RSFT, + _______, _______, _______, _______, _______, _______, KC_RALT, _______, _______, _______ + ) +}; + +const uint16_t PROGMEM fn_actions[] = {}; + +// Tap dance functions +void mod_tap_fn(qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + register_mods(MOD_BIT(tap_dance_keys[state->keycode - QK_TAP_DANCE])); + send_keyboard_report(); + break; + case 2: + layer_on(_L2); + break; + case 3: + layer_off(_L2); + layer_on(_L1); + break; + default: + reset_tap_dance(state); + } +} + +void mod_reset_fn(qk_tap_dance_state_t *state, void *user_data) { + layer_off(_L1); + layer_off(_L2); + unregister_mods(MOD_BIT(tap_dance_keys[state->keycode - QK_TAP_DANCE])); + send_keyboard_report(); +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/readme.md b/keyboards/thevankeyboards/minivan/keymaps/belak/readme.md new file mode 100644 index 0000000000..b0a505c4ae --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/readme.md @@ -0,0 +1,14 @@ +# Belak's TV44 (TV46?) layout + +This layout is roughly based on the low-rider arrow-southpaw layout from [the +configurator](http://minivan.config.thevankeyboards.com) with a number of +changes to make it easier to use and add in missing keys (like adding / and ' +to the main layer) + +## Rev1 + +* Moved enter to a more standard location to have a full spacebar +* Quote is now on L1 +* Small tweaks to make modifiers work a little more consistently +* Greatly increase the tapping term to make the tap-dance mods easier to use + diff --git a/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk new file mode 100644 index 0000000000..6112411240 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/belak/rules.mk @@ -0,0 +1,12 @@ +#BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +#EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +#CONSOLE_ENABLE = yes # Console for debug(+400) +#DEBUG_ENABLE = yes +#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 +TAP_DANCE_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/budi/config.h b/keyboards/thevankeyboards/minivan/keymaps/budi/config.h new file mode 100644 index 0000000000..67bcf3546e --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/budi/config.h @@ -0,0 +1,22 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#ifdef DEBOUNCING_DELAY +#undef DEBOUNCING_DELAY +#endif +#define DEBOUNCING_DELAY 2 +#define MOUSEKEY_INTERVAL 10 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 120 +#define MOUSEKEY_MAX_SPEED 9 +#define MOUSEKEY_WHEEL_DELAY 0 +#define MOUSEKEY_WHEEL_MAX_SPEED 2 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 120 +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT +#define FORCE_NKRO +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c new file mode 100644 index 0000000000..baa266e635 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/budi/keymap.c @@ -0,0 +1,229 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _DV 0 +#define _NM 1 +#define _NV 2 +#define _MN 3 +#define _FN 4 + +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define NM_SP LT(_NM, KC_SPC) +#define NV_SP LT(_NV, KC_SPC) +#define MN_EN LT(_MN, KC_ENT) +#define FN_EX LT(_FN, KC_ESC) + +// Curly braces have their own keys. These are defined to make them not mess up +// the grid in layer 2. +#define L_CURB LSFT(KC_LBRC) +#define R_CURB LSFT(KC_RBRC) + +// Hypers +#define HYP0 HYPR(KC_0) +#define HYP1 HYPR(KC_1) +#define HYP2 HYPR(KC_2) +#define HYP3 HYPR(KC_3) +#define HYP4 HYPR(KC_4) +#define HYP5 HYPR(KC_5) +#define HYP6 HYPR(KC_6) +#define HYP7 HYPR(KC_7) +#define HYP8 HYPR(KC_8) +#define HYP9 HYPR(KC_9) + +// MEH +#define MEH0 MEH(KC_0) +#define MEH1 MEH(KC_1) +#define MEH2 MEH(KC_2) +#define MEH3 MEH(KC_3) +#define MEH4 MEH(KC_4) +#define MEH5 MEH(KC_5) +#define MEH6 MEH(KC_6) +#define MEH7 MEH(KC_7) +#define MEH8 MEH(KC_8) +#define MEH9 MEH(KC_9) + +// CAG +#define CAG0 LCAG(KC_0) +#define CAG1 LCAG(KC_1) +#define CAG2 LCAG(KC_2) +#define CAG3 LCAG(KC_3) +#define CAG4 LCAG(KC_4) +#define CAG5 LCAG(KC_5) +#define CAG6 LCAG(KC_6) +#define CAG7 LCAG(KC_7) +#define CAG8 LCAG(KC_8) +#define CAG9 LCAG(KC_9) + +// ALTS +#define ALT0 LALT(KC_0) +#define ALT1 LALT(KC_1) +#define ALT2 LALT(KC_2) +#define ALT3 LALT(KC_3) +#define ALT4 LALT(KC_4) +#define ALT5 LALT(KC_5) +#define ALT6 LALT(KC_6) +#define ALT7 LALT(KC_7) +#define ALT8 LALT(KC_8) +#define ALT9 LALT(KC_9) +#define ALTX LALT(KC_GRV) +#define ALTL LALT(KC_LEFT) +#define ALTR LALT(KC_RIGHT) +#define ALTESC LALT(KC_ESC) +#define ALTEQL LALT(KC_EQL) +#define ALTMIN LALT(KC_MINS) + +// BACK AND FORWARD +#define XBACK LGUI(LALT(KC_LEFT)) +#define XFFWD LGUI(LALT(KC_RIGHT)) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define xxxxxxx KC_NO + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + SWTCH +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* DVORAK + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | TAB | ' | , | . | P | Y | F | G | C | R | L | BACKSPACE | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | LCTL | A | O | E | U | I | D | H | T | N | S | MN/ENTER | + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | LSHFT | ; | Q | J | K | X | B | M | W | V | Z | RSHFT | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | FN EX | GUI | ALT | NM / SPACE | NV / SPACE | RALT | - | = | ESC | + * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' + */ + [_DV] = LAYOUT_arrow( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MN_EN, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + FN_EX, KC_LGUI, KC_LALT, NM_SP, NV_SP, KC_RALT, KC_MINS, KC_EQL, KC_ESC + ), + + + +/* NUMBERS + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DELETE | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | LCTL | ! | @ | [ | { | ( | ) | } | ] | | | ? | ENTER | + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | = | + * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | / | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | | GUI | LALT |-----TRNS-----| SPACE | RALT | - | = | \ | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + */ + [_NM] = LAYOUT_arrow( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, KC_EXLM, KC_AT, KC_LBRC, L_CURB, KC_LPRN, KC_RPRN, R_CURB, KC_RBRC, KC_PIPE, KC_QUES, _______, + _______, KC_GRV, KC_TILD, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, KC_SLSH, + _______, _______, _______, _______, KC_SPC, _______, KC_MINS, KC_EQL, KC_BSLS + ), + + + +/* NAVIGATION + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | ESC | MWU | MWL | MU | MWR | MPRV | MNXT | HOME | UP | END | PGUP | DELETE | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | LCTL | MWD | ML | MD | MR | MRWD | MFFD | LEFT | DOWN | RIGHT| PGDN | MB2 | + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | LSFT | HYP1 | HYP2 | HYP3 | HYP4 | HYP5 | HYP6 | HYP7 | HYP8 | HYP9 | HYP0 | VOLUP | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | | GUI | LALT | MB1 |----TRNS----| MUTE | PLAY | STOP | VOLDN | + * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' + */ + [_NV] = LAYOUT_arrow( + KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_MPRV, KC_MNXT, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL, + _______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_MRWD, KC_MFFD, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BTN2, + _______, HYP1, HYP2, HYP3, HYP4, HYP5, HYP6, HYP7, HYP8, HYP9, HYP0, KC_VOLU, + _______, _______, _______, KC_BTN1, _______, KC_MUTE, KC_MPLY, KC_MSTP, KC_VOLD + ), + + + +/* MODIFIED NUMBERS + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | ALTESC | CAG1 | CAG2 | CAG3 | CAG4 | CAG5 | CAG6 | CAG7 | CAG8 | CAG9 | CAG0 | SWTCH | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | ALT ` | ALT1 | ALT2 | ALT3 | ALT4 | ALT5 | ALT6 | ALT7 | ALT8 | ALT9 | ALT0 |----TRNS---| + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | ALT = | MEH1 | MEH2 | MEH3 | MEH4 | MEH5 | MEH6 | MEH7 | MEH8 | MEH9 | MEH0 | | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | ALT - | | XBACK | ALT LEFT | ALT RIGHT | XFFWD | | | | + * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' + */ + [_MN] = LAYOUT_arrow( + ALTESC, CAG1, CAG2, CAG3, CAG4, CAG5, CAG6, CAG7, CAG8, CAG9, CAG0, SWTCH, + ALTX, ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7, ALT8, ALT9, ALT0, _______, + ALTEQL, MEH1, MEH2, MEH3, MEH4, MEH5, MEH6, MEH7, MEH8, MEH9, MEH0, xxxxxxx, + ALTMIN, xxxxxxx, XBACK, ALTL, ALTR, XFFWD, xxxxxxx, xxxxxxx, xxxxxxx + ), + + + +/* FUNCTIONS + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DELETE | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | LCTL | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | LSFT | | | | | | | | | | | | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * |---TRNS---| CAPS | LALT | | SWTCH | RALT | | RESET |--TRNS-| + * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' + */ + [_FN] = LAYOUT_arrow( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, xxxxxxx, + _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC_PWR, KC_SLEP, KC_WAKE, xxxxxxx, xxxxxxx, xxxxxxx, + _______, KC_CAPS, _______, xxxxxxx, SWTCH, KC_RALT, xxxxxxx, RESET, _______ + ) + + + +/* Transparent placeholder for more layers + * ,---------+------+------+------+------+------+------+------+------+------+------+------------. + * | | | | | | | | | | | | | + * |---------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | | | | | | | | | + * |----------`------`------`------`------`------`------`------`------`------`------`-----------| + * | | | | | | | | | | | | | + * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| + * | | | | | | | | | | + * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' + */ +// [_TR] = LAYOUT_arrow( +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, +// _______, _______, _______, _______, _______, _______, _______, _______, _______ +// ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case SWTCH: + SEND_STRING(SS_DOWN(X_LGUI)); + SEND_STRING(SS_DOWN(X_LSHIFT)); + SEND_STRING(SS_TAP(X_ENTER)); + SEND_STRING(SS_UP(X_LSHIFT)); + SEND_STRING(SS_UP(X_LGUI)); + return false; + } + } + return true; +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/budi/readme.md b/keyboards/thevankeyboards/minivan/keymaps/budi/readme.md new file mode 100644 index 0000000000..e5de86ef81 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/budi/readme.md @@ -0,0 +1,17 @@ +# Budi's TV44 Arrow layout + +- Dvorak main layer +- Somewhat easy bracket access for easy devs, happy :) +- Dedicated gaming layers cuz u don't wanna mess with apm +- Mainly for windows, but with translated alt/cmd on os, it's good to go + +ASCII graphics shamelessly stolen from tong92's layout :) + +Updates August 2018: +- Escape both ways +- Only include QMK_KEYBOARD_H + +Updates July 2018: +- I guess I don't play games that much anymore +- SUGDW modifiers +- Somehow LALT(LSFT(KC_RET)) does not register correctly on my mac diff --git a/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c new file mode 100644 index 0000000000..cf1e0d3f51 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/core/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _L1 1 +#define _L2 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT( /* Qwerty */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_L2), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, MO(_L1), KC_RALT, KC_RCTL + ), + [_L1] = LAYOUT( /* LAYER 1 */ + KC_GRV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_PAUS, + KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, _______, + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_L2] = LAYOUT( /* LAYER 2 */ + 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_UNDS, KC_PLUS, + _______, _______, _______, _______, _______, KC_COMM, KC_SLSH, KC_RBRC, KC_LBRC, KC_BSLS, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/core/readme.md b/keyboards/thevankeyboards/minivan/keymaps/core/readme.md new file mode 100644 index 0000000000..3ec503b21f --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/core/readme.md @@ -0,0 +1,18 @@ +# A minivan keymap based off the Vertex Core + +## Main differences + +* There are only 3 keys on the bottom right, so menu was dropped +* There are only 3 keys on the bottom left, so Pn was dropped because there is + no programmable layer. +* There are only 12 keys in the first row, so the delete key (along with scroll + lock) has been dropped. +* The F1-F12 keys have been shifted by 1 so they all fit in the first row of + layer 2. +* Moved the grave/tilde to layer 1 (because in layer 2 it's now taken up by F1). +* Keys relating to speed have been removed +* The `L_Win + L_Alt + R_spacebar = R_Shift, R_Alt, Menu and R_Ctrl as arrow + keys` as mentioned in the manual does not work. +* The layer 2 plus shift should have support for symbols in the first row (where + the F1-F12 keys are) but this has not been implemented, so you need to use the + second row (where the numbers are). diff --git a/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk new file mode 100644 index 0000000000..457a3d01d4 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/core/rules.mk @@ -0,0 +1,3 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/config.h b/keyboards/thevankeyboards/minivan/keymaps/default/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c new file mode 100644 index 0000000000..90b188b55f --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/default/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QW 0 +#define _DV 1 +#define _CM 2 +#define _L1 3 +#define _L2 4 +#define _L3 5 + +// Macro name shortcuts +#define QWERTY M(_QW) +#define DVORAK M(_DV) +#define COLEMAK M(_CM) + +// Curly braces have their own keys. These are defined to make them not mess up +// the grid in layer 2. +#define L_CURBR LSFT(KC_LBRC) +#define R_CURBR LSFT(KC_RBRC) + +// Fillers to make layering more clear +#define _______ KC_TRNS + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = LAYOUT( /* Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2), + KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) + ), + [_DV] = LAYOUT( /* Dvorak */ + KC_TAB, KC_SLSH, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1), + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2), + KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) + ), + [_CM] = LAYOUT( /* Colemak */ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2), + KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) + ), + [_L1] = LAYOUT( /* LAYER 1 */ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______, + _______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT, + _______, KC_LGUI, _______, _______, _______, _______, _______, _______ + ), + [_L2] = LAYOUT( /* LAYER 2 */ + _______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, + KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, L_CURBR, R_CURBR, KC_4, KC_5, KC_6, KC_VOLU, KC_ENT, + _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_L3] = LAYOUT( /* LAYER 3 */ + _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, + KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______, + _______, KC_LSFT, KC_B, KC_SPC, KC_C, _______, _______, _______ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _DV: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DV); + } + break; + case _QW: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QW); + } + break; + case _CM: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_CM); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/readme.md b/keyboards/thevankeyboards/minivan/keymaps/default/readme.md new file mode 100644 index 0000000000..ac84c08cfa --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c new file mode 100644 index 0000000000..0ec9485c72 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/keymap.c @@ -0,0 +1,423 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _PLOVER 5 +#define _TOUCHCURSOR 6 +#define _MOUSECURSOR 7 +#define _ADJUST 16 + +// Keycodes +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +enum macro_keycodes { + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab +#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab +#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings +#define AG_AGAIN M(KC_AG_AGAIN) +#define AG_UNDO M(KC_AG_UNDO) +#define AG_CUT M(KC_AG_CUT) +#define AG_COPY M(KC_AG_COPY) +#define AG_PASTE M(KC_AG_PASTE) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_QWERTY] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Colemak + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | Z | X | C | V | B | K | M | , | . | / | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_COLEMAK] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_R,LT_MC(KC_S), KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Dvorak + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Sft/Ent | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_DVORAK] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_O,LT_MC(KC_E), KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Lower + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | Vol- | Mute | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_LOWER] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_RBRC , KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Raise + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Brite | | | | | | Vol- | Mute | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_RAISE] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + * + * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't + * seem to work on Mac. Presumably they'll work under Windows. + */ + +[_TOUCHCURSOR] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______ , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Mouse Layer + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ + +[_MOUSECURSOR] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + _______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______ , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5 , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Plover layer (http://opensteno.org) + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | # | # | # | # | # | # | # | # | # | # | # | # | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | TogOut | S | K | W | R | * | * | R | B | G | S | Z | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | Exit | A | O | | | E | U | | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ + +[_PLOVER] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + KC_1 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + EXT_PLV , KC_C , KC_V , XXXXXXX , XXXXXXX , KC_N , KC_M , XXXXXXX ), +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ + +/* Adjust (Lower + Raise) + * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + * | | | | | | | | | | | | Del | + * |---------`------`------`------`------`------`------`------`------`------`------`-------------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |----------`------`------`------`------`------`------`------`------`------`------`------------| + * | | | | | | | | | | | | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + * | | | | | | | | Reset | + * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' + */ +[_ADJUST] = LAYOUT( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , RESET ) +/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: + // quantum/quantum.c + if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. + } + + switch (id) { + case KC_ALT_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + case KC_CMD_TAB: + if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } + else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } + + case KC_CTL_TAB: + return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + + case KC_AG_FIND: + return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); + case KC_AG_AGAIN: + return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); + case KC_AG_UNDO: + return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); + case KC_AG_CUT: + return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); + case KC_AG_COPY: + return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); + case KC_AG_PASTE: + return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); + + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + } + + return MACRO_NONE; +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/readme.md b/keyboards/thevankeyboards/minivan/keymaps/jeebak/readme.md new file mode 100644 index 0000000000..f781d55558 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/readme.md @@ -0,0 +1,129 @@ +jeebak's TV44 layout +======================= +NOTE: This is a port of jeebak's planck layout, for tv44. + +This WIP keymap attempts to minimize fingers straying away from the home row. +To aid in this endeavor, when additional modifyer keys to switch layers are +needed, they will be mapped to home row keys. The `keymap.c` file will contain +the exact changes. The diagrams in this README shows the highlights of the +changes from the default mappings. + +I also decided to change all calls to `persistent_default_layer_set()` to +`default_layer_set()` since this is my personal perference. + +## Macros +``` +#define ALT_TAB M(KC_ALT_TAB) +``` + +## Base Layers (Qwerty/Colemak/Dvorak) +These base layers are mostly the same as the default mappings. The interesting +changes are shown below. + +- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, +- `GUI/;` as `;` and `GUI`, +- `Alt/"` as `"` and `Alt`, +- `Sft/Ent` as `Enter` and `Shift`, and +- `Hyper/Tab` as `Tab` and `Hyper` + +A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. +The arrow keys, which have been moved to the +[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been +replaced with the Media keys as shown. The `MC/kc` key activates the +`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, +when tapped. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Lower Layer (Symbols and Function Keys) +The symbols and functions keys are essentially the same as the default mapping. +The most notable changes are that the symbol keys from the `RAISE` layer have +been moved here. The remaining Media keys replace those that are now on the +base layers. The `BACKLIT` key has also been moved here. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | Vol- | Mute | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Raise Layer (Numbers and Arithmetic Operators) +All of the numbers and arithmetic operators are available on this layer. Some +keys are duplicated for the convenience of their positions. The `0` and `$` +keys at the far left are for quick access to beginning and end of line in vim. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | Brite | | | | | | Vol- | Mute | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## TouchCursor layer plus personal customizations +[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key +as the modifier, with the `IJKL` home row keys representing the inverted-T of +the arrow keys. All of the default TouchCursor keymappings for the right hand +are represented below. My personalizations include all of the keys shown for +the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key +from the base layers) readily accessible from the home row allows quick word +jumps and highlighting when used in conjunction with the arrow keys. The +`Alt-Tab` macro is not only useful under Windows, but also under Mac when used +with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). +The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in +this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` +keycodes do not seem to work. There are macros in place that'll "automatically" +choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, +etc.) depending on which layout you've currently selected (`AG_NORM` or +`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I +use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and +`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as +Google Chrome. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` + +## Mouse Layer +The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. +The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the +mouse from the `doc/keycode.txt` file are represented, and logically located, +IMHO. The left and right click buttons are duplicated; on the right hand side, +for a quick click here and there, and again on the left hand side for when the +buttons need to be held for dragging things or highlighting text, thus allowing +the right hand to be free to use the up/down/left/right actions. +``` + ,---------+------+------+------+------+------+------+------+------+------+------+-------------. + | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | + |---------`------`------`------`------`------`------`------`------`------`------`-------------| + | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | + |----------`------`------`------`------`------`------`------`------`------`------`------------| + | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | + |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| + | | | | | | | | | + `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' +``` diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/config.h b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/config.h new file mode 100644 index 0000000000..5f5872becc --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/config.h @@ -0,0 +1,7 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define PERMISSIVE_HOLD +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c new file mode 100644 index 0000000000..02ba684216 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/keymap.c @@ -0,0 +1,39 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_arrow_command( /* Qwerty */ + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(2, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(2, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MT(MOD_RSFT, KC_SLSH), + KC_LCTL, KC_LGUI, KC_LALT, MO(3), LT(1, KC_SPC), LT(1, KC_SPC), MO(4), KC_LEFT, KC_DOWN, KC_RIGHT + ), + [1] = LAYOUT_arrow_command( /* LAYER 2 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_QUOT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_PGUP, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END + ), + [2] = LAYOUT_arrow_command( /* LAYER 1 */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UNDS, KC_PLUS, KC_DQUO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PGUP, KC_PIPE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END + ), + [3] = LAYOUT_arrow_command( /* LAYER 3 */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + [4] = LAYOUT_arrow_command( /* Gaming Layer*/ + KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, + KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ) +}; + +const uint16_t PROGMEM fn_actions[] = { +}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/readme.md b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/readme.md new file mode 100644 index 0000000000..fd95b56ab8 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/readme.md @@ -0,0 +1,49 @@ +# Jetpacktuxedo's minivan layout + +This differs quite a bit from the stock layout but leaves keys in a more familiar position in my opinion. It is designed to use the arrow+command layout, but I used a fairly similar layout for the normal arrow layout. Additionally, I use an mx lock switch on the key between the right space key and the arrow cluster. If you don't want to use a lock switch you should change MO(4) on the base layer to use TG(4) instead for a similar effect. + +## Base Layer (0) + +The base layer is pretty simple, straight qwerty layout where available. Of note: /? is to the right of the arrow keys. Yes this is kinda weird sometimes, but you get used to it. Tab is tab when pressed and fn2 when held, Enter is the same. GESC is esc when used alone, but ~ when shifted. Tapping FN 1 is space +``` +|GESC| Q | W | E | R | T | Y | U | I | O | P | BSPC | +| TAB | A | S | D | F | G | H | J | K | L | ; |ENTER| +|SHIFT | Z | X | C | V | B | N | M | , | . | UP | / | +|CTRL|WIN |ALT |FN 3| FN 1 | SPACE | FN 4 |LEFT|DOWN|RIGH| +``` +## Numeric Layer (1) + +This layer has the numrow as well as swapping the arrow keys for a nav cluster, and swapping ;: for '" and /? for \|. With that almost all of the missing keys are accounted for. +``` +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DEL | +| | | | | | | | | - | = | ' | | +| | | | | | | | | [ | ] |PGUP| \ | +| | | | | | | |HOME|PGDN|END | +``` +## Symbolic Layer (2) + +I don't want to be using two key combos constantly, so I also added this symbol layer that is basically shift+numeric layer +``` +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | DEL | +| | | | | | | | | _ | + | " | | +| | | | | | | | | { | } |PGUP| | | +| | | | | | | |HOME|PGDN|END | +``` +## Fkeys (3) + +I very rarely use Fkeys, but figured I'd throw them on anyway just in case. The setup basically mimics the way Fkeys are usually done on a 60%, with F11 and F12 still on - and =, even though the location of those keys has moved. +``` +| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 |F10 | | +| | | | | | | | |F11 |F12 | | | +| | | | | | | | | | | | | +| | | | | | | | | | | +``` +## Gaming Layer (4) + +Originally this was just going to be a gaming layer (make esc just esc, make tab just tab, move space to the left side), but I ended up in a hotel without a usb mouse, so I added mousekeys to it as well. +``` +|ESC | | | | | |MWUP|MRCK|M_UP|MLCK| | | +| TAB | | | | | |MWDN|M_LF|M_DN|M_RG| | | +| | | | | | | | | | | | | +| | | | | SPACE | | | | | | +``` diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk new file mode 100644 index 0000000000..ebc9f810f9 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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 diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/config.h b/keyboards/thevankeyboards/minivan/keymaps/mjt/config.h new file mode 100644 index 0000000000..e89a3ea125 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/config.h @@ -0,0 +1,14 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B2 + #define BACKLIGHT_LEVELS 7 +#endif + +#define USB_MAX_POWER_CONSUMPTION 50 + +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c new file mode 100644 index 0000000000..8f0fba11dc --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/keymap.c @@ -0,0 +1,197 @@ +//Author: mike terhar +#include QMK_KEYBOARD_H + +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +enum minivan_layers { + _QWERTY, + _NUMSYM, + _FKEYS, + _FKEYGRV, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + DYNKEY, + DYNAMIC_MACRO_RANGE, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define FKEYS F(_FKEYS) +#define NUMSYM F(_NUMSYM) +#define FKEYGRV F(_FKEYGRV) +#define MACSLEEP M(5) +#define PLOVER M(6) +#define LAYERRESET M(7) +#define BACKLIT M(8) +#define ADJUST M(9) +#define XXXXXXX KC_NO + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QWERTY] = { + {FKEYS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, + {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT}, + {KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,SFT_T(KC_ENT) }, + {KC_LCTL,KC_LALT,KC_LGUI, KC_SPC,XXXXXXX,XXXXXXX,XXXXXXX,NUMSYM,KC_LEFT,KC_DOWN,KC_UP ,KC_RIGHT} +}, +[_NUMSYM] = { + {FKEYGRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {KC_DEL,KC_EXLM, KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN, ADJUST }, + { _______, KC_UNDS,KC_PLUS, KC_LCBR,KC_RCBR,KC_PIPE , KC_MINS,KC_EQL,KC_LBRC, KC_RBRC, KC_BSLS, _______}, + {_______,_______,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_HOME, KC_PGDN, KC_PGUP, KC_END} +}, +[_FKEYS] ={ + {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______}, + {KC_DEL, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, MACSLEEP, DYN_REC_START1, DYN_REC_START2 }, + {KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,_______,DYN_REC_STOP}, + {_______,_______,_______,LAYERRESET,XXXXXXX,XXXXXXX,XXXXXXX,LAYERRESET, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} +}, +[_PLOVER] = { + {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, + {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, + {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {LAYERRESET, XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} +}, +[_ADJUST] = { + {_______ , RESET, _______, _______, _______, _______, _______, _______, KC_SLCK, KC_PAUS, KC_PSCR, KC_DEL }, + {_______ , _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, MACSLEEP, PLOVER, _______}, + {_______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {BACKLIT, _______, _______, LAYERRESET, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} +} +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND); +float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_adjust[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const uint16_t PROGMEM fn_actions[] = { + [_FKEYS] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_TAB), + [_FKEYGRV] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_GRV), + [_NUMSYM] = ACTION_LAYER_TAP_TOGGLE(_NUMSYM), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case 5: // MACSLEEP + if (record->event.pressed) { + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + break; + case 6: // PLOVER + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_plover, false, 0); + #endif + layer_off(_NUMSYM); + layer_off(_FKEYS); + layer_off(_ADJUST); + layer_on(_PLOVER); + } + break; + case 7: // LAYERRESET + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_qwerty, false, 0); + #endif + layer_off(_NUMSYM); + layer_off(_FKEYS); + layer_off(_PLOVER); + layer_off(_ADJUST); + } + break; + case 8: // BACKLIT + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + break; + case 9: // ADJUST + if(record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_NOTE_ARRAY(tone_adjust, false, 0); + #endif + layer_off(_NUMSYM); + layer_off(_FKEYS); + layer_off(_PLOVER); + layer_on(_ADJUST); + } + } + return MACRO_NONE; +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint16_t macro_kc = keycode; + if (keycode == FKEYS || keycode == ADJUST || keycode == FKEYGRV ){ + macro_kc = DYN_REC_STOP; + } + if (!process_record_dynamic_macro(macro_kc, record)) { + return false; + } + + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_NOTE_ARRAY(tone_startup, false, 0); +} + +void shutdown_user() +{ + PLAY_NOTE_ARRAY(tone_goodbye, false, 0); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_NOTE_ARRAY(music_scale, false, 0); +} +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/readme.md b/keyboards/thevankeyboards/minivan/keymaps/mjt/readme.md new file mode 100644 index 0000000000..c86985f6cb --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/readme.md @@ -0,0 +1,26 @@ +# Mike's Minivan + +- Arrow Layout (45key) +- Dynamic Macros +- Media Keys +- Works with iPhone Camera Adapter + +## Layers + +Qwerty for letters and mods. + +Numsym for all numbers and symbols used in typing. Follows a similar approach to +planck but puts both on the same layer eschewing the F-keys. + +Fkeys layer is for the seldom used stuff like F-keys and some additional features +such as dynamic macros, media keys, and a sleep shortcut for OS X. + +Adjust layer is tough to get to so it is only for keyboard configuration stuff. + +## Dynamic Macros + +Hold TAB key, then press ";" to record macro 1 and "'" to record macro 2. + +When you are done recording, press TAB again. + +For playback of macros, TAB+"," plays macro 1 and TAB+","plays macro 2. diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk new file mode 100644 index 0000000000..41afd9a551 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk @@ -0,0 +1,21 @@ +# 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 = 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 = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c new file mode 100644 index 0000000000..ee117e47bd --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/keymap.c @@ -0,0 +1,230 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +// Keycodes +enum planck_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) +#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt (Ctrl+Alt+Shift) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_QWERTY] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ + +/* Colemak + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent| + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_COLEMAK] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ + +/* Dvorak + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * |Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent| + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_DVORAK] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + CTL_ESC , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ + +/* Lower + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | Brite | | | Home | End | | Left | Down | Right | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_LOWER] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ +ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ +CTL_T(KC_DLR), KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_DOT, KC_PGUP , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ +SFT_T(KC_EQL), KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_UP, SFT_T(KC_PGDN), +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ +ALT_T(BACKLIT), _______ , _______ , KC_HOME , KC_END , _______ , KC_LEFT, KC_DOWN, KC_RGHT ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ + +/* Raise + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | Brite | | | Play | Next | | Mute | Vol- | Vol+ | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_RAISE] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ +ALL_T(KC_TILD),KC_EXLM,KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ +CTL_T(KC_F1), KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + SFT_T(KC_F7), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ +ALT_T(BACKLIT), _______ , _______ , KC_MPLY , KC_MNXT , _______ , KC_MUTE, KC_VOLD, KC_VOLU ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ + +/* Adjust (Lower + Raise) + * ,---------+------+------+------+------+------+------+------+------+------+------+---------. + * | | Reset| | | | | | | | | | Reset | + * |---------`------`------`------`------`------`------`------`------`------`------`---------| + * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |----------`------`------`------`------`------`------`------`------`------`------`--------| + * | | | | | | | | | | | | | + * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| + * | | | | | | | | | | + * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' + */ +[_ADJUST] = LAYOUT_arrow( +/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ + _______, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET , +/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ + _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______ , +/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , +/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______ , _______ , _______ , _______ , _______ , _______ , _______, _______, _______ ), +/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/readme.md b/keyboards/thevankeyboards/minivan/keymaps/smt/readme.md new file mode 100644 index 0000000000..059fd1bbde --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/readme.md @@ -0,0 +1,126 @@ +# smt's TV44 keymap + +This keymap is based on a combination of my Planck keymap and [jeebak's TV44 layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tv44/keymaps/jeebak). I removed the macros and TouchCursor/MouseCursor layers, because I'm just not ready for that level of mind-mapping. + +I had been using something close to the default Minivan layout, but after spending a bit of time with the Planck and Preonic, I decided it would be better for me to try to standardize to some degree, where possible. + +Also, it's worth noting that my Minivan is one with the "arrows" layout, which has a 45th key. In spite of this, the 45-key Minivan is still technically considered a "TV44" as far as I know. + +![smt's TV44 keymap](https://i.imgur.com/Y4n6eHj.png) + +## Notable features (most of which can be found in my or jeebak's respective keymap file): + +1. **Shift/Enter** + + I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory. + + Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome! + +2. **Hyper/Tab** + + This key modifies with "Hyper" (see [Brett Terpstra's post](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) on this) when held, and outputs the code for Tab when tapped. On the Mac, I use KeyboardMaestro to remap my hyper-keys to do a lot of crazy things. + +3. **Ctrl/Escape** + + I set up another mod-tap, this time for the Escape key that would act as a Control modifier when held. + +4. **Alt/Backtick** + + I don't currently have LEDs on most of my keyboards, and I certainly don't want LED controls on the base layer of a 40%. + + So, why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for my use case, and it's consistent with where I place it in my Planck and Preonic keymaps. + + I also like Alt in that position, so it works well as yet another mod-tap key. + + +## Layers + +### Qwerty + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +|Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` + +### Colemak + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +|Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent| +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` + +### Dvorak + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +|Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent| +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` + +### Lower + +This is where I put the number row, two numpad clusters, common arithmetic operators, and cursorkeys: Arrow cluster, Home/End, Page Up/Page Down. `0` and `$` are also placed on the left side for convenient access to beginning-of-line and end-of-line Vim commands. BRITE has been moved here from the base layer. + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn | +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| Brite | | | Home | End | | Left | Down | Right | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` + +### Raise + +As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets helps me keep them straight. I've dropped basic media controls onto this layer as well. + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | | | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | \ | +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| Brite | | | Play | Next | | Mute | Vol- | Vol+ | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` + +### Adjust (Lower + Raise) + +Utility layer. There isn't much here; it's mainly for swapping the default keymap between Qwerty and Dvorak, or putting the keyboard into flash mode via the Reset key. + +``` +,---------+------+------+------+------+------+------+------+------+------+------+---------. +| | Reset| | | | | | | | | | Del | +|---------`------`------`------`------`------`------`------`------`------`------`---------| +| | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | +|----------`------`------`------`------`------`------`------`------`------`------`--------| +| | | | | | | | | | | | | +|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| +| | | | | | | | | | + `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' +``` diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/config.h b/keyboards/thevankeyboards/minivan/keymaps/tong92/config.h new file mode 100644 index 0000000000..be959a823c --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B2 + #define BACKLIGHT_LEVELS 7 +#endif + +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c new file mode 100644 index 0000000000..220cc8c61b --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/keymap.c @@ -0,0 +1,203 @@ +//Author: tong92 +#include QMK_KEYBOARD_H + +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +extern keymap_config_t keymap_config; + +enum tv44_layers { + _WINDOW, + _MAC, + _LOWER, + _RAISE, + _WINDOW_SHORTCUT, + _MAC_SHORTCUT, + _MOUSE +}; + +enum tv44_keycodes { + WINDOW = SAFE_RANGE, + MAC, + MOUSE, + BACKLIT, + EXT_MOUSE +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define LOWER F(_LOWER) +#define RAISE F(_RAISE) +#define XXXXXXX KC_NO +#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) +#define MAC_SHORTCUT MO(_MAC_SHORTCUT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Window - Qwerty + * ,--------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter| + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | Ft | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | + * `--------------------------------------------------------------------------' + */ +[_WINDOW] = LAYOUT_arrow( +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, +KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, +WINDOW_SHORTCUT, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT +), +/* Mac - Qwerty + * ,--------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | Cmd | A | S | D | F | G | H | J | K | L | ; | Enter| + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | Ft | Alt | Ctrl | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | + * `--------------------------------------------------------------------------' + */ +[_MAC] = LAYOUT_arrow( +KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, +KC_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, +KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, +MAC_SHORTCUT, KC_LALT, KC_LCTRL, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT +), +/* LOWER + * ,--------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | | | | | END | LEFT| Down|RIGHT| + * `--------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_arrow( +KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, +_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS, +_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, +XXXXXXX,_______,_______, _______,XXXXXXX, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT +), +/* RAISE + * ,--------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | | | | | END | LEFT| Down|RIGHT| + * `--------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_arrow( +KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, +_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE, +_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, +XXXXXXX,_______,_______, _______,_______, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT +), +/* Window Shortcut + * ,--------------------------------------------------------------------------. + * | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED | + * `--------------------------------------------------------------------------' + */ +[_WINDOW_SHORTCUT] = LAYOUT_arrow( +KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX,S(KC_CAPS) ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, +_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT),XXXXXXX,LALT(KC_CAPS) ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, +_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,LCTL(KC_CAPS) ,KC_SLCK ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, +_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LALT(KC_DELT)),LGUI(LCTL(KC_F4)), MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT +), +/* Mac Shortcut + * ,--------------------------------------------------------------------------. + * | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DELET | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | |WBlkL|WBlkR| |ScrFu| |CapsL| LEFT| DOWN|RIGHT| | | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | |BlckL|BlckR| | | | | HOME| | END | | Ctrl| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | | | | | MOUSE| | | LED | + * `--------------------------------------------------------------------------' + */ +[_MAC_SHORTCUT] = LAYOUT_arrow( +KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, +_______,LALT(LSFT(KC_LEFT)) ,LALT(LSFT(KC_RIGHT)) ,XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, +_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, +_______,_______,_______, _______,_______, MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT +), +/* MOUSE + * ,--------------------------------------------------------------------------. + * | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET | + * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + * | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | + * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + * | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO| + * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + * | | | | GO_DEFAULT | GO_DEFAULT | | | | MAC | + * `--------------------------------------------------------------------------' + */ +[_MOUSE] = LAYOUT_arrow( +XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,RESET, +XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX, +XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW, +XXXXXXX,XXXXXXX,XXXXXXX, EXT_MOUSE,EXT_MOUSE, XXXXXXX,XXXXXXX,XXXXXXX,MAC +) +}; + +const uint16_t PROGMEM fn_actions[] = { + [_LOWER] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), + [_RAISE] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case WINDOW: + if (record->event.pressed) { + set_single_persistent_default_layer(_WINDOW); + } + return false; + break; + case MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_MAC); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + } + return false; + break; + case EXT_MOUSE: + if (record->event.pressed) { + layer_off(_MOUSE); + layer_off(_WINDOW_SHORTCUT); + layer_off(_MAC_SHORTCUT); + } + return false; + break; + } + return true; +}; + diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/readme.md b/keyboards/thevankeyboards/minivan/keymaps/tong92/readme.md new file mode 100644 index 0000000000..8208572568 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/readme.md @@ -0,0 +1,52 @@ +# The tong92's keymap for tv44 + +- Arrow Layout (45key) +- my keymap for Window User +- Mouse Layer : space -> Default Layer + +## Qwerty + ,--------------------------------------------------------------------------. + | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter| + |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| + |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + | Ftn1 | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | + `--------------------------------------------------------------------------' + + +## RAISE + ,--------------------------------------------------------------------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | + |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | + |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| + |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + | | | | | | END | LEFT| Down|RIGHT| + `--------------------------------------------------------------------------' + + +## FTN + ,--------------------------------------------------------------------------. + | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET | + |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | + |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl| + |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED | + `--------------------------------------------------------------------------' + + +## MOUSE + ,--------------------------------------------------------------------------. + | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET | + |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| + | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | + |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| + | | | | | | | |M_AC0|M_AC1|M_AC2| | | + |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| + | | | | GO_DEFAULT | GO_DEFAULT | | | | | + `--------------------------------------------------------------------------' diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk new file mode 100644 index 0000000000..e60e3c5c5a --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/config.h b/keyboards/thevankeyboards/minivan/keymaps/xyverz/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c new file mode 100644 index 0000000000..ec0d270070 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/keymap.c @@ -0,0 +1,124 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + DVORAK = SAFE_RANGE, + QWERTY, + COLEMAK, + LOWER, + RAISE, + ADJUST +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Aliases for some other things I want to try out +#define RAI_ESC LT(_RAISE, KC_ESC) +#define LOW_QUQ LT(_LOWER, KC_QUOT) +#define LOW_MIN LT(_LOWER, KC_MINS) // Same as above, but for Dvorak layer +#define GUIBSPC GUI_T(KC_BSPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_DVORAK] = LAYOUT( /* 0: Dvorak */ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, + RAI_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, LOW_MIN, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LCTL, KC_LALT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT + ), + + [_QWERTY] = LAYOUT( /* 1: Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + RAI_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LOW_QUQ, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT + ), + + [_COLEMAK] = LAYOUT( /* 2: Colemak */ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + RAI_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, LOW_QUQ, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT + ), + + [_LOWER] = LAYOUT( /* 1: FN 1 */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, + KC_LEFT, KC_RGHT, _______, KC_DEL, KC_INS, _______, KC_UP, KC_DOWN + ), + + [_RAISE] = LAYOUT( /* 2: FN 2 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, + KC_LEFT, KC_RGHT, _______, KC_DEL, KC_INS, _______, KC_UP, KC_DOWN + ), + + [_ADJUST] = LAYOUT( + KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, + _______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_HOME, KC_END, _______, _______, _______, _______, KC_PGUP, KC_PGDN + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/readme.md b/keyboards/thevankeyboards/minivan/keymaps/xyverz/readme.md new file mode 100644 index 0000000000..ac84c08cfa --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/readme.md @@ -0,0 +1 @@ +# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/minivan.c b/keyboards/thevankeyboards/minivan/minivan.c new file mode 100644 index 0000000000..b260195cec --- /dev/null +++ b/keyboards/thevankeyboards/minivan/minivan.c @@ -0,0 +1,28 @@ +#include "minivan.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/thevankeyboards/minivan/minivan.h b/keyboards/thevankeyboards/minivan/minivan.h new file mode 100644 index 0000000000..27a3583657 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/minivan.h @@ -0,0 +1,67 @@ +#ifndef MINIVAN_H +#define MINIVAN_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// There are a number of variations depending on the layout of your bottom row. +// The arrow variant adds an additional key on the bottom-right, while the +// command variant adds an additional key on the bottom-left. arrow-command is a +// combination of both of those, having an additional key on both sides. +// +// Please note that the numbering of the macro arguments are based on the +// numbers of the keys on the PCB. + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K37, K38, K39, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, KC_NO, K3B } \ +} + +#define LAYOUT_arrow( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K32, K33, K37, K38, K39, K3A, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ +} + +#define LAYOUT_command( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K34, K32, K33, K37, K38, K39, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37, K38, K39, KC_NO, K3B } \ +} + +#define LAYOUT_arrow_command( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K31, K34, K32, K33, K37, K38, K39, K3A, K3B \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ +} + +#endif diff --git a/keyboards/thevankeyboards/minivan/readme.md b/keyboards/thevankeyboards/minivan/readme.md new file mode 100644 index 0000000000..03a868a162 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/readme.md @@ -0,0 +1,13 @@ +# Minivan (tv44) + +A compact 44% keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: Minivan PCB +Hardware Availability: https://thevankeyboards.com/collections/catalog/products/minivan-diy?variant=609138376718 + +Make example for this keyboard (after setting up your build environment): + + make thevankeyboards/minivan: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/thevankeyboards/minivan/rules.mk b/keyboards/thevankeyboards/minivan/rules.mk new file mode 100644 index 0000000000..786c9dc3e7 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/rules.mk @@ -0,0 +1,69 @@ + + +# MCU name +#MCU = at90usb1287 +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 + + +# Boot Section Size in *bytes* +# 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 = yes # 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 +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/thevankeyboards/readme.md b/keyboards/thevankeyboards/readme.md new file mode 100644 index 0000000000..5dfd74e574 --- /dev/null +++ b/keyboards/thevankeyboards/readme.md @@ -0,0 +1,3 @@ +# TheVan Keyboards + +[TheVan Keyboards](https://thevankeyboards.com/) is based in the United States and is responsible for boards such as the minivan. \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/config.h b/keyboards/thevankeyboards/roadkit/config.h new file mode 100644 index 0000000000..9596f7f3b2 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEAE +#define PRODUCT_ID 0x8846 +#define DEVICE_VER 0x0001 +#define MANUFACTURER TheVan Keyboards +#define PRODUCT Roadkit Micro +#define DESCRIPTION keyboard firmware for Roadkit Micro + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F5, D7, B4 } +#define MATRIX_COL_PINS { F1, F4, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/thevankeyboards/roadkit/info.json b/keyboards/thevankeyboards/roadkit/info.json new file mode 100644 index 0000000000..839ac73fbf --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Roadkit", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 4, + "layouts": { + "LAYOUT_numpad_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0, "h":2}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "h":2}, {"x":0, "y":3, "w":2}, {"x":2, "y":3}] + }, + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}] + } + } +} diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/config.h b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c new file mode 100644 index 0000000000..4ec0f6cfdc --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _NP 0 + +// Macro name shortcuts +#define NUMPAD M(_NP) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NP] = LAYOUT_numpad_4x4( /* Numpad */ + KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_P4, KC_P5, KC_P6, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_P0, KC_PDOT \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _NP: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_NP); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/default/readme.md new file mode 100644 index 0000000000..5984a71d1a --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for roadkit diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/config.h b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c new file mode 100644 index 0000000000..fed9d02706 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/keymap.c @@ -0,0 +1,219 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +void backlight_toggle(void){ +}; + +enum roadkit_layers { + _NUMPAD, + _FPH, + _FPHNOISY, + _ADJUST, + _DYN +}; + +enum roadkit_keycodes { + NUMPAD = SAFE_RANGE, + FPH_1, + FPH_2, + FPH_3, + FPH_4, + FPH_5, + FPH_6, + FPH_7, + FPH_8, + FPH_9, + FN_0, + BACKLIT, + MACSLEEP, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +// Fillers to make keymaps cleaner looking +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ + KC_KP_4, KC_KP_5, KC_KP_6, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \ + LT(_ADJUST, KC_KP_0), KC_KP_DOT \ + ), + [_FPH] = LAYOUT_numpad_4x4( /* Quiet T9 */ + FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \ + FPH_4, FPH_5, FPH_6, \ + FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \ + LT(_ADJUST, KC_SPACE), KC_KP_DOT \ + ), + [_FPHNOISY] = LAYOUT_numpad_4x4( /* Noisy T9 */ + FPH_7, FPH_8, FPH_9, KC_KP_PLUS, \ + FPH_4, FPH_5, FPH_6, \ + FPH_1, FPH_2, FPH_3, SFT_T(KC_KP_ENTER), \ + LT(_ADJUST, KC_SPACE), KC_KP_DOT \ + ), + [_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */ + KC_NUMLOCK, TG(_FPHNOISY), TG(_FPH), TG(_NUMPAD), \ + KC_BSPC, BACKLIT, KC_DEL, \ + MACSLEEP, _______, _______, _______, \ + _______, MO(_DYN) \ + ), + [_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */ + DYN_REC_START1, DYN_REC_START2, _______, DYN_REC_STOP, \ + _______, _______, _______, \ + DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \ + _______, _______ \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +uint16_t fph_tap_qty = false; +uint16_t fph_keycode = 0; // stores which spacebar was used, either raise or lower... + +uint16_t get_render_keycode(uint16_t keycode, uint16_t tap_qty){ // maybe replace shift with "mods" + tap_qty--; // reduce by one to match array indexes. + switch(keycode){ + case FPH_2: + {uint16_t kc[] = {KC_A, KC_B, KC_C}; + if(tap_qty % 6 > 2) + return LSFT(kc[tap_qty % 3]); + return kc[tap_qty % 3];} + break; + case FPH_3: + {uint16_t kc[] = {KC_D, KC_E, KC_F}; + if(tap_qty % 6 > 2) + return LSFT(kc[tap_qty % 3]); + return kc[tap_qty % 3];} + break; + case FPH_4: + {uint16_t kc[] = {KC_G, KC_H, KC_I}; + if(tap_qty % 6 > 2) + return LSFT(kc[tap_qty % 3]); + return kc[tap_qty % 3];} + break; + case FPH_5: + {uint16_t kc[] = {KC_J, KC_K, KC_L}; + if(tap_qty % 6 > 2) + return LSFT(kc[tap_qty % 3]); + return kc[tap_qty % 3];} + break; + case FPH_6: + {uint16_t kc[] = {KC_M, KC_N, KC_O}; + if(tap_qty % 6 > 2) + return LSFT(kc[tap_qty % 3]); + return kc[tap_qty % 3];} + break; + case FPH_7: + {uint16_t kc[] = {KC_P, KC_Q, KC_R, KC_S}; + if(tap_qty % 8 > 2) + return LSFT(kc[tap_qty % 4]); + return kc[tap_qty % 4];} + break; + case FPH_8: + {uint16_t kc[] = {KC_T, KC_U, KC_V}; + if(tap_qty % 8 > 2) + return LSFT(kc[tap_qty % 4]); + return kc[tap_qty % 4];} + break; + case FPH_9: + {uint16_t kc[] = {KC_W, KC_X, KC_Y, KC_Z}; + if(tap_qty % 8 > 2) + return LSFT(kc[tap_qty % 4]); + return kc[tap_qty % 4];} + break; + case FPH_1: + {uint16_t kc[] = {KC_COMM, LSFT(KC_SLSH), KC_EXLM, KC_AT, KC_MINS, KC_UNDS, KC_PLUS, \ + KC_SCLN, LSFT(KC_SCLN), KC_QUOT, LSFT(KC_QUOT), KC_TILD, \ + KC_PIPE, KC_BSLS, KC_HASH, LSFT(KC_4), KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, \ + KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR, LSFT(KC_COMM), LSFT(KC_DOT)}; + return kc[tap_qty % 26];} + } + return KC_NO; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + uint8_t layer; + layer = biton32(layer_state); + + switch (keycode) { + case FPH_1 ... FPH_9: + if(layer == _FPHNOISY){ + if (record->event.pressed) { + if(fph_keycode != keycode) { // key change + fph_tap_qty = 0; + fph_keycode = keycode; + } else { // same key tapped again so erase and increment. + register_code(KC_BSPC); + unregister_code(KC_BSPC); + fph_tap_qty++; + } + uint16_t render_keycode = get_render_keycode(keycode, fph_tap_qty); + // find mods? Apply mods.. + register_code(render_keycode); + unregister_code(render_keycode); + } else { + // do we need to do anything on key-release? + } + } else { // not noisy, be demure . + if (record->event.pressed) { + if(fph_keycode != keycode) { // key change, kill everything. + uint16_t render_keycode = get_render_keycode(fph_keycode, fph_tap_qty); + // find mods? Apply mods.. + register_code(render_keycode); + unregister_code(render_keycode); + fph_keycode = keycode; + fph_tap_qty = 0; + } else { // same key tapped again so increment counter silently + fph_tap_qty++; + } + } else { + // do we need to do anything on key-release? + // maybe start a timer on this one? + } + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/readme.md new file mode 100644 index 0000000000..ad630be195 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/readme.md @@ -0,0 +1,26 @@ +# Flip Phone layout for Roadkit + +BEWARE, THIS DOES NOT WORK YET. + +Uses the numpad with classic cellular phone style letters assigned to the numbers. + +# LAYERS + +* Numpad - The layer that matches the caps mostly +* FPH - Base layer for text +* FPHNOISY - Text layer that outputs every character and then backspaces as they're replaced +* DYN - dynamic macro layer for recording and playing macros + +## FPH + +Poke the "2" key twice and it makes "B". + +## FPHNOISY + +Poke the "2" key twice and it makes "A"+backspace+"B" so you can see it cycle through. + +## MACROS + +May be able to record macros with the T9 layer because the "KC_*"s are only sent +at the end. Trying to do a macro with T9NOISY would probably fill up the buffer +in just a few characters. diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/config.h b/keyboards/thevankeyboards/roadkit/keymaps/khord/config.h new file mode 100644 index 0000000000..da6ed7189c --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/config.h @@ -0,0 +1,15 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#define TAPPING_TERM 175 + +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B5 + #define BACKLIGHT_LEVELS 3 + #define BACKLIGHT_ON_STATE 0 +#endif + +#endif diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c new file mode 100644 index 0000000000..9111f4f898 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/keymap.c @@ -0,0 +1,112 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _NP 0 +#define _L1 1 +#define _L2 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +enum custom_keycodes { + NUMPAD = SAFE_RANGE, + ADMIN, + SMSPC1, + STR192, + STR255 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Numpad + * ,-----------------------. + * | 7 | 8 | 9 |Bksp | + * |-----`-----`-----`-----| + * | 4 | 5 | 6 | Tab | + * |-----`-----`-----`-----| + * | 1 | 2 | 3 |Enter| + * |-----`-----`-----`-----| + * | 0 |Space| . | / | + * `-----`-----`-----`-----' + * | L1 | L2 | | | Layer hold + */ + [_NP] = LAYOUT_ortho_4x4( /* Numpad */ + KC_P7, KC_P8, KC_P9, KC_BSPC, \ + KC_P4, KC_P5, KC_P6, KC_TAB, \ + KC_P1, KC_P2, KC_P3, KC_PENT, \ + LT(1, KC_P0), LT(2, KC_SPC), KC_PDOT, KC_PSLS + ), + + /* L1 + * ,-----------------------. + * |Reset| | | Del | + * |-----`-----`-----`-----| + * | Left| Down| Up |Right| + * |-----`-----`-----`-----| + * | 192.| 255 | | | + * |-----`-----`-----`-----| + * |_____| LED | . | | + * `-----`-----`-----`-----' + */ + [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ + RESET, XXXXXXX, XXXXXXX, KC_DEL, \ + KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, \ + STR192, STR255, XXXXXXX, XXXXXXX, \ + _______, BL_STEP, _______, XXXXXXX + ), + + /* L2 + * ,-----------------------. + * | | | str | str | + * |-----`-----`-----`-----| + * | | | | | + * |-----`-----`-----`-----| + * | | | | | + * |-----`-----`-----`-----| + * | |_____| | | + * `-----`-----`-----`-----' + */ + [_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */ + XXXXXXX, XXXXXXX, ADMIN, SMSPC1, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, _______, XXXXXXX, XXXXXXX + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case ADMIN: + if (record->event.pressed) { + SEND_STRING("Administrator"); + } + return false; + break; + case SMSPC1: + if (record->event.pressed) { + SEND_STRING("Simspace1!"); + } + return false; + break; + case STR192: + if (record->event.pressed) { + SEND_STRING("192.168."); + } + return false; + break; + case STR255: + if (record->event.pressed) { + SEND_STRING("255"); + } + return false; + break; + } + return true; +}; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk new file mode 100644 index 0000000000..9f3c958bd8 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk @@ -0,0 +1,22 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 +TAP_DANCE_ENABLE = no # Enable Tap Dance functionality + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/config.h b/keyboards/thevankeyboards/roadkit/keymaps/mjt/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c new file mode 100644 index 0000000000..a1af5b1f28 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/keymap.c @@ -0,0 +1,239 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef BACKLIGHT_ENABLE + #include "backlight.h" +#endif + +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +void backlight_toggle(void){ +}; + +enum roadkit_layers { + _NUMPAD, + _NAVIGATION, + _EXCEL, + _ADJUST, + _DYN +}; + +enum minivan_keycodes { + NUMPAD = SAFE_RANGE, + NAVIGATION, + EXCEL, + NUMPAD_LOCK, + NAVIGATION_LOCK, + EXCEL_LOCK, + PARENS, + BRACKETS, + BRACES, + BACKLIT, + MACSLEEP, + DYNAMIC_MACRO_RANGE, +}; + +#include "dynamic_macro.h" + +// Fillers to make keymaps cleaner looking +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NUMPAD] = LAYOUT_numpad_4x4( /* Numpad */ + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ + KC_KP_4, KC_KP_5, KC_KP_6, \ + KC_KP_1, KC_KP_2, KC_KP_3, NAVIGATION, \ + EXCEL, KC_KP_DOT + ), + [_EXCEL] = LAYOUT_numpad_4x4( /* Excel related */ + KC_KP_SLASH, KC_KP_ASTERISK, KC_MINS, KC_TAB, \ + KC_QUOT, KC_KP_EQUAL, PARENS, \ + KC_DQT, BRACKETS, BRACES, _______, \ + _______, MO(_DYN) + ), + [_NAVIGATION] = LAYOUT_numpad_4x4( /* Navigation */ + KC_HOME, _______, KC_PGUP, KC_TAB, \ + KC_END, KC_UP, KC_PGDN, \ + KC_LEFT, KC_DOWN, KC_RIGHT, _______, \ + _______, MO(_DYN) + ), + [_ADJUST] = LAYOUT_numpad_4x4( /* Adjustments */ + KC_NUMLOCK, MACSLEEP, BACKLIT, _______, \ + KC_BSPC, _______, KC_DEL, \ + EXCEL_LOCK, NUMPAD_LOCK, NAVIGATION_LOCK, _______, \ + _______, _______ + ), + [_DYN] = LAYOUT_numpad_4x4( /* DYNAMIC MACRO */ + DYN_REC_START1, DYN_REC_START2, _______, _______, \ + _______, _______, _______, \ + DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, _______, _______, \ + _______, _______ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_numpad[][2] = SONG(QWERTY_SOUND); +float tone_excel[][2] = SONG(DVORAK_SOUND); +float tone_navigation[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool fn_tap_used = false; // sets to false when space is pressed, + // sets to true when any other key is pressed, + //when space is lifted, if another key was prssed, don't send space. +uint16_t fn_keycode = 0; // stores which spacebar was used, either raise or lower... + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case NAVIGATION: // This key is enter if tapped, navigation if held + if (record->event.pressed) { + fn_keycode = NAVIGATION; // these two lines figure out if the next action is + fn_tap_used = false; + layer_on(_NAVIGATION); + update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); + } else { + layer_off(_NAVIGATION); + update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); + if(!fn_tap_used && fn_keycode == NAVIGATION ){ + register_code(KC_KP_ENTER); + unregister_code(KC_KP_ENTER); + fn_keycode = 0; + fn_tap_used = false; + } + } + return false; + break; + case EXCEL: + if (record->event.pressed) { + fn_keycode = EXCEL; + fn_tap_used = false; + layer_on(_EXCEL); + update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); + } else { + layer_off(_EXCEL); + update_tri_layer(_EXCEL, _NAVIGATION, _ADJUST); + if(!fn_tap_used && fn_keycode == EXCEL ){ + register_code(KC_KP_0); + unregister_code(KC_KP_0); + fn_keycode = 0; + fn_tap_used = false; + } + } + return false; + break; + default: + fn_tap_used = true; + break; // don't return because this just handles the spacebars. + } + // this is the normal keycode processing switch from Planck default layout. + switch (keycode) { + case NUMPAD_LOCK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_numpad, false, 0); + #endif + persistant_default_layer_set(1UL<<_NUMPAD); + } + return false; + break; + case NAVIGATION_LOCK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_navigation, false, 0); + #endif + persistant_default_layer_set(1UL<<_NAVIGATION); + } + return false; + break; + case EXCEL_LOCK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_excel, false, 0); + #endif + persistant_default_layer_set(1UL<<_EXCEL); + } + return false; + break; + case PARENS: + if (record->event.pressed) { + register_code(KC_RSFT); + register_code(KC_9); + unregister_code(KC_9); + register_code(KC_0); + unregister_code(KC_0); + register_code(KC_RSFT); + register_code(KC_LEFT); + unregister_code(KC_LEFT); + } + return false; + break; + case BRACKETS: + if (record->event.pressed) { + register_code(KC_LBRC); + unregister_code(KC_LBRC); + register_code(KC_RBRC); + unregister_code(KC_RBRC); + register_code(KC_LEFT); + unregister_code(KC_LEFT); + } + return false; + break; + case BRACES: + if (record->event.pressed) { + register_code(KC_RSFT); + register_code(KC_LBRC); + unregister_code(KC_LBRC); + register_code(KC_RBRC); + unregister_code(KC_RBRC); + unregister_code(KC_RSFT); + register_code(KC_LEFT); + unregister_code(KC_LEFT); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/mjt/readme.md new file mode 100644 index 0000000000..80c0e5240e --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/readme.md @@ -0,0 +1,22 @@ +# Mike's custom keymap for roadkit + +Based on the 13 key layout. + +## LAYERS + +* Numpad - The layer that matches the caps +* Excel - / * - = and () [] {} macros +* Navigation - arrow keys and home/end +* ADJUST - just like planck adjust, lets you set default layer. +* DYN - dynamic macro layer for recording and playing macros + +## MACROS + +Sadly, the dynamic macros are probably going worthless because they keys that +they record have to be pressed on this keyboard. This keyboard doesn't have +most letters... + +## LEADER KEYS + +This board would probably be better with the user of leader keys instead of +complex layers with a raise/lower setup... Something to look into for later. diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/config.h b/keyboards/thevankeyboards/roadkit/keymaps/singles/config.h new file mode 100644 index 0000000000..df06a26206 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c new file mode 100644 index 0000000000..4c246f5136 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _NP 0 +#define _L1 1 + +// Macro name shortcuts +#define NUMPAD M(_NP) +#define LAYER1 M(_L1) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NP] = LAYOUT_ortho_4x4( /* Numpad */ + KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, \ + KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_MINUS, \ + KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, \ + KC_KP_0, KC_KP_DOT, TG(_L1), KC_BSPC + ), + [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ + KC_NUMLOCK, _______, _______, KC_VOLU, \ + _______, KC_UP, _______, KC_VOLD, \ + KC_LEFT, KC_DOWN, KC_RIGHT, _______, \ + _______, _______, _______, _______ + ) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch(id) { + case _L1: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_L1); + } + break; + case _NP: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_NP); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/singles/readme.md new file mode 100644 index 0000000000..48ea4a8b35 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/readme.md @@ -0,0 +1,3 @@ +# The singles keymap for roadkit + +This keymap has a base layer with numpad functionality, and then a second layer with some additional keys. The user is encouraged to develop their own keymap using this as a starting point. diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk new file mode 100644 index 0000000000..f4671a9d11 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/config.h b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/config.h new file mode 100644 index 0000000000..57468e122a --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/config.h @@ -0,0 +1,15 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here +#define TAPPING_TERM 175 + +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B5 + #define BACKLIGHT_LEVELS 3 + #define BACKLIGHT_ON_STATE 0 +#endif + +#endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c new file mode 100644 index 0000000000..b4da80e284 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/keymap.c @@ -0,0 +1,242 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _NP 0 +#define _L1 1 +#define _L2 2 +#define _L3 3 + +// Macro name shortcuts +#define NUMPAD M(_NP) +#define LAYER1 M(_L1) +#define LAYER2 M(_L2) +#define LAYER3 M(_L3) + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +void matrix_init_user(void) { + backlight_level(4); +} + + + +//Tap Dance Declarations + +enum { + + TD_EQUAL_NP = 0, + TD_KP_PLUS_L1, + TD_DOT_L2, + TD_0_L3 + +}; + +//Tap Dance Definitions + + + //TD equal to turn on layer NP +void _td_equal_tg_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code(KC_EQUAL); + } else if (state->count == 2) { + backlight_set(3); + layer_on(_NP); + layer_off(_L1); + layer_off(_L2); + layer_off(_L3); + } +} + +void _td_equal_tg_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_EQUAL); + } +} + + + //TD kp plus to toggle layer 1 +void _td_kp_plus_tg_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code(KC_KP_PLUS); + } else if (state->count == 2) { +// layer_invert(_L1); + backlight_set(2); + layer_on(_L1); + layer_off(_L2); + layer_off(_L3); + } +} + +void _td_kp_plus_tg_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_KP_PLUS); + } +} + + + //TD dot to toggle layer 2 +void _td_dot_tg_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code(KC_DOT); + } else if (state->count == 2) { + backlight_set(1); + layer_on(_L2); + layer_off(_L1); + layer_off(_L3); + } +} + +void _td_dot_tg_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_DOT); + } +} + + //TD 0 to toggle layer 3 +void _td_0_tg_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code(KC_0); + } else if (state->count == 2) { + backlight_set(0); + layer_on(_L3); + layer_off(_L1); + layer_off(_L2); + } +} + +void _td_0_tg_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code(KC_0); + } +} + +//TD Actions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_EQUAL_NP] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_equal_tg_finished, _td_equal_tg_reset), + [TD_KP_PLUS_L1] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_kp_plus_tg_finished, _td_kp_plus_tg_reset), + [TD_DOT_L2] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_dot_tg_finished, _td_dot_tg_reset), + [TD_0_L3] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, _td_0_tg_finished, _td_0_tg_reset) +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Numberpad + * ,-----------------------. + * | 7 | 8 | 9 | / | + * |-----`-----`-----`-----| + * | 4 | 5 | 6 | * | + * |-----`-----`-----`-----| + * | 1 | 2 | 3 | - | + * |-----`-----`-----`-----| + * | 0 | . | + | = | + * `-----`-----`-----`-----' + * Tapdances: + * | L3 | L2 | L1 | NP | + * `-----`-----`-----`-----' + */ + [_NP] = LAYOUT_ortho_4x4( /* Numpad */ + KC_7, KC_8, KC_9, KC_SLASH, \ + KC_4, KC_5, KC_6, KC_KP_ASTERISK, \ + KC_1, KC_2, KC_3, KC_MINUS, \ + TD(TD_0_L3), TD(TD_DOT_L2), TD(TD_KP_PLUS_L1), TD(TD_EQUAL_NP) + ), + + /* L1 + * ,-----------------------. + * | Esc |Bksp |Home |PgUp | + * |-----`-----`-----`-----| + * | Tab | Up | End |PgDn | + * |-----`-----`-----`-----| + * |Left |Down |Right|Enter| + * |-----`-----`-----`-----| + * | 0 | . | + | = | + * `-----`-----`-----`-----' + */ + [_L1] = LAYOUT_ortho_4x4( /* LAYER 1 */ + KC_ESCAPE, KC_BSPACE, KC_HOME, KC_PGUP, \ + KC_TAB, KC_UP, KC_END, KC_PGDOWN, \ + KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER, \ + _______, _______, _______, _______ + ), + + /* L2 + * ,-----------------------. + * |Sleep|LClik|RClik|VolUp| + * |-----`-----`-----`-----| + * |AltF4| F11 |WinTb|VolDn| + * |-----`-----`-----`-----| + * |PrvTk|Play |NxtTk|Mute | + * |-----`-----`-----`-----| + * | 0 | . | + | = | + * `-----`-----`-----`-----' + */ + [_L2] = LAYOUT_ortho_4x4( /* LAYER 2 */ + KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \ + LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \ + KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \ + _______, _______, _______, _______ + ), + + /* L3 needs cut, copy, paste, undo, again (redo), find, calc, www back, www forward, F5 + * ,-----------------------. + * |WBack|WHome|WFor | F5 | + * |-----`-----`-----`-----| + * |Calc |Undo |Redo |WSrch| + * |-----`-----`-----`-----| + * | Cut |Copy |Paste|Find | + * |-----`-----`-----`-----| + * | 0 | . | + | = | + * `-----`-----`-----`-----' + */ + [_L3] = LAYOUT_ortho_4x4( /* LAYER 3 */ + KC_SYSTEM_SLEEP, KC_MS_BTN1, KC_MS_BTN2, KC_AUDIO_VOL_UP, \ + LALT(KC_F4), KC_F11, LGUI(KC_TAB), KC_AUDIO_VOL_DOWN, \ + KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, \ + _______, _______, _______, _______ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +const macro_t * action_get_macro(keyrecord_t * record, uint8_t id, uint8_t opt) { + switch (id) { + case _L3: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_L3); + } + break; + case _L2: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_L2); + } + break; + case _L1: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_L1); + } + break; + case _NP: + if (record->event.pressed) { + persistent_default_layer_set(1UL<<_NP); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/readme.md new file mode 100644 index 0000000000..48ea4a8b35 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/readme.md @@ -0,0 +1,3 @@ +# The singles keymap for roadkit + +This keymap has a base layer with numpad functionality, and then a second layer with some additional keys. The user is encouraged to develop their own keymap using this as a starting point. diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk new file mode 100644 index 0000000000..b61d6cca2c --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk @@ -0,0 +1,22 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 +TAP_DANCE_ENABLE = yes # Enable Tap Dance functionality + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/thevankeyboards/roadkit/readme.md b/keyboards/thevankeyboards/roadkit/readme.md new file mode 100644 index 0000000000..e4af2dcc00 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/readme.md @@ -0,0 +1,13 @@ +# Roadkit + +A programmable macro pad. + +Keyboard Maintainer: QMK Community +Hardware Supported: Roadkit PCB +Hardware Availability: https://thevankeyboards.com/collections/catalog/products/road-kit-diy?variant=603645345806 + +Make example for this keyboard (after setting up your build environment): + + make thevankeyboards/roadkit: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/thevankeyboards/roadkit/roadkit.c b/keyboards/thevankeyboards/roadkit/roadkit.c new file mode 100644 index 0000000000..26e0c51ec5 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/roadkit.c @@ -0,0 +1,28 @@ +#include "roadkit.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/thevankeyboards/roadkit/roadkit.h b/keyboards/thevankeyboards/roadkit/roadkit.h new file mode 100644 index 0000000000..62cfabc5eb --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/roadkit.h @@ -0,0 +1,33 @@ +#ifndef ROADKIT_H +#define ROADKIT_H + +#include "quantum.h" + +// This is a shortcut to help you visually see your layout. +#define LAYOUT_numpad_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K23, \ + K30, K32 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, KC_NO }, \ + { K20, K21, K22, K23 }, \ + { K30, KC_NO, K32, KC_NO } \ +} + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} + +#endif diff --git a/keyboards/thevankeyboards/roadkit/rules.mk b/keyboards/thevankeyboards/roadkit/rules.mk new file mode 100644 index 0000000000..d15a5541bb --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/rules.mk @@ -0,0 +1,71 @@ + + +# MCU name +#MCU = at90usb1287 +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 + + +# Boot Section Size in *bytes* +# 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 = yes # 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 +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +LAYOUTS = numpad_4x4 ortho_4x4 diff --git a/keyboards/tv44/config.h b/keyboards/tv44/config.h deleted file mode 100644 index 0ae93c0957..0000000000 --- a/keyboards/tv44/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEAE -#define PRODUCT_ID 0x8844 -#define DEVICE_VER 0x0002 -#define MANUFACTURER Evan Sailer -#define PRODUCT TheVan 44 -#define DESCRIPTION keyboard firmware for TV44 - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D7, B5, F7, D4 } -#define MATRIX_COL_PINS { D2, D3, D5, D6, B4, B6, F6, F5, F4, F1, F0, B3 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/tv44/info.json b/keyboards/tv44/info.json deleted file mode 100644 index 355701feec..0000000000 --- a/keyboards/tv44/info.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "keyboard_name": "tv44", - "url": "", - "maintainer": "qmk", - "width": 12.75, - "height": 4, - "layouts": { - "LAYOUT": { - "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"Win", "x":1.25, "y":3, "w":1.5}, {"label":"Alt", "x":2.75, "y":3, "w":1.25}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"label":"Alt", "x":8.25, "y":3, "w":1.25}, {"label":"Win", "x":9.5, "y":3, "w":1.5}, {"label":"Menu", "x":11, "y":3, "w":1.75}] - }, - - "LAYOUT_arrow": { - "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3, "w":1.25}, {"label":"Win", "x":1.25, "y":3, "w":1.5}, {"label":"Alt", "x":2.75, "y":3, "w":1.25}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3}, {"label":"Win", "x":10.75, "y":3}, {"label":"Menu", "x":11.75, "y":3}] - }, - - "LAYOUT_command": { - "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Win", "x":1, "y":3}, {"label":"Alt", "x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3, "w":1.5}, {"label":"Win", "x":11.25, "y":3, "w":1.5}] - }, - - "LAYOUT_arrow_command": { - "layout": [{"label":"Tab", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"|", "x":11, "y":0, "w":1.75}, {"label":"Caps Lock", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.5}, {"label":"Shift", "x":0, "y":2, "w":1.75}, {"label":"Z", "x":1.75, "y":2}, {"label":"X", "x":2.75, "y":2}, {"label":"C", "x":3.75, "y":2}, {"label":"V", "x":4.75, "y":2}, {"label":"B", "x":5.75, "y":2}, {"label":"N", "x":6.75, "y":2}, {"label":"M", "x":7.75, "y":2}, {"label":"<", "x":8.75, "y":2}, {"label":">", "x":9.75, "y":2}, {"label":"?", "x":10.75, "y":2}, {"x":11.75, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Win", "x":1, "y":3}, {"label":"Alt", "x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3, "w":2.25}, {"x":6.25, "y":3, "w":2}, {"x":8.25, "y":3, "w":1.5}, {"label":"Alt", "x":9.75, "y":3}, {"label":"Win", "x":10.75, "y":3}, {"label":"Menu", "x":11.75, "y":3}] - } - } -} diff --git a/keyboards/tv44/keymaps/belak/config.h b/keyboards/tv44/keymaps/belak/config.h deleted file mode 100644 index 47d96a29d8..0000000000 --- a/keyboards/tv44/keymaps/belak/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define TAPPING_TERM 500 - -#endif diff --git a/keyboards/tv44/keymaps/belak/keymap.c b/keyboards/tv44/keymaps/belak/keymap.c deleted file mode 100644 index 6c0ff1a1cf..0000000000 --- a/keyboards/tv44/keymaps/belak/keymap.c +++ /dev/null @@ -1,105 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "debug.h" -#include "eeconfig.h" - -// Layer names. We stick to 3 letters if possible so MO(NAME) fits in 7 -// characters and doesn't mess with the grid. -#define _QW 0 -#define _L1 1 -#define _L2 2 -#define _L3 3 - -// Curly braces have their own keys. These are defined so they don't mess up the -// grid in layer 2. -#define L_CURBR LSFT(KC_LBRC) -#define R_CURBR LSFT(KC_RBRC) - -#define L1_TAB LT(_L1, KC_TAB) -#define L2_ESC LT(_L2, KC_ESC) -#define L2_SLSH LT(_L2, KC_SLSH) -#define L3_QUOT LT(_L3, KC_QUOT) - -// Tap dance magic -#define TD_LGUI TD(BE_TD_GUI) -#define TD_LCTL TD(BE_TD_CTL) -#define TD_LALT TD(BE_TD_ALT) - -enum belak_td { - BE_TD_GUI = 0, - BE_TD_CTL, - BE_TD_ALT, -}; - -void mod_tap_fn(qk_tap_dance_state_t *state, void *user_data); -void mod_reset_fn(qk_tap_dance_state_t *state, void *user_data); - -qk_tap_dance_action_t tap_dance_actions[] = { - [BE_TD_GUI] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), - [BE_TD_CTL] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), - [BE_TD_ALT] = ACTION_TAP_DANCE_FN_ADVANCED(mod_tap_fn, NULL, mod_reset_fn), -}; - -uint16_t tap_dance_keys[] = { - [BE_TD_GUI] = KC_LGUI, - [BE_TD_CTL] = KC_LCTL, - [BE_TD_ALT] = KC_LALT, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT_arrow_command( /* Qwerty */ - L2_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - L1_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, L2_SLSH, - TD_LCTL, MO(_L3), TD_LALT, TD_LGUI, KC_SPC, KC_SPC, MO(_L1), KC_LEFT, KC_DOWN, KC_RGHT - ), - [_L1] = LAYOUT_arrow_command( /* LAYER 1 */ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, - _______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_QUOT, - _______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT, - _______, KC_LGUI, _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_L2] = LAYOUT_arrow_command( /* LAYER 2 */ - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, L_CURBR, R_CURBR, KC_4, KC_5, KC_6, KC_VOLU, _______, - _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______, - _______, _______, _______, _______, _______, _______, KC_RALT, _______, _______, _______ - ), - [_L3] = LAYOUT_arrow_command( /* LAYER 3 */ - _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, - KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, - _______, _______, _______, _______, _______, _______, _______, KC_F9, KC_F10, KC_F11, KC_F12, KC_RSFT, - _______, _______, _______, _______, _______, _______, KC_RALT, _______, _______, _______ - ) -}; - -const uint16_t PROGMEM fn_actions[] = {}; - -// Tap dance functions -void mod_tap_fn(qk_tap_dance_state_t *state, void *user_data) { - switch (state->count) { - case 1: - register_mods(MOD_BIT(tap_dance_keys[state->keycode - QK_TAP_DANCE])); - send_keyboard_report(); - break; - case 2: - layer_on(_L2); - break; - case 3: - layer_off(_L2); - layer_on(_L1); - break; - default: - reset_tap_dance(state); - } -} - -void mod_reset_fn(qk_tap_dance_state_t *state, void *user_data) { - layer_off(_L1); - layer_off(_L2); - unregister_mods(MOD_BIT(tap_dance_keys[state->keycode - QK_TAP_DANCE])); - send_keyboard_report(); -} diff --git a/keyboards/tv44/keymaps/belak/readme.md b/keyboards/tv44/keymaps/belak/readme.md deleted file mode 100644 index b0a505c4ae..0000000000 --- a/keyboards/tv44/keymaps/belak/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -# Belak's TV44 (TV46?) layout - -This layout is roughly based on the low-rider arrow-southpaw layout from [the -configurator](http://minivan.config.thevankeyboards.com) with a number of -changes to make it easier to use and add in missing keys (like adding / and ' -to the main layer) - -## Rev1 - -* Moved enter to a more standard location to have a full spacebar -* Quote is now on L1 -* Small tweaks to make modifiers work a little more consistently -* Greatly increase the tapping term to make the tap-dance mods easier to use - diff --git a/keyboards/tv44/keymaps/belak/rules.mk b/keyboards/tv44/keymaps/belak/rules.mk deleted file mode 100644 index 6112411240..0000000000 --- a/keyboards/tv44/keymaps/belak/rules.mk +++ /dev/null @@ -1,12 +0,0 @@ -#BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -#EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -#CONSOLE_ENABLE = yes # Console for debug(+400) -#DEBUG_ENABLE = yes -#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 -TAP_DANCE_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tv44/keymaps/budi/config.h b/keyboards/tv44/keymaps/budi/config.h deleted file mode 100644 index 67bcf3546e..0000000000 --- a/keyboards/tv44/keymaps/budi/config.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#ifdef DEBOUNCING_DELAY -#undef DEBOUNCING_DELAY -#endif -#define DEBOUNCING_DELAY 2 -#define MOUSEKEY_INTERVAL 10 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 120 -#define MOUSEKEY_MAX_SPEED 9 -#define MOUSEKEY_WHEEL_DELAY 0 -#define MOUSEKEY_WHEEL_MAX_SPEED 2 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 120 -#define TAPPING_TOGGLE 1 -#define TAPPING_TERM 200 -#define IGNORE_MOD_TAP_INTERRUPT -#define FORCE_NKRO -#endif diff --git a/keyboards/tv44/keymaps/budi/keymap.c b/keyboards/tv44/keymaps/budi/keymap.c deleted file mode 100644 index baa266e635..0000000000 --- a/keyboards/tv44/keymaps/budi/keymap.c +++ /dev/null @@ -1,229 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _DV 0 -#define _NM 1 -#define _NV 2 -#define _MN 3 -#define _FN 4 - -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define NM_SP LT(_NM, KC_SPC) -#define NV_SP LT(_NV, KC_SPC) -#define MN_EN LT(_MN, KC_ENT) -#define FN_EX LT(_FN, KC_ESC) - -// Curly braces have their own keys. These are defined to make them not mess up -// the grid in layer 2. -#define L_CURB LSFT(KC_LBRC) -#define R_CURB LSFT(KC_RBRC) - -// Hypers -#define HYP0 HYPR(KC_0) -#define HYP1 HYPR(KC_1) -#define HYP2 HYPR(KC_2) -#define HYP3 HYPR(KC_3) -#define HYP4 HYPR(KC_4) -#define HYP5 HYPR(KC_5) -#define HYP6 HYPR(KC_6) -#define HYP7 HYPR(KC_7) -#define HYP8 HYPR(KC_8) -#define HYP9 HYPR(KC_9) - -// MEH -#define MEH0 MEH(KC_0) -#define MEH1 MEH(KC_1) -#define MEH2 MEH(KC_2) -#define MEH3 MEH(KC_3) -#define MEH4 MEH(KC_4) -#define MEH5 MEH(KC_5) -#define MEH6 MEH(KC_6) -#define MEH7 MEH(KC_7) -#define MEH8 MEH(KC_8) -#define MEH9 MEH(KC_9) - -// CAG -#define CAG0 LCAG(KC_0) -#define CAG1 LCAG(KC_1) -#define CAG2 LCAG(KC_2) -#define CAG3 LCAG(KC_3) -#define CAG4 LCAG(KC_4) -#define CAG5 LCAG(KC_5) -#define CAG6 LCAG(KC_6) -#define CAG7 LCAG(KC_7) -#define CAG8 LCAG(KC_8) -#define CAG9 LCAG(KC_9) - -// ALTS -#define ALT0 LALT(KC_0) -#define ALT1 LALT(KC_1) -#define ALT2 LALT(KC_2) -#define ALT3 LALT(KC_3) -#define ALT4 LALT(KC_4) -#define ALT5 LALT(KC_5) -#define ALT6 LALT(KC_6) -#define ALT7 LALT(KC_7) -#define ALT8 LALT(KC_8) -#define ALT9 LALT(KC_9) -#define ALTX LALT(KC_GRV) -#define ALTL LALT(KC_LEFT) -#define ALTR LALT(KC_RIGHT) -#define ALTESC LALT(KC_ESC) -#define ALTEQL LALT(KC_EQL) -#define ALTMIN LALT(KC_MINS) - -// BACK AND FORWARD -#define XBACK LGUI(LALT(KC_LEFT)) -#define XFFWD LGUI(LALT(KC_RIGHT)) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define xxxxxxx KC_NO - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - SWTCH -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - -/* DVORAK - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | TAB | ' | , | . | P | Y | F | G | C | R | L | BACKSPACE | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | A | O | E | U | I | D | H | T | N | S | MN/ENTER | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSHFT | ; | Q | J | K | X | B | M | W | V | Z | RSHFT | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | FN EX | GUI | ALT | NM / SPACE | NV / SPACE | RALT | - | = | ESC | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ - [_DV] = LAYOUT_arrow( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MN_EN, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - FN_EX, KC_LGUI, KC_LALT, NM_SP, NV_SP, KC_RALT, KC_MINS, KC_EQL, KC_ESC - ), - - - -/* NUMBERS - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DELETE | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | ! | @ | [ | { | ( | ) | } | ] | | | ? | ENTER | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | = | - * | LSFT | ` | ~ | # | $ | % | ^ | & | * | _ | + | / | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | | GUI | LALT |-----TRNS-----| SPACE | RALT | - | = | \ | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - */ - [_NM] = LAYOUT_arrow( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - _______, KC_EXLM, KC_AT, KC_LBRC, L_CURB, KC_LPRN, KC_RPRN, R_CURB, KC_RBRC, KC_PIPE, KC_QUES, _______, - _______, KC_GRV, KC_TILD, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_PLUS, KC_SLSH, - _______, _______, _______, _______, KC_SPC, _______, KC_MINS, KC_EQL, KC_BSLS - ), - - - -/* NAVIGATION - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ESC | MWU | MWL | MU | MWR | MPRV | MNXT | HOME | UP | END | PGUP | DELETE | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | MWD | ML | MD | MR | MRWD | MFFD | LEFT | DOWN | RIGHT| PGDN | MB2 | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | HYP1 | HYP2 | HYP3 | HYP4 | HYP5 | HYP6 | HYP7 | HYP8 | HYP9 | HYP0 | VOLUP | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | | GUI | LALT | MB1 |----TRNS----| MUTE | PLAY | STOP | VOLDN | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ - [_NV] = LAYOUT_arrow( - KC_ESC, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, KC_MPRV, KC_MNXT, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_DEL, - _______, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_MRWD, KC_MFFD, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_BTN2, - _______, HYP1, HYP2, HYP3, HYP4, HYP5, HYP6, HYP7, HYP8, HYP9, HYP0, KC_VOLU, - _______, _______, _______, KC_BTN1, _______, KC_MUTE, KC_MPLY, KC_MSTP, KC_VOLD - ), - - - -/* MODIFIED NUMBERS - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ALTESC | CAG1 | CAG2 | CAG3 | CAG4 | CAG5 | CAG6 | CAG7 | CAG8 | CAG9 | CAG0 | SWTCH | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | ALT ` | ALT1 | ALT2 | ALT3 | ALT4 | ALT5 | ALT6 | ALT7 | ALT8 | ALT9 | ALT0 |----TRNS---| - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | ALT = | MEH1 | MEH2 | MEH3 | MEH4 | MEH5 | MEH6 | MEH7 | MEH8 | MEH9 | MEH0 | | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | ALT - | | XBACK | ALT LEFT | ALT RIGHT | XFFWD | | | | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ - [_MN] = LAYOUT_arrow( - ALTESC, CAG1, CAG2, CAG3, CAG4, CAG5, CAG6, CAG7, CAG8, CAG9, CAG0, SWTCH, - ALTX, ALT1, ALT2, ALT3, ALT4, ALT5, ALT6, ALT7, ALT8, ALT9, ALT0, _______, - ALTEQL, MEH1, MEH2, MEH3, MEH4, MEH5, MEH6, MEH7, MEH8, MEH9, MEH0, xxxxxxx, - ALTMIN, xxxxxxx, XBACK, ALTL, ALTR, XFFWD, xxxxxxx, xxxxxxx, xxxxxxx - ), - - - -/* FUNCTIONS - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DELETE | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | LCTL | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | LSFT | | | | | | | | | | | | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * |---TRNS---| CAPS | LALT | | SWTCH | RALT | | RESET |--TRNS-| - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ - [_FN] = LAYOUT_arrow( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, xxxxxxx, - _______, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, xxxxxxx, KC_PWR, KC_SLEP, KC_WAKE, xxxxxxx, xxxxxxx, xxxxxxx, - _______, KC_CAPS, _______, xxxxxxx, SWTCH, KC_RALT, xxxxxxx, RESET, _______ - ) - - - -/* Transparent placeholder for more layers - * ,---------+------+------+------+------+------+------+------+------+------+------+------------. - * | | | | | | | | | | | | | - * |---------`------`------`------`------`------`------`------`------`------`------`------------| - * | | | | | | | | | | | | | - * |----------`------`------`------`------`------`------`------`------`------`------`-----------| - * | | | | | | | | | | | | | - * |-----------`------`------`------`------`------`-------`------`------`------`------`---------| - * | | | | | | | | | | - * `---------+----------+----------+-----^^^------+----^^^-----+-------+-------+-------+-------' - */ -// [_TR] = LAYOUT_arrow( -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -// _______, _______, _______, _______, _______, _______, _______, _______, _______ -// ) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch (keycode) { - case SWTCH: - SEND_STRING(SS_DOWN(X_LGUI)); - SEND_STRING(SS_DOWN(X_LSHIFT)); - SEND_STRING(SS_TAP(X_ENTER)); - SEND_STRING(SS_UP(X_LSHIFT)); - SEND_STRING(SS_UP(X_LGUI)); - return false; - } - } - return true; -} diff --git a/keyboards/tv44/keymaps/budi/readme.md b/keyboards/tv44/keymaps/budi/readme.md deleted file mode 100644 index e5de86ef81..0000000000 --- a/keyboards/tv44/keymaps/budi/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# Budi's TV44 Arrow layout - -- Dvorak main layer -- Somewhat easy bracket access for easy devs, happy :) -- Dedicated gaming layers cuz u don't wanna mess with apm -- Mainly for windows, but with translated alt/cmd on os, it's good to go - -ASCII graphics shamelessly stolen from tong92's layout :) - -Updates August 2018: -- Escape both ways -- Only include QMK_KEYBOARD_H - -Updates July 2018: -- I guess I don't play games that much anymore -- SUGDW modifiers -- Somehow LALT(LSFT(KC_RET)) does not register correctly on my mac diff --git a/keyboards/tv44/keymaps/core/keymap.c b/keyboards/tv44/keymaps/core/keymap.c deleted file mode 100644 index d24049696e..0000000000 --- a/keyboards/tv44/keymaps/core/keymap.c +++ /dev/null @@ -1,34 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" - -#define _QW 0 -#define _L1 1 -#define _L2 2 - -// Fillers to make layering more clear -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT( /* Qwerty */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, MO(_L2), - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, MO(_L1), KC_RALT, KC_RCTL - ), - [_L1] = LAYOUT( /* LAYER 1 */ - KC_GRV, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_PAUS, - KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, _______, - _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_L2] = LAYOUT( /* LAYER 2 */ - 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_UNDS, KC_PLUS, - _______, _______, _______, _______, _______, KC_COMM, KC_SLSH, KC_RBRC, KC_LBRC, KC_BSLS, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/tv44/keymaps/core/readme.md b/keyboards/tv44/keymaps/core/readme.md deleted file mode 100644 index 3ec503b21f..0000000000 --- a/keyboards/tv44/keymaps/core/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -# A minivan keymap based off the Vertex Core - -## Main differences - -* There are only 3 keys on the bottom right, so menu was dropped -* There are only 3 keys on the bottom left, so Pn was dropped because there is - no programmable layer. -* There are only 12 keys in the first row, so the delete key (along with scroll - lock) has been dropped. -* The F1-F12 keys have been shifted by 1 so they all fit in the first row of - layer 2. -* Moved the grave/tilde to layer 1 (because in layer 2 it's now taken up by F1). -* Keys relating to speed have been removed -* The `L_Win + L_Alt + R_spacebar = R_Shift, R_Alt, Menu and R_Ctrl as arrow - keys` as mentioned in the manual does not work. -* The layer 2 plus shift should have support for symbols in the first row (where - the F1-F12 keys are) but this has not been implemented, so you need to use the - second row (where the numbers are). diff --git a/keyboards/tv44/keymaps/core/rules.mk b/keyboards/tv44/keymaps/core/rules.mk deleted file mode 100644 index 457a3d01d4..0000000000 --- a/keyboards/tv44/keymaps/core/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tv44/keymaps/default/config.h b/keyboards/tv44/keymaps/default/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/tv44/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/keymap.c b/keyboards/tv44/keymaps/default/keymap.c deleted file mode 100644 index 6055cd74e2..0000000000 --- a/keyboards/tv44/keymaps/default/keymap.c +++ /dev/null @@ -1,101 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// 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 _QW 0 -#define _DV 1 -#define _CM 2 -#define _L1 3 -#define _L2 4 -#define _L3 5 - -// Macro name shortcuts -#define QWERTY M(_QW) -#define DVORAK M(_DV) -#define COLEMAK M(_CM) - -// Curly braces have their own keys. These are defined to make them not mess up -// the grid in layer 2. -#define L_CURBR LSFT(KC_LBRC) -#define R_CURBR LSFT(KC_RBRC) - -// Fillers to make layering more clear -#define _______ KC_TRNS - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QW] = LAYOUT( /* Qwerty */ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - MO(_L1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MO(_L1), - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2), - KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) - ), - [_DV] = LAYOUT( /* Dvorak */ - KC_TAB, KC_SLSH, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - MO(_L1), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, MO(_L1), - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, MO(_L2), - KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) - ), - [_CM] = LAYOUT( /* Colemak */ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - MO(_L1), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, MO(_L1), - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(_L2), - KC_LCTL, MO(_L2), KC_LGUI, KC_ENT, KC_SPC, KC_RALT, KC_ESC, TG(_L3) - ), - [_L1] = LAYOUT( /* LAYER 1 */ - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, - _______, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, _______, - _______, KC_ESC, _______, KC_PSCR, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, KC_RSFT, - _______, KC_LGUI, _______, _______, _______, _______, _______, _______ - ), - [_L2] = LAYOUT( /* LAYER 2 */ - _______, QWERTY, DVORAK, COLEMAK, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, _______, - KC_ESC, KC_PIPE, KC_DQUO, KC_UNDS, KC_PLUS, L_CURBR, R_CURBR, KC_4, KC_5, KC_6, KC_VOLU, KC_ENT, - _______, _______, _______, _______, _______, _______, KC_0, KC_1, KC_2, KC_3, KC_VOLD, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - [_L3] = LAYOUT( /* LAYER 3 */ - _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, _______, - KC_ESC, _______, _______, _______, _______, _______, _______, KC_F5, KC_F6, KC_F7, KC_F8, _______, - KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_F12, _______, - _______, KC_LSFT, KC_B, KC_SPC, KC_C, _______, _______, _______ - ) -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case _DV: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DV); - } - break; - case _QW: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QW); - } - break; - case _CM: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_CM); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/tv44/keymaps/default/readme.md b/keyboards/tv44/keymaps/default/readme.md deleted file mode 100644 index ac84c08cfa..0000000000 --- a/keyboards/tv44/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/keymaps/default/rules.mk b/keyboards/tv44/keymaps/default/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/tv44/keymaps/default/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/jeebak/keymap.c b/keyboards/tv44/keymaps/jeebak/keymap.c deleted file mode 100644 index 5503e1f9eb..0000000000 --- a/keyboards/tv44/keymaps/jeebak/keymap.c +++ /dev/null @@ -1,425 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// 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 _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _PLOVER 5 -#define _TOUCHCURSOR 6 -#define _MOUSECURSOR 7 -#define _ADJUST 16 - -// Keycodes -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - LOWER, - RAISE, - BACKLIT, - EXT_PLV -}; - -enum macro_keycodes { - KC_ALT_TAB, - KC_CMD_TAB, - KC_CTL_TAB, - KC_CMD_SLSH, - KC_AG_FIND, - KC_AG_AGAIN, - KC_AG_UNDO, - KC_AG_CUT, - KC_AG_COPY, - KC_AG_PASTE, - KC_AG_DESK_L, - KC_AG_DESK_R, - KC_AG_TAB_C, - KC_AG_TAB_N, - KC_AG_TAB_R, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper -#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI -#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab -#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab -#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab -#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) -#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings -#define AG_AGAIN M(KC_AG_AGAIN) -#define AG_UNDO M(KC_AG_UNDO) -#define AG_CUT M(KC_AG_CUT) -#define AG_COPY M(KC_AG_COPY) -#define AG_PASTE M(KC_AG_PASTE) -#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and -#define AG_D_R M(KC_AG_DESK_R) // Right -#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, -#define AG_T_N M(KC_AG_TAB_N) // Tab New, and -#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_QWERTY] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Colemak - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | Shift | Z | X | C | V | B | K | M | , | . | / | Sft/Ent | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_COLEMAK] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_R,LT_MC(KC_S), KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Dvorak - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | Shift | ; | Q | J | K | X | B | M | W | V | Z | Sft/Ent | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_DVORAK] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_O,LT_MC(KC_E), KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLU , KC_MPLY ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Lower - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Brite | | | | | | Vol- | Mute | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_LOWER] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - KC_TILD,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - KC_LBRC , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_RBRC , KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Raise - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Brite | | | | | | Vol- | Mute | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_RAISE] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - KC_DLR , KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_EQL , KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - BACKLIT , _______ , _______ , _______ , _______ , _______ , KC_VOLD , KC_MUTE ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | | | | | | | | | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - * - * The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't - * seem to work on Mac. Presumably they'll work under Windows. - */ - -[_TOUCHCURSOR] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______ , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - _______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Mouse Layer - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | | | | | | | | | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ - -[_MOUSECURSOR] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - _______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______ , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - _______ ,KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5 , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Plover layer (http://opensteno.org) - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | TogOut | S | K | W | R | * | * | R | B | G | S | Z | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | Exit | A | O | | | E | U | | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ - -[_PLOVER] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - KC_1 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - EXT_PLV , KC_C , KC_V , XXXXXXX , XXXXXXX , KC_N , KC_M , XXXXXXX ), -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ - -/* Adjust (Lower + Raise) - * ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - * | | | | | | | | | | | | Del | - * |---------`------`------`------`------`------`------`------`------`------`------`-------------| - * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | - * |----------`------`------`------`------`------`------`------`------`------`------`------------| - * | | | | | | | | | | | | | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - * | | | | | | | | Reset | - * `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' - */ -[_ADJUST] = LAYOUT( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______ , _______ , _______ , _______ , _______ , _______ , RESET ) -/*`-----------+---------------+---------+-------^^^------+-------^^^-------+---------+-----------------+--------------'*/ -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - case PLOVER: - if (record->event.pressed) { - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - layer_off(_PLOVER); - } - return false; - break; - } - return true; -} - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. - // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in: - // quantum/quantum.c - if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { - use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. - } - - switch (id) { - case KC_ALT_TAB: - if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } - else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } - case KC_CMD_TAB: - if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } - else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } - - case KC_CTL_TAB: - return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); - case KC_CMD_SLSH: - return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); - - case KC_AG_FIND: - return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); - case KC_AG_AGAIN: - return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); - case KC_AG_UNDO: - return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); - case KC_AG_CUT: - return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); - case KC_AG_COPY: - return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); - case KC_AG_PASTE: - return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); - - case KC_AG_DESK_L: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); - case KC_AG_DESK_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); - - case KC_AG_TAB_C: - return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); - case KC_AG_TAB_N: - return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); - case KC_AG_TAB_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); - } - - return MACRO_NONE; -} diff --git a/keyboards/tv44/keymaps/jeebak/readme.md b/keyboards/tv44/keymaps/jeebak/readme.md deleted file mode 100644 index f781d55558..0000000000 --- a/keyboards/tv44/keymaps/jeebak/readme.md +++ /dev/null @@ -1,129 +0,0 @@ -jeebak's TV44 layout -======================= -NOTE: This is a port of jeebak's planck layout, for tv44. - -This WIP keymap attempts to minimize fingers straying away from the home row. -To aid in this endeavor, when additional modifyer keys to switch layers are -needed, they will be mapped to home row keys. The `keymap.c` file will contain -the exact changes. The diagrams in this README shows the highlights of the -changes from the default mappings. - -I also decided to change all calls to `persistent_default_layer_set()` to -`default_layer_set()` since this is my personal perference. - -## Macros -``` -#define ALT_TAB M(KC_ALT_TAB) -``` - -## Base Layers (Qwerty/Colemak/Dvorak) -These base layers are mostly the same as the default mappings. The interesting -changes are shown below. - -- The `Ctrl/Esc`, will emit an `Escape` when tapped, and act as a `Control` key when held, -- `GUI/;` as `;` and `GUI`, -- `Alt/"` as `"` and `Alt`, -- `Sft/Ent` as `Enter` and `Shift`, and -- `Hyper/Tab` as `Tab` and `Hyper` - -A `TODO` item is to see if it can also act as a `CapsLock` when double-tapped. -The arrow keys, which have been moved to the -[TouchCursor](http://martin-stone.github.io/touchcursor/) layer, have been -replaced with the Media keys as shown. The `MC/kc` key activates the -`MouseCursor` layer when held, and emits the corresponding `kc` for its layer, -when tapped. -``` - ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | - |---------`------`------`------`------`------`------`------`------`------`------`-------------| - | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L |GUI/; | Alt/" | - |----------`------`------`------`------`------`------`------`------`------`------`------------| - | Shift | Z | X | C | V | B | N | M | , | . | / | Sft/Ent | - |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol+ | Play | - `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' -``` - -## Lower Layer (Symbols and Function Keys) -The symbols and functions keys are essentially the same as the default mapping. -The most notable changes are that the symbol keys from the `RAISE` layer have -been moved here. The remaining Media keys replace those that are now on the -base layers. The `BACKLIT` key has also been moved here. -``` - ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - |---------`------`------`------`------`------`------`------`------`------`------`-------------| - | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | "|" | - |----------`------`------`------`------`------`------`------`------`------`------`------------| - | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ | - |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - | Brite | | | | | | Vol- | Mute | - `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' -``` - -## Raise Layer (Numbers and Arithmetic Operators) -All of the numbers and arithmetic operators are available on this layer. Some -keys are duplicated for the convenience of their positions. The `0` and `$` -keys at the far left are for quick access to beginning and end of line in vim. -``` - ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - |---------`------`------`------`------`------`------`------`------`------`------`-------------| - | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | "|" | - |----------`------`------`------`------`------`------`------`------`------`------`------------| - | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ | - |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - | Brite | | | | | | Vol- | Mute | - `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' -``` - -## TouchCursor layer plus personal customizations -[TouchCursor](http://martin-stone.github.io/touchcursor/) uses the `Space` key -as the modifier, with the `IJKL` home row keys representing the inverted-T of -the arrow keys. All of the default TouchCursor keymappings for the right hand -are represented below. My personalizations include all of the keys shown for -the left hand. Having the `Alt` and `Shift` keys (as well as the `Control` key -from the base layers) readily accessible from the home row allows quick word -jumps and highlighting when used in conjunction with the arrow keys. The -`Alt-Tab` macro is not only useful under Windows, but also under Mac when used -with alternative switchers like [HyperSwitch](https://bahoom.com/hyperswitch). -The `Cmd-Tab` and `Ctrl-Tab` sequences are duplicated for easy access while in -this layer. The `KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND,` and `KC_AGAIN` -keycodes do not seem to work. There are macros in place that'll "automatically" -choose the correct version (`Cmd-Tab` vs. `Alt-Tab`, `Cmd-C` vs. `Ctrl-C`, -etc.) depending on which layout you've currently selected (`AG_NORM` or -`AG_SWAP`) in the `_ADJUST` layer. The `Desk_L` and `Desk_R` macros are what I -use to switch between Virtual Desktops Left/Right. The `Tab_C`, `Tab_N` and -`Tab_R` are for "Close Tab," "New Tab" and "Reopen Closed Tab" for apps such as -Google Chrome. -``` - ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | - |---------`------`------`------`------`------`------`------`------`------`------`-------------| - | | Alt |Space |Tab_C | Find |Again | PgUp | Left | Down |Right |Desk_L| Desk_R | - |----------`------`------`------`------`------`------`------`------`------`------`------------| - | | Undo | Cut | Copy |Paste | ` | PgDn | Del |Tab_N |Tab_R |iTerm2| | - |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - | | | | | | | | | - `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' -``` - -## Mouse Layer -The Mouse layer, closely mimics the layout/behaviour of the TouchCursor layer. -The `D` key (on QWERTY) is used to activate this layer. All 16 keycodes for the -mouse from the `doc/keycode.txt` file are represented, and logically located, -IMHO. The left and right click buttons are duplicated; on the right hand side, -for a quick click here and there, and again on the left hand side for when the -buttons need to be held for dragging things or highlighting text, thus allowing -the right hand to be free to use the up/down/left/right actions. -``` - ,---------+------+------+------+------+------+------+------+------+------+------+-------------. - | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | - |---------`------`------`------`------`------`------`------`------`------`------`-------------| - | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 | - |----------`------`------`------`------`------`------`------`------`------`------`------------| - | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | | - |-----------`------`------`------`------`-----'-------`------`------`------`------`-----------| - | | | | | | | | | - `--------+---------+---------+------^^^-------+-----^^^--------+---------+---------+---------' -``` diff --git a/keyboards/tv44/keymaps/jeebak/rules.mk b/keyboards/tv44/keymaps/jeebak/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/tv44/keymaps/jeebak/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/config.h b/keyboards/tv44/keymaps/jetpacktuxedo/config.h deleted file mode 100644 index 5f5872becc..0000000000 --- a/keyboards/tv44/keymaps/jetpacktuxedo/config.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PERMISSIVE_HOLD -#endif diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c b/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c deleted file mode 100644 index 45bedaa977..0000000000 --- a/keyboards/tv44/keymaps/jetpacktuxedo/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -#include "tv44.h" - -extern keymap_config_t keymap_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_arrow_command( /* Qwerty */ - KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT(2, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(2, KC_ENT), - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MT(MOD_RSFT, KC_SLSH), - KC_LCTL, KC_LGUI, KC_LALT, MO(3), LT(1, KC_SPC), LT(1, KC_SPC), MO(4), KC_LEFT, KC_DOWN, KC_RIGHT - ), - [1] = LAYOUT_arrow_command( /* LAYER 2 */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, - KC_TRNS, KC_MINS, KC_EQL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_QUOT, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_PGUP, KC_BSLS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END - ), - [2] = LAYOUT_arrow_command( /* LAYER 1 */ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, - KC_TRNS, KC_UNDS, KC_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UNDS, KC_PLUS, KC_DQUO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_PGUP, KC_PIPE, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END - ), - [3] = LAYOUT_arrow_command( /* LAYER 3 */ - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [4] = LAYOUT_arrow_command( /* Gaming Layer*/ - KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, - KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPACE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ) -}; - -const uint16_t PROGMEM fn_actions[] = { -}; diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md b/keyboards/tv44/keymaps/jetpacktuxedo/readme.md deleted file mode 100644 index fd95b56ab8..0000000000 --- a/keyboards/tv44/keymaps/jetpacktuxedo/readme.md +++ /dev/null @@ -1,49 +0,0 @@ -# Jetpacktuxedo's minivan layout - -This differs quite a bit from the stock layout but leaves keys in a more familiar position in my opinion. It is designed to use the arrow+command layout, but I used a fairly similar layout for the normal arrow layout. Additionally, I use an mx lock switch on the key between the right space key and the arrow cluster. If you don't want to use a lock switch you should change MO(4) on the base layer to use TG(4) instead for a similar effect. - -## Base Layer (0) - -The base layer is pretty simple, straight qwerty layout where available. Of note: /? is to the right of the arrow keys. Yes this is kinda weird sometimes, but you get used to it. Tab is tab when pressed and fn2 when held, Enter is the same. GESC is esc when used alone, but ~ when shifted. Tapping FN 1 is space -``` -|GESC| Q | W | E | R | T | Y | U | I | O | P | BSPC | -| TAB | A | S | D | F | G | H | J | K | L | ; |ENTER| -|SHIFT | Z | X | C | V | B | N | M | , | . | UP | / | -|CTRL|WIN |ALT |FN 3| FN 1 | SPACE | FN 4 |LEFT|DOWN|RIGH| -``` -## Numeric Layer (1) - -This layer has the numrow as well as swapping the arrow keys for a nav cluster, and swapping ;: for '" and /? for \|. With that almost all of the missing keys are accounted for. -``` -| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | DEL | -| | | | | | | | | - | = | ' | | -| | | | | | | | | [ | ] |PGUP| \ | -| | | | | | | |HOME|PGDN|END | -``` -## Symbolic Layer (2) - -I don't want to be using two key combos constantly, so I also added this symbol layer that is basically shift+numeric layer -``` -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | DEL | -| | | | | | | | | _ | + | " | | -| | | | | | | | | { | } |PGUP| | | -| | | | | | | |HOME|PGDN|END | -``` -## Fkeys (3) - -I very rarely use Fkeys, but figured I'd throw them on anyway just in case. The setup basically mimics the way Fkeys are usually done on a 60%, with F11 and F12 still on - and =, even though the location of those keys has moved. -``` -| | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 |F10 | | -| | | | | | | | |F11 |F12 | | | -| | | | | | | | | | | | | -| | | | | | | | | | | -``` -## Gaming Layer (4) - -Originally this was just going to be a gaming layer (make esc just esc, make tab just tab, move space to the left side), but I ended up in a hotel without a usb mouse, so I added mousekeys to it as well. -``` -|ESC | | | | | |MWUP|MRCK|M_UP|MLCK| | | -| TAB | | | | | |MWDN|M_LF|M_DN|M_RG| | | -| | | | | | | | | | | | | -| | | | | SPACE | | | | | | -``` diff --git a/keyboards/tv44/keymaps/jetpacktuxedo/rules.mk b/keyboards/tv44/keymaps/jetpacktuxedo/rules.mk deleted file mode 100644 index ebc9f810f9..0000000000 --- a/keyboards/tv44/keymaps/jetpacktuxedo/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 controls -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 diff --git a/keyboards/tv44/keymaps/mjt/config.h b/keyboards/tv44/keymaps/mjt/config.h deleted file mode 100644 index e89a3ea125..0000000000 --- a/keyboards/tv44/keymaps/mjt/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B2 - #define BACKLIGHT_LEVELS 7 -#endif - -#define USB_MAX_POWER_CONSUMPTION 50 - -#endif diff --git a/keyboards/tv44/keymaps/mjt/keymap.c b/keyboards/tv44/keymaps/mjt/keymap.c deleted file mode 100644 index 25f8cfc52a..0000000000 --- a/keyboards/tv44/keymaps/mjt/keymap.c +++ /dev/null @@ -1,199 +0,0 @@ -//Author: mike terhar - -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif - -enum minivan_layers { - _QWERTY, - _NUMSYM, - _FKEYS, - _FKEYGRV, - _PLOVER, - _ADJUST -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - DYNKEY, - DYNAMIC_MACRO_RANGE, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define FKEYS F(_FKEYS) -#define NUMSYM F(_NUMSYM) -#define FKEYGRV F(_FKEYGRV) -#define MACSLEEP M(5) -#define PLOVER M(6) -#define LAYERRESET M(7) -#define BACKLIT M(8) -#define ADJUST M(9) -#define XXXXXXX KC_NO - -#include "dynamic_macro.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = { - {FKEYS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT}, - {KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT,KC_SLSH,SFT_T(KC_ENT) }, - {KC_LCTL,KC_LALT,KC_LGUI, KC_SPC,XXXXXXX,XXXXXXX,XXXXXXX,NUMSYM,KC_LEFT,KC_DOWN,KC_UP ,KC_RIGHT} -}, -[_NUMSYM] = { - {FKEYGRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, - {KC_DEL,KC_EXLM, KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN, ADJUST }, - { _______, KC_UNDS,KC_PLUS, KC_LCBR,KC_RCBR,KC_PIPE , KC_MINS,KC_EQL,KC_LBRC, KC_RBRC, KC_BSLS, _______}, - {_______,_______,_______,_______,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_HOME, KC_PGDN, KC_PGUP, KC_END} -}, -[_FKEYS] ={ - {_______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______}, - {KC_DEL, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, MACSLEEP, DYN_REC_START1, DYN_REC_START2 }, - {KC_CAPS, _______, _______, _______, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,_______,DYN_REC_STOP}, - {_______,_______,_______,LAYERRESET,XXXXXXX,XXXXXXX,XXXXXXX,LAYERRESET, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {LAYERRESET, XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, -[_ADJUST] = { - {_______ , RESET, _______, _______, _______, _______, _______, _______, KC_SLCK, KC_PAUS, KC_PSCR, KC_DEL }, - {_______ , _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, MACSLEEP, PLOVER, _______}, - {_______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {BACKLIT, _______, _______, LAYERRESET, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} -} -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dyn_macro_rec[][2] = SONG(DVORAK_SOUND); -float tone_dyn_macro_play[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_adjust[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -const uint16_t PROGMEM fn_actions[] = { - [_FKEYS] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_TAB), - [_FKEYGRV] = ACTION_LAYER_TAP_KEY(_FKEYS, KC_GRV), - [_NUMSYM] = ACTION_LAYER_TAP_TOGGLE(_NUMSYM), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { - case 5: // MACSLEEP - if (record->event.pressed) { - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - break; - case 6: // PLOVER - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_NOTE_ARRAY(tone_plover, false, 0); - #endif - layer_off(_NUMSYM); - layer_off(_FKEYS); - layer_off(_ADJUST); - layer_on(_PLOVER); - } - break; - case 7: // LAYERRESET - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_qwerty, false, 0); - #endif - layer_off(_NUMSYM); - layer_off(_FKEYS); - layer_off(_PLOVER); - layer_off(_ADJUST); - } - break; - case 8: // BACKLIT - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - case 9: // ADJUST - if(record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_NOTE_ARRAY(tone_adjust, false, 0); - #endif - layer_off(_NUMSYM); - layer_off(_FKEYS); - layer_off(_PLOVER); - layer_on(_ADJUST); - } - } - return MACRO_NONE; -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint16_t macro_kc = keycode; - if (keycode == FKEYS || keycode == ADJUST || keycode == FKEYGRV ){ - macro_kc = DYN_REC_STOP; - } - if (!process_record_dynamic_macro(macro_kc, record)) { - return false; - } - - return true; -} - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_NOTE_ARRAY(tone_startup, false, 0); -} - -void shutdown_user() -{ - PLAY_NOTE_ARRAY(tone_goodbye, false, 0); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_NOTE_ARRAY(music_scale, false, 0); -} -#endif diff --git a/keyboards/tv44/keymaps/mjt/readme.md b/keyboards/tv44/keymaps/mjt/readme.md deleted file mode 100644 index c86985f6cb..0000000000 --- a/keyboards/tv44/keymaps/mjt/readme.md +++ /dev/null @@ -1,26 +0,0 @@ -# Mike's Minivan - -- Arrow Layout (45key) -- Dynamic Macros -- Media Keys -- Works with iPhone Camera Adapter - -## Layers - -Qwerty for letters and mods. - -Numsym for all numbers and symbols used in typing. Follows a similar approach to -planck but puts both on the same layer eschewing the F-keys. - -Fkeys layer is for the seldom used stuff like F-keys and some additional features -such as dynamic macros, media keys, and a sleep shortcut for OS X. - -Adjust layer is tough to get to so it is only for keyboard configuration stuff. - -## Dynamic Macros - -Hold TAB key, then press ";" to record macro 1 and "'" to record macro 2. - -When you are done recording, press TAB again. - -For playback of macros, TAB+"," plays macro 1 and TAB+","plays macro 2. diff --git a/keyboards/tv44/keymaps/mjt/rules.mk b/keyboards/tv44/keymaps/mjt/rules.mk deleted file mode 100644 index 41afd9a551..0000000000 --- a/keyboards/tv44/keymaps/mjt/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = 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 = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tv44/keymaps/smt/keymap.c b/keyboards/tv44/keymaps/smt/keymap.c deleted file mode 100644 index 0e1484e82d..0000000000 --- a/keyboards/tv44/keymaps/smt/keymap.c +++ /dev/null @@ -1,232 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -// 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 _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -// Keycodes -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Alt+Shift) -#define ALT_GRV ALT_T(KC_GRV) // Tap for Backtick, hold for Alt (Ctrl+Alt+Shift) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * |Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_QWERTY] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ - -/* Colemak - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent| - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_COLEMAK] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ - -/* Dvorak - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * |Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent| - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_DVORAK] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - CTL_ESC , KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - ALT_GRV , KC_LGUI , LOWER , KC_SPC , KC_SPC , RAISE , KC_RGUI, KC_RALT, KC_RCTL ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ - -/* Lower - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | Brite | | | Home | End | | Left | Down | Right | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_LOWER] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ -ALL_T(KC_0), KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ -CTL_T(KC_DLR), KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_ASTR, KC_4, KC_5, KC_6, KC_DOT, KC_PGUP , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ -SFT_T(KC_EQL), KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_SLSH, KC_1, KC_2, KC_3, KC_UP, SFT_T(KC_PGDN), -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ -ALT_T(BACKLIT), _______ , _______ , KC_HOME , KC_END , _______ , KC_LEFT, KC_DOWN, KC_RGHT ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ - -/* Raise - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | Brite | | | Play | Next | | Mute | Vol- | Vol+ | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_RAISE] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ -ALL_T(KC_TILD),KC_EXLM,KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ -CTL_T(KC_F1), KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_QUES, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - SFT_T(KC_F7), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_SLSH, KC_EQL, KC_LBRC, KC_RBRC, SFT_T(KC_BSLS), -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ -ALT_T(BACKLIT), _______ , _______ , KC_MPLY , KC_MNXT , _______ , KC_MUTE, KC_VOLD, KC_VOLU ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ - -/* Adjust (Lower + Raise) - * ,---------+------+------+------+------+------+------+------+------+------+------+---------. - * | | Reset| | | | | | | | | | Reset | - * |---------`------`------`------`------`------`------`------`------`------`------`---------| - * | | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |----------`------`------`------`------`------`------`------`------`------`------`--------| - * | | | | | | | | | | | | | - * |-----------`------`------`------`------`-----'-------`------`------`------`------`-------| - * | | | | | | | | | | - * `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' - */ -[_ADJUST] = LAYOUT_arrow( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------.*/ - _______, RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`-----------------|*/ - _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______ , _______ , _______ , _______ , _______ , _______, _______, _______ ), -/*`---------+---------------+---------+-------^^^------+-------^^^-------+----------+--------+--------+--------------'*/ -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} diff --git a/keyboards/tv44/keymaps/smt/readme.md b/keyboards/tv44/keymaps/smt/readme.md deleted file mode 100644 index 059fd1bbde..0000000000 --- a/keyboards/tv44/keymaps/smt/readme.md +++ /dev/null @@ -1,126 +0,0 @@ -# smt's TV44 keymap - -This keymap is based on a combination of my Planck keymap and [jeebak's TV44 layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tv44/keymaps/jeebak). I removed the macros and TouchCursor/MouseCursor layers, because I'm just not ready for that level of mind-mapping. - -I had been using something close to the default Minivan layout, but after spending a bit of time with the Planck and Preonic, I decided it would be better for me to try to standardize to some degree, where possible. - -Also, it's worth noting that my Minivan is one with the "arrows" layout, which has a 45th key. In spite of this, the 45-key Minivan is still technically considered a "TV44" as far as I know. - -![smt's TV44 keymap](https://i.imgur.com/Y4n6eHj.png) - -## Notable features (most of which can be found in my or jeebak's respective keymap file): - -1. **Shift/Enter** - - I use both the left and right shift keys when I type. When I want to modify a key with shift, I hold shift with the hand opposite the one typing the key. In the default keymap, Enter is where shift would be on a standard keyboard layout. Oh, muscle memory. - - Thankfully, QMK supports [mod-tap](https://github.com/jackhumbert/qmk_firmware/wiki#fun-with-modifier-keys) keys, and this allows me to set the Enter key to send a modifier (MOD_LSFT) when held, and KC_ENT when tapped. Awesome! - -2. **Hyper/Tab** - - This key modifies with "Hyper" (see [Brett Terpstra's post](http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key/) on this) when held, and outputs the code for Tab when tapped. On the Mac, I use KeyboardMaestro to remap my hyper-keys to do a lot of crazy things. - -3. **Ctrl/Escape** - - I set up another mod-tap, this time for the Escape key that would act as a Control modifier when held. - -4. **Alt/Backtick** - - I don't currently have LEDs on most of my keyboards, and I certainly don't want LED controls on the base layer of a 40%. - - So, why use backtick in the lower left corner? I use it as my tmux prefix key, so I need to type it more frequently than most people. Putting it on the base layer works well for my use case, and it's consistent with where I place it in my Planck and Preonic keymaps. - - I also like Alt in that position, so it works well as yet another mod-tap key. - - -## Layers - -### Qwerty - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -|Hyper/Tab| Q | W | E | R | T | Y | U | I | O | P | Bksp | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent| -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` - -### Colemak - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -|Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| Ctrl/Esc | A | R | S | T | D | H | N | E | I | O | ' | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent| -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` - -### Dvorak - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -|Hyper/Tab| ' | , | . | P | Y | F | G | C | R | L | Bksp | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| Ctrl/Esc | A | O | E | U | I | D | H | T | N | S | - | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent| -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| Alt/` | GUI | Lower | Space | Space | Raise | GUI | Alt | Ctrl | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` - -### Lower - -This is where I put the number row, two numpad clusters, common arithmetic operators, and cursorkeys: Arrow cluster, Home/End, Page Up/Page Down. `0` and `$` are also placed on the left side for convenient access to beginning-of-line and end-of-line Vim commands. BRITE has been moved here from the base layer. - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| $ | 4 | 5 | 6 | . | + | * | 4 | 5 | 6 | . | PageUp | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| = | 7 | 8 | 9 | 0 | - | / | 1 | 2 | 3 | Up |PageDn | -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| Brite | | | Home | End | | Left | Down | Right | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` - -### Raise - -As a developer, it makes the most sense for me to group all the commonly-used symbols that don't fit on the main layer. In particular, having the dual-column of parens-braces-brackets helps me keep them straight. I've dropped basic media controls onto this layer as well. - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -| ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| F1 | F2 | F3 | F4 | F5 | F6 | _ | ? | + | { | } | | | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| F7 | F8 | F9 | F10 | F11 | F12 | - | / | = | [ | ] | \ | -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| Brite | | | Play | Next | | Mute | Vol- | Vol+ | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` - -### Adjust (Lower + Raise) - -Utility layer. There isn't much here; it's mainly for swapping the default keymap between Qwerty and Dvorak, or putting the keyboard into flash mode via the Reset key. - -``` -,---------+------+------+------+------+------+------+------+------+------+------+---------. -| | Reset| | | | | | | | | | Del | -|---------`------`------`------`------`------`------`------`------`------`------`---------| -| | | | | |AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | -|----------`------`------`------`------`------`------`------`------`------`------`--------| -| | | | | | | | | | | | | -|-----------`------`------`------`------`-----'-------`------`------`------`------`-------| -| | | | | | | | | | - `-------+---------+--------+-----^^^------+-----^^^------+---------+------+------+-------' -``` diff --git a/keyboards/tv44/keymaps/smt/rules.mk b/keyboards/tv44/keymaps/smt/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/tv44/keymaps/smt/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/tong92/config.h b/keyboards/tv44/keymaps/tong92/config.h deleted file mode 100644 index be959a823c..0000000000 --- a/keyboards/tv44/keymaps/tong92/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here -#ifdef BACKLIGHT_ENABLE - #define BACKLIGHT_PIN B2 - #define BACKLIGHT_LEVELS 7 -#endif - -#endif diff --git a/keyboards/tv44/keymaps/tong92/keymap.c b/keyboards/tv44/keymaps/tong92/keymap.c deleted file mode 100644 index 758c3bb15c..0000000000 --- a/keyboards/tv44/keymaps/tong92/keymap.c +++ /dev/null @@ -1,205 +0,0 @@ -//Author: tong92 - -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" -#endif - -extern keymap_config_t keymap_config; - -enum tv44_layers { - _WINDOW, - _MAC, - _LOWER, - _RAISE, - _WINDOW_SHORTCUT, - _MAC_SHORTCUT, - _MOUSE -}; - -enum tv44_keycodes { - WINDOW = SAFE_RANGE, - MAC, - MOUSE, - BACKLIT, - EXT_MOUSE -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define LOWER F(_LOWER) -#define RAISE F(_RAISE) -#define XXXXXXX KC_NO -#define WINDOW_SHORTCUT MO(_WINDOW_SHORTCUT) -#define MAC_SHORTCUT MO(_MAC_SHORTCUT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Window - Qwerty - * ,--------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter| - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | Ft | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | - * `--------------------------------------------------------------------------' - */ -[_WINDOW] = LAYOUT_arrow( -KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, -KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, -KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, -WINDOW_SHORTCUT, KC_LGUI,KC_LALT, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT -), -/* Mac - Qwerty - * ,--------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | Cmd | A | S | D | F | G | H | J | K | L | ; | Enter| - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | Ft | Alt | Ctrl | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | - * `--------------------------------------------------------------------------' - */ -[_MAC] = LAYOUT_arrow( -KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, -KC_LGUI,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_ENT, -KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RSFT, -MAC_SHORTCUT, KC_LALT, KC_LCTRL, LOWER, RAISE, KC_QUOT,KC_LBRC,KC_RBRC,KC_RALT -), -/* LOWER - * ,--------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | - | + | [ | ] | \ | - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | | | | | END | LEFT| Down|RIGHT| - * `--------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_arrow( -KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, -_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS,KC_PLUS,KC_LBRC,KC_RBRC,KC_BSLS, -_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, -XXXXXXX,_______,_______, _______,XXXXXXX, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT -), -/* RAISE - * ,--------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | | | | | END | LEFT| Down|RIGHT| - * `--------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_arrow( -KC_TILD,KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,_______, -_______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS,KC_EQL, KC_LCBR,KC_RCBR,KC_PIPE, -_______,KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______,KC_HOME,KC_PGUP,KC_UP ,KC_PGDN, -XXXXXXX,_______,_______, _______,_______, KC_END, KC_LEFT,KC_DOWN,KC_RIGHT -), -/* Window Shortcut - * ,--------------------------------------------------------------------------. - * | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED | - * `--------------------------------------------------------------------------' - */ -[_WINDOW_SHORTCUT] = LAYOUT_arrow( -KC_ESC ,LALT(KC_F4) ,LGUI(KC_UP) ,XXXXXXX ,XXXXXXX,S(KC_CAPS) ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, -_______,LGUI(KC_LEFT) ,LGUI(KC_DOWN) ,LGUI(KC_RIGHT),XXXXXXX,LALT(KC_CAPS) ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, -_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,LCTL(KC_CAPS) ,KC_SLCK ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, -_______,LGUI(LCTL(KC_LEFT)),LGUI(LCTL(KC_RIGHT)), LCTL(LALT(KC_DELT)),LGUI(LCTL(KC_F4)), MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT -), -/* Mac Shortcut - * ,--------------------------------------------------------------------------. - * | ESC |CmdUp|CmdDo| | | | | PgUp| UP | PgDo|PrtSc| DELET | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | |WBlkL|WBlkR| |ScrFu| |CapsL| LEFT| DOWN|RIGHT| | | - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | |BlckL|BlckR| | | | | HOME| | END | | Ctrl| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | | | | | MOUSE| | | LED | - * `--------------------------------------------------------------------------' - */ -[_MAC_SHORTCUT] = LAYOUT_arrow( -KC_ESC ,LGUI(KC_UP) ,LGUI(KC_DOWN) ,XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_PGUP,KC_UP ,KC_PGDN ,KC_PSCR,KC_DELT, -_______,LALT(LSFT(KC_LEFT)) ,LALT(LSFT(KC_RIGHT)) ,XXXXXXX,LGUI(LCTL(KC_F)),XXXXXXX ,KC_CAPS ,KC_LEFT,KC_DOWN,KC_RIGHT,XXXXXXX,XXXXXXX, -_______,LGUI(LSFT(KC_LEFT)),LGUI(LSFT(KC_RIGHT)),XXXXXXX ,XXXXXXX,XXXXXXX ,XXXXXXX ,KC_HOME,XXXXXXX,KC_END ,XXXXXXX,KC_RCTL, -_______,_______,_______, _______,_______, MOUSE ,XXXXXXX ,XXXXXXX,BACKLIT -), -/* MOUSE - * ,--------------------------------------------------------------------------. - * | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET | - * |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - * | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | - * |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - * | | | | | | | |M_AC0|M_AC1|M_AC2| |WINDO| - * |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - * | | | | GO_DEFAULT | GO_DEFAULT | | | | MAC | - * `--------------------------------------------------------------------------' - */ -[_MOUSE] = LAYOUT_arrow( -XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,RESET, -XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX,XXXXXXX,KC_BTN1,KC_WH_D,KC_BTN2,XXXXXXX,XXXXXXX, -XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,WINDOW, -XXXXXXX,XXXXXXX,XXXXXXX, EXT_MOUSE,EXT_MOUSE, XXXXXXX,XXXXXXX,XXXXXXX,MAC -) -}; - -const uint16_t PROGMEM fn_actions[] = { - [_LOWER] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), - [_RAISE] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC) -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch(keycode) { - case WINDOW: - if (record->event.pressed) { - set_single_persistent_default_layer(_WINDOW); - } - return false; - break; - case MAC: - if (record->event.pressed) { - set_single_persistent_default_layer(_MAC); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } - return false; - break; - case MOUSE: - if (record->event.pressed) { - layer_on(_MOUSE); - } - return false; - break; - case EXT_MOUSE: - if (record->event.pressed) { - layer_off(_MOUSE); - layer_off(_WINDOW_SHORTCUT); - layer_off(_MAC_SHORTCUT); - } - return false; - break; - } - return true; -}; - diff --git a/keyboards/tv44/keymaps/tong92/readme.md b/keyboards/tv44/keymaps/tong92/readme.md deleted file mode 100644 index 8208572568..0000000000 --- a/keyboards/tv44/keymaps/tong92/readme.md +++ /dev/null @@ -1,52 +0,0 @@ -# The tong92's keymap for tv44 - -- Arrow Layout (45key) -- my keymap for Window User -- Mouse Layer : space -> Default Layer - -## Qwerty - ,--------------------------------------------------------------------------. - | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - | Ctrl | A | S | D | F | G | H | J | K | L | ; | Enter| - |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - | Shift | Z | X | C | V | B | N | M | , | . | / |Shift| - |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - | Ftn1 | GUI | Alt | Space/LOWER | Space/RAISE | ' | [ | ] | Alt | - `--------------------------------------------------------------------------' - - -## RAISE - ,--------------------------------------------------------------------------. - | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | - |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | { | } | | | - |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - | | F7 | F8 | F9 | F10 | F11 | F12 | | HOME| PgUp| UP | PgDo| - |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - | | | | | | END | LEFT| Down|RIGHT| - `--------------------------------------------------------------------------' - - -## FTN - ,--------------------------------------------------------------------------. - | ESC |WinOf|WinUp| | |Sh+Ca| | PgUp| UP | PgDo|PrtSc| DELET | - |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - | |WinLe|WinDo|WinRi| |Al+Ca|CapsL| LEFT| DOWN|RIGHT| | | - |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - | |WinLW|WinRW| | |Ct+Ca|ScroL| HOME| | END | | Ctrl| - |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - | | DeskL | DeskR| Task Manager| DeskX | MOUSE| | | LED | - `--------------------------------------------------------------------------' - - -## MOUSE - ,--------------------------------------------------------------------------. - | | | |Mo_Up| | | |M_WhL|M_WhU|M_WhR| | RESET | - |------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-------| - | | |Mo_Le|Mo_Do|Mo_Ri| | |M_Bt1|M_WhD|M_Bt2| | | - |-------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`------| - | | | | | | | |M_AC0|M_AC1|M_AC2| | | - |--------`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----`-----| - | | | | GO_DEFAULT | GO_DEFAULT | | | | | - `--------------------------------------------------------------------------' diff --git a/keyboards/tv44/keymaps/tong92/rules.mk b/keyboards/tv44/keymaps/tong92/rules.mk deleted file mode 100644 index e60e3c5c5a..0000000000 --- a/keyboards/tv44/keymaps/tong92/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/config.h b/keyboards/tv44/keymaps/xyverz/config.h deleted file mode 100644 index df06a26206..0000000000 --- a/keyboards/tv44/keymaps/xyverz/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/keymap.c b/keyboards/tv44/keymaps/xyverz/keymap.c deleted file mode 100644 index bbdb9093e1..0000000000 --- a/keyboards/tv44/keymaps/xyverz/keymap.c +++ /dev/null @@ -1,126 +0,0 @@ -#include "tv44.h" -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; - -enum planck_layers { - _QWERTY, - _COLEMAK, - _DVORAK, - _LOWER, - _RAISE, - _ADJUST -}; - -enum planck_keycodes { - DVORAK = SAFE_RANGE, - QWERTY, - COLEMAK, - LOWER, - RAISE, - ADJUST -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -// Aliases for some other things I want to try out -#define RAI_ESC LT(_RAISE, KC_ESC) -#define LOW_QUQ LT(_LOWER, KC_QUOT) -#define LOW_MIN LT(_LOWER, KC_MINS) // Same as above, but for Dvorak layer -#define GUIBSPC GUI_T(KC_BSPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DVORAK] = LAYOUT( /* 0: Dvorak */ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, - RAI_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, LOW_MIN, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, - KC_LCTL, KC_LALT, LOWER, GUIBSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT - ), - - [_QWERTY] = LAYOUT( /* 1: Qwerty */ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - RAI_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LOW_QUQ, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT - ), - - [_COLEMAK] = LAYOUT( /* 2: Colemak */ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - RAI_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, LOW_QUQ, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, - KC_LCTL, KC_LALT, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LGUI, KC_ENT - ), - - [_LOWER] = LAYOUT( /* 1: FN 1 */ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, - KC_LEFT, KC_RGHT, _______, KC_DEL, KC_INS, _______, KC_UP, KC_DOWN - ), - - [_RAISE] = LAYOUT( /* 2: FN 2 */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSLS, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_CAPS, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, - KC_LEFT, KC_RGHT, _______, KC_DEL, KC_INS, _______, KC_UP, KC_DOWN - ), - - [_ADJUST] = LAYOUT( - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, - _______, RESET, _______, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_HOME, KC_END, _______, _______, _______, _______, KC_PGUP, KC_PGDN - ) -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/tv44/keymaps/xyverz/readme.md b/keyboards/tv44/keymaps/xyverz/readme.md deleted file mode 100644 index ac84c08cfa..0000000000 --- a/keyboards/tv44/keymaps/xyverz/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for tv44 \ No newline at end of file diff --git a/keyboards/tv44/keymaps/xyverz/rules.mk b/keyboards/tv44/keymaps/xyverz/rules.mk deleted file mode 100644 index f4671a9d11..0000000000 --- a/keyboards/tv44/keymaps/xyverz/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/tv44/readme.md b/keyboards/tv44/readme.md deleted file mode 100644 index 28185f455b..0000000000 --- a/keyboards/tv44/readme.md +++ /dev/null @@ -1,14 +0,0 @@ -The Van 44 -========== - -A compact 44% keyboard. - -Keyboard Maintainer: QMK Community -Hardware Supported: The Van PCB -Hardware Availability: https://thevankeyboards.com/collections/catalog/products/minivan-diy?variant=609138376718 - -Make example for this keyboard (after setting up your build environment): - - make tv44:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/tv44/rules.mk b/keyboards/tv44/rules.mk deleted file mode 100644 index 786c9dc3e7..0000000000 --- a/keyboards/tv44/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ - - -# MCU name -#MCU = at90usb1287 -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 - - -# Boot Section Size in *bytes* -# 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 = yes # 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 -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 diff --git a/keyboards/tv44/tv44.c b/keyboards/tv44/tv44.c deleted file mode 100644 index 6dc0efd28e..0000000000 --- a/keyboards/tv44/tv44.c +++ /dev/null @@ -1,28 +0,0 @@ -#include "tv44.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/tv44/tv44.h b/keyboards/tv44/tv44.h deleted file mode 100644 index aea6179d9e..0000000000 --- a/keyboards/tv44/tv44.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef TV44_H -#define TV44_H - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. -// There are a number of variations depending on the layout of your bottom row. -// The arrow variant adds an additional key on the bottom-right, while the -// command variant adds an additional key on the bottom-left. arrow-command is a -// combination of both of those, having an additional key on both sides. -// -// Please note that the numbering of the macro arguments are based on the -// numbers of the keys on the PCB. - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K37, K38, K39, K3B \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ - { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, KC_NO, K3B } \ -} - -#define LAYOUT_arrow( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K32, K33, K37, K38, K39, K3A, K3B \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ - { K30, K31, K32, K33, KC_NO, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ -} - -#define LAYOUT_command( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K34, K32, K33, K37, K38, K39, K3B \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ - { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37, K38, K39, KC_NO, K3B } \ -} - -#define LAYOUT_arrow_command( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K31, K34, K32, K33, K37, K38, K39, K3A, K3B \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B }, \ - { K30, K31, K32, K33, K34, KC_NO, KC_NO, K37, K38, K39, K3A, K3B } \ -} - -#endif -- cgit v1.2.3 From 6d6d91c834ef3415425e21d895d4ec91c67fd4b8 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 14 Sep 2018 02:24:10 +0900 Subject: rgblight.[ch] more configurable (#3582) * add temporary test code rgblight-macro-test1.[ch] * rgblight.h : mode auto numberring and auto generate mode name symbol No change in build result. * rgblight.c use RGBLIGHT_MODE_xxx symbols No change in build result. * quantum.c use RGBLIGHT_MODE_xxx symbols No change in build result. * fix build break. when RGB_MATRIX_ENABLE defined * add temporary test code rgblight-macro-test2.[ch] * modify rgblight_mode_eeprom_helper() and rgblight_sethsv_eeprom_helper() * modify rgblight_task() * configurable each effect compile on/off in config.h * update docs/feature_rgblight.md * fix conflict. docs/feature_rgblight.md * remove temporary test code rgblight-macro-test*.[ch] * fix comment typo. * remove old mode number from comment * update docs/feature_rgblight.md about effect mode * Revert "update docs/feature_rgblight.md about effect mode" This reverts commit 43890663fcc9dda1899df7a37d382fc38b1a6d6d. * some change docs/feature_rgblight.md * fix typo * docs/feature_rgblight.md update: revise mode number table --- docs/feature_rgblight.md | 42 +++++--- quantum/quantum.c | 52 ++++++--- quantum/quantum.h | 6 ++ quantum/rgblight.c | 237 +++++++++++++++++++++++++++--------------- quantum/rgblight.h | 87 +++++++++++++++- quantum/rgblight_reconfig.h | 36 +++++++ tmk_core/common/avr/suspend.c | 1 + tmk_core/protocol/lufa/lufa.c | 1 + 8 files changed, 346 insertions(+), 116 deletions(-) create mode 100644 quantum/rgblight_reconfig.h diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index d48941a04f..925dca724b 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -79,20 +79,23 @@ Your RGB lighting can be configured by placing these `#define`s in your `config. ## Animations -Not only can this lighting be whatever color you want, if `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal: - -|Mode |Description | -|-----|---------------------| -|1 |Solid color | -|2-5 |Solid color breathing| -|6-8 |Cycling rainbow | -|9-14 |Swirling rainbow | -|15-20|Snake | -|21-23|Knight | -|24 |Christmas | -|25-34|Static gradient | -|35 |RGB Test | -|36 |Alternating | + +Not only can this lighting be whatever color you want, +if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a number of animation modes at your disposal: + +|Mode number symbol |Additional number |Description | +|-----------------------------|-------------------|---------------------------------------| +|`RGBLIGHT_MODE_STATIC_LIGHT` | *None* |Solid color (this mode is always enabled) | +|`RGBLIGHT_MODE_BREATHING` | 0,1,2,3 |Solid color breathing | +|`RGBLIGHT_MODE_RAINBOW_MOOD` | 0,1,2 |Cycling rainbow | +|`RGBLIGHT_MODE_RAINBOW_SWIRL`| 0,1,2,3,4,5 |Swirling rainbow | +|`RGBLIGHT_MODE_SNAKE` | 0,1,2,3,4,5 |Snake | +|`RGBLIGHT_MODE_KNIGHT` | 0,1,2 |Knight | +|`RGBLIGHT_MODE_CHRISTMAS` | *None* |Christmas | +|`RGBLIGHT_MODE_STATIC_GRADIENT`| 0,1,..,9 |Static gradient | +|`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test | +|`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating | + Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration. @@ -100,7 +103,16 @@ The following options can be used to tweak the various animations: |Define |Default |Description | |------------------------------------|-------------|-------------------------------------------------------------------------------------| -|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables additional animation modes | +|`RGBLIGHT_EFFECT_BREATHING` |*Not defined*|If defined, enable breathing animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_MOOD` |*Not defined*|If defined, enable rainbow mood animation mode. | +|`RGBLIGHT_EFFECT_RAINBOW_SWIRL` |*Not defined*|If defined, enable rainbow swirl animation mode. | +|`RGBLIGHT_EFFECT_SNAKE` |*Not defined*|If defined, enable snake animation mode. | +|`RGBLIGHT_EFFECT_KNIGHT` |*Not defined*|If defined, enable knight animation mode. | +|`RGBLIGHT_EFFECT_CHRISTMAS` |*Not defined*|If defined, enable christmas animation mode. | +|`RGBLIGHT_EFFECT_STATIC_GRADIENT` |*Not defined*|If defined, enable static gradient mode. | +|`RGBLIGHT_EFFECT_RGB_TEST` |*Not defined*|If defined, enable RGB test animation mode. | +|`RGBLIGHT_EFFECT_ALTERNATING` |*Not defined*|If defined, enable alternating animation mode. | +|`RGBLIGHT_ANIMATIONS` |*Not defined*|If defined, enables all additional animation modes | |`RGBLIGHT_EFFECT_BREATHE_CENTER` |`1.85` |Used to calculate the curve for the breathing animation. Valid values are 1.0 to 2.7 | |`RGBLIGHT_EFFECT_BREATHE_MAX` |`255` |The maximum brightness for the breathing mode. Valid values are 1 to 255 | |`RGBLIGHT_EFFECT_SNAKE_LENGTH` |`4` |The number of LEDs to light up for the "Snake" animation | diff --git a/quantum/quantum.c b/quantum/quantum.c index ab47fa48ff..9d352a94cf 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -445,75 +445,97 @@ bool process_record_quantum(keyrecord_t *record) { return false; case RGB_MODE_PLAIN: if (record->event.pressed) { - rgblight_mode(1); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); #ifdef SPLIT_KEYBOARD RGB_DIRTY = true; #endif } return false; case RGB_MODE_BREATHE: + #ifdef RGBLIGHT_EFFECT_BREATHING if (record->event.pressed) { - if ((2 <= rgblight_get_mode()) && (rgblight_get_mode() < 5)) { + if ((RGBLIGHT_MODE_BREATHING <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_BREATHING_end)) { rgblight_step(); } else { - rgblight_mode(2); + rgblight_mode(RGBLIGHT_MODE_BREATHING); } } + #endif return false; case RGB_MODE_RAINBOW: + #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD if (record->event.pressed) { - if ((6 <= rgblight_get_mode()) && (rgblight_get_mode() < 8)) { + if ((RGBLIGHT_MODE_RAINBOW_MOOD <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_RAINBOW_MOOD_end)) { rgblight_step(); } else { - rgblight_mode(6); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); } } + #endif return false; case RGB_MODE_SWIRL: + #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL if (record->event.pressed) { - if ((9 <= rgblight_get_mode()) && (rgblight_get_mode() < 14)) { + if ((RGBLIGHT_MODE_RAINBOW_SWIRL <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_RAINBOW_SWIRL_end)) { rgblight_step(); } else { - rgblight_mode(9); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); } } + #endif return false; case RGB_MODE_SNAKE: + #ifdef RGBLIGHT_EFFECT_SNAKE if (record->event.pressed) { - if ((15 <= rgblight_get_mode()) && (rgblight_get_mode() < 20)) { + if ((RGBLIGHT_MODE_SNAKE <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_SNAKE_end)) { rgblight_step(); } else { - rgblight_mode(15); + rgblight_mode(RGBLIGHT_MODE_SNAKE); } } + #endif return false; case RGB_MODE_KNIGHT: + #ifdef RGBLIGHT_EFFECT_KNIGHT if (record->event.pressed) { - if ((21 <= rgblight_get_mode()) && (rgblight_get_mode() < 23)) { + if ((RGBLIGHT_MODE_KNIGHT <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_KNIGHT_end)) { rgblight_step(); } else { - rgblight_mode(21); + rgblight_mode(RGBLIGHT_MODE_KNIGHT); } } + #endif return false; case RGB_MODE_XMAS: + #ifdef RGBLIGHT_EFFECT_CHRISTMAS if (record->event.pressed) { - rgblight_mode(24); + rgblight_mode(RGBLIGHT_MODE_CHRISTMAS); } + #endif return false; case RGB_MODE_GRADIENT: + #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT if (record->event.pressed) { - if ((25 <= rgblight_get_mode()) && (rgblight_get_mode() < 34)) { + if ((RGBLIGHT_MODE_STATIC_GRADIENT <= rgblight_get_mode()) && + (rgblight_get_mode() < RGBLIGHT_MODE_STATIC_GRADIENT_end)) { rgblight_step(); } else { - rgblight_mode(25); + rgblight_mode(RGBLIGHT_MODE_STATIC_GRADIENT); } } + #endif return false; case RGB_MODE_RGBTEST: + #ifdef RGBLIGHT_EFFECT_RGB_TEST if (record->event.pressed) { - rgblight_mode(35); + rgblight_mode(RGBLIGHT_MODE_RGB_TEST); } + #endif return false; #endif // defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) #ifdef PROTOCOL_LUFA diff --git a/quantum/quantum.h b/quantum/quantum.h index b4e4de1743..d1f761f17a 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -32,6 +32,12 @@ #endif #ifdef RGBLIGHT_ENABLE #include "rgblight.h" +#else + #ifdef RGB_MATRIX_ENABLE + /* dummy define RGBLIGHT_MODE_xxxx */ + #define RGBLIGHT_H_DUMMY_DEFINE + #include "rgblight.h" + #endif #endif #ifdef SPLIT_KEYBOARD diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 4919ae4abf..03f77cc80d 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -14,6 +14,7 @@ * along with this program. If not, see . */ #include +#include #ifdef __AVR__ #include #include @@ -29,23 +30,27 @@ #define RGBLIGHT_LIMIT_VAL 255 #endif +#define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_SINGLE_DYNAMIC(sym) +#define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI_DYNAMIC(sym) +#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_DYNAMIC(sym) +static uint8_t static_effect_table [] = { +#include "rgblight.h" +}; + +static inline int is_static_effect(uint8_t mode) { + return memchr(static_effect_table, mode, sizeof(static_effect_table)) != NULL; +} + #define MIN(a,b) (((a)<(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b)) -__attribute__ ((weak)) -const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; -__attribute__ ((weak)) -const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; -__attribute__ ((weak)) -const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; -__attribute__ ((weak)) -const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; -__attribute__ ((weak)) -const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT __attribute__ ((weak)) const uint16_t RGBLED_GRADIENT_RANGES[] PROGMEM = {360, 240, 180, 120, 90}; -__attribute__ ((weak)) -const uint16_t RGBLED_RGBTEST_INTERVALS[] PROGMEM = {1024}; +#endif rgblight_config_t rgblight_config; @@ -129,7 +134,7 @@ void eeconfig_update_rgblight(uint32_t val) { void eeconfig_update_rgblight_default(void) { //dprintf("eeconfig_update_rgblight_default\n"); rgblight_config.enable = 1; - rgblight_config.mode = 1; + rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; rgblight_config.hue = 0; rgblight_config.sat = 255; rgblight_config.val = RGBLIGHT_LIMIT_VAL; @@ -163,9 +168,9 @@ void rgblight_init(void) { } eeconfig_debug_rgblight(); // display current eeprom values - #ifdef RGBLIGHT_ANIMATIONS +#ifdef RGBLIGHT_USE_TIMER rgblight_timer_init(); // setup the timer - #endif +#endif if (rgblight_config.enable) { rgblight_mode_noeeprom(rgblight_config.mode); @@ -178,9 +183,9 @@ void rgblight_update_dword(uint32_t dword) { if (rgblight_config.enable) rgblight_mode(rgblight_config.mode); else { - #ifdef RGBLIGHT_ANIMATIONS +#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); - #endif +#endif rgblight_set(); } } @@ -195,7 +200,7 @@ void rgblight_increase(void) { void rgblight_decrease(void) { uint8_t mode = 0; // Mode will never be < 1. If it ever is, eeprom needs to be initialized. - if (rgblight_config.mode > 1) { + if (rgblight_config.mode > RGBLIGHT_MODE_STATIC_LIGHT) { mode = rgblight_config.mode - 1; } rgblight_mode(mode); @@ -229,8 +234,8 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { if (!rgblight_config.enable) { return; } - if (mode < 1) { - rgblight_config.mode = 1; + if (mode < RGBLIGHT_MODE_STATIC_LIGHT) { + rgblight_config.mode = RGBLIGHT_MODE_STATIC_LIGHT; } else if (mode > RGBLIGHT_MODES) { rgblight_config.mode = RGBLIGHT_MODES; } else { @@ -242,30 +247,14 @@ void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { } else { xprintf("rgblight mode [NOEEPROM]: %u\n", rgblight_config.mode); } - if (rgblight_config.mode == 1) { - #ifdef RGBLIGHT_ANIMATIONS + if( is_static_effect(rgblight_config.mode) ) { +#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); - #endif - } else if ((rgblight_config.mode >= 2 && rgblight_config.mode <= 24) || - rgblight_config.mode == 35 || rgblight_config.mode == 36) { - // MODE 2-5, breathing - // MODE 6-8, rainbow mood - // MODE 9-14, rainbow swirl - // MODE 15-20, snake - // MODE 21-23, knight - // MODE 24, xmas - // MODE 35 RGB test - // MODE 36, alterating - - #ifdef RGBLIGHT_ANIMATIONS +#endif + } else { +#ifdef RGBLIGHT_USE_TIMER rgblight_timer_enable(); - #endif - } else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) { - // MODE 25-34, static gradient - - #ifdef RGBLIGHT_ANIMATIONS - rgblight_timer_disable(); - #endif +#endif } rgblight_sethsv_noeeprom(rgblight_config.hue, rgblight_config.sat, rgblight_config.val); } @@ -317,9 +306,9 @@ void rgblight_disable(void) { rgblight_config.enable = 0; eeconfig_update_rgblight(rgblight_config.raw); xprintf("rgblight disable [EEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); - #ifdef RGBLIGHT_ANIMATIONS - rgblight_timer_disable(); - #endif +#ifdef RGBLIGHT_USE_TIMER + rgblight_timer_disable(); +#endif wait_ms(50); rgblight_set(); } @@ -327,9 +316,9 @@ void rgblight_disable(void) { void rgblight_disable_noeeprom(void) { rgblight_config.enable = 0; xprintf("rgblight disable [noEEPROM]: rgblight_config.enable = %u\n", rgblight_config.enable); - #ifdef RGBLIGHT_ANIMATIONS +#ifdef RGBLIGHT_USE_TIMER rgblight_timer_disable(); - #endif +#endif _delay_ms(50); rgblight_set(); } @@ -419,24 +408,43 @@ void rgblight_sethsv_noeeprom_old(uint16_t hue, uint8_t sat, uint8_t val) { void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { if (rgblight_config.enable) { - if (rgblight_config.mode == 1) { + if (rgblight_config.mode == RGBLIGHT_MODE_STATIC_LIGHT) { // same static color LED_TYPE tmp_led; sethsv(hue, sat, val, &tmp_led); rgblight_setrgb(tmp_led.r, tmp_led.g, tmp_led.b); } else { // all LEDs in same color - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { + if ( 1 == 0 ) { //dummy + } +#ifdef RGBLIGHT_EFFECT_BREATHING + else if (rgblight_config.mode >= RGBLIGHT_MODE_BREATHING && + rgblight_config.mode <= RGBLIGHT_MODE_BREATHING_end) { // breathing mode, ignore the change of val, use in memory value instead val = rgblight_config.val; - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 14) { - // rainbow mood and rainbow swirl, ignore the change of hue + } +#endif +#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD + else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_MOOD && + rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_MOOD_end) { + // rainbow mood, ignore the change of hue + hue = rgblight_config.hue; + } +#endif +#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL + else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_SWIRL && + rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_SWIRL_end) { + // rainbow swirl, ignore the change of hue hue = rgblight_config.hue; - } else if (rgblight_config.mode >= 25 && rgblight_config.mode <= 34) { + } +#endif +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT + else if (rgblight_config.mode >= RGBLIGHT_MODE_STATIC_GRADIENT && + rgblight_config.mode <= RGBLIGHT_MODE_STATIC_GRADIENT_end) { // static gradient uint16_t _hue; - int8_t direction = ((rgblight_config.mode - 25) % 2) ? -1 : 1; - uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[(rgblight_config.mode - 25) / 2]); + int8_t direction = ((rgblight_config.mode - RGBLIGHT_MODE_STATIC_GRADIENT) % 2) ? -1 : 1; + uint16_t range = pgm_read_word(&RGBLED_GRADIENT_RANGES[(rgblight_config.mode - RGBLIGHT_MODE_STATIC_GRADIENT) / 2]); for (uint8_t i = 0; i < RGBLED_NUM; i++) { _hue = (range / RGBLED_NUM * i * direction + hue + 360) % 360; dprintf("rgblight rainbow set hsv: %u,%u,%d,%u\n", i, _hue, direction, range); @@ -444,6 +452,7 @@ void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool } rgblight_set(); } +#endif } rgblight_config.hue = hue; rgblight_config.sat = sat; @@ -528,7 +537,7 @@ void rgblight_set(void) { } #endif -#ifdef RGBLIGHT_ANIMATIONS +#ifdef RGBLIGHT_USE_TIMER // Animation timer -- AVR Timer3 void rgblight_timer_init(void) { @@ -564,41 +573,77 @@ void rgblight_timer_toggle(void) { void rgblight_show_solid_color(uint8_t r, uint8_t g, uint8_t b) { rgblight_enable(); - rgblight_mode(1); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); rgblight_setrgb(r, g, b); } void rgblight_task(void) { if (rgblight_timer_enabled) { - // mode = 1, static light, do nothing here - if (rgblight_config.mode >= 2 && rgblight_config.mode <= 5) { - // mode = 2 to 5, breathing mode - rgblight_effect_breathing(rgblight_config.mode - 2); - } else if (rgblight_config.mode >= 6 && rgblight_config.mode <= 8) { - // mode = 6 to 8, rainbow mood mod - rgblight_effect_rainbow_mood(rgblight_config.mode - 6); - } else if (rgblight_config.mode >= 9 && rgblight_config.mode <= 14) { - // mode = 9 to 14, rainbow swirl mode - rgblight_effect_rainbow_swirl(rgblight_config.mode - 9); - } else if (rgblight_config.mode >= 15 && rgblight_config.mode <= 20) { - // mode = 15 to 20, snake mode - rgblight_effect_snake(rgblight_config.mode - 15); - } else if (rgblight_config.mode >= 21 && rgblight_config.mode <= 23) { - // mode = 21 to 23, knight mode - rgblight_effect_knight(rgblight_config.mode - 21); - } else if (rgblight_config.mode == 24) { - // mode = 24, christmas mode + // static light mode, do nothing here + if ( 1 == 0 ) { //dummy + } +#ifdef RGBLIGHT_EFFECT_BREATHING + else if (rgblight_config.mode >= RGBLIGHT_MODE_BREATHING && + rgblight_config.mode <= RGBLIGHT_MODE_BREATHING_end) { + // breathing mode + rgblight_effect_breathing(rgblight_config.mode - RGBLIGHT_MODE_BREATHING ); + } +#endif +#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD + else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_MOOD && + rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_MOOD_end) { + // rainbow mood mode + rgblight_effect_rainbow_mood(rgblight_config.mode - RGBLIGHT_MODE_RAINBOW_MOOD); + } +#endif +#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL + else if (rgblight_config.mode >= RGBLIGHT_MODE_RAINBOW_SWIRL && + rgblight_config.mode <= RGBLIGHT_MODE_RAINBOW_SWIRL_end) { + // rainbow swirl mode + rgblight_effect_rainbow_swirl(rgblight_config.mode - RGBLIGHT_MODE_RAINBOW_SWIRL); + } +#endif +#ifdef RGBLIGHT_EFFECT_SNAKE + else if (rgblight_config.mode >= RGBLIGHT_MODE_SNAKE && + rgblight_config.mode <= RGBLIGHT_MODE_SNAKE_end) { + // snake mode + rgblight_effect_snake(rgblight_config.mode - RGBLIGHT_MODE_SNAKE); + } +#endif +#ifdef RGBLIGHT_EFFECT_KNIGHT + else if (rgblight_config.mode >= RGBLIGHT_MODE_KNIGHT && + rgblight_config.mode <= RGBLIGHT_MODE_KNIGHT_end) { + // knight mode + rgblight_effect_knight(rgblight_config.mode - RGBLIGHT_MODE_KNIGHT); + } +#endif +#ifdef RGBLIGHT_EFFECT_CHRISTMAS + else if (rgblight_config.mode == RGBLIGHT_MODE_CHRISTMAS) { + // christmas mode rgblight_effect_christmas(); - } else if (rgblight_config.mode == 35) { - // mode = 35, RGB test + } +#endif +#ifdef RGBLIGHT_EFFECT_RGB_TEST + else if (rgblight_config.mode == RGBLIGHT_MODE_RGB_TEST) { + // RGB test mode rgblight_effect_rgbtest(); - } else if (rgblight_config.mode == 36){ + } +#endif +#ifdef RGBLIGHT_EFFECT_ALTERNATING + else if (rgblight_config.mode == RGBLIGHT_MODE_ALTERNATING){ rgblight_effect_alternating(); } +#endif } } +#endif /* RGBLIGHT_USE_TIMER */ + // Effects +#ifdef RGBLIGHT_EFFECT_BREATHING +__attribute__ ((weak)) +const uint8_t RGBLED_BREATHING_INTERVALS[] PROGMEM = {30, 20, 10, 5}; + void rgblight_effect_breathing(uint8_t interval) { static uint8_t pos = 0; static uint16_t last_timer = 0; @@ -609,12 +654,17 @@ void rgblight_effect_breathing(uint8_t interval) { } last_timer = timer_read(); - // http://sean.voisen.org/blog/2011/10/breathing-led-with-arduino/ val = (exp(sin((pos/255.0)*M_PI)) - RGBLIGHT_EFFECT_BREATHE_CENTER/M_E)*(RGBLIGHT_EFFECT_BREATHE_MAX/(M_E-1/M_E)); rgblight_sethsv_noeeprom_old(rgblight_config.hue, rgblight_config.sat, val); pos = (pos + 1) % 256; } +#endif + +#ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD +__attribute__ ((weak)) +const uint8_t RGBLED_RAINBOW_MOOD_INTERVALS[] PROGMEM = {120, 60, 30}; + void rgblight_effect_rainbow_mood(uint8_t interval) { static uint16_t current_hue = 0; static uint16_t last_timer = 0; @@ -626,6 +676,12 @@ void rgblight_effect_rainbow_mood(uint8_t interval) { rgblight_sethsv_noeeprom_old(current_hue, rgblight_config.sat, rgblight_config.val); current_hue = (current_hue + 1) % 360; } +#endif + +#ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL +__attribute__ ((weak)) +const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; + void rgblight_effect_rainbow_swirl(uint8_t interval) { static uint16_t current_hue = 0; static uint16_t last_timer = 0; @@ -651,6 +707,12 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) { } } } +#endif + +#ifdef RGBLIGHT_EFFECT_SNAKE +__attribute__ ((weak)) +const uint8_t RGBLED_SNAKE_INTERVALS[] PROGMEM = {100, 50, 20}; + void rgblight_effect_snake(uint8_t interval) { static uint8_t pos = 0; static uint16_t last_timer = 0; @@ -689,6 +751,12 @@ void rgblight_effect_snake(uint8_t interval) { pos = (pos + 1) % RGBLED_NUM; } } +#endif + +#ifdef RGBLIGHT_EFFECT_KNIGHT +__attribute__ ((weak)) +const uint8_t RGBLED_KNIGHT_INTERVALS[] PROGMEM = {127, 63, 31}; + void rgblight_effect_knight(uint8_t interval) { static uint16_t last_timer = 0; if (timer_elapsed(last_timer) < pgm_read_byte(&RGBLED_KNIGHT_INTERVALS[interval])) { @@ -730,8 +798,9 @@ void rgblight_effect_knight(uint8_t interval) { increment = -increment; } } +#endif - +#ifdef RGBLIGHT_EFFECT_CHRISTMAS void rgblight_effect_christmas(void) { static uint16_t current_offset = 0; static uint16_t last_timer = 0; @@ -748,6 +817,11 @@ void rgblight_effect_christmas(void) { } rgblight_set(); } +#endif + +#ifdef RGBLIGHT_EFFECT_RGB_TEST +__attribute__ ((weak)) +const uint16_t RGBLED_RGBTEST_INTERVALS[] PROGMEM = {1024}; void rgblight_effect_rgbtest(void) { static uint8_t pos = 0; @@ -774,7 +848,9 @@ void rgblight_effect_rgbtest(void) { rgblight_setrgb(r, g, b); pos = (pos + 1) % 3; } +#endif +#ifdef RGBLIGHT_EFFECT_ALTERNATING void rgblight_effect_alternating(void){ static uint16_t last_timer = 0; static uint16_t pos = 0; @@ -795,5 +871,4 @@ void rgblight_effect_alternating(void){ rgblight_set(); pos = (pos + 1) % 2; } - -#endif /* RGBLIGHT_ANIMATIONS */ +#endif diff --git a/quantum/rgblight.h b/quantum/rgblight.h index ba010dfae3..d1e00eef31 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -16,11 +16,23 @@ #ifndef RGBLIGHT_H #define RGBLIGHT_H -#ifdef RGBLIGHT_ANIMATIONS - #define RGBLIGHT_MODES 36 -#else - #define RGBLIGHT_MODES 1 -#endif +#include "rgblight_reconfig.h" + +#define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_MULTI_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_STATIC(sym) RGBLIGHT_MODE_ ## sym, +#define _RGBM_TMP_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, +enum RGBLIGHT_EFFECT_MODE { + RGBLIGHT_MODE_zero = 0, +#include "rgblight.h" + RGBLIGHT_MODE_last +}; + +#ifndef RGBLIGHT_H_DUMMY_DEFINE + +#define RGBLIGHT_MODES (RGBLIGHT_MODE_last-1) #ifndef RGBLIGHT_EFFECT_BREATHE_CENTER #define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1-2.7 @@ -168,4 +180,69 @@ void rgblight_effect_christmas(void); void rgblight_effect_rgbtest(void); void rgblight_effect_alternating(void); +#endif // #ifndef RGBLIGHT_H_DUMMY_DEFINE +#endif // RGBLIGHT_H + +#ifdef _RGBM_SINGLE_STATIC + _RGBM_SINGLE_STATIC( STATIC_LIGHT ) + #ifdef RGBLIGHT_EFFECT_BREATHING + _RGBM_MULTI_DYNAMIC( BREATHING ) + _RGBM_TMP_DYNAMIC( breathing_3 ) + _RGBM_TMP_DYNAMIC( breathing_4 ) + _RGBM_TMP_DYNAMIC( BREATHING_end ) + #endif + #ifdef RGBLIGHT_EFFECT_RAINBOW_MOOD + _RGBM_MULTI_DYNAMIC( RAINBOW_MOOD ) + _RGBM_TMP_DYNAMIC( rainbow_mood_7 ) + _RGBM_TMP_DYNAMIC( RAINBOW_MOOD_end ) + #endif + #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL + _RGBM_MULTI_DYNAMIC( RAINBOW_SWIRL ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_10 ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_11 ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_12 ) + _RGBM_TMP_DYNAMIC( rainbow_swirl_13 ) + _RGBM_TMP_DYNAMIC( RAINBOW_SWIRL_end ) + #endif + #ifdef RGBLIGHT_EFFECT_SNAKE + _RGBM_MULTI_DYNAMIC( SNAKE ) + _RGBM_TMP_DYNAMIC( snake_16 ) + _RGBM_TMP_DYNAMIC( snake_17 ) + _RGBM_TMP_DYNAMIC( snake_18 ) + _RGBM_TMP_DYNAMIC( snake_19 ) + _RGBM_TMP_DYNAMIC( SNAKE_end ) + #endif + #ifdef RGBLIGHT_EFFECT_KNIGHT + _RGBM_MULTI_DYNAMIC( KNIGHT ) + _RGBM_TMP_DYNAMIC( knight_22 ) + _RGBM_TMP_DYNAMIC( KNIGHT_end ) + #endif + #ifdef RGBLIGHT_EFFECT_CHRISTMAS + _RGBM_SINGLE_DYNAMIC( CHRISTMAS ) + #endif + #ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT + _RGBM_MULTI_STATIC( STATIC_GRADIENT ) + _RGBM_TMP_STATIC( static_gradient_26 ) + _RGBM_TMP_STATIC( static_gradient_27 ) + _RGBM_TMP_STATIC( static_gradient_28 ) + _RGBM_TMP_STATIC( static_gradient_29 ) + _RGBM_TMP_STATIC( static_gradient_30 ) + _RGBM_TMP_STATIC( static_gradient_31 ) + _RGBM_TMP_STATIC( static_gradient_32 ) + _RGBM_TMP_STATIC( static_gradient_33 ) + _RGBM_TMP_STATIC( STATIC_GRADIENT_end ) + #endif + #ifdef RGBLIGHT_EFFECT_RGB_TEST + _RGBM_SINGLE_DYNAMIC( RGB_TEST ) + #endif + #ifdef RGBLIGHT_EFFECT_ALTERNATING + _RGBM_SINGLE_DYNAMIC( ALTERNATING ) + #endif #endif + +#undef _RGBM_SINGLE_STATIC +#undef _RGBM_SINGLE_DYNAMIC +#undef _RGBM_MULTI_STATIC +#undef _RGBM_MULTI_DYNAMIC +#undef _RGBM_TMP_STATIC +#undef _RGBM_TMP_DYNAMIC diff --git a/quantum/rgblight_reconfig.h b/quantum/rgblight_reconfig.h new file mode 100644 index 0000000000..11bd4fd118 --- /dev/null +++ b/quantum/rgblight_reconfig.h @@ -0,0 +1,36 @@ +#ifndef RGBLIGHT_RECONFIG_H +#define RGBLIGHT_RECONFIG_H + +#ifdef RGBLIGHT_ANIMATIONS + // for backward compatibility + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST + #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#ifdef RGBLIGHT_STATIC_PATTERNS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT +#endif + +// check dynamic animation effects chose ? +#if defined(RGBLIGHT_EFFECT_BREATHING) || \ + defined(RGBLIGHT_EFFECT_RAINBOW_MOOD) || \ + defined(RGBLIGHT_EFFECT_RAINBOW_SWIRL) || \ + defined(RGBLIGHT_EFFECT_SNAKE) || \ + defined(RGBLIGHT_EFFECT_KNIGHT) || \ + defined(RGBLIGHT_EFFECT_CHRISTMAS) || \ + defined(RGBLIGHT_EFFECT_RGB_TEST) || \ + defined(RGBLIGHT_EFFECT_ALTERNATING) + #define RGBLIGHT_USE_TIMER + #ifndef RGBLIGHT_ANIMATIONS + #define RGBLIGHT_ANIMATIONS // for backward compatibility + #endif +#endif + +#endif // RGBLIGHT_RECONFIG_H diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 73fdda6cc0..d7a7f049c7 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -10,6 +10,7 @@ #include "timer.h" #include "led.h" #include "host.h" +#include "rgblight_reconfig.h" #ifdef PROTOCOL_LUFA #include "lufa.h" diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index cb918d3dce..95e0b95b2f 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -54,6 +54,7 @@ #include "quantum.h" #include #include "outputselect.h" +#include "rgblight_reconfig.h" #ifdef NKRO_ENABLE #include "keycode_config.h" -- cgit v1.2.3 From 170de1273cde78d93b3f955aca133a4d690742b2 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 13 Sep 2018 11:22:05 -0700 Subject: Add an easy way to create new keymaps for your favorite keyboard (#3868) * initial commit of keymap creation script * create default keymap * pass shellcheck * provide a better usage message * change printf string to more accurately reflect the path * make it more easily understood * found another typo * add documentation regarding the new_keymap script * enforce lowercase for userinputs --- docs/newbs_building_firmware.md | 14 ++++++++++++++ util/new_keymap.sh | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100755 util/new_keymap.sh diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index f227d623f0..ac6bff2bc7 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -22,6 +22,20 @@ Start by navigating to the `keymaps` folder for your keyboard. Once you have the `keymaps` folder open you will want to create a copy of the `default` folder. We highly recommend you name your folder the same as your GitHub username, but you can use any name you want as long as it contains only lower case letters, numbers, and the underscore character. +To automate the process, you also have the option to run the `new_keymap.sh` script. + +Navigate to the `qmk_firmware/util` directory and type the following: + +``` +./new_keymap.sh +``` + +For example, for a user named John, trying to make a new keymap for the 1up60hse, they would type in + +``` +./new_keymap.sh 1upkeyboards/1up60hse john +``` + ## Open `keymap.c` In Your Favorite Text Editor Open up your `keymap.c`. Inside this file you'll find the structure that controls how your keyboard behaves. At the top of `keymap.c` there may be some defines and enums that make the keymap easier to read. Farther down you'll find a line that looks like this: diff --git a/util/new_keymap.sh b/util/new_keymap.sh new file mode 100755 index 0000000000..b09f3dd0ca --- /dev/null +++ b/util/new_keymap.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# Script to make a new keymap for a keyboard of your choosing +# This script automates the copying of the default keymap into +# your own keymap + +KB_PATH=$(echo "$1" | tr 'A-Z' 'a-z') +USERNAME=$(echo "$2" | tr 'A-Z' 'a-z') + +if [ -z "$KB_PATH" ]; then + printf "Usage: %s \n" "$0" + printf "Example: %s 1upkeyboards/1up60hse yourname\n" "$0" + exit 1 +fi + +if [ -z "$USERNAME" ]; then + printf "Usage: %s \n" "$0" + printf "Example: %s 1upkeyboards/1up60hse yourname\n" "$0" + exit 1 +fi + +cd .. + +if [ ! -d "keyboards/$KB_PATH" ]; then + printf "Error! keyboards/%s does not exist!\n" "$KB_PATH" + exit 1 +fi + +if [ -d "keyboards/$KB_PATH/keymaps/$USERNAME" ]; then + printf "Error! keyboards/%s/keymaps/%s already exists!\n" "$KB_PATH" "$USERNAME" + exit 1 +fi + +# Recursively copy the chosen keyboard's default keymap +cp -r keyboards/"$KB_PATH"/keymaps/default keyboards/"$KB_PATH"/keymaps/"$USERNAME" + +printf "%s keymap directory created in: qmk_firmware/keyboards/%s/keymaps/\n\n" "$USERNAME" "$KB_PATH" + +printf "Compile a firmware file with your new keymap by typing: \n" +printf " make %s:%s\n" "$KB_PATH" "$USERNAME" +printf "from the qmk_firmware directory\n" \ No newline at end of file -- cgit v1.2.3 From 48a992f1c037658bbacccefd2709ffdcda8bb345 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 14 Sep 2018 04:37:13 +1000 Subject: Zeal60/Zeal65/M60-A implementation (#3879) * Initial version of zeal60 * WIP * Fixes issue #900 * Adding RGB underglow functionality. Fixed a compile-time conflict caused by enabling RGB underglow functionality. * Refactor RPC protocol * Fix last merge * README for RGB underglow updated. * Additional README changes. * Adding RGBW strip software-based current-limiting functionality. * RGBW current-limiting functionality should be handled by RGBSTRIP_MAX_CURRENT_PER_LIGHT instead. * Updated README to reflect implementation of built-in current limiting. * Keymap readability improvements. * Minor keymap improvements. * Fixed LED driver init sequence, formatting * Dimming implementation tested, working. * Stab LEDs synced with spacebar hits in effects. * RGB underglow tested and functional. Simplified README for RGB underglow. * Undid accidental file deletion from previous merge conflict. Safer values for RGB underglow. * Improved arrow key positions in keymap. * Added functionality to correct uneven RGB underglow. Refactored related code. * Reverted to safer values for underglow. * Changes for v0.3 * Custom LED brightness scaling will take place after current adjustment in order to avoid being overridden. * Create keymap.c Added split backspace and split shift to ISO layout * Create config.h Turned on LEDs for new layout * Fixed bug where left spacebar stabilizer LED (LC06) would adopt color of row above. * Added hhkb_wilba keymap * Update keymap.c * Update keymap.c * Update keymap.c * Added indicators, full param setting via host * Added "mousekey" layout * Added Zeal65 support, factory test mode * Keycode safe range changed, caused bugs * Bumped EEPROM version due to change in QMK keycodes * Disable HHKB "blocked" LEDs if KC_NO in keymap * Added "disable_hhkb_blocker_leds" * Required overridden function for keymaps in EEPROM * Added polar coordinate mapping, effect speed * Force Raw HID interface number to 1 always * Fixed last merge from master * Added effect speed to default keymaps * add BACKLIGHT_ prefix to vars * add BACKLIGHT_ prefix to vars * Keymap speed effect; keymap improvements/fixes Readme updated to match changes * Refactored to use common IS31FL3731/I2C drivers * Fixed make rules, backlight disabled feature * Make split rightshift default for Zeal65 * Added M60-A as a "version" of Zeal60. * Renamed IS31FL3731 driver functions * Fix suspend_wakeup_init_kb() being defined twice * First pass refactor dynamic keymaps * Updated to changed I2C and ISSI drivers * Refactor zeal_color.* usage to quantum/color.* * Updated Zeal65, fixed dynamic_keymap * Major refactoring of Zeal60 backlight and API * Lots of little cleanups * Added readme.md * Added readme.md * Added LAYOUT_60*() macros, refactored and cleaned up default keymaps * Fix compile error in suspend.c * Added Zeal65 LAYOUT macros, info.json * Added rama/m60_a, deleted zeal60/keymaps/m60_a * Fixed rama/m60_a/keymaps/proto * Fixed compilation error for suspend.c * Requested changes for PR * Fixed readme.md images * Another readme.md fix * Added drashna's requested changes --- common_features.mk | 5 + keyboards/rama/m60_a/config.h | 128 ++ keyboards/rama/m60_a/info.json | 13 + keyboards/rama/m60_a/keymaps/default/keymap.c | 40 + keyboards/rama/m60_a/keymaps/proto/config.h | 5 + keyboards/rama/m60_a/keymaps/proto/keymap.c | 40 + keyboards/rama/m60_a/m60_a.c | 18 + keyboards/rama/m60_a/m60_a.h | 37 + keyboards/rama/m60_a/readme.md | 15 + keyboards/rama/m60_a/rules.mk | 79 + keyboards/zeal60/config.h | 125 ++ keyboards/zeal60/info.json | 25 + .../zeal60/keymaps/ansi_split_bs_rshift/config.h | 21 + .../zeal60/keymaps/ansi_split_bs_rshift/keymap.c | 38 + keyboards/zeal60/keymaps/default/config.h | 20 + keyboards/zeal60/keymaps/default/keymap.c | 38 + keyboards/zeal60/keymaps/hhkb/config.h | 20 + keyboards/zeal60/keymaps/hhkb/keymap.c | 38 + keyboards/zeal60/keymaps/iso/config.h | 20 + keyboards/zeal60/keymaps/iso/keymap.c | 38 + keyboards/zeal60/keymaps/ryanmaclean/config.h | 21 + keyboards/zeal60/keymaps/ryanmaclean/keymap.c | 84 ++ keyboards/zeal60/keymaps/tusing/Makefile | 6 + keyboards/zeal60/keymaps/tusing/README.md | 80 ++ keyboards/zeal60/keymaps/tusing/config.h | 40 + keyboards/zeal60/keymaps/tusing/keymap.c | 49 + keyboards/zeal60/readme.md | 47 + keyboards/zeal60/rgb_backlight.c | 1519 ++++++++++++++++++++ keyboards/zeal60/rgb_backlight.h | 101 ++ keyboards/zeal60/rgb_backlight_api.h | 42 + keyboards/zeal60/rgb_backlight_keycodes.h | 34 + keyboards/zeal60/rules.mk | 78 + keyboards/zeal60/zeal60.c | 341 +++++ keyboards/zeal60/zeal60.h | 93 ++ keyboards/zeal60/zeal60_api.h | 33 + keyboards/zeal60/zeal60_keycodes.h | 42 + keyboards/zeal65/config.h | 125 ++ keyboards/zeal65/info.json | 16 + keyboards/zeal65/keymaps/default/config.h | 5 + keyboards/zeal65/keymaps/default/keymap.c | 38 + keyboards/zeal65/keymaps/split_bs/config.h | 5 + keyboards/zeal65/keymaps/split_bs/keymap.c | 38 + keyboards/zeal65/readme.md | 16 + keyboards/zeal65/rules.mk | 79 + keyboards/zeal65/zeal65.c | 18 + keyboards/zeal65/zeal65.h | 50 + quantum/dynamic_keymap.c | 97 ++ quantum/dynamic_keymap.h | 31 + tmk_core/common/avr/suspend.c | 37 +- 49 files changed, 3912 insertions(+), 16 deletions(-) create mode 100644 keyboards/rama/m60_a/config.h create mode 100644 keyboards/rama/m60_a/info.json create mode 100644 keyboards/rama/m60_a/keymaps/default/keymap.c create mode 100644 keyboards/rama/m60_a/keymaps/proto/config.h create mode 100644 keyboards/rama/m60_a/keymaps/proto/keymap.c create mode 100644 keyboards/rama/m60_a/m60_a.c create mode 100644 keyboards/rama/m60_a/m60_a.h create mode 100644 keyboards/rama/m60_a/readme.md create mode 100644 keyboards/rama/m60_a/rules.mk create mode 100644 keyboards/zeal60/config.h create mode 100644 keyboards/zeal60/info.json create mode 100644 keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h create mode 100644 keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c create mode 100644 keyboards/zeal60/keymaps/default/config.h create mode 100644 keyboards/zeal60/keymaps/default/keymap.c create mode 100644 keyboards/zeal60/keymaps/hhkb/config.h create mode 100644 keyboards/zeal60/keymaps/hhkb/keymap.c create mode 100644 keyboards/zeal60/keymaps/iso/config.h create mode 100644 keyboards/zeal60/keymaps/iso/keymap.c create mode 100644 keyboards/zeal60/keymaps/ryanmaclean/config.h create mode 100644 keyboards/zeal60/keymaps/ryanmaclean/keymap.c create mode 100644 keyboards/zeal60/keymaps/tusing/Makefile create mode 100644 keyboards/zeal60/keymaps/tusing/README.md create mode 100644 keyboards/zeal60/keymaps/tusing/config.h create mode 100644 keyboards/zeal60/keymaps/tusing/keymap.c create mode 100644 keyboards/zeal60/readme.md create mode 100644 keyboards/zeal60/rgb_backlight.c create mode 100644 keyboards/zeal60/rgb_backlight.h create mode 100644 keyboards/zeal60/rgb_backlight_api.h create mode 100644 keyboards/zeal60/rgb_backlight_keycodes.h create mode 100644 keyboards/zeal60/rules.mk create mode 100644 keyboards/zeal60/zeal60.c create mode 100644 keyboards/zeal60/zeal60.h create mode 100644 keyboards/zeal60/zeal60_api.h create mode 100644 keyboards/zeal60/zeal60_keycodes.h create mode 100644 keyboards/zeal65/config.h create mode 100644 keyboards/zeal65/info.json create mode 100644 keyboards/zeal65/keymaps/default/config.h create mode 100644 keyboards/zeal65/keymaps/default/keymap.c create mode 100644 keyboards/zeal65/keymaps/split_bs/config.h create mode 100644 keyboards/zeal65/keymaps/split_bs/keymap.c create mode 100644 keyboards/zeal65/readme.md create mode 100644 keyboards/zeal65/rules.mk create mode 100644 keyboards/zeal65/zeal65.c create mode 100644 keyboards/zeal65/zeal65.h create mode 100644 quantum/dynamic_keymap.c create mode 100644 quantum/dynamic_keymap.h diff --git a/common_features.mk b/common_features.mk index e0d4ca297c..c637582d45 100644 --- a/common_features.mk +++ b/common_features.mk @@ -227,6 +227,11 @@ ifeq ($(strip $(HD44780_ENABLE)), yes) OPT_DEFS += -DHD44780_ENABLE endif +ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) + OPT_DEFS += -DDYNAMIC_KEYMAP_ENABLE + SRC += $(QUANTUM_DIR)/dynamic_keymap.c +endif + QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h new file mode 100644 index 0000000000..45e7d88963 --- /dev/null +++ b/keyboards/rama/m60_a/config.h @@ -0,0 +1,128 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0xFEED // This is same as Zeal60 for now +#define PRODUCT_ID 0x6060 // This is same as Zeal60 for now +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA M60-A +#define DESCRIPTION RAMA M60-A Keyboard + + + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCING_DELAY 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 + +// key combination for command +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for M60-A specifics +#define RGB_BACKLIGHT_M60_A + +// enable/disable LEDs based on layout +// they aren't really used if RGB_BACKLIGHT_M60_A defined +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011100000000111 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/rama/m60_a/info.json b/keyboards/rama/m60_a/info.json new file mode 100644 index 0000000000..577becd219 --- /dev/null +++ b/keyboards/rama/m60_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "M60-A", + "url": "", + "maintainer": "Wilba", + "bootloader": "DFU", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/rama/m60_a/keymaps/default/keymap.c b/keyboards/rama/m60_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..7b6d9b756c --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/default/keymap.c @@ -0,0 +1,40 @@ +// M60-A layout +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_hhkb( + KC_ESC, 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_BSLS, KC_DEL, + 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_BSPC, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23), + +// Fn1 Layer +[1] = LAYOUT_60_hhkb( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_hhkb( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_hhkb( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + + diff --git a/keyboards/rama/m60_a/keymaps/proto/config.h b/keyboards/rama/m60_a/keymaps/proto/config.h new file mode 100644 index 0000000000..54a185ff19 --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/proto/config.h @@ -0,0 +1,5 @@ +#pragma once + +// This fixes the diodes mounted reversed (fab fail) on M60-A prototype +#undef DIODE_DIRECTION +#define DIODE_DIRECTION ROW2COL diff --git a/keyboards/rama/m60_a/keymaps/proto/keymap.c b/keyboards/rama/m60_a/keymaps/proto/keymap.c new file mode 100644 index 0000000000..7b6d9b756c --- /dev/null +++ b/keyboards/rama/m60_a/keymaps/proto/keymap.c @@ -0,0 +1,40 @@ +// M60-A layout +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_hhkb( + KC_ESC, 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_BSLS, KC_DEL, + 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_BSPC, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23), + +// Fn1 Layer +[1] = LAYOUT_60_hhkb( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_hhkb( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_hhkb( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + + diff --git a/keyboards/rama/m60_a/m60_a.c b/keyboards/rama/m60_a/m60_a.c new file mode 100644 index 0000000000..80a98460d8 --- /dev/null +++ b/keyboards/rama/m60_a/m60_a.c @@ -0,0 +1,18 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ +#ifndef RGB_BACKLIGHT_M60_A +#error RGB_BACKLIGHT_M60_A not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/rama/m60_a/m60_a.h b/keyboards/rama/m60_a/m60_a.h new file mode 100644 index 0000000000..3caab6ac0f --- /dev/null +++ b/keyboards/rama/m60_a/m60_a.h @@ -0,0 +1,37 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" +#include "../../zeal60/rgb_backlight_keycodes.h" +#include "../../zeal60/zeal60_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K41, K42, K47, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ +} + diff --git a/keyboards/rama/m60_a/readme.md b/keyboards/rama/m60_a/readme.md new file mode 100644 index 0000000000..fe54f0163a --- /dev/null +++ b/keyboards/rama/m60_a/readme.md @@ -0,0 +1,15 @@ +# RAMA M60-A + +![RAMA M60-A](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/5aafa6a20e2e7254480b21bf/1535873164793/RAMA-M60-A-03.688.jpg?format=1500w) + +The M60-A represents the benchmark and equilibrium between function and design for us at Rama Works. The gently exaggerated design of the frame is not understated, but rather provocative. Inspiration and evolution from previous models are evident in the beautifully articulated design and the well defined aesthetic, the fingerprint of our 'Industrial Modern' designs. The M60-A offers a unique contender in the traditional 60% form factor. [More info at RAMA WORKS](https://rama.works/m60-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA M60-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/m60_a: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). \ No newline at end of file diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk new file mode 100644 index 0000000000..02617cf1c7 --- /dev/null +++ b/keyboards/rama/m60_a/rules.mk @@ -0,0 +1,79 @@ + + +# project specific files +SRC = ../zeal60/zeal60.c \ + ../zeal60/rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +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 + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h new file mode 100644 index 0000000000..baa4978a83 --- /dev/null +++ b/keyboards/zeal60/config.h @@ -0,0 +1,125 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ZealPC +#define PRODUCT Zeal60 +#define DESCRIPTION Zeal60 (QMK Firmware) + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCING_DELAY 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 + +// key combination for command +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Zeal60 specifics +#define RGB_BACKLIGHT_ZEAL60 + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0010000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0000000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0001000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0011000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0011110000000111 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/zeal60/info.json b/keyboards/zeal60/info.json new file mode 100644 index 0000000000..c4234e49a4 --- /dev/null +++ b/keyboards/zeal60/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Zeal60", + "url": "", + "maintainer": "Wilba", + "bootloader": "DFU", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h new file mode 100644 index 0000000000..011cf5c5a5 --- /dev/null +++ b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/config.h @@ -0,0 +1,21 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + diff --git a/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c new file mode 100644 index 0000000000..edb4f256b5 --- /dev/null +++ b/keyboards/zeal60/keymaps/ansi_split_bs_rshift/keymap.c @@ -0,0 +1,38 @@ +// ANSI split backspace/right shift layout for Zeal60 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_ansi_split_bs_rshift( + KC_ESC, 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_BSLS, KC_DEL, + 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_BSPC, + 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, FN_MO23, KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_ansi_split_bs_rshift( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_ansi_split_bs_rshift( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_ansi_split_bs_rshift( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal60/keymaps/default/config.h b/keyboards/zeal60/keymaps/default/config.h new file mode 100644 index 0000000000..f8478a3df2 --- /dev/null +++ b/keyboards/zeal60/keymaps/default/config.h @@ -0,0 +1,20 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 diff --git a/keyboards/zeal60/keymaps/default/keymap.c b/keyboards/zeal60/keymaps/default/keymap.c new file mode 100644 index 0000000000..3a13cf4d5a --- /dev/null +++ b/keyboards/zeal60/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +// Default layout for Zeal60 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_ansi( + KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO13, FN_MO23, KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL , + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_ansi( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal60/keymaps/hhkb/config.h b/keyboards/zeal60/keymaps/hhkb/config.h new file mode 100644 index 0000000000..25f74d3d28 --- /dev/null +++ b/keyboards/zeal60/keymaps/hhkb/config.h @@ -0,0 +1,20 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 1 diff --git a/keyboards/zeal60/keymaps/hhkb/keymap.c b/keyboards/zeal60/keymaps/hhkb/keymap.c new file mode 100644 index 0000000000..5cedc6e5ec --- /dev/null +++ b/keyboards/zeal60/keymaps/hhkb/keymap.c @@ -0,0 +1,38 @@ +// HHKB layout for Zeal60 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_hhkb( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_MO13, + KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO23), + +// Fn1 Layer +[1] = LAYOUT_60_hhkb( + KC_PWR, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_hhkb( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_hhkb( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal60/keymaps/iso/config.h b/keyboards/zeal60/keymaps/iso/config.h new file mode 100644 index 0000000000..c96ef1f057 --- /dev/null +++ b/keyboards/zeal60/keymaps/iso/config.h @@ -0,0 +1,20 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 1 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 1 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 diff --git a/keyboards/zeal60/keymaps/iso/keymap.c b/keyboards/zeal60/keymaps/iso/keymap.c new file mode 100644 index 0000000000..55120f05e5 --- /dev/null +++ b/keyboards/zeal60/keymaps/iso/keymap.c @@ -0,0 +1,38 @@ +// ISO layout for Zeal60 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_iso( + KC_ESC, 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_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_ENT, + 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_NUHS, + 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, FN_MO13, FN_MO23, KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_iso( + KC_GRV, 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_DEL , + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_iso( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_60_iso( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, ES_DEC, ES_INC, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal60/keymaps/ryanmaclean/config.h b/keyboards/zeal60/keymaps/ryanmaclean/config.h new file mode 100644 index 0000000000..f1531eb345 --- /dev/null +++ b/keyboards/zeal60/keymaps/ryanmaclean/config.h @@ -0,0 +1,21 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + diff --git a/keyboards/zeal60/keymaps/ryanmaclean/keymap.c b/keyboards/zeal60/keymaps/ryanmaclean/keymap.c new file mode 100644 index 0000000000..2e342b497c --- /dev/null +++ b/keyboards/zeal60/keymaps/ryanmaclean/keymap.c @@ -0,0 +1,84 @@ +// Ryan MacLean's layout for Zeal60 +// Note that LGUI and RGUI are swapped with LALT and RALT respectively, for use with Macs +// Also note that Control has replaced Caps Lock, and that pressing left or right shift once +// will output left parenthese and right parenthese respectively. +#include QMK_KEYBOARD_H + +// [0,13] is either left key of split backspace (e.g. HHKB \| key) or 2U backspace +// [1,13] is either backslash or ISO Enter +// [2,12] is either ANSI Enter or key left of ISO Enter +// [2,13] is right key of split backspace (e.g. HHKB `~ key) +// [3,1] is right key of split left-shift (e.g ISO key) +// [3,13] is right key of split right-shift (e.g. HHKB Fn key) + + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) // this is the function signature -- just copy/paste it into your keymap file as it is. KC_LSFT KC_LALT KC_LGUI KC_4 +{ + switch(id) { + case 0: // macOS screenshot to capture are to clipboard - this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( D(LSFT), D(LCTL), D(LGUI), T(4), U(LSFT), U(LCTL), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes + } + break; + case 1: // macOS screenshot capture area to file - this would trigger when you hit a key mapped as M(1) + if (record->event.pressed) { + return MACRO( D(LSFT), D(LGUI), T(4), U(LSFT), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes + } + break; + case 2: // macOS screenshot to clipboard - this would trigger when you hit a key mapped as M(2) + if (record->event.pressed) { + return MACRO( D(LSFT), D(LCTL), D(LGUI), T(3), U(LSFT), U(LCTL), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes + } + break; + case 3: // macOS screenshot to file - this would trigger when you hit a key mapped as M(3) + if (record->event.pressed) { + return MACRO( D(LSFT), D(LGUI), T(3), U(LSFT), U(LGUI), W(255), END ); // this sends the string 'hello' when the macro executes + } + break; + } + return MACRO_NONE; +}; + +#define CADETL MT(KC_LSFT, KC_LBRC) +#define CADETR MT(KC_RSFT, KC_RBRC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = { + {KC_ESC, 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_BSLS}, + {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_BSPC}, + {KC_LGUI, 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_GRV}, + {KC_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, FN_MO13}, + {KC_LCTL, KC_LALT, KC_LGUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_SPC, KC_NO, KC_NO, KC_RGUI, KC_RALT, KC_RCTL, FN_MO23} +}, + +// Fn1 Layer +[1] = { + {KC_GRV, 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_TRNS}, + {KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL}, + {KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, + +// Fn2 Layer +[2] = { + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, M(2), M(3), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, M(1), M(0), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +}, + +// Fn3 Layer (zeal60 Configuration) +[3] = { + {KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS}, + {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS} +} + +}; diff --git a/keyboards/zeal60/keymaps/tusing/Makefile b/keyboards/zeal60/keymaps/tusing/Makefile new file mode 100644 index 0000000000..762905da03 --- /dev/null +++ b/keyboards/zeal60/keymaps/tusing/Makefile @@ -0,0 +1,6 @@ +# 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 +# +RGBLIGHT_ENABLE = yes +AUDIO_ENABLE = no # Underglow cannot be used with audio. diff --git a/keyboards/zeal60/keymaps/tusing/README.md b/keyboards/zeal60/keymaps/tusing/README.md new file mode 100644 index 0000000000..edddf1c58f --- /dev/null +++ b/keyboards/zeal60/keymaps/tusing/README.md @@ -0,0 +1,80 @@ +# RGB Underglow Strip on the Zeal60: A Guide + + + +## Requirements + +- WS2812B RGB strip, preferably 60 LEDs/meter +- Wire, solder +- Tape, hot glue, or some sort of adhesive + +## A. Connecting the strip +You might find the [**full PCB image**](https://cdn.shopify.com/s/files/1/0490/7329/files/zeal60jumpers.png) helpful. Ignore the red boxes! + +1. Connect V+ to the receiving end of the thermistor labeled F1; connect GND to the board's GND pin. (*Avoid connecting +V to the board's +5V pin* - you will likely overload the thermistor, and you will limit your maximum brightness.) + + + +2. Connect DI to PB0. + + + +3. Should look something like this when finished: + + + +*Optional:* To allow considerably more light to escape, consider angling the strip outwards by using some sort of fulcrum under the strip. (I used a thick wire.) + +## B. Enabling the strip +1. If it is not present already, add the following to your ***keymap's*** ```Makefile```: + + ```Makefile + RGBLIGHT_ENABLE = yes + AUDIO_ENABLE = no #Underglow animations cannot be used with audio. + ``` +2. If it is not present already, add the following to your *keymap's* ```config.h```, and edit the values as necessary: + + ```c + // Set up RGB underglow. + #define RGB_DI_PIN B0 // The pin your RGB strip is wired to + #define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio) + #define RGBLED_NUM 35 // Number of LEDs + #define RGBLIGHT_HUE_STEP 5 // How much each press of rgb_hue changes hue + #define RGBLIGHT_SAT_STEP 10 // How much each press of rgb_sat changes sat + #define RGBLIGHT_VAL_STEP 10 // How much each press of rgb_val changes val + ``` +3. If they are not present already, add the following keycodes to your keymap to control the RGB strip: ```RGB_TOG``` (on/off), ```RGB_MOD``` (step through modes), ```RGB_HUI```, ```RGB_HUD```, ```RGB_SAI```, ```RGB_SAD```, ```RGB_VAI```, ```RGB_VAD``` (HSV increase/decrease). Add these to your keymap. + +## C. Dealing with current limits +USB 2.0 ports on laptops provide up to 500mA max, but USB 3.0 ports can provide up to 900mA; USB 3.1 up to 1.5A; and powered USB hubs even more. We can run our keyboard at a higher brightness if we draw more power. **The Zeal60 uses 500mA at max brightness.** This means that **you have about 400mA remaining for the strip to use on a USB 3.0 port**; 1000mA free on a USB 3.1 port, so on and so forth. + +***Warning:*** **This means you will need to turn *off* your RGB strip before connecting to a USB 2.0 port**, as USB 2.0 cannot sustain the current necessary! + +1. If not present already, add the following to your keymap's ```config.h```. Change the numbers based on your needs. The ones below are safe underestimates. + + ```c + // Enable current limiting for RGB underglow. + #define RGBSTRIP_CURRENT_LIMIT 400 // Strip current limit in mA. (USB amperage - 500mA for keyboard) + #define RGBSTRIP_MAX_CURRENT_PER_LIGHT 50 // mA per light when at max brightness. + ``` + *Example:* I use a USB port capable of providing 1800 mA. The keyboard uses 500mA, so my personal value (in the `tusing` keymap) for `RGBSTRIP_CURRENT_LIMIT` is 1300. The particular WS2812B RGB strip I have uses a maximum of 60 mA per LED, so that is my personal value for `RGBSTRIP_MAX_CURRENT_PER_LIGHT`. +2. Toggle on the LED strip (```RGB_TOG```) and step through animations (```RGB_MOD```) to test it out! + +## D. Sources and resources +### A. Connecting the strip. +* [In-depth description of connecting an RGB strip to the GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4d5or2/my_first_custom_build_satan_gh60_rbg_underglow_in/d1nz3o7/) +* [32U4 Pinout](https://40.media.tumblr.com/93b6bbd4113418c2b45459bb177e67c5/tumblr_mi49a20QMB1s5t695o1_1280.png) +* [Redditor describes connecting RGB strips on his Satan GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4hbjw4/finally_finished_my_satan_gh60_also_granite_o/d2qn8zx/?context=3) +* [Another Redditor on RGB with the Satan GH60](https://www.reddit.com/r/MechanicalKeyboards/comments/4ewzdx/gh60_satan_with_the_rgb_mod/d251uu6/ ) + +### B. Enabling the strip. +* [QMK Wiki portion on underglow](https://github.com/jackhumbert/qmk_firmware/wiki#rgb-under-glow-mod) +* [Planck ```Makefile```, ```config.h```, and ```keymap.c``` config example](https://github.com/jackhumbert/qmk_firmware/tree/master/keyboards/planck/keymaps/yang) +* [Video demonstrating keycode functions and RGB modes on a KC60](https://www.youtube.com/watch?v=VKrpPAHlisY) + +### C. Dealing with current limits. +* [Discussion of cutting jumpers and adding resistors to lower current from Zeal60](https://www.reddit.com/r/MechanicalKeyboards/comments/5hou92/photos_zeal60_lets_just_say_santa_came_early_this/db23qid/) +* [A selection of 900mA-1.5A current hold fuses - look for an SMD 0805-sized fuse.](https://goo.gl/748avG) +* [Video detailing technique to solder 0805 resistors](https://www.youtube.com/watch?v=PU7wLcuqc-I&t=123s&list=FLheMlKEVQ5cmVXazUt6HrxQ&index=2) +* [QMK feature request to implement max power draw limits in ```config.h```](https://github.com/jackhumbert/qmk_firmware/issues/954) +* [Commit enabling max power draw limits in ```config.h```](https://github.com/jackhumbert/qmk_firmware/commit/83e613ad239459582ae28f78b6c81535b9b138d7) \ No newline at end of file diff --git a/keyboards/zeal60/keymaps/tusing/config.h b/keyboards/zeal60/keymaps/tusing/config.h new file mode 100644 index 0000000000..93f260946c --- /dev/null +++ b/keyboards/zeal60/keymaps/tusing/config.h @@ -0,0 +1,40 @@ +#pragma once + +/* Enable/disable LEDs based on layout. */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// Set up RGB underglow. +#define RGB_DI_PIN B0 // The pin your RGB strip is wired to +#define RGBLIGHT_ANIMATIONS // Require for fancier stuff (not compatible with audio) +#define RGBLED_NUM 35 // Number of LEDs +#define RGBLIGHT_HUE_STEP 5 // How much each press of rgb_hue changes hue +#define RGBLIGHT_SAT_STEP 10 // How much each press of rgb_sat changes sat +#define RGBLIGHT_VAL_STEP 10 // How much each press of rgb_val changes val + +// Enable current limiting for RGB underglow. +#define RGBSTRIP_CURRENT_LIMIT 1300 // Strip current limit in mA. (USB amperage - 500mA for keyboard) +#define RGBSTRIP_MAX_CURRENT_PER_LIGHT 40 // mA per light when at max brightness. + +// Scale brightnes according to BRIGHTNESS_CORRECTION_TABLE in quantum/rgblight.c. +// This allows to mitigate uneven brightness from LED underglow strips. +// #define LED_BRIGHTNESS_CORRECTION + +// Prevent modifiers on layer 1 from persisting after we let go +#define PREVENT_STUCK_MODIFIERS + diff --git a/keyboards/zeal60/keymaps/tusing/keymap.c b/keyboards/zeal60/keymaps/tusing/keymap.c new file mode 100644 index 0000000000..41d2effd46 --- /dev/null +++ b/keyboards/zeal60/keymaps/tusing/keymap.c @@ -0,0 +1,49 @@ +// Default layout for Zeal60 +#include QMK_KEYBOARD_H + +// For readability. +#define _______ KC_TRNS +#define _x_ KC_NO +#define AUD_PRV LCTL(KC_MPRV) // Previous music track +#define AUD_PLY LCTL(KC_MPLY) // Pause music +#define AUD_NXT LCTL(KC_MNXT) // Next music track + +// Zeal60-specific keys: +// EF_INC, EF_DEC, // next/previous backlight effect +// H1_INC, H1_DEC, // Color 1 hue increase/decrease +// S1_INC, S1_DEC, // Color 1 saturation increase/decrease +// H2_INC, H2_DEC, // Color 2 hue increase/decrease +// S2_INC, S2_DEC, // Color 2 saturation increase/decrease +// BR_INC, BR_DEC, // backlight brightness increase/decrease + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// Default layer: Pressing caps-lock momentarily switches to Layer 1. +// This is the default layer. Pressing an empty keycode on another layer will take you here. + [0] = { + {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_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}, + {MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, _x_ }, + {KC_LSFT, _x_ , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, _x_ }, + {KC_LCTL, KC_LGUI, KC_LALT, _x_ , _x_ , _x_ , _x_ , KC_SPC, _x_ , _x_ , KC_LEFT, KC_UP, KC_DOWN, KC_RGHT} + }, + +// Layer 1: Pressing enter switches to layer 2, where backlight controls live. +// This is a momentary layer: once you let go of caps, you'll be back in layer 1. + [1] = { + {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_DEL }, + {_______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_INS, KC_DEL, _______}, + {_______, AUD_PRV, AUD_PLY, AUD_NXT, _______, _______, _______, _______, _______, _______, _______, _______, TO(2) , _x_ }, + {KC_CAPS, _x_ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _x_ }, + {KC_RCTL, KC_RGUI, KC_RALT, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , KC_HOME, KC_PGUP, KC_PGDN, KC_END} + }, + +// Layer 2: Zeal60 and backlight configuration. (Get here quickly by pressing Caps+Enter from Layer 1.) +// This is a persistent layer. Get back to the default layer by pressing enter. + [2] = { + {RESET, EF_DEC, EF_INC, BR_DEC, BR_INC, ES_DEC, ES_INC, _______, _______, _______, _______, _______, _______, _______}, + {_______, H1_DEC, H1_INC, S1_DEC, S1_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, H2_DEC, H2_INC, S2_DEC, S2_INC, _______, _______, _______, _______, _______, _______, _______, TO(0) , _x_ }, + {RGB_MOD, _x_ , RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _x_ }, + {RGB_TOG, RGB_VAD, RGB_VAI, _x_ , _x_ , _x_ , _x_ , _______, _x_ , _x_ , _______, _______, _______, _______} + } +}; diff --git a/keyboards/zeal60/readme.md b/keyboards/zeal60/readme.md new file mode 100644 index 0000000000..9eca28f83e --- /dev/null +++ b/keyboards/zeal60/readme.md @@ -0,0 +1,47 @@ +Zeal60 +==== + +![Zeal60](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal60.jpg) + +This is a 60% PCB with per-key RGB LEDs and supports ANSI, ISO, winkey/winkeyless bottom row, HHKB-layout (split right shift and backspace). + +Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) +Hardware Supported: Zeal60 PCB Rev 0-3 +Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zeal60rgb + +Make example for this keyboard (after setting up your build environment): + + make zeal60: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). + + +RGB Backlight Configuration +==== + +A keymap (in the keymaps directory) can optionally configure which RGB backlight LEDs are used, depending on the needs of the layout, by adding a config.h file in the keymap's directory. +The following #define symbols will enable/disable a feature using 1 or 0. + + RGB_BACKLIGHT_USE_SPLIT_BACKSPACE + +Split backspace is being used, enables the right LED of the split backspace (the top-right corner) + + RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT + +Split left shift is being used (i.e. ISO layout), enables the right LED of the split left shift (the ISO key) + + RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT + +Split right shift is being used (i.e. HHKB style layouts), enables the right LED of the split right shift (the Fn key) + + RGB_BACKLIGHT_USE_7U_SPACEBAR + +A 7U spacebar is being used, controls the LEDs under the right stabilizer (of 7U spacebar) and right Alt (if 6.25U spacebar). + + RGB_BACKLIGHT_USE_ISO_ENTER + +An ISO Enter is being used. Only used to tweak the location of the LED being used under ANSI Enter/backslash + + RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS + +Disables the LEDs under HHKB corner blockers, useful for transparent cases. diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c new file mode 100644 index 0000000000..9f62a8d381 --- /dev/null +++ b/keyboards/zeal60/rgb_backlight.c @@ -0,0 +1,1519 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ +#if RGB_BACKLIGHT_ENABLED + +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) +#else +#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A +#endif + +#include "zeal60.h" +#include "rgb_backlight.h" +#include "rgb_backlight_api.h" +#include "rgb_backlight_keycodes.h" + +#include +#include +#include +#include "progmem.h" + +#include "quantum/color.h" +#include "drivers/avr/i2c_master.h" +#include "drivers/issi/is31fl3731.h" + +#define BACKLIGHT_EFFECT_MAX 10 + +backlight_config g_config = { + .use_split_backspace = RGB_BACKLIGHT_USE_SPLIT_BACKSPACE, + .use_split_left_shift = RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT, + .use_split_right_shift = RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT, + .use_7u_spacebar = RGB_BACKLIGHT_USE_7U_SPACEBAR, + .use_iso_enter = RGB_BACKLIGHT_USE_ISO_ENTER, + .disable_hhkb_blocker_leds = RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS, + .disable_when_usb_suspended = RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED, + .disable_after_timeout = RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT, + .brightness = 255, + .effect = RGB_BACKLIGHT_EFFECT, + .effect_speed = 0, + .color_1 = { .h = 0, .s = 255, .v = 255 }, + .color_2 = { .h = 127, .s = 255, .v = 255 }, + .caps_lock_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, + .layer_1_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, + .layer_2_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, + .layer_3_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, + .alphas_mods = { + RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } +}; + +bool g_suspend_state = false; +uint8_t g_indicator_state = 0; + +// Global tick at 20 Hz +uint32_t g_tick = 0; + +// Ticks since this key was last hit. +uint8_t g_key_hit[72]; + +// Ticks since any key was last hit. +uint32_t g_any_key_hit = 0; + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +#define ISSI_ADDR_1 0x74 +#define ISSI_ADDR_2 0x76 + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C2_1, C3_1, C4_1}, // LA0 + {0, C1_1, C3_2, C4_2}, // LA1 + {0, C1_2, C2_2, C4_3}, // LA2 + {0, C1_3, C2_3, C3_3}, // LA3 + {0, C1_4, C2_4, C3_4}, // LA4 + {0, C1_5, C2_5, C3_5}, // LA5 + {0, C1_6, C2_6, C3_6}, // LA6 + {0, C1_7, C2_7, C3_7}, // LA7 + {0, C1_8, C2_8, C3_8}, // LA8 + {0, C9_1, C8_1, C7_1}, // LA9 + {0, C9_2, C8_2, C7_2}, // LA10 + {0, C9_3, C8_3, C7_3}, // LA11 + {0, C9_4, C8_4, C7_4}, // LA12 + {0, C9_5, C8_5, C7_5}, // LA13 + {0, C9_6, C8_6, C7_6}, // LA14 + {0, C9_7, C8_7, C6_6}, // LA15 + {0, C9_8, C7_7, C6_7}, // LA16 + {0, C8_8, C7_8, C6_8}, // LA17 + + {0, C2_9, C3_9, C4_9}, // LB0 + {0, C1_9, C3_10, C4_10}, // LB1 + {0, C1_10, C2_10, C4_11}, // LB2 + {0, C1_11, C2_11, C3_11}, // LB3 + {0, C1_12, C2_12, C3_12}, // LB4 + {0, C1_13, C2_13, C3_13}, // LB5 + {0, C1_14, C2_14, C3_14}, // LB6 + {0, C1_15, C2_15, C3_15}, // LB7 + {0, C1_16, C2_16, C3_16}, // LB8 + {0, C9_9, C8_9, C7_9}, // LB9 + {0, C9_10, C8_10, C7_10}, // LB10 + {0, C9_11, C8_11, C7_11}, // LB11 + {0, C9_12, C8_12, C7_12}, // LB12 + {0, C9_13, C8_13, C7_13}, // LB13 + {0, C9_14, C8_14, C7_14}, // LB14 + {0, C9_15, C8_15, C6_14}, // LB15 + {0, C9_16, C7_15, C6_15}, // LB16 + {0, C8_16, C7_16, C6_16}, // LB17 + + {1, C2_1, C3_1, C4_1}, // LC0 + {1, C1_1, C3_2, C4_2}, // LC1 + {1, C1_2, C2_2, C4_3}, // LC2 + {1, C1_3, C2_3, C3_3}, // LC3 + {1, C1_4, C2_4, C3_4}, // LC4 + {1, C1_5, C2_5, C3_5}, // LC5 + {1, C1_6, C2_6, C3_6}, // LC6 + {1, C1_7, C2_7, C3_7}, // LC7 + {1, C1_8, C2_8, C3_8}, // LC8 + {1, C9_1, C8_1, C7_1}, // LC9 + {1, C9_2, C8_2, C7_2}, // LC10 + {1, C9_3, C8_3, C7_3}, // LC11 + {1, C9_4, C8_4, C7_4}, // LC12 + {1, C9_5, C8_5, C7_5}, // LC13 + {1, C9_6, C8_6, C7_6}, // LC14 + {1, C9_7, C8_7, C6_6}, // LC15 + {1, C9_8, C7_7, C6_7}, // LC16 + {1, C8_8, C7_8, C6_8}, // LC17 + + {1, C2_9, C3_9, C4_9}, // LD0 + {1, C1_9, C3_10, C4_10}, // LD1 + {1, C1_10, C2_10, C4_11}, // LD2 + {1, C1_11, C2_11, C3_11}, // LD3 + {1, C1_12, C2_12, C3_12}, // LD4 + {1, C1_13, C2_13, C3_13}, // LD5 + {1, C1_14, C2_14, C3_14}, // LD6 + {1, C1_15, C2_15, C3_15}, // LD7 + {1, C1_16, C2_16, C3_16}, // LD8 + {1, C9_9, C8_9, C7_9}, // LD9 + {1, C9_10, C8_10, C7_10}, // LD10 + {1, C9_11, C8_11, C7_11}, // LD11 + {1, C9_12, C8_12, C7_12}, // LD12 + {1, C9_13, C8_13, C7_13}, // LD13 + {1, C9_14, C8_14, C7_14}, // LD14 + {1, C9_15, C8_15, C6_14}, // LD15 + {1, C9_16, C7_15, C6_15}, // LD16 + {1, C8_16, C7_16, C6_16}, // LD17 +}; + + + +typedef struct Point { + uint8_t x; + uint8_t y; +} Point; + + +// index in range 0..71 (LA0..LA17, LB0..LB17, LC0..LC17, LD0..LD17) +// point values in range x=0..224 y=0..64 +// origin is center of top-left key (i.e Esc) +#if defined (RGB_BACKLIGHT_ZEAL65) +const Point g_map_led_to_point[72] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {240,0}, {240,16}, {240,32}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64}, + // LC0..LC17 + {96,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {255,255}, {48,60}, {28,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,44}, {10,48}, {4,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {144,60}, {164,64}, {188,64}, {208,64} +}; +const Point g_map_led_to_point_polar[72] PROGMEM = { + // LA0..LA17 + {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,247}, + {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, + // LB0..LB17 + {56,255}, {51,255}, {46,255}, {42,255}, {37,255}, {35,255}, {32,255}, {19,255}, {0,255}, + {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255}, + // LC0..LC17 + {184,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {255,255}, {167,255}, {165,255}, + {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {145,233}, {148,255}, {161,255}, + // LD0..LD17 + {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {255,201}, {224,181}, {230,217}, {235,255}, + {189,128}, {200,131}, {210,141}, {218,159}, {201,228}, {201,228}, {206,255}, {213,255}, {218,255} +}; +#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) +const Point g_map_led_to_point[72] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {216,0}, {224,0}, {255,255}, {255,255}, {255,255}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {255,255}, {255,255}, {255,255}, + // LC0..LC17 + {102,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {60,64}, {43,64}, {23,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {20,48}, {2,48}, {3,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {210,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {144,64}, {161,64}, {181,64}, {201,64}, {221,64} +}; +const Point g_map_led_to_point_polar[72] PROGMEM = { + // LA0..LA17 + {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, {58,255}, + {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255}, + // LB0..LB17 + {53,255}, {48,255}, {43,255}, {39,255}, {34,255}, {32,255}, {255,255}, {255,255}, {255,255}, + {48,139}, {39,157}, {32,181}, {27,208}, {23,238}, {19,255}, {255,255}, {255,255}, {255,255}, + // LC0..LC17 + {188,255}, {183,131}, {173,143}, {165,163}, {159,188}, {154,216}, {172,252}, {170,255}, {165,255}, + {128,9}, {128,46}, {128,82}, {128,119}, {128,155}, {128,192}, {150,244}, {147,255}, {161,255}, + // LD0..LD17 + {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255}, + {195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255} +}; +#endif + +// This may seem counter-intuitive, but it's quite flexible. +// For each LED, get it's position to decide what color to make it. +// This solves the issue of LEDs (and switches) not aligning to a grid, +// or having a large "bitmap" and sampling them. +void map_led_to_point( uint8_t index, Point *point ) +{ + // Slightly messy way to get Point structs out of progmem. + uint8_t *addr = (uint8_t*)&g_map_led_to_point[index]; + point->x = pgm_read_byte(addr); + point->y = pgm_read_byte(addr+1); + + switch (index) + { + case 18+4: // LB4A + if ( g_config.use_split_backspace ) + point->x -= 8; + break; + case 18+14: // LB14A + if ( g_config.use_iso_enter ) + point->y += 8; // extremely pedantic + break; +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) + case 36+0: // LC0A + if ( g_config.use_7u_spacebar ) + point->x += 10; + break; + case 36+6: // LC6A + if ( g_config.use_7u_spacebar ) + point->x += 4; + break; +#endif + case 36+16: // LC16A + if ( !g_config.use_split_left_shift ) + point->x += 8; + break; + case 54+5: // LD5A + if ( !g_config.use_iso_enter ) + point->x -= 10; + break; + case 54+7: // LD7A + if ( !g_config.use_split_right_shift ) + point->x -= 8; + break; + } +} + +void map_led_to_point_polar( uint8_t index, Point *point ) +{ + // Slightly messy way to get Point structs out of progmem. + uint8_t *addr = (uint8_t*)&g_map_led_to_point_polar[index]; + point->x = pgm_read_byte(addr); + point->y = pgm_read_byte(addr+1); +} + +// +// Maps switch matrix coordinate (row,col) to LED index +// + + +#if defined (RGB_BACKLIGHT_ZEAL65) +// Note: Left spacebar stab is at 4,3 (LC7) +// Right spacebar stab is at 4,9 (D14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7 +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8 +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15 +// C17, C8, C7, ---, ---, ---, ---, C0, ---, D14, D15, D16, D17, B17, B16 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, + { 36+17, 36+8, 36+7, 255, 255, 255, 255, 36+0, 255, 54+14, 54+15, 54+16, 54+17, 18+17, 18+16 } +}; +#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) +// Note: Left spacebar stab is at 4,3 (LC6) +// Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, +// C17, C8, C7, C6, ---, ---, ---, C0, ---, D13, D14, D15, D16, D17, +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8 }, + { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 } +}; +#endif + +void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ) +{ + *led = 255; + if ( row < MATRIX_ROWS && column < MATRIX_COLS ) + { + *led = pgm_read_byte(&g_map_row_column_to_led[row][column]); + } +} + +void backlight_update_pwm_buffers(void) +{ + IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, ISSI_ADDR_2 ); + IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 ); +} + +void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3731_set_color( index, red, green, blue ); +} + +void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3731_set_color_all( red, green, blue ); +} + +void backlight_set_key_hit(uint8_t row, uint8_t column) +{ + uint8_t led; + map_row_column_to_led(row,column,&led); + g_key_hit[led] = 0; + + g_any_key_hit = 0; +} + +// This is (F_CPU/1024) / 20 Hz +// = 15625 Hz / 20 Hz +// = 781 +#define TIMER3_TOP 781 + +void backlight_timer_init(void) +{ + static uint8_t backlight_timer_is_init = 0; + if ( backlight_timer_is_init ) + { + return; + } + backlight_timer_is_init = 1; + + // Timer 3 setup + TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP + _BV(CS32) | _BV(CS30); // prescale by /1024 + // Set TOP value + uint8_t sreg = SREG; + cli(); + + OCR3AH = (TIMER3_TOP >> 8) & 0xff; + OCR3AL = TIMER3_TOP & 0xff; + SREG = sreg; +} + +void backlight_timer_enable(void) +{ + TIMSK3 |= _BV(OCIE3A); +} + +void backlight_timer_disable(void) +{ + TIMSK3 &= ~_BV(OCIE3A); +} + +void backlight_set_suspend_state(bool state) +{ + g_suspend_state = state; +} + +void backlight_set_indicator_state(uint8_t state) +{ + g_indicator_state = state; +} + +void backlight_effect_rgb_test(void) +{ + // Mask out bits 4 and 5 + // This 2-bit value will stay the same for 16 ticks. + switch ( (g_tick & 0x30) >> 4 ) + { + case 0: + { + backlight_set_color_all( 255, 0, 0 ); + break; + } + case 1: + { + backlight_set_color_all( 0, 255, 0 ); + break; + } + case 2: + { + backlight_set_color_all( 0, 0, 255 ); + break; + } + case 3: + { + backlight_set_color_all( 255, 255, 255 ); + break; + } + } +} + +// This tests the LEDs +// Note that it will change the LED control registers +// in the LED drivers, and leave them in an invalid +// state for other backlight effects. +// ONLY USE THIS FOR TESTING LEDS! +void backlight_effect_single_LED_test(void) +{ + static uint8_t color = 0; // 0,1,2 for R,G,B + static uint8_t row = 0; + static uint8_t column = 0; + + static uint8_t tick = 0; + tick++; + + if ( tick > 2 ) + { + tick = 0; + column++; + } + if ( column > 14 ) + { + column = 0; + row++; + } + if ( row > 4 ) + { + row = 0; + color++; + } + if ( color > 2 ) + { + color = 0; + } + + uint8_t led; + map_row_column_to_led( row, column, &led ); + backlight_set_color_all( 255, 255, 255 ); + backlight_test_led( led, color==0, color==1, color==2 ); +} + +// All LEDs off +void backlight_effect_all_off(void) +{ + backlight_set_color_all( 0, 0, 0 ); +} + +// Solid color +void backlight_effect_solid_color(void) +{ + HSV hsv = { .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness }; + RGB rgb = hsv_to_rgb( hsv ); + backlight_set_color_all( rgb.r, rgb.g, rgb.b ); +} + +// alphas = color1, mods = color2 +void backlight_effect_alphas_mods(void) +{ + RGB rgb1 = hsv_to_rgb( (HSV){ .h = g_config.color_1.h, .s = g_config.color_1.s, .v = g_config.brightness } ); + RGB rgb2 = hsv_to_rgb( (HSV){ .h = g_config.color_2.h, .s = g_config.color_2.s, .v = g_config.brightness } ); + + for ( int row = 0; row < MATRIX_ROWS; row++ ) + { + for ( int column = 0; column < MATRIX_COLS; column++ ) + { + uint8_t index; + map_row_column_to_led( row, column, &index ); + if ( index < 72 ) + { + if ( ( g_config.alphas_mods[row] & (1< 127 ) + { + deltaH -= 256; + } + else if ( deltaH < -127 ) + { + deltaH += 256; + } + // Divide delta by 4, this gives the delta per row + deltaH /= 4; + + int16_t s1 = g_config.color_1.s; + int16_t s2 = g_config.color_2.s; + int16_t deltaS = ( s2 - s1 ) / 4; + + HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i<72; i++ ) + { + map_led_to_point( i, &point ); + // The y range will be 0..64, map this to 0..4 + uint8_t y = (point.y>>4); + // Relies on hue being 8-bit and wrapping + hsv.h = g_config.color_1.h + ( deltaH * y ); + hsv.s = g_config.color_1.s + ( deltaS * y ); + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_raindrops(bool initialize) +{ + int16_t h1 = g_config.color_1.h; + int16_t h2 = g_config.color_2.h; + int16_t deltaH = h2 - h1; + deltaH /= 4; + + // Take the shortest path between hues + if ( deltaH > 127 ) + { + deltaH -= 256; + } + else if ( deltaH < -127 ) + { + deltaH += 256; + } + + int16_t s1 = g_config.color_1.s; + int16_t s2 = g_config.color_2.s; + int16_t deltaS = ( s2 - s1 ) / 4; + + HSV hsv; + RGB rgb; + + // Change one LED every tick + uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255; + + for ( int i=0; i<72; i++ ) + { + // If initialize, all get set to random colors + // If not, all but one will stay the same as before. + if ( initialize || i == led_to_change ) + { + hsv.h = h1 + ( deltaH * ( rand() & 0x03 ) ); + hsv.s = s1 + ( deltaS * ( rand() & 0x03 ) ); + // Override brightness with global brightness control + hsv.v = g_config.brightness;; + + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } + } +} + +void backlight_effect_cycle_all(void) +{ + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; + + // Relies on hue being 8-bit and wrapping + for ( int i=0; i<72; i++ ) + { + uint16_t offset2 = g_key_hit[i]<<2; + // stabilizer LEDs use spacebar hits + if ( i == 36+6 || i == 54+13 || // LC6, LD13 + ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 + { + offset2 = g_key_hit[36+0]<<2; + } + offset2 = (offset2<=63) ? (63-offset2) : 0; + + HSV hsv = { .h = offset+offset2, .s = 255, .v = g_config.brightness }; + RGB rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_cycle_left_right(void) +{ + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; + HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i<72; i++ ) + { + uint16_t offset2 = g_key_hit[i]<<2; + // stabilizer LEDs use spacebar hits + if ( i == 36+6 || i == 54+13 || // LC6, LD13 + ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 + { + offset2 = g_key_hit[36+0]<<2; + } + offset2 = (offset2<=63) ? (63-offset2) : 0; + + map_led_to_point( i, &point ); + // Relies on hue being 8-bit and wrapping + hsv.h = point.x + offset + offset2; + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_cycle_up_down(void) +{ + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; + HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i<72; i++ ) + { + uint16_t offset2 = g_key_hit[i]<<2; + // stabilizer LEDs use spacebar hits + if ( i == 36+6 || i == 54+13 || // LC6, LD13 + ( g_config.use_7u_spacebar && i == 54+14 ) ) // LD14 + { + offset2 = g_key_hit[36+0]<<2; + } + offset2 = (offset2<=63) ? (63-offset2) : 0; + + map_led_to_point( i, &point ); + // Relies on hue being 8-bit and wrapping + hsv.h = point.y + offset + offset2; + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_jellybean_raindrops( bool initialize ) +{ + HSV hsv; + RGB rgb; + + // Change one LED every tick + uint8_t led_to_change = ( g_tick & 0x000 ) == 0 ? rand() % 72 : 255; + + for ( int i=0; i<72; i++ ) + { + // If initialize, all get set to random colors + // If not, all but one will stay the same as before. + if ( initialize || i == led_to_change ) + { + hsv.h = rand() & 0xFF; + hsv.s = rand() & 0xFF; + // Override brightness with global brightness control + hsv.v = g_config.brightness;; + + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } + } +} + +void backlight_effect_cycle_radial1(void) +{ + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; + HSV hsv = { .h = 0, .s = 255, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i<72; i++ ) + { + map_led_to_point_polar( i, &point ); + // Relies on hue being 8-bit and wrapping + hsv.h = point.x + offset; + hsv.s = point.y; + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_cycle_radial2(void) +{ + uint8_t offset = ( g_tick << g_config.effect_speed ) & 0xFF; + + HSV hsv = { .h = 0, .s = g_config.color_1.s, .v = g_config.brightness }; + RGB rgb; + Point point; + for ( int i=0; i<72; i++ ) + { + map_led_to_point_polar( i, &point ); + uint8_t offset2 = offset + point.x; + if ( offset2 & 0x80 ) + { + offset2 = ~offset2; + } + offset2 = offset2 >> 2; + hsv.h = g_config.color_1.h + offset2; + hsv.s = 127 + ( point.y >> 1 ); + rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +void backlight_effect_indicators_set_colors( uint8_t index, HSV hsv ) +{ + RGB rgb = hsv_to_rgb( hsv ); + if ( index == 254 ) + { + backlight_set_color_all( rgb.r, rgb.g, rgb.b ); + } + else + { + backlight_set_color( index, rgb.r, rgb.g, rgb.b ); + + // If the spacebar LED is the indicator, + // do the same for the spacebar stabilizers + if ( index == 36+0 ) // LC0 + { +#if defined (RGB_BACKLIGHT_ZEAL65) + backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7 + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 +#elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) + backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 + backlight_set_color( 54+13, rgb.r, rgb.g, rgb.b ); // LD13 + if ( g_config.use_7u_spacebar ) + { + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 + } +#endif + } + } +} + +// This runs after another backlight effect and replaces +// colors already set +void backlight_effect_indicators(void) +{ + if ( g_config.caps_lock_indicator.index != 255 && + ( g_indicator_state & (1< 0 && g_any_key_hit > g_config.disable_after_timeout * 60 * 20)); + uint8_t effect = suspend_backlight ? 0 : g_config.effect; + + // Keep track of the effect used last time, + // detect change in effect, so each effect can + // have an optional initialization. + static uint8_t effect_last = 255; + bool initialize = effect != effect_last; + effect_last = effect; + + // this gets ticked at 20 Hz. + // each effect can opt to do calculations + // and/or request PWM buffer updates. + switch ( effect ) + { + case 0: + backlight_effect_all_off(); + break; + case 1: + backlight_effect_solid_color(); + break; + case 2: + backlight_effect_alphas_mods(); + break; + case 3: + backlight_effect_gradient_up_down(); + break; + case 4: + backlight_effect_raindrops( initialize ); + break; + case 5: + backlight_effect_cycle_all(); + break; + case 6: + backlight_effect_cycle_left_right(); + break; + case 7: + backlight_effect_cycle_up_down(); + break; + case 8: + backlight_effect_jellybean_raindrops( initialize ); + break; + case 9: + backlight_effect_cycle_radial1(); + break; + case 10: + backlight_effect_cycle_radial2(); + break; + default: + backlight_effect_all_off(); + break; + } + + if ( ! suspend_backlight ) + { + backlight_effect_indicators(); + } +} + +void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column ) +{ + if ( row >= MATRIX_ROWS ) + { + // Special value, 255=none, 254=all + *index = row; + } + else + { + map_row_column_to_led( row, column, index ); + } +} + +// Some helpers for setting/getting HSV +void _set_color( HSV *color, uint8_t *data ) +{ + color->h = data[0]; + color->s = data[1]; + color->v = data[2]; +} + +void _get_color( HSV *color, uint8_t *data ) +{ + data[0] = color->h; + data[1] = color->s; + data[2] = color->v; +} + +void backlight_config_set_value( uint8_t *data ) +{ + bool reinitialize = false; + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { +#if defined (RGB_BACKLIGHT_ZEAL60) || defined(RGB_BACKLIGHT_ZEAL65) + case id_use_split_backspace: + { + g_config.use_split_backspace = (bool)*value_data; + reinitialize = true; + break; + } +#endif +#if defined (RGB_BACKLIGHT_ZEAL60) + case id_use_split_left_shift: + { + g_config.use_split_left_shift = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_split_right_shift: + { + g_config.use_split_right_shift = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_7u_spacebar: + { + g_config.use_7u_spacebar = (bool)*value_data; + reinitialize = true; + break; + } + case id_use_iso_enter: + { + g_config.use_iso_enter = (bool)*value_data; + reinitialize = true; + break; + } + case id_disable_hhkb_blocker_leds: + { + g_config.disable_hhkb_blocker_leds = (bool)*value_data; + reinitialize = true; + break; + } +#endif + case id_disable_when_usb_suspended: + { + g_config.disable_when_usb_suspended = (bool)*value_data; + break; + } + case id_disable_after_timeout: + { + g_config.disable_after_timeout = *value_data; + break; + } + case id_brightness: + { + g_config.brightness = *value_data; + break; + } + case id_effect: + { + g_config.effect = *value_data; + break; + } + case id_effect_speed: + { + g_config.effect_speed = *value_data; + break; + } + case id_color_1: + { + _set_color( &(g_config.color_1), value_data ); + break; + } + case id_color_2: + { + _set_color( &(g_config.color_2), value_data ); + break; + } + case id_caps_lock_indicator_color: + { + _set_color( &(g_config.caps_lock_indicator.color), value_data ); + break; + } + case id_caps_lock_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.caps_lock_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_1_indicator_color: + { + _set_color( &(g_config.layer_1_indicator.color), value_data ); + break; + } + case id_layer_1_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_1_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_2_indicator_color: + { + _set_color( &(g_config.layer_2_indicator.color), value_data ); + break; + } + case id_layer_2_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_2_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_layer_3_indicator_color: + { + _set_color( &(g_config.layer_3_indicator.color), value_data ); + break; + } + case id_layer_3_indicator_row_col: + { + backlight_set_indicator_index( &(g_config.layer_3_indicator.index), value_data[0], value_data[1] ); + break; + } + case id_alphas_mods: + { + for ( int i=0; i<5; i++ ) + { + g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) ); + } + } + } + + if ( reinitialize ) + { + backlight_init_drivers(); + } +} + +void backlight_config_get_value( uint8_t *data ) +{ + uint8_t *value_id = &(data[0]); + uint8_t *value_data = &(data[1]); + switch ( *value_id ) + { + case id_use_split_backspace: + { + *value_data = ( g_config.use_split_backspace ? 1 : 0 ); + break; + } + case id_use_split_left_shift: + { + *value_data = ( g_config.use_split_left_shift ? 1 : 0 ); + break; + } + case id_use_split_right_shift: + { + *value_data = ( g_config.use_split_right_shift ? 1 : 0 ); + break; + } + case id_use_7u_spacebar: + { + *value_data = ( g_config.use_7u_spacebar ? 1 : 0 ); + break; + } + case id_use_iso_enter: + { + *value_data = ( g_config.use_iso_enter ? 1 : 0 ); + break; + } + case id_disable_when_usb_suspended: + { + *value_data = ( g_config.disable_when_usb_suspended ? 1 : 0 ); + break; + } + case id_disable_hhkb_blocker_leds: + { + *value_data = ( g_config.disable_hhkb_blocker_leds ? 1 : 0 ); + break; + } + case id_disable_after_timeout: + { + *value_data = g_config.disable_after_timeout; + break; + } + case id_brightness: + { + *value_data = g_config.brightness; + break; + } + case id_effect: + { + *value_data = g_config.effect; + break; + } + case id_effect_speed: + { + *value_data = g_config.effect_speed; + break; + } + case id_color_1: + { + _get_color( &(g_config.color_1), value_data ); + break; + } + case id_color_2: + { + _get_color( &(g_config.color_2), value_data ); + break; + } + case id_caps_lock_indicator_color: + { + _get_color( &(g_config.caps_lock_indicator.color), value_data ); + break; + } + case id_caps_lock_indicator_row_col: + { + //*value_data = g_config.caps_lock_indicator.index; + break; + } + case id_layer_1_indicator_color: + { + _get_color( &(g_config.layer_1_indicator.color), value_data ); + break; + } + case id_layer_1_indicator_row_col: + { + //*value_data = g_config.layer_1_indicator.index; + break; + } + case id_layer_2_indicator_color: + { + _get_color( &(g_config.layer_2_indicator.color), value_data ); + break; + } + case id_layer_2_indicator_row_col: + { + //*value_data = g_config.layer_2_indicator.index; + break; + } + case id_layer_3_indicator_color: + { + _get_color( &(g_config.layer_3_indicator.color), value_data ); + break; + } + case id_layer_3_indicator_row_col: + { + //*value_data = g_config.layer_3_indicator.index; + break; + } + case id_alphas_mods: + { + for ( int i=0; i<5; i++ ) + { + *(value_data+i*2) = g_config.alphas_mods[i] >> 8; + *(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF; + } + } + } +} + +void backlight_config_set_alphas_mods( uint16_t *alphas_mods ) +{ + for ( int i=0; i<5; i++ ) + { + g_config.alphas_mods[i] = alphas_mods[i]; + } + + backlight_config_save(); +} + +void backlight_config_load(void) +{ + eeprom_read_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); +} + +void backlight_config_save(void) +{ + eeprom_update_block( &g_config, ((void*)RGB_BACKLIGHT_CONFIG_EEPROM_ADDR), sizeof(backlight_config) ); +} + +void backlight_init_drivers(void) +{ + // Initialize I2C + i2c_init(); + IS31FL3731_init( ISSI_ADDR_1 ); + IS31FL3731_init( ISSI_ADDR_2 ); + + for ( int index = 0; index < 72; index++ ) + { + // OR the possible "disabled" cases together, then NOT the result to get the enabled state + // LC6 LD13 not present on Zeal65 +#if defined (RGB_BACKLIGHT_ZEAL65) + bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 + ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15 + ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8 + ( index == 36+6 ) || // LC6 + ( index == 54+13 ) ); // LD13 +#elif defined (RGB_BACKLIGHT_M60_A) + bool enabled = !( + // LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A + ( index == 18+6 ) || // LB6 + ( index == 18+7 ) || // LB7 + ( index == 18+8 ) || // LB8 + ( index == 18+15 ) || // LB15 + ( index == 18+16 ) || // LB16 + ( index == 18+17 ) || // LB17 + // HHKB blockers (LC17, LD17) and ISO extra keys (LC15,LD13) not present on M60-A + ( index == 36+17 ) || // LC17 + ( index == 54+17 ) || // LD17 + ( index == 36+15 ) || // LC15 + ( index == 54+13 ) ); // LD13 +#elif defined (RGB_BACKLIGHT_ZEAL60) + // LB6 LB7 LB8 LB15 LB16 LB17 not present on Zeal60 + bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 + ( index == 36+15 && !g_config.use_split_left_shift ) || // LC15 + ( index == 54+8 && !g_config.use_split_right_shift ) || // LD8 + ( index == 54+13 && g_config.use_7u_spacebar ) || // LD13 + ( index == 36+17 && g_config.disable_hhkb_blocker_leds ) || // LC17 + ( index == 54+17 && g_config.disable_hhkb_blocker_leds ) || // LD17 + ( index == 18+6 ) || // LB6 + ( index == 18+7 ) || // LB7 + ( index == 18+8 ) || // LB8 + ( index == 18+15 ) || // LB15 + ( index == 18+16 ) || // LB16 + ( index == 18+17 ) ); // LB17 +#endif + // This only caches it for later + IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); + } + // This actually updates the LED drivers + IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 ); + + // TODO: put the 1 second startup delay here? + + // clear the key hits + for ( int led=0; led<72; led++ ) + { + g_key_hit[led] = 255; + } +} + +bool process_record_backlight(uint16_t keycode, keyrecord_t *record) +{ + // Record keypresses for backlight effects + if ( record->event.pressed ) + { + backlight_set_key_hit( record->event.key.row, record->event.key.col ); + } + + switch(keycode) + { + case BR_INC: + if (record->event.pressed) + { + backlight_brightness_increase(); + } + return false; + break; + case BR_DEC: + if (record->event.pressed) + { + backlight_brightness_decrease(); + } + return false; + break; + case EF_INC: + if (record->event.pressed) + { + backlight_effect_increase(); + } + return false; + break; + case EF_DEC: + if (record->event.pressed) + { + backlight_effect_decrease(); + } + return false; + break; + case ES_INC: + if (record->event.pressed) + { + backlight_effect_speed_increase(); + } + return false; + break; + case ES_DEC: + if (record->event.pressed) + { + backlight_effect_speed_decrease(); + } + return false; + break; + case H1_INC: + if (record->event.pressed) + { + backlight_color_1_hue_increase(); + } + return false; + break; + case H1_DEC: + if (record->event.pressed) + { + backlight_color_1_hue_decrease(); + } + return false; + break; + case S1_INC: + if (record->event.pressed) + { + backlight_color_1_sat_increase(); + } + return false; + break; + case S1_DEC: + if (record->event.pressed) + { + backlight_color_1_sat_decrease(); + break; + } + return false; + break; + case H2_INC: + if (record->event.pressed) + { + backlight_color_2_hue_increase(); + } + return false; + break; + case H2_DEC: + if (record->event.pressed) + { + backlight_color_2_hue_decrease(); + } + return false; + break; + case S2_INC: + if (record->event.pressed) + { + backlight_color_2_sat_increase(); + } + return false; + break; + case S2_DEC: + if (record->event.pressed) + { + backlight_color_2_sat_decrease(); + break; + } + return false; + break; + } + + return true; +} + +// Deals with the messy details of incrementing an integer +uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value += step; + return MIN( MAX( new_value, min ), max ); +} + +uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) +{ + int16_t new_value = value; + new_value -= step; + return MIN( MAX( new_value, min ), max ); +} + +void backlight_effect_increase(void) +{ + g_config.effect = increment( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_decrease(void) +{ + g_config.effect = decrement( g_config.effect, 1, 0, BACKLIGHT_EFFECT_MAX ); + backlight_config_save(); +} + +void backlight_effect_speed_increase(void) +{ + g_config.effect_speed = increment( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_effect_speed_decrease(void) +{ + g_config.effect_speed = decrement( g_config.effect_speed, 1, 0, 3 ); + backlight_config_save(); +} + +void backlight_brightness_increase(void) +{ + g_config.brightness = increment( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_brightness_decrease(void) +{ + g_config.brightness = decrement( g_config.brightness, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_hue_increase(void) +{ + g_config.color_1.h = increment( g_config.color_1.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_hue_decrease(void) +{ + g_config.color_1.h = decrement( g_config.color_1.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_sat_increase(void) +{ + g_config.color_1.s = increment( g_config.color_1.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_1_sat_decrease(void) +{ + g_config.color_1.s = decrement( g_config.color_1.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_hue_increase(void) +{ + g_config.color_2.h = increment( g_config.color_2.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_hue_decrease(void) +{ + g_config.color_2.h = decrement( g_config.color_2.h, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_sat_increase(void) +{ + g_config.color_2.s = increment( g_config.color_2.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_color_2_sat_decrease(void) +{ + g_config.color_2.s = decrement( g_config.color_2.s, 8, 0, 255 ); + backlight_config_save(); +} + +void backlight_test_led( uint8_t index, bool red, bool green, bool blue ) +{ + for ( int i=0; i<72; i++ ) + { + if ( i == index ) + { + IS31FL3731_set_led_control_register( i, red, green, blue ); + } + else + { + IS31FL3731_set_led_control_register( i, false, false, false ); + } + } +} + +void backlight_debug_led( bool state ) +{ + if (state) + { + // Output high. + DDRE |= (1<<6); + PORTE |= (1<<6); + } + else + { + // Output low. + DDRE &= ~(1<<6); + PORTE &= ~(1<<6); + } +} + +#endif // BACKLIGHT_ENABLED diff --git a/keyboards/zeal60/rgb_backlight.h b/keyboards/zeal60/rgb_backlight.h new file mode 100644 index 0000000000..60f2ace51a --- /dev/null +++ b/keyboards/zeal60/rgb_backlight.h @@ -0,0 +1,101 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#if RGB_BACKLIGHT_ENABLED +#else +#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 +#endif // RGB_BACKLIGHT_ENABLED + +#include +#include + +#include "quantum/color.h" + +typedef struct +{ + HSV color; + uint8_t index; +} backlight_config_indicator; + +typedef struct +{ + bool use_split_backspace:1; // | + bool use_split_left_shift:1; // | + bool use_split_right_shift:1; // | + bool use_7u_spacebar:1; // | + bool use_iso_enter:1; // | + bool disable_when_usb_suspended:1; // | + bool disable_hhkb_blocker_leds:1; // | + bool __pad7:1; // 1 byte + uint8_t disable_after_timeout; // 1 byte + uint8_t brightness; // 1 byte + uint8_t effect; // 1 byte + uint8_t effect_speed; // 1 byte + HSV color_1; // 3 bytes + HSV color_2; // 3 bytes + backlight_config_indicator caps_lock_indicator; // 4 bytes + backlight_config_indicator layer_1_indicator; // 4 bytes + backlight_config_indicator layer_2_indicator; // 4 bytes + backlight_config_indicator layer_3_indicator; // 4 bytes + uint16_t alphas_mods[5]; // 10 bytes +} backlight_config; // = 37 bytes + +void backlight_config_load(void); +void backlight_config_save(void); +void backlight_config_set_value( uint8_t *data ); +void backlight_config_get_value( uint8_t *data ); + +void backlight_init_drivers(void); + +void backlight_timer_init(void); +void backlight_timer_enable(void); +void backlight_timer_disable(void); + +void backlight_set_suspend_state(bool state); +void backlight_set_indicator_state(uint8_t state); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void backlight_update_pwm_buffers(void); + +// Handle backlight specific keycodes +bool process_record_backlight(uint16_t keycode, keyrecord_t *record); + +void backlight_set_key_hit(uint8_t row, uint8_t col); + +void backlight_effect_increase(void); +void backlight_effect_decrease(void); +void backlight_effect_speed_increase(void); +void backlight_effect_speed_decrease(void); + +void backlight_brightness_increase(void); +void backlight_brightness_decrease(void); + +void backlight_color_1_hue_increase(void); +void backlight_color_1_hue_decrease(void); +void backlight_color_1_sat_increase(void); +void backlight_color_1_sat_decrease(void); +void backlight_color_2_hue_increase(void); +void backlight_color_2_hue_decrease(void); +void backlight_color_2_sat_increase(void); +void backlight_color_2_sat_decrease(void); + +void backlight_test_led( uint8_t index, bool red, bool green, bool blue ); +void backlight_debug_led(bool state); + diff --git a/keyboards/zeal60/rgb_backlight_api.h b/keyboards/zeal60/rgb_backlight_api.h new file mode 100644 index 0000000000..01827e849f --- /dev/null +++ b/keyboards/zeal60/rgb_backlight_api.h @@ -0,0 +1,42 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +enum backlight_config_value +{ + id_use_split_backspace = 0x01, + id_use_split_left_shift = 0x02, + id_use_split_right_shift = 0x03, + id_use_7u_spacebar = 0x04, + id_use_iso_enter = 0x05, + id_disable_hhkb_blocker_leds = 0x06, + id_disable_when_usb_suspended = 0x07, + id_disable_after_timeout = 0x08, + id_brightness = 0x09, + id_effect = 0x0A, + id_effect_speed = 0x0B, + id_color_1 = 0x0C, + id_color_2 = 0x0D, + id_caps_lock_indicator_color = 0x0E, + id_caps_lock_indicator_row_col = 0x0F, + id_layer_1_indicator_color = 0x10, + id_layer_1_indicator_row_col = 0x11, + id_layer_2_indicator_color = 0x12, + id_layer_2_indicator_row_col = 0x13, + id_layer_3_indicator_color = 0x14, + id_layer_3_indicator_row_col = 0x15, + id_alphas_mods = 0x16 +}; diff --git a/keyboards/zeal60/rgb_backlight_keycodes.h b/keyboards/zeal60/rgb_backlight_keycodes.h new file mode 100644 index 0000000000..ba7f03f89d --- /dev/null +++ b/keyboards/zeal60/rgb_backlight_keycodes.h @@ -0,0 +1,34 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +// This is hardcoded at 0x5F00 so it's well after keycode value SAFE_RANGE +enum backlight_keycodes { + BR_INC = 0x5F00, // backlight brightness increase + BR_DEC, // backlight brightness decrease + EF_INC, // backlight effect increase + EF_DEC, // backlight effect decrease + ES_INC, + ES_DEC, + H1_INC, + H1_DEC, + S1_INC, + S1_DEC, + H2_INC, + H2_DEC, + S2_INC, + S2_DEC +}; diff --git a/keyboards/zeal60/rules.mk b/keyboards/zeal60/rules.mk new file mode 100644 index 0000000000..c4686f9852 --- /dev/null +++ b/keyboards/zeal60/rules.mk @@ -0,0 +1,78 @@ + + +# project specific files +SRC = rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +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 + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c new file mode 100644 index 0000000000..e516c4dbfc --- /dev/null +++ b/keyboards/zeal60/zeal60.c @@ -0,0 +1,341 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ +#include "zeal60.h" +#include "zeal60_api.h" + +// Check that no backlight functions are called +#if RGB_BACKLIGHT_ENABLED +#include "rgb_backlight.h" +#endif // BACKLIGHT_ENABLED + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "timer.h" +#include "tmk_core/common/eeprom.h" + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + if ( command_data[0] == 0x01 ) + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + } + else + { + *command_id = id_unhandled; + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_clear_all: + { + dynamic_keymap_clear_all(); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE +#if RGB_BACKLIGHT_ENABLED + case id_backlight_config_set_value: + { + backlight_config_set_value(command_data); + break; + } + case id_backlight_config_get_value: + { + backlight_config_get_value(command_data); + break; + } + case id_backlight_config_save: + { + backlight_config_save(); + break; + } +#endif // RGB_BACKLIGHT_ENABLED + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc and space bar are held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // Assumes Esc is at [0,0] and spacebar is at [4,7]. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + if ( ( matrix_get_row(0) & (1<<0) ) && + ( matrix_get_row(4) & (1<<7) ) ) + { + // Set the Zeal60 specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); + // Jump to bootloader. + bootloader_jump(); + } +} + +void matrix_init_kb(void) +{ + bootmagic_lite(); + + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) + { +#if RGB_BACKLIGHT_ENABLED + backlight_config_load(); +#endif // RGB_BACKLIGHT_ENABLED + // TODO: do something to "turn on" keymaps in EEPROM? + } + else + { +#if RGB_BACKLIGHT_ENABLED + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + backlight_config_save(); +#endif // RGB_BACKLIGHT_ENABLED + +#ifdef DYNAMIC_KEYMAP_ENABLE + // This saves "empty" keymaps so it falls back to the keymaps + // in the firmware (aka. progmem/flash) + dynamic_keymap_clear_all(); +#endif + + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } + +#if RGB_BACKLIGHT_ENABLED + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +#endif // RGB_BACKLIGHT_ENABLED + + matrix_init_user(); +} + +void matrix_scan_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + // This only updates the LED driver buffers if something has changed. + backlight_update_pwm_buffers(); +#endif // BACKLIGHT_ENABLED + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) +{ +#if RGB_BACKLIGHT_ENABLED + process_record_backlight(keycode, record); +#endif // BACKLIGHT_ENABLED + + switch(keycode) + { + case FN_MO13: + if (record->event.pressed) + { + layer_on(1); + update_tri_layer(1, 2, 3); + } + else + { + layer_off(1); + update_tri_layer(1, 2, 3); + } + return false; + break; + case FN_MO23: + if (record->event.pressed) + { + layer_on(2); + update_tri_layer(1, 2, 3); + } + else + { + layer_off(2); + update_tri_layer(1, 2, 3); + } + return false; + break; + } + + return process_record_user(keycode, record); +} + +// This overrides the one in quantum/keymap_common.c +uint16_t keymap_function_id_to_action( uint16_t function_id ) +{ + // Zeal60 specific "action functions" are 0xF00 to 0xFFF + // i.e. F(0xF00) to F(0xFFF) are mapped to + // enum zeal60_action_functions by masking last 8 bits. + if ( function_id >= 0x0F00 && function_id <= 0x0FFF ) + { + uint8_t id = function_id & 0xFF; + switch ( id ) + { + case TRIPLE_TAP_1_3: + case TRIPLE_TAP_2_3: + { + return ACTION_FUNCTION_TAP(id); + break; + } + default: + break; + } + } + +#if USE_KEYMAPS_IN_EEPROM + +#if 0 + // This is how to implement actions stored in EEPROM. + // Not yet implemented. Not sure if it's worth the trouble + // before we have a nice GUI for keymap editing. + if ( eeprom_is_valid() && + function_id < 32 ) // TODO: replace magic number + { + uint16_t action = keymap_action_load(function_id); + + // If action is not "empty", return it, otherwise + // drop down to return the one in flash + if ( action != 0x0000 ) // TODO: replace magic number + { + return action; + } + } +#endif + +#endif // USE_KEYMAPS_IN_EEPROM + + return pgm_read_word(&fn_actions[function_id]); +} + + +// Zeal60 specific "action functions" +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) + { + case TRIPLE_TAP_1_3: + case TRIPLE_TAP_2_3: + if (record->event.pressed) + { + layer_on( id == TRIPLE_TAP_1_3 ? 1 : 2 ); + + if (record->tap.count && !record->tap.interrupted) + { + if (record->tap.count >= 3) + { + layer_invert(3); + } + } + else + { + record->tap.count = 0; + } + } + else + { + layer_off( id == TRIPLE_TAP_1_3 ? 1 : 2 ); + } + break; + } +} + +void led_set_kb(uint8_t usb_led) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_indicator_state(usb_led); +#endif // RGB_BACKLIGHT_ENABLED +} + +void suspend_power_down_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_suspend_state(true); +#endif // RGB_BACKLIGHT_ENABLED +} + +void suspend_wakeup_init_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + backlight_set_suspend_state(false); +#endif // RGB_BACKLIGHT_ENABLED +} + diff --git a/keyboards/zeal60/zeal60.h b/keyboards/zeal60/zeal60.h new file mode 100644 index 0000000000..ef9de7989e --- /dev/null +++ b/keyboards/zeal60/zeal60.h @@ -0,0 +1,93 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" +#include "rgb_backlight_keycodes.h" +#include "zeal60_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_60_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, XXX }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K47, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K41, K42, K47, K4B, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { XXX, K41, K42, XXX, XXX, XXX, XXX, K47, XXX, XXX, XXX, K4B, K4C, XXX } \ +} + diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h new file mode 100644 index 0000000000..baa8ac09f8 --- /dev/null +++ b/keyboards/zeal60/zeal60_api.h @@ -0,0 +1,33 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#define PROTOCOL_VERSION 0x0007 + +enum zeal60_command_id +{ + id_get_protocol_version = 0x01, // always 0x01 + id_get_keyboard_value, + id_set_keyboard_value, + id_dynamic_keymap_get_keycode, + id_dynamic_keymap_set_keycode, + id_dynamic_keymap_clear_all, + id_backlight_config_set_value, + id_backlight_config_get_value, + id_backlight_config_save, + + id_unhandled = 0xFF, +}; diff --git a/keyboards/zeal60/zeal60_keycodes.h b/keyboards/zeal60/zeal60_keycodes.h new file mode 100644 index 0000000000..9511801eb2 --- /dev/null +++ b/keyboards/zeal60/zeal60_keycodes.h @@ -0,0 +1,42 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +// Can't use SAFE_RANGE here, it might change if someone adds +// new values to enum quantum_keycodes. +// Need to keep checking 0x5F10 is still in the safe range. +// TODO: merge this into quantum_keycodes +// Backlight keycodes are in range 0x5F00-0x5F0F +enum zeal60_keycodes { + FN_MO13 = 0x5F10, + FN_MO23 +}; + +// Zeal60 specific "action functions" +// These are only valid IDs in action_function() +// Use FN_TT13, FN_TT23, etc. in keymaps +enum zeal60_action_functions { + TRIPLE_TAP_1_3 = 0x31, + TRIPLE_TAP_2_3 = 0x32 +}; + +// Bitwise OR the above with 0x0F00 to use in F(x) macro +// This reserves the top 256 of the 4096 range of F(x) keycodes, +// leaving the rest for use in fn_actions[] or actions in EEPROM. +#define FN_TT13 F((0x0F00|TRIPLE_TAP_1_3)) +#define FN_TT23 F((0x0F00|TRIPLE_TAP_2_3)) + +#define TG_NKRO MAGIC_TOGGLE_NKRO diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h new file mode 100644 index 0000000000..2dbf612378 --- /dev/null +++ b/keyboards/zeal65/config.h @@ -0,0 +1,125 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +// USB Device descriptor parameter +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6065 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ZealPC +#define PRODUCT Zeal65 +#define DESCRIPTION Zeal65 (QMK Firmware) + +// key matrix size +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +// Zeal60 PCB default pin-out +#define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +// IS31FL3731 driver +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 72 + +// COL2ROW or ROW2COL +#define DIODE_DIRECTION COL2ROW + +// Set 0 if debouncing isn't needed +#define DEBOUNCING_DELAY 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 + +// key combination for command +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +#define RGB_BACKLIGHT_ENABLED 1 + +// This conditionally compiles the backlight code for Zeal65 specifics +#define RGB_BACKLIGHT_ZEAL65 + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0b0110000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0b0100000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0b0101000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0b0111000000000001 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0b0111110000000011 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/zeal65/info.json b/keyboards/zeal65/info.json new file mode 100644 index 0000000000..94a090689e --- /dev/null +++ b/keyboards/zeal65/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Zeal65", + "url": "", + "maintainer": "Wilba", + "bootloader": "DFU", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_65_split_bs": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_65_normie": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Win", "x":0, "y":4, "w":1.5}, {"label":"Alt", "x":1.5, "y":4, "w":1.5}, {"x":3, "y":4, "w":7}, {"label":"Fn2", "x":10, "y":4, "w":1.5}, {"label":"Fn1", "x":11.5, "y":4, "w":1.5}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/zeal65/keymaps/default/config.h b/keyboards/zeal65/keymaps/default/config.h new file mode 100644 index 0000000000..f579dfaa7b --- /dev/null +++ b/keyboards/zeal65/keymaps/default/config.h @@ -0,0 +1,5 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 diff --git a/keyboards/zeal65/keymaps/default/keymap.c b/keyboards/zeal65/keymaps/default/keymap.c new file mode 100644 index 0000000000..dd1a715d0a --- /dev/null +++ b/keyboards/zeal65/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +// Default layout for Zeal65 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_65_normie( + KC_ESC, 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_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LALT, KC_SPC, FN_MO23, FN_MO13, KC_LEFT, KC_DOWN, KC_RGHT), + +// Fn1 Layer +[1] = LAYOUT_65_normie( + KC_GRV, 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_DEL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_65_normie( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_65_normie( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal65/keymaps/split_bs/config.h b/keyboards/zeal65/keymaps/split_bs/config.h new file mode 100644 index 0000000000..018be8d7cc --- /dev/null +++ b/keyboards/zeal65/keymaps/split_bs/config.h @@ -0,0 +1,5 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 1 diff --git a/keyboards/zeal65/keymaps/split_bs/keymap.c b/keyboards/zeal65/keymaps/split_bs/keymap.c new file mode 100644 index 0000000000..96b04c358d --- /dev/null +++ b/keyboards/zeal65/keymaps/split_bs/keymap.c @@ -0,0 +1,38 @@ +// Split-backspace layout for Zeal65 +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_65_split_bs( + KC_ESC, 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_BSLS, KC_DEL, KC_HOME, + 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_BSPC, KC_PGUP, + KC_LCTL, 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_PGDN, + KC_LSFT, 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_END, + KC_LGUI, KC_LALT, KC_SPC, FN_MO23, FN_MO13, KC_LEFT, KC_DOWN, KC_RGHT), + +// Fn1 Layer +[1] = LAYOUT_65_split_bs( + KC_GRV, 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_INS, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_65_split_bs( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer (zeal60 Configuration) +[3] = LAYOUT_65_split_bs( + KC_TRNS, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BR_DEC, BR_INC, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, S1_DEC, S1_INC, S2_DEC, S2_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/zeal65/readme.md b/keyboards/zeal65/readme.md new file mode 100644 index 0000000000..8f43dc2435 --- /dev/null +++ b/keyboards/zeal65/readme.md @@ -0,0 +1,16 @@ +Zeal65 +==== + +![Zeal65](https://cdn.shopify.com/s/files/1/0490/7329/products/Zeal65_PCB2.jpg) + +This is a 65% PCB with per-key RGB LEDs and supports fixed, 1800-like bottom row and split backspace. It was designed for the Zephyr custom keyboard. + +Keyboard Maintainer: [Wilba](http://wilba.tech/) and on [github](https://github.com/Wilba6582) +Hardware Supported: Zeal65 PCB Rev 1 +Hardware Availability: https://zealpc.net/collections/group-buy-pre-orders/products/zephyr + +Make example for this keyboard (after setting up your build environment): + + make zeal65: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/zeal65/rules.mk b/keyboards/zeal65/rules.mk new file mode 100644 index 0000000000..02617cf1c7 --- /dev/null +++ b/keyboards/zeal65/rules.mk @@ -0,0 +1,79 @@ + + +# project specific files +SRC = ../zeal60/zeal60.c \ + ../zeal60/rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3731.c \ + drivers/avr/i2c_master.c + +# MCU name +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 + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes + diff --git a/keyboards/zeal65/zeal65.c b/keyboards/zeal65/zeal65.c new file mode 100644 index 0000000000..540c93080a --- /dev/null +++ b/keyboards/zeal65/zeal65.c @@ -0,0 +1,18 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ +#ifndef RGB_BACKLIGHT_ZEAL65 +#error RGB_BACKLIGHT_ZEAL65 not defined, you done goofed somehao, brah +#endif diff --git a/keyboards/zeal65/zeal65.h b/keyboards/zeal65/zeal65.h new file mode 100644 index 0000000000..3ee4f49e59 --- /dev/null +++ b/keyboards/zeal65/zeal65.h @@ -0,0 +1,50 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" +#include "../zeal60/rgb_backlight_keycodes.h" +#include "../zeal60/zeal60_keycodes.h" + +#define XXX KC_NO + +#define LAYOUT_65_split_bs( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ +} + +#define LAYOUT_65_normie( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K47, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, XXX, K2E }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, XXX, XXX, XXX, XXX, XXX, K47, XXX, XXX, K4A, K4B, K4C, K4D, K4E } \ +} diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c new file mode 100644 index 0000000000..9f18612d56 --- /dev/null +++ b/quantum/dynamic_keymap.c @@ -0,0 +1,97 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ + +#include "config.h" +#include "keymap.h" // to get keymaps[][][] + +#include "dynamic_keymap.h" + +#ifdef DYNAMIC_KEYMAP_ENABLE + +#ifndef DYNAMIC_KEYMAP_EEPROM_ADDR +#error DYNAMIC_KEYMAP_EEPROM_ADDR not defined +#endif + +#ifndef DYNAMIC_KEYMAP_LAYER_COUNT +#error DYNAMIC_KEYMAP_LAYER_COUNT not defined +#endif + +#define KC_EENULL 0xFFFF // TODO: move to enum quantum_keycodes + +void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) +{ + // TODO: optimize this with some left shifts + return ((void*)DYNAMIC_KEYMAP_EEPROM_ADDR) + ( layer * MATRIX_ROWS * MATRIX_COLS * 2 ) + + ( row * MATRIX_COLS * 2 ) + ( column * 2 ); +} + +uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column) +{ + void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column); + // Big endian, so we can read/write EEPROM directly from host if we want + uint16_t keycode = eeprom_read_byte(address) << 8; + keycode |= eeprom_read_byte(address + 1); + return keycode; +} + +void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode) +{ + void *address = dynamic_keymap_key_to_eeprom_address(layer, row, column); + // Big endian, so we can read/write EEPROM directly from host if we want + eeprom_update_byte(address, (uint8_t)(keycode >> 8)); + eeprom_update_byte(address+1, (uint8_t)(keycode & 0xFF)); +} + +void dynamic_keymap_clear_all(void) +{ + // Save "empty" keymaps. + for ( int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++ ) + { + for ( int row = 0; row < MATRIX_ROWS; row++ ) + { + for ( int column = 0; column < MATRIX_COLS; column++ ) + { + dynamic_keymap_set_keycode(layer, row, column, KC_EENULL); + } + } + } +} + +// This overrides the one in quantum/keymap_common.c +uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) +{ + // This used to test EEPROM for magic bytes, but it was redundant. + // Test for EEPROM usage change (fresh install, address change, etc.) + // externally and call dynamic_keymap_default_save() + if ( layer < DYNAMIC_KEYMAP_LAYER_COUNT && + key.row < MATRIX_ROWS && // possibly redundant + key.col < MATRIX_COLS ) // possibly redundant + { + uint16_t keycode = dynamic_keymap_get_keycode(layer, key.row, key.col); + + // If keycode is not "empty", return it, otherwise + // drop down to return the one in flash + if ( keycode != KC_EENULL) + { + return keycode; + } + } + + return pgm_read_word(&keymaps[layer][key.row][key.col]); +} + +#endif // DYNAMIC_KEYMAP_ENABLE + diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h new file mode 100644 index 0000000000..b0133aeb85 --- /dev/null +++ b/quantum/dynamic_keymap.h @@ -0,0 +1,31 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 . + */ + +#ifndef DYNAMIC_KEYMAP_H +#define DYNAMIC_KEYMAP_H + +#include +#include + +void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column); +uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column); +void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode); +void dynamic_keymap_clear_all(void); + +// This overrides the one in quantum/keymap_common.c +// uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); + +#endif //DYNAMIC_KEYMAP_H diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index d7a7f049c7..5bca646854 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -56,6 +56,24 @@ void suspend_idle(uint8_t time) sleep_disable(); } + +// TODO: This needs some cleanup + +/** \brief Run keyboard level Power down + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_user (void) { } +/** \brief Run keyboard level Power down + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_kb(void) { + suspend_power_down_user(); +} + #ifndef NO_SUSPEND_POWER_DOWN /** \brief Power down MCU with watchdog timer * @@ -73,21 +91,6 @@ void suspend_idle(uint8_t time) */ static uint8_t wdt_timeout = 0; -/** \brief Run keyboard level Power down - * - * FIXME: needs doc - */ -__attribute__ ((weak)) -void suspend_power_down_user (void) { } -/** \brief Run keyboard level Power down - * - * FIXME: needs doc - */ -__attribute__ ((weak)) -void suspend_power_down_kb(void) { - suspend_power_down_user(); -} - /** \brief Power down * * FIXME: needs doc @@ -144,6 +147,8 @@ static void power_down(uint8_t wdto) */ void suspend_power_down(void) { + suspend_power_down_kb(); + #ifndef NO_SUSPEND_POWER_DOWN power_down(WDTO_15MS); #endif @@ -198,7 +203,7 @@ void suspend_wakeup_init(void) rgblight_timer_enable(); #endif #endif - suspend_wakeup_init_kb(); + suspend_wakeup_init_kb(); } #ifndef NO_SUSPEND_POWER_DOWN -- cgit v1.2.3 From b1f11636c63694f0e94504e5752e963c73f86c3b Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Sat, 15 Sep 2018 11:50:12 +1000 Subject: docs/contributing: add `#pragma once` to Coding Conventions This supersedes the older include guard mechanism since all the compilers now support it. It's easier for new users and less prone to error. --- docs/contributing.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/contributing.md b/docs/contributing.md index 8242cc1adc..7ed7cd06a5 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -70,6 +70,7 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * Do not write obvious comments * If you not sure if a comment is obvious, go ahead and include it. * In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. +* We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) # General Guidelines -- cgit v1.2.3 From db35065e1431246b5297e644a867ee6f5449a6f4 Mon Sep 17 00:00:00 2001 From: Graham P Heath Date: Sat, 15 Sep 2018 12:12:11 -0500 Subject: Keymap: Grahampheath: telophase fix and keymaps (#3888) * add my config * fix backlight, clean up that code * group background code, restore static var * qwerty is supposed to be in the middle * wrap layer change backlight in ifdef * backlight levels and some more 'emojis'. * Restructure to make it possible to press cmd ent on the right side of the board with one hand. * Expose the period through the number layer. Add Hyper keys to mouse layer * reduce mouse speed * add a : -P key * Thumbs up and down, remove some keys that are duplicated via function keys, clean up * fix build issues * add various emoji * duplicate default Meira keymaps * Miera updates * add documented but unmapped emoji * Sound for the Meira, was stumped by a file size! Thanks drashna! * add docs * docs * revert lib changes... * clean up * clean up * remove make file * Fixes missing key * clean up * add my lets split * add more emoji * add the telophase board (unofficially, I guess...) * add missing files * add/reset files * Review feedback implementation: Not needed. Add #define FLIP_HALF to your config.h file instead. * Review feedback implementation: All of these includes should be replaced with #include QMK_KEYBOARD_H. * Review feedback implementation: [FAILING] You may want to use LAYOUT_ortho_4x12 instead, and move this to /layouts/community/ortho_4x12/ instead. That way, you can use the same keymap for all of the boards. * clean up * add a key for command tilde (osx loves it) * at least its building again * remove adjusts and migrate layer switching to MO(_LAYER) * update the telophase readme * update the telophase readme * grahampheaths -> grahampheath * ONEHAND_ENABLE -> SWAP_HANDS_ENABLE * convert lets split to use ortho_4x12 * Move lets split keyboard layout into community/ortho_4x12 * make telophase use LAYOUT() * I did it?! * Add clap and grin * swap tabs and back and forward * whitespace * Add ellipsis and thanks emoji * Move flip_half to telophase config (conflicts with lets split layout) * Use #pragma once instead of config_user_h * remove unused stuff --- keyboards/planck/keymaps/grahampheath/config.h | 7 +------ layouts/community/ortho_4x12/grahampheath/config.h | 2 -- layouts/community/ortho_4x12/grahampheath/keymap.c | 22 ++++++++++++++++++---- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/keyboards/planck/keymaps/grahampheath/config.h b/keyboards/planck/keymaps/grahampheath/config.h index 1c842420bb..db24d273a4 100644 --- a/keyboards/planck/keymaps/grahampheath/config.h +++ b/keyboards/planck/keymaps/grahampheath/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) @@ -39,8 +36,6 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif - #define TAPPING_TERM 200 #undef BACKLIGHT_LEVELS diff --git a/layouts/community/ortho_4x12/grahampheath/config.h b/layouts/community/ortho_4x12/grahampheath/config.h index 21d647921c..8bc3d7762d 100644 --- a/layouts/community/ortho_4x12/grahampheath/config.h +++ b/layouts/community/ortho_4x12/grahampheath/config.h @@ -21,8 +21,6 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -#define FLIP_HALF - #include "keyboards/lets_split/config.h" /* Use I2C or Serial, not both */ diff --git a/layouts/community/ortho_4x12/grahampheath/keymap.c b/layouts/community/ortho_4x12/grahampheath/keymap.c index e2421e9a7e..0b84b66eb8 100644 --- a/layouts/community/ortho_4x12/grahampheath/keymap.c +++ b/layouts/community/ortho_4x12/grahampheath/keymap.c @@ -19,6 +19,7 @@ enum custom_keycodes { CONFUSED, CRY, CLAP, + ELIP, FLIP, FNGLEFT, FNGRIGHT, @@ -35,6 +36,7 @@ enum custom_keycodes { THMBDN, THMBUP, TOUNGE, + THANKS, WINK }; @@ -114,19 +116,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Emoji Layer * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ - * │HYPR0│ Q │ ;-) │ E │ 🤣 │ :-P │ Y │ U │:'-( │FLIP │ P │ │ + * │HYPR0│ Q │ ;-) │ E │ 🤣 │ :-P │ 🙏🏼 │ U │:'-( │FLIP │ P │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ * │HYPR1│ 👆 │SHRUG│ GRIN│ :-( │ G │ <3 │ :-) │ k │LLAP │ ; │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │HYPR2│🎶^🎶│💭^💭│ 👏 | :-\ │ 🐛 │ n │ :-D │ SHIT│ . │ / │ │ + * │HYPR2│🎶^🎶│💭^💭│ 👏 | :-\ │ 🐛 │ n │ :-D │ SHIT│ ... │ / │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │ * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ */ [_EMOJI] = LAYOUT_ortho_4x12( - HYPR_0, _______, WINK, _______, ROFL, TOUNGE, _______, _______, CRY, FLIP, _______, _______ , + HYPR_0, _______, WINK, _______, ROFL, TOUNGE, THANKS, _______, CRY, FLIP, _______, _______ , HYPR_1, ABOVE, SHRUG, GRIN, FROWN, _______, HEART, JOY, _______, LLAP, _______, _______ , - HYPR_2, SING, THINK, CLAP, CONFUSED, BUG, _______, _______, SHIT, _______, _______, _______ , + HYPR_2, SING, THINK, CLAP, CONFUSED, BUG, _______, _______, SHIT, ELIP, _______, _______ , _______, _______, _______, _______, KC_SLCK, KC_SLEP, KC_SLEP, KC_PAUS, FNGLEFT, THMBDN, THMBUP, FNGRIGHT ), }; @@ -174,6 +176,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case ELIP: + if (record->event.pressed) { + SEND_STRING("..."); + } + return false; + break; case FLIP: if (record->event.pressed) { SEND_STRING("&fliptable;"); @@ -246,6 +254,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case THANKS: + if (record->event.pressed) { + SEND_STRING("&thanks;"); + } + return false; + break; case THINK: if (record->event.pressed) { SEND_STRING("_think_"); -- cgit v1.2.3 From 9712501bf3291942067ac75b50b1675a265a3f11 Mon Sep 17 00:00:00 2001 From: Naoki Katahira Date: Sun, 16 Sep 2018 02:14:39 +0900 Subject: Keyboard: Add Lily58 Keyboard (#3893) * add Lily58 * file fix --- keyboards/lily58/config.h | 21 ++ keyboards/lily58/i2c.c | 162 +++++++++++ keyboards/lily58/i2c.h | 49 ++++ keyboards/lily58/keymaps/default/config.h | 41 +++ keyboards/lily58/keymaps/default/keymap.c | 155 ++++++++++ keyboards/lily58/keymaps/default/rules.mk | 22 ++ keyboards/lily58/lily58.c | 1 + keyboards/lily58/lily58.h | 28 ++ keyboards/lily58/matrix.c | 459 ++++++++++++++++++++++++++++++ keyboards/lily58/readme.md | 17 ++ keyboards/lily58/rev1/config.h | 86 ++++++ keyboards/lily58/rev1/rev1.c | 24 ++ keyboards/lily58/rev1/rev1.h | 61 ++++ keyboards/lily58/rev1/rules.mk | 1 + keyboards/lily58/rules.mk | 76 +++++ keyboards/lily58/serial.c | 445 +++++++++++++++++++++++++++++ keyboards/lily58/serial.h | 80 ++++++ keyboards/lily58/serial_config.h | 8 + keyboards/lily58/split_util.c | 86 ++++++ keyboards/lily58/split_util.h | 20 ++ keyboards/lily58/ssd1306.c | 330 +++++++++++++++++++++ keyboards/lily58/ssd1306.h | 94 ++++++ 22 files changed, 2266 insertions(+) create mode 100644 keyboards/lily58/config.h create mode 100644 keyboards/lily58/i2c.c create mode 100644 keyboards/lily58/i2c.h create mode 100644 keyboards/lily58/keymaps/default/config.h create mode 100644 keyboards/lily58/keymaps/default/keymap.c create mode 100644 keyboards/lily58/keymaps/default/rules.mk create mode 100644 keyboards/lily58/lily58.c create mode 100644 keyboards/lily58/lily58.h create mode 100644 keyboards/lily58/matrix.c create mode 100644 keyboards/lily58/readme.md create mode 100644 keyboards/lily58/rev1/config.h create mode 100644 keyboards/lily58/rev1/rev1.c create mode 100644 keyboards/lily58/rev1/rev1.h create mode 100644 keyboards/lily58/rev1/rules.mk create mode 100644 keyboards/lily58/rules.mk create mode 100644 keyboards/lily58/serial.c create mode 100644 keyboards/lily58/serial.h create mode 100644 keyboards/lily58/serial_config.h create mode 100644 keyboards/lily58/split_util.c create mode 100644 keyboards/lily58/split_util.h create mode 100644 keyboards/lily58/ssd1306.c create mode 100644 keyboards/lily58/ssd1306.h diff --git a/keyboards/lily58/config.h b/keyboards/lily58/config.h new file mode 100644 index 0000000000..db4844c910 --- /dev/null +++ b/keyboards/lily58/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "serial_config.h" \ No newline at end of file diff --git a/keyboards/lily58/i2c.c b/keyboards/lily58/i2c.c new file mode 100644 index 0000000000..084c890c40 --- /dev/null +++ b/keyboards/lily58/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/lily58/keymaps/default/config.h b/keyboards/lily58/keymaps/default/config.h new file mode 100644 index 0000000000..3077c94632 --- /dev/null +++ b/keyboards/lily58/keymaps/default/config.h @@ -0,0 +1,41 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// Underglow +/* +#undef RGBLED_NUM +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP +*/ \ No newline at end of file diff --git a/keyboards/lily58/keymaps/default/keymap.c b/keyboards/lily58/keymaps/default/keymap.c new file mode 100644 index 0000000000..624ce210b1 --- /dev/null +++ b/keyboards/lily58/keymaps/default/keymap.c @@ -0,0 +1,155 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ~ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER,KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, RAISE \ +), +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | _ | + | | | | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * | | | | | | |-------| |-------| |ISO ~ |ISO | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ +[_LOWER] = LAYOUT( \ + 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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),_______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______\ +), +/* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | Left | Down | Up |Right | | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * | | | | | | |-------| |-------| + | - | = | [ | ] | \ | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + +[_RAISE] = LAYOUT( \ + 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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* ADJUST (Layers for Underglow) + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | | | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + [_ADJUST] = LAYOUT( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lily58/keymaps/default/rules.mk b/keyboards/lily58/keymaps/default/rules.mk new file mode 100644 index 0000000000..73777a1b78 --- /dev/null +++ b/keyboards/lily58/keymaps/default/rules.mk @@ -0,0 +1,22 @@ + +# 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 +# + +OLED_ENABLE = no +RGBLIGHT_ENABLE = no + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +ONEHAND_ENABLE = no # Enable one-hand typing +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/lily58/lily58.c b/keyboards/lily58/lily58.c new file mode 100644 index 0000000000..697e3820c6 --- /dev/null +++ b/keyboards/lily58/lily58.c @@ -0,0 +1 @@ + #include "lily58.h" diff --git a/keyboards/lily58/lily58.h b/keyboards/lily58/lily58.h new file mode 100644 index 0000000000..1d64dd7b2a --- /dev/null +++ b/keyboards/lily58/lily58.h @@ -0,0 +1,28 @@ +#ifndef LILY58_H +#define LILY58_H + +#include "quantum.h" + +#ifdef KEYBOARD_lily58_rev1 + #include "rev1.h" +#endif + + + +// Used to create a keymap using only KC_ prefixed keys +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, \ + L41, L42, L43, L44, R41, R42, R43, R44 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L45, KC_##R40, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##R41, KC_##R42, KC_##R43, KC_##R44 \ + ) + +#endif diff --git a/keyboards/lily58/matrix.c b/keyboards/lily58/matrix.c new file mode 100644 index 0000000000..fc42dd14d9 --- /dev/null +++ b/keyboards/lily58/matrix.c @@ -0,0 +1,459 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" + +#ifdef USE_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#define ERROR_DISCONNECT_COUNT 5 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#endif + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col +#if (DIODE_DIRECTION == COL2ROW) + unselect_rows(); + init_cols(); +#elif (DIODE_DIRECTION == ROW2COL) + unselect_cols(); + init_rows(); +#endif + + TX_RX_LED_INIT; + + // 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) +{ + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); +#if (DIODE_DIRECTION == COL2ROW) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix+offset, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix+offset, current_col); +# endif + + } +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + debouncing = false; + } +# endif + + return 1; +} + +#ifdef USE_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#ifdef USE_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) + { + + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_cols(void) +{ + for(uint8_t x = 0; x < MATRIX_COLS; x++) { + uint8_t pin = col_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#endif diff --git a/keyboards/lily58/readme.md b/keyboards/lily58/readme.md new file mode 100644 index 0000000000..c71365e46b --- /dev/null +++ b/keyboards/lily58/readme.md @@ -0,0 +1,17 @@ +# Lily58 + +Lily58 is 6×4+5keys column-staggered split keyboard. + +![Lily58_01](https://user-images.githubusercontent.com/6285554/45210815-92744a00-b2cb-11e8-977a-8c1a93584f17.jpg) + +![Lily58_02](https://user-images.githubusercontent.com/6285554/45337733-7b33a600-b5c4-11e8-85b0-35f1cc9bf946.png) + +Keyboard Maintainer: [Naoki Katahira](https://github.com/kata0510/) [Twitter:@F_YUUCHI](https://twitter.com/F_YUUCHI) +Hardware Supported: Lily58 PCB, ProMicro +Hardware Availability: [PCB & Case Data](https://github.com/kata0510/Lily58) + +Make example for this keyboard (after setting up your build environment): + + make lily58: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). \ No newline at end of file diff --git a/keyboards/lily58/rev1/config.h b/keyboards/lily58/rev1/config.h new file mode 100644 index 0000000000..9413e8d4a2 --- /dev/null +++ b/keyboards/lily58/rev1/config.h @@ -0,0 +1,86 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2017 F_YUUCHI + +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 + +//#include QMK_KEYBOARD_CONFIG_H +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFC51 +#define PRODUCT_ID 0x0058 +#define DEVICE_VER 0x0100 +#define MANUFACTURER F_YUUCHI +#define PRODUCT Lily58 +#define DESCRIPTION Lily58 is 6×4+5keys column-staggered split keyboard. + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { C6, D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2, B6 } + +#define CATERINA_BOOTLOADER + +/* define tapping term */ +#define TAPPING_TERM 100 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 14 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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 \ No newline at end of file diff --git a/keyboards/lily58/rev1/rev1.c b/keyboards/lily58/rev1/rev1.c new file mode 100644 index 0000000000..64dd084b21 --- /dev/null +++ b/keyboards/lily58/rev1/rev1.c @@ -0,0 +1,24 @@ +#include "lily58.h" + +/* +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif +*/ + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + diff --git a/keyboards/lily58/rev1/rev1.h b/keyboards/lily58/rev1/rev1.h new file mode 100644 index 0000000000..a830463582 --- /dev/null +++ b/keyboards/lily58/rev1/rev1.h @@ -0,0 +1,61 @@ +#pragma once + +#include "lily58.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + + +//void promicro_bootloader_jmp(bool program); +#ifndef FLIP_HALF +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L45, R40, R30, R31, R32, R33, R34, R35, \ + L41, L42, L43, L44, R41, R42, R43, R44 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, R44, R43, R42, R41, R40 } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L45, R30, R31, R32, R33, R34, R35, R45, \ + L41, L42, L43, L44, R41, R42, R43, R44 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { KC_NO, R41, R42, R43, R44, R45 } \ + } +#endif \ No newline at end of file diff --git a/keyboards/lily58/rev1/rules.mk b/keyboards/lily58/rev1/rules.mk new file mode 100644 index 0000000000..f845616741 --- /dev/null +++ b/keyboards/lily58/rev1/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk new file mode 100644 index 0000000000..23527476a3 --- /dev/null +++ b/keyboards/lily58/rules.mk @@ -0,0 +1,76 @@ +SRC += matrix.c \ + i2c.c \ + split_util.c \ + serial.c \ + ssd1306.c + +# MCU name +#MCU = at90usb1287 +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 +# 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 = caterina + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SUBPROJECT_rev1 = no +USE_I2C = no +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = lily58/rev1 diff --git a/keyboards/lily58/serial.c b/keyboards/lily58/serial.c new file mode 100644 index 0000000000..f85dc28dc3 --- /dev/null +++ b/keyboards/lily58/serial.c @@ -0,0 +1,445 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef USE_SERIAL +//#ifndef USE_SERIAL_PD2 + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ return soft_serial_transaction(); } + +#endif // Simple API (OLD API, compatible with let's split serial.c) + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define TID_SEND_ADJUST 14 + +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#else +#error Illegal Serial Speed +#endif + + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_input_with_pullup(); + +#if SERIAL_PIN_MASK == _BV(PD0) + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#elif SERIAL_PIN_MASK == _BV(PD2) + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); +#else + #error unknown SERIAL_PIN_MASK value +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void)NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid; + uint8_t pecount = 0; + sync_recv(); + tid = serial_read_chunk(&pecount,4); + if(pecount> 0) + return; + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(sstd_index, 4); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif diff --git a/keyboards/lily58/serial.h b/keyboards/lily58/serial.h new file mode 100644 index 0000000000..d2b7fd8e60 --- /dev/null +++ b/keyboards/lily58/serial.h @@ -0,0 +1,80 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x4 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/lily58/serial_config.h b/keyboards/lily58/serial_config.h new file mode 100644 index 0000000000..fef689038e --- /dev/null +++ b/keyboards/lily58/serial_config.h @@ -0,0 +1,8 @@ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 \ No newline at end of file diff --git a/keyboards/lily58/split_util.c b/keyboards/lily58/split_util.c new file mode 100644 index 0000000000..ff069b7e28 --- /dev/null +++ b/keyboards/lily58/split_util.c @@ -0,0 +1,86 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "config.h" +#include "timer.h" + +#ifdef USE_I2C +# include "i2c.h" +#else +# include "serial.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { +#ifdef USE_I2C + i2c_master_init(); +//#ifdef SSD1306OLED +// matrix_master_OLED_init (); +//#endif +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + timer_init(); +#ifdef USE_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); +void keyboard_slave_loop(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/lily58/ssd1306.c b/keyboards/lily58/ssd1306.c new file mode 100644 index 0000000000..d079001199 --- /dev/null +++ b/keyboards/lily58/ssd1306.c @@ -0,0 +1,330 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#include "glcdfont.c" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ +#define ScreenOffInterval 300000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty) { + iota_gfx_flush(); + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} +#endif diff --git a/keyboards/lily58/ssd1306.h b/keyboards/lily58/ssd1306.h new file mode 100644 index 0000000000..59d31c9f32 --- /dev/null +++ b/keyboards/lily58/ssd1306.h @@ -0,0 +1,94 @@ +#ifndef SSD1306_H +#define SSD1306_H + +#include +#include +#include "pincontrol.h" +#include "config.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + + + +#endif -- cgit v1.2.3 From 232ef757832d46cb63550376a38d224472075996 Mon Sep 17 00:00:00 2001 From: Pascal Greilich Date: Sat, 15 Sep 2018 13:15:36 -0400 Subject: Keymap: A new alternative layout for planck (#3894) * a new planck layout * layout images * layout images 2 * typo * update include following PR comment * updates following PR commments 2 * updates following PR comments --- keyboards/planck/keymaps/pascamel/config.h | 38 +++++ keyboards/planck/keymaps/pascamel/keymap.c | 237 ++++++++++++++++++++++++++++ keyboards/planck/keymaps/pascamel/readme.md | 29 ++++ keyboards/planck/keymaps/pascamel/rules.mk | 1 + 4 files changed, 305 insertions(+) create mode 100644 keyboards/planck/keymaps/pascamel/config.h create mode 100644 keyboards/planck/keymaps/pascamel/keymap.c create mode 100644 keyboards/planck/keymaps/pascamel/readme.md create mode 100644 keyboards/planck/keymaps/pascamel/rules.mk diff --git a/keyboards/planck/keymaps/pascamel/config.h b/keyboards/planck/keymaps/pascamel/config.h new file mode 100644 index 0000000000..679d106ca0 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/pascamel/keymap.c b/keyboards/planck/keymaps/pascamel/keymap.c new file mode 100644 index 0000000000..9ee0dde359 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/keymap.c @@ -0,0 +1,237 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + BACKLIT, + MY_PWD +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Alt | GUI |Brite |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + KC_LCTL, KC_LALT, KC_LGUI, BACKLIT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | Prev | Play | Next | | | * | 4 | 5 | 6 | - | Del | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Pwd | Vol- | MUTE | Vol+ | | | / | 1 | 2 | 3 | + | PgUp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | 0 | . | = | PgDn | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_ASTR, KC_4, KC_5, KC_6, KC_MINS, KC_DEL, + MY_PWD, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_SLSH, KC_1, KC_2, KC_3, KC_PLUS, KC_PGUP, + _______, _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_EQL, KC_PGDN +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | ~ | | / | { | [ | ] | } | \ | - | + | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | _ | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Home | PgDn | PgUp | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + _______, KC_TILD, _______, KC_SLSH, KC_LCBR, KC_LBRC, KC_RBRC, KC_RCBR, KC_BSLS, KC_MINS, KC_PLUS, KC_PIPE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_EQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + #ifdef KEYBOARD_planck_rev5 + PORTE &= ~(1<<6); + #endif + } else { + unregister_code(KC_RSFT); + #ifdef KEYBOARD_planck_rev5 + PORTE |= (1<<6); + #endif + } + return false; + break; + case MY_PWD: + if (record->event.pressed) { + SEND_STRING("My secret password!"); + false; + } + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/pascamel/readme.md b/keyboards/planck/keymaps/pascamel/readme.md new file mode 100644 index 0000000000..b6be21cc97 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/readme.md @@ -0,0 +1,29 @@ +#### Base Layer + +A regular QWERTY layer, with Ctrl/alt/cmd on the bottom right corner + +![Qwerty](https://i.imgur.com/FpRNJZH.png) + + + +#### Lower ⇓ + +Focused on numbers and calculations + +![Lower](https://i.imgur.com/PyXSGba.png) + + + +#### Raise ⇑ + +Symbols + +![Raise](https://i.imgur.com/pYhqcnI.png) + + + +#### Adjust ⇑+⇓ + +Settings and configurations + +![Adjust](https://i.imgur.com/JN7a0Ku.png) diff --git a/keyboards/planck/keymaps/pascamel/rules.mk b/keyboards/planck/keymaps/pascamel/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/pascamel/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From 6bf2c077151bf6e71f5fe44f730c127eb667f5a6 Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Sat, 15 Sep 2018 10:50:38 -0700 Subject: Keymap: dz60/macos_arrow: rev3 (#3909) * Arrow keys are now arranged on hjkl (vi style) * The escape key is moved on capslock, shared with func layer switch * The grave key is now dedicated (not shared with escape) * Add a new numpad layer that can be activated with the spacebar * Fix layout mismatch between layers * Use bult-in underscore KC_TRNS alias --- keyboards/dz60/keymaps/macos_arrow/keymap.c | 77 +++++++++++++++++----------- keyboards/dz60/keymaps/macos_arrow/readme.md | 39 ++++++++++---- 2 files changed, 76 insertions(+), 40 deletions(-) diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index f4b03ddc95..9a3120afd3 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -1,9 +1,9 @@ #include QMK_KEYBOARD_H -#define ______ KC_TRNS -#define _BL 0 -#define _FL 1 -#define _ML 2 +#define _BL 0 // Base layer +#define _FL 1 // Function layer +#define _ML 2 // Media layer +#define _NL 2 // Numpad layer enum my_keycodes { BR_UP = SAFE_RANGE, @@ -12,45 +12,45 @@ enum my_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ,-----------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | * |-----------------------------------------------------------------------------------------+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | * |-----------------------------------------------------------------------------------------+ - * | _FL | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * | Esc/_FL | A | S | D | F | G | H | J | K | L | ; | ' | Enter | * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | _ML | Up |Shift| + * | Shift | Z | X | C | V | B | N | M | , | . | / | | Up |Shift| * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Alt | Gui | Space |Gui/_ML| Alt | Left| Down|Right| + * | Ctrl | Alt | Gui | Space / _NL |Gui/_ML| Alt | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ [_BL] = LAYOUT_2_shifts( - KC_GESC, 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_NO, KC_BSPC, + 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_NO, KC_BSPC, 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, - MO(_FL), 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, MO(_ML), KC_UP, KC_RSFT, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), + LT(_FL, KC_ESC), 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_A, KC_UP, KC_RSFT, + KC_LCTL, KC_LALT, KC_LGUI, KC_NO, LT(_NL, KC_SPC), KC_NO, LM(_ML, MOD_RGUI), KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT), /* ,-----------------------------------------------------------------------------------------. - * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | UP | | | | | | + * | | | | | | | |PgUp | | | | | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | Left| Down|Right| | | | + * | | | | | | | Left| Down| Up |Right| | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | | + * | | | | | | | |PgDwn| | | | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ - [_FL] = LAYOUT( - KC_GRV, 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_DEL, - ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, ______, ______, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, KC_LEFT, KC_DOWN, KC_RIGHT, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), + [_FL] = LAYOUT_2_shifts( + _______, 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_NO, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_PGDN, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), /* ,-----------------------------------------------------------------------------------------. - * |Eject| BR- | BR+ | F3 | F4 | | |PREV |PLAY |NEXT |MUTE | V- | V+ | | + * |Eject| BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | | | Reset | * |-----------------------------------------------------------------------------------------+ @@ -61,12 +61,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ - [_ML] = LAYOUT( - KC_MEDIA_EJECT, BR_DOWN, BR_UP, ______, ______, KC_F5, KC_F6, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RESET, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), + [_ML] = LAYOUT_2_shifts( + KC_MEDIA_EJECT, BR_DOWN, BR_UP, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | % | ( | ) | < | > | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | * | 0 | 1 | 2 | 3 | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | . | - | 4 | 5 | 6 | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | , | = | 7 | 8 | 9 | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + [_NL] = LAYOUT_2_shifts( + _______, _______, _______, _______, _______, _______, _______, _______, KC_PERCENT, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_LEFT_ANGLE_BRACKET, KC_RIGHT_ANGLE_BRACKET, KC_NO, _______, + _______, _______, _______, _______, _______, _______, _______, KC_ASTERISK, KC_0, KC_1, KC_2, KC_3, _______, RESET, + _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_MINS, KC_4, KC_5, KC_6, _______, + _______, KC_NO, _______, _______, _______, _______, _______, _______, KC_COMMA, KC_EQL, KC_7, KC_8, KC_9, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { diff --git a/keyboards/dz60/keymaps/macos_arrow/readme.md b/keyboards/dz60/keymaps/macos_arrow/readme.md index bba8148ba5..cb700b38f0 100644 --- a/keyboards/dz60/keymaps/macos_arrow/readme.md +++ b/keyboards/dz60/keymaps/macos_arrow/readme.md @@ -15,21 +15,22 @@ My build used the following components: ``` ,-----------------------------------------------------------------------------------------. -| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | +| ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | |-----------------------------------------------------------------------------------------+ | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | |-----------------------------------------------------------------------------------------+ -| _FL | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +| _FL/Esc | A | S | D | F | G | H | J | K | L | ; | ' | Enter | |-----------------------------------------------------------------------------------------+ -| Shift | Z | X | C | V | B | N | M | , | . | / | _ML | Up |Shift| +| Shift | Z | X | C | V | B | N | M | , | . | / | | Up |Shift| |-----------------------------------------------------------------------------------------+ -| Ctrl | Alt | Cmd | Space |Cmd/_ML| Alt | Left| Down|Right| +| Ctrl | Alt | Cmd | _NL / Space |Cmd/_ML| Alt | Left| Down|Right| `-----------------------------------------------------------------------------------------' ``` -* The escape key use `KC_GESC` to get grave accent on any letter with ``Alt+Esc`` and `` ` `` alone with the ``Hyper+Esc``. The `~` is obtained with `Shift+Esc`. `GRAVE_ESC_GUI_OVERRIDE` is define so `Cmd+Alt+Esc` can still work. -* The `Caps-Lock` (`Hyper`) key switch to the function layer (`_FL`). -* The right `Cmd` key is used to switch to the media layer (`_ML`) when used with keys mapped on that layer (the top row). Any other keys just act as a `Cmd+` that key. +* The escape key is moved to the capslock to get keep grave letter pristine. +* The `Caps-Lock` (`Hyper`) key switch to the function layer (`_FL`) or escape when used alone. +* The right `Cmd` key is used to switch to the media layer (`_ML`) when used with keys mapped on that layer. +* The space key can be used to switch to the numpad layer (`_NL`) when used with one of the mapped key on that layer. ## Function Layer (_FL) @@ -37,9 +38,9 @@ My build used the following components: ,-----------------------------------------------------------------------------------------. | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | |-----------------------------------------------------------------------------------------+ -| | | | | | | | | UP | | | | | | +| | | | | | | |PgDwn| PgUp| | | | | | |-----------------------------------------------------------------------------------------+ -| | | | | | | | Left| Down|Right| | | | +| | | | | | | Left| Down| Up |Right| | | | |-----------------------------------------------------------------------------------------+ | | | | | | | | | | | | | | | |-----------------------------------------------------------------------------------------+ @@ -47,13 +48,13 @@ My build used the following components: `-----------------------------------------------------------------------------------------' ``` -The function layer is activated by the `Caps-Lock` (`Hyper`) key to access `F` keys. In addition, the `IJKL` are mapped as cursor keys on that layer. +The function layer is activated by the `Caps-Lock` (`Hyper`) key to access `F` keys. In addition, the `HJKL` are mapped as cursor keys on that layer. ## Media Layer (_ML) ``` ,-----------------------------------------------------------------------------------------. -| | BR- | BR+ | F3 | F4 | | |PREV |PLAY |NEXT |MUTE | V- | V+ | Eject | +|Eject| BR- | BR+ | | | | |PREV |PLAY |NEXT |MUTE | V- | V+ | | |-----------------------------------------------------------------------------------------+ | | | | | | | | | | | | | | Reset | |-----------------------------------------------------------------------------------------+ @@ -67,4 +68,20 @@ The function layer is activated by the `Caps-Lock` (`Hyper`) key to access `F` k The media layer is activated by the right `Cmd` (`FN`) key. It contains the typical macos media keys on the top row. Blank keys act as `Cmd+` that key on the base layer. +## Numpad Layer (_NL) +``` +,-----------------------------------------------------------------------------------------. +| | | | | | | | | % | ( | ) | < | > | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | * | 0 | 1 | 2 | 3 | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | . | - | 4 | 5 | 6 | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | , | = | 7 | 8 | 9 | | | +|-----------------------------------------------------------------------------------------+ +| | | | | | | | | | +`-----------------------------------------------------------------------------------------' +``` + +The numpad layer is activated by the space bar, when hold. \ No newline at end of file -- cgit v1.2.3 From b65e2143751fd7c1721a6690597f523137c7c484 Mon Sep 17 00:00:00 2001 From: omkbd Date: Sun, 16 Sep 2018 02:57:46 +0900 Subject: Keyboard: add ergodash mini keyboard (#3901) * add ergodash mini add ergodash mini (4rows version) fix keymap and readme * fix replace include guard remove includes * fix audio --- keyboards/ergodash/ergodash.h | 18 ++++ keyboards/ergodash/mini/config.h | 97 +++++++++++++++++ keyboards/ergodash/mini/info.json | 13 +++ keyboards/ergodash/mini/keymaps/default/config.h | 39 +++++++ keyboards/ergodash/mini/keymaps/default/keymap.c | 129 +++++++++++++++++++++++ keyboards/ergodash/mini/keymaps/default/rules.mk | 0 keyboards/ergodash/mini/mini.c | 13 +++ keyboards/ergodash/mini/mini.h | 60 +++++++++++ keyboards/ergodash/mini/readme.md | 18 ++++ keyboards/ergodash/mini/rules.mk | 2 + keyboards/ergodash/readme.md | 4 +- keyboards/ergodash/rev2/config.h | 2 + keyboards/ergodash/rev2/keymaps/default/keymap.c | 30 +++--- keyboards/ergodash/rev2/rules.mk | 3 +- keyboards/ergodash/rules.mk | 2 +- 15 files changed, 411 insertions(+), 19 deletions(-) create mode 100644 keyboards/ergodash/mini/config.h create mode 100644 keyboards/ergodash/mini/info.json create mode 100644 keyboards/ergodash/mini/keymaps/default/config.h create mode 100644 keyboards/ergodash/mini/keymaps/default/keymap.c create mode 100644 keyboards/ergodash/mini/keymaps/default/rules.mk create mode 100644 keyboards/ergodash/mini/mini.c create mode 100644 keyboards/ergodash/mini/mini.h create mode 100644 keyboards/ergodash/mini/readme.md create mode 100644 keyboards/ergodash/mini/rules.mk diff --git a/keyboards/ergodash/ergodash.h b/keyboards/ergodash/ergodash.h index 9900a1def8..bf2bac581e 100644 --- a/keyboards/ergodash/ergodash.h +++ b/keyboards/ergodash/ergodash.h @@ -43,4 +43,22 @@ ) #endif // #ifdef KEYBOARD_ergodash_rev2 +#ifdef KEYBOARD_ergodash_mini + #include "mini.h" + + // Used to create a keymap using only KC_ prefixed keys + #define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36 \ + ) +#endif // #ifdef KEYBOARD_ergodash_mini + #endif diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h new file mode 100644 index 0000000000..a7be1635c1 --- /dev/null +++ b/keyboards/ergodash/mini/config.h @@ -0,0 +1,97 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0100 +#define MANUFACTURER Omkbd +#define PRODUCT ErgoDashmini +#define DESCRIPTION Power + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 8 +#define MATRIX_COLS 7 + +// wiring of each half +#define MATRIX_ROW_PINS { D7, E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define tapping term */ +#define TAPPING_TERM 120 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +#define C6_AUDIO +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define GOODBYE_SONG SONG(GOODBYE_SOUND) +#endif + +/* number of backlight levels */ +#ifdef BACKLIGHT_ENABLE + #define BACKLIGHT_PIN B6 + #define BACKLIGHT_LEVELS 7 +// #define BACKLIGHT_BREATHING +// #define BREATHING_PERIOD 4 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 20 // Number of LEDs +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +/* + * 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/ergodash/mini/info.json b/keyboards/ergodash/mini/info.json new file mode 100644 index 0000000000..538e0b8720 --- /dev/null +++ b/keyboards/ergodash/mini/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "ErgoDash mini", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 6.25, + "layouts": { + "LAYOUT": { + "key_count": 56, + "layout": [{"label":"L00", "x":0, "y":1.375}, {"label":"L01", "x":1, "y":1.375}, {"label":"L02", "x":2, "y":1.125}, {"label":"L03", "x":3, "y":1}, {"label":"L04", "x":4, "y":1.125}, {"label":"L05", "x":5, "y":1.25}, {"label":"L06", "x":6, "y":1.75}, {"label":"R00", "x":11, "y":1.75}, {"label":"R01", "x":12, "y":1.25}, {"label":"R02", "x":13, "y":1.125}, {"label":"R03", "x":14, "y":1}, {"label":"R04", "x":15, "y":1.125}, {"label":"R05", "x":16, "y":1.375}, {"label":"R06", "x":17, "y":1.375}, {"label":"L10", "x":0, "y":2.375}, {"label":"L11", "x":1, "y":2.375}, {"label":"L12", "x":2, "y":2.125}, {"label":"L13", "x":3, "y":2}, {"label":"L14", "x":4, "y":2.125}, {"label":"L15", "x":5, "y":2.25}, {"label":"L16", "x":6, "y":2.75}, {"label":"R10", "x":11, "y":2.75}, {"label":"R11", "x":12, "y":2.25}, {"label":"R12", "x":13, "y":2.125}, {"label":"R13", "x":14, "y":2}, {"label":"R14", "x":15, "y":2.125}, {"label":"R15", "x":16, "y":2.375}, {"label":"R16", "x":17, "y":2.375}, {"label":"L20", "x":0, "y":3.375}, {"label":"L21", "x":1, "y":3.375}, {"label":"L22", "x":2, "y":3.125}, {"label":"L23", "x":3, "y":3}, {"label":"L24", "x":4, "y":3.125}, {"label":"L25", "x":5, "y":3.25}, {"label":"L26", "x":6.5, "y":4.25}, {"label":"R20", "x":10.5, "y":4.25}, {"label":"R21", "x":12, "y":3.25}, {"label":"R22", "x":13, "y":3.125}, {"label":"R23", "x":14, "y":3}, {"label":"R24", "x":15, "y":3.125}, {"label":"R25", "x":16, "y":3.375}, {"label":"R26", "x":17, "y":3.375}, {"label":"L30", "x":0, "y":4.375}, {"label":"L31", "x":1, "y":4.375}, {"label":"L32", "x":2, "y":4.125}, {"label":"L33", "x":3, "y":4}, {"label":"L34", "x":5.5, "y":5.25}, {"label":"L35", "x":6.5, "y":5.25}, {"label":"L36", "x":7.5, "y":4.25, "h":2}, {"label":"R30", "x":9.5, "y":4.25, "h":2}, {"label":"R31", "x":10.5, "y":5.25}, {"label":"R32", "x":11.5, "y":5.25}, {"label":"R33", "x":14, "y":4}, {"label":"R34", "x":15, "y":4.125}, {"label":"R35", "x":16, "y":4.375}, {"label":"R36", "x":17, "y":4.375}] + } + } +} diff --git a/keyboards/ergodash/mini/keymaps/default/config.h b/keyboards/ergodash/mini/keymaps/default/config.h new file mode 100644 index 0000000000..a5a722fb2a --- /dev/null +++ b/keyboards/ergodash/mini/keymaps/default/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* 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 20 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/ergodash/mini/keymaps/default/keymap.c b/keyboards/ergodash/mini/keymaps/default/keymap.c new file mode 100644 index 0000000000..ecf1f723f7 --- /dev/null +++ b/keyboards/ergodash/mini/keymaps/default/keymap.c @@ -0,0 +1,129 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define EISU LALT(KC_GRV) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,----------------------------------------------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | Tab | A | S | D | F | G | [ | | ] | H | J | K | L | ; | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space|Delete|||||||| Bksp | Enter| Raise|||||||| Left | Down | Up | Right| + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LBRC, KC_RBRC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC , KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,----------------------------------------------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | 1 | 2 | 3 | 4 | 5 | { | | } | Left | Down | Up | Right| : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space|Delete|||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_LOWER] = LAYOUT( + KC_GRV , KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LCBR, KC_RCBR, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_COLN, KC_DQT , \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC , KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), + + /* Raise + * ,----------------------------------------------------------------------------------------------------------------------. + * | ` | ! | @ | # | $ | % | _ | | + | ^ | & | * | ( | ) | | | + * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| + * | ~ | F1 | F2 | F3 | F4 | F5 | { | | } | Left | Down | Up | Right| : | " | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | Shift| F6 | F7 | F8 | F9 | F10 | Space| | Enter| N | M | < | > | ? | Shift| + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | Ctrl | F11 | F12 | EISU |||||||| Lower| Space|Delete|||||||| Bksp | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_RAISE] = LAYOUT( + KC_GRV , KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, KC_COLN, KC_DQT , \ + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_F11 , KC_F12, EISU, LOWER, KC_SPC , KC_DEL, KC_BSPC,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), + + /* Adjust + * ,----------------------------------------------------------------------------------------------------------------------. + * | | Reset|RGB ON| MODE| HUE-| HUE+| | | | SAT-| SAT+| VAL-| VAL+| | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| + * | | | | |||||||| | | |||||||| | | |||||||| | | | | + * ,----------------------------------------------------------------------------------------------------------------------. + */ + [_ADJUST] = LAYOUT( + _______, RESET , RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI,_______, _______, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, \ + _______, _______, BL_TOGG, BL_BRTG, BL_INC , BL_DEC ,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______,_______,_______, _______,_______, _______, _______, _______, _______, _______ \ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergodash/mini/keymaps/default/rules.mk b/keyboards/ergodash/mini/keymaps/default/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/ergodash/mini/mini.c b/keyboards/ergodash/mini/mini.c new file mode 100644 index 0000000000..89b8212976 --- /dev/null +++ b/keyboards/ergodash/mini/mini.c @@ -0,0 +1,13 @@ +#include "ergodash.h" + +#ifdef AUDIO_ENABLE + float tone_startup[][2] = SONG(STARTUP_SOUND); + float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif diff --git a/keyboards/ergodash/mini/mini.h b/keyboards/ergodash/mini/mini.h new file mode 100644 index 0000000000..74e5741706 --- /dev/null +++ b/keyboards/ergodash/mini/mini.h @@ -0,0 +1,60 @@ +#ifndef MINI_H +#define MINI_H + +#include "ergodash.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R06, R05, R04, R03, R02, R01, R00 }, \ + { R16, R15, R14, R13, R12, R11, R10 }, \ + { R26, R25, R24, R23, R22, R21, R20 }, \ + { R36, R35, R34, R33, R32, R31, R30 }, \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ + L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ + L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ + L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { R00, R01, R02, R03, R04, R05, R06 }, \ + { R10, R11, R12, R13, R14, R15, R16 }, \ + { R20, R21, R22, R23, R24, R25, R26 }, \ + { R30, R31, R32, R33, R34, R35, R36 }, \ + } +#endif + +#endif diff --git a/keyboards/ergodash/mini/readme.md b/keyboards/ergodash/mini/readme.md new file mode 100644 index 0000000000..f830f3f1d9 --- /dev/null +++ b/keyboards/ergodash/mini/readme.md @@ -0,0 +1,18 @@ +# ErgoDash mini + +![ErgoDash mini](https://github.com/omkbd/picture/blob/master/Ergodashmini.jpg) + +Keyboard Maintainer: [omkbd](https://github.com/omkbd) [@omkbd](https://twitter.com/omkbd) +Hardware Supported: ErgoDash mini PCB, Pro Micro ATmega32u4 +Hardware Availability: Order your own [yourself](https://github.com/omkbd/ErgoDash) + + +Make example for this keyboard (after setting up your build environment): + + make ergodash/mini:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +# Layout +![layout](https://github.com/omkbd/picture/blob/master/ergodashmini-layout.png) +![PCB](https://github.com/omkbd/picture/blob/master/Ergodashmini_PCB.jpg) diff --git a/keyboards/ergodash/mini/rules.mk b/keyboards/ergodash/mini/rules.mk new file mode 100644 index 0000000000..b6c9a25805 --- /dev/null +++ b/keyboards/ergodash/mini/rules.mk @@ -0,0 +1,2 @@ +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/ergodash/readme.md b/keyboards/ergodash/readme.md index d0d1dcb569..7fa76344f1 100644 --- a/keyboards/ergodash/readme.md +++ b/keyboards/ergodash/readme.md @@ -1,6 +1,6 @@ # ErgoDash -![ErgoDash](https://github.com/omkbd/picture/blob/master/IMG_20180630_1702141.jpg) +![ErgoDash](https://github.com/omkbd/picture/blob/master/Ergodash.jpg) Keyboard Maintainer: [omkbd](https://github.com/omkbd) [@omkbd](https://twitter.com/omkbd) Hardware Supported: ErgoDash PCB, Pro Micro ATmega32u4 @@ -15,4 +15,4 @@ See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) # Layout ![layout](https://github.com/omkbd/picture/blob/master/ergodash-layout.png) -![PCB](https://github.com/omkbd/picture/blob/master/IMG_20180630_2022231.jpg) +![PCB](https://github.com/omkbd/picture/blob/master/Ergodash_PCB.jpg) diff --git a/keyboards/ergodash/rev2/config.h b/keyboards/ergodash/rev2/config.h index d0b396cd40..489afe0178 100644 --- a/keyboards/ergodash/rev2/config.h +++ b/keyboards/ergodash/rev2/config.h @@ -45,6 +45,8 @@ along with this program. If not, see . /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST +#define C6_AUDIO + /* number of backlight levels */ #ifdef BACKLIGHT_ENABLE #define BACKLIGHT_PIN B6 diff --git a/keyboards/ergodash/rev2/keymaps/default/keymap.c b/keyboards/ergodash/rev2/keymaps/default/keymap.c index dc1f6eedd0..418089e1b0 100644 --- a/keyboards/ergodash/rev2/keymaps/default/keymap.c +++ b/keyboards/ergodash/rev2/keymaps/default/keymap.c @@ -19,29 +19,29 @@ enum custom_keycodes { // Fillers to make layering more clear #define _______ KC_TRNS #define XXXXXXX KC_NO -#define KC_JPN LALT(KC_GRV) +#define EISU LALT(KC_GRV) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,----------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 | Caps | + * | ESC | 1 | 2 | 3 | 4 | 5 | [ | | ] | 6 | 7 | 8 | 9 | 0 |Pscree| * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| * | ` | Q | W | E | R | T | - | | = | Y | U | I | O | P | \ | * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| * | Tab | A | S | D | F | G | Del | | Bksp | H | J | K | L | ; | " | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | JPN | | Enter| N | M | , | . | / | Shift| + * | Shift| Z | X | C | V | B | Space| | Enter| N | M | , | . | / | Shift| * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt |Adjust|||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Left | Down | Up | Right| + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Left | Down | Up | Right| * ,----------------------------------------------------------------------------------------------------------------------. */ [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_CAPS, \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LBRC, KC_RBRC, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PSCR, \ KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_EQL , KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_JPN , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_SPC , KC_ENT , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -52,17 +52,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | | Enter| N | M | < | > | ? | Shift| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt |Adjust|||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | * ,----------------------------------------------------------------------------------------------------------------------. */ [_LOWER] = LAYOUT( KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Raise @@ -73,17 +73,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+--------------------+------+------+------+------+------+------+------| * | Tab | 1 | 2 | 3 | 4 | 5 | Del | | Bksp | H | J | K | L | : | " | * |------+------+------+------+------+------+---------------------------+------+------+------+------+------+------+------| - * | Shift| 6 | 7 | 8 | 9 | 0 | JPN | | Enter| N | M | < | > | ? | Shift| + * | Shift| 6 | 7 | 8 | 9 | 0 | Space| | Enter| N | M | < | > | ? | Shift| * |-------------+------+------+------+------+------+------+------+------+------+------+------+------+------+-------------| - * | Ctrl | GUI | ALt |Adjust|||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | + * | Ctrl | GUI | ALt | EISU |||||||| Lower| Space| |||||||| | Enter| Raise|||||||| Home |PageDn|PageUp| End | * ,----------------------------------------------------------------------------------------------------------------------. */ [_RAISE] = LAYOUT( KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LCBR, KC_RCBR, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_UNDS, KC_PLUS, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PIPE, \ KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_DEL , KC_BSPC, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_DQT , \ - KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_JPN , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, ADJUST, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + KC_LSFT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SPC , KC_ENT , KC_N, KC_M, KC_LT, KC_GT, KC_QUES, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, EISU, LOWER, KC_SPC ,_______, _______,KC_ENT , RAISE, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), /* Adjust diff --git a/keyboards/ergodash/rev2/rules.mk b/keyboards/ergodash/rev2/rules.mk index bd518d8f27..b6c9a25805 100644 --- a/keyboards/ergodash/rev2/rules.mk +++ b/keyboards/ergodash/rev2/rules.mk @@ -1 +1,2 @@ -BACKLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no diff --git a/keyboards/ergodash/rules.mk b/keyboards/ergodash/rules.mk index fc06d60e28..bf0df4040f 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/ergodash/rules.mk @@ -64,7 +64,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -- cgit v1.2.3 From 743449472e58651ec8111e6f70811103fb0a28bd Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 10:48:02 -0700 Subject: Make `PREVENT_STUCK_MODIFIERS` the default (#3107) * Remove chording as it is not documented, not used, and needs work. * Make Leader Key an optional feature. * Switch from `PREVENT_STUCK_MODIFIERS` to `STRICT_LAYER_RELEASE` * Remove `#define PREVENT_STUCK_MODIFIERS` from keymaps. --- common_features.mk | 11 ++-- docs/config_options.md | 4 +- docs/feature_leader_key.md | 8 +++ docs/understanding_qmk.md | 2 +- keyboards/1upkeyboards/1up60rgb/config.h | 3 - keyboards/1upkeyboards/sweet16/config.h | 7 +- keyboards/acr60/config.h | 3 - keyboards/alf/x2/config.h | 5 +- keyboards/alpha/config.h | 2 - keyboards/alu84/config.h | 3 - keyboards/at101_blackheart/config.h | 3 - keyboards/atreus/keymaps/jeremy/keymap.c | 2 - keyboards/atreus/keymaps/khitsule/config.h | 4 +- keyboards/atreus/keymaps/xk/config.h | 3 +- keyboards/atreus62/keymaps/mneme/config.h | 1 - keyboards/atreus62/keymaps/mneme/rules.mk | 1 + .../bfo9000/keymaps/andylikescandy6x18/config.h | 3 - keyboards/bigseries/1key/config.h | 3 - keyboards/bigseries/2key/config.h | 3 - keyboards/bigseries/3key/config.h | 3 - keyboards/bigseries/4key/config.h | 3 - keyboards/bigswitch/config.h | 2 - keyboards/catch22/config.h | 3 - keyboards/chimera_ergo/config.h | 2 - keyboards/chimera_ls/config.h | 2 - keyboards/chimera_ortho/config.h | 2 - keyboards/chocopad/config.h | 6 +- keyboards/clueboard/60/config.h | 3 - keyboards/clueboard/66/keymaps/bloodlvst/config.h | 1 - keyboards/comet46/config.h | 2 - keyboards/contra/config.h | 4 -- keyboards/contra/keymaps/ryanm101/config.h | 5 +- keyboards/crawlpad/config.h | 3 - keyboards/crkbd/keymaps/default/config.h | 1 - keyboards/dichotemy/config.h | 2 - keyboards/dilly/config.h | 6 +- keyboards/dz60/config.h | 3 - keyboards/dz60/keymaps/LEdiodes/config.h | 3 - keyboards/ergodone/config.h | 2 - keyboards/ergodox_ez/config.h | 2 - .../ergodox_ez/keymaps/heartrobotninja/rules.mk | 3 +- keyboards/ergodox_ez/keymaps/vim/vim.h | 1 - keyboards/ergodox_infinity/keymaps/gordon/config.h | 2 - keyboards/ergodox_infinity/keymaps/narze/config.h | 1 - .../keymaps/not-quite-neo/rules.mk | 3 +- keyboards/ergoinu/config.h | 2 - keyboards/ergotravel/keymaps/ckofy/config.h | 3 - keyboards/felix/config.h | 4 +- keyboards/four_banger/config.h | 5 +- keyboards/fourier/keymaps/jennetters/config.h | 5 +- keyboards/fractal/config.h | 4 -- keyboards/frosty_flake/keymaps/nikchi/rules.mk | 3 +- keyboards/gh80_3000/config.h | 6 +- keyboards/gherkin/config.h | 6 +- keyboards/gherkin/keymaps/talljoe_gherkin/config.h | 4 +- keyboards/gonnerd/keymaps/gam3cat/config.h | 1 - keyboards/hadron/keymaps/default/config.h | 1 - keyboards/hadron/keymaps/side_numpad/config.h | 1 - keyboards/handwired/MS_sculpt_mobile/config.h | 8 +-- .../handwired/atreus50/keymaps/ajp10304/config.h | 2 - keyboards/handwired/dactyl/config.h | 2 - keyboards/handwired/kbod/config.h | 4 +- .../handwired/promethium/keymaps/default/config.h | 2 - .../handwired/promethium/keymaps/priyadi/config.h | 2 - keyboards/handwired/space_oddity/config.h | 4 -- keyboards/helix/pico/config.h | 1 - keyboards/helix/rev1/keymaps/OLED_sample/config.h | 3 +- keyboards/helix/rev2/config.h | 1 - keyboards/hhkb/keymaps/blakedietz/rules.mk | 1 + keyboards/infinity60/config.h | 2 - keyboards/iris/keymaps/davidrambo/config.h | 1 - keyboards/iris/keymaps/jennetters/config.h | 5 +- keyboards/iris/keymaps/krusli/config.h | 2 - keyboards/iris/keymaps/xyverz/config.h | 2 - keyboards/jc65/v32u4/keymaps/gam3cat/config.h | 1 - keyboards/jj40/keymaps/ajp10304/config.h | 8 --- keyboards/jj40/keymaps/fun40/config.h | 1 - keyboards/jj40/keymaps/krusli/config.h | 1 - keyboards/jj40/keymaps/oscillope/config.h | 1 - keyboards/jj40/keymaps/suzuken/config.h | 1 - keyboards/jj40/keymaps/waples/config.h | 1 - keyboards/jm60/config.h | 2 - keyboards/k_type/config.h | 2 - keyboards/katana60/config.h | 3 +- keyboards/kbd75/config.h | 3 - .../kinesis/keymaps/insertsnideremarks/config.h | 1 - keyboards/lets_split/keymaps/OLED_sample/config.h | 2 - keyboards/lets_split/keymaps/adam/config.h | 1 - keyboards/lets_split/keymaps/khord/config.h | 3 - keyboards/lets_split/keymaps/piemod/config.h | 1 - keyboards/lets_split/keymaps/waples/config.h | 2 - keyboards/lets_split/keymaps/xk/config.h | 1 - keyboards/m10a/keymaps/gam3cat/config.h | 2 - keyboards/mechmini/v2/config.h | 3 - keyboards/melody96/config.h | 3 - keyboards/minidox/keymaps/alairock/config.h | 1 - keyboards/minidox/keymaps/khitsule/config.h | 4 +- keyboards/mint60/config.h | 1 - keyboards/mitosis/config.h | 2 - keyboards/niu_mini/config.h | 3 - keyboards/novelpad/config.h | 3 - keyboards/noxary/268/config.h | 5 +- keyboards/ok60/config.h | 3 - keyboards/omnikey_blackheart/config.h | 6 +- keyboards/paladin64/config.h | 2 - keyboards/pegasushoof/keymaps/citadel/config.h | 3 - keyboards/planck/keymaps/ajp10304/config.h | 8 --- keyboards/planck/keymaps/altgr/config.h | 3 - keyboards/planck/keymaps/am/config.h | 3 - keyboards/planck/keymaps/andylikescandy/config.h | 3 - keyboards/planck/keymaps/bone2planck/config.h | 8 --- keyboards/planck/keymaps/davidrambo/config.h | 5 +- keyboards/planck/keymaps/dshields/config.h | 1 - keyboards/planck/keymaps/espynn/keymap.c | 1 - keyboards/planck/keymaps/experimental/config.h | 2 - keyboards/planck/keymaps/experimental/rules.mk | 3 +- keyboards/planck/keymaps/hiea/config.h | 3 - keyboards/planck/keymaps/hieax/config.h | 3 - keyboards/planck/keymaps/ishtob/config.h | 2 - keyboards/planck/keymaps/jarred/config.h | 4 +- keyboards/planck/keymaps/jeremy-dev/keymap.c | 1 - keyboards/planck/keymaps/kmontag42/rules.mk | 1 + keyboards/planck/keymaps/lae3/config.h | 8 --- keyboards/planck/keymaps/mitch/config.h | 3 +- keyboards/planck/keymaps/mitch/readme.md | 4 -- keyboards/planck/keymaps/narze/config.h | 3 +- keyboards/planck/keymaps/neo2planck/config.h | 8 --- keyboards/planck/keymaps/priyadi/config.h | 2 - keyboards/planck/keymaps/sdothum/config.h | 3 - keyboards/planck/keymaps/steno/config.h | 4 +- keyboards/planck/keymaps/tehwalris/config.h | 4 +- keyboards/planck/keymaps/vifon/config.h | 3 - keyboards/planck/keymaps/yale/config.h | 11 ---- keyboards/planck/keymaps/zach/config.h | 1 - keyboards/planck/rev6/config.h | 3 - keyboards/playkbtw/ca66/config.h | 2 - keyboards/playkbtw/pk60/config.h | 5 +- keyboards/preonic/keymaps/bucktooth/config.h | 1 - keyboards/preonic/keymaps/jacwib/config.h | 1 - keyboards/preonic/keymaps/kuatsure/rules.mk | 1 + keyboards/preonic/keymaps/that_canadian/config.h | 8 --- keyboards/preonic/keymaps/zach/config.h | 1 - keyboards/preonic/rev3/config.h | 3 - keyboards/prime_r/config.h | 4 -- .../rorschach/keymaps/insertsnideremarks/config.h | 1 - keyboards/s60_x/keymaps/bluebear/config.h | 3 - keyboards/s60_x/rgb/config.h | 5 +- keyboards/s65_plus/config.h | 3 - keyboards/s65_x/config.h | 4 -- keyboards/sx60/config.h | 4 -- keyboards/telophase/config.h | 2 - keyboards/tetris/config.h | 5 +- .../bananasplit/keymaps/talljoe/config.h | 1 - keyboards/tokyo60/config.h | 3 - keyboards/tomato/config.h | 3 - keyboards/uk78/config.h | 3 - keyboards/viterbi/keymaps/drashna/config.h | 2 +- keyboards/whitefox/config.h | 2 - keyboards/xd60/keymaps/kmontag42/rules.mk | 1 + keyboards/xd75/keymaps/davidrambo/config.h | 3 +- keyboards/xd75/keymaps/tdl-jturner/config.h | 1 - keyboards/xmmx/config.h | 6 +- keyboards/ymd96/keymaps/hgoel89/config.h | 1 - keyboards/z150_blackheart/config.h | 6 +- keyboards/zeal60/keymaps/tusing/config.h | 4 -- keyboards/zlant/config.h | 3 - layouts/community/60_ansi/talljoe-ansi/config.h | 1 - .../60_ansi_split_bs_rshift/talljoe/config.h | 1 - layouts/community/60_hhkb/talljoe-hhkb/config.h | 1 - layouts/community/ergodox/adam/config.h | 1 - layouts/community/ergodox/albert/rules.mk | 3 +- layouts/community/ergodox/algernon/rules.mk | 1 + layouts/community/ergodox/alphadox/config.h | 1 - layouts/community/ergodox/deadcyclo/rules.mk | 1 + .../community/ergodox/erez_experimental/rules.mk | 3 +- layouts/community/ergodox/familiar/rules.mk | 1 + layouts/community/ergodox/mclennon_osx/README.md | 4 +- layouts/community/ergodox/techtomas/readme.md | 2 +- layouts/community/ortho_4x12/symbolic/config.h | 4 -- layouts/community/tkl_ansi/talljoe-tkl/config.h | 1 - quantum/process_keycode/process_chording.c | 76 ---------------------- quantum/process_keycode/process_chording.h | 32 --------- quantum/process_keycode/process_leader.c | 2 +- quantum/quantum.c | 7 +- quantum/quantum.h | 7 +- quantum/quantum_keycodes.h | 6 +- tmk_core/common/action.c | 2 +- tmk_core/common/action.h | 2 +- tmk_core/common/action_layer.c | 4 +- tmk_core/common/action_layer.h | 2 +- users/333fred/333fred_config.h | 1 - users/bocaj/config.h | 1 - users/drashna/config.h | 5 -- users/ishtob/config.h | 3 +- users/replicaJunction/config.h | 6 -- users/talljoe/config.h | 1 - users/wanleg/config.h | 2 - users/zer09/config.h | 2 +- 198 files changed, 91 insertions(+), 599 deletions(-) delete mode 100644 keyboards/jj40/keymaps/ajp10304/config.h delete mode 100644 keyboards/m10a/keymaps/gam3cat/config.h delete mode 100644 keyboards/planck/keymaps/ajp10304/config.h delete mode 100644 keyboards/planck/keymaps/bone2planck/config.h delete mode 100644 keyboards/planck/keymaps/lae3/config.h delete mode 100644 keyboards/planck/keymaps/neo2planck/config.h delete mode 100644 keyboards/planck/keymaps/yale/config.h delete mode 100644 keyboards/preonic/keymaps/that_canadian/config.h create mode 100644 keyboards/xd60/keymaps/kmontag42/rules.mk delete mode 100644 quantum/process_keycode/process_chording.c delete mode 100644 quantum/process_keycode/process_chording.h diff --git a/common_features.mk b/common_features.mk index c637582d45..7af7789808 100644 --- a/common_features.mk +++ b/common_features.mk @@ -221,7 +221,6 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes) include $(TMK_DIR)/protocol/usb_hid.mk endif - ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += drivers/avr/hd44780.c OPT_DEFS += -DHD44780_ENABLE @@ -232,11 +231,15 @@ ifeq ($(strip $(DYNAMIC_KEYMAP_ENABLE)), yes) SRC += $(QUANTUM_DIR)/dynamic_keymap.c endif +ifeq ($(strip $(LEADER_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/process_keycode/process_leader.c + OPT_DEFS += -DLEADER_ENABLE +endif + QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ - $(QUANTUM_DIR)/keycode_config.c \ - $(QUANTUM_DIR)/process_keycode/process_leader.c + $(QUANTUM_DIR)/keycode_config.c ifndef CUSTOM_MATRIX ifeq ($(strip $(SPLIT_KEYBOARD)), yes) @@ -251,5 +254,5 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ $(QUANTUM_DIR)/split_common/split_util.c \ $(QUANTUM_DIR)/split_common/i2c.c \ - $(QUANTUM_DIR)/split_common/serial.c + $(QUANTUM_DIR)/split_common/serial.c endif diff --git a/docs/config_options.md b/docs/config_options.md index eaaa59872c..072857727b 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -119,8 +119,8 @@ If you define these options you will enable the associated feature, which may in * `#define FORCE_NKRO` * NKRO by default requires to be turned on, this forces it on during keyboard startup regardless of EEPROM setting. NKRO can still be turned off but will be turned on again if the keyboard reboots. -* `#define PREVENT_STUCK_MODIFIERS` - * stores the layer a key press came from so the same layer is used when the key is released, regardless of which layers are enabled +* `#define STRICT_LAYER_RELEASE` + * force a key release to be evaluated using the current layer stack instead of remembering which layer it came from (used for advanced cases) ## Behaviors That Can Be Configured diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 46633b2870..0c3f4a1332 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -39,3 +39,11 @@ void matrix_scan_user(void) { As you can see, you have a few function. You can use `SEQ_ONE_KEY` for single-key sequences (Leader followed by just one key), and `SEQ_TWO_KEYS`, `SEQ_THREE_KEYS` up to `SEQ_FIVE_KEYS` for longer sequences. Each of these accepts one or more keycodes as arguments. This is an important point: You can use keycodes from **any layer on your keyboard**. That layer would need to be active for the leader macro to fire, obviously. + +## Adding Leader Key Support in the `rules.mk` + +To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: + +``` +LEADER_ENABLE = yes +``` diff --git a/docs/understanding_qmk.md b/docs/understanding_qmk.md index bf695d008d..35596cc692 100644 --- a/docs/understanding_qmk.md +++ b/docs/understanding_qmk.md @@ -129,6 +129,7 @@ Comparing against our keymap we can see that the pressed key is KC_NLCK. From he ##### Process Record + The `process_record()` function itself is deceptively simple, but hidden within is a gateway to overriding functionality at various levels of QMK. The chain of events is listed below, using cluecard whenever we need to look at the keyboard/keymap level functions. Depending on options set in rule.mk or elsewhere, only a subset of the functions below will be included in final firmware. * [`void process_record(keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/08c682c193f43e5d54df990680ae93fc2e06150a/tmk_core/common/action.c#L172) @@ -146,7 +147,6 @@ The `process_record()` function itself is deceptively simple, but hidden within * [`bool process_music(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_music.c#L114) * [`bool process_tap_dance(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_tap_dance.c#L136) * [`bool process_leader(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_leader.c#L38) - * [`bool process_chording(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_chording.c#L41) * [`bool process_combo(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_combo.c#L115) * [`bool process_unicode(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_unicode.c#L22) * [`bool process_ucis(uint16_t keycode, keyrecord_t *record)`](https://github.com/qmk/qmk_firmware/blob/661ca4440cc42f3b60697e98985c44b0571ccfc1/quantum/process_keycode/process_ucis.c#L91) diff --git a/keyboards/1upkeyboards/1up60rgb/config.h b/keyboards/1upkeyboards/1up60rgb/config.h index bfdf354af7..ee49211b48 100644 --- a/keyboards/1upkeyboards/1up60rgb/config.h +++ b/keyboards/1upkeyboards/1up60rgb/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/1upkeyboards/sweet16/config.h b/keyboards/1upkeyboards/sweet16/config.h index 77d9e276dc..20d99651da 100644 --- a/keyboards/1upkeyboards/sweet16/config.h +++ b/keyboards/1upkeyboards/sweet16/config.h @@ -9,7 +9,7 @@ #define DEVICE_VER 0x0001 #define MANUFACTURER 1up Keyboards #define PRODUCT Sweet16 -#define DESCRIPTION 4x4 grid +#define DESCRIPTION 4x4 grid /* key matrix size */ #define MATRIX_ROWS 4 @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN B1 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -55,4 +52,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/acr60/config.h b/keyboards/acr60/config.h index c44ba737e8..3066f349de 100644 --- a/keyboards/acr60/config.h +++ b/keyboards/acr60/config.h @@ -41,9 +41,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 20 diff --git a/keyboards/alf/x2/config.h b/keyboards/alf/x2/config.h index 31212ce336..f2106fa88e 100644 --- a/keyboards/alf/x2/config.h +++ b/keyboards/alf/x2/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -55,4 +52,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/alpha/config.h b/keyboards/alpha/config.h index 0295275635..1e16f5ca3c 100755 --- a/keyboards/alpha/config.h +++ b/keyboards/alpha/config.h @@ -43,8 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS #define RGB_DI_PIN F4 #ifdef RGB_DI_PIN diff --git a/keyboards/alu84/config.h b/keyboards/alu84/config.h index 9e013dbcc3..9d2dca409c 100755 --- a/keyboards/alu84/config.h +++ b/keyboards/alu84/config.h @@ -59,9 +59,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLED_NUM 16 diff --git a/keyboards/at101_blackheart/config.h b/keyboards/at101_blackheart/config.h index 6a809a02f8..237cb095e6 100644 --- a/keyboards/at101_blackheart/config.h +++ b/keyboards/at101_blackheart/config.h @@ -38,6 +38,3 @@ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS \ No newline at end of file diff --git a/keyboards/atreus/keymaps/jeremy/keymap.c b/keyboards/atreus/keymaps/jeremy/keymap.c index 42bef9d80c..890980f41f 100644 --- a/keyboards/atreus/keymaps/jeremy/keymap.c +++ b/keyboards/atreus/keymaps/jeremy/keymap.c @@ -4,8 +4,6 @@ #include "action_layer.h" #include "keymap_colemak.h" -#define PREVENT_STUCK_MODIFIERS - // Each layer gets a name for readability, which is then used in the keymap matrix below. #define ALPH 0 #define NUMS 1 diff --git a/keyboards/atreus/keymaps/khitsule/config.h b/keyboards/atreus/keymaps/khitsule/config.h index 19714ec7d5..c74909a9ff 100644 --- a/keyboards/atreus/keymaps/khitsule/config.h +++ b/keyboards/atreus/keymaps/khitsule/config.h @@ -3,8 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS - #define IGNORE_MOD_TAP_INTERRUPT -#endif \ No newline at end of file +#endif diff --git a/keyboards/atreus/keymaps/xk/config.h b/keyboards/atreus/keymaps/xk/config.h index 2f8110167e..a8b9c88057 100644 --- a/keyboards/atreus/keymaps/xk/config.h +++ b/keyboards/atreus/keymaps/xk/config.h @@ -30,8 +30,7 @@ the Free Software Foundation, either version 2 of the License, or #define MOUSEKEY_WHEEL_MAX_SPEED 8 #define MOUSEKEY_WHEEL_TIME_TO_MAX 40 -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD -#endif \ No newline at end of file +#endif diff --git a/keyboards/atreus62/keymaps/mneme/config.h b/keyboards/atreus62/keymaps/mneme/config.h index 73eb0fa33d..a89bf5503c 100644 --- a/keyboards/atreus62/keymaps/mneme/config.h +++ b/keyboards/atreus62/keymaps/mneme/config.h @@ -1,6 +1,5 @@ #define ONESHOT_TIMEOUT 3000 #define TAPPING_TERM 200 -#define PREVENT_STUCK_MODIFIERS #define FORCE_NKRO #define LEADER_TIMEOUT 1000 diff --git a/keyboards/atreus62/keymaps/mneme/rules.mk b/keyboards/atreus62/keymaps/mneme/rules.mk index 046aec2733..160ce6edbf 100644 --- a/keyboards/atreus62/keymaps/mneme/rules.mk +++ b/keyboards/atreus62/keymaps/mneme/rules.mk @@ -3,3 +3,4 @@ NKRO_ENABLE = true MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no +LEADER_ENABLE = yes diff --git a/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h b/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h index 9d124a98e5..be57e385ef 100644 --- a/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h +++ b/keyboards/bfo9000/keymaps/andylikescandy6x18/config.h @@ -37,7 +37,4 @@ along with this program. If not, see . #define PERMISSIVE_HOLD - #define PREVENT_STUCK_MODIFIERS - - #endif diff --git a/keyboards/bigseries/1key/config.h b/keyboards/bigseries/1key/config.h index 4e30276fc0..966f2062c4 100755 --- a/keyboards/bigseries/1key/config.h +++ b/keyboards/bigseries/1key/config.h @@ -47,9 +47,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/bigseries/2key/config.h b/keyboards/bigseries/2key/config.h index 83c8e31417..79b9ed3786 100755 --- a/keyboards/bigseries/2key/config.h +++ b/keyboards/bigseries/2key/config.h @@ -47,9 +47,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/bigseries/3key/config.h b/keyboards/bigseries/3key/config.h index e10b14db42..9963a82197 100755 --- a/keyboards/bigseries/3key/config.h +++ b/keyboards/bigseries/3key/config.h @@ -47,9 +47,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/bigseries/4key/config.h b/keyboards/bigseries/4key/config.h index 3ebcfe0911..a222512d3c 100755 --- a/keyboards/bigseries/4key/config.h +++ b/keyboards/bigseries/4key/config.h @@ -47,9 +47,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/bigswitch/config.h b/keyboards/bigswitch/config.h index cc290fd79b..a0ef6b5554 100755 --- a/keyboards/bigswitch/config.h +++ b/keyboards/bigswitch/config.h @@ -47,8 +47,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 diff --git a/keyboards/catch22/config.h b/keyboards/catch22/config.h index cb7ca7d84c..f151e7048f 100644 --- a/keyboards/catch22/config.h +++ b/keyboards/catch22/config.h @@ -46,9 +46,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN F6 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/chimera_ergo/config.h b/keyboards/chimera_ergo/config.h index 86ee237181..8ce195cc06 100644 --- a/keyboards/chimera_ergo/config.h +++ b/keyboards/chimera_ergo/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/chimera_ls/config.h b/keyboards/chimera_ls/config.h index d92878026b..254dad3064 100644 --- a/keyboards/chimera_ls/config.h +++ b/keyboards/chimera_ls/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/chimera_ortho/config.h b/keyboards/chimera_ortho/config.h index 44c6212b17..4bf85eb88f 100644 --- a/keyboards/chimera_ortho/config.h +++ b/keyboards/chimera_ortho/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/chocopad/config.h b/keyboards/chocopad/config.h index bf861ccda4..2163ff8bc4 100644 --- a/keyboards/chocopad/config.h +++ b/keyboards/chocopad/config.h @@ -40,10 +40,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 8 @@ -56,4 +52,4 @@ #define ws2812_PORTREG PORTD #define ws2812_DDRREG DDRD -#endif \ No newline at end of file +#endif diff --git a/keyboards/clueboard/60/config.h b/keyboards/clueboard/60/config.h index 5c5a86296f..a862d2cda3 100644 --- a/keyboards/clueboard/60/config.h +++ b/keyboards/clueboard/60/config.h @@ -49,9 +49,6 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 6 -/* Prevent modifiers from being stuck on after layer changes. */ -#define PREVENT_STUCK_MODIFIERS - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/clueboard/66/keymaps/bloodlvst/config.h b/keyboards/clueboard/66/keymaps/bloodlvst/config.h index 320401dbda..456936cf93 100644 --- a/keyboards/clueboard/66/keymaps/bloodlvst/config.h +++ b/keyboards/clueboard/66/keymaps/bloodlvst/config.h @@ -3,6 +3,5 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS #define DISABLE_SPACE_CADET_ROLLOVER #endif diff --git a/keyboards/comet46/config.h b/keyboards/comet46/config.h index 90d923f90b..2421f53412 100644 --- a/keyboards/comet46/config.h +++ b/keyboards/comet46/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/contra/config.h b/keyboards/contra/config.h index 85077ed46a..c6bb374da2 100755 --- a/keyboards/contra/config.h +++ b/keyboards/contra/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/contra/keymaps/ryanm101/config.h b/keyboards/contra/keymaps/ryanm101/config.h index 9a458b892d..224a4a37d0 100644 --- a/keyboards/contra/keymaps/ryanm101/config.h +++ b/keyboards/contra/keymaps/ryanm101/config.h @@ -3,7 +3,6 @@ #include "config_common.h" -#define PREVENT_STUCK_MODIFIERS #define TAPPING_TERM 200 #ifdef AUDIO_ENABLE @@ -28,7 +27,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -42,4 +41,4 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +#endif diff --git a/keyboards/crawlpad/config.h b/keyboards/crawlpad/config.h index a07c79cd20..c72be83f28 100755 --- a/keyboards/crawlpad/config.h +++ b/keyboards/crawlpad/config.h @@ -40,9 +40,6 @@ false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/crkbd/keymaps/default/config.h b/keyboards/crkbd/keymaps/default/config.h index 8d25f7cbc6..c573530f74 100644 --- a/keyboards/crkbd/keymaps/default/config.h +++ b/keyboards/crkbd/keymaps/default/config.h @@ -36,7 +36,6 @@ along with this program. If not, see . #define USE_SERIAL_PD2 -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/dichotemy/config.h b/keyboards/dichotemy/config.h index b3bd6d9421..1d92cf74e5 100644 --- a/keyboards/dichotemy/config.h +++ b/keyboards/dichotemy/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/dilly/config.h b/keyboards/dilly/config.h index 97a6e533bb..d9ca4597cf 100644 --- a/keyboards/dilly/config.h +++ b/keyboards/dilly/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 8 @@ -59,4 +55,4 @@ #define ws2812_PORTREG PORTD #define ws2812_DDRREG DDRD -#endif \ No newline at end of file +#endif diff --git a/keyboards/dz60/config.h b/keyboards/dz60/config.h index 8e1a5ae5f5..e58eae0858 100644 --- a/keyboards/dz60/config.h +++ b/keyboards/dz60/config.h @@ -41,9 +41,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 diff --git a/keyboards/dz60/keymaps/LEdiodes/config.h b/keyboards/dz60/keymaps/LEdiodes/config.h index bb78d9bb66..4f991b9ca2 100644 --- a/keyboards/dz60/keymaps/LEdiodes/config.h +++ b/keyboards/dz60/keymaps/LEdiodes/config.h @@ -41,9 +41,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 diff --git a/keyboards/ergodone/config.h b/keyboards/ergodone/config.h index 1feff26aa7..2c764d782c 100644 --- a/keyboards/ergodone/config.h +++ b/keyboards/ergodone/config.h @@ -53,8 +53,6 @@ /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 5 -#define PREVENT_STUCK_MODIFIERS - #define USB_MAX_POWER_CONSUMPTION 500 /* NKRO */ diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 07a9b54977..7a350183b1 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -97,8 +97,6 @@ along with this program. If not, see . */ #define DEBOUNCE 15 -#define PREVENT_STUCK_MODIFIERS - #define USB_MAX_POWER_CONSUMPTION 500 // RGB backlight diff --git a/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk b/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk index 38112a9065..db5e5d1558 100644 --- a/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk +++ b/keyboards/ergodox_ez/keymaps/heartrobotninja/rules.mk @@ -13,6 +13,7 @@ AUTOLOG_ENABLE = no RGBLIGHT_ENABLE = yes RGBLIGHT_ANIMATION = yes EXTRAKEY_ENABLE = yes +LEADER_ENABLE = yes OPT_DEFS += -DUSER_PRINT @@ -31,4 +32,4 @@ OPT_DEFS += -DKEYMAP_VERSION=\"$(KEYMAP_VERSION)\\\#$(KEYMAP_BRANCH)\" ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/ergodox_ez/keymaps/vim/vim.h b/keyboards/ergodox_ez/keymaps/vim/vim.h index e9b682fd3f..7565c6e3e6 100644 --- a/keyboards/ergodox_ez/keymaps/vim/vim.h +++ b/keyboards/ergodox_ez/keymaps/vim/vim.h @@ -9,7 +9,6 @@ #define PRESS(keycode) register_code16(keycode) #define RELEASE(keycode) unregister_code16(keycode) -#define PREVENT_STUCK_MODIFIERS uint16_t VIM_QUEUE = KC_NO; diff --git a/keyboards/ergodox_infinity/keymaps/gordon/config.h b/keyboards/ergodox_infinity/keymaps/gordon/config.h index 88d495b12b..772ce0bac9 100644 --- a/keyboards/ergodox_infinity/keymaps/gordon/config.h +++ b/keyboards/ergodox_infinity/keymaps/gordon/config.h @@ -15,8 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#define PREVENT_STUCK_MODIFIERS - #undef IGNORE_MOD_TAP_INTERRUPT #define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/ergodox_infinity/keymaps/narze/config.h b/keyboards/ergodox_infinity/keymaps/narze/config.h index 8174edd359..551327a126 100644 --- a/keyboards/ergodox_infinity/keymaps/narze/config.h +++ b/keyboards/ergodox_infinity/keymaps/narze/config.h @@ -13,7 +13,6 @@ #define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS #undef MOUSEKEY_DELAY #define MOUSEKEY_DELAY 100 diff --git a/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk index 75624bb8c6..74505bd69e 100644 --- a/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk +++ b/keyboards/ergodox_infinity/keymaps/not-quite-neo/rules.mk @@ -1,2 +1,3 @@ BACKLIGHT_ENABLE = yes -UNICODE_ENABLE = yes \ No newline at end of file +UNICODE_ENABLE = yes +LEADER_ENABLE = yes diff --git a/keyboards/ergoinu/config.h b/keyboards/ergoinu/config.h index 4b7c584005..de72635b19 100644 --- a/keyboards/ergoinu/config.h +++ b/keyboards/ergoinu/config.h @@ -31,8 +31,6 @@ along with this program. If not, see . #define PRODUCT ergoinu #define DESCRIPTION An (Not Portable But Small) Ergonomic split keyboard - -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/ergotravel/keymaps/ckofy/config.h b/keyboards/ergotravel/keymaps/ckofy/config.h index caae080d70..41ec06657e 100644 --- a/keyboards/ergotravel/keymaps/ckofy/config.h +++ b/keyboards/ergotravel/keymaps/ckofy/config.h @@ -33,9 +33,6 @@ along with this program. If not, see . #define TAPPING_TOGGLE 2 -// required if modifiers are defined in layers besided the default one. -#define PREVENT_STUCK_MODIFIERS - #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 12 diff --git a/keyboards/felix/config.h b/keyboards/felix/config.h index f70089af49..003fe87dc8 100644 --- a/keyboards/felix/config.h +++ b/keyboards/felix/config.h @@ -42,8 +42,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS /* there is no rgb underglow by default. */ #define RGB_DI_PIN @@ -53,4 +51,4 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif \ No newline at end of file +#endif diff --git a/keyboards/four_banger/config.h b/keyboards/four_banger/config.h index 96011cbdfa..8dceff5db5 100644 --- a/keyboards/four_banger/config.h +++ b/keyboards/four_banger/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -55,4 +52,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/fourier/keymaps/jennetters/config.h b/keyboards/fourier/keymaps/jennetters/config.h index 87cda7b5c9..5f99c65ad5 100644 --- a/keyboards/fourier/keymaps/jennetters/config.h +++ b/keyboards/fourier/keymaps/jennetters/config.h @@ -22,10 +22,7 @@ along with this program. If not, see . #define TAPPING_TERM 100 -/* Try to prevent sticky keys */ -#define PREVENT_STUCK_MODIFIERS - /* Use I2C or Serial, not both */ #define USE_SERIAL -// #define USE_I2C \ No newline at end of file +// #define USE_I2C diff --git a/keyboards/fractal/config.h b/keyboards/fractal/config.h index 30b703b6e6..1a5901f984 100755 --- a/keyboards/fractal/config.h +++ b/keyboards/fractal/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/frosty_flake/keymaps/nikchi/rules.mk index ad86e82d20..b21eb64044 100644 --- a/keyboards/frosty_flake/keymaps/nikchi/rules.mk +++ b/keyboards/frosty_flake/keymaps/nikchi/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -17,6 +17,7 @@ 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 TAP_DANCE_ENABLE = yes +LEADER_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/gh80_3000/config.h b/keyboards/gh80_3000/config.h index 83d30129a1..ca72aba5aa 100644 --- a/keyboards/gh80_3000/config.h +++ b/keyboards/gh80_3000/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 @@ -55,4 +51,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/gherkin/config.h b/keyboards/gherkin/config.h index 4607962d7c..34f38e35c2 100644 --- a/keyboards/gherkin/config.h +++ b/keyboards/gherkin/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 @@ -55,4 +51,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/gherkin/keymaps/talljoe_gherkin/config.h b/keyboards/gherkin/keymaps/talljoe_gherkin/config.h index 3e9e692d3c..7fa3bf328e 100644 --- a/keyboards/gherkin/keymaps/talljoe_gherkin/config.h +++ b/keyboards/gherkin/keymaps/talljoe_gherkin/config.h @@ -3,6 +3,4 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS - -#endif \ No newline at end of file +#endif diff --git a/keyboards/gonnerd/keymaps/gam3cat/config.h b/keyboards/gonnerd/keymaps/gam3cat/config.h index a3819d3a59..d86da86e40 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/config.h +++ b/keyboards/gonnerd/keymaps/gam3cat/config.h @@ -1,7 +1,6 @@ #include "../../config.h" //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. #define GRAVE_ESC_CTRL_OVERRIDE -#define PREVENT_STUCK_MODIFIERS //Delay matrix scan for tap dance, reduce to activate modifier keys faster. //#define TAPPING_TERM 200 diff --git a/keyboards/hadron/keymaps/default/config.h b/keyboards/hadron/keymaps/default/config.h index 0f349ad932..09922b61bc 100644 --- a/keyboards/hadron/keymaps/default/config.h +++ b/keyboards/hadron/keymaps/default/config.h @@ -5,7 +5,6 @@ #define LEADER_TIMEOUT 300 //#define BACKLIGHT_BREATHING -#define PREVENT_STUCK_MODIFIERS #define USE_I2C #define SSD1306OLED diff --git a/keyboards/hadron/keymaps/side_numpad/config.h b/keyboards/hadron/keymaps/side_numpad/config.h index 0f349ad932..09922b61bc 100644 --- a/keyboards/hadron/keymaps/side_numpad/config.h +++ b/keyboards/hadron/keymaps/side_numpad/config.h @@ -5,7 +5,6 @@ #define LEADER_TIMEOUT 300 //#define BACKLIGHT_BREATHING -#define PREVENT_STUCK_MODIFIERS #define USE_I2C #define SSD1306OLED diff --git a/keyboards/handwired/MS_sculpt_mobile/config.h b/keyboards/handwired/MS_sculpt_mobile/config.h index f89514278d..c3bdf333e2 100644 --- a/keyboards/handwired/MS_sculpt_mobile/config.h +++ b/keyboards/handwired/MS_sculpt_mobile/config.h @@ -28,10 +28,10 @@ along with this program. If not, see . #define DESCRIPTION 6000 /* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 -#ifdef ASTAR +#ifdef ASTAR #define PRODUCT sculpt mobile astar /*0 1 2 3 4 5 6 7 8 */ #define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} @@ -95,6 +95,4 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#define PREVENT_STUCK_MODIFIERS - #endif diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/config.h b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h index 6916d1a7d4..f5e6bbabe6 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/config.h +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/config.h @@ -3,8 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS - #undef MATRIX_ROW_PINS #undef MATRIX_COL_PINS diff --git a/keyboards/handwired/dactyl/config.h b/keyboards/handwired/dactyl/config.h index a990cc7208..08931ecd34 100644 --- a/keyboards/handwired/dactyl/config.h +++ b/keyboards/handwired/dactyl/config.h @@ -63,8 +63,6 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCE 15 -#define PREVENT_STUCK_MODIFIERS - #define USB_MAX_POWER_CONSUMPTION 500 #endif diff --git a/keyboards/handwired/kbod/config.h b/keyboards/handwired/kbod/config.h index f3d0c8bf2d..a3f3e3908a 100644 --- a/keyboards/handwired/kbod/config.h +++ b/keyboards/handwired/kbod/config.h @@ -48,7 +48,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -159,8 +159,6 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#define PREVENT_STUCK_MODIFIERS - #undef TAPPING_TOGGLE #define TAPPING_TOGGLE 2 diff --git a/keyboards/handwired/promethium/keymaps/default/config.h b/keyboards/handwired/promethium/keymaps/default/config.h index fa86e22479..2064f3676a 100644 --- a/keyboards/handwired/promethium/keymaps/default/config.h +++ b/keyboards/handwired/promethium/keymaps/default/config.h @@ -11,8 +11,6 @@ /* skip bootmagic and eeconfig */ #define BOOTMAGIC_KEY_SKIP KC_SPACE -#define PREVENT_STUCK_MODIFIERS - #define RGBSPS_ENABLE #define RGBSPS_DEMO_ENABLE diff --git a/keyboards/handwired/promethium/keymaps/priyadi/config.h b/keyboards/handwired/promethium/keymaps/priyadi/config.h index fa86e22479..2064f3676a 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/config.h +++ b/keyboards/handwired/promethium/keymaps/priyadi/config.h @@ -11,8 +11,6 @@ /* skip bootmagic and eeconfig */ #define BOOTMAGIC_KEY_SKIP KC_SPACE -#define PREVENT_STUCK_MODIFIERS - #define RGBSPS_ENABLE #define RGBSPS_DEMO_ENABLE diff --git a/keyboards/handwired/space_oddity/config.h b/keyboards/handwired/space_oddity/config.h index 9c9361ced7..46d854099c 100644 --- a/keyboards/handwired/space_oddity/config.h +++ b/keyboards/handwired/space_oddity/config.h @@ -49,10 +49,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index b49f0173b4..41edfcbc20 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -28,7 +28,6 @@ along with this program. If not, see . #define DESCRIPTION A split keyboard for the cheap makers -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/config.h b/keyboards/helix/rev1/keymaps/OLED_sample/config.h index 0e1b787a5a..5e8989d96f 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/config.h +++ b/keyboards/helix/rev1/keymaps/OLED_sample/config.h @@ -35,7 +35,8 @@ along with this program. If not, see . #define SSD1306OLED -#define PREVENT_STUCK_MODIFIERS +#define USE_SERIAL_PD2 + #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h index 058236122f..b354d312d5 100644 --- a/keyboards/helix/rev2/config.h +++ b/keyboards/helix/rev2/config.h @@ -28,7 +28,6 @@ along with this program. If not, see . #define DESCRIPTION A split keyboard for the cheap makers -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/hhkb/keymaps/blakedietz/rules.mk b/keyboards/hhkb/keymaps/blakedietz/rules.mk index 7c16b2c98d..7d97e7a524 100644 --- a/keyboards/hhkb/keymaps/blakedietz/rules.mk +++ b/keyboards/hhkb/keymaps/blakedietz/rules.mk @@ -1,2 +1,3 @@ TAP_DANCE_ENABLE = no UNICODE_ENABLE = no +LEADER_ENABLE = yes diff --git a/keyboards/infinity60/config.h b/keyboards/infinity60/config.h index 8306c8f7ef..c1e9ec5b1f 100644 --- a/keyboards/infinity60/config.h +++ b/keyboards/infinity60/config.h @@ -18,8 +18,6 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H -#define PREVENT_STUCK_MODIFIERS - /* USB Device descriptor parameter */ #define VENDOR_ID 0x1c11 #define PRODUCT_ID 0xb04d diff --git a/keyboards/iris/keymaps/davidrambo/config.h b/keyboards/iris/keymaps/davidrambo/config.h index 01e078e326..2cdff4213b 100644 --- a/keyboards/iris/keymaps/davidrambo/config.h +++ b/keyboards/iris/keymaps/davidrambo/config.h @@ -27,7 +27,6 @@ along with this program. If not, see . /* Select hand configuration */ #define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/iris/keymaps/jennetters/config.h b/keyboards/iris/keymaps/jennetters/config.h index a3c0634f52..42f91bd027 100644 --- a/keyboards/iris/keymaps/jennetters/config.h +++ b/keyboards/iris/keymaps/jennetters/config.h @@ -19,9 +19,6 @@ along with this program. If not, see . #define TAPPING_TERM 150 -/* Try to prevent sticky keys */ -#define PREVENT_STUCK_MODIFIERS - /* Use I2C or Serial, not both */ #define USE_SERIAL @@ -38,4 +35,4 @@ along with this program. If not, see . #define RGBLED_NUM 12 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 \ No newline at end of file +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/krusli/config.h b/keyboards/iris/keymaps/krusli/config.h index a53c746ad9..72e35c4728 100644 --- a/keyboards/iris/keymaps/krusli/config.h +++ b/keyboards/iris/keymaps/krusli/config.h @@ -20,8 +20,6 @@ along with this program. If not, see . #include "config_common.h" -// #define PREVENT_STUCK_MODIFIERS - /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/iris/keymaps/xyverz/config.h b/keyboards/iris/keymaps/xyverz/config.h index 0c61a8eac8..b820a0753d 100644 --- a/keyboards/iris/keymaps/xyverz/config.h +++ b/keyboards/iris/keymaps/xyverz/config.h @@ -23,8 +23,6 @@ along with this program. If not, see . #define USE_SERIAL #define EE_HANDS -#define PREVENT_STUCK_MODIFIERS - #undef PRODUCT #define PRODUCT Iris Keyboard diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h index a3819d3a59..d86da86e40 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h @@ -1,7 +1,6 @@ #include "../../config.h" //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. #define GRAVE_ESC_CTRL_OVERRIDE -#define PREVENT_STUCK_MODIFIERS //Delay matrix scan for tap dance, reduce to activate modifier keys faster. //#define TAPPING_TERM 200 diff --git a/keyboards/jj40/keymaps/ajp10304/config.h b/keyboards/jj40/keymaps/ajp10304/config.h deleted file mode 100644 index 11cafbefcb..0000000000 --- a/keyboards/jj40/keymaps/ajp10304/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif diff --git a/keyboards/jj40/keymaps/fun40/config.h b/keyboards/jj40/keymaps/fun40/config.h index 89807d84ad..f2b5d264e7 100644 --- a/keyboards/jj40/keymaps/fun40/config.h +++ b/keyboards/jj40/keymaps/fun40/config.h @@ -4,6 +4,5 @@ #include "../../config.h" #define FORCE_NKRO -#define PREVENT_STUCK_MODIFIERS #endif diff --git a/keyboards/jj40/keymaps/krusli/config.h b/keyboards/jj40/keymaps/krusli/config.h index 6d98a37a67..e710dbbb60 100644 --- a/keyboards/jj40/keymaps/krusli/config.h +++ b/keyboards/jj40/keymaps/krusli/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS // #define TAPPING_TERM 300 #endif diff --git a/keyboards/jj40/keymaps/oscillope/config.h b/keyboards/jj40/keymaps/oscillope/config.h index d7f991fa91..e812903de9 100644 --- a/keyboards/jj40/keymaps/oscillope/config.h +++ b/keyboards/jj40/keymaps/oscillope/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS #define TAPPING_TERM 200 #endif diff --git a/keyboards/jj40/keymaps/suzuken/config.h b/keyboards/jj40/keymaps/suzuken/config.h index 52aaa8f24d..b1d74e1e69 100644 --- a/keyboards/jj40/keymaps/suzuken/config.h +++ b/keyboards/jj40/keymaps/suzuken/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS #define TAPPING_TERM 300 #endif diff --git a/keyboards/jj40/keymaps/waples/config.h b/keyboards/jj40/keymaps/waples/config.h index 52aaa8f24d..b1d74e1e69 100644 --- a/keyboards/jj40/keymaps/waples/config.h +++ b/keyboards/jj40/keymaps/waples/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS #define TAPPING_TERM 300 #endif diff --git a/keyboards/jm60/config.h b/keyboards/jm60/config.h index 847cf20780..cb5c90bb19 100644 --- a/keyboards/jm60/config.h +++ b/keyboards/jm60/config.h @@ -18,8 +18,6 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H -#define PREVENT_STUCK_MODIFIERS - /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6464 diff --git a/keyboards/k_type/config.h b/keyboards/k_type/config.h index d19e0ff649..4937d9ad99 100644 --- a/keyboards/k_type/config.h +++ b/keyboards/k_type/config.h @@ -18,8 +18,6 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H -#define PREVENT_STUCK_MODIFIERS - /* USB Device descriptor parameter */ #define VENDOR_ID 0x1c11 #define PRODUCT_ID 0xb04d diff --git a/keyboards/katana60/config.h b/keyboards/katana60/config.h index 169cffb420..aaf2b5d544 100644 --- a/keyboards/katana60/config.h +++ b/keyboards/katana60/config.h @@ -48,7 +48,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION ROW2COL - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -111,7 +111,6 @@ along with this program. If not, see . ) #define TAPPING_TERM 200 -#define PREVENT_STUCK_MODIFIERS /* control how magic key switches layers */ //#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true diff --git a/keyboards/kbd75/config.h b/keyboards/kbd75/config.h index f76d9082fb..726afcaf6e 100644 --- a/keyboards/kbd75/config.h +++ b/keyboards/kbd75/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/config.h b/keyboards/kinesis/keymaps/insertsnideremarks/config.h index 3548fa3486..9ce094be51 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/config.h +++ b/keyboards/kinesis/keymaps/insertsnideremarks/config.h @@ -5,7 +5,6 @@ #include "../../config.h" // place overrides here -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define TAPPING_TERM 175 #define TAPPING_TOGGLE 2 diff --git a/keyboards/lets_split/keymaps/OLED_sample/config.h b/keyboards/lets_split/keymaps/OLED_sample/config.h index e8632fe61d..6aa909d284 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/config.h +++ b/keyboards/lets_split/keymaps/OLED_sample/config.h @@ -38,8 +38,6 @@ along with this program. If not, see . #define SSD1306OLED //#define OLED_ROTATE180 - -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/lets_split/keymaps/adam/config.h b/keyboards/lets_split/keymaps/adam/config.h index ff29eb1bde..59a2e5db72 100644 --- a/keyboards/lets_split/keymaps/adam/config.h +++ b/keyboards/lets_split/keymaps/adam/config.h @@ -43,7 +43,6 @@ along with this program. If not, see . #undef TAPPING_TERM #define TAPPING_TERM 200 //At 500 some bad logic takes hold -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD diff --git a/keyboards/lets_split/keymaps/khord/config.h b/keyboards/lets_split/keymaps/khord/config.h index 4ebdbad769..71ec20dbc8 100644 --- a/keyboards/lets_split/keymaps/khord/config.h +++ b/keyboards/lets_split/keymaps/khord/config.h @@ -25,9 +25,6 @@ along with this program. If not, see . #define TAPPING_TERM 150 -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/lets_split/keymaps/piemod/config.h b/keyboards/lets_split/keymaps/piemod/config.h index 001b62e41b..1b3fd7544e 100644 --- a/keyboards/lets_split/keymaps/piemod/config.h +++ b/keyboards/lets_split/keymaps/piemod/config.h @@ -43,7 +43,6 @@ along with this program. If not, see . #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 1 // Typing Options -#define PREVENT_STUCK_MODIFIERS #define QMK_KEYS_PER_SCAN 4 #endif diff --git a/keyboards/lets_split/keymaps/waples/config.h b/keyboards/lets_split/keymaps/waples/config.h index 98ebeff455..5221fd011a 100644 --- a/keyboards/lets_split/keymaps/waples/config.h +++ b/keyboards/lets_split/keymaps/waples/config.h @@ -12,6 +12,4 @@ // #define MASTER_RIGHT #define EE_HANDS // We like to have choices I guess -#define PREVENT_STUCK_MODIFIERS // When switching layers, this will release all mods - #endif diff --git a/keyboards/lets_split/keymaps/xk/config.h b/keyboards/lets_split/keymaps/xk/config.h index c75ed12cc8..a5cd518576 100644 --- a/keyboards/lets_split/keymaps/xk/config.h +++ b/keyboards/lets_split/keymaps/xk/config.h @@ -37,7 +37,6 @@ the Free Software Foundation, either version 2 of the License, or #define EE_HANDS -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD diff --git a/keyboards/m10a/keymaps/gam3cat/config.h b/keyboards/m10a/keymaps/gam3cat/config.h deleted file mode 100644 index 73bc50bc2d..0000000000 --- a/keyboards/m10a/keymaps/gam3cat/config.h +++ /dev/null @@ -1,2 +0,0 @@ -#include "../../config.h" -#define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/mechmini/v2/config.h b/keyboards/mechmini/v2/config.h index 58c751e0f8..e0922bb7e2 100755 --- a/keyboards/mechmini/v2/config.h +++ b/keyboards/mechmini/v2/config.h @@ -62,9 +62,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/melody96/config.h b/keyboards/melody96/config.h index 6083dcf751..67123a7e52 100644 --- a/keyboards/melody96/config.h +++ b/keyboards/melody96/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/minidox/keymaps/alairock/config.h b/keyboards/minidox/keymaps/alairock/config.h index 4456060319..3649fdd12c 100644 --- a/keyboards/minidox/keymaps/alairock/config.h +++ b/keyboards/minidox/keymaps/alairock/config.h @@ -36,5 +36,4 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 #define RGBLIGHT_VAL_STEP 17 -#define PREVENT_STUCK_MODIFIERS #endif diff --git a/keyboards/minidox/keymaps/khitsule/config.h b/keyboards/minidox/keymaps/khitsule/config.h index 7023548646..645e80ee8f 100644 --- a/keyboards/minidox/keymaps/khitsule/config.h +++ b/keyboards/minidox/keymaps/khitsule/config.h @@ -1,8 +1,6 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -#define PREVENT_STUCK_MODIFIERS - #define IGNORE_MOD_TAP_INTERRUPT -#endif \ No newline at end of file +#endif diff --git a/keyboards/mint60/config.h b/keyboards/mint60/config.h index 37b69e93a1..51c586e636 100644 --- a/keyboards/mint60/config.h +++ b/keyboards/mint60/config.h @@ -29,7 +29,6 @@ along with this program. If not, see . #define PRODUCT Mint60 #define DESCRIPTION A row staggered split keyboard -#define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD #define TAPPING_TERM 100 diff --git a/keyboards/mitosis/config.h b/keyboards/mitosis/config.h index 6101ee1237..5cfd2e4b12 100644 --- a/keyboards/mitosis/config.h +++ b/keyboards/mitosis/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/niu_mini/config.h b/keyboards/niu_mini/config.h index 2f22306160..b9d3ed4e9d 100644 --- a/keyboards/niu_mini/config.h +++ b/keyboards/niu_mini/config.h @@ -64,9 +64,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/novelpad/config.h b/keyboards/novelpad/config.h index 0d6a713433..3a47c0eb65 100755 --- a/keyboards/novelpad/config.h +++ b/keyboards/novelpad/config.h @@ -53,9 +53,6 @@ along with this program. If not, see . false \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define BACKLIGHT_LEVELS 10 #define BACKLIGHT_PIN B7 diff --git a/keyboards/noxary/268/config.h b/keyboards/noxary/268/config.h index b2cb95e95c..7eec79a1bc 100644 --- a/keyboards/noxary/268/config.h +++ b/keyboards/noxary/268/config.h @@ -60,9 +60,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - /* ws2812b options */ #define RGB_DI_PIN B5 #ifdef RGB_DI_PIN @@ -73,4 +70,4 @@ along with this program. If not, see . #define RGBLIGHT_VAL_STEP 16 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/ok60/config.h b/keyboards/ok60/config.h index 61c2fa0ed3..db7b74e587 100644 --- a/keyboards/ok60/config.h +++ b/keyboards/ok60/config.h @@ -71,9 +71,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN F6 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 10 diff --git a/keyboards/omnikey_blackheart/config.h b/keyboards/omnikey_blackheart/config.h index 14b4a5f172..94412cfa67 100644 --- a/keyboards/omnikey_blackheart/config.h +++ b/keyboards/omnikey_blackheart/config.h @@ -45,10 +45,6 @@ /* force n-key rollover*/ #define FORCE_NKRO -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 @@ -57,4 +53,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/paladin64/config.h b/keyboards/paladin64/config.h index 27f54bf161..a5280f4d48 100755 --- a/keyboards/paladin64/config.h +++ b/keyboards/paladin64/config.h @@ -110,8 +110,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS #define RGB_DI_PIN D0 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/pegasushoof/keymaps/citadel/config.h b/keyboards/pegasushoof/keymaps/citadel/config.h index e8eafe2e17..2d27ff392d 100644 --- a/keyboards/pegasushoof/keymaps/citadel/config.h +++ b/keyboards/pegasushoof/keymaps/citadel/config.h @@ -8,7 +8,4 @@ #undef PRODUCT #define PRODUCT Pegasus Hoof Citadel -/* necessary option for this keymap, because CAPS is redefined in Layer 0 */ -#define PREVENT_STUCK_MODIFIERS - #endif diff --git a/keyboards/planck/keymaps/ajp10304/config.h b/keyboards/planck/keymaps/ajp10304/config.h deleted file mode 100644 index 11cafbefcb..0000000000 --- a/keyboards/planck/keymaps/ajp10304/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif diff --git a/keyboards/planck/keymaps/altgr/config.h b/keyboards/planck/keymaps/altgr/config.h index d55258c02b..e517a8b24b 100644 --- a/keyboards/planck/keymaps/altgr/config.h +++ b/keyboards/planck/keymaps/altgr/config.h @@ -3,9 +3,6 @@ #include "../../config.h" -// required because lower/raise modifiers are redefined by colemak-dh -#define PREVENT_STUCK_MODIFIERS - // tap dance key press termination interval #define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/am/config.h b/keyboards/planck/keymaps/am/config.h index b2b87045b8..1ae457e3b8 100644 --- a/keyboards/planck/keymaps/am/config.h +++ b/keyboards/planck/keymaps/am/config.h @@ -1,8 +1,5 @@ #pragma once -/* Prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) diff --git a/keyboards/planck/keymaps/andylikescandy/config.h b/keyboards/planck/keymaps/andylikescandy/config.h index 0de5f3db0c..01169db2aa 100644 --- a/keyboards/planck/keymaps/andylikescandy/config.h +++ b/keyboards/planck/keymaps/andylikescandy/config.h @@ -17,9 +17,6 @@ #define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS - - /* * MIDI options */ diff --git a/keyboards/planck/keymaps/bone2planck/config.h b/keyboards/planck/keymaps/bone2planck/config.h deleted file mode 100644 index 3e9e692d3c..0000000000 --- a/keyboards/planck/keymaps/bone2planck/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/davidrambo/config.h b/keyboards/planck/keymaps/davidrambo/config.h index c3bebf5799..2decb3dc8d 100644 --- a/keyboards/planck/keymaps/davidrambo/config.h +++ b/keyboards/planck/keymaps/davidrambo/config.h @@ -3,7 +3,6 @@ #define CONFIG_USER_H #define TAPPING_TERM 200 #include "../../config.h" -#define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS +#define PERMISSIVE_HOLD -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index 480ba453a2..9ba854ef04 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -10,7 +10,6 @@ #define _______ KC_TRNS #define XXXXXXX KC_NO -#define PREVENT_STUCK_MODIFIERS #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 diff --git a/keyboards/planck/keymaps/espynn/keymap.c b/keyboards/planck/keymaps/espynn/keymap.c index 9cf508af6d..5615a78bf7 100644 --- a/keyboards/planck/keymaps/espynn/keymap.c +++ b/keyboards/planck/keymaps/espynn/keymap.c @@ -5,7 +5,6 @@ #ifdef BACKLIGHT_ENABLE #include "backlight.h" #endif -#define PREVENT_STUCK_MODIFIERS extern keymap_config_t keymap_config; // Symbolic names for macro IDs. diff --git a/keyboards/planck/keymaps/experimental/config.h b/keyboards/planck/keymaps/experimental/config.h index 0864b5fbc9..86cc4760bb 100644 --- a/keyboards/planck/keymaps/experimental/config.h +++ b/keyboards/planck/keymaps/experimental/config.h @@ -5,8 +5,6 @@ #define LEADER_TIMEOUT 300 #define BACKLIGHT_BREATHING -#define PREVENT_STUCK_MODIFIERS - /* ws2812 RGB LED */ #define RGB_DI_PIN B1 diff --git a/keyboards/planck/keymaps/experimental/rules.mk b/keyboards/planck/keymaps/experimental/rules.mk index b135dfca01..168d3cb9f0 100644 --- a/keyboards/planck/keymaps/experimental/rules.mk +++ b/keyboards/planck/keymaps/experimental/rules.mk @@ -18,10 +18,11 @@ BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. SWAP_HANDS_ENABLE = yes # Enable one-hand typing STENO_ENABLE = yes # Enable TX Bolt protocol for Stenography, requires VIRTSER and may not work with mouse keys +LEADER_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile -endif \ No newline at end of file +endif diff --git a/keyboards/planck/keymaps/hiea/config.h b/keyboards/planck/keymaps/hiea/config.h index 9bb5e08735..655cdf5db3 100644 --- a/keyboards/planck/keymaps/hiea/config.h +++ b/keyboards/planck/keymaps/hiea/config.h @@ -3,9 +3,6 @@ #include "../../config.h" -// required because lower/raise modifiers are redefined by colemak-dh -#define PREVENT_STUCK_MODIFIERS - // tap dance key press termination interval #define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/hieax/config.h b/keyboards/planck/keymaps/hieax/config.h index 9bb5e08735..655cdf5db3 100644 --- a/keyboards/planck/keymaps/hieax/config.h +++ b/keyboards/planck/keymaps/hieax/config.h @@ -3,9 +3,6 @@ #include "../../config.h" -// required because lower/raise modifiers are redefined by colemak-dh -#define PREVENT_STUCK_MODIFIERS - // tap dance key press termination interval #define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/ishtob/config.h b/keyboards/planck/keymaps/ishtob/config.h index e58ade0b0f..688607634c 100755 --- a/keyboards/planck/keymaps/ishtob/config.h +++ b/keyboards/planck/keymaps/ishtob/config.h @@ -2,7 +2,6 @@ #ifndef USERSPACE_CONFIG_H #define USERSPACE_CONFIG_H - #ifdef AUDIO_ENABLE // #define STARTUP_SONG SONG(E1M1_DOOM) @@ -24,7 +23,6 @@ #define FORCE_NKRO #define LEADER_TIMEOUT 300 -#define PREVENT_STUCK_MODIFIERS #undef DEBOUNCE #define DEBOUNCE 0 diff --git a/keyboards/planck/keymaps/jarred/config.h b/keyboards/planck/keymaps/jarred/config.h index f98b8935e2..9e8f404c15 100644 --- a/keyboards/planck/keymaps/jarred/config.h +++ b/keyboards/planck/keymaps/jarred/config.h @@ -19,8 +19,6 @@ #include "config_common.h" -#define PREVENT_STUCK_MODIFIERS - #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) #endif @@ -34,6 +32,6 @@ #define MOUSEKEY_WHEEL_DELAY 0 #define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 #endif diff --git a/keyboards/planck/keymaps/jeremy-dev/keymap.c b/keyboards/planck/keymaps/jeremy-dev/keymap.c index 5aea443290..89b7e6b84a 100644 --- a/keyboards/planck/keymaps/jeremy-dev/keymap.c +++ b/keyboards/planck/keymaps/jeremy-dev/keymap.c @@ -1,7 +1,6 @@ // This is the personal keymap of Jeremy Cowgar (@jcowgar). It is written for the programmer. // Configuration options -#define PREVENT_STUCK_MODIFIERS #pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" diff --git a/keyboards/planck/keymaps/kmontag42/rules.mk b/keyboards/planck/keymaps/kmontag42/rules.mk index b9f73934aa..0c100076be 100644 --- a/keyboards/planck/keymaps/kmontag42/rules.mk +++ b/keyboards/planck/keymaps/kmontag42/rules.mk @@ -1,4 +1,5 @@ UNICODE_ENABLE = yes +LEADER_ENABLE = yes ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/planck/keymaps/lae3/config.h b/keyboards/planck/keymaps/lae3/config.h deleted file mode 100644 index a28634e696..0000000000 --- a/keyboards/planck/keymaps/lae3/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef LAE3_KEYMAP_H -#define LAE3_KEYMAP_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif diff --git a/keyboards/planck/keymaps/mitch/config.h b/keyboards/planck/keymaps/mitch/config.h index 10591b3c8c..bb7989d90d 100644 --- a/keyboards/planck/keymaps/mitch/config.h +++ b/keyboards/planck/keymaps/mitch/config.h @@ -1,6 +1,5 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS // for the broken board #undef MATRIX_COL_PINS -#define MATRIX_COL_PINS { F1, F0, B0, B2, F4, F5, F6, F7, D4, D6, B4, D7 } \ No newline at end of file +#define MATRIX_COL_PINS { F1, F0, B0, B2, F4, F5, F6, F7, D4, D6, B4, D7 } diff --git a/keyboards/planck/keymaps/mitch/readme.md b/keyboards/planck/keymaps/mitch/readme.md index 3869304f44..9ed1133ef9 100644 --- a/keyboards/planck/keymaps/mitch/readme.md +++ b/keyboards/planck/keymaps/mitch/readme.md @@ -20,7 +20,3 @@ rest of the symbols, mostly mapped with the ten key numbers. The normal right shift key uses the `MT` macro to trigger Enter on tap and right shift when held. - -This keymap sets the `PREVENT_STUCK_MODIFIERS` flag to avoid the occasional WTF -moments when using a modifier keys and accidentally releasing them after moving -to a new layer. diff --git a/keyboards/planck/keymaps/narze/config.h b/keyboards/planck/keymaps/narze/config.h index e081a93b53..19d784b2be 100644 --- a/keyboards/planck/keymaps/narze/config.h +++ b/keyboards/planck/keymaps/narze/config.h @@ -33,10 +33,9 @@ #define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS #define SUPER_DUPER_SOUND S__NOTE(_B1) #define MOUSEKEY_DELAY 100 -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/neo2planck/config.h b/keyboards/planck/keymaps/neo2planck/config.h deleted file mode 100644 index 3e9e692d3c..0000000000 --- a/keyboards/planck/keymaps/neo2planck/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/config.h b/keyboards/planck/keymaps/priyadi/config.h index 448ae3b908..876d057bf2 100644 --- a/keyboards/planck/keymaps/priyadi/config.h +++ b/keyboards/planck/keymaps/priyadi/config.h @@ -11,8 +11,6 @@ /* skip bootmagic and eeconfig */ #define BOOTMAGIC_KEY_SKIP KC_SPACE -#define PREVENT_STUCK_MODIFIERS - #define UNICODE_TYPE_DELAY 0 #define LAYOUT_DVORAK diff --git a/keyboards/planck/keymaps/sdothum/config.h b/keyboards/planck/keymaps/sdothum/config.h index 4b2cdeece1..8bed79e6f7 100644 --- a/keyboards/planck/keymaps/sdothum/config.h +++ b/keyboards/planck/keymaps/sdothum/config.h @@ -3,9 +3,6 @@ #include "../../config.h" -// required because lower/raise modifiers are redefined by colemak-dh -#define PREVENT_STUCK_MODIFIERS - // tap dance key press termination interval #define TAPPING_TERM 250 diff --git a/keyboards/planck/keymaps/steno/config.h b/keyboards/planck/keymaps/steno/config.h index 1879ab007f..4f99c7eb81 100644 --- a/keyboards/planck/keymaps/steno/config.h +++ b/keyboards/planck/keymaps/steno/config.h @@ -15,8 +15,6 @@ #define MUSIC_MASK (keycode != KC_NO) -#define PREVENT_STUCK_MODIFIERS - /* * MIDI options */ @@ -41,4 +39,4 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +#endif diff --git a/keyboards/planck/keymaps/tehwalris/config.h b/keyboards/planck/keymaps/tehwalris/config.h index 4725e1426d..c5d55b9693 100644 --- a/keyboards/planck/keymaps/tehwalris/config.h +++ b/keyboards/planck/keymaps/tehwalris/config.h @@ -3,8 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS - #ifdef AUDIO_ENABLE // #define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(NO_SOUND) @@ -27,7 +25,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: diff --git a/keyboards/planck/keymaps/vifon/config.h b/keyboards/planck/keymaps/vifon/config.h index 4cb4a1235a..be395faad3 100644 --- a/keyboards/planck/keymaps/vifon/config.h +++ b/keyboards/planck/keymaps/vifon/config.h @@ -26,9 +26,6 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -/* prevent the modifiers from being stuck, sacrificing some memory */ -#define PREVENT_STUCK_MODIFIERS - /* A larger buffer for the dynamic macros as this keymap is not taking * up that much memory. */ diff --git a/keyboards/planck/keymaps/yale/config.h b/keyboards/planck/keymaps/yale/config.h deleted file mode 100644 index 8a916bbd09..0000000000 --- a/keyboards/planck/keymaps/yale/config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif - - - diff --git a/keyboards/planck/keymaps/zach/config.h b/keyboards/planck/keymaps/zach/config.h index 19a3856a39..dc79bad064 100644 --- a/keyboards/planck/keymaps/zach/config.h +++ b/keyboards/planck/keymaps/zach/config.h @@ -55,7 +55,6 @@ //#define NO_ACTION_ONESHOT #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define PREVENT_STUCK_MODIFIERS //#define DYNAMIC_MACRO_ENABLE // Enable if you need to use the macro functionality //#define SPACE_CADET // Parenthesis on L/R shift diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h index 0e462180bd..afd69f7d84 100644 --- a/keyboards/planck/rev6/config.h +++ b/keyboards/planck/rev6/config.h @@ -50,9 +50,6 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 6 -/* Prevent modifiers from being stuck on after layer changes. */ -#define PREVENT_STUCK_MODIFIERS - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/playkbtw/ca66/config.h b/keyboards/playkbtw/ca66/config.h index c35718042a..53bbe95e3a 100644 --- a/keyboards/playkbtw/ca66/config.h +++ b/keyboards/playkbtw/ca66/config.h @@ -42,8 +42,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS #define RGB_DI_PIN B1 #ifdef RGB_DI_PIN diff --git a/keyboards/playkbtw/pk60/config.h b/keyboards/playkbtw/pk60/config.h index 06101349cc..601e3c8a5c 100644 --- a/keyboards/playkbtw/pk60/config.h +++ b/keyboards/playkbtw/pk60/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -55,4 +52,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/preonic/keymaps/bucktooth/config.h b/keyboards/preonic/keymaps/bucktooth/config.h index b988831207..23e9e0ed28 100644 --- a/keyboards/preonic/keymaps/bucktooth/config.h +++ b/keyboards/preonic/keymaps/bucktooth/config.h @@ -4,6 +4,5 @@ #include "../../config.h" #define FORCE_NKRO 1 -#define PREVENT_STUCK_MODIFIERS #endif diff --git a/keyboards/preonic/keymaps/jacwib/config.h b/keyboards/preonic/keymaps/jacwib/config.h index b988831207..23e9e0ed28 100644 --- a/keyboards/preonic/keymaps/jacwib/config.h +++ b/keyboards/preonic/keymaps/jacwib/config.h @@ -4,6 +4,5 @@ #include "../../config.h" #define FORCE_NKRO 1 -#define PREVENT_STUCK_MODIFIERS #endif diff --git a/keyboards/preonic/keymaps/kuatsure/rules.mk b/keyboards/preonic/keymaps/kuatsure/rules.mk index 76d73acef7..9369f99a9e 100644 --- a/keyboards/preonic/keymaps/kuatsure/rules.mk +++ b/keyboards/preonic/keymaps/kuatsure/rules.mk @@ -1 +1,2 @@ BACKLIGHT_ENABLE = no +LEADER_ENABLE = yes diff --git a/keyboards/preonic/keymaps/that_canadian/config.h b/keyboards/preonic/keymaps/that_canadian/config.h deleted file mode 100644 index 11cafbefcb..0000000000 --- a/keyboards/preonic/keymaps/that_canadian/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define PREVENT_STUCK_MODIFIERS - -#endif diff --git a/keyboards/preonic/keymaps/zach/config.h b/keyboards/preonic/keymaps/zach/config.h index bb8913c7af..40a083da37 100644 --- a/keyboards/preonic/keymaps/zach/config.h +++ b/keyboards/preonic/keymaps/zach/config.h @@ -87,7 +87,6 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define PREVENT_STUCK_MODIFIERS //#define DYNAMIC_MACRO_ENABLE // Enable if you need to use the macro functionality //#define SPACE_CADET // Parenthesis on L/R shift diff --git a/keyboards/preonic/rev3/config.h b/keyboards/preonic/rev3/config.h index 3f57c591ab..98899dc6ac 100644 --- a/keyboards/preonic/rev3/config.h +++ b/keyboards/preonic/rev3/config.h @@ -50,9 +50,6 @@ /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCE 6 -/* Prevent modifiers from being stuck on after layer changes. */ -#define PREVENT_STUCK_MODIFIERS - /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ //#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/prime_r/config.h b/keyboards/prime_r/config.h index b53f149051..ad92199a22 100644 --- a/keyboards/prime_r/config.h +++ b/keyboards/prime_r/config.h @@ -60,10 +60,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/config.h b/keyboards/rorschach/keymaps/insertsnideremarks/config.h index 90fb5120df..2048232c9c 100644 --- a/keyboards/rorschach/keymaps/insertsnideremarks/config.h +++ b/keyboards/rorschach/keymaps/insertsnideremarks/config.h @@ -11,7 +11,6 @@ // #define MASTER_RIGHT #define EE_HANDS -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define TAPPING_TERM 175 #define TAPPING_TOGGLE 2 diff --git a/keyboards/s60_x/keymaps/bluebear/config.h b/keyboards/s60_x/keymaps/bluebear/config.h index 35754b5233..10bddf0d37 100644 --- a/keyboards/s60_x/keymaps/bluebear/config.h +++ b/keyboards/s60_x/keymaps/bluebear/config.h @@ -105,7 +105,4 @@ along with this program. If not, see . // Space Cadet Rollover - if set, allows to tap opposite shift key to cancel erroneous press #define DISABLE_SPACE_CADET_ROLLOVER -// Prevent stuck modifiers -#define PREVENT_STUCK_MODIFIERS - #endif diff --git a/keyboards/s60_x/rgb/config.h b/keyboards/s60_x/rgb/config.h index ec8b0f49e1..d9c26658df 100644 --- a/keyboards/s60_x/rgb/config.h +++ b/keyboards/s60_x/rgb/config.h @@ -17,9 +17,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN F6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS @@ -29,4 +26,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/s65_plus/config.h b/keyboards/s65_plus/config.h index df60e60a8d..60512db462 100644 --- a/keyboards/s65_plus/config.h +++ b/keyboards/s65_plus/config.h @@ -49,7 +49,4 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #endif diff --git a/keyboards/s65_x/config.h b/keyboards/s65_x/config.h index 8288ef7834..367efc526c 100644 --- a/keyboards/s65_x/config.h +++ b/keyboards/s65_x/config.h @@ -49,8 +49,4 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) - -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #endif diff --git a/keyboards/sx60/config.h b/keyboards/sx60/config.h index f22fbe8be4..52a1cc7a18 100755 --- a/keyboards/sx60/config.h +++ b/keyboards/sx60/config.h @@ -46,10 +46,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 diff --git a/keyboards/telophase/config.h b/keyboards/telophase/config.h index 09655c0258..be0a369773 100644 --- a/keyboards/telophase/config.h +++ b/keyboards/telophase/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . * These options are also useful to firmware size reduction. */ -#define PREVENT_STUCK_MODIFIERS - /* disable debug print */ //#define NO_DEBUG diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h index 9c7f525a71..7e7dac7cf6 100644 --- a/keyboards/tetris/config.h +++ b/keyboards/tetris/config.h @@ -41,9 +41,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define TAPPING_TERM 200 #define PERMISSIVE_HOLD @@ -62,4 +59,4 @@ //#define RGBLIGHT_LIMIT_VAL 128 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h index bb2aadfa69..fc9bd3d616 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h +++ b/keyboards/thevankeyboards/bananasplit/keymaps/talljoe/config.h @@ -3,7 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define SPACE_COUNT 3 #define TEMPLATE( \ diff --git a/keyboards/tokyo60/config.h b/keyboards/tokyo60/config.h index 6e6ab2215d..16927be17e 100644 --- a/keyboards/tokyo60/config.h +++ b/keyboards/tokyo60/config.h @@ -47,9 +47,6 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN F7 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/tomato/config.h b/keyboards/tomato/config.h index f33c131087..185cb326cc 100644 --- a/keyboards/tomato/config.h +++ b/keyboards/tomato/config.h @@ -34,9 +34,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - /* eliminate lag on space cadet mods */ #define PERMISSIVE_HOLD diff --git a/keyboards/uk78/config.h b/keyboards/uk78/config.h index 35f5bf70b3..34d6720792 100644 --- a/keyboards/uk78/config.h +++ b/keyboards/uk78/config.h @@ -60,9 +60,6 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - /* ws2812b options */ #define RGB_DI_PIN F6 #ifdef RGB_DI_PIN diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index 687f80441a..a1e361e346 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . #define NO_MUSIC_MODE #endif -#undef PREVENT_STUCK_MODIFIERS +#define STRICT_LAYER_RELEASE #define LAYOUT_ortho_5x7( \ L00, L01, L02, L03, L04, L05, L06, \ diff --git a/keyboards/whitefox/config.h b/keyboards/whitefox/config.h index 9f021fb516..a8047cf54f 100644 --- a/keyboards/whitefox/config.h +++ b/keyboards/whitefox/config.h @@ -18,8 +18,6 @@ along with this program. If not, see . #ifndef CONFIG_H #define CONFIG_H -#define PREVENT_STUCK_MODIFIERS - /* USB Device descriptor parameter */ #define VENDOR_ID 0x1c11 #define PRODUCT_ID 0xb04d diff --git a/keyboards/xd60/keymaps/kmontag42/rules.mk b/keyboards/xd60/keymaps/kmontag42/rules.mk new file mode 100644 index 0000000000..d0d2ef6d53 --- /dev/null +++ b/keyboards/xd60/keymaps/kmontag42/rules.mk @@ -0,0 +1 @@ +LEADER_ENABLE = yes diff --git a/keyboards/xd75/keymaps/davidrambo/config.h b/keyboards/xd75/keymaps/davidrambo/config.h index e87ccde797..f219147034 100644 --- a/keyboards/xd75/keymaps/davidrambo/config.h +++ b/keyboards/xd75/keymaps/davidrambo/config.h @@ -20,7 +20,6 @@ #include "../../config.h" #define TAPPING_TERM 200 -#define PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS +#define PERMISSIVE_HOLD #endif diff --git a/keyboards/xd75/keymaps/tdl-jturner/config.h b/keyboards/xd75/keymaps/tdl-jturner/config.h index 561a48d7eb..985247bb2e 100644 --- a/keyboards/xd75/keymaps/tdl-jturner/config.h +++ b/keyboards/xd75/keymaps/tdl-jturner/config.h @@ -26,7 +26,6 @@ #define TAPPING_TOGGLE 2 //#define PERMISSIVE_HOLD //#define QMK_KEYS_PER_SCAN 4 -#define PREVENT_STUCK_MODIFIERS #define FORCE_NKRO #define MOUSEKEY_INTERVAL 16 diff --git a/keyboards/xmmx/config.h b/keyboards/xmmx/config.h index f3f893e283..8cb2cf82df 100644 --- a/keyboards/xmmx/config.h +++ b/keyboards/xmmx/config.h @@ -43,10 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 @@ -55,4 +51,4 @@ #define RGBLIGHT_VAL_STEP 8 #endif -#endif \ No newline at end of file +#endif diff --git a/keyboards/ymd96/keymaps/hgoel89/config.h b/keyboards/ymd96/keymaps/hgoel89/config.h index 52aaa8f24d..b1d74e1e69 100644 --- a/keyboards/ymd96/keymaps/hgoel89/config.h +++ b/keyboards/ymd96/keymaps/hgoel89/config.h @@ -3,7 +3,6 @@ #include "../../config.h" -#define PREVENT_STUCK_MODIFIERS #define TAPPING_TERM 300 #endif diff --git a/keyboards/z150_blackheart/config.h b/keyboards/z150_blackheart/config.h index d2fce9aeef..3621536522 100644 --- a/keyboards/z150_blackheart/config.h +++ b/keyboards/z150_blackheart/config.h @@ -39,14 +39,10 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - - #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 0 #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif \ No newline at end of file +#endif diff --git a/keyboards/zeal60/keymaps/tusing/config.h b/keyboards/zeal60/keymaps/tusing/config.h index 93f260946c..64aaece501 100644 --- a/keyboards/zeal60/keymaps/tusing/config.h +++ b/keyboards/zeal60/keymaps/tusing/config.h @@ -34,7 +34,3 @@ // Scale brightnes according to BRIGHTNESS_CORRECTION_TABLE in quantum/rgblight.c. // This allows to mitigate uneven brightness from LED underglow strips. // #define LED_BRIGHTNESS_CORRECTION - -// Prevent modifiers on layer 1 from persisting after we let go -#define PREVENT_STUCK_MODIFIERS - diff --git a/keyboards/zlant/config.h b/keyboards/zlant/config.h index 456d225aa2..ae9dcfef67 100755 --- a/keyboards/zlant/config.h +++ b/keyboards/zlant/config.h @@ -43,9 +43,6 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* prevent stuck modifiers */ -#define PREVENT_STUCK_MODIFIERS - #define RGB_DI_PIN D6 #ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS diff --git a/layouts/community/60_ansi/talljoe-ansi/config.h b/layouts/community/60_ansi/talljoe-ansi/config.h index 1990b0ee3b..4326a2fd10 100644 --- a/layouts/community/60_ansi/talljoe-ansi/config.h +++ b/layouts/community/60_ansi/talljoe-ansi/config.h @@ -3,7 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define ENABLE_GAME_LAYER #define TEMPLATE( \ diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h index 81ab5cf89e..bf18fd9f7d 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h @@ -3,7 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define ENABLE_GAME_LAYER #define TEMPLATE( \ diff --git a/layouts/community/60_hhkb/talljoe-hhkb/config.h b/layouts/community/60_hhkb/talljoe-hhkb/config.h index 938ea6cd63..9e907feeb5 100644 --- a/layouts/community/60_hhkb/talljoe-hhkb/config.h +++ b/layouts/community/60_hhkb/talljoe-hhkb/config.h @@ -3,7 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define ENABLE_GAME_LAYER #define TEMPLATE( \ diff --git a/layouts/community/ergodox/adam/config.h b/layouts/community/ergodox/adam/config.h index 21af8c6b8d..1a8fddb506 100644 --- a/layouts/community/ergodox/adam/config.h +++ b/layouts/community/ergodox/adam/config.h @@ -2,5 +2,4 @@ #undef TAPPING_TERM #define TAPPING_TERM 300 //At 500 some bad logic takes hold -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT diff --git a/layouts/community/ergodox/albert/rules.mk b/layouts/community/ergodox/albert/rules.mk index fcd019e838..47549b50f6 100644 --- a/layouts/community/ergodox/albert/rules.mk +++ b/layouts/community/ergodox/albert/rules.mk @@ -1,3 +1,2 @@ COMMAND_ENABLE = no # Commands for debug and configuration - - +LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/algernon/rules.mk b/layouts/community/ergodox/algernon/rules.mk index f795a8676e..53dec5153a 100644 --- a/layouts/community/ergodox/algernon/rules.mk +++ b/layouts/community/ergodox/algernon/rules.mk @@ -8,6 +8,7 @@ TAP_DANCE_ENABLE = yes KEYLOGGER_ENABLE ?= yes UCIS_ENABLE = yes MOUSEKEY_ENABLE = no +LEADER_ENABLE = yes AUTOLOG_ENABLE ?= no diff --git a/layouts/community/ergodox/alphadox/config.h b/layouts/community/ergodox/alphadox/config.h index 6fc64f5082..9e076dead1 100644 --- a/layouts/community/ergodox/alphadox/config.h +++ b/layouts/community/ergodox/alphadox/config.h @@ -4,7 +4,6 @@ #include QMK_KEYBOARD_CONFIG_H #define FORCE_NKRO -#define PREVENT_STUCK_MODIFIERS #undef TAPPING_TERM #undef IGNORE_MOD_TAP_INTERRUPT diff --git a/layouts/community/ergodox/deadcyclo/rules.mk b/layouts/community/ergodox/deadcyclo/rules.mk index 039f07c8e3..f5093529bf 100644 --- a/layouts/community/ergodox/deadcyclo/rules.mk +++ b/layouts/community/ergodox/deadcyclo/rules.mk @@ -1 +1,2 @@ UNICODE_ENABLE = yes +LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/erez_experimental/rules.mk b/layouts/community/ergodox/erez_experimental/rules.mk index 839dd82e1e..f68b56f872 100644 --- a/layouts/community/ergodox/erez_experimental/rules.mk +++ b/layouts/community/ergodox/erez_experimental/rules.mk @@ -3,5 +3,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend COMMAND_ENABLE = no # Commands for debug and configuration - - +LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/familiar/rules.mk b/layouts/community/ergodox/familiar/rules.mk index 31e0fcf293..4a3c58621c 100644 --- a/layouts/community/ergodox/familiar/rules.mk +++ b/layouts/community/ergodox/familiar/rules.mk @@ -1 +1,2 @@ TAP_DANCE_ENABLE=yes +LEADER_ENABLE = yes diff --git a/layouts/community/ergodox/mclennon_osx/README.md b/layouts/community/ergodox/mclennon_osx/README.md index 28cdb7c108..53b3d48414 100644 --- a/layouts/community/ergodox/mclennon_osx/README.md +++ b/layouts/community/ergodox/mclennon_osx/README.md @@ -1,5 +1,5 @@ # Ergodox EZ for OS X -This keymapping is designed to be reasonably familiar to an ordinary Mac keyboard while taking advantage of the Ergodox EZ's features. Caps lock instead enables a layer which allows a user to use HJKL as arrow keys and to control media. Shift and control have additional mappings on S and D to provide easier access while holding down caps lock. +This keymapping is designed to be reasonably familiar to an ordinary Mac keyboard while taking advantage of the Ergodox EZ's features. Caps lock instead enables a layer which allows a user to use HJKL as arrow keys and to control media. Shift and control have additional mappings on S and D to provide easier access while holding down caps lock. -If you choose to compile this yourself, be sure to compile with `#define PREVENT_STUCK_MODIFIERS` in your `config.h`. Firmware built using [qmk_firmware](https://github.com/qmk/qmk_firmware/). +Firmware built using [qmk_firmware](https://github.com/qmk/qmk_firmware/). diff --git a/layouts/community/ergodox/techtomas/readme.md b/layouts/community/ergodox/techtomas/readme.md index 36e0591a8e..3d1bcb9e11 100644 --- a/layouts/community/ergodox/techtomas/readme.md +++ b/layouts/community/ergodox/techtomas/readme.md @@ -39,7 +39,7 @@ The right arrow key and End key toggle the control layer on the left board. Ther On the left board you have mouse control with left & right click in the location of the G and B keys. On the right board you have vim-style arrow keys using hjkl -The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. I found that it was easy to get the alt key stuck on depending on what key you released first so I added the PREVENT_STUCK_MODIFIERS to the config.h to help with that. +The left thumb cluster moves shift and alt within easy reach while holding the toggle (end). So far I've found this convient to navigate and skip around text when using the hjkl arrow keys. ## Changelog diff --git a/layouts/community/ortho_4x12/symbolic/config.h b/layouts/community/ortho_4x12/symbolic/config.h index 702c9226c6..c29b077062 100644 --- a/layouts/community/ortho_4x12/symbolic/config.h +++ b/layouts/community/ortho_4x12/symbolic/config.h @@ -20,10 +20,6 @@ along with this program. If not, see . #pragma once -// prevent stuck modifiers -#define PREVENT_STUCK_MODIFIERS - - // hold & tapping delay setting #define TAPPING_TERM 100 diff --git a/layouts/community/tkl_ansi/talljoe-tkl/config.h b/layouts/community/tkl_ansi/talljoe-tkl/config.h index 8b27d41365..02f8a94e39 100644 --- a/layouts/community/tkl_ansi/talljoe-tkl/config.h +++ b/layouts/community/tkl_ansi/talljoe-tkl/config.h @@ -3,7 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define ENABLE_GAME_LAYER #define TEMPLATE_TKL(\ diff --git a/quantum/process_keycode/process_chording.c b/quantum/process_keycode/process_chording.c deleted file mode 100644 index 6c6ebe300a..0000000000 --- a/quantum/process_keycode/process_chording.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright 2016 Jack Humbert - * - * 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 . - */ - -#include "process_chording.h" - -bool keys_chord(uint8_t keys[]) { - uint8_t keys_size = sizeof(keys)/sizeof(keys[0]); - bool pass = true; - uint8_t in = 0; - for (uint8_t i = 0; i < chord_key_count; i++) { - bool found = false; - for (uint8_t j = 0; j < keys_size; j++) { - if (chord_keys[i] == (keys[j] & 0xFF)) { - in++; // detects key in chord - found = true; - break; - } - } - if (found) - continue; - if (chord_keys[i] != 0) { - pass = false; // makes sure rest are blank - } - } - return (pass && (in == keys_size)); -} - -bool process_chording(uint16_t keycode, keyrecord_t *record) { - if (keycode >= QK_CHORDING && keycode <= QK_CHORDING_MAX) { - if (record->event.pressed) { - if (!chording) { - chording = true; - for (uint8_t i = 0; i < CHORDING_MAX; i++) - chord_keys[i] = 0; - chord_key_count = 0; - chord_key_down = 0; - } - chord_keys[chord_key_count] = (keycode & 0xFF); - chord_key_count++; - chord_key_down++; - return false; - } else { - if (chording) { - chord_key_down--; - if (chord_key_down == 0) { - chording = false; - // Chord Dictionary - if (keys_chord((uint8_t[]){KC_ENTER, KC_SPACE})) { - register_code(KC_A); - unregister_code(KC_A); - return false; - } - for (uint8_t i = 0; i < chord_key_count; i++) { - register_code(chord_keys[i]); - unregister_code(chord_keys[i]); - return false; - } - } - } - } - } - return true; -} diff --git a/quantum/process_keycode/process_chording.h b/quantum/process_keycode/process_chording.h deleted file mode 100644 index 8c0f4862a8..0000000000 --- a/quantum/process_keycode/process_chording.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright 2016 Jack Humbert - * - * 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 . - */ - -#ifndef PROCESS_CHORDING_H -#define PROCESS_CHORDING_H - -#include "quantum.h" - -// Chording stuff -#define CHORDING_MAX 4 -bool chording = false; - -uint8_t chord_keys[CHORDING_MAX] = {0}; -uint8_t chord_key_count = 0; -uint8_t chord_key_down = 0; - -bool process_chording(uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index c87ef115af..eddbf71f70 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#ifndef DISABLE_LEADER +#ifdef LEADER_ENABLE #include "process_leader.h" diff --git a/quantum/quantum.c b/quantum/quantum.c index 9d352a94cf..9bf91eb865 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -196,7 +196,7 @@ bool process_record_quantum(keyrecord_t *record) { keypos_t key = record->event.key; uint16_t keycode; - #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) + #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) /* TODO: Use store_or_get_action() or a similar function. */ if (!disable_action_cache) { uint8_t layer; @@ -251,12 +251,9 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef TAP_DANCE_ENABLE process_tap_dance(keycode, record) && #endif - #ifndef DISABLE_LEADER + #ifdef LEADER_ENABLE process_leader(keycode, record) && #endif - #ifndef DISABLE_CHORDING - process_chording(keycode, record) && - #endif #ifdef COMBO_ENABLE process_combo(keycode, record) && #endif diff --git a/quantum/quantum.h b/quantum/quantum.h index d1f761f17a..7cf16d81e6 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -89,15 +89,10 @@ extern uint32_t default_layer_state; #include "process_music.h" #endif -#ifndef DISABLE_LEADER +#ifdef LEADER_ENABLE #include "process_leader.h" #endif -#define DISABLE_CHORDING -#ifndef DISABLE_CHORDING - #include "process_chording.h" -#endif - #ifdef UNICODE_ENABLE #include "process_unicode.h" #endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 0ecc293a82..3b87954960 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -63,10 +63,6 @@ enum quantum_keycodes { QK_ONE_SHOT_LAYER_MAX = 0x54FF, QK_ONE_SHOT_MOD = 0x5500, QK_ONE_SHOT_MOD_MAX = 0x55FF, -#ifndef DISABLE_CHORDING - QK_CHORDING = 0x5600, - QK_CHORDING_MAX = 0x56FF, -#endif QK_TAP_DANCE = 0x5700, QK_TAP_DANCE_MAX = 0x57FF, QK_LAYER_TAP_TOGGLE = 0x5800, @@ -123,7 +119,7 @@ enum quantum_keycodes { GRAVE_ESC, // Leader key -#ifndef DISABLE_LEADER +#ifdef LEADER_ENABLE KC_LEAD, #endif diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index ae08647496..76d02bc9df 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -120,7 +120,7 @@ void process_hand_swap(keyevent_t *event) { } #endif -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) bool disable_action_cache = false; void process_record_nocache(keyrecord_t *record) diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index acc55c7d38..0322c73ed1 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -62,7 +62,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt); bool process_record_quantum(keyrecord_t *record); /* Utilities for actions. */ -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) extern bool disable_action_cache; #endif diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index f3cd381ab0..62375dfbfe 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -219,7 +219,7 @@ void layer_debug(void) } #endif -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {{0}}; void update_source_layers_cache(keypos_t key, uint8_t layer) @@ -263,7 +263,7 @@ uint8_t read_source_layers_cache(keypos_t key) */ action_t store_or_get_action(bool pressed, keypos_t key) { -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) if (disable_action_cache) { return layer_switch_get_action(key); } diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 72a6bd8f68..7bf116be2d 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -88,7 +88,7 @@ uint32_t layer_state_set_kb(uint32_t state); #endif /* pressed actions cache */ -#if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) +#if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) /* The number of bits needed to represent the layer number: log2(32). */ #define MAX_LAYER_BITS 5 void update_source_layers_cache(keypos_t key, uint8_t layer); diff --git a/users/333fred/333fred_config.h b/users/333fred/333fred_config.h index 7c637d8d36..b158e2d5a2 100644 --- a/users/333fred/333fred_config.h +++ b/users/333fred/333fred_config.h @@ -1,4 +1,3 @@ #pragma once -#define PREVENT_STUCK_MODIFIERS #define PERMISSIVE_HOLD diff --git a/users/bocaj/config.h b/users/bocaj/config.h index ce5ec65d62..0e726598cd 100644 --- a/users/bocaj/config.h +++ b/users/bocaj/config.h @@ -10,7 +10,6 @@ // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT #undef PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS #ifdef TAPPING_TERM #undef TAPPING_TERM diff --git a/users/drashna/config.h b/users/drashna/config.h index dd6875ceb1..92efcc5c74 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -43,7 +43,6 @@ // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT #undef PERMISSIVE_HOLD -#define PREVENT_STUCK_MODIFIERS // #define TAPPING_FORCE_HOLD //#define RETRO_TAPPING @@ -64,8 +63,4 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER - #define MACRO_TIMER 5 - - diff --git a/users/ishtob/config.h b/users/ishtob/config.h index 9c4a7ed8dd..1f567f4a5b 100755 --- a/users/ishtob/config.h +++ b/users/ishtob/config.h @@ -15,7 +15,6 @@ //#define LEADER_TIMEOUT 300 //#define BACKLIGHT_BREATHING -#define PREVENT_STUCK_MODIFIERS //#define PERMISSIVE_HOLD // #define QMK_KEYS_PER_SCAN 4 @@ -72,5 +71,5 @@ // Most tactile encoders have detents every 4 stages #define ENCODER_RESOLUTION 4 - + #endif diff --git a/users/replicaJunction/config.h b/users/replicaJunction/config.h index f3556c87ed..4b58b579f8 100644 --- a/users/replicaJunction/config.h +++ b/users/replicaJunction/config.h @@ -6,12 +6,6 @@ // https://docs.qmk.fm/reference/config-options#features-that-can-be-enabled //////////////////////////////////////////////////////////////////////////////// -// Prevent modifiers from sticking when switching layers -// Uses 5 bytes of memory per 8 keys, but makes sure modifiers don't get "stuck" switching layers -#define PREVENT_STUCK_MODIFIERS - - - //////////////////////////////////////////////////////////////////////////////// // Behaviors That Can Be Configured // https://docs.qmk.fm/reference/config-options#behaviors-that-can-be-configured diff --git a/users/talljoe/config.h b/users/talljoe/config.h index 15bbde6bcd..1cdbb5a412 100644 --- a/users/talljoe/config.h +++ b/users/talljoe/config.h @@ -1,7 +1,6 @@ #ifndef USERSPACE_CONFIG_H #define USERSPACE_CONFIG_H -#define PREVENT_STUCK_MODIFIERS #define IGNORE_MOD_TAP_INTERRUPT #define RESET_LAYER 15 diff --git a/users/wanleg/config.h b/users/wanleg/config.h index 22073449b2..28e7690e65 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -1,8 +1,6 @@ #ifndef USERSPACE_CONFIG_H #define USERSPACE_CONFIG_H -#define PREVENT_STUCK_MODIFIERS - //TAPPING_TERM #ifdef TAP_DANCE_ENABLE #define TAPPING_TERM 200 diff --git a/users/zer09/config.h b/users/zer09/config.h index 7668064622..4cb65c258f 100644 --- a/users/zer09/config.h +++ b/users/zer09/config.h @@ -11,7 +11,7 @@ // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT #undef PERMISSIVE_HOLD -#undef PREVENT_STUCK_MODIFIERS +#define STRICT_LAYER_RELEASE #define FORCE_NKRO -- cgit v1.2.3 From fe3bfd91c1a085716baa2b4396709ad5d77c7c75 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Mon, 17 Sep 2018 13:41:59 -0700 Subject: Keymap: Big switch config (#3904) * bigswitch keymap * bigswitch keymap * bigswitch keymap * bigswitch keymap * recommended edits made * forgot to revert this change with the others --- keyboards/bigswitch/bigswitch.c | 2 + keyboards/bigswitch/keymaps/wanleg/config.h | 45 ++++++++++++++++++++++ keyboards/bigswitch/keymaps/wanleg/keymap.c | 27 +++++++++++++ keyboards/bigswitch/keymaps/wanleg/rules.mk | 7 ++++ users/wanleg/tapdances.c | 59 +++++++++++++++++++++++++++++ users/wanleg/wanleg.h | 1 + 6 files changed, 141 insertions(+) create mode 100644 keyboards/bigswitch/keymaps/wanleg/config.h create mode 100644 keyboards/bigswitch/keymaps/wanleg/keymap.c create mode 100644 keyboards/bigswitch/keymaps/wanleg/rules.mk diff --git a/keyboards/bigswitch/bigswitch.c b/keyboards/bigswitch/bigswitch.c index dfd9710e27..b924c7017c 100644 --- a/keyboards/bigswitch/bigswitch.c +++ b/keyboards/bigswitch/bigswitch.c @@ -19,10 +19,12 @@ along with this program. If not, see . volatile uint8_t runonce = true; static uint16_t my_timer; +__attribute__ ((weak)) void matrix_init_user(void) { my_timer = timer_read(); } +__attribute__ ((weak)) void matrix_scan_user(void) { if (runonce && timer_elapsed(my_timer) > 1000) { runonce = false; diff --git a/keyboards/bigswitch/keymaps/wanleg/config.h b/keyboards/bigswitch/keymaps/wanleg/config.h new file mode 100644 index 0000000000..f1e1693457 --- /dev/null +++ b/keyboards/bigswitch/keymaps/wanleg/config.h @@ -0,0 +1,45 @@ +/* Copyright 2018 wanleg + * + * 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 + +// place overrides here +#undef MATRIX_ROW_PINS +#define MATRIX_ROW_PINS { B4 } +#undef MATRIX_COL_PINS +#define MATRIX_COL_PINS { B6 } +//#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#undef DIODE_DIRECTION +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define BREATHING_PERIOD 5 + +/* for Tap Dance */ +#undef TAPPING_TERM +#define TAPPING_TERM 700 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +//#define DEBOUNCING_DELAY 5 +#undef DEBOUNCING_DELAY +#define DEBOUNCING_DELAY 2 + +// set flashing LED with QMK DFU +#define QMK_LED B0 diff --git a/keyboards/bigswitch/keymaps/wanleg/keymap.c b/keyboards/bigswitch/keymaps/wanleg/keymap.c new file mode 100644 index 0000000000..7f4150e581 --- /dev/null +++ b/keyboards/bigswitch/keymaps/wanleg/keymap.c @@ -0,0 +1,27 @@ +/* Copyright 2018 wanleg + * + * 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 . + */ +#include QMK_KEYBOARD_H +#include "wanleg.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ +TD(CAD_TD) \ +), +}; + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/bigswitch/keymaps/wanleg/rules.mk b/keyboards/bigswitch/keymaps/wanleg/rules.mk new file mode 100644 index 0000000000..bc4a1873f8 --- /dev/null +++ b/keyboards/bigswitch/keymaps/wanleg/rules.mk @@ -0,0 +1,7 @@ +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default + +#If using a ProMicro and it has the QMK DFU bootloader instead of Caterina, +#run "make : dfu=qmk" when compiling to ensure it is flagged properly after being flashed +ifeq ($(strip $(dfu)), qmk) + BOOTLOADER = qmk-dfu +endif \ No newline at end of file diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 318810b1b2..6a98b896a5 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -94,6 +94,64 @@ void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { } DELtap_state.state = 0; } + +//instantialize an instance of 'tap' for the 'CAD' tap dance. +static tap CADtap_state = { + .is_press_action = true, + .state = 0 +}; + +void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { + CADtap_state.state = cur_dance(state); + switch (CADtap_state.state) { + case SINGLE_TAP: + //register_code(KC_SPC); + SEND_STRING(SS_LGUI("l")); + backlight_set(3); + break; + case SINGLE_HOLD: + //register_code(KC_NO); + //take a screenshot of a single window, open Paint and paste + SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)) SS_LGUI("r")); + _delay_ms(500); + SEND_STRING("mspaint" SS_TAP(X_ENTER)); + _delay_ms(700); + SEND_STRING(SS_LCTRL("v")); + break; //register this keycode when button is held + case DOUBLE_TAP: + //register_code(KC_ENT); + SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); + backlight_set(0); + break; + //case DOUBLE_HOLD: register_code(KC_NO); break; //register this keycode when button is tapped and then held + case DOUBLE_HOLD: + reset_keyboard(); + break; //register this keycode when button is tapped and then held + case DOUBLE_SINGLE_TAP: register_code(KC_NO); unregister_code(KC_NO); register_code(KC_NO); + } +} + +void CAD_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (CADtap_state.state) { + case SINGLE_TAP: + //unregister_code(KC_SPC); + SEND_STRING(SS_LGUI("l")); + backlight_set(3); + break; + case SINGLE_HOLD: + register_code(KC_NO); //(un)register this keycode when button is held and then released + //SEND_STRING(SS_LCTRL("v")); + break; + case DOUBLE_TAP: + //register_code(KC_ENT); + SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); + backlight_set(0); + break; + case DOUBLE_HOLD: register_code(KC_NO); //(un)register this keycode when button is tapped and then held, and then released + case DOUBLE_SINGLE_TAP: unregister_code(KC_NO); + } + CADtap_state.state = 0; +} ///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// //Tap Dance Definitions @@ -104,6 +162,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) + ,[CAD_TD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, CAD_finished, CAD_reset) }; //In Layer declaration, add tap dance item in place of a key code diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 5cec82e605..8b98ec7ddf 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -106,6 +106,7 @@ enum { ,TD_Q_ESC ,ENT_TAP_DANCE ,DEL_TAP_DANCE + ,CAD_TD }; #endif -- cgit v1.2.3 From ed2dd3b59c5fc7856a1b01a97ba5b22ed4f69317 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Mon, 17 Sep 2018 21:55:49 +0100 Subject: Keyboard: Add YMD96 instructions for Linux + Backlight Fixes (#3908) * Add flashing instructions for Linux * Make device/manufacturer name consistent for ymd96 * Disable command mode by default for YMD96 * Add function call to fix backlight for YMD96 * Add personal YMD96 config * Replace include with QMK macro * Move KEYMAP macro to keymap-level folder * Move custom KEYMAP macro to global LAYOUT_iso macro * Change transparent keymappings to global definition * Remove unecessary import and change to pragma once - (instead of repeated ifdef) * Remove global keymap/layout definition --- keyboards/ymd96/README.md | 14 ++++-- keyboards/ymd96/config.h | 1 - keyboards/ymd96/keymaps/AnthonyWharton/README.md | 16 ++++++ keyboards/ymd96/keymaps/AnthonyWharton/config.h | 63 ++++++++++++++++++++++++ keyboards/ymd96/keymaps/AnthonyWharton/keymap.c | 47 ++++++++++++++++++ keyboards/ymd96/matrix.c | 12 ----- keyboards/ymd96/rules.mk | 2 +- keyboards/ymd96/usbconfig.h | 8 +-- keyboards/ymd96/ymd96.h | 17 +++++++ 9 files changed, 158 insertions(+), 22 deletions(-) create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/README.md create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/config.h create mode 100644 keyboards/ymd96/keymaps/AnthonyWharton/keymap.c diff --git a/keyboards/ymd96/README.md b/keyboards/ymd96/README.md index 7a950223b6..9cb3760582 100644 --- a/keyboards/ymd96/README.md +++ b/keyboards/ymd96/README.md @@ -31,17 +31,23 @@ This firmware was modified from [ps2avrGB](https://github.com/qmk/qmk_firmware/t ## Installing and Building -Since the YMD96 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. If anyone knows of a Linux/Mac bootflasher that works, edit this readme! +Since the YMD96 uses an ATmega32a chip instead of the 32u4, you need to download [HIDBootFlash v.1.0](http://vusb.wikidot.com/project:hidbootflash) for Windows. For Linux you can use the [bootloadHID](https://www.obdev.at/products/vusb/bootloadhid.html) utility (which will require building). Arch Linux users can alternatively install this from the [AUR](https://aur.archlinux.org/packages/bootloadhid/). On Windows, I use [MINGw](http://www.mingw.org/) to compile the keymaps. On Linux, you can simply use the terminal. Once you have those two pieces of software: -Build the keyboard with +Build the keyboard by navigating to the root folder of the QMK repo and running ``` -$ make ymd96-default +$ make ymd96:default ``` If you make your own layout, change the `default` word to whatever your layout is. -And flash the compiled hex file with `HIDBootFlash`. Simply put the board in flashing mode by plugging it in while holding control, and click `find device`. Then you can specify the .hex file and flash it to the device. +To flash the compiled hex file, simply put the board in flashing mode by plugging it in while holding control. +In `HIDBootFlash` first click `find device`, then you can specify the .hex file and flash it to the device. +For `bootloadHID`, from a terminal that is in the same folder as your firmware file, run +``` +$ sudo bootloadHID ymd96_default.hex +``` +Again replacing default with your custom keymap name if required. ## Troubleshooting diff --git a/keyboards/ymd96/config.h b/keyboards/ymd96/config.h index 3122c694eb..1e9497fac6 100644 --- a/keyboards/ymd96/config.h +++ b/keyboards/ymd96/config.h @@ -23,7 +23,6 @@ along with this program. If not, see . #define VENDOR_ID 0x20A0 #define PRODUCT_ID 0x422D -// TODO: share these strings with usbconfig.h // Edit usbconfig.h to change these. #define MANUFACTURER ymdkey #define PRODUCT ymd96 diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/README.md b/keyboards/ymd96/keymaps/AnthonyWharton/README.md new file mode 100644 index 0000000000..973e336cb6 --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/README.md @@ -0,0 +1,16 @@ +# Personal Config by @AnthonyWharton + +The keymap and layout macro's in the main repository are for the following +keyboard: + +![@AnthonyWharton's YMD96](https://i.imgur.com/uhKmkBz.jpg) + +**Note:** This setup has locking Caps Lock and Num Lock keys, so if you wish +to use this layout and do not have such keys, you should : + + - Change the keys `KC_LCAP` and `KC_LNUM` to `KC_CAPS` and `KC_NUMLOCK` + respectively. + - Remove the `LOCKING_SUPPORT_ENABLE` and `LOCKING_RESYNC_ENABLE` lines + from `config.h`. + +For any other questions, find my latest contact information on my github page. diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/config.h b/keyboards/ymd96/keymaps/AnthonyWharton/config.h new file mode 100644 index 0000000000..715e2c9a5f --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/config.h @@ -0,0 +1,63 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak +Modified 2018 Anthony Wharton + +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 + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +// Edit usbconfig.h to change these. +#define MANUFACTURER ymdkey +#define PRODUCT ymd96 + +/* Matrix Size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 +#define DIODE_DIRECTION COL2ROW + +/* Required for MX Locks installed */ +#define LOCKING_SUPPORT_ENABLE +#define LOCKING_RESYNC_ENABLE + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_TOGGLE 3 +#define NO_UART 1 + +#define BACKLIGHT_LEVELS 12 + +/* RGB Underglow */ +// The RGB_DI_PING value seems to be shared between all PS2AVRGB boards. +// The same pin is used on the JJ40, at least. +#define RGBLED_NUM 18 +#define RGB_DI_PIN E2 // NOTE: for PS2AVRGB boards, underglow commands are send + // via I2C to 0xB0 + +#define RGBLIGHT_ANIMATIONS + +#define RGBLIGHT_EFFECT_BREATHE_CENTER 1.85 // 1.0-2.7 +#define RGBLIGHT_EFFECT_BREATHE_MAX 255 // 1-255 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +#define RGBLIGHT_EFFECT_KNIGHT_OFFSET 0 +#define RGBLIGHT_EFFECT_KNIGHT_LED_NUM RGBLED_NUM +#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 +#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 500 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + diff --git a/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c new file mode 100644 index 0000000000..2b3e2e2c7c --- /dev/null +++ b/keyboards/ymd96/keymaps/AnthonyWharton/keymap.c @@ -0,0 +1,47 @@ +/* +Base Copyright 2017 Luiz Ribeiro +Modified 2017 Andrew Novak +Modified 2018 Anthony Wharton + +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 LicensezZZ +along with this program. If not, see . +*/ + +#include QMK_KEYBOARD_H + +#define _DEFLT 0 +#define _RAISE 1 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0, default layer */ + [_DEFLT] = LAYOUT_iso( + 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_HOME, KC_END, KC_INS, KC_DEL, KC_PGUP, \ + 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_LNUM, KC_PSLS, KC_PAST, KC_PGDN, \ + 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_ENT, KC_P7, KC_P8, KC_P9, KC_PMNS, \ + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_RAISE), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + + /* Layer 1, raise layer */ + [_RAISE] = LAYOUT_iso( + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, KC_PAUS, KC_SLCK, _______, _______, _______, \ + _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_M_X, RGB_M_G, BL_OFF, BL_ON, BL_DEC, BL_INC, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, KC_MUTE, _______, KC_VOLU, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, BL_TOGG, KC_MPRV, KC_MPLY, KC_MNXT, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_VOLD, _______, KC_LOCK, \ + _______, _______, KC_RALT, _______, _______, _______, KC_HOME, KC_PGDN, KC_END, _______, _______ \ + ) +}; diff --git a/keyboards/ymd96/matrix.c b/keyboards/ymd96/matrix.c index f2ecf4d33c..2932976dde 100644 --- a/keyboards/ymd96/matrix.c +++ b/keyboards/ymd96/matrix.c @@ -50,20 +50,8 @@ void matrix_init(void) { matrix[row] = 0x00; matrix_debouncing[row] = 0x00; } -/*} matrix_init_quantum(); // missing from original port by Luiz -void matrix_set_row_status(uint8_t row) { - DDRB = (1 << row); - PORTB = ~(1 << row); -}*/ - - -/*uint8_t bit_reverse(uint8_t x) { - x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); - x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); - x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); - return x;*/ } uint8_t matrix_scan(void) { diff --git a/keyboards/ymd96/rules.mk b/keyboards/ymd96/rules.mk index 42b3d11551..1cc4060b01 100644 --- a/keyboards/ymd96/rules.mk +++ b/keyboards/ymd96/rules.mk @@ -35,7 +35,7 @@ BOOTMAGIC_ENABLE = no MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no -COMMAND_ENABLE = yes +COMMAND_ENABLE = no BACKLIGHT_ENABLE = yes BACKLIGHT_CUSTOM_DRIVER = yes diff --git a/keyboards/ymd96/usbconfig.h b/keyboards/ymd96/usbconfig.h index 50fe4ed113..a90a36f082 100644 --- a/keyboards/ymd96/usbconfig.h +++ b/keyboards/ymd96/usbconfig.h @@ -242,8 +242,8 @@ section at the end of this file). #define USB_CFG_DEVICE_VERSION 0x00, 0x02 /* Version number of the device: Minor number first, then major number. */ -#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' -#define USB_CFG_VENDOR_NAME_LEN 13 +#define USB_CFG_VENDOR_NAME 'y','m','d','k','e','y' +#define USB_CFG_VENDOR_NAME_LEN 6 /* These two values define the vendor name returned by the USB device. The name * must be given as a list of characters under single quotes. The characters * are interpreted as Unicode (UTF-16) entities. @@ -252,8 +252,8 @@ section at the end of this file). * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for * details. */ -#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' -#define USB_CFG_DEVICE_NAME_LEN 8 +#define USB_CFG_DEVICE_NAME 'y','m','d','9','6' +#define USB_CFG_DEVICE_NAME_LEN 5 /* Same as above for the device name. If you don't want a device name, undefine * the macros. See the file USB-IDs-for-free.txt before you assign a name if * you use a shared VID/PID. diff --git a/keyboards/ymd96/ymd96.h b/keyboards/ymd96/ymd96.h index ee0926eee8..9c25f22192 100644 --- a/keyboards/ymd96/ymd96.h +++ b/keyboards/ymd96/ymd96.h @@ -76,5 +76,22 @@ K411, K410, K409, K408, K404, K405, K406, K407, K403, K402, K401, K400 \ { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411 }, \ } +#define LAYOUT_iso( \ + K0500, K0502, K0503, K0504, K0505, K0600, K0610, K0710, K0700, K0511, K0512, K0513, K0514, K0113, K0214, K0013, K0706, K0709, K0708, \ + K0400, K0401, K0402, K0403, K0404, K0405, K0601, K0611, K0711, K0701, K0410, K0411, K0412, K0414, K0406, K0407, K0408, K0409, \ + K0300, K0301, K0302, K0303, K0304, K0305, K0602, K0612, K0712, K0702, K0310, K0311, K0312, K0213, K0306, K0307, K0308, K0309, \ + K0200, K0201, K0202, K0203, K0204, K0205, K0603, K0613, K0713, K0703, K0210, K0211, K0212, K0206, K0207, K0208, K0209, \ + K0100, K0003, K0101, K0102, K0103, K0104, K0105, K0604, K0614, K0714, K0704, K0110, K0111, K0608, K0106, K0107, K0108, K0009, \ + K0000, K0001, K0002, K0605, K0705, K0011, K0606, K0607, K0609, K0006, K0008 \ +) { \ + { K0000, K0001, K0002, K0003, KC_NO, KC_NO, K0006, KC_NO, K0008, K0009, KC_NO, K0011, KC_NO, K0013, KC_NO, }, \ + { K0100, K0101, K0102, K0103, K0104, K0105, K0106, K0107, K0108, KC_NO, K0110, K0111, KC_NO, K0113, KC_NO, }, \ + { K0200, K0201, K0202, K0203, K0204, K0205, K0206, K0207, K0208, K0209, K0210, K0211, K0212, K0213, K0214, }, \ + { K0300, K0301, K0302, K0303, K0304, K0305, K0306, K0307, K0308, K0309, K0310, K0311, K0312, KC_NO, KC_NO, }, \ + { K0400, K0401, K0402, K0403, K0404, K0405, K0406, K0407, K0408, K0409, K0410, K0411, K0412, KC_NO, K0414, }, \ + { K0500, KC_NO, K0502, K0503, K0504, K0505, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K0511, K0512, K0513, K0514, }, \ + { K0600, K0601, K0602, K0603, K0604, K0605, K0606, K0607, K0608, K0609, K0610, K0611, K0612, K0613, K0614, }, \ + { K0700, K0701, K0702, K0703, K0704, K0705, K0706, KC_NO, K0708, K0709, K0710, K0711, K0712, K0713, K0714 } \ +} #endif -- cgit v1.2.3 From 3f680a93eb38408d1fc6b0c78ee94b542cbc7aee Mon Sep 17 00:00:00 2001 From: Pascal Greilich Date: Mon, 17 Sep 2018 17:09:41 -0400 Subject: Keyboard: Tada68 readme img (#3918) * a new planck layout * layout images * layout images 2 * typo * update include following PR comment * updates following PR commments 2 * updates following PR comments * layout images * better layout names --- keyboards/tada68/keymaps/pascamel/readme.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/keyboards/tada68/keymaps/pascamel/readme.md b/keyboards/tada68/keymaps/pascamel/readme.md index 640ca27347..a829133fc6 100755 --- a/keyboards/tada68/keymaps/pascamel/readme.md +++ b/keyboards/tada68/keymaps/pascamel/readme.md @@ -1,3 +1,11 @@ # pascamel's TADA68 layout -A layout based on raylas' layout with some updates on the fn layer especially around media keys. \ No newline at end of file +A layout based on raylas' layout with some updates on the fn layer especially around media keys. + +### Main layer + +![Imgur](https://i.imgur.com/UColvfc.png) + +### Fn layer + +![Imgur](https://i.imgur.com/pDQFoCQ.png) -- cgit v1.2.3 From 244e1c5a57eecd349c7d88e1af42d1b3467aeafe Mon Sep 17 00:00:00 2001 From: dsissitka Date: Sun, 16 Sep 2018 17:49:20 -0400 Subject: Fix LEADER_KEY docs. LEADER_KEY needs to be set in config.h, not keymap.c. Credit goes to @randywallace for figuring this one out: https://github.com/qmk/qmk_firmware/issues/2514#issuecomment-384847485 --- docs/feature_leader_key.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 0c3f4a1332..92aebd463d 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -5,7 +5,7 @@ If you've ever used Vim, you know what a Leader key is. If not, you're about to That's what `KC_LEAD` does. Here's an example: 1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` somewhere in your keymap.c file, probably near the top. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. +2. Include the line `#define LEADER_TIMEOUT 300` in your config.h. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. 3. Within your `matrix_scan_user` function, do something like this: ``` -- cgit v1.2.3 From a6d1db2c275f2e33e23135a6e410dbc8d19720a2 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 17 Sep 2018 09:23:43 -0700 Subject: Create AG_TOGG code to toggle Alt/Gui swap. --- docs/feature_bootmagic.md | 1 + docs/keycodes.md | 1 + quantum/quantum.c | 11 +++++++++++ quantum/quantum_keycodes.h | 2 ++ 4 files changed, 15 insertions(+) diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index d6915d3559..586b5d8370 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -57,6 +57,7 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug |`MAGIC_UNNO_GUI` | |Enable the GUI keys | |`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)| |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI | +|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap | |`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace | |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock | diff --git a/docs/keycodes.md b/docs/keycodes.md index c344a75283..6676bb53c9 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -271,6 +271,7 @@ This is a reference only. Each group of keys links to the page documenting their |`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace | |`MAGIC_UNHOST_NKRO` | |Force NKRO off | |`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides | +|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides| |`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off | ## [Bluetooth](feature_bluetooth.md) diff --git a/quantum/quantum.c b/quantum/quantum.c index 9bf91eb865..84ccbdeaba 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -626,6 +626,17 @@ bool process_record_quantum(keyrecord_t *record) { PLAY_SONG(ag_norm_song); #endif break; + case MAGIC_TOGGLE_ALT_GUI: + keymap_config.swap_lalt_lgui = !keymap_config.swap_lalt_lgui; + keymap_config.swap_ralt_rgui = !keymap_config.swap_ralt_rgui; + #ifdef AUDIO_ENABLE + if (keymap_config.swap_ralt_rgui) { + PLAY_SONG(ag_swap_song); + } else { + PLAY_SONG(ag_norm_song); + } + #endif + break; case MAGIC_TOGGLE_NKRO: keymap_config.nkro = !keymap_config.nkro; break; diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 3b87954960..050d2d275d 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -116,6 +116,7 @@ enum quantum_keycodes { MAGIC_UNHOST_NKRO, MAGIC_UNSWAP_ALT_GUI, MAGIC_TOGGLE_NKRO, + MAGIC_TOGGLE_ALT_GUI, GRAVE_ESC, // Leader key @@ -590,6 +591,7 @@ enum quantum_keycodes { #define AG_SWAP MAGIC_SWAP_ALT_GUI #define AG_NORM MAGIC_UNSWAP_ALT_GUI +#define AG_TOGG MAGIC_TOGGLE_ALT_GUI // GOTO layer - 16 layers max // when: -- cgit v1.2.3 From cb8d352cb3902612b118bf813d0459a2cd68473e Mon Sep 17 00:00:00 2001 From: Olivier Poitrey Date: Mon, 17 Sep 2018 15:10:00 -0700 Subject: Keymap: dz60/macos_arrow: fix rev3 broken media layer (#3928) Last rev broke the media layer because of a typo in layer definition. Switched to an enum to avoid similar future typos. --- keyboards/dz60/keymaps/macos_arrow/keymap.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index 9a3120afd3..7106092a47 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -1,9 +1,11 @@ #include QMK_KEYBOARD_H -#define _BL 0 // Base layer -#define _FL 1 // Function layer -#define _ML 2 // Media layer -#define _NL 2 // Numpad layer +enum dz60_layers { + _BL, // Base layer + _FL, // Function layer + _ML, // Media layer + _NL // Numpad layer +}; enum my_keycodes { BR_UP = SAFE_RANGE, -- cgit v1.2.3 From ec64be6622f73500f852149b7ab5460b6db5bac0 Mon Sep 17 00:00:00 2001 From: Merlin04 Date: Mon, 17 Sep 2018 15:18:19 -0700 Subject: Keyboard: Fix pin numbers for Fractal keyboard (#3743) * Added support for the Fractal keyboard * Try to fix the issue * Add support for the Fractal keyboard. * Fix errors with files * Update config.h --- keyboards/fractal/config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/fractal/config.h b/keyboards/fractal/config.h index 1a5901f984..396c3b4b94 100755 --- a/keyboards/fractal/config.h +++ b/keyboards/fractal/config.h @@ -17,7 +17,8 @@ /* key matrix pins */ #define MATRIX_ROW_PINS { B1, F7, F6, F5, F4 } -#define MATRIX_COL_PINS { B3, B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D2 } +#define MATRIX_COL_PINS { B3, B2, B6, B5, B4, E6, D7, C6, D4, D0, D1, D3 } + #define UNUSED_PINS /* COL2ROW or ROW2COL */ -- cgit v1.2.3 From 03b8ce206d566bf7f75771b55e05aea6ea6dba2d Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Tue, 18 Sep 2018 08:49:20 +1000 Subject: Keyboard: add Keyboardio Model 01 (#3900) * Keyboard: add Keyboardio Model01 This port implements key scanning and everything in their default keymap. It doesn't implement mouse warping; QMK can't do that (yet). LED control is mostly not implemented. The ability to set all LEDs is included because they can get stuck on coming from the bootloader otherwise. Single LED control is also implemented for numpad indication. The scanners also support batch LED transfer which is what you'd need if you wanted to do fast effects. Gamma correction is also not implemented, but is present in the original firmware. The necessary info for further implementation is in the KeyboardioScanner module for Kaleidoscope. To install on your keyboard: make model01:avrdude When prompted, hold the "prog" key on the keyboard to put it into programming mode. This can also be achieved by holding the "prog" key while plugging in the keyboard. This works even if the firmware is corrupt or missing. Hot plugging the halves seems to work fine, but there is no explicit support for eg. making sure the matrix scan rate is reconfigured. * model01: clean up includes and include guards Uses #pragma once everywhere. * model01: split LED and matrix code This makes space if someone wants to implement better LED support later on, the keyboard is a lot more capable than the current code. * model01: separate I2C timeouts for matrix vs. LED If the scanners have no data they don't ACK reads and just time out. So we want a pretty short timeout to keep scan rates high. Meanwhile the LED transfers might take longer - I don't know though, so here we are conservative. * model01: implement better LED control - gamma correction from the manufacturer's firmware - suitable delays to allow back to back LED writes - this is fast enough to write the whole keyboard without noticeable delay, in my experience - minor bug fix: RHS Fn key was not addressable * model01: add license to wire-protocol-constants.h * model01: replace gamma LUT The original was of unclear license origin. This one is functionally identical and includes a generator should people wish to adjust it. * model01: use the already-present CIE1931 lightness curve ...rather than baking in another gamma curve. It's said that CIE1931 is the right thing to be using rather than gamma. OK. Let it be so. * model01: call matrix_init_user() from matrix_init_kb() * model01: remove inapplicable config options from rules.mk * model01: readme.md: update build environment links --- keyboards/model01/config.h | 35 +++++++++++ keyboards/model01/info.json | 4 ++ keyboards/model01/keymaps/default/config.h | 19 ++++++ keyboards/model01/keymaps/default/keymap.c | 93 ++++++++++++++++++++++++++++ keyboards/model01/keymaps/default/readme.md | 3 + keyboards/model01/keymaps/default/rules.mk | 2 + keyboards/model01/leds.c | 57 +++++++++++++++++ keyboards/model01/leds.h | 25 ++++++++ keyboards/model01/matrix.c | 94 +++++++++++++++++++++++++++++ keyboards/model01/model01.c | 38 ++++++++++++ keyboards/model01/model01.h | 50 +++++++++++++++ keyboards/model01/readme.md | 37 ++++++++++++ keyboards/model01/rules.mk | 62 +++++++++++++++++++ keyboards/model01/wire-protocol-constants.h | 53 ++++++++++++++++ 14 files changed, 572 insertions(+) create mode 100644 keyboards/model01/config.h create mode 100644 keyboards/model01/info.json create mode 100644 keyboards/model01/keymaps/default/config.h create mode 100644 keyboards/model01/keymaps/default/keymap.c create mode 100644 keyboards/model01/keymaps/default/readme.md create mode 100644 keyboards/model01/keymaps/default/rules.mk create mode 100644 keyboards/model01/leds.c create mode 100644 keyboards/model01/leds.h create mode 100644 keyboards/model01/matrix.c create mode 100644 keyboards/model01/model01.c create mode 100644 keyboards/model01/model01.h create mode 100644 keyboards/model01/readme.md create mode 100644 keyboards/model01/rules.mk create mode 100644 keyboards/model01/wire-protocol-constants.h diff --git a/keyboards/model01/config.h b/keyboards/model01/config.h new file mode 100644 index 0000000000..796653f459 --- /dev/null +++ b/keyboards/model01/config.h @@ -0,0 +1,35 @@ +/* +Copyright 2018 James Laird-Wah + +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 + +#include + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1209 +#define PRODUCT_ID 0x2301 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Keyboardio +#define PRODUCT Model 01 +#define DESCRIPTION (QMK) + +/* key matrix size; rows are doubled for split */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* The scanners already debounce for us */ +#define DEBOUNCING_DELAY 0 diff --git a/keyboards/model01/info.json b/keyboards/model01/info.json new file mode 100644 index 0000000000..daf51492db --- /dev/null +++ b/keyboards/model01/info.json @@ -0,0 +1,4 @@ +{ + "keyboard_name": "model01", + "url": "https://keyboard.io" +} diff --git a/keyboards/model01/keymaps/default/config.h b/keyboards/model01/keymaps/default/config.h new file mode 100644 index 0000000000..8ab9d8b025 --- /dev/null +++ b/keyboards/model01/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 + +/* place overrides here */ diff --git a/keyboards/model01/keymaps/default/keymap.c b/keyboards/model01/keymaps/default/keymap.c new file mode 100644 index 0000000000..cdc050cd90 --- /dev/null +++ b/keyboards/model01/keymaps/default/keymap.c @@ -0,0 +1,93 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 . + */ +#include QMK_KEYBOARD_H + +/* layer constants */ +enum { + DEF = 0, + NUM, + FUN, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[DEF] = LAYOUT( + RESET , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , TG(NUM), + KC_GRV , KC_Q , KC_W , KC_E , KC_R , KC_T , _______, _______, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_EQL , + KC_PGUP, KC_A , KC_S , KC_D , KC_F , KC_G , KC_TAB , KC_ENT , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, + KC_PGDN, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_ESC , _______, KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_MINS, + KC_LCTL, KC_RCTL, + KC_BSPC, KC_SPC , + KC_LGUI, KC_RALT, + KC_LSFT, KC_RSFT, + MO(FUN), MO(FUN) + ), +[NUM] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, KC_P7 , KC_P8 , KC_P9 , KC_PMNS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P4 , KC_P5 , KC_P6 , KC_PPLS, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P1 , KC_P2 , KC_P3 , KC_PEQL, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_P0 , KC_PDOT, KC_PAST, KC_PSLS, KC_PENT, + _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______ + ), +[FUN] = LAYOUT( + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + KC_TAB , _______, KC_MS_U, _______, KC_BTN3, _______, _______, KC_MPRV, KC_MNXT, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_F12 , + KC_HOME, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, _______, _______, KC_MPLY, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______, + KC_END , KC_PSCR, KC_INS , _______, KC_BTN2, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_BSLS, KC_PIPE, + _______, _______, + KC_DEL , KC_ENT , + _______, _______, + _______, _______, + _______, _______ + ) +}; + +/* template for new layouts: +LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______, + _______, _______ + ) +*/ + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case DEF: + set_all_leds_to(0,0,0); + break; + case NUM: + /* highlight the numpad keys when numlock is on */ + for (int i=44; i<=60; i++) { + set_led_to(i, 128,0,0); + } + set_led_to(63, 128, 0, 0); + break; + } + + return state; +} + +/* vim: set ts=2 sw=2 et: */ diff --git a/keyboards/model01/keymaps/default/readme.md b/keyboards/model01/keymaps/default/readme.md new file mode 100644 index 0000000000..740515a268 --- /dev/null +++ b/keyboards/model01/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default keymap for Keyboardio's Model01 + +This implements all of their default keymap, except for mouse warping. diff --git a/keyboards/model01/keymaps/default/rules.mk b/keyboards/model01/keymaps/default/rules.mk new file mode 100644 index 0000000000..4d1abd88ad --- /dev/null +++ b/keyboards/model01/keymaps/default/rules.mk @@ -0,0 +1,2 @@ +# used by default keymap +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) diff --git a/keyboards/model01/leds.c b/keyboards/model01/leds.c new file mode 100644 index 0000000000..b80a749a75 --- /dev/null +++ b/keyboards/model01/leds.c @@ -0,0 +1,57 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 . + */ +#include +#include +#include +#include "model01.h" + +#define I2C_TIMEOUT 1000 + +#define LINCOR(i) pgm_read_byte(&CIE1931_CURVE[i]) + +int set_all_leds_to_raw(uint8_t r, uint8_t g, uint8_t b) { + uint8_t buf[] = { + TWI_CMD_LED_SET_ALL_TO, + b, g, r + }; + int ret = 0; + ret |= i2c_transmit(I2C_ADDR(LEFT), buf, sizeof(buf), I2C_TIMEOUT); + ret |= i2c_transmit(I2C_ADDR(RIGHT), buf, sizeof(buf), I2C_TIMEOUT); + _delay_us(10); + return ret; +} + +int set_all_leds_to(uint8_t r, uint8_t g, uint8_t b) { + return set_all_leds_to_raw(LINCOR(r), LINCOR(g), LINCOR(b)); +} + +int set_led_to_raw(uint8_t led, uint8_t r, uint8_t g, uint8_t b) { + uint8_t buf[] = { + TWI_CMD_LED_SET_ONE_TO, + led & 0x1f, + b, g, r + }; + int hand = (led >= 32) ? RIGHT : LEFT; + int ret = i2c_transmit(I2C_ADDR(hand), buf, sizeof(buf), I2C_TIMEOUT); + _delay_us(10); + return ret; +} + +int set_led_to(uint8_t led, uint8_t r, uint8_t g, uint8_t b) { + return set_led_to_raw(led, LINCOR(r), LINCOR(g), LINCOR(b)); +} + +/* vim: set ts=2 sw=2 et: */ diff --git a/keyboards/model01/leds.h b/keyboards/model01/leds.h new file mode 100644 index 0000000000..0aac781dd5 --- /dev/null +++ b/keyboards/model01/leds.h @@ -0,0 +1,25 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 + +#include + +int set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); +int set_led_to(uint8_t led, uint8_t r, uint8_t g, uint8_t b); + +/* Raw (gamma uncorrected) LED values */ +int set_all_leds_to_raw(uint8_t r, uint8_t g, uint8_t b); +int set_led_to_raw(uint8_t led, uint8_t r, uint8_t g, uint8_t b); diff --git a/keyboards/model01/matrix.c b/keyboards/model01/matrix.c new file mode 100644 index 0000000000..f1f9024c7c --- /dev/null +++ b/keyboards/model01/matrix.c @@ -0,0 +1,94 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 . + */ +#include +#include +#include +#include "model01.h" + +/* If no key events have occurred, the scanners will time out on reads. + * So we don't want to be too permissive here. */ +#define I2C_TIMEOUT 10 + +static matrix_row_t rows[MATRIX_ROWS]; +#define ROWS_PER_HAND (MATRIX_ROWS / 2) + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +static int i2c_read_hand(int hand) { + uint8_t buf[5]; + i2c_status_t ret = i2c_receive(I2C_ADDR(hand), buf, sizeof(buf), I2C_TIMEOUT); + if (ret != I2C_STATUS_SUCCESS) + return 1; + + if (buf[0] != TWI_REPLY_KEYDATA) + return 2; + + int start_row = hand ? ROWS_PER_HAND : 0; + uint8_t *out = &rows[start_row]; + memcpy(out, &buf[1], 4); + return 0; +} + +static int i2c_set_keyscan_interval(int hand, int delay) { + uint8_t buf[] = {TWI_CMD_KEYSCAN_INTERVAL, delay}; + i2c_status_t ret = i2c_transmit(I2C_ADDR(hand), buf, sizeof(buf), I2C_TIMEOUT); + return ret; +} + +void matrix_init(void) { + /* Ensure scanner power is on - else right hand will not work */ + DDRC |= _BV(7); + PORTC |= _BV(7); + + i2c_init(); + i2c_set_keyscan_interval(LEFT, 2); + i2c_set_keyscan_interval(RIGHT, 2); + memset(rows, 0, sizeof(rows)); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + uint8_t ret = 0; + ret |= i2c_read_hand(LEFT); + ret |= i2c_read_hand(RIGHT); + matrix_scan_quantum(); + return ret; +} + +inline +matrix_row_t matrix_get_row(uint8_t row) { + return rows[row]; +} + +void matrix_print(void) { + print("\nr/c 0123456789ABCDEF\n"); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + pbin_reverse16(matrix_get_row(row)); + print("\n"); + } +} + +/* vim: set ts=2 sw=2 et: */ diff --git a/keyboards/model01/model01.c b/keyboards/model01/model01.c new file mode 100644 index 0000000000..29615ca866 --- /dev/null +++ b/keyboards/model01/model01.c @@ -0,0 +1,38 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 . + */ +#include +#include +#include +#include "model01.h" + +void matrix_init_kb(void) { + /* the bootloader can leave LEDs on, so */ + set_all_leds_to(0, 0, 0); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + diff --git a/keyboards/model01/model01.h b/keyboards/model01/model01.h new file mode 100644 index 0000000000..a83e33cd86 --- /dev/null +++ b/keyboards/model01/model01.h @@ -0,0 +1,50 @@ +/* Copyright 2018 James Laird-Wah + * + * 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 + +#include + +#define LAYOUT( \ + L07, L06, L05, L04, L03, L02, R05, R04, R03, R02, R01, R00, \ + L17, L16, L15, L14, L13, L12, L01, R06, R15, R14, R13, R12, R11, R10, \ + L27, L26, L25, L24, L23, L22, L11, R16, R25, R24, R23, R22, R21, R20, \ + L37, L36, L35, L34, L33, L32, L21, R26, R35, R34, R33, R32, R31, R30, \ + L00, R07, \ + L10, R17, \ + L20, R27, \ + L30, R37, \ + L31, R36 \ + ) { \ + {L00, L01, L02, L03, L04, L05, L06, L07}, \ + {L10, L11, L12, L13, L14, L15, L16, L17}, \ + {L20, L21, L22, L23, L24, L25, L26, L27}, \ + {L30, L31, L32, L33, L34, L35, L36, L37}, \ + {R00, R01, R02, R03, R04, R05, R06, R07}, \ + {R10, R11, R12, R13, R14, R15, R16, R17}, \ + {R20, R21, R22, R23, R24, R25, R26, R27}, \ + {R30, R31, R32, R33, R34, R35, R36, R37} \ + } + +#include "wire-protocol-constants.h" +#define I2C_ADDR_LEFT (0x58 << 1) +#define I2C_ADDR_RIGHT (I2C_ADDR_LEFT + 6) +#define I2C_ADDR(hand) ((hand) ? I2C_ADDR_RIGHT : I2C_ADDR_LEFT) +#define LEFT 0 +#define RIGHT 1 + +#include "leds.h" + +/* vim: set ts=2 sw=2 et: */ diff --git a/keyboards/model01/readme.md b/keyboards/model01/readme.md new file mode 100644 index 0000000000..34bd291e2e --- /dev/null +++ b/keyboards/model01/readme.md @@ -0,0 +1,37 @@ +# Keyboardio Model 01 + +A split keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: Keyboardio Model 01 +Hardware Availability: [Keyboardio](https://shop.keyboard.io) + +Make example for this keyboard (after setting up your build environment): + + make model01: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). + +## Programming the Keyboard + +To program the keyboard, if you have avrdude installed: + + make model01:default:avrdude + +When prompted to reset your keyboard, press the prog key at upper left. If the +keyboard does not reset, you can hold the prog key while plugging it into your +computer. The prog key will light up red in programming mode. + +## Features + +This implements the standard keymap, including mousekeys. + +It doesn't do cursor warping - QMK does not support absolute mouse positioning. + +LED support is limited. Gamma compensation and the high speed batch update +functions supported by the hardware are not implemented. The high current power +switch is also not implemented, so if you try and turn all the LEDs on at full +brightness, something may conk out. + +Hotplugging the two halves works but is not extensively tested. diff --git a/keyboards/model01/rules.mk b/keyboards/model01/rules.mk new file mode 100644 index 0000000000..cab7065ff8 --- /dev/null +++ b/keyboards/model01/rules.mk @@ -0,0 +1,62 @@ +SRC += i2c_master.c \ + leds.c \ + matrix.c + +# MCU name +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 = caterina + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = no # Unicode + +CUSTOM_MATRIX = yes +CIE1931_CURVE = yes diff --git a/keyboards/model01/wire-protocol-constants.h b/keyboards/model01/wire-protocol-constants.h new file mode 100644 index 0000000000..90a528582a --- /dev/null +++ b/keyboards/model01/wire-protocol-constants.h @@ -0,0 +1,53 @@ +/* + * This file is taken from the KeyboardioScanner module: + * https://github.com/keyboardio/KeyboardioScanner/blob/master/wire-protocol-constants.h + * + * Copyright (C) 2015-2018 Keyboard.io, Inc + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ +#pragma once + +#define TWI_CMD_NONE 0x00 +#define TWI_CMD_VERSION 0x01 +#define TWI_CMD_KEYSCAN_INTERVAL 0x02 +#define TWI_CMD_LED_SET_ALL_TO 0x03 +#define TWI_CMD_LED_SET_ONE_TO 0x04 +#define TWI_CMD_COLS_USE_PULLUPS 0x05 +#define TWI_CMD_LED_SPI_FREQUENCY 0x06 + +#define LED_SPI_FREQUENCY_4MHZ 0x07 +#define LED_SPI_FREQUENCY_2MHZ 0x06 +#define LED_SPI_FREQUENCY_1MHZ 0x05 +#define LED_SPI_FREQUENCY_512KHZ 0x04 +#define LED_SPI_FREQUENCY_256KHZ 0x03 +#define LED_SPI_FREQUENCY_128KHZ 0x02 +#define LED_SPI_FREQUENCY_64KHZ 0x01 +#define LED_SPI_OFF 0x00 + + +// 512KHZ seems to be the sweet spot in early testing +// so make it the default +#define LED_SPI_FREQUENCY_DEFAULT LED_SPI_FREQUENCY_512KHZ + + +#define TWI_CMD_LED_BASE 0x80 + +#define TWI_REPLY_NONE 0x00 +#define TWI_REPLY_KEYDATA 0x01 -- cgit v1.2.3 From 23da333ae3527228f101ed8cf08e3cd6a5796901 Mon Sep 17 00:00:00 2001 From: nachie Date: Mon, 17 Sep 2018 16:00:40 -0700 Subject: Keyboard: Added support for GSKT-00 (#3911) * Added QMK support for GSKT-00, PaladinSplit, PaladinTKL and PaladinPad pcbs * Remove the paladin boards from this PR * Changed gskt00 as per review comments. Added two new default layouts, 60_ansi_tsangan and 60_iso_tsangan * Fix the layouts/default/60_iso_tsangan/layout.json file * Removed ? from rules.mk, removed unused fn_actions from keymaps. Changed the 60_iso_tsangan to work correctly * Removed PREVENT_STUCK_MODIFIERS --- keyboards/gskt00/config.h | 39 ++++++++++ keyboards/gskt00/gskt00.c | 2 + keyboards/gskt00/gskt00.h | 57 +++++++++++++++ keyboards/gskt00/info.json | 16 +++++ keyboards/gskt00/keymaps/default/keymap.c | 82 ++++++++++++++++++++++ keyboards/gskt00/keymaps/nachie/keymap.c | 82 ++++++++++++++++++++++ keyboards/gskt00/readme.md | 17 +++++ keyboards/gskt00/rules.mk | 55 +++++++++++++++ .../default_60_ansi_tsangan/keymap.c | 11 +++ layouts/default/60_ansi_tsangan/layout.json | 5 ++ layouts/default/60_ansi_tsangan/readme.md | 3 + .../60_iso_tsangan/default_60_iso_tsangan/keymap.c | 11 +++ layouts/default/60_iso_tsangan/layout.json | 5 ++ layouts/default/60_iso_tsangan/readme.md | 3 + 14 files changed, 388 insertions(+) create mode 100755 keyboards/gskt00/config.h create mode 100755 keyboards/gskt00/gskt00.c create mode 100755 keyboards/gskt00/gskt00.h create mode 100644 keyboards/gskt00/info.json create mode 100755 keyboards/gskt00/keymaps/default/keymap.c create mode 100755 keyboards/gskt00/keymaps/nachie/keymap.c create mode 100644 keyboards/gskt00/readme.md create mode 100755 keyboards/gskt00/rules.mk create mode 100644 layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c create mode 100644 layouts/default/60_ansi_tsangan/layout.json create mode 100644 layouts/default/60_ansi_tsangan/readme.md create mode 100644 layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c create mode 100644 layouts/default/60_iso_tsangan/layout.json create mode 100644 layouts/default/60_iso_tsangan/readme.md diff --git a/keyboards/gskt00/config.h b/keyboards/gskt00/config.h new file mode 100755 index 0000000000..f36493f288 --- /dev/null +++ b/keyboards/gskt00/config.h @@ -0,0 +1,39 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6061 +#define DEVICE_VER 0x0001 +#define MANUFACTURER inachie +#define PRODUCT GSKT00 +#define DESCRIPTION GSKT00 Gasket 60 keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F1, D1, D2, D4, D6, F7, B0, F4 } +#define MATRIX_COL_PINS { F6, D7, F5, C7, B4, C6, B6, B5 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + diff --git a/keyboards/gskt00/gskt00.c b/keyboards/gskt00/gskt00.c new file mode 100755 index 0000000000..89a0040ff3 --- /dev/null +++ b/keyboards/gskt00/gskt00.c @@ -0,0 +1,2 @@ +#include "gskt00.h" + diff --git a/keyboards/gskt00/gskt00.h b/keyboards/gskt00/gskt00.h new file mode 100755 index 0000000000..90e9a1ad5a --- /dev/null +++ b/keyboards/gskt00/gskt00.h @@ -0,0 +1,57 @@ +#ifndef GSKT00_H +#define GSKT00_H + +#include "quantum.h" + +#define LAYOUT_all( \ + K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K26, K27, \ + K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ + K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ + K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, K22, \ + K30, K40, K50, K60, K00, K10, K20 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 } \ +} + +#define LAYOUT_60_iso_tsangan( \ + K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \ + K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, \ + K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K24, K23, /* enter */ \ + K31, K41, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ + K30, K40, K50, K60, K00, K10, K20 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { KC_NO, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 } \ +} + +#define LAYOUT_60_ansi_tsangan( \ + K36, K37, K46, K47, K56, K57, K66, K67, K76, K77, K06, K07, K17, K27, \ + K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ + K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ + K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ + K30, K40, K50, K60, K00, K10, K20 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 } \ +} + +#endif diff --git a/keyboards/gskt00/info.json b/keyboards/gskt00/info.json new file mode 100644 index 0000000000..88191240b9 --- /dev/null +++ b/keyboards/gskt00/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "gskt00", + "url": "", + "maintainer": "nachie", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_tsangan": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + + "LAYOUT_60_iso_tsangan": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + } + } + } diff --git a/keyboards/gskt00/keymaps/default/keymap.c b/keyboards/gskt00/keymaps/default/keymap.c new file mode 100755 index 0000000000..792ba2f412 --- /dev/null +++ b/keyboards/gskt00/keymaps/default/keymap.c @@ -0,0 +1,82 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSPC, + 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_LCTL, 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_LSFT, MO(3), + KC_LGUI, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(3)), + + /* DVORAK */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSLS, + 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_BSPC, + MO(3), 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_LSFT, KC_NUBS, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, MO(3), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + /* COLEMAK */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, + MO(3), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(3), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + /* FUNCTION */ + LAYOUT_all( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLCK, KC_PAUS, KC_UP, KC_PAUS, KC_DEL, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, KC_TRNS, RGB_TOG) + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + diff --git a/keyboards/gskt00/keymaps/nachie/keymap.c b/keyboards/gskt00/keymaps/nachie/keymap.c new file mode 100755 index 0000000000..8606d24841 --- /dev/null +++ b/keyboards/gskt00/keymaps/nachie/keymap.c @@ -0,0 +1,82 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSLS, + 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_BSPC, + MO(3), 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_LSFT, MO(3), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_LCTL), + + /* DVORAK */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSLS, + 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_BSPC, + MO(3), 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_LSFT, KC_NUBS, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_LSFT, MO(3), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + /* COLEMAK */ + LAYOUT_all( + KC_ESC, 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_GRV, KC_BSLS, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, + MO(3), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(3), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL), + + /* FUNCTION */ + LAYOUT_all( + KC_GRV, 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_PAUS, KC_BSPC, + KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_MOD, KC_TRNS, RGB_TOG) + +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + diff --git a/keyboards/gskt00/readme.md b/keyboards/gskt00/readme.md new file mode 100644 index 0000000000..ad03ac819f --- /dev/null +++ b/keyboards/gskt00/readme.md @@ -0,0 +1,17 @@ +# GSKT-00 PCB + +Firmware for the GSKT-00 PCB + +Keyboard Maintainer: [/u/iNachie](https://github.com/nachie) +Hardware Supported: GSKT-00 PCB +Hardware Availability: [/u/iNachie](https://www.reddit.com/user/inachie/) + +Make example for this keyboard (after setting up your build environment): + + make gskt00:default + +Or to make and flash: + + make gskt00:default:dfu + +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/gskt00/rules.mk b/keyboards/gskt00/rules.mk new file mode 100755 index 0000000000..338384e3e8 --- /dev/null +++ b/keyboards/gskt00/rules.mk @@ -0,0 +1,55 @@ +# MCU name +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 = atmel-dfu + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # 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 = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + +LAYOUTS = 60_ansi_tsangan 60_iso_tsangan diff --git a/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c new file mode 100644 index 0000000000..8f7f5f8c6f --- /dev/null +++ b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi( + 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT , + KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , KC_RCTL + ) +}; diff --git a/layouts/default/60_ansi_tsangan/layout.json b/layouts/default/60_ansi_tsangan/layout.json new file mode 100644 index 0000000000..f6a65beb34 --- /dev/null +++ b/layouts/default/60_ansi_tsangan/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:2.75},""], +[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_ansi_tsangan/readme.md b/layouts/default/60_ansi_tsangan/readme.md new file mode 100644 index 0000000000..76b4514034 --- /dev/null +++ b/layouts/default/60_ansi_tsangan/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_tsangan + + LAYOUT_60_ansi_tsangan diff --git a/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c new file mode 100644 index 0000000000..204a12d33d --- /dev/null +++ b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_iso( + KC_ESC, 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_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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTRL, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_RCTL + ) +}; diff --git a/layouts/default/60_iso_tsangan/layout.json b/layouts/default/60_iso_tsangan/layout.json new file mode 100644 index 0000000000..e231859353 --- /dev/null +++ b/layouts/default/60_iso_tsangan/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","",{w:2},""], +[{w:1.5},"","","","","","","","","","","","","",{x:0.25,w:1.25,h:2,w2:1.5,h2:1,x2:-0.25},""], +[{w:1.75},"","","","","","","","","","","","",""], +[{w:1.25},"","","","","","","","","","","","",{w:2.75},""], +[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_iso_tsangan/readme.md b/layouts/default/60_iso_tsangan/readme.md new file mode 100644 index 0000000000..edb7f9242d --- /dev/null +++ b/layouts/default/60_iso_tsangan/readme.md @@ -0,0 +1,3 @@ +# 60_iso_tsangan + + LAYOUT_60_iso_tsangan -- cgit v1.2.3 From 92f67719cc7faf6f2708d848ae3d1c6ee2b781cb Mon Sep 17 00:00:00 2001 From: skullydazed Date: Wed, 19 Sep 2018 11:41:40 -0700 Subject: Keyboard: Fix the LAYOUT_iso macro for tada68 (#3943) --- keyboards/tada68/keymaps/iso-uk/keymap.c | 8 ++++---- keyboards/tada68/tada68.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/tada68/keymaps/iso-uk/keymap.c b/keyboards/tada68/keymaps/iso-uk/keymap.c index d59f610f7c..c843595dc3 100644 --- a/keyboards/tada68/keymaps/iso-uk/keymap.c +++ b/keyboards/tada68/keymaps/iso-uk/keymap.c @@ -21,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_BL] = LAYOUT_iso( KC_ESC, 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_GRV, \ - 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_NUHS, KC_DEL, \ - 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_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_DEL, \ + 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_NUHS, KC_ENT, KC_PGUP, \ 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_PGDN, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), @@ -42,8 +42,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FL] = LAYOUT_iso( _______, 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_DEL, KC_INS, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, \ _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, KC_BTN1, KC_MS_U, KC_BTN2, \ _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), diff --git a/keyboards/tada68/tada68.h b/keyboards/tada68/tada68.h index 608f52e44f..670b0e6c15 100755 --- a/keyboards/tada68/tada68.h +++ b/keyboards/tada68/tada68.h @@ -55,8 +55,8 @@ #define LAYOUT_iso( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k2c, k1e, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, k2e, \ k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ k40, k41, k42, k45, k49, k4a, k4b, k4c, k4d, k4e \ ) \ @@ -102,4 +102,4 @@ void matrix_init_user(void); void matrix_scan_user(void); -#endif \ No newline at end of file +#endif -- cgit v1.2.3 From 71fe973190610bf155d864c71b8b326bc1b74eab Mon Sep 17 00:00:00 2001 From: Simon Dagfinrud Date: Wed, 19 Sep 2018 20:42:58 +0200 Subject: Keyboard: Add ISO-NOR keymap for TADA68 (#3944) --- keyboards/tada68/keymaps/iso-nor/config.h | 1 + keyboards/tada68/keymaps/iso-nor/keymap.c | 51 ++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/iso-nor/readme.md | 17 ++++++++++ keyboards/tada68/keymaps/iso-nor/rules.mk | 21 ++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 keyboards/tada68/keymaps/iso-nor/config.h create mode 100644 keyboards/tada68/keymaps/iso-nor/keymap.c create mode 100644 keyboards/tada68/keymaps/iso-nor/readme.md create mode 100644 keyboards/tada68/keymaps/iso-nor/rules.mk diff --git a/keyboards/tada68/keymaps/iso-nor/config.h b/keyboards/tada68/keymaps/iso-nor/config.h new file mode 100644 index 0000000000..6f70f09bee --- /dev/null +++ b/keyboards/tada68/keymaps/iso-nor/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/tada68/keymaps/iso-nor/keymap.c b/keyboards/tada68/keymaps/iso-nor/keymap.c new file mode 100644 index 0000000000..2e6a80750f --- /dev/null +++ b/keyboards/tada68/keymaps/iso-nor/keymap.c @@ -0,0 +1,51 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| +| '|Backspa | ´| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| Å| ¨| Ent-|Del | + * |-------------------------------------------------------| er|----| + * |CAPS | A| S| D| F| G| H| J| K| L| Ø| Æ| @ | |PgUp| + * |----------------------------------------------------------------| + * |Shif| <>| Z| X| C| V| B| N| M| ,| .| -| Shift| Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Alt |Cmd | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_iso( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_GRV, KC_BSPC, KC_EQL, \ + 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_NUHS, KC_DEL, \ + 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_PGUP, \ + 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap _FL1: Function Layer + * ,----------------------------------------------------------------. + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| RESET|PSCR| + * |----------------------------------------------------------------| + * | | | Up| | | | | | | | |BL-|BL+|BL | INS| + * |----------------------------------------------------------------| + * | |Lef|Dow|Rig| | | | | | PP|PLA| PN| | |HOME| + * |----------------------------------------------------------------| + * | | | | | | | | | | V-| MV| V+| | | END| + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL] = LAYOUT_iso( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, KC_PSCR, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, BL_TOGG, KC_INS, \ + _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/tada68/keymaps/iso-nor/readme.md b/keyboards/tada68/keymaps/iso-nor/readme.md new file mode 100644 index 0000000000..5ade71ab4d --- /dev/null +++ b/keyboards/tada68/keymaps/iso-nor/readme.md @@ -0,0 +1,17 @@ +# TADA68 layout for ISO-NOR + +> An ISO-style layout for Norwegian keyboards. + +This layout was specifically made for Norwegian keyboards (i.e. includes `Æ`, `Ø` and `Å`), and is tested on a TADA68 purchased from [kbdfans](https://kbdfans.cn/) in September 2018. + +### Specifics + +As it's an ISO style keymap, it works with the fat double-row `Enter` key and the narrower left `Shift` and `<>` key. In addition, it switches the `'` key and the `´` key since the latter one is less common in Norwegian, and the first one normally is placed where the `Escape` key is located on a TADA68. + +## Installation + +Please see the [tada68 readme](../../readme.md) using the following command + +``` +make tada68:iso-nor:bin +``` diff --git a/keyboards/tada68/keymaps/iso-nor/rules.mk b/keyboards/tada68/keymaps/iso-nor/rules.mk new file mode 100644 index 0000000000..4deca710b8 --- /dev/null +++ b/keyboards/tada68/keymaps/iso-nor/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file -- cgit v1.2.3 From c23233f41ab9221577fc83bbae0a230452a38231 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Wed, 19 Sep 2018 16:13:58 -0700 Subject: Keymap: Talljoe's keymap for oddball keyboards (#3910) * Create layout for JD45 * Tweak layout to better support JD45 and add more tap dancing. * Add Maltron and tweak layout for 40% enter compatibility. * Switch back to `BL_TOGGLE` for backlight. * More tweaks * Rename talljoe_gherkin to talljoe-gherkin * Make NAV layer tab C_S_T also. * Add missing RESET key. * Add Talljoe layout for minivan. * MTI is not for me * Tweak keymap. * Add talljoe keymap to Atreus. * Minor tweaks. * Fix talljoe keymaps to work with new Zeal60 commit. --- keyboards/atreus/keymaps/talljoe-atreus/config.h | 42 ++++++ keyboards/atreus/keymaps/talljoe-atreus/keymap.c | 1 + keyboards/atreus/keymaps/talljoe-atreus/rules.mk | 1 + keyboards/gherkin/keymaps/talljoe-gherkin/config.h | 6 + keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c | 58 ++++++++ keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk | 6 + keyboards/gherkin/keymaps/talljoe_gherkin/config.h | 6 - keyboards/gherkin/keymaps/talljoe_gherkin/keymap.c | 58 -------- keyboards/gherkin/keymaps/talljoe_gherkin/rules.mk | 6 - keyboards/jd45/keymaps/talljoe/config.h | 22 +++ keyboards/jd45/keymaps/talljoe/keymap.c | 1 + keyboards/tv44/keymaps/talljoe-minivan/config.h | 53 ++++++++ keyboards/tv44/keymaps/talljoe-minivan/keymap.c | 1 + keyboards/tv44/keymaps/talljoe-minivan/rules.mk | 3 + keyboards/zeal60/rules.mk | 3 +- .../60_ansi_split_bs_rshift/talljoe/keymap.c | 25 ++-- .../60_ansi_split_bs_rshift/talljoe/rules.mk | 1 + .../60_ansi_split_bs_rshift/talljoe/solarized.c | 23 ++++ .../60_ansi_split_bs_rshift/talljoe/solarized.h | 27 ++++ users/talljoe/config.h | 2 +- users/talljoe/talljoe.c | 53 ++++---- users/talljoe/talljoe.h | 76 +++++++++-- users/talljoe/tapdance.c | 148 ++++++++++++++++++--- 23 files changed, 487 insertions(+), 135 deletions(-) create mode 100644 keyboards/atreus/keymaps/talljoe-atreus/config.h create mode 100644 keyboards/atreus/keymaps/talljoe-atreus/keymap.c create mode 100644 keyboards/atreus/keymaps/talljoe-atreus/rules.mk create mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/config.h create mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c create mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk delete mode 100644 keyboards/gherkin/keymaps/talljoe_gherkin/config.h delete mode 100644 keyboards/gherkin/keymaps/talljoe_gherkin/keymap.c delete mode 100644 keyboards/gherkin/keymaps/talljoe_gherkin/rules.mk create mode 100644 keyboards/jd45/keymaps/talljoe/config.h create mode 100644 keyboards/jd45/keymaps/talljoe/keymap.c create mode 100644 keyboards/tv44/keymaps/talljoe-minivan/config.h create mode 100644 keyboards/tv44/keymaps/talljoe-minivan/keymap.c create mode 100644 keyboards/tv44/keymaps/talljoe-minivan/rules.mk create mode 100644 layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk create mode 100644 layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c create mode 100644 layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h diff --git a/keyboards/atreus/keymaps/talljoe-atreus/config.h b/keyboards/atreus/keymaps/talljoe-atreus/config.h new file mode 100644 index 0000000000..87b68ffc65 --- /dev/null +++ b/keyboards/atreus/keymaps/talljoe-atreus/config.h @@ -0,0 +1,42 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define PREVENT_STUCK_MODIFIERS +#define SPACE_COUNT 2 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT( \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K10, K41, K42, K30, K44, K1D, K20, K45, K3C, K0D, K2B, K3D \ +) + +#define TEMPLATE_NUM( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT( \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K10, K41, K42, K30, K44, K1D, K20, K45, K48, K49, K2B, K3D \ +) + + +#define TEMPLATE_RESET LAYOUT( \ + RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ +) +#endif diff --git a/keyboards/atreus/keymaps/talljoe-atreus/keymap.c b/keyboards/atreus/keymaps/talljoe-atreus/keymap.c new file mode 100644 index 0000000000..7812add812 --- /dev/null +++ b/keyboards/atreus/keymaps/talljoe-atreus/keymap.c @@ -0,0 +1 @@ +// This space intentionally left blank diff --git a/keyboards/atreus/keymaps/talljoe-atreus/rules.mk b/keyboards/atreus/keymaps/talljoe-atreus/rules.mk new file mode 100644 index 0000000000..92007fe8ad --- /dev/null +++ b/keyboards/atreus/keymaps/talljoe-atreus/rules.mk @@ -0,0 +1 @@ +USER_NAME := talljoe diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/gherkin/keymaps/talljoe-gherkin/config.h new file mode 100644 index 0000000000..7fa3bf328e --- /dev/null +++ b/keyboards/gherkin/keymaps/talljoe-gherkin/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c new file mode 100644 index 0000000000..ea2921924e --- /dev/null +++ b/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c @@ -0,0 +1,58 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +#define ST_BOLT QK_STENO_BOLT +#define ST_GEM QK_STENO_GEMINI + +#define XXXXXXX KC_NO + +enum keyboard_layers { + _QWERTY, + _RAISE, + _LOWER, + _PLOVER, + _ADJUST +}; + +#define ADJ_Z LT(_ADJUST, KC_Z) +#define RS_BSPC LT(_RAISE, KC_BSPC) +#define LW_SPC LT(_LOWER, KC_SPC) +#define MO_ADJ MO(_ADJUST) +#define TG_PLV TG(_PLOVER) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_LGUI OSM(MOD_LGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, + ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [_RAISE] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, + KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, + OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH + ), + + [_LOWER] = LAYOUT_ortho_3x10( + KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, + KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, + KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS + ), + + [_PLOVER] = LAYOUT_ortho_3x10( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX + ), + + [_ADJUST] = LAYOUT_ortho_3x10( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET + ), + +}; diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk new file mode 100644 index 0000000000..02216ecb36 --- /dev/null +++ b/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk @@ -0,0 +1,6 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/gherkin/keymaps/talljoe_gherkin/config.h b/keyboards/gherkin/keymaps/talljoe_gherkin/config.h deleted file mode 100644 index 7fa3bf328e..0000000000 --- a/keyboards/gherkin/keymaps/talljoe_gherkin/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#endif diff --git a/keyboards/gherkin/keymaps/talljoe_gherkin/keymap.c b/keyboards/gherkin/keymaps/talljoe_gherkin/keymap.c deleted file mode 100644 index ea2921924e..0000000000 --- a/keyboards/gherkin/keymaps/talljoe_gherkin/keymap.c +++ /dev/null @@ -1,58 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -#define ST_BOLT QK_STENO_BOLT -#define ST_GEM QK_STENO_GEMINI - -#define XXXXXXX KC_NO - -enum keyboard_layers { - _QWERTY, - _RAISE, - _LOWER, - _PLOVER, - _ADJUST -}; - -#define ADJ_Z LT(_ADJUST, KC_Z) -#define RS_BSPC LT(_RAISE, KC_BSPC) -#define LW_SPC LT(_LOWER, KC_SPC) -#define MO_ADJ MO(_ADJUST) -#define TG_PLV TG(_PLOVER) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_LGUI OSM(MOD_LGUI) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, - ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [_RAISE] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, - KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, - OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH - ), - - [_LOWER] = LAYOUT_ortho_3x10( - KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, - KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, - KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS - ), - - [_PLOVER] = LAYOUT_ortho_3x10( - STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX - ), - - [_ADJUST] = LAYOUT_ortho_3x10( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET - ), - -}; diff --git a/keyboards/gherkin/keymaps/talljoe_gherkin/rules.mk b/keyboards/gherkin/keymaps/talljoe_gherkin/rules.mk deleted file mode 100644 index 02216ecb36..0000000000 --- a/keyboards/gherkin/keymaps/talljoe_gherkin/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/jd45/keymaps/talljoe/config.h b/keyboards/jd45/keymaps/talljoe/config.h new file mode 100644 index 0000000000..f8b0333cfb --- /dev/null +++ b/keyboards/jd45/keymaps/talljoe/config.h @@ -0,0 +1,22 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define PREVENT_STUCK_MODIFIERS +#define SPACE_COUNT 2 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) { \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K0D, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, KC_NO }, \ + { K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO }, \ + { K40, K00, K41, K42, K44, KC_NO, K45, KC_NO, K48, K49, K3D, K4C, KC_NO } \ +} + +#endif diff --git a/keyboards/jd45/keymaps/talljoe/keymap.c b/keyboards/jd45/keymaps/talljoe/keymap.c new file mode 100644 index 0000000000..7812add812 --- /dev/null +++ b/keyboards/jd45/keymaps/talljoe/keymap.c @@ -0,0 +1 @@ +// This space intentionally left blank diff --git a/keyboards/tv44/keymaps/talljoe-minivan/config.h b/keyboards/tv44/keymaps/talljoe-minivan/config.h new file mode 100644 index 0000000000..fa1f43adce --- /dev/null +++ b/keyboards/tv44/keymaps/talljoe-minivan/config.h @@ -0,0 +1,53 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define SPACE_COUNT 2 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) KEYMAP_ARROW( \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K0D, \ + K41, K49, K42, K44, K45, K3C, K0B, K00, K3D \ +) + +#define TEMPLATE_ALT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) KEYMAP_ARROW( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K41, K49, K42, K44, K45, K48, K49, K4B, K4C \ +) + +#define TEMPLATE_ADJUST( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) KEYMAP_ARROW( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K2D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K49, K42, K44, K45, K48, K0B, K0C, K4C \ +) + +#define TEMPLATE_RESET KEYMAP_ARROW( \ + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, \ + 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, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET) + +#endif diff --git a/keyboards/tv44/keymaps/talljoe-minivan/keymap.c b/keyboards/tv44/keymaps/talljoe-minivan/keymap.c new file mode 100644 index 0000000000..7812add812 --- /dev/null +++ b/keyboards/tv44/keymaps/talljoe-minivan/keymap.c @@ -0,0 +1 @@ +// This space intentionally left blank diff --git a/keyboards/tv44/keymaps/talljoe-minivan/rules.mk b/keyboards/tv44/keymaps/talljoe-minivan/rules.mk new file mode 100644 index 0000000000..a4e40d0ba6 --- /dev/null +++ b/keyboards/tv44/keymaps/talljoe-minivan/rules.mk @@ -0,0 +1,3 @@ +USER_NAME := talljoe + +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/zeal60/rules.mk b/keyboards/zeal60/rules.mk index c4686f9852..f099ea9fdd 100644 --- a/keyboards/zeal60/rules.mk +++ b/keyboards/zeal60/rules.mk @@ -53,7 +53,7 @@ BOOTLOADER = atmel-dfu OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -76,3 +76,4 @@ RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes +LAYOUTS = 60_ansi 60_iso 60_hhkb 60_ansi_split_bs_rshift diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c index b5dc544927..cfad9da8a3 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c @@ -1,7 +1,7 @@ #ifdef KEYBOARD_zeal60 #include "config.h" #include "zeal60.h" -#include "zeal_backlight.h" +#include "rgb_backlight.h" #include "action_layer.h" #include "solarized.h" #include "talljoe.h" @@ -9,7 +9,7 @@ // from zeal_backlight.c // we want to be able to set indicators for the spacebar stabs // but they are not represented by a row/index. -extern zeal_backlight_config g_config; +extern backlight_config g_config; void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); void set_backlight_defaults(void) { @@ -17,7 +17,7 @@ void set_backlight_defaults(void) { uint8_t caps_lock; map_row_column_to_led(3, 12, &caps_lock); map_row_column_to_led(4, 7, &space); - zeal_backlight_config default_values = { + backlight_config default_values = { .use_split_backspace = USE_SPLIT_BACKSPACE, .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, @@ -34,15 +34,17 @@ void set_backlight_defaults(void) { .layer_2_indicator = { .index = space, .color = solarized.yellow }, .layer_3_indicator = { .index = 254, .color = solarized.red }, .alphas_mods = { - BACKLIGHT_ALPHAS_MODS_ROW_0, - BACKLIGHT_ALPHAS_MODS_ROW_1, - BACKLIGHT_ALPHAS_MODS_ROW_2, - BACKLIGHT_ALPHAS_MODS_ROW_3, - BACKLIGHT_ALPHAS_MODS_ROW_4 } + RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, + RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } }; - memcpy(&g_config, &default_values, sizeof(zeal_backlight_config)); + memcpy(&g_config, &default_values, sizeof(backlight_config)); backlight_config_save(); +#undef CUSTOM_RGB_LAYOUTS +#ifdef CUSTOM_RGB_LAYOUTS solarized_t* S = &solarized; HSV alphas = S->base2; HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( @@ -54,9 +56,12 @@ void set_backlight_defaults(void) { ); for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { for (uint8_t col = 0; col < MATRIX_COLS; ++col) { - backlight_set_key_color(row, col, custom_color_map[row][col]); + uint8_t index; + map_row_column_to_led( row, col, &index ); + set_key_color(index, custom_color_map[row][col]); } } +#endif // CUSTOM_RGB_LAYOUTS } bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk b/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk new file mode 100644 index 0000000000..239f03091a --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/rules.mk @@ -0,0 +1 @@ +SRC += $(KEYMAP_PATH)/solarized.c diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c new file mode 100644 index 0000000000..3e9e726b95 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.c @@ -0,0 +1,23 @@ +#include "solarized.h" + +#define MAKE_COLOR(_H, _S, _V) \ + { .h = (((uint32_t)_H) * 255) / 360, .s = (((uint16_t)_S) * 255) / 100, .v = (((uint16_t)_V) * 255) / 100 } + +solarized_t solarized = { + .base03 = MAKE_COLOR(193, 100, 21), + .base02 = MAKE_COLOR(192, 90, 26), + .base01 = MAKE_COLOR(194, 25, 46), + .base00 = MAKE_COLOR(195, 23, 51), + .base0 = MAKE_COLOR(186, 13, 59), + .base1 = MAKE_COLOR(180, 9, 63), + .base2 = MAKE_COLOR( 44, 11, 93), + .base3 = MAKE_COLOR( 44, 10, 99), + .yellow = MAKE_COLOR( 45, 100, 71), + .orange = MAKE_COLOR( 18, 89, 80), + .red = MAKE_COLOR( 1, 79, 86), + .magenta = MAKE_COLOR(331, 74, 83), + .violet = MAKE_COLOR(237, 45, 77), + .blue = MAKE_COLOR(205, 82, 82), + .cyan = MAKE_COLOR(175, 74, 63), + .green = MAKE_COLOR( 68, 100, 60), +}; diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h new file mode 100644 index 0000000000..3b00caea70 --- /dev/null +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/solarized.h @@ -0,0 +1,27 @@ +#ifndef SOLARIZED_H +#define SOLARIZED_H + +#include "quantum/color.h" + +typedef struct { + HSV base03; + HSV base02; + HSV base01; + HSV base00; + HSV base0; + HSV base1; + HSV base2; + HSV base3; + HSV yellow; + HSV orange; + HSV red; + HSV magenta; + HSV violet; + HSV blue; + HSV cyan; + HSV green; +} solarized_t; + +extern solarized_t solarized; + +#endif diff --git a/users/talljoe/config.h b/users/talljoe/config.h index 1cdbb5a412..0d06a0b12d 100644 --- a/users/talljoe/config.h +++ b/users/talljoe/config.h @@ -1,7 +1,7 @@ #ifndef USERSPACE_CONFIG_H #define USERSPACE_CONFIG_H -#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD #define RESET_LAYER 15 diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c index e9c69b016a..7a343e7768 100644 --- a/users/talljoe/talljoe.c +++ b/users/talljoe/talljoe.c @@ -5,10 +5,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = TEMPLATE_TKL( 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, MO_ADJ , - 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_BSLS, 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_BSPC, KC_DEL , KC_END , KC_PGDN, - US_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT , - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP , + US_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 , US_BSLS, KC_INS , KC_HOME, KC_PGUP, + US_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_BSPC, KC_DEL , KC_END , KC_PGDN, + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT , + SH_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SH_RBRC, KC_UP , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT), [_WORKMAN] = TEMPLATE( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -34,41 +34,44 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_A, KC_R, KC_S, KC_T, KC_D , KC_H, KC_N, KC_E, KC_I, KC_O , _______, _______, _______, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - +#if (SPACE_COUNT > 1) + // A tweaked version of the Maltron layout + [_MALTROFF] = TEMPLATE( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_Q, KC_P, KC_Y, KC_G, KC_B , KC_J, KC_M, KC_U, KC_K, KC_L, _______, _______, _______, + _______, KC_A, KC_N, KC_I, KC_S, KC_F , KC_D, KC_T, KC_H, KC_O, KC_R , US_ENT , KC_BSPC, + _______, KC_Z, KC_X, KC_C, KC_V, US_QUOT, KC_SCLN, KC_W, KC_COMM, KC_DOT, KC_SLSH, _______, _______, + _______, _______, _______, MLT_E , _______, _______, _______, _______, _______, _______), +#endif #ifdef ENABLE_GAME_LAYER [_GAME] = TEMPLATE( KC_ESC , 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_BSLS, KC_GRV, 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_BSPC, MO_NAV , 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_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, MO_ADJ , - KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ), + KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ), #endif - [_NAV] = TEMPLATE( + [_NAV] = TEMPLATE_NAV( KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_TAB , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_VOLU, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN2, KC_BTN3, KC_DEL , - US_CAPS, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_MUTE, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , KC_RCTL, TG_ADJ , - KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_END , KC_PGDN, KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP , + US_TAB , KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN3, KC_BTN2, KC_DEL , + CTL_ESC, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_AMPR, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , US_QUOT, TG_ADJ , + KC_LSFT, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, KC_ASTR, KC_CALC, US_GRV , KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP , KC_LCTL, KC_LGUI, KC_LALT, NV_SPC2, NV_SPC1, NV_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT ), - [_NUM] = TEMPLATE( + [_NUM] = TEMPLATE_NUM( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, XXXXXXX, KC_DEL , - US_CAPS, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_PPLS, KC_PENT, XXXXXXX, - KC_LSFT, KC_EQL, KC_PLUS, KC_BSLS, KC_PIPE, KC_SCLN, XXXXXXX, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, XXXXXXX, + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_VOLU, KC_CIRC, KC_7, KC_8, KC_9, KC_PMNS, XXXXXXX, XXXXXXX, KC_DEL , + CTL_ESC, KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_MUTE, KC_PENT, KC_4, KC_5, KC_6, KC_PPLS, XXXXXXX, KC_ENT , + KC_LSFT, KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_VOLD, KC_PIPE, KC_1, KC_2, KC_3, KC_PAST, KC_PSLS, TG_NUM , KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ), // Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards) - [_ADJUST] = TEMPLATE( - MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(6) , FX(7) , FX(8) , FX(9) , FX(10) , BR_DEC , BR_INC , XXXXXXX, MO_RST , - XXXXXXX, H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, KC_DEL , + [_ADJUST] = TEMPLATE_ADJUST( + MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(8) , FX(9) , FX(10) , FX(20) , FX(0) , BR_DEC , BR_INC , XXXXXXX, MO_RST , + MO_RST , H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, MO_RST , XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ , - TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX, - MO_RST , AG_NORM, AG_SWAP, XXXXXXX, BL_STEP, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME), + TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, LY_MALT, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX, + MO_RST , AG_SWAP, AG_NORM, XXXXXXX, BL_TOGG, XXXXXXX, RGB_TOG, XXXXXXX, XXXXXXX, TG_GAME), // To Reset hit FN + ` + Esc - [_RESET] = TEMPLATE( - RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - RESET , XXXXXXX, XXXXXXX, XXXXXXX, KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX), + [_RESET] = TEMPLATE_RESET, }; void matrix_scan_user(void) { diff --git a/users/talljoe/talljoe.h b/users/talljoe/talljoe.h index 7c34cd41ff..4436c0a044 100644 --- a/users/talljoe/talljoe.h +++ b/users/talljoe/talljoe.h @@ -8,7 +8,7 @@ enum userspace_custom_keycodes { DFAULTS, TOGGLE_BACKLIGHT, EFFECT, - EFFECT_END = EFFECT + 10 + EFFECT_END = EFFECT + 20 }; #ifndef RESET_LAYER @@ -21,6 +21,7 @@ enum layers { _NORMAN, _DVORAK, _COLMAK, + _MALTROFF, _GAME, _NAV, _NUM, @@ -29,7 +30,9 @@ enum layers { }; enum tap_dancers { - TD_SEMICOLON + TD_SEMICOLON, + TD_GRAVE, + TD_QUOTE, }; #define _______ KC_TRNS @@ -39,6 +42,7 @@ enum tap_dancers { #define MO_ADJ MO(_ADJUST) #define MO_RST MO(_RESET) #define TG_ADJ TG(_ADJUST) +#define TG_NUM TG(_NUM) #ifdef ENABLE_GAME_LAYER #define TG_GAME TG(_GAME) #else @@ -49,16 +53,28 @@ enum tap_dancers { #define LY_NRMN DF(_NORMAN) #define LY_DVRK DF(_DVORAK) #define LY_CLMK DF(_COLMAK) +#if SPACE_COUNT >= 2 + #define LY_MALT DF(_MALTROFF) +#else + #define LY_MALT KC_NO +#endif #define TG_NKRO MAGIC_TOGGLE_NKRO #define KC_PTT KC_F24 #define MS_MID KC_MS_BTN3 #define FX(x) (EFFECT + x) -#define US_CAPS CTL_T(KC_ESC) -#define US_QUOT RCTL_T(KC_QUOT) +#define CTL_ESC CTL_T(KC_ESC) +#define US_ENT RCTL_T(KC_ENT) #define US_MINS RCTL_T(KC_QUOT) +#define US_BSLS LCA_T(KC_BSLS) #define US_SCLN TD(TD_SEMICOLON) -#define US_ENT LT(_NUM, KC_ENT) +#define US_GRV TD(TD_GRAVE) +#define US_QUOT TD(TD_QUOTE) +#define US_TAB C_S_T(KC_TAB) +#define SH_LBRC LSFT_T(KC_LBRC) +#define SH_RBRC RSFT_T(KC_RBRC) + +#define MLT_E LT(_NUM, KC_E) #ifndef SPACE_COUNT #define SPACE_COUNT 1 @@ -75,17 +91,34 @@ enum tap_dancers { #define NM_SPC1 _______ #define NM_SPC2 _______ #define NM_SPC3 _______ +#elif (SPACE_COUNT == 2) + #define KC_SPC1 LT(_NAV,KC_SPC) + #define KC_SPC2 LT(_NUM,KC_ENT) + + #define NV_SPC1 KC_SPC + #define NV_SPC2 KC_ENT + + #define NM_SPC1 KC_0 + #define NM_SPC2 KC_SPC + + #define KC_SPC3 XXXXXXX + #define NV_SPC3 XXXXXXX + #define NM_SPC3 XXXXXXX #elif (SPACE_COUNT == 3) - #define KC_SPC1 KC_BSPC + #ifdef SWAP_HANDS_ENABLE + #define KC_SPC1 SH_T(KC_BSPC) + #else + #define KC_SPC1 KC_BSPC + #endif #define KC_SPC2 LT(_NUM,KC_ENT) #define KC_SPC3 LT(_NAV,KC_SPC) #define NV_SPC1 KC_SPC - #define NV_SPC2 C_S_T(KC_ENT) + #define NV_SPC2 KC_ENT #define NV_SPC3 KC_SPC - #define NM_SPC2 XXXXXXX #define NM_SPC1 KC_SPC + #define NM_SPC2 XXXXXXX #define NM_SPC3 KC_0 #else #error "Unsupported space count:" SPACE_COUNT @@ -110,7 +143,7 @@ enum tap_dancers { #define FN_MO2 KC_NO #endif -#ifdef TEMPLATE_TKL +#ifndef TEMPLATE #define _X_ KC_NO #define TEMPLATE( \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KJ6, \ @@ -126,7 +159,8 @@ enum tap_dancers { KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, _X_, \ KA4, KP2, KC6, KX1, KK6, KX2, KC0, KM3, KD0, KA1, _X_, _X_, _X_ \ ) -#else +#endif +#ifndef TEMPLATE_TKL #define TEMPLATE_TKL( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ @@ -143,4 +177,26 @@ enum tap_dancers { ) #endif +#ifndef TEMPLATE_ALT + #define TEMPLATE_ALT TEMPLATE +#endif +#ifndef TEMPLATE_NUM + #define TEMPLATE_NUM TEMPLATE_ALT +#endif +#ifndef TEMPLATE_NAV + #define TEMPLATE_NAV TEMPLATE_ALT +#endif +#ifndef TEMPLATE_ADJUST + #define TEMPLATE_ADJUST TEMPLATE_ALT +#endif + +#ifndef TEMPLATE_RESET + #define TEMPLATE_RESET TEMPLATE_ALT( \ + RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , \ + RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET , \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RESET , XXXXXXX, XXXXXXX, XXXXXXX, RESET , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX) +#endif + #endif diff --git a/users/talljoe/tapdance.c b/users/talljoe/tapdance.c index 3198fc67f0..c4d6025f0f 100644 --- a/users/talljoe/tapdance.c +++ b/users/talljoe/tapdance.c @@ -1,34 +1,146 @@ //Tap Dance #include "talljoe.h" -// Send semin-colon + enter on two taps -void tap_dance_semicolon(qk_tap_dance_state_t *state, void *user_data) { +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, //send two single taps + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7, + SPECIAL = 8 +}; + +static struct { + int quote; + int semicolon; +} tap_state = {0}; + +int cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + //If count = 1, and it has been interrupted - it doesn't matter if it is pressed or not: Send SINGLE_TAP + if (state->interrupted) { + // if (!state->pressed) return SINGLE_TAP; + //need "permissive hold" here. + // else return SINGLE_HOLD; + //If the interrupting key is released before the tap-dance key, then it is a single HOLD + //However, if the tap-dance key is released first, then it is a single TAP + //But how to get access to the state of the interrupting key???? + return SINGLE_TAP; + } + else { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->interrupted) return DOUBLE_SINGLE_TAP; + else if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; + else if (state->count == 3) return TRIPLE_HOLD; + else return SPECIAL; +} + +int hold_cur_dance (qk_tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted) { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + else { + if (!state->pressed) return SINGLE_TAP; + else return SINGLE_HOLD; + } + } + //If count = 2, and it has been interrupted - assume that user is trying to type the letter associated + //with single tap. + else if (state->count == 2) { + if (state->pressed) return DOUBLE_HOLD; + else return DOUBLE_TAP; + } + else if (state->count == 3) { + if (!state->pressed) return TRIPLE_TAP; + else return TRIPLE_HOLD; + } + else return SPECIAL; +} + +// Send semi-colon + enter on two taps +void tap_dance_semicolon_finished(qk_tap_dance_state_t *state, void *user_data) { + tap_state.semicolon = hold_cur_dance(state); + switch (tap_state.semicolon) { + case SINGLE_TAP: case DOUBLE_HOLD: register_code(KC_SCLN); break; + case SINGLE_HOLD: layer_on(_NUM); break; + } +} + +void tap_dance_semicolon_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (tap_state.semicolon) { + case SINGLE_TAP: case DOUBLE_HOLD: unregister_code(KC_SCLN); break; + case DOUBLE_TAP: { + if (get_mods()) { + SEND_STRING(";;"); // send normal when mods are pressed + } + else { + SEND_STRING(";\n"); + } + break; + } + case TRIPLE_TAP: { + SEND_STRING(";\n\n"); + } + case SPECIAL: layer_invert(_NUM); break; + case SINGLE_HOLD: layer_off(_NUM); break; + } + tap_state.semicolon = 0; +} + +// Send `. ~. ``` +void tap_dance_grave_finished(qk_tap_dance_state_t *state, void *user_data) { switch(state->count) { case 1: - register_code(KC_SCLN); - unregister_code(KC_SCLN); + SEND_STRING("`"); break; case 2: - register_code(KC_SCLN); - unregister_code(KC_SCLN); + SEND_STRING("~"); + break; + } +} - uint8_t mods = get_mods(); - if (mods) { - clear_mods(); - } +void tap_dance_grave_each(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 3) { + SEND_STRING("```"); + } else if (state->count > 3) { + SEND_STRING("`"); + } +} - register_code(KC_ENT); - unregister_code(KC_ENT); - if (mods) { - set_mods(mods); - } +void tap_dance_quote_finished(qk_tap_dance_state_t *state, void *user_data) { + tap_state.quote = hold_cur_dance(state); + switch (tap_state.quote) { + case SINGLE_TAP: case DOUBLE_HOLD: register_code(KC_QUOT); break; + case SINGLE_HOLD: layer_on(_NAV); break; + } +} - reset_tap_dance(state); - break; +void tap_dance_quote_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (tap_state.quote) { + case SINGLE_TAP: case DOUBLE_HOLD: unregister_code(KC_QUOTE); break; + case DOUBLE_TAP: SEND_STRING("\""); break; + case TRIPLE_TAP: layer_invert(_NAV); break; + case SINGLE_HOLD: layer_off(_NAV); break; } + tap_state.quote = 0; } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_SEMICOLON] = ACTION_TAP_DANCE_FN(tap_dance_semicolon), + [TD_SEMICOLON] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_semicolon_finished, tap_dance_semicolon_reset), + [TD_GRAVE] = ACTION_TAP_DANCE_FN_ADVANCED(tap_dance_grave_each, tap_dance_grave_finished, NULL), + [TD_QUOTE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, tap_dance_quote_finished, tap_dance_quote_reset), }; -- cgit v1.2.3 From 14f691d2a749c6f4fd9bf39d219da1369747cd8d Mon Sep 17 00:00:00 2001 From: Mat Greten Date: Wed, 19 Sep 2018 17:15:13 -0600 Subject: Keymap: meagerfindings ergodox (#3920) * initial commit * updating after review --- layouts/community/ergodox/meagerfindings/README.md | 109 ++++ layouts/community/ergodox/meagerfindings/config.h | 26 + layouts/community/ergodox/meagerfindings/keymap.c | 558 +++++++++++++++++++++ layouts/community/ergodox/meagerfindings/rules.mk | 3 + 4 files changed, 696 insertions(+) create mode 100644 layouts/community/ergodox/meagerfindings/README.md create mode 100644 layouts/community/ergodox/meagerfindings/config.h create mode 100644 layouts/community/ergodox/meagerfindings/keymap.c create mode 100644 layouts/community/ergodox/meagerfindings/rules.mk diff --git a/layouts/community/ergodox/meagerfindings/README.md b/layouts/community/ergodox/meagerfindings/README.md new file mode 100644 index 0000000000..e7e4270db9 --- /dev/null +++ b/layouts/community/ergodox/meagerfindings/README.md @@ -0,0 +1,109 @@ +![Base](https://meagerfindings.com/assets/img/ergodox/base.png) + +# Meagerfinding's ErgoDox Layout + + + +- [Overview](#overview) +- [Credit where credit is due](#credit-where-credit-is-due) +- [Features](#features) + - [Tap/Hold Macro Keys](#taphold-macro-keys) + - [TapDance Keys](#tapdance-keys) +- [Base Layer](#base-layer) + - [Things to note:](#things-to-note) +- [Old Base Layer](#old-base-layer) +- [Symbols Layer](#symbols-layer) +- [Mouse & Media Keys Layer](#mouse-media-keys-layer) +- [Markdown Layer](#markdown-layer) +- [Arrow/Movements Layer](#arrowmovements-layer) +- [Numpad Layer](#numpad-layer) + + + +## Overview + +The overall goals of this layout are to: +1. Use the Ergodox thumb clusters to eliminate pinky reach. +2. Place as many useful keys under the home rows as possible. + +I first decided to build an ErgoDox as I wanted to use my thumbs for more with the added ergonomic benefits of a split board and ortholinear layout. I knew my hands were hurting from the weird contortions of copying and pasting constantly on my Mac, but I had no idea how strained I really was until I started moving as many modifier keys to the thumb clusters. + +## Credit where credit is due + +The initial layout used created on the [ErgoDox EZ Configurator](https://ergodox-ez.com/pages/graphical-configurator). I went through 26+ iterations within the configurator prior to beginning my journey with QMK itself. Much of the dual function/layer keys are influenced by and adapted from the EZ Configurator. + +Many features in this layout are either directly inspired by or are adaptations of [Algernon's incredible ErgoDox layout](https://github.com/algernon/ergodox-layout). Specifically: TapDance and its usage, and the brilliant idea of using TapDance to pair down the four keys for parens, brackets, and curly braces into just 2 keys. + +## Features + +### Tap/Hold Macro Keys +* `Paste/Paste Special` key sends Paste on tap and Paste Special when held. +* `Screen/Video` key sends `||scrn` when tapped and `||video` when held + - [Typinator](http://www.ergonis.com/products/typinator/) expands `||scrn` into `(Screenshot: )`, and `||video` into `(Video: )`, the QMK macro then moves back to before the last paren, inserts a space and removes a space to create a hyperlink for use in Zendesk. +* When tapped, `Todoist` toggles quick add window for a new Todoist task (`CMD + Shift + A`) and switches to Todoist when held +* The RubyMine key opens RubyMine by triggering spotlight, typing out `Rubymine`, and submitting the enter key. +* `Zendesk` triggers spotlight and then calls Typinator expansion to open my Zendesk Agent dashboard in Chrome. + + +### TapDance Keys +* `Copy/Cut` key copies on tap, cut's on two taps. +* One tap on `Snagit` key = sends `Ctrl + Shift + C` which is Snagit's selector and two taps on `Snagit` key = `Cmd + Shift + Opt + 4`, OS X cropping screenshot that is copied to the clipboard only. +* Tapping the `[{(`/`)}]` keys once yields `[` or `{` when the shift key is engaged, tapping them twice yields `(`. + +## Base Layer + +![Base](https://meagerfindings.com/assets/img/ergodox/base.png) + +The base layer retains the alphas from the QWERTY layout without any modifications. + +### Things to note: + +- The shift key is a One Shot Modifier key, meaning shift is not submitted when the key is tapped, instead, it only submits when you either tap it again, or on the next key press. + - There is no CAPSLOCK key designated as it is pretty comfortable to simply hold down shift in this layout and continue typing. +- There is only one layer that you can fully switch to on this layout, the [Old Base layer](#old-base-layer). All other layers require holding a key to reach them. For the most part, the key that toggles a layer, will be on the opposite hand that will be typing with that layer. + - For example: the symbols layer is reached by holding down the enter key with your right thumb, and most of the symbols are located on the left hand board. + + +## Old Base Layer + +![Old Base](https://meagerfindings.com/assets/img/ergodox/old_base.png) + +I am moving into a new position (software engineering) at work from a Support position. My hope is to use my F keys more often and write fewer emails. This is my old base layer, still easily accessible, as I'm not used to having F key's on my top row quite yet. + +## Symbols Layer + +![Symbols](https://meagerfindings.com/assets/img/ergodox/symbols.png) + +Holding down the `enter` key with your right thumb toggles the symbol layer. + +I've placed my most used symbols under the homerow. Granted, right now I mainly right emails/support ticket responses, so this home row may need to change as I transition to software engineering. + +## Mouse & Media Keys Layer + +![Mouse & Media](https://meagerfindings.com/assets/img/ergodox/mouse_media.png) + +Holding down the `:` key on with your right pinky toggles the mouse and media layer. Your left hand controls the mouse directions just in a similar fashion to the keys used in the [movement layer](#arrowmovements-layer). + +The right hand has a media controls under the homerow for quick muting/pausing. + +* `XKCD #1319` Key that ironically partially-automates accessing the link to [XKCD #1319](https://xkcd.com/1319/). + +## Markdown Layer + +![Markdown](https://meagerfindings.com/assets/img/ergodox/markdown.png) + +This layer places most common markdown symbols under the right hand. You can reach this layer by holding down the `F` key on your left hand. + +## Arrow/Movements Layer + +![Movement](https://meagerfindings.com/assets/img/ergodox/movement_arrows.png) + +Toggled by holding down the space key with the right thumb. This isn't vim like movement, nope, it's `WASD` but over one column. So I guess it's actually `ESDF` on the left hand and `IJKL` on the right hand to better line up with the columns offset/staggered columns on the Dox. + +## Numpad Layer + +![Numpad](https://meagerfindings.com/assets/img/ergodox/numpad.png) + +My right hand is pretty comfortable with tenkey number input so this is easily accessible by holding down backspace with the left thumb. + +Also, on the left hand, there is a tap to copy and hold to cut macro under the `D` key, and a tap to paste and a hold to paste special macro on the `F` key. I guess I'm to too lazy to move my fingers when copying/pasting... diff --git a/layouts/community/ergodox/meagerfindings/config.h b/layouts/community/ergodox/meagerfindings/config.h new file mode 100644 index 0000000000..3d4f11b43a --- /dev/null +++ b/layouts/community/ergodox/meagerfindings/config.h @@ -0,0 +1,26 @@ +#undef VENDOR_ID +#define VENDOR_ID 0xFEED +#undef PRODUCT_ID +#define PRODUCT_ID 0x1307 +#undef DEVICE_VER +#define DEVICE_VER 0x0001 +#undef MANUFACTURER +#define MANUFACTURER meagerfindings +#undef PRODUCT +#define PRODUCT ErgoDox +#undef DESCRIPTION +#define DESCRIPTION meagerfindings firmware for Ergodox + +#define USB_MAX_POWER_CONSUMPTION 500 + +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 20 +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 0 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 18 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 4 + +#undef TAPPING_TERM +#define TAPPING_TERM 200 diff --git a/layouts/community/ergodox/meagerfindings/keymap.c b/layouts/community/ergodox/meagerfindings/keymap.c new file mode 100644 index 0000000000..62504f9667 --- /dev/null +++ b/layouts/community/ergodox/meagerfindings/keymap.c @@ -0,0 +1,558 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +enum { + BASE = 0, + OLD_BASE, + SYMBL, + MEDIA, + MKDWN, + ARROWS, + NUM, +}; + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + MD_LINK, + XKCD, + DBLE_ZER0, + L_ID_0, + L_ID_1, + L_ID_2, + PAST_PS, + TODO, + RUBYMINE, + ZENDESK, + DBLE_ASTR, + TRPLE_GRAVE, + H_ONE, + H_TWO, + H_THREE, + H_FOUR, + H_FIVE, + M_LINK, + M_GREATER, + TD_COPY_CUT = 6, + TD_SNAGIT = 8, + TD_B_L_SEL = 10, + CT_LBP = 11, + CT_RBP = 12 +}; + +//Redefine Key Names for Readaibilty +#define XXXXXXX KC_NO +#define SCRN_CLIPB LCTL(LGUI(LSFT(KC_4))) +#define CHRM_L LALT(LGUI(KC_LEFT)) //Move left one tab in Chrome +#define CHRM_R LALT(LGUI(KC_RIGHT)) //Move right one tab in Chrome +#define S_CMD_S LGUI_T(KC_S) //`S` when typing `CMD` when held +#define D_CMD_OPT LGUI_T(LALT_T(KC_D)) //`D` when typing `CMD + Opt` when held + +static uint16_t key_timer; //key timer for macros + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Copy, twice for Paste, three times for Cut. + [TD_COPY_CUT] = ACTION_TAP_DANCE_DOUBLE(LGUI(KC_C),LGUI(KC_X)), + //Tap once for Snagit, twice for Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) + [TD_SNAGIT] = ACTION_TAP_DANCE_DOUBLE(LCTL(LSFT(KC_C)), LCTL(LGUI(LSFT(KC_4)))), + [CT_LBP] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, KC_LPRN), + [CT_RBP] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, KC_RPRN) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap 0: Basic layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | "> " | | []() | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | SCRN |------+------+------+------+------+--------| + * | Hyper | A |S /CMD|D/OPT | F /MD| G |------| |------| H | J |K/OPT |L /CMD| ; /L2| '/Hyper| + * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| + * |Shft Tab|Z/Ctrl|X/Alt | C | V | B | [ { | | ] } | N | M | , | ./Alt|//Ctrl|CMD+SHFT| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ` |Zendsk|RBMINE|CMD+S | ToDo | | _ | | 00 | 00 |OLD BASE| + * `----------------------------------' `----------------------------------' + * ,-------------. ,--------------. + * | Esc | Home | |Layer?| Esc | + * ,------|------|------| |------+-------+------. + * | | | End | | Undo | | | + * |Shift |Backsp|------| |------| Return|Space/| + * | OSM | /NUM | DEL | | Ctrl | /SYML |Arrows| + * `--------------------' `---------------------' + * + *Copy/Cut key copies on tap, cut's on two taps. + * + *One tap on Snagit key = is Ctrl + Shift + C which is Snagit's selector. + *Two taps on Snagit key = Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) + */ + + [BASE] = LAYOUT_ergodox( + //left hand + KC_EQUAL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, M_GREATER, + OSM(MOD_HYPR), KC_A, S_CMD_S, ALT_T(KC_D), LT(MKDWN,KC_F), KC_G, + LSFT(KC_TAB), CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, TD(CT_LBP), + KC_GRAVE, ZENDESK, RUBYMINE, LGUI(KC_S), TODO, + KC_ESCAPE, KC_HOME, + KC_END, + OSM(MOD_LSFT), LT(NUM,KC_BSPACE), LT(MKDWN,KC_DELETE), + + //right hand + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINUS, + MD_LINK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, + KC_H, KC_J, ALT_T(KC_K), LGUI_T(KC_L), LT(MEDIA,KC_SCOLON), ALL_T(KC_QUOTE), + TD(CT_RBP), KC_N, KC_M, KC_COMMA, ALT_T(KC_DOT), CTL_T(KC_SLASH), SCMD_T(_______), + LSFT(KC_MINUS), _______, DBLE_ZER0, DBLE_ZER0, TO(OLD_BASE), + L_ID_0, KC_ESCAPE, + LGUI(KC_Z), + LT(MEDIA,KC_LCTL), LT(SYMBL,KC_ENTER), LT(ARROWS,KC_SPACE)), + + /* Keymap 1: OLD Base layer + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | []() | |Snagit| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | "> " | | []() | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | SCRN |------+------+------+------+------+--------| + * | Hyper | A |S /CMD| D | F | G |------| |------| H | J | K |L /CMD| ; /L2| '/Hyper| + * |--------+------+------+------+------+------| ( | | ) |------+------+------+------+------+--------| + * |Shft Tab|Z/Ctrl|X/Alt | C | V | B | [ { | | ] } | N | M | , | ./Alt|//Ctrl|CMD+SHFT| + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | ` |Zendsk|RBMINE|CMD+S | ToDo | | _ | | 00 | 00 |ToBase| + * `----------------------------------' `----------------------------------' + * ,-------------. ,--------------. + * | Esc | Home | |Layer?| Esc | + * ,------|------|------| |------+-------+------. + * | | | End | | Undo | | | + * |Shift |Backsp|------| |------| Return|Space/| + * | OSM | /L5 | DEL | | Ctrl | /LT1 |Arrows| + * `--------------------' `---------------------' + * + *Copy/Cut key copies on tap, cut's on two taps. + * + *One tap on Snagit key = is Ctrl + Shift + C which is Snagit's selector. + *Two taps on Snagit key = Cmd + Shift + Opt + 4 (OS X cropping screenshot that is copied to the clipboard only.) + */ + + [OLD_BASE] = LAYOUT_ergodox( + //left hand + KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, M_LINK, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, M_GREATER, + OSM(MOD_HYPR), KC_A, S_CMD_S, D_CMD_OPT, LT(MKDWN,KC_F),KC_G, + LSFT(KC_TAB), CTL_T(KC_Z), ALT_T(KC_X), KC_C, KC_V, KC_B, TD(CT_LBP), + KC_GRAVE, ZENDESK, RUBYMINE, LGUI(KC_S), TODO, + KC_ESCAPE, KC_HOME, + KC_END, + OSM(MOD_LSFT), LT(NUM,KC_BSPACE), LT(MKDWN,KC_DELETE), + + //right hand + TD(TD_SNAGIT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + MD_LINK, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLASH, + KC_H, KC_J, KC_K, LGUI_T(KC_L), LT(MEDIA,KC_SCOLON), ALL_T(KC_QUOTE), + TD(CT_RBP), KC_N, KC_M, KC_COMMA, ALT_T(KC_DOT), CTL_T(KC_SLASH), SCMD_T(_______), + LSFT(KC_MINUS), _______, DBLE_ZER0, DBLE_ZER0, TO(BASE), + L_ID_0, KC_ESCAPE, + LGUI(KC_Z), + LT(MEDIA,KC_LCTL), LT(SYMBL,KC_ENTER), LT(ARROWS,KC_SPACE)), + + /* Keymap 2: Symbol + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | []() | |Snagit| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | $ | & | ` | | | Cmd | | | | | * | | | | + * |--------+------+------+------+------+------| + K | | |------+------+------+------+------+--------| + * | | # | $ | & | ! | @ |------| |------| - | [ | ] | ( | ) | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | | | ~ | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | |Layer?| | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + // SYMBOLS + [SYMBL] = LAYOUT_ergodox( + //left hand + _______, KC_1, KC_2, KC_3, KC_4, KC_5, M_LINK, + _______, _______, KC_DLR, KC_AMPR, KC_GRAVE, KC_PIPE, LGUI(KC_K), + _______, KC_HASH, KC_DLR, KC_AMPR, KC_EXLM, KC_AT, + _______, KC_PERC, KC_CIRC, _______, _______, KC_TILD, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + + //right hand + TD(TD_SNAGIT), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + _______, _______, _______, KC_PAST, _______, _______, _______, + KC_MINUS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + L_ID_1, _______, + _______, + _______, _______, _______), + + /* Keymap 3: Media and mouse keys + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | XKCD | | | | | | F15 | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | |Whl Up| MsUp |Whl Dn| | | | | | | | | | F14 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |Ctl L |MsLeft|MsDown|MsRght| Ctl R|------| |------| | Mute | VolDn| VolUp| TL 2 | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |WHL L | |Whl R | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | Mute | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | |LAYER?| | + * ,------|------|------| |------+------+------. + * | Left |Right | | | |Copy/ | paste| + * | Click|Click |------| |------| cut |/paste| + * | | | | | | |spcial| + * `--------------------' `--------------------' + */ + // MEDIA AND MOUSE + + [MEDIA] = LAYOUT_ergodox( + //left hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, KC_MS_WH_UP, KC_MS_UP, KC_MS_WH_DOWN, _______, _______, + _______, LCTL(KC_LEFT), KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, RCTL(KC_RIGHT), + XXXXXXX, _______, KC_MS_WH_LEFT, _______, KC_MS_WH_RIGHT, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + KC_MS_BTN1, KC_MS_BTN2, _______, + + //right hand + XKCD, _______, _______, _______, _______, _______, KC_F15, + _______, _______, _______, _______, _______, _______, KC_F14, + _______, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _______, KC_MEDIA_PLAY_PAUSE, + _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, _______, XXXXXXX, + _______, _______, _______, _______, _______, + L_ID_2, _______, + _______, + _______, TD(TD_COPY_CUT), PAST_PS), + + /* Keymap 4: Markdown Symbols + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | |SCRNCL| | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | | ``` | ** | _ | ` | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | TL MD| |------| |------| - | [ | ] | ( | ) | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | # | ## | ### | #### | #####| | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | |Layer?| | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + * Sc cp = OS X cropping screenshot that is copied to the clipboard only. + */ + // Markdown Layer + [MKDWN] = LAYOUT_ergodox( + //left hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + + //right hand + SCRN_CLIPB, _______, _______, _______, _______, _______, _______, + _______, _______, TRPLE_GRAVE, DBLE_ASTR,LSFT(KC_MINUS), KC_GRAVE, _______, + KC_MINUS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, _______, + _______, H_ONE, H_TWO, H_THREE, H_FOUR, H_FIVE, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______), + + /* Keymap 5: Arrows + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | RESET | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Opt+L| Up |Opt+R | | | | | | Opt+L| Up |Opt+R | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | |Ctrl+L| Left | Dn | Right|Ctrl+R|------| |------|Ctrl+L| Left | Dn | Right|Ctrl+R| | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + * + * + * + */ + // Movement Layer + + [ARROWS] = LAYOUT_ergodox( + //left hand + RESET, _______, _______, _______, _______, _______, _______, + _______, _______, CHRM_L, KC_UP, CHRM_R, _______, _______, + _______,LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + //right hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, CHRM_L, KC_UP, CHRM_R, _______, _______, + LCTL(KC_LEFT), KC_LEFT, KC_DOWN, LGUI_T(KC_RIGHT), LCTL(KC_RIGHT), _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______), + + /* Keymap 6: Numpad + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | | | | | = | 7 | 8 | 9 | * | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | |Cp/Cut|paste | |------| |------| + | 4 | 5 | 6 | + | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | - | 1 | 2 | 3 | / | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | 0 | . | 00 | 00 | Enter| + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | |Nupmad| | + * | | |------| |------|Enter | | + * | | | | | | | | + * `--------------------' `--------------------' + */ + // Numpad Layer + [NUM] = LAYOUT_ergodox( + //left hand + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, TD(TD_COPY_CUT), PAST_PS, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, + _______, _______, + _______, + _______, _______, _______, + + //right hand + _______, _______, _______, _______, _______, _______, _______, + _______, KC_EQUAL, KC_7, KC_8, KC_9, KC_ASTR, _______, + KC_PLUS, KC_4, KC_5, KC_6, KC_PLUS, _______, + _______, KC_MINUS, KC_1, KC_2, KC_3, KC_KP_SLASH, _______, + KC_KP_0, KC_DOT, DBLE_ZER0, DBLE_ZER0, KC_KP_ENTER, + _______, _______, + _______, + _______, KC_PENT, _______), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + + case MD_LINK: + if (record->event.pressed){ + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > 150) { + SEND_STRING ("([Video]("); + } else { + SEND_STRING ("([Screenshot]("); + } + SEND_STRING(SS_LGUI("v")); + SEND_STRING("))"); + } + break; + + case XKCD: + if (record->event.pressed) { + SEND_STRING ("https://xkcd.com/1319/"); + } + break; + + case DBLE_ZER0: + if (record->event.pressed){ + SEND_STRING ("00"); + } + break; + + case DBLE_ASTR: + if (record->event.pressed){ + SEND_STRING ("**"); + SEND_STRING ("**"); + SEND_STRING (SS_TAP(X_LEFT)); + SEND_STRING (SS_TAP(X_LEFT)); + } + break; + + case TRPLE_GRAVE: + if (record->event.pressed){ + SEND_STRING ("```"); + } + break; + + case L_ID_0: + if (record->event.pressed) { + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("Layer 0: Base"); + } + break; + + case L_ID_1: + if (record->event.pressed) { + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("Layer 1: Symbols"); + } + break; + + case L_ID_2: + if (record->event.pressed) { + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("Layer 2: Media & Mousekeys"); + } + break; + + case PAST_PS: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > 150) { + SEND_STRING (SS_LGUI("V")); // Paste special + } else { + SEND_STRING (SS_LGUI("v")); // Paste + } + } + break; + + case TODO: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (timer_elapsed(key_timer) > 150) { //switch to Todoist when held and released + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("Todoist"); + SEND_STRING (SS_TAP(X_ENTER)); + } else { + SEND_STRING (SS_LGUI(SS_LCTRL("a"))); //macro to open Todoist new task dialog + } + } + break; + + case RUBYMINE: + if (record->event.pressed){ + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("RUBYMINE"); + SEND_STRING (SS_TAP(X_ENTER)); + } + break; + + case ZENDESK: + if (record->event.pressed){ + SEND_STRING (SS_LGUI(" ")); + SEND_STRING ("||ZEN"); + SEND_STRING (SS_TAP(X_ENTER)); + } + break; + + case H_ONE: + if (record->event.pressed){ + SEND_STRING ("# "); + } + break; + + case H_TWO: + if (record->event.pressed){ + SEND_STRING ("## "); + } + break; + + case H_THREE: + if (record->event.pressed){ + SEND_STRING ("### "); + } + break; + + case H_FOUR: + if (record->event.pressed){ + SEND_STRING ("#### "); + } + break; + + case H_FIVE: + if (record->event.pressed){ + SEND_STRING ("##### "); + } + break; + case M_LINK: + if (record->event.pressed){ + SEND_STRING ("[]()"); + } + break; + case M_GREATER: + if (record->event.pressed){ + SEND_STRING ("> "); + } + break; + } + return true; +}; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case 1: + ergodox_right_led_1_on(); + break; + case 2: + ergodox_right_led_2_on(); + break; + default: + break; + } +}; diff --git a/layouts/community/ergodox/meagerfindings/rules.mk b/layouts/community/ergodox/meagerfindings/rules.mk new file mode 100644 index 0000000000..c775e1f6d6 --- /dev/null +++ b/layouts/community/ergodox/meagerfindings/rules.mk @@ -0,0 +1,3 @@ +COMMAND_ENABLE = no +TAP_DANCE_ENABLE = yes +FORCE_NKRO = yes -- cgit v1.2.3 From 77433b1a3140411b8b8f1b0389827c38384fc5fe Mon Sep 17 00:00:00 2001 From: itsdrdick Date: Thu, 20 Sep 2018 07:16:18 +0800 Subject: Keyboard: Add evil80 keyboard (#3921) * Add evil80 keyboard * Delete rules.mk * Update config.h * Update keymap.c * Update keymap.c --- keyboards/evil80/config.h | 64 +++++++++++++++++++++++++++++ keyboards/evil80/evil80.c | 47 +++++++++++++++++++++ keyboards/evil80/evil80.h | 23 +++++++++++ keyboards/evil80/info.json | 13 ++++++ keyboards/evil80/keymaps/default/keymap.c | 31 ++++++++++++++ keyboards/evil80/rules.mk | 68 +++++++++++++++++++++++++++++++ 6 files changed, 246 insertions(+) create mode 100644 keyboards/evil80/config.h create mode 100644 keyboards/evil80/evil80.c create mode 100644 keyboards/evil80/evil80.h create mode 100644 keyboards/evil80/info.json create mode 100644 keyboards/evil80/keymaps/default/keymap.c create mode 100644 keyboards/evil80/rules.mk diff --git a/keyboards/evil80/config.h b/keyboards/evil80/config.h new file mode 100644 index 0000000000..81138a7703 --- /dev/null +++ b/keyboards/evil80/config.h @@ -0,0 +1,64 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Evil +#define PRODUCT Evil80 +#define DESCRIPTION QMK keyboard firmware for Evil80 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 16 + +/* Planck PCB default pin-out */ +#define MATRIX_ROW_PINS { F1, F4, F5, F0, B3, B0 } +#define MATRIX_COL_PINS { B2, D0, D1, D2, D3, D5, D4, D6, D7, B4, B1, C6, C7, E6, F6, F7 } +#define UNUSED_PINS + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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/evil80/evil80.c b/keyboards/evil80/evil80.c new file mode 100644 index 0000000000..d4653d049b --- /dev/null +++ b/keyboards/evil80/evil80.c @@ -0,0 +1,47 @@ +#include "evil80.h" +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + led_init_ports(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_init_ports(void) { + DDRB |= (1<<6) | (1<<7); // OUT +} + +void led_set_kb(uint8_t usb_led) { + if (usb_led & (1<", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} \ No newline at end of file diff --git a/keyboards/evil80/keymaps/default/keymap.c b/keyboards/evil80/keymaps/default/keymap.c new file mode 100644 index 0000000000..1706517a25 --- /dev/null +++ b/keyboards/evil80/keymaps/default/keymap.c @@ -0,0 +1,31 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: Winkey */ + 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_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_NUHS, 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, MO(2), KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + /* 1: Winkeyless */ + 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_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_NUHS, 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, MO(2), KC_UP, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_NO,KC_RALT,KC_RGUI,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + /* 2: Fn */ + LAYOUT( + KC_TRNS, BL_ON, BL_OFF,BL_STEP,BL_BRTG,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,\ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,\ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,\ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, \ + KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS \ + ), +}; diff --git a/keyboards/evil80/rules.mk b/keyboards/evil80/rules.mk new file mode 100644 index 0000000000..1067b43445 --- /dev/null +++ b/keyboards/evil80/rules.mk @@ -0,0 +1,68 @@ +# MCU name +#MCU = at90usb1287 +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. +API_SYSEX_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 334e2629df4adb44b0ac0dff3363a6daebc072e7 Mon Sep 17 00:00:00 2001 From: Anthony Wharton Date: Thu, 20 Sep 2018 00:18:15 +0100 Subject: Remove redefinition of `_______` in documentation example (#3924) * Remove redefinition of `_______` in documentation example * Slight rewording to include purpose of defintions * Update include to newer macro --- docs/keymap.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/docs/keymap.md b/docs/keymap.md index b28d21a21d..382a0e911b 100644 --- a/docs/keymap.md +++ b/docs/keymap.md @@ -89,11 +89,15 @@ There are 3 main sections of a `keymap.c` file you'll want to concern yourself w At the top of the file you'll find this: - #include "clueboard.h" + #include QMK_KEYBOARD_H // Helpful defines #define GRAVE_MODS (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)|MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) - #define _______ KC_TRNS + + /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * You can use _______ in place for KC_TRNS (transparent) * + * Or you can use XXXXXXX for KC_NO (NOOP) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ // Each layer gets a name for readability. // The underscores don't mean anything - you can @@ -105,7 +109,9 @@ At the top of the file you'll find this: #define _FL 1 #define _CL 2 -These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function. The `_______` define makes it easier to see what keys a layer is overriding, while the `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. +These are some handy definitions we can use when building our keymap and our custom function. The `GRAVE_MODS` definition will be used later in our custom function, and the following `_BL`, `_FL`, and `_CL` defines make it easier to refer to each of our layers. + +Note: You may also find some older keymap files may also have a define(s) for `_______` and/or `XXXXXXX`. These can be used in place for `KC_TRNS` and `KC_NO` respectively, making it easier to see what keys a layer is overriding. These definitions are now unecessary, as they are included by default. ### Layers and Keymaps -- cgit v1.2.3 From 2bdeccd7baab67df2d0c04c1c8167277f7217d3e Mon Sep 17 00:00:00 2001 From: holtenc Date: Wed, 19 Sep 2018 18:20:36 -0500 Subject: Keyboard: Add Prime_EXL prototype to 'handwired' (#3932) * initial commit * Update readme.md * Update keymap.c added comment for description of function to control LED as layer indicator * corrected formatting as requested. * format for configurator * corrected info.json to propertly reflect layout in Configurator * updated layouts to reflect physical keyboard --- keyboards/handwired/prime_exl/config.h | 56 ++++++++ keyboards/handwired/prime_exl/info.json | 12 ++ .../handwired/prime_exl/keymaps/default/config.h | 19 +++ .../handwired/prime_exl/keymaps/default/keymap.c | 143 +++++++++++++++++++++ .../handwired/prime_exl/keymaps/default/readme.md | 1 + keyboards/handwired/prime_exl/prime_exl.c | 43 +++++++ keyboards/handwired/prime_exl/prime_exl.h | 40 ++++++ keyboards/handwired/prime_exl/readme.md | 15 +++ keyboards/handwired/prime_exl/rules.mk | 80 ++++++++++++ 9 files changed, 409 insertions(+) create mode 100644 keyboards/handwired/prime_exl/config.h create mode 100644 keyboards/handwired/prime_exl/info.json create mode 100644 keyboards/handwired/prime_exl/keymaps/default/config.h create mode 100644 keyboards/handwired/prime_exl/keymaps/default/keymap.c create mode 100644 keyboards/handwired/prime_exl/keymaps/default/readme.md create mode 100644 keyboards/handwired/prime_exl/prime_exl.c create mode 100644 keyboards/handwired/prime_exl/prime_exl.h create mode 100644 keyboards/handwired/prime_exl/readme.md create mode 100644 keyboards/handwired/prime_exl/rules.mk diff --git a/keyboards/handwired/prime_exl/config.h b/keyboards/handwired/prime_exl/config.h new file mode 100644 index 0000000000..e34fbb8ccc --- /dev/null +++ b/keyboards/handwired/prime_exl/config.h @@ -0,0 +1,56 @@ +/* +Copyright 2018 Holten Campbell + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4024 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_EXL +#define DESCRIPTION Ergo + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 9 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { B1, E6, D5, D6, B4, D7, D4, F1, F0, B0 } +#define MATRIX_COL_PINS { D0, B3, B2, D1, D2, D3, F7, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 5 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/handwired/prime_exl/info.json b/keyboards/handwired/prime_exl/info.json new file mode 100644 index 0000000000..edab788607 --- /dev/null +++ b/keyboards/handwired/prime_exl/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Prime_EXL", + "url": "https://www.primekb.com", + "maintainer": "holtenc", + "width": 18, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0,"y":0,"w":1,"h":1}, {"x":1,"y":0,"w":1,"h":1}, {"x":2,"y":0,"w":1,"h":1}, {"x":3,"y":0,"w":1,"h":1}, {"x":4,"y":0,"w":1,"h":1}, {"x":5,"y":0,"w":1,"h":1}, {"x":6.5,"y":0,"w":1,"h":1}, {"x":7.5,"y":0,"w":1,"h":1}, {"x":8.5,"y":0,"w":1,"h":1}, {"x":9.5,"y":0,"w":1,"h":1}, {"x":10.5,"y":0,"w":1,"h":1}, {"x":11.5,"y":0,"w":1,"h":1}, {"x":13.75,"y":0,"w":1,"h":1}, {"x":14.75,"y":0,"w":1,"h":1}, {"x":15.75,"y":0,"w":1,"h":1}, {"x":16.75,"y":0,"w":1,"h":1}, {"x":17.75,"y":0,"w":1,"h":1}, {"x":18.75,"y":0,"w":2,"h":1}, {"x":0,"y":1,"w":1,"h":1}, {"x":1,"y":1,"w":1,"h":1}, {"x":2,"y":1,"w":1,"h":1}, {"x":3,"y":1,"w":1,"h":1}, {"x":4,"y":1,"w":1,"h":1}, {"x":5,"y":1,"w":1,"h":1}, {"x":6.5,"y":1,"w":1.26,"h":1}, {"x":7.75,"y":1,"w":1,"h":1}, {"x":8.75,"y":1,"w":1,"h":1}, {"x":9.75,"y":1,"w":1,"h":1}, {"x":10.75,"y":1,"w":1,"h":1}, {"x":11.75,"y":1,"w":1,"h":1}, {"x":14,"y":1,"w":1,"h":1}, {"x":15,"y":1,"w":1,"h":1}, {"x":16,"y":1,"w":1,"h":1}, {"x":17,"y":1,"w":1,"h":1}, {"x":18,"y":1,"w":1,"h":1}, {"x":19,"y":1,"w":1.75,"h":1}, {"x":0,"y":2,"w":1,"h":1}, {"x":1,"y":2,"w":1,"h":1}, {"x":2,"y":2,"w":1,"h":1}, {"x":3,"y":2,"w":1,"h":1}, {"x":4,"y":2,"w":1,"h":1}, {"x":5,"y":2,"w":1,"h":1}, {"x":6.5,"y":2,"w":1.75,"h":1}, {"x":8.25,"y":2,"w":1,"h":1}, {"x":9.25,"y":2,"w":1,"h":1}, {"x":10.25,"y":2,"w":1,"h":1}, {"x":11.25,"y":2,"w":1,"h":1}, {"x":12.25,"y":2,"w":1,"h":1}, {"x":13.5,"y":2,"w":1,"h":1}, {"x":14.5,"y":2,"w":1,"h":1}, {"x":15.5,"y":2,"w":1,"h":1}, {"x":16.5,"y":2,"w":1,"h":1}, {"x":17.5,"y":2,"w":1,"h":1}, {"x":18.5,"y":2,"w":1,"h":1}, {"x":19.5,"y":2,"w":1.25,"h":1}, {"x":0,"y":3,"w":1,"h":1}, {"x":1,"y":3,"w":1,"h":1}, {"x":2,"y":3,"w":1,"h":1}, {"x":3,"y":3,"w":1,"h":1}, {"x":4,"y":3,"w":1,"h":1}, {"x":5,"y":3,"w":1,"h":1}, {"x":6.5,"y":3,"w":1.25,"h":1}, {"x":7.75,"y":3,"w":1.25,"h":1}, {"x":9,"y":3,"w":1,"h":1}, {"x":10,"y":3,"w":1,"h":1}, {"x":11,"y":3,"w":2,"h":1}, {"x":13.5,"y":3,"w":2,"h":1}, {"x":15.5,"y":3,"w":1,"h":1}, {"x":16.5,"y":3,"w":1,"h":1}, {"x":17.5,"y":3,"w":1.5,"h":1}, {"x":19,"y":3,"w":1.5,"h":1}, {"x":0,"y":4,"w":1,"h":1}, {"x":1,"y":4,"w":1,"h":1}, {"x":2,"y":4,"w":1,"h":1}, {"x":3,"y":4,"w":1,"h":1}, {"x":4,"y":4,"w":1,"h":1}, {"x":5,"y":4,"w":1,"h":1}] + } + } +} diff --git a/keyboards/handwired/prime_exl/keymaps/default/config.h b/keyboards/handwired/prime_exl/keymaps/default/config.h new file mode 100644 index 0000000000..83bd38a81d --- /dev/null +++ b/keyboards/handwired/prime_exl/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Holten Campbell + * + * 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 + +// place overrides here diff --git a/keyboards/handwired/prime_exl/keymaps/default/keymap.c b/keyboards/handwired/prime_exl/keymaps/default/keymap.c new file mode 100644 index 0000000000..0e1c60d4aa --- /dev/null +++ b/keyboards/handwired/prime_exl/keymaps/default/keymap.c @@ -0,0 +1,143 @@ +/* Copyright 2018 Holten Campbell + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_NLCK, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, KC_BSPC, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(1), KC_SPC, KC_MINS, KC_EQL, KC_LGUI, MO(4), + KC_F7, KC_F8, TO(2), KC_PDOT, KC_P0, KC_PENT + ), + + [1] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [2] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_F9, KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, MO(3), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(5), KC_SPC, KC_MINS, KC_EQL, KC_LGUI, MO(4), + KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC + ), + + [3] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [4] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + + [5] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, KC_BSLS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + // set CapsLock LED to output and low + DDRC |= (1 << 6); + PORTC &= ~(1 << 6); + // set NumLock LED to output and low + DDRB |= (1 << 6); + PORTB &= ~(1 << 6); + // set ScrollLock LED to output and low + DDRB |= (1 << 5); + PORTB &= ~(1 << 5); +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1<. + */ +#include "prime_exl.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/prime_exl/prime_exl.h b/keyboards/handwired/prime_exl/prime_exl.h new file mode 100644 index 0000000000..727db5db8d --- /dev/null +++ b/keyboards/handwired/prime_exl/prime_exl.h @@ -0,0 +1,40 @@ +/* Copyright 2018 Holten Campbell + * + * 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 . + */ +#ifndef PRIME_EXL_H +#define PRIME_EXL_H + +#include "quantum.h" + +#define LAYOUT( \ + K040, K050, K041, K051, K042, K052, K043, K053, K044, K054, K045, K055, K046, K056, K047, K057, K048, K058, \ + K030, K060, K031, K061, K032, K062, K033, K063, K034, K064, K035, K065, K036, K066, K037, K067, K038, K068, \ + K020, K070, K021, K071, K022, K072, K023, K073, K024, K074, K025, K075, K085, K026, K076, K027, K077, K028, K078, \ + K010, K080, K011, K081, K012, K082, K013, K083, K014, K084, K015, K016, K086, K017, K087, K018, \ + K000, K090, K001, K091, K002, K092 \ +) { \ + { K000, K001, K002, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K010, K011, K012, K013, K014, K015, K016, K017, K018 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027, K028 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037, K038 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047, K048 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057, K058 }, \ + { K060, K061, K062, K063, K064, K065, K066, K067, K068 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077, K078 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087, KC_NO }, \ + { K090, K091, K092, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#endif \ No newline at end of file diff --git a/keyboards/handwired/prime_exl/readme.md b/keyboards/handwired/prime_exl/readme.md new file mode 100644 index 0000000000..f99cba004d --- /dev/null +++ b/keyboards/handwired/prime_exl/readme.md @@ -0,0 +1,15 @@ +# Prime_EXL + +![Prime_EXL](https://i.imgur.com/3t524g8.jpg) + +An ergonomic 45% keyboard with a macro/numpad added to the left side. + +Keyboard Maintainer: [Holtenc](https://github.com/holtenc/) +Hardware Supported: Prime_EXL PCB, ATMega32u4 +Hardware Availability: Prototype + +Make example for this keyboard (after setting up your build environment): + + make handwired/prime_exl: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/handwired/prime_exl/rules.mk b/keyboards/handwired/prime_exl/rules.mk new file mode 100644 index 0000000000..5cce4e8113 --- /dev/null +++ b/keyboards/handwired/prime_exl/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # 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) -- cgit v1.2.3 From 14be5258a6784829b6931f348fc20d64e1a5f2a7 Mon Sep 17 00:00:00 2001 From: Rys Sommefeldt Date: Thu, 20 Sep 2018 00:23:23 +0100 Subject: Keymap: rys Tada68 ISO UK layout (#3934) * rys Tada68 ISO UK layout * Bring _FL more in line with my favoute WhiteFox layout * Whoops, fix - to _ * remove empty config.h * Remove legacy block --- keyboards/tada68/keymaps/rys/keymap.c | 50 ++++++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/rys/readme.md | 15 ++++++++++ keyboards/tada68/keymaps/rys/rules.mk | 17 ++++++++++++ 3 files changed, 82 insertions(+) create mode 100644 keyboards/tada68/keymaps/rys/keymap.c create mode 100644 keyboards/tada68/keymaps/rys/readme.md create mode 100644 keyboards/tada68/keymaps/rys/rules.mk diff --git a/keyboards/tada68/keymaps/rys/keymap.c b/keyboards/tada68/keymaps/rys/keymap.c new file mode 100644 index 0000000000..6f32b092d4 --- /dev/null +++ b/keyboards/tada68/keymaps/rys/keymap.c @@ -0,0 +1,50 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| |Del | + * |------------------------------------------------------- -----| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #|Entr|PgUp| + * |----------------------------------------------------------------| + * |Shift| \ | Z| X| C| V| B| N| M| ,| .| /|Rshift|Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_iso( + KC_ESC, 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_GRV, \ + 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_NUHS, KC_DEL, \ + 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_PGUP, \ + 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_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + /* Keymap _FL1: Function Layer 1 + * ,----------------------------------------------------------------. + * | | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Delete| Ins| + * |----------------------------------------------------------------| + * | | | ↑ | | | | | | | | | | | |Home| + * |------------------------------------------------------- -----| + * | | ← | ↓ | → | | | | | | | | | | | End| + * |----------------------------------------------------------------| + * | | | | | L+|LED| L-| | V+| V-|Mut| | MsBtn|Up|MsBn| + * |----------------------------------------------------------------| + * | | | | | | | | Lt| Dn| Rt | + * `----------------------------------------------------------------' + */ + [_FL] = LAYOUT_iso( + _______, 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_BTN1, KC_UP, KC_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, \ + _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, KC_VOLU, KC_VOLD, KC_MUTE, _______, _______, KC_MS_U, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R + ), +}; diff --git a/keyboards/tada68/keymaps/rys/readme.md b/keyboards/tada68/keymaps/rys/readme.md new file mode 100644 index 0000000000..a9425bf067 --- /dev/null +++ b/keyboards/tada68/keymaps/rys/readme.md @@ -0,0 +1,15 @@ +# Custom Tada68 layout for ISO UK with Apple-y tweaks + +This layout is based on the [ISO UK](../iso-uk) layout, with the following +changes: + +Swap Win and Alt on the left side (Option and Command on macOS) + +## Installation + +Please see the [Tada68 readme](../../readme.md). Make the firmware wih the +following command: + +``` +make tada68:rys:bin +``` diff --git a/keyboards/tada68/keymaps/rys/rules.mk b/keyboards/tada68/keymaps/rys/rules.mk new file mode 100644 index 0000000000..1915481bf9 --- /dev/null +++ b/keyboards/tada68/keymaps/rys/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 -- cgit v1.2.3 From 5b4bcfa7f2530ad12ef801101933aba6ac46acb2 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 19 Sep 2018 16:25:58 -0700 Subject: Keyboard: Move Bathroom Epiphany boards into its own directory (#3936) * make bpiphany directory with simple readme file * move unloved_bastard to bpiphany directory * move frosty_flake to bpiphany directory * move pegasushoof to bpiphany directory * move tiger_lily to bpiphany directory * add a little more info to readme * move kitten_paw to bpiphany directory * update make instructions * update intro text * add missing routines to matrix.c of unloved_bastard * add missing routines --- keyboards/bpiphany/frosty_flake/config.h | 147 +++++++++++++ keyboards/bpiphany/frosty_flake/frosty_flake.c | 63 ++++++ keyboards/bpiphany/frosty_flake/frosty_flake.h | 106 +++++++++ .../bpiphany/frosty_flake/keymaps/QFR_JM/config.h | 11 + .../bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c | 132 +++++++++++ .../bpiphany/frosty_flake/keymaps/QFR_JM/readme.md | 86 ++++++++ .../bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk | 17 ++ .../bpiphany/frosty_flake/keymaps/default/config.h | 8 + .../bpiphany/frosty_flake/keymaps/default/keymap.c | 11 + .../frosty_flake/keymaps/default/readme.md | 1 + .../bpiphany/frosty_flake/keymaps/default/rules.mk | 21 ++ .../bpiphany/frosty_flake/keymaps/nikchi/config.h | 23 ++ .../bpiphany/frosty_flake/keymaps/nikchi/keymap.c | 228 +++++++++++++++++++ .../bpiphany/frosty_flake/keymaps/nikchi/readme.md | 24 ++ .../bpiphany/frosty_flake/keymaps/nikchi/rules.mk | 24 ++ .../keymaps/nikchi/variableTapDance.md | 9 + .../bpiphany/frosty_flake/keymaps/tkl/config.h | 8 + .../bpiphany/frosty_flake/keymaps/tkl/keymap.c | 11 + .../bpiphany/frosty_flake/keymaps/tkl/readme.md | 1 + .../bpiphany/frosty_flake/keymaps/tkl/rules.mk | 17 ++ keyboards/bpiphany/frosty_flake/matrix.c | 155 +++++++++++++ keyboards/bpiphany/frosty_flake/readme.md | 43 ++++ keyboards/bpiphany/frosty_flake/rules.mk | 73 +++++++ keyboards/bpiphany/kitten_paw/config.h | 162 ++++++++++++++ keyboards/bpiphany/kitten_paw/info.json | 18 ++ .../bpiphany/kitten_paw/keymaps/default/keymap.c | 51 +++++ .../bpiphany/kitten_paw/keymaps/ickerwx/config.h | 31 +++ .../bpiphany/kitten_paw/keymaps/ickerwx/keymap.c | 242 +++++++++++++++++++++ .../bpiphany/kitten_paw/keymaps/ickerwx/readme.md | 18 ++ keyboards/bpiphany/kitten_paw/kitten_paw.c | 51 +++++ keyboards/bpiphany/kitten_paw/kitten_paw.h | 77 +++++++ keyboards/bpiphany/kitten_paw/matrix.c | 183 ++++++++++++++++ keyboards/bpiphany/kitten_paw/readme.md | 16 ++ keyboards/bpiphany/kitten_paw/rules.mk | 74 +++++++ keyboards/bpiphany/pegasushoof/README.md | 12 + keyboards/bpiphany/pegasushoof/config.h | 46 ++++ .../bpiphany/pegasushoof/keymaps/blowrak/keymap.c | 112 ++++++++++ .../bpiphany/pegasushoof/keymaps/blowrak/rules.mk | 22 ++ .../bpiphany/pegasushoof/keymaps/citadel/config.h | 11 + .../bpiphany/pegasushoof/keymaps/citadel/keymap.c | 128 +++++++++++ .../bpiphany/pegasushoof/keymaps/citadel/readme.md | 75 +++++++ .../bpiphany/pegasushoof/keymaps/citadel/rules.mk | 22 ++ .../bpiphany/pegasushoof/keymaps/default/keymap.c | 60 +++++ .../bpiphany/pegasushoof/keymaps/default/rules.mk | 22 ++ keyboards/bpiphany/pegasushoof/matrix.c | 222 +++++++++++++++++++ keyboards/bpiphany/pegasushoof/pegasushoof.c | 59 +++++ keyboards/bpiphany/pegasushoof/pegasushoof.h | 51 +++++ keyboards/bpiphany/pegasushoof/rules.mk | 67 ++++++ keyboards/bpiphany/readme.md | 6 + keyboards/bpiphany/tiger_lily/config.h | 147 +++++++++++++ keyboards/bpiphany/tiger_lily/info.json | 15 ++ .../bpiphany/tiger_lily/keymaps/default/config.h | 8 + .../bpiphany/tiger_lily/keymaps/default/keymap.c | 11 + .../bpiphany/tiger_lily/keymaps/default/readme.md | 1 + .../bpiphany/tiger_lily/keymaps/default/rules.mk | 21 ++ .../tiger_lily/keymaps/default_ansi/config.h | 8 + .../tiger_lily/keymaps/default_ansi/keymap.c | 11 + .../tiger_lily/keymaps/default_ansi/readme.md | 3 + .../tiger_lily/keymaps/default_ansi/rules.mk | 21 ++ keyboards/bpiphany/tiger_lily/matrix.c | 155 +++++++++++++ keyboards/bpiphany/tiger_lily/readme.md | 16 ++ keyboards/bpiphany/tiger_lily/rules.mk | 73 +++++++ keyboards/bpiphany/tiger_lily/tiger_lily.c | 63 ++++++ keyboards/bpiphany/tiger_lily/tiger_lily.h | 71 ++++++ keyboards/bpiphany/unloved_bastard/config.h | 168 ++++++++++++++ keyboards/bpiphany/unloved_bastard/info.json | 16 ++ .../unloved_bastard/keymaps/default/config.h | 24 ++ .../unloved_bastard/keymaps/default/keymap.c | 63 ++++++ .../unloved_bastard/keymaps/default/readme.md | 1 + .../unloved_bastard/keymaps/default_ansi/config.h | 24 ++ .../unloved_bastard/keymaps/default_ansi/keymap.c | 63 ++++++ .../unloved_bastard/keymaps/default_ansi/readme.md | 3 + keyboards/bpiphany/unloved_bastard/matrix.c | 156 +++++++++++++ keyboards/bpiphany/unloved_bastard/readme.md | 15 ++ keyboards/bpiphany/unloved_bastard/rules.mk | 73 +++++++ .../bpiphany/unloved_bastard/unloved_bastard.c | 70 ++++++ .../bpiphany/unloved_bastard/unloved_bastard.h | 63 ++++++ keyboards/frosty_flake/config.h | 147 ------------- keyboards/frosty_flake/frosty_flake.c | 63 ------ keyboards/frosty_flake/frosty_flake.h | 106 --------- keyboards/frosty_flake/keymaps/QFR_JM/config.h | 11 - keyboards/frosty_flake/keymaps/QFR_JM/keymap.c | 132 ----------- keyboards/frosty_flake/keymaps/QFR_JM/readme.md | 86 -------- keyboards/frosty_flake/keymaps/QFR_JM/rules.mk | 17 -- keyboards/frosty_flake/keymaps/default/config.h | 8 - keyboards/frosty_flake/keymaps/default/keymap.c | 11 - keyboards/frosty_flake/keymaps/default/readme.md | 1 - keyboards/frosty_flake/keymaps/default/rules.mk | 21 -- keyboards/frosty_flake/keymaps/nikchi/config.h | 23 -- keyboards/frosty_flake/keymaps/nikchi/keymap.c | 228 ------------------- keyboards/frosty_flake/keymaps/nikchi/readme.md | 24 -- keyboards/frosty_flake/keymaps/nikchi/rules.mk | 24 -- .../keymaps/nikchi/variableTapDance.md | 9 - keyboards/frosty_flake/keymaps/tkl/config.h | 8 - keyboards/frosty_flake/keymaps/tkl/keymap.c | 11 - keyboards/frosty_flake/keymaps/tkl/readme.md | 1 - keyboards/frosty_flake/keymaps/tkl/rules.mk | 17 -- keyboards/frosty_flake/matrix.c | 137 ------------ keyboards/frosty_flake/readme.md | 46 ---- keyboards/frosty_flake/rules.mk | 73 ------- keyboards/kitten_paw/config.h | 162 -------------- keyboards/kitten_paw/info.json | 18 -- keyboards/kitten_paw/keymaps/default/keymap.c | 51 ----- keyboards/kitten_paw/keymaps/ickerwx/config.h | 31 --- keyboards/kitten_paw/keymaps/ickerwx/keymap.c | 242 --------------------- keyboards/kitten_paw/keymaps/ickerwx/readme.md | 18 -- keyboards/kitten_paw/kitten_paw.c | 51 ----- keyboards/kitten_paw/kitten_paw.h | 77 ------- keyboards/kitten_paw/matrix.c | 165 -------------- keyboards/kitten_paw/readme.md | 16 -- keyboards/kitten_paw/rules.mk | 74 ------- keyboards/pegasushoof/README.md | 12 - keyboards/pegasushoof/config.h | 46 ---- keyboards/pegasushoof/keymaps/blowrak/keymap.c | 112 ---------- keyboards/pegasushoof/keymaps/blowrak/rules.mk | 22 -- keyboards/pegasushoof/keymaps/citadel/config.h | 11 - keyboards/pegasushoof/keymaps/citadel/keymap.c | 128 ----------- keyboards/pegasushoof/keymaps/citadel/readme.md | 75 ------- keyboards/pegasushoof/keymaps/citadel/rules.mk | 22 -- keyboards/pegasushoof/keymaps/default/keymap.c | 60 ----- keyboards/pegasushoof/keymaps/default/rules.mk | 22 -- keyboards/pegasushoof/matrix.c | 204 ----------------- keyboards/pegasushoof/pegasushoof.c | 59 ----- keyboards/pegasushoof/pegasushoof.h | 51 ----- keyboards/pegasushoof/rules.mk | 67 ------ keyboards/tiger_lily/config.h | 147 ------------- keyboards/tiger_lily/info.json | 15 -- keyboards/tiger_lily/keymaps/default/config.h | 8 - keyboards/tiger_lily/keymaps/default/keymap.c | 11 - keyboards/tiger_lily/keymaps/default/readme.md | 1 - keyboards/tiger_lily/keymaps/default/rules.mk | 21 -- keyboards/tiger_lily/keymaps/default_ansi/config.h | 8 - keyboards/tiger_lily/keymaps/default_ansi/keymap.c | 11 - .../tiger_lily/keymaps/default_ansi/readme.md | 3 - keyboards/tiger_lily/keymaps/default_ansi/rules.mk | 21 -- keyboards/tiger_lily/matrix.c | 137 ------------ keyboards/tiger_lily/readme.md | 16 -- keyboards/tiger_lily/rules.mk | 73 ------- keyboards/tiger_lily/tiger_lily.c | 63 ------ keyboards/tiger_lily/tiger_lily.h | 71 ------ keyboards/unloved_bastard/config.h | 168 -------------- keyboards/unloved_bastard/info.json | 16 -- keyboards/unloved_bastard/keymaps/default/config.h | 24 -- keyboards/unloved_bastard/keymaps/default/keymap.c | 63 ------ .../unloved_bastard/keymaps/default/readme.md | 1 - .../unloved_bastard/keymaps/default_ansi/config.h | 24 -- .../unloved_bastard/keymaps/default_ansi/keymap.c | 63 ------ .../unloved_bastard/keymaps/default_ansi/readme.md | 3 - keyboards/unloved_bastard/matrix.c | 138 ------------ keyboards/unloved_bastard/readme.md | 15 -- keyboards/unloved_bastard/rules.mk | 73 ------- keyboards/unloved_bastard/unloved_bastard.c | 70 ------ keyboards/unloved_bastard/unloved_bastard.h | 63 ------ 153 files changed, 4420 insertions(+), 4327 deletions(-) create mode 100644 keyboards/bpiphany/frosty_flake/config.h create mode 100644 keyboards/bpiphany/frosty_flake/frosty_flake.c create mode 100644 keyboards/bpiphany/frosty_flake/frosty_flake.h create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/readme.md create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/default/config.h create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/default/readme.md create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/nikchi/readme.md create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/nikchi/variableTapDance.md create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/tkl/readme.md create mode 100644 keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk create mode 100644 keyboards/bpiphany/frosty_flake/matrix.c create mode 100644 keyboards/bpiphany/frosty_flake/readme.md create mode 100644 keyboards/bpiphany/frosty_flake/rules.mk create mode 100644 keyboards/bpiphany/kitten_paw/config.h create mode 100644 keyboards/bpiphany/kitten_paw/info.json create mode 100644 keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c create mode 100644 keyboards/bpiphany/kitten_paw/keymaps/ickerwx/config.h create mode 100644 keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c create mode 100644 keyboards/bpiphany/kitten_paw/keymaps/ickerwx/readme.md create mode 100644 keyboards/bpiphany/kitten_paw/kitten_paw.c create mode 100644 keyboards/bpiphany/kitten_paw/kitten_paw.h create mode 100644 keyboards/bpiphany/kitten_paw/matrix.c create mode 100644 keyboards/bpiphany/kitten_paw/readme.md create mode 100644 keyboards/bpiphany/kitten_paw/rules.mk create mode 100644 keyboards/bpiphany/pegasushoof/README.md create mode 100644 keyboards/bpiphany/pegasushoof/config.h create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/citadel/readme.md create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk create mode 100644 keyboards/bpiphany/pegasushoof/matrix.c create mode 100644 keyboards/bpiphany/pegasushoof/pegasushoof.c create mode 100644 keyboards/bpiphany/pegasushoof/pegasushoof.h create mode 100644 keyboards/bpiphany/pegasushoof/rules.mk create mode 100644 keyboards/bpiphany/readme.md create mode 100644 keyboards/bpiphany/tiger_lily/config.h create mode 100644 keyboards/bpiphany/tiger_lily/info.json create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default/config.h create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default/keymap.c create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default/readme.md create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default_ansi/config.h create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default_ansi/keymap.c create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default_ansi/readme.md create mode 100644 keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk create mode 100644 keyboards/bpiphany/tiger_lily/matrix.c create mode 100644 keyboards/bpiphany/tiger_lily/readme.md create mode 100644 keyboards/bpiphany/tiger_lily/rules.mk create mode 100644 keyboards/bpiphany/tiger_lily/tiger_lily.c create mode 100644 keyboards/bpiphany/tiger_lily/tiger_lily.h create mode 100644 keyboards/bpiphany/unloved_bastard/config.h create mode 100644 keyboards/bpiphany/unloved_bastard/info.json create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default/config.h create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default/readme.md create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/config.h create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c create mode 100644 keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/readme.md create mode 100644 keyboards/bpiphany/unloved_bastard/matrix.c create mode 100644 keyboards/bpiphany/unloved_bastard/readme.md create mode 100644 keyboards/bpiphany/unloved_bastard/rules.mk create mode 100644 keyboards/bpiphany/unloved_bastard/unloved_bastard.c create mode 100644 keyboards/bpiphany/unloved_bastard/unloved_bastard.h delete mode 100644 keyboards/frosty_flake/config.h delete mode 100644 keyboards/frosty_flake/frosty_flake.c delete mode 100644 keyboards/frosty_flake/frosty_flake.h delete mode 100644 keyboards/frosty_flake/keymaps/QFR_JM/config.h delete mode 100644 keyboards/frosty_flake/keymaps/QFR_JM/keymap.c delete mode 100644 keyboards/frosty_flake/keymaps/QFR_JM/readme.md delete mode 100644 keyboards/frosty_flake/keymaps/QFR_JM/rules.mk delete mode 100644 keyboards/frosty_flake/keymaps/default/config.h delete mode 100644 keyboards/frosty_flake/keymaps/default/keymap.c delete mode 100644 keyboards/frosty_flake/keymaps/default/readme.md delete mode 100644 keyboards/frosty_flake/keymaps/default/rules.mk delete mode 100644 keyboards/frosty_flake/keymaps/nikchi/config.h delete mode 100644 keyboards/frosty_flake/keymaps/nikchi/keymap.c delete mode 100644 keyboards/frosty_flake/keymaps/nikchi/readme.md delete mode 100644 keyboards/frosty_flake/keymaps/nikchi/rules.mk delete mode 100644 keyboards/frosty_flake/keymaps/nikchi/variableTapDance.md delete mode 100644 keyboards/frosty_flake/keymaps/tkl/config.h delete mode 100644 keyboards/frosty_flake/keymaps/tkl/keymap.c delete mode 100644 keyboards/frosty_flake/keymaps/tkl/readme.md delete mode 100644 keyboards/frosty_flake/keymaps/tkl/rules.mk delete mode 100644 keyboards/frosty_flake/matrix.c delete mode 100644 keyboards/frosty_flake/readme.md delete mode 100644 keyboards/frosty_flake/rules.mk delete mode 100644 keyboards/kitten_paw/config.h delete mode 100644 keyboards/kitten_paw/info.json delete mode 100644 keyboards/kitten_paw/keymaps/default/keymap.c delete mode 100644 keyboards/kitten_paw/keymaps/ickerwx/config.h delete mode 100644 keyboards/kitten_paw/keymaps/ickerwx/keymap.c delete mode 100644 keyboards/kitten_paw/keymaps/ickerwx/readme.md delete mode 100644 keyboards/kitten_paw/kitten_paw.c delete mode 100644 keyboards/kitten_paw/kitten_paw.h delete mode 100644 keyboards/kitten_paw/matrix.c delete mode 100644 keyboards/kitten_paw/readme.md delete mode 100644 keyboards/kitten_paw/rules.mk delete mode 100644 keyboards/pegasushoof/README.md delete mode 100644 keyboards/pegasushoof/config.h delete mode 100644 keyboards/pegasushoof/keymaps/blowrak/keymap.c delete mode 100644 keyboards/pegasushoof/keymaps/blowrak/rules.mk delete mode 100644 keyboards/pegasushoof/keymaps/citadel/config.h delete mode 100644 keyboards/pegasushoof/keymaps/citadel/keymap.c delete mode 100644 keyboards/pegasushoof/keymaps/citadel/readme.md delete mode 100644 keyboards/pegasushoof/keymaps/citadel/rules.mk delete mode 100644 keyboards/pegasushoof/keymaps/default/keymap.c delete mode 100644 keyboards/pegasushoof/keymaps/default/rules.mk delete mode 100644 keyboards/pegasushoof/matrix.c delete mode 100644 keyboards/pegasushoof/pegasushoof.c delete mode 100644 keyboards/pegasushoof/pegasushoof.h delete mode 100644 keyboards/pegasushoof/rules.mk delete mode 100644 keyboards/tiger_lily/config.h delete mode 100644 keyboards/tiger_lily/info.json delete mode 100644 keyboards/tiger_lily/keymaps/default/config.h delete mode 100644 keyboards/tiger_lily/keymaps/default/keymap.c delete mode 100644 keyboards/tiger_lily/keymaps/default/readme.md delete mode 100644 keyboards/tiger_lily/keymaps/default/rules.mk delete mode 100644 keyboards/tiger_lily/keymaps/default_ansi/config.h delete mode 100644 keyboards/tiger_lily/keymaps/default_ansi/keymap.c delete mode 100644 keyboards/tiger_lily/keymaps/default_ansi/readme.md delete mode 100644 keyboards/tiger_lily/keymaps/default_ansi/rules.mk delete mode 100644 keyboards/tiger_lily/matrix.c delete mode 100644 keyboards/tiger_lily/readme.md delete mode 100644 keyboards/tiger_lily/rules.mk delete mode 100644 keyboards/tiger_lily/tiger_lily.c delete mode 100644 keyboards/tiger_lily/tiger_lily.h delete mode 100644 keyboards/unloved_bastard/config.h delete mode 100644 keyboards/unloved_bastard/info.json delete mode 100644 keyboards/unloved_bastard/keymaps/default/config.h delete mode 100644 keyboards/unloved_bastard/keymaps/default/keymap.c delete mode 100644 keyboards/unloved_bastard/keymaps/default/readme.md delete mode 100644 keyboards/unloved_bastard/keymaps/default_ansi/config.h delete mode 100644 keyboards/unloved_bastard/keymaps/default_ansi/keymap.c delete mode 100644 keyboards/unloved_bastard/keymaps/default_ansi/readme.md delete mode 100644 keyboards/unloved_bastard/matrix.c delete mode 100644 keyboards/unloved_bastard/readme.md delete mode 100644 keyboards/unloved_bastard/rules.mk delete mode 100644 keyboards/unloved_bastard/unloved_bastard.c delete mode 100644 keyboards/unloved_bastard/unloved_bastard.h diff --git a/keyboards/bpiphany/frosty_flake/config.h b/keyboards/bpiphany/frosty_flake/config.h new file mode 100644 index 0000000000..2c73f10743 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/config.h @@ -0,0 +1,147 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Bathroom Epiphanies +#define PRODUCT frosty_flake +#define DESCRIPTION Frosty Flake controller for the CM Storm Quick Fire Rapid + +/* + * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies + * Ported from the Bathroom Epiphanies TMK Firmware: + * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers + * + */ + +/* key matrix size */ +#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic +#define MATRIX_COLS 18 // ColA - ColR in the schematic + +/* + * Keyboard Matrix Assignments + */ +#define UNUSED_PINS { B0, C4, D3 } + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/bpiphany/frosty_flake/frosty_flake.c b/keyboards/bpiphany/frosty_flake/frosty_flake.c new file mode 100644 index 0000000000..1cd4760389 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/frosty_flake.c @@ -0,0 +1,63 @@ +#include "frosty_flake.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + DDRB |= (1<<7); + DDRC |= (1<<5) | (1<<6); + + print_dec(usb_led); + + if (usb_led & (1<event.pressed) { // pointer + SEND_STRING("<- "); +// return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); + } + break; + case R_PIPE: + if (record->event.pressed) { // dplyr pipe + SEND_STRING("%>% "); +// return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); + } + break; + } + return MACRO_NONE; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/readme.md b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/readme.md new file mode 100644 index 0000000000..f12a0ffba1 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/readme.md @@ -0,0 +1,86 @@ + +# TKL keymap for frosty\_flake +``` +make frosty_flake:QFR_JM + +dfu-programmer atmega32u2 erase +dfu-programmer atmega32u2 flash frosty_flake_QFR_JM.hex +dfu-programmer atmega32u2 start +``` + +##Layers +``` + ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. + |ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 |F10 |F11 |F12 | |PrSc|ScLk|PsBk| + '----' '-------------------' '-------------------' '-------------------' '--------------' + ,-------------------------------------------------------------------------. ,--------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bspc | | Ins|Home|PgUp| + |-------------------------------------------------------------------------| |--------------| + | Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | | Del|End |PgDn| + |-------------------------------------------------------------------------| '--------------' + | Bspc | A | R | S | T | D | H | N | E | I | O | ' | Enter | + |-------------------------------------------------------------------------| ,----. + | LSPO | Z | X | C | V | B | K | M | , | . | / | RSPC | | Up | + |-------------------------------------------------------------------------| ,--------------. + |Ctrl|LGUI|LAlt| Space/Lower |MSE |RGUI|Menu|Ctrl| |Left|Down|Rght| + '-------------------------------------------------------------------------' '--------------' + +``` +### Base Layer - Colemak +The base layout is Colemak by default, but this can be changed to QWERTY via the *LOWER* layer. +* I've implemented COLEMAK = SAFE\_RANGE when enumerating the custom\_keycodes, but I don't actually know what this does... + +* Space cadet is implemented in the shift keys (hold for shift, tap for respective parentheses) + +#### Layer Shifting +* The spacebar is a **TAP_KEY** macro - Hold for momentary *LOWER* layer, Tap for Space. +* The Right hand ALT key is a **TAP_TOGGLE** macro for the *MOUSE* layer (RAlt is accessible through LOWER, if you want...) + +### LOWER +``` + ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. + |ESC | | F1 | F2 | F3 | F4 | |>/|||Stop| << | >> | | F9 |MUTE|Vol-|Vol+| |QWTY|CLMK|PsBk| + '----' '-------------------' '-------------------' '-------------------' '--------------' + ,-------------------------------------------------------------------------. ,--------------. + | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | Bspc | | Ins|Home|PgUp| + |-------------------------------------------------------------------------| |--------------| + | Tab |PgUp|Home| Up | End| | | | | | | { | } | | | | Del|End |PgDn| + |-------------------------------------------------------------------------| '--------------' + | Bckspc|PgDn|Left|Down|Rght| | | | | | | ' | Enter | + |-------------------------------------------------------------------------| ,----. + | LSPO | <- |%>% | { | [ | ` | | | ] | } | . | / | RSPC | | Up | + |-------------------------------------------------------------------------| ,--------------. + |Ctrl|LGUI|LAlt| |RAlt|RGUI|Menu|Ctrl| |Left|Down|Rght| + '-------------------------------------------------------------------------' '--------------' +``` +The *LOWER* layer contains a navigation cluster on the left hand. This layer is momentary when the spacebar or LOWER (RAlt) key is held and toggled on/off when the LOWER key is tapped. + +* The Navigation cluster is offset to the right compared to the traditional **WASD** nav cluster. With this implementation, you don't need to move your hand from the home position when navigating. Page Up & Down keys are found on the far left of the cluster. + +* All unused (blank on the above keymap) keys are locked out using the XXXXXXX filler (KC\_NO), all modifiers (edge |\_| keys \[except 0, \. & Fn\] on the above keymap) and the ZXCV cluster are transparent (\_\_\_\_\_\_\_) to the Base layer. + +* The base layer can be switched to QWERTY or COLEMAK by pressing the Pause Break or Scroll Lock keys respectively + +### MOUSE +``` + ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. + |ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 |F10 |F11 |F12 | |PrSc|ScLk|PsBk| + '----' '-------------------' '-------------------' '-------------------' '--------------' + ,-------------------------------------------------------------------------. ,--------------. + | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Del | | Ins|Home|PgUp| + |-------------------------------------------------------------------------| |--------------| + | Tab | WhU| WhL| MsU| WhR| | | M3 | M4 | M5 | | [ | ] | \ | | Del|End |PgDn| + |-------------------------------------------------------------------------| '--------------' + | BSPC | WhD| MsL| MsD| MsR| | |LClk |RClk | | | ' | Enter | + |-------------------------------------------------------------------------| ,----. + | LSPO | Z | X | C | V | | | | , | . | / | RSPC | | Up | + |-------------------------------------------------------------------------| ,--------------. + |Ctrl|LGUI|LAlt| Accel ++ |MSE |RGUI|Menu|Ctrl| |Left|Down|Rght| + '-------------------------------------------------------------------------' '--------------' +``` +The *MOUSE* layer contains keys replicating functions found on the mouse. + +* The navigation cluster (Up, Down, Left, Right) is a replication of the Navigation cluster on the *LOWER* layer. The scroll keys are analagous to the Page Up & Downkeys. +* The primary click (right & left) buttons are on the right home row (index & middle fingers) +* Secondary click buttons are above the standard keys (M3/Wheel click, M4, M5) but I do not use this function. + diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk new file mode 100644 index 0000000000..0ae0b96462 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk @@ -0,0 +1,17 @@ +# 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 = 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 +NKRO_ENABLE = no # 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 controls +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 diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/config.h b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h new file mode 100644 index 0000000000..8893d122e0 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c new file mode 100644 index 0000000000..4dc7ed655f --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c @@ -0,0 +1,11 @@ +#include "frosty_flake.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP(\ + 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_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_PPLS, \ + 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_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_P1, KC_P2, KC_P3,KC_PENT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) +}; \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/readme.md b/keyboards/bpiphany/frosty_flake/keymaps/default/readme.md new file mode 100644 index 0000000000..11bf4825ff --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for frosty_flake diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk new file mode 100644 index 0000000000..9d3df5964f --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h new file mode 100644 index 0000000000..3f78526437 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h @@ -0,0 +1,23 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define TAPPING_TERM 200 +#define LEADER_TIMEOUT 800 + +#define DISABLE_SPACE_CADET_ROLLOVER + +#define UNICODE_TYPE_DELAY 0 + +#define LSPO_KEY KC_9 +#define RSPC_KEY KC_0 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 +// place overrides here + +#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c new file mode 100644 index 0000000000..bf7c5e5883 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c @@ -0,0 +1,228 @@ +#include "frosty_flake.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "process_unicode.h" +#include "process_unicodemap.h" +#include "quantum.h" + +#define _______ KC_TRNS +#define MAXEMOJITAPS 80 + + +//declarations for tap dancing emojis +void register_hex32(uint32_t hex); +void cycleEmojis(qk_tap_dance_state_t *state, void *user_data); +void cycleAnimals(qk_tap_dance_state_t *state, void *user_data); +void cycleFoods(qk_tap_dance_state_t *state, void *user_data); +void cycleEtc(qk_tap_dance_state_t *state, void *user_data); +void cycleAll(qk_tap_dance_state_t *state, void *user_data); + +void tap(uint16_t keycode){ + register_code(keycode); + unregister_code(keycode); +}; + +//Tap Dance Declarations +enum taps{ + TD_CTCPS = 0, + EMOJIS, + ANIMAL, + HAND, + MEMES, + COPA, + ALLS +}; + +enum unicode_name { + EMOTIS = 1,//80, //1F60x - 1F64x + ANIMALS, //64, //1F40x - 1F43x + SYMBOLS,// = 45, //1F300 - 1F32C + FOODS,// = 87 , //1F32D - + ETC,// = 192, //1F44x -1F4Fx + VEHICLES,// = 83, //1F68x - 1F6Dx + SUPPLEMENT,// = 32, //1F91x-1F92x + ALCHEMY,// = 116 //1F70x - 1F773 + +}; + +enum my_macros { + NEWDESK = 0, + LEFTDESK, + RIGHTDESK, + CLOSEDESK +}; + + +// Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + // Tap once for CTRL, twice for Caps Lock + [TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS), + [COPA] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_C), LCTL(KC_V)), + [EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEmojis, NULL, NULL, 800), + [ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAnimals, NULL, NULL, 800), + //[SYMBOLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSymbols, NULL, NULL, 800), + [FOODS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleFoods, NULL, NULL, 800), + [ETC] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEtc, NULL, NULL, 800), + //[VEHICLES] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleVehicles, NULL, NULL, 800), + //[SUPPLEMENT] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSupplement, NULL, NULL, 800), + [ALLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAll, NULL, NULL, 800) +// Other declarations would go here, separated by commas, if you have them +}; + +// macros +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case NEWDESK: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(1), D(LGUI), D(LCTL), D(D), U(LGUI), U(LCTL), U(D), END ); // NEW DESKTOP + } + break; + case LEFTDESK: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(1), D(LGUI), D(LCTL), D(LEFT), U(LGUI), U(LCTL), U(LEFT), END ); // LEFT DESKTOP + } + break; + case RIGHTDESK: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(1), D(LGUI), D(LCTL), D(RGHT), U(LGUI), U(LCTL), U(RGHT), END ); // RIGHT DESKTOP + } + break; + case CLOSEDESK: // this would trigger when you hit a key mapped as M(0) + if (record->event.pressed) { + return MACRO( I(1), D(LGUI), D(LCTL), D(F4), U(LGUI), U(LCTL), U(F4), END ); // CLOSE DESKTOP + } + break; + } + return MACRO_NONE; +}; + + +// emojis in unicode +const uint32_t PROGMEM unicode_map[] = { + [EMOTIS] = 0x1F600, + [ANIMALS] = 0x1F400, + [SYMBOLS] = 0x1F300, + [FOODS] = 0x1F32D, + [ETC] = 0x1F440, + [VEHICLES] = 0x1F680, + [SUPPLEMENT] = 0x1F910, + [ALCHEMY] = 0x1F700 + }; +// Layouts +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP(\ + 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_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_PPLS, \ + KC_LCTL, 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_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ + TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), +[1] = KEYMAP(\ + TD(ALLS), 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_GRV, TD(EMOJIS),TD(ANIMAL),TD(ETC),TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ + KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ + KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ + KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), +[2] = KEYMAP(\ + 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_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_MPRV,KC_MPLY,KC_MNXT, 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_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ + KC_LCTL, KC_D, 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_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_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ + KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2) , KC_NO , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), +}; + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_TWO_KEYS(KC_A, KC_A) { // select all and copy + register_code(KC_LCTL); + tap(KC_A); + tap(KC_C); + unregister_code(KC_LCTL); + } + } +} + +void matrix_init_user(void) { + _delay_ms(500); + set_unicode_input_mode(UC_WINC); +}; + +void cycleAll(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[EMOTIS])); + unicode_input_finish(); + } + else if(state->count <= 1642) { + tap(KC_BSPC); + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[1])+state->count); + unicode_input_finish(); + } +}; + + +void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[EMOTIS])); + unicode_input_finish(); + } + else if(state->count <= 80) { + tap(KC_BSPC); + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[EMOTIS])+state->count); + unicode_input_finish(); + } +}; + +void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[ANIMALS])); + unicode_input_finish(); + } + else if(state->count <= MAXEMOJITAPS) { + tap(KC_BSPC); + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[ANIMALS])+state->count); + unicode_input_finish(); + } +}; + +void cycleFoods(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[FOODS])); + unicode_input_finish(); + } + else if(state->count <= 87) { + tap(KC_BSPC); + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[FOODS])+state->count); + unicode_input_finish(); + } +}; + + +void cycleEtc(qk_tap_dance_state_t *state, void *user_data) { + if(state->count == 1) { + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[ETC])); + unicode_input_finish(); + } + else if(state->count <= MAXEMOJITAPS) { + tap(KC_BSPC); + unicode_input_start(); + register_hex32(pgm_read_dword(&unicode_map[ETC])+state->count); + unicode_input_finish(); + } +}; + diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/readme.md b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/readme.md new file mode 100644 index 0000000000..0b01f9dbf8 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/readme.md @@ -0,0 +1,24 @@ +# The Nikchi's keymap for frosty_flake + +### FEATURING +-SPACE CADET +-Caps Lock is now LCTRL +-LCTRL is Tap(LCTRL, Caps Lock) + +### LEADER KEY - RALT +COMBOS +-a,a => Select All, Copy + + + +### FN REBINDS for Windows +``` + [W] [New Desktop] +[A][S][D] [Left Desk][Delete Desk][Right Desk] + +[Ins][Hom][PUp] [RW][PP][FF] +[Del][End][PDn] [MU][VD][VU] + +Arrows are Mouskeys, left three mods are clicks + +``` \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk new file mode 100644 index 0000000000..b21eb64044 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk @@ -0,0 +1,24 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = yes # unicodemap +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 +TAP_DANCE_ENABLE = yes +LEADER_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/variableTapDance.md b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/variableTapDance.md new file mode 100644 index 0000000000..b2e5041393 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/variableTapDance.md @@ -0,0 +1,9 @@ +# Tap Dancing to different beats. +Tap Dance is constrained normally by `TAPPING_TERM` defined in your keyboard's config.h This proves to be challenging to work with when sometimes you just need more time to tap out your dance, or even a different "beat". + + + +- `ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term)` : This works the same as `ACTION_TAP_DANCE_FN_ADVANCED` just with the extra `tap_specific_tapping_term` arguement at the end. This way you can set a specific tap dance to have a longer or shorter tap in between your taps, giving you more, or less, time in between each tap. + + +`tap_specific_tapping_term` should be the same type and range of values that one would put into the `TAPPING_TERM` definition in the config.h file. diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h new file mode 100644 index 0000000000..8893d122e0 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c new file mode 100644 index 0000000000..99dc95627e --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c @@ -0,0 +1,11 @@ +#include "frosty_flake.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = KEYMAP_TKL(\ + 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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) +}; diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/readme.md b/keyboards/bpiphany/frosty_flake/keymaps/tkl/readme.md new file mode 100644 index 0000000000..a076a65de9 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/readme.md @@ -0,0 +1 @@ +# TKL keymap for frosty_flake diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk new file mode 100644 index 0000000000..f29756f223 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 = no # 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 controls +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 diff --git a/keyboards/bpiphany/frosty_flake/matrix.c b/keyboards/bpiphany/frosty_flake/matrix.c new file mode 100644 index 0000000000..480e3455ba --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/matrix.c @@ -0,0 +1,155 @@ +/* + Copyright 2017 Gabriel Young + + 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 . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +__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 matrix_row_t scan_col(void) { + return ( + (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | + (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) | + (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | + (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | + (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | + (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | + (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | + (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)) + ); +} + +static void select_col(uint8_t col) { + switch (col) { + case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; + case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; + case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; + case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; + case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; + case 5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; + case 6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; + case 7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; + case 8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; + case 9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; + case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; + case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; + case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; + case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; + case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; + case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; + case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; + case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; + } +} + +void matrix_init(void) { + /* Row output pins */ + DDRD |= 0b01111011; + /* Column input pins */ + DDRC &= ~0b10000000; + DDRB &= ~0b01111111; + PORTC |= 0b10000000; + PORTB |= 0b01111111; + + for (uint8_t i=0; i < MATRIX_ROWS; i++) + matrix[i] = matrix_debouncing[i] = 0; + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + matrix_row_t col_scan = scan_col(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Costar +#define PRODUCT Majestouch + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +//#define MATRIX_ROW_PINS { D0, D5 } +//#define MATRIX_COL_PINS { F1, F0, B0 } +//#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/bpiphany/kitten_paw/info.json b/keyboards/bpiphany/kitten_paw/info.json new file mode 100644 index 0000000000..7d2574710a --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "Kitten Paw", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "key_count": 105, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"KC_NUBS", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + }, + + "LAYOUT_fullsize_ansi": { + "key_count": 104, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + } + } +} diff --git a/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c b/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c new file mode 100644 index 0000000000..6767f04145 --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +#include QMK_KEYBOARD_H + +enum layers { + DEFAULT, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = 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_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_PPLS, \ + 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_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_P1, KC_P2, KC_P3,KC_PENT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} \ No newline at end of file diff --git a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/config.h b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/config.h new file mode 100644 index 0000000000..142aba8909 --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/config.h @@ -0,0 +1,31 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#undef MOUSEKEY_MOVE_MAX +#define MOUSEKEY_MOVE_MAX 127 +#undef MOUSEKEY_WHEEL_MAX +#define MOUSEKEY_WHEEL_MAX 110 +#undef MOUSEKEY_MOVE_DELTA +#define MOUSEKEY_MOVE_DELTA 5 +#undef MOUSEKEY_WHEEL_DELTA +#define MOUSEKEY_WHEEL_DELTA 1 +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 50 +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 20 +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 4 +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 30 +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 3 +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 +#undef ONESHOT_TIMEOUT +#define ONESHOT_TIMEOUT 500 +#undef TAPPING_TOGGLE +#define TAPPING_TOGGLE 2 + +#endif diff --git a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c new file mode 100644 index 0000000000..856cef9cc2 --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/keymap.c @@ -0,0 +1,242 @@ +#include QMK_KEYBOARD_H +#include "mousekey.h" + +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define C(kc) LCTL(KC_##kc) +#define RA(kc) RALT(KC_##kc) +#define KC_SLCT KC_SELECT +#define MEDAPP LT(MEDIA, KC_APP) +#undef S +#define S(kc) LSFT(KC_##kc) + +uint8_t current_layer_global = 255; + +enum layers { + DEFAULT, + PROG1, + PROG2, + MEDIA, + MOUSE1, + MOUSE2, + MISC, +}; + +enum function_id { + LSHFT_PAREN, + RSHFT_PAREN, + LCTRL_BRACKET, + RCTRL_BRACKET, + LALT_CURLY, + RALT_CURLY, + CTRL_CLICK +}; + +enum macro_id { + GRV, + CFLEX +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DEFAULT] = 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_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_PPLS, \ + F(0), 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, \ + F(8),KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, F(9), KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ + F(1),KC_LGUI, F(3), LT(MISC, KC_SPC), F(4), F(5), MEDAPP, F(2), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), + /* Layer 1: Programming Layer 1, emulating US l ayout */ + [PROG1] = LAYOUT(\ + KC_ESC,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + M(GRV),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_SLSH, S(0),_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______, KC_Z,_______,_______,_______,_______, RA(8), RA(9),RA(MINS), _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,S(COMM),S(BSLS), _______, _______,_______,_______, \ + MO(PROG2),_______, KC_Y,_______,_______,_______,_______,_______,_______,_______,_______, S(7), MO(PROG2), _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 2: programming layer 2 + all keys that are not FN keys are sent as LSFT+key on this layer + */ + [PROG2] = LAYOUT(\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + RA(RBRC),_______, RA(Q),KC_BSLS,_______,_______,M(CFLEX), S(6),S(RBRC), S(8), S(9),S(SLSH),KC_RBRC,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RA(7), RA(0),RA(NUBS), _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, S(DOT), S(2), _______, _______,_______,_______, \ + _______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 3: media layer */ + [MEDIA] = LAYOUT(\ + KC_PWR,KC_SLEP,KC_WAKE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, KC_EJCT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ + XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,_______,XXXXXXX, KC_MRWD,KC_MSTP,KC_MFFD, XXXXXXX,XXXXXXX), + /* Layer 4: Mouse layer */ + [MOUSE1] = LAYOUT(\ + F(6),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,KC_ACL0,KC_ACL1,KC_ACL2,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_BTN4,KC_WH_D,KC_MS_U,KC_WH_U,_______, C(Z),_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_BTN5,KC_MS_L,KC_MS_D,KC_MS_R, F(7),KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,_______,_______, _______, _______,_______,_______, \ + MO(MOUSE2),_______, C(Y), C(X), C(C), C(V),_______,KC_BTN2,KC_BTN3,C(PGUP),C(PGDN),_______, KC_RSFT, _______, _______,_______,_______,_______, \ + KC_LCTL,_______,KC_LALT, KC_BTN1, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, _______,_______,_______, _______,_______), + /* Layer 5: Mouse layer 2*/ + [MOUSE2] = LAYOUT(\ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_BTN2,KC_WH_U,KC_BTN3,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_WH_L,KC_WH_D,KC_WH_R,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,_______,_______, _______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), + /* Layer 6: Misc layer */ + [MISC] = LAYOUT(\ + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,KC_SLCT, C(W), KC_UP,_______,_______,_______,_______,KC_BSPC, KC_DEL,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ + _______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,KC_HOME,KC_PGDN,KC_PGUP,_______,_______,_______, _______, _______,_______,_______, \ + KC_LSFT,_______, C(Y), C(X), C(C), C(V), KC_SPC, KC_END,_______,C(PGUP),C(PGDN),_______, _______, _______, _______,_______,_______,_______, \ + _______,_______,_______, LT(MISC, KC_SPC), _______,_______,_______,_______, _______,_______,_______, _______,_______), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_TAP_TOGGLE(MOUSE1), // tap-toggle mouse layer (4) + [1] = ACTION_FUNCTION_TAP(LCTRL_BRACKET), // tap to print [ + [2] = ACTION_FUNCTION_TAP(RCTRL_BRACKET), // tap to print ] + [3] = ACTION_FUNCTION_TAP(LALT_CURLY), // tap to print { + [4] = ACTION_FUNCTION_TAP(RALT_CURLY), // tap to print } + [5] = ACTION_LAYER_TAP_TOGGLE(PROG1), // tap-toggle programming layer 1 + [6] = ACTION_LAYER_SET_CLEAR(DEFAULT), + [7] = ACTION_FUNCTION_TAP(CTRL_CLICK), + [8] = ACTION_FUNCTION_TAP(LSHFT_PAREN), // tap to print ( + [9] = ACTION_FUNCTION_TAP(RSHFT_PAREN), // tap to print ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case GRV: // macro to print accent grave + return (record->event.pressed ? + MACRO( D(LSFT), T(EQL), U(RALT), T(SPC), END) : + MACRO_NONE ); + case CFLEX: // print accent circonflex + return (record->event.pressed ? + MACRO( T(GRV), T(SPC), END ) : + MACRO_NONE ); + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + uint8_t layer; + layer = biton32(layer_state); + + if (current_layer_global != layer) { + current_layer_global = layer; + + // unset CAPSLOCK and SCROLL LOCK LEDs + led_set_kb(host_keyboard_leds() & ~(1<event.pressed) { + if (record->tap.count > 0 && !record->tap.interrupted) { + if (record->tap.interrupted) { + register_mods(MOD_BIT(orig_mod)); + } + } else { + register_mods(MOD_BIT(orig_mod)); + } + } else { + if (record->tap.count > 0 && !(record->tap.interrupted)) { + add_weak_mods(MOD_BIT(macro_mod)); + send_keyboard_report(); + register_code(macro_kc); + unregister_code(macro_kc); + del_weak_mods(MOD_BIT(macro_mod)); + send_keyboard_report(); + record->tap.count = 0; // ad hoc: cancel tap + } else { + unregister_mods(MOD_BIT(orig_mod)); + } + } +} + +/* if LCTRL is tabbed, print (, or ) if RCTRL is tabbed, same for LALT/RALT and [/] */ +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { + // The code is copied from keymap_hasu.c in the tmk keyboards hhkb folder + switch (id) { + case LCTRL_BRACKET: + tap_helper(record, KC_LCTL, KC_RALT, KC_8); + break; + case RCTRL_BRACKET: + tap_helper(record, KC_RCTL, KC_RALT, KC_9); + break; + case LALT_CURLY: + tap_helper(record, KC_LALT, KC_RALT, KC_7); + break; + case RALT_CURLY: + tap_helper(record, KC_RALT, KC_RALT, KC_0); + break; + case LSHFT_PAREN: + tap_helper(record, KC_LSFT, KC_LSFT, KC_8); + break; + case RSHFT_PAREN: + tap_helper(record, KC_RSFT, KC_LSFT, KC_9); + break; + case CTRL_CLICK: + if (record->event.pressed) { + mousekey_clear(); + register_mods(MOD_BIT(KC_LCTL)); + send_keyboard_report(); + wait_ms(5); + mousekey_on(KC_BTN1); + mousekey_send(); + wait_ms(10); + mousekey_off(KC_BTN1); + mousekey_send(); + wait_ms(5); + unregister_mods(MOD_BIT(KC_LCTL)); + send_keyboard_report(); + } + break; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t layer; + layer = biton32(layer_state); + if (layer == PROG2) { + if (keycode >= KC_A && keycode <= KC_EXSEL && \ + !( // do not send LSFT + these keycodes, they are needed for emulating the US layout + keycode == KC_NONUS_BSLASH || + keycode == KC_RBRC || + keycode == KC_BSLS || + keycode == KC_GRV + )) { + // LSFT is the modifier for this layer, so we set LSFT for every key to get the expected behavior + if (record->event.pressed) { + register_mods(MOD_LSFT); + } else { + unregister_mods(MOD_LSFT); + } + } + } + return true; +} diff --git a/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/readme.md b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/readme.md new file mode 100644 index 0000000000..0d23be4eac --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/keymaps/ickerwx/readme.md @@ -0,0 +1,18 @@ +# My personal keymap for the Kitten Paw controller + +This keymap only works correctly when you have your OS configured with a German keymap. Use the keymap however you like. It's most likely a living thing that will never be quite finished. + +## Description of the layers +Layer 0 (DEFAULT) works just like you would expect a keyboard to work, mostly, except: +Caps Lock switches to the mouse layer, RGUI and APP are switches to the programming layer and media layer. +Mouse and programming layer switches can be held or double-tapped to lock. +Holding space switches to the MISC layer where I currently accumulate useful shortcuts. +Tapping left and right Shift, Ctrl and Alt will send (), [] and {} respectively. + +Layers 1 and 2 (PROG1 and PROG2) emulate the US layout while still using a German OS keymap setting. I was annoyed of having to change the OS settings every time I wanted to use the US layout for coding, so I made these layers to behave just like the US layout even though the OS still uses German. The shift keys were a bit tricky, I had to use them as MO(PROG2) switches, so to get the actual expected behavior I enable LSFT for almost every keypress on PROG2 in ```process_record_user```. Since the shift keys are MO() function keys, they do not print () at the moment, which sucks. I'm working on it. + +Layer 3 (MEDIA) just has a couple of media keys on it, mainly around the cursor keys and nav key cluster. + +Layers 4 and 5 (MOUSE1 and MOUSE2) are mouse layers. Move the cursor using ESDF, scroll using HJKL, Space for left click, N and M for right and middle click. There's more, look at the keymap. + +Layer 6 is a layer I don't have a good name for, so I call it MISC. You'll find cursor keys at ESDF, other navigation keys around the HJKL cluster and F12 to F24 on the F-keys. For now. \ No newline at end of file diff --git a/keyboards/bpiphany/kitten_paw/kitten_paw.c b/keyboards/bpiphany/kitten_paw/kitten_paw.c new file mode 100644 index 0000000000..26cb533f2d --- /dev/null +++ b/keyboards/bpiphany/kitten_paw/kitten_paw.c @@ -0,0 +1,51 @@ +#include "kitten_paw.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +__attribute__ ((weak)) +void matrix_init_user(void) { +} + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + CONFIG_LED_IO; + CONFIG_LED_IO; + print_dec(usb_led); + if (usb_led & (1< + + 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 . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint8_t read_rows(void); +static void select_col(uint8_t col); + +__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) { +} + +inline uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +/* Column pin configuration + * + * col: 0 1 2 3 4 5 6 7 + * pin: PC7 PD5 PD3 PD1 PC2 PD6 PD4 PD2 + * + * Rrr pin configuration + * + * These rrrs uses one 74HC154 4 to 16 bit demultiplexer (low + * active), together with 2 rrrs driven directly from the micro + * controller, to control the 18 rrrs. The rrrs are driven from + * pins B6,5,4,3,2,1,0. + */ +void matrix_init(void) { + DDRC &= ~0b10000100; // Row input pins + DDRD &= ~0b01111110; + PORTC |= 0b10000100; + PORTD |= 0b01111110; + + DDRB |= 0b01111111; // Column output pins + + 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++) { + select_col(col); + _delay_us(3); + uint8_t rows = read_rows(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6050 +#define DEVICE_VER 0x0104 +#define MANUFACTURER Filco +#define PRODUCT Majestouch TKL \\w The Pegasus Hoof +#define DESCRIPTION QMK firmware for Majestouch TKL + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c new file mode 100644 index 0000000000..6faf4db6fa --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c @@ -0,0 +1,112 @@ +/* +Copyright 2016 Daniel Svensson + +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 . +*/ + +#include "pegasushoof.h" + +#define _______ KC_TRNS + +/* Swedish keys */ +#define SE_HALF KC_GRV +#define SE_PLUS KC_MINS +#define SE_ACUT KC_EQL +#define SE_AO KC_LBRC +#define SE_CIRC KC_RBRC +#define SE_QUOT KC_BSLS +#define SE_OE KC_SCLN +#define SE_AE KC_QUOT +#define SE_MINS KC_SLSH +#define SE_LTGT KC_NUBS +#define SE_LCBR RALT(KC_7) +#define SE_LBRC RALT(KC_8) +#define SE_RBRC RALT(KC_9) +#define SE_RCBR RALT(KC_0) +#define SE_PIPE RALT(SE_LTGT) +#define SE_BSLS RALT(SE_PLUS) + +#define KM_BLOWRAK 0 +#define KM_QWERTY 1 +#define KM_MEDIA 2 +#define KM_HAXHAX 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Blowrak ISO layer, a Swedish take on Dvorak */ + [KM_BLOWRAK] = KEYMAP( \ + 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, \ + SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ + KC_TAB, SE_AO, SE_AE, SE_OE, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM,SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ + KC_LCTRL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_H, KC_D, KC_T, KC_N, KC_S, SE_MINS, KC_ENT, \ + KC_LSFT, SE_LTGT,KC_DOT, KC_Q, KC_J, KC_K, KC_B, KC_X, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ + KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), + /* Layer 1: Standard ISO layer */ + [KM_QWERTY] = KEYMAP( \ + 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, \ + SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,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, SE_AO, SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ + KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_OE, SE_AE, KC_ENT, \ + KC_LSFT, SE_LTGT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, SE_MINS, KC_RSFT, KC_UP, \ + KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), + /* Layer 2: Media layer */ + [KM_MEDIA] = KEYMAP( \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MUTE,_______,KC_VOLD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ + _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT), + /* Layer 3: Programming layer */ + [KM_HAXHAX] = KEYMAP( \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,SE_LCBR,SE_PIPE,SE_RCBR,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,SE_LBRC,SE_BSLS,SE_RBRC,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______), +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA), + [1] = ACTION_LAYER_TOGGLE(KM_QWERTY) +}; + +void matrix_scan_user(void) +{ + uint8_t layer = biton32(layer_state); + switch (layer) { + case KM_BLOWRAK: + ph_caps_led_on(); + ph_sclk_led_off(); + break; + case KM_QWERTY: + ph_sclk_led_on(); + ph_caps_led_off(); + break; + } +} + +/* Mixes in KM_HAXHAX via RALT modifier without shadowing the RALT key combinations. */ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t modifiers = get_mods(); + if (modifiers & MOD_BIT(KC_RALT) && record->event.pressed) { + uint16_t kc = keymap_key_to_keycode(KM_HAXHAX, record->event.key); + if (kc != KC_TRNS) { + register_code(kc); + unregister_code(kc); + return false; + } + } + return true; +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk new file mode 100644 index 0000000000..168fb625b2 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk @@ -0,0 +1,22 @@ +# 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 # 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 +CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 +NKRO_ENABLE = no # 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 controls +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. + + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h new file mode 100644 index 0000000000..2d27ff392d --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h @@ -0,0 +1,11 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +/* overridden settings: */ + +#undef PRODUCT +#define PRODUCT Pegasus Hoof Citadel + +#endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c new file mode 100644 index 0000000000..382854de9b --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c @@ -0,0 +1,128 @@ +/* Copyright 2018 Daniel Rose + * + * 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 . + */ + +#include "pegasushoof.h" + +/* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */ +#define G(kc) RALT(KC_##kc) +#define A(kc) LALT(KC_##kc) +#define C(kc) LCTL(KC_##kc) +#undef S /* Original shortcut (quantum_keycodes.h) takes full-sized keycodes: too long! */ +#define S(kc) LSFT(KC_##kc) +#define CTALDEL LCTL(LALT(KC_DEL)) + +enum layers { + DEF, + FUN, + RES, +}; + +enum tap_dance { + AF4, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: default layer (ISO-DE) + * .----. .-------------------. .-------------------. .-------------------. .--------------. + * |Esc | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10 |F11 |F12 | |PrSc|SLck|2Tp:| + * | | | | | | | | | | | | | | | | | |SyRq| |A+F4| + * '----' '-------------------' '-------------------' '-------------------' '--------------' + * .------------------------------------------------------------------------. .--------------. + * |° |! |" |§ |$ |% |& |/ |( |) |= |? |` |Backspa| |Ins |Home|PgUp| + * |^ |1 |2 ²|3 ³|4 |5 |6 |7 {|8 [|9 ]|0 }|ß \|´ | | | | | | + * |------------------------------------------------------------------------| |--------------| + * |Tab |Q |W |E |R |T |Z |U |I |O |P |Ü |* | E | |Del |End |PgDn| + * | | | | €| | | | | | | | |+ ~| n | | | | | + * |------------------------------------------------------------------\ t | '--------------' + * |Fn: |A |S |D |F |G |H |J |K |L |Ö |Ä |' | e | + * |Layer 2| | | | | | | | | | | |# | r | + * |------------------------------------------------------------------------| .----. + * |Shift|> |Y |X |C |V |B |N |M |; |: |_ |Shift | |Up | + * | |< ¦| | | | | | | µ|, |. |- | | | | + * |------------------------------------------------------------------------| .--------------. + * |Ctrl |Super|Alt | |AltGr|Alt |Fn: |Ctrl | |Left|Down|Righ| + * | | | | | | |Lay 2| | | | | | + * '------------------------------------------------------------------------' '--------------' + * NUHS = true position of KC_NUHS + */ +[DEF] = KEYMAP( \ + 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,TD(AF4), \ + 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_NUHS, KC_DEL, KC_END, KC_PGDN, \ + MO(FUN),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,/*NUHS*/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_LALT,MO(FUN),KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Layer 1: function layer + * .----. .-------------------. .-------------------. .-------------------. .--------------. + * |Ctl+| |My |WWW:|Calc|Medi| |Mus:|Mus:|Mus:|Mus:| |Vol:|Vol:|Vol:|See:| | | |Paus| + * |A+De| |Comp|Home| |Play| |Prev|Next|Paus|Stop| |Mute|Down|Up |[3] | | | |Brea| + * '----' '-------------------' '-------------------' '-------------------' '--------------' + * .------------------------------------------------------------------------. .--------------. + * | | | | | | | | | | | | | | | | | |Mou:| + * | | | | | | | |{ |[ |] |} |\ | | | | | |WhUp| + * |------------------------------------------------------------------------| |--------------| + * | | | | | | | | | | | | |~ | | | | |Mou:| + * | | | | | | | | | | | | | | | | | |WhDn| + * |------------------------------------------------------------------\ | '--------------' + * |CapsLck|Mou:|Mou:| | | | | | | | | | | | + * | |Fast|Slow| | | | | | | | | | | | + * |------------------------------------------------------------------------| .----. + * | | | | | | | | |µ | | | | | |Mou:| + * | | | | | | | | | | | | | | |Up | + * |------------------------------------------------------------------------| .--------------. + * |Mous:|Mous:| | | |Super|App | | |Mou:|Mou:|Mou:| + * |Bttn2|Bttn1| | | | | | | |Left|Down|Righ| + * '------------------------------------------------------------------------' '--------------' + * + */ +[FUN] = KEYMAP( \ + CTALDEL, KC_MYCM,KC_WHOM,KC_CALC,KC_MSEL,KC_MPRV,KC_MNXT,KC_MPLY,KC_MSTP,KC_MUTE,KC_VOLD,KC_VOLU,MO(RES), _______,KC_SLCK,KC_PAUS, \ + _______,_______,_______,_______,_______,_______,_______,G(7), G(8), G(9), G(0), G(MINS),_______,_______, _______,_______,KC_WH_U, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,G(RBRC),_______, _______,_______,KC_WH_D, \ + KC_CAPS,KC_ACL2,KC_ACL0,_______,_______,_______,_______,_______,_______,_______,_______,_______,/*NUHS*/_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,G(M), _______,_______,_______, _______, KC_MS_U, \ + KC_BTN2,KC_BTN1,_______, _______, _______,KC_RGUI,KC_APP ,_______, KC_MS_L,KC_MS_D,KC_MS_R), + + +/* Layer 3: Reset layer (prevents accidental resets) */ +[RES] = KEYMAP( \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,/*NUHS*/_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______), +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + /* Tap once: nothing. Tap twice: Alt+F4 */ + [AF4] = ACTION_TAP_DANCE_DOUBLE(XXXXXXX,A(F4)), +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/readme.md b/keyboards/bpiphany/pegasushoof/keymaps/citadel/readme.md new file mode 100644 index 0000000000..3618bae861 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/readme.md @@ -0,0 +1,75 @@ +# Citadel keymap for pegasushoof + +Designed for ISO-DE and similar ISO layouts. + +The central idea of this keymap is to avoid unergonomic key combos that force the user to either press +multiple keys with one hand or to use the left hand for right-sided keys. For instance, ISO-DE users +have to press `AltGr`+`7` to type _{_. The keymap allows ergonomic access to the right-sided keys of the +German AltGr-layer by turning `Caps Lock` into a hybrid Fn/AltGr-key. It can easily be adapted for other +ISO layouts. + +The _Function_ layer also offers mouse emulation and function/media keys in the F-Row. + +`Pause/Break` is used as a safe _close key_: A _single tap_ does nothing, a _double tap_ executes ALT+F4. + +Named after the homonymous space station from _Mass Effect_. Made by [Daniel Rose](https://github.com/droseger/). + +## [1] Layers + +### Layer 1 (Default) + .----. .-------------------. .-------------------. .-------------------. .--------------. + |Esc | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10 |F11 |F12 | |PrSc|SLck|2Tp:| + | | | | | | | | | | | | | | | | | |SyRq| |A+F4| + '----' '-------------------' '-------------------' '-------------------' '--------------' + .------------------------------------------------------------------------. .--------------. + |° |! |" |§ |$ |% |& |/ |( |) |= |? |` |Backspa| |Ins |Home|PgUp| + |^ |1 |2 ²|3 ³|4 |5 |6 |7 {|8 [|9 ]|0 }|ß \|´ | | | | | | + |------------------------------------------------------------------------| |--------------| + |Tab |Q |W |E |R |T |Z |U |I |O |P |Ü |* | E | |Del |End |PgDn| + | | | | €| | | | | | | | |+ ~| n | | | | | + |------------------------------------------------------------------\ t | '--------------' + |Fn: |A |S |D |F |G |H |J |K |L |Ö |Ä |' | e | + |Layer 2| | | | | | | | | | | |# | r | + |------------------------------------------------------------------------| .----. + |Shift|> |Y |X |C |V |B |N |M |; |: |_ |Shift | |Up | + | |< ¦| | | | | | | µ|, |. |- | | | | + |------------------------------------------------------------------------| .--------------. + |Ctrl |Super|Alt | |AltGr|Alt |Fn: |Ctrl | |Left|Down|Righ| + | | | | | | |Lay 2| | | | | | + '------------------------------------------------------------------------' '--------------' + +### Layer 2 (Function) + .----. .-------------------. .-------------------. .-------------------. .--------------. + |Ctl+| |My |WWW:|Calc|Medi| |Mus:|Mus:|Mus:|Mus:| |Vol:|Vol:|Vol:|See:| | | |Paus| + |A+De| |Comp|Home| |Play| |Prev|Next|Paus|Stop| |Mute|Down|Up |[3] | | | |Brea| + '----' '-------------------' '-------------------' '-------------------' '--------------' + .------------------------------------------------------------------------. .--------------. + | | | | | | | | | | | | | | | | | |Mou:| + | | | | | | | |{ |[ |] |} |\ | | | | | |WhUp| + |------------------------------------------------------------------------| |--------------| + | | | | | | | | | | | | |~ | | | | |Mou:| + | | | | | | | | | | | | | | | | | |WhDn| + |------------------------------------------------------------------\ | '--------------' + |CapsLck|Mou:|Mou:| | | | | | | | | | | | + | |Fast|Slow| | | | | | | | | | | | + |------------------------------------------------------------------------| .----. + | | | | | | | | |µ | | | | | |Mou:| + | | | | | | | | | | | | | | |Up | + |------------------------------------------------------------------------| .--------------. + |Mous:|Mous:| | | |Super|App | | |Mou:|Mou:|Mou:| + |Bttn2|Bttn1| | | | | | | |Left|Down|Righ| + '------------------------------------------------------------------------' '--------------' + +Layer 3 exists solely to prevent users from accidentally activating boot mode: `R` is redefined +as `RESET` key [3]. + +## [2] How to build and install +1) Prerequisite: install the necessary [build tools](https://docs.qmk.fm/#/getting_started_build_tools) +such as [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer). + - You might need to [add udev rules](https://docs.qmk.fm/#/faq_build?id=can39t-program-on-linux) under Linux. +2) To test if the keymap compiles, simply run `make pegasushoof:citadel` +3) Enter the `qmk_firmware` root directory and run `make pegasushoof:citadel:dfu` +4) Reset controller to _Boot mode_ by pressing the `RESET` key or by using a magnet. + +## [3] How to access Boot mode after install +Press `Fn+F12+R` diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk new file mode 100644 index 0000000000..0dd8a79f4e --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk @@ -0,0 +1,22 @@ +# Build Options +# change to "no" to disable the options +# +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 = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 +NKRO_ENABLE = no # 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 controls +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. +TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000) + + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c new file mode 100644 index 0000000000..aa006b23a4 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +/* +Copyright 2016 Daniel Svensson + +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 . +*/ + +#include "pegasushoof.h" + +#define _______ KC_TRNS + +#define KM_QWERTY 0 +#define KM_MEDIA 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Layer 0: Standard ISO layer */ + [KM_QWERTY] = KEYMAP( \ + 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_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_CLCK, 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,KC_MENU,KC_FN0, KC_LEFT,KC_DOWN,KC_RGHT), + /* Layer 1: Function layer */ + [KM_MEDIA] = KEYMAP( \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ + _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT) +}; + +const uint16_t PROGMEM fn_actions[] = { + [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA) +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk new file mode 100644 index 0000000000..168fb625b2 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk @@ -0,0 +1,22 @@ +# 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 # 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 +CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 +NKRO_ENABLE = no # 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 controls +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. + + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/pegasushoof/matrix.c b/keyboards/bpiphany/pegasushoof/matrix.c new file mode 100644 index 0000000000..127433875d --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/matrix.c @@ -0,0 +1,222 @@ +/* +Copyright 2014 Ralf Schmitt +Copyright 2016 Daniel Svensson + +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 . +*/ + +#include +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +static uint8_t debouncing = DEBOUNCING_DELAY; +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void select_row(uint8_t col); + +__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) { +} + +inline uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + /* Column output pins */ + DDRD |= 0b01111011; + /* Row input pins */ + DDRC &= ~0b10000000; + DDRB &= ~0b01111111; + PORTC |= 0b10000000; + PORTB |= 0b01111111; + + 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++) { + select_row(col); + wait_us(30); + matrix_row_t rows = read_cols(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + +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 . +*/ + +#include "pegasushoof.h" + + +extern inline void ph_caps_led_on(void); +extern inline void ph_caps_led_off(void); + +extern inline void ph_sclk_led_on(void); +extern inline void ph_sclk_led_off(void); + + +__attribute__ ((weak)) +void matrix_init_user(void) { +}; + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} + +__attribute__ ((weak)) +bool process_action_user(keyrecord_t *record) { + return true; +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { +} + +void matrix_init_kb(void) { + matrix_init_user(); +} + +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +bool process_action_kb(keyrecord_t *record) { + return process_action_user(record); +} + +void led_set_kb(uint8_t usb_led) { + led_set_user(usb_led); +} diff --git a/keyboards/bpiphany/pegasushoof/pegasushoof.h b/keyboards/bpiphany/pegasushoof/pegasushoof.h new file mode 100644 index 0000000000..d031e3ed25 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/pegasushoof.h @@ -0,0 +1,51 @@ +/* +Copyright 2016 Daniel Svensson + +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 . +*/ + +#ifndef PEGASUSHOOF_H +#define PEGASUSHOOF_H + +#include "matrix.h" +#include "quantum.h" + +#define ___ KC_NO + +#define KEYMAP( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ + /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , ___ , ___ , ___ , KJ0 , KK0 , ___ , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ + /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ + /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ + /* 3 */ { KA3 , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ + /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ + /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ + /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ + /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \ + } + +inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } +inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } + +inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } +inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } + + +#endif diff --git a/keyboards/bpiphany/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk new file mode 100644 index 0000000000..c5a35428ca --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/rules.mk @@ -0,0 +1,67 @@ +# MCU name +MCU = atmega32u2 + +# 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 + + +# Boot Section Size in *bytes* +# 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 = yes # 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 +NKRO_ENABLE = no # 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 controls +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. + + +CUSTOM_MATRIX = yes +SRC = matrix.c diff --git a/keyboards/bpiphany/readme.md b/keyboards/bpiphany/readme.md new file mode 100644 index 0000000000..992b7c908d --- /dev/null +++ b/keyboards/bpiphany/readme.md @@ -0,0 +1,6 @@ +# Bathroom Epiphanies + +bpiphany is the owner and designer of [Bathroom Epiphanies](http://bathroomepiphanies.com/). + +He is based in Sweden and creates several controller boards as a swappable component for some off the shelf keyboards. + diff --git a/keyboards/bpiphany/tiger_lily/config.h b/keyboards/bpiphany/tiger_lily/config.h new file mode 100644 index 0000000000..4908192906 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/config.h @@ -0,0 +1,147 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Bathroom Epiphanies +#define PRODUCT tiger_lily +#define DESCRIPTION Tiger Lily controller for the Filco Majestouch 2 + +/* + * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies + * Ported from the Bathroom Epiphanies TMK Firmware: + * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers + * + */ + +/* key matrix size */ +#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic +#define MATRIX_COLS 18 // ColA - ColR in the schematic + +/* + * Keyboard Matrix Assignments + */ +#define UNUSED_PINS { B0, C4, D3 } + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/bpiphany/tiger_lily/info.json b/keyboards/bpiphany/tiger_lily/info.json new file mode 100644 index 0000000000..1a2194b06f --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "tiger_lily", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + }, + "LAYOUT_fullsize_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] + } + } +} diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/config.h b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h new file mode 100644 index 0000000000..8893d122e0 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/keymap.c b/keyboards/bpiphany/tiger_lily/keymaps/default/keymap.c new file mode 100644 index 0000000000..46c17aca8b --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/keymap.c @@ -0,0 +1,11 @@ +#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_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_PPLS, \ + 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_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_P1, KC_P2, KC_P3,KC_PENT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) +}; \ No newline at end of file diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/readme.md b/keyboards/bpiphany/tiger_lily/keymaps/default/readme.md new file mode 100644 index 0000000000..4626859df4 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for tiger_lily diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk new file mode 100644 index 0000000000..9d3df5964f --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/config.h b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/config.h new file mode 100644 index 0000000000..8893d122e0 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/config.h @@ -0,0 +1,8 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/keymap.c b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/keymap.c new file mode 100644 index 0000000000..6457b0282a --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_fullsize_ansi(\ + 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_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_PPLS, \ + 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_LSFT, 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_P1, KC_P2, KC_P3,KC_PENT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) +}; \ No newline at end of file diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/readme.md b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/readme.md new file mode 100644 index 0000000000..2cb8c89935 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/readme.md @@ -0,0 +1,3 @@ +# default_ansi + +A standard fullsize ANSI-layout keymap for Tiger Lily-powered keyboards. diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk new file mode 100644 index 0000000000..9d3df5964f --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk @@ -0,0 +1,21 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/bpiphany/tiger_lily/matrix.c b/keyboards/bpiphany/tiger_lily/matrix.c new file mode 100644 index 0000000000..3b48f6b368 --- /dev/null +++ b/keyboards/bpiphany/tiger_lily/matrix.c @@ -0,0 +1,155 @@ +/* + Copyright 2017 Gabriel Young + + 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 . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +__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 matrix_row_t scan_col(void) { + return ( + (PINC&(1<<2) ? 0 : ((matrix_row_t)1<<0)) | \ + (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<1)) | \ + (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | \ + (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<3)) | \ + (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | \ + (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<5)) | \ + (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<6)) | \ + (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<7)) + ); +} + +static void select_col(uint8_t col) { + switch (col) { + case 0: PORTD = (PORTD & ~0b01110111) | 0b01110110; break; \ + case 1: PORTD = (PORTD & ~0b01110111) | 0b01100001; break; \ + case 2: PORTD = (PORTD & ~0b01110111) | 0b01100101; break; \ + case 3: PORTD = (PORTD & ~0b01110111) | 0b00000011; break; \ + case 4: PORTD = (PORTD & ~0b01110111) | 0b00000111; break; \ + case 5: PORTD = (PORTD & ~0b01110111) | 0b00010011; break; \ + case 6: PORTD = (PORTD & ~0b01110111) | 0b00010111; break; \ + case 7: PORTD = (PORTD & ~0b01110111) | 0b00100011; break; \ + case 8: PORTD = (PORTD & ~0b01110111) | 0b00100111; break; \ + case 9: PORTD = (PORTD & ~0b01110111) | 0b00110011; break; \ + case 10: PORTD = (PORTD & ~0b01110111) | 0b01110010; break; \ + case 11: PORTD = (PORTD & ~0b01110111) | 0b01100110; break; \ + case 12: PORTD = (PORTD & ~0b01110111) | 0b01110000; break; \ + case 13: PORTD = (PORTD & ~0b01110111) | 0b01100100; break; \ + case 14: PORTD = (PORTD & ~0b01110111) | 0b01100000; break; \ + case 15: PORTD = (PORTD & ~0b01110111) | 0b01000111; break; \ + case 16: PORTD = (PORTD & ~0b01110111) | 0b01000011; break; \ + case 17: PORTD = (PORTD & ~0b01110111) | 0b00110111; break; + } +} + +void matrix_init(void) { + /* Column output pins */ \ + DDRD |= 0b01110111; \ + /* Row input pins */ \ + DDRC &= ~0b10000100; \ + DDRB &= ~0b01111110; \ + PORTC |= 0b10000100; \ + PORTB |= 0b01111110; + + for (uint8_t i=0; i < MATRIX_ROWS; i++) + matrix[i] = matrix_debouncing[i] = 0; + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + matrix_row_t col_scan = scan_col(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x1337 +#define DEVICE_VER 0x0001 +#define MANUFACTURER BathroomEpiphanies +#define PRODUCT Unloved Bastard +#define DESCRIPTION Unloved Bastard controller for CM Masterkeys S + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +#endif diff --git a/keyboards/bpiphany/unloved_bastard/info.json b/keyboards/bpiphany/unloved_bastard/info.json new file mode 100644 index 0000000000..efa995088b --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "unloved_bastard", + "url": "", + "maintainer": "qmk", + "bootloader": "", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + }, + "LAYOUT_tkl_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h new file mode 100644 index 0000000000..c55f7f9f7d --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c b/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c new file mode 100644 index 0000000000..ea103154ea --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ +#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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default/readme.md b/keyboards/bpiphany/unloved_bastard/keymaps/default/readme.md new file mode 100644 index 0000000000..a2b5f1192f --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for unloved_bastard diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/config.h b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/config.h new file mode 100644 index 0000000000..c55f7f9f7d --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c new file mode 100644 index 0000000000..16c0342d23 --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/keymap.c @@ -0,0 +1,63 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_tkl_ansi(\ + 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_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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/readme.md b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/readme.md new file mode 100644 index 0000000000..00d90f12c9 --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/keymaps/default_ansi/readme.md @@ -0,0 +1,3 @@ +# default_ansi + +A standard tenkeyless ANSI-layout keymap for Unloved Bastard-powered keyboards. diff --git a/keyboards/bpiphany/unloved_bastard/matrix.c b/keyboards/bpiphany/unloved_bastard/matrix.c new file mode 100644 index 0000000000..bb6de8613a --- /dev/null +++ b/keyboards/bpiphany/unloved_bastard/matrix.c @@ -0,0 +1,156 @@ +/* + Copyright 2017 Gabriel Young + Copyright 2018 Alexander Fougner + + 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 . +*/ + +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" + +__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) { +} + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif +static uint8_t debouncing = DEBOUNCING_DELAY; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t scan_col(void) { + return ( + (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | + (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<1)) | + (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<2)) | + (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<3)) | + (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<4)) | + (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<5)) | + (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<6)) | + (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<7)) + ); +} + +static void select_col(uint8_t col) { + switch (col) { + case 0: PORTD = (PORTD & ~0b00111111) | 0b00110011; break; + case 1: PORTD = (PORTD & ~0b00111111) | 0b00100011; break; + case 2: PORTD = (PORTD & ~0b00111111) | 0b00010111; break; + case 3: PORTD = (PORTD & ~0b00111111) | 0b00110011; break; + case 4: PORTD = (PORTD & ~0b00111111) | 0b00010011; break; + case 5: PORTD = (PORTD & ~0b00111111) | 0b00011011; break; + case 6: PORTD = (PORTD & ~0b00111111) | 0b00110100; break; + case 7: PORTD = (PORTD & ~0b00111111) | 0b00111010; break; + case 8: PORTD = (PORTD & ~0b00111111) | 0b00111000; break; + case 9: PORTD = (PORTD & ~0b00111111) | 0b00111100; break; + case 10: PORTD = (PORTD & ~0b00111111) | 0b00110010; break; + case 11: PORTD = (PORTD & ~0b00111111) | 0b00011111; break; + case 12: PORTD = (PORTD & ~0b00111111) | 0b00001111; break; + case 13: PORTD = (PORTD & ~0b00111111) | 0b00100111; break; + case 14: PORTD = (PORTD & ~0b00111111) | 0b00000111; break; + case 15: PORTD = (PORTD & ~0b00111111) | 0b00110110; break; + case 16: PORTD = (PORTD & ~0b00111111) | 0b00001011; break; + case 17: PORTD = (PORTD & ~0b00111111) | 0b00000011; break; + } +} + +void matrix_init(void) { + /* Row output pins */ + DDRD |= 0b00111111; + /* Column input pins */ + DDRC &= ~0b10000000; + DDRB &= ~0b01111111; + PORTC |= 0b10000000; + PORTB |= 0b01111111; + + for (uint8_t i=0; i < MATRIX_ROWS; i++) + matrix[i] = matrix_debouncing[i] = 0; + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + select_col(col); + _delay_us(3); + matrix_row_t col_scan = scan_col(); + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< + * + * 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 . + */ +#include "unloved_bastard.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + led_init_ports(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + return process_record_user(keycode, record); +} + +// C5 left +// C6 middle led +// B7 right led +void led_init_ports(void) { + DDRB |= (1<<7); + DDRC |= (1<<5); + DDRC |= (1<<6); + + PORTB |= (1<<7); + PORTC |= (1<<5); + PORTC |= (1<<6); +} + + +void led_set_kb(uint8_t usb_led) { + + if (usb_led & (1<. + */ +#ifndef UNLOVED_BASTARD_H +#define UNLOVED_BASTARD_H + +#include "quantum.h" + +#define LAYOUT( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KN2, KN6, KQ6, KN0, KN3, KM0, KP1, KC0, KQ0, KR0 \ +) \ +{ \ +/* Columns and rows need to be swapped in the below definition */ \ +/* A B C D E F G H I J K L M N O P Q R */ \ +/* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KC_NO, KC_NO, KC_NO, KJ0, KK0, KC_NO, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ +/* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ +/* 2 */ { KC_NO, KB2, KC_NO, KC_NO, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KN2, KO2, KC_NO, KC_NO, KC_NO }, \ +/* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KC_NO, KC_NO }, \ +/* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ +/* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ +/* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KH6, KI6, KJ6, KK6, KL6, KC_NO,KN6, KO6, KC_NO, KQ6, KC_NO }, \ +/* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KM7, KN7, KC_NO, KP7, KC_NO, KC_NO } \ +} + +#define LAYOUT_tkl_ansi( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KN2, KN6, KQ6, KN0, KN3, KM0, KP1, KC0, KQ0, KR0 \ +) \ +{ \ +/* Columns and rows need to be swapped in the below definition */ \ +/* A B C D E F G H I J K L M N O P Q R */ \ +/* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KC_NO, KC_NO, KC_NO, KJ0, KK0, KC_NO, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ +/* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ +/* 2 */ { KC_NO, KB2, KC_NO, KC_NO, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KN2, KO2, KC_NO, KC_NO, KC_NO }, \ +/* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KC_NO, KC_NO }, \ +/* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ +/* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ +/* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO,KN6, KO6, KC_NO, KQ6, KC_NO }, \ +/* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KM7, KN7, KC_NO, KP7, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/frosty_flake/config.h b/keyboards/frosty_flake/config.h deleted file mode 100644 index 2c73f10743..0000000000 --- a/keyboards/frosty_flake/config.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Bathroom Epiphanies -#define PRODUCT frosty_flake -#define DESCRIPTION Frosty Flake controller for the CM Storm Quick Fire Rapid - -/* - * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies - * Ported from the Bathroom Epiphanies TMK Firmware: - * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers - * - */ - -/* key matrix size */ -#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic -#define MATRIX_COLS 18 // ColA - ColR in the schematic - -/* - * Keyboard Matrix Assignments - */ -#define UNUSED_PINS { B0, C4, D3 } - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/frosty_flake/frosty_flake.c b/keyboards/frosty_flake/frosty_flake.c deleted file mode 100644 index 1cd4760389..0000000000 --- a/keyboards/frosty_flake/frosty_flake.c +++ /dev/null @@ -1,63 +0,0 @@ -#include "frosty_flake.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - DDRB |= (1<<7); - DDRC |= (1<<5) | (1<<6); - - print_dec(usb_led); - - if (usb_led & (1<event.pressed) { // pointer - SEND_STRING("<- "); -// return MACRO(D(LSFT), T(COMM), U(LSFT), T(MINS), END); - } - break; - case R_PIPE: - if (record->event.pressed) { // dplyr pipe - SEND_STRING("%>% "); -// return MACRO(D(LSFT), T(5), T(DOT), T(5), U(LSFT), END); - } - break; - } - return MACRO_NONE; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - } - return true; -} \ No newline at end of file diff --git a/keyboards/frosty_flake/keymaps/QFR_JM/readme.md b/keyboards/frosty_flake/keymaps/QFR_JM/readme.md deleted file mode 100644 index f12a0ffba1..0000000000 --- a/keyboards/frosty_flake/keymaps/QFR_JM/readme.md +++ /dev/null @@ -1,86 +0,0 @@ - -# TKL keymap for frosty\_flake -``` -make frosty_flake:QFR_JM - -dfu-programmer atmega32u2 erase -dfu-programmer atmega32u2 flash frosty_flake_QFR_JM.hex -dfu-programmer atmega32u2 start -``` - -##Layers -``` - ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. - |ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 |F10 |F11 |F12 | |PrSc|ScLk|PsBk| - '----' '-------------------' '-------------------' '-------------------' '--------------' - ,-------------------------------------------------------------------------. ,--------------. - | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bspc | | Ins|Home|PgUp| - |-------------------------------------------------------------------------| |--------------| - | Tab | Q | W | F | P | G | J | L | U | Y | ; | [ | ] | \ | | Del|End |PgDn| - |-------------------------------------------------------------------------| '--------------' - | Bspc | A | R | S | T | D | H | N | E | I | O | ' | Enter | - |-------------------------------------------------------------------------| ,----. - | LSPO | Z | X | C | V | B | K | M | , | . | / | RSPC | | Up | - |-------------------------------------------------------------------------| ,--------------. - |Ctrl|LGUI|LAlt| Space/Lower |MSE |RGUI|Menu|Ctrl| |Left|Down|Rght| - '-------------------------------------------------------------------------' '--------------' - -``` -### Base Layer - Colemak -The base layout is Colemak by default, but this can be changed to QWERTY via the *LOWER* layer. -* I've implemented COLEMAK = SAFE\_RANGE when enumerating the custom\_keycodes, but I don't actually know what this does... - -* Space cadet is implemented in the shift keys (hold for shift, tap for respective parentheses) - -#### Layer Shifting -* The spacebar is a **TAP_KEY** macro - Hold for momentary *LOWER* layer, Tap for Space. -* The Right hand ALT key is a **TAP_TOGGLE** macro for the *MOUSE* layer (RAlt is accessible through LOWER, if you want...) - -### LOWER -``` - ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. - |ESC | | F1 | F2 | F3 | F4 | |>/|||Stop| << | >> | | F9 |MUTE|Vol-|Vol+| |QWTY|CLMK|PsBk| - '----' '-------------------' '-------------------' '-------------------' '--------------' - ,-------------------------------------------------------------------------. ,--------------. - | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + | Bspc | | Ins|Home|PgUp| - |-------------------------------------------------------------------------| |--------------| - | Tab |PgUp|Home| Up | End| | | | | | | { | } | | | | Del|End |PgDn| - |-------------------------------------------------------------------------| '--------------' - | Bckspc|PgDn|Left|Down|Rght| | | | | | | ' | Enter | - |-------------------------------------------------------------------------| ,----. - | LSPO | <- |%>% | { | [ | ` | | | ] | } | . | / | RSPC | | Up | - |-------------------------------------------------------------------------| ,--------------. - |Ctrl|LGUI|LAlt| |RAlt|RGUI|Menu|Ctrl| |Left|Down|Rght| - '-------------------------------------------------------------------------' '--------------' -``` -The *LOWER* layer contains a navigation cluster on the left hand. This layer is momentary when the spacebar or LOWER (RAlt) key is held and toggled on/off when the LOWER key is tapped. - -* The Navigation cluster is offset to the right compared to the traditional **WASD** nav cluster. With this implementation, you don't need to move your hand from the home position when navigating. Page Up & Down keys are found on the far left of the cluster. - -* All unused (blank on the above keymap) keys are locked out using the XXXXXXX filler (KC\_NO), all modifiers (edge |\_| keys \[except 0, \. & Fn\] on the above keymap) and the ZXCV cluster are transparent (\_\_\_\_\_\_\_) to the Base layer. - -* The base layer can be switched to QWERTY or COLEMAK by pressing the Pause Break or Scroll Lock keys respectively - -### MOUSE -``` - ,----. ,-------------------. ,-------------------. ,-------------------. ,--------------. - |ESC | | F1 | F2 | F3 | F4 | | F5 | F6 | F7 | F8 | | F9 |F10 |F11 |F12 | |PrSc|ScLk|PsBk| - '----' '-------------------' '-------------------' '-------------------' '--------------' - ,-------------------------------------------------------------------------. ,--------------. - | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Del | | Ins|Home|PgUp| - |-------------------------------------------------------------------------| |--------------| - | Tab | WhU| WhL| MsU| WhR| | | M3 | M4 | M5 | | [ | ] | \ | | Del|End |PgDn| - |-------------------------------------------------------------------------| '--------------' - | BSPC | WhD| MsL| MsD| MsR| | |LClk |RClk | | | ' | Enter | - |-------------------------------------------------------------------------| ,----. - | LSPO | Z | X | C | V | | | | , | . | / | RSPC | | Up | - |-------------------------------------------------------------------------| ,--------------. - |Ctrl|LGUI|LAlt| Accel ++ |MSE |RGUI|Menu|Ctrl| |Left|Down|Rght| - '-------------------------------------------------------------------------' '--------------' -``` -The *MOUSE* layer contains keys replicating functions found on the mouse. - -* The navigation cluster (Up, Down, Left, Right) is a replication of the Navigation cluster on the *LOWER* layer. The scroll keys are analagous to the Page Up & Downkeys. -* The primary click (right & left) buttons are on the right home row (index & middle fingers) -* Secondary click buttons are above the standard keys (M3/Wheel click, M4, M5) but I do not use this function. - diff --git a/keyboards/frosty_flake/keymaps/QFR_JM/rules.mk b/keyboards/frosty_flake/keymaps/QFR_JM/rules.mk deleted file mode 100644 index 0ae0b96462..0000000000 --- a/keyboards/frosty_flake/keymaps/QFR_JM/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 = 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 -NKRO_ENABLE = no # 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 controls -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 diff --git a/keyboards/frosty_flake/keymaps/default/config.h b/keyboards/frosty_flake/keymaps/default/config.h deleted file mode 100644 index 8893d122e0..0000000000 --- a/keyboards/frosty_flake/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/frosty_flake/keymaps/default/keymap.c b/keyboards/frosty_flake/keymaps/default/keymap.c deleted file mode 100644 index 4dc7ed655f..0000000000 --- a/keyboards/frosty_flake/keymaps/default/keymap.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "frosty_flake.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - 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_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_PPLS, \ - 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_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_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; \ No newline at end of file diff --git a/keyboards/frosty_flake/keymaps/default/readme.md b/keyboards/frosty_flake/keymaps/default/readme.md deleted file mode 100644 index 11bf4825ff..0000000000 --- a/keyboards/frosty_flake/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for frosty_flake diff --git a/keyboards/frosty_flake/keymaps/default/rules.mk b/keyboards/frosty_flake/keymaps/default/rules.mk deleted file mode 100644 index 9d3df5964f..0000000000 --- a/keyboards/frosty_flake/keymaps/default/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/frosty_flake/keymaps/nikchi/config.h b/keyboards/frosty_flake/keymaps/nikchi/config.h deleted file mode 100644 index 3f78526437..0000000000 --- a/keyboards/frosty_flake/keymaps/nikchi/config.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define TAPPING_TERM 200 -#define LEADER_TIMEOUT 800 - -#define DISABLE_SPACE_CADET_ROLLOVER - -#define UNICODE_TYPE_DELAY 0 - -#define LSPO_KEY KC_9 -#define RSPC_KEY KC_0 - -#define MOUSEKEY_INTERVAL 20 -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_TIME_TO_MAX 60 -#define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 -// place overrides here - -#endif diff --git a/keyboards/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/frosty_flake/keymaps/nikchi/keymap.c deleted file mode 100644 index bf7c5e5883..0000000000 --- a/keyboards/frosty_flake/keymaps/nikchi/keymap.c +++ /dev/null @@ -1,228 +0,0 @@ -#include "frosty_flake.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "process_unicode.h" -#include "process_unicodemap.h" -#include "quantum.h" - -#define _______ KC_TRNS -#define MAXEMOJITAPS 80 - - -//declarations for tap dancing emojis -void register_hex32(uint32_t hex); -void cycleEmojis(qk_tap_dance_state_t *state, void *user_data); -void cycleAnimals(qk_tap_dance_state_t *state, void *user_data); -void cycleFoods(qk_tap_dance_state_t *state, void *user_data); -void cycleEtc(qk_tap_dance_state_t *state, void *user_data); -void cycleAll(qk_tap_dance_state_t *state, void *user_data); - -void tap(uint16_t keycode){ - register_code(keycode); - unregister_code(keycode); -}; - -//Tap Dance Declarations -enum taps{ - TD_CTCPS = 0, - EMOJIS, - ANIMAL, - HAND, - MEMES, - COPA, - ALLS -}; - -enum unicode_name { - EMOTIS = 1,//80, //1F60x - 1F64x - ANIMALS, //64, //1F40x - 1F43x - SYMBOLS,// = 45, //1F300 - 1F32C - FOODS,// = 87 , //1F32D - - ETC,// = 192, //1F44x -1F4Fx - VEHICLES,// = 83, //1F68x - 1F6Dx - SUPPLEMENT,// = 32, //1F91x-1F92x - ALCHEMY,// = 116 //1F70x - 1F773 - -}; - -enum my_macros { - NEWDESK = 0, - LEFTDESK, - RIGHTDESK, - CLOSEDESK -}; - - -// Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - // Tap once for CTRL, twice for Caps Lock - [TD_CTCPS] = ACTION_TAP_DANCE_DOUBLE(KC_LCTL, KC_CAPS), - [COPA] = ACTION_TAP_DANCE_DOUBLE(LCTL(KC_C), LCTL(KC_V)), - [EMOJIS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEmojis, NULL, NULL, 800), - [ANIMAL] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAnimals, NULL, NULL, 800), - //[SYMBOLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSymbols, NULL, NULL, 800), - [FOODS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleFoods, NULL, NULL, 800), - [ETC] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleEtc, NULL, NULL, 800), - //[VEHICLES] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleVehicles, NULL, NULL, 800), - //[SUPPLEMENT] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleSupplement, NULL, NULL, 800), - [ALLS] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(cycleAll, NULL, NULL, 800) -// Other declarations would go here, separated by commas, if you have them -}; - -// macros -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case NEWDESK: // this would trigger when you hit a key mapped as M(0) - if (record->event.pressed) { - return MACRO( I(1), D(LGUI), D(LCTL), D(D), U(LGUI), U(LCTL), U(D), END ); // NEW DESKTOP - } - break; - case LEFTDESK: // this would trigger when you hit a key mapped as M(0) - if (record->event.pressed) { - return MACRO( I(1), D(LGUI), D(LCTL), D(LEFT), U(LGUI), U(LCTL), U(LEFT), END ); // LEFT DESKTOP - } - break; - case RIGHTDESK: // this would trigger when you hit a key mapped as M(0) - if (record->event.pressed) { - return MACRO( I(1), D(LGUI), D(LCTL), D(RGHT), U(LGUI), U(LCTL), U(RGHT), END ); // RIGHT DESKTOP - } - break; - case CLOSEDESK: // this would trigger when you hit a key mapped as M(0) - if (record->event.pressed) { - return MACRO( I(1), D(LGUI), D(LCTL), D(F4), U(LGUI), U(LCTL), U(F4), END ); // CLOSE DESKTOP - } - break; - } - return MACRO_NONE; -}; - - -// emojis in unicode -const uint32_t PROGMEM unicode_map[] = { - [EMOTIS] = 0x1F600, - [ANIMALS] = 0x1F400, - [SYMBOLS] = 0x1F300, - [FOODS] = 0x1F32D, - [ETC] = 0x1F440, - [VEHICLES] = 0x1F680, - [SUPPLEMENT] = 0x1F910, - [ALCHEMY] = 0x1F700 - }; -// Layouts -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - 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_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_PPLS, \ - KC_LCTL, 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_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), -[1] = KEYMAP(\ - TD(ALLS), 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_GRV, TD(EMOJIS),TD(ANIMAL),TD(ETC),TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), -[2] = KEYMAP(\ - 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_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_MPRV,KC_MPLY,KC_MNXT, 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_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, KC_D, 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_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_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2) , KC_NO , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), -}; - -LEADER_EXTERNS(); - -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - SEQ_TWO_KEYS(KC_A, KC_A) { // select all and copy - register_code(KC_LCTL); - tap(KC_A); - tap(KC_C); - unregister_code(KC_LCTL); - } - } -} - -void matrix_init_user(void) { - _delay_ms(500); - set_unicode_input_mode(UC_WINC); -}; - -void cycleAll(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[EMOTIS])); - unicode_input_finish(); - } - else if(state->count <= 1642) { - tap(KC_BSPC); - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[1])+state->count); - unicode_input_finish(); - } -}; - - -void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[EMOTIS])); - unicode_input_finish(); - } - else if(state->count <= 80) { - tap(KC_BSPC); - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[EMOTIS])+state->count); - unicode_input_finish(); - } -}; - -void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[ANIMALS])); - unicode_input_finish(); - } - else if(state->count <= MAXEMOJITAPS) { - tap(KC_BSPC); - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[ANIMALS])+state->count); - unicode_input_finish(); - } -}; - -void cycleFoods(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[FOODS])); - unicode_input_finish(); - } - else if(state->count <= 87) { - tap(KC_BSPC); - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[FOODS])+state->count); - unicode_input_finish(); - } -}; - - -void cycleEtc(qk_tap_dance_state_t *state, void *user_data) { - if(state->count == 1) { - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[ETC])); - unicode_input_finish(); - } - else if(state->count <= MAXEMOJITAPS) { - tap(KC_BSPC); - unicode_input_start(); - register_hex32(pgm_read_dword(&unicode_map[ETC])+state->count); - unicode_input_finish(); - } -}; - diff --git a/keyboards/frosty_flake/keymaps/nikchi/readme.md b/keyboards/frosty_flake/keymaps/nikchi/readme.md deleted file mode 100644 index 0b01f9dbf8..0000000000 --- a/keyboards/frosty_flake/keymaps/nikchi/readme.md +++ /dev/null @@ -1,24 +0,0 @@ -# The Nikchi's keymap for frosty_flake - -### FEATURING --SPACE CADET --Caps Lock is now LCTRL --LCTRL is Tap(LCTRL, Caps Lock) - -### LEADER KEY - RALT -COMBOS --a,a => Select All, Copy - - - -### FN REBINDS for Windows -``` - [W] [New Desktop] -[A][S][D] [Left Desk][Delete Desk][Right Desk] - -[Ins][Hom][PUp] [RW][PP][FF] -[Del][End][PDn] [MU][VD][VU] - -Arrows are Mouskeys, left three mods are clicks - -``` \ No newline at end of file diff --git a/keyboards/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/frosty_flake/keymaps/nikchi/rules.mk deleted file mode 100644 index b21eb64044..0000000000 --- a/keyboards/frosty_flake/keymaps/nikchi/rules.mk +++ /dev/null @@ -1,24 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 controls -AUDIO_ENABLE = no # Audio output on port C6 -UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes # unicodemap -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 -TAP_DANCE_ENABLE = yes -LEADER_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/frosty_flake/keymaps/nikchi/variableTapDance.md b/keyboards/frosty_flake/keymaps/nikchi/variableTapDance.md deleted file mode 100644 index b2e5041393..0000000000 --- a/keyboards/frosty_flake/keymaps/nikchi/variableTapDance.md +++ /dev/null @@ -1,9 +0,0 @@ -# Tap Dancing to different beats. -Tap Dance is constrained normally by `TAPPING_TERM` defined in your keyboard's config.h This proves to be challenging to work with when sometimes you just need more time to tap out your dance, or even a different "beat". - - - -- `ACTION_TAP_DANCE_FN_ADVANCED_TIME(user_fn_on_each_tap, user_fn_on_dance_finished, user_fn_on_dance_reset, tap_specific_tapping_term)` : This works the same as `ACTION_TAP_DANCE_FN_ADVANCED` just with the extra `tap_specific_tapping_term` arguement at the end. This way you can set a specific tap dance to have a longer or shorter tap in between your taps, giving you more, or less, time in between each tap. - - -`tap_specific_tapping_term` should be the same type and range of values that one would put into the `TAPPING_TERM` definition in the config.h file. diff --git a/keyboards/frosty_flake/keymaps/tkl/config.h b/keyboards/frosty_flake/keymaps/tkl/config.h deleted file mode 100644 index 8893d122e0..0000000000 --- a/keyboards/frosty_flake/keymaps/tkl/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/frosty_flake/keymaps/tkl/keymap.c b/keyboards/frosty_flake/keymaps/tkl/keymap.c deleted file mode 100644 index 99dc95627e..0000000000 --- a/keyboards/frosty_flake/keymaps/tkl/keymap.c +++ /dev/null @@ -1,11 +0,0 @@ -#include "frosty_flake.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP_TKL(\ - 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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) -}; diff --git a/keyboards/frosty_flake/keymaps/tkl/readme.md b/keyboards/frosty_flake/keymaps/tkl/readme.md deleted file mode 100644 index a076a65de9..0000000000 --- a/keyboards/frosty_flake/keymaps/tkl/readme.md +++ /dev/null @@ -1 +0,0 @@ -# TKL keymap for frosty_flake diff --git a/keyboards/frosty_flake/keymaps/tkl/rules.mk b/keyboards/frosty_flake/keymaps/tkl/rules.mk deleted file mode 100644 index f29756f223..0000000000 --- a/keyboards/frosty_flake/keymaps/tkl/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # 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 = no # 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 controls -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 diff --git a/keyboards/frosty_flake/matrix.c b/keyboards/frosty_flake/matrix.c deleted file mode 100644 index cde7f63b95..0000000000 --- a/keyboards/frosty_flake/matrix.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright 2017 Gabriel Young - - 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 . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif -static uint8_t debouncing = DEBOUNCING_DELAY; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t scan_col(void) { - return ( - (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | - (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<1)) | - (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | - (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<3)) | - (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | - (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<5)) | - (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<6)) | - (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<7)) - ); -} - -static void select_col(uint8_t col) { - switch (col) { - case 0: PORTD = (PORTD & ~0b01111011) | 0b00011011; break; - case 1: PORTD = (PORTD & ~0b01111011) | 0b01000011; break; - case 2: PORTD = (PORTD & ~0b01111011) | 0b01101010; break; - case 3: PORTD = (PORTD & ~0b01111011) | 0b01111001; break; - case 4: PORTD = (PORTD & ~0b01111011) | 0b01100010; break; - case 5: PORTD = (PORTD & ~0b01111011) | 0b01110001; break; - case 6: PORTD = (PORTD & ~0b01111011) | 0b01100001; break; - case 7: PORTD = (PORTD & ~0b01111011) | 0b01110000; break; - case 8: PORTD = (PORTD & ~0b01111011) | 0b01100000; break; - case 9: PORTD = (PORTD & ~0b01111011) | 0b01101000; break; - case 10: PORTD = (PORTD & ~0b01111011) | 0b00101011; break; - case 11: PORTD = (PORTD & ~0b01111011) | 0b00110011; break; - case 12: PORTD = (PORTD & ~0b01111011) | 0b00100011; break; - case 13: PORTD = (PORTD & ~0b01111011) | 0b01111000; break; - case 14: PORTD = (PORTD & ~0b01111011) | 0b00010011; break; - case 15: PORTD = (PORTD & ~0b01111011) | 0b01101001; break; - case 16: PORTD = (PORTD & ~0b01111011) | 0b00001011; break; - case 17: PORTD = (PORTD & ~0b01111011) | 0b00111011; break; - } -} - -void matrix_init(void) { - /* Row output pins */ - DDRD |= 0b01111011; - /* Column input pins */ - DDRC &= ~0b10000000; - DDRB &= ~0b01111111; - PORTC |= 0b10000000; - PORTB |= 0b01111111; - - for (uint8_t i=0; i < MATRIX_ROWS; i++) - matrix[i] = matrix_debouncing[i] = 0; - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); - _delay_us(3); - matrix_row_t col_scan = scan_col(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER Costar -#define PRODUCT Majestouch - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -//#define MATRIX_ROW_PINS { D0, D5 } -//#define MATRIX_COL_PINS { F1, F0, B0 } -//#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/kitten_paw/info.json b/keyboards/kitten_paw/info.json deleted file mode 100644 index 7d2574710a..0000000000 --- a/keyboards/kitten_paw/info.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "keyboard_name": "Kitten Paw", - "url": "", - "maintainer": "qmk", - "width": 22.5, - "height": 6.5, - "layouts": { - "LAYOUT": { - "key_count": 105, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"KC_NUBS", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] - }, - - "LAYOUT_fullsize_ansi": { - "key_count": 104, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] - } - } -} diff --git a/keyboards/kitten_paw/keymaps/default/keymap.c b/keyboards/kitten_paw/keymaps/default/keymap.c deleted file mode 100644 index 6767f04145..0000000000 --- a/keyboards/kitten_paw/keymaps/default/keymap.c +++ /dev/null @@ -1,51 +0,0 @@ -#include QMK_KEYBOARD_H - -enum layers { - DEFAULT, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEFAULT] = 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_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_PPLS, \ - 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_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_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} \ No newline at end of file diff --git a/keyboards/kitten_paw/keymaps/ickerwx/config.h b/keyboards/kitten_paw/keymaps/ickerwx/config.h deleted file mode 100644 index 142aba8909..0000000000 --- a/keyboards/kitten_paw/keymaps/ickerwx/config.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#undef MOUSEKEY_MOVE_MAX -#define MOUSEKEY_MOVE_MAX 127 -#undef MOUSEKEY_WHEEL_MAX -#define MOUSEKEY_WHEEL_MAX 110 -#undef MOUSEKEY_MOVE_DELTA -#define MOUSEKEY_MOVE_DELTA 5 -#undef MOUSEKEY_WHEEL_DELTA -#define MOUSEKEY_WHEEL_DELTA 1 -#undef MOUSEKEY_DELAY -#define MOUSEKEY_DELAY 50 -#undef MOUSEKEY_INTERVAL -#define MOUSEKEY_INTERVAL 20 -#undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 4 -#undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 30 -#undef MOUSEKEY_WHEEL_MAX_SPEED -#define MOUSEKEY_WHEEL_MAX_SPEED 3 -#undef MOUSEKEY_WHEEL_TIME_TO_MAX -#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 -#undef ONESHOT_TIMEOUT -#define ONESHOT_TIMEOUT 500 -#undef TAPPING_TOGGLE -#define TAPPING_TOGGLE 2 - -#endif diff --git a/keyboards/kitten_paw/keymaps/ickerwx/keymap.c b/keyboards/kitten_paw/keymaps/ickerwx/keymap.c deleted file mode 100644 index 856cef9cc2..0000000000 --- a/keyboards/kitten_paw/keymaps/ickerwx/keymap.c +++ /dev/null @@ -1,242 +0,0 @@ -#include QMK_KEYBOARD_H -#include "mousekey.h" - -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define C(kc) LCTL(KC_##kc) -#define RA(kc) RALT(KC_##kc) -#define KC_SLCT KC_SELECT -#define MEDAPP LT(MEDIA, KC_APP) -#undef S -#define S(kc) LSFT(KC_##kc) - -uint8_t current_layer_global = 255; - -enum layers { - DEFAULT, - PROG1, - PROG2, - MEDIA, - MOUSE1, - MOUSE2, - MISC, -}; - -enum function_id { - LSHFT_PAREN, - RSHFT_PAREN, - LCTRL_BRACKET, - RCTRL_BRACKET, - LALT_CURLY, - RALT_CURLY, - CTRL_CLICK -}; - -enum macro_id { - GRV, - CFLEX -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [DEFAULT] = 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_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_PPLS, \ - F(0), 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, \ - F(8),KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, F(9), KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - F(1),KC_LGUI, F(3), LT(MISC, KC_SPC), F(4), F(5), MEDAPP, F(2), KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), - /* Layer 1: Programming Layer 1, emulating US l ayout */ - [PROG1] = LAYOUT(\ - KC_ESC,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - M(GRV),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_SLSH, S(0),_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______, KC_Z,_______,_______,_______,_______, RA(8), RA(9),RA(MINS), _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,S(COMM),S(BSLS), _______, _______,_______,_______, \ - MO(PROG2),_______, KC_Y,_______,_______,_______,_______,_______,_______,_______,_______, S(7), MO(PROG2), _______, _______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), - /* Layer 2: programming layer 2 - all keys that are not FN keys are sent as LSFT+key on this layer - */ - [PROG2] = LAYOUT(\ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - RA(RBRC),_______, RA(Q),KC_BSLS,_______,_______,M(CFLEX), S(6),S(RBRC), S(8), S(9),S(SLSH),KC_RBRC,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, RA(7), RA(0),RA(NUBS), _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, S(DOT), S(2), _______, _______,_______,_______, \ - _______,S(NUBS),_______,_______,_______,_______,_______,_______,_______,KC_NUBS,S(NUBS),S(MINS), _______, _______, _______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), - /* Layer 3: media layer */ - [MEDIA] = LAYOUT(\ - KC_PWR,KC_SLEP,KC_WAKE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \ - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_MPRV,KC_MPLY,KC_MNXT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, KC_VOLD,KC_MUTE,KC_VOLU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX, \ - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, KC_EJCT, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, \ - XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX,_______,XXXXXXX, KC_MRWD,KC_MSTP,KC_MFFD, XXXXXXX,XXXXXXX), - /* Layer 4: Mouse layer */ - [MOUSE1] = LAYOUT(\ - F(6),_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,KC_ACL0,KC_ACL1,KC_ACL2,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,KC_BTN4,KC_WH_D,KC_MS_U,KC_WH_U,_______, C(Z),_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,KC_BTN5,KC_MS_L,KC_MS_D,KC_MS_R, F(7),KC_WH_L,KC_WH_D,KC_WH_U,KC_WH_R,_______,_______, _______, _______,_______,_______, \ - MO(MOUSE2),_______, C(Y), C(X), C(C), C(V),_______,KC_BTN2,KC_BTN3,C(PGUP),C(PGDN),_______, KC_RSFT, _______, _______,_______,_______,_______, \ - KC_LCTL,_______,KC_LALT, KC_BTN1, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, _______,_______,_______, _______,_______), - /* Layer 5: Mouse layer 2*/ - [MOUSE2] = LAYOUT(\ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,KC_BTN2,KC_WH_U,KC_BTN3,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,KC_WH_L,KC_WH_D,KC_WH_R,_______,KC_MS_L,KC_MS_D,KC_MS_U,KC_MS_R,_______,_______, _______, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______, \ - _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______, _______,_______), - /* Layer 6: Misc layer */ - [MISC] = LAYOUT(\ - _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,KC_SLCT, C(W), KC_UP,_______,_______,_______,_______,KC_BSPC, KC_DEL,_______,_______,_______,_______, _______,_______,_______, _______,_______,_______,_______, \ - _______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,KC_HOME,KC_PGDN,KC_PGUP,_______,_______,_______, _______, _______,_______,_______, \ - KC_LSFT,_______, C(Y), C(X), C(C), C(V), KC_SPC, KC_END,_______,C(PGUP),C(PGDN),_______, _______, _______, _______,_______,_______,_______, \ - _______,_______,_______, LT(MISC, KC_SPC), _______,_______,_______,_______, _______,_______,_______, _______,_______), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_TOGGLE(MOUSE1), // tap-toggle mouse layer (4) - [1] = ACTION_FUNCTION_TAP(LCTRL_BRACKET), // tap to print [ - [2] = ACTION_FUNCTION_TAP(RCTRL_BRACKET), // tap to print ] - [3] = ACTION_FUNCTION_TAP(LALT_CURLY), // tap to print { - [4] = ACTION_FUNCTION_TAP(RALT_CURLY), // tap to print } - [5] = ACTION_LAYER_TAP_TOGGLE(PROG1), // tap-toggle programming layer 1 - [6] = ACTION_LAYER_SET_CLEAR(DEFAULT), - [7] = ACTION_FUNCTION_TAP(CTRL_CLICK), - [8] = ACTION_FUNCTION_TAP(LSHFT_PAREN), // tap to print ( - [9] = ACTION_FUNCTION_TAP(RSHFT_PAREN), // tap to print ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case GRV: // macro to print accent grave - return (record->event.pressed ? - MACRO( D(LSFT), T(EQL), U(RALT), T(SPC), END) : - MACRO_NONE ); - case CFLEX: // print accent circonflex - return (record->event.pressed ? - MACRO( T(GRV), T(SPC), END ) : - MACRO_NONE ); - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - uint8_t layer; - layer = biton32(layer_state); - - if (current_layer_global != layer) { - current_layer_global = layer; - - // unset CAPSLOCK and SCROLL LOCK LEDs - led_set_kb(host_keyboard_leds() & ~(1<event.pressed) { - if (record->tap.count > 0 && !record->tap.interrupted) { - if (record->tap.interrupted) { - register_mods(MOD_BIT(orig_mod)); - } - } else { - register_mods(MOD_BIT(orig_mod)); - } - } else { - if (record->tap.count > 0 && !(record->tap.interrupted)) { - add_weak_mods(MOD_BIT(macro_mod)); - send_keyboard_report(); - register_code(macro_kc); - unregister_code(macro_kc); - del_weak_mods(MOD_BIT(macro_mod)); - send_keyboard_report(); - record->tap.count = 0; // ad hoc: cancel tap - } else { - unregister_mods(MOD_BIT(orig_mod)); - } - } -} - -/* if LCTRL is tabbed, print (, or ) if RCTRL is tabbed, same for LALT/RALT and [/] */ -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - // The code is copied from keymap_hasu.c in the tmk keyboards hhkb folder - switch (id) { - case LCTRL_BRACKET: - tap_helper(record, KC_LCTL, KC_RALT, KC_8); - break; - case RCTRL_BRACKET: - tap_helper(record, KC_RCTL, KC_RALT, KC_9); - break; - case LALT_CURLY: - tap_helper(record, KC_LALT, KC_RALT, KC_7); - break; - case RALT_CURLY: - tap_helper(record, KC_RALT, KC_RALT, KC_0); - break; - case LSHFT_PAREN: - tap_helper(record, KC_LSFT, KC_LSFT, KC_8); - break; - case RSHFT_PAREN: - tap_helper(record, KC_RSFT, KC_LSFT, KC_9); - break; - case CTRL_CLICK: - if (record->event.pressed) { - mousekey_clear(); - register_mods(MOD_BIT(KC_LCTL)); - send_keyboard_report(); - wait_ms(5); - mousekey_on(KC_BTN1); - mousekey_send(); - wait_ms(10); - mousekey_off(KC_BTN1); - mousekey_send(); - wait_ms(5); - unregister_mods(MOD_BIT(KC_LCTL)); - send_keyboard_report(); - } - break; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint8_t layer; - layer = biton32(layer_state); - if (layer == PROG2) { - if (keycode >= KC_A && keycode <= KC_EXSEL && \ - !( // do not send LSFT + these keycodes, they are needed for emulating the US layout - keycode == KC_NONUS_BSLASH || - keycode == KC_RBRC || - keycode == KC_BSLS || - keycode == KC_GRV - )) { - // LSFT is the modifier for this layer, so we set LSFT for every key to get the expected behavior - if (record->event.pressed) { - register_mods(MOD_LSFT); - } else { - unregister_mods(MOD_LSFT); - } - } - } - return true; -} diff --git a/keyboards/kitten_paw/keymaps/ickerwx/readme.md b/keyboards/kitten_paw/keymaps/ickerwx/readme.md deleted file mode 100644 index 0d23be4eac..0000000000 --- a/keyboards/kitten_paw/keymaps/ickerwx/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -# My personal keymap for the Kitten Paw controller - -This keymap only works correctly when you have your OS configured with a German keymap. Use the keymap however you like. It's most likely a living thing that will never be quite finished. - -## Description of the layers -Layer 0 (DEFAULT) works just like you would expect a keyboard to work, mostly, except: -Caps Lock switches to the mouse layer, RGUI and APP are switches to the programming layer and media layer. -Mouse and programming layer switches can be held or double-tapped to lock. -Holding space switches to the MISC layer where I currently accumulate useful shortcuts. -Tapping left and right Shift, Ctrl and Alt will send (), [] and {} respectively. - -Layers 1 and 2 (PROG1 and PROG2) emulate the US layout while still using a German OS keymap setting. I was annoyed of having to change the OS settings every time I wanted to use the US layout for coding, so I made these layers to behave just like the US layout even though the OS still uses German. The shift keys were a bit tricky, I had to use them as MO(PROG2) switches, so to get the actual expected behavior I enable LSFT for almost every keypress on PROG2 in ```process_record_user```. Since the shift keys are MO() function keys, they do not print () at the moment, which sucks. I'm working on it. - -Layer 3 (MEDIA) just has a couple of media keys on it, mainly around the cursor keys and nav key cluster. - -Layers 4 and 5 (MOUSE1 and MOUSE2) are mouse layers. Move the cursor using ESDF, scroll using HJKL, Space for left click, N and M for right and middle click. There's more, look at the keymap. - -Layer 6 is a layer I don't have a good name for, so I call it MISC. You'll find cursor keys at ESDF, other navigation keys around the HJKL cluster and F12 to F24 on the F-keys. For now. \ No newline at end of file diff --git a/keyboards/kitten_paw/kitten_paw.c b/keyboards/kitten_paw/kitten_paw.c deleted file mode 100644 index 26cb533f2d..0000000000 --- a/keyboards/kitten_paw/kitten_paw.c +++ /dev/null @@ -1,51 +0,0 @@ -#include "kitten_paw.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -__attribute__ ((weak)) -void matrix_init_user(void) { -} - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - CONFIG_LED_IO; - CONFIG_LED_IO; - print_dec(usb_led); - if (usb_led & (1< - - 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 . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif -static uint8_t debouncing = DEBOUNCING_DELAY; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint8_t read_rows(void); -static void select_col(uint8_t col); - -inline uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -/* Column pin configuration - * - * col: 0 1 2 3 4 5 6 7 - * pin: PC7 PD5 PD3 PD1 PC2 PD6 PD4 PD2 - * - * Rrr pin configuration - * - * These rrrs uses one 74HC154 4 to 16 bit demultiplexer (low - * active), together with 2 rrrs driven directly from the micro - * controller, to control the 18 rrrs. The rrrs are driven from - * pins B6,5,4,3,2,1,0. - */ -void matrix_init(void) { - DDRC &= ~0b10000100; // Row input pins - DDRD &= ~0b01111110; - PORTC |= 0b10000100; - PORTD |= 0b01111110; - - DDRB |= 0b01111111; // Column output pins - - 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++) { - select_col(col); - _delay_us(3); - uint8_t rows = read_rows(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6050 -#define DEVICE_VER 0x0104 -#define MANUFACTURER Filco -#define PRODUCT Majestouch TKL \\w The Pegasus Hoof -#define DESCRIPTION QMK firmware for Majestouch TKL - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#endif diff --git a/keyboards/pegasushoof/keymaps/blowrak/keymap.c b/keyboards/pegasushoof/keymaps/blowrak/keymap.c deleted file mode 100644 index 6faf4db6fa..0000000000 --- a/keyboards/pegasushoof/keymaps/blowrak/keymap.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -Copyright 2016 Daniel Svensson - -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 . -*/ - -#include "pegasushoof.h" - -#define _______ KC_TRNS - -/* Swedish keys */ -#define SE_HALF KC_GRV -#define SE_PLUS KC_MINS -#define SE_ACUT KC_EQL -#define SE_AO KC_LBRC -#define SE_CIRC KC_RBRC -#define SE_QUOT KC_BSLS -#define SE_OE KC_SCLN -#define SE_AE KC_QUOT -#define SE_MINS KC_SLSH -#define SE_LTGT KC_NUBS -#define SE_LCBR RALT(KC_7) -#define SE_LBRC RALT(KC_8) -#define SE_RBRC RALT(KC_9) -#define SE_RCBR RALT(KC_0) -#define SE_PIPE RALT(SE_LTGT) -#define SE_BSLS RALT(SE_PLUS) - -#define KM_BLOWRAK 0 -#define KM_QWERTY 1 -#define KM_MEDIA 2 -#define KM_HAXHAX 3 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Blowrak ISO layer, a Swedish take on Dvorak */ - [KM_BLOWRAK] = KEYMAP( \ - 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, \ - SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ - KC_TAB, SE_AO, SE_AE, SE_OE, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM,SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ - KC_LCTRL,KC_A, KC_O, KC_E, KC_U, KC_I, KC_H, KC_D, KC_T, KC_N, KC_S, SE_MINS, KC_ENT, \ - KC_LSFT, SE_LTGT,KC_DOT, KC_Q, KC_J, KC_K, KC_B, KC_X, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), - /* Layer 1: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ - 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, \ - SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,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, SE_AO, SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ - KC_LCTRL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SE_OE, SE_AE, KC_ENT, \ - KC_LSFT, SE_LTGT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, SE_MINS, KC_RSFT, KC_UP, \ - KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), - /* Layer 2: Media layer */ - [KM_MEDIA] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MUTE,_______,KC_VOLD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ - _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT), - /* Layer 3: Programming layer */ - [KM_HAXHAX] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,SE_LCBR,SE_PIPE,SE_RCBR,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,SE_LBRC,SE_BSLS,SE_RBRC,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ - _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______), -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA), - [1] = ACTION_LAYER_TOGGLE(KM_QWERTY) -}; - -void matrix_scan_user(void) -{ - uint8_t layer = biton32(layer_state); - switch (layer) { - case KM_BLOWRAK: - ph_caps_led_on(); - ph_sclk_led_off(); - break; - case KM_QWERTY: - ph_sclk_led_on(); - ph_caps_led_off(); - break; - } -} - -/* Mixes in KM_HAXHAX via RALT modifier without shadowing the RALT key combinations. */ -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint8_t modifiers = get_mods(); - if (modifiers & MOD_BIT(KC_RALT) && record->event.pressed) { - uint16_t kc = keymap_key_to_keycode(KM_HAXHAX, record->event.key); - if (kc != KC_TRNS) { - register_code(kc); - unregister_code(kc); - return false; - } - } - return true; -} diff --git a/keyboards/pegasushoof/keymaps/blowrak/rules.mk b/keyboards/pegasushoof/keymaps/blowrak/rules.mk deleted file mode 100644 index 168fb625b2..0000000000 --- a/keyboards/pegasushoof/keymaps/blowrak/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# 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 # 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 -CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 -NKRO_ENABLE = no # 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 controls -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. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/pegasushoof/keymaps/citadel/config.h b/keyboards/pegasushoof/keymaps/citadel/config.h deleted file mode 100644 index 2d27ff392d..0000000000 --- a/keyboards/pegasushoof/keymaps/citadel/config.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* overridden settings: */ - -#undef PRODUCT -#define PRODUCT Pegasus Hoof Citadel - -#endif diff --git a/keyboards/pegasushoof/keymaps/citadel/keymap.c b/keyboards/pegasushoof/keymaps/citadel/keymap.c deleted file mode 100644 index 382854de9b..0000000000 --- a/keyboards/pegasushoof/keymaps/citadel/keymap.c +++ /dev/null @@ -1,128 +0,0 @@ -/* Copyright 2018 Daniel Rose - * - * 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 . - */ - -#include "pegasushoof.h" - -/* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */ -#define G(kc) RALT(KC_##kc) -#define A(kc) LALT(KC_##kc) -#define C(kc) LCTL(KC_##kc) -#undef S /* Original shortcut (quantum_keycodes.h) takes full-sized keycodes: too long! */ -#define S(kc) LSFT(KC_##kc) -#define CTALDEL LCTL(LALT(KC_DEL)) - -enum layers { - DEF, - FUN, - RES, -}; - -enum tap_dance { - AF4, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Layer 0: default layer (ISO-DE) - * .----. .-------------------. .-------------------. .-------------------. .--------------. - * |Esc | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10 |F11 |F12 | |PrSc|SLck|2Tp:| - * | | | | | | | | | | | | | | | | | |SyRq| |A+F4| - * '----' '-------------------' '-------------------' '-------------------' '--------------' - * .------------------------------------------------------------------------. .--------------. - * |° |! |" |§ |$ |% |& |/ |( |) |= |? |` |Backspa| |Ins |Home|PgUp| - * |^ |1 |2 ²|3 ³|4 |5 |6 |7 {|8 [|9 ]|0 }|ß \|´ | | | | | | - * |------------------------------------------------------------------------| |--------------| - * |Tab |Q |W |E |R |T |Z |U |I |O |P |Ü |* | E | |Del |End |PgDn| - * | | | | €| | | | | | | | |+ ~| n | | | | | - * |------------------------------------------------------------------\ t | '--------------' - * |Fn: |A |S |D |F |G |H |J |K |L |Ö |Ä |' | e | - * |Layer 2| | | | | | | | | | | |# | r | - * |------------------------------------------------------------------------| .----. - * |Shift|> |Y |X |C |V |B |N |M |; |: |_ |Shift | |Up | - * | |< ¦| | | | | | | µ|, |. |- | | | | - * |------------------------------------------------------------------------| .--------------. - * |Ctrl |Super|Alt | |AltGr|Alt |Fn: |Ctrl | |Left|Down|Righ| - * | | | | | | |Lay 2| | | | | | - * '------------------------------------------------------------------------' '--------------' - * NUHS = true position of KC_NUHS - */ -[DEF] = KEYMAP( \ - 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,TD(AF4), \ - 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_NUHS, KC_DEL, KC_END, KC_PGDN, \ - MO(FUN),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,/*NUHS*/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_LALT,MO(FUN),KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), - - /* Layer 1: function layer - * .----. .-------------------. .-------------------. .-------------------. .--------------. - * |Ctl+| |My |WWW:|Calc|Medi| |Mus:|Mus:|Mus:|Mus:| |Vol:|Vol:|Vol:|See:| | | |Paus| - * |A+De| |Comp|Home| |Play| |Prev|Next|Paus|Stop| |Mute|Down|Up |[3] | | | |Brea| - * '----' '-------------------' '-------------------' '-------------------' '--------------' - * .------------------------------------------------------------------------. .--------------. - * | | | | | | | | | | | | | | | | | |Mou:| - * | | | | | | | |{ |[ |] |} |\ | | | | | |WhUp| - * |------------------------------------------------------------------------| |--------------| - * | | | | | | | | | | | | |~ | | | | |Mou:| - * | | | | | | | | | | | | | | | | | |WhDn| - * |------------------------------------------------------------------\ | '--------------' - * |CapsLck|Mou:|Mou:| | | | | | | | | | | | - * | |Fast|Slow| | | | | | | | | | | | - * |------------------------------------------------------------------------| .----. - * | | | | | | | | |µ | | | | | |Mou:| - * | | | | | | | | | | | | | | |Up | - * |------------------------------------------------------------------------| .--------------. - * |Mous:|Mous:| | | |Super|App | | |Mou:|Mou:|Mou:| - * |Bttn2|Bttn1| | | | | | | |Left|Down|Righ| - * '------------------------------------------------------------------------' '--------------' - * - */ -[FUN] = KEYMAP( \ - CTALDEL, KC_MYCM,KC_WHOM,KC_CALC,KC_MSEL,KC_MPRV,KC_MNXT,KC_MPLY,KC_MSTP,KC_MUTE,KC_VOLD,KC_VOLU,MO(RES), _______,KC_SLCK,KC_PAUS, \ - _______,_______,_______,_______,_______,_______,_______,G(7), G(8), G(9), G(0), G(MINS),_______,_______, _______,_______,KC_WH_U, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,G(RBRC),_______, _______,_______,KC_WH_D, \ - KC_CAPS,KC_ACL2,KC_ACL0,_______,_______,_______,_______,_______,_______,_______,_______,_______,/*NUHS*/_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,G(M), _______,_______,_______, _______, KC_MS_U, \ - KC_BTN2,KC_BTN1,_______, _______, _______,KC_RGUI,KC_APP ,_______, KC_MS_L,KC_MS_D,KC_MS_R), - - -/* Layer 3: Reset layer (prevents accidental resets) */ -[RES] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,/*NUHS*/_______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, \ - _______,_______,_______, _______, _______,_______,_______,_______, _______,_______,_______), -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - /* Tap once: nothing. Tap twice: Alt+F4 */ - [AF4] = ACTION_TAP_DANCE_DOUBLE(XXXXXXX,A(F4)), -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - ph_caps_led_on(); - } else { - ph_caps_led_off(); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - ph_sclk_led_on(); - } else { - ph_sclk_led_off(); - } -} diff --git a/keyboards/pegasushoof/keymaps/citadel/readme.md b/keyboards/pegasushoof/keymaps/citadel/readme.md deleted file mode 100644 index 3618bae861..0000000000 --- a/keyboards/pegasushoof/keymaps/citadel/readme.md +++ /dev/null @@ -1,75 +0,0 @@ -# Citadel keymap for pegasushoof - -Designed for ISO-DE and similar ISO layouts. - -The central idea of this keymap is to avoid unergonomic key combos that force the user to either press -multiple keys with one hand or to use the left hand for right-sided keys. For instance, ISO-DE users -have to press `AltGr`+`7` to type _{_. The keymap allows ergonomic access to the right-sided keys of the -German AltGr-layer by turning `Caps Lock` into a hybrid Fn/AltGr-key. It can easily be adapted for other -ISO layouts. - -The _Function_ layer also offers mouse emulation and function/media keys in the F-Row. - -`Pause/Break` is used as a safe _close key_: A _single tap_ does nothing, a _double tap_ executes ALT+F4. - -Named after the homonymous space station from _Mass Effect_. Made by [Daniel Rose](https://github.com/droseger/). - -## [1] Layers - -### Layer 1 (Default) - .----. .-------------------. .-------------------. .-------------------. .--------------. - |Esc | |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10 |F11 |F12 | |PrSc|SLck|2Tp:| - | | | | | | | | | | | | | | | | | |SyRq| |A+F4| - '----' '-------------------' '-------------------' '-------------------' '--------------' - .------------------------------------------------------------------------. .--------------. - |° |! |" |§ |$ |% |& |/ |( |) |= |? |` |Backspa| |Ins |Home|PgUp| - |^ |1 |2 ²|3 ³|4 |5 |6 |7 {|8 [|9 ]|0 }|ß \|´ | | | | | | - |------------------------------------------------------------------------| |--------------| - |Tab |Q |W |E |R |T |Z |U |I |O |P |Ü |* | E | |Del |End |PgDn| - | | | | €| | | | | | | | |+ ~| n | | | | | - |------------------------------------------------------------------\ t | '--------------' - |Fn: |A |S |D |F |G |H |J |K |L |Ö |Ä |' | e | - |Layer 2| | | | | | | | | | | |# | r | - |------------------------------------------------------------------------| .----. - |Shift|> |Y |X |C |V |B |N |M |; |: |_ |Shift | |Up | - | |< ¦| | | | | | | µ|, |. |- | | | | - |------------------------------------------------------------------------| .--------------. - |Ctrl |Super|Alt | |AltGr|Alt |Fn: |Ctrl | |Left|Down|Righ| - | | | | | | |Lay 2| | | | | | - '------------------------------------------------------------------------' '--------------' - -### Layer 2 (Function) - .----. .-------------------. .-------------------. .-------------------. .--------------. - |Ctl+| |My |WWW:|Calc|Medi| |Mus:|Mus:|Mus:|Mus:| |Vol:|Vol:|Vol:|See:| | | |Paus| - |A+De| |Comp|Home| |Play| |Prev|Next|Paus|Stop| |Mute|Down|Up |[3] | | | |Brea| - '----' '-------------------' '-------------------' '-------------------' '--------------' - .------------------------------------------------------------------------. .--------------. - | | | | | | | | | | | | | | | | | |Mou:| - | | | | | | | |{ |[ |] |} |\ | | | | | |WhUp| - |------------------------------------------------------------------------| |--------------| - | | | | | | | | | | | | |~ | | | | |Mou:| - | | | | | | | | | | | | | | | | | |WhDn| - |------------------------------------------------------------------\ | '--------------' - |CapsLck|Mou:|Mou:| | | | | | | | | | | | - | |Fast|Slow| | | | | | | | | | | | - |------------------------------------------------------------------------| .----. - | | | | | | | | |µ | | | | | |Mou:| - | | | | | | | | | | | | | | |Up | - |------------------------------------------------------------------------| .--------------. - |Mous:|Mous:| | | |Super|App | | |Mou:|Mou:|Mou:| - |Bttn2|Bttn1| | | | | | | |Left|Down|Righ| - '------------------------------------------------------------------------' '--------------' - -Layer 3 exists solely to prevent users from accidentally activating boot mode: `R` is redefined -as `RESET` key [3]. - -## [2] How to build and install -1) Prerequisite: install the necessary [build tools](https://docs.qmk.fm/#/getting_started_build_tools) -such as [dfu-programmer](https://github.com/dfu-programmer/dfu-programmer). - - You might need to [add udev rules](https://docs.qmk.fm/#/faq_build?id=can39t-program-on-linux) under Linux. -2) To test if the keymap compiles, simply run `make pegasushoof:citadel` -3) Enter the `qmk_firmware` root directory and run `make pegasushoof:citadel:dfu` -4) Reset controller to _Boot mode_ by pressing the `RESET` key or by using a magnet. - -## [3] How to access Boot mode after install -Press `Fn+F12+R` diff --git a/keyboards/pegasushoof/keymaps/citadel/rules.mk b/keyboards/pegasushoof/keymaps/citadel/rules.mk deleted file mode 100644 index 0dd8a79f4e..0000000000 --- a/keyboards/pegasushoof/keymaps/citadel/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# Build Options -# change to "no" to disable the options -# -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 = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 -NKRO_ENABLE = no # 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 controls -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. -TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000) - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/pegasushoof/keymaps/default/keymap.c b/keyboards/pegasushoof/keymaps/default/keymap.c deleted file mode 100644 index aa006b23a4..0000000000 --- a/keyboards/pegasushoof/keymaps/default/keymap.c +++ /dev/null @@ -1,60 +0,0 @@ -/* -Copyright 2016 Daniel Svensson - -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 . -*/ - -#include "pegasushoof.h" - -#define _______ KC_TRNS - -#define KM_QWERTY 0 -#define KM_MEDIA 1 - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ - 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_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_CLCK, 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,KC_MENU,KC_FN0, KC_LEFT,KC_DOWN,KC_RGHT), - /* Layer 1: Function layer */ - [KM_MEDIA] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ - _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT) -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA) -}; - -void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - ph_caps_led_on(); - } else { - ph_caps_led_off(); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - ph_sclk_led_on(); - } else { - ph_sclk_led_off(); - } -} diff --git a/keyboards/pegasushoof/keymaps/default/rules.mk b/keyboards/pegasushoof/keymaps/default/rules.mk deleted file mode 100644 index 168fb625b2..0000000000 --- a/keyboards/pegasushoof/keymaps/default/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -# 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 # 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 -CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 -NKRO_ENABLE = no # 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 controls -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. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/pegasushoof/matrix.c b/keyboards/pegasushoof/matrix.c deleted file mode 100644 index d2a74b8d72..0000000000 --- a/keyboards/pegasushoof/matrix.c +++ /dev/null @@ -1,204 +0,0 @@ -/* -Copyright 2014 Ralf Schmitt -Copyright 2016 Daniel Svensson - -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 . -*/ - -#include -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -static uint8_t debouncing = DEBOUNCING_DELAY; -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void select_row(uint8_t col); - -inline uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - /* Column output pins */ - DDRD |= 0b01111011; - /* Row input pins */ - DDRC &= ~0b10000000; - DDRB &= ~0b01111111; - PORTC |= 0b10000000; - PORTB |= 0b01111111; - - 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++) { - select_row(col); - wait_us(30); - matrix_row_t rows = read_cols(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -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 . -*/ - -#include "pegasushoof.h" - - -extern inline void ph_caps_led_on(void); -extern inline void ph_caps_led_off(void); - -extern inline void ph_sclk_led_on(void); -extern inline void ph_sclk_led_off(void); - - -__attribute__ ((weak)) -void matrix_init_user(void) { -}; - -__attribute__ ((weak)) -void matrix_scan_user(void) { -} - -__attribute__ ((weak)) -bool process_action_user(keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -void led_set_user(uint8_t usb_led) { -} - -void matrix_init_kb(void) { - matrix_init_user(); -} - -void matrix_scan_kb(void) { - matrix_scan_user(); -} - -bool process_action_kb(keyrecord_t *record) { - return process_action_user(record); -} - -void led_set_kb(uint8_t usb_led) { - led_set_user(usb_led); -} diff --git a/keyboards/pegasushoof/pegasushoof.h b/keyboards/pegasushoof/pegasushoof.h deleted file mode 100644 index d031e3ed25..0000000000 --- a/keyboards/pegasushoof/pegasushoof.h +++ /dev/null @@ -1,51 +0,0 @@ -/* -Copyright 2016 Daniel Svensson - -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 . -*/ - -#ifndef PEGASUSHOOF_H -#define PEGASUSHOOF_H - -#include "matrix.h" -#include "quantum.h" - -#define ___ KC_NO - -#define KEYMAP( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ - KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ - KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ - ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ - /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , ___ , ___ , ___ , KJ0 , KK0 , ___ , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ - /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ - /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ - /* 3 */ { KA3 , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ - /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ - /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ - /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ - /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \ - } - -inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } -inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } - -inline void ph_sclk_led_on(void) { DDRC |= (1<<5); PORTC &= ~(1<<5); } -inline void ph_sclk_led_off(void) { DDRC &= ~(1<<5); PORTC &= ~(1<<5); } - - -#endif diff --git a/keyboards/pegasushoof/rules.mk b/keyboards/pegasushoof/rules.mk deleted file mode 100644 index c5a35428ca..0000000000 --- a/keyboards/pegasushoof/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ -# MCU name -MCU = atmega32u2 - -# 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 - - -# Boot Section Size in *bytes* -# 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 = yes # 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 -NKRO_ENABLE = no # 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 controls -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. - - -CUSTOM_MATRIX = yes -SRC = matrix.c diff --git a/keyboards/tiger_lily/config.h b/keyboards/tiger_lily/config.h deleted file mode 100644 index 4908192906..0000000000 --- a/keyboards/tiger_lily/config.h +++ /dev/null @@ -1,147 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Bathroom Epiphanies -#define PRODUCT tiger_lily -#define DESCRIPTION Tiger Lily controller for the Filco Majestouch 2 - -/* - * Frosty Flake Rev. 20140521 made by Bathroom Ephiphanies - * Ported from the Bathroom Epiphanies TMK Firmware: - * https://github.com/BathroomEpiphanies/epiphanies_tmk_keyboard/tree/master/be_controllers - * - */ - -/* key matrix size */ -#define MATRIX_ROWS 8 // Row0 - Row7 in the schematic -#define MATRIX_COLS 18 // ColA - ColR in the schematic - -/* - * Keyboard Matrix Assignments - */ -#define UNUSED_PINS { B0, C4, D3 } - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/tiger_lily/info.json b/keyboards/tiger_lily/info.json deleted file mode 100644 index 1a2194b06f..0000000000 --- a/keyboards/tiger_lily/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "keyboard_name": "tiger_lily", - "url": "", - "maintainer": "qmk", - "width": 22.5, - "height": 6.5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] - }, - "LAYOUT_fullsize_ansi": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Num Lock", "x":18.5, "y":1.5}, {"label":"/", "x":19.5, "y":1.5}, {"label":"*", "x":20.5, "y":1.5}, {"label":"-", "x":21.5, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"7", "x":18.5, "y":2.5}, {"label":"8", "x":19.5, "y":2.5}, {"label":"9", "x":20.5, "y":2.5}, {"label":"+", "x":21.5, "y":2.5, "h":2}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"4", "x":18.5, "y":3.5}, {"label":"5", "x":19.5, "y":3.5}, {"label":"6", "x":20.5, "y":3.5}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"1", "x":18.5, "y":4.5}, {"label":"2", "x":19.5, "y":4.5}, {"label":"3", "x":20.5, "y":4.5}, {"label":"Enter", "x":21.5, "y":4.5, "h":2}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}, {"label":"0", "x":18.5, "y":5.5, "w":2}, {"label":".", "x":20.5, "y":5.5}] - } - } -} diff --git a/keyboards/tiger_lily/keymaps/default/config.h b/keyboards/tiger_lily/keymaps/default/config.h deleted file mode 100644 index 8893d122e0..0000000000 --- a/keyboards/tiger_lily/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/tiger_lily/keymaps/default/keymap.c b/keyboards/tiger_lily/keymaps/default/keymap.c deleted file mode 100644 index 46c17aca8b..0000000000 --- a/keyboards/tiger_lily/keymaps/default/keymap.c +++ /dev/null @@ -1,11 +0,0 @@ -#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_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_PPLS, \ - 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_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_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; \ No newline at end of file diff --git a/keyboards/tiger_lily/keymaps/default/readme.md b/keyboards/tiger_lily/keymaps/default/readme.md deleted file mode 100644 index 4626859df4..0000000000 --- a/keyboards/tiger_lily/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for tiger_lily diff --git a/keyboards/tiger_lily/keymaps/default/rules.mk b/keyboards/tiger_lily/keymaps/default/rules.mk deleted file mode 100644 index 9d3df5964f..0000000000 --- a/keyboards/tiger_lily/keymaps/default/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tiger_lily/keymaps/default_ansi/config.h b/keyboards/tiger_lily/keymaps/default_ansi/config.h deleted file mode 100644 index 8893d122e0..0000000000 --- a/keyboards/tiger_lily/keymaps/default_ansi/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/tiger_lily/keymaps/default_ansi/keymap.c b/keyboards/tiger_lily/keymaps/default_ansi/keymap.c deleted file mode 100644 index 6457b0282a..0000000000 --- a/keyboards/tiger_lily/keymaps/default_ansi/keymap.c +++ /dev/null @@ -1,11 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_fullsize_ansi(\ - 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_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_PPLS, \ - 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_LSFT, 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_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; \ No newline at end of file diff --git a/keyboards/tiger_lily/keymaps/default_ansi/readme.md b/keyboards/tiger_lily/keymaps/default_ansi/readme.md deleted file mode 100644 index 2cb8c89935..0000000000 --- a/keyboards/tiger_lily/keymaps/default_ansi/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# default_ansi - -A standard fullsize ANSI-layout keymap for Tiger Lily-powered keyboards. diff --git a/keyboards/tiger_lily/keymaps/default_ansi/rules.mk b/keyboards/tiger_lily/keymaps/default_ansi/rules.mk deleted file mode 100644 index 9d3df5964f..0000000000 --- a/keyboards/tiger_lily/keymaps/default_ansi/rules.mk +++ /dev/null @@ -1,21 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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 - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/tiger_lily/matrix.c b/keyboards/tiger_lily/matrix.c deleted file mode 100644 index d3a0d7ebd1..0000000000 --- a/keyboards/tiger_lily/matrix.c +++ /dev/null @@ -1,137 +0,0 @@ -/* - Copyright 2017 Gabriel Young - - 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 . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif -static uint8_t debouncing = DEBOUNCING_DELAY; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t scan_col(void) { - return ( - (PINC&(1<<2) ? 0 : ((matrix_row_t)1<<0)) | \ - (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<1)) | \ - (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<2)) | \ - (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<3)) | \ - (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<4)) | \ - (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<5)) | \ - (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<6)) | \ - (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<7)) - ); -} - -static void select_col(uint8_t col) { - switch (col) { - case 0: PORTD = (PORTD & ~0b01110111) | 0b01110110; break; \ - case 1: PORTD = (PORTD & ~0b01110111) | 0b01100001; break; \ - case 2: PORTD = (PORTD & ~0b01110111) | 0b01100101; break; \ - case 3: PORTD = (PORTD & ~0b01110111) | 0b00000011; break; \ - case 4: PORTD = (PORTD & ~0b01110111) | 0b00000111; break; \ - case 5: PORTD = (PORTD & ~0b01110111) | 0b00010011; break; \ - case 6: PORTD = (PORTD & ~0b01110111) | 0b00010111; break; \ - case 7: PORTD = (PORTD & ~0b01110111) | 0b00100011; break; \ - case 8: PORTD = (PORTD & ~0b01110111) | 0b00100111; break; \ - case 9: PORTD = (PORTD & ~0b01110111) | 0b00110011; break; \ - case 10: PORTD = (PORTD & ~0b01110111) | 0b01110010; break; \ - case 11: PORTD = (PORTD & ~0b01110111) | 0b01100110; break; \ - case 12: PORTD = (PORTD & ~0b01110111) | 0b01110000; break; \ - case 13: PORTD = (PORTD & ~0b01110111) | 0b01100100; break; \ - case 14: PORTD = (PORTD & ~0b01110111) | 0b01100000; break; \ - case 15: PORTD = (PORTD & ~0b01110111) | 0b01000111; break; \ - case 16: PORTD = (PORTD & ~0b01110111) | 0b01000011; break; \ - case 17: PORTD = (PORTD & ~0b01110111) | 0b00110111; break; - } -} - -void matrix_init(void) { - /* Column output pins */ \ - DDRD |= 0b01110111; \ - /* Row input pins */ \ - DDRC &= ~0b10000100; \ - DDRB &= ~0b01111110; \ - PORTC |= 0b10000100; \ - PORTB |= 0b01111110; - - for (uint8_t i=0; i < MATRIX_ROWS; i++) - matrix[i] = matrix_debouncing[i] = 0; - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); - _delay_us(3); - matrix_row_t col_scan = scan_col(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x1337 -#define DEVICE_VER 0x0001 -#define MANUFACTURER BathroomEpiphanies -#define PRODUCT Unloved Bastard -#define DESCRIPTION Unloved Bastard controller for CM Masterkeys S - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -#endif diff --git a/keyboards/unloved_bastard/info.json b/keyboards/unloved_bastard/info.json deleted file mode 100644 index efa995088b..0000000000 --- a/keyboards/unloved_bastard/info.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "keyboard_name": "unloved_bastard", - "url": "", - "maintainer": "qmk", - "bootloader": "", - "width": 18.25, - "height": 6.5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":1.25}, {"label":"|", "x":1.25, "y":4.5}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] - }, - "LAYOUT_tkl_ansi": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5, "w":2}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] - } - } -} diff --git a/keyboards/unloved_bastard/keymaps/default/config.h b/keyboards/unloved_bastard/keymaps/default/config.h deleted file mode 100644 index c55f7f9f7d..0000000000 --- a/keyboards/unloved_bastard/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Alexander Fougner - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/unloved_bastard/keymaps/default/keymap.c b/keyboards/unloved_bastard/keymaps/default/keymap.c deleted file mode 100644 index ea103154ea..0000000000 --- a/keyboards/unloved_bastard/keymaps/default/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2018 Alexander Fougner - * - * 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 . - */ -#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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/unloved_bastard/keymaps/default/readme.md b/keyboards/unloved_bastard/keymaps/default/readme.md deleted file mode 100644 index a2b5f1192f..0000000000 --- a/keyboards/unloved_bastard/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for unloved_bastard diff --git a/keyboards/unloved_bastard/keymaps/default_ansi/config.h b/keyboards/unloved_bastard/keymaps/default_ansi/config.h deleted file mode 100644 index c55f7f9f7d..0000000000 --- a/keyboards/unloved_bastard/keymaps/default_ansi/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Alexander Fougner - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/unloved_bastard/keymaps/default_ansi/keymap.c b/keyboards/unloved_bastard/keymaps/default_ansi/keymap.c deleted file mode 100644 index 16c0342d23..0000000000 --- a/keyboards/unloved_bastard/keymaps/default_ansi/keymap.c +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright 2018 Alexander Fougner - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_tkl_ansi(\ - 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_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_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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/unloved_bastard/keymaps/default_ansi/readme.md b/keyboards/unloved_bastard/keymaps/default_ansi/readme.md deleted file mode 100644 index 00d90f12c9..0000000000 --- a/keyboards/unloved_bastard/keymaps/default_ansi/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# default_ansi - -A standard tenkeyless ANSI-layout keymap for Unloved Bastard-powered keyboards. diff --git a/keyboards/unloved_bastard/matrix.c b/keyboards/unloved_bastard/matrix.c deleted file mode 100644 index 65773879bc..0000000000 --- a/keyboards/unloved_bastard/matrix.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - Copyright 2017 Gabriel Young - Copyright 2018 Alexander Fougner - - 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 . -*/ - -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif -static uint8_t debouncing = DEBOUNCING_DELAY; - -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t scan_col(void) { - return ( - (PINC&(1<<7) ? 0 : ((matrix_row_t)1<<0)) | - (PINB&(1<<6) ? 0 : ((matrix_row_t)1<<1)) | - (PINB&(1<<1) ? 0 : ((matrix_row_t)1<<2)) | - (PINB&(1<<0) ? 0 : ((matrix_row_t)1<<3)) | - (PINB&(1<<5) ? 0 : ((matrix_row_t)1<<4)) | - (PINB&(1<<3) ? 0 : ((matrix_row_t)1<<5)) | - (PINB&(1<<4) ? 0 : ((matrix_row_t)1<<6)) | - (PINB&(1<<2) ? 0 : ((matrix_row_t)1<<7)) - ); -} - -static void select_col(uint8_t col) { - switch (col) { - case 0: PORTD = (PORTD & ~0b00111111) | 0b00110011; break; - case 1: PORTD = (PORTD & ~0b00111111) | 0b00100011; break; - case 2: PORTD = (PORTD & ~0b00111111) | 0b00010111; break; - case 3: PORTD = (PORTD & ~0b00111111) | 0b00110011; break; - case 4: PORTD = (PORTD & ~0b00111111) | 0b00010011; break; - case 5: PORTD = (PORTD & ~0b00111111) | 0b00011011; break; - case 6: PORTD = (PORTD & ~0b00111111) | 0b00110100; break; - case 7: PORTD = (PORTD & ~0b00111111) | 0b00111010; break; - case 8: PORTD = (PORTD & ~0b00111111) | 0b00111000; break; - case 9: PORTD = (PORTD & ~0b00111111) | 0b00111100; break; - case 10: PORTD = (PORTD & ~0b00111111) | 0b00110010; break; - case 11: PORTD = (PORTD & ~0b00111111) | 0b00011111; break; - case 12: PORTD = (PORTD & ~0b00111111) | 0b00001111; break; - case 13: PORTD = (PORTD & ~0b00111111) | 0b00100111; break; - case 14: PORTD = (PORTD & ~0b00111111) | 0b00000111; break; - case 15: PORTD = (PORTD & ~0b00111111) | 0b00110110; break; - case 16: PORTD = (PORTD & ~0b00111111) | 0b00001011; break; - case 17: PORTD = (PORTD & ~0b00111111) | 0b00000011; break; - } -} - -void matrix_init(void) { - /* Row output pins */ - DDRD |= 0b00111111; - /* Column input pins */ - DDRC &= ~0b10000000; - DDRB &= ~0b01111111; - PORTC |= 0b10000000; - PORTB |= 0b01111111; - - for (uint8_t i=0; i < MATRIX_ROWS; i++) - matrix[i] = matrix_debouncing[i] = 0; - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) { - for (uint8_t col = 0; col < MATRIX_COLS; col++) { - select_col(col); - _delay_us(3); - matrix_row_t col_scan = scan_col(); - for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - bool prev_bit = matrix_debouncing[row] & ((matrix_row_t)1< - * - * 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 . - */ -#include "unloved_bastard.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - led_init_ports(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - return process_record_user(keycode, record); -} - -// C5 left -// C6 middle led -// B7 right led -void led_init_ports(void) { - DDRB |= (1<<7); - DDRC |= (1<<5); - DDRC |= (1<<6); - - PORTB |= (1<<7); - PORTC |= (1<<5); - PORTC |= (1<<6); -} - - -void led_set_kb(uint8_t usb_led) { - - if (usb_led & (1<. - */ -#ifndef UNLOVED_BASTARD_H -#define UNLOVED_BASTARD_H - -#include "quantum.h" - -#define LAYOUT( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ - KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ - KP4, KN2, KN6, KQ6, KN0, KN3, KM0, KP1, KC0, KQ0, KR0 \ -) \ -{ \ -/* Columns and rows need to be swapped in the below definition */ \ -/* A B C D E F G H I J K L M N O P Q R */ \ -/* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KC_NO, KC_NO, KC_NO, KJ0, KK0, KC_NO, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ -/* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ -/* 2 */ { KC_NO, KB2, KC_NO, KC_NO, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KN2, KO2, KC_NO, KC_NO, KC_NO }, \ -/* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KC_NO, KC_NO }, \ -/* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ -/* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ -/* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KH6, KI6, KJ6, KK6, KL6, KC_NO,KN6, KO6, KC_NO, KQ6, KC_NO }, \ -/* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KM7, KN7, KC_NO, KP7, KC_NO, KC_NO } \ -} - -#define LAYOUT_tkl_ansi( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ - KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ - KP4, KN2, KN6, KQ6, KN0, KN3, KM0, KP1, KC0, KQ0, KR0 \ -) \ -{ \ -/* Columns and rows need to be swapped in the below definition */ \ -/* A B C D E F G H I J K L M N O P Q R */ \ -/* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KC_NO, KC_NO, KC_NO, KJ0, KK0, KC_NO, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ -/* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ -/* 2 */ { KC_NO, KB2, KC_NO, KC_NO, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KN2, KO2, KC_NO, KC_NO, KC_NO }, \ -/* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KN3, KO3, KC_NO, KC_NO, KC_NO }, \ -/* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ -/* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ -/* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO,KN6, KO6, KC_NO, KQ6, KC_NO }, \ -/* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KM7, KN7, KC_NO, KP7, KC_NO, KC_NO } \ -} - -#endif -- cgit v1.2.3 From 6cab5140368c006030f35a9c7eaa946b0fdd78ef Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Thu, 20 Sep 2018 00:33:00 +0100 Subject: Keymap: Initial commit of dshields keymap for the model01 keyboard. (#3942) --- keyboards/model01/keymaps/dshields/config.h | 31 ++++++++++++++++ keyboards/model01/keymaps/dshields/keymap.c | 53 ++++++++++++++++++++++++++++ keyboards/model01/keymaps/dshields/readme.md | 10 ++++++ keyboards/model01/keymaps/dshields/rules.mk | 2 ++ 4 files changed, 96 insertions(+) create mode 100644 keyboards/model01/keymaps/dshields/config.h create mode 100644 keyboards/model01/keymaps/dshields/keymap.c create mode 100644 keyboards/model01/keymaps/dshields/readme.md create mode 100644 keyboards/model01/keymaps/dshields/rules.mk diff --git a/keyboards/model01/keymaps/dshields/config.h b/keyboards/model01/keymaps/dshields/config.h new file mode 100644 index 0000000000..86a4dd5314 --- /dev/null +++ b/keyboards/model01/keymaps/dshields/config.h @@ -0,0 +1,31 @@ +#pragma once + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define USB_MAX_POWER_CONSUMPTION 100 +#define ONESHOT_TAP_TOGGLE 2 +#define ONESHOT_TIMEOUT 3000 + +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 40 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 + +// dynamic macro keys +#define DM_PLAY DYN_MACRO_PLAY1 +#define DM_STRT DYN_REC_START1 +#define DM_STOP DYN_REC_STOP + +// one-shot layer keys +#define OSL_FUN OSL(FUN) + +// one-shot modifier keys +#define OSMLCTL OSM(MOD_LCTL) +#define OSMRCTL OSM(MOD_RCTL) +#define OSMLALT OSM(MOD_LALT) +#define OSMRALT OSM(MOD_RALT) +#define OSMLSFT OSM(MOD_LSFT) +#define OSMRSFT OSM(MOD_RSFT) + diff --git a/keyboards/model01/keymaps/dshields/keymap.c b/keyboards/model01/keymaps/dshields/keymap.c new file mode 100644 index 0000000000..3a89d062b5 --- /dev/null +++ b/keyboards/model01/keymaps/dshields/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +enum { DEF, FUN }; +enum { DYNAMIC_MACRO_RANGE = SAFE_RANGE }; + +#include "dynamic_macro.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[DEF] = LAYOUT( + RESET , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, + KC_GRV , KC_Q , KC_W , KC_E , KC_R , KC_T , RGB_TOG, DM_PLAY, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_EQL , + KC_PGUP, KC_A , KC_S , KC_D , KC_F , KC_G , KC_TAB , KC_ENT , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, + KC_PGDN, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_ESC , _______, KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_MINS, + OSMLCTL, KC_RCTL, + KC_BSPC, KC_SPC , + KC_LGUI, OSMRALT, + OSMLSFT, OSMRSFT, + OSL_FUN, OSL_FUN + ), +[FUN] = LAYOUT( + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , + KC_TAB , _______, KC_MS_U, _______, KC_BTN3, _______, RGB_MOD, DM_STRT, _______, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_F12 , + KC_HOME, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, _______, _______, DM_STOP, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______, + KC_END , KC_PSCR, KC_INS , _______, KC_BTN2, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, KC_PIPE, + _______, _______, + KC_DEL , KC_ENT , + _______, _______, + _______, _______, + _______, _______ + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case DEF: + set_all_leds_to(0,0,0); + break; + case FUN: + // TODO light the fn keys + // set_led_to(?, 0, 128, 0); + // set_led_to(?, 0, 128, 0); + break; + } + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + return true; +} + diff --git a/keyboards/model01/keymaps/dshields/readme.md b/keyboards/model01/keymaps/dshields/readme.md new file mode 100644 index 0000000000..ead1c1aad2 --- /dev/null +++ b/keyboards/model01/keymaps/dshields/readme.md @@ -0,0 +1,10 @@ + +About +------ + +A lightly modded version of the default keymap. + +- One-shot modifiers and layers. +- Dynamic macros +- No num lock layer + diff --git a/keyboards/model01/keymaps/dshields/rules.mk b/keyboards/model01/keymaps/dshields/rules.mk new file mode 100644 index 0000000000..4d1abd88ad --- /dev/null +++ b/keyboards/model01/keymaps/dshields/rules.mk @@ -0,0 +1,2 @@ +# used by default keymap +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -- cgit v1.2.3 From 4c22e92ce81cc5fecce713c7525d7102df39f2df Mon Sep 17 00:00:00 2001 From: Simon Dagfinrud Date: Thu, 20 Sep 2018 01:34:08 +0200 Subject: Keymap: Fix tada68:iso-nor to match latest ISO_layout (#3946) --- keyboards/tada68/keymaps/iso-nor/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/tada68/keymaps/iso-nor/keymap.c b/keyboards/tada68/keymaps/iso-nor/keymap.c index 2e6a80750f..c26932b0e4 100644 --- a/keyboards/tada68/keymaps/iso-nor/keymap.c +++ b/keyboards/tada68/keymaps/iso-nor/keymap.c @@ -21,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_BL] = LAYOUT_iso( KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_GRV, KC_BSPC, KC_EQL, \ - 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_NUHS, KC_DEL, \ - 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_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_DEL, \ + 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_NUHS, KC_ENT, KC_PGUP, \ 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_PGDN, \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), @@ -42,9 +42,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FL] = LAYOUT_iso( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, KC_PSCR, \ - _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, BL_TOGG, KC_INS, \ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, BL_TOGG, _______, KC_INS, \ _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_END, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -- cgit v1.2.3 From cfdc23bbaea69039d01e57e7256b62010635c260 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 20 Sep 2018 11:00:19 -0400 Subject: Keyboard: Add Quefrency 65 support in configurator (#3950) * Fix Quefrency configurator layout to support new key added * Add configurator support for Quefrency 65 --- keyboards/quefrency/info.json | 94 ++++++++++++++++++++++++-- keyboards/quefrency/keymaps/default65/keymap.c | 8 +-- 2 files changed, 94 insertions(+), 8 deletions(-) diff --git a/keyboards/quefrency/info.json b/keyboards/quefrency/info.json index f63cd1f6c3..160e7896bb 100644 --- a/keyboards/quefrency/info.json +++ b/keyboards/quefrency/info.json @@ -2,7 +2,7 @@ "keyboard_name": "Quefrency", "url": "https://keeb.io", "maintainer": "nooges", - "width": 16, + "width": 17, "height": 5, "layouts": { "LAYOUT": { @@ -72,17 +72,103 @@ {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Alt", "x":1.25, "y":4, "w":1.25}, - {"label":"GUI", "x":2.5, "y":4, "w":1.25}, + {"label":"Win", "x":2.5, "y":4, "w":1.25}, {"label":"Fn", "x":3.75, "y":4, "w":1.25}, {"label":"Space", "x":5, "y":4, "w":2.25}, - {"label":"Backspace", "x":8.25, "y":4, "w":2.75}, + {"label":"Fn", "x":8.25, "y":4, "w":1.25}, + {"label":"Space", "x":9.5, "y":4, "w":1.5}, {"label":"Alt", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"Left", "x":13, "y":4}, {"label":"Down", "x":14, "y":4}, {"label":"Right", "x":15, "y":4} ] - } + }, + "LAYOUT_65": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + + {"label":"7", "x":8, "y":0}, + {"label":"8", "x":9, "y":0}, + {"label":"9", "x":10, "y":0}, + {"label":"0", "x":11, "y":0}, + {"label":"-", "x":12, "y":0}, + {"label":"=", "x":13, "y":0}, + {"label":"Del", "x":14, "y":0}, + {"label":"Bksp", "x":15, "y":0}, + {"label":"Home", "x":16, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"[", "x":12.5, "y":1}, + {"label":"]", "x":13.5, "y":1}, + {"label":"Backslash", "x":14.5, "y":1, "w":1.5}, + {"label":"End", "x":16, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":";", "x":11.75, "y":2}, + {"label":"'", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, + {"label":"Page Up", "x":16, "y":2}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + + {"label":"N", "x":8.25, "y":3}, + {"label":"M", "x":9.25, "y":3}, + {"label":",", "x":10.25, "y":3}, + {"label":".", "x":11.25, "y":3}, + {"label":"/", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.75}, + {"label":"Up", "x":15, "y":3}, + {"label":"Page Down", "x":16, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Alt", "x":1.25, "y":4, "w":1.25}, + {"label":"Win", "x":2.5, "y":4, "w":1.25}, + {"label":"Fn", "x":3.75, "y":4, "w":1.25}, + {"label":"Space", "x":5, "y":4, "w":2.25}, + + {"label":"Fn", "x":8.25, "y":4, "w":1.25}, + {"label":"Space", "x":9.5, "y":4, "w":1.5}, + {"label":"Alt", "x":11, "y":4}, + {"label":"Ctrl", "x":12, "y":4}, + {"label":"Win", "x":13, "y":4}, + {"label":"Left", "x":14, "y":4}, + {"label":"Down", "x":15, "y":4}, + {"label":"Right", "x":16, "y":4} + ] + } } } diff --git a/keyboards/quefrency/keymaps/default65/keymap.c b/keyboards/quefrency/keymaps/default65/keymap.c index b660b5d86b..4b07949b06 100644 --- a/keyboards/quefrency/keymaps/default65/keymap.c +++ b/keyboards/quefrency/keymaps/default65/keymap.c @@ -18,10 +18,10 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_65( - KC_GESC, 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_DEL, KC_BSPC, 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_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_HOME, \ - KC_LSFT, 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_END, \ + KC_GESC, 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_DEL, KC_BSPC, KC_HOME, \ + 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_END, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ KC_LCTL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, MO(_FN1),KC_SPC, KC_RALT, KC_RCTL, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT ), -- cgit v1.2.3 From 99c1c5bfe933865bacdebdcbcfa55954a5a946a2 Mon Sep 17 00:00:00 2001 From: Jumail Mundekkat Date: Fri, 21 Sep 2018 08:36:11 +1000 Subject: Keyboard: Added Prime_L, Prime_O and Prime_M, moved Prime_R into primekb folder (#3907) * Added template copies for prime_l Added first set of files for prime_m and prime_o Temporarily storing kbfirmware dumps in tmp * Completed base for prime_m, prime_o and prime_l Moved prime_r into primekb folder * Added in QMK Configurator layout files for new PrimeKB keyboards Slight modification to layout header files Added my name to licensing * Updated primekb readmes * Removed temporary working files * Updated default keymap for Prime_O * Added link to Newbs Guide in prime_r readme --- keyboards/prime_r/config.h | 71 -------- keyboards/prime_r/info.json | 13 -- keyboards/prime_r/keymaps/default/config.h | 24 --- keyboards/prime_r/keymaps/default/keymap.c | 76 -------- keyboards/prime_r/keymaps/default/readme.md | 3 - keyboards/prime_r/keymaps/rooski/config.h | 27 --- keyboards/prime_r/keymaps/rooski/keymap.c | 201 --------------------- keyboards/prime_r/keymaps/rooski/readme.md | 3 - keyboards/prime_r/keymaps/rooski/rules.mk | 2 - keyboards/prime_r/prime_r.c | 43 ----- keyboards/prime_r/prime_r.h | 35 ---- keyboards/prime_r/readme.md | 18 -- keyboards/prime_r/rules.mk | 56 ------ keyboards/primekb/prime_l/config.h | 57 ++++++ keyboards/primekb/prime_l/info.json | 12 ++ keyboards/primekb/prime_l/keymaps/default/config.h | 19 ++ keyboards/primekb/prime_l/keymaps/default/keymap.c | 74 ++++++++ .../primekb/prime_l/keymaps/default/readme.md | 1 + keyboards/primekb/prime_l/prime_l.c | 43 +++++ keyboards/primekb/prime_l/prime_l.h | 35 ++++ keyboards/primekb/prime_l/readme.md | 15 ++ keyboards/primekb/prime_l/rules.mk | 80 ++++++++ keyboards/primekb/prime_m/config.h | 57 ++++++ keyboards/primekb/prime_m/info.json | 12 ++ keyboards/primekb/prime_m/keymaps/default/config.h | 19 ++ keyboards/primekb/prime_m/keymaps/default/keymap.c | 82 +++++++++ .../primekb/prime_m/keymaps/default/readme.md | 1 + keyboards/primekb/prime_m/prime_m.c | 43 +++++ keyboards/primekb/prime_m/prime_m.h | 35 ++++ keyboards/primekb/prime_m/readme.md | 15 ++ keyboards/primekb/prime_m/rules.mk | 80 ++++++++ keyboards/primekb/prime_o/config.h | 57 ++++++ keyboards/primekb/prime_o/info.json | 12 ++ keyboards/primekb/prime_o/keymaps/default/config.h | 19 ++ keyboards/primekb/prime_o/keymaps/default/keymap.c | 85 +++++++++ .../primekb/prime_o/keymaps/default/readme.md | 1 + keyboards/primekb/prime_o/prime_o.c | 43 +++++ keyboards/primekb/prime_o/prime_o.h | 40 ++++ keyboards/primekb/prime_o/readme.md | 15 ++ keyboards/primekb/prime_o/rules.mk | 80 ++++++++ keyboards/primekb/prime_r/config.h | 71 ++++++++ keyboards/primekb/prime_r/info.json | 13 ++ keyboards/primekb/prime_r/keymaps/default/config.h | 24 +++ keyboards/primekb/prime_r/keymaps/default/keymap.c | 76 ++++++++ .../primekb/prime_r/keymaps/default/readme.md | 3 + keyboards/primekb/prime_r/keymaps/rooski/config.h | 27 +++ keyboards/primekb/prime_r/keymaps/rooski/keymap.c | 201 +++++++++++++++++++++ keyboards/primekb/prime_r/keymaps/rooski/readme.md | 3 + keyboards/primekb/prime_r/keymaps/rooski/rules.mk | 2 + keyboards/primekb/prime_r/prime_r.c | 43 +++++ keyboards/primekb/prime_r/prime_r.h | 35 ++++ keyboards/primekb/prime_r/readme.md | 17 ++ keyboards/primekb/prime_r/rules.mk | 56 ++++++ 53 files changed, 1603 insertions(+), 572 deletions(-) delete mode 100644 keyboards/prime_r/config.h delete mode 100644 keyboards/prime_r/info.json delete mode 100644 keyboards/prime_r/keymaps/default/config.h delete mode 100644 keyboards/prime_r/keymaps/default/keymap.c delete mode 100644 keyboards/prime_r/keymaps/default/readme.md delete mode 100644 keyboards/prime_r/keymaps/rooski/config.h delete mode 100644 keyboards/prime_r/keymaps/rooski/keymap.c delete mode 100644 keyboards/prime_r/keymaps/rooski/readme.md delete mode 100644 keyboards/prime_r/keymaps/rooski/rules.mk delete mode 100644 keyboards/prime_r/prime_r.c delete mode 100644 keyboards/prime_r/prime_r.h delete mode 100644 keyboards/prime_r/readme.md delete mode 100644 keyboards/prime_r/rules.mk create mode 100644 keyboards/primekb/prime_l/config.h create mode 100644 keyboards/primekb/prime_l/info.json create mode 100644 keyboards/primekb/prime_l/keymaps/default/config.h create mode 100644 keyboards/primekb/prime_l/keymaps/default/keymap.c create mode 100644 keyboards/primekb/prime_l/keymaps/default/readme.md create mode 100644 keyboards/primekb/prime_l/prime_l.c create mode 100644 keyboards/primekb/prime_l/prime_l.h create mode 100644 keyboards/primekb/prime_l/readme.md create mode 100644 keyboards/primekb/prime_l/rules.mk create mode 100644 keyboards/primekb/prime_m/config.h create mode 100644 keyboards/primekb/prime_m/info.json create mode 100644 keyboards/primekb/prime_m/keymaps/default/config.h create mode 100644 keyboards/primekb/prime_m/keymaps/default/keymap.c create mode 100644 keyboards/primekb/prime_m/keymaps/default/readme.md create mode 100644 keyboards/primekb/prime_m/prime_m.c create mode 100644 keyboards/primekb/prime_m/prime_m.h create mode 100644 keyboards/primekb/prime_m/readme.md create mode 100644 keyboards/primekb/prime_m/rules.mk create mode 100644 keyboards/primekb/prime_o/config.h create mode 100644 keyboards/primekb/prime_o/info.json create mode 100644 keyboards/primekb/prime_o/keymaps/default/config.h create mode 100644 keyboards/primekb/prime_o/keymaps/default/keymap.c create mode 100644 keyboards/primekb/prime_o/keymaps/default/readme.md create mode 100644 keyboards/primekb/prime_o/prime_o.c create mode 100644 keyboards/primekb/prime_o/prime_o.h create mode 100644 keyboards/primekb/prime_o/readme.md create mode 100644 keyboards/primekb/prime_o/rules.mk create mode 100644 keyboards/primekb/prime_r/config.h create mode 100644 keyboards/primekb/prime_r/info.json create mode 100644 keyboards/primekb/prime_r/keymaps/default/config.h create mode 100644 keyboards/primekb/prime_r/keymaps/default/keymap.c create mode 100644 keyboards/primekb/prime_r/keymaps/default/readme.md create mode 100644 keyboards/primekb/prime_r/keymaps/rooski/config.h create mode 100644 keyboards/primekb/prime_r/keymaps/rooski/keymap.c create mode 100644 keyboards/primekb/prime_r/keymaps/rooski/readme.md create mode 100644 keyboards/primekb/prime_r/keymaps/rooski/rules.mk create mode 100644 keyboards/primekb/prime_r/prime_r.c create mode 100644 keyboards/primekb/prime_r/prime_r.h create mode 100644 keyboards/primekb/prime_r/readme.md create mode 100644 keyboards/primekb/prime_r/rules.mk diff --git a/keyboards/prime_r/config.h b/keyboards/prime_r/config.h deleted file mode 100644 index ad92199a22..0000000000 --- a/keyboards/prime_r/config.h +++ /dev/null @@ -1,71 +0,0 @@ -/* -Copyright 2018 Andrew Heaston - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER PrimeKB -#define PRODUCT Prime_R -#define DESCRIPTION A compact layout with mini-numpad. - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 16 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D1, D0, B7, B3, B2 } -#define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B5, C7, C6, F7, F6, F5, F4, F1, F0 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B6 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 5 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 0 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/prime_r/info.json b/keyboards/prime_r/info.json deleted file mode 100644 index 1899df9f3a..0000000000 --- a/keyboards/prime_r/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "Prime_R", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 5, - "layouts": { - "LAYOUT": { - "key_count": 75, - "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K015", "x":15, "y":0}, {"label":"K100", "x":0, "y":1}, {"label":"K101", "x":1, "y":1}, {"label":"K102", "x":2, "y":1}, {"label":"K103", "x":3, "y":1}, {"label":"K104", "x":4, "y":1}, {"label":"K105", "x":5, "y":1}, {"label":"K106", "x":6, "y":1}, {"label":"K107", "x":7, "y":1}, {"label":"K108", "x":8, "y":1}, {"label":"K109", "x":9, "y":1}, {"label":"K110", "x":10, "y":1}, {"label":"K111", "x":11, "y":1}, {"label":"K112", "x":12, "y":1}, {"label":"K113", "x":13, "y":1}, {"label":"K114", "x":14, "y":1}, {"label":"K115", "x":15, "y":1}, {"label":"K200", "x":0, "y":2, "w":1.25}, {"label":"K201", "x":1.25, "y":2}, {"label":"K202", "x":2.25, "y":2}, {"label":"K203", "x":3.25, "y":2}, {"label":"K204", "x":4.25, "y":2}, {"label":"K205", "x":5.25, "y":2}, {"label":"K206", "x":6.25, "y":2}, {"label":"K207", "x":7.25, "y":2}, {"label":"K208", "x":8.25, "y":2}, {"label":"K209", "x":9.25, "y":2}, {"label":"K210", "x":10.25, "y":2}, {"label":"K212", "x":11.25, "y":2, "w":1.75}, {"label":"K213", "x":13, "y":2}, {"label":"K214", "x":14, "y":2}, {"label":"K215", "x":15, "y":2}, {"label":"K300", "x":0, "y":3, "w":1.75}, {"label":"K302", "x":1.75, "y":3}, {"label":"K303", "x":2.75, "y":3}, {"label":"K304", "x":3.75, "y":3}, {"label":"K305", "x":4.75, "y":3}, {"label":"K306", "x":5.75, "y":3}, {"label":"K307", "x":6.75, "y":3}, {"label":"K308", "x":7.75, "y":3}, {"label":"K309", "x":8.75, "y":3}, {"label":"K310", "x":9.75, "y":3}, {"label":"K311", "x":10.75, "y":3}, {"label":"K312", "x":11.75, "y":3, "w":1.25}, {"label":"K313", "x":13, "y":3}, {"label":"K314", "x":14, "y":3}, {"label":"K315", "x":15, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K402", "x":1.25, "y":4, "w":1.25}, {"label":"K403", "x":2.5, "y":4}, {"label":"K404", "x":3.5, "y":4}, {"label":"K405", "x":4.5, "y":4, "w":2}, {"label":"K407", "x":6.5, "y":4, "w":2.25}, {"label":"K409", "x":8.75, "y":4}, {"label":"K410", "x":9.75, "y":4}, {"label":"K411", "x":10.75, "y":4}, {"label":"K412", "x":11.75, "y":4, "w":1.25}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}, {"label":"K415", "x":15, "y":4}] - } - } -} diff --git a/keyboards/prime_r/keymaps/default/config.h b/keyboards/prime_r/keymaps/default/config.h deleted file mode 100644 index e7ffd3aa20..0000000000 --- a/keyboards/prime_r/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Andrew Heaston - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/prime_r/keymaps/default/keymap.c b/keyboards/prime_r/keymaps/default/keymap.c deleted file mode 100644 index a39d197e27..0000000000 --- a/keyboards/prime_r/keymaps/default/keymap.c +++ /dev/null @@ -1,76 +0,0 @@ -/* Copyright 2018 Andrew Heaston @rooski15 - * - * Developed by /u/holtenc at www.primekb.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 . - */ -// Prime_R Rev 1.0 - -#include QMK_KEYBOARD_H - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* (Base Layer) Default Layer - * ,---------------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0|PUP|BSP|PSC|PUP|PDN| - * |---------------------------------------------------------------| - * |Grv| Q| W| E| R| T| Y| U| I| O| P|PDN|DEL| 7| 8| 9| - * |---------------------------------------------------------------| - * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| - * |---------------------------------------------------------------| - * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1| 2| 3| - * |---------------------------------------------------------------| - * |Ctrl|Gui |App|Alt| Space| Space |Alt|App|GUI|Ctrl | 0| .|Ret| - * `---------------------------------------------------------------' - */ - // 0: Base Layer - [0] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, KC_BSPC, KC_PSCR, KC_PGUP, KC_PGDN, \ - KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PGDN, KC_DEL, KC_7, KC_8, KC_9, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_DQUO, KC_ENT, KC_4, KC_5, KC_6, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LABK, KC_RABK, KC_QUES, KC_LSFT, KC_1, KC_2, KC_3, \ - KC_LCTL, KC_LGUI, KC_APP, KC_LALT, MO(0), KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL, KC_0, KC_DOT, KC_ENT \ - ), - - // 1: Function Layer - [1] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} diff --git a/keyboards/prime_r/keymaps/default/readme.md b/keyboards/prime_r/keymaps/default/readme.md deleted file mode 100644 index be92dce9b1..0000000000 --- a/keyboards/prime_r/keymaps/default/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# The default Prime_R layout, with nothing committed to function layer. - -# Extracted from json at https://www.primekb.com/pages/programming \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/rooski/config.h b/keyboards/prime_r/keymaps/rooski/config.h deleted file mode 100644 index 51728ccd3f..0000000000 --- a/keyboards/prime_r/keymaps/rooski/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2018 Andrew Heaston - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#define DISABLE_SPACE_CADET_ROLLOVER - - -#endif diff --git a/keyboards/prime_r/keymaps/rooski/keymap.c b/keyboards/prime_r/keymaps/rooski/keymap.c deleted file mode 100644 index 3fadc6c6bc..0000000000 --- a/keyboards/prime_r/keymaps/rooski/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -/* Copyright 2018 Andrew Heaston @rooski15 - * - * Developed by /u/holtenc at www.primekb.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 . - */// Prime_R Rev 1.0 - -#include QMK_KEYBOARD_H - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -//Arrow Cluster Toggle -static bool arrow_toggle = false; - -//Arrow Keys -enum custom_keycodes{ - AR_TOG = SAFE_RANGE, //Toggle Arrow Keys - AR_LT, //Num0 or Left Arrow - AR_RT, //NumEnt or Right Arrow - AR_DN, //NumDot or Down Arrow - AR_UP, //Num2 or Up Arrow -}; - -// Tap/Hold Space Layer -#define SPC_LT LT(1, KC_SPC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* (Base Layer) Default Layer - * ,---------------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP|DEL|HOM|END| - * |---------------------------------------------------------------| - * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| - * |---------------------------------------------------------------| - * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| - * |---------------------------------------------------------------| - * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| AR - U/D/L/R & Toggle - * |---------------------------------------------------------------| - * |Ctrl|Gui |Alt|TO1| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| Arrow keys operate on AR Toggle to be numpad keys - * `---------------------------------------------------------------' - */ - // 0: Base Layer - [0] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_DEL, KC_HOME, KC_END, \ - KC_GRV, 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_P7, KC_P8, KC_P9, \ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_P1, AR_UP, KC_P3, \ - KC_LCTL, KC_LGUI, KC_LALT, TO(1), SPC_LT, SPC_LT, AR_TOG, KC_APP, KC_RALT, KC_RCTL, AR_LT, AR_DN, AR_RT \ - ), - - /* (Function Layer) - * ,---------------------------------------------------------------. - * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| =|BSP|HOM|END|DEL| - * |---------------------------------------------------------------| - * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| \| 7| 8| 9| - * |---------------------------------------------------------------| - * |BL | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| - * |---------------------------------------------------------------| - * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|VUP| 3| - * |---------------------------------------------------------------| - * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|TO2|Alt|Ctrl |MUT|VDN|STP| - * `---------------------------------------------------------------' - */ - // 1: Function Layer - [1] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, _______, KC_PSLS, KC_PAST, KC_PPLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, _______, _______, - BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, - _______, _______, _______, TO(0), _______, _______, _______, TO(2), _______, _______, KC_MUTE, KC_VOLD, KC_MSTP - ), - - /* (Numpad Mods) - * ,---------------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP| /| *| +| Mirrors base layer, but with numpad mods - * |---------------------------------------------------------------| - * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| - * |---------------------------------------------------------------| - * |Tab | A| S| D| F| G| H| J| K| L| ;|Return| 4| 5| 6| - * |---------------------------------------------------------------| - * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| - * |---------------------------------------------------------------| - * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| - * `---------------------------------------------------------------' - */ - // 2: Numpad Mods - [2] = LAYOUT( - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, _______, KC_PSLS, KC_PAST, KC_PPLS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RBRC, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AR_UP, _______, - _______, _______, _______, TO(0), _______, _______, _______, KC_APP, _______, _______, AR_LT, AR_DN, AR_RT - ), - - // 3: Extra - [3] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -}; - -void matrix_init_user(void) { - if (get_backlight_level() != 0){ - backlight_toggle(); - } -}; - -void matrix_scan_user(void) { -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if(record->event.pressed){ - switch(keycode) { - case AR_TOG: - arrow_toggle = !arrow_toggle; - backlight_toggle(); - return false; break; - - case AR_UP: - if(arrow_toggle == 1){ - SEND_STRING(SS_DOWN(X_UP)); - } else { - SEND_STRING(SS_DOWN(X_KP_2)); - } - return false; break; - - case AR_DN: - if(arrow_toggle == 1){ - SEND_STRING(SS_DOWN(X_DOWN)); - } else { - SEND_STRING(SS_DOWN(X_KP_DOT)); - } - return false; break; - - case AR_LT: - if(arrow_toggle == 1){ - SEND_STRING(SS_DOWN(X_LEFT)); - } else { - SEND_STRING(SS_DOWN(X_KP_0)); - } - return false; break; - - case AR_RT: - if(arrow_toggle == 1){ - SEND_STRING(SS_DOWN(X_RIGHT)); - } else { - SEND_STRING(SS_DOWN(X_KP_ENTER)); - } - return false; break; - } - } - if(!record->event.pressed){ - switch(keycode) { - case AR_UP: - if(arrow_toggle == 1){ - SEND_STRING(SS_UP(X_UP)); - } else { - SEND_STRING(SS_UP(X_KP_2)); - } - return false; break; - case AR_DN: - if(arrow_toggle == 1){ - SEND_STRING(SS_UP(X_DOWN)); - } else { - SEND_STRING(SS_UP(X_KP_DOT)); - } - return false; break; - case AR_LT: - if(arrow_toggle == 1){ - SEND_STRING(SS_UP(X_LEFT)); - } else { - SEND_STRING(SS_UP(X_KP_0)); - } - return false; break; - case AR_RT: - if(arrow_toggle == 1){ - SEND_STRING(SS_UP(X_RIGHT)); - } else { - SEND_STRING(SS_UP(X_KP_ENTER)); - } - return false; break; - } - } - return true; -}; diff --git a/keyboards/prime_r/keymaps/rooski/readme.md b/keyboards/prime_r/keymaps/rooski/readme.md deleted file mode 100644 index c61314ee09..0000000000 --- a/keyboards/prime_r/keymaps/rooski/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# /u/rooski15 layout - -Changes include numpad codes, layer additions, and a toggle-able arrow cluster that is non layer dependant. \ No newline at end of file diff --git a/keyboards/prime_r/keymaps/rooski/rules.mk b/keyboards/prime_r/keymaps/rooski/rules.mk deleted file mode 100644 index f816547680..0000000000 --- a/keyboards/prime_r/keymaps/rooski/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ - -COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/prime_r/prime_r.c b/keyboards/prime_r/prime_r.c deleted file mode 100644 index 845769dae3..0000000000 --- a/keyboards/prime_r/prime_r.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 Andrew Heaston - * - * 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 . - */ -#include "prime_r.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/prime_r/prime_r.h b/keyboards/prime_r/prime_r.h deleted file mode 100644 index 8295fc336c..0000000000 --- a/keyboards/prime_r/prime_r.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Copyright 2018 Andrew Heaston - * - * 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 . - */ -#ifndef PRIMER_H -#define PRIMER_H - -#include "quantum.h" - -#define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K212, K213, K214, K215, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ - K400, K402, K403, K404, K405, K407, K409, K410, K411, K412, K413, K414, K415 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, KC_NO, K212, K213, K214, K215 }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ - { K400, KC_NO, K402, K403, K404, K405, KC_NO, K407, KC_NO, K409, K410, K411, K412, K413, K414, K415 } \ -} - -#endif \ No newline at end of file diff --git a/keyboards/prime_r/readme.md b/keyboards/prime_r/readme.md deleted file mode 100644 index 7a77b20738..0000000000 --- a/keyboards/prime_r/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -# Prime_R - -![Prime_R](https://i.imgur.com/ldOVlLG.jpg) - -A compact layout with the footprint of your typical 65% board, featuring a right mini-numpad. Produced by /u/holtenc at www.primekb.com - -[Additional resources here](https://www.primekb.com/pages/programming) - -Keyboard Maintainer: [Andrew Heaston](https://github.com/rooski15) -Hardware Supported: prime_r pcb, ATmega32U4 -Hardware Availability: [Prime_KB](https://www.primekb.com/) - -Make example for this keyboard (after setting up your build environment): - - make prime_r:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - diff --git a/keyboards/prime_r/rules.mk b/keyboards/prime_r/rules.mk deleted file mode 100644 index 0e7a407276..0000000000 --- a/keyboards/prime_r/rules.mk +++ /dev/null @@ -1,56 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality -AUDIO_ENABLE ?= no -RGBLIGHT_ENABLE ?= no \ No newline at end of file diff --git a/keyboards/primekb/prime_l/config.h b/keyboards/primekb/prime_l/config.h new file mode 100644 index 0000000000..46dd3604e4 --- /dev/null +++ b/keyboards/primekb/prime_l/config.h @@ -0,0 +1,57 @@ +/* +Copyright 2018 Jumail Mundekkat + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4024 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_L +#define DESCRIPTION Custom layout keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { D1, D0, B7, B3, B2 } +#define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B5, C7, C6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 4 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/primekb/prime_l/info.json b/keyboards/primekb/prime_l/info.json new file mode 100644 index 0000000000..8a407fd3eb --- /dev/null +++ b/keyboards/primekb/prime_l/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Prime_L", + "url": "https://www.primekb.com", + "maintainer": "MxBlu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2, "w":1.25}, {"x":4.25, "y":2}, {"x":5.25, "y":2}, {"x":6.25, "y":2}, {"x":7.25, "y":2}, {"x":8.25, "y":2}, {"x":9.25, "y":2}, {"x":10.25, "y":2}, {"x":11.25, "y":2}, {"x":12.25, "y":2}, {"x":13.25, "y":2}, {"x":14.25, "y":2, "w":1.75}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "w":1.75}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3}, {"x":13.75, "y":3}, {"x":14.75, "y":3, "w":1.25}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4, "w":1.25}, {"x":4.25, "y":4, "w":1.25}, {"x":5.5, "y":4}, {"x":6.5, "y":4}, {"x":7.5, "y":4, "w":2}, {"x":9.5, "y":4, "w":2.25}, {"x":11.75, "y":4}, {"x":12.75, "y":4}, {"x":13.75, "y":4}, {"x":14.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/primekb/prime_l/keymaps/default/config.h b/keyboards/primekb/prime_l/keymaps/default/config.h new file mode 100644 index 0000000000..95917a65cd --- /dev/null +++ b/keyboards/primekb/prime_l/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 + +// place overrides here diff --git a/keyboards/primekb/prime_l/keymaps/default/keymap.c b/keyboards/primekb/prime_l/keymaps/default/keymap.c new file mode 100644 index 0000000000..8a044b9556 --- /dev/null +++ b/keyboards/primekb/prime_l/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_HOME, KC_END, KC_PSCR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, KC_BSPC, + KC_P7, KC_P8, KC_P9, KC_NLCK, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PGDN, KC_BSLS, + KC_P4, KC_P5, KC_P6, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, + KC_P1, KC_P2, KC_P3, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_ENT, KC_PDOT, KC_P0, KC_LCTL, KC_LALT, KC_LBRC, KC_RBRC, MO(1), KC_SPC, KC_MINS, KC_EQL, KC_RGUI, KC_RCTL + ), + + [1] = LAYOUT( + RESET, KC_TRNS, KC_TRNS, KC_TRNS, 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_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_SCLN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/primekb/prime_l/keymaps/default/readme.md b/keyboards/primekb/prime_l/keymaps/default/readme.md new file mode 100644 index 0000000000..4e4db88799 --- /dev/null +++ b/keyboards/primekb/prime_l/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for prime_l \ No newline at end of file diff --git a/keyboards/primekb/prime_l/prime_l.c b/keyboards/primekb/prime_l/prime_l.c new file mode 100644 index 0000000000..844407a10d --- /dev/null +++ b/keyboards/primekb/prime_l/prime_l.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#include "prime_l.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/primekb/prime_l/prime_l.h b/keyboards/primekb/prime_l/prime_l.h new file mode 100644 index 0000000000..b50898b28b --- /dev/null +++ b/keyboards/primekb/prime_l/prime_l.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#ifndef PRIME_L_H +#define PRIME_L_H + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215 , \ + K300, K301, K302, K303, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ + K400, K401, K402, K403, K405, K406, K407, K408, K410, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO, K215 }, \ + { K300, K301, K302, K303, KC_NO, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ + { K400, K401, K402, K403, KC_NO, K405, K406, K407, K408, KC_NO, K410, KC_NO, K412, K413, K414, K415 } \ +} + +#endif diff --git a/keyboards/primekb/prime_l/readme.md b/keyboards/primekb/prime_l/readme.md new file mode 100644 index 0000000000..3f760a4cc5 --- /dev/null +++ b/keyboards/primekb/prime_l/readme.md @@ -0,0 +1,15 @@ +# Prime_L + +![Prime_L](https://i.imgur.com/jUWhjOD.jpg) + +A compact layout with the footprint of your typical 65% board, featuring a left mini-numpad. Pre-drilled and counter sunk holes for use with optional feet for a slight tilt. Switches are oriented so that back light LEDs are on the top of the switch. + +Keyboard Maintainer: [MxBlue](https://github.com/MxBlu) +Hardware Supported: Prime_L PCBs, ATMega32u4 +Hardware Availability: [Store Link](https://www.primekb.com/collections/keyboards/products/bundle-save) + +Make example for this keyboard (after setting up your build environment): + + make primekb/prime_l: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/primekb/prime_l/rules.mk b/keyboards/primekb/prime_l/rules.mk new file mode 100644 index 0000000000..5cce4e8113 --- /dev/null +++ b/keyboards/primekb/prime_l/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # 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) diff --git a/keyboards/primekb/prime_m/config.h b/keyboards/primekb/prime_m/config.h new file mode 100644 index 0000000000..82a8037c99 --- /dev/null +++ b/keyboards/primekb/prime_m/config.h @@ -0,0 +1,57 @@ +/* +Copyright 2018 Jumail Mundekkat + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4024 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_M +#define DESCRIPTION 6x5 Macropad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { C5, B5, B2, D5, D3 } +#define MATRIX_COL_PINS { B3, C7, C6, D2, D1, D0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 4 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/primekb/prime_m/info.json b/keyboards/primekb/prime_m/info.json new file mode 100644 index 0000000000..5332522022 --- /dev/null +++ b/keyboards/primekb/prime_m/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Prime_M", + "url": "https://www.primekb.com", + "maintainer": "MxBlu", + "width": 6, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}] + } + } +} diff --git a/keyboards/primekb/prime_m/keymaps/default/config.h b/keyboards/primekb/prime_m/keymaps/default/config.h new file mode 100644 index 0000000000..95917a65cd --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 + +// place overrides here diff --git a/keyboards/primekb/prime_m/keymaps/default/keymap.c b/keyboards/primekb/prime_m/keymaps/default/keymap.c new file mode 100644 index 0000000000..d230439d08 --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/default/keymap.c @@ -0,0 +1,82 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, KC_LPRN, KC_RPRN, KC_PSLS, KC_PAST, LT(2, KC_BSPC), + KC_F1, KC_F2, KC_P7, KC_P8, KC_P9, KC_DEL, + KC_F3, KC_F4, KC_P4, KC_P5, KC_P6, KC_PMNS, + KC_F5, KC_F6, KC_P1, KC_P2, KC_P3, KC_PPLS, + KC_LCTL, KC_LALT, TO(1), KC_P0, KC_PDOT, KC_ENT + ), + + [1] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, LT(2, KC_F9), + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, + KC_LCTL, KC_LALT, TO(0), KC_P, KC_H, KC_SPC + ), + + [2] = LAYOUT( + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/primekb/prime_m/keymaps/default/readme.md b/keyboards/primekb/prime_m/keymaps/default/readme.md new file mode 100644 index 0000000000..5654918abb --- /dev/null +++ b/keyboards/primekb/prime_m/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for prime_m \ No newline at end of file diff --git a/keyboards/primekb/prime_m/prime_m.c b/keyboards/primekb/prime_m/prime_m.c new file mode 100644 index 0000000000..a33db95d83 --- /dev/null +++ b/keyboards/primekb/prime_m/prime_m.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#include "prime_m.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/primekb/prime_m/prime_m.h b/keyboards/primekb/prime_m/prime_m.h new file mode 100644 index 0000000000..0449a66d9b --- /dev/null +++ b/keyboards/primekb/prime_m/prime_m.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#ifndef PRIME_M_H +#define PRIME_M_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, \ + K10, K11, K12, K13, K14, K15, \ + K20, K21, K22, K23, K24, K25, \ + K30, K31, K32, K33, K34, K35, \ + K40, K41, K42, K43, K44, K45 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, K25 }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, K43, K44, K45 } \ +} + +#endif diff --git a/keyboards/primekb/prime_m/readme.md b/keyboards/primekb/prime_m/readme.md new file mode 100644 index 0000000000..668b29e4ae --- /dev/null +++ b/keyboards/primekb/prime_m/readme.md @@ -0,0 +1,15 @@ +# Prime_M + +![Prime_M](https://i.imgur.com/Iqa6FJw.jpg) + +The Prime_M is a premium input device that is designed to be flexible so that it can cover many needs. The case is milled from a solid block of aluminum and features an integrated switch plate, which is 4.75mm thick yet designed to allow MX style switches to properly snap in. The bottom cover is machine from solid brass and is pre-drilled/countersunk for use with optional feet to give the device a slight tilt. + +Keyboard Maintainer: [MxBlue](https://github.com/MxBlu) +Hardware Supported: Prime_M PCB, ATMega32u2 +Hardware Availability: [GB Post](https://geekhack.org/index.php?topic=91821.0), [B-Stock Listing](https://www.primekb.com/products/prime_m) + +Make example for this keyboard (after setting up your build environment): + + make primekb/prime_m: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/primekb/prime_m/rules.mk b/keyboards/primekb/prime_m/rules.mk new file mode 100644 index 0000000000..8d3b835f18 --- /dev/null +++ b/keyboards/primekb/prime_m/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u2 + +# 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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # 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) diff --git a/keyboards/primekb/prime_o/config.h b/keyboards/primekb/prime_o/config.h new file mode 100644 index 0000000000..9f634474cf --- /dev/null +++ b/keyboards/primekb/prime_o/config.h @@ -0,0 +1,57 @@ +/* +Copyright 2018 Jumail Mundekkat + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4024 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_O +#define DESCRIPTION A Large Ortholinear + +/* key matrix size */ +#define MATRIX_ROWS 10 +#define MATRIX_COLS 8 + +/* Keyboard Matrix Assignments */ +#define MATRIX_ROW_PINS { D4, D6, B1, C5, B4, B3, C4, B2, B0, D5 } +#define MATRIX_COL_PINS { B6, B5, C7, C6, D2, D1, D0, C2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 4 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/primekb/prime_o/info.json b/keyboards/primekb/prime_o/info.json new file mode 100644 index 0000000000..83fc143605 --- /dev/null +++ b/keyboards/primekb/prime_o/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Prime_O", + "url": "https://www.primekb.com", + "maintainer": "MxBlu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":15, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":15, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/primekb/prime_o/keymaps/default/config.h b/keyboards/primekb/prime_o/keymaps/default/config.h new file mode 100644 index 0000000000..95917a65cd --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 + +// place overrides here diff --git a/keyboards/primekb/prime_o/keymaps/default/keymap.c b/keyboards/primekb/prime_o/keymaps/default/keymap.c new file mode 100644 index 0000000000..f48e9e51ae --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/default/keymap.c @@ -0,0 +1,85 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ENT, KC_P0, KC_LCTL, KC_LBRC, LT(1, KC_BSPC), KC_SPC, KC_MINS, KC_RGUI, + KC_ENT, KC_P2, KC_LSFT, KC_X, KC_V, KC_N, KC_COMM, KC_SLSH, + KC_PPLS, KC_P5, KC_TAB, KC_S, KC_F, KC_H, KC_K, KC_QUOT, + KC_PPLS, KC_P8, KC_PSCR, KC_W, KC_R, KC_Y, KC_I, KC_P, + KC_ESC, KC_PSLS, KC_NLCK, KC_2, KC_4, KC_6, KC_8, KC_0, + KC_PMNS, KC_PAST, KC_1, KC_3, KC_5, KC_7, KC_9, KC_DEL, + KC_P7, KC_P9, KC_Q, KC_E, KC_T, KC_U, KC_O, KC_BSLS, + KC_P4, KC_P6, KC_A, KC_D, KC_G, KC_J, KC_L, KC_ENT, + KC_P1, KC_P3, KC_Z, KC_C, KC_B, KC_M, KC_DOT, KC_LSFT, + KC_PDOT, KC_P0, KC_LALT, KC_RBRC, LT(1, KC_BSPC), KC_SPC, KC_EQL, KC_RCTL + ), + + [1] = LAYOUT( + BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_VOLD, KC_MUTE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_SCLN, + KC_TRNS, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, + KC_GRV, KC_F2, KC_F4, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, + KC_F1, KC_F3, KC_F1, KC_F3, KC_F5, KC_F7, KC_F9, KC_DEL, + KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, + BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_VOLU, KC_MUTE + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/primekb/prime_o/keymaps/default/readme.md b/keyboards/primekb/prime_o/keymaps/default/readme.md new file mode 100644 index 0000000000..e6e7a1dc9d --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for prime_o \ No newline at end of file diff --git a/keyboards/primekb/prime_o/prime_o.c b/keyboards/primekb/prime_o/prime_o.c new file mode 100644 index 0000000000..d603cc6c9e --- /dev/null +++ b/keyboards/primekb/prime_o/prime_o.c @@ -0,0 +1,43 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 . + */ +#include "prime_o.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/primekb/prime_o/prime_o.h b/keyboards/primekb/prime_o/prime_o.h new file mode 100644 index 0000000000..1ec7277b04 --- /dev/null +++ b/keyboards/primekb/prime_o/prime_o.h @@ -0,0 +1,40 @@ +/* Copyright 2018 Jumail Mundekkat + * + * 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 . + */ +#ifndef PRIME_O_H +#define PRIME_O_H + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K010, K011, K012, K013, K014, K015, K016, K017, \ + K020, K021, K022, K023, K024, K025, K026, K027, K030, K031, K032, K033, K034, K035, K036, K037, \ + K040, K041, K042, K043, K044, K045, K046, K047, K050, K051, K052, K053, K054, K055, K056, K057, \ + K060, K061, K062, K063, K064, K065, K066, K067, K070, K071, K072, K073, K074, K075, K076, K077, \ + K080, K081, K082, K083, K084, K085, K086, K087, K090, K091, K092, K093, K094, K095, K096, K097 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007 }, \ + { K010, K011, K012, K013, K014, K015, K016, K017 }, \ + { K020, K021, K022, K023, K024, K025, K026, K027 }, \ + { K030, K031, K032, K033, K034, K035, K036, K037 }, \ + { K040, K041, K042, K043, K044, K045, K046, K047 }, \ + { K050, K051, K052, K053, K054, K055, K056, K057 }, \ + { K060, K061, K062, K063, K064, K065, K066, K067 }, \ + { K070, K071, K072, K073, K074, K075, K076, K077 }, \ + { K080, K081, K082, K083, K084, K085, K086, K087 }, \ + { K090, K091, K092, K093, K094, K095, K096, K097 } \ +} + +#endif diff --git a/keyboards/primekb/prime_o/readme.md b/keyboards/primekb/prime_o/readme.md new file mode 100644 index 0000000000..fe91a86b9e --- /dev/null +++ b/keyboards/primekb/prime_o/readme.md @@ -0,0 +1,15 @@ +# Prime_O + +![Prime_O](https://i.imgur.com/ujbBdja.jpg) + +A 16x5 ortholinear keyboard that has many layout options, including: full grid, left- or right-side full sized numpads, and Many spacebar locations. Standard in-switch backlighting. See primekb.com for full details of possible layouts. + +Keyboard Maintainer: [MxBlue](https://github.com/MxBlu) +Hardware Supported: Prime_O PCB, ATMega32u2 +Hardware Availability: GB + +Make example for this keyboard (after setting up your build environment): + + make primekb/prime_o: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/primekb/prime_o/rules.mk b/keyboards/primekb/prime_o/rules.mk new file mode 100644 index 0000000000..8d3b835f18 --- /dev/null +++ b/keyboards/primekb/prime_o/rules.mk @@ -0,0 +1,80 @@ +# MCU name +MCU = atmega32u2 + +# 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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # 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) diff --git a/keyboards/primekb/prime_r/config.h b/keyboards/primekb/prime_r/config.h new file mode 100644 index 0000000000..ad92199a22 --- /dev/null +++ b/keyboards/primekb/prime_r/config.h @@ -0,0 +1,71 @@ +/* +Copyright 2018 Andrew Heaston + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER PrimeKB +#define PRODUCT Prime_R +#define DESCRIPTION A compact layout with mini-numpad. + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, B7, B3, B2 } +#define MATRIX_COL_PINS { D2, D3, D5, D4, D6, D7, B4, B5, C7, C6, F7, F6, F5, F4, F1, F0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 5 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/primekb/prime_r/info.json b/keyboards/primekb/prime_r/info.json new file mode 100644 index 0000000000..1899df9f3a --- /dev/null +++ b/keyboards/primekb/prime_r/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Prime_R", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 75, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K015", "x":15, "y":0}, {"label":"K100", "x":0, "y":1}, {"label":"K101", "x":1, "y":1}, {"label":"K102", "x":2, "y":1}, {"label":"K103", "x":3, "y":1}, {"label":"K104", "x":4, "y":1}, {"label":"K105", "x":5, "y":1}, {"label":"K106", "x":6, "y":1}, {"label":"K107", "x":7, "y":1}, {"label":"K108", "x":8, "y":1}, {"label":"K109", "x":9, "y":1}, {"label":"K110", "x":10, "y":1}, {"label":"K111", "x":11, "y":1}, {"label":"K112", "x":12, "y":1}, {"label":"K113", "x":13, "y":1}, {"label":"K114", "x":14, "y":1}, {"label":"K115", "x":15, "y":1}, {"label":"K200", "x":0, "y":2, "w":1.25}, {"label":"K201", "x":1.25, "y":2}, {"label":"K202", "x":2.25, "y":2}, {"label":"K203", "x":3.25, "y":2}, {"label":"K204", "x":4.25, "y":2}, {"label":"K205", "x":5.25, "y":2}, {"label":"K206", "x":6.25, "y":2}, {"label":"K207", "x":7.25, "y":2}, {"label":"K208", "x":8.25, "y":2}, {"label":"K209", "x":9.25, "y":2}, {"label":"K210", "x":10.25, "y":2}, {"label":"K212", "x":11.25, "y":2, "w":1.75}, {"label":"K213", "x":13, "y":2}, {"label":"K214", "x":14, "y":2}, {"label":"K215", "x":15, "y":2}, {"label":"K300", "x":0, "y":3, "w":1.75}, {"label":"K302", "x":1.75, "y":3}, {"label":"K303", "x":2.75, "y":3}, {"label":"K304", "x":3.75, "y":3}, {"label":"K305", "x":4.75, "y":3}, {"label":"K306", "x":5.75, "y":3}, {"label":"K307", "x":6.75, "y":3}, {"label":"K308", "x":7.75, "y":3}, {"label":"K309", "x":8.75, "y":3}, {"label":"K310", "x":9.75, "y":3}, {"label":"K311", "x":10.75, "y":3}, {"label":"K312", "x":11.75, "y":3, "w":1.25}, {"label":"K313", "x":13, "y":3}, {"label":"K314", "x":14, "y":3}, {"label":"K315", "x":15, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K402", "x":1.25, "y":4, "w":1.25}, {"label":"K403", "x":2.5, "y":4}, {"label":"K404", "x":3.5, "y":4}, {"label":"K405", "x":4.5, "y":4, "w":2}, {"label":"K407", "x":6.5, "y":4, "w":2.25}, {"label":"K409", "x":8.75, "y":4}, {"label":"K410", "x":9.75, "y":4}, {"label":"K411", "x":10.75, "y":4}, {"label":"K412", "x":11.75, "y":4, "w":1.25}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}, {"label":"K415", "x":15, "y":4}] + } + } +} diff --git a/keyboards/primekb/prime_r/keymaps/default/config.h b/keyboards/primekb/prime_r/keymaps/default/config.h new file mode 100644 index 0000000000..e7ffd3aa20 --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Andrew Heaston + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/primekb/prime_r/keymaps/default/keymap.c b/keyboards/primekb/prime_r/keymaps/default/keymap.c new file mode 100644 index 0000000000..a39d197e27 --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/default/keymap.c @@ -0,0 +1,76 @@ +/* Copyright 2018 Andrew Heaston @rooski15 + * + * Developed by /u/holtenc at www.primekb.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 . + */ +// Prime_R Rev 1.0 + +#include QMK_KEYBOARD_H + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* (Base Layer) Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0|PUP|BSP|PSC|PUP|PDN| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P|PDN|DEL| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1| 2| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |App|Alt| Space| Space |Alt|App|GUI|Ctrl | 0| .|Ret| + * `---------------------------------------------------------------' + */ + // 0: Base Layer + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PGUP, KC_BSPC, KC_PSCR, KC_PGUP, KC_PGDN, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_PGDN, KC_DEL, KC_7, KC_8, KC_9, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_DQUO, KC_ENT, KC_4, KC_5, KC_6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LABK, KC_RABK, KC_QUES, KC_LSFT, KC_1, KC_2, KC_3, \ + KC_LCTL, KC_LGUI, KC_APP, KC_LALT, MO(0), KC_SPC, KC_RALT, KC_APP, KC_RGUI, KC_RCTL, KC_0, KC_DOT, KC_ENT \ + ), + + // 1: Function Layer + [1] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/primekb/prime_r/keymaps/default/readme.md b/keyboards/primekb/prime_r/keymaps/default/readme.md new file mode 100644 index 0000000000..be92dce9b1 --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/default/readme.md @@ -0,0 +1,3 @@ +# The default Prime_R layout, with nothing committed to function layer. + +# Extracted from json at https://www.primekb.com/pages/programming \ No newline at end of file diff --git a/keyboards/primekb/prime_r/keymaps/rooski/config.h b/keyboards/primekb/prime_r/keymaps/rooski/config.h new file mode 100644 index 0000000000..51728ccd3f --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/rooski/config.h @@ -0,0 +1,27 @@ +/* Copyright 2018 Andrew Heaston + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#define DISABLE_SPACE_CADET_ROLLOVER + + +#endif diff --git a/keyboards/primekb/prime_r/keymaps/rooski/keymap.c b/keyboards/primekb/prime_r/keymaps/rooski/keymap.c new file mode 100644 index 0000000000..3fadc6c6bc --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/rooski/keymap.c @@ -0,0 +1,201 @@ +/* Copyright 2018 Andrew Heaston @rooski15 + * + * Developed by /u/holtenc at www.primekb.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 . + */// Prime_R Rev 1.0 + +#include QMK_KEYBOARD_H + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +//Arrow Cluster Toggle +static bool arrow_toggle = false; + +//Arrow Keys +enum custom_keycodes{ + AR_TOG = SAFE_RANGE, //Toggle Arrow Keys + AR_LT, //Num0 or Left Arrow + AR_RT, //NumEnt or Right Arrow + AR_DN, //NumDot or Down Arrow + AR_UP, //Num2 or Up Arrow +}; + +// Tap/Hold Space Layer +#define SPC_LT LT(1, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* (Base Layer) Default Layer + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP|DEL|HOM|END| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| AR - U/D/L/R & Toggle + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO1| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| Arrow keys operate on AR Toggle to be numpad keys + * `---------------------------------------------------------------' + */ + // 0: Base Layer + [0] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_BSPC, KC_DEL, KC_HOME, KC_END, \ + KC_GRV, 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_P7, KC_P8, KC_P9, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_P1, AR_UP, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, TO(1), SPC_LT, SPC_LT, AR_TOG, KC_APP, KC_RALT, KC_RCTL, AR_LT, AR_DN, AR_RT \ + ), + + /* (Function Layer) + * ,---------------------------------------------------------------. + * |Esc| F1| F2| F3| F4| F5| F6| F7| F8| F9| F0| =|BSP|HOM|END|DEL| + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| \| 7| 8| 9| + * |---------------------------------------------------------------| + * |BL | A| S| D| F| G| H| J| K| L| '|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|VUP| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|TO2|Alt|Ctrl |MUT|VDN|STP| + * `---------------------------------------------------------------' + */ + // 1: Function Layer + [1] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_EQL, _______, KC_PSLS, KC_PAST, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, _______, _______, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, _______, + _______, _______, _______, TO(0), _______, _______, _______, TO(2), _______, _______, KC_MUTE, KC_VOLD, KC_MSTP + ), + + /* (Numpad Mods) + * ,---------------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -|BSP| /| *| +| Mirrors base layer, but with numpad mods + * |---------------------------------------------------------------| + * |Grv| Q| W| E| R| T| Y| U| I| O| P| [| ]| 7| 8| 9| + * |---------------------------------------------------------------| + * |Tab | A| S| D| F| G| H| J| K| L| ;|Return| 4| 5| 6| + * |---------------------------------------------------------------| + * |Shift| Z| X| C| V| B| N| M| ,| .| ?|Shift| 1|ARU| 3| + * |---------------------------------------------------------------| + * |Ctrl|Gui |Alt|TO0| 1/SP | 1/SP |ART|App|Alt|Ctrl |ARL|ARD|ARR| + * `---------------------------------------------------------------' + */ + // 2: Numpad Mods + [2] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, _______, KC_PSLS, KC_PAST, KC_PPLS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RBRC, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, AR_UP, _______, + _______, _______, _______, TO(0), _______, _______, _______, KC_APP, _______, _______, AR_LT, AR_DN, AR_RT + ), + + // 3: Extra + [3] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +void matrix_init_user(void) { + if (get_backlight_level() != 0){ + backlight_toggle(); + } +}; + +void matrix_scan_user(void) { +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if(record->event.pressed){ + switch(keycode) { + case AR_TOG: + arrow_toggle = !arrow_toggle; + backlight_toggle(); + return false; break; + + case AR_UP: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_UP)); + } else { + SEND_STRING(SS_DOWN(X_KP_2)); + } + return false; break; + + case AR_DN: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_DOWN)); + } else { + SEND_STRING(SS_DOWN(X_KP_DOT)); + } + return false; break; + + case AR_LT: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_LEFT)); + } else { + SEND_STRING(SS_DOWN(X_KP_0)); + } + return false; break; + + case AR_RT: + if(arrow_toggle == 1){ + SEND_STRING(SS_DOWN(X_RIGHT)); + } else { + SEND_STRING(SS_DOWN(X_KP_ENTER)); + } + return false; break; + } + } + if(!record->event.pressed){ + switch(keycode) { + case AR_UP: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_UP)); + } else { + SEND_STRING(SS_UP(X_KP_2)); + } + return false; break; + case AR_DN: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_DOWN)); + } else { + SEND_STRING(SS_UP(X_KP_DOT)); + } + return false; break; + case AR_LT: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_LEFT)); + } else { + SEND_STRING(SS_UP(X_KP_0)); + } + return false; break; + case AR_RT: + if(arrow_toggle == 1){ + SEND_STRING(SS_UP(X_RIGHT)); + } else { + SEND_STRING(SS_UP(X_KP_ENTER)); + } + return false; break; + } + } + return true; +}; diff --git a/keyboards/primekb/prime_r/keymaps/rooski/readme.md b/keyboards/primekb/prime_r/keymaps/rooski/readme.md new file mode 100644 index 0000000000..c61314ee09 --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/rooski/readme.md @@ -0,0 +1,3 @@ +# /u/rooski15 layout + +Changes include numpad codes, layer additions, and a toggle-able arrow cluster that is non layer dependant. \ No newline at end of file diff --git a/keyboards/primekb/prime_r/keymaps/rooski/rules.mk b/keyboards/primekb/prime_r/keymaps/rooski/rules.mk new file mode 100644 index 0000000000..f816547680 --- /dev/null +++ b/keyboards/primekb/prime_r/keymaps/rooski/rules.mk @@ -0,0 +1,2 @@ + +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/primekb/prime_r/prime_r.c b/keyboards/primekb/prime_r/prime_r.c new file mode 100644 index 0000000000..845769dae3 --- /dev/null +++ b/keyboards/primekb/prime_r/prime_r.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Andrew Heaston + * + * 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 . + */ +#include "prime_r.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/primekb/prime_r/prime_r.h b/keyboards/primekb/prime_r/prime_r.h new file mode 100644 index 0000000000..8295fc336c --- /dev/null +++ b/keyboards/primekb/prime_r/prime_r.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Andrew Heaston + * + * 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 . + */ +#ifndef PRIMER_H +#define PRIMER_H + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K212, K213, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ + K400, K402, K403, K404, K405, K407, K409, K410, K411, K412, K413, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, KC_NO, K212, K213, K214, K215 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ + { K400, KC_NO, K402, K403, K404, K405, KC_NO, K407, KC_NO, K409, K410, K411, K412, K413, K414, K415 } \ +} + +#endif \ No newline at end of file diff --git a/keyboards/primekb/prime_r/readme.md b/keyboards/primekb/prime_r/readme.md new file mode 100644 index 0000000000..dfce62e1af --- /dev/null +++ b/keyboards/primekb/prime_r/readme.md @@ -0,0 +1,17 @@ +# Prime_R + +![Prime_R](https://i.imgur.com/ldOVlLG.jpg) + +A compact layout with the footprint of your typical 65% board, featuring a right mini-numpad. Produced by /u/holtenc at www.primekb.com + +[Additional resources here](https://www.primekb.com/pages/programming) + +Keyboard Maintainer: [Andrew Heaston](https://github.com/rooski15) +Hardware Supported: prime_r pcb, ATmega32U4 +Hardware Availability: [Prime_KB](https://www.primekb.com/) + +Make example for this keyboard (after setting up your build environment): + + make primekb/prime_r: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/primekb/prime_r/rules.mk b/keyboards/primekb/prime_r/rules.mk new file mode 100644 index 0000000000..0e7a407276 --- /dev/null +++ b/keyboards/primekb/prime_r/rules.mk @@ -0,0 +1,56 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= yes # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no # Commands for debug and configuration +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no \ No newline at end of file -- cgit v1.2.3 From 747cf78b5da17969fe057d77512e276fa6c59fd9 Mon Sep 17 00:00:00 2001 From: Danny Date: Thu, 20 Sep 2018 18:37:18 -0400 Subject: Add nano keymap for modding Spooka light (#3953) --- keyboards/nano/config.h | 5 +---- keyboards/nano/keymaps/default/rules.mk | 3 --- keyboards/nano/keymaps/spooka/config.h | 25 +++++++++++++++++++++++++ keyboards/nano/keymaps/spooka/keymap.c | 12 ++++++++++++ keyboards/nano/keymaps/spooka/rules.mk | 1 + 5 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 keyboards/nano/keymaps/spooka/config.h create mode 100644 keyboards/nano/keymaps/spooka/keymap.c create mode 100644 keyboards/nano/keymaps/spooka/rules.mk diff --git a/keyboards/nano/config.h b/keyboards/nano/config.h index 5c4f920dfe..088fafcaa5 100644 --- a/keyboards/nano/config.h +++ b/keyboards/nano/config.h @@ -33,12 +33,9 @@ along with this program. If not, see . #define MATRIX_COLS 4 /* ws2812 RGB LED */ -#define RGB_DI_PIN B1 -#define RGBLIGHT_TIMER +#define RGB_DI_PIN D3 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 6 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/nano/keymaps/default/rules.mk b/keyboards/nano/keymaps/default/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/nano/keymaps/default/rules.mk +++ b/keyboards/nano/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nano/keymaps/spooka/config.h b/keyboards/nano/keymaps/spooka/config.h new file mode 100644 index 0000000000..05900a215b --- /dev/null +++ b/keyboards/nano/keymaps/spooka/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2018 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 + +#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/nano/keymaps/spooka/keymap.c b/keyboards/nano/keymaps/spooka/keymap.c new file mode 100644 index 0000000000..63b90da09f --- /dev/null +++ b/keyboards/nano/keymaps/spooka/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H + +#define _MAIN 0 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAIN] = LAYOUT( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD + ) +}; diff --git a/keyboards/nano/keymaps/spooka/rules.mk b/keyboards/nano/keymaps/spooka/rules.mk new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/keyboards/nano/keymaps/spooka/rules.mk @@ -0,0 +1 @@ + -- cgit v1.2.3 From 35e76539e7257a1932ec76882892b999e21c9d4f Mon Sep 17 00:00:00 2001 From: Alexander Kagno Date: Sat, 22 Sep 2018 09:43:28 -0600 Subject: Keymap: Arkag Userspace and MechMini2 Layout (#3958) * deleting arkag branch, forcibly moving changes over to master * fade_color function added, not tested * added half functions some stuff * surround_type function implemented and working. * added flashing function and removed fading, flashing supports infinite flashing along with controlled number flashes * added a fade state machine and functionality * build optimizations, changed fade to bounce between bounds rather than roll over, added a HALMAK layout * changes to sleep breath function, changed how I will switch to HALMAK * support for halmak added * support for activity detection added, condensed fading and flashing state machines, removed support for HALMAK and COLEMAK because arkag is stupid * changed sleep and inactive behaviors, now the color shifting reverses on state change, yay! save_color and reset_color are made to enable layer color changing to look cooler. * reformatted some if statements in state detection * changes to force fade to pause on boot, or plug in. * Attempting to move over to userspace, pushing to repository for help * userspace stuff.... * userspace stuff.... * layout changes, working userspace, Removed left side shift and replaced it with a MT() for LSFT and SPC. Userspace seems to be working properly now! HURRAY * Layout change Removed space/shift and reset modifiers to what they were originally. Added homerow modifiers. * Removed excessive tabs in files * Moved mods on homerow around... * changes recommended by @drashna --- keyboards/mechmini/v2/keymaps/arkag/config.h | 7 + keyboards/mechmini/v2/keymaps/arkag/keymap.c | 40 ++ keyboards/mechmini/v2/keymaps/arkag/rules.mk | 16 + users/arkag/arkag.c | 573 +++++++++++++++++++++++++++ users/arkag/arkag.h | 161 ++++++++ users/arkag/config.h | 5 + users/arkag/readme.md | 14 + users/arkag/rules.mk | 1 + 8 files changed, 817 insertions(+) create mode 100644 keyboards/mechmini/v2/keymaps/arkag/config.h create mode 100644 keyboards/mechmini/v2/keymaps/arkag/keymap.c create mode 100644 keyboards/mechmini/v2/keymaps/arkag/rules.mk create mode 100644 users/arkag/arkag.c create mode 100644 users/arkag/arkag.h create mode 100644 users/arkag/config.h create mode 100644 users/arkag/readme.md create mode 100644 users/arkag/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/arkag/config.h b/keyboards/mechmini/v2/keymaps/arkag/config.h new file mode 100644 index 0000000000..f5f3a90fa7 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/arkag/config.h @@ -0,0 +1,7 @@ +#pragma once + +// save me space! +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION +#define DISABLE_LEADER +#define NO_MUSIC_MODE diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechmini/v2/keymaps/arkag/keymap.c new file mode 100644 index 0000000000..10502a5b61 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/arkag/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H +#include "arkag.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_2u_space_ortho( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, TAP_A, TAP_S, TAP_D, TAP_F, KC_G, KC_H, TAP_J, TAP_K, TAP_L, TAP_SCN, QUOTE, + XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, + M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, LAZY, KC_LEFT, KC_DOWN, KC_RGHT), + + [_RAISE] = LAYOUT_2u_space_ortho( + GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, OBRACK, CBRACK, TAP_EQ, HYPHEN, _______, _______, KC_4, TAP_5, KC_6, _______, KC_NLCK, + _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_PPLS, KC_PENT, + _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), + + [_LOWER] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, M_ULIN, M_ITAL, _______, M_P_B, M_C_A_D, + _______, _______, STRIKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, KC_DEL, _______, _______, _______, M_BOLD, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, MEDIA, KC_BSLS, M_CALC, KC_HOME, KC_PGDN, KC_END), + + [_KEEB] = LAYOUT_2u_space_ortho( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + _______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, BL_BRTG, _______, _______, _______, _______, _______, _______, + RGB_M_P, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + [_MEDIA] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + + [_LAZY] = LAYOUT_2u_space_ortho( + _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, _______, + _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, + _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; diff --git a/keyboards/mechmini/v2/keymaps/arkag/rules.mk b/keyboards/mechmini/v2/keymaps/arkag/rules.mk new file mode 100644 index 0000000000..d6c210e9e8 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/arkag/rules.mk @@ -0,0 +1,16 @@ +BOOTMAGIC_ENABLE = no +MOUSEKEY_ENABLE = no +STENO_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = no +SLEEP_LED_ENABLE = no +NKRO_ENABLE = yes +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes + +# save me space! +EXTRAFLAGS += -flto diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c new file mode 100644 index 0000000000..c716b5e93f --- /dev/null +++ b/users/arkag/arkag.c @@ -0,0 +1,573 @@ +#include "arkag.h" + +// Start: Written by konstantin: vomindoraan +#include +#include +#include + +void send_unicode_hex_string(const char *str) { + if (!str) { return; } // Saftey net + while (*str) { + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower(*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + str += n; // Move to the first ' ' (or '\0') after the current token + } +} +// End: Written by konstantin: vomindoraan + +uint8_t current_os, mod_primary_mask, fade_delay; +uint16_t flash_timer_one, flash_timer_two, + fade_timer_one, fade_timer_two, + active_timer_one, active_timer_two, + elapsed = 0, + num_extra_flashes_off = 0; +Color underglow, + flash_color, + saved_color, + hsv_none = {0,0,0}, + hsv_white = {0,0,127}; +flashState flash_state = no_flash; +fadeState fade_state = add_fade; +activityState state = boot; + +void set_color (Color new, bool update) { + rgblight_sethsv_eeprom_helper(new.h, new.s, new.v, update); +} + +void save_color(Color to_save) { + saved_color = to_save; +} + +void reset_color(void) { + underglow = saved_color; +} + +Color mod_color(Color current_color, bool should_add, uint8_t change_amount) { + save_color(underglow); + int addlim = 359 - change_amount; + int sublim = change_amount; + int leftovers; + if (should_add) { + if (current_color.h <= addlim) { + current_color.h += change_amount; + } else { + leftovers = (359 + change_amount) % 359; + current_color.h = 0 + leftovers; + } + } else { + if (current_color.h >= sublim) { + current_color.h -= change_amount; + } else { + leftovers = change_amount - current_color.h; + current_color.h = 359 - leftovers; + } + } + return current_color; +} + +void reverse_fade (void) { + if (fade_state == add_fade){ + fade_state = sub_fade; + } else { + fade_state = add_fade; + } +} + +void check_state (void) { + static bool activated, deactivated, slept; + switch (state) { + case active: + if (!activated) { + fade_delay = LED_FADE_DELAY; + reverse_fade(); + activated = true; + deactivated = false; + } + active_timer_two = timer_read(); + elapsed = active_timer_two - active_timer_one; + if (elapsed < INACTIVE_DELAY) {return;} + state = inactive; + return; + + case inactive: + if (!deactivated) { + fade_delay = LED_FADE_DELAY * 2; + reverse_fade(); + deactivated = true; + slept = false; + activated = false; + } + active_timer_two = timer_read(); + elapsed = active_timer_two - active_timer_one; + if (elapsed < SLEEP_DELAY) {return;} + state = sleeping; + return; + + case sleeping: + if (!slept) { + fade_delay = LED_FADE_DELAY * 6; + reverse_fade(); + slept = true; + deactivated = false; + activated = false; + } + return; + + case boot: + return; + } +} + +void fade_rgb (void) { + static bool ran_once; + if (flash_state != no_flash) {return;} + if (state == boot) {return;} + switch (fade_state) { + case add_fade: + if (!ran_once) { + fade_timer_one = timer_read(); + ran_once = true; + } + fade_timer_two = timer_read(); + elapsed = fade_timer_two - fade_timer_one; + if (elapsed < fade_delay) {return;} + if (underglow.h == 359) { + fade_state = sub_fade; + return; + } + underglow.h = underglow.h + 1; + set_color(underglow, false); + // set_color_at(underglow, 0); + fade_timer_one = fade_timer_two; + return; + + case sub_fade: + fade_timer_two = timer_read(); + elapsed = fade_timer_two - fade_timer_one; + if (elapsed < fade_delay) {return;} + if (underglow.h == 0) { + fade_state = add_fade; + return; + } + underglow.h = underglow.h - 1; + set_color(underglow, false); + // set_color_at(underglow, 0); + fade_timer_one = fade_timer_two; + return; + } +} + +void flash_rgb (void) { + static bool ran_once; + switch(flash_state) { + case no_flash: + return; + + case flash_off: + if (!ran_once) { + set_color(hsv_none, false); + flash_timer_one = timer_read(); + ran_once = true; + flash_state = flash_on; + return; + } + flash_timer_two = timer_read(); + elapsed = flash_timer_two - flash_timer_one; + if (elapsed >= LED_FLASH_DELAY) { + set_color(hsv_none, false); + flash_timer_one = timer_read(); + flash_state = flash_on; + } + return; + + case flash_on: + flash_timer_two = timer_read(); + elapsed = flash_timer_two - flash_timer_one; + if (elapsed >= LED_FLASH_DELAY) { + set_color(flash_color, false); + flash_timer_one = timer_read(); + if (num_extra_flashes_off > 0) { + flash_state = flash_off; + num_extra_flashes_off--; + } else { + set_color(underglow, false); + flash_state = no_flash; + ran_once = false; + } + } + return; + } +} + +void set_os (uint8_t os, bool update) { + current_os = os; + if (update) { + eeprom_update_byte(EECONFIG_USERSPACE, current_os); + } + switch (os) { + case OS_MAC: + set_unicode_input_mode(UC_OSX); + underglow = (Color){ 300, 255, 255 }; + mod_primary_mask = MOD_GUI_MASK; + break; + case OS_WIN: + set_unicode_input_mode(UC_WINC); + underglow = (Color){ 180, 255, 255 }; + mod_primary_mask = MOD_CTL_MASK; + break; + case OS_NIX: + set_unicode_input_mode(UC_LNX); + underglow = (Color){ 60, 255, 255 }; + mod_primary_mask = MOD_CTL_MASK; + break; + default: + underglow = (Color){ 0, 0, 255 }; + mod_primary_mask = MOD_CTL_MASK; + } + set_color(underglow, update); + flash_color = underglow; + flash_state = flash_off; + num_extra_flashes_off = 1; +} + +void tap_key(uint8_t keycode) { + register_code(keycode); + unregister_code(keycode); +} + +// register GUI if Mac or Ctrl if other +void pri_mod(bool press) { + if (press) { + if (current_os == OS_MAC) { + register_code(KC_LGUI); + } else { + register_code(KC_LCTL); + } + } else { + if (current_os == OS_MAC) { + unregister_code(KC_LGUI); + } else { + unregister_code(KC_LCTL); + } + } +} + +// register Ctrl if Mac or GUI if other +void sec_mod(bool press) { + if (press) { + if (current_os == OS_MAC) { + register_code(KC_LCTL); + } else { + register_code(KC_LGUI); + } + } else { + if (current_os == OS_MAC) { + unregister_code(KC_LCTL); + } else { + unregister_code(KC_LGUI); + } + } +} + +void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift) { + if (use_shift) { + register_code(KC_LSFT); + } + for (int i = 0; i < num_of_chars; i++) { + tap_key(keycode); + } + if (use_shift) { + unregister_code(KC_LSFT); + } + for (int i = 0; i < (num_of_chars/2); i++) { + tap_key(KC_LEFT); + } +} + +void long_keystroke(size_t num_of_keys, uint16_t keys[]) { + for (int i = 0; i < num_of_keys-1; i++) { + register_code(keys[i]); + } + tap_key(keys[num_of_keys-1]); + for (int i = 0; i < num_of_keys-1; i++) { + unregister_code(keys[i]); + } +} + +void dance_grv (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_key(KC_GRV); + } else if (state->count == 2) { + surround_type(2, KC_GRAVE, false); + } else { + surround_type(6, KC_GRAVE, false); + } +} + +void dance_quot (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_key(KC_QUOT); + } else if (state->count == 2) { + surround_type(2, KC_QUOTE, false); + } else if (state->count == 3) { + surround_type(2, KC_QUOTE, true); + } +} + +void dance_strk (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + surround_type(4, KC_TILDE, true); + } else if (state->count == 2) { + if (current_os == OS_MAC) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); + } else if (current_os == OS_WIN) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); + } else { + return; + } + } +} + +void dance_3 (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_key(KC_3); + } else if (state->count == 2) { + send_unicode_hex_string("00E8"); + } else if (state->count == 3) { + send_unicode_hex_string("00E9"); + } +} + +void dance_c (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + tap_key(KC_C); + } else if (state->count == 2) { + send_unicode_hex_string("00E7"); + } +} + +void matrix_init_user(void) { + current_os = eeprom_read_byte(EECONFIG_USERSPACE); + set_os(current_os, false); +} + +void matrix_scan_user(void) { + check_state(); + flash_rgb(); + fade_rgb(); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_PMOD: + if (record->event.pressed) { + pri_mod(true); + } else { + pri_mod(false); + } + return false; + + case M_SMOD: + if (record->event.pressed) { + sec_mod(true); + } else { + sec_mod(false); + } + return false; + + case M_P_B: + if (record->event.pressed) { + if (current_os == OS_WIN) { + SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI)); + } else { + } + } + return false; + + case M_C_A_D: + if (record->event.pressed) { + if (current_os == OS_WIN) { + SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL)); + } else { + } + } + return false; + + case M_CALC: + if (record->event.pressed) { + if (current_os == OS_WIN) { + SEND_STRING(SS_TAP(X_CALCULATOR)); + } else if (current_os == OS_MAC) { + SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER)); + } + } + return false; + + case M_OS: + if (record->event.pressed) { + set_os((current_os+1) % _OS_COUNT, true); + } + return false; + + case M_LOD: + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 005F 0CA0"); + } + return false; + + case M_LENNY: + if (record->event.pressed) { + send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + } + return false; + + + case M_TF: + if (record->event.pressed) { + send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B"); + } + return false; + + case M_UF: + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029"); + } + return false; + + case M_SHRUG: + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + return false; + + case M_TM: + if (record->event.pressed) { + send_unicode_hex_string("2122"); + } + return false; + + case M_REPO: + if (record->event.pressed) { + SEND_STRING("https://github.com/arkag/qmk_firmware/tree/master/keyboards/mechmini/v2/keymaps/arkag"); + } + return false; + + case M_GGT: + if (record->event.pressed) { + SEND_STRING("@GrahamGoldenTech.com"); + } + return false; + + case M_SNIPT: + if (record->event.pressed) { + surround_type(6, KC_GRAVE, false); + pri_mod(true); + tap_key(KC_V); + pri_mod(false); + tap_key(KC_RGHT); + tap_key(KC_RGHT); + tap_key(KC_RGHT); + tap_key(KC_ENTER); + } + return false; + + case M_BOLD: + if (record->event.pressed) { + surround_type(4, KC_8, true); + } + return false; + + case M_ITAL: + if (record->event.pressed) { + surround_type(2, KC_8, true); + } + return false; + + case M_ULIN: + if (record->event.pressed) { + surround_type(4, KC_MINS, true); + } + return false; + + case KC_LSFT: + if (record->event.pressed) { + set_color(mod_color(underglow, true, 50), false); + SEND_STRING(SS_DOWN(X_LSHIFT)); + } else { + set_color(underglow, false); + SEND_STRING(SS_UP(X_LSHIFT)); + } + return false; + + case MEDIA: + case LAZY: + case KEEB: + case RAISE: + case LOWER: + return true; + + default: + if (record->event.pressed) { + active_timer_one = timer_read(); + state = active; + } + return true; + } +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _LAZY: + save_color(underglow); + underglow = mod_color(underglow, true, 50); + break; + case _MEDIA: + save_color(underglow); + underglow = mod_color(underglow, true, 150); + break; + case _KEEB: + save_color(underglow); + underglow = mod_color(underglow, false, 150); + break; + case _LOWER: + save_color(underglow); + underglow = mod_color(underglow, false, 100); + break; + case _RAISE: + save_color(underglow); + underglow = mod_color(underglow, true, 100); + break; + default: + reset_color(); + break; + } + set_color(underglow, false); + return state; +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3), + [TD_C_CED] = ACTION_TAP_DANCE_FN (dance_c), + [TD_GRV_3GRV] = ACTION_TAP_DANCE_FN (dance_grv), + [TD_SING_DOUB] = ACTION_TAP_DANCE_FN (dance_quot), + [TD_STRK_SHOT] = ACTION_TAP_DANCE_FN (dance_strk), + [TD_HYPH_UNDR] = ACTION_TAP_DANCE_DOUBLE (KC_MINS, LSFT(KC_MINS)), + [TD_BRCK_PARN_O] = ACTION_TAP_DANCE_DOUBLE (KC_LBRC, LSFT(KC_9)), + [TD_BRCK_PARN_C] = ACTION_TAP_DANCE_DOUBLE (KC_RBRC, LSFT(KC_0)), + [TD_LALT_RALT] = ACTION_TAP_DANCE_DOUBLE (KC_LALT, KC_RALT), +}; diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h new file mode 100644 index 0000000000..9c81e4487c --- /dev/null +++ b/users/arkag/arkag.h @@ -0,0 +1,161 @@ +#pragma once + +#include "quantum.h" +#include "process_keycode/process_tap_dance.h" + +#define EECONFIG_USERSPACE (uint8_t *)20 + +#define LRALT TD(TD_LALT_RALT) +#define QUOTE TD(TD_SING_DOUB) +#define GRAVE TD(TD_GRV_3GRV) +#define OBRACK TD(TD_BRCK_PARN_O) +#define CBRACK TD(TD_BRCK_PARN_C) +#define THREE TD(TD_3_GRV_ACT) +#define STRIKE TD(TD_STRK_SHOT) +#define HYPHEN TD(TD_HYPH_UNDR) +#define CEDILLA TD(TD_C_CED) + +#define RAISE MO(1) +#define LOWER MO(2) +#define KEEB MO(3) +#define MEDIA MO(4) +#define LAZY MO(5) + +#define MOD_CTL_MASK (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL)) +#define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) +#define MOD_SFT_MASK (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) + +#define TAP_A LALT_T(KC_A) +#define TAP_SCN RALT_T(KC_SCOLON) + +#define TAP_S LCTL_T(KC_S) +#define TAP_L RCTL_T(KC_L) + +#define TAP_D LSFT_T(KC_D) +#define TAP_K RSFT_T(KC_K) + +#define TAP_F LGUI_T(KC_F) +#define TAP_J RGUI_T(KC_J) + +#define TAP_EQ LSFT_T(KC_EQUAL) +#define TAP_5 RSFT_T(KC_5) + +#define LED_FLASH_DELAY 150 +#define LED_FADE_DELAY 10 + +#define INACTIVE_DELAY 200 +#define SLEEP_DELAY 60000 + +enum { + _QWERTY = 0, + _RAISE, + _LOWER, + _KEEB, + _MEDIA, + _LAZY, +}; + +typedef enum { + OS_MAC, // Don't assign values + OS_WIN, + OS_NIX, + _OS_COUNT, +} OS; + +typedef struct { + uint16_t h; + uint8_t s; + uint8_t v; +} Color; + +typedef enum { + no_flash = 0, + flash_off, + flash_on, +} flashState; + +typedef enum { + add_fade = 0, + sub_fade, +} fadeState; + +typedef enum { + active = 0, + inactive, + sleeping, + boot, +} activityState; + +enum custom_keycodes { + M_PMOD = SAFE_RANGE, + M_SMOD, + M_P_B, + M_C_A_D, + M_CALC, + M_OS, + M_TF, + M_TM, + M_GGT, + M_LOD, + M_LENNY, + M_BOLD, + M_ITAL, + M_ULIN, + M_SNIPT, + M_REPO, + M_SHRUG, + M_UF, +}; + +enum tapdances { + TD_3_GRV_ACT = 0, + TD_C_CED, + TD_GRV_3GRV, + TD_SLSH_HTTP, + TD_SING_DOUB, + TD_HYPH_UNDR, + TD_STRK_SHOT, + TD_SPECIAL, + TD_BRCK_PARN_O, + TD_BRCK_PARN_C, + TD_LALT_RALT, + SPC_SFT_NSFT, +}; + +void send_unicode_hex_string(const char *str); + +void set_color (Color new, bool update); +void save_color(Color to_save); +void reset_color(void); + +Color mod_color(Color current_color, bool should_add, uint8_t change_amount); + +void reverse_fade (void); + +void check_state (void); + +void fade_rgb (void); + +void flash_rgb (void); + +void set_os (uint8_t os, bool update); + +void tap_key(uint8_t keycode); + +void pri_mod(bool press); + +void sec_mod(bool press); + +void surround_type(uint8_t num_of_chars, uint16_t keycode, bool use_shift); + +void long_keystroke(size_t num_of_keys, uint16_t keys[]); + +void dance_grv (qk_tap_dance_state_t *state, void *user_data); +void dance_quot (qk_tap_dance_state_t *state, void *user_data); +void dance_strk (qk_tap_dance_state_t *state, void *user_data); +void dance_3 (qk_tap_dance_state_t *state, void *user_data); +void dance_c (qk_tap_dance_state_t *state, void *user_data); + +int cur_dance (qk_tap_dance_state_t *state); +void spc_finished (qk_tap_dance_state_t *state, void *user_data); +void spc_reset (qk_tap_dance_state_t *state, void *user_data); diff --git a/users/arkag/config.h b/users/arkag/config.h new file mode 100644 index 0000000000..e715e5534e --- /dev/null +++ b/users/arkag/config.h @@ -0,0 +1,5 @@ +#pragma once + +#define TAPPING_TERM 200 + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/users/arkag/readme.md b/users/arkag/readme.md new file mode 100644 index 0000000000..76a5c4525b --- /dev/null +++ b/users/arkag/readme.md @@ -0,0 +1,14 @@ +Copyright 2018 arkag arkag@pm.me + +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 . diff --git a/users/arkag/rules.mk b/users/arkag/rules.mk new file mode 100644 index 0000000000..3513f0ea6c --- /dev/null +++ b/users/arkag/rules.mk @@ -0,0 +1 @@ + SRC += arkag.c -- cgit v1.2.3 From 57ec309d3e05732094408834b00af9cfd1ffca62 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 23 Sep 2018 13:48:48 -0700 Subject: Keyboard: Panc60 (#3961) * initial check in * figure out the column pins * temporary keymap * guess the row pins * fix matrix.c compilation errors * use the LAYOUT_60_hhkb macro and tweak the keymap a little bit * update readme * Put my name everywhere * Add QMK Configurator support * figured out the row pins * update readme to have reset info * Fill in some blanks that are documentation related * Update matrix.c * add kb functions * forego kbfirmware labeling * add arrows and caps lock to function layer. * add a LAYOUT_60 and LAYOUT_all macro * missed a comma * add configurator support for the two new LAYOUT macros * Jack helped me with a new custom matrix * add 60_ansi into rules.mk --- keyboards/panc60/config.h | 46 ++++ keyboards/panc60/i2c.c | 106 ++++++++ keyboards/panc60/i2c.h | 27 ++ keyboards/panc60/info.json | 20 ++ keyboards/panc60/keymaps/default/config.h | 19 ++ keyboards/panc60/keymaps/default/keymap.c | 60 +++++ keyboards/panc60/keymaps/default/readme.md | 1 + keyboards/panc60/matrix.c | 145 +++++++++++ keyboards/panc60/panc60.c | 25 ++ keyboards/panc60/panc60.h | 71 ++++++ keyboards/panc60/readme.md | 46 ++++ keyboards/panc60/rules.mk | 52 ++++ keyboards/panc60/usbconfig.h | 396 +++++++++++++++++++++++++++++ 13 files changed, 1014 insertions(+) create mode 100644 keyboards/panc60/config.h create mode 100644 keyboards/panc60/i2c.c create mode 100644 keyboards/panc60/i2c.h create mode 100644 keyboards/panc60/info.json create mode 100644 keyboards/panc60/keymaps/default/config.h create mode 100644 keyboards/panc60/keymaps/default/keymap.c create mode 100644 keyboards/panc60/keymaps/default/readme.md create mode 100644 keyboards/panc60/matrix.c create mode 100644 keyboards/panc60/panc60.c create mode 100644 keyboards/panc60/panc60.h create mode 100644 keyboards/panc60/readme.md create mode 100644 keyboards/panc60/rules.mk create mode 100644 keyboards/panc60/usbconfig.h diff --git a/keyboards/panc60/config.h b/keyboards/panc60/config.h new file mode 100644 index 0000000000..703141bebf --- /dev/null +++ b/keyboards/panc60/config.h @@ -0,0 +1,46 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER Panc Interactive +#define PRODUCT panc60 + +#define RGBLED_NUM 12 + +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW +#define DEBOUNCING_DELAY 5 + +#define NO_BACKLIGHT_CLOCK +#define BACKLIGHT_LEVELS 1 +#define RGBLIGHT_ANIMATIONS + +#define NO_UART 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/panc60/i2c.c b/keyboards/panc60/i2c.c new file mode 100644 index 0000000000..e8c4455ad1 --- /dev/null +++ b/keyboards/panc60/i2c.c @@ -0,0 +1,106 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +// Please do not modify this file + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +// Please do not modify this file + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/panc60/info.json b/keyboards/panc60/info.json new file mode 100644 index 0000000000..fe919e8b91 --- /dev/null +++ b/keyboards/panc60/info.json @@ -0,0 +1,20 @@ +{ + "keyboard_name": "panc60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + }, + + "LAYOUT_60_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":13.75, "y":4, "w":1.25}] + }, + + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + } + } +} diff --git a/keyboards/panc60/keymaps/default/config.h b/keyboards/panc60/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/panc60/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/panc60/keymaps/default/keymap.c b/keyboards/panc60/keymaps/default/keymap.c new file mode 100644 index 0000000000..2754d89ff5 --- /dev/null +++ b/keyboards/panc60/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_hhkb( + KC_ESC, 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_BSLS, KC_GRV, + 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_DEL, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, MO(1), + KC_RGUI, KC_LALT, KC_SPC, KC_LALT, KC_LGUI), + + [1] = LAYOUT_60_hhkb( + 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_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RIGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} diff --git a/keyboards/panc60/keymaps/default/readme.md b/keyboards/panc60/keymaps/default/readme.md new file mode 100644 index 0000000000..3aa3cdb4c6 --- /dev/null +++ b/keyboards/panc60/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for panc60 diff --git a/keyboards/panc60/matrix.c b/keyboards/panc60/matrix.c new file mode 100644 index 0000000000..cf0f63837b --- /dev/null +++ b/keyboards/panc60/matrix.c @@ -0,0 +1,145 @@ +/* +Copyright 2018 Jack Humbert + +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 . +*/ + +#include +#include +#include +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +__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) { } + +// #define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +// #define MATRIX_COL_PINS { A0, A1, A2, A3, A4, A5, A6, A7, C7, C6, C5, C4, C3, C2, D7 } + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_init(void) { + + // disables JTAG so we can use them as columns + MCUCSR = (1<. + */ +#include "panc60.h" + +#include +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +__attribute__ ((weak)) +void matrix_scan_user(void) { +} diff --git a/keyboards/panc60/panc60.h b/keyboards/panc60/panc60.h new file mode 100644 index 0000000000..95dcb1f90b --- /dev/null +++ b/keyboards/panc60/panc60.h @@ -0,0 +1,71 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef PANC60_H +#define PANC60_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K47, K49, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, K4B, K4C, K4D, KC_NO } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K47, K49, K4A, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, KC_NO }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, K49, K4A, KC_NO, K4C, K4D, KC_NO } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K47, K4A, K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ + { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, KC_NO, K4C, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/panc60/readme.md b/keyboards/panc60/readme.md new file mode 100644 index 0000000000..05ac3d72be --- /dev/null +++ b/keyboards/panc60/readme.md @@ -0,0 +1,46 @@ +# panc60 + +![panc60](https://imgix.ttcdn.co/i/product/original/0/670893-eca4599c4aad489dbe62609ac2fed86e.jpeg?q=100&auto=format%2Ccompress&w=500) + +The panc60 is a 60% PCB with backlight and rgb underglow. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin), [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: panc60 PCB +Hardware Availability: [PANC Interactive](https://store.panc.co/product/panc60-60-pcb) + +Make example for this keyboard (after setting up your build environment): + + make panc60:default + +Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +To put the panc60 into reset, hold left control while plugging in. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +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/panc60/rules.mk b/keyboards/panc60/rules.mk new file mode 100644 index 0000000000..fcb14d0ae0 --- /dev/null +++ b/keyboards/panc60/rules.mk @@ -0,0 +1,52 @@ +# Copyright 2017 Luiz Ribeiro +# +# 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 . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# 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 = bootloadHID + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = no +RGBLIGHT_ENABLE = no +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex + +LAYOUTS = 60_ansi 60_hhkb diff --git a/keyboards/panc60/usbconfig.h b/keyboards/panc60/usbconfig.h new file mode 100644 index 0000000000..d2d848fcdc --- /dev/null +++ b/keyboards/panc60/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ -- cgit v1.2.3 From 58b9b22670c2c36e8502826349d8f752d8b3ab37 Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 23 Sep 2018 22:49:17 +0200 Subject: Circuitry sample for PS/2 Mouse (#3959) Added a sample circuitry for handling the connection of a PS/2 Mouse. Even if it's written that a circuitry is needed, there're a lot of other things and the information gets lost really fast. A really simple sample helps to remember who wants to implement the functionality about the circuitry. --- docs/feature_ps2_mouse.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/feature_ps2_mouse.md b/docs/feature_ps2_mouse.md index 909406e7d2..01e2cc63db 100644 --- a/docs/feature_ps2_mouse.md +++ b/docs/feature_ps2_mouse.md @@ -6,6 +6,24 @@ To hook up a Trackpoint, you need to obtain a Trackpoint module (i.e. harvest fr There are three available modes for hooking up PS/2 devices: USART (best), interrupts (better) or busywait (not recommended). +### The Cirtuitry between Trackpoint and Controller + +To get the things working, a 4.7K drag is needed between the two lines DATA and CLK and the line 5+. + +``` + + DATA ----------+--------- PIN + | + 4.7K + | +MODULE 5+ --------+--+--------- PWR CONTROLLER + | + 4.7K + | + CLK ------+------------ PIN +``` + + ### Busywait Version Note: This is not recommended, you may encounter jerky movement or unsent inputs. Please use interrupt or USART version if possible. -- cgit v1.2.3 From ce057ea47448d0df2a05efa419f61563649a5821 Mon Sep 17 00:00:00 2001 From: listofoptions <39714365+listofoptions@users.noreply.github.com> Date: Sun, 23 Sep 2018 21:46:53 -0400 Subject: Keyboard: HP 46010A converter (#3967) * funged git history, restarting * tested and working (message typed on this) * updated documentation to include wiring directions * formatting * updated matrix and default layout a bit * getting ready for merge into main repo * getting ready for merge into main repo v2 * cleaning * cleaning repo of extranious files * updated documentation --- keyboards/converter/hp_46010a/config.h | 35 +++ keyboards/converter/hp_46010a/hp_46010a.c | 3 + keyboards/converter/hp_46010a/hp_46010a.h | 62 ++++++ keyboards/converter/hp_46010a/info.json | 6 + .../converter/hp_46010a/keymaps/default/keymap.c | 45 ++++ keyboards/converter/hp_46010a/matrix.c | 244 +++++++++++++++++++++ keyboards/converter/hp_46010a/readme.md | 52 +++++ keyboards/converter/hp_46010a/rules.mk | 72 ++++++ 8 files changed, 519 insertions(+) create mode 100644 keyboards/converter/hp_46010a/config.h create mode 100644 keyboards/converter/hp_46010a/hp_46010a.c create mode 100644 keyboards/converter/hp_46010a/hp_46010a.h create mode 100644 keyboards/converter/hp_46010a/info.json create mode 100644 keyboards/converter/hp_46010a/keymaps/default/keymap.c create mode 100644 keyboards/converter/hp_46010a/matrix.c create mode 100644 keyboards/converter/hp_46010a/readme.md create mode 100644 keyboards/converter/hp_46010a/rules.mk diff --git a/keyboards/converter/hp_46010a/config.h b/keyboards/converter/hp_46010a/config.h new file mode 100644 index 0000000000..f77ed4115f --- /dev/null +++ b/keyboards/converter/hp_46010a/config.h @@ -0,0 +1,35 @@ +/* +Copyright 2018 listofoptions + +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 + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 1 +#define MANUFACTURER QMK +#define PRODUCT 46010A keyboard converter +#define DESCRIPTION 46010A keyboard converter + +#define MATRIX_ROWS 14 +#define MATRIX_COLS 8 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + + diff --git a/keyboards/converter/hp_46010a/hp_46010a.c b/keyboards/converter/hp_46010a/hp_46010a.c new file mode 100644 index 0000000000..915a220f91 --- /dev/null +++ b/keyboards/converter/hp_46010a/hp_46010a.c @@ -0,0 +1,3 @@ +#include "hp_46010a.h" +#include +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/hp_46010a/hp_46010a.h b/keyboards/converter/hp_46010a/hp_46010a.h new file mode 100644 index 0000000000..db64ce24a5 --- /dev/null +++ b/keyboards/converter/hp_46010a/hp_46010a.h @@ -0,0 +1,62 @@ +/* +Copyright 2018 listofoptions + +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 + +#include "quantum.h" + +/* ,---------. ,---------------------------------------------------------. ,---------. ,-------------------. + * | res|stop| | f1| f2| f3| f4|menu|user| f5| f6| f7| f8| |clrl|clrd| | | | | | + * `---------' `---------------------------------------------------------' `---------' `-------------------' + * ,------------------------------------------------------------------------..---------. ,-------------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| +| back||insl|dell| | *| /| +| -| + * |------------------------------------------------------------------------||---------| |-------------------| + * | tab| q| w| e| r| t| y| u| i| o| p| [| ]| \||insc|delc| | 7| 8| 9|pade| + * |------------------------------------------------------------------------||---------| |-------------------| + * |caps|ctrl| a| s| d| f| g| h| j| k| l| ;| '| retr|| cur|prev| | 4| 5| 6| ,| + * |------------------------------------------------------------------------------------ |-------------------| + * |dele|lshf | z| x| c| v| b| n| m| ,| .| /|rshf |sel | up|next| | 1| 2| 3| tab| + * |-------------------------------------------------------------------------|---------| |--------------- | + * |prnt| |lalt| space |ralt| |left|down|rght| | 0| .| | + * `-----------------------------------------------------------------------------------' `-------------------' + */ + +#define LAYOUT_HP_46010A( \ + KEY_RES, KEY_STOP, KEY_F1, KEY_F2, KEY_F3, KEY_F4,KEY_MENU,KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_B1, KEY_B2, KEY_B3, KEY_B4, \ + KEY_GRAV, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_MULT, KEY_DIV, KEY_ADD, KEY_SUBT, \ + KEY_TAB, KEY_Q,KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_P7, KEY_P8, KEY_P9, KEY_PADE, \ + KEY_CAPS, KEY_CTRL, KEY_A, KEY_S, KEY_D, KEY_F, KEY_G, KEY_H, KEY_J, KEY_K, KEY_L, KEY_SEMI, KEY_QUOT, KEY_RETR, KEY_CUR, KEY_PREV, KEY_P4, KEY_P5, KEY_P6, KEY_PCOM, \ + KEY_DELE, KEY_LSHF, KEY_Z, KEY_X, KEY_C, KEY_V, KEY_B, KEY_N, KEY_M, KEY_COMA, KEY_DOT, KEY_SLAS,KEY_RSHF, KEY_SEL, KEY_UP, KEY_NEXT, KEY_P1, KEY_P2, KEY_P3, KEY_PTAB, \ + KEY_PRNT, KEY_LALT, KEY_SPACE , KEY_RALT, KEY_LEFT, KEY_DOWN, KEY_RGHT, KEY_P0, KEY_PDOT \ +) { \ + {KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_MENU }, \ + {KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_8 }, \ + {KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_I }, \ + {KEY_K, KEY_L, KEY_SEMI, KEY_QUOT, KEY_RETR, KEY_CUR, KEY_PREV, KEY_J }, \ + {KEY_COMA, KEY_DOT, KEY_SLAS, KEY_1, KEY_SEL, KEY_UP, KEY_NEXT, KEY_M }, \ + {KEY_SPACE, KEY_LALT, KEY_RALT, KC_NO, KEY_LEFT, KEY_DOWN, KEY_RGHT, KC_NO }, \ + {KEY_F3, KEY_F2, KEY_F1, KEY_GRAV, KEY_CTRL, KEY_STOP, KEY_G, KEY_F4 }, \ + {KEY_6, KEY_5, KEY_4, KEY_3, KEY_CAPS, KEY_RSHF, KEY_LSHF, KEY_7 }, \ + {KEY_Y, KEY_T, KEY_R, KEY_E, KEY_W, KEY_Q, KEY_TAB, KEY_U }, \ + {KEY_RES, KEY_F, KEY_D, KEY_S, KEY_A, KC_NO, KEY_2, KEY_H }, \ + {KEY_P7, KEY_P4, KEY_P8, KEY_P5, KEY_P9, KEY_P6, KEY_PADE, KEY_PCOM }, \ + {KEY_MULT, KEY_P1, KEY_DIV, KEY_P2, KEY_PLUS, KEY_P3, KEY_MINU, KEY_PTAB }, \ + {KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \ + {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ +} + +#define LAYOUT LAYOUT_HP_46010A diff --git a/keyboards/converter/hp_46010a/info.json b/keyboards/converter/hp_46010a/info.json new file mode 100644 index 0000000000..de68a12285 --- /dev/null +++ b/keyboards/converter/hp_46010a/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "HP_46010A", + "keyboard_folder": "converter/HP_46010A", + "url": "https://deskthority.net/wiki/HP_46010A", + "maintainer": "listofoptions", +} diff --git a/keyboards/converter/hp_46010a/keymaps/default/keymap.c b/keyboards/converter/hp_46010a/keymaps/default/keymap.c new file mode 100644 index 0000000000..cb65bd422e --- /dev/null +++ b/keyboards/converter/hp_46010a/keymaps/default/keymap.c @@ -0,0 +1,45 @@ +/* +Copyright 2018 listofoptions + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* ,---------. ,---------------------------------------------------------. ,---------. ,-------------------. + * | esc|xxxx| | f1| f2| f3| f4|xxxx|xxxx| f5| f6| f7| f8| |xxxx|xxxx| | f9| f10| f11| f12| + * `---------' `---------------------------------------------------------' `---------' `-------------------' + * ,------------------------------------------------------------------------..---------. ,-------------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| back||ins |home| | *| /| +| -| + * |------------------------------------------------------------------------||---------| |-------------------| + * | tab| q| w| e| r| t| y| u| i| o| p| [| ]| \||del | end| | 7| 8| 9|pade| + * |------------------------------------------------------------------------||---------| |-------------------| + * |caps|ctrl| a| s| d| f| g| h| j| k| l| ;| '| retr||xxxx|pgup| | 4| 5| 6| ,| + * |------------------------------------------------------------------------------------ |-------------------| + * |del |lsft | z| x| c| v| b| n| m| ,| .| /|rsft | app| up|pgdn| | 1| 2| 3| tab| + * |-------------------------------------------------------------------------|---------| |--------------- | + * | gui| |lalt| space |ralt| |left|down|rght| | 0| .| | + * `-----------------------------------------------------------------------------------' `-------------------' + */ + + [0] = LAYOUT( + KC_ESC, KC_NO, KC_F1, KC_F2, KC_F3, KC_F4,KC_NO, KC_NO, KC_F5, KC_F6, KC_F7, KC_F8, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQUAL, KC_BSPC, KC_INS, KC_HOME, KC_PAST, KC_PSLS, KC_PPLS, 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_P7, KC_P8, KC_P9, KC_PENT, \ + KC_CAPS, KC_LCTL, 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_NO, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PCMM, \ + KC_DEL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,KC_RSFT, KC_APP, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, KC_TAB, \ + KC_LGUI, KC_LALT, KC_SPACE , KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ) +} ; \ No newline at end of file diff --git a/keyboards/converter/hp_46010a/matrix.c b/keyboards/converter/hp_46010a/matrix.c new file mode 100644 index 0000000000..2ca7d0357e --- /dev/null +++ b/keyboards/converter/hp_46010a/matrix.c @@ -0,0 +1,244 @@ +/* +Copyright 2018 listofoptions + +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 . +*/ + +#include +#include +#include +#if defined(__AVR__) +#include +#endif +#include + +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "LUFA/Drivers/Peripheral/SPI.h" + +#include "config.h" + + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if ( DEBOUNCING_DELAY > 0 ) +static uint16_t debouncing_time ; +static bool debouncing = false ; +#endif + +static uint8_t matrix [MATRIX_ROWS] = {0}; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint8_t matrix_debounce_old [MATRIX_ROWS] = {0}; +static uint8_t matrix_debounce_new [MATRIX_ROWS] = {0}; +#endif + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { +} + +// the keyboard's internal wiring is such that the inputs to the logic are +// a clock signal, and a reset line. +// the output is a single output pin. im bitbanging here, but the SPI controller +// would work normally +// +// the device functions, by using the clock signal to count 128 bits, the lower +// 3 bits of this 7 bit counter are tied to a 1-of-8 multiplexer, this forms +// the columns. +// the upper 4 bits form the rows, and are decoded using bcd to decimal +// decoders, so that 14 out of 16 of the outputs are wired to the rows of the +// matrix. each switch has a diode, such that the row signal feeds into the +// switch, and then into the diode, then into one of the columns into the +// matrix. the reset pin can be used to reset the entire counter. + +#define RESET _BV(PB0) +#define SCLK _BV(PB1) +#define SDATA _BV(PB3) +#define LED _BV(PD6) + +inline +static +void SCLK_increment(void) { + PORTB &= ~SCLK ; + _delay_us( 4 ) ; // make sure the line is stable + PORTB |= SCLK ; + _delay_us( 4 ) ; + + return ; +} + +inline +static +void Matrix_Reset(void) { + PORTB |= RESET ; + _delay_us( 4 ) ; // make sure the line is stable + PORTB &= ~RESET ; + + return ; +} + +inline +static +uint8_t Matrix_ReceiveByte (void) { + uint8_t received = 0 ; + uint8_t temp = 0 ; + for ( uint8_t bit = 0; bit < MATRIX_COLS; ++bit ) { + // toggle the clock + SCLK_increment(); + temp = (PINB & SDATA) << 4 ; + received |= temp >> bit ; + } + + return received ; +} + +inline +static +void Matrix_ThrowByte(void) { + // we use MATRIX_COLS - 1 here because that would put us at 7 clocks + for ( uint8_t bit = 0; bit < MATRIX_COLS - 1; ++bit ) { + // toggle the clock + SCLK_increment(); + } + + return ; +} + +void matrix_init () { + // debug_matrix = 1; + // PB0 (SS) and PB1 (SCLK) set to outputs + DDRB |= RESET | SCLK ; + // PB2, is unused, and PB3 is our serial input + DDRB &= ~SDATA ; + + // SS is reset for this board, and is active High + // SCLK is the serial clock and is active High + PORTB &= ~RESET ; + PORTB |= SCLK ; + + // led pin + DDRD |= LED ; + PORTD &= ~LED ; + + matrix_init_quantum(); + + //toggle reset, to put the keyboard logic into a known state + Matrix_Reset() ; +} + +uint8_t matrix_scan(void) { + + // the first byte of the keyboard's output data can be ignored + Matrix_ThrowByte(); + +#if ( DEBOUNCING_DELAY > 0 ) + + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + //transfer old debouncing values + matrix_debounce_old[row] = matrix_debounce_new[row] ; + // read new key-states in + matrix_debounce_new[row] = Matrix_ReceiveByte() ; + + if ( matrix_debounce_new[row] != matrix_debounce_old[row] ) { + debouncing = true ; + debouncing_time = timer_read() ; + } + } + +#else + // without debouncing we simply just read in the raw matrix + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + matrix[row] = Matrix_ReceiveByte ; + } +#endif + + +#if ( DEBOUNCING_DELAY > 0 ) + if ( debouncing && ( timer_elapsed( debouncing_time ) > DEBOUNCING_DELAY ) ) { + + for ( uint8_t row = 0 ; row < MATRIX_ROWS ; ++row ) { + matrix[row] = matrix_debounce_new[row] ; + } + + debouncing = false ; + } +#endif + Matrix_Reset() ; + + matrix_scan_quantum() ; + return 1; +} + +inline +uint8_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++) { + phex(row); print(": "); + print_bin_reverse8(matrix_get_row(row)); + print("\n"); + } +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +// as an aside, I used the M0110 converter: +// tmk_core/common/keyboard.c, quantum/matrix.c, and the project layout of the planck +// the online ducmentation starting from : +// https://docs.qmk.fm/#/config_options +// https://docs.qmk.fm/#/understanding_qmk +// and probably a few i forgot.... \ No newline at end of file diff --git a/keyboards/converter/hp_46010a/readme.md b/keyboards/converter/hp_46010a/readme.md new file mode 100644 index 0000000000..2321faa6e1 --- /dev/null +++ b/keyboards/converter/hp_46010a/readme.md @@ -0,0 +1,52 @@ +# HP 46010A + +![46010A](https://deskthority.net/w/images/a/a5/HP_46010A_--_top.jpg) + +A converter for the eponymous keyboard. + +Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions) +Hardware Supported: HP 46010A, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make converter/HP_46010A: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). + +to get a matrix created if your board uses a different one (i used the US layout) please see the following gists: +for the matrix itself: https://gist.github.com/listofoptions/cdf70d94767e9c6c027741850a24c568 +for the program to generate the matrix: https://gist.github.com/listofoptions/d245e370678024edbe5bed8c8ab17999 + +to build the actual converter, you are going to need to either splice into the a connector or, use a multi-meter to buzz/ohm out which wires go where. +from the bottom of the pcb the pins are arraged as follows: + + + 4 5 6 + 3 2 1 + + +connect a six pin modular connector of the 6p6c variaty. +then lop off the other end of the cable, striping the wires inside. +use the ohm-meter to find the corresponding wire for each pin on the bottom of the pcb + +the pin meanings are as follows: +1 reset +2 no connection +3 vcc +4 data out +5 clock +6 ground + +wire the ground and power pins to ground and 5v power on the teensy (or other avr device of your choice) +connect +on the teensy the connection is as follows + + +teensy | HP 46010A +----|----- +gnd | gnd (6) +vcc | vcc (3) +PB0 | reset (1) +PB1 | clock (5) +PB3 | data out (4) +gnd | no connection (2) -- optional diff --git a/keyboards/converter/hp_46010a/rules.mk b/keyboards/converter/hp_46010a/rules.mk new file mode 100644 index 0000000000..ddd2d593bd --- /dev/null +++ b/keyboards/converter/hp_46010a/rules.mk @@ -0,0 +1,72 @@ +# MCU name +#MCU = at90usb1287 +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 +# 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 = halfkay + +# 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 = 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 = no # 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 controls +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. +API_SYSEX_ENABLE = no +SPLIT_KEYBOARD = no +WAIT_FOR_USB = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS_HAS_RGB = NO + +CUSTOM_MATRIX = yes +SRC = matrix.c \ No newline at end of file -- cgit v1.2.3 From 07d317ab8877f935768e8798c1560242e3687847 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 23 Sep 2018 18:47:43 -0700 Subject: Keyboard: Crkbd: move I2C and Serial defines to keyboard's config.h (#3970) * Crkbd: move I2C and Serial defines to keyboard's config.h per @drashna on Discord * Crkbd: remove misleading comment re: I2C and Serial USE_I2C and USE_SERIAL are usually a "one or the other"-type deal, but this keyboard uses both. --- keyboards/crkbd/config.h | 3 +++ keyboards/crkbd/keymaps/default/config.h | 4 ---- keyboards/crkbd/keymaps/like_jis/config.h | 4 ---- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/keyboards/crkbd/config.h b/keyboards/crkbd/config.h index 64fee75457..4357a218d4 100644 --- a/keyboards/crkbd/config.h +++ b/keyboards/crkbd/config.h @@ -21,6 +21,9 @@ along with this program. If not, see . #include "config_common.h" #include +#define USE_I2C +#define USE_SERIAL + #ifdef USE_Link_Time_Optimization // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), // so just disable them diff --git a/keyboards/crkbd/keymaps/default/config.h b/keyboards/crkbd/keymaps/default/config.h index c573530f74..644e813650 100644 --- a/keyboards/crkbd/keymaps/default/config.h +++ b/keyboards/crkbd/keymaps/default/config.h @@ -20,10 +20,6 @@ along with this program. If not, see . #pragma once -/* Use I2C or Serial */ - -#define USE_I2C -#define USE_SERIAL //#define USE_MATRIX_I2C /* Select hand configuration */ diff --git a/keyboards/crkbd/keymaps/like_jis/config.h b/keyboards/crkbd/keymaps/like_jis/config.h index 4c31cc7794..0e2960a937 100644 --- a/keyboards/crkbd/keymaps/like_jis/config.h +++ b/keyboards/crkbd/keymaps/like_jis/config.h @@ -20,10 +20,6 @@ along with this program. If not, see . #pragma once -/* Use I2C or Serial */ - -#define USE_I2C -#define USE_SERIAL //#define USE_MATRIX_I2C /* Select hand configuration */ -- cgit v1.2.3 From 9012f4c2e005253574f2af2887c2317d51c70405 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 23 Sep 2018 20:50:08 -0700 Subject: Keyboard: Crkbd: Configurator support and readme formatting (#3971) --- keyboards/crkbd/info.json | 62 +++++++++++++++++++++++++++++++++++++++++++++++ keyboards/crkbd/readme.md | 3 ++- 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 keyboards/crkbd/info.json diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json new file mode 100644 index 0000000000..d74bb49430 --- /dev/null +++ b/keyboards/crkbd/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "crkbd (helidox) rev. 1", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 4.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0.3}, + {"label":"Q", "x":1, "y":0.3}, + {"label":"W", "x":2, "y":0.1}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0.1}, + {"label":"T", "x":5, "y":0.2}, + + {"label":"Y", "x":9, "y":0.2}, + {"label":"U", "x":10, "y":0.1}, + {"label":"I", "x":11, "y":0}, + {"label":"O", "x":12, "y":0.1}, + {"label":"P", "x":13, "y":0.3}, + {"label":"Back Space", "x":14, "y":0.3}, + + {"label":"Ctrl / Tab", "x":0, "y":1.3}, + {"label":"A", "x":1, "y":1.3}, + {"label":"S", "x":2, "y":1.1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1.1}, + {"label":"G", "x":5, "y":1.2}, + + {"label":"H", "x":9, "y":1.2}, + {"label":"J", "x":10, "y":1.1}, + {"label":"K", "x":11, "y":1}, + {"label":"L", "x":12, "y":1.1}, + {"label":";", "x":13, "y":1.3}, + {"label":"'", "x":14, "y":1.3}, + + {"label":"Shift", "x":0, "y":2.3}, + {"label":"Z", "x":1, "y":2.3}, + {"label":"X", "x":2, "y":2.1}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2.1}, + {"label":"B", "x":5, "y":2.2}, + + {"label":"N", "x":9, "y":2.2}, + {"label":"M", "x":10, "y":2.1}, + {"label":",", "x":11, "y":2}, + {"label":".", "x":12, "y":2.1}, + {"label":"/", "x":13, "y":2.3}, + {"label":"Shift", "x":14, "y":2.3}, + + {"label":"GUI / KC_HANJ", "x":4, "y":3.7}, + {"label":"Lower", "x":5, "y":3.7}, + {"label":"Space", "x":6, "y":3.2, "h":1.5}, + + {"label":"Enter", "x":8, "y":3.2, "h":1.5}, + {"label":"Raise", "x":9, "y":3.7}, + {"label":"Alt / KC_HAEN", "x":10, "y":3.7} + ] + } + } +} diff --git a/keyboards/crkbd/readme.md b/keyboards/crkbd/readme.md index 2f9f047a47..591fdfe0da 100644 --- a/keyboards/crkbd/readme.md +++ b/keyboards/crkbd/readme.md @@ -10,8 +10,9 @@ A split keyboard with 3x6 vertically staggered keys and 3 thumb keys. Keyboard Maintainer: [foostan](https://github.com/foostan/) [@foostan](https://twitter.com/foostan) Hardware Supported: Crkbd PCB, Pro Micro Hardware Availability: [PCB & Case Data](https://github.com/foostan/crkbd) + Make example for this keyboard (after setting up your build environment): make crkbd:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From b7e25f9ec4203670f2434e82608554ba284cf1f3 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 24 Sep 2018 20:39:17 -0700 Subject: Keyboard: DZ60 Bug: layout_directional is shifted to the left by one (#3978) * layout_directional is shifted to the left by one * forgot to adjust the physical layout --- keyboards/dz60/dz60.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index b1089d3b64..3d0b0dd527 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -82,13 +82,13 @@ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K312, K313, K314, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ K400, K401, K403, K404, K406, K408, K410, K411, K412, K413, K414 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, KC_NO, K312, K313, K314 }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ } -- cgit v1.2.3 From e72e4b6920299176a322a2862f930b7ee5f73dff Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 8 May 2018 18:46:29 -0700 Subject: Store Clicky status in EEPROM --- docs/feature_audio.md | 4 +--- quantum/audio/audio.c | 8 ++++---- quantum/process_keycode/process_clicky.c | 14 +++++++------- users/drashna/drashna.c | 28 ++++++++++++++++++++-------- users/drashna/drashna.h | 3 +-- 5 files changed, 33 insertions(+), 24 deletions(-) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 039c62cdf1..fe210c09b9 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -128,13 +128,11 @@ This adds a click sound each time you hit a button, to simulate click sounds fro * `CK_UP` - Increases the frequency of the clicks * `CK_DOWN` - Decreases the frequency of the clicks + The feature is disabled by default, to save space. To enable it, add this to your `config.h`: #define AUDIO_CLICKY -Additionally, even when enabled, the feature is not enabled by default, so you would need to turn it on first. And since we don't use EEPROM to store the setting (yet), you can default this to on by adding this to your `config.h`: - - #define AUDIO_CLICKY_ON You can configure the default, min and max frequencies, the stepping and built in randomness by defining these values: diff --git a/quantum/audio/audio.c b/quantum/audio/audio.c index c948a60d6c..6d6833ec11 100644 --- a/quantum/audio/audio.c +++ b/quantum/audio/audio.c @@ -223,7 +223,7 @@ void audio_init() TCCR1B = (1 << WGM13) | (1 << WGM12) | (0 << CS12) | (1 << CS11) | (0 << CS10); TIMER_1_PERIOD = (uint16_t)(((float)F_CPU) / (440 * CPU_PRESCALER)); TIMER_1_DUTY_CYCLE = (uint16_t)((((float)F_CPU) / (440 * CPU_PRESCALER)) * note_timbre); - #endif + #endif audio_initialized = true; } @@ -231,7 +231,7 @@ void audio_init() if (audio_config.enable) { PLAY_SONG(startup_song); } - + } void stop_all_notes() @@ -464,7 +464,7 @@ ISR(TIMER3_AUDIO_vect) note_position++; bool end_of_note = false; if (TIMER_3_PERIOD > 0) { - if (!note_resting) + if (!note_resting) end_of_note = (note_position >= (note_length / TIMER_3_PERIOD * 0xFFFF - 1)); else end_of_note = (note_position >= (note_length)); @@ -604,7 +604,7 @@ ISR(TIMER1_AUDIO_vect) note_position++; bool end_of_note = false; if (TIMER_1_PERIOD > 0) { - if (!note_resting) + if (!note_resting) end_of_note = (note_position >= (note_length / TIMER_1_PERIOD * 0xFFFF - 1)); else end_of_note = (note_position >= (note_length)); diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 1e950d1113..bd2f1b3b37 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -3,11 +3,6 @@ #ifdef AUDIO_CLICKY -#ifdef AUDIO_CLICKY_ON -bool clicky_enable = true; -#else // AUDIO_CLICKY_ON -bool clicky_enable = false; -#endif // AUDIO_CLICKY_ON #ifndef AUDIO_CLICKY_FREQ_DEFAULT #define AUDIO_CLICKY_FREQ_DEFAULT 440.0f #endif // !AUDIO_CLICKY_FREQ_DEFAULT @@ -27,6 +22,8 @@ bool clicky_enable = false; float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations +extern audio_config_t audio_config; + #ifndef NO_MUSIC_MODE extern bool music_activated; extern bool midi_activated; @@ -42,7 +39,10 @@ void clicky_play(void) { } bool process_clicky(uint16_t keycode, keyrecord_t *record) { - if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_enable = !clicky_enable; } + if (keycode == CLICKY_TOGGLE && record->event.pressed) { + audio_config.clicky ^= 1; + eeconfig_update_audio(audio_config.raw); + } if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; } @@ -60,7 +60,7 @@ bool process_clicky(uint16_t keycode, keyrecord_t *record) { } - if ( clicky_enable ) { + if ( audio_config.clicky ) { if (record->event.pressed) { clicky_play();; } diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 20df2f4de6..7bb272a267 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -133,9 +133,6 @@ void led_set_keymap(uint8_t usb_led) {} void matrix_init_user(void) { userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); -#ifdef AUDIO_CLICKY - clicky_enable = userspace_config.clicky_enable; -#endif #ifdef BOOTLOADER_CATERINA DDRD &= ~(1<<5); @@ -145,7 +142,6 @@ void matrix_init_user(void) { PORTB &= ~(1<<0); #endif - #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) set_unicode_input_mode(UC_WINC); #endif //UNICODE_ENABLE @@ -338,11 +334,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - case CLICKY_TOGGLE: -#ifdef AUDIO_CLICKY - userspace_config.clicky_enable = clicky_enable; - eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); + case KC_CCCV: // One key copy/paste + if(record->event.pressed){ + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + register_code(KC_LCTL); + tap(KC_C); + unregister_code(KC_LCTL); +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_copy); +#endif + } else { // Tap, paste + register_code(KC_LCTL); + tap(KC_V); + unregister_code(KC_LCTL); +#ifdef AUDIO_ENABLE + PLAY_SONG(tone_paste); #endif + } + } + return false; break; #ifdef UNICODE_ENABLE case UC_FLIP: // (╯°□°)╯ ︵ ┻━┻ diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index dd0d1c0d7e..de8c3ba947 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -49,7 +49,7 @@ enum userspace_layers { // RGB color codes are no longer located here anymore. Instead, you will want to // head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h -extern bool clicky_enable; +extern bool rgb_layer_change; #ifdef RGBLIGHT_ENABLE void rgblight_sethsv_default_helper(uint8_t index); @@ -64,7 +64,6 @@ bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t thi typedef union { uint8_t raw; struct { - bool clicky_enable :1; bool rgb_layer_change :1; bool is_overwatch :1; bool nuke_switch :1; -- cgit v1.2.3 From cfb1b353eef290ea4eddd7cfcb4617ca25d440d2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 31 May 2018 12:24:10 -0700 Subject: Add functions so you can configure programatically --- quantum/audio/audio.h | 3 +- quantum/process_keycode/process_clicky.c | 60 ++++++++++++++++++++++---------- quantum/process_keycode/process_clicky.h | 9 +++++ 3 files changed, 53 insertions(+), 19 deletions(-) diff --git a/quantum/audio/audio.h b/quantum/audio/audio.h index da09b2bcd2..8136c5b258 100644 --- a/quantum/audio/audio.h +++ b/quantum/audio/audio.h @@ -40,7 +40,8 @@ typedef union { uint8_t raw; struct { bool enable :1; - uint8_t level :7; + bool clicky_enable :1; + uint8_t level :6; }; } audio_config_t; diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index bd2f1b3b37..b3c8d890e2 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -38,29 +38,53 @@ void clicky_play(void) { PLAY_SONG(clicky_song); } +void clicky_freq_up(void) { + float new_freq = clicky_freq * AUDIO_CLICKY_FREQ_FACTOR; + if (new_freq < AUDIO_CLICKY_FREQ_MAX) { + clicky_freq = new_freq; + } +} + +void clicky_freq_down(void) { + float new_freq = clicky_freq / AUDIO_CLICKY_FREQ_FACTOR; + if (new_freq > AUDIO_CLICKY_FREQ_MIN) { + clicky_freq = new_freq; + } +} + +void clicky_freq_reset(void) { + clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; +} + +void clicky_freq_toggle(void) { + audio_config.clicky_enable ^= 1; + eeconfig_update_audio(audio_config.raw); +} + +void clicky_freq_on(void) { + audio_config.clicky_enable = 1; + eeconfig_update_audio(audio_config.raw); +} + +void clicky_freq_off(void) { + audio_config.clicky_enable = 0; + eeconfig_update_audio(audio_config.raw); +} + +bool is_clicky_on(void) { + return (audio_config.clicky_enable != 0); +} + bool process_clicky(uint16_t keycode, keyrecord_t *record) { - if (keycode == CLICKY_TOGGLE && record->event.pressed) { - audio_config.clicky ^= 1; - eeconfig_update_audio(audio_config.raw); - } + if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_freq_toggle(); } - if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; } + if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq_reset(); } - if (keycode == CLICKY_UP && record->event.pressed) { - float new_freq = clicky_freq * AUDIO_CLICKY_FREQ_FACTOR; - if (new_freq < AUDIO_CLICKY_FREQ_MAX) { - clicky_freq = new_freq; - } - } - if (keycode == CLICKY_DOWN && record->event.pressed) { - float new_freq = clicky_freq / AUDIO_CLICKY_FREQ_FACTOR; - if (new_freq > AUDIO_CLICKY_FREQ_MIN) { - clicky_freq = new_freq; - } - } + if (keycode == CLICKY_UP && record->event.pressed) { clicky_freq_up(); } + if (keycode == CLICKY_DOWN && record->event.pressed) { clicky_freq_down(); } - if ( audio_config.clicky ) { + if ( audio_config.clicky_enable ) { if (record->event.pressed) { clicky_play();; } diff --git a/quantum/process_keycode/process_clicky.h b/quantum/process_keycode/process_clicky.h index e274af56f1..6ee3cc5d9f 100644 --- a/quantum/process_keycode/process_clicky.h +++ b/quantum/process_keycode/process_clicky.h @@ -4,4 +4,13 @@ void clicky_play(void); bool process_clicky(uint16_t keycode, keyrecord_t *record); +void clicky_freq_up(void); +void clicky_freq_down(void); +void clicky_freq_reset(void); +void clicky_freq_toggle(void); +void clicky_freq_on(void); +void clicky_freq_off(void); + +bool is_clicky_on(void); + #endif -- cgit v1.2.3 From a0309db983150fd0197eb620a6ba552d90d29f93 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 1 Jun 2018 13:29:52 -0700 Subject: Add On/Off keycodes --- docs/feature_audio.md | 12 +++++++----- quantum/process_keycode/process_clicky.c | 11 +++++++---- quantum/process_keycode/process_clicky.h | 7 ++++--- quantum/quantum_keycodes.h | 5 +++++ 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index fe210c09b9..82e0ed9503 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -119,14 +119,16 @@ You can completely disable Music Mode as well. This is useful, if you're pressed #define NO_MUSIC_MODE -## Faux Click +## Audio Click This adds a click sound each time you hit a button, to simulate click sounds from the keyboard. And the sounds are slightly different for each keypress, so it doesn't sound like a single long note, if you type rapidly. * `CK_TOGG` - Toggles the status (will play sound if enabled) -* `CK_RST` - Resets the frequency to the default state -* `CK_UP` - Increases the frequency of the clicks -* `CK_DOWN` - Decreases the frequency of the clicks +* `CK_ON` - Turns on Audio Click (plays sound) +* `CK_OFF` - Turns off Audio Click (doesn't play sound) +* `CK_RST` - Resets the frequency to the default state (plays sound at default frequency) +* `CK_UP` - Increases the frequency of the clicks (plays sound at new frequency) +* `CK_DOWN` - Decreases the frequency of the clicks (plays sound at new frequency) The feature is disabled by default, to save space. To enable it, add this to your `config.h`: @@ -142,7 +144,7 @@ You can configure the default, min and max frequencies, the stepping and built i | `AUDIO_CLICKY_FREQ_MIN` | 65.0f | Sets the lowest frequency (under 60f are a bit buggy). | | `AUDIO_CLICKY_FREQ_MAX` | 1500.0f | Sets the the highest frequency. Too high may result in coworkers attacking you. | | `AUDIO_CLICKY_FREQ_FACTOR` | 1.18921f| Sets the stepping of UP/DOWN key codes. | -| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical. | +| `AUDIO_CLICKY_FREQ_RANDOMNESS` | 0.05f | Sets a factor of randomness for the clicks, Setting this to `0f` will make each click identical, and `1.0f` will make this sound much like the 90's computer screen scrolling/typing effect. | diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index b3c8d890e2..36578047ad 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -56,17 +56,17 @@ void clicky_freq_reset(void) { clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; } -void clicky_freq_toggle(void) { +void clicky_toggle(void) { audio_config.clicky_enable ^= 1; eeconfig_update_audio(audio_config.raw); } -void clicky_freq_on(void) { +void clicky_on(void) { audio_config.clicky_enable = 1; eeconfig_update_audio(audio_config.raw); } -void clicky_freq_off(void) { +void clicky_off(void) { audio_config.clicky_enable = 0; eeconfig_update_audio(audio_config.raw); } @@ -76,7 +76,10 @@ bool is_clicky_on(void) { } bool process_clicky(uint16_t keycode, keyrecord_t *record) { - if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_freq_toggle(); } + if (keycode == CLICKY_TOGGLE && record->event.pressed) { clicky_toggle(); } + + if (keycode == CLICKY_ENABLE && record->event.pressed) { clicky_on(); } + if (keycode == CLICKY_DISABLE && record->event.pressed) { clicky_off(); } if (keycode == CLICKY_RESET && record->event.pressed) { clicky_freq_reset(); } diff --git a/quantum/process_keycode/process_clicky.h b/quantum/process_keycode/process_clicky.h index 6ee3cc5d9f..f746edb951 100644 --- a/quantum/process_keycode/process_clicky.h +++ b/quantum/process_keycode/process_clicky.h @@ -7,9 +7,10 @@ bool process_clicky(uint16_t keycode, keyrecord_t *record); void clicky_freq_up(void); void clicky_freq_down(void); void clicky_freq_reset(void); -void clicky_freq_toggle(void); -void clicky_freq_on(void); -void clicky_freq_off(void); + +void clicky_toggle(void); +void clicky_on(void); +void clicky_off(void); bool is_clicky_on(void); diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 050d2d275d..e983798f2b 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -139,10 +139,13 @@ enum quantum_keycodes { // Faux clicky as part of main audio feature CLICKY_TOGGLE, + CLICKY_ENABLE, + CLICKY_DISABLE, CLICKY_UP, CLICKY_DOWN, CLICKY_RESET, + #ifdef FAUXCLICKY_ENABLE // Faux clicky FC_ON, @@ -571,6 +574,8 @@ enum quantum_keycodes { #define CK_RST CLICKY_RESET #define CK_UP CLICKY_UP #define CK_DOWN CLICKY_DOWN +#define CK_ON CLICKY_ENABLE +#define CK_OFF CLICKY_DISABLE #define RGB_MOD RGB_MODE_FORWARD #define RGB_SMOD RGB_MODE_FORWARD -- cgit v1.2.3 From a54f09d4f32e026543903502e340e4496bfba94c Mon Sep 17 00:00:00 2001 From: Ethan Madden Date: Tue, 25 Sep 2018 15:06:48 -0700 Subject: Keymap: jetpacktuxedo planck keymap (#3896) * added my planck keymap based on a blend of my minivan keymap and the planck default keymap. * moved pipe to better match minivan keymap * updated as per @drashna also moved my keymap a bit after adding the quad encoder and underglow (which doesn't even work on arm right now lol) * a few smaller tweaks --- keyboards/planck/keymaps/jetpacktuxedo/config.h | 32 +++ keyboards/planck/keymaps/jetpacktuxedo/keymap.c | 278 ++++++++++++++++++++++++ keyboards/planck/keymaps/jetpacktuxedo/rules.mk | 1 + 3 files changed, 311 insertions(+) create mode 100644 keyboards/planck/keymaps/jetpacktuxedo/config.h create mode 100644 keyboards/planck/keymaps/jetpacktuxedo/keymap.c create mode 100644 keyboards/planck/keymaps/jetpacktuxedo/rules.mk diff --git a/keyboards/planck/keymaps/jetpacktuxedo/config.h b/keyboards/planck/keymaps/jetpacktuxedo/config.h new file mode 100644 index 0000000000..f216dc02dc --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/config.h @@ -0,0 +1,32 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c new file mode 100644 index 0000000000..2994c0c077 --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c @@ -0,0 +1,278 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _PLOVER, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + PLOVER, + EXT_PLV +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Tab | A | S | D | F | G | H | J | K | L | ; |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | Up |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Brite | Ctrl | Alt | GUI |Lower | Space |Raise | / | Left | Down |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + 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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_RSFT, + RGB_TOG, KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | _ | + | " | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | { | } | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_DQUO, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PIPE, KC_HOME, KC_PGDN, KC_END +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | - | = | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | [ | ] | PgUp | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | \ | Home | PgDn | End | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, KC_HOME, KC_PGDN, KC_END +), + +/* Plover layer (http://opensteno.org) + * ,-----------------------------------------------------------------------------------. + * | Exit | # | # | # | # | # | # | # | # | # | # | # | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | S | T | P | H | * | * | F | P | L | T | D | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | S | K | W | R | * | * | R | B | G | S | Z | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | A | O | | E | U | | | | + * `-----------------------------------------------------------------------------------' + */ + +[_PLOVER] = LAYOUT_planck_grid( + EXT_PLV, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + XXXXXXX, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Plover| | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, PLOVER, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); + #endif + layer_off(_RAISE); + layer_off(_LOWER); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 20; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + register_code(KC_RGHT); + unregister_code(KC_RGHT); + } else { + register_code(KC_LEFT); + unregister_code(KC_LEFT); + } + } else { + if (clockwise) { + register_code(KC_DOWN); + unregister_code(KC_DOWN); + } else { + register_code(KC_UP); + unregister_code(KC_UP); + } + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/jetpacktuxedo/rules.mk b/keyboards/planck/keymaps/jetpacktuxedo/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/jetpacktuxedo/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From 9dc19fdb6d0fedfb0080891a8eff49a8fc3b70c2 Mon Sep 17 00:00:00 2001 From: BenRLewis <11444078+BenRLewis@users.noreply.github.com> Date: Tue, 25 Sep 2018 23:11:11 +0100 Subject: Keymap: FollowingGhosts v60r layout (#3926) * First version of FollowingGhosts' custom layout * Added copyright etc. * Fixed readme and added space cadet shift * Moved from RGB to HSV, updated readme and added media keys * Updated pragma * Added play/pause and updated config * Added pragma back --- .../v60_type_r/keymaps/followingghosts/config.h | 18 ++++ .../v60_type_r/keymaps/followingghosts/keymap.c | 109 +++++++++++++++++++++ .../v60_type_r/keymaps/followingghosts/readme.md | 61 ++++++++++++ .../v60_type_r/keymaps/followingghosts/rules.mk | 4 + 4 files changed, 192 insertions(+) create mode 100644 keyboards/v60_type_r/keymaps/followingghosts/config.h create mode 100644 keyboards/v60_type_r/keymaps/followingghosts/keymap.c create mode 100644 keyboards/v60_type_r/keymaps/followingghosts/readme.md create mode 100644 keyboards/v60_type_r/keymaps/followingghosts/rules.mk diff --git a/keyboards/v60_type_r/keymaps/followingghosts/config.h b/keyboards/v60_type_r/keymaps/followingghosts/config.h new file mode 100644 index 0000000000..a2612e2d32 --- /dev/null +++ b/keyboards/v60_type_r/keymaps/followingghosts/config.h @@ -0,0 +1,18 @@ +/* Copyright 2018 Ben Lewis (FollowingGhosts) + * + * 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 +#define V60_POLESTAR +#define RGBLIGHT_EFFECT_BREATHING diff --git a/keyboards/v60_type_r/keymaps/followingghosts/keymap.c b/keyboards/v60_type_r/keymaps/followingghosts/keymap.c new file mode 100644 index 0000000000..cca95c509d --- /dev/null +++ b/keyboards/v60_type_r/keymaps/followingghosts/keymap.c @@ -0,0 +1,109 @@ +/* Copyright 2018 Ben Lewis (FollowingGhosts) + * + * 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 . + */ + +/* This is adapted from the official ANSI layout provided by the KBP V60 Type R +* as depicted in their manual and on the stock keycaps. +*/ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap 0: Default Layer (Qwerty) + * CAPS opens Layer 1 if held, acts normally if tapped + * Tab is used for Mouse Layer (2) + * ,-----------------------------------------------------------. + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| Bs | + * |-----------------------------------------------------------| + * |L2/Tab| Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |-----------------------------------------------------------| + * |L1/Caps| A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |LShift( | Z| X| C| V| B| N| M| ,| .| /| RShift) | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Fn0 |Gui |App|Ctrl| + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_ansi( + KC_ESC, 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, \ + LT(2, 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, \ + LT(1, 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(1), KC_RGUI, KC_APP, KC_RCTL), + + /* + Keymap 1: FN Layer + AGSW swaps Alt and OS keys for Windows/Mac + RGB enabled + Backlight keys are swapped as firmware is backwards? + * ,-----------------------------------------------------------. + * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| Del | + * |-----------------------------------------------------------| + * | | |Up |RGB|HUI|SAI|VAI| |Prt|Scl|Pau|Up| | Ins | + * |-----------------------------------------------------------| + * | |Lft|Dwn|Rig|HUD|SAD|VAD| |Hme|PgU|Lef|Rig| | + * |-----------------------------------------------------------| + * | |BLD|BLT|BLI| |VolD|VolU|Mut|End|PgD|Dwn| RESET | + * |-----------------------------------------------------------| + * | | | | | |AGSW| | | + * `-----------------------------------------------------------' + */ + + [1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL, \ + KC_TRNS, KC_TRNS, KC_UP, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_INS, \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, RGB_HUD, RGB_SAD, RGB_VAD, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RIGHT, KC_TRNS, \ + KC_TRNS, BL_INC, BL_STEP, BL_DEC, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_DOWN, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, AG_SWAP, KC_TRNS, KC_TRNS), + +/* +Mouse Layer +M1 = Mouse Button 1 +M2 = Mouse Button 2 +WASD are Up Left Right Down respectively +* ,-----------------------------------------------------------. +* | | | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | | M1|MUP|M2 | | | | | | | |MPLY| | | +* |-----------------------------------------------------------| +* | |ML |MDN|MR | | | | | | |MPRV|MNXT| | +* |-----------------------------------------------------------| +* | | | | | | | | | | | | | +* |-----------------------------------------------------------| +* | | | | | | | | | +* `-----------------------------------------------------------' +*/ + [2] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + +}; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1< Date: Tue, 25 Sep 2018 18:16:35 -0400 Subject: Pin avr-gcc in shell.nix pending release of 8.3.0 (#3922) * Pin avr-gcc in shell.nix pending release of 8.3.0 There's apparently a critical bug in 8.2.0, which is now the nixpkgs default. This change overrides that default in favor of the known good version. Once 8.3.0 is the default, the override can be dropped. * Arch/Manjaro fix --- shell.nix | 7 +++++++ util/linux_install.sh | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 715414f96a..67efb46b74 100644 --- a/shell.nix +++ b/shell.nix @@ -13,6 +13,13 @@ let "-B${avrlibc}/avr/lib/avr51" "-L${avrlibc}/avr/lib/avr51" ]; + avrgcc = pkgs.avrgcc.overrideAttrs (oldAttrs: rec { + name = "avr-gcc-8.1.0"; + src = fetchurl { + url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz"; + sha256 = "0lxil8x0jjx7zbf90cy1rli650akaa6hpk8wk8s62vk2jbwnc60x"; + }; + }); in stdenv.mkDerivation { diff --git a/util/linux_install.sh b/util/linux_install.sh index d5da59e827..9b8b92d087 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -10,7 +10,9 @@ elif grep ID /etc/os-release | grep -q debian; then dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ libnewlib-arm-none-eabi elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then - sudo pacman -S gcc unzip wget zip avr-gcc avr-binutils avr-libc \ + # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. + sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz + sudo pacman -S gcc unzip wget zip avr-binutils avr-libc \ dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \ arm-none-eabi-newlib git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer -- cgit v1.2.3 From 6347a654de1ac00f6feb02e0a95b62a42aed406f Mon Sep 17 00:00:00 2001 From: takashi kono Date: Wed, 26 Sep 2018 07:18:11 +0900 Subject: Keymap: Ergo42: biacco-winjp (#3935) * create: biacco jis keymap for windows for Ergo42 * fix: biacco-winjp: change #ifndef to #pragma once. * fix: following: 3935#pullrequestreview-157941685 --- keyboards/ergo42/keymaps/biacco-winjp/config.h | 33 +++++++++ keyboards/ergo42/keymaps/biacco-winjp/keymap.c | 95 ++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 keyboards/ergo42/keymaps/biacco-winjp/config.h create mode 100644 keyboards/ergo42/keymaps/biacco-winjp/keymap.c diff --git a/keyboards/ergo42/keymaps/biacco-winjp/config.h b/keyboards/ergo42/keymaps/biacco-winjp/config.h new file mode 100644 index 0000000000..360d6a5621 --- /dev/null +++ b/keyboards/ergo42/keymaps/biacco-winjp/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/ergo42/keymaps/biacco-winjp/keymap.c b/keyboards/ergo42/keymaps/biacco-winjp/keymap.c new file mode 100644 index 0000000000..5dbca3bfc5 --- /dev/null +++ b/keyboards/ergo42/keymaps/biacco-winjp/keymap.c @@ -0,0 +1,95 @@ +// WindowsでJIS配列として認識しているときに、US配列として使うためのキーマップ +// hdbx から2行コピーさせて頂きました。 + +#include QMK_KEYBOARD_H +#include "keymap_jp.h" // qmk_firmware-master/quantum/keymap_extras/keymap_jp.h 日本語キーボード設定用 +// マクロが必要になったらコメントインすること +// #include // macro sendstring for jis keyboard マクロ文字列送信時に日本語キーボード設定での文字化け回避> + +extern keymap_config_t keymap_config; + +#define BASE 0 +#define META 1 +#define SYMB 2 +#define GAME 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* BASE + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [BASE] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, LT(SYMB, KC_ESC), RCTL_T(KC_SPC), SFT_T(KC_TAB), KC_BSPC, LT(META, KC_ENT), KC_DELT, KC_PSCR, TG(GAME), TG(SYMB), KC_JYEN \ + ), + + /* META + * ,------------------------------------------------. ,------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | [ | | ] | 7 | 8 | 9 | 0 | - | ^ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | F1 | |Muhen | Henk | | ( | | ) | Left | Down | Up |Right | | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | F2 | F3 | F4 | F5 | F6 | { | | } | F7 | F8 | F9 | F10 | F11 |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |Reset |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [META] = LAYOUT( \ + 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_F1, XXXXXXX, KC_MHEN, KC_HENK, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, \ + _______, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, SFT_T(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ \ + ), + + /* SYMB + * ,------------------------------------------------. ,------------------------------------------------. + * | ! | " | # | $ | % | & | [ | | ] | ' | ( | ) | ~ | = | ~ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | | | | | | ( | | ) | | | | | + | * | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | | | | | | { | | } | | | < | > | ? | \ | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc |ESC/ |Space/|Tab/ | |Back |Enter/| Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | |~SYMB |RCtrl |Shift | |Space |~META | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [SYMB] = LAYOUT( \ + S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), _______, _______, S(KC_7), S(KC_8), S(KC_9), S(KC_0), S(KC_MINS), S(KC_EQL), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, S(KC_SCLN), S(KC_QUOT), \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, S(KC_COMM), S(KC_DOT), S(KC_SLSH), S(KC_RO), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* GAME + * ,------------------------------------------------. ,------------------------------------------------. + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | @ | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Alt | A | S | D | F | G | ( | | ) | H | J | K | L | ; | : | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Sft | Z | X | C | V | B | { | | } | N | M | , | . | / |\/Sft | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | GUI | App |PrtSc | ESC |Space |Tab | |Back |Enter | Del |PrtSc |=>GAME|=>SYMB| \ | + * | | | | | | | | |Space | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [GAME] = LAYOUT( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_RBRC, KC_BSLS, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, \ + KC_LALT, KC_A, KC_S, KC_D, KC_F, KC_G, S(KC_8), S(KC_9), KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, S(KC_RBRC), S(KC_BSLS), KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_RO), \ + KC_LCTRL, KC_LGUI, KC_APP, KC_PSCR, KC_ESC, KC_SPC, KC_TAB, KC_BSPC, KC_ENT, KC_DELT, KC_PSCR, _______, _______, KC_JYEN \ + ) + +}; + -- cgit v1.2.3 From 118e948e355b784b22f94378b5f85285e6dd4634 Mon Sep 17 00:00:00 2001 From: johanntang Date: Tue, 25 Sep 2018 15:23:31 -0700 Subject: Keyboard: added mehkee96 support -JT (#3957) * added mehkee96 support -JT * making requested changes -JT * fixes -jt * fixed info.json -JT * tidy up info.json comments from noroadsleft -JT --- keyboards/mehkee96/config.h | 18 ++ keyboards/mehkee96/i2c.c | 106 ++++++++ keyboards/mehkee96/i2c.h | 27 ++ keyboards/mehkee96/info.json | 12 + keyboards/mehkee96/keymaps/default/keymap.c | 80 ++++++ keyboards/mehkee96/keymaps/johann/keymap.c | 80 ++++++ keyboards/mehkee96/matrix.c | 130 +++++++++ keyboards/mehkee96/mehkee96.c | 81 ++++++ keyboards/mehkee96/mehkee96.h | 24 ++ keyboards/mehkee96/program | 105 ++++++++ keyboards/mehkee96/readme.md | 16 ++ keyboards/mehkee96/rules.mk | 35 +++ keyboards/mehkee96/usbconfig.h | 396 ++++++++++++++++++++++++++++ keyboards/melody96/keymaps/default/keymap.c | 6 - 14 files changed, 1110 insertions(+), 6 deletions(-) create mode 100644 keyboards/mehkee96/config.h create mode 100644 keyboards/mehkee96/i2c.c create mode 100644 keyboards/mehkee96/i2c.h create mode 100644 keyboards/mehkee96/info.json create mode 100644 keyboards/mehkee96/keymaps/default/keymap.c create mode 100644 keyboards/mehkee96/keymaps/johann/keymap.c create mode 100644 keyboards/mehkee96/matrix.c create mode 100644 keyboards/mehkee96/mehkee96.c create mode 100644 keyboards/mehkee96/mehkee96.h create mode 100644 keyboards/mehkee96/program create mode 100644 keyboards/mehkee96/readme.md create mode 100644 keyboards/mehkee96/rules.mk create mode 100644 keyboards/mehkee96/usbconfig.h diff --git a/keyboards/mehkee96/config.h b/keyboards/mehkee96/config.h new file mode 100644 index 0000000000..70ca273c36 --- /dev/null +++ b/keyboards/mehkee96/config.h @@ -0,0 +1,18 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D +#define MANUFACTURER mehkee +#define PRODUCT 96kee + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define RGBLED_NUM 16 +#define RGBLIGHT_ANIMATIONS +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/mehkee96/i2c.c b/keyboards/mehkee96/i2c.c new file mode 100644 index 0000000000..a4f9521352 --- /dev/null +++ b/keyboards/mehkee96/i2c.c @@ -0,0 +1,106 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +// Please do not modify this file + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +// Please do not modify this file + +#ifndef __I2C_H__ +#define __I2C_H__ + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + +#endif diff --git a/keyboards/mehkee96/info.json b/keyboards/mehkee96/info.json new file mode 100644 index 0000000000..75da3e591d --- /dev/null +++ b/keyboards/mehkee96/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "mehkee96", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"Print Screen", "x":13, "y":0}, {"label":"Delete", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"End", "x":16, "y":0}, {"label":"Page Up", "x":17, "y":0}, {"label":"Page Down", "x":18, "y":0}, {"label":"`", "x":0, "y":1}, {"label":"1", "x":1, "y":1}, {"label":"2", "x":2, "y":1}, {"label":"3", "x":3, "y":1}, {"label":"4", "x":4, "y":1}, {"label":"5", "x":5, "y":1}, {"label":"6", "x":6, "y":1}, {"label":"7", "x":7, "y":1}, {"label":"8", "x":8, "y":1}, {"label":"9", "x":9, "y":1}, {"label":"0", "x":10, "y":1}, {"label":"-", "x":11, "y":1}, {"label":"=", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Num Lock", "x":15, "y":1}, {"label":"P/", "x":16, "y":1}, {"label":"P*", "x":17, "y":1}, {"label":"P-", "x":18, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"[", "x":11.5, "y":2}, {"label":"]", "x":12.5, "y":2}, {"label":"\\", "x":13.5, "y":2, "w":1.5}, {"label":"P7", "x":15, "y":2}, {"label":"P8", "x":16, "y":2}, {"label":"P9", "x":17, "y":2}, {"label":"P+", "x":18, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":";", "x":10.75, "y":3}, {"label":"'", "x":11.75, "y":3}, {"label":"Enter", "x":12.75, "y":3, "w":2.25}, {"label":"P4", "x":15, "y":3}, {"label":"P5", "x":16, "y":3}, {"label":"P6", "x":17, "y":3}, {"label":"P+", "x":18, "y":3}, {"label":"Shift", "x":0, "y":4, "w":2.25}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":",", "x":9.25, "y":4}, {"label":".", "x":10.25, "y":4}, {"label":"/", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"Up", "x":14, "y":4}, {"label":"P1", "x":15, "y":4}, {"label":"P2", "x":16, "y":4}, {"label":"P3", "x":17, "y":4}, {"label":"PEnter", "x":18, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Win", "x":11, "y":5}, {"label":"Fn", "x":12, "y":5}, {"label":"Left", "x":13, "y":5}, {"label":"Down", "x":14, "y":5}, {"label":"Right", "x":15, "y":5}, {"label":"P0", "x":16, "y":5}, {"label":"P.", "x":17, "y":5}, {"label":"PEnter", "x":18, "y":5}] + } + } +} diff --git a/keyboards/mehkee96/keymaps/default/keymap.c b/keyboards/mehkee96/keymaps/default/keymap.c new file mode 100644 index 0000000000..cd69fb2fe9 --- /dev/null +++ b/keyboards/mehkee96/keymaps/default/keymap.c @@ -0,0 +1,80 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0, default layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | DEL | HOME | END | P Up | P Down | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | \ | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | + | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________| +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | + | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | ENTER | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________| +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | RGUI | _FN | LEFT | DOWN | RIGHT | 0 | . | ENTER | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| +*/ + + + + 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_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + 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_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_P7, KC_P8, KC_P9, KC_PPLS, + 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + + + /* Layer 1, function layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | | | | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | | RGB | HUE | HUE | SATUR. | SATUR. | VALUE | VALUE | | | | | | | | | +| | TOGGLE | | MODE |INCREASE| DCRSE |INCREASE| DCRSE |INCREASE| DCRSE | | | | | | | | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________| +| BACKLIGHT | | | | | | | | | | | | | | | | | +| TOGGLE | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | |BACKLHT |BACKLHT |BACKLHT | | | | | | | | | | | | +| | | | | DCRSE |TOGGLE |INCREASE| | | | | | | | | | | | +|_________|________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________| +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| +BL_TOGG, BL_DEC, BL_INC changes the in-switch LEDs +*/ + + + LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/mehkee96/keymaps/johann/keymap.c b/keyboards/mehkee96/keymaps/johann/keymap.c new file mode 100644 index 0000000000..a0212702ab --- /dev/null +++ b/keyboards/mehkee96/keymaps/johann/keymap.c @@ -0,0 +1,80 @@ +#include "mehkee96.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Layer 0, default layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC* | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | DEL | INSERT | P Up | P Down | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | | BACK | NUM | | | Play | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | \ | SPACE | LOCK | / | * | Pause | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | Next | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________| +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | - | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | + | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________| +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | RGUI | _FN | LEFT | DOWN | RIGHT | 0 | . | ENTER | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| +*/ + + + + 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_HOME, KC_DEL, KC_INS, KC_PGUP, KC_PGDN, + 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_NLCK, KC_PSLS, KC_PAST, KC_MPLY, + 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_P7, KC_P8, KC_P9, KC_MNXT, + 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_PMNS, + KC_LSFT, 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_P1, KC_P2, KC_P3, KC_PPLS, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT), + + + + /* Layer 1, function layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | | | | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | | RGB | HUE | HUE | SATUR. | SATUR. | VALUE | VALUE | | | | | | | | | +| | TOGGLE | | MODE |INCREASE| DCRSE |INCREASE| DCRSE |INCREASE| DCRSE | | | | | | | | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________|________| +| BACKLIGHT | | | | | | | | | | | | | | | | | +| TOGGLE | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | |BACKLHT |BACKLHT |BACKLHT | | | | | | | | | | | | +| | | | | DCRSE |TOGGLE |INCREASE| | | | | | | | | | | | +|_________|________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________|________| +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| +BL_TOGG, BL_DEC, BL_INC changes the in-switch LEDs +*/ + + + LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, _______, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, + BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______ , _______, _______, BL_DEC, BL_TOGG, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/keyboards/mehkee96/matrix.c b/keyboards/mehkee96/matrix.c new file mode 100644 index 0000000000..bbb84e52e4 --- /dev/null +++ b/keyboards/mehkee96/matrix.c @@ -0,0 +1,130 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_set_row_status(uint8_t row); +uint8_t bit_reverse(uint8_t x); + +__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) { +} + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1< 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + 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; +} + +// declarations +void matrix_set_row_status(uint8_t row) { + DDRB = (1 << row); + PORTB = ~(1 << row); +} + +uint8_t bit_reverse(uint8_t x) { + x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/mehkee96/mehkee96.c b/keyboards/mehkee96/mehkee96.c new file mode 100644 index 0000000000..604fad8032 --- /dev/null +++ b/keyboards/mehkee96/mehkee96.c @@ -0,0 +1,81 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include "mehkee96.h" +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i, Sebastian Kaim +# +# 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 . + +from __future__ import print_function + +import os +import sys +import time +import usb + + +def checkForKeyboardInNormalMode(): + """Returns a device if a ps2avrGB device in normal made (that is in keyboard mode) or None if it is not found.""" + return usb.core.find(idVendor=0x20A0, idProduct=0x422D) + +def checkForKeyboardInBootloaderMode(): + """Returns True if a ps2avrGB device in bootloader (flashable) mode is found and False otherwise.""" + return (usb.core.find(idVendor=0x16c0, idProduct=0x05df) is not None) + +def flashKeyboard(firmware_file): + """Calls bootloadHID to flash the given file to the device.""" + print('Flashing firmware to device ...') + if os.system('bootloadHID -r "%s"' % firmware_file) == 0: + print('\nDone!') + else: + print('\nbootloadHID returned an error.') + +def printDeviceInfo(dev): + """Prints all infos for a given USB device""" + print('Device Information:') + print(' idVendor: %d (0x%04x)' % (dev.idVendor, dev.idVendor)) + print(' idProduct: %d (0x%04x)' % (dev.idProduct, dev.idProduct)) + print('Manufacturer: %s' % (dev.iManufacturer)) + print('Serial: %s' % (dev.iSerialNumber)) + print('Product: %s' % (dev.iProduct), end='\n\n') + +def sendDeviceToBootloaderMode(dev): + """Tries to send a given ps2avrGB keyboard to bootloader mode to allow flashing.""" + try: + dev.set_configuration() + + request_type = usb.util.build_request_type( + usb.util.CTRL_OUT, + usb.util.CTRL_TYPE_CLASS, + usb.util.CTRL_RECIPIENT_DEVICE) + + USBRQ_HID_SET_REPORT = 0x09 + HID_REPORT_OPTION = 0x0301 + + dev.ctrl_transfer(request_type, USBRQ_HID_SET_REPORT, HID_REPORT_OPTION, 0, [0, 0, 0xFF] + [0] * 5) + except usb.core.USBError: + # for some reason I keep getting USBError, but it works! + pass + + +if len(sys.argv) < 2: + print('Usage: %s ' % sys.argv[0]) + sys.exit(1) + +kb = checkForKeyboardInNormalMode() + +if kb is not None: + print('Found a keyboard in normal mode. Attempting to send it to bootloader mode ...', end='') + sendDeviceToBootloaderMode(kb) + print(' done.') + print("Hint: If your keyboard can't be set to bootloader mode automatically, plug it in while pressing the bootloader key to do so manually.") + print(" You can find more infos about this here: https://github.com/qmk/qmk_firmware/tree/master/keyboards/ps2avrGB#setting-the-board-to-bootloader-mode") + +attempts = 12 # 60 seconds +found = False +for attempt in range(1, attempts + 1): + print("Searching for keyboard in bootloader mode (%i/%i) ... " % (attempt, attempts), end='') + + if checkForKeyboardInBootloaderMode(): + print('Found', end='\n\n') + flashKeyboard(sys.argv[1]) + found = True + break + else: + print('Nothing.', end='') + + if attempt != attempts: # no need to wait on the last attempt + print(' Sleeping 5 seconds.', end='') + time.sleep(5) + + # print a newline + print() + +if not found: + print("Couldn't find a flashable keyboard. Aborting.") + sys.exit(2) + diff --git a/keyboards/mehkee96/readme.md b/keyboards/mehkee96/readme.md new file mode 100644 index 0000000000..9dfad2a79e --- /dev/null +++ b/keyboards/mehkee96/readme.md @@ -0,0 +1,16 @@ +# Mehkee 96KEE + +![mehkee96](https://cdn.shopify.com/s/files/1/1799/1839/products/96KEE_-_1_-_Copy_1024x1024.jpg?v=1516262148) + +96-key Keyboard from mehkee + +Keyboard Maintainer: [johanntang](https://github.com/johanntang) +Hardware Supported: mehkee96 +Hardware Availability: [mehkee, group buy closed](https://mehkee.com/products/96kee?variant=46912017423) + +Make example for this keyboard (after setting up your build environment): + + make mehkee96: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/mehkee96/rules.mk b/keyboards/mehkee96/rules.mk new file mode 100644 index 0000000000..e6e7d4a588 --- /dev/null +++ b/keyboards/mehkee96/rules.mk @@ -0,0 +1,35 @@ +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# Processor frequency. +F_CPU = 12000000 + +# Bootloader +BOOTLOADER = bootloadHID + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # 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 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c + +# programming options +PROGRAM_CMD = ./keyboards/mehkee96/program $(TARGET).hex diff --git a/keyboards/mehkee96/usbconfig.h b/keyboards/mehkee96/usbconfig.h new file mode 100644 index 0000000000..d2d848fcdc --- /dev/null +++ b/keyboards/mehkee96/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/keyboards/melody96/keymaps/default/keymap.c b/keyboards/melody96/keymaps/default/keymap.c index 9142a04708..16f4561b58 100644 --- a/keyboards/melody96/keymaps/default/keymap.c +++ b/keyboards/melody96/keymaps/default/keymap.c @@ -73,12 +73,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { return MACRO_NONE; } -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -- cgit v1.2.3 From 61f95410666319ac5ef0cb3d533b820f45ae237c Mon Sep 17 00:00:00 2001 From: Alexander Kagno Date: Tue, 25 Sep 2018 16:38:04 -0600 Subject: Keymap: Velocikey implemented at userspace, readme is more helpful (#3974) * deleting arkag branch, forcibly moving changes over to master * fade_color function added, not tested * added half functions some stuff * surround_type function implemented and working. * added flashing function and removed fading, flashing supports infinite flashing along with controlled number flashes * added a fade state machine and functionality * build optimizations, changed fade to bounce between bounds rather than roll over, added a HALMAK layout * changes to sleep breath function, changed how I will switch to HALMAK * support for halmak added * support for activity detection added, condensed fading and flashing state machines, removed support for HALMAK and COLEMAK because arkag is stupid * changed sleep and inactive behaviors, now the color shifting reverses on state change, yay! save_color and reset_color are made to enable layer color changing to look cooler. * reformatted some if statements in state detection * changes to force fade to pause on boot, or plug in. * Attempting to move over to userspace, pushing to repository for help * userspace stuff.... * userspace stuff.... * layout changes, working userspace, Removed left side shift and replaced it with a MT() for LSFT and SPC. Userspace seems to be working properly now! HURRAY * Layout change Removed space/shift and reset modifiers to what they were originally. Added homerow modifiers. * Removed excessive tabs in files * Moved mods on homerow around... * changes recommended by @drashna * removed homerow mods, more flashy lighting! * changed delays for lighting. * velocikey code retro fit into userspace to match typing speed currently "working" but isn't as reactive as I want. * Readme and other documentation hidden throughout code * Added a pretty picture * pretty picture actually added * More readme updates * Velocikey now working inside my userspace! * Changed repo macro and fixed readme * Removed media layer, moved media control to LAZY layer * fixed more merge issues when I had to merge... --- keyboards/mechmini/v2/keymaps/arkag/keymap.c | 25 ++- users/arkag/arkag.c | 238 ++++++++++++++------------- users/arkag/arkag.h | 27 +-- users/arkag/mechmini2.jpg | Bin 0 -> 3548191 bytes users/arkag/readme.md | 28 ++++ 5 files changed, 171 insertions(+), 147 deletions(-) create mode 100644 users/arkag/mechmini2.jpg diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechmini/v2/keymaps/arkag/keymap.c index 10502a5b61..7038f220c4 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/keymap.c +++ b/keyboards/mechmini/v2/keymaps/arkag/keymap.c @@ -1,16 +1,21 @@ #include QMK_KEYBOARD_H #include "arkag.h" +/* + Userspace: + https://github.com/arkag/qmk_firmware/blob/master/users/arkag/arkag.c +*/ + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_2u_space_ortho( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_TAB, TAP_A, TAP_S, TAP_D, TAP_F, KC_G, KC_H, TAP_J, TAP_K, TAP_L, TAP_SCN, QUOTE, - XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, LAZY, KC_LEFT, KC_DOWN, KC_RGHT), [_RAISE] = LAYOUT_2u_space_ortho( GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, OBRACK, CBRACK, TAP_EQ, HYPHEN, _______, _______, KC_4, TAP_5, KC_6, _______, KC_NLCK, + _______, OBRACK, CBRACK, KC_EQL, HYPHEN, _______, _______, KC_4, KC_5, KC_6, _______, KC_NLCK, _______, _______, _______, CEDILLA, _______, KC_COMM, KC_PDOT, KC_1, KC_2, KC_3, KC_PPLS, KC_PENT, _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), @@ -18,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, M_ULIN, M_ITAL, _______, M_P_B, M_C_A_D, _______, _______, STRIKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_DEL, _______, _______, _______, M_BOLD, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, MEDIA, KC_BSLS, M_CALC, KC_HOME, KC_PGDN, KC_END), + _______, _______, _______, _______, _______, _______, KC_BSLS, M_CALC, KC_HOME, KC_PGDN, KC_END), [_KEEB] = LAYOUT_2u_space_ortho( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -26,15 +31,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_M_P, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), - [_MEDIA] = LAYOUT_2u_space_ortho( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), - [_LAZY] = LAYOUT_2u_space_ortho( - _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, _______, + _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, - _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), }; diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c index c716b5e93f..a35e13ed6b 100644 --- a/users/arkag/arkag.c +++ b/users/arkag/arkag.c @@ -1,5 +1,10 @@ #include "arkag.h" +/* + Current Layout and Keeb: + https://github.com/arkag/qmk_firmware/blob/master/keyboards/mechmini/v2/keymaps/arkag/keymap.c +*/ + // Start: Written by konstantin: vomindoraan #include #include @@ -8,38 +13,68 @@ void send_unicode_hex_string(const char *str) { if (!str) { return; } // Saftey net while (*str) { - // Find the next code point (token) in the string - for (; *str == ' '; str++); - size_t n = strcspn(str, " "); // Length of the current token - char code_point[n+1]; - strncpy(code_point, str, n); - code_point[n] = '\0'; // Make sure it's null-terminated - - // Normalize the code point: make all hex digits lowercase - for (char *p = code_point; *p; p++) { - *p = tolower(*p); - } - - // Send the code point as a Unicode input string - unicode_input_start(); - send_string(code_point); - unicode_input_finish(); - str += n; // Move to the first ' ' (or '\0') after the current token + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower(*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + str += n; // Move to the first ' ' (or '\0') after the current token } } // End: Written by konstantin: vomindoraan -uint8_t current_os, mod_primary_mask, fade_delay; -uint16_t flash_timer_one, flash_timer_two, - fade_timer_one, fade_timer_two, - active_timer_one, active_timer_two, - elapsed = 0, +// Start: Written by Chris Lewis +#ifndef MIN +#define MIN(a,b) (((a)<(b))?(a):(b)) +#endif +#ifndef MAX +#define MAX(a,b) (((a)>(b))?(a):(b)) +#endif + +#define TYPING_SPEED_MAX_VALUE 200 +uint8_t typing_speed = 0; + +void velocikey_accelerate() { + if (typing_speed < TYPING_SPEED_MAX_VALUE) typing_speed += (TYPING_SPEED_MAX_VALUE / 50); +} + +void velocikey_decelerate() { + static uint16_t decay_timer = 0; + + if (timer_elapsed(decay_timer) > 500 || decay_timer == 0) { + if (typing_speed > 0) typing_speed -= 1; + //Decay a little faster at half of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 2) typing_speed -= 1; + //Decay even faster at 3/4 of max speed + if (typing_speed > TYPING_SPEED_MAX_VALUE / 4 * 3) typing_speed -= 3; + decay_timer = timer_read(); + } +} + +uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue) { + return MAX(minValue, maxValue - (maxValue - minValue) * ((float)typing_speed / TYPING_SPEED_MAX_VALUE)); +} +// End: Written by Chris Lewis + +uint8_t current_os, + mod_primary_mask, + fade_interval, num_extra_flashes_off = 0; Color underglow, flash_color, saved_color, - hsv_none = {0,0,0}, - hsv_white = {0,0,127}; + hsv_none = {0,0,0}; flashState flash_state = no_flash; fadeState fade_state = add_fade; activityState state = boot; @@ -79,134 +114,103 @@ Color mod_color(Color current_color, bool should_add, uint8_t change_amount) { return current_color; } -void reverse_fade (void) { - if (fade_state == add_fade){ - fade_state = sub_fade; - } else { - fade_state = add_fade; - } -} - void check_state (void) { - static bool activated, deactivated, slept; - switch (state) { - case active: - if (!activated) { - fade_delay = LED_FADE_DELAY; - reverse_fade(); - activated = true; - deactivated = false; - } - active_timer_two = timer_read(); - elapsed = active_timer_two - active_timer_one; - if (elapsed < INACTIVE_DELAY) {return;} - state = inactive; - return; - - case inactive: - if (!deactivated) { - fade_delay = LED_FADE_DELAY * 2; - reverse_fade(); - deactivated = true; - slept = false; - activated = false; - } - active_timer_two = timer_read(); - elapsed = active_timer_two - active_timer_one; - if (elapsed < SLEEP_DELAY) {return;} - state = sleeping; - return; - - case sleeping: - if (!slept) { - fade_delay = LED_FADE_DELAY * 6; - reverse_fade(); - slept = true; - deactivated = false; - activated = false; - } - return; - - case boot: - return; - } + static uint16_t active_timer; + if (!active_timer) {active_timer = timer_read();} + static bool activated, deactivated, slept; + switch (state) { + case active: + if (!activated) { + if (slept) {rgblight_mode_noeeprom(1);} + activated = true; + deactivated = false; + slept = false; + } + fade_interval = velocikey_match_speed(1, 25); + if (timer_elapsed(active_timer) < INACTIVE_DELAY) {return;} + active_timer = timer_read(); + state = inactive; + return; + + case inactive: + if (!deactivated) { + deactivated = true; + activated = false; + slept = false; + } + velocikey_decelerate(); + fade_interval = velocikey_match_speed(1, 25); + if (timer_elapsed(active_timer) < SLEEP_DELAY) {return;} + state = sleeping; + return; + + case sleeping: + if (!slept) { + rgblight_mode_noeeprom(4); + slept = true; + activated = false; + deactivated = false; + } + return; + + case boot: + return; + } } void fade_rgb (void) { - static bool ran_once; - if (flash_state != no_flash) {return;} + static uint16_t fade_timer; if (state == boot) {return;} + if (!fade_timer) {fade_timer = timer_read();} + if (timer_elapsed(fade_timer) < fade_interval) {return;} switch (fade_state) { case add_fade: - if (!ran_once) { - fade_timer_one = timer_read(); - ran_once = true; - } - fade_timer_two = timer_read(); - elapsed = fade_timer_two - fade_timer_one; - if (elapsed < fade_delay) {return;} if (underglow.h == 359) { fade_state = sub_fade; return; } underglow.h = underglow.h + 1; - set_color(underglow, false); - // set_color_at(underglow, 0); - fade_timer_one = fade_timer_two; - return; + break; case sub_fade: - fade_timer_two = timer_read(); - elapsed = fade_timer_two - fade_timer_one; - if (elapsed < fade_delay) {return;} if (underglow.h == 0) { fade_state = add_fade; return; } underglow.h = underglow.h - 1; + break; + } + fade_timer = timer_read(); + if (flash_state == no_flash) { set_color(underglow, false); - // set_color_at(underglow, 0); - fade_timer_one = fade_timer_two; - return; } } void flash_rgb (void) { - static bool ran_once; + static uint16_t flash_timer; switch(flash_state) { case no_flash: return; case flash_off: - if (!ran_once) { - set_color(hsv_none, false); - flash_timer_one = timer_read(); - ran_once = true; - flash_state = flash_on; - return; - } - flash_timer_two = timer_read(); - elapsed = flash_timer_two - flash_timer_one; - if (elapsed >= LED_FLASH_DELAY) { + if (!flash_timer) {flash_timer = timer_read();} + if (timer_elapsed(flash_timer) >= LED_FLASH_DELAY) { set_color(hsv_none, false); - flash_timer_one = timer_read(); + flash_timer = timer_read(); flash_state = flash_on; } return; case flash_on: - flash_timer_two = timer_read(); - elapsed = flash_timer_two - flash_timer_one; - if (elapsed >= LED_FLASH_DELAY) { + if (timer_elapsed(flash_timer) >= LED_FLASH_DELAY) { set_color(flash_color, false); - flash_timer_one = timer_read(); + flash_timer = timer_read(); if (num_extra_flashes_off > 0) { flash_state = flash_off; num_extra_flashes_off--; } else { set_color(underglow, false); flash_state = no_flash; - ran_once = false; } } return; @@ -239,8 +243,9 @@ void set_os (uint8_t os, bool update) { mod_primary_mask = MOD_CTL_MASK; } set_color(underglow, update); - flash_color = underglow; - flash_state = flash_off; + flash_color = underglow; + flash_state = flash_off; + state = boot; num_extra_flashes_off = 1; } @@ -462,7 +467,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case M_REPO: if (record->event.pressed) { - SEND_STRING("https://github.com/arkag/qmk_firmware/tree/master/keyboards/mechmini/v2/keymaps/arkag"); + SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag"); } return false; @@ -505,10 +510,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_LSFT: if (record->event.pressed) { - set_color(mod_color(underglow, true, 50), false); + save_color(underglow); + underglow = mod_color(underglow, true, 75); SEND_STRING(SS_DOWN(X_LSHIFT)); } else { - set_color(underglow, false); + reset_color(); SEND_STRING(SS_UP(X_LSHIFT)); } return false; @@ -522,8 +528,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { default: if (record->event.pressed) { - active_timer_one = timer_read(); state = active; + velocikey_accelerate(); } return true; } diff --git a/users/arkag/arkag.h b/users/arkag/arkag.h index 9c81e4487c..a4672a8e82 100644 --- a/users/arkag/arkag.h +++ b/users/arkag/arkag.h @@ -25,26 +25,13 @@ #define MOD_GUI_MASK (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) #define MOD_SFT_MASK (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) -#define TAP_A LALT_T(KC_A) -#define TAP_SCN RALT_T(KC_SCOLON) - -#define TAP_S LCTL_T(KC_S) -#define TAP_L RCTL_T(KC_L) - -#define TAP_D LSFT_T(KC_D) -#define TAP_K RSFT_T(KC_K) - -#define TAP_F LGUI_T(KC_F) -#define TAP_J RGUI_T(KC_J) - -#define TAP_EQ LSFT_T(KC_EQUAL) -#define TAP_5 RSFT_T(KC_5) - #define LED_FLASH_DELAY 150 -#define LED_FADE_DELAY 10 -#define INACTIVE_DELAY 200 -#define SLEEP_DELAY 60000 +#define ACCEL_DELAY 500 +#define DEACCEL_DELAY 500 + +#define INACTIVE_DELAY 250 +#define SLEEP_DELAY 180000 enum { _QWERTY = 0, @@ -124,6 +111,10 @@ enum tapdances { void send_unicode_hex_string(const char *str); +void velocikey_accelerate(void); +void velocikey_decelerate(void); +uint8_t velocikey_match_speed(uint8_t minValue, uint8_t maxValue); + void set_color (Color new, bool update); void save_color(Color to_save); void reset_color(void); diff --git a/users/arkag/mechmini2.jpg b/users/arkag/mechmini2.jpg new file mode 100644 index 0000000000..611a0859c0 Binary files /dev/null and b/users/arkag/mechmini2.jpg differ diff --git a/users/arkag/readme.md b/users/arkag/readme.md index 76a5c4525b..c685892f86 100644 --- a/users/arkag/readme.md +++ b/users/arkag/readme.md @@ -1,3 +1,26 @@ +# Shot on Pixel 2 XL with Cheap Lamp at Work + +![mmm, tasty](mechmini2.jpg) + +# I don't know what I'm doing + +Some links: +* [Layout File: Mech Mini 2](layout_mm2) +* [Userspace Header](arkag_h) +* [Userspace Main](arkag_c) + +Here's a list of some things I have working with my currently [keyboard](mm2_home): + +* Reactive (sort of) fading while typing, ported from [Velocikey](https://github.com/qmk/qmk_firmware/pull/3754). +* OS Switching, storing to EEPROM +* OS Specific Macros and Shortcuts(WIN+SHIFT+S for Windows and CMD+SHIFT+4 for MacOS) +* Flashing RGB LED on OS change +* Hex Unicode Macros dependent on OS(half works on Windows due to [WinCompose](https://github.com/SamHocevar/wincompose) not functioning properly just yet). +* "Sleep" function activates after 3 minutes (breathing). +* Markdown style macros for surround type __eve__ ~~ryw~~ *her* **eee** (apparently only certain places support underline and strikethrough ಠ__ಠ) + +# License Stuff + Copyright 2018 arkag arkag@pm.me This program is free software: you can redistribute it and/or modify @@ -12,3 +35,8 @@ 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 . + +[arkag_c]: /users/arkag/arkag.c +[arkag_h]: /users/arkag/arkag.h +[layout_mm2]: /keyboards/mechmini/v2/keymaps/arkag/keymap.c +[mm2_home]: https://cartel.ltd/projects/mechmini2/ -- cgit v1.2.3 From 223081bf2b201a53fb0383d6be0cacb8cde39140 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Tue, 25 Sep 2018 15:39:41 -0700 Subject: Keymap: 4x4 pro micro (#3976) * 4x4 - pro micro version * pro-micro setup on 4x4 * tap dance LCTL/RESET key * remove test file * more research * revert a couple un-intended edits * opt_defs version of adding custom rules.mk variables * cleanup * cleanup * cleanup * cleanup * layout edits * layout edits * keymap edit * numpad layout change * got tap dance layer-switch working * keymap changes * temporary revert * restore previous settings * misc fixes * layer order change * fix layout matrix * Update tapdances.c --- keyboards/4x4/4x4.h | 4 +- layouts/community/ortho_4x12/wanleg/config.h | 19 ++++++- layouts/community/ortho_4x12/wanleg/keymap.c | 17 ++++++ users/wanleg/rules.mk | 12 +++-- users/wanleg/tapdances.c | 77 ++++++++++++++++++++++++++-- users/wanleg/wanleg.c | 6 +++ users/wanleg/wanleg.h | 51 +++++++++++++----- 7 files changed, 158 insertions(+), 28 deletions(-) diff --git a/keyboards/4x4/4x4.h b/keyboards/4x4/4x4.h index db67ab34e9..ec75c3e280 100644 --- a/keyboards/4x4/4x4.h +++ b/keyboards/4x4/4x4.h @@ -43,7 +43,7 @@ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, ___, ___, ___, ___}, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, ___, ___, ___, ___}, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ } #define LAYOUT_ortho_4x16( \ @@ -56,7 +56,7 @@ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ } #endif diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 0d2cc591e3..2444b8b976 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -1,7 +1,7 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -//QMK DFU settings (ProMicro boards) +//QMK DFU settings (ProMicro boards with QMK bootloader) // set top left key as bootloader mode escape key on Lets Split rev2 #if defined(KEYBOARD_lets_split_rev2) #define QMK_LED B0 @@ -13,10 +13,25 @@ #endif // set top left key as bootloader mode escape key on 4x4 48key layout -#if defined(KEYBOARD_4x4) +#if defined(KEYBOARD_4x4) && !defined(PRO_MICRO) #define QMK_LED B0 #define QMK_ESC_OUTPUT C6 // usually COL #define QMK_ESC_INPUT B2 // usually ROW #endif +// use alternate settings for 4x4 board using ProMicro instead of Micro +// usage: make 4x4:wanleg PM=yes +#if defined(KEYBOARD_4x4) && defined(PRO_MICRO) +#define QMK_ESC_OUTPUT F4 // usually COL +#define QMK_ESC_INPUT D1 // usually ROW +#define QMK_LED B0 + +//need to undefine standard 4x4 array before defining alternate ProMicro array +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#define MATRIX_ROW_PINS { D1, D0, D4, C6 } +//last 4 elements of the column array are are not broken out on a ProMicro (included only to preserve array structure) +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, F0, B7, D6, F1 } +#endif + #endif diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index f6030469c0..6fe8446f6d 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -15,6 +15,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__2_______________, KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL ), + +#elif defined(KEYBOARD_4x4) +[_GK] = LAYOUT_ortho_4x12_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + TD(RST_TAP_DANCE), KC_LGUI, KC_LALT, NUMPAD, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL +), + +[PAD] = LAYOUT_ortho_4x4_wrapper( + _______________NUMPAD_Row__0_______________, + _______________NUMPAD_Row__1_______________, + _______________NUMPAD_Row__2_______________, + _______________NUMPAD_Row__3_______________ +), + #else [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, @@ -64,4 +80,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______________ETCETERA_Row__2______________, ______________ETCETERA_Row__3______________ ), + }; diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index ac86769538..5630401315 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -1,8 +1,4 @@ -ifeq ($(strip $(KEYBOARD)), lets_split_rev2) -SRC += ../../keyboards/lets_split/lets_split.c -endif - -SRC += wanleg.c tapdances.c +SRC += wanleg.c tapdances.c TAP_DANCE_ENABLE = yes MOUSEKEY_ENABLE = yes @@ -12,3 +8,9 @@ MOUSEKEY_ENABLE = yes ifeq ($(strip $(dfu)), qmk) BOOTLOADER = qmk-dfu endif + +#use alternate settings for 4x4 board using ProMicro instead of Micro +#usage: make 4x4:wanleg PM=yes +ifeq ($(strip $(PM)), yes) + OPT_DEFS += -DPRO_MICRO +endif diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 6a98b896a5..0778bf5f7e 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -36,7 +36,7 @@ int cur_dance (qk_tap_dance_state_t *state) { } ///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// ///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// -//instantialize an instance of 'tap' for the 'ENT' tap dance. +//instantiate 'tap' for the 'ENT' tap dance. static tap ENTtap_state = { .is_press_action = true, .state = 0 @@ -67,7 +67,7 @@ void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { ENTtap_state.state = 0; } -//instanalize an instance of 'tap' for the 'DEL' tap dance. +//instantiate 'tap' for the 'DEL' tap dance. static tap DELtap_state = { .is_press_action = true, .state = 0 @@ -95,7 +95,7 @@ void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { DELtap_state.state = 0; } -//instantialize an instance of 'tap' for the 'CAD' tap dance. +//instantiate 'tap' for the 'CAD' tap dance. static tap CADtap_state = { .is_press_action = true, .state = 0 @@ -107,7 +107,9 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { case SINGLE_TAP: //register_code(KC_SPC); SEND_STRING(SS_LGUI("l")); + #ifdef BACKLIGHT_ENABLE backlight_set(3); + #endif break; case SINGLE_HOLD: //register_code(KC_NO); @@ -121,7 +123,9 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { case DOUBLE_TAP: //register_code(KC_ENT); SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); + #ifdef BACKLIGHT_ENABLE backlight_set(0); + #endif break; //case DOUBLE_HOLD: register_code(KC_NO); break; //register this keycode when button is tapped and then held case DOUBLE_HOLD: @@ -136,7 +140,9 @@ void CAD_reset (qk_tap_dance_state_t *state, void *user_data) { case SINGLE_TAP: //unregister_code(KC_SPC); SEND_STRING(SS_LGUI("l")); + #ifdef BACKLIGHT_ENABLE backlight_set(3); + #endif break; case SINGLE_HOLD: register_code(KC_NO); //(un)register this keycode when button is held and then released @@ -145,13 +151,71 @@ void CAD_reset (qk_tap_dance_state_t *state, void *user_data) { case DOUBLE_TAP: //register_code(KC_ENT); SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); + #ifdef BACKLIGHT_ENABLE backlight_set(0); + #endif break; case DOUBLE_HOLD: register_code(KC_NO); //(un)register this keycode when button is tapped and then held, and then released case DOUBLE_SINGLE_TAP: unregister_code(KC_NO); } CADtap_state.state = 0; -} +} + +//instantiate 'tap' for the 'RST' tap dance. +static tap RSTtap_state = { + .is_press_action = true, + .state = 0 +}; + +void RST_finished (qk_tap_dance_state_t *state, void *user_data) { + RSTtap_state.state = cur_dance(state); + switch (RSTtap_state.state) { + case SINGLE_TAP: register_code(KC_LCTL); break; + case SINGLE_HOLD: register_code(KC_LCTL); break; + case DOUBLE_TAP: reset_keyboard(); break; + case DOUBLE_HOLD: register_code(KC_NO); break; + case DOUBLE_SINGLE_TAP: register_code(KC_LCTL); unregister_code(KC_LCTL); register_code(KC_LCTL); + } +} + +void RST_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (RSTtap_state.state) { + case SINGLE_TAP: unregister_code(KC_LCTL); break; + case SINGLE_HOLD: unregister_code(KC_LCTL); break; + case DOUBLE_TAP: unregister_code(KC_NO); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_LCTL); + } + RSTtap_state.state = 0; +} + +//instantiate 'tap' for the 'LYR' tap dance. +static tap LYRtap_state = { + .is_press_action = true, + .state = 0 +}; + +void LYR_finished (qk_tap_dance_state_t *state, void *user_data) { + LYRtap_state.state = cur_dance(state); + switch (LYRtap_state.state) { + case SINGLE_TAP: register_code(KC_PSLS); break; + case SINGLE_HOLD: register_code(KC_NO); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; + case DOUBLE_HOLD: register_code(KC_NO); break; + case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); + } +} + +void LYR_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (LYRtap_state.state) { + case SINGLE_TAP: unregister_code(KC_PSLS); break; + case SINGLE_HOLD: unregister_code(KC_NO); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; + case DOUBLE_HOLD: unregister_code(KC_NO); + case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); + } + LYRtap_state.state = 0; +} ///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// //Tap Dance Definitions @@ -162,8 +226,11 @@ qk_tap_dance_action_t tap_dance_actions[] = { ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) + ,[RST_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, RST_finished, RST_reset) ,[CAD_TD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, CAD_finished, CAD_reset) + ,[LYR_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, LYR_finished, LYR_reset) + }; //In Layer declaration, add tap dance item in place of a key code -//TD(TD_SFT_CAPS) \ No newline at end of file +//TD(TD_SFT_CAPS) diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 931546c153..f22c34ba30 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -41,6 +41,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case NUMPAD: + if (record->event.pressed) { + set_single_persistent_default_layer(PAD); + } + return false; + break; case SUBTER: if (record->event.pressed) { layer_on(SUB); diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 8b98ec7ddf..65028751a9 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -25,7 +25,8 @@ enum userspace_layers { NUM75, DIR75, ETC75, - FN75 + FN75, + PAD, }; #elif KEYBOARD_xd75 enum userspace_layers { @@ -49,29 +50,31 @@ enum userspace_layers { gNUM, gDIR, gETC, + PAD, }; #else enum userspace_layers { _GK = 0, + PAD, _QW, - QW75, - GK75, - gGK, ONE, SUB, SUP, NUM, DIR, ETC, + gGK, gNUM, gDIR, gETC, + QW75, + GK75, SUB75, SUP75, NUM75, DIR75, ETC75, - FN75 + FN75, }; #endif @@ -95,7 +98,8 @@ enum userspace_custom_keycodes { NUMBER75, DIRECTION75, ETCETERA75, - FUNCTION75 + FUNCTION75, + NUMPAD, }; @@ -107,6 +111,8 @@ enum { ,ENT_TAP_DANCE ,DEL_TAP_DANCE ,CAD_TD + ,RST_TAP_DANCE + ,LYR_TAP_DANCE }; #endif @@ -123,6 +129,7 @@ enum { #define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) +#define LAYOUT_ortho_4x4_wrapper(...) LAYOUT_ortho_4x4(__VA_ARGS__) // Blocks for each of the major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -141,7 +148,7 @@ enum { * | A | S | D | F | G | H | J | K | L | SPACE | * | | | | | | | | | |SFThold | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BKSC | + * | Z | X | C | V/gNUM | B/gETC | N | M/gDIR | ,/GUI | ./ALT | BSPC | * | SFThold| | | | | | | | |CTRLhold| * '-----------------------------------------------------------------------------------------' */ @@ -168,7 +175,7 @@ enum { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BKSC | + * | F11 | F12 | | | | ENTER | SHIFT | GUI | ./ALT | BSPC | * | | | | | | | | | |CTRLhold| * '-----------------------------------------------------------------------------------------' */ @@ -191,12 +198,12 @@ enum { /* Gherkin-Like * .-----------------------------------------------------------------------------------------------------------. - * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BACKSP | + * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BKSC | ENT/SFT| + * |SFT/CAPS| Z | X | C | V/NUM | B/ETC | N | M/DIR | ,/GUI | ./ALT | BSPC | ENT/SFT| * | |SFThold | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | LCTRL | LGUI | ALT | ONEHAND| NUM | ETC | SPACE | DIR | RGUI | ALT | DEL | CTRL | @@ -210,7 +217,7 @@ enum { /* Qwerty * .-------------------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * | Esc | Q | W | E | R | T | Y | U | I | O | P | BSPC | * |-------+------+------+------+------+-------------+------+------+------+------+-------| * | Tab | A | S | D | F | G | H | J | K | L | ; | ' | * |-------+------+------+------+------+------|------+------+------+------+------+-------| @@ -246,7 +253,7 @@ enum { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | | | RGUI | ./ALT | BKSC | | + * | | F11 | F12 | | | | | | RGUI | ./ALT | BSPC | | * | | | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | | gherkin| | | | ENTER | SHIFT | | | | | @@ -259,11 +266,11 @@ enum { /* Gherkin Numbers * .-----------------------------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BACKSP | + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BSPC | | * | | | | | | | | | | |CTRLhold| | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | | | | | | | ENTER | SHIFT | RGUI | | | | @@ -307,4 +314,20 @@ enum { #define ______________ETCETERA_Row__2______________ _______, _______________Gherkin_ETC_2_______________, _______ #define ______________ETCETERA_Row__3______________ _______, _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______, _______ +/* Single 4x4 board only + * .-----------------------------------. + * | 7 | 8 | 9 | BSPC | + * |--------+--------+--------+--------| + * | 4 | 5 | 6 | SPACE | + * |--------+--------+--------+--------| + * | 1 | 2 | 3 | ENTER | + * |--------+--------+--------+--------| + * | 0 |/ //_GK | . | - | + * '-----------------------------------' + */ + +#define _______________NUMPAD_Row__0_______________ KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC +#define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC +#define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT +#define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS #endif // !USERSPACE -- cgit v1.2.3 From 627ee050b491cc9d6ab57f90ac0f0779f6be47c9 Mon Sep 17 00:00:00 2001 From: holtenc Date: Tue, 25 Sep 2018 17:48:01 -0500 Subject: Keyboard: Remove BACKLIGHT BREATHING as default config for Prime Keyboards (#3979) * initial commit * Update readme.md * Update keymap.c added comment for description of function to control LED as layer indicator * corrected formatting as requested. * format for configurator * corrected info.json to propertly reflect layout in Configurator * updated layouts to reflect physical keyboard * comment out BACKLIGHT BREATHING in config.h --- keyboards/primekb/prime_l/config.h | 2 +- keyboards/primekb/prime_m/config.h | 2 +- keyboards/primekb/prime_o/config.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/primekb/prime_l/config.h b/keyboards/primekb/prime_l/config.h index 46dd3604e4..8e24578166 100644 --- a/keyboards/primekb/prime_l/config.h +++ b/keyboards/primekb/prime_l/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B6 -#define BACKLIGHT_BREATHING +/*#define BACKLIGHT_BREATHING*/ #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/keyboards/primekb/prime_m/config.h b/keyboards/primekb/prime_m/config.h index 82a8037c99..366504375e 100644 --- a/keyboards/primekb/prime_m/config.h +++ b/keyboards/primekb/prime_m/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 -#define BACKLIGHT_BREATHING +/*#define BACKLIGHT_BREATHING*/ #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ diff --git a/keyboards/primekb/prime_o/config.h b/keyboards/primekb/prime_o/config.h index 9f634474cf..eb897ef8fa 100644 --- a/keyboards/primekb/prime_o/config.h +++ b/keyboards/primekb/prime_o/config.h @@ -40,7 +40,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define BACKLIGHT_PIN B7 -#define BACKLIGHT_BREATHING +/*#define BACKLIGHT_BREATHING*/ #define BACKLIGHT_LEVELS 4 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -- cgit v1.2.3 From 4d5705ea6ceeb11cd2adc018644ec87c51af4e86 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Mon, 3 Sep 2018 08:26:53 +0100 Subject: Add new RGB matrix effect digital rain aka The Matrix --- quantum/rgb_matrix.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ quantum/rgb_matrix.h | 1 + 2 files changed, 67 insertions(+) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 197bc1ac5e..8ad00c37dd 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -510,6 +510,69 @@ void rgb_matrix_jellybean_raindrops( bool initialize ) { } } +void rgb_matrix_digital_rain( const bool initialize ) { + // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain + const uint8_t drop_ticks = 28; + const uint8_t new_drop_probability = 24; + const uint8_t pure_green_intensity = 0xd0; + const uint8_t max_brightness_boost = 0xc0; + const uint8_t max_intensity = 0xff; + + static uint8_t map[MATRIX_COLS][MATRIX_ROWS] = {{0}}; + static uint8_t drop = 0; + + if (initialize) { + rgb_matrix_set_color_all(0, 0, 0); + memset(map, 0, sizeof map); + drop = 0; + } + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + if (row == 0 && drop == 0 && rand() < RAND_MAX / new_drop_probability) { + // top row, pixels have just fallen and we're + // making a new rain drop in this column + map[col][row] = max_intensity; + } + else if (map[col][row] > 0 && map[col][row] < max_intensity) { + // neither fully bright nor dark, decay it + map[col][row]--; + } + // set the pixel colour + uint8_t led, led_count; + map_row_column_to_led(row, col, &led, &led_count); + + if (map[col][row] > pure_green_intensity) { + const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost + * (map[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); + rgb_matrix_set_color(led, boost, max_intensity, boost); + } + else { + const uint8_t green = (uint8_t) ((uint16_t) max_intensity * map[col][row] / pure_green_intensity); + rgb_matrix_set_color(led, 0, green, 0); + } + } + } + if (++drop > drop_ticks) { + // reset drop timer + drop = 0; + for (uint8_t row = MATRIX_ROWS - 1; row > 0; row--) { + for (uint8_t col = 0; col < MATRIX_COLS; col++) { + // if ths is on the bottom row and bright allow decay + if (row == MATRIX_ROWS - 1 && map[col][row] == max_intensity) { + map[col][row]--; + } + // check if the pixel above is bright + if (map[col][row - 1] == max_intensity) { + // allow old bright pixel to decay + map[col][row - 1]--; + // make this pixel bright + map[col][row] = max_intensity; + } + } + } + } +} + void rgb_matrix_multisplash(void) { // if (g_any_key_hit < 0xFF) { HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; @@ -685,6 +748,9 @@ void rgb_matrix_task(void) { case RGB_MATRIX_JELLYBEAN_RAINDROPS: rgb_matrix_jellybean_raindrops( initialize ); break; + case RGB_MATRIX_DIGITAL_RAIN: + rgb_matrix_digital_rain( initialize ); + break; #ifdef RGB_MATRIX_KEYPRESSES case RGB_MATRIX_SOLID_REACTIVE: rgb_matrix_solid_reactive(); diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index b91c9fba59..046d98790f 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -81,6 +81,7 @@ enum rgb_matrix_effects { RGB_MATRIX_RAINBOW_PINWHEELS, RGB_MATRIX_RAINBOW_MOVING_CHEVRON, RGB_MATRIX_JELLYBEAN_RAINDROPS, + RGB_MATRIX_DIGITAL_RAIN, #ifdef RGB_MATRIX_KEYPRESSES RGB_MATRIX_SOLID_REACTIVE, RGB_MATRIX_SPLASH, -- cgit v1.2.3 From 7f1268f35edb24d57f424a1936265ced78eb3daa Mon Sep 17 00:00:00 2001 From: Savio Fernandes Date: Thu, 27 Sep 2018 02:03:42 +0800 Subject: Keymap: add artbycrunk iris layout (#3964) * version 1 * version 1.1 * version 1.2 --- keyboards/iris/keymaps/saviof/config.h | 39 ++++++++++++ keyboards/iris/keymaps/saviof/keymap.c | 107 +++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/saviof/rules.mk | 3 + 3 files changed, 149 insertions(+) create mode 100644 keyboards/iris/keymaps/saviof/config.h create mode 100644 keyboards/iris/keymaps/saviof/keymap.c create mode 100644 keyboards/iris/keymaps/saviof/rules.mk diff --git a/keyboards/iris/keymaps/saviof/config.h b/keyboards/iris/keymaps/saviof/config.h new file mode 100644 index 0000000000..eb4c7328eb --- /dev/null +++ b/keyboards/iris/keymaps/saviof/config.h @@ -0,0 +1,39 @@ +/* +Copyright 2018 Savio Fernandes + +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 + +/* Use I2C or Serial, not both */ + +//#define USE_SERIAL +#define USE_I2C + +/* Select hand configuration */ + +//#define MASTER_LEFT +#define MASTER_RIGHT +// #define BACKLIGHT_BREATHING +// #define EE_HANDS + +#define TAPPING_TERM 200 + +// #undef RGBLED_NUM +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 30 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/saviof/keymap.c b/keyboards/iris/keymaps/saviof/keymap.c new file mode 100644 index 0000000000..a63e606821 --- /dev/null +++ b/keyboards/iris/keymaps/saviof/keymap.c @@ -0,0 +1,107 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJ 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJ, +}; + +//Tap Dance Declarations +enum { + TD_SPC_ENT = 0 +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_SPC_ENT] = ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT) +}; + +#define KC_ KC_TRNS + +#define KC_LOWR LT(_LOWER, KC_LEFT) //LOWER +#define KC_RASE LT(_RAISE, KC_RIGHT) //RAISE +#define KC_ADJT LT(_ADJ, KC_LGUI) //RAISE +#define KC_SCET TD(TD_SPC_ENT) +#define KC_RST RESET +#define KC_BL_S BL_STEP +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_RMOD RGB_MOD +#define KC_LMOD 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_BTOG BL_TOGG +#define KC_BLVL BL_STEP +#define KC_BRTG BL_BRTG + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + LCTL, Z , X , C , V , B ,HOME, END , N , M ,COMM,DOT ,SLSH,RSFT, + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + ADJT,LOWR, SPC, SCET,RASE, ENT + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + TILD,EXLM, AT ,HASH, DLR,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RST , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + DEL , ,LEFT,RGHT, UP ,LBRC, RBRC, P4 , P5 , P6 ,PLUS,PIPE, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S, , , ,DOWN,LCBR,LPRN, RPRN,RCBR, P1 , P2 , P3 ,MINS, , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , ,DEL , DEL , , P0 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + F12 , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,MPRV,MNXT,VOLU,PGUP,UNDS, EQL ,HOME, , , ,BSLS, + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + MUTE,MSTP,MPLY,VOLD,PGDN,MINS, , ,PLUS,END , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJ] = LAYOUT_kc( + //,----+----+----+----+----+----. ,----+----+----+----+----+----. + ,LMOD, , , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + RTOG,RMOD,RHUI,RSAI,RVAI, , BTOG,BLVL,BRTG, , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,DBUG,RHUD,RSAD,RVAD, , , , , , , , + //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| + BL_S,RST , , , , , , , , , , , , , + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) + +}; diff --git a/keyboards/iris/keymaps/saviof/rules.mk b/keyboards/iris/keymaps/saviof/rules.mk new file mode 100644 index 0000000000..0e1023be1a --- /dev/null +++ b/keyboards/iris/keymaps/saviof/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +TAP_DANCE_ENABLE=yes -- cgit v1.2.3 From f3551747b3cd071bc242fd646f32567fb89f5356 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Daisuke Date: Thu, 27 Sep 2018 03:04:31 +0900 Subject: Keymap: Add Koba's keymap for Ergo42. (#3965) * Keymap: Add Koba's keymap for Ergo42. * Fix: Remove unnecessary #define. * Fix: Rename readme files to lowercase. --- keyboards/ergo42/keymaps/koba/config.h | 33 ++++++++ keyboards/ergo42/keymaps/koba/keymap.c | 128 +++++++++++++++++++++++++++++ keyboards/ergo42/keymaps/koba/readme.md | 57 +++++++++++++ keyboards/ergo42/keymaps/koba/readme_ja.md | 62 ++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 keyboards/ergo42/keymaps/koba/config.h create mode 100644 keyboards/ergo42/keymaps/koba/keymap.c create mode 100644 keyboards/ergo42/keymaps/koba/readme.md create mode 100644 keyboards/ergo42/keymaps/koba/readme_ja.md diff --git a/keyboards/ergo42/keymaps/koba/config.h b/keyboards/ergo42/keymaps/koba/config.h new file mode 100644 index 0000000000..360d6a5621 --- /dev/null +++ b/keyboards/ergo42/keymaps/koba/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + diff --git a/keyboards/ergo42/keymaps/koba/keymap.c b/keyboards/ergo42/keymaps/koba/keymap.c new file mode 100644 index 0000000000..f05f78b9e7 --- /dev/null +++ b/keyboards/ergo42/keymaps/koba/keymap.c @@ -0,0 +1,128 @@ +/* Copyright 2018 Daisuke Kobayashi + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +enum { + _WIN, + _MACOS, + _LOWER, + _RAISE, + _FUNC +}; + +#define KC_KNA KC_LANG1 +#define KC_EISU KC_LANG2 +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FN MO(_FUNC) +#define WIN DF(_WIN) +#define MACOS DF(_MACOS) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* WIN + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Del | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | H/Z |Shift | Z | X | C | V | B | | N | M | , < | . > | / ? | Up |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Fn | Ctrl | Win | Alt | Mhen |LOWER |Space | |Space |RAISE | Henk | Menu | Left | Down |Right | + * `------------------------------------------------' `------------------------------------------------' + */ + [_WIN] = LAYOUT( \ + KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ + KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ + KC_ZKHK, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + FN, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, LOWER, KC_SPC, KC_SPC, RAISE, KC_HENK, KC_APP, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* MACOS + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | Tab | Q | W | E | R | T | | Y | U | I | O | P | @ ` | Bksp | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | Del | Ctrl | A | S | D | F | G | | H | J | K | L | ; + | ; * |Enter | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | Caps |Shift | Z | X | C | V | B | | N | M | , < | . > | / ? | Up |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Fn | Ctrl | Opt | Cmd | Eisu |LOWER |Space | |Space |RAISE | Kana | Cmd | Left | Down |Right | + * `------------------------------------------------' `------------------------------------------------' + */ + [_MACOS] = LAYOUT( \ + KC_ESC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, JP_AT, KC_BSPC, \ + KC_DELT, KC_RCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, JP_COLN, KC_ENT, \ + KC_CAPS, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_RSFT, \ + FN, KC_LCTL, KC_LALT, KC_LGUI, KC_EISU, LOWER, KC_SPC, KC_SPC, RAISE, KC_KNA, KC_RGUI, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* LOWER + * ,------------------------------------------------. ,------------------------------------------------. + * | | | ! | " | # | $ | % | | & | ' | ( | ) | | = | | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | | XXXX | XXXX | XXXX | { | ( | | ) | } | XXXX | ~ | | | _ | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | | XXXX | XXXX | XXXX | XXXX | XXXX | | XXXX | XXXX | XXXX | XXXX | XXXX | PgUp | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | Home | PgDn | End | + * `------------------------------------------------' `------------------------------------------------' + */ + [_LOWER] = LAYOUT( \ + _______, _______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), JP_EQL, _______, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, JP_LCBR, JP_LPRN, JP_RPRN, JP_RCBR, XXXXXXX, JP_TILD, JP_PIPE, JP_UNDS, _______, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + + /* RAISE + * ,------------------------------------------------. ,------------------------------------------------. + * | | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | - | | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | | F11 | F12 | XXXX | [ | ( | | ) | ] | XXXX | ^ | \ | \ | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------------------------------------------------' `------------------------------------------------' + */ + [_RAISE] = LAYOUT( \ + _______, _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, _______, \ + _______, _______, KC_F11, KC_F12, XXXXXXX, JP_LBRC, JP_LPRN, JP_RPRN, JP_RBRC, XXXXXXX, JP_CIRC, KC_JYEN, KC_RO, _______, \ + _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* FUNC + * ,------------------------------------------------. ,------------------------------------------------. + * |Reset | | XXXX | XXXX | XXXX | XXXX | XXXX | |PrtSc |SLock |Pause | XXXX | XXXX | XXXX | | + * |------+------+------+------+------+------+------| |-------------+------+------+------+------+------| + * | | | XXXX | XXXX | XXXX | XXXX | >Win | | Ins | XXXX | XXXX | XXXX | XXXX | XXXX | | + * |------+------+------+------+------+------+------| |------|------+------+------+------+------+------| + * | | | XXXX | XXXX | XXXX | XXXX | >Mac | | XXXX | XXXX | XXXX | XXXX | XXXX | Vol+ | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | Vol- | Play | + * `------------------------------------------------' `------------------------------------------------' + */ + [_FUNC] = LAYOUT( \ + RESET, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, WIN, KC_INS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MACOS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_VOLU, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_VOLD, KC_MPLY \ + ) +}; + diff --git a/keyboards/ergo42/keymaps/koba/readme.md b/keyboards/ergo42/keymaps/koba/readme.md new file mode 100644 index 0000000000..1fe0543902 --- /dev/null +++ b/keyboards/ergo42/keymaps/koba/readme.md @@ -0,0 +1,57 @@ +# Keymap for Ergo42 + +## About + +This keymap is for Ergo42. + +- JIS layout. +- Independent Windows layout/MacOS layout layers. +- Bottom row keys arranged like a standard keyboard. +- Arrow keys are designed in the inverted-T. + +## Layout + +![keyboard-layout](https://user-images.githubusercontent.com/1042121/45888288-aa35ed00-bdf8-11e8-8741-71fe9a0fadc6.png) + +## Windows mode/MacOS mode + +|mode |key | +|------------|------------| +|Windows mode|Function + g| +|MacOS mode |Function + b| + +When switching mode, the following keys switches. + +|Windows |MacOS | +|---------------|------------| +|Alt |Command(GUI)| +|Windows(GUI) |Option(Alt) | +|Menu(App) |Command(GUI)| +|Muhenkan |Eisu | +|Henkan |Kana | +|Hankaku/Zenkaku|Caps | + +## Layers + +|No.|Name |Description | +|---|--------|---------------------------| +| 4 |Function|Mode switch, Media | +| 3 |Raise |Number, Function | +| 2 |Lower |Symbol, Home/End, PgUp/PgDn| +| 1 |MacOS |MacOS layout | +| 0 |Windows |Windows layout | + +When power is turn on, No.0 Windows layer becomes enabled. + +## Windows/MacOS layers + +Standard layers for Windows mode/MacOS mode. + +## Raise/Lower layers + +Layer enabled during pressing Raise or Lower key. + +## Function layer + +Layer enabled during pressing Function key. + diff --git a/keyboards/ergo42/keymaps/koba/readme_ja.md b/keyboards/ergo42/keymaps/koba/readme_ja.md new file mode 100644 index 0000000000..e1dbda821f --- /dev/null +++ b/keyboards/ergo42/keymaps/koba/readme_ja.md @@ -0,0 +1,62 @@ +# Keymap for Ergo42 + +## 概要 + +Ergo42 用キーマップです。 + +- JIS 配列 +- 独立した Windows 配列/MacOS 配列レイヤー +- 普通のキーボード配列に似せた最下段キー +- 逆 T 字 (凸型) 配列の矢印キー + +## レイアウト + +![keyboard-layout](https://user-images.githubusercontent.com/1042121/45888288-aa35ed00-bdf8-11e8-8741-71fe9a0fadc6.png) + +## Windows モード/MacOS モード + +|モード |キー | +|--------------|------------| +|Windows モード|Function + g| +|MacOS モード |Function + b| + +モードを切り替えることで下記のキーが切り替わります。 + +|Windows |MacOS | +|------------|------------| +|Alt |Command(GUI)| +|Windows(GUI)|Option(Alt) | +|Menu(App) |Command(GUI)| +|無変換 |英数 | +|変換 |かな | +|半角/全角 |Caps | + +## レイヤー + +|No.|名称 |内容 | +|---|--------|--------------------------| +| 4 |Function|モード切替, メディア | +| 3 |Raise |数字, ファンクションキー | +| 2 |Lower |記号, Home/End, PgUp/PgDn | +| 1 |MacOS |MacOS 配列 | +| 0 |Windows |Windows 配列 | + +電源 ON により No.0 の Windows レイヤーが有効になります。 + +## Windows/MacOS レイヤー + +Windows モード/MacOS モードの標準レイヤー。 + +## Raise/Lower レイヤー + +Raise キーまたは Lower キーを押している間だけ有効になるレイヤー。 + +普通のキーボードの最上段キー (数字/記号) に加えて、標準レイヤーに入らなかった記号キーが3つ (`[{`, `]}`, `\_`) 入っています。 +括弧キー `[{`, `]}` は `(`, `)` を加えて、左右対称に配置しました。 + +## Function レイヤー + +Function キーを押している間だけ有効になるレイヤー。 + +Windows モード/MacOS モードの切り替え、メディア系の操作、標準レイヤーに入らなかった機能キーのレイヤーです。 + -- cgit v1.2.3 From 722f06ff8c7c77843cc5be14d9fdb7d68a16ebf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 26 Sep 2018 20:08:56 +0200 Subject: Keymap: Update whitefox/konstantin keymap (#3980) * Rename constexpr keymap folder to konstantin * Replace numpad comma with Unicode comma * Rename tap dance constants * Move record->event.pressed check into switch * Use RShift as a dedicated Fn key --- keyboards/whitefox/keymaps/constexpr/config.h | 14 --- keyboards/whitefox/keymaps/constexpr/keymap.c | 142 ------------------------ keyboards/whitefox/keymaps/constexpr/rules.mk | 4 - keyboards/whitefox/keymaps/konstantin/config.h | 14 +++ keyboards/whitefox/keymaps/konstantin/keymap.c | 146 +++++++++++++++++++++++++ keyboards/whitefox/keymaps/konstantin/rules.mk | 4 + 6 files changed, 164 insertions(+), 160 deletions(-) delete mode 100644 keyboards/whitefox/keymaps/constexpr/config.h delete mode 100644 keyboards/whitefox/keymaps/constexpr/keymap.c delete mode 100644 keyboards/whitefox/keymaps/constexpr/rules.mk create mode 100644 keyboards/whitefox/keymaps/konstantin/config.h create mode 100644 keyboards/whitefox/keymaps/konstantin/keymap.c create mode 100644 keyboards/whitefox/keymaps/konstantin/rules.mk diff --git a/keyboards/whitefox/keymaps/constexpr/config.h b/keyboards/whitefox/keymaps/constexpr/config.h deleted file mode 100644 index b4bc05acf5..0000000000 --- a/keyboards/whitefox/keymaps/constexpr/config.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#define FORCE_NKRO - -#define TAPPING_TOGGLE 2 -#define TAPPING_TERM 200 -#define PERMISSIVE_HOLD - -#define MOUSEKEY_DELAY 50 -#define MOUSEKEY_INTERVAL 15 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 diff --git a/keyboards/whitefox/keymaps/constexpr/keymap.c b/keyboards/whitefox/keymaps/constexpr/keymap.c deleted file mode 100644 index b19f1c81fa..0000000000 --- a/keyboards/whitefox/keymaps/constexpr/keymap.c +++ /dev/null @@ -1,142 +0,0 @@ -#include QMK_KEYBOARD_H - -#define FN_CAPS LT(L_FN, KC_CAPS) -#define FN_CTRL TD(TD_FN_CTRL) -#define RL_ALT TD(TD_RL_ALT) // Unused - -#define TOP LCTL(KC_HOME) -#define BOTTOM LCTL(KC_END) - -#define UC_LPRN UC(0x0028) -#define UC_RPRN UC(0x0029) -#define UC_EQLS UC(0x003D) -#define UC_MULS UC(0x00D7) -#define UC_DIVS UC(0x00F7) -#define UC_MINS UC(0x2212) - -void matrix_init_user(void) -{ - set_unicode_input_mode(UC_WIN); -} - -enum layers { - L_BASE, - L_FN, - L_NUMPAD, -}; - -enum custom_keycodes { - CLEAR = SAFE_RANGE, - NUMPAD, -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - if (!record->event.pressed) { return true; } - - switch (keycode) { - case CLEAR: - SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); - return false; - - case NUMPAD: - layer_invert(L_NUMPAD); - bool num_lock = host_keyboard_leds() & 1<count & 1) { layer_on(L_FN); } - if (state->count & 2) { register_code(KC_RCTL); } -} - -void td_fn_ctrl_reset(qk_tap_dance_state_t *state, void *user_data) -{ - if (state->count & 1) { layer_off(L_FN); } - if (state->count & 2) { unregister_code(KC_RCTL); } -} - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_FN_CTRL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_ctrl_finished, td_fn_ctrl_reset), - [TD_RL_ALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), // Unused -}; - -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ,---------------------------------------------------------------. - * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |PSc| - * |---------------------------------------------------------------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Bspc |Del| - * |---------------------------------------------------------------| - * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| - * |---------------------------------------------------------------| - * | LShift | Z | X | C | V | B | N | M | , | . | / |RShift| ↑ |PgD| - * |---------------------------------------------------------------| - * |LCtl|LGui|LAlt| Space |RAlt|FnCt| | ← | ↓ | → | - * `---------------------------------------------------------------' - */ - [L_BASE] = LAYOUT_truefox( \ - KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ - 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_BSPC, KC_DEL, \ - 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_PGUP, \ - KC_LSFT, 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_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN_CTRL, KC_LEFT,KC_DOWN,KC_RGHT \ - ), - - /* Function layer - * ,---------------------------------------------------------------. - * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| - * |---------------------------------------------------------------| - * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| - * |---------------------------------------------------------------| - * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| - * |---------------------------------------------------------------| - * | |MA0|MA2|MW←|MW→| | | |Vo-|Vo+|Mut| |PgU|Btm| - * |---------------------------------------------------------------| - * | | | | MW↓ |App | | |Hom|PgD|End| - * `---------------------------------------------------------------' - */ - [L_FN] = LAYOUT_truefox( \ - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ - KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ - _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ - _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,_______, KC_PGUP,BOTTOM, \ - _______,_______,_______, KC_WH_D, KC_APP, _______, KC_HOME,KC_PGDN,KC_END \ - ), - - /* Numpad layer - * ,---------------------------------------------------------------. - * |Num| | | | | | |P7 |P8 |P9 |P- | − | = |Num| | | - * |---------------------------------------------------------------| - * | | | | | | | |P4 |P5 |P6 |P+ | ( | ) | | | - * |---------------------------------------------------------------| - * | | | | | | | |P1 |P2 |P3 |P* | × | PEnter | | - * |---------------------------------------------------------------| - * | | | | | | |P0 |P0 |P, |P. |P/ | ÷ | | | - * |---------------------------------------------------------------| - * | | | | | | | | | | | - * `---------------------------------------------------------------' - */ - [L_NUMPAD] = LAYOUT_truefox( \ - NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,UC_MINS,UC_EQLS,NUMPAD, _______,_______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,UC_LPRN,UC_RPRN,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,UC_MULS, KC_PENT, _______, \ - _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, KC_PCMM,KC_PDOT,KC_PSLS,UC_DIVS, _______,_______, \ - _______,_______,_______, _______, _______,_______, _______,_______,_______ \ - ), -}; diff --git a/keyboards/whitefox/keymaps/constexpr/rules.mk b/keyboards/whitefox/keymaps/constexpr/rules.mk deleted file mode 100644 index f1f3d2378e..0000000000 --- a/keyboards/whitefox/keymaps/constexpr/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -BOOTMAGIC_ENABLE = no -CONSOLE_ENABLE = yes -TAP_DANCE_ENABLE = yes -UNICODE_ENABLE = yes diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h new file mode 100644 index 0000000000..ad40105a7c --- /dev/null +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -0,0 +1,14 @@ +#pragma once + +#define FORCE_NKRO + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c new file mode 100644 index 0000000000..6998798e3c --- /dev/null +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -0,0 +1,146 @@ +#include QMK_KEYBOARD_H + +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_RCTL TD(TD_FN_RCTL) // Unused +#define RLALT TD(TD_RLALT) // Unused + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +#define UC_COMM UC(0x002C) +#define UC_LPRN UC(0x0028) +#define UC_RPRN UC(0x0029) +#define UC_EQLS UC(0x003D) +#define UC_MULS UC(0x00D7) +#define UC_DIVS UC(0x00F7) +#define UC_MINS UC(0x2212) + +void matrix_init_user(void) +{ + set_unicode_input_mode(UC_WIN); +} + +enum layers { + L_BASE, + L_FN, + L_NUMPAD, +}; + +enum custom_keycodes { + CLEAR = SAFE_RANGE, + NUMPAD, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + case NUMPAD: + if (record->event.pressed) { + layer_invert(L_NUMPAD); + bool num_lock = host_keyboard_leds() & 1<count & 1) { layer_on(L_FN); } + if (state->count & 2) { register_code(KC_RCTL); } +} + +void td_fn_ctrl_reset(qk_tap_dance_state_t *state, void *user_data) +{ + if (state->count & 1) { layer_off(L_FN); } + if (state->count & 2) { unregister_code(KC_RCTL); } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_ctrl_finished, td_fn_ctrl_reset), + [TD_RLALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), +}; + +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ,---------------------------------------------------------------. + * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |PSc| + * |---------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Bspc |Del| + * |---------------------------------------------------------------| + * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| + * |---------------------------------------------------------------| + * | LShift | Z | X | C | V | B | N | M | , | . | / | Fn | ↑ |PgD| + * |---------------------------------------------------------------| + * |LCtl|LGui|LAlt| Space |RAlt|RCtl| | ← | ↓ | → | + * `---------------------------------------------------------------' + */ + [L_BASE] = LAYOUT_truefox( \ + KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ + 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_BSPC, KC_DEL, \ + 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_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,FN, KC_UP, KC_PGDN, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + + /* Function layer + * ,---------------------------------------------------------------. + * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| + * |---------------------------------------------------------------| + * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| + * |---------------------------------------------------------------| + * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| + * |---------------------------------------------------------------| + * | |MA0|MA2|MW←|MW→| | | |VoD|VoU|Mut| |PgU|Btm| + * |---------------------------------------------------------------| + * | | | | MW↓ | |Menu| |Hom|PgD|End| + * `---------------------------------------------------------------' + */ + [L_FN] = LAYOUT_truefox( \ + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ + KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ + _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ + _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,_______, KC_PGUP,BOTTOM, \ + _______,_______,_______, KC_WH_D, _______,KC_APP, KC_HOME,KC_PGDN,KC_END \ + ), + + /* Numpad layer + * ,---------------------------------------------------------------. + * |Num| | | | | | |P7 |P8 |P9 |P- | − | = |Num| | | + * |---------------------------------------------------------------| + * | | | | | | | |P4 |P5 |P6 |P+ | ( | ) | | | + * |---------------------------------------------------------------| + * | | | | | | | |P1 |P2 |P3 |P* | × | PEnter | | + * |---------------------------------------------------------------| + * | | | | | | |P0 |P0 | , |P. |P/ | ÷ | | | + * |---------------------------------------------------------------| + * | | | | | | | | | | | + * `---------------------------------------------------------------' + */ + [L_NUMPAD] = LAYOUT_truefox( \ + NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,UC_MINS,UC_EQLS,NUMPAD, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,UC_LPRN,UC_RPRN,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,UC_MULS, KC_PENT, _______, \ + _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, UC_COMM,KC_PDOT,KC_PSLS,UC_DIVS, _______,_______, \ + _______,_______,_______, _______, _______,_______, _______,_______,_______ \ + ), +}; diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk new file mode 100644 index 0000000000..f1f3d2378e --- /dev/null +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -0,0 +1,4 @@ +BOOTMAGIC_ENABLE = no +CONSOLE_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes -- cgit v1.2.3 From e2eee47e20481d0936a1893b561f3a95445b40fd Mon Sep 17 00:00:00 2001 From: Kosuke Adachi Date: Thu, 27 Sep 2018 03:13:19 +0900 Subject: Keyboard: Crkbd stands for Corne Keyboard, not helidox (#3985) --- keyboards/crkbd/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/crkbd/info.json b/keyboards/crkbd/info.json index d74bb49430..45a0255c1a 100644 --- a/keyboards/crkbd/info.json +++ b/keyboards/crkbd/info.json @@ -1,5 +1,5 @@ { - "keyboard_name": "crkbd (helidox) rev. 1", + "keyboard_name": "crkbd rev. 1", "url": "", "maintainer": "qmk", "width": 15, -- cgit v1.2.3 From dbdbbbd5c9b1458f682eec661d0a17f91dccb4dc Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 26 Sep 2018 12:17:54 -0700 Subject: Keyboard: Refactor XMMX keyboard to XMMX and Toad (#3955) * pull out toad keyboard and get it compiling * refactor xmmx * use the correct LAYOUT macros * move LED code out to toad.c file * move LED code out to xmmx.c file * adjust for correct number of columns and pins used * remove led set user --- keyboards/toad/config.h | 54 +++++++++++++++ keyboards/toad/keymaps/ansi_wk/keymap.c | 15 +++++ keyboards/toad/keymaps/ansi_wkl/keymap.c | 13 ++++ keyboards/toad/keymaps/default/keymap.c | 13 ++++ keyboards/toad/keymaps/iso_wk/keymap.c | 13 ++++ keyboards/toad/keymaps/iso_wkl/keymap.c | 13 ++++ keyboards/toad/readme.md | 14 ++++ keyboards/toad/rules.mk | 56 ++++++++++++++++ keyboards/toad/toad.c | 18 +++++ keyboards/toad/toad.h | 91 +++++++++++++++++++++++++ keyboards/xmmx/keymaps/ansi_wk/keymap.c | 13 ++++ keyboards/xmmx/keymaps/ansi_wkl/keymap.c | 13 ++++ keyboards/xmmx/keymaps/default/keymap.c | 21 +----- keyboards/xmmx/keymaps/iso_wk/keymap.c | 13 ++++ keyboards/xmmx/keymaps/iso_wkl/keymap.c | 13 ++++ keyboards/xmmx/keymaps/toad/keymap.c | 30 --------- keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c | 30 --------- keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c | 30 --------- keyboards/xmmx/keymaps/toad_iso_wk/keymap.c | 30 --------- keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c | 30 --------- keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c | 30 --------- keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c | 30 --------- keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c | 30 --------- keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c | 30 --------- keyboards/xmmx/readme.md | 8 +-- keyboards/xmmx/xmmx.c | 17 +++++ keyboards/xmmx/xmmx.h | 96 ++------------------------- 27 files changed, 377 insertions(+), 387 deletions(-) create mode 100644 keyboards/toad/config.h create mode 100644 keyboards/toad/keymaps/ansi_wk/keymap.c create mode 100644 keyboards/toad/keymaps/ansi_wkl/keymap.c create mode 100644 keyboards/toad/keymaps/default/keymap.c create mode 100644 keyboards/toad/keymaps/iso_wk/keymap.c create mode 100644 keyboards/toad/keymaps/iso_wkl/keymap.c create mode 100644 keyboards/toad/readme.md create mode 100644 keyboards/toad/rules.mk create mode 100644 keyboards/toad/toad.c create mode 100644 keyboards/toad/toad.h create mode 100644 keyboards/xmmx/keymaps/ansi_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/ansi_wkl/keymap.c create mode 100644 keyboards/xmmx/keymaps/iso_wk/keymap.c create mode 100644 keyboards/xmmx/keymaps/iso_wkl/keymap.c delete mode 100644 keyboards/xmmx/keymaps/toad/keymap.c delete mode 100644 keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c delete mode 100644 keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c delete mode 100644 keyboards/xmmx/keymaps/toad_iso_wk/keymap.c delete mode 100644 keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c delete mode 100644 keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c delete mode 100644 keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c delete mode 100644 keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c delete mode 100644 keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c diff --git a/keyboards/toad/config.h b/keyboards/toad/config.h new file mode 100644 index 0000000000..f1d32c15b6 --- /dev/null +++ b/keyboards/toad/config.h @@ -0,0 +1,54 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6776 +#define DEVICE_VER 0x0001 +#define MANUFACTURER farmakon +#define PRODUCT "TOAD" +#define DESCRIPTION "TOAD" + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 14 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, F6, F5, F4, F1, F0 } +#define MATRIX_COL_PINS { B3, B2, B1, E6, B7, C7, C6, D4, D6, D7, B4, D0, D1, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 0 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/toad/keymaps/ansi_wk/keymap.c b/keyboards/toad/keymaps/ansi_wk/keymap.c new file mode 100644 index 0000000000..a4fd348f0e --- /dev/null +++ b/keyboards/toad/keymaps/ansi_wk/keymap.c @@ -0,0 +1,15 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ansi_wk( + 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_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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL + ) +}; + + diff --git a/keyboards/toad/keymaps/ansi_wkl/keymap.c b/keyboards/toad/keymaps/ansi_wkl/keymap.c new file mode 100644 index 0000000000..7fb6b3b599 --- /dev/null +++ b/keyboards/toad/keymaps/ansi_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ansi_wkl( + 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_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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/keyboards/toad/keymaps/default/keymap.c b/keyboards/toad/keymaps/default/keymap.c new file mode 100644 index 0000000000..4c30bdc442 --- /dev/null +++ b/keyboards/toad/keymaps/default/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_all( + 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_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_BSPC, \ + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_RSFT, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + ) +}; diff --git a/keyboards/toad/keymaps/iso_wk/keymap.c b/keyboards/toad/keymaps/iso_wk/keymap.c new file mode 100644 index 0000000000..2025504321 --- /dev/null +++ b/keyboards/toad/keymaps/iso_wk/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_iso_wk( + 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_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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, 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_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL + ) +}; diff --git a/keyboards/toad/keymaps/iso_wkl/keymap.c b/keyboards/toad/keymaps/iso_wkl/keymap.c new file mode 100644 index 0000000000..1659d7b384 --- /dev/null +++ b/keyboards/toad/keymaps/iso_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_iso_wkl( + 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_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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, 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_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL + ) +}; diff --git a/keyboards/toad/readme.md b/keyboards/toad/readme.md new file mode 100644 index 0000000000..3f3bff5b5b --- /dev/null +++ b/keyboards/toad/readme.md @@ -0,0 +1,14 @@ +# Toad + +Toad: 70% Mechanical Keyboard PCB. + +Toad schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/70_Keyboard-d4f6baf4792d4ada9c0571fa3713e461) + +For more informations on the Toad please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=91388.0) + +Make examples for these keyboards (after setting up your build environment): + + make toad:default + + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/toad/rules.mk b/keyboards/toad/rules.mk new file mode 100644 index 0000000000..ee87c6e8d4 --- /dev/null +++ b/keyboards/toad/rules.mk @@ -0,0 +1,56 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) +EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) +CONSOLE_ENABLE ?= no # Console for debug(+400) +COMMAND_ENABLE ?= no # Commands for debug and configuration +SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +NKRO_ENABLE ?= yes # USB 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 +AUDIO_ENABLE ?= no +RGBLIGHT_ENABLE ?= no \ No newline at end of file diff --git a/keyboards/toad/toad.c b/keyboards/toad/toad.c new file mode 100644 index 0000000000..bc4db0339e --- /dev/null +++ b/keyboards/toad/toad.c @@ -0,0 +1,18 @@ +#include "toad.h" + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/toad/toad.h b/keyboards/toad/toad.h new file mode 100644 index 0000000000..154068e42a --- /dev/null +++ b/keyboards/toad/toad.h @@ -0,0 +1,91 @@ +#ifndef TOAD +#define TOAD + +#include "quantum.h" + +// 70% keyboard: default - all keys +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413 }, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ANSI Winkey +#define LAYOUT_ansi_wk( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ANSI Winkeyless +#define LAYOUT_ansi_wkl( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K502, K507, K511, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ + { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ +} + +// 70% keyboard: ISO Winkey +#define LAYOUT_iso_wk( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K501, K502, K507, K510, K511, K512, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ +} + +// 70% keyboard: ISO Winkeyless +#define LAYOUT_iso_wkl( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ + K500, K502, K507, K511, K513 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ + { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ +} + +#endif diff --git a/keyboards/xmmx/keymaps/ansi_wk/keymap.c b/keyboards/xmmx/keymaps/ansi_wk/keymap.c new file mode 100644 index 0000000000..abdba99ba7 --- /dev/null +++ b/keyboards/xmmx/keymaps/ansi_wk/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ansi_wk( + 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_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_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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; diff --git a/keyboards/xmmx/keymaps/ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c new file mode 100644 index 0000000000..aeb61ff2ca --- /dev/null +++ b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ansi_wkl( + 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_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_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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; diff --git a/keyboards/xmmx/keymaps/default/keymap.c b/keyboards/xmmx/keymaps/default/keymap.c index 6b0a114328..a7522fe25a 100644 --- a/keyboards/xmmx/keymaps/default/keymap.c +++ b/keyboards/xmmx/keymaps/default/keymap.c @@ -1,8 +1,8 @@ -#include "xmmx.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( + LAYOUT_all( 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_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_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, \ @@ -11,20 +11,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT ) }; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/iso_wk/keymap.c b/keyboards/xmmx/keymaps/iso_wk/keymap.c new file mode 100644 index 0000000000..882cb224a6 --- /dev/null +++ b/keyboards/xmmx/keymaps/iso_wk/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_iso_wk( + 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_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_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_NUHS, 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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; diff --git a/keyboards/xmmx/keymaps/iso_wkl/keymap.c b/keyboards/xmmx/keymaps/iso_wkl/keymap.c new file mode 100644 index 0000000000..18ba79e1f9 --- /dev/null +++ b/keyboards/xmmx/keymaps/iso_wkl/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_iso_wkl( + 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_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_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_NUHS, 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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ) +}; diff --git a/keyboards/xmmx/keymaps/toad/keymap.c b/keyboards/xmmx/keymaps/toad/keymap.c deleted file mode 100644 index c13dc8f671..0000000000 --- a/keyboards/xmmx/keymaps/toad/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - TOAD_KEYMAP( - 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_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_BSPC, \ - 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_RSFT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c b/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c deleted file mode 100644 index 5e61dfffbb..0000000000 --- a/keyboards/xmmx/keymaps/toad_ansi_wk/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - TOAD_KEYMAP_ANSI_WK( - 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_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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c deleted file mode 100644 index 7778b06521..0000000000 --- a/keyboards/xmmx/keymaps/toad_ansi_wkl/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - TOAD_KEYMAP_ANSI_WKL( - 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_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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c b/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c deleted file mode 100644 index c51ff862a0..0000000000 --- a/keyboards/xmmx/keymaps/toad_iso_wk/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - TOAD_KEYMAP_ISO_WK( - 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_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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, 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_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c b/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c deleted file mode 100644 index efcebc713b..0000000000 --- a/keyboards/xmmx/keymaps/toad_iso_wkl/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - TOAD_KEYMAP_ISO_WKL( - 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_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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, KC_NUHS, 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_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c b/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c deleted file mode 100644 index 20d55c1fd5..0000000000 --- a/keyboards/xmmx/keymaps/xmmx_ansi_wk/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - KEYMAP_ANSI_WK( - 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_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_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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c deleted file mode 100644 index 3c8ba436f0..0000000000 --- a/keyboards/xmmx/keymaps/xmmx_ansi_wkl/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - KEYMAP_ANSI_WKL( - 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_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_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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c b/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c deleted file mode 100644 index ee68253c7e..0000000000 --- a/keyboards/xmmx/keymaps/xmmx_iso_wk/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - KEYMAP_ISO_WK( - 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_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_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_NUHS, 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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c b/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c deleted file mode 100644 index c27914e451..0000000000 --- a/keyboards/xmmx/keymaps/xmmx_iso_wkl/keymap.c +++ /dev/null @@ -1,30 +0,0 @@ -#include "xmmx.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - KEYMAP_ISO_WKL( - 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_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_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_NUHS, 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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) -}; - -void led_set_user(uint8_t usb_led) { - - //LED1 - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 6); PORTB &= ~(1 << 6); - } else { - DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); - } - - //LED2 - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRB |= (1 << 5); PORTB &= ~(1 << 5); - } else { - DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); - } -} diff --git a/keyboards/xmmx/readme.md b/keyboards/xmmx/readme.md index cf16231e17..8f94df4b92 100644 --- a/keyboards/xmmx/readme.md +++ b/keyboards/xmmx/readme.md @@ -1,20 +1,14 @@ -XMMX and Toad -======== +# XMMX XMMX: Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases -Toad: 70% Mechanical Keyboard PCB. XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d) -Toad schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/70_Keyboard-d4f6baf4792d4ada9c0571fa3713e461) For more informations on the XMMX please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=93422.0) -For more informations on the Toad please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=91388.0) Make examples for these keyboards (after setting up your build environment): make xmmx:default - make xmmx:toad - See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/xmmx/xmmx.c b/keyboards/xmmx/xmmx.c index 399ae4eb44..4d410e90a0 100644 --- a/keyboards/xmmx/xmmx.c +++ b/keyboards/xmmx/xmmx.c @@ -1 +1,18 @@ #include "xmmx.h" + +void led_set_user(uint8_t usb_led) { + + //LED1 + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 6); PORTB &= ~(1 << 6); + } else { + DDRB &= ~(1 << 6); PORTB &= ~(1 << 6); + } + + //LED2 + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 5); PORTB &= ~(1 << 5); + } else { + DDRB &= ~(1 << 5); PORTB &= ~(1 << 5); + } +} diff --git a/keyboards/xmmx/xmmx.h b/keyboards/xmmx/xmmx.h index ad6ae30146..22d0f1480d 100644 --- a/keyboards/xmmx/xmmx.h +++ b/keyboards/xmmx/xmmx.h @@ -4,7 +4,7 @@ #include "quantum.h" // 80% keyboard: default - all keys -#define KEYMAP( \ +#define LAYOUT_all( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K013, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -21,7 +21,7 @@ } // 80% keyboard: ANSI Winkey -#define KEYMAP_ANSI_WK( \ +#define LAYOUT_ansi_wk( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -38,7 +38,7 @@ } // 80% keyboard: ANSI Winkeyless -#define KEYMAP_ANSI_WKL( \ +#define LAYOUT_ansi_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -55,7 +55,7 @@ } // 80% keyboard: ISO Winkey -#define KEYMAP_ISO_WK( \ +#define LAYOUT_iso_wk( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -72,7 +72,7 @@ } // 80% keyboard: ISO Winkeyless -#define KEYMAP_ISO_WKL( \ +#define LAYOUT_iso_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -88,90 +88,4 @@ { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513, K514, K515, K516 } \ } - -// 70% keyboard: default - all keys -#define TOAD_KEYMAP( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K013, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, \ - K500, K501, K502, K507, K510, K511, K512, K513 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413 }, \ - { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ -} - -// 70% keyboard: ANSI Winkey -#define TOAD_KEYMAP_ANSI_WK( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ - K500, K501, K502, K507, K510, K511, K512, K513 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ - { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ - { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ -} - -// 70% keyboard: ANSI Winkeyless -#define TOAD_KEYMAP_ANSI_WKL( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ - K500, K502, K507, K511, K513 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO,K313 }, \ - { K400, KC_NO,K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ - { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ -} - -// 70% keyboard: ISO Winkey -#define TOAD_KEYMAP_ISO_WK( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ - K500, K501, K502, K507, K510, K511, K512, K513 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ - { K500, K501, K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,K510, K511, K512, K513 } \ -} - -// 70% keyboard: ISO Winkeyless -#define TOAD_KEYMAP_ISO_WKL( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K013, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, \ - K500, K502, K507, K511, K513 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO}, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO}, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, KC_NO}, \ - { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513 } \ -} - #endif -- cgit v1.2.3 From 96648a133de7f297157b7d447be59354c1200c09 Mon Sep 17 00:00:00 2001 From: mtdjr Date: Wed, 26 Sep 2018 15:23:30 -0400 Subject: Keymap: mtdjr userspace changes and Nyquist keymap addition (#3940) * holefully correct error in mtdjr userspace for layer_state_set_user * return state and wrap rgb actions in their own conditional * mtdjr nyquist and userspace updates * mtdjr updates as requested --- keyboards/nyquist/keymaps/mtdjr/config.h | 36 ++++++++++++++++++ keyboards/nyquist/keymaps/mtdjr/keymap.c | 64 ++++++++++++++++++++++++++++++++ keyboards/nyquist/keymaps/mtdjr/rules.mk | 2 + users/mtdjr/mtdjr.c | 2 +- users/mtdjr/mtdjr.h | 2 +- 5 files changed, 104 insertions(+), 2 deletions(-) create mode 100644 keyboards/nyquist/keymaps/mtdjr/config.h create mode 100644 keyboards/nyquist/keymaps/mtdjr/keymap.c create mode 100644 keyboards/nyquist/keymaps/mtdjr/rules.mk diff --git a/keyboards/nyquist/keymaps/mtdjr/config.h b/keyboards/nyquist/keymaps/mtdjr/config.h new file mode 100644 index 0000000000..0fa606f296 --- /dev/null +++ b/keyboards/nyquist/keymaps/mtdjr/config.h @@ -0,0 +1,36 @@ +/* +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 + +/* 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/nyquist/keymaps/mtdjr/keymap.c b/keyboards/nyquist/keymaps/mtdjr/keymap.c new file mode 100644 index 0000000000..668e7964b5 --- /dev/null +++ b/keyboards/nyquist/keymaps/mtdjr/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H +#include "mtdjr.h" + +extern keymap_config_t keymap_config; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc ( +// ,-----------------------------. .-----------------------------. + GESC, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + TAB, Q , W , E , R , T , Y , U , I , O , P ,QUOT, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + RASE, A , S , D , F , G , H , J , K , L ,SCLN, ENT, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + LSFT, Z , X , C , V , B , N , M ,COMM, DOT,SLSH,xxxx, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + LOWR,LCTL,LALT,LGUI, SPC, SPC, SPC, SPC,LEFT,DOWN, UP ,RGHT +// '-----------------------------' '-----------------------------' +), + + [_LOWER] = LAYOUT_kc( +// ,-----------------------------. .-----------------------------. + TILD,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,UNDS,PLUS, DEL, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,LBRC,RBRC,BSLS, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + ,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,UNDO, CUT,XCPY,XINS,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , ,MNXT,VOLD,VOLU,MPLY +// '-----------------------------' '-----------------------------' +), + + [_RAISE] = LAYOUT_kc( +// ,-----------------------------. .-----------------------------. + xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,MINS, EQL, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,LCBR,RCBR,PIPE, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + ,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, xxxx,xxxx,xxxx,xxxx,xxxx,xxxx, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , ,MNXT,VOLD,VOLU,MPLY +// '-----------------------------' '-----------------------------' +), + + [_ADJUST] = LAYOUT_kc( +// ,-----------------------------. .-----------------------------. + xxxx,ROOT,PPLY,PSEF,xxxx,xxxx, F1 , F2 , F3 , F4 , F5 , F6 , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,xxxx,xxxx,xxxx, RST,xxxx, F7 , F8 , F9 , F10, F11, F12, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , RGB,RHUI,RSAI,RVAI, MOD, xxxx,xxxx,xxxx,xxxx,xxxx, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + xxxx,RBTH,RHUD,RSAD,RVAD,RMOD, xxxx,xxxx,xxxx,xxxx,xxxx, BLB, +// |----+----+----+----+----+----| |----+----+----+----+----+----| + ,xxxx,xxxx,xxxx, , , , ,BLOF, BLD, BLI,BLON +// '-----------------------------' '-----------------------------' +) + +}; diff --git a/keyboards/nyquist/keymaps/mtdjr/rules.mk b/keyboards/nyquist/keymaps/mtdjr/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/nyquist/keymaps/mtdjr/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/users/mtdjr/mtdjr.c b/users/mtdjr/mtdjr.c index d8d6871a17..c31b077b46 100644 --- a/users/mtdjr/mtdjr.c +++ b/users/mtdjr/mtdjr.c @@ -5,7 +5,7 @@ #endif #ifndef RGB_MODE - #define RGB_MODE 16 + #define RGB_MODE 2 #endif #ifndef RGB_HUE #define RGB_HUE 285 diff --git a/users/mtdjr/mtdjr.h b/users/mtdjr/mtdjr.h index 3efcb45ec2..85ca1596dc 100644 --- a/users/mtdjr/mtdjr.h +++ b/users/mtdjr/mtdjr.h @@ -95,7 +95,7 @@ enum user_tapdance { #define KC_BLD BL_DEC #define KC_BLB BL_BRTG #define KC_BLON BL_ON -#define KB_BLOF BL_OFF +#define KC_BLOF BL_OFF #endif -- cgit v1.2.3 From c7ce0d21dc07e1154b6a40cd621eb2eef075483b Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Tue, 25 Sep 2018 11:32:23 +0900 Subject: Moves animation calculation logic out of the for loops --- quantum/rgb_matrix.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 8ad00c37dd..5fb59af8c0 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -438,10 +438,12 @@ void rgb_matrix_cycle_up_down(void) { void rgb_matrix_dual_beacon(void) { HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; RGB rgb; - rgb_led led; + Point point; + double cos_value = cos(g_tick * PI / 128) / 32; + double sin_value = sin(g_tick * PI / 128) / 112; for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - hsv.h = ((led.point.y - 32.0)* cos(g_tick * PI / 128) / 32 + (led.point.x - 112.0) * sin(g_tick * PI / 128) / (112)) * (180) + rgb_matrix_config.hue; + point = g_rgb_leds[i].point; + hsv.h = ((point.y - 32.0)* cos_value + (point.x - 112.0) * sin_value) * (180) + rgb_matrix_config.hue; rgb = hsv_to_rgb( hsv ); rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); } @@ -450,10 +452,12 @@ void rgb_matrix_dual_beacon(void) { void rgb_matrix_rainbow_beacon(void) { HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; RGB rgb; - rgb_led led; + Point point; + double cos_value = cos(g_tick * PI / 128); + double sin_value = sin(g_tick * PI / 128); for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.y - 32.0)* cos(g_tick * PI / 128) + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.x - 112.0) * sin(g_tick * PI / 128) + rgb_matrix_config.hue; + point = g_rgb_leds[i].point; + hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.y - 32.0)* cos_value + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.x - 112.0) * sin_value + rgb_matrix_config.hue; rgb = hsv_to_rgb( hsv ); rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); } @@ -462,10 +466,12 @@ void rgb_matrix_rainbow_beacon(void) { void rgb_matrix_rainbow_pinwheels(void) { HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; RGB rgb; - rgb_led led; + Point point; + double cos_value = cos(g_tick * PI / 128); + double sin_value = sin(g_tick * PI / 128); for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - hsv.h = (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.y - 32.0)* cos(g_tick * PI / 128) + (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (66 - abs(led.point.x - 112.0)) * sin(g_tick * PI / 128) + rgb_matrix_config.hue; + point = g_rgb_leds[i].point; + hsv.h = (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.y - 32.0)* cos_value + (2 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (66 - abs(point.x - 112.0)) * sin_value + rgb_matrix_config.hue; rgb = hsv_to_rgb( hsv ); rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); } @@ -474,12 +480,14 @@ void rgb_matrix_rainbow_pinwheels(void) { void rgb_matrix_rainbow_moving_chevron(void) { HSV hsv = { .h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val }; RGB rgb; - rgb_led led; + Point point; + uint8_t r = 128; + double cos_value = cos(r * PI / 128); + double sin_value = sin(r * PI / 128); + double multiplier = (g_tick / 256.0 * 224); for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - // uint8_t r = g_tick; - uint8_t r = 128; - hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * abs(led.point.y - 32.0)* sin(r * PI / 128) + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (led.point.x - (g_tick / 256.0 * 224)) * cos(r * PI / 128) + rgb_matrix_config.hue; + point = g_rgb_leds[i].point; + hsv.h = (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * abs(point.y - 32.0)* sin_value + (1.5 * (rgb_matrix_config.speed == 0 ? 1 : rgb_matrix_config.speed)) * (point.x - multiplier) * cos_value + rgb_matrix_config.hue; rgb = hsv_to_rgb( hsv ); rgb_matrix_set_color( i, rgb.r, rgb.g, rgb.b ); } -- cgit v1.2.3 From ec0297027d5ad180af06d41dbfa351d313fe91e8 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 26 Sep 2018 19:19:38 -0700 Subject: Bugfix for 60_ansi_tsangan and 60_iso_tsangan layouts (#3987) This corrects the matrix macro reference for both of the keymap.c files in layouts/default. --- .../default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c | 12 ++++++------ .../default/60_iso_tsangan/default_60_iso_tsangan/keymap.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c index 8f7f5f8c6f..e4562ede51 100644 --- a/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c +++ b/layouts/default/60_ansi_tsangan/default_60_ansi_tsangan/keymap.c @@ -1,11 +1,11 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_60_ansi( - 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT , - KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , KC_RCTL + [0] = LAYOUT_60_ansi_tsangan( + 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ) }; diff --git a/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c index 204a12d33d..94d7630207 100644 --- a/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c +++ b/layouts/default/60_iso_tsangan/default_60_iso_tsangan/keymap.c @@ -1,11 +1,11 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_60_iso( - KC_ESC, 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_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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTRL, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_RCTL + [0] = LAYOUT_60_iso_tsangan( + KC_ESC, 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_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_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL ) }; -- cgit v1.2.3 From 12ad59f99de0ecd2c81b92587c2858b3fb39523c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 26 Sep 2018 22:09:05 -0700 Subject: Keyboard: Treasure Macropad (#3988) * port macropad over to qmk * add bootloader size --- keyboards/macropad/config.h | 224 +++++++++++++++++++++++++++ keyboards/macropad/info.json | 12 ++ keyboards/macropad/keymaps/default/config.h | 19 +++ keyboards/macropad/keymaps/default/keymap.c | 64 ++++++++ keyboards/macropad/keymaps/default/readme.md | 1 + keyboards/macropad/macropad.c | 43 +++++ keyboards/macropad/macropad.h | 40 +++++ keyboards/macropad/readme.md | 13 ++ keyboards/macropad/rules.mk | 81 ++++++++++ 9 files changed, 497 insertions(+) create mode 100644 keyboards/macropad/config.h create mode 100644 keyboards/macropad/info.json create mode 100644 keyboards/macropad/keymaps/default/config.h create mode 100644 keyboards/macropad/keymaps/default/keymap.c create mode 100644 keyboards/macropad/keymaps/default/readme.md create mode 100644 keyboards/macropad/macropad.c create mode 100644 keyboards/macropad/macropad.h create mode 100644 keyboards/macropad/readme.md create mode 100644 keyboards/macropad/rules.mk diff --git a/keyboards/macropad/config.h b/keyboards/macropad/config.h new file mode 100644 index 0000000000..00f2e78110 --- /dev/null +++ b/keyboards/macropad/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Treasure +#define PRODUCT Macropad Type 9 +#define DESCRIPTION A custom macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6, D7, C6 } +#define MATRIX_COL_PINS { D1, D0, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 10 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/macropad/info.json b/keyboards/macropad/info.json new file mode 100644 index 0000000000..f946ed153e --- /dev/null +++ b/keyboards/macropad/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Macropad", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}] + } + } +} diff --git a/keyboards/macropad/keymaps/default/config.h b/keyboards/macropad/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/macropad/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/macropad/keymaps/default/keymap.c b/keyboards/macropad/keymaps/default/keymap.c new file mode 100644 index 0000000000..300d5b1e4c --- /dev/null +++ b/keyboards/macropad/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_0, KC_1, KC_2, \ + KC_3, KC_4, KC_5, \ + KC_6, KC_7, KC_8 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/macropad/keymaps/default/readme.md b/keyboards/macropad/keymaps/default/readme.md new file mode 100644 index 0000000000..bd3d78af21 --- /dev/null +++ b/keyboards/macropad/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for macropad diff --git a/keyboards/macropad/macropad.c b/keyboards/macropad/macropad.c new file mode 100644 index 0000000000..0219746e12 --- /dev/null +++ b/keyboards/macropad/macropad.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "macropad.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/macropad/macropad.h b/keyboards/macropad/macropad.h new file mode 100644 index 0000000000..94471d7c57 --- /dev/null +++ b/keyboards/macropad/macropad.h @@ -0,0 +1,40 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef MACROPAD_H +#define MACROPAD_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, \ + K20, K21, K22 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { K20, K21, K22 }, \ +} + +#endif diff --git a/keyboards/macropad/readme.md b/keyboards/macropad/readme.md new file mode 100644 index 0000000000..204ec1fd23 --- /dev/null +++ b/keyboards/macropad/readme.md @@ -0,0 +1,13 @@ +# Macropad + +3x3 Macropad. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Treasure Macropad Type-9 +Hardware Availability: [Treasure](http://macropad.co/) + +Make example for this keyboard (after setting up your build environment): + + make macropad: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/macropad/rules.mk b/keyboards/macropad/rules.mk new file mode 100644 index 0000000000..599974d25a --- /dev/null +++ b/keyboards/macropad/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From f70f45ee677a2a39a759052a356e0c5d82e25424 Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Fri, 28 Sep 2018 00:40:18 +1000 Subject: RGB Matrix refactoring to open up for new drivers (#3913) * rgb_matrix: use a driver ops struct This is intended to avoid #ifdef proliferation on adding more drivers, eg. model01, which use different architectures. * rgb_matrix: document driver struct members * rgb_matrix: remove unused LED testing code * rgb_matrix: don't build into IS31x drivers unless being used * rgb_matrix: refactor make config options This ensures that the necessary files are included for any custom RGB_MATRIX_ENABLE value, without having to add entries here for specific boards. This particularly affects model01 because its controller is integrated and won't be used anywhere else, so it's preferable not to put it in common_features.mk. This now validates the value of RGB_MATRIX_ENABLE. It was necessary to fix an error in ergodox_ez rules.mk using the wrong comment separator, yielding an invalid value. * IS31x drivers: don't write the control registers all the time This is only needed when they are changed. This is done in init() and board- or keymap-specific code is free to make further changes. * rgb_matrix: move structs from chip drivers to rgb_matrix_drivers.c This approach is specific to the rgb_matrix functionality, so keep it neatly separated from the raw chip drivers. --- common_features.mk | 24 ++++----- drivers/issi/is31fl3731.c | 1 - drivers/issi/is31fl3733.c | 3 +- keyboards/ergodox_ez/rules.mk | 2 +- quantum/rgb_matrix.c | 113 ++---------------------------------------- quantum/rgb_matrix.h | 17 +++++-- quantum/rgb_matrix_drivers.c | 82 ++++++++++++++++++++++++++++++ 7 files changed, 113 insertions(+), 129 deletions(-) create mode 100644 quantum/rgb_matrix_drivers.c diff --git a/common_features.mk b/common_features.mk index 7af7789808..6c835abde6 100644 --- a/common_features.mk +++ b/common_features.mk @@ -114,37 +114,35 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif -ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) +RGB_MATRIX_ENABLE ?= no +VALID_MATRIX_TYPES := yes IS31FL3731L IS31FL3733L custom +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) +ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) + $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type) +endif OPT_DEFS += -DRGB_MATRIX_ENABLE - OPT_DEFS += -DIS31FL3731 - COMMON_VPATH += $(DRIVER_PATH)/issi - SRC += is31fl3731.c - SRC += i2c_master.c SRC += $(QUANTUM_DIR)/color.c SRC += $(QUANTUM_DIR)/rgb_matrix.c + SRC += $(QUANTUM_DIR)/rgb_matrix_drivers.c CIE1931_CURVE = yes endif +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + RGB_MATRIX_ENABLE = IS31FL3731 +endif + ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3731) - OPT_DEFS += -DRGB_MATRIX_ENABLE OPT_DEFS += -DIS31FL3731 COMMON_VPATH += $(DRIVER_PATH)/issi SRC += is31fl3731.c SRC += i2c_master.c - SRC += $(QUANTUM_DIR)/color.c - SRC += $(QUANTUM_DIR)/rgb_matrix.c - CIE1931_CURVE = yes endif ifeq ($(strip $(RGB_MATRIX_ENABLE)), IS31FL3733) - OPT_DEFS += -DRGB_MATRIX_ENABLE OPT_DEFS += -DIS31FL3733 COMMON_VPATH += $(DRIVER_PATH)/issi SRC += is31fl3733.c SRC += i2c_master.c - SRC += $(QUANTUM_DIR)/color.c - SRC += $(QUANTUM_DIR)/rgb_matrix.c - CIE1931_CURVE = yes endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) diff --git a/drivers/issi/is31fl3731.c b/drivers/issi/is31fl3731.c index 4d0d6b8a5e..c9155f5a37 100644 --- a/drivers/issi/is31fl3731.c +++ b/drivers/issi/is31fl3731.c @@ -268,4 +268,3 @@ void IS31FL3731_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) } } } - diff --git a/drivers/issi/is31fl3733.c b/drivers/issi/is31fl3733.c index 4098b54689..c198ec5174 100644 --- a/drivers/issi/is31fl3733.c +++ b/drivers/issi/is31fl3733.c @@ -24,10 +24,10 @@ #include "wait.h" #endif -#include "is31fl3733.h" #include #include "i2c_master.h" #include "progmem.h" +#include "rgb_matrix.h" // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) @@ -250,4 +250,3 @@ void IS31FL3733_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) } } } - diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk index dfbdba10d6..ef2aefbb9a 100644 --- a/keyboards/ergodox_ez/rules.mk +++ b/keyboards/ergodox_ez/rules.mk @@ -83,6 +83,6 @@ SWAP_HANDS_ENABLE= yes # Allow swapping hands of keyboard SLEEP_LED_ENABLE = no API_SYSEX_ENABLE = no RGBLIGHT_ENABLE = yes -RGB_MATRIX_ENABLE = no // enable later +RGB_MATRIX_ENABLE = no # enable later LAYOUTS = ergodox diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 5fb59af8c0..807e4d62d1 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -18,7 +18,6 @@ #include "rgb_matrix.h" -#include "i2c_master.h" #include "progmem.h" #include "config.h" #include "eeprom.h" @@ -111,29 +110,15 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led_i, uint8_t } void rgb_matrix_update_pwm_buffers(void) { -#ifdef IS31FL3731 - IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); - IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); -#elif defined(IS31FL3733) - IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); - IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); -#endif + rgb_matrix_driver.flush(); } void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef IS31FL3731 - IS31FL3731_set_color( index, red, green, blue ); -#elif defined(IS31FL3733) - IS31FL3733_set_color( index, red, green, blue ); -#endif + rgb_matrix_driver.set_color(index, red, green, blue); } void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { -#ifdef IS31FL3731 - IS31FL3731_set_color_all( red, green, blue ); -#elif defined(IS31FL3733) - IS31FL3733_set_color_all( red, green, blue ); -#endif + rgb_matrix_driver.set_color_all(red, green, blue); } bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { @@ -196,47 +181,6 @@ void rgb_matrix_test(void) { } } -// This tests the LEDs -// Note that it will change the LED control registers -// in the LED drivers, and leave them in an invalid -// state for other backlight effects. -// ONLY USE THIS FOR TESTING LEDS! -void rgb_matrix_single_LED_test(void) { - static uint8_t color = 0; // 0,1,2 for R,G,B - static uint8_t row = 0; - static uint8_t column = 0; - - static uint8_t tick = 0; - tick++; - - if ( tick > 2 ) - { - tick = 0; - column++; - } - if ( column > MATRIX_COLS ) - { - column = 0; - row++; - } - if ( row > MATRIX_ROWS ) - { - row = 0; - color++; - } - if ( color > 2 ) - { - color = 0; - } - - uint8_t led[8], led_count; - map_row_column_to_led(row,column,led,&led_count); - for(uint8_t i = 0; i < led_count; i++) { - rgb_matrix_set_color_all( 40, 40, 40 ); - rgb_matrix_test_led( led[i], color==0, color==1, color==2 ); - } -} - // All LEDs off void rgb_matrix_all_off(void) { rgb_matrix_set_color_all( 0, 0, 0 ); @@ -817,7 +761,7 @@ void rgb_matrix_indicators_user(void) {} // } void rgb_matrix_init(void) { - rgb_matrix_setup_drivers(); + rgb_matrix_driver.init(); // TODO: put the 1 second startup delay here? @@ -841,33 +785,6 @@ void rgb_matrix_init(void) { eeconfig_debug_rgb_matrix(); // display current eeprom values } -void rgb_matrix_setup_drivers(void) { - // Initialize TWI - i2c_init(); -#ifdef IS31FL3731 - IS31FL3731_init( DRIVER_ADDR_1 ); - IS31FL3731_init( DRIVER_ADDR_2 ); -#elif defined (IS31FL3733) - IS31FL3733_init( DRIVER_ADDR_1 ); -#endif - - for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { - bool enabled = true; - // This only caches it for later -#ifdef IS31FL3731 - IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); -#elif defined (IS31FL3733) - IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); -#endif - } - // This actually updates the LED drivers -#ifdef IS31FL3731 - IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); -#elif defined (IS31FL3733) - IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); -#endif -} - // Deals with the messy details of incrementing an integer uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { int16_t new_value = value; @@ -910,28 +827,6 @@ uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { // } // } -void rgb_matrix_test_led( uint8_t index, bool red, bool green, bool blue ) { - for ( int i=0; i. + */ + +#include "rgb_matrix.h" + +/* Each driver needs to define the struct + * const rgb_matrix_driver_t rgb_matrix_driver; + * All members must be provided. + * Keyboard custom drivers can define this in their own files, it should only + * be here if shared between boards. + */ + +#if defined(IS31FL3731) || defined(IS31FL3733) + +#include "i2c_master.h" + +static void init( void ) +{ + i2c_init(); +#ifdef IS31FL3731 + IS31FL3731_init( DRIVER_ADDR_1 ); + IS31FL3731_init( DRIVER_ADDR_2 ); +#else + IS31FL3733_init( DRIVER_ADDR_1 ); +#endif + for ( int index = 0; index < DRIVER_LED_TOTAL; index++ ) { + bool enabled = true; + // This only caches it for later +#ifdef IS31FL3731 + IS31FL3731_set_led_control_register( index, enabled, enabled, enabled ); +#else + IS31FL3733_set_led_control_register( index, enabled, enabled, enabled ); +#endif + } + // This actually updates the LED drivers +#ifdef IS31FL3731 + IS31FL3731_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#else + IS31FL3733_update_led_control_registers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +#endif +} + +#ifdef IS31FL3731 +static void flush( void ) +{ + IS31FL3731_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = IS31FL3731_set_color, + .set_color_all = IS31FL3731_set_color_all, +}; +#else +static void flush( void ) +{ + IS31FL3733_update_pwm_buffers( DRIVER_ADDR_1, DRIVER_ADDR_2 ); +} + +const rgb_matrix_driver_t rgb_matrix_driver = { + .init = init, + .flush = flush, + .set_color = IS31FL3733_set_color, + .set_color_all = IS31FL3733_set_color_all, +}; +#endif + +#endif -- cgit v1.2.3 From 13e166d9c42845e2622605e94d4a0c38fa5443a0 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 28 Sep 2018 00:40:44 +1000 Subject: RAMA U80-A, wilba.tech WT60-A, WT65-A, WT80-A, IS31FL3736 driver (#3925) * Initial commit of RAMA U80-A * Initial commit of RAMA U80-A * Moved IS31FL3736 driver, minor cleanups * Superficial stuff * Review changes * Refactored to use common code. --- drivers/issi/is31fl3736.c | 306 +++++++++++++++++++++ drivers/issi/is31fl3736.h | 172 ++++++++++++ keyboards/rama/readme.md | 2 + keyboards/rama/u80_a/config.h | 187 +++++++++++++ keyboards/rama/u80_a/info.json | 13 + keyboards/rama/u80_a/keymaps/default/keymap.c | 22 ++ keyboards/rama/u80_a/readme.md | 15 + keyboards/rama/u80_a/rules.mk | 68 +++++ keyboards/rama/u80_a/u80_a.c | 17 ++ keyboards/rama/u80_a/u80_a.h | 43 +++ keyboards/wilba_tech/wt60_a/config.h | 187 +++++++++++++ keyboards/wilba_tech/wt60_a/info.json | 16 ++ .../wt60_a/keymaps/ansi_split_bs_rshift/keymap.c | 38 +++ .../wilba_tech/wt60_a/keymaps/default/keymap.c | 38 +++ keyboards/wilba_tech/wt60_a/readme.md | 15 + keyboards/wilba_tech/wt60_a/rules.mk | 68 +++++ keyboards/wilba_tech/wt60_a/wt60_a.c | 17 ++ keyboards/wilba_tech/wt60_a/wt60_a.h | 52 ++++ keyboards/wilba_tech/wt65_a/config.h | 187 +++++++++++++ keyboards/wilba_tech/wt65_a/info.json | 13 + .../wilba_tech/wt65_a/keymaps/default/keymap.c | 37 +++ keyboards/wilba_tech/wt65_a/readme.md | 15 + keyboards/wilba_tech/wt65_a/rules.mk | 68 +++++ keyboards/wilba_tech/wt65_a/wt65_a.c | 17 ++ keyboards/wilba_tech/wt65_a/wt65_a.h | 41 +++ keyboards/wilba_tech/wt80_a/config.h | 187 +++++++++++++ keyboards/wilba_tech/wt80_a/info.json | 13 + .../wilba_tech/wt80_a/keymaps/default/keymap.c | 22 ++ keyboards/wilba_tech/wt80_a/readme.md | 15 + keyboards/wilba_tech/wt80_a/rules.mk | 68 +++++ keyboards/wilba_tech/wt80_a/wt80_a.c | 17 ++ keyboards/wilba_tech/wt80_a/wt80_a.h | 43 +++ keyboards/wilba_tech/wt_main.c | 55 ++++ keyboards/wilba_tech/wt_mono_backlight.c | 116 ++++++++ keyboards/wilba_tech/wt_mono_backlight.h | 33 +++ 35 files changed, 2223 insertions(+) create mode 100644 drivers/issi/is31fl3736.c create mode 100644 drivers/issi/is31fl3736.h create mode 100644 keyboards/rama/u80_a/config.h create mode 100644 keyboards/rama/u80_a/info.json create mode 100644 keyboards/rama/u80_a/keymaps/default/keymap.c create mode 100644 keyboards/rama/u80_a/readme.md create mode 100644 keyboards/rama/u80_a/rules.mk create mode 100644 keyboards/rama/u80_a/u80_a.c create mode 100644 keyboards/rama/u80_a/u80_a.h create mode 100644 keyboards/wilba_tech/wt60_a/config.h create mode 100644 keyboards/wilba_tech/wt60_a/info.json create mode 100644 keyboards/wilba_tech/wt60_a/keymaps/ansi_split_bs_rshift/keymap.c create mode 100644 keyboards/wilba_tech/wt60_a/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt60_a/readme.md create mode 100644 keyboards/wilba_tech/wt60_a/rules.mk create mode 100644 keyboards/wilba_tech/wt60_a/wt60_a.c create mode 100644 keyboards/wilba_tech/wt60_a/wt60_a.h create mode 100644 keyboards/wilba_tech/wt65_a/config.h create mode 100644 keyboards/wilba_tech/wt65_a/info.json create mode 100644 keyboards/wilba_tech/wt65_a/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt65_a/readme.md create mode 100644 keyboards/wilba_tech/wt65_a/rules.mk create mode 100644 keyboards/wilba_tech/wt65_a/wt65_a.c create mode 100644 keyboards/wilba_tech/wt65_a/wt65_a.h create mode 100644 keyboards/wilba_tech/wt80_a/config.h create mode 100644 keyboards/wilba_tech/wt80_a/info.json create mode 100644 keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt80_a/readme.md create mode 100644 keyboards/wilba_tech/wt80_a/rules.mk create mode 100644 keyboards/wilba_tech/wt80_a/wt80_a.c create mode 100644 keyboards/wilba_tech/wt80_a/wt80_a.h create mode 100644 keyboards/wilba_tech/wt_main.c create mode 100644 keyboards/wilba_tech/wt_mono_backlight.c create mode 100644 keyboards/wilba_tech/wt_mono_backlight.h diff --git a/drivers/issi/is31fl3736.c b/drivers/issi/is31fl3736.c new file mode 100644 index 0000000000..c5d4310971 --- /dev/null +++ b/drivers/issi/is31fl3736.c @@ -0,0 +1,306 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + + +#ifdef __AVR__ +#include +#include +#include +#else +#include "wait.h" +#endif + +#include "is31fl3736.h" +#include +#include "i2c_master.h" +#include "progmem.h" + + + +// This is a 7-bit address, that gets left-shifted and bit 0 +// set to 0 for write, 1 for read (as per I2C protocol) +// The address will vary depending on your wiring: +// 00 <-> GND +// 01 <-> SCL +// 10 <-> SDA +// 11 <-> VCC +// ADDR1 represents A1:A0 of the 7-bit address. +// ADDR2 represents A3:A2 of the 7-bit address. +// The result is: 0b101(ADDR2)(ADDR1) +#define ISSI_ADDR_DEFAULT 0x50 + +#define ISSI_COMMANDREGISTER 0xFD +#define ISSI_COMMANDREGISTER_WRITELOCK 0xFE +#define ISSI_INTERRUPTMASKREGISTER 0xF0 +#define ISSI_INTERRUPTSTATUSREGISTER 0xF1 + +#define ISSI_PAGE_LEDCONTROL 0x00 //PG0 +#define ISSI_PAGE_PWM 0x01 //PG1 +#define ISSI_PAGE_AUTOBREATH 0x02 //PG2 +#define ISSI_PAGE_FUNCTION 0x03 //PG3 + +#define ISSI_REG_CONFIGURATION 0x00 //PG3 +#define ISSI_REG_GLOBALCURRENT 0x01 //PG3 +#define ISSI_REG_RESET 0x11// PG3 +#define ISSI_REG_SWPULLUP 0x0F //PG3 +#define ISSI_REG_CSPULLUP 0x10 //PG3 + +#ifndef ISSI_TIMEOUT + #define ISSI_TIMEOUT 100 +#endif + +#ifndef ISSI_PERSISTENCE + #define ISSI_PERSISTENCE 0 +#endif + +// Transfer buffer for TWITransmitData() +uint8_t g_twi_transfer_buffer[20]; + +// These buffers match the IS31FL3736 PWM registers. +// The control buffers match the PG0 LED On/Off registers. +// Storing them like this is optimal for I2C transfers to the registers. +// We could optimize this and take out the unused registers from these +// buffers and the transfers in IS31FL3736_write_pwm_buffer() but it's +// probably not worth the extra complexity. +uint8_t g_pwm_buffer[DRIVER_COUNT][192]; +bool g_pwm_buffer_update_required = false; + +uint8_t g_led_control_registers[DRIVER_COUNT][24] = { { 0 }, { 0 } }; +bool g_led_control_registers_update_required = false; + +void IS31FL3736_write_register( uint8_t addr, uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); + #endif +} + +void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ) +{ + // assumes PG1 is already selected + + // transmit PWM registers in 12 transfers of 16 bytes + // g_twi_transfer_buffer[] is 20 bytes + + // iterate over the pwm_buffer contents at 16 byte intervals + for ( int i = 0; i < 192; i += 16 ) { + g_twi_transfer_buffer[0] = i; + // copy the data from i to i+15 + // device will auto-increment register for data after the first byte + // thus this sets registers 0x00-0x0F, 0x10-0x1F, etc. in one transfer + for ( int j = 0; j < 16; j++ ) { + g_twi_transfer_buffer[1 + j] = pwm_buffer[i + j]; + } + + #if ISSI_PERSISTENCE > 0 + for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) { + if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) + break; + } + #else + i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT); + #endif + } +} + +void IS31FL3736_init( uint8_t addr ) +{ + // In order to avoid the LEDs being driven with garbage data + // in the LED driver's PWM registers, shutdown is enabled last. + // Set up the mode and other settings, clear the PWM registers, + // then disable software shutdown. + + // Unlock the command register. + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG0 + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + // Turn off all LEDs. + for ( int i = 0x00; i <= 0x17; i++ ) + { + IS31FL3736_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG1 + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + // Set PWM on all LEDs to 0 + // No need to setup Breath registers to PWM as that is the default. + for ( int i = 0x00; i <= 0xBF; i++ ) + { + IS31FL3736_write_register( addr, i, 0x00 ); + } + + // Unlock the command register. + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + + // Select PG3 + IS31FL3736_write_register( addr, ISSI_COMMANDREGISTER, ISSI_PAGE_FUNCTION ); + // Set global current to maximum. + IS31FL3736_write_register( addr, ISSI_REG_GLOBALCURRENT, 0xFF ); + // Disable software shutdown. + IS31FL3736_write_register( addr, ISSI_REG_CONFIGURATION, 0x01 ); + + // Wait 10ms to ensure the device has woken up. + #ifdef __AVR__ + _delay_ms( 10 ); + #else + wait_ms(10); + #endif +} + +void IS31FL3736_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + if ( index >= 0 && index < DRIVER_LED_TOTAL ) { + is31_led led = g_is31_leds[index]; + + g_pwm_buffer[led.driver][led.r] = red; + g_pwm_buffer[led.driver][led.g] = green; + g_pwm_buffer[led.driver][led.b] = blue; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3736_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < DRIVER_LED_TOTAL; i++ ) + { + IS31FL3736_set_color( i, red, green, blue ); + } +} + +void IS31FL3736_set_led_control_register( uint8_t index, bool red, bool green, bool blue ) +{ + is31_led led = g_is31_leds[index]; + + // IS31FL3733 + // The PWM register for a matrix position (0x00 to 0xBF) can be + // divided by 8 to get the LED control register (0x00 to 0x17), + // then mod 8 to get the bit position within that register. + + // IS31FL3736 + // The PWM register for a matrix position (0x00 to 0xBF) is interleaved, so: + // A1=0x00 A2=0x02 A3=0x04 A4=0x06 A5=0x08 A6=0x0A A7=0x0C A8=0x0E + // B1=0x10 B2=0x12 B3=0x14 + // But also, the LED control registers (0x00 to 0x17) are also interleaved, so: + // A1-A4=0x00 A5-A8=0x01 + // So, the same math applies. + + uint8_t control_register_r = led.r / 8; + uint8_t control_register_g = led.g / 8; + uint8_t control_register_b = led.b / 8; + + uint8_t bit_r = led.r % 8; + uint8_t bit_g = led.g % 8; + uint8_t bit_b = led.b % 8; + + if ( red ) { + g_led_control_registers[led.driver][control_register_r] |= (1 << bit_r); + } else { + g_led_control_registers[led.driver][control_register_r] &= ~(1 << bit_r); + } + if ( green ) { + g_led_control_registers[led.driver][control_register_g] |= (1 << bit_g); + } else { + g_led_control_registers[led.driver][control_register_g] &= ~(1 << bit_g); + } + if ( blue ) { + g_led_control_registers[led.driver][control_register_b] |= (1 << bit_b); + } else { + g_led_control_registers[led.driver][control_register_b] &= ~(1 << bit_b); + } + + g_led_control_registers_update_required = true; + +} + +void IS31FL3736_mono_set_brightness( int index, uint8_t value ) +{ + if ( index >= 0 && index < 96 ) { + // Index in range 0..95 -> A1..A8, B1..B8, etc. + // Map index 0..95 to registers 0x00..0xBE (interleaved) + uint8_t pwm_register = index * 2; + g_pwm_buffer[0][pwm_register] = value; + g_pwm_buffer_update_required = true; + } +} + +void IS31FL3736_mono_set_brightness_all( uint8_t value ) +{ + for ( int i = 0; i < 96; i++ ) + { + IS31FL3736_mono_set_brightness( i, value ); + } +} + +void IS31FL3736_mono_set_led_control_register( uint8_t index, bool enabled ) +{ + // Index in range 0..95 -> A1..A8, B1..B8, etc. + + // Map index 0..95 to registers 0x00..0xBE (interleaved) + uint8_t pwm_register = index * 2; + // Map register 0x00..0xBE (interleaved) into control register and bit + uint8_t control_register = pwm_register / 8; + uint8_t bit = pwm_register % 8; + + if ( enabled ) { + g_led_control_registers[0][control_register] |= (1 << bit); + } else { + g_led_control_registers[0][control_register] &= ~(1 << bit); + } + + g_led_control_registers_update_required = true; +} + +void IS31FL3736_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_pwm_buffer_update_required ) + { + // Firstly we need to unlock the command register and select PG1 + IS31FL3736_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3736_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM ); + + IS31FL3736_write_pwm_buffer( addr1, g_pwm_buffer[0] ); + //IS31FL3736_write_pwm_buffer( addr2, g_pwm_buffer[1] ); + } + g_pwm_buffer_update_required = false; +} + +void IS31FL3736_update_led_control_registers( uint8_t addr1, uint8_t addr2 ) +{ + if ( g_led_control_registers_update_required ) + { + // Firstly we need to unlock the command register and select PG0 + IS31FL3736_write_register( addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5 ); + IS31FL3736_write_register( addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL ); + for ( int i=0; i<24; i++ ) + { + IS31FL3736_write_register(addr1, i, g_led_control_registers[0][i] ); + //IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i] ); + } + } +} + diff --git a/drivers/issi/is31fl3736.h b/drivers/issi/is31fl3736.h new file mode 100644 index 0000000000..cff50fd0d8 --- /dev/null +++ b/drivers/issi/is31fl3736.h @@ -0,0 +1,172 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include +#include + + +// Simple interface option. +// If these aren't defined, just define them to make it compile + + +#ifndef DRIVER_COUNT +#define DRIVER_COUNT 2 +#endif + +#ifndef DRIVER_LED_TOTAL +#define DRIVER_LED_TOTAL 96 +#endif + + +typedef struct is31_led { + uint8_t driver:2; + uint8_t r; + uint8_t g; + uint8_t b; +} __attribute__((packed)) is31_led; + +extern const is31_led g_is31_leds[DRIVER_LED_TOTAL]; + +void IS31FL3736_init( uint8_t addr ); +void IS31FL3736_write_register( uint8_t addr, uint8_t reg, uint8_t data ); +void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer ); + +void IS31FL3736_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3736_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); + +void IS31FL3736_set_led_control_register( uint8_t index, bool red, bool green, bool blue ); + +void IS31FL3736_mono_set_brightness( int index, uint8_t value ); +void IS31FL3736_mono_set_brightness_all( uint8_t value ); +void IS31FL3736_mono_set_led_control_register( uint8_t index, bool enabled ); + +// This should not be called from an interrupt +// (eg. from a timer interrupt). +// Call this while idle (in between matrix scans). +// If the buffer is dirty, it will update the driver with the buffer. +void IS31FL3736_update_pwm_buffers( uint8_t addr1, uint8_t addr2 ); +void IS31FL3736_update_led_control_registers( uint8_t addr1, uint8_t addr2 ); + +#define A_1 0x00 +#define A_2 0x02 +#define A_3 0x04 +#define A_4 0x06 +#define A_5 0x08 +#define A_6 0x0A +#define A_7 0x0C +#define A_8 0x0E + +#define B_1 0x10 +#define B_2 0x12 +#define B_3 0x14 +#define B_4 0x16 +#define B_5 0x18 +#define B_6 0x1A +#define B_7 0x1C +#define B_8 0x1E + +#define C_1 0x20 +#define C_2 0x22 +#define C_3 0x24 +#define C_4 0x26 +#define C_5 0x28 +#define C_6 0x2A +#define C_7 0x2C +#define C_8 0x2E + +#define D_1 0x30 +#define D_2 0x32 +#define D_3 0x34 +#define D_4 0x36 +#define D_5 0x38 +#define D_6 0x3A +#define D_7 0x3C +#define D_8 0x3E + +#define E_1 0x40 +#define E_2 0x42 +#define E_3 0x44 +#define E_4 0x46 +#define E_5 0x48 +#define E_6 0x4A +#define E_7 0x4C +#define E_8 0x4E + +#define F_1 0x50 +#define F_2 0x52 +#define F_3 0x54 +#define F_4 0x56 +#define F_5 0x58 +#define F_6 0x5A +#define F_7 0x5C +#define F_8 0x5E + +#define G_1 0x60 +#define G_2 0x62 +#define G_3 0x64 +#define G_4 0x66 +#define G_5 0x68 +#define G_6 0x6A +#define G_7 0x6C +#define G_8 0x6E + +#define H_1 0x70 +#define H_2 0x72 +#define H_3 0x74 +#define H_4 0x76 +#define H_5 0x78 +#define H_6 0x7A +#define H_7 0x7C +#define H_8 0x7E + +#define I_1 0x80 +#define I_2 0x82 +#define I_3 0x84 +#define I_4 0x86 +#define I_5 0x88 +#define I_6 0x8A +#define I_7 0x8C +#define I_8 0x8E + +#define J_1 0x90 +#define J_2 0x92 +#define J_3 0x94 +#define J_4 0x96 +#define J_5 0x98 +#define J_6 0x9A +#define J_7 0x9C +#define J_8 0x9E + +#define K_1 0xA0 +#define K_2 0xA2 +#define K_3 0xA4 +#define K_4 0xA6 +#define K_5 0xA8 +#define K_6 0xAA +#define K_7 0xAC +#define K_8 0xAE + +#define L_1 0xB0 +#define L_2 0xB2 +#define L_3 0xB4 +#define L_4 0xB6 +#define L_5 0xB8 +#define L_6 0xBA +#define L_7 0xBC +#define L_8 0xBE + diff --git a/keyboards/rama/readme.md b/keyboards/rama/readme.md index 4625eb1ef5..c7ddf6d111 100644 --- a/keyboards/rama/readme.md +++ b/keyboards/rama/readme.md @@ -6,4 +6,6 @@ Firmware for keyboards designed by [RAMA WORKS](https://rama.works) [RAMA M60-A](https://rama.works/#/m60-a/) +[RAMA U80-A](https://rama.works/#/tkl-a/) + [RAMA M10-B](https://www.massdrop.com/buy/rama-m10-a?mode=guest_open) diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h new file mode 100644 index 0000000000..bfd9728283 --- /dev/null +++ b/keyboards/rama/u80_a/config.h @@ -0,0 +1,187 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x080A // 80-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA U80-A +#define DESCRIPTION RAMA U80-A Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + diff --git a/keyboards/rama/u80_a/info.json b/keyboards/rama/u80_a/info.json new file mode 100644 index 0000000000..cb61c89b88 --- /dev/null +++ b/keyboards/rama/u80_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "RAMA U80-A", + "url": "https://rama.works/#/tkl-a/", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/rama/u80_a/keymaps/default/keymap.c b/keyboards/rama/u80_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..cf9225e3e5 --- /dev/null +++ b/keyboards/rama/u80_a/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + diff --git a/keyboards/rama/u80_a/readme.md b/keyboards/rama/u80_a/readme.md new file mode 100644 index 0000000000..c98d00cb6b --- /dev/null +++ b/keyboards/rama/u80_a/readme.md @@ -0,0 +1,15 @@ +# RAMA U80-A + +![RAMA U80-A](https://something.com/something.jpg) + +A TKL keyboard. [More info at RAMA WORKS](https://rama.works/#/tkl-a/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA U80-A PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/u80_a: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). \ No newline at end of file diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk new file mode 100644 index 0000000000..99224c247c --- /dev/null +++ b/keyboards/rama/u80_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +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 + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 diff --git a/keyboards/rama/u80_a/u80_a.c b/keyboards/rama/u80_a/u80_a.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/rama/u80_a/u80_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/rama/u80_a/u80_a.h b/keyboards/rama/u80_a/u80_a.h new file mode 100644 index 0000000000..26403ef347 --- /dev/null +++ b/keyboards/rama/u80_a/u80_a.h @@ -0,0 +1,43 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 3,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 18 columns, +// so the numbering goes 00 to 16. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K313, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ +} + diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h new file mode 100644 index 0000000000..95f4c786e6 --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -0,0 +1,187 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x060A // 60-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT60-A +#define DESCRIPTION wilba.tech WT60-A + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + diff --git a/keyboards/wilba_tech/wt60_a/info.json b/keyboards/wilba_tech/wt60_a/info.json new file mode 100644 index 0000000000..3b3614a8bf --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "wilba.tech WT60-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/keymaps/ansi_split_bs_rshift/keymap.c b/keyboards/wilba_tech/wt60_a/keymaps/ansi_split_bs_rshift/keymap.c new file mode 100644 index 0000000000..95e01fc2ca --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/keymaps/ansi_split_bs_rshift/keymap.c @@ -0,0 +1,38 @@ +// ANSI split backspace/right shift layout for WT60-A +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_ansi_split_bs_rshift( + KC_ESC, 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_BSLS, KC_DEL, + 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_BSPC, + 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_ansi_split_bs_rshift( + KC_GRV, 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_ansi_split_bs_rshift( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer +[3] = LAYOUT_60_ansi_split_bs_rshift( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/wilba_tech/wt60_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt60_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..566736f5e3 --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/keymaps/default/keymap.c @@ -0,0 +1,38 @@ +// Default layout for WT60-A +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// Default layer +[0] = LAYOUT_60_ansi( + KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + +// Fn1 Layer +[1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL , + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn2 Layer +[2] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +// Fn3 Layer +[3] = LAYOUT_60_ansi( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; diff --git a/keyboards/wilba_tech/wt60_a/readme.md b/keyboards/wilba_tech/wt60_a/readme.md new file mode 100644 index 0000000000..d7a73165d4 --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/readme.md @@ -0,0 +1,15 @@ +# WILBA.TECH WT60-A + +![WILBA.TECH WT60-A](https://wilba.tech) + +WT60-A is a keyboard PCB supporting 60% layout. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: WILBA.TECH WT65-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt60_a: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). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/rules.mk b/keyboards/wilba_tech/wt60_a/rules.mk new file mode 100644 index 0000000000..99224c247c --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +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 + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 diff --git a/keyboards/wilba_tech/wt60_a/wt60_a.c b/keyboards/wilba_tech/wt60_a/wt60_a.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/wt60_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt60_a/wt60_a.h b/keyboards/wilba_tech/wt60_a/wt60_a.h new file mode 100644 index 0000000000..8ac8d92167 --- /dev/null +++ b/keyboards/wilba_tech/wt60_a/wt60_a.h @@ -0,0 +1,52 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT_60_ansi_split_bs_rshift( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, \ + K400, K401, K402, K406, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, K412, K413 } \ +} + +#define LAYOUT_60_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K401, K402, K406, K410, K411, K412, K413 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, ____ }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, ____ }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, K412, K413 } \ +} + + + diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h new file mode 100644 index 0000000000..fa919f186b --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -0,0 +1,187 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x065A // 65-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT65-A +#define DESCRIPTION wilba.tech WT65-A + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + diff --git a/keyboards/wilba_tech/wt65_a/info.json b/keyboards/wilba_tech/wt65_a/info.json new file mode 100644 index 0000000000..f2b18dadd1 --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT65-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Home", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Fn", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt65_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..c5ae811680 --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT_all( + KC_ESC, 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_BSPC, KC_HOME, + 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_PGUP, + 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_PGDN, + KC_LSFT, 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_END, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT_all( + KC_GRV, 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_DEL, KC_DEL, KC_TRNS, + KC_CAPS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_END, KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn2 Layer + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + // Fn3 Layer + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + diff --git a/keyboards/wilba_tech/wt65_a/readme.md b/keyboards/wilba_tech/wt65_a/readme.md new file mode 100644 index 0000000000..1551b55b57 --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/readme.md @@ -0,0 +1,15 @@ +# WILBA.TECH WT65-A + +![WILBA.TECH WT65-A](https://wilba.tech) + +WT65-A is a keyboard PCB supporting 65% layout with 0.25U blocker. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: WILBA.TECH WT65-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt65_a: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). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_a/rules.mk b/keyboards/wilba_tech/wt65_a/rules.mk new file mode 100644 index 0000000000..99224c247c --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +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 + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 diff --git a/keyboards/wilba_tech/wt65_a/wt65_a.c b/keyboards/wilba_tech/wt65_a/wt65_a.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/wt65_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt65_a/wt65_a.h b/keyboards/wilba_tech/wt65_a/wt65_a.h new file mode 100644 index 0000000000..9c3e6e12be --- /dev/null +++ b/keyboards/wilba_tech/wt65_a/wt65_a.h @@ -0,0 +1,41 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 2,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 16 columns, +// so the numbering goes 00 to 14. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K213, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ + K400, K401, K402, K406, K410, K411, K412, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ + { K300, ____, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ + { K400, K401, K402, ____, ____, ____, K406, ____, ____, ____, K410, K411, K412, K413, K414 } \ +} + diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h new file mode 100644 index 0000000000..9687cb6d68 --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -0,0 +1,187 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x080A // 80-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT80-A +#define DESCRIPTION wilba.tech WT80-A + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F1, F0, E6, F4, F6, F7 } +#define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6, D4, B7, B0 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION ROW2COL + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + diff --git a/keyboards/wilba_tech/wt80_a/info.json b/keyboards/wilba_tech/wt80_a/info.json new file mode 100644 index 0000000000..a43acb2f5a --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT80-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"PrtSc", "x":15.25, "y":0}, {"label":"Scroll Lock", "x":16.25, "y":0}, {"label":"Pause", "x":17.25, "y":0}, {"label":"~", "x":0, "y":1.5}, {"label":"!", "x":1, "y":1.5}, {"label":"@", "x":2, "y":1.5}, {"label":"#", "x":3, "y":1.5}, {"label":"$", "x":4, "y":1.5}, {"label":"%", "x":5, "y":1.5}, {"label":"^", "x":6, "y":1.5}, {"label":"&", "x":7, "y":1.5}, {"label":"*", "x":8, "y":1.5}, {"label":"(", "x":9, "y":1.5}, {"label":")", "x":10, "y":1.5}, {"label":"_", "x":11, "y":1.5}, {"label":"+", "x":12, "y":1.5}, {"label":"Backspace", "x":13, "y":1.5}, {"x":14, "y":1.5}, {"label":"Insert", "x":15.25, "y":1.5}, {"label":"Home", "x":16.25, "y":1.5}, {"label":"PgUp", "x":17.25, "y":1.5}, {"label":"Tab", "x":0, "y":2.5, "w":1.5}, {"label":"Q", "x":1.5, "y":2.5}, {"label":"W", "x":2.5, "y":2.5}, {"label":"E", "x":3.5, "y":2.5}, {"label":"R", "x":4.5, "y":2.5}, {"label":"T", "x":5.5, "y":2.5}, {"label":"Y", "x":6.5, "y":2.5}, {"label":"U", "x":7.5, "y":2.5}, {"label":"I", "x":8.5, "y":2.5}, {"label":"O", "x":9.5, "y":2.5}, {"label":"P", "x":10.5, "y":2.5}, {"label":"{", "x":11.5, "y":2.5}, {"label":"}", "x":12.5, "y":2.5}, {"label":"|", "x":13.5, "y":2.5, "w":1.5}, {"label":"Delete", "x":15.25, "y":2.5}, {"label":"End", "x":16.25, "y":2.5}, {"label":"PgDn", "x":17.25, "y":2.5}, {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, {"label":"F", "x":4.75, "y":3.5}, {"label":"G", "x":5.75, "y":3.5}, {"label":"H", "x":6.75, "y":3.5}, {"label":"J", "x":7.75, "y":3.5}, {"label":"K", "x":8.75, "y":3.5}, {"label":"L", "x":9.75, "y":3.5}, {"label":":", "x":10.75, "y":3.5}, {"label":"\"", "x":11.75, "y":3.5}, {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, {"label":"Shift", "x":0, "y":4.5, "w":2.25}, {"label":"Z", "x":2.25, "y":4.5}, {"label":"X", "x":3.25, "y":4.5}, {"label":"C", "x":4.25, "y":4.5}, {"label":"V", "x":5.25, "y":4.5}, {"label":"B", "x":6.25, "y":4.5}, {"label":"N", "x":7.25, "y":4.5}, {"label":"M", "x":8.25, "y":4.5}, {"label":"<", "x":9.25, "y":4.5}, {"label":">", "x":10.25, "y":4.5}, {"label":"?", "x":11.25, "y":4.5}, {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"label":"\u2191", "x":16.25, "y":4.5}, {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"label":"Alt", "x":10, "y":5.5, "w":1.25}, {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, {"label":"\u2190", "x":15.25, "y":5.5}, {"label":"\u2193", "x":16.25, "y":5.5}, {"label":"\u2192", "x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..cf9225e3e5 --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_all( + 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [1] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + diff --git a/keyboards/wilba_tech/wt80_a/readme.md b/keyboards/wilba_tech/wt80_a/readme.md new file mode 100644 index 0000000000..011805748f --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/readme.md @@ -0,0 +1,15 @@ +# WILBA.TECH WT80-A + +![WILBA.TECH WT80-A](https://wilba./tech) + +WT80-A is a keyboard PCB supporting TKL layout with 0.25U gaps. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: WILBA.TECH WT80-A +Hardware Availability: Custom keyboard group buys + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt80_a: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). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt80_a/rules.mk b/keyboards/wilba_tech/wt80_a/rules.mk new file mode 100644 index 0000000000..99224c247c --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = drivers/issi/is31fl3736.c \ + drivers/avr/i2c_master.c \ + keyboards/wilba_tech/wt_mono_backlight.c \ + keyboards/wilba_tech/wt_main.c + +# MCU name +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 + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 diff --git a/keyboards/wilba_tech/wt80_a/wt80_a.c b/keyboards/wilba_tech/wt80_a/wt80_a.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/wt80_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt80_a/wt80_a.h b/keyboards/wilba_tech/wt80_a/wt80_a.h new file mode 100644 index 0000000000..26403ef347 --- /dev/null +++ b/keyboards/wilba_tech/wt80_a/wt80_a.h @@ -0,0 +1,43 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +#define ____ KC_NO + +// Right switch of split backspace is at 3,13 and is the only switch +// whose physical position doesn't match switch matrix position :-( +// However, it also makes no sense to view the physical as 18 columns, +// so the numbering goes 00 to 16. Deal with it. + +#define LAYOUT_all( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K313, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ +} + diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c new file mode 100644 index 0000000000..f514dbefcd --- /dev/null +++ b/keyboards/wilba_tech/wt_main.c @@ -0,0 +1,55 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +#include "quantum.h" +#include "keyboards/wilba_tech/wt_mono_backlight.h" + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc (matrix 0,0) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + if ( matrix_get_row(0) & (1<<0) ) { + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); + // Jump to bootloader. + bootloader_jump(); + } +} + +void matrix_init_kb(void) +{ + bootmagic_lite(); + backlight_init_drivers(); + backlight_timer_init(); + backlight_timer_enable(); + matrix_init_user(); +} + +void matrix_scan_kb(void) +{ + backlight_update_pwm_buffers(); + matrix_scan_user(); +} diff --git a/keyboards/wilba_tech/wt_mono_backlight.c b/keyboards/wilba_tech/wt_mono_backlight.c new file mode 100644 index 0000000000..bf485bce1f --- /dev/null +++ b/keyboards/wilba_tech/wt_mono_backlight.c @@ -0,0 +1,116 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +#include "wt_mono_backlight.h" +#include "drivers/avr/i2c_master.h" +#include "drivers/issi/is31fl3736.h" + +#include + +#define ISSI_ADDR_DEFAULT 0x50 + +bool g_suspend_state = false; + +// Global tick at 20 Hz +uint32_t g_tick = 0; +uint8_t g_config_effect_speed = 0; +uint8_t g_config_brightness = 255; + +void backlight_init_drivers(void) +{ + // Initialize I2C + i2c_init(); + IS31FL3736_init( ISSI_ADDR_DEFAULT ); + + for ( uint8_t index = 0; index < 96; index++ ) { + IS31FL3736_mono_set_led_control_register( index, true ); + } + IS31FL3736_update_led_control_registers( ISSI_ADDR_DEFAULT, 0x00 ); +} + + +// This is (F_CPU/1024) / 20 Hz +// = 15625 Hz / 20 Hz +// = 781 +#define TIMER3_TOP 781 + +void backlight_timer_init(void) +{ + static uint8_t backlight_timer_is_init = 0; + if ( backlight_timer_is_init ) { + return; + } + backlight_timer_is_init = 1; + + // Timer 3 setup + TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP + _BV(CS32) | _BV(CS30); // prescale by /1024 + // Set TOP value + uint8_t sreg = SREG; + cli(); + + OCR3AH = (TIMER3_TOP >> 8) & 0xff; + OCR3AL = TIMER3_TOP & 0xff; + SREG = sreg; +} + +void backlight_timer_enable(void) +{ + TIMSK3 |= _BV(OCIE3A); +} + +void backlight_timer_disable(void) +{ + TIMSK3 &= ~_BV(OCIE3A); +} + +void backlight_set_suspend_state(bool state) +{ + g_suspend_state = state; +} + +void backlight_effect_cycle_all(void) +{ + uint8_t offset = ( g_tick << g_config_effect_speed ) & 0xFF; + + backlight_set_brightness_all( offset ); +} + +ISR(TIMER3_COMPA_vect) +{ + // delay 1 second before driving LEDs or doing anything else + static uint8_t startup_tick = 0; + if ( startup_tick < 20 ) { + startup_tick++; + return; + } + + g_tick++; + + //backlight_effect_cycle_all(); + backlight_set_brightness_all( 255 ); +} + +void backlight_update_pwm_buffers(void) +{ + IS31FL3736_update_pwm_buffers(ISSI_ADDR_DEFAULT,0x00); +} + +void backlight_set_brightness_all( uint8_t value ) +{ + IS31FL3736_mono_set_brightness_all( value ); +} + diff --git a/keyboards/wilba_tech/wt_mono_backlight.h b/keyboards/wilba_tech/wt_mono_backlight.h new file mode 100644 index 0000000000..70031bedc7 --- /dev/null +++ b/keyboards/wilba_tech/wt_mono_backlight.h @@ -0,0 +1,33 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include +#include + +void backlight_init_drivers(void); + +void backlight_timer_init(void); +void backlight_timer_enable(void); +void backlight_timer_disable(void); + +void backlight_set_suspend_state(bool state); + +void backlight_update_pwm_buffers(void); + +void backlight_set_brightness_all( uint8_t value ); + -- cgit v1.2.3 From 8b2591c707abe670dbd1ab21237870bc989d0614 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Thu, 27 Sep 2018 19:47:26 +0100 Subject: Keymap: Clean-up of dshields keymaps. (#3983) --- keyboards/model01/keymaps/dshields/config.h | 3 -- keyboards/model01/keymaps/dshields/rules.mk | 3 +- keyboards/planck/keymaps/dshields/config.h | 15 +--------- keyboards/planck/keymaps/dshields/keymap.c | 44 ----------------------------- 4 files changed, 2 insertions(+), 63 deletions(-) diff --git a/keyboards/model01/keymaps/dshields/config.h b/keyboards/model01/keymaps/dshields/config.h index 86a4dd5314..4d609e4368 100644 --- a/keyboards/model01/keymaps/dshields/config.h +++ b/keyboards/model01/keymaps/dshields/config.h @@ -1,8 +1,5 @@ #pragma once -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 3000 diff --git a/keyboards/model01/keymaps/dshields/rules.mk b/keyboards/model01/keymaps/dshields/rules.mk index 4d1abd88ad..6c605daecf 100644 --- a/keyboards/model01/keymaps/dshields/rules.mk +++ b/keyboards/model01/keymaps/dshields/rules.mk @@ -1,2 +1 @@ -# used by default keymap -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = yes diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index 9ba854ef04..b149530b8d 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -1,15 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define QMK_ESC_OUTPUT F1 -#define QMK_ESC_INPUT D5 -#define QMK_LED E6 -#define QMK_SPEAKER C6 - -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#pragma once #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 @@ -39,5 +28,3 @@ // mod-tap keys #define MT_SPC SFT_T(KC_SPC) -#endif - diff --git a/keyboards/planck/keymaps/dshields/keymap.c b/keyboards/planck/keymaps/dshields/keymap.c index a39dc5e776..11abaa6b07 100644 --- a/keyboards/planck/keymaps/dshields/keymap.c +++ b/keyboards/planck/keymaps/dshields/keymap.c @@ -17,68 +17,24 @@ enum planck_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE }; #endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Default - * ,-----------------------------------------------------------------------------------. - * | Q | W | E | R | T | Esc | Bksp | Y | U | I | O | P | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | A | S | D | F | G | Tab | Enter| H | J | K | L | ; | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Z | X | C | V | B | Shift|DmPlay| N | M | , | . | / | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | Super| Alt | Fun | Lower| Space | Raise| Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ [DEF] = LAYOUT_planck_grid( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_BSPC, KC_Y, KC_U, KC_I, KC_O, KC_P , KC_A, KC_S, KC_D, KC_F, KC_G, KC_TAB, KC_ENT, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_Z, KC_X, KC_C, KC_V, KC_B, OSM_SFT, DM_PLAY, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM_CTL, KC_LGUI, OSM_ALT, OSL_FUN, OSL_LWR, MT_SPC, MT_SPC, OSL_RSE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - /* Lower - * ,-----------------------------------------------------------------------------------. - * | ! | @ | # | $ | % | | | ^ | & | * | ( | ) | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | | | | | | | _ | + | | { | } | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | " | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Home | PgDn | PgUp | End | - * `-----------------------------------------------------------------------------------' - */ [LWR] = LAYOUT_planck_grid( KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, _______, KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DQUO, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), - /* Raise - * ,-----------------------------------------------------------------------------------. - * | 1 | 2 | 3 | 4 | 5 | | | 6 | 7 | 8 | 9 | 0 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ` | | | | | | | - | = | | [ | ] | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | ' | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Home | PgDn | PgUp | End | - * `-----------------------------------------------------------------------------------' - */ [RSE] = LAYOUT_planck_grid( KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0 , KC_GRV, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_QUOT, KC_BSLS, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), - /* Function - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | Reset|Delete| F6 | F7 | F8 | F9 | F10 | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | F11 | F12 | F13 | F14 | F15 | | | |MsWhLt|MsWhDn|MsWhUp|MsWhRt| - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |BlTggl|BlStep| | | |DmStrt|DmStop| | |MsBtn1|MsBtn2|MsBtn3| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | |MsLeft|MsDown| MsUp |MsRght| - * `-----------------------------------------------------------------------------------' - */ [FUN] = LAYOUT_planck_grid( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, RESET, KC_DEL, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 , KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_U, KC_WH_R, -- cgit v1.2.3 From 8ef747accf6e59ff50a3dde1cb34f56e4edce9fe Mon Sep 17 00:00:00 2001 From: skullydazed Date: Thu, 27 Sep 2018 13:32:01 -0700 Subject: Treat too-large firmwares as an error, not a warning (#3956) * Treat too-large firmwares as an error, not a warning * switch the order of printing * I think I have it * adjust the formatting some more --- message.mk | 6 +++--- tmk_core/rules.mk | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/message.mk b/message.mk index 427925dac1..6894dd8cb5 100644 --- a/message.mk +++ b/message.mk @@ -77,6 +77,6 @@ endef MSG_MAKE_TEST = $(eval $(call GENERATE_MSG_MAKE_TEST))$(MSG_MAKE_TEST_ACTUAL) MSG_TEST = Testing $(BOLD)$(TEST_NAME)$(NO_COLOR) MSG_CHECK_FILESIZE = Checking file size of $(TARGET).hex -MSG_FILE_TOO_BIG = $(ERROR_COLOR)Your file is too big!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) over)\n -MSG_FILE_TOO_SMALL = Your file is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n -MSG_FILE_JUST_RIGHT = File size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) free)\n +MSG_FILE_TOO_BIG = $(ERROR_COLOR)The firmware is too large!$(NO_COLOR) $(CURRENT_SIZE)/$(MAX_SIZE) ($(OVER_SIZE) bytes over)\n +MSG_FILE_TOO_SMALL = The firmware is too small! $(CURRENT_SIZE)/$(MAX_SIZE)\n +MSG_FILE_JUST_RIGHT = The firmware size is fine - $(CURRENT_SIZE)/$(MAX_SIZE) ($(FREE_SIZE) bytes free)\n diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index 5b1858b718..f1ef733f69 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -378,7 +378,7 @@ check-size: $(eval OVER_SIZE=$(shell expr $(CURRENT_SIZE) - $(MAX_SIZE))) if [ $(MAX_SIZE) -gt 0 ] && [ $(CURRENT_SIZE) -gt 0 ]; then \ $(SILENT) || printf "$(MSG_CHECK_FILESIZE)" | $(AWK_CMD); \ - if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then $(PRINT_WARNING_PLAIN); $(SILENT) || printf " * $(MSG_FILE_TOO_BIG)" ; else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ + if [ $(CURRENT_SIZE) -gt $(MAX_SIZE) ]; then printf "\n * $(MSG_FILE_TOO_BIG)"; $(PRINT_ERROR_PLAIN); else $(PRINT_OK); $(SILENT) || printf " * $(MSG_FILE_JUST_RIGHT)"; fi \ fi else check-size: -- cgit v1.2.3 From a65085a89354e89ddd3517aa63c74ef6dd32ca8b Mon Sep 17 00:00:00 2001 From: Pekaso Date: Fri, 28 Sep 2018 10:06:19 +0900 Subject: Keyboard: [Fortitude60] LED fix and Serial improvement (#3982) * arrangement Underglow * modified serial function references from helix * Remove defines (ws2812_*REG) --- keyboards/fortitude60/config.h | 1 + keyboards/fortitude60/keymaps/default/config.h | 1 - keyboards/fortitude60/keymaps/default/keymap.c | 4 +- keyboards/fortitude60/keymaps/default/rules.mk | 1 + keyboards/fortitude60/rev1/config.h | 11 +- keyboards/fortitude60/rev1/rules.mk | 1 - keyboards/fortitude60/serial.c | 451 ++++++++++++++++++------- keyboards/fortitude60/serial.h | 86 +++-- keyboards/fortitude60/serial_config.h | 14 + 9 files changed, 420 insertions(+), 150 deletions(-) create mode 100644 keyboards/fortitude60/serial_config.h diff --git a/keyboards/fortitude60/config.h b/keyboards/fortitude60/config.h index 863722d7d0..27a44ab928 100644 --- a/keyboards/fortitude60/config.h +++ b/keyboards/fortitude60/config.h @@ -19,5 +19,6 @@ along with this program. If not, see . #define CONFIG_H #include "config_common.h" +#include #endif // CONFIG_H diff --git a/keyboards/fortitude60/keymaps/default/config.h b/keyboards/fortitude60/keymaps/default/config.h index b356791fc8..1748373481 100644 --- a/keyboards/fortitude60/keymaps/default/config.h +++ b/keyboards/fortitude60/keymaps/default/config.h @@ -28,7 +28,6 @@ along with this program. If not, see . // #define MASTER_RIGHT #define EE_HANDS -#define USE_SERIAL_PD2 /* #undef RGBLED_NUM */ /* #define RGBLIGHT_ANIMATIONS */ /* #define RGBLED_NUM 12 */ diff --git a/keyboards/fortitude60/keymaps/default/keymap.c b/keyboards/fortitude60/keymaps/default/keymap.c index 18d2527e45..9d724a8ec6 100644 --- a/keyboards/fortitude60/keymaps/default/keymap.c +++ b/keyboards/fortitude60/keymaps/default/keymap.c @@ -119,9 +119,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------. ,-----------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | * |------+------+------+------+------+------. ,------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * | ` | 1 | ↑ | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+------. ,------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | | | + * | Del | ← | ↓ | → | F4 | F5 | | F6 | - | = | [ | ] | | | * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | | | F12 |ISO # |ISO / | | | | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' diff --git a/keyboards/fortitude60/keymaps/default/rules.mk b/keyboards/fortitude60/keymaps/default/rules.mk index e0ed6f0c2d..1964bd0a7c 100644 --- a/keyboards/fortitude60/keymaps/default/rules.mk +++ b/keyboards/fortitude60/keymaps/default/rules.mk @@ -1 +1,2 @@ RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/fortitude60/rev1/config.h b/keyboards/fortitude60/rev1/config.h index 4ba195ff8e..8c6f21afe6 100644 --- a/keyboards/fortitude60/rev1/config.h +++ b/keyboards/fortitude60/rev1/config.h @@ -64,12 +64,11 @@ along with this program. If not, see . ) /* ws2812 RGB LED */ -/* #define RGB_DI_PIN D3 */ -/* #define RGBLIGHT_TIMER */ -/* #define RGBLED_NUM 16 // Number of LEDs */ -/* #define ws2812_PORTREG PORTD */ -/* #define ws2812_DDRREG DDRD */ - +#ifdef RGBLIGHT_ENABLE + #define RGB_DI_PIN B5 + #define RGBLIGHT_TIMER + #define RGBLED_NUM 18 // Number of LEDs */ +#endif /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/fortitude60/rev1/rules.mk b/keyboards/fortitude60/rev1/rules.mk index bd518d8f27..e69de29bb2 100644 --- a/keyboards/fortitude60/rev1/rules.mk +++ b/keyboards/fortitude60/rev1/rules.mk @@ -1 +0,0 @@ -BACKLIGHT_ENABLE = yes diff --git a/keyboards/fortitude60/serial.c b/keyboards/fortitude60/serial.c index 46dfad021d..cea1a5f6ca 100644 --- a/keyboards/fortitude60/serial.c +++ b/keyboards/fortitude60/serial.c @@ -9,34 +9,128 @@ #include #include #include +#include #include #include "serial.h" +//#include + +#ifdef USE_SERIAL + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions); } -#ifndef USE_I2C +void serial_slave_init(void) +{ soft_serial_target_init(transactions); } -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ return soft_serial_transaction(); } + +#endif // Simple API (OLD API, compatible with let's split serial.c) + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define TID_SEND_ADJUST 14 + +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles +#else +#error Illegal Serial Speed +#endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static -void serial_input(void) { +void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } @@ -46,190 +140,305 @@ uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void serial_master_init(void) { - serial_output(); - serial_high(); +void soft_serial_initiator_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_output(); + serial_high(); } -void serial_slave_init(void) { - serial_input(); - -#ifndef USE_SERIAL_PD2 - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +void soft_serial_target_init(SSTD_t *sstd_table) +{ + Transaction_table = sstd_table; + serial_input_with_pullup(); + +#if SERIAL_PIN_MASK == _BV(PD0) + // Enable INT0 + EIMSK |= _BV(INT0); + // Trigger on falling edge of INT0 + EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +#elif SERIAL_PIN_MASK == _BV(PD2) + // Enable INT2 + EIMSK |= _BV(INT2); + // Trigger on falling edge of INT2 + EICRA &= ~(_BV(ISC20) | _BV(ISC21)); #else - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + #error unknown SERIAL_PIN_MASK value #endif } -// Used by the master to synchronize timing with the slave. +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; static void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. while (!serial_read_pin()); - serial_delay(); } -// Used by the slave to send a synchronization signal to the master. +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void)NO_INLINE; static void sync_send(void) { - serial_output(); - serial_low(); serial_delay(); - serial_high(); } // Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; return byte; } // Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } serial_delay(); - } -} -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); + serial_low(); // sync_send() / senc_recv() need raise edge +} - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; sync_send(); - checksum += serial_slave_buffer[i]; + serial_write_chunk(data,8); } - serial_write_byte(checksum); - sync_send(); +} - // wait for the sync to finish sending - serial_delay(); +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} - serial_input(); // end transaction +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid; + uint8_t pecount = 0; + sync_recv(); + tid = serial_read_chunk(&pecount,4); + if(pecount> 0) + return; + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } } else { - status &= ~SLAVE_DATA_CORRUPT; + *trans->status = TRANSACTION_ACCEPTED; } -} -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; + sync_recv(); //weit initiator output to high } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) // // Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif cli(); - // signal to the slave that we want to start a transaction + // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(1); + _delay_us(SLAVE_INT_WIDTH_US); - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); - // check if the slave is present + // check if the target is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return 1; + return TRANSACTION_NO_RESPONSE; } - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; +#else + // send transaction table index + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(sstd_index, 4); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - if (checksum_computed != checksum_received) { - sei(); - return 2; + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } +#endif - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); } - serial_write_byte(checksum); - sync_recv(); // always, release the line when not in use - serial_output(); - serial_high(); + sync_send(); + *trans->status = TRANSACTION_END; sei(); - return 0; + return TRANSACTION_END; } +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} #endif + +#endif \ No newline at end of file diff --git a/keyboards/fortitude60/serial.h b/keyboards/fortitude60/serial.h index 361f1881b6..d008980556 100644 --- a/keyboards/fortitude60/serial.h +++ b/keyboards/fortitude60/serial.h @@ -1,32 +1,80 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H -#include "config.h" #include -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in serial_config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SERIAL_PIN_DDR DDRD +// #define SERIAL_PIN_PORT PORTD +// #define SERIAL_PIN_INPUT PIND +// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 +// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// -#ifndef USE_SERIAL_PD2 -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect -#else -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect -#endif - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 -// Buffers for master - slave communication +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif void serial_master_init(void); void serial_slave_init(void); int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); #endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x4 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ \ No newline at end of file diff --git a/keyboards/fortitude60/serial_config.h b/keyboards/fortitude60/serial_config.h new file mode 100644 index 0000000000..96a54afbd8 --- /dev/null +++ b/keyboards/fortitude60/serial_config.h @@ -0,0 +1,14 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +/* Soft Serial defines */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD2) +#define SERIAL_PIN_INTERRUPT INT2_vect + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH 1 + +#endif /* SOFT_SERIAL_CONFIG_H */ \ No newline at end of file -- cgit v1.2.3 From 246d539f295c70846aa4ecaf9cfbe79b959bf3c7 Mon Sep 17 00:00:00 2001 From: Ethan Madden Date: Thu, 27 Sep 2018 18:09:23 -0700 Subject: Keymap: add clicky support to jetpacktuxedo keymap (#3990) controlled by dip 3 with pitch modulated by the knob --- keyboards/planck/keymaps/jetpacktuxedo/config.h | 2 ++ keyboards/planck/keymaps/jetpacktuxedo/keymap.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/keyboards/planck/keymaps/jetpacktuxedo/config.h b/keyboards/planck/keymaps/jetpacktuxedo/config.h index f216dc02dc..7efe97a573 100644 --- a/keyboards/planck/keymaps/jetpacktuxedo/config.h +++ b/keyboards/planck/keymaps/jetpacktuxedo/config.h @@ -2,6 +2,7 @@ #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) + #define AUDIO_CLICKY #endif /* @@ -30,3 +31,4 @@ // Most tactile encoders have detents every 4 stages #define ENCODER_RESOLUTION 4 + diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c index 2994c0c077..1324056862 100644 --- a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c @@ -189,6 +189,13 @@ uint8_t muse_offset = 70; uint16_t muse_tempo = 20; void encoder_update(bool clockwise) { + if (is_clicky_on()) { + if (clockwise) { + clicky_freq_up(); + } else { + clicky_freq_down(); + } + } else if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { @@ -248,6 +255,12 @@ void dip_update(uint8_t index, bool active) { stop_all_notes(); #endif } + case 2: + if (active) { + clicky_on(); + } else { + clicky_off(); + } } } -- cgit v1.2.3 From edeace279b1cdc5a5450cc5b41d49b341a3a121f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 27 Sep 2018 18:12:32 -0700 Subject: Make Audio Clicky's randomness a float Rather than a define, but read from the define. This way, a smart coder could externally configure the randomness, changing it on the fly This is also a precursor step to adding full on support for configurable randomness. --- quantum/process_keycode/process_clicky.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quantum/process_keycode/process_clicky.c b/quantum/process_keycode/process_clicky.c index 36578047ad..8238c263f9 100644 --- a/quantum/process_keycode/process_clicky.c +++ b/quantum/process_keycode/process_clicky.c @@ -20,6 +20,7 @@ #endif // !AUDIO_CLICKY_FREQ_RANDOMNESS float clicky_freq = AUDIO_CLICKY_FREQ_DEFAULT; +float clicky_rand = AUDIO_CLICKY_FREQ_RANDOMNESS; float clicky_song[][2] = {{AUDIO_CLICKY_FREQ_DEFAULT, 3}, {AUDIO_CLICKY_FREQ_DEFAULT, 1}}; // 3 and 1 --> durations extern audio_config_t audio_config; @@ -33,8 +34,8 @@ void clicky_play(void) { #ifndef NO_MUSIC_MODE if (music_activated || midi_activated) return; #endif // !NO_MUSIC_MODE - clicky_song[0][0] = 2.0f * clicky_freq * (1.0f + AUDIO_CLICKY_FREQ_RANDOMNESS * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); - clicky_song[1][0] = clicky_freq * (1.0f + AUDIO_CLICKY_FREQ_RANDOMNESS * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); + clicky_song[0][0] = 2.0f * clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); + clicky_song[1][0] = clicky_freq * (1.0f + clicky_rand * ( ((float)rand()) / ((float)(RAND_MAX)) ) ); PLAY_SONG(clicky_song); } -- cgit v1.2.3 From baebbc096702c3ecc0ee89b4fbf5749e79f02375 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 28 Sep 2018 11:02:12 +0900 Subject: add 'mavrdude' target into tmk_core/avr.mk (#3986) * add 'mavrdude' target into tmk_core/avr.mk I made it a little convenient when writing the same binary to multiple Pro Micro. * rename target name 'mavrdude' to 'avrdude-loop' * modify docs/flashing.md about avrdude-loop * mdify docs/flashing.md again * modifi docs/flashing.md 3rd --- docs/flashing.md | 6 ++++++ tmk_core/avr.mk | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/flashing.md b/docs/flashing.md index e5fe59f8f0..66c08a3610 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -78,6 +78,12 @@ or make ::avrdude +or if you want to flash multiple boards, use the following command + + make ::avrdude-loop + +When you're done flashing boards, you'll need to hit Ctrl + C or whatever the correct keystroke is for your operating system to break the loop. + ## Halfkay Halfkay is a super-slim protocol developed by PJRC that uses HID, and come on all Teensys (namely the 2.0). diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index 2f955b18fe..add904c9c5 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -169,7 +169,8 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep fi $(DFU_PROGRAMMER) $(MCU) reset -avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware +define EXEC_AVRDUDE + USB= ;\ if $(GREP) -q -s Microsoft /proc/version; then \ echo 'ERROR: AVR flashing cannot be automated within the Windows Subsystem for Linux (WSL) currently. Instead, take the .hex file generated and flash it using AVRDUDE, AVRDUDESS, or XLoader.'; \ else \ @@ -191,6 +192,15 @@ avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware sleep 1; \ avrdude -p $(MCU) -c avr109 -P $$USB -U flash:w:$(BUILD_DIR)/$(TARGET).hex; \ fi +endef + +avrdude: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + $(call EXEC_AVRDUDE) + +avrdude-loop: $(BUILD_DIR)/$(TARGET).hex check-size cpfirmware + while true; do \ + $(call EXEC_AVRDUDE) ; \ + done # Convert hex to bin. bin: $(BUILD_DIR)/$(TARGET).hex -- cgit v1.2.3 From 96c9ebc2e48b8f327bca2a2d5db77c0ab2ef6c8a Mon Sep 17 00:00:00 2001 From: Chiang Fong Lee Date: Sat, 18 Aug 2018 12:19:29 +0800 Subject: Revert "Split Common: Serial Backlight LED fix (#3586)" This reverts commit 3eabd7946ec5e47d12d603d591e8d8658d82fa42. --- quantum/split_common/matrix.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 3d2983f2ef..ff6738b58f 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -355,24 +355,6 @@ void matrix_slave_scan(void) { for (int i = 0; i < ROWS_PER_HAND; ++i) { serial_slave_buffer[i] = matrix[offset+i]; } -#endif -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); -#endif #endif matrix_slave_scan_user(); } -- cgit v1.2.3 From 7d2d0c6795eaaa87d4e13fc159807b64ca2d71f9 Mon Sep 17 00:00:00 2001 From: Chiang Fong Lee Date: Sat, 18 Aug 2018 12:46:12 +0800 Subject: split_common: fix backlight update for serial boards --- quantum/split_common/split_util.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 13b09d5b81..7c87de4d9b 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -106,14 +106,14 @@ void keyboard_slave_loop(void) { // Read Backlight Info #ifdef BACKLIGHT_ENABLE - if (BACKLIT_DIRTY) { - #ifdef USE_I2C + #ifdef USE_I2C + if (BACKLIT_DIRTY) { backlight_set(i2c_slave_buffer[I2C_BACKLIT_START]); - #else // USE_SERIAL - backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); - #endif - BACKLIT_DIRTY = false; - } + BACKLIT_DIRTY = false; + } + #else // USE_SERIAL + backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); + #endif #endif // Read RGB Info #ifdef RGBLIGHT_ENABLE -- cgit v1.2.3 From b382076ad1a6d857b6f185077b5f3635801b4ad6 Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Fri, 28 Sep 2018 13:53:36 +1000 Subject: Keyboard: keyboardio model01: rgbmatrix support (#3989) * model01: implement RGB matrix feature LEDs can still be individually controlled if this is switched off. * model01: use fast banked LED setting commands * model01: update default keymap to use RGB matrix * model01: update RGB matrix support to match common_features.mk * rgb_matrix: include This was missing after commit 4d5705ea6ceeb11cd2adc018644ec87c51af4e86 which introduces a use of memset(). * model01: make g_rgb_leds weak This allows users to override which LEDs are configured as modifiers, or tweak the x/y coordinates, should they so choose. --- keyboards/model01/config.h | 3 + keyboards/model01/keymaps/default/keymap.c | 57 +++++++++--- keyboards/model01/leds.c | 144 +++++++++++++++++++++++++---- keyboards/model01/leds.h | 9 +- keyboards/model01/rules.mk | 4 +- quantum/rgb_matrix.c | 1 + 6 files changed, 182 insertions(+), 36 deletions(-) diff --git a/keyboards/model01/config.h b/keyboards/model01/config.h index 796653f459..167310731f 100644 --- a/keyboards/model01/config.h +++ b/keyboards/model01/config.h @@ -33,3 +33,6 @@ along with this program. If not, see . /* The scanners already debounce for us */ #define DEBOUNCING_DELAY 0 + +/* RGB matrix constants */ +#define DRIVER_LED_TOTAL 64 diff --git a/keyboards/model01/keymaps/default/keymap.c b/keyboards/model01/keymaps/default/keymap.c index cdc050cd90..a6e5303fe8 100644 --- a/keyboards/model01/keymaps/default/keymap.c +++ b/keyboards/model01/keymaps/default/keymap.c @@ -26,7 +26,7 @@ enum { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [DEF] = LAYOUT( RESET , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , TG(NUM), - KC_GRV , KC_Q , KC_W , KC_E , KC_R , KC_T , _______, _______, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_EQL , + KC_GRV , KC_Q , KC_W , KC_E , KC_R , KC_T , RGB_MOD, _______, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_EQL , KC_PGUP, KC_A , KC_S , KC_D , KC_F , KC_G , KC_TAB , KC_ENT , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_PGDN, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_ESC , _______, KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_MINS, KC_LCTL, KC_RCTL, @@ -48,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [FUN] = LAYOUT( _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , - KC_TAB , _______, KC_MS_U, _______, KC_BTN3, _______, _______, KC_MPRV, KC_MNXT, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_F12 , + KC_TAB , _______, KC_MS_U, _______, KC_BTN3, _______, RGB_TOG, KC_MPRV, KC_MNXT, KC_LCBR, KC_RCBR, KC_LBRC, KC_RBRC, KC_F12 , KC_HOME, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN1, _______, _______, KC_MPLY, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, _______, KC_END , KC_PSCR, KC_INS , _______, KC_BTN2, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, KC_BSLS, KC_PIPE, _______, _______, @@ -73,21 +73,52 @@ LAYOUT( ) */ +static void set_numpad_colours(int on, void (*write)(int, uint8_t, uint8_t, uint8_t)) { + if (!on) { + for (int i=44; i<=60; i++) + write(i, 0, 0, 0); + write(63, 0, 0, 0); + return; + } + + /* main number keys */ + for (int i=44; i<=47; i++) + write(i, 255, 0, 0); + for (int i=49; i<=54; i++) + write(i, 255, 0, 0); + + /* accessory keys */ + write(48, 128, 128, 0); + for (int i=55; i<=59; i++) + write(i, 128, 128, 0); + + // enter + write(63, 0, 128, 0); + + // num key + write(60, 128, 0, 128); +} + +#ifdef RGB_MATRIX_ENABLE +/* the RGB matrix effects will overwrite the numpad indicator. + * this handy mechanism allows to override the matrix effects. + */ +void rgb_matrix_indicators_user(void) { + if (layer_state & (1< #include #include +#include +#include #include "model01.h" #define I2C_TIMEOUT 1000 -#define LINCOR(i) pgm_read_byte(&CIE1931_CURVE[i]) - -int set_all_leds_to_raw(uint8_t r, uint8_t g, uint8_t b) { +void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b) { uint8_t buf[] = { TWI_CMD_LED_SET_ALL_TO, b, g, r }; - int ret = 0; - ret |= i2c_transmit(I2C_ADDR(LEFT), buf, sizeof(buf), I2C_TIMEOUT); - ret |= i2c_transmit(I2C_ADDR(RIGHT), buf, sizeof(buf), I2C_TIMEOUT); + i2c_transmit(I2C_ADDR(LEFT), buf, sizeof(buf), I2C_TIMEOUT); + i2c_transmit(I2C_ADDR(RIGHT), buf, sizeof(buf), I2C_TIMEOUT); _delay_us(10); - return ret; -} - -int set_all_leds_to(uint8_t r, uint8_t g, uint8_t b) { - return set_all_leds_to_raw(LINCOR(r), LINCOR(g), LINCOR(b)); } -int set_led_to_raw(uint8_t led, uint8_t r, uint8_t g, uint8_t b) { +void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b) { uint8_t buf[] = { TWI_CMD_LED_SET_ONE_TO, led & 0x1f, b, g, r }; int hand = (led >= 32) ? RIGHT : LEFT; - int ret = i2c_transmit(I2C_ADDR(hand), buf, sizeof(buf), I2C_TIMEOUT); + i2c_transmit(I2C_ADDR(hand), buf, sizeof(buf), I2C_TIMEOUT); _delay_us(10); - return ret; } -int set_led_to(uint8_t led, uint8_t r, uint8_t g, uint8_t b) { - return set_led_to_raw(led, LINCOR(r), LINCOR(g), LINCOR(b)); +#ifdef RGB_MATRIX_ENABLE + +__attribute__ ((weak)) +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { + {{0x73}, { 3, 35}, 0}, + {{0x72}, { 0, 26}, 0}, + {{0x71}, { 0, 17}, 0}, + {{0x70}, { 0, 6}, 0}, + {{0x60}, { 14, 5}, 0}, + {{0x61}, { 15, 16}, 0}, + {{0x62}, { 16, 25}, 0}, + {{0x63}, { 17, 34}, 0}, + {{0x53}, { 31, 29}, 0}, + {{0x52}, { 31, 19}, 0}, + {{0x51}, { 30, 11}, 0}, + {{0x50}, { 30, 1}, 0}, + {{0x40}, { 45, 0}, 0}, + {{0x41}, { 45, 8}, 0}, + {{0x42}, { 46, 17}, 0}, + {{0x43}, { 46, 27}, 0}, + {{0x33}, { 60, 27}, 0}, + {{0x32}, { 60, 18}, 0}, + {{0x31}, { 60, 9}, 0}, + {{0x30}, { 60, 0}, 0}, + {{0x20}, { 74, 2}, 0}, + {{0x21}, { 74, 11}, 0}, + {{0x22}, { 75, 20}, 0}, + {{0x23}, { 74, 28}, 0}, + {{0x12}, { 89, 30}, 0}, + {{0x11}, { 89, 19}, 0}, + {{0x10}, { 89, 7}, 0}, + {{0x00}, { 70, 38}, 1}, + {{0x01}, { 82, 41}, 1}, + {{0x02}, { 93, 45}, 1}, + {{0x03}, {104, 50}, 1}, + {{0x13}, { 74, 64}, 1}, + {{0x67}, {149, 64}, 1}, + {{0x77}, {119, 50}, 1}, + {{0x76}, {130, 45}, 1}, + {{0x75}, {141, 41}, 1}, + {{0x74}, {153, 38}, 1}, + {{0x64}, {134, 7}, 0}, + {{0x65}, {134, 19}, 0}, + {{0x66}, {134, 30}, 0}, + {{0x57}, {149, 28}, 0}, + {{0x56}, {148, 20}, 0}, + {{0x55}, {149, 11}, 0}, + {{0x54}, {149, 2}, 0}, + {{0x44}, {163, 0}, 0}, + {{0x45}, {163, 9}, 0}, + {{0x46}, {163, 18}, 0}, + {{0x47}, {163, 27}, 0}, + {{0x37}, {177, 27}, 0}, + {{0x36}, {177, 17}, 0}, + {{0x35}, {178, 8}, 0}, + {{0x34}, {178, 0}, 0}, + {{0x24}, {193, 1}, 0}, + {{0x25}, {193, 11}, 0}, + {{0x26}, {192, 19}, 0}, + {{0x27}, {192, 29}, 0}, + {{0x17}, {206, 34}, 0}, + {{0x16}, {207, 25}, 0}, + {{0x15}, {208, 16}, 0}, + {{0x14}, {209, 5}, 0}, + {{0x04}, {224, 6}, 0}, + {{0x05}, {223, 17}, 0}, + {{0x06}, {223, 26}, 0}, + {{0x07}, {220, 35}, 0}, +}; + +static struct { + uint8_t b; + uint8_t g; + uint8_t r; +} __attribute__((packed)) led_state[64]; + +static void set_color(int index, uint8_t r, uint8_t g, uint8_t b) { + led_state[index].r = r; + led_state[index].g = g; + led_state[index].b = b; +} + +static void set_color_all(uint8_t r, uint8_t g, uint8_t b) { + for (int i=0; i +#include -int set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); -int set_led_to(uint8_t led, uint8_t r, uint8_t g, uint8_t b); - -/* Raw (gamma uncorrected) LED values */ -int set_all_leds_to_raw(uint8_t r, uint8_t g, uint8_t b); -int set_led_to_raw(uint8_t led, uint8_t r, uint8_t g, uint8_t b); +void set_all_leds_to(uint8_t r, uint8_t g, uint8_t b); +void set_led_to(int led, uint8_t r, uint8_t g, uint8_t b); diff --git a/keyboards/model01/rules.mk b/keyboards/model01/rules.mk index cab7065ff8..49ab981d14 100644 --- a/keyboards/model01/rules.mk +++ b/keyboards/model01/rules.mk @@ -59,4 +59,6 @@ MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode CUSTOM_MATRIX = yes -CIE1931_CURVE = yes + +# You can set RGB_MATRIX_ENABLE = no in your rules.mk to disable this and save the Flash +RGB_MATRIX_ENABLE = custom # Enable RGB matrix effects (+10000). diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 807e4d62d1..b282284a13 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -21,6 +21,7 @@ #include "progmem.h" #include "config.h" #include "eeprom.h" +#include #include rgb_config_t rgb_matrix_config; -- cgit v1.2.3 From a173eda6d28bd09b2d59448a6532edb7a6c8e358 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Fri, 28 Sep 2018 14:09:14 +1000 Subject: Improved dynamic keymaps (#3972) * Improved dynamic keymaps * K&R sucks --- keyboards/zeal60/zeal60.c | 9 ++++----- keyboards/zeal60/zeal60_api.h | 2 +- quantum/dynamic_keymap.c | 42 +++++++++++++++--------------------------- quantum/dynamic_keymap.h | 7 ++----- 4 files changed, 22 insertions(+), 38 deletions(-) diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c index e516c4dbfc..092235ca61 100644 --- a/keyboards/zeal60/zeal60.c +++ b/keyboards/zeal60/zeal60.c @@ -81,9 +81,9 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); break; } - case id_dynamic_keymap_clear_all: + case id_dynamic_keymap_reset: { - dynamic_keymap_clear_all(); + dynamic_keymap_reset(); break; } #endif // DYNAMIC_KEYMAP_ENABLE @@ -171,9 +171,8 @@ void matrix_init_kb(void) #endif // RGB_BACKLIGHT_ENABLED #ifdef DYNAMIC_KEYMAP_ENABLE - // This saves "empty" keymaps so it falls back to the keymaps - // in the firmware (aka. progmem/flash) - dynamic_keymap_clear_all(); + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); #endif // Save the magic number last, in case saving was interrupted diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h index baa8ac09f8..eaac3ad7ce 100644 --- a/keyboards/zeal60/zeal60_api.h +++ b/keyboards/zeal60/zeal60_api.h @@ -24,7 +24,7 @@ enum zeal60_command_id id_set_keyboard_value, id_dynamic_keymap_get_keycode, id_dynamic_keymap_set_keycode, - id_dynamic_keymap_clear_all, + id_dynamic_keymap_reset, id_backlight_config_set_value, id_backlight_config_get_value, id_backlight_config_save, diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index 9f18612d56..2c989d6918 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -16,6 +16,8 @@ #include "config.h" #include "keymap.h" // to get keymaps[][][] +#include "tmk_core/common/eeprom.h" +#include "progmem.h"// to read default from flash #include "dynamic_keymap.h" @@ -29,8 +31,6 @@ #error DYNAMIC_KEYMAP_LAYER_COUNT not defined #endif -#define KC_EENULL 0xFFFF // TODO: move to enum quantum_keycodes - void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) { // TODO: optimize this with some left shifts @@ -55,16 +55,15 @@ void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint eeprom_update_byte(address+1, (uint8_t)(keycode & 0xFF)); } -void dynamic_keymap_clear_all(void) +void dynamic_keymap_reset(void) { - // Save "empty" keymaps. - for ( int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++ ) - { - for ( int row = 0; row < MATRIX_ROWS; row++ ) - { - for ( int column = 0; column < MATRIX_COLS; column++ ) - { - dynamic_keymap_set_keycode(layer, row, column, KC_EENULL); + // Reset the keymaps in EEPROM to what is in flash. + // All keyboards using dynamic keymaps should define a layout + // for the same number of layers as DYNAMIC_KEYMAP_LAYER_COUNT. + for ( int layer = 0; layer < DYNAMIC_KEYMAP_LAYER_COUNT; layer++ ) { + for ( int row = 0; row < MATRIX_ROWS; row++ ) { + for ( int column = 0; column < MATRIX_COLS; column++ ) { + dynamic_keymap_set_keycode(layer, row, column, pgm_read_word(&keymaps[layer][row][column])); } } } @@ -73,24 +72,13 @@ void dynamic_keymap_clear_all(void) // This overrides the one in quantum/keymap_common.c uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { - // This used to test EEPROM for magic bytes, but it was redundant. - // Test for EEPROM usage change (fresh install, address change, etc.) - // externally and call dynamic_keymap_default_save() if ( layer < DYNAMIC_KEYMAP_LAYER_COUNT && - key.row < MATRIX_ROWS && // possibly redundant - key.col < MATRIX_COLS ) // possibly redundant - { - uint16_t keycode = dynamic_keymap_get_keycode(layer, key.row, key.col); - - // If keycode is not "empty", return it, otherwise - // drop down to return the one in flash - if ( keycode != KC_EENULL) - { - return keycode; - } + key.row < MATRIX_ROWS && + key.col < MATRIX_COLS ) { + return dynamic_keymap_get_keycode(layer, key.row, key.col); + } else { + return KC_NO; } - - return pgm_read_word(&keymaps[layer][key.row][key.col]); } #endif // DYNAMIC_KEYMAP_ENABLE diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h index b0133aeb85..bd76adae20 100644 --- a/quantum/dynamic_keymap.h +++ b/quantum/dynamic_keymap.h @@ -13,9 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ - -#ifndef DYNAMIC_KEYMAP_H -#define DYNAMIC_KEYMAP_H +#pragma once #include #include @@ -23,9 +21,8 @@ void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column); uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column); void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode); -void dynamic_keymap_clear_all(void); +void dynamic_keymap_reset(void); // This overrides the one in quantum/keymap_common.c // uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); -#endif //DYNAMIC_KEYMAP_H -- cgit v1.2.3 From 31afdd81a1e7cdb8808c8eb32e0ebe69c3d15f5c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 07:15:20 -0700 Subject: Optimize size of JC65/v32a keyboard --- keyboards/jc65/v32a/config.h | 7 ++++--- keyboards/jc65/v32a/rules.mk | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/keyboards/jc65/v32a/config.h b/keyboards/jc65/v32a/config.h index dc6d280f52..466cb7a28e 100644 --- a/keyboards/jc65/v32a/config.h +++ b/keyboards/jc65/v32a/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -43,4 +42,6 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + diff --git a/keyboards/jc65/v32a/rules.mk b/keyboards/jc65/v32a/rules.mk index 1ea19fe00e..5c8e63283d 100644 --- a/keyboards/jc65/v32a/rules.mk +++ b/keyboards/jc65/v32a/rules.mk @@ -26,7 +26,7 @@ F_CPU = 12000000 # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID -- cgit v1.2.3 From a4bdab68370bc1497a7d5aa32d05bd8a6b3c3c14 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 07:09:46 -0700 Subject: Optimize size of Hadron keyboard --- keyboards/hadron/config.h | 19 ++++++------------ keyboards/hadron/keymaps/default/rules.mk | 4 +--- keyboards/hadron/rules.mk | 32 +++++++++++++++---------------- keyboards/hadron/ver0/config.h | 7 ++----- keyboards/hadron/ver2/config.h | 7 ++----- keyboards/hadron/ver2/rules.mk | 2 +- 6 files changed, 28 insertions(+), 43 deletions(-) diff --git a/keyboards/hadron/config.h b/keyboards/hadron/config.h index 0c19d6c791..9111ad7279 100644 --- a/keyboards/hadron/config.h +++ b/keyboards/hadron/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -30,7 +29,7 @@ along with this program. If not, see . -//#define AUDIO_VOICES +//#define AUDIO_VOICES //#define BACKLIGHT_PIN B7 @@ -71,13 +70,7 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION -#ifdef SUBPROJECT_ver0 - #include "ver0/config.h" -#endif -#ifdef SUBPROJECT_ver2 - #include "ver2/config.h" -#endif - -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + + diff --git a/keyboards/hadron/keymaps/default/rules.mk b/keyboards/hadron/keymaps/default/rules.mk index 1f3975255a..4d08544f3a 100644 --- a/keyboards/hadron/keymaps/default/rules.mk +++ b/keyboards/hadron/keymaps/default/rules.mk @@ -21,6 +21,4 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file +EXTRAFLAGS += -flto diff --git a/keyboards/hadron/rules.mk b/keyboards/hadron/rules.mk index 66a900825a..1f835e0660 100644 --- a/keyboards/hadron/rules.mk +++ b/keyboards/hadron/rules.mk @@ -44,30 +44,30 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 +BOOTLOADER = halfkay # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -NKRO_ENABLE ?= no # 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 controls -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. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. API_SYSEX_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend SRC = i2c.c \ ssd1306.c -DEFAULT_FOLDER = hadron/ver2 \ No newline at end of file +DEFAULT_FOLDER = hadron/ver2 diff --git a/keyboards/hadron/ver0/config.h b/keyboards/hadron/ver0/config.h index 039d4f1c71..2157a52cee 100644 --- a/keyboards/hadron/ver0/config.h +++ b/keyboards/hadron/ver0/config.h @@ -14,10 +14,7 @@ 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 . */ -#ifndef VER0_CONFIG_H -#define VER0_CONFIG_H - -#include "../config.h" +#pragma once /* USB Device descriptor parameter */ #define DEVICE_VER 0x0001 @@ -32,4 +29,4 @@ along with this program. If not, see . #define UNUSED_PINS -#endif + diff --git a/keyboards/hadron/ver2/config.h b/keyboards/hadron/ver2/config.h index 71a0ab5b3f..5ee3f931ff 100644 --- a/keyboards/hadron/ver2/config.h +++ b/keyboards/hadron/ver2/config.h @@ -14,10 +14,7 @@ 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 . */ -#ifndef VER2_CONFIG_H -#define VER2_CONFIG_H - -#include "../config.h" +#pragma once /* USB Device descriptor parameter */ #define DEVICE_VER 0x0002 @@ -32,4 +29,4 @@ along with this program. If not, see . #define UNUSED_PINS -#endif + diff --git a/keyboards/hadron/ver2/rules.mk b/keyboards/hadron/ver2/rules.mk index a3952a5d33..521493b3d3 100644 --- a/keyboards/hadron/ver2/rules.mk +++ b/keyboards/hadron/ver2/rules.mk @@ -1 +1 @@ -#AUDIO_ENABLE ?= yes # Audio output on port C6 \ No newline at end of file +#AUDIO_ENABLE = yes # Audio output on port C6 -- cgit v1.2.3 From 8847b2abbff5c6d55cf43402d394e9db751f728f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 07:24:08 -0700 Subject: Optimize size of Vitamins_Included keyboard --- keyboards/vitamins_included/config.h | 10 +--------- keyboards/vitamins_included/keymaps/default/config.h | 7 +------ keyboards/vitamins_included/keymaps/default/keymap.c | 12 +++--------- keyboards/vitamins_included/keymaps/default/rules.mk | 4 +--- keyboards/vitamins_included/rules.mk | 5 ++--- 5 files changed, 8 insertions(+), 30 deletions(-) diff --git a/keyboards/vitamins_included/config.h b/keyboards/vitamins_included/config.h index 27924ae46c..abbb310563 100644 --- a/keyboards/vitamins_included/config.h +++ b/keyboards/vitamins_included/config.h @@ -16,20 +16,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" -#if !defined(NO_DEBUG) && !defined(CONSOLE_ENABLE) -#define NO_DEBUG -#endif // !NO_DEBUG -#if !defined(NO_PRINT) && !defined(CONSOLE_ENABLE) -#define NO_PRINT -#endif // !NO_PRINT #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION #define DISABLE_LEADER -#endif diff --git a/keyboards/vitamins_included/keymaps/default/config.h b/keyboards/vitamins_included/keymaps/default/config.h index 35f641a94a..aba9fa7d40 100644 --- a/keyboards/vitamins_included/keymaps/default/config.h +++ b/keyboards/vitamins_included/keymaps/default/config.h @@ -18,10 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -40,5 +37,3 @@ along with this program. If not, see . SONG(COLEMAK_SOUND) \ } #endif - -#endif diff --git a/keyboards/vitamins_included/keymaps/default/keymap.c b/keyboards/vitamins_included/keymaps/default/keymap.c index f25e2fd32e..13b48e7640 100644 --- a/keyboards/vitamins_included/keymaps/default/keymap.c +++ b/keyboards/vitamins_included/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -141,28 +139,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); } return false; break; case COLEMAK: if (record->event.pressed) { - persistent_default_layer_set(1UL<<_COLEMAK); + set_single_persistent_default_layer(_COLEMAK); } return false; break; case DVORAK: if (record->event.pressed) { - persistent_default_layer_set(1UL<<_DVORAK); + set_single_persistent_default_layer(_DVORAK); } return false; break; diff --git a/keyboards/vitamins_included/keymaps/default/rules.mk b/keyboards/vitamins_included/keymaps/default/rules.mk index 457a3d01d4..8b13789179 100644 --- a/keyboards/vitamins_included/keymaps/default/rules.mk +++ b/keyboards/vitamins_included/keymaps/default/rules.mk @@ -1,3 +1 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif + diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk index 2291b21161..8ac39dffbc 100644 --- a/keyboards/vitamins_included/rules.mk +++ b/keyboards/vitamins_included/rules.mk @@ -56,7 +56,7 @@ 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 = no # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # 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 controls @@ -64,7 +64,6 @@ 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. -USE_I2C = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -74,4 +73,4 @@ LAYOUTS = ortho_4x12 DEFAULT_FOLDER = vitamins_included/rev1 -EXTRAFLAGS += -flto \ No newline at end of file +EXTRAFLAGS += -flto -- cgit v1.2.3 From ebc143297c24bdd894340ffece2d93f15fbd5c1c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 07:18:43 -0700 Subject: Optimize size of Pearl keyboard --- keyboards/pearl/config.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboards/pearl/config.h b/keyboards/pearl/config.h index 9f7a148f98..c0594bf91a 100644 --- a/keyboards/pearl/config.h +++ b/keyboards/pearl/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef PEARL_CONFIG_H -#define PEARL_CONFIG_H +#pragma once #include "config_common.h" @@ -46,4 +45,6 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + -- cgit v1.2.3 From 9ade35a9fedbc6e4e77f422ed5fb514348e754ad Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 07:00:11 -0700 Subject: Optimize size of USB_USB BLE Converter --- keyboards/converter/usb_usb/ble/config.h | 8 ++++---- keyboards/converter/usb_usb/ble/rules.mk | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h index 45aa778d57..5333e17c82 100644 --- a/keyboards/converter/usb_usb/ble/config.h +++ b/keyboards/converter/usb_usb/ble/config.h @@ -1,13 +1,13 @@ -#ifndef CONFIG_BLE_H -#define CONFIG_BLE_H +#pragma once #undef PRODUCT #define PRODUCT QMK BLE Adapter #undef DESCRIPTION -#define DESCRIPTION +#define DESCRIPTION // Turn off the mode leds on the BLE module #define ADAFRUIT_BLE_ENABLE_MODE_LEDS 0 #define ADAFRUIT_BLE_ENABLE_POWER_LED 0 -#endif +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk index 16090962d9..84aa767f54 100644 --- a/keyboards/converter/usb_usb/ble/rules.mk +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -1,3 +1,23 @@ BLUETOOTH = AdafruitBLE ADAFRUIT_BLE_ENABLE = yes F_CPU = 8000000 + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # 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) + +EXTRAFLAGS += -flto -- cgit v1.2.3 From 8454fa5e9faab3a969168447d42369828f8ade91 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 09:04:30 -0700 Subject: Update Document Templates to reflect newer wording and URLs (#4006) * Add pragma once info to contributing guidelines * Fix links in readme template to match doc site * Revert changes to contributing doc as somebody already changed it --- docs/documentation_templates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/documentation_templates.md b/docs/documentation_templates.md index 18829ed0f0..ba3830b64c 100644 --- a/docs/documentation_templates.md +++ b/docs/documentation_templates.md @@ -36,7 +36,7 @@ Make example for this keyboard (after setting up your build environment): make planck/rev4:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). ``` There needs to be two spaces at the end of the `Keyboard Maintainer` and `Hardware Supported` lines for it to render correctly with Markdown. -- cgit v1.2.3 From fa47f5fb15cca3bea9ab4de1001fcfecd43dac19 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 09:27:51 -0700 Subject: Update to the Userspace documentation (#4005) * Overhaul to Userspace Documentation * Formatting issues * Additionaly formatting fixes * Add Readme info * Additionaly Readme info * Formatting fixes --- docs/feature_userspace.md | 178 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 133 insertions(+), 45 deletions(-) diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index 5f7c05b83b..b7fc9d8099 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -5,15 +5,12 @@ If you use more than one keyboard with a similar keymap, you might see the benef * `/users//` (added to the path automatically) * `readme.md` (optional, recommended) * `rules.mk` (included automatically) + * `config.h` (included automatically) * `.h` (optional) * `.c` (optional) - * `config.h` (optional) + * `cool_rgb_stuff.c` (optional) + * `cool_rgb_stuff.h` (optional) -`.c` will need to be added to the SRC in `rules.mk` like this: - - SRC += .c - -Additional files may be added in the same way - it's recommended you have one named ``.c/.h though. All this only happens when you build a keymap named ``, like this: @@ -23,82 +20,179 @@ For example, make planck:jack -Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. +Will include the `/users/jack/` folder in the path, along with `/users/jack/rules.mk`. -Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `.h` file. +!> This `name` can be [overridden](#override-default-userspace), if needed. -The reason for this, is that `.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `` file in any `config.h` files will result in compile issues. +## `Rules.mk` + +The `rules.mk` is one of the two files that gets processed automatically. This is how you add additional source files (such as `.c`) will be added when compiling. -So you should use the `config.h` for QMK settings, and the `.h` file for user or keymap specific settings. +It's highly recommended that you use `.c` as the default source file to be added. And to add it, you need to add it the SRC in `rules.mk` like this: -`/users//rules.mk` will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can `define RGB_ENABLE` in your keymap `rules.mk` and then check for the variable in your userspace `rules.mk` like this: + SRC += .c + +Additional files may be added in the same way - it's recommended you have one named ``.c/.h to start off with, though. + +The `/users//rules.mk` file will be included in the build _after_ the `rules.mk` from your keymap. This allows you to have features in your userspace `rules.mk` that depend on individual QMK features that may or may not be available on a specific keyboard. + +For example, if you have RGB control features shared between all your keyboards that support RGB lighting, you can add support for that if the RGBLIGHT feature is enabled: ```make -ifdef RGB_ENABLE - # Include my fancy rgb functions source here +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + # Include my fancy rgb functions source here + SRC += cool_rgb_stuff.c endif ``` -Because of this, any time you turn on QMK features in your `users//rules.mk`, you should conditionally enable them only if the flag isn't already defined, like this: + +Alternatively, you can `define RGB_ENABLE` in your keymap's `rules.mk` and then check for the variable in your userspace's `rules.mk` like this: ```make -ifndef TAP_DANCE_ENABLE - TAP_DANCE_ENABLE = yes +ifdef RGB_ENABLE + # Include my fancy rgb functions source here + SRC += cool_rgb_stuff.c endif ``` -This will ensure that you can explicitly turn off features for an individual keymap. -## Readme +### Override default userspace + +By default the userspace used will be the same as the keymap name. In some situations this isn't desirable. For instance, if you use the [layout](feature_layouts.md) feature you can't use the same name for different keymaps (e.g. ANSI and ISO). You can name your layouts `mylayout-ansi` and `mylayout-iso` and add the following line to your layout's `rules.mk`: + +``` +USER_NAME := mylayout +``` + +This is also useful if you have multiple different keyboards with different features physically present on the board (such as one with RGB Lights, and one with Audio, or different number of LEDs, or connected to a different PIN on the controller). + +## Configuration Options (`config.h`) + +Additionally, `config.h` here will be processed like the same file in your keymap folder. This is handled separately from the `.h` file. + +The reason for this, is that `.h` won't be added in time to add settings (such as `#define TAPPING_TERM 100`), and including the `` file in any `config.h` files will result in compile issues. + +!>You should use the `config.h` for [configuration options](config_options.md), and the `.h` file for user or keymap specific settings (such as the enum for layer or keycodes) + + +## Readme (`readme.md`) Please include authorship (your name, github username, email), and optionally [a license that's GPL compatible](https://www.gnu.org/licenses/license-list.html#GPLCompatibleLicenses). -## `Config.h` +You can use this as a template: +``` +Copyright @ + +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 . +``` + +You'd want to replace the year, name, email and github username with your info. + +Additionally, this is a good place to document your code, if you wish to share it with others. + +# Examples + +For a brief example, checkout [`/users/_example/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). +For a more complicaed example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. + + +## Customized Functions + +QMK has a bunch of [functions](custom_quantum_functions.md) that have [`_quantum`, `_kb`, and `_user` versions](custom_quantum_functions.md#a-word-on-core-vs-keyboards-vs-keymap) that you can use. You will pretty much always want to use the user version of these functions. But the problem is that if you use them in your userspace, then you don't have a version that you can use in your keymap. + +However, you can actually add support for keymap version, so that you can use it in both your userspace and your keymap! -If you do add a `config,h` file, you want to make sure that it only gets processed once. So you may want to start off with something like this: +For instance, lets looks at the `layer_state_set_user` function. Lets enable the [Tri Layer State](ref_functions.md#olkb-tri-layers) functionalitly to all of our boards, and then still have your `keymap.c` still able to use this functionality. + +In your `` file, you'd want to add this: ```c -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + +uint32_t layer_state_set_user (uint32_t state) { + state = update_tri_layer_state(state, 2, 3, 5); + return layer_state_set_keymap (state); +} +``` +The `__attribute__ ((weak))` part tells the compiler that this is a placce holder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. -// Put normal config.h settings here: +The `_keymap` part here doesn't matter, it just needs to be something other than `_quantum`, `_kb`, or `_user`, since those are already in use. So you could use `layer_state_set_mine`, `layer_state_set_fn`, or anything else. -#endif // !USERSPACE_CONFIG_H +You can see a list of this and other common functions in [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in [`users/drashna`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). + +## Custom Features + +Since the Userspace feature can support a staggering number of boards, you may have boards that you want to enable certain functionality for, but not for others. And you can actually create "features" that you can enable or disable in your own userspace. + +For instance, if you wanted to have a bunch of macros available, but only on certain boards (to save space), you could "hide" them being a `#ifdef MACROS_ENABLED`, and then enable it per board. To do this, add this to your rules.mk +```make +ifeq ($(strip $(MACROS_ENABLED)), yes) + OPT_DEFS += -DMACROS_ENABLED +endif ``` +The `OPT_DEFS` setting causee `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. -You can use any option hre that you could use in your keymap's `config.h` file. You can find a list of vales [here](config_options.md). +Then you add `MACROS_ENABLED = yes` to the `rules.mk` for you keymap to enable this feature and the code in your userspace. -## Example +And in your `process_record_user` function, you'd do something like this: +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { +#ifdef MACROS_ENABLED + case MACRO1: + if (!record->event.pressed) { + SEND_STRING("This is macro 1!"); + } + break; + case MACRO2: + if (!record->event.pressed) { + SEND_STRING("This is macro 2!"); + } + break; +#endif + } + return true; +} +``` -For a brief example, checkout `/users/_example/` , or for a more detailed examples check out [`template.h`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.h) and [`template.c`](https://github.com/qmk/qmk_firmware/blob/master/users/drashna/template.c) in `/users/drashna/` . -### Consolidated Macros +## Consolidated Macros -If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. The issue is that you then cannot call any function defined in your userspace, or it gets complicated. To better handle this, you can call the functions here and create new functions to use in individual keymaps. +If you wanted to consolidate macros and other functions into your userspace for all of your keymaps, you can do that. This builds upon the [Customized Functions](#customized-functions) example above. This lets you maintain a bunch of macros that are shared between the different keyboards, and allow for keyboard specific macros, too. First, you'd want to go through all of your `keymap.c` files and replace `process_record_user` with `process_record_keymap` instead. This way, you can still use keyboard specific codes on those boards, and use your custom "global" keycodes as well. You'll also want to replace `SAFE_RANGE` with `NEW_SAFE_RANGE` so that you wont have any overlapping keycodes Then add `#include ` to all of your keymap.c files. This allows you to use these new keycodes without having to redefine them in each keymap. Once you've done that, you'll want to set the keycode definitions that you need to the `.h` file. For instance: -``` -#ifndef USERSPACE -#define USERSPACE +```c +#pragma once #include "quantum.h" +#include "action.h" +#include "version.h" // Define all of enum custom_keycodes { KC_MAKE = SAFE_RANGE, NEW_SAFE_RANGE //use "NEW_SAFE_RANGE" for keymap specific codes }; - -#endif ``` Now you want to create the `.c` file, and add this content to it: -``` +```c #include ".h" -#include "quantum.h" -#include "action.h" -#include "version.h" __attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { @@ -126,14 +220,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } ``` -This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. +This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead). -## Override default userspace -By default the userspace used will be the same as the keymap name. In some situations this isn't desirable. For instance, if you use the [layout](feature_layouts.md) feature you can't use the same name for different keymaps (e.g. ANSI and ISO). You can name your layouts `mylayout-ansi` and `mylayout-iso` and add the following line to your layout's `rules.mk`: - -``` -USER_NAME := mylayout -``` -- cgit v1.2.3 From 7fe03d085c2ecaa324779093eceb1a12313ca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 28 Sep 2018 17:33:11 +0100 Subject: Update quantum matrix to support both AVR and Chibios ARM (#3968) * Update quantum matrix to support both AVR and Chibios ARM - Addition of STM32 pin definitions - Created abstruction layer defines to control GPIO (This is a bit pointless for Chibios as we are creating a PAL ontop of a PAL but it is necessary for uniformity with AVR) - Modified matrix.c to use the above functions * minor ifdef fix * Rename of functions and docs - Added documentation. - Renamed functions according to Jack's spec. * Massdrop fix * Update matrix.c * Update quantum.h * Update quantum.h * Update quantum.h * Update internals_gpio_control.md --- docs/internals_gpio_control.md | 23 +++++ quantum/config_common.h | 199 ++++++++++++++++++++++++++++++----------- quantum/matrix.c | 49 ++++------ quantum/quantum.h | 69 +++++++++++--- 4 files changed, 244 insertions(+), 96 deletions(-) create mode 100644 docs/internals_gpio_control.md diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md new file mode 100644 index 0000000000..21643d30c9 --- /dev/null +++ b/docs/internals_gpio_control.md @@ -0,0 +1,23 @@ +# GPIO Control + +QMK has a GPIO control abstraction layer which is micro-controller agnostic. This is done to allow easy access to pin control across different platforms. + +## Functions + +The following functions can provide basic control of GPIOs and are found in `quantum/quantum.h`. + +|Function |Description | +|----------------------|------------------------------------------------------------------| +|`setPinInput(pin)` |Set pin as input with high impedance (High-Z) | +|`setPinInputHigh(pin)`|Set pin as input with build in pull-up | +|`setPinInputLow(pin)` |Set pin as input with build in pull-down (Supported only on STM32)| +|`setPinOutput(pin)` |Set pin as output | +|`writePinHige(pin)` |Set pin level as high, assuming it is an output | +|`writePinLow(pin)` |Set pin level as low, assuming it is an output | +|`writePin(pin, level)`|Set pin level, assuming it is an output | +|`readPin(pin)` |Returns the level of the pin | + +## Advance settings + +Each micro-controller can have multiple advance settings regarding its GPIO. This abstraction layer does not limit the use of architecture specific functions. Advance users should consult the datasheet of there desired device and include any needed libraries. For AVR the standard avr/io.h library is used and for STM32 the Chibios [PAL library](http://chibios.sourceforge.net/docs3/hal/group___p_a_l.html) is used. + diff --git a/quantum/config_common.h b/quantum/config_common.h index f6f51b367d..288617255f 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -23,57 +23,154 @@ #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ #ifdef __AVR__ - /* I/O pins */ - #ifndef F0 - #define B0 0x30 - #define B1 0x31 - #define B2 0x32 - #define B3 0x33 - #define B4 0x34 - #define B5 0x35 - #define B6 0x36 - #define B7 0x37 - #define C0 0x60 - #define C1 0x61 - #define C2 0x62 - #define C3 0x63 - #define C4 0x64 - #define C5 0x65 - #define C6 0x66 - #define C7 0x67 - #define D0 0x90 - #define D1 0x91 - #define D2 0x92 - #define D3 0x93 - #define D4 0x94 - #define D5 0x95 - #define D6 0x96 - #define D7 0x97 - #define E0 0xC0 - #define E1 0xC1 - #define E2 0xC2 - #define E3 0xC3 - #define E4 0xC4 - #define E5 0xC5 - #define E6 0xC6 - #define E7 0xC7 - #define F0 0xF0 - #define F1 0xF1 - #define F2 0xF2 - #define F3 0xF3 - #define F4 0xF4 - #define F5 0xF5 - #define F6 0xF6 - #define F7 0xF7 - #define A0 0x00 - #define A1 0x01 - #define A2 0x02 - #define A3 0x03 - #define A4 0x04 - #define A5 0x05 - #define A6 0x06 - #define A7 0x07 - #endif + /* I/O pins */ + #ifndef F0 + #define B0 0x30 + #define B1 0x31 + #define B2 0x32 + #define B3 0x33 + #define B4 0x34 + #define B5 0x35 + #define B6 0x36 + #define B7 0x37 + #define C0 0x60 + #define C1 0x61 + #define C2 0x62 + #define C3 0x63 + #define C4 0x64 + #define C5 0x65 + #define C6 0x66 + #define C7 0x67 + #define D0 0x90 + #define D1 0x91 + #define D2 0x92 + #define D3 0x93 + #define D4 0x94 + #define D5 0x95 + #define D6 0x96 + #define D7 0x97 + #define E0 0xC0 + #define E1 0xC1 + #define E2 0xC2 + #define E3 0xC3 + #define E4 0xC4 + #define E5 0xC5 + #define E6 0xC6 + #define E7 0xC7 + #define F0 0xF0 + #define F1 0xF1 + #define F2 0xF2 + #define F3 0xF3 + #define F4 0xF4 + #define F5 0xF5 + #define F6 0xF6 + #define F7 0xF7 + #define A0 0x00 + #define A1 0x01 + #define A2 0x02 + #define A3 0x03 + #define A4 0x04 + #define A5 0x05 + #define A6 0x06 + #define A7 0x07 + #endif +#elif defined(PROTOCOL_CHIBIOS) + #define A0 PAL_LINE(GPIOA, 0) + #define A1 PAL_LINE(GPIOA, 1) + #define A2 PAL_LINE(GPIOA, 2) + #define A3 PAL_LINE(GPIOA, 3) + #define A4 PAL_LINE(GPIOA, 4) + #define A5 PAL_LINE(GPIOA, 5) + #define A6 PAL_LINE(GPIOA, 6) + #define A7 PAL_LINE(GPIOA, 7) + #define A8 PAL_LINE(GPIOA, 8) + #define A9 PAL_LINE(GPIOA, 9) + #define A10 PAL_LINE(GPIOA, 10) + #define A11 PAL_LINE(GPIOA, 11) + #define A12 PAL_LINE(GPIOA, 12) + #define A13 PAL_LINE(GPIOA, 13) + #define A14 PAL_LINE(GPIOA, 14) + #define A15 PAL_LINE(GPIOA, 15) + #define B0 PAL_LINE(GPIOB, 0) + #define B1 PAL_LINE(GPIOB, 1) + #define B2 PAL_LINE(GPIOB, 2) + #define B3 PAL_LINE(GPIOB, 3) + #define B4 PAL_LINE(GPIOB, 4) + #define B5 PAL_LINE(GPIOB, 5) + #define B6 PAL_LINE(GPIOB, 6) + #define B7 PAL_LINE(GPIOB, 7) + #define B8 PAL_LINE(GPIOB, 8) + #define B9 PAL_LINE(GPIOB, 9) + #define B10 PAL_LINE(GPIOB, 10) + #define B11 PAL_LINE(GPIOB, 11) + #define B12 PAL_LINE(GPIOB, 12) + #define B13 PAL_LINE(GPIOB, 13) + #define B14 PAL_LINE(GPIOB, 14) + #define B15 PAL_LINE(GPIOB, 15) + #define C0 PAL_LINE(GPIOC, 0) + #define C1 PAL_LINE(GPIOC, 1) + #define C2 PAL_LINE(GPIOC, 2) + #define C3 PAL_LINE(GPIOC, 3) + #define C4 PAL_LINE(GPIOC, 4) + #define C5 PAL_LINE(GPIOC, 5) + #define C6 PAL_LINE(GPIOC, 6) + #define C7 PAL_LINE(GPIOC, 7) + #define C8 PAL_LINE(GPIOC, 8) + #define C9 PAL_LINE(GPIOC, 9) + #define C10 PAL_LINE(GPIOC, 10) + #define C11 PAL_LINE(GPIOC, 11) + #define C12 PAL_LINE(GPIOC, 12) + #define C13 PAL_LINE(GPIOC, 13) + #define C14 PAL_LINE(GPIOC, 14) + #define C15 PAL_LINE(GPIOC, 15) + #define D0 PAL_LINE(GPIOD, 0) + #define D1 PAL_LINE(GPIOD, 1) + #define D2 PAL_LINE(GPIOD, 2) + #define D3 PAL_LINE(GPIOD, 3) + #define D4 PAL_LINE(GPIOD, 4) + #define D5 PAL_LINE(GPIOD, 5) + #define D6 PAL_LINE(GPIOD, 6) + #define D7 PAL_LINE(GPIOD, 7) + #define D8 PAL_LINE(GPIOD, 8) + #define D9 PAL_LINE(GPIOD, 9) + #define D10 PAL_LINE(GPIOD, 10) + #define D11 PAL_LINE(GPIOD, 11) + #define D12 PAL_LINE(GPIOD, 12) + #define D13 PAL_LINE(GPIOD, 13) + #define D14 PAL_LINE(GPIOD, 14) + #define D15 PAL_LINE(GPIOD, 15) + #define E0 PAL_LINE(GPIOE, 0) + #define E1 PAL_LINE(GPIOE, 1) + #define E2 PAL_LINE(GPIOE, 2) + #define E3 PAL_LINE(GPIOE, 3) + #define E4 PAL_LINE(GPIOE, 4) + #define E5 PAL_LINE(GPIOE, 5) + #define E6 PAL_LINE(GPIOE, 6) + #define E7 PAL_LINE(GPIOE, 7) + #define E8 PAL_LINE(GPIOE, 8) + #define E9 PAL_LINE(GPIOE, 9) + #define E10 PAL_LINE(GPIOE, 10) + #define E11 PAL_LINE(GPIOE, 11) + #define E12 PAL_LINE(GPIOE, 12) + #define E13 PAL_LINE(GPIOE, 13) + #define E14 PAL_LINE(GPIOE, 14) + #define E15 PAL_LINE(GPIOE, 15) + #define F0 PAL_LINE(GPIOF, 0) + #define F1 PAL_LINE(GPIOF, 1) + #define F2 PAL_LINE(GPIOF, 2) + #define F3 PAL_LINE(GPIOF, 3) + #define F4 PAL_LINE(GPIOF, 4) + #define F5 PAL_LINE(GPIOF, 5) + #define F6 PAL_LINE(GPIOF, 6) + #define F7 PAL_LINE(GPIOF, 7) + #define F8 PAL_LINE(GPIOF, 8) + #define F9 PAL_LINE(GPIOF, 9) + #define F10 PAL_LINE(GPIOF, 10) + #define F11 PAL_LINE(GPIOF, 11) + #define F12 PAL_LINE(GPIOF, 12) + #define F13 PAL_LINE(GPIOF, 13) + #define F14 PAL_LINE(GPIOF, 14) + #define F15 PAL_LINE(GPIOF, 15) #endif /* USART configuration */ diff --git a/quantum/matrix.c b/quantum/matrix.c index 3600d4e7b5..9b5ce33d23 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c @@ -1,5 +1,5 @@ /* -Copyright 2012-2017 Jun Wako, Jack Humbert +Copyright 2012-2018 Jun Wako, Jack Humbert, Yiancar 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 @@ -16,15 +16,13 @@ along with this program. If not, see . */ #include #include -#if defined(__AVR__) -#include -#endif #include "wait.h" #include "print.h" #include "debug.h" #include "util.h" #include "matrix.h" #include "timer.h" +#include "quantum.h" /* Set 0 if debouncing isn't needed */ @@ -60,8 +58,8 @@ along with this program. If not, see . #endif #if (DIODE_DIRECTION == ROW2COL) || (DIODE_DIRECTION == COL2ROW) -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +static const pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; #endif /* matrix state(1:on, 0:off) */ @@ -271,9 +269,7 @@ uint8_t matrix_key_count(void) static void init_cols(void) { for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[x]); } } @@ -293,8 +289,7 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + uint8_t pin_state = readPin(col_pins[col_index]); // Populate the matrix row with the state of the col pin current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); @@ -308,24 +303,19 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) static void select_row(uint8_t row) { - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + setPinOutput(row_pins[row]); + writePinLow(row_pins[row]); } static void unselect_row(uint8_t row) { - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(row_pins[row]); } static void unselect_rows(void) { for(uint8_t x = 0; x < MATRIX_ROWS; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInput(row_pins[x]); } } @@ -334,9 +324,7 @@ static void unselect_rows(void) static void init_rows(void) { for(uint8_t x = 0; x < MATRIX_ROWS; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(row_pins[x]); } } @@ -356,7 +344,7 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[row_index]; // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + if (readPin(row_pins[row_index]) == 0) { // Pin LO, set col bit current_matrix[row_index] |= (ROW_SHIFTER << current_col); @@ -382,24 +370,19 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void select_col(uint8_t col) { - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + setPinOutput(col_pins[col]); + writePinLow(col_pins[col]); } static void unselect_col(uint8_t col) { - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[col]); } static void unselect_cols(void) { for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[x]); } } diff --git a/quantum/quantum.h b/quantum/quantum.h index 7cf16d81e6..6833332117 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -1,4 +1,4 @@ -/* Copyright 2016-2017 Erez Zukerman, Jack Humbert +/* Copyright 2016-2018 Erez Zukerman, Jack Humbert, Yiancar * * 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 @@ -17,9 +17,12 @@ #define QUANTUM_H #if defined(__AVR__) -#include -#include -#include + #include + #include + #include +#endif +#if defined(PROTOCOL_CHIBIOS) + #include "hal.h" #endif #include "wait.h" #include "matrix.h" @@ -33,11 +36,11 @@ #ifdef RGBLIGHT_ENABLE #include "rgblight.h" #else - #ifdef RGB_MATRIX_ENABLE - /* dummy define RGBLIGHT_MODE_xxxx */ - #define RGBLIGHT_H_DUMMY_DEFINE - #include "rgblight.h" - #endif + #ifdef RGB_MATRIX_ENABLE + /* dummy define RGBLIGHT_MODE_xxxx */ + #define RGBLIGHT_H_DUMMY_DEFINE + #include "rgblight.h" + #endif #endif #ifdef SPLIT_KEYBOARD @@ -76,9 +79,9 @@ extern uint32_t default_layer_state; #ifdef AUDIO_ENABLE #include "audio.h" #include "process_audio.h" - #ifdef AUDIO_CLICKY - #include "process_clicky.h" - #endif // AUDIO_CLICKY + #ifdef AUDIO_CLICKY + #include "process_clicky.h" + #endif // AUDIO_CLICKY #endif #ifdef STENO_ENABLE @@ -133,6 +136,48 @@ extern uint32_t default_layer_state; #include "hd44780.h" #endif +//Function substitutions to ease GPIO manipulation +#ifdef __AVR__ + #define pin_t uint8_t + #define setPinInput(pin) _SFR_IO8((pin >> 4) + 1) &= ~ _BV(pin & 0xF) + #define setPinInputHigh(pin) ({\ + _SFR_IO8((pin >> 4) + 1) &= ~ _BV(pin & 0xF);\ + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);\ + }) + #define setPinInputLow(pin) _Static_assert(0, "AVR Processors cannot impliment an input as pull low") + #define setPinOutput(pin) _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF) + + #define writePinHigh(pin) _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF) + #define writePinLow(pin) _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF) + static inline void writePin(pin_t pin, uint8_t level){ + if (level){ + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); + } + } + + #define readPin(pin) (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)) +#elif defined(PROTOCOL_CHIBIOS) + #define pin_t ioline_t + #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) + #define setPinInputHigh(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLUP) + #define setPinInputLow(pin) palSetLineMode(pin, PAL_MODE_INPUT_PULLDOWN) + #define setPinOutput(pin) palSetLineMode(pin, PAL_MODE_OUTPUT_PUSHPULL) + + #define writePinHigh(pin) palSetLine(pin) + #define writePinLow(pin) palClearLine(pin) + static inline void writePin(pin_t pin, uint8_t level){ + if (level){ + palSetLine(pin); + } else { + palClearLine(pin); + } + } + + #define readPin(pin) palReadLine(pin) +#endif + #define STRINGIZE(z) #z #define ADD_SLASH_X(y) STRINGIZE(\x ## y) #define SYMBOL_STR(x) ADD_SLASH_X(x) -- cgit v1.2.3 From daa11dc414d505076ebdf147a4e2c800b8a06190 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Sat, 29 Sep 2018 02:01:00 +1000 Subject: Changed VID/PID, added commands, refactoring --- keyboards/rama/m60_a/config.h | 4 +- keyboards/zeal60/zeal60.c | 134 ++++++++++++++++++++---------------------- keyboards/zeal60/zeal60_api.h | 9 ++- 3 files changed, 74 insertions(+), 73 deletions(-) diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h index 45e7d88963..03794965fc 100644 --- a/keyboards/rama/m60_a/config.h +++ b/keyboards/rama/m60_a/config.h @@ -18,8 +18,8 @@ #include "config_common.h" // USB Device descriptor parameter -#define VENDOR_ID 0xFEED // This is same as Zeal60 for now -#define PRODUCT_ID 0x6060 // This is same as Zeal60 for now +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x060A // 60-A #define DEVICE_VER 0x0001 #define MANUFACTURER RAMA.WORKS #define PRODUCT RAMA M60-A diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c index 092235ca61..be54f75f3d 100644 --- a/keyboards/zeal60/zeal60.c +++ b/keyboards/zeal60/zeal60.c @@ -38,6 +38,14 @@ void eeprom_set_valid(bool valid) eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); } +void eeprom_reset(void) +{ + // Set the Zeal60 specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + #ifdef RAW_ENABLE void raw_hid_receive( uint8_t *data, uint8_t length ) @@ -54,7 +62,7 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) } case id_get_keyboard_value: { - if ( command_data[0] == 0x01 ) + if ( command_data[0] == id_uptime ) { uint32_t value = timer_read32(); command_data[1] = (value >> 24 ) & 0xFF; @@ -104,6 +112,21 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) break; } #endif // RGB_BACKLIGHT_ENABLED + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } default: { // Unhandled message. @@ -119,74 +142,61 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) #endif -void bootmagic_lite(void) +void main_init(void) { - // The lite version of TMK's bootmagic. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc and space bar are held down on power up, - // reset the EEPROM valid state and jump to bootloader. - // Assumes Esc is at [0,0] and spacebar is at [4,7]. - // This isn't very generalized, but we need something that doesn't - // rely on user's keymaps in firmware or EEPROM. - if ( ( matrix_get_row(0) & (1<<0) ) && - ( matrix_get_row(4) & (1<<7) ) ) - { - // Set the Zeal60 specific EEPROM state as invalid. - eeprom_set_valid(false); - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); - // Jump to bootloader. - bootloader_jump(); - } -} - -void matrix_init_kb(void) -{ - bootmagic_lite(); - // If the EEPROM has the magic, the data is good. // OK to load from EEPROM. - if (eeprom_is_valid()) - { + if (eeprom_is_valid()) { #if RGB_BACKLIGHT_ENABLED backlight_config_load(); #endif // RGB_BACKLIGHT_ENABLED - // TODO: do something to "turn on" keymaps in EEPROM? - } - else - { + } else { #if RGB_BACKLIGHT_ENABLED // If the EEPROM has not been saved before, or is out of date, // save the default values to the EEPROM. Default values // come from construction of the zeal_backlight_config instance. backlight_config_save(); #endif // RGB_BACKLIGHT_ENABLED - #ifdef DYNAMIC_KEYMAP_ENABLE // This resets the keymaps in EEPROM to what is in flash. dynamic_keymap_reset(); #endif - // Save the magic number last, in case saving was interrupted eeprom_set_valid(true); } - #if RGB_BACKLIGHT_ENABLED // Initialize LED drivers for backlight. backlight_init_drivers(); - + backlight_timer_init(); backlight_timer_enable(); #endif // RGB_BACKLIGHT_ENABLED +} +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc (matrix 0,0) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + if ( matrix_get_row(0) & (1<<0) ) { + eeprom_reset(); + bootloader_jump(); + } +} + +void matrix_init_kb(void) +{ + bootmagic_lite(); + main_init(); matrix_init_user(); } @@ -205,29 +215,22 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) process_record_backlight(keycode, record); #endif // BACKLIGHT_ENABLED - switch(keycode) - { + switch(keycode) { case FN_MO13: - if (record->event.pressed) - { + if (record->event.pressed) { layer_on(1); update_tri_layer(1, 2, 3); - } - else - { + } else { layer_off(1); update_tri_layer(1, 2, 3); } return false; break; case FN_MO23: - if (record->event.pressed) - { + if (record->event.pressed) { layer_on(2); update_tri_layer(1, 2, 3); - } - else - { + } else { layer_off(2); update_tri_layer(1, 2, 3); } @@ -247,8 +250,7 @@ uint16_t keymap_function_id_to_action( uint16_t function_id ) if ( function_id >= 0x0F00 && function_id <= 0x0FFF ) { uint8_t id = function_id & 0xFF; - switch ( id ) - { + switch ( id ) { case TRIPLE_TAP_1_3: case TRIPLE_TAP_2_3: { @@ -293,24 +295,16 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { case TRIPLE_TAP_1_3: case TRIPLE_TAP_2_3: - if (record->event.pressed) - { + if (record->event.pressed) { layer_on( id == TRIPLE_TAP_1_3 ? 1 : 2 ); - - if (record->tap.count && !record->tap.interrupted) - { - if (record->tap.count >= 3) - { + if (record->tap.count && !record->tap.interrupted) { + if (record->tap.count >= 3) { layer_invert(3); } - } - else - { + } else { record->tap.count = 0; } - } - else - { + } else { layer_off( id == TRIPLE_TAP_1_3 ? 1 : 2 ); } break; diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h index eaac3ad7ce..a65bf2f509 100644 --- a/keyboards/zeal60/zeal60_api.h +++ b/keyboards/zeal60/zeal60_api.h @@ -28,6 +28,13 @@ enum zeal60_command_id id_backlight_config_set_value, id_backlight_config_get_value, id_backlight_config_save, - + id_eeprom_reset, + id_bootloader_jump, id_unhandled = 0xFF, }; + +enum zeal60_keyboard_value_id +{ + id_uptime = 0x01 +}; + -- cgit v1.2.3 From f1b2d46eafbec2b834dc4bcb5ba2dac9f913eed8 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 28 Sep 2018 11:34:40 -0700 Subject: Spell-check update for Userspace documentation Because leaving review comments on a PR that's already been merged doesn't make any sense. --- docs/feature_userspace.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/feature_userspace.md b/docs/feature_userspace.md index b7fc9d8099..5a9fc287b3 100644 --- a/docs/feature_userspace.md +++ b/docs/feature_userspace.md @@ -100,7 +100,7 @@ Additionally, this is a good place to document your code, if you wish to share i # Examples For a brief example, checkout [`/users/_example/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). -For a more complicaed example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. +For a more complicated example, checkout [`/users/drashna/`](https://github.com/qmk/qmk_firmware/tree/master/users/drashna)'s userspace. ## Customized Functions @@ -124,7 +124,7 @@ uint32_t layer_state_set_user (uint32_t state) { return layer_state_set_keymap (state); } ``` -The `__attribute__ ((weak))` part tells the compiler that this is a placce holder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. +The `__attribute__ ((weak))` part tells the compiler that this is a placeholder function that can then be replaced by a version in your `keymap.c`. That way, you don't need to add it to your `keymap.c`, but if you do, you won't get any conflicts because the function is the same name. The `_keymap` part here doesn't matter, it just needs to be something other than `_quantum`, `_kb`, or `_user`, since those are already in use. So you could use `layer_state_set_mine`, `layer_state_set_fn`, or anything else. @@ -140,7 +140,7 @@ ifeq ($(strip $(MACROS_ENABLED)), yes) OPT_DEFS += -DMACROS_ENABLED endif ``` -The `OPT_DEFS` setting causee `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. +The `OPT_DEFS` setting causes `MACROS_ENABLED` to be defined for your keyboards (note the `-D` in front of the name), and you could use `#ifdef MACROS_ENABLED` to check the status in your c/h files, and handle that code based on that. Then you add `MACROS_ENABLED = yes` to the `rules.mk` for you keymap to enable this feature and the code in your userspace. @@ -220,7 +220,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } ``` -This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. +This will add a new `KC_MAKE` keycode that can be used in any of your keymaps. And this keycode will output `make :`, making frequent compiling easier. And this will work with any keyboard and any keymap as it will output the current boards info, so that you don't have to type this out every time. Additionally, this should flash the newly compiled firmware automatically, using the correct utility, based on the bootloader settings (or default to just generating the HEX file). However, it should be noted that this may not work on all systems. AVRDUDE doesn't work on WSL, namely (and will dump the HEX in the ".build" folder instead). -- cgit v1.2.3 From cb468e030712731cffb288cb6d8433cf3b953491 Mon Sep 17 00:00:00 2001 From: Ethan Madden Date: Fri, 28 Sep 2018 12:44:15 -0700 Subject: Keymap: Clicky frequency modulation (#4012) Also worked around my busted dipswitch 2... --- keyboards/planck/keymaps/jetpacktuxedo/keymap.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c index 1324056862..b344bd0767 100644 --- a/keyboards/planck/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/planck/keymaps/jetpacktuxedo/keymap.c @@ -188,15 +188,24 @@ uint16_t muse_counter = 0; uint8_t muse_offset = 70; uint16_t muse_tempo = 20; +extern float clicky_rand; + void encoder_update(bool clockwise) { if (is_clicky_on()) { - if (clockwise) { - clicky_freq_up(); + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + clicky_rand += 0.5f; + } else { + clicky_rand -= 0.5f; + } } else { - clicky_freq_down(); + if (clockwise) { + clicky_freq_up(); + } else { + clicky_freq_down(); + } } - } else - if (muse_mode) { + } else if (muse_mode) { if (IS_LAYER_ON(_RAISE)) { if (clockwise) { muse_offset++; @@ -255,7 +264,8 @@ void dip_update(uint8_t index, bool active) { stop_all_notes(); #endif } - case 2: + break; + case 3: if (active) { clicky_on(); } else { -- cgit v1.2.3 From e4eeb1eb230a4d92f1c88197b71a07b342966e73 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 13:32:54 -0700 Subject: Fix RGB Matrix feature processing in common_features.mk Specifically, an "L" got appended to the controller names for te "valid types", but did not get appended to the blocks that include the specific drives. So, this breaks anything that isn't "Yes". --- common_features.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common_features.mk b/common_features.mk index 6c835abde6..65ff6b5b38 100644 --- a/common_features.mk +++ b/common_features.mk @@ -115,7 +115,7 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif RGB_MATRIX_ENABLE ?= no -VALID_MATRIX_TYPES := yes IS31FL3731L IS31FL3733L custom +VALID_MATRIX_TYPES := yes IS31FL3731 IS31FL3733 custom ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) ifeq ($(filter $(RGB_MATRIX_ENABLE),$(VALID_MATRIX_TYPES)),) $(error RGB_MATRIX_ENABLE="$(RGB_MATRIX_ENABLE)" is not a valid matrix type) -- cgit v1.2.3 From e2dee054d0649cb7b5b051a04a9bd82d14a0fdcd Mon Sep 17 00:00:00 2001 From: Takuya Urakawa Date: Sat, 29 Sep 2018 10:30:44 +0900 Subject: add st-link_cli flashing (#3899) * add st-link_cli support * format names --- tmk_core/chibios.mk | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 25c49204bc..014c8d502a 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -198,10 +198,13 @@ ifneq ("$(SERIAL)","") DFU_ARGS += -S $(SERIAL) endif +ST_LINK_ARGS ?= + # List any extra directories to look for libraries here. EXTRALIBDIRS = $(RULESPATH)/ld DFU_UTIL ?= dfu-util +ST_LINK_CLI ?= st-link_cli # Generate a .qmk for the QMK-FF qmk: $(BUILD_DIR)/$(TARGET).bin @@ -230,5 +233,8 @@ qmk: $(BUILD_DIR)/$(TARGET).bin dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin +st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter + $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst + bin: $(BUILD_DIR)/$(TARGET).bin sizeafter $(COPY) $(BUILD_DIR)/$(TARGET).bin $(TARGET).bin; -- cgit v1.2.3 From 239f02408e219567be060be7e65e92e888304ed0 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 28 Sep 2018 21:32:15 -0400 Subject: Massdrop keyboard updates for SEND_STRING, syscalls, stdio, debug prints, Auto Shift (#3973) * Update for SEND_STRING usage Update for SEND_STRING usage. Sending keyboard reports (kbd, nkro) now obey the minimum polling time. While attempting to send a keyboard report and waiting for a USB poll, other functions of the keyboard, including LED effects and power management, will continue to operate at their intended intervals. * Updates for send string, syscalls, stdio, debug prints, auto shift Now properly waiting for previous keys sent over USB to complete before sending new. Added heap to linker and now compiling with syscalls support. Removed custom string functions and now using stdio. dprintf now works as intended through virtser device. * CTRL and ALT keymap updates CTRL mac keymap updated ALT default and mac keymap updated ALT rules.mk added Auto Shift with default no * Code cleanup as per discussion with vomindoraan Code cleanup as per discussion with vomindoraan --- keyboards/massdrop/alt/alt.h | 10 + keyboards/massdrop/alt/keymaps/default/keymap.c | 35 +-- keyboards/massdrop/alt/keymaps/mac/keymap.c | 33 +-- keyboards/massdrop/alt/rules.mk | 1 + keyboards/massdrop/ctrl/ctrl.h | 10 + keyboards/massdrop/ctrl/keymaps/default/keymap.c | 39 +-- keyboards/massdrop/ctrl/keymaps/mac/keymap.c | 41 +--- keyboards/massdrop/ctrl/rules.mk | 1 + .../SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld | 16 +- tmk_core/arm_atsam.mk | 2 +- tmk_core/common/arm_atsam/printf.h | 2 +- tmk_core/common/print.h | 2 +- tmk_core/protocol/arm_atsam.mk | 1 - tmk_core/protocol/arm_atsam/arm_atsam_protocol.h | 1 - tmk_core/protocol/arm_atsam/d51_util.h | 10 + tmk_core/protocol/arm_atsam/main_arm_atsam.c | 136 ++++++----- tmk_core/protocol/arm_atsam/usb/spfssf.c | 268 --------------------- tmk_core/protocol/arm_atsam/usb/spfssf.h | 57 ----- tmk_core/protocol/arm_atsam/usb/udi_cdc.c | 8 +- tmk_core/protocol/arm_atsam/usb/udi_cdc.h | 10 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 10 +- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h | 2 + 22 files changed, 175 insertions(+), 520 deletions(-) delete mode 100644 tmk_core/protocol/arm_atsam/usb/spfssf.c delete mode 100644 tmk_core/protocol/arm_atsam/usb/spfssf.h diff --git a/keyboards/massdrop/alt/alt.h b/keyboards/massdrop/alt/alt.h index 387985512b..8dfed8d2d6 100644 --- a/keyboards/massdrop/alt/alt.h +++ b/keyboards/massdrop/alt/alt.h @@ -22,3 +22,13 @@ { K45, KC_NO, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, }, \ { K59, K60, K61, KC_NO, KC_NO, KC_NO, K62, KC_NO, KC_NO, KC_NO, K63, K64, K65, K66, K67, }, \ } + +#define TOGGLE_FLAG_AND_PRINT(var, name) { \ + if (var) { \ + dprintf(name " disabled\r\n"); \ + var = !var; \ + } else { \ + var = !var; \ + dprintf(name " enabled\r\n"); \ + } \ + } diff --git a/keyboards/massdrop/alt/keymaps/default/keymap.c b/keyboards/massdrop/alt/keymaps/default/keymap.c index 0cbce86293..a5c443ffcd 100644 --- a/keyboards/massdrop/alt/keymaps/default/keymap.c +++ b/keyboards/massdrop/alt/keymaps/default/keymap.c @@ -136,8 +136,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case L_T_BR: if (record->event.pressed) { led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { + if (led_animation_breathing) { gcr_breathe = gcr_desired; led_animation_breathe_cur = BREATHE_MIN_STEP; breathe_dir = 1; @@ -151,50 +150,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); } return false; case U_T_AGCR: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); } return false; case DBG_TOG: if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); } return false; case DBG_MTRX: if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); } return false; case DBG_KBD: if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); } return false; case DBG_MOU: if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); } return false; case MD_BOOT: @@ -209,4 +190,4 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { default: return true; //Process all other keycodes normally } -} \ No newline at end of file +} diff --git a/keyboards/massdrop/alt/keymaps/mac/keymap.c b/keyboards/massdrop/alt/keymaps/mac/keymap.c index e886290e7e..d6978fd801 100644 --- a/keyboards/massdrop/alt/keymaps/mac/keymap.c +++ b/keyboards/massdrop/alt/keymaps/mac/keymap.c @@ -136,8 +136,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case L_T_BR: if (record->event.pressed) { led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { + if (led_animation_breathing) { gcr_breathe = gcr_desired; led_animation_breathe_cur = BREATHE_MIN_STEP; breathe_dir = 1; @@ -151,50 +150,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); } return false; case U_T_AGCR: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); } return false; case DBG_TOG: if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); } return false; case DBG_MTRX: if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); } return false; case DBG_KBD: if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); } return false; case DBG_MOU: if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); } return false; case MD_BOOT: diff --git a/keyboards/massdrop/alt/rules.mk b/keyboards/massdrop/alt/rules.mk index daf6795852..c5539158f5 100644 --- a/keyboards/massdrop/alt/rules.mk +++ b/keyboards/massdrop/alt/rules.mk @@ -30,3 +30,4 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device +AUTO_SHIFT_ENABLE = no # Auto Shift diff --git a/keyboards/massdrop/ctrl/ctrl.h b/keyboards/massdrop/ctrl/ctrl.h index dc7c7eabe5..c83efca16d 100644 --- a/keyboards/massdrop/ctrl/ctrl.h +++ b/keyboards/massdrop/ctrl/ctrl.h @@ -30,3 +30,13 @@ { K59, K60, K61, K62, K63, K76, K50, K33 }, \ { K72, K73, K74, K75, K85, K86, K87, }, \ } + +#define TOGGLE_FLAG_AND_PRINT(var, name) { \ + if (var) { \ + dprintf(name " disabled\r\n"); \ + var = !var; \ + } else { \ + var = !var; \ + dprintf(name " enabled\r\n"); \ + } \ + } diff --git a/keyboards/massdrop/ctrl/keymaps/default/keymap.c b/keyboards/massdrop/ctrl/keymaps/default/keymap.c index 9bfb7fec58..88c1ac3123 100644 --- a/keyboards/massdrop/ctrl/keymaps/default/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/default/keymap.c @@ -33,7 +33,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), /* [X] = LAYOUT( @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), */ }; @@ -139,8 +139,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case L_T_BR: if (record->event.pressed) { led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { + if (led_animation_breathing) { gcr_breathe = gcr_desired; led_animation_breathe_cur = BREATHE_MIN_STEP; breathe_dir = 1; @@ -154,50 +153,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); } return false; case U_T_AGCR: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); } return false; case DBG_TOG: if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); } return false; case DBG_MTRX: if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); } return false; case DBG_KBD: if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); } return false; case DBG_MOU: if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); } return false; case MD_BOOT: diff --git a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c index a03f891e8c..6c5dfe19c0 100644 --- a/keyboards/massdrop/ctrl/keymaps/mac/keymap.c +++ b/keyboards/massdrop/ctrl/keymaps/mac/keymap.c @@ -33,15 +33,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), [1] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MSTP, KC_VOLU, \ L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_VOLD, \ L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), /* [X] = LAYOUT( @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ ), */ }; @@ -139,8 +139,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case L_T_BR: if (record->event.pressed) { led_animation_breathing = !led_animation_breathing; - if (led_animation_breathing) - { + if (led_animation_breathing) { gcr_breathe = gcr_desired; led_animation_breathe_cur = BREATHE_MIN_STEP; breathe_dir = 1; @@ -154,50 +153,32 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; case U_T_AUTO: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_extra_manual = !usb_extra_manual; - CDC_print("USB extra port manual mode "); - CDC_print(usb_extra_manual ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); } return false; case U_T_AGCR: if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { - usb_gcr_auto = !usb_gcr_auto; - CDC_print("USB GCR auto mode "); - CDC_print(usb_gcr_auto ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); } return false; case DBG_TOG: if (record->event.pressed) { - debug_enable = !debug_enable; - CDC_print("Debug mode "); - CDC_print(debug_enable ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); } return false; case DBG_MTRX: if (record->event.pressed) { - debug_matrix = !debug_matrix; - CDC_print("Debug matrix "); - CDC_print(debug_matrix ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); } return false; case DBG_KBD: if (record->event.pressed) { - debug_keyboard = !debug_keyboard; - CDC_print("Debug keyboard "); - CDC_print(debug_keyboard ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); } return false; case DBG_MOU: if (record->event.pressed) { - debug_mouse = !debug_mouse; - CDC_print("Debug mouse "); - CDC_print(debug_mouse ? "enabled" : "disabled"); - CDC_print("\r\n"); + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); } return false; case MD_BOOT: diff --git a/keyboards/massdrop/ctrl/rules.mk b/keyboards/massdrop/ctrl/rules.mk index daf6795852..c5539158f5 100644 --- a/keyboards/massdrop/ctrl/rules.mk +++ b/keyboards/massdrop/ctrl/rules.mk @@ -30,3 +30,4 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) VIRTSER_ENABLE = no # USB Serial Driver RAW_ENABLE = no # Raw device +AUTO_SHIFT_ENABLE = no # Auto Shift diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld index 3d114f5b7b..35db619717 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld @@ -35,7 +35,7 @@ SEARCH_DIR(.) /* Memory Spaces Definitions */ MEMORY { - //rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 +/*rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000*/ rom (rx) : ORIGIN = 0x00004000, LENGTH = 0x0003C000 ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00020000 bkupram (rwx) : ORIGIN = 0x47000000, LENGTH = 0x00002000 @@ -45,6 +45,9 @@ MEMORY /* The stack size used by the application. NOTE: you need to adjust according to your application. */ STACK_SIZE = DEFINED(STACK_SIZE) ? STACK_SIZE : DEFINED(__stack_size__) ? __stack_size__ : 0x8000; +/* The heap size used by the application. */ +HEAP_SIZE = DEFINED(HEAP_SIZE) ? HEAP_SIZE : DEFINED(__heap_size__) ? __heap_size__ : 0x800; + _srom = ORIGIN(rom); _lrom = LENGTH(rom); _erom = ORIGIN(rom) + LENGTH(rom); @@ -153,6 +156,17 @@ SECTIONS _ezero = .; } > ram + /* .heap section for syscalls */ + .heap (NOLOAD) : + { + . = ALIGN(4); + _end = .; + end = .; + _heap_start = .; + . = . + HEAP_SIZE; + _heap_end = .; + } > ram + /* stack section */ .stack (NOLOAD): { diff --git a/tmk_core/arm_atsam.mk b/tmk_core/arm_atsam.mk index ef412d59d6..06823fb629 100644 --- a/tmk_core/arm_atsam.mk +++ b/tmk_core/arm_atsam.mk @@ -36,7 +36,7 @@ LDFLAGS +=-Wl,--gc-sections LDFLAGS += -Wl,-Map="%OUT%%PROJ_NAME%.map" LDFLAGS += -Wl,--start-group LDFLAGS += -Wl,--end-group -LDFLAGS += -Wl,--gc-sections +LDFLAGS += --specs=rdimon.specs LDFLAGS += -T$(LIB_PATH)/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld OPT_DEFS += -DPROTOCOL_ARM_ATSAM diff --git a/tmk_core/common/arm_atsam/printf.h b/tmk_core/common/arm_atsam/printf.h index 582c83bf54..3206b40bdb 100644 --- a/tmk_core/common/arm_atsam/printf.h +++ b/tmk_core/common/arm_atsam/printf.h @@ -1,8 +1,8 @@ #ifndef _PRINTF_H_ #define _PRINTF_H_ -#define __xprintf dpf int dpf(const char *_Format, ...); +#define __xprintf dpf #endif //_PRINTF_H_ diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 9cbe67bad6..d945276572 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -29,7 +29,7 @@ #include #include "util.h" -#if defined(PROTOCOL_CHIBIOS) +#if defined(PROTOCOL_CHIBIOS) || defined(PROTOCOL_ARM_ATSAM) #define PSTR(x) x #endif diff --git a/tmk_core/protocol/arm_atsam.mk b/tmk_core/protocol/arm_atsam.mk index d535b64cd7..04e02790a0 100644 --- a/tmk_core/protocol/arm_atsam.mk +++ b/tmk_core/protocol/arm_atsam.mk @@ -10,7 +10,6 @@ SRC += $(ARM_ATSAM_DIR)/spi.c SRC += $(ARM_ATSAM_DIR)/startup.c SRC += $(ARM_ATSAM_DIR)/usb/main_usb.c -SRC += $(ARM_ATSAM_DIR)/usb/spfssf.c SRC += $(ARM_ATSAM_DIR)/usb/udc.c SRC += $(ARM_ATSAM_DIR)/usb/udi_cdc.c SRC += $(ARM_ATSAM_DIR)/usb/udi_hid.c diff --git a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h index be73beccd7..2ba0991749 100644 --- a/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h +++ b/tmk_core/protocol/arm_atsam/arm_atsam_protocol.h @@ -36,7 +36,6 @@ along with this program. If not, see . #include "issi3733_driver.h" #include "./usb/compiler.h" #include "./usb/udc.h" -#include "./usb/spfssf.h" #include "./usb/udi_cdc.h" #endif //MD_BOOTLOADER diff --git a/tmk_core/protocol/arm_atsam/d51_util.h b/tmk_core/protocol/arm_atsam/d51_util.h index 465889c7cb..7a35f7989f 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.h +++ b/tmk_core/protocol/arm_atsam/d51_util.h @@ -32,6 +32,16 @@ along with this program. If not, see . #define m15_on REG_PORT_OUTSET1 = 0x40000000 //PB30 High #define m15_off REG_PORT_OUTCLR1 = 0x40000000 //PB30 Low +//Debug Port PB23 +#define m27_ena REG_PORT_DIRSET1 = 0x800000 //PB23 Output +#define m27_on REG_PORT_OUTSET1 = 0x800000 //PB23 High +#define m27_off REG_PORT_OUTCLR1 = 0x800000 //PB23 Low + +//Debug Port PB31 +#define m28_ena REG_PORT_DIRSET1 = 0x80000000 //PB31 Output +#define m28_on REG_PORT_OUTSET1 = 0x80000000 //PB31 High +#define m28_off REG_PORT_OUTCLR1 = 0x80000000 //PB31 Low + #define m15_loop(M15X) {uint8_t M15L=M15X; while(M15L--){m15_on;CLK_delay_us(1);m15_off;}} void m15_print(uint32_t x); diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 8cc7767038..676dac4ea3 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -31,6 +31,7 @@ along with this program. If not, see . //From keyboard's directory #include "config_led.h" +void main_subtasks(void); uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); void send_mouse(report_mouse_t *report); @@ -65,7 +66,7 @@ void send_keyboard(report_keyboard_t *report) if (!keymap_config.nkro) { #endif //NKRO_ENABLE - dprint("s-kbd\r\n"); + while (udi_hid_kbd_b_report_trans_ongoing) { main_subtasks(); } //Run other tasks while waiting for USB to be free irqflags = __get_PRIMASK(); __disable_irq(); @@ -81,7 +82,7 @@ void send_keyboard(report_keyboard_t *report) } else { - dprint("s-nkro\r\n"); + while (udi_hid_nkro_b_report_trans_ongoing) { main_subtasks(); } //Run other tasks while waiting for USB to be free irqflags = __get_PRIMASK(); __disable_irq(); @@ -102,8 +103,6 @@ void send_mouse(report_mouse_t *report) #ifdef MOUSEKEY_ENABLE uint32_t irqflags; - dprint("s-mou\r\n"); - irqflags = __get_PRIMASK(); __disable_irq(); __DMB(); @@ -120,8 +119,6 @@ void send_mouse(report_mouse_t *report) void send_system(uint16_t data) { #ifdef EXTRAKEY_ENABLE - dprintf("s-exks %i\r\n", data); - uint32_t irqflags; irqflags = __get_PRIMASK(); @@ -142,8 +139,6 @@ void send_system(uint16_t data) void send_consumer(uint16_t data) { #ifdef EXTRAKEY_ENABLE - dprintf("s-exkc %i\r\n",data); - uint32_t irqflags; irqflags = __get_PRIMASK(); @@ -160,6 +155,77 @@ void send_consumer(uint16_t data) #endif //EXTRAKEY_ENABLE } +uint8_t g_drvid; + +void main_subtask_usb_state(void) +{ + if (usb_state == USB_STATE_POWERDOWN) + { + uint32_t timer_led = timer_read32(); + + led_on; + if (led_enabled) + { + for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + { + I2C3733_Control_Set(0); + } + } + while (usb_state == USB_STATE_POWERDOWN) + { + if (timer_read32() - timer_led > 1000) led_off; //Good to indicate went to sleep, but only for a second + } + if (led_enabled) + { + for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + { + I2C3733_Control_Set(1); + } + } + led_off; + } +} + +void main_subtask_led(void) +{ + led_matrix_task(); +} + +void main_subtask_power_check(void) +{ + static uint64_t next_5v_checkup = 0; + + if (CLK_get_ms() > next_5v_checkup) + { + next_5v_checkup = CLK_get_ms() + 5; + + v_5v = adc_get(ADC_5V); + v_5v_avg = 0.9 * v_5v_avg + 0.1 * v_5v; + + gcr_compute(); + } +} + +void main_subtask_usb_extra_device(void) +{ + static uint64_t next_usb_checkup = 0; + + if (CLK_get_ms() > next_usb_checkup) + { + next_usb_checkup = CLK_get_ms() + 10; + + USB_HandleExtraDevice(); + } +} + +void main_subtasks(void) +{ + main_subtask_usb_state(); + main_subtask_led(); + main_subtask_power_check(); + main_subtask_usb_extra_device(); +} + int main(void) { led_ena; @@ -201,9 +267,8 @@ int main(void) i2c_led_q_init(); - uint8_t drvid; - for (drvid=0;drvid 1000) led_off; //Good to indicate went to sleep, but only for a second - } - if (led_enabled) - { - for (drvid=0;drvid next_5v_checkup) - { - next_5v_checkup = CLK_get_ms() + 5; - - v_5v = adc_get(ADC_5V); - v_5v_avg = 0.9 * v_5v_avg + 0.1 * v_5v; - - gcr_compute(); - } - - if (CLK_get_ms() > next_usb_checkup) - { - next_usb_checkup = CLK_get_ms() + 10; - - USB_HandleExtraDevice(); - } + main_subtasks(); //Note these tasks will also be run while waiting for USB keyboard polling intervals #ifdef VIRTSER_ENABLE if (CLK_get_ms() > next_print) { next_print = CLK_get_ms() + 250; - //dpf("5v=%i 5vu=%i dlow=%i dhi=%i gca=%i gcd=%i\r\n",v_5v,v_5v_avg,v_5v_avg-V5_LOW,v_5v_avg-V5_HIGH,gcr_actual,gcr_desired); + dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n",v_5v,v_5v_avg,v_5v_avg-V5_LOW,v_5v_avg-V5_HIGH,gcr_actual,gcr_desired); } #endif //VIRTSER_ENABLE } diff --git a/tmk_core/protocol/arm_atsam/usb/spfssf.c b/tmk_core/protocol/arm_atsam/usb/spfssf.c deleted file mode 100644 index 449a8bb7d0..0000000000 --- a/tmk_core/protocol/arm_atsam/usb/spfssf.c +++ /dev/null @@ -1,268 +0,0 @@ -#include "samd51j18a.h" -#include "stdarg.h" -#include "spfssf.h" -#include "usb_util.h" - -int vspf(char *_Dest, const char *_Format, va_list va) -{ - //va_list va; //Variable argument list variable - char *d = _Dest; //Pointer to dest - - //va_start(va,_Format); //Initialize the variable argument list - while (*_Format) //While not end of format string - { - if (*_Format == SPF_SPEC_START) //If current format string character is the specifier start character - { - _Format++; //Skip over the character - while (*_Format && *_Format <= 64) _Format++; //Forward past any options - if (*_Format == SPF_SPEC_START) *d++ = *_Format; //If the character is the specifier start character, output the character and advance dest - else if (*_Format == SPF_SPEC_LONG) //If the character is the long type - { - _Format++; //Skip over the character - if (*_Format == SPF_SPEC_DECIMAL) //If the character is the decimal type - { - int64_t buf = va_arg(va,int64_t); //Get the next value from the va list - //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and invert number - //spf_uint2str_32_3t(&d,buf,32); //Perform the conversion - d += UTIL_ltoa_radix(buf, d, 10); - } - else if (*_Format == SPF_SPEC_UNSIGNED) //If the character is the unsigned type - { - uint64_t num = va_arg(va,uint64_t); //Get the next value from the va list - //spf_uint2str_32_3t(&d,num,32); //Perform the conversion - d += UTIL_ltoa_radix(num, d, 10); - } - else if (*_Format == SPF_SPEC_UHINT || *_Format == SPF_SPEC_UHINT_UP) //If the character is the unsigned type - { - uint64_t buf = va_arg(va,uint64_t); //Get the next value from the va list - //spf_uint2hex_32(&d,(unsigned long) buf); - d += UTIL_ltoa_radix(buf, d, 16); - } - else //If the character was not a known type - { - *d++ = SPF_SPEC_START; //Output the start specifier - *d++ = SPF_SPEC_LONG; //Output the long type - *d++ = *_Format; //Output the unknown type - } - } - else if (*_Format == SPF_SPEC_DECIMAL) //If the character is the decimal type - { - int buf = va_arg(va,int); //Get the next value from the va list - //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and invert number - //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion - d += UTIL_itoa(buf, d); - } - else if (*_Format == SPF_SPEC_INT) //If the character is the integer type - { - int buf = va_arg(va,int); //Get the next value from the va list - //if (buf < 0) { *d++ = '-'; buf = -buf; } //If the given number is negative, add a negative sign to the dest and inverted number - //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion - d += UTIL_itoa(buf, d); - } - else if (*_Format == SPF_SPEC_UINT) //If the character is the unsigned integer type - { - int buf = va_arg(va,int); //Get the next value from the va list - //spf_uint2str_32_3t(&d,buf,16); //Perform the conversion - d += UTIL_utoa(buf, d); - } - else if (*_Format == SPF_SPEC_STRING) //If the character is the string type - { - char *buf = va_arg(va,char*); //Get the next value from the va list - while (*buf) *d++ = *buf++; //Perform the conversion (simply output characters and adcance pointers) - } - else if (*_Format == SPF_SPEC_UHINT || *_Format == SPF_SPEC_UHINT_UP) //If the character is the short type - { - int buf = va_arg(va,unsigned int); //Get the next value from the va list - //spf_uint2hex_32(&d,(unsigned long) buf); //Perform the conversion - d += UTIL_utoa(buf, d); - } - else //If the character type is unknown - { - *d++ = SPF_SPEC_START; //Output the start specifier - *d++ = *_Format; //Output the unknown type - } - } - else *d++ = *_Format; //If the character is unknown, output it to dest and advance dest - _Format++; //Advance the format buffer pointer to next character - } - //va_end(va); //End the variable argument list - - *d = '\0'; //Cap off the destination string with a zero - - return d - _Dest; //Return the length of the destintion buffer -} - -int spf(char *_Dest, const char *_Format, ...) -{ - va_list va; //Variable argument list variable - int result; - - va_start(va,_Format); //Initialize the variable argument list - result = vspf(_Dest, _Format, va); - va_end(va); - return result; -} - -//sscanf string to number (integer types) -int64_t ssf_ston(const char **_Src, uint32_t count, uint32_t *conv_count) -{ - int64_t value = 0; //Return value accumulator - uint32_t counter=count; //Counter to keep track of numbers converted - const char* p; //Pointer to first non space character - - while (*(*_Src) == SSF_SKIP_SPACE) (*_Src)++; //Forward through the whitespace to next non whitespace - - p = (*_Src); //Set pointer to first non space character - if (*p == '+' || *p == '-') (*_Src)++; //Skip over sign if any - while (*(*_Src) >= ASCII_NUM_START && - *(*_Src) <= ASCII_NUM_END && - counter) //While the source character is a digit and counter is not zero - { - value *= 10; //Multiply result by 10 to make room for next 1's place number - value += *(*_Src)++ - ASCII_NUM_START; //Add source number to value - counter--; //Decrement counter - } - if (counter - count == 0) return 0; //If no number conversion were performed, return 0 - if (*p == '-') value = -value; //If the number given was negative, make the result negative - - if (conv_count) (*conv_count)++; //Increment the converted count - return value; //Return the value -} - -uint64_t ssf_hton(const char **_Src, uint32_t count,uint32_t *conv_count) -{ - int64_t value=0; //Return value accumulator - uint32_t counter=count; //Counter to keep track of numbers converted - //const char* p; //Pointer to first non space character - char c; - - while (*(*_Src) == SSF_SKIP_SPACE) (*_Src)++; //Forward through the whitespace to next non whitespace - - //p = (*_Src); //Set pointer to first non space character - - while (counter) - { - c = *(*_Src)++; - if (c >= 'a' && c <= 'f') c -= ('a'-'A'); //toupper - if (c < '0' || (c > '9' && c < 'A') || c > 'F') break; - value *= 16; //Multiply result by 10 to make room for next 1's place number - c = c - '0'; - if (c > 9) c -= 7; - value += c; //Add source number to value - counter--; //Decrement counter - } - - if (counter - count == 0) return 0; //If no number conversion were performed, return 0 - //if (*p == '-') value = -value; //If the number given was negative, make the result negative - - if (conv_count) (*conv_count)++; //Increment the converted count - return value; -} - -//sscanf -int ssf(const char *_Src, const char *_Format, ...) -{ - va_list va; //Variable argument list variable - unsigned char looking_for=0; //Static char specified in format to be found in source - uint32_t conv_count=0; //Count of conversions made - - va_start(va,_Format); //Initialize the variable argument list - while (*_Format) //While the format string has not been fully read - { - if (looking_for != 0) //If we are looking for a matching character in the source string - { - while (*_Src != looking_for && *_Src) _Src++; //While the character is not found in the source string and not the end of the source - // string, increment the pointer position - if (*_Src == looking_for) _Src++; //If the character was found, step over it - else break; //Else the end was reached and the scan is now invalid (Could not find static character) - looking_for = 0; //Clear the looking for character - } - if (*_Format == SSF_SPEC_START) //If the current format character is the specifier start character - { - _Format++; //Step over the specifier start character - if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found - { - int *value=va_arg(va,int*); //User given destination address - //*value = (int)ssf_ston(&_Src,5,&conv_count); //Run conversion - *value = (int)ssf_ston(&_Src,10,&conv_count); //Run conversion - } - else if (*_Format == SSF_SPEC_LONG) //If the long specifier type is found - { - _Format++; //Skip over the specifier type - if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found - { - int64_t *value=va_arg(va,int64_t*); //User given destination address - //*value = (int64_t)ssf_ston(&_Src,10,&conv_count); //Run conversion - *value = (int64_t)ssf_ston(&_Src,19,&conv_count); //Run conversion - } - else if (*_Format == SSF_SPEC_UHINT) //If the decimal specifier type is found - { - uint64_t *value=va_arg(va,uint64_t *); //User given destination address - //*value = (uint64_t int)ssf_hton(&_Src,12,&conv_count); //Run conversion - *value = (uint64_t)ssf_hton(&_Src,16,&conv_count); //Run conversion - } - } - else if (*_Format == SSF_SPEC_SHORTINT) //If the short int specifier type is found - { - _Format++; //Skip over the specifier type - if (*_Format == SSF_SPEC_SHORTINT) //If the short int specifier type is found - { - _Format++; //Skip over the specifier type - if (*_Format == SSF_SPEC_DECIMAL) //If the decimal specifier type is found - { - unsigned char *value=va_arg(va,unsigned char*); //User given destination address - //*value = (unsigned char)ssf_ston(&_Src,3,&conv_count); //Run conversion - *value = (unsigned char)ssf_ston(&_Src,5,&conv_count); //Run conversion - } - } - } - else if (*_Format == SSF_SPEC_STRING) //If the specifier type is string - { - char *value=va_arg(va,char*); //User given destination address, max chars read pointer - while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace - while (*_Src != SSF_SKIP_SPACE && *_Src) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest - *value = 0; //Cap off the string pointer with zero - conv_count++; //Increment the converted count - } - else if (*_Format == SSF_SPEC_VERSION) //If the specifier type is string - { - char *value=va_arg(va,char*); //User given destination address, max chars read pointer - while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace - while (*_Src != SSF_DELIM_COMMA && *_Src) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest - *value = 0; //Cap off the string pointer with zero - conv_count++; //Increment the converted count - } - else if (*_Format >= ASCII_NUM_START && *_Format <= ASCII_NUM_END) - { - uint32_t len = (uint32_t)ssf_ston(&_Format,3,NULL); //Convert the given length - if (*_Format == SSF_SPEC_STRING) //If the specifier type is string - { - char *value=va_arg(va,char*),*e; //User given destination address, max chars read pointer - while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace - e = (char*)_Src+len; //Set a maximum length pointer location - while (*_Src != SSF_SKIP_SPACE && *_Src && _Src != e) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest - *value = 0; //Cap off the string pointer with zero - conv_count++; //Increment the converted count - } - else if (*_Format == SSF_SPEC_VERSION) //If the specifier type is string - { - char *value=va_arg(va,char*),*e; //User given destination address, max chars read pointer - while (*_Src == SSF_SKIP_SPACE) _Src++; //Forward through the whitespace to next non whitespace - e = (char*)_Src+len; //Set a maximum length pointer location - while (*_Src != SSF_DELIM_COMMA && *_Src && _Src != e) *value++ = *_Src++; //While any character but space and not end of string and not end location, copy char to dest - *value = 0; //Cap off the string pointer with zero - conv_count++; //Increment the converted count - } - } - else if (*_Format == SSF_SPEC_START) looking_for = *_Format; //If another start specifier character is found, output a specifier character - else break; //Scan is now invalid (Uknown type specified) - } - else if (*_Format == SSF_SKIP_SPACE) { } //If a space is found, ignore it - else looking_for = *_Format; //If any other character is found, it is static and should be found in src as well - _Format++; //Skip over current format character - } - - va_end(va); //End the variable argument list - return conv_count; //Return the number of conversions made -} - diff --git a/tmk_core/protocol/arm_atsam/usb/spfssf.h b/tmk_core/protocol/arm_atsam/usb/spfssf.h deleted file mode 100644 index 337a904dfe..0000000000 --- a/tmk_core/protocol/arm_atsam/usb/spfssf.h +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef ____spfssf_h -#define ____spfssf_h - -#include - -#define sprintf spf -#define sscanf ssf - -#define SIZEOF_OFFSET 1 - -#ifndef NULL -#define NULL 0 -#endif - -#define SPF_NONE 0 - -#define SPF_SPEC_START 37 //% -#define SPF_SPEC_DECIMAL 100 //d 16bit dec signed (-32767 to 32767) DONE same as i -#define SPF_SPEC_INT 105 //i 16bit dec signed (-32767 to 32767) DONE same as d -#define SPF_SPEC_UINT 117 //u 16bit dec unsigned (0 to 65535) DONE -#define SPF_SPEC_STRING 115 //s variable length (abcd...) DONE -#define SPF_SPEC_UHINT 120 //x 16bit hex lwrc (7fa) DONE -#define SPF_SPEC_UHINT_UP 88 //x 16bit hex lwrc (7fa) DONE -#define SPF_SPEC_LONG 108 //l start of either ld or lu DONE -#define SPF_SPEC_DECIMAL 100 //ld 32bit dec signed (-2147483647 to 2147483647) DONE -#define SPF_SPEC_UNSIGNED 117 //lu 32bit dec unsigned (0 to 4294967295) DONE -#define SPF_SPEC_UHINT 120 //lx 32bit hex unsigned (0 to ffffffff) DONE - -#define SSF_SPEC_START 37 //% -#define SSF_SPEC_SHORTINT 104 //h 8bit dec signed (-127 to 127) DONE -#define SSF_LEN_SHORTINT 3 //hhd -#define SSF_SPEC_DECIMAL 100 //d 16bit dec signed (-32767 to 32767) DONE -#define SSF_LEN_DECIMAL 5 //32767 -#define SSF_SPEC_INT 105 //i 16bit dec signed (-32767 to 32767) DONE -#define SSF_LEN_INT 5 //32767 -#define SSF_SPEC_LONG 108 //l start of either ld or lu DONE -#define SSF_SPEC_DECIMAL 100 //ld 32bit dec signed (-2147483647 to 2147483647) DONE -#define SSF_SPEC_UHINT 120 //lx 32bit hex unsigned DONE -#define SSF_LEN_LDECIMAL 10 //2147483647 -#define SSF_SPEC_STRING 115 //s variable length (abcd...) DONE -#define SSF_SKIP_SPACE 32 //space - -#define SSF_SPEC_VERSION 118 //v collect to comma delimiter - special -#define SSF_DELIM_COMMA 44 //, - -#define ASCII_NUM_START 48 //0 -#define ASCII_NUM_END 58 //9 - -#define T_UINT32_0_LIMIT 14 -#define T_UINT32_1_LIMIT 27 - -int vspf(char *_Dest, const char *_Format, va_list va); -int spf(char *_Dest, const char *_Format, ...); -int ssf(const char *_Src, const char *_Format, ...); - -#endif //____spfssf_h - diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index b4159d3251..15f0f760cc 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -54,7 +54,6 @@ #include #include "udi_cdc_conf.h" #include "udi_device_conf.h" -#include "spfssf.h" #include "stdarg.h" #include "tmk_core/protocol/arm_atsam/clks.h" @@ -1259,7 +1258,6 @@ uint32_t CDC_print(char *printbuf) return 1; } - char printbuf[CDC_PRINTBUF_SIZE]; int dpf(const char *_Format, ...) @@ -1267,8 +1265,8 @@ int dpf(const char *_Format, ...) va_list va; //Variable argument list variable int result; - va_start(va,_Format); //Initialize the variable argument list - result = vspf(printbuf, _Format, va); + va_start(va, _Format); //Initialize the variable argument list + result = vsnprintf(printbuf, CDC_PRINTBUF_SIZE, _Format, va); va_end(va); CDC_print(printbuf); @@ -1377,8 +1375,6 @@ void CDC_init(void) printbuf[0]=0; } -char printbuf[CDC_PRINTBUF_SIZE]; - #endif //CDC line 62 //@} diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h index 6b70e96d0e..e134cf2360 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h @@ -57,8 +57,8 @@ #include "udi.h" // Check the number of port -#ifndef UDI_CDC_PORT_NB -# define UDI_CDC_PORT_NB 1 +#ifndef UDI_CDC_PORT_NB +# define UDI_CDC_PORT_NB 1 #endif #if (UDI_CDC_PORT_NB > 1) # error UDI_CDC_PORT_NB must be at most 1 @@ -86,9 +86,6 @@ extern UDC_DESC_STORAGE udi_api_t udi_api_cdc_data; //! CDC data endpoints size for FS speed (8B, 16B, 32B, 64B) #define UDI_CDC_DATA_EPS_FS_SIZE CDC_RX_SIZE -#define CDC_PRINT_BUF_SIZE 256 -extern char printbuf[CDC_PRINT_BUF_SIZE]; - //@} /** @@ -371,9 +368,6 @@ uint32_t CDC_print(char *printbuf); uint32_t CDC_input(void); void CDC_init(void); -#define __xprintf dpf -int dpf(const char *_Format, ...); - #ifdef __cplusplus } #endif diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 18f69350c0..1a6f7905e6 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -45,6 +45,7 @@ */ #include "samd51j18a.h" +#include "d51_util.h" #include "conf_usb.h" #include "usb_protocol.h" #include "udd.h" @@ -86,7 +87,7 @@ bool udi_hid_kbd_b_report_valid; COMPILER_WORD_ALIGNED uint8_t udi_hid_kbd_report[UDI_HID_KBD_REPORT_SIZE]; -static bool udi_hid_kbd_b_report_trans_ongoing; +volatile bool udi_hid_kbd_b_report_trans_ongoing; COMPILER_WORD_ALIGNED static uint8_t udi_hid_kbd_report_trans[UDI_HID_KBD_REPORT_SIZE]; @@ -186,8 +187,7 @@ bool udi_hid_kbd_send_report(void) return false; } - memcpy(udi_hid_kbd_report_trans, udi_hid_kbd_report, - UDI_HID_KBD_REPORT_SIZE); + memcpy(udi_hid_kbd_report_trans, udi_hid_kbd_report, UDI_HID_KBD_REPORT_SIZE); udi_hid_kbd_b_report_valid = false; udi_hid_kbd_b_report_trans_ongoing = udd_ep_run(UDI_HID_KBD_EP_IN | USB_EP_DIR_IN, @@ -249,7 +249,7 @@ bool udi_hid_nkro_b_report_valid; COMPILER_WORD_ALIGNED uint8_t udi_hid_nkro_report[UDI_HID_NKRO_REPORT_SIZE]; -static bool udi_hid_nkro_b_report_trans_ongoing; +volatile bool udi_hid_nkro_b_report_trans_ongoing; COMPILER_WORD_ALIGNED static uint8_t udi_hid_nkro_report_trans[UDI_HID_NKRO_REPORT_SIZE]; @@ -355,7 +355,7 @@ bool udi_hid_nkro_send_report(void) return false; } - memcpy(udi_hid_nkro_report_trans, udi_hid_nkro_report,UDI_HID_NKRO_REPORT_SIZE); + memcpy(udi_hid_nkro_report_trans, udi_hid_nkro_report, UDI_HID_NKRO_REPORT_SIZE); udi_hid_nkro_b_report_valid = false; udi_hid_nkro_b_report_trans_ongoing = udd_ep_run(UDI_HID_NKRO_EP_IN | USB_EP_DIR_IN, diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h index 9a2741534d..babfdb7a78 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -60,6 +60,7 @@ extern "C" { #ifdef KBD extern UDC_DESC_STORAGE udi_api_t udi_api_hid_kbd; extern bool udi_hid_kbd_b_report_valid; +extern volatile bool udi_hid_kbd_b_report_trans_ongoing; extern uint8_t udi_hid_kbd_report_set; bool udi_hid_kbd_send_report(void); #endif //KBD @@ -70,6 +71,7 @@ bool udi_hid_kbd_send_report(void); #ifdef NKRO extern UDC_DESC_STORAGE udi_api_t udi_api_hid_nkro; extern bool udi_hid_nkro_b_report_valid; +extern volatile bool udi_hid_nkro_b_report_trans_ongoing; bool udi_hid_nkro_send_report(void); #endif //NKRO -- cgit v1.2.3 From ab83aedfabd7f11d914466d008ab5938b3e0107f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 19:22:31 -0700 Subject: Second attempt to reduce the size of the USB BLE Converter (#4010) * Disable Leader to reduce firmware size for Travis * Additionaly fixes to USB_USB\BLE Keyboard converter * Disable One Shots to get USB to USB BLE converter to fit --- keyboards/converter/usb_usb/ble/config.h | 2 + keyboards/converter/usb_usb/ble/rules.mk | 2 +- keyboards/converter/usb_usb/keymap.c | 288 ------------------------------- 3 files changed, 3 insertions(+), 289 deletions(-) delete mode 100644 keyboards/converter/usb_usb/keymap.c diff --git a/keyboards/converter/usb_usb/ble/config.h b/keyboards/converter/usb_usb/ble/config.h index 5333e17c82..3bf3b2963a 100644 --- a/keyboards/converter/usb_usb/ble/config.h +++ b/keyboards/converter/usb_usb/ble/config.h @@ -11,3 +11,5 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION +#define NO_ACTION_ONESHOT + diff --git a/keyboards/converter/usb_usb/ble/rules.mk b/keyboards/converter/usb_usb/ble/rules.mk index 84aa767f54..f5ab3880bf 100644 --- a/keyboards/converter/usb_usb/ble/rules.mk +++ b/keyboards/converter/usb_usb/ble/rules.mk @@ -4,7 +4,7 @@ F_CPU = 8000000 BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/converter/usb_usb/keymap.c b/keyboards/converter/usb_usb/keymap.c deleted file mode 100644 index 16f2a28092..0000000000 --- a/keyboards/converter/usb_usb/keymap.c +++ /dev/null @@ -1,288 +0,0 @@ -/* -Copyright 2017 Balz Guenat - -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 . -*/ - -#include "keymap_common.h" - - -const uint8_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { - /* 0: plain Qwerty without layer switching - * ,---------------. ,---------------. ,---------------. - * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| - * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help | - * `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn| - * |-----------------------------------------------------------| |-----------| |---------------| |-------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und| - * |-----------------------------------------------------------| `-----------' |---------------| |-------| - * |CapsL | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy| - * |-----------------------------------------------------------| ,---. |---------------| |-------| - * |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst| - * |-----------------------------------------------------------| ,-----------. |---------------| |-------| - * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| - * `-----------------------------------------------------------' `-----------' `---------------' `-------' - */ - // KEYMAP_ALL( - // F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - // ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - // GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - // TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - // CAPS,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - // LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - // LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - // ), - KEYMAP_ALL( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - FN0, A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - ), - KEYMAP_ALL( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, - GRV, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - CAPS,MPRV,VOLU,MNXT,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,MUTE,VOLD,MPLY,TRNS,TRNS,LEFT,DOWN,UP, RGHT,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS - ), -}; - -// const action_t fn_actions[] PROGMEM = {}; - -const action_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), -}; - - - -/* - * Keymap samples - */ -#if 0 - /* ANSI layout - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |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| -| =| Bsp| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| - * |-----------------------------------------------------------| `-----------' |-----------| | - * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| Return| | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | - * |-----------------------------------------------------------| ,-----------. |-----------| | - * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent| - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, ENT, P4, P5, P6, PPLS, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT - ), - - /* ISO layout - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |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| -| ^| Bsp| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Retn| |Del|End|PgD| | 7| 8| 9| +| - * |------------------------------------------------------` | `-----------' |-----------| | - * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #| | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shft|\ | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3|Ent| - * |-----------------------------------------------------------| ,-----------. |-----------| | - * |Ctl|Gui|Alt| Space |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_ISO( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PPLS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT - ), - - /* JIS layout - * ,---. ,---------------. ,---------------. ,---------------. ,-----------. - * |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| -| ^|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| - * |-----------------------------------------------------------| |-----------| |---------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| @| [| Retn| |Del|End|PgD| | 7| 8| 9| +| - * |------------------------------------------------------` | `-----------' |-----------| | - * |CapsL | A| S| D| F| G| H| J| K| L| ;| :| ]| | | 4| 5| 6| | - * |-----------------------------------------------------------| ,---. |---------------| - * |Shft | Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|Ent| - * |-----------------------------------------------------------| ,-----------. |-----------| | - * |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | - * `-----------------------------------------------------------' `-----------' `---------------' - */ - KEYMAP_JIS( - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, DEL, END, PGDN, P7, P8, P9, PPLS, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, - LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT - ), - - /* Colemak http://colemak.com - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| - * |-----------------------------------------------------------| - * |Tab | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| - * |-----------------------------------------------------------| - * |BackSp| A| R| S| T| D| H| N| E| I| O| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| C| V| B| K| M| ,| ,| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `----------------------------------------------------------' - */ - KEYMAP_ALL( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - TAB, Q, W, F, P, G, J, L, U, Y, SCLN,LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - BSPC,A, R, S, T, D, H, N, E, I, O, QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - LSFT,NUBS,Z, X, C, V, B, K, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - ), - - /* Dvorak http://en.wikipedia.org/wiki/Dvorak_Simplified_Keyboard - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| [| ]|Backspa| - * |-----------------------------------------------------------| - * |Tab | '| ,| .| P| Y| F| G| C| R| L| /| =| \| - * |-----------------------------------------------------------| - * |BackSp| A| O| E| U| I| D| H| T| N| S| -|Return | - * |-----------------------------------------------------------| - * |Shift | ;| Q| J| K| X| B| M| Wl V| Z|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP_ALL( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - TAB, QUOT,COMM,DOT, P, Y, F, G, C, R, L, SLSH,EQL, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - CAPS,A, O, E, U, I, D, H, T, N, S, MINS, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - LSFT,NUBS,SCLN,Q, J, K, X, B, M, W, V, Z, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - ), - - /* Workman http://viralintrospection.wordpress.com/2010/09/06/a-different-philosophy-in-designing-keyboard-layouts/ - * ,-----------------------------------------------------------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| - * |-----------------------------------------------------------| - * |Tab | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| - * |-----------------------------------------------------------| - * |CapsLo| A| S| H| T| G| Y| N| E| O| I| '|Return | - * |-----------------------------------------------------------| - * |Shift | Z| X| M| C| V| K| L| ,| ,| /|Shift | - * |-----------------------------------------------------------| - * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| - * `-----------------------------------------------------------' - */ - KEYMAP_ALL( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - TAB, Q, D, R, W, B, J, F, U, P, SCLN,LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - CAPS,A, S, H, T, G, Y, N, E, O, I, QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - LSFT,NUBS,Z, X, M, C, V, K, L, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - ), - - -/* - * SpaceFN layout - * http://geekhack.org/index.php?topic=51069.0 - */ -const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: plain Qwerty - * ,---------------. ,---------------. ,---------------. - * |F13|F14|F15|F16| |F17|F18|F19|F20| |F21|F22|F23|F24| - * ,---. |---------------| |---------------| |---------------| ,-----------. ,---------------. ,-------. - * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut|Pwr| | Help | - * `---' `---------------' `---------------' `---------------' `-----------' `---------------' `-------' - * ,-----------------------------------------------------------. ,-----------. ,---------------. ,-------. - * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| |Stp|Agn| - * |-----------------------------------------------------------| |-----------| |---------------| |-------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| |Mnu|Und| - * |-----------------------------------------------------------| `-----------' |---------------| |-------| - * |LCtrl | A| S| D| F| G| H| J| K| L| ;| :| #|Retn| | 4| 5| 6|KP,| |Sel|Cpy| - * |-----------------------------------------------------------| ,---. |---------------| |-------| - * |Shft| <| Z| X| C| V| B| N| M| ,| ,| /| RO|Shift | |Up | | 1| 2| 3|KP=| |Exe|Pst| - * |-----------------------------------------------------------| ,-----------. |---------------| |-------| - * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| - * `-----------------------------------------------------------' `-----------' `---------------' `-------' - */ - [0] = KEYMAP_ALL( - F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, - ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, - ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, - TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, BSLS, DEL, END, PGDN, P7, P8, P9, PPLS, MENU,UNDO, - LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT, NUHS,ENT, P4, P5, P6, PCMM, SLCT,COPY, - LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, - LCTL,LGUI,LALT,MHEN,HANJ, FN0, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT - ), - - /* 1: SpaceFN - * ,-----------------------------------------------------------. - * |` | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|Delete | - * |-----------------------------------------------------------| - * |Caps | | |Esc| | | |Hom|Up |End|Psc|Slk|Pau|Ins | - * |-----------------------------------------------------------| - * | | | | | | |PgU|Lef|Dow|Rig| | | | - * |-----------------------------------------------------------| - * | | | | | |Spc|PgD|` |~ | |Men| | - * |-----------------------------------------------------------| - * | | | | | | | | | - * `-----------------------------------------------------------' - */ - [1] = KEYMAP_ALL( - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, - TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - CAPS,TRNS,TRNS,ESC, TRNS,TRNS,TRNS,HOME,UP, END, PSCR,SLCK,PAUS, INS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,PGUP,LEFT,DOWN,RGHT,TRNS,TRNS, TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,SPC, PGDN,GRV, FN1, TRNS,APP, TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, - TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS, TRNS,TRNS, TRNS,TRNS - ), -}; - -const action_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(1, KC_SPACE), - [1] = ACTION_MODS_KEY(MOD_LSFT, KC_GRV), // tilde -}; - -#endif -- cgit v1.2.3 From 3d767e4aab5a6c87cb334a22ffaa9b6ad8e76393 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 10:37:50 -0700 Subject: Disable Moueskeys to reduce Vitamins Included firmware size --- keyboards/vitamins_included/config.h | 2 +- keyboards/vitamins_included/rules.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/vitamins_included/config.h b/keyboards/vitamins_included/config.h index abbb310563..bcaf777c77 100644 --- a/keyboards/vitamins_included/config.h +++ b/keyboards/vitamins_included/config.h @@ -23,5 +23,5 @@ along with this program. If not, see . #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER + diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk index 8ac39dffbc..4f6d497a6b 100644 --- a/keyboards/vitamins_included/rules.mk +++ b/keyboards/vitamins_included/rules.mk @@ -53,7 +53,7 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration -- cgit v1.2.3 From 20a10bd0846d502069203419f57e36fd7467df5e Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Sep 2018 19:23:13 -0700 Subject: Size fix for Hadron, take 2 (#4009) * Add Link Time Optimization to reduce firmware size * Disable Mousekeys on Hadron to save room --- keyboards/hadron/keymaps/default/rules.mk | 2 +- keyboards/hadron/rules.mk | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/hadron/keymaps/default/rules.mk b/keyboards/hadron/keymaps/default/rules.mk index 4d08544f3a..545ffa75c1 100644 --- a/keyboards/hadron/keymaps/default/rules.mk +++ b/keyboards/hadron/keymaps/default/rules.mk @@ -5,7 +5,7 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/hadron/rules.mk b/keyboards/hadron/rules.mk index 1f835e0660..2a8b780450 100644 --- a/keyboards/hadron/rules.mk +++ b/keyboards/hadron/rules.mk @@ -71,3 +71,5 @@ SRC = i2c.c \ ssd1306.c DEFAULT_FOLDER = hadron/ver2 + +EXTRAFLAGS += -flto -- cgit v1.2.3 From daf0cc60bff54be948c923cdc40aa80b82a27f6d Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 28 Sep 2018 22:34:56 -0400 Subject: CTRL keyboard bootloader_jump support Adds support for CTRL keyboards to enter bootloader via bootloader_jump() --- .../SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld | 3 ++ tmk_core/common/arm_atsam/bootloader.c | 32 ++++++++++++---------- tmk_core/protocol/arm_atsam/md_bootloader.h | 7 +++++ tmk_core/protocol/arm_atsam/startup.c | 11 ++++++++ 4 files changed, 38 insertions(+), 15 deletions(-) diff --git a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld index 35db619717..1c63547863 100644 --- a/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld +++ b/lib/arm_atsam/packs/atmel/SAMD51_DFP/1.0.70/gcc/gcc/samd51j18a_flash.ld @@ -51,6 +51,9 @@ HEAP_SIZE = DEFINED(HEAP_SIZE) ? HEAP_SIZE : DEFINED(__heap_size__) ? __heap_siz _srom = ORIGIN(rom); _lrom = LENGTH(rom); _erom = ORIGIN(rom) + LENGTH(rom); +_sram = ORIGIN(ram); +_lram = LENGTH(ram); +_eram = ORIGIN(ram) + LENGTH(ram); /* Section Definitions */ SECTIONS diff --git a/tmk_core/common/arm_atsam/bootloader.c b/tmk_core/common/arm_atsam/bootloader.c index 9701a62196..ba71bfeb0b 100644 --- a/tmk_core/common/arm_atsam/bootloader.c +++ b/tmk_core/common/arm_atsam/bootloader.c @@ -16,25 +16,27 @@ #include "bootloader.h" #include "samd51j18a.h" +#include "md_bootloader.h" //Set watchdog timer to reset. Directs the bootloader to stay in programming mode. -void bootloader_jump(void) -{ - //Keyboards released with certain bootloader can not enter bootloader from app until workaround is created - uint8_t ver_no_jump[] = "v2.18Jun 22 2018 17:28:08"; - uint8_t *ver_check = ver_no_jump; - uint8_t *boot_check = (uint8_t *)0x21A0; - while (*ver_check && *boot_check == *ver_check) - { - ver_check++; - boot_check++; +void bootloader_jump(void) { +#ifdef KEYBOARD_massdrop_ctrl + //CTRL keyboards released with bootloader version below must use RAM method. Otherwise use WDT method. + uint8_t ver_ram_method[] = "v2.18Jun 22 2018 17:28:08"; //The version to match (NULL terminated by compiler) + uint8_t *ver_check = ver_ram_method; //Pointer to version match string for traversal + uint8_t *ver_rom = (uint8_t *)0x21A0; //Pointer to address in ROM where this specific bootloader version would exist + + while (*ver_check && *ver_rom == *ver_check) { //While there are check version characters to match and bootloader's version matches check's version + ver_check++; //Move check version pointer to next character + ver_rom++; //Move ROM version pointer to next character } - if (!*ver_check) - { - //Version match - //Software workaround would go here - return; //No software restart method implemented... must use hardware reset button + + if (!*ver_check) { //If check version pointer is NULL, all characters have matched + *MAGIC_ADDR = BOOTLOADER_MAGIC; //Set magic number into RAM + NVIC_SystemReset(); //Perform system reset + while (1) {} //Won't get here } +#endif WDT->CTRLA.bit.ENABLE = 0; while (WDT->SYNCBUSY.bit.ENABLE) {} diff --git a/tmk_core/protocol/arm_atsam/md_bootloader.h b/tmk_core/protocol/arm_atsam/md_bootloader.h index 1316876c84..956145c313 100644 --- a/tmk_core/protocol/arm_atsam/md_bootloader.h +++ b/tmk_core/protocol/arm_atsam/md_bootloader.h @@ -7,6 +7,13 @@ extern uint32_t _erom; #define BOOTLOADER_SERIAL_MAX_SIZE 20 //DO NOT MODIFY! +#ifdef KEYBOARD_massdrop_ctrl +//WARNING: These are only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support +extern uint32_t _eram; +#define BOOTLOADER_MAGIC 0x3B9ACA00 +#define MAGIC_ADDR (uint32_t *)(&_eram - 4) +#endif + #ifdef MD_BOOTLOADER #define MCU_HZ 48000000 diff --git a/tmk_core/protocol/arm_atsam/startup.c b/tmk_core/protocol/arm_atsam/startup.c index a62d02f1ca..f29fac179b 100644 --- a/tmk_core/protocol/arm_atsam/startup.c +++ b/tmk_core/protocol/arm_atsam/startup.c @@ -28,6 +28,7 @@ */ #include "samd51.h" +#include "md_bootloader.h" /* Initialize segments */ extern uint32_t _sfixed; @@ -500,6 +501,16 @@ const DeviceVectors exception_table = { */ void Reset_Handler(void) { +#ifdef KEYBOARD_massdrop_ctrl + /* WARNING: This is only for CTRL bootloader release "v2.18Jun 22 2018 17:28:08" for bootloader_jump support */ + if (*MAGIC_ADDR == BOOTLOADER_MAGIC) { + /* At this point, the bootloader's memory is initialized properly, so undo the jump to here, then jump back */ + *MAGIC_ADDR = 0x00000000; /* Change value to prevent potential bootloader entrance loop */ + __set_MSP(0x20008818); /* MSP according to bootloader */ + SCB->VTOR = 0x00000000; /* Vector table back to bootloader's */ + asm("bx %0"::"r"(0x00001267)); /* Jump past bootloader RCAUSE check using THUMB */ + } +#endif uint32_t *pSrc, *pDest; /* Initialize the relocate segment */ -- cgit v1.2.3 From 9f8bbe2f3f30c39f1ed44a6a2de63f39b405391f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 29 Sep 2018 08:47:16 -0700 Subject: Keyboard: converter/hp_46010a: Configurator support (#4017) --- keyboards/converter/hp_46010a/info.json | 115 ++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) diff --git a/keyboards/converter/hp_46010a/info.json b/keyboards/converter/hp_46010a/info.json index de68a12285..91dcf97ecc 100644 --- a/keyboards/converter/hp_46010a/info.json +++ b/keyboards/converter/hp_46010a/info.json @@ -3,4 +3,119 @@ "keyboard_folder": "converter/HP_46010A", "url": "https://deskthority.net/wiki/HP_46010A", "maintainer": "listofoptions", + "width": 22, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Reset", "x":0, "y":0}, + {"label":"Stop", "x":1, "y":0}, + {"label":"F1", "x":2.5, "y":0, "w":1.25}, + {"label":"F2", "x":3.75, "y":0, "w":1.25}, + {"label":"F3", "x":5, "y":0, "w":1.25}, + {"label":"F4", "x":6.25, "y":0, "w":1.25}, + {"label":"Menu", "x":7.5, "y":0}, + {"label":"User", "x":8.5, "y":0}, + {"label":"F5", "x":9.5, "y":0, "w":1.25}, + {"label":"F6", "x":10.75, "y":0, "w":1.25}, + {"label":"F7", "x":12, "y":0, "w":1.25}, + {"label":"F8", "x":13.25, "y":0, "w":1.25}, + {"label":"Clear line", "x":15, "y":0}, + {"label":"Clear display", "x":16, "y":0}, + {"x":18, "y":0}, + {"x":19, "y":0}, + {"x":20, "y":0}, + {"x":21, "y":0}, + {"label":"`", "x":0, "y":2, "w":1.25}, + {"label":"1", "x":1.25, "y":2}, + {"label":"2", "x":2.25, "y":2}, + {"label":"3", "x":3.25, "y":2}, + {"label":"4", "x":4.25, "y":2}, + {"label":"5", "x":5.25, "y":2}, + {"label":"6", "x":6.25, "y":2}, + {"label":"7", "x":7.25, "y":2}, + {"label":"8", "x":8.25, "y":2}, + {"label":"9", "x":9.25, "y":2}, + {"label":"0", "x":10.25, "y":2}, + {"label":"-", "x":11.25, "y":2}, + {"label":"=", "x":12.25, "y":2}, + {"label":"Backspace", "x":13.25, "y":2, "w":1.5}, + {"label":"Insert line", "x":15, "y":2}, + {"label":"Delete line", "x":16, "y":2}, + {"label":"*", "x":18, "y":2}, + {"label":"/", "x":19, "y":2}, + {"label":"+", "x":20, "y":2}, + {"label":"-", "x":21, "y":2}, + {"label":"Tab", "x":0, "y":3, "w":1.75}, + {"label":"Q", "x":1.75, "y":3}, + {"label":"W", "x":2.75, "y":3}, + {"label":"E", "x":3.75, "y":3}, + {"label":"R", "x":4.75, "y":3}, + {"label":"T", "x":5.75, "y":3}, + {"label":"Y", "x":6.75, "y":3}, + {"label":"U", "x":7.75, "y":3}, + {"label":"I", "x":8.75, "y":3}, + {"label":"O", "x":9.75, "y":3}, + {"label":"P", "x":10.75, "y":3}, + {"label":"[", "x":11.75, "y":3}, + {"label":"]", "x":12.75, "y":3}, + {"label":"\\", "x":13.75, "y":3}, + {"label":"Insert char", "x":15, "y":3}, + {"label":"Delete char", "x":16, "y":3}, + {"label":"7", "x":18, "y":3}, + {"label":"8", "x":19, "y":3}, + {"label":"9", "x":20, "y":3}, + {"label":"Enter", "x":21, "y":3}, + {"label":"Caps Lock", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"A", "x":2, "y":4}, + {"label":"S", "x":3, "y":4}, + {"label":"D", "x":4, "y":4}, + {"label":"F", "x":5, "y":4}, + {"label":"G", "x":6, "y":4}, + {"label":"H", "x":7, "y":4}, + {"label":"J", "x":8, "y":4}, + {"label":"K", "x":9, "y":4}, + {"label":"L", "x":10, "y":4}, + {"label":";", "x":11, "y":4}, + {"label":"'", "x":12, "y":4}, + {"label":"Return", "x":13, "y":4, "w":1.75}, + {"label":"Cursor", "x":15, "y":4}, + {"label":"Prev", "x":16, "y":4}, + {"label":"4", "x":18, "y":4}, + {"label":"5", "x":19, "y":4}, + {"label":"6", "x":20, "y":4}, + {"label":",", "x":21, "y":4}, + {"label":"Del", "x":0, "y":5}, + {"label":"Shift", "x":1.25, "y":5, "w":1.25}, + {"label":"Z", "x":2.5, "y":5}, + {"label":"X", "x":3.5, "y":5}, + {"label":"C", "x":4.5, "y":5}, + {"label":"V", "x":5.5, "y":5}, + {"label":"B", "x":6.5, "y":5}, + {"label":"N", "x":7.5, "y":5}, + {"label":"M", "x":8.5, "y":5}, + {"label":",", "x":9.5, "y":5}, + {"label":".", "x":10.5, "y":5}, + {"label":"/", "x":11.5, "y":5}, + {"label":"Shift", "x":12.5, "y":5, "w":1.25}, + {"label":"Select", "x":14, "y":5}, + {"label":"Up", "x":15, "y":5}, + {"label":"Next", "x":16, "y":5}, + {"label":"1", "x":18, "y":5}, + {"label":"2", "x":19, "y":5}, + {"label":"3", "x":20, "y":5}, + {"label":"Tab", "x":21, "y":5, "h":2}, + {"label":"Win", "x":0, "y":6}, + {"label":"Extend Char", "x":2.5, "y":6}, + {"x":3.5, "y":6, "w":8}, + {"label":"Extend Char", "x":11.5, "y":6}, + {"label":"Left", "x":14, "y":6}, + {"label":"Down", "x":15, "y":6}, + {"label":"Right", "x":16, "y":6}, + {"label":"0", "x":18, "y":6, "w":2}, + {"label":".", "x":20, "y":6} + ] + } + } } -- cgit v1.2.3 From 1da2f8d5467e5a9b9300437d2afc86d2c1f63370 Mon Sep 17 00:00:00 2001 From: Shaleen Jain Date: Sat, 29 Sep 2018 21:19:51 +0530 Subject: Keymap: tada68: add shalzz's layout (#4019) --- keyboards/tada68/keymaps/shalzz/config.h | 4 +++ keyboards/tada68/keymaps/shalzz/keymap.c | 53 +++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/shalzz/readme.md | 43 +++++++++++++++++++++++++ keyboards/tada68/keymaps/shalzz/rules.mk | 12 +++++++ 4 files changed, 112 insertions(+) create mode 100644 keyboards/tada68/keymaps/shalzz/config.h create mode 100644 keyboards/tada68/keymaps/shalzz/keymap.c create mode 100644 keyboards/tada68/keymaps/shalzz/readme.md create mode 100644 keyboards/tada68/keymaps/shalzz/rules.mk diff --git a/keyboards/tada68/keymaps/shalzz/config.h b/keyboards/tada68/keymaps/shalzz/config.h new file mode 100644 index 0000000000..3214a33fb4 --- /dev/null +++ b/keyboards/tada68/keymaps/shalzz/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define DISABLE_SPACE_CADET_ROLLOVER +#define GRAVE_ESC_ALT_OVERRIDE diff --git a/keyboards/tada68/keymaps/shalzz/keymap.c b/keyboards/tada68/keymaps/shalzz/keymap.c new file mode 100644 index 0000000000..e2b4c170e5 --- /dev/null +++ b/keyboards/tada68/keymaps/shalzz/keymap.c @@ -0,0 +1,53 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |FN |Alt|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + * + * Note: Shift + Esc = ~ + * Win + Esc = ` + */ +[_BL] = LAYOUT_ansi( + KC_GESC, 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_GRV, \ + 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_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_PGUP, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP,KC_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, LT(_BL, KC_SPC), MO(_FL),KC_RALT,KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |PRSC| + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Ins | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | |<- |Dn |Up | ->| | | |Hme | + * |----------------------------------------------------------------| + * | ( | | |Bl-|BL |BL+| | |VU-|VU+|MUT| ) | |End | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, 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_DEL, KC_PSCR, \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_INS, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,KC_LEFT,KC_DOWN,KC_UP,KC_RGHT,_______,_______, _______,KC_HOME, \ + KC_LPRN,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_RPRN, _______, KC_END, \ + _______,_______,_______, _______, _______,_______,_______,_______,_______, _______), +}; diff --git a/keyboards/tada68/keymaps/shalzz/readme.md b/keyboards/tada68/keymaps/shalzz/readme.md new file mode 100644 index 0000000000..3e4cf60673 --- /dev/null +++ b/keyboards/tada68/keymaps/shalzz/readme.md @@ -0,0 +1,43 @@ +# Shalzz's Unix layout + +This layout is based on the Unix Layout with a few changes. + +``` + Base Layer +,----------------------------------------------------------------. +|Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | +|----------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | +|----------------------------------------------------------------| +|CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| +|----------------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| +|----------------------------------------------------------------| +|Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | +`----------------------------------------------------------------' +Note: Shift + Esc = ~ + Win + Esc = ` + Fn + LShift = ( + Fn + RShift = ) + + Fn Layer +,----------------------------------------------------------------. +| | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |PRSC| +|----------------------------------------------------------------| +| | |Up | | | | | | | | | | | |Ins | +|----------------------------------------------------------------| +| |<- |Dn | ->| | |<- |Dn |Up | ->| | | |Hme | +|----------------------------------------------------------------| +| ( | | |Bl-|BL |BL+| | |VU-|VU+|MUT| ) | |End | +|----------------------------------------------------------------| +| | | | | | | | | | | +`----------------------------------------------------------------' + +``` + +The changes that were applied over the Unix layout: + +* Left and Right Shift when pressed alone emit `(` and `)` respectively. Hold shift for normal behaviour. +* Fn + Left and Right Shift also act as actual `(` and `)` keys respectively. +* Changed PrintSc to `Fn+`` +* Fixed Holding down space activating the function layer instead of the lower layer. diff --git a/keyboards/tada68/keymaps/shalzz/rules.mk b/keyboards/tada68/keymaps/shalzz/rules.mk new file mode 100644 index 0000000000..1df3af955d --- /dev/null +++ b/keyboards/tada68/keymaps/shalzz/rules.mk @@ -0,0 +1,12 @@ +# 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 +# +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no # Audio output on port C6 +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 4f6495108087da13d7ee44c1f6ced03ebdfb934d Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Sun, 30 Sep 2018 02:25:03 +0900 Subject: Keymap: Fixed a possible of buffer overflow. (#4016) Update inline funnction to static inline function. Fixed error of if enabe ADJUST_MACRO_ENABLE. --- .../helix/rev2/keymaps/five_rows_jis/keymap.c | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index 141b222753..df00366e39 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -214,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #endif #ifdef SSD1306OLED -char keylog[20] = {}; +char keylog[24] = {}; const char code_to_name[60] = { ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', @@ -223,7 +223,7 @@ const char code_to_name[60] = { 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; -inline void set_keylog(uint16_t keycode, keyrecord_t *record) +static inline void set_keylog(uint16_t keycode, keyrecord_t *record) { char name = ' '; uint8_t leds = host_keyboard_leds(); @@ -246,6 +246,12 @@ inline void set_keylog(uint16_t keycode, keyrecord_t *record) } #endif +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT(mode) rgblight_mode(mode) +#else +#define RGBLIGHT(mode) +#endif + // define variables for reactive RGB int RGB_current_mode; #ifdef ADJUST_MACRO_ENABLE @@ -263,12 +269,6 @@ void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { #define ADJUST_MACRO(layer1, layer2, layer3) #endif -#ifdef RGBLIGHT_ENABLE -#define RGBLIGHT(mode) rgblight_mode(mode) -#else -#define RGBLIGHT(mode) -#endif - bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef SSD1306OLED if (record->event.pressed) { @@ -344,7 +344,7 @@ void matrix_scan_user(void) { iota_gfx_task(); // this is what updates the display continuously } -inline void matrix_update(struct CharacterMatrix *dest, +static inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { memcpy(dest->display, source->display, sizeof(dest->display)); @@ -367,13 +367,15 @@ const char helix_logo[]={ 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, 0}; -inline void render_logo(struct CharacterMatrix *matrix) { + +static inline void render_logo(struct CharacterMatrix *matrix) { matrix_write(matrix, helix_logo); } const char mac_win_logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; -inline void render_status(struct CharacterMatrix *matrix) { + +static inline void render_status(struct CharacterMatrix *matrix) { char buf[20]; // Render to mode icon -- cgit v1.2.3 From cd215209efb0e236b691b51c3397495d4449623b Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sun, 30 Sep 2018 02:40:54 +0900 Subject: Helix led_test keymap reduce size (#4023) * Helix: make rgblight modes selectable. No change in build result. * edit the comment of helix/rev2/keymaps/default/keymap.c * Helix led_test keymap: reduced the size. --- keyboards/helix/config.h | 13 +++++++++++++ keyboards/helix/rev2/keymaps/default/keymap.c | 2 +- keyboards/helix/rev2/keymaps/led_test/config.h | 16 +++++++++++++--- keyboards/helix/rev2/keymaps/led_test/led_test_init.c | 4 ++-- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h index fbfbd32804..b79093d871 100644 --- a/keyboards/helix/config.h +++ b/keyboards/helix/config.h @@ -48,4 +48,17 @@ along with this program. If not, see . #define DISABLE_LEADER #endif // USE_Link_Time_Optimization +#if defined(LED_ANIMATIONS) || defined(RGBLIGHT_ANIMATIONS) + #undef RGBLIGHT_ANIMATIONS + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST + #define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_H */ diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c index dca9be9a47..087bd8e517 100644 --- a/keyboards/helix/rev2/keymaps/default/keymap.c +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -512,7 +512,7 @@ void music_scale_user(void) // hook point for 'led_test' keymap // 'default' keymap's led_test_init() is empty function, do nothing -// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); __attribute__ ((weak)) void led_test_init(void) {} diff --git a/keyboards/helix/rev2/keymaps/led_test/config.h b/keyboards/helix/rev2/keymaps/led_test/config.h index 0438254528..094195fc6e 100644 --- a/keyboards/helix/rev2/keymaps/led_test/config.h +++ b/keyboards/helix/rev2/keymaps/led_test/config.h @@ -21,9 +21,19 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -// if you need more program area, try uncomment follow line -#include "serial_config_simpleapi.h" - // place overrides here +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#undef RGBLIGHT_EFFECT_BREATHING +#undef RGBLIGHT_EFFECT_RAINBOW_MOOD +#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#undef RGBLIGHT_EFFECT_SNAKE +#undef RGBLIGHT_EFFECT_KNIGHT +#undef RGBLIGHT_EFFECT_CHRISTMAS +#undef RGBLIGHT_EFFECT_STATIC_GRADIENT +//#undef RGBLIGHT_EFFECT_RGB_TEST // led_test keymap need only this. +#undef RGBLIGHT_EFFECT_ALTERNATING + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/led_test/led_test_init.c b/keyboards/helix/rev2/keymaps/led_test/led_test_init.c index 1d9cb4ebde..85f5d1aa7e 100644 --- a/keyboards/helix/rev2/keymaps/led_test/led_test_init.c +++ b/keyboards/helix/rev2/keymaps/led_test/led_test_init.c @@ -5,7 +5,7 @@ void led_test_init(void) { static int scan_count = 0; if( scan_count == 2 ) { rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(35); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); } if( scan_count < 3 ) scan_count ++; } @@ -15,6 +15,6 @@ void led_test_init(void) { // can use this? void startup_user(void) { rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(35); + rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); } #endif -- cgit v1.2.3 From 68854f0735ecfa69e383c1f7c93211a6ad89e13b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 29 Sep 2018 12:44:12 -0700 Subject: Keyboard: converter/hp_46010a: rename layout macro to LAYOUT (#4024) Messed up in my previous PR (#4017) by providing the wrong matrix name. Fixing by changing the matrix name instead, because there's only one at this point. Thought it made more sense this way. --- keyboards/converter/hp_46010a/hp_46010a.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/converter/hp_46010a/hp_46010a.h b/keyboards/converter/hp_46010a/hp_46010a.h index db64ce24a5..fd5adfc639 100644 --- a/keyboards/converter/hp_46010a/hp_46010a.h +++ b/keyboards/converter/hp_46010a/hp_46010a.h @@ -35,7 +35,7 @@ along with this program. If not, see . * `-----------------------------------------------------------------------------------' `-------------------' */ -#define LAYOUT_HP_46010A( \ +#define LAYOUT( \ KEY_RES, KEY_STOP, KEY_F1, KEY_F2, KEY_F3, KEY_F4,KEY_MENU,KEY_USER, KEY_F5, KEY_F6, KEY_F7, KEY_F8, KEY_CLRL, KEY_CLRD, KEY_B1, KEY_B2, KEY_B3, KEY_B4, \ KEY_GRAV, KEY_1, KEY_2, KEY_3, KEY_4, KEY_5, KEY_6, KEY_7, KEY_8, KEY_9, KEY_0, KEY_MINU, KEY_PLUS, KEY_BACK, KEY_INSL, KEY_DELL, KEY_MULT, KEY_DIV, KEY_ADD, KEY_SUBT, \ KEY_TAB, KEY_Q,KEY_W, KEY_E, KEY_R, KEY_T, KEY_Y, KEY_U, KEY_I, KEY_O, KEY_P, KEY_LBRA, KEY_RBRA, KEY_PIPE, KEY_INSC, KEY_DELC, KEY_P7, KEY_P8, KEY_P9, KEY_PADE, \ @@ -58,5 +58,3 @@ along with this program. If not, see . {KEY_B1, KEY_P0, KEY_B2, KC_NO, KEY_B3, KEY_PDOT, KEY_B4, KC_NO }, \ {KEY_B, KEY_V, KEY_C, KEY_X, KEY_Z, KEY_PRNT, KEY_DELE, KEY_N }, \ } - -#define LAYOUT LAYOUT_HP_46010A -- cgit v1.2.3 From 92d95ba1e1223538f8c16fe2d17a23fa0dd67725 Mon Sep 17 00:00:00 2001 From: izzy84075 Date: Sat, 29 Sep 2018 12:44:54 -0700 Subject: Keyboard: Add basic support for the YD68 / YD68v2 PCBs. (#4020) * Add basic support for the YD68 / YD68v2. Keymap and WS2812 underlighting work. Capslock LED should work, though I don't have one populated to test. Backlight LEDs are not set up, as they're not on a hardware PWM pin, could be set up as software. * Fix Imgur link * Fix default keymap to match the stock firmware * Fix the Hardware Supported line and add a short description --- keyboards/yd68/config.h | 224 +++++++++++++++++++++++++++++++ keyboards/yd68/info.json | 13 ++ keyboards/yd68/keymaps/default/config.h | 19 +++ keyboards/yd68/keymaps/default/keymap.c | 65 +++++++++ keyboards/yd68/keymaps/default/readme.md | 1 + keyboards/yd68/readme.md | 15 +++ keyboards/yd68/rules.mk | 81 +++++++++++ keyboards/yd68/yd68.c | 73 ++++++++++ keyboards/yd68/yd68.h | 62 +++++++++ 9 files changed, 553 insertions(+) create mode 100644 keyboards/yd68/config.h create mode 100644 keyboards/yd68/info.json create mode 100644 keyboards/yd68/keymaps/default/config.h create mode 100644 keyboards/yd68/keymaps/default/keymap.c create mode 100644 keyboards/yd68/keymaps/default/readme.md create mode 100644 keyboards/yd68/readme.md create mode 100644 keyboards/yd68/rules.mk create mode 100644 keyboards/yd68/yd68.c create mode 100644 keyboards/yd68/yd68.h diff --git a/keyboards/yd68/config.h b/keyboards/yd68/config.h new file mode 100644 index 0000000000..1b4d7f7a13 --- /dev/null +++ b/keyboards/yd68/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 Ryan "Izzy" Bales + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0002 +#define MANUFACTURER YANG +#define PRODUCT YD68v2 +#define DESCRIPTION 65% board with Bluetooth + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B5, C6, C7, D7, B4 } +#define MATRIX_COL_PINS { B6, F7, F6, F5, F4, F1, F0, E6, B0, B7, D0, D1, D2, D3, D5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN B3 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/yd68/info.json b/keyboards/yd68/info.json new file mode 100644 index 0000000000..b392f03865 --- /dev/null +++ b/keyboards/yd68/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "YD68", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 68, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Win", "x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/yd68/keymaps/default/config.h b/keyboards/yd68/keymaps/default/config.h new file mode 100644 index 0000000000..405f935500 --- /dev/null +++ b/keyboards/yd68/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Ryan "Izzy" Bales + * + * 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 + +// place overrides here diff --git a/keyboards/yd68/keymaps/default/keymap.c b/keyboards/yd68/keymaps/default/keymap.c new file mode 100644 index 0000000000..290aa0d61e --- /dev/null +++ b/keyboards/yd68/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2018 Ryan "Izzy" Bales + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + YD68_BT_PWR = SAFE_RANGE, + YD68_RGB_PWR, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( /* Base */ + KC_ESC, 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_HOME, \ + 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_END, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_RCTRL,KC_LEFT,KC_DOWN,KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case YD68_BT_PWR: + if (record->event.pressed) { + // when keycode YD68_BT_PWR is pressed + } else { + // when keycode YD68_BT_PWR is released + } + break; + case YD68_RGB_PWR: + if (record->event.pressed) { + // when keycode YD68_RGB_PWR is pressed + PORTE ^= (1<<2); + } else { + // when keycode YD68_RGB_PWR is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/yd68/keymaps/default/readme.md b/keyboards/yd68/keymaps/default/readme.md new file mode 100644 index 0000000000..877e64f18b --- /dev/null +++ b/keyboards/yd68/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for yd68 \ No newline at end of file diff --git a/keyboards/yd68/readme.md b/keyboards/yd68/readme.md new file mode 100644 index 0000000000..7e5e83bcc9 --- /dev/null +++ b/keyboards/yd68/readme.md @@ -0,0 +1,15 @@ +# yd68 + +[yd68](https://imgur.com/gallery/Ygo668L) + +A 68-key board with RGB underlighting and bluetooth. + +Keyboard Maintainer: [Izzy84075](https://github.com/izzy84075) +Hardware Supported: YD68/YD68v2 +Hardware Availability: [KBDFans](https://kbdfans.cn/collections/diy-kit/products/yd68-65-bluetooth-custom-keyboard-pcb) + +Make example for this keyboard (after setting up your build environment): + + make yd68: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/yd68/rules.mk b/keyboards/yd68/rules.mk new file mode 100644 index 0000000000..197402e8ab --- /dev/null +++ b/keyboards/yd68/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) diff --git a/keyboards/yd68/yd68.c b/keyboards/yd68/yd68.c new file mode 100644 index 0000000000..f34661dd37 --- /dev/null +++ b/keyboards/yd68/yd68.c @@ -0,0 +1,73 @@ +/* Copyright 2018 Ryan "Izzy" Bales + * + * 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 . + */ +#include "yd68.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + //Capslock LED Output Low + DDRD |= (1<<4); + PORTD &= ~(1<<4); + + //Backlight LEDs Output Low + DDRD |= (1<<6); + PORTD &= ~(1<<6); + + //RGB power output low + DDRE |= (1<<2); + PORTE &= ~(1<<2); + + //Bluetooth power output high + DDRB |= (1<<2); + PORTB |= (1<<2); + + //RGB data output low + DDRB |= (1<<3); + PORTB &= ~(1<<3); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1<. + */ +#ifndef YD68_H +#define YD68_H + +#include "quantum.h" + +#define XXX KC_NO + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +/* YD68 ANSI layout + * ,----------------------------------------------------------------. + * | 00 |01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0e | 48 | + * |----------------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | 1e | + * |----------------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | 2e | + * |----------------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3c | 3d| 3e | + * |----------------------------------------------------------------| + * | 40 | 41 | 42 | 46 | 49| 4a| 4b| 4c| 4d| 4e | + * `----------------------------------------------------------------' + */ +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k48, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, k2e, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k42, k46, k49, k4a, k4b, k4c, k4d, k4e \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, XXX, k0e}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d, k2e}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e}, \ + {k40, k41, k42, XXX, XXX, XXX, k46, XXX, k48, k49, k4a, k4b, k4c, k4d, k4e} \ +} + +#endif -- cgit v1.2.3 From 170507896d4d7fe12e1fa2c31ab8589e4cbdf7ba Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Sat, 29 Sep 2018 16:16:21 -0700 Subject: Keyboard: Update info.json to match LAYOUT (#4027) * Update info.json to match LAYOUT * update mf68_ble info.json LAYOUT -> LAYOUT_68_ansi --- keyboards/mf68/info.json | 2 +- keyboards/mf68_ble/info.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/mf68/info.json b/keyboards/mf68/info.json index d41c2176a9..fae15aaf5f 100644 --- a/keyboards/mf68/info.json +++ b/keyboards/mf68/info.json @@ -5,7 +5,7 @@ "width": 17.25, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_68_ansi": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] } } diff --git a/keyboards/mf68_ble/info.json b/keyboards/mf68_ble/info.json index 1f8aaed924..4cd9b2c83c 100644 --- a/keyboards/mf68_ble/info.json +++ b/keyboards/mf68_ble/info.json @@ -5,7 +5,7 @@ "width": 17.25, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_68_ansi": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] } } -- cgit v1.2.3 From 3875d6f5815bf263cb3ee5d18b74c5ec8ab865f2 Mon Sep 17 00:00:00 2001 From: Alexander Kagno Date: Sat, 29 Sep 2018 18:51:06 -0600 Subject: Keymap: Added Leader Key Functionality (#4025) * deleting arkag branch, forcibly moving changes over to master * fade_color function added, not tested * added half functions some stuff * surround_type function implemented and working. * added flashing function and removed fading, flashing supports infinite flashing along with controlled number flashes * added a fade state machine and functionality * build optimizations, changed fade to bounce between bounds rather than roll over, added a HALMAK layout * changes to sleep breath function, changed how I will switch to HALMAK * support for halmak added * support for activity detection added, condensed fading and flashing state machines, removed support for HALMAK and COLEMAK because arkag is stupid * changed sleep and inactive behaviors, now the color shifting reverses on state change, yay! save_color and reset_color are made to enable layer color changing to look cooler. * reformatted some if statements in state detection * changes to force fade to pause on boot, or plug in. * Attempting to move over to userspace, pushing to repository for help * userspace stuff.... * userspace stuff.... * layout changes, working userspace, Removed left side shift and replaced it with a MT() for LSFT and SPC. Userspace seems to be working properly now! HURRAY * Layout change Removed space/shift and reset modifiers to what they were originally. Added homerow modifiers. * Removed excessive tabs in files * Moved mods on homerow around... * changes recommended by @drashna * removed homerow mods, more flashy lighting! * changed delays for lighting. * velocikey code retro fit into userspace to match typing speed currently "working" but isn't as reactive as I want. * Readme and other documentation hidden throughout code * Added a pretty picture * pretty picture actually added * More readme updates * Velocikey now working inside my userspace! * Changed repo macro and fixed readme * Removed media layer, moved media control to LAZY layer * fixed more merge issues when I had to merge... * implemented some leader key stuff * removed merge garbage... * changes requested by @drashna, leader key switch from macros --- keyboards/mechmini/v2/keymaps/arkag/config.h | 2 +- keyboards/mechmini/v2/keymaps/arkag/keymap.c | 14 +- keyboards/mechmini/v2/keymaps/arkag/rules.mk | 1 + users/arkag/arkag.c | 213 ++++++++++----------------- users/arkag/config.h | 5 +- 5 files changed, 93 insertions(+), 142 deletions(-) diff --git a/keyboards/mechmini/v2/keymaps/arkag/config.h b/keyboards/mechmini/v2/keymaps/arkag/config.h index f5f3a90fa7..e89adc0978 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/config.h +++ b/keyboards/mechmini/v2/keymaps/arkag/config.h @@ -3,5 +3,5 @@ // save me space! #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER +// #define DISABLE_LEADER #define NO_MUSIC_MODE diff --git a/keyboards/mechmini/v2/keymaps/arkag/keymap.c b/keyboards/mechmini/v2/keymaps/arkag/keymap.c index 7038f220c4..29e125394b 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/keymap.c +++ b/keyboards/mechmini/v2/keymaps/arkag/keymap.c @@ -8,10 +8,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_2u_space_ortho( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LEAD, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, QUOTE, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENT, - M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, LAZY, KC_LEFT, KC_DOWN, KC_RGHT), + M_PMOD, LRALT, M_SMOD, LOWER, RAISE, KC_SPC, KC_SLSH, KC_BSLS, KC_LEFT, KC_DOWN, KC_RGHT), [_RAISE] = LAYOUT_2u_space_ortho( GRAVE, KC_1, KC_2, THREE, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, @@ -20,10 +20,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, KEEB, _______, _______, _______, M_OS, KC_PSLS, KC_PMNS, KC_PAST), [_LOWER] = LAYOUT_2u_space_ortho( - _______, _______, _______, _______, _______, _______, _______, M_ULIN, M_ITAL, _______, M_P_B, M_C_A_D, - _______, _______, STRIKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_CAPS, KC_DEL, _______, _______, _______, M_BOLD, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, KC_BSLS, M_CALC, KC_HOME, KC_PGDN, KC_END), + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_P_B, M_C_A_D, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END), [_KEEB] = LAYOUT_2u_space_ortho( KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -35,5 +35,5 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, M_TM, _______, M_SNIPT, M_SHRUG, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, M_GGT, _______, M_UF, M_LOD, M_REPO, _______, _______, _______, _______, _______, _______, _______, _______, _______, M_TF, M_LENNY, _______, KC_VOLU, KC_MPLY, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT), + _______, _______, _______, _______, _______, _______, M_CALC, _______, KC_MPRV, KC_VOLD, KC_MNXT), }; diff --git a/keyboards/mechmini/v2/keymaps/arkag/rules.mk b/keyboards/mechmini/v2/keymaps/arkag/rules.mk index d6c210e9e8..c1d5afa1eb 100644 --- a/keyboards/mechmini/v2/keymaps/arkag/rules.mk +++ b/keyboards/mechmini/v2/keymaps/arkag/rules.mk @@ -11,6 +11,7 @@ AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes +LEADER_ENABLE = yes # save me space! EXTRAFLAGS += -flto diff --git a/users/arkag/arkag.c b/users/arkag/arkag.c index a35e13ed6b..212d06de67 100644 --- a/users/arkag/arkag.c +++ b/users/arkag/arkag.c @@ -370,115 +370,70 @@ void matrix_init_user(void) { set_os(current_os, false); } +LEADER_EXTERNS(); + void matrix_scan_user(void) { check_state(); flash_rgb(); fade_rgb(); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case M_PMOD: - if (record->event.pressed) { - pri_mod(true); - } else { - pri_mod(false); - } - return false; + LEADER_DICTIONARY() { + leading = false; + leader_end(); - case M_SMOD: - if (record->event.pressed) { - sec_mod(true); - } else { - sec_mod(false); - } - return false; - - case M_P_B: - if (record->event.pressed) { + // begin OS functions + SEQ_TWO_KEYS(KC_P, KC_B) { if (current_os == OS_WIN) { SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_PAUSE) SS_UP(X_LGUI)); } else { } } - return false; - - case M_C_A_D: - if (record->event.pressed) { + SEQ_THREE_KEYS(KC_C, KC_A, KC_D) { if (current_os == OS_WIN) { SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) SS_TAP(X_DELETE) SS_UP(X_LALT) SS_UP(X_LCTRL)); } else { } } - return false; - - case M_CALC: - if (record->event.pressed) { + SEQ_FOUR_KEYS(KC_C, KC_A, KC_L, KC_C) { if (current_os == OS_WIN) { SEND_STRING(SS_TAP(X_CALCULATOR)); } else if (current_os == OS_MAC) { SEND_STRING(SS_DOWN(X_LGUI) SS_TAP(X_SPACE) SS_UP(X_LGUI) "calculator" SS_TAP(X_ENTER)); } } - return false; - - case M_OS: - if (record->event.pressed) { - set_os((current_os+1) % _OS_COUNT, true); - } - return false; - - case M_LOD: - if (record->event.pressed) { - send_unicode_hex_string("0CA0 005F 005F 0CA0"); - } - return false; + // end OS functions - case M_LENNY: - if (record->event.pressed) { - send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + // begin format functions + SEQ_ONE_KEY(KC_B) { + surround_type(4, KC_8, true); } - return false; - - - case M_TF: - if (record->event.pressed) { - send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B"); + SEQ_ONE_KEY(KC_I) { + surround_type(2, KC_8, true); } - return false; - - case M_UF: - if (record->event.pressed) { - send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029"); + SEQ_ONE_KEY(KC_U) { + surround_type(4, KC_MINS, true); } - return false; - - case M_SHRUG: - if (record->event.pressed) { - send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + SEQ_ONE_KEY(KC_S) { + surround_type(4, KC_GRAVE, true); } - return false; - - case M_TM: - if (record->event.pressed) { - send_unicode_hex_string("2122"); + SEQ_TWO_KEYS(KC_S, KC_S) { + if (current_os == OS_MAC) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_4}); + } else if (current_os == OS_WIN) { + long_keystroke(3, (uint16_t[]){KC_LGUI, KC_LSFT, KC_S}); + } else { + return; + } } - return false; - - case M_REPO: - if (record->event.pressed) { - SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag"); + SEQ_ONE_KEY(KC_C) { + surround_type(2, KC_GRAVE, false); } - return false; - - case M_GGT: - if (record->event.pressed) { - SEND_STRING("@GrahamGoldenTech.com"); + SEQ_TWO_KEYS(KC_C, KC_C) { + surround_type(6, KC_GRAVE, false); } - return false; + // end format functions - case M_SNIPT: - if (record->event.pressed) { + // start fancy functions + SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { surround_type(6, KC_GRAVE, false); pri_mod(true); tap_key(KC_V); @@ -488,44 +443,68 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { tap_key(KC_RGHT); tap_key(KC_ENTER); } - return false; + // end fancy functions - case M_BOLD: - if (record->event.pressed) { - surround_type(4, KC_8, true); + // start typing functions + SEQ_TWO_KEYS(KC_T, KC_M) { + // ™ + send_unicode_hex_string("2122"); } - return false; + SEQ_THREE_KEYS(KC_G, KC_G, KC_T) { + SEND_STRING("@GrahamGoldenTech.com"); + } + SEQ_THREE_KEYS(KC_L, KC_O, KC_D) { + // ಠ__ಠ + send_unicode_hex_string("0CA0 005F 005F 0CA0"); + } + SEQ_FOUR_KEYS(KC_R, KC_E, KC_P, KC_O) { + SEND_STRING("https://github.com/qmk/qmk_firmware/tree/master/users/arkag"); + } + SEQ_FOUR_KEYS(KC_F, KC_L, KC_I, KC_P) { + // (╯‵Д′)╯彡┻━┻ + send_unicode_hex_string("0028 256F 2035 0414 2032 0029 256F 5F61 253B 2501 253B"); + } + SEQ_FIVE_KEYS(KC_U, KC_F, KC_L, KC_I, KC_P) { + // ┬─┬ノ( º _ º ノ) + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 0020 30CE 0029"); + } + SEQ_FIVE_KEYS(KC_L, KC_E, KC_N, KC_N, KC_Y) { + // ( ͡° ͜ʖ ͡°) + send_unicode_hex_string("0028 0020 0361 00B0 0020 035C 0296 0020 0361 00B0 0029"); + } + SEQ_FIVE_KEYS(KC_S, KC_H, KC_R, KC_U, KC_G) { + // ¯\_(ツ)_/¯ + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + // end typing functions - case M_ITAL: + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_PMOD: if (record->event.pressed) { - surround_type(2, KC_8, true); + pri_mod(true); + } else { + pri_mod(false); } return false; - case M_ULIN: + case M_SMOD: if (record->event.pressed) { - surround_type(4, KC_MINS, true); + sec_mod(true); + } else { + sec_mod(false); } return false; - case KC_LSFT: + case M_OS: if (record->event.pressed) { - save_color(underglow); - underglow = mod_color(underglow, true, 75); - SEND_STRING(SS_DOWN(X_LSHIFT)); - } else { - reset_color(); - SEND_STRING(SS_UP(X_LSHIFT)); + set_os((current_os+1) % _OS_COUNT, true); } return false; - case MEDIA: - case LAZY: - case KEEB: - case RAISE: - case LOWER: - return true; - default: if (record->event.pressed) { state = active; @@ -535,36 +514,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -uint32_t layer_state_set_user(uint32_t state) { - switch (biton32(state)) { - case _LAZY: - save_color(underglow); - underglow = mod_color(underglow, true, 50); - break; - case _MEDIA: - save_color(underglow); - underglow = mod_color(underglow, true, 150); - break; - case _KEEB: - save_color(underglow); - underglow = mod_color(underglow, false, 150); - break; - case _LOWER: - save_color(underglow); - underglow = mod_color(underglow, false, 100); - break; - case _RAISE: - save_color(underglow); - underglow = mod_color(underglow, true, 100); - break; - default: - reset_color(); - break; - } - set_color(underglow, false); - return state; -} - //Tap Dance Definitions qk_tap_dance_action_t tap_dance_actions[] = { [TD_3_GRV_ACT] = ACTION_TAP_DANCE_FN (dance_3), diff --git a/users/arkag/config.h b/users/arkag/config.h index e715e5534e..2e0a9ad019 100644 --- a/users/arkag/config.h +++ b/users/arkag/config.h @@ -1,5 +1,6 @@ #pragma once -#define TAPPING_TERM 200 +#define TAPPING_TERM 200 +#define LEADER_TIMEOUT 250 -#define IGNORE_MOD_TAP_INTERRUPT +#define LEADER_PER_KEY_TIMING -- cgit v1.2.3 From 6734cd9c5c7b63677d3d4cf9bef8ccf878fd3551 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Mon, 1 Oct 2018 00:31:23 +1000 Subject: Keyboard: Zeal60: Fix getting backlight values "id_*_indicator_row_col" (#4030) --- keyboards/zeal60/rgb_backlight.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c index 9f62a8d381..ce8b1cb179 100644 --- a/keyboards/zeal60/rgb_backlight.c +++ b/keyboards/zeal60/rgb_backlight.c @@ -916,6 +916,31 @@ void backlight_set_indicator_index( uint8_t *index, uint8_t row, uint8_t column } } +void backlight_get_indicator_row_col( uint8_t index, uint8_t *row, uint8_t *column ) +{ + if ( index == 255 || index == 254 ) + { + // Special value, 255=none, 254=all + *row = index; + *column = 0; + return; + } + for ( uint8_t r = 0; r < MATRIX_ROWS; r++ ) + { + for ( uint8_t c = 0; c < MATRIX_COLS; c++ ) + { + uint8_t i = 255; + map_row_column_to_led( r, c, &i ); + if ( i == index ) + { + *row = r; + *column = c; + return; + } + } + } +} + // Some helpers for setting/getting HSV void _set_color( HSV *color, uint8_t *data ) { @@ -1146,7 +1171,7 @@ void backlight_config_get_value( uint8_t *data ) } case id_caps_lock_indicator_row_col: { - //*value_data = g_config.caps_lock_indicator.index; + backlight_get_indicator_row_col( g_config.caps_lock_indicator.index, &(value_data[0]), &(value_data[1]) ); break; } case id_layer_1_indicator_color: @@ -1156,7 +1181,7 @@ void backlight_config_get_value( uint8_t *data ) } case id_layer_1_indicator_row_col: { - //*value_data = g_config.layer_1_indicator.index; + backlight_get_indicator_row_col( g_config.layer_1_indicator.index, &(value_data[0]), &(value_data[1]) ); break; } case id_layer_2_indicator_color: @@ -1166,7 +1191,7 @@ void backlight_config_get_value( uint8_t *data ) } case id_layer_2_indicator_row_col: { - //*value_data = g_config.layer_2_indicator.index; + backlight_get_indicator_row_col( g_config.layer_2_indicator.index, &(value_data[0]), &(value_data[1]) ); break; } case id_layer_3_indicator_color: @@ -1176,7 +1201,7 @@ void backlight_config_get_value( uint8_t *data ) } case id_layer_3_indicator_row_col: { - //*value_data = g_config.layer_3_indicator.index; + backlight_get_indicator_row_col( g_config.layer_3_indicator.index, &(value_data[0]), &(value_data[1]) ); break; } case id_alphas_mods: -- cgit v1.2.3 From 66ef1e3d6770e388d631d25e4cd1c6b1640cea24 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Mon, 1 Oct 2018 01:35:10 +1000 Subject: RAMA M6-B and IS31FL3218 driver (#4021) * Initial RAMA M6-B commit. * Moved IS31FL3218 driver, minor cleanups * Refactor, added dynamic keymap. * Added dynamic keymaps to RAMA M6-A * Refactor M6-A and M6-B to use common code. * Formatting * Cleanup * Cleanup * Changes from review --- drivers/issi/is31fl3218.c | 102 +++++++++ drivers/issi/is31fl3218.h | 24 ++ keyboards/rama/m6_a/config.h | 24 +- keyboards/rama/m6_a/keymaps/default/config.h | 24 -- keyboards/rama/m6_a/keymaps/default/keymap.c | 316 +-------------------------- keyboards/rama/m6_a/m6_a.c | 31 +-- keyboards/rama/m6_a/readme.md | 2 +- keyboards/rama/m6_a/rules.mk | 44 ++-- keyboards/rama/m6_b/config.h | 129 +++++++++++ keyboards/rama/m6_b/info.json | 19 ++ keyboards/rama/m6_b/keymaps/default/keymap.c | 16 ++ keyboards/rama/m6_b/m6_b.c | 230 +++++++++++++++++++ keyboards/rama/m6_b/m6_b.h | 28 +++ keyboards/rama/m6_b/m6_b_api.h | 39 ++++ keyboards/rama/m6_b/readme.md | 15 ++ keyboards/rama/m6_b/rgb_backlight.c | 139 ++++++++++++ keyboards/rama/m6_b/rgb_backlight.h | 34 +++ keyboards/rama/m6_b/rules.mk | 77 +++++++ quantum/dynamic_keymap.c | 2 +- 19 files changed, 901 insertions(+), 394 deletions(-) create mode 100644 drivers/issi/is31fl3218.c create mode 100644 drivers/issi/is31fl3218.h delete mode 100644 keyboards/rama/m6_a/keymaps/default/config.h create mode 100644 keyboards/rama/m6_b/config.h create mode 100644 keyboards/rama/m6_b/info.json create mode 100644 keyboards/rama/m6_b/keymaps/default/keymap.c create mode 100644 keyboards/rama/m6_b/m6_b.c create mode 100644 keyboards/rama/m6_b/m6_b.h create mode 100644 keyboards/rama/m6_b/m6_b_api.h create mode 100644 keyboards/rama/m6_b/readme.md create mode 100644 keyboards/rama/m6_b/rgb_backlight.c create mode 100644 keyboards/rama/m6_b/rgb_backlight.h create mode 100644 keyboards/rama/m6_b/rules.mk diff --git a/drivers/issi/is31fl3218.c b/drivers/issi/is31fl3218.c new file mode 100644 index 0000000000..db44f72564 --- /dev/null +++ b/drivers/issi/is31fl3218.c @@ -0,0 +1,102 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ +#include "is31fl3218.h" +#include "i2c_master.h" + +// This is the full 8-bit address +#define ISSI_ADDRESS 0b10101000 + +// These are the register addresses +#define ISSI_REG_SHUTDOWN 0x00 +#define ISSI_REG_PWM 0x01 +#define ISSI_REG_CONTROL 0x13 +#define ISSI_REG_UPDATE 0x16 +#define ISSI_REG_RESET 0x17 + +// Default timeout if no I2C response +#define ISSI_TIMEOUT 100 + +// Reusable buffer for transfers +uint8_t g_twi_transfer_buffer[20]; + +// IS31FL3218 has 18 PWM outputs and a fixed I2C address, so no chaining. +// If used as RGB LED driver, LEDs are assigned RGB,RGB,RGB,RGB,RGB,RGB +uint8_t g_pwm_buffer[18]; +bool g_pwm_buffer_update_required = false; + +void IS31FL3218_write_register( uint8_t reg, uint8_t data ) +{ + g_twi_transfer_buffer[0] = reg; + g_twi_transfer_buffer[1] = data; + i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT); +} + +void IS31FL3218_write_pwm_buffer( uint8_t *pwm_buffer ) +{ + g_twi_transfer_buffer[0] = ISSI_REG_PWM; + for ( int i=0; i<18; i++ ) { + g_twi_transfer_buffer[1+i] = pwm_buffer[i]; + } + + i2c_transmit( ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT); +} + +void IS31FL3218_init(void) +{ + // In case we ever want to reinitialize (?) + IS31FL3218_write_register( ISSI_REG_RESET, 0x00 ); + + // Turn off software shutdown + IS31FL3218_write_register( ISSI_REG_SHUTDOWN, 0x01 ); + + // Set all PWM values to zero + for ( uint8_t i = 0; i < 18; i++ ) { + IS31FL3218_write_register( ISSI_REG_PWM+i, 0x00 ); + } + + // Enable all channels + for ( uint8_t i = 0; i < 3; i++ ) { + IS31FL3218_write_register( ISSI_REG_CONTROL+i, 0b00111111 ); + } + + // Load PWM registers and LED Control register data + IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 ); +} + +void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + g_pwm_buffer[index * 3 + 0] = red; + g_pwm_buffer[index * 3 + 1] = green; + g_pwm_buffer[index * 3 + 2] = blue; + g_pwm_buffer_update_required = true; +} + +void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + for ( int i = 0; i < 6; i++ ) { + IS31FL3218_set_color( i, red, green, blue ); + } +} + +void IS31FL3218_update_pwm_buffers(void) +{ + if ( g_pwm_buffer_update_required ) { + IS31FL3218_write_pwm_buffer( g_pwm_buffer ); + // Load PWM registers and LED Control register data + IS31FL3218_write_register( ISSI_REG_UPDATE, 0x01 ); + } + g_pwm_buffer_update_required = false; +} diff --git a/drivers/issi/is31fl3218.h b/drivers/issi/is31fl3218.h new file mode 100644 index 0000000000..2d24e51463 --- /dev/null +++ b/drivers/issi/is31fl3218.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include +#include + +void IS31FL3218_init(void); +void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); +void IS31FL3218_update_pwm_buffers(void); diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 0c5355f4a8..8d77f5339d 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -187,4 +186,23 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#endif +#define RGB_BACKLIGHT_ENABLED 0 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/rama/m6_a/keymaps/default/config.h b/keyboards/rama/m6_a/keymaps/default/config.h deleted file mode 100644 index d150575c1a..0000000000 --- a/keyboards/rama/m6_a/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Wilba - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/rama/m6_a/keymaps/default/keymap.c b/keyboards/rama/m6_a/keymaps/default/keymap.c index 6b15f3cd10..7a408fa8aa 100644 --- a/keyboards/rama/m6_a/keymaps/default/keymap.c +++ b/keyboards/rama/m6_a/keymaps/default/keymap.c @@ -3,322 +3,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( - TO(1), KC_A, KC_B, KC_C, KC_D, KC_E), + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6), LAYOUT( - TO(2), KC_F, KC_G, KC_H, KC_I, KC_J), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), LAYOUT( - TO(3), KC_K, KC_L, KC_M, KC_N, KC_O), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), LAYOUT( - TO(4), KC_P, KC_Q, KC_R, KC_S, KC_T), + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; - LAYOUT( - TO(5), KC_U, KC_V, KC_W, KC_X, KC_Y), - - LAYOUT( - TO(0), KC_Z, KC_1, KC_2, KC_3, KC_4)}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - //keyevent_t event = record->event; - - switch (id) - { - case 0: - if (record->event.pressed) - { - return MACRO(T(T), T(G), T(L), T(H), T(F), T(ENT), END); - } - break; - case 1: - if (record->event.pressed) - { - return MACRO(T(T), T(G), T(G), T(ENT), END); - } - break; - case 2: - if (record->event.pressed) - { - return MACRO(D(NO), T(L), U(NO), END); - } - break; - case 3: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(Z), U(LCTL), END); - } - break; - case 4: - if (record->event.pressed) - { - return MACRO(D(LCTL), D(LSFT), T(Z), U(LSFT), U(LCTL), END); - } - break; - case 5: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(X), U(LCTL), END); - } - break; - case 6: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(C), U(LCTL), END); - } - break; - case 7: - if (record->event.pressed) - { - return MACRO(D(LCTL), T(V), U(LCTL), END); - } - break; - } - return MACRO_NONE; -} - -// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7 -// This is 1-based because I copied it from Knops code. -void set_switch_led(int ledId, bool state) -{ - if (state) - { - switch (ledId) - { - case 1: - PORTD |= (1 << 6); - break; - case 2: - PORTB |= (1 << 6); - break; - case 3: - PORTF |= (1 << 5); - break; - case 4: - PORTB |= (1 << 4); - break; - case 5: - PORTC |= (1 << 7); - break; - case 6: - PORTF |= (1 << 7); - break; - } - } - else - { - switch (ledId) - { - case 1: - PORTD &= ~(1 << 6); - break; - case 2: - PORTB &= ~(1 << 6); - break; - case 3: - PORTF &= ~(1 << 5); - break; - case 4: - PORTB &= ~(1 << 4); - break; - case 5: - PORTC &= ~(1 << 7); - break; - case 6: - PORTF &= ~(1 << 7); - break; - } - } -} - -void set_layer_led(int layerId) -{ - // UNUSED -} - -void led_set_layer(int layer); - -void matrix_init_user(void) -{ - led_init_ports(); - led_set_layer(0); -} - -void matrix_scan_user(void) -{ -} - -// M6-A LEDs are connected to D6, B6, F5, B4, C7, F7 -void led_init_ports() -{ - // Switch #1 - DDRD |= (1 << 6); - PORTD &= ~(1 << 6); - - // Switch #2 - DDRB |= (1 << 6); - PORTB &= ~(1 << 6); - - // Switch #3 - DDRF |= (1 << 5); - PORTF &= ~(1 << 5); - - // Switch #4 - DDRB |= (1 << 4); - PORTB &= ~(1 << 4); - - // Switch #5 - DDRC |= (1 << 7); - PORTC &= ~(1 << 7); - - // Switch #6 - DDRF |= (1 << 7); - PORTF &= ~(1 << 7); -} - -void led_set_user(uint8_t usb_led) -{ - - if (usb_led & (1 << USB_LED_NUM_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_COMPOSE)) - { - } - else - { - } - - if (usb_led & (1 << USB_LED_KANA)) - { - } - else - { - } -} - -void led_set_layer(int layer) -{ - switch (layer) - { - case 0: - set_switch_led(1, true); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 1: - set_switch_led(1, false); - set_switch_led(2, true); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 2: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, true); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 3: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, true); - set_switch_led(5, false); - set_switch_led(6, false); - break; - case 4: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, true); - set_switch_led(6, false); - break; - case 5: - set_switch_led(1, false); - set_switch_led(2, false); - set_switch_led(3, false); - set_switch_led(4, false); - set_switch_led(5, false); - set_switch_led(6, true); - break; - default: - set_switch_led(1, true); - set_switch_led(2, true); - set_switch_led(3, true); - set_switch_led(4, true); - set_switch_led(5, true); - set_switch_led(6, true); - break; - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - switch (keycode) - { - case TO(0): - if (record->event.pressed) - { - led_set_layer(0); - } - break; - case TO(1): - if (record->event.pressed) - { - led_set_layer(1); - } - break; - case TO(2): - if (record->event.pressed) - { - led_set_layer(2); - } - break; - case TO(3): - if (record->event.pressed) - { - led_set_layer(3); - } - break; - case TO(4): - if (record->event.pressed) - { - led_set_layer(4); - } - break; - case TO(5): - if (record->event.pressed) - { - led_set_layer(5); - } - break; - } - return true; -} diff --git a/keyboards/rama/m6_a/m6_a.c b/keyboards/rama/m6_a/m6_a.c index 1c84ea2b83..fa19003600 100644 --- a/keyboards/rama/m6_a/m6_a.c +++ b/keyboards/rama/m6_a/m6_a.c @@ -1,4 +1,4 @@ -/* Copyright 2018 Wilba +/* Copyright 2018 Jason Williams (Wilba) * * 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 @@ -13,32 +13,3 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m6_a.h" -/* -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} -*/ diff --git a/keyboards/rama/m6_a/readme.md b/keyboards/rama/m6_a/readme.md index 5dd2b92e19..ceaf6a88de 100644 --- a/keyboards/rama/m6_a/readme.md +++ b/keyboards/rama/m6_a/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make rama/m6_a:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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). \ No newline at end of file diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ca2a2a5f80..ed85ac36d0 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,7 @@ +# project specific files +SRC = keyboards/rama/m6_b/m6_b.c + # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -38,31 +40,27 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - +# Boot Section +BOOTLOADER = atmel-dfu # 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 +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -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 +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h new file mode 100644 index 0000000000..1adaad3f9e --- /dev/null +++ b/keyboards/rama/m6_b/config.h @@ -0,0 +1,129 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x5241 // "RW" +#define PRODUCT_ID 0x006B // 6-B +#define DEVICE_VER 0x0001 +#define MANUFACTURER RAMA.WORKS +#define PRODUCT RAMA M6-B +#define DESCRIPTION RAMA M6-B Macropad + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { D4, B5, F4, D7, C6, F6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGB_BACKLIGHT_ENABLED 1 + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/rama/m6_b/info.json b/keyboards/rama/m6_b/info.json new file mode 100644 index 0000000000..c88a3cc618 --- /dev/null +++ b/keyboards/rama/m6_b/info.json @@ -0,0 +1,19 @@ +{ + "keyboard_name": "m6-b", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [ + { "x": 0, "y": 0 }, + { "x": 1, "y": 0 }, + { "x": 2, "y": 0 }, + { "x": 0, "y": 1 }, + { "x": 1, "y": 1 }, + { "x": 2, "y": 1 } + ] + } + } +} diff --git a/keyboards/rama/m6_b/keymaps/default/keymap.c b/keyboards/rama/m6_b/keymaps/default/keymap.c new file mode 100644 index 0000000000..7a408fa8aa --- /dev/null +++ b/keyboards/rama/m6_b/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; + diff --git a/keyboards/rama/m6_b/m6_b.c b/keyboards/rama/m6_b/m6_b.c new file mode 100644 index 0000000000..e7cd2f6287 --- /dev/null +++ b/keyboards/rama/m6_b/m6_b.c @@ -0,0 +1,230 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ +#include "m6_b.h" +#include "m6_b_api.h" + +// Check that no backlight functions are called +#if RGB_BACKLIGHT_ENABLED +#include "rgb_backlight.h" +#endif // RGB_BACKLIGHT_ENABLED + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "timer.h" +#include "tmk_core/common/eeprom.h" + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + // Set the keyboard-specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + if ( command_data[0] == id_uptime ) + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + } + else + { + *command_id = id_unhandled; + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE +#if RGB_BACKLIGHT_ENABLED + case id_backlight_config_set_value: + { + //backlight_config_set_value(command_data); + break; + } + case id_backlight_config_get_value: + { + //backlight_config_get_value(command_data); + break; + } + case id_backlight_config_save: + { + //backlight_config_save(); + break; + } +#endif // RGB_BACKLIGHT_ENABLED + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + +void main_init(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { +#if RGB_BACKLIGHT_ENABLED + //backlight_config_load(); +#endif // RGB_BACKLIGHT_ENABLED + } else { +#if RGB_BACKLIGHT_ENABLED + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + //backlight_config_save(); +#endif // RGB_BACKLIGHT_ENABLED +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); +#endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } +#if RGB_BACKLIGHT_ENABLED + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +#endif // RGB_BACKLIGHT_ENABLED +} + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc (matrix 0,0) is held down on power up, + // reset the EEPROM valid state and jump to bootloader. + if ( matrix_get_row(0) & (1<<0) ) { + eeprom_reset(); + bootloader_jump(); + } +} + +void matrix_init_kb(void) { + bootmagic_lite(); + main_init(); + matrix_init_user(); +} + +void matrix_scan_kb(void) { +#if RGB_BACKLIGHT_ENABLED + // This only updates the LED driver buffers if something has changed. + backlight_update_pwm_buffers(); +#endif // BACKLIGHT_ENABLED + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + led_set_user(usb_led); +} + +void suspend_power_down_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + //backlight_set_suspend_state(true); +#endif // BACKLIGHT_ENABLED +} + +void suspend_wakeup_init_kb(void) +{ +#if RGB_BACKLIGHT_ENABLED + //backlight_set_suspend_state(false); +#endif // BACKLIGHT_ENABLED +} diff --git a/keyboards/rama/m6_b/m6_b.h b/keyboards/rama/m6_b/m6_b.h new file mode 100644 index 0000000000..bd4158bcb1 --- /dev/null +++ b/keyboards/rama/m6_b/m6_b.h @@ -0,0 +1,28 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05) \ + { \ + {K00, K01, K02, K03, K04, K05}, \ + } + diff --git a/keyboards/rama/m6_b/m6_b_api.h b/keyboards/rama/m6_b/m6_b_api.h new file mode 100644 index 0000000000..041fd6e6ee --- /dev/null +++ b/keyboards/rama/m6_b/m6_b_api.h @@ -0,0 +1,39 @@ +/* Copyright 2017 Jason Williams (Wilba) + * + * 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 + +#define PROTOCOL_VERSION 0x0001 + +enum m6_b_command_id +{ + id_get_protocol_version = 0x01, // always 0x01 + id_get_keyboard_value, + id_set_keyboard_value, + id_dynamic_keymap_get_keycode, + id_dynamic_keymap_set_keycode, + id_dynamic_keymap_reset, + id_backlight_config_set_value, + id_backlight_config_get_value, + id_backlight_config_save, + id_eeprom_reset, + id_bootloader_jump, + id_unhandled = 0xFF, +}; + +enum m6_b_keyboard_value_id +{ + id_uptime = 0x01 +}; diff --git a/keyboards/rama/m6_b/readme.md b/keyboards/rama/m6_b/readme.md new file mode 100644 index 0000000000..d6bdd0c4c2 --- /dev/null +++ b/keyboards/rama/m6_b/readme.md @@ -0,0 +1,15 @@ +# RAMA M6-B + +![RAMA M6-B](https://static1.squarespace.com/static/563c788ae4b099120ae219e2/t/59fc7b1053450adf5bf9a852/1515932239307/RAMA-RAMA-M6-DSA-XO-CAPS.73-3_1.jpg?format=1500w) + +A 6-key companion keyboard. [More info at RAMA WORKS](https://rama.works/m6a) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: RAMA M6-B PCB +Hardware Availability: [RAMA WORKS Store](https://ramaworks.store/) + +Make example for this keyboard (after setting up your build environment): + + make rama/m6_b: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). \ No newline at end of file diff --git a/keyboards/rama/m6_b/rgb_backlight.c b/keyboards/rama/m6_b/rgb_backlight.c new file mode 100644 index 0000000000..8f7ac06303 --- /dev/null +++ b/keyboards/rama/m6_b/rgb_backlight.c @@ -0,0 +1,139 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ +#if RGB_BACKLIGHT_ENABLED + +#include "rgb_backlight.h" +//#include "rgb_backlight_api.h" + +#include +#include +#include +#include "progmem.h" + +#include "quantum/color.h" +#include "drivers/avr/i2c_master.h" +#include "drivers/issi/is31fl3218.h" + +bool g_suspend_state = false; + +// Global tick at 20 Hz +uint32_t g_tick = 0; +uint8_t g_config_effect_speed = 0; +uint8_t g_config_brightness = 255; + +void backlight_update_pwm_buffers(void) +{ + IS31FL3218_update_pwm_buffers(); +} + +void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3218_set_color( index, red, green, blue ); +} + +void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) +{ + IS31FL3218_set_color_all( red, green, blue ); +} + + +// This is (F_CPU/1024) / 20 Hz +// = 15625 Hz / 20 Hz +// = 781 +#define TIMER3_TOP 260 + +void backlight_timer_init(void) +{ + static uint8_t backlight_timer_is_init = 0; + if ( backlight_timer_is_init ) + { + return; + } + backlight_timer_is_init = 1; + + // Timer 3 setup + TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP + _BV(CS32) | _BV(CS30); // prescale by /1024 + // Set TOP value + uint8_t sreg = SREG; + cli(); + + OCR3AH = (TIMER3_TOP >> 8) & 0xff; + OCR3AL = TIMER3_TOP & 0xff; + SREG = sreg; +} + +void backlight_timer_enable(void) +{ + TIMSK3 |= _BV(OCIE3A); +} + +void backlight_timer_disable(void) +{ + TIMSK3 &= ~_BV(OCIE3A); +} + +void backlight_set_suspend_state(bool state) +{ + g_suspend_state = state; +} + +void backlight_effect_cycle_all(void) +{ + uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF; + uint8_t satOffset = 127; + // Relies on hue being 8-bit and wrapping + for ( int i=0; i<6; i++ ) + { + HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness }; + RGB rgb = hsv_to_rgb( hsv ); + backlight_set_color( i, rgb.r, rgb.g, rgb.b ); + } +} + +ISR(TIMER3_COMPA_vect) +{ + // delay 1 second before driving LEDs or doing anything else + static uint8_t startup_tick = 0; + if ( startup_tick < 20 ) + { + startup_tick++; + return; + } + + g_tick++; + + if ( g_suspend_state ) + { + backlight_set_color_all( 0, 0, 0 ); + } + else + { + //HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness }; + //RGB rgb = hsv_to_rgb( hsv ); + //backlight_set_color_all( rgb.r, rgb.g, rgb.b ); + backlight_effect_cycle_all(); + } +} + +void backlight_init_drivers(void) +{ + // Initialize I2C + i2c_init(); + IS31FL3218_init(); +} + +#endif // RGB_BACKLIGHT_ENABLED diff --git a/keyboards/rama/m6_b/rgb_backlight.h b/keyboards/rama/m6_b/rgb_backlight.h new file mode 100644 index 0000000000..bbf605284b --- /dev/null +++ b/keyboards/rama/m6_b/rgb_backlight.h @@ -0,0 +1,34 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#if RGB_BACKLIGHT_ENABLED +#else +#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 +#endif // RGB_BACKLIGHT_ENABLED + +#include +#include + +#include "quantum/color.h" + +void backlight_init_drivers(void); +void backlight_update_pwm_buffers(void); +void backlight_timer_init(void); +void backlight_timer_enable(void); +void backlight_timer_disable(void); +void backlight_set_suspend_state(bool state); + diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk new file mode 100644 index 0000000000..8226debd45 --- /dev/null +++ b/keyboards/rama/m6_b/rules.mk @@ -0,0 +1,77 @@ +# project specific files +SRC = rgb_backlight.c \ + quantum/color.c \ + drivers/issi/is31fl3218.c \ + drivers/avr/i2c_master.c + + +# MCU name +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 + +# Boot Section +BOOTLOADER = atmel-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index 2c989d6918..ee39a20251 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -17,7 +17,7 @@ #include "config.h" #include "keymap.h" // to get keymaps[][][] #include "tmk_core/common/eeprom.h" -#include "progmem.h"// to read default from flash +#include "progmem.h" // to read default from flash #include "dynamic_keymap.h" -- cgit v1.2.3 From a7d46f1b0f4d18699a38898ff68114204d4c087d Mon Sep 17 00:00:00 2001 From: Erovia Date: Sun, 30 Sep 2018 20:14:06 +0200 Subject: Keymap: Add ErgoDone keymap with QWERTY and COLEMAK Mod-DH (#3884) * Custom keymap for the ErgoDone The keymap supports QWERTY and COLEMAK MOD-DH with LED indication. * Enable Space Cadet Shift * Fix after-boot layer indicator LED * Implement keyboard suspend, move layer LED handling to function, unify identation * Add readme.md with layout * Optimize LED handling, add include guard Read the default layer via the proper EEPROM function, so the calling of bootmagic() is no longer necessary. Fix bug when the CapsLock LED wasn't working anymore after a layer switch. --- keyboards/ergodone/keymaps/erovia/config.h | 3 + keyboards/ergodone/keymaps/erovia/keymap.c | 233 ++++++++++++++++++++++++++++ keyboards/ergodone/keymaps/erovia/readme.md | 76 +++++++++ keyboards/ergodone/keymaps/erovia/rules.mk | 1 + 4 files changed, 313 insertions(+) create mode 100644 keyboards/ergodone/keymaps/erovia/config.h create mode 100644 keyboards/ergodone/keymaps/erovia/keymap.c create mode 100644 keyboards/ergodone/keymaps/erovia/readme.md create mode 100644 keyboards/ergodone/keymaps/erovia/rules.mk diff --git a/keyboards/ergodone/keymaps/erovia/config.h b/keyboards/ergodone/keymaps/erovia/config.h new file mode 100644 index 0000000000..60c6ad4a12 --- /dev/null +++ b/keyboards/ergodone/keymaps/erovia/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define DISABLE_SPACE_CADET_ROLLOVER diff --git a/keyboards/ergodone/keymaps/erovia/keymap.c b/keyboards/ergodone/keymaps/erovia/keymap.c new file mode 100644 index 0000000000..627805afb0 --- /dev/null +++ b/keyboards/ergodone/keymaps/erovia/keymap.c @@ -0,0 +1,233 @@ +#include QMK_KEYBOARD_H +#include "version.h" +#include "bootmagic.h" + +#define QWERTY 0 // qwerty layer +#define COLEMAK 1 // colemak layer +#define FN 2 // function layer + +enum custom_keycodes { + QWRTY = SAFE_RANGE, // can always be here + CLMK, + VRSN, + FNCTN +}; + +/* false: Caps Lock LED is off + true: Caps Lock LED is on */ +bool CAPS_LED = false; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Qwerty layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Copy | | Paste| 6 | 7 | 8 | 9 | 0 | Sleep | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | E | R | T | Mute | | { | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | [ |------+------+------+------+------+--------| + * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | + * |--------+------+------+------+------+------| Fn1 | | } |------+------+------+------+------+--------| + * | LShift | Z | X | C | V | B | | | ] | N | M | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | LGui | LAlt | Left | Right| | Down | Up | - | = | RCtrl | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Caps | LGui | | Ins | Del | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[QWERTY] = LAYOUT_ergodox( // layer 0 : qwerty + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_COPY, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MUTE, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_FN1, + KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, + KC_CAPS, KC_LGUI, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + KC_PASTE, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLEP, + KC_LBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOTE, + KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_DOWN, KC_UP, KC_MINS, KC_EQL, KC_RCTL, + KC_INS, KC_DEL, + KC_PGUP, + KC_PGDN, KC_TAB, KC_ENT +), +/* Keymap 1: Colemak layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | Copy | | Paste| 6 | 7 | 8 | 9 | 0 | Sleep | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Tab | Q | W | F | P | B | Mute | | { | J | L | U | Y | ; | \ | + * |--------+------+------+------+------+------| | | [ |------+------+------+------+------+--------| + * | Esc | A | R | S | T | G |------| |------| M | N | E | I | O | ' | + * |--------+------+------+------+------+------| Fn1 | | } |------+------+------+------+------+--------| + * | LShift | Z | X | C | D | V | | | ] | K | H | , | . | / | RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |LCtrl | LGui | LAlt | Left | Right| | Down | Up | - | = | RCtrl | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | Caps | LGui | | Ins | Del | + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +[COLEMAK] = LAYOUT_ergodox( // layer 1 : colemak + // left hand + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_COPY, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_MUTE, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_G, + KC_LSPO, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_FN1, + KC_LCTL, KC_LGUI, KC_LALT, KC_LEFT, KC_RGHT, + KC_CAPS, KC_LGUI, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + KC_PASTE, KC_6, KC_7, KC_8, KC_9, KC_0, KC_SLEP, + KC_LBRC, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, + KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOTE, + KC_RBRC, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_DOWN, KC_UP, KC_MINS, KC_EQL, KC_RCTL, + KC_INS, KC_DEL, + KC_PGUP, + KC_PGDN, KC_TAB, KC_ENT +), +/* Keymap 2: Function Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | | | Prev | Play | Next | | | | | | | | | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | |VolDn | VolUp|------| |------| |QWRTY | CLMK | | | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | | | | | | | | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// Functions +[FN] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, QWRTY, CLMK, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS +), +}; + +const uint16_t PROGMEM fn_actions[] = { + [1] = ACTION_LAYER_TAP_TOGGLE(FN) // FN1 - Momentary Layer 1 +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case QWRTY: + if (record->event.pressed) { + set_single_persistent_default_layer(QWERTY); + } + return false; + break; + case CLMK: + if (record->event.pressed) { + set_single_persistent_default_layer(COLEMAK); + } + return false; + break; + case KC_CAPS: + if (record->event.pressed) { + // Turn LED1 On/Off for Caps Lock + if (CAPS_LED) { + ergodox_right_led_1_off(); + CAPS_LED = false; + } else { + ergodox_right_led_1_on(); + CAPS_LED = true; + } + } + return true; + break; + } + return true; +}; + +// Set LED according to the default layer +void default_layer_led_set(void) { + switch (biton32(eeconfig_read_default_layer())) { + case COLEMAK: + // LED2 for COLEMAK + ergodox_right_led_2_on(); + break; + case QWERTY: + // LED3 for QWERTY + ergodox_right_led_3_on(); + break; + }; +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + default_layer_led_set(); +}; + +uint32_t layer_state_set_user(uint32_t state) { + ergodox_led_all_off(); + switch (biton32(state)) { + case FN: + // Red led on Pro Micro for Fn layer + ergodox_board_led_on(); + break; + }; + + if (CAPS_LED) { + ergodox_right_led_1_on(); + } + + default_layer_led_set(); + + return state; +}; + +void suspend_power_down_user(void) { + ergodox_led_all_off(); +}; + +void suspend_wakeup_init_user(void) { + default_layer_led_set(); +}; diff --git a/keyboards/ergodone/keymaps/erovia/readme.md b/keyboards/ergodone/keymaps/erovia/readme.md new file mode 100644 index 0000000000..160c875983 --- /dev/null +++ b/keyboards/ergodone/keymaps/erovia/readme.md @@ -0,0 +1,76 @@ +# Erovia's ErdoDone Keymap + +My personal ErgoDone keymap based on the *default* keymap. + +**Features** + +* Qwerty and Colemak Mod-DH support +* Space Cadet Shift +* LED indicator for: active layout, CapsLock, Function layer + +## QWERTY (Normal) Layer +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | Copy | | Paste| 6 | 7 | 8 | 9 | 0 | Sleep | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | E | R | T | Mute | | { | Y | U | I | O | P | \ | +|--------+------+------+------+------+------| | | [ |------+------+------+------+------+--------| +| Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | +|--------+------+------+------+------+------| Fn1 | | } |------+------+------+------+------+--------| +| LShift | Z | X | C | V | B | | | ] | N | M | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |LCtrl | LGui | LAlt | Left | Right| | Down | Up | - | = | RCtrl | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | Caps | LGui | | Ins | Del | + ,------|------|------| |------+--------+------. + | | | Home | | PgUp | | | + | Space|Backsp|------| |------| Tab |Enter | + | |ace | End | | PgDn | | | + `--------------------' `----------------------' +``` + +## Colemak Layer +Switch from `Fn1` layer. +``` +,--------------------------------------------------. ,--------------------------------------------------. +| ` | 1 | 2 | 3 | 4 | 5 | Copy | | Paste| 6 | 7 | 8 | 9 | 0 | Sleep | +|--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| +| Tab | Q | W | F | P | B | Mute | | { | J | L | U | Y | ; | \ | +|--------+------+------+------+------+------| | | [ |------+------+------+------+------+--------| +| Esc | A | R | S | T | G |------| |------| M | N | E | I | O | ' | +|--------+------+------+------+------+------| Fn1 | | } |------+------+------+------+------+--------| +| LShift | Z | X | C | D | V | | | ] | K | H | , | . | / | RShift | +`--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + |LCtrl | LGui | LAlt | Left | Right| | Down | Up | - | = | RCtrl | + `----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | Caps | LGui | | Ins | Del | + ,------|------|------| |------+--------+------. + | | | Home | | PgUp | | | + | Space|Backsp|------| |------| Tab |Enter | + | |ace | End | | PgDn | | | + `--------------------' `----------------------' +``` + +## Function Layer +``` +,---------------------------------------------------. ,--------------------------------------------------. +|Version | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | +|---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| +| | | | Prev | Play | Next | | | | | | | | | | +|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | |VolDn | VolUp|------| |------| |QWRTY | CLMK | | | | +|---------+------+------+------+------+------| | | |------+------+------+------+------+--------| +| | | | | | | | | | | | | | | | +`---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + | | | | | | | | | | | | + `-----------------------------------' `----------------------------------' + ,-------------. ,-------------. + | | | | | | + ,------|------|------| |------+------+------. + | | | | | | | | + | | |------| |------| | | + | | | | | | | | + `--------------------' `--------------------' +``` diff --git a/keyboards/ergodone/keymaps/erovia/rules.mk b/keyboards/ergodone/keymaps/erovia/rules.mk new file mode 100644 index 0000000000..f7b7da719e --- /dev/null +++ b/keyboards/ergodone/keymaps/erovia/rules.mk @@ -0,0 +1 @@ +COMMAND_ENABLE = no # Commands for debug and configuration -- cgit v1.2.3 From a6c85f1c2383616e875e7cdc6ce31873d6fb0ce3 Mon Sep 17 00:00:00 2001 From: OlliGranlund Date: Sun, 30 Sep 2018 23:50:16 +0300 Subject: Keymap: add olligranlund Iris + satan layouts (#4031) * init * function layout planning * nordic keymap v1.0 * Added latest satan layouts, updated readmes * Cleaning code * Renamed ISO -> iso --- .../iris/keymaps/olligranlund_nordic/config.h | 36 ++++++ .../iris/keymaps/olligranlund_nordic/keymap.c | 131 +++++++++++++++++++++ .../iris/keymaps/olligranlund_nordic/readme.md | 11 ++ .../iris/keymaps/olligranlund_nordic/rules.mk | 2 + keyboards/satan/keymaps/olligranlund_iso/config.h | 17 +++ keyboards/satan/keymaps/olligranlund_iso/keymap.c | 99 ++++++++++++++++ keyboards/satan/keymaps/olligranlund_iso/readme.md | 18 +++ keyboards/satan/keymaps/olligranlund_iso/rules.mk | 17 +++ 8 files changed, 331 insertions(+) create mode 100644 keyboards/iris/keymaps/olligranlund_nordic/config.h create mode 100644 keyboards/iris/keymaps/olligranlund_nordic/keymap.c create mode 100644 keyboards/iris/keymaps/olligranlund_nordic/readme.md create mode 100644 keyboards/iris/keymaps/olligranlund_nordic/rules.mk create mode 100644 keyboards/satan/keymaps/olligranlund_iso/config.h create mode 100644 keyboards/satan/keymaps/olligranlund_iso/keymap.c create mode 100644 keyboards/satan/keymaps/olligranlund_iso/readme.md create mode 100644 keyboards/satan/keymaps/olligranlund_iso/rules.mk diff --git a/keyboards/iris/keymaps/olligranlund_nordic/config.h b/keyboards/iris/keymaps/olligranlund_nordic/config.h new file mode 100644 index 0000000000..259f2a7424 --- /dev/null +++ b/keyboards/iris/keymaps/olligranlund_nordic/config.h @@ -0,0 +1,36 @@ +/* +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 + +/* 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 18 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/iris/keymaps/olligranlund_nordic/keymap.c b/keyboards/iris/keymaps/olligranlund_nordic/keymap.c new file mode 100644 index 0000000000..65ed6d289b --- /dev/null +++ b/keyboards/iris/keymaps/olligranlund_nordic/keymap.c @@ -0,0 +1,131 @@ +#include QMK_KEYBOARD_H +#include "keymap_swedish.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +#define KC_ KC_TRNS + +#define KC_LOWER LOWER +#define KC_RAISE RAISE +#define KC_ADJ ADJUST +#define KC_RST RESET + +#define KC_AA NO_AA +#define KC_AE NO_AE +#define KC_OE NO_OSLH + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ +LT(_LOWER, KC_TAB),KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_AA, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_OE, KC_AE, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, RAISE, KC_BSPC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, KC_LALT, KC_SPC, KC_ENT, ADJUST, KC_RALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + NO_TILD, KC_EXLM, NO_AT, KC_HASH, NO_DLR, KC_PERC, NO_CIRC, NO_AMPR, NO_ASTR, NO_SLSH, NO_LPRN, NO_RPRN, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDOWN, NO_LCBR, NO_RCBR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, NO_BSLS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, NO_LBRC, NO_RBRC, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_GRAVE, KC_CIRC, KC_QUOTE, NO_LESS, NO_GRTR, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + NO_GRV, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_7, KC_8, KC_9, NO_MINS, NO_ASTR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_4, KC_5, KC_6, NO_PLUS, NO_SLSH, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_1, KC_2, KC_3, KC_0, KC_TRNS, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + BL_TOGG, BL_STEP, BL_BRTG, RGB_TOG, RGB_RMOD, RGB_MOD, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_DEC, _______, BL_INC, RGB_VAD, RGB_SAI, RGB_VAI, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, RGB_HUD, RGB_SAD, RGB_HUI, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/olligranlund_nordic/readme.md b/keyboards/iris/keymaps/olligranlund_nordic/readme.md new file mode 100644 index 0000000000..72eccde102 --- /dev/null +++ b/keyboards/iris/keymaps/olligranlund_nordic/readme.md @@ -0,0 +1,11 @@ +# Iris Nordic Layout +### by Oliver Granlund + +![Finished product](https://i.imgur.com/zqSBc3t.jpg) + +This is for those who insist to use keyboard with ÅÄÖ. Also thought about the +gaming aspect with this keyboard, therefore space on left side. + +At first I thought about having backspace in the upper right corner of the +slave side, but that made it really clunky to fix your text. Thumbs should take +care of this job instead. diff --git a/keyboards/iris/keymaps/olligranlund_nordic/rules.mk b/keyboards/iris/keymaps/olligranlund_nordic/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/iris/keymaps/olligranlund_nordic/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes diff --git a/keyboards/satan/keymaps/olligranlund_iso/config.h b/keyboards/satan/keymaps/olligranlund_iso/config.h new file mode 100644 index 0000000000..eab4c8e975 --- /dev/null +++ b/keyboards/satan/keymaps/olligranlund_iso/config.h @@ -0,0 +1,17 @@ +// Backlight configuration +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 10 + +// Underlight configuration +#undef RGB_DI_PIN +#define RGB_DI_PIN B2 +#undef RGBLED_NUM +#define RGBLED_NUM 16 // Number of LEDs +#undef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 8 +#undef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 8 +#undef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 8 + +#define RGBLIGHT_ANIMATIONS diff --git a/keyboards/satan/keymaps/olligranlund_iso/keymap.c b/keyboards/satan/keymaps/olligranlund_iso/keymap.c new file mode 100644 index 0000000000..5016d43779 --- /dev/null +++ b/keyboards/satan/keymaps/olligranlund_iso/keymap.c @@ -0,0 +1,99 @@ +#include QMK_KEYBOARD_H + +#define BASE 0 // Default layer +#define MOUSE 1 // Space layer +#define NUMPAD 2 // Alt layer +#define CAPS 3 // Caps layer + +// General shortenings +#define ESCA KC_ESC +#define MINS KC_MINS +#define EQUL KC_EQL +#define BSPC KC_BSPC +#define DELE KC_DEL +#define LBRC KC_LBRC +#define RBRC KC_RBRC +#define ALTR KC_RALT +#define SCLN KC_SCLN +#define QUOT KC_QUOT +#define NUHS KC_NUHS +#define ENTE KC_ENT +#define NUBS KC_NUBS // Less/ greater sign +#define COMM KC_COMM // Comma +#define FSTO KC_DOT // Full stop +#define SLSH KC_SLSH +#define ALTL KC_LALT +#define GUIL KC_LGUI +#define GUIR KC_RGUI +#define MENO KC_MENU + +// Special Actions and Media Keys +#define INSE KC_INS // Insert here +#define HOME KC_HOME // Go to beginning of line +#define ENDI KC_END // go to end of line +#define PSCR KC_PSCR // Print Screen +#define SLCK KC_SLCK // go to end of line +#define PGDN KC_PGDN // go to end of line +#define PGUP KC_PGUP // go to end of line +#define PLPS KC_MPLY // Play/Pause +#define PAUS KC_PAUS // Pause button +#define MUTE KC_MUTE // Mute sound +#define VOLU KC_VOLU // Volume increase +#define VOLD KC_VOLD // Volume decrease +#define MNXT KC_MNXT // next track +#define MPRV KC_MPRV // prev track +#define MSTP KC_MSTP // stop playing +#define MSEL KC_MSEL // Select media (Start playing it) +#define MAIL KC_MAIL // Open default mail app +#define CALC KC_CALC // Open default calculator app +#define MYCM KC_MYCM // Open default file manager + +// increase readability +#define _______ KC_TRNS +#define XXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Keymap BASE: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| R | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| # | R | + * |-----------------------------------------------------------| + * |Shft| \ | Z| X| C| V| B| N| M| ,| .| /|Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------| + */ + +[ BASE ] = KEYMAP_ISO_SPLITRSHIFT( + KC_ESC, 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_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, XXXXX, \ + LT(CAPS, 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_NUHS, 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, XXXXX, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, MO(CAPS), TG(NUMPAD), TG(MOUSE)), + +[ MOUSE ] = KEYMAP( // Mouse controls + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXX,\ + _______, _______, _______, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXX,\ + _______, _______, _______, _______, _______, _______, _______, _______), + +[ NUMPAD ] = KEYMAP( //Numpad and alt shortcuts + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXX,\ + _______, BL_TOGG, BL_DEC, BL_INC, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, _______, _______,\ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, _______,\ + _______, _______, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_7, KC_8, KC_9, KC_0, _______, _______, XXXXX,\ + _______, _______, _______, _______, _______, _______, _______, _______), + +[ CAPS ] = KEYMAP( // Main "function" key, arrows, media control + KC_GRAVE, 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_DEL, XXXXX,\ + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, PGDN, KC_UP, PGUP, PSCR, SLCK, PAUS, _______,\ + _______, KC__VOLDOWN, KC__MUTE, KC__VOLUP, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, XXXXX,\ + _______, _______, _______, _______, _______, _______, _______, _______) + +}; diff --git a/keyboards/satan/keymaps/olligranlund_iso/readme.md b/keyboards/satan/keymaps/olligranlund_iso/readme.md new file mode 100644 index 0000000000..e0801ef858 --- /dev/null +++ b/keyboards/satan/keymaps/olligranlund_iso/readme.md @@ -0,0 +1,18 @@ +# ISO layout for the Satan GH60 +### Originally by Ben James, forked by Oliver Granlund + +![Finished product](https://i.imgur.com/s5HAgr6.jpg) + +I've wanted to make this as close to a P0ker as possible, but some macros in +the P0ker don't make sense... + +Some of the features: +* Caps activates special features when held: + * Arrow keys directly under right hand + * Volume control + * Fn keys on number row + * PageUp/PageDn/Home/other general buttons +* Mouse control +* Numpad (works so much better if this would be ortho) +### RGB-strip +![Behind the scenes](https://i.imgur.com/reHLXrc.jpg) diff --git a/keyboards/satan/keymaps/olligranlund_iso/rules.mk b/keyboards/satan/keymaps/olligranlund_iso/rules.mk new file mode 100644 index 0000000000..c96deccaa9 --- /dev/null +++ b/keyboards/satan/keymaps/olligranlund_iso/rules.mk @@ -0,0 +1,17 @@ +# 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 # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From a398d2cece1ee69006cf26e9a86fbf38e1acb0d1 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 30 Sep 2018 22:06:29 -0700 Subject: Keymap: Add noroadsleft keymap for KC60 (#3876) * Add personal KC60 keymap * Update personal KC60 keymap * Keymap update 2018-05-30 01:53 UTC-7 * Added macro: T_PEEKR * Added macro for MacOS Select All; modified MacOS function layer * Added git branch-name macro * Added GitHub signature macro * Added readme files * Added Quake 2 and System layers * Refactored keymap readme * Refactored to add userspace files; added Colemak layer * Minor code cleanup; updated readme files * Reverted use of userspace Decided not to make use of the Userspace feature at this time. Reverted its addition, and updated the readme files where needed (they were linking to userspace files). * Updated per review comments by @drashna * Refactor buggy macros I'm still not sure these work properly * Fix Windows shortcuts * Fix Mac shortcuts, possibly Untested; still may be broken. * Remove PREVENT_STUCK_MODIFIERS from config.h Deprecated by #3107 --- keyboards/kc60/keymaps/noroadsleft/config.h | 8 + keyboards/kc60/keymaps/noroadsleft/keymap.c | 393 +++++++++++++++++++++++ keyboards/kc60/keymaps/noroadsleft/readme.md | 29 ++ keyboards/kc60/keymaps/noroadsleft/readme_ch1.md | 70 ++++ keyboards/kc60/keymaps/noroadsleft/readme_ch2.md | 26 ++ keyboards/kc60/keymaps/noroadsleft/readme_ch3.md | 39 +++ keyboards/kc60/keymaps/noroadsleft/readme_ch4.md | 54 ++++ keyboards/kc60/keymaps/noroadsleft/readme_ch5.md | 84 +++++ keyboards/kc60/keymaps/noroadsleft/readme_git.md | 56 ++++ keyboards/kc60/keymaps/noroadsleft/rules.mk | 2 + 10 files changed, 761 insertions(+) create mode 100644 keyboards/kc60/keymaps/noroadsleft/config.h create mode 100644 keyboards/kc60/keymaps/noroadsleft/keymap.c create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_ch1.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_ch2.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_ch3.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_ch4.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_ch5.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/readme_git.md create mode 100644 keyboards/kc60/keymaps/noroadsleft/rules.mk diff --git a/keyboards/kc60/keymaps/noroadsleft/config.h b/keyboards/kc60/keymaps/noroadsleft/config.h new file mode 100644 index 0000000000..e216d050b1 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/config.h @@ -0,0 +1,8 @@ +#pragma once + +#define PERMISSIVE_HOLD // https://docs.qmk.fm/#/feature_advanced_keycodes?id=permissive-hold + +// Enable single-color backlighting +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 +#define BREATHING_PERIOD 4 diff --git a/keyboards/kc60/keymaps/noroadsleft/keymap.c b/keyboards/kc60/keymaps/noroadsleft/keymap.c new file mode 100644 index 0000000000..f28f2144f0 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/keymap.c @@ -0,0 +1,393 @@ +#include QMK_KEYBOARD_H +#include +//#include +#include + + +/********************** +** LAYER DEFINITIONS ** +**********************/ +enum layers_keymap { + // BASE LAYERS + _QWERTY = 0, + _DVORAK, + _COLEMAK, + _MAC, + _QUAKE2, + _QUAKE2_DVORAK, + _QUAKE2_CONSOLE, + + // FUNCTION LAYERS + _FUNCWIN, + _FUNCMAC, + _FUNCQ2, + + // OTHER LAYERS + _NUMPAD, + _MACROS, + _SYSTEM +}; + +// LAYER SHORT CODES +#define _QW _QWERTY +#define _DV _DVORAK +#define _CM _COLEMAK +#define _MC _MAC +#define _Q2 _QUAKE2 +#define _QD _QUAKE2_DVORAK +#define _QC _QUAKE2_CONSOLE +#define _FW _FUNCWIN +#define _FM _FUNCMAC +#define _FQ _FUNCQ2 +#define _NP _NUMPAD +#define _MA _MACROS +#define _SY _SYSTEM + + +// KEYCODE DEFINITIONS +#define NO_CHNG KC_TRNS // Note for me for keys I need to leave as Pass-through + +#define FW_CAPS LT(_FUNCWIN, KC_CAPS) // _FUNCWIN when held, Caps Lock when tapped +#define FM_CAPS LT(_FUNCMAC, KC_CAPS) // _FUNCMAC when held, Caps Lock when tapped +#define Q2_CAPS LT(_FUNCQ2, KC_CAPS) // _FUNCQ2 when held, Caps Lock when tapped + +#define WN_SALL LCTL(DV_A) // Windows/Linux Select All +#define WN_UNDO LCTL(DV_Z) // Windows/Linux Undo +#define WN_CUT LCTL(DV_X) // Windows/Linux Cut +#define WN_COPY LCTL(DV_C) // Windows/Linux Copy +#define WN_PSTE LCTL(DV_V) // Windows/Linux Paste + +#define MC_PSCR LGUI(LSFT(KC_3)) // MacOS Print Screen (Command + Shift + 3) +#define MC_HOME LGUI(KC_LEFT) // MacOS Home (Command + Left Arrow) +#define MC_END LGUI(KC_RGHT) // MacOS End (Command + Right Arrow) +#define MC_SALL LGUI(KC_A) // MacOS Select All +//#define MC_UNDO LGUI(KC_Z) // MacOS Undo // replaced by macro +#define MC_CUT LGUI(KC_X) // MacOS Cut +#define MC_COPY LGUI(KC_C) // MacOS Copy +//#define MC_PSTE LGUI(KC_V) // MacOS Paste // replaced by macro + + +// MACRO DEFINITIONS +enum custom_keycodes { + F_CAPS = SAFE_RANGE, + T_L3DED, + G_PUSH, + G_FTCH, + G_COMM, + G_RST, + G_C10R, + G_BRCH, + SIGNA, + GO_Q2, + Q2_ON, + Q2_OFF, + Q2_ESC, + Q2_GRV, + MC_UNDO, + MC_PSTE +}; + + +// define modifiers +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t modifiers = get_mods(); + switch(keycode) { + // these are our macros! + case F_CAPS: + /* + Objective: write a macro that checks the current layers that are + enabled, and activates the appropriate function layer. + */ + if ( biton32(layer_state) == _MAC ) { + if (record->event.pressed) { + layer_on(_FUNCMAC); + } else { + layer_off(_FUNCMAC); + } + } else { + if (record->event.pressed) { + layer_on(_FUNCWIN); + } else { + layer_off(_FUNCWIN); + } + }; + return false; + break; + case T_L3DED: + if (record->event.pressed) { + SEND_STRING("lavak3DED "); + }; + return false; + break; + case G_PUSH: + if (record->event.pressed) { + SEND_STRING("git push origin "); + }; + return false; + break; + case G_FTCH: + if (record->event.pressed) { + SEND_STRING("git fetch upstream"); + }; + return false; + break; + case G_COMM: + if (record->event.pressed) { + SEND_STRING("git commit -m \"\"" SS_TAP(X_LEFT)); + layer_off(_MACROS); + }; + return false; + break; + case G_RST: + if (record->event.pressed) { + SEND_STRING("git histt -n 10" SS_TAP(X_ENTER) "git reset --soft "); + layer_off(_MACROS); + }; + return false; + break; + case G_C10R: + if (record->event.pressed) { + SEND_STRING("cf/"); + layer_off(_MACROS); + }; + return false; + break; + case G_BRCH: + if (record->event.pressed) { + SEND_STRING("$(git branch-name)"); + layer_off(_MACROS); + }; + return false; + break; + case SIGNA: + if (record->event.pressed) { + SEND_STRING("\\- @noroadsleft" SS_TAP(X_ENTER)); + layer_off(_MACROS); + }; + return false; + break; + case GO_Q2: + if (record->event.pressed) { + //default_layer_set(_QWERTY); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + //layer_off(_SYSTEM); + }; + return false; + break; + case Q2_ON: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + }; + return false; + break; + case Q2_OFF: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ENTER)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + break; + case Q2_ESC: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_ESCAPE)); + layer_move(_QWERTY); // TO(_QWERTY); + layer_on(_QUAKE2); + }; + return false; + break; + case Q2_GRV: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_GRAVE)); + layer_on(_DVORAK); + layer_on(_QUAKE2_DVORAK); + layer_on(_QUAKE2_CONSOLE); + }; + return false; + break; + case MC_UNDO: + if (record->event.pressed) { + if ( modifiers & MODS_SHIFT_MASK ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_Z) SS_UP(X_LGUI) ); + } + }; + return false; + break; + case MC_PSTE: + if (record->event.pressed) { + if ( modifiers & MODS_SHIFT_MASK ) { + SEND_STRING( SS_DOWN(X_LSHIFT) SS_DOWN(X_LGUI) SS_DOWN(X_LALT) SS_TAP(X_V) SS_UP(X_LALT) SS_UP(X_LGUI) SS_UP(X_LSHIFT) ); + } else { + SEND_STRING( SS_DOWN(X_LGUI) SS_TAP(X_V) SS_UP(X_LGUI) ); + } + }; + return false; + break; + } // switch() + return true; +}; + + +// KEYMAPS +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /**************** + ** BASE LAYERS ** + ****************/ + + /* QWERTY */ + [_QWERTY] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, 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_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, \ + FW_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Dvorak */ + [_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, 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_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, \ + FW_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_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /* Colemak */ + [_COLEMAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GESC, 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, \ + FW_CAPS, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FW), KC_RCTL \ + ), + + /**************** + ** OS OVERLAYS ** + ****************/ + + /* Mac */ + [_MAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + FM_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FM), _______ \ + ), + + /********************* + ** QUAKE 2 OVERLAYS ** + *********************/ + + /* Quake 2 */ + [_QUAKE2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_ON, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_DVORAK] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, Q2_OFF, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + [_QUAKE2_CONSOLE] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + Q2_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, MO(_FQ), _______ \ + ), + + /******************** + ** FUNCTION LAYERS ** + ********************/ + + /* Windows Fn layer */ + [_FUNCWIN] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, 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_DEL, \ + _______, KC_CALC, KC_APP, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, WN_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_PENT, \ + _______, WN_UNDO, WN_CUT, WN_COPY, WN_PSTE, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, TG(_MA), NO_CHNG, _______ \ + ), + + /* MacOS Fn layer */ + [_FUNCMAC] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + KC_GRV, 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_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, MC_HOME, KC_UP, MC_END, KC_PGUP, MC_PSCR, _______, _______, \ + NO_CHNG, MC_SALL, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, \ + _______, MC_UNDO, MC_CUT, MC_COPY, MC_PSTE, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Quake 2 Fn layer */ + [_FUNCQ2] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + Q2_GRV, 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_DEL, \ + _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_PSCR, KC_SLCK, KC_PAUS, \ + NO_CHNG, _______, _______, _______, _______, _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, KC_ENT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TG(_SY), _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /***************** + ** OTHER LAYERS ** + *****************/ + + /* Numpad layer */ + [_NUMPAD] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, \ + _______, _______, _______, _______, KC_E, KC_F, _______, KC_P4, KC_P5, KC_P6, KC_PAST, KC_PSLS, KC_PEQL, _______, \ + _______, _______, _______, _______, KC_C, KC_D, _______, KC_P1, KC_P2, KC_P3, KC_PPLS, KC_PMNS, KC_PENT, \ + _______, _______, _______, _______, KC_A, KC_B, _______, KC_P0, _______, KC_PDOT, _______, _______, \ + _______, _______, _______, TG(_NP), _______, _______, NO_CHNG, _______ \ + ), + + /* Macro layer */ + [_MACROS] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_MA), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, G_PUSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, G_RST, G_FTCH, G_COMM, _______, _______, _______, _______, T_L3DED, _______, _______, _______, \ + _______, _______, _______, G_C10R, _______, G_BRCH, SIGNA, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, NO_CHNG, _______ \ + ), + + /* System layer */ + [_SYSTEM] = LAYOUT_60_ansi( + // 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 + TG(_SY), TO(_QW), TO(_DV), TO(_CM), GO_Q2, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, TG(_MC), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_BRTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_CHNG, XXXXXXX \ + ), + +}; diff --git a/keyboards/kc60/keymaps/noroadsleft/readme.md b/keyboards/kc60/keymaps/noroadsleft/readme.md new file mode 100644 index 0000000000..737fdc06bb --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme.md @@ -0,0 +1,29 @@ +# @noroadsleft's KC60 keymap + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + +![](https://i.imgur.com/tzhXQYI.jpg) + +I am a full-time Dvorak typist, and occasional semi-serious FPS gamer. The layers are oriented towards a mix of typing and gaming. + + +---- + +# Outline + +- [Base Layers](./readme_ch1.md) + - Layer 0: QWERTY `_QW` + - Layer 1: Hardware Dvorak `_DV` + - Layer 2: Hardware Colemak `_CM` +- [OS Overlays](./readme_ch2.md) + - Layer 3: MacOS Overlay `_MC` +- [Quake 2 Overlays](./readme_ch3.md) + - Layers 4, 5 and 6: Quake 2 `_Q2`, Quake 2 Dvorak `_QD`, and Quake 2 Console `_QC` +- [Function Layers](./readme_ch4.md) + - Layer 7: Windows Fn layer `_FW` + - Layer 8: MacOS-oriented Fn layer `_FM` + - Layer 9: Quake 2 Fn layer `_FQ` +- [Other Layers](./readme_ch5.md) + - Layer 10: Numpad layer `_NP` + - Layer 11: Macro layer `_MA` + - Layer 12: System layer `_SY` diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md new file mode 100644 index 0000000000..bee0709f48 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch1.md @@ -0,0 +1,70 @@ +# @noroadsleft's KC60 keymap + +- [Table of Contents](./readme.md) + 1. **Base Layers** + 2. [**OS Overlays**](./readme_ch2.md) + 3. [Quake 2 Overlays](./readme_ch3.md) + 4. [Function Layers](./readme_ch4.md) + 5. [Other Layers](./readme_ch5.md) + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + + +---- + +## Layer 0: QWERTY - `_QW` + +Standard QWERTY layout, with three QMK features: + +- The `Menu` key has been replaced by `MO(_FW)`, which moves to my Windows Fn layer when held. +- The `Caps Lock` key has been replaced with a dual function `LT()` key, which opens the Windows Fn layer when held, and is `Caps Lock` when tapped +- The `Escape` key has been replaced with a `KC_GESC` `` ` ~ `` key when used with a `Fn` key or a `Shift` key + +###### For the rest of this readme, the physical location of keys will be referred to by their function in a US QWERTY layout. + +![QWERTY layer](https://i.imgur.com/2eVsefw.png) + +Keycode(s) Sent | Notes +:---------------------------------------------------- | :---- +[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key. +`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped. +`MO(_FW)` | Opens the Windows Fn layer when held. + + +---- + +## Layer 1: Hardware Dvorak - `_DV` + +### Accessed by holding either `Fn` and tapping `/?` key, then tapping `2@`. + +A hardware-based Dvorak Simplified layout. At my weekend job, I use a shared computer that runs MacOS Sierra, in US QWERTY layout. In this layer, I can leave the system in QWERTY, plug my keyboard in, and still type in Dvorak. + +![Hardware Dvorak layer](https://i.imgur.com/a6hYedB.png) + +Keycode(s) Sent | Notes +:---------------------------------------------------- | :---- +[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key. +`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped. +`MO(_FW)` | Opens the Windows Fn layer when held. + + +---- + +## Layer 2: Hardware Colemak `_CM` + +### Accessed by holding either `Fn` and tapping `/?` key, then tapping `3#`. + +A hardware-based Colemak layout. Been thinking of trying it, so it's here. + +![Hardware Colemak layer](https://i.imgur.com/dbQ6HDW.png) + +Keycode(s) Sent | Notes +:---------------------------------------------------- | :---- +[`KC_GESC`](https://docs.qmk.fm/#/feature_grave_esc) | `Esc` when tapped alone, `` ` ~ `` when used with a `Shift` or `GUI` key. +`LT(_FW, KC_CAPS)` | Opens the Windows Fn layer when held; toggles Caps Lock when tapped. +`MO(_FW)` | Opens the Windows Fn layer when held. + + +---- + +Next Chapter: [OS Overlays](./readme_ch2.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md new file mode 100644 index 0000000000..75a4fc5244 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch2.md @@ -0,0 +1,26 @@ +# @noroadsleft's KC60 keymap + +- [Table of Contents](./readme.md) + 1. [Base Layers](./readme_ch1.md) + 2. **OS Overlays** + 3. [Quake 2 Overlays](./readme_ch3.md) + 4. [Function Layers](./readme_ch4.md) + 5. [Other Layers](./readme_ch5.md) + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + + +---- + +## Layer 3: Layer 3: MacOS Overlay `_MC` + +### Toggled by holding either `Fn` and tapping `/?` key, then tapping `W`. + +This layer overrides the `Fn` keys on whichever base layer is currently enabled, sending the keyboard to the MacOS-oriented Fn layer `_FM`, instead of the Windows Fn layer `_FW`. + +![MacOS Overlay](https://i.imgur.com/lxsEVpm.png) + + +---- + +Next Chapter: [Quake 2 Overlays](./readme_ch3.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md new file mode 100644 index 0000000000..80549ba5ce --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch3.md @@ -0,0 +1,39 @@ +# @noroadsleft's KC60 keymap + +- [Table of Contents](./readme.md) + 1. [Base Layers](./readme_ch1.md) + 2. [OS Overlays](./readme_ch2.md) + 3. **Quake 2 Overlays** + 4. [Function Layers](./readme_ch4.md) + 5. [Other Layers](./readme_ch5.md) + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + + +---- + +## Layers 4, 5 and 6: Quake 2 `_Q2`, Quake 2 Dvorak `_QD`, and Quake 2 Console `_QC` + +### Accessed by holding either `Fn` key and tapping the `/?` key, then tapping `4$` + +These layers were born out of the confusion I have had trying to use the in-game chat and the console in [Quake 2](https://en.wikipedia.org/wiki/Quake_II). When Quake 2 came out, alternate keyboard layouts weren't really a thing. As a result, all in-game text input is hard-locked to US QWERTY, regardless of what the operating system is using for its input method. + +I'm attempting to solve this by some creative use of QMK's macro feature. The keycode in the System layer that enables these layers, [`GO_Q2`](./keymap.c#L386), is a [macro](./keymap.c#L175-183) that sets the default layer to the QWERTY layer, then turns the Quake 2 layer `_Q2` on. The result is a partially-overwritten QWERTY layer, that has some keycodes with some creative layer switching. + +When I hit the `Enter` key (bound in-game to text chat), the [macro keycode](./keymap.c#L184-L191) I've created sends the keycode for `Enter`, then follows with enabling the Hardware Dvorak layer and its corresponding overlay. Now the game is in text chat mode, and my keyboard is in Dvorak. When I hit `Enter` again, another `Enter` [keycode macro](./keymap.c#L192-L199) is sent, which sends the message, then the macro brings me back to the standard QWERTY+Quake 2 setup. Hitting `Escape` instead runs a [macro](./keymap.c#L200-L207) that cancels the sending of the message, and undoes the layers. + +I have been testing this configuration for a few months. Sometimes I end up still in Dvorak mode without any text input systems (in-game chat or the console) running, but it pretty much always happens when I'm focused on the game, so I don't know the cause yet. + +### Layer 4: Quake 2 +![Quake 2](https://i.imgur.com/WEZ9p2u.png) + +### Layer 5: Quake 2 Dvorak +![Quake 2 Dvorak](https://i.imgur.com/rhugHN4.png) + +### Layer 6: Quake 2 Console +![Quake 2 Console](https://i.imgur.com/dRTAjcy.png) + + +---- + +Next Chapter: [Function Layers](./readme_ch4.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md new file mode 100644 index 0000000000..f1b50846d9 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch4.md @@ -0,0 +1,54 @@ +# @noroadsleft's KC60 keymap + +- [Table of Contents](./readme.md) + 1. [Base Layers](./readme_ch1.md) + 2. [OS Overlays](./readme_ch2.md) + 3. [Quake 2 Overlays](./readme_ch3.md) + 4. **Function Layers** + 5. [Other Layers](./readme_ch5.md) + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + + +---- + +## Layer 7: Windows Fn layer - `_FW` + +### Accessed by holding either `Fn` key in Layer 0 + +Arrows, Navigation keys (Insert, Home, Page Up, etc.), and Function keys are here. Also has keys for Calculator, Menu, Volume Control, and shortcuts for Select All, Undo, Cut, Copy, and Paste. Numpad Enter for when I'm working in Adobe Photoshop, because it treats Numpad Enter differently from the regular Enter key. + +![Windows Fn layer](https://i.imgur.com/XwCshcz.png) + + +---- + +## Layer 8: MacOS-oriented Fn layer - `_FM` + +### Accessed by holding either `Fn` key in Layer 1 + +Based on my Windows Fn layer, but swaps a few functions for a MacOS environment. Arrow, Navigation, and Function keys are basically unchanged from Layer 2. This layer enables using either `Fn` key as a sort of simulated `Command` key, which I find easier to reach and use. + +![MacOS-oriented Fn layer](https://i.imgur.com/Z11kRu2.png) + + +---- + +## Layer 9: Quake 2 Fn layer - `_FQ` + +### Accessed by holding either `Fn` key while either Quake 2 overlay is active. + +Based on the Windows function layer, but removes some functions that are pointless to have while in the game. + +![Quake 2 Fn layer](https://i.imgur.com/9PG7yWb.png) + +Keycode(s) Sent | Notes +:-------------------------------- | :---- +[`Q2_GRV`](./keymap.c#L208-L216) | Sends `KC_GRV`, then enables the Dvorak, Quake 2 Dvorak, and Quake 2 Console layers. + + + + +---- + +Next Chapter: [Other Layers](./readme_ch5.md) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md new file mode 100644 index 0000000000..64102eb88d --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_ch5.md @@ -0,0 +1,84 @@ +# @noroadsleft's KC60 keymap + +- [Table of Contents](./readme.md) + 1. [Base Layers](./readme_ch1.md) + 2. [OS Overlays](./readme_ch2.md) + 3. [Quake 2 Overlays](./readme_ch3.md) + 4. [Function Layers](./readme_ch4.md) + 5. **Other Layers** + +### Last updated: September 2, 2018, 1:03 PM UTC-0700 + + +---- + +## Layer 10: Numpad layer - `_NP` + +### Accessed by holding either `Fn` key and tapping `Space`, from any of the Base Layers + +Puts a Numpad on the right-hand side of the keyboard. A through F included for hexadecimal input. Tapping `Space` returns to the previous Base Layer. + +![Numpad layer](https://i.imgur.com/fKVRkGH.png) + + +---- + +## Layer 11: Macro layer - `_MA` + +### Accessed by holding the `Fn` key and tapping the right-side `Win` key + +Has some macros that I use in Git, and some frequently-typed strings. + +Tapping `Esc` exits the Macro layer, if the macro used doesn't do it automatically. + +![Macro layer](https://i.imgur.com/wgbsluI.png) + + +### Macros + +[![lavak3DED](https://static-cdn.jtvnw.net/emoticons/v1/821796/1.0)](./keymap.c#L122-L127) +Inputs: `lavak3DED ` +Twitch emote for [a streamer I watch a lot](https://www.twitch.tv/lavak3_). + +[G_PUSH](./keymap.c#L128-L133) +Inputs: `git push origin ` +Everything from here down is related to Git or GitHub. + +[G_FTCH](./keymap.c#L134-L139) +Inputs: `git fetch upstream` + +[G_COMM](./keymap.c#L140-L146) +Inputs: `git commit -m ""` `[Left]` +Readies a `git commit` command, moves the cursor between the quotation marks, then disables the Macro layer. + +[G_RST](./keymap.c#L147-L153) +Inputs: `git histt -n 10`, Enter, `git reset --soft ` +Runs a [git alias](./readme_git.md) that shows my last ten commits, then readies a `git reset --soft`. For when I commit something too soon. Disables the Macro layer when complete. + +[G_C10R](./keymap.c#L154-L160) +Inputs: `cf/` +A branch prefix I use for my current work in QMK. Disables the Macro layer when finished. + +[G_BRCH](./keymap.c#L161-L167) +Inputs: `$(git branch-name)` +A [git alias](./readme_git.md) that returns the name of the current branch. Disables the Macro layer when finished. + +[SIGNA](./keymap.c#L168-L174) +Inputs: `\- @noroadsleft` `[Enter]` +Sometimes on GitHub, I sign my comments. Types my GitHub name in Markdown syntax, and then taps the `Enter` key. Disables the Macro layer when finished. + + +---- + +### Layer 12: System layer - `_SY` + +#### Accessed by holding either `Fn` key and tapping the `/?` key + +This is where I change my keyboard function. Base layer select on `1` through `3`, Backlight controls on `C` through `N`, Reset on `8*`, Debug on `0)`. + +![System layer](https://i.imgur.com/95ovTBn.png) + + +---- + +[Back to the index.](./) diff --git a/keyboards/kc60/keymaps/noroadsleft/readme_git.md b/keyboards/kc60/keymaps/noroadsleft/readme_git.md new file mode 100644 index 0000000000..585d9c8909 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/readme_git.md @@ -0,0 +1,56 @@ +# @noroadsleft's Git aliases + +[Return to the directory index.](./) + +``` +[alias] + # change branches + co = checkout + cob = checkout -b + + # sync master + sync = "!f() { if [ $(git branch-name) != "master" ]; then git checkout master; fi; git pull upstream master; git push origin master; }; f" + + # Return the last five commits on the branch, in a more compact format + hist = log --pretty=format:\"%C(yellow)%h%Creset %Cgreen%ad%Creset%n %w(100,0,3)%s%d [%an]%n\" --graph --date=iso-local -n 5 + histm = log --pretty=format:\"%C(yellow)%h%Creset %w(100,0,3)%s%d [%an]\" --graph --date=iso-local -n 5 + histt = log --pretty=format:\"%C(yellow)%h%Creset %<(88,trunc)%s [%an]\" --graph --date=iso-local -n 5 + histb = log --reverse --pretty=format:\"- %<(98,trunc)%s [%an]\" --date=iso-local -n 5 + + # compact diff + df = "diff --compact-summary" + + # Short-form status + st = "!git status --short" + + # Returns the name of the current branch + branch-name = "!git rev-parse --abbrev-ref HEAD" + + # short-form of the above + bn = "!git branch-name" + + po = "push origin ($(git branch-name))" + + # List the stashes + sl = "stash list" + + # Show the contents of a numbered stash + # Syntax: + # git st-show + st-show = "!f() { git stash show stash@{$1} -p; }; f" + + # Apply a stash, without deleting it from the list of stashes + # Syntax: + # git st-copy + st-copy = "!f() { git stash apply stash@{$1}; }; f" + + # Unstage a file + unstage = "reset HEAD" + + # Restore a file to the state it was in when checked out + restore = "checkout --" + + # Compare local master repo to its upstream branch. If anything is returned, local branch has diverged from upstream. + cm = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master --compact-summary; }; f" + cml = "!f() { git fetch upstream master; git diff $(git branch-name) upstream/master; }; f" +``` diff --git a/keyboards/kc60/keymaps/noroadsleft/rules.mk b/keyboards/kc60/keymaps/noroadsleft/rules.mk new file mode 100644 index 0000000000..9d78fc0fb3 --- /dev/null +++ b/keyboards/kc60/keymaps/noroadsleft/rules.mk @@ -0,0 +1,2 @@ +# https://github.com/qmk/qmk_firmware/issues/3448#issuecomment-406636125 +EXTRAFLAGS += -flto -- cgit v1.2.3 From 9d949389f92b6b397ed62246b60ead86d80a57a1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 08:09:05 -0700 Subject: Adds default value for TAPPING_TERM if Tap Dance is enabled (#2785) * Force require TAPPING_TERM if Tap Dance is enabled * Handle lack of TAPPING_TERM more gracefully --- quantum/process_keycode/process_tap_dance.c | 4 ++++ quantum/quantum.h | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index 8337806912..b55ace5ba8 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -16,6 +16,10 @@ #include "quantum.h" #include "action_tapping.h" +#ifndef TAPPING_TERM +#define TAPPING_TERM 200 +#endif + #ifndef NO_ACTION_ONESHOT uint8_t get_oneshot_mods(void); #endif diff --git a/quantum/quantum.h b/quantum/quantum.h index 6833332117..87a61356c7 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -31,7 +31,7 @@ #include "backlight.h" #endif #if !defined(RGBLIGHT_ENABLE) && !defined(RGB_MATRIX_ENABLE) - #include "rgb.h" + #include "rgb.h" #endif #ifdef RGBLIGHT_ENABLE #include "rgblight.h" @@ -108,7 +108,9 @@ extern uint32_t default_layer_state; #include "process_unicodemap.h" #endif -#include "process_tap_dance.h" +#ifdef TAP_DANCE_ENABLE + #include "process_tap_dance.h" +#endif #ifdef PRINTING_ENABLE #include "process_printer.h" -- cgit v1.2.3 From 3907ed034bec6730d8bff401ac632161540ea3cb Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 08:09:57 -0700 Subject: Fix YMDK NP21 keyboard to use proper keyboard level functions (#3042) * Use proper function levels * Add matrix init functions * Convert KEYMAP to LAYOUT Or @mechmerlin is going to hunt me down and harm me... probably :) * Fix conflict issues --- keyboards/ymdk_np21/keymaps/default/keymap.c | 7 +++---- keyboards/ymdk_np21/matrix.c | 11 +++++++++++ keyboards/ymdk_np21/ymdk_np21.c | 6 ++++-- keyboards/ymdk_np21/ymdk_np21.h | 4 +--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/keyboards/ymdk_np21/keymaps/default/keymap.c b/keyboards/ymdk_np21/keymaps/default/keymap.c index e79d326b7c..3ade30479f 100644 --- a/keyboards/ymdk_np21/keymaps/default/keymap.c +++ b/keyboards/ymdk_np21/keymaps/default/keymap.c @@ -1,5 +1,4 @@ -#include "ymdk_np21.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #define _NP 0 #define _BL 1 @@ -21,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Enter| Enter| + | + | - | FN | * `-----------------------------------------' */ -[_NP] = KEYMAP( \ +[_NP] = LAYOUT( \ KC_KP_0, KC_KP_1, KC_KP_4, KC_KP_7, KC_NUMLOCK, KC_ESC, \ KC_DOT, KC_KP_2, KC_KP_5, KC_KP_8, KC_KP_SLASH, KC_TAB, \ KC_KP_DOT, KC_KP_3, KC_KP_6, KC_KP_9, KC_KP_ASTERISK, KC_BSPACE, \ @@ -38,7 +37,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | BL_DEC | BL_DEC | BL_INC | BL_INC | | | * `---------------------------------------------' */ -[_BL] = KEYMAP( \ +[_BL] = LAYOUT( \ BL_BRTG, _______, _______, _______, _______, _______, \ _______, BL_OFF, BL_TOGG, BL_ON, _______, _______, \ _______, _______, _______, _______, _______, _______, \ diff --git a/keyboards/ymdk_np21/matrix.c b/keyboards/ymdk_np21/matrix.c index a9e9cb5397..b2bfb2f0bb 100644 --- a/keyboards/ymdk_np21/matrix.c +++ b/keyboards/ymdk_np21/matrix.c @@ -91,12 +91,23 @@ uint8_t matrix_scan(void) { return 1; } +__attribute__ ((weak)) +void matrix_scan_user(void) {}; + +__attribute__ ((weak)) void matrix_scan_kb(void) { // Looping keyboard code goes here // This runs every cycle (a lot) matrix_scan_user(); }; +__attribute__ ((weak)) +void matrix_init_user(void) {}; + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} // declarations void matrix_set_row_status(uint8_t row) { DDRB = (1 << row); diff --git a/keyboards/ymdk_np21/ymdk_np21.c b/keyboards/ymdk_np21/ymdk_np21.c index 670083a116..c1b11b4046 100644 --- a/keyboards/ymdk_np21/ymdk_np21.c +++ b/keyboards/ymdk_np21/ymdk_np21.c @@ -34,7 +34,7 @@ extern rgblight_config_t rgblight_config; // @Override void matrix_init_kb(void) { // call user level keymaps, if any - // matrix_init_user(); + matrix_init_user(); } #ifdef BACKLIGHT_ENABLE @@ -67,7 +67,7 @@ void rgblight_set(void) { } bool rgb_init = false; -void matrix_scan_user(void) { +void matrix_scan_kb(void) { // if LEDs were previously on before poweroff, turn them back on if (rgb_init == false && rgblight_config.enable) { i2c_init(); @@ -77,4 +77,6 @@ void matrix_scan_user(void) { rgblight_task(); /* Nothing else for now. */ + + matrix_scan_user(); } diff --git a/keyboards/ymdk_np21/ymdk_np21.h b/keyboards/ymdk_np21/ymdk_np21.h index babdc84831..728406d6e5 100644 --- a/keyboards/ymdk_np21/ymdk_np21.h +++ b/keyboards/ymdk_np21/ymdk_np21.h @@ -25,7 +25,7 @@ along with this program. If not, see . void matrix_init_user(void); // TODO port this to other PS2AVRGB boards -#define KEYMAP_GRID( \ +#define LAYOUT( \ K01, K02, K03, K04, K05, K06, \ K11, K12, K13, K14, K15, K16, \ K21, K22, K23, K24, K25, K26, \ @@ -38,6 +38,4 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards { K36, K35, K34, K33, K32, K31 } \ } -#define KEYMAP KEYMAP_GRID - #endif -- cgit v1.2.3 From 45a4a0a7fc32f521ad6487c19201340b81aaad5c Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 1 Oct 2018 12:25:16 -0400 Subject: Keyboard: Adding initial luddite keyboard framework (#4029) * Adding initial luddite keyboard framework * Use pragma and update readme * Remove duplicate macro definitions --- keyboards/luddite/README.md | 18 +++++++++ keyboards/luddite/config.h | 48 ++++++++++++++++++++++++ keyboards/luddite/keymaps/default/keymap.c | 32 ++++++++++++++++ keyboards/luddite/luddite.c | 1 + keyboards/luddite/luddite.h | 21 +++++++++++ keyboards/luddite/rules.mk | 59 ++++++++++++++++++++++++++++++ 6 files changed, 179 insertions(+) create mode 100644 keyboards/luddite/README.md create mode 100644 keyboards/luddite/config.h create mode 100644 keyboards/luddite/keymaps/default/keymap.c create mode 100644 keyboards/luddite/luddite.c create mode 100644 keyboards/luddite/luddite.h create mode 100644 keyboards/luddite/rules.mk diff --git a/keyboards/luddite/README.md b/keyboards/luddite/README.md new file mode 100644 index 0000000000..72666dda5f --- /dev/null +++ b/keyboards/luddite/README.md @@ -0,0 +1,18 @@ +# Luddite + +Luddite 60% keyboard with backlight and RGB underglow. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/luddite) + +Keyboard Maintainer: QMK Community +Hardware Supported: Luddite PCB +Hardware Availability: [Luddite project on 40% Keyboards](http://www.40percent.club/search/label/luddite) + +Make example for this keyboard (after setting up your build environment): + + make luddite: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). + +First pass at adding support for the luddite keyboard. Compiles but completely +untested. Intended to kick-start development. diff --git a/keyboards/luddite/config.h b/keyboards/luddite/config.h new file mode 100644 index 0000000000..62ff72bb03 --- /dev/null +++ b/keyboards/luddite/config.h @@ -0,0 +1,48 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x1001 +#define MANUFACTURER di0ib +#define PRODUCT Luddite +#define DESCRIPTION Luddite Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 4 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +// #define RGBLIGHT_HUE_STEP 10 +// #define RGBLIGHT_SAT_STEP 17 +// #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/luddite/keymaps/default/keymap.c b/keyboards/luddite/keymaps/default/keymap.c new file mode 100644 index 0000000000..4d6ae0d524 --- /dev/null +++ b/keyboards/luddite/keymaps/default/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, 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_BSPC, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/luddite/luddite.c b/keyboards/luddite/luddite.c new file mode 100644 index 0000000000..3e720ad571 --- /dev/null +++ b/keyboards/luddite/luddite.c @@ -0,0 +1 @@ +#include "luddite.h" diff --git a/keyboards/luddite/luddite.h b/keyboards/luddite/luddite.h new file mode 100644 index 0000000000..1ba743e9e7 --- /dev/null +++ b/keyboards/luddite/luddite.h @@ -0,0 +1,21 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K10, K11, K12, K13, K14, K15, \ + K16, K17, K20, K21, K22, K23, K24, K25, K26, K27, K30, K31, K32, K33, \ + K34, K35, K36, K37, K40, K41, K42, K43, K44, K45, K46, K47, K50, \ + K51, K52, K53, K54, K55, K56, K57, K60, K61, K62, K63, K64, \ + K65, K66, K67, K70, K71, K72, K73, K74\ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K70, K71, K72, K73, K74 }, \ +} + diff --git a/keyboards/luddite/rules.mk b/keyboards/luddite/rules.mk new file mode 100644 index 0000000000..2f7d847bf0 --- /dev/null +++ b/keyboards/luddite/rules.mk @@ -0,0 +1,59 @@ +# MCU name +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi -- cgit v1.2.3 From 285ed08867931e967d2660f6179a57d247191d4c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 1 Oct 2018 09:34:20 -0700 Subject: Keyboard: Rename macropad to treasure/type9 (#4035) * rename macropad keyboard to type9 under the treasure directory * fixup the readme * rename macropad to type9 * moar renames --- keyboards/macropad/config.h | 224 --------------------- keyboards/macropad/info.json | 12 -- keyboards/macropad/keymaps/default/config.h | 19 -- keyboards/macropad/keymaps/default/keymap.c | 64 ------ keyboards/macropad/keymaps/default/readme.md | 1 - keyboards/macropad/macropad.c | 43 ---- keyboards/macropad/macropad.h | 40 ---- keyboards/macropad/readme.md | 13 -- keyboards/macropad/rules.mk | 81 -------- keyboards/treasure/type9/config.h | 224 +++++++++++++++++++++ keyboards/treasure/type9/info.json | 12 ++ keyboards/treasure/type9/keymaps/default/config.h | 19 ++ keyboards/treasure/type9/keymaps/default/keymap.c | 64 ++++++ keyboards/treasure/type9/keymaps/default/readme.md | 1 + keyboards/treasure/type9/readme.md | 13 ++ keyboards/treasure/type9/rules.mk | 81 ++++++++ keyboards/treasure/type9/type9.c | 43 ++++ keyboards/treasure/type9/type9.h | 40 ++++ 18 files changed, 497 insertions(+), 497 deletions(-) delete mode 100644 keyboards/macropad/config.h delete mode 100644 keyboards/macropad/info.json delete mode 100644 keyboards/macropad/keymaps/default/config.h delete mode 100644 keyboards/macropad/keymaps/default/keymap.c delete mode 100644 keyboards/macropad/keymaps/default/readme.md delete mode 100644 keyboards/macropad/macropad.c delete mode 100644 keyboards/macropad/macropad.h delete mode 100644 keyboards/macropad/readme.md delete mode 100644 keyboards/macropad/rules.mk create mode 100644 keyboards/treasure/type9/config.h create mode 100644 keyboards/treasure/type9/info.json create mode 100644 keyboards/treasure/type9/keymaps/default/config.h create mode 100644 keyboards/treasure/type9/keymaps/default/keymap.c create mode 100644 keyboards/treasure/type9/keymaps/default/readme.md create mode 100644 keyboards/treasure/type9/readme.md create mode 100644 keyboards/treasure/type9/rules.mk create mode 100644 keyboards/treasure/type9/type9.c create mode 100644 keyboards/treasure/type9/type9.h diff --git a/keyboards/macropad/config.h b/keyboards/macropad/config.h deleted file mode 100644 index 00f2e78110..0000000000 --- a/keyboards/macropad/config.h +++ /dev/null @@ -1,224 +0,0 @@ -/* -Copyright 2018 MechMerlin - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Treasure -#define PRODUCT Macropad Type 9 -#define DESCRIPTION A custom macropad - -/* key matrix size */ -#define MATRIX_ROWS 3 -#define MATRIX_COLS 3 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { E6, D7, C6 } -#define MATRIX_COL_PINS { D1, D0, D4 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -// #define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 10 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/macropad/info.json b/keyboards/macropad/info.json deleted file mode 100644 index f946ed153e..0000000000 --- a/keyboards/macropad/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Macropad", - "url": "", - "maintainer": "qmk", - "width": 3, - "height": 3, - "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}] - } - } -} diff --git a/keyboards/macropad/keymaps/default/config.h b/keyboards/macropad/keymaps/default/config.h deleted file mode 100644 index a3ed4f762a..0000000000 --- a/keyboards/macropad/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 - -// place overrides here diff --git a/keyboards/macropad/keymaps/default/keymap.c b/keyboards/macropad/keymaps/default/keymap.c deleted file mode 100644 index 300d5b1e4c..0000000000 --- a/keyboards/macropad/keymaps/default/keymap.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include QMK_KEYBOARD_H - -// Defines the keycodes used by our macros in process_record_user -enum custom_keycodes { - QMKBEST = SAFE_RANGE, - QMKURL -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( /* Base */ - KC_0, KC_1, KC_2, \ - KC_3, KC_4, KC_5, \ - KC_6, KC_7, KC_8 \ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QMKBEST: - if (record->event.pressed) { - // when keycode QMKBEST is pressed - SEND_STRING("QMK is the best thing ever!"); - } else { - // when keycode QMKBEST is released - } - break; - case QMKURL: - if (record->event.pressed) { - // when keycode QMKURL is pressed - SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); - } else { - // when keycode QMKURL is released - } - break; - } - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/macropad/keymaps/default/readme.md b/keyboards/macropad/keymaps/default/readme.md deleted file mode 100644 index bd3d78af21..0000000000 --- a/keyboards/macropad/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for macropad diff --git a/keyboards/macropad/macropad.c b/keyboards/macropad/macropad.c deleted file mode 100644 index 0219746e12..0000000000 --- a/keyboards/macropad/macropad.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#include "macropad.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/macropad/macropad.h b/keyboards/macropad/macropad.h deleted file mode 100644 index 94471d7c57..0000000000 --- a/keyboards/macropad/macropad.h +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2018 MechMerlin - * - * 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 . - */ -#ifndef MACROPAD_H -#define MACROPAD_H - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - K00, K01, K02, \ - K10, K11, K12, \ - K20, K21, K22 \ -) \ -{ \ - { K00, K01, K02 }, \ - { K10, K11, K12 }, \ - { K20, K21, K22 }, \ -} - -#endif diff --git a/keyboards/macropad/readme.md b/keyboards/macropad/readme.md deleted file mode 100644 index 204ec1fd23..0000000000 --- a/keyboards/macropad/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# Macropad - -3x3 Macropad. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: Treasure Macropad Type-9 -Hardware Availability: [Treasure](http://macropad.co/) - -Make example for this keyboard (after setting up your build environment): - - make macropad: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/macropad/rules.mk b/keyboards/macropad/rules.mk deleted file mode 100644 index 599974d25a..0000000000 --- a/keyboards/macropad/rules.mk +++ /dev/null @@ -1,81 +0,0 @@ -# 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 = atmel-dfu - - -# 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = yes # 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) diff --git a/keyboards/treasure/type9/config.h b/keyboards/treasure/type9/config.h new file mode 100644 index 0000000000..55f0a85956 --- /dev/null +++ b/keyboards/treasure/type9/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Treasure +#define PRODUCT Type 9 +#define DESCRIPTION A custom macropad + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6, D7, C6 } +#define MATRIX_COL_PINS { D1, D0, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 10 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/treasure/type9/info.json b/keyboards/treasure/type9/info.json new file mode 100644 index 0000000000..7e7b1d0bda --- /dev/null +++ b/keyboards/treasure/type9/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Type-9", + "url": "", + "maintainer": "qmk", + "width": 3, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}] + } + } +} diff --git a/keyboards/treasure/type9/keymaps/default/config.h b/keyboards/treasure/type9/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/treasure/type9/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/treasure/type9/keymaps/default/keymap.c b/keyboards/treasure/type9/keymaps/default/keymap.c new file mode 100644 index 0000000000..300d5b1e4c --- /dev/null +++ b/keyboards/treasure/type9/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_0, KC_1, KC_2, \ + KC_3, KC_4, KC_5, \ + KC_6, KC_7, KC_8 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/treasure/type9/keymaps/default/readme.md b/keyboards/treasure/type9/keymaps/default/readme.md new file mode 100644 index 0000000000..94784baccd --- /dev/null +++ b/keyboards/treasure/type9/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Type-9 diff --git a/keyboards/treasure/type9/readme.md b/keyboards/treasure/type9/readme.md new file mode 100644 index 0000000000..7c567f91b9 --- /dev/null +++ b/keyboards/treasure/type9/readme.md @@ -0,0 +1,13 @@ +# Type-9 + +3x3 Macropad. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: Treasure Macropad Type-9 +Hardware Availability: [Treasure](http://macropad.co/) + +Make example for this keyboard (after setting up your build environment): + + make treasure/type9: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/treasure/type9/rules.mk b/keyboards/treasure/type9/rules.mk new file mode 100644 index 0000000000..599974d25a --- /dev/null +++ b/keyboards/treasure/type9/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # 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) diff --git a/keyboards/treasure/type9/type9.c b/keyboards/treasure/type9/type9.c new file mode 100644 index 0000000000..58a9c8f52d --- /dev/null +++ b/keyboards/treasure/type9/type9.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "type9.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/treasure/type9/type9.h b/keyboards/treasure/type9/type9.h new file mode 100644 index 0000000000..4e3c235d11 --- /dev/null +++ b/keyboards/treasure/type9/type9.h @@ -0,0 +1,40 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef TYPE9_H +#define TYPE9_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, \ + K10, K11, K12, \ + K20, K21, K22 \ +) \ +{ \ + { K00, K01, K02 }, \ + { K10, K11, K12 }, \ + { K20, K21, K22 }, \ +} + +#endif -- cgit v1.2.3 From b3f6aa9480a5ddb0b0ba0d611d988121c0ff848b Mon Sep 17 00:00:00 2001 From: Anthony Som Date: Mon, 1 Oct 2018 17:39:45 +0100 Subject: Correct small typo A small typo (it -> in) that I noticed while reading through the documentation --- docs/flashing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/flashing.md b/docs/flashing.md index 66c08a3610..1edbe22253 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -2,7 +2,7 @@ There are quite a few different types of bootloaders that keyboards use, and just about all of the use a different flashing method. Luckily, projects like the [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) aim to be compatible with all the different types without having to think about it much, but this article will describe the different types of bootloaders, and available methods for flashing them. -If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size it bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`. +If you have a bootloader selected with the `BOOTLOADER` variable in your `rules.mk`, QMK will automatically calculate if your .hex file is the right size to be flashed to the device, and output the total size in bytes (along with the max). To run this process manually, compile with the target `check-size`, eg `make planck/rev4:default:check-size`. ## DFU -- cgit v1.2.3 From da6c58175a74e4bb5a6c67f7e8b63567c14800d7 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 28 Sep 2018 09:33:51 +0100 Subject: Make digital rain RGB matrix effect #define configurable. --- docs/feature_rgb_matrix.md | 1 + keyboards/model01/keymaps/dshields/config.h | 1 + keyboards/planck/keymaps/dshields/config.h | 1 + quantum/rgb_matrix.c | 8 ++++++-- 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 4f827f8dc9..809d034bdc 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -140,6 +140,7 @@ These are the effects that are currently available: RGB_MATRIX_RAINBOW_PINWHEELS, RGB_MATRIX_RAINBOW_MOVING_CHEVRON, RGB_MATRIX_JELLYBEAN_RAINDROPS, + RGB_MATRIX_DIGITAL_RAIN, #ifdef RGB_MATRIX_KEYPRESSES RGB_MATRIX_SOLID_REACTIVE, RGB_MATRIX_SPLASH, diff --git a/keyboards/model01/keymaps/dshields/config.h b/keyboards/model01/keymaps/dshields/config.h index 4d609e4368..4de2d3cbb3 100644 --- a/keyboards/model01/keymaps/dshields/config.h +++ b/keyboards/model01/keymaps/dshields/config.h @@ -1,5 +1,6 @@ #pragma once +#define RGB_DIGITAL_RAIN_DROPS 18 #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 3000 diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index b149530b8d..512e2fbc64 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -1,5 +1,6 @@ #pragma once +#define RGB_DIGITAL_RAIN_DROPS 24 #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 3000 diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index b282284a13..f0c2ddfdfb 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -50,6 +50,11 @@ rgb_config_t rgb_matrix_config; #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 #endif +#ifndef RGB_DIGITAL_RAIN_DROPS + // lower the number for denser effect/wider keyboard + #define RGB_DIGITAL_RAIN_DROPS 24 +#endif + bool g_suspend_state = false; // Global tick at 20 Hz @@ -466,7 +471,6 @@ void rgb_matrix_jellybean_raindrops( bool initialize ) { void rgb_matrix_digital_rain( const bool initialize ) { // algorithm ported from https://github.com/tremby/Kaleidoscope-LEDEffect-DigitalRain const uint8_t drop_ticks = 28; - const uint8_t new_drop_probability = 24; const uint8_t pure_green_intensity = 0xd0; const uint8_t max_brightness_boost = 0xc0; const uint8_t max_intensity = 0xff; @@ -481,7 +485,7 @@ void rgb_matrix_digital_rain( const bool initialize ) { } for (uint8_t col = 0; col < MATRIX_COLS; col++) { for (uint8_t row = 0; row < MATRIX_ROWS; row++) { - if (row == 0 && drop == 0 && rand() < RAND_MAX / new_drop_probability) { + if (row == 0 && drop == 0 && rand() < RAND_MAX / RGB_DIGITAL_RAIN_DROPS) { // top row, pixels have just fallen and we're // making a new rain drop in this column map[col][row] = max_intensity; -- cgit v1.2.3 From 4318797d198b58bb807b3e436c7d8924d8b4a6fe Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 27 Aug 2018 09:16:54 -0700 Subject: Add user level to default_layer_state_set --- tmk_core/common/action_layer.c | 11 ++++++++++- tmk_core/common/action_layer.h | 2 ++ users/drashna/drashna.c | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index 62375dfbfe..b8dcb34f3a 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -15,13 +15,22 @@ */ uint32_t default_layer_state = 0; +/** \brief Default Layer State Set At user Level + * + * FIXME: Needs docs + */ +__attribute__((weak)) +uint32_t default_layer_state_set_user(uint32_t state) { + return state; +} + /** \brief Default Layer State Set At Keyboard Level * * FIXME: Needs docs */ __attribute__((weak)) uint32_t default_layer_state_set_kb(uint32_t state) { - return state; + return default_layer_state_set_user(state); } /** \brief Default Layer State Set diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 7bf116be2d..6d48321f92 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -31,6 +31,8 @@ void default_layer_set(uint32_t state); __attribute__((weak)) uint32_t default_layer_state_set_kb(uint32_t state); +__attribute__((weak)) +uint32_t default_layer_state_set_user(uint32_t state); #ifndef NO_ACTION_LAYER /* bitwise operation */ diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 7bb272a267..9489fb4567 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -403,8 +403,8 @@ uint32_t layer_state_set_user(uint32_t state) { } -uint32_t default_layer_state_set_kb(uint32_t state) { - return default_layer_state_set_keymap (state); +uint32_t default_layer_state_set_user(uint32_t state) { + return default_layer_state_set_keymap(state); } -- cgit v1.2.3 From e885c793bcffcba03e18e93e41120b21cdfb6b75 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:53:14 -0700 Subject: Add Function level EECONFIG code for EEPROM (#3084) * Add Function level EEPROM configuration Add kb and user functions for EEPROM, and example of how to use it. * Bug fixes and demo * Additional cleanup * Add EEPROM reset macro to example * Forgot init function in list * Move eeconfig_init_quantum function to quantum.c and actually set default layer * See if removing weak quantum function fixes issue * Fix travis compile error * Remove ifdef blocks from EECONFIG so settings are always set * Fix for ARM EEPROM updates * Fix merge issues * Fix potential STM32 EEPROM issues --- docs/custom_quantum_functions.md | 140 ++++++++++++ keyboards/ergodox_ez/keymaps/rgb_layer/config.h | 24 +++ keyboards/ergodox_ez/keymaps/rgb_layer/keymap.c | 271 ++++++++++++++++++++++++ quantum/quantum.c | 3 + tmk_core/common/eeconfig.c | 103 ++++++--- tmk_core/common/eeconfig.h | 44 ++-- 6 files changed, 545 insertions(+), 40 deletions(-) create mode 100644 keyboards/ergodox_ez/keymaps/rgb_layer/config.h create mode 100644 keyboards/ergodox_ez/keymaps/rgb_layer/keymap.c diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index 10c5c75a2d..f8b84cd6b3 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -244,3 +244,143 @@ uint32_t layer_state_set_user(uint32_t state) { * Keymap: `uint32_t layer_state_set_user(uint32_t state)` The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status) + + +# Persistent Configuration (EEPROM) + +This allows you to configure persistent settings for your keyboard. These settings are stored in the EEPROM of your controller, and are retained even after power loss. The settings can be read with `eeconfig_read_kb` and `eeconfig_read_user`, and can be written to using `eeconfig_update_kb` and `eeconfig_update_user`. This is useful for features that you want to be able to toggle (like toggling rgb layer indication). Additionally, you can use `eeconfig_init_kb` and `eeconfig_init_user` to set the default values for the EEPROM. + +The complicated part here, is that there are a bunch of ways that you can store and access data via EEPROM, and there is no "correct" way to do this. However, you only have a DWORD (4 bytes) for each function. + +Keep in mind that EEPROM has a limited number of writes. While this is very high, it's not the only thing writing to the EEPROM, and if you write too often, you can potentially drastically shorten the life of your MCU. + +* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated. + +### Example Implementation + +This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work! + + +In your keymap.c file, add this to the top: +``` +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} user_config_t; + +user_config_t user_config; +``` + +This sets up a 32 bit structure that we can store settings with in memory, and write to the EEPROM. Using this removes the need to define variables, since they're defined in this structure. Remember that `bool` (boolean) values use 1 bit, `uint8_t` uses 8 bits, `uint16_t` uses up 16 bits. You can mix and match, but changing the order can cause issues, as it will change the values that are read and written. + +We're using `rgb_layer_change`, for the `layer_state_set_*` function, and use `matrix_init_user` and `process_record_user` to configure everything. + +Now, using the `matrix_init_user` code above, you want to add `eeconfig_read_user()` to it, to populate the structure you've just created. And you can then immediately use this structure to control functionality in your keymap. And It should look like: +``` +void matrix_init_user(void) { + // Call the keymap level matrix init. + + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + + // Set default layer, if enabled + if (user_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(1); + } +} +``` +The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above. + +``` +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _RAISE: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); } + break; + case _LOWER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } + break; + case _PLOVER: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } + break; + case _ADJUST: + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } + break; + default: // for any other layers, or the default layer + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } + break; + } + return state; +} +``` +This will cause the RGB underglow to be changed ONLY if the value was enabled. Now to configure this value, create a new keycode for `process_record_user` called `RGB_LYR` and `EPRM`. Additionally, we want to make sure that if you use the normal RGB codes, that it turns off Using the example above, make it look this: +``` + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case FOO: + if (record->event.pressed) { + // Do something when pressed + } else { + // Do something else when release + } + return false; // Skip all further processing of this key + case KC_ENTER: + // Play a tone when enter is pressed + if (record->event.pressed) { + PLAY_NOTE_ARRAY(tone_qwerty); + } + return true; // Let QMK send the enter press/release events + case EPRM: + if (record->event.pressed) { + eeconfig_init(); // resets the EEPROM to default + } + return false; + case RGB_LYR: // This allows me to use underglow as layer indication, or as normal + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.rgb_layer_change) { // if layer state indication is enabled, + layer_state_set(layer_state); // then immediately update the layer color + } + } + return false; break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference) + if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (user_config.rgb_layer_change) { // only if this is enabled + user_config.rgb_layer_change = false; // disable it, and + eeconfig_update_user(user_config.raw); // write the setings to EEPROM + } + } + return true; break; + default: + return true; // Process all other keycodes normally + } +} +``` +And lastly, you want to add the `eeconfig_init_user` function, so that when the EEPROM is reset, you can specify default values, and even custom actions. For example, if you want to set rgb layer indication by default, and save the default valued. + +``` +void eeconfig_init_user(void) { // EEPROM is getting reset! + user_config.rgb_layer_change = true; // We want this enabled by default + eeconfig_update_user(user_config.raw); // Write default value to EEPROM now + + // use the non noeeprom versions, to write these values to EEPROM too + rgblight_enable(); // Enable RGB by default + rgblight_sethsv_cyan(); // Set it to CYAN by default + rgblight_mode(1); // set to solid by default +} +``` + +And you're done. The RGB layer indication will only work if you want it to. And it will be saved, even after unplugging the board. And if you use any of the RGB codes, it will disable the layer indication, so that it stays on the mode and color that you set it to. + +### 'EECONFIG' Function Documentation + +* Keyboard/Revision: `void eeconfig_init_kb(void)`, `uint32_t eeconfig_read_kb(void)` and `void eeconfig_update_kb(uint32_t val)` +* Keymap: `void eeconfig_init_user(void)`, `uint32_t eeconfig_read_user(void)` and `void eeconfig_update_user(uint32_t val)` + +The `val` is the value of the data that you want to write to EEPROM. And the `eeconfig_read_*` function return a 32 bit (DWORD) value from the EEPROM. diff --git a/keyboards/ergodox_ez/keymaps/rgb_layer/config.h b/keyboards/ergodox_ez/keymaps/rgb_layer/config.h new file mode 100644 index 0000000000..59302b8003 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/rgb_layer/config.h @@ -0,0 +1,24 @@ +#ifndef KEYMAP_CONFIG_H +#define KEYMAP_CONFIG_H + + + #define RGBLIGHT_SLEEP + + +#ifndef QMK_KEYS_PER_SCAN +#define QMK_KEYS_PER_SCAN 4 +#endif // !QMK_KEYS_PER_SCAN + +#define IGNORE_MOD_TAP_INTERRUPT +#undef PERMISSIVE_HOLD +#undef PREVENT_STUCK_MODIFIERS + + +#define FORCE_NKRO + +#ifndef TAPPING_TOGGLE +#define TAPPING_TOGGLE 1 +#endif + +#endif // !USERSPACE_CONFIG_H + diff --git a/keyboards/ergodox_ez/keymaps/rgb_layer/keymap.c b/keyboards/ergodox_ez/keymaps/rgb_layer/keymap.c new file mode 100644 index 0000000000..384d7d0945 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/rgb_layer/keymap.c @@ -0,0 +1,271 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +#define BASE 0 // default layer +#define SYMB 1 // symbols +#define MDIA 2 // media keys + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EPRM, + VRSN, + RGB_SLD, + RGB_LYR +}; + +typedef union { + uint32_t raw; + struct { + bool rgb_layer_change :1; + }; +} user_config_t; + +user_config_t user_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap 0: Basic layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | = | 1 | 2 | 3 | 4 | 5 | LEFT | | RIGHT| 6 | 7 | 8 | 9 | 0 | - | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | Del | Q | W | E | R | T | L1 | | L1 | Y | U | I | O | P | \ | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | BkSp | A | S | D | F | G |------| |------| H | J | K | L |; / L2|' / Cmd | + * |--------+------+------+------+------+------| Hyper| | Meh |------+------+------+------+------+--------| + * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |Grv/L1| '" |AltShf| Left | Right| | Up | Down | [ | ] | ~L1 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | App | LGui | | Alt |Ctrl/Esc| + * ,------|------|------| |------+--------+------. + * | | | Home | | PgUp | | | + * | Space|Backsp|------| |------| Tab |Enter | + * | |ace | End | | PgDn | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[BASE] = LAYOUT_ergodox( // layer 0 : default + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC,KC_BSPC,KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), + MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, TT(SYMB), + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN,KC_TAB, KC_ENT + ), +/* Keymap 1: Symbol Layer + * + * ,---------------------------------------------------. ,--------------------------------------------------. + * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | | + * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | + * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | EPRM | | | | | | | . | 0 | = | | + * `-----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * |Animat| LYR | |Toggle|Solid | + * ,------|------|------| |------+------+------. + * |Bright|Bright| | | |Hue- |Hue+ | + * |ness- |ness+ |------| |------| | | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// SYMBOLS +[SYMB] = LAYOUT_ergodox( + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + RESET, KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, + KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, + EPRM,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, + KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, + RGB_MOD,RGB_LYR, + KC_TRNS, + RGB_VAD,RGB_VAI,KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI +), +/* Keymap 2: Media and mouse keys + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | MsUp | | | | | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | |MsLeft|MsDown|MsRght| |------| |------| | | | | | Play | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | | | | | | | | | | | | Prev | Next | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | | | | | | + * ,------|------|------| |------+------+------. + * | | | | | | |Brwser| + * | | |------| |------| |Back | + * | | | | | | | | + * `--------------------' `--------------------' + */ +// MEDIA AND MOUSE +[MDIA] = LAYOUT_ergodox( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK +), +}; + +void eeconfig_init_user(void) { + rgblight_enable(); + rgblight_sethsv_cyan(); + rgblight_mode(1); + user_config.rgb_layer_change = true; + eeconfig_update_user(user_config.raw); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // dynamically generate these. + case EPRM: + if (record->event.pressed) { + eeconfig_init(); + } + return false; + break; + case VRSN: + if (record->event.pressed) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); + } + return false; + break; + case RGB_SLD: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + #endif + } + return false; + break; + case RGB_LYR: // This allows me to use underglow as layer indication, or as normal + if (record->event.pressed) { + user_config.rgb_layer_change ^= 1; // Toggles the status + eeconfig_update_user(user_config.raw); // Writes the new status to EEPROM + if (user_config.rgb_layer_change) { // if layer state indication is enabled, + layer_state_set(layer_state); // then immediately update the layer color + } + } + return false; break; + case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // For any of the RGB codes (see quantum_keycodes.h, L400 for reference) + if (record->event.pressed) { //This disables layer indication, as it's assumed that if you're changing this ... you want that disabled + if (user_config.rgb_layer_change) { // only if this is enabled + user_config.rgb_layer_change = false; // disable it, and + eeconfig_update_user(user_config.raw); // write the setings to EEPROM + } + } + return true; break; + } + return true; +} + +void matrix_init_user(void) { + // Call the keymap level matrix init. + + // Read the user config from EEPROM + user_config.raw = eeconfig_read_user(); + + // Set default layer, if enabled + if (user_config.rgb_layer_change) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(1); + } +} + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +}; + +uint32_t layer_state_set_user(uint32_t state) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (biton32(state)) { + case SYMB: + ergodox_right_led_1_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_red(); rgblight_mode_noeeprom(1); } + break; + case MDIA: + ergodox_right_led_2_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_green(); rgblight_mode_noeeprom(1); } + break; + case 3: + ergodox_right_led_3_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_blue(); rgblight_mode_noeeprom(1); } + break; + case 4: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_orange(); rgblight_mode_noeeprom(1); } + break; + case 5: + ergodox_right_led_1_on(); + ergodox_right_led_3_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_yellow(); rgblight_mode_noeeprom(1); } + break; + case 6: + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_pink(); rgblight_mode_noeeprom(1); } + break; + case 7: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_white(); rgblight_mode_noeeprom(1); } + break; + default: // for any other layers, or the default layer + if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_cyan(); rgblight_mode_noeeprom(1); } + break; + } + return state; +} + diff --git a/quantum/quantum.c b/quantum/quantum.c index 84ccbdeaba..eed59f811e 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -945,6 +945,9 @@ void tap_random_base64(void) { } void matrix_init_quantum() { + if (!eeconfig_is_enabled() && !eeconfig_is_disabled()) { + eeconfig_init(); + } #ifdef BACKLIGHT_ENABLE backlight_init_ports(); #endif diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 35de574a96..0fec410a9c 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c @@ -8,32 +8,54 @@ #include "eeprom_stm32.h" #endif -/** \brief eeconfig initialization +extern uint32_t default_layer_state; +/** \brief eeconfig enable * * FIXME: needs doc */ -void eeconfig_init(void) -{ +__attribute__ ((weak)) +void eeconfig_init_user(void) { + // Reset user EEPROM value to blank, rather than to a set value + eeconfig_update_user(0); +} + +__attribute__ ((weak)) +void eeconfig_init_kb(void) { + // Reset Keyboard EEPROM value to blank, rather than to a set value + eeconfig_update_kb(0); + + eeconfig_init_user(); +} + + +/* + * FIXME: needs doc + */ +void eeconfig_init_quantum(void) { #ifdef STM32F303xC EEPROM_format(); #endif - eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); - eeprom_update_byte(EECONFIG_DEBUG, 0); - eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); - eeprom_update_byte(EECONFIG_KEYMAP, 0); - eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); -#ifdef BACKLIGHT_ENABLE - eeprom_update_byte(EECONFIG_BACKLIGHT, 0); -#endif -#ifdef AUDIO_ENABLE - eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default -#endif -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - eeprom_update_dword(EECONFIG_RGBLIGHT, 0); -#endif -#ifdef STENO_ENABLE - eeprom_update_byte(EECONFIG_STENOMODE, 0); -#endif + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); + eeprom_update_byte(EECONFIG_DEBUG, 0); + eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); + default_layer_state = 0; + eeprom_update_byte(EECONFIG_KEYMAP, 0); + eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); + eeprom_update_byte(EECONFIG_BACKLIGHT, 0); + eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default + eeprom_update_dword(EECONFIG_RGBLIGHT, 0); + eeprom_update_byte(EECONFIG_STENOMODE, 0); + + eeconfig_init_kb(); +} + +/** \brief eeconfig initialization + * + * FIXME: needs doc + */ +void eeconfig_init(void) { + + eeconfig_init_quantum(); } /** \brief eeconfig enable @@ -54,7 +76,7 @@ void eeconfig_disable(void) #ifdef STM32F303xC EEPROM_format(); #endif - eeprom_update_word(EECONFIG_MAGIC, 0xFFFF); + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF); } /** \brief eeconfig is enabled @@ -66,6 +88,15 @@ bool eeconfig_is_enabled(void) return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER); } +/** \brief eeconfig is disabled + * + * FIXME: needs doc + */ +bool eeconfig_is_disabled(void) +{ + return (eeprom_read_word(EECONFIG_MAGIC) == EECONFIG_MAGIC_NUMBER_OFF); +} + /** \brief eeconfig read debug * * FIXME: needs doc @@ -99,7 +130,6 @@ uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMA */ void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); } -#ifdef BACKLIGHT_ENABLE /** \brief eeconfig read backlight * * FIXME: needs doc @@ -110,9 +140,8 @@ uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BA * FIXME: needs doc */ void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); } -#endif -#ifdef AUDIO_ENABLE + /** \brief eeconfig read audio * * FIXME: needs doc @@ -123,4 +152,28 @@ uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO) * FIXME: needs doc */ void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); } -#endif + + +/** \brief eeconfig read kb + * + * FIXME: needs doc + */ +uint32_t eeconfig_read_kb(void) { return eeprom_read_dword(EECONFIG_KEYBOARD); } +/** \brief eeconfig update kb + * + * FIXME: needs doc + */ + +void eeconfig_update_kb(uint32_t val) { eeprom_update_dword(EECONFIG_KEYBOARD, val); } +/** \brief eeconfig read user + * + * FIXME: needs doc + */ +uint32_t eeconfig_read_user(void) { return eeprom_read_dword(EECONFIG_USER); } +/** \brief eeconfig update user + * + * FIXME: needs doc + */ +void eeconfig_update_user(uint32_t val) { eeprom_update_dword(EECONFIG_USER, val); } + + diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index fa498df48c..a45cb8b12d 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -23,36 +23,41 @@ along with this program. If not, see . #define EECONFIG_MAGIC_NUMBER (uint16_t)0xFEED +#define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF /* eeprom parameteter address */ #if !defined(STM32F303xC) #define EECONFIG_MAGIC (uint16_t *)0 -#define EECONFIG_DEBUG (uint8_t *)2 -#define EECONFIG_DEFAULT_LAYER (uint8_t *)3 -#define EECONFIG_KEYMAP (uint8_t *)4 -#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 -#define EECONFIG_BACKLIGHT (uint8_t *)6 -#define EECONFIG_AUDIO (uint8_t *)7 +#define EECONFIG_DEBUG (uint8_t *)2 +#define EECONFIG_DEFAULT_LAYER (uint8_t *)3 +#define EECONFIG_KEYMAP (uint8_t *)4 +#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 +#define EECONFIG_BACKLIGHT (uint8_t *)6 +#define EECONFIG_AUDIO (uint8_t *)7 #define EECONFIG_RGBLIGHT (uint32_t *)8 #define EECONFIG_UNICODEMODE (uint8_t *)12 #define EECONFIG_STENOMODE (uint8_t *)13 // EEHANDS for two handed boards -#define EECONFIG_HANDEDNESS (uint8_t *)14 +#define EECONFIG_HANDEDNESS (uint8_t *)14 +#define EECONFIG_KEYBOARD (uint32_t *)15 +#define EECONFIG_USER (uint32_t *)19 #else /* STM32F3 uses 16byte block. Reconfigure memory map */ #define EECONFIG_MAGIC (uint16_t *)0 -#define EECONFIG_DEBUG (uint8_t *)1 -#define EECONFIG_DEFAULT_LAYER (uint8_t *)2 -#define EECONFIG_KEYMAP (uint8_t *)3 -#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)4 -#define EECONFIG_BACKLIGHT (uint8_t *)5 -#define EECONFIG_AUDIO (uint8_t *)6 +#define EECONFIG_DEBUG (uint8_t *)1 +#define EECONFIG_DEFAULT_LAYER (uint8_t *)2 +#define EECONFIG_KEYMAP (uint8_t *)3 +#define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)4 +#define EECONFIG_BACKLIGHT (uint8_t *)5 +#define EECONFIG_AUDIO (uint8_t *)6 #define EECONFIG_RGBLIGHT (uint32_t *)7 -#define EECONFIG_UNICODEMODE (uint8_t *)9 +#define EECONFIG_UNICODEMODE (uint8_t *)9 #define EECONFIG_STENOMODE (uint8_t *)10 // EEHANDS for two handed boards -#define EECONFIG_HANDEDNESS (uint8_t *)11 +#define EECONFIG_HANDEDNESS (uint8_t *)11 +#define EECONFIG_KEYBOARD (uint32_t *)12 +#define EECONFIG_USER (uint32_t *)14 #endif /* debug bit */ @@ -73,8 +78,12 @@ along with this program. If not, see . bool eeconfig_is_enabled(void); +bool eeconfig_is_disabled(void); void eeconfig_init(void); +void eeconfig_init_quantum(void); +void eeconfig_init_kb(void); +void eeconfig_init_user(void); void eeconfig_enable(void); @@ -99,4 +108,9 @@ uint8_t eeconfig_read_audio(void); void eeconfig_update_audio(uint8_t val); #endif +uint32_t eeconfig_read_kb(void); +void eeconfig_update_kb(uint32_t val); +uint32_t eeconfig_read_user(void); +void eeconfig_update_user(uint32_t val); + #endif -- cgit v1.2.3 From 26f4e7031a643ce2760ae7b6df3bd2c79710451a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:53:47 -0700 Subject: Add tap_code function (#3784) * Add tap_code * formatting * Doc clarification * Rename variable to make more consistent --- docs/feature_macros.md | 4 ++++ tmk_core/common/action.h | 1 + 2 files changed, 5 insertions(+) diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 6731530812..ba5d91882f 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -228,6 +228,10 @@ This sends the `` keydown event to the computer. Some examples would be `KC_ Parallel to `register_code` function, this sends the `` keyup event to the computer. If you don't use this, the key will be held down until it's sent. +### `tap_code();` + +This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). + ### `clear_keyboard();` This will clear all mods and keys currently pressed. diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 0322c73ed1..833febe9ce 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -88,6 +88,7 @@ void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); void register_code(uint8_t code); void unregister_code(uint8_t code); +inline void tap_code(uint8_t code) { register_code(code); unregister_code(code); } void register_mods(uint8_t mods); void unregister_mods(uint8_t mods); //void set_mods(uint8_t mods); -- cgit v1.2.3 From f5ae3760c6be7e927fba74aca4a0cf21a44113af Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 17:56:04 -0700 Subject: Add send_unicode_hex_string function (#3828) * Add send_string_unicode function Co-authored-by: kdb424 Co-authored-by: Konstantin * Clean up code based on feedback * Fix includes --- docs/feature_unicode.md | 7 +++++- quantum/process_keycode/process_unicode_common.c | 28 ++++++++++++++++++++++++ quantum/process_keycode/process_unicode_common.h | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index ecad6c60c7..278b93ad79 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -19,7 +19,7 @@ table. TBD Unicode input in QMK works by inputing a sequence of characters to the OS, -sort of like macro. Unfortunately, each OS has different ideas on how Unicode is inputted. +sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. This is the current list of Unicode input method in QMK: @@ -29,6 +29,11 @@ This is the current list of Unicode input method in QMK: * UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. * UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. +To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values seperated by spaces. +For example, the table flip seen above would be `send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B")` + +There are many ways to get a hex code, but an easy one is [this site](https://r12a.github.io/app-conversion/). Just make sure to convert to hexadecimal, and that is your string. + # Additional Language Support In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware. diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 7f34ad57cf..e6620b7ea9 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -16,6 +16,8 @@ #include "process_unicode_common.h" #include "eeprom.h" +#include +#include static uint8_t input_mode; uint8_t mods; @@ -120,3 +122,29 @@ void register_hex(uint16_t hex) { unregister_code(hex_to_keycode(digit)); } } + +void send_unicode_hex_string(const char *str) +{ + if (!str) { return; } // Safety net + + while (*str) { + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower((unsigned char)*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + + str += n; // Move to the first ' ' (or '\0') after the current token + } +} diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 4d2b04fb39..814b60c573 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -31,6 +31,7 @@ uint8_t get_unicode_input_mode(void); void unicode_input_start(void); void unicode_input_finish(void); void register_hex(uint16_t hex); +void send_unicode_hex_string(const char *str); #define UC_OSX 0 // Mac OS X #define UC_LNX 1 // Linux -- cgit v1.2.3 From 1512a6bfd48fb75619a1f77394d41bdca7ea28b1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 1 Oct 2018 18:00:14 -0700 Subject: Keymap: Update to drashna keymaps and userspace (#3992) * Enabled unicode support and send_unicode function * Unicode cleanup * More unicode tweaking * Update EEPROM stuff * Account for keyboard macros * Switch Equal to Plus on Ergodox * more tweaks * Minor Unicode tweaks * Correct matrix printing for keylogger * Fix unicode functions * Fix unicode mode set since it actually uses EEPROM * Re-add DISABLE_LEADER * Ergodox is easier to hit the tapping term, fix that * Fix stupid type on unicode mode check * Preliminary CRKBD/HeliDox support * Fixes to Helidox * Cleanup userspace from old merge stuff * Remove CCCV sounds * Make Mode NOEEPROM Again --- keyboards/crkbd/keymaps/drashna/config.h | 43 +++++ keyboards/crkbd/keymaps/drashna/glcdfont.c | 244 +++++++++++++++++++++++++++++ keyboards/crkbd/keymaps/drashna/keymap.c | 173 ++++++++++++++++++++ keyboards/crkbd/keymaps/drashna/rules.mk | 30 ++++ layouts/community/ergodox/drashna/keymap.c | 18 +-- layouts/community/ergodox/drashna/rules.mk | 4 +- users/drashna/config.h | 10 +- users/drashna/drashna.c | 75 +++++---- users/drashna/drashna.h | 28 +++- users/drashna/drashna_unicode.h | 71 --------- users/drashna/rgb_stuff.c | 5 +- users/drashna/rules.mk | 7 +- users/drashna/send_unicode.c | 58 +++++++ users/drashna/send_unicode.h | 71 +++++++++ 14 files changed, 705 insertions(+), 132 deletions(-) create mode 100644 keyboards/crkbd/keymaps/drashna/config.h create mode 100644 keyboards/crkbd/keymaps/drashna/glcdfont.c create mode 100644 keyboards/crkbd/keymaps/drashna/keymap.c create mode 100644 keyboards/crkbd/keymaps/drashna/rules.mk delete mode 100644 users/drashna/drashna_unicode.h create mode 100644 users/drashna/send_unicode.c create mode 100644 users/drashna/send_unicode.h diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h new file mode 100644 index 0000000000..366f013dca --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -0,0 +1,43 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define SSD1306OLED + +#define USE_SERIAL_PD2 + +// #define TAPPING_FORCE_HOLD +// #define TAPPING_TERM 100 + +#undef RGBLED_NUM +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c new file mode 100644 index 0000000000..4e7b27bc0c --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x0E, 0x3F, 0xFF, 0xFF, +0xFF, 0xFF, 0xFE, 0xE0, 0x80, 0x00, +0x00, 0x00, 0x00, 0x00, 0x1E, 0xBE, +0x7F, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, +0xE0, 0xC0, 0x80, 0x00, 0x0E, 0xEF, +0xDF, 0xDE, 0xBE, 0x3C, 0x38, 0x70, +0xE0, 0xDD, 0xBB, 0x7B, 0x07, 0x0E, +0x0E, 0x0C, 0x98, 0xF0, 0xE0, 0xF0, +0xF0, 0xF8, 0x78, 0x3C, 0x1C, 0x1E, +0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, +0x1F, 0xFE, 0xFE, 0xF8, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x03, +0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFE, +0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x7F, +0xFF, 0xFE, 0xFD, 0xFB, 0x1B, 0x07, +0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, +0x0B, 0x07, 0x01, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, +0xF8, 0xFE, 0xFF, 0xFF, 0x1F, 0x07, +0x01, 0x01, 0x01, 0x03, 0x06, 0x06, +0x0C, 0x0C, 0x08, 0x0C, 0x0C, 0x0E, +0x07, 0x83, 0xC1, 0xE0, 0x70, 0x30, +0x18, 0x1C, 0x7C, 0xCC, 0x8C, 0xDC, +0xF8, 0xC0, 0xE0, 0xE0, 0x70, 0xB8, +0xF0, 0x60, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xF0, 0x70, 0xF8, 0xFC, 0xFC, +0x3C, 0x30, 0x38, 0xF8, 0xF8, 0xF8, +0x78, 0x00, 0x80, 0x80, 0xC0, 0xE0, +0x70, 0x38, 0x38, 0x9C, 0xDC, 0xFC, +0x7C, 0x38, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x03, 0x07, +0x1F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7E, 0x7D, 0x3B, 0x17, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x7C, +0x78, 0x70, 0x70, 0x70, 0x70, 0x70, +0x70, 0x78, 0x38, 0x18, 0x1C, 0x0E, +0x07, 0x0F, 0x1F, 0x3F, 0x3C, 0x38, +0x38, 0x18, 0x0C, 0x06, 0x03, 0x01, +0x01, 0x01, 0x01, 0x0E, 0x1F, 0x1F, +0x1C, 0x1C, 0x1E, 0x0F, 0x0F, 0x03, +0x1D, 0x0E, 0x07, 0x03, 0x01, 0x00, +0x00, 0x0E, 0x1F, 0x1F, 0x1D, 0x1E, +0x0F, 0x07, 0x03, 0x03, 0x0F, 0x1F, +0x1F, 0x19, 0x19, 0x19, 0x19, 0x0C, +0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c new file mode 100644 index 0000000000..7bced8de33 --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H +#include "drashna.h" +#ifdef PROTOCOL_LUFA + #include "lufa.h" + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + +extern keymap_config_t keymap_config; +extern uint8_t is_master; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +enum crkbd_keycodes { + RGBRST = NEW_SAFE_RANGE +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_wrapper( + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + ), + [_COLEMAK] = LAYOUT_wrapper( + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + ), + [_DVORAK] = LAYOUT_wrapper( + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + ), + [_WORKMAN] = LAYOUT_wrapper( + KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, + KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + ), + + [_MODS] = LAYOUT_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, _______, _______, _______, _______, _______ + ), + + [_LOWER] = LAYOUT_wrapper( + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, + KC_F11, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + KC_F12, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______ + ), + + [_RAISE] = LAYOUT_wrapper( \ + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______ //`--------------------' `--------------------' + ), + + [_ADJUST] = LAYOUT_wrapper( \ + KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, + TG_MODS, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, + _______, _______, _______, _______, _______, _______ + ) +}; + +int RGB_current_mode; + +void matrix_init_keymap(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif + + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0);} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// When add source files to SRC in rules.mk, you can use functions. +const char *read_layer_state(void); +const char *read_logo(void); +void set_keylog(uint16_t keycode, keyrecord_t *record); +const char *read_keylog(void); +const char *read_keylogs(void); + +// const char *read_mode_icon(bool swap); +// const char *read_host_led_state(void); +// void set_timelog(void); +// const char *read_timelog(void); + +void matrix_scan_keymap(void) { + iota_gfx_task(); +} + +void matrix_render_user(struct CharacterMatrix *matrix) { + if (is_master) { + // If you want to change the display of OLED, you need to change here + matrix_write_ln(matrix, read_layer_state()); + matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_keylogs()); + //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + //matrix_write_ln(matrix, read_host_led_state()); + //matrix_write_ln(matrix, read_timelog()); + } else { + matrix_write(matrix, read_logo()); + } +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + matrix_render_user(&matrix); + matrix_update(&display, &matrix); +} + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + set_keylog(keycode, record); + // set_timelog(); + } + + switch (keycode) { + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode_noeeprom(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + #endif + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +#endif diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk new file mode 100644 index 0000000000..f490aa2ea8 --- /dev/null +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -0,0 +1,30 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +# 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 you want to change the display of OLED, you need to change here +SRC += ./lib/rgb_state_reader.c \ + ./lib/layer_state_reader.c \ + ./lib/logo_reader.c \ + ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 4d7700f199..15153c4692 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -57,11 +57,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT_ergodox_pretty_wrapper( // left hand // right hand - KC_EQL, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, KC_MINS, + KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS, KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, KC_MLSF, _________________QWERTY_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: COLEMAK layer @@ -89,11 +89,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [_COLEMAK] = LAYOUT_ergodox_pretty_wrapper( // left hand // right hand - KC_EQL, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, KC_MINS, + KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS, KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, KC_MLSF, _________________COLEMAK_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: DVORAK Layout @@ -121,11 +121,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [_DVORAK] = LAYOUT_ergodox_pretty_wrapper( // left hand // right hand - KC_EQL, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, KC_BSLS, + KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_BSLS, KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH, KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_MINS, KC_MLSF, _________________DVORAK_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, __________________ERGODOX_THUMB_CLUSTER_____________________ ), /* Keymap 0: WORKMAN layer @@ -153,11 +153,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Otherwise, it needs KC_* [_WORKMAN] = LAYOUT_ergodox_pretty_wrapper( // left hand - KC_EQL, ________________NUMBER_LEFT________________, _______, _______, ________________NUMBER_RIGHT_______________, KC_MINS, + KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS, KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, KC_MLSF, _________________WORKMAN_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, KC_NO, + KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, __________________ERGODOX_THUMB_CLUSTER_____________________ ), @@ -197,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index 30d513c911..8bf53950e4 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -8,8 +8,8 @@ endif CONSOLE_ENABLE = no BOOTMAGIC_ENABLE = yes -UNICODE_ENABLE = no -UNICDOEMAP_ENABLE = yes +UNICODE_ENABLE = yes +UNICDOEMAP_ENABLE = no MACROS_ENABLED = no RGBLIGHT_TWINKLE = no diff --git a/users/drashna/config.h b/users/drashna/config.h index 92efcc5c74..3ddec93b13 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -55,7 +55,11 @@ #ifdef TAPPING_TERM #undef TAPPING_TERM #endif // TAPPING_TERM -#define TAPPING_TERM 175 +#ifdef KEYBOARD_ergodox_ez + #define TAPPING_TERM 185 +#else + #define TAPPING_TERM 175 +#endif // Disable action_get_macro and fn_actions, since we don't use these @@ -63,4 +67,8 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION +#define DISABLE_LEADER + #define MACRO_TIMER 5 + + diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 9489fb4567..aad9fab611 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -21,6 +21,7 @@ along with this program. If not, see . userspace_config_t userspace_config; +uint16_t copy_paste_timer; // Helper Functions @@ -131,7 +132,7 @@ void led_set_keymap(uint8_t usb_led) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); + userspace_config.raw = eeprom_read_dword(EECONFIG_USERSPACE); #ifdef BOOTLOADER_CATERINA @@ -143,7 +144,9 @@ void matrix_init_user(void) { #endif #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - set_unicode_input_mode(UC_WINC); + if (eeprom_read_byte(EECONFIG_UNICODEMODE) != UC_WIN) { + set_unicode_input_mode(UC_WIN); + } #endif //UNICODE_ENABLE matrix_init_keymap(); } @@ -173,17 +176,12 @@ void shutdown_user (void) { shutdown_keymap(); } -void suspend_power_down_user(void) -{ +void suspend_power_down_user(void) { suspend_power_down_keymap(); } -void suspend_wakeup_init_user(void) -{ +void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); - #ifdef KEYBOARD_ergodox_ez - wait_ms(10); - #endif } @@ -216,7 +214,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // If console is enabled, it will print the matrix position and status of each key pressed #ifdef KEYLOGGER_ENABLE - xprintf("KL: row: %u, column: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); + #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) + xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed); + #else + xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); + #endif #endif //KEYLOGGER_ENABLE switch (keycode) { @@ -249,7 +251,9 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP -#if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) +#if defined(__ARM__) + ":dfu-util" +#elif defined(BOOTLOADER_DFU) ":dfu" #elif defined(BOOTLOADER_HALFKAY) ":teensy" @@ -291,7 +295,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { // to save on firmware space, since it's limited. #ifdef MACROS_ENABLED case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); } + if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); } #ifdef RGBLIGHT_ENABLE userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); #endif //RGBLIGHT_ENABLE @@ -342,45 +346,40 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_LCTL); tap(KC_C); unregister_code(KC_LCTL); -#ifdef AUDIO_ENABLE - PLAY_SONG(tone_copy); -#endif } else { // Tap, paste register_code(KC_LCTL); tap(KC_V); unregister_code(KC_LCTL); -#ifdef AUDIO_ENABLE - PLAY_SONG(tone_paste); -#endif } } return false; break; #ifdef UNICODE_ENABLE - case UC_FLIP: // (╯°□°)╯ ︵ ┻━┻ + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ if (record->event.pressed) { - register_code(KC_RSFT); - tap(KC_9); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - process_unicode((0x25A1 | QK_UNICODE), record); // Mouth - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - register_code(KC_RSFT); - tap(KC_0); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - tap(KC_SPC); - process_unicode((0x0361 | QK_UNICODE), record); // Flippy - tap(KC_SPC); - process_unicode((0x253B | QK_UNICODE), record); // Table - process_unicode((0x2501 | QK_UNICODE), record); // Table - process_unicode((0x253B | QK_UNICODE), record); // Table + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); } return false; break; -#endif // UNICODE_ENABLE - + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + return false; + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + return false; + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + return false; + break; +#endif } return process_record_keymap(keycode, record) && #ifdef RGBLIGHT_ENABLE diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index de8c3ba947..49e3fc870b 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,9 +19,13 @@ along with this program. If not, see . #include "quantum.h" #include "version.h" #include "eeprom.h" +#include "send_unicode.h" + #ifdef RGB_MATRIX_ENABLE #include "rgb_matrix.h" #endif + + // Define layer names enum userspace_layers { _QWERTY = 0, @@ -59,19 +63,26 @@ inline void tap(uint16_t keycode){ register_code(keycode); unregister_code(keyco bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -#define EECONFIG_USERSPACE (uint8_t *)19 +#define EECONFIG_USERSPACE (uint32_t *)19 typedef union { - uint8_t raw; + uint32_t raw; struct { bool rgb_layer_change :1; bool is_overwatch :1; bool nuke_switch :1; + uint8_t unicode_mod :4; }; } userspace_config_t; +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + enum userspace_custom_keycodes { - EPRM = SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) + EPRM = PLACEHOLDER_SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) VRSN, // Prints QMK Firmware and board info KC_QWERTY, // Sets default layer to QWERTY KC_COLEMAK, // Sets default layer to COLEMAK @@ -99,13 +110,14 @@ enum userspace_custom_keycodes { KC_SECRET_5, // test5 KC_CCCV, // Hold to copy, tap to paste KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - -#ifdef UNICODE_ENABLE - UC_FLIP, // Table flip (not working?) -#endif //UNICODE_ENABLE + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes }; + #define LOWER MO(_LOWER) #define RAISE MO(_RAISE) #define ADJUST MO(_ADJUST) @@ -153,6 +165,8 @@ enum userspace_custom_keycodes { #define MG_NKRO MAGIC_TOGGLE_NKRO +#define UC_IRNY UC(0x2E2E) +#define UC_CLUE UC(0x203D) #ifdef TAP_DANCE_ENABLE enum { diff --git a/users/drashna/drashna_unicode.h b/users/drashna/drashna_unicode.h deleted file mode 100644 index 3d1bc03f9b..0000000000 --- a/users/drashna/drashna_unicode.h +++ /dev/null @@ -1,71 +0,0 @@ -#ifndef UNICODE_USERSPACE_H -#define UNICODE_USERSPACE_H - - - -/* use X(n) to call the */ - -enum unicode_name { - THINK, // thinking face 🤔 - GRIN, // grinning face 😊 - SMRK, // smirk 😏 - WEARY, // good shit 😩 - UNAMU, // unamused 😒 - - SNEK, // snke 🐍 - PENGUIN, // 🐧 - DRAGON, // 🐉 - MONKEY, // 🐒 - CHICK, // 🐥 - BOAR, // 🐗 - - OKOK, // 👌 - EFFU, // 🖕 - INUP, // 👆 - THUP, // 👍 - THDN, // 👎 - - BBB, // dat B 🅱 - POO, // poop 💩 - HUNDR, // 100 💯 - EGGPL, // EGGPLANT 🍆 - WATER, // wet 💦 - TUMBLER, // 🥃 - - LIT, // fire 🔥 - BANG, // ‽ - IRONY, // ⸮ - DEGREE // ° -}; - - -const uint32_t PROGMEM unicode_map[] = { - [THINK] = 0x1F914, - [GRIN] = 0x1F600, - [BBB] = 0x1F171, - [POO] = 0x1F4A9, - [HUNDR] = 0x1F4AF, - [SMRK] = 0x1F60F, - [WEARY] = 0x1F629, - [EGGPL] = 0x1F346, - [WATER] = 0x1F4A6, - [LIT] = 0x1F525, - [UNAMU] = 0x1F612, - [SNEK] = 0x1F40D, - [PENGUIN] = 0x1F427, - [BOAR] = 0x1F417, - [MONKEY] = 0x1F412, - [CHICK] = 0x1F425, - [DRAGON] = 0x1F409, - [OKOK] = 0x1F44C, - [EFFU] = 0x1F595, - [INUP] = 0x1F446, - [THDN] = 0x1F44E, - [THUP] = 0x1F44D, - [TUMBLER] = 0x1F943, - [BANG] = 0x0203D, - [IRONY] = 0x02E2E, - [DEGREE] = 0x000B0 - }; - - #endif diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 03c55b1323..4a1a8de692 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -230,7 +230,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { userspace_config.rgb_layer_change ^= 1; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); + eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); if (userspace_config.rgb_layer_change) { layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) } @@ -243,7 +243,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (userspace_config.rgb_layer_change) { userspace_config.rgb_layer_change = false; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw); + eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); } } return true; break; @@ -273,6 +273,7 @@ void matrix_init_rgb(void) { default: rgblight_sethsv_noeeprom_cyan(); break; } + rgblight_mode_noeeprom(1); } } diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index e299f24a1e..3d6213eff2 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,4 +1,3 @@ - SRC += drashna.c ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") @@ -9,7 +8,7 @@ ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += tap_dances.c endif -EXTRAFLAGS += -flto +EXTRAFLAGS += -flto ifeq ($(strip $(NO_SECRETS)), yes) OPT_DEFS += -DNO_SECRETS @@ -37,3 +36,7 @@ ifdef CONSOLE_ENABLE OPT_DEFS += -DKEYLOGGER_ENABLE endif endif + +ifeq ($(strip $(UNICODE_ENABLE)), yes) + SRC += send_unicode.c +endif diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c new file mode 100644 index 0000000000..cacfe1dc85 --- /dev/null +++ b/users/drashna/send_unicode.c @@ -0,0 +1,58 @@ +// Written by konstantin: vomindoraan +#include "send_unicode.h" +#include +#include + +__attribute__((weak)) +void send_unicode_hex_string(const char* str) { + if (!str) { return; } // Safety net + + while (*str) { + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower((unsigned char)*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + + str += n; // Move to the first ' ' (or '\0') after the current token + } +} + +// (ノಠ痊ಠ)ノ彡┻━┻ +// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + +//Old code +// (╯°□°)╯ ︵ ┻━┻ + #if 0 + register_code(KC_RSFT); + tap(KC_9); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + process_unicode((0x25A1 | QK_UNICODE), record); // Mouth + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + register_code(KC_RSFT); + tap(KC_0); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + tap(KC_SPC); + process_unicode((0x0361 | QK_UNICODE), record); // Flippy + tap(KC_SPC); + process_unicode((0x253B | QK_UNICODE), record); // Table + process_unicode((0x2501 | QK_UNICODE), record); // Table + process_unicode((0x253B | QK_UNICODE), record); // Table + #endif + + +// If you need a good converter: https://r12a.github.io/app-conversion/ diff --git a/users/drashna/send_unicode.h b/users/drashna/send_unicode.h new file mode 100644 index 0000000000..818b6e571b --- /dev/null +++ b/users/drashna/send_unicode.h @@ -0,0 +1,71 @@ +#pragma once + +#include "quantum.h" + +void send_unicode_hex_string(const char* str); + +/* use X(n) to call the */ +#ifdef UNICODEMAP_ENABLE +enum unicode_name { + THINK, // thinking face 🤔 + GRIN, // grinning face 😊 + SMRK, // smirk 😏 + WEARY, // good shit 😩 + UNAMU, // unamused 😒 + + SNEK, // snke 🐍 + PENGUIN, // 🐧 + DRAGON, // 🐉 + MONKEY, // 🐒 + CHICK, // 🐥 + BOAR, // 🐗 + + OKOK, // 👌 + EFFU, // 🖕 + INUP, // 👆 + THUP, // 👍 + THDN, // 👎 + + BBB, // dat B 🅱 + POO, // poop 💩 + HUNDR, // 100 💯 + EGGPL, // EGGPLANT 🍆 + WATER, // wet 💦 + TUMBLER, // 🥃 + + LIT, // fire 🔥 + BANG, // ‽ + IRONY, // ⸮ + DEGREE // ° +}; + + +const uint32_t PROGMEM unicode_map[] = { + [THINK] = 0x1F914, + [GRIN] = 0x1F600, + [BBB] = 0x1F171, + [POO] = 0x1F4A9, + [HUNDR] = 0x1F4AF, + [SMRK] = 0x1F60F, + [WEARY] = 0x1F629, + [EGGPL] = 0x1F346, + [WATER] = 0x1F4A6, + [LIT] = 0x1F525, + [UNAMU] = 0x1F612, + [SNEK] = 0x1F40D, + [PENGUIN] = 0x1F427, + [BOAR] = 0x1F417, + [MONKEY] = 0x1F412, + [CHICK] = 0x1F425, + [DRAGON] = 0x1F409, + [OKOK] = 0x1F44C, + [EFFU] = 0x1F595, + [INUP] = 0x1F446, + [THDN] = 0x1F44E, + [THUP] = 0x1F44D, + [TUMBLER] = 0x1F943, + [BANG] = 0x0203D, + [IRONY] = 0x02E2E, + [DEGREE] = 0x000B0 + }; +#endif // UNICODEMAP_ENABLE -- cgit v1.2.3 From 713ec91147aa56849f9e2ff93ee98ef1eb6eebc0 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Mon, 1 Oct 2018 19:50:14 -0700 Subject: Add C hint to inline code --- docs/custom_quantum_functions.md | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index f8b84cd6b3..b077e4b78d 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -27,7 +27,7 @@ The first step to creating your own custom keycode(s) is to enumerate them. This Here is an example of enumerating 2 keycodes. After adding this block to your `keymap.c` you will be able to use `FOO` and `BAR` inside your keymap. -``` +```c enum my_keycodes { FOO = SAFE_RANGE, BAR @@ -44,7 +44,7 @@ These function are called every time a key is pressed or released. This example does two things. It defines the behavior for a custom keycode called `FOO`, and it supplements our Enter key by playing a tone whenever it is pressed. -``` +```c bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case FOO: @@ -75,16 +75,16 @@ The `keycode` argument is whatever is defined in your keymap, eg `MO(1)`, `KC_L` The `record` argument contains information about the actual press: -``` +```c keyrecord_t record { -+-keyevent_t event { -| +-keypos_t key { -| | +-uint8_t col -| | +-uint8_t row -| | } -| +-bool pressed -| +-uint16_t time -| } + keyevent_t event { + keypos_t key { + uint8_t col + uint8_t row + } + bool pressed + uint16_t time + } } ``` @@ -100,7 +100,7 @@ This allows you to control the 5 LED's defined as part of the USB Keyboard spec. ### Example `led_set_user()` Implementation -``` +```c void led_set_user(uint8_t usb_led) { if (usb_led & (1< Date: Mon, 1 Oct 2018 20:35:09 -0700 Subject: Keyboard: DZ60 cleanup (#3994) * DZ60: Deleted K214 from LAYOUT_all * DZ60: Delete matrix LAYOUT_2_shifts; replace with LAYOUT_all After the deletion of K214 from LAYOUT_all, LAYOUT_all and LAYOUT_2_shifts are identical. Deprecated LAYOUT_2_shifts in favor of LAYOUT_all. * DZ60: refactor 256k_HHKB and itsaferbie keymaps to use LAYOUT_60_hhkb macro Both keymaps previously used the LAYOUT_hhkb macro. After comparing the macros, the only difference between them was that LAYOUT_hhkb included the place of the ISO Backslash key. Neither keymap used this key, so both were refactored to use LAYOUT_60_hhkb instead. LAYOUT_hhkb is now essentially unused by any keymaps in the repo. (More on that in a moment.) * DZ60: bugfix for dbroqua keymap This keymap had two layers that used the LAYOUT_true_hhkb macro and a third that used LAYOUT_hhkb. These macros have the same number of keys, but represent different physical layouts. As the "main" layers used LAYOUT_true_hhkb, switched the third layer to LAYOUT_true_hhkb as well. The LAYOUT_hhkb macro is now unused by any DZ60 keymaps in the repo, and can be safely deleted. * DZ60: bugfix for 60_ansi_arrow_fkeys, 60_plus_arrows, and stephengrier keymaps All three keymaps had one layer in LAYOUT_all and one in LAYOUT_directional. Only difference between these macros is LAYOUT_all excludes the ISO Backslash position. As none of the keymaps used this position, all layers were switched to use LAYOUT_directional. * DZ60: added layout mock-ups to dz60.h Documenting the physical layouts that go with each matrix. * DZ60: replace TMK SHIFT_ESC with QMK Grave Escape Replaced all instances of keycodes that called TMK's ACTION_FUNCTION(SHIFT_ESC) with QMK's KC_GESC, and added config.h files so KC_GESC behaves as the deprecated TMK function did, except for the default keymap, which I thought should have the QMK standard behavior. * DZ60: delete SHIFT_ESC code blocks Deleted ACTION_FUNCTION(SHIFT_ESC) code blocks from keymaps that didn't use the functionality it provided. * DZ60: deleted unused MODS_CTRL_MASk definitions Was used in the now-deleted SHIFT_ESC code blocks. Interestingly named MODS_CTRL_MASK when it was actually checking the Shift keys. *shrug* * DZ60: refactor jkbone keymap to use process_record_user Replaced TMK action_function keycodes with QMK process_record_user equivalents. * DZ60: delete unused layout macros The macros LAYOUT_hhkb, LAYOUT_directional_625_space, and LAYOUT_60_ansi_split_bs_rshift_5x1u were unused by any keymaps in the repo, and have thus been deleted. * DZ60: refactor iso_6u_space and iso_7u_space keymaps Both keymaps refactored to use the LAYOUT_60_iso macro. * DZ60: refactor dz60.h Updated the notation of the switch arguments. Format is now: `k` where `` is `[0-4]` and `` is `[0-9a-e]`. * DZ60: refactor LAYOUT_60_iso_5x1u matrix Updated matrix so `KC_ENT` belongs on the home row, which is consistent with LAYOUT_60_iso for the DZ60 as well as the ISO community layouts. * DZ60: fix white space in dz60.h I hate when indentation is inconsistent within a file. --- keyboards/dz60/dz60.h | 320 ++++++++++++--------- keyboards/dz60/info.json | 22 +- keyboards/dz60/keymaps/256k_HHKB/keymap.c | 20 +- .../dz60/keymaps/60_ansi_arrow_fkeys/config.h | 1 + .../dz60/keymaps/60_ansi_arrow_fkeys/keymap.c | 42 +-- keyboards/dz60/keymaps/60_plus_arrows/keymap.c | 40 +-- .../dz60/keymaps/Ansi_plus_fn_arrows/config.h | 1 + .../dz60/keymaps/Ansi_plus_fn_arrows/keymap.c | 38 +-- keyboards/dz60/keymaps/dbroqua/keymap.c | 2 +- keyboards/dz60/keymaps/default/keymap.c | 38 +-- keyboards/dz60/keymaps/eric/keymap.c | 36 --- keyboards/dz60/keymaps/f3d3/keymap.c | 40 +-- keyboards/dz60/keymaps/frogger/keymap.c | 8 +- keyboards/dz60/keymaps/hailbreno/keymap.c | 16 +- keyboards/dz60/keymaps/iso_6u_space/keymap.c | 106 +++---- keyboards/dz60/keymaps/iso_7u_space/keymap.c | 109 +++---- keyboards/dz60/keymaps/iso_uk/keymap.c | 36 --- keyboards/dz60/keymaps/iso_vim_arrow/keymap.c | 44 +-- keyboards/dz60/keymaps/itsaferbie/keymap.c | 12 +- keyboards/dz60/keymaps/jkbone/keymap.c | 53 ++-- keyboards/dz60/keymaps/krusli/keymap.c | 1 - keyboards/dz60/keymaps/macos_arrow/keymap.c | 8 +- keyboards/dz60/keymaps/stephengrier/config.h | 1 + keyboards/dz60/keymaps/stephengrier/keymap.c | 42 +-- keyboards/dz60/keymaps/weeheavy/keymap.c | 6 +- 25 files changed, 343 insertions(+), 699 deletions(-) create mode 100644 keyboards/dz60/keymaps/60_ansi_arrow_fkeys/config.h create mode 100644 keyboards/dz60/keymaps/Ansi_plus_fn_arrows/config.h create mode 100644 keyboards/dz60/keymaps/stephengrier/config.h diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 3d0b0dd527..6d80b2c7cb 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -7,173 +7,221 @@ // 标准配列 +/* Standard arrangement / LAYOUT + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴──┬┴──┬┴──┬───┼───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴───┴───┴───┴───┴───┘ +*/ #define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K404, K406, K408, K410, K411, K412, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ -} - -#define LAYOUT_hhkb( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K401, K403, K406, K411, K413 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { KC_NO, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_true_hhkb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├────┴┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴┬─────┴───┤ + * │▓▓▓▓▓│41 │43 │46 (6u) │4a │4b │▓▓▓▓▓▓▓▓▓│ + * └─────┴───┴─────┴───────────────────────┴─────┴───┴─────────┘ +*/ #define LAYOUT_true_hhkb( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K401, K403, K406, K410, K411 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k41, k43, k46, k4a, k4b \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { KC_NO, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, KC_NO, KC_NO } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { KC_NO, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, KC_NO, KC_NO } \ } +/* LAYOUT_60_hhkb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴──────┬┴───┴┬───┬─┴───┤ + * │▓▓▓▓▓│41 │43 │46 (7u) │4b │4d │▓▓▓▓▓│ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ #define LAYOUT_60_hhkb( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K401, K403, K406, K411, K413 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { KC_NO, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, KC_NO, K411, KC_NO, K413, KC_NO } \ -} - -#define LAYOUT_2_shifts( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K404, K406, K408, K410, K411, K412, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k41, k43, k46, k4b, k4d \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { KC_NO, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, KC_NO } \ } // 带方向配列 +/* Directional arrangement | LAYOUT_directional + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3d │3e │ + * ├────┬──┴─┬─┴──┬┴───┴───┼───┴┬──┴───┴───┼───┼───┼───┼───┼───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴───┴───┴───┴───┴───┘ +*/ #define LAYOUT_directional( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K404, K406, K408, K410, K411, K412, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_all + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├───┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬───┬───┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3d │3e │ + * ├───┴┬──┴─┬─┴──┬┴───┴───┼───┴┬──┴───┴───┼───┼───┼───┼───┼───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴───┴───┴───┴───┴───┘ +*/ #define LAYOUT_all( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K404, K406, K408, K410, K411, K412, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, K412, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_ansi + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │40 │41 │43 │46 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ +*/ #define LAYOUT_60_ansi( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k46, k4a, k4b, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } +/* LAYOUT_60_iso + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │40 │41 │43 │46 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ +*/ #define LAYOUT_60_iso( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k46, k4a, k4b, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, KC_NO, K413, K414 } \ -} - -#define LAYOUT_directional_625_space( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314 }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } +/* LAYOUT_60_iso_5x1u + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┬───┤ + * │40 │41 │43 │46 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┘ +*/ #define LAYOUT_60_iso_5x1u( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K213, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ -} - -#define LAYOUT_60_ansi_split_bs_rshift_5x1u( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, \ - K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, K314, \ - K400, K401, K403, K406, K410, K411, K412, K413, K414 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k46, k4a, k4b, k4c, k4d, k4e \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, K314 }, \ - { K400, K401, KC_NO, K403, KC_NO, KC_NO, K406, KC_NO, KC_NO, KC_NO, K410, K411, K412, K413, K414 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 54d6753757..4855c3b81a 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -9,25 +9,17 @@ "key_count": 67, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] }, - "LAYOUT_hhkb": { - "key_count": 61, - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Ctrl", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Alt", "x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"x":10, "y":4, "w":1.5}, {"label":"Alt", "x":11.5, "y":4}] - }, "LAYOUT_true_hhkb": { "key_count": 61, "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Ctrl", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Alt", "x":1.5, "y":4}, {"x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":6}, {"x":10, "y":4, "w":1.5}, {"label":"Alt", "x":11.5, "y":4}] }, - "LAYOUT_2_shifts": { - "key_count": 68, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] - }, "LAYOUT_directional": { "key_count": 67, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"Del", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] }, "LAYOUT_all": { - "key_count": 69, - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] + "key_count": 68, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"label":"Shift", "x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"x":6, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] }, "LAYOUT_60_ansi": { "key_count": 61, @@ -41,17 +33,9 @@ "key_count": 60, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] }, - "LAYOUT_directional_625_space": { - "key_count": 65, - "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K012", "x":12, "y":0}, {"label":"K013", "x":13, "y":0}, {"label":"K014", "x":14, "y":0}, {"label":"K100", "x":0, "y":1, "w":1.5}, {"label":"K102", "x":1.5, "y":1}, {"label":"K103", "x":2.5, "y":1}, {"label":"K104", "x":3.5, "y":1}, {"label":"K105", "x":4.5, "y":1}, {"label":"K106", "x":5.5, "y":1}, {"label":"K107", "x":6.5, "y":1}, {"label":"K108", "x":7.5, "y":1}, {"label":"K109", "x":8.5, "y":1}, {"label":"K110", "x":9.5, "y":1}, {"label":"K111", "x":10.5, "y":1}, {"label":"K112", "x":11.5, "y":1}, {"label":"K113", "x":12.5, "y":1}, {"label":"K114", "x":13.5, "y":1, "w":1.5}, {"label":"K200", "x":0, "y":2, "w":1.75}, {"label":"K202", "x":1.75, "y":2}, {"label":"K203", "x":2.75, "y":2}, {"label":"K204", "x":3.75, "y":2}, {"label":"K205", "x":4.75, "y":2}, {"label":"K206", "x":5.75, "y":2}, {"label":"K207", "x":6.75, "y":2}, {"label":"K208", "x":7.75, "y":2}, {"label":"K209", "x":8.75, "y":2}, {"label":"K210", "x":9.75, "y":2}, {"label":"K211", "x":10.75, "y":2}, {"label":"K212", "x":11.75, "y":2}, {"label":"K213", "x":12.75, "y":2, "w":2.25}, {"label":"K300", "x":0, "y":3, "w":2}, {"label":"K301", "x":2, "y":3}, {"label":"K302", "x":3, "y":3}, {"label":"K303", "x":4, "y":3}, {"label":"K304", "x":5, "y":3}, {"label":"K305", "x":6, "y":3}, {"label":"K306", "x":7, "y":3}, {"label":"K307", "x":8, "y":3}, {"label":"K308", "x":9, "y":3}, {"label":"K309", "x":10, "y":3}, {"label":"K310", "x":11, "y":3}, {"label":"K312", "x":12, "y":3}, {"label":"K313", "x":13, "y":3}, {"label":"K314", "x":14, "y":3}, {"label":"K400", "x":0, "y":4, "w":1.25}, {"label":"K401", "x":1.25, "y":4, "w":1.25}, {"label":"K403", "x":2.5, "y":4, "w":1.25}, {"label":"K406", "x":3.75, "y":4, "w":6.25}, {"label":"K410", "x":10, "y":4}, {"label":"K411", "x":11, "y":4}, {"label":"K412", "x":12, "y":4}, {"label":"K413", "x":13, "y":4}, {"label":"K414", "x":14, "y":4}] - }, "LAYOUT_60_iso_5x1u": { "key_count": 63, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"~", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] - }, - "LAYOUT_60_ansi_split_bs_rshift_5x1u": { - "key_count": 64, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"~", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] } } } diff --git a/keyboards/dz60/keymaps/256k_HHKB/keymap.c b/keyboards/dz60/keymaps/256k_HHKB/keymap.c index f426e3d1fb..1448e4ddce 100644 --- a/keyboards/dz60/keymaps/256k_HHKB/keymap.c +++ b/keyboards/dz60/keymaps/256k_HHKB/keymap.c @@ -29,11 +29,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ - [_DEFAULT] = LAYOUT_hhkb( + [_DEFAULT] = LAYOUT_60_hhkb( KC_ESC, 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_BSLS, KC_GRV, 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_BSPC, KC_LCTL, 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, MO(_FN), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, MO(_ALTFN), MO(_LIGHTS)), @@ -55,12 +55,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `---------------------------------------------------------------------------------------------------------------------' */ - [_ALTFN] = LAYOUT_hhkb( + [_ALTFN] = LAYOUT_60_hhkb( MO(_MOUSEFN), 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_CAPS, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_UP, KC_VOLD, KC_VOLU, KC_DEL, ______, ______, ______, ______, ______, ______, ______, KC_HOME, KC_END, KC_LEFT, KC_DOWN, KC_RIGHT, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MNXT, KC_MPLY, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, KC_MPRV, KC_MNXT, KC_MPLY, ______, ______, ______, ______, ______, ______, ______), @@ -85,12 +85,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ - [_MOUSEFN] = LAYOUT_hhkb( + [_MOUSEFN] = LAYOUT_60_hhkb( ______, KC_ACL0, KC_ACL1, KC_ACL2, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_UP, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), @@ -116,11 +116,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_FN] = LAYOUT_hhkb( + [_FN] = LAYOUT_60_hhkb( ______, 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_INS, ______, KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, KC_DEL, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, - ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, + ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, ______, ______, ______, ______, ______), @@ -146,11 +146,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_LIGHTS] = LAYOUT_hhkb( + [_LIGHTS] = LAYOUT_60_hhkb( RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, ______, ______, ______, ______, ______, ______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_HUD, RGB_SAD, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), }; diff --git a/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/config.h b/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/config.h new file mode 100644 index 0000000000..9560d51a6f --- /dev/null +++ b/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/keymap.c b/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/keymap.c index 76804670c8..0d3b653638 100644 --- a/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/keymap.c +++ b/keyboards/dz60/keymaps/60_ansi_arrow_fkeys/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define ______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -20,11 +18,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( - F(0), 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, + LAYOUT_directional( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_DEL, + KC_LSFT, 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_DEL, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT ), @@ -50,37 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/60_plus_arrows/keymap.c b/keyboards/dz60/keymaps/60_plus_arrows/keymap.c index a4b2dc29e1..f38cdb2853 100644 --- a/keyboards/dz60/keymaps/60_plus_arrows/keymap.c +++ b/keyboards/dz60/keymaps/60_plus_arrows/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define ______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -20,11 +18,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( + LAYOUT_directional( 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT ), @@ -50,37 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/config.h b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/config.h new file mode 100644 index 0000000000..9560d51a6f --- /dev/null +++ b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c index 778a5ac038..4c6552675a 100644 --- a/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c +++ b/keyboards/dz60/keymaps/Ansi_plus_fn_arrows/keymap.c @@ -1,11 +1,9 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( - F(0), 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_NO, KC_BSPC, + KC_GESC, 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_NO, KC_BSPC, 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_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_NO, @@ -25,37 +23,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/dbroqua/keymap.c b/keyboards/dz60/keymaps/dbroqua/keymap.c index c6c77210d8..0b4deae51e 100644 --- a/keyboards/dz60/keymaps/dbroqua/keymap.c +++ b/keyboards/dz60/keymaps/dbroqua/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | * `-----------------------------------------------------------------' */ - [_SFX] = LAYOUT_hhkb( + [_SFX] = LAYOUT_true_hhkb( ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, BL_TOGG,BL_STEP,BL_DEC, BL_INC, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ ______, RGB_TOG,RGB_MOD,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, \ diff --git a/keyboards/dz60/keymaps/default/keymap.c b/keyboards/dz60/keymaps/default/keymap.c index 426b10989d..1d375a3c63 100644 --- a/keyboards/dz60/keymaps/default/keymap.c +++ b/keyboards/dz60/keymaps/default/keymap.c @@ -1,11 +1,9 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( - F(0), 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_NO, KC_BSPC, + KC_GESC, 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_NO, KC_BSPC, 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_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_NO, @@ -25,37 +23,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/eric/keymap.c b/keyboards/dz60/keymaps/eric/keymap.c index d2cabebe74..a384de480c 100644 --- a/keyboards/dz60/keymaps/eric/keymap.c +++ b/keyboards/dz60/keymaps/eric/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0 @@ -56,37 +54,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, KC_NO, KC_NO), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC) -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/f3d3/keymap.c b/keyboards/dz60/keymaps/f3d3/keymap.c index 85bb05a1d4..1e92aabc18 100644 --- a/keyboards/dz60/keymaps/f3d3/keymap.c +++ b/keyboards/dz60/keymaps/f3d3/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0 @@ -18,7 +16,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( + LAYOUT_all( KC_ESC, 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_GRV, KC_BSPC, 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_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, @@ -42,44 +40,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ - LAYOUT_2_shifts( + LAYOUT_all( KC_PWR, 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_TRNS, KC_DEL, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_TOGG, BL_DEC, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_TRNS, KC_TRNS, KC_MPRV, KC_VOLD, KC_MNXT), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/frogger/keymap.c b/keyboards/dz60/keymaps/frogger/keymap.c index 86a4687913..75e805cd91 100644 --- a/keyboards/dz60/keymaps/frogger/keymap.c +++ b/keyboards/dz60/keymaps/frogger/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define ______ KC_TRNS #define LAYER_1 1 @@ -24,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( + LAYOUT_all( KC_GRAVE, 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_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, @@ -52,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MPRV, KC_MPLY, KC_MNXT, */ - LAYOUT_2_shifts( + LAYOUT_all( 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_DEL, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, ______, ______, KC_UP, ______, ______, ______, ______, ______, @@ -78,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( + LAYOUT_all( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ______, RESET, ______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, ______, ______, ______, ______, ______, diff --git a/keyboards/dz60/keymaps/hailbreno/keymap.c b/keyboards/dz60/keymaps/hailbreno/keymap.c index cc718c3935..edc22a5a24 100644 --- a/keyboards/dz60/keymaps/hailbreno/keymap.c +++ b/keyboards/dz60/keymaps/hailbreno/keymap.c @@ -44,7 +44,7 @@ enum keycodes { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------------' - [LAYOUT] = LAYOUT_2_shifts( + [LAYOUT] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | Gui | Backspace | Fn2 | Space | Alt | App | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_2_shifts( +[_QWERTY] = LAYOUT_all( KC_ESC, 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_BSLS, KC_GRV, 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_DEL, LT(_FUNC,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, @@ -87,7 +87,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | Gui | Backspace | Fn2 | Space | Alt | App | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_2_shifts( +[_COLEMAK] = LAYOUT_all( KC_ESC, 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_BSLS, KC_GRV, KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_DEL, LT(_FUNC,KC_CAPS), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | Gui | Backspace | Fn2 | Space | Alt | App | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_2_shifts( +[_DVORAK] = LAYOUT_all( KC_ESC, 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_BSLS, KC_GRV, KC_TAB, KC_QUOTE, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, KC_EQL, KC_DEL, LT(_FUNC,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, @@ -127,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | Home| PgDn| End | * `-----------------------------------------------------------------------------------------' */ -[_FUNC] = LAYOUT_2_shifts( +[_FUNC] = LAYOUT_all( _______, 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_INS, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_CIRC, _______, _______, KC_BSPC, _______, _______, _______, _______, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_TILD, _______, @@ -147,7 +147,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ -[_FUNC2] = LAYOUT_2_shifts( +[_FUNC2] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -167,7 +167,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ -[_RGB] = LAYOUT_2_shifts( +[_RGB] = LAYOUT_all( _______, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_VAD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -187,7 +187,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | |Qwerty|Colemk|Dvorak| * `-----------------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_2_shifts( +[_ADJUST] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/dz60/keymaps/iso_6u_space/keymap.c b/keyboards/dz60/keymaps/iso_6u_space/keymap.c index 15ad72f3e4..e0085b4904 100644 --- a/keyboards/dz60/keymaps/iso_6u_space/keymap.c +++ b/keyboards/dz60/keymaps/iso_6u_space/keymap.c @@ -1,74 +1,44 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * _______ can be used in place of KC_TRNS (transparent) * + * XXXXXXX can be used in place of KC_NO (No Operation) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* ISO 6u layout layer 0 -* ,-----------------------------------------------------------------------------------------. -* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BSPC | -* |-----------------------------------------------------------------------------------------+ -* | Tab | Q | W | E | R | T | Z | U | I | O | P | P | Ü | * | | -* |-------------------------------------------------------------------------------------| + -* | Layer_1 | A | S | D | F | G | H | J | K | L | Ö | Ä | # |Enter | -* |-----------------------------------------------------------------------------------------+ -* | Shift| < | Y | X | C | V | B | N | M | , | . | . | - | RShift | -* |-----------------------------------------------------------------------------------------+ -* | LCtrl | LGUI | LAlt | Space | RAlt | RGUI | Layer_2 | RCtrl | -* `-----------------------------------------------------------------------------------------' -*/ - LAYOUT( - KC_ESC, 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_NO, KC_BSPC, - 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, - MO(1), 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_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI, KC_NO, MO(2), KC_RCTL), + /* ISO 6u layout layer 0 (UK Layout shown) + * ,-----------------------------------------------------------. + * |Esc|1 !|2 "|3 £|4 $|5 %|6 ^|7 &|8 *|9 (|0 )|- _|= +| Bksp | + * |-----------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P |[ {|] }|Enter| + * |------------------------------------------------------. | + * | Fn1 | A | S | D | F | G | H | J | K | L |; :|' @|# ~| | + * |-----------------------------------------------------------| + * |Sft |\ || Z | X | C | V | B | N | M |, <|. >|/ ?| Shift | + * |-----------------------------------------------------------| + * |Ctrl |GUI|Alt | Space |Alt |GUI|Fn2|Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_iso( + KC_ESC, 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_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, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(2), KC_RCTL), + + + [1] = LAYOUT_60_iso( + KC_GRV, 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_DEL, + XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_STEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LGUI, XXXXXXX, KC_RALT, KC_RGUI, _______, KC_RCTL), + + [2] = LAYOUT_60_iso( + KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX), - - LAYOUT( - KC_GRV, 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_NO, KC_DEL, - KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, 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_LSFT, KC_NO, KC_NO, KC_NO, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LCTL, KC_LGUI, KC_LGUI, KC_NO, KC_NO, KC_NO, KC_RALT, KC_RGUI, KC_NO, KC_NO, KC_RCTL), - - LAYOUT( - KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, M(4), M(5), M(6), M(7), M(8), M(9), M(10), M(11), M(12), KC_NO, KC_DEL, - KC_NO, KC_NO, KC_UP, 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_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LSFT, 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_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), -}; - -enum function_id { - SHIFT_ESC, }; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/iso_7u_space/keymap.c b/keyboards/dz60/keymaps/iso_7u_space/keymap.c index 2de2445987..016fe9a6a5 100644 --- a/keyboards/dz60/keymaps/iso_7u_space/keymap.c +++ b/keyboards/dz60/keymaps/iso_7u_space/keymap.c @@ -1,76 +1,47 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * _______ can be used in place of KC_TRNS (transparent) * + * XXXXXXX can be used in place of KC_NO (No Operation) * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* ISO 7u layout layer 0 -* ,-----------------------------------------------------------------------------------------. -* | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | ´ | BSPC | -* |-----------------------------------------------------------------------------------------+ -* | Tab | Q | W | E | R | T | Z | U | I | O | P | P | Ü | * | | -* |-------------------------------------------------------------------------------------| + -* | Layer_1 | A | S | D | F | G | H | J | K | L | Ö | Ä | # |Enter | -* |-----------------------------------------------------------------------------------------+ -* | Shift| < | Y | X | C | V | B | N | M | , | . | . | - | RShift | -* |-----------------------------------------------------------------------------------------+ -* | LCtrl | LGUI | LAlt | Space | RAlt | Layer_2 | RCtrl | -* `-----------------------------------------------------------------------------------------' -*/ + /* ISO 7u layout layer 0 + * ,-----------------------------------------------------------. + * |Esc|1 !|2 "|3 £|4 $|5 %|6 ^|7 &|8 *|9 (|0 )|- _|= +| Bksp | + * |-----------------------------------------------------------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P |[ {|] }|Enter| + * |------------------------------------------------------. | + * | Fn1 | A | S | D | F | G | H | J | K | L |; :|' @|# ~| | + * |-----------------------------------------------------------| + * |Sft |\ || Z | X | C | V | B | N | M |, <|. >|/ ?| Shift | + * |-----------------------------------------------------------| + * |Ctrl |GUI|Alt | Space |Alt |Fn2|Ctrl | + * `-----------------------------------------------------------' + */ + [0] = LAYOUT_60_iso( + KC_ESC, 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_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, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, XXXXXXX, KC_RALT, MO(2), KC_RCTL + ), + + [1] = LAYOUT_60_iso( + KC_GRV, 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_DEL, + XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_PGUP, XXXXXXX, XXXXXXX, XXXXXXX, BL_DEC, BL_TOGG, BL_INC, BL_STEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_PGDN, KC_LGUI, KC_LGUI, XXXXXXX, XXXXXXX, KC_RGUI, _______, KC_RCTL + ), + + [2] = LAYOUT_60_iso( + KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL, + XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX + ), - LAYOUT( - KC_ESC, 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_NO, KC_BSPC, - 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, - MO(1), 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_LCTL, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_NO, KC_RALT, KC_NO, MO(2), KC_RCTL), - - - LAYOUT( - KC_GRV, 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_NO, KC_DEL, - KC_NO, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, 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_PGUP, KC_NO, KC_NO, KC_NO, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_PGDOWN, KC_LGUI, KC_LGUI, KC_NO, KC_NO, KC_NO, KC_RALT, KC_RGUI, KC_NO, KC_NO, KC_RCTL), - - LAYOUT( - KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DEL, - KC_NO, KC_NO, KC_UP, 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_LEFT, KC_DOWN, KC_RIGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, - KC_LSFT, 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_LCTL, KC_LGUI, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), -}; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), }; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/iso_uk/keymap.c b/keyboards/dz60/keymaps/iso_uk/keymap.c index 1c15a59df8..13e6e18594 100644 --- a/keyboards/dz60/keymaps/iso_uk/keymap.c +++ b/keyboards/dz60/keymaps/iso_uk/keymap.c @@ -18,8 +18,6 @@ #define MO_FN MO(1) #define MO_FN MO(1) -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_60_iso( @@ -50,37 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c b/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c index 9e85a89eee..4dad9e19f5 100644 --- a/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c +++ b/keyboards/dz60/keymaps/iso_vim_arrow/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ISO 5x1u layout (ISO German keyboard layout shown) @@ -23,8 +21,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_60_iso_5x1u( KC_ESC, 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_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_ENT, - MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, + 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, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), @@ -32,44 +30,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_iso_5x1u( KC_GRV, 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_DEL, - KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_NO, KC_NO, KC_NO, - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_DEL, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_DEL, KC_NO, KC_NO, KC_LSFT, BL_TOGG, KC_APP, KC_PAUS, KC_INS, KC_NO, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_DEL, KC_HOME, KC_PGDN, KC_PGUP, KC_END ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/itsaferbie/keymap.c b/keyboards/dz60/keymaps/itsaferbie/keymap.c index ecc99cc751..de30e05382 100644 --- a/keyboards/dz60/keymaps/itsaferbie/keymap.c +++ b/keyboards/dz60/keymaps/itsaferbie/keymap.c @@ -9,25 +9,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_DEFAULT] = LAYOUT_hhkb( + [_DEFAULT] = LAYOUT_60_hhkb( KC_ESC, 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_BSLS, KC_GRV, 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_BSPC, KC_LCTL, 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, MO(_FN), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FN), KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_LIGHTS)), - [_FN] = LAYOUT_hhkb( + [_FN] = LAYOUT_60_hhkb( ______, 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_INS, KC_DEL, KC_CAPS, ______, ______, ______, ______, ______, ______, ______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, ______, RESET, ______, KC_VOLD, KC_VOLU, KC_MUTE, ______, ______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, ______, - ______, ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, + ______, KC_MPRV, KC_MPLY, KC_MNXT, ______, ______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, ______, ______, ______, ______, ______, ______, ______), - [_LIGHTS] = LAYOUT_hhkb( + [_LIGHTS] = LAYOUT_60_hhkb( RGB_TOG, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, ______, ______, ______, ______, ______, ______, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, RGB_HUD, RGB_SAD, RGB_VAD, ______, ______, ______, ______, ______, ______, ______, ______, ______, - ______, ______, ______, ______, BL_DEC, BL_TOGG, BL_INC, ______, ______, ______, ______, ______, ______, ______, + ______, ______, ______, BL_DEC, BL_TOGG, BL_INC, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______), }; diff --git a/keyboards/dz60/keymaps/jkbone/keymap.c b/keyboards/dz60/keymaps/jkbone/keymap.c index ecc391785f..1efcbe38f4 100644 --- a/keyboards/dz60/keymaps/jkbone/keymap.c +++ b/keyboards/dz60/keymaps/jkbone/keymap.c @@ -1,7 +1,6 @@ #include QMK_KEYBOARD_H #define ____ KC_TRNS -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define FL_ESC LT(_FL, KC_ESC) #define FL MO(_FL) @@ -11,60 +10,56 @@ enum layers_idx { _FL // Functions }; +enum custom_keycodes { + RGB_VAZ = SAFE_RANGE, + RGB_OAZ, + RGB_WAN, + RGB_000 +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_60_iso_5x1u( KC_ESC, 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_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_ENT, - FL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, + 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, + FL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS,KC_ENT, KC_LSFT, KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, FL, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT ), [_ML] = LAYOUT_60_iso_5x1u( ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, KC_LGUI, KC_LALT, KC_LCTL, ____, ____, ____, ____, ____, ____ ), [_FL] = LAYOUT_60_iso_5x1u( RESET, 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_DEL, - ____, ____, DF(_BL), DF(_ML), ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, - ____, ____, ____, ____, ____, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ____, ____, ____, - ____, F(3), F(2), F(1), F(0), ____, ____, ____, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY, ____, + ____, ____, DF(_BL), DF(_ML), ____, ____, ____, ____, ____, ____, ____, ____, ____, + ____, ____, ____, ____, ____, ____, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, ____, ____, ____, ____, + ____, RGB_000, RGB_WAN, RGB_OAZ, RGB_VAZ, ____, ____, ____, KC_MUTE, KC_MPRV, KC_MNXT, KC_MPLY, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ ) }; -enum function_id { - RGB_VAZ, - RGB_OAZ, - RGB_WAN, - RGB_000 -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(RGB_VAZ), - [1] = ACTION_FUNCTION(RGB_OAZ), - [2] = ACTION_FUNCTION(RGB_WAN), - [3] = ACTION_FUNCTION(RGB_000) -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case RGB_VAZ: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case RGB_VAZ: rgblight_enable(); rgblight_setrgb(0, 204, 33); break; - case RGB_OAZ: + case RGB_OAZ: rgblight_enable(); rgblight_setrgb(229, 65, 0); break; - case RGB_WAN: + case RGB_WAN: rgblight_enable(); rgblight_setrgb(255, 255, 255); break; - case RGB_000: + case RGB_000: rgblight_disable(); break; + } } -} + return true; +}; diff --git a/keyboards/dz60/keymaps/krusli/keymap.c b/keyboards/dz60/keymaps/krusli/keymap.c index 36e7b801a3..0ad6f1b2b5 100644 --- a/keyboards/dz60/keymaps/krusli/keymap.c +++ b/keyboards/dz60/keymaps/krusli/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define _______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/dz60/keymaps/macos_arrow/keymap.c b/keyboards/dz60/keymaps/macos_arrow/keymap.c index 7106092a47..81d61a59ae 100644 --- a/keyboards/dz60/keymaps/macos_arrow/keymap.c +++ b/keyboards/dz60/keymaps/macos_arrow/keymap.c @@ -25,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Alt | Gui | Space / _NL |Gui/_ML| Alt | Left| Down|Right| * `-----------------------------------------------------------------------------------------' */ - [_BL] = LAYOUT_2_shifts( + [_BL] = LAYOUT_all( 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_NO, KC_BSPC, 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, LT(_FL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, @@ -44,7 +44,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ - [_FL] = LAYOUT_2_shifts( + [_FL] = LAYOUT_all( _______, 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_NO, KC_DEL, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ - [_ML] = LAYOUT_2_shifts( + [_ML] = LAYOUT_all( KC_MEDIA_EJECT, BR_DOWN, BR_UP, _______, _______, _______, _______, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | * `-----------------------------------------------------------------------------------------' */ - [_NL] = LAYOUT_2_shifts( + [_NL] = LAYOUT_all( _______, _______, _______, _______, _______, _______, _______, _______, KC_PERCENT, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_LEFT_ANGLE_BRACKET, KC_RIGHT_ANGLE_BRACKET, KC_NO, _______, _______, _______, _______, _______, _______, _______, _______, KC_ASTERISK, KC_0, KC_1, KC_2, KC_3, _______, RESET, _______, _______, _______, _______, _______, _______, _______, KC_DOT, KC_MINS, KC_4, KC_5, KC_6, _______, diff --git a/keyboards/dz60/keymaps/stephengrier/config.h b/keyboards/dz60/keymaps/stephengrier/config.h new file mode 100644 index 0000000000..9560d51a6f --- /dev/null +++ b/keyboards/dz60/keymaps/stephengrier/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/stephengrier/keymap.c b/keyboards/dz60/keymaps/stephengrier/keymap.c index d9403f59e2..f6bbe78932 100644 --- a/keyboards/dz60/keymaps/stephengrier/keymap.c +++ b/keyboards/dz60/keymaps/stephengrier/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) - #define ______ KC_TRNS const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -20,11 +18,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------------' */ - LAYOUT_2_shifts( - F(0), 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, + LAYOUT_directional( + KC_GESC, 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_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, MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, MO(1), KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, KC_LEFT, KC_DOWN, KC_RIGHT ), @@ -50,37 +48,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______ ), }; - -enum function_id { - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(SHIFT_ESC), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - static uint8_t shift_esc_shift_mask; - switch (id) { - case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); - } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } -} diff --git a/keyboards/dz60/keymaps/weeheavy/keymap.c b/keyboards/dz60/keymaps/weeheavy/keymap.c index a98e3eeb20..cb9697e107 100644 --- a/keyboards/dz60/keymaps/weeheavy/keymap.c +++ b/keyboards/dz60/keymaps/weeheavy/keymap.c @@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Base layer - ANSI QWERTY -[L0] = LAYOUT_2_shifts( +[L0] = LAYOUT_all( KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXX, KC_BSPC, 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_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, @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(L1), KC_SPC, KC_RALT, MO(L2), KC_LEFT, KC_DOWN, KC_RIGHT), // Utility layer - RGB and multimedia control -[L1] = LAYOUT_2_shifts( +[L1] = LAYOUT_all( ____, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ____, ____, ____, RGB_TOG, RGB_MOD, RGB_M_K, RGB_M_R, ____, ____, KC_PSCR, ____, KC_PAUS, ____, ____, ____, ____, ____, RGB_HUI, RGB_HUD, ____, ____, ____, ____, KC_INS, KC_HOME, KC_PGUP, ____, ____, ____, @@ -28,7 +28,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ____, RGB_VAI, RGB_VAD, ____, ____, ____, ____, ____, KC_MPRV, KC_VOLD, KC_MNXT), // Setup layer - Reset an additional "b" button -[L2] = LAYOUT_2_shifts( +[L2] = LAYOUT_all( RESET, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, KC_B, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, RESET, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, -- cgit v1.2.3 From 9f2e39732f2458b1bfe5d546581da508c2be577e Mon Sep 17 00:00:00 2001 From: Rebecca Le <543859+sevenseacat@users.noreply.github.com> Date: Tue, 2 Oct 2018 11:43:43 +0800 Subject: Keyboard: Add support for the KBD4x (#4036) * Generate a new project for the KBD4x * Specify the possible layouts for the KBD4x - MIT and grid * Fill out the readme for the KBD4x * Configure the default keymap and wiring configuration as specified on http://qmkeyboard.cn/ * Add info.json for QMK Configurator * Enable backlight support for the KBD4x * Standardise on LAYOUT_planck_mit/LAYOUT_ortho_4x12 layout names * Add whitespace so the Readme will render correctly * Disable mouse keys support for the KBD4x to make the firmware small enough --- keyboards/kbd4x/config.h | 223 ++++++++++++++++++++++++++++++ keyboards/kbd4x/info.json | 112 +++++++++++++++ keyboards/kbd4x/kbd4x.c | 43 ++++++ keyboards/kbd4x/kbd4x.h | 48 +++++++ keyboards/kbd4x/keymaps/default/config.h | 19 +++ keyboards/kbd4x/keymaps/default/keymap.c | 52 +++++++ keyboards/kbd4x/keymaps/default/readme.md | 1 + keyboards/kbd4x/readme.md | 15 ++ keyboards/kbd4x/rules.mk | 81 +++++++++++ 9 files changed, 594 insertions(+) create mode 100644 keyboards/kbd4x/config.h create mode 100644 keyboards/kbd4x/info.json create mode 100644 keyboards/kbd4x/kbd4x.c create mode 100644 keyboards/kbd4x/kbd4x.h create mode 100644 keyboards/kbd4x/keymaps/default/config.h create mode 100644 keyboards/kbd4x/keymaps/default/keymap.c create mode 100644 keyboards/kbd4x/keymaps/default/readme.md create mode 100644 keyboards/kbd4x/readme.md create mode 100644 keyboards/kbd4x/rules.mk diff --git a/keyboards/kbd4x/config.h b/keyboards/kbd4x/config.h new file mode 100644 index 0000000000..b967ab8f75 --- /dev/null +++ b/keyboards/kbd4x/config.h @@ -0,0 +1,223 @@ +/* +Copyright 2018 sevenseacat + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT KBD4x +#define DESCRIPTION A compact 40% (12x4) ortholinear keyboard kit. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, B3, B1, B0, D5, B7, C7 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/kbd4x/info.json b/keyboards/kbd4x/info.json new file mode 100644 index 0000000000..78d011e2c7 --- /dev/null +++ b/keyboards/kbd4x/info.json @@ -0,0 +1,112 @@ +{ + "keyboard_name": "kbd4x", + "url": "", + "maintainer": "qmk", + "width": 14, + "height": 4, + "layouts": { + "LAYOUT_planck_mit": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"BKSP", "x":11, "y":0}, + {"label":"TAB", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"SHIFT", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"UP", "x":10, "y":2}, + {"label":"ENTER", "x":11, "y":2}, + {"label":"LCTRL", "x":0, "y":3}, + {"label":"LGUI", "x":1, "y":3}, + {"label":"1", "x":2, "y":3}, + {"label":"2", "x":3, "y":3}, + {"label":"3", "x":4, "y":3}, + {"label":"SPACE", "x":5, "y":3, "w":2}, + {"label":"MO(1)", "x":7, "y":3}, + {"label":"/", "x":8, "y":3}, + {"label":"LEFT", "x":9, "y":3}, + {"label":"DOWN", "x":10, "y":3}, + {"label":"RIGHT", "x":11, "y":3}, + ] + }, + "LAYOUT_ortho_4x12": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"BKSP", "x":11, "y":0}, + {"label":"TAB", "x":0, "y":1}, + {"label":"A", "x":1, "y":1}, + {"label":"S", "x":2, "y":1}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1}, + {"label":"G", "x":5, "y":1}, + {"label":"H", "x":6, "y":1}, + {"label":"J", "x":7, "y":1}, + {"label":"K", "x":8, "y":1}, + {"label":"L", "x":9, "y":1}, + {"label":";", "x":10, "y":1}, + {"label":"'", "x":11, "y":1}, + {"label":"SHIFT", "x":0, "y":2}, + {"label":"Z", "x":1, "y":2}, + {"label":"X", "x":2, "y":2}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2}, + {"label":"B", "x":5, "y":2}, + {"label":"N", "x":6, "y":2}, + {"label":"M", "x":7, "y":2}, + {"label":",", "x":8, "y":2}, + {"label":".", "x":9, "y":2}, + {"label":"UP", "x":10, "y":2}, + {"label":"ENTER", "x":11, "y":2}, + {"label":"LCTRL", "x":0, "y":3}, + {"label":"LGUI", "x":1, "y":3}, + {"label":"1", "x":2, "y":3}, + {"label":"2", "x":3, "y":3}, + {"label":"3", "x":4, "y":3}, + {"label":"SPACE", "x":5, "y":3}, + {"label":"MO(2)", "x":6, "y":3}, + {"label":"MO(1)", "x":7, "y":3}, + {"label":"/", "x":8, "y":3}, + {"label":"LEFT", "x":9, "y":3}, + {"label":"DOWN", "x":10, "y":3}, + {"label":"RIGHT", "x":11, "y":3}, + ] + } + } +} diff --git a/keyboards/kbd4x/kbd4x.c b/keyboards/kbd4x/kbd4x.c new file mode 100644 index 0000000000..84ada250d7 --- /dev/null +++ b/keyboards/kbd4x/kbd4x.c @@ -0,0 +1,43 @@ +/* Copyright 2018 sevenseacat + * + * 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 . + */ +#include "kbd4x.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/kbd4x/kbd4x.h b/keyboards/kbd4x/kbd4x.h new file mode 100644 index 0000000000..d7a851e3eb --- /dev/null +++ b/keyboards/kbd4x/kbd4x.h @@ -0,0 +1,48 @@ +/* Copyright 2018 sevenseacat + * + * 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 . + */ +#ifndef KBD4X_H +#define KBD4X_H + +#include "quantum.h" + +#define LAYOUT_planck_mit( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, KC_NO, k37, k38, k39, k3a, k3b } \ +} + +// The PCB does support a grid layout, but the case does not. +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b } \ +} + +#endif diff --git a/keyboards/kbd4x/keymaps/default/config.h b/keyboards/kbd4x/keymaps/default/config.h new file mode 100644 index 0000000000..7f3bd7dd52 --- /dev/null +++ b/keyboards/kbd4x/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 sevenseacat + * + * 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 + +// place overrides here diff --git a/keyboards/kbd4x/keymaps/default/keymap.c b/keyboards/kbd4x/keymaps/default/keymap.c new file mode 100644 index 0000000000..ad49b37998 --- /dev/null +++ b/keyboards/kbd4x/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* Copyright 2018 sevenseacat + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define ___ KC_TRNS + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + KBD4X = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_planck_mit( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, KC_ENTER, + KC_LCTL, KC_LGUI, KC_1, KC_2, KC_3, KC_SPACE, MO(1), KC_SLSH, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + [1] = LAYOUT_planck_mit( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, ___, + ___, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, ___, ___, ___, ___, ___, ___, RESET, + ___, BL_TOGG, BL_STEP, ___, ___, ___, ___, ___, ___, ___, ___, ___, + ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { +} diff --git a/keyboards/kbd4x/keymaps/default/readme.md b/keyboards/kbd4x/keymaps/default/readme.md new file mode 100644 index 0000000000..a950a25ace --- /dev/null +++ b/keyboards/kbd4x/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for kbd4x diff --git a/keyboards/kbd4x/readme.md b/keyboards/kbd4x/readme.md new file mode 100644 index 0000000000..42dc450248 --- /dev/null +++ b/keyboards/kbd4x/readme.md @@ -0,0 +1,15 @@ +# KBD4x + +![KBD4x](https://cdn.shopify.com/s/files/1/1473/3902/products/1_ef8d3ad0-fc70-4d4f-9e36-8438c781a581_1800x1800.jpg) + +A compact 40% (12x4) ortholinear keyboard kit sold by KBDFans. + +Keyboard Maintainer: ![sevenseacat](https://github.com/sevenseacat) +Hardware Supported: KBD4x PCB +Hardware Availability: https://kbdfans.cn/collections/diy-kit/products/kbd4x-custom-mechanical-keyboard-hot-swap-diy-kit + +Make example for this keyboard (after setting up your build environment): + + make kbd4x: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/kbd4x/rules.mk b/keyboards/kbd4x/rules.mk new file mode 100644 index 0000000000..6cfd92bc63 --- /dev/null +++ b/keyboards/kbd4x/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From 1a33054a3586fa69812a249762e24ecc08a40423 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 2 Oct 2018 07:54:18 -0700 Subject: Reduce firmware size of KBD8x to fix Travis Compile issues --- keyboards/kbd8x/config.h | 5 ++--- keyboards/kbd8x/kbd8x.h | 8 +++----- keyboards/kbd8x/keymaps/default/config.h | 9 +-------- keyboards/kbd8x/keymaps/default_backlighting/config.h | 9 +-------- keyboards/kbd8x/keymaps/default_backlighting/rules.mk | 2 +- keyboards/kbd8x/rules.mk | 3 +-- 6 files changed, 9 insertions(+), 27 deletions(-) diff --git a/keyboards/kbd8x/config.h b/keyboards/kbd8x/config.h index c021fb40b5..7749e04724 100644 --- a/keyboards/kbd8x/config.h +++ b/keyboards/kbd8x/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -196,4 +195,4 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 -#endif + diff --git a/keyboards/kbd8x/kbd8x.h b/keyboards/kbd8x/kbd8x.h index 02a7436446..f28b8ca7a1 100644 --- a/keyboards/kbd8x/kbd8x.h +++ b/keyboards/kbd8x/kbd8x.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KBD8X_H -#define KBD8X_H +#pragma once #include "quantum.h" #include "led.h" @@ -31,7 +30,7 @@ inline void scroll_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } // LAYOUT depicting all possible switch positions. -// LAYOUT_all supports ISO, split backspace and split left/right shift. +// LAYOUT_all supports ISO, split backspace and split left/right shift. #define LAYOUT_all( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K3D, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K5B, K5C, K3E, \ @@ -49,7 +48,7 @@ inline void scroll_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E } \ } -// LAYOUT depicting only switch positions for a standard TKL ANSI keyboard. +// LAYOUT depicting only switch positions for a standard TKL ANSI keyboard. // TODO: Double check location of backspace key for 2u layout (It's either K1D or K1C). #define LAYOUT_tkl_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K3D, \ @@ -68,4 +67,3 @@ inline void scroll_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C, K5D, K5E } \ } -#endif diff --git a/keyboards/kbd8x/keymaps/default/config.h b/keyboards/kbd8x/keymaps/default/config.h index 63bef2a735..fa7db0bc10 100644 --- a/keyboards/kbd8x/keymaps/default/config.h +++ b/keyboards/kbd8x/keymaps/default/config.h @@ -14,11 +14,4 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif +#pragma once diff --git a/keyboards/kbd8x/keymaps/default_backlighting/config.h b/keyboards/kbd8x/keymaps/default_backlighting/config.h index 63bef2a735..fa7db0bc10 100644 --- a/keyboards/kbd8x/keymaps/default_backlighting/config.h +++ b/keyboards/kbd8x/keymaps/default_backlighting/config.h @@ -14,11 +14,4 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif +#pragma once diff --git a/keyboards/kbd8x/keymaps/default_backlighting/rules.mk b/keyboards/kbd8x/keymaps/default_backlighting/rules.mk index e806a1ca59..07b9f81fd0 100644 --- a/keyboards/kbd8x/keymaps/default_backlighting/rules.mk +++ b/keyboards/kbd8x/keymaps/default_backlighting/rules.mk @@ -1,7 +1,7 @@ #Build Options BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 diff --git a/keyboards/kbd8x/rules.mk b/keyboards/kbd8x/rules.mk index 46e9732ea7..e5925463ec 100644 --- a/keyboards/kbd8x/rules.mk +++ b/keyboards/kbd8x/rules.mk @@ -45,7 +45,6 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Atmel DFU loader 4096 # LUFA bootloader 4096 # USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 BOOTLOADER = atmel-dfu @@ -53,7 +52,7 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 -- cgit v1.2.3 From 5c2ac733afe9f6d68d2ad42c9d58fbff466a7874 Mon Sep 17 00:00:00 2001 From: Jarred Steenvoorden Date: Wed, 3 Oct 2018 01:14:37 +1000 Subject: Keymap: Adding my DZ60, Satan, XD75 kemaps and updates to userspace (#4039) * Update userspace with common config.h * Add my dz60, satan and xd75 keyboard keymaps * Fixing executable bits changed during last upstream merge * Cleanup unnecessary files and defines * Remove unnecessary defines from userspace config --- keyboards/dz60/keymaps/jarred/keymap.c | 21 ++++++++++++++ keyboards/planck/keymaps/jarred/config.h | 37 ----------------------- keyboards/planck/keymaps/jarred/rules.mk | 4 --- keyboards/satan/keymaps/jarred/keymap.c | 22 ++++++++++++++ keyboards/satan/keymaps/jarred/readme.md | 1 + keyboards/xd75/keymaps/daniel/keymap.c | 29 ++++++++++++++++++ keyboards/xd75/keymaps/daniel/readme.md | 1 + keyboards/xd75/keymaps/jarred/keymap.c | 37 +++++++++++++++++++++++ keyboards/xd75/keymaps/jarred/readme.md | 1 + users/jarred/config.h | 50 ++++++++++++++++++++++++++++++++ users/jarred/jarred.c | 15 ++++++++++ users/jarred/jarred.h | 8 ++--- users/jarred/rules.mk | 15 ++++++++++ 13 files changed, 196 insertions(+), 45 deletions(-) create mode 100644 keyboards/dz60/keymaps/jarred/keymap.c delete mode 100644 keyboards/planck/keymaps/jarred/config.h delete mode 100644 keyboards/planck/keymaps/jarred/rules.mk create mode 100644 keyboards/satan/keymaps/jarred/keymap.c create mode 100644 keyboards/satan/keymaps/jarred/readme.md create mode 100644 keyboards/xd75/keymaps/daniel/keymap.c create mode 100644 keyboards/xd75/keymaps/daniel/readme.md create mode 100644 keyboards/xd75/keymaps/jarred/keymap.c create mode 100644 keyboards/xd75/keymaps/jarred/readme.md create mode 100644 users/jarred/config.h diff --git a/keyboards/dz60/keymaps/jarred/keymap.c b/keyboards/dz60/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..9e68506831 --- /dev/null +++ b/keyboards/dz60/keymaps/jarred/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _NV 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QW] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, + 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, + MO(_NV), 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, XXXXXXX,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT,XXXXXXX, + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI, XXXXXXX,KC_APP, KC_RCTL), + + [_NV] = LAYOUT( + KC_GRV ,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_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, + _______,_______,_______,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, + _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______,_______, + _______,_______,_______, _______,_______,_______, _______,_______,_______, RESET, _______) +}; diff --git a/keyboards/planck/keymaps/jarred/config.h b/keyboards/planck/keymaps/jarred/config.h deleted file mode 100644 index 9e8f404c15..0000000000 --- a/keyboards/planck/keymaps/jarred/config.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Copyright 2018 Jarred Steenvoorden - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) -#endif - -#define TAPPING_TERM 200 - -#define MOUSEKEY_DELAY 0 -#define MOUSEKEY_INTERVAL 16 -#define MOUSEKEY_TIME_TO_MAX 40 -#define MOUSEKEY_MAX_SPEED 5 - -#define MOUSEKEY_WHEEL_DELAY 0 -#define MOUSEKEY_WHEEL_MAX_SPEED 4 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 - -#endif diff --git a/keyboards/planck/keymaps/jarred/rules.mk b/keyboards/planck/keymaps/jarred/rules.mk deleted file mode 100644 index cd14c41e11..0000000000 --- a/keyboards/planck/keymaps/jarred/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ -# Build options - -BACKLIGHT_ENABLE = no # Switch LEDs -MOUSEKEY_ENABLE = no # Emulates mouse key using keypresses diff --git a/keyboards/satan/keymaps/jarred/keymap.c b/keyboards/satan/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..c6852e4eb5 --- /dev/null +++ b/keyboards/satan/keymaps/jarred/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _NV 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QW] = LAYOUT_60_ansi( + KC_ESC, 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_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, \ + MO(_NV), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP, KC_RCTL), + +[_NV] = LAYOUT_60_ansi( + KC_GRV ,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_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, \ + _______,_______,_______,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, \ + _______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______, \ + _______,_______,_______, _______, _______,_______, RESET, _______), + +}; diff --git a/keyboards/satan/keymaps/jarred/readme.md b/keyboards/satan/keymaps/jarred/readme.md new file mode 100644 index 0000000000..522cb19b65 --- /dev/null +++ b/keyboards/satan/keymaps/jarred/readme.md @@ -0,0 +1 @@ +# Jarred's Satan GH60 layout diff --git a/keyboards/xd75/keymaps/daniel/keymap.c b/keyboards/xd75/keymaps/daniel/keymap.c new file mode 100644 index 0000000000..2804a6cd0d --- /dev/null +++ b/keyboards/xd75/keymaps/daniel/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _NV 1 +#define _NM 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { + { KC_ESC , 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_GRV , KC_BSPC }, + { 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 }, + { MO(_NV), KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , MO(_NM), KC_PGUP }, + { KC_LSFT, 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_PGDN }, + { KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_SPC , KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_RGUI, KC_APP , KC_LEFT, KC_DOWN, KC_RGHT }, + }, + [_NV] = { + { 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_DEL , KC_BSPC, _______, KC_HOME, KC_UP , KC_END , KC_INS , _______, _______, _______, _______ }, + { _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT , _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + [_NM] = { + { _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + } +}; diff --git a/keyboards/xd75/keymaps/daniel/readme.md b/keyboards/xd75/keymaps/daniel/readme.md new file mode 100644 index 0000000000..3305d0f30b --- /dev/null +++ b/keyboards/xd75/keymaps/daniel/readme.md @@ -0,0 +1 @@ +# Daniels xd75 keymap diff --git a/keyboards/xd75/keymaps/jarred/keymap.c b/keyboards/xd75/keymaps/jarred/keymap.c new file mode 100644 index 0000000000..f851787118 --- /dev/null +++ b/keyboards/xd75/keymaps/jarred/keymap.c @@ -0,0 +1,37 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _LW 1 +#define _NV 2 +#define _NM 3 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QW] = { + { KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_MUTE, KC_VOLD, KC_VOLU, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC }, + { KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_INS , KC_HOME, KC_PGUP, KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC }, + { MO(_NV), KC_A , KC_S , KC_D , KC_F , KC_G , KC_DEL , KC_END , KC_PGDN, KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT }, + { KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , _______, KC_UP , _______, KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT }, + { KC_LCTL, KC_LGUI, MO(_NM), KC_LALT, MO(_LW), KC_SPC , KC_LEFT, KC_DOWN, KC_RGHT, KC_ENT , MO(_LW), KC_RALT, KC_RGUI, KC_APP , KC_RCTL }, + }, + [_LW] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , _______, _______, _______, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______ }, + { _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , _______, _______, _______, KC_F11 , KC_MINS, KC_EQL , KC_LBRC, KC_RBRC, KC_BSLS }, + { _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , _______, _______, _______, KC_F12 , KC_GRV , _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + [_NV] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, KC_DEL , KC_BSPC, _______, _______, _______, _______, KC_HOME, KC_UP , KC_END , KC_INS , _______ }, + { _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT , _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + }, + [_NM] = { + { _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______ }, + { RESET , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, + } +}; diff --git a/keyboards/xd75/keymaps/jarred/readme.md b/keyboards/xd75/keymaps/jarred/readme.md new file mode 100644 index 0000000000..4070bb3eed --- /dev/null +++ b/keyboards/xd75/keymaps/jarred/readme.md @@ -0,0 +1 @@ +# Jarreds xd75 keymap diff --git a/users/jarred/config.h b/users/jarred/config.h new file mode 100644 index 0000000000..f282088144 --- /dev/null +++ b/users/jarred/config.h @@ -0,0 +1,50 @@ +/* Copyright 2018 Jarred Steenvoorden + * + * 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 + +// Sets good default for the speed of the mouse. +#undef MOUSEKEY_INTERVAL +#undef MOUSEKEY_DELAY +#undef MOUSEKEY_TIME_TO_MAX +#undef MOUSEKEY_MAX_SPEED + +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 40 +#define MOUSEKEY_MAX_SPEED 5 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#undef MOUSEKEY_WHEEL_DELAY + +#define MOUSEKEY_WHEEL_MAX_SPEED 4 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 255 +#define MOUSEKEY_WHEEL_DELAY 0 + +#undef TAPPING_TOGGLE +#undef TAPPING_TERM +#undef IGNORE_MOD_TAP_INTERRUPT + +#define TAPPING_TOGGLE 1 +#define TAPPING_TERM 200 +#define IGNORE_MOD_TAP_INTERRUPT + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +#define MACRO_TIMER 5 diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c index f8413ca3b3..33162b6891 100644 --- a/users/jarred/jarred.c +++ b/users/jarred/jarred.c @@ -15,3 +15,18 @@ */ #include "jarred.h" +#include "version.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); + } + return false; + break; + } + + return true; +} diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h index b1253f76a7..a6774ce264 100644 --- a/users/jarred/jarred.h +++ b/users/jarred/jarred.h @@ -19,9 +19,9 @@ #include "quantum.h" -// Use 7 wide characters for keymaps -#define _______ KC_TRNS -#define XXXXXXX KC_NO +enum userspace_custom_keycodes { + VRSN = SAFE_RANGE // Prints QMK Firmware and board info +}; // Layers #define _QW 0 @@ -72,7 +72,7 @@ #define NUMPAD_L1 RGB_TOG, RGB_MOD, _______, _______, RGB_HUD, RGB_HUI #define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI #define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI -#define NUMPAD_L4 RESET, _______, _______, _______, RGB_SPD, RGB_SPI +#define NUMPAD_L4 RESET, VRSN, _______, _______, RGB_SPD, RGB_SPI #define NUMPAD_R1 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______ #define NUMPAD_R2 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______ diff --git a/users/jarred/rules.mk b/users/jarred/rules.mk index 3c15cd0f9a..9a00cbf72b 100644 --- a/users/jarred/rules.mk +++ b/users/jarred/rules.mk @@ -1 +1,16 @@ SRC += jarred.c + +ifneq (,$(findstring planck,$(KEYBOARD))) + # Enable backlight for rev4 planck only + ifneq (,$(findstring rev4,$(KEYBOARD))) + BACKLIGHT_ENABLE = yes + BACKLIGHT_BREATHING = yes + else + BACKLIGHT_ENABLE = no + BACKLIGHT_BREATHING = no + endif + + AUDIO_ENABLE = yes +endif + +MOUSEKEY_ENABLE = no -- cgit v1.2.3 From 66b793730ead28e409cbc152606a769e1c7b6a0b Mon Sep 17 00:00:00 2001 From: Bramver Date: Tue, 2 Oct 2018 22:06:31 +0200 Subject: Keymap: Personal XD75 keymap added. (#4045) * Personal XD75 keymap added. Nothing fancy, has emojisupport. * Converted to spaces to follow guidelines * Fixed requested changes. Replacing include guards with pragma once. Omitting unnecessary lines. PR #4045 --- keyboards/xd75/keymaps/bramver/README.md | 43 ++++++++++++ keyboards/xd75/keymaps/bramver/config.h | 25 +++++++ keyboards/xd75/keymaps/bramver/keymap.c | 115 +++++++++++++++++++++++++++++++ keyboards/xd75/keymaps/bramver/rules.mk | 7 ++ 4 files changed, 190 insertions(+) create mode 100644 keyboards/xd75/keymaps/bramver/README.md create mode 100644 keyboards/xd75/keymaps/bramver/config.h create mode 100644 keyboards/xd75/keymaps/bramver/keymap.c create mode 100644 keyboards/xd75/keymaps/bramver/rules.mk diff --git a/keyboards/xd75/keymaps/bramver/README.md b/keyboards/xd75/keymaps/bramver/README.md new file mode 100644 index 0000000000..2dcac5f0e3 --- /dev/null +++ b/keyboards/xd75/keymaps/bramver/README.md @@ -0,0 +1,43 @@ +# XD75 Layout + +Standard qwerty layout. +Limited emoji support and proper mouse settings. + +## Keymap + +``` +_BASE + | GESC | 1 | 2 | 3 | 4 | 5 | MPRV | MPLY | MNXT | 6 | 7 | 8 | 9 | 0 | BSPC | + | TAB | Q | W | E | R | T | MINS | EQL | BSLS | Y | U | I | O | P | ENT | + | MO(3) | A | S | D | F | G | LBRC | MUTE | RBRC | H | J | K | L | SCLN | QUOT | + | LSFT | Z | X | C | V | B | HOME | SLEP | END | N | M | COMM | DOT | SLSH | RSFT | + | LCTL | MO(4) | LALT | LGUI | SPC | SPC | MO(1) | DEL | MO(2) | SPC | LEFT | DOWN | UP | RGHT | RGUI | + +_LOWER + | _______ | _______ | _______ | _______ | _______ | _______ | BL_TOGG | BL_DEC | BL_INC | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | WH_L | BTN1 | MS_U | BTN2 | WH_U | BL_STEP | RGB_TOG | RGB_MOD | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | WH_R | MS_L | MS_D | MS_R | WH_D | RGB_HUI | RGB_HUD | RGB_SAI | _______ | LEFT | DOWN | UP | RGHT | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | RGB_SAD | RGB_VAI | RGB_VAD | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + +_LINVERT + | _______ | _______ | _______ | _______ | _______ | _______ | BL_TOGG | BL_DEC | BL_INC | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | BL_STEP | RGB_TOG | RGB_MOD | WH_U | BTN1 | MS_U | BTN2 | WH_L | _______ | + | _______ | LEFT | DOWN | UP | RGHT | _______ | RGB_SAI | RGB_HUI | RGB_HUD | WH_D | MS_L | MS_D | MS_R | WH_R | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | RGB_SAD | RGB_VAI | RGB_VAD | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + +_RAISE + | F1 | F2 | F3 | F4 | F5 | F6 | _______ | _______ | _______ | F7 | F8 | F9 | F10 | F11 | F12 | + | _______ | _______ | 7 | 8 | 9 | _______ | _______ | _______ | _______ | _______ | MUTE | VOLD | VOLU | _______ | _______ | + | _______ | _______ | 4 | 5 | 6 | _______ | _______ | _______ | _______ | _______ | MPRV | MPLY | MNXT | _______ | _______ | + | _______ | _______ | 1 | 2 | 3 | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | _______ | _______ | 0 | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + +_EMOJIFY + | TO(0) | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | RESET | + | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | X(CELE) | X(PRAY) | X(NAIL) | X(OK) | X(THNK) | _______ | _______ | _______ | X(UNAM) | X(HEYE) | X(COOL) | X(EYES) | X(SMIR) | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | + | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | _______ | +``` \ No newline at end of file diff --git a/keyboards/xd75/keymaps/bramver/config.h b/keyboards/xd75/keymaps/bramver/config.h new file mode 100644 index 0000000000..2264af74c2 --- /dev/null +++ b/keyboards/xd75/keymaps/bramver/config.h @@ -0,0 +1,25 @@ +/* Copyright 2018 darm + * + * 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 + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/xd75/keymaps/bramver/keymap.c b/keyboards/xd75/keymaps/bramver/keymap.c new file mode 100644 index 0000000000..831278d001 --- /dev/null +++ b/keyboards/xd75/keymaps/bramver/keymap.c @@ -0,0 +1,115 @@ +/* Copyright 2018 darm + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// Layer shorthand +#define _BASE 0 +#define _LOWER 1 +#define _LINVERT 2 +#define _RAISE 3 +#define _EMOJIFY 4 + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare 💅 +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = { + { KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_MPRV , KC_MPLY , KC_MNXT , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC }, + { KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_MINS , KC_EQL , KC_BSLS , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_ENT }, + { MO(3) , KC_A , KC_S , KC_D , KC_F , KC_G , KC_LBRC , KC_MUTE , KC_RBRC , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT }, + { KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_HOME , KC_SLEP , KC_END , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT }, + { KC_LCTL , MO(4) , KC_LALT , KC_LGUI , KC_SPC , KC_SPC , MO(1) , KC_DEL , MO(2) , KC_SPC , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_RGUI }, + }, + + [_LOWER] = { + { _______ , _______ , _______ , _______ , _______ , _______ , BL_TOGG , BL_DEC , BL_INC , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , BL_STEP , RGB_TOG , RGB_MOD , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , RGB_HUI , RGB_HUD , RGB_SAI , _______ , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , RGB_SAD , RGB_VAI , RGB_VAD , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + }, + + [_LINVERT] = { + { _______ , _______ , _______ , _______ , _______ , _______ , BL_TOGG , BL_DEC , BL_INC , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , BL_STEP , RGB_TOG , RGB_MOD , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ }, + { _______ , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , _______ , RGB_SAI , RGB_HUI , RGB_HUD , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , RGB_SAD , RGB_VAI , RGB_VAD , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + }, + + [_RAISE] = { + { 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_7 , KC_8 , KC_9 , _______ , _______ , _______ , _______ , _______ , KC_MUTE , KC_VOLD , KC_VOLU , _______ , _______ }, + { _______ , _______ , KC_4 , KC_5 , KC_6 , _______ , _______ , _______ , _______ , _______ , KC_MPRV , KC_MPLY , KC_MNXT , _______ , _______ }, + { _______ , _______ , KC_1 , KC_2 , KC_3 , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , _______ , _______ , KC_0 , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + }, + + [_EMOJIFY] = { + { TO(0) , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , RESET }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , _______ , _______ , _______ , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + }, + +}; + +const uint16_t PROGMEM fn_actions[] = {}; + +void matrix_init_user(void) { + _delay_ms(20); // Gets rid of tick + set_unicode_input_mode(UC_LNX); +} + +/* Template for future layers + [_LAYER_NAME] = { + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + } +}; +*/ diff --git a/keyboards/xd75/keymaps/bramver/rules.mk b/keyboards/xd75/keymaps/bramver/rules.mk new file mode 100644 index 0000000000..1c3d4d8cd0 --- /dev/null +++ b/keyboards/xd75/keymaps/bramver/rules.mk @@ -0,0 +1,7 @@ +# Build options +BACKLIGHT_ENABLE = yes # Switch LEDs +MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses +RGBLIGHT_ENABLE = yes # LED strips +EXTRAKEY_ENABLE = yes # Use system and audio control key codes +TAP_DANCE_ENABLE = no # Use multi-tap features +UNICODEMAP_ENABLE = yes # Emojify me pls -- cgit v1.2.3 From 9aecf4ccfdbef6123bbf0a1e6670f85f4763ee89 Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Tue, 2 Oct 2018 08:41:19 +0900 Subject: Adds a method allowing to set custom colors to the rgb matrix --- quantum/rgb_matrix.c | 7 +++++++ quantum/rgb_matrix.h | 1 + 2 files changed, 8 insertions(+) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index f0c2ddfdfb..1f00e9d99b 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -903,3 +903,10 @@ void rgblight_mode(uint8_t mode) { uint32_t rgblight_get_mode(void) { return rgb_matrix_config.mode; } + +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_config.hue = hue; + rgb_matrix_config.sat = sat; + rgb_matrix_config.val = val; + eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +} diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 45caaac423..d2450a7d99 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -128,6 +128,7 @@ uint32_t rgb_matrix_get_tick(void); void rgblight_toggle(void); void rgblight_step(void); +void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); void rgblight_step_reverse(void); void rgblight_increase_hue(void); void rgblight_decrease_hue(void); -- cgit v1.2.3 From 1741e39e3463ac3cc6164656b0cc7afa8c33cc00 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 3 Oct 2018 00:03:50 +0100 Subject: New keyboard: Baguette (#4047) * Bagette Addition of Baguette a close group buy custom * Add json --- keyboards/baguette/baguette.c | 71 +++++++++ keyboards/baguette/baguette.h | 59 +++++++ keyboards/baguette/config.h | 224 +++++++++++++++++++++++++++ keyboards/baguette/info.json | 16 ++ keyboards/baguette/keymaps/default/keymap.c | 50 ++++++ keyboards/baguette/keymaps/default/readme.md | 9 ++ keyboards/baguette/keymaps/iso/keymap.c | 50 ++++++ keyboards/baguette/keymaps/iso/readme.md | 10 ++ keyboards/baguette/readme.md | 16 ++ keyboards/baguette/rules.mk | 81 ++++++++++ 10 files changed, 586 insertions(+) create mode 100644 keyboards/baguette/baguette.c create mode 100644 keyboards/baguette/baguette.h create mode 100644 keyboards/baguette/config.h create mode 100644 keyboards/baguette/info.json create mode 100644 keyboards/baguette/keymaps/default/keymap.c create mode 100644 keyboards/baguette/keymaps/default/readme.md create mode 100644 keyboards/baguette/keymaps/iso/keymap.c create mode 100644 keyboards/baguette/keymaps/iso/readme.md create mode 100644 keyboards/baguette/readme.md create mode 100644 keyboards/baguette/rules.mk diff --git a/keyboards/baguette/baguette.c b/keyboards/baguette/baguette.c new file mode 100644 index 0000000000..6a8df873ab --- /dev/null +++ b/keyboards/baguette/baguette.c @@ -0,0 +1,71 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include "baguette.h" + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic made by Wilba. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc and space bar are held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // Assumes Esc is at [0,0] and spacebar is at [4,7]. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + if ( ( matrix_get_row(0) & (1<<0) ) && + ( matrix_get_row(4) & (1<<7) ) ) + { + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); + //eeprom_set_valid(false); + // Jump to bootloader. + bootloader_jump(); + } +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + bootmagic_lite(); + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/baguette/baguette.h b/keyboards/baguette/baguette.h new file mode 100644 index 0000000000..e3945bea7e --- /dev/null +++ b/keyboards/baguette/baguette.h @@ -0,0 +1,59 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#ifndef BAGUETTE_H +#define BAGUETTE_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K42, K43, K47, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D, KC_NO, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO }, \ + { KC_NO, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D, K4E, K4F } \ +} + +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K42, K43, K47, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, KC_NO, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K1D, K2D, KC_NO, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO }, \ + { KC_NO, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, KC_NO, K4B, K4C, K4D, K4E, K4F } \ +} + +#endif diff --git a/keyboards/baguette/config.h b/keyboards/baguette/config.h new file mode 100644 index 0000000000..806f9fb4f6 --- /dev/null +++ b/keyboards/baguette/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 Yiancar + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x5050 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar +#define PRODUCT Baguette +#define DESCRIPTION A French Custom + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B3, B2, B1, E6, D6 } +#define MATRIX_COL_PINS { B6, C6, C7, F7, F6, F5, F4, F1, F0, B0, D0, D1, D2, D3, D5, D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/baguette/info.json b/keyboards/baguette/info.json new file mode 100644 index 0000000000..777899a600 --- /dev/null +++ b/keyboards/baguette/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "Baguette", + "url": "", + "maintainer": "qmk", + "bootloader": "atmel-dfu", + "width": 19.75, + "height": 6.5, + "layouts": { + "LAYOUT_ansi": { + "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"|", "x":16.75, "y":2.5, "w":1.5}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"label":"Enter", "x":16, "y":3.5, "w":2.25}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] + }, + "LAYOUT_iso": { + "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"Enter", "x":17, "y":2.5, "w":1.25, "h":2}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"x":16, "y":3.5}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] + } + } +} diff --git a/keyboards/baguette/keymaps/default/keymap.c b/keyboards/baguette/keymaps/default/keymap.c new file mode 100644 index 0000000000..4dfcb837a5 --- /dev/null +++ b/keyboards/baguette/keymaps/default/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_ansi( /* Base */ + KC_GESC, 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_TRNS, KC_INS,\ + 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_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_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, KC_RSFT, KC_UP, \ + KC_LGUI, KC_LALT, KC_SPC, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + +[1] = LAYOUT_ansi( /* FN */ + KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/baguette/keymaps/default/readme.md b/keyboards/baguette/keymaps/default/readme.md new file mode 100644 index 0000000000..1e74a02cd6 --- /dev/null +++ b/keyboards/baguette/keymaps/default/readme.md @@ -0,0 +1,9 @@ +# The default ANSI keymap for baguette + +Typical ANSI keymap. Please note: +- Left key from split backspace is connected to 2u key. +- Left key from split left Shift is connected to 2u key. +- Right key from split right Shift is connected to 2u key. +- Backlight control is on the Z, X and C keys of the FN layer. +- Reset key combination is FN + ]. +- Holding ESC and Space while plugging in the USB erases the EEPROM. diff --git a/keyboards/baguette/keymaps/iso/keymap.c b/keyboards/baguette/keymaps/iso/keymap.c new file mode 100644 index 0000000000..ea8baf08ee --- /dev/null +++ b/keyboards/baguette/keymaps/iso/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_iso( /* Base */ + KC_GESC, 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_TRNS, KC_INS,\ + 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_DEL,\ + 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_QUOT, KC_ENT, \ + KC_LSFT, KC_TRNS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_TRNS, KC_RSFT, KC_UP, \ + KC_LGUI, KC_LALT, KC_SPC, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + +[0] = LAYOUT_iso( /* FN */ + KC_TRNS, 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_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, BL_TOGG, BL_STEP, BL_BRTG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_RCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/baguette/keymaps/iso/readme.md b/keyboards/baguette/keymaps/iso/readme.md new file mode 100644 index 0000000000..9256820a5c --- /dev/null +++ b/keyboards/baguette/keymaps/iso/readme.md @@ -0,0 +1,10 @@ +# The default ISO keymap for baguette + +Typical ISO keymap. Please note: +- Left key from split backspace is connected to 2u key. +- Left key from split left Shift is connected to 2u key. +- Right key from split right Shift is connected to 2u key. +- Backlight control is on the Z, X and C keys of the FN layer. +- Reset key combination is FN + ]. +- Holding ESC and Space while plugging in the USB erases the EEPROM. + diff --git a/keyboards/baguette/readme.md b/keyboards/baguette/readme.md new file mode 100644 index 0000000000..d211af16a5 --- /dev/null +++ b/keyboards/baguette/readme.md @@ -0,0 +1,16 @@ +Baguette +======== + +![Baguette](https://cdn.discordapp.com/attachments/426880953143525384/479788409263489035/scecre2.png) + +This is a custom keyboard with backlight inspired by France. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: ATMEGA 32u4 MCU with backlight support. +Hardware Availability: Closed group-buy please contact the runners (Tesletron and Enjoy) + +Make example for this keyboard (after setting up your build environment): + + make baguette: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/baguette/rules.mk b/keyboards/baguette/rules.mk new file mode 100644 index 0000000000..062ff1b22c --- /dev/null +++ b/keyboards/baguette/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From 37cfd2c5009b932cfddec815c63c6846a5ef3854 Mon Sep 17 00:00:00 2001 From: takashiski Date: Wed, 3 Oct 2018 09:51:43 +0900 Subject: add JP keycode for MacOSX (#4033) --- quantum/keymap_extras/keymap_jp.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/quantum/keymap_extras/keymap_jp.h b/quantum/keymap_extras/keymap_jp.h index fb74bce8d4..b0235f1120 100644 --- a/quantum/keymap_extras/keymap_jp.h +++ b/quantum/keymap_extras/keymap_jp.h @@ -40,6 +40,9 @@ #define JP_HENK KC_INT4 // henkan #define JP_KANA KC_INT2 // katakana/hiragana|ro-mazi +#define JP_MKANA KC_LANG1 //kana on MacOSX +#define JP_MEISU KC_LANG2 //eisu on MacOSX + //Aliases for shifted symbols #define JP_DQT LSFT(KC_2) // " -- cgit v1.2.3 From 2d671a7e1a75bb9d03a40c0e440f897c7e52a15e Mon Sep 17 00:00:00 2001 From: Chris Johnston Date: Tue, 2 Oct 2018 22:16:49 -0700 Subject: Enable support for Linux Mint 18 with linux_install.sh (#4042) Enable support for ubuntu-derived linux-es in installer Checks /etc/os-release for mention of ubuntu and debian. Linux Mint uses ID_LIKE=ubuntu, not ID_LIKE=debian (as seen in Ubuntu 16.04, unsure about others) --- util/linux_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 9b8b92d087..0e4e26fd96 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -4,7 +4,7 @@ if grep ID /etc/os-release | grep -qE "rhel|fedora"; then sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \ avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \ arm-none-eabi-binutils-cs arm-none-eabi-newlib -elif grep ID /etc/os-release | grep -q debian; then +elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then sudo apt-get update sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \ dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ @@ -38,5 +38,5 @@ fi else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo - echo "https://docs.qmk.fm/contributing.html" + echo "https://docs.qmk.fm/#/contributing" fi -- cgit v1.2.3 From 76f0b3cc70d8d1173f9145abc4d2725fd8f47302 Mon Sep 17 00:00:00 2001 From: "James D. Marble" Date: Tue, 2 Oct 2018 20:13:04 -0700 Subject: Add missing F-keys to ergodox_infinity input_club F11 and F12 were in the ascii art, but not the actual mapping. This corrects the error. --- keyboards/ergodox_infinity/keymaps/input_club/keymap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_infinity/keymaps/input_club/keymap.c b/keyboards/ergodox_infinity/keymaps/input_club/keymap.c index e77319d2c8..45ad1f51f7 100644 --- a/keyboards/ergodox_infinity/keymaps/input_club/keymap.c +++ b/keyboards/ergodox_infinity/keymaps/input_club/keymap.c @@ -93,7 +93,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | * +-----+-----+-----+ */ - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, @@ -120,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | * +-----+-----+-----+ */ - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, -- cgit v1.2.3 From d435dabefb6b6870de2e1d2a660c0e9be8fa25e5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 3 Oct 2018 08:29:29 -0700 Subject: Keyboard: Mint60: Configurator support and readme cleanup (#4057) * Mint60: add Configurator support * Mint60: readme cleanup Fixed the imgur url so the photo shows up, and updated the links to the docs. --- keyboards/mint60/info.json | 78 ++++++++++++++++++++++++++++++++++++++++++++++ keyboards/mint60/readme.md | 4 +-- 2 files changed, 80 insertions(+), 2 deletions(-) diff --git a/keyboards/mint60/info.json b/keyboards/mint60/info.json index e69de29bb2..f03e6371b1 100644 --- a/keyboards/mint60/info.json +++ b/keyboards/mint60/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "Mint60", + "url": "", + "maintainer": "eucalyn", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":7, "y":0}, + {"label":"&", "x":8, "y":0}, + {"label":"*", "x":9, "y":0}, + {"label":"(", "x":10, "y":0}, + {"label":")", "x":11, "y":0}, + {"label":"_", "x":12, "y":0}, + {"label":"+", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":7.5, "y":1}, + {"label":"U", "x":8.5, "y":1}, + {"label":"I", "x":9.5, "y":1}, + {"label":"O", "x":10.5, "y":1}, + {"label":"P", "x":11.5, "y":1}, + {"label":"{", "x":12.5, "y":1}, + {"label":"}", "x":13.5, "y":1}, + {"label":"|", "x":14.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":7.75, "y":2}, + {"label":"J", "x":8.75, "y":2}, + {"label":"K", "x":9.75, "y":2}, + {"label":"L", "x":10.75, "y":2}, + {"label":":", "x":11.75, "y":2}, + {"label":"\"", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2}, + {"label":"Z", "x":2, "y":3}, + {"label":"X", "x":3, "y":3}, + {"label":"C", "x":4, "y":3}, + {"label":"V", "x":5, "y":3}, + {"label":"B", "x":6, "y":3}, + {"label":"N", "x":8, "y":3}, + {"label":"M", "x":9, "y":3}, + {"label":"<", "x":10, "y":3}, + {"label":">", "x":11, "y":3}, + {"label":"?", "x":12, "y":3}, + {"label":"Shift", "x":13, "y":3}, + {"label":"Up", "x":14, "y":3}, + {"label":"Fn", "x":15, "y":3}, + {"label":"Esc", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4, "w":1.25}, + {"label":"Win", "x":2.25, "y":4, "w":1.25}, + {"label":"Alt", "x":3.5, "y":4, "w":1.25}, + {"label":"Space", "x":4.75, "y":4, "w":2.25}, + {"label":"Space", "x":7.75, "y":4, "w":2.75}, + {"label":"Win", "x":10.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":11.75, "y":4, "w":1.25}, + {"label":"Left", "x":13, "y":4}, + {"label":"Down", "x":14, "y":4}, + {"label":"Right", "x":15, "y":4}] + } + } +} diff --git a/keyboards/mint60/readme.md b/keyboards/mint60/readme.md index b8ae720f5b..1824c682f8 100644 --- a/keyboards/mint60/readme.md +++ b/keyboards/mint60/readme.md @@ -1,6 +1,6 @@ # Mint60 -![Mint60](https://imgur.com/a/8xnTS4U) +![Mint60](https://i.imgur.com/suOE8HN.jpg) A short description of the keyboard/project @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make mint60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From b9c503085191ea1fb0f9d80c7d083e316e9f0f7c Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 3 Oct 2018 08:30:13 -0700 Subject: Keyboard: KBD4x: corrected info.json file (#4056) The `info.json` file for the KBD4x was invalid due to a couple of extra commas. --- keyboards/kbd4x/info.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/kbd4x/info.json b/keyboards/kbd4x/info.json index 78d011e2c7..f9952e7903 100644 --- a/keyboards/kbd4x/info.json +++ b/keyboards/kbd4x/info.json @@ -53,7 +53,7 @@ {"label":"/", "x":8, "y":3}, {"label":"LEFT", "x":9, "y":3}, {"label":"DOWN", "x":10, "y":3}, - {"label":"RIGHT", "x":11, "y":3}, + {"label":"RIGHT", "x":11, "y":3} ] }, "LAYOUT_ortho_4x12": { @@ -105,7 +105,7 @@ {"label":"/", "x":8, "y":3}, {"label":"LEFT", "x":9, "y":3}, {"label":"DOWN", "x":10, "y":3}, - {"label":"RIGHT", "x":11, "y":3}, + {"label":"RIGHT", "x":11, "y":3} ] } } -- cgit v1.2.3 From b1c2849500df4d8fedeaf3a4d01bec1a15cf4cd0 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Wed, 3 Oct 2018 16:30:44 +0100 Subject: Keymap: Add RGB matrix keypress effects and reduce firmware size. (#4055) --- keyboards/model01/keymaps/dshields/config.h | 1 + keyboards/model01/keymaps/dshields/rules.mk | 2 ++ keyboards/planck/keymaps/dshields/config.h | 1 + keyboards/planck/keymaps/dshields/rules.mk | 1 + 4 files changed, 5 insertions(+) diff --git a/keyboards/model01/keymaps/dshields/config.h b/keyboards/model01/keymaps/dshields/config.h index 4de2d3cbb3..1c78217f2f 100644 --- a/keyboards/model01/keymaps/dshields/config.h +++ b/keyboards/model01/keymaps/dshields/config.h @@ -1,5 +1,6 @@ #pragma once +#define RGB_MATRIX_KEYPRESSES #define RGB_DIGITAL_RAIN_DROPS 18 #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 diff --git a/keyboards/model01/keymaps/dshields/rules.mk b/keyboards/model01/keymaps/dshields/rules.mk index 6c605daecf..d3754cc1fc 100644 --- a/keyboards/model01/keymaps/dshields/rules.mk +++ b/keyboards/model01/keymaps/dshields/rules.mk @@ -1 +1,3 @@ MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = no +CONSOLE_ENABLE = no diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index 512e2fbc64..63434f60ca 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -1,5 +1,6 @@ #pragma once +#define RGB_MATRIX_KEYPRESSES #define RGB_DIGITAL_RAIN_DROPS 24 #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 8799c78f06..033e3c9c4e 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -5,6 +5,7 @@ endif MOUSEKEY_ENABLE = yes # Mouse keys(+4700) COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) +EXTRAKEY_ENABLE = no SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend API_SYSEX_ENABLE = no -- cgit v1.2.3 From 4d1d1b7196e4aec3f91cc17856aa15c9a92d6ace Mon Sep 17 00:00:00 2001 From: Jumail Mundekkat Date: Thu, 4 Oct 2018 01:32:56 +1000 Subject: Keyboard: Added JN68M keyboard to handwired (#4053) --- keyboards/handwired/jn68m/config.h | 54 +++++++++++++++ keyboards/handwired/jn68m/info.json | 16 +++++ keyboards/handwired/jn68m/jn68m.c | 37 ++++++++++ keyboards/handwired/jn68m/jn68m.h | 49 +++++++++++++ keyboards/handwired/jn68m/keymaps/default/config.h | 19 +++++ keyboards/handwired/jn68m/keymaps/default/keymap.c | 75 ++++++++++++++++++++ keyboards/handwired/jn68m/readme.md | 14 ++++ keyboards/handwired/jn68m/rules.mk | 81 ++++++++++++++++++++++ 8 files changed, 345 insertions(+) create mode 100644 keyboards/handwired/jn68m/config.h create mode 100644 keyboards/handwired/jn68m/info.json create mode 100644 keyboards/handwired/jn68m/jn68m.c create mode 100644 keyboards/handwired/jn68m/jn68m.h create mode 100644 keyboards/handwired/jn68m/keymaps/default/config.h create mode 100644 keyboards/handwired/jn68m/keymaps/default/keymap.c create mode 100644 keyboards/handwired/jn68m/readme.md create mode 100644 keyboards/handwired/jn68m/rules.mk diff --git a/keyboards/handwired/jn68m/config.h b/keyboards/handwired/jn68m/config.h new file mode 100644 index 0000000000..22ab1158d7 --- /dev/null +++ b/keyboards/handwired/jn68m/config.h @@ -0,0 +1,54 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xC714 +#define PRODUCT_ID 0x1010 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MxBlue +#define PRODUCT JN68M +#define DESCRIPTION Custom PCB for VA68M + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, D5, D3, D2 } +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7, C6, B6, B5, B4, D7, D6, D4, E6, D1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/handwired/jn68m/info.json b/keyboards/handwired/jn68m/info.json new file mode 100644 index 0000000000..ce95563e96 --- /dev/null +++ b/keyboards/handwired/jn68m/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "JN68M", + "url": "", + "maintainer": "qmk", + "bootloader": "atmel-dfu", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] + }, + "LAYOUT_splitbs": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4, "w":1.25}, {"x":11.25, "y":4, "w":1.25}, {"x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] + } + } +} diff --git a/keyboards/handwired/jn68m/jn68m.c b/keyboards/handwired/jn68m/jn68m.c new file mode 100644 index 0000000000..b61b17aa9b --- /dev/null +++ b/keyboards/handwired/jn68m/jn68m.c @@ -0,0 +1,37 @@ +/* Copyright 2018 Jumail Mundekkat / MxBlue + * + * 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 . + */ +#include "jn68m.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} diff --git a/keyboards/handwired/jn68m/jn68m.h b/keyboards/handwired/jn68m/jn68m.h new file mode 100644 index 0000000000..d47f9f6c9c --- /dev/null +++ b/keyboards/handwired/jn68m/jn68m.h @@ -0,0 +1,49 @@ +/* Copyright 2018 Jumail Mundekkat / MxBlue + * + * 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 . + */ +#ifndef JN68M_H +#define JN68M_H + +#include "quantum.h" + +#define LAYOUT( \ + K1 , K2 , K3 , K4 , K5 , K6 , K7 , K8 , K9 , K10, K11, K12, K13, K14, K67, K68,\ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K69, K70,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, \ + K43, K44, K45, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, \ + K56, K57, K58, K59, K60, K61, K63, K64, K65, K66 \ +) { \ + { K1 , K2 , K3 , K4 , K5 , K6 , K7 , K8 , K9 , K10, K11, K12, K13, K14, K67, K68 }, \ + { K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K69, K70 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42,KC_NO,KC_NO,KC_NO}, \ + { K43, K44, K45, K46, K47, K48, K49, K50, K51, K52,KC_NO,K53, K54,KC_NO,K55,KC_NO}, \ + { K56, K57, K58,KC_NO,KC_NO,K59,KC_NO,KC_NO,KC_NO,K60,KC_NO,K61, K63, K64, K65, K66} \ +} + +#define LAYOUT_splitbs( \ + K1 , K2 , K3 , K4 , K5 , K6 , K7 , K8 , K9 , K10, K11, K12, K13, K14, K15, K67, K68,\ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K69, K70,\ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, \ + K43, K44, K45, K46, K47, K48, K49, K50, K51, K52, K53, K54, K55, \ + K56, K57, K58, K59, K60, K61, K63, K64, K65, K66 \ +) { \ + { K1 , K2 , K3 , K4 , K5 , K6 , K7 , K8 , K9 , K10, K11, K12, K13, K14, K67, K68 }, \ + { K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K69, K70 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K15,KC_NO,KC_NO}, \ + { K43, K44, K45, K46, K47, K48, K49, K50, K51, K52,KC_NO,K53, K54,KC_NO,K55,KC_NO}, \ + { K56, K57, K58,KC_NO,KC_NO,K59,KC_NO,KC_NO,KC_NO,K60,KC_NO,K61, K63, K64, K65, K66} \ +} + +#endif diff --git a/keyboards/handwired/jn68m/keymaps/default/config.h b/keyboards/handwired/jn68m/keymaps/default/config.h new file mode 100644 index 0000000000..4496c59100 --- /dev/null +++ b/keyboards/handwired/jn68m/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 REPLACE_WITH_YOUR_NAME + * + * 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 + +// place overrides here diff --git a/keyboards/handwired/jn68m/keymaps/default/keymap.c b/keyboards/handwired/jn68m/keymaps/default/keymap.c new file mode 100644 index 0000000000..98eede94cb --- /dev/null +++ b/keyboards/handwired/jn68m/keymaps/default/keymap.c @@ -0,0 +1,75 @@ +/* Copyright 2018 Jumail Mundekkat / MxBlue + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_GESC, 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_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_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_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, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ), + + [1] = LAYOUT( + KC_GRV, 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_DEL, KC_PSCR, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, + RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_APP, KC_TRNS, KC_TRNS, KC_TRNS + ), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/jn68m/readme.md b/keyboards/handwired/jn68m/readme.md new file mode 100644 index 0000000000..f219564cae --- /dev/null +++ b/keyboards/handwired/jn68m/readme.md @@ -0,0 +1,14 @@ +# JN68M + +A custom replacement PCB for the VA68M and a birthday present for a mate. +PCB designed by /u/Xelus22 + +Keyboard Maintainer: [MxBlue](https://github.com/mxblu) +Hardware Supported: ATMega32u4 +Hardware Availability: Unavailable unless you happen to be Justin ;) + +Make example for this keyboard (after setting up your build environment): + + make handwired/jn68m: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/handwired/jn68m/rules.mk b/keyboards/handwired/jn68m/rules.mk new file mode 100644 index 0000000000..42d85ada17 --- /dev/null +++ b/keyboards/handwired/jn68m/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # 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) -- cgit v1.2.3 From 404db1d06fa9c0dd25fff3bfa1b2ebed7273a8fc Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 3 Oct 2018 08:33:14 -0700 Subject: handwired/ibm122m: refactor and Configurator support (#4054) * handwired/ibm122m: refactor Refactored layout macro and keymaps to more closely resemble the keyboard's physical layout. * handwired/ibm122m: add Configurator support --- keyboards/handwired/ibm122m/ibm122m.h | 15 +- keyboards/handwired/ibm122m/info.json | 136 +++++++++ .../handwired/ibm122m/keymaps/default/keymap.c | 22 +- .../handwired/ibm122m/keymaps/lukaus/keymap.c | 309 ++++++++++----------- 4 files changed, 308 insertions(+), 174 deletions(-) diff --git a/keyboards/handwired/ibm122m/ibm122m.h b/keyboards/handwired/ibm122m/ibm122m.h index 93e18b4e60..a52bf4bc44 100644 --- a/keyboards/handwired/ibm122m/ibm122m.h +++ b/keyboards/handwired/ibm122m/ibm122m.h @@ -21,14 +21,13 @@ // The first section contains all of the arguments // The second converts the arguments into a two-dimensional array #define LAYOUT( \ - k09, k19, k1A, k29, k39, k3A, k49, k59, k5A, k69, k79, k7A, k3G, k3H, k2G, \ - k0A, k0B, k1B, k2A, k2B, k3B, k4A, k4B, k5B, k6A, k6B, k7B, k1G, k5G, k4G, \ -k31, k32, k34, k24, k25, k26, k27, k37, k38, k28, k2C, k2D, k2E, k3E, k3C, k3F, k2F, k2H, k2I, k20, \ -k21, k41, k42, k44, k45, k46, k47, k57, k58, k48, k4C, k4D, k4E, k5E, k5C, k6F, k4F, k4H, k4I, k40, \ -k51, k52, k62, k14, k15, k16, k17, k07, k08, k18, k1C, k1D, k1E, k0E, k6E, k1F, k1H, k1I, k10, \ -k11, k12, k73, k74, k64, k65, k66, k67, k77, k78, k68, k6C, k6D, k7E, k63, k0G, k61, k6H, k6I, k7J, \ -k02, k01, k00, k70, k71, k03, k72, k60, k0J, k1J, k7H, k7I, \ - k0F \ + k09, k19, k1A, k29, k39, k3A, k49, k59, k5A, k69, k79, k7A, \ + k0A, k0B, k1B, k2A, k2B, k3B, k4A, k4B, k5B, k6A, k6B, k7B, \ + k31, k32, k34, k24, k25, k26, k27, k37, k38, k28, k2C, k2D, k2E, k3E, k3C, k3F, k3G, k3H, k2G, k2F, k2H, k2I, k20, \ + k21, k41, k42, k44, k45, k46, k47, k57, k58, k48, k4C, k4D, k4E, k5E, k5C, k6F, k1G, k5G, k4G, k4F, k4H, k4I, k40, \ + k51, k52, k62, k14, k15, k16, k17, k07, k08, k18, k1C, k1D, k1E, k0E, k6E, k0G, k1F, k1H, k1I, k10, \ + k11, k12, k73, k74, k64, k65, k66, k67, k77, k78, k68, k6C, k6D, k7E, k63, k60, k0J, k1J, k61, k6H, k6I, k7J, \ + k02, k01, k00, k70, k71, k03, k72, k0F, k7H, k7I \ ) \ { \ { k00, k01, k02, k03, KC_NO, KC_NO, KC_NO, k07, k08, k09, k0A, k0B, KC_NO, KC_NO, k0E, k0F, k0G, KC_NO, KC_NO, k0J }, \ diff --git a/keyboards/handwired/ibm122m/info.json b/keyboards/handwired/ibm122m/info.json index e69de29bb2..b9ce9e8f83 100644 --- a/keyboards/handwired/ibm122m/info.json +++ b/keyboards/handwired/ibm122m/info.json @@ -0,0 +1,136 @@ +{ + "keyboard_name": "IBM Model M 122-key", + "url": "", + "maintainer": "qmk", + "bootloader": "", + "width": 24.75, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F13", "x":3.25, "y":0}, + {"label":"F14", "x":4.25, "y":0}, + {"label":"F15", "x":5.25, "y":0}, + {"label":"F16", "x":6.25, "y":0}, + {"label":"F17", "x":7.25, "y":0}, + {"label":"F18", "x":8.25, "y":0}, + {"label":"F19", "x":9.25, "y":0}, + {"label":"F20", "x":10.25, "y":0}, + {"label":"F21", "x":11.25, "y":0}, + {"label":"F22", "x":12.25, "y":0}, + {"label":"F23", "x":13.25, "y":0}, + {"label":"F24", "x":14.25, "y":0}, + {"label":"F1", "x":3.25, "y":1}, + {"label":"F2", "x":4.25, "y":1}, + {"label":"F3", "x":5.25, "y":1}, + {"label":"F4", "x":6.25, "y":1}, + {"label":"F5", "x":7.25, "y":1}, + {"label":"F6", "x":8.25, "y":1}, + {"label":"F7", "x":9.25, "y":1}, + {"label":"F8", "x":10.25, "y":1}, + {"label":"F9", "x":11.25, "y":1}, + {"label":"F10", "x":12.25, "y":1}, + {"label":"F11", "x":13.25, "y":1}, + {"label":"F12", "x":14.25, "y":1}, + {"label":"Esc", "x":0, "y":3}, + {"x":1, "y":3}, + {"label":"`", "x":2.25, "y":3}, + {"label":"1", "x":3.25, "y":3}, + {"label":"2", "x":4.25, "y":3}, + {"label":"3", "x":5.25, "y":3}, + {"label":"4", "x":6.25, "y":3}, + {"label":"5", "x":7.25, "y":3}, + {"label":"6", "x":8.25, "y":3}, + {"label":"7", "x":9.25, "y":3}, + {"label":"8", "x":10.25, "y":3}, + {"label":"9", "x":11.25, "y":3}, + {"label":"0", "x":12.25, "y":3}, + {"label":"-", "x":13.25, "y":3}, + {"label":"=", "x":14.25, "y":3}, + {"label":"Backspace", "x":15.25, "y":3, "w":2}, + {"label":"Insert", "x":17.5, "y":3}, + {"label":"Home", "x":18.5, "y":3}, + {"label":"Page Up", "x":19.5, "y":3}, + {"label":"Num Lock", "x":20.75, "y":3}, + {"label":"/", "x":21.75, "y":3}, + {"label":"*", "x":22.75, "y":3}, + {"label":"-", "x":23.75, "y":3}, + {"x":0, "y":4}, + {"x":1, "y":4}, + {"label":"Tab", "x":2.25, "y":4, "w":1.5}, + {"label":"Q", "x":3.75, "y":4}, + {"label":"W", "x":4.75, "y":4}, + {"label":"E", "x":5.75, "y":4}, + {"label":"R", "x":6.75, "y":4}, + {"label":"T", "x":7.75, "y":4}, + {"label":"Y", "x":8.75, "y":4}, + {"label":"U", "x":9.75, "y":4}, + {"label":"I", "x":10.75, "y":4}, + {"label":"O", "x":11.75, "y":4}, + {"label":"P", "x":12.75, "y":4}, + {"label":"[", "x":13.75, "y":4}, + {"label":"]", "x":14.75, "y":4}, + {"label":"Enter", "x":16, "y":4, "w":1.25, "h":2}, + {"label":"Delete", "x":17.5, "y":4}, + {"label":"End", "x":18.5, "y":4}, + {"label":"Page Down", "x":19.5, "y":4}, + {"label":"7", "x":20.75, "y":4}, + {"label":"8", "x":21.75, "y":4}, + {"label":"9", "x":22.75, "y":4}, + {"label":"+", "x":23.75, "y":4}, + {"x":0, "y":5}, + {"x":1, "y":5}, + {"label":"Caps Lock", "x":2.25, "y":5, "w":1.75}, + {"label":"A", "x":4, "y":5}, + {"label":"S", "x":5, "y":5}, + {"label":"D", "x":6, "y":5}, + {"label":"F", "x":7, "y":5}, + {"label":"G", "x":8, "y":5}, + {"label":"H", "x":9, "y":5}, + {"label":"J", "x":10, "y":5}, + {"label":"K", "x":11, "y":5}, + {"label":"L", "x":12, "y":5}, + {"label":";", "x":13, "y":5}, + {"label":"'", "x":14, "y":5}, + {"label":"#", "x":15, "y":5}, + {"label":"Up", "x":18.5, "y":5}, + {"label":"4", "x":20.75, "y":5}, + {"label":"5", "x":21.75, "y":5}, + {"label":"6", "x":22.75, "y":5}, + {"x":23.75, "y":5}, + {"x":0, "y":6}, + {"x":1, "y":6}, + {"label":"Shift", "x":2.25, "y":6, "w":1.25}, + {"label":"\\", "x":3.5, "y":6}, + {"label":"Z", "x":4.5, "y":6}, + {"label":"X", "x":5.5, "y":6}, + {"label":"C", "x":6.5, "y":6}, + {"label":"V", "x":7.5, "y":6}, + {"label":"B", "x":8.5, "y":6}, + {"label":"N", "x":9.5, "y":6}, + {"label":"M", "x":10.5, "y":6}, + {"label":",", "x":11.5, "y":6}, + {"label":".", "x":12.5, "y":6}, + {"label":"/", "x":13.5, "y":6}, + {"label":"Shift", "x":14.5, "y":6, "w":2.75}, + {"label":"Left", "x":17.5, "y":6}, + {"x":18.5, "y":6}, + {"label":"Right", "x":19.5, "y":6}, + {"label":"1", "x":20.75, "y":6}, + {"label":"2", "x":21.75, "y":6}, + {"label":"3", "x":22.75, "y":6}, + {"label":"Enter", "x":23.75, "y":6, "h":2}, + {"x":0, "y":7}, + {"x":1, "y":7}, + {"label":"Ctrl", "x":2.25, "y":7, "w":1.5}, + {"label":"Alt", "x":4.75, "y":7, "w":1.5}, + {"x":6.25, "y":7, "w":7}, + {"label":"AltGr", "x":13.25, "y":7, "w":1.5}, + {"label":"Ctrl", "x":15.75, "y":7, "w":1.5}, + {"label":"Down", "x":18.5, "y":7}, + {"label":"0", "x":20.75, "y":7, "w":2}, + {"label":".", "x":22.75, "y":7} + ] + } + } +} diff --git a/keyboards/handwired/ibm122m/keymaps/default/keymap.c b/keyboards/handwired/ibm122m/keymaps/default/keymap.c index 633df106e9..fc383498a1 100644 --- a/keyboards/handwired/ibm122m/keymaps/default/keymap.c +++ b/keyboards/handwired/ibm122m/keymaps/default/keymap.c @@ -16,16 +16,16 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// Original Layer -[0] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -KC_ESC, KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -KC_NO, KC_NO, 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, -KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, -KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, -KC_NO, KC_NO, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_NO, KC_RIGHT,KC_P0, KC_PDOT, - KC_DOWN), + // Original Layer + [0] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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_ESC, KC_NO, 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_NO, KC_NO, 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_ENT, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_NO, KC_NO, 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_BSLS, KC_UP, KC_P4, KC_P5, KC_P6, KC_BSPC, + KC_NO, KC_NO, 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_LEFT, KC_NO, KC_RIGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_NO, KC_NO, KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_DOWN, KC_P0, KC_PDOT + ), }; void matrix_init_user(void) { @@ -37,7 +37,7 @@ void matrix_scan_user(void) { } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - + return true; } diff --git a/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c index 02b69bacf0..9cd58c0ec9 100644 --- a/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c +++ b/keyboards/handwired/ibm122m/keymaps/lukaus/keymap.c @@ -16,7 +16,7 @@ #include QMK_KEYBOARD_H enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, + PLACEHOLDER = SAFE_RANGE, DVP_ESC, // Grave escape basically i think DVP_AMPR, @@ -37,105 +37,104 @@ enum custom_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -// Programmer's Dvorak -[0] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, -KC_NO, KC_NO, MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_P4, KC_P5, KC_P6, MO(4), -LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_ESC, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, -LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_P0, KC_PDOT, - KC_DOWN -), - -// Qwerty layer + function -[1] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -KC_ESC, TO(0), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -KC_NO, KC_NO, 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, -KC_NO, KC_NO, MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, -KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, -KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT, - KC_DOWN -), -// Orirginal Layer -[2] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -KC_ESC, TO(1), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -KC_NO, TO(0), 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_ENTER, KC_P7, KC_P8, KC_P9, KC_PPLS, -KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_P4, KC_P5, KC_P6, KC_BSPC, -KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, -KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT,KC_P0, KC_PDOT, - KC_DOWN -), - -// Function Layer -[3] = LAYOUT( - 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_INS, KC_HOME, KC_PGUP, - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_DEL, KC_END, KC_PGDN, -MU_TOG, KC_NO, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -MU_MOD, KC_NO, KC_TAB, KC_NO, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, KC_NO, KC_PGUP, KC_DEL, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS, -KC_NO, KC_NO, KC_TRNS, KC_NO, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_SCOLON, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, -KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, -KC_NO, KC_NO, KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_CAPS, KC_LEFT, KC_WH_D, KC_RIGHT,LSFT(KC_A), KC_PDOT, - KC_DOWN -), -// Literally just the numpad is different -[4] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -KC_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_NO, KC_NO, KC_NO, KC_NO, -KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, -KC_NO, KC_NO, TO(0), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_MS_L, KC_NO, KC_MS_R, KC_TRNS, -LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_NO, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, KC_GT, KC_MS_D, KC_GT, KC_PENT, -LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_BTN3, KC_RIGHT, KC_BTN1, KC_PDOT, - KC_DOWN -), -/* -[4] = LAYOUT( - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_INS, KC_HOME, KC_PGUP, - 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_DEL, KC_END, KC_PGDN, -MU_TOG, TO(0), KC_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, -MU_MOD, KC_NO, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_NO, KC_NO, KC_NO, KC_PPLS, -KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_QUOT, KC_BSLS, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, -KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, -KC_NO, KC_LGUI, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_LEFT, KC_WH_D, KC_RIGHT, LSFT(KC_A), KC_PDOT, - KC_DOWN -),*/ -/*[0] = LAYOUT( - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_NO,TO(1),KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, - KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, TO(2),KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, - KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, - KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_BSPC,KC_4,KC_4,KC_4, KC_4, - KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, - KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, - KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, - KC_8, KC_SPC,KC_8,KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, TO(1) - -), -[1] = LAYOUT( - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, TO(0),KC_NO,KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, TO(2),KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_BSPC,KC_Q,KC_R,KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, - KC_A, KC_SPC,KC_C,KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, TO(0) -), -[2] = LAYOUT( - KC_LCTRL, KC_LALT, KC_C, KC_RALT, KC_E, KC_F, KC_G, KC_G, KC_H, KC_J, TO(0), TO(1), KC_M, KC_N, KC_QUOT, KC_DOWN, KC_UP, KC_R, KC_S, KC_ENTER, - KC_PPLS, KC_B, KC_C, KC_D, KC_A, KC_S, KC_D, KC_F, KC_J, KC_J, KC_K, KC_NO, KC_K, KC_L, KC_SCOLON, KC_P4, KC_DEL, KC_P5, KC_P6, KC_RIGHT, - KC_PMNS, KC_1, KC_C, KC_D, KC_1, KC_2, KC_3, KC_4, KC_7, KC_J, KC_K, KC_L, KC_8, KC_9, KC_0, KC_NLCK, KC_PGUP,KC_PSLS, KC_PAST, KC_T, - KC_A, KC_ESC, TO(0),KC_D, KC_GRV, KC_F, KC_G, KC_5, KC_6, KC_J, KC_K, KC_L, KC_EQL, KC_N, KC_MINUS, KC_BSPC, KC_INS, KC_HOME, KC_S, KC_T, - KC_PPLS, KC_NO, KC_TAB, KC_D, KC_Q, KC_W, KC_E, KC_R, KC_U, KC_J, KC_K, KC_L, KC_I, KC_O, KC_P, KC_P7, KC_PGDN,KC_P8, KC_P9, KC_T, - KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_T, KC_Y, KC_J, KC_K, KC_L, KC_RBRC, KC_N, KC_LBRC, KC_P, KC_END, KC_R, KC_S, KC_T, - KC_LEFT, KC_P1, KC_CAPS, KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_J, KC_K, KC_L, KC_COMMA, KC_DOT, KC_BSLS, KC_PENT, KC_Q, KC_P2, KC_P3, KC_T, - KC_LGUI, KC_SPACE, KC_RCTRL, KC_LSHIFT, KC_E, KC_F, KC_G, KC_B, KC_N, KC_J, KC_K, KC_L, KC_M, KC_N, KC_SLSH, KC_P, KC_Q, KC_P0, KC_PDOT, KC_KP_ENTER + // Programmer's Dvorak + [0] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_NO, KC_NO, MO(3), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_UP, KC_P4, KC_P5, KC_P6, MO(4), + LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_ESC, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_LEFT, KC_BTN3, KC_RIGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_DOWN, KC_P0, KC_PDOT + ), + + // Qwerty layer + function + [1] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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_ESC, TO(0), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_NO, KC_NO, 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_ENTER, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_NO, KC_NO, MO(3), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_UP, KC_P4, KC_P5, KC_P6, KC_BSPC, + KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_LEFT, KC_WH_D, KC_RIGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_DOWN, KC_P0, KC_PDOT + ), + + // Orirginal Layer + [2] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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_ESC, TO(1), KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_NO, TO(0), 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_ENTER, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_NO, KC_NO, KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_BSLS, KC_UP, KC_P4, KC_P5, KC_P6, KC_BSPC, + KC_NO, KC_NO, KC_LSHIFT,KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_LEFT, KC_WH_D, KC_RIGHT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_NO, KC_LALT,KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_DOWN, KC_P0, KC_PDOT + ), + + // Function Layer + [3] = LAYOUT( + 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_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + MU_TOG, KC_NO, KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + MU_MOD, KC_NO, KC_TAB, KC_NO, KC_MEDIA_PREV_TRACK, KC_MEDIA_PLAY_PAUSE, KC_MEDIA_NEXT_TRACK, KC_NO, KC_NO, KC_PGUP, KC_DEL, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_DEL, KC_END, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_PPLS, + KC_NO, KC_NO, KC_TRNS, KC_NO, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_SCOLON, KC_QUOT, KC_BSLS, KC_UP, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, + KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_LEFT, KC_WH_D, KC_RIGHT, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, + KC_NO, KC_NO, KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_CAPS, KC_DOWN, LSFT(KC_A), KC_PDOT + ), + + // Literally just the numpad is different + [4] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + 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_ESC, TO(1), DVP_ESC, DVP_AMPR, DVP_LBRACKET, DVP_LCBR, DVP_RCBR, DVP_LPRN, DVP_EQUAL,DVP_ASTERISK, DVP_RPRN, DVP_PLUS, DVP_RBRACKET, DVP_EXLM, DVP_HASH, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, TO(2), KC_TAB, KC_SCOLON,KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH, DVP_AT, KC_ENTER, KC_DEL, KC_END, KC_PGDN, KC_BTN1, KC_MS_U, KC_BTN2, KC_NO, + KC_NO, KC_NO, TO(0), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINUS, KC_BSLS, KC_UP, KC_MS_L, KC_NO, KC_MS_R, KC_TRNS, + LCTL(KC_F), KC_LALT, KC_LSHIFT,KC_NO, KC_QUOT, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_LEFT, KC_BTN3, KC_RIGHT, KC_GT, KC_MS_D, KC_GT, KC_PENT, + LCTL(KC_C), LCTL(KC_V), KC_LCTRL, KC_LGUI, KC_SPC, KC_RALT, KC_RCTRL, KC_DOWN, KC_BTN1, KC_PDOT + + ), + + /* + [4] = LAYOUT( + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, + MU_TOG, TO(0), KC_DLR, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + MU_MOD, KC_NO, KC_TAB, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LBRC, KC_RBRC,KC_ENTER, KC_DEL, KC_END, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_PPLS, + KC_NO, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_QUOT, KC_BSLS, KC_UP, LSFT(KC_E), LSFT(KC_F), KC_NO, KC_BSPC, + KC_NO, KC_LALT, KC_LSHIFT,KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_COMMA, KC_DOT, KC_SLSH, KC_RSFT, KC_LEFT, KC_WH_D, KC_RIGHT, LSFT(KC_B), LSFT(KC_C), LSFT(KC_D), KC_PENT, + KC_NO, KC_LGUI, KC_LCTRL, KC_LALT, KC_SPC, KC_RALT, KC_RCTRL, KC_DOWN, LSFT(KC_A), KC_PDOT + ),*/ + /*[0] = LAYOUT( + KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_NO,TO(1),KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, + KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, TO(2),KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, KC_2, + KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, KC_3, + KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_4, KC_BSPC,KC_4,KC_4,KC_4, KC_4, + KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, KC_5, + KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, KC_6, + KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, KC_7, + KC_8, KC_SPC,KC_8,KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, KC_8, TO(1) + + ), + [1] = LAYOUT( + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, TO(0),KC_NO,KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, TO(2),KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_BSPC,KC_Q,KC_R,KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, KC_T, + KC_A, KC_SPC,KC_C,KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, KC_P, KC_Q, KC_R, KC_S, TO(0) + ), + [2] = LAYOUT( + KC_LCTRL, KC_LALT, KC_C, KC_RALT, KC_E, KC_F, KC_G, KC_G, KC_H, KC_J, TO(0), TO(1), KC_M, KC_N, KC_QUOT, KC_DOWN, KC_UP, KC_R, KC_S, KC_ENTER, + KC_PPLS, KC_B, KC_C, KC_D, KC_A, KC_S, KC_D, KC_F, KC_J, KC_J, KC_K, KC_NO, KC_K, KC_L, KC_SCOLON, KC_P4, KC_DEL, KC_P5, KC_P6, KC_RIGHT, + KC_PMNS, KC_1, KC_C, KC_D, KC_1, KC_2, KC_3, KC_4, KC_7, KC_J, KC_K, KC_L, KC_8, KC_9, KC_0, KC_NLCK, KC_PGUP,KC_PSLS, KC_PAST, KC_T, + KC_A, KC_ESC, TO(0),KC_D, KC_GRV, KC_F, KC_G, KC_5, KC_6, KC_J, KC_K, KC_L, KC_EQL, KC_N, KC_MINUS, KC_BSPC, KC_INS, KC_HOME, KC_S, KC_T, + KC_PPLS, KC_NO, KC_TAB, KC_D, KC_Q, KC_W, KC_E, KC_R, KC_U, KC_J, KC_K, KC_L, KC_I, KC_O, KC_P, KC_P7, KC_PGDN,KC_P8, KC_P9, KC_T, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_T, KC_Y, KC_J, KC_K, KC_L, KC_RBRC, KC_N, KC_LBRC, KC_P, KC_END, KC_R, KC_S, KC_T, + KC_LEFT, KC_P1, KC_CAPS, KC_RSFT, KC_Z, KC_X, KC_C, KC_V, KC_M, KC_J, KC_K, KC_L, KC_COMMA, KC_DOT, KC_BSLS, KC_PENT, KC_Q, KC_P2, KC_P3, KC_T, + KC_LGUI, KC_SPACE, KC_RCTRL, KC_LSHIFT, KC_E, KC_F, KC_G, KC_B, KC_N, KC_J, KC_K, KC_L, KC_M, KC_N, KC_SLSH, KC_P, KC_Q, KC_P0, KC_PDOT, KC_KP_ENTER + ),*/ }; const uint16_t PROGMEM fn_actions[] = { @@ -166,7 +165,7 @@ void matrix_scan_user(void) { } -bool left_shift_down = false; +bool left_shift_down = false; bool right_shift_down = false; bool process_record_user(uint16_t keycode, keyrecord_t *record) { @@ -196,11 +195,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } break; - - + + case DVP_ESC: if (left_shift_down || right_shift_down) - { + { if(record->event.pressed) SEND_STRING("~"); return false; @@ -214,7 +213,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { break; case DVP_AMPR: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -228,10 +227,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("&"); return false; } - break; - + break; + case DVP_LBRACKET: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -256,13 +255,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("["); return false; } - break; - + break; + case DVP_LCBR: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) - { + { if(left_shift_down) unregister_code(KC_LSHIFT); if(right_shift_down) @@ -270,7 +269,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_5); unregister_code(KC_5); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -284,10 +283,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("{"); return false; } - break; - + break; + case DVP_RCBR: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -298,7 +297,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_3); unregister_code(KC_3); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -312,11 +311,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("}"); return false; } - break; + break; case DVP_LPRN: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -327,7 +326,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_1); unregister_code(KC_1); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -341,10 +340,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("("); return false; } - break; -// + break; +// case DVP_AT: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -357,7 +356,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_6); unregister_code(KC_6); unregister_code(KC_LSHIFT); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -371,11 +370,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("@"); return false; } - break; + break; + - case DVP_EQUAL: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -386,7 +385,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_9); unregister_code(KC_9); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -400,10 +399,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("="); return false; } - break; - + break; + case DVP_ASTERISK: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -414,7 +413,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_0); unregister_code(KC_0); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -428,10 +427,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("*"); return false; } - break; - + break; + case DVP_RPRN: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -442,7 +441,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_2); unregister_code(KC_2); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -456,10 +455,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING(")"); return false; } - break; + break; case DVP_PLUS: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -470,7 +469,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_4); unregister_code(KC_4); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -483,10 +482,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("+"); } return false; - break; - + break; + case DVP_RBRACKET: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -497,7 +496,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_6); unregister_code(KC_6); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -510,10 +509,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("]"); } return false; - break; - + break; + case DVP_EXLM: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -524,7 +523,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_8); unregister_code(KC_8); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -537,10 +536,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("!"); } return false; - break; - + break; + case DVP_HASH: - if (left_shift_down || right_shift_down) + if (left_shift_down || right_shift_down) { if(record->event.pressed) { @@ -551,7 +550,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { register_code(KC_GRAVE); unregister_code(KC_GRAVE); - + if(left_shift_down) register_code(KC_LSHIFT); if(right_shift_down) @@ -564,7 +563,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("#"); } return false; - break; + break; case SHFT_DOT: if(record->event.pressed) SEND_STRING(">"); @@ -575,10 +574,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { SEND_STRING("<"); break; - } - - - + } + + + return true; } -- cgit v1.2.3 From 5368235f223d0537c7456cd8d36d5430f4b58312 Mon Sep 17 00:00:00 2001 From: takashiski Date: Thu, 4 Oct 2018 00:34:43 +0900 Subject: Keyboard: Add namecard keyboard (#4044) * create namecard2x4 * create default keymaps * Update README * fixed typo and func remove dont need. * update infomation on readme * update missed point * remove explicit initialize * update default keymap's readme * add my name to copyright * change keymap style to LAYOUT macro and fixed typo LAYOUT macro --- keyboards/namecard2x4/config.h | 223 ++++++++++++++++++++++++ keyboards/namecard2x4/info.json | 0 keyboards/namecard2x4/keymaps/default/config.h | 19 ++ keyboards/namecard2x4/keymaps/default/keymap.c | 60 +++++++ keyboards/namecard2x4/keymaps/default/readme.md | 9 + keyboards/namecard2x4/namecard2x4.c | 43 +++++ keyboards/namecard2x4/namecard2x4.h | 33 ++++ keyboards/namecard2x4/readme.md | 24 +++ keyboards/namecard2x4/rules.mk | 81 +++++++++ 9 files changed, 492 insertions(+) create mode 100644 keyboards/namecard2x4/config.h create mode 100644 keyboards/namecard2x4/info.json create mode 100644 keyboards/namecard2x4/keymaps/default/config.h create mode 100644 keyboards/namecard2x4/keymaps/default/keymap.c create mode 100644 keyboards/namecard2x4/keymaps/default/readme.md create mode 100644 keyboards/namecard2x4/namecard2x4.c create mode 100644 keyboards/namecard2x4/namecard2x4.h create mode 100644 keyboards/namecard2x4/readme.md create mode 100644 keyboards/namecard2x4/rules.mk diff --git a/keyboards/namecard2x4/config.h b/keyboards/namecard2x4/config.h new file mode 100644 index 0000000000..d0c26193c4 --- /dev/null +++ b/keyboards/namecard2x4/config.h @@ -0,0 +1,223 @@ +/* +Copyright 2018 takashiski + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER takashiski +#define PRODUCT namecard2x4 +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B4,B5 } +#define MATRIX_COL_PINS { E6,D7,C6,D4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define RGB_DI_PIN F4 +#define RGBLED_NUM 4 +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +//#define BACKLIGHT_PIN F4 +//#define BACKLIGHT_BREATHING +//#define BACKLIGHT_LEVELS 1 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/namecard2x4/info.json b/keyboards/namecard2x4/info.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/namecard2x4/keymaps/default/config.h b/keyboards/namecard2x4/keymaps/default/config.h new file mode 100644 index 0000000000..dbacdcce58 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 takashiski + * + * 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 + +// place overrides here diff --git a/keyboards/namecard2x4/keymaps/default/keymap.c b/keyboards/namecard2x4/keymaps/default/keymap.c new file mode 100644 index 0000000000..1a0a727fc0 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/default/keymap.c @@ -0,0 +1,60 @@ +/* Copyright 2018 takashiski + * + * 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 . + */ +#include QMK_KEYBOARD_H + +enum Layer +{ + DF, + LW, + RS +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[DF] = LAYOUT( + KC_1,KC_2,KC_3,LT(LW,KC_4), + KC_5,KC_6,KC_7,LT(RS,KC_8) + ), +[LW]= LAYOUT( + + RGB_VAD,RGB_VAI,RGB_HUI,RGB_HUD, + KC_TRNS,RGB_MOD,RGB_RMOD,KC_TRNS + ), +[RS]= LAYOUT( + + KC_MYCM,KC_MAIL,KC_VOLU,KC_MUTE, + KC_WSCH,KC_CALC,KC_VOLD,KC_TRNS + ) + +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/namecard2x4/keymaps/default/readme.md b/keyboards/namecard2x4/keymaps/default/readme.md new file mode 100644 index 0000000000..83601c9cf5 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/default/readme.md @@ -0,0 +1,9 @@ +# The default keymap for namecard2x4 + +this is test keymap. + +| 1 | 2 | 3 | 4 | +| 5 | 6 | 7 | 8 | + +if hold 4, change to Backlight settings Layer. +if hold 8, change to Windows action Layer(Open my computer, Open calculater and others). diff --git a/keyboards/namecard2x4/namecard2x4.c b/keyboards/namecard2x4/namecard2x4.c new file mode 100644 index 0000000000..349923daf8 --- /dev/null +++ b/keyboards/namecard2x4/namecard2x4.c @@ -0,0 +1,43 @@ +/* Copyright 2018 takashiski + * + * 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 . + */ +#include "namecard2x4.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/namecard2x4/namecard2x4.h b/keyboards/namecard2x4/namecard2x4.h new file mode 100644 index 0000000000..f2e27a0102 --- /dev/null +++ b/keyboards/namecard2x4/namecard2x4.h @@ -0,0 +1,33 @@ +/* Copyright 2018 takashiski + * + * 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 . + */ +#ifndef NAMECARD2X4_H +#define NAMECARD2X4_H + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. +// The following is an example using the Planck MIT layout +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13 \ +) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ +} + +#endif diff --git a/keyboards/namecard2x4/readme.md b/keyboards/namecard2x4/readme.md new file mode 100644 index 0000000000..ec98bc6736 --- /dev/null +++ b/keyboards/namecard2x4/readme.md @@ -0,0 +1,24 @@ +# namecard2x4 + +日本式名刺サイズのキーボードです(55x91mm)。 +Kailh PCB SocketとWS2812/SK6812に対応しています。 + +This keyboard is Japanese namecard size(55x91mm) keyboard. + +namecard2x4 has 8 switch and kailh PCB socket. + +![namecard2x4](https://i.imgur.com/Bi9SV9A.jpg) + +![namecard2x4 with case](https://i.imgur.com/yTv1vSz.jpg) + + + +Keyboard Maintainer: [takashiski](https://github.com/takashiski) + + +Make example for this keyboard (after setting up your build environment): + + make namecard2x4: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/namecard2x4/rules.mk b/keyboards/namecard2x4/rules.mk new file mode 100644 index 0000000000..51d2cbcb2e --- /dev/null +++ b/keyboards/namecard2x4/rules.mk @@ -0,0 +1,81 @@ +# 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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = atmel-dfu + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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) + +#UNICODEMAP_ENABLE = yes # for emoji user +#RGBLIGHT_ENABLE = yes # uncomment if you want addressable led strips -- cgit v1.2.3 From e58ea882e40eff146b9cebf9e1c99e89f25260ac Mon Sep 17 00:00:00 2001 From: Jumail Mundekkat Date: Thu, 4 Oct 2018 01:36:40 +1000 Subject: Keyboard: Added split backspace layout for the b.mini (#4051) --- keyboards/bmini/bmini.h | 18 ++++++++++++++++++ keyboards/bmini/info.json | 4 ++++ 2 files changed, 22 insertions(+) diff --git a/keyboards/bmini/bmini.h b/keyboards/bmini/bmini.h index 9a70f92046..7bdf66fd25 100644 --- a/keyboards/bmini/bmini.h +++ b/keyboards/bmini/bmini.h @@ -38,6 +38,24 @@ along with this program. If not, see . { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ } +#define LAYOUT_splitbs( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD4, KD0, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, KC_NO, KC_NO, KC_NO, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, KC_NO, KC_NO, KC_NO, KC_NO, KA2, KB2, KC_NO, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, KC_NO, KC_NO, KC_NO, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, KC_NO, KC_NO, KC_NO, KC_NO, KA4, KB4, KC4, KD4, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + #define LAYOUT_kc( \ K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, \ K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, \ diff --git a/keyboards/bmini/info.json b/keyboards/bmini/info.json index a047a3ef58..ab4d01c023 100644 --- a/keyboards/bmini/info.json +++ b/keyboards/bmini/info.json @@ -8,6 +8,10 @@ "LAYOUT": { "key_count": 84, "layout": [{"label":"K05", "x":0, "y":0}, {"label":"K25", "x":1, "y":0}, {"label":"K35", "x":2, "y":0}, {"label":"K45", "x":3, "y":0}, {"label":"K55", "x":4, "y":0}, {"label":"K06", "x":5, "y":0}, {"label":"KA6", "x":6, "y":0}, {"label":"KA7", "x":7, "y":0}, {"label":"K07", "x":8, "y":0}, {"label":"KB5", "x":9, "y":0}, {"label":"KC5", "x":10, "y":0}, {"label":"KD5", "x":11, "y":0}, {"label":"KE5", "x":12, "y":0}, {"label":"KD1", "x":13, "y":0}, {"label":"KE1", "x":14, "y":0}, {"label":"KE2", "x":15, "y":0}, {"label":"K04", "x":0, "y":1}, {"label":"K14", "x":1, "y":1}, {"label":"K24", "x":2, "y":1}, {"label":"K34", "x":3, "y":1}, {"label":"K44", "x":4, "y":1}, {"label":"K54", "x":5, "y":1}, {"label":"K16", "x":6, "y":1}, {"label":"KB6", "x":7, "y":1}, {"label":"KB7", "x":8, "y":1}, {"label":"K17", "x":9, "y":1}, {"label":"KA4", "x":10, "y":1}, {"label":"KB4", "x":11, "y":1}, {"label":"KC4", "x":12, "y":1}, {"label":"KE4", "x":13, "y":1, "w":2}, {"label":"KD0", "x":15, "y":1}, {"label":"K03", "x":0, "y":2, "w":1.5}, {"label":"K13", "x":1.5, "y":2}, {"label":"K23", "x":2.5, "y":2}, {"label":"K33", "x":3.5, "y":2}, {"label":"K43", "x":4.5, "y":2}, {"label":"K53", "x":5.5, "y":2}, {"label":"K26", "x":6.5, "y":2}, {"label":"KC6", "x":7.5, "y":2}, {"label":"KC7", "x":8.5, "y":2}, {"label":"K27", "x":9.5, "y":2}, {"label":"KA3", "x":10.5, "y":2}, {"label":"KB3", "x":11.5, "y":2}, {"label":"KC3", "x":12.5, "y":2}, {"label":"KD3", "x":13.5, "y":2, "w":1.5}, {"label":"K67", "x":15, "y":2}, {"label":"K02", "x":0, "y":3, "w":1.75}, {"label":"K12", "x":1.75, "y":3}, {"label":"K22", "x":2.75, "y":3}, {"label":"K32", "x":3.75, "y":3}, {"label":"K42", "x":4.75, "y":3}, {"label":"K52", "x":5.75, "y":3}, {"label":"K36", "x":6.75, "y":3}, {"label":"KD6", "x":7.75, "y":3}, {"label":"KD7", "x":8.75, "y":3}, {"label":"K37", "x":9.75, "y":3}, {"label":"KA2", "x":10.75, "y":3}, {"label":"KB2", "x":11.75, "y":3}, {"label":"KD2", "x":12.75, "y":3, "w":2.25}, {"label":"KE0", "x":15, "y":3}, {"label":"K01", "x":0, "y":4, "w":2.25}, {"label":"K11", "x":2.25, "y":4}, {"label":"K21", "x":3.25, "y":4}, {"label":"K31", "x":4.25, "y":4}, {"label":"K41", "x":5.25, "y":4}, {"label":"K51", "x":6.25, "y":4}, {"label":"K46", "x":7.25, "y":4}, {"label":"KE6", "x":8.25, "y":4}, {"label":"KE7", "x":9.25, "y":4}, {"label":"K47", "x":10.25, "y":4}, {"label":"KA1", "x":11.25, "y":4}, {"label":"KB1", "x":12.25, "y":4, "w":1.75}, {"label":"K86", "x":14, "y":4}, {"label":"K77", "x":15, "y":4}, {"label":"K00", "x":0, "y":5, "w":1.25}, {"label":"K10", "x":1.25, "y":5, "w":1.25}, {"label":"K20", "x":2.5, "y":5, "w":1.25}, {"label":"K56", "x":3.75, "y":5, "w":6.25}, {"label":"K57", "x":10, "y":5}, {"label":"KB0", "x":11, "y":5}, {"label":"KC0", "x":12, "y":5}, {"label":"K66", "x":13, "y":5}, {"label":"K76", "x":14, "y":5}, {"label":"K96", "x":15, "y":5}] + }, + "LAYOUT_splitbs": { + "key_count": 85, + "layout": [{"label":"K05", "x":0, "y":0}, {"label":"K25", "x":1, "y":0}, {"label":"K35", "x":2, "y":0}, {"label":"K45", "x":3, "y":0}, {"label":"K55", "x":4, "y":0}, {"label":"K06", "x":5, "y":0}, {"label":"KA6", "x":6, "y":0}, {"label":"KA7", "x":7, "y":0}, {"label":"K07", "x":8, "y":0}, {"label":"KB5", "x":9, "y":0}, {"label":"KC5", "x":10, "y":0}, {"label":"KD5", "x":11, "y":0}, {"label":"KE5", "x":12, "y":0}, {"label":"KD1", "x":13, "y":0}, {"label":"KE1", "x":14, "y":0}, {"label":"KE2", "x":15, "y":0}, {"label":"K04", "x":0, "y":1}, {"label":"K14", "x":1, "y":1}, {"label":"K24", "x":2, "y":1}, {"label":"K34", "x":3, "y":1}, {"label":"K44", "x":4, "y":1}, {"label":"K54", "x":5, "y":1}, {"label":"K16", "x":6, "y":1}, {"label":"KB6", "x":7, "y":1}, {"label":"KB7", "x":8, "y":1}, {"label":"K17", "x":9, "y":1}, {"label":"KA4", "x":10, "y":1}, {"label":"KB4", "x":11, "y":1}, {"label":"KC4", "x":12, "y":1}, {"label":"KE4", "x":13, "y":1}, {"label":"KD4", "x":14, "y":1}, {"label":"KD0", "x":15, "y":1}, {"label":"K03", "x":0, "y":2, "w":1.5}, {"label":"K13", "x":1.5, "y":2}, {"label":"K23", "x":2.5, "y":2}, {"label":"K33", "x":3.5, "y":2}, {"label":"K43", "x":4.5, "y":2}, {"label":"K53", "x":5.5, "y":2}, {"label":"K26", "x":6.5, "y":2}, {"label":"KC6", "x":7.5, "y":2}, {"label":"KC7", "x":8.5, "y":2}, {"label":"K27", "x":9.5, "y":2}, {"label":"KA3", "x":10.5, "y":2}, {"label":"KB3", "x":11.5, "y":2}, {"label":"KC3", "x":12.5, "y":2}, {"label":"KD3", "x":13.5, "y":2, "w":1.5}, {"label":"K67", "x":15, "y":2}, {"label":"K02", "x":0, "y":3, "w":1.75}, {"label":"K12", "x":1.75, "y":3}, {"label":"K22", "x":2.75, "y":3}, {"label":"K32", "x":3.75, "y":3}, {"label":"K42", "x":4.75, "y":3}, {"label":"K52", "x":5.75, "y":3}, {"label":"K36", "x":6.75, "y":3}, {"label":"KD6", "x":7.75, "y":3}, {"label":"KD7", "x":8.75, "y":3}, {"label":"K37", "x":9.75, "y":3}, {"label":"KA2", "x":10.75, "y":3}, {"label":"KB2", "x":11.75, "y":3}, {"label":"KD2", "x":12.75, "y":3, "w":2.25}, {"label":"KE0", "x":15, "y":3}, {"label":"K01", "x":0, "y":4, "w":2.25}, {"label":"K11", "x":2.25, "y":4}, {"label":"K21", "x":3.25, "y":4}, {"label":"K31", "x":4.25, "y":4}, {"label":"K41", "x":5.25, "y":4}, {"label":"K51", "x":6.25, "y":4}, {"label":"K46", "x":7.25, "y":4}, {"label":"KE6", "x":8.25, "y":4}, {"label":"KE7", "x":9.25, "y":4}, {"label":"K47", "x":10.25, "y":4}, {"label":"KA1", "x":11.25, "y":4}, {"label":"KB1", "x":12.25, "y":4, "w":1.75}, {"label":"K86", "x":14, "y":4}, {"label":"K77", "x":15, "y":4}, {"label":"K00", "x":0, "y":5, "w":1.25}, {"label":"K10", "x":1.25, "y":5, "w":1.25}, {"label":"K20", "x":2.5, "y":5, "w":1.25}, {"label":"K56", "x":3.75, "y":5, "w":6.25}, {"label":"K57", "x":10, "y":5}, {"label":"KB0", "x":11, "y":5}, {"label":"KC0", "x":12, "y":5}, {"label":"K66", "x":13, "y":5}, {"label":"K76", "x":14, "y":5}, {"label":"K96", "x":15, "y":5}] } } } -- cgit v1.2.3 From f01133d08918b3d1dd7b349309b02ffd37273f5c Mon Sep 17 00:00:00 2001 From: Filip Sund Date: Wed, 3 Oct 2018 19:12:27 +0200 Subject: Keyboard: Add handwired/pteron config and keymaps (#4060) * Added pteron files made via from kbfirmware.com. * Added readme. * Made some progress on Pteron keymap. * More keymap. * Updated bootloader, added some keymap illustrations. * Moved default keymap to FSund, made default keymap from default preonic keymap. * Fixed typo in default pteron keymap. * Made changes recommended by drashna. --- keyboards/handwired/pteron/config.h | 34 ++++++ keyboards/handwired/pteron/keymaps/FSund/keymap.c | 118 +++++++++++++++++++++ .../handwired/pteron/keymaps/default/keymap.c | 104 ++++++++++++++++++ keyboards/handwired/pteron/pteron.c | 1 + keyboards/handwired/pteron/pteron.h | 17 +++ keyboards/handwired/pteron/readme.md | 15 +++ keyboards/handwired/pteron/rules.mk | 58 ++++++++++ 7 files changed, 347 insertions(+) create mode 100644 keyboards/handwired/pteron/config.h create mode 100644 keyboards/handwired/pteron/keymaps/FSund/keymap.c create mode 100644 keyboards/handwired/pteron/keymaps/default/keymap.c create mode 100644 keyboards/handwired/pteron/pteron.c create mode 100644 keyboards/handwired/pteron/pteron.h create mode 100644 keyboards/handwired/pteron/readme.md create mode 100644 keyboards/handwired/pteron/rules.mk diff --git a/keyboards/handwired/pteron/config.h b/keyboards/handwired/pteron/config.h new file mode 100644 index 0000000000..9650839e30 --- /dev/null +++ b/keyboards/handwired/pteron/config.h @@ -0,0 +1,34 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QMK Community +#define PRODUCT Pteron Keyboard +#define DESCRIPTION Pteron Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D7, E6, B4, B5, B6 } +#define MATRIX_COL_PINS { F4, F6, F5, F7, B1, B3, C6, D4, D0, D1, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 5 // 5 is default + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/handwired/pteron/keymaps/FSund/keymap.c b/keyboards/handwired/pteron/keymaps/FSund/keymap.c new file mode 100644 index 0000000000..f34beae063 --- /dev/null +++ b/keyboards/handwired/pteron/keymaps/FSund/keymap.c @@ -0,0 +1,118 @@ +#include QMK_KEYBOARD_H + +enum pteron_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +// use S() to produce shifted versions of keys +// #define S(kc) LSFT(kc) // defined by default + +// alt gr +#define G(kc) RALT(kc) + +// custom keycodes +// use F_ prefix to avoid problems + +// NB! I use Norwegian keyboard layout on my machines, so the keymap probably +// doesn't make much sense for US/ANSI users + +#define F_FSLH S(KC_7) // forward slash +#define F_BSLH KC_EQL // backward slash +#define F_EQL S(KC_0) // equals sign +#define F_APOS KC_BSLS // ' +#define F_TIMES S(KC_BSLS) // * +#define F_PLUS KC_MINS // + +#define F_QUEST S(KC_MINS) // ? +#define F_HAT S(KC_RBRC) // ^ +#define F_TILD G(KC_RBRC) // ~ +#define F_UML KC_RBRC // ¨ (umlaut) +#define F_SECT S(KC_GRV) // section sign ("law sign") (shifted key below esc) +#define F_GRAVE S(KC_EQL) +#define F_ACUTE G(KC_EQL) + +#define KC_AA KC_LBRC +#define KC_OE KC_SCLN +#define KC_AE KC_QUOT + +// brackets +#define F_SBRL G(KC_8) // square bracket left +#define F_SBRR G(KC_9) // square bracket right +#define F_CBRL G(KC_7) // curly bracket left +#define F_CBRR G(KC_0) // curly bracket right +#define F_RBRL S(KC_8) // round bracket left +#define F_RBRR S(KC_9) // round bracket right +#define F_ABRL KC_NUBS // angle bracket left +#define F_ABRR S(KC_NUBS) // angle bracket right + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * +-----------------------------------------+ +-----------------------------------------+ + * | Esc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Å | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | Ø | Æ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | | N | M | , | . | - | Shft | + * +---------------------------+------+------+-------------+ +-------------+------+------+---------------------------+ + * | LOWR | Spc | Alt | Win | | Win | Alt | Spc | RISE | + * +---------------------------+ +---------------------------+ + */ + +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_AA, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_OE, KC_AE, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, + LOWER, KC_SPC, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_ENT, RAISE + ), + +/* LOWER + * +-----------------------------------------+ +-----------------------------------------+ + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | \ | / | [ | ] | = | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | < | > | ( | ) | * | ~ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F6 | F7 | F8 | F9 | F10 | | F11 | F12 | { | } | + | | + * +---------------------------+------+------+-------------+ +-------------+------+------+---------------------------+ + * | | | | | | | | | | + * +---------------------------+ +---------------------------+ + */ + +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, F_BSLH, F_FSLH, F_SBRL, F_SBRR, F_EQL, KC_DEL, + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, F_ABRL, F_ABRR, F_RBRL, F_RBRR, F_TIMES, F_TILD, + _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, F_CBRL, F_CBRR, F_PLUS, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_AA, + F_SECT, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), F_QUEST, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, F_APOS, + _______, S(KC_6), G(KC_2), G(KC_3), G(KC_4), G(KC_5), F_HAT, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + +[_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, F_UML, F_GRAVE, F_ACUTE, _______, RESET, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/handwired/pteron/keymaps/default/keymap.c b/keyboards/handwired/pteron/keymaps/default/keymap.c new file mode 100644 index 0000000000..3079cc7afd --- /dev/null +++ b/keyboards/handwired/pteron/keymaps/default/keymap.c @@ -0,0 +1,104 @@ +#include QMK_KEYBOARD_H + +enum pteron_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST +}; + + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * +-----------------------------------------+ +-----------------------------------------+ + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * +-------------+------+------+------+------| |------+------+------+------+-------------+ + * |Lower | SPC | Alt | GUI | | Alt | GUI | SPC |Raise | + * +---------------------------+ +---------------------------+ + */ +[_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + LOWER, KC_SPC, KC_LALT, KC_LGUI, KC_RALT, KC_RGUI, KC_SPC, RAISE \ +), + +/* Lower + * +-----------------------------------------+ +-----------------------------------------+ + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO ~ |ISO | | | | | + * +-------------+------+------+------+------| |------+------+------+------+-------------+ + * | | | | | | Next | Vol- | Vol+ | Play | + * +---------------------------+ +---------------------------+ + */ +[_LOWER] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * +-----------------------------------------+ +-----------------------------------------+ + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO # |ISO / | | | | + * +-------------+------+------+------+------| |------+------+------+------+-------------+ + * | | | | | | Next | Vol- | Vol+ | Play | + * +---------------------------+ +---------------------------+ + */ +[_RAISE] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * +-----------------------------------------+ +-----------------------------------------+ + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Reset| | | | | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn| |MidOff| | | | | | + * +-------------+------+------+------+------| |------+------+------+------+-------------+ + * | | | | | | | | | | + * +---------------------------+ +---------------------------+ + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RESET, DEBUG, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/handwired/pteron/pteron.c b/keyboards/handwired/pteron/pteron.c new file mode 100644 index 0000000000..972b45aa20 --- /dev/null +++ b/keyboards/handwired/pteron/pteron.c @@ -0,0 +1 @@ +#include "pteron.h" diff --git a/keyboards/handwired/pteron/pteron.h b/keyboards/handwired/pteron/pteron.h new file mode 100644 index 0000000000..f29c2619af --- /dev/null +++ b/keyboards/handwired/pteron/pteron.h @@ -0,0 +1,17 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, \ + K402, K403, K404, K405, K406, K407, K408, K409 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 }, \ + { KC_NO, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, KC_NO, KC_NO } \ +} diff --git a/keyboards/handwired/pteron/readme.md b/keyboards/handwired/pteron/readme.md new file mode 100644 index 0000000000..a66d41edbb --- /dev/null +++ b/keyboards/handwired/pteron/readme.md @@ -0,0 +1,15 @@ +# Pteron + +![Pteron](https://i.imgur.com/9QhPlVD.jpg) + +An ergonomic keyboard heavily inspired by the [Atreus](https://github.com/technomancy/atreus), [Iris](https://github.com/keebio/iris-case) and [Atreis](https://github.com/dekonnection/atreis) keyboards. More info and files for laser cutting plates and case are in the [Pteron repository](https://github.com/FSund/pteron-keyboard). + +Keyboard Maintainer: [Filip Sund](https://github.com/FSund) +Hardware Supported: Pro Micro +Hardware Availability: Handwired, no PCB's available (for now) + +Make example for this keyboard (after setting up your build environment): + + make handwired/pteron: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). \ No newline at end of file diff --git a/keyboards/handwired/pteron/rules.mk b/keyboards/handwired/pteron/rules.mk new file mode 100644 index 0000000000..10218020e6 --- /dev/null +++ b/keyboards/handwired/pteron/rules.mk @@ -0,0 +1,58 @@ +# MCU name +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 +# 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 = caterina + +# Build Options +# comment out to disable the options. +# +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 = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +RGBLIGHT_ENABLE = no +UNICODE_ENABLE = no +UNICODEMAP_ENABLE = no \ No newline at end of file -- cgit v1.2.3 From d55468c18d666870cfe095d32153e5e503e50649 Mon Sep 17 00:00:00 2001 From: Filip Sund Date: Wed, 3 Oct 2018 21:04:01 +0200 Subject: Keyboard: Added dactyl-manuform 4x6 and keymap. (#4058) * Added dactyl-manuform 4x6 and keymap. * Did changes recommended by drashna. --- .../dactyl_manuform/4x5/keymaps/default/config.h | 5 +- .../dactyl_manuform/4x5/keymaps/dvorak/config.h | 5 +- keyboards/handwired/dactyl_manuform/4x6/4x6.c | 14 ++++ keyboards/handwired/dactyl_manuform/4x6/4x6.h | 36 +++++++++ keyboards/handwired/dactyl_manuform/4x6/config.h | 40 ++++++++++ .../dactyl_manuform/4x6/keymaps/default/config.h | 31 ++++++++ .../dactyl_manuform/4x6/keymaps/default/keymap.c | 87 ++++++++++++++++++++++ keyboards/handwired/dactyl_manuform/4x6/rules.mk | 21 ++++++ .../handwired/dactyl_manuform/dactyl_manuform.h | 10 ++- 9 files changed, 237 insertions(+), 12 deletions(-) create mode 100644 keyboards/handwired/dactyl_manuform/4x6/4x6.c create mode 100644 keyboards/handwired/dactyl_manuform/4x6/4x6.h create mode 100644 keyboards/handwired/dactyl_manuform/4x6/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x6/keymaps/default/config.h create mode 100644 keyboards/handwired/dactyl_manuform/4x6/keymaps/default/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/4x6/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h index 216917ed71..682c7a868b 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/default/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "../../config.h" @@ -33,5 +32,3 @@ along with this program. If not, see . // #define MASTER_LEFT // #define MASTER_RIGHT #define EE_HANDS - -#endif diff --git a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h index 216917ed71..682c7a868b 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h +++ b/keyboards/handwired/dactyl_manuform/4x5/keymaps/dvorak/config.h @@ -18,8 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "../../config.h" @@ -33,5 +32,3 @@ along with this program. If not, see . // #define MASTER_LEFT // #define MASTER_RIGHT #define EE_HANDS - -#endif diff --git a/keyboards/handwired/dactyl_manuform/4x6/4x6.c b/keyboards/handwired/dactyl_manuform/4x6/4x6.c new file mode 100644 index 0000000000..1d305c8541 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/4x6.c @@ -0,0 +1,14 @@ +#include "4x6.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + matrix_init_user(); +}; + diff --git a/keyboards/handwired/dactyl_manuform/4x6/4x6.h b/keyboards/handwired/dactyl_manuform/4x6/4x6.h new file mode 100644 index 0000000000..25741be57b --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/4x6.h @@ -0,0 +1,36 @@ +#pragma once + +#include "dactyl_manuform.h" +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +#define LAYOUT(\ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L32, L33, R32, R33, \ + L34, L35, R30, R31, \ + L44, L45, R40, R41, \ + L42, L43, R42, R43 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { KC_NO, KC_NO, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, L42, L43, L44, L45 }, \ +\ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, KC_NO, KC_NO }, \ + { R40, R41, R42, R43, KC_NO, KC_NO } \ +\ + } diff --git a/keyboards/handwired/dactyl_manuform/4x6/config.h b/keyboards/handwired/dactyl_manuform/4x6/config.h new file mode 100644 index 0000000000..d4a1922876 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/config.h @@ -0,0 +1,40 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER tshort +#define DESCRIPTION A split keyboard for the cheap makers + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// row-driven +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { D4, C6, D7, E6, B4, B5 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/config.h b/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/config.h new file mode 100644 index 0000000000..1fc2c617f6 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS diff --git a/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/keymap.c b/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/keymap.c new file mode 100644 index 0000000000..ad23beef5c --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +// Fillers to make layering more clear + +#define ____ KC_TRNS + +#define SFT_ESC SFT_T(KC_ESC) +#define CTL_BSPC CTL_T(KC_BSPC) +#define ALT_SPC ALT_T(KC_SPC) +#define SFT_ENT SFT_T(KC_ENT) + +#define KC_ML KC_MS_LEFT +#define KC_MR KC_MS_RIGHT +#define KC_MU KC_MS_UP +#define KC_MD KC_MS_DOWN +#define KC_MB1 KC_MS_BTN1 +#define KC_MB2 KC_MS_BTN1 + +#define RAISE MO(_RAISE) +#define LOWER MO(_LOWER) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base (qwerty) + * +-----------------------------------------+ +-----------------------------------------+ + * | ESC | q | w | e | r | t | | y | u | i | o | p | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | TAB | a | s | d | f | g | | h | j | k | l | ; | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | SHFT | z | x | c | v | b | | n | m | , | . | / | | + * +------+------+------+------+-------------+ +-------------+------+------+------+------+ + * | [ | ] | | | | + * +-------------+-------------+ +-------------+-------------+ + * | | | | | | + * |------+------| |------+------| + * | | | | | | + * +-------------+ +-------------+ + * +-------------+ +-------------+ + * | | | | | | + * |------+------| |------+------| + * | | | | | | + * +-------------+ +-------------+ + */ + +[_BASE] = LAYOUT( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_BSLASH, \ + KC_LBRC,KC_RBRC, KC_PLUS,KC_EQL, \ + RAISE, KC_SPC, KC_ENT, LOWER, \ + KC_TAB, KC_HOME, KC_END, KC_DEL, \ + KC_BSPC,KC_GRV, KC_LGUI,KC_LALT \ +), + +[_LOWER] = LAYOUT( + _______,_______,_______,_______,_______,KC_LBRC, KC_RBRC, KC_P7, KC_P8, KC_P9, RESET, KC_PLUS, \ + _______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ,KC_LPRN, KC_RPRN, KC_P4, KC_P5, KC_P6, KC_MINS,KC_PIPE, \ + _______,_______,_______,_______,_______,_______, _______, KC_P1, KC_P2, KC_P3, KC_EQL, KC_UNDS, \ + _______,KC_PSCR, _______, KC_P0, \ + _______,_______, _______,_______, \ + _______,_______, _______,_______, \ + _______,_______, _______,_______ \ +), + +[_RAISE] = LAYOUT( + _______,RESET, _______,_______,_______,KC_LBRC, KC_RBRC,_______,KC_NLCK,KC_INS, KC_SLCK,KC_MUTE, \ + _______,KC_LEFT,KC_UP ,KC_DOWN,KC_RGHT,KC_LPRN, KC_RPRN,KC_MPRV,KC_MPLY,KC_MNXT,_______,KC_VOLU, \ + _______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,KC_VOLD, \ + _______,_______, KC_EQL, _______, \ + _______,_______, _______,_______, \ + _______,_______, _______,_______, \ + _______,_______, _______,_______ \ +) +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + diff --git a/keyboards/handwired/dactyl_manuform/4x6/rules.mk b/keyboards/handwired/dactyl_manuform/4x6/rules.mk new file mode 100644 index 0000000000..14b6e1e4e3 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/rules.mk @@ -0,0 +1,21 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + diff --git a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h index 8b60097bc2..eea0757d59 100644 --- a/keyboards/handwired/dactyl_manuform/dactyl_manuform.h +++ b/keyboards/handwired/dactyl_manuform/dactyl_manuform.h @@ -1,13 +1,15 @@ #pragma once -#ifdef KEYBOARD_handwired_dactyl_manuform_6x6 - #include "6x6.h" +#ifdef KEYBOARD_handwired_dactyl_manuform_4x5 + #include "4x5.h" +#elif KEYBOARD_handwired_dactyl_manuform_4x6 + #include "4x6.h" #elif KEYBOARD_handwired_dactyl_manuform_5x6 #include "5x6.h" -#elif KEYBOARD_handwired_dactyl_manuform_4x5 - #include "4x5.h" #elif KEYBOARD_handwired_dactyl_manuform_5x7 #include "5x7.h" +#elif KEYBOARD_handwired_dactyl_manuform_6x6 + #include "6x6.h" #endif //void promicro_bootloader_jmp(bool program); -- cgit v1.2.3 From 9c4b6d21003290abd92644d882165a95ffee4470 Mon Sep 17 00:00:00 2001 From: Pittyolo Date: Wed, 3 Oct 2018 21:14:36 +0200 Subject: Keyboard: Adding Split Space support for Mechmini 1 (#4052) * Adding Split Space support * Adding my keymap * update * Made the requested updates * Made the requested update --- keyboards/mechmini/v1/keymaps/pitty/keymap.c | 54 ++++++++++++++++++++++++++++ keyboards/mechmini/v1/v1.h | 17 +++++++++ 2 files changed, 71 insertions(+) create mode 100644 keyboards/mechmini/v1/keymaps/pitty/keymap.c diff --git a/keyboards/mechmini/v1/keymaps/pitty/keymap.c b/keyboards/mechmini/v1/keymaps/pitty/keymap.c new file mode 100644 index 0000000000..7db2dc1836 --- /dev/null +++ b/keyboards/mechmini/v1/keymaps/pitty/keymap.c @@ -0,0 +1,54 @@ +/* +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 . +*/ + +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _NMBR 1 +#define _NAV 2 +#define _MOUSE 3 +#define _FUNCT 4 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_split_space( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_FUNCT, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + KC_LCTL, KC_LGUI, KC_LALT, LT(_NAV, KC_SPC), KC_BSPC, KC_RALT, TT(_MOUSE), TT(_NMBR) + ), + [_NAV] = LAYOUT_split_space( + _______, _______, KC_UP, _______, KC_LPRN, KC_RPRN, _______, KC_7, KC_8, KC_9, KC_KP_SLASH, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_LCBR, KC_RCBR, _______, KC_4, KC_5, KC_6, KC_KP_ASTERISK, + _______, _______, _______, _______, KC_LABK, KC_RABK, KC_GRV, KC_1, KC_2, KC_3, KC_KP_MINUS, + _______, _______, _______, _______, _______, _______, KC_KP_DOT, KC_KP_PLUS + ), + [_NMBR] = LAYOUT_split_space( + KC_GRAVE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, + _______, KC_4, KC_5, KC_6, _______, _______, _______, _______, _______, _______, _______, + _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, TO(_QWERTY), _______, _______, _______ + ), + [_MOUSE] = LAYOUT_split_space( + _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, _______, _______, KC_WH_U, _______, _______, _______, + _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, KC_WH_L, KC_WH_D, KC_WH_R, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, TO(_QWERTY), _______, _______, _______ + ), + [_FUNCT] = LAYOUT_split_space( + 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_INS, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, + _______, KC_DEL, KC_END, KC_PGDN, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, RGB_TOG, RGB_MOD, _______, _______, RESET + ) +}; diff --git a/keyboards/mechmini/v1/v1.h b/keyboards/mechmini/v1/v1.h index 501bd89c59..1e392b3530 100644 --- a/keyboards/mechmini/v1/v1.h +++ b/keyboards/mechmini/v1/v1.h @@ -40,4 +40,21 @@ along with this program. If not, see . { 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 } \ } +#define LAYOUT_split_space( \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, \ + K00, K10, K20, K56, K57, KB0, KC0, K66 \ +) \ +{ \ + { K00, K10, K20, K56, KC_NO, KC_NO, K57, KC_NO, KB0, KC0, K66, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, 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, 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, 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 } \ +} + #endif -- cgit v1.2.3 From ac27b62fa17859b61a5b5f6c26b1e3113f219b39 Mon Sep 17 00:00:00 2001 From: takashiski Date: Thu, 4 Oct 2018 04:22:18 +0900 Subject: Keyboard: add info.json for qmk configurator (#4063) --- keyboards/namecard2x4/info.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/keyboards/namecard2x4/info.json b/keyboards/namecard2x4/info.json index e69de29bb2..3d6c332154 100644 --- a/keyboards/namecard2x4/info.json +++ b/keyboards/namecard2x4/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "namecard2x4", + "url": "https://skyhigh-works.hatenablog.com/", + "maintainer": "takashiski", + "bootloader": "atmel-dfu", + "width": 4, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"1", "x":0, "y":0}, {"label":"2", "x":1, "y":0}, {"label":"3", "x":2, "y":0}, {"label":"4", "x":3, "y":0}, {"label":"5", "x":0, "y":1}, {"label":"6", "x":1, "y":1}, {"label":"7", "x":2, "y":1}, {"label":"8", "x":3, "y":1}] + } + } +} -- cgit v1.2.3 From 0d61e612f063b91568bf8098878051c4ea405ab3 Mon Sep 17 00:00:00 2001 From: martinakcsilla Date: Wed, 3 Oct 2018 23:38:02 +0200 Subject: process_ucis: Add a callback for success (#4067) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There is `qk_ucis_symbol_fallback` for the case where symbol lookup fails, but there wasn't one for the success case. This adds `qk_ucis_success`, called after successfully finishing the UCIS symbol input. Thanks to @drashna for the idea! Signed-off-by: Csilla Nagyné Martinák --- quantum/process_keycode/process_ucis.c | 8 ++++++++ quantum/process_keycode/process_ucis.h | 1 + 2 files changed, 9 insertions(+) diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 86c0937f5e..5de2e41fc3 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -32,6 +32,10 @@ void qk_ucis_start_user(void) { unicode_input_finish(); } +__attribute__((weak)) +void qk_ucis_success(uint8_t symbol_index) { +} + static bool is_uni_seq(char *seq) { uint8_t i; @@ -142,6 +146,10 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { } unicode_input_finish(); + if (symbol_found) { + qk_ucis_success(i); + } + qk_ucis_state.in_progress = false; return false; } diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index 3f736a709f..d4aa34cde7 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h @@ -45,6 +45,7 @@ extern const qk_ucis_symbol_t ucis_symbol_table[]; void qk_ucis_start(void); void qk_ucis_start_user(void); void qk_ucis_symbol_fallback (void); +void qk_ucis_success(uint8_t symbol_index); void register_ucis(const char *hex); bool process_ucis (uint16_t keycode, keyrecord_t *record); -- cgit v1.2.3 From f13ca593618b9f5ed6c175496a0d84633f541a94 Mon Sep 17 00:00:00 2001 From: Enochen Date: Wed, 3 Oct 2018 18:02:24 -0400 Subject: rn42 compilation error fix (#4050) * rn42 compile fix Fixes a compilation error * simpler rn42 compile fix good idea drashna :) --- keyboards/hhkb/rn42/rn42.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/hhkb/rn42/rn42.c b/keyboards/hhkb/rn42/rn42.c index 859e401490..154da4e101 100644 --- a/keyboards/hhkb/rn42/rn42.c +++ b/keyboards/hhkb/rn42/rn42.c @@ -1,7 +1,7 @@ #include #include "host.h" #include "host_driver.h" -#include "serial.h" +#include "../serial.h" #include "rn42.h" #include "print.h" #include "timer.h" -- cgit v1.2.3 From dad579c8f81bdde08e598f9d99249893d5d779a8 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 3 Oct 2018 22:33:06 -0700 Subject: Add mousekey_send to (un)register_code --- tmk_core/common/action.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 76d02bc9df..8bdcd54e32 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -777,6 +777,7 @@ void register_code(uint8_t code) #ifdef MOUSEKEY_ENABLE else if IS_MOUSEKEY(code) { mousekey_on(code); + mousekey_send(); } #endif } @@ -841,6 +842,7 @@ void unregister_code(uint8_t code) #ifdef MOUSEKEY_ENABLE else if IS_MOUSEKEY(code) { mousekey_off(code); + mousekey_send(); } #endif } -- cgit v1.2.3 From 26adf3706a7822e05977c0eadb6963c0db2e1c3b Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Fri, 5 Oct 2018 00:00:33 +0200 Subject: Keymap: Added personal userspace and keymaps. (#4073) * added personal userspace, niu mini, planck and fc660c keymaps * removed unnecessary include and some other minor corrections --- keyboards/fc660c/keymaps/spacebarracecar/README.md | 4 + keyboards/fc660c/keymaps/spacebarracecar/config.h | 9 + keyboards/fc660c/keymaps/spacebarracecar/keymap.c | 38 +++ keyboards/fc660c/keymaps/spacebarracecar/rules.mk | 6 + .../niu_mini/keymaps/spacebarracecar/config.h | 0 .../niu_mini/keymaps/spacebarracecar/keymap.c | 126 +++++++++ .../niu_mini/keymaps/spacebarracecar/readme.md | 3 + .../niu_mini/keymaps/spacebarracecar/rules.mk | 22 ++ keyboards/planck/keymaps/spacebarracecar/config.h | 3 + keyboards/planck/keymaps/spacebarracecar/keymap.c | 148 ++++++++++ keyboards/planck/keymaps/spacebarracecar/readme.md | 4 + keyboards/planck/keymaps/spacebarracecar/rules.mk | 23 ++ users/spacebarracecar/config.h | 0 users/spacebarracecar/rules.mk | 5 + users/spacebarracecar/spacebarracecar.c | 305 +++++++++++++++++++++ users/spacebarracecar/spacebarracecar.h | 242 ++++++++++++++++ 16 files changed, 938 insertions(+) create mode 100644 keyboards/fc660c/keymaps/spacebarracecar/README.md create mode 100644 keyboards/fc660c/keymaps/spacebarracecar/config.h create mode 100644 keyboards/fc660c/keymaps/spacebarracecar/keymap.c create mode 100644 keyboards/fc660c/keymaps/spacebarracecar/rules.mk create mode 100644 keyboards/niu_mini/keymaps/spacebarracecar/config.h create mode 100644 keyboards/niu_mini/keymaps/spacebarracecar/keymap.c create mode 100644 keyboards/niu_mini/keymaps/spacebarracecar/readme.md create mode 100644 keyboards/niu_mini/keymaps/spacebarracecar/rules.mk create mode 100644 keyboards/planck/keymaps/spacebarracecar/config.h create mode 100644 keyboards/planck/keymaps/spacebarracecar/keymap.c create mode 100644 keyboards/planck/keymaps/spacebarracecar/readme.md create mode 100644 keyboards/planck/keymaps/spacebarracecar/rules.mk create mode 100644 users/spacebarracecar/config.h create mode 100644 users/spacebarracecar/rules.mk create mode 100644 users/spacebarracecar/spacebarracecar.c create mode 100644 users/spacebarracecar/spacebarracecar.h diff --git a/keyboards/fc660c/keymaps/spacebarracecar/README.md b/keyboards/fc660c/keymaps/spacebarracecar/README.md new file mode 100644 index 0000000000..7d87ef8cf6 --- /dev/null +++ b/keyboards/fc660c/keymaps/spacebarracecar/README.md @@ -0,0 +1,4 @@ +# US International keymap for PCs with German set as input language + +This keymap emulates a US International layout including a deadkey layer on PCs that have German set as the input language. +This allows the use of the keyboard on any PC in Germany without the need of changing the input language. diff --git a/keyboards/fc660c/keymaps/spacebarracecar/config.h b/keyboards/fc660c/keymaps/spacebarracecar/config.h new file mode 100644 index 0000000000..9c9b00656b --- /dev/null +++ b/keyboards/fc660c/keymaps/spacebarracecar/config.h @@ -0,0 +1,9 @@ +#pragma once + +// higher value means deeper actuation point, less sensitive +// be careful and only make small adjustments (steps of 1 or 2). +// too high and keys will fail to actuate. too low and keys will actuate spontaneously. +// test all keys before further adjustment. +// this should probably stay in the range +/-5. +#undef ACTUATION_DEPTH_ADJUSTMENT +#define ACTUATION_DEPTH_ADJUSTMENT +2 diff --git a/keyboards/fc660c/keymaps/spacebarracecar/keymap.c b/keyboards/fc660c/keymaps/spacebarracecar/keymap.c new file mode 100644 index 0000000000..2cbef10bbf --- /dev/null +++ b/keyboards/fc660c/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +enum layers { + _BASE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT( + KC_ESC, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, DE_MINS,CU_EQL, KC_BSPC, KC_INS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, CU_Z, KC_U, KC_I, KC_O, KC_P, CU_LBRC,CU_RBRC,CU_BSLS, KC_DEL, + CU_NAV, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, CU_SCLN,CU_QUOT, KC_ENT, + CU_LSFT,CU_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CU_COMM,CU_DOT, CU_SLSH,CU_RSFT, KC_UP, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT + ), + + [_DEADKEY] = LAYOUT( + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, CU_ED, + _______,CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + _______,CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, CU_DDQ , + _______,CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, + _______,_______,_______, CU_DDQ, _______,_______,_______, _______,_______,_______ + ), + + [_NAV] = LAYOUT( + CU_GRV, 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_DEL, CU_GAME, + _______,KC_PGDN,KC_UP, KC_PGUP,KC_HOME,XXXXXXX,XXXXXXX,XXXXXXX,GUIU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, CU_ESCT, + _______,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, XXXXXXX,XXXXXXX,GUIL, GUID, GUIR, XXXXXXX,XXXXXXX, KC_ENT, + _______,KC_MPRV,KC_MPLY,KC_MNXT,KC_VOLD,KC_VOLU,KC_MUTE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_PGUP, + RESET, _______,_______, _______, _______,_______,_______, KC_HOME,KC_PGDN,KC_END + ) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return process_record_userspace(keycode, record); +} diff --git a/keyboards/fc660c/keymaps/spacebarracecar/rules.mk b/keyboards/fc660c/keymaps/spacebarracecar/rules.mk new file mode 100644 index 0000000000..8ee642a4a7 --- /dev/null +++ b/keyboards/fc660c/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,6 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/config.h b/keyboards/niu_mini/keymaps/spacebarracecar/config.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c new file mode 100644 index 0000000000..b850e5fda7 --- /dev/null +++ b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,126 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +enum layers { + _BASE, + _LOWER, + _RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base Layer +,-----------------------------------------------------------------------------------------------------------------------. +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Shift |Y |X |C |V |B |N |M |, |. |/ |Shift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|LCtrl | |Win |Alt |Lower |Space |Enter |Raise |AltGr |Win |Menu |RCtrl | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT_ortho_4x12( + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,-----------------------------------------------------------------------------------------------------------------------. +|~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_ortho_4x12( + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,-----------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_ortho_4x12( + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Dead-Key +,-----------------------------------------------------------------------------------------------------------------------. +| | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT_ortho_4x12( + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ +), + +/* Nav +,-----------------------------------------------------------------------------------------------------------------------. +|Caps Lock|PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | |RESET | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT_ortho_4x12( + CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, RGB_M_P, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, RGB_MOD, RGB_HUI, CU_RGBV, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_GAME +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MO(_LOWER): + if (game){ + if(record->event.pressed) { + register_code(KC_SPC); + } else { + unregister_code(KC_SPC); + } + return false; + } else { + return true; + } + } + return process_record_userspace(keycode, record); +} diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/readme.md b/keyboards/niu_mini/keymaps/spacebarracecar/readme.md new file mode 100644 index 0000000000..88d7221869 --- /dev/null +++ b/keyboards/niu_mini/keymaps/spacebarracecar/readme.md @@ -0,0 +1,3 @@ +# US-International like Niu Mini layout for PCs with German set as input language + +This layout aims to provide a US-International like layout for PCs that have German set as Input Language. This is useful for users living in germany, because it enables the use of the Niu Mini on any pc without having to switch the input language. It's mostly based on the Planck default layout, but adds essential features for german input, like a dead key layer to access ä, ö, ü. diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk b/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk new file mode 100644 index 0000000000..b1d7055da7 --- /dev/null +++ b/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,22 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/keyboards/planck/keymaps/spacebarracecar/config.h b/keyboards/planck/keymaps/spacebarracecar/config.h new file mode 100644 index 0000000000..9b55fa93aa --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/config.h @@ -0,0 +1,3 @@ +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(NO_SOUND) +#endif diff --git a/keyboards/planck/keymaps/spacebarracecar/keymap.c b/keyboards/planck/keymaps/spacebarracecar/keymap.c new file mode 100644 index 0000000000..705f78f8ea --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,148 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +enum layers { + _BASE, + _LOWER, + _RAISE, + _MUSICMODE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base Layer +,-----------------------------------------------------------------------------------------------------------------------. +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Shift |Y |X |C |V |B |N |M |, |. |/ |Shift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|LCtrl | |Win |Alt |Lower |Space |Enter |Raise |AltGr |Win |Menu |RCtrl | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT_ortho_4x12( + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,-----------------------------------------------------------------------------------------------------------------------. +|~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ +[_LOWER] = LAYOUT_ortho_4x12( + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,-----------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT_ortho_4x12( + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MUSICMODE] = LAYOUT_ortho_4x12( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_LCTL, KC_LALT, KC_LGUI, KC_DOWN, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_MOD, MU_OFF +), + +/* Dead-Key +,-----------------------------------------------------------------------------------------------------------------------. +| | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT_ortho_4x12( + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, KC_BSPC, + CU_NAV, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + CU_LSFT, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Nav +,-----------------------------------------------------------------------------------------------------------------------. +|Caps Lock|PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | |RESET | | +`-----------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT_ortho_4x12( + CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, MU_ON, XXXXXXX, XXXXXXX, XXXXXXX, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_GAME +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MO(_LOWER): + if (game){ + if(record->event.pressed) { + register_code(KC_SPC); + } else { + unregister_code(KC_SPC); + } + return false; + } else { + return true; + } + case MU_ON: + if(record->event.pressed) { + layer_off(_LOWER); + layer_off(_RAISE); + layer_off(_NAV); + layer_off(_DEADKEY); + layer_on(_MUSICMODE); + } + return true; + case MU_OFF: + if(record->event.pressed) { + layer_off(_MUSICMODE); + } + return true; + } + return process_record_userspace(keycode, record); +} diff --git a/keyboards/planck/keymaps/spacebarracecar/readme.md b/keyboards/planck/keymaps/spacebarracecar/readme.md new file mode 100644 index 0000000000..daa9c4ad2b --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/readme.md @@ -0,0 +1,4 @@ +# US-International like Planck layout for PCs with German set as input language + +This layout aims to provide a US-International like layout for PCs that have German set as Input Language. This is useful for users living in germany, because it enables the use of the planck on any pc without having to switch the input language. It's mostly based on the Planck default layout, but adds essential features for german input, like a dead key layer to access ä, ö, ü. + diff --git a/keyboards/planck/keymaps/spacebarracecar/rules.mk b/keyboards/planck/keymaps/spacebarracecar/rules.mk new file mode 100644 index 0000000000..fbdd1217c0 --- /dev/null +++ b/keyboards/planck/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,23 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +AUDIO_ENABLE = yes # 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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language + diff --git a/users/spacebarracecar/config.h b/users/spacebarracecar/config.h new file mode 100644 index 0000000000..e69de29bb2 diff --git a/users/spacebarracecar/rules.mk b/users/spacebarracecar/rules.mk new file mode 100644 index 0000000000..319e887ae3 --- /dev/null +++ b/users/spacebarracecar/rules.mk @@ -0,0 +1,5 @@ +SRC += spacebarracecar.c + +ifeq ($(strip $(GERMAN_ENABLE)), yes) + OPT_DEFS += -DGERMAN_ENABLE +endif diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c new file mode 100644 index 0000000000..404331f8df --- /dev/null +++ b/users/spacebarracecar/spacebarracecar.c @@ -0,0 +1,305 @@ +#include "spacebarracecar.h" + +#ifdef GERMAN_ENABLE +bool lshift = false; +bool rshift = false; +bool lshiftp = false; +bool rshiftp = false; +uint16_t lshift_timer = 0; +uint16_t rshift_timer = 0; + +uint8_t prev_indx = 0; +uint16_t prev_kcs[6] = {0, 0, 0, 0, 0, 0}; + +bool esct = false; + +void add_to_prev(uint16_t kc){ + for (int i=0; i0; i--){ + prev_kcs[i] = prev_kcs[i-1]; + } + prev_kcs[0] = kc; + } else { + prev_kcs[prev_indx] = kc; + prev_indx++; + } +} + +void unreg_prev(void){ + if (prev_indx == 0) + return; + for (int i=0; ievent.pressed) { + game = !game; + } + return false; + case KC_LGUI: + case KC_RGUI: + if (game) + return false; + else + return true; + case CU_NAV: + if(record->event.pressed) { + navesc = true; + navesc_timer = timer_read(); + layer_on(_NAV); + } else { + if (timer_elapsed(navesc_timer) < 200 && navesc) { + register_code(KC_ESC); + unregister_code(KC_ESC); + } + layer_off(_NAV); + } + return false; + + #ifdef RGBLIGHT_ENABLE + case CU_RGBV: + if(record->event.pressed) { + if (rgblight_get_val()+32>255) + rgblight_sethsv(rgblight_get_hue(), rgblight_get_sat(), 31); + else + rgblight_sethsv(rgblight_get_hue(), rgblight_get_sat(), rgblight_get_val()+32); + } + return false; + #endif + + #ifdef GERMAN_ENABLE + case CU_LSFT: + if(record->event.pressed) { + lshiftp = true; + lshift_timer = timer_read(); + unregister_code(KC_LSFT); + register_code(KC_LSFT); + lshift = true; + } else { + if (timer_elapsed(lshift_timer) < 200 && lshiftp && !game) { + register_code(KC_LSFT); + register_code(KC_8); + unregister_code(KC_8); + unregister_code(KC_LSFT); + } + unreg_prev(); + if (!rshift) + unregister_code(KC_LSFT); + lshift = false; + } + return false; + case CU_RSFT: + if(record->event.pressed) { + rshiftp = true; + rshift_timer = timer_read(); + unregister_code(KC_LSFT); + register_code(KC_LSFT); + rshift = true; + } else { + if (timer_elapsed(rshift_timer) < 200 && rshiftp && !game) { + register_code(KC_LSFT); + register_code(KC_9); + unregister_code(KC_9); + unregister_code(KC_LSFT); + } + unreg_prev(); + if (!lshift) + unregister_code(KC_LSFT); + rshift = false; + } + return false; + case CU_ESCT: + if(record->event.pressed) { + esct = !esct; + } + return false; + case CU_AE: + UML(DE_AE) + case CU_OE: + UML(DE_OE) + case CU_UE: + UML(DE_UE) + case CU_SS: + if(record->event.pressed) { + timer_timeout(); + unregister_code(KC_LSFT); + register_code(DE_SS); + unregister_code(DE_SS); + if (lshift || rshift) + register_code(KC_LSFT); + layer_off(_DEADKEY); + } + return false; + case CU_DDQ: + if(record->event.pressed) { + timer_timeout(); + register_code(KC_LSFT); + register_code(KC_2); + unregister_code(KC_2); + if (!lshift && !rshift) + unregister_code(KC_LSFT); + layer_off(_DEADKEY); + } + return false; + case CU_ED: + if(record->event.pressed) { + timer_timeout(); + layer_off(_DEADKEY); + } + return false; + case CU_GRV: + if(record->event.pressed) { + timer_timeout(); + if (lshift || rshift){ + unregister_code(KC_LSFT); + register_code(DE_ALGR); + unregister_code(DE_PLUS); + register_code(DE_PLUS); + unregister_code(DE_PLUS); + unregister_code(DE_ALGR); + register_code(KC_LSFT); + } else { + register_code(KC_LSFT); + unregister_code(DE_ACUT); + register_code(DE_ACUT); + unregister_code(DE_ACUT); + unregister_code(KC_LSFT); + if (!esct) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + } + } + return false; + case CU_CIRC: + if(record->event.pressed) { + timer_timeout(); + unregister_code(KC_LSFT); + unregister_code(DE_CIRC); + register_code(DE_CIRC); + unregister_code(DE_CIRC); + if (!esct) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + if (lshift || rshift) + register_code(KC_LSFT); + } + return false; + case CU_QUOT: + if(record->event.pressed){ + timer_timeout(); + register_code(KC_LSFT); + if (lshift || rshift){ + layer_on(_DEADKEY); + } else { + unregister_code(DE_HASH); + register_code(DE_HASH); + add_to_prev(DE_HASH); + } + } else { + unregister_code(DE_HASH); + unreg_prev(); + if (lshift || rshift) + register_code(KC_LSFT); + else + unregister_code(KC_LSFT); + } + return false; + case CU_6: + if(record->event.pressed){ + timer_timeout(); + unregister_code(KC_LSFT); + if (lshift || rshift){ + unregister_code(DE_CIRC); + register_code(DE_CIRC); + unregister_code(DE_CIRC); + if (!esct) { + register_code(KC_SPC); + unregister_code(KC_SPC); + } + register_code(KC_LSFT); + } else { + register_code(DE_6); + } + } else { + unregister_code(DE_6); + } + return false; + case CU_COMM: + SHIFT_NO(DE_COMM, DE_LESS) + case CU_DOT: + SHIFT_NORM(DE_DOT, DE_LESS) + case CU_SLSH: + SHIFT_ALL(DE_7, DE_SS) + case CU_SCLN: + SHIFT_ALL(DE_COMM, DE_DOT) + case CU_3: + SHIFT_NO(DE_3, DE_HASH) + case CU_7: + SHIFT_NORM(DE_7, DE_6) + case CU_8: + SHIFT_NORM(DE_8, DE_PLUS) + case CU_9: + SHIFT_NORM(DE_9, DE_8) + case CU_0: + SHIFT_NORM(DE_0, DE_9) + case CU_EQL: + SHIFT_SWITCH(DE_0, DE_PLUS) + case CU_LBRC: + SHIFT_ALGR(DE_8, DE_7) + case CU_RBRC: + SHIFT_ALGR(DE_9, DE_0) + case CU_BSLS: + SHIFT_ALGR(DE_SS, DE_LESS) + case CU_Z: + CTRL(DE_Z, KC_Z) + case CU_Y: + CTRL(DE_Y, KC_Y) + case KC_LCTL: + case KC_RCTL: + if(!record->event.pressed) { + unregister_code(KC_Z); + unregister_code(KC_Y); + } + return true; + #endif + + default: + if(record->event.pressed) { + timer_timeout(); + + #ifdef GERMAN_ENABLE + if (lshift || rshift) + register_code(KC_LSFT); + else + unregister_code(KC_LSFT); + #endif + + } + return true; + } +} diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h new file mode 100644 index 0000000000..42879d2efb --- /dev/null +++ b/users/spacebarracecar/spacebarracecar.h @@ -0,0 +1,242 @@ +#pragma once + +#include "quantum.h" +#include "keymap_german.h" + +enum userspace_layers { + _DEADKEY = 14, //change if more than 16 layers are required + _NAV +}; + +enum userspace_custom_keycodes { + CU_GAME = SAFE_RANGE, // Toggle game mode on/off + CU_NAV, // NAV | ESC + + #ifdef GERMAN_ENABLE + CU_LSFT, // LSFT | ( + CU_RSFT, // LSFT | ) + CU_COMM, // , | < + CU_DOT, // . | > + CU_SLSH, // / | ? + CU_SCLN, // ; | : + CU_QUOT, // ' | Enable deadkey layer + CU_GRV, // ` | ~ + CU_CIRC, // ^ + CU_3, // 3 | # + CU_6, // 6 | ^ + CU_7, // 7 | & + CU_8, // 8 | * + CU_9, // 9 | ( + CU_0, // 0 | ) + CU_EQL, // = | + + CU_LBRC, // [ | { + CU_RBRC, // ] | } + CU_BSLS, // \ | | + CU_Z, // Z | Y in conjunction with ctrl + CU_Y, // Y | Z in conjunction wiht ctrl + CU_ESCT, // Toggle escape of grv and circ on/off + // Deadkey Layer + CU_AE, // Ä + CU_OE, // Ö + CU_UE, // Ü + CU_SS, // ß + CU_DDQ, // " + CU_ED, // Escape deadkey layer + #endif + + #ifdef RGBLIGHT_ENABLE + CU_RGBV, // Cycle through RGB brightness + #endif + + NEW_SAFE_RANGE // Use for keymap specific keycodes +}; + +#ifdef GERMAN_ENABLE +// these save the current shift status +extern bool lshift; +extern bool rshift; +// stuff for custom space cadet shift +extern bool lshiftp; +extern bool rshiftp; +extern uint16_t lshift_timer; +extern uint16_t rshift_timer; + +extern uint8_t prev_indx; +extern uint16_t prev_kcs[6]; + +void add_to_prev(uint16_t kc); +void unreg_prev(void); + +extern bool esct; +#endif + +// stuff for nav esc +extern bool navesc; +extern uint16_t navesc_timer; + +extern bool game; + +void timer_timeout(void); + +bool process_record_userspace(uint16_t keycode, keyrecord_t *record); + +#define CTRLX LCTL(KC_X) +#define CTRLC LCTL(KC_C) +#define CTRLV LCTL(KC_V) + +#define GUIU LGUI(KC_UP) +#define GUID LGUI(KC_DOWN) +#define GUIL LGUI(KC_LEFT) +#define GUIR RGUI(KC_RIGHT) + +// +// Templates for Keys, with custom shifted and non shifted Characters +// + +// Normal shift status +#define SHIFT_NORM(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + if (lshift || rshift) { \ + register_code(KC_LSFT); \ + unregister_code(kc2); \ + register_code(kc2); \ + add_to_prev(kc2); \ + } else { \ + unregister_code(KC_LSFT); \ + unregister_code(kc1); \ + register_code(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ +} \ +return false; + +// Inverted shift status +#define SHIFT_SWITCH(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + if (lshift || rshift) { \ + unregister_code(KC_LSFT); \ + unregister_code(kc2); \ + register_code(kc2); \ + add_to_prev(kc2); \ + } else { \ + register_code(KC_LSFT); \ + unregister_code(kc1); \ + register_code(kc1); \ + add_to_prev(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ + unreg_prev(); \ + if (lshift || rshift) \ + register_code(KC_LSFT); \ + else \ + unregister_code(KC_LSFT); \ +} \ +return false; + +// All shift +#define SHIFT_ALL(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + register_code(KC_LSFT); \ + if (lshift || rshift) { \ + unregister_code(kc2); \ + register_code(kc2); \ + add_to_prev(kc2); \ + } else { \ + unregister_code(kc1); \ + register_code(kc1); \ + add_to_prev(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ + unreg_prev(); \ + if (lshift || rshift) \ + register_code(KC_LSFT); \ + else \ + unregister_code(KC_LSFT); \ +} \ +return false; + +// All no shift +#define SHIFT_NO(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + unregister_code(KC_LSFT); \ + if (lshift || rshift) { \ + unregister_code(kc2); \ + register_code(kc2); \ + add_to_prev(kc2); \ + } else { \ + unregister_code(kc1); \ + register_code(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ + unreg_prev(); \ + if (lshift || rshift) \ + register_code(KC_LSFT); \ + else \ + unregister_code(KC_LSFT); \ +} \ +return false; + +// All algr +#define SHIFT_ALGR(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + unregister_code(KC_LSFT); \ + register_code(DE_ALGR); \ + if (lshift || rshift) { \ + unregister_code(kc2); \ + register_code(kc2); \ + unregister_code(kc2); \ + register_code(KC_LSFT); \ + } else { \ + unregister_code(kc1); \ + register_code(kc1); \ + unregister_code(kc1); \ + } \ + unregister_code(DE_ALGR); \ +} \ +return false; + +// Different keycode for ctrl +#define CTRL(kc1, kc2) \ +if(record->event.pressed) { \ + timer_timeout(); \ + if (lshift || rshift) \ + register_code(KC_LSFT); \ + else \ + unregister_code(KC_LSFT); \ + if (keyboard_report->mods & (MOD_BIT(KC_LCTL) | MOD_BIT(KC_RCTL))){ \ + register_code(kc2); \ + } else { \ + register_code(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ +} \ +return false; + +// Umlaute for deadkey layer +#define UML(kc) \ +if(record->event.pressed) { \ + timer_timeout(); \ + if (lshift || rshift) \ + register_code(KC_LSFT); \ + else \ + unregister_code(KC_LSFT); \ + register_code(kc); \ + unregister_code(kc); \ + layer_off(_DEADKEY); \ +} \ +return false; -- cgit v1.2.3 From 0c3137d8ff0b84ee6b39ea8b85aeb4f82fcd7a9c Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Sat, 15 Sep 2018 22:28:25 +1000 Subject: rgb_matrix: continue calling rgb_matrix_indicators() when toggled off This allows user code to continue to use the matrix for indication, even when the RGB toggle is off, using rgb_matrix_set_color(). Without this change, it's impossible for user code to use the matrix when the toggle is off, as any changes get overwritten with black on the next task cycle, and the indicator code is not called at all. --- quantum/rgb_matrix.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 1f00e9d99b..26ee57f5c2 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -620,7 +620,8 @@ void rgb_matrix_custom(void) { void rgb_matrix_task(void) { static uint8_t toggle_enable_last = 255; if (!rgb_matrix_config.enable) { - rgb_matrix_all_off(); + rgb_matrix_all_off(); + rgb_matrix_indicators(); toggle_enable_last = rgb_matrix_config.enable; return; } -- cgit v1.2.3 From b4f26a46164996f5bce58fbf958145ae64e8ae59 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 4 Oct 2018 20:34:47 -0700 Subject: Keyboard: DZ60: add Plate B layouts (#4076) Adds maximized DZ60 Plate B layout macros in ANSI and ISO, featuring 2.25u Left Shift (1.25u/1u split for ISO) and 1.75u Right Shift with Inverted-T arrow keys. Also supports Split Spacebar and Split Backspace. --- keyboards/dz60/dz60.h | 56 +++++++++++++++++++++++++++++++++++++++++++++++- keyboards/dz60/info.json | 8 +++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 6d80b2c7cb..fac5fa32ff 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -70,7 +70,7 @@ * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ - * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴──────┬┴───┴┬───┬─┴───┤ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ * │▓▓▓▓▓│41 │43 │46 (7u) │4b │4d │▓▓▓▓▓│ * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ */ @@ -224,4 +224,58 @@ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_b_ansi (maximized DZ60 Plate B layout for ANSI) + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬───┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3c │3d │3e │ + * ├────┬───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴──┬┴──┬───┼───┼───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴───┴───┴───┴───┴───┘ +*/ +#define LAYOUT_60_b_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3c, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, KC_NO, k3c, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ +} + +/* LAYOUT_60_b_iso (maximized DZ60 Plate B layout for ISO) + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴┬──┴────┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3c │3d │3e │ + * ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴──┬┴──┬───┼───┼───┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4c │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴───┴───┴───┴───┴───┘ +*/ +#define LAYOUT_60_b_iso( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3c, k3d, k3e, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4c, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, KC_NO, k3c, k3d, k3e }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ +} + #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 4855c3b81a..56e3677b7a 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -36,6 +36,14 @@ "LAYOUT_60_iso_5x1u": { "key_count": 63, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"~", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] + }, + "LAYOUT_60_b_ansi": { + "key_count": 66, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"\\", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] + }, + "LAYOUT_60_b_iso": { + "key_count": 67, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] } } } -- cgit v1.2.3 From 13d67200df2337a2b4dbe86574e77f0e1732aef6 Mon Sep 17 00:00:00 2001 From: eucalyn Date: Sat, 6 Oct 2018 00:43:04 +0900 Subject: Keyboard: set SAFE_RANGE (#4078) --- keyboards/mint60/keymaps/default/keymap.c | 2 +- keyboards/mint60/keymaps/eucalyn/keymap.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/mint60/keymaps/default/keymap.c b/keyboards/mint60/keymaps/default/keymap.c index 42c61ffaad..36895cb474 100644 --- a/keyboards/mint60/keymaps/default/keymap.c +++ b/keyboards/mint60/keymaps/default/keymap.c @@ -31,7 +31,7 @@ extern rgblight_config_t rgblight_config; #define XXXXXXX KC_NO enum custom_keycodes { - RGBRST + RGBRST = SAFE_RANGE }; diff --git a/keyboards/mint60/keymaps/eucalyn/keymap.c b/keyboards/mint60/keymaps/eucalyn/keymap.c index 09b30730ad..566d734a52 100644 --- a/keyboards/mint60/keymaps/eucalyn/keymap.c +++ b/keyboards/mint60/keymaps/eucalyn/keymap.c @@ -31,7 +31,7 @@ extern rgblight_config_t rgblight_config; #define XXXXXXX KC_NO enum custom_keycodes { - RGBRST + RGBRST = SAFE_RANGE }; -- cgit v1.2.3 From ac7b2d92bf1254803ec97c075e6d0c833dfd4146 Mon Sep 17 00:00:00 2001 From: yiancar Date: Thu, 4 Oct 2018 22:37:26 +0100 Subject: ARM SWD guide - Added a detailed (but saddly long) debugging guide. - Modified sidebar and summary to include the links. --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/arm_debugging.md | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+) create mode 100644 docs/arm_debugging.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index a35014dd8c..973428c9e0 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -74,6 +74,7 @@ * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) + * [ARM Debugging Guide](arm_debugging.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/_summary.md b/docs/_summary.md index a35014dd8c..973428c9e0 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -74,6 +74,7 @@ * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) + * [ARM Debugging Guide](arm_debugging.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/arm_debugging.md b/docs/arm_debugging.md new file mode 100644 index 0000000000..491dfe8ad7 --- /dev/null +++ b/docs/arm_debugging.md @@ -0,0 +1,87 @@ +# ARM Debugging usign Eclipse + +This page describes how to setup debugging for ARM MCUs using an SWD adapter and open-source/free tools. In this guide we will install GNU MCU Eclipse IDE for C/C++ Developers and OpenOCD together with all the necessary dependencies. + +This guide is catered towards advance users and assumes you can compile an ARM compatible keyboard on your machine using the MAKE flow. + +## Installing the software + +The main objective here is to get the MCU Eclipse IDE correcly installed on our machine. The necesarry instructions are derived from [this](https://gnu-mcu-eclipse.github.io/install/) install guide. + +### The xPack Manager + +This tool is a software package manager and it is used to help us get the necesarry depencencies. + +XPM runs using Node.js so grab that form [here](https://nodejs.org/en/). After installation, open a terminal and type `npm -v`. A reply with the version number means that the instalation was successful. + +XPM instalation instructions can be found [here](https://www.npmjs.com/package/xpm) and are OS specific. Entering `xpm --version` to your terminal should return the software version. + +### The ARM Toolchain + +Using XPM it is very easy to install the ARM toolchain. Enter the command `xpm install --global @gnu-mcu-eclipse/arm-none-eabi-gcc`. + +### Windows build tools + +If you are using windows you need to install this! + +`xpm install --global @gnu-mcu-eclipse/windows-build-tools` + +### Programer/Debugger Drivers + +Now its the time to install your programer's drivers. This tutorial was made using an ST-Link v2 which you can get from almost anywhere. +If you have an ST-Link the drivers can be found [here](https://www.st.com/en/development-tools/stsw-link009.html) otherwise consult the manufuturer of your tool. + +### OpenOCD + +This dependency allows SWD access from GDB and it is essential for debugging. Run `xpm install --global @gnu-mcu-eclipse/openocd`. + +### Java + +Java is needed by Eclipse so please download it from [here](https://www.oracle.com/technetwork/java/javase/downloads/index.html). + +### GNU MCU Eclipse IDE + +Now its finally time to install the IDE. Use the Release page [here](https://github.com/gnu-mcu-eclipse/org.eclipse.epp.packages/releases/) to get the latest version. + +## Configuring Eclipse + +Open up the Eclipse IDE we just downloaded. To import our QMK directory select File -> Import -> C/C++ -> Existing code as Makefile Project. Select next and use Browse to select your QMK folder. In the tool-chain list select ARM Cross GCC and select Finish. + +Now you can see the QMK folder on the left hand side. Right click it and select Properties. On the left hand side, expand MCU and select ARM Toolchain Paths. Press xPack and OK. Repeat for OpenOCD Path and if you are on windows for Build Tool Path. Select Apply and Close. + +Now its time to install the necessary MCU packages. Go to Packs perspective by selecting Window -> Open Perspective -> Others -> Packs. Now select the yellow refresh symbol next to the Packs tab. This will take a long time as it is requesting the MCU definitions from various places. If some of the links fail you can probably select Ignore. + +When this finishes you must find the MCU which we will be building/debugging for. In this example I will be using the STM32F3 series MCUs. On the left, select STMicroelectonics -> STM32F3 Series. On the middle window we can see the pack. Right click and select Install. Once that is done we can go back to the default perspective, Window -> Open Perspective -> Others -> C/C++. + +We need to let eclipse know the device we intent to build QMK on. Right click on the QMK folder -> Properties -> C/C++ Build -> Settings. Select the Devices tab and under devices select the appropriate variant of your MCU. For my example it is STM32F303CC + +While we are here let's setup the build command as well. Select C/C++ Build and then the Behavior tab. On the build command, replace `all` with your necessary make command. For example for a rev6 Planck with the default keymap this would be `planck/rev6:default`. Select Apply and Close. + +## Building + +If you have setup everything correctly pressing the hammer button should build the firmware for you and a .bin file should appear. + +## Debugging + +### Connecting the Debugger + +ARM MCUs use the Single Wire Debug (SWD) protocol which comprises of the clock (SWCLK) signal and the data (SWDIO) signal. Connecting this two wires and ground should be enough to allow full manipulation of the MCU. Here we assume that the keyboard will be powered though USB. The RESET signal is not necessary as we can manually assert it using the reset button. For a more advance setup, the SWO signal can be used which pipes printf and scanf asynchronously to the host but for our setup we will ignore it. + +NOTE: Make sure the SWCLK and SWDIO pins are not used in the matrix of your keyboard. If they are you can temporarily switch them for some other pins. + +### Configuring the Debugger + +Right click on your QMK folder, select Debug As -> Debug Configuration. Here double click on GDB OpenOCD Debugging. Select the debugger tab and enter the configuration necessary for your MCU. This might take some fiddling and googleing to find out. The default script for the STM32F3 is called stm32f3discovery.cfg. To let OpenOCD know, in the Config options enter `-f board/stm32f3discovery.cfg`. + +NOTE: In my case this configuration script requires editing to disable the reset assertion. The locations of the scripts can be found in the actual executable field usually under the path `openocd/version/.content/scripts/board`. Here I edited `reset_config srst_only` to `reset_config none`. + +Select Apply and Close. + +### Running the Debugger. + +Reset your keyboard. + +Press the bug icon and if all goes well you should soon find yourself in the debug perspective. Here the program counter will pause at the beginning of the main function and way for you to press Play. Most of the features of all debuggers work on ARM MCUs but for exact details google is your friend! + + +Happy debugging! \ No newline at end of file -- cgit v1.2.3 From 27e216fc1a481bb3e65832458bd2b199cb499e0b Mon Sep 17 00:00:00 2001 From: thomasviaud Date: Fri, 5 Oct 2018 21:00:24 +0200 Subject: Keymap: Add french iso layout for dz60 (thomasviaud) (#4080) --- keyboards/dz60/keymaps/thomasviaud/README.md | 4 ++++ keyboards/dz60/keymaps/thomasviaud/keymap.c | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 keyboards/dz60/keymaps/thomasviaud/README.md create mode 100644 keyboards/dz60/keymaps/thomasviaud/keymap.c diff --git a/keyboards/dz60/keymaps/thomasviaud/README.md b/keyboards/dz60/keymaps/thomasviaud/README.md new file mode 100644 index 0000000000..f5bf221a22 --- /dev/null +++ b/keyboards/dz60/keymaps/thomasviaud/README.md @@ -0,0 +1,4 @@ +## French ISO Layout + +Here is a very simple version of a French ISO Layout (handled by OS). +Feel free to take this as base for your own layout. diff --git a/keyboards/dz60/keymaps/thomasviaud/keymap.c b/keyboards/dz60/keymaps/thomasviaud/keymap.c new file mode 100644 index 0000000000..02fdb5a4a0 --- /dev/null +++ b/keyboards/dz60/keymaps/thomasviaud/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_60_iso( + KC_ESC, 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS , 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + + LAYOUT_60_iso( + KC_GRV, 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_DEL, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, + _______, _______, _______, RESET, _______, _______, _______, _______), +}; \ No newline at end of file -- cgit v1.2.3 From 54b61b508be7f0b0d85ecd7c45bc8b6bd51d2140 Mon Sep 17 00:00:00 2001 From: Johannes Huber Date: Fri, 5 Oct 2018 23:49:30 +0200 Subject: E6V2 LE HHKB love (#4079) * Keyboard: E6V2 LE HHKB layout support * Keymap: Add johu's E6V2 LE HHKB layout --- keyboards/e6v2/le/info.json | 7 ++- keyboards/e6v2/le/keymaps/johu/keymap.c | 98 ++++++++++++++++++++++++++++++++ keyboards/e6v2/le/keymaps/johu/readme.md | 40 +++++++++++++ keyboards/e6v2/le/le.h | 28 +++++++++ keyboards/e6v2/readme.md | 2 +- 5 files changed, 172 insertions(+), 3 deletions(-) create mode 100644 keyboards/e6v2/le/keymaps/johu/keymap.c create mode 100644 keyboards/e6v2/le/keymaps/johu/readme.md diff --git a/keyboards/e6v2/le/info.json b/keyboards/e6v2/le/info.json index 9016f413e8..5a44eab18c 100644 --- a/keyboards/e6v2/le/info.json +++ b/keyboards/e6v2/le/info.json @@ -8,9 +8,12 @@ "LAYOUT": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4, "w":1.75}, {"label":"Ctrl", "x":1.75, "y":4, "w":1.25}, {"label":"Win", "x":3, "y":4, "w":1.25}, {"label":"Alt", "x":4.25, "y":4, "w":1.25}, {"x":5.5, "y":4, "w":2.75}, {"x":8.25, "y":4, "w":1.75}, {"x":10, "y":4}, {"label":"Alt", "x":11, "y":4}, {"label":"Win", "x":12, "y":4}, {"label":"Menu", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}] }, - "LAYOUT_60_ansi": { "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_hhkb": { + "key_count": 60, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"label":"\\", "x":13, "y":0}, {"label":"`", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] } } -} \ No newline at end of file +} diff --git a/keyboards/e6v2/le/keymaps/johu/keymap.c b/keyboards/e6v2/le/keymaps/johu/keymap.c new file mode 100644 index 0000000000..691f0e73cd --- /dev/null +++ b/keyboards/e6v2/le/keymaps/johu/keymap.c @@ -0,0 +1,98 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 +#define _SL 2 +#define _CL 3 + +// Tap dance defines +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper (Super+Ctrl+Shift+Alt) +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define KC_SPFN LT(_SL, KC_SPC) // Tap for space, hold for function layer (aka SpaceFN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Layer 0: Base layer (Default layer) + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` | + * |-----------------------------------------------------------------------------------------+ + * |Tab/Hyper| Q | W | E | R | T | Y | U | I | O | P | [ | ] | Bksp | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl/Esc | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | Shift/Ent | FN | + * |-----------------------------------------------------------------------------------------+ + * |LGUI | LAlt | Space | RAlt |RGUI | + * `--------------------------------------------------------------------' + */ + [_BL] = LAYOUT_60_hhkb( + KC_GESC, 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_BSLS, KC_GRV, + HPR_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_BSPC, + CTL_ESC, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, MO(_FL), + KC_LGUI, KC_LALT, KC_SPFN, KC_RALT, KC_RGUI + ), + +/* Layer 1: FN Layer + * ,-----------------------------------------------------------------------------------------. + * | CL | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | Psc | Slck| Paus| Up | | Del | + * |-----------------------------------------------------------------------------------------+ + * | | Vol-| Vol+| Mute| | | * | / | Home| PgUp| Left|Right| | + * |-----------------------------------------------------------------------------------------+ + * | | Prev| Play| Next| | | + | - | End |PgDn| Down| | | + * |-----------------------------------------------------------------------------------------+ + * | | | | Stop | CL | + * `--------------------------------------------------------------------' + */ + [_FL] = LAYOUT_60_hhkb( + TG(_CL), 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_INS, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, _______, KC_DEL, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_PAST, KC_PSLS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_PPLS, KC_PMNS, KC_END, KC_PGDN, KC_DOWN, _______, _______, + _______, _______, _______, KC_MSTP, MO(_CL) + ), + +/* Layer 2: Space FN Layer +* ,-----------------------------------------------------------------------------------------. +* | CL | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Ins | Del | +* |-----------------------------------------------------------------------------------------+ +* | | | | | | | | PgUp| | PgDn| | | | Del | +* |-----------------------------------------------------------------------------------------+ +* | | Vol-| Vol+| Mute| | | Left| Down| Up |Right| | | | +* |-----------------------------------------------------------------------------------------+ +* | | Prev| Play| Next| | | Home| End | | | | | | +* |-----------------------------------------------------------------------------------------+ +* | | | | | CL | +* `--------------------------------------------------------------------' +*/ + [_SL] = LAYOUT_60_hhkb( + TG(_CL), 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_INS, KC_DEL, + _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, KC_PGDN, _______, _______, _______, KC_DEL, + _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, _______, _______, KC_HOME, KC_END, _______, _______, _______, _______, _______, + _______, _______, _______, _______, MO(_CL) + ), + +/* Layer 3: Control Layer + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL- | BL+ | BL | | | | | | | | | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | | RGBT| RGBM| | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | CAPS | Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | + * `--------------------------------------------------------------------' + */ + [_CL] = LAYOUT_60_hhkb( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, BL_TOGG, BL_STEP, BL_DEC, BL_INC, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/e6v2/le/keymaps/johu/readme.md b/keyboards/e6v2/le/keymaps/johu/readme.md new file mode 100644 index 0000000000..605a14a1c3 --- /dev/null +++ b/keyboards/e6v2/le/keymaps/johu/readme.md @@ -0,0 +1,40 @@ +# johu's E6-V2 Last Edition (LE) HHKB +Make example for this keyboard (after setting up your build environment): +```bash +$ make e6v2/le:johu +``` + +Or to make and flash: +```bash +$ make e6v2/le:johu:dfu +``` + +See the [build environment setup] and the [make instructions] for more +information. Brand new to QMK? Start with our [Complete Newbs Guide]. + +## Layer 0: Base Layer +* HHKB Qwerty layout plus some specials: + * The Space key sends `Space` when tapped, toggles to *Space FN Layer* when held + * [Grave Escape] + * The Ctrl key sends `Esc` when tapped, `Ctrl` when held + * The Tab key sends `Tab` when tapped, [Hyper] (`Super+Ctrl+Alt+Shift`) when held + * The right Shift key sends `Enter` when tapped, `Shift` when held + +## Layer 1: Function Layer +* Default HHKB function layer includig the iconic diamond arrow cluster +* Multimedia controls + +## Layer 2: Space FN Layer +* VIM style arrow cluster +* Multimedia controls + +## Layer 3: Control Layer +* Reset button +* RGB controls +* Caps Lock + +[build environment setup]: https://docs.qmk.fm/#/getting_started_build_tools +[make instructions]: https://docs.qmk.fm/#/getting_started_make_guide +[Complete Newbs Guide]: https://docs.qmk.fm/#/newbs +[Grave Escape]: https://beta.docs.qmk.fm/features/feature_grave_esc +[Hyper]: http://brettterpstra.com/2012/12/08/a-useful-caps-lock-key diff --git a/keyboards/e6v2/le/le.h b/keyboards/e6v2/le/le.h index 380efd2a7a..d52560dfbe 100644 --- a/keyboards/e6v2/le/le.h +++ b/keyboards/e6v2/le/le.h @@ -33,4 +33,32 @@ { K40, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, K4A, K4B, KC_NO, K4D, K4E }, \ } +/* LAYOUT_60_hhkb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │0d │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3c │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴──────┬┴───┴┬───┬─┴───┤ + * │▓▓▓▓▓│42 │43 │47 (7u) │4b │4d │▓▓▓▓▓│ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0D, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3E, \ + K42, K43, K47, K4B, K4D \ +)\ +{\ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, KC_NO, K3E }, \ + { KC_NO, KC_NO, K42, K43, KC_NO, KC_NO, KC_NO, K47, KC_NO, KC_NO, KC_NO, K4B, KC_NO, K4D, KC_NO }, \ +} + #endif diff --git a/keyboards/e6v2/readme.md b/keyboards/e6v2/readme.md index 9ebfac4a78..c09d1ccf1b 100644 --- a/keyboards/e6v2/readme.md +++ b/keyboards/e6v2/readme.md @@ -17,4 +17,4 @@ The E6V2 has been available with either a bootmapper client or QMK powered PCB. Please use the appropriate version when making your firmware. Flashing one in place of the other, can brick your PCB. Please be certain whether you have a OE or LE PCB. -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From f1003aaccfdd4210103e796206e6ac40285dab5b Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sat, 6 Oct 2018 06:51:34 +0900 Subject: Keyboard: Helix five_rows keymap reduced size (#4082) * add PERMISSIVE_HOLD in helix:five_rows/config.h * add Eucalyn char layout into helix:five_rows * Helix five_rows keymap: make rgblight modes selectable. No change in build result. * fix keymap.c map comment, add console compile option No change in build result. * Helix five_rows keymap: reduced the size. --- keyboards/helix/config.h | 13 ---- keyboards/helix/rev2/keymaps/five_rows/config.h | 23 ++++-- keyboards/helix/rev2/keymaps/five_rows/keymap.c | 96 +++++++++++++++++-------- keyboards/helix/rev2/keymaps/five_rows/rules.mk | 15 +++- keyboards/helix/rev2/keymaps/led_test/config.h | 20 +++--- keyboards/helix/rev2/keymaps/led_test/rules.mk | 2 +- 6 files changed, 112 insertions(+), 57 deletions(-) diff --git a/keyboards/helix/config.h b/keyboards/helix/config.h index b79093d871..fbfbd32804 100644 --- a/keyboards/helix/config.h +++ b/keyboards/helix/config.h @@ -48,17 +48,4 @@ along with this program. If not, see . #define DISABLE_LEADER #endif // USE_Link_Time_Optimization -#if defined(LED_ANIMATIONS) || defined(RGBLIGHT_ANIMATIONS) - #undef RGBLIGHT_ANIMATIONS - #define RGBLIGHT_EFFECT_BREATHING - #define RGBLIGHT_EFFECT_RAINBOW_MOOD - #define RGBLIGHT_EFFECT_RAINBOW_SWIRL - #define RGBLIGHT_EFFECT_SNAKE - #define RGBLIGHT_EFFECT_KNIGHT - #define RGBLIGHT_EFFECT_CHRISTMAS - #define RGBLIGHT_EFFECT_STATIC_GRADIENT - #define RGBLIGHT_EFFECT_RGB_TEST - #define RGBLIGHT_EFFECT_ALTERNATING -#endif - #endif /* CONFIG_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows/config.h b/keyboards/helix/rev2/keymaps/five_rows/config.h index 8372194604..538859bc3c 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows/config.h @@ -21,12 +21,27 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -// if you need more program area, try uncomment follow line -//#include "serial_config_simpleapi.h" - #undef TAPPING_TERM -#define TAPPING_TERM 140 +#define TAPPING_TERM 300 +#define PERMISSIVE_HOLD +/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. + see tmk_core/common/action_tapping.c */ // place overrides here +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows/keymap.c b/keyboards/helix/rev2/keymaps/five_rows/keymap.c index 548caf8220..983bbe9378 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows/keymap.c @@ -10,6 +10,9 @@ #ifdef SSD1306OLED #include "ssd1306.h" #endif +#ifdef CONSOLE_ENABLE + #include +#endif extern keymap_config_t keymap_config; @@ -28,6 +31,7 @@ enum layer_number { _QWERTY = 0, _COLEMAK, _DVORAK, + _EUCALYN, _KEYPAD, _AUX, _KAUX, @@ -41,6 +45,7 @@ enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, DVORAK, + EUCALYN, KEYPAD, EISU, KANA, @@ -72,7 +77,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | ` | ' | N | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * |Lower | Lower| Caps | GUI | Alt | Space| BS | Enter| Space| Alt | GUI | Menu |Lower |Lower | + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT( \ @@ -94,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | ` | ' | K | M | , | . | / | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * |Lower | Lower| Caps | GUI | Alt | Space| BS | Enter| Space| Alt | GUI | Menu |Lower |Lower | + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT( \ @@ -116,7 +121,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | ` | / | B | M | W | V | Z | Shift| * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * |Lower | Lower| Caps | GUI | Alt | Space| BS | Enter| Space| Alt | GUI | Menu |Lower |Lower | + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ [_DVORAK] = LAYOUT( \ @@ -128,6 +133,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ ), + /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | , | . | ; | | M | R | D | Y | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | F | ` | ' | B | H | J | L | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_EUCALYN] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, KC_BSLS, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_RCTL, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_GRV, KC_QUOT, KC_B, KC_H, KC_J, KC_L, KC_SLSH, KC_RSFT, \ + MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \ + LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ + ), + /* Keypad * ,-----------------------------------------. ,-----------------------------------------. * | Tab | / | * | Del | F1 | F6 | | F1 | F6 | Del | Tab | / | * | @@ -239,7 +266,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Adjust (Lower + Raise) * ,-----------------------------------------. ,-----------------------------------------. - * | | |Keypad|Dvorak|Colemk|Qwerty| |Qwerty|Colemk|Dvorak|Keypad| | | + * | |Keypad|Dvorak|Colemk|Euclyn|Qwerty| |Qwerty|Euclyn|Colemk|Dvorak|Keypad| | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | | Reset|RGBRST|RGB ON|Aud on| Win | | Win |Aud on|RGB ON|RGBRST| | | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -251,7 +278,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT( \ - XXXXXXX, XXXXXXX, KEYPAD, DVORAK, COLEMAK, QWERTY, QWERTY, COLEMAK, DVORAK, KEYPAD, XXXXXXX, XXXXXXX, \ + XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \ XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \ RGB_HUI, RGB_SAI, RGB_VAI,RGB_SMOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF,RGB_SMOD, RGB_VAI, RGB_SAI, RGB_HUI, \ RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \ @@ -304,23 +331,25 @@ uint32_t default_layer_state_set_kb(uint32_t state) { current_default_layer = state - 1; // 1<<_DVORAK - 2 == 4 - 2 == _DVORAK (=2) if ( current_default_layer == 3 ) current_default_layer -= 1; - // 1<<_KEYPAD - 5 == 8 - 5 == _KEYPAD (=3) + // 1<<_EUCALYN - 5 == 8 - 5 == _EUCALYN (=3) if ( current_default_layer == 7 ) current_default_layer -= 4; + // 1<<_KEYPAD - 12 == 16 - 12 == _KEYPAD (=4) + if ( current_default_layer == 15 ) current_default_layer -= 11; return state; } void update_base_layer(int base) { if( current_default_layer != base ) { - eeconfig_update_default_layer(1UL<event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + update_base_layer(_EUCALYN); } return false; break; @@ -358,7 +396,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef AUDIO_ENABLE PLAY_SONG(tone_dvorak); #endif - update_base_layer(_KEYPAD); + update_base_layer(_KEYPAD); } return false; break; @@ -468,10 +506,10 @@ static void render_logo(struct CharacterMatrix *matrix) { char buf[30]; if(rgblight_config.enable) { snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", - rgblight_config.mode, - rgblight_config.hue/RGBLIGHT_HUE_STEP, - rgblight_config.sat/RGBLIGHT_SAT_STEP, - rgblight_config.val/RGBLIGHT_VAL_STEP); + rgblight_config.mode, + rgblight_config.hue/RGBLIGHT_HUE_STEP, + rgblight_config.sat/RGBLIGHT_SAT_STEP, + rgblight_config.val/RGBLIGHT_VAL_STEP); matrix_write(matrix, buf); } #endif @@ -481,6 +519,7 @@ static void render_logo(struct CharacterMatrix *matrix) { static const char Qwerty_name[] PROGMEM = " Qwerty"; static const char Colemak_name[] PROGMEM = " Colemak"; static const char Dvorak_name[] PROGMEM = " Dvorak"; +static const char Eucalyn_name[] PROGMEM = " Eucalyn"; static const char Keypad_name[] PROGMEM = " Keypad"; static const char AUX_name[] PROGMEM = ":AUX"; @@ -494,6 +533,7 @@ static const char *layer_names[] = { [_QWERTY] = Qwerty_name, [_COLEMAK] = Colemak_name, [_DVORAK] = Dvorak_name, + [_EUCALYN]= Eucalyn_name, [_KEYPAD] = Keypad_name, [_AUX] = AUX_name, [_KAUX] = KAUX_name, @@ -526,18 +566,18 @@ void render_status(struct CharacterMatrix *matrix) { lstate && name_num < sizeof(layer_names)/sizeof(char *); lstate >>=1, name_num++ ) { if( (lstate & 1) != 0 ) { - if( layer_names[name_num] ) { - matrix_write_P(matrix, layer_names[name_num]); - } + if( layer_names[name_num] ) { + matrix_write_P(matrix, layer_names[name_num]); + } } } // Host Keyboard LED Status char led[40]; snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<. // If you need more program area, try select and reduce rgblight modes to use. // Selection of RGBLIGHT MODE to use. -#undef RGBLIGHT_EFFECT_BREATHING -#undef RGBLIGHT_EFFECT_RAINBOW_MOOD -#undef RGBLIGHT_EFFECT_RAINBOW_SWIRL -#undef RGBLIGHT_EFFECT_SNAKE -#undef RGBLIGHT_EFFECT_KNIGHT -#undef RGBLIGHT_EFFECT_CHRISTMAS -#undef RGBLIGHT_EFFECT_STATIC_GRADIENT -//#undef RGBLIGHT_EFFECT_RGB_TEST // led_test keymap need only this. -#undef RGBLIGHT_EFFECT_ALTERNATING +#if defined(LED_ANIMATIONS) + //#define RGBLIGHT_EFFECT_BREATHING + //#define RGBLIGHT_EFFECT_RAINBOW_MOOD + //#define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_KNIGHT + //#define RGBLIGHT_EFFECT_CHRISTMAS + //#define RGBLIGHT_EFFECT_STATIC_GRADIENT + #define RGBLIGHT_EFFECT_RGB_TEST // led_test keymap need only this. + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index c7ee75c36b..f599cd4f38 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) -- cgit v1.2.3 From 2c1402aa3208d450a7724790b0eb9f2d352a1d9d Mon Sep 17 00:00:00 2001 From: Jereme Corrado Date: Fri, 5 Oct 2018 17:52:46 -0400 Subject: Keymap: Added Planck keymap: jcorrado (#4083) --- keyboards/planck/keymaps/jcorrado/keymap.c | 115 ++++++++++++++++++++++++++++ keyboards/planck/keymaps/jcorrado/readme.md | 9 +++ 2 files changed, 124 insertions(+) create mode 100644 keyboards/planck/keymaps/jcorrado/keymap.c create mode 100644 keyboards/planck/keymaps/jcorrado/readme.md diff --git a/keyboards/planck/keymaps/jcorrado/keymap.c b/keyboards/planck/keymaps/jcorrado/keymap.c new file mode 100644 index 0000000000..35ca76d517 --- /dev/null +++ b/keyboards/planck/keymaps/jcorrado/keymap.c @@ -0,0 +1,115 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2018 Jereme Corrado + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +enum { + _QWERTY = 0, + _NUM, + _SYM_L, + _SYM_R +}; + +#define LMOD_0 LT(_SYM_L, KC_TAB) /* Tab, hold: Sym layer */ +#define LMOD_1 LT(_NUM, KC_ESC) /* Esc, hold: Num layer */ +#define LMOD_2 LSFT_T(KC_CAPS) /* Caps Lock, hold: Left Shift */ + +#define RMOD_0 LT(_SYM_R, KC_BSPC) /* Backspace, hold: Sym layer */ +#define RMOD_1 LT(_NUM, KC_QUOT) /* Quote, hold: Nu layer */ +#define RMOD_2 RSFT_T(KC_ENT) /* Enter, hold: Right Shift */ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Tab/ | Q | W | E | R | T | Y | U | I | O | P | BacSp/ | + * | Sym | | | | | | | | | | | Sym | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Esc/ | A | S | D | F | G | H | J | K | L | : | " | + * | Num | | | | | | | | | | ; | '/Num | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CapLk/ | Z | X | C | V | B | N | M | < | > | ? | Shift/ | + * | Shift | | | | | | | | , | . | / | Enter | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Toggle | ~ | {pipe} | Alt | Ctrl | Space | Space | Ctrl | Alt | { | } | | + * | Num | ` | \ | | | | | | | [ | ] | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_QWERTY] = LAYOUT_planck_grid( + LMOD_0, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, RMOD_0, + LMOD_1, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, RMOD_1, + LMOD_2, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RMOD_2, + _______, KC_GRV, KC_BSLS, KC_LALT, KC_LCTL, KC_SPC, KC_SPC, KC_RCTL, KC_RALT, KC_LBRC, KC_RBRC, _______ +), + + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | = | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | Left | Down | Up | Right | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | Home | PgDown | PgUp | End | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_NUM] = LAYOUT_planck_grid( + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + + +/* + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | + | ! | @ | # | $ | % | ^ | & | * | ( | ) | _ | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + */ + +[_SYM_L] = LAYOUT_planck_grid( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_UNDS, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_SYM_R] = LAYOUT_planck_grid( + KC_PLUS, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +}; diff --git a/keyboards/planck/keymaps/jcorrado/readme.md b/keyboards/planck/keymaps/jcorrado/readme.md new file mode 100644 index 0000000000..3a600dea16 --- /dev/null +++ b/keyboards/planck/keymaps/jcorrado/readme.md @@ -0,0 +1,9 @@ +# jcorrado Planck keymap + +A keymap for the Planck modeled after the way I remap my Kinesis +Advantage keyboards. + +The layout is designed to minimize awkward contortions: all modifier and +layer-activation combinations can be performed with either hand's thumb +and pinky. This leaves the other hand free to complete commands +comfortably. -- cgit v1.2.3 From 60f5ce8890453751a00ab63b150dded25c39db42 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Sat, 6 Oct 2018 16:49:04 +0200 Subject: Keymap: Update keyboards/planck/keymaps/vifon (#4084) * Implement macro recording * Remove off-by-one from the macro recorder * Holding both modifiers enables the third layer * Exit the 3rd layer into one of the secondary ones * Regular Enter and Escape on the secondary layers Useful for the macro recording because the "tap" modifiers always act as modifiers there. * Remove the buffer overflow from the macro recorder When the limit is reached, the backlight blinks with each keypress. * More robust macro recording implementation * Macro record refactoring and improvement - support for a second macro (saved using the end of the macro buffer) - improved reliability * Add comments to my macros * Macro recording: remove a redundant code * Separate the raise+lower layer from the special layer * Add back/forward keys * Bind mouse movement * More readable KC_TRNS * Improve the mouse bindings * Use a convenience macro instead of the low-level ACTION macro * Add mouse to the Dual layer; make most of the layer transparent * New "mouse" layer; clean up the "special" layer * CapsLock, NumLock and ScrollLock on the Special layer * Enable my fix for the stuck modifiers and adjust the dual layer to it * Fix the macro recording after enabling the stuck mods fix * Click with Lower/Raise+Space * Reduce the memory used by the macro recording Previously the auxiliary layers were numbered 30 and 31 which resulted in all 32 array elements being allocated regardless of the actually used layers in the user code. * Optimize source_layers_cache for the cache memory Swapping the array indices should increase the locality of the memory access. * Remove the mouse layer * Use update_tri_layer to simplify the code * Add some custom per-keymap build options * Add ShiftLock * Secure the reset button * Add numeric layer * Remove explicit layer keys on LW and RS layers * Replace Alt+left/right with Back/Forward keys * Sleep/delay key (for macro recording) * App/menu key * Fix stuff after merging to master * Local per-keymap config.h; minor cleanup * Remove the old macro_record.h Replaced with dynamic_macro.h * Adjust my keymap to the current API * Pure Pro Gaming layer Accessible by double tapping the Pure Pro layer. It features switched Lower and Raise layers, for one-handed access to numbers. * Pure Pro Gaming layer: no Mod4, persistent number layer under RShift * Pure Pro Gaming layer activated with long press, not double press * Reduce the size of the vifon keymap See: issue #930 * Increase the dynamic macro buffer The default was actually decreased. The actual used value didn't change. * Add the context menu key * No more strange ideas in the gaming layer * Reduce the firmware size by disabling API_SYSEX_ENABLE * Make slash available on the PP layer (replaces the RESET key) * Add a generic "hold this key" macro * Add a missing undef * Turn LGUI in the gaming layer into LW instead of disabling it It's not as disruptive as LGUI and it makes the LW/RS order kind of more consistent (LW on the left, RS on the right). * Refactor the Pure Pro Gaming layer * Try out the 1st party qmk KC_LOCK (vs my own KM_HOLD) * Alternative way to switch keyboard layouts with the left hand * Add dot & slash to the Pure Pro layer (but not to the Gaming layer) * Now that there is a second KM_LW, we can simplify the layout a bit It was confusing to have the modifiers completely swapped. Just moving them is much more natural. * Disable the console now that qmk got bigger * Update the keymap for the modern qmk standards --- keyboards/planck/keymaps/vifon/keymap.c | 179 ++++++++++++++++++-------------- keyboards/planck/keymaps/vifon/rules.mk | 2 + 2 files changed, 105 insertions(+), 76 deletions(-) diff --git a/keyboards/planck/keymaps/vifon/keymap.c b/keyboards/planck/keymaps/vifon/keymap.c index 0fa8d9066f..6398accc21 100644 --- a/keyboards/planck/keymaps/vifon/keymap.c +++ b/keyboards/planck/keymaps/vifon/keymap.c @@ -1,11 +1,5 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#ifdef BACKLIGHT_ENABLE -# include "backlight.h" -#endif -#include "timer.h" -#include +#include QMK_KEYBOARD_H // 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. @@ -27,90 +21,98 @@ enum planck_keycodes { KM_LW = SAFE_RANGE, KM_RS, KM_SHLK, /* ShiftLock */ + KM_HOLD, /* Any-key Lock */ KM_RST, /* Reset */ KM_NUM, /* Numeric layer */ KM_SLP, /* Sleep 250 ms */ - KM_PPLR, /* Pure Pro layer */ + KM_PP_GAME, /* Pure Pro Gaming layer */ + KM_PP_HOLD, /* Pure Pro / PP Gaming layer */ DYNAMIC_MACRO_RANGE, }; #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QW] = { /* Qwerty */ - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {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}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 }, - {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL} -}, -[_CM] = { /* Colemak */ - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_FN0 }, - {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL} -}, -[_PP] = { /* Pure Pro */ - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT }, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_RSFT, KC_UP, KC_RCTL}, - {KC_LCTL, MO(_DYN),KC_LGUI, KC_LALT, KM_LW, KC_SPC, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT} -}, -[_PPG] = { /* Pure Pro: Gaming */ - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, XXXXXXX, _______, KM_RS , _______, _______, KM_LW , _______, _______, _______, _______}, -}, -[_NM] = { /* Numeric */ - {KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, KC_FN0 }, - {_______, _______, _______, _______, _______, KC_SPC, KC_SPC, _______, _______, _______, _______, _______} -}, -[_LW]= { /* LOWER */ - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT }, - {_______, BL_TOGG, _______, _______, _______, KC_BTN1, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, -[_RS]= { /* RAISE */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL }, - {KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PPLR, KM_RST, KC_ENT }, - {_______, BL_STEP, _______, _______, _______, KC_BTN2, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______} -}, -[_DL]= { /* DUAL */ - {_______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______}, - {_______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2}, - {_______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______}, - {_______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______} -}, -[_DYN]= { /* special */ - {_______, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, KC_PAUS}, - {_______, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK}, - {KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, -}; - -#undef _______ - -const uint16_t PROGMEM fn_actions[] = { - ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [_QW] = LAYOUT_planck_mit( /* Qwerty */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + 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, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL + ), + [_CM] = LAYOUT_planck_mit( /* Colemak */ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT(MOD_RSFT, KC_ENT), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_DOWN, KC_UP, KC_RCTL + ), + [_PP] = LAYOUT_planck_mit( /* Pure Pro */ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MT(MOD_RSFT, KC_DOT), KC_UP, MT(MOD_RCTL, KC_SLSH), + KC_LCTL, MO(_DYN), KC_LGUI, KC_LALT, KM_LW, KC_SPC, KM_RS, KC_RALT, KC_LEFT, KC_DOWN, KC_RGHT + ), + [_PPG] = LAYOUT_planck_mit( /* Pure Pro: Gaming */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, _______, KC_RCTL, + _______, _______, KM_LW, _______, KM_RS, _______, KM_RS , _______, _______, _______, _______ + ), + [_NM] = LAYOUT_planck_mit( /* Numeric */ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, KC_COMM, KC_DOT, _______, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______ + ), + [_LW] = LAYOUT_planck_mit( /* LOWER */ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_ESC, LGUI(KC_1), LGUI(KC_2), LGUI(KC_3), LGUI(KC_4), LGUI(KC_5), KM_NUM, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, LGUI(KC_6), LGUI(KC_7), LGUI(KC_8), LGUI(KC_9), LGUI(KC_0), KM_SLP, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_ENT, + _______, BL_TOGG, _______, _______, _______, KC_BTN1, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + [_RS] = LAYOUT_planck_mit( /* RAISE */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, DF(_QW), DF(_CM), KM_PP_HOLD, KM_RST, KC_ENT, + _______, BL_STEP, _______, _______, _______, KC_BTN2, _______, KC_MPLY, KC_VOLD, KC_VOLU, _______ + ), + [_DL] = LAYOUT_planck_mit( /* DUAL */ + _______, _______, KC_WH_U, KC_MS_U, KC_WH_D, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, _______, + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ACL0, KC_ACL2, + _______, _______, KC_BTN2, KC_BTN3, KC_BTN1, KC_WWW_BACK, KC_WWW_FORWARD, KC_MUTE, _______, _______, _______, _______, + _______, _______, KC_LGUI, KC_LALT, _______, _______, _______, _______, _______, _______, _______ + ), + [_DYN] = LAYOUT_planck_mit( /* special */ + KM_HOLD, DYN_REC_START1, DYN_MACRO_PLAY1, _______, _______, _______, _______, KC_APP, KC_INS, _______, KC_PSCR, KC_PAUS, + KC_LOCK, DYN_REC_START2, DYN_MACRO_PLAY2, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_SLCK, KC_NLCK, + KM_SHLK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KM_PP_GAME, DF(_QW), DF(_PP), _______, _______, _______, _______ + ), }; +/* It's a pseudo-layer composed of two real layers, we need a function for this. */ +void enable_gaming_layer(void) { + default_layer_set((1UL << _PP) | (1UL << _PPG)); +#ifdef BACKLIGHT_ENABLE + backlight_toggle(); + _delay_ms(100); + backlight_toggle(); +#endif +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { static uint16_t key_timer; + static uint8_t ignore_up_events = 0; uint16_t macro_kc = (keycode == MO(_DYN) ? DYN_REC_STOP : keycode); if (!process_record_dynamic_macro(macro_kc, record)) { return false; } + if (ignore_up_events > 0 && keycode != MO(_DYN) && keycode != KM_HOLD && !record->event.pressed) { + ignore_up_events -= 1; + return false; + } + switch (keycode) { case KM_LW: if (record->event.pressed) { @@ -133,7 +135,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KM_SHLK: register_code(KC_LSFT); break; + case KM_HOLD: + if (!record->event.pressed) { + ignore_up_events += 1; + } + break; case KM_RST: + { + /* Make slash available on the PP layer. */ + if ((1UL << _PP) & default_layer_state) { + int32_t old_default_layer_state = default_layer_state; + int32_t old_layer_state = layer_state; + + layer_state = 0; + default_layer_state = (1UL << _QW); + + process_record(record); + + layer_state = old_layer_state; + default_layer_state = old_default_layer_state; + + return false; + } + } + if (record->event.pressed) { key_timer = timer_read(); } else { @@ -146,15 +171,17 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } break; - case KM_PPLR: + case KM_PP_GAME: + if (!record->event.pressed) { + enable_gaming_layer(); + } + break; + case KM_PP_HOLD: if (record->event.pressed) { key_timer = timer_read(); } else { if (timer_elapsed(key_timer) >= 250) { - default_layer_set((1UL << _PP) | (1UL << _PPG)); - backlight_toggle(); - _delay_ms(100); - backlight_toggle(); + enable_gaming_layer(); } else { default_layer_set(1UL << _PP); } diff --git a/keyboards/planck/keymaps/vifon/rules.mk b/keyboards/planck/keymaps/vifon/rules.mk index 15a7b736fd..da83096d6b 100644 --- a/keyboards/planck/keymaps/vifon/rules.mk +++ b/keyboards/planck/keymaps/vifon/rules.mk @@ -16,6 +16,8 @@ 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. +API_SYSEX_ENABLE = no # https://www.reddit.com/r/olkb/comments/5swhij/_/ddie6zq/ +KEY_LOCK_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From cfa9f6ba6da7e6d3435610d6d3b4b7971d3dd547 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 4 Oct 2018 10:17:41 -0700 Subject: Add non-US Hash and Backslash to AutoShift handling --- quantum/process_keycode/process_auto_shift.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/quantum/process_keycode/process_auto_shift.c b/quantum/process_keycode/process_auto_shift.c index 01d99445b0..0d0930ee67 100644 --- a/quantum/process_keycode/process_auto_shift.c +++ b/quantum/process_keycode/process_auto_shift.c @@ -173,6 +173,8 @@ bool process_auto_shift(uint16_t keycode, keyrecord_t *record) { case KC_DOT: case KC_SLSH: case KC_GRAVE: + case KC_NONUS_BSLASH: + case KC_NONUS_HASH: #endif autoshift_flush(); -- cgit v1.2.3 From 7458ac94897afa7f67d98bc40aa1e090c11c235d Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 17:43:37 -0700 Subject: Update Contrib doc (#4068) * Add link for style * ignore java * Add example and update link? * Minor fixes * Change 1TBS text * comments --- docs/contributing.md | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 7ed7cd06a5..bcedcaf974 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -57,14 +57,14 @@ Never made an open source contribution before? Wondering how contributions work Most of our style is pretty easy to pick up on, but right now it's not entirely consistent. You should match the style of the code surrounding your change, but if that code is inconsistent or unclear use the following guidelines: * We indent using two spaces (soft tabs) -* We use One True Brace Style +* We use a modified One True Brace Style * Opening Brace: At the end of the same line as the statement that opens the block * Closing Brace: Lined up with the first character of the statement that opens the block * Else If: Place the closing brace at the beginning of the line and the next opening brace at the end of the same line. * Optional Braces: Always include optional braces. * Good: if (condition) { return false; } * Bad: if (condition) return false; -* We use C style comments: `/* */` +* We encourage use of C style comments: `/* */` * Think of them as a story describing the feature * Use them liberally to explain why particular decisions were made. * Do not write obvious comments @@ -72,6 +72,25 @@ Most of our style is pretty easy to pick up on, but right now it's not entirely * In general we don't wrap lines, they can be as long as needed. If you do choose to wrap lines please do not wrap any wider than 76 columns. * We use `#pragma once` at the start of header files rather than old-style include guards (`#ifndef THIS_FILE_H`, `#define THIS_FILE_H`, ..., `#endif`) +Here is an example for easy reference: + +```c +/* Enums for foo */ +enum foo_state { + FOO_BAR, + FOO_BAZ, +}; + +/* Returns a value */ +int foo(void) { + if (some_condition) { + return FOO_BAR; + } else { + return -1; + } +} +``` + # General Guidelines We have a few different types of changes in QMK, each requiring a different level of rigor. We'd like you to keep the following guidelines in mind no matter what type of change you're making. -- cgit v1.2.3 From f86c0c2643a665dd09bc7a9a2beaaf37f97b9b61 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 17:44:33 -0700 Subject: Update and clarify Unicode documentation (#4065) * Update and clarify Unicode documentation * Fixed UCIS info based on feedback from algernon * Further clarifications and cleanup * Formatting * Add an example for unicode map * fix AutoHotKey title --- docs/feature_unicode.md | 107 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 89 insertions(+), 18 deletions(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index 278b93ad79..f13eed05b8 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -4,45 +4,108 @@ There are three Unicode keymap definition method available in QMK: ## UNICODE_ENABLE -Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in -keymap file, where *n* is a 4 digit hexadecimal. +Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal. ## UNICODEMAP_ENABLE -Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping -table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. -The keycode function is `X(n)` where *n* is the array index of the mapping -table. +Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table. + +And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap: + +```c +enum unicode_name { + BANG, // ‽ + IRONY, // ⸮ + SNEK // snke 🐍 +}; + +const uint32_t PROGMEM unicode_map[] = { + [BANG] = 0x0203D, // ‽ + [IRONY] = 0x02E2E, // ⸮ + [SNEK] = 0x1F40D // snke 🐍 +}: +``` + +Make sure that the order for both matches. ## UCIS_ENABLE -TBD +Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. + +For instance, you would need to have a table like this in your keymap: + +```c +const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE +( + UCIS_SYM("poop", 0x1f4a9), + UCIS_SYM("rofl", 0x1f923), + UCIS_SYM("kiss", 0x1f619) +); +``` + +You run the function, and then type "rofl" and hit enter, it should backspace remove "rofl" and input the `0x1f923` unicode. + +### Customization + +There are several functions that you can add to your keymap to customize the functionality of this feature. + +* `void qk_ucis_start_user(void)` - This runs when you run the "start" function, and can be used to provide feedback. By default, it types out a keyboard emoji. +* `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything. +* `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code. + +The default code for these are: -Unicode input in QMK works by inputing a sequence of characters to the OS, +```c +void qk_ucis_start_user(void) { // outputs keyboard emoji + unicode_input_start(); + register_hex(0x2328); + unicode_input_finish(); +} + +void qk_ucis_success(uint8_t symbol_index) { +} + +void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry + for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { + uint8_t code = qk_ucis_state.codes[i]; + register_code(code); + unregister_code(code); + wait_ms(UNICODE_TYPE_DELAY); + } +} +``` + +## Unicode Input methods + +Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. This is the current list of Unicode input method in QMK: -* UC_OSX: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* UC_OSX_RALT: Same as UC_OSX, but sends the Right Alt key for unicode input -* UC_LNX: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* UC_WIN: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. -* UC_WINC: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. +* _UC_OSX_: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. +* _UC_OSX_RALT_: Same as UC_OSX, but sends the Right Alt key for unicode input +* _UC_LNX_: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. +* _UC_WIN_: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. +* _UC_WINC_: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. + +At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. -To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values seperated by spaces. +## `send_unicode_hex_string` + +To type multiple characters for things like (ノಠ痊ಠ)ノ彡┻━┻, you can use `send_unicode_hex_string()` much like `SEND_STRING()` except you would use hex values separate by spaces. For example, the table flip seen above would be `send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B")` There are many ways to get a hex code, but an easy one is [this site](https://r12a.github.io/app-conversion/). Just make sure to convert to hexadecimal, and that is your string. -# Additional Language Support +## Additional Language Support In `quantum/keymap_extras/`, you'll see various language files - these work the same way as the alternative layout ones do. Most are defined by their two letter country/language code followed by an underscore and a 4-letter abbreviation of its name. `FR_UGRV` which will result in a `ù` when using a software-implemented AZERTY layout. It's currently difficult to send such characters in just the firmware. -# International Characters on Windows +## International Characters on Windows -[AutoHotkey](https://autohotkey.com) allows Windows users to create custom hotkeys among others. +### AutoHotkey allows Windows users to create custom hotkeys among others. -The method does not require Unicode support in the keyboard itself but depends instead of AutoHotkey running in the background. +The method does not require Unicode support in the keyboard itself but depends instead of [AutoHotkey](https://autohotkey.com) running in the background. First you need to select a modifier combination that is not in use by any of your programs. CtrlAltWin is not used very widely and should therefore be perfect for this. @@ -57,3 +120,11 @@ In the default script of AutoHotkey you can define custom hotkeys. The hotkeys above are for the combination CtrlAltGui and CtrlAltGuiShift plus the letter a. AutoHotkey inserts the Text right of `Send, ` when this combination is pressed. + +### US International + +If you enable the US International layout on the system, it will use punctuation to accent the characters. + +For instance, typing "`a" will result in à. + +You can find details on how to enable this [here](https://support.microsoft.com/en-us/help/17424/windows-change-keyboard-layout). -- cgit v1.2.3 From 370fdb89c2b63dafcbbe7deae40189dad26a820f Mon Sep 17 00:00:00 2001 From: Brian Mock Date: Sat, 6 Oct 2018 20:55:48 -0700 Subject: Keymap: Adds TheVan RoadKit Gamepad Layout (#4090) * adds prototype firmware for wavebeem-gamepad * adds installer script * updates readme * updates title * adds prototype firmware for wavebeem-gamepad * adds installer script * updates readme * updates title * removes unused code * removes more code * simplify code --- .../roadkit/keymaps/wavebeem-gamepad/keymap.c | 10 +++++++ .../roadkit/keymaps/wavebeem-gamepad/readme.md | 35 ++++++++++++++++++++++ .../roadkit/keymaps/wavebeem-gamepad/rules.mk | 17 +++++++++++ 3 files changed, 62 insertions(+) create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/keymap.c create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/readme.md create mode 100644 keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk diff --git a/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/keymap.c b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/keymap.c new file mode 100644 index 0000000000..dfdded8e7b --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/keymap.c @@ -0,0 +1,10 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( + KC_TAB, KC_Q, KC_W, KC_E, + KC_ESC, KC_A, KC_S, KC_D, + KC_LSFT, KC_Z, KC_X, KC_C, + KC_F, KC_LALT, KC_LCTL, KC_SPC + ), +}; diff --git a/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/readme.md b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/readme.md new file mode 100644 index 0000000000..7eeb07ede1 --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/readme.md @@ -0,0 +1,35 @@ +![Keymap Diagram](https://i.imgur.com/hRjbhEn.png) + +# Gamepad Layout by @wavebeem + +The concept behind this layout is the left side of a computer keyboard, +optimized with essential keys for playing FPS games. It was designed for TheVan +RoadKit, but it should work for any 4x4 ortholinear keyboard. + +I play with my pinky on `Shift`, thumb on `Space`, and the rest of my fingers on +`W A S D`. I use my thumb for `Control`, `X`, and sometimes `C`. I usually use +`Z` with my ring finger. It also helps to angle my fingers more perpendicular to +the board in order to allow my thumb to more easily access the `Z X C` row. + +The number keys `1 2 3` are missing for weapon switching, but you can usually +switch with the mouse wheel or rebind those to `Z X C` or something else. + +The key `R` for reloading is missing, but I prefer to use my extra mouse buttons +for that. + +I don't really use `Alt` for games, but I kept it around for `Alt-Tab` in +Windows. + +# Keymap Text Diagram + +``` ++-------+-------+-------+-------+ +| Tab | Q | W | E | ++-------+-------+-------+-------+ +| Esc | A | S | D | ++-------+-------+-------+-------+ +| Shift | Z | X | C | ++-------+-------+-------+-------+ +| F | Alt | Ctrl | Space | ++-------+-------+-------+-------+ +``` diff --git a/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk new file mode 100644 index 0000000000..72fd3d30ba --- /dev/null +++ b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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 -- cgit v1.2.3 From aa707c6b9e1e60592e8d7434214eb1549ce9053b Mon Sep 17 00:00:00 2001 From: Bramver Date: Sun, 7 Oct 2018 16:36:01 +0200 Subject: Keymap: Personal Nyquist keymap added. (#4059) * Personal Nyquist keymap added. * Responded to comments for PR. Removed unnecessary imports. Updated way of macros. Removed tick from unicode inputs. * formatting in keymap --- keyboards/nyquist/keymaps/bramver/README.md | 100 ++++++++++ keyboards/nyquist/keymaps/bramver/config.h | 31 +++ keyboards/nyquist/keymaps/bramver/keymap.c | 281 ++++++++++++++++++++++++++++ keyboards/nyquist/keymaps/bramver/rules.mk | 6 + 4 files changed, 418 insertions(+) create mode 100644 keyboards/nyquist/keymaps/bramver/README.md create mode 100644 keyboards/nyquist/keymaps/bramver/config.h create mode 100644 keyboards/nyquist/keymaps/bramver/keymap.c create mode 100644 keyboards/nyquist/keymaps/bramver/rules.mk diff --git a/keyboards/nyquist/keymaps/bramver/README.md b/keyboards/nyquist/keymaps/bramver/README.md new file mode 100644 index 0000000000..2768acdf7d --- /dev/null +++ b/keyboards/nyquist/keymaps/bramver/README.md @@ -0,0 +1,100 @@ +# Nyquist Layout - rev 02 + +Standard qwerty layout. +Limited emoji support and proper mouse settings. + +Mostly based off of my XD75 layout. + +## Keymap + +``` + +/* Base + * ,-----------------------------------------. ,-----------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LOW | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | | N | M | , | . | / | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | EMO | Alt | GUI | SPCE |SP_LMS| |SP_RMS|SP_RMS| GUI | Alt | RAI | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | \ | - | = | [ | ] | | [ | ] | - | = | \ | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | ^Z | ^X | ^C | ^V | | | Play | Vol+ | Vol- | Mute | Next | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + +/* Raise + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | | | | | | | | = | / | * | - | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | F9 | F10 | F11 | F12 | | | | 7 | 8 | 9 | + | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | | 4 | 5 | 6 | , | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | F1 | F2 | F3 | F4 | | | | 1 | 2 | 3 | . | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | 0 | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + +/* LMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | Home | End | PGUP | PGDN | | | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | WH_L | BTN1 | MS_U | BTN2 | WH_U | | | | | | | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | WH_R | MS_L | MS_D | MS_R | WH_D | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | LEFT | DOWN | UP |RIGHT | | | | | | | | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + +/* RMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | PGUP | PGDN | Home | End | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | | | | | | | WH_U | BTN1 | MS_U | BTN2 | WH_L | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | WH_D | MS_L | MS_D | MS_R | WH_R | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | | | | | | | | LEFT | DOWN | UP |RIGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + +/* Emojis + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | RSET | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | CLAP | CUM | BNIS | BUTT | CAR | | FIRE | REDB | MONY | 100 | SOS | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | CELE | PRAY | NAIL | OK | THNK | | UNAM | HEYE | COOL | EYES | SMIR | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | TRIU | SCRM | VOMI | DTIV | EXPL | | HAIR | DANC | STRN | LEFT | RGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ +``` \ No newline at end of file diff --git a/keyboards/nyquist/keymaps/bramver/config.h b/keyboards/nyquist/keymaps/bramver/config.h new file mode 100644 index 0000000000..c908386e28 --- /dev/null +++ b/keyboards/nyquist/keymaps/bramver/config.h @@ -0,0 +1,31 @@ +/* Copyright 2018 darm + * + * 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 + +#define USE_SERIAL +#define MASTER_LEFT + +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/nyquist/keymaps/bramver/keymap.c b/keyboards/nyquist/keymaps/bramver/keymap.c new file mode 100644 index 0000000000..c5eac853cc --- /dev/null +++ b/keyboards/nyquist/keymaps/bramver/keymap.c @@ -0,0 +1,281 @@ +/* Copyright 2018 darm + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +// 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 _BASE 0 +#define _LOWER 1 +#define _RAISE 2 +#define _LMOUSE 3 +#define _RMOUSE 4 +#define _EMOJI 5 + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare + SOS, // Vuile sos + REDB, // Red B + HNDR, // 100 + MONY, + FIRE, + CAR, + BUTT, + BNIS, + CUM, + CLAP, + TRIU, // Fart from nose + SCRM, + VOMI, + DTIV, // Detective + EXPL, // Brainsplosion + HAIR, // Haircut + DANC, // Salsa dancer + STRN, // Stronk + LEFT, // Point Left + RGHT, // Point Right +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, + [SOS] = 0x1F198, + [REDB] = 0x1F171, + [HNDR] = 0x1F4AF, + [MONY] = 0x1F480, + [FIRE] = 0x1F525, + [CAR] = 0x1F697, + [BUTT] = 0x1F351, + [BNIS] = 0x1F346, + [CUM] = 0x1F4A6, + [CLAP] = 0x1F44F, + [TRIU] = 0x1F624, + [SCRM] = 0x1F631, + [VOMI] = 0x1F92E, + [DTIV] = 0x1F575, + [EXPL] = 0x1F92F, + [HAIR] = 0x2640, + [DANC] = 0x1F483, + [STRN] = 0x1F4AA, + [LEFT] = 0x1F448, + [RGHT] = 0x1F449, +}; + +enum custom_keycodes { + CTRL_Z = SAFE_RANGE, + CTRL_X, + CTRL_C, + CTRL_V +}; + +// Enable these functions using FUNC(n) macro. +// const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 +// [0] = , //Hold for momentary LMouse layer, Tap for Space, +// [1] = , //Hold for momentary RMouse layer, Tap for Space, +// [2] = , //Hold for momentary Lower +// [3] = , //Hold for momentary Raise +// [4] = , //Hold for momentary Emoji +// }; + +#define SP_LMS LT(_LMOUSE, KC_SPC) +#define SP_RMS LT(_RMOUSE, KC_SPC) +#define LOW TT(_LOWER) +#define RAI TT(_RAISE) +#define EMO TT(_EMOJI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base + * ,-----------------------------------------. ,-----------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | LOW | A | S | D | F | G | | H | J | K | L | ; | " | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | | N | M | , | . | / | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | EMO | Alt | GUI | SPCE |SP_LMS| |SP_RMS|SP_RMS| GUI | Alt | RAI | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + [_BASE] = LAYOUT( \ + KC_GESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , /**/ KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_BSPC , \ + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , /**/ KC_Y , KC_U , KC_I , KC_O , KC_P , KC_ENT , \ + LOW , KC_A , KC_S , KC_D , KC_F , KC_G , /**/ KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_QUOT , \ + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , /**/ KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT , \ + KC_LCTL , EMO , KC_LALT , KC_LGUI , KC_SPC , SP_LMS , /**/ SP_RMS , KC_SPC , KC_RGUI , KC_RALT , RAI , KC_RCTL \ + ), + + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | \ | - | = | [ | ] | | [ | ] | - | = | \ | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | ^Z | ^X | ^C | ^V | | | Play | Vol+ | Vol- | Mute | Next | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT( \ + TO(0) , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ + _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , \ + _______ , KC_RCBR , KC_MINS , KC_EQL , KC_LBRC , KC_RBRC , /**/ KC_LBRC , KC_RBRC , KC_MINS , KC_EQL , KC_BSLS , KC_DEL , \ + _______ , CTRL_Z , CTRL_X , CTRL_C , CTRL_V , XXXXXXX , /**/ KC_MPLY , KC_VOLU , KC_VOLD , KC_MUTE , KC_MNXT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* Raise + * ,-----------------------------------------. .-----------------------------------------. + * | GESC | | | | | | | | = | / | * | - | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | F9 | F10 | F11 | F12 | | | | 7 | 8 | 9 | + | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F5 | F6 | F7 | F8 | | | | 4 | 5 | 6 | , | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | F1 | F2 | F3 | F4 | | | | 1 | 2 | 3 | . | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | 0 | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_RAISE] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_EQL , KC_SLSH , KC_ASTR , KC_MINS , _______ , \ + _______ , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX , /**/ XXXXXXX , KC_7 , KC_8 , KC_9 , KC_PLUS , _______ , \ + XXXXXXX , KC_F5 , KC_F6 , KC_F7 , KC_F8 , XXXXXXX , /**/ XXXXXXX , KC_4 , KC_5 , KC_6 , KC_COMM , KC_DEL , \ + _______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , XXXXXXX , /**/ XXXXXXX , KC_1 , KC_2 , KC_3 , KC_DOT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , KC_0 , _______ , _______ , _______ , _______ \ + ), + + /* LMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | Home | End | PGUP | PGDN | | | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | WH_L | BTN1 | MS_U | BTN2 | WH_U | | | | | | | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | WH_R | MS_L | MS_D | MS_R | WH_D | | | | | | | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | LEFT | DOWN | UP |RIGHT | | | | | | | | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_LMOUSE] = LAYOUT( \ + TO(0) , XXXXXXX , KC_HOME , KC_END , KC_PGUP , KC_PGDN , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + XXXXXXX , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , KC_DEL , \ + _______ , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , XXXXXXX , /**/ XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , _______ , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* RMOUSE (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | PGUP | PGDN | Home | End | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | | | | | | | WH_U | BTN1 | MS_U | BTN2 | WH_L | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | WH_D | MS_L | MS_D | MS_R | WH_R | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | | | | | | | | LEFT | DOWN | UP |RIGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_RMOUSE] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_PGUP , KC_PGDN , KC_HOME , KC_END , XXXXXXX , _______ , \ + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , \ + XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , KC_DEL , \ + _______ , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ XXXXXXX , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , _______ , \ + _______ , XXXXXXX , _______ , _______ , _______ , XXXXXXX , /**/ _______ , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + + /* Emojis + * ,-----------------------------------------. ,-----------------------------------------. + * | GESC | | | | | | | RSET | | | | | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | CLAP | CUM | BNIS | BUTT | CAR | | FIRE | REDB | MONY | 100 | SOS | Entr | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | CELE | PRAY | NAIL | OK | THNK | | UNAM | HEYE | COOL | EYES | SMIR | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shft | TRIU | SCRM | VOMI | DTIV | EXPL | | HAIR | DANC | STRN | LEFT | RGHT | Shft | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | Alt | GUI | | | | | | GUI | Alt | | Ctrl | + * `-----------------------------------------' `-----------------------------------------' + */ + + [_EMOJI] = LAYOUT( \ + TO(0) , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , /**/ RESET , XXXXXXX , XXXXXXX , XXXXXXX , XXXXXXX , _______ , \ + _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , /**/ X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , \ + XXXXXXX , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , /**/ X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , KC_DEL , \ + _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , /**/ X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , \ + _______ , _______ , _______ , _______ , _______ , XXXXXXX , /**/ XXXXXXX , _______ , _______ , _______ , XXXXXXX , _______ \ + ), + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + if (record->event.pressed) { + switch(keycode) { + case CTRL_Z: + SEND_STRING(SS_LCTRL("z")); + return false; + case CTRL_X: + SEND_STRING(SS_LCTRL("x")); + return false; + case CTRL_C: + SEND_STRING(SS_LCTRL("c")); + return false; + case CTRL_V: + SEND_STRING(SS_LCTRL("v")); + return false; + } + } + + return true; +} diff --git a/keyboards/nyquist/keymaps/bramver/rules.mk b/keyboards/nyquist/keymaps/bramver/rules.mk new file mode 100644 index 0000000000..d211d7b4cf --- /dev/null +++ b/keyboards/nyquist/keymaps/bramver/rules.mk @@ -0,0 +1,6 @@ +# Build options +MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses +EXTRAKEY_ENABLE = yes # Use system and audio control key codes +TAP_DANCE_ENABLE = no # Use multi-tap features +UNICODEMAP_ENABLE = yes # Emojify me pls +NKRO_ENABLE = yes -- cgit v1.2.3 From be2610b6da8e7466107678a4782ddafac7002b1d Mon Sep 17 00:00:00 2001 From: sbstjn Date: Fri, 5 Oct 2018 23:59:05 +0200 Subject: feat: Add 68Keys.io --- keyboards/68keys/68keys.c | 6 +++ keyboards/68keys/68keys.h | 20 ++++++++ keyboards/68keys/README.md | 23 +++++++++ keyboards/68keys/config.h | 42 ++++++++++++++++ keyboards/68keys/info.json | 81 +++++++++++++++++++++++++++++++ keyboards/68keys/keymaps/default/keymap.c | 10 ++++ keyboards/68keys/rules.mk | 22 +++++++++ 7 files changed, 204 insertions(+) create mode 100644 keyboards/68keys/68keys.c create mode 100644 keyboards/68keys/68keys.h create mode 100644 keyboards/68keys/README.md create mode 100644 keyboards/68keys/config.h create mode 100644 keyboards/68keys/info.json create mode 100644 keyboards/68keys/keymaps/default/keymap.c create mode 100644 keyboards/68keys/rules.mk diff --git a/keyboards/68keys/68keys.c b/keyboards/68keys/68keys.c new file mode 100644 index 0000000000..dcf04e6a3d --- /dev/null +++ b/keyboards/68keys/68keys.c @@ -0,0 +1,6 @@ +#include "68keys.h" + +void matrix_init_kb(void) +{ + matrix_init_user(); +} diff --git a/keyboards/68keys/68keys.h b/keyboards/68keys/68keys.h new file mode 100644 index 0000000000..e8a2c4aeed --- /dev/null +++ b/keyboards/68keys/68keys.h @@ -0,0 +1,20 @@ +#include "quantum.h" + +#define LAYOUT_68_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74) \ + { \ + {K00, K01, K02, K03, K04, K05, K06, K07, K08}, \ + {K10, K11, K12, K13, K14, K15, K16, K17, K18}, \ + {K20, K21, K22, K23, K24, K25, K26, K27, K28}, \ + {K30, K31, K32, K33, K34, K35, K36, K37, K38}, \ + {K40, K41, K42, K43, K44, K45, K46, K47, K48}, \ + {K50, K51, K52, K53, K54, K55, K56, K57, K58}, \ + {K60, K61, K62, K63, K64, K65, K66, K67, K68}, \ + { \ + K70, K71, K72, K73, K74 \ + } \ + } diff --git a/keyboards/68keys/README.md b/keyboards/68keys/README.md new file mode 100644 index 0000000000..082a47a755 --- /dev/null +++ b/keyboards/68keys/README.md @@ -0,0 +1,23 @@ +# 68Keys.io + +Custom [68Keys.io](https://68keys.io) DIY keyboard. + +Keyboard Maintainer: [sbstjn](https://sbstjn.com) +Hardware Supported: Pro Micro +Hardware Availability: [DIY Guide](https://68keys.io) + +Make example for this keyboard (after setting up your build environment): + +```bash +$ > cd qmk_firmware/ +$ > make 68keys:default +``` + +Example of flashing this keyboard: + +```bash +$ > cd qmk_firmware/ +$ > make 68keys:default:avrdude +``` + +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/68keys/config.h b/keyboards/68keys/config.h new file mode 100644 index 0000000000..07c87563d3 --- /dev/null +++ b/keyboards/68keys/config.h @@ -0,0 +1,42 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0068 +#define MANUFACTURER 68Keys.io +#define PRODUCT The 68Keys.io Keyboard +#define DESCRIPTION A 68 keys mechanical keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 9 + +#define MATRIX_ROW_PINS \ + { \ + B6, B2, B3, B1, F7, F6, F5, F4 \ + } +#define MATRIX_COL_PINS \ + { \ + D3, D2, D1, D0, D4, C6, D7, E6, B4 \ + } +#define UNUSED_PINS + +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define DEBOUNCING_DELAY 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/68keys/info.json b/keyboards/68keys/info.json new file mode 100644 index 0000000000..b24e22b0a1 --- /dev/null +++ b/keyboards/68keys/info.json @@ -0,0 +1,81 @@ +{ + "keyboard_name": "68Keys.io", + "url": "https://68keys.io", + "maintainer": "qmk", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT_68_ansi": { + "layout": [ + { "label": "~", "x": 0, "y": 0 }, + { "label": "!", "x": 1, "y": 0 }, + { "label": "@", "x": 2, "y": 0 }, + { "label": "#", "x": 3, "y": 0 }, + { "label": "$", "x": 4, "y": 0 }, + { "label": "%", "x": 5, "y": 0 }, + { "label": "^", "x": 6, "y": 0 }, + { "label": "&", "x": 7, "y": 0 }, + { "label": "*", "x": 8, "y": 0 }, + { "label": "(", "x": 9, "y": 0 }, + { "label": ")", "x": 10, "y": 0 }, + { "label": "_", "x": 11, "y": 0 }, + { "label": "+", "x": 12, "y": 0 }, + { "label": "Backspace", "x": 13, "y": 0, "w": 2 }, + { "label": "ESC", "x": 15.25, "y": 0 }, + { "label": "PGUP", "x": 16.25, "y": 0 }, + { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 1 }, + { "label": "W", "x": 2.5, "y": 1 }, + { "label": "E", "x": 3.5, "y": 1 }, + { "label": "R", "x": 4.5, "y": 1 }, + { "label": "T", "x": 5.5, "y": 1 }, + { "label": "Y", "x": 6.5, "y": 1 }, + { "label": "U", "x": 7.5, "y": 1 }, + { "label": "I", "x": 8.5, "y": 1 }, + { "label": "O", "x": 9.5, "y": 1 }, + { "label": "P", "x": 10.5, "y": 1 }, + { "label": "{", "x": 11.5, "y": 1 }, + { "label": "}", "x": 12.5, "y": 1 }, + { "label": "|", "x": 13.5, "y": 1, "w": 1.5 }, + { "label": "DEL", "x": 15.25, "y": 1 }, + { "label": "PGDN", "x": 16.25, "y": 1 }, + { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 2 }, + { "label": "S", "x": 2.75, "y": 2 }, + { "label": "D", "x": 3.75, "y": 2 }, + { "label": "F", "x": 4.75, "y": 2 }, + { "label": "G", "x": 5.75, "y": 2 }, + { "label": "H", "x": 6.75, "y": 2 }, + { "label": "J", "x": 7.75, "y": 2 }, + { "label": "K", "x": 8.75, "y": 2 }, + { "label": "L", "x": 9.75, "y": 2 }, + { "label": ":", "x": 10.75, "y": 2 }, + { "label": "\"", "x": 11.75, "y": 2 }, + { "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 }, + { "label": "Shift", "x": 0, "y": 3, "w": 2.25 }, + { "label": "Z", "x": 2.25, "y": 3 }, + { "label": "X", "x": 3.25, "y": 3 }, + { "label": "C", "x": 4.25, "y": 3 }, + { "label": "V", "x": 5.25, "y": 3 }, + { "label": "B", "x": 6.25, "y": 3 }, + { "label": "N", "x": 7.25, "y": 3 }, + { "label": "M", "x": 8.25, "y": 3 }, + { "label": "<", "x": 9.25, "y": 3 }, + { "label": ">", "x": 10.25, "y": 3 }, + { "label": "?", "x": 11.25, "y": 3 }, + { "label": "Shift", "x": 12.25, "y": 3, "w": 2.75 }, + { "x": 15.25, "y": 3 }, + { "label": "CTRL", "x": 0, "y": 4, "w": 1.25 }, + { "label": "ALT", "x": 1.25, "y": 4, "w": 1.25 }, + { "label": "GUI", "x": 2.5, "y": 4, "w": 1.25 }, + { "x": 3.75, "y": 4, "w": 6.25 }, + { "label": "GUI", "x": 10, "y": 4, "w": 1.25 }, + { "label": "ALT", "x": 11.25, "y": 4, "w": 1.25 }, + { "label": "CTRL", "x": 12.5, "y": 4, "w": 1.25 }, + { "x": 14.25, "y": 4 }, + { "x": 15.25, "y": 4 }, + { "x": 16.25, "y": 4 } + ] + } + } +} diff --git a/keyboards/68keys/keymaps/default/keymap.c b/keyboards/68keys/keymaps/default/keymap.c new file mode 100644 index 0000000000..8f23d22462 --- /dev/null +++ b/keyboards/68keys/keymaps/default/keymap.c @@ -0,0 +1,10 @@ +#include QMK_KEYBOARD_H +#include "68keys.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_68_ansi( + 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_ESC, 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_PGDN, + KC_CAPSLOCK, 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_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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT)}; diff --git a/keyboards/68keys/rules.mk b/keyboards/68keys/rules.mk new file mode 100644 index 0000000000..f1a56d496d --- /dev/null +++ b/keyboards/68keys/rules.mk @@ -0,0 +1,22 @@ +LAYOUTS = 68_ansi + +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT +BOOTLOADER = atmel-dfu + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration (+1000) +MOUSEKEY_ENABLE = no # Mouse keys (+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control (+450) +CONSOLE_ENABLE = no # Console for debug (+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + -- cgit v1.2.3 From 914d42acd01cae9fa03d9368f9316a1e1017fb17 Mon Sep 17 00:00:00 2001 From: chipperdoodles Date: Sun, 7 Oct 2018 11:23:41 -0700 Subject: Update Bluetooth docs (#4062) * syncing upstream * Bluetooth Doc update More Description in bluetooth section, Addition to Config options rules.mk section. * merge upstream chibios * lib/chibios checkout * Additional EZ key Section added back EZ-Key diy link, Cleaned up some errors --- docs/config_options.md | 4 +++- docs/feature_bluetooth.md | 32 +++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index 072857727b..4678a7146c 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -245,7 +245,9 @@ Use these to enable or disable building certain features. The more you have enab * `UNICODE_ENABLE` * Unicode * `BLUETOOTH_ENABLE` - * Enable Bluetooth with the Adafruit EZ-Key HID + * Legacy option to Enable Bluetooth with the Adafruit EZ-Key HID. See BLUETOOTH +* `BLUETOOTH` + * Current options are AdafruitEzKey, AdafruitBLE, RN42 * `SPLIT_KEYBOARD` * Enables split keyboard support (dual MCU like the let's split and bakingpy's boards) and includes all necessary files located at quantum/split_common * `WAIT_FOR_USB` diff --git a/docs/feature_bluetooth.md b/docs/feature_bluetooth.md index f647adc727..3ffbfa0680 100644 --- a/docs/feature_bluetooth.md +++ b/docs/feature_bluetooth.md @@ -1,10 +1,40 @@ # Bluetooth -## Bluetooth Functionality +## Bluetooth Known Supported Hardware +Currently Bluetooth support is limited to AVR based chips. For Bluetooth 2.1 Qmk has support for RN-42 HID Firmware and Bluefruit EZ Key the later of which is not produced anymore. For more recent BLE protocols currently only the Adafruit Bluefruit SPI friend is directly supported. BLE is needed to connect to iOS devices. Note iOS does not support Mouse Input. + +|Board |Bluetooth Protocol |Connection Type |Rules.mk |Bluetooth Chip| +|----------------------------------------------------------------|----------------------------|----------------|---------------------------|--------------| +|[Adafruit EzKey HID]("https://www.adafruit.com/product/1535") |Bluetooth Classic | UART | BLUETOOTH = AdafruitEZKey | | +|Rover Networks RN-42 (Sparkfun Bluesmirf) |Bluetooth Classic | UART | BLUETOOTH = RN42 | RN-42 | +|[Bluefruit LE SPI Friend](https://www.adafruit.com/product/2633)|Bluetooth Low Energy | SPI | BLUETOOTH = AdafruitBLE | nRF5182 | + +Not Supported Yet but possible: +* [Bluefruit LE UART Friend](https://www.adafruit.com/product/2479). [Possible tmk implementation found in](https://github.com/tmk/tmk_keyboard/issues/514) +* HC-05 boards flashed with RN-42 firmware. They apparently both use the CSR BC417 Chip. Flashing it with RN-42 firmware gives it HID capability. +* [Sparkfun Bluetooth mate](https://www.sparkfun.com/products/14839) +* HM-13 based boards + +### Adafruit BLE SPI Friend +Currently The only bluetooth chipset supported by QMK is the Adafruit Bluefruit SPI Friend. It's a Nordic nRF5182 based chip running Adafruit's custom firmware. Data is transmitted via Adafruit's SDEP over Hardware SPI. The [Feather 32u4 Bluefruit LE](https://www.adafruit.com/product/2829) is supported as it's an AVR mcu connected via SPI to the Nordic BLE chip with Adafruit firmware. If Building a custom board with the SPI friend it would be easiest to just use the pin selection that the 32u4 feather uses but you can change the pins in the config.h options with the following defines: +* #define AdafruitBleResetPin D4 +* #define AdafruitBleCSPin B4 +* #define AdafruitBleIRQPin E6 + +A Bluefruit UART friend can be converted to an SPI friend, however this [requires](https://github.com/qmk/qmk_firmware/issues/2274) some reflashing and soldering directly to the MDBT40 chip. + +## Adafruit EZ-Key hid This requires [some hardware changes](https://www.reddit.com/r/MechanicalKeyboards/comments/3psx0q/the_planck_keyboard_with_bluetooth_guide_and/?ref=search_posts), but can be enabled via the Makefile. The firmware will still output characters via USB, so be aware of this when charging via a computer. It would make sense to have a switch on the Bluefruit to turn it off at will. + +## Bluetooth Rules.mk Options +Use only one of these +* BLUETOOTH_ENABLE = yes (Legacy Option) +* BLUETOOTH = RN42 +* BLUETOOTH = AdafruitEZKey +* BLUETOOTH = AdafruitBLE ## Bluetooth Keycodes -- cgit v1.2.3 From 98a63d8d6e91fcd0de4e8496d21ceef17b81d5d1 Mon Sep 17 00:00:00 2001 From: yiancar Date: Mon, 8 Oct 2018 23:27:04 +0100 Subject: DC01 updates and I2C avr speed overwrite (#4088) * DC01 updates and I2C avr speed overwrite - General updating of DC01 - Made F_SCL define in AVR I2C driver overwritable from config.h * Update drivers/avr/i2c_master.c --- drivers/avr/i2c_master.c | 2 ++ keyboards/dc01/left/config.h | 2 ++ keyboards/dc01/left/matrix.c | 41 +++++++++++++---------------------------- 3 files changed, 17 insertions(+), 28 deletions(-) diff --git a/drivers/avr/i2c_master.c b/drivers/avr/i2c_master.c index 47c6f8e6c6..a04e6570d7 100755 --- a/drivers/avr/i2c_master.c +++ b/drivers/avr/i2c_master.c @@ -8,7 +8,9 @@ #include "i2c_master.h" #include "timer.h" +#ifndef F_SCL #define F_SCL 400000UL // SCL frequency +#endif #define Prescaler 1 #define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16 ) / 2) diff --git a/keyboards/dc01/left/config.h b/keyboards/dc01/left/config.h index 68484d8355..e3d49404ea 100644 --- a/keyboards/dc01/left/config.h +++ b/keyboards/dc01/left/config.h @@ -46,6 +46,8 @@ along with this program. If not, see . #define MATRIX_COL_PINS { F4, F1, F0, F7, F6, F5 } #define UNUSED_PINS +#define F_SCL 300000UL + /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/dc01/left/matrix.c b/keyboards/dc01/left/matrix.c index 7923766359..806583580d 100644 --- a/keyboards/dc01/left/matrix.c +++ b/keyboards/dc01/left/matrix.c @@ -43,7 +43,7 @@ static uint8_t error_count_arrow = 0; /* Set 0 if debouncing isn't needed */ #ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 +# define DEBOUNCING_DELAY 5 #endif #if (DEBOUNCING_DELAY > 0) @@ -135,10 +135,7 @@ uint8_t matrix_cols(void) { return MATRIX_COLS; } - i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset); -//uint8_t i2c_transaction_numpad(void); -//uint8_t i2c_transaction_arrow(void); //this replases tmk code void matrix_setup(void){ @@ -220,7 +217,7 @@ uint8_t matrix_scan(void) matrix[i] &= 0x3F; //mask bits to keep } } - }else{ //no error + }else{ //no error error_count_right = 0; } @@ -440,40 +437,28 @@ static void unselect_cols(void) // Complete rows from other modules over i2c i2c_status_t i2c_transaction(uint8_t address, uint32_t mask, uint8_t col_offset) { i2c_status_t err = i2c_start((address << 1) | I2C_WRITE, 10); - if (err) return err; - i2c_write(0x01, 10); - if (err) return err; + i2c_write(0x01, 10); //request data in address 1 - i2c_start((address << 1) | I2C_READ, 10); - if (err) return err; + i2c_start((address << 1) | I2C_READ, 5); err = i2c_read_ack(10); if (err == 0x55) { //synchronization byte - for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix - matrix[i] &= mask; //mask bits to keep - err = i2c_read_ack(10); - if (err >= 0) { - matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end - } else { - return err; - } - } - //last read request must be followed by a NACK - matrix[MATRIX_ROWS - 1] &= mask; //mask bits to keep - err = i2c_read_nack(10); - if (err >= 0) { + for (uint8_t i = 0; i < MATRIX_ROWS-1 ; i++) { //assemble slave matrix in main matrix + matrix[i] &= mask; //mask bits to keep + err = i2c_read_ack(10); + matrix[i] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end + } + //last read request must be followed by a NACK + matrix[MATRIX_ROWS - 1] &= mask; //mask bits to keep + err = i2c_read_nack(10); matrix[MATRIX_ROWS - 1] |= ((uint32_t)err << (MATRIX_COLS_SCANNED + col_offset)); //add new bits at the end - } else { - return err; - } + } else { i2c_stop(10); return 1; } i2c_stop(10); - if (err) return err; - return 0; } \ No newline at end of file -- cgit v1.2.3 From be227b43174f6ec9effbbfc25eb9a853b42cbf2f Mon Sep 17 00:00:00 2001 From: captsis <34025500+captsis@users.noreply.github.com> Date: Mon, 8 Oct 2018 15:20:31 -1000 Subject: Keyboard: add orange75 (#4093) * New Keyboard: orange75 Co-Authored-By: fox-lab * Update keyboards/orange75/info.json corrected * #4093 corrections * added del to layout again * clarified supported hardware * directives... * Update keyboards/orange75/config.h * Update keyboards/orange75/readme.md --- keyboards/orange75/config.h | 35 ++++++++++++++ keyboards/orange75/info.json | 12 +++++ keyboards/orange75/keymaps/default/keymap.c | 53 +++++++++++++++++++++ keyboards/orange75/orange75.c | 1 + keyboards/orange75/orange75.h | 29 ++++++++++++ keyboards/orange75/readme.md | 16 +++++++ keyboards/orange75/rules.mk | 73 +++++++++++++++++++++++++++++ 7 files changed, 219 insertions(+) create mode 100644 keyboards/orange75/config.h create mode 100644 keyboards/orange75/info.json create mode 100644 keyboards/orange75/keymaps/default/keymap.c create mode 100644 keyboards/orange75/orange75.c create mode 100644 keyboards/orange75/orange75.h create mode 100644 keyboards/orange75/readme.md create mode 100644 keyboards/orange75/rules.mk diff --git a/keyboards/orange75/config.h b/keyboards/orange75/config.h new file mode 100644 index 0000000000..7d1b497be0 --- /dev/null +++ b/keyboards/orange75/config.h @@ -0,0 +1,35 @@ +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEEB +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Fox-Lab +#define PRODUCT Orange75 +#define DESCRIPTION Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 15 +#define MATRIX_COLS 6 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { E6,F0, F1, F4, F5, F6, F7, C7, C6, B6, B4, D7, D4, D5, D6 } +#define MATRIX_COL_PINS { D3, D2, D1, D0, B7, B3 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 3 + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 diff --git a/keyboards/orange75/info.json b/keyboards/orange75/info.json new file mode 100644 index 0000000000..093b4cd4ec --- /dev/null +++ b/keyboards/orange75/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Orange75", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Home", "x":15, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"End", "x":15, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Page Up", "x":15, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"label":"Up", "x":14, "y":4.25}, {"label":"Page Down", "x":15, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"Alt", "x":10, "y":5.25, "w":1.25}, {"label":"Fn", "x":11.25, "y":5.25, "w":1.25}, {"label":"Left", "x":13, "y":5.25}, {"label":"Down", "x":14, "y":5.25}, {"label":"Right", "x":15, "y":5.25}] + } + } +} \ No newline at end of file diff --git a/keyboards/orange75/keymaps/default/keymap.c b/keyboards/orange75/keymaps/default/keymap.c new file mode 100644 index 0000000000..50aaf718ec --- /dev/null +++ b/keyboards/orange75/keymaps/default/keymap.c @@ -0,0 +1,53 @@ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + 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_DEL, + 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_HOME, + 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_END, + 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_PGUP, + KC_LSFT, LT(1, KC_NO), 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, LT(1, KC_NO), KC_LEFT, KC_DOWN, KC_RGHT), + + LAYOUT( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, + _______, _______, _______, _______, _______, _______, _______, _______, _______) +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 1); PORTB &= ~(1 << 1); + } else { + DDRB &= ~(1 << 1); PORTB &= ~(1 << 1); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } +} \ No newline at end of file diff --git a/keyboards/orange75/orange75.c b/keyboards/orange75/orange75.c new file mode 100644 index 0000000000..2d5f73048a --- /dev/null +++ b/keyboards/orange75/orange75.c @@ -0,0 +1 @@ +#include "orange75.h" \ No newline at end of file diff --git a/keyboards/orange75/orange75.h b/keyboards/orange75/orange75.h new file mode 100644 index 0000000000..1b351a595c --- /dev/null +++ b/keyboards/orange75/orange75.h @@ -0,0 +1,29 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514 \ +) { \ + { K000, K100, K200, K300, K400, K500 }, \ + { KC_NO, K101, K201, K301, K401, K501 }, \ + { K002, K102, K202, K302, K402, K502 }, \ + { K003, K103, K203, K303, K403, KC_NO}, \ + { K004, K104, K204, K304, K404, KC_NO}, \ + { K005, K105, K205, K305, K405, KC_NO}, \ + { K006, K106, K206, K306, K406, K506 }, \ + { K007, K107, K207, K307, K407, KC_NO}, \ + { K008, K108, K208, K308, K408, KC_NO}, \ + { K009, K109, K209, K309, K409, KC_NO}, \ + { K010, K110, K210, K310, K410, K510 }, \ + { K011, K111, K211, K311, K411, K511 }, \ + { K012, K112, K212, K312, K412, K512 }, \ + { K013, K113, K213, KC_NO,K413, K513 }, \ + { K014, K114, K214, K314, K414, K514 } \ +} + diff --git a/keyboards/orange75/readme.md b/keyboards/orange75/readme.md new file mode 100644 index 0000000000..9106744062 --- /dev/null +++ b/keyboards/orange75/readme.md @@ -0,0 +1,16 @@ +# Orange75 + +![Orange75](https://i.imgur.com/eAfiwwM.jpg) + +A 75% made by Fox Lab. + +Keyboard Maintainer: [captsis](https://github.com/captsis), [fox-lab](https://github.com/fox-lab) +Hardware Supported: Orange75 powered by the ATmega32U4 +Hardware Availability: [zFrontier](https://en.zfrontier.com/collections/keyboards/products/foxlab-orange75), [Geekhack GB](https://geekhack.org/index.php?topic=95080.0) + + +Make example for this keyboard (after setting up your build environment): + + make orange75: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). \ No newline at end of file diff --git a/keyboards/orange75/rules.mk b/keyboards/orange75/rules.mk new file mode 100644 index 0000000000..0f9672a51c --- /dev/null +++ b/keyboards/orange75/rules.mk @@ -0,0 +1,73 @@ +# MCU name +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 = atmel-dfu + + +# 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 +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file -- cgit v1.2.3 From 42add5450d453d734833a7b978e4ab6907ab1fe1 Mon Sep 17 00:00:00 2001 From: Grady Sigler Date: Mon, 8 Oct 2018 20:50:42 -0600 Subject: Keymap: Iris Keymap (#4100) * IRIS Keyboard Keymap I wanted a keymap that really changed things up. I also found that as a programmer I need as many symbols as I can get. * Make cmd-option-escape work on a mac * Add more prettyfication. * Add other types of hold * More work on the layer keys * tweaks * More tweaks. * more tweaks * Remove OSL/OSM they didnt seem to work very well --- keyboards/iris/keymaps/gsigler/config.h | 33 +++++++++++++++ keyboards/iris/keymaps/gsigler/keymap.c | 74 +++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/gsigler/rules.mk | 3 ++ 3 files changed, 110 insertions(+) create mode 100644 keyboards/iris/keymaps/gsigler/config.h create mode 100644 keyboards/iris/keymaps/gsigler/keymap.c create mode 100644 keyboards/iris/keymaps/gsigler/rules.mk diff --git a/keyboards/iris/keymaps/gsigler/config.h b/keyboards/iris/keymaps/gsigler/config.h new file mode 100644 index 0000000000..e1793fb1b8 --- /dev/null +++ b/keyboards/iris/keymaps/gsigler/config.h @@ -0,0 +1,33 @@ +/* +Copyright 2018 Grady Sigler + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define AUTO_SHIFT_TIMEOUT 95 +#define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ +#define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ diff --git a/keyboards/iris/keymaps/gsigler/keymap.c b/keyboards/iris/keymaps/gsigler/keymap.c new file mode 100644 index 0000000000..f8753cbdcc --- /dev/null +++ b/keyboards/iris/keymaps/gsigler/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum iris_layers { + _QWERTY, + _LOWER, + _RAISE +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + //| `/~ | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | _/- | + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| TAB | Q | W | E | R | T | | Y | U | I | O | P | +/= | + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_EQL, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| RAISE | A | S | D | F | G | | H | J | K | L | :/; | "/' | + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + //| LOWER | Z | X | C | V | B | ESC | | ALT | N | M | /. | ?-/ | |-\ | + LOWER, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_ESC, KC_LALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + // | CTRL | COMMAND| BKSPACE| | SPACE | ENTER | SHIFT | + KC_LCTL, KC_LGUI, KC_BSPC, KC_SPC, KC_ENT, KC_LSFT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), +//KC_LALT ALT + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + //| `/~ | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| TAB | ! | @ | { | } | | | | | | ↑ | | | F12 | + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, KC_F12, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| RAISE | # | $ | ( | ) | ` | | ? | ← | ↓ | → | | VOLUP | + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, KC_QUES, KC_LEFT,KC_DOWN, KC_RGHT, XXXXXXX, KC__VOLUP, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + //| | % | ^ | [ | ] | ~ | ESC | ALT | & | | | | MUTE | VOLDN | + XXXXXXX, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, XXXXXXX, XXXXXXX,XXXXXXX, KC__MUTE,KC__VOLDOWN, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + // | CTRL | COMMAND| BKSPACE| | SPACE | ENTER | SHIFT| + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + //| | | | | | | | | 7 | 8 | 9 | * | / | + KC_ASUP, KC_ASON, KC_ASRP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| | | | | | | | | 4 | 5 | 6 | + | - | + KC_ASDN, KC_ASOFF, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + //| | | | | | | | | 1 | 2 | 3 | | | + XXXXXXX, KC_ASTG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_P1, KC_P2, KC_P3, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + //| LOWER | | | | | | ESC | | ALT | | 0 | . | ENTER | = | | + KC_TRNS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_TRNS, KC_TRNS, XXXXXXX, KC_P0, KC_PDOT, KC_PENT, KC_PEQL, XXXXXXX, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + // | CTRL | COMMAND| BKSPACE | | SPACE | ENTER | SHIFT | + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + +}; diff --git a/keyboards/iris/keymaps/gsigler/rules.mk b/keyboards/iris/keymaps/gsigler/rules.mk new file mode 100644 index 0000000000..0abc28fc59 --- /dev/null +++ b/keyboards/iris/keymaps/gsigler/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +AUTO_SHIFT_ENABLE = yes -- cgit v1.2.3 From 04e28470bcf22b05ca2bd52746c2254cae281836 Mon Sep 17 00:00:00 2001 From: Brian Choromanski Date: Mon, 8 Oct 2018 09:48:44 -0400 Subject: Added OSL to list of layer toggles --- docs/feature_advanced_keycodes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 5f30359e0d..0f5b8618a8 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -27,6 +27,7 @@ These functions allow you to activate layers in various ways. Note that layers a * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From 7f6bb82b9daf51fb79972871e9f85696f783aa7a Mon Sep 17 00:00:00 2001 From: Brian Choromanski Date: Tue, 9 Oct 2018 13:20:09 -0400 Subject: Added link to One Shot Keys --- docs/feature_advanced_keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 0f5b8618a8..2ca533a282 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -27,7 +27,7 @@ These functions allow you to activate layers in various ways. Note that layers a * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. * `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. -* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys.](#one-shot-keys) * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From 5a127293e7dfb348102afcb47d0e21b6fefad50a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 18:02:02 -0700 Subject: Fix formatting in Unicode text --- docs/feature_unicode.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index f13eed05b8..b1527b848a 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -82,11 +82,11 @@ sort of like macro. Unfortunately, each OS has different ideas on how Unicode is This is the current list of Unicode input method in QMK: -* _UC_OSX_: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* _UC_OSX_RALT_: Same as UC_OSX, but sends the Right Alt key for unicode input -* _UC_LNX_: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* _UC_WIN_: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. -* _UC_WINC_: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. +* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. +* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input +* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. +* __UC_WIN__: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. +* __UC_WINC__: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. -- cgit v1.2.3 From 1df10ae3bfc146805c75b06dc0c126cd1ef3a60a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 6 Oct 2018 07:57:55 -0700 Subject: Update default Planck layout to be more in line with standard conventions --- keyboards/planck/keymaps/default/config.h | 6 +----- keyboards/planck/keymaps/default/keymap.c | 21 +++++++++++++++------ 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/keyboards/planck/keymaps/default/config.h b/keyboards/planck/keymaps/default/config.h index fbd2fdb272..6fa31cc8a7 100644 --- a/keyboards/planck/keymaps/default/config.h +++ b/keyboards/planck/keymaps/default/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PLANCK_SOUND) @@ -40,4 +37,3 @@ // Most tactile encoders have detents every 4 stages #define ENCODER_RESOLUTION 4 -#endif diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index cffa5a5df5..0b787cd122 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#include "planck.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #include "muse.h" extern keymap_config_t keymap_config; @@ -276,11 +275,21 @@ void encoder_update(bool clockwise) { } } else { if (clockwise) { - register_code(KC_PGDN); - unregister_code(KC_PGDN); + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif } else { - register_code(KC_PGUP); - unregister_code(KC_PGUP); + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif } } } -- cgit v1.2.3 From f2965e1eeaf1769e106145a9d19f102fcd8fe4d4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 08:00:41 -0700 Subject: Specify max layers supported in layer keycodes --- docs/feature_advanced_keycodes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 2ca533a282..15109e5459 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -26,8 +26,8 @@ These functions allow you to activate layers in various ways. Note that layers a * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. * `LM(layer, mod)` - Momentarily activates *layer* (like `MO`), but with modifier(s) *mod* active. Only supports layers 0-15 and the left modifiers. -* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. -* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys.](#one-shot-keys) +* `LT(layer, kc)` - momentarily activates *layer* when held, and sends *kc* when tapped. Only supports layers 0-15. +* `OSL(layer)` - momentarily activates *layer* until the next key is pressed. See [One Shot Keys](#one-shot-keys) for details and additional functionality. * `TG(layer)` - toggles *layer*, activating it if it's inactive and vice versa * `TO(layer)` - activates *layer* and de-activates all other layers (except your default layer). This function is special, because instead of just adding/removing one layer to your active layer stack, it will completely replace your current active layers, uniquely allowing you to replace higher layers with a lower one. This is activated on keydown (as soon as the key is pressed). * `TT(layer)` - Layer Tap-Toggle. If you hold the key down, *layer* is activated, and then is de-activated when you let go (like `MO`). If you repeatedly tap it, the layer will be toggled on or off (like `TG`). It needs 5 taps by default, but you can change this by defining `TAPPING_TOGGLE` -- for example, `#define TAPPING_TOGGLE 2` to toggle on just two taps. -- cgit v1.2.3 From ab91e07753720f8114d6c427139a1436e6efa3ce Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Tue, 9 Oct 2018 15:14:13 -0400 Subject: Massdrop keyboards console device support for hid_listen Added hid_listen USB device for arm_atsam USB protocol. Debug printing is now done through the console device (CONSOLE_ENABLE = yes) rather than the virtser device, for viewing in hid_listen. Function dpf(...) renamed to CDC_printf(...) and should now be called directly if intending to print to the virtual serial device. --- tmk_core/common.mk | 1 + tmk_core/common/arm_atsam/printf.c | 66 ++++++++++ tmk_core/common/arm_atsam/printf.h | 7 +- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 12 +- tmk_core/protocol/arm_atsam/usb/conf_usb.h | 5 + tmk_core/protocol/arm_atsam/usb/main_usb.c | 14 ++ tmk_core/protocol/arm_atsam/usb/udi_cdc.c | 4 +- tmk_core/protocol/arm_atsam/usb/udi_cdc.h | 1 + tmk_core/protocol/arm_atsam/usb/udi_device_conf.h | 88 +++++++++++-- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 146 +++++++++++++++++++++ tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h | 11 ++ tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c | 6 + tmk_core/protocol/arm_atsam/usb/usb_main.h | 6 + 13 files changed, 347 insertions(+), 20 deletions(-) create mode 100644 tmk_core/common/arm_atsam/printf.c diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 319d196aec..4a0f7dcf9a 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -43,6 +43,7 @@ endif endif ifeq ($(PLATFORM),ARM_ATSAM) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/printf.c TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom.c endif diff --git a/tmk_core/common/arm_atsam/printf.c b/tmk_core/common/arm_atsam/printf.c new file mode 100644 index 0000000000..d49d234de2 --- /dev/null +++ b/tmk_core/common/arm_atsam/printf.c @@ -0,0 +1,66 @@ +/* +Copyright 2018 Massdrop Inc. + +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 . +*/ + +#ifdef CONSOLE_PRINT + +#include "samd51j18a.h" +#include "arm_atsam_protocol.h" +#include "printf.h" +#include +#include + +void console_printf(char *fmt, ...) { + while (udi_hid_con_b_report_trans_ongoing) {} //Wait for any previous transfers to complete + + static char console_printbuf[CONSOLE_PRINTBUF_SIZE]; //Print and send buffer + va_list va; + int result; + + va_start(va, fmt); + result = vsnprintf(console_printbuf, CONSOLE_PRINTBUF_SIZE, fmt, va); + va_end(va); + + uint32_t irqflags; + char *pconbuf = console_printbuf; //Pointer to start send from + int send_out = CONSOLE_EPSIZE; //Bytes to send per transfer + + while (result > 0) { //While not error and bytes remain + while (udi_hid_con_b_report_trans_ongoing) {} //Wait for any previous transfers to complete + + irqflags = __get_PRIMASK(); + __disable_irq(); + __DMB(); + + if (result < CONSOLE_EPSIZE) { //If remaining bytes are less than console epsize + memset(udi_hid_con_report, 0, CONSOLE_EPSIZE); //Clear the buffer + send_out = result; //Send remaining size + } + + memcpy(udi_hid_con_report, pconbuf, send_out); //Copy data into the send buffer + + udi_hid_con_b_report_valid = 1; //Set report valid + udi_hid_con_send_report(); //Send report + + __DMB(); + __set_PRIMASK(irqflags); + + result -= send_out; //Decrement result by bytes sent + pconbuf += send_out; //Increment buffer point by bytes sent + } +} + +#endif //CONSOLE_PRINT diff --git a/tmk_core/common/arm_atsam/printf.h b/tmk_core/common/arm_atsam/printf.h index 3206b40bdb..1f1c2280b5 100644 --- a/tmk_core/common/arm_atsam/printf.h +++ b/tmk_core/common/arm_atsam/printf.h @@ -1,8 +1,11 @@ #ifndef _PRINTF_H_ #define _PRINTF_H_ -int dpf(const char *_Format, ...); -#define __xprintf dpf +#define CONSOLE_PRINTBUF_SIZE 512 + +void console_printf(char *fmt, ...); + +#define __xprintf console_printf #endif //_PRINTF_H_ diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 676dac4ea3..54d056a14e 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -276,9 +276,9 @@ int main(void) host_set_driver(&arm_atsam_driver); -#ifdef VIRTSER_ENABLE +#ifdef CONSOLE_ENABLE uint64_t next_print = 0; -#endif //VIRTSER_ENABLE +#endif //CONSOLE_ENABLE v_5v_avg = adc_get(ADC_5V); @@ -290,15 +290,17 @@ int main(void) main_subtasks(); //Note these tasks will also be run while waiting for USB keyboard polling intervals -#ifdef VIRTSER_ENABLE +#ifdef CONSOLE_ENABLE if (CLK_get_ms() > next_print) { next_print = CLK_get_ms() + 250; - dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n",v_5v,v_5v_avg,v_5v_avg-V5_LOW,v_5v_avg-V5_HIGH,gcr_actual,gcr_desired); + //Add any debug information here that you want to see very often + //dprintf("5v=%u 5vu=%u dlow=%u dhi=%u gca=%u gcd=%u\r\n", v_5v, v_5v_avg, v_5v_avg - V5_LOW, v_5v_avg - V5_HIGH, gcr_actual, gcr_desired); } -#endif //VIRTSER_ENABLE +#endif //CONSOLE_ENABLE } + return 1; } diff --git a/tmk_core/protocol/arm_atsam/usb/conf_usb.h b/tmk_core/protocol/arm_atsam/usb/conf_usb.h index 8f0f472687..c91caffe02 100644 --- a/tmk_core/protocol/arm_atsam/usb/conf_usb.h +++ b/tmk_core/protocol/arm_atsam/usb/conf_usb.h @@ -134,6 +134,11 @@ #define UDI_HID_EXK_DISABLE_EXT() main_exk_disable() #endif +#ifdef CON +#define UDI_HID_CON_ENABLE_EXT() main_con_enable() +#define UDI_HID_CON_DISABLE_EXT() main_con_disable() +#endif + #ifdef MOU #define UDI_HID_MOU_ENABLE_EXT() main_mou_enable() #define UDI_HID_MOU_DISABLE_EXT() main_mou_disable() diff --git a/tmk_core/protocol/arm_atsam/usb/main_usb.c b/tmk_core/protocol/arm_atsam/usb/main_usb.c index e943cbcdcd..0f676ab639 100644 --- a/tmk_core/protocol/arm_atsam/usb/main_usb.c +++ b/tmk_core/protocol/arm_atsam/usb/main_usb.c @@ -88,6 +88,20 @@ void main_exk_disable(void) } #endif +#ifdef CON +volatile bool main_b_con_enable = false; +bool main_con_enable(void) +{ + main_b_con_enable = true; + return true; +} + +void main_con_disable(void) +{ + main_b_con_enable = false; +} +#endif + #ifdef MOU volatile bool main_b_mou_enable = false; bool main_mou_enable(void) diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c index 15f0f760cc..5f3c289e81 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.c @@ -1260,7 +1260,7 @@ uint32_t CDC_print(char *printbuf) char printbuf[CDC_PRINTBUF_SIZE]; -int dpf(const char *_Format, ...) +int CDC_printf(const char *_Format, ...) { va_list va; //Variable argument list variable int result; @@ -1356,7 +1356,7 @@ uint32_t CDC_print(char *printbuf) return 0; } -int dpf(const char *_Format, ...) +int CDC_printf(const char *_Format, ...) { return 0; } diff --git a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h index e134cf2360..86077ce53b 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_cdc.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_cdc.h @@ -365,6 +365,7 @@ extern inbuf_t inbuf; #endif //CDC uint32_t CDC_print(char *printbuf); +int CDC_printf(const char *_Format, ...); uint32_t CDC_input(void); void CDC_init(void); diff --git a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h index c787262340..1e82b9eccb 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_device_conf.h @@ -44,10 +44,10 @@ along with this program. If not, see . #define RAW #endif -//#define CONSOLE_ENABLE //deferred implementation -//#ifdef CONSOLE_ENABLE -//#define CON -//#endif +//#define CONSOLE_ENABLE //rules.mk +#ifdef CONSOLE_ENABLE +#define CON +#endif //#define NKRO_ENABLE //rules.mk #ifdef NKRO_ENABLE @@ -110,8 +110,9 @@ along with this program. If not, see . #endif #ifdef CON -#define CONSOLE_INTERFACE NEXT_INTERFACE_4 -#define NEXT_INTERFACE_5 (CONSOLE_INTERFACE + 1) +#define CON_INTERFACE NEXT_INTERFACE_4 +#define NEXT_INTERFACE_5 (CON_INTERFACE + 1) +#define UDI_HID_CON_IFACE_NUMBER CON_INTERFACE #else #define NEXT_INTERFACE_5 NEXT_INTERFACE_4 #endif @@ -211,11 +212,16 @@ along with this program. If not, see . #endif #ifdef CON -#define CONSOLE_IN_EPNUM NEXT_IN_EPNUM_4 -#define NEXT_IN_EPNUM_5 (CONSOLE_IN_EPNUM + 1) -#define CONSOLE_OUT_EPNUM NEXT_OUT_EPNUM_1 -#define NEXT_OUT_EPNUM_2 (CONSOLE_OUT_EPNUM + 1) -#define CONSOLE_POLLING_INTERVAL 1 +#define CON_IN_EPNUM NEXT_IN_EPNUM_4 +#define UDI_HID_CON_EP_IN CON_IN_EPNUM +#define NEXT_IN_EPNUM_5 (CON_IN_EPNUM + 1) +#define CON_OUT_EPNUM NEXT_OUT_EPNUM_1 +#define UDI_HID_CON_EP_OUT CON_OUT_EPNUM +#define NEXT_OUT_EPNUM_2 (CON_OUT_EPNUM + 1) +#define CON_POLLING_INTERVAL 1 +#ifndef UDI_HID_CON_STRING_ID +#define UDI_HID_CON_STRING_ID 0 +#endif #else #define NEXT_IN_EPNUM_5 NEXT_IN_EPNUM_4 #define NEXT_OUT_EPNUM_2 NEXT_OUT_EPNUM_1 @@ -558,6 +564,66 @@ COMPILER_PACK_RESET() #endif //RAW +// ********************************************************************** +// CON Descriptor structure and content +// ********************************************************************** +#ifdef CON + +COMPILER_PACK_SET(1) + +typedef struct { + usb_iface_desc_t iface; + usb_hid_descriptor_t hid; + usb_ep_desc_t ep_out; + usb_ep_desc_t ep_in; +} udi_hid_con_desc_t; + +typedef struct { + uint8_t array[34]; +} udi_hid_con_report_desc_t; + +#define UDI_HID_CON_DESC {\ + .iface.bLength = sizeof(usb_iface_desc_t),\ + .iface.bDescriptorType = USB_DT_INTERFACE,\ + .iface.bInterfaceNumber = UDI_HID_CON_IFACE_NUMBER,\ + .iface.bAlternateSetting = 0,\ + .iface.bNumEndpoints = 2,\ + .iface.bInterfaceClass = HID_CLASS,\ + .iface.bInterfaceSubClass = HID_SUB_CLASS_NOBOOT,\ + .iface.bInterfaceProtocol = HID_SUB_CLASS_NOBOOT,\ + .iface.iInterface = UDI_HID_CON_STRING_ID,\ + .hid.bLength = sizeof(usb_hid_descriptor_t),\ + .hid.bDescriptorType = USB_DT_HID,\ + .hid.bcdHID = LE16(USB_HID_BDC_V1_11),\ + .hid.bCountryCode = USB_HID_NO_COUNTRY_CODE,\ + .hid.bNumDescriptors = USB_HID_NUM_DESC,\ + .hid.bRDescriptorType = USB_DT_HID_REPORT,\ + .hid.wDescriptorLength = LE16(sizeof(udi_hid_con_report_desc_t)),\ + .ep_out.bLength = sizeof(usb_ep_desc_t),\ + .ep_out.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_out.bEndpointAddress = UDI_HID_CON_EP_OUT | USB_EP_DIR_OUT,\ + .ep_out.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep_out.wMaxPacketSize = LE16(CONSOLE_EPSIZE),\ + .ep_out.bInterval = CON_POLLING_INTERVAL,\ + .ep_in.bLength = sizeof(usb_ep_desc_t),\ + .ep_in.bDescriptorType = USB_DT_ENDPOINT,\ + .ep_in.bEndpointAddress = UDI_HID_CON_EP_IN | USB_EP_DIR_IN,\ + .ep_in.bmAttributes = USB_EP_TYPE_INTERRUPT,\ + .ep_in.wMaxPacketSize = LE16(CONSOLE_EPSIZE),\ + .ep_in.bInterval = CON_POLLING_INTERVAL,\ +} + +#define UDI_HID_CON_REPORT_SIZE CONSOLE_EPSIZE + +extern uint8_t udi_hid_con_report_set[UDI_HID_CON_REPORT_SIZE]; + +//report buffer +extern uint8_t udi_hid_con_report[UDI_HID_CON_REPORT_SIZE]; + +COMPILER_PACK_RESET() + +#endif //CON + // ********************************************************************** // CDC Descriptor structure and content // ********************************************************************** diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 1a6f7905e6..18f9784ae6 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -843,3 +843,149 @@ static void udi_hid_raw_setreport_valid(void) } #endif //RAW + +//******************************************************************************************** +// CON +//******************************************************************************************** +#ifdef CON + +bool udi_hid_con_enable(void); +void udi_hid_con_disable(void); +bool udi_hid_con_setup(void); +uint8_t udi_hid_con_getsetting(void); + +UDC_DESC_STORAGE udi_api_t udi_api_hid_con = { + .enable = (bool(*)(void))udi_hid_con_enable, + .disable = (void (*)(void))udi_hid_con_disable, + .setup = (bool(*)(void))udi_hid_con_setup, + .getsetting = (uint8_t(*)(void))udi_hid_con_getsetting, + .sof_notify = NULL, +}; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_con_rate; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_con_protocol; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_con_report_set[UDI_HID_CON_REPORT_SIZE]; + +bool udi_hid_con_b_report_valid; + +COMPILER_WORD_ALIGNED +uint8_t udi_hid_con_report[UDI_HID_CON_REPORT_SIZE]; + +volatile bool udi_hid_con_b_report_trans_ongoing; + +COMPILER_WORD_ALIGNED +static uint8_t udi_hid_con_report_trans[UDI_HID_CON_REPORT_SIZE]; + +COMPILER_WORD_ALIGNED +UDC_DESC_STORAGE udi_hid_con_report_desc_t udi_hid_con_report_desc = { + { + 0x06, 0x31, 0xFF, // Vendor Page (PJRC Teensy compatible) + 0x09, 0x74, // Vendor Usage (PJRC Teensy compatible) + 0xA1, 0x01, // Collection (Application) + 0x09, 0x75, // Usage (Vendor) + 0x15, 0x00, // Logical Minimum (0x00) + 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) + 0x95, CONSOLE_EPSIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x81, 0x02, // Input (Data) + 0x09, 0x76, // Usage (Vendor) + 0x15, 0x00, // Logical Minimum (0x00) + 0x26, 0xFF, 0x00, // Logical Maximum (0x00FF) + 0x95, CONSOLE_EPSIZE, // Report Count + 0x75, 0x08, // Report Size (8) + 0x91, 0x02, // Output (Data) + 0xC0, // End Collection + } +}; + +static bool udi_hid_con_setreport(void); +static void udi_hid_con_setreport_valid(void); + +static void udi_hid_con_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep); + +bool udi_hid_con_enable(void) +{ + // Initialize internal values + udi_hid_con_rate = 0; + udi_hid_con_protocol = 0; + udi_hid_con_b_report_trans_ongoing = false; + memset(udi_hid_con_report, 0, UDI_HID_CON_REPORT_SIZE); + udi_hid_con_b_report_valid = false; + return UDI_HID_CON_ENABLE_EXT(); +} + +void udi_hid_con_disable(void) +{ + UDI_HID_CON_DISABLE_EXT(); +} + +bool udi_hid_con_setup(void) +{ + return udi_hid_setup(&udi_hid_con_rate, + &udi_hid_con_protocol, + (uint8_t *) &udi_hid_con_report_desc, + udi_hid_con_setreport); +} + +uint8_t udi_hid_con_getsetting(void) +{ + return 0; +} + +static bool udi_hid_con_setreport(void) +{ + if ((USB_HID_REPORT_TYPE_OUTPUT == (udd_g_ctrlreq.req.wValue >> 8)) + && (0 == (0xFF & udd_g_ctrlreq.req.wValue)) + && (UDI_HID_CON_REPORT_SIZE == udd_g_ctrlreq.req.wLength)) { + udd_g_ctrlreq.payload = udi_hid_con_report_set; + udd_g_ctrlreq.callback = udi_hid_con_setreport_valid; + udd_g_ctrlreq.payload_size = UDI_HID_CON_REPORT_SIZE; + return true; + } + return false; +} + +bool udi_hid_con_send_report(void) +{ + if (!main_b_con_enable) { + return false; + } + + if (udi_hid_con_b_report_trans_ongoing) { + return false; + } + + memcpy(udi_hid_con_report_trans, udi_hid_con_report,UDI_HID_CON_REPORT_SIZE); + udi_hid_con_b_report_valid = false; + udi_hid_con_b_report_trans_ongoing = + udd_ep_run(UDI_HID_CON_EP_IN | USB_EP_DIR_IN, + false, + udi_hid_con_report_trans, + UDI_HID_CON_REPORT_SIZE, + udi_hid_con_report_sent); + + return udi_hid_con_b_report_trans_ongoing; +} + +static void udi_hid_con_report_sent(udd_ep_status_t status, iram_size_t nb_sent, udd_ep_id_t ep) +{ + UNUSED(status); + UNUSED(nb_sent); + UNUSED(ep); + udi_hid_con_b_report_trans_ongoing = false; + if (udi_hid_con_b_report_valid) { + udi_hid_con_send_report(); + } +} + +static void udi_hid_con_setreport_valid(void) +{ + +} + +#endif //CON diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h index babfdb7a78..e442919a9b 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.h @@ -85,6 +85,17 @@ extern uint8_t udi_hid_exk_report_set; bool udi_hid_exk_send_report(void); #endif //EXK +//******************************************************************************************** +// CON Console +//******************************************************************************************** +#ifdef CON +extern UDC_DESC_STORAGE udi_api_t udi_api_hid_con; +extern bool udi_hid_con_b_report_valid; +extern uint8_t udi_hid_con_report_set[UDI_HID_CON_REPORT_SIZE]; +extern volatile bool udi_hid_con_b_report_trans_ongoing; +bool udi_hid_con_send_report(void); +#endif //CON + //******************************************************************************************** // MOU Mouse //******************************************************************************************** diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c index 16bd4e514c..2d6e35e254 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd_desc.c @@ -134,6 +134,9 @@ UDC_DESC_STORAGE udc_desc_t udc_desc = { #ifdef EXK .hid_exk = UDI_HID_EXK_DESC, #endif +#ifdef CON + .hid_con = UDI_HID_CON_DESC, +#endif #ifdef NKRO .hid_nkro = UDI_HID_NKRO_DESC, #endif @@ -155,6 +158,9 @@ UDC_DESC_STORAGE udi_api_t *udi_apis[USB_DEVICE_NB_INTERFACE] = { #ifdef EXK &udi_api_hid_exk, #endif + #ifdef CON + &udi_api_hid_con, + #endif #ifdef NKRO &udi_api_hid_nkro, #endif diff --git a/tmk_core/protocol/arm_atsam/usb/usb_main.h b/tmk_core/protocol/arm_atsam/usb/usb_main.h index b7adaa1a72..76ced474dc 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb_main.h +++ b/tmk_core/protocol/arm_atsam/usb/usb_main.h @@ -82,6 +82,12 @@ bool main_exk_enable(void); void main_exk_disable(void); #endif //EXK +#ifdef CON +extern volatile bool main_b_con_enable; +bool main_con_enable(void); +void main_con_disable(void); +#endif //CON + #ifdef MOU extern volatile bool main_b_mou_enable; bool main_mou_enable(void); -- cgit v1.2.3 From 79bff502471d8fd534e9266954a184aa0f7d55c3 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Thu, 11 Oct 2018 04:53:18 +0900 Subject: Keymaps: Helix rgblight mode update (#4091) * Helix each keymap's using rgblight mode symbol instead magic number No change in build result. * Helix pico keymaps: make rgblight modes selectable. No change in build result. * Helix rev2 keymaps: make rgblight modes selectable. No change in build result. * fixed Helix froggy/keymap.c: invalid rgblight mode value 0 to 1 (=RGBLIGHT_MODE_STATIC_LIGHT) * Deselect RGB_TEST and ALTERNATING in Helix rev2,pico keymaps config.h. --- keyboards/helix/pico/keymaps/biacco/config.h | 14 ++++++++++++++ keyboards/helix/pico/keymaps/biacco/rules.mk | 2 +- keyboards/helix/pico/keymaps/default/config.h | 15 +++++++++++++++ keyboards/helix/pico/keymaps/default/keymap.c | 4 ++-- keyboards/helix/pico/keymaps/default/rules.mk | 2 +- keyboards/helix/rev1/keymaps/OLED_sample/keymap.c | 4 ++-- keyboards/helix/rev2/keymaps/default/config.h | 18 +++++++++++++++--- keyboards/helix/rev2/keymaps/default/keymap.c | 4 ++-- keyboards/helix/rev2/keymaps/default/rules.mk | 2 +- keyboards/helix/rev2/keymaps/edvorakjp/config.h | 18 +++++++++++++++--- keyboards/helix/rev2/keymaps/edvorakjp/keymap.c | 4 ++-- keyboards/helix/rev2/keymaps/edvorakjp/rules.mk | 2 +- keyboards/helix/rev2/keymaps/five_rows_jis/config.h | 18 +++++++++++++++--- keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk | 2 +- keyboards/helix/rev2/keymaps/froggy/config.h | 18 +++++++++++++++--- keyboards/helix/rev2/keymaps/froggy/keymap.c | 8 ++++---- keyboards/helix/rev2/keymaps/froggy/rules.mk | 2 +- keyboards/helix/rev2/keymaps/yshrsmz/config.h | 15 +++++++++++++++ keyboards/helix/rev2/keymaps/yshrsmz/keymap.c | 6 +++--- keyboards/helix/rev2/keymaps/yshrsmz/rules.mk | 2 +- 20 files changed, 126 insertions(+), 34 deletions(-) diff --git a/keyboards/helix/pico/keymaps/biacco/config.h b/keyboards/helix/pico/keymaps/biacco/config.h index 776eecfb64..7653185198 100644 --- a/keyboards/helix/pico/keymaps/biacco/config.h +++ b/keyboards/helix/pico/keymaps/biacco/config.h @@ -27,3 +27,17 @@ along with this program. If not, see . #define AUDIO_CLICKY #endif +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk index 0a720002d7..4f264fa952 100644 --- a/keyboards/helix/pico/keymaps/biacco/rules.mk +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -92,7 +92,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/pico/keymaps/default/config.h b/keyboards/helix/pico/keymaps/default/config.h index 6084b0970b..20dfc9f985 100644 --- a/keyboards/helix/pico/keymaps/default/config.h +++ b/keyboards/helix/pico/keymaps/default/config.h @@ -28,4 +28,19 @@ along with this program. If not, see . #define AUDIO_CLICKY #endif +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index 75221d485a..4c58785179 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -238,7 +238,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(16); + //rgblight_mode(RGBLIGHT_MODE_SNAKE + 1); #endif } layer_on(_LOWER); @@ -261,7 +261,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(15); + //rgblight_mode(RGBLIGHT_MODE_SNAKE); #endif } layer_on(_RAISE); diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index afb1240685..b1e219537f 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -92,7 +92,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c index fa51501e62..9b81979ff4 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c +++ b/keyboards/helix/rev1/keymaps/OLED_sample/keymap.c @@ -368,7 +368,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false } else { TOG_STATUS = !TOG_STATUS; - rgblight_mode(16); + rgblight_mode(RGBLIGHT_MODE_SNAKE + 1); } layer_on(_LOWER); update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); @@ -387,7 +387,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false } else { TOG_STATUS = !TOG_STATUS; - rgblight_mode(15); + rgblight_mode(RGBLIGHT_MODE_SNAKE); } layer_on(_RAISE); update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); diff --git a/keyboards/helix/rev2/keymaps/default/config.h b/keyboards/helix/rev2/keymaps/default/config.h index 185e678385..ed37675794 100644 --- a/keyboards/helix/rev2/keymaps/default/config.h +++ b/keyboards/helix/rev2/keymaps/default/config.h @@ -21,9 +21,21 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -// if you need more program area, try uncomment follow line -//#include "serial_config_simpleapi.h" - // place overrides here +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c index 087bd8e517..92393208ce 100644 --- a/keyboards/helix/rev2/keymaps/default/keymap.c +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -373,7 +373,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(16); + //rgblight_mode(RGBLIGHT_MODE_SNAKE + 1); #endif } layer_on(_LOWER); @@ -396,7 +396,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(15); + //rgblight_mode(RGBLIGHT_MODE_SNAKE); #endif } layer_on(_RAISE); diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index 5340a74ba2..14c353d507 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h index ead31605b2..643220383c 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h @@ -1,11 +1,23 @@ #ifndef CONFIG_USER_H #define CONFIG_USER_H -// if you need more program area, try uncomment follow line -//#include "serial_config_simpleapi.h" - #undef TAPPING_FORCE_HOLD #undef TAPPING_TERM #define TAPPING_TERM 120 +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c index 650a39115a..22940f7cbe 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c @@ -35,7 +35,7 @@ void matrix_scan_user(void) { #ifdef RGBLIGHT_ENABLE uint32_t layer_state_set_keymap(uint32_t state) { - rgblight_mode_noeeprom(1); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); switch (biton32(state)) { case _EDVORAKJ1: case _EDVORAKJ2: @@ -52,7 +52,7 @@ uint32_t layer_state_set_keymap(uint32_t state) { rgblight_sethsv_noeeprom_green(); break; default: // for any other layers, or the default layer - rgblight_mode_noeeprom(28); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); rgblight_sethsv_noeeprom_red(); break; } diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk index 67da9c370b..9bd46fabcf 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk +++ b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk @@ -102,7 +102,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h index c380b7db4e..97494c937f 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/config.h +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/config.h @@ -23,9 +23,6 @@ along with this program. If not, see . // place overrides here -// if you need more program area, try uncomment follow line -//#include "serial_config_simpleapi.h" - #ifdef MOUSEKEY_ENABLE #undef MOUSEKEY_INTERVAL #define MOUSEKEY_INTERVAL 0 @@ -43,4 +40,19 @@ along with this program. If not, see . #define MOUSEKEY_DELAY 0 #endif +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index 5340a74ba2..14c353d507 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/rev2/keymaps/froggy/config.h b/keyboards/helix/rev2/keymaps/froggy/config.h index dad2483034..517368ae94 100644 --- a/keyboards/helix/rev2/keymaps/froggy/config.h +++ b/keyboards/helix/rev2/keymaps/froggy/config.h @@ -21,12 +21,24 @@ along with this program. If not, see . #ifndef CONFIG_USER_H #define CONFIG_USER_H -// if you need more program area, try uncomment follow line -//#include "serial_config_simpleapi.h" - #undef TAPPING_TERM #define TAPPING_TERM 200 #define ONESHOT_TAP_TOGGLE 5 /* Tapping this number of times holds the key until tapped this number of times again. */ #define ONESHOT_TIMEOUT 5000 /* Time (in ms) before the one shot key is released */ +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + #endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c index 81a28dfa5d..75c6f08114 100644 --- a/keyboards/helix/rev2/keymaps/froggy/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c @@ -399,7 +399,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { RGBAnimation = true; - rgblight_mode(6); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_MOOD); RGB_current_mode = rgblight_config.mode; } #endif @@ -408,7 +408,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { RGBAnimation = true; - rgblight_mode(10); + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL + 1); RGB_current_mode = rgblight_config.mode; } #endif @@ -417,7 +417,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE if (record->event.pressed) { RGBAnimation = true; - rgblight_mode(21); + rgblight_mode(RGBLIGHT_MODE_KNIGHT); RGB_current_mode = rgblight_config.mode; } #endif @@ -508,7 +508,7 @@ void led_ripple_effect(char r, char g, char b) { if (scan_count == -1) { rgblight_enable_noeeprom(); - rgblight_mode(0); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); } else if (scan_count >= 0 && scan_count < 5) { for (unsigned char c=keybuf_begin; c!=keybuf_end; c++) { int i = c; diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index aa97964134..e52e4a3736 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -100,7 +100,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/config.h b/keyboards/helix/rev2/keymaps/yshrsmz/config.h index a1cd126eef..d70f23c3e3 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/config.h +++ b/keyboards/helix/rev2/keymaps/yshrsmz/config.h @@ -21,3 +21,18 @@ along with this program. If not, see . /* auto shift config */ #define AUTO_SHIFT_TIMEOUT 150 + +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c index cce28796e6..049a864c1a 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c +++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c @@ -312,7 +312,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(16); + //rgblight_mode(RGBLIGHT_MODE_SNAKE + 1); #endif } layer_on(_LOWER); @@ -335,7 +335,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { TOG_STATUS = !TOG_STATUS; #ifdef RGBLIGHT_ENABLE - //rgblight_mode(15); + //rgblight_mode(RGBLIGHT_MODE_SNAKE); #endif } layer_on(_RAISE); @@ -450,7 +450,7 @@ void music_scale_user(void) // hook point for 'led_test' keymap // 'default' keymap's led_test_init() is empty function, do nothing -// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(RGBLIGHT_MODE_RGB_TEST); __attribute__ ((weak)) void led_test_init(void) {} diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk index da439dc9b5..8331a2e1d8 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk +++ b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk @@ -99,7 +99,7 @@ ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) endif ifeq ($(strip $(LED_ANIMATIONS)), yes) - OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS endif ifeq ($(strip $(OLED_ENABLE)), yes) -- cgit v1.2.3 From 7d156263ab81ff960adab6b80134f5202df67048 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 10 Oct 2018 12:56:45 -0700 Subject: Orange75: cleanup and Configurator support update (#4101) * Orange75: cleanup and Configurator support update `orange75.h`: Moved `K014` to the second (number row) as the left half of a split Backspace (guessing at its true location; will need to be checked/tested after merge). `info.json`: Updated to match new `LAYOUT` macro. `keymaps/default/keymap.c`: - Updated to match new `LAYOUT` macro. - Added layer mock-ups as block comments. - Formatted to be a bit more readable. * Orange75: deleted an extra comma from keymap.c --- keyboards/orange75/info.json | 98 ++++++++++++++++++++++++++--- keyboards/orange75/keymaps/default/keymap.c | 56 +++++++++++++---- keyboards/orange75/orange75.h | 12 ++-- 3 files changed, 141 insertions(+), 25 deletions(-) diff --git a/keyboards/orange75/info.json b/keyboards/orange75/info.json index 093b4cd4ec..e6a70c1021 100644 --- a/keyboards/orange75/info.json +++ b/keyboards/orange75/info.json @@ -1,12 +1,96 @@ { - "keyboard_name": "Orange75", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6.25, + "keyboard_name": "Orange75", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6.25, "layouts": { "LAYOUT": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":2, "y":0}, {"label":"F2", "x":3, "y":0}, {"label":"F3", "x":4, "y":0}, {"label":"F4", "x":5, "y":0}, {"label":"F5", "x":6.5, "y":0}, {"label":"F6", "x":7.5, "y":0}, {"label":"F7", "x":8.5, "y":0}, {"label":"F8", "x":9.5, "y":0}, {"label":"F9", "x":11, "y":0}, {"label":"F10", "x":12, "y":0}, {"label":"F11", "x":13, "y":0}, {"label":"F12", "x":14, "y":0}, {"label":"~", "x":0, "y":1.25}, {"label":"!", "x":1, "y":1.25}, {"label":"@", "x":2, "y":1.25}, {"label":"#", "x":3, "y":1.25}, {"label":"$", "x":4, "y":1.25}, {"label":"%", "x":5, "y":1.25}, {"label":"^", "x":6, "y":1.25}, {"label":"&", "x":7, "y":1.25}, {"label":"*", "x":8, "y":1.25}, {"label":"(", "x":9, "y":1.25}, {"label":")", "x":10, "y":1.25}, {"label":"_", "x":11, "y":1.25}, {"label":"+", "x":12, "y":1.25}, {"label":"Backspace", "x":13, "y":1.25, "w":2}, {"label":"Home", "x":15, "y":1.25}, {"label":"Tab", "x":0, "y":2.25, "w":1.5}, {"label":"Q", "x":1.5, "y":2.25}, {"label":"W", "x":2.5, "y":2.25}, {"label":"E", "x":3.5, "y":2.25}, {"label":"R", "x":4.5, "y":2.25}, {"label":"T", "x":5.5, "y":2.25}, {"label":"Y", "x":6.5, "y":2.25}, {"label":"U", "x":7.5, "y":2.25}, {"label":"I", "x":8.5, "y":2.25}, {"label":"O", "x":9.5, "y":2.25}, {"label":"P", "x":10.5, "y":2.25}, {"label":"{", "x":11.5, "y":2.25}, {"label":"}", "x":12.5, "y":2.25}, {"label":"|", "x":13.5, "y":2.25, "w":1.5}, {"label":"End", "x":15, "y":2.25}, {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, {"label":"A", "x":1.75, "y":3.25}, {"label":"S", "x":2.75, "y":3.25}, {"label":"D", "x":3.75, "y":3.25}, {"label":"F", "x":4.75, "y":3.25}, {"label":"G", "x":5.75, "y":3.25}, {"label":"H", "x":6.75, "y":3.25}, {"label":"J", "x":7.75, "y":3.25}, {"label":"K", "x":8.75, "y":3.25}, {"label":"L", "x":9.75, "y":3.25}, {"label":":", "x":10.75, "y":3.25}, {"label":"\"", "x":11.75, "y":3.25}, {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, {"label":"Page Up", "x":15, "y":3.25}, {"label":"Shift", "x":0, "y":4.25, "w":2.25}, {"label":"Z", "x":2.25, "y":4.25}, {"label":"X", "x":3.25, "y":4.25}, {"label":"C", "x":4.25, "y":4.25}, {"label":"V", "x":5.25, "y":4.25}, {"label":"B", "x":6.25, "y":4.25}, {"label":"N", "x":7.25, "y":4.25}, {"label":"M", "x":8.25, "y":4.25}, {"label":"<", "x":9.25, "y":4.25}, {"label":">", "x":10.25, "y":4.25}, {"label":"?", "x":11.25, "y":4.25}, {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, {"label":"Up", "x":14, "y":4.25}, {"label":"Page Down", "x":15, "y":4.25}, {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, {"label":"Win", "x":1.25, "y":5.25, "w":1.25}, {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, {"x":3.75, "y":5.25, "w":6.25}, {"label":"Alt", "x":10, "y":5.25, "w":1.25}, {"label":"Fn", "x":11.25, "y":5.25, "w":1.25}, {"label":"Left", "x":13, "y":5.25}, {"label":"Down", "x":14, "y":5.25}, {"label":"Right", "x":15, "y":5.25}] + "key_count": 82, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"`", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"-", "x":11, "y":1.25}, + {"label":"=", "x":12, "y":1.25}, + {"label":"Delete", "x":13, "y":1.25}, + {"label":"Back Space", "x":14, "y":1.25}, + {"label":"Home", "x":15, "y":1.25}, + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"[", "x":11.5, "y":2.25}, + {"label":"]", "x":12.5, "y":2.25}, + {"label":"\\", "x":13.5, "y":2.25, "w":1.5}, + {"label":"End", "x":15, "y":2.25}, + {"label":"Caps Lock", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":";", "x":10.75, "y":3.25}, + {"label":"'", "x":11.75, "y":3.25}, + {"label":"Enter", "x":12.75, "y":3.25, "w":2.25}, + {"label":"PgUp", "x":15, "y":3.25}, + {"label":"Shift", "x":0, "y":4.25, "w":1.25}, + {"label":"ISO\\", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":",", "x":9.25, "y":4.25}, + {"label":".", "x":10.25, "y":4.25}, + {"label":"/", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":1.75}, + {"label":"Up", "x":14, "y":4.25}, + {"label":"PgDn", "x":15, "y":4.25}, + {"label":"Ctrl", "x":0, "y":5.25, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.25, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.25, "w":6.25}, + {"label":"Alt", "x":10, "y":5.25, "w":1.25}, + {"label":"Fn", "x":11.25, "y":5.25, "w":1.25}, + {"label":"Left", "x":13, "y":5.25}, + {"label":"Down", "x":14, "y":5.25}, + {"label":"Right", "x":15, "y":5.25} + ] } } -} \ No newline at end of file +} diff --git a/keyboards/orange75/keymaps/default/keymap.c b/keyboards/orange75/keymaps/default/keymap.c index 50aaf718ec..37e198f99c 100644 --- a/keyboards/orange75/keymaps/default/keymap.c +++ b/keyboards/orange75/keymaps/default/keymap.c @@ -3,21 +3,53 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ,---------------------------------------------------------------. + * |Esc|▓▓▓|F1 |F2 |F3 |F4 |▓|F5 |F6 |F7 |F8 |▓|F9 |F10|F11|F12|▓▓▓| + * |---------------------------------------------------------------| + * |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Del|Bsp|Hm | + * |---------------------------------------------------------------| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |End| + * |---------------------------------------------------------------| + * |Caps |A |S |D |F |G |H |J |K |L |; |' |Enter |PgU| + * |---------------------------------------------------------------| + * |Shft|\ |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD| + * |---------------------------------------------------------------| + * |Ctrl|GUI |Alt |Space |Alt |Fn |▓|Lt |Dn |Rt | + * `---------------------------------------------------------------' + */ 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_DEL, - 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_HOME, - 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_END, - 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_PGUP, - KC_LSFT, LT(1, KC_NO), 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_PGDN, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, LT(1, KC_NO), KC_LEFT, KC_DOWN, KC_RGHT), + 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_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_DEL, KC_BSPC, KC_HOME, + 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_END, + 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_PGUP, + KC_LSFT, LT(1, KC_NO), 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, LT(1, KC_NO), KC_LEFT, KC_DOWN, KC_RGHT + ), + /* + * ,---------------------------------------------------------------. + * |RST|▓▓▓| | | | |▓| | | | |▓| | | | |▓▓▓| + * |---------------------------------------------------------------| + * |` | | | | | | | | | | | | | | |Tog| + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | | |Stp| + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | |BL+| + * |---------------------------------------------------------------| + * | | | | | | | | | | | | | | |BL-| + * |---------------------------------------------------------------| + * | | | | | | |▓| | | | + * `---------------------------------------------------------------' + */ LAYOUT( - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, - _______, _______, _______, _______, _______, _______, _______, _______, _______) + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_TOGG, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) }; diff --git a/keyboards/orange75/orange75.h b/keyboards/orange75/orange75.h index 1b351a595c..a7ddd5a06d 100644 --- a/keyboards/orange75/orange75.h +++ b/keyboards/orange75/orange75.h @@ -3,12 +3,12 @@ #include "quantum.h" #define LAYOUT( \ - K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ - K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, \ - K500, K501, K502, K506, K510, K511, K512, K513, K514 \ + K000, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K014, K113, K114, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, \ + K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, K414, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514 \ ) { \ { K000, K100, K200, K300, K400, K500 }, \ { KC_NO, K101, K201, K301, K401, K501 }, \ -- cgit v1.2.3 From d17421d074402765204c0e7b09007906e91af7dc Mon Sep 17 00:00:00 2001 From: pgillan145 Date: Wed, 10 Oct 2018 15:58:11 -0400 Subject: Added cheese keymap to tada68. (#4105) * Added cheese keymap to tada68. * Removed extraneous definitions. --- keyboards/tada68/keymaps/cheese/keymap.c | 107 ++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/cheese/readme.md | 20 ++++++ keyboards/tada68/keymaps/cheese/rules.mk | 18 +++++ 3 files changed, 145 insertions(+) create mode 100755 keyboards/tada68/keymaps/cheese/keymap.c create mode 100755 keyboards/tada68/keymaps/cheese/readme.md create mode 100644 keyboards/tada68/keymaps/cheese/rules.mk diff --git a/keyboards/tada68/keymaps/cheese/keymap.c b/keyboards/tada68/keymaps/cheese/keymap.c new file mode 100755 index 0000000000..b2395282c3 --- /dev/null +++ b/keyboards/tada68/keymaps/cheese/keymap.c @@ -0,0 +1,107 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL 1 +#define _CL 2 +#define _AL 3 + +enum custom_keycodes { + SPX4 = SAFE_RANGE +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case SPX4: + SEND_STRING(" "); + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |PgUp| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|Del | + * |----------------------------------------------------------------| + * |Ctrl|Win |Win | Space |Win| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_ESC, 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_BSPC, \ + 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_PGUP, \ + MO(_CL), 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_PGDN, \ + KC_LSFT, 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_DEL, \ + KC_LCTL, KC_LALT,LM(_AL,0x08), KC_SPC, LM(_AL,0x18),MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |` ~ | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |MUT|VU-|VU+| | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, 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_DEL, KC_GRV, \ + SPX4,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_MUTE,KC_VOLD,KC_VOLU,_______,_______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______,_______, _______), + + /* Keymap _CL: Caps Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |` ~ | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |MUT|VU-|VU+| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[_CL] = LAYOUT_ansi( + _______, 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_DEL, KC_GRV , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + _______,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, _______,KC_MUTE,KC_VOLD,KC_VOLU,_______,KC_BTN1, KC_MS_U, KC_BTN2, \ + _______,_______,_______, _______, _______,_______,_______,KC_MS_L,KC_MS_D, KC_MS_R), + + /* Keymap _AL: ALT Layer + * ,----------------------------------------------------------------. + * |` ~| | | | | | | | | | | | | | ` ~| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ +[_AL] = LAYOUT_ansi( + KC_GRV, _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_GRV , \ + _______,_______, _______, _______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ + _______,_______, _______, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ + _______,_______,_______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______, _______, _______, _______), +}; diff --git a/keyboards/tada68/keymaps/cheese/readme.md b/keyboards/tada68/keymaps/cheese/readme.md new file mode 100755 index 0000000000..8374e469b9 --- /dev/null +++ b/keyboards/tada68/keymaps/cheese/readme.md @@ -0,0 +1,20 @@ +# pgillan's Cheese TADA68 layout + +A collection of tweaks to make the keyboard more mac friendly and increase personal usability, +based on the default keymap. + +* Turned the caps-lock into an additional function key so I didn't have to try to hit the + the keys on the right with one hand. +* Moved the arrow/mouse controls to the caps-lock layer from the function layer. +* Swapped the Windows key and Alt keys, I didn't have to do it in OS X. +* Made the escape key work as a backtick when "Alt" is depressed, so I can 1) reverse + direction when I Alt-Tab through current applications, and Alt-Backtick through + open windows. +* Turned the backtick/tilde key into another backspace key, so I can just go all the way + up to the corner without overshooting. +* Adjusted the volume controles so M is "mute", the "," ( or "<") is "down", and "." (or ">") + is "up". It just makes a ton more sense, I have no idea why it would have been done any + differently. +* Moved PageUp/PageDown up above the delete key, and made the Home and End on the capslock + and function layers. +* Made the tab key on the function layer output 4 spaces instead of a tab character. diff --git a/keyboards/tada68/keymaps/cheese/rules.mk b/keyboards/tada68/keymaps/cheese/rules.mk new file mode 100644 index 0000000000..fdbd25ea80 --- /dev/null +++ b/keyboards/tada68/keymaps/cheese/rules.mk @@ -0,0 +1,18 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 + -- cgit v1.2.3 From 0e142138aa5c4daa3f113f5a402060cde3efdea9 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Tue, 9 Oct 2018 01:21:38 -0700 Subject: evil80: Add readme.md file --- keyboards/evil80/readme.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 keyboards/evil80/readme.md diff --git a/keyboards/evil80/readme.md b/keyboards/evil80/readme.md new file mode 100644 index 0000000000..bc21855eba --- /dev/null +++ b/keyboards/evil80/readme.md @@ -0,0 +1,15 @@ +# Evil 80 + +![Evil 80](https://i.imgur.com/f5dKuML.jpg) + +Also known as the Odyssey, the Evil 80 is a QMK-powered aluminum TKL keyboard featuring an Aviator connector cable. Sold via a Geekhack group buy in January of 2018. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Evil 80-Odyssey QMK version +Hardware Availability: [Geekhack](https://geekhack.org/index.php?topic=93434.0) + +Make example for this keyboard (after setting up your build environment): + + make evil80: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). -- cgit v1.2.3 From 6c55e8cab5a1cc43c0c024344727ceb243d98f5a Mon Sep 17 00:00:00 2001 From: Boris Burger Date: Wed, 10 Oct 2018 23:17:42 +0200 Subject: Keymap: DZ60 layout based on stephengrier's with PgUp/PgDn/Home/End, Insert, etc. (#4110) * DZ60 layout based on stephengrier's with customisations. * CapsLock is used as Fn key. * Del is available as Fn+Backspace & Shift+Backspace (using a macro) * PgUp / PgDn / Home / End = Fn+Arrows (as on macOS, Microsoft Surface) * Tilde = Shift+Esc * Backtick = Fn+Esc * Underglow toggle and mode selection are available as Fn+Q and Fn+W * Reset (bootloader mode) = Fn+B * Standardised layout formatting and Ctrl+Del & Shift+Del support. Using 7 underscores for KC_TRNS in layouts and aligning the keycodes according to LAYOUT_directional. Del is now only Fn+Del, Ctrl+Backspace translates to Ctrl+Del, Shift+Backspace translates to Shift+Del. * Documented new Backspace/Del related macros. Del is now just Fn+Backspace, pressing Ctrl+Backspace sends Ctrl+Del, pressing Shift+Backspace sends Shift+Del --- keyboards/dz60/keymaps/boris_burger/README.md | 52 ++++++++++++++++ keyboards/dz60/keymaps/boris_burger/config.h | 1 + keyboards/dz60/keymaps/boris_burger/keymap.c | 87 +++++++++++++++++++++++++++ 3 files changed, 140 insertions(+) create mode 100644 keyboards/dz60/keymaps/boris_burger/README.md create mode 100644 keyboards/dz60/keymaps/boris_burger/config.h create mode 100644 keyboards/dz60/keymaps/boris_burger/keymap.c diff --git a/keyboards/dz60/keymaps/boris_burger/README.md b/keyboards/dz60/keymaps/boris_burger/README.md new file mode 100644 index 0000000000..64062f823a --- /dev/null +++ b/keyboards/dz60/keymaps/boris_burger/README.md @@ -0,0 +1,52 @@ +### boris_burger's DZ60 layout + +This layout is for a DZ60 with a 2U left shift, 1U right shift and an arrow cluster in +the bottom right. + +It is based off stephengrier's layout adding support for Home/End/PgUp/PgDn using Fn+arrows +as used on macOS and Microsoft Surface. It has Insert instead of Fn near the arrow cluster +and other smaller tweaks: +- CapsLock is the only Fn key (CapsLock by itself is not available) +- Del is available as Fn+Backspace +- Ctrl+Del is available as Ctrl+Backspace (e.g. deleting word to the right of the cursor) +- Shift+Del is available as Shift+Backspace (e.g. permanently deleting file or e-mail) +- PgUp = Fn+Up +- PgDn = Fn+Down +- Home = Fn+Left +- End = Fn+Right +- Tilde = Shift+Esc +- Backtick = Fn+Esc +- Underglow toggle and mode selection are available as Fn+Q and Fn+W +- Reset (bootloader mode) = Fn+B + +### 0 Qwerty +``` +,-----------------------------------------------------------------------------------------. +| Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | +|-----------------------------------------------------------------------------------------+ +| Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | +|-----------------------------------------------------------------------------------------+ +| Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | +|-----------------------------------------------------------------------------------------+ +| Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Ins | +|-----------------------------------------------------------------------------------------+ +| Ctrl | Win | Alt | Space | Alt | Menu | L | D | R | +`-----------------------------------------------------------------------------------------' +``` + +### 1 Fn Layer +``` +FN Layer +,-----------------------------------------------------------------------------------------. +| ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | +|-----------------------------------------------------------------------------------------+ +| |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | +|-----------------------------------------------------------------------------------------+ +| | BL T| BL M| BL+ | BL- | | | | | | | | | +|-----------------------------------------------------------------------------------------+ +| | | | | |RESET| | | | | | | PgUp| | +|-----------------------------------------------------------------------------------------+ +| | | | | | | Home| PgDn| End | +`-----------------------------------------------------------------------------------------' +``` + diff --git a/keyboards/dz60/keymaps/boris_burger/config.h b/keyboards/dz60/keymaps/boris_burger/config.h new file mode 100644 index 0000000000..9560d51a6f --- /dev/null +++ b/keyboards/dz60/keymaps/boris_burger/config.h @@ -0,0 +1 @@ +#define GRAVE_ESC_GUI_OVERRIDE # Always send Escape if GUI is pressed diff --git a/keyboards/dz60/keymaps/boris_burger/keymap.c b/keyboards/dz60/keymaps/boris_burger/keymap.c new file mode 100644 index 0000000000..5dcadf34c1 --- /dev/null +++ b/keyboards/dz60/keymaps/boris_burger/keymap.c @@ -0,0 +1,87 @@ +#include QMK_KEYBOARD_H + +/* Holds state of modifiers when Backspace was pressed. + * Used to ensure that the correct keycode is unregistered when Backspace is released. + */ +static uint8_t bspc_mods = 0; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | Ins | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Win | Alt | Space | Alt | Menu | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_directional( + KC_GESC, 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_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, + MO(1) , 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_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, KC_UP , KC_INS , + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_RGUI, KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL T| BL M| BL+ | BL- | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | |RESET| | | | | | | PgUp| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | Home| PgDn| End | + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_directional( + KC_GRV , 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_DEL , + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, BL_TOGG, BL_STEP, BL_INC , BL_DEC , _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, RESET , _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END + ), +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case KC_BSPC: { + if (record->event.pressed) { + const uint8_t current_mods = get_mods(); + const uint8_t shift = current_mods & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)); + const uint8_t ctrl = current_mods & (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTL)); + bspc_mods = current_mods; + if(shift || ctrl) { + add_key(KC_DEL); + add_mods(current_mods); + send_keyboard_report(); + } else { + return true; + } + } + else { + if(bspc_mods & (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)|MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTL))) { + // if Shift or Ctrl was pressed with Backspace, than that was intepreted as Del, so we need + // to unregister the Del key + del_key(KC_DEL); + } else { + // Either Backspace was pressed without mods, or with a modifier other than Shift or Ctrl + // so it is simply taken as Backspace + del_key(KC_BSPC); + } + send_keyboard_report(); + } + return false; + } + default: + return true; + } +} -- cgit v1.2.3 From 0e4374042c5aef32762637f6fefd4662106bd5af Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 16:32:38 -0700 Subject: Update and cleanup AVR Hardware docs --- docs/hardware_avr.md | 42 ++++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index be69324062..4d81a23d7d 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -8,7 +8,7 @@ If you have not yet you should read the [Keyboard Guidelines](hardware_keyboard_ QMK has a number of features to simplify working with AVR keyboards. For most keyboards you don't have to write a single line of code. To get started run the `util/new_project.sh` script: -``` +```bash $ util/new_project.sh my_awesome_keyboard ###################################################### # /keyboards/my_awesome_keyboard project created. To start @@ -30,7 +30,7 @@ This is where all the custom logic for your keyboard goes. Many keyboards do not This is the file you define your [Layout Macro(s)](feature_layouts.md) in. At minimum you should have a `#define LAYOUT` for your keyboard that looks something like this: -``` +```c #define LAYOUT( \ k00, k01, k02, \ k10, k11 \ @@ -57,7 +57,7 @@ At the top of the `config.h` you'll find USB related settings. These control how Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately reflect your keyboard. -``` +```c #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 @@ -72,14 +72,14 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r The next section of the `config.h` file deals with your keyboard's matrix. The first thing you should set is the matrix's size. This is usually, but not always, the same number of rows and columns as the physical key arrangement. -``` +```c #define MATRIX_ROWS 2 #define MATRIX_COLS 3 ``` Once you've defined the size of your matrix you need to define which pins on your MCU are connected to rows and columns. To do so simply specify the names of those pins: -``` +```c #define MATRIX_ROW_PINS { D0, D5 } #define MATRIX_COL_PINS { F1, F0, B0 } #define UNUSED_PINS @@ -89,7 +89,7 @@ The number of `MATRIX_ROW_PINS` entries must be the same as the number you assig Finally, you can specify the direction your diodes point. This can be `COL2ROW`, `ROW2COL`, or `CUSTOM_MATRIX`. -``` +```c #define DIODE_DIRECTION COL2ROW ``` @@ -97,16 +97,14 @@ Finally, you can specify the direction your diodes point. This can be `COL2ROW`, By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md). -``` +```c #define BACKLIGHT_PIN B7 #define BACKLIGHT_LEVELS 3 #define BACKLIGHT_BREATHING #define BREATHING_PERIOD 6 ``` -{% hint style='info' %} -You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details. -{% endhint %} +?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details. ### Other Configuration Options @@ -120,7 +118,7 @@ You use the `rules.mk` file to tell QMK what files to build and what features to These options tell the build system what CPU to build for. Be very careful if you change any of these settings, you can render your keyboard inoperable. -``` +```make MCU = atmega32u4 F_CPU = 16000000 ARCH = AVR8 @@ -128,26 +126,26 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT ``` -### Bootloader Size +### Bootloaders -The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. If you are using a teensy 2.0, or a device like the Ergodox EZ that uses the teensy bootloader you should set this to `512`. Most other bootloaders should be set to `4096`, but `1024` and `2048` are other possible values you may encounter. +The bootloader is a special section of your MCU that allows you to upgrade the code stored on the MCU. Think of it like a Rescue Partition for your keyboard. -#### Teensy 2.0 Bootloader Example +#### Teensy Bootloader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=512 +```make +BOOTLOADER = halfkay ``` -#### Teensy 2.0++ Bootloader Example +#### Atmel DFU Loader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=1024 +```make +BOOTLOADER = atmel-dfu ``` -#### Atmel DFU Loader Example +#### Pro Micro Bootloader Example -``` -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +```make +BOOTLOADER = caterina ``` ### Build Options -- cgit v1.2.3 From 43757cd985153ba4f620336003c20b3554c03678 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 16:10:30 -0700 Subject: Cleanup learning newb links --- docs/_sidebar.md | 1 + docs/newbs.md | 3 +-- docs/newbs_learn_more_resources.md | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 973428c9e0..32e3c7eca0 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -3,6 +3,7 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) * [QMK Introduction](getting_started_introduction.md) diff --git a/docs/newbs.md b/docs/newbs.md index 87933b018c..38a9607d44 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -6,7 +6,7 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y ## Overview -There are 4 main sections to this guide: +There are 5 main sections to this guide: * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) @@ -15,4 +15,3 @@ There are 4 main sections to this guide: * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). - diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index 69d165c2bb..23b99f470f 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -2,12 +2,12 @@ These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs. Git resources: -* -*[Great General Tutorial](https://www.codecademy.com/learn/learn-git) -*[Git Game To Learn From Examples](https://learngitbranching.js.org/) -*[Git Resources to Learn More About Github](getting_started_github.md) -*[Git Resources Aimed Specificly toward QMK](contributing.md) + +* [Great General Tutorial](https://www.codecademy.com/learn/learn-git) +* [Git Game To Learn From Examples](https://learngitbranching.js.org/) +* [Git Resources to Learn More About Github](getting_started_github.md) +* [Git Resources Aimed Specificly toward QMK](contributing.md) Command Line resources: -*[Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) \ No newline at end of file +* [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) -- cgit v1.2.3 From a7d05820a6258178b7ea440ee2781edf074d8f41 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 10 Oct 2018 12:38:10 -0700 Subject: Add documentation for Combo feature --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/config_options.md | 6 ++++ docs/feature_combo.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 docs/feature_combo.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 32e3c7eca0..56a6463918 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -48,6 +48,7 @@ * [Backlight](feature_backlight.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) + * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) * [Grave Escape](feature_grave_esc.md) diff --git a/docs/_summary.md b/docs/_summary.md index 973428c9e0..11aeb7cd36 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -47,6 +47,7 @@ * [Backlight](feature_backlight.md) * [Bluetooth](feature_bluetooth.md) * [Bootmagic](feature_bootmagic.md) + * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) * [Grave Escape](feature_grave_esc.md) diff --git a/docs/config_options.md b/docs/config_options.md index 4678a7146c..19861c9d23 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -155,6 +155,10 @@ If you define these options you will enable the associated feature, which may in going to produce the 500 keystrokes a second needed to actually get more than a few ms of delay from this. But if you're doing chording on something with 3-4ms scan times? You probably want this. +* `#define COMBO_COUNT 2` + * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. +* `#define COMBO_TERM 200` + * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. ## RGB Light Configuration @@ -234,6 +238,8 @@ Use these to enable or disable building certain features. The more you have enab * Console for debug(+400) * `COMMAND_ENABLE` * Commands for debug and configuration +* `COMBO_ENABLE` + * Key combo feature * `NKRO_ENABLE` * USB N-Key Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work * `AUDIO_ENABLE` diff --git a/docs/feature_combo.md b/docs/feature_combo.md new file mode 100644 index 0000000000..f509e9f33f --- /dev/null +++ b/docs/feature_combo.md @@ -0,0 +1,88 @@ +# Combos + +The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks. + +To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`. + +Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using). + + +Also, by default, the tapping term for the Combos is set to the same value as `TAPPING_TERM` (200 by default on most boards). But you can specify a different value by defining it in your `config.h`. For instance: `#define COMBO_TERM 300` would set the time out period for combos to 300ms. + +Then, your `keymap.c` file, you'll need to define a sequence of keys, terminated with `COMBO_END`, and a structure to list the combination of keys, and it's resulting action. + +```c +const uint16_t PROGMEM test_combo[] = {KC_A, KC_B, COMBO_END}; +combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; +``` + +This will send "Escape" if you hit the A and B keys. + +!> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. + +## Examples + +If you want to add a list, then you'd use something like this: + +```c +enum combos { + AB_ESC, + JK_TAB +} +const uint16_t PROGMEM ab_combo[] = {KC_A, KC_B, COMBO_END}; +const uint16_t PROGMEM jk_combo[] = {KC_J, KC_K, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [AB_ESC] = COMBO(ab_combo, KC_ESC), + [JK_TAB] = COMBO(jk_combo, KC_TAB) +}; +``` + +For a more complicated implementation, you can use the `process_combo_event` function to add custom handling. + +```c +enum combo_events { + ZC_COPY, + ZV_PASTE + }; + +const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; + +combo_t key_combos[COMBO_COUNT] = { + [ZC_COPY] = COMBO_ACTION(copy_combo), + [ZV_PASTE] = COMBO_ACTION(paste_combo), +}; + +void process_combo_event(uint8_t combo_index, bool pressed) { + switch(combo_index) { + case ZC_COPY: + if (pressed) { + register_code(KC_LCTL); + register_code(KC_C); + unregister_code(KC_C); + unregister_code(KC_LCTL); + } + break; + + case ZV_PASTE: + if (pressed) { + register_code(KC_LCTL); + register_code(KC_V); + unregister_code(KC_V); + unregister_code(KC_LCTL); + } + break; + } +} +``` + +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. + +## Additional Configuration + +If you're using long combos, or even longer combos, you may run into issues with this, as the structure may not be large enough to accommodate what you're doing. + +In this case, you can add either `#define EXTRA_LONG_COMBOS` or `#define EXTRA_EXTRA_LONG_COMBOS` in your `config.h` file. + +You may also be able to enable action keys by defining `COMBO_ALLOW_ACTION_KEYS`. -- cgit v1.2.3 From 8a778d656dc42289b4cc344c8ef0abae2de73eff Mon Sep 17 00:00:00 2001 From: Oscillope Date: Thu, 11 Oct 2018 20:00:17 -0400 Subject: Keymap: Undo my backlight workaround (#4122) * Update jj40 keymap for easier pgup/pgdn * Backlight problem fixed by a previous commit --- keyboards/jj40/keymaps/oscillope/backlight.c | 60 ---------------------------- keyboards/jj40/keymaps/oscillope/keymap.c | 4 +- 2 files changed, 2 insertions(+), 62 deletions(-) delete mode 100644 keyboards/jj40/keymaps/oscillope/backlight.c diff --git a/keyboards/jj40/keymaps/oscillope/backlight.c b/keyboards/jj40/keymaps/oscillope/backlight.c deleted file mode 100644 index 14c677cd6c..0000000000 --- a/keyboards/jj40/keymaps/oscillope/backlight.c +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Backlighting code for PS2AVRGB boards (ATMEGA32A) - * Kenneth A. (github.com/krusli | krusli.me) - */ - -#include "quantum.h" - -#include -#include - -// Port D: digital pins of the AVR chipset -#define NUMLOCK_PORT (1 << 0) // D0 -#define CAPSLOCK_PORT (1 << 1) // D1 -#define BACKLIGHT_PORT (1 << 4) // D4 -#define SCROLLLOCK_PORT (1 << 6) // D6 - -/** - * References - * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation - * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b - * Timers: http://www.avrbeginners.net/architecture/timers/timers.html - * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ - * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware - */ - -// @Override -// turn LEDs on and off depending on USB caps/num/scroll lock states. -__attribute__ ((weak)) -void led_set_user(uint8_t usb_led) { -/* It appears that these cause the v1 JJ40 PCB to hang. - * I haven't looked into why, but I don't have any LEDs on my board anyway. */ -#if 0 - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - // turn on - DDRD |= NUMLOCK_PORT; - PORTD |= NUMLOCK_PORT; - } else { - // turn off - DDRD &= ~NUMLOCK_PORT; - PORTD &= ~NUMLOCK_PORT; - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRD |= CAPSLOCK_PORT; - PORTD |= CAPSLOCK_PORT; - } else { - DDRD &= ~CAPSLOCK_PORT; - PORTD &= ~CAPSLOCK_PORT; - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - DDRD |= SCROLLLOCK_PORT; - PORTD |= SCROLLLOCK_PORT; - } else { - DDRD &= ~SCROLLLOCK_PORT; - PORTD &= ~SCROLLLOCK_PORT; - } -#endif -} - diff --git a/keyboards/jj40/keymaps/oscillope/keymap.c b/keyboards/jj40/keymaps/oscillope/keymap.c index 49ceff864c..8b30f52c8b 100644 --- a/keyboards/jj40/keymaps/oscillope/keymap.c +++ b/keyboards/jj40/keymaps/oscillope/keymap.c @@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ins | | | () | [] | {} | Left | Down | Up |Right | | | + * | Ins | | | () | [] | {} | Home | PgDn | PgUp | End | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * |RESET | Back | Fwd | | | | | | Mute | Vol- | Vol+ | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -71,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_LOWER] = KEYMAP( \ 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_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + KC_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ RESET, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \ _______, _______, _______, _______, KC_LOCK, _______, _______, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT \ ), -- cgit v1.2.3 From ae489efee4512790e38f173bcd2e2f1e2547da07 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Thu, 11 Oct 2018 17:00:53 -0700 Subject: Keymap: Add crd's simple layout (#4117) * Add crd's simple layout * Fix transparent mapping in crd's config * Add secondary navigation to fn layer --- keyboards/dz60/keymaps/crd/keymap.c | 48 +++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 keyboards/dz60/keymaps/crd/keymap.c diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c new file mode 100644 index 0000000000..5e9242c9d9 --- /dev/null +++ b/keyboards/dz60/keymaps/crd/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | FN | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GESC, 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_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, + 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, KC_ENT, + KC_LSFT, 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_DEL, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN Layer + * ,-----------------------------------------------------------------------------------------. + * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | RESET | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | BL T| BL M| BL+ | BL- | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | |PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Home |PgDn | End | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRV, 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_TRNS, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END + ), +}; -- cgit v1.2.3 From 661e304033d704084a85930a4ff2c91e13c270af Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Sat, 29 Sep 2018 23:45:22 +0900 Subject: Add a temporary comment to quantum/rgblight.h to aid migration. Add a temporary comment. The content is a contrast table of old magic number and new symbol. --- quantum/rgblight.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/quantum/rgblight.h b/quantum/rgblight.h index d1e00eef31..50567b5b20 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -18,6 +18,52 @@ #include "rgblight_reconfig.h" +/***** rgblight_mode(mode)/rgblight_mode_noeeprom(mode) **** + + old mode number (before 0.6.117) to new mode name table + +|-----------------|-----------------------------------| +| old mode number | new mode name | +|-----------------|-----------------------------------| +| 1 | RGBLIGHT_MODE_STATIC_LIGHT | +| 2 | RGBLIGHT_MODE_BREATHING | +| 3 | RGBLIGHT_MODE_BREATHING + 1 | +| 4 | RGBLIGHT_MODE_BREATHING + 2 | +| 5 | RGBLIGHT_MODE_BREATHING + 3 | +| 6 | RGBLIGHT_MODE_RAINBOW_MOOD | +| 7 | RGBLIGHT_MODE_RAINBOW_MOOD + 1 | +| 8 | RGBLIGHT_MODE_RAINBOW_MOOD + 2 | +| 9 | RGBLIGHT_MODE_RAINBOW_SWIRL | +| 10 | RGBLIGHT_MODE_RAINBOW_SWIRL + 1 | +| 11 | RGBLIGHT_MODE_RAINBOW_SWIRL + 2 | +| 12 | RGBLIGHT_MODE_RAINBOW_SWIRL + 3 | +| 13 | RGBLIGHT_MODE_RAINBOW_SWIRL + 4 | +| 14 | RGBLIGHT_MODE_RAINBOW_SWIRL + 5 | +| 15 | RGBLIGHT_MODE_SNAKE | +| 16 | RGBLIGHT_MODE_SNAKE + 1 | +| 17 | RGBLIGHT_MODE_SNAKE + 2 | +| 18 | RGBLIGHT_MODE_SNAKE + 3 | +| 19 | RGBLIGHT_MODE_SNAKE + 4 | +| 20 | RGBLIGHT_MODE_SNAKE + 5 | +| 21 | RGBLIGHT_MODE_KNIGHT | +| 22 | RGBLIGHT_MODE_KNIGHT + 1 | +| 23 | RGBLIGHT_MODE_KNIGHT + 2 | +| 24 | RGBLIGHT_MODE_CHRISTMAS | +| 25 | RGBLIGHT_MODE_STATIC_GRADIENT | +| 26 | RGBLIGHT_MODE_STATIC_GRADIENT + 1 | +| 27 | RGBLIGHT_MODE_STATIC_GRADIENT + 2 | +| 28 | RGBLIGHT_MODE_STATIC_GRADIENT + 3 | +| 29 | RGBLIGHT_MODE_STATIC_GRADIENT + 4 | +| 30 | RGBLIGHT_MODE_STATIC_GRADIENT + 5 | +| 31 | RGBLIGHT_MODE_STATIC_GRADIENT + 6 | +| 32 | RGBLIGHT_MODE_STATIC_GRADIENT + 7 | +| 33 | RGBLIGHT_MODE_STATIC_GRADIENT + 8 | +| 34 | RGBLIGHT_MODE_STATIC_GRADIENT + 9 | +| 35 | RGBLIGHT_MODE_RGB_TEST | +| 36 | RGBLIGHT_MODE_ALTERNATING | +|-----------------|-----------------------------------| + *****/ + #define _RGBM_SINGLE_STATIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_SINGLE_DYNAMIC(sym) RGBLIGHT_MODE_ ## sym, #define _RGBM_MULTI_STATIC(sym) RGBLIGHT_MODE_ ## sym, -- cgit v1.2.3 From ec59556cd7896e359340feb961f10f3f12a48b95 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Wed, 10 Oct 2018 06:50:11 +0900 Subject: add a notice into docs/feature_rgblight.md --- docs/feature_rgblight.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 925dca724b..a2820347de 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -96,9 +96,10 @@ if `RGBLIGHT_EFFECT_xxxx` or `RGBLIGHT_ANIMATIONS` is defined, you also have a n |`RGBLIGHT_MODE_RGB_TEST` | *None* |RGB Test | |`RGBLIGHT_MODE_ALTERNATING` | *None* |Alternating | - Check out [this video](https://youtube.com/watch?v=VKrpPAHlisY) for a demonstration. +Note: For versions older than 0.6.117, The mode numbers were written directly. In `quantum/rgblight.h` there is a contrast table between the old mode number and the current symbol. + The following options can be used to tweak the various animations: |Define |Default |Description | -- cgit v1.2.3 From 4bb0fb2ffc2d3fd136f5803b92f1a55792645a28 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Thu, 11 Oct 2018 22:15:31 +0900 Subject: A comment indicating the insertion location of the new mode was added. --- quantum/rgblight.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 50567b5b20..33b279f08c 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -284,6 +284,10 @@ void rgblight_effect_alternating(void); #ifdef RGBLIGHT_EFFECT_ALTERNATING _RGBM_SINGLE_DYNAMIC( ALTERNATING ) #endif + //// Add a new mode here. + // #ifdef RGBLIGHT_EFFECT_ + // _RGBM__( ) + // #endif #endif #undef _RGBM_SINGLE_STATIC -- cgit v1.2.3 From 52ecc76e28bbcde9e35d35eb48a4d5b78aa204e2 Mon Sep 17 00:00:00 2001 From: Yann Hodique Date: Thu, 11 Oct 2018 15:26:56 -0700 Subject: port sun_usb converter from tmk initial import --- keyboards/converter/sun_usb/command_extra.c | 64 +++++++ keyboards/converter/sun_usb/config.h | 88 +++++++++ keyboards/converter/sun_usb/led.c | 32 ++++ keyboards/converter/sun_usb/matrix.c | 197 +++++++++++++++++++++ keyboards/converter/sun_usb/readme.md | 89 ++++++++++ keyboards/converter/sun_usb/rules.mk | 42 +++++ .../sun_usb/type3/keymaps/default/keymap.c | 29 +++ keyboards/converter/sun_usb/type3/rules.mk | 0 keyboards/converter/sun_usb/type3/type3.h | 66 +++++++ .../sun_usb/type5/keymaps/default/keymap.c | 30 ++++ keyboards/converter/sun_usb/type5/rules.mk | 0 keyboards/converter/sun_usb/type5/type5.h | 148 ++++++++++++++++ 12 files changed, 785 insertions(+) create mode 100644 keyboards/converter/sun_usb/command_extra.c create mode 100644 keyboards/converter/sun_usb/config.h create mode 100644 keyboards/converter/sun_usb/led.c create mode 100644 keyboards/converter/sun_usb/matrix.c create mode 100644 keyboards/converter/sun_usb/readme.md create mode 100644 keyboards/converter/sun_usb/rules.mk create mode 100644 keyboards/converter/sun_usb/type3/keymaps/default/keymap.c create mode 100644 keyboards/converter/sun_usb/type3/rules.mk create mode 100644 keyboards/converter/sun_usb/type3/type3.h create mode 100644 keyboards/converter/sun_usb/type5/keymaps/default/keymap.c create mode 100644 keyboards/converter/sun_usb/type5/rules.mk create mode 100644 keyboards/converter/sun_usb/type5/type5.h diff --git a/keyboards/converter/sun_usb/command_extra.c b/keyboards/converter/sun_usb/command_extra.c new file mode 100644 index 0000000000..756a9160bb --- /dev/null +++ b/keyboards/converter/sun_usb/command_extra.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H +#include "protocol/serial.h" + +bool sun_bell = false; +bool sun_click = false; + + +bool command_extra(uint8_t code) +{ + switch (code) { + case KC_H: + case KC_SLASH: /* ? */ + print("\n\n----- Sun converter Help -----\n"); + print("Home: Toggle Bell\n"); + print("End: Toggle Click\n"); + print("PgUp: LED all On\n"); + print("PgDown: LED all Off\n"); + print("Insert: Layout\n"); + print("Delete: Reset\n"); + return false; + case KC_DEL: + print("Reset\n"); + serial_send(0x01); + break; + case KC_HOME: + sun_bell = !sun_bell; + if (sun_bell) { + print("Bell On\n"); + serial_send(0x02); + } else { + print("Bell Off\n"); + serial_send(0x03); + } + break; + case KC_END: + sun_click = !sun_click; + if (sun_click) { + print("Click On\n"); + serial_send(0x0A); + } else { + print("Click Off\n"); + serial_send(0x0B); + } + break; + case KC_PGUP: + print("LED all on\n"); + serial_send(0x0E); + serial_send(0xFF); + break; + case KC_PGDOWN: + print("LED all off\n"); + serial_send(0x0E); + serial_send(0x00); + break; + case KC_INSERT: + print("layout\n"); + serial_send(0x0F); + break; + default: + xprintf("Unknown extra command: %02X\n", code); + return false; + } + return true; +} diff --git a/keyboards/converter/sun_usb/config.h b/keyboards/converter/sun_usb/config.h new file mode 100644 index 0000000000..f7ad416393 --- /dev/null +++ b/keyboards/converter/sun_usb/config.h @@ -0,0 +1,88 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#define CUSTOM_MATRIX 2 + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3333 +#define DEVICE_VER 0x0100 +#define MANUFACTURER QMK +#define PRODUCT Sun keyboard converter +#define DESCRIPTION USB converter for Sun type 5 keyboard + +/* matrix size */ +#define MATRIX_ROWS 16 +#define MATRIX_COLS 8 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ + keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +/* Serial(USART) configuration + * asynchronous, negative logic, 1200baud, no flow control + * 1-start bit, 8-data bit, non parity, 1-stop bit + */ +#define SERIAL_SOFT_BAUD 1200 +#define SERIAL_SOFT_PARITY_NONE +#define SERIAL_SOFT_BIT_ORDER_LSB +#define SERIAL_SOFT_LOGIC_NEGATIVE +/* RXD Port */ +#define SERIAL_SOFT_RXD_ENABLE +#define SERIAL_SOFT_RXD_DDR DDRD +#define SERIAL_SOFT_RXD_PORT PORTD +#define SERIAL_SOFT_RXD_PIN PIND +#define SERIAL_SOFT_RXD_BIT 2 +#define SERIAL_SOFT_RXD_VECT INT2_vect +/* RXD Interupt */ +#define SERIAL_SOFT_RXD_INIT() do { \ + /* pin configuration: input with pull-up */ \ + SERIAL_SOFT_RXD_DDR &= ~(1< + +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 . +*/ + +#include QMK_KEYBOARD_H +#include "protocol/serial.h" + +void led_set(uint8_t usb_led) +{ + uint8_t sun_led = 0; + if (usb_led & (1< + +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 . +*/ + +#include QMK_KEYBOARD_H +#include "protocol/serial.h" + +/* + * Matrix Array usage: + * + * ROW: 16(4bits) + * COL: 8(3bits) + * + * 8bit wide + * +---------+ + * 0|00 ... 07| + * 1|08 ... 0F| + * :| ... | + * :| ... | + * E|70 ... 77| + * F|78 ... 7F| + * +---------+ + */ +static uint8_t matrix[MATRIX_ROWS]; +#define ROW(code) ((code>>3)&0xF) +#define COL(code) (code&0x07) + +static bool is_modified = false; + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + /* DDRD |= (1<<6); */ + /* PORTD |= (1<<6); */ + debug_enable = true; + + serial_init(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + + /* // wait for keyboard coming up */ + /* // otherwise LED status update fails */ + /* print("Reseting "); */ + /* while (1) { */ + /* print("."); */ + /* while (serial_recv()); */ + /* serial_send(0x01); */ + /* _delay_ms(500); */ + /* if (serial_recv() == 0xFF) { */ + /* _delay_ms(500); */ + /* if (serial_recv() == 0x04) */ + /* break; */ + /* } */ + /* } */ + /* print(" Done\n"); */ + + /* PORTD &= ~(1<<6); */ + + matrix_init_quantum(); + return; +} + +uint8_t matrix_scan(void) +{ + uint8_t code; + code = serial_recv(); + if (!code) return 0; + + debug_hex(code); debug(" "); + + switch (code) { + case 0xFF: // reset success: FF 04 + print("reset: "); + _delay_ms(500); + code = serial_recv(); + xprintf("%02X\n", code); + if (code == 0x04) { + // LED status + led_set(host_keyboard_leds()); + } + return 0; + case 0xFE: // layout: FE + print("layout: "); + _delay_ms(500); + xprintf("%02X\n", serial_recv()); + return 0; + case 0x7E: // reset fail: 7E 01 + print("reset fail: "); + _delay_ms(500); + xprintf("%02X\n", serial_recv()); + return 0; + case 0x7F: + // all keys up + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + return 0; + } + + if (code&0x80) { + // break code + if (matrix_is_on(ROW(code), COL(code))) { + matrix[ROW(code)] &= ~(1< + + 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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT( + KC_F10,KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_BSPC, KC_VOLD, KC_MUTE, KC_VOLU, + KC_F12,KC_F13, KC_ESC,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_BSLS,KC_GRV, KC_MPRV, KC_MPLY, KC_MNXT, + KC_F14,KC_F15, 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_DEL, KC_HOME, KC_UP, KC_PGUP, + KC_F16,KC_F17, KC_LCTL, 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_LEFT,KC_INSERT,KC_RIGHT, + KC_F18,KC_F19, KC_LSFT, KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT,KC_SLSH,KC_RSFT,KC_RCTL, KC_END, KC_DOWN,KC_PGDOWN, + KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI + ), +}; diff --git a/keyboards/converter/sun_usb/type3/rules.mk b/keyboards/converter/sun_usb/type3/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/converter/sun_usb/type3/type3.h b/keyboards/converter/sun_usb/type3/type3.h new file mode 100644 index 0000000000..f6f14f4eff --- /dev/null +++ b/keyboards/converter/sun_usb/type3/type3.h @@ -0,0 +1,66 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef TYPE3_H +#define TYPE3_H + +#include "quantum.h" + +/* Sun type 3 keyboard +,-------. ,-----------------------------------------------------------. ,-----------. +| 01| 03| | 05| 06| 08| 0A| 0C| 0E| 10| 11| 12| 2B| | 15| 16| 17| +|-------| |-----------------------------------------------------------| |-----------| +| 19| 1A| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2D| 2E| 2F| +|-------| |-----------------------------------------------------------| |-----------| +| 31| 33| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 42 | | 44| 45| 46| +|-------| |-----------------------------------------------------------| |-----------| +| 48| 49| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| +|-------| |-----------------------------------------------------------| |-----------| +| 5F| 61| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E| 6F| | 70| 71| 72| +`-------' |-----------------------------------------------------------| `-----------' + | 77 | 78 | 79 | 7A | 13 | + `-----------------------------------------------------------' +*/ + + +#define LAYOUT( \ + K01,K03, K05,K06, K08, K0A, K0C, K0E, K10,K11,K12,K2B, K15,K16,K17, \ + K19,K1A, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2D,K2E,K2F, \ + K31,K33, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K42, K44,K45,K46, \ + K48,K49, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ + K5F,K61, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E,K6F, K70,K71,K72, \ + K77,K78, K79, K7A,K13 \ +) { \ + { KC_NO, K01 , KC_NO, K03 , KC_NO, K05 , K06 , KC_NO }, \ + { K08 , KC_NO, K0A , KC_NO, K0C , KC_NO, K0E , KC_NO }, \ + { K10 , K11 , K12 , K13 , KC_NO, K15 , K16 , K17 }, \ + { KC_NO, K19 , K1A , KC_NO, KC_NO, K1D , K1E , K1F }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \ + { K28 , K29 , K2A , K2B , KC_NO, K2D , K2E , K2F }, \ + { KC_NO, K31 , KC_NO, K33 , KC_NO, K35 , K36 , K37 }, \ + { K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \ + { K40 , K41 , K42 , KC_NO, K44 , K45 , K46 , KC_NO }, \ + { K48 , K49 , KC_NO, KC_NO, K4C , K4D , K4E , K4F }, \ + { K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \ + { K58 , K59 , KC_NO, K5B , K5C , K5D , KC_NO, K5F }, \ + { KC_NO, K61 , KC_NO, K63 , K64 , K65 , K66 , K67 }, \ + { K68 , K69 , K6A , K6B , K6C , K6D , K6E , K6F }, \ + { K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, KC_NO, K77 }, \ + { K78 , K79 , K7A , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/converter/sun_usb/type5/keymaps/default/keymap.c b/keyboards/converter/sun_usb/type5/keymaps/default/keymap.c new file mode 100644 index 0000000000..5e04ff4b3b --- /dev/null +++ b/keyboards/converter/sun_usb/type5/keymaps/default/keymap.c @@ -0,0 +1,30 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* LAYOUT_jp_unix is a superset of the other layouts, hence the default */ + LAYOUT_jp_unix( + KC_HELP, KC_NO, 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_PWR, + KC_STOP, KC_AGAIN, KC_ESC,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_BSLS,KC_GRV, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, + KC_MENU, KC_UNDO, 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_BSPC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_SELECT, KC_COPY, KC_LCTL, 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_EXECUTE,KC_PASTE, KC_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, + KC_FIND, KC_CUT, KC_CAPS,KC_LALT,KC_LGUI,KC_HENK, KC_SPC, KC_MHEN,KC_KANA,KC_RGUI,KC_APP,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT + ), +}; diff --git a/keyboards/converter/sun_usb/type5/rules.mk b/keyboards/converter/sun_usb/type5/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/converter/sun_usb/type5/type5.h b/keyboards/converter/sun_usb/type5/type5.h new file mode 100644 index 0000000000..da66d80abc --- /dev/null +++ b/keyboards/converter/sun_usb/type5/type5.h @@ -0,0 +1,148 @@ +/* + Copyright 2012 Jun Wako + + 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 . +*/ + +#ifndef TYPE5_H +#define TYPE5_H + +#include "quantum.h" + +/* sun type 5 keyboard, JP Unix-style +,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------. +| 76 | | 0F| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30| +`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------' +,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. +| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47| +|-------| |-----------------------------------------------------------| |------------ |---------------| +| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B | | 42| 4A| 7B| | 44| 45| 46| | +|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D| +| 31| 33| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| | +|-------| |-----------------------------------------------------------| ,---. |-----------|---| +| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| | +|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A| +| 5F| 61| | 77 | 13| 78 |*73 | 79 |*74 |*75| 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| | +`-------' `-----------------------------------------------------------' `-----------' `---------------' +*/ +#define LAYOUT_jp_unix( \ + K76, K0F, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \ + K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \ + K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \ + K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ + K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \ + K5F,K61, K77,K13, K78, K73, K79, K74, K75, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \ +) { \ + { KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \ + { K08 , K09 , K0A , K0B , K0C , K0D , K0E , K0F ,}, \ + { K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \ + { K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \ + { K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \ + { K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \ + { K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \ + { K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \ + { K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \ + { K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \ + { K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \ + { K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \ + { K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \ + { K70 , K71 , K72 , K73 , K74 , K75 , K76 , K77 }, \ + { K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \ +} + +/* Sun type 5 keyboard, US Unix-style +,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------. +| 76 | | 0F| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30| +`-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------' +,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. +| 01| 03| | 1D| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 58| 2A| | 2C| 34| 60| | 62| 2E| 2F| 47| +|-------| |-----------------------------------------------------------| |------------ |---------------| +| 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 2B | | 42| 4A| 7B| | 44| 45| 46| | +|-------| |-----------------------------------------------------------| `-----------' |-----------| 7D| +| 31| 33| | 4C | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| | +|-------| |-----------------------------------------------------------| ,---. |-----------|---| +| 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| | +|-------| |-----------------------------------------------------------| .-----------. |-----------| 5A| +| 5F| 61| | 77 | 13| 78 | 79 | 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| | +`-------' `-----------------------------------------------------------' `-----------' `---------------' +*/ +#define LAYOUT_us_unix( \ + K76, K0F, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \ + K01,K03, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K58,K2A, K2C,K34,K60, K62,K2E,K2F,K47, \ + K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K2B, K42,K4A,K7B, K44,K45,K46,K7D, \ + K31,K33, K4C, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ + K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \ + K5F,K61, K77,K13, K78, K79, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \ +) { \ + { KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \ + { K08 , K09 , K0A , K0B , K0C , K0D , K0E , K0F ,}, \ + { K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \ + { K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \ + { K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \ + { K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \ + { K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \ + { K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \ + { K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \ + { K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \ + { K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \ + { K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \ + { K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \ + { K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, K76 , K77 }, \ + { K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \ +} + +/* Sun type 5 keyboard, US ANSI-style + ,-------. ,---, ,---------------. ,---------------. ,---------------. ,-----------. ,---------------. + | 76 | | 1D| | 05| 06| 08| 0A| | 0C| 0E| 10| 11| | 12| 07| 09| 0B| | 16| 17| 15| | 2D| 02| 04| 30| + `-------' `---' `---------------' `---------------' `---------------' `-----------' `---------------' + ,-------. ,-----------------------------------------------------------. ,-----------. ,---------------. + | 01| 03| | 2A| 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| 2B | | 2C| 34| 60| | 62| 2E| 2F| 47| + |-------| |-----------------------------------------------------------| |------------ |---------------| + | 19| 1A| | 35 | 36| 37| 38| 39| 3A| 3B| 3C| 3D| 3E| 3F| 40| 41| 58 | | 42| 4A| 7B| | 44| 45| 46| | + |-------| |-----------------------------------------------------------| `-----------' |-----------| 7D| + | 31| 33| | 77 | 4D| 4E| 4F| 50| 51| 52| 53| 54| 55| 56| 57| 59 | | 5B| 5C| 5D| | + |-------| |-----------------------------------------------------------| ,---. |-----------|---| + | 48| 49| | 63 | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E | | 14| | 70| 71| 72| | + |-------| |-----------------------------------------------------------| .-----------. |-----------| 5A| + | 5F| 61| | 4C | 13| 78 | 79 | 7A | 43| 0D| | 18| 1B| 1C| | 5E | 32| | + `-------' `-----------------------------------------------------------' `-----------' `---------------' +*/ +#define LAYOUT_ansi( \ + K76, K1D, K05,K06,K08,K0A, K0C,K0E,K10,K11, K12,K07,K09,K0B, K16,K17,K15, K2D,K02,K04,K30, \ + K01,K03, K2A,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29, K2B, K2C,K34,K60, K62,K2E,K2F,K47, \ + K19,K1A, K35, K36,K37,K38,K39,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41, K58, K42,K4A,K7B, K44,K45,K46,K7D, \ + K31,K33, K77, K4D,K4E,K4F,K50,K51,K52,K53,K54,K55,K56,K57, K59, K5B,K5C,K5D, \ + K48,K49, K63, K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D, K6E, K14, K70,K71,K72,K5A, \ + K5F,K61, K4C,K13, K78, K79, K7A, K43, K0D, K18,K1B,K1C, K5E, K32 \ +) { \ + { KC_NO, K01 , K02 , K03 , K04 , K05 , K06 , K07 }, \ + { K08 , K09 , K0A , K0B , K0C , K0D , K0E , KC_NO,}, \ + { K10 , K11 , K12 , K13 , K14 , K15 , K16 , K17 }, \ + { K18 , K19 , K1A , K1B , K1C , K1D , K1E , K1F }, \ + { K20 , K21 , K22 , K23 , K24 , K25 , K26 , K27 }, \ + { K28 , K29 , K2A , K2B , K2C , K2D , K2E , K2F }, \ + { K30 , K31 , K32 , K33 , K34 , K35 , K36 , K37 }, \ + { K38 , K39 , K3A , K3B , K3C , K3D , K3E , K3F }, \ + { K40 , K41 , K42 , K43 , K44 , K45 , K46 , K47 }, \ + { K48 , K49 , K4A , KC_NO, K4C , K4D , K4E , K4F }, \ + { K50 , K51 , K52 , K53 , K54 , K55 , K56 , K57 }, \ + { K58 , K59 , K5A , K5B , K5C , K5D , K5E , K5F }, \ + { K60 , K61 , K62 , K63 , K64 , K65 , K66 , K67 }, \ + { K68 , K69 , K6A , K6B , K6C , K6D , K6E , KC_NO }, \ + { K70 , K71 , K72 , KC_NO, KC_NO, KC_NO, K76 , K77 }, \ + { K78 , K79 , K7A , K7B , KC_NO, K7D , KC_NO, KC_NO } \ +} +#endif -- cgit v1.2.3 From 0793abfd19d994e68f4b449eb2fed7ea51aa3e2f Mon Sep 17 00:00:00 2001 From: Patrick Hener Date: Fri, 12 Oct 2018 19:31:08 +0200 Subject: Add sendstring_german.h (#4124) * added sweet16 test keymap and touched sendstring_german.h * added sendstring_german.h * Delete keymap.c As suggested deleted the keymap file. --- quantum/keymap_extras/sendstring_german.h | 81 +++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 quantum/keymap_extras/sendstring_german.h diff --git a/quantum/keymap_extras/sendstring_german.h b/quantum/keymap_extras/sendstring_german.h new file mode 100644 index 0000000000..1eaafee317 --- /dev/null +++ b/quantum/keymap_extras/sendstring_german.h @@ -0,0 +1,81 @@ +/* Copyright 2018 Patrick Hener + * + * 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 . + */ +/* Sendstring definitions for the German layout */ +#ifndef SENDSTRING_GERMAN +#define SENDSTRING_GERMAN + +#include "keymap_german.h" + +const bool ascii_to_shift_lut[0x80] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 1, 1, 0, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 1, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 1, 0, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 0, 0, 0, 1, + 1, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 1, 1, 1, 1, 0 +}; + +/* Until an ALT table/functionality is added, the following symbols will not work: +* § @ [ ] { } \ ~ äA öÖ ß ´ +* Following characters can be printed using other characters like so: +* [ in makro will be ü +* { in makro will be Ü +* ~ in makro will be ° +*/ +const uint8_t ascii_to_keycode_lut[0x80] PROGMEM = { + 0, 0, 0, 0, 0, 0, 0, 0, + KC_BSPC, KC_TAB, KC_ENT, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, KC_ESC, 0, 0, 0, 0, + + /* SPACE ! " # $ % & ' */ + KC_SPC, KC_1, KC_2, DE_HASH, KC_4, KC_5, KC_6, DE_HASH, + /* ( ) * + , - . / */ + KC_8, KC_9, DE_PLUS, DE_PLUS, KC_COMM, DE_MINS, KC_DOT, KC_7, + /* 0 1 2 3 4 5 6 7 */ + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, + /* 8 9 : ; < = > ? */ + KC_8, KC_9, KC_DOT, KC_COMM, DE_LESS, KC_0, DE_LESS, KC_MINS, + /* @ A B C D E F G */ + KC_2, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + /* H I J K L M N O */ + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + /* P Q R S T U V W */ + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + /* X Y Z [ \ ] ^ _ */ + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, DE_CIRC, DE_MINS, + /* ` a b c d e f g */ + DE_ACUT, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, + /* h i j k l m n o */ + KC_H, KC_I, KC_J, KC_K, KC_L, KC_M, KC_N, KC_O, + /* p q r s t u v w */ + KC_P, KC_Q, KC_R, KC_S, KC_T, KC_U, KC_V, KC_W, + /* x y z { | } ~ DELETE */ + KC_X, KC_Y, KC_Z, KC_LBRC, KC_BSLS, KC_RBRC, KC_GRV, KC_DEL +}; + +#endif -- cgit v1.2.3 From e5c315f961a55ba31b44b70e4554a3969a788a99 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 12 Oct 2018 10:34:52 -0700 Subject: Treasure Type9 Fix: change diode direction to ROW2COL (#4125) --- keyboards/treasure/type9/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/treasure/type9/config.h b/keyboards/treasure/type9/config.h index 55f0a85956..367c53cb97 100644 --- a/keyboards/treasure/type9/config.h +++ b/keyboards/treasure/type9/config.h @@ -46,7 +46,7 @@ along with this program. If not, see . #define UNUSED_PINS /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW +#define DIODE_DIRECTION ROW2COL #define BACKLIGHT_PIN B5 // #define BACKLIGHT_BREATHING -- cgit v1.2.3 From d81d216d72fe4e50da22259558e86c70a4f14a8d Mon Sep 17 00:00:00 2001 From: asakuno Date: Sat, 13 Oct 2018 16:40:42 +0900 Subject: Fix Typo in Custom Quantum functions document (led_state) (#4129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit *_LOCK   ↓ DEL --- docs/custom_quantum_functions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/custom_quantum_functions.md b/docs/custom_quantum_functions.md index b077e4b78d..5b95450f26 100644 --- a/docs/custom_quantum_functions.md +++ b/docs/custom_quantum_functions.md @@ -117,12 +117,12 @@ void led_set_user(uint8_t usb_led) { } else { PORTB &= ~(1<<2); } - if (usb_led & (1< Date: Sat, 13 Oct 2018 21:46:46 +0100 Subject: Keymap: Move navigation buttons closer to the middle on XD75:skewwhiffy (#4118) * RGB toggle button * Remove custom lighting effects * Fix small bug in Symbols layer * Ignore mod tap interrupt in XD75 for skewwhiffy, and split layers into two for more flexibility and fix persistent layer issue * Replace shift in nav layer with IntelliJ omnibox shortcut to avoid a sticky shift * Remove custom setting in config, because it were annoying, it were. * Move navigation buttons in one key * Some review markups * Use enums for layers * Use LAYOUT_ortho_5x15 * Revert some capitalization changes made by accident --- keyboards/xd75/keymaps/skewwhiffy/config.h | 24 --- keyboards/xd75/keymaps/skewwhiffy/keymap.c | 281 ++++++++++++----------------- 2 files changed, 113 insertions(+), 192 deletions(-) delete mode 100644 keyboards/xd75/keymaps/skewwhiffy/config.h diff --git a/keyboards/xd75/keymaps/skewwhiffy/config.h b/keyboards/xd75/keymaps/skewwhiffy/config.h deleted file mode 100644 index f52a97bbc8..0000000000 --- a/keyboards/xd75/keymaps/skewwhiffy/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2017 REPLACE_WITH_YOUR_NAME - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -// place overrides here - -#endif diff --git a/keyboards/xd75/keymaps/skewwhiffy/keymap.c b/keyboards/xd75/keymaps/skewwhiffy/keymap.c index 11fa2f0e64..33f3868084 100644 --- a/keyboards/xd75/keymaps/skewwhiffy/keymap.c +++ b/keyboards/xd75/keymaps/skewwhiffy/keymap.c @@ -13,41 +13,49 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "xd75.h" +#include QMK_KEYBOARD_H #include "keymap_uk.h" -// Fillers to make layering more clear -#define _______ KC_TRNS // Layer shorthand -#define _CM 0 // Colemak -#define _DV 1 // Dvorak -#define _QW 2 // QWERTY -#define _NB 3 // Numbers -#define _SY 4 // Symbols -#define _NAV 5 // Navigation +enum Layers { + cm, // colemak + dv, // dvorak + qw, // qwerty + nbl, // numbers left + nbr, // numbers right + syl, // symbols left + syr, // symbols right + nal, // navigation left + nar // navigation right +}; // Layer buttons #define _Z_SFT SFT_T(UK_Z) #define _SCLSH SFT_T(UK_SCLN) #define _SLSH SFT_T(UK_SLSH) -#define _X_NB LT(_NB, UK_X) -#define _Q_NB LT(_NB, UK_Q) -#define _DOT_NB LT(_NB, UK_DOT) -#define _V_NB LT(_NB, UK_V) -#define _C_SY LT(_SY, UK_C) -#define _J_SY LT(_SY, UK_J) -#define _W_SY LT(_SY, UK_W) -#define _COM_SY LT(_SY, UK_COMM) -#define _AST_SY LT(_SY, UK_PAST) -#define _B_NAV LT(_NAV, UK_B) -#define _X_NAV LT(_NAV, UK_X) -#define _K_NAV LT(_NAV, UK_K) -#define _N_NAV LT(_NAV, UK_N) -#define _F1_NB LT(_NB, UK_F1) -#define _3_NB LT(_NB, UK_3) + +#define _X_NB LT(nbl, UK_X) +#define _Q_NB LT(nbl, UK_Q) +#define _DOT_NB LT(nbr, UK_DOT) +#define _V_NB LT(nbr, UK_V) +#define __NBL LT(nbl, _______) +#define __NBR LT(nbr, _______) + +#define _C_SY LT(syl, UK_C) +#define _J_SY LT(syl, UK_J) +#define _W_SY LT(syr, UK_W) +#define _COM_SY LT(syr, UK_COMM) +#define __SYL LT(syl, _______) +#define __SYR LT(syr, _______) + +#define _V_NAL LT(nal, UK_V) +#define _K_NAL LT(nal, UK_K) +#define _M_NAR LT(nar, UK_M) +#define __NAL LT(nal, _______) +#define __NAR LT(nar, _______) // Custom hotkeys -#define _TERM LCTL(UK_QUOT) // Hotkey for Cmder or iTerm +#define _TERM LCTL(UK_QUOT) // Hotkey for terminal #define _S_TAB S(UK_TAB) #define _C_LEFT LCTL(UK_LEFT) #define _C_RGHT LCTL(UK_RGHT) @@ -55,35 +63,34 @@ #define _A_RGHT LALT(UK_RGHT) enum custom_keycodes { - L_NEXT = SAFE_RANGE, - L_SB + IJ_OMN = SAFE_RANGE // IntelliJ Omnibox }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Colemak _CM +/* Colemak * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | L_NEXT | L_SB | + * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| * | Q | W | F | P | G | | | | | | J | L | U | Y | ; | * |--------------------------------------------------------------------------------------------------------------------------------------| * | A | R | S | T | D | | | | | | H | N | E | I | O | * |--------------------------------------------------------------------------------------------------------------------------------------| * | Z | X | C | V | B | | | | | | K | M | , | . | / | - * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT | * |--------------------------------------------------------------------------------------------------------------------------------------| * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | * .--------------------------------------------------------------------------------------------------------------------------------------. */ - [_CM] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, L_NEXT, L_SB }, - { UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN }, - { UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O }, - { _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _K_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH }, - { UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT } - }, - -/* DVORAK _DV + [cm] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, _______, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, \ + UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, _______, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O , \ + _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, _______, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \ + UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, _______, _______, _______, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \ + ), + +/* Dvorak * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| @@ -92,18 +99,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | A | O | E | U | I | | | | | | D | H | T | N | S | * |--------------------------------------------------------------------------------------------------------------------------------------| * | ; | Q | J | K | X | | | | | | B | M | W | V | Z | - * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT | * |--------------------------------------------------------------------------------------------------------------------------------------| * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| */ - [_DV] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, _______, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L }, - { UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, _______, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S }, - { _SCLSH, _Q_NB, _J_SY, UK_K, _X_NAV, _______, _______, _______, _______, _______, _B_NAV, UK_M, _W_SY, _V_NB, _Z_SFT }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } - }, + [dv] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, _______, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L , \ + UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, _______, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S , \ + _SCLSH, _Q_NB, _J_SY, _K_NAL, UK_X, _______, _______, _______, _______, _______, UK_B, _M_NAR, _W_SY, _V_NB, _Z_SFT , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), /* QWERTY _QW * .--------------------------------------------------------------------------------------------------------------------------------------. @@ -114,20 +121,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | A | S | D | F | G | | | | | | H | J | K | L | ; | * |--------------------------------------------------------------------------------------------------------------------------------------| * | Z | X | C | V | B | | | | | | N | M | , | . | / | - * | SHIFT | NUMBER | SYMBOL | | NAV | | | | | | NAV | | SYMBOL | FUNC | SHIFT | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | | | | NAV | SYMBOL | FUNC | SHIFT | * |--------------------------------------------------------------------------------------------------------------------------------------| * | | | | | | | | | | | | | | | | * |--------------------------------------------------------------------------------------------------------------------------------------| * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | | | | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | * .--------------------------------------------------------------------------------------------------------------------------------------. */ - [_QW] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, _______, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P }, - { UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, _______, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN }, - { _Z_SFT, _X_NB, _C_SY, UK_V, _B_NAV, _______, _______, _______, _______, _______, _N_NAV, UK_M, _COM_SY, _DOT_NB, _SLSH }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } - }, + [qw] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, _______, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P , \ + UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, _______, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN, \ + _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, _______, _______, _______, UK_N, _M_NAR, _COM_SY, _DOT_NB, _SLSH , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), /* Numbers _NB * .--------------------------------------------------------------------------------------------------------------------------------------. @@ -142,15 +149,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_NB] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______ }, - { _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______ }, - { _______, _F1_NB, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, _3_NB, UK_DOT }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } - }, - -/* Symbols _SY + [nbl] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______, \ + _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______, \ + _______, __NBL, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, UK_3, UK_DOT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [nbr] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, _______, _______, _______, UK_7, UK_8, UK_9, _______, \ + _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, _______, _______, _______, UK_4, UK_5, UK_6, _______, \ + _______, UK_F1, UK_F2, UK_F3, UK_F12, _______, _______, _______, _______, _______, UK_0, UK_1, UK_2, __NBR, UK_DOT , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Symbols _SY * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -163,17 +177,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_SY] = { - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH }, - { UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT }, - { UK_CIRC, UK_AMPR, _AST_SY, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, _COM_SY, UK_RABK, UK_GRV }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } - }, + [syl] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \ + UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT , \ + UK_CIRC, UK_AMPR, __SYL, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [syr] = LAYOUT_ortho_5x15( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, _______, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \ + UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT , \ + UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, _______, _______, _______, UK_LABK, UK_LBRC, __SYR, UK_RABK, UK_GRV , \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), /* - * Navigation + * Navigation _NA * .--------------------------------------------------------------------------------------------------------------------------------------. - * | RESET | COLEMA | DVORAK | QWERTY | | | | | | | | | | | | + * | RESET | COLEMA | DVORAK | QWERTY | | RGB_TG | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Esc | Ctrl L | Up | Ctrl R | | RGB HD | RGB HI | | | | | PtSn | ScLk | Pause | | * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -184,105 +205,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | RGB RMD| RGB MD | | | | | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ - [_NAV] = { - { RESET, DF(_CM), DF(_DV), DF(_QW), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______ }, - { UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM }, - { _S_TAB, _A_LEFT, UK_LSFT, _A_RGHT, _B_NAV, RGB_VAD, RGB_VAI, _______, _______, _______, _K_NAV, UK_SLCK, UK_END, UK_PGDN, _______ }, - { _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ } - }, -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + [nal] = LAYOUT_ortho_5x15( \ + RESET, DF(cm), DF(dv), DF(qw), _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, \ + UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM , \ + _S_TAB, _A_LEFT, IJ_OMN, __NAL, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, UK_SLCK, UK_END, UK_PGDN, _______, \ + _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [nar] = LAYOUT_ortho_5x15( \ + RESET, DF(cm), DF(dv), DF(qw), _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + UK_ESC, _C_LEFT, UK_UP , _C_RGHT, _______, RGB_HUD, RGB_HUI, _______, _______, _______, _______, UK_PSCR, UK_SLCK, UK_PAUS, _______, \ + UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, _______, RGB_SAD, RGB_SAI, _______, _______, _______, _______, UK_INS, UK_HOME, UK_PGUP, _TERM , \ + _S_TAB, _A_LEFT, IJ_OMN, _A_RGHT, _______, RGB_VAD, RGB_VAI, _______, _______, _______, _______, __NAR, UK_END, UK_PGDN, _______, \ + _______, _______, _______, _______, _______, RGB_RMOD,RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) }; -bool lightsOn = true; -int keyPresses = 0; -int effect = 0; -uint32_t key_timer; - -void resetCounts(void) { - effect++; - keyPresses = 0; - key_timer = timer_read32(); -} - -void matrix_scan_user(void) { - if (!lightsOn) { - rgblight_setrgb(0, 0, 0); - return; - } - if (timer_elapsed32(key_timer) > 60000) { - resetCounts(); - } - switch (effect) { - case 0: - rgblight_effect_breathing(3); - break; - case 1: - rgblight_effect_knight(3); - break; - case 2: - rgblight_effect_rainbow_swirl(128); - break; - case 3: - rgblight_effect_snake(30); - break; - case 4: - rgblight_effect_rainbow_swirl(128); - break; - case 5: - rgblight_effect_rainbow_mood(128); - break; - case 6: - rgblight_effect_christmas(); - break; - case 7: - rgblight_effect_rgbtest(); - break; - default: - effect = 0; - break; - } -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!record->event.pressed) return true; - if (keycode == L_SB) { - lightsOn = !lightsOn; - if (!lightsOn) { - keyPresses = 0; - } else { - resetCounts(); + if (record->event.pressed) { + switch(keycode) { + case IJ_OMN: + SEND_STRING(SS_TAP(X_LSHIFT)SS_TAP(X_LSHIFT)); + return false; } - return true; - } - if (keycode == L_NEXT) { - resetCounts(); - return true; - } - keyPresses++; - if (keyPresses > 100) { - resetCounts(); } return true; } -- cgit v1.2.3 From d7dea0e6d9a6e9a8ed7e760a996aac8f89560a5b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 15 Oct 2018 08:31:26 -0700 Subject: Fix ErgoTravel Board It was not properly including the "config_common" files, and was causing it to break on the configurator. Additionally, updated this to use the split common code. --- keyboards/ergotravel/config.h | 73 +--- keyboards/ergotravel/ergotravel.h | 4 +- keyboards/ergotravel/i2c.c | 162 ------- keyboards/ergotravel/i2c.h | 49 --- keyboards/ergotravel/keymaps/ckofy/config.h | 6 +- keyboards/ergotravel/keymaps/ckofy/keymap.c | 12 +- keyboards/ergotravel/keymaps/ckofy/rules.mk | 3 - keyboards/ergotravel/keymaps/default/config.h | 7 +- keyboards/ergotravel/keymaps/default/rules.mk | 3 - keyboards/ergotravel/keymaps/ian/config.h | 7 +- keyboards/ergotravel/keymaps/ian/rules.mk | 3 - .../ergotravel/keymaps/jpconstantineau/config.h | 7 +- .../ergotravel/keymaps/jpconstantineau/rules.mk | 3 - keyboards/ergotravel/keymaps/viet/config.h | 6 +- keyboards/ergotravel/keymaps/viet/rules.mk | 3 - keyboards/ergotravel/matrix.c | 482 --------------------- keyboards/ergotravel/rev1/config.h | 6 +- keyboards/ergotravel/rules.mk | 10 +- keyboards/ergotravel/serial.c | 228 ---------- keyboards/ergotravel/serial.h | 26 -- keyboards/ergotravel/split_util.c | 86 ---- keyboards/ergotravel/split_util.h | 20 - 22 files changed, 20 insertions(+), 1186 deletions(-) delete mode 100644 keyboards/ergotravel/i2c.c delete mode 100644 keyboards/ergotravel/i2c.h delete mode 100644 keyboards/ergotravel/matrix.c delete mode 100644 keyboards/ergotravel/serial.c delete mode 100644 keyboards/ergotravel/serial.h delete mode 100644 keyboards/ergotravel/split_util.c delete mode 100644 keyboards/ergotravel/split_util.h diff --git a/keyboards/ergotravel/config.h b/keyboards/ergotravel/config.h index beda546a04..2130801819 100644 --- a/keyboards/ergotravel/config.h +++ b/keyboards/ergotravel/config.h @@ -15,76 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once -#include QMK_KEYBOARD_CONFIG_H +#include "config_common.h" -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x1256 -#define DEVICE_VER 0x0100 -#define MANUFACTURER JPConstantineau.com -#define PRODUCT ErgoTravel Keyboard -#define DESCRIPTION Split 45 percent ergonomic keyboard - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 8 -#define MATRIX_COLS 7 - -// wiring of each half -#define MATRIX_ROW_PINS { C6, D7, E6, B4 } -#define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -// #define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_LEVELS 5 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - -/* - * 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 - -#endif diff --git a/keyboards/ergotravel/ergotravel.h b/keyboards/ergotravel/ergotravel.h index 10bc4e2bb9..7201db788d 100644 --- a/keyboards/ergotravel/ergotravel.h +++ b/keyboards/ergotravel/ergotravel.h @@ -1,5 +1,4 @@ -#ifndef ERGOTRAVEL_H -#define ERGOTRAVEL_H +#pragma once #ifdef KEYBOARD_ergotravel_rev1 #include "rev1.h" @@ -21,4 +20,3 @@ KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ ) -#endif \ No newline at end of file diff --git a/keyboards/ergotravel/i2c.c b/keyboards/ergotravel/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/ergotravel/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 100000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/ergotravel/keymaps/ckofy/config.h b/keyboards/ergotravel/keymaps/ckofy/config.h index 41ec06657e..7c99c093c9 100644 --- a/keyboards/ergotravel/keymaps/ckofy/config.h +++ b/keyboards/ergotravel/keymaps/ckofy/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -40,4 +37,3 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif diff --git a/keyboards/ergotravel/keymaps/ckofy/keymap.c b/keyboards/ergotravel/keymaps/ckofy/keymap.c index cc2c33cca3..9de5fa2b84 100644 --- a/keyboards/ergotravel/keymaps/ckofy/keymap.c +++ b/keyboards/ergotravel/keymaps/ckofy/keymap.c @@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , ,COMM, P1 , P2 , P3 ,PLUS, , //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - , , , , , , , P0 ,NLCK, , , + , , , , , , , P0 ,NLCK, , , //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' ), @@ -112,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| ,UDO ,CUT ,CPY ,PST ,XXXX, , ,XXXX,XXXX,COMM,DOT ,SLSH, , //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - , , , , , , , , , , , + , , , , , , , , , , , //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' ), @@ -124,7 +124,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , GRV,TILD,XXXX,EQL ,PLUS, , ,UNDS,MINS,COMM,DOT ,SLSH,ENT , //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| - , , , , , , , , , , , + , , , , , , , , , , , //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' ), @@ -139,7 +139,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----. .----+----+----+----+----+----+----| , , , , , , , , ,VOLD,VOLU,MUTE //`----+----+----+--+-+----/----/ \----\----+----+----+----+----' - ) + ) }; @@ -148,9 +148,9 @@ const uint16_t PROGMEM fn_actions[] = { ,[F_ALT] = ACTION_MODS_ONESHOT (MOD_LALT) ,[F_CTRL] = ACTION_MODS_ONESHOT (MOD_LCTL) ,[F_NUMPAD] = ACTION_LAYER_TAP_TOGGLE(_NUMPAD) -// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower) +// ,[F_LOWER] = ACTION_LAYER_TAP_TOGGLE(LOWER) // FN1 - Momentary Layer 1 (Lower) // ,[F_RAISE] = ACTION_LAYER_TAP_TOGGLE(RAISE) // FN2 - Momentary Layer 2 (Raise) -}; +}; diff --git a/keyboards/ergotravel/keymaps/ckofy/rules.mk b/keyboards/ergotravel/keymaps/ckofy/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/ergotravel/keymaps/ckofy/rules.mk +++ b/keyboards/ergotravel/keymaps/ckofy/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergotravel/keymaps/default/config.h b/keyboards/ergotravel/keymaps/default/config.h index abb8cfa8e6..eeca26ce1d 100644 --- a/keyboards/ergotravel/keymaps/default/config.h +++ b/keyboards/ergotravel/keymaps/default/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -38,4 +35,4 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif + diff --git a/keyboards/ergotravel/keymaps/default/rules.mk b/keyboards/ergotravel/keymaps/default/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/ergotravel/keymaps/default/rules.mk +++ b/keyboards/ergotravel/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergotravel/keymaps/ian/config.h b/keyboards/ergotravel/keymaps/ian/config.h index b2e8ca9b5d..dea5b121ea 100644 --- a/keyboards/ergotravel/keymaps/ian/config.h +++ b/keyboards/ergotravel/keymaps/ian/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -38,4 +35,4 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif + diff --git a/keyboards/ergotravel/keymaps/ian/rules.mk b/keyboards/ergotravel/keymaps/ian/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/ergotravel/keymaps/ian/rules.mk +++ b/keyboards/ergotravel/keymaps/ian/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergotravel/keymaps/jpconstantineau/config.h b/keyboards/ergotravel/keymaps/jpconstantineau/config.h index abb8cfa8e6..eeca26ce1d 100644 --- a/keyboards/ergotravel/keymaps/jpconstantineau/config.h +++ b/keyboards/ergotravel/keymaps/jpconstantineau/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -38,4 +35,4 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif + diff --git a/keyboards/ergotravel/keymaps/jpconstantineau/rules.mk b/keyboards/ergotravel/keymaps/jpconstantineau/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/ergotravel/keymaps/jpconstantineau/rules.mk +++ b/keyboards/ergotravel/keymaps/jpconstantineau/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergotravel/keymaps/viet/config.h b/keyboards/ergotravel/keymaps/viet/config.h index 24e95b2b96..1c6c400b45 100644 --- a/keyboards/ergotravel/keymaps/viet/config.h +++ b/keyboards/ergotravel/keymaps/viet/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -39,4 +36,3 @@ along with this program. If not, see . #define RGBLIGHT_VAL_STEP 20 #define RGBLIGHT_LIMIT_VAL 220 -#endif diff --git a/keyboards/ergotravel/keymaps/viet/rules.mk b/keyboards/ergotravel/keymaps/viet/rules.mk index da4752731b..24963d46b6 100644 --- a/keyboards/ergotravel/keymaps/viet/rules.mk +++ b/keyboards/ergotravel/keymaps/viet/rules.mk @@ -2,6 +2,3 @@ RGBLIGHT_ENABLE = yes BACKLIGHT_ENABLE = no UNICODE_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/ergotravel/matrix.c b/keyboards/ergotravel/matrix.c deleted file mode 100644 index 4061924dc2..0000000000 --- a/keyboards/ergotravel/matrix.c +++ /dev/null @@ -1,482 +0,0 @@ -/* -Copyright 2018 Pierre Constantineau - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "backlight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // 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) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - PORTD ^= (1 << 2); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(get_backlight_level()); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/ergotravel/rev1/config.h b/keyboards/ergotravel/rev1/config.h index beda546a04..5fa447da74 100644 --- a/keyboards/ergotravel/rev1/config.h +++ b/keyboards/ergotravel/rev1/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xCEEB @@ -87,4 +84,3 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#endif diff --git a/keyboards/ergotravel/rules.mk b/keyboards/ergotravel/rules.mk index fceb56edf8..d2da788067 100644 --- a/keyboards/ergotravel/rules.mk +++ b/keyboards/ergotravel/rules.mk @@ -1,7 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c # MCU name #MCU = at90usb1287 @@ -41,7 +37,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -64,11 +60,9 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SUBPROJECT_rev1 = yes -USE_I2C = yes # I2C is used between the sides # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = ergotravel/rev1 diff --git a/keyboards/ergotravel/serial.c b/keyboards/ergotravel/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/ergotravel/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/ergotravel/serial.h b/keyboards/ergotravel/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/ergotravel/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/ergotravel/split_util.c b/keyboards/ergotravel/split_util.c deleted file mode 100644 index 346cbc9089..0000000000 --- a/keyboards/ergotravel/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif -- cgit v1.2.3 From 9fbd7eb7a58ff5a39ffcaa3fcc50320e63c8ec08 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Mon, 15 Oct 2018 16:24:29 +0000 Subject: convert to unix line-endings [skip ci] --- keyboards/ergotravel/keymaps/ckofy/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergotravel/keymaps/ckofy/keymap.c b/keyboards/ergotravel/keymaps/ckofy/keymap.c index 9de5fa2b84..7b3b333a5d 100644 --- a/keyboards/ergotravel/keymaps/ckofy/keymap.c +++ b/keyboards/ergotravel/keymaps/ckofy/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_H +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -- cgit v1.2.3 From f0f9283d02cf4a61f185ed0bf5fc83ee8247f41d Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Mon, 15 Oct 2018 12:21:14 -0500 Subject: Keymap: add new keymap for Iris (#4119) * Add files via upload * Delete config.h * Delete keymap.c * Delete rules.mk * Keymap w/mirror mode and steno support. Keymap w/mirror mode and steno support. Can be used entirely one handed. * Fixed some niggling issues. --- keyboards/iris/keymaps/vyolle_steno/config.h | 34 ++++++ keyboards/iris/keymaps/vyolle_steno/keymap.c | 149 +++++++++++++++++++++++++++ keyboards/iris/keymaps/vyolle_steno/rules.mk | 7 ++ 3 files changed, 190 insertions(+) create mode 100644 keyboards/iris/keymaps/vyolle_steno/config.h create mode 100644 keyboards/iris/keymaps/vyolle_steno/keymap.c create mode 100644 keyboards/iris/keymaps/vyolle_steno/rules.mk diff --git a/keyboards/iris/keymaps/vyolle_steno/config.h b/keyboards/iris/keymaps/vyolle_steno/config.h new file mode 100644 index 0000000000..9cbc148e42 --- /dev/null +++ b/keyboards/iris/keymaps/vyolle_steno/config.h @@ -0,0 +1,34 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_I2C +// #define USE_SERIAL + + +#define FORCE_NKRO //For Steno. + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + diff --git a/keyboards/iris/keymaps/vyolle_steno/keymap.c b/keyboards/iris/keymaps/vyolle_steno/keymap.c new file mode 100644 index 0000000000..3ad117655a --- /dev/null +++ b/keyboards/iris/keymaps/vyolle_steno/keymap.c @@ -0,0 +1,149 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _PLOVER 3 +#define _ADJUST 4 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + PLOVER, + EXT_PLV, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, PLOVER, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_RBRC, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_RSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LCTL, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_SCLN, KC_P, KC_O, KC_I, KC_U, KC_Y, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_QUOT, KC_L, KC_K, KC_J, KC_H, _______, KC_LEFT, KC_UP, KC_RGHT, KC_SCLN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ENT, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, KC_LALT, _______, _______, _______, KC_DOWN, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_LGUI, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + 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_VOLU, KC_LEFT, KC_UP, KC_RGHT, KC_INS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_VOLD, KC_PGUP, KC_DOWN, KC_PGDN, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_LALT, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_PLOVER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + STN_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_PLV, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RE1, STN_RE2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + + +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case PLOVER: + if (!record->event.pressed) { + layer_on(_PLOVER); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + layer_off(_PLOVER); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/vyolle_steno/rules.mk b/keyboards/iris/keymaps/vyolle_steno/rules.mk new file mode 100644 index 0000000000..e412316833 --- /dev/null +++ b/keyboards/iris/keymaps/vyolle_steno/rules.mk @@ -0,0 +1,7 @@ +EXTRAKEY_ENABLE = no +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes \ No newline at end of file -- cgit v1.2.3 From ec86141a4a558fc51b9ebfdcb14106b8a8d051d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Pevec?= Date: Mon, 15 Oct 2018 19:39:58 +0200 Subject: Basic Slovenian keymap added (#4128) * Basic Slovenian keymap added * Author fixed --- quantum/keymap_extras/keymap_slovenian.h | 106 +++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 quantum/keymap_extras/keymap_slovenian.h diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h new file mode 100644 index 0000000000..8b197e6c5b --- /dev/null +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -0,0 +1,106 @@ +/* Copyright 2018 Žan Pevec + * + * 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 . + */ + +#ifndef KEYMAP_SLOVENIAN +#define KEYMAP_SLOVENIAN +#include "keymap.h" + + +//Swapped Z and Y +#define SI_Z KC_Y +#define SI_Y KC_Z + +//Special characters +#define SI_CV KC_SCLN +#define SI_SV KC_LBRC +#define SI_ZV KC_BSLS + +#define SI_A KC_A +#define SI_B KC_B +#define SI_C KC_C +#define SI_D KC_D +#define SI_E KC_E +#define SI_F KC_F +#define SI_G KC_G +#define SI_H KC_H +#define SI_I KC_I +#define SI_J KC_J +#define SI_K KC_K +#define SI_L KC_L +#define SI_M KC_M +#define SI_N KC_N +#define SI_O KC_O +#define SI_P KC_P +#define SI_Q KC_Q +#define SI_R KC_R +#define SI_S KC_S +#define SI_T KC_T +#define SI_U KC_U +#define SI_V KC_V +#define SI_W KC_W +#define SI_X KC_X + +#define SI_0 KC_0 +#define SI_1 KC_1 +#define SI_2 KC_2 +#define SI_3 KC_3 +#define SI_4 KC_4 +#define SI_5 KC_5 +#define SI_6 KC_6 +#define SI_7 KC_7 +#define SI_8 KC_8 +#define SI_9 KC_9 + +#define SI_DOT KC_DOT +#define SI_COMM KC_COMM + +#define SI_PLUS KC_EQL // + and * and ~ +#define SI_QOT KC_MINS // Single quote +#define SI_MINS KC_SLSH // - and _ + +// shifted characters +#define SI_EXLM LSFT(KC_1) // ! +#define SO_DQOT LSFT(KC_2) // " +#define SI_HASH LSFT(KC_3) // # +#define SI_DLR LSFT(KC_4) // $ +#define SI_PERC LSFT(KC_5) // % +#define SI_AMPR LSFT(KC_6) // & +#define SI_SLSH LSFT(KC_7) // / +#define SI_LPRN LSFT(KC_8) // ( +#define SI_RPRN LSFT(KC_9) // ) +#define SI_EQL LSFT(KC_0) // = +#define SI_QST LSFT(SI_QOT) // ? +#define SI_ASTR LSFT(SI_PLUS) // * +#define SI_COLN LSFT(KC_DOT) // : +#define SI_SCLN LSFT(KC_COMM) // ; +#define SI_UNDS LSFT(SI_MINS) // _ + +// Alt Gr-ed characters +#define SI_CIRC ALGR(KC_3) // ^ +#define SI_DEG ALGR(KC_5) // ° +#define SI_GRV ALGR(KC_7) // ` +#define SI_ACCU ALGR(KC_9) // ´ +#define SI_LCBR ALGR(KC_B) // { +#define SI_RCBR ALGR(KC_N) // } +#define SI_LBRC ALGR(KC_F) // [ +#define SI_RBRC ALGR(KC_G) // ] +#define SI_BSLS ALGR(KC_Q) // backslash +#define SI_AT ALGR(KC_V) // @ +#define SI_EURO ALGR(KC_E) // € +#define SI_TILD ALGR(KC_1) // ~ +#define SI_PIPE ALGR(KC_W) // | + +#endif -- cgit v1.2.3 From 47e29754c215d02af39f3ee6158d4d6b76a7bffc Mon Sep 17 00:00:00 2001 From: Chris <38164944+ChrisUC@users.noreply.github.com> Date: Mon, 15 Oct 2018 12:41:43 -0500 Subject: Keymap: added default layout to the kbd6x for the tofu hhkb (#4132) * added layouts * fixed * might aswell fix the default layout aswell --- keyboards/kbd6x/keymaps/default/keymap.c | 19 -------- .../kbd6x/keymaps/hhkb-default-improved/keymap.c | 50 +++++++++++++++++++++ .../kbd6x/keymaps/hhkb-default-improved/readme.md | 1 + keyboards/kbd6x/keymaps/hhkb-default/keymap.c | 51 ++++++++++++++++++++++ keyboards/kbd6x/keymaps/hhkb-default/readme.md | 1 + 5 files changed, 103 insertions(+), 19 deletions(-) create mode 100644 keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c create mode 100644 keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md create mode 100644 keyboards/kbd6x/keymaps/hhkb-default/keymap.c create mode 100644 keyboards/kbd6x/keymaps/hhkb-default/readme.md diff --git a/keyboards/kbd6x/keymaps/default/keymap.c b/keyboards/kbd6x/keymaps/default/keymap.c index fd73b1445f..00adbf8873 100644 --- a/keyboards/kbd6x/keymaps/default/keymap.c +++ b/keyboards/kbd6x/keymaps/default/keymap.c @@ -33,25 +33,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - void matrix_init_user(void) { diff --git a/keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c b/keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c new file mode 100644 index 0000000000..80c22e5d90 --- /dev/null +++ b/keyboards/kbd6x/keymaps/hhkb-default-improved/keymap.c @@ -0,0 +1,50 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// iproved hhkb layout with more functionality + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_RCTL + ), + + [1] = 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_INS, RESET, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_DEL, + KC_RCTL, KC_VOLU, KC_VOLD, KC_MUTE, KC_MPLY, KC_MSTP, KC_ASTR, KC_SLSH, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PLUS, KC_UNDS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md b/keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md new file mode 100644 index 0000000000..be22dd16c0 --- /dev/null +++ b/keyboards/kbd6x/keymaps/hhkb-default-improved/readme.md @@ -0,0 +1 @@ +# this is the default hhkb layout in a more useable normalized form (aka the way i use mine) \ No newline at end of file diff --git a/keyboards/kbd6x/keymaps/hhkb-default/keymap.c b/keyboards/kbd6x/keymaps/hhkb-default/keymap.c new file mode 100644 index 0000000000..03153b67ac --- /dev/null +++ b/keyboards/kbd6x/keymaps/hhkb-default/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// stock hhkb as referenced by https://i.imgur.com/QoBTDHf.png + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_BSLS, KC_GRV, + 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_BSPC, + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), + KC_TRNS, KC_LALT, KC_LGUI, KC_SPACE, KC_RGUI, KC_RALT, KC_TRNS + ), + + [1] = 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_INS, KC_DEL, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, RESET, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_MSTP, KC_TRNS, KC_ASTR, KC_SLSH, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PLUS, KC_UNDS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), +}; + + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/kbd6x/keymaps/hhkb-default/readme.md b/keyboards/kbd6x/keymaps/hhkb-default/readme.md new file mode 100644 index 0000000000..cf93c3553a --- /dev/null +++ b/keyboards/kbd6x/keymaps/hhkb-default/readme.md @@ -0,0 +1 @@ +# default hhkb layout adapted to the 6x (for tofu hhkb) \ No newline at end of file -- cgit v1.2.3 From 64459fedbff54d8e8c3943e75624377a6b70464c Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Mon, 15 Oct 2018 20:42:38 +0300 Subject: Keymap: Reworked layout (#4133) * Reworked layout * Remove redundant defines https://github.com/qmk/qmk_firmware/pull/4133#discussion_r224977420 * fix typo --- keyboards/planck/keymaps/skug/config.h | 13 +- keyboards/planck/keymaps/skug/keymap.c | 256 ++++++++++++++++---------------- keyboards/planck/keymaps/skug/readme.md | 7 +- keyboards/planck/keymaps/skug/rules.mk | 2 + 4 files changed, 148 insertions(+), 130 deletions(-) diff --git a/keyboards/planck/keymaps/skug/config.h b/keyboards/planck/keymaps/skug/config.h index 0a1d8d2892..79f77786ad 100644 --- a/keyboards/planck/keymaps/skug/config.h +++ b/keyboards/planck/keymaps/skug/config.h @@ -1,13 +1,20 @@ #pragma once +// Override SpaceCadet Settings +#undef LSPO_KEY +#undef RSPC_KEY +#define LSPO_KEY KC_8 // Nordic Left SpaceCadet +#define RSPC_KEY KC_9 // Nordic Right SpaceCadet + +// Audio #ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) + #define STARTUP_SONG SONG(COIN_SOUND) #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ SONG(COLEMAK_SOUND), \ SONG(DVORAK_SOUND) \ } +#endif /* * MIDI options @@ -35,5 +42,3 @@ // Most tactile encoders have detents every 4 stages #define ENCODER_RESOLUTION 4 - -#endif diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c index 00b2ab21ce..29324a09e4 100644 --- a/keyboards/planck/keymaps/skug/keymap.c +++ b/keyboards/planck/keymaps/skug/keymap.c @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Jack Humbert +/* Copyright 2015-2017 Jack Humbert, Christoffer Holmberg * * 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 @@ -15,158 +15,124 @@ */ #include QMK_KEYBOARD_H +#include "keymap_swedish.h" #include "muse.h" extern keymap_config_t keymap_config; enum planck_layers { - _QWERTY, - _COLEMAK, - _DVORAK, + _DEFAULT, _LOWER, _RAISE, - _PLOVER, + _UTILITY, _ADJUST }; enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, + DEFAULT = SAFE_RANGE, + RAISE, + LOWER, + UTILITY, BACKLIT, - EXT_PLV + S1, S2, S3, S4, S5, S6, S7, S8, S9 }; -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) +#define ESC_LOW LT(_LOWER, KC_ESC) +#define BSP_RAI LT(_RAISE, KC_BSPC) +#define LFT_CTR CTL_T(NO_APOS) +#define RGT_CTR CTL_T(KC_TILD) +#define UTILITY MO(_UTILITY) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Å | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * | Fn | A | S | D | F | G | H | J | K | L | Ö | Ä | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * | Shift| Z | X | C | V | B | N | M | , | . | - |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | Ctrl | Super| Alt | |L/Esc | Ret | Space|R/Bspc| |AltGr | * | ¨ | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_planck_grid( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_DEFAULT] = LAYOUT_planck_grid( + KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , NO_AA , + UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , NO_OSLH, NO_AE , + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , NO_MINS, KC_RSPC, + LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, NO_ALGR, NO_ASTR, RGT_CTR ), -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_planck_grid( - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -/* Dvorak +/* Raise * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * | | | | | | | | | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_planck_grid( - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , - BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, NO_GRTR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Lower * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * | | | | | | | | | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * | | | | | | | | | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_planck_grid( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_planck_grid( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY + NO_HALF, LSFT(KC_1), NO_QUO2, LSFT(KC_3), NO_BULT, LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL , NO_QUES, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, NO_LESS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -/* Plover layer (http://opensteno.org) +/* Utility layer * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | + * | | | up | | | | | | S1 | S2 | S3 | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | + * | | left | down | right| | | | | S4 | S5 | S6 | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | + * | | | | | | | | | S7 | S8 | S9 | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | + * | | | | | | | | Del | | | | | * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = LAYOUT_planck_grid( - KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , - XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX +[_UTILITY] = LAYOUT_planck_grid( + _______, _______, KC_UP , _______, _______, _______, _______, _______, S1 , S2 , S3 , _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, S4 , S5 , S6 , _______, + _______, _______, _______, _______, _______, _______, _______, _______, S7 , S8 , S9 , _______, + _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______ ), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Utilit| | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | + * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_planck_grid( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, RESET , MU_MOD , AU_ON , AU_OFF , AG_NORM, AG_SWAP, DEFAULT, XXXXXXX , XXXXXXX, UTILITY, _______, + _______, NO_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) @@ -176,6 +142,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #ifdef AUDIO_ENABLE float plover_song[][2] = SONG(PLOVER_SOUND); float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); + float s1[][2] = SONG(NUMBER_ONE); + float s2[][2] = SONG(ZELDA_PUZZLE); + float s3[][2] = SONG(ZELDA_TREASURE); + float s4[][2] = SONG(OVERWATCH_THEME); + float s5[][2] = SONG(IMPERIAL_MARCH); + float s6[][2] = SONG(E1M1_DOOM); + float s7[][2] = SONG(COIN_SOUND); + float s8[][2] = SONG(ONE_UP_SOUND); + float s9[][2] = SONG(SONIC_RING); #endif uint32_t layer_state_set_user(uint32_t state) { @@ -184,22 +159,9 @@ uint32_t layer_state_set_user(uint32_t state) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: + case DEFAULT: if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); + set_single_persistent_default_layer(_DEFAULT); } return false; break; @@ -220,31 +182,75 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case PLOVER: + case S1: if (record->event.pressed) { #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); + PLAY_SONG(s1); + #endif //AUDIO_ENABLE } return false; break; - case EXT_PLV: + case S2: if (record->event.pressed) { #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_PLOVER); + PLAY_SONG(s2); + #endif //AUDIO_ENABLE + } + return false; + break; + case S3: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s3); + #endif //AUDIO_ENABLE + } + return false; + break; + case S4: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s4); + #endif //AUDIO_ENABLE + } + return false; + break; + case S5: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s5); + #endif //AUDIO_ENABLE + } + return false; + break; + case S6: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s6); + #endif //AUDIO_ENABLE + } + return false; + break; + case S7: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s7); + #endif //AUDIO_ENABLE + } + return false; + break; + case S8: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s8); + #endif //AUDIO_ENABLE + } + return false; + break; + case S9: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(s9); + #endif //AUDIO_ENABLE } return false; break; diff --git a/keyboards/planck/keymaps/skug/readme.md b/keyboards/planck/keymaps/skug/readme.md index 259b52f86f..aa3e6cda00 100644 --- a/keyboards/planck/keymaps/skug/readme.md +++ b/keyboards/planck/keymaps/skug/readme.md @@ -1,3 +1,8 @@ +![Nordic Planck](https://i.imgur.com/0ZOLnx2.png) + # Nordic Planck -TODO: Add layout image +This is my attempt at making a Nordic layout for the planck with all nordic +characters available in the default layer, things to note are the bottom row +with Esc, Enter, Space and Backspace in the middle for easy thumb access and +an arrow cluster on the left. diff --git a/keyboards/planck/keymaps/skug/rules.mk b/keyboards/planck/keymaps/skug/rules.mk index dcf16bef39..9721fcd747 100644 --- a/keyboards/planck/keymaps/skug/rules.mk +++ b/keyboards/planck/keymaps/skug/rules.mk @@ -1 +1,3 @@ SRC += muse.c +EXTRAKEY_ENABLE = no +CONSOLE_ENABLE = no -- cgit v1.2.3 From bf0bb1a4db98864fe04d40ca68fe6bc5a0184395 Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Mon, 15 Oct 2018 20:43:11 +0300 Subject: Keymap: Update to ergodox layout (#4134) * Disable KB mouse & cleanup * fix ascii-layout * _______ is now defined by qmk and apparently has been for a year already ;) --- keyboards/ergodox_ez/keymaps/skug/config.h | 2 ++ keyboards/ergodox_ez/keymaps/skug/keymap.c | 30 ++++++++++++++---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/skug/config.h b/keyboards/ergodox_ez/keymaps/skug/config.h index d972813920..abf1c635f1 100644 --- a/keyboards/ergodox_ez/keymaps/skug/config.h +++ b/keyboards/ergodox_ez/keymaps/skug/config.h @@ -1,5 +1,7 @@ #pragma once +#define FORCE_NKRO + #undef LSPO_KEY #undef RSPC_KEY #define LSPO_KEY KC_8 // Nordic Left SpaceCadet diff --git a/keyboards/ergodox_ez/keymaps/skug/keymap.c b/keyboards/ergodox_ez/keymaps/skug/keymap.c index 0d2ec1dd9f..d17990481e 100644 --- a/keyboards/ergodox_ez/keymaps/skug/keymap.c +++ b/keyboards/ergodox_ez/keymaps/skug/keymap.c @@ -22,8 +22,6 @@ #include "version.h" #include "keymap_swedish.h" -#define _______ KC_TRNS - #define BASE 0 // default layer #define SYMB 1 // symbols #define MDIA 2 // media keys @@ -47,8 +45,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | L4 | A | S | D | F | G |------| |------| H | J | K | L |Ö / L3| Ä/L2 | - * | | | | | | | Hypr/| | Meh/ | | | | | | | - * |--------+------+------+------+------+------| Esc | | Ent |------+------+------+------+------+--------| + * | | | | | | | | | | | | | | | | + * |--------+------+------+------+------+------| Back | |Forwd |------+------+------+------+------+--------| * | LShift/| Z | X | C | V | B | | | | N | M | ; | : | _ | RShift/| * | ( | | | | | | | | | | | , | . | - | ) | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' @@ -71,8 +69,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { NO_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_INS, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_ESC), - CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC, + KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_WBAK, + CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC, NO_LESS, KC_END, KC_LEFT, KC_RIGHT, KC_PGDN, CTL_T(KC_ENT), ALT_T(KC_ESC), KC_LGUI, @@ -81,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TO(ARRW), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS, TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE), - MEH_T(KC_ENT), KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, + KC_WFWD, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD), KC_HOME, NO_CIRC, KC_PGUP, KC_UP, KC_DOWN, @@ -101,11 +99,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | . | 0 | = | | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * |Animat| | |Toggle|Solid | + * | | | | | | * ,------|------|------| |------+------+------. * | | | | | | | | * |------|------|------| |------|------|------| - * |BNess-|Bness+| | | |Hue- |Hue+ | + * | | | | | | | | * `--------------------' `--------------------' */ // SYMBOLS @@ -116,18 +114,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,KC_HASH,NO_DLR, NO_LPRN,NO_RPRN,NO_GRV, _______,KC_PERC,NO_CIRC,NO_LBRC,NO_RBRC,NO_TILD,_______, EPRM,_______,_______,_______,_______, - RGB_MOD,_______, + _______,_______, + _______,_______,_______, _______,_______,_______, - RGB_VAD,RGB_VAI,_______, // right hand _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12, KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______, _______, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______, _______,KC_DOT, KC_0, NO_EQL, _______, - RGB_TOG, RGB_SLD, + _______, _______, _______, _______, _______, - _______, RGB_HUD, RGB_HUI + _______, _______, _______ ), /* Keymap: Media and mouse keys @@ -183,10 +181,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, // right hand TO(BASE), _______, _______, _______, _______, _______, _______, - _______, _______, KC_BTN4, KC_MS_U, KC_BTN5, _______, _______, - _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_BTN1, KC_BTN3, KC_BTN2, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -- cgit v1.2.3 From 0beb945554e043172f344eb4a48aaede28a529a0 Mon Sep 17 00:00:00 2001 From: Kenny Hung Date: Mon, 15 Oct 2018 18:44:19 +0100 Subject: Keymap: add JJ40 Skewwhiffy layout (#4135) --- keyboards/jj40/keymaps/skewwhiffy/keymap.c | 219 +++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 keyboards/jj40/keymaps/skewwhiffy/keymap.c diff --git a/keyboards/jj40/keymaps/skewwhiffy/keymap.c b/keyboards/jj40/keymaps/skewwhiffy/keymap.c new file mode 100644 index 0000000000..6b193a15cb --- /dev/null +++ b/keyboards/jj40/keymaps/skewwhiffy/keymap.c @@ -0,0 +1,219 @@ +/* Copyright 2017 Kenny Hung + * + * 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 . + */ +#include QMK_KEYBOARD_H +#include "keymap_uk.h" + +// Layer shorthand +enum Layers { + cm, // colemak + dv, // dvorak + qw, // qwerty + nbl, // numbers left + nbr, // numbers right + syl, // symbols left + syr, // symbols right + nal, // navigation left + nar // navigation right +}; + +// Layer buttons +#define _Z_SFT SFT_T(UK_Z) +#define _SCLSH SFT_T(UK_SCLN) +#define _SLSH SFT_T(UK_SLSH) + +#define _X_NB LT(nbl, UK_X) +#define _Q_NB LT(nbl, UK_Q) +#define _DOT_NB LT(nbr, UK_DOT) +#define _V_NB LT(nbr, UK_V) +#define __NBL LT(nbl, _______) +#define __NBR LT(nbr, _______) + +#define _C_SY LT(syl, UK_C) +#define _J_SY LT(syl, UK_J) +#define _W_SY LT(syr, UK_W) +#define _COM_SY LT(syr, UK_COMM) +#define __SYL LT(syl, _______) +#define __SYR LT(syr, _______) + +#define _V_NAL LT(nal, UK_V) +#define _K_NAL LT(nal, UK_K) +#define _M_NAR LT(nar, UK_M) +#define __NAL LT(nal, _______) +#define __NAR LT(nar, _______) + +// Custom hotkeys +#define _TERM LCTL(UK_QUOT) // Hotkey for terminal +#define _S_TAB S(UK_TAB) +#define _C_LEFT LCTL(UK_LEFT) +#define _C_RGHT LCTL(UK_RGHT) +#define _A_LEFT LALT(UK_LEFT) +#define _A_RGHT LALT(UK_RGHT) + +// Custom hotkeys +#define _TERM LCTL(UK_QUOT) // Hotkey for terminal +#define _S_TAB S(UK_TAB) +#define _C_LEFT LCTL(UK_LEFT) +#define _C_RGHT LCTL(UK_RGHT) +#define _A_LEFT LALT(UK_LEFT) +#define _A_RGHT LALT(UK_RGHT) + +enum custom_keycodes { + IJ_OMN = SAFE_RANGE // IntelliJ Omnibox +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Colemak + * .-----------------------------------------------------------------------------------------------------------. + * | Q | W | F | P | G | | | J | L | U | Y | ; | + * |-----------------------------------------------------------------------------------------------------------| + * | A | R | S | T | D | | | H | N | E | I | O | + * |-----------------------------------------------------------------------------------------------------------| + * | Z | X | C | V | B | | | K | M | , | . | / | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT | + * |-----------------------------------------------------------------------------------------------------------| + * | LSHIFT | LCTRL | LALT | LGUI | SPACE | ENT | DEL | BKSPC | RGUI | RALT | RCTRL | RSHIFT | + * .-----------------------------------------------------------------------------------------------------------. + */ + [cm] = LAYOUT_ortho_4x12( \ + UK_Q, UK_W, UK_F, UK_P, UK_G, _______, _______, UK_J, UK_L, UK_U, UK_Y, UK_SCLN, \ + UK_A, UK_R, UK_S, UK_T, UK_D, _______, _______, UK_H, UK_N, UK_E, UK_I, UK_O, \ + _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, UK_K, _M_NAR, _COM_SY, _DOT_NB, _SLSH, \ + UK_LSFT, UK_LCTL, UK_LALT, UK_LGUI, UK_SPC, UK_ENT, UK_DEL, UK_BSPC, UK_RGUI, UK_RALT, UK_RCTL, UK_RSFT \ + ), + +/* Dvorak + * .-----------------------------------------------------------------------------------------------------------. + * | ' | , | . | P | Y | | | F | G | C | R | L | + * |-----------------------------------------------------------------------------------------------------------| + * | A | O | E | U | I | | | D | H | T | N | S | + * |-----------------------------------------------------------------------------------------------------------| + * | ; | Q | J | K | X | | | B | M | W | V | Z | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT | + * |-----------------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------------------------| + */ + [dv] = LAYOUT_ortho_4x12( \ + UK_QUOT, UK_COMM, UK_DOT, UK_P, UK_Y, _______, _______, UK_F, UK_G, UK_C, UK_R, UK_L, \ + UK_A, UK_O, UK_E, UK_U, UK_I, _______, _______, UK_D, UK_H, UK_T, UK_N, UK_S, \ + _SCLSH, _Q_NB, _J_SY, _K_NAL, UK_X, _______, _______, UK_B, _M_NAR, _W_SY, _V_NB, _Z_SFT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +/* QWERTY + * .-----------------------------------------------------------------------------------------------------------. + * | Q | W | E | R | T | | | Y | U | I | O | P | + * |-----------------------------------------------------------------------------------------------------------| + * | A | S | D | F | G | | | H | J | K | L | ; | + * |-----------------------------------------------------------------------------------------------------------| + * | Z | X | C | V | B | | | N | M | , | . | / | + * | SHIFT | NUMBER | SYMBOL | NAV | | | | | NAV | SYMBOL | FUNC | SHIFT | + * |-----------------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * .-----------------------------------------------------------------------------------------------------------. + */ + [qw] = LAYOUT_ortho_4x12( \ + UK_Q, UK_W, UK_E, UK_R, UK_T, _______, _______, UK_Y, UK_U, UK_I, UK_O, UK_P, \ + UK_A, UK_S, UK_D, UK_F, UK_G, _______, _______, UK_H, UK_J, UK_K, UK_L, UK_SCLN, \ + _Z_SFT, _X_NB, _C_SY, _V_NAL, UK_B, _______, _______, UK_N, _M_NAR, _COM_SY, _DOT_NB, _SLSH, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +/* Numbers _NB + * .-----------------------------------------------------------------------------------------------------------. + * | | F7 | F8 | F9 | F10 | | | | 7 | 8 | 9 | | + * |-----------------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F4 | F5 | F6 | F11 | | | | 4 | 5 | 6 | | + * |-----------------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | | F1 | F2 | F3 | F12 | | | 0 | 1 | 2 | 3 | . | + * |-----------------+--------+--------+--------+--------+--------+--------+-----------------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ + [nbl] = LAYOUT_ortho_4x12( \ + _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, UK_7, UK_8, UK_9, _______, \ + _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, UK_4, UK_5, UK_6, _______, \ + _______, __NBL, UK_F2, UK_F3, UK_F12, _______, _______, UK_0, UK_1, UK_2, UK_3, UK_DOT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [nbr] = LAYOUT_ortho_4x12( \ + _______, UK_F7, UK_F8, UK_F9, UK_F10, _______, _______, _______, UK_7, UK_8, UK_9, _______, \ + _______, UK_F4, UK_F5, UK_F6, UK_F11, _______, _______, _______, UK_4, UK_5, UK_6, _______, \ + _______, UK_F1, UK_F2, UK_F3, UK_F12, _______, _______, UK_0, UK_1, UK_2, __NBR, UK_DOT, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +/* Symbols _SY + * .-----------------------------------------------------------------------------------------------------------. + * | ! | £ | _ | - | ~ | | | \ | { | } | / | # | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | $ | % | + | = | | | | " | ( | ) | ' | @ | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ^ | & | * | | | | | | < | [ | ] | > | ` | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ + [syl] = LAYOUT_ortho_4x12( \ + UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \ + UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, \ + UK_CIRC, UK_AMPR, __SYL, UK_PIPE, _______, _______, _______, UK_LABK, UK_LBRC, UK_RBRC, UK_RABK, UK_GRV, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [syr] = LAYOUT_ortho_4x12( \ + UK_EXLM, UK_PND, UK_UNDS, UK_MINS, UK_TILD, _______, _______, UK_BSLS, UK_LCBR, UK_RCBR, UK_SLSH, UK_HASH, \ + UK_DLR, UK_PERC, UK_PLUS, UK_EQL, _______, _______, _______, UK_DQUO, UK_LPRN, UK_RPRN, UK_QUOT, UK_AT, \ + UK_CIRC, UK_AMPR, UK_ASTR, UK_PIPE, _______, _______, _______, UK_LABK, UK_LBRC, __SYR, UK_RABK, UK_GRV, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + +/* + * Navigation + * .-----------------------------------------------------------------------------------------------------------. + * | Esc | Ctrl L | Up | Ctrl R | RGB RMD| RGB HD | RGB HI | RGB_TG | PtSn | ScLk | Pause | DVORAK | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | Tab | Left | Down | Right | RGB MD | RGB SD | RGB SI | COLEMAK| Insert | Home | PgUp | Term | + * +--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ShTab | Alt L | IJ Omni| Alt R | | RGB VD | RGB VI | | ScLk | End | PgDn | QWERTY | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------' + */ + [nal] = LAYOUT_ortho_4x12( \ + UK_ESC, _C_LEFT, UK_UP, _C_RGHT, RGB_RMOD,RGB_HUD, RGB_HUI, RGB_TOG, UK_PSCR, UK_SLCK, UK_PAUS, DF(dv), \ + UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, RGB_MOD, RGB_SAD, RGB_SAI, DF(cm), UK_INS, UK_HOME, UK_PGUP, _TERM, \ + _S_TAB, _A_LEFT, IJ_OMN, __NAL, _______, RGB_VAD, RGB_VAI, _______, UK_SLCK, UK_END, UK_PGDN, DF(qw), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [nar] = LAYOUT_ortho_4x12( \ + UK_ESC, _C_LEFT, UK_UP, _C_RGHT, RGB_RMOD,RGB_HUD, RGB_HUI, RGB_TOG, UK_PSCR, UK_SLCK, UK_PAUS, DF(dv), \ + UK_TAB, UK_LEFT, UK_DOWN, UK_RGHT, RGB_MOD, RGB_SAD, RGB_SAI, DF(cm), UK_INS, UK_HOME, UK_PGUP, _TERM, \ + _S_TAB, _A_LEFT, IJ_OMN, _A_RGHT, _______, RGB_VAD, RGB_VAI, _______, __NAR, UK_END, UK_PGDN, DF(qw), \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case IJ_OMN: + SEND_STRING(SS_TAP(X_LSHIFT)SS_TAP(X_LSHIFT)); + return false; + } + } + return true; +} -- cgit v1.2.3 From 4930e22dda408420332831781c4fde002a89915e Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Mon, 15 Oct 2018 10:44:55 -0700 Subject: Keymap: Move multimedia events to dedicated layer and format config (#4136) --- keyboards/dz60/keymaps/crd/keymap.c | 48 +++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 13 deletions(-) diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c index 5e9242c9d9..a17d32caaf 100644 --- a/keyboards/dz60/keymaps/crd/keymap.c +++ b/keyboards/dz60/keymaps/crd/keymap.c @@ -12,25 +12,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------------+ * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL | * |-----------------------------------------------------------------------------------------+ - * | Ctrl | Alt | Cmd | Space | Cmd | FN | L | D | R | + * | FN2 | Alt | Cmd | Space | Cmd | FN1 | L | D | R | * `-----------------------------------------------------------------------------------------' */ LAYOUT_directional( - KC_GESC, 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_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, - 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, KC_ENT, - KC_LSFT, 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_DEL, - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + KC_GESC, 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_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, + 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, KC_ENT, + KC_LSFT, 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_DEL, + MO(2), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT ), - /* FN Layer + /* FN1 Layer * ,-----------------------------------------------------------------------------------------. - * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | RESET | + * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | * |-----------------------------------------------------------------------------------------+ - * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | + * | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ - * | | BL T| BL M| BL+ | BL- | | | | | | | | | + * | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | |PgUp | | * |-----------------------------------------------------------------------------------------+ @@ -39,10 +39,32 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_directional( - KC_GRV, 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_TRNS, RESET, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, - _______, BL_TOGG, BL_STEP, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, + KC_GRV, 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_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END ), + + /* FN2 Layer (Media) + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | |Pl/Ps|Vol+ |Mute | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Prev |Vol- |Next | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), }; -- cgit v1.2.3 From 4c9372a0819b3fa062105803668d3b277222dc1a Mon Sep 17 00:00:00 2001 From: Yann Hodique Date: Mon, 15 Oct 2018 10:45:30 -0700 Subject: Keyboard: Make type 5 the default sun keyboard. (#4137) Type 5 is better polished, and probably more common as the last non-USB Sun keyboard. --- keyboards/converter/sun_usb/rules.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/converter/sun_usb/rules.mk b/keyboards/converter/sun_usb/rules.mk index e03b374f37..6e36a19050 100644 --- a/keyboards/converter/sun_usb/rules.mk +++ b/keyboards/converter/sun_usb/rules.mk @@ -40,3 +40,5 @@ ifdef HARDWARE_SERIAL else SRC += protocol/serial_soft.c endif + +DEFAULT_FOLDER = converter/sun_usb/type5 -- cgit v1.2.3 From 088b476343bf97c4bca6855a4ff2152f1bf0785e Mon Sep 17 00:00:00 2001 From: Yann Hodique Date: Mon, 15 Oct 2018 10:49:51 -0700 Subject: Keymap: add sun_usb keymap for sigma (#4138) Also add users/sigma, which contains useful code for keymaps. --- .../converter/sun_usb/type5/keymaps/sigma/keymap.c | 31 +++ .../sun_usb/type5/keymaps/sigma/readme.md | 12 + .../converter/sun_usb/type5/keymaps/sigma/rules.mk | 1 + users/sigma/config.h | 21 ++ users/sigma/rules.mk | 3 + users/sigma/sigma.c | 276 +++++++++++++++++++++ users/sigma/sigma.h | 58 +++++ 7 files changed, 402 insertions(+) create mode 100644 keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c create mode 100644 keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md create mode 100644 keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk create mode 100644 users/sigma/config.h create mode 100644 users/sigma/rules.mk create mode 100644 users/sigma/sigma.c create mode 100644 users/sigma/sigma.h diff --git a/keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c b/keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c new file mode 100644 index 0000000000..1c7ea3efc2 --- /dev/null +++ b/keyboards/converter/sun_usb/type5/keymaps/sigma/keymap.c @@ -0,0 +1,31 @@ +/* +Copyright 2018 Yann Hodique @sigma + +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 . +*/ + +#include QMK_KEYBOARD_H +#include "sigma.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = + { + [_QWERTY] = LAYOUT_us_unix( + KC_LEAD, KC_SCRT, 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_OS_LOCK, + KC_STOP, KC_OS_REDO, KC_ESC,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_BSLS,KC_GRV, KC_INS, KC_HOME,KC_PGUP, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, + VRSN, KC_OS_UNDO, 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_BSPC, KC_DEL, KC_END, KC_PGDN, KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_MAKE, KC_OS_COPY, KC_LCTL, 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_EXECUTE,KC_OS_PASTE, KC_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, + KC_FIND, KC_OS_CUT, KC_CAPS,KC_LGUI,KC_LALT, KC_SPC, KC_RGUI,KC_APP,KC_RALT, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT + ), + }; diff --git a/keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md b/keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md new file mode 100644 index 0000000000..6ae011f866 --- /dev/null +++ b/keyboards/converter/sun_usb/type5/keymaps/sigma/readme.md @@ -0,0 +1,12 @@ +Overview +======== + +This is my personal Sun Type 5 configuration. + +How to build +------------ + + make converter/sun_usb/type5:sigma:teensy + +Layers +------ diff --git a/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk b/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk new file mode 100644 index 0000000000..09a3af829a --- /dev/null +++ b/keyboards/converter/sun_usb/type5/keymaps/sigma/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = halfkay diff --git a/users/sigma/config.h b/users/sigma/config.h new file mode 100644 index 0000000000..53b986cdac --- /dev/null +++ b/users/sigma/config.h @@ -0,0 +1,21 @@ +/* + Copyright 2018 Yann Hodique @sigma + + 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 + +#define LEADER_TIMEOUT 1000 + +#define MACRO_TIMER 5 diff --git a/users/sigma/rules.mk b/users/sigma/rules.mk new file mode 100644 index 0000000000..a4cd2b34d3 --- /dev/null +++ b/users/sigma/rules.mk @@ -0,0 +1,3 @@ +LEADER_ENABLE = yes + +SRC += sigma.c diff --git a/users/sigma/sigma.c b/users/sigma/sigma.c new file mode 100644 index 0000000000..b2bf40d576 --- /dev/null +++ b/users/sigma/sigma.c @@ -0,0 +1,276 @@ +/* + Copyright 2018 Yann Hodique @sigma + + 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 . +*/ +#include "sigma.h" + +userspace_config_t runtime_userspace_config; +userspace_config_t stored_userspace_config; + +__attribute__ ((weak)) +void matrix_init_keymap(void) {} + +__attribute__ ((weak)) +void startup_keymap(void) {} + +__attribute__ ((weak)) +void shutdown_keymap(void) {} + +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} + +__attribute__ ((weak)) +uint32_t default_layer_state_set_keymap (uint32_t state) { + return state; +} + +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} + +void set_os(uint8_t os) { + runtime_userspace_config.os_target = os; + + switch (os) { + case _OS_MACOS: + set_unicode_input_mode(UC_OSX); + break; + case _OS_LINUX: + set_unicode_input_mode(UC_LNX); + break; + case _OS_WINDOWS: + set_unicode_input_mode(UC_WIN); + break; + } +} + +void matrix_init_user(void) { + stored_userspace_config.raw = eeconfig_read_user(); + runtime_userspace_config.raw = stored_userspace_config.raw; + + set_os(runtime_userspace_config.os_target); +} + +void store_userspace_config(void) { + eeconfig_update_user(stored_userspace_config.raw); +} + +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_TWO_KEYS(KC_F1, KC_L) { + set_os(_OS_LINUX); + } + SEQ_TWO_KEYS(KC_F1, KC_M) { + set_os(_OS_MACOS); + } + SEQ_TWO_KEYS(KC_F1, KC_W) { + set_os(_OS_WINDOWS); + } + SEQ_TWO_KEYS(KC_F1, KC_S) { + stored_userspace_config.raw = runtime_userspace_config.raw; + store_userspace_config(); + } + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + uint8_t os_target = runtime_userspace_config.os_target; + bool pressed = record->event.pressed; + + switch (keycode) { + case KC_QWERTY: + if (pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!pressed) { + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP +#if defined(__ARM__) + ":dfu-util" +#elif defined(BOOTLOADER_DFU) + ":dfu" +#elif defined(BOOTLOADER_HALFKAY) + ":teensy" +#elif defined(BOOTLOADER_CATERINA) + ":avrdude" +#endif // bootloader options + SS_TAP(X_ENTER)), 10); + } + return false; + break; + + case EPRM: // Resets EEPROM + if (pressed) { + eeconfig_init(); + default_layer_set(1UL< @sigma + + 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 + +#include "quantum.h" +#include "version.h" +#include "eeprom.h" + +// Define os types +enum os_types + { + _OS_MACOS = 0, + _OS_LINUX, + _OS_WINDOWS, + }; + +// Define layer names +enum userspace_layers + { + _QWERTY = 0, + }; + +typedef union { + uint32_t raw; + struct { + uint8_t os_target :2; + }; +} userspace_config_t; + +enum userspace_custom_keycodes + { + EPRM = SAFE_RANGE, // Resets EEPROM + VRSN, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_MAKE, // Rebuild the current firmware + KC_OS_CUT, + KC_OS_COPY, + KC_OS_PASTE, + KC_OS_UNDO, + KC_OS_REDO, + KC_OS_LOCK, + KC_SCRT, + NEW_SAFE_RANGE //use NEW_SAFE_RANGE for keymap specific codes + }; -- cgit v1.2.3 -- cgit v1.2.3 From 85f315ad6508d96af4497ea433c54f13c0296a90 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Mon, 8 Oct 2018 22:56:07 -0400 Subject: Add Iris Rev. 3 --- keyboards/iris/iris.h | 4 +- keyboards/iris/rev1/config.h | 2 - keyboards/iris/rev1_led/config.h | 2 - keyboards/iris/rev2/config.h | 2 - keyboards/iris/rev3/config.h | 85 ++++++++++++++++++++++++++++++++++++++++ keyboards/iris/rev3/rev3.c | 42 ++++++++++++++++++++ keyboards/iris/rev3/rev3.h | 35 +++++++++++++++++ keyboards/iris/rev3/rules.mk | 2 + 8 files changed, 167 insertions(+), 7 deletions(-) create mode 100644 keyboards/iris/rev3/config.h create mode 100644 keyboards/iris/rev3/rev3.c create mode 100644 keyboards/iris/rev3/rev3.h create mode 100644 keyboards/iris/rev3/rules.mk diff --git a/keyboards/iris/iris.h b/keyboards/iris/iris.h index 8d33b6b217..afad9a0d6d 100644 --- a/keyboards/iris/iris.h +++ b/keyboards/iris/iris.h @@ -4,8 +4,10 @@ #include "rev1.h" #elif KEYBOARD_iris_rev1_led #include "rev1_led.h" -#else +#elif KEYBOARD_iris_rev2 #include "rev2.h" +#else + #include "rev3.h" #endif #include "quantum.h" diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index fd9b2ced39..cc7f2d8d44 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -65,8 +65,6 @@ along with this program. If not, see . #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h index 18d783ae79..e9eac2455c 100644 --- a/keyboards/iris/rev1_led/config.h +++ b/keyboards/iris/rev1_led/config.h @@ -65,8 +65,6 @@ along with this program. If not, see . #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 2ea31a1541..368d21c989 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -65,8 +65,6 @@ along with this program. If not, see . #define RGB_DI_PIN D3 #define RGBLIGHT_TIMER #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/iris/rev3/config.h b/keyboards/iris/rev3/config.h new file mode 100644 index 0000000000..7f68180c29 --- /dev/null +++ b/keyboards/iris/rev3/config.h @@ -0,0 +1,85 @@ +/* +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 + +#include QMK_KEYBOARD_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x1256 +#define DEVICE_VER 0x0300 +#define MANUFACTURER Keebio +#define PRODUCT Iris Keyboard +#define DESCRIPTION Split 50 percent ergonomic keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { D2, D3, D5, D7, D6 } +#define MATRIX_COL_PINS { F1, F4, F5, F6, D4, B4 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_LEVELS 5 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN F7 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 // Number of LEDs + +/* + * 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/iris/rev3/rev3.c b/keyboards/iris/rev3/rev3.c new file mode 100644 index 0000000000..d8272db0f5 --- /dev/null +++ b/keyboards/iris/rev3/rev3.c @@ -0,0 +1,42 @@ +#include "rev3.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; + + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +// swap-hands action needs a matrix to define the swap +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + /* Right hand, matrix positions */ + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, +}; +#endif + diff --git a/keyboards/iris/rev3/rev3.h b/keyboards/iris/rev3/rev3.h new file mode 100644 index 0000000000..d44cef9a6b --- /dev/null +++ b/keyboards/iris/rev3/rev3.h @@ -0,0 +1,35 @@ +#pragma once + +#include "iris.h" +#include "quantum.h" + + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, LT4, RT4, R30, R31, R32, R33, R34, R35, \ + LT1, LT2, LT3, RT3, RT2, RT1 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { KC_NO, KC_NO, LT4, LT1, LT2, LT3 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { KC_NO, KC_NO, RT4, RT1, RT2, RT3 } \ + } diff --git a/keyboards/iris/rev3/rules.mk b/keyboards/iris/rev3/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/iris/rev3/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes -- cgit v1.2.3 From 44a348d56f661d22144202f440b87c26832a8170 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Mon, 15 Oct 2018 12:46:33 -0400 Subject: Use DFU bootloader for rev 3 --- keyboards/iris/rules.mk | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/keyboards/iris/rules.mk b/keyboards/iris/rules.mk index fa261adc6f..88dd66c18e 100644 --- a/keyboards/iris/rules.mk +++ b/keyboards/iris/rules.mk @@ -37,7 +37,11 @@ F_USB = $(F_CPU) # 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 = caterina +ifeq ($(strip $(KEYBOARD)), iris/rev3) + BOOTLOADER = dfu +else + BOOTLOADER = caterina +endif # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -- cgit v1.2.3 From 31d12662bde435e6636347ee842108b1cb3d8d48 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 15 Oct 2018 12:34:49 -0700 Subject: Update to drashna keymaps and userspace - RGB edition (#4143) * Fix up userspace after feature merges * Add new macros for keyboard layouts * Keep new layouts in keymap for easy reference * Cleanup layouts * Fix CRKBD wrappers * Fix up comments * Fix spacing in orthodox base layer * ergodox related cleanup * Make KC_MAKE only flash when holding shift * Add option to fast compile boards * Clean up rgb modes to save space * Re-enable Swap Hands on my Iris --- keyboards/crkbd/keymaps/drashna/config.h | 10 ++- keyboards/crkbd/keymaps/drashna/keymap.c | 59 +++++++------ keyboards/iris/keymaps/drashna/config.h | 2 +- keyboards/iris/keymaps/drashna/keymap.c | 67 ++++++++------ keyboards/iris/keymaps/drashna/rules.mk | 4 +- keyboards/orthodox/keymaps/drashna/config.h | 2 +- keyboards/orthodox/keymaps/drashna/keymap.c | 52 ++++++----- keyboards/orthodox/keymaps/drashna/rules.mk | 2 +- keyboards/viterbi/keymaps/drashna/config.h | 4 +- layouts/community/ergodox/drashna/config.h | 5 +- layouts/community/ergodox/drashna/keymap.c | 77 +++++++++-------- layouts/community/ortho_4x12/drashna/config.h | 2 +- layouts/community/ortho_4x12/drashna/keymap.c | 50 ++++++----- users/drashna/config.h | 6 +- users/drashna/drashna.c | 35 +++++--- users/drashna/drashna.h | 120 +++++++++++--------------- users/drashna/rgb_stuff.c | 20 ++--- users/drashna/rules.mk | 3 - users/drashna/tap_dances.c | 10 +-- 19 files changed, 282 insertions(+), 248 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index 366f013dca..adfd79044d 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -34,10 +34,12 @@ along with this program. If not, see . // #define TAPPING_FORCE_HOLD // #define TAPPING_TERM 100 +#ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 27 + +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_LIMIT_VAL 120 -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 -#define RGBLIGHT_VAL_STEP 17 +#endif diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 7bced8de33..a293d53374 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -20,37 +20,48 @@ enum crkbd_keycodes { RGBRST = NEW_SAFE_RANGE }; +#define LAYOUT_crkbd_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ + ) +#define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_wrapper( - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + [_QWERTY] = LAYOUT_crkbd_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), - [_COLEMAK] = LAYOUT_wrapper( - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_COLEMAK] = LAYOUT_crkbd_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), - [_DVORAK] = LAYOUT_wrapper( - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_DVORAK] = LAYOUT_crkbd_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), - [_WORKMAN] = LAYOUT_wrapper( - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_WORKMAN] = LAYOUT_crkbd_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), [_MODS] = LAYOUT_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, KC_RSFT, _______, _______, _______, _______, _______, _______ ), @@ -65,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______ //`--------------------' `--------------------' + _______, _______, _______, _______, _______, _______ ), [_ADJUST] = LAYOUT_wrapper( \ diff --git a/keyboards/iris/keymaps/drashna/config.h b/keyboards/iris/keymaps/drashna/config.h index 47276845f9..0274867153 100644 --- a/keyboards/iris/keymaps/drashna/config.h +++ b/keyboards/iris/keymaps/drashna/config.h @@ -31,7 +31,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 18 // Number of LEDs -#define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index 37c3f97f54..60f41f9d98 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -2,42 +2,53 @@ #include QMK_KEYBOARD_H #include "drashna.h" + +#define LAYOUT_iris_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ + KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, ALT_APP, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ + ) +#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, - KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, ALT_APP, OS_RGUI, _________________QWERTY_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + [_QWERTY] = LAYOUT_iris_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), - [_COLEMAK] = LAYOUT_wrapper( - KC_ESC , ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSLS, - KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, ALT_APP, OS_RGUI, _________________COLEMAK_R3________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_COLEMAK] = LAYOUT_iris_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), - [_DVORAK] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSLS, - KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_QUOT, - KC_MLSF, _________________DVORAK_L3_________________, ALT_APP, OS_RGUI, _________________DVORAK_R3_________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_DVORAK] = LAYOUT_iris_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), - [_WORKMAN] = LAYOUT_wrapper( - KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB , _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSLS, - KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_MLSF, _________________WORKMAN_L3________________, ALT_APP, OS_RGUI, _________________WORKMAN_R3________________, KC_MRSF, - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE + + [_WORKMAN] = LAYOUT_iris_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), [_MODS] = LAYOUT_wrapper( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, _______, _______, ___________________BLANK___________________, KC_RSFT, _______, _______, _______, _______, _______, _______ ), diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk index e8035176ef..89e568f399 100644 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ b/keyboards/iris/keymaps/drashna/rules.mk @@ -8,10 +8,10 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = no +SWAP_HANDS_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no -RGBLIGHT_TWINKLE = no +RGBLIGHT_TWINKLE = yes BOOTLOADER = qmk-dfu diff --git a/keyboards/orthodox/keymaps/drashna/config.h b/keyboards/orthodox/keymaps/drashna/config.h index 2257b62fd3..09df12d9ed 100644 --- a/keyboards/orthodox/keymaps/drashna/config.h +++ b/keyboards/orthodox/keymaps/drashna/config.h @@ -45,7 +45,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 #define RGBLED_NUM 16 // Number of LEDs -#define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 67f732c127..25296ca4fd 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -30,41 +30,47 @@ uint8_t last_led; uint8_t last_osm; #endif -// 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. -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LAYOUT_orthodox_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + KC_TAB, K11, K12, K13, K14, K15, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ + ) +#define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_wrapper(\ - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________QWERTY_R3_________________, KC_MRSF +[_QWERTY] = LAYOUT_orthodox_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), -[_COLEMAK] = LAYOUT_wrapper(\ - KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, - KC_TAB, _________________COLEMAK_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________COLEMAK_R3________________, KC_MRSF +[_COLEMAK] = LAYOUT_orthodox_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), -[_DVORAK] = LAYOUT_wrapper(\ - KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, - KC_TAB, _________________DVORAK_L2_________________, ___________ORTHODOX_THUMP_TOP_____________, _________________DVORAK_R2_________________, KC_MINS, - KC_MLSF, _________________DVORAK_L3_________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________DVORAK_R3_________________, KC_MRSF +[_DVORAK] = LAYOUT_orthodox_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), -[_WORKMAN] = LAYOUT_wrapper(\ - KC_ESC, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, - KC_TAB, _________________WORKMAN_L2________________, ___________ORTHODOX_THUMP_TOP_____________, _________________WORKMAN_R2________________, KC_MINS, - KC_MLSF, _________________WORKMAN_L3________________, ___________________ORTHODOX_THUMB_BOTTOM____________________, _________________WORKMAN_R3________________, KC_MRSF + +[_WORKMAN] = LAYOUT_orthodox_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), + [_MODS] = LAYOUT_wrapper(\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/orthodox/keymaps/drashna/rules.mk b/keyboards/orthodox/keymaps/drashna/rules.mk index a826c664a7..f870c3a7d6 100644 --- a/keyboards/orthodox/keymaps/drashna/rules.mk +++ b/keyboards/orthodox/keymaps/drashna/rules.mk @@ -10,6 +10,6 @@ NKRO_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no -RGBLIGHT_TWINKLE = no +RGBLIGHT_TWINKLE = yes BOOTLOADER = qmk-dfu diff --git a/keyboards/viterbi/keymaps/drashna/config.h b/keyboards/viterbi/keymaps/drashna/config.h index a1e361e346..6eb871a50f 100644 --- a/keyboards/viterbi/keymaps/drashna/config.h +++ b/keyboards/viterbi/keymaps/drashna/config.h @@ -19,16 +19,14 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM -#define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 16 + #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 #define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 -#define RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL 300 -#define RGBLIGHT_EFFECT_CHRISTMAS_STEP 1 #endif // RGBLIGHT_ENABLE diff --git a/layouts/community/ergodox/drashna/config.h b/layouts/community/ergodox/drashna/config.h index 3ced185932..fee954d179 100644 --- a/layouts/community/ergodox/drashna/config.h +++ b/layouts/community/ergodox/drashna/config.h @@ -5,8 +5,9 @@ #ifdef RGBLIGHT_ENABLE #undef RGBLIGHT_SAT_STEP #define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 7 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 7 + +#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 3 +#define RGBLIGHT_EFFECT_SNAKE_LENGTH 3 #define RGBLIGHT_EFFECT_BREATHE_CENTER 1 #endif // RGBLIGHT_ENABLE diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 15153c4692..b9a2eb7a8f 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -30,6 +30,24 @@ along with this program. If not, see . //define layer change stuff for underglow indicator bool skip_leds = false; +#define LAYOUT_ergodox_pretty_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_ergodox_pretty_wrapper( \ + KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, \ + KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ + KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ + KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ + ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ + KC_HOME, KC_PGUP, \ + LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ + ) + +#define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -55,15 +73,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | End | | PgDn | | | * `---------------------' `---------------------' */ - [_QWERTY] = LAYOUT_ergodox_pretty_wrapper( - // left hand // right hand - KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB, _________________QWERTY_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________QWERTY_R1_________________, KC_BSLS, - KC_C1R3, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________QWERTY_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, - __________________ERGODOX_THUMB_CLUSTER_____________________ - ), + [_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ + ), /* Keymap 0: COLEMAK layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -87,15 +101,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* - [_COLEMAK] = LAYOUT_ergodox_pretty_wrapper( - // left hand // right hand - KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB, _________________COLEMAK_L1________________, TG(_DIABLO), TG(_DIABLO), _________________COLEMAK_R1________________, KC_BSLS, - KC_C1R3, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________COLEMAK_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, - __________________ERGODOX_THUMB_CLUSTER_____________________ - ), + [_COLEMAK] = LAYOUT_ergodox_pretty_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ + ), /* Keymap 0: DVORAK Layout * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -119,15 +129,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* - [_DVORAK] = LAYOUT_ergodox_pretty_wrapper( - // left hand // right hand - KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_BSLS, - KC_TAB, _________________DVORAK_L1_________________, TG(_DIABLO), TG(_DIABLO), _________________DVORAK_R1_________________, KC_SLSH, - KC_C1R3, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_MINS, - KC_MLSF, _________________DVORAK_L3_________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________DVORAK_R3_________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, - __________________ERGODOX_THUMB_CLUSTER_____________________ - ), + [_DVORAK] = LAYOUT_ergodox_pretty_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ + ), /* Keymap 0: WORKMAN layer * * ,--------------------------------------------------. ,--------------------------------------------------. @@ -149,17 +155,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |ace | End | | PgDn | | | * `--------------------' `----------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* - [_WORKMAN] = LAYOUT_ergodox_pretty_wrapper( - // left hand - KC_ESC, ________________NUMBER_LEFT________________, UC_FLIP, UC_TABL, ________________NUMBER_RIGHT_______________, KC_MINS, - KC_TAB, _________________WORKMAN_L1________________, TG(_DIABLO), TG(_DIABLO), _________________WORKMAN_R1________________, KC_BSLS, - KC_C1R3, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_MLSF, _________________WORKMAN_L3________________, TG(_GAMEPAD), TG(_GAMEPAD), _________________WORKMAN_R3________________, KC_MRSF, - KC_GRV, ___________ERGODOX_BOTTOM_LEFT_____________, ___________ERGODOX_BOTTOM_RIGHT____________, UC_IRNY, - __________________ERGODOX_THUMB_CLUSTER_____________________ - ), + + [_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ + ), // Reverts OSM(Shift) to normal Shifts. However, may not need since we fixed the issue with RDP (LOCAL RESOURCES) [_MODS] = LAYOUT_ergodox_pretty_wrapper( diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index cbd5bb4602..b4c780cc11 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -5,7 +5,7 @@ #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) #define RGB_DI_PIN D3 #define RGBLED_NUM 16 // Number of LEDs -#define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 39f901b14f..108df69315 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -25,34 +25,44 @@ enum planck_keycodes { #define BACKLIT OSM(MOD_LSFT) #endif +#define LAYOUT_ortho_4x12_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_ortho_4x12_wrapper( \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_ENT, \ + BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ) +#define LAYOUT_ortho_4x12_base_wrapper(...) LAYOUT_ortho_4x12_base(__VA_ARGS__) + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_ortho_4x12_wrapper( - KC_ESC, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, - KC_TAB, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, - KC_MLSF, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_QWERTY] = LAYOUT_ortho_4x12_base_wrapper( + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ ), -[_COLEMAK] = LAYOUT_ortho_4x12_wrapper( - KC_ESC, _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, - KC_TAB, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_QUOT, - KC_MLSF, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, KC_ENT, - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_COLEMAK] = LAYOUT_ortho_4x12_base_wrapper( + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ ), -[_DVORAK] = LAYOUT_ortho_4x12_wrapper( - KC_ESC, _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, - KC_TAB, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_SLSH, - KC_MLSF, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, KC_ENT, - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_DVORAK] = LAYOUT_ortho_4x12_base_wrapper( + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ ), -[_WORKMAN] = LAYOUT_ortho_4x12_wrapper( - KC_TAB, _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, KC_BSPC, - KC_ESC, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_MLSF, _________________WORKMAN_L3________________, _________________WORKMAN_R3________________, KC_ENT, - BACKLIT, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +[_WORKMAN] = LAYOUT_ortho_4x12_base_wrapper( + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ ), [_MODS] = LAYOUT_ortho_4x12_wrapper( diff --git a/users/drashna/config.h b/users/drashna/config.h index 3ddec93b13..4545b34ef6 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -19,10 +19,12 @@ #ifdef RGBLIGHT_ENABLE #define RGBLIGHT_SLEEP +#undef RGBLIGHT_ANIMATIONS +#define RGBLIGHT_EFFECT_BREATHING +#define RGBLIGHT_EFFECT_SNAKE +#define RGBLIGHT_EFFECT_KNIGHT #endif // RGBLIGHT_ENABLE - - #ifndef ONESHOT_TAP_TOGGLE #define ONESHOT_TAP_TOGGLE 2 #endif // !ONESHOT_TAP_TOGGLE diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index aad9fab611..5b6620cf33 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -36,11 +36,11 @@ bool send_game_macro(const char *str, keyrecord_t *record, bool override) { keycode = KC_ENTER; } clear_keyboard(); - tap(keycode); + tap_code(keycode); wait_ms(50); send_string_with_delay(str, MACRO_TIMER); wait_ms(50); - tap(KC_ENTER); + tap_code(KC_ENTER); } if (override) wait_ms(3000); return false; @@ -127,13 +127,13 @@ uint32_t default_layer_state_set_keymap (uint32_t state) { __attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) {} - +__attribute__ ((weak)) +void eeconfig_init_keymap(void) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeprom_read_dword(EECONFIG_USERSPACE); - + userspace_config.raw = eeconfig_read_user(); #ifdef BOOTLOADER_CATERINA DDRD &= ~(1<<5); @@ -250,7 +250,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP + uint8_t temp_mod = get_mods(); + clear_mods(); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + if (temp_mod & MODS_SHIFT_MASK) { + send_string_with_delay_P(PSTR( #if defined(__ARM__) ":dfu-util" #elif defined(BOOTLOADER_DFU) @@ -260,7 +264,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #elif defined(BOOTLOADER_CATERINA) ":avrdude" #endif // bootloader options - SS_TAP(X_ENTER)), 10); + ), 10); + } + if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + set_mods(temp_mod); } return false; break; @@ -268,8 +276,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case EPRM: // Resets EEPROM if (record->event.pressed) { eeconfig_init(); - default_layer_set(1UL<event.pressed) { userspace_config.is_overwatch ^= 1; eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); } + if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } #ifdef RGBLIGHT_ENABLE userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); #endif //RGBLIGHT_ENABLE @@ -344,11 +350,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } else { if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy register_code(KC_LCTL); - tap(KC_C); + tap_code(KC_C); unregister_code(KC_LCTL); } else { // Tap, paste register_code(KC_LCTL); - tap(KC_V); + tap_code(KC_V); unregister_code(KC_LCTL); } } @@ -413,3 +419,8 @@ uint32_t default_layer_state_set_user(uint32_t state) { void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } + +void eeconfig_init_user(void) { + userspace_config.raw = 0; + eeconfig_update_user(userspace_config.raw); +} diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 49e3fc870b..7e69a9f8d9 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,14 +19,13 @@ along with this program. If not, see . #include "quantum.h" #include "version.h" #include "eeprom.h" -#include "send_unicode.h" #ifdef RGB_MATRIX_ENABLE #include "rgb_matrix.h" #endif -// Define layer names +/* Define layer names */ enum userspace_layers { _QWERTY = 0, _NUMLOCK = 0, @@ -43,28 +42,27 @@ enum userspace_layers { _ADJUST, }; -//define modifiers +/* +define modifiers here, since MOD_* doesn't seem to work for these + */ #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -// RGB color codes are no longer located here anymore. Instead, you will want to -// head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h - -extern bool rgb_layer_change; +/* +RGB color codes are no longer located here anymore. Instead, you will want to +head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h +*/ #ifdef RGBLIGHT_ENABLE void rgblight_sethsv_default_helper(uint8_t index); #endif // RGBLIGHT_ENABLE -inline void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -#define EECONFIG_USERSPACE (uint32_t *)19 - typedef union { uint32_t raw; struct { @@ -149,7 +147,7 @@ enum userspace_custom_keycodes { #define DL_RAIS LT(_RAISE, KC_DEL) #define ET_RAIS LT(_RAISE, KC_ENTER) -// OSM keycodes, to keep things clean and easy to change +/* OSM keycodes, to keep things clean and easy to change */ #define KC_MLSF OSM(MOD_LSFT) #define KC_MRSF OSM(MOD_RSFT) @@ -178,9 +176,11 @@ enum { #endif // TAP_DANCE_ENABLE -// Custom Keycodes for Diablo 3 layer -// But since TD() doesn't work when tap dance is disabled -// We use custom codes here, so we can substitute the right stuff +/* +Custom Keycodes for Diablo 3 layer +But since TD() doesn't work when tap dance is disabled +We use custom codes here, so we can substitute the right stuff +*/ #ifdef TAP_DANCE_ENABLE #define KC_D3_1 TD(TD_D3_1) #define KC_D3_2 TD(TD_D3_2) @@ -193,11 +193,11 @@ enum { #define KC_D3_4 KC_4 #endif // TAP_DANCE_ENABLE - - -// Since our quirky block definitions are basically a list of comma separated -// arguments, we need a wrapper in order for these definitions to be -// expanded before being used as arguments to the LAYOUT_xxx macro. +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ #if (!defined(LAYOUT) && defined(KEYMAP)) #define LAYOUT KEYMAP #endif @@ -208,112 +208,114 @@ enum { #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -// Blocks for each of the four major keyboard layouts -// Organized so we can quickly adapt and modify all of them -// at once, rather than for each keyboard, one at a time. -// And this allows for much cleaner blocks in the keymaps. -// For instance Tap/Hold for Control on all of the layouts - -// NOTE: These are all the same length. If you do a search/replace -// then you need to add/remove underscores to keep the -// lengths consistent. +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ #define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T #define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B #define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P #define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH #define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G #define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B #define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN #define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH #define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B #define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ CTL_T(KC_Z), KC_X, KC_C, KC_D, KC_V +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V #define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN #define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH #define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y #define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ CTL_T(KC_SCLN),KC_Q, KC_J, KC_K, KC_X +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X #define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L #define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, CTL_T(KC_Z) +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z #define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B #define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V #define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN #define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH #define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K #define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B #define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN #define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH #define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B #define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ CTL_T(KC_SCLN), KC_SLSH, KC_J KC_G, KC_COMM +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM #define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L #define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, CTL_T(KC_x) +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X #define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q #define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_W +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W #define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P #define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, CTL_T(KC_SCLN) +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN #define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W #define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ CTL_T(KC_Z), KC_V, KC_G, KC_C, KC_X +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X #define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J #define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, CTL_T(KC_SLSH) +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH #define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W #define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_F, KC_J +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J #define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN #define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH #define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W #define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_J +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J #define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN #define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, CTL_T(KC_SLSH) +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH #define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 @@ -352,21 +354,3 @@ enum { #define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -// Since we have 4 default layouts (QWERTY, DVORAK, COLEMAK and WORKMAN), -// this allows us to quickly modify the bottom row for all of the layouts -// so we don't have to alter it 4 times and hope that we haven't missed -// anything -#define ___________ERGODOX_BOTTOM_LEFT_____________ OSM(MOD_MEH), OSM(MOD_LGUI), KC_LBRC, KC_RBRC -#define ___________ERGODOX_BOTTOM_RIGHT____________ KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - -#define ___________ORTHODOX_THUMP_TOP_____________ ALT_APP, OS_LGUI, KC_LALT, OS_RGUI -#define ___________________ORTHODOX_THUMB_BOTTOM____________________ LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE - - -#define __________________ERGODOX_THUMB_CLUSTER_____________________ ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ - KC_HOME, KC_PGUP, \ - LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) - - diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 4a1a8de692..dc6075320e 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -230,7 +230,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { userspace_config.rgb_layer_change ^= 1; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); + eeconfig_update_user(userspace_config.raw); if (userspace_config.rgb_layer_change) { layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) } @@ -243,7 +243,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { if (userspace_config.rgb_layer_change) { userspace_config.rgb_layer_change = false; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeprom_update_dword(EECONFIG_USERSPACE, userspace_config.raw); + eeconfig_update_user(userspace_config.raw); } } return true; break; @@ -295,31 +295,31 @@ uint32_t layer_state_set_rgb(uint32_t state) { switch (biton32(state)) { case _MACROS: rgblight_sethsv_noeeprom_orange(); - userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); + userspace_config.is_overwatch ? rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 2) : rgblight_effect_snake(RGBLIGHT_MODE_SNAKE + 3); break; case _MEDIA: rgblight_sethsv_noeeprom_chartreuse(); - rgblight_mode_noeeprom(22); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 1); break; case _GAMEPAD: rgblight_sethsv_noeeprom_orange(); - rgblight_mode_noeeprom(17); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 2); break; case _DIABLO: rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(5); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); break; case _RAISE: rgblight_sethsv_noeeprom_yellow(); - rgblight_mode_noeeprom(5); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); break; case _LOWER: rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(5); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); break; case _ADJUST: rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(23); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); break; default: // for any other layers, or the default layer switch (biton32(default_layer_state)) { @@ -332,7 +332,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { default: rgblight_sethsv_noeeprom_cyan(); break; } - biton32(state) == _MODS ? rgblight_mode_noeeprom(2) : rgblight_mode_noeeprom(1); // if _MODS layer is on, then breath to denote it + biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it break; } // layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 3d6213eff2..964c96c522 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -37,6 +37,3 @@ ifdef CONSOLE_ENABLE endif endif -ifeq ($(strip $(UNICODE_ENABLE)), yes) - SRC += send_unicode.c -endif diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c index c9e4b1d0ff..3466758530 100644 --- a/users/drashna/tap_dances.c +++ b/users/drashna/tap_dances.c @@ -38,16 +38,16 @@ qk_tap_dance_action_t tap_dance_actions[] = { // Sends the key press to system, but only if on the Diablo layer void send_diablo_keystroke(uint8_t diablo_key) { - if (biton32(layer_state) == _DIABLO) { + if (IS_LAYER_ON(_DIABLO)) { switch (diablo_key) { case 0: - tap(KC_1); break; + tap_code(KC_1); break; case 1: - tap(KC_2); break; + tap_code(KC_2); break; case 2: - tap(KC_3); break; + tap_code(KC_3); break; case 3: - tap(KC_4); break; + tap_code(KC_4); break; } } } -- cgit v1.2.3 From 4e2817eff18f868b6d62710b67f46808d6efd22d Mon Sep 17 00:00:00 2001 From: Max Rumpf Date: Mon, 15 Oct 2018 22:23:19 +0200 Subject: Keymap: Some tweaks to Maxr1998's Contra layout (#4144) * Make some keys more accessible, prevent mistypings * Add "Gaming" layer which maps L-Ctrl to space (left-handed jumping compatibility-mode for all games) --- keyboards/contra/keymaps/maxr1998/keymap.c | 70 +++++++++++++++++++++++------- 1 file changed, 55 insertions(+), 15 deletions(-) diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c index afdd3d94ac..87bf338948 100644 --- a/keyboards/contra/keymaps/maxr1998/keymap.c +++ b/keyboards/contra/keymaps/maxr1998/keymap.c @@ -20,13 +20,17 @@ enum contra_layers { _QWERTZ, _FUNC, - _NUMROW + _NUMROW, + _NUMROW_L3, + _GAMING }; #define KC_I3 LM(_NUMROW, MOD_LALT) #define KC_NR MO(_NUMROW) #define NR_L3 SAFE_RANGE #define FUN MO(_FUNC) +#define G_1 TO(_GAMING) +#define G_0 TG(_GAMING) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -52,7 +56,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | | | | | | | Ü | | Ö | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Lock | Ä | ß | | | | | RGBS | RGBB | RGBS | | | + * | Lock | Ä | ß | | | GAME | | RGBS | RGBB | RGBS | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | RGBH-| RGBT | RGBH+| PgUp | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -61,14 +65,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FUNC] = { {_______, _______, _______, _______, _______, _______, _______, DE_UE, _______, DE_OE, _______, KC_DEL }, - {KC_LOCK, DE_AE, DE_SS, _______, _______, _______, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______}, + {KC_LOCK, DE_AE, DE_SS, _______, _______, G_1, _______, RGB_M_P, RGB_M_B, RGB_M_SW,_______, _______}, {_______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_TOG, RGB_HUI, KC_PGUP, _______}, {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, KC_HOME, KC_PGDN, KC_END } }, /* Numrow layer (special characters with Shift and ISO_L3_Shift) * ,-----------------------------------------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ß | + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | | | | | | | | | #' | | * |------+------+------+------+------+------|------+------+------+------+------+------| @@ -78,25 +82,61 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUMROW] = { - {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, DE_SS }, + {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DE_HASH, _______}, {_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______}, {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} +}, +[_NUMROW_L3] = { + {_______, DE_1, DE_2, DE_3, DE_4, DE_5, DE_6, DE_7, DE_8, DE_9, DE_0, _______}, + {_______, DE_Q, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, DE_LESS, _______, _______, _______, _______, _______, _______, _______, _______, DE_MINS, _______}, + {_______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______} +}, + +/* Gaming + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Space| | | | | | | | Reset| | | | + * `-----------------------------------------------------------------------------------' + */ +[_GAMING] = { + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_SPC, _______, _______, _______, _______, _______, _______, _______, G_0, _______, _______, _______} } }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (keycode == NR_L3) { - if (record->event.pressed) { - register_code(DE_ALGR); - layer_on(_NUMROW); - } else { - layer_off(_NUMROW); - unregister_code(DE_ALGR); - } - return false; + switch(keycode) { + case KC_BSPC: + if (record->event.pressed) { + if (get_mods() & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT))) { + register_code(DE_SS); + return false; + } + } else { + unregister_code(DE_SS); + } + return true; + case NR_L3: + if (record->event.pressed) { + register_code(DE_ALGR); + layer_on(_NUMROW_L3); + } else { + layer_off(_NUMROW_L3); + unregister_code(DE_ALGR); + } + return false; + default: + return true; } - return true; } void led_set_user(uint8_t usb_led) { -- cgit v1.2.3 From 423b419138f78118a0fde0144053284ab64ab88e Mon Sep 17 00:00:00 2001 From: jshuf <44121348+jshuf@users.noreply.github.com> Date: Mon, 15 Oct 2018 16:27:09 -0400 Subject: Keymap: 60_ansi keymap for DZ60 (#4139) * 60_ansi keymap for DZ60 * 60_ansi keymap for DZ60 Amend author * 60_ansi keymap for DZ60 --- keyboards/dz60/keymaps/60_ansi/keymap.c | 18 ++++++++++++++++++ keyboards/dz60/keymaps/60_ansi/readme.md | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 keyboards/dz60/keymaps/60_ansi/keymap.c create mode 100644 keyboards/dz60/keymaps/60_ansi/readme.md diff --git a/keyboards/dz60/keymaps/60_ansi/keymap.c b/keyboards/dz60/keymaps/60_ansi/keymap.c new file mode 100644 index 0000000000..9a9e11ac91 --- /dev/null +++ b/keyboards/dz60/keymaps/60_ansi/keymap.c @@ -0,0 +1,18 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_60_ansi( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_RCTL), + + LAYOUT_60_ansi( + KC_GRV, 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_DEL, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, RESET, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_DEL, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; diff --git a/keyboards/dz60/keymaps/60_ansi/readme.md b/keyboards/dz60/keymaps/60_ansi/readme.md new file mode 100644 index 0000000000..edbc16c042 --- /dev/null +++ b/keyboards/dz60/keymaps/60_ansi/readme.md @@ -0,0 +1,9 @@ +![60_ansi DZ60 base layer](https://i.imgur.com/MqBLh3D.png) + +![60_ansi DZ60 fn layer](https://i.imgur.com/ml1djHi.png) + +# 60_ansi DZ60 Layout + +This is a basic keymap for the 60_ansi layout of the DZ60. +The default layer is normal ANSI and the Fn layer is used for RGB +and backlighting functions. -- cgit v1.2.3 From 76aa2baf3ea169b976c4cef7013b2020d93a69c3 Mon Sep 17 00:00:00 2001 From: Jim Tittsler Date: Tue, 16 Oct 2018 08:36:20 +0900 Subject: Fix doc typo --- docs/getting_started_github.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started_github.md b/docs/getting_started_github.md index 7a3531c75d..aeb8738b77 100644 --- a/docs/getting_started_github.md +++ b/docs/getting_started_github.md @@ -8,7 +8,7 @@ Start on the [QMK Github page](https://github.com/qmk/qmk_firmware), and you'll ![Fork on Github](http://i.imgur.com/8Toomz4.jpg) -If you're apart of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button: +If you're a part of an organization, you'll need to choose which account to fork it to. In most circumstances, you'll want to fork it to your personal account. Once your fork is completed (sometimes this takes a little while), click the "Clone or Download" button: ![Download from Github](http://i.imgur.com/N1NYcSz.jpg) -- cgit v1.2.3 From 6cf9402cbc8156dd7c0892822ba949a1a1d8a4ba Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Oct 2018 11:14:52 -0700 Subject: Fix LAYOUT define generation (#4148) * Fix LAYOUT define generation Prior to this, only the full keyboard path was defined. Eg `KEYBOARD_planck_rev6`. But the docs mention `KEYBOAD_planck`, which never actually gets defined. This addresses this, and creates a define for each level of the keyboard folder, so that stuff like `KEYBOARD_planck` actually exists. * Clean up changes to make it more readable --- build_keyboard.mk | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index a73741bb3e..d225fe8216 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -110,8 +110,28 @@ ifneq ("$(wildcard $(KEYBOARD_C_1))","") KEYBOARD_SRC += $(KEYBOARD_C_1) endif -OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE) +# Generate KEYBOARD_name_subname for all levels of the keyboard folder +KEYBOARD_FILESAFE_1 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_1))) +KEYBOARD_FILESAFE_2 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_2))) +KEYBOARD_FILESAFE_3 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_3))) +KEYBOARD_FILESAFE_4 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_4))) +KEYBOARD_FILESAFE_5 := $(subst .,,$(subst /,_,$(KEYBOARD_FOLDER_PATH_5))) +ifneq ("$(wildcard $(KEYBOARD_PATH_5)/)","") + OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_5) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_4)/)","") + OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_4) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_3)/)","") + OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_3) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_2)/)","") + OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_2) +endif +ifneq ("$(wildcard $(KEYBOARD_PATH_1)/)","") + OPT_DEFS += -DKEYBOARD_$(KEYBOARD_FILESAFE_1) +endif # Setup the define for QMK_KEYBOARD_H. This is used inside of keymaps so # that the same keymap may be used on multiple keyboards. -- cgit v1.2.3 From 1dc1e12fec6b8ce06792ac2e2224b6466b4de2a3 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Oct 2018 11:35:43 -0700 Subject: Only include lufa.h if AVR in quantum/api.h --- quantum/api.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/quantum/api.h b/quantum/api.h index efc0ddca12..fc016391bc 100644 --- a/quantum/api.h +++ b/quantum/api.h @@ -17,7 +17,9 @@ #ifndef _API_H_ #define _API_H_ +#ifdef __AVR__ #include "lufa.h" +#endif enum MESSAGE_TYPE { MT_GET_DATA = 0x10, // Get data from keyboard @@ -28,7 +30,7 @@ enum MESSAGE_TYPE { MT_SEND_DATA_ACK = 0x31, // returned data/action confirmation (ACK) MT_EXE_ACTION = 0x40, // executing actions on keyboard MT_EXE_ACTION_ACK =0x41, // return confirmation/value (ACK) - MT_TYPE_ERROR = 0x80 // type not recofgnised (ACK) + MT_TYPE_ERROR = 0x80 // type not recognised (ACK) }; enum DATA_TYPE { -- cgit v1.2.3 From 8ce9e3255ee324174c7dbcc553ff089c54fc5265 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Pevec?= Date: Wed, 17 Oct 2018 00:45:05 +0200 Subject: Fixes on slovenian keymap --- quantum/keymap_extras/keymap_slovenian.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 8b197e6c5b..364bd90b8c 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -73,7 +73,7 @@ // shifted characters #define SI_EXLM LSFT(KC_1) // ! -#define SO_DQOT LSFT(KC_2) // " +#define SI_DQOT LSFT(KC_2) // " #define SI_HASH LSFT(KC_3) // # #define SI_DLR LSFT(KC_4) // $ #define SI_PERC LSFT(KC_5) // % @@ -89,18 +89,18 @@ #define SI_UNDS LSFT(SI_MINS) // _ // Alt Gr-ed characters -#define SI_CIRC ALGR(KC_3) // ^ -#define SI_DEG ALGR(KC_5) // ° -#define SI_GRV ALGR(KC_7) // ` -#define SI_ACCU ALGR(KC_9) // ´ -#define SI_LCBR ALGR(KC_B) // { -#define SI_RCBR ALGR(KC_N) // } -#define SI_LBRC ALGR(KC_F) // [ -#define SI_RBRC ALGR(KC_G) // ] -#define SI_BSLS ALGR(KC_Q) // backslash -#define SI_AT ALGR(KC_V) // @ -#define SI_EURO ALGR(KC_E) // € -#define SI_TILD ALGR(KC_1) // ~ -#define SI_PIPE ALGR(KC_W) // | +#define SI_CIRC ALTG(KC_3) // ^ +#define SI_DEG ALTG(KC_5) // ° +#define SI_GRV ALTG(KC_7) // ` +#define SI_ACCU ALTG(KC_9) // ´ +#define SI_LCBR ALTG(KC_B) // { +#define SI_RCBR ALTG(KC_N) // } +#define SI_LBRC ALTG(KC_F) // [ +#define SI_RBRC ALTG(KC_G) // ] +#define SI_BSLS ALTG(KC_Q) // backslash +#define SI_AT ALTG(KC_V) // @ +#define SI_EURO ALTG(KC_E) // € +#define SI_TILD ALTG(KC_1) // ~ +#define SI_PIPE ALTG(KC_W) // | #endif -- cgit v1.2.3 From 1d03af876c122cf16ed78025eb753e1d838edcac Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Tue, 16 Oct 2018 23:11:58 +0000 Subject: convert to unix line-endings [skip ci] --- quantum/keymap_extras/keymap_slovenian.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 364bd90b8c..53d07837e9 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -1,4 +1,4 @@ -/* Copyright 2018 Žan Pevec +/* Copyright 2018 Žan Pevec * * 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 -- cgit v1.2.3 From 1f13254460db4ad4cb3c4868b69fbb35cca9c764 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Pevec?= Date: Wed, 17 Oct 2018 01:56:39 +0200 Subject: Keymap: Personal keymap for planck (#4061) * added my keymap * Adde more changes * Moved to pevecyan folder * Added slovenian mapping * Slovenian keymap completed * Suggestions updates * Fixes on slovenian keymap Made some typos in previous iteration --- keyboards/planck/keymaps/pevecyan/config.h | 38 +++++ keyboards/planck/keymaps/pevecyan/keymap.c | 226 ++++++++++++++++++++++++++++ keyboards/planck/keymaps/pevecyan/readme.md | 2 + keyboards/planck/keymaps/pevecyan/rules.mk | 1 + 4 files changed, 267 insertions(+) create mode 100644 keyboards/planck/keymaps/pevecyan/config.h create mode 100644 keyboards/planck/keymaps/pevecyan/keymap.c create mode 100644 keyboards/planck/keymaps/pevecyan/readme.md create mode 100644 keyboards/planck/keymaps/pevecyan/rules.mk diff --git a/keyboards/planck/keymaps/pevecyan/config.h b/keyboards/planck/keymaps/pevecyan/config.h new file mode 100644 index 0000000000..e8c13caac5 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/config.h @@ -0,0 +1,38 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/pevecyan/keymap.c b/keyboards/planck/keymaps/pevecyan/keymap.c new file mode 100644 index 0000000000..7bc43a373c --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/keymap.c @@ -0,0 +1,226 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +#include "action_layer.h" +#include "muse.h" +#include "keymap_slovenian.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _ALTGR, + _CAPS +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define CAPS MO(_CAPS) +#define ALTGR MO(_ALTGR) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Z | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Y | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, SI_Q, SI_W, SI_E, SI_R, SI_T, SI_Z, SI_U, SI_I, SI_O, SI_P, KC_BSPC, + CAPS, SI_A, SI_S, SI_D, SI_F, SI_G, SI_H, SI_J, SI_K, SI_L, KC_SCLN, KC_ENT, + KC_LSFT, SI_Y, SI_X, SI_C, SI_V, SI_B, SI_N, SI_M, SI_COMM, SI_DOT, SI_MINS, KC_RSFT , + KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, ALTGR, KC_DOWN, KC_UP, KC_F5 +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_MINS, KC_PPLS , KC_ENT, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_ALTGR] = LAYOUT_planck_grid( + _______, ALTG(KC_Q), ALTG(KC_W), ALTG(KC_E), _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ALTG(KC_F), ALTG(KC_G), _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, ALTG(KC_V), ALTG(KC_B), ALTG(KC_N), _______, ALTG(KC_COMM), ALTG(KC_DOT), _______, _______ , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_CAPS] = LAYOUT_planck_grid( + KC_ESC , KC_BSPC, KC_UP , KC_DEL , _______, _______, _______, _______, _______, _______, _______, KC_DEL , + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE + float plover_song[][2] = SONG(PLOVER_SOUND); + float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); +#endif + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } +} + +void dip_update(uint8_t index, bool active) { + switch (index) { + case 0: + if (active) { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_song); + #endif + layer_on(_ADJUST); + } else { + #ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); + #endif + layer_off(_ADJUST); + } + break; + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif + } + } +} + +void matrix_scan_user(void) { + #ifdef AUDIO_ENABLE + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } + #endif +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} diff --git a/keyboards/planck/keymaps/pevecyan/readme.md b/keyboards/planck/keymaps/pevecyan/readme.md new file mode 100644 index 0000000000..de9680b498 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/readme.md @@ -0,0 +1,2 @@ +# The Default Planck Layout + diff --git a/keyboards/planck/keymaps/pevecyan/rules.mk b/keyboards/planck/keymaps/pevecyan/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/pevecyan/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From 9de4ace6f274c5bebfcfd8d31fa793f8d9060cb5 Mon Sep 17 00:00:00 2001 From: jshuf <44121348+jshuf@users.noreply.github.com> Date: Tue, 16 Oct 2018 20:13:53 -0400 Subject: Keyboard: Add tkl_ansi_plus_five layout for Phantom (#4145) * 60_ansi keymap for DZ60 * 60_ansi keymap for DZ60 Amend author * 60_ansi keymap for DZ60 * Merge new phantom layout from dev branch --- keyboards/phantom/info.json | 474 ++++++++++++++++++++++++++++++++++++++++++++ keyboards/phantom/phantom.h | 18 ++ 2 files changed, 492 insertions(+) diff --git a/keyboards/phantom/info.json b/keyboards/phantom/info.json index cf7b161803..6a1e4f72f5 100644 --- a/keyboards/phantom/info.json +++ b/keyboards/phantom/info.json @@ -459,6 +459,480 @@ } ] }, + "LAYOUT_tkl_ansi_plus_five": { + "key_count": 92, + "layout": [ + { + "label": "Esc", + "x": 0, + "y": 0 + }, + { + "label": "F1", + "x": 2, + "y": 0 + }, + { + "label": "F2", + "x": 3, + "y": 0 + }, + { + "label": "F3", + "x": 4, + "y": 0 + }, + { + "label": "F4", + "x": 5, + "y": 0 + }, + { + "label": "F5", + "x": 6.5, + "y": 0 + }, + { + "label": "F6", + "x": 7.5, + "y": 0 + }, + { + "label": "F7", + "x": 8.5, + "y": 0 + }, + { + "label": "F8", + "x": 9.5, + "y": 0 + }, + { + "label": "F9", + "x": 11, + "y": 0 + }, + { + "label": "F10", + "x": 12, + "y": 0 + }, + { + "label": "F11", + "x": 13, + "y": 0 + }, + { + "label": "F12", + "x": 14, + "y": 0 + }, + { + "label": "PrtSc", + "x": 15.25, + "y": 0 + }, + { + "label": "Scroll Lock", + "x": 16.25, + "y": 0 + }, + { + "label": "Pause", + "x": 17.25, + "y": 0 + }, + { + "label": "~", + "x": 0, + "y": 1.5 + }, + { + "label": "!", + "x": 1, + "y": 1.5 + }, + { + "label": "@", + "x": 2, + "y": 1.5 + }, + { + "label": "#", + "x": 3, + "y": 1.5 + }, + { + "label": "$", + "x": 4, + "y": 1.5 + }, + { + "label": "%", + "x": 5, + "y": 1.5 + }, + { + "label": "^", + "x": 6, + "y": 1.5 + }, + { + "label": "&", + "x": 7, + "y": 1.5 + }, + { + "label": "*", + "x": 8, + "y": 1.5 + }, + { + "label": "(", + "x": 9, + "y": 1.5 + }, + { + "label": ")", + "x": 10, + "y": 1.5 + }, + { + "label": "_", + "x": 11, + "y": 1.5 + }, + { + "label": "+", + "x": 12, + "y": 1.5 + }, + { + "label": "Backspace", + "x": 13, + "y": 1.5, + "w": 2 + }, + { + "label": "Insert", + "x": 15.25, + "y": 1.5 + }, + { + "label": "Home", + "x": 16.25, + "y": 1.5 + }, + { + "label": "PgUp", + "x": 17.25, + "y": 1.5 + }, + { + "label": "Tab", + "x": 0, + "y": 2.5, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 2.5 + }, + { + "label": "W", + "x": 2.5, + "y": 2.5 + }, + { + "label": "E", + "x": 3.5, + "y": 2.5 + }, + { + "label": "R", + "x": 4.5, + "y": 2.5 + }, + { + "label": "T", + "x": 5.5, + "y": 2.5 + }, + { + "label": "Y", + "x": 6.5, + "y": 2.5 + }, + { + "label": "U", + "x": 7.5, + "y": 2.5 + }, + { + "label": "I", + "x": 8.5, + "y": 2.5 + }, + { + "label": "O", + "x": 9.5, + "y": 2.5 + }, + { + "label": "P", + "x": 10.5, + "y": 2.5 + }, + { + "label": "{", + "x": 11.5, + "y": 2.5 + }, + { + "label": "}", + "x": 12.5, + "y": 2.5 + }, + { + "label": "|", + "x": 13.5, + "y": 2.5, + "w": 1.5 + }, + { + "label": "Delete", + "x": 15.25, + "y": 2.5 + }, + { + "label": "End", + "x": 16.25, + "y": 2.5 + }, + { + "label": "PgDn", + "x": 17.25, + "y": 2.5 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 3.5, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 3.5 + }, + { + "label": "S", + "x": 2.75, + "y": 3.5 + }, + { + "label": "D", + "x": 3.75, + "y": 3.5 + }, + { + "label": "F", + "x": 4.75, + "y": 3.5 + }, + { + "label": "G", + "x": 5.75, + "y": 3.5 + }, + { + "label": "H", + "x": 6.75, + "y": 3.5 + }, + { + "label": "J", + "x": 7.75, + "y": 3.5 + }, + { + "label": "K", + "x": 8.75, + "y": 3.5 + }, + { + "label": "L", + "x": 9.75, + "y": 3.5 + }, + { + "label": ":", + "x": 10.75, + "y": 3.5 + }, + { + "label": "\"", + "x": 11.75, + "y": 3.5 + }, + { + "label": "Enter", + "x": 12.75, + "y": 3.5, + "w": 2.25 + }, + { + "x": 15.25, + "y": 3.5 + }, + { + "x": 16.25, + "y": 3.5 + }, + { + "x": 17.25, + "y": 3.5 + }, + { + "label": "Shift", + "x": 0, + "y": 4.5, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 4.5 + }, + { + "label": "X", + "x": 3.25, + "y": 4.5 + }, + { + "label": "C", + "x": 4.25, + "y": 4.5 + }, + { + "label": "V", + "x": 5.25, + "y": 4.5 + }, + { + "label": "B", + "x": 6.25, + "y": 4.5 + }, + { + "label": "N", + "x": 7.25, + "y": 4.5 + }, + { + "label": "M", + "x": 8.25, + "y": 4.5 + }, + { + "label": "<", + "x": 9.25, + "y": 4.5 + }, + { + "label": ">", + "x": 10.25, + "y": 4.5 + }, + { + "label": "?", + "x": 11.25, + "y": 4.5 + }, + { + "label": "Shift", + "x": 12.25, + "y": 4.5, + "w": 2.75 + }, + { + "x": 15.25, + "y": 4.5 + }, + { + "label": "\\u2191", + "x": 16.25, + "y": 4.5 + }, + { + "x": 17.25, + "y": 4.5 + }, + { + "label": "Ctrl", + "x": 0, + "y": 5.5, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 5.5, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 5.5, + "w": 1.25 + }, + { + "x": 3.75, + "y": 5.5, + "w": 6.25 + }, + { + "label": "Alt", + "x": 10, + "y": 5.5, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 5.5, + "w": 1.25 + }, + { + "label": "FN", + "x": 12.5, + "y": 5.5, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.75, + "y": 5.5, + "w": 1.25 + }, + { + "label": "\\u2190", + "x": 15.25, + "y": 5.5 + }, + { + "label": "\\u2193", + "x": 16.25, + "y": 5.5 + }, + { + "label": "\\u2192", + "x": 17.25, + "y": 5.5 + } + ] + }, "LAYOUT_tkl_ansi_wkl": { "key_count": 86, "layout": [ diff --git a/keyboards/phantom/phantom.h b/keyboards/phantom/phantom.h index bed840f191..fa77634d3c 100644 --- a/keyboards/phantom/phantom.h +++ b/keyboards/phantom/phantom.h @@ -54,6 +54,24 @@ K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ ) +// Keymap for a standard ANSI layout plus the five extra keys +// above the arrow block. +#define LAYOUT_tkl_ansi_plus_five( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, K3G, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4D, K4E, K4F, K4G, \ + K50, K51, K52, K57, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) LAYOUT_7bit( \ + K00, KC_NO, K02, K03, K04, K05, KC_NO, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F, K3G, \ + K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, KC_NO, K4D, K4E, K4F, K4G, \ + K50, K51, K52, KC_NO, KC_NO, K57, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) + #define LAYOUT_tkl_ansi_wkl( \ K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ -- cgit v1.2.3 From 397d404ce0b2a0730e493897f72a86f7a40f4207 Mon Sep 17 00:00:00 2001 From: Bramver Date: Wed, 17 Oct 2018 22:42:26 +0200 Subject: Keymap: Added personal Quefrency layout (#4156) --- keyboards/quefrency/keymaps/bramver/README.md | 61 ++++++++++++ keyboards/quefrency/keymaps/bramver/config.h | 31 ++++++ keyboards/quefrency/keymaps/bramver/keymap.c | 134 ++++++++++++++++++++++++++ keyboards/quefrency/keymaps/bramver/rules.mk | 6 ++ 4 files changed, 232 insertions(+) create mode 100644 keyboards/quefrency/keymaps/bramver/README.md create mode 100644 keyboards/quefrency/keymaps/bramver/config.h create mode 100644 keyboards/quefrency/keymaps/bramver/keymap.c create mode 100644 keyboards/quefrency/keymaps/bramver/rules.mk diff --git a/keyboards/quefrency/keymaps/bramver/README.md b/keyboards/quefrency/keymaps/bramver/README.md new file mode 100644 index 0000000000..76310ed73a --- /dev/null +++ b/keyboards/quefrency/keymaps/bramver/README.md @@ -0,0 +1,61 @@ +# Quefrency Layout - initial 60% + +Standard qwerty layout. +Limited emoji support and proper mouse settings. + +Mostly based off of my other XD75 and Nyquist layouts. + +## Keymap + +``` +/* BASE + * + * KC_GESC , 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_DEL , KC_BSPC , \ + * 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 , \ + * MO_EMOJ , 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_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_LALT , KC_LGUI , MO_SYMB , SP_LMS , /**/ SP_RMS , KC_BSPC , KC_RGUI , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + * + */ + +/* LMSE + * + * _______ , _______ , _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ ,\ + * _______ , _______ , KC_PGDN , KC_PGUP , KC_END , KC_HOME , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ + * + */ + +/* RMSE + * + * _______ , _______ , _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , _______ , /**/ KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , _______ , /**/ KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ , _______ ,\ + * _______ , _______ , _______ , _______ , _______ , _______ , /**/ KC_HOME , KC_END , KC_PGUP , KC_PGDN , _______ , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ + * + */ + +/* SYMB + * + * KC_GESC , KC_F1 , KC_F12 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , /**/ KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , KC_BSPC , \ + * _______ , _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , /**/ KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , _______ ,\ + * _______ , _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ + * + */ + +/* EMOJ + * + * _______ , _______ , _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + * _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , /**/ X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , _______ , _______ , \ + * _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , /**/ X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ , _______ ,\ + * _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , /**/ X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , _______ , \ + * _______ , _______ , _______ , _______ , _______ , /**/ _______ , _______ , _______ , _______ , _______ , _______ , _______ + * + */ + +``` \ No newline at end of file diff --git a/keyboards/quefrency/keymaps/bramver/config.h b/keyboards/quefrency/keymaps/bramver/config.h new file mode 100644 index 0000000000..c908386e28 --- /dev/null +++ b/keyboards/quefrency/keymaps/bramver/config.h @@ -0,0 +1,31 @@ +/* Copyright 2018 darm + * + * 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 + +#define USE_SERIAL +#define MASTER_LEFT + +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/quefrency/keymaps/bramver/keymap.c b/keyboards/quefrency/keymaps/bramver/keymap.c new file mode 100644 index 0000000000..527f5de047 --- /dev/null +++ b/keyboards/quefrency/keymaps/bramver/keymap.c @@ -0,0 +1,134 @@ +#include QMK_KEYBOARD_H + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define _BASE 0 +#define _LMSE 1 +#define _RMSE 2 +#define _SYMB 3 +#define _EMOJ 4 + +#define SP_LMS LT(_LMSE, KC_SPC) +#define SP_RMS LT(_RMSE, KC_SPC) +#define MO_SYMB TT(_SYMB) +#define MO_EMOJ TT(_EMOJ) + + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare + SOS, // Vuile sos + REDB, // Red B + HNDR, // 100 + MONY, + FIRE, + CAR, + BUTT, + BNIS, + CUM, + CLAP, + TRIU, // Fart from nose + SCRM, + VOMI, + DTIV, // Detective + EXPL, // Brainsplosion + HAIR, // Haircut + DANC, // Salsa dancer + STRN, // Stronk + LEFT, // Point Left + RGHT, // Point Right +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, + [SOS] = 0x1F198, + [REDB] = 0x1F171, + [HNDR] = 0x1F4AF, + [MONY] = 0x1F480, + [FIRE] = 0x1F525, + [CAR] = 0x1F697, + [BUTT] = 0x1F351, + [BNIS] = 0x1F346, + [CUM] = 0x1F4A6, + [CLAP] = 0x1F44F, + [TRIU] = 0x1F624, + [SCRM] = 0x1F631, + [VOMI] = 0x1F92E, + [DTIV] = 0x1F575, + [EXPL] = 0x1F92F, + [HAIR] = 0x2640, + [DANC] = 0x1F483, + [STRN] = 0x1F4AA, + [LEFT] = 0x1F448, + [RGHT] = 0x1F449, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT( + KC_GESC , 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_DEL , KC_BSPC , \ + 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 , \ + MO_EMOJ , 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_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_LALT , KC_LGUI , MO_SYMB , SP_LMS , SP_RMS , KC_BSPC , KC_RGUI , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT + ), + + [_LMSE] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , _______ , _______ , _______ , _______ , _______ , _______ , _______ ,\ + _______ , _______ , KC_PGDN , KC_PGUP , KC_END , KC_HOME , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_RMSE] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ , _______ ,\ + _______ , _______ , _______ , _______ , _______ , _______ , KC_HOME , KC_END , KC_PGUP , KC_PGDN , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_SYMB] = LAYOUT( + KC_GESC , KC_F1 , KC_F12 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , KC_DEL , KC_BSPC , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , KC_LPRN , KC_RPRN , _______ , _______ ,\ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_EMOJ] = LAYOUT( + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , \ + _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , _______ , _______ , \ + _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ , _______ ,\ + _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , _______ , \ + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; diff --git a/keyboards/quefrency/keymaps/bramver/rules.mk b/keyboards/quefrency/keymaps/bramver/rules.mk new file mode 100644 index 0000000000..d211d7b4cf --- /dev/null +++ b/keyboards/quefrency/keymaps/bramver/rules.mk @@ -0,0 +1,6 @@ +# Build options +MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses +EXTRAKEY_ENABLE = yes # Use system and audio control key codes +TAP_DANCE_ENABLE = no # Use multi-tap features +UNICODEMAP_ENABLE = yes # Emojify me pls +NKRO_ENABLE = yes -- cgit v1.2.3 From d08f9cb6e4d5f14409d49ea5df93cb91777357da Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Wed, 17 Oct 2018 21:54:37 +0300 Subject: Fix grammar, typos, and the link to HID specification --- docs/how_keyboards_work.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/how_keyboards_work.md b/docs/how_keyboards_work.md index fac2b5a489..cc54e566a1 100644 --- a/docs/how_keyboards_work.md +++ b/docs/how_keyboards_work.md @@ -27,17 +27,17 @@ This usually happens with a periodic scan of key presses. This speed often is li ## 2. What the Firmware Sends -The [HID specification](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard. +The [HID specification](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) tells what a keyboard can actually send through USB to have a chance to be properly recognised. This includes a pre-defined list of scancodes which are simple numbers from `0x00` to `0xE7`. The firmware assigns a scancode to each key of the keyboard. -The firmware does not send actually letters or characters, but only scancodes. -Thus, by modifying the firmware, you only can modify what scancode is sent over +The firmware does not send actual letters or characters, but only scancodes. +Thus, by modifying the firmware, you can only modify what scancode is sent over USB for a given key. ## 3. What the Operating System Does Once the keycode reaches the operating system, a piece of software has to have it match an actual character thanks to a keyboard layout. For example, if your -layout is set to QWERTY, a sample of the matching table is as follow: +layout is set to QWERTY, a sample of the matching table is as follows: | keycode | character | |---------|-----------| @@ -55,11 +55,11 @@ As the layout is generally fixed (unless you create your own), the firmware can ## List of Characters You Can Send -Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key only is the ones present in the layout**. +Putting aside shortcuts, having a limited set of keycodes mapped to a limited layout means that **the list of characters you can assign to a given key are only the ones present in the layout**. -For example, this means that if you have a QWERTY US layout, and you want to assign 1 key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International. +For example, this means that if you have a QWERTY US layout, and you want to assign one key to produce `€` (euro currency symbol), you are unable to do so, because the QWERTY US layout does not have such mapping. You could fix that by using a QWERTY UK layout, or a QWERTY US International. -You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycode available through USB simply disallow such a thing. +You may wonder why a keyboard layout containing all of Unicode is not devised then? The limited number of keycodes available through USB simply disallows such a thing. ## How to (Maybe) Enter Unicode Characters -- cgit v1.2.3 From dad79cafcd9b3401b68fb29aaa311e999c4c4e6e Mon Sep 17 00:00:00 2001 From: Christoffer Holmberg Date: Wed, 17 Oct 2018 23:27:16 +0300 Subject: Fix more broken links to the HID spec --- docs/keycodes_basic.md | 2 +- docs/reference_glossary.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 8445b05ef3..82e94aa5e9 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -1,6 +1,6 @@ # Basic Keycodes -The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details. +The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07)](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) with the exception of `KC_NO`, `KC_TRNS` and keycodes in the `0xA5-DF` range. See below for more details. ## Letters and Numbers diff --git a/docs/reference_glossary.md b/docs/reference_glossary.md index 29d07f26d3..422abb2ece 100644 --- a/docs/reference_glossary.md +++ b/docs/reference_glossary.md @@ -128,7 +128,7 @@ The standard Deutsche (German) keyboard layout. Named for the first 6 letters on The term for pressing a key while a key is already held down. Variants include 2KRO, 6KRO, and NKRO. ## Scancode -A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](http://www.usb.org/developers/hidpage/Hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/). +A 1 byte number that is sent as part of a HID report over USB that represents a single key. These numbers are documented in the [HID Usage Tables](https://www.usb.org/sites/default/files/documents/hut1_12v2.pdf) published by the [USB-IF](http://www.usb.org/). ## Space Cadet Shift A special set of shift keys which allow you to type various types of braces by tapping the left or right shift one or more times. -- cgit v1.2.3 From 4a7baaaf50bc9cce3886ff7e1b6455e028d92ab9 Mon Sep 17 00:00:00 2001 From: TheOneTrueTrench <38593283+TheOneTrueTrench@users.noreply.github.com> Date: Thu, 18 Oct 2018 00:38:24 -0400 Subject: Keymap: Adding new functionality to personal keymap, smart macros (#4159) * Added base keymap * Added initial layers and mirrored most of Pok3r behavior. * Some stuff for Space Captain * Added new Marianas keymap for DZ60 * Included suggestions to remove unnecessary line regarding MODS_CTRL_MASK, and added names for layers. Added enum to define names for layers, and removed unused #DEFINE * Added DVORAK and COLEMAK * Caps + enter + space for flashing mode. * Added RGB status * added flash script * Changed lighting modes to make layers more apparent * fixed issue with not being able to exit gaming mode. * Added abbreviation constructor * Changed lighting modes to make layers more apparent * fixed issue with not being able to exit gaming mode. * Added abbreviation constructor * Fixed bug with SQL Table Macro generator. * restructured file. No Logical changes. * literals only for smart macros * removed extraneous pointer declaration. * Smart Macros * Added Makefile and header file * extended smart macros to be able to cover the whole alphas. * removed non-relavent keymaps. * didn't mean to include this guy. --- keyboards/dz60/keymaps/marianas/keymap.c | 592 ++++++++++++++++++++++++++++--- keyboards/dz60/keymaps/marianas/keymap.h | 103 ++++++ keyboards/dz60/keymaps/marianas/rules.mk | 17 + 3 files changed, 657 insertions(+), 55 deletions(-) create mode 100644 keyboards/dz60/keymaps/marianas/keymap.h create mode 100644 keyboards/dz60/keymaps/marianas/rules.mk diff --git a/keyboards/dz60/keymaps/marianas/keymap.c b/keyboards/dz60/keymaps/marianas/keymap.c index dfc83fb508..e40bc6897b 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.c +++ b/keyboards/dz60/keymaps/marianas/keymap.c @@ -1,71 +1,553 @@ #include QMK_KEYBOARD_H +#include "keymap.h" enum marianas_layers { - BASE, + QWERTY, +/* + COLEMAK, + DVORAK, +*/ NAV_CLUSTER, - RGB, - MOUSE, GAMING, - FN_LAYER, - LAYER_SEL + SQLMACROS, + SQLNAMES, + FN_LAYER +}; + +enum sql_macros { + S_LFTJN = SAFE_RANGE, // L + S_INRJN, // I + S_SLCT, // S + S_FROM, // F + S_DSNCT, // D + S_ORDER, // O + S_WHERE, // W + S_ALTER, // Esc + S_ASTRK, // * + + TD_A, + TD_B, + TD_C, // Corp, Corporation, Company + TD_D, // Distribution, Dist, Distributor + TD_E, + TD_F, + TD_G, // GlobalLookup + TD_H, + TD_I, // Instance, Item + TD_J, + TD_K, + TD_L, + TD_M, + TD_N, // NadRate + TD_O, + TD_P, // Product, Person, + TD_Q, // Darden + TD_R, + TD_S, // Supplier, Step + TD_T, // Task, Type + TD_U, + TD_V, + TD_W, // Workflow, + TD_X, + TD_Y, + TD_Z, + TD_BSPC, + TD_ENT, + TD_ESC +}; + +uint16_t *macroTaps = 0; + +char *tableNameList = 0; + +uint8_t *charCount = 0; +uint8_t countPointer = 0; + +bool shifted = false; + +bool sendAbbr = false; + + +void initStringData(void) +{ + if (macroTaps == 0) + { + macroTaps = malloc(macroTapsLen*sizeof(uint16_t)); + for(int i = 0; i < macroTapsLen; i++) + { + macroTaps[i] = 0; + } + } + if (tableNameList == 0) + { + tableNameList = malloc(tableNameListLen*sizeof(char)); + for(int i = 0; i < tableNameListLen; i++) + { + tableNameList[i] = 0; + } + } + if (charCount == 0) + { + charCount = malloc(charCountLen*sizeof(uint8_t)); + for (int i = 0; i < charCountLen; i++) + { + charCount[i] = 0; + } + } +} + + +uint32_t layer_state_set_user(uint32_t state) +{ + switch (biton32(state)) + { + case QWERTY: + rgblight_mode(9); + break; + case NAV_CLUSTER: + rgblight_mode(29); + break; + case GAMING: + rgblight_mode(26); + break; + case SQLMACROS: + rgblight_mode(1); + rgblight_setrgb(0x00, 0xFF, 0x80); + break; + case SQLNAMES: + rgblight_mode(1); + rgblight_setrgb(0x80, 0xFF, 0x00); + break; + case FN_LAYER: + rgblight_mode(1); + rgblight_setrgb(0x00, 0x80, 0xFF); + break; + } + return state; +} + +bool containsCode(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc) return true; + } + return false; +} + +bool lastCodeIs(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true; + } + return false; +} + +bool last2CodeAre(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true; + } + return false; +} + +bool last2CodesAre(uint16_t kc, uint16_t kc2) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true; + } + return false; +} + +void addKeyCode(uint16_t kc) +{ + int i = 0; + while (i < macroTapsLen-2 && macroTaps[i] > 0) i++; + if (macroTaps[i] == 0) + { + macroTaps[i] = kc; + macroTaps[i+1] = 0; + } +} + +void eraseKeyCodes(void) +{ + int i = 0; + while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0; +} + +void eraseCharCounts(void) +{ + int i = 0; + while (i < charCountLen) + { + charCount[i] = 0; + } +} + +void printTableAbbreviation(void) +{ + initStringData(); + if (tableNameList[0] == 0) + { + return; + } + send_char(0x20); + int i = 0; + for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + if (tableNameList[i] >= 65 && tableNameList[i] <= 90) + { + send_char(tableNameList[i]+32); + } + else + { + send_char(tableNameList[i]); + } + } + send_char(0x20); +} + +void eraseTableAbbreviation(void) +{ + initStringData(); + for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + tableNameList[i] = '\0'; + } +} + +void printString(char* str) +{ + + if (str[0] != '\0') + { + int i = 0; + while (true) + { + if (str[i] == 0) + { + break; + } + send_char(str[i++]); + charCount[countPointer]++; + } + } +} + +void printStringAndQueueChar(char* str) +{ + initStringData(); + if (charCount[countPointer] != 0) + { + countPointer++; + } + sendAbbr = true; + if (str[0] != '\0') + { + printString(str); + + for (int i = 0; i < tableNameListLen-1; i++) + { + if (tableNameList[i] == '\0') + { + tableNameList[i] = str[0]; + tableNameList[i+1] = '\0'; + break; + } + else if (i == tableNameListLen-2) + { + printTableAbbreviation(); + break; + } + } + //for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + //{ + // send_char(tableNameList[i]); + //} + //send_string_P("Darden"); + //send_string_P(&myarray); + //send_string_P(str); + } +} + +void ReplaceString(char *orig, char *repl) +{ + int i = 0; + while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i]) + i++; + + if(orig[i] != 0x0) + { + int o = i; + while (orig[o++] != 0x0) { + charCount[countPointer]--; + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + } + printString(repl+i); +} + +void deletePrev(void) +{ + for (int i = 0; i < charCount[countPointer]; i++) + { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + charCount[countPointer] = 0; + countPointer--; + int i = 1; + for (;i < tableNameListLen-1; i++) + { + if (tableNameList[i] == 0x0) + { + break; + } + } + tableNameList[i-1] = 0x0; +} + +void processSmartMacroTap(uint16_t kc) +{ + initStringData(); + switch(kc) + { + case TD_C: + if (containsCode(TD_D)) + { + printString("ribution"); + printStringAndQueueChar("Center"); + } + else if (last2CodeAre(TD_C)) + { + ReplaceString("Corporation", "Contact"); + } + else if(lastCodeIs(TD_C)) + { + printString("oration"); + } + else + { + printStringAndQueueChar("Corp"); + } + break; + case TD_D: + if (last2CodeAre(TD_D)) + { + ReplaceString("Distribution", "Distributor"); + } + else if(lastCodeIs(TD_D)) + { + printString("ribution"); + } + else + { + printStringAndQueueChar("Dist"); + } + break; + case TD_G: + printStringAndQueueChar("Global"); + printStringAndQueueChar("Lookup"); + break; + case TD_I: + if (containsCode(TD_W)) + printStringAndQueueChar("Instance"); + else + printStringAndQueueChar("Item"); + break; + case TD_N: + printStringAndQueueChar("NadRate"); + break; + case TD_P: + if (last2CodesAre(TD_D, TD_C)) + { + ReplaceString("DistributionCenter", "DistCenter"); + printStringAndQueueChar("Pricing"); + } + else if (last2CodeAre(TD_P)) + { + } + else if(lastCodeIs(TD_P)) + { + ReplaceString("Product", "Person"); + } + else + { + printStringAndQueueChar("Product"); + } + break; + case TD_Q: + printStringAndQueueChar("Darden"); + break; + case TD_S: + if (containsCode(TD_W)) + if (containsCode(TD_S) || containsCode(TD_D)) + printStringAndQueueChar("Step"); + else + printStringAndQueueChar("Session"); + else + printStringAndQueueChar("Supplier"); + break; + case TD_T: + if (containsCode(TD_W)) + printStringAndQueueChar("Task"); + else + printStringAndQueueChar("Type"); + break; + case TD_W: + printStringAndQueueChar("Workflow"); + break; + } + addKeyCode(kc); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + if (record->event.pressed) + { + switch (keycode) + { + case KC_LSPO: + case KC_RSPC: + shifted = true; + return true; + + case S_LFTJN: SEND_STRING("LEFT JOIN"); return false; + case S_INRJN: SEND_STRING("INNER JOIN "); return false; + case S_SLCT: SEND_STRING("SELECT "); return false; + case S_FROM: SEND_STRING("FROM "); return false; + case S_DSNCT: SEND_STRING("DISTINCT "); return false; + case S_ORDER: SEND_STRING("ORDER "); return false; + case S_WHERE: SEND_STRING("WHERE "); return false; + case S_ALTER: SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = "); return false; + case S_ASTRK: SEND_STRING("* "); return false; + + case KC_BSLS: + initStringData(); + layer_on(SQLNAMES); + return false; + + case TD_BSPC: + if (!shifted){ + deletePrev(); + } + else { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + return false; + + case TD_A: + case TD_B: + case TD_C: + case TD_D: + case TD_E: + case TD_F: + case TD_G: + case TD_H: + case TD_I: + case TD_J: + case TD_K: + case TD_L: + case TD_M: + case TD_N: + case TD_O: + case TD_P: + case TD_Q: + case TD_R: + case TD_S: + case TD_T: + case TD_U: + case TD_V: + case TD_W: + case TD_X: + case TD_Y: + case TD_Z: + processSmartMacroTap(keycode); + return false; + + case TD_ENT: + printTableAbbreviation(); + case TD_ESC: + eraseKeyCodes(); + eraseTableAbbreviation(); + layer_off(SQLNAMES); + return true; + } + } + else + { + switch (keycode) + { + + case KC_BSLS: + if (macroTaps[0] == 0) + { + SEND_STRING("\\"); + layer_off(SQLNAMES); + } + return true; + case KC_LSPO: + case KC_RSPC: + shifted = false; + return true; + } + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE]= - LAYOUT( - KC_ESC, 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_NO, KC_BSPC, - 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, - MO(FN_LAYER), 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_LSPO, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_NO, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_LGUI, KC_NO, KC_APP, KC_RCTL), + [QWERTY]= + LAYOUT_60_ansi( + ESCAP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MNUS, EQUL, BACKSPC, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LBRC, RBRC, BSLASH, + MO_FNLR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL, + LEFTSHFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CMMA, PRRD, SLSH, RIGHT_SHIFT__PAREN, + CTLL, WINL, ALTL, SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE, ALTR, WINR, APPR, CTLR), [NAV_CLUSTER]= - LAYOUT( - KC_TRNS, KC_PSCREEN, KC_SCROLLLOCK, KC_PAUSE, KC_INSERT, KC_HOME, KC_PGUP, KC_NUMLOCK, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_PLUS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_UP, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_PLUS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_ENTER, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_KP_0, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_KP_ENTER, KC_TRNS, KC_TRNS, KC_TRNS), - - [RGB]= - LAYOUT( - KC_TRNS, RGB_TOG, RGB_MOD, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, RGB_SPD, RGB_SPI, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_HUI, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - [MOUSE]= - LAYOUT( - KC_TRNS, KC_ACL0, KC_ACL1, KC_ACL2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN3, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_WH_L, KC_WH_D, KC_WH_R, KC_TRNS, KC_TRNS, KC_BTN4, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN5, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + LAYOUT_60_ansi( + _____, PSCR, SCRL, PAUS, NSRT, HOME, PGUP, NMLK, KSSH, STAR, KMIN, ____, ____, ______, + ______, ____, ____, ____, DELT, END_, PGDN, KP_7, KP_8, KP_9, PLUS, ____, ____, _____, + _______, ____, ____, ____, ____, UPUP, UPUP, KP_4, KP_5, KP_6, PLUS, ____, ___________, + ________, ____, ____, ____, LEFT, D_WN, RGHT, KP_1, KP_2, KP_3, KNTR, _________________, + ____, ____, ____, /*-----------------*/KC_KP_0/*-----------------*/, KDOT, KNTR, ____, ____), [GAMING]= - LAYOUT( - KC_ESC, 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_NO, KC_BSPC, - 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_TRNS, 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_LSHIFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, KC_NO, - KC_LCTL, KC_NO, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_NO, KC_NO, TO(BASE)), + LAYOUT_60_ansi( + _____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ______, + ______, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _____, + KCNO, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ___________, + ________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________, + ____, KCNO, ____, /*------------------*/_____/*------------------*/, ____, KCNO, ____, QWRTY), - [FN_LAYER]= - LAYOUT( - KC_GRV, 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_TRNS, KC_DEL, - KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), KC_TRNS, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, KC_TRNS, - KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, MO(LAYER_SEL), - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HYPR, KC_TRNS, KC_MEH, KC_TRNS), - - [LAYER_SEL]= - LAYOUT( - TO(BASE), TO(NAV_CLUSTER), TO(RGB), TO(MOUSE), TO(GAMING), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) + [SQLMACROS]= + LAYOUT_60_ansi( + S_ALTER, ____, ____, ____, ____, ____, ____, ____, S_ASTRK, ____, ____, ____, ____, ___________, + ______, ____, S_WHERE, ____, ____, ____, ____, ____, S_INRJN, S_ORDER, ____, ____, ____, ______, + _______, KC_LBRC, S_SLCT, KC_PAST,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________, + ________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________, + ____, ____, ____, /*------------------*/_____/*------------------*/, ____, ____, ____, ____), + [SQLNAMES]= + LAYOUT_60_ansi( + TD_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, TD_BSPC, + ________, TD_Q, TD_W, TD_E, TD_R, TD_T, TD_Y, TD_U, TD_I, TD_O, TD_P, ____, ____, _____, + ___________, TD_A, TD_S, TD_D, TD_F, TD_G, TD_H, TD_J, TD_K, TD_L, ____, ____, TD_ENT, + ___________, TD_Z, TD_X, TD_C, TD_V, TD_B, TD_N, TD_M, ____, ____, ____, _________________, + ____, ____, ____, /*----------------------*/TD_ENT/*-----------------------*/, ____, ____, ____, RESET), + + [FN_LAYER]= + LAYOUT_60_ansi( + KC_GRV, 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_DEL, + KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), ____, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, ____, + ____, KC_VOLD, KC_MUTE, KC_VOLU, ____, ____, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, ____, + ____, ____, ____, ____, ____, ____, KC_END, ____, QWRTY, NAVS, GAME, ____, + ____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, ____) }; diff --git a/keyboards/dz60/keymaps/marianas/keymap.h b/keyboards/dz60/keymaps/marianas/keymap.h new file mode 100644 index 0000000000..01de5c6e2c --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/keymap.h @@ -0,0 +1,103 @@ +//Control +#define MO_FNLR MO(FN_LAYER) +#define BACKSPC KC_BSPC +#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT) +#define ESCAP KC_ESC +#define PSCR KC_PSCREEN +#define SCRL KC_SCROLLLOCK +#define PAUS KC_PAUSE +#define NSRT KC_INSERT +#define HOME KC_HOME +#define PGUP KC_PGUP +#define PGDN KC_PGDN +#define END_ KC_END +#define DELT KC_DELETE +#define UPUP KC_UP +#define D_WN KC_DOWN +#define LEFT KC_LEFT +#define RGHT KC_RIGHT + +//KEYPAD +#define KP_1 KC_KP_1 +#define KP_2 KC_KP_2 +#define KP_3 KC_KP_3 +#define KP_4 KC_KP_4 +#define KP_5 KC_KP_5 +#define KP_6 KC_KP_6 +#define KP_7 KC_KP_7 +#define KP_8 KC_KP_8 +#define KP_9 KC_KP_9 +#define KP_0 KC_KP_0 +#define NMLK KC_NUMLOCK +#define STAR KC_KP_ASTERISK +#define KSSH KC_KP_SLASH +#define KMIN KC_KP_MINUS +#define PLUS KC_KP_PLUS +#define KNTR KC_KP_ENTER +#define KDOT KC_KP_DOT + +//Modifiers +#define CTLL KC_LCTL +#define LEFTSHFT KC_LSPO +#define WINL KC_LGUI +#define ALTL KC_LALT +#define CTLR KC_RCTL +#define RIGHT_SHIFT__PAREN KC_RSPC +#define WINR KC_RGUI +#define ALTR KC_RALT +#define APPR KC_APP + + +//Punctuation +#define CMMA KC_COMM +#define PRRD KC_DOT +#define SLSH KC_SLSH +#define QUOT KC_QUOT +#define COLN KC_SCLN +#define LBRC KC_LBRC +#define RBRC KC_RBRC +#define EQUL KC_EQL +#define MNUS KC_MINS +#define BSLASH KC_BSLS + +//Layers +#define QWRTY TO(QWERTY) +#define NAVS TO(NAV_CLUSTER) +#define GAME TO(GAMING) + +//Space +#define ____ KC_TRNS +#define _____ KC_TRNS +#define ______ KC_TRNS +#define _______ KC_TRNS +#define ________ KC_TRNS +#define ___________ KC_TRNS +#define _________________ KC_TRNS +#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC +#define KCNO KC_NO + + + + + +#define macroTapsLen 32 +#define tableNameListLen 32 +#define charCountLen 32 + +void initStringData(void); +uint32_t layer_state_set_user(uint32_t state); +bool containsCode(uint16_t kc); +bool lastCodeIs(uint16_t kc); +bool last2CodeAre(uint16_t kc); +bool last2CodesAre(uint16_t kc, uint16_t kc2); +void addKeyCode(uint16_t kc); +void eraseKeyCodes(void); +void eraseCharCounts(void); +void printTableAbbreviation(void); +void eraseTableAbbreviation(void); +void printString(char* str); +void printStringAndQueueChar(char* str); +void ReplaceString(char *orig, char *repl); +void deletePrev(void); +void processSmartMacroTap(uint16_t kc); +bool process_record_user(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/rules.mk b/keyboards/dz60/keymaps/marianas/rules.mk new file mode 100644 index 0000000000..ab188f3b2c --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/rules.mk @@ -0,0 +1,17 @@ +# Build Options +# comment out to disable the options. +# + + +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = no +AUTO_SHIFT_ENABLE = no -- cgit v1.2.3 From f45bc9b362363f6f3f848026eefad7d7a1842c2c Mon Sep 17 00:00:00 2001 From: mwpeterson Date: Thu, 18 Oct 2018 16:00:30 -0400 Subject: Keymap: Add Planck keymap (#4154) * remove clmk and dvrk and backlight; switch esc and enter to be modtap; add meh key * change songs * space cadet; move enter; move '"; move pgup pgdn * remove extra songs * update from noahfredrick keymap * make it easier to type ../../thing/*/* * move pipe * requested changes --- keyboards/planck/keymaps/mwpeterson/config.h | 40 ++++ keyboards/planck/keymaps/mwpeterson/keymap.c | 295 +++++++++++++++++++++++++++ keyboards/planck/keymaps/mwpeterson/rules.mk | 6 + 3 files changed, 341 insertions(+) create mode 100644 keyboards/planck/keymaps/mwpeterson/config.h create mode 100644 keyboards/planck/keymaps/mwpeterson/keymap.c create mode 100644 keyboards/planck/keymaps/mwpeterson/rules.mk diff --git a/keyboards/planck/keymaps/mwpeterson/config.h b/keyboards/planck/keymaps/mwpeterson/config.h new file mode 100644 index 0000000000..d66557b29d --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/config.h @@ -0,0 +1,40 @@ +#pragma once + +#define PERMISSIVE_HOLD +#define IGNORE_MOD_TAP_INTERRUPT + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(ONE_UP_SOUND) + // #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + #define GOODBYE_SONG SONG(COIN_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND) } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 diff --git a/keyboards/planck/keymaps/mwpeterson/keymap.c b/keyboards/planck/keymaps/mwpeterson/keymap.c new file mode 100644 index 0000000000..bfb015c7a8 --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/keymap.c @@ -0,0 +1,295 @@ +// from event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(plover_song); +#endif + layer_off(RAISE_LAYER); + layer_off(LOWER_LAYER); + layer_off(ADJUST_LAYER); + layer_on(STENO_LAYER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + plover_resume(); + } + return false; + case PV_EXIT: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(plover_gb_song); +#endif + plover_suspend(); + layer_off(STENO_LAYER); + } + return false; + case PV_LOOK: + if (record->event.pressed) { + plover_lookup(); + } + return false; + case SEND_VERSION: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION " (" QMK_BUILDDATE ")"); + } + return false; + case SEND_MAKE: + if (record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP ":dfu\n"); + } + return false; + } + return true; +} diff --git a/keyboards/planck/keymaps/mwpeterson/rules.mk b/keyboards/planck/keymaps/mwpeterson/rules.mk new file mode 100644 index 0000000000..de8aa389c4 --- /dev/null +++ b/keyboards/planck/keymaps/mwpeterson/rules.mk @@ -0,0 +1,6 @@ +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens +MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) +NKRO_ENABLE = no # N-key rollover required for use as a steno board +AUDIO_ENABLE = yes # Audio output on port C6 -- cgit v1.2.3 From 14bdd5ed2a808075130bac26fc72dcb9b158ae2c Mon Sep 17 00:00:00 2001 From: sm0g <38926679+sm0ggles@users.noreply.github.com> Date: Thu, 18 Oct 2018 16:51:02 -0400 Subject: Keymap: added my tada68's from Gitlab. (#4146) * added my tada68 from Gitlab. * Removed unneeded code and the sm0gunix layout. --- keyboards/tada68/keymaps/sm0g/config.h | 3 + keyboards/tada68/keymaps/sm0g/keymap.c | 100 ++++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/sm0g/readme.md | 15 +++++ keyboards/tada68/keymaps/sm0g/rules.mk | 18 ++++++ 4 files changed, 136 insertions(+) create mode 100644 keyboards/tada68/keymaps/sm0g/config.h create mode 100644 keyboards/tada68/keymaps/sm0g/keymap.c create mode 100644 keyboards/tada68/keymaps/sm0g/readme.md create mode 100644 keyboards/tada68/keymaps/sm0g/rules.mk diff --git a/keyboards/tada68/keymaps/sm0g/config.h b/keyboards/tada68/keymaps/sm0g/config.h new file mode 100644 index 0000000000..3a2370b62c --- /dev/null +++ b/keyboards/tada68/keymaps/sm0g/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define BACKLIGHT_BREATHING \ No newline at end of file diff --git a/keyboards/tada68/keymaps/sm0g/keymap.c b/keyboards/tada68/keymaps/sm0g/keymap.c new file mode 100644 index 0000000000..25312cd98f --- /dev/null +++ b/keyboards/tada68/keymaps/sm0g/keymap.c @@ -0,0 +1,100 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL 1 +#define _GM 2 +#define _GF 3 + + +// Tap dance declarations (These must go above the keymaps) +enum { + TD_F1 = 0, + TD_F2, + TD_F3, + TD_F4, + TD_F5, + TD_F6, + TD_F7, + TD_F8, + TD_F9, + TD_F10, + TD_F11, + TD_F12, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]|Bksp |Del | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Caps|Win |Alt | Space |Alt|Ctrl| FN|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_ESC, TD(TD_F1), TD(TD_F2), TD(TD_F3), TD(TD_F4), TD(TD_F5), TD(TD_F6), TD(TD_F7), TD(TD_F8), TD(TD_F9), TD(TD_F10), TD(TD_F11), TD(TD_F12), KC_BSLS,KC_GRV, \ + 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_BSPC,KC_DEL, \ + 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, KC_ENT,KC_PGUP, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP,KC_PGDN, \ + KC_CAPS, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(_FL), KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | Caps |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |Prev|P/P|Next| + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TG(_GM), KC_INS , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, BL_BRTG,KC_VOLD,KC_VOLU,KC_MUTE,_______,_______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______,KC_MPRV,KC_MPLY, KC_MNXT), + +[_GM] = LAYOUT_ansi( + KC_ESC, 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_GRV, \ + 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_BSPC,KC_DEL, \ + KC_LCTL, 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_CAPS, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL,MO(_GF), KC_LEFT,KC_DOWN,KC_RGHT), + +[_GF] = LAYOUT_ansi( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, TG(_GM), KC_INS , \ + _______,_______, KC_UP,_______,_______, _______,_______,_______,_______,_______,_______,_______,_______, _______,KC_HOME, \ + KC_CAPS,KC_LEFT,KC_DOWN,KC_RIGHT,_______,_______,_______,_______,_______,_______,_______,_______, _______,KC_END, \ + _______,_______,_______,BL_DEC, BL_TOGG,BL_INC, BL_BRTG,KC_VOLD,KC_VOLU,KC_MUTE,_______,_______, _______, _______, \ + _______,_______,_______, _______, _______,_______,_______,KC_MPRV,KC_MPLY, KC_MNXT), + +}; + +// Tapdance definitions. Tap Dance F Keys. +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_F1] = ACTION_TAP_DANCE_DOUBLE(KC_1, KC_F1), + [TD_F2] = ACTION_TAP_DANCE_DOUBLE(KC_2, KC_F2), + [TD_F3] = ACTION_TAP_DANCE_DOUBLE(KC_3, KC_F3), + [TD_F4] = ACTION_TAP_DANCE_DOUBLE(KC_4, KC_F4), + [TD_F5] = ACTION_TAP_DANCE_DOUBLE(KC_5, KC_F5), + [TD_F6] = ACTION_TAP_DANCE_DOUBLE(KC_6, KC_F6), + [TD_F7] = ACTION_TAP_DANCE_DOUBLE(KC_7, KC_F7), + [TD_F8] = ACTION_TAP_DANCE_DOUBLE(KC_8, KC_F8), + [TD_F9] = ACTION_TAP_DANCE_DOUBLE(KC_9, KC_F9), + [TD_F10] = ACTION_TAP_DANCE_DOUBLE(KC_0, KC_F10), + [TD_F11] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_F11), + [TD_F12] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_F12), +}; diff --git a/keyboards/tada68/keymaps/sm0g/readme.md b/keyboards/tada68/keymaps/sm0g/readme.md new file mode 100644 index 0000000000..9916dcabd8 --- /dev/null +++ b/keyboards/tada68/keymaps/sm0g/readme.md @@ -0,0 +1,15 @@ +``` + ______ __ __ ______ ______ +.-----.--------.| |.-----. | |_.---.-.--| |.---.-.| __| __ | +|__ --| || -- || _ | | _| _ | _ || _ || __ | __ | +|_____|__|__|__||______||___ | |____|___._|_____||___._||______|______| + |_____| +``` + +Just my simple layout for the Tada68. +Space [Cadet Shift](https://docs.qmk.fm/#/feature_space_cadet_shift) is enabled. +LCTRL and Caps have been swapped and the new CTRL also acts as ESC when tapped and CTRL when held. +This is helpful for me as a VIM user. +Some other changes. + +Tap Dance for the F Row.. i.e double tap 1 and get F1 instead. diff --git a/keyboards/tada68/keymaps/sm0g/rules.mk b/keyboards/tada68/keymaps/sm0g/rules.mk new file mode 100644 index 0000000000..bd4bb32491 --- /dev/null +++ b/keyboards/tada68/keymaps/sm0g/rules.mk @@ -0,0 +1,18 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Tappa Dance \ No newline at end of file -- cgit v1.2.3 From db03b76910c486cd27c175ae85efeeaa183b1c98 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Fri, 19 Oct 2018 01:30:48 +0900 Subject: optimize rgblight_effect_alternating(void) rgblight_effect_alternating (void) calls rgblight_sethsv_at () RGBLED_NUM times. As a result, rgblight_set () is called RGBLED_NUM + 1 times. This is wasteful processing. --- quantum/rgblight.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 03f77cc80d..94e9c0a3b2 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -860,13 +860,13 @@ void rgblight_effect_alternating(void){ last_timer = timer_read(); for(int i = 0; i=RGBLED_NUM/2 && !pos){ - rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, i); - }else{ - rgblight_sethsv_at(rgblight_config.hue, rgblight_config.sat, 0, i); - } + if(i=RGBLED_NUM/2 && !pos){ + sethsv(rgblight_config.hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); + }else{ + sethsv(rgblight_config.hue, rgblight_config.sat, 0, (LED_TYPE *)&led[i]); + } } rgblight_set(); pos = (pos + 1) % 2; -- cgit v1.2.3 From 53a43dbe995640632be834f406007a72f8fa4d3e Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Thu, 18 Oct 2018 13:53:40 -0700 Subject: Keymap: Swap func layer keys and add vim navigation to navigation layer (#4163) --- keyboards/dz60/keymaps/crd/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c index a17d32caaf..2aedc0b728 100644 --- a/keyboards/dz60/keymaps/crd/keymap.c +++ b/keyboards/dz60/keymaps/crd/keymap.c @@ -12,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------------+ * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL | * |-----------------------------------------------------------------------------------------+ - * | FN2 | Alt | Cmd | Space | Cmd | FN1 | L | D | R | + * | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R | * `-----------------------------------------------------------------------------------------' */ @@ -21,7 +21,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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, 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, KC_ENT, KC_LSFT, 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_DEL, - MO(2), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT ), /* FN1 Layer @@ -30,7 +30,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | + * | | | | | | | L | D | U | R | | | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | |PgUp | | * |-----------------------------------------------------------------------------------------+ @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_directional( KC_GRV, 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_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END ), -- cgit v1.2.3 From 480651cf9df5c0b7453f60dffe13ae5de665a120 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 18 Oct 2018 15:12:11 -0700 Subject: Docs: Adding QMK Git Conventions doc; formatting cleanup on Learning Resources doc (#3902) * Docs: newbs_learn_more_resources.md: formatting * Added QMK Git Conventions doc, initial version * Renamed contributing_qmk.md to newbs_best_practices.md * Updated per review by @drashna * Added navigation links * Updated to Best Practices doc * Minor updates to Learn More Resources doc Markdown formatting consistency because I'm particular about it. * Added Merge Conflict section to Best Practices doc --- docs/_sidebar.md | 1 + docs/_summary.md | 2 + docs/newbs.md | 1 + docs/newbs_best_practices.md | 163 +++++++++++++++++++++++++++++++++++++ docs/newbs_learn_more_resources.md | 6 +- 5 files changed, 171 insertions(+), 2 deletions(-) create mode 100644 docs/newbs_best_practices.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 56a6463918..465f4657cd 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -3,6 +3,7 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Best Practices](newbs_best_practices.md) * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) diff --git a/docs/_summary.md b/docs/_summary.md index 11aeb7cd36..465f4657cd 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -3,6 +3,8 @@ * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) + * [Best Practices](newbs_best_practices.md) + * [Learning Resources](newbs_learn_more_resources.md) * [QMK Basics](README.md) * [QMK Introduction](getting_started_introduction.md) diff --git a/docs/newbs.md b/docs/newbs.md index 38a9607d44..e687fd2279 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -12,6 +12,7 @@ There are 5 main sections to this guide: * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) +* [Best Practices](newbs_best_practices.md) * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). diff --git a/docs/newbs_best_practices.md b/docs/newbs_best_practices.md new file mode 100644 index 0000000000..61bcc0c6ad --- /dev/null +++ b/docs/newbs_best_practices.md @@ -0,0 +1,163 @@ +# Best Practices + +## Or, "How I Learned to Stop Worrying and Love Git." + +This document aims to instruct novices in the best ways to have a smooth experience in contributing to QMK. We will walk through the process of contributing to QMK, detailing some ways to make this task easier, and then later we'll break some things in order to teach you how to fix them. + +This document assumes a few things: + +1. You have a GitHub account, and have [forked the qmk_firmware repository](getting_started_github.md) to your account. +2. You've [set up your build environment](newbs_getting_started.md?id=environment-setup). + + +## Your fork's master: Update Often, Commit Never + +It is highly recommended for QMK development, regardless of what is being done or where, to keep your `master` branch updated, but ***never*** commit to it. Instead, do all your changes in a development branch and issue pull requests from your branches when you're developing. + +To reduce the chances of merge conflicts — instances where two or more users have edited the same part of a file concurrently — keep your `master` branch relatively up-to-date, and start any new developments by creating a new branch. + +### Updating your master branch + +To keep your `master` branch updated, it is recommended to add the QMK Firmware repository ("repo") as a remote repository in git. To do this, open your Git command line interface and enter: + +``` +git remote add upstream https://github.com/qmk/qmk_firmware.git +``` + +To verify that the repository has been added, run `git remote -v`, which should return the following: + +``` +$ git remote -v +origin https://github.com//qmk_firmware.git (fetch) +origin https://github.com//qmk_firmware.git (push) +upstream https://github.com/qmk/qmk_firmware.git (fetch) +upstream https://github.com/qmk/qmk_firmware.git (push) +``` + +Now that this is done, you can check for updates to the repo by running `git fetch upstream`. This retrieves the branches and tags — collectively referred to as "refs" — from the QMK repo, which now has the nickname `upstream`. We can now compare the data on our fork `origin` to that held by QMK. + +To update your fork's master, run the following, hitting the Enter key after each line: + +``` +git checkout master +git fetch upstream +git pull upstream master +git push origin master +``` + +This switches you to your `master` branch, retrieves the refs from the QMK repo, downloads the current QMK `master` branch to your computer, and then uploads it to your fork. + +### Making Changes + +To make changes, create a new branch by entering: + +``` +git checkout -b dev_branch +git push --set-upstream origin dev_branch +``` + +This creates a new branch named `dev_branch`, checks it out, and then saves the new branch to your fork. The `--set-upstream` argument tells git to use your fork and the `dev_branch` branch every time you use `git push` or `git pull` from this branch. It only needs to be used on the first push; after that, you can safely use `git push` or `git pull`, without the rest of the arguments. + +!> With `git push`, you can use `-u` in place of `--set-upstream` — `-u` is an alias for `--set-upstream`. + +You can name your branch nearly anything you want, though it is recommended to name it something related to the changes you are going to make. + +By default `git checkout -b` will base your new branch on the branch that is checked out. You can base your new branch on an existing branch that is not checked out by adding the name of the existing branch to the command: + +``` +git checkout -b dev_branch master +``` + +Now that you have a development branch, open your text editor and make whatever changes you need to make. It is recommended to make many small commits to your branch; that way, any change that causes issues can be more easily traced and undone if needed. To make your changes, edit and save any files that need to be updated, add them to Git's *staging area*, and then commit them to your branch: + +``` +git add path/to/updated_file +git commit -m "My commit message." +``` + +`git add` adds files that have been changed to Git's *staging area*, which is Git's "loading zone." This contains the changes that are going to be *committed* by `git commit`, which saves the changes to the repo. Use descriptive commit messages so you can know what was changed at a glance. + +!> If you've changed a lot of files, but all the files are part of the same change, you can use `git add .` to add all the changed files that are in your current directory, rather than having to add each file individually. + +### Publishing Your Changes + +The last step is to push your changes to your fork. To do this, enter `git push`. Git now publishes the current state of `dev_branch` to your fork. + + +## Resolving Merge Conflicts + +Sometimes when your work in a branch takes a long time to complete, changes that have been made by others conflict with changes you have made to your branch when you open a pull request. This is called a *merge conflict*, and is what happens when multiple people edit the same parts of the same files. + +### Rebasing Your Changes + +A *rebase* is Git's way of taking changes that were applied at one point, reversing them, and then applying the same changes to another point. In the case of a merge conflict, you can rebase your branch to grab the changes that were made between when you created your branch and the present time. + +To start, run the following: + +``` +git fetch upstream +git rev-list --left-right --count HEAD...upstream/master +``` + +The `git rev-list` command entered here returns the number of commits that differ between the current branch and QMK's master branch. We run `git fetch` first to make sure we have the refs that represent the current state of the upstream repo. The output of the `git rev-list` command entered returns two numbers: + +``` +$ git rev-list --left-right --count HEAD...upstream/master +7 35 +``` + +The first number represents the number of commits on the current branch since it was created, and the second number is the number of commits made to `upstream/master` since the current branch was created, and thus, the changes that are not recorded in the current branch. + +Now that the current states of both the current branch and the upstream repo are known, we can start a rebase operation: + +``` +git rebase upstream/master +``` + +This tells Git to undo the commits on the current branch, and then reapply them against QMK's master branch. + +``` +$ git rebase upstream/master +First, rewinding head to replay your work on top of it... +Applying: Commit #1 +Using index info to reconstruct a base tree... +M conflicting_file_1.txt +Falling back to patching base and 3-way merge... +Auto-merging conflicting_file_1.txt +CONFLICT (content): Merge conflict in conflicting_file_1.txt +error: Failed to merge in the changes. +hint: Use 'git am --show-current-patch' to see the failed patch +Patch failed at 0001 Commit #1 + +Resolve all conflicts manually, mark them as resolved with +"git add/rm ", then run "git rebase --continue". +You can instead skip this commit: run "git rebase --skip". +To abort and get back to the state before "git rebase", run "git rebase --abort". +``` + +This tells us that we have a merge conflict, and gives the name of the file with the conflict. Open the conflicting file in your text editor, and somewhere in the file, you'll find something like this: + +``` +<<<<<<< HEAD +

For help with any issues, email us at support@webhost.us.

+======= +

Need help? Email support@webhost.us.

+>>>>>>> Commit #1 +``` + +The line `<<<<<<< HEAD` marks the beginning of a merge conflict, and the `>>>>>>> Commit #1` line marks the end, with the conflicting sections separated by `=======`. The part on the `HEAD` side is from the QMK master version of the file, and the part marked with the commit message is from the current branch and commit. + +Because Git tracks *changes to files* rather than the contents of the files directly, if Git can't find the text that was in the file previous to the commit that was made, it won't know how to edit the file. Re-editing the file will solve the conflict. Make your changes, and then save the file. + +``` +

Need help? Email support@webhost.us.

+``` + +Now run: + +``` +git add conflicting_file_1.txt +git rebase --continue +``` + +Git logs the changes to the conflicting file, and continues applying the commits from our branch until it reaches the end. diff --git a/docs/newbs_learn_more_resources.md b/docs/newbs_learn_more_resources.md index 23b99f470f..9b77db8fd4 100644 --- a/docs/newbs_learn_more_resources.md +++ b/docs/newbs_learn_more_resources.md @@ -1,13 +1,15 @@ # Learning Resources -These resources are aimed at giving new members in the qmk community more understanding to the information provided in the newbs docs. + +These resources are aimed at giving new members in the QMK community more understanding to the information provided in the Newbs docs. Git resources: * [Great General Tutorial](https://www.codecademy.com/learn/learn-git) * [Git Game To Learn From Examples](https://learngitbranching.js.org/) * [Git Resources to Learn More About Github](getting_started_github.md) -* [Git Resources Aimed Specificly toward QMK](contributing.md) +* [Git Resources Aimed Specifically toward QMK](contributing.md) Command Line resources: + * [Good General Tutorial on Command Line](https://www.codecademy.com/learn/learn-the-command-line) -- cgit v1.2.3 From fc1c692f710fcd65be250d43662ee9742b221f0d Mon Sep 17 00:00:00 2001 From: lexworth <30760424+lexworth@users.noreply.github.com> Date: Thu, 18 Oct 2018 18:36:30 -0400 Subject: Keymap: Adding my Minivan layout (#4162) * adding my keymap * adding my Minivan keymap * deleted old incomplete keymap * added link to layout image * adding my minivan keymap --- .../minivan/keymaps/lexworth/config.h | 5 ++++ .../minivan/keymaps/lexworth/keymap.c | 29 ++++++++++++++++++++++ .../minivan/keymaps/lexworth/readme.md | 7 ++++++ .../minivan/keymaps/lexworth/rules.mk | 5 ++++ 4 files changed, 46 insertions(+) create mode 100644 keyboards/thevankeyboards/minivan/keymaps/lexworth/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/lexworth/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/lexworth/readme.md create mode 100644 keyboards/thevankeyboards/minivan/keymaps/lexworth/rules.mk diff --git a/keyboards/thevankeyboards/minivan/keymaps/lexworth/config.h b/keyboards/thevankeyboards/minivan/keymaps/lexworth/config.h new file mode 100644 index 0000000000..36062c47b9 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/lexworth/config.h @@ -0,0 +1,5 @@ +#pragma once + +// place overrides here +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 5 \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/lexworth/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/lexworth/keymap.c new file mode 100644 index 0000000000..1824f3cf39 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/lexworth/keymap.c @@ -0,0 +1,29 @@ +#include QMK_KEYBOARD_H + +// Helpful defines + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT + (KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT(1,KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(1,KC_QUOT), + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_SPC, TG(2), LT(3,KC_APP), KC_DEL), + + [1] = LAYOUT + (KC_CAPS, KC_PGUP, KC_UP, KC_PGDN, KC_INS, KC_HOME, KC_UNDS, KC_P7, KC_P8, KC_P9, KC_EQL, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, KC_END, KC_PMNS, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, + KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_PAST, KC_P1, KC_P2, KC_P3, KC_PSLS, KC_NLCK, + KC_TRNS, KC_TRNS, KC_MSTP, KC_PENT, KC_P0, KC_PDOT, KC_APP, KC_TRNS), + + [2] = LAYOUT + (KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F11, KC_F12), + + [3] = LAYOUT + (KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LCBR, KC_RCBR, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LBRC, KC_RBRC, KC_PIPE, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LPRN, KC_RPRN, KC_TRNS, + BL_TOGG, BL_DEC, BL_INC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET) +}; diff --git a/keyboards/thevankeyboards/minivan/keymaps/lexworth/readme.md b/keyboards/thevankeyboards/minivan/keymaps/lexworth/readme.md new file mode 100644 index 0000000000..5ac3aafdcc --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/lexworth/readme.md @@ -0,0 +1,7 @@ +# Minivan + +![Layout Image](https://drive.google.com/file/d/1rDbtoOBvw5lxfvUBLYmjTt6MJPoeXngr/view?usp=sharing) + +# Custom keymap for the minivan with backlight enabled and 5 backlight levels. +# Hardware Supported: Minivan +# Hardware Availability: [thevankeyboards.com](https://thevankeyboards.com/) \ No newline at end of file diff --git a/keyboards/thevankeyboards/minivan/keymaps/lexworth/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/lexworth/rules.mk new file mode 100644 index 0000000000..9c7dc2e122 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/lexworth/rules.mk @@ -0,0 +1,5 @@ +# 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 + +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -- cgit v1.2.3 From 8efe8b498d344928fb55ea78a289d9eb32145e48 Mon Sep 17 00:00:00 2001 From: 194h <38110558+194h@users.noreply.github.com> Date: Fri, 19 Oct 2018 02:09:06 +0200 Subject: Keymap: Added 194h atreus62 keymap (#4164) * Added my(194h) atreus62 keymap * Fixed what noroadsleft remarked in my pull request, hopefully got it all. * Followed drashna's suggestion. --- keyboards/atreus62/keymaps/194h/config.h | 6 ++ keyboards/atreus62/keymaps/194h/keymap.c | 160 +++++++++++++++++++++++++++++++ keyboards/atreus62/keymaps/194h/rules.mk | 8 ++ 3 files changed, 174 insertions(+) create mode 100644 keyboards/atreus62/keymaps/194h/config.h create mode 100644 keyboards/atreus62/keymaps/194h/keymap.c create mode 100644 keyboards/atreus62/keymaps/194h/rules.mk diff --git a/keyboards/atreus62/keymaps/194h/config.h b/keyboards/atreus62/keymaps/194h/config.h new file mode 100644 index 0000000000..f5306a07f1 --- /dev/null +++ b/keyboards/atreus62/keymaps/194h/config.h @@ -0,0 +1,6 @@ +#pragma once +#define ONESHOT_TIMEOUT 3000 +#define TAPPING_TERM 200 +#define FORCE_NKRO +#define LEADER_TIMEOUT 1000 +#define TAPPING_TOGGLE 3 diff --git a/keyboards/atreus62/keymaps/194h/keymap.c b/keyboards/atreus62/keymaps/194h/keymap.c new file mode 100644 index 0000000000..9b397fce46 --- /dev/null +++ b/keyboards/atreus62/keymaps/194h/keymap.c @@ -0,0 +1,160 @@ +#include QMK_KEYBOARD_H + +//The current Nordic and Norwegian layout files are a mess. I'll do it myself: +//Norwegian +#define NO_AE KC_QUOT // Æ +#define NO_AO KC_LBRC // Å +#define NO_BSLS KC_EQL // Backslash +#define NO_LT KC_NUBS // < +#define NO_MINS KC_SLSH // - +#define NO_OE KC_SCLN // Ø +#define NO_PIPE KC_GRV // | +#define NO_PLUS KC_MINS // + +#define NO_QUOT KC_NUHS // ' +#define NO_UMLA KC_RBRC // ¨ +//Norwegian - Modifier dependant definitions +#define NO_EXLM LSFT(KC_1) // ! +#define NO_DQT LSFT(KC_2) // " +#define NO_AT RALT(KC_2) // @ +#define NO_HASH LSFT(KC_3) // # +#define NO_EUR LSFT(KC_4) // € +#define NO_DLR RALT(KC_4) // $ +#define NO_PERC LSFT(KC_5) // % +#define NO_AND LSFT(KC_6) // & +#define NO_SLSH LSFT(KC_7) // / +#define NO_PO LSFT(KC_8) // ( +#define NO_PC LSFT(KC_9) // ) +#define NO_EQL LSFT(KC_0) // = +#define NO_LCBR RALT(KC_7) // { +#define NO_LBRC RALT(KC_8) // [ +#define NO_RBRC RALT(KC_9) // ] +#define NO_RCBR RALT(KC_0) // } +#define NO_COLN LSFT(KC_DOT) // : +#define NO_SCLN LSFT(KC_COMM) // ; +#define NO_MU RALT(KC_M) // µ +#define NO_EURO RALT(KC_E) // € +#define NO_SECT LSFT(KC_GRV) // § +#define NO_GERC RALT(KC_COMM) // ¸ +#define NO_QUAR LSFT(RALT(KC_4)) // ¼ +//Norwegian layout - dependant on previous definitions +#define NO_UNDS LSFT(NO_MINS) // _ +#define NO_QUES LSFT(NO_PLUS) // ? +#define NO_GRAV LSFT(NO_BSLS) // ` +#define NO_GT LSFT(NO_LT) // > +#define NO_HALF RALT(NO_LT) // ½ +#define NO_HAT LSFT(NO_UMLA) // ^ +#define NO_ASTR LSFT(NO_QUOT) // * +#define NO_TILD RALT(NO_UMLA) // ~ + +//One Shot Modifier +#define OSM_LCTL OSM(MOD_LCTL) +#define OSM_LALT OSM(MOD_LALT) +#define OSM_LSFT OSM(MOD_LSFT) +#define OSM_LGUI OSM(MOD_LGUI) +#define OSM_RCTL OSM(MOD_RCTL) +#define OSM_RALT OSM(MOD_RALT) +#define OSM_RSFT OSM(MOD_RSFT) +#define OSM_RGUI OSM(MOD_RGUI) + +//Layers +#define L1 0 +#define L2 1 +#define L3 2 +#define L4 3 +#define L5 4 + +// Momentary switch to layer - One Shot Layer +#define OSL_L3 OSL(L3) +#define OSL_L4 OSL(L4) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [L1] = LAYOUT( + KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RGUI, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_DQT, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_SCLN, NO_QUOT, + OSM_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, OSM_RSFT, + CTL_T(KC_ESC), MO(L5), KC_LEAD, OSM_LALT, MO(L4), OSL_L3, KC_SPC, KC_ENT, OSL_L3, MO(L4), OSM_RALT, NO_EQL, NO_PLUS, KC_RCTL + ), + [L2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_AO, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_OE, NO_AE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [L3] = LAYOUT( + NO_LBRC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_RBRC, + NO_LCBR, XXXXXXX, XXXXXXX, NO_AT, XXXXXXX, NO_TILD, NO_QUES, NO_EXLM, NO_PIPE, XXXXXXX, XXXXXXX, NO_RCBR, + _______, NO_ASTR, NO_BSLS, NO_DLR, NO_HASH, XXXXXXX, NO_HAT, XXXXXXX, NO_COLN, NO_SLSH, NO_SCLN, NO_QUOT, + NO_PO, KC_0, NO_SECT, NO_PERC, XXXXXXX, NO_GRAV, NO_AND, NO_UMLA, NO_LT, NO_GT, NO_UNDS, NO_PC, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX + ), + [L4] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, KC_DEL, + XXXXXXX, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, + OSM_LCTL, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, OSM_RCTL + ), + [L5] = LAYOUT( + XXXXXXX, TO(L1), TO(L2), TO(L3), TO(L4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_AO, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_OE, NO_AE, + XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + ) +}; + + +// Unicode Linux +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + + +#define TAP_ONCE(code) \ + register_code (code); \ + unregister_code (code) + + +LEADER_EXTERNS(); + +// Runs constantly in the background, in a loop. Only supports basic keycodes. +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + //probably useless in practice, but cool + SEQ_ONE_KEY (KC_P) { + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + tap_random_base64(); + } + + SEQ_ONE_KEY (KC_G) { + SEND_STRING("grep something !"); + register_code(KC_RALT); + TAP_ONCE(KC_4); + unregister_code(KC_RALT); + } + SEQ_ONE_KEY (KC_T) { + SEND_STRING("tail "); + TAP_ONCE(KC_SLSH); + SEND_STRING("f !"); + register_code(KC_RALT); + TAP_ONCE(KC_4); + unregister_code(KC_RALT); + } + SEQ_ONE_KEY (KC_S) { + SEND_STRING("sudo !!"); + TAP_ONCE(KC_ENT); + } + } +} diff --git a/keyboards/atreus62/keymaps/194h/rules.mk b/keyboards/atreus62/keymaps/194h/rules.mk new file mode 100644 index 0000000000..5246909a38 --- /dev/null +++ b/keyboards/atreus62/keymaps/194h/rules.mk @@ -0,0 +1,8 @@ +TAP_DANCE_ENABLE = no +NKRO_ENABLE = true +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +KEY_LOCK_ENABLE = no +AUTO_SHIFT_ENABLE = no +LEADER_ENABLE = yes -- cgit v1.2.3 From f4094930a393ec3dc597e06e95cd3365e3f8cb97 Mon Sep 17 00:00:00 2001 From: Takuya Urakawa Date: Fri, 19 Oct 2018 13:33:23 +0900 Subject: stm32f1xx EEPROM emulation (#3914) * * Add stm32f1xx EEPROM emulation * Fix eeprom update compare bug Squashed commit of the following: commit b8f248ae08cec0cd81ecbb8854d9b39221d4d573 Author: hsgw Date: Sat Sep 15 19:13:48 2018 +0900 fix EEPROM_update wrong compare commit d4ed4e6ea864e967a3e17f7edee4b0c3b4a25541 Author: hsgw Date: Sat Sep 15 17:43:47 2018 +0900 eeprom fix initialization define commit b61aa7c04d70c64df3416d63e5da08b73b6053af Author: hsgw Date: Sat Sep 15 16:33:40 2018 +0900 maybe working * Fix FLASH_KEY defines --- tmk_core/common.mk | 7 +++++++ tmk_core/common/chibios/eeprom_stm32.c | 8 ++++---- tmk_core/common/chibios/eeprom_stm32.h | 12 +++++++++--- tmk_core/common/chibios/flash_stm32.c | 24 ++++++++++++++++-------- tmk_core/common/eeconfig.c | 6 +++--- tmk_core/common/eeconfig.h | 2 +- tmk_core/protocol/chibios/main.c | 4 ++-- 7 files changed, 42 insertions(+), 21 deletions(-) diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 4a0f7dcf9a..33bcc97b2e 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -34,6 +34,13 @@ ifeq ($(PLATFORM),CHIBIOS) ifeq ($(MCU_SERIES), STM32F3xx) TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F303xC + TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE + else ifeq ($(MCU_SERIES), STM32F1xx) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB + TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE else TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c endif diff --git a/tmk_core/common/chibios/eeprom_stm32.c b/tmk_core/common/chibios/eeprom_stm32.c index 3c19451223..a869985501 100755 --- a/tmk_core/common/chibios/eeprom_stm32.c +++ b/tmk_core/common/chibios/eeprom_stm32.c @@ -10,7 +10,7 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and * https://github.com/leaflabs/libmaple * * Modifications for QMK and STM32F303 by Yiancar @@ -274,7 +274,7 @@ uint16_t EE_VerifyPageFullWriteVariable(uint16_t Address, uint16_t Data) // Check each active page address starting from begining for (idx = pageBase + 4; idx < pageEnd; idx += 4) - if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element + if ((*(__IO uint32_t*)idx) == 0xFFFFFFFF) // Verify if element { // contents are 0xFFFFFFFF FlashStatus = FLASH_ProgramHalfWord(idx, Data); // Set variable data if (FlashStatus != FLASH_COMPLETE) @@ -517,7 +517,7 @@ uint16_t EEPROM_read(uint16_t Address, uint16_t *Data) // Get the valid Page end Address pageEnd = pageBase + ((uint32_t)(PageSize - 2)); - + // Check each active page address starting from end for (pageBase += 6; pageEnd >= pageBase; pageEnd -= 4) if ((*(__IO uint16_t*)pageEnd) == Address) // Compare the read address with the virtual address @@ -574,7 +574,7 @@ uint16_t EEPROM_update(uint16_t Address, uint16_t Data) { uint16_t temp; EEPROM_read(Address, &temp); - if (Address == Data) + if (temp == Data) return EEPROM_SAME_VALUE; else return EEPROM_write(Address, Data); diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h index 68aa14f6d4..09229530ca 100755 --- a/tmk_core/common/chibios/eeprom_stm32.h +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -10,7 +10,7 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and * https://github.com/leaflabs/libmaple * * Modifications for QMK and STM32F303 by Yiancar @@ -27,8 +27,14 @@ #include "flash_stm32.h" // HACK ALERT. This definition may not match your processor -// To Do. Work out correct value for EEPROM_PAGE_SIZE on the STM32F103CT6 etc -#define MCU_STM32F303CC +// To Do. Work out correct value for EEPROM_PAGE_SIZE on the STM32F103CT6 etc +#if defined(EEPROM_EMU_STM32F303xC) + #define MCU_STM32F303CC +#elif defined(EEPROM_EMU_STM32F103xB) + #define MCU_STM32F103RB +#else + #error "not implemented." +#endif #ifndef EEPROM_PAGE_SIZE #if defined (MCU_STM32F103RB) diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c index e7199ac7b1..2735934844 100755 --- a/tmk_core/common/chibios/flash_stm32.c +++ b/tmk_core/common/chibios/flash_stm32.c @@ -10,19 +10,27 @@ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and + * This files are free to use from https://github.com/rogerclarkmelbourne/Arduino_STM32 and * https://github.com/leaflabs/libmaple * * Modifications for QMK and STM32F303 by Yiancar */ -#define STM32F303xC +#if defined(EEPROM_EMU_STM32F303xC) + #define STM32F303xC + #include "stm32f3xx.h" +#elif defined(EEPROM_EMU_STM32F103xB) + #define STM32F103xB + #include "stm32f1xx.h" +#else + #error "not implemented." +#endif -#include "stm32f3xx.h" #include "flash_stm32.h" -#define FLASH_KEY1 ((uint32_t)0x45670123) -#define FLASH_KEY2 ((uint32_t)0xCDEF89AB) +#if defined(EEPROM_EMU_STM32F103xB) + #define FLASH_SR_WRPERR FLASH_SR_WRPRTERR +#endif /* Delay definition */ #define EraseTimeout ((uint32_t)0x00000FFF) @@ -71,7 +79,7 @@ FLASH_Status FLASH_GetStatus(void) * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. */ FLASH_Status FLASH_WaitForLastOperation(uint32_t Timeout) -{ +{ FLASH_Status status; /* Check for the Flash Status */ @@ -102,7 +110,7 @@ FLASH_Status FLASH_ErasePage(uint32_t Page_Address) ASSERT(IS_FLASH_ADDRESS(Page_Address)); /* Wait for last operation to be completed */ status = FLASH_WaitForLastOperation(EraseTimeout); - + if(status == FLASH_COMPLETE) { /* if the previous operation is completed, proceed to erase the page */ @@ -128,7 +136,7 @@ FLASH_Status FLASH_ErasePage(uint32_t Page_Address) * @param Address: specifies the address to be programmed. * @param Data: specifies the data to be programmed. * @retval FLASH Status: The returned value can be: FLASH_ERROR_PG, - * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. + * FLASH_ERROR_WRP, FLASH_COMPLETE or FLASH_TIMEOUT. */ FLASH_Status FLASH_ProgramHalfWord(uint32_t Address, uint16_t Data) { diff --git a/tmk_core/common/eeconfig.c b/tmk_core/common/eeconfig.c index 0fec410a9c..d8bab7d2e5 100644 --- a/tmk_core/common/eeconfig.c +++ b/tmk_core/common/eeconfig.c @@ -3,7 +3,7 @@ #include "eeprom.h" #include "eeconfig.h" -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE #include "hal.h" #include "eeprom_stm32.h" #endif @@ -32,7 +32,7 @@ void eeconfig_init_kb(void) { * FIXME: needs doc */ void eeconfig_init_quantum(void) { -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE EEPROM_format(); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); @@ -73,7 +73,7 @@ void eeconfig_enable(void) */ void eeconfig_disable(void) { -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE EEPROM_format(); #endif eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER_OFF); diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index a45cb8b12d..8d4e1d4d00 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -26,7 +26,7 @@ along with this program. If not, see . #define EECONFIG_MAGIC_NUMBER_OFF (uint16_t)0xFFFF /* eeprom parameteter address */ -#if !defined(STM32F303xC) +#if !defined(STM32_EEPROM_ENABLE) #define EECONFIG_MAGIC (uint16_t *)0 #define EECONFIG_DEBUG (uint8_t *)2 #define EECONFIG_DEFAULT_LAYER (uint8_t *)3 diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index dcc6d9d076..6cceccd23c 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -44,7 +44,7 @@ #ifdef MIDI_ENABLE #include "qmk_midi.h" #endif -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE #include "eeprom_stm32.h" #endif #include "suspend.h" @@ -112,7 +112,7 @@ int main(void) { halInit(); chSysInit(); -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE EEPROM_init(); #endif -- cgit v1.2.3 From 7e1b57add42dcc3330d9d99e28c9b7f96eb2eee8 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 18 Oct 2018 21:34:40 -0700 Subject: Some cleanup of the Useful Functions docs (#4064) * Add examples for tri layers * Clean up and spelling fixes --- docs/ref_functions.md | 78 ++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 64 insertions(+), 14 deletions(-) diff --git a/docs/ref_functions.md b/docs/ref_functions.md index 7d0cda3227..9b5be7a883 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -1,28 +1,79 @@ # List of Useful Core Functions To Make Your Keyboard Better -There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. +There are a lot of hidden functions in QMK that are incredible useful, or may add a bit of functionality that you've been wanting. Functions that are specific to certain features are not included here, as those will be on their respective feature page. ## (OLKB) Tri Layers -There are actually separate functions that you can use there, depending on what you're after. +There are actually separate functions that you can use there, depending on what you're after. -The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. +### `update_tri_layer(x, y, z)` -This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. +The first is the `update_tri_layer(x, y, z)` function. This function check to see if layers `x` and `y` are both on. If they are both on, then it runs on layer `z`. Otherwise, if both `x` and `y` are not both on (either only one is, or neither is), then it runs off layer `z`. -The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. +This function is useful if you want to create specific keys that have this functionality, but other layer keycodes won't do this. -The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. +#### Example + +```c +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + } + return true; +} +``` + +### `update_tri_layer_state(state, x, y, z)` +The other function is `update_tri_layer_state(state, x, y, z)`. This function is meant to be called from they [`layer_state_set_*` functions](custom_quantum_functions.md#layer-change-code). This means that any time that you use a keycode to change the layer, this will be checked. So you could use `LT(layer, kc)` to change the layer and it will trigger the same layer check. + +The caveat to this method is that you cannot access the `z` layer without having `x` and `y` layers on, since if you try to activate just layer `z`, it will run this code and turn off layer `z` before you could use it. + +#### Example + +```c +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} +``` + +Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects. + +```c +uint32_t layer_state_set_user(uint32_t state) { + state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL); + return state; +} +``` ## Setting the Persistent Default Layer -Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. +Do you want to set the default layer, so that it's retained even after you unplug the board? If so, this is the function for you. -To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). +To use this, you would use `set_single_persistent_default_layer(layer)`. If you have a name defined for your layer, you can use that instead (such as _QWERTY, _DVORAK or _COLEMAK). -This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. +This will set the default layer, update the persistent settings, and play a tune if you have [Audio](feature_audio.md) enabled on your board, and the default layer sounds set. -To configure the default layer sounds, you would want to define this in your `config.h` file, like this: +To configure the default layer sounds, you would want to define this in your `config.h` file, like this: ```c #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ @@ -36,13 +87,12 @@ To configure the default layer sounds, you would want to define this in your `co ## Reseting the keyboard -There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. +There is the `RESET` quantum keycode that you can use. But if you want to reset the board as part of a macro, rather than hitting a key separately, you can do that. And to do so, add `reset_keyboard()` to your function or macro, and this will reset to bootloader. ## Wiping the EEPROM (Persistent Storage) -If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. - -To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. +If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. +To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. -- cgit v1.2.3 From 7222e3691b18128c4822f6bb5db008010f5e41dd Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 18 Oct 2018 21:35:15 -0700 Subject: Fix Unicode EEPROM handling so it is consistent. (#4066) * Fix Unicode EEPROM handling so it's consistant * Remove changes to my userspace * Optimize variables used * fix functions * additional cleanup * Add False Flag * rename function --- quantum/process_keycode/process_ucis.c | 6 +++--- quantum/process_keycode/process_unicode.c | 7 +------ quantum/process_keycode/process_unicode_common.c | 17 +++++++++++------ quantum/process_keycode/process_unicode_common.h | 1 + quantum/process_keycode/process_unicodemap.c | 1 + 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 5de2e41fc3..380199771d 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -93,7 +93,7 @@ void register_ucis(const char *hex) { } bool process_ucis (uint16_t keycode, keyrecord_t *record) { - uint8_t i; + unicode_input_mode_init(); if (!qk_ucis_state.in_progress) return true; @@ -122,7 +122,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) { bool symbol_found = false; - for (i = qk_ucis_state.count; i > 0; i--) { + for (uint8_t i = qk_ucis_state.count; i > 0; i--) { register_code (KC_BSPC); unregister_code (KC_BSPC); wait_ms(UNICODE_TYPE_DELAY); @@ -134,7 +134,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { } unicode_input_start(); - for (i = 0; ucis_symbol_table[i].symbol; i++) { + for (uint8_t i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; register_ucis(ucis_symbol_table[i].code + 2); diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index fd008eca12..f39c4a36e1 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -17,15 +17,10 @@ #include "action_util.h" #include "eeprom.h" -static uint8_t first_flag = 0; - bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { - if (first_flag == 0) { - set_unicode_input_mode(eeprom_read_byte(EECONFIG_UNICODEMODE)); - first_flag = 1; - } uint16_t unicode = keycode & 0x7FFF; + unicode_input_mode_init(); unicode_input_start(); register_hex(unicode); unicode_input_finish(); diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index e6620b7ea9..4285d20a19 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -22,8 +22,7 @@ static uint8_t input_mode; uint8_t mods; -void set_unicode_input_mode(uint8_t os_target) -{ +void set_unicode_input_mode(uint8_t os_target) { input_mode = os_target; eeprom_update_byte(EECONFIG_UNICODEMODE, os_target); } @@ -32,6 +31,14 @@ uint8_t get_unicode_input_mode(void) { return input_mode; } +void unicode_input_mode_init(void) { + static bool first_flag = false; + if (!first_flag) { + input_mode = eeprom_read_byte(EECONFIG_UNICODEMODE); + first_flag = true; + } +} + __attribute__((weak)) void unicode_input_start (void) { // save current mods @@ -104,8 +111,7 @@ void unicode_input_finish (void) { } __attribute__((weak)) -uint16_t hex_to_keycode(uint8_t hex) -{ +uint16_t hex_to_keycode(uint8_t hex) { if (hex == 0x0) { return KC_0; } else if (hex < 0xA) { @@ -123,8 +129,7 @@ void register_hex(uint16_t hex) { } } -void send_unicode_hex_string(const char *str) -{ +void send_unicode_hex_string(const char *str) { if (!str) { return; } // Safety net while (*str) { diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index 814b60c573..e78e1cec6c 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -28,6 +28,7 @@ static uint8_t input_mode; void set_unicode_input_mode(uint8_t os_target); uint8_t get_unicode_input_mode(void); +void unicode_input_mode_init(void); void unicode_input_start(void); void unicode_input_finish(void); void register_hex(uint16_t hex); diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index 47c27b9117..ab5717ba3a 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -45,6 +45,7 @@ __attribute__((weak)) void unicode_map_input_error() {} bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { + unicode_input_mode_init(); uint8_t input_mode = get_unicode_input_mode(); if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { const uint32_t* map = unicode_map; -- cgit v1.2.3 From ae31eb564a340cab53f18fe5290ee5033704be1f Mon Sep 17 00:00:00 2001 From: Trigotometry <25544371+Trigotometry@users.noreply.github.com> Date: Sat, 20 Oct 2018 02:40:46 +1100 Subject: Keymap: Trigotometry's Preonic (#4158) * adding my keymap * updated pull request comments from dashna, including redundancies and DVORAK entirely * changed over visual representation to use 'LAYOUT_preonic_grid()' * added a ReadMe and commented out AUDIO_ENABLED related stuff in keymap.c until I can align with current QMK standards * Update readme.md * readme corrections and adjustments --- keyboards/preonic/keymaps/trigotometry/config.h | 8 ++ keyboards/preonic/keymaps/trigotometry/keymap.c | 165 +++++++++++++++++++++++ keyboards/preonic/keymaps/trigotometry/readme.md | 75 +++++++++++ keyboards/preonic/keymaps/trigotometry/rules.mk | 2 + 4 files changed, 250 insertions(+) create mode 100644 keyboards/preonic/keymaps/trigotometry/config.h create mode 100644 keyboards/preonic/keymaps/trigotometry/keymap.c create mode 100644 keyboards/preonic/keymaps/trigotometry/readme.md create mode 100644 keyboards/preonic/keymaps/trigotometry/rules.mk diff --git a/keyboards/preonic/keymaps/trigotometry/config.h b/keyboards/preonic/keymaps/trigotometry/config.h new file mode 100644 index 0000000000..eaf6997db1 --- /dev/null +++ b/keyboards/preonic/keymaps/trigotometry/config.h @@ -0,0 +1,8 @@ +#pragma once + +#define STARTUP_SONG SONG(PREONIC_SOUND) +#define MUSIC_MASK (keycode != KC_NO) + +#define FORCE_NKRO 1 +#define PREVENT_STUCK_MODIFIERS +#define GRAVE_ESC_GUI_OVERRIDE \ No newline at end of file diff --git a/keyboards/preonic/keymaps/trigotometry/keymap.c b/keyboards/preonic/keymaps/trigotometry/keymap.c new file mode 100644 index 0000000000..31cee4a4cd --- /dev/null +++ b/keyboards/preonic/keymaps/trigotometry/keymap.c @@ -0,0 +1,165 @@ +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +// Layer declarations +enum preonic_layers { + _QWERTY = 1, + _GAMING = 2, + _LOWER = 3, + _RAISE = 4, +}; + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + GAMING, + LOWER, + RAISE, +}; + +// QMK predefined macros +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------------------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shft | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |SFTENT| Z | X | C | V | B | N | M | , | . | / | Entr | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | Supr |Lower | Space | Raise| Left | Down | Up | Rght | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_preonic_grid( + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + SFT_ENT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, \ + XXXXXXX, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Gaming + * ,-----------------------------------------------------------------------------------. + * | Grve | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shft | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | N | M | , | . | / | Entr | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Ctrl | Alt | Alt |Lower | Space | Raise| Left | Down | Up | Rght | + * `-----------------------------------------------------------------------------------' + */ +[_GAMING] = LAYOUT_preonic_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + KC_LCTL, KC_LCTL, KC_LALT, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | * | / | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | VolD | Up | VolU | | | 7 | 8 | 9 | - | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Left | Down | Rght | | | 4 | 5 | 6 | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Prev | Play | Skip | | | 1 | 2 | 3 | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Supr | | | 0 | Home |PageDn|PageUp| End | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_preonic_grid( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_PAST, KC_PSLS, XXXXXXX, KC_DEL, \ + _______, XXXXXXX, KC_VOLD, KC_UP, KC_VOLU, XXXXXXX, XXXXXXX, KC_7, KC_8, KC_9, KC_PMNS, KC_BSPC, \ + _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, KC_4, KC_5, KC_6, KC_PPLS, XXXXXXX, \ + _______, XXXXXXX, KC_MRWD, KC_MPLY, KC_MFFD, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_PEQL, KC_ENT, \ + _______, _______, _______, KC_LGUI, _______, _______, _______, KC_0, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | \ | | | / | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | [ | { | ( | < | > | ) | } | ] | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | + | - | _ | = | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Qwerty| Game | | Reset| + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_preonic_grid( + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11 , \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, XXXXXXX, XXXXXXX, KC_PSLS, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, KC_PIPE, KC_LBRC, KC_LCBR, KC_LPRN, KC_LABK, KC_RABK, KC_RPRN, KC_RCBR, KC_RBRC, KC_PIPE, XXXXXXX, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, KC_PPLS, KC_PMNS, KC_UNDS, KC_EQL, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, QWERTY , GAMING, XXXXXXX, RESET \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + + case GAMING: + if (record->event.pressed) { + set_single_persistent_default_layer(_GAMING); + } + return false; + break; + + } + return true; +}; + +// NFI how to bring this inline with current QMK standards yet, or it's redundant and don't use it. +// #ifdef AUDIO_ENABLE +// float tone_startup[][2] = { +// {NOTE_D5, 8}, +// {NOTE_E6, 8}, +// {NOTE_D6, 8}, +// {NOTE_E5, 8} +// }; + +// void startup_user() +// { +// _delay_ms(20); // gets rid of tick +// PLAY_SONG(tone_startup); +// } +// #endif diff --git a/keyboards/preonic/keymaps/trigotometry/readme.md b/keyboards/preonic/keymaps/trigotometry/readme.md new file mode 100644 index 0000000000..aff01a22ea --- /dev/null +++ b/keyboards/preonic/keymaps/trigotometry/readme.md @@ -0,0 +1,75 @@ +# Trigotometry's v1.0 + +This layout is the confluence of the standard Preonic QWERTY layout and some of my own tweaks to make it's software as logical and straight cut as it's physical presence, at least in my eyes. Some might say there's wasted space, though possibly true, I believe in keeping it minimal and only adding what is really needed. So if, like me, you're also beginning your journey of coding and enjoy some downtime with friends on the battlefield I think you'll find this layout a stellar place to kick off your customisation. + +## Qwerty + /* Qwerty + * ,-----------------------------------------------------------------------------------. + * | GEsc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shft | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |SFTENT| Z | X | C | V | B | N | M | , | . | / | ENT | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Ctrl | Alt | Supr |Lower | Space | Raise| Left | Down | Up | Rght | + * `----------------------------------------------------------------------------------- + */ +Take note of the dual Enter keys, located where normally there'd be a pair of Shifts. I did this to ensure the alphas stayed in the same spot when compared to a staggered and standard board. My brain found it easier to switch the mods across keyboard than the relative position in the alphas, however it's easy to reverse the Enters/Shifts and you'll be back an (nearly) square one! + +Also, LEnter acts as a Shift if it's held. + + + +## Gaming + /* Gaming + * ,-----------------------------------------------------------------------------------. + * | Grve | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Shft | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shft | Z | X | C | V | B | N | M | , | . | / | Entr | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | Ctrl | Alt | Alt |Lower | Space | Raise| Left | Down | Up | Rght | + * `-----------------------------------------------------------------------------------' + */ +Honestly it's pretty standard, however I've doubled up on the important modifiers and removed the Super. It's still accessable readily by holding Lower and the key to it's left. Neato? I thought so. + + + +## Raise Layer + /* Raise + * ,-----------------------------------------------------------------------------------. + * | F12 | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | \ | | | / | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | [ | { | ( | < | > | ) | } | ] | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | + | - | _ | = | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | |Qwerty| Game | | Reset| + * `-----------------------------------------------------------------------------------' + */ +Pretty self explanatory I think. + + + +## Lower Layer + /* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | | * | / | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | VolD | Up | VolU | | | 7 | 8 | 9 | - | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | Left | Down | Rght | | | 4 | 5 | 6 | + | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | Prev | Play | Skip | | | 1 | 2 | 3 | = | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | Supr | | | 0 | Home |PageDn|PageUp| End | + * `-----------------------------------------------------------------------------------' + */ + Music controls and arrows in prime location. F1-F6 there for extra mappings when in the Gaming layer. diff --git a/keyboards/preonic/keymaps/trigotometry/rules.mk b/keyboards/preonic/keymaps/trigotometry/rules.mk new file mode 100644 index 0000000000..a6bcd56379 --- /dev/null +++ b/keyboards/preonic/keymaps/trigotometry/rules.mk @@ -0,0 +1,2 @@ +#Build Options +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -- cgit v1.2.3 From 6c6897f7789f67076ea2f3f9cfe47da814e599fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Fri, 19 Oct 2018 17:42:01 +0200 Subject: Keymap: Update whitefox/konstantin keymap (#4169) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * td_fn_ctrl_* → td_fn_rctl_* * Swap Fn and RCtrl * Change key combination for Command feature * Replace register/unregister_code call with tap_code * Add virtual desktop controls to keymap * Add/close virtual desktop on Fn+GUI tap dance --- keyboards/whitefox/keymaps/konstantin/config.h | 3 +++ keyboards/whitefox/keymaps/konstantin/keymap.c | 34 ++++++++++++++------------ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index ad40105a7c..725609b465 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -12,3 +12,6 @@ #define MOUSEKEY_TIME_TO_MAX 50 #define MOUSEKEY_WHEEL_MAX_SPEED 1 #define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#undef IS_COMMAND +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index 6998798e3c..247bc6bbff 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -2,9 +2,12 @@ #define FN MO(L_FN) #define FN_CAPS LT(L_FN, KC_CAPS) -#define FN_RCTL TD(TD_FN_RCTL) // Unused -#define RLALT TD(TD_RLALT) // Unused +#define FN_RCTL TD(TD_FN_RCTL) // Unused +#define RLALT TD(TD_RLALT) // Unused +#define DESKTOP TD(TD_DESKTOP) +#define DESKT_L LCTL(LGUI(KC_LEFT)) +#define DESKT_R LCTL(LGUI(KC_RGHT)) #define TOP LCTL(KC_HOME) #define BOTTOM LCTL(KC_END) @@ -46,8 +49,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) layer_invert(L_NUMPAD); bool num_lock = host_keyboard_leds() & 1<count & 1) { layer_on(L_FN); } if (state->count & 2) { register_code(KC_RCTL); } } -void td_fn_ctrl_reset(qk_tap_dance_state_t *state, void *user_data) +void td_fn_rctl_reset(qk_tap_dance_state_t *state, void *user_data) { if (state->count & 1) { layer_off(L_FN); } if (state->count & 2) { unregister_code(KC_RCTL); } } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_ctrl_finished, td_fn_ctrl_reset), + [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_rctl_finished, td_fn_rctl_reset), [TD_RLALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), + [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop }; const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -89,17 +93,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |---------------------------------------------------------------| * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| * |---------------------------------------------------------------| - * | LShift | Z | X | C | V | B | N | M | , | . | / | Fn | ↑ |PgD| + * | LShift | Z | X | C | V | B | N | M | , | . | / |RCtrl | ↑ |PgD| * |---------------------------------------------------------------| - * |LCtl|LGui|LAlt| Space |RAlt|RCtl| | ← | ↓ | → | + * |LCtl|LGui|LAlt| Space |RAlt| Fn | | ← | ↓ | → | * `---------------------------------------------------------------' */ [L_BASE] = LAYOUT_truefox( \ KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ 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_BSPC, KC_DEL, \ 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_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,FN, KC_UP, KC_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RCTL, KC_UP, KC_PGDN, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN, KC_LEFT,KC_DOWN,KC_RGHT \ ), /* Function layer @@ -110,17 +114,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |---------------------------------------------------------------| * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| * |---------------------------------------------------------------| - * | |MA0|MA2|MW←|MW→| | | |VoD|VoU|Mut| |PgU|Btm| + * | |MA0|MA2|MW←|MW→| | | |VoD|VoU|Mut| App |PgU|Btm| * |---------------------------------------------------------------| - * | | | | MW↓ | |Menu| |Hom|PgD|End| + * | |Dstp|Dst←| MW↓ |Dst→| | |Hom|PgD|End| * `---------------------------------------------------------------' */ [L_FN] = LAYOUT_truefox( \ _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ - _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,_______, KC_PGUP,BOTTOM, \ - _______,_______,_______, KC_WH_D, _______,KC_APP, KC_HOME,KC_PGDN,KC_END \ + _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ + _______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \ ), /* Numpad layer -- cgit v1.2.3 From efc88a0b16055dc0b2f94da8c46ea8fadeab70f4 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Oct 2018 02:43:55 +1100 Subject: Keymap: qwerty_code_friendly: use numpad layout for f-keys (#4170) --- .../ergodox/qwerty_code_friendly/keymap.c | 26 +++++++++++----------- .../ergodox/qwerty_code_friendly/readme.md | 13 ++++++----- lib/chibios-contrib | 2 +- 3 files changed, 22 insertions(+), 19 deletions(-) diff --git a/layouts/community/ergodox/qwerty_code_friendly/keymap.c b/layouts/community/ergodox/qwerty_code_friendly/keymap.c index f882d0e002..2a441be0e6 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/keymap.c +++ b/layouts/community/ergodox/qwerty_code_friendly/keymap.c @@ -403,16 +403,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, K80(L1K2), K80(L1K3), KC_TRNS, KC_TRNS, KC_TRNS ), -/* Keymap 2: Numbers, media and mouse keys +/* Keymap 2: FKeys, media & mouse keys * * .--------------------------------------------------. .--------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | | | Mute | 6 | 7 | 8 | 9 | 0 | | + * | | | | | | | | | Mute | | F10 | F11 | F12 | | | * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | | | MsUp | | |MWhlUp| |VolUp | | | | | | | + * | | | | MsUp | | |MWhlUp| |VolUp | | F7 | F8 | F9 | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | | |MsLeft|MsDown|MsRght| |------| |------| Left | Down | Up |Right | | | + * | | |MsLeft|MsDown|MsRght| |------| |------| | F4 | F5 | F6 | | | * |--------+------+------+------+------+------|MWhlDn| |VolDn |------+------+------+------+------+--------| - * | | | Rclk | Mclk | Lclk | | | | | | | | | | | + * | | | Rclk | Mclk | Lclk | | | | | | F1 | F2 | F3 | | | * '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' * | | | | | | | | | | | | * '----------------------------------' '----------------------------------' @@ -427,7 +427,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* MEDIA, MOUSE & NUMBERS */ [LAYER_MDIA] = LAYOUT_ergodox_76_or_80( /* left hand */ - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN2, KC_BTN3, KC_BTN1, KC_TRNS, KC_WH_D, @@ -436,10 +436,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { K80(L2K0), K80(L2K1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* right hand */ - KC_MUTE, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TRNS, KC_TRNS, - KC_VOLD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_MUTE, KC_TRNS, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_TRNS, + KC_VOLU, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_TRNS, KC_TRNS, + KC_TRNS, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_TRNS, + KC_VOLD, KC_TRNS, KC_F1, KC_F2, KC_F3, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MRWD, KC_MFFD, KC_MPRV, K80(L2K2), K80(L2K3), @@ -448,7 +448,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 3: Entire Words (one for each key) * * .--------------------------------------------------. .--------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | + * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| * | | Q | W | E | R | T | | | | Y | U | I | O | P | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -470,7 +470,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FKEY & WORDS */ [LAYER_FKEY] = LAYOUT_ergodox_76_or_80( /* left hand */ - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, + KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_TRNS, KC_TRNS, M_WORD_Q, M_WORD_W, M_WORD_E, M_WORD_R, M_WORD_T, KC_TRNS, KC_TRNS, M_WORD_A, M_WORD_S, M_WORD_D, M_WORD_F, M_WORD_G, KC_TRNS, M_WORD_Z, M_WORD_X, M_WORD_C, M_WORD_V, M_WORD_B, KC_TRNS, @@ -479,7 +479,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { K80(L3K0), K80(L3K1), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, /* right hand */ - KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_TRNS, + KC_TRNS, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, KC_TRNS, M_WORD_Y, M_WORD_U, M_WORD_I, M_WORD_O, M_WORD_P, KC_TRNS, M_WORD_H, M_WORD_J, M_WORD_K, M_WORD_L, KC_TRNS, KC_TRNS, KC_TRNS, M_WORD_N, M_WORD_M, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, diff --git a/layouts/community/ergodox/qwerty_code_friendly/readme.md b/layouts/community/ergodox/qwerty_code_friendly/readme.md index 8bc15dd310..23afa656f7 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/readme.md +++ b/layouts/community/ergodox/qwerty_code_friendly/readme.md @@ -131,13 +131,13 @@ Notes: ``` .--------------------------------------------------. .--------------------------------------------------. -| | 1 | 2 | 3 | 4 | 5 | | | Mute | 6 | 7 | 8 | 9 | 0 | | +| | | | | | | | | Mute | | F10 | F11 | F12 | | | |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| -| | | | MsUp | | |MWhlUp| |VolUp | | | | | | | +| | | | MsUp | | |MWhlUp| |VolUp | | F7 | F8 | F9 | | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| -| | |MsLeft|MsDown|MsRght| |------| |------| Left | Down | Up |Right | | | +| | |MsLeft|MsDown|MsRght| |------| |------| | F4 | F5 | F6 | | | |--------+------+------+------+------+------|MWhlDn| |VolDn |------+------+------+------+------+--------| -| | | Rclk | Mclk | Lclk | | | | | | | | | | | +| | | Rclk | Mclk | Lclk | | | | | | F1 | F2 | F3 | | | '--------+------+------+------+------+-------------' '-------------+------+------+------+------+--------' | | | | | | | | | | | | '----------------------------------' '----------------------------------' @@ -158,7 +158,7 @@ eg: `-DCFQ_WORD_E=\"my@email.com\"` ``` .--------------------------------------------------. .--------------------------------------------------. -| | F1 | F2 | F3 | F4 | F5 | F11 | | F12 | F6 | F7 | F8 | F9 | F10 | | +| | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| | | Q | W | E | R | T | | | | Y | U | I | O | P | | |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -179,6 +179,9 @@ eg: `-DCFQ_WORD_E=\"my@email.com\"` ## Changelog +- 2018/10/19 + Move F-Keys to numpad like layout. + - 2018/05/29 Add number keys for cases when keypad numbers are handled differently. diff --git a/lib/chibios-contrib b/lib/chibios-contrib index ede48346ee..2de67e2f4a 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit ede48346eee4b8d6847c19bc01420bee76a5e486 +Subproject commit 2de67e2f4a268eae072c5fd76a1b160124cee4f6 -- cgit v1.2.3 From 78b48371aac3bc4ba468c9f7efcb742bafb81965 Mon Sep 17 00:00:00 2001 From: Kosuke Adachi Date: Sat, 20 Oct 2018 01:12:55 +0900 Subject: Keyboard: Update logo and commonize it (#4151) * Update logo and commonize it * Move the glcdfont.c to the lib and add it to the SRC values of the rules.mk in the keymap folders * Add static --- keyboards/crkbd/keymaps/default/glcdfont.c | 244 ---------------------------- keyboards/crkbd/keymaps/default/rules.mk | 15 +- keyboards/crkbd/keymaps/drashna/glcdfont.c | 244 ---------------------------- keyboards/crkbd/keymaps/drashna/rules.mk | 15 +- keyboards/crkbd/keymaps/like_jis/glcdfont.c | 244 ---------------------------- keyboards/crkbd/keymaps/like_jis/keymap.c | 6 +- keyboards/crkbd/keymaps/like_jis/rules.mk | 15 +- keyboards/crkbd/lib/glcdfont.c | 243 +++++++++++++++++++++++++++ keyboards/crkbd/ssd1306.c | 3 +- 9 files changed, 272 insertions(+), 757 deletions(-) delete mode 100644 keyboards/crkbd/keymaps/default/glcdfont.c delete mode 100644 keyboards/crkbd/keymaps/drashna/glcdfont.c delete mode 100644 keyboards/crkbd/keymaps/like_jis/glcdfont.c create mode 100644 keyboards/crkbd/lib/glcdfont.c diff --git a/keyboards/crkbd/keymaps/default/glcdfont.c b/keyboards/crkbd/keymaps/default/glcdfont.c deleted file mode 100644 index 4e7b27bc0c..0000000000 --- a/keyboards/crkbd/keymaps/default/glcdfont.c +++ /dev/null @@ -1,244 +0,0 @@ -// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. -// See gfxfont.h for newer custom bitmap font info. - -#ifndef FONT5X7_H -#define FONT5X7_H - -#ifdef __AVR__ - #include - #include -#elif defined(ESP8266) - #include -#else - #define PROGMEM -#endif - -// Standard ASCII 5x7 font - -static const unsigned char font[] PROGMEM = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, -0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, -0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, -0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, -0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, -0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, -0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, -0x00, 0x18, 0x24, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, -0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, -0x26, 0x29, 0x79, 0x29, 0x26, 0x00, -0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, -0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, -0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, -0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, -0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, -0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, -0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, -0x60, 0x60, 0x60, 0x60, 0x60, 0x00, -0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, -0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, -0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, -0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, -0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, -0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, -0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, -0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, -0x00, 0x07, 0x00, 0x07, 0x00, 0x00, -0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, -0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, -0x23, 0x13, 0x08, 0x64, 0x62, 0x00, -0x36, 0x49, 0x56, 0x20, 0x50, 0x00, -0x00, 0x08, 0x07, 0x03, 0x00, 0x00, -0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, -0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, -0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, -0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, -0x00, 0x80, 0x70, 0x30, 0x00, 0x00, -0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -0x00, 0x00, 0x60, 0x60, 0x00, 0x00, -0x20, 0x10, 0x08, 0x04, 0x02, 0x00, -0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, -0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, -0x72, 0x49, 0x49, 0x49, 0x46, 0x00, -0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, -0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, -0x27, 0x45, 0x45, 0x45, 0x39, 0x00, -0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, -0x41, 0x21, 0x11, 0x09, 0x07, 0x00, -0x36, 0x49, 0x49, 0x49, 0x36, 0x00, -0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, -0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x00, 0x40, 0x34, 0x00, 0x00, 0x00, -0x00, 0x08, 0x14, 0x22, 0x41, 0x00, -0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -0x00, 0x41, 0x22, 0x14, 0x08, 0x00, -0x02, 0x01, 0x59, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, -0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, -0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, -0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, -0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, -0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, -0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, -0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, -0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, -0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, -0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, -0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, -0x26, 0x49, 0x49, 0x49, 0x32, 0x00, -0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, -0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, -0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, -0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, -0x63, 0x14, 0x08, 0x14, 0x63, 0x00, -0x03, 0x04, 0x78, 0x04, 0x03, 0x00, -0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, -0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, -0x02, 0x04, 0x08, 0x10, 0x20, 0x00, -0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, -0x04, 0x02, 0x01, 0x02, 0x04, 0x00, -0x40, 0x40, 0x40, 0x40, 0x40, 0x00, -0x00, 0x03, 0x07, 0x08, 0x00, 0x00, -0x20, 0x54, 0x54, 0x78, 0x40, 0x00, -0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, -0x38, 0x44, 0x44, 0x44, 0x28, 0x00, -0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, -0x38, 0x54, 0x54, 0x54, 0x18, 0x00, -0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, -0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, -0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, -0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, -0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, -0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, -0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, -0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, -0x38, 0x44, 0x44, 0x44, 0x38, 0x00, -0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, -0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, -0x48, 0x54, 0x54, 0x54, 0x24, 0x00, -0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, -0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, -0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, -0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, -0x44, 0x28, 0x10, 0x28, 0x44, 0x00, -0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, -0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, -0x00, 0x08, 0x36, 0x41, 0x00, 0x00, -0x00, 0x00, 0x77, 0x00, 0x00, 0x00, -0x00, 0x41, 0x36, 0x08, 0x00, 0x00, -0x02, 0x01, 0x02, 0x04, 0x02, 0x00, -0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0E, 0x3F, 0xFF, 0xFF, -0xFF, 0xFF, 0xFE, 0xE0, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1E, 0xBE, -0x7F, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, -0xE0, 0xC0, 0x80, 0x00, 0x0E, 0xEF, -0xDF, 0xDE, 0xBE, 0x3C, 0x38, 0x70, -0xE0, 0xDD, 0xBB, 0x7B, 0x07, 0x0E, -0x0E, 0x0C, 0x98, 0xF0, 0xE0, 0xF0, -0xF0, 0xF8, 0x78, 0x3C, 0x1C, 0x1E, -0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, -0x1F, 0xFE, 0xFE, 0xF8, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, -0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, -0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, -0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, -0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, -0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, -0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, -0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x03, -0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFE, -0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x7F, -0xFF, 0xFE, 0xFD, 0xFB, 0x1B, 0x07, -0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, -0x0B, 0x07, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, -0xF8, 0xFE, 0xFF, 0xFF, 0x1F, 0x07, -0x01, 0x01, 0x01, 0x03, 0x06, 0x06, -0x0C, 0x0C, 0x08, 0x0C, 0x0C, 0x0E, -0x07, 0x83, 0xC1, 0xE0, 0x70, 0x30, -0x18, 0x1C, 0x7C, 0xCC, 0x8C, 0xDC, -0xF8, 0xC0, 0xE0, 0xE0, 0x70, 0xB8, -0xF0, 0x60, 0x00, 0x00, 0x80, 0xC0, -0xE0, 0xF0, 0x70, 0xF8, 0xFC, 0xFC, -0x3C, 0x30, 0x38, 0xF8, 0xF8, 0xF8, -0x78, 0x00, 0x80, 0x80, 0xC0, 0xE0, -0x70, 0x38, 0x38, 0x9C, 0xDC, 0xFC, -0x7C, 0x38, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, -0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, -0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, -0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, -0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, -0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x03, 0x07, -0x1F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7E, 0x7D, 0x3B, 0x17, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x7C, -0x78, 0x70, 0x70, 0x70, 0x70, 0x70, -0x70, 0x78, 0x38, 0x18, 0x1C, 0x0E, -0x07, 0x0F, 0x1F, 0x3F, 0x3C, 0x38, -0x38, 0x18, 0x0C, 0x06, 0x03, 0x01, -0x01, 0x01, 0x01, 0x0E, 0x1F, 0x1F, -0x1C, 0x1C, 0x1E, 0x0F, 0x0F, 0x03, -0x1D, 0x0E, 0x07, 0x03, 0x01, 0x00, -0x00, 0x0E, 0x1F, 0x1F, 0x1D, 0x1E, -0x0F, 0x07, 0x03, 0x03, 0x0F, 0x1F, -0x1F, 0x19, 0x19, 0x19, 0x19, 0x0C, -0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#endif // FONT5X7_H diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk index 0edf1181f0..5ee01e89e1 100644 --- a/keyboards/crkbd/keymaps/default/rules.mk +++ b/keyboards/crkbd/keymaps/default/rules.mk @@ -4,24 +4,25 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # 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 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing # 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 you want to change the display of OLED, you need to change here -SRC += ./lib/rgb_state_reader.c \ +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ diff --git a/keyboards/crkbd/keymaps/drashna/glcdfont.c b/keyboards/crkbd/keymaps/drashna/glcdfont.c deleted file mode 100644 index 4e7b27bc0c..0000000000 --- a/keyboards/crkbd/keymaps/drashna/glcdfont.c +++ /dev/null @@ -1,244 +0,0 @@ -// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. -// See gfxfont.h for newer custom bitmap font info. - -#ifndef FONT5X7_H -#define FONT5X7_H - -#ifdef __AVR__ - #include - #include -#elif defined(ESP8266) - #include -#else - #define PROGMEM -#endif - -// Standard ASCII 5x7 font - -static const unsigned char font[] PROGMEM = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, -0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, -0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, -0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, -0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, -0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, -0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, -0x00, 0x18, 0x24, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, -0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, -0x26, 0x29, 0x79, 0x29, 0x26, 0x00, -0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, -0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, -0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, -0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, -0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, -0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, -0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, -0x60, 0x60, 0x60, 0x60, 0x60, 0x00, -0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, -0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, -0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, -0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, -0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, -0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, -0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, -0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, -0x00, 0x07, 0x00, 0x07, 0x00, 0x00, -0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, -0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, -0x23, 0x13, 0x08, 0x64, 0x62, 0x00, -0x36, 0x49, 0x56, 0x20, 0x50, 0x00, -0x00, 0x08, 0x07, 0x03, 0x00, 0x00, -0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, -0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, -0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, -0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, -0x00, 0x80, 0x70, 0x30, 0x00, 0x00, -0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -0x00, 0x00, 0x60, 0x60, 0x00, 0x00, -0x20, 0x10, 0x08, 0x04, 0x02, 0x00, -0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, -0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, -0x72, 0x49, 0x49, 0x49, 0x46, 0x00, -0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, -0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, -0x27, 0x45, 0x45, 0x45, 0x39, 0x00, -0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, -0x41, 0x21, 0x11, 0x09, 0x07, 0x00, -0x36, 0x49, 0x49, 0x49, 0x36, 0x00, -0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, -0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x00, 0x40, 0x34, 0x00, 0x00, 0x00, -0x00, 0x08, 0x14, 0x22, 0x41, 0x00, -0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -0x00, 0x41, 0x22, 0x14, 0x08, 0x00, -0x02, 0x01, 0x59, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, -0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, -0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, -0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, -0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, -0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, -0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, -0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, -0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, -0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, -0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, -0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, -0x26, 0x49, 0x49, 0x49, 0x32, 0x00, -0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, -0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, -0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, -0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, -0x63, 0x14, 0x08, 0x14, 0x63, 0x00, -0x03, 0x04, 0x78, 0x04, 0x03, 0x00, -0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, -0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, -0x02, 0x04, 0x08, 0x10, 0x20, 0x00, -0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, -0x04, 0x02, 0x01, 0x02, 0x04, 0x00, -0x40, 0x40, 0x40, 0x40, 0x40, 0x00, -0x00, 0x03, 0x07, 0x08, 0x00, 0x00, -0x20, 0x54, 0x54, 0x78, 0x40, 0x00, -0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, -0x38, 0x44, 0x44, 0x44, 0x28, 0x00, -0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, -0x38, 0x54, 0x54, 0x54, 0x18, 0x00, -0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, -0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, -0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, -0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, -0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, -0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, -0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, -0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, -0x38, 0x44, 0x44, 0x44, 0x38, 0x00, -0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, -0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, -0x48, 0x54, 0x54, 0x54, 0x24, 0x00, -0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, -0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, -0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, -0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, -0x44, 0x28, 0x10, 0x28, 0x44, 0x00, -0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, -0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, -0x00, 0x08, 0x36, 0x41, 0x00, 0x00, -0x00, 0x00, 0x77, 0x00, 0x00, 0x00, -0x00, 0x41, 0x36, 0x08, 0x00, 0x00, -0x02, 0x01, 0x02, 0x04, 0x02, 0x00, -0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0E, 0x3F, 0xFF, 0xFF, -0xFF, 0xFF, 0xFE, 0xE0, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1E, 0xBE, -0x7F, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, -0xE0, 0xC0, 0x80, 0x00, 0x0E, 0xEF, -0xDF, 0xDE, 0xBE, 0x3C, 0x38, 0x70, -0xE0, 0xDD, 0xBB, 0x7B, 0x07, 0x0E, -0x0E, 0x0C, 0x98, 0xF0, 0xE0, 0xF0, -0xF0, 0xF8, 0x78, 0x3C, 0x1C, 0x1E, -0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, -0x1F, 0xFE, 0xFE, 0xF8, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, -0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, -0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, -0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, -0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, -0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, -0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, -0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x03, -0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFE, -0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x7F, -0xFF, 0xFE, 0xFD, 0xFB, 0x1B, 0x07, -0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, -0x0B, 0x07, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, -0xF8, 0xFE, 0xFF, 0xFF, 0x1F, 0x07, -0x01, 0x01, 0x01, 0x03, 0x06, 0x06, -0x0C, 0x0C, 0x08, 0x0C, 0x0C, 0x0E, -0x07, 0x83, 0xC1, 0xE0, 0x70, 0x30, -0x18, 0x1C, 0x7C, 0xCC, 0x8C, 0xDC, -0xF8, 0xC0, 0xE0, 0xE0, 0x70, 0xB8, -0xF0, 0x60, 0x00, 0x00, 0x80, 0xC0, -0xE0, 0xF0, 0x70, 0xF8, 0xFC, 0xFC, -0x3C, 0x30, 0x38, 0xF8, 0xF8, 0xF8, -0x78, 0x00, 0x80, 0x80, 0xC0, 0xE0, -0x70, 0x38, 0x38, 0x9C, 0xDC, 0xFC, -0x7C, 0x38, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, -0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, -0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, -0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, -0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, -0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x03, 0x07, -0x1F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7E, 0x7D, 0x3B, 0x17, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x7C, -0x78, 0x70, 0x70, 0x70, 0x70, 0x70, -0x70, 0x78, 0x38, 0x18, 0x1C, 0x0E, -0x07, 0x0F, 0x1F, 0x3F, 0x3C, 0x38, -0x38, 0x18, 0x0C, 0x06, 0x03, 0x01, -0x01, 0x01, 0x01, 0x0E, 0x1F, 0x1F, -0x1C, 0x1C, 0x1E, 0x0F, 0x0F, 0x03, -0x1D, 0x0E, 0x07, 0x03, 0x01, 0x00, -0x00, 0x0E, 0x1F, 0x1F, 0x1D, 0x1E, -0x0F, 0x07, 0x03, 0x03, 0x0F, 0x1F, -0x1F, 0x19, 0x19, 0x19, 0x19, 0x0C, -0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#endif // FONT5X7_H diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index f490aa2ea8..8fca704489 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -4,24 +4,25 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 +COMMAND_ENABLE = no # 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 controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing # 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 you want to change the display of OLED, you need to change here -SRC += ./lib/rgb_state_reader.c \ +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ diff --git a/keyboards/crkbd/keymaps/like_jis/glcdfont.c b/keyboards/crkbd/keymaps/like_jis/glcdfont.c deleted file mode 100644 index 4e7b27bc0c..0000000000 --- a/keyboards/crkbd/keymaps/like_jis/glcdfont.c +++ /dev/null @@ -1,244 +0,0 @@ -// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. -// See gfxfont.h for newer custom bitmap font info. - -#ifndef FONT5X7_H -#define FONT5X7_H - -#ifdef __AVR__ - #include - #include -#elif defined(ESP8266) - #include -#else - #define PROGMEM -#endif - -// Standard ASCII 5x7 font - -static const unsigned char font[] PROGMEM = { -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, -0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, -0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, -0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, -0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, -0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, -0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, -0x00, 0x18, 0x24, 0x18, 0x00, 0x00, -0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, -0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, -0x26, 0x29, 0x79, 0x29, 0x26, 0x00, -0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, -0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, -0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, -0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, -0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, -0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, -0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, -0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, -0x60, 0x60, 0x60, 0x60, 0x60, 0x00, -0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, -0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, -0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, -0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, -0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, -0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, -0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, -0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, -0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, -0x00, 0x07, 0x00, 0x07, 0x00, 0x00, -0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, -0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, -0x23, 0x13, 0x08, 0x64, 0x62, 0x00, -0x36, 0x49, 0x56, 0x20, 0x50, 0x00, -0x00, 0x08, 0x07, 0x03, 0x00, 0x00, -0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, -0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, -0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, -0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, -0x00, 0x80, 0x70, 0x30, 0x00, 0x00, -0x08, 0x08, 0x08, 0x08, 0x08, 0x00, -0x00, 0x00, 0x60, 0x60, 0x00, 0x00, -0x20, 0x10, 0x08, 0x04, 0x02, 0x00, -0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, -0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, -0x72, 0x49, 0x49, 0x49, 0x46, 0x00, -0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, -0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, -0x27, 0x45, 0x45, 0x45, 0x39, 0x00, -0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, -0x41, 0x21, 0x11, 0x09, 0x07, 0x00, -0x36, 0x49, 0x49, 0x49, 0x36, 0x00, -0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, -0x00, 0x00, 0x14, 0x00, 0x00, 0x00, -0x00, 0x40, 0x34, 0x00, 0x00, 0x00, -0x00, 0x08, 0x14, 0x22, 0x41, 0x00, -0x14, 0x14, 0x14, 0x14, 0x14, 0x00, -0x00, 0x41, 0x22, 0x14, 0x08, 0x00, -0x02, 0x01, 0x59, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, -0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, -0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, -0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, -0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, -0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, -0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, -0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, -0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, -0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, -0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, -0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, -0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, -0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, -0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, -0x26, 0x49, 0x49, 0x49, 0x32, 0x00, -0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, -0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, -0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, -0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, -0x63, 0x14, 0x08, 0x14, 0x63, 0x00, -0x03, 0x04, 0x78, 0x04, 0x03, 0x00, -0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, -0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, -0x02, 0x04, 0x08, 0x10, 0x20, 0x00, -0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, -0x04, 0x02, 0x01, 0x02, 0x04, 0x00, -0x40, 0x40, 0x40, 0x40, 0x40, 0x00, -0x00, 0x03, 0x07, 0x08, 0x00, 0x00, -0x20, 0x54, 0x54, 0x78, 0x40, 0x00, -0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, -0x38, 0x44, 0x44, 0x44, 0x28, 0x00, -0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, -0x38, 0x54, 0x54, 0x54, 0x18, 0x00, -0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, -0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, -0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, -0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, -0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, -0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, -0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, -0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, -0x38, 0x44, 0x44, 0x44, 0x38, 0x00, -0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, -0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, -0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, -0x48, 0x54, 0x54, 0x54, 0x24, 0x00, -0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, -0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, -0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, -0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, -0x44, 0x28, 0x10, 0x28, 0x44, 0x00, -0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, -0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, -0x00, 0x08, 0x36, 0x41, 0x00, 0x00, -0x00, 0x00, 0x77, 0x00, 0x00, 0x00, -0x00, 0x41, 0x36, 0x08, 0x00, 0x00, -0x02, 0x01, 0x02, 0x04, 0x02, 0x00, -0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x0E, 0x3F, 0xFF, 0xFF, -0xFF, 0xFF, 0xFE, 0xE0, 0x80, 0x00, -0x00, 0x00, 0x00, 0x00, 0x1E, 0xBE, -0x7F, 0xFF, 0xFF, 0xFE, 0xFE, 0xF0, -0xE0, 0xC0, 0x80, 0x00, 0x0E, 0xEF, -0xDF, 0xDE, 0xBE, 0x3C, 0x38, 0x70, -0xE0, 0xDD, 0xBB, 0x7B, 0x07, 0x0E, -0x0E, 0x0C, 0x98, 0xF0, 0xE0, 0xF0, -0xF0, 0xF8, 0x78, 0x3C, 0x1C, 0x1E, -0x0E, 0x0E, 0x0F, 0x0F, 0x0F, 0x0F, -0x1F, 0xFE, 0xFE, 0xF8, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, -0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, -0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, -0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, -0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, -0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, -0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, -0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x01, 0x03, -0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFE, -0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x7F, -0xFF, 0xFE, 0xFD, 0xFB, 0x1B, 0x07, -0x07, 0x0F, 0x1F, 0x1F, 0x1E, 0x1D, -0x0B, 0x07, 0x01, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, -0xF8, 0xFE, 0xFF, 0xFF, 0x1F, 0x07, -0x01, 0x01, 0x01, 0x03, 0x06, 0x06, -0x0C, 0x0C, 0x08, 0x0C, 0x0C, 0x0E, -0x07, 0x83, 0xC1, 0xE0, 0x70, 0x30, -0x18, 0x1C, 0x7C, 0xCC, 0x8C, 0xDC, -0xF8, 0xC0, 0xE0, 0xE0, 0x70, 0xB8, -0xF0, 0x60, 0x00, 0x00, 0x80, 0xC0, -0xE0, 0xF0, 0x70, 0xF8, 0xFC, 0xFC, -0x3C, 0x30, 0x38, 0xF8, 0xF8, 0xF8, -0x78, 0x00, 0x80, 0x80, 0xC0, 0xE0, -0x70, 0x38, 0x38, 0x9C, 0xDC, 0xFC, -0x7C, 0x38, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, -0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, -0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, -0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, -0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, -0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, -0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x01, 0x03, 0x07, -0x1F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, -0x7E, 0x7D, 0x3B, 0x17, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x07, -0x0F, 0x1F, 0x3F, 0x3F, 0x7E, 0x7C, -0x78, 0x70, 0x70, 0x70, 0x70, 0x70, -0x70, 0x78, 0x38, 0x18, 0x1C, 0x0E, -0x07, 0x0F, 0x1F, 0x3F, 0x3C, 0x38, -0x38, 0x18, 0x0C, 0x06, 0x03, 0x01, -0x01, 0x01, 0x01, 0x0E, 0x1F, 0x1F, -0x1C, 0x1C, 0x1E, 0x0F, 0x0F, 0x03, -0x1D, 0x0E, 0x07, 0x03, 0x01, 0x00, -0x00, 0x0E, 0x1F, 0x1F, 0x1D, 0x1E, -0x0F, 0x07, 0x03, 0x03, 0x0F, 0x1F, -0x1F, 0x19, 0x19, 0x19, 0x19, 0x0C, -0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; -#endif // FONT5X7_H diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 90e5b7ec17..05d31845c8 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { int RGB_current_mode; // Setting ADJUST layer RGB back to default -inline void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { +static inline void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { layer_on(layer3); } else { @@ -155,7 +155,7 @@ void matrix_scan_user(void) { iota_gfx_task(); } -inline void matrix_render_user(struct CharacterMatrix *matrix) { +static inline void matrix_render_user(struct CharacterMatrix *matrix) { if (is_master) { // If you want to change the display of OLED, you need to change here matrix_write_ln(matrix, read_layer_state()); @@ -171,7 +171,7 @@ inline void matrix_render_user(struct CharacterMatrix *matrix) { } } -inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { +static inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { memcpy(dest->display, source->display, sizeof(dest->display)); dest->dirty = true; diff --git a/keyboards/crkbd/keymaps/like_jis/rules.mk b/keyboards/crkbd/keymaps/like_jis/rules.mk index 0edf1181f0..5ee01e89e1 100644 --- a/keyboards/crkbd/keymaps/like_jis/rules.mk +++ b/keyboards/crkbd/keymaps/like_jis/rules.mk @@ -4,24 +4,25 @@ # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = no # 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 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +SWAP_HANDS_ENABLE = no # Enable one-hand typing # 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 you want to change the display of OLED, you need to change here -SRC += ./lib/rgb_state_reader.c \ +SRC += ./lib/glcdfont.c \ + ./lib/rgb_state_reader.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ diff --git a/keyboards/crkbd/lib/glcdfont.c b/keyboards/crkbd/lib/glcdfont.c new file mode 100644 index 0000000000..f7567c57c6 --- /dev/null +++ b/keyboards/crkbd/lib/glcdfont.c @@ -0,0 +1,243 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font +const unsigned char font[] PROGMEM = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, +0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, +0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, +0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, +0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, +0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, +0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, +0x00, 0x18, 0x24, 0x18, 0x00, 0x00, +0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, +0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, +0x26, 0x29, 0x79, 0x29, 0x26, 0x00, +0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, +0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, +0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, +0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, +0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, +0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, +0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, +0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, +0x60, 0x60, 0x60, 0x60, 0x60, 0x00, +0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, +0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, +0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, +0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, +0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, +0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, +0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, +0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, +0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, +0x00, 0x07, 0x00, 0x07, 0x00, 0x00, +0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, +0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, +0x23, 0x13, 0x08, 0x64, 0x62, 0x00, +0x36, 0x49, 0x56, 0x20, 0x50, 0x00, +0x00, 0x08, 0x07, 0x03, 0x00, 0x00, +0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, +0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, +0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, +0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, +0x00, 0x80, 0x70, 0x30, 0x00, 0x00, +0x08, 0x08, 0x08, 0x08, 0x08, 0x00, +0x00, 0x00, 0x60, 0x60, 0x00, 0x00, +0x20, 0x10, 0x08, 0x04, 0x02, 0x00, +0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, +0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, +0x72, 0x49, 0x49, 0x49, 0x46, 0x00, +0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, +0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, +0x27, 0x45, 0x45, 0x45, 0x39, 0x00, +0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, +0x41, 0x21, 0x11, 0x09, 0x07, 0x00, +0x36, 0x49, 0x49, 0x49, 0x36, 0x00, +0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, +0x00, 0x00, 0x14, 0x00, 0x00, 0x00, +0x00, 0x40, 0x34, 0x00, 0x00, 0x00, +0x00, 0x08, 0x14, 0x22, 0x41, 0x00, +0x14, 0x14, 0x14, 0x14, 0x14, 0x00, +0x00, 0x41, 0x22, 0x14, 0x08, 0x00, +0x02, 0x01, 0x59, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, +0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, +0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, +0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, +0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, +0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, +0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, +0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, +0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, +0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, +0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, +0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, +0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, +0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, +0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, +0x26, 0x49, 0x49, 0x49, 0x32, 0x00, +0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, +0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, +0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, +0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, +0x63, 0x14, 0x08, 0x14, 0x63, 0x00, +0x03, 0x04, 0x78, 0x04, 0x03, 0x00, +0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, +0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, +0x02, 0x04, 0x08, 0x10, 0x20, 0x00, +0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, +0x04, 0x02, 0x01, 0x02, 0x04, 0x00, +0x40, 0x40, 0x40, 0x40, 0x40, 0x00, +0x00, 0x03, 0x07, 0x08, 0x00, 0x00, +0x20, 0x54, 0x54, 0x78, 0x40, 0x00, +0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, +0x38, 0x44, 0x44, 0x44, 0x28, 0x00, +0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, +0x38, 0x54, 0x54, 0x54, 0x18, 0x00, +0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, +0x18, 0x24, 0x24, 0x1C, 0x78, 0x00, +0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, +0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, +0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, +0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, +0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, +0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, +0x38, 0x44, 0x44, 0x44, 0x38, 0x00, +0x7C, 0x18, 0x24, 0x24, 0x18, 0x00, +0x18, 0x24, 0x24, 0x18, 0x7C, 0x00, +0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, +0x48, 0x54, 0x54, 0x54, 0x24, 0x00, +0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, +0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, +0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, +0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, +0x44, 0x28, 0x10, 0x28, 0x44, 0x00, +0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, +0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, +0x00, 0x08, 0x36, 0x41, 0x00, 0x00, +0x00, 0x00, 0x77, 0x00, 0x00, 0x00, +0x00, 0x41, 0x36, 0x08, 0x00, 0x00, +0x02, 0x01, 0x02, 0x04, 0x02, 0x00, +0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, +0xF0, 0xF8, 0xF8, 0x18, 0x00, 0xC0, +0xF0, 0xFC, 0xFE, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, +0x80, 0xC0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0xE0, 0xE0, 0xC0, +0xC0, 0xE0, 0xE0, 0xE0, 0xE0, 0x00, +0x00, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, +0xE0, 0xE0, 0xE0, 0xE0, 0xC0, 0x80, +0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, +0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, +0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, +0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, +0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, +0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, +0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, +0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, +0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, +0xFF, 0xE0, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x1F, 0x07, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x81, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x81, +0xC3, 0xC3, 0xC3, 0x00, 0x00, 0xFF, +0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x81, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0x01, 0x00, +0x00, 0x00, 0x00, 0x01, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0x9D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, +0x1C, 0x9D, 0xDF, 0xDF, 0xDF, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, +0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, +0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, +0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, +0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, +0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, +0x3F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, +0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x3F, +0x3F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, +0x7F, 0x7C, 0x78, 0x78, 0x38, 0x1C, +0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x03, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x03, 0x01, 0x00, 0x00, 0x00, 0x00, +0x01, 0x03, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x07, 0x07, 0x03, 0x01, +0x00, 0x00, 0x00, 0x07, 0x07, 0x07, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x07, 0x07, 0x07, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x07, 0x07, +0x07, 0x00, 0x00, 0x00, 0x01, 0x03, +0x07, 0x07, 0x07, 0x07, 0x07, 0x07, +0x07, 0x07, 0x03, 0x01, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +}; +#endif // FONT5X7_H diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index b8f9512e3f..205ce67a9e 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -4,7 +4,6 @@ #include "i2c.h" #include #include "print.h" -#include "glcdfont.c" #ifdef ADAFRUIT_BLE_ENABLE #include "adafruit_ble.h" #endif @@ -14,6 +13,8 @@ #include "sendchar.h" #include "timer.h" +static const unsigned char font[] PROGMEM; + // Set this to 1 to help diagnose early startup problems // when testing power-on with ble. Turn it off otherwise, // as the latency of printing most of the debug info messes -- cgit v1.2.3 From 9ca73a9edcb8cfaeba13baae16b8c8cc5c9fafe6 Mon Sep 17 00:00:00 2001 From: Andy Date: Fri, 19 Oct 2018 19:57:44 +0200 Subject: Keymap: Add dz60 iso-de layout (#4173) --- keyboards/dz60/keymaps/iso_de_andys8/README.md | 3 ++ keyboards/dz60/keymaps/iso_de_andys8/keymap.c | 38 ++++++++++++++++++++++++++ keyboards/dz60/keymaps/iso_de_andys8/rules.mk | 15 ++++++++++ 3 files changed, 56 insertions(+) create mode 100644 keyboards/dz60/keymaps/iso_de_andys8/README.md create mode 100644 keyboards/dz60/keymaps/iso_de_andys8/keymap.c create mode 100644 keyboards/dz60/keymaps/iso_de_andys8/rules.mk diff --git a/keyboards/dz60/keymaps/iso_de_andys8/README.md b/keyboards/dz60/keymaps/iso_de_andys8/README.md new file mode 100644 index 0000000000..504726adf5 --- /dev/null +++ b/keyboards/dz60/keymaps/iso_de_andys8/README.md @@ -0,0 +1,3 @@ +# ISO DE layout + +This layout is ISO-DE and similar to a standard 60 ISO layout. There are vim style arrow keys on the function layer. The bottom right is the expected default. diff --git a/keyboards/dz60/keymaps/iso_de_andys8/keymap.c b/keyboards/dz60/keymaps/iso_de_andys8/keymap.c new file mode 100644 index 0000000000..3039914c6f --- /dev/null +++ b/keyboards/dz60/keymaps/iso_de_andys8/keymap.c @@ -0,0 +1,38 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* ISO 60 layout by andys8 (ISO German keyboard layout shown) + * + * This layout starts from a standard ISO 60% layout, and adds a function layer. + * + * ,-----------------------------------------------------------------------------------------. + * | Esc | 1 ! | 2 " | 3 § | 4 $ | 5 % | 6 & | 7 / | 8 ( | 9 ) | 0 = | ß ? | ´ ` | Backspace | + * |-----------------------------------------------------------------------------------------| + * | Tab | Q | W | E | R | T | Z | U | I | O | P | Ä | + * | Enter | + * |---------------------------------------------------------------------------------- | + * | Layer_1 | A | S | D | F | G | H | J | K | L | Ö | Ü | # ' | | + * |-----------------------------------------------------------------------------------------| + * | Shift | < > | Y | X | C | V | B | N | M | , ; | . : | - _ | Shift | + * |-----------------------------------------------------------------------------------------| + * | LCtl | LGUI | LAlt | Space | RAlt | RGUI | App | RCtl | + * `-----------------------------------------------------------------------------------------' + */ + LAYOUT_60_iso( + KC_ESC, 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_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, + MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_BSLS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + ), + + + LAYOUT_60_iso( + KC_GRV, 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_DEL, + KC_NO, KC_NO, KC_NO, KC_NO, RESET, KC_NO, KC_HOME, KC_PGDN, KC_PGUP, KC_END, KC_PSCR, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, KC_DEL, KC_NO, KC_NO, + KC_LSFT, BL_TOGG, KC_APP, KC_PAUS, KC_INS, KC_NO, KC_MPLY, KC_MSTP, KC_MUTE, KC_VOLD, KC_VOLU, KC_NO, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + +}; diff --git a/keyboards/dz60/keymaps/iso_de_andys8/rules.mk b/keyboards/dz60/keymaps/iso_de_andys8/rules.mk new file mode 100644 index 0000000000..b5f45d7aa8 --- /dev/null +++ b/keyboards/dz60/keymaps/iso_de_andys8/rules.mk @@ -0,0 +1,15 @@ +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +AUTO_SHIFT_ENABLE = no # If the time depressed is greater than or equal to the AUTO_SHIFT_TIMEOUT, then a shifted version of the key is emitted. If the time is less than the AUTO_SHIFT_TIMEOUT time, then the normal state is emitted +TAP_DANCE_ENABLE = no -- cgit v1.2.3 From 6f6d28fa8d81063691d2fd11540675eaa5b6989c Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Fri, 19 Oct 2018 11:01:40 -0700 Subject: Big Switch and 5x5 edits (#4168) * 4x4 - pro micro version * pro-micro setup on 4x4 * tap dance LCTL/RESET key * remove test file * more research * revert a couple un-intended edits * opt_defs version of adding custom rules.mk variables * cleanup * cleanup * cleanup * cleanup * layout edits * layout edits * keymap edit * numpad layout change * got tap dance layer-switch working * keymap changes * temporary revert * restore previous settings * misc fixes * layer order change * fix layout matrix * Update tapdances.c * playing around with triple tap dance * sync with upstream * quick edit * tapdance cleanup * mod tap interrupt * tapping term edit * tapping term adjust * 5x5 board edits * set gherkin tapping term * big switch tap dance edit * tapping term refinements * 5x10 layout setup * add audio for bigswitch * keymap change * keymap change & created testing board * sound setup for big_switch * more big switch size testing * bigswitch testing finished * final touch-ups --- keyboards/5x5/5x5.h | 4 +- keyboards/bigswitch/bigswitch.c | 2 + keyboards/bigswitch/keymaps/wanleg/config.h | 11 +- keyboards/bigswitch/keymaps/wanleg/keymap.c | 9 +- keyboards/bigswitch/keymaps/wanleg/rules.mk | 15 +- layouts/community/ortho_3x10/wanleg/readme.md | 9 +- layouts/community/ortho_5x10/wanleg/config.h | 9 - layouts/community/ortho_5x10/wanleg/keymap.c | 38 ---- layouts/community/ortho_5x10/wanleg/rules.mk | 3 - layouts/community/ortho_5x15/wanleg/config.h | 11 +- layouts/community/ortho_5x15/wanleg/keymap.c | 89 ++++++++-- layouts/community/ortho_5x5/layout.json | 1 + layouts/community/ortho_5x5/readme.md | 3 + users/wanleg/config.h | 18 +- users/wanleg/rules.mk | 4 +- users/wanleg/tapdances.c | 246 ++++++++++++++------------ users/wanleg/wanleg.c | 6 + users/wanleg/wanleg.h | 39 +++- 18 files changed, 305 insertions(+), 212 deletions(-) delete mode 100644 layouts/community/ortho_5x10/wanleg/config.h delete mode 100644 layouts/community/ortho_5x10/wanleg/keymap.c delete mode 100644 layouts/community/ortho_5x10/wanleg/rules.mk create mode 100644 layouts/community/ortho_5x5/layout.json create mode 100644 layouts/community/ortho_5x5/readme.md diff --git a/keyboards/5x5/5x5.h b/keyboards/5x5/5x5.h index cbfc28a901..45fb80a4f7 100644 --- a/keyboards/5x5/5x5.h +++ b/keyboards/5x5/5x5.h @@ -35,7 +35,7 @@ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ } @@ -50,7 +50,7 @@ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ } diff --git a/keyboards/bigswitch/bigswitch.c b/keyboards/bigswitch/bigswitch.c index b924c7017c..32f9f7fab8 100644 --- a/keyboards/bigswitch/bigswitch.c +++ b/keyboards/bigswitch/bigswitch.c @@ -26,10 +26,12 @@ void matrix_init_user(void) { __attribute__ ((weak)) void matrix_scan_user(void) { +#if defined(RGBLIGHT_ENABLE) if (runonce && timer_elapsed(my_timer) > 1000) { runonce = false; rgblight_sethsv_noeeprom(0x0, 0xff, 0x80); rgblight_mode_noeeprom(9); rgblight_enable_noeeprom(); } +#endif } diff --git a/keyboards/bigswitch/keymaps/wanleg/config.h b/keyboards/bigswitch/keymaps/wanleg/config.h index f1e1693457..8ac82f40d9 100644 --- a/keyboards/bigswitch/keymaps/wanleg/config.h +++ b/keyboards/bigswitch/keymaps/wanleg/config.h @@ -21,7 +21,6 @@ #define MATRIX_ROW_PINS { B4 } #undef MATRIX_COL_PINS #define MATRIX_COL_PINS { B6 } -//#define UNUSED_PINS /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #undef DIODE_DIRECTION @@ -32,14 +31,12 @@ #define BACKLIGHT_LEVELS 3 #define BREATHING_PERIOD 5 -/* for Tap Dance */ -#undef TAPPING_TERM -#define TAPPING_TERM 700 - /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -//#define DEBOUNCING_DELAY 5 #undef DEBOUNCING_DELAY -#define DEBOUNCING_DELAY 2 +#define DEBOUNCING_DELAY 5 // set flashing LED with QMK DFU #define QMK_LED B0 + +// set audio pin +#define C6_AUDIO diff --git a/keyboards/bigswitch/keymaps/wanleg/keymap.c b/keyboards/bigswitch/keymaps/wanleg/keymap.c index 7f4150e581..76d0808fda 100644 --- a/keyboards/bigswitch/keymaps/wanleg/keymap.c +++ b/keyboards/bigswitch/keymaps/wanleg/keymap.c @@ -20,8 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Base */ TD(CAD_TD) \ ), -}; - -void led_set_user(uint8_t usb_led) { - -} +[1] = LAYOUT( /*Secondary*/ +TD(BSW_TAP_DANCE) \ +), +}; \ No newline at end of file diff --git a/keyboards/bigswitch/keymaps/wanleg/rules.mk b/keyboards/bigswitch/keymaps/wanleg/rules.mk index bc4a1873f8..a6c7d1d3f0 100644 --- a/keyboards/bigswitch/keymaps/wanleg/rules.mk +++ b/keyboards/bigswitch/keymaps/wanleg/rules.mk @@ -1,7 +1,16 @@ -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default - #If using a ProMicro and it has the QMK DFU bootloader instead of Caterina, #run "make : dfu=qmk" when compiling to ensure it is flagged properly after being flashed ifeq ($(strip $(dfu)), qmk) BOOTLOADER = qmk-dfu -endif \ No newline at end of file +endif + +AUDIO_ENABLE = yes # Audio output on port C6 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +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 +FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) \ No newline at end of file diff --git a/layouts/community/ortho_3x10/wanleg/readme.md b/layouts/community/ortho_3x10/wanleg/readme.md index ef6c1f9dbb..8696cccf6b 100644 --- a/layouts/community/ortho_3x10/wanleg/readme.md +++ b/layouts/community/ortho_3x10/wanleg/readme.md @@ -1,13 +1,10 @@ ![Gherkin Wanleg Layout Image](https://i.imgur.com/nCPog2W.png) # Gherkin Wanleg Layout This is the layout I came up with to preserve a standard QWERTY 104 key ANSI layout as much as possible, in as few layers as possible for a 30 key board. -I originally set up a few Tap Dance keys, but dropped half of them in favor of chorded versions since in actual use, they tended to impede typing speed more than their current two-key versions. -I've left them in my `keymap.c` ready for use if anyone wants to try them out: +Here are the two Tap Dance keys I've set up for this board: -Legend Name | Single Tap | Double Tap | Hold ---- | --- | --- | --- -*null* | space | enter | shift -*null* | backspace | delete | control +Legend Name | Single Tap | Double Tap | Hold +--- | --- | --- | --- Sft//Cp | shift | caps lock | *null* Q//Esc | KC_Q | escape | *null* diff --git a/layouts/community/ortho_5x10/wanleg/config.h b/layouts/community/ortho_5x10/wanleg/config.h deleted file mode 100644 index 2d24f2771b..0000000000 --- a/layouts/community/ortho_5x10/wanleg/config.h +++ /dev/null @@ -1,9 +0,0 @@ -#pragma once - -//QMK DFU settings (ProMicro boards) -// set top left key as bootloader mode escape key on Gherkin -#if defined(KEYBOARD_5x5) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT D7 // usually COL -#define QMK_ESC_INPUT B2 // usually ROW -#endif diff --git a/layouts/community/ortho_5x10/wanleg/keymap.c b/layouts/community/ortho_5x10/wanleg/keymap.c deleted file mode 100644 index 5d06e53ae4..0000000000 --- a/layouts/community/ortho_5x10/wanleg/keymap.c +++ /dev/null @@ -1,38 +0,0 @@ -#include QMK_KEYBOARD_H -#include "wanleg.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[gGK] = LAYOUT_ortho_5x10_wrapper( - _______________Gherkin_NUM_0_______________, - _______________Gherkin_Row_0_______________, - _______________Gherkin_Row_1_______________, - _______________Gherkin_Row_2_______________, - _______, _______, _______, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, _______, _______ -), - - -[gNUM] = LAYOUT_ortho_5x10_wrapper( - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________, - _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ -), - -[gDIR] = LAYOUT_ortho_5x10_wrapper( - _______________Gherkin_NUM_0_______________, - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -[gETC] = LAYOUT_ortho_5x10_wrapper( - _______________Gherkin_NUM_0_______________, - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________, - _______, _______, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ -), - -}; diff --git a/layouts/community/ortho_5x10/wanleg/rules.mk b/layouts/community/ortho_5x10/wanleg/rules.mk deleted file mode 100644 index 90841d2abe..0000000000 --- a/layouts/community/ortho_5x10/wanleg/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -SWAP_HANDS_ENABLE = no - -BOOTLOADER = qmk-dfu \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h index a55fc6a3eb..1043986f7a 100644 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -1,3 +1,8 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H -#endif +#pragma once + +// set top left key as bootloader mode escape key on 5x5 75key layout +#if defined(KEYBOARD_5x5) && !defined(PRO_MICRO) +#define QMK_LED B0 +#define QMK_ESC_OUTPUT D7 // usually COL +#define QMK_ESC_INPUT B2 // usually ROW +#endif \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index 7731edb6a2..df74241157 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -2,30 +2,36 @@ #include "wanleg.h" #define _________________BLANK_75__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +#define _________________BLANK_50__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ #define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* QWERTY 75 - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| gherkin| | FN | - * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| - * | | 7 | 8 | 9 | - * | |--------+--------+--------| - * | 4x12 QWERTY LAYOUT | 4 | 5 | 6 | - * | |--------+--------+--------| - * | | 1 | 2 | 3 | - * | |--------+--------+--------| - * | | 0 | 0 | . | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ -[QW75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, GHERKIN75, XXXXXXX, FUNCTION75, - _______________Qwerty_Row__0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________Qwerty_Row__1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - _______________Qwerty_Row__2_______________, KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER75, KC_LSFT, KC_SPC, SUPRA75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +#if defined(KEYBOARD_5x5) +[GK75] = LAYOUT_ortho_5x15_wrapper( + _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, + _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, + _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, + TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, + TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +), + +[PAD] = LAYOUT_ortho_5x5_wrapper( + _______, _______, _______, _______, _______, + _______________NUMPAD_Row__0_______________, _______, + _______________NUMPAD_Row__1_______________, _______, + _______________NUMPAD_Row__2_______________, _______, + KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ +), + +[GK50] = LAYOUT_ortho_5x10_wrapper( + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, + _______________Gherkin_Row_0_______________, + _______________Gherkin_Row_1_______________, + _______________Gherkin_Row_2_______________, + TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI ), +#else /* Gherkin 75 * .--------------------------------------------------------------------------------------------------------------------------------------. * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | | FN | @@ -46,6 +52,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT ), +#endif + /* QWERTY 75 + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| gherkin| | FN | + * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| + * | | 7 | 8 | 9 | + * | |--------+--------+--------| + * | 4x12 QWERTY LAYOUT | 4 | 5 | 6 | + * | |--------+--------+--------| + * | | 1 | 2 | 3 | + * | |--------+--------+--------| + * | | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ +[QW75] = LAYOUT_ortho_5x15_wrapper( + _________________Num_Row_75________________, GHERKIN75, XXXXXXX, FUNCTION75, + _______________Qwerty_Row__0_______________, KC_KP_7, KC_KP_8, KC_KP_9, + _______________Qwerty_Row__1_______________, KC_KP_4, KC_KP_5, KC_KP_6, + _______________Qwerty_Row__2_______________, KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER75, KC_LSFT, KC_SPC, SUPRA75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +), /* SUBTER75 * .--------------------------------------------------------------------------------------------------------------------------------------. @@ -173,4 +200,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, KC_MS_U, KC_WH_D, _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), + +[gNUM] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ +), + +[gDIR] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________, + _________________BLANK_50__________________ +), + +[gETC] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ +), }; diff --git a/layouts/community/ortho_5x5/layout.json b/layouts/community/ortho_5x5/layout.json new file mode 100644 index 0000000000..ab4eef8e1b --- /dev/null +++ b/layouts/community/ortho_5x5/layout.json @@ -0,0 +1 @@ +["","","","",""],["","","","",""],["","","","",""],["","","","",""],["","","","",""] diff --git a/layouts/community/ortho_5x5/readme.md b/layouts/community/ortho_5x5/readme.md new file mode 100644 index 0000000000..3dd75765d1 --- /dev/null +++ b/layouts/community/ortho_5x5/readme.md @@ -0,0 +1,3 @@ +# ortho_5x5 + + LAYOUT_ortho_5x5 \ No newline at end of file diff --git a/users/wanleg/config.h b/users/wanleg/config.h index 28e7690e65..f2e785659f 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -2,8 +2,17 @@ #define USERSPACE_CONFIG_H //TAPPING_TERM -#ifdef TAP_DANCE_ENABLE -#define TAPPING_TERM 200 +//tapping term short (<100): on multi-purpose keys, slow taps may not register, but "holds" register easier. multi-tap keys may be difficult to activate. +//tapping term long (>200): holds don't register as easily - noticeable when typing quickly (e.g. shift doesn't want to engage.) +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) +//Kailh Coppers activate quickly and don't need a long tapping term +#define TAPPING_TERM 100 + +#elif defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_bigswitch) +#define TAPPING_TERM 700 + +#else +#define TAPPING_TERM 145 #endif //Mousekey Settings @@ -27,4 +36,9 @@ #define NO_ACTION_FUNCTION #define NO_ACTION_ONESHOT +// Disable mod tap interrrupt +#ifndef IGNORE_MOD_TAP_INTERRUPT +#define IGNORE_MOD_TAP_INTERRUPT +#endif // !mod tap interrrupt + #endif // !USERSPACE_CONFIG_H diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 5630401315..2a2a65cfea 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -9,8 +9,8 @@ ifeq ($(strip $(dfu)), qmk) BOOTLOADER = qmk-dfu endif -#use alternate settings for 4x4 board using ProMicro instead of Micro -#usage: make 4x4:wanleg PM=yes +#use alternate settings for boards using ProMicro instead of Micro +#example usage: make 4x4:wanleg PM=yes ifeq ($(strip $(PM)), yes) OPT_DEFS += -DPRO_MICRO endif diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 0778bf5f7e..3878e6d31c 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -1,6 +1,12 @@ //Tap Dance Settings #include "wanleg.h" +//audio settings for one of the tap dances below +#ifdef AUDIO_ENABLE + float lyrup_song[][2] = SONG(MUSIC_ON_SOUND); + float lyrdown_song[][2] = SONG(MUSIC_OFF_SOUND); +#endif + ///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION START ///// ///// (no need to edit this section) ///// //Enums used to clearly convey the state of the tap dance @@ -9,7 +15,10 @@ enum { SINGLE_HOLD = 2, DOUBLE_TAP = 3, DOUBLE_HOLD = 4, - DOUBLE_SINGLE_TAP = 5 //send SINGLE_TAP twice - NOT DOUBLE_TAP + DOUBLE_SINGLE_TAP = 5, //send SINGLE_TAP twice - NOT DOUBLE_TAP + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7, + TRIPLE_SINGLE_TAP = 8 // Add more enums here if you want for triple, quadruple, etc. }; @@ -32,69 +41,18 @@ int cur_dance (qk_tap_dance_state_t *state) { else if (state->pressed) return DOUBLE_HOLD; else return DOUBLE_TAP; } - else return 6; //magic number. At some point this method will expand to work for more presses -} -///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// -///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// -//instantiate 'tap' for the 'ENT' tap dance. -static tap ENTtap_state = { - .is_press_action = true, - .state = 0 -}; - -void ENT_finished (qk_tap_dance_state_t *state, void *user_data) { - ENTtap_state.state = cur_dance(state); - switch (ENTtap_state.state) { - case SINGLE_TAP: register_code(KC_SPC); break; - case SINGLE_HOLD: register_code(KC_LSFT); break; - case DOUBLE_TAP: register_code(KC_ENT); break; - case DOUBLE_HOLD: register_code(KC_NO); break; // setting double hold to do nothing (change this if you want) - case DOUBLE_SINGLE_TAP: register_code(KC_SPC); unregister_code(KC_SPC); register_code(KC_SPC); - //Last case is for fast typing. Assuming your key is `f`: - //For example, when typing the word `buffer`, and you want to make sure that you send `ff` and not `Esc`. - //In order to type `ff` when typing fast, the next character will have to be hit within the `TAPPING_TERM`, which by default is 200ms. - } -} - -void ENT_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (ENTtap_state.state) { - case SINGLE_TAP: unregister_code(KC_SPC); break; - case SINGLE_HOLD: unregister_code(KC_LSFT); break; - case DOUBLE_TAP: unregister_code(KC_ENT); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_SPC); - } - ENTtap_state.state = 0; -} - -//instantiate 'tap' for the 'DEL' tap dance. -static tap DELtap_state = { - .is_press_action = true, - .state = 0 -}; - -void DEL_finished (qk_tap_dance_state_t *state, void *user_data) { - DELtap_state.state = cur_dance(state); - switch (DELtap_state.state) { - case SINGLE_TAP: register_code(KC_BSPC); break; - case SINGLE_HOLD: register_code(KC_LCTL); break; - case DOUBLE_TAP: register_code(KC_DEL); break; - case DOUBLE_HOLD: register_code(KC_NO); break; - case DOUBLE_SINGLE_TAP: register_code(KC_BSPC); unregister_code(KC_BSPC); register_code(KC_BSPC); - } -} -void DEL_reset (qk_tap_dance_state_t *state, void *user_data) { - switch (DELtap_state.state) { - case SINGLE_TAP: unregister_code(KC_BSPC); break; - case SINGLE_HOLD: unregister_code(KC_LCTL); break; - case DOUBLE_TAP: unregister_code(KC_DEL); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_BSPC); + //If count = 3, and it has been interrupted - assume that user is trying to type the letter associated + //with double tap. + else if (state->count == 3) { + if (state->interrupted) return TRIPLE_SINGLE_TAP; + else if (state->pressed) return TRIPLE_HOLD; + else return TRIPLE_TAP; } - DELtap_state.state = 0; + else return 9; //magic number. At some point this method will expand to work for more presses } - +///// QUAD FUNCTION TAP DANCE GENERAL SETUP SECTION END ///// +///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION START ///// //instantiate 'tap' for the 'CAD' tap dance. static tap CADtap_state = { .is_press_action = true, @@ -104,14 +62,14 @@ static tap CADtap_state = { void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { CADtap_state.state = cur_dance(state); switch (CADtap_state.state) { - case SINGLE_TAP: - //register_code(KC_SPC); + case SINGLE_TAP: + //register_code(KC_SPC); SEND_STRING(SS_LGUI("l")); #ifdef BACKLIGHT_ENABLE - backlight_set(3); + backlight_level(3); #endif break; - case SINGLE_HOLD: + case SINGLE_HOLD: //register_code(KC_NO); //take a screenshot of a single window, open Paint and paste SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)) SS_LGUI("r")); @@ -120,47 +78,37 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { _delay_ms(700); SEND_STRING(SS_LCTRL("v")); break; //register this keycode when button is held - case DOUBLE_TAP: - //register_code(KC_ENT); + case DOUBLE_TAP: + //register_code(KC_ENT); SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); #ifdef BACKLIGHT_ENABLE - backlight_set(0); + backlight_level(0); #endif break; //case DOUBLE_HOLD: register_code(KC_NO); break; //register this keycode when button is tapped and then held - case DOUBLE_HOLD: - reset_keyboard(); + case DOUBLE_HOLD: + reset_keyboard(); break; //register this keycode when button is tapped and then held - case DOUBLE_SINGLE_TAP: register_code(KC_NO); unregister_code(KC_NO); register_code(KC_NO); + case TRIPLE_TAP: + SEND_STRING("wanleg@github.com"); + break; + case TRIPLE_HOLD: + set_single_persistent_default_layer(1); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(lyrup_song); + #endif + break; } } void CAD_reset (qk_tap_dance_state_t *state, void *user_data) { switch (CADtap_state.state) { - case SINGLE_TAP: - //unregister_code(KC_SPC); - SEND_STRING(SS_LGUI("l")); - #ifdef BACKLIGHT_ENABLE - backlight_set(3); - #endif - break; - case SINGLE_HOLD: - register_code(KC_NO); //(un)register this keycode when button is held and then released - //SEND_STRING(SS_LCTRL("v")); - break; - case DOUBLE_TAP: - //register_code(KC_ENT); - SEND_STRING(SS_LCTRL(SS_LALT(SS_TAP(X_DELETE)))); - #ifdef BACKLIGHT_ENABLE - backlight_set(0); - #endif - break; - case DOUBLE_HOLD: register_code(KC_NO); //(un)register this keycode when button is tapped and then held, and then released - case DOUBLE_SINGLE_TAP: unregister_code(KC_NO); +//nothing to do } CADtap_state.state = 0; -} - +} + //instantiate 'tap' for the 'RST' tap dance. static tap RSTtap_state = { .is_press_action = true, @@ -173,21 +121,18 @@ void RST_finished (qk_tap_dance_state_t *state, void *user_data) { case SINGLE_TAP: register_code(KC_LCTL); break; case SINGLE_HOLD: register_code(KC_LCTL); break; case DOUBLE_TAP: reset_keyboard(); break; - case DOUBLE_HOLD: register_code(KC_NO); break; - case DOUBLE_SINGLE_TAP: register_code(KC_LCTL); unregister_code(KC_LCTL); register_code(KC_LCTL); + case DOUBLE_SINGLE_TAP: register_code(KC_LCTL); unregister_code(KC_LCTL); register_code(KC_LCTL); break; } -} +} void RST_reset (qk_tap_dance_state_t *state, void *user_data) { switch (RSTtap_state.state) { case SINGLE_TAP: unregister_code(KC_LCTL); break; case SINGLE_HOLD: unregister_code(KC_LCTL); break; - case DOUBLE_TAP: unregister_code(KC_NO); break; - case DOUBLE_HOLD: unregister_code(KC_NO); - case DOUBLE_SINGLE_TAP: unregister_code(KC_LCTL); + case DOUBLE_SINGLE_TAP: unregister_code(KC_LCTL); break; } RSTtap_state.state = 0; -} +} //instantiate 'tap' for the 'LYR' tap dance. static tap LYRtap_state = { @@ -199,23 +144,106 @@ void LYR_finished (qk_tap_dance_state_t *state, void *user_data) { LYRtap_state.state = cur_dance(state); switch (LYRtap_state.state) { case SINGLE_TAP: register_code(KC_PSLS); break; - case SINGLE_HOLD: register_code(KC_NO); break; case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; - case DOUBLE_HOLD: register_code(KC_NO); break; case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); } -} +} void LYR_reset (qk_tap_dance_state_t *state, void *user_data) { switch (LYRtap_state.state) { case SINGLE_TAP: unregister_code(KC_PSLS); break; - case SINGLE_HOLD: unregister_code(KC_NO); break; case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; - case DOUBLE_HOLD: unregister_code(KC_NO); case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); } LYRtap_state.state = 0; -} +} + +//instantiate 'tap' for the 'LYR75' tap dance. +static tap LYR75tap_state = { + .is_press_action = true, + .state = 0 +}; + +void LYR75_finished (qk_tap_dance_state_t *state, void *user_data) { + LYR75tap_state.state = cur_dance(state); + switch (LYR75tap_state.state) { + case SINGLE_TAP: register_code(KC_PSLS); break; + case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); + } +} + +void LYR75_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (LYR75tap_state.state) { + case SINGLE_TAP: unregister_code(KC_PSLS); break; + case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); + } + LYR75tap_state.state = 0; +} + +//instantiate 'tap' for the 'LYR50' tap dance. +static tap LYR50tap_state = { + .is_press_action = true, + .state = 0 +}; + +void LYR50_finished (qk_tap_dance_state_t *state, void *user_data) { + LYR50tap_state.state = cur_dance(state); + switch (LYR75tap_state.state) { + case SINGLE_TAP: register_code(KC_PSLS); break; + case DOUBLE_TAP: set_single_persistent_default_layer(GK50); break; + case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); + } +} + +void LYR50_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (LYR50tap_state.state) { + case SINGLE_TAP: unregister_code(KC_PSLS); break; + case DOUBLE_TAP: set_single_persistent_default_layer(GK50); break; + case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); + } + LYR50tap_state.state = 0; +} + +//instantiate 'tap' for the 'BSW' tap dance. +static tap BSWtap_state = { + .is_press_action = true, + .state = 0 +}; + +void BSW_finished (qk_tap_dance_state_t *state, void *user_data) { + BSWtap_state.state = cur_dance(state); + switch (BSWtap_state.state) { + case SINGLE_TAP: register_code(KC_ENTER); break; + case SINGLE_HOLD: + set_single_persistent_default_layer(0); + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(lyrdown_song); + #endif + break; + case DOUBLE_TAP: + register_code(KC_LCTRL); + register_code(KC_C); + break; + case DOUBLE_HOLD: + reset_keyboard(); + break; //register this keycode when button is tapped and then held + } +} + +void BSW_reset (qk_tap_dance_state_t *state, void *user_data) { + switch (BSWtap_state.state) { + case SINGLE_TAP: unregister_code(KC_ENTER); break; + case DOUBLE_TAP: + unregister_code(KC_LCTRL); + unregister_code(KC_C); + break; + } + BSWtap_state.state = 0; +} + ///// QUAD FUNCTION TAP DANCE PERSONALIZATION SECTION END ///// //Tap Dance Definitions @@ -224,12 +252,12 @@ qk_tap_dance_action_t tap_dance_actions[] = { [TD_SFT_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) // Other declarations would go here, separated by commas, if you have them ,[TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) - ,[ENT_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, ENT_finished, ENT_reset) - ,[DEL_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, DEL_finished, DEL_reset) ,[RST_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, RST_finished, RST_reset) ,[CAD_TD] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, CAD_finished, CAD_reset) ,[LYR_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, LYR_finished, LYR_reset) - + ,[LYR75_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, LYR75_finished, LYR75_reset) + ,[LYR50_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, LYR50_finished, LYR50_reset) + ,[BSW_TAP_DANCE] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, BSW_finished, BSW_reset) }; //In Layer declaration, add tap dance item in place of a key code diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index f22c34ba30..4e60c422fa 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -47,6 +47,12 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; + case GHERKIN50: + if (record->event.pressed) { + set_single_persistent_default_layer(GK50); + } + return false; + break; case SUBTER: if (record->event.pressed) { layer_on(SUB); diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 65028751a9..9e0cf3ee5d 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -27,10 +27,12 @@ enum userspace_layers { ETC75, FN75, PAD, + GK50, }; #elif KEYBOARD_xd75 enum userspace_layers { GK75 = 0, + PAD, QW75, SUB75, SUP75, @@ -50,7 +52,32 @@ enum userspace_layers { gNUM, gDIR, gETC, + GK50, +}; +#elif KEYBOARD_5x5 +enum userspace_layers { + GK50 = 0, + gNUM, + gDIR, + gETC, + GK75, + QW75, + SUB75, + SUP75, + NUM75, + DIR75, + ETC75, + FN75, PAD, + gGK, + _GK, + _QW, + ONE, + SUB, + SUP, + NUM, + DIR, + ETC, }; #else enum userspace_layers { @@ -75,6 +102,7 @@ enum userspace_layers { DIR75, ETC75, FN75, + GK50, }; #endif @@ -100,6 +128,7 @@ enum userspace_custom_keycodes { ETCETERA75, FUNCTION75, NUMPAD, + GHERKIN50, }; @@ -108,11 +137,12 @@ enum userspace_custom_keycodes { enum { TD_SFT_CAPS = 0 ,TD_Q_ESC - ,ENT_TAP_DANCE - ,DEL_TAP_DANCE ,CAD_TD ,RST_TAP_DANCE ,LYR_TAP_DANCE + ,LYR50_TAP_DANCE + ,LYR75_TAP_DANCE + ,BSW_TAP_DANCE }; #endif @@ -130,6 +160,7 @@ enum { #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) #define LAYOUT_ortho_4x4_wrapper(...) LAYOUT_ortho_4x4(__VA_ARGS__) +#define LAYOUT_ortho_5x5_wrapper(...) LAYOUT_ortho_5x5(__VA_ARGS__) // Blocks for each of the major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -189,12 +220,12 @@ enum { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | Sft//Cp| | | | | C-A-D | mScrL | mScrR | ALT | DEL | + * | Sft//Cp| CAPS | | | | C-A-D | mScrL | mScrR | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ #define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS #define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT -#define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),_______, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL +#define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),KC_CAPS, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL /* Gherkin-Like * .-----------------------------------------------------------------------------------------------------------. -- cgit v1.2.3 From 0d1e0a0d972c77231062e2ff84742f168a6010a6 Mon Sep 17 00:00:00 2001 From: mcarni Date: Fri, 19 Oct 2018 21:05:34 +0200 Subject: added an ISO split spacebar layout, keymap and readme files (#4165) --- keyboards/dz60/dz60.h | 14 ++ keyboards/dz60/info.json | 4 + .../dz60/keymaps/iso_split-spacebar/README.md | 69 ++++++++ keyboards/dz60/keymaps/iso_split-spacebar/keymap.c | 193 +++++++++++++++++++++ 4 files changed, 280 insertions(+) create mode 100644 keyboards/dz60/keymaps/iso_split-spacebar/README.md create mode 100644 keyboards/dz60/keymaps/iso_split-spacebar/keymap.c diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index fac5fa32ff..36ddb7ade1 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -196,6 +196,20 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } +// iso split +#define LAYOUT_60_iso_split( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ + K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ + K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ + K400, K401, K403, K404, K406, K408, K410, K411, K413, K414 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ + { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ + { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ + { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ +} /* LAYOUT_60_iso_5x1u * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 56e3677b7a..1f621360bf 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -28,6 +28,10 @@ "LAYOUT_60_iso": { "key_count": 62, "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_iso_split": { + "key_count": 64, + "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, "LAYOUT_60_hhkb": { "key_count": 60, diff --git a/keyboards/dz60/keymaps/iso_split-spacebar/README.md b/keyboards/dz60/keymaps/iso_split-spacebar/README.md new file mode 100644 index 0000000000..7d96f2225f --- /dev/null +++ b/keyboards/dz60/keymaps/iso_split-spacebar/README.md @@ -0,0 +1,69 @@ +# iso layout with a split spacebar + +i needed to have an ISO layout +and i wanted to have a split spacebar +i couldn't find anything ready so i cobbled this together + + + +---- Layer 0 - BL +this is basically the standard iso layout with the addition of the split spacebar +menu key (KC_APP) is used to move to the next layer +the key in between the two spacebars is the function key + *,-----------------------------------------------------------. + *| ' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Backsp | + *|-----------------------------------------------------------| + *| Tab | q | w | e | r | t | y | u | i | o | p | [ | ] |enter| + *|------------------------------------------------------ | + *| Caps | a | s | d | f | g | h | j | k | l | ; | ' | # | | + *|-----------------------------------------------------------| + *|Shft| < | z | x | c | v | b | n | m | , | . | / | Shift | + *|-----------------------------------------------------------| + *|Ctrl|Gui |Alt | Space | FN | Space |Alt |Gui | NL |Ctrl | + *`-----------------------------------------------------------' + +---- Layer 1 - FL +quite standard function layer +arrow keys and mouse movement/buttons on the home row + *,-----------------------------------------------------------. + *|ESC|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + *|-----------------------------------------------------------| + *| | | | | | | | | | |prt| | | | + *|------------------------------------------------------ | + *| |m l|m d|m u|m r| | | l | d | u | r | | | | + *|-----------------------------------------------------------| + *| | | | | |mb1|mb2| |hm |pgd|pgu|end| | + *|-----------------------------------------------------------| + *| | | | | | | | | | | + *`-----------------------------------------------------------' + +---- Layer 2 - NL +numbers numbers numbers... +first key (top left) to return to BL +menu key (KC_APP) is used to move to the next layer + *,-----------------------------------------------------------. + *|BL | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + *|-----------------------------------------------------------| + *| | 4 | 5 | 6 | * | / | | 4 | 5 | 6 | * | / | ] | | + *|------------------------------------------------------ | + *| | 7 | 8 | 9 | + | - | | 1 | 2 | 3 | + | - | | | + *|-----------------------------------------------------------| + *| | | 0 | , | . | = | | | 0 | , | . | = | | + *|-----------------------------------------------------------| + *| | | | | | | | | RL | | + *`-----------------------------------------------------------' + +---- Layer 3 - BL +all the fancy lights +and useful reset button (top right) + *,-----------------------------------------------------------. + *|BL | | | | | | | | | | | | |Reset | + *|-----------------------------------------------------------| + *| |tog|mod|hui|hud| | |sai|sad|vai|vad| | | | + *|------------------------------------------------------ | + *| |sta|bre|rai|swi| | |sna|kni|gra|xms| | | | + *|-----------------------------------------------------------| + *| | |bd |bt |bi |bs | | | | | | | | + *|-----------------------------------------------------------| + *| | | | | | | | | BL | | + *`-----------------------------------------------------------' diff --git a/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c new file mode 100644 index 0000000000..7c17a6f5f8 --- /dev/null +++ b/keyboards/dz60/keymaps/iso_split-spacebar/keymap.c @@ -0,0 +1,193 @@ +// using as reference +// https://docs.qmk.fm/#/keymap + +// thanks to atlacat, hailbreno, itsaferbie and weeheavy... + +// and special thanks to AGausmann and drashna for the layer-activated RGB underglow +// https://www.reddit.com/r/olkb/comments/6t1vdu/update_layeractivated_rgb_underglow/ +// https://github.com/AGausmann/qmk_firmware/blob/agausmann-v3.x/keyboards/nyquist/keymaps/agausmann/keymap.c + +#include QMK_KEYBOARD_H + + +// Helpful defines +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +/* +* Each layer gets a name for readability. +* 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, and you can also skip them entirely +* and just use numbers. +* +*/ +#define BL 0 // Base Layer +#define FL 1 // Function Layer +#define NL 2 // Numpad Layer +#define RL 3 // RGB Layer + +/* +* Let's give an easier name to the RGB modes +* and assign the ones we want to the different layer +* these will then be used by the function below +* +*/ +#define RGB_STA RGB_M_P //rgb static +#define RGB_BRE RGB_M_B //rgb breathe +#define RGB_RAI RGB_M_R //rgb rainbow +#define RGB_SWI RGB_M_SW //rgb swirl +#define RGB_SNA RGB_M_SN //rgb snake +#define RGB_KNI RGB_M_K //rgb knight +#define RGB_GRA RGB_M_G //rgb gradient +#define RGB_XMS RGB_M_X //rgb christmas +// +#define RGB_BL_MODE rgblight_mode_noeeprom(3) //rgb mode for BL layer +#define RGB_BL_LIGHT rgblight_sethsv_noeeprom_turquoise() //rgb light for BL layer +// +#define RGB_FL_MODE rgblight_mode_noeeprom(1) //rgb mode for FL layer +#define RGB_FL_LIGHT rgblight_sethsv_noeeprom_orange() //rgb light for FL layer +// +#define RGB_NL_MODE rgblight_mode_noeeprom(12) //rgb mode for NL layer +#define RGB_NL_LIGHT rgblight_sethsv_noeeprom_turquoise() //rgb light for NL layer +// +#define RGB_RL_MODE rgblight_mode_noeeprom(22) //rgb mode for RL layer +#define RGB_RL_LIGHT rgblight_sethsv_noeeprom_red() //rgb light for RL layer + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Keymap BL: Base Layer (Default Layer) + * + * ,-----------------------------------------------------------. + * | ' | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Backsp | + * |-----------------------------------------------------------| + * | Tab | q | w | e | r | t | y | u | i | o | p | [ | ] |enter| + * |------------------------------------------------------ | + * | Caps | a | s | d | f | g | h | j | k | l | ; | ' | # | | + * |-----------------------------------------------------------| + * |Shft| < | z | x | c | v | b | n | m | , | . | / | Shift | + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space | FN | Space |Alt |Gui | NL |Ctrl | + * `-----------------------------------------------------------' + */ + [BL] = LAYOUT_60_iso_split( + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, TO(NL), KC_RCTL), + + /* Keymap FL: Function Layer + * + * ,-----------------------------------------------------------. + * |ESC|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| DEL | + * |-----------------------------------------------------------| + * | | | | | | | | | | |prt| | | | + * |------------------------------------------------------ | + * | |m l|m d|m u|m r| | | l | d | u | r | | | | + * |-----------------------------------------------------------| + * | | | | | |mb1|mb2| |hm |pgd|pgu|end| | + * |-----------------------------------------------------------| + * | | | | | | | | | | | + * `-----------------------------------------------------------' + */ + [FL] = LAYOUT_60_iso_split( + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + 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_DEL, + _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, _______, _______, + _______, KC_MS_LEFT,KC_MS_DOWN,KC_MS_UP, KC_MS_RIGHT,_______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, + _______, _______, _______, _______, _______, KC_MS_BTN1,KC_MS_BTN2,_______, KC_HOME, KC_PGDOWN, KC_PGUP, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + /* Keymap NL: Numpad Layer + * + * ,-----------------------------------------------------------. + * |BL | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + * |-----------------------------------------------------------| + * | | 4 | 5 | 6 | * | / | | 4 | 5 | 6 | * | / | ] | | + * |------------------------------------------------------ | + * | | 7 | 8 | 9 | + | - | | 1 | 2 | 3 | + | - | | | + * |-----------------------------------------------------------| + * | | | 0 | , | . | = | | | 0 | , | . | = | | + * |-----------------------------------------------------------| + * | | | | | | | | | RL | | + * `-----------------------------------------------------------' + */ + [NL] = LAYOUT_60_iso_split( + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + TG(NL), 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_4, KC_5, KC_6, KC_PAST, KC_PSLS, _______, KC_4, KC_5, KC_6, KC_PAST, KC_PSLS, _______, + _______, KC_7, KC_8, KC_9, KC_PPLS, KC_PMNS, _______, KC_1, KC_2, KC_3, KC_PPLS, KC_PMNS, _______, _______, + _______, KC_0, KC_COMM, KC_DOT, KC_EQL, _______, _______, _______, KC_0, KC_COMM, KC_DOT, KC_EQL, _______, + _______, _______, _______, _______, MO(FL), _______, _______, _______, TG(RL), _______), + + /* Keymap RL: RGB Layer + * + * ,-----------------------------------------------------------. + * |BL | | | | | | | | | | | | |Reset | + * |-----------------------------------------------------------| + * | |tog|mod|hui|hud| | |sai|sad|vai|vad| | | | + * |------------------------------------------------------ | + * | |sta|bre|rai|swi| | |sna|kni|gra|xms| | | | + * |-----------------------------------------------------------| + * | | |bd |bt |bi |bs | | | | | | | | + * |-----------------------------------------------------------| + * | | | | | | | | | BL | | + * `-----------------------------------------------------------' + */ + [RL] = LAYOUT_60_iso_split( + // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 + TG(RL), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, + _______, RGB_STA, RGB_BRE, RGB_RAI, RGB_SWI, _______, _______, RGB_SNA, RGB_KNI, RGB_GRA, RGB_XMS, _______, _______, _______, + _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, MO(FL), _______, _______, _______, TO(BL), _______), + + +}; + + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + + +// layer-activated RGB underglow + +void matrix_scan_user(void) { + + #ifdef RGBLIGHT_ENABLE + + static uint8_t old_layer = 1; + uint8_t new_layer = biton32(layer_state); + + if (old_layer != new_layer) { + switch (new_layer) { + case BL: + RGB_BL_MODE; + RGB_BL_LIGHT; + break; + case FL: + RGB_FL_MODE; + RGB_FL_LIGHT; + break; + case NL: + RGB_NL_MODE; + // RGB_NL_LIGHT; + break; + case RL: + RGB_RL_MODE; + // RGB_RL_LIGHT; + break; + } + + old_layer = new_layer; + } + + #endif //RGBLIGHT_ENABLE + +} -- cgit v1.2.3 From 6c086f2b6d340c22462f6d6d3cb1d9b583123a65 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 19 Oct 2018 12:42:28 -0700 Subject: Revert changes to chibiOS-contrib (#4176) * Revert "Keymap: qwerty_code_friendly: use numpad layout for f-keys (#4170)" This reverts commit efc88a0b16055dc0b2f94da8c46ea8fadeab70f4. * Fix keymap --- lib/chibios-contrib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chibios-contrib b/lib/chibios-contrib index 2de67e2f4a..ede48346ee 160000 --- a/lib/chibios-contrib +++ b/lib/chibios-contrib @@ -1 +1 @@ -Subproject commit 2de67e2f4a268eae072c5fd76a1b160124cee4f6 +Subproject commit ede48346eee4b8d6847c19bc01420bee76a5e486 -- cgit v1.2.3 From f775168c4fa870c045984069a1b55eb9d269098c Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 20 Oct 2018 10:47:59 +1100 Subject: Keymap: qwerty_code_friendly: update readme, comments (#4178) --- .../community/ergodox/qwerty_code_friendly/keymap.c | 2 +- .../community/ergodox/qwerty_code_friendly/readme.md | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/layouts/community/ergodox/qwerty_code_friendly/keymap.c b/layouts/community/ergodox/qwerty_code_friendly/keymap.c index 2a441be0e6..43a1d1ad80 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/keymap.c +++ b/layouts/community/ergodox/qwerty_code_friendly/keymap.c @@ -445,7 +445,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MPRV, K80(L2K2), K80(L2K3), KC_MNXT, KC_TRNS, KC_MPLY ), -/* Keymap 3: Entire Words (one for each key) +/* Keymap 3: Entire Words (one for each key) & Numbers * * .--------------------------------------------------. .--------------------------------------------------. * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | diff --git a/layouts/community/ergodox/qwerty_code_friendly/readme.md b/layouts/community/ergodox/qwerty_code_friendly/readme.md index 23afa656f7..9abd071b9b 100644 --- a/layouts/community/ergodox/qwerty_code_friendly/readme.md +++ b/layouts/community/ergodox/qwerty_code_friendly/readme.md @@ -30,7 +30,7 @@ Some optional behavior is configurable without editing the code using `CFQ_` prefixed defines which can be set by passing `EXTRAFLAGS` to make. - `CFQ_USER_KEY0` - (0..7) are used for custom-keys + (0..8) are used for custom-keys - `CFQ_USE_MOMENTARY_LAYER_KEYS` is used to prevent layer keys from toggling when tapped. - `CFQ_USE_SHIFT_QUOTES` @@ -122,12 +122,7 @@ Notes: '--------------------' '--------------------' ``` -## Keymap 2: Media, Mouse Keys and Numbers - -Notes: - -- Numbers are included on this layer since some applications differentiate - between numbers top row and keypad. +## Keymap 2: F-Keys, Media & Mouse Keys ``` .--------------------------------------------------. .--------------------------------------------------. @@ -150,12 +145,17 @@ Notes: '--------------------' '--------------------' ``` -## Keymap 3: F-Keys & User Defined Words +## Keymap 3: User Defined Words & Numbers This is for assigning whole words to single keys. You can define the arguments (which must be quoted) using: `CFQ_WORD_[A-Z]` eg: `-DCFQ_WORD_E=\"my@email.com\"` +Notes: + +- Numbers are included on this layer since some applications differentiate + between numbers top row and keypad. + ``` .--------------------------------------------------. .--------------------------------------------------. | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | | @@ -180,7 +180,7 @@ eg: `-DCFQ_WORD_E=\"my@email.com\"` ## Changelog - 2018/10/19 - Move F-Keys to numpad like layout. + Move F-Keys to key-pad like layout. - 2018/05/29 Add number keys for cases when keypad numbers are handled differently. -- cgit v1.2.3 From 26d2ef2ad1c9b040151d1aac19c4fff3f8b55dd5 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Sat, 20 Oct 2018 01:07:48 -0400 Subject: Ergodox EZ: Use Correct Const For LED Color --- keyboards/ergodox_ez/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index e400ffcd37..ef70decd53 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -266,7 +266,7 @@ uint32_t layer_state_set_user(uint32_t state) { ergodox_right_led_2_on(); ergodox_right_led_3_on(); #ifdef RGBLIGHT_COLOR_LAYER_7 - rgblight_setrgb(RGBLIGHT_COLOR_LAYER_6); + rgblight_setrgb(RGBLIGHT_COLOR_LAYER_7); #endif break; default: -- cgit v1.2.3 From ea17e363a61b925c1c6da0146fe383630a7848c0 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 20 Oct 2018 08:40:32 -0700 Subject: Add instructions for zadig when bootloader device is unknown --- docs/faq_build.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/faq_build.md b/docs/faq_build.md index 7d17df0745..00a0d386b9 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -17,7 +17,7 @@ or just: Note that running `make` with `sudo` is generally *not* a good idea, and you should use one of the former methods, if possible. -## Linux `udev` Rules +### Linux `udev` Rules On Linux, you'll need proper privileges to access the MCU. You can either use `sudo` when flashing firmware, or place these files in `/etc/udev/rules.d/`. @@ -37,6 +37,14 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2ff0", MODE:="066 SUBSYSTEMS=="usb", ATTRS{idVendor}=="feed", MODE:="0666" ``` +## Unknown Device for DFU Bootloader + +If you're using Windows to flash your keyboard, and you are running into issues, check the Device Manager. If you see an "Unknown Device" when the keyboard is in "bootloader mode", then you may have a driver issue. + +Re-running the installation script for MSYS2 may help (eg run `./util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue. + +If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, find the device in question, and select the `WinUS(libusb-1.0)` option, and hit "Reinstall driver". Once you've done that, try flashing your board, again. + ## WINAVR is Obsolete It is no longer recommended and may cause some problem. See [TMK Issue #99](https://github.com/tmk/tmk_keyboard/issues/99). -- cgit v1.2.3 From 4fffef88535dd62c19e7a1db10c557895ef9cd86 Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Sun, 21 Oct 2018 12:05:45 -0400 Subject: Keymap: add initial khord iris keymap (#4188) --- keyboards/iris/keymaps/khord/config.h | 38 ++++++++++ keyboards/iris/keymaps/khord/keymap.c | 136 ++++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/khord/rules.mk | 3 + 3 files changed, 177 insertions(+) create mode 100644 keyboards/iris/keymaps/khord/config.h create mode 100644 keyboards/iris/keymaps/khord/keymap.c create mode 100644 keyboards/iris/keymaps/khord/rules.mk diff --git a/keyboards/iris/keymaps/khord/config.h b/keyboards/iris/keymaps/khord/config.h new file mode 100644 index 0000000000..9b44bca792 --- /dev/null +++ b/keyboards/iris/keymaps/khord/config.h @@ -0,0 +1,38 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define TAPPING_TERM 150 + +#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/khord/keymap.c b/keyboards/iris/keymaps/khord/keymap.c new file mode 100644 index 0000000000..379617a8b7 --- /dev/null +++ b/keyboards/iris/keymaps/khord/keymap.c @@ -0,0 +1,136 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + ADMIN, + SMSPC1 +}; + +enum { + SFT_CAP = 0 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + TD(SFT_CAP),KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, SFT_T(KC_ENT), + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_HOME, KC_END, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LGUI, LOWER, KC_ENT, KC_SPC, RAISE, KC_LALT + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RESET, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_DEL, _______, KC_LEFT, KC_RGHT, KC_UP, KC_LBRC, KC_RBRC, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_PIPE, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_STEP, _______, _______, _______, KC_DOWN, KC_LCBR, KC_LPRN, KC_RPRN, KC_RCBR, KC_P1, KC_P2, KC_P3, KC_MINS, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_DEL, KC_DEL, _______, KC_P0 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F12, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_MOD, KC_MPRV, KC_MNXT, KC_VOLU, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_MUTE, KC_MSTP, KC_MPLY, KC_VOLD, KC_PGDN, KC_MINS, KC_LPRN, _______, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case ADMIN: + if (record->event.pressed) { + SEND_STRING("Administrator"); + } + return false; + break; + case SMSPC1: + if (record->event.pressed) { + SEND_STRING("Simspace1!"); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/khord/rules.mk b/keyboards/iris/keymaps/khord/rules.mk new file mode 100644 index 0000000000..c46edbd128 --- /dev/null +++ b/keyboards/iris/keymaps/khord/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes -- cgit v1.2.3 From 877c285ec8c5509f665b558cb2bcaa89d6093055 Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Sun, 21 Oct 2018 11:15:48 -0500 Subject: Keymap: Renabled EXTRAKEYS in layout (#4174) * Renabled EXTRAKEYS. * Update keyboards/iris/keymaps/vyolle_steno/rules.mk Co-Authored-By: Vyolle --- keyboards/iris/keymaps/vyolle_steno/rules.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/iris/keymaps/vyolle_steno/rules.mk b/keyboards/iris/keymaps/vyolle_steno/rules.mk index e412316833..ebe1c86a0e 100644 --- a/keyboards/iris/keymaps/vyolle_steno/rules.mk +++ b/keyboards/iris/keymaps/vyolle_steno/rules.mk @@ -1,7 +1,7 @@ -EXTRAKEY_ENABLE = no -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER +EXTRAKEY_ENABLE = yes # Disable if you run out of usb endpoints. Media keys need this to work. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) Uses extra usb endpoints. +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER. AUDIO_ENABLE = no # Audio output on port C6 MIDI_ENABLE = no # MIDI controls NKRO_ENABLE = yes -BOOTMAGIC_ENABLE = yes \ No newline at end of file +BOOTMAGIC_ENABLE = yes -- cgit v1.2.3 From 8e3330bbf6f8c4faf39a3df20fa3ab62910c8b19 Mon Sep 17 00:00:00 2001 From: a-chol Date: Sun, 21 Oct 2018 18:20:24 +0200 Subject: Keyboard: bminiex : Working backlight (#4171) * bminiex : Working backlight * bminiex keyboard with fixes * bminiex keyboard more fixes --- keyboards/bminiex/backlight.c | 211 +++++++++++++++ keyboards/bminiex/backlight_custom.h | 13 + keyboards/bminiex/bminiex.c | 97 +++++++ keyboards/bminiex/bminiex.h | 58 +++++ keyboards/bminiex/breathing_custom.h | 140 ++++++++++ keyboards/bminiex/config.h | 41 +++ keyboards/bminiex/i2c.c | 106 ++++++++ keyboards/bminiex/i2c.h | 25 ++ keyboards/bminiex/keymaps/default/keymap.c | 29 +++ keyboards/bminiex/matrix.c | 122 +++++++++ keyboards/bminiex/readme.md | 14 + keyboards/bminiex/rules.mk | 56 ++++ keyboards/bminiex/usbconfig.h | 396 +++++++++++++++++++++++++++++ tmk_core/common/backlight.h | 5 +- 14 files changed, 1309 insertions(+), 4 deletions(-) create mode 100644 keyboards/bminiex/backlight.c create mode 100644 keyboards/bminiex/backlight_custom.h create mode 100644 keyboards/bminiex/bminiex.c create mode 100644 keyboards/bminiex/bminiex.h create mode 100644 keyboards/bminiex/breathing_custom.h create mode 100644 keyboards/bminiex/config.h create mode 100644 keyboards/bminiex/i2c.c create mode 100644 keyboards/bminiex/i2c.h create mode 100644 keyboards/bminiex/keymaps/default/keymap.c create mode 100644 keyboards/bminiex/matrix.c create mode 100644 keyboards/bminiex/readme.md create mode 100644 keyboards/bminiex/rules.mk create mode 100644 keyboards/bminiex/usbconfig.h diff --git a/keyboards/bminiex/backlight.c b/keyboards/bminiex/backlight.c new file mode 100644 index 0000000000..94e8126d88 --- /dev/null +++ b/keyboards/bminiex/backlight.c @@ -0,0 +1,211 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/bminiex/backlight_custom.h b/keyboards/bminiex/backlight_custom.h new file mode 100644 index 0000000000..51365fe3ba --- /dev/null +++ b/keyboards/bminiex/backlight_custom.h @@ -0,0 +1,13 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#pragma once + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + diff --git a/keyboards/bminiex/bminiex.c b/keyboards/bminiex/bminiex.c new file mode 100644 index 0000000000..d9b05aba51 --- /dev/null +++ b/keyboards/bminiex/bminiex.c @@ -0,0 +1,97 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include "bminiex.h" +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +#include "backlight.h" +#include "backlight_custom.h" + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i + +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 + +#include "quantum.h" + +#define LAYOUT( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + +#define LAYOUT_kc( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +) \ +{ \ + { KC_##K00, KC_##K10, KC_##K20, KC_##K30, KC_NO, KC_NO, KC_##K60, KC_NO, KC_##K80, KC_##K90, KC_NO, KC_##KB0, KC_##KC0, KC_##KD0, KC_##KE0 }, \ + { KC_##K01, KC_##K11, KC_##K21, KC_##K31, KC_##K41, KC_##K51, KC_##K61, KC_##K71, KC_##K81, KC_NO, KC_##KA1, KC_##KB1, KC_NO, KC_##KD1, KC_##KE1 }, \ + { KC_##K02, KC_##K12, KC_##K22, KC_##K32, KC_##K42, KC_##K52, KC_##K62, KC_##K72, KC_##K82, KC_##K92, KC_##KA2, KC_##KB2, KC_##KC2, KC_##KD2, KC_##KE2 }, \ + { KC_##K03, KC_##K13, KC_##K23, KC_##K33, KC_##K43, KC_##K53, KC_##K63, KC_##K73, KC_##K83, KC_NO, KC_##KA3, KC_##KB3, KC_##KC3, KC_##KD3, KC_NO }, \ + { KC_##K04, KC_##K14, KC_##K24, KC_##K34, KC_##K44, KC_##K54, KC_##K64, KC_##K74, KC_##K84, KC_##K94, KC_##KA4, KC_##KB4, KC_##KC4, KC_NO, KC_##KE4 }, \ + { KC_##K05, KC_NO, KC_##K25, KC_##K35, KC_##K45, KC_##K55, KC_##K65, KC_##K75, KC_##K85, KC_##K95, KC_NO, KC_##KB5, KC_##KC5, KC_##KD5, KC_##KE5 }, \ + { KC_##K06, KC_##K16, KC_##K26, KC_##K36, KC_##K46, KC_##K56, KC_##K66, KC_##K76, KC_##K86, KC_##K96, KC_##KA6, KC_##KB6, KC_##KC6, KC_##KD6, KC_##KE6 }, \ + { KC_##K07, KC_##K17, KC_##K27, KC_##K37, KC_##K47, KC_##K57, KC_##K67, KC_##K77, KC_NO, KC_NO, KC_##KA7, KC_##KB7, KC_##KC7, KC_##KD7, KC_##KE7 } \ +} + diff --git a/keyboards/bminiex/breathing_custom.h b/keyboards/bminiex/breathing_custom.h new file mode 100644 index 0000000000..71416b1b45 --- /dev/null +++ b/keyboards/bminiex/breathing_custom.h @@ -0,0 +1,140 @@ +/** + * Breathing effect code for PS2AVRGB boards (ATMEGA32A) + * Works in conjunction with `backlight.c`. + * + * Code adapted from `quantum.c` to register with the existing TIMER1 overflow + * handler in `backlight.c` instead of setting up its own timer. + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifdef BACKLIGHT_ENABLE +#ifdef BACKLIGHT_BREATHING + +#include "backlight_custom.h" + +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) + +// TODO make this share code with quantum.c + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +void breathing_enable(void) { + breathing = true; + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + // interrupt already registered +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + // breathing_interrupt_enable(); + breathing = true; +} + +void breathing_disable(void) { + breathing = false; + // backlight_set(get_backlight_level()); + b_led_set(get_backlight_level()); // custom implementation of backlight_set() +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void custom_breathing_handler(void) { + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + // breathing_interrupt_disable(); + } + + setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/bminiex/config.h b/keyboards/bminiex/config.h new file mode 100644 index 0000000000..3f160109e3 --- /dev/null +++ b/keyboards/bminiex/config.h @@ -0,0 +1,41 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 + +#include "config_common.h" + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422E +#define MANUFACTURER winkeyless.kr +#define PRODUCT B.mini Ex + +#define RGBLED_NUM 20 + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 15 + +#define RGBLIGHT_ANIMATIONS + +#define BACKLIGHT_LEVELS 5 + +#define NO_UART 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + diff --git a/keyboards/bminiex/i2c.c b/keyboards/bminiex/i2c.c new file mode 100644 index 0000000000..a4f9521352 --- /dev/null +++ b/keyboards/bminiex/i2c.c @@ -0,0 +1,106 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +// Please do not modify this file + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +// Please do not modify this file + +#pragma once + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + diff --git a/keyboards/bminiex/keymaps/default/keymap.c b/keyboards/bminiex/keymaps/default/keymap.c new file mode 100644 index 0000000000..ed949d74fb --- /dev/null +++ b/keyboards/bminiex/keymaps/default/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#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_HOME,KC_END, KC_NO, KC_NO, KC_NO, KC_NO, + 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_DEL, 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_NO, KC_INS, KC_P7, KC_P8, KC_P9, + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_NUHS,KC_ENT, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS, + 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_PGDN, KC_P1, KC_P2, KC_P3, + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_APP ,KC_RCTL,KC_LEFT,KC_DOWN,KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ) +}; diff --git a/keyboards/bminiex/matrix.c b/keyboards/bminiex/matrix.c new file mode 100644 index 0000000000..8faaed8ac0 --- /dev/null +++ b/keyboards/bminiex/matrix.c @@ -0,0 +1,122 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "matrix.h" +#include "backlight.h" + +#ifndef DEBOUNCE +#define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +__attribute__ ((weak)) +void matrix_init_user(void) {} +__attribute__ ((weak)) +void matrix_scan_user(void) {} +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1<> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +uint8_t matrix_scan(void) { + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + matrix_set_row_status(row); + _delay_us(5); + + matrix_row_t cols = ( + // cols 0..7, PORTA 0 -> 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + 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 matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/bminiex/readme.md b/keyboards/bminiex/readme.md new file mode 100644 index 0000000000..204bcbbb1b --- /dev/null +++ b/keyboards/bminiex/readme.md @@ -0,0 +1,14 @@ +B.mini EX +========= + +A compact fullsize keyboard with RGB + +Keyboard Maintainer: QMK Community +Hardware Supported: B.mini EX PCB +Hardware Availability: https://winkeyless.kr/product/b-mini-ex-x2-pcb/ + +Make example for this keyboard (after setting up your build environment): + + make bminiex: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). \ No newline at end of file diff --git a/keyboards/bminiex/rules.mk b/keyboards/bminiex/rules.mk new file mode 100644 index 0000000000..e5d3a2a88c --- /dev/null +++ b/keyboards/bminiex/rules.mk @@ -0,0 +1,56 @@ +# Copyright 2017 Luiz Ribeiro +# +# 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 . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# 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 = bootloadHID + +# build options +BOOTMAGIC_ENABLE = yes +MOUSEKEY_ENABLE = yes +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +DEBUG_ENABLE = no +COMMAND_ENABLE = no +BACKLIGHT_ENABLE = yes +BACKLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_CUSTOM_DRIVER = yes +TAP_DANCE_ENABLE = no + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/bminiex/usbconfig.h b/keyboards/bminiex/usbconfig.h new file mode 100644 index 0000000000..d2d848fcdc --- /dev/null +++ b/keyboards/bminiex/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'w', 'i', 'n', 'k', 'e', 'y', 'l', 'e', 's', 's', '.', 'k', 'r' +#define USB_CFG_VENDOR_NAME_LEN 13 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'p', 's', '2', 'a', 'v', 'r', 'G', 'B' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ diff --git a/tmk_core/common/backlight.h b/tmk_core/common/backlight.h index f573092674..ef8ab9b2be 100644 --- a/tmk_core/common/backlight.h +++ b/tmk_core/common/backlight.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef BACKLIGHT_H -#define BACKLIGHT_H +#pragma once #include #include @@ -37,5 +36,3 @@ void backlight_step(void); void backlight_set(uint8_t level); void backlight_level(uint8_t level); uint8_t get_backlight_level(void); - -#endif -- cgit v1.2.3 From dedbc37196d5b9d9ccbb5654441fd84f820c4a7b Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Sun, 21 Oct 2018 18:27:33 -0700 Subject: Doesn't need a 50ms debounce Set it to default. I have no idea what I was thinking. --- keyboards/catch22/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/catch22/config.h b/keyboards/catch22/config.h index f151e7048f..c5cf8233db 100644 --- a/keyboards/catch22/config.h +++ b/keyboards/catch22/config.h @@ -39,7 +39,7 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW /* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 50 +// #define DEBOUNCING_DELAY 0 /* key combination for command */ #define IS_COMMAND() ( \ -- cgit v1.2.3 From 91bfbb62560cc237066de2392eefbb271eff9d6b Mon Sep 17 00:00:00 2001 From: "Colin T.A. Gray" Date: Mon, 22 Oct 2018 14:19:51 -0400 Subject: Updates docs - planck 6 and macos instructions (#4201) * add note about how to install rev6 (dfu-util) * include instructions on installing dfu-util on macOS --- docs/faq_build.md | 2 ++ docs/getting_started_build_tools.md | 1 + keyboards/planck/readme.md | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/docs/faq_build.md b/docs/faq_build.md index 00a0d386b9..465a283aef 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -105,10 +105,12 @@ The solution is to remove and reinstall all affected modules. ``` brew rm avr-gcc brew rm dfu-programmer +brew rm dfu-util brew rm gcc-arm-none-eabi brew rm avrdude brew install avr-gcc brew install dfu-programmer +brew install dfu-util brew install gcc-arm-none-eabi brew install avrdude ``` diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index c1e02d4e07..dd3e7805a9 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -58,6 +58,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew update brew install avr-gcc@7 brew install dfu-programmer + brew install dfu-util brew install gcc-arm-none-eabi brew install avrdude diff --git a/keyboards/planck/readme.md b/keyboards/planck/readme.md index f857c546cc..083279e8a6 100644 --- a/keyboards/planck/readme.md +++ b/keyboards/planck/readme.md @@ -13,4 +13,8 @@ Make example for this keyboard (after setting up your build environment): make planck/rev4:default +Install examples: + + make planck/rev6:default:dfu-util + See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. -- cgit v1.2.3 From fbc6bd82664f7286e358e14da6c7945aa061ee3b Mon Sep 17 00:00:00 2001 From: Dylan Khor Date: Mon, 22 Oct 2018 14:29:04 -0400 Subject: Minor updates to build tools docs revised (#4195) * add initial khord iris keymap * correct path of windows qmk install script --- docs/getting_started_build_tools.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index dd3e7805a9..88f3642b28 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -62,7 +62,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew install gcc-arm-none-eabi brew install avrdude -This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of avr-libc can take over 20 minutes and exhibit high CPU usage. +This is the recommended method. If you don't have homebrew, [install it!](http://brew.sh/) It's very much worth it for anyone who works in the command line. Note that the `make` and `make install` portion during the homebrew installation of `avr-gcc@7` can take over 20 minutes and exhibit high CPU usage. ## Windows with msys2 (recommended) @@ -70,9 +70,9 @@ The best environment to use, for Windows Vista through any later version (tested * Install msys2 by downloading it and following the instructions here: http://www.msys2.org * Open the ``MSYS2 MingGW 64-bit`` shortcut -* Navigate to your qmk checkout. For example, if it's in the root of your c drive: +* Navigate to your QMK repository. For example, if it's in the root of your c drive: * `$ cd /c/qmk_firmware` -* Run `util/msys2_install.sh` and follow the prompts +* Run `util/qmk_install.sh` and follow the prompts ## Windows 10 (deprecated) These are the old instructions for Windows 10. We recommend you use [MSYS2 as outlined above](#windows-with-msys2-recommended). -- cgit v1.2.3 From 4665e4ffffcdfc6fe6f498928963adc64f6fefd7 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Tue, 23 Oct 2018 03:38:05 +0900 Subject: Keyboard: Helix serial.c, split_scom.c bug fix and update (#4191) * helix/serial.c add support PD1,PD3,PE6 and configuration simplify * Add comment about ATmega32U4 I2C * Add compile time check for ATmega32U4 I2C * change TAB code to 8 SPACE code * Helix serial.c PORTD,PD0 test. OK OK PD0 - PD1 OK PD2 - PD3 - PE6 * Helix serial.c PORTD,PD1 test. OK OK PD0 OK PD1 OK PD2 - PD3 - PE6 * Helix serial.c PORTD,PD3 test. OK OK PD0 OK PD1 OK PD2 OK PD3 - PE6 * Helix serial.c PORTE,PD6 test. OK OK PD0 OK PD1 OK PD2 OK PD3 OK PE6 * Helix serial.c: PD0,PD1,PD3,PE6 all test end * Helix serial.c: rename SOFT_SERIAL_PORT to SOFT_SERIAL_PIN * Helix serial.c add debug code * Helix serial.c: add transaction ID range check * Helix serial.c debug code update * Helix serial.c debug code update * Helix serial.c: Strict checking of the value of tid. * adjust the delay of serial.c * Helix serial.c: remove debug code * remove EXTRAFLAGS += -DCONSOLE_ENABLE from five_rows/rules.mk tmk_core/common.mk has >ifeq ($(strip $(CONSOLE_ENABLE)), yes) > TMK_COMMON_DEFS += -DCONSOLE_ENABLE * Fix error handling in split_scomm.c * add some comment to serial.c * add some comment about SELECT_SOFT_SERIAL_SPEED --- keyboards/helix/pico/serial_config.h | 15 +- .../helix/rev1/keymaps/OLED_sample/serial_config.h | 15 +- keyboards/helix/rev1/serial_config.h | 15 +- keyboards/helix/rev2/keymaps/five_rows/rules.mk | 4 - keyboards/helix/rev2/serial_config.h | 15 +- keyboards/helix/rev2/split_scomm.c | 48 +++-- keyboards/helix/serial.c | 228 +++++++++++++++------ keyboards/helix/serial.h | 22 +- 8 files changed, 227 insertions(+), 135 deletions(-) diff --git a/keyboards/helix/pico/serial_config.h b/keyboards/helix/pico/serial_config.h index 82c6e4e836..fc8736d472 100644 --- a/keyboards/helix/pico/serial_config.h +++ b/keyboards/helix/pico/serial_config.h @@ -1,16 +1,9 @@ -#ifndef SOFT_SERIAL_CONFIG_H -#define SOFT_SERIAL_CONFIG_H +//// #error rev2 serial config +#ifndef SOFT_SERIAL_PIN /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect +#define SOFT_SERIAL_PIN D2 #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 - -//// #error rev2 serial config - -#endif /* SOFT_SERIAL_CONFIG_H */ +#endif diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h index b991b874b7..f56951e707 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h +++ b/keyboards/helix/rev1/keymaps/OLED_sample/serial_config.h @@ -1,16 +1,9 @@ -#ifndef SOFT_SERIAL_CONFIG_H -#define SOFT_SERIAL_CONFIG_H +//// #error rev1/keymaps/OLED_sample serial config +#ifndef SOFT_SERIAL_PIN /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect +#define SOFT_SERIAL_PIN D2 #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 0 - -//// #error rev1/keymaps/OLED_sample serial config - -#endif /* SOFT_SERIAL_CONFIG_H */ +#endif diff --git a/keyboards/helix/rev1/serial_config.h b/keyboards/helix/rev1/serial_config.h index 51c6aa3750..32218f9bbe 100644 --- a/keyboards/helix/rev1/serial_config.h +++ b/keyboards/helix/rev1/serial_config.h @@ -1,16 +1,9 @@ -#ifndef SOFT_SERIAL_CONFIG_H -#define SOFT_SERIAL_CONFIG_H +/// #error rev1 serial config +#ifndef SOFT_SERIAL_PIN /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect +#define SOFT_SERIAL_PIN D0 #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 0 - -/// #error rev1 serial config - -#endif /* SOFT_SERIAL_CONFIG_H */ +#endif diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index 63106df764..f771c94c9c 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -122,10 +122,6 @@ ifeq ($(strip $(Link_Time_Optimization)),yes) EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization endif -ifeq ($(strip $(CONSOLE_ENABLE)),yes) - EXTRAFLAGS += -DCONSOLE_ENABLE -endif - # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/helix/rev2/serial_config.h b/keyboards/helix/rev2/serial_config.h index 8d7e628378..37135213d5 100644 --- a/keyboards/helix/rev2/serial_config.h +++ b/keyboards/helix/rev2/serial_config.h @@ -1,15 +1,8 @@ -#ifndef SOFT_SERIAL_CONFIG_H -#define SOFT_SERIAL_CONFIG_H +//// #error rev2 serial config +#ifndef SOFT_SERIAL_PIN /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect +#define SOFT_SERIAL_PIN D2 #define SERIAL_USE_MULTI_TRANSACTION - -//// #error rev2 serial config - -#endif /* SOFT_SERIAL_CONFIG_H */ +#endif diff --git a/keyboards/helix/rev2/split_scomm.c b/keyboards/helix/rev2/split_scomm.c index 9719eb22ea..50d233ce9a 100644 --- a/keyboards/helix/rev2/split_scomm.c +++ b/keyboards/helix/rev2/split_scomm.c @@ -10,6 +10,9 @@ #ifdef SERIAL_DEBUG_MODE #include #endif +#ifdef CONSOLE_ENABLE + #include +#endif uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; @@ -17,6 +20,7 @@ uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; uint8_t slave_buffer_change_count = 0; uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; SSTD_t transactions[] = { #define GET_SLAVE_STATUS 0 @@ -41,12 +45,12 @@ SSTD_t transactions[] = { void serial_master_init(void) { - soft_serial_initiator_init(transactions); + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) { - soft_serial_target_init(transactions); + soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error @@ -54,19 +58,37 @@ void serial_slave_init(void) // 2 => checksum error int serial_update_buffers(int master_update) { - int status; + int status, smatstatus; static int need_retry = 0; - if( s_change_old != slave_buffer_change_count ) { - status = soft_serial_transaction(GET_SLAVE_BUFFER); - if( status == TRANSACTION_END ) - s_change_old = slave_buffer_change_count; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; } - if( !master_update && !need_retry) - status = soft_serial_transaction(GET_SLAVE_STATUS); - else - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); - need_retry = ( status == TRANSACTION_END ) ? 0 : 1; - return status; + return smatstatus; } #endif // SERIAL_USE_MULTI_TRANSACTION diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 11ceff0b37..830f86b55a 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -14,7 +14,56 @@ #include "serial.h" //#include -#ifdef USE_SERIAL +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ @@ -42,16 +91,20 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} #endif // Simple API (OLD API, compatible with let's split serial.c) @@ -59,39 +112,66 @@ int serial_update_buffers() #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#define TID_SEND_ADJUST 2 -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #define READ_WRITE_WIDTH_ADJUST 6 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -105,6 +185,7 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; inline static void serial_delay(void) { @@ -152,30 +233,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -205,12 +284,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -230,13 +309,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -288,6 +367,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -297,12 +383,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -315,17 +404,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -349,6 +438,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -375,9 +466,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -389,12 +481,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -404,12 +496,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -419,7 +511,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -442,3 +534,9 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif #endif + +// Helix serial.c history +// 2018-1-29 fork from let's split (#2308) +// 2018-6-28 bug fix master to slave comm (#3255) +// 2018-8-11 improvements (#3608) +// 2018-10-21 fix serial and RGB animation conflict (#4191) diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h index d2b7fd8e60..7e0c0847a4 100644 --- a/keyboards/helix/serial.h +++ b/keyboards/helix/serial.h @@ -4,14 +4,16 @@ #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. @@ -47,16 +49,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -72,7 +76,7 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif -- cgit v1.2.3 From f69333a0e57ca767d49b3155a31fd6d30114dced Mon Sep 17 00:00:00 2001 From: Naoki Katahira Date: Tue, 23 Oct 2018 03:39:26 +0900 Subject: Lily58 default keymap fix / add keymap (#4190) * keymap fix/add * keymap fix * file fix * typo fix --- keyboards/lily58/keymaps/default/config.h | 2 - keyboards/lily58/keymaps/default/keymap.c | 60 +++--- keyboards/lily58/keymaps/default/rules.mk | 1 - keyboards/lily58/keymaps/yuchi/config.h | 39 ++++ keyboards/lily58/keymaps/yuchi/keymap.c | 148 ++++++++++++++ keyboards/lily58/keymaps/yuchi/rules.mk | 22 ++ keyboards/lily58/rev1/rev1.c | 12 +- keyboards/lily58/rules.mk | 4 +- keyboards/lily58/split_util.c | 3 - keyboards/lily58/ssd1306.c | 330 ------------------------------ keyboards/lily58/ssd1306.h | 94 --------- 11 files changed, 237 insertions(+), 478 deletions(-) create mode 100644 keyboards/lily58/keymaps/yuchi/config.h create mode 100644 keyboards/lily58/keymaps/yuchi/keymap.c create mode 100644 keyboards/lily58/keymaps/yuchi/rules.mk delete mode 100644 keyboards/lily58/ssd1306.c delete mode 100644 keyboards/lily58/ssd1306.h diff --git a/keyboards/lily58/keymaps/default/config.h b/keyboards/lily58/keymaps/default/config.h index 3077c94632..fd09785593 100644 --- a/keyboards/lily58/keymaps/default/config.h +++ b/keyboards/lily58/keymaps/default/config.h @@ -19,8 +19,6 @@ along with this program. If not, see . */ #pragma once -#include "config.h" - /* Use I2C or Serial, not both */ #define USE_SERIAL diff --git a/keyboards/lily58/keymaps/default/keymap.c b/keyboards/lily58/keymaps/default/keymap.c index 624ce210b1..8d77058129 100644 --- a/keyboards/lily58/keymaps/default/keymap.c +++ b/keyboards/lily58/keymaps/default/keymap.c @@ -19,7 +19,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* QWERTY * ,-----------------------------------------. ,-----------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ~ | + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ` | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -27,9 +27,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| * `-----------------------------------------/ / \ \-----------------------------------------' - * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' + * `----------------------------' '------''--------------------' */ [_QWERTY] = LAYOUT( \ @@ -37,53 +37,52 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - LOWER,KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, RAISE \ + KC_LALT, KC_LGUI,LOWER, KC_SPC, KC_ENT, RAISE, KC_BSPC, KC_RGUI \ ), /* LOWER * ,-----------------------------------------. ,-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| | _ | + | | | | + * | ` | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | - | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| - * | | | | | | |-------| |-------| |ISO ~ |ISO | | | | | + * | | | | | | |-------| |-------| | _ | + | { | } | | | * `-----------------------------------------/ / \ \-----------------------------------------' - * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' + * `----------------------------' '------''--------------------' */ [_LOWER] = LAYOUT( \ - 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_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),_______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,\ + 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_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ _______, _______, _______, _______, _______, _______, _______, _______\ ), /* RAISE * ,-----------------------------------------. ,-----------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | * |------+------+------+------+------+------| |------+------+------+------+------+------| - * | | | | | | |-------. ,-------| | Left | Down | Up |Right | | + * | F1 | F2 | F3 | F4 | F5 | F6 |-------. ,-------| | Left | Down | Up |Right | | * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| - * | | | | | | |-------| |-------| + | - | = | [ | ] | \ | + * | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ | * `-----------------------------------------/ / \ \-----------------------------------------' - * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' + * `----------------------------' '------''--------------------' */ [_RAISE] = LAYOUT( \ - 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_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ - _______, _______, _______, _______, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, _______, _______, _______, _______, _______, _______, _______ \ ), - -/* ADJUST (Layers for Underglow) +/* ADJUST * ,-----------------------------------------. ,-----------------------------------------. * | | | | | | | | | | | | | | * |------+------+------+------+------+------| |------+------+------+------+------+------| @@ -93,9 +92,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------| | | |------+------+------+------+------+------| * | | | | | | |-------| |-------| | | | | | | * `-----------------------------------------/ / \ \-----------------------------------------' - * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | LAlt | LGUI |LOWER | /Space / \Enter \ |RAISE |BackSP| RGUI | * | | | |/ / \ \ | | | | - * `-------------------''-------' '------''--------------------' + * `----------------------------' '------''--------------------' */ [_ADJUST] = LAYOUT( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ @@ -107,17 +106,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); + if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } return false; diff --git a/keyboards/lily58/keymaps/default/rules.mk b/keyboards/lily58/keymaps/default/rules.mk index 73777a1b78..3d2d3c9e0f 100644 --- a/keyboards/lily58/keymaps/default/rules.mk +++ b/keyboards/lily58/keymaps/default/rules.mk @@ -4,7 +4,6 @@ # the appropriate keymap folder that will get included automatically # -OLED_ENABLE = no RGBLIGHT_ENABLE = no BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) diff --git a/keyboards/lily58/keymaps/yuchi/config.h b/keyboards/lily58/keymaps/yuchi/config.h new file mode 100644 index 0000000000..fd09785593 --- /dev/null +++ b/keyboards/lily58/keymaps/yuchi/config.h @@ -0,0 +1,39 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// Underglow +/* +#undef RGBLED_NUM +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_ANIMATIONS +#define RGBLIGHT_SLEEP +*/ \ No newline at end of file diff --git a/keyboards/lily58/keymaps/yuchi/keymap.c b/keyboards/lily58/keymaps/yuchi/keymap.c new file mode 100644 index 0000000000..d708dbec76 --- /dev/null +++ b/keyboards/lily58/keymaps/yuchi/keymap.c @@ -0,0 +1,148 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | ~ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | - | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |LCTRL | A | S | D | F | G |-------. ,-------| H | J | K | L | ; | ' | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * |LShift| Z | X | C | V | B |-------| |-------| N | M | , | . | / |RShift| + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + + [_QWERTY] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, \ + KC_LCTRL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + LOWER,KC_LGUI, KC_LALT, KC_SPC, KC_ENT, KC_BSPC, KC_RGUI, RAISE \ +), +/* LOWER + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % |-------. ,-------| ^ | & | * | ( | ) | - | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | _ | + | { | } | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ +[_LOWER] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______,_______, _______, _______,\ + 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_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_TILD, \ + _______, _______, _______, _______, _______, _______, _______, _______, XXXXXXX, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______\ +), +/* RAISE + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | F1 | F2 | F3 | F4 | F5 | F6 |-------. ,-------| | Left | Down | Up |Right | | + * |------+------+------+------+------+------| [ | | ] |------+------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 |-------| |-------| + | - | = | [ | ] | \ | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + +[_RAISE] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_PLUS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* ADJUST + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | |-------. ,-------| | | | | | | + * |------+------+------+------+------+------| | | |------+------+------+------+------+------| + * | | | | | | |-------| |-------| | | | | | | + * `-----------------------------------------/ / \ \-----------------------------------------' + * |LOWER | LGUI | Alt | /Space / \Enter \ |BackSP| RGUI |RAISE | + * | | | |/ / \ \ | | | | + * `-------------------''-------' '------''--------------------' + */ + [_ADJUST] = LAYOUT( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,\ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ) +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} \ No newline at end of file diff --git a/keyboards/lily58/keymaps/yuchi/rules.mk b/keyboards/lily58/keymaps/yuchi/rules.mk new file mode 100644 index 0000000000..73777a1b78 --- /dev/null +++ b/keyboards/lily58/keymaps/yuchi/rules.mk @@ -0,0 +1,22 @@ + +# 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 +# + +OLED_ENABLE = no +RGBLIGHT_ENABLE = no + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +ONEHAND_ENABLE = no # Enable one-hand typing +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/lily58/rev1/rev1.c b/keyboards/lily58/rev1/rev1.c index 64dd084b21..4c54d7717c 100644 --- a/keyboards/lily58/rev1/rev1.c +++ b/keyboards/lily58/rev1/rev1.c @@ -1,14 +1,5 @@ #include "lily58.h" -/* -#ifdef SSD1306OLED -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - led_set_user(usb_led); -} -#endif -*/ - void matrix_init_kb(void) { // // green led on @@ -20,5 +11,4 @@ void matrix_init_kb(void) { // PORTB &= ~(1<<0); matrix_init_user(); -}; - +}; \ No newline at end of file diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk index 23527476a3..72964fca1b 100644 --- a/keyboards/lily58/rules.mk +++ b/keyboards/lily58/rules.mk @@ -1,9 +1,7 @@ SRC += matrix.c \ i2c.c \ split_util.c \ - serial.c \ - ssd1306.c - + serial.c # MCU name #MCU = at90usb1287 MCU = atmega32u4 diff --git a/keyboards/lily58/split_util.c b/keyboards/lily58/split_util.c index ff069b7e28..49b065518c 100644 --- a/keyboards/lily58/split_util.c +++ b/keyboards/lily58/split_util.c @@ -34,9 +34,6 @@ static void setup_handedness(void) { static void keyboard_master_setup(void) { #ifdef USE_I2C i2c_master_init(); -//#ifdef SSD1306OLED -// matrix_master_OLED_init (); -//#endif #else serial_master_init(); #endif diff --git a/keyboards/lily58/ssd1306.c b/keyboards/lily58/ssd1306.c deleted file mode 100644 index d079001199..0000000000 --- a/keyboards/lily58/ssd1306.c +++ /dev/null @@ -1,330 +0,0 @@ -#ifdef SSD1306OLED - -#include "ssd1306.h" -#include "i2c.h" -#include -#include "print.h" -#include "glcdfont.c" -#ifdef ADAFRUIT_BLE_ENABLE -#include "adafruit_ble.h" -#endif -#ifdef PROTOCOL_LUFA -#include "lufa.h" -#endif -#include "sendchar.h" -#include "timer.h" - -// Set this to 1 to help diagnose early startup problems -// when testing power-on with ble. Turn it off otherwise, -// as the latency of printing most of the debug info messes -// with the matrix scan, causing keys to drop. -#define DEBUG_TO_SCREEN 0 - -//static uint16_t last_battery_update; -//static uint32_t vbat; -//#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ -#if DEBUG_TO_SCREEN -static uint8_t displaying; -#endif -static uint16_t last_flush; - -// Write command sequence. -// Returns true on success. -static inline bool _send_cmd1(uint8_t cmd) { - bool res = false; - - if (i2c_start_write(SSD1306_ADDRESS)) { - xprintf("failed to start write to %d\n", SSD1306_ADDRESS); - goto done; - } - - if (i2c_master_write(0x0 /* command byte follows */)) { - print("failed to write control byte\n"); - - goto done; - } - - if (i2c_master_write(cmd)) { - xprintf("failed to write command %d\n", cmd); - goto done; - } - res = true; -done: - i2c_master_stop(); - return res; -} - -// Write 2-byte command sequence. -// Returns true on success -static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { - if (!_send_cmd1(cmd)) { - return false; - } - return _send_cmd1(opr); -} - -// Write 3-byte command sequence. -// Returns true on success -static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { - if (!_send_cmd1(cmd)) { - return false; - } - if (!_send_cmd1(opr1)) { - return false; - } - return _send_cmd1(opr2); -} - -#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} -#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} -#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} - -static void clear_display(void) { - matrix_clear(&display); - - // Clear all of the display bits (there can be random noise - // in the RAM on startup) - send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); - send_cmd3(ColumnAddr, 0, DisplayWidth - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < DisplayWidth; ++col) { - i2c_master_write(0); - } - } - - display.dirty = false; - -done: - i2c_master_stop(); -} - -#if DEBUG_TO_SCREEN -#undef sendchar -static int8_t capture_sendchar(uint8_t c) { - sendchar(c); - iota_gfx_write_char(c); - - if (!displaying) { - iota_gfx_flush(); - } - return 0; -} -#endif - -bool iota_gfx_init(bool rotate) { - bool success = false; - - send_cmd1(DisplayOff); - send_cmd2(SetDisplayClockDiv, 0x80); - send_cmd2(SetMultiPlex, DisplayHeight - 1); - - send_cmd2(SetDisplayOffset, 0); - - - send_cmd1(SetStartLine | 0x0); - send_cmd2(SetChargePump, 0x14 /* Enable */); - send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); - - if(rotate){ - // the following Flip the display orientation 180 degrees - send_cmd1(SegRemap); - send_cmd1(ComScanInc); - }else{ - // Flips the display orientation 0 degrees - send_cmd1(SegRemap | 0x1); - send_cmd1(ComScanDec); - } - - send_cmd2(SetComPins, 0x2); - send_cmd2(SetContrast, 0x8f); - send_cmd2(SetPreCharge, 0xf1); - send_cmd2(SetVComDetect, 0x40); - send_cmd1(DisplayAllOnResume); - send_cmd1(NormalDisplay); - send_cmd1(DeActivateScroll); - send_cmd1(DisplayOn); - - send_cmd2(SetContrast, 0); // Dim - - clear_display(); - - success = true; - - iota_gfx_flush(); - -#if DEBUG_TO_SCREEN - print_set_sendchar(capture_sendchar); -#endif - -done: - return success; -} - -bool iota_gfx_off(void) { - bool success = false; - - send_cmd1(DisplayOff); - success = true; - -done: - return success; -} - -bool iota_gfx_on(void) { - bool success = false; - - send_cmd1(DisplayOn); - success = true; - -done: - return success; -} - -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { - *matrix->cursor = c; - ++matrix->cursor; - - if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { - // We went off the end; scroll the display upwards by one line - memmove(&matrix->display[0], &matrix->display[1], - MatrixCols * (MatrixRows - 1)); - matrix->cursor = &matrix->display[MatrixRows - 1][0]; - memset(matrix->cursor, ' ', MatrixCols); - } -} - -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { - matrix->dirty = true; - - if (c == '\n') { - // Clear to end of line from the cursor and then move to the - // start of the next line - uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; - - while (cursor_col++ < MatrixCols) { - matrix_write_char_inner(matrix, ' '); - } - return; - } - - matrix_write_char_inner(matrix, c); -} - -void iota_gfx_write_char(uint8_t c) { - matrix_write_char(&display, c); -} - -void matrix_write(struct CharacterMatrix *matrix, const char *data) { - const char *end = data + strlen(data); - while (data < end) { - matrix_write_char(matrix, *data); - ++data; - } -} - -void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { - char data_ln[strlen(data)+2]; - snprintf(data_ln, sizeof(data_ln), "%s\n", data); - matrix_write(matrix, data_ln); -} - -void iota_gfx_write(const char *data) { - matrix_write(&display, data); -} - -void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { - while (true) { - uint8_t c = pgm_read_byte(data); - if (c == 0) { - return; - } - matrix_write_char(matrix, c); - ++data; - } -} - -void iota_gfx_write_P(const char *data) { - matrix_write_P(&display, data); -} - -void matrix_clear(struct CharacterMatrix *matrix) { - memset(matrix->display, ' ', sizeof(matrix->display)); - matrix->cursor = &matrix->display[0][0]; - matrix->dirty = true; -} - -void iota_gfx_clear_screen(void) { - matrix_clear(&display); -} - -void matrix_render(struct CharacterMatrix *matrix) { - last_flush = timer_read(); - iota_gfx_on(); -#if DEBUG_TO_SCREEN - ++displaying; -#endif - - // Move to the home position - send_cmd3(PageAddr, 0, MatrixRows - 1); - send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); - - if (i2c_start_write(SSD1306_ADDRESS)) { - goto done; - } - if (i2c_master_write(0x40)) { - // Data mode - goto done; - } - - for (uint8_t row = 0; row < MatrixRows; ++row) { - for (uint8_t col = 0; col < MatrixCols; ++col) { - const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); - - for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { - uint8_t colBits = pgm_read_byte(glyph + glyphCol); - i2c_master_write(colBits); - } - - // 1 column of space between chars (it's not included in the glyph) - //i2c_master_write(0); - } - } - - matrix->dirty = false; - -done: - i2c_master_stop(); -#if DEBUG_TO_SCREEN - --displaying; -#endif -} - -void iota_gfx_flush(void) { - matrix_render(&display); -} - -__attribute__ ((weak)) -void iota_gfx_task_user(void) { -} - -void iota_gfx_task(void) { - iota_gfx_task_user(); - - if (display.dirty) { - iota_gfx_flush(); - } - - if (timer_elapsed(last_flush) > ScreenOffInterval) { - iota_gfx_off(); - } -} -#endif diff --git a/keyboards/lily58/ssd1306.h b/keyboards/lily58/ssd1306.h deleted file mode 100644 index 59d31c9f32..0000000000 --- a/keyboards/lily58/ssd1306.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef SSD1306_H -#define SSD1306_H - -#include -#include -#include "pincontrol.h" -#include "config.h" - -enum ssd1306_cmds { - DisplayOff = 0xAE, - DisplayOn = 0xAF, - - SetContrast = 0x81, - DisplayAllOnResume = 0xA4, - - DisplayAllOn = 0xA5, - NormalDisplay = 0xA6, - InvertDisplay = 0xA7, - SetDisplayOffset = 0xD3, - SetComPins = 0xda, - SetVComDetect = 0xdb, - SetDisplayClockDiv = 0xD5, - SetPreCharge = 0xd9, - SetMultiPlex = 0xa8, - SetLowColumn = 0x00, - SetHighColumn = 0x10, - SetStartLine = 0x40, - - SetMemoryMode = 0x20, - ColumnAddr = 0x21, - PageAddr = 0x22, - - ComScanInc = 0xc0, - ComScanDec = 0xc8, - SegRemap = 0xa0, - SetChargePump = 0x8d, - ExternalVcc = 0x01, - SwitchCapVcc = 0x02, - - ActivateScroll = 0x2f, - DeActivateScroll = 0x2e, - SetVerticalScrollArea = 0xa3, - RightHorizontalScroll = 0x26, - LeftHorizontalScroll = 0x27, - VerticalAndRightHorizontalScroll = 0x29, - VerticalAndLeftHorizontalScroll = 0x2a, -}; - -// Controls the SSD1306 128x32 OLED display via i2c - -#ifndef SSD1306_ADDRESS -#define SSD1306_ADDRESS 0x3C -#endif - -#define DisplayHeight 32 -#define DisplayWidth 128 - -#define FontHeight 8 -#define FontWidth 6 - -#define MatrixRows (DisplayHeight / FontHeight) -#define MatrixCols (DisplayWidth / FontWidth) - -struct CharacterMatrix { - uint8_t display[MatrixRows][MatrixCols]; - uint8_t *cursor; - bool dirty; -}; - -struct CharacterMatrix display; - -bool iota_gfx_init(bool rotate); -void iota_gfx_task(void); -bool iota_gfx_off(void); -bool iota_gfx_on(void); -void iota_gfx_flush(void); -void iota_gfx_write_char(uint8_t c); -void iota_gfx_write(const char *data); -void iota_gfx_write_P(const char *data); -void iota_gfx_clear_screen(void); - -void iota_gfx_task_user(void); - -void matrix_clear(struct CharacterMatrix *matrix); -void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); -void matrix_write(struct CharacterMatrix *matrix, const char *data); -void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); -void matrix_write_P(struct CharacterMatrix *matrix, const char *data); -void matrix_render(struct CharacterMatrix *matrix); - - - -#endif -- cgit v1.2.3 From 387bd555c7e6c88a78e0d388ea7eda5b1ce7958b Mon Sep 17 00:00:00 2001 From: Mattia Dal Ben Date: Mon, 22 Oct 2018 20:41:57 +0200 Subject: Keyboard: Add Redox Wireless keyboard (#4180) * Added folder and default keymap * Added italian keymap * Fixed readme.md * Added layer display through RGB led * Added layer status display to italian keymap * Fixed indentation * Removed obsolete comments * Updated instructions * Fixed keymaps readmes and removed RGB controls on ADJUST layer * Removed redundant KC_* definitions * Fixed readme file * Changed include guards to pragma once * Removed unused audio functions * Fixed rules.mk file * Added spaces in readme to fix rendering * Reconfigured keymap macro to resemble physical layout * Updated default keymap * Updated italian keymap * Removed unused persistent_default_layer_set function --- keyboards/redox_w/config.h | 81 ++++++++++++++ keyboards/redox_w/keymaps/default/keymap.c | 115 ++++++++++++++++++++ keyboards/redox_w/keymaps/default/readme.md | 1 + keyboards/redox_w/keymaps/italian/keymap.c | 125 +++++++++++++++++++++ keyboards/redox_w/keymaps/italian/readme.md | 1 + keyboards/redox_w/matrix.c | 162 ++++++++++++++++++++++++++++ keyboards/redox_w/readme.md | 34 ++++++ keyboards/redox_w/redox_w.c | 42 ++++++++ keyboards/redox_w/redox_w.h | 40 +++++++ keyboards/redox_w/rules.mk | 76 +++++++++++++ 10 files changed, 677 insertions(+) create mode 100644 keyboards/redox_w/config.h create mode 100644 keyboards/redox_w/keymaps/default/keymap.c create mode 100644 keyboards/redox_w/keymaps/default/readme.md create mode 100644 keyboards/redox_w/keymaps/italian/keymap.c create mode 100644 keyboards/redox_w/keymaps/italian/readme.md create mode 100644 keyboards/redox_w/matrix.c create mode 100644 keyboards/redox_w/readme.md create mode 100644 keyboards/redox_w/redox_w.c create mode 100644 keyboards/redox_w/redox_w.h create mode 100644 keyboards/redox_w/rules.mk diff --git a/keyboards/redox_w/config.h b/keyboards/redox_w/config.h new file mode 100644 index 0000000000..810a236d9a --- /dev/null +++ b/keyboards/redox_w/config.h @@ -0,0 +1,81 @@ +/* Copyright 2017 Mattia Dal Ben + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Mattia Dal Ben +#define PRODUCT Redox_wireless +#define DESCRIPTION q.m.k. keyboard firmware for Redox-w + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +#define ONESHOT_TIMEOUT 500 + + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +//UART settings for communication with the RF microcontroller +#define SERIAL_UART_BAUD 1000000 +#define SERIAL_UART_DATA UDR1 +#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) +#define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX and RX */ \ + UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + } while(0) diff --git a/keyboards/redox_w/keymaps/default/keymap.c b/keyboards/redox_w/keymaps/default/keymap.c new file mode 100644 index 0000000000..9cfc1734eb --- /dev/null +++ b/keyboards/redox_w/keymaps/default/keymap.c @@ -0,0 +1,115 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTPL LCTL_T(KC_PSLS) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_BKSL ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_LGUI ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + switch (layer) { + case _QWERTY: + set_led_off; + break; + case _SYMB: + set_led_green; + break; + case _NAV: + set_led_blue; + break; + case _ADJUST: + set_led_red; + break; + default: + break; + } +}; + + diff --git a/keyboards/redox_w/keymaps/default/readme.md b/keyboards/redox_w/keymaps/default/readme.md new file mode 100644 index 0000000000..32ab1253d7 --- /dev/null +++ b/keyboards/redox_w/keymaps/default/readme.md @@ -0,0 +1 @@ +# Default keymap for Redox Wireless diff --git a/keyboards/redox_w/keymaps/italian/keymap.c b/keyboards/redox_w/keymaps/italian/keymap.c new file mode 100644 index 0000000000..6e23a32d4d --- /dev/null +++ b/keyboards/redox_w/keymaps/italian/keymap.c @@ -0,0 +1,125 @@ +#include QMK_KEYBOARD_H + +#include "keymap_italian.h" + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _SYMB 1 +#define _NAV 2 +#define _ADJUST 3 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + SYMB, + NAV, + ADJUST, +}; + +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTPL LCTL_T(KC_PSLS) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +// Italian specific shortcuts +#define ALT_IACC RALT_T(IT_IACC) +#define GUI_LESS LGUI_T(IT_LESS) + +#define IT_SHSL RSFT_T(KC_SLSH) +#define IT_GRV RALT(KC_MINS) +#define IT_TILD RALT(KC_EQL) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,IT_EACC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,IT_LBRC , IT_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,IT_OACC ,IT_AACC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,IT_UACC ,IT_SHSL , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + GUI_LESS,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , ALT_IACC, KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_EXLM ,IT_AT ,IT_LCBR ,IT_RCBR ,IT_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_SHRP ,IT_DLR ,IT_LBRC ,IT_RBRC ,IT_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_PERC ,IT_CRC ,IT_LPRN ,IT_RPRN ,IT_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_NAV] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + + switch (layer) { + case _QWERTY: + set_led_off; + break; + case _SYMB: + set_led_green; + break; + case _NAV: + set_led_blue; + break; + case _ADJUST: + set_led_red; + break; + default: + break; + } +}; + + diff --git a/keyboards/redox_w/keymaps/italian/readme.md b/keyboards/redox_w/keymaps/italian/readme.md new file mode 100644 index 0000000000..a2b5ef7079 --- /dev/null +++ b/keyboards/redox_w/keymaps/italian/readme.md @@ -0,0 +1 @@ +# Italian keymap for Redox Wireless diff --git a/keyboards/redox_w/matrix.c b/keyboards/redox_w/matrix.c new file mode 100644 index 0000000000..5e61103f20 --- /dev/null +++ b/keyboards/redox_w/matrix.c @@ -0,0 +1,162 @@ +/* Copyright 2017 Mattia Dal Ben + * + * 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 . + */ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + SERIAL_UART_INIT(); + + uint32_t timeout = 0; + + //the s character requests the RF slave to send the matrix + SERIAL_UART_DATA = 's'; + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 14 bytes corresponding to 14 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + break; + } + } + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + if (uart_data[10] == 0xE0) + { + //shifting and transferring the keystates to the QMK matrix variable + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = (uint16_t) uart_data[i*2] | (uint16_t) uart_data[i*2+1] << 7; + } + } + + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1 +Redox logo +

+ +**Redox**: the **R**educed **E**rgo**dox** project. More information and building instruction [here](https://github.com/mattdibi/redox-keyboard). + +A wireless version of the Redox keyboard. + +- Keyboard Maintainer: [@mattdibi](https://github.com/mattdibi) +- Hardware Supported: Redox-w rev1.0W PCB +- Hardware Availability: Falbatech + +Make example for this keyboard (after setting up your build environment): + +```sh +make redox_w:default +``` + +Example of flashing this keyboard: + +```sh +make redox_w/rev1:default:avrdude +``` + +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). + +For nRF51822 firmware upload instruction and development see [the Redox wireless firmware repository](https://github.com/mattdibi/redox-w-firmware). + +## Redox-w Notes + +These configuration files were based off the [Mitosis](https://github.com/qmk/qmk_firmware/tree/master/keyboards/mitosis) and [Atreus](https://github.com/technomancy/atreus) keyboard. It assumes a Pro Micro is being used, however retains the 'make upload' feature from the Atreus branch. This keyboard uses a completely different 'matrix scan' system to other keyboards, it relies on an external nRF51822 microcontroller maintaining a matrix of keystates received from the keyboard halves. The matrix.c file contains the code to poll the external microcontroller for the key matrix. As long as this file is not changed, all other QMK features are supported. diff --git a/keyboards/redox_w/redox_w.c b/keyboards/redox_w/redox_w.c new file mode 100644 index 0000000000..75df91066c --- /dev/null +++ b/keyboards/redox_w/redox_w.c @@ -0,0 +1,42 @@ +#include "redox_w.h" + +void uart_init(void) { + SERIAL_UART_INIT(); +} + +void led_init(void) { + DDRD |= (1<<1); + PORTD |= (1<<1); + DDRF |= (1<<4) | (1<<5); + PORTF |= (1<<4) | (1<<5); +} + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + uart_init(); + led_init(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + +} + +#ifdef ONEHAND_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { +{{13, 0}, {12, 0}, {11, 0}, {10, 0}, {9, 0}, {8, 0}, {7, 0}, {6, 0}, {5, 0}, {4, 0}, {3, 0}, {2, 0}, {1, 0}, {0, 0}}, +{{13, 1}, {12, 1}, {11, 1}, {10, 1}, {9, 1}, {8, 1}, {7, 1}, {6, 1}, {5, 1}, {4, 1}, {3, 1}, {2, 1}, {1, 1}, {0, 1}}, +{{13, 2}, {12, 2}, {11, 2}, {10, 2}, {9, 2}, {8, 2}, {7, 2}, {6, 2}, {5, 2}, {4, 2}, {3, 2}, {2, 2}, {1, 2}, {0, 2}}, +{{13, 3}, {12, 3}, {11, 3}, {10, 3}, {9, 3}, {8, 3}, {7, 3}, {6, 3}, {5, 3}, {4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, +{{13, 4}, {12, 4}, {11, 4}, {10, 4}, {9, 4}, {8, 4}, {7, 4}, {6, 4}, {5, 4}, {4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, +}; +#endif diff --git a/keyboards/redox_w/redox_w.h b/keyboards/redox_w/redox_w.h new file mode 100644 index 0000000000..3adcb121d1 --- /dev/null +++ b/keyboards/redox_w/redox_w.h @@ -0,0 +1,40 @@ +#pragma once + +#include "quantum.h" +#include "matrix.h" +#include "backlight.h" +#include + +#define red_led_off PORTF |= (1<<5) +#define red_led_on PORTF &= ~(1<<5) +#define blu_led_off PORTF |= (1<<4) +#define blu_led_on PORTF &= ~(1<<4) +#define grn_led_off PORTD |= (1<<1) +#define grn_led_on PORTD &= ~(1<<1) + +#define set_led_off red_led_off; grn_led_off; blu_led_off +#define set_led_red red_led_on; grn_led_off; blu_led_off +#define set_led_blue red_led_off; grn_led_off; blu_led_on +#define set_led_green red_led_off; grn_led_on; blu_led_off +#define set_led_yellow red_led_on; grn_led_on; blu_led_off +#define set_led_magenta red_led_on; grn_led_off; blu_led_on +#define set_led_cyan red_led_off; grn_led_on; blu_led_on +#define set_led_white red_led_on; grn_led_on; blu_led_on + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k08, k09, k10, k11, k12, k13, \ + k14, k15, k16, k17, k18, k19, k06, k07, k22, k23, k24, k25, k26, k27, \ + k28, k29, k30, k31, k32, k33, k20, k21, k36, k37, k38, k39, k40, k41, \ + k42, k43, k44, k45, k46, k47, k34, k48, k49, k35, k50, k51, k52, k53, k54, k55, \ + k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13 }, \ + { k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27 }, \ + { k28, k29, k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k40, k41 }, \ + { k42, k43, k44, k45, k46, k47, k48, k49, k50, k51, k52, k53, k54, k55 }, \ + { k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 } \ +} diff --git a/keyboards/redox_w/rules.mk b/keyboards/redox_w/rules.mk new file mode 100644 index 0000000000..f2f73d5c5f --- /dev/null +++ b/keyboards/redox_w/rules.mk @@ -0,0 +1,76 @@ + +OPT_DEFS += -DREDOX_W_PROMICRO +INTERPHASE_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) + +# # project specific files +SRC = matrix.c + + +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +#BOOTMAGIC_ENABLE = yes # 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 +CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID + +USB = /dev/ttyACM0 + +# upload: build +# $(REDOX_W_UPLOAD_COMMAND) -- cgit v1.2.3 From cf19cb0dbeda15d51df9c513a51cd2d985747b36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fernando=20Pazos=20Est=C3=A9vez?= <30479687+fpazos@users.noreply.github.com> Date: Mon, 22 Oct 2018 20:45:46 +0200 Subject: Add Bluepill (stm32f103) handwired keyboard (#4126) * Main folder Main folder with some changes like the base layout and matrix for uploading in a future to the qmk repositorie * First Commit Firsts non previously commited changes: -Changed to keyboards/handwired -Basic credit to Xydane -70% Layout * Modified file structure for several keyboards As I don't want to create several folders and overcrowd the main folders I made a few modifications to being able of configure several keyboards as revisions of the main keyboard. Added a second variant. Compiling tests went right but I haven't tried it on the controller. * Starting leds * Started dual color leds PWM functions and configs I started to create the PWM functions and configs based on internet examples, it doesn't compile yet * Backtraced a bit to establish and try debug before continuing the pwm Just this, algo some doc as a new pinout image, space cadet modification to try if it works and little more * Deleted unuseful stuff After trying the reestructure to being compatible with several keyboards and that it worked I deleted the other keyboard. Added space cadet shift to ISO. Finally I couldn't debug everything and I'm getting quite frustrated to continue much more than just adding pwm leds * Changed again Iso fix for Space Cadet * Renamed keyboard, future pull I just renamed the keyboard and made some simplifying changes in order to make a pull request sometime soon. I'm too frustrated, tired and knowledge limited to achive using the PWM for leds, I didn't even get to use the debug mode... I intend to end basic led color change using layers (if I can), document everything properly and make a pull request so other users can continue/use this project. * Writed Readme.md file I also corrected a previous compilation problem and ordered a bit the keymaps * Corrected readme * Try to add layer activated light * Revert "Try to add layer activated light" This reverts commit 205af820d845dab08988f329b9f062f558060220. * Progress to fork Coming back to work, upcoming pull * Linked image Corrected readme * Some cleanning Added images to readme, som cleaning, burning after commit. * Almost finished (working) Finally * Finished bluepill firmware Just finished and tried layer dependant led colors. Going for merge * Deleted innecesary stuff and trailing spaces Just as commit title said. * Coding conventions Just modified some files to respect coding conventions * Deleted XXXXXX define Checking some other PR seen this improvement * Changes suggested on PR Firs doing the easy changes * More changes for the PR -I also deleted one unused function for led toggling on matrix.c (Now it uses layer dependent baklight, algo on of on start) -Deleted commented function on keymaps. Right now only needs testing and all pragma replaces. * Almost every pragma change on PR That's almost finished, only waiting for reply due to compiling errors * Revert "Almost every pragma change on PR" This reverts commit 07f23aa862b370cdf0ae37d6f2130c9e9856f491. * Revert last commit I moddified by mistake a file from another keyboard * Solved last pragma Compiles fine. Now I only need to test it, I say you if it works to include it in the main repository. --- keyboards/handwired/bluepill/bluepill.c | 1 + keyboards/handwired/bluepill/bluepill.h | 54 +++ .../handwired/bluepill/bluepill70/bluepill70.c | 1 + .../handwired/bluepill/bluepill70/bluepill70.h | 4 + .../bluepill/bluepill70/bootloader_defs.h | 10 + keyboards/handwired/bluepill/bluepill70/chconf.h | 524 +++++++++++++++++++++ keyboards/handwired/bluepill/bluepill70/config.h | 25 + keyboards/handwired/bluepill/bluepill70/flash.sh | 2 + keyboards/handwired/bluepill/bluepill70/halconf.h | 354 ++++++++++++++ keyboards/handwired/bluepill/bluepill70/led.c | 38 ++ keyboards/handwired/bluepill/bluepill70/matrix.c | 225 +++++++++ keyboards/handwired/bluepill/bluepill70/mcuconf.h | 209 ++++++++ keyboards/handwired/bluepill/bluepill70/rules.mk | 47 ++ .../bluepill/boards/GENERIC_STM32_F103/board.c | 49 ++ .../bluepill/boards/GENERIC_STM32_F103/board.h | 170 +++++++ .../bluepill/boards/GENERIC_STM32_F103/board.mk | 5 + keyboards/handwired/bluepill/config.h | 58 +++ .../handwired/bluepill/keymaps/default/keymap.c | 69 +++ keyboards/handwired/bluepill/keymaps/iso/keymap.c | 69 +++ keyboards/handwired/bluepill/ld/MKL26Z64.ld | 105 +++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ++++ keyboards/handwired/bluepill/readme.md | 60 +++ keyboards/handwired/bluepill/rules.mk | 10 + 23 files changed, 2177 insertions(+) create mode 100644 keyboards/handwired/bluepill/bluepill.c create mode 100644 keyboards/handwired/bluepill/bluepill.h create mode 100644 keyboards/handwired/bluepill/bluepill70/bluepill70.c create mode 100644 keyboards/handwired/bluepill/bluepill70/bluepill70.h create mode 100644 keyboards/handwired/bluepill/bluepill70/bootloader_defs.h create mode 100644 keyboards/handwired/bluepill/bluepill70/chconf.h create mode 100644 keyboards/handwired/bluepill/bluepill70/config.h create mode 100644 keyboards/handwired/bluepill/bluepill70/flash.sh create mode 100644 keyboards/handwired/bluepill/bluepill70/halconf.h create mode 100644 keyboards/handwired/bluepill/bluepill70/led.c create mode 100644 keyboards/handwired/bluepill/bluepill70/matrix.c create mode 100644 keyboards/handwired/bluepill/bluepill70/mcuconf.h create mode 100644 keyboards/handwired/bluepill/bluepill70/rules.mk create mode 100644 keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/handwired/bluepill/config.h create mode 100644 keyboards/handwired/bluepill/keymaps/default/keymap.c create mode 100644 keyboards/handwired/bluepill/keymaps/iso/keymap.c create mode 100644 keyboards/handwired/bluepill/ld/MKL26Z64.ld create mode 100644 keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld create mode 100644 keyboards/handwired/bluepill/readme.md create mode 100644 keyboards/handwired/bluepill/rules.mk diff --git a/keyboards/handwired/bluepill/bluepill.c b/keyboards/handwired/bluepill/bluepill.c new file mode 100644 index 0000000000..85c92dfe96 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill.c @@ -0,0 +1 @@ +#include "bluepill.h" \ No newline at end of file diff --git a/keyboards/handwired/bluepill/bluepill.h b/keyboards/handwired/bluepill/bluepill.h new file mode 100644 index 0000000000..a686d155ce --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill.h @@ -0,0 +1,54 @@ +#pragma once + +#include "quantum.h" +#include "led.h" + +/* ANSI LAYOUT + ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD + GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL + TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM + CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END + LSI| (<)| Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNL + LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG +*/ + +#define LAYOUT_seventy_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K59 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K0E, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K1D, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { K50, K51, K52, KC_NO, KC_NO, KC_NO, K53, KC_NO, KC_NO,K54, K55, K56, K57, K58, K59 } \ +} + +/* ISO LAYOUT + ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD + GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL + TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM + CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END + LSI| < | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNL + LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG +*/ + +#define LAYOUT_seventy_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K59 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K0E, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K1D, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ + { K50, K51, K52, KC_NO, KC_NO, KC_NO, K53, KC_NO, KC_NO,K54, K55, K56, K57, K58, K59 } \ +} diff --git a/keyboards/handwired/bluepill/bluepill70/bluepill70.c b/keyboards/handwired/bluepill/bluepill70/bluepill70.c new file mode 100644 index 0000000000..511c602d45 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/bluepill70.c @@ -0,0 +1 @@ +#include "bluepill70.h" \ No newline at end of file diff --git a/keyboards/handwired/bluepill/bluepill70/bluepill70.h b/keyboards/handwired/bluepill/bluepill70/bluepill70.h new file mode 100644 index 0000000000..8a313cc500 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/bluepill70.h @@ -0,0 +1,4 @@ +#pragma once +#include "bluepill.h" +// Modified by Xydane +// #define LAYOUT(k00) {{ k00 }} \ No newline at end of file diff --git a/keyboards/handwired/bluepill/bluepill70/bootloader_defs.h b/keyboards/handwired/bluepill/bluepill70/bootloader_defs.h new file mode 100644 index 0000000000..0f45203cb6 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/handwired/bluepill/bluepill70/chconf.h b/keyboards/handwired/bluepill/bluepill70/chconf.h new file mode 100644 index 0000000000..dfb1f9dfb9 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 16 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 2000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/bluepill/bluepill70/config.h b/keyboards/handwired/bluepill/bluepill70/config.h new file mode 100644 index 0000000000..87fd74633f --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/config.h @@ -0,0 +1,25 @@ +#pragma once + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c works */ + +// Modified by Xydane +#define MANUFACTURER "QMK" +#define USBSTR_MANUFACTURER 'T', '\x00', 'M', '\x00', 'K', '\x00', ' ', '\x00', '\xc6', '\x00' +#define PRODUCT "BluePill70" +#define USBSTR_PRODUCT 'C', '\x00', 'h', '\x00', 'i', '\x00', 'b', '\x00', 'i', '\x00', 'O', '\x00', 'S', '\x00', ' ', '\x00', 'Q', '\x00', 'M', '\x00', 'K', '\x00' +#define DESCRIPTION "QMK keyboard firmware with ChibiOS" + +/* key matrix size */ +// Modified by Xydane +#define MATRIX_ROWS 6 +#define MATRIX_COLS 15 +#define DIODE_DIRECTION COL2ROW + +// Iso fix for Space Cadet, comment for ANSI layouts +#define LSPO_KEY KC_8 +#define RSPC_KEY KC_9 \ No newline at end of file diff --git a/keyboards/handwired/bluepill/bluepill70/flash.sh b/keyboards/handwired/bluepill/bluepill70/flash.sh new file mode 100644 index 0000000000..d001ff007e --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/flash.sh @@ -0,0 +1,2 @@ +#!/bin/bash +Arduino_STM32_usb_hid/tools/linux/maple_upload ttyACM0 2 1EAF:0003 build/ch.bin \ No newline at end of file diff --git a/keyboards/handwired/bluepill/bluepill70/halconf.h b/keyboards/handwired/bluepill/bluepill70/halconf.h new file mode 100644 index 0000000000..5be284cd35 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/halconf.h @@ -0,0 +1,354 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM TRUE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +// Modified by Xydane +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/handwired/bluepill/bluepill70/led.c b/keyboards/handwired/bluepill/bluepill70/led.c new file mode 100644 index 0000000000..5c557bbee1 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/led.c @@ -0,0 +1,38 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" +#include "led.h" + + +void led_set(uint8_t usb_led){ + if (usb_led & (1< + +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 . +*/ + +#include "ch.h" +#include "hal.h" + +/* + * scan matrix + */ +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "wait.h" + +//#include "pwm.c" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + +inline uint8_t matrix_rows(void){ + return MATRIX_ROWS; +} + +inline uint8_t matrix_cols(void){ + return MATRIX_COLS; +} + +/* generic STM32F103C8T6 board */ +#ifdef BOARD_GENERIC_STM32_F103 +// This could be removed, only used now in matrix_init() +#define LED_ON() do { palClearPad(GPIOA, 1) ;} while (0) +#define LED_OFF() do { palSetPad(GPIOA, 1); } while (0) +#endif + +__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) { +} + +void matrix_init(void) +{ + // initialize row and col + unselect_rows(); + init_cols(); + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + //debug + debug_matrix = true; + LED_ON(); + wait_ms(500); + LED_OFF(); + + matrix_init_quantum(); +} + +uint8_t matrix_scan(void){ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + wait_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + wait_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_is_on(uint8_t row, uint8_t col){ + return (matrix[row] & ((matrix_row_t)1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 \ No newline at end of file diff --git a/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 0000000000..2809c9d184 --- /dev/null +++ b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,49 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { +} diff --git a/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 0000000000..75bb848fd0 --- /dev/null +++ b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,170 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOC_LED 13 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* Backlighting */ + +/*#define GPIOC_BACKLIGHT_PIN 15*/ + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 0000000000..6b8b312fd9 --- /dev/null +++ b/keyboards/handwired/bluepill/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/handwired/bluepill/config.h b/keyboards/handwired/bluepill/config.h new file mode 100644 index 0000000000..aeab1808a8 --- /dev/null +++ b/keyboards/handwired/bluepill/config.h @@ -0,0 +1,58 @@ +/* +Copyright 2015 Jun Wako + +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 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +// Modified by Xydane +#define DEBOUNCE 1 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Backlighting include */ +/*#define BACKLIGHT_PIN 19 +#define BACKLIGHT_LEVELS 5 +#define BACKLIGHT_BREATHING +#define BREATHING_PERIOD 6*/ +/* + * 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 \ No newline at end of file diff --git a/keyboards/handwired/bluepill/keymaps/default/keymap.c b/keyboards/handwired/bluepill/keymaps/default/keymap.c new file mode 100644 index 0000000000..8a34930390 --- /dev/null +++ b/keyboards/handwired/bluepill/keymaps/default/keymap.c @@ -0,0 +1,69 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ + +#include QMK_KEYBOARD_H + +// Define layer names +#define _NORMAL 0 +#define _FNONE 1 +#define _FNTWO 2 + +// Highly Modified by Xydane +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NORMAL] = LAYOUT_seventy_ansi( + 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_PSCREEN,KC_HOME, KC_END, \ +KC_GRAVE, 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_DELETE, \ + 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_PGUP, \ + 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_SLASH,KC_PGDOWN, \ + KC_LSPO, XXXXXXX,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP, TT(2), \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_FNONE] = LAYOUT_seventy_ansi( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), + + [_FNTWO] = LAYOUT_seventy_ansi( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS, KC_MUTE,KC_VOLD,KC_VOLU,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), +}; + +/* Layer based ilumination, just binary */ +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _FNONE: + palSetPad(GPIOA, 0); //OFF Color A + palClearPad(GPIOA, 1); //ON Color B + break; + case _FNTWO: + palClearPad(GPIOA, 0); //ON Color A + palClearPad(GPIOA, 1); //ON Color B + break; + default: // for any other layers, or the default layer + palClearPad(GPIOA, 0); //ON Color A + palSetPad(GPIOA, 1); //OFF Color B + break; + } + return state; +} \ No newline at end of file diff --git a/keyboards/handwired/bluepill/keymaps/iso/keymap.c b/keyboards/handwired/bluepill/keymaps/iso/keymap.c new file mode 100644 index 0000000000..a6aedde7a3 --- /dev/null +++ b/keyboards/handwired/bluepill/keymaps/iso/keymap.c @@ -0,0 +1,69 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ + +#include QMK_KEYBOARD_H + +// Define layer names +#define _NORMAL 0 +#define _FNONE 1 +#define _FNTWO 2 + +// Highly Modified by Xydane +const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_NORMAL] = LAYOUT_seventy_iso( + 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_PSCREEN,KC_HOME, KC_END, \ +KC_GRAVE, 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_DELETE, \ + 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_PGUP, \ + 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_NUHS, KC_ENT,KC_PGDOWN, \ + KC_LSPO, KC_NUBS,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSPC,KC_UP, TT(2), \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT ), + + [_FNONE] = LAYOUT_seventy_iso( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_NLCK, KC_CALC, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), + + [_FNTWO] = LAYOUT_seventy_iso( + KC_TRNS, KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT, KC_TRNS,KC_MUTE,KC_VOLD,KC_VOLU, KC_TRNS,KC_TRNS,KC_NLCK, KC_CALC, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P7, KC_P8, KC_P9, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P4, KC_P5, KC_P6, KC_PPLS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_P1, KC_P2, KC_P3, KC_PAST, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_P0, KC_PDOT,KC_PENT, KC_PSLS, KC_TRNS,KC_TRNS,KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS ), +}; + +/* Layer based ilumination, just binary */ +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _FNONE: + palSetPad(GPIOA, 0); //OFF Color A + palClearPad(GPIOA, 1); //ON Color B + break; + case _FNTWO: + palClearPad(GPIOA, 0); //ON Color A + palClearPad(GPIOA, 1); //ON Color B + break; + default: // for any other layers, or the default layer + palClearPad(GPIOA, 0); //ON Color A + palSetPad(GPIOA, 1); //OFF Color B + break; + } + return state; +} \ No newline at end of file diff --git a/keyboards/handwired/bluepill/ld/MKL26Z64.ld b/keyboards/handwired/bluepill/ld/MKL26Z64.ld new file mode 100644 index 0000000000..c4ca8b874c --- /dev/null +++ b/keyboards/handwired/bluepill/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 0000000000..f9bfe9c005 --- /dev/null +++ b/keyboards/handwired/bluepill/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 128k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/bluepill/readme.md b/keyboards/handwired/bluepill/readme.md new file mode 100644 index 0000000000..8b53f12f46 --- /dev/null +++ b/keyboards/handwired/bluepill/readme.md @@ -0,0 +1,60 @@ + +# BluePill handwired + +Keyboards using a BluePill controller (generic Chinese STM32F103C8T6) and based on the [KC64 of Xydane](https://github.com/Xydane/qmk_firmware). + +Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. +Hardware Supported: Bluepill STM32F103C8T6 +Hardware Availability: Everywhere + +Make example for BluePill70 (after setting up your build environment): + +make handwired/bluepill/bluepill70:default + +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + +Read everything before using it. + +## Introduction + +First of all thanks to [Xydane](https://github.com/Xydane) at [GeekHack](https://geekhack.org/) for his advice and his repository, without it you couldn't be reading this. + +That's was an attempt to create a firmware using an STM32F103C8T6, and in a "future", also developing a revision for split keyboards. But... +As I'm mainly a web developer I didn't even get to debug the controller, not to speak about ChibiOS. So I just structured everything, created a working 70% layout and leave the project to someone with more knowledge and patience. + +## Resistor fix + +If you want to use the Bluepill USB port, it's very likely that you need to solder a 1.8 kΩ between PA12 and 3.3V. That depends on the PC's motherboard but I needed, more info [here](https://wiki.stm32duino.com/index.php?title=Blue_Pill). + +## No bootloader + +Neither Xydane or I used the bootloader, the code for it is commented and you can use it if you want. I didn't achieve to run it and just used a serial programmer (FTDI, ST-LINK). + +## Adding layouts and revisions + +If you want to create new layouts just add them to the keymaps folder. If you prefer to develop a more complex revision just copy the bluepill70 folder, rename it and create a new keymap in /keymap.c (I tried to divide the project even more but it didn't worked). + +## Pinout + +That's the pinout; + + A5 A15 A10 A9 A8 B15 B14 B13 B12 B11 B10 B1 B0 A7 A6 + B9 ESC| F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10| F11| F12| PSC| PGU| PGD + B8 GRA| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ' | ¡ | BCKS | DEL + B7 TAB| Q | W | E | R | T | Y | U | I | O | P | ` | + | | HOM + B6 CAP| A | S | D | F | G | H | J | K | L | Ñ | ´ | Ç | ENTER | END + B5 LSI| < | Z | X | C | V | B | N | M | , | . | - | RSHIF | UP | FNT + A4 LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG + +And the wiring: +ISO +![Wiring](https://i.imgur.com/ZCaxVzs.jpg) +ANSI +![Wiring](https://i.imgur.com/dBUJCdD.jpg) + +It also uses: +PC13: Caps Lock led. + +Backlight dual color leds, my version is for common anode that's more common, for leds with common anode just replace the palSetPad with palClearPad and viceversa. +PA1: Backlight color A. +PA0: Backlight color B. \ No newline at end of file diff --git a/keyboards/handwired/bluepill/rules.mk b/keyboards/handwired/bluepill/rules.mk new file mode 100644 index 0000000000..38bacae34d --- /dev/null +++ b/keyboards/handwired/bluepill/rules.mk @@ -0,0 +1,10 @@ +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = yes # Console for debug +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +MOUSEKEY_ENABLE = no + +DEFAULT_FOLDER = handwired/bluepill/bluepill70 \ No newline at end of file -- cgit v1.2.3 From 5694e7b6a60e0a1b60c1bd7fce51e99a8314abb7 Mon Sep 17 00:00:00 2001 From: ROMUSKING <38523153+ROMUSKING@users.noreply.github.com> Date: Mon, 22 Oct 2018 19:54:31 +0100 Subject: Keymap: add new keymap (#4127) * an attempt at own layout * typematrixed dvorak * columns shifted columns shifted out, second pinky column moved to the inside. * Update users/romus/romus.h * code cleanup Changes requested by Drashna + Tap Dance enabled * Fixed EOF Fixed the no newline at the end of file alert. * rgblight fight eeprom writes * rgb code simplification * Update users/romus/README.md * Update quantum/keymap_extras/keymap_slovenian.h --- .../lets_split_eh/keymaps/doxish_dvorak/config.h | 21 + .../lets_split_eh/keymaps/doxish_dvorak/keymap.c | 161 ++++++ .../lets_split_eh/keymaps/doxish_dvorak/rules.mk | 0 keyboards/lets_split_eh/keymaps/romus/README.md | 7 + keyboards/lets_split_eh/keymaps/romus/keymap.c | 28 ++ keyboards/lets_split_eh/keymaps/romus/rules.mk | 7 + quantum/keymap_extras/keymap_slovenian.h | 1 + users/romus/README.md | 45 ++ users/romus/config.h | 8 + users/romus/romus.c | 557 +++++++++++++++++++++ users/romus/romus.h | 272 ++++++++++ users/romus/rules.mk | 24 + 12 files changed, 1131 insertions(+) create mode 100644 keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h create mode 100644 keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c create mode 100644 keyboards/lets_split_eh/keymaps/doxish_dvorak/rules.mk create mode 100644 keyboards/lets_split_eh/keymaps/romus/README.md create mode 100644 keyboards/lets_split_eh/keymaps/romus/keymap.c create mode 100644 keyboards/lets_split_eh/keymaps/romus/rules.mk create mode 100644 users/romus/README.md create mode 100644 users/romus/config.h create mode 100644 users/romus/romus.c create mode 100644 users/romus/romus.h create mode 100644 users/romus/rules.mk diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h b/keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h new file mode 100644 index 0000000000..526c0837c7 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/doxish_dvorak/config.h @@ -0,0 +1,21 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c new file mode 100644 index 0000000000..8976081542 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c @@ -0,0 +1,161 @@ +#include "eeconfig.h" + +extern keymap_config_t keymap_config; + +// 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 _DVORAK 0 + +#define _LOWER 3 +#define _RAISE 4 +#define _FUNCTION 15 +#define _ADJUST 16 + +enum custom_keycodes { + DVORAK = SAFE_RANGE, + LOWER, + RAISE, + ADJUST +}; + +// Defines for task manager and such +#define CALTDEL LCTL(LALT(KC_DEL)) +#define TSKMGR LCTL(LSFT(KC_ESC)) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Func | A | S | D | F | G | H | J | K | L | ; | Enter| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | ` | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( \ + KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_TAB, KC_BSPC, KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, KC_ENT, KC_ENT, KC_D, KC_H, KC_T, KC_N, KC_S, \ + KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, OSM(MOD_LSFT), OSM(MOD_RSFT), KC_B, KC_M, KC_W, KC_V, KC_Z, \ + KC_LCTL, KC_LGUI, KC_LALT, OSM(MOD_LSFT), KC_SPC, LOWER, RAISE, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/*[BASE] = LAYOUT( + * KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, + * KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, + * KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, + * OSM(MOD_LSFT), OSM(MOD_LCTL), MO(KEYSEL), MO(BROWSER_CONTROL), MO(COMBINED), MO(KEYNAV), KC_ENTER, KC_SPACE, KC_BSPC, RCTL(KC_BSPC), KC_CAPSLOCK, OSM(MOD_LSFT) + * ), + *KC_GRV, + */ +/* Lower + * ,-----------------------------------------------------------------------------------. + * | Esc | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | Mute | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( \ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, KC_MUTE, _______, KC_PIPE, \ + _______, _______, _______, _______, KC_BSPC, _______, _______, KC_BSPC, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | 4 | 5 | 6 | + | F5 | F6 | - | = | [ | ] |Enter | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |Enter | 7 | 8 | 9 | - | F11 | F12 |ISO # |ISO / | Mute | | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | , | 0 | . |Lower | Bksp | Bksp |Raise | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_4, KC_5, KC_6, KC_PLUS, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, \ + KC_ENT, KC_7, KC_8, KC_9, KC_MINS, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_MUTE, _______, KC_BSLS, \ + _______, KC_COMM, KC_0, KC_DOT, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | |BLSTEP| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | RESET| + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( \ + TSKMGR, _______, _______, _______, _______, _______, KC_DEL, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ + _______, _______, _______, _______, _______, _______, _______, DVORAK, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ +), + +/* Function + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down |Right | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Caps | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_FUNCTION] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/rules.mk b/keyboards/lets_split_eh/keymaps/doxish_dvorak/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/lets_split_eh/keymaps/romus/README.md b/keyboards/lets_split_eh/keymaps/romus/README.md new file mode 100644 index 0000000000..d54ed6856f --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/romus/README.md @@ -0,0 +1,7 @@ +# Lets Split Eh Layout + +Check out [user readme](../../../../users/romus/README.md) for more info. + +# Usage + +Fill in after flashing diff --git a/keyboards/lets_split_eh/keymaps/romus/keymap.c b/keyboards/lets_split_eh/keymaps/romus/keymap.c new file mode 100644 index 0000000000..ba5b75a5cf --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/romus/keymap.c @@ -0,0 +1,28 @@ +#include QMK_KEYBOARD_H +#include "romus.h" + + +void matrix_init_keymap (void) { +} + +uint32_t layer_state_set_keymap(uint32_t state) { + + return state; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // Main Dvorak layer + [_DV] = LAYOUT_letssplit_wrapper(DVORAK), + // Turkish and special character overlay + [_AL] = LAYOUT_letssplit_wrapper(ALTCHAR), + // Gaming layer + [_GA] = LAYOUT_letssplit_wrapper(GAME), + // Numbers layer + [_NU] = LAYOUT_letssplit_wrapper(NUMBERS), + // Settings layer + [_SE] = LAYOUT_letssplit_wrapper(SETTINGS), + // Mouse emulation layer + [_MO] = LAYOUT_letssplit_wrapper(MOUSE), + // Music layer + [_MU] = LAYOUT_letssplit_wrapper(MUSIC), +}; diff --git a/keyboards/lets_split_eh/keymaps/romus/rules.mk b/keyboards/lets_split_eh/keymaps/romus/rules.mk new file mode 100644 index 0000000000..ad7dd4c474 --- /dev/null +++ b/keyboards/lets_split_eh/keymaps/romus/rules.mk @@ -0,0 +1,7 @@ +# Build options + +BACKLIGHT_ENABLE = no # Switch LEDs +MOUSEKEY_ENABLE = yes # Emulates mouse key using keypresses +RGBLIGHT_ENABLE = yes # LED strips +TAP_DANCE_ENABLE = yes # Use multi-tap features +AUDIO_ENABLE = no # Audio stuff diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 53d07837e9..a9db17becd 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -1,4 +1,5 @@ /* Copyright 2018 Žan Pevec + * * 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 diff --git a/users/romus/README.md b/users/romus/README.md new file mode 100644 index 0000000000..0de9d9a817 --- /dev/null +++ b/users/romus/README.md @@ -0,0 +1,45 @@ +# overview + + this is a modified version of let's split keyboard from bbaserdem. i don't like standard dvorak overuses right pinky + so i shifted the columns out. i'm not sure if this is any good, time will tell. + + i have ortholinear let's split eh, which share a lot of functions with other ortholinear keyboards. + +# layout + +i use dvorak with an unorthodox off layout. +if you wanna grab my code, and you used a layout with a persistent base +layer change, change it to layer 0 before proceeding. + +# layers + +* **dvorak**: base layer,with dvorak layout. +* **alternative**: has alternate characters. +* **game**: toggled from *function*, comfortable for gaming use. +* **numeric**: has numericals and symbols. can be locked. +* **function**: layer has media and function keys. +* **mouse**: manipulates mouse. can be locked. +* **music** allows playing sounds. + +# functionality + +* **rgb backlight**: with layer indication, and ability to change base layer lighting mode. +* **secrets**: by placing a secrets.h, and not tracking it, passwords can be stored. +* **mouse**: mouse emulation, complete with diagonal keys. +* **turkish**: an altgr-like overlay that allows some non-common letters, in unicode. + +i suggest checking out how i enabled turkish keys, +how i planned out rgb lighting, +and my mouse implementation; +they might offer some insight into fringe user cases. + +# issues + +all features are too big for the 32kb bootloader. +offenders are audio and rgb lights; it comes down to one or the other. + +~the proton board, and rev 6 might fix that.~ + +# credits + +this is a modified version of let's split keyboard from bbaserdem who has previously written his keymap by himself before, but rewrote it here. diff --git a/users/romus/config.h b/users/romus/config.h new file mode 100644 index 0000000000..9332febe63 --- /dev/null +++ b/users/romus/config.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef TAP_DANCE_ENABLE + #define TAPPING_TERM 300 + #define TAPPING_TOGGLE 1 +#endif + +// !USERSPACE_CONFIG_H diff --git a/users/romus/romus.c b/users/romus/romus.c new file mode 100644 index 0000000000..35b524f941 --- /dev/null +++ b/users/romus/romus.c @@ -0,0 +1,557 @@ +#include "romus.h" + +/*---------------*\ +|*-----MOUSE-----*| +\*---------------*/ +#ifdef MOUSEKEY_ENABLE +#include "mousekey.h" +#endif + +/*-------------*\ +|*-----RGB-----*| +\*-------------*/ +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif + +/*-------------*\ +|*---UNICODE---*| +\*-------------*/ +#ifdef UNICODE_ENABLE +#endif + +/*-----------------*\ +|*-----SECRETS-----*| +\*-----------------*/ +// Enabled by adding a non-tracked secrets.h to this dir. +#if (__has_include("secrets.h")) +#include "secrets.h" +#endif + +/*---------------*\ +|*-----MUSIC-----*| +\*---------------*/ +#ifdef AUDIO_ENABLE +float tone_game[][2] = SONG(ZELDA_PUZZLE); +float tone_return[][2] = SONG(ZELDA_TREASURE); +float tone_linux[][2] = SONG(UNICODE_LINUX); +float tone_windows[][2] = SONG(UNICODE_WINDOWS); +#endif + +/*-------------------*\ +|*-----TAP-DANCE-----*| +\*-------------------*/ +#ifdef TAP_DANCE_ENABLE +qk_tap_dance_action_t tap_dance_actions[] = { + // Shift on double tap of semicolon + [SCL] = ACTION_TAP_DANCE_DOUBLE( KC_SCLN, KC_COLN ) +}; +#endif + +/* In keymaps, instead of writing _user functions, write _keymap functions + * The __attribute__((weak)) allows for empty definitions here, and during + * compilation, if these functions are defined elsewhere, they are written + * over. This allows to include custom code from keymaps in the generic code + * in this file. + */ +__attribute__ ((weak)) void matrix_init_keymap(void) { } +__attribute__ ((weak)) void matrix_scan_keymap(void) { } +__attribute__ ((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} +__attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { + return state; +} +__attribute__ ((weak)) void led_set_keymap(uint8_t usb_led) { } + +/* ----------------------- *\ + * -----RGB Functions----- * +\* ----------------------- */ +#ifdef RGBLIGHT_ENABLE + +// Set RGBLIGHT state depending on layer +void rgblight_change( uint8_t this_layer ) { + // Enable RGB light; will not work without this + //rgblight_enable_noeeprom(); + // Change RGB light + switch ( this_layer ) { + case _DV: + // Load base layer + rgblight_disable_noeeprom(); + break; + case _AL: + // Do yellow for alternate + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom( 60,255,255); + + + break; + case _GA: + // Do purple for game + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(285,255,255); + + + break; + case _NU: + // Do azure for number + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(186,200,255); + + + break; + case _SE: + // Do red for settings + rgblight_enable_noeeprom(); + + rgblight_sethsv_noeeprom( 16,255,255); + + break; + case _MO: + // Do green for mouse + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(120,255,255); + + + break; + case _MU: + // Do orange for music + + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom( 39,255,255); + + break; + default: + // Something went wrong + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom( 0,255,255); + + break; + } +} + +#endif + +/*---------------------*\ +|*-----MATRIX INIT-----*| +\*---------------------*/ +void matrix_init_user (void) { + + // Keymap specific things, do it first thing to allow for delays etc + matrix_init_keymap(); + + // Correct unicode +#ifdef UNICODE_ENABLE + set_unicode_input_mode(UC_LNX); +#endif + + // Make beginning layer DVORAK + set_single_persistent_default_layer(_DV); + +} + +/*---------------------*\ +|*-----MATRIX SCAN-----*| +\*---------------------*/ +void matrix_scan_user (void) { + // Keymap specific, do it first + matrix_scan_keymap(); +} + +/*------------------*\ +|*-----KEYCODES-----*| +\*------------------*/ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + // Shift check + bool is_capital = ( keyboard_report->mods & (MOD_BIT(KC_LSFT)|MOD_BIT(KC_RSFT)) ); + static bool lock_flag = false; + uint8_t layer = biton32 (layer_state); + + switch (keycode) { + // Secrets implementation +#if (__has_include("secrets.h")) + case SECRET1: + if( !record->event.pressed ) { + send_string_P( secret[ keycode - SECRET1 ] ); + } + return false; + break; + case SECRET2: + if( !record->event.pressed ) { + send_string_P( secret[ keycode - SECRET2 ] ); + } + return false; + break; + case SECRET3: + if( !record->event.pressed ) { + send_string_P( secret[ keycode - SECRET3 ] ); + } + return false; + break; +#endif + + // Lock functionality: These layers are locked if the LOCKED buttons are + // pressed. Otherwise, they are momentary toggles + case K_LOCK: + if (record->event.pressed) { + lock_flag = !lock_flag; + } + return false; + break; + case K_MOUSE: + if (record->event.pressed) { + layer_on(_MO); + lock_flag = false; + } else { + if ( lock_flag ) { + lock_flag = false; + } else { + layer_off(_MO); + } + } + return false; + break; + case K_NUMBR: + if (record->event.pressed) { + layer_on(_NU); + lock_flag = false; + } else { + if ( lock_flag ) { + lock_flag = false; + } else { + layer_off(_NU); + } + } + return false; + break; + + // Layer switches with sound + case K_GAMES: + if (record->event.pressed) { + // On press, turn off layer if active + if ( layer == _GA ) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_return); +#endif + layer_off(_GA); + } + } else { + // After click, turn on layer if accessed from setting + if ( layer == _SE ) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_game); +#endif + layer_on(_GA); + layer_off(_SE); + } + } + return false; + break; + case MU_TOG: + if (record->event.pressed) { + // On press, turn off layer if active + if ( layer == _SE ) { + layer_off(_SE); + layer_on(_MU); + } else { + layer_off(_MU); + } + } + return true; + break; + +//------UNICODE + // Unicode switches with sound +#ifdef UNICODE_ENABLE + case UNI_LI: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_linux); +#endif + set_unicode_input_mode(UC_LNX); + } + return false; + break; + case UNI_WN: + if (record->event.pressed) { +#ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_windows); +#endif + set_unicode_input_mode(UC_WIN); + } + return false; + break; + + // Turkish letters, with capital functionality + case TUR_A: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x00c2); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x00e2); + unicode_input_finish(); + } + } + return false; + break; + case TUR_O: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x00d6); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x00f6); + unicode_input_finish(); + } + } + return false; + break; + case TUR_U: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x00dc); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x00fc); + unicode_input_finish(); + } + } + return false; + break; + case TUR_I: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x0130); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x0131); + unicode_input_finish(); + } + } + return false; + break; + case TUR_G: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x011e); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x011f); + unicode_input_finish(); + } + } + return false; + break; + case TUR_C: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x00c7); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x00e7); + unicode_input_finish(); + } + } + return false; + break; + case TUR_S: + if (record->event.pressed) { + if ( is_capital ) { + unicode_input_start(); + register_hex(0x015e); + unicode_input_finish(); + } else { + unicode_input_start(); + register_hex(0x015f); + unicode_input_finish(); + } + } + return false; + break; +#endif + +//-------Diagonal mouse movements +#ifdef MOUSEKEY_ENABLE + case MO_NE: + if( record->event.pressed ) { + mousekey_on(MO_N); + mousekey_on(MO_E); + mousekey_send(); + } else { + mousekey_off(MO_N); + mousekey_off(MO_E); + mousekey_send(); + } + return false; + break; + case MO_NW: + if( record->event.pressed ) { + mousekey_on(MO_N); + mousekey_on(MO_W); + mousekey_send(); + } else { + mousekey_off(MO_N); + mousekey_off(MO_W); + mousekey_send(); + } + return false; + break; + case MO_SE: + if( record->event.pressed ) { + mousekey_on(MO_S); + mousekey_on(MO_E); + mousekey_send(); + } else { + mousekey_off(MO_S); + mousekey_off(MO_E); + mousekey_send(); + } + return false; + break; + case MO_SW: + if( record->event.pressed ) { + mousekey_on(MO_S); + mousekey_on(MO_W); + mousekey_send(); + } else { + mousekey_off(MO_S); + mousekey_off(MO_W); + mousekey_send(); + } + return false; + break; + case MO_S_NE: + if( record->event.pressed ) { + mousekey_on(MO_S_N); + mousekey_on(MO_S_E); + mousekey_send(); + } else { + mousekey_off(MO_S_N); + mousekey_off(MO_S_E); + mousekey_send(); + } + return false; + break; + case MO_S_NW: + if( record->event.pressed ) { + mousekey_on(MO_S_N); + mousekey_on(MO_S_W); + mousekey_send(); + } else { + mousekey_off(MO_S_N); + mousekey_off(MO_S_W); + mousekey_send(); + } + return false; + break; + case MO_S_SE: + if( record->event.pressed ) { + mousekey_on(MO_S_S); + mousekey_on(MO_S_E); + mousekey_send(); + } else { + mousekey_off(MO_S_S); + mousekey_off(MO_S_E); + mousekey_send(); + } + return false; + break; + case MO_S_SW: + if( record->event.pressed ) { + mousekey_on(MO_S_S); + mousekey_on(MO_S_W); + mousekey_send(); + } else { + mousekey_off(MO_S_S); + mousekey_off(MO_S_W); + mousekey_send(); + } + return false; + break; +#endif + +//------DOUBLE PRESS, with added left navigation + case DBL_SPC: + if( record->event.pressed ) { + SEND_STRING(" "SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_ANG: + if( record->event.pressed ) { + SEND_STRING("<>"SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_PAR: + if( record->event.pressed ) { + SEND_STRING("()"SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_SQR: + if( record->event.pressed ) { + SEND_STRING("[]"SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_BRC: + if( record->event.pressed ) { + SEND_STRING("{}"SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_QUO: + if( record->event.pressed ) { + SEND_STRING("\'\'"SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_DQT: + if( record->event.pressed ) { + SEND_STRING("\"\""SS_TAP(X_LEFT)); + } + return false; + break; + case DBL_GRV: + if( record->event.pressed ) { + SEND_STRING("``"SS_TAP(X_LEFT)); + } + return false; + break; +// END OF KEYCODES + } + return process_record_keymap(keycode, record); +} + +/*----------------------*\ +|*-----LAYER CHANGE-----*| +\*----------------------*/ + +uint32_t layer_state_set_user(uint32_t state) { + + state = layer_state_set_keymap (state); +#ifdef RGBLIGHT_ENABLE + // Change RGB lighting depending on the last layer activated + rgblight_change( biton32(state) ); +#endif + return state; +} \ No newline at end of file diff --git a/users/romus/romus.h b/users/romus/romus.h new file mode 100644 index 0000000000..265c942e92 --- /dev/null +++ b/users/romus/romus.h @@ -0,0 +1,272 @@ +// This is a modified version of Let's Split keyboard from bbaserdem + +#pragma once + +#include "quantum.h" + +// Use 7 wide characters for keymaps +#define _______ KC_TRNS +#define XXX KC_NO + +// Layers +#define _DV 0 // Base layer +#define _AL 1 // Alt char overlay +#define _GA 2 // Game layer +#define _NU 3 // Numbers layer +#define _SE 4 // Settings layer +#define _MO 5 // Mouse emulation +#define _MU 6 // Music mode + +// Define short macros +#define UNDO LCTL(KC_Z) +#define REDO LCTL(KC_Y) +#define COPY LCTL(KC_C) +#define CUT LCTL(KC_X) +#define PASTE LCTL(KC_V) +#define EXIT LALT(KC_F4) +#define CAPS SFT_T(KC_CAPS) + + +// Rename mouse keys with 7 letters +#ifdef MOUSEKEY_ENABLE +#define MO_S_N KC_MS_WH_UP +#define MO_S_S KC_MS_WH_DOWN +#define MO_S_E KC_MS_WH_RIGHT +#define MO_S_W KC_MS_WH_LEFT +#define MO_N KC_MS_UP +#define MO_S KC_MS_DOWN +#define MO_E KC_MS_RIGHT +#define MO_W KC_MS_LEFT +#define MO_CL_L KC_MS_BTN1 +#define MO_CL_R KC_MS_BTN2 +#define MO_CL_M KC_MS_BTN3 +#define MO_CL_4 KC_MS_BTN4 +#define MO_CL_5 KC_MS_BTN5 +#define MO_AC_0 KC_MS_ACCEL0 +#define MO_AC_1 KC_MS_ACCEL1 +#define MO_AC_2 KC_MS_ACCEL2 +#else +#define MO_S_N KC_NO +#define MO_S_S KC_NO +#define MO_S_E KC_NO +#define MO_S_W KC_NO +#define MO_N KC_NO +#define MO_S KC_NO +#define MO_E KC_NO +#define MO_W KC_NO +#define MO_CL_L KC_NO +#define MO_CL_R KC_NO +#define MO_CL_M KC_NO +#define MO_CL_1 KC_NO +#define MO_CL_2 KC_NO +#define MO_AC_0 KC_NO +#define MO_AC_1 KC_NO +#define MO_AC_2 KC_NO +#endif + +// Rename music keys with <8 letters +#ifdef AUDIO_ENABLE +#define MU_REC KC_LCTL +#define MU_STOP KC_LALT +#define MU_PLAY KC_LGUI +#define MU_PLAY KC_LGUI +#define MU_FAST KC_UP +#define MU_SLOW KC_DOWN +#define MU_MASK KC_A +#else +#define MU_REC KC_NO +#define MU_STOP KC_NO +#define MU_PLAY KC_NO +#define MU_PLAY KC_NO +#define MU_FAST KC_NO +#define MU_SLOW KC_NO +#define MU_MASK KC_NO +#endif + +// Define non-capitalized UTF shortcuts here +#ifdef UNICODE_ENABLE +#define PHY_HBR UC(0x0127) +#define PHY_DEG UC(0x00b0) +#define CUR_LIR UC(0x20ba) +#define CUR_BIT UC(0x20bf) +#define CUR_EUR UC(0x20ac) +#define CUR_BPN UC(0x00a3) +#define CUR_YEN UC(0x00a5) +#else +#define PHY_HBR KC_NO +#define PHY_DEG KC_NO +#define CUR_LIR KC_NO +#define CUR_BIT KC_NO +#define CUR_EUR KC_NO +#define CUR_BPN KC_NO +#define CUR_YEN KC_NO +#endif + +// Custom keycodes +enum userspace_custom_keycodes { + // Turkish letters, with shifting + TUR_A = SAFE_RANGE, + TUR_C, + TUR_G, + TUR_I, + TUR_O, + TUR_S, + TUR_U, + // Unicode mode switch + UNI_LI, + UNI_WN, + // Double keys + DBL_SPC, + DBL_ANG, + DBL_PAR, + DBL_SQR, + DBL_BRC, + DBL_QUO, + DBL_DQT, + DBL_GRV, + // Diagonal mouse movements + MO_NE, + MO_NW, + MO_SE, + MO_SW, + MO_S_NE, + MO_S_NW, + MO_S_SE, + MO_S_SW, + // Layer switches and lock functionality + K_MOUSE, + K_NUMBR, + K_LOCK, + K_GAMES, + // Secret macros + SECRET1, + SECRET2, + SECRET3 +}; + +// Do tap dancable semicolon key if available +#ifdef TAP_DANCE_ENABLE +enum { + SCL = 0 +}; +#define MY_SCL TD(SCL) +#else +#define MY_SCL KC_SCLN +#endif + +// Shared keymaps +#define LAYOUT_planck_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) +#define LAYOUT_letssplit_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) + +/* Dvorak + * ,------------------------------------------------------------------------. + * | ' " | , | . | P | Y | Esc || Del | F | G | C | R | L | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | A | O | E | U | I | Bkp || Ent | D | H | T | N | S | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | ; : | Q | J | K | X | Spc || SET | B | M | W | V | Z | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Ctrl| OS | Alt | Tab | Cps | ACH || SYM | Spc | Lft | Up | Dwn | Rght| + * `------------------------------------------------------------------------' */ +#define DVORAK \ + KC_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_ESC, KC_DEL, KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, KC_BSPC,KC_ENT, KC_D, KC_H, KC_T, KC_N, KC_S, \ + MY_SCL, KC_Q, KC_J, KC_K, KC_X, KC_SPC, MO(_SE),KC_B, KC_M, KC_W, KC_V, KC_Z, \ + KC_LCTL,KC_LGUI,KC_LALT,KC_TAB, CAPS, MO(_AL),K_NUMBR,KC_SPC, KC_LEFT,KC_UP, KC_DOWN,KC_RGHT + +/* Alternative character overlay + * ,------------------------------------------------------------------------. + * | ` ~ | ' ' | " " | Euro|Pound| || Del | Home| PgUp| Prn | \ | | / ? | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Redo| < > | ( ) | [ ] | { } | Alt || Ins | End |PgDwn| Scl | BTC | - _ | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Undo| Cut | Copy|Paste| EXIT| Shf || | | | | Yen | = + | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | | | | | || | | | | | | + * `------------------------------------------------------------------------' */ +#define ALTCHAR \ + KC_GRV, DBL_QUO,DBL_DQT,CUR_EUR,CUR_BPN,_______,_______,KC_HOME,KC_PGUP,KC_PSCREEN, KC_BSLASH, KC_SLSH, \ + REDO, DBL_ANG,DBL_PAR,DBL_SQR,DBL_BRC,KC_LALT,KC_INS, KC_END, KC_PGDN,KC_SCROLLLOCK, CUR_BIT, KC_MINUS, \ + UNDO, CUT, COPY, PASTE, EXIT, KC_LSFT,_______,_______,_______,_______, CUR_YEN, KC_EQUAL, \ + _______,_______,_______,_______,_______,_______,_______,DBL_SPC,_______,_______, _______, _______ + +/* Game layer + * ,------------------------------------------------------------------------. + * | OFF | Q | W | E | R | T || Esc | 7 | 8 | 9 |NumLk|Bkspc| + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Tab | A | S | D | F | G || F1 | 4 | 5 | 6 | \ | Ent | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Shf | Z | X | C | V | B || F2 | 1 | 2 | 3 | ^ | MSE | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Ctrl| Alt | / | ` | SYM | Spc || F5 | Ent | 0 | < | v | > | + * `------------------------------------------------------------------------' */ +#define GAME \ + K_GAMES,KC_Q, KC_W, KC_E, KC_R, KC_T, KC_ESC, KC_P7, KC_P8, KC_P9, KC_NLCK,KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_F1, KC_P4, KC_P5, KC_P6, KC_BSLS,KC_ENT , \ + KC_LSFT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_F2, KC_P1, KC_P2, KC_P3, KC_UP,K_MOUSE, \ + KC_LCTL,KC_LALT,KC_SLSH,KC_GRV, K_NUMBR,KC_SPC, KC_F5, KC_ENT, KC_P0, KC_LEFT,KC_DOWN,KC_RGHT + +/* Symbols layer + * ,------------------------------------------------------------------------. + * | OFF | ` | ~ | \ | [ | { || } | ] | - | _ | = | + | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | 1 | 2 | 3 | 4 | 5 | || LCK | 6 | 7 | 8 | 9 | 0 | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | ! | @ | # | $ | % | ||Vol +| ^ | & | * | ( | ) | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | | | | | | || | | | | | | + * `------------------------------------------------------------------------' */ +#define NUMBERS \ + K_NUMBR,KC_GRV, KC_TILD,KC_BSLS,KC_LBRC,KC_LCBR,KC_RCBR,KC_RBRC,KC_MINS,KC_UNDS,KC_EQL, KC_PLUS, \ + KC_1, KC_2, KC_3, KC_4, KC_5, _______,K_LOCK, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,_______,KC_VOLU,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN, \ + KC_PIPE,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______ + +/* Settings layer + * ,------------------------------------------------------------------------. + * |BLLed| F1 | F2 | F3 | F4 | Lin || Win | Wake| |Hue -|Hue +|Reset| + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | F5 | F6 | F7 | F8 | ||Vol 0| |RGBto|Sat -|Sat +| | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | Game| F9 | F10 | F11 | F12 |Vol 0|| |PrtSc|RGBan|Bri -|Bri +| | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * |Musir| | | | |Vol +||Vol -| Prev| Stop|TogMu| Next| | + * `------------------------------------------------------------------------' */ +#define SETTINGS \ + BL_STEP,KC_F1, KC_F2, KC_F3, KC_F4, UNI_LI, UNI_WN, KC_WAKE,_______,RGB_HUD,RGB_HUI,RESET , \ + _______,KC_F5, KC_F6, KC_F7, KC_F8, _______,KC_MUTE,_______,RGB_TOG,RGB_SAD,RGB_SAI,_______, \ + K_GAMES,KC_F9, KC_F10, KC_F11, KC_F12, KC_MUTE,_______,KC_PSCR,RGB_MOD,RGB_VAD,RGB_VAI,_______, \ + MU_TOG, _______,_______,_______,_______,KC_VOLU,KC_VOLD,KC_MPRV,KC_MSTP,KC_MPLY,KC_MNXT,_______ + +/* Mouse layer + * ,------------------------------------------------------------------------. + * |Ulock| \ | ^ | / |.....|.....||.....|.....| |\|.| |^| | |/|.| | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | < | Mid | > |Btn 4|.....||.....|Btn 5| <-- | Mid | --> | | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | / | v | \ |.....|.....||.....|.....| |/| | |v| | |\| | LCK | + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | | | | | | Left||Right| | |Accl0|Accl1|Accl2| + * `------------------------------------------------------------------------' */ +#define MOUSE \ + K_MOUSE,MO_NW, MO_N, MO_NE, XXX, XXX ,XXX, XXX, MO_S_NW,MO_S_N, MO_S_NE,_______, \ + _______,MO_W, MO_CL_M,MO_E, MO_CL_4,XXX ,XXX, MO_CL_5,MO_S_W, MO_CL_M,MO_S_E, _______, \ + _______,MO_SW, MO_S, MO_SE, XXX, XXX ,XXX, XXX, MO_S_SW,MO_S_S, MO_S_SE,K_LOCK , \ + _______,_______,_______,_______,_______,MO_CL_L,MO_CL_R,_______,MO_AC_0,MO_AC_1,MO_AC_2,_______ + +/* Music layer + * ,------------------------------------------------------------------------. + * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * |.....|.....|.....|.....|.....|.....||.....|.....|.....|.....|.....|.....| + * |-----+-----+-----+-----+-----+-----++-----+-----+-----+-----+-----+-----| + * | togg| rec | stop| play| slow| fast||modes|.....|.....|.....|.....|.....| + * `------------------------------------------------------------------------' + */ +#define MUSIC \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK, \ + MU_TOG, MU_REC, MU_STOP,MU_PLAY,MU_SLOW,MU_FAST,MU_MOD, MU_MASK,MU_MASK,MU_MASK,MU_MASK,MU_MASK diff --git a/users/romus/rules.mk b/users/romus/rules.mk new file mode 100644 index 0000000000..78ce2e93f4 --- /dev/null +++ b/users/romus/rules.mk @@ -0,0 +1,24 @@ +SRC += romus.c +EXTRAFLAGS += -flto # Used to make code smaller + +# ENABLE +UNICODE_ENABLE = yes # Used for unicode character emulation +EXTRAKEY_ENABLE = yes # OS signals like volume control + +# DISABLE +ifndef BLUETOOTH_ENABLE + BLUETOOTH_ENABLE = no # No bluetooth +endif +COMMAND_ENABLE = no # Some bootmagic thing i dont use +BOOTMAGIC_ENABLE = no # Access to EEPROM settings, not needed +CONSOLE_ENABLE = no # Allows console output with a command +SLEEP_LED_ENABLE = no # Breathes LED's when computer is asleep. Untested. +NKRO_ENABLE = no # Default is 6KRO which is plenty +MIDI_ENABLE = no # Untested feature +FAUXCLICKY_ENABLE = no # Emulates clicks using speaker +KEY_LOCK_ENABLE = no # Allows locking any key. Not used +API_SYSEX_ENABLE = no # Allows OS to send signals. + + +# Disabling this makes it compile, i dont know why +# VARIABLE_TRACE = no # Allows debugging variables -- cgit v1.2.3 From 00b6f14821f44ead75504e28d7fed26791cb2875 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 08:57:37 -0700 Subject: Replace outdated RGB/Audio information --- keyboards/amj40/keymaps/default/rules.mk | 4 ++-- keyboards/amj40/keymaps/fabian/rules.mk | 2 +- keyboards/amj40/keymaps/jetpacktuxedo/rules.mk | 2 +- keyboards/amj40/keymaps/myee/rules.mk | 2 +- keyboards/amj60/keymaps/iso_split_rshift/rules.mk | 2 +- keyboards/atomic/keymaps/pvc/rules.mk | 2 +- keyboards/atomic/rules.mk | 2 +- keyboards/atreus/keymaps/xk/rules.mk | 2 +- keyboards/bfo9000/rules.mk | 2 +- keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk | 2 +- keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk | 2 +- keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk | 2 +- keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk | 2 +- keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk | 2 +- keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk | 2 +- keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk | 2 +- keyboards/bpiphany/pegasushoof/rules.mk | 2 +- keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk | 2 +- keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk | 2 +- keyboards/clueboard/66/keymaps/xyverz/rules.mk | 2 +- keyboards/comet46/keymaps/satt/rules.mk | 2 +- keyboards/contra/keymaps/losinggeneration/rules.mk | 2 +- keyboards/converter/ibm_terminal/keymaps/default/rules.mk | 2 +- keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk | 2 +- keyboards/converter/ibm_terminal/rules.mk | 2 +- keyboards/converter/sun_usb/rules.mk | 2 +- keyboards/crkbd/keymaps/default/rules.mk | 2 +- keyboards/crkbd/keymaps/drashna/rules.mk | 2 +- keyboards/crkbd/keymaps/like_jis/rules.mk | 2 +- keyboards/crkbd/rules.mk | 2 +- keyboards/daisy/rules.mk | 2 +- keyboards/deltasplit75/keymaps/itsaferbie/rules.mk | 2 +- keyboards/deltasplit75/rules.mk | 6 +++--- keyboards/diverge3/rules.mk | 2 +- keyboards/divergetm2/rules.mk | 2 +- keyboards/do60/rules.mk | 2 +- keyboards/eco/keymaps/default/rules.mk | 2 +- keyboards/eco/keymaps/hexwire/rules.mk | 2 +- keyboards/eco/keymaps/that_canadian/rules.mk | 2 +- keyboards/eco/keymaps/xyverz/rules.mk | 2 +- keyboards/ergo42/rules.mk | 2 +- keyboards/ergodash/rules.mk | 2 +- keyboards/ergodox_infinity/keymaps/narze/rules.mk | 2 +- keyboards/ergoinu/keymaps/default/rules.mk | 2 +- keyboards/ergoinu/keymaps/default_jis/rules.mk | 2 +- keyboards/ergoinu/rules.mk | 2 +- keyboards/ergotravel/rules.mk | 2 +- keyboards/fortitude60/rules.mk | 2 +- keyboards/fourier/rules.mk | 2 +- keyboards/gherkin/keymaps/mjt/rules.mk | 2 +- keyboards/gonnerd/keymaps/default/rules.mk | 2 +- keyboards/gonnerd/keymaps/gam3cat/rules.mk | 2 +- keyboards/gonnerd/keymaps/mauin/rules.mk | 2 +- keyboards/gonnerd/keymaps/tkl/rules.mk | 2 +- keyboards/hadron/keymaps/default/rules.mk | 2 +- keyboards/hadron/keymaps/side_numpad/rules.mk | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk | 2 +- keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk | 2 +- keyboards/handwired/arrow_pad/keymaps/pad_21/rules.mk | 2 +- keyboards/handwired/arrow_pad/keymaps/pad_24/rules.mk | 2 +- keyboards/handwired/atreus50/rules.mk | 2 +- keyboards/handwired/dactyl_manuform/4x5/rules.mk | 3 +-- keyboards/handwired/dactyl_manuform/4x6/rules.mk | 3 +-- keyboards/handwired/dactyl_manuform/5x6/rules.mk | 3 +-- keyboards/handwired/dactyl_manuform/5x7/rules.mk | 2 +- keyboards/handwired/dactyl_manuform/6x6/rules.mk | 3 +-- keyboards/handwired/dactyl_manuform/rules.mk | 2 +- keyboards/handwired/kbod/keymaps/default/rules.mk | 2 +- keyboards/handwired/minorca/keymaps/default/rules.mk | 2 +- keyboards/handwired/minorca/keymaps/rgb/rules.mk | 2 +- keyboards/handwired/minorca/rules.mk | 2 +- keyboards/handwired/not_so_minidox/rules.mk | 2 +- keyboards/handwired/pilcrow/keymaps/default/rules.mk | 2 +- keyboards/handwired/promethium/keymaps/default/rules.mk | 2 +- keyboards/handwired/promethium/keymaps/priyadi/rules.mk | 2 +- keyboards/handwired/promethium/rules.mk | 2 +- keyboards/handwired/qc60/rules.mk | 2 +- keyboards/handwired/terminus_mini/keymaps/default/rules.mk | 2 +- keyboards/handwired/terminus_mini/rules.mk | 2 +- keyboards/handwired/woodpad/keymaps/default/rules.mk | 2 +- keyboards/handwired/xealous/rules.mk | 2 +- keyboards/helix/pico/keymaps/biacco/rules.mk | 2 +- keyboards/helix/pico/keymaps/default/rules.mk | 2 +- keyboards/helix/rev1/keymaps/OLED_sample/rules.mk | 2 +- keyboards/helix/rev2/keymaps/default/rules.mk | 2 +- keyboards/helix/rev2/keymaps/edvorakjp/rules.mk | 2 +- keyboards/helix/rev2/keymaps/five_rows/rules.mk | 2 +- keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk | 2 +- keyboards/helix/rev2/keymaps/froggy/rules.mk | 2 +- keyboards/helix/rev2/keymaps/led_test/rules.mk | 2 +- keyboards/helix/rev2/keymaps/yshrsmz/rules.mk | 2 +- keyboards/helix/rules.mk | 2 +- keyboards/hhkb/keymaps/cinaeco/rules.mk | 2 +- keyboards/iris/keymaps/edvorakjp/rules.mk | 2 +- keyboards/iris/rules.mk | 2 +- keyboards/jd45/keymaps/mjt/rules.mk | 2 +- keyboards/jd45/keymaps/mjt6u/rules.mk | 2 +- keyboards/kinesis/keymaps/carpalx/rules.mk | 2 +- keyboards/kinesis/keymaps/default/rules.mk | 2 +- keyboards/kinesis/keymaps/default_pretty/rules.mk | 2 +- keyboards/kinesis/keymaps/dvorak/rules.mk | 2 +- keyboards/kinesis/keymaps/insertsnideremarks/rules.mk | 2 +- keyboards/kinesis/keymaps/milestogo/rules.mk | 2 +- keyboards/kinesis/keymaps/xyverz/rules.mk | 2 +- keyboards/launchpad/keymaps/default/rules.mk | 2 +- keyboards/lets_split/keymaps/OLED_sample/rules.mk | 2 +- keyboards/lets_split/keymaps/heartrobotninja/rules.mk | 3 +-- keyboards/lets_split/keymaps/mjt/rules.mk | 2 +- keyboards/lets_split/keymaps/piemod/rules.mk | 2 +- keyboards/lets_split/keymaps/xk/rules.mk | 2 +- keyboards/lets_split/rules.mk | 2 +- keyboards/levinson/keymaps/losinggeneration/rules.mk | 2 +- keyboards/levinson/rules.mk | 2 +- keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk | 2 +- keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk | 2 +- keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk | 2 +- keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk | 2 +- keyboards/lily58/rules.mk | 2 +- keyboards/meira/rules.mk | 2 +- keyboards/minidox/keymaps/alairock/rules.mk | 2 +- keyboards/minidox/keymaps/that_canadian/rules.mk | 2 +- keyboards/minidox/keymaps/xyverz/rules.mk | 2 +- keyboards/minidox/rules.mk | 2 +- keyboards/mint60/rules.mk | 2 +- keyboards/miuni32/keymaps/adam-lee/rules.mk | 2 +- keyboards/miuni32/keymaps/default/rules.mk | 2 +- keyboards/miuni32/keymaps/ht_156/rules.mk | 2 +- keyboards/miuni32/keymaps/ki/rules.mk | 2 +- keyboards/mt40/rules.mk | 2 +- keyboards/niu_mini/keymaps/spacebarracecar/rules.mk | 2 +- keyboards/nyquist/keymaps/DivergeJM/rules.mk | 2 +- keyboards/nyquist/keymaps/danielhklein/rules.mk | 2 +- keyboards/nyquist/keymaps/losinggeneration/rules.mk | 2 +- keyboards/nyquist/rules.mk | 2 +- keyboards/org60/rules.mk | 2 +- keyboards/orthodox/rules.mk | 2 +- keyboards/planck/keymaps/ab/rules.mk | 2 +- keyboards/planck/keymaps/alexey/rules.mk | 2 +- keyboards/planck/keymaps/angerthosenear/rules.mk | 2 +- keyboards/planck/keymaps/austin/rules.mk | 2 +- keyboards/planck/keymaps/basic/rules.mk | 2 +- keyboards/planck/keymaps/bone2planck/rules.mk | 2 +- keyboards/planck/keymaps/callum/rules.mk | 2 +- keyboards/planck/keymaps/cbbrowne/rules.mk | 2 +- keyboards/planck/keymaps/chance/rules.mk | 2 +- keyboards/planck/keymaps/charlie/rules.mk | 2 +- keyboards/planck/keymaps/circuit/rules.mk | 2 +- keyboards/planck/keymaps/daniel/rules.mk | 2 +- keyboards/planck/keymaps/danielhklein/rules.mk | 2 +- keyboards/planck/keymaps/david/rules.mk | 2 +- keyboards/planck/keymaps/dc/rules.mk | 2 +- keyboards/planck/keymaps/dlaroe/rules.mk | 2 +- keyboards/planck/keymaps/dr_notsokind/rules.mk | 2 +- keyboards/planck/keymaps/dzobert/rules.mk | 2 +- keyboards/planck/keymaps/espynn/rules.mk | 2 +- keyboards/planck/keymaps/experimental/rules.mk | 2 +- keyboards/planck/keymaps/gabriel/rules.mk | 2 +- keyboards/planck/keymaps/gunp/rules.mk | 2 +- keyboards/planck/keymaps/impossible/rules.mk | 2 +- keyboards/planck/keymaps/jacob/rules.mk | 2 +- keyboards/planck/keymaps/jeebak/rules.mk | 2 +- keyboards/planck/keymaps/jhenahan/rules.mk | 2 +- keyboards/planck/keymaps/joe/rules.mk | 2 +- keyboards/planck/keymaps/johannes/rules.mk | 2 +- keyboards/planck/keymaps/kyle/rules.mk | 2 +- keyboards/planck/keymaps/lae3/rules.mk | 2 +- keyboards/planck/keymaps/leo/rules.mk | 2 +- keyboards/planck/keymaps/lucas/rules.mk | 2 +- keyboards/planck/keymaps/lukas/rules.mk | 2 +- keyboards/planck/keymaps/luke/rules.mk | 2 +- keyboards/planck/keymaps/max/rules.mk | 2 +- keyboards/planck/keymaps/mollat/rules.mk | 2 +- keyboards/planck/keymaps/myoung34/rules.mk | 2 +- keyboards/planck/keymaps/narze/rules.mk | 2 +- keyboards/planck/keymaps/neo2planck/rules.mk | 2 +- keyboards/planck/keymaps/nico/rules.mk | 2 +- keyboards/planck/keymaps/not-quite-neo/rules.mk | 2 +- keyboards/planck/keymaps/pickle_jr/rules.mk | 2 +- keyboards/planck/keymaps/premek/rules.mk | 2 +- keyboards/planck/keymaps/priyadi/rules.mk | 2 +- keyboards/planck/keymaps/pvc/rules.mk | 2 +- keyboards/planck/keymaps/rai-suta/rules.mk | 2 +- keyboards/planck/keymaps/sgoodwin/rules.mk | 2 +- keyboards/planck/keymaps/spacebarracecar/rules.mk | 3 +-- keyboards/planck/keymaps/tak3over/rules.mk | 2 +- keyboards/planck/keymaps/thermal_printer/rules.mk | 2 +- keyboards/planck/keymaps/tong92/rules.mk | 2 +- keyboards/planck/keymaps/vifon/rules.mk | 2 +- keyboards/planck/keymaps/yale/rules.mk | 2 +- keyboards/planck/keymaps/yang/rules.mk | 2 +- keyboards/planck/keymaps/zach/rules.mk | 2 +- keyboards/planck/keymaps/zrichard/rules.mk | 2 +- keyboards/preonic/keymaps/bucktooth/rules.mk | 2 +- keyboards/preonic/keymaps/dlaroe/rules.mk | 2 +- keyboards/preonic/keymaps/jacwib/rules.mk | 2 +- keyboards/preonic/keymaps/kinesis/rules.mk | 2 +- keyboards/preonic/keymaps/seph/rules.mk | 2 +- keyboards/preonic/keymaps/zach/rules.mk | 2 +- keyboards/quefrency/rules.mk | 2 +- keyboards/qwertyydox/rules.mk | 2 +- keyboards/rama/m60_a/rules.mk | 3 +-- keyboards/redox/rules.mk | 2 +- keyboards/rorschach/keymaps/insertsnideremarks/rules.mk | 4 +--- keyboards/rorschach/rules.mk | 2 +- keyboards/s60_x/keymaps/ansi_qwertz/rules.mk | 2 +- keyboards/s60_x/keymaps/bluebear/rules.mk | 2 +- keyboards/satan/keymaps/addcninblue/rules.mk | 2 +- keyboards/satan/keymaps/admiralStrokers/rules.mk | 2 +- keyboards/satan/keymaps/ben_iso/rules.mk | 2 +- keyboards/satan/keymaps/chaser/rules.mk | 2 +- keyboards/satan/keymaps/colemak/rules.mk | 2 +- keyboards/satan/keymaps/default/rules.mk | 2 +- keyboards/satan/keymaps/dende_iso/rules.mk | 2 +- keyboards/satan/keymaps/dkrieger/rules.mk | 2 +- keyboards/satan/keymaps/isoHHKB/rules.mk | 2 +- keyboards/satan/keymaps/lepa/rules.mk | 2 +- keyboards/satan/keymaps/midi/rules.mk | 2 +- keyboards/satan/keymaps/olligranlund_iso/rules.mk | 2 +- keyboards/satan/keymaps/sethbc/rules.mk | 2 +- keyboards/satan/keymaps/smt/rules.mk | 2 +- keyboards/satan/keymaps/unxmaal/rules.mk | 2 +- keyboards/tada68/keymaps/ardakilic/rules.mk | 2 +- keyboards/tada68/keymaps/bazooka/rules.mk | 2 +- keyboards/tada68/keymaps/cheese/rules.mk | 3 +-- keyboards/tada68/keymaps/default/rules.mk | 2 +- keyboards/tada68/keymaps/fakb/rules.mk | 2 +- keyboards/tada68/keymaps/fezzant/rules.mk | 2 +- keyboards/tada68/keymaps/iso-nor/rules.mk | 2 +- keyboards/tada68/keymaps/iso-uk/rules.mk | 2 +- keyboards/tada68/keymaps/isoish/rules.mk | 2 +- keyboards/tada68/keymaps/mattdicarlo/rules.mk | 2 +- keyboards/tada68/keymaps/mlechner/rules.mk | 2 +- keyboards/tada68/keymaps/mtdjr/rules.mk | 2 +- keyboards/tada68/keymaps/pascamel/rules.mk | 2 +- keyboards/tada68/keymaps/raylas/rules.mk | 2 +- keyboards/tada68/keymaps/rbong/rules.mk | 2 +- keyboards/tada68/keymaps/rgb/rules.mk | 2 +- keyboards/tada68/keymaps/rys/rules.mk | 2 +- keyboards/tada68/keymaps/shalzz/rules.mk | 2 +- keyboards/tada68/keymaps/sm0g/rules.mk | 2 +- keyboards/tada68/keymaps/stephengrier/rules.mk | 2 +- keyboards/tada68/keymaps/trashcat/rules.mk | 2 +- keyboards/tada68/keymaps/tshack/rules.mk | 2 +- keyboards/tada68/keymaps/unix/rules.mk | 2 +- keyboards/tada68/keymaps/wamsm_tada/rules.mk | 2 +- keyboards/the_ruler/keymaps/default/rules.mk | 2 +- keyboards/the_ruler/rules.mk | 2 +- keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk | 2 +- keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk | 2 +- keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk | 2 +- keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/default/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk | 2 +- keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk | 2 +- keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk | 2 +- keyboards/vision_division/keymaps/default/rules.mk | 2 +- keyboards/vitamins_included/rules.mk | 2 +- keyboards/viterbi/rules.mk | 2 +- keyboards/wavelet/rules.mk | 2 +- keyboards/xd60/rules.mk | 2 +- keyboards/xd75/keymaps/fabian/rules.mk | 2 +- keyboards/xd75/keymaps/germanized/rules.mk | 2 +- keyboards/xd75/rules.mk | 2 +- keyboards/zeal60/rules.mk | 2 +- keyboards/zeal65/rules.mk | 3 +-- keyboards/zen/rules.mk | 2 +- layouts/community/ergodox/alphadox/rules.mk | 4 +--- 277 files changed, 280 insertions(+), 293 deletions(-) diff --git a/keyboards/amj40/keymaps/default/rules.mk b/keyboards/amj40/keymaps/default/rules.mk index 034e697bc2..41a1982248 100644 --- a/keyboards/amj40/keymaps/default/rules.mk +++ b/keyboards/amj40/keymaps/default/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/amj40/keymaps/fabian/rules.mk b/keyboards/amj40/keymaps/fabian/rules.mk index a914e4c0ce..7e0634e09e 100644 --- a/keyboards/amj40/keymaps/fabian/rules.mk +++ b/keyboards/amj40/keymaps/fabian/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk b/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk index d7f3e76054..6ad9236688 100644 --- a/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk +++ b/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. It uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/amj40/keymaps/myee/rules.mk b/keyboards/amj40/keymaps/myee/rules.mk index 034e697bc2..c35191cef2 100644 --- a/keyboards/amj40/keymaps/myee/rules.mk +++ b/keyboards/amj40/keymaps/myee/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/amj60/keymaps/iso_split_rshift/rules.mk b/keyboards/amj60/keymaps/iso_split_rshift/rules.mk index 2969ed8aec..931affcd56 100644 --- a/keyboards/amj60/keymaps/iso_split_rshift/rules.mk +++ b/keyboards/amj60/keymaps/iso_split_rshift/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/atomic/keymaps/pvc/rules.mk b/keyboards/atomic/keymaps/pvc/rules.mk index c7c04485fc..8414b40fb6 100644 --- a/keyboards/atomic/keymaps/pvc/rules.mk +++ b/keyboards/atomic/keymaps/pvc/rules.mk @@ -9,7 +9,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/atomic/rules.mk b/keyboards/atomic/rules.mk index 3bd04a00a7..eee6c2530a 100644 --- a/keyboards/atomic/rules.mk +++ b/keyboards/atomic/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/atreus/keymaps/xk/rules.mk b/keyboards/atreus/keymaps/xk/rules.mk index fe431f28a7..2e76f9da5d 100644 --- a/keyboards/atreus/keymaps/xk/rules.mk +++ b/keyboards/atreus/keymaps/xk/rules.mk @@ -10,7 +10,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) ifndef QUANTUM_DIR diff --git a/keyboards/bfo9000/rules.mk b/keyboards/bfo9000/rules.mk index 8a7e56f462..d11f9a54e7 100644 --- a/keyboards/bfo9000/rules.mk +++ b/keyboards/bfo9000/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk index 0ae0b96462..856481d031 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk index b21eb64044..fc5761c053 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk @@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # unicodemap 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes LEADER_ENABLE = yes diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk index f29756f223..c76a5a80e4 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk index 168fb625b2..7a616ee5f3 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk index 0dd8a79f4e..4cec29477a 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000) diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk index 168fb625b2..7a616ee5f3 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR diff --git a/keyboards/bpiphany/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk index c5a35428ca..0cfe115aab 100644 --- a/keyboards/bpiphany/pegasushoof/rules.mk +++ b/keyboards/bpiphany/pegasushoof/rules.mk @@ -60,7 +60,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. CUSTOM_MATRIX = yes diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk +++ b/keyboards/bpiphany/tiger_lily/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk +++ b/keyboards/bpiphany/tiger_lily/keymaps/default_ansi/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/clueboard/66/keymaps/xyverz/rules.mk b/keyboards/clueboard/66/keymaps/xyverz/rules.mk index 950dadf841..fc02ecb7ef 100644 --- a/keyboards/clueboard/66/keymaps/xyverz/rules.mk +++ b/keyboards/clueboard/66/keymaps/xyverz/rules.mk @@ -42,7 +42,7 @@ # change to "no" to disable the options, or define them in the makefile.mk in # the appropriate keymap folder that will get included automatically # -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/comet46/keymaps/satt/rules.mk b/keyboards/comet46/keymaps/satt/rules.mk index 08af2e70a4..dc4355c78f 100644 --- a/keyboards/comet46/keymaps/satt/rules.mk +++ b/keyboards/comet46/keymaps/satt/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ONEHAND_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/contra/keymaps/losinggeneration/rules.mk b/keyboards/contra/keymaps/losinggeneration/rules.mk index 1728afd85c..ea2b7165d9 100644 --- a/keyboards/contra/keymaps/losinggeneration/rules.mk +++ b/keyboards/contra/keymaps/losinggeneration/rules.mk @@ -10,7 +10,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/converter/ibm_terminal/keymaps/default/rules.mk b/keyboards/converter/ibm_terminal/keymaps/default/rules.mk index 19eb5972e3..76d349920f 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/rules.mk +++ b/keyboards/converter/ibm_terminal/keymaps/default/rules.mk @@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_USE_USART = yes API_SYSEX_ENABLE = no diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk b/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk index 19eb5972e3..76d349920f 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/rules.mk @@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_USE_USART = yes API_SYSEX_ENABLE = no diff --git a/keyboards/converter/ibm_terminal/rules.mk b/keyboards/converter/ibm_terminal/rules.mk index 9401cf199c..77b3a6f3f7 100644 --- a/keyboards/converter/ibm_terminal/rules.mk +++ b/keyboards/converter/ibm_terminal/rules.mk @@ -61,7 +61,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_USE_USART = yes API_SYSEX_ENABLE = n CUSTOM_MATRIX = yes diff --git a/keyboards/converter/sun_usb/rules.mk b/keyboards/converter/sun_usb/rules.mk index 6e36a19050..3cf503b1d2 100644 --- a/keyboards/converter/sun_usb/rules.mk +++ b/keyboards/converter/sun_usb/rules.mk @@ -24,7 +24,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. CUSTOM_MATRIX = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/crkbd/keymaps/default/rules.mk b/keyboards/crkbd/keymaps/default/rules.mk index 5ee01e89e1..16deaf45d1 100644 --- a/keyboards/crkbd/keymaps/default/rules.mk +++ b/keyboards/crkbd/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 8fca704489..8f69cba72f 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/crkbd/keymaps/like_jis/rules.mk b/keyboards/crkbd/keymaps/like_jis/rules.mk index 5ee01e89e1..16deaf45d1 100644 --- a/keyboards/crkbd/keymaps/like_jis/rules.mk +++ b/keyboards/crkbd/keymaps/like_jis/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/crkbd/rules.mk b/keyboards/crkbd/rules.mk index 6396b115de..426ed0c03f 100644 --- a/keyboards/crkbd/rules.mk +++ b/keyboards/crkbd/rules.mk @@ -65,7 +65,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = no USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/daisy/rules.mk b/keyboards/daisy/rules.mk index f24df2fd6c..8157b168e5 100644 --- a/keyboards/daisy/rules.mk +++ b/keyboards/daisy/rules.mk @@ -62,5 +62,5 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk b/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk index bab3b4c564..75db99ebec 100644 --- a/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk +++ b/keyboards/deltasplit75/keymaps/itsaferbie/rules.mk @@ -1,4 +1,4 @@ -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no # Audio disabled while using RGB underlight. EXTRAKEY_ENABLE = yes diff --git a/keyboards/deltasplit75/rules.mk b/keyboards/deltasplit75/rules.mk index 2a13dbdfc6..5c7571b9db 100644 --- a/keyboards/deltasplit75/rules.mk +++ b/keyboards/deltasplit75/rules.mk @@ -41,7 +41,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE @@ -71,4 +71,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend CUSTOM_MATRIX = yes -DEFAULT_FOLDER = deltasplit75/v2 \ No newline at end of file +DEFAULT_FOLDER = deltasplit75/v2 diff --git a/keyboards/diverge3/rules.mk b/keyboards/diverge3/rules.mk index aa74530543..38f3ee4e6a 100644 --- a/keyboards/diverge3/rules.mk +++ b/keyboards/diverge3/rules.mk @@ -66,7 +66,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/divergetm2/rules.mk b/keyboards/divergetm2/rules.mk index 2be853a2a6..084a3bf63e 100644 --- a/keyboards/divergetm2/rules.mk +++ b/keyboards/divergetm2/rules.mk @@ -64,7 +64,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/do60/rules.mk b/keyboards/do60/rules.mk index e7314caf9e..8003914fa7 100644 --- a/keyboards/do60/rules.mk +++ b/keyboards/do60/rules.mk @@ -59,7 +59,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) MIDI_ENABLE = no # MIDI controls MOUSEKEY_ENABLE = yes # Mouse keys(+4700) NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend UNICODE_ENABLE = no # Unicode diff --git a/keyboards/eco/keymaps/default/rules.mk b/keyboards/eco/keymaps/default/rules.mk index 7dab979426..0996602325 100644 --- a/keyboards/eco/keymaps/default/rules.mk +++ b/keyboards/eco/keymaps/default/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/eco/keymaps/hexwire/rules.mk b/keyboards/eco/keymaps/hexwire/rules.mk index 7dab979426..0996602325 100644 --- a/keyboards/eco/keymaps/hexwire/rules.mk +++ b/keyboards/eco/keymaps/hexwire/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/eco/keymaps/that_canadian/rules.mk b/keyboards/eco/keymaps/that_canadian/rules.mk index 7dab979426..0996602325 100644 --- a/keyboards/eco/keymaps/that_canadian/rules.mk +++ b/keyboards/eco/keymaps/that_canadian/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/eco/keymaps/xyverz/rules.mk b/keyboards/eco/keymaps/xyverz/rules.mk index 9a3059e715..9e7b9c2024 100644 --- a/keyboards/eco/keymaps/xyverz/rules.mk +++ b/keyboards/eco/keymaps/xyverz/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/ergo42/rules.mk b/keyboards/ergo42/rules.mk index 252411cab4..cdc9da9084 100644 --- a/keyboards/ergo42/rules.mk +++ b/keyboards/ergo42/rules.mk @@ -67,7 +67,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/ergodash/rules.mk b/keyboards/ergodash/rules.mk index bf0df4040f..e25346dacd 100644 --- a/keyboards/ergodash/rules.mk +++ b/keyboards/ergodash/rules.mk @@ -64,7 +64,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/ergodox_infinity/keymaps/narze/rules.mk b/keyboards/ergodox_infinity/keymaps/narze/rules.mk index 7d2e00d0e9..bd89bb9d98 100644 --- a/keyboards/ergodox_infinity/keymaps/narze/rules.mk +++ b/keyboards/ergodox_infinity/keymaps/narze/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/ergoinu/keymaps/default/rules.mk b/keyboards/ergoinu/keymaps/default/rules.mk index 7d7a475d17..92dde90ff1 100644 --- a/keyboards/ergoinu/keymaps/default/rules.mk +++ b/keyboards/ergoinu/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/ergoinu/keymaps/default_jis/rules.mk b/keyboards/ergoinu/keymaps/default_jis/rules.mk index 7d7a475d17..92dde90ff1 100644 --- a/keyboards/ergoinu/keymaps/default_jis/rules.mk +++ b/keyboards/ergoinu/keymaps/default_jis/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/ergoinu/rules.mk b/keyboards/ergoinu/rules.mk index a00cc16de2..de4bcad526 100644 --- a/keyboards/ergoinu/rules.mk +++ b/keyboards/ergoinu/rules.mk @@ -60,7 +60,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = no USE_I2C = no # i2c is not supported # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/ergotravel/rules.mk b/keyboards/ergotravel/rules.mk index d2da788067..55155b5a3e 100644 --- a/keyboards/ergotravel/rules.mk +++ b/keyboards/ergotravel/rules.mk @@ -59,7 +59,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/fortitude60/rules.mk b/keyboards/fortitude60/rules.mk index 7b2557b701..3d1745c6f7 100644 --- a/keyboards/fortitude60/rules.mk +++ b/keyboards/fortitude60/rules.mk @@ -62,7 +62,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. USE_SERIAL = yes # Serial support only on fortitude60 # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend diff --git a/keyboards/fourier/rules.mk b/keyboards/fourier/rules.mk index 151339bc9d..9ec05e8740 100644 --- a/keyboards/fourier/rules.mk +++ b/keyboards/fourier/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/gherkin/keymaps/mjt/rules.mk b/keyboards/gherkin/keymaps/mjt/rules.mk index b397f86d04..afb93b674c 100644 --- a/keyboards/gherkin/keymaps/mjt/rules.mk +++ b/keyboards/gherkin/keymaps/mjt/rules.mk @@ -20,7 +20,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE=yes diff --git a/keyboards/gonnerd/keymaps/default/rules.mk b/keyboards/gonnerd/keymaps/default/rules.mk index 772d7aee3b..e34aba6927 100644 --- a/keyboards/gonnerd/keymaps/default/rules.mk +++ b/keyboards/gonnerd/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/gonnerd/keymaps/gam3cat/rules.mk b/keyboards/gonnerd/keymaps/gam3cat/rules.mk index a32d22e41e..a226838424 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/rules.mk +++ b/keyboards/gonnerd/keymaps/gam3cat/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/gonnerd/keymaps/mauin/rules.mk b/keyboards/gonnerd/keymaps/mauin/rules.mk index 772d7aee3b..e34aba6927 100644 --- a/keyboards/gonnerd/keymaps/mauin/rules.mk +++ b/keyboards/gonnerd/keymaps/mauin/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/gonnerd/keymaps/tkl/rules.mk b/keyboards/gonnerd/keymaps/tkl/rules.mk index 5854366f9d..b96663efe6 100644 --- a/keyboards/gonnerd/keymaps/tkl/rules.mk +++ b/keyboards/gonnerd/keymaps/tkl/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/hadron/keymaps/default/rules.mk b/keyboards/hadron/keymaps/default/rules.mk index 545ffa75c1..4c6d04f1e5 100644 --- a/keyboards/hadron/keymaps/default/rules.mk +++ b/keyboards/hadron/keymaps/default/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/hadron/keymaps/side_numpad/rules.mk b/keyboards/hadron/keymaps/side_numpad/rules.mk index d9fabc1acc..687c285bdb 100644 --- a/keyboards/hadron/keymaps/side_numpad/rules.mk +++ b/keyboards/hadron/keymaps/side_numpad/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = yes # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk index b3c01678f3..3955a3ff42 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk index 4f62657b3f..ddfea82556 100644 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk +++ b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_21/rules.mk b/keyboards/handwired/arrow_pad/keymaps/pad_21/rules.mk index af51976a89..d2403c9ecb 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_21/rules.mk +++ b/keyboards/handwired/arrow_pad/keymaps/pad_21/rules.mk @@ -9,7 +9,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_24/rules.mk b/keyboards/handwired/arrow_pad/keymaps/pad_24/rules.mk index e31bfe1af2..b305f8482a 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_24/rules.mk +++ b/keyboards/handwired/arrow_pad/keymaps/pad_24/rules.mk @@ -9,7 +9,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/atreus50/rules.mk b/keyboards/handwired/atreus50/rules.mk index 2e2d48f6ab..21c4704e0d 100644 --- a/keyboards/handwired/atreus50/rules.mk +++ b/keyboards/handwired/atreus50/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/dactyl_manuform/4x5/rules.mk b/keyboards/handwired/dactyl_manuform/4x5/rules.mk index 14b6e1e4e3..7508070515 100644 --- a/keyboards/handwired/dactyl_manuform/4x5/rules.mk +++ b/keyboards/handwired/dactyl_manuform/4x5/rules.mk @@ -14,8 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/handwired/dactyl_manuform/4x6/rules.mk b/keyboards/handwired/dactyl_manuform/4x6/rules.mk index 14b6e1e4e3..7508070515 100644 --- a/keyboards/handwired/dactyl_manuform/4x6/rules.mk +++ b/keyboards/handwired/dactyl_manuform/4x6/rules.mk @@ -14,8 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/handwired/dactyl_manuform/5x6/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/rules.mk index 14b6e1e4e3..7508070515 100644 --- a/keyboards/handwired/dactyl_manuform/5x6/rules.mk +++ b/keyboards/handwired/dactyl_manuform/5x6/rules.mk @@ -14,8 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/handwired/dactyl_manuform/5x7/rules.mk b/keyboards/handwired/dactyl_manuform/5x7/rules.mk index fc9cbcccd4..7508070515 100644 --- a/keyboards/handwired/dactyl_manuform/5x7/rules.mk +++ b/keyboards/handwired/dactyl_manuform/5x7/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/dactyl_manuform/6x6/rules.mk b/keyboards/handwired/dactyl_manuform/6x6/rules.mk index 14b6e1e4e3..7508070515 100644 --- a/keyboards/handwired/dactyl_manuform/6x6/rules.mk +++ b/keyboards/handwired/dactyl_manuform/6x6/rules.mk @@ -14,8 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/handwired/dactyl_manuform/rules.mk b/keyboards/handwired/dactyl_manuform/rules.mk index adb058c8af..a93de36858 100644 --- a/keyboards/handwired/dactyl_manuform/rules.mk +++ b/keyboards/handwired/dactyl_manuform/rules.mk @@ -58,7 +58,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/kbod/keymaps/default/rules.mk b/keyboards/handwired/kbod/keymaps/default/rules.mk index eb6bf940ae..5b9ff0bfdc 100644 --- a/keyboards/handwired/kbod/keymaps/default/rules.mk +++ b/keyboards/handwired/kbod/keymaps/default/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/minorca/keymaps/default/rules.mk b/keyboards/handwired/minorca/keymaps/default/rules.mk index 0ea7a69353..584798d1a1 100644 --- a/keyboards/handwired/minorca/keymaps/default/rules.mk +++ b/keyboards/handwired/minorca/keymaps/default/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/minorca/keymaps/rgb/rules.mk b/keyboards/handwired/minorca/keymaps/rgb/rules.mk index da44256f99..6e430d59e2 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/rules.mk +++ b/keyboards/handwired/minorca/keymaps/rgb/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/minorca/rules.mk b/keyboards/handwired/minorca/rules.mk index ce502b8204..3e408e2b93 100644 --- a/keyboards/handwired/minorca/rules.mk +++ b/keyboards/handwired/minorca/rules.mk @@ -61,7 +61,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/handwired/not_so_minidox/rules.mk b/keyboards/handwired/not_so_minidox/rules.mk index fe4cc014e7..833dd4b79e 100644 --- a/keyboards/handwired/not_so_minidox/rules.mk +++ b/keyboards/handwired/not_so_minidox/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE ?= no # MIDI controls 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. +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. USE_I2C ?= no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/pilcrow/keymaps/default/rules.mk b/keyboards/handwired/pilcrow/keymaps/default/rules.mk index b3c01678f3..3955a3ff42 100644 --- a/keyboards/handwired/pilcrow/keymaps/default/rules.mk +++ b/keyboards/handwired/pilcrow/keymaps/default/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/promethium/keymaps/default/rules.mk b/keyboards/handwired/promethium/keymaps/default/rules.mk index a0d4261fa1..5761be5170 100644 --- a/keyboards/handwired/promethium/keymaps/default/rules.mk +++ b/keyboards/handwired/promethium/keymaps/default/rules.mk @@ -16,7 +16,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes FAUXCLICKY_ENABLE = yes diff --git a/keyboards/handwired/promethium/keymaps/priyadi/rules.mk b/keyboards/handwired/promethium/keymaps/priyadi/rules.mk index a0d4261fa1..5761be5170 100644 --- a/keyboards/handwired/promethium/keymaps/priyadi/rules.mk +++ b/keyboards/handwired/promethium/keymaps/priyadi/rules.mk @@ -16,7 +16,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes FAUXCLICKY_ENABLE = yes diff --git a/keyboards/handwired/promethium/rules.mk b/keyboards/handwired/promethium/rules.mk index 69903dcebe..21328b7f8e 100644 --- a/keyboards/handwired/promethium/rules.mk +++ b/keyboards/handwired/promethium/rules.mk @@ -62,7 +62,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PS2_MOUSE_ENABLE = yes PS2_USE_INT = yes API_SYSEX_ENABLE = no diff --git a/keyboards/handwired/qc60/rules.mk b/keyboards/handwired/qc60/rules.mk index 1be83d5f8d..e61b18b00c 100644 --- a/keyboards/handwired/qc60/rules.mk +++ b/keyboards/handwired/qc60/rules.mk @@ -58,7 +58,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes diff --git a/keyboards/handwired/terminus_mini/keymaps/default/rules.mk b/keyboards/handwired/terminus_mini/keymaps/default/rules.mk index 1485c08320..42ab51f150 100644 --- a/keyboards/handwired/terminus_mini/keymaps/default/rules.mk +++ b/keyboards/handwired/terminus_mini/keymaps/default/rules.mk @@ -29,6 +29,6 @@ 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance diff --git a/keyboards/handwired/terminus_mini/rules.mk b/keyboards/handwired/terminus_mini/rules.mk index d7acbf7d52..9ecba25d80 100644 --- a/keyboards/handwired/terminus_mini/rules.mk +++ b/keyboards/handwired/terminus_mini/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable tap dance diff --git a/keyboards/handwired/woodpad/keymaps/default/rules.mk b/keyboards/handwired/woodpad/keymaps/default/rules.mk index b8879076bd..f060db79c0 100644 --- a/keyboards/handwired/woodpad/keymaps/default/rules.mk +++ b/keyboards/handwired/woodpad/keymaps/default/rules.mk @@ -29,7 +29,7 @@ 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/handwired/xealous/rules.mk b/keyboards/handwired/xealous/rules.mk index 7178959606..eebd11d86e 100644 --- a/keyboards/handwired/xealous/rules.mk +++ b/keyboards/handwired/xealous/rules.mk @@ -59,7 +59,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes # Use shared split_common code SUBPROJECT_rev1 = yes diff --git a/keyboards/helix/pico/keymaps/biacco/rules.mk b/keyboards/helix/pico/keymaps/biacco/rules.mk index 4f264fa952..d6b36580e1 100644 --- a/keyboards/helix/pico/keymaps/biacco/rules.mk +++ b/keyboards/helix/pico/keymaps/biacco/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port B5 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/pico/keymaps/default/rules.mk b/keyboards/helix/pico/keymaps/default/rules.mk index b1e219537f..c5ee8acb2a 100644 --- a/keyboards/helix/pico/keymaps/default/rules.mk +++ b/keyboards/helix/pico/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port B5 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk index 3f8fd5dc67..c56d6f37e0 100644 --- a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk +++ b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/helix/rev2/keymaps/default/rules.mk b/keyboards/helix/rev2/keymaps/default/rules.mk index 14c353d507..3f84b895aa 100644 --- a/keyboards/helix/rev2/keymaps/default/rules.mk +++ b/keyboards/helix/rev2/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk index 9bd46fabcf..4257d004da 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk +++ b/keyboards/helix/rev2/keymaps/edvorakjp/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/five_rows/rules.mk b/keyboards/helix/rev2/keymaps/five_rows/rules.mk index f771c94c9c..bd7130cfc6 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows/rules.mk @@ -18,7 +18,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk index 14c353d507..3f84b895aa 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/froggy/rules.mk b/keyboards/helix/rev2/keymaps/froggy/rules.mk index e52e4a3736..f460170711 100644 --- a/keyboards/helix/rev2/keymaps/froggy/rules.mk +++ b/keyboards/helix/rev2/keymaps/froggy/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/led_test/rules.mk b/keyboards/helix/rev2/keymaps/led_test/rules.mk index f599cd4f38..a9cd251bc5 100644 --- a/keyboards/helix/rev2/keymaps/led_test/rules.mk +++ b/keyboards/helix/rev2/keymaps/led_test/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk index 8331a2e1d8..3f390b48f8 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk +++ b/keyboards/helix/rev2/keymaps/yshrsmz/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing define HELIX_CUSTOMISE_MSG diff --git a/keyboards/helix/rules.mk b/keyboards/helix/rules.mk index 7c1d56527a..be234e60ec 100644 --- a/keyboards/helix/rules.mk +++ b/keyboards/helix/rules.mk @@ -62,7 +62,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = no USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/hhkb/keymaps/cinaeco/rules.mk b/keyboards/hhkb/keymaps/cinaeco/rules.mk index 05b724051e..efed95492f 100644 --- a/keyboards/hhkb/keymaps/cinaeco/rules.mk +++ b/keyboards/hhkb/keymaps/cinaeco/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/iris/keymaps/edvorakjp/rules.mk b/keyboards/iris/keymaps/edvorakjp/rules.mk index 1c88fbc7bc..58d244c389 100644 --- a/keyboards/iris/keymaps/edvorakjp/rules.mk +++ b/keyboards/iris/keymaps/edvorakjp/rules.mk @@ -13,4 +13,4 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/iris/rules.mk b/keyboards/iris/rules.mk index 88dd66c18e..e93d7dae80 100644 --- a/keyboards/iris/rules.mk +++ b/keyboards/iris/rules.mk @@ -61,7 +61,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/jd45/keymaps/mjt/rules.mk b/keyboards/jd45/keymaps/mjt/rules.mk index 1f4b391d55..a22e71b0d9 100644 --- a/keyboards/jd45/keymaps/mjt/rules.mk +++ b/keyboards/jd45/keymaps/mjt/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/jd45/keymaps/mjt6u/rules.mk b/keyboards/jd45/keymaps/mjt6u/rules.mk index f9cec3b84a..1df8b9754b 100644 --- a/keyboards/jd45/keymaps/mjt6u/rules.mk +++ b/keyboards/jd45/keymaps/mjt6u/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend DEBUG_ENABLE = yes diff --git a/keyboards/kinesis/keymaps/carpalx/rules.mk b/keyboards/kinesis/keymaps/carpalx/rules.mk index 1854d35df2..c7753fae05 100644 --- a/keyboards/kinesis/keymaps/carpalx/rules.mk +++ b/keyboards/kinesis/keymaps/carpalx/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/kinesis/keymaps/default/rules.mk b/keyboards/kinesis/keymaps/default/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/kinesis/keymaps/default/rules.mk +++ b/keyboards/kinesis/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/kinesis/keymaps/default_pretty/rules.mk b/keyboards/kinesis/keymaps/default_pretty/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/kinesis/keymaps/default_pretty/rules.mk +++ b/keyboards/kinesis/keymaps/default_pretty/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/kinesis/keymaps/dvorak/rules.mk b/keyboards/kinesis/keymaps/dvorak/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/kinesis/keymaps/dvorak/rules.mk +++ b/keyboards/kinesis/keymaps/dvorak/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk index 8e4a8ffada..24b16ba9b7 100644 --- a/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk +++ b/keyboards/kinesis/keymaps/insertsnideremarks/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dancing function diff --git a/keyboards/kinesis/keymaps/milestogo/rules.mk b/keyboards/kinesis/keymaps/milestogo/rules.mk index 9d3df5964f..93f927c7d0 100644 --- a/keyboards/kinesis/keymaps/milestogo/rules.mk +++ b/keyboards/kinesis/keymaps/milestogo/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/kinesis/keymaps/xyverz/rules.mk b/keyboards/kinesis/keymaps/xyverz/rules.mk index c21f8aea67..94dc4cdfea 100644 --- a/keyboards/kinesis/keymaps/xyverz/rules.mk +++ b/keyboards/kinesis/keymaps/xyverz/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/launchpad/keymaps/default/rules.mk b/keyboards/launchpad/keymaps/default/rules.mk index 260b9d8fad..9bf35a59d0 100644 --- a/keyboards/launchpad/keymaps/default/rules.mk +++ b/keyboards/launchpad/keymaps/default/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/lets_split/keymaps/OLED_sample/rules.mk b/keyboards/lets_split/keymaps/OLED_sample/rules.mk index 874d09eab5..a14e84d4e5 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/rules.mk +++ b/keyboards/lets_split/keymaps/OLED_sample/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/lets_split/keymaps/heartrobotninja/rules.mk b/keyboards/lets_split/keymaps/heartrobotninja/rules.mk index 2261a848aa..36f5e5b6d5 100644 --- a/keyboards/lets_split/keymaps/heartrobotninja/rules.mk +++ b/keyboards/lets_split/keymaps/heartrobotninja/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE @@ -23,4 +23,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR include ../../../../Makefile endif - diff --git a/keyboards/lets_split/keymaps/mjt/rules.mk b/keyboards/lets_split/keymaps/mjt/rules.mk index 874d09eab5..a14e84d4e5 100644 --- a/keyboards/lets_split/keymaps/mjt/rules.mk +++ b/keyboards/lets_split/keymaps/mjt/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/lets_split/keymaps/piemod/rules.mk b/keyboards/lets_split/keymaps/piemod/rules.mk index 027ea977e7..e2bb583cd9 100644 --- a/keyboards/lets_split/keymaps/piemod/rules.mk +++ b/keyboards/lets_split/keymaps/piemod/rules.mk @@ -9,5 +9,5 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = no diff --git a/keyboards/lets_split/keymaps/xk/rules.mk b/keyboards/lets_split/keymaps/xk/rules.mk index 84bf8e1f59..195f015778 100644 --- a/keyboards/lets_split/keymaps/xk/rules.mk +++ b/keyboards/lets_split/keymaps/xk/rules.mk @@ -11,7 +11,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) ifndef QUANTUM_DIR diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk index 951723edc5..4cd972786f 100644 --- a/keyboards/lets_split/rules.mk +++ b/keyboards/lets_split/rules.mk @@ -64,7 +64,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/levinson/keymaps/losinggeneration/rules.mk b/keyboards/levinson/keymaps/losinggeneration/rules.mk index f3e47b4c2e..c8eef2cb3f 100644 --- a/keyboards/levinson/keymaps/losinggeneration/rules.mk +++ b/keyboards/levinson/keymaps/losinggeneration/rules.mk @@ -10,7 +10,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/levinson/rules.mk b/keyboards/levinson/rules.mk index 4805ed99ee..8f1fa130fa 100644 --- a/keyboards/levinson/rules.mk +++ b/keyboards/levinson/rules.mk @@ -22,7 +22,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk index 20030f17d0..555ad97230 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk index ab20ac0db2..147e95bc87 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk index 20030f17d0..555ad97230 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk index d2ddd15783..1653f4e302 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no diff --git a/keyboards/lily58/rules.mk b/keyboards/lily58/rules.mk index 72964fca1b..ad8ad585e9 100644 --- a/keyboards/lily58/rules.mk +++ b/keyboards/lily58/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = no USE_I2C = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/meira/rules.mk b/keyboards/meira/rules.mk index d3e45fc8d0..6c2472f433 100644 --- a/keyboards/meira/rules.mk +++ b/keyboards/meira/rules.mk @@ -59,7 +59,7 @@ 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 -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches BACKLIGHT_CUSTOM_DRIVER = yes BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality, also set ISSI_ENABLE below for Miera diff --git a/keyboards/minidox/keymaps/alairock/rules.mk b/keyboards/minidox/keymaps/alairock/rules.mk index cd7ab91c22..ebada165ae 100644 --- a/keyboards/minidox/keymaps/alairock/rules.mk +++ b/keyboards/minidox/keymaps/alairock/rules.mk @@ -1,2 +1,2 @@ -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. EXTRAKEY_ENABLE = yes diff --git a/keyboards/minidox/keymaps/that_canadian/rules.mk b/keyboards/minidox/keymaps/that_canadian/rules.mk index 52ef1ad3e4..7637dfc09a 100644 --- a/keyboards/minidox/keymaps/that_canadian/rules.mk +++ b/keyboards/minidox/keymaps/that_canadian/rules.mk @@ -1,4 +1,4 @@ -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/minidox/keymaps/xyverz/rules.mk b/keyboards/minidox/keymaps/xyverz/rules.mk index d34df5b19b..c777cb1b9f 100644 --- a/keyboards/minidox/keymaps/xyverz/rules.mk +++ b/keyboards/minidox/keymaps/xyverz/rules.mk @@ -1 +1 @@ -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/minidox/rules.mk b/keyboards/minidox/rules.mk index 0c3a03bd73..861976e15b 100644 --- a/keyboards/minidox/rules.mk +++ b/keyboards/minidox/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE ?= no # MIDI controls 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. +RGBLIGHT_ENABLE ?= no # Enable WS2812 RGB underlight. USE_I2C ?= no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/mint60/rules.mk b/keyboards/mint60/rules.mk index b4d4bddd33..b4472153bc 100644 --- a/keyboards/mint60/rules.mk +++ b/keyboards/mint60/rules.mk @@ -75,4 +75,4 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) CUSTOM_MATRIX = yes USE_I2C = yes -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/miuni32/keymaps/adam-lee/rules.mk b/keyboards/miuni32/keymaps/adam-lee/rules.mk index 88a3aea741..3138ab57f7 100644 --- a/keyboards/miuni32/keymaps/adam-lee/rules.mk +++ b/keyboards/miuni32/keymaps/adam-lee/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/miuni32/keymaps/default/rules.mk b/keyboards/miuni32/keymaps/default/rules.mk index 88a3aea741..3138ab57f7 100644 --- a/keyboards/miuni32/keymaps/default/rules.mk +++ b/keyboards/miuni32/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/miuni32/keymaps/ht_156/rules.mk b/keyboards/miuni32/keymaps/ht_156/rules.mk index 88a3aea741..3138ab57f7 100644 --- a/keyboards/miuni32/keymaps/ht_156/rules.mk +++ b/keyboards/miuni32/keymaps/ht_156/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/miuni32/keymaps/ki/rules.mk b/keyboards/miuni32/keymaps/ki/rules.mk index 8a72a6e4e7..7639c2b3f1 100644 --- a/keyboards/miuni32/keymaps/ki/rules.mk +++ b/keyboards/miuni32/keymaps/ki/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/mt40/rules.mk b/keyboards/mt40/rules.mk index 64e7413f5c..db6ec93f5e 100644 --- a/keyboards/mt40/rules.mk +++ b/keyboards/mt40/rules.mk @@ -27,7 +27,7 @@ MIDI_ENABLE ?= no # MIDI controls 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 ?= yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE ?= yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes TAP_DANCE_ENABLE = no diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk b/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk index b1d7055da7..124de79deb 100644 --- a/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk +++ b/keyboards/niu_mini/keymaps/spacebarracecar/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/nyquist/keymaps/DivergeJM/rules.mk b/keyboards/nyquist/keymaps/DivergeJM/rules.mk index 654e82a10f..2c26b47ea1 100644 --- a/keyboards/nyquist/keymaps/DivergeJM/rules.mk +++ b/keyboards/nyquist/keymaps/DivergeJM/rules.mk @@ -29,6 +29,6 @@ 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance diff --git a/keyboards/nyquist/keymaps/danielhklein/rules.mk b/keyboards/nyquist/keymaps/danielhklein/rules.mk index 0b540a4712..12ad2fec59 100644 --- a/keyboards/nyquist/keymaps/danielhklein/rules.mk +++ b/keyboards/nyquist/keymaps/danielhklein/rules.mk @@ -29,6 +29,6 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance diff --git a/keyboards/nyquist/keymaps/losinggeneration/rules.mk b/keyboards/nyquist/keymaps/losinggeneration/rules.mk index 1728afd85c..ea2b7165d9 100644 --- a/keyboards/nyquist/keymaps/losinggeneration/rules.mk +++ b/keyboards/nyquist/keymaps/losinggeneration/rules.mk @@ -10,7 +10,7 @@ COMMAND_ENABLE = no # Commands for debug and configuration CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/nyquist/rules.mk b/keyboards/nyquist/rules.mk index e8f1840418..74d5625f85 100644 --- a/keyboards/nyquist/rules.mk +++ b/keyboards/nyquist/rules.mk @@ -64,7 +64,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID USE_I2C = yes -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/org60/rules.mk b/keyboards/org60/rules.mk index c79e6e2704..53e9a28fe8 100644 --- a/keyboards/org60/rules.mk +++ b/keyboards/org60/rules.mk @@ -59,7 +59,7 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) MIDI_ENABLE = no # MIDI controls MOUSEKEY_ENABLE = yes # Mouse keys(+4700) NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend UNICODE_ENABLE = no # Unicode diff --git a/keyboards/orthodox/rules.mk b/keyboards/orthodox/rules.mk index 7132a915bf..715f25c3a0 100644 --- a/keyboards/orthodox/rules.mk +++ b/keyboards/orthodox/rules.mk @@ -61,7 +61,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/ab/rules.mk b/keyboards/planck/keymaps/ab/rules.mk index 44a030ba38..0b025a2313 100644 --- a/keyboards/planck/keymaps/ab/rules.mk +++ b/keyboards/planck/keymaps/ab/rules.mk @@ -53,7 +53,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/alexey/rules.mk b/keyboards/planck/keymaps/alexey/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/alexey/rules.mk +++ b/keyboards/planck/keymaps/alexey/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/angerthosenear/rules.mk b/keyboards/planck/keymaps/angerthosenear/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/angerthosenear/rules.mk +++ b/keyboards/planck/keymaps/angerthosenear/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/austin/rules.mk b/keyboards/planck/keymaps/austin/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/austin/rules.mk +++ b/keyboards/planck/keymaps/austin/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/basic/rules.mk b/keyboards/planck/keymaps/basic/rules.mk index 0c0632da09..6f88a28d50 100644 --- a/keyboards/planck/keymaps/basic/rules.mk +++ b/keyboards/planck/keymaps/basic/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/bone2planck/rules.mk b/keyboards/planck/keymaps/bone2planck/rules.mk index 39635192e5..699726948d 100644 --- a/keyboards/planck/keymaps/bone2planck/rules.mk +++ b/keyboards/planck/keymaps/bone2planck/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/callum/rules.mk b/keyboards/planck/keymaps/callum/rules.mk index 8ee9a45ab7..67fe8d284d 100644 --- a/keyboards/planck/keymaps/callum/rules.mk +++ b/keyboards/planck/keymaps/callum/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/cbbrowne/rules.mk b/keyboards/planck/keymaps/cbbrowne/rules.mk index d5026e2d9b..c7cef55a9a 100644 --- a/keyboards/planck/keymaps/cbbrowne/rules.mk +++ b/keyboards/planck/keymaps/cbbrowne/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no # Enable SYSEX API (+5390) # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/chance/rules.mk b/keyboards/planck/keymaps/chance/rules.mk index 00d09e974a..5c9798a572 100644 --- a/keyboards/planck/keymaps/chance/rules.mk +++ b/keyboards/planck/keymaps/chance/rules.mk @@ -1,4 +1,4 @@ -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no ifndef QUANTUM_DIR diff --git a/keyboards/planck/keymaps/charlie/rules.mk b/keyboards/planck/keymaps/charlie/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/charlie/rules.mk +++ b/keyboards/planck/keymaps/charlie/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/circuit/rules.mk b/keyboards/planck/keymaps/circuit/rules.mk index 1ed0ff9568..e9a02e31e2 100644 --- a/keyboards/planck/keymaps/circuit/rules.mk +++ b/keyboards/planck/keymaps/circuit/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/daniel/rules.mk b/keyboards/planck/keymaps/daniel/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/daniel/rules.mk +++ b/keyboards/planck/keymaps/daniel/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/danielhklein/rules.mk b/keyboards/planck/keymaps/danielhklein/rules.mk index a73d851833..72386fae7d 100644 --- a/keyboards/planck/keymaps/danielhklein/rules.mk +++ b/keyboards/planck/keymaps/danielhklein/rules.mk @@ -9,6 +9,6 @@ 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance \ No newline at end of file diff --git a/keyboards/planck/keymaps/david/rules.mk b/keyboards/planck/keymaps/david/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/david/rules.mk +++ b/keyboards/planck/keymaps/david/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/dc/rules.mk b/keyboards/planck/keymaps/dc/rules.mk index 6106b40e14..ea4341b4fd 100644 --- a/keyboards/planck/keymaps/dc/rules.mk +++ b/keyboards/planck/keymaps/dc/rules.mk @@ -17,7 +17,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/dlaroe/rules.mk b/keyboards/planck/keymaps/dlaroe/rules.mk index 22a08c668b..0064f622b7 100644 --- a/keyboards/planck/keymaps/dlaroe/rules.mk +++ b/keyboards/planck/keymaps/dlaroe/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/dr_notsokind/rules.mk b/keyboards/planck/keymaps/dr_notsokind/rules.mk index 7f691ebe43..eea90f8e6a 100644 --- a/keyboards/planck/keymaps/dr_notsokind/rules.mk +++ b/keyboards/planck/keymaps/dr_notsokind/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # Enables the double-tap functionality of keys # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/dzobert/rules.mk b/keyboards/planck/keymaps/dzobert/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/dzobert/rules.mk +++ b/keyboards/planck/keymaps/dzobert/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/espynn/rules.mk b/keyboards/planck/keymaps/espynn/rules.mk index 44a030ba38..0b025a2313 100644 --- a/keyboards/planck/keymaps/espynn/rules.mk +++ b/keyboards/planck/keymaps/espynn/rules.mk @@ -53,7 +53,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/experimental/rules.mk b/keyboards/planck/keymaps/experimental/rules.mk index 168d3cb9f0..721e887b98 100644 --- a/keyboards/planck/keymaps/experimental/rules.mk +++ b/keyboards/planck/keymaps/experimental/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = yes # Enable one-hand typing STENO_ENABLE = yes # Enable TX Bolt protocol for Stenography, requires VIRTSER and may not work with mouse keys LEADER_ENABLE = yes diff --git a/keyboards/planck/keymaps/gabriel/rules.mk b/keyboards/planck/keymaps/gabriel/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/gabriel/rules.mk +++ b/keyboards/planck/keymaps/gabriel/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/gunp/rules.mk b/keyboards/planck/keymaps/gunp/rules.mk index 1ad30423be..7d03482abc 100644 --- a/keyboards/planck/keymaps/gunp/rules.mk +++ b/keyboards/planck/keymaps/gunp/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/impossible/rules.mk b/keyboards/planck/keymaps/impossible/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/impossible/rules.mk +++ b/keyboards/planck/keymaps/impossible/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/jacob/rules.mk b/keyboards/planck/keymaps/jacob/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/jacob/rules.mk +++ b/keyboards/planck/keymaps/jacob/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/jeebak/rules.mk b/keyboards/planck/keymaps/jeebak/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/jeebak/rules.mk +++ b/keyboards/planck/keymaps/jeebak/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/jhenahan/rules.mk b/keyboards/planck/keymaps/jhenahan/rules.mk index bb12dd865c..f8d1f0d8f3 100644 --- a/keyboards/planck/keymaps/jhenahan/rules.mk +++ b/keyboards/planck/keymaps/jhenahan/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/joe/rules.mk b/keyboards/planck/keymaps/joe/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/joe/rules.mk +++ b/keyboards/planck/keymaps/joe/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/johannes/rules.mk b/keyboards/planck/keymaps/johannes/rules.mk index 0c0632da09..6f88a28d50 100644 --- a/keyboards/planck/keymaps/johannes/rules.mk +++ b/keyboards/planck/keymaps/johannes/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/kyle/rules.mk b/keyboards/planck/keymaps/kyle/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/kyle/rules.mk +++ b/keyboards/planck/keymaps/kyle/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/lae3/rules.mk b/keyboards/planck/keymaps/lae3/rules.mk index 595803e322..89b147f819 100644 --- a/keyboards/planck/keymaps/lae3/rules.mk +++ b/keyboards/planck/keymaps/lae3/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/leo/rules.mk b/keyboards/planck/keymaps/leo/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/leo/rules.mk +++ b/keyboards/planck/keymaps/leo/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/lucas/rules.mk b/keyboards/planck/keymaps/lucas/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/lucas/rules.mk +++ b/keyboards/planck/keymaps/lucas/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/lukas/rules.mk b/keyboards/planck/keymaps/lukas/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/lukas/rules.mk +++ b/keyboards/planck/keymaps/lukas/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/luke/rules.mk b/keyboards/planck/keymaps/luke/rules.mk index 847686873d..76ed281c11 100644 --- a/keyboards/planck/keymaps/luke/rules.mk +++ b/keyboards/planck/keymaps/luke/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/max/rules.mk b/keyboards/planck/keymaps/max/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/max/rules.mk +++ b/keyboards/planck/keymaps/max/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/mollat/rules.mk b/keyboards/planck/keymaps/mollat/rules.mk index be3f692802..249f422a55 100644 --- a/keyboards/planck/keymaps/mollat/rules.mk +++ b/keyboards/planck/keymaps/mollat/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/myoung34/rules.mk b/keyboards/planck/keymaps/myoung34/rules.mk index c47418104a..b1aaafd3a4 100644 --- a/keyboards/planck/keymaps/myoung34/rules.mk +++ b/keyboards/planck/keymaps/myoung34/rules.mk @@ -7,5 +7,5 @@ CONSOLE_ENABLE = no # Console for debug(+400) MIDI_ENABLE = no # MIDI controls MOUSEKEY_ENABLE = no # Mouse keys(+4700) NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BACKLIGHT_ENABLE = yes diff --git a/keyboards/planck/keymaps/narze/rules.mk b/keyboards/planck/keymaps/narze/rules.mk index 05c2ce455f..286a2ffdc1 100644 --- a/keyboards/planck/keymaps/narze/rules.mk +++ b/keyboards/planck/keymaps/narze/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/neo2planck/rules.mk b/keyboards/planck/keymaps/neo2planck/rules.mk index 2122dd349b..cedf3095e6 100644 --- a/keyboards/planck/keymaps/neo2planck/rules.mk +++ b/keyboards/planck/keymaps/neo2planck/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/nico/rules.mk b/keyboards/planck/keymaps/nico/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/nico/rules.mk +++ b/keyboards/planck/keymaps/nico/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/not-quite-neo/rules.mk b/keyboards/planck/keymaps/not-quite-neo/rules.mk index 316a3ea7bb..90e6353f65 100644 --- a/keyboards/planck/keymaps/not-quite-neo/rules.mk +++ b/keyboards/planck/keymaps/not-quite-neo/rules.mk @@ -20,7 +20,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) UNICODEMAP_ENABLE = no # Enable extended 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/pickle_jr/rules.mk b/keyboards/planck/keymaps/pickle_jr/rules.mk index d452c706d0..43e0b843f0 100644 --- a/keyboards/planck/keymaps/pickle_jr/rules.mk +++ b/keyboards/planck/keymaps/pickle_jr/rules.mk @@ -12,7 +12,7 @@ BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/premek/rules.mk b/keyboards/planck/keymaps/premek/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/premek/rules.mk +++ b/keyboards/planck/keymaps/premek/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/priyadi/rules.mk b/keyboards/planck/keymaps/priyadi/rules.mk index 27c2638e2f..282c047eec 100644 --- a/keyboards/planck/keymaps/priyadi/rules.mk +++ b/keyboards/planck/keymaps/priyadi/rules.mk @@ -14,7 +14,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # Unicode map 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no FAUXCLICKY_ENABLE = yes diff --git a/keyboards/planck/keymaps/pvc/rules.mk b/keyboards/planck/keymaps/pvc/rules.mk index 8a73eab584..3fb98eca86 100644 --- a/keyboards/planck/keymaps/pvc/rules.mk +++ b/keyboards/planck/keymaps/pvc/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/rai-suta/rules.mk b/keyboards/planck/keymaps/rai-suta/rules.mk index 38efe374cf..ce13befd90 100644 --- a/keyboards/planck/keymaps/rai-suta/rules.mk +++ b/keyboards/planck/keymaps/rai-suta/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/sgoodwin/rules.mk b/keyboards/planck/keymaps/sgoodwin/rules.mk index 279e16eb72..cdcb4a887d 100644 --- a/keyboards/planck/keymaps/sgoodwin/rules.mk +++ b/keyboards/planck/keymaps/sgoodwin/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no # Disable extra stuff for ergodoxen # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/spacebarracecar/rules.mk b/keyboards/planck/keymaps/spacebarracecar/rules.mk index fbdd1217c0..bc817a1403 100644 --- a/keyboards/planck/keymaps/spacebarracecar/rules.mk +++ b/keyboards/planck/keymaps/spacebarracecar/rules.mk @@ -13,11 +13,10 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # Userspace defines GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language - diff --git a/keyboards/planck/keymaps/tak3over/rules.mk b/keyboards/planck/keymaps/tak3over/rules.mk index 247a1fd2ae..1e877943d9 100644 --- a/keyboards/planck/keymaps/tak3over/rules.mk +++ b/keyboards/planck/keymaps/tak3over/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend \ No newline at end of file diff --git a/keyboards/planck/keymaps/thermal_printer/rules.mk b/keyboards/planck/keymaps/thermal_printer/rules.mk index 7c50d87a0f..3c0e340d1f 100644 --- a/keyboards/planck/keymaps/thermal_printer/rules.mk +++ b/keyboards/planck/keymaps/thermal_printer/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. PRINTING_ENABLE = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/planck/keymaps/tong92/rules.mk b/keyboards/planck/keymaps/tong92/rules.mk index e6608e74c5..df9e7918ca 100644 --- a/keyboards/planck/keymaps/tong92/rules.mk +++ b/keyboards/planck/keymaps/tong92/rules.mk @@ -52,7 +52,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/vifon/rules.mk b/keyboards/planck/keymaps/vifon/rules.mk index da83096d6b..5caec1afa8 100644 --- a/keyboards/planck/keymaps/vifon/rules.mk +++ b/keyboards/planck/keymaps/vifon/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. API_SYSEX_ENABLE = no # https://www.reddit.com/r/olkb/comments/5swhij/_/ddie6zq/ KEY_LOCK_ENABLE = yes diff --git a/keyboards/planck/keymaps/yale/rules.mk b/keyboards/planck/keymaps/yale/rules.mk index 581e08cd02..caff043c58 100644 --- a/keyboards/planck/keymaps/yale/rules.mk +++ b/keyboards/planck/keymaps/yale/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/yang/rules.mk b/keyboards/planck/keymaps/yang/rules.mk index 6b18762fa7..173fe29893 100644 --- a/keyboards/planck/keymaps/yang/rules.mk +++ b/keyboards/planck/keymaps/yang/rules.mk @@ -2,7 +2,7 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. AUDIO_ENABLE = no ifndef QUANTUM_DIR diff --git a/keyboards/planck/keymaps/zach/rules.mk b/keyboards/planck/keymaps/zach/rules.mk index 9d86fc81fc..ca24b47929 100644 --- a/keyboards/planck/keymaps/zach/rules.mk +++ b/keyboards/planck/keymaps/zach/rules.mk @@ -20,7 +20,7 @@ AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode (can't be used with unicodemap) UNICODEMAP_ENABLE = yes # Enable extended 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/planck/keymaps/zrichard/rules.mk b/keyboards/planck/keymaps/zrichard/rules.mk index 0b87bc9882..7b17f58ce1 100755 --- a/keyboards/planck/keymaps/zrichard/rules.mk +++ b/keyboards/planck/keymaps/zrichard/rules.mk @@ -20,7 +20,7 @@ MIDI_ENABLE = yes # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = no # Enable double or n tap macros # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/bucktooth/rules.mk b/keyboards/preonic/keymaps/bucktooth/rules.mk index 3e87d41d36..9dbdfcbd3b 100644 --- a/keyboards/preonic/keymaps/bucktooth/rules.mk +++ b/keyboards/preonic/keymaps/bucktooth/rules.mk @@ -11,7 +11,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/dlaroe/rules.mk b/keyboards/preonic/keymaps/dlaroe/rules.mk index b356244713..eea3168497 100644 --- a/keyboards/preonic/keymaps/dlaroe/rules.mk +++ b/keyboards/preonic/keymaps/dlaroe/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/jacwib/rules.mk b/keyboards/preonic/keymaps/jacwib/rules.mk index 3e87d41d36..9dbdfcbd3b 100644 --- a/keyboards/preonic/keymaps/jacwib/rules.mk +++ b/keyboards/preonic/keymaps/jacwib/rules.mk @@ -11,7 +11,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/kinesis/rules.mk b/keyboards/preonic/keymaps/kinesis/rules.mk index 6c8d2897cd..f37fe43389 100644 --- a/keyboards/preonic/keymaps/kinesis/rules.mk +++ b/keyboards/preonic/keymaps/kinesis/rules.mk @@ -15,7 +15,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/seph/rules.mk b/keyboards/preonic/keymaps/seph/rules.mk index 4333bf4553..dd26cd906d 100644 --- a/keyboards/preonic/keymaps/seph/rules.mk +++ b/keyboards/preonic/keymaps/seph/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/preonic/keymaps/zach/rules.mk b/keyboards/preonic/keymaps/zach/rules.mk index eebf413495..f00af43961 100644 --- a/keyboards/preonic/keymaps/zach/rules.mk +++ b/keyboards/preonic/keymaps/zach/rules.mk @@ -20,7 +20,7 @@ AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode UNICODEMAP_ENABLE = yes # Enable extended 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/quefrency/rules.mk b/keyboards/quefrency/rules.mk index b78dc5df7b..3ec04fbf1f 100644 --- a/keyboards/quefrency/rules.mk +++ b/keyboards/quefrency/rules.mk @@ -22,7 +22,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/qwertyydox/rules.mk b/keyboards/qwertyydox/rules.mk index d8a287bbc8..d04a4b9f30 100644 --- a/keyboards/qwertyydox/rules.mk +++ b/keyboards/qwertyydox/rules.mk @@ -58,7 +58,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # I2C is used between the sides # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 02617cf1c7..7ab1b7d3ba 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -68,7 +68,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -76,4 +76,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes - diff --git a/keyboards/redox/rules.mk b/keyboards/redox/rules.mk index c74a3bda2c..748d89dcfb 100644 --- a/keyboards/redox/rules.mk +++ b/keyboards/redox/rules.mk @@ -66,7 +66,7 @@ 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 -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes diff --git a/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk b/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk index 6beaae7aee..b9e39c0539 100644 --- a/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk +++ b/keyboards/rorschach/keymaps/insertsnideremarks/rules.mk @@ -14,8 +14,6 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dancing function - - diff --git a/keyboards/rorschach/rules.mk b/keyboards/rorschach/rules.mk index 9de068d2f2..3201253487 100644 --- a/keyboards/rorschach/rules.mk +++ b/keyboards/rorschach/rules.mk @@ -17,7 +17,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk b/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk index 6a078bcc3f..cf50122526 100644 --- a/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk +++ b/keyboards/s60_x/keymaps/ansi_qwertz/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/s60_x/keymaps/bluebear/rules.mk b/keyboards/s60_x/keymaps/bluebear/rules.mk index 78d770d262..b7c9a04790 100644 --- a/keyboards/s60_x/keymaps/bluebear/rules.mk +++ b/keyboards/s60_x/keymaps/bluebear/rules.mk @@ -9,6 +9,6 @@ MIDI_ENABLE = yes # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable tap dancing keys \ No newline at end of file diff --git a/keyboards/satan/keymaps/addcninblue/rules.mk b/keyboards/satan/keymaps/addcninblue/rules.mk index c2937fd57f..fd7f34300b 100644 --- a/keyboards/satan/keymaps/addcninblue/rules.mk +++ b/keyboards/satan/keymaps/addcninblue/rules.mk @@ -16,6 +16,6 @@ UNICODEMAP_ENABLE = no # This allows sending unicode symbols using X() UNICODE_ENABLE =no # Unicode UCIS_ENABLE = no # Keep in mind that not all will work (See WinCompose for details on Windows). 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no# Breathing sleep LED during USB suspend API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/ben_iso/rules.mk b/keyboards/satan/keymaps/ben_iso/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/ben_iso/rules.mk +++ b/keyboards/satan/keymaps/ben_iso/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/chaser/rules.mk b/keyboards/satan/keymaps/chaser/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/chaser/rules.mk +++ b/keyboards/satan/keymaps/chaser/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/colemak/rules.mk b/keyboards/satan/keymaps/colemak/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/colemak/rules.mk +++ b/keyboards/satan/keymaps/colemak/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/default/rules.mk b/keyboards/satan/keymaps/default/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/default/rules.mk +++ b/keyboards/satan/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/dende_iso/rules.mk b/keyboards/satan/keymaps/dende_iso/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/dende_iso/rules.mk +++ b/keyboards/satan/keymaps/dende_iso/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/dkrieger/rules.mk b/keyboards/satan/keymaps/dkrieger/rules.mk index 4c280ceb04..f2434d30e5 100644 --- a/keyboards/satan/keymaps/dkrieger/rules.mk +++ b/keyboards/satan/keymaps/dkrieger/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes diff --git a/keyboards/satan/keymaps/isoHHKB/rules.mk b/keyboards/satan/keymaps/isoHHKB/rules.mk index 026b33c7d8..80ce560588 100644 --- a/keyboards/satan/keymaps/isoHHKB/rules.mk +++ b/keyboards/satan/keymaps/isoHHKB/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/lepa/rules.mk b/keyboards/satan/keymaps/lepa/rules.mk index 636dd1b1d3..72ca006465 100644 --- a/keyboards/satan/keymaps/lepa/rules.mk +++ b/keyboards/satan/keymaps/lepa/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes diff --git a/keyboards/satan/keymaps/midi/rules.mk b/keyboards/satan/keymaps/midi/rules.mk index 89c34b3946..d144314de7 100644 --- a/keyboards/satan/keymaps/midi/rules.mk +++ b/keyboards/satan/keymaps/midi/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/olligranlund_iso/rules.mk b/keyboards/satan/keymaps/olligranlund_iso/rules.mk index c96deccaa9..73106b6749 100644 --- a/keyboards/satan/keymaps/olligranlund_iso/rules.mk +++ b/keyboards/satan/keymaps/olligranlund_iso/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/satan/keymaps/sethbc/rules.mk b/keyboards/satan/keymaps/sethbc/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/satan/keymaps/sethbc/rules.mk +++ b/keyboards/satan/keymaps/sethbc/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/smt/rules.mk b/keyboards/satan/keymaps/smt/rules.mk index 0c9ae824f6..806c2cb84b 100644 --- a/keyboards/satan/keymaps/smt/rules.mk +++ b/keyboards/satan/keymaps/smt/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/satan/keymaps/unxmaal/rules.mk b/keyboards/satan/keymaps/unxmaal/rules.mk index ee94a67b4e..470d621b10 100644 --- a/keyboards/satan/keymaps/unxmaal/rules.mk +++ b/keyboards/satan/keymaps/unxmaal/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/ardakilic/rules.mk b/keyboards/tada68/keymaps/ardakilic/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/ardakilic/rules.mk +++ b/keyboards/tada68/keymaps/ardakilic/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/bazooka/rules.mk b/keyboards/tada68/keymaps/bazooka/rules.mk index 1915481bf9..b2789a78a7 100644 --- a/keyboards/tada68/keymaps/bazooka/rules.mk +++ b/keyboards/tada68/keymaps/bazooka/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/cheese/rules.mk b/keyboards/tada68/keymaps/cheese/rules.mk index fdbd25ea80..b2789a78a7 100644 --- a/keyboards/tada68/keymaps/cheese/rules.mk +++ b/keyboards/tada68/keymaps/cheese/rules.mk @@ -13,6 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - diff --git a/keyboards/tada68/keymaps/default/rules.mk b/keyboards/tada68/keymaps/default/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/default/rules.mk +++ b/keyboards/tada68/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/fakb/rules.mk b/keyboards/tada68/keymaps/fakb/rules.mk index 54b79fc9d4..642e16de59 100644 --- a/keyboards/tada68/keymaps/fakb/rules.mk +++ b/keyboards/tada68/keymaps/fakb/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/fezzant/rules.mk b/keyboards/tada68/keymaps/fezzant/rules.mk index f2439cc7d1..8df84ae954 100644 --- a/keyboards/tada68/keymaps/fezzant/rules.mk +++ b/keyboards/tada68/keymaps/fezzant/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/iso-nor/rules.mk b/keyboards/tada68/keymaps/iso-nor/rules.mk index 4deca710b8..baaca071cf 100644 --- a/keyboards/tada68/keymaps/iso-nor/rules.mk +++ b/keyboards/tada68/keymaps/iso-nor/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/iso-uk/rules.mk b/keyboards/tada68/keymaps/iso-uk/rules.mk index 4deca710b8..baaca071cf 100644 --- a/keyboards/tada68/keymaps/iso-uk/rules.mk +++ b/keyboards/tada68/keymaps/iso-uk/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/isoish/rules.mk b/keyboards/tada68/keymaps/isoish/rules.mk index 4deca710b8..baaca071cf 100644 --- a/keyboards/tada68/keymaps/isoish/rules.mk +++ b/keyboards/tada68/keymaps/isoish/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/mattdicarlo/rules.mk b/keyboards/tada68/keymaps/mattdicarlo/rules.mk index c920006650..ac92f99f48 100644 --- a/keyboards/tada68/keymaps/mattdicarlo/rules.mk +++ b/keyboards/tada68/keymaps/mattdicarlo/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/mlechner/rules.mk b/keyboards/tada68/keymaps/mlechner/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/mlechner/rules.mk +++ b/keyboards/tada68/keymaps/mlechner/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/mtdjr/rules.mk b/keyboards/tada68/keymaps/mtdjr/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/mtdjr/rules.mk +++ b/keyboards/tada68/keymaps/mtdjr/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/pascamel/rules.mk b/keyboards/tada68/keymaps/pascamel/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/pascamel/rules.mk +++ b/keyboards/tada68/keymaps/pascamel/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/raylas/rules.mk b/keyboards/tada68/keymaps/raylas/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/raylas/rules.mk +++ b/keyboards/tada68/keymaps/raylas/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/rbong/rules.mk b/keyboards/tada68/keymaps/rbong/rules.mk index 1915481bf9..b2789a78a7 100644 --- a/keyboards/tada68/keymaps/rbong/rules.mk +++ b/keyboards/tada68/keymaps/rbong/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/rgb/rules.mk b/keyboards/tada68/keymaps/rgb/rules.mk index ee94a67b4e..470d621b10 100644 --- a/keyboards/tada68/keymaps/rgb/rules.mk +++ b/keyboards/tada68/keymaps/rgb/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/rys/rules.mk b/keyboards/tada68/keymaps/rys/rules.mk index 1915481bf9..b2789a78a7 100644 --- a/keyboards/tada68/keymaps/rys/rules.mk +++ b/keyboards/tada68/keymaps/rys/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/shalzz/rules.mk b/keyboards/tada68/keymaps/shalzz/rules.mk index 1df3af955d..4595aa8c24 100644 --- a/keyboards/tada68/keymaps/shalzz/rules.mk +++ b/keyboards/tada68/keymaps/shalzz/rules.mk @@ -8,5 +8,5 @@ COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no # Audio output on port C6 -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend diff --git a/keyboards/tada68/keymaps/sm0g/rules.mk b/keyboards/tada68/keymaps/sm0g/rules.mk index bd4bb32491..0826db7554 100644 --- a/keyboards/tada68/keymaps/sm0g/rules.mk +++ b/keyboards/tada68/keymaps/sm0g/rules.mk @@ -13,6 +13,6 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Tappa Dance \ No newline at end of file diff --git a/keyboards/tada68/keymaps/stephengrier/rules.mk b/keyboards/tada68/keymaps/stephengrier/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/stephengrier/rules.mk +++ b/keyboards/tada68/keymaps/stephengrier/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/trashcat/rules.mk b/keyboards/tada68/keymaps/trashcat/rules.mk index 644b6a814b..6fb4969193 100644 --- a/keyboards/tada68/keymaps/trashcat/rules.mk +++ b/keyboards/tada68/keymaps/trashcat/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Tappa Dance Bitch ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/tshack/rules.mk b/keyboards/tada68/keymaps/tshack/rules.mk index 061907d3a2..86d22dd3fd 100644 --- a/keyboards/tada68/keymaps/tshack/rules.mk +++ b/keyboards/tada68/keymaps/tshack/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/unix/rules.mk b/keyboards/tada68/keymaps/unix/rules.mk index 46f0b65a9c..aade51459b 100644 --- a/keyboards/tada68/keymaps/unix/rules.mk +++ b/keyboards/tada68/keymaps/unix/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/tada68/keymaps/wamsm_tada/rules.mk b/keyboards/tada68/keymaps/wamsm_tada/rules.mk index 2a7ff27793..bb535beb34 100644 --- a/keyboards/tada68/keymaps/wamsm_tada/rules.mk +++ b/keyboards/tada68/keymaps/wamsm_tada/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/the_ruler/keymaps/default/rules.mk b/keyboards/the_ruler/keymaps/default/rules.mk index fac9327db3..b491f5b3f3 100644 --- a/keyboards/the_ruler/keymaps/default/rules.mk +++ b/keyboards/the_ruler/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/the_ruler/rules.mk b/keyboards/the_ruler/rules.mk index 30d76a3c92..6362176fea 100644 --- a/keyboards/the_ruler/rules.mk +++ b/keyboards/the_ruler/rules.mk @@ -65,4 +65,4 @@ MIDI_ENABLE = no # MIDI controls UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID AUDIO_ENABLE = no # Audio output on port C6 -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk index 7d09c322e5..159fd7dc6c 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/0010/rules.mk @@ -29,7 +29,7 @@ # 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. +# RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk index 7d09c322e5..159fd7dc6c 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/coloneljesus/rules.mk @@ -29,7 +29,7 @@ # 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. +# RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk index 7d09c322e5..159fd7dc6c 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/default/rules.mk @@ -29,7 +29,7 @@ # 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. +# RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk index 7d09c322e5..159fd7dc6c 100644 --- a/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk +++ b/keyboards/thevankeyboards/bananasplit/keymaps/kamon/rules.mk @@ -29,7 +29,7 @@ # 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. +# RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/jeebak/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk index ebc9f810f9..d7ca73ac58 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/jetpacktuxedo/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk index 41afd9a551..b2c421c4dc 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/mjt/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/smt/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk index e60e3c5c5a..1e006e9472 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/tong92/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk +++ b/keyboards/thevankeyboards/minivan/keymaps/xyverz/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/flipphone/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk index 9f3c958bd8..ba4b4fec0c 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/khord/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no # Enable Tap Dance functionality diff --git a/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/mjt/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk index f4671a9d11..3ff1477251 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/singles/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk index b61d6cca2c..030d27f2a6 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/singlesBrent/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dance functionality diff --git a/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk index 72fd3d30ba..d8284e6bd5 100644 --- a/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk +++ b/keyboards/thevankeyboards/roadkit/keymaps/wavebeem-gamepad/rules.mk @@ -13,5 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/vision_division/keymaps/default/rules.mk b/keyboards/vision_division/keymaps/default/rules.mk index 28060947af..342f37453c 100644 --- a/keyboards/vision_division/keymaps/default/rules.mk +++ b/keyboards/vision_division/keymaps/default/rules.mk @@ -13,7 +13,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/vitamins_included/rules.mk b/keyboards/vitamins_included/rules.mk index 4f6d497a6b..34f423f59d 100644 --- a/keyboards/vitamins_included/rules.mk +++ b/keyboards/vitamins_included/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/viterbi/rules.mk b/keyboards/viterbi/rules.mk index af24c15f53..ee043cca3b 100644 --- a/keyboards/viterbi/rules.mk +++ b/keyboards/viterbi/rules.mk @@ -63,7 +63,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/keyboards/wavelet/rules.mk b/keyboards/wavelet/rules.mk index 86149c5622..cfff50a41d 100644 --- a/keyboards/wavelet/rules.mk +++ b/keyboards/wavelet/rules.mk @@ -22,7 +22,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/xd60/rules.mk b/keyboards/xd60/rules.mk index 50fba97e5f..8a60252dcf 100644 --- a/keyboards/xd60/rules.mk +++ b/keyboards/xd60/rules.mk @@ -61,7 +61,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend LAYOUTS = 60_ansi \ No newline at end of file diff --git a/keyboards/xd75/keymaps/fabian/rules.mk b/keyboards/xd75/keymaps/fabian/rules.mk index 6e8941fdfd..f1ae8d44a1 100644 --- a/keyboards/xd75/keymaps/fabian/rules.mk +++ b/keyboards/xd75/keymaps/fabian/rules.mk @@ -29,7 +29,7 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend ifndef QUANTUM_DIR diff --git a/keyboards/xd75/keymaps/germanized/rules.mk b/keyboards/xd75/keymaps/germanized/rules.mk index d72bcf575d..f57fb8c54e 100644 --- a/keyboards/xd75/keymaps/germanized/rules.mk +++ b/keyboards/xd75/keymaps/germanized/rules.mk @@ -29,7 +29,7 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes # Enable Tap Dancing diff --git a/keyboards/xd75/rules.mk b/keyboards/xd75/rules.mk index 5f6e856486..e992729432 100644 --- a/keyboards/xd75/rules.mk +++ b/keyboards/xd75/rules.mk @@ -62,7 +62,7 @@ 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend LAYOUTS = ortho_5x15 \ No newline at end of file diff --git a/keyboards/zeal60/rules.mk b/keyboards/zeal60/rules.mk index f099ea9fdd..1327d88210 100644 --- a/keyboards/zeal60/rules.mk +++ b/keyboards/zeal60/rules.mk @@ -67,7 +67,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend diff --git a/keyboards/zeal65/rules.mk b/keyboards/zeal65/rules.mk index 02617cf1c7..7ab1b7d3ba 100644 --- a/keyboards/zeal65/rules.mk +++ b/keyboards/zeal65/rules.mk @@ -68,7 +68,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -76,4 +76,3 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes - diff --git a/keyboards/zen/rules.mk b/keyboards/zen/rules.mk index 32d3dc51c8..4e82689111 100644 --- a/keyboards/zen/rules.mk +++ b/keyboards/zen/rules.mk @@ -62,7 +62,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes USE_I2C = no # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE diff --git a/layouts/community/ergodox/alphadox/rules.mk b/layouts/community/ergodox/alphadox/rules.mk index f93ff3bb68..57c62a5e63 100644 --- a/layouts/community/ergodox/alphadox/rules.mk +++ b/layouts/community/ergodox/alphadox/rules.mk @@ -9,7 +9,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - - -- cgit v1.2.3 From 7e99d869deb57251dc15620beff34d5fd53066e4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 10:26:19 -0700 Subject: Remove all of the deprecated RGB defines Fixes #3641 --- drivers/avr/ws2812.h | 3 --- keyboards/6ball/config.h | 4 +--- keyboards/9key/config.h | 4 +--- keyboards/amj40/keymaps/default/rules.mk | 3 --- keyboards/amj40/keymaps/fabian/rules.mk | 10 +--------- keyboards/amj40/keymaps/jetpacktuxedo/rules.mk | 8 -------- keyboards/amj40/keymaps/myee/rules.mk | 10 +--------- keyboards/bfo9000/config.h | 2 +- keyboards/blockey/config.h | 5 +---- keyboards/chocopad/config.h | 4 +--- keyboards/crkbd/rev1/config.h | 4 +--- keyboards/deltasplit75/v2/config.h | 6 ++---- keyboards/dilly/config.h | 4 +--- keyboards/ergo42/rev1/config.h | 4 +--- keyboards/ergodash/mini/config.h | 4 +--- keyboards/ergodash/rev1/config.h | 4 +--- keyboards/ergodash/rev2/config.h | 4 +--- keyboards/ergotravel/rev1/config.h | 5 +---- keyboards/fortitude60/rev1/config.h | 2 +- keyboards/fourier/rev1/config.h | 4 +--- keyboards/gh60/keymaps/dbroqua/config.h | 13 +++---------- keyboards/gh60/keymaps/robotmaxtron/config.h | 13 +++---------- keyboards/handwired/dactyl_manuform/config.h | 4 +--- keyboards/handwired/qc60/proto/config.h | 2 -- keyboards/helix/pico/config.h | 4 +--- keyboards/helix/rev1/config.h | 5 +---- keyboards/helix/rev2/config.h | 4 +--- keyboards/iris/rev1/config.h | 2 +- keyboards/iris/rev1_led/config.h | 2 +- keyboards/iris/rev2/config.h | 2 +- keyboards/iris/rev3/config.h | 2 +- keyboards/lets_split/keymaps/zer09/config.h | 4 +--- keyboards/lets_split/rev1/config.h | 4 +--- keyboards/lets_split/rev2/config.h | 4 +--- keyboards/lets_split/sockets/config.h | 4 +--- keyboards/levinson/rev1/config.h | 2 +- keyboards/levinson/rev2/config.h | 2 +- keyboards/lily58/rev1/config.h | 8 +++----- keyboards/meira/config.h | 2 +- keyboards/minidox/keymaps/alairock/config.h | 2 +- keyboards/minidox/keymaps/that_canadian/config.h | 2 +- keyboards/minidox/keymaps/xyverz/config.h | 2 +- keyboards/mint60/config.h | 4 +--- keyboards/miuni32/config.h | 7 +++---- keyboards/nyquist/rev1/config.h | 4 +--- keyboards/nyquist/rev2/config.h | 2 +- keyboards/orthodox/rev1/config.h | 3 --- keyboards/orthodox/rev3/config.h | 4 +--- keyboards/orthodox/rev3_teensy/config.h | 4 +--- keyboards/preonic/keymaps/zach/config.h | 2 +- keyboards/qwertyydox/config.h | 4 +--- keyboards/qwertyydox/rev1/config.h | 4 +--- keyboards/redox/rev1/config.h | 4 +--- keyboards/the_ruler/config.h | 3 +-- keyboards/vitamins_included/rev1/config.h | 4 +--- keyboards/viterbi/rev1/config.h | 4 +--- keyboards/wavelet/config.h | 2 +- keyboards/zen/rev1/config.h | 4 +--- 58 files changed, 62 insertions(+), 180 deletions(-) diff --git a/drivers/avr/ws2812.h b/drivers/avr/ws2812.h index f7e0c31440..1f9299ffb5 100644 --- a/drivers/avr/ws2812.h +++ b/drivers/avr/ws2812.h @@ -69,7 +69,4 @@ void ws2812_sendarray_mask(uint8_t *array,uint16_t length, uint8_t pinmask); #define CONCAT_EXP(a, b) CONCAT(a, b) #endif -// #define ws2812_PORTREG CONCAT_EXP(PORT,ws2812_port) -// #define ws2812_DDRREG CONCAT_EXP(DDR,ws2812_port) - #endif /* LIGHT_WS2812_H_ */ diff --git a/keyboards/6ball/config.h b/keyboards/6ball/config.h index 19d24486cc..b0e59f20c6 100644 --- a/keyboards/6ball/config.h +++ b/keyboards/6ball/config.h @@ -39,11 +39,9 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN F7 -#define RGBLIGHT_TIMER + #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 6 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/9key/config.h b/keyboards/9key/config.h index eee8407cce..4e5a2fd45b 100644 --- a/keyboards/9key/config.h +++ b/keyboards/9key/config.h @@ -39,10 +39,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN F7 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 1 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION COL2ROW diff --git a/keyboards/amj40/keymaps/default/rules.mk b/keyboards/amj40/keymaps/default/rules.mk index 41a1982248..fe98672201 100644 --- a/keyboards/amj40/keymaps/default/rules.mk +++ b/keyboards/amj40/keymaps/default/rules.mk @@ -18,9 +18,6 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - ifndef QUANTUM_DIR include ../../../../Makefile diff --git a/keyboards/amj40/keymaps/fabian/rules.mk b/keyboards/amj40/keymaps/fabian/rules.mk index 7e0634e09e..90559e0dd2 100644 --- a/keyboards/amj40/keymaps/fabian/rules.mk +++ b/keyboards/amj40/keymaps/fabian/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -17,11 +17,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk b/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk index 6ad9236688..2b613b28e4 100644 --- a/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk +++ b/keyboards/amj40/keymaps/jetpacktuxedo/rules.mk @@ -17,11 +17,3 @@ RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. It uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/amj40/keymaps/myee/rules.mk b/keyboards/amj40/keymaps/myee/rules.mk index c35191cef2..fe07e43d82 100644 --- a/keyboards/amj40/keymaps/myee/rules.mk +++ b/keyboards/amj40/keymaps/myee/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -17,11 +17,3 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bfo9000/config.h b/keyboards/bfo9000/config.h index 561d2d1146..893fa5ab6a 100644 --- a/keyboards/bfo9000/config.h +++ b/keyboards/bfo9000/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN B4 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 20 // Number of LEDs /* diff --git a/keyboards/blockey/config.h b/keyboards/blockey/config.h index b099a816bf..53860bfbc9 100644 --- a/keyboards/blockey/config.h +++ b/keyboards/blockey/config.h @@ -51,11 +51,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN B1 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 4 -#define ws2812_PORTREG PORTB -#define ws2812_DDRREG DDRB +#define RGBLED_NUM 4 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/chocopad/config.h b/keyboards/chocopad/config.h index 2163ff8bc4..d2a1a7b484 100644 --- a/keyboards/chocopad/config.h +++ b/keyboards/chocopad/config.h @@ -47,9 +47,7 @@ #define RGBLIGHT_VAL_STEP 8 #endif #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 4 -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD #endif diff --git a/keyboards/crkbd/rev1/config.h b/keyboards/crkbd/rev1/config.h index efce13a490..915779060b 100644 --- a/keyboards/crkbd/rev1/config.h +++ b/keyboards/crkbd/rev1/config.h @@ -57,10 +57,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/deltasplit75/v2/config.h b/keyboards/deltasplit75/v2/config.h index 319a149fbc..475a5c9dc5 100644 --- a/keyboards/deltasplit75/v2/config.h +++ b/keyboards/deltasplit75/v2/config.h @@ -61,10 +61,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options @@ -85,4 +83,4 @@ along with this program. If not, see . //#define NO_ACTION_FUNCTION -#endif \ No newline at end of file +#endif diff --git a/keyboards/dilly/config.h b/keyboards/dilly/config.h index d9ca4597cf..084186fc66 100644 --- a/keyboards/dilly/config.h +++ b/keyboards/dilly/config.h @@ -50,9 +50,7 @@ #define RGBLIGHT_VAL_STEP 8 #endif #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 10 -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD #endif diff --git a/keyboards/ergo42/rev1/config.h b/keyboards/ergo42/rev1/config.h index 1a674a8586..a7edb40972 100644 --- a/keyboards/ergo42/rev1/config.h +++ b/keyboards/ergo42/rev1/config.h @@ -66,10 +66,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/ergodash/mini/config.h b/keyboards/ergodash/mini/config.h index a7be1635c1..11cff145e1 100644 --- a/keyboards/ergodash/mini/config.h +++ b/keyboards/ergodash/mini/config.h @@ -73,10 +73,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 20 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/ergodash/rev1/config.h b/keyboards/ergodash/rev1/config.h index 09dd6604eb..d3f3314ee6 100644 --- a/keyboards/ergodash/rev1/config.h +++ b/keyboards/ergodash/rev1/config.h @@ -63,10 +63,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 24 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/ergodash/rev2/config.h b/keyboards/ergodash/rev2/config.h index 489afe0178..5f9c689916 100644 --- a/keyboards/ergodash/rev2/config.h +++ b/keyboards/ergodash/rev2/config.h @@ -70,10 +70,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 24 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/ergotravel/rev1/config.h b/keyboards/ergotravel/rev1/config.h index 5fa447da74..3af1147a7a 100644 --- a/keyboards/ergotravel/rev1/config.h +++ b/keyboards/ergotravel/rev1/config.h @@ -61,10 +61,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options @@ -83,4 +81,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - diff --git a/keyboards/fortitude60/rev1/config.h b/keyboards/fortitude60/rev1/config.h index 8c6f21afe6..b89f5c7df9 100644 --- a/keyboards/fortitude60/rev1/config.h +++ b/keyboards/fortitude60/rev1/config.h @@ -66,7 +66,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN B5 - #define RGBLIGHT_TIMER + #define RGBLED_NUM 18 // Number of LEDs */ #endif /* diff --git a/keyboards/fourier/rev1/config.h b/keyboards/fourier/rev1/config.h index c137522261..3bd67228c3 100644 --- a/keyboards/fourier/rev1/config.h +++ b/keyboards/fourier/rev1/config.h @@ -56,11 +56,9 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/gh60/keymaps/dbroqua/config.h b/keyboards/gh60/keymaps/dbroqua/config.h index 0b8218d28a..fd63c9a8f7 100644 --- a/keyboards/gh60/keymaps/dbroqua/config.h +++ b/keyboards/gh60/keymaps/dbroqua/config.h @@ -158,26 +158,19 @@ along with this program. If not, see . /* * RGB Underglow * These settings are for the F4 by default: - * * - * #define ws2812_PORTREG PORTF - * #define ws2812_DDRREG DDRF + * * #define ws2812_pin PF4 * #define RGBLED_NUM 14 // Number of LEDs * #define RGBLIGHT_HUE_STEP 10 * #define RGBLIGHT_SAT_STEP 17 * #define RGBLIGHT_VAL_STEP 17 * - * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. - * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c */ -/* Deprecated code below -#define ws2812_PORTREG PORTF -#define ws2812_DDRREG DDRF -#define ws2812_pin PF4 -*/ #define RGB_DI_PIN F4 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 11 // Number of LEDs diff --git a/keyboards/gh60/keymaps/robotmaxtron/config.h b/keyboards/gh60/keymaps/robotmaxtron/config.h index abaddb71f1..925a69efe0 100644 --- a/keyboards/gh60/keymaps/robotmaxtron/config.h +++ b/keyboards/gh60/keymaps/robotmaxtron/config.h @@ -161,26 +161,19 @@ along with this program. If not, see . /* * RGB Underglow * These settings are for the F4 by default: - * * - * #define ws2812_PORTREG PORTF - * #define ws2812_DDRREG DDRF + * * #define ws2812_pin PF4 * #define RGBLED_NUM 14 // Number of LEDs * #define RGBLIGHT_HUE_STEP 10 * #define RGBLIGHT_SAT_STEP 17 * #define RGBLIGHT_VAL_STEP 17 * - * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. - * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. + * The firmware supports 5 different light effects, and the color (hue, saturation, brightness) can be customized in most effects. + * To control the underglow, you need to modify your keymap file to assign those functions to some keys/key combinations. * For details, please check this keymap. keyboard/planck/keymaps/yang/keymap.c */ -/* Deprecated code below -#define ws2812_PORTREG PORTF -#define ws2812_DDRREG DDRF -#define ws2812_pin PF4 -*/ #define RGB_DI_PIN F4 #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 8 // Number of LEDs diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h index 19cd356d89..320ce3c482 100644 --- a/keyboards/handwired/dactyl_manuform/config.h +++ b/keyboards/handwired/dactyl_manuform/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs @@ -74,5 +74,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - diff --git a/keyboards/handwired/qc60/proto/config.h b/keyboards/handwired/qc60/proto/config.h index 81466b0196..8c21fa9265 100644 --- a/keyboards/handwired/qc60/proto/config.h +++ b/keyboards/handwired/qc60/proto/config.h @@ -10,5 +10,3 @@ /* ws2812 RGB LED */ #define RGB_DI_PIN D3 #define RGBLED_NUM 1 // Number of LEDs -// #define ws2812_PORTREG PORTD -// #define ws2812_DDRREG DDRD diff --git a/keyboards/helix/pico/config.h b/keyboards/helix/pico/config.h index 41edfcbc20..b8822e2273 100644 --- a/keyboards/helix/pico/config.h +++ b/keyboards/helix/pico/config.h @@ -83,10 +83,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + //#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD // Helix keyboard RGB LED support //#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no diff --git a/keyboards/helix/rev1/config.h b/keyboards/helix/rev1/config.h index 7fec62fc83..07b5c4f6f8 100644 --- a/keyboards/helix/rev1/config.h +++ b/keyboards/helix/rev1/config.h @@ -74,11 +74,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER -#define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD +#define RGBLED_NUM 12 // Number of LEDs /* * Feature disable options * These options are also useful to firmware size reduction. diff --git a/keyboards/helix/rev2/config.h b/keyboards/helix/rev2/config.h index b354d312d5..f7d35b3714 100644 --- a/keyboards/helix/rev2/config.h +++ b/keyboards/helix/rev2/config.h @@ -87,10 +87,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + //#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD // Helix keyboard RGB LED support //#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index cc7f2d8d44..3c088f6711 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h index e9eac2455c..d8571f8daf 100644 --- a/keyboards/iris/rev1_led/config.h +++ b/keyboards/iris/rev1_led/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 368d21c989..087e0f69e5 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev3/config.h b/keyboards/iris/rev3/config.h index 7f68180c29..3329a4edb2 100644 --- a/keyboards/iris/rev3/config.h +++ b/keyboards/iris/rev3/config.h @@ -63,7 +63,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN F7 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/lets_split/keymaps/zer09/config.h b/keyboards/lets_split/keymaps/zer09/config.h index 73438d8a93..14be4ccc59 100644 --- a/keyboards/lets_split/keymaps/zer09/config.h +++ b/keyboards/lets_split/keymaps/zer09/config.h @@ -52,8 +52,6 @@ along with this program. If not, see . /* ws2812 RGB LED */ #undef RGBLED_NUM #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 50 -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD #endif diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index 73f90e715d..c0e4d1fbce 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -60,10 +60,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 1c48f38e05..1ff25cd480 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h @@ -60,10 +60,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index d004b26bd7..a45cdd13bb 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h @@ -60,10 +60,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D4 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* Audio settings */ #ifdef AUDIO_ENABLE diff --git a/keyboards/levinson/rev1/config.h b/keyboards/levinson/rev1/config.h index 52a644e82f..8161b4e32f 100644 --- a/keyboards/levinson/rev1/config.h +++ b/keyboards/levinson/rev1/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* Backlight LEDs */ diff --git a/keyboards/levinson/rev2/config.h b/keyboards/levinson/rev2/config.h index 4845c935e8..03b98b45c1 100644 --- a/keyboards/levinson/rev2/config.h +++ b/keyboards/levinson/rev2/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* Backlight LEDs */ diff --git a/keyboards/lily58/rev1/config.h b/keyboards/lily58/rev1/config.h index 9413e8d4a2..a991e88322 100644 --- a/keyboards/lily58/rev1/config.h +++ b/keyboards/lily58/rev1/config.h @@ -24,7 +24,7 @@ along with this program. If not, see . /* USB Device descriptor parameter */ #define VENDOR_ID 0xFC51 -#define PRODUCT_ID 0x0058 +#define PRODUCT_ID 0x0058 #define DEVICE_VER 0x0100 #define MANUFACTURER F_YUUCHI #define PRODUCT Lily58 @@ -62,10 +62,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 14 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options @@ -83,4 +81,4 @@ along with this program. If not, see . //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION \ No newline at end of file +//#define NO_ACTION_FUNCTION diff --git a/keyboards/meira/config.h b/keyboards/meira/config.h index 5e9dd6837e..ff39f90eb7 100644 --- a/keyboards/meira/config.h +++ b/keyboards/meira/config.h @@ -42,7 +42,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 15 // Number of LEDs #endif diff --git a/keyboards/minidox/keymaps/alairock/config.h b/keyboards/minidox/keymaps/alairock/config.h index 3649fdd12c..6b0069f4b2 100644 --- a/keyboards/minidox/keymaps/alairock/config.h +++ b/keyboards/minidox/keymaps/alairock/config.h @@ -30,7 +30,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 diff --git a/keyboards/minidox/keymaps/that_canadian/config.h b/keyboards/minidox/keymaps/that_canadian/config.h index 5832d1866e..b85609127e 100644 --- a/keyboards/minidox/keymaps/that_canadian/config.h +++ b/keyboards/minidox/keymaps/that_canadian/config.h @@ -29,7 +29,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 diff --git a/keyboards/minidox/keymaps/xyverz/config.h b/keyboards/minidox/keymaps/xyverz/config.h index 6d7b6256a1..ae26f94999 100644 --- a/keyboards/minidox/keymaps/xyverz/config.h +++ b/keyboards/minidox/keymaps/xyverz/config.h @@ -29,7 +29,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D7 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 8 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 diff --git a/keyboards/mint60/config.h b/keyboards/mint60/config.h index 51c586e636..a762c5ffea 100644 --- a/keyboards/mint60/config.h +++ b/keyboards/mint60/config.h @@ -152,10 +152,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 8 -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/miuni32/config.h b/keyboards/miuni32/config.h index 9f26b2291e..a56a818f55 100644 --- a/keyboards/miuni32/config.h +++ b/keyboards/miuni32/config.h @@ -24,7 +24,7 @@ along with this program. If not, see . #define VENDOR_ID 0xFEED #define PRODUCT_ID 0x6060 #define DEVICE_VER 0x0001 -#define MANUFACTURER Bigtuna.io +#define MANUFACTURER Bigtuna.io #define PRODUCT Miuni32 #define DESCRIPTION A custom keyboard for writers @@ -48,7 +48,7 @@ along with this program. If not, see . /* COL2ROW or ROW2COL */ #define DIODE_DIRECTION ROW2COL - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -159,9 +159,8 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#define RGBLIGHT_TIMER + #define RGB_DI_PIN D0 // The pin your RGB strip is wired to -#define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) #define RGBLED_NUM 7 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 diff --git a/keyboards/nyquist/rev1/config.h b/keyboards/nyquist/rev1/config.h index 61bcb80e2c..eec084eccd 100644 --- a/keyboards/nyquist/rev1/config.h +++ b/keyboards/nyquist/rev1/config.h @@ -61,10 +61,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/nyquist/rev2/config.h b/keyboards/nyquist/rev2/config.h index 75d2e93935..ab062c9209 100644 --- a/keyboards/nyquist/rev2/config.h +++ b/keyboards/nyquist/rev2/config.h @@ -58,7 +58,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs /* Backlight LEDs */ diff --git a/keyboards/orthodox/rev1/config.h b/keyboards/orthodox/rev1/config.h index 98c24c8c08..03936e737f 100644 --- a/keyboards/orthodox/rev1/config.h +++ b/keyboards/orthodox/rev1/config.h @@ -70,10 +70,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ //#define RGB_DI_PIN D3 -//#define RGBLIGHT_TIMER //#define RGBLED_NUM 16 // Number of LEDs -//#define ws2812_PORTREG PORTD -//#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/orthodox/rev3/config.h b/keyboards/orthodox/rev3/config.h index 8514991762..2e4018e91b 100644 --- a/keyboards/orthodox/rev3/config.h +++ b/keyboards/orthodox/rev3/config.h @@ -75,10 +75,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ //#define RGB_DI_PIN D3 -//#define RGBLIGHT_TIMER + //#define RGBLED_NUM 16 // Number of LEDs -//#define ws2812_PORTREG PORTD -//#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/orthodox/rev3_teensy/config.h b/keyboards/orthodox/rev3_teensy/config.h index daba627fa8..e2e693079c 100644 --- a/keyboards/orthodox/rev3_teensy/config.h +++ b/keyboards/orthodox/rev3_teensy/config.h @@ -67,10 +67,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ //#define RGB_DI_PIN D3 -//#define RGBLIGHT_TIMER + //#define RGBLED_NUM 16 // Number of LEDs -//#define ws2812_PORTREG PORTD -//#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/preonic/keymaps/zach/config.h b/keyboards/preonic/keymaps/zach/config.h index 40a083da37..25f88afdc1 100644 --- a/keyboards/preonic/keymaps/zach/config.h +++ b/keyboards/preonic/keymaps/zach/config.h @@ -65,7 +65,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ //#define RGB_DI_PIN D1 -//#define RGBLIGHT_TIMER + //#define RGBLED_NUM 28 // Number of LEDs //#define RGBLIGHT_HUE_STEP 10 //#define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/qwertyydox/config.h b/keyboards/qwertyydox/config.h index 5c4f8a6b2a..b22ca534e3 100644 --- a/keyboards/qwertyydox/config.h +++ b/keyboards/qwertyydox/config.h @@ -64,10 +64,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D6 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/qwertyydox/rev1/config.h b/keyboards/qwertyydox/rev1/config.h index c5c4daa3d3..3d4c9b0d00 100644 --- a/keyboards/qwertyydox/rev1/config.h +++ b/keyboards/qwertyydox/rev1/config.h @@ -64,10 +64,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D6 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* diff --git a/keyboards/redox/rev1/config.h b/keyboards/redox/rev1/config.h index f8041f2356..fe951f7226 100644 --- a/keyboards/redox/rev1/config.h +++ b/keyboards/redox/rev1/config.h @@ -62,10 +62,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 14 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/the_ruler/config.h b/keyboards/the_ruler/config.h index 16135bbd1b..e72875c766 100644 --- a/keyboards/the_ruler/config.h +++ b/keyboards/the_ruler/config.h @@ -155,9 +155,8 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION -#define RGBLIGHT_TIMER + #define RGB_DI_PIN E6 // The pin your RGB strip is wired to -#define RGBLIGHT_TIMER // Require for fancier stuff (not compatible with audio) #define RGBLED_NUM 1 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 diff --git a/keyboards/vitamins_included/rev1/config.h b/keyboards/vitamins_included/rev1/config.h index 26023bfea9..0347477eea 100644 --- a/keyboards/vitamins_included/rev1/config.h +++ b/keyboards/vitamins_included/rev1/config.h @@ -59,10 +59,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN F0 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTF -#define ws2812_DDRREG DDRF #define RGBLIGHT_ANIMATIONS /* Audio settings */ diff --git a/keyboards/viterbi/rev1/config.h b/keyboards/viterbi/rev1/config.h index 3400ea31a1..d6a66408ef 100644 --- a/keyboards/viterbi/rev1/config.h +++ b/keyboards/viterbi/rev1/config.h @@ -61,10 +61,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options diff --git a/keyboards/wavelet/config.h b/keyboards/wavelet/config.h index 4e45ef8e19..ac6c966969 100644 --- a/keyboards/wavelet/config.h +++ b/keyboards/wavelet/config.h @@ -53,7 +53,7 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 12 // Number of LEDs /* Backlight LEDs */ diff --git a/keyboards/zen/rev1/config.h b/keyboards/zen/rev1/config.h index efae558927..890d307570 100644 --- a/keyboards/zen/rev1/config.h +++ b/keyboards/zen/rev1/config.h @@ -65,10 +65,8 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D1 -#define RGBLIGHT_TIMER + #define RGBLED_NUM 16 // Number of LEDs -#define ws2812_PORTREG PORTD -#define ws2812_DDRREG DDRD /* * Feature disable options -- cgit v1.2.3 From ab3fbfdb3b36533125f520b540212a88349ceae6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 10:13:08 -0700 Subject: Update hardware config warnings to be more accurate Closes #3565 --- docs/hardware_avr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hardware_avr.md b/docs/hardware_avr.md index 4d81a23d7d..2c3652a02d 100644 --- a/docs/hardware_avr.md +++ b/docs/hardware_avr.md @@ -66,7 +66,7 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r #define DESCRIPTION A custom keyboard ``` -?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. On Linux these values will not be visible in `lsusb`, since Linux takes that information from the list published by the USB-IF. +?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. ?> On Linux these values will not be visible in lsusb by default, since Linux takes the information from the list maintained by [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. lsusb will show the information reported by the device when executed with -v option. It is also present in kernel logs after plugging in the device. ### Keyboard Matrix Configuration -- cgit v1.2.3 From 9374c0c9db317932d78356b2f92a7993145ea9a2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 11:57:15 -0700 Subject: Add caveats for shifted characters (#4192) * Add caveats for shifted characters And some formatting and grammar corrections. Closes #1037 * Fix spelling of remote * Fix spelling error * Remote not Remove * Remote not Remove --- docs/feature_advanced_keycodes.md | 20 ++++++++++++++------ docs/keycodes_us_ansi_shifted.md | 4 ++++ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 15109e5459..85f4fa1bfc 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -2,7 +2,7 @@ Your keymap can include keycodes that are more advanced than normal, for example keys that switch layers or send modifiers when held, but send regular keycodes when tapped. This page documents the functions that are available to you. -### Assigning Custom Names +## Assigning Custom Names People often define custom names using `#define`. For example: @@ -13,7 +13,7 @@ People often define custom names using `#define`. For example: This will allow you to use `FN_CAPS` and `ALT_TAB` in your `KEYMAP()`, keeping it more readable. -### Caveats +## Caveats Currently, `LT()` and `MT()` are limited to the [Basic Keycode set](keycodes_basic.md), meaning you can't use keycodes like `LCTL()`, `KC_TILD`, or anything greater than `0xFF`. Modifiers specified as part of a Layer Tap or Mod Tap's keycode will be ignored. @@ -36,7 +36,7 @@ These functions allow you to activate layers in various ways. Note that layers a Care must be taken when switching layers, it's possible to lock yourself into a layer with no way to deactivate that layer (without unplugging your keyboard.) We've created some guidelines to help users avoid the most common problems. -### Beginners +## Beginners If you are just getting started with QMK you will want to keep everything simple. Follow these guidelines when setting up your layers: @@ -44,11 +44,11 @@ If you are just getting started with QMK you will want to keep everything simple * Arrange your layers in a "tree" layout, with layer 0 as the root. Do not try to enter the same layer from more than one other layer. * In a layer's keymap, only reference higher-numbered layers. Because layers are processed from the highest-numbered (topmost) active layer down, modifying the state of lower layers can be tricky and error-prone. -### Intermediate Users +## Intermediate Users Sometimes you need more than one base layer. For example, if you want to switch between QWERTY and Dvorak, switch between layouts for different countries, or switch your layout for different videogames. Your base layers should always be the lowest numbered layers. When you have multiple base layers you should always treat them as mutually exclusive. When one base layer is on the others are off. -### Advanced Users +## Advanced Users Once you have a good feel for how layers work and what you can do, you can get more creative. The rules listed in the beginner section will help you be successful by avoiding some of the tricker details but they can be constraining, especially for ultra-compact keyboard users. Understanding how layers work will allow you to use them in more advanced ways. @@ -126,6 +126,14 @@ For convenience, QMK includes some Mod-Tap shortcuts to make common combinations |`SGUI_T(kc)`|`SCMD_T(kc)`, `SWIN_T(kc)` |Left Shift and GUI when held, `kc` when tapped | |`LCA_T(kc)` | |Left Control and Alt when held, `kc` when tapped | +## Caveats + +Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored. + +Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes. + +To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly. + # One Shot Keys One shot keys are keys that remain active until the next key is pressed, and then are released. This allows you to type keyboard combinations without pressing more than one key at a time. These keys are usually called "Sticky keys" or "Dead keys". @@ -146,7 +154,7 @@ You can control the behavior of one shot keys by defining these in `config.h`: Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429). -If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by clicking on "Show Options", going to the "Local Resources" tab, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. # Permissive Hold diff --git a/docs/keycodes_us_ansi_shifted.md b/docs/keycodes_us_ansi_shifted.md index e7abaa7099..41d6035929 100644 --- a/docs/keycodes_us_ansi_shifted.md +++ b/docs/keycodes_us_ansi_shifted.md @@ -6,6 +6,10 @@ These keycodes correspond to characters that are "shifted" on a standard US ANSI Unfortunately, these keycodes cannot be used in Mod-Taps or Layer-Taps, since any modifiers specified in the keycode are ignored. +Additionally, you may run into issues when using Remote Desktop Connection on Windows. Because these codes send shift very fast, Remote Desktop may miss the codes. + +To fix this, open Remote Desktop Connection, click on "Show Options", open the the "Local Resources" tab. In the keyboard section, change the drop down to "On this Computer". This will fix the issue, and allow the characters to work correctly. + ## Keycodes |Key |Aliases |Description | -- cgit v1.2.3 From a2b650df474420b2003978fbf391393b2cccbd33 Mon Sep 17 00:00:00 2001 From: Michael MacDougall Date: Mon, 22 Oct 2018 14:59:40 -0400 Subject: Keymap: Add mmacdougall keymap (#3852) * Add mmacdougall keymap * Make requested changes --- keyboards/levinson/keymaps/mmacdougall/README.md | 21 +++ .../levinson/keymaps/mmacdougall/keymap/config.h | 20 ++ .../levinson/keymaps/mmacdougall/keymap/keymap.c | 201 +++++++++++++++++++++ .../levinson/keymaps/mmacdougall/keymap/rules.mk | 2 + 4 files changed, 244 insertions(+) create mode 100644 keyboards/levinson/keymaps/mmacdougall/README.md create mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/config.h create mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c create mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk diff --git a/keyboards/levinson/keymaps/mmacdougall/README.md b/keyboards/levinson/keymaps/mmacdougall/README.md new file mode 100644 index 0000000000..bae8c8a4b8 --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/README.md @@ -0,0 +1,21 @@ +mmacdougall's Levinson Layout +============================ + +Similar to default layout, however RGB & backlight controls are mapped to adjust layer + +## Layouts + +### Adjust (Lower + Raise) + +``` +/* Adjust (Lower + Raise) + ,-----------------------------------------------------------------------------------. + | | Reset| | | | | | | | | | Del | + |------+------+------+------+------+-------------+------+------+------+------+------| + | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + |------+------+------+------+------+------|------+------+------+------+------+------| + |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | + |------+------+------+------+------+------+------+------+------+------+------+------| + | | | | | | | | | | | | + `-----------------------------------------------------------------------------------' +``` diff --git a/keyboards/levinson/keymaps/mmacdougall/keymap/config.h b/keyboards/levinson/keymaps/mmacdougall/keymap/config.h new file mode 100644 index 0000000000..63dd5bc88f --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/keymap/config.h @@ -0,0 +1,20 @@ +#pragma once + +/* 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/levinson/keymaps/mmacdougall/keymap/keymap.c b/keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c new file mode 100644 index 0000000000..dec47a7616 --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c @@ -0,0 +1,201 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + BL_STEP, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk b/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes -- cgit v1.2.3 From 47dcda1087a2aa3bbb46d69c5cf682bf45650a8b Mon Sep 17 00:00:00 2001 From: Levi Olson Date: Mon, 22 Oct 2018 14:04:28 -0500 Subject: Diverge3 - Workman Layout (#3682) * Diverge3: Workman Programmers Layout * Diverge3: Comment Removal * Diverge3: Image Links Fixed * Diverge3: Images added * Diverge3: Images cleaned up * Diverge3: Images cleaned up * Diverge3: Removing Images * Diverge3: Improving readme.md * Diverge3: Improving readme.md * Diverge3: Add supporting Comments * Diverge3: Update readme * Diverge3: Update readme * Diverge3: Updates per comments in PR * Diverge3: Updates per comments in PR * Diverge3: Updates per comments in PR * Diverge3: Updates per comments in PR * Diverge3: Updates per comments in PR * Diverge3: Updates per comments in PR --- keyboards/diverge3/.gitignore | 1 + keyboards/diverge3/config.h | 9 +- keyboards/diverge3/keymaps/workman/config.h | 5 + keyboards/diverge3/keymaps/workman/keymap.c | 212 +++++++++++++++++++++++++++ keyboards/diverge3/keymaps/workman/readme.md | 21 +++ keyboards/diverge3/keymaps/workman/rules.mk | 1 + keyboards/diverge3/readme.md | 6 +- 7 files changed, 250 insertions(+), 5 deletions(-) create mode 100644 keyboards/diverge3/.gitignore create mode 100644 keyboards/diverge3/keymaps/workman/config.h create mode 100644 keyboards/diverge3/keymaps/workman/keymap.c create mode 100644 keyboards/diverge3/keymaps/workman/readme.md create mode 100644 keyboards/diverge3/keymaps/workman/rules.mk diff --git a/keyboards/diverge3/.gitignore b/keyboards/diverge3/.gitignore new file mode 100644 index 0000000000..722d5e71d9 --- /dev/null +++ b/keyboards/diverge3/.gitignore @@ -0,0 +1 @@ +.vscode diff --git a/keyboards/diverge3/config.h b/keyboards/diverge3/config.h index db3c6a6f76..f3ed06739a 100644 --- a/keyboards/diverge3/config.h +++ b/keyboards/diverge3/config.h @@ -31,7 +31,9 @@ along with this program. If not, see . /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// SERIAL is the only supported +// Only SERIAL is currently supported +// By converting this to use I2C, backlight +// would/should be fully functional as well #define USE_SERIAL /* @@ -51,7 +53,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION ROW2COL -// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_PIN C6 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -61,8 +63,7 @@ along with this program. If not, see . /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST - -/* number of backlight levels */ + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE diff --git a/keyboards/diverge3/keymaps/workman/config.h b/keyboards/diverge3/keymaps/workman/config.h new file mode 100644 index 0000000000..9829a604f1 --- /dev/null +++ b/keyboards/diverge3/keymaps/workman/config.h @@ -0,0 +1,5 @@ +#pragma once + +// place overrides here +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 \ No newline at end of file diff --git a/keyboards/diverge3/keymaps/workman/keymap.c b/keyboards/diverge3/keymaps/workman/keymap.c new file mode 100644 index 0000000000..5e681f4188 --- /dev/null +++ b/keyboards/diverge3/keymaps/workman/keymap.c @@ -0,0 +1,212 @@ +/* Copyright 2017 IslandMan93 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// KEYMAP +extern keymap_config_t keymap_config; + +#define _WORKMAN_P 0 +#define _GAME 1 +#define _RAISE 2 + +#define _______ KC_TRNS + +#define SHIFT_MOD MOD_BIT(KC_LSFT) +#define SPACE_RAISE LT(_RAISE, KC_SPC) +#define ENT_RAISE LT(_RAISE, KC_ENT) +#define PAGE_PREV S(LCTL(KC_TAB)) +#define PAGE_NEXT LCTL(KC_TAB) + +enum custom_keycodes +{ + LO_BSPC = SAFE_RANGE, + LO_1, + LO_2, + LO_3, + LO_4, + LO_5, + LO_6, + LO_7, + LO_8, + LO_9, + LO_0, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + if (record->event.pressed) { + switch (keycode) { + case LO_BSPC: + if (record->event.pressed) { + if (get_mods() & SHIFT_MOD) { + uint8_t current_mods = get_mods(); + clear_mods(); + SEND_STRING(SS_TAP(X_DELETE)); + set_mods(current_mods); + } else { + SEND_STRING(SS_TAP(X_BSPACE)); + } + } + return false; + case LO_1: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("1"); + set_mods(current_mods); + } else { + SEND_STRING("!"); + } + } + return false; + case LO_2: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("2"); + set_mods(current_mods); + } else { + SEND_STRING("@"); + } + } + return false; + case LO_3: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("3"); + set_mods(current_mods); + } else { + SEND_STRING("#"); + } + } + return false; + case LO_4: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("4"); + set_mods(current_mods); + } else { + SEND_STRING("$"); + } + } + return false; + case LO_5: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("5"); + set_mods(current_mods); + } else { + SEND_STRING("%"); + } + } + return false; + case LO_6: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("6"); + set_mods(current_mods); + } else { + SEND_STRING("^"); + } + } + return false; + case LO_7: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("7"); + set_mods(current_mods); + } else { + SEND_STRING("&"); + } + } + return false; + case LO_8: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("8"); + set_mods(current_mods); + } else { + SEND_STRING("*"); + } + } + return false; + case LO_9: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("9"); + set_mods(current_mods); + } else { + SEND_STRING("("); + } + } + return false; + case LO_0: + if (record->event.pressed) { + uint8_t current_mods = get_mods(); + if (current_mods & SHIFT_MOD) { + clear_mods(); + SEND_STRING("0"); + set_mods(current_mods); + } else { + SEND_STRING(")"); + } + } + return false; + } + } + return true; +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_WORKMAN_P] = LAYOUT( + KC_ESC, LO_1, LO_2, LO_3, LO_4, LO_5, LO_6, LO_6, LO_7, LO_8, LO_9, LO_0, KC_MINS, KC_ESC, + KC_GRV, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_LPRN, KC_RPRN, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_EQL, + KC_TAB, KC_A, KC_S, KC_H, KC_T, KC_G, KC_LCBR, KC_RCBR, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_BSLS, + KC_LCTL, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_LBRC, KC_RBRC, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LSFT, RESET, PAGE_PREV, PAGE_NEXT, KC_END, KC_LGUI, KC_LALT, TG(_GAME), LO_BSPC, ENT_RAISE, SPACE_RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL), + + [_GAME] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_ESC, + KC_GRV, KC_Q, KC_D, KC_R, KC_W, KC_B, KC_LPRN, KC_RPRN, KC_J, KC_F, KC_U, KC_P, KC_SCLN, KC_EQL, + KC_TAB, KC_A, KC_S, KC_H, KC_T, KC_G, KC_LCBR, KC_RCBR, KC_Y, KC_N, KC_E, KC_O, KC_I, KC_BSLS, + KC_LCTL, KC_Z, KC_X, KC_M, KC_C, KC_V, KC_LBRC, KC_RBRC, KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, + KC_LSFT, KC_F1, KC_F2, KC_3, KC_F5, KC_SPC, KC_LALT, TG(_GAME), LO_BSPC, ENT_RAISE, SPACE_RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RCTL), + + [_RAISE] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, RESET, + _______, _______, _______, _______, _______, _______, BL_INC, KC_VOLU, _______, _______, _______, _______, _______, KC_F12, + _______, _______, _______, _______, _______, _______, BL_DEC, KC_VOLD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, BL_BRTG, KC_MUTE, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, _______, + _______, _______, _______, _______, _______, _______, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; \ No newline at end of file diff --git a/keyboards/diverge3/keymaps/workman/readme.md b/keyboards/diverge3/keymaps/workman/readme.md new file mode 100644 index 0000000000..48ba482fe6 --- /dev/null +++ b/keyboards/diverge3/keymaps/workman/readme.md @@ -0,0 +1,21 @@ +# The Workman keymap for diverge3 + +Basic example of the [Workman Programming Layout](https://github.com/ojbucao/workman) which uses the `SHIFT`ed variants of the number row, by default. + +## Layer 1 - Default Layer + +Workman programming layout. + +![Workman Layout Picture](https://i.imgur.com/IOOmRfI.png) + +## Layer 2 - Gaming Layer + +Reverts the number row to the normal 1, 2, 3, etc... for better gaming compatibility. + +![Gaming Layer Picture](https://i.imgur.com/E0vmEAa.png) + +## Layer 3 - Raise Layer + +Volume and backlight controls (although backlight is not fully functional using `USE_SERIAL` in `../config.h`). + +![Raise Layer Misc Buttons Picture](https://i.imgur.com/50L3O62.png) diff --git a/keyboards/diverge3/keymaps/workman/rules.mk b/keyboards/diverge3/keymaps/workman/rules.mk new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/keyboards/diverge3/keymaps/workman/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/diverge3/readme.md b/keyboards/diverge3/readme.md index 2ecfbca3bb..43add9d990 100644 --- a/keyboards/diverge3/readme.md +++ b/keyboards/diverge3/readme.md @@ -10,7 +10,11 @@ Make example for this keyboard (after setting up your build environment): make diverge3:default +Or for the [Workman](https://github.com/ojbucao/workman) layout: + + make diverge3:workman + See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. # Reflashing Animus -Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST) during the upload step. Then reapply your keymap through Arbites. \ No newline at end of file +Reflashing the stock firmware is pretty easy. Just follow the same steps in the [original guide](https://imgur.com/a/8UapN). You will have to manually reset the Pro Micro (by shorting the GND and RST pins) during the upload step. Then reapply your keymap through Arbites. \ No newline at end of file -- cgit v1.2.3 From bf57587e6203e3bcabbc161c1d45b9a6cc7abfaa Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 22 Oct 2018 12:35:09 -0700 Subject: Keyboard: Zlant refactor and Configurator support (#3678) * Matrix/keymap refactor White space and readability updates * Configurator support Added info.json file. * Readme update Markdown formatting * Add support for ortho_4x12 keymaps * Added planck_mit layout support * Disable SWAP_HANDS_ENABLE for zlant:wanleg keymap * Disable BACKLIGHT_ENABLE for zlant:bakingpy keymap --- keyboards/zlant/info.json | 17 ++++++++++ keyboards/zlant/keymaps/default/keymap.c | 22 +++++++------ keyboards/zlant/readme.md | 6 ++-- keyboards/zlant/rules.mk | 2 ++ keyboards/zlant/zlant.h | 44 ++++++++++++++++++++------ layouts/community/ortho_4x12/bakingpy/rules.mk | 6 +++- layouts/community/ortho_4x12/wanleg/rules.mk | 4 +++ 7 files changed, 77 insertions(+), 24 deletions(-) create mode 100644 keyboards/zlant/info.json diff --git a/keyboards/zlant/info.json b/keyboards/zlant/info.json new file mode 100644 index 0000000000..b1f20555c0 --- /dev/null +++ b/keyboards/zlant/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "Zlant", + "url": "", + "maintainer": "qmk", + "width": 12.75, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K100", "x":0.25, "y":1}, {"label":"K101", "x":1.25, "y":1}, {"label":"K102", "x":2.25, "y":1}, {"label":"K103", "x":3.25, "y":1}, {"label":"K104", "x":4.25, "y":1}, {"label":"K105", "x":5.25, "y":1}, {"label":"K106", "x":6.25, "y":1}, {"label":"K107", "x":7.25, "y":1}, {"label":"K108", "x":8.25, "y":1}, {"label":"K109", "x":9.25, "y":1}, {"label":"K110", "x":10.25, "y":1}, {"label":"K111", "x":11.25, "y":1}, {"label":"K200", "x":0.5, "y":2}, {"label":"K201", "x":1.5, "y":2}, {"label":"K202", "x":2.5, "y":2}, {"label":"K203", "x":3.5, "y":2}, {"label":"K204", "x":4.5, "y":2}, {"label":"K205", "x":5.5, "y":2}, {"label":"K206", "x":6.5, "y":2}, {"label":"K207", "x":7.5, "y":2}, {"label":"K208", "x":8.5, "y":2}, {"label":"K209", "x":9.5, "y":2}, {"label":"K210", "x":10.5, "y":2}, {"label":"K211", "x":11.5, "y":2}, {"label":"K300", "x":0.75, "y":3}, {"label":"K301", "x":1.75, "y":3}, {"label":"K302", "x":2.75, "y":3}, {"label":"K303", "x":3.75, "y":3}, {"label":"K304", "x":4.75, "y":3}, {"label":"K305", "x":5.75, "y":3}, {"label":"K306", "x":6.75, "y":3}, {"label":"K307", "x":7.75, "y":3}, {"label":"K308", "x":8.75, "y":3}, {"label":"K309", "x":9.75, "y":3}, {"label":"K310", "x":10.75, "y":3}, {"label":"K311", "x":11.75, "y":3}] + }, + "LAYOUT_planck_mit": { + "key_count": 47, + "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K100", "x":0.25, "y":1}, {"label":"K101", "x":1.25, "y":1}, {"label":"K102", "x":2.25, "y":1}, {"label":"K103", "x":3.25, "y":1}, {"label":"K104", "x":4.25, "y":1}, {"label":"K105", "x":5.25, "y":1}, {"label":"K106", "x":6.25, "y":1}, {"label":"K107", "x":7.25, "y":1}, {"label":"K108", "x":8.25, "y":1}, {"label":"K109", "x":9.25, "y":1}, {"label":"K110", "x":10.25, "y":1}, {"label":"K111", "x":11.25, "y":1}, {"label":"K200", "x":0.5, "y":2}, {"label":"K201", "x":1.5, "y":2}, {"label":"K202", "x":2.5, "y":2}, {"label":"K203", "x":3.5, "y":2}, {"label":"K204", "x":4.5, "y":2}, {"label":"K205", "x":5.5, "y":2}, {"label":"K206", "x":6.5, "y":2}, {"label":"K207", "x":7.5, "y":2}, {"label":"K208", "x":8.5, "y":2}, {"label":"K209", "x":9.5, "y":2}, {"label":"K210", "x":10.5, "y":2}, {"label":"K211", "x":11.5, "y":2}, {"label":"K300", "x":0.75, "y":3}, {"label":"K301", "x":1.75, "y":3}, {"label":"K302", "x":2.75, "y":3}, {"label":"K303", "x":3.75, "y":3}, {"label":"K304", "x":4.75, "y":3, "w":1.25}, {"label":"K305", "x":6, "y":3, "w":1.5}, {"label":"K307", "x":7.5, "y":3, "w":1.25}, {"label":"K308", "x":8.75, "y":3}, {"label":"K309", "x":9.75, "y":3}, {"label":"K310", "x":10.75, "y":3}, {"label":"K311", "x":11.75, "y":3}] + } + } +} diff --git a/keyboards/zlant/keymaps/default/keymap.c b/keyboards/zlant/keymaps/default/keymap.c index d586c841d8..a701a7965a 100755 --- a/keyboards/zlant/keymaps/default/keymap.c +++ b/keyboards/zlant/keymaps/default/keymap.c @@ -5,16 +5,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [BASE] = LAYOUT( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_ESC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, - RGB_HUI, RGB_HUD, KC_LGUI, KC_LALT, KC_LSFT, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT), + [BASE] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_ESC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + RGB_HUI, RGB_HUD, KC_LGUI, KC_LALT, KC_LSFT, KC_SPC, KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), - [FN] = LAYOUT( - KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_PGUP, KC_HOME, KC_TRNS, KC_TRNS, - RGB_VAI, RGB_VAD, RESET, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGDN, KC_END, KC_TRNS, KC_DEL) + [FN] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_PGUP, KC_HOME, _______, _______, \ + RGB_VAI, RGB_VAD, RESET, KC_PSCR, _______, _______, _______, _______, KC_PGDN, KC_END, _______, KC_DEL \ + ) }; diff --git a/keyboards/zlant/readme.md b/keyboards/zlant/readme.md index 0780cedeb1..8f50e6d4c7 100644 --- a/keyboards/zlant/readme.md +++ b/keyboards/zlant/readme.md @@ -4,10 +4,8 @@ A compact 40% inspired by the Plank with a staggered layout instead. -Keyboard Maintainer: [Felipe Coury](https://github.com/fcoury) - -Hardware Supported: Zlant Prototype PCB - +Keyboard Maintainer: [Felipe Coury](https://github.com/fcoury) +Hardware Supported: Zlant Prototype PCB Hardware Availability: Group buy soon Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/zlant/rules.mk b/keyboards/zlant/rules.mk index 482f99b223..0bc5c8aaed 100755 --- a/keyboards/zlant/rules.mk +++ b/keyboards/zlant/rules.mk @@ -54,3 +54,5 @@ NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https:/ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_4x12 planck_mit diff --git a/keyboards/zlant/zlant.h b/keyboards/zlant/zlant.h index 48c7b3f409..6310a14e35 100755 --- a/keyboards/zlant/zlant.h +++ b/keyboards/zlant/zlant.h @@ -3,16 +3,42 @@ #include "quantum.h" -#define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ - K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ - K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ +#define LAYOUT_ortho_4x12( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 } \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 } \ } +#define LAYOUT_planck_mit( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K307, K308, K309, K310, K311 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211 }, \ + { K300, K301, K302, K303, K304, K305, K305, K307, K308, K309, K310, K311 } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311 \ +) LAYOUT( \ + KC_##K000, KC_##K001, KC_##K002, KC_##K003, KC_##K004, KC_##K005, KC_##K006, KC_##K007, KC_##K008, KC_##K009, KC_##K010, KC_##K011, \ + KC_##K100, KC_##K101, KC_##K102, KC_##K103, KC_##K104, KC_##K105, KC_##K106, KC_##K107, KC_##K108, KC_##K109, KC_##K110, KC_##K111, \ + KC_##K200, KC_##K201, KC_##K202, KC_##K203, KC_##K204, KC_##K205, KC_##K206, KC_##K207, KC_##K208, KC_##K209, KC_##K210, KC_##K211, \ + KC_##K300, KC_##K301, KC_##K302, KC_##K303, KC_##K304, KC_##K305, KC_##K306, KC_##K307, KC_##K308, KC_##K309, KC_##K310, KC_##K311 \ +) + +#define LAYOUT LAYOUT_ortho_4x12 + #endif diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk index 0d568c401a..490ebbf779 100644 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ b/layouts/community/ortho_4x12/bakingpy/rules.mk @@ -3,4 +3,8 @@ ifeq ($(LAYOUTS_HAS_RGB),yes) RGBLIGHT_ENABLE = yes endif AUDIO_ENABLE = no -BACKLIGHT_ENABLE = yes +ifeq ($(strip $(KEYBOARD)), zlant) + BACKLIGHT_ENABLE = no +else + BACKLIGHT_ENABLE = yes +endif diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index 69f377a015..fa433a6b0d 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -7,4 +7,8 @@ endif ifeq ($(strip $(KEYBOARD)), 4x4) SWAP_HANDS_ENABLE = no +endif + +ifeq ($(strip $(KEYBOARD)), zlant) + SWAP_HANDS_ENABLE = no endif \ No newline at end of file -- cgit v1.2.3 From 6d7745a110daad815fe5edbb35a2e33702f24aaa Mon Sep 17 00:00:00 2001 From: markspanbroek Date: Mon, 22 Oct 2018 21:37:03 +0200 Subject: Keyboard: Port of TMK XT USB Converter (#3619) * Converter: add XT USB converter from TMK * Converter: port TMK code for USB converter to QMK * Apply requested changes after code review by @drashna - use "pragma once" instead of include guards - use LAYOUT instead of KEYMAP - allow customisation with matrix_init_user() and matrix_scan_user() - set BOOTLOADER instead of BOOTLOADER_SIZE - Add XT_ENABLE to OPT_DEFS * Remove unnecessary lines --- keyboards/converter/xt_usb/README.md | 17 ++ keyboards/converter/xt_usb/config.h | 78 ++++++ .../converter/xt_usb/keymaps/default/config.h | 1 + .../converter/xt_usb/keymaps/default/keymap.c | 55 ++++ keyboards/converter/xt_usb/led.c | 22 ++ keyboards/converter/xt_usb/matrix.c | 309 +++++++++++++++++++++ keyboards/converter/xt_usb/rules.mk | 62 +++++ keyboards/converter/xt_usb/xt_usb.c | 1 + keyboards/converter/xt_usb/xt_usb.h | 132 +++++++++ tmk_core/protocol.mk | 5 + tmk_core/protocol/xt.h | 71 +++++ tmk_core/protocol/xt_interrupt.c | 173 ++++++++++++ 12 files changed, 926 insertions(+) create mode 100644 keyboards/converter/xt_usb/README.md create mode 100644 keyboards/converter/xt_usb/config.h create mode 100644 keyboards/converter/xt_usb/keymaps/default/config.h create mode 100644 keyboards/converter/xt_usb/keymaps/default/keymap.c create mode 100644 keyboards/converter/xt_usb/led.c create mode 100644 keyboards/converter/xt_usb/matrix.c create mode 100644 keyboards/converter/xt_usb/rules.mk create mode 100644 keyboards/converter/xt_usb/xt_usb.c create mode 100644 keyboards/converter/xt_usb/xt_usb.h create mode 100644 tmk_core/protocol/xt.h create mode 100644 tmk_core/protocol/xt_interrupt.c diff --git a/keyboards/converter/xt_usb/README.md b/keyboards/converter/xt_usb/README.md new file mode 100644 index 0000000000..40b265a189 --- /dev/null +++ b/keyboards/converter/xt_usb/README.md @@ -0,0 +1,17 @@ +XT to USB keyboard converter +============================== +This is a port of TMK's converter/xt_usb to QMK. + +This firmware converts XT keyboard protocol to USB.(It supports Scan Code Set 1.) + + +Connect Wires +------------- +1. Connect **Vcc** and **GND**. +2. Connect **Clock** and **Data** line. **Clock** is on `PD1`, **Data** on `PD0` by default. And optionally you can use `PB7` for **Reset**.(Compatible to Soarer's converter) To change pin configuration edit `config.h`. +3. You need pull-up resistor. **1K-10K Ohm** will be OK. + + +XT keyboard protocol resource +------------------------------ +https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol diff --git a/keyboards/converter/xt_usb/config.h b/keyboards/converter/xt_usb/config.h new file mode 100644 index 0000000000..963a3c6396 --- /dev/null +++ b/keyboards/converter/xt_usb/config.h @@ -0,0 +1,78 @@ +/* +Copyright 2012 Jun Wako + +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 + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6512 +#define DEVICE_VER 0x0001 +#define MANUFACTURER QMK +#define PRODUCT XT keyboard converter +#define DESCRIPTION convert XT keyboard to USB + + +/* matrix size */ +#define MATRIX_ROWS 16 // keycode bit: 3-0 +#define MATRIX_COLS 8 // keycode bit: 6-4 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) || \ + keyboard_report->mods == (MOD_BIT(KC_LCTRL) | MOD_BIT(KC_RSHIFT)) \ +) + + +//#define NO_SUSPEND_POWER_DOWN + +/* + * XT Pin interrupt + */ +#define XT_CLOCK_PORT PORTD +#define XT_CLOCK_PIN PIND +#define XT_CLOCK_DDR DDRD +#define XT_CLOCK_BIT 1 +#define XT_DATA_PORT PORTD +#define XT_DATA_PIN PIND +#define XT_DATA_DDR DDRD +#define XT_DATA_BIT 0 +#define XT_RST_PORT PORTB +#define XT_RST_PIN PINB +#define XT_RST_DDR DDRB +#define XT_RST_BIT 7 + +/* hard reset: low pulse for 500ms and after that HiZ for safety */ +#define XT_RESET() do { \ + XT_RST_PORT &= ~(1< + +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 . +*/ + +#include "led.h" + +void led_set(uint8_t usb_led) { + //XT Keyboards do not have LEDs, nothing to do. +} diff --git a/keyboards/converter/xt_usb/matrix.c b/keyboards/converter/xt_usb/matrix.c new file mode 100644 index 0000000000..e2d7117b13 --- /dev/null +++ b/keyboards/converter/xt_usb/matrix.c @@ -0,0 +1,309 @@ +/* +Copyright 2011 Jun Wako +Copyright 2016 Ethan Apodaca + +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 . +*/ + +#include +#include +#include "action.h" +#include "print.h" +#include "util.h" +#include "debug.h" +#include "xt.h" +#include "matrix.h" + + +static void matrix_make(uint8_t code); +static void matrix_break(uint8_t code); + +static uint8_t matrix[MATRIX_ROWS]; +#define ROW(code) (code>>3) +#define COL(code) (code&0x07) + +__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) { +} + +void matrix_init(void) +{ + debug_enable = true; + xt_host_init(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + + matrix_init_quantum(); +} + +// convert E0-escaped codes into unused area +static uint8_t move_e0code(uint8_t code) { + switch(code) { + // Original IBM XT keyboard has these keys + case 0x37: return 0x54; // Print Screen + case 0x46: return 0x55; // Ctrl + Pause + case 0x1C: return 0x6F; // Keypad Enter + case 0x35: return 0x7F; // Keypad / + + // Any XT keyobard with these keys? + // http://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/translate.pdf + // https://download.microsoft.com/download/1/6/1/161ba512-40e2-4cc9-843a-923143f3456c/scancode.doc + case 0x5B: return 0x5A; // Left GUI + case 0x5C: return 0x5B; // Right GUI + case 0x5D: return 0x5C; // Application + case 0x5E: return 0x5D; // Power(not used) + case 0x5F: return 0x5E; // Sleep(not used) + case 0x63: return 0x5F; // Wake (not used) + case 0x48: return 0x60; // Up + case 0x4B: return 0x61; // Left + case 0x50: return 0x62; // Down + case 0x4D: return 0x63; // Right + case 0x52: return 0x71; // Insert + case 0x53: return 0x72; // Delete + case 0x47: return 0x74; // Home + case 0x4F: return 0x75; // End + case 0x49: return 0x77; // Home + case 0x51: return 0x78; // End + case 0x1D: return 0x7A; // Right Ctrl + case 0x38: return 0x7C; // Right Alt + } + return 0x00; +} + +uint8_t matrix_scan(void) +{ + static enum { + INIT, + E0, + // Pause: E1 1D 45, E1 9D C5 + E1, + E1_1D, + E1_9D, + } state = INIT; + + uint8_t code = xt_host_recv(); + if (!code) return 0; + xprintf("%02X ", code); + switch (state) { + case INIT: + switch (code) { + case 0xE0: + state = E0; + break; + case 0xE1: + state = E1; + break; + default: + if (code < 0x80) + matrix_make(code); + else + matrix_break(code & 0x7F); + break; + } + break; + case E0: + switch (code) { + case 0x2A: + case 0xAA: + case 0x36: + case 0xB6: + //ignore fake shift + state = INIT; + break; + default: + if (code < 0x80) + matrix_make(move_e0code(code)); + else + matrix_break(move_e0code(code & 0x7F)); + state = INIT; + break; + } + break; + case E1: + switch (code) { + case 0x1D: + state = E1_1D; + break; + case 0x9D: + state = E1_9D; + break; + default: + state = INIT; + break; + } + break; + case E1_1D: + switch (code) { + case 0x45: + matrix_make(0x55); + break; + default: + state = INIT; + break; + } + break; + case E1_9D: + switch (code) { + case 0x45: + matrix_break(0x55); + break; + default: + state = INIT; + break; + } + break; + default: + state = INIT; + } + matrix_scan_quantum(); + return 1; +} + +inline +uint8_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +inline +static void matrix_make(uint8_t code) +{ + if (!matrix_is_on(ROW(code), COL(code))) { + matrix[ROW(code)] |= 1< + +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 + +#include "quantum.h" + +/* IBM XT keyboard layout + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift|PrS| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' + * Scan code set 1 + * ,-------. ,--------------------------------------------------------------------------. + * | 3B| 3C| | 01| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 0E | 45 | 46 | + * |-------| |--------------------------------------------------------------------------| + * | 3D| 3E| | 0F | 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B | | 47| 48| 49| 4A| + * |-------| |------------------------------------------------------| 1C|---------------| + * | 3F| 40| | 1D | 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 29| | 4B| 4C| 4D| | + * |-------| |----------------------------------------------------------------------| | + * | 41| 42| | 2A | 2B| 2C| 2D| 2E| 2F| 30| 31| 32| 33| 34| 35| 36 |*37| 4F| 50| 51| 4E| + * |-------| |----------------------------------------------------------------------| | + * | 43| 44| | 38 | 39 | 3A | 52 | 53 | | + * `-------' `--------------------------------------------------------------------------' + */ +#define LAYOUT_xt( \ + K3B,K3C, K01,K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D,K0E, K45, K46, \ + K3D,K3E, K0F,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K1A,K1B, K47,K48,K49,K4A, \ + K3F,K40, K1D,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28,K29,K1C,K4B,K4C,K4D, \ + K41,K42, K2A,K2B,K2C,K2D,K2E,K2F,K30,K31,K32,K33,K34,K35,K36,K54,K4F,K50,K51,K4E, \ + K43,K44, K38, K39, K3A, K52, K53 \ +) { \ + { KC_NO, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, KC_NO }, \ + { K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, 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, 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 } \ +} + +/* Extended keyboard layout + * ,-----------------------------------------------. + * |F13|F14|F15|F16|F17|F18|F19|F20|F21|F22|F23|F24| + * ,---. |-----------------------------------------------| ,-----------. ,-----------. + * |Esc| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| |PrS|ScL|Pau| |VDn|VUp|Mut| + * `---' `-----------------------------------------------' `-----------' `-----------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|JPY|Bsp| |Ins|Hom|PgU| |NmL| /| *| -| + * |-----------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | |Del|End|PgD| | 7| 8| 9| +| + * |-----------------------------------------------------------| `-----------' |---------------| + * |CapsL | A| S| D| F| G| H| J| K| L| ;| '| #|Entr| | 4| 5| 6|KP,| + * |-----------------------------------------------------------| ,---. |---------------| + * |Shft| <| Z| X| C| V| B| N| M| ,| .| /| RO|Shift | |Up | | 1| 2| 3|Ent| + * |-----------------------------------------------------------| ,-----------. |---------------| + * |Ctl|Gui|Alt|MHEN| Space |HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|KP=| + * `-----------------------------------------------------------' `-----------' `---------------' + * ,-----------------------------------------------. + * | 64| 65| 66| 67| 68| 69| 6A| 6B| 6C| 6D| 6E| 76| + * ,---. |-----------------------------------------------| ,-----------. ,-----------. + * | 01| | 3B| 3C| 3D| 3E| 3F| 40| 41| 42| 43| 44| 57| 58| |*37| 46|*45| |e5E|e5F|e63| + * `---' `-----------------------------------------------' `-----------' `-----------' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | 29| 02| 03| 04| 05| 06| 07| 08| 09| 0A| 0B| 0C| 0D| 7D| 0E| |e52|e47|e49| | 45|e35| 37| 4A| + * |-----------------------------------------------------------| |-----------| |---------------| + * | 0F | 10| 11| 12| 13| 14| 15| 16| 17| 18| 19| 1A| 1B| 2B | |e53|e4F|e51| | 47| 48| 49| 4E| + * |-----------------------------------------------------------| `-----------' |---------------| + * | 3A | 1E| 1F| 20| 21| 22| 23| 24| 25| 26| 27| 28| 00| 1C | | 4B| 4C| 4D| 7E| + * |-----------------------------------------------------------| ,---. |---------------| + * | 2A | 56| 2C| 2D| 2E| 2F| 30| 31| 32| 33| 34| 35| 73| 36 | |e48| | 4F| 50| 51|e1C| + * |-----------------------------------------------------------| ,-----------. |---------------| + * | 1D|e5B| 38| 7B | 39 | 79 | 70 |e38|e5C|e5D|e1D| |e4B|e50|e4D| | 52| 53| 59| + * `-----------------------------------------------------------' `-----------' `---------------' + * e: E0-escaped codes + * *: special handling codes + */ +#define LAYOUT( \ + K64,K65,K66,K67,K68,K69,K6A,K6B,K6C,K6D,K6E,K76, \ + K01, K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K57,K58, K54,K46,K55, K5D,K5E,K5F, \ + K29,K02,K03,K04,K05,K06,K07,K08,K09,K0A,K0B,K0C,K0D,K7D,K0E, K71,K74,K77, K45,K7F,K37,K4A, \ + K0F,K10,K11,K12,K13,K14,K15,K16,K17,K18,K19,K1A,K1B, K2B, K72,K75,K78, K47,K48,K49,K4E, \ + K3A,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K28, K00,K1C, K4B,K4C,K4D,K7E, \ + K2A,K56,K2C,K2D,K2E,K2F,K30,K31,K32,K33,K34,K35, K73,K36, K60, K4F,K50,K51,K6F, \ + K1D,K5A,K38,K7B, K39, K79,K70,K7C,K5B,K5C,K7A, K61,K62,K63, K52,K53,K59 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K48, K49, K4A, K4B, K4C, K4D, K4E, K4F }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K58, K59, K5A, K5B, K5C, K5D, K5E, K5F }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ + { K70, K71, K72, K73, K74, K75, K76, K77 }, \ + { K78, K79, K7A, K7B, K7C, K7D, K7E, K7F } \ +} diff --git a/tmk_core/protocol.mk b/tmk_core/protocol.mk index 54913329e6..78b9deb297 100644 --- a/tmk_core/protocol.mk +++ b/tmk_core/protocol.mk @@ -50,5 +50,10 @@ ifdef ADB_MOUSE_ENABLE OPT_DEFS += -DADB_MOUSE_ENABLE -DMOUSE_ENABLE endif +ifdef XT_ENABLE + SRC += $(PROTOCOL_DIR)/xt_interrupt.c + OPT_DEFS += -DXT_ENABLE +endif + # Search Path VPATH += $(TMK_DIR)/protocol diff --git a/tmk_core/protocol/xt.h b/tmk_core/protocol/xt.h new file mode 100644 index 0000000000..93bc5daf82 --- /dev/null +++ b/tmk_core/protocol/xt.h @@ -0,0 +1,71 @@ +/* +Copyright 2018 Jun WAKO +Copyright 2016 Ethan Apodaca + +This software is licensed with a Modified BSD License. +All of this is supposed to be Free Software, Open Source, DFSG-free, +GPL-compatible, and OK to use in both free and proprietary applications. +Additions and corrections to this file are welcome. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +* Neither the name of the copyright holders nor the names of + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#ifndef XT_H +#define XT_H + +#define XT_DATA_IN() do { \ + XT_DATA_DDR &= ~(1< +Copyright 2016 Ethan Apodaca + +This software is licensed with a Modified BSD License. +All of this is supposed to be Free Software, Open Source, DFSG-free, +GPL-compatible, and OK to use in both free and proprietary applications. +Additions and corrections to this file are welcome. + + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +* Neither the name of the copyright holders nor the names of + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include "xt.h" +#include "wait.h" +#include "print.h" + +static inline uint8_t pbuf_dequeue(void); +static inline void pbuf_enqueue(uint8_t data); +static inline bool pbuf_has_data(void); +static inline void pbuf_clear(void); + +void xt_host_init(void) +{ + XT_INT_INIT(); + XT_INT_OFF(); + + /* hard reset */ +#ifdef XT_RESET + XT_RESET(); +#endif + + /* soft reset: pull clock line down for 20ms */ + XT_DATA_LO(); + XT_CLOCK_LO(); + _delay_ms(20); + + /* input mode with pullup */ + XT_CLOCK_IN(); + XT_DATA_IN(); + + XT_INT_ON(); +} + +/* get data received by interrupt */ +uint8_t xt_host_recv(void) +{ + if (pbuf_has_data()) { + return pbuf_dequeue(); + } else { + return 0; + } +} + +ISR(XT_INT_VECT) +{ + /* + * XT signal format consits of 10 or 9 clocks and sends start bits and 8-bit data, + * which should be read on falling edge of clock. + * + * start(0), start(1), bit0, bit1, bit2, bit3, bit4, bit5, bit6, bit7 + * + * Original IBM XT keyboard sends start(0) bit while some of clones don't. + * Start(0) bit is read as low on data line while start(1) as high. + * + * https://github.com/tmk/tmk_keyboard/wiki/IBM-PC-XT-Keyboard-Protocol + */ + static enum { + START, BIT0, BIT1, BIT2, BIT3, BIT4, BIT5, BIT6, BIT7 + } state = START; + static uint8_t data = 0; + + uint8_t dbit = XT_DATA_READ(); + + // This is needed if using PCINT which can be called on both falling and rising edge + //if (XT_CLOCK_READ()) return; + + switch (state) { + case START: + // ignore start(0) bit + if (!dbit) return; + break; + case BIT0 ... BIT7: + data >>= 1; + if (dbit) + data |= 0x80; + break; + } + if (state++ == BIT7) { + pbuf_enqueue(data); + state = START; + data = 0; + } + return; +} + +/*-------------------------------------------------------------------- + * Ring buffer to store scan codes from keyboard + *------------------------------------------------------------------*/ +#define PBUF_SIZE 32 +static uint8_t pbuf[PBUF_SIZE]; +static uint8_t pbuf_head = 0; +static uint8_t pbuf_tail = 0; +static inline void pbuf_enqueue(uint8_t data) +{ + uint8_t sreg = SREG; + cli(); + uint8_t next = (pbuf_head + 1) % PBUF_SIZE; + if (next != pbuf_tail) { + pbuf[pbuf_head] = data; + pbuf_head = next; + } else { + print("pbuf: full\n"); + } + SREG = sreg; +} +static inline uint8_t pbuf_dequeue(void) +{ + uint8_t val = 0; + + uint8_t sreg = SREG; + cli(); + if (pbuf_head != pbuf_tail) { + val = pbuf[pbuf_tail]; + pbuf_tail = (pbuf_tail + 1) % PBUF_SIZE; + } + SREG = sreg; + + return val; +} +static inline bool pbuf_has_data(void) +{ + uint8_t sreg = SREG; + cli(); + bool has_data = (pbuf_head != pbuf_tail); + SREG = sreg; + return has_data; +} +static inline void pbuf_clear(void) +{ + uint8_t sreg = SREG; + cli(); + pbuf_head = pbuf_tail = 0; + SREG = sreg; +} -- cgit v1.2.3 From 352bef99a9a1dfe4c80d8b50677c7cbd8c78f87b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 22 Oct 2018 12:58:23 -0700 Subject: Keyboard: JJ40 Refactor and Configurator support (#3197) * Deleted LAYOUTS = planck_grid from rules.mk * Refactor * Configurator support * Fixed offset layout matrix macro * Readded LAYOUT_kc_ortho_4x12 matrix alias * Refactor: rename LAYOUT_offset_right macro as LAYOUT_planck_1x2uR --- keyboards/jj40/info.json | 23 ++++++++++++ keyboards/jj40/jj40.h | 60 +++++++++++++++---------------- keyboards/jj40/keymaps/cockpit/keymap.c | 8 ++--- keyboards/jj40/keymaps/default/keymap.c | 6 ++-- keyboards/jj40/keymaps/krusli/keymap.c | 35 +++++++++++++----- keyboards/jj40/keymaps/oscillope/keymap.c | 13 +++---- keyboards/jj40/rules.mk | 2 +- 7 files changed, 92 insertions(+), 55 deletions(-) create mode 100644 keyboards/jj40/info.json diff --git a/keyboards/jj40/info.json b/keyboards/jj40/info.json new file mode 100644 index 0000000000..c6416ce168 --- /dev/null +++ b/keyboards/jj40/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "jj40", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_planck_mit": { + "key_count": 47, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3, "w":2}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + }, + + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + }, + + "LAYOUT_planck_1x2uR": { + "key_count": 47, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3, "w":2}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + } + } +} diff --git a/keyboards/jj40/jj40.h b/keyboards/jj40/jj40.h index bb7068fdc0..731f2ff455 100644 --- a/keyboards/jj40/jj40.h +++ b/keyboards/jj40/jj40.h @@ -25,7 +25,10 @@ along with this program. If not, see . void matrix_init_user(void); // TODO port this to other PS2AVRGB boards -#define KEYMAP_GRID( \ +#define XXX KC_NO + + +#define LAYOUT_ortho_4x12( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ @@ -34,61 +37,58 @@ void matrix_init_user(void); // TODO port this to other PS2AVRGB boards { \ { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ { K312, K311, K310, K39, K35, K36, K37, K38, K34, K33, K32, K31 } \ } -#define KEYMAP_MIT( \ + +#define LAYOUT_planck_mit( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ K31, K32, K33, K34, K35, K3X, K38, K39, K310, K311, K312 \ ) \ { \ - { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ - { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ - { K312, K311, K310, K39, K35, K3X, KC_NO, K38, K34, K33, K32, K31 } \ + { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ + { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ + { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ + { K312, K311, K310, K39, K35, K3X, XXX, K38, K34, K33, K32, K31 } \ } -#define KEYMAP_OFFSET( \ + +#define LAYOUT_planck_1x2uR( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K010, K011, K012, \ K11, K12, K13, K14, K15, K16, K17, K18, K19, K110, K111, K112, \ K21, K22, K23, K24, K25, K26, K27, K28, K29, K210, K211, K212, \ K31, K32, K33, K34, K35, K36, K3X, K39, K310, K311, K312 \ ) \ { \ - { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ - { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO }, \ - { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ - { K312, K311, K310, K39, K35, K36, K3X, KC_NO, K34, K33, K32, K31 } \ + { K012, K011, K010, K09, K05, K06, K07, K08, K04, K03, K02, K01 }, \ + { K112, K111, K110, K19, K15, K16, K17, K18, K14, K13, K12, K11 }, \ + { XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX, XXX }, \ + { K212, K211, K210, K29, K25, K26, K27, K28, K24, K23, K22, K21 }, \ + { K312, K311, K310, K39, K35, K36, K3X, XXX, K34, K33, K32, K31 } \ } -#define KC_KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ + +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b \ ) \ - KEYMAP_GRID( \ + LAYOUT_ortho_4x12( \ KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, \ KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, \ KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, \ - KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ - ) - - -#define KEYMAP KEYMAP_MIT + KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k35, KC_##k36, KC_##k37, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b \ +) -#define LAYOUT_ortho_4x12 KEYMAP_GRID -#define LAYOUT_2U_space KEYMAP_MIT -#define LAYOUT_planck_mit KEYMAP_MIT +#define LAYOUT LAYOUT_planck_mit -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP -#define LAYOUT_kc_ortho_4x12 KC_KEYMAP +#define LAYOUT_kc_ortho_4x12 LAYOUT_kc #endif diff --git a/keyboards/jj40/keymaps/cockpit/keymap.c b/keyboards/jj40/keymaps/cockpit/keymap.c index 02deaaa8e3..12ed62b6b5 100644 --- a/keyboards/jj40/keymaps/cockpit/keymap.c +++ b/keyboards/jj40/keymaps/cockpit/keymap.c @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | Fn | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_2U_space( \ +[_QWERTY] = LAYOUT_planck_mit( \ 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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ @@ -85,7 +85,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | | | Alt |Lower|| Space | | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_2U_space( \ +[_LOWER] = LAYOUT_planck_mit( \ KC_GRV, LT_A_OG, LT_C_CA, LT_E_OG, LT_E_DO, LT_I_OG, LT_S_CA, LT_U_OG, LT_U_MA, LT_Z_CA, KC_MINS, KC_BSPC, \ KC_TAB, LT_EXLM, LT_AT, LT_HASH, LT_DLR, LT_PERC, LT_CIRC, LT_AMPR, LT_ASTR, KC_LPRN, KC_RPRN, KC_DEL , \ KC_LSFT, KC_PEQL, KC_PPLS, KC_PMNS, KC_PIPE, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_LCBR, KC_RCBR, KC_INS , \ @@ -107,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | | | Alt | | Space |Raise|| Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_2U_space( \ +[_RAISE] = LAYOUT_planck_mit( \ KC_GRV, LT_1, LT_2, LT_3, LT_4, LT_5, LT_6, LT_7, LT_8, LT_9, LT_0, KC_BSPC, \ KC_TAB, LT_4, LT_5, LT_6, _______, _______, _______, _______, _______, _______, _______, KC_BSLS, \ KC_LSFT, LT_7, LT_8, LT_9, LT_0, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ @@ -130,7 +130,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl |||Fn||| Mode | Alt | | Space |MPrev |MStop |MNext |MPlay | Lock | * `-----------------------------------------------------------------------------------' */ -[_FUNC] = LAYOUT_2U_space( \ +[_FUNC] = LAYOUT_planck_mit( \ 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_CAPS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, BL_TOGG, BL_BRTG, BL_INC, _______, _______, _______, KC_VOLU, \ KC_LSFT, KC_CALC, RGB_HUD, RGB_SAD, RGB_VAD, KC_WBAK, KC_WFWD, BL_DEC, _______, _______, KC_PSCR, KC_VOLD, \ diff --git a/keyboards/jj40/keymaps/default/keymap.c b/keyboards/jj40/keymaps/default/keymap.c index 1db887bd01..d84b01b15a 100644 --- a/keyboards/jj40/keymaps/default/keymap.c +++ b/keyboards/jj40/keymaps/default/keymap.c @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_2U_space( \ +[_QWERTY] = LAYOUT_planck_mit( \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_2U_space( \ +[_LOWER] = LAYOUT_planck_mit( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_2U_space( \ +[_RAISE] = LAYOUT_planck_mit( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ diff --git a/keyboards/jj40/keymaps/krusli/keymap.c b/keyboards/jj40/keymaps/krusli/keymap.c index 6fea9d314e..f996fbf35b 100644 --- a/keyboards/jj40/keymaps/krusli/keymap.c +++ b/keyboards/jj40/keymaps/krusli/keymap.c @@ -26,11 +26,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Ctrl | GUI | Alt |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT_2U_space( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - _______, KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + + [_QWERTY] = LAYOUT_planck_mit( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + TO(_NUMPAD),KC_LCTL, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -41,10 +42,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | F7 | F8 | F9 | F10 | F11 | F12 | RGB | RGB | RGB | RGB |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play | | + * | | RGB | RGB | RGB | | | Next | Vol- | Vol+ | Play | | * `-----------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT_2U_space( \ + [_LOWER] = LAYOUT_planck_mit( \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, \ @@ -62,10 +63,28 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | Prev | Play | Next | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT_2U_space( \ + [_RAISE] = LAYOUT_planck_mit( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, KC_END, KC_PGUP, KC_PGDN, _______, \ _______, KC_MRWD, KC_MPLY, KC_MNXT, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Numpad + * ,-----------------------------------------------------------------------------------. + * | Esc | 7 | 8 | 9 | * | / | | | | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | <-- | 4 | 5 | 6 | + | - | | | | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | 1 | 2 | 3 |Enter |Enter | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Qwerty| 0 | . | . |Enter | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_NUMPAD] = LAYOUT_planck_mit( \ + KC_ESC, KC_P7, KC_P8, KC_P9, KC_PAST, KC_PSLS, _______, _______, _______, _______, _______, _______, \ + KC_BSPC, KC_P4, KC_P5, KC_P6, KC_PPLS, KC_PMNS, _______, _______, _______, _______, _______, _______, \ + _______, KC_P1, KC_P2, KC_P3, KC_PENT, KC_PENT, _______, _______, _______, _______, _______, _______, \ + TO(_QWERTY),KC_P0, KC_PDOT, KC_PDOT, KC_PENT, _______, _______, _______, _______, _______, _______ \ ) }; diff --git a/keyboards/jj40/keymaps/oscillope/keymap.c b/keyboards/jj40/keymaps/oscillope/keymap.c index 8b30f52c8b..1a42261940 100644 --- a/keyboards/jj40/keymaps/oscillope/keymap.c +++ b/keyboards/jj40/keymaps/oscillope/keymap.c @@ -17,11 +17,6 @@ along with this program. If not, see . #include QMK_KEYBOARD_H -#ifdef KEYMAP -#undef KEYMAP -#endif -#define KEYMAP KEYMAP_OFFSET - #define _QWERTY 0 #define _LOWER 1 #define _RAISE 2 @@ -51,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | OS | Alt |Lower |Shift |Raise | Space | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP( \ +[_QWERTY] = LAYOUT_planck_1x2uR( \ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ KC_GRV, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \ @@ -69,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | Lock | | | Prev | Stop | Play | Next | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = KEYMAP( \ +[_LOWER] = LAYOUT_planck_1x2uR( \ 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_INS, _______, _______, CC_PRN, CC_BRC, CC_CBR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ RESET, KC_WBAK, KC_WFWD, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \ @@ -87,14 +82,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | OS | Alt | |Shift | | 0 | Home | PgDn | PgUp | End | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = KEYMAP( \ +[_RAISE] = LAYOUT_planck_1x2uR( \ KC_CAPS, KC_AMPR, KC_ASTR, KC_UNDS, KC_LPRN, KC_RPRN, KC_7, KC_8, KC_9, KC_EQL, KC_BSPC, KC_DEL, \ KC_TAB, KC_DLR, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_4, KC_5, KC_6, KC_MINS, KC_PLUS, _______, \ CC_ARRW, KC_EXLM, KC_AT, KC_HASH, KC_LCBR, KC_RCBR, KC_1, KC_2, KC_3, _______, KC_BSLS, KC_PIPE, \ _______, _______, _______, _______, _______, _______, KC_0, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ ), -[_NAV] = KEYMAP( \ +[_NAV] = LAYOUT_planck_1x2uR( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ diff --git a/keyboards/jj40/rules.mk b/keyboards/jj40/rules.mk index 4e6f626175..697e17a014 100644 --- a/keyboards/jj40/rules.mk +++ b/keyboards/jj40/rules.mk @@ -57,4 +57,4 @@ SRC = matrix.c i2c.c backlight.c # programming options PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex -LAYOUTS = ortho_4x12 planck_mit planck_grid +LAYOUTS = ortho_4x12 planck_mit -- cgit v1.2.3 From e7451448361b0d1490f74aae6dfe4f80e86ea1ca Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Mon, 22 Oct 2018 22:22:20 +0200 Subject: Keyboard: Prime_O layout/matrix fix (#4205) --- keyboards/primekb/prime_o/keymaps/default/keymap.c | 38 +++++++++------------- keyboards/primekb/prime_o/prime_o.h | 30 ++++++++--------- 2 files changed, 30 insertions(+), 38 deletions(-) diff --git a/keyboards/primekb/prime_o/keymaps/default/keymap.c b/keyboards/primekb/prime_o/keymaps/default/keymap.c index f48e9e51ae..a2d9e807cc 100644 --- a/keyboards/primekb/prime_o/keymaps/default/keymap.c +++ b/keyboards/primekb/prime_o/keymaps/default/keymap.c @@ -15,6 +15,8 @@ */ #include QMK_KEYBOARD_H +#define L1BS LT(1, KC_BSPC) + // Defines the keycodes used by our macros in process_record_user enum custom_keycodes { QMKBEST = SAFE_RANGE, @@ -22,31 +24,21 @@ enum custom_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ENT, KC_P0, KC_LCTL, KC_LBRC, LT(1, KC_BSPC), KC_SPC, KC_MINS, KC_RGUI, - KC_ENT, KC_P2, KC_LSFT, KC_X, KC_V, KC_N, KC_COMM, KC_SLSH, - KC_PPLS, KC_P5, KC_TAB, KC_S, KC_F, KC_H, KC_K, KC_QUOT, - KC_PPLS, KC_P8, KC_PSCR, KC_W, KC_R, KC_Y, KC_I, KC_P, - KC_ESC, KC_PSLS, KC_NLCK, KC_2, KC_4, KC_6, KC_8, KC_0, - KC_PMNS, KC_PAST, KC_1, KC_3, KC_5, KC_7, KC_9, KC_DEL, - KC_P7, KC_P9, KC_Q, KC_E, KC_T, KC_U, KC_O, KC_BSLS, - KC_P4, KC_P6, KC_A, KC_D, KC_G, KC_J, KC_L, KC_ENT, - KC_P1, KC_P3, KC_Z, KC_C, KC_B, KC_M, KC_DOT, KC_LSFT, - KC_PDOT, KC_P0, KC_LALT, KC_RBRC, LT(1, KC_BSPC), KC_SPC, KC_EQL, KC_RCTL - ), + [0] = LAYOUT( + KC_ESC, KC_PMNS, KC_PSLS, KC_PAST, KC_NLCK, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_9, KC_DEL, + KC_PPLS, KC_P7, KC_P8, KC_P9, KC_PSCR, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_PPLS, KC_P4, KC_P5, KC_P6, KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT,KC_ENT, + KC_ENT, KC_P1, KC_P2, KC_P3, 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_ENT, KC_PDOT, KC_P0, KC_P0, KC_LCTL, KC_LALT,KC_LBRC,KC_RBRC,L1BS, L1BS, KC_SPC, KC_SPC, KC_MINS,KC_EQL, KC_RGUI,KC_RCTL + ), [1] = LAYOUT( - BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_VOLD, KC_MUTE, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DOWN, KC_SCLN, - KC_TRNS, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, - KC_GRV, KC_F2, KC_F4, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, - KC_F1, KC_F3, KC_F1, KC_F3, KC_F5, KC_F7, KC_F9, KC_DEL, - KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_RGHT, KC_VOLU, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, - BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_VOLU, KC_MUTE - ), + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UP, KC_TRNS,KC_TRNS,KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_CAPS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_RGHT,KC_SCLN,KC_VOLU, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MUTE, + BL_TOGG, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_DEL, KC_VOLD,KC_VOLU,KC_MUTE,KC_MUTE + ), }; diff --git a/keyboards/primekb/prime_o/prime_o.h b/keyboards/primekb/prime_o/prime_o.h index 1ec7277b04..99a8054522 100644 --- a/keyboards/primekb/prime_o/prime_o.h +++ b/keyboards/primekb/prime_o/prime_o.h @@ -19,22 +19,22 @@ #include "quantum.h" #define LAYOUT( \ - K000, K001, K002, K003, K004, K005, K006, K007, K010, K011, K012, K013, K014, K015, K016, K017, \ - K020, K021, K022, K023, K024, K025, K026, K027, K030, K031, K032, K033, K034, K035, K036, K037, \ - K040, K041, K042, K043, K044, K045, K046, K047, K050, K051, K052, K053, K054, K055, K056, K057, \ - K060, K061, K062, K063, K064, K065, K066, K067, K070, K071, K072, K073, K074, K075, K076, K077, \ - K080, K081, K082, K083, K084, K085, K086, K087, K090, K091, K092, K093, K094, K095, K096, K097 \ + K001, K008, K013, K018, K023, K029, K035, K041, K046, K052, K058, K064, K071, K076, K081, K086, \ + K002, K009, K014, K019, K024, K030, K036, K042, K047, K053, K059, K065, K072, K077, K082, K087, \ + K004, K010, K015, K020, K025, K031, K037, K043, K048, K054, K060, K066, K073, K078, K083, K089, \ + K005, K011, K016, K021, K026, K032, K038, K044, K049, K055, K061, K067, K074, K079, K084, K090, \ + K007, K012, K017, K022, K028, K034, K040, K045, K051, K057, K063, K069, K075, K080, K085, K092 \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007 }, \ - { K010, K011, K012, K013, K014, K015, K016, K017 }, \ - { K020, K021, K022, K023, K024, K025, K026, K027 }, \ - { K030, K031, K032, K033, K034, K035, K036, K037 }, \ - { K040, K041, K042, K043, K044, K045, K046, K047 }, \ - { K050, K051, K052, K053, K054, K055, K056, K057 }, \ - { K060, K061, K062, K063, K064, K065, K066, K067 }, \ - { K070, K071, K072, K073, K074, K075, K076, K077 }, \ - { K080, K081, K082, K083, K084, K085, K086, K087 }, \ - { K090, K091, K092, K093, K094, K095, K096, K097 } \ + { K007, K017, K028, K040, K051, K063, K075, K085 }, \ + { K005, K016, K026, K038, K049, K061, K074, K084 }, \ + { K004, K015, K025, K037, K048, K060, K073, K083 }, \ + { K002, K014, K024, K036, K047, K059, K072, K082 }, \ + { K001, K013, K023, K035, K046, K058, K071, K081 }, \ + { K008, K018, K029, K041, K052, K064, K076, K086 }, \ + { K009, K019, K030, K042, K053, K065, K077, K087 }, \ + { K010, K020, K031, K043, K054, K066, K078, K089 }, \ + { K011, K021, K032, K044, K055, K067, K079, K090 }, \ + { K012, K022, K034, K045, K057, K069, K080, K092 } \ } #endif -- cgit v1.2.3 From 704a2e8d3c0bd15f6c8accd5a39fb88ca6c9e2d5 Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Mon, 22 Oct 2018 22:23:22 +0200 Subject: Keymap: Updates to personal userspace and keymaps (#4206) * - updated personal userspace - updated fc660c, niu mini and planck keymaps - added prime_o keymap * Rename README.md to readme.md --- keyboards/fc660c/keymaps/spacebarracecar/README.md | 4 - keyboards/fc660c/keymaps/spacebarracecar/config.h | 11 +- keyboards/fc660c/keymaps/spacebarracecar/keymap.c | 6 +- keyboards/fc660c/keymaps/spacebarracecar/readme.md | 5 + .../niu_mini/keymaps/spacebarracecar/config.h | 1 + .../niu_mini/keymaps/spacebarracecar/keymap.c | 17 +- .../niu_mini/keymaps/spacebarracecar/readme.md | 6 +- keyboards/planck/keymaps/spacebarracecar/config.h | 2 + keyboards/planck/keymaps/spacebarracecar/keymap.c | 19 +- keyboards/planck/keymaps/spacebarracecar/readme.md | 7 +- .../prime_o/keymaps/spacebarracecar/config.h | 1 + .../prime_o/keymaps/spacebarracecar/keymap.c | 286 +++++++++++++++++++++ .../prime_o/keymaps/spacebarracecar/readme.md | 6 + .../prime_o/keymaps/spacebarracecar/rules.mk | 22 ++ users/spacebarracecar/spacebarracecar.c | 47 +++- users/spacebarracecar/spacebarracecar.h | 25 +- 16 files changed, 411 insertions(+), 54 deletions(-) delete mode 100644 keyboards/fc660c/keymaps/spacebarracecar/README.md create mode 100644 keyboards/fc660c/keymaps/spacebarracecar/readme.md create mode 100644 keyboards/primekb/prime_o/keymaps/spacebarracecar/config.h create mode 100644 keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c create mode 100644 keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md create mode 100644 keyboards/primekb/prime_o/keymaps/spacebarracecar/rules.mk diff --git a/keyboards/fc660c/keymaps/spacebarracecar/README.md b/keyboards/fc660c/keymaps/spacebarracecar/README.md deleted file mode 100644 index 7d87ef8cf6..0000000000 --- a/keyboards/fc660c/keymaps/spacebarracecar/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# US International keymap for PCs with German set as input language - -This keymap emulates a US International layout including a deadkey layer on PCs that have German set as the input language. -This allows the use of the keyboard on any PC in Germany without the need of changing the input language. diff --git a/keyboards/fc660c/keymaps/spacebarracecar/config.h b/keyboards/fc660c/keymaps/spacebarracecar/config.h index 9c9b00656b..9d83a27000 100644 --- a/keyboards/fc660c/keymaps/spacebarracecar/config.h +++ b/keyboards/fc660c/keymaps/spacebarracecar/config.h @@ -1,9 +1,8 @@ #pragma once -// higher value means deeper actuation point, less sensitive -// be careful and only make small adjustments (steps of 1 or 2). -// too high and keys will fail to actuate. too low and keys will actuate spontaneously. -// test all keys before further adjustment. -// this should probably stay in the range +/-5. +/* +higher value means deeper actuation point, less sensitive +this should probably stay in the range +/-5. +*/ #undef ACTUATION_DEPTH_ADJUSTMENT -#define ACTUATION_DEPTH_ADJUSTMENT +2 +#define ACTUATION_DEPTH_ADJUSTMENT -1 diff --git a/keyboards/fc660c/keymaps/spacebarracecar/keymap.c b/keyboards/fc660c/keymaps/spacebarracecar/keymap.c index 2cbef10bbf..760b83b9fb 100644 --- a/keyboards/fc660c/keymaps/spacebarracecar/keymap.c +++ b/keyboards/fc660c/keymaps/spacebarracecar/keymap.c @@ -28,11 +28,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,KC_PGDN,KC_UP, KC_PGUP,KC_HOME,XXXXXXX,XXXXXXX,XXXXXXX,GUIU, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, CU_ESCT, _______,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, XXXXXXX,XXXXXXX,GUIL, GUID, GUIR, XXXXXXX,XXXXXXX, KC_ENT, _______,KC_MPRV,KC_MPLY,KC_MNXT,KC_VOLD,KC_VOLU,KC_MUTE,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, KC_PGUP, - RESET, _______,_______, _______, _______,_______,_______, KC_HOME,KC_PGDN,KC_END + RESET, _______,_______, KC_SPC, _______,_______,_______, KC_HOME,KC_PGDN,KC_END ) }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return process_record_userspace(keycode, record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; } diff --git a/keyboards/fc660c/keymaps/spacebarracecar/readme.md b/keyboards/fc660c/keymaps/spacebarracecar/readme.md new file mode 100644 index 0000000000..88c447e75c --- /dev/null +++ b/keyboards/fc660c/keymaps/spacebarracecar/readme.md @@ -0,0 +1,5 @@ +# SpacebarRacecar US-International FC660C Keymap for German PCs + +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the US-International layout. diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/config.h b/keyboards/niu_mini/keymaps/spacebarracecar/config.h index e69de29bb2..6f70f09bee 100644 --- a/keyboards/niu_mini/keymaps/spacebarracecar/config.h +++ b/keyboards/niu_mini/keymaps/spacebarracecar/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c index b850e5fda7..c3f6fb09a1 100644 --- a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c +++ b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c @@ -12,7 +12,7 @@ enum layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base Layer +/* Base ,-----------------------------------------------------------------------------------------------------------------------. |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -/* Dead-Key +/* Deadkey ,-----------------------------------------------------------------------------------------------------------------------. | | | | | | | |Ü | |Ö | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| @@ -87,15 +87,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ ), -/* Nav +/* Navigation ,-----------------------------------------------------------------------------------------------------------------------. -|Caps Lock|PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | |RESET | | +|RESET | | | | | | | | | | |Game | `-----------------------------------------------------------------------------------------------------------------------' */ @@ -103,12 +103,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, RGB_M_P, KC_ENT, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, RGB_MOD, RGB_HUI, CU_RGBV, _______, - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_GAME + RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME ) }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case MO(_LOWER): if (game){ @@ -121,6 +121,7 @@ switch (keycode) { } else { return true; } + default: + return true; } - return process_record_userspace(keycode, record); } diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/readme.md b/keyboards/niu_mini/keymaps/spacebarracecar/readme.md index 88d7221869..9672743816 100644 --- a/keyboards/niu_mini/keymaps/spacebarracecar/readme.md +++ b/keyboards/niu_mini/keymaps/spacebarracecar/readme.md @@ -1,3 +1,5 @@ -# US-International like Niu Mini layout for PCs with German set as input language +# SpacebarRacecar US-International NIU Mini Keymap for German PCs -This layout aims to provide a US-International like layout for PCs that have German set as Input Language. This is useful for users living in germany, because it enables the use of the Niu Mini on any pc without having to switch the input language. It's mostly based on the Planck default layout, but adds essential features for german input, like a dead key layer to access ä, ö, ü. +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. diff --git a/keyboards/planck/keymaps/spacebarracecar/config.h b/keyboards/planck/keymaps/spacebarracecar/config.h index 9b55fa93aa..4f48857fe5 100644 --- a/keyboards/planck/keymaps/spacebarracecar/config.h +++ b/keyboards/planck/keymaps/spacebarracecar/config.h @@ -1,3 +1,5 @@ +#pragma once + #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(NO_SOUND) #endif diff --git a/keyboards/planck/keymaps/spacebarracecar/keymap.c b/keyboards/planck/keymaps/spacebarracecar/keymap.c index 705f78f8ea..db91231bf7 100644 --- a/keyboards/planck/keymaps/spacebarracecar/keymap.c +++ b/keyboards/planck/keymaps/spacebarracecar/keymap.c @@ -13,7 +13,7 @@ enum layers { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Base Layer +/* Base ,-----------------------------------------------------------------------------------------------------------------------. |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LALT, KC_LGUI, KC_DOWN, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, MU_MOD, MU_OFF ), -/* Dead-Key +/* Deadkey ,-----------------------------------------------------------------------------------------------------------------------. | | | | | | | |Ü | |Ö | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| @@ -92,18 +92,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, KC_BSPC, CU_NAV, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, CU_LSFT, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_RSFT, - KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, CU_DDQ, CU_DDQ, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ), -/* Nav +/* Navigation ,-----------------------------------------------------------------------------------------------------------------------. -|Caps Lock|PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | |RESET | | +|RESET | | | | | | | | | | |Game | `-----------------------------------------------------------------------------------------------------------------------' */ @@ -111,12 +111,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, MU_ON, XXXXXXX, XXXXXXX, XXXXXXX, _______, - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_GAME + RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME ) }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case MO(_LOWER): if (game){ @@ -143,6 +143,7 @@ switch (keycode) { layer_off(_MUSICMODE); } return true; + default: + return true; } - return process_record_userspace(keycode, record); } diff --git a/keyboards/planck/keymaps/spacebarracecar/readme.md b/keyboards/planck/keymaps/spacebarracecar/readme.md index daa9c4ad2b..c8e8134caa 100644 --- a/keyboards/planck/keymaps/spacebarracecar/readme.md +++ b/keyboards/planck/keymaps/spacebarracecar/readme.md @@ -1,4 +1,5 @@ -# US-International like Planck layout for PCs with German set as input language - -This layout aims to provide a US-International like layout for PCs that have German set as Input Language. This is useful for users living in germany, because it enables the use of the planck on any pc without having to switch the input language. It's mostly based on the Planck default layout, but adds essential features for german input, like a dead key layer to access ä, ö, ü. +# SpacebarRacecar US-International Planck Keymap for German PCs +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/config.h b/keyboards/primekb/prime_o/keymaps/spacebarracecar/config.h new file mode 100644 index 0000000000..6f70f09bee --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c new file mode 100644 index 0000000000..d38ff0d1d6 --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c @@ -0,0 +1,286 @@ +#include QMK_KEYBOARD_H +#include "spacebarracecar.h" + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +#define LEFTNUM + +enum layers { + _BASE, + _LOWER, + _RAISE, + _GAME = _NAV+1 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +#ifndef LEFTNUM +/* Base +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ |Numlock |/ |* |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace|7 |8 |9 |- | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' |4 |5 |6 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl |00 |0 |. |Tab | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT( + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, KC_P4, KC_P5, KC_P6, KC_PEQL, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_P00, KC_P0, KC_PDOT, KC_TAB +), + +/* Lower +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|~ |! |" |# |$ |% |^ |& |* |( |) | |7 |8 |9 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |00 |0 |. |Tab | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, _______, _______, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |7 |8 |9 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |00 |0 |. |Tab | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Deadkey +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +| | | | | | | | | | | | |Numlock |/ |* |- | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | |Ü | |Ö | | |7 |8 |9 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Ä |ß | | | | | | | | | |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | |00 |0 |. |Tab | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT( + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, _______, _______, _______, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, _______, _______, _______, _______, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Navigation +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|Escape | | | | | | | | | | | |Numlock |/ |* |- | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del |7 |8 |9 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RESET | | | | | | | | | | |Game |00 |0 |. |Tab | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT( + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, _______, _______, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME, _______, _______, _______, _______ +), + +// Can be used to place macros on the numpad +[_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +#endif + +#ifdef LEFTNUM +/* Base +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 |Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 |(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 |RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT( + KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, + KC_PPLS, KC_P7, KC_P8, KC_P9, KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + KC_PEQL, KC_P4, KC_P5, KC_P6, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + KC_PENT, KC_P1, KC_P2, KC_P3, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_BSPC, KC_PDOT, KC_P0, KC_P00, KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | |? | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, _______, _______, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, _______, _______, _______, _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Deadkey +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock | | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 | | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | | | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | |" |" | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT( + _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + _______, _______, _______, _______, KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, _______, _______, _______, _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ +), + +/* Navigation +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |Escape | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 |RESET | | | | | | | | | | |Game | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT( + _______, _______, _______, _______, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, + _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME +), + +// Can be used to place macros on the numpad +[_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) +#endif + +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { +switch (keycode) { + case MO(_LOWER): + if (game){ + if(record->event.pressed) { + register_code(KC_SPC); + } else { + unregister_code(KC_SPC); + } + return false; + } else { + return true; + } + case CU_GAME: + if(record->event.pressed) { + if (game) + layer_on(_GAME); + else + layer_off(_GAME); + } + return false; + default: + return true; + } +} diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md new file mode 100644 index 0000000000..eb8da3fa78 --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md @@ -0,0 +1,6 @@ +# SpacebarRacecar US-International Prime_O Keymap for German PCs + +This keymap emulates most keys of the US-International layout on PCs that have German set as input language. +This allows the use of the keyboard on any PC in Germany without the need to change any settings. +The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. +Righthand Numpad is enabled by default, enable lefthand Numpad with #define LEFTNUM. diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/rules.mk b/keyboards/primekb/prime_o/keymaps/spacebarracecar/rules.mk new file mode 100644 index 0000000000..f50334d5ec --- /dev/null +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/rules.mk @@ -0,0 +1,22 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# Userspace defines +GERMAN_ENABLE = yes # Enable Custom US Ansi Keycodes for PC with German set as input language diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c index 404331f8df..f7048869ed 100644 --- a/users/spacebarracecar/spacebarracecar.c +++ b/users/spacebarracecar/spacebarracecar.c @@ -1,18 +1,29 @@ #include "spacebarracecar.h" #ifdef GERMAN_ENABLE +// These indicate if left and right shift are physically pressed bool lshift = false; bool rshift = false; + +// Interrupt and times for space cadet shift bool lshiftp = false; bool rshiftp = false; uint16_t lshift_timer = 0; uint16_t rshift_timer = 0; +// Number of items that are saved in prev_kcs uint8_t prev_indx = 0; +// Used to save the last 6 actual keycodes activated by frankenkeycodes uint16_t prev_kcs[6] = {0, 0, 0, 0, 0, 0}; +// If true the deadkey characters grave and circonflexe are not automatically escaped bool esct = false; +/* +Used to add a keycode to a prev_kcs to remember it. +When full the last code gets discarded and replaced by +the new one. +*/ void add_to_prev(uint16_t kc){ for (int i=0; ievent.pressed) { + timer_timeout(); game = !game; } - return false; + // allows keymap to execute further commands when CU_GAME is pressed, for example enabling a macro layer + return process_record_keymap(keycode, record) && false; case KC_LGUI: case KC_RGUI: + if (record->event.pressed) + timer_timeout(); if (game) return false; else @@ -77,11 +102,21 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { } layer_off(_NAV); } - return false; + return false; + case KC_P00: + if(record->event.pressed) { + timer_timeout(); + register_code(KC_P0); + unregister_code(KC_P0); + register_code(KC_P0); + unregister_code(KC_P0); + } + return false; #ifdef RGBLIGHT_ENABLE case CU_RGBV: if(record->event.pressed) { + timer_timeout(); if (rgblight_get_val()+32>255) rgblight_sethsv(rgblight_get_hue(), rgblight_get_sat(), 31); else @@ -133,6 +168,7 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { return false; case CU_ESCT: if(record->event.pressed) { + timer_timeout(); esct = !esct; } return false; @@ -282,6 +318,7 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { case KC_LCTL: case KC_RCTL: if(!record->event.pressed) { + timer_timeout(); unregister_code(KC_Z); unregister_code(KC_Y); } @@ -300,6 +337,6 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record) { #endif } - return true; + return process_record_keymap(keycode, record); } } diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h index 42879d2efb..1e18253510 100644 --- a/users/spacebarracecar/spacebarracecar.h +++ b/users/spacebarracecar/spacebarracecar.h @@ -4,13 +4,14 @@ #include "keymap_german.h" enum userspace_layers { - _DEADKEY = 14, //change if more than 16 layers are required + _DEADKEY = 14, // Change if more than 16 layers are required _NAV }; enum userspace_custom_keycodes { CU_GAME = SAFE_RANGE, // Toggle game mode on/off CU_NAV, // NAV | ESC + KC_P00, // Numpad double zero #ifdef GERMAN_ENABLE CU_LSFT, // LSFT | ( @@ -52,10 +53,8 @@ enum userspace_custom_keycodes { }; #ifdef GERMAN_ENABLE -// these save the current shift status extern bool lshift; extern bool rshift; -// stuff for custom space cadet shift extern bool lshiftp; extern bool rshiftp; extern uint16_t lshift_timer; @@ -63,14 +62,12 @@ extern uint16_t rshift_timer; extern uint8_t prev_indx; extern uint16_t prev_kcs[6]; - void add_to_prev(uint16_t kc); void unreg_prev(void); extern bool esct; #endif -// stuff for nav esc extern bool navesc; extern uint16_t navesc_timer; @@ -78,7 +75,7 @@ extern bool game; void timer_timeout(void); -bool process_record_userspace(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define CTRLX LCTL(KC_X) #define CTRLC LCTL(KC_C) @@ -89,9 +86,9 @@ bool process_record_userspace(uint16_t keycode, keyrecord_t *record); #define GUIL LGUI(KC_LEFT) #define GUIR RGUI(KC_RIGHT) -// -// Templates for Keys, with custom shifted and non shifted Characters -// +/* +Templates for Keys, with custom shifted and non shifted Characters +*/ // Normal shift status #define SHIFT_NORM(kc1, kc2) \ @@ -139,7 +136,7 @@ if (record->event.pressed) { \ } \ return false; -// All shift +// Always shifted #define SHIFT_ALL(kc1, kc2) \ if (record->event.pressed) { \ timer_timeout(); \ @@ -164,7 +161,7 @@ if (record->event.pressed) { \ } \ return false; -// All no shift +// Never shifted #define SHIFT_NO(kc1, kc2) \ if (record->event.pressed) { \ timer_timeout(); \ @@ -188,7 +185,7 @@ if (record->event.pressed) { \ } \ return false; -// All algr +// Always AltGr #define SHIFT_ALGR(kc1, kc2) \ if (record->event.pressed) { \ timer_timeout(); \ @@ -208,7 +205,7 @@ if (record->event.pressed) { \ } \ return false; -// Different keycode for ctrl +// Different keycode when Ctrl is pressed #define CTRL(kc1, kc2) \ if(record->event.pressed) { \ timer_timeout(); \ @@ -227,7 +224,7 @@ if(record->event.pressed) { \ } \ return false; -// Umlaute for deadkey layer +// Template for keys on deadkey layer (mostly Umlaute) #define UML(kc) \ if(record->event.pressed) { \ timer_timeout(); \ -- cgit v1.2.3 From ca56c2145f25ab04daa6bb96f31b948be9e57ef2 Mon Sep 17 00:00:00 2001 From: skullY Date: Tue, 9 Oct 2018 09:40:10 -0700 Subject: Fold install_dependencies.sh into linux_install.sh and freebsd_install.sh --- util/freebsd_install.sh | 18 +++++++ util/install_dependencies.sh | 118 ------------------------------------------- util/linux_install.sh | 116 ++++++++++++++++++++++++++++++++---------- util/qmk_install.sh | 13 +++-- 4 files changed, 114 insertions(+), 151 deletions(-) create mode 100644 util/freebsd_install.sh delete mode 100755 util/install_dependencies.sh diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh new file mode 100644 index 0000000000..25ea80a7fc --- /dev/null +++ b/util/freebsd_install.sh @@ -0,0 +1,18 @@ +#!/bin/sh +pkg update +pkg install -y \ + git \ + wget \ + gmake \ + gcc \ + zip \ + unzip \ + avr-binutils \ + avr-gcc \ + avr-libc \ + dfu-programmer \ + dfu-util \ + arm-none-eabi-gcc \ + arm-none-eabi-binutils \ + arm-none-eabi-newlib \ + diffutils diff --git a/util/install_dependencies.sh b/util/install_dependencies.sh deleted file mode 100755 index 227c86f87f..0000000000 --- a/util/install_dependencies.sh +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/env bash -# This script will attempt to setup the Linux dependencies for compiling QMK/TMK - -# This could probably go much lower, but since we are including an Arch vagrant, -# making it the first match makes sense - -if [[ -n "$(type -P pacman )" ]]; then - # Arch linux and derivatives like Apricity - # Future improvements: - # Allow user to speed up package installs using powerpill/wget tweaks - # Always run the pacman mirror update script if possible when vagrant comes up - # This will ensure that users never get stalled on a horribly slow mirror - pacman -Syyu --needed --noconfirm - pacman -S --needed --noconfirm \ - base-devel \ - avr-gcc \ - avr-binutils \ - avr-libc \ - dfu-util \ - arm-none-eabi-gcc \ - arm-none-eabi-binutils \ - arm-none-eabi-newlib \ - git \ - diffutils - -elif [[ -n "$(type -P apt-get)" ]]; then - # Debian and derivatives - # This block performs completely non-interactive updates {{ - export DEBIAN_FRONTEND=noninteractive - export DEBCONF_NONINTERACTIVE_SEEN=true - echo "grub-pc hold" | dpkg --set-selections - apt-get -y update - apt-get -y --allow-unauthenticated upgrade \ - -o Dpkg::Options::="--force-confdef" \ - -o Dpkg::Options::="--force-confold" - # }} - apt-get install -y \ - build-essential \ - gcc \ - unzip \ - wget \ - zip \ - gcc-avr \ - binutils-avr \ - avr-libc \ - dfu-programmer \ - dfu-util \ - gcc-arm-none-eabi \ - binutils-arm-none-eabi \ - libnewlib-arm-none-eabi \ - git \ - diffutils - -elif [[ -n "$(type -P yum)" ]]; then - # Fedora, CentOS or RHEL and derivatives - yum -y makecache && yum -y update - yum -y install \ - gcc \ - glibc-headers \ - kernel-devel \ - kernel-headers \ - make \ - perl \ - git \ - wget \ - avr-binutils \ - avr-gcc \ - avr-libc \ - dfu-programmer \ - dfu-util \ - arm-none-eabi-gcc-cs \ - arm-none-eabi-newlib \ - git \ - diffutils - # The listed eabi pacackes do unfortunately not exist for CentOS, - # But at least in Fedora they do, so try to install them anyway - # TODO: Build them from sources, if the installation fails - -elif [[ -n "$(type -P zypper)" ]]; then - # openSUSE - zypper --non-interactive refresh && zypper --non-interactive update - zypper --non-interactive install \ - git \ - make \ - gcc \ - kernel-devel \ - patch \ - wget \ - dfu-programmer \ - git \ - diffutils - # TODO: The avr and eabi tools are not available as default packages, so we need - # another way to install them - -elif [[ -n "$(type -P pkg)" ]]; then - # FreeBSD - pkg update - pkg install -y \ - git \ - wget \ - gmake \ - gcc \ - zip \ - unzip \ - avr-binutils \ - avr-gcc \ - avr-libc \ - dfu-programmer \ - dfu-util \ - arm-none-eabi-gcc \ - arm-none-eabi-binutils \ - arm-none-eabi-newlib \ - diffutils -elif [[ -n "$(type -P emerge)" ]]; then - echo 'Please check that your gcc is built with the multilib use flag enabled.' - emerge -vq sys-devel/crossdev - USE="-openmp -hardened -sanitize -vtv" crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr -fi diff --git a/util/linux_install.sh b/util/linux_install.sh index 0e4e26fd96..a6a0532768 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -1,40 +1,100 @@ #!/bin/sh -if grep ID /etc/os-release | grep -qE "rhel|fedora"; then - # RPM based OS - sudo dnf install gcc unzip wget zip dfu-util dfu-programmer avr-gcc \ - avr-libc binutils-avr32-linux-gnu arm-none-eabi-gcc-cs \ - arm-none-eabi-binutils-cs arm-none-eabi-newlib + +# Note: This file uses tabs to indent. Please don't mix tabs and spaces. + +GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." + +if grep ID /etc/os-release | grep -qE "fedora"; then + sudo dnf install \ + arm-none-eabi-binutils-cs \ + arm-none-eabi-gcc-cs \ + arm-none-eabi-newlib + avr-binutils \ + avr-gcc \ + avr-libc \ + binutils-avr32-linux-gnu \ + dfu-util \ + dfu-programmer \ + diffutils \ + git \ + gcc \ + glibc-headers \ + kernel-devel \ + kernel-headers \ + make \ + perl \ + unzip \ + wget \ + zip + elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then + DEBIAN_FRONTEND=noninteractive + DEBCONF_NONINTERACTIVE_SEEN=true + export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN sudo apt-get update - sudo apt-get install gcc unzip wget zip gcc-avr binutils-avr avr-libc \ - dfu-programmer dfu-util gcc-arm-none-eabi binutils-arm-none-eabi \ - libnewlib-arm-none-eabi + sudo apt-get install \ + build-essential \ + avr-libc \ + binutils-arm-none-eabi \ + binutils-avr \ + dfu-programmer \ + dfu-util \ + diffutils \ + gcc \ + gcc-arm-none-eabi \ + gcc-avr \ + git \ + libnewlib-arm-none-eabi \ + unzip \ + wget \ + zip + elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then - # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. - sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz - sudo pacman -S gcc unzip wget zip avr-binutils avr-libc \ - dfu-util arm-none-eabi-gcc arm-none-eabi-binutils \ - arm-none-eabi-newlib + # install avr-gcc 8.1 until 8.3 is available. See #3657 for details of the bug. + sudo pacman -U https://archive.archlinux.org/packages/a/avr-gcc/avr-gcc-8.1.0-1-x86_64.pkg.tar.xz + sudo pacman -S \ + arm-none-eabi-binutils \ + arm-none-eabi-gcc \ + arm-none-eabi-newlib \ + avr-binutils \ + avr-libc \ + avr-gcc \ + base-devel \ + dfu-util \ + diff-utils \ + gcc \ + git \ + unzip \ + wget \ + zip git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer cd /tmp/dfu-programmer makepkg -sic rm -rf /tmp/dfu-programmer/ + elif grep ID /etc/os-release | grep -q gentoo; then - echo "This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." - echo -n "Proceed (y/N)? " - old_stty_cfg=$(stty -g) - stty raw -echo - answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) - stty $old_stty_cfg - if echo "$answer" | grep -iq "^y" ;then - sudo touch /etc/portage/package.use/qmkfirmware - echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null - sudo emerge -auN sys-devel/gcc app-arch/unzip app-arch/zip net-misc/wget app-mobilephone/dfu-util sys-devel/crossdev dev-embedded/avrdude - sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr - echo Done! - else - echo "Quitting..." -fi + echo GENTOO_WARNING | fmt + echo -n "Proceed (y/N)? " + old_stty_cfg=$(stty -g) + stty raw -echo + answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) + stty $old_stty_cfg + if echo "$answer" | grep -iq "^y" ;then + sudo touch /etc/portage/package.use/qmkfirmware + echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null + sudo emerge -auN \ + app-arch/unzip \ + app-arch/zip \ + app-mobilephone/dfu-util \ + net-misc/wget \ + sys-devel/gcc \ + sys-devel/crossdev dev-embedded/avrdude + sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr + echo Done! + else + echo "Quitting..." + fi + else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo diff --git a/util/qmk_install.sh b/util/qmk_install.sh index 6f35e4c71b..76ecf5fc01 100755 --- a/util/qmk_install.sh +++ b/util/qmk_install.sh @@ -7,16 +7,19 @@ case $(uname -a) in *Darwin*) exec "${util_dir}/macos_install.sh" ;; - *Linux*Microsoft*) + *Linux*Microsoft*) exec "${util_dir}/wsl_install.sh" - ;; + ;; + *FreeBSD*) + exec "${util_dir}/freebsd_install.sh" + ;; *Linux*) exec "${util_dir}/linux_install.sh" ;; MSYS_NT*|MINGW64_NT*|MINGW32_NT*) exec "${util_dir}/msys2_install.sh" ;; - *) - echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." - ;; + *) + echo "Environment not supported. Please see https://docs.qmk.fm for details on how to configure the QMK Firmware build tools manually." + ;; esac -- cgit v1.2.3 From 79d495f51dd0d49a4e0ba84f3bcec588dba498b5 Mon Sep 17 00:00:00 2001 From: skullY Date: Tue, 9 Oct 2018 10:21:13 -0700 Subject: Add opensuse packages provided by @isolatedvirus --- util/linux_install.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/util/linux_install.sh b/util/linux_install.sh index a6a0532768..5186e31f2b 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -95,6 +95,20 @@ elif grep ID /etc/os-release | grep -q gentoo; then echo "Quitting..." fi +elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then + sudo zypper install \ + avr-libc \ + cross-avr-gcc8 \ + cross-avr-binutils \ + cross-arm-none-newlib-devel \ + cross-arm-binutils cross-arm-none-newlib-devel \ + dfu-tool \ + dfu-programmer \ + gcc \ + unzip \ + wget \ + zip + else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo -- cgit v1.2.3 From 11c4c711310d297a378f029b7ffa1409d5a04dbc Mon Sep 17 00:00:00 2001 From: skullY Date: Tue, 9 Oct 2018 11:35:31 -0700 Subject: Fixup the WSL install --- util/win_shared_install.sh | 3 --- util/wsl_install.sh | 7 +------ 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh index f24ec08e8e..c7517881ee 100644 --- a/util/win_shared_install.sh +++ b/util/win_shared_install.sh @@ -18,11 +18,8 @@ function install_utils { wget 'https://www.pjrc.com/teensy/teensy_loader_cli_windows.zip' unzip teensy_loader_cli_windows.zip - # This URL has changed and I can't find the new location. Commenting out until we figure out the new URL or determine this isn't needed. -skullY echo "Installing Atmel Flip" wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/Flip%20Installer%20-%203.4.7.112.exe' - # This is the JRE-less installer, if we need the larger bundled with JRE installer, use this: - #wget 'http://ww1.microchip.com/downloads/en/DeviceDoc/JRE%20-%20Flip%20Installer%20-%203.4.7.112.exe' mv Flip\ Installer\ \-\ 3.4.7.112.exe FlipInstaller.exe echo "Downloading the QMK driver installer" diff --git a/util/wsl_install.sh b/util/wsl_install.sh index d11c78ac71..c2c206d2b9 100644 --- a/util/wsl_install.sh +++ b/util/wsl_install.sh @@ -15,20 +15,15 @@ fi while true; do echo echo "Do you want to install all toolchain dependencies needed for compiling QMK?" - echo "This will run install_dependencies.sh, which calls apt-get upgrade." echo "If you don't want that, you can install the dependencies manually." read -p "(Y/N) " res case $res in - [Yy]* ) sudo ./install_dependencies.sh; break;; + [Yy]* ) ./linux_install.sh; break;; [Nn]* ) break;; * ) echo "Invalid answer";; esac done -echo "Installing dependencies needed for the installation (unzip, wget)" -echo "This will ask for the sudo password" -sudo apt-get install unzip wget - download_dir=wsl_downloaded source "$dir/win_shared_install.sh" -- cgit v1.2.3 From 552b1cccec12f2685f594df5b58afc11ca1fbc74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 18 Oct 2018 21:33:50 -0700 Subject: Update the installation script PR (#4167) * Update docs to use qmk_install * Update Vagrantfile to use qmk_install --- Vagrantfile | 2 +- docs/getting_started_build_tools.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 08de5f7f52..9c414b2bcb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -59,7 +59,7 @@ Vagrant.configure(2) do |config| # add a # before ,args: and run 'vagrant up' to get a working # non-updated box and then attempt to troubleshoot or open a Github issue - config.vm.provision "shell", run: "always", path: "./util/install_dependencies.sh", args: "-update" + config.vm.provision "shell", run: "always", path: "./util/qmk_install.sh", args: "-update" config.vm.post_up_message = <<-EOT diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 88f3642b28..587dece4a1 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -8,7 +8,7 @@ Note: If it is your first time here, Check out the "Complete Newbs guide" instea ## Linux -To ensure you are always up to date, you can just run `sudo util/install_dependencies.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.** +To ensure you are always up to date, you can just run `sudo util/qmk_install.sh`. That should always install all the dependencies needed. **This will run `apt-get upgrade`.** You can also install things manually, but this documentation might not be always up to date with all requirements. -- cgit v1.2.3 From 418a886ae44833eb323e2e902b92759369063339 Mon Sep 17 00:00:00 2001 From: "Colin T.A. Gray" Date: Mon, 22 Oct 2018 14:56:52 -0400 Subject: adds 'dfu-util' to macos_install.sh --- util/macos_install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/macos_install.sh b/util/macos_install.sh index 7bfb105ecb..c31be99d22 100755 --- a/util/macos_install.sh +++ b/util/macos_install.sh @@ -22,4 +22,4 @@ fi brew tap osx-cross/avr brew tap PX4/homebrew-px4 brew update -brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude +brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude dfu-util -- cgit v1.2.3 From e26a7b0ed8af7b6b4e99fee718ca265fcc8961f1 Mon Sep 17 00:00:00 2001 From: fougner Date: Mon, 22 Oct 2018 23:01:45 +0200 Subject: Keyboard: initial support for XD87 (#4182) * Keyboard: initial support for XD87 * Add row/col pin configuration for XD87 PCB * Add default ISO layout * Fix incorrect KC in default_tkl_iso The KC_NUBS is duplicated in the TKL ISO layout. Compare with the fullsize ISO which has a KC_NUHS in the corresponding place. * Add support for community layouts * Add TKL ANSI layout * Enable TKL ISO/ANSI community layout * Fix LAYOUT_all * Configure backlighting for XD87 * Various documentation changes --- keyboards/xd87/config.h | 227 +++++++++++++++++++++++ keyboards/xd87/info.json | 0 keyboards/xd87/keymaps/default/config.h | 19 ++ keyboards/xd87/keymaps/default/keymap.c | 68 +++++++ keyboards/xd87/keymaps/default/readme.md | 1 + keyboards/xd87/readme.md | 26 +++ keyboards/xd87/rules.mk | 84 +++++++++ keyboards/xd87/xd87.c | 43 +++++ keyboards/xd87/xd87.h | 70 +++++++ layouts/default/tkl_iso/default_tkl_iso/keymap.c | 2 +- 10 files changed, 539 insertions(+), 1 deletion(-) create mode 100644 keyboards/xd87/config.h create mode 100644 keyboards/xd87/info.json create mode 100644 keyboards/xd87/keymaps/default/config.h create mode 100644 keyboards/xd87/keymaps/default/keymap.c create mode 100644 keyboards/xd87/keymaps/default/readme.md create mode 100644 keyboards/xd87/readme.md create mode 100644 keyboards/xd87/rules.mk create mode 100644 keyboards/xd87/xd87.c create mode 100644 keyboards/xd87/xd87.h diff --git a/keyboards/xd87/config.h b/keyboards/xd87/config.h new file mode 100644 index 0000000000..3682af7409 --- /dev/null +++ b/keyboards/xd87/config.h @@ -0,0 +1,227 @@ +/* +Copyright 2018 Alexander Fougner + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KP Republic +#define PRODUCT XD87 TKL +#define DESCRIPTION KP Republic XD87 + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 17 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + + +#define MATRIX_ROW_PINS { D1, B0, B1, C7, D3, D5 } + +#define MATRIX_COL_PINS { E6, F0, F1, F4, F5, F6, F7, B5, B6, C6, D4, D6, D7, B4, B2, B3, D2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN D0 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/xd87/info.json b/keyboards/xd87/info.json new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/xd87/keymaps/default/config.h b/keyboards/xd87/keymaps/default/config.h new file mode 100644 index 0000000000..ed56340c39 --- /dev/null +++ b/keyboards/xd87/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 + +// place overrides here diff --git a/keyboards/xd87/keymaps/default/keymap.c b/keyboards/xd87/keymaps/default/keymap.c new file mode 100644 index 0000000000..b31db9b577 --- /dev/null +++ b/keyboards/xd87/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_tkl_iso(\ + 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_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_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_NUHS, 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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/xd87/keymaps/default/readme.md b/keyboards/xd87/keymaps/default/readme.md new file mode 100644 index 0000000000..41baff9435 --- /dev/null +++ b/keyboards/xd87/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for xd87 \ No newline at end of file diff --git a/keyboards/xd87/readme.md b/keyboards/xd87/readme.md new file mode 100644 index 0000000000..0b9389740d --- /dev/null +++ b/keyboards/xd87/readme.md @@ -0,0 +1,26 @@ +# XD87 + +![XD87](https://i.imgur.com/qVyOies.jpg) + + +- Keyboard Maintainer: [Alexander Fougner](https://github.com/fougner) +- Hardware Supported: XD87 PCB v1.1 +- Hardware Availability: + - [KPrepublic.com](https://kprepublic.com/products/xd87-xd87-xd80-custom-mechanical-keyboard-kit80-supports-tkg-tools-support-underglow-rgb-pcb-programmed-gh80-kle) + - [AliExpress](https://www.aliexpress.com/item/xd87-XD87-XD80-Custom-Mechanical-Keyboard-Kit80-Supports-TKG-TOOLS-Support-Underglow-RGB-PCB-programmed-gh80/32892540743.html) + +Make example for this keyboard (after setting up your build environment): + + make xd87:default + +It also supports the tkl_ansi and tkl_iso community layouts: + + # Build firmware with ANSI layout + make xd87:default_tkl_ansi + # Build firmware with ISO layout + make xd87:default_tkl_iso + + +The keyboard can be reset to bootloader by using bootmagic (space+b by default) or short out the small connector between the Delete and End keys. + +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). \ No newline at end of file diff --git a/keyboards/xd87/rules.mk b/keyboards/xd87/rules.mk new file mode 100644 index 0000000000..39540e701d --- /dev/null +++ b/keyboards/xd87/rules.mk @@ -0,0 +1,84 @@ +# 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 = atmel-dfu + + +# 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 = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # 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) + +# Supported layouts +LAYOUTS = tkl_ansi tkl_iso diff --git a/keyboards/xd87/xd87.c b/keyboards/xd87/xd87.c new file mode 100644 index 0000000000..da07c71d88 --- /dev/null +++ b/keyboards/xd87/xd87.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ +#include "xd87.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/xd87/xd87.h b/keyboards/xd87/xd87.h new file mode 100644 index 0000000000..c4df290a3b --- /dev/null +++ b/keyboards/xd87/xd87.h @@ -0,0 +1,70 @@ +/* Copyright 2018 Alexander Fougner + * + * 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 . + */ +#ifndef XD87_H +#define XD87_H + +#include "quantum.h" + +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K3E, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K4G, \ + K50, K51, K52, K55, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) { \ +/* 0 1 2 3 4 5 6 7 8 9 A B C D E F G */ \ +/* 0 */ { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G }, \ +/* 1 */ { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G }, \ +/* 2 */ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G }, \ +/* 3 */ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, KC_NO, KC_NO, KC_NO }, \ +/* 4 */ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E, K4F, K4G }, \ +/* 5 */ { K50, K51, K52, KC_NO, KC_NO, K55, KC_NO, KC_NO, K58, KC_NO, K5A, K5B, K5C, K5D, K5E, K5F, K5G } \ +} + +#define LAYOUT_tkl_ansi( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K01, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) LAYOUT_all( \ + K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, KC_NO, K1D, KC_NO, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, \ + K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) + +#define LAYOUT_tkl_iso( \ + K00, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4F, \ + K50, K51, K52, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) LAYOUT_all( \ + K00, KC_NO, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, K0G, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, KC_NO, K1E, K1F, K1G, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO, K2E, K2F, K2G, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, KC_NO, KC_NO, K4F, KC_NO, \ + K50, K51, K52, KC_NO, K58, K5A, K5B, K5C, K5D, K5E, K5F, K5G \ +) + +#endif \ No newline at end of file diff --git a/layouts/default/tkl_iso/default_tkl_iso/keymap.c b/layouts/default/tkl_iso/default_tkl_iso/keymap.c index f29ef2267f..eb4c48d657 100644 --- a/layouts/default/tkl_iso/default_tkl_iso/keymap.c +++ b/layouts/default/tkl_iso/default_tkl_iso/keymap.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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_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_NUBS, KC_ENT, + 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_NUHS, 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, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ) \ -- cgit v1.2.3 From 5dc41446aae0b429c72ca020cb20efb3356afee5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 22 Oct 2018 14:18:47 -0700 Subject: Keyboard: Chimera LS refactor and Configurator support (#3715) * Matrix/keymap refactor - Deleted `KC_KEYMAP` macro - Renamed `KEYMAP` macro to `LAYOUT_ortho_4x12` - Default keymap updated to current QMK standards - #include QMK_KEYBOARD_H - Refactored from `KC_KEYMAP` to `LAYOUT_ortho_4x12` macro - `action_get_macro()` deprecated in favor of `process_record_user()` `rules.mk` *not* updated to include `LAYOUTS = ortho_4x12` because I have no idea if and how that works on a split and/or wireless keyboard. * readme cleanup: markdown formatting * Add Configurator support * added support for ortho_4x12 layout * Macro and readme updates Macros updated to use `KC_NO` directly. Readme updates and cleanup. --- keyboards/chimera_ls/chimera_ls.h | 46 +++--- keyboards/chimera_ls/info.json | 13 ++ keyboards/chimera_ls/keymaps/default/keymap.c | 227 +++++++++++++------------- keyboards/chimera_ls/readme.md | 10 +- keyboards/chimera_ls/rules.mk | 4 +- 5 files changed, 152 insertions(+), 148 deletions(-) create mode 100644 keyboards/chimera_ls/info.json diff --git a/keyboards/chimera_ls/chimera_ls.h b/keyboards/chimera_ls/chimera_ls.h index b39bcf2047..bb99684e5f 100644 --- a/keyboards/chimera_ls/chimera_ls.h +++ b/keyboards/chimera_ls/chimera_ls.h @@ -50,32 +50,30 @@ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KC_KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \ - k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \ - k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \ - k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \ -) \ -{ \ - { KC_##k43, KC_##k45, KC_##k34, KC_##k11, KC_##k23, KC_##k40, KC_##k38, KC_##k25, KC_##k00, KC_##k12 }, \ - { KC_##k31, KC_##k44, KC_##k46, KC_##k35, KC_##k22, KC_##k28, KC_##k39, KC_##k37, KC_##k24, KC_##k13 }, \ - { KC_##k30, KC_##k32, KC_##k33, KC_##k47, KC_##k09, KC_##k29, KC_##k27, KC_##k26, KC_##k36, KC_##k02 }, \ - { KC_##k19, KC_##k20, KC_##k21, KC_##k42, KC_##k18, KC_##k16, KC_##k15, KC_##k14, KC_##k41, KC_##k17 }, \ - { KC_##k06, KC_##k07, KC_##k08, KC_##k10, KC_NO, KC_##k05, KC_##k04, KC_##k03, KC_##k01, KC_NO }, \ +#define LAYOUT_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \ + k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \ + k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \ + k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \ + ) { \ + { k43, k45, k34, k11, k23, k40, k38, k25, k00, k12 }, \ + { k31, k44, k46, k35, k22, k28, k39, k37, k24, k13 }, \ + { k30, k32, k33, k47, k09, k29, k27, k26, k36, k02 }, \ + { k19, k20, k21, k42, k18, k16, k15, k14, k41, k17 }, \ + { k06, k07, k08, k10, KC_NO, k05, k04, k03, k01, KC_NO } \ } -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \ - k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \ - k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \ - k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \ -) \ -{ \ - { k43, k45, k34, k11, k23, k40, k38, k25, k00, k12 }, \ - { k31, k44, k46, k35, k22, k28, k39, k37, k24, k13 }, \ - { k30, k32, k33, k47, k09, k29, k27, k26, k36, k02 }, \ - { k19, k20, k21, k42, k18, k16, k15, k14, k41, k17 }, \ - { k06, k07, k08, k10, KC_NO, k05, k04, k03, k01, KC_NO }, \ +#define LAYOUT_kc_ortho_4x12( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, \ + k12, k13, k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, \ + k24, k25, k26, k27, k28, k29, k30, k31, k32, k33, k34, k35, \ + k36, k37, k38, k39, k40, k41, k42, k43, k44, k45, k46, k47 \ + ) { \ + { KC_##k43, KC_##k45, KC_##k34, KC_##k11, KC_##k23, KC_##k40, KC_##k38, KC_##k25, KC_##k00, KC_##k12 }, \ + { KC_##k31, KC_##k44, KC_##k46, KC_##k35, KC_##k22, KC_##k28, KC_##k39, KC_##k37, KC_##k24, KC_##k13 }, \ + { KC_##k30, KC_##k32, KC_##k33, KC_##k47, KC_##k09, KC_##k29, KC_##k27, KC_##k26, KC_##k36, KC_##k02 }, \ + { KC_##k19, KC_##k20, KC_##k21, KC_##k42, KC_##k18, KC_##k16, KC_##k15, KC_##k14, KC_##k41, KC_##k17 }, \ + { KC_##k06, KC_##k07, KC_##k08, KC_##k10, KC_NO, KC_##k05, KC_##k04, KC_##k03, KC_##k01, KC_NO } \ } diff --git a/keyboards/chimera_ls/info.json b/keyboards/chimera_ls/info.json new file mode 100644 index 0000000000..077a760796 --- /dev/null +++ b/keyboards/chimera_ls/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Chimera LS", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}] + } + } +} diff --git a/keyboards/chimera_ls/keymaps/default/keymap.c b/keyboards/chimera_ls/keymaps/default/keymap.c index 493b8eee15..0affeef389 100644 --- a/keyboards/chimera_ls/keymaps/default/keymap.c +++ b/keyboards/chimera_ls/keymaps/default/keymap.c @@ -1,7 +1,7 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ls.h" +#include QMK_KEYBOARD_H // 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. @@ -24,168 +24,163 @@ enum chimera_lets_split_layers #define KC_SCTR MT(MOD_LCTL, KC_RBRC) #define KC_SPLT MT(MOD_LALT, KC_MINS) #define KC_MESC LT(_MACROS, KC_ESC) -#define KC_INCL M(0) -#define KC_PULL M(1) -#define KC_PUSH M(2) -#define KC_SCAP M(3) -#define KC_SCOF M(4) #define KC_CAD LALT(LCTL(KC_DEL)) +enum custom_keycodes { + KC_INCL = SAFE_RANGE, + KC_PULL, + KC_PUSH, + KC_SCAP, + KC_SCOF +}; + #define LONGPRESS_DELAY 150 //#define LAYER_TOGGLE_DELAY 300 -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - MESC, Q , W , E , R , T , Y , U , I , O , P ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB , A , S , D , F , G , H , J , K , L ,SCLN, ENT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSPO, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - SCTL,SPFN,SPLT,AMPR,NMPD,SPC , SPC ,SYMB,ASTR,EXLM,LBRC,SCTR - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_QWERTY] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + KC_MESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_SCTL, KC_SPFN, KC_SPLT, KC_AMPR, KC_NMPD, KC_SPC, KC_SPC, KC_SYMB, KC_ASTR, KC_EXLM, KC_LBRC, KC_SCTR + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), - [_CAPS] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , ,COLN, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , ,UNDS, , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_CAPS] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), - [_NUMPAD] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , 7 , 8 , 9 ,MINS,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , 4 , 5 , 6 ,PLUS, ENT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, , , , , , , 1 , 2 , 3 ,ASTR, EQL, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,BSPC, SPC , 0 , 0 , DOT,SLSH, - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_NUMPAD] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_ENT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_LSFT, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_ASTR, KC_EQL, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, KC_BSPC, KC_SPC, KC_0, KC_0, KC_DOT, KC_SLSH, _______ + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), - [_SYMBOLS] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F1 , F2 , F3 , F4 , F5 , F6 , TILD,EQL ,UNDS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - F7 , F8 , F9 , F10, F11, F12, GRV ,PLUS,MINS,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , NO ,BSPC, SPC , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_SYMBOLS] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_QUOT, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TILD, KC_EQL, KC_UNDS, KC_LCBR, KC_RCBR, KC_PIPE, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, KC_PLUS, KC_MINS, KC_LBRC, KC_RBRC, KC_BSLS, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, XXXXXXX, KC_BSPC, KC_SPC, _______, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), - [_NAV] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , DEL,BSPC, ,HOME, UP , END, INS,PSCR, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , ,LSFT,LCTL, ENT, ,LEFT,DOWN,RGHT, DEL, , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , ,PGUP,PGDN, , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , ,DEL , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_NAV] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, KC_DEL, KC_BSPC, _______, KC_HOME, KC_UP, KC_END, KC_INS, KC_PSCR, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), - [_MACROS] = KC_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - , , , , , , , ,INCL, , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , ,CAD , , , , , , , , , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - SCAP, , , , , , , ,PULL,PUSH, ,SCAP, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , , , , , , , , , , , - //`----+----+----+----+----+----' `----+----+----+----+----+----' + [_MACROS] = LAYOUT_ortho_4x12( + //,--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------. + _______, _______, _______, _______, _______, _______, _______, _______, KC_INCL, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, KC_CAD, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + KC_SCAP, _______, _______, _______, _______, _______, _______, _______, KC_PULL, KC_PUSH, _______, KC_SCAP, + //|--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------' `--------+--------+--------+--------+--------+--------' ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { /* include some kind of library or header */ - case 0: + case KC_INCL: if (record->event.pressed) { - SEND_STRING("#include <>"); - return MACRO( T(LEFT), END); + SEND_STRING("#include <>" SS_TAP(X_LEFT) ); + return false; } break; - case 1: + case KC_PULL: if (record->event.pressed) { - SEND_STRING("git pull"); - return MACRO( T(ENT), END ); + SEND_STRING("git pull" SS_TAP(X_ENTER) ); + return false; } break; - case 2: + case KC_PUSH: if (record->event.pressed){ - SEND_STRING("git push"); - return MACRO( T(ENT), END ); + SEND_STRING("git push" SS_TAP(X_ENTER) ); + return false; } break; - case 3: + case KC_SCAP: if (record->event.pressed){ layer_on(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); + return false; } break; - case 4: + case KC_SCOF: if (record->event.pressed){ layer_off(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); + return false; } break; } - return MACRO_NONE; + return true; }; - + void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - - switch (layer) { - case _QWERTY: - set_led_green; - break; - case _CAPS: - set_led_white; - break; - case _NUMPAD: - set_led_blue; - break; - case _SYMBOLS: - set_led_red; - break; - case _NAV: - set_led_magenta; - break; - case _MACROS: - set_led_cyan; - break; - default: - set_led_green; - break; - } + uint8_t layer = biton32(layer_state); + + switch (layer) { + case _QWERTY: + set_led_green; + break; + case _CAPS: + set_led_white; + break; + case _NUMPAD: + set_led_blue; + break; + case _SYMBOLS: + set_led_red; + break; + case _NAV: + set_led_magenta; + break; + case _MACROS: + set_led_cyan; + break; + default: + set_led_green; + break; + } }; diff --git a/keyboards/chimera_ls/readme.md b/keyboards/chimera_ls/readme.md index 689d9ee614..0170dd8a8f 100644 --- a/keyboards/chimera_ls/readme.md +++ b/keyboards/chimera_ls/readme.md @@ -2,18 +2,14 @@ ![Chimera LS](https://imgur.com/FOGlO4M.jpg) -A wireless version of the let's split: a split 40% ortholinear keyboard +A wireless version of the Let's Split: a split 40% ortholinear keyboard. Keyboard Maintainer: [William Wilson](https://github.com/GlenPickle) - - -Hardware Supported: Chimera LS PCB, WaveShare core nRF51822 - +Hardware Supported: Chimera LS PCB, WaveShare core nRF51822 Hardware Availability: [Gerbers](https://github.com/GlenPickle/Chimera/tree/master/ls/gerbers) Make example for this keyboard (after setting up your build environment): make chimera_ls:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - +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/chimera_ls/rules.mk b/keyboards/chimera_ls/rules.mk index af08f7a879..497e58677e 100644 --- a/keyboards/chimera_ls/rules.mk +++ b/keyboards/chimera_ls/rules.mk @@ -46,7 +46,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -80,3 +80,5 @@ UNICODE_ENABLE = YES # Unicode # BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID USB = /dev/ttyACM0 + +LAYOUTS = ortho_4x12 -- cgit v1.2.3 From 8421a898209da6bbebddfbc93e4c10af878130a9 Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Mon, 22 Oct 2018 23:20:31 +0200 Subject: added ASCII representation to dz60 iso-split layout and adjusted it so that it's consistent with the other layouts. (#4207) --- keyboards/dz60/dz60.h | 42 ++++++++++++++++++++++++++++-------------- keyboards/dz60/info.json | 8 ++++---- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 36ddb7ade1..2cf2eec7a0 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -196,20 +196,6 @@ { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } -// iso split -#define LAYOUT_60_iso_split( \ - K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, \ - K100, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, \ - K200, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, \ - K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K313, \ - K400, K401, K403, K404, K406, K408, K410, K411, K413, K414 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, K014 }, \ - { K100, KC_NO, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114 }, \ - { K200, KC_NO, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, KC_NO }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO, K313, KC_NO }, \ - { K400, K401, KC_NO, K403, K404, KC_NO, K406, KC_NO, K408, KC_NO, K410, K411, KC_NO, K413, K414 } \ -} /* LAYOUT_60_iso_5x1u * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ @@ -238,6 +224,33 @@ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_iso_split + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┐2d │ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │1e │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┴────┤ + * │30 │31 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┼───┴┬──┴─┬─┴───┴──┬┴───┼───┴───┴──┬┴───┼───┴┬────┬────┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────┴────┴──────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_iso_split( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k1e, k2d, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + /* LAYOUT_60_b_ansi (maximized DZ60 Plate B layout for ANSI) * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ @@ -292,4 +305,5 @@ { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } + #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 1f621360bf..a163cc6a46 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -28,10 +28,6 @@ "LAYOUT_60_iso": { "key_count": 62, "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_iso_split": { - "key_count": 64, - "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, "LAYOUT_60_hhkb": { "key_count": 60, @@ -41,6 +37,10 @@ "key_count": 63, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"|", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"~", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"/", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Fn", "x":10, "y":4}, {"label":"←", "x":11, "y":4}, {"label":"↓", "x":12, "y":4}, {"label":"↑", "x":13, "y":4}, {"label":"→", "x":14, "y":4}] }, + "LAYOUT_60_iso_split": { + "key_count": 64, + "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_b_ansi": { "key_count": 66, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"\\", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"Alt", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] -- cgit v1.2.3 From 95619bdaca2c48156b4749270199d4a50437f44e Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 14:39:11 -0700 Subject: Fix file location for mmacdougal's keymap --- keyboards/levinson/keymaps/mmacdougall/config.h | 20 ++ keyboards/levinson/keymaps/mmacdougall/keymap.c | 201 +++++++++++++++++++++ .../levinson/keymaps/mmacdougall/keymap/config.h | 20 -- .../levinson/keymaps/mmacdougall/keymap/keymap.c | 201 --------------------- .../levinson/keymaps/mmacdougall/keymap/rules.mk | 2 - keyboards/levinson/keymaps/mmacdougall/rules.mk | 2 + 6 files changed, 223 insertions(+), 223 deletions(-) create mode 100644 keyboards/levinson/keymaps/mmacdougall/config.h create mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap.c delete mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/config.h delete mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c delete mode 100644 keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk create mode 100644 keyboards/levinson/keymaps/mmacdougall/rules.mk diff --git a/keyboards/levinson/keymaps/mmacdougall/config.h b/keyboards/levinson/keymaps/mmacdougall/config.h new file mode 100644 index 0000000000..63dd5bc88f --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/config.h @@ -0,0 +1,20 @@ +#pragma once + +/* 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/levinson/keymaps/mmacdougall/keymap.c b/keyboards/levinson/keymaps/mmacdougall/keymap.c new file mode 100644 index 0000000000..dec47a7616 --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/keymap.c @@ -0,0 +1,201 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + BL_STEP, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/mmacdougall/keymap/config.h b/keyboards/levinson/keymaps/mmacdougall/keymap/config.h deleted file mode 100644 index 63dd5bc88f..0000000000 --- a/keyboards/levinson/keymaps/mmacdougall/keymap/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once - -/* 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/levinson/keymaps/mmacdougall/keymap/keymap.c b/keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c deleted file mode 100644 index dec47a7616..0000000000 --- a/keyboards/levinson/keymaps/mmacdougall/keymap/keymap.c +++ /dev/null @@ -1,201 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Dvorak - * ,-----------------------------------------------------------------------------------. - * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT_ortho_4x12( \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | | \ | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT_ortho_4x12( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT_ortho_4x12( \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |B Step|RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_ortho_4x12( \ - _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - BL_STEP, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - set_single_persistent_default_layer(_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } - return true; -} diff --git a/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk b/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk deleted file mode 100644 index d7463419b4..0000000000 --- a/keyboards/levinson/keymaps/mmacdougall/keymap/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -RGBLIGHT_ENABLE = yes -BACKLIGHT_ENABLE = yes diff --git a/keyboards/levinson/keymaps/mmacdougall/rules.mk b/keyboards/levinson/keymaps/mmacdougall/rules.mk new file mode 100644 index 0000000000..d7463419b4 --- /dev/null +++ b/keyboards/levinson/keymaps/mmacdougall/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes -- cgit v1.2.3 From cb1e45b4efdc685134c0dbc35100e2fb99c5b006 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 14:07:18 -0700 Subject: Include quantum.h to fix travis CI errors --- keyboards/dz60/keymaps/marianas/keymap.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/dz60/keymaps/marianas/keymap.h b/keyboards/dz60/keymaps/marianas/keymap.h index 01de5c6e2c..00e51cea2c 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.h +++ b/keyboards/dz60/keymaps/marianas/keymap.h @@ -1,3 +1,5 @@ +#include "quantum.h" + //Control #define MO_FNLR MO(FN_LAYER) #define BACKSPC KC_BSPC -- cgit v1.2.3 From 572c316e7dfb0bcd495ce09e068078593fd4ec82 Mon Sep 17 00:00:00 2001 From: Scott Gorsuch Date: Tue, 23 Oct 2018 12:29:35 -0400 Subject: Keymap: Fix missing 4 key (#4219) --- keyboards/iris/keymaps/dbroqua/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/iris/keymaps/dbroqua/keymap.c b/keyboards/iris/keymaps/dbroqua/keymap.c index eed288c50d..4cbb8af540 100644 --- a/keyboards/iris/keymaps/dbroqua/keymap.c +++ b/keyboards/iris/keymaps/dbroqua/keymap.c @@ -49,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----+-----+-----+-----+-----+-----+ ,-----+-----+-----+-----+-----+-----+ * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | BSPC| * |-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ - * | RST | 1 | 2 | 3 | 5 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * | RST | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | * +-----+-----+-----+-----+-----+-----+ +-----+-----+-----+-----+-----+-----+ * | DEL | | LEFT| RGHT| UP | [ | | ] | 4 | 5 | 6 | + | | | * +-----+-----+-----+-----+-----+-----+-----. ,-----+-----+-----+-----+-----+-----+-----+ -- cgit v1.2.3 From 03d16db942fe0352cc3b3522a1c778b7e60a4b3a Mon Sep 17 00:00:00 2001 From: Peter Roe Date: Tue, 23 Oct 2018 13:52:57 -0500 Subject: Keyboard: Ported ADB-to-USB converter from TMK to QMK (#3931) * Ported ADB-to-USB converter from TMK to QMK * Updated pull request with reviewer suggestions. * Removed precompiled header file type (gch) from gitignore per reviewer request * Update keyboards/converter/adb_usb/matrix.c Changed instances of matrix_init_quantum to matrix_scan_quantum. * Update keyboards/converter/adb_usb/matrix.c Co-Authored-By: 13-bit --- keyboards/converter/adb_usb/README.md | 83 +++++++ keyboards/converter/adb_usb/adb_usb.c | 3 + keyboards/converter/adb_usb/adb_usb.h | 109 +++++++++ keyboards/converter/adb_usb/config.h | 43 ++++ keyboards/converter/adb_usb/keymaps/13bit/keymap.c | 26 ++ .../converter/adb_usb/keymaps/default/keymap.c | 13 + keyboards/converter/adb_usb/led.c | 27 +++ keyboards/converter/adb_usb/led.h | 43 ++++ keyboards/converter/adb_usb/matrix.c | 267 +++++++++++++++++++++ keyboards/converter/adb_usb/rules.mk | 73 ++++++ 10 files changed, 687 insertions(+) create mode 100644 keyboards/converter/adb_usb/README.md create mode 100644 keyboards/converter/adb_usb/adb_usb.c create mode 100644 keyboards/converter/adb_usb/adb_usb.h create mode 100644 keyboards/converter/adb_usb/config.h create mode 100644 keyboards/converter/adb_usb/keymaps/13bit/keymap.c create mode 100644 keyboards/converter/adb_usb/keymaps/default/keymap.c create mode 100644 keyboards/converter/adb_usb/led.c create mode 100644 keyboards/converter/adb_usb/led.h create mode 100644 keyboards/converter/adb_usb/matrix.c create mode 100644 keyboards/converter/adb_usb/rules.mk diff --git a/keyboards/converter/adb_usb/README.md b/keyboards/converter/adb_usb/README.md new file mode 100644 index 0000000000..ed71750080 --- /dev/null +++ b/keyboards/converter/adb_usb/README.md @@ -0,0 +1,83 @@ +ADB-to USB Keyboard Converter +============================= +This firmware converts Apple Desktop Bus (ADB) keyboard protocol to USB so that you can use an ADB keyboard on a modern computer. It works on the PJRC Teensy 2.0 and other USB AVR MCUs (ATMega32U4, AT90USB64/128, etc) and needs at least 10KB of flash memory. + + +This is a port of the TMK ADB-to-USB converter to QMK. For information on QMK, please consult the following: +https://github.com/qmk/qmk_firmware +https://docs.qmk.fm + + +Wiring +------ +Connect the VCC, GND, and DATA lines of the ADB keyboard to the controller (Teensy 2.0 or similar). By default the DATA line uses port PD0. The Power SW line is unused by the converter. + +ADB female socket from the front: + + ,--_--. + / o4 3o \ 1: DATA + | o2 1o | 2: Power SW + - === - 3: VCC + `-___-' 4: GND + +This converter uses AVR's internal pull-up, but it seems to be too weak, in particular when you want to use a long or coiled cable. Using an external pull-up resistor (1K-10K Ohm) between the DATA and VCC lines is strongly recommended. + +Pull-up resistor: + + Keyboard Converter + ,------. + 5V------+------|VCC | + | | | + [R] | | + | | | + Signal--+------|PD0 | + | | + GND------------|GND | + `------' + R: 1K Ohm resistor + + +Define following macros for ADB connection in config.h if you use other than port PD0. + + ADB_PORT, ADB_PIN, ADB_DDR, ADB_DATA_BIT + + +Building the Firmware +------------------------------------------ +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). + + +Keymap +------ +To build the default keymap run this command: + + $ make converter/adb_usb:default + +You may add your own keymap to the converter/adb_usb/keymaps directory, as you would with any other QMK-powered keyboard. + +To build your custom keymap, change the build command to: + + $ make converter/adb_usb:my_keymap + +Where 'my_keymap' is the name of your custom keymap directory. + + +Locking Caps Lock +---------------- +Many old ADB keyboards use a locking switch for the caps lock key. This converter supports the locking caps lock key by default. + + +Notes +----- +Non-extended ADB keyboards make no distinction between the left and right modifiers, +i.e. the keycode for the left modifier will be sent even if the right modifier + +The Apple Extended Keyboard and Apple Extended Keyboard II can differentiate between the left and right modifiers except for the GUI key (Windows/Command). + +Most ADB keyboards have no diodes in its matrix so they are not NKRO, +though the ADB protocol itself supports it. See protocol/adb.c for more info. + + +QMK Port Changelog +--------- +- 2018/09/16 - Initial release. diff --git a/keyboards/converter/adb_usb/adb_usb.c b/keyboards/converter/adb_usb/adb_usb.c new file mode 100644 index 0000000000..7026d62751 --- /dev/null +++ b/keyboards/converter/adb_usb/adb_usb.c @@ -0,0 +1,3 @@ +#include "adb_usb.h" +#include +#include "quantum.h" diff --git a/keyboards/converter/adb_usb/adb_usb.h b/keyboards/converter/adb_usb/adb_usb.h new file mode 100644 index 0000000000..491db95f1c --- /dev/null +++ b/keyboards/converter/adb_usb/adb_usb.h @@ -0,0 +1,109 @@ +/* +Copyright 2011,2012,2013 Jun Wako + +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 . + +Ported to QMK by Peter Roe +*/ + +#ifndef KEYMAP_COMMON_H +#define KEYMAP_COMMON_H + +#include "quantum.h" + +/* M0115/M3501 Apple Extended Keyboard ANSI + * ,---. ,---------------. ,---------------. ,---------------. ,-----------. ,---. + * |Esc| |F1 |F2 |F3 |F4 | |F5 |F6 |F7 |F8 | |F9 |F10|F11|F12| |PrS|ScL|Pau| |Pwr| + * `---' `---------------' `---------------' `---------------' `-----------' `---' + * ,-----------------------------------------------------------. ,-----------. ,---------------. + * | `| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backspa| |Ins|Hom|PgU| |NmL| =| /| *| + * |-----------------------------------------------------------| |-----------| |---------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| |Del|End|PgD| | 7| 8| 9| -| + * |-----------------------------------------------------------| `-----------' |---------------| + * |CapsLo| A| S| D| F| G| H| J| K| L| ;| '|Return | | 4| 5| 6| +| + * |-----------------------------------------------------------| ,---. |---------------| + * |Shift | Z| X| C| V| B| N| M| ,| ,| /|Shift | |Up | | 1| 2| 3| | + * |-----------------------------------------------------------| ,-----------. |-----------|Ent| + * |Ctrl |Opt |Cmd | Space | |Opt |Ctrl | |Lef|Dow|Rig| | 0| .| | + * `-----------------------------------------------------------' `-----------' `---------------' + */ +#define LAYOUT_ext_ansi( \ + K35, K7A,K78,K63,K76,K60,K61,K62,K64,K65,K6D,K67,K6F, K69,K6B,K71, K7F, \ + K32,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K72,K73,K74, K47,K51,K4B,K43, \ + K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E,K2A, K75,K77,K79, K59,K5B,K5C,K4E, \ + K39,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K45, \ + K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K3E, K53,K54,K55, \ + K36,K3A,K37, K31, K7C,K7D, K3B,K3D,K3C, K52, K41,K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, KC_NO, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, KC_NO, K35, K36, K37 }, \ + { K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO, }, \ + { KC_NO, K41, KC_NO, K43, KC_NO, K45, KC_NO, K47 }, \ + { KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO, }, \ + { KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \ + { K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO, }, \ + { K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \ + { KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \ + { K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \ +} + +/* M0116 Apple Standard Keyboard ANSI + * +-------+ + * | power | + * +-------+ + * +---+---+---+---+---+---+---+---+---+---+---+---+---+-----+ +---+---+---+---+ + * |esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | bks | |clr| = | / | * | + * +---------------------------------------------------------+ +---+---+---+---+ + * | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | | | 7 | 8 | 9 | + | + * +-----------------------------------------------------+ | +---+---+---+---+ + * | ctrl | a | s | d | f | g | h | j | k | l | ; | ' |return| | 4 | 5 | 6 | - | + * +---------------------------------------------------------+ +---+---+---+---+ + * | shift | z | x | c | v | b | n | m | , | . | / | shift | | 1 | 2 | 3 | | + * +---------------------------------------------------------+ +-------+---|ent| + * |cap|opt|comnd| ` | | \ |lef|rig|dwn|up | | 0 | . | | + * +---------------------------------------------------------+ +-------+---+---+ + */ +#define LAYOUT_m0116_ansi( \ + K7F, \ + K35,K12,K13,K14,K15,K17,K16,K1A,K1C,K19,K1D,K1B,K18,K33, K47,K51,K4B,K43, \ + K30,K0C,K0D,K0E,K0F,K11,K10,K20,K22,K1F,K23,K21,K1E, K59,K5B,K5C,K45, \ + K36,K00,K01,K02,K03,K05,K04,K26,K28,K25,K29,K27, K24, K56,K57,K58,K4E, \ + K38,K06,K07,K08,K09,K0B,K2D,K2E,K2B,K2F,K2C, K7B, K53,K54,K55, \ + K39,K3A,K37,K32, K31, K2A,K3B,K3C,K3D,K3E, K52, K41,K4C \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K08, K09, KC_NO, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, KC_NO, K35, K36, K37 }, \ + { K38, K39, K3A, K3B, K3C, K3D, K3E, KC_NO }, \ + { KC_NO, K41, KC_NO, K43, KC_NO, K45, KC_NO, K47 }, \ + { KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO }, \ + { KC_NO, K51, K52, K53, K54, K55, K56, K57 }, \ + { K58, K59, KC_NO, K5B, K5C, 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, KC_NO, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, K7B, KC_NO, KC_NO, KC_NO, K7F } \ +} + +#endif diff --git a/keyboards/converter/adb_usb/config.h b/keyboards/converter/adb_usb/config.h new file mode 100644 index 0000000000..a5845a0290 --- /dev/null +++ b/keyboards/converter/adb_usb/config.h @@ -0,0 +1,43 @@ +/* +Copyright 2011 Jun Wako + +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 . + +Ported to QMK by Peter Roe +*/ + +#pragma once + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0ADB +#define DEVICE_VER 0x0101 +#define MANUFACTURER QMK +#define PRODUCT ADB keyboard converter +#define DESCRIPTION Convert ADB keyboard to USB + +/* matrix size */ +#define MATRIX_ROWS 16 // keycode bit: 3-0 +#define MATRIX_COLS 8 // keycode bit: 6-4 + +/* 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 + +/* ADB port setting */ +#define ADB_PORT PORTD +#define ADB_PIN PIND +#define ADB_DDR DDRD +#define ADB_DATA_BIT 0 +//#define ADB_PSW_BIT 1 // optional diff --git a/keyboards/converter/adb_usb/keymaps/13bit/keymap.c b/keyboards/converter/adb_usb/keymaps/13bit/keymap.c new file mode 100644 index 0000000000..3b36a20c25 --- /dev/null +++ b/keyboards/converter/adb_usb/keymaps/13bit/keymap.c @@ -0,0 +1,26 @@ +#include QMK_KEYBOARD_H + +#define MCTL LCTL(KC_UP) +#define SCST LSFT(LGUI(KC_4)) +#define SLP LALT(LGUI(KC_EJCT)) + +#define APP1 LSFT(LALT(LCTL(LGUI(KC_1)))) +#define APP2 LSFT(LALT(LCTL(LGUI(KC_2)))) +#define APP3 LSFT(LALT(LCTL(LGUI(KC_3)))) +#define APP4 LSFT(LALT(LCTL(LGUI(KC_4)))) +#define APP5 LSFT(LALT(LCTL(LGUI(KC_5)))) +#define APP6 LSFT(LALT(LCTL(LGUI(KC_6)))) +#define APP7 LSFT(LALT(LCTL(LGUI(KC_7)))) +#define APP8 LSFT(LALT(LCTL(LGUI(KC_8)))) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ext_ansi( + KC_ESC, APP1, APP2, APP3, APP4, APP5, APP6, APP7, APP8, MCTL, KC_MUTE, KC_VOLD, KC_VOLU, SCST, KC_SLCK, KC_PAUS, SLP, + 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_EQL, KC_PSLS, KC_PAST, + 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_PMNS, + KC_LCAP, 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), +}; diff --git a/keyboards/converter/adb_usb/keymaps/default/keymap.c b/keyboards/converter/adb_usb/keymaps/default/keymap.c new file mode 100644 index 0000000000..6b63c1a3c1 --- /dev/null +++ b/keyboards/converter/adb_usb/keymaps/default/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ext_ansi( + 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_EJCT, + 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_EQL, KC_PSLS, KC_PAST, + 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_PMNS, + KC_LCAP, 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_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), +}; diff --git a/keyboards/converter/adb_usb/led.c b/keyboards/converter/adb_usb/led.c new file mode 100644 index 0000000000..ea9bf77b5c --- /dev/null +++ b/keyboards/converter/adb_usb/led.c @@ -0,0 +1,27 @@ +/* +Copyright 2011 Jun Wako + +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 . +*/ + +#include +#include +#include "adb.h" +#include "led.h" + + +void led_set(uint8_t usb_led) +{ + adb_host_kbd_led(ADB_ADDR_KEYBOARD, ~usb_led); +} diff --git a/keyboards/converter/adb_usb/led.h b/keyboards/converter/adb_usb/led.h new file mode 100644 index 0000000000..19952fae2a --- /dev/null +++ b/keyboards/converter/adb_usb/led.h @@ -0,0 +1,43 @@ +/* +Copyright 2011 Jun Wako + +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 . + +Ported to QMK by Peter Roe +*/ + +#ifndef LED_H +#define LED_H +#include "stdint.h" + + +/* keyboard LEDs */ +#define USB_LED_NUM_LOCK 0 +#define USB_LED_CAPS_LOCK 1 +#define USB_LED_SCROLL_LOCK 2 +#define USB_LED_COMPOSE 3 +#define USB_LED_KANA 4 + + +#ifdef __cplusplus +extern "C" { +#endif + +void led_set(uint8_t usb_led); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/keyboards/converter/adb_usb/matrix.c b/keyboards/converter/adb_usb/matrix.c new file mode 100644 index 0000000000..8ee48bf23f --- /dev/null +++ b/keyboards/converter/adb_usb/matrix.c @@ -0,0 +1,267 @@ +/* +Copyright 2011 Jun Wako + +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 . + +Ported to QMK by Peter Roe +*/ + +#include +#include +#include +#include +#include "print.h" +#include "util.h" +#include "debug.h" +#include "adb.h" +#include "matrix.h" +#include "report.h" +#include "host.h" +#include "led.h" +#include "timer.h" + +static bool is_iso_layout = false; + +// matrix state buffer(1:on, 0:off) +static matrix_row_t matrix[MATRIX_ROWS]; + +static void register_key(uint8_t key); + +__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) { +} + +void matrix_init(void) +{ + // LED on + DDRD |= (1<<6); PORTD |= (1<<6); + + adb_host_init(); + // wait for keyboard to boot up and receive command + _delay_ms(2000); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + + led_set(host_keyboard_leds()); + + // debug_enable = false; + // debug_matrix = true; + // debug_keyboard = true; + // debug_mouse = true; + // print("debug enabled.\n"); + + // LED off + DDRD |= (1<<6); PORTD &= ~(1<<6); + matrix_init_quantum(); +} + +#ifdef ADB_MOUSE_ENABLE + +#ifdef MAX +#undef MAX +#endif +#define MAX(X, Y) ((X) > (Y) ? (X) : (Y)) + +static report_mouse_t mouse_report = {}; + +void adb_mouse_task(void) +{ + uint16_t codes; + int16_t x, y; + static int8_t mouseacc; + + /* tick of last polling */ + static uint16_t tick_ms; + + // polling with 12ms interval + if (timer_elapsed(tick_ms) < 12) return; + tick_ms = timer_read(); + + codes = adb_host_mouse_recv(); + // If nothing received reset mouse acceleration, and quit. + if (!codes) { + mouseacc = 1; + return; + }; + // Bit sixteen is button. + if (~codes & (1 << 15)) + mouse_report.buttons |= MOUSE_BTN1; + if (codes & (1 << 15)) + mouse_report.buttons &= ~MOUSE_BTN1; + // lower seven bits are movement, as signed int_7. + // low byte is X-axis, high byte is Y. + y = (codes>>8 & 0x3F); + x = (codes>>0 & 0x3F); + // bit seven and fifteen is negative + // usb does not use int_8, but int_7 (measuring distance) with sign-bit. + if (codes & (1 << 6)) + x = (x-0x40); + if (codes & (1 << 14)) + y = (y-0x40); + // Accelerate mouse. (They weren't meant to be used on screens larger than 320x200). + x *= mouseacc; + y *= mouseacc; + // Cap our two bytes per axis to one byte. + // Easier with a MIN-function, but since -MAX(-a,-b) = MIN(a,b)... + // I.E. MIN(MAX(x,-127),127) = -MAX(-MAX(x, -127), -127) = MIN(-MIN(-x,127),127) + mouse_report.x = -MAX(-MAX(x, -127), -127); + mouse_report.y = -MAX(-MAX(y, -127), -127); + if (debug_mouse) { + print("adb_host_mouse_recv: "); print_bin16(codes); print("\n"); + print("adb_mouse raw: ["); + phex(mouseacc); print(" "); + phex(mouse_report.buttons); print("|"); + print_decs(mouse_report.x); print(" "); + print_decs(mouse_report.y); print("]\n"); + } + // Send result by usb. + host_mouse_send(&mouse_report); + // increase acceleration of mouse + mouseacc += ( mouseacc < ADB_MOUSE_MAXACC ? 1 : 0 ); + return; +} +#endif + +uint8_t matrix_scan(void) +{ + /* extra_key is volatile and more convoluted than necessary because gcc refused + to generate valid code otherwise. Making extra_key uint8_t and constructing codes + here via codes = extra_key<<8 | 0xFF; would consistently fail to even LOAD + extra_key from memory, and leave garbage in the high byte of codes. I tried + dozens of code variations and it kept generating broken assembly output. So + beware if attempting to make extra_key code more logical and efficient. */ + static volatile uint16_t extra_key = 0xFFFF; + uint16_t codes; + uint8_t key0, key1; + + /* tick of last polling */ + static uint16_t tick_ms; + + codes = extra_key; + extra_key = 0xFFFF; + + if ( codes == 0xFFFF ) + { + // polling with 12ms interval + if (timer_elapsed(tick_ms) < 12) return 0; + tick_ms = timer_read(); + + codes = adb_host_kbd_recv(); + } + + key0 = codes>>8; + key1 = codes&0xFF; + + if (debug_matrix && codes) { + print("adb_host_kbd_recv: "); phex16(codes); print("\n"); + } + + if (codes == 0) { // no keys + return 0; + } else if (codes == 0x7F7F) { // power key press + register_key(0x7F); + } else if (codes == 0xFFFF) { // power key release + register_key(0xFF); + } else if (key0 == 0xFF) { // error + xprintf("adb_host_kbd_recv: ERROR(%d)\n", codes); + // something wrong or plug-in + matrix_init(); + return key1; + } else { + /* Swap codes for ISO keyboard + * https://github.com/tmk/tmk_keyboard/issues/35 + * + * ANSI + * ,----------- ----------. + * | *a| 1| 2 =|Backspa| + * |----------- ----------| + * |Tab | Q| | ]| *c| + * |----------- ----------| + * |CapsLo| A| '|Return | + * |----------- ----------| + * |Shift | Shift | + * `----------- ----------' + * + * ISO + * ,----------- ----------. + * | *a| 1| 2 =|Backspa| + * |----------- ----------| + * |Tab | Q| | ]|Retur| + * |----------- -----` | + * |CapsLo| A| '| *c| | + * |----------- ----------| + * |Shif| *b| Shift | + * `----------- ----------' + * + * ADB scan code USB usage + * ------------- --------- + * Key ANSI ISO ANSI ISO + * --------------------------------------------- + * *a 0x32 0x0A 0x35 0x35 + * *b ---- 0x32 ---- 0x64 + * *c 0x2A 0x2A 0x31 0x31(or 0x32) + */ + if (is_iso_layout) { + if ((key0 & 0x7F) == 0x32) { + key0 = (key0 & 0x80) | 0x0A; + } else if ((key0 & 0x7F) == 0x0A) { + key0 = (key0 & 0x80) | 0x32; + } + } + register_key(key0); + if (key1 != 0xFF) // key1 is 0xFF when no second key. + extra_key = key1<<8 | 0xFF; // process in a separate call + } + + matrix_scan_quantum(); + return 1; +} + +void matrix_print(void){ + +} + +inline +matrix_row_t matrix_get_row(uint8_t row) +{ + return matrix[row]; +} + +inline +static void register_key(uint8_t key) +{ + uint8_t col, row; + col = key&0x07; + row = (key>>3)&0x0F; + if (key&0x80) { + matrix[row] &= ~(1< Date: Tue, 23 Oct 2018 14:00:54 -0500 Subject: keymap for 1upkeyboards/sweet16 multilayers rgb lighting and tapdance (#4208) * keymap for 1upkeyboards/sweet16 multilayers rgb lighting and tapdance * Update config.h typo * cleanup Co-Authored-By: ridingintraffic * layers are using layout macro replaced the include guard (the ifndef, define, and endif at the end) with just #pragma once changed undergrow to use layer-change-code emoji macros are using send_hex_code_string cleaned up the includes * tap() removed maxtrix_scan_user updated conf.h cleanup --- .../sweet16/keymaps/ridingintraffic/config.h | 15 ++ .../sweet16/keymaps/ridingintraffic/keymap.c | 215 +++++++++++++++++++++ .../sweet16/keymaps/ridingintraffic/readme.md | 10 + .../sweet16/keymaps/ridingintraffic/rules.mk | 5 + 4 files changed, 245 insertions(+) create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md create mode 100644 keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h new file mode 100644 index 0000000000..c835440076 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/config.h @@ -0,0 +1,15 @@ +#pragma once + +/* tap dance stuff*/ +#undef TAPPING_TERM +#define TAPPING_TERM 500 + +#define TAPPING_TOGGLE 2 + +#define EXAMPLESTRING1 "tapdance_1" +#define EXAMPLESTRING2 "tapdance_2" +#define EXAMPLESTRING3 "tapdance_3" +#define EXAMPLESTRING4 "tapdance_4" + +#undef RGBLED_NUM +#define RGBLED_NUM 16 \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c new file mode 100644 index 0000000000..ad9786ba7f --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/keymap.c @@ -0,0 +1,215 @@ +/* +tap danc eis turned on in the rules now... +*/ +#include QMK_KEYBOARD_H + +#define _EMOJI 0 +#define _TAPLAND 1 +#define _LEDCNTL 2 + +enum custom_keycodes { + SHRUG, + DISFACE, + FU, + TFLIP, + TFLIP2, + SAD_EYES, + TPUT, + HAPPYFACE, + HEARTFACE, + CLOUD, + CHANFACE, + CMDCLEAR +}; +//Tap Dance Declarations +enum { + TD_EXAMPLE1 = 0, + TD_EXAMPLE2, + TD_EXAMPLE3, + TD_EXAMPLE4 +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* EMOJI Pad + * ,-------------------------------. + * |TFLIP | TFlIP2|DISFACE| FU | + * |------+-------+-------+--------| + * | CLOUD| | | CLEAR | + * |------+-------+-------+--------| + * |SHRUG |DISFACE| HRTFAC| HAPPYF | + * |------+-------+-------+--------| + * | ENTER| |LEDCNTR| tapland| + * `-------------------------------' + */ + //purple + [_EMOJI] = LAYOUT_ortho_4x4( + TFLIP, TFLIP2, KC_NO, FU , + CLOUD, KC_NO, KC_NO, CMDCLEAR, + SHRUG, DISFACE, HEARTFACE, HAPPYFACE, + KC_ENT, RGB_TOG, MO(_LEDCNTL), MO(_TAPLAND) + ), + + /* TapLand // + * ,-------------------------------. + * | str1 | str2 | str3 | str4 | + * |------+-------+-------+--------| + * | | | | | + * |------+-------+-------+--------| + * | | | | | + * |------+-------+-------+--------| + * | | | | | + * `-------------------------------' + */ + //blue + [_TAPLAND] = LAYOUT_ortho_4x4( + TD(TD_EXAMPLE1), TD(TD_EXAMPLE2), TD(TD_EXAMPLE3), TD(TD_EXAMPLE4), + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, KC_NO, KC_NO, KC_NO + ), + /* LEDControl Pad + * ,-------------------------------. + * | snake|breathe|rainbow|gradient| + * |------+-------+-------+--------| + * | xmas | Val+ | Sat+ | HUE+ | + * |------+-------+-------+--------| + * |kngrdr| Val- | Sat- | HUE- | + * |------+-------+-------+--------| + * | swirl| PLAIN | | ON/OFF | + * `-------------------------------' + */ + //blue + [_LEDCNTL] = LAYOUT_ortho_4x4( + RGB_M_SN, RGB_M_B, RGB_M_R, RGB_M_G, + RGB_M_X, RGB_VAI, RGB_SAI, RGB_HUI, + RGB_M_K, RGB_VAD, RGB_SAD, RGB_HUD, + RGB_M_SW, RGB_M_P, KC_NO, RGB_TOG + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case CLOUD: // (っ◕‿◕)っ + if(record->event.pressed){ + send_unicode_hex_string("0028 3063 25D5 203F 25D5 0029 3063"); + } + return false; + break; + case FU: // t(-_-t) + if(record->event.pressed){ + SEND_STRING("t(-_-t)"); + } + return false; + break; + case HAPPYFACE: // ʘ‿ʘ + if(record->event.pressed){ + send_unicode_hex_string("0298 203F 0298"); + } + return false; + break; + case CMDCLEAR: + if (record->event.pressed) { + register_code(KC_LGUI); + tap_code(KC_A); + unregister_code(KC_LGUI); + tap_code(KC_DEL); + } + return false; + break; + case SHRUG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + return false; + break; + case HEARTFACE: // ♥‿♥ + if(record->event.pressed){ + send_unicode_hex_string("2665 203F 2665"); + } + return false; + break; + case DISFACE: // ಠ_ಠ + if(record->event.pressed){ + send_unicode_hex_string("0CA0 005F 0CA0"); + } + return false; + break; + case TFLIP: // (╯°□°)╯ ︵ ┻━┻ + if(record->event.pressed){ + send_unicode_hex_string("0028 256F 00B0 25A1 00B0 0029 256F 0020 FE35 0020 253B 2501 253B"); + } + return false; + break; + case TFLIP2: // ┻━┻︵ \(°□°)/ ︵ ┻━┻ + if(record->event.pressed){ + send_unicode_hex_string("253B 2501 253B FE35 0020 005C 0028 00B0 25A1 00B0 0029 002F 0020 FE35 0020 253B 2501 253B"); + } + return false; + break; + } + } + return true; +} + + +/* tap dance time */ +void tdexample1(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING1); + reset_tap_dance (state); + } +} +void tdexample2(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING2); + reset_tap_dance (state); + } +} +void tdexample3(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING3); + reset_tap_dance (state); + } +} +void tdexample4(qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 2) { + SEND_STRING(EXAMPLESTRING4); + reset_tap_dance (state); + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_EXAMPLE1] = ACTION_TAP_DANCE_FN(tdexample1), + [TD_EXAMPLE2] = ACTION_TAP_DANCE_FN(tdexample2), + [TD_EXAMPLE3] = ACTION_TAP_DANCE_FN(tdexample3), + [TD_EXAMPLE4] = ACTION_TAP_DANCE_FN(tdexample4) +}; + +// Runs just one time when the keyboard initializes. +void matrix_scan_user(void) { + static bool has_ran_yet; + if (!has_ran_yet) { + has_ran_yet = true; + rgblight_setrgb (16, 0, 16); + } +} +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _TAPLAND: + rgblight_setrgb(0, 16, 0); //green + break; + case _LEDCNTL: + rgblight_setrgb(0, 0, 16); //blue + break; + case _EMOJI: + rgblight_setrgb (16, 0, 16); //purple + break; + + default: // for any other layers, or the default layer + rgblight_setrgb (16, 0, 16); //purple + break; + } + return state; +} \ No newline at end of file diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md new file mode 100644 index 0000000000..7a3b8c8e44 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/readme.md @@ -0,0 +1,10 @@ +# Ridingtraffic's examples +=== +This keymap has many features: +3 layers +Momentary layer switching +16 pixel neopixel +Unicode Enabled +Tap dance enabled + +The rgb also updates depending on what layer you are on, and then flips back when done. diff --git a/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk new file mode 100644 index 0000000000..de44175531 --- /dev/null +++ b/keyboards/1upkeyboards/sweet16/keymaps/ridingintraffic/rules.mk @@ -0,0 +1,5 @@ +# turning on tap dance +TAP_DANCE_ENABLE = yes +RGBLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = no +UNICODE_ENABLE = yes \ No newline at end of file -- cgit v1.2.3 From c8267d9fea5e8b0dbdeb8521238c922ff4a83a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 23 Oct 2018 21:34:06 +0200 Subject: Update whitefox/konstantin keymap (#4220) * Change brace style to QMK OTBS * Change Unicode input mode to UC_WINC * Align constant values in config.h --- keyboards/whitefox/keymaps/konstantin/config.h | 18 +++++++++--------- keyboards/whitefox/keymaps/konstantin/keymap.c | 18 ++++++------------ 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index 725609b465..39450d6802 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -2,16 +2,16 @@ #define FORCE_NKRO -#define PERMISSIVE_HOLD -#define TAPPING_TERM 200 -#define TAPPING_TOGGLE 2 +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 -#define MOUSEKEY_DELAY 50 -#define MOUSEKEY_INTERVAL 15 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 #undef IS_COMMAND #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index 247bc6bbff..edb049287c 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -19,9 +19,8 @@ #define UC_DIVS UC(0x00F7) #define UC_MINS UC(0x2212) -void matrix_init_user(void) -{ - set_unicode_input_mode(UC_WIN); +void matrix_init_user(void) { + set_unicode_input_mode(UC_WINC); } enum layers { @@ -35,13 +34,10 @@ enum custom_keycodes { NUMPAD, }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ +bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case CLEAR: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); - } + if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); } return false; case NUMPAD: @@ -65,15 +61,13 @@ enum tap_dance { TD_DESKTOP, }; -void td_fn_rctl_finished(qk_tap_dance_state_t *state, void *user_data) -{ +void td_fn_rctl_finished(qk_tap_dance_state_t *state, void *user_data) { // Single tap → Fn, double tap → RCtrl, triple tap → Fn+RCtrl etc. if (state->count & 1) { layer_on(L_FN); } if (state->count & 2) { register_code(KC_RCTL); } } -void td_fn_rctl_reset(qk_tap_dance_state_t *state, void *user_data) -{ +void td_fn_rctl_reset(qk_tap_dance_state_t *state, void *user_data) { if (state->count & 1) { layer_off(L_FN); } if (state->count & 2) { unregister_code(KC_RCTL); } } -- cgit v1.2.3 From b0a021c07aa38905090058bd57b9304425594557 Mon Sep 17 00:00:00 2001 From: Ajax Date: Tue, 23 Oct 2018 15:44:48 -0400 Subject: Made a userspace that allows you to use your keyboard as an order of operations based calculator (#2864) * Made DZ60 layout with calculator * Cleaned up and commented, preparing to fix bug with negative in front of open parenthesis as first character * Fixed bug where negative sign infront of parenthesis as first character was parsed incorrectly * Made a better solution for the bug from the previous commit * Modularized and added a userfile so that this code can be used on various keyboards, found in doogle999 * Removed commented code from keymap * Made the layer that is used for calculations a define so that it can be changed per keyboard * Made the readme * Made the readme in the correct place * Revert "Made the readme in the correct place" This reverts commit 7f8b59ed9e59c77401a48be3a7ac1e8fd8e84e32. * Manually synced with qmk upstream * Stopped repeat, made keys print character that they are defined as rather than what the keyboard wants them to do * Added support for numpad, might make all keycodes custom so that there is no need to change doogle999.c if you want to change the keycode that is associated with a function, also made numpad automatically activating an option * Fixed some bugs with backspacing, updated the readme * Fixed some bugs with numlock turning on at the wrong times when a shift key was down * Made the return to layer work automatically instead of just forcing it to layer 0 * fixes and style changes, 20% decreased binary size * Fixed some bugs with double printing and compilation errors on my side * Fixed bug with exceeding the buffer size * Removed changes that added const-ness * Made changes so that backspace does not repeat to remove backspace bugs, still some bugs with recalculating without having typed anything * Fixed obo error with calc main loop * Made includes more accurate in keymap for dz60 * Moved flags to user makefile --- keyboards/dz60/keymaps/doogle999/keymap.c | 74 +++++ tmk_core/rules.mk | 1 - users/doogle999/doogle999.c | 460 ++++++++++++++++++++++++++++++ users/doogle999/doogle999.h | 99 +++++++ users/doogle999/readme.md | 41 +++ users/doogle999/rules.mk | 14 + 6 files changed, 688 insertions(+), 1 deletion(-) create mode 100644 keyboards/dz60/keymaps/doogle999/keymap.c create mode 100644 users/doogle999/doogle999.c create mode 100644 users/doogle999/doogle999.h create mode 100644 users/doogle999/readme.md create mode 100644 users/doogle999/rules.mk diff --git a/keyboards/dz60/keymaps/doogle999/keymap.c b/keyboards/dz60/keymaps/doogle999/keymap.c new file mode 100644 index 0000000000..deea641f70 --- /dev/null +++ b/keyboards/dz60/keymaps/doogle999/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +#include "doogle999.h" + +#define ______ KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base layer + * ,-----------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Fn | A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | Shift | U | Del | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Cmd | Alt | Space | / | Fn | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_ESC, 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_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, + MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT, KC_UP, KC_DELETE, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SLSH, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT + ), + +/* Fn layer + * ,-----------------------------------------------------------------------------------------. + * | ~ | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10 | F11 | F12 | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Reset | NP1 | NP2 | NP3 | NP4 | NP5 | NP6 | NP7 | NP8 | NP9 | NP0 |VolD |VolU | Mute | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | BlD | BlI | BlT | Menu | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Cyc+| Cyc-| Val+| Val-| Hue+| Hue-| Sat+| Sat-| Tog | Shift | Pup | Ins | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Cmd | Alt | Space |HwCal| |Home | Pdn | End | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_GRV, 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_CALC, + RESET, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_0, KC_VOLD, KC_VOLU, KC_MUTE, + ______, ______, ______, ______, ______, ______, ______, ______, ______, BL_DEC, BL_INC, BL_TOGG, KC_APP, + KC_LSFT, ______, RGB_MOD, RGB_RMOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_TOG, KC_RSFT, KC_PGUP, KC_INSERT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, TO(2), ______, KC_HOME, KC_PGDOWN, KC_END + ), + + /* Hardware calculator layer + * ,-----------------------------------------------------------------------------------------. + * |EndCa| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | | Q | | E | | T | | | | | P | | | | + * |-----------------------------------------------------------------------------------------+ + * | | | S | | | | | | | L | | | Calc | + * |-----------------------------------------------------------------------------------------+ + * | Shift | | | | C | | | | | . | Shift | | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | / | | | | | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + ENDCALC, 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_Q, ______, KC_E, ______, KC_T, ______, ______, ______, ______, KC_P, ______, ______, ______, + ______, ______, KC_S, ______, ______, ______, ______, ______, ______, KC_L, ______, ______, CALC, + KC_LSFT, ______, ______, ______, KC_C, ______, ______, ______, ______, ______, KC_DOT, KC_RSFT, ______, ______, + ______, ______, ______, ______, ______, ______, KC_SLSH, ______, ______, ______, ______ + ), +}; \ No newline at end of file diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index f1ef733f69..ce3cd83b3f 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -103,7 +103,6 @@ endif CFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) CFLAGS += $(CSTANDARD) - #---------------- Compiler Options C++ ---------------- # -g*: generate debugging information # -O*: optimization level diff --git a/users/doogle999/doogle999.c b/users/doogle999/doogle999.c new file mode 100644 index 0000000000..320de7cff8 --- /dev/null +++ b/users/doogle999/doogle999.c @@ -0,0 +1,460 @@ +#include "doogle999.h" + +static unsigned char inputLocation = 0; // Current index in text input + +static double calc(const char input[CALC_BUFFER_SIZE +1]) // Finds value of input char array, relatively small and fast I think +{ + char inputToken[CALC_BUFFER_SIZE + 1]; // Input buffer, used when a single token (generally a number) takes up more + unsigned char inputTokenLocation = 0, inputLocation = 0; // Keep track of indices + + struct Token tokens[CALC_BUFFER_SIZE + 1]; // Input, converted to tokens, one extra large to accomodate for possible negative sign then open parenthesis as first character + unsigned char tokenCount = 0; // Keep track of index + + bool dashAsMinus = false; // Kind of a hacky solution to determining whether to treat a dash as a minus sign or a negative sign + + while(inputLocation < CALC_BUFFER_SIZE + 1) + { + char digit = input[inputLocation]; + + if(inputLocation == 0 && input[inputLocation] == CALC_CHAR_SUB && input[inputLocation + 1] == CALC_CHAR_BEG) + { + tokens[tokenCount].raw.num = 0; + tokens[tokenCount].isNum = true; + + tokenCount++; + dashAsMinus = true; + } + + if ((digit >= '0' && digit <= '9') || /* valid digit */ + (inputTokenLocation != 0 && input[inputLocation] == CALC_CHAR_DEC) || /* valid floating point */ + (!dashAsMinus && inputTokenLocation == 0 && input[inputLocation] == CALC_CHAR_SUB)) /* - is negative sign */ + { + inputToken[inputTokenLocation] = input[inputLocation]; + inputTokenLocation++; + inputLocation++; + continue; + } + + if(inputTokenLocation != 0) + { + // sscanf(inputToken, "%lf", &tokens[tokenCount].raw.num); // I would like to use sscanf here, but the small version of stdio.h on the chip doesn't allow sscanf or its sister functions to be used to process floats + tokens[tokenCount].raw.num = atof(inputToken); + tokens[tokenCount].isNum = true; + for(unsigned char i = 0; i < inputTokenLocation + 1; i++) + { + inputToken[i] = '\0'; + } + inputTokenLocation = 0; + tokenCount++; + dashAsMinus = true; + continue; + } + + /* inputTokenLocation == 0 */ + tokens[tokenCount].isNum = false; + tokens[tokenCount].raw.op.c = input[inputLocation]; + tokens[tokenCount].raw.op.priority = 0; + tokens[tokenCount].raw.op.ltr = true; + dashAsMinus = false; + + switch(input[inputLocation]) + { + case CALC_CHAR_BEG: + break; + case CALC_CHAR_END: + dashAsMinus = true; + break; + case CALC_CHAR_ADD: + tokens[tokenCount].raw.op.priority = CALC_PRIO_ADD; + break; + case CALC_CHAR_SUB: + tokens[tokenCount].raw.op.priority = CALC_PRIO_SUB; + break; + case CALC_CHAR_MUL: + tokens[tokenCount].raw.op.priority = CALC_PRIO_MUL; + break; + case CALC_CHAR_DIV: + tokens[tokenCount].raw.op.priority = CALC_PRIO_DIV; + break; + case CALC_CHAR_EXP: + tokens[tokenCount].raw.op.priority = CALC_PRIO_EXP; + tokens[tokenCount].raw.op.ltr = false; + break; + case CALC_CHAR_SIN: + case CALC_CHAR_COS: + case CALC_CHAR_TAN: + case CALC_CHAR_ASN: + case CALC_CHAR_ACS: + case CALC_CHAR_ATN: + case CALC_CHAR_LGE: + case CALC_CHAR_LOG: + case CALC_CHAR_SQT: + break; + case CALC_CHAR_EUL: + tokens[tokenCount].isNum = true; + tokens[tokenCount].raw.num = CALC_VALU_EUL; + dashAsMinus = true; + break; + case CALC_CHAR_PI: + tokens[tokenCount].isNum = true; + tokens[tokenCount].raw.num = CALC_VALU_PI; + dashAsMinus = true; + break; + case '\0': + tokenCount--; + inputLocation = CALC_BUFFER_SIZE; + break; + default: + tokenCount--; + break; + } + tokenCount++; + inputLocation++; + } + + struct Token output[CALC_BUFFER_SIZE + 1]; // Final output tokens before evaluation + struct Token opstack[CALC_BUFFER_SIZE + 1]; // Stack of operators + unsigned char outputLocation = 0, opstackLocation = 0; // Keep track of indices + + unsigned char numBrackets = 0; // The number of parenthesis + + for(unsigned char i = 0; i < tokenCount; i++) + { + if(tokens[i].isNum) + { + output[outputLocation] = tokens[i]; + outputLocation++; + } + else if(tokens[i].raw.op.c == CALC_CHAR_BEG) + { + opstack[opstackLocation] = tokens[i]; + opstackLocation++; + } + else if(tokens[i].raw.op.c == CALC_CHAR_END) + { + while(opstack[opstackLocation - 1].raw.op.c != CALC_CHAR_BEG) + { + output[outputLocation] = opstack[opstackLocation - 1]; + outputLocation++; + opstackLocation--; + } + opstackLocation--; + + numBrackets += 2; + } + else if(tokens[i].raw.op.priority == 0) + { + opstack[opstackLocation] = tokens[i]; + opstackLocation++; + } + else + { + while(opstackLocation != 0 + && (opstack[opstackLocation - 1].raw.op.priority == 0 + || tokens[i].raw.op.priority < opstack[opstackLocation - 1].raw.op.priority + || (tokens[i].raw.op.priority == opstack[opstackLocation - 1].raw.op.priority && opstack[opstackLocation - 1].raw.op.ltr)) + && opstack[opstackLocation - 1].raw.op.c != CALC_CHAR_BEG) + { + output[outputLocation] = opstack[opstackLocation - 1]; + outputLocation++; + opstackLocation--; + } + opstack[opstackLocation] = tokens[i]; + opstackLocation++; + } + } + + tokenCount -= numBrackets; + + for(signed char i = opstackLocation - 1; i >= 0; i--) + { + output[outputLocation] = opstack[i]; + outputLocation++; + opstackLocation--; + } + + double answer[CALC_BUFFER_SIZE]; + unsigned char answerLocation = 0; + + for(unsigned char i = 0; i < tokenCount; i++) + { + if(output[i].isNum) + { + answer[answerLocation] = output[i].raw.num; + answerLocation++; + continue; + } + + if(output[i].raw.op.priority == 0) + { + if (answerLocation < 1) { /* not handled here -- ERROR? */ } else + if(answerLocation >= 1) + { + double (*op)(double); + switch(output[i].raw.op.c) + { + case CALC_CHAR_SIN: + op = sin; + break; + case CALC_CHAR_COS: + op = cos; + break; + case CALC_CHAR_TAN: + op = tan; + break; + case CALC_CHAR_ASN: + op = asin; + break; + case CALC_CHAR_ACS: + op = acos; + break; + case CALC_CHAR_ATN: + op = atan; + break; + case CALC_CHAR_LGE: + op = log; + break; + case CALC_CHAR_LOG: + op = log10; + break; + case CALC_CHAR_SQT: + op = sqrt; + break; + default: + continue; /* invalid input */ + } + answer[answerLocation - 1] = op(answer[answerLocation - 1]); + } + } + /* priority != 0 */ + else if(answerLocation >= 2) + { + switch(output[i].raw.op.c) + { + case CALC_CHAR_ADD: + answer[answerLocation - 2] += answer[answerLocation - 1]; + break; + case CALC_CHAR_SUB: + answer[answerLocation - 2] -= answer[answerLocation - 1]; + break; + case CALC_CHAR_MUL: + answer[answerLocation - 2] *= answer[answerLocation - 1]; + break; + case CALC_CHAR_DIV: + answer[answerLocation - 2] /= answer[answerLocation - 1]; + break; + case CALC_CHAR_EXP: + answer[answerLocation - 2] = pow(answer[answerLocation - 2], answer[answerLocation - 1]); + break; + } + + answerLocation--; + } + } + + return answer[0]; +} + +/* + * @returns 0 when nothing should happen and QMK should work as usual + * @returns -1 when invalid input was given, QMK should ignore it + * @returns -2 when BSP should be done + * @returns -3 when CALC should be done + * @returns -4 when ENDCALC should be done + * @returns positive value of CALC_* when normal input was processed + */ +static int process_input(const uint16_t keycode, const uint8_t mods, const keyevent_t event) +{ + /* handle even when no key was pressed */ + if(!event.pressed) + { + switch(keycode) + { + /* QMK should handle those */ + case KC_RSFT: + case KC_LSFT: + return 0; + break; + } + /* ??? ignore */ + return -1; + } + + /* when shift key is pressed handle characters differently */ + char characterPressed; + if((get_mods() & MODS_SHIFT_MASK)) + { + switch(keycode) + { + case KC_9: + characterPressed = CALC_CHAR_BEG; + break; + case KC_0: + characterPressed = CALC_CHAR_END; + break; + case KC_EQUAL: + characterPressed = CALC_CHAR_ADD; + break; + case KC_KP_PLUS: + characterPressed = CALC_CHAR_ADD; + break; + case KC_6: + characterPressed = CALC_CHAR_EXP; + break; + case KC_8: + characterPressed = CALC_CHAR_MUL; + break; + case KC_KP_ASTERISK: + characterPressed = CALC_CHAR_MUL; + break; + case KC_S: + characterPressed = CALC_CHAR_ASN; + break; + case KC_C: + characterPressed = CALC_CHAR_ACS; + break; + case KC_T: + characterPressed = CALC_CHAR_ATN; + break; + case KC_L: + characterPressed = CALC_CHAR_LOG; + break; + default: + return -1; + break; + } + return characterPressed; + } + + /* normal key handling: shift not pressed */ + + /* digits */ + if (keycode == KC_KP_0 || keycode == KC_0) { + return '0'; + } else if (keycode >= KC_KP_1 && keycode <= KC_KP_9) { + return keycode - KC_KP_1 +1 + '0'; + } else if (keycode >= KC_1 && keycode <= KC_9) { + return keycode - KC_1 +1 + '0'; + } + + /* other tokens */ + switch (keycode) { + case KC_MINUS: + case KC_KP_MINUS: + return characterPressed = CALC_CHAR_SUB; + case KC_SLASH: + case KC_KP_SLASH: + return characterPressed = CALC_CHAR_DIV; + case KC_S: + return characterPressed = CALC_CHAR_SIN; + case KC_C: + return characterPressed = CALC_CHAR_COS; + case KC_T: + return characterPressed = CALC_CHAR_TAN; + case KC_Q: + return characterPressed = CALC_CHAR_SQT; + case KC_L: + return characterPressed = CALC_CHAR_LGE; + case KC_DOT: + case KC_KP_DOT: + return characterPressed = CALC_CHAR_DEC; + case KC_P: + return characterPressed = CALC_CHAR_PI; + case KC_E: + return characterPressed = CALC_CHAR_EUL; + case KC_BSPC: + return -2; + case KC_RSFT: + return 0; + case KC_LSFT: + return 0; + case CALC: + return -3; + case ENDCALC: + return -4; + default: + return -1; + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t* record) +{ + static char text[CALC_BUFFER_SIZE + 1]; // Used to store input and then output when ready to print + static char backspaceText[CALC_BUFFER_SIZE + 1]; // Pretty dumb waste of memory because only backspace characters, used with send_string to backspace and remove input + + if((biton32(layer_state) == CALC_LAYER && CALC_FORCE_NUM_LOCK_INSIDE_CALC) || (biton32(layer_state) != CALC_LAYER && CALC_FORCE_NUM_LOCK_OUTSIDE_CALC)) + { + bool numpadKeyPressed = record->event.pressed && + !(get_mods() & MODS_SHIFT_MASK) && + /* KC_KP_1, KC_KP_2, ..., KC_KP_0, KC_KP_DOT */ + (keycode >= KC_KP_1 && keycode <= KC_KP_DOT); + + if(numpadKeyPressed && !(host_keyboard_leds() & (1 << USB_LED_NUM_LOCK))) + { + add_key(KC_NLCK); + send_keyboard_report(); + del_key(KC_NLCK); + } + } + + if(biton32(layer_state) != CALC_LAYER) { return true; } + + int action = process_input(keycode, get_mods(), record->event); + switch(action) + { + case 0: + return true; + case -1: + return false; + case -2: + if(inputLocation > 0) + { + inputLocation--; + text[inputLocation] = '\0'; + backspaceText[0] = (char)8; + backspaceText[1] = '\0'; + send_string(backspaceText); + } + return false; + case -3: + for(int i = 0; i < inputLocation; i++) + { + backspaceText[i] = (char)8; + } + send_string(backspaceText); + dtostrf(calc(text), CALC_PRINT_SIZE, CALC_PRINT_SIZE, text); + send_string(text); + for(unsigned char i = 0; i < CALC_BUFFER_SIZE; i++) + { + text[i] = '\0'; + backspaceText[i] = '\0'; + } + inputLocation = 0; + return false; + case -4: + for(unsigned char i = 0; i < CALC_BUFFER_SIZE; i++) + { + text[i] = '\0'; + backspaceText[i] = '\0'; + } + inputLocation = 0; + layer_off(CALC_LAYER); + return false; + default: + break; + } + char characterPressed = (char)action; + + if(inputLocation < CALC_BUFFER_SIZE) + { + text[inputLocation] = characterPressed; + inputLocation++; + + char characterToSend[2]; + characterToSend[0] = characterPressed; + characterToSend[1] = '\0'; + + send_string(characterToSend); + } + return false; +} \ No newline at end of file diff --git a/users/doogle999/doogle999.h b/users/doogle999/doogle999.h new file mode 100644 index 0000000000..7ed38fbcc8 --- /dev/null +++ b/users/doogle999/doogle999.h @@ -0,0 +1,99 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO + +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +// Layer the calculator is on +#define CALC_LAYER 2 + +// Inside is whether when you are in calc mode it should automatically force numlock, outside is whether it should do it outside of calculator mode +#define CALC_FORCE_NUM_LOCK_INSIDE_CALC true +#define CALC_FORCE_NUM_LOCK_OUTSIDE_CALC true + +// Maximum number of characters the calculator can have +#define CALC_BUFFER_SIZE 32 + +// Minimum width of the printed text / the number of decimal places +#define CALC_PRINT_SIZE 6 + +/*----- + Special +-----*/ +#define CALC_CHAR_BEG '(' +#define CALC_CHAR_END ')' +#define CALC_CHAR_DEC '.' + +/*----- + Operators - Can add more here such as modulo %, factorial ! +-----*/ +#define CALC_CHAR_ADD '+' +#define CALC_PRIO_ADD 1 + +#define CALC_CHAR_SUB '-' +#define CALC_PRIO_SUB 1 + +#define CALC_CHAR_MUL '*' +#define CALC_PRIO_MUL 2 + +#define CALC_CHAR_DIV '/' +#define CALC_PRIO_DIV 2 + +#define CALC_CHAR_EXP '^' +#define CALC_PRIO_EXP 3 + +/*----- + Functions +-----*/ +#define CALC_CHAR_SIN 's' +#define CALC_CHAR_COS 'c' +#define CALC_CHAR_TAN 't' + +#define CALC_CHAR_ASN 'S' +#define CALC_CHAR_ACS 'C' +#define CALC_CHAR_ATN 'T' + +#define CALC_CHAR_LGE 'l' +#define CALC_CHAR_LOG 'L' + +#define CALC_CHAR_SQT 'q' + +/*----- + Constants +-----*/ +#define CALC_CHAR_EUL 'e' +#define CALC_VALU_EUL 2.71828182845904523536 + +#define CALC_CHAR_PI 'p' +#define CALC_VALU_PI 3.14159265358979323846 + +struct OP // Operator/function +{ + char c; + unsigned char priority; + bool ltr; +}; + +union TokenRaw // A token after the input has been processed, can either be a number or an operator/function +{ + double num; + struct OP op; +}; + +struct Token // Encapsulator +{ + bool isNum; + union TokenRaw raw; +}; + +enum CalcFunctions // Hardware calculator key functionality +{ + CALC = SAFE_RANGE, + ENDCALC +}; + +#endif diff --git a/users/doogle999/readme.md b/users/doogle999/readme.md new file mode 100644 index 0000000000..e108555b9c --- /dev/null +++ b/users/doogle999/readme.md @@ -0,0 +1,41 @@ +Copyright 2018 @doogle999 + +Overview +======== + +This folder is just for some calculator code for my keyboards. + +Making Your Keyboard Into A Calculator +-------------------------------------- + +If you'd like to make your keyboard into a calculator, you can do it with this userspace (hopefully!) + +You can make a keymap for your keyboard of choice named doogle999 and then you can make it regularly. + +You should make one layer that is just the functionality for your calculator, so it just has the keys you need (numbers, symbols, some letters for functions). It should also have END_CALC and CALC somewhere. END_CALC gets you out of calculator mode, and CALC evaluates the calculation. + +On one of your other keymaps you should make a key that is TO(layer of calculator). This is how you will activate the calculator. You should also define the layer your calculator is on with the define CALC_LAYER in doogle999.h (this means that for all your keyboards, your calculator layer has to be the same layer). + +You can change what characters coorespond to what operators and functions and you can add more functions in doogle999.h and doogle999.c, you can also change which characters are sued for which keys. However, as of now standard keys should be used for operations. By that I mean if you want your multiplication sign to be an x, you should change the CALC_CHAR_MUL to an x but you should keep your multiplication keycode on the keymap either as KC_8 (shifted) or KC_KP_ASTERISK. This might be changed in the future so there are custom keycodes so this is less of a pain and more intuitive. + +You can look at my dz60 keymap doogle999 for an example. + +Issues +------ +Unfortunately the chip onboard my dz60 only does single precision floating point numbers, but I have everything set up as double so if your chip supports doubles it should work for you. + +This Was Here When I Made The ReadMe +------------------------------------ + +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 . \ No newline at end of file diff --git a/users/doogle999/rules.mk b/users/doogle999/rules.mk new file mode 100644 index 0000000000..12698a27e5 --- /dev/null +++ b/users/doogle999/rules.mk @@ -0,0 +1,14 @@ +SRC += doogle999.c + +CFLAGS += -fstrict-aliasing -ftree-vrp + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes -- cgit v1.2.3 From 9ed0c2d57b4f5014c24ea48a6fe448b69789957b Mon Sep 17 00:00:00 2001 From: Callum Oakley Date: Wed, 24 Oct 2018 00:28:40 +0100 Subject: Keymap update (#4223) * change window focus shortcuts * hangul * macos goodness * re-arrange tab keys * remove tab switching keys * left hand func * glorious macro pad * workspace rotation keys * tabbing hotkeys * left hand tab change keys * SEND_STRING("!") on KC_EXLM * use SEND_STRING for all shifted symbols * SEND_STRING even for non shifted symbols so they play nicely with the shifted ones --- keyboards/planck/keymaps/callum/keymap.c | 74 ++++++++++++++++++++++++++++---- 1 file changed, 66 insertions(+), 8 deletions(-) diff --git a/keyboards/planck/keymaps/callum/keymap.c b/keyboards/planck/keymaps/callum/keymap.c index 2a816bf677..1cffe15d46 100644 --- a/keyboards/planck/keymaps/callum/keymap.c +++ b/keyboards/planck/keymaps/callum/keymap.c @@ -172,7 +172,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * |Power| F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 |VolDn| * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | | F21 | F22 | F23 | F24 | | | | |Clmak|Qwrty| | + * | | | |TabL |TabR | | | | |Clmak|Qwrty| | * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| * | | | | |Prev |Mute |Play |Next | | | | | * `-----------------------------------------------------------------------' @@ -189,8 +189,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_F18, KC_F19, KC_F20, KC_VOLD }, { - _______, KC_F21, KC_F22, KC_F23, - KC_F24, XXXXXXX, XXXXXXX, XXXXXXX, + _______, XXXXXXX, XXXXXXX, SC(KC_TAB), + C(KC_TAB), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, COLEMAK, QWERTY, _______ }, { @@ -229,13 +229,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_colemak(); } return false; - break; case QWERTY: if (record->event.pressed) { set_qwerty(); } return false; - break; case SYMB: if (record->event.pressed) { layer_on(_SYMB); @@ -243,7 +241,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_SYMB); } return false; - break; case MOVE: if (record->event.pressed) { layer_on(_MOVE); @@ -251,7 +248,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_MOVE); } return false; - break; case FUNC: if (record->event.pressed) { layer_on(_FUNC); @@ -259,7 +255,69 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_FUNC); } return false; - break; + + // Override the defualt auto shifted symbols to use SEND_STRING + // See https://github.com/qmk/qmk_firmware/issues/4072 + case KC_EXLM: + if (record->event.pressed) { SEND_STRING("!"); } + return false; + case KC_AT: + if (record->event.pressed) { SEND_STRING("@"); } + return false; + case KC_HASH: + if (record->event.pressed) { SEND_STRING("#"); } + return false; + case KC_DLR: + if (record->event.pressed) { SEND_STRING("$"); } + return false; + case KC_PERC: + if (record->event.pressed) { SEND_STRING("%"); } + return false; + case KC_CIRC: + if (record->event.pressed) { SEND_STRING("^"); } + return false; + case KC_AMPR: + if (record->event.pressed) { SEND_STRING("&"); } + return false; + case KC_ASTR: + if (record->event.pressed) { SEND_STRING("*"); } + return false; + case KC_LPRN: + if (record->event.pressed) { SEND_STRING("("); } + return false; + case KC_RPRN: + if (record->event.pressed) { SEND_STRING(")"); } + return false; + case KC_TILD: + if (record->event.pressed) { SEND_STRING("~"); } + return false; + case KC_GRV: + if (record->event.pressed) { SEND_STRING("`"); } + return false; + case KC_PLUS: + if (record->event.pressed) { SEND_STRING("+"); } + return false; + case KC_EQL: + if (record->event.pressed) { SEND_STRING("="); } + return false; + case KC_PIPE: + if (record->event.pressed) { SEND_STRING("|"); } + return false; + case KC_BSLS: + if (record->event.pressed) { SEND_STRING("\\"); } + return false; + case KC_LBRC: + if (record->event.pressed) { SEND_STRING("["); } + return false; + case KC_RBRC: + if (record->event.pressed) { SEND_STRING("]"); } + return false; + case KC_LCBR: + if (record->event.pressed) { SEND_STRING("{"); } + return false; + case KC_RCBR: + if (record->event.pressed) { SEND_STRING("}"); } + return false; } return true; } -- cgit v1.2.3 From bef554d18bcb14492e2513b0759407e4b4581c9c Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 24 Oct 2018 08:57:08 -0700 Subject: Bug: Users had to be in the /util directory to run the script (#4228) --- util/new_keymap.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/new_keymap.sh b/util/new_keymap.sh index b09f3dd0ca..73cc9e8cc3 100755 --- a/util/new_keymap.sh +++ b/util/new_keymap.sh @@ -18,7 +18,7 @@ if [ -z "$USERNAME" ]; then exit 1 fi -cd .. +cd "$(dirname "$0")/.." if [ ! -d "keyboards/$KB_PATH" ]; then printf "Error! keyboards/%s does not exist!\n" "$KB_PATH" -- cgit v1.2.3 From a5b10e5da24cb52c04dddc9168d5e7590fb749d2 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 24 Oct 2018 12:13:40 -0700 Subject: Fix syntax for windows --- docs/newbs_building_firmware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/newbs_building_firmware.md b/docs/newbs_building_firmware.md index ac6bff2bc7..fabfefb190 100644 --- a/docs/newbs_building_firmware.md +++ b/docs/newbs_building_firmware.md @@ -16,7 +16,7 @@ Start by navigating to the `keymaps` folder for your keyboard. ?> Windows: - start keyboards//keymaps + start .\\keyboards\\\\keymaps ## Create a Copy Of The `default` Keymap -- cgit v1.2.3 From ffb2557a3aac1e5c943b1e6242c3a693da68d8ee Mon Sep 17 00:00:00 2001 From: 194h <38110558+194h@users.noreply.github.com> Date: Thu, 25 Oct 2018 19:04:48 +0200 Subject: Keymap: Updated my(194h) keymap to make it more clean and useful (#4236) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Added my(194h) atreus62 keymap * Fixed what noroadsleft remarked in my pull request, hopefully got it all. * Followed drashna's suggestion. * Removed unused functionality from my keymap, added tap dance æøå and changed Layer 1 and Layer 2 * Removed unused functionality from my keymap, added tap dance æøå and changed Layer 1 and Layer 2 --- keyboards/atreus62/keymaps/194h/keymap.c | 109 ++++++++++++++----------------- keyboards/atreus62/keymaps/194h/rules.mk | 5 +- 2 files changed, 51 insertions(+), 63 deletions(-) diff --git a/keyboards/atreus62/keymaps/194h/keymap.c b/keyboards/atreus62/keymaps/194h/keymap.c index 9b397fce46..1d069e9d42 100644 --- a/keyboards/atreus62/keymaps/194h/keymap.c +++ b/keyboards/atreus62/keymaps/194h/keymap.c @@ -39,6 +39,7 @@ //Norwegian layout - dependant on previous definitions #define NO_UNDS LSFT(NO_MINS) // _ #define NO_QUES LSFT(NO_PLUS) // ? +#define NO_ACUT RALT(NO_BSLS) // Acute #define NO_GRAV LSFT(NO_BSLS) // ` #define NO_GT LSFT(NO_LT) // > #define NO_HALF RALT(NO_LT) // ½ @@ -56,6 +57,9 @@ #define OSM_RSFT OSM(MOD_RSFT) #define OSM_RGUI OSM(MOD_RGUI) +//CTRL on hold, ESC on tap +#define CTL_ESC CTL_T(KC_ESC) + //Layers #define L1 0 #define L2 1 @@ -63,23 +67,51 @@ #define L4 3 #define L5 4 +// Momentary switch to layer +#define MO_L2 MO(L2) +#define MO_L4 MO(L4) +#define MO_L5 MO(L5) // Momentary switch to layer - One Shot Layer +#define OSL_L2 OSL(L2) #define OSL_L3 OSL(L3) #define OSL_L4 OSL(L4) +//Tap Dance Declarations +enum { + SCLN_OE = 0, + QUOT_AE, + DQT_AO +}; + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for semicolon, twice for ø + [SCLN_OE] = ACTION_TAP_DANCE_DOUBLE(NO_SCLN, NO_OE), + //Tap once for single quote, twice for æ + [QUOT_AE] = ACTION_TAP_DANCE_DOUBLE(NO_QUOT, NO_AE), + //Tap once for double quote, twice for å + [DQT_AO] = ACTION_TAP_DANCE_DOUBLE(NO_DQT, NO_AO), +// Other declarations would go here, separated by commas, if you have them +}; + +//Tap Dance keys +#define TD_SCLN_OE TD(SCLN_OE) +#define TD_QUOT_AE TD(QUOT_AE) +#define TD_DQT_AO TD(DQT_AO) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [L1] = LAYOUT( KC_LGUI, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_RGUI, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_DQT, - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_SCLN, NO_QUOT, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, TD_DQT_AO, + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, TD_SCLN_OE, TD_QUOT_AE, OSM_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, OSM_RSFT, - CTL_T(KC_ESC), MO(L5), KC_LEAD, OSM_LALT, MO(L4), OSL_L3, KC_SPC, KC_ENT, OSL_L3, MO(L4), OSM_RALT, NO_EQL, NO_PLUS, KC_RCTL + CTL_ESC, MO_L5, KC_TAB, OSM_LALT, MO_L4, OSL_L3, KC_SPC, KC_ENT, OSL_L3, MO_L4, OSM_LALT, NO_EQL, NO_PLUS, KC_RCTL ), [L2] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_AO, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_OE, NO_AE, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_DQT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, NO_SCLN, NO_QUOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -95,66 +127,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_HOME, KC_PGDN, KC_PGUP, KC_END, XXXXXXX, XXXXXXX, _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, XXXXXXX, KC_DEL, XXXXXXX, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, XXXXXXX, KC_APP, XXXXXXX, XXXXXXX, KC_VOLD, XXXXXXX, - OSM_LCTL, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, OSM_RCTL + OSM_LCTL, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, OSM_RALT, KC_MUTE, KC_VOLU, OSM_RCTL ), [L5] = LAYOUT( XXXXXXX, TO(L1), TO(L2), TO(L3), TO(L4), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_AO, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, NO_OE, NO_AE, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX ) }; - -// Unicode Linux -void matrix_init_user(void) { - set_unicode_input_mode(UC_LNX); -}; - - -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - - -LEADER_EXTERNS(); - -// Runs constantly in the background, in a loop. Only supports basic keycodes. -void matrix_scan_user(void) { - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - //probably useless in practice, but cool - SEQ_ONE_KEY (KC_P) { - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - tap_random_base64(); - } - - SEQ_ONE_KEY (KC_G) { - SEND_STRING("grep something !"); - register_code(KC_RALT); - TAP_ONCE(KC_4); - unregister_code(KC_RALT); - } - SEQ_ONE_KEY (KC_T) { - SEND_STRING("tail "); - TAP_ONCE(KC_SLSH); - SEND_STRING("f !"); - register_code(KC_RALT); - TAP_ONCE(KC_4); - unregister_code(KC_RALT); - } - SEQ_ONE_KEY (KC_S) { - SEND_STRING("sudo !!"); - TAP_ONCE(KC_ENT); - } - } -} +//TODO: Is there productivity gain in the use of unicode? +// - Won't work in xterm. +// Create a layer for macros and/or unicode? +// Are macros useful? +// - Found no gain in having sendstring for commands. +// - Find repeated tasks that cannot be done easily on the OS. +// - Most other keymaps have macros for game/fun stuff, hard to find "serious" onces. +// Screw Norwegian layout, switch to US with unicode æøå or US/English International? +// - Will be different from laptop keyboard, requiring a switch on the OS side when only using the laptop. diff --git a/keyboards/atreus62/keymaps/194h/rules.mk b/keyboards/atreus62/keymaps/194h/rules.mk index 5246909a38..2c97aee093 100644 --- a/keyboards/atreus62/keymaps/194h/rules.mk +++ b/keyboards/atreus62/keymaps/194h/rules.mk @@ -1,8 +1,7 @@ -TAP_DANCE_ENABLE = no +TAP_DANCE_ENABLE = yes NKRO_ENABLE = true MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = no KEY_LOCK_ENABLE = no -AUTO_SHIFT_ENABLE = no -LEADER_ENABLE = yes +LEADER_ENABLE = no -- cgit v1.2.3 From 3c95de3c695135be358800911f4d36767392f010 Mon Sep 17 00:00:00 2001 From: SpacebarRacecar <42380065+SpacebarRacecar@users.noreply.github.com> Date: Thu, 25 Oct 2018 22:08:25 +0200 Subject: Adding a readme to my userspace (#4239) * added userspace readme * small fix to userspace readme * another fix to userspace readme * changed and improved userspace readme * Update readme.md * Update readme.md * changes to readme again * readme again --- users/spacebarracecar/readme.md | 111 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 users/spacebarracecar/readme.md diff --git a/users/spacebarracecar/readme.md b/users/spacebarracecar/readme.md new file mode 100644 index 0000000000..172764c074 --- /dev/null +++ b/users/spacebarracecar/readme.md @@ -0,0 +1,111 @@ +# SpacebarRacecar Userspace + +The main purpose of this userspace is to keep my personal keymaps clean by moving shared code in here and also allowing me to easily change all my keymaps at once. However it also contains code that might be interesting to QMK Users living in Germany. Most of this code will be explained here. + + +## US Layout Keys for German PCs + +I'm using the US Ansi layout however I'm living in Germany which means that every PC here has its input language set to German. My goal was to create custom keycodes that emulate the US Keys so that I can plug my keyboards into any German PC and have them working without changing any settings. + +### How to use + +- To activate the custom keycodes set GERMAN_ENABLE = yes in the keyboards rules.mk file. +- The keycodes are listed and explained in [spacebarracecar.h](spacebarracecar.h) under `enum userspace_custom_keycodes`. +- The keycodes are handled by the `process_record_user` function which is now located in [spacebarracecar.c](spacebarracecar.c). To change keyboard specific configuration `process_record_keymap` is used (see [drashna userspace readme](../drashna/readme.md) for better explanation). +- There is a predefined `_DEADKEY` layer in [spacebarracecar.h](spacebarracecar.h) under `enum userspace_layers`. Shifted CU_QUOT enables the dead key layer, just like KC_QUOT would when using the US International layout. (See `enum userspace_custom_keycodes` for more explanation). +- On Windows grave and circonflexe are defined as dead keys when using the standard german layout. Those are automatically escaped when using the custom keycodes. `CU_ESCT` can be used to enable/disable this behavior. +- For a complete example see my [fc660c](../../keyboards/fc660c/keymaps/spacebarracecar/keymap.c) or [planck](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) keymaps. + +### How it works + +Creating the custom keycodes was not a trivial task because it is necessary that they are able to send different keycodes depending on the physical shift state. Also the shift state of the actual send keycodes has to be completely independent of the physical shift state. At the same time it has to be ensured that shift never gets stuck or disabled accidentaly. + +(Shift state: If shift keycode is registered; Physical shift state: If shift key is actually pressed) + +Here is an example for a custom *US Equal* keycode that illustrates the problem: + +| Physical Shift State | Custom keycode | Actual send keycodes | +|----------------------|----------------|----------------------| +| Unshifted | = | Shifted DE_0 | +| Shifted | + | Unshifted DE_PLUS | + +#### Tracking the physical shift state + +To track the physical shift state there are two custom left and right shift keycodes `CU_LSFT` and `CU_RSFT`. These track the current physical shift state using two booleans `lshift` and `rshift`. To make things easier both custom shifts use KC_LSFT. A space cadet shift functionality is also included. The preexisting space cadet shift implementation could not be used because it doesn't reset when custom keycodes are pressed and therefore produces unwated parenthesis. + +#### Custom keycode templates + +To ease the creation of custom keycodes there are a few templates defined in [spacebarracecar.h](spacebarracecar.h). + +- `SHIFT_NORM(kc1, kc2)` Sends independent keycodes kc1 and kc2 depending on physical shift state without changing shift state. +- `SHIFT_SWITCH(kc1, kc2)` Sends independent keycodes kc1 and kc2 depending on physical shift state while flipping shift state. +- `SHIFT_ALL(kc1, kc2)` Sends independent keycodes kc1 and kc2 depending on physical shift state while always sending shift. +- `SHIFT_NO(kc1, kc2)` Sends independent keycodes kc1 and kc2 depending on physical shift state while never sending shift. +- `SHIFT_ALGR(kc1, kc2)` Sends independent keycodes kc1 and kc2 depending on physical shift state while never sending shift and always sending ralt. +- `UML(kc)` Sends keycode kc without changing shift state and then escapes the `_DEADKEY` layer. + +Here is `SHIFT_NORM` as an example: +```c +#define SHIFT_NORM(kc1, kc2) \ +if (record->event.pressed) { \ + timer_timeout(); \ + if (lshift || rshift) { \ + register_code(KC_LSFT); \ + unregister_code(kc2); \ + register_code(kc2); \ + add_to_prev(kc2); \ + } else { \ + unregister_code(KC_LSFT); \ + unregister_code(kc1); \ + register_code(kc1); \ + } \ +} else { \ + unregister_code(kc1); \ + unregister_code(kc2); \ +} \ +return false; +``` + +It is noticeable that before registering a keycode the same keycode gets unregistered first. The reason for this is that there can now be two physical keys that use the same keycode only with different shift states. When rolling those two keys the keycode has to be unregistered first, otherwise the second key doesn't register. Also noticable is that sometimes the `add_to_prev` function is called. This will be explained later. The `timer_timeout` function is necessary to reset the timers of the custom space cadet shift functionality. + +It's worth mentioning that `SHIFT_ALGR` unlike the other templates doesn't allow repetition of characters when held. This is because it would otherwise require extensive checking of physical ralt status similar to shift to prevent ralt from getting stuck. + +#### Ensuring that shift state is always correct when pressing normal keycodes + +To ensure that non custom keycodes always get send with the correct shift state the default case in `process_record_user` includes a physical shift check that sets shift accordingly before registering the keycode. Also `timer_timeout` is always called to reset the space cadet shift timers to prevent unwanted parenthesis. + +```c +default: + if(record->event.pressed) { + timer_timeout(); + + #ifdef GERMAN_ENABLE + if (lshift || rshift) + register_code(KC_LSFT); + else + unregister_code(KC_LSFT); + #endif + + } + return process_record_keymap(keycode, record); +``` + +#### Ensuring that custom keycodes always produce the correct character + +When very specific key combinations that include custom keycodes and/or shift are pressed it can happen that wrong characters are produced due to changing shift states. The previously mentioned `add_to_prev` function is there to prevent that. It can be used to add a keycode to the `prev_kcs` array that can hold up to 6 keycodes. On various occasions, but mainly when shift is released `unreg_prev` is called, which then unregisters all saved keycodes. + +For real use this is probably not needed, but it doesn't hurt either. + +#### Adapting the templates for other languages + +In theory the templates can be used to create custom keycodes that map any layout to any other layout. + +## Other stuff + +### Custom Nav/Esc Key + +Since I'm always using a navigation layer with all my keyboards there is a `_NAV` layer predefined in [spacebarracecar.h](spacebarracecar.h) under `enum userspace_layers`. In addition to that I wanted to have a keycode that activates the navigation layer when held, but acts as Escape when pressed. In QMK there already exists `LT(layer, kc)`, however I found that there is some amount of lag before the layer is actived. Therefore I created a custom keycode CU_NAV that does the same without lag using a custom timer. Since I already need timers for the custom space cadet shift implementing this was very easy by adding the timer to the `timer_timeout` function. + +### Gamemode + +The userspace includes the custom keycode `CU_GAME` that is used to flip a boolean variable called `game`. That variable is used to enable/disable windows keys and space cadet shift. In my [planck keymap](../../keyboards/planck/keymaps/spacebarracecar/keymap.c) it also makes Lower act like Space which is more comfortable when resting on wasd and it could also be used to change various other things when gaming. -- cgit v1.2.3 From fc1e22ea94146d090af5b47a51fcc07cac7e677c Mon Sep 17 00:00:00 2001 From: lbibass Date: Thu, 25 Oct 2018 16:10:45 -0400 Subject: Keymap: Mechmini layout (#4232) * Added my Mechmini2 layout to qmk. * Added more info to the readme. * Made changes. * Update keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c Co-Authored-By: lbibass * Update keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c Co-Authored-By: lbibass --- .../mechmini/v2/keymaps/lbibass_625_space/config.h | 4 ++ .../mechmini/v2/keymaps/lbibass_625_space/keymap.c | 48 ++++++++++++++++++++++ .../v2/keymaps/lbibass_625_space/readme.md | 2 + .../mechmini/v2/keymaps/lbibass_625_space/rules.mk | 11 +++++ .../v2/keymaps/lbibass_split_space/config.h | 4 ++ .../v2/keymaps/lbibass_split_space/keymap.c | 33 +++++++++++++++ .../v2/keymaps/lbibass_split_space/readme.md | 2 + .../v2/keymaps/lbibass_split_space/rules.mk | 11 +++++ 8 files changed, 115 insertions(+) create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c create mode 100644 keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c create mode 100644 keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md create mode 100755 keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h b/keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h new file mode 100755 index 0000000000..7adb68d347 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define ONESHOT_TAP_TOGGLE 3 +#define TAPPING_TERM 200 diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c new file mode 100755 index 0000000000..40bfc42de0 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c @@ -0,0 +1,48 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN1 2 +#define _FN2 3 +#define _WIN 1 +//Tap Dance Declarations +enum +{ + TD_DOTCOM = 0 +}; +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_DOTCOM] = ACTION_TAP_DANCE_DOUBLE(KC_COMMA, KC_DOT) + // Other declarations would go here, separated by commas, if you have them +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT_625_space( + LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), + KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_RGUI, RGB_TOG), + [_WIN] = LAYOUT_625_space( + LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), + KC_ESC, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, RGB_TOG), + [_FN1] = LAYOUT_625_space( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + GUI_T(KC_ESC), KC_PGUP, KC_VOLU, KC_DEL, KC_TRNS, KC_BSLS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_TRNS, + KC_LSFT, KC_PGDN, KC_VOLD, BL_STEP, BL_TOGG, KC_SCLN, KC_QUOT, KC_SLSH, KC_DOT, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_625_space( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + + + + + diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md b/keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md new file mode 100644 index 0000000000..e09e520131 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/readme.md @@ -0,0 +1,2 @@ +# /u/Lbibass's 6.25u spacebar Mechmini 2.0 Layout. + diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk b/keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk new file mode 100755 index 0000000000..7bc50168df --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/rules.mk @@ -0,0 +1,11 @@ +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h b/keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h new file mode 100755 index 0000000000..2f35530627 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_split_space/config.h @@ -0,0 +1,4 @@ +#pragma once + +#define ONESHOT_TAP_TOGGLE 3 +#define TAPPING_TERM 200 diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c b/keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c new file mode 100755 index 0000000000..7ad2aa81e9 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c @@ -0,0 +1,33 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FN1 2 +#define _FN2 3 +#define _WIN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BL] = LAYOUT_split_space( + LT(2, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MO(2), KC_RSHIFT, + KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_SPC, KC_RGUI, KC_RALT, RGB_TOG), + [_WIN] = LAYOUT_split_space( + LT(2, KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, MO(2), KC_RSHIFT, + KC_ESC, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_RALT, KC_LCTL, RGB_TOG), + [_FN1] = LAYOUT_split_space( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_TRNS, KC_PGUP, KC_VOLU, KC_TRNS, KC_TRNS, KC_BSLS, KC_LBRC, KC_RBRC, KC_MINS, KC_EQL, KC_TRNS, + KC_LSFT, KC_PGDN, KC_VOLD, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_SLSH, KC_DOT, KC_RSHIFT, KC_HOME, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN2] = LAYOUT_split_space( + KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, + MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_END, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + +}; + diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md b/keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md new file mode 100644 index 0000000000..34888fbb19 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_split_space/readme.md @@ -0,0 +1,2 @@ +# /u/Lbibass's Split Space Mechmini 2.0 Layout + diff --git a/keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk b/keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk new file mode 100755 index 0000000000..fd3621e841 --- /dev/null +++ b/keyboards/mechmini/v2/keymaps/lbibass_split_space/rules.mk @@ -0,0 +1,11 @@ +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = no -- cgit v1.2.3 From fa1ac4d7242a0f3944d71b58926ff2a1ce73c96b Mon Sep 17 00:00:00 2001 From: Phillip Tennen Date: Fri, 26 Oct 2018 15:59:41 +0200 Subject: Fix incorrect doctoring in feature.backlight.md (#4244) I'm guessing someone deleted a row at some point in the past, but I didn't blame it. --- docs/feature_backlight.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 8f883e08fb..7bb7e03a89 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -61,7 +61,7 @@ In this handler, the value of an incrementing counter is mapped onto a precomput |`backlight_increase()` |Increase the backlight level | |`backlight_decrease()` |Decrease the backlight level | |`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()`|Toggle backlight breathing | +|`get_backlight_level()`|Return the current backlight level | ### Backlight Breathing Functions -- cgit v1.2.3 From 39addf8bc99e6282e655298c2c24da07a5ef77f8 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:34:40 -0700 Subject: JD45: layout macro refactor The macro that was LAYOUT prepended KC_ to all the keycode arguments, preventing the Configurator from working with the JD45. This macro is now LAYOUT_kc. The macro LAYOUT is a more-standard macro. Switch identifiers have changed throughout. Format is k. --- keyboards/jd45/jd45.h | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/keyboards/jd45/jd45.h b/keyboards/jd45/jd45.h index 48641c199a..105a8acb60 100644 --- a/keyboards/jd45/jd45.h +++ b/keyboards/jd45/jd45.h @@ -6,15 +6,27 @@ /* JD45 keymap definition macro */ #define LAYOUT( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ - K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ - K38, K39, K40, K41, K42, K43, K44, K45, K46, K47 \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k36, k38, k39, k3a, k3b \ ) { \ - { KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K10, KC_##K11, KC_##K12, KC_##K13 }, \ - { KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_NO }, \ - { KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_NO }, \ - { KC_##K38, KC_##K39, KC_##K40, KC_##K41, KC_##K42, KC_NO, KC_##K43, KC_NO, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_NO } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, KC_NO }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, KC_NO }, \ + { k30, k31, k32, k33, k34, KC_NO, k36, KC_NO, k38, k39, k3a, k3b, KC_NO } \ +} + +#define LAYOUT_kc( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k36, k38, k39, k3a, k3b \ +) { \ + { KC_##k00, KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k06, KC_##k07, KC_##k08, KC_##k09, KC_##k0a, KC_##k0b, KC_##k0c }, \ + { KC_##k10, KC_##k11, KC_##k12, KC_##k13, KC_##k14, KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k1a, KC_##k1b, KC_NO }, \ + { KC_##k20, KC_##k21, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26, KC_##k27, KC_##k28, KC_##k29, KC_##k2a, KC_##k2b, KC_NO }, \ + { KC_##k30, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_NO, KC_##k36, KC_NO, KC_##k38, KC_##k39, KC_##k3a, KC_##k3b, KC_NO } \ } #endif -- cgit v1.2.3 From 899731679d262023a9e25eba805b3674b1ceb82e Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:38:45 -0700 Subject: JD45: blakedietz keymap refactor - config.h - updated to more-preferred format - layout macro LAYOUT_JD45 removed (identical to new macro LAYOUT) - keymap.c - updated to use macro LAYOUT - redundant KC_TRNS and KC_NO definitions removed --- keyboards/jd45/keymaps/blakedietz/config.h | 19 ++----------------- keyboards/jd45/keymaps/blakedietz/keymap.c | 18 +++++++----------- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/keyboards/jd45/keymaps/blakedietz/config.h b/keyboards/jd45/keymaps/blakedietz/config.h index 38d850ef6e..eb4cf3bdfb 100644 --- a/keyboards/jd45/keymaps/blakedietz/config.h +++ b/keyboards/jd45/keymaps/blakedietz/config.h @@ -1,19 +1,4 @@ -#include "../../config.h" - -/** - *JD45 keymap definition macro - */ -#define LAYOUT_JD45( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ - K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ - K38, K39, K40, K41, K42, K43, K44, K45, K46, K47 \ -) { \ - { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13 }, \ - { K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, KC_NO }, \ - { K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, KC_NO }, \ - { K38, K39, K40, K41, K42, KC_NO, K43, KC_NO, K44, K45, K46, K47, KC_NO } \ -} +#pragma once /** * This makes it possible to do rolling combos (zx) with keys that convert to other keys on hold (z becomes ctrl when @@ -28,4 +13,4 @@ #define MOUSEKEY_DELAY 0 #define MOUSEKEY_TIME_TO_MAX 5 #define MOUSEKEY_MAX_SPEED 2 -#define MOUSEKEY_WHEEL_DELAY 0 \ No newline at end of file +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/jd45/keymaps/blakedietz/keymap.c b/keyboards/jd45/keymaps/blakedietz/keymap.c index bde760a223..a40a2c604e 100644 --- a/keyboards/jd45/keymaps/blakedietz/keymap.c +++ b/keyboards/jd45/keymaps/blakedietz/keymap.c @@ -45,10 +45,6 @@ enum macro_keycodes KC_AG_TAB_R, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - /** * This section of macros is for tap or hold functionality. Keys will fire off the second symbol in the name if tapped * or fire the first symbol in the name if held. For example @@ -101,7 +97,7 @@ enum macro_keycodes * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_JD45( + [_QWERTY] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, ALL_T(KC_NO), /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -124,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_LOWER] = LAYOUT_JD45( + [_LOWER] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -146,7 +142,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_RAISE] = LAYOUT_JD45( + [_RAISE] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -169,7 +165,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_MOUSECURSOR] = LAYOUT_JD45( + [_MOUSECURSOR] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -191,7 +187,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | Reset | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_ADJUST] = LAYOUT_JD45( + [_ADJUST] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, @@ -214,7 +210,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_VIM] = LAYOUT_JD45( + [_VIM] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -236,7 +232,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_MEDIA] = LAYOUT_JD45( + [_MEDIA] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ -- cgit v1.2.3 From 340dd097580f27d9f8ffaad78371869d883220d1 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:40:12 -0700 Subject: JD45: default keymap refactor Default keymap refactored to use new macro LAYOUT (from LAYOUT_kc). --- keyboards/jd45/keymaps/default/keymap.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/keyboards/jd45/keymaps/default/keymap.c b/keyboards/jd45/keymaps/default/keymap.c index 0bb519f5fc..61e051a360 100644 --- a/keyboards/jd45/keymaps/default/keymap.c +++ b/keyboards/jd45/keymaps/default/keymap.c @@ -5,13 +5,10 @@ */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - ESC, Q, W, E, R, T, Y, U, I, O, P, QUOT, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - PAUSE, LCTL, LALT, DEL, SPC, DEL, LEFT, UP, DOWN, RIGHT), -}; - -const uint16_t PROGMEM fn_actions[] = { - + [0] = LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_PAUS, KC_LCTL, KC_LALT, KC_DEL, KC_SPC, KC_DEL, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT + ), }; -- cgit v1.2.3 From 8cf15bffa0693caa99d1b9ddc5c6ecc0936f2605 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:45:14 -0700 Subject: JD45: jeebak keymap refactor - config.h deleted (file was redundant) - layout macro LAYOUT_JD45 removed (identical to new macro LAYOUT) - ../../config.h include line redundant due to past changes to build script - keymap.c - updated to use macro LAYOUT - redundant KC_TRNS and KC_NO definitions removed --- keyboards/jd45/keymaps/jeebak/config.h | 16 ---------------- keyboards/jd45/keymaps/jeebak/keymap.c | 22 +++++++++------------- 2 files changed, 9 insertions(+), 29 deletions(-) delete mode 100644 keyboards/jd45/keymaps/jeebak/config.h diff --git a/keyboards/jd45/keymaps/jeebak/config.h b/keyboards/jd45/keymaps/jeebak/config.h deleted file mode 100644 index bfaa128937..0000000000 --- a/keyboards/jd45/keymaps/jeebak/config.h +++ /dev/null @@ -1,16 +0,0 @@ -#include "../../config.h" - -/** - *JD45 keymap definition macro - */ -#define LAYOUT_JD45( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ - K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ - K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ - K38, K39, K40, K41, K42, K43, K44, K45, K46, K47 \ -) { \ - { K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13 }, \ - { K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, KC_NO }, \ - { K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, KC_NO }, \ - { K38, K39, K40, K41, K42, KC_NO, K43, KC_NO, K44, K45, K46, K47, KC_NO } \ -} diff --git a/keyboards/jd45/keymaps/jeebak/keymap.c b/keyboards/jd45/keymaps/jeebak/keymap.c index c711939fcf..bb6c829382 100644 --- a/keyboards/jd45/keymaps/jeebak/keymap.c +++ b/keyboards/jd45/keymaps/jeebak/keymap.c @@ -48,10 +48,6 @@ enum macro_keycodes KC_AG_TAB_R, }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Custom macros #define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl #define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift @@ -91,7 +87,7 @@ enum macro_keycodes */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_JD45( + [_QWERTY] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -113,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_COLEMAK] = LAYOUT_JD45( + [_COLEMAK] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -135,7 +131,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_DVORAK] = LAYOUT_JD45( + [_DVORAK] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -157,7 +153,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_LOWER] = LAYOUT_JD45( + [_LOWER] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -179,7 +175,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_RAISE] = LAYOUT_JD45( + [_RAISE] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -205,7 +201,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * seem to work on Mac. Presumably they'll work under Windows. */ - [_TOUCHCURSOR] = LAYOUT_JD45( + [_TOUCHCURSOR] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, _______, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -228,7 +224,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_MOUSECURSOR] = LAYOUT_JD45( + [_MOUSECURSOR] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______, _______, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -251,7 +247,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_PLOVER] = LAYOUT_JD45( + [_PLOVER] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ @@ -273,7 +269,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | Reset | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ - [_ADJUST] = LAYOUT_JD45( + [_ADJUST] = LAYOUT( /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ -- cgit v1.2.3 From 357c1bb657cfa2c65c73b8b12929725db2465bf4 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:58:20 -0700 Subject: JD45: justin keymap refactor Updated parallel to LAYOUT_kc macro rename. --- keyboards/jd45/keymaps/justin/keymap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/jd45/keymaps/justin/keymap.c b/keyboards/jd45/keymaps/justin/keymap.c index a797582b07..4590374e9b 100644 --- a/keyboards/jd45/keymaps/justin/keymap.c +++ b/keyboards/jd45/keymaps/justin/keymap.c @@ -1,27 +1,27 @@ #include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_kc( ESC, Q, W, F, P, G, J, L, U, Y, SCLN, QUOT, BSPC, FN8, A, R, S, T, D, H, N, E, I, O, ENT, LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, FN6, FN4, LGUI, FN7, FN2, FN1, SPC, FN5, RALT, FN3, FN0), - [1] = LAYOUT( + [1] = LAYOUT_kc( TRNS, FN10, FN11, FN12, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, DEL, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGUP, LEFT, RGHT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, END, PGDN, DOWN, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - [2] = LAYOUT( + [2] = LAYOUT_kc( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, TRNS, FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS), - [3] = LAYOUT( + [3] = LAYOUT_kc( TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - [4] = LAYOUT( + [4] = LAYOUT_kc( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, -- cgit v1.2.3 From db8454ca99b58c31ea25954b4ca513d38e5b8c72 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 25 Oct 2018 23:59:20 -0700 Subject: JD45: mjt keymap refactor Updated parallel to LAYOUT_kc macro rename. --- keyboards/jd45/keymaps/mjt/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/jd45/keymaps/mjt/keymap.c b/keyboards/jd45/keymaps/mjt/keymap.c index a53b09642a..f806de65d9 100644 --- a/keyboards/jd45/keymaps/mjt/keymap.c +++ b/keyboards/jd45/keymaps/mjt/keymap.c @@ -4,23 +4,23 @@ */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( + [0] = LAYOUT_kc( TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, BSLS, FN1, A, S, D, F, G, H, J, K, L, QUOT, ENT, FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO), - [1] = LAYOUT( + [1] = LAYOUT_kc( GRV, TRNS, UP, TRNS, 7, 8, 9, 0, MINS, EQL, PSCR, LBRC, RBRC, TRNS, LEFT, DOWN, RGHT, 4, 5, 6, INS, HOME, PGUP, SCLN, TRNS, TRNS, TRNS, TRNS, TRNS, 1, 2, 3, DEL, END, PGDN, TRNS, TRNS, TRNS, TRNS, TRNS, SPC, TRNS, DEL, TRNS, FN3, TRNS, TRNS), - [2] = LAYOUT( + [2] = LAYOUT_kc( TRNS, TRNS, VOLU, TRNS, F7, F8, F9, F10, F11, F12, PSCR, FN3, FN4, TRNS, MPRV, VOLD, MNXT, F4, F5, F6, J, K, L, SCLN, TRNS, TRNS, TRNS, TRNS, TRNS, F1, F2, F3, MUTE, MPRV, MNXT, MSTP, TRNS, TRNS, TRNS, TRNS, LGUI, TRNS, TRNS, TRNS, TRNS, PAUS, TRNS) /* , -[3] = LAYOUT( +[3] = LAYOUT_kc( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BTLD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, -- cgit v1.2.3 From ca02863b569fb9a3bf21967942567149b562e2be Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 26 Oct 2018 00:03:00 -0700 Subject: JD45: mjt6u keymap refactor - config.h - updated to remove redundancies - add #pragma once - keymap.c - updated to use macro LAYOUT - redundant KC_TRNS and KC_NO definitions removed --- keyboards/jd45/keymaps/mjt6u/config.h | 83 +---------------------------------- keyboards/jd45/keymaps/mjt6u/keymap.c | 62 ++++++++++++++++++++------ 2 files changed, 50 insertions(+), 95 deletions(-) diff --git a/keyboards/jd45/keymaps/mjt6u/config.h b/keyboards/jd45/keymaps/mjt6u/config.h index bf9dc6df3b..41d1557c6f 100644 --- a/keyboards/jd45/keymaps/mjt6u/config.h +++ b/keyboards/jd45/keymaps/mjt6u/config.h @@ -1,84 +1,3 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER geekhack -#define PRODUCT JD45 -#define DESCRIPTION q.m.k. keyboard firmware for JD45 - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 13 - -/* Planck PCB default pin-out */ -#define MATRIX_ROW_PINS { F0, F1, F5, B4 } -#define MATRIX_COL_PINS { F4, D7, B5, B6, C6, C7, D4, D6, D5, D0, D1, D2, B0 } -#define UNUSED_PINS - -#define BACKLIGHT_PIN B7 +#pragma once #define USB_MAX_POWER_CONSUMPTION 50 - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * 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 - -#endif diff --git a/keyboards/jd45/keymaps/mjt6u/keymap.c b/keyboards/jd45/keymaps/mjt6u/keymap.c index c17a07fd04..4c0b8828a5 100644 --- a/keyboards/jd45/keymaps/mjt6u/keymap.c +++ b/keyboards/jd45/keymaps/mjt6u/keymap.c @@ -25,25 +25,61 @@ enum jd45_keycodes #define LONGPRESS_DELAY 150 #define LAYER_TOGGLE_DELAY 900 -#define _______ KC_TRNS #define __MOD__ KC_TRNS -#define XXXXXXX KC_NO #define F_FNSPC F(0) #define F_NUMSPC F(1) #define F_FNTAB F(2) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = { - {F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, - {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, - {XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_FNSPC, XXXXXXX, XXXXXXX, MO(_FUNCTION), MO(_ADJUST)}}, - [_QWERTYNUMMODS] = {{F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, {XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_NUMSPC, XXXXXXX, XXXXXXX, MO(_FKEYNUMPAD), MO(_ADJUST)}}, - [_NUMSYM] = {{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_DEL}, {__MOD__, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______}, {_______, _______, _______, _______, _______, KC_SPC, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______}, {XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, - [_FUNCTION] = {{__MOD__, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {__MOD__, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, - [_NUMPAD] = {{KC_GRV, _______, KC_UP, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_PSCR, KC_LBRC, KC_RBRC}, {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_4, KC_5, KC_6, KC_INS, KC_HOME, KC_PGUP, _______, _______}, {_______, _______, _______, _______, KC_1, KC_2, KC_3, KC_DEL, KC_END, KC_PGDN, _______, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, - [_FKEYNUMPAD] = {{_______, _______, KC_VOLU, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, _______, _______}, {_______, KC_MPRV, KC_VOLD, KC_MNXT, KC_F4, KC_F5, KC_F6, KC_J, KC_K, KC_L, KC_SCLN, _______}, {_______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_MUTE, KC_MPRV, KC_MNXT, KC_MSTP, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, - [_ADJUST] = {{_______, RESET, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, KC_PSCR, _______, _______}, {_______, _______, _______, _______, USEFNMODS, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, MACSLEEP, _______, _______}, {_______, _______, _______, _______, _______, _______, USENUMMODS, _______, _______, _______, _______, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}}; + [_QWERTY] = LAYOUT( \ + F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC, \ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT), \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ + XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, F_FNSPC, XXXXXXX, MO(_FUNCTION), MO(_ADJUST), XXXXXXX \ + ), + + [_QWERTYNUMMODS] = LAYOUT( \ + F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC, \ + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT), \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \ + XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, F_NUMSPC, XXXXXXX, MO(_FKEYNUMPAD), MO(_ADJUST), XXXXXXX \ + ), + + [_NUMSYM] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_DEL, \ + __MOD__, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, \ + XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, _______, XXXXXXX, __MOD__, __MOD__, XXXXXXX \ + ), + + [_FUNCTION] = LAYOUT( \ + __MOD__, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + __MOD__, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, _______, XXXXXXX, __MOD__, __MOD__, XXXXXXX \ + ), + + [_NUMPAD] = LAYOUT( \ + KC_GRV, _______, KC_UP, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_PSCR, KC_LBRC, KC_RBRC, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_4, KC_5, KC_6, KC_INS, KC_HOME, KC_PGUP, _______, _______, \ + _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_DEL, KC_END, KC_PGDN, _______, _______, \ + XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, __MOD__, __MOD__, XXXXXXX \ + ), + + [_FKEYNUMPAD] = LAYOUT( \ + _______, _______, KC_VOLU, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, _______, _______, \ + _______, KC_MPRV, KC_VOLD, KC_MNXT, KC_F4, KC_F5, KC_F6, KC_J, KC_K, KC_L, KC_SCLN, _______, \ + _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_MUTE, KC_MPRV, KC_MNXT, KC_MSTP, _______, \ + XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, __MOD__, __MOD__, XXXXXXX \ + ), + + [_ADJUST] = LAYOUT( \ + _______, RESET, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, KC_PSCR, _______, _______, \ + _______, _______, _______, _______, USEFNMODS, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, MACSLEEP, _______, _______, \ + _______, _______, _______, _______, _______, _______, USENUMMODS, _______, _______, _______, _______, _______, \ + XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, __MOD__, __MOD__, XXXXXXX \ + ) +}; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_LAYER_TAP_KEY(_NUMSYM, KC_SPC), -- cgit v1.2.3 From cc8744548108b1c1f820fb411ac3bf313aca1f5f Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 26 Oct 2018 00:12:07 -0700 Subject: JD45: readme update Updated the links to the Docs. --- keyboards/jd45/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/jd45/readme.md b/keyboards/jd45/readme.md index d85a521269..7ef02bd4fa 100644 --- a/keyboards/jd45/readme.md +++ b/keyboards/jd45/readme.md @@ -11,4 +11,4 @@ Make example for this keyboard (after setting up your build environment): make jd45:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From e22c3992454ade93ccaef70ab077e79a4b2a5ef0 Mon Sep 17 00:00:00 2001 From: gromwalh <15847180+gromwalh@users.noreply.github.com> Date: Fri, 26 Oct 2018 14:12:40 -0700 Subject: Ergodox Infinity: Swapped Row and Column in comments (#4247) When comparing the pins in this file to the Ergodox Infinity schematic, it seems that the first section is describing the rows and the second section is describing the columns. --- keyboards/ergodox_infinity/matrix.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/ergodox_infinity/matrix.c b/keyboards/ergodox_infinity/matrix.c index 3baa07f583..3a0a179286 100644 --- a/keyboards/ergodox_infinity/matrix.c +++ b/keyboards/ergodox_infinity/matrix.c @@ -44,14 +44,14 @@ static uint16_t debouncing_time = 0; void matrix_init(void) { - /* Column(sense) */ + /* Row(sense) */ palSetPadMode(GPIOD, 1, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 4, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 5, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 6, PAL_MODE_INPUT_PULLDOWN); palSetPadMode(GPIOD, 7, PAL_MODE_INPUT_PULLDOWN); - /* Row(strobe) */ + /* Column(strobe) */ palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 3, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 18, PAL_MODE_OUTPUT_PUSHPULL); -- cgit v1.2.3 From 85688e5b52112c86895171d3dc8b26610480e932 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 26 Oct 2018 16:19:23 -0400 Subject: add support for encoders to core --- common_features.mk | 5 +++ docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/feature_encoders.md | 41 +++++++++++++++++++++++++ keyboards/planck/planck.h | 2 ++ keyboards/planck/rev6/config.h | 4 +++ keyboards/planck/rev6/matrix.c | 29 ----------------- keyboards/planck/rev6/rules.mk | 1 + quantum/encoder.c | 70 ++++++++++++++++++++++++++++++++++++++++++ quantum/encoder.h | 29 +++++++++++++++++ quantum/quantum.c | 12 ++++++++ 11 files changed, 166 insertions(+), 29 deletions(-) create mode 100644 docs/feature_encoders.md create mode 100644 quantum/encoder.c create mode 100644 quantum/encoder.h diff --git a/common_features.mk b/common_features.mk index 65ff6b5b38..3fd8361a52 100644 --- a/common_features.mk +++ b/common_features.mk @@ -219,6 +219,11 @@ ifeq ($(strip $(USB_HID_ENABLE)), yes) include $(TMK_DIR)/protocol/usb_hid.mk endif +ifeq ($(strip $(ENCODER_ENABLE)), yes) + SRC += $(QUANTUM_DIR)/encoder.c + OPT_DEFS += -DENCODER_ENABLE +endif + ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += drivers/avr/hd44780.c OPT_DEFS += -DHD44780_ENABLE diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 465f4657cd..2c57380122 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -52,6 +52,7 @@ * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) + * [Encoders](feature_encoders.md) * [Grave Escape](feature_grave_esc.md) * [Key Lock](feature_key_lock.md) * [Layouts](feature_layouts.md) diff --git a/docs/_summary.md b/docs/_summary.md index 465f4657cd..2c57380122 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -52,6 +52,7 @@ * [Combos](feature_combo) * [Command](feature_command.md) * [Dynamic Macros](feature_dynamic_macros.md) + * [Encoders](feature_encoders.md) * [Grave Escape](feature_grave_esc.md) * [Key Lock](feature_key_lock.md) * [Layouts](feature_layouts.md) diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md new file mode 100644 index 0000000000..f482eefec8 --- /dev/null +++ b/docs/feature_encoders.md @@ -0,0 +1,41 @@ +# Encoders + +Basic encoders are supported by adding this to your `rules.mk`: + + ENCODER_ENABLE = yes + +and this to your `config.h`: + + #define NUMBER_OF_ENCODERS 1 + #define ENCODERS_PAD_A { B12 } + #define ENCODERS_PAD_B { B13 } + +Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: + + #define ENCODERS_PAD_A { encoder1a, encoder2a } + #define ENCODERS_PAD_B { encoder1a, encoder2b } + +If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. + +Additionally, the resolution can be specified in the same file (the default & suggested is 4): + + #define ENCODER_RESOLUTION 4 + +## Callbacks + +The callback functions can be inserted into your `.c`: + + void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_update_user(index, clockwise); + } + +or `keymap.c`: + + void encoder_update_user(uint8_t index, bool clockwise) { + + } + + +## Hardware + +The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. diff --git a/keyboards/planck/planck.h b/keyboards/planck/planck.h index f0a12d9335..d908d80ec4 100644 --- a/keyboards/planck/planck.h +++ b/keyboards/planck/planck.h @@ -3,6 +3,8 @@ #include "quantum.h" +#define encoder_update(clockwise) encoder_update_user(uint8_t index, clockwise) + #ifdef __AVR__ #define LAYOUT_planck_mit( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ diff --git a/keyboards/planck/rev6/config.h b/keyboards/planck/rev6/config.h index afd69f7d84..c0fbb412ee 100644 --- a/keyboards/planck/rev6/config.h +++ b/keyboards/planck/rev6/config.h @@ -43,6 +43,10 @@ * #define UNUSED_PINS */ +#define NUMBER_OF_ENCODERS 1 +#define ENCODERS_PAD_A { B12 } +#define ENCODERS_PAD_B { B13 } + #define MUSIC_MAP #undef AUDIO_VOICES #undef C6_AUDIO diff --git a/keyboards/planck/rev6/matrix.c b/keyboards/planck/rev6/matrix.c index e4ebe48acc..2df588cefc 100644 --- a/keyboards/planck/rev6/matrix.c +++ b/keyboards/planck/rev6/matrix.c @@ -21,10 +21,6 @@ static matrix_row_t matrix_debouncing[MATRIX_COLS]; static bool debouncing = false; static uint16_t debouncing_time = 0; -static uint8_t encoder_state = 0; -static int8_t encoder_value = 0; -static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; - static bool dip_switch[4] = {0, 0, 0, 0}; __attribute__ ((weak)) @@ -53,12 +49,6 @@ void matrix_init(void) { palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLUP); palSetPadMode(GPIOB, 9, PAL_MODE_INPUT_PULLUP); - // encoder setup - palSetPadMode(GPIOB, 12, PAL_MODE_INPUT_PULLUP); - palSetPadMode(GPIOB, 13, PAL_MODE_INPUT_PULLUP); - - encoder_state = (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); - // actual matrix setup palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); @@ -87,15 +77,8 @@ void matrix_init(void) { __attribute__ ((weak)) void dip_update(uint8_t index, bool active) { } -__attribute__ ((weak)) -void encoder_update(bool clockwise) { } - bool last_dip_switch[4] = {0}; -#ifndef ENCODER_RESOLUTION - #define ENCODER_RESOLUTION 4 -#endif - uint8_t matrix_scan(void) { // dip switch dip_switch[0] = !palReadPad(GPIOB, 14); @@ -108,18 +91,6 @@ uint8_t matrix_scan(void) { } memcpy(last_dip_switch, dip_switch, sizeof(&dip_switch)); - // encoder on B12 and B13 - encoder_state <<= 2; - encoder_state |= (palReadPad(GPIOB, 12) << 0) | (palReadPad(GPIOB, 13) << 1); - encoder_value += encoder_LUT[encoder_state & 0xF]; - if (encoder_value >= ENCODER_RESOLUTION) { - encoder_update(0); - } - if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise - encoder_update(1); - } - encoder_value %= ENCODER_RESOLUTION; - // actual matrix for (int col = 0; col < MATRIX_COLS; col++) { matrix_row_t data = 0; diff --git a/keyboards/planck/rev6/rules.mk b/keyboards/planck/rev6/rules.mk index 3603e287b3..dce683a7ff 100644 --- a/keyboards/planck/rev6/rules.mk +++ b/keyboards/planck/rev6/rules.mk @@ -54,3 +54,4 @@ CUSTOM_MATRIX = yes # Custom matrix file AUDIO_ENABLE = yes RGBLIGHT_ENABLE = no # SERIAL_LINK_ENABLE = yes +ENCODER_ENABLE = yes diff --git a/quantum/encoder.c b/quantum/encoder.c new file mode 100644 index 0000000000..6629a098b8 --- /dev/null +++ b/quantum/encoder.c @@ -0,0 +1,70 @@ +/* + * Copyright 2018 Jack Humbert + * + * 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 . + */ + +#include "encoder.h" + +#ifndef ENCODER_RESOLUTION + #define ENCODER_RESOLUTION 4 +#endif + +#ifndef NUMBER_OF_ENCODERS + #error "Number of encoders not defined by NUMBER_OF_ENCODERS" +#endif + +#if !defined(ENCODERS_PAD_A) || !defined(ENCODERS_PAD_B) + #error "No encoder pads defined by ENCODERS_PAD_A and ENCODERS_PAD_B" +#endif + +static pin_t encoders_pad_a[NUMBER_OF_ENCODERS] = ENCODERS_PAD_A; +static pin_t encoders_pad_b[NUMBER_OF_ENCODERS] = ENCODERS_PAD_B; + +static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; + +static uint8_t encoder_state[NUMBER_OF_ENCODERS] = {0}; +static int8_t encoder_value[NUMBER_OF_ENCODERS] = {0}; + +__attribute__ ((weak)) +void encoder_update_user(int8_t index, bool clockwise) { } + +__attribute__ ((weak)) +void encoder_update_kb(int8_t index, bool clockwise) { + encoder_update_user(index, clockwise); +} + +void encoder_init(void) { + for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { + setPinInputHigh(encoders_pad_a[i]); + setPinInputHigh(encoders_pad_b[i]); + + encoder_state[i] = (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); + } +} + +void encoder_read(void) { + for (int i = 0; i < NUMBER_OF_ENCODERS; i++) { + encoder_state[i] <<= 2; + encoder_state[i] |= (readPin(encoders_pad_a[i]) << 0) | (readPin(encoders_pad_b[i]) << 1); + encoder_value[i] += encoder_LUT[encoder_state[i] & 0xF]; + if (encoder_value[i] >= ENCODER_RESOLUTION) { + encoder_update_kb(i, COUNTRECLOCKWISE); + } + if (encoder_value[i] <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise + encoder_update_kb(i, CLOCKWISE); + } + encoder_value[i] %= ENCODER_RESOLUTION; + } +} diff --git a/quantum/encoder.h b/quantum/encoder.h new file mode 100644 index 0000000000..2024fa303f --- /dev/null +++ b/quantum/encoder.h @@ -0,0 +1,29 @@ +/* + * Copyright 2018 Jack Humbert + * + * 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 + +#include "quantum.h" + +#define COUNTRECLOCKWISE 0 +#define CLOCKWISE 1 + +void encoder_init(void); +void encoder_read(void); + +void encoder_update_kb(int8_t index, bool clockwise); +void encoder_update_user(int8_t index, bool clockwise); diff --git a/quantum/quantum.c b/quantum/quantum.c index eed59f811e..c9bec6740b 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -42,6 +42,11 @@ extern backlight_config_t backlight_config; #include "process_midi.h" #endif + +#ifdef ENCODER_ENABLE +#include "encoder.h" +#endif + #ifdef AUDIO_ENABLE #ifndef GOODBYE_SONG #define GOODBYE_SONG SONG(GOODBYE_SOUND) @@ -957,6 +962,9 @@ void matrix_init_quantum() { #ifdef RGB_MATRIX_ENABLE rgb_matrix_init(); #endif + #ifdef ENCODER_ENABLE + encoder_init(); + #endif matrix_init_kb(); } @@ -991,6 +999,10 @@ void matrix_scan_quantum() { rgb_matrix_task_counter = ((rgb_matrix_task_counter + 1) % (RGB_MATRIX_SKIP_FRAMES + 1)); #endif + #ifdef ENCODER_ENABLE + encoder_read(); + #endif + matrix_scan_kb(); } #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_PIN) -- cgit v1.2.3 From 24b3556e844ec76813a42ce4c5b7a77a6f874d5a Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 26 Oct 2018 16:47:00 -0400 Subject: add better example --- docs/feature_encoders.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index f482eefec8..036c6a1d89 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -32,10 +32,17 @@ The callback functions can be inserted into your `.c`: or `keymap.c`: void encoder_update_user(uint8_t index, bool clockwise) { - + if (index == 0) { + if (clockwise) { + register_code(KC_PGDN); + unregister_code(KC_PGDN); + } else { + register_code(KC_PGUP); + unregister_code(KC_PGUP); + } + } } - ## Hardware The A an B lines of the encoders should be wired directly to the MCU, and the C/common lines should be wired to ground. -- cgit v1.2.3 From 6fa3cfbf534b54290f693dc1986437aebd092b32 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 27 Oct 2018 00:14:29 +0100 Subject: Keyboard: Add HS60 V2 (#4250) * HS60 V2 - Created V1 and V2 folders - Added V2 ARM configuration * Problems in paradise * More touble * We got it now! --- keyboards/hs60/config.h | 146 -- keyboards/hs60/hs60.c | 496 ------ keyboards/hs60/hs60.h | 52 - keyboards/hs60/info.json | 15 - keyboards/hs60/keymaps/ansi/config.h | 26 - keyboards/hs60/keymaps/ansi/keymap.c | 46 - keyboards/hs60/keymaps/ansi/readme.md | 6 - keyboards/hs60/keymaps/default/keymap.c | 46 - keyboards/hs60/keymaps/default/readme.md | 6 - keyboards/hs60/readme.md | 18 - keyboards/hs60/rules.mk | 74 - keyboards/hs60/v1/config.h | 143 ++ keyboards/hs60/v1/info.json | 15 + keyboards/hs60/v1/keymaps/ansi/config.h | 21 + keyboards/hs60/v1/keymaps/ansi/keymap.c | 46 + keyboards/hs60/v1/keymaps/ansi/readme.md | 6 + keyboards/hs60/v1/keymaps/default/keymap.c | 46 + keyboards/hs60/v1/keymaps/default/readme.md | 6 + keyboards/hs60/v1/readme.md | 18 + keyboards/hs60/v1/rules.mk | 74 + keyboards/hs60/v1/v1.c | 495 ++++++ keyboards/hs60/v1/v1.h | 52 + .../hs60/v2/boards/GENERIC_STM32_F303XC/board.c | 126 ++ .../hs60/v2/boards/GENERIC_STM32_F303XC/board.h | 1187 ++++++++++++++ .../hs60/v2/boards/GENERIC_STM32_F303XC/board.mk | 5 + keyboards/hs60/v2/bootloader_defs.h | 7 + keyboards/hs60/v2/chconf.h | 520 ++++++ keyboards/hs60/v2/config.h | 117 ++ keyboards/hs60/v2/halconf.h | 388 +++++ keyboards/hs60/v2/info.json | 1650 ++++++++++++++++++++ keyboards/hs60/v2/keymaps/ansi/config.h | 21 + keyboards/hs60/v2/keymaps/ansi/keymap.c | 46 + keyboards/hs60/v2/keymaps/ansi/readme.md | 6 + keyboards/hs60/v2/keymaps/default/keymap.c | 46 + keyboards/hs60/v2/keymaps/default/readme.md | 6 + keyboards/hs60/v2/keymaps/hhkb/config.h | 21 + keyboards/hs60/v2/keymaps/hhkb/keymap.c | 46 + keyboards/hs60/v2/mcuconf.h | 257 +++ keyboards/hs60/v2/readme.md | 18 + keyboards/hs60/v2/rules.mk | 58 + keyboards/hs60/v2/v2.c | 635 ++++++++ keyboards/hs60/v2/v2.h | 67 + 42 files changed, 6149 insertions(+), 931 deletions(-) delete mode 100644 keyboards/hs60/config.h delete mode 100644 keyboards/hs60/hs60.c delete mode 100644 keyboards/hs60/hs60.h delete mode 100644 keyboards/hs60/info.json delete mode 100644 keyboards/hs60/keymaps/ansi/config.h delete mode 100644 keyboards/hs60/keymaps/ansi/keymap.c delete mode 100644 keyboards/hs60/keymaps/ansi/readme.md delete mode 100644 keyboards/hs60/keymaps/default/keymap.c delete mode 100644 keyboards/hs60/keymaps/default/readme.md delete mode 100644 keyboards/hs60/readme.md delete mode 100644 keyboards/hs60/rules.mk create mode 100644 keyboards/hs60/v1/config.h create mode 100644 keyboards/hs60/v1/info.json create mode 100644 keyboards/hs60/v1/keymaps/ansi/config.h create mode 100644 keyboards/hs60/v1/keymaps/ansi/keymap.c create mode 100644 keyboards/hs60/v1/keymaps/ansi/readme.md create mode 100644 keyboards/hs60/v1/keymaps/default/keymap.c create mode 100644 keyboards/hs60/v1/keymaps/default/readme.md create mode 100644 keyboards/hs60/v1/readme.md create mode 100644 keyboards/hs60/v1/rules.mk create mode 100644 keyboards/hs60/v1/v1.c create mode 100644 keyboards/hs60/v1/v1.h create mode 100644 keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c create mode 100644 keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h create mode 100644 keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk create mode 100644 keyboards/hs60/v2/bootloader_defs.h create mode 100644 keyboards/hs60/v2/chconf.h create mode 100644 keyboards/hs60/v2/config.h create mode 100644 keyboards/hs60/v2/halconf.h create mode 100644 keyboards/hs60/v2/info.json create mode 100644 keyboards/hs60/v2/keymaps/ansi/config.h create mode 100644 keyboards/hs60/v2/keymaps/ansi/keymap.c create mode 100644 keyboards/hs60/v2/keymaps/ansi/readme.md create mode 100644 keyboards/hs60/v2/keymaps/default/keymap.c create mode 100644 keyboards/hs60/v2/keymaps/default/readme.md create mode 100644 keyboards/hs60/v2/keymaps/hhkb/config.h create mode 100644 keyboards/hs60/v2/keymaps/hhkb/keymap.c create mode 100644 keyboards/hs60/v2/mcuconf.h create mode 100644 keyboards/hs60/v2/readme.md create mode 100644 keyboards/hs60/v2/rules.mk create mode 100644 keyboards/hs60/v2/v2.c create mode 100644 keyboards/hs60/v2/v2.h diff --git a/keyboards/hs60/config.h b/keyboards/hs60/config.h deleted file mode 100644 index 31f7c07901..0000000000 --- a/keyboards/hs60/config.h +++ /dev/null @@ -1,146 +0,0 @@ -/* -Copyright 2018 Yiancar - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0257 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Yiancar-Designs -#define PRODUCT HS60 -#define DESCRIPTION GH60 compatible, tool free RGB keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B0, B1, B2, B3, F7 } -#define MATRIX_COL_PINS { F1, F4, F5, E6, F0, B7, D2, D3, D5, D4, D6, D7, B4, B5 } -#define UNUSED_PINS { B6, C6, C7, F6 } - -/* bootloader configuration */ - -#define QMK_ESC_OUTPUT B5 // usually COL -#define QMK_ESC_INPUT B2 // usually ROW - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * Feature disable options - * These options are also useful to firmware size reduction. - */ - -/* disable debug print */ -//#define NO_DEBUG - -/* disable print */ -//#define NO_PRINT - -/* Backlight options */ - -//This is experimental do not enable yet -//#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) - -#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended -#define RGB_MATRIX_SKIP_FRAMES 0 -#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 215 - -#define DRIVER_ADDR_1 0b1110100 -#define DRIVER_ADDR_2 0b1110101 - -#define DRIVER_COUNT 2 -#define DRIVER_1_LED_TOTAL 30 - -#ifdef HS60_ANSI -#define DRIVER_2_LED_TOTAL 31 -#else -#define DRIVER_2_LED_TOTAL 32 -#endif - -#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL - -#endif diff --git a/keyboards/hs60/hs60.c b/keyboards/hs60/hs60.c deleted file mode 100644 index 169f84b020..0000000000 --- a/keyboards/hs60/hs60.c +++ /dev/null @@ -1,496 +0,0 @@ -/* Copyright 2018 Yiancar - * - * 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 . - */ -#include "hs60.h" -#include "config.h" - -// Please ignore this is for upcoming features -/*#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t command = data[0]; - switch ( command ) - { - case id_protocol_version: - { - msg_protocol_version *msg = (msg_protocol_version*)&data[1]; - msg->version = PROTOCOL_VERSION; - break; - } -#if USE_KEYMAPS_IN_EEPROM - case id_keymap_keycode_load: - { - msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; - msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); - break; - } - case id_keymap_keycode_save: - { - msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; - keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); - break; - } - case id_keymap_default_save: - { - keymap_default_save(); - break; - } -#endif // USE_KEYMAPS_IN_EEPROM - case id_backlight_config_set_values: - { - msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; - backlight_config_set_values(msg); - backlight_config_save(); - break; - } - case id_backlight_config_set_alphas_mods: - { - msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; - backlight_config_set_alphas_mods( msg->alphas_mods ); - backlight_config_save(); - break; - } - case id_backlight_set_key_color: - { - msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; - backlight_set_key_color(msg->row, msg->column, msg->hsv); - break; - } - case id_system_get_state: - { - msg_system_state *msg = (msg_system_state*)&data[1]; - msg->value = backlight_get_tick(); - break; - } - default: - { - // Unhandled message. - data[0] = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - -#endif*/ - -#ifdef HS60_ANSI - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, C1_1, C3_2, C4_2}, //A1 - {0, C1_2, C2_2, C4_3}, //A2 - {0, C1_3, C2_3, C3_3}, //A3 - {0, C1_4, C2_4, C3_4}, //A4 - {0, C1_5, C2_5, C3_5}, //A5 - {0, C1_6, C2_6, C3_6}, //A6 - {0, C1_7, C2_7, C3_7}, //A7 - {0, C1_8, C2_8, C3_8}, //A8 - {0, C9_1, C8_1, C7_1}, //A9 - {0, C9_2, C8_2, C7_2}, //A10 - {0, C9_3, C8_3, C7_3}, //A11 - {0, C9_4, C8_4, C7_4}, //A12 - {0, C9_5, C8_5, C7_5}, //A13 - {0, C9_6, C8_6, C7_6}, //A14 - {0, C9_7, C8_7, C6_6}, //A15 - {0, C9_8, C7_7, C6_7}, //A16 - - {0, C1_9, C3_10, C4_10}, //B1 - {0, C1_10, C2_10, C4_11}, //B2 - {0, C1_11, C2_11, C3_11}, //B3 - {0, C1_12, C2_12, C3_12}, //B4 - {0, C1_13, C2_13, C3_13}, //B5 - {0, C1_14, C2_14, C3_14}, //B6 - {0, C1_15, C2_15, C3_15}, //B7 - {0, C1_16, C2_16, C3_16}, //B8 - {0, C9_9, C8_9, C7_9}, //B9 - {0, C9_10, C8_10, C7_10}, //B10 - {0, C9_11, C8_11, C7_11}, //B11 - {0, C9_12, C8_12, C7_12}, //B12 - {0, C9_13, C8_13, C7_13}, //B13 - {0, C9_14, C8_14, C7_14}, //B14 - - {1, C1_1, C3_2, C4_2}, //C1 - {1, C1_2, C2_2, C4_3}, //C2 - {1, C1_3, C2_3, C3_3}, //C3 - {1, C1_4, C2_4, C3_4}, //C4 - {1, C1_5, C2_5, C3_5}, //C5 - {1, C1_6, C2_6, C3_6}, //C6 - {1, C1_7, C2_7, C3_7}, //C7 - {1, C1_8, C2_8, C3_8}, //C8 - {1, C9_1, C8_1, C7_1}, //C9 - {1, C9_2, C8_2, C7_2}, //C10 - {1, C9_3, C8_3, C7_3}, //C11 - {1, C9_4, C8_4, C7_4}, //C12 - {1, C9_5, C8_5, C7_5}, //C13 - {1, C9_6, C8_6, C7_6}, //C14 - {1, C9_7, C8_7, C6_6}, //C15 - {1, C9_8, C7_7, C6_7}, //C16 - - {1, C1_9, C3_10, C4_10}, //D1 - //D2 - {1, C1_11, C2_11, C3_11}, //D3 - {1, C1_12, C2_12, C3_12}, //D4 - {1, C1_13, C2_13, C3_13}, //D5 - {1, C1_14, C2_14, C3_14}, //D6 - {1, C1_15, C2_15, C3_15}, //D7 - {1, C1_16, C2_16, C3_16}, //D8 - {1, C9_9, C8_9, C7_9}, //D9 - {1, C9_10, C8_10, C7_10}, //D10 - {1, C9_11, C8_11, C7_11}, //D11 - {1, C9_12, C8_12, C7_12}, //D12 - {1, C9_13, C8_13, C7_13}, //D13 - {1, C9_14, C8_14, C7_14}, //D14 - {1, C9_15, C8_15, C6_14}, //D15 - {1, C9_16, C7_15, C6_15} //D16 -}; - -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, ---, A14, -// D3, ---, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, - {{2|(13<<4)}, {224, 32}, 1}, - {{2|(12<<4)}, {224, 16}, 0}, - {{2|(11<<4)}, {197, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - //D2 - {{3|(0<<4)}, { 10, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; - -#else - -const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { -/* Refer to IS31 manual for these locations - * driver - * | R location - * | | G location - * | | | B location - * | | | | */ - {0, C1_1, C3_2, C4_2}, //A1 - {0, C1_2, C2_2, C4_3}, //A2 - {0, C1_3, C2_3, C3_3}, //A3 - {0, C1_4, C2_4, C3_4}, //A4 - {0, C1_5, C2_5, C3_5}, //A5 - {0, C1_6, C2_6, C3_6}, //A6 - {0, C1_7, C2_7, C3_7}, //A7 - {0, C1_8, C2_8, C3_8}, //A8 - {0, C9_1, C8_1, C7_1}, //A9 - {0, C9_2, C8_2, C7_2}, //A10 - {0, C9_3, C8_3, C7_3}, //A11 - {0, C9_4, C8_4, C7_4}, //A12 - {0, C9_5, C8_5, C7_5}, //A13 - {0, C9_6, C8_6, C7_6}, //A14 - {0, C9_7, C8_7, C6_6}, //A15 - {0, C9_8, C7_7, C6_7}, //A16 - - {0, C1_9, C3_10, C4_10}, //B1 - {0, C1_10, C2_10, C4_11}, //B2 - {0, C1_11, C2_11, C3_11}, //B3 - {0, C1_12, C2_12, C3_12}, //B4 - {0, C1_13, C2_13, C3_13}, //B5 - {0, C1_14, C2_14, C3_14}, //B6 - {0, C1_15, C2_15, C3_15}, //B7 - {0, C1_16, C2_16, C3_16}, //B8 - {0, C9_9, C8_9, C7_9}, //B9 - {0, C9_10, C8_10, C7_10}, //B10 - {0, C9_11, C8_11, C7_11}, //B11 - {0, C9_12, C8_12, C7_12}, //B12 - {0, C9_13, C8_13, C7_13}, //B13 - {0, C9_14, C8_14, C7_14}, //B14 - - {1, C1_1, C3_2, C4_2}, //C1 - {1, C1_2, C2_2, C4_3}, //C2 - {1, C1_3, C2_3, C3_3}, //C3 - {1, C1_4, C2_4, C3_4}, //C4 - {1, C1_5, C2_5, C3_5}, //C5 - {1, C1_6, C2_6, C3_6}, //C6 - {1, C1_7, C2_7, C3_7}, //C7 - {1, C1_8, C2_8, C3_8}, //C8 - {1, C9_1, C8_1, C7_1}, //C9 - {1, C9_2, C8_2, C7_2}, //C10 - {1, C9_3, C8_3, C7_3}, //C11 - {1, C9_4, C8_4, C7_4}, //C12 - {1, C9_5, C8_5, C7_5}, //C13 - {1, C9_6, C8_6, C7_6}, //C14 - {1, C9_7, C8_7, C6_6}, //C15 - {1, C9_8, C7_7, C6_7}, //C16 - - {1, C1_9, C3_10, C4_10}, //D1 - {1, C1_10, C2_10, C4_11}, //D2 - {1, C1_11, C2_11, C3_11}, //D3 - {1, C1_12, C2_12, C3_12}, //D4 - {1, C1_13, C2_13, C3_13}, //D5 - {1, C1_14, C2_14, C3_14}, //D6 - {1, C1_15, C2_15, C3_15}, //D7 - {1, C1_16, C2_16, C3_16}, //D8 - {1, C9_9, C8_9, C7_9}, //D9 - {1, C9_10, C8_10, C7_10}, //D10 - {1, C9_11, C8_11, C7_11}, //D11 - {1, C9_12, C8_12, C7_12}, //D12 - {1, C9_13, C8_13, C7_13}, //D13 - {1, C9_14, C8_14, C7_14}, //D14 - {1, C9_15, C8_15, C6_14}, //D15 - {1, C9_16, C7_15, C6_15} //D16 -}; - -const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { -// -// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, -// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, -// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, -// D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, -// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 -/* {row | col << 4} - * | {x=0..224, y=0..64} - * | | modifier - * | | | */ - {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 - {{0|(12<<4)}, {204, 0}, 0}, - {{0|(11<<4)}, {187, 0}, 0}, - {{0|(10<<4)}, {170, 0}, 0}, - {{0|(9<<4)}, {153, 0}, 0}, - {{0|(8<<4)}, {136, 0}, 0}, - {{0|(7<<4)}, {119, 0}, 0}, - {{1|(7<<4)}, {119, 16}, 0}, - {{1|(8<<4)}, {136, 16}, 0}, - {{1|(9<<4)}, {153, 16}, 0}, - {{1|(10<<4)}, {170, 16}, 0}, - {{1|(11<<4)}, {187, 16}, 0}, - {{1|(12<<4)}, {204, 16}, 0}, - {{2|(13<<4)}, {224, 8}, 1}, - {{2|(12<<4)}, {204, 32}, 0}, - {{2|(11<<4)}, {187, 32}, 0}, - - {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 - {{3|(9<<4)}, {153, 48}, 0}, - {{3|(8<<4)}, {136, 48}, 0}, - {{3|(7<<4)}, {119, 48}, 0}, - {{2|(7<<4)}, {119, 32}, 0}, - {{2|(8<<4)}, {136, 32}, 0}, - {{2|(9<<4)}, {153, 32}, 0}, - {{2|(10<<4)}, {170, 32}, 0}, - {{3|(11<<4)}, {187, 48}, 0}, - {{3|(13<<4)}, {214, 48}, 1}, - {{4|(13<<4)}, {224, 64}, 1}, - {{4|(12<<4)}, {204, 64}, 1}, - {{4|(11<<4)}, {187, 64}, 1}, - {{4|(10<<4)}, {170, 64}, 1}, - - {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 - {{0|(5<<4)}, { 85, 0}, 0}, - {{0|(4<<4)}, { 68, 0}, 0}, - {{0|(3<<4)}, { 51, 0}, 0}, - {{0|(2<<4)}, { 34, 0}, 0}, - {{0|(1<<4)}, { 17, 0}, 0}, - {{0|(0<<4)}, { 0, 0}, 1}, - {{1|(0<<4)}, { 0, 16}, 1}, - {{1|(1<<4)}, { 17, 16}, 0}, - {{1|(2<<4)}, { 34, 16}, 0}, - {{1|(3<<4)}, { 51, 16}, 0}, - {{1|(4<<4)}, { 68, 16}, 0}, - {{1|(5<<4)}, { 85, 16}, 0}, - {{1|(6<<4)}, {102, 16}, 0}, - {{2|(6<<4)}, {102, 32}, 0}, - {{2|(5<<4)}, { 85, 32}, 0}, - - {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 - {{3|(1<<4)}, { 17, 48}, 0}, - {{3|(0<<4)}, { 0, 48}, 1}, - {{2|(0<<4)}, { 0, 32}, 1}, - {{2|(1<<4)}, { 17, 32}, 0}, - {{2|(2<<4)}, { 34, 32}, 0}, - {{2|(3<<4)}, { 51, 32}, 0}, - {{2|(4<<4)}, { 68, 32}, 0}, - {{3|(3<<4)}, { 51, 48}, 0}, - {{3|(4<<4)}, { 68, 48}, 0}, - {{3|(5<<4)}, { 85, 48}, 0}, - {{3|(6<<4)}, {102, 48}, 0}, - {{4|(3<<4)}, {102, 64}, 0}, - {{4|(2<<4)}, { 34, 68}, 1}, - {{4|(1<<4)}, { 17, 68}, 1}, - {{4|(0<<4)}, { 0, 68}, 1} -}; - -#endif - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic made by Wilba. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc and space bar are held down on power up, - // reset the EEPROM valid state and jump to bootloader. - // Assumes Esc is at [0,0] and spacebar is at [4,6]. - // This isn't very generalized, but we need something that doesn't - // rely on user's keymaps in firmware or EEPROM. - if ( ( matrix_get_row(0) & (1<<0) ) && - ( matrix_get_row(4) & (1<<6) ) ) - { - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); - //eeprom_set_valid(false); - // Jump to bootloader. - bootloader_jump(); - } -} - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - bootmagic_lite(); - - // Please ignore this is for upcoming features - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - /*if (eeprom_is_valid()) - { - backlight_config_load(); - - // TODO: do something to "turn on" keymaps in EEPROM? - } - else - { - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - backlight_config_save(); - - // Clear the LED colors stored in EEPROM - for ( int row=0; row < MATRIX_ROWS; row++ ) - { - HSV hsv; - for ( int column=0; column < MATRIX_COLS; column++ ) - { - hsv.h = rand() & 0xFF; - hsv.s = rand() & 0x7F; - hsv.v = 255; - backlight_set_key_color( row, column, hsv ); - } - } - #ifdef USE_KEYMAPS_IN_EEPROM - keymap_default_save(); - #endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - }*/ - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - //backlight_set_indicator_state(usb_led); -} - -void suspend_power_down_kb(void) -{ - rgb_matrix_set_suspend_state(true); -} - -void suspend_wakeup_init_kb(void) -{ - rgb_matrix_set_suspend_state(false); -} \ No newline at end of file diff --git a/keyboards/hs60/hs60.h b/keyboards/hs60/hs60.h deleted file mode 100644 index 4de781e5fa..0000000000 --- a/keyboards/hs60/hs60.h +++ /dev/null @@ -1,52 +0,0 @@ -/* Copyright 2018 Yiancar - * - * 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 . - */ -#ifndef HS60_H -#define HS60_H - -#define XXX KC_NO - -#include "quantum.h" - -// This a shortcut to help you visually see your layout. - -#define LAYOUT_60_iso( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ -} - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ - { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ -} -#endif \ No newline at end of file diff --git a/keyboards/hs60/info.json b/keyboards/hs60/info.json deleted file mode 100644 index 677054cc6e..0000000000 --- a/keyboards/hs60/info.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "keyboard_name": "HS60", - "url": "", - "maintainer": "qmk", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_60_iso": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - }, - "LAYOUT_60_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] - } - } -} diff --git a/keyboards/hs60/keymaps/ansi/config.h b/keyboards/hs60/keymaps/ansi/config.h deleted file mode 100644 index bab67fd558..0000000000 --- a/keyboards/hs60/keymaps/ansi/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* -Copyright 2018 Yiancar - -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 . -*/ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -/* Include overwrites for specific keymap */ - -#define HS60_ANSI - -#endif \ No newline at end of file diff --git a/keyboards/hs60/keymaps/ansi/keymap.c b/keyboards/hs60/keymaps/ansi/keymap.c deleted file mode 100644 index 923af9e2ce..0000000000 --- a/keyboards/hs60/keymaps/ansi/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2018 Yiancar - * - * 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 . - */ -#include QMK_KEYBOARD_H - -//This is the ANSI version of the PCB - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_60_ansi( /* Base */ - KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), - -[1] = LAYOUT_60_ansi( /* FN */ - KC_TRNS, 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_DEL ,\ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS,\ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS,\ - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -void matrix_init_user(void) { - //user initialization -} - -void matrix_scan_user(void) { - //user matrix -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} \ No newline at end of file diff --git a/keyboards/hs60/keymaps/ansi/readme.md b/keyboards/hs60/keymaps/ansi/readme.md deleted file mode 100644 index fa811319d3..0000000000 --- a/keyboards/hs60/keymaps/ansi/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -The default keymap for ANSI HS60 -================================ - -![Layout image](https://imgur.com/CSyPw0J.png) - -Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/keymaps/default/keymap.c b/keyboards/hs60/keymaps/default/keymap.c deleted file mode 100644 index 2a5e823618..0000000000 --- a/keyboards/hs60/keymaps/default/keymap.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Copyright 2018 Yiancar - * - * 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 . - */ -#include QMK_KEYBOARD_H - -//This is the ISO version of the PCB - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = LAYOUT_60_iso( /* Base */ - KC_GESC, 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), - -[1] = LAYOUT_60_iso( /* FN */ - KC_TRNS, 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_DEL ,\ - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ - KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS,\ - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), -}; - -void matrix_init_user(void) { - //user initialization -} - -void matrix_scan_user(void) { - //user matrix -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} \ No newline at end of file diff --git a/keyboards/hs60/keymaps/default/readme.md b/keyboards/hs60/keymaps/default/readme.md deleted file mode 100644 index 9125cb349e..0000000000 --- a/keyboards/hs60/keymaps/default/readme.md +++ /dev/null @@ -1,6 +0,0 @@ -The default keymap for ISO HS60 -=============================== - -![Layout image](https://imgur.com/HXj4tYL.png) - -Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/readme.md b/keyboards/hs60/readme.md deleted file mode 100644 index 939b588286..0000000000 --- a/keyboards/hs60/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -HS60 -==== - -[HS60](https://mechboards.co.uk/wp-content/uploads/2018/04/IMG_20180420_140353.jpg) - -This is a standard fixed layout 60% PCB. It comes in two varians, ISO and ANSI and support full per-key RGB. - -Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) -Hardware Supported: HS60 ISO and ANSI PCBs with Atmega 32u4 -Hardware Availability: https://mechboards.co.uk/shop/all/hs60-pcb/ - -Due to the RGB implementation, the HS60 is currently not compatible with community layouts. - -Make example for this keyboard (after setting up your build environment): - - make hs60:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/hs60/rules.mk b/keyboards/hs60/rules.mk deleted file mode 100644 index bff9659489..0000000000 --- a/keyboards/hs60/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -# MCU name -#MCU = at90usb1286 -MCU = atmega32u4 - -# project specific files -#SRC = - -# 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 - -# Boot Section -BOOTLOADER = qmk-dfu - -# Do not put the microcontroller into power saving mode -# when we get USB suspend event. We want it to keep updating -# backlight effects. -OPT_DEFS += -DNO_SUSPEND_POWER_DOWN - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 -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 -RGB_MATRIX_ENABLE = yes # Use RGB matrix - -# Experimental features for zealcmd please do no enable -#RAW_ENABLE = yes -#USE_KEYMAPS_IN_EEPROM = yes diff --git a/keyboards/hs60/v1/config.h b/keyboards/hs60/v1/config.h new file mode 100644 index 0000000000..c297a6e191 --- /dev/null +++ b/keyboards/hs60/v1/config.h @@ -0,0 +1,143 @@ +/* +Copyright 2018 Yiancar + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0257 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar-Designs +#define PRODUCT HS60 +#define DESCRIPTION GH60 compatible, tool free RGB keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, F7 } +#define MATRIX_COL_PINS { F1, F4, F5, E6, F0, B7, D2, D3, D5, D4, D6, D7, B4, B5 } +#define UNUSED_PINS { B6, C6, C7, F6 } + +/* bootloader configuration */ + +#define QMK_ESC_OUTPUT B5 // usually COL +#define QMK_ESC_INPUT B2 // usually ROW + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* Backlight options */ + +//This is experimental do not enable yet +//#define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) + +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +#define RGB_MATRIX_SKIP_FRAMES 0 +#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 215 + +#define DRIVER_ADDR_1 0b1110100 +#define DRIVER_ADDR_2 0b1110101 + +#define DRIVER_COUNT 2 +#define DRIVER_1_LED_TOTAL 30 + +#ifdef HS60_ANSI +#define DRIVER_2_LED_TOTAL 31 +#else +#define DRIVER_2_LED_TOTAL 32 +#endif + +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL + DRIVER_2_LED_TOTAL diff --git a/keyboards/hs60/v1/info.json b/keyboards/hs60/v1/info.json new file mode 100644 index 0000000000..677054cc6e --- /dev/null +++ b/keyboards/hs60/v1/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "HS60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_iso": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} diff --git a/keyboards/hs60/v1/keymaps/ansi/config.h b/keyboards/hs60/v1/keymaps/ansi/config.h new file mode 100644 index 0000000000..f51cc16d85 --- /dev/null +++ b/keyboards/hs60/v1/keymaps/ansi/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2018 Yiancar + +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 + +/* Include overwrites for specific keymap */ + +#define HS60_ANSI diff --git a/keyboards/hs60/v1/keymaps/ansi/keymap.c b/keyboards/hs60/v1/keymaps/ansi/keymap.c new file mode 100644 index 0000000000..923af9e2ce --- /dev/null +++ b/keyboards/hs60/v1/keymaps/ansi/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +//This is the ANSI version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( /* Base */ + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_ansi( /* FN */ + KC_TRNS, 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_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v1/keymaps/ansi/readme.md b/keyboards/hs60/v1/keymaps/ansi/readme.md new file mode 100644 index 0000000000..fa811319d3 --- /dev/null +++ b/keyboards/hs60/v1/keymaps/ansi/readme.md @@ -0,0 +1,6 @@ +The default keymap for ANSI HS60 +================================ + +![Layout image](https://imgur.com/CSyPw0J.png) + +Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v1/keymaps/default/keymap.c b/keyboards/hs60/v1/keymaps/default/keymap.c new file mode 100644 index 0000000000..2a5e823618 --- /dev/null +++ b/keyboards/hs60/v1/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +//This is the ISO version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_iso( /* Base */ + KC_GESC, 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_iso( /* FN */ + KC_TRNS, 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_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v1/keymaps/default/readme.md b/keyboards/hs60/v1/keymaps/default/readme.md new file mode 100644 index 0000000000..9125cb349e --- /dev/null +++ b/keyboards/hs60/v1/keymaps/default/readme.md @@ -0,0 +1,6 @@ +The default keymap for ISO HS60 +=============================== + +![Layout image](https://imgur.com/HXj4tYL.png) + +Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v1/readme.md b/keyboards/hs60/v1/readme.md new file mode 100644 index 0000000000..a77bbc25ca --- /dev/null +++ b/keyboards/hs60/v1/readme.md @@ -0,0 +1,18 @@ +HS60 +==== + +[HS60](https://mechboards.co.uk/wp-content/uploads/2018/04/IMG_20180420_140353.jpg) + +This is a standard fixed layout 60% PCB. It comes in two varians, ISO and ANSI and support full per-key RGB. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: HS60 ISO and ANSI PCBs with Atmega 32u4 +Hardware Availability: https://mechboards.co.uk/shop/all/hs60-pcb/ + +Due to the RGB implementation, the HS60 is currently not compatible with community layouts. + +Make example for this keyboard (after setting up your build environment): + + make hs60/v1:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/hs60/v1/rules.mk b/keyboards/hs60/v1/rules.mk new file mode 100644 index 0000000000..bff9659489 --- /dev/null +++ b/keyboards/hs60/v1/rules.mk @@ -0,0 +1,74 @@ +# MCU name +#MCU = at90usb1286 +MCU = atmega32u4 + +# project specific files +#SRC = + +# 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 + +# Boot Section +BOOTLOADER = qmk-dfu + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +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 +RGB_MATRIX_ENABLE = yes # Use RGB matrix + +# Experimental features for zealcmd please do no enable +#RAW_ENABLE = yes +#USE_KEYMAPS_IN_EEPROM = yes diff --git a/keyboards/hs60/v1/v1.c b/keyboards/hs60/v1/v1.c new file mode 100644 index 0000000000..882611030b --- /dev/null +++ b/keyboards/hs60/v1/v1.c @@ -0,0 +1,495 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include "v1.h" + +// Please ignore this is for upcoming features +/*#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t command = data[0]; + switch ( command ) + { + case id_protocol_version: + { + msg_protocol_version *msg = (msg_protocol_version*)&data[1]; + msg->version = PROTOCOL_VERSION; + break; + } +#if USE_KEYMAPS_IN_EEPROM + case id_keymap_keycode_load: + { + msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; + msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); + break; + } + case id_keymap_keycode_save: + { + msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; + keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); + break; + } + case id_keymap_default_save: + { + keymap_default_save(); + break; + } +#endif // USE_KEYMAPS_IN_EEPROM + case id_backlight_config_set_values: + { + msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; + backlight_config_set_values(msg); + backlight_config_save(); + break; + } + case id_backlight_config_set_alphas_mods: + { + msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; + backlight_config_set_alphas_mods( msg->alphas_mods ); + backlight_config_save(); + break; + } + case id_backlight_set_key_color: + { + msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; + backlight_set_key_color(msg->row, msg->column, msg->hsv); + break; + } + case id_system_get_state: + { + msg_system_state *msg = (msg_system_state*)&data[1]; + msg->value = backlight_get_tick(); + break; + } + default: + { + // Unhandled message. + data[0] = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif*/ + +#ifdef HS60_ANSI + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_1, C3_2, C4_2}, //A1 + {0, C1_2, C2_2, C4_3}, //A2 + {0, C1_3, C2_3, C3_3}, //A3 + {0, C1_4, C2_4, C3_4}, //A4 + {0, C1_5, C2_5, C3_5}, //A5 + {0, C1_6, C2_6, C3_6}, //A6 + {0, C1_7, C2_7, C3_7}, //A7 + {0, C1_8, C2_8, C3_8}, //A8 + {0, C9_1, C8_1, C7_1}, //A9 + {0, C9_2, C8_2, C7_2}, //A10 + {0, C9_3, C8_3, C7_3}, //A11 + {0, C9_4, C8_4, C7_4}, //A12 + {0, C9_5, C8_5, C7_5}, //A13 + {0, C9_6, C8_6, C7_6}, //A14 + {0, C9_7, C8_7, C6_6}, //A15 + {0, C9_8, C7_7, C6_7}, //A16 + + {0, C1_9, C3_10, C4_10}, //B1 + {0, C1_10, C2_10, C4_11}, //B2 + {0, C1_11, C2_11, C3_11}, //B3 + {0, C1_12, C2_12, C3_12}, //B4 + {0, C1_13, C2_13, C3_13}, //B5 + {0, C1_14, C2_14, C3_14}, //B6 + {0, C1_15, C2_15, C3_15}, //B7 + {0, C1_16, C2_16, C3_16}, //B8 + {0, C9_9, C8_9, C7_9}, //B9 + {0, C9_10, C8_10, C7_10}, //B10 + {0, C9_11, C8_11, C7_11}, //B11 + {0, C9_12, C8_12, C7_12}, //B12 + {0, C9_13, C8_13, C7_13}, //B13 + {0, C9_14, C8_14, C7_14}, //B14 + + {1, C1_1, C3_2, C4_2}, //C1 + {1, C1_2, C2_2, C4_3}, //C2 + {1, C1_3, C2_3, C3_3}, //C3 + {1, C1_4, C2_4, C3_4}, //C4 + {1, C1_5, C2_5, C3_5}, //C5 + {1, C1_6, C2_6, C3_6}, //C6 + {1, C1_7, C2_7, C3_7}, //C7 + {1, C1_8, C2_8, C3_8}, //C8 + {1, C9_1, C8_1, C7_1}, //C9 + {1, C9_2, C8_2, C7_2}, //C10 + {1, C9_3, C8_3, C7_3}, //C11 + {1, C9_4, C8_4, C7_4}, //C12 + {1, C9_5, C8_5, C7_5}, //C13 + {1, C9_6, C8_6, C7_6}, //C14 + {1, C9_7, C8_7, C6_6}, //C15 + {1, C9_8, C7_7, C6_7}, //C16 + + {1, C1_9, C3_10, C4_10}, //D1 + //D2 + {1, C1_11, C2_11, C3_11}, //D3 + {1, C1_12, C2_12, C3_12}, //D4 + {1, C1_13, C2_13, C3_13}, //D5 + {1, C1_14, C2_14, C3_14}, //D6 + {1, C1_15, C2_15, C3_15}, //D7 + {1, C1_16, C2_16, C3_16}, //D8 + {1, C9_9, C8_9, C7_9}, //D9 + {1, C9_10, C8_10, C7_10}, //D10 + {1, C9_11, C8_11, C7_11}, //D11 + {1, C9_12, C8_12, C7_12}, //D12 + {1, C9_13, C8_13, C7_13}, //D13 + {1, C9_14, C8_14, C7_14}, //D14 + {1, C9_15, C8_15, C6_14}, //D15 + {1, C9_16, C7_15, C6_15} //D16 +}; + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// +// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, +// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, A15, +// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, ---, A14, +// D3, ---, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, +// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 +/* {row | col << 4} + * | {x=0..224, y=0..64} + * | | modifier + * | | | */ + {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 + {{0|(12<<4)}, {204, 0}, 0}, + {{0|(11<<4)}, {187, 0}, 0}, + {{0|(10<<4)}, {170, 0}, 0}, + {{0|(9<<4)}, {153, 0}, 0}, + {{0|(8<<4)}, {136, 0}, 0}, + {{0|(7<<4)}, {119, 0}, 0}, + {{1|(7<<4)}, {119, 16}, 0}, + {{1|(8<<4)}, {136, 16}, 0}, + {{1|(9<<4)}, {153, 16}, 0}, + {{1|(10<<4)}, {170, 16}, 0}, + {{1|(11<<4)}, {187, 16}, 0}, + {{1|(12<<4)}, {204, 16}, 0}, + {{2|(13<<4)}, {224, 32}, 1}, + {{2|(12<<4)}, {224, 16}, 0}, + {{2|(11<<4)}, {197, 32}, 0}, + + {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 + {{3|(9<<4)}, {153, 48}, 0}, + {{3|(8<<4)}, {136, 48}, 0}, + {{3|(7<<4)}, {119, 48}, 0}, + {{2|(7<<4)}, {119, 32}, 0}, + {{2|(8<<4)}, {136, 32}, 0}, + {{2|(9<<4)}, {153, 32}, 0}, + {{2|(10<<4)}, {170, 32}, 0}, + {{3|(11<<4)}, {187, 48}, 0}, + {{3|(13<<4)}, {214, 48}, 1}, + {{4|(13<<4)}, {224, 64}, 1}, + {{4|(12<<4)}, {204, 64}, 1}, + {{4|(11<<4)}, {187, 64}, 1}, + {{4|(10<<4)}, {170, 64}, 1}, + + {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 + {{0|(5<<4)}, { 85, 0}, 0}, + {{0|(4<<4)}, { 68, 0}, 0}, + {{0|(3<<4)}, { 51, 0}, 0}, + {{0|(2<<4)}, { 34, 0}, 0}, + {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(0<<4)}, { 0, 0}, 1}, + {{1|(0<<4)}, { 0, 16}, 1}, + {{1|(1<<4)}, { 17, 16}, 0}, + {{1|(2<<4)}, { 34, 16}, 0}, + {{1|(3<<4)}, { 51, 16}, 0}, + {{1|(4<<4)}, { 68, 16}, 0}, + {{1|(5<<4)}, { 85, 16}, 0}, + {{1|(6<<4)}, {102, 16}, 0}, + {{2|(6<<4)}, {102, 32}, 0}, + {{2|(5<<4)}, { 85, 32}, 0}, + + {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 + //D2 + {{3|(0<<4)}, { 10, 48}, 1}, + {{2|(0<<4)}, { 0, 32}, 1}, + {{2|(1<<4)}, { 17, 32}, 0}, + {{2|(2<<4)}, { 34, 32}, 0}, + {{2|(3<<4)}, { 51, 32}, 0}, + {{2|(4<<4)}, { 68, 32}, 0}, + {{3|(3<<4)}, { 51, 48}, 0}, + {{3|(4<<4)}, { 68, 48}, 0}, + {{3|(5<<4)}, { 85, 48}, 0}, + {{3|(6<<4)}, {102, 48}, 0}, + {{4|(3<<4)}, {102, 64}, 0}, + {{4|(2<<4)}, { 34, 68}, 1}, + {{4|(1<<4)}, { 17, 68}, 1}, + {{4|(0<<4)}, { 0, 68}, 1} +}; + +#else + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, C1_1, C3_2, C4_2}, //A1 + {0, C1_2, C2_2, C4_3}, //A2 + {0, C1_3, C2_3, C3_3}, //A3 + {0, C1_4, C2_4, C3_4}, //A4 + {0, C1_5, C2_5, C3_5}, //A5 + {0, C1_6, C2_6, C3_6}, //A6 + {0, C1_7, C2_7, C3_7}, //A7 + {0, C1_8, C2_8, C3_8}, //A8 + {0, C9_1, C8_1, C7_1}, //A9 + {0, C9_2, C8_2, C7_2}, //A10 + {0, C9_3, C8_3, C7_3}, //A11 + {0, C9_4, C8_4, C7_4}, //A12 + {0, C9_5, C8_5, C7_5}, //A13 + {0, C9_6, C8_6, C7_6}, //A14 + {0, C9_7, C8_7, C6_6}, //A15 + {0, C9_8, C7_7, C6_7}, //A16 + + {0, C1_9, C3_10, C4_10}, //B1 + {0, C1_10, C2_10, C4_11}, //B2 + {0, C1_11, C2_11, C3_11}, //B3 + {0, C1_12, C2_12, C3_12}, //B4 + {0, C1_13, C2_13, C3_13}, //B5 + {0, C1_14, C2_14, C3_14}, //B6 + {0, C1_15, C2_15, C3_15}, //B7 + {0, C1_16, C2_16, C3_16}, //B8 + {0, C9_9, C8_9, C7_9}, //B9 + {0, C9_10, C8_10, C7_10}, //B10 + {0, C9_11, C8_11, C7_11}, //B11 + {0, C9_12, C8_12, C7_12}, //B12 + {0, C9_13, C8_13, C7_13}, //B13 + {0, C9_14, C8_14, C7_14}, //B14 + + {1, C1_1, C3_2, C4_2}, //C1 + {1, C1_2, C2_2, C4_3}, //C2 + {1, C1_3, C2_3, C3_3}, //C3 + {1, C1_4, C2_4, C3_4}, //C4 + {1, C1_5, C2_5, C3_5}, //C5 + {1, C1_6, C2_6, C3_6}, //C6 + {1, C1_7, C2_7, C3_7}, //C7 + {1, C1_8, C2_8, C3_8}, //C8 + {1, C9_1, C8_1, C7_1}, //C9 + {1, C9_2, C8_2, C7_2}, //C10 + {1, C9_3, C8_3, C7_3}, //C11 + {1, C9_4, C8_4, C7_4}, //C12 + {1, C9_5, C8_5, C7_5}, //C13 + {1, C9_6, C8_6, C7_6}, //C14 + {1, C9_7, C8_7, C6_6}, //C15 + {1, C9_8, C7_7, C6_7}, //C16 + + {1, C1_9, C3_10, C4_10}, //D1 + {1, C1_10, C2_10, C4_11}, //D2 + {1, C1_11, C2_11, C3_11}, //D3 + {1, C1_12, C2_12, C3_12}, //D4 + {1, C1_13, C2_13, C3_13}, //D5 + {1, C1_14, C2_14, C3_14}, //D6 + {1, C1_15, C2_15, C3_15}, //D7 + {1, C1_16, C2_16, C3_16}, //D8 + {1, C9_9, C8_9, C7_9}, //D9 + {1, C9_10, C8_10, C7_10}, //D10 + {1, C9_11, C8_11, C7_11}, //D11 + {1, C9_12, C8_12, C7_12}, //D12 + {1, C9_13, C8_13, C7_13}, //D13 + {1, C9_14, C8_14, C7_14}, //D14 + {1, C9_15, C8_15, C6_14}, //D15 + {1, C9_16, C7_15, C6_15} //D16 +}; + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// +// C7, C6, C5, C4, C3, C2, C1, A7, A6, A5, A4, A3, A2, A1, +// C8, C9, C10, C11, C12, C13, C14, A8, A9, A10, A11, A12, A13, ---, +// D4, D5, D6, D7, D8, C16, C15, B5, B6, B7, B8, A16, A15, A14, +// D3, D2, D1, D9, D10, D11, D12, B4, B3, B2, B1, B9, ---, B10, +// D16, D15, D14, ---, ---, ---, D13, ---, ---, ---, B14, B13, B12, B11 +/* {row | col << 4} + * | {x=0..224, y=0..64} + * | | modifier + * | | | */ + {{0|(13<<4)}, {224, 0}, 1}, //A1-A16 + {{0|(12<<4)}, {204, 0}, 0}, + {{0|(11<<4)}, {187, 0}, 0}, + {{0|(10<<4)}, {170, 0}, 0}, + {{0|(9<<4)}, {153, 0}, 0}, + {{0|(8<<4)}, {136, 0}, 0}, + {{0|(7<<4)}, {119, 0}, 0}, + {{1|(7<<4)}, {119, 16}, 0}, + {{1|(8<<4)}, {136, 16}, 0}, + {{1|(9<<4)}, {153, 16}, 0}, + {{1|(10<<4)}, {170, 16}, 0}, + {{1|(11<<4)}, {187, 16}, 0}, + {{1|(12<<4)}, {204, 16}, 0}, + {{2|(13<<4)}, {224, 8}, 1}, + {{2|(12<<4)}, {204, 32}, 0}, + {{2|(11<<4)}, {187, 32}, 0}, + + {{3|(10<<4)}, {170, 48}, 0}, //B1-B14 + {{3|(9<<4)}, {153, 48}, 0}, + {{3|(8<<4)}, {136, 48}, 0}, + {{3|(7<<4)}, {119, 48}, 0}, + {{2|(7<<4)}, {119, 32}, 0}, + {{2|(8<<4)}, {136, 32}, 0}, + {{2|(9<<4)}, {153, 32}, 0}, + {{2|(10<<4)}, {170, 32}, 0}, + {{3|(11<<4)}, {187, 48}, 0}, + {{3|(13<<4)}, {214, 48}, 1}, + {{4|(13<<4)}, {224, 64}, 1}, + {{4|(12<<4)}, {204, 64}, 1}, + {{4|(11<<4)}, {187, 64}, 1}, + {{4|(10<<4)}, {170, 64}, 1}, + + {{0|(6<<4)}, {102, 0}, 0}, //C1-C16 + {{0|(5<<4)}, { 85, 0}, 0}, + {{0|(4<<4)}, { 68, 0}, 0}, + {{0|(3<<4)}, { 51, 0}, 0}, + {{0|(2<<4)}, { 34, 0}, 0}, + {{0|(1<<4)}, { 17, 0}, 0}, + {{0|(0<<4)}, { 0, 0}, 1}, + {{1|(0<<4)}, { 0, 16}, 1}, + {{1|(1<<4)}, { 17, 16}, 0}, + {{1|(2<<4)}, { 34, 16}, 0}, + {{1|(3<<4)}, { 51, 16}, 0}, + {{1|(4<<4)}, { 68, 16}, 0}, + {{1|(5<<4)}, { 85, 16}, 0}, + {{1|(6<<4)}, {102, 16}, 0}, + {{2|(6<<4)}, {102, 32}, 0}, + {{2|(5<<4)}, { 85, 32}, 0}, + + {{3|(2<<4)}, { 32, 48}, 0}, //D1-D16 + {{3|(1<<4)}, { 17, 48}, 0}, + {{3|(0<<4)}, { 0, 48}, 1}, + {{2|(0<<4)}, { 0, 32}, 1}, + {{2|(1<<4)}, { 17, 32}, 0}, + {{2|(2<<4)}, { 34, 32}, 0}, + {{2|(3<<4)}, { 51, 32}, 0}, + {{2|(4<<4)}, { 68, 32}, 0}, + {{3|(3<<4)}, { 51, 48}, 0}, + {{3|(4<<4)}, { 68, 48}, 0}, + {{3|(5<<4)}, { 85, 48}, 0}, + {{3|(6<<4)}, {102, 48}, 0}, + {{4|(3<<4)}, {102, 64}, 0}, + {{4|(2<<4)}, { 34, 68}, 1}, + {{4|(1<<4)}, { 17, 68}, 1}, + {{4|(0<<4)}, { 0, 68}, 1} +}; + +#endif + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic made by Wilba. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(DEBOUNCING_DELAY); + matrix_scan(); + + // If the Esc and space bar are held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // Assumes Esc is at [0,0] and spacebar is at [4,6]. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + if ( ( matrix_get_row(0) & (1<<0) ) && + ( matrix_get_row(4) & (1<<6) ) ) + { + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); + //eeprom_set_valid(false); + // Jump to bootloader. + bootloader_jump(); + } +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + bootmagic_lite(); + + // Please ignore this is for upcoming features + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + /*if (eeprom_is_valid()) + { + backlight_config_load(); + + // TODO: do something to "turn on" keymaps in EEPROM? + } + else + { + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + backlight_config_save(); + + // Clear the LED colors stored in EEPROM + for ( int row=0; row < MATRIX_ROWS; row++ ) + { + HSV hsv; + for ( int column=0; column < MATRIX_COLS; column++ ) + { + hsv.h = rand() & 0xFF; + hsv.s = rand() & 0x7F; + hsv.v = 255; + backlight_set_key_color( row, column, hsv ); + } + } + #ifdef USE_KEYMAPS_IN_EEPROM + keymap_default_save(); + #endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + }*/ + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + //backlight_set_indicator_state(usb_led); +} + +void suspend_power_down_kb(void) +{ + rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_kb(void) +{ + rgb_matrix_set_suspend_state(false); +} \ No newline at end of file diff --git a/keyboards/hs60/v1/v1.h b/keyboards/hs60/v1/v1.h new file mode 100644 index 0000000000..4de781e5fa --- /dev/null +++ b/keyboards/hs60/v1/v1.h @@ -0,0 +1,52 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#ifndef HS60_H +#define HS60_H + +#define XXX KC_NO + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} +#endif \ No newline at end of file diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c new file mode 100644 index 0000000000..4331155df4 --- /dev/null +++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.c @@ -0,0 +1,126 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_SDC || defined(__DOXYGEN__) +/** + * @brief SDC card detection. + */ +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief SDC card write protection detection. + */ +bool sdc_lld_is_write_protected(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif /* HAL_USE_SDC */ + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h new file mode 100644 index 0000000000..fb7283add9 --- /dev/null +++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for Clueboard 60% Keyboard + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "HS60 V2.0 PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk new file mode 100644 index 0000000000..43377629a3 --- /dev/null +++ b/keyboards/hs60/v2/boards/GENERIC_STM32_F303XC/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/hs60/v2/bootloader_defs.h b/keyboards/hs60/v2/bootloader_defs.h new file mode 100644 index 0000000000..3b0e9d20a6 --- /dev/null +++ b/keyboards/hs60/v2/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/hs60/v2/chconf.h b/keyboards/hs60/v2/chconf.h new file mode 100644 index 0000000000..1d9f12ff1f --- /dev/null +++ b/keyboards/hs60/v2/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/hs60/v2/config.h b/keyboards/hs60/v2/config.h new file mode 100644 index 0000000000..192f7d6f25 --- /dev/null +++ b/keyboards/hs60/v2/config.h @@ -0,0 +1,117 @@ +/* +Copyright 2018 Yiancar + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0258 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Yiancar-Designs +#define PRODUCT HS60 V2 +#define DESCRIPTION GH60 compatible, tool free RGB keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_ROW_PINS { B3, B4, B5, A8, A4 } +#define MATRIX_COL_PINS { A13, A10, A9, A14, A15, B8, B9, C13, C14, C15, A0, A1, A2, A3 } +// To enable debugger set A13 A14 -> A5 A6 + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 0 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * Feature disable options + * These options are also useful to firmware size reduction. + */ + +/* disable debug print */ +//#define NO_DEBUG + +/* disable print */ +//#define NO_PRINT + +/* Backlight options */ + +#define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects +#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +#define RGB_MATRIX_SKIP_FRAMES 3 + +#define DRIVER_ADDR_1 0b1010000 +#define DRIVER_ADDR_2 0b1010000 // this is here for compliancy reasons. + +#define DRIVER_COUNT 2 +#ifdef HS60_ANSI +#define DRIVER_1_LED_TOTAL 61 +#else +#define DRIVER_1_LED_TOTAL 62 +#endif + +#define DRIVER_LED_TOTAL DRIVER_1_LED_TOTAL diff --git a/keyboards/hs60/v2/halconf.h b/keyboards/hs60/v2/halconf.h new file mode 100644 index 0000000000..eda293c49b --- /dev/null +++ b/keyboards/hs60/v2/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/hs60/v2/info.json b/keyboards/hs60/v2/info.json new file mode 100644 index 0000000000..abafb69f99 --- /dev/null +++ b/keyboards/hs60/v2/info.json @@ -0,0 +1,1650 @@ +{ + "keyboard_name": "clueboard/60", + "maintainer": "skullydazed", + "url": "", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "key_count": 61, + "layout": [ + { + "label": "~", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "label": "Backspace", + "x": 13, + "y": 0, + "w": 2 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "|", + "x": 13.5, + "y": 1, + "w": 1.5 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "\"", + "x": 11.75, + "y": 2 + }, + { + "label": "Enter", + "x": 12.75, + "y": 2, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 2.75 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.25 + }, + { + "x": 3.75, + "y": 4, + "w": 6.25 + }, + { + "label": "Alt", + "x": 10, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Menu", + "x": 12.5, + "y": 4, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.75, + "y": 4, + "w": 1.25 + } + ] + }, + "LAYOUT_60_iso": { + "key_count": 62, + "layout": [ + { + "label": "\\u00ac", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "\"", + "x": 2, + "y": 0 + }, + { + "label": "\\u00a3", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "label": "Backspace", + "x": 13, + "y": 0, + "w": 2 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "Enter", + "x": 13.75, + "y": 1, + "w": 1.25, + "h": 2 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "@", + "x": 11.75, + "y": 2 + }, + { + "label": "~", + "x": 12.75, + "y": 2 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 1.25 + }, + { + "label": "|", + "x": 1.25, + "y": 3 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 2.75 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.25 + }, + { + "x": 3.75, + "y": 4, + "w": 6.25 + }, + { + "label": "AltGr", + "x": 10, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Menu", + "x": 12.5, + "y": 4, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.75, + "y": 4, + "w": 1.25 + } + ] + }, + "KEYMAP_AEK": { + "key_count": 60, + "layout": [ + { + "label": "~", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "label": "Backspace", + "x": 13, + "y": 0, + "w": 2 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "|", + "x": 13.5, + "y": 1, + "w": 1.5 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "\"", + "x": 11.75, + "y": 2 + }, + { + "label": "Enter", + "x": 12.75, + "y": 2, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 2.75 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.5 + }, + { + "label": "Win", + "x": 1.5, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.75, + "y": 4, + "w": 1.5 + }, + { + "x": 4.25, + "y": 4, + "w": 6.5 + }, + { + "label": "AltGr", + "x": 10.75, + "y": 4, + "w": 1.5 + }, + { + "label": "Win", + "x": 12.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.5, + "y": 4, + "w": 1.5 + } + ] + }, + "KEYMAP": { + "key_count": 65, + "layout": [ + { + "label": "~", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "x": 13, + "y": 0 + }, + { + "label": "Back", + "x": 14, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "|", + "x": 13.5, + "y": 1, + "w": 1.5 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "\"", + "x": 11.75, + "y": 2 + }, + { + "x": 12.75, + "y": 2 + }, + { + "label": "Enter", + "x": 13.75, + "y": 2, + "w": 1.25 + }, + { + "x": 0, + "y": 3 + }, + { + "label": "Shift", + "x": 1, + "y": 3, + "w": 1.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 1.75 + }, + { + "x": 14, + "y": 3 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.25 + }, + { + "x": 3.75, + "y": 4, + "w": 6.25 + }, + { + "label": "Alt", + "x": 10, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Menu", + "x": 12.5, + "y": 4, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.75, + "y": 4, + "w": 1.25 + } + ] + }, + "LAYOUT_60_ansi_split_bs_rshift": { + "key_count": 63, + "layout": [ + { + "label": "~", + "x": 0, + "y": 0 + }, + { + "label": "!", + "x": 1, + "y": 0 + }, + { + "label": "@", + "x": 2, + "y": 0 + }, + { + "label": "#", + "x": 3, + "y": 0 + }, + { + "label": "$", + "x": 4, + "y": 0 + }, + { + "label": "%", + "x": 5, + "y": 0 + }, + { + "label": "^", + "x": 6, + "y": 0 + }, + { + "label": "&", + "x": 7, + "y": 0 + }, + { + "label": "*", + "x": 8, + "y": 0 + }, + { + "label": "(", + "x": 9, + "y": 0 + }, + { + "label": ")", + "x": 10, + "y": 0 + }, + { + "label": "_", + "x": 11, + "y": 0 + }, + { + "label": "+", + "x": 12, + "y": 0 + }, + { + "x": 13, + "y": 0 + }, + { + "label": "Back", + "x": 14, + "y": 0 + }, + { + "label": "Tab", + "x": 0, + "y": 1, + "w": 1.5 + }, + { + "label": "Q", + "x": 1.5, + "y": 1 + }, + { + "label": "W", + "x": 2.5, + "y": 1 + }, + { + "label": "E", + "x": 3.5, + "y": 1 + }, + { + "label": "R", + "x": 4.5, + "y": 1 + }, + { + "label": "T", + "x": 5.5, + "y": 1 + }, + { + "label": "Y", + "x": 6.5, + "y": 1 + }, + { + "label": "U", + "x": 7.5, + "y": 1 + }, + { + "label": "I", + "x": 8.5, + "y": 1 + }, + { + "label": "O", + "x": 9.5, + "y": 1 + }, + { + "label": "P", + "x": 10.5, + "y": 1 + }, + { + "label": "{", + "x": 11.5, + "y": 1 + }, + { + "label": "}", + "x": 12.5, + "y": 1 + }, + { + "label": "|", + "x": 13.5, + "y": 1, + "w": 1.5 + }, + { + "label": "Caps Lock", + "x": 0, + "y": 2, + "w": 1.75 + }, + { + "label": "A", + "x": 1.75, + "y": 2 + }, + { + "label": "S", + "x": 2.75, + "y": 2 + }, + { + "label": "D", + "x": 3.75, + "y": 2 + }, + { + "label": "F", + "x": 4.75, + "y": 2 + }, + { + "label": "G", + "x": 5.75, + "y": 2 + }, + { + "label": "H", + "x": 6.75, + "y": 2 + }, + { + "label": "J", + "x": 7.75, + "y": 2 + }, + { + "label": "K", + "x": 8.75, + "y": 2 + }, + { + "label": "L", + "x": 9.75, + "y": 2 + }, + { + "label": ":", + "x": 10.75, + "y": 2 + }, + { + "label": "\"", + "x": 11.75, + "y": 2 + }, + { + "label": "Enter", + "x": 12.75, + "y": 2, + "w": 2.25 + }, + { + "label": "Shift", + "x": 0, + "y": 3, + "w": 2.25 + }, + { + "label": "Z", + "x": 2.25, + "y": 3 + }, + { + "label": "X", + "x": 3.25, + "y": 3 + }, + { + "label": "C", + "x": 4.25, + "y": 3 + }, + { + "label": "V", + "x": 5.25, + "y": 3 + }, + { + "label": "B", + "x": 6.25, + "y": 3 + }, + { + "label": "N", + "x": 7.25, + "y": 3 + }, + { + "label": "M", + "x": 8.25, + "y": 3 + }, + { + "label": "<", + "x": 9.25, + "y": 3 + }, + { + "label": ">", + "x": 10.25, + "y": 3 + }, + { + "label": "?", + "x": 11.25, + "y": 3 + }, + { + "label": "Shift", + "x": 12.25, + "y": 3, + "w": 1.75 + }, + { + "x": 14, + "y": 3 + }, + { + "label": "Ctrl", + "x": 0, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 1.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Alt", + "x": 2.5, + "y": 4, + "w": 1.25 + }, + { + "x": 3.75, + "y": 4, + "w": 6.25 + }, + { + "label": "Alt", + "x": 10, + "y": 4, + "w": 1.25 + }, + { + "label": "Win", + "x": 11.25, + "y": 4, + "w": 1.25 + }, + { + "label": "Menu", + "x": 12.5, + "y": 4, + "w": 1.25 + }, + { + "label": "Ctrl", + "x": 13.75, + "y": 4, + "w": 1.25 + } + ] + } + } +} diff --git a/keyboards/hs60/v2/keymaps/ansi/config.h b/keyboards/hs60/v2/keymaps/ansi/config.h new file mode 100644 index 0000000000..f51cc16d85 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2018 Yiancar + +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 + +/* Include overwrites for specific keymap */ + +#define HS60_ANSI diff --git a/keyboards/hs60/v2/keymaps/ansi/keymap.c b/keyboards/hs60/v2/keymaps/ansi/keymap.c new file mode 100644 index 0000000000..923af9e2ce --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +//This is the ANSI version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_ansi( /* Base */ + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_ansi( /* FN */ + KC_TRNS, 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_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , KC_TRNS,\ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/ansi/readme.md b/keyboards/hs60/v2/keymaps/ansi/readme.md new file mode 100644 index 0000000000..fa811319d3 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/ansi/readme.md @@ -0,0 +1,6 @@ +The default keymap for ANSI HS60 +================================ + +![Layout image](https://imgur.com/CSyPw0J.png) + +Default layer is normal ANSI and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/default/keymap.c b/keyboards/hs60/v2/keymaps/default/keymap.c new file mode 100644 index 0000000000..2a5e823618 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +//This is the ISO version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_iso( /* Base */ + KC_GESC, 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_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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1) , KC_APP, KC_RCTL), + +[1] = LAYOUT_60_iso( /* FN */ + KC_TRNS, 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_DEL ,\ + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET , \ + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_TRNS, KC_TRNS,\ + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/default/readme.md b/keyboards/hs60/v2/keymaps/default/readme.md new file mode 100644 index 0000000000..9125cb349e --- /dev/null +++ b/keyboards/hs60/v2/keymaps/default/readme.md @@ -0,0 +1,6 @@ +The default keymap for ISO HS60 +=============================== + +![Layout image](https://imgur.com/HXj4tYL.png) + +Default layer is normal ISO and Fn layer is used for RGB functions, Volume control and arrow cluster \ No newline at end of file diff --git a/keyboards/hs60/v2/keymaps/hhkb/config.h b/keyboards/hs60/v2/keymaps/hhkb/config.h new file mode 100644 index 0000000000..3db403ecc5 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb/config.h @@ -0,0 +1,21 @@ +/* +Copyright 2018 Yiancar + +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 + +/* Include overwrites for specific keymap */ + +#define HS60_HHKB diff --git a/keyboards/hs60/v2/keymaps/hhkb/keymap.c b/keyboards/hs60/v2/keymaps/hhkb/keymap.c new file mode 100644 index 0000000000..d52fc4bac9 --- /dev/null +++ b/keyboards/hs60/v2/keymaps/hhkb/keymap.c @@ -0,0 +1,46 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include QMK_KEYBOARD_H + +//This is the HHKB version of the PCB + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT_60_hhkb( /* Base */ + KC_ESC, 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_GRV, KC_BSLS, \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(1), \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL ), + +[1] = LAYOUT_60_hhkb( /* FN */ + RESET, 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_TRNS, KC_TRNS,\ + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, RGB_SPI, RGB_SPD, KC_UP, KC_TRNS, KC_DEL, \ + KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ) +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/hs60/v2/mcuconf.h b/keyboards/hs60/v2/mcuconf.h new file mode 100644 index 0000000000..226da48d59 --- /dev/null +++ b/keyboards/hs60/v2/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 TRUE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/hs60/v2/readme.md b/keyboards/hs60/v2/readme.md new file mode 100644 index 0000000000..50c91698da --- /dev/null +++ b/keyboards/hs60/v2/readme.md @@ -0,0 +1,18 @@ +HS60 V2.0 +========= + +[HS60](https://mechboards.co.uk/wp-content/uploads/2018/04/IMG_20180420_140353.jpg) + +This is a standard fixed layout 60% PCB. It comes in three variants; ISO, ANSI and HHKB and support full per-key RGB. + +Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](https://github.com/yiancar) +Hardware Supported: HS60 ISO, ANSI and HHKB PCBs with STM32F303CC +Hardware Availability: http://groupbuys.mechboards.co.uk/shop/hs60-hotswap-60-pcb/ + +Due to the RGB implementation, the HS60 is currently not compatible with community layouts. + +Make example for this keyboard (after setting up your build environment): + + make hs60/v2:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file diff --git a/keyboards/hs60/v2/rules.mk b/keyboards/hs60/v2/rules.mk new file mode 100644 index 0000000000..51e3cf0a3e --- /dev/null +++ b/keyboards/hs60/v2/rules.mk @@ -0,0 +1,58 @@ +# project specific files + +## chip/board settings +# the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = no +RGB_MATRIX_ENABLE = IS31FL3733 # Use RGB matrix +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in +#SERIAL_LINK_ENABLE = yes diff --git a/keyboards/hs60/v2/v2.c b/keyboards/hs60/v2/v2.c new file mode 100644 index 0000000000..4289c1fed5 --- /dev/null +++ b/keyboards/hs60/v2/v2.c @@ -0,0 +1,635 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#include "v2.h" + +//#include "is31fl3733.h" + +// Please ignore this is for upcoming features +/*#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t command = data[0]; + switch ( command ) + { + case id_protocol_version: + { + msg_protocol_version *msg = (msg_protocol_version*)&data[1]; + msg->version = PROTOCOL_VERSION; + break; + } +#if USE_KEYMAPS_IN_EEPROM + case id_keymap_keycode_load: + { + msg_keymap_keycode_load *msg = (msg_keymap_keycode_load*)&data[1]; + msg->keycode = keymap_keycode_load( msg->layer, msg->row, msg->column ); + break; + } + case id_keymap_keycode_save: + { + msg_keymap_keycode_save *msg = (msg_keymap_keycode_save*)&data[1]; + keymap_keycode_save( msg->layer, msg->row, msg->column, msg->keycode); + break; + } + case id_keymap_default_save: + { + keymap_default_save(); + break; + } +#endif // USE_KEYMAPS_IN_EEPROM + case id_backlight_config_set_values: + { + msg_backlight_config_set_values *msg = (msg_backlight_config_set_values*)&data[1]; + backlight_config_set_values(msg); + backlight_config_save(); + break; + } + case id_backlight_config_set_alphas_mods: + { + msg_backlight_config_set_alphas_mods *msg = (msg_backlight_config_set_alphas_mods*)&data[1]; + backlight_config_set_alphas_mods( msg->alphas_mods ); + backlight_config_save(); + break; + } + case id_backlight_set_key_color: + { + msg_backlight_set_key_color *msg = (msg_backlight_set_key_color*)&data[1]; + backlight_set_key_color(msg->row, msg->column, msg->hsv); + break; + } + case id_system_get_state: + { + msg_system_state *msg = (msg_system_state*)&data[1]; + msg->value = backlight_get_tick(); + break; + } + default: + { + // Unhandled message. + data[0] = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif*/ + +#ifdef HS60_ANSI + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, //MX1 + {0, E_1, D_1, F_1}, //MX2 + {0, H_1, G_1, I_1}, //MX3 + {0, K_1, J_1, L_1}, //MX4 + {0, B_2, A_2, C_2}, //MX6 + {0, E_2, D_2, F_2}, //MX7 + {0, H_2, G_2, I_2}, //MX8 + {0, K_2, J_2, L_2}, //MX14 + {0, B_3, A_3, C_3}, //MX11 + {0, E_3, D_3, F_3}, //MX12 + {0, H_3, G_3, I_3}, //MX13 + {0, K_3, J_3, L_3}, //MX19 + {0, B_4, A_4, C_4}, //MX16 + {0, E_4, D_4, F_4}, //MX17 + {0, H_4, G_4, I_4}, //MX18 + {0, K_4, J_4, L_4}, //MX23 + {0, B_5, A_5, C_5}, //MX20 + {0, E_5, D_5, F_5}, //MX21 + {0, H_5, G_5, I_5}, //MX22 + {0, K_5, J_5, L_5}, //MX27 + {0, B_6, A_6, C_6}, //MX24 + {0, E_6, D_6, F_6}, //MX25 + {0, H_6, G_6, I_6}, //MX26 + {0, K_6, J_6, L_6}, //MX31 + {0, B_7, A_7, C_7}, //MX28 + {0, E_7, D_7, F_7}, //MX29 + {0, H_7, G_7, I_7}, //MX30 + {0, K_7, J_7, L_7}, //MX36 + {0, B_8, A_8, C_8}, //MX33 + {0, E_8, D_8, F_8}, //MX34 + {0, H_8, G_8, I_8}, //MX35 + {0, K_8, J_8, L_8}, //MX40 + {0, B_9, A_9, C_9}, //MX37 + {0, E_9, D_9, F_9}, //MX38 + {0, H_9, G_9, I_9}, //MX39 + {0, K_9, J_9, L_9}, //MX44 + {0, B_10, A_10, C_10}, //MX41 + {0, E_10, D_10, F_10}, //MX42 + {0, H_10, G_10, I_10}, //MX43 + {0, K_10, J_10, L_10}, //MX48 + {0, B_11, A_11, C_11}, //MX45 + {0, E_11, D_11, F_11}, //MX46 + {0, H_11, G_11, I_11}, //MX47 + {0, K_11, J_11, L_11}, //MX53 + {0, B_12, A_12, C_12}, //MX50 + {0, E_12, D_12, F_12}, //MX51 + {0, H_12, G_12, I_12}, //MX52 + + {0, B_13, A_13, C_13}, //MX55 + {0, E_13, D_13, F_13}, //MX56 + + {0, K_13, J_13, L_13}, //MX61 + {0, B_14, A_14, C_14}, //MX59 + {0, E_14, D_14, F_14}, //MX57 + {0, H_14, G_14, I_14}, //MX60 + {0, K_14, J_14, L_14}, //MX62 + {0, B_15, A_15, C_15}, //MX5 + {0, E_15, D_15, F_15}, //MX10 + {0, H_15, G_15, I_15}, //MX15 + {0, K_15, J_15, L_15}, //MX32 + + {0, E_16, D_16, F_16}, //MX49 + {0, H_16, G_16, I_16}, //MX54 + {0, K_16, J_16, L_16}, //MX58 +}; + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// +// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, +// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---, +// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, +// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61, +// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62 +/* {row | col << 4} + * | {x=0..224, y=0..64} + * | | modifier + * | | | */ + {{0|(0<<4)}, { 0, 0}, 1}, //MX1 + {{1|(0<<4)}, { 0, 16}, 1}, //MX2 + {{2|(0<<4)}, { 0, 32}, 1}, //MX3 + {{3|(0<<4)}, { 0, 48}, 1}, //MX4 + {{0|(1<<4)}, { 17, 0}, 0}, //MX6 + {{1|(1<<4)}, { 17, 16}, 0}, //MX7 + {{2|(1<<4)}, { 17, 32}, 0}, //MX8 + {{3|(2<<4)}, { 34, 48}, 0}, //MX14 + {{0|(2<<4)}, { 34, 0}, 0}, //MX11 + {{1|(2<<4)}, { 34, 16}, 0}, //MX12 + {{2|(2<<4)}, { 34, 32}, 0}, //MX13 + {{3|(3<<4)}, { 51, 48}, 0}, //MX19 + {{0|(3<<4)}, { 51, 0}, 0}, //MX16 + {{1|(3<<4)}, { 51, 16}, 0}, //MX17 + {{2|(3<<4)}, { 51, 32}, 0}, //MX18 + {{3|(4<<4)}, { 68, 48}, 0}, //MX23 + {{0|(4<<4)}, { 68, 0}, 0}, //MX20 + {{1|(4<<4)}, { 68, 16}, 0}, //MX21 + {{2|(4<<4)}, { 68, 32}, 0}, //MX22 + {{3|(5<<4)}, { 85, 48}, 0}, //MX27 + {{0|(5<<4)}, { 85, 0}, 0}, //MX24 + {{1|(5<<4)}, { 85, 16}, 0}, //MX25 + {{2|(5<<4)}, { 85, 32}, 0}, //MX26 + {{3|(6<<4)}, {102, 48}, 0}, //MX31 + {{0|(6<<4)}, {102, 0}, 0}, //MX28 + {{1|(6<<4)}, {102, 16}, 0}, //MX29 + {{2|(6<<4)}, {102, 32}, 0}, //MX30 + {{3|(7<<4)}, {119, 48}, 0}, //MX36 + {{0|(7<<4)}, {119, 0}, 0}, //MX33 + {{1|(7<<4)}, {119, 16}, 0}, //MX34 + {{2|(7<<4)}, {119, 32}, 0}, //MX35 + {{3|(8<<4)}, {136, 48}, 0}, //MX40 + {{0|(8<<4)}, {136, 0}, 0}, //MX37 + {{1|(8<<4)}, {136, 16}, 0}, //MX38 + {{2|(8<<4)}, {136, 32}, 0}, //MX39 + {{3|(9<<4)}, {153, 48}, 0}, //MX44 + {{0|(9<<4)}, {153, 0}, 0}, //MX41 + {{1|(9<<4)}, {153, 16}, 0}, //MX42 + {{2|(9<<4)}, {153, 32}, 0}, //MX43 + {{3|(10<<4)}, {170, 48}, 0}, //MX48 + {{0|(10<<4)}, {170, 0}, 0}, //MX45 + {{1|(10<<4)}, {170, 16}, 0}, //MX46 + {{2|(10<<4)}, {170, 32}, 0}, //MX47 + {{3|(11<<4)}, {187, 48}, 0}, //MX53 + {{0|(11<<4)}, {187, 0}, 0}, //MX50 + {{1|(11<<4)}, {187, 16}, 0}, //MX51 + {{2|(11<<4)}, {187, 32}, 0}, //MX52 + + {{0|(12<<4)}, {204, 0}, 0}, //MX55 + {{1|(12<<4)}, {204, 16}, 0}, //MX56 + + {{3|(13<<4)}, {221, 48}, 1}, //MX61 + {{0|(13<<4)}, {221, 0}, 1}, //MX59 + {{2|(12<<4)}, {221, 16}, 0}, //MX57 + {{2|(13<<4)}, {221, 32}, 1}, //MX60 + {{4|(13<<4)}, {221, 64}, 1}, //MX62 + {{4|(0<<4)}, { 0, 64}, 1}, //MX5 + {{4|(1<<4)}, { 17, 64}, 1}, //MX10 + {{4|(2<<4)}, { 34, 64}, 1}, //MX15 + {{4|(5<<4)}, {102, 64}, 0}, //MX32 + + {{4|(10<<4)}, {170, 64}, 1}, //MX49 + {{4|(11<<4)}, {187, 64}, 1}, //MX54 + {{4|(12<<4)}, {204, 64}, 1} //MX58 +}; + +#elif defined(HS60_HHKB) + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, //MX1 + {0, E_1, D_1, F_1}, //MX2 + {0, H_1, G_1, I_1}, //MX3 + {0, K_1, J_1, L_1}, //MX4 + {0, B_2, A_2, C_2}, //MX6 + {0, E_2, D_2, F_2}, //MX7 + {0, H_2, G_2, I_2}, //MX8 + {0, K_2, J_2, L_2}, //MX14 + {0, B_3, A_3, C_3}, //MX11 + {0, E_3, D_3, F_3}, //MX12 + {0, H_3, G_3, I_3}, //MX13 + {0, K_3, J_3, L_3}, //MX19 + {0, B_4, A_4, C_4}, //MX16 + {0, E_4, D_4, F_4}, //MX17 + {0, H_4, G_4, I_4}, //MX18 + {0, K_4, J_4, L_4}, //MX23 + {0, B_5, A_5, C_5}, //MX20 + {0, E_5, D_5, F_5}, //MX21 + {0, H_5, G_5, I_5}, //MX22 + {0, K_5, J_5, L_5}, //MX27 + {0, B_6, A_6, C_6}, //MX24 + {0, E_6, D_6, F_6}, //MX25 + {0, H_6, G_6, I_6}, //MX26 + {0, K_6, J_6, L_6}, //MX31 + {0, B_7, A_7, C_7}, //MX28 + {0, E_7, D_7, F_7}, //MX29 + {0, H_7, G_7, I_7}, //MX30 + {0, K_7, J_7, L_7}, //MX36 + {0, B_8, A_8, C_8}, //MX33 + {0, E_8, D_8, F_8}, //MX34 + {0, H_8, G_8, I_8}, //MX35 + {0, K_8, J_8, L_8}, //MX40 + {0, B_9, A_9, C_9}, //MX37 + {0, E_9, D_9, F_9}, //MX38 + {0, H_9, G_9, I_9}, //MX39 + {0, K_9, J_9, L_9}, //MX44 + {0, B_10, A_10, C_10}, //MX41 + {0, E_10, D_10, F_10}, //MX42 + {0, H_10, G_10, I_10}, //MX43 + {0, K_10, J_10, L_10}, //MX48 + {0, B_11, A_11, C_11}, //MX45 + {0, E_11, D_11, F_11}, //MX46 + {0, H_11, G_11, I_11}, //MX47 + {0, K_11, J_11, L_11}, //MX53 + {0, B_12, A_12, C_12}, //MX50 + {0, E_12, D_12, F_12}, //MX51 + {0, H_12, G_12, I_12}, //MX52 + {0, K_12, J_12, L_12}, //MX64 + {0, B_13, A_13, C_13}, //MX55 + {0, E_13, D_13, F_13}, //MX56 + {0, H_13, G_13, I_13}, //MX63 + {0, K_13, J_13, L_13}, //MX61 + {0, B_14, A_14, C_14}, //MX59 + {0, E_14, D_14, F_14}, //MX57 + {0, H_14, G_14, I_14}, //MX60 + {0, K_14, J_14, L_14}, //MX62 + {0, B_15, A_15, C_15}, //MX5 + {0, E_15, D_15, F_15}, //MX10 + {0, H_15, G_15, I_15}, //MX15 + {0, K_15, J_15, L_15}, //MX32 + + + {0, H_16, G_16, I_16}, //MX54 + {0, K_16, J_16, L_16}, //MX58 +}; + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// +// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, +// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, MX64, +// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, +// MX4, ----, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, MX63, MX61, +// MX5, MX10, MX15, ----, ----, ----, MX32, ----, ---, ----, ----, MX54, MX58, MX62 +/* {row | col << 4} + * | {x=0..224, y=0..64} + * | | modifier + * | | | */ + {{0|(0<<4)}, { 0, 0}, 1}, //MX1 + {{1|(0<<4)}, { 0, 16}, 1}, //MX2 + {{2|(0<<4)}, { 0, 32}, 1}, //MX3 + {{3|(0<<4)}, { 0, 48}, 1}, //MX4 + {{0|(1<<4)}, { 17, 0}, 0}, //MX6 + {{1|(1<<4)}, { 17, 16}, 0}, //MX7 + {{2|(1<<4)}, { 17, 32}, 0}, //MX8 + {{3|(2<<4)}, { 34, 48}, 0}, //MX14 + {{0|(2<<4)}, { 34, 0}, 0}, //MX11 + {{1|(2<<4)}, { 34, 16}, 0}, //MX12 + {{2|(2<<4)}, { 34, 32}, 0}, //MX13 + {{3|(3<<4)}, { 51, 48}, 0}, //MX19 + {{0|(3<<4)}, { 51, 0}, 0}, //MX16 + {{1|(3<<4)}, { 51, 16}, 0}, //MX17 + {{2|(3<<4)}, { 51, 32}, 0}, //MX18 + {{3|(4<<4)}, { 68, 48}, 0}, //MX23 + {{0|(4<<4)}, { 68, 0}, 0}, //MX20 + {{1|(4<<4)}, { 68, 16}, 0}, //MX21 + {{2|(4<<4)}, { 68, 32}, 0}, //MX22 + {{3|(5<<4)}, { 85, 48}, 0}, //MX27 + {{0|(5<<4)}, { 85, 0}, 0}, //MX24 + {{1|(5<<4)}, { 85, 16}, 0}, //MX25 + {{2|(5<<4)}, { 85, 32}, 0}, //MX26 + {{3|(6<<4)}, {102, 48}, 0}, //MX31 + {{0|(6<<4)}, {102, 0}, 0}, //MX28 + {{1|(6<<4)}, {102, 16}, 0}, //MX29 + {{2|(6<<4)}, {102, 32}, 0}, //MX30 + {{3|(7<<4)}, {119, 48}, 0}, //MX36 + {{0|(7<<4)}, {119, 0}, 0}, //MX33 + {{1|(7<<4)}, {119, 16}, 0}, //MX34 + {{2|(7<<4)}, {119, 32}, 0}, //MX35 + {{3|(8<<4)}, {136, 48}, 0}, //MX40 + {{0|(8<<4)}, {136, 0}, 0}, //MX37 + {{1|(8<<4)}, {136, 16}, 0}, //MX38 + {{2|(8<<4)}, {136, 32}, 0}, //MX39 + {{3|(9<<4)}, {153, 48}, 0}, //MX44 + {{0|(9<<4)}, {153, 0}, 0}, //MX41 + {{1|(9<<4)}, {153, 16}, 0}, //MX42 + {{2|(9<<4)}, {153, 32}, 0}, //MX43 + {{3|(10<<4)}, {170, 48}, 0}, //MX48 + {{0|(10<<4)}, {170, 0}, 0}, //MX45 + {{1|(10<<4)}, {170, 16}, 0}, //MX46 + {{2|(10<<4)}, {170, 32}, 0}, //MX47 + {{3|(11<<4)}, {187, 48}, 0}, //MX53 + {{0|(11<<4)}, {187, 0}, 0}, //MX50 + {{1|(11<<4)}, {187, 16}, 0}, //MX51 + {{2|(11<<4)}, {187, 32}, 0}, //MX52 + {{1|(13<<4)}, {221, 0}, 1}, //MX64 + {{0|(12<<4)}, {204, 0}, 0}, //MX55 + {{1|(12<<4)}, {204, 16}, 0}, //MX56 + {{3|(12<<4)}, {204, 48}, 0}, //MX63 + {{3|(13<<4)}, {212, 48}, 1}, //MX61 + {{0|(13<<4)}, {221, 0}, 0}, //MX59 + {{2|(12<<4)}, {221, 16}, 0}, //MX57 + {{2|(13<<4)}, {221, 32}, 1}, //MX60 + {{4|(13<<4)}, {221, 64}, 1}, //MX62 + {{4|(0<<4)}, { 0, 64}, 1}, //MX5 + {{4|(1<<4)}, { 17, 64}, 1}, //MX10 + {{4|(2<<4)}, { 34, 64}, 1}, //MX15 + {{4|(5<<4)}, {102, 64}, 0}, //MX32 + + + {{4|(11<<4)}, {187, 64}, 1}, //MX54 + {{4|(12<<4)}, {204, 64}, 1} //MX58 +}; + +#else //ISO layout + +const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { +/* Refer to IS31 manual for these locations + * driver + * | R location + * | | G location + * | | | B location + * | | | | */ + {0, B_1, A_1, C_1}, //MX1 + {0, E_1, D_1, F_1}, //MX2 + {0, H_1, G_1, I_1}, //MX3 + {0, K_1, J_1, L_1}, //MX4 + {0, B_2, A_2, C_2}, //MX6 + {0, E_2, D_2, F_2}, //MX7 + {0, H_2, G_2, I_2}, //MX8 + {0, K_2, J_2, L_2}, //MX14 + {0, B_3, A_3, C_3}, //MX11 + {0, E_3, D_3, F_3}, //MX12 + {0, H_3, G_3, I_3}, //MX13 + {0, K_3, J_3, L_3}, //MX19 + {0, B_4, A_4, C_4}, //MX16 + {0, E_4, D_4, F_4}, //MX17 + {0, H_4, G_4, I_4}, //MX18 + {0, K_4, J_4, L_4}, //MX23 + {0, B_5, A_5, C_5}, //MX20 + {0, E_5, D_5, F_5}, //MX21 + {0, H_5, G_5, I_5}, //MX22 + {0, K_5, J_5, L_5}, //MX27 + {0, B_6, A_6, C_6}, //MX24 + {0, E_6, D_6, F_6}, //MX25 + {0, H_6, G_6, I_6}, //MX26 + {0, K_6, J_6, L_6}, //MX31 + {0, B_7, A_7, C_7}, //MX28 + {0, E_7, D_7, F_7}, //MX29 + {0, H_7, G_7, I_7}, //MX30 + {0, K_7, J_7, L_7}, //MX36 + {0, B_8, A_8, C_8}, //MX33 + {0, E_8, D_8, F_8}, //MX34 + {0, H_8, G_8, I_8}, //MX35 + {0, K_8, J_8, L_8}, //MX40 + {0, B_9, A_9, C_9}, //MX37 + {0, E_9, D_9, F_9}, //MX38 + {0, H_9, G_9, I_9}, //MX39 + {0, K_9, J_9, L_9}, //MX44 + {0, B_10, A_10, C_10}, //MX41 + {0, E_10, D_10, F_10}, //MX42 + {0, H_10, G_10, I_10}, //MX43 + {0, K_10, J_10, L_10}, //MX48 + {0, B_11, A_11, C_11}, //MX45 + {0, E_11, D_11, F_11}, //MX46 + {0, H_11, G_11, I_11}, //MX47 + {0, K_11, J_11, L_11}, //MX53 + {0, B_12, A_12, C_12}, //MX50 + {0, E_12, D_12, F_12}, //MX51 + {0, H_12, G_12, I_12}, //MX52 + {0, K_12, J_12, L_12}, //MX9 + {0, B_13, A_13, C_13}, //MX55 + {0, E_13, D_13, F_13}, //MX56 + + {0, K_13, J_13, L_13}, //MX61 + {0, B_14, A_14, C_14}, //MX59 + {0, E_14, D_14, F_14}, //MX57 + {0, H_14, G_14, I_14}, //MX60 + {0, K_14, J_14, L_14}, //MX62 + {0, B_15, A_15, C_15}, //MX5 + {0, E_15, D_15, F_15}, //MX10 + {0, H_15, G_15, I_15}, //MX15 + {0, K_15, J_15, L_15}, //MX32 + + {0, E_16, D_16, F_16}, //MX49 + {0, H_16, G_16, I_16}, //MX54 + {0, K_16, J_16, L_16}, //MX58 +}; + +const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { +// +// MX1, MX6, MX11, MX16, MX20, MX24, MX28, MX33, MX37, MX41, MX45, MX50, MX55, MX59, +// MX2, MX7, MX12, MX17, MX21, MX25, MX29, MX34, MX38, MX42, MX46, MX51, MX56, ---, +// MX3, MX8, MX13, MX18, MX22, MX26, MX30, MX35, MX39, MX43, MX47, MX52, MX57, MX60, +// MX4, ---, MX14, MX19, MX23, MX27, MX31, MX36, MX40, MX44, MX48, MX53, ---, MX61, +// MX5, MX10, MX15, ---, ---, ---, MX32, ---, ---, ---, MX49, MX54, MX58, MX62 +/* {row | col << 4} + * | {x=0..224, y=0..64} + * | | modifier + * | | | */ + {{0|(0<<4)}, { 0, 0}, 1}, //MX1 + {{1|(0<<4)}, { 0, 16}, 1}, //MX2 + {{2|(0<<4)}, { 0, 32}, 1}, //MX3 + {{3|(0<<4)}, { 0, 48}, 1}, //MX4 + {{0|(1<<4)}, { 17, 0}, 0}, //MX6 + {{1|(1<<4)}, { 17, 16}, 0}, //MX7 + {{2|(1<<4)}, { 17, 32}, 0}, //MX8 + {{3|(2<<4)}, { 34, 48}, 0}, //MX14 + {{0|(2<<4)}, { 34, 0}, 0}, //MX11 + {{1|(2<<4)}, { 34, 16}, 0}, //MX12 + {{2|(2<<4)}, { 34, 32}, 0}, //MX13 + {{3|(3<<4)}, { 51, 48}, 0}, //MX19 + {{0|(3<<4)}, { 51, 0}, 0}, //MX16 + {{1|(3<<4)}, { 51, 16}, 0}, //MX17 + {{2|(3<<4)}, { 51, 32}, 0}, //MX18 + {{3|(4<<4)}, { 68, 48}, 0}, //MX23 + {{0|(4<<4)}, { 68, 0}, 0}, //MX20 + {{1|(4<<4)}, { 68, 16}, 0}, //MX21 + {{2|(4<<4)}, { 68, 32}, 0}, //MX22 + {{3|(5<<4)}, { 85, 48}, 0}, //MX27 + {{0|(5<<4)}, { 85, 0}, 0}, //MX24 + {{1|(5<<4)}, { 85, 16}, 0}, //MX25 + {{2|(5<<4)}, { 85, 32}, 0}, //MX26 + {{3|(6<<4)}, {102, 48}, 0}, //MX31 + {{0|(6<<4)}, {102, 0}, 0}, //MX28 + {{1|(6<<4)}, {102, 16}, 0}, //MX29 + {{2|(6<<4)}, {102, 32}, 0}, //MX30 + {{3|(7<<4)}, {119, 48}, 0}, //MX36 + {{0|(7<<4)}, {119, 0}, 0}, //MX33 + {{1|(7<<4)}, {119, 16}, 0}, //MX34 + {{2|(7<<4)}, {119, 32}, 0}, //MX35 + {{3|(8<<4)}, {136, 48}, 0}, //MX40 + {{0|(8<<4)}, {136, 0}, 0}, //MX37 + {{1|(8<<4)}, {136, 16}, 0}, //MX38 + {{2|(8<<4)}, {136, 32}, 0}, //MX39 + {{3|(9<<4)}, {153, 48}, 0}, //MX44 + {{0|(9<<4)}, {153, 0}, 0}, //MX41 + {{1|(9<<4)}, {153, 16}, 0}, //MX42 + {{2|(9<<4)}, {153, 32}, 0}, //MX43 + {{3|(10<<4)}, {170, 48}, 0}, //MX48 + {{0|(10<<4)}, {170, 0}, 0}, //MX45 + {{1|(10<<4)}, {170, 16}, 0}, //MX46 + {{2|(10<<4)}, {170, 32}, 0}, //MX47 + {{3|(11<<4)}, {187, 48}, 0}, //MX53 + {{0|(11<<4)}, {187, 0}, 0}, //MX50 + {{1|(11<<4)}, {187, 16}, 0}, //MX51 + {{2|(11<<4)}, {187, 32}, 0}, //MX52 + {{3|(2<<4)}, { 17, 32}, 1}, //MX9 + {{0|(12<<4)}, {204, 0}, 0}, //MX55 + {{1|(12<<4)}, {204, 16}, 0}, //MX56 + + {{3|(13<<4)}, {221, 48}, 1}, //MX61 + {{0|(13<<4)}, {221, 0}, 1}, //MX59 + {{2|(12<<4)}, {204, 32}, 0}, //MX57 + {{2|(13<<4)}, {221, 24}, 1}, //MX60 + {{4|(13<<4)}, {221, 64}, 1}, //MX62 + {{4|(0<<4)}, { 0, 64}, 1}, //MX5 + {{4|(1<<4)}, { 17, 64}, 1}, //MX10 + {{4|(2<<4)}, { 34, 64}, 1}, //MX15 + {{4|(5<<4)}, {102, 64}, 0}, //MX32 + + {{4|(10<<4)}, {170, 64}, 1}, //MX49 + {{4|(11<<4)}, {187, 64}, 1}, //MX54 + {{4|(12<<4)}, {204, 64}, 1} //MX58 +}; + +#endif + +void bootmagic_lite(void) +{ + // The lite version of TMK's bootmagic made by Wilba. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + wait_ms(10); + matrix_scan(); + + // If the Esc and space bar are held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // Assumes Esc is at [0,0] and spacebar is at [4,6]. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + if ( ( matrix_get_row(0) & (1<<0) ) && + ( matrix_get_row(4) & (1<<6) ) ) + { + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); + //eeprom_set_valid(false); + // Jump to bootloader. + bootloader_jump(); + } +} + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + bootmagic_lite(); + + // Please ignore this is for upcoming features + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + /*if (eeprom_is_valid()) + { + backlight_config_load(); + + // TODO: do something to "turn on" keymaps in EEPROM? + } + else + { + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + backlight_config_save(); + + // Clear the LED colors stored in EEPROM + for ( int row=0; row < MATRIX_ROWS; row++ ) + { + HSV hsv; + for ( int column=0; column < MATRIX_COLS; column++ ) + { + hsv.h = rand() & 0xFF; + hsv.s = rand() & 0x7F; + hsv.v = 255; + backlight_set_key_color( row, column, hsv ); + } + } + #ifdef USE_KEYMAPS_IN_EEPROM + keymap_default_save(); + #endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + }*/ + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + //backlight_set_indicator_state(usb_led); +} \ No newline at end of file diff --git a/keyboards/hs60/v2/v2.h b/keyboards/hs60/v2/v2.h new file mode 100644 index 0000000000..86aeb68a74 --- /dev/null +++ b/keyboards/hs60/v2/v2.h @@ -0,0 +1,67 @@ +/* Copyright 2018 Yiancar + * + * 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 . + */ +#ifndef HS60_H +#define HS60_H + +#define XXX KC_NO + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. + +#define LAYOUT_60_iso( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, XXX, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, K4A, K4B, K4C, K4D } \ +} + +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K1D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K2C, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K46, K4B, K4C, K4D \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ + { K30, XXX, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ + { K40, K41, K42, XXX, XXX, XXX, K46, XXX, XXX, XXX, XXX, K4B, K4C, K4D } \ +} + +#endif \ No newline at end of file -- cgit v1.2.3 From b11a776cef1d5e26e435ed6b4a12711c965abeb6 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 26 Oct 2018 17:14:50 -0700 Subject: Keymap: Update userspace (I want my Hacktoberfest shirt!) (#4252) * use ctl_t * spruce up readme and add a changelog * add comment about using CTL_T * add more description * use RSFT_T so I can still have a right shift key even on the _AL layer * add config.h for rgblight_sleep * update readme to talk about rgblight_sleep * update changelog with new changes --- layouts/community/60_ansi/mechmerlin-ansi/keymap.c | 2 +- .../mechmerlin-split/keymap.c | 2 +- users/mechmerlin/changelog.md | 14 ++++++++ users/mechmerlin/config.h | 5 +++ users/mechmerlin/mechmerlin.h | 4 +-- users/mechmerlin/readme.md | 41 ++++++++++++++++++++-- 6 files changed, 62 insertions(+), 6 deletions(-) create mode 100644 users/mechmerlin/changelog.md create mode 100644 users/mechmerlin/config.h diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c index e48fddea46..4128c4cf2d 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c index 5ec005162f..2464dcaa70 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/users/mechmerlin/changelog.md b/users/mechmerlin/changelog.md new file mode 100644 index 0000000000..11b3ba708f --- /dev/null +++ b/users/mechmerlin/changelog.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to my userspace will be documented in this file. + +## [0.1.1] - 2018-10-26 +### Added +- Added a changelog, aka THIS VERY FILE! +- Added `config.h` to userspace for `RGBLIGHT_SLEEP` feature. + +### Changed +- Spruced up the readme file to better explain the things I use in my keymap for would be keymap snoopers. Also useful as an example when people ask. +- Use `CTL_T` instead of `MT` for my custom `KC_CTCP` keycode as it was causing issues on some boards. + +## [0.1.0] - 2018-08-31 +Initial usage of userspaces! diff --git a/users/mechmerlin/config.h b/users/mechmerlin/config.h new file mode 100644 index 0000000000..3d58c230af --- /dev/null +++ b/users/mechmerlin/config.h @@ -0,0 +1,5 @@ +#pragma once + +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_SLEEP +#endif // RGBLIGHT_ENABLE diff --git a/users/mechmerlin/mechmerlin.h b/users/mechmerlin/mechmerlin.h index c140ac70c9..6b4d50edc8 100644 --- a/users/mechmerlin/mechmerlin.h +++ b/users/mechmerlin/mechmerlin.h @@ -10,8 +10,8 @@ enum userspace_layers { // Enum of custom keycodes defined in process_record_user enum keycodes { - KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. + KC_FNX, // Hold for FN layer, tap to toggle ARROWS layer. }; // Custom #defined keycodes -#define KC_CTCP MT(KC_LCTL, KC_CAPS) +#define KC_CTCP CTL_T(KC_CAPS) diff --git a/users/mechmerlin/readme.md b/users/mechmerlin/readme.md index 6a76dd2a9d..1e86a64107 100644 --- a/users/mechmerlin/readme.md +++ b/users/mechmerlin/readme.md @@ -1,3 +1,40 @@ -# MechMerlin's Userspace +# MechMerlin's Userspace v0.1.1 -This is a collection of my most commonly used QMK functions +This is a collection of my most commonly used QMK features. + +A majority of my keyboards are smaller than 75%, ANSI, and staggered. + +## Layers +---- + +### _BL (Base Layer) +Typical standard QWERTY keymap. + +### _FL (Function Layer) +This layer is commonly accessed via `MO(_FL)` on the base layer. It consists of your typical function key F1 through F12 and some RGB and Backlight controls. + +### _AL (Arrow Layer) +This layer is only present on my 60% boards. I habitually use the bottom right modifiers as arrows. + +### _CL (Control Layer) +This is not defined in here as it's present only on `LAYOUT_66` boards, or to be specific, my clueboard. It currently uses the default clueboard controls. + +## Custom Keycodes +---- + +### KC_FNX (Fn Extended) + +`KC_FNX` functions as a hold for `MO(X)` and tap for `TG(Y)`. Layer X and Y are different layers. + +It is used primarily on my `LAYOUT_60_ansi` boards as my regular toggle (the 1u key to the right of right shift), is not present there. + +### KC_CTCP (Control Caps) + +This is just a wrapper for `CTL_T(KC_CAPS)`. This is a hold for control and tap for caps lock. + +## QMK Features +---- + +### RGBLIGHT_SLEEP + +Ensures that when my computer is in sleep mode, the keyboard underglow lights will also be off. -- cgit v1.2.3 From b1bf0879ad2acf3aec1db0f67250b8679e565324 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 11:22:02 -0700 Subject: Fix mouse_send() on chibiOS so it won't lock up the firmware --- tmk_core/protocol/chibios/usb_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index e79ff15e89..71892c4f49 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -715,15 +715,16 @@ void send_mouse(report_mouse_t *report) { osalSysUnlock(); return; } - osalSysUnlock(); - osalSysLock(); if(usbGetTransmitStatusI(&USB_DRIVER, MOUSE_IN_EPNUM)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread); + if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, MS2ST(10)==MSG_TIMEOUT)) { + osalSysUnlock(); + return; + } } usbStartTransmitI(&USB_DRIVER, MOUSE_IN_EPNUM, (uint8_t *)report, sizeof(report_mouse_t)); osalSysUnlock(); -- cgit v1.2.3 From d3a6296199c6f6564e0fffd6d7c1355496d9feac Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 22 Oct 2018 14:46:50 -0700 Subject: Add key caveat to combos doc --- docs/feature_combo.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/feature_combo.md b/docs/feature_combo.md index f509e9f33f..5bb73ef106 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -19,6 +19,7 @@ combo_t key_combos[COMBO_COUNT] = {COMBO(test_combo, KC_ESC)}; This will send "Escape" if you hit the A and B keys. !> This method only supports [basic keycodes](keycodes_basic.md). See the examples for more control. +!> You cannot reuse (share) keys in combos. Each key should only belong to a single combo. ## Examples -- cgit v1.2.3 From 5632552558fc5e032e89c62d578dff7d3c3cb800 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 26 Oct 2018 21:20:00 -0700 Subject: RGB Support for Panc60 (#4253) * add RGB underglow support * enable RGB underglow and backlighting --- keyboards/panc60/panc60.c | 39 +++++++++++++++++++++++++++++++++++++++ keyboards/panc60/rules.mk | 4 ++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/keyboards/panc60/panc60.c b/keyboards/panc60/panc60.c index 4828cb9cfe..9ac087dbf2 100644 --- a/keyboards/panc60/panc60.c +++ b/keyboards/panc60/panc60.c @@ -14,8 +14,15 @@ * along with this program. If not, see . */ #include "panc60.h" +#ifdef BACKLIGHT_ENABLE +#include "backlight.h" +#endif +#ifdef RGBLIGHT_ENABLE +#include "rgblight.h" +#endif #include + #include "action_layer.h" #include "i2c.h" #include "quantum.h" @@ -23,3 +30,35 @@ __attribute__ ((weak)) void matrix_scan_user(void) { } + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i = 0; i < RGBLED_NUM; i++) { + led[i].r = 0; + led[i].g = 0; + led[i].b = 0; + } + } + + i2c_init(); + i2c_send(0xb0, (uint8_t*)led, 3 * RGBLED_NUM); +} +#endif + +void backlight_init_ports(void) { + DDRD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); +} + +void backlight_set(uint8_t level) { + if (level == 0) { + // Turn out the lights + PORTD &= ~(1<<0 | 1<<1 | 1<<4 | 1<<6); + } else { + // Turn on the lights + PORTD |= (1<<0 | 1<<1 | 1<<4 | 1<<6); + } +} diff --git a/keyboards/panc60/rules.mk b/keyboards/panc60/rules.mk index fcb14d0ae0..588562a95b 100644 --- a/keyboards/panc60/rules.mk +++ b/keyboards/panc60/rules.mk @@ -36,8 +36,8 @@ MOUSEKEY_ENABLE = yes EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes RGBLIGHT_CUSTOM_DRIVER = yes OPT_DEFS = -DDEBUG_LEVEL=0 -- cgit v1.2.3 From f16b5cc92b1fb3f5c551d009b11f291ee650b432 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 26 Oct 2018 21:21:43 -0700 Subject: Add delayed flashing option for DFU Util (#4225) * Add delayed flashing option for DFU Util * Use a loop to make code cleaner * Make delay configurable but default to 10 * Better formatting of check --- tmk_core/chibios.mk | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 014c8d502a..0f665450ac 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk @@ -233,6 +233,24 @@ qmk: $(BUILD_DIR)/$(TARGET).bin dfu-util: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin + +ifneq ($(strip $(TIME_DELAY)),) + TIME_DELAY = $(strip $(TIME_DELAY)) +else + TIME_DELAY = 10 +endif +dfu-util-wait: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter + echo "Preparing to flash firmware. Please enter bootloader now..." ;\ + COUNTDOWN=$(TIME_DELAY) ;\ + while [[ $$COUNTDOWN -ge 1 ]] ; do \ + echo "Flashing in $$COUNTDOWN ..."; \ + sleep 1 ;\ + ((COUNTDOWN = COUNTDOWN - 1)) ; \ + done; \ + echo "Flashing $(TARGET).bin" ;\ + sleep 1 ;\ + $(DFU_UTIL) $(DFU_ARGS) -D $(BUILD_DIR)/$(TARGET).bin + st-link-cli: $(BUILD_DIR)/$(TARGET).hex sizeafter $(ST_LINK_CLI) $(ST_LINK_ARGS) -q -c SWD -p $(BUILD_DIR)/$(TARGET).hex -Rst -- cgit v1.2.3 From d210ac7a3ea9a6049f2c344d3a44fdc1bccd1f1b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 09:01:31 -0700 Subject: Add caveat for basic keycodes in Tap Dance docs --- docs/feature_tap_dance.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index 93d1908831..b2b567f1d0 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -26,6 +26,8 @@ This array specifies what actions shall be taken when a tap-dance key is in acti The first option is enough for a lot of cases, that just want dual roles. For example, `ACTION_TAP_DANCE_DOUBLE(KC_SPC, KC_ENT)` will result in `Space` being sent on single-tap, `Enter` otherwise. +!> Keep in mind that only [basic keycodes](keycodes_basic.md) are supported here. Custom keycodes are not supported. + And that's the bulk of it! And now, on to the explanation of how it works! -- cgit v1.2.3 From 73e92ef0c06de389d39d3ca0a8c98da2196ebec7 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 26 Oct 2018 21:22:47 -0700 Subject: Docs: Add references to One Shot functions, and clean up formatting (#4189) * Docs: Add references to One Shot functions, and clean up formatting * Update PR based on @mechmerlin's recommendations --- docs/feature_advanced_keycodes.md | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index 85f4fa1bfc..f2e4909d86 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -142,6 +142,8 @@ For example, if you define a key as `OSM(MOD_LSFT)`, you can type a capital A ch One shot keys also work as normal modifiers. If you hold down a one shot key and type other keys, your one shot will be released immediately after you let go of the key. +Additionally, hitting keys five times in a short period will lock that key. This applies for both One Shot Modifiers and One Shot Layers, and is controlled by the `ONESHOT_TAP_TOGGLE` define. + You can control the behavior of one shot keys by defining these in `config.h`: ```c @@ -152,15 +154,20 @@ You can control the behavior of one shot keys by defining these in `config.h`: * `OSM(mod)` - Momentarily hold down *mod*. You must use the `MOD_*` keycodes as shown in [Mod Tap](#mod-tap), not the `KC_*` codes. * `OSL(layer)` - momentary switch to *layer*. -Sometimes, you want to activate a one-shot layer as part of a macro or tap dance routine. To do this, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. For more complicated actions, take a look at the oneshot implementation in [`process_record`](https://github.com/qmk/qmk_firmware/blob/master/tmk_core/common/action.c#L429). +Sometimes, you want to activate a one-shot key as part of a macro or tap dance routine. + +For one shot layers, you need to call `set_oneshot_layer(LAYER, ONESHOT_START)` on key down, and `set_oneshot_layer(ONESHOT_PRESSED)` on key up. If you want to cancel the oneshot, call `reset_oneshot_layer()`. + +For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear_oneshot_mods()` to cancel it. + +!> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. -If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by clicking on "Show Options", going to the "Local Resources" tab, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. # Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: -``` +```c #define PERMISSIVE_HOLD ``` @@ -205,6 +212,6 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo # Retro Tapping -When you hold a dual function key, and haven't pressed anything when you release the key, normally nothing happens. However, if you enable this, if you release the key without pressing another key, it will send the original key, even if it is outside of the tapping term. +Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. -For instance, if you're using `LT(2, KC_SPACE)`, if you hold the key, don't hit anything else and then release it, normally, nothing happens. But with `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. +For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. -- cgit v1.2.3 From 23cd9f4dee791464196faaf6692599325cfe6f3c Mon Sep 17 00:00:00 2001 From: Monksoffunk Date: Sat, 27 Oct 2018 13:23:49 +0900 Subject: Keyboard: Add new keyboard Zinc (#4245) * Add Zinc keyboard * Fix photo * Fix readme.md * Fix RGB LED init of monks/keymap.c * Fix default keymap and readme.jp * Fix change DEFS of RGB ANIMATIONS to LED_ANIMATIONS * Add EOL * Use serial_config_simpleapi.h * Fix comment char * Fix error handling in split_scomm.c : mtei works * Fix keymaps * Remove DISABLE_LEADER definition * Remove pro_micro.h * Add 2 spaces after Hardware name * Fix keymaps - remove audio codes - change LAYOUT to LAYOUT_ortho_4X12 - change "persistent_default_layer_set" to core function * Use the Community Layouts feature - with some clean up --- keyboards/zinc/config.h | 50 +++ keyboards/zinc/i2c.c | 162 ++++++++ keyboards/zinc/i2c.h | 49 +++ keyboards/zinc/info.json | 13 + keyboards/zinc/keymaps/default/config.h | 38 ++ keyboards/zinc/keymaps/default/keymap.c | 306 +++++++++++++++ keyboards/zinc/keymaps/default/readme_jp.md | 123 ++++++ keyboards/zinc/keymaps/default/rules.mk | 98 +++++ keyboards/zinc/keymaps/monks/config.h | 38 ++ keyboards/zinc/keymaps/monks/keymap.c | 255 ++++++++++++ keyboards/zinc/keymaps/monks/readme_jp.md | 103 +++++ keyboards/zinc/keymaps/monks/rules.mk | 100 +++++ keyboards/zinc/readme.md | 17 + keyboards/zinc/rev1/config.h | 149 +++++++ keyboards/zinc/rev1/info.json | 13 + keyboards/zinc/rev1/matrix.c | 356 +++++++++++++++++ keyboards/zinc/rev1/rev1.c | 6 + keyboards/zinc/rev1/rev1.h | 44 +++ keyboards/zinc/rev1/rules.mk | 4 + keyboards/zinc/rev1/serial_config.h | 18 + keyboards/zinc/rev1/serial_config_simpleapi.h | 8 + keyboards/zinc/rev1/split_scomm.c | 95 +++++ keyboards/zinc/rev1/split_scomm.h | 24 ++ keyboards/zinc/rev1/split_util.c | 70 ++++ keyboards/zinc/rev1/split_util.h | 19 + keyboards/zinc/reva/config.h | 143 +++++++ keyboards/zinc/reva/info.json | 13 + keyboards/zinc/reva/matrix.c | 356 +++++++++++++++++ keyboards/zinc/reva/reva.c | 6 + keyboards/zinc/reva/reva.h | 44 +++ keyboards/zinc/reva/rules.mk | 4 + keyboards/zinc/reva/serial_config.h | 18 + keyboards/zinc/reva/serial_config_simpleapi.h | 8 + keyboards/zinc/reva/split_scomm.c | 95 +++++ keyboards/zinc/reva/split_scomm.h | 24 ++ keyboards/zinc/reva/split_util.c | 70 ++++ keyboards/zinc/reva/split_util.h | 19 + keyboards/zinc/rules.mk | 72 ++++ keyboards/zinc/serial.c | 542 ++++++++++++++++++++++++++ keyboards/zinc/serial.h | 84 ++++ keyboards/zinc/zinc.c | 1 + keyboards/zinc/zinc.h | 14 + 42 files changed, 3671 insertions(+) create mode 100644 keyboards/zinc/config.h create mode 100644 keyboards/zinc/i2c.c create mode 100644 keyboards/zinc/i2c.h create mode 100644 keyboards/zinc/info.json create mode 100644 keyboards/zinc/keymaps/default/config.h create mode 100644 keyboards/zinc/keymaps/default/keymap.c create mode 100644 keyboards/zinc/keymaps/default/readme_jp.md create mode 100644 keyboards/zinc/keymaps/default/rules.mk create mode 100644 keyboards/zinc/keymaps/monks/config.h create mode 100644 keyboards/zinc/keymaps/monks/keymap.c create mode 100644 keyboards/zinc/keymaps/monks/readme_jp.md create mode 100644 keyboards/zinc/keymaps/monks/rules.mk create mode 100644 keyboards/zinc/readme.md create mode 100644 keyboards/zinc/rev1/config.h create mode 100644 keyboards/zinc/rev1/info.json create mode 100644 keyboards/zinc/rev1/matrix.c create mode 100644 keyboards/zinc/rev1/rev1.c create mode 100644 keyboards/zinc/rev1/rev1.h create mode 100644 keyboards/zinc/rev1/rules.mk create mode 100644 keyboards/zinc/rev1/serial_config.h create mode 100644 keyboards/zinc/rev1/serial_config_simpleapi.h create mode 100644 keyboards/zinc/rev1/split_scomm.c create mode 100644 keyboards/zinc/rev1/split_scomm.h create mode 100644 keyboards/zinc/rev1/split_util.c create mode 100644 keyboards/zinc/rev1/split_util.h create mode 100644 keyboards/zinc/reva/config.h create mode 100644 keyboards/zinc/reva/info.json create mode 100644 keyboards/zinc/reva/matrix.c create mode 100644 keyboards/zinc/reva/reva.c create mode 100644 keyboards/zinc/reva/reva.h create mode 100644 keyboards/zinc/reva/rules.mk create mode 100644 keyboards/zinc/reva/serial_config.h create mode 100644 keyboards/zinc/reva/serial_config_simpleapi.h create mode 100644 keyboards/zinc/reva/split_scomm.c create mode 100644 keyboards/zinc/reva/split_scomm.h create mode 100644 keyboards/zinc/reva/split_util.c create mode 100644 keyboards/zinc/reva/split_util.h create mode 100644 keyboards/zinc/rules.mk create mode 100644 keyboards/zinc/serial.c create mode 100644 keyboards/zinc/serial.h create mode 100644 keyboards/zinc/zinc.c create mode 100644 keyboards/zinc/zinc.h diff --git a/keyboards/zinc/config.h b/keyboards/zinc/config.h new file mode 100644 index 0000000000..9c60d631bc --- /dev/null +++ b/keyboards/zinc/config.h @@ -0,0 +1,50 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 +//#ifndef CONFIG_H +//#define CONFIG_H + +#include "config_common.h" + +// GCC include 'config.h" sequence in qmk_firmware/keyboards/zinc/ +// -include keyboards/zinc/config.h +// -include keyboards/zinc/rev?/config.h +// -include keyboards/zinc/rev?/keymaps/MAPNAME/config.h +// XXXX.c + +#include + +// GCC include search path in qmk_firmare/keyboards/zinc/ +// #include "..." search starts here: +// #include <...> search starts here: +// keyboards/zinc/rev?/keymaps/MAPNAME +// keyboards/zinc +// keyboards/zinc/rev? +// . +// ./tmk_core +// ...... + +#ifdef USE_Link_Time_Optimization + // LTO has issues with macros (action_get_macro) and "functions" (fn_actions), + // so just disable them + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION +#endif // USE_Link_Time_Optimization + +//#endif /* CONFIG_H */ diff --git a/keyboards/zinc/i2c.c b/keyboards/zinc/i2c.c new file mode 100644 index 0000000000..4bee5c6398 --- /dev/null +++ b/keyboards/zinc/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/zinc/info.json b/keyboards/zinc/info.json new file mode 100644 index 0000000000..740f31ae6e --- /dev/null +++ b/keyboards/zinc/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Zinc", + "url": "https://github.com/monksoffunk/", + "maintainer": "monksoffunk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "key_count": 48, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}] + } + } +} diff --git a/keyboards/zinc/keymaps/default/config.h b/keyboards/zinc/keymaps/default/config.h new file mode 100644 index 0000000000..4dcb0724ff --- /dev/null +++ b/keyboards/zinc/keymaps/default/config.h @@ -0,0 +1,38 @@ +/* +This is the c configuration file for the keymap + +Copyright 2018 monksoffunk +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 +// if you need more program area, try uncomment follow line +#include "serial_config_simpleapi.h" + +// place overrides here +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/zinc/keymaps/default/keymap.c b/keyboards/zinc/keymaps/default/keymap.c new file mode 100644 index 0000000000..7729914ecc --- /dev/null +++ b/keyboards/zinc/keymaps/default/keymap.c @@ -0,0 +1,306 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + KANA, + EISU, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { \ + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Win | Alt |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | - | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | Home | End | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST|Aud on|Audoff| | | |Qwerty|Colemk|Dvorak| | Ins | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGB ON| HUE+ | SAT+ | VAL+ | Mac | | Win | - | = |Print |ScLock|Pause | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MODE | HUE- | SAT- | VAL- | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | EISU | EISU | EISU | | KANA | KANA | Home |PageDn|PageUp| End | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_INS, \ + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, AG_NORM, AG_SWAP, KC_MINS, KC_EQL, KC_PSCR, KC_SLCK, KC_PAUS,\ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, EISU, EISU, EISU, KANA, KANA, KC_HOME, KC_PGDN, KC_PGUP, KC_END\ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode_noeeprom(RGB_current_config.mode); + rgblight_step(); + RGB_current_config.mode = rgblight_config.mode; + } + #endif + return false; + break; + + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} + + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_init(); + RGB_current_config = rgblight_config; + #endif +} + + diff --git a/keyboards/zinc/keymaps/default/readme_jp.md b/keyboards/zinc/keymaps/default/readme_jp.md new file mode 100644 index 0000000000..f6e91f0c89 --- /dev/null +++ b/keyboards/zinc/keymaps/default/readme_jp.md @@ -0,0 +1,123 @@ +# The Default Zinc Layout +## 配列 + +### Qwerty配列 + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc | Fn | Alt | Win |Lower |Space | | Space| Raise| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Colemak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Dvorak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `-----------------------------------------' `-----------------------------------------' +``` + + +## コンパイルの仕方 + +コンパイルは、qmk_firmware のトップディレクトリで行います。 + +``` +$ cd qmk_firmware +``` +qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。 + +``` +$ make zinc:default +``` + +キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。 + +``` +$ make zinc:default:avrdude +``` + +コンパイル結果と中間生成物を消去したい場合は以下のようにします。 + +``` +$ make zinc:default:clean +``` + +## カスタマイズ + +コマンドラインからオプションを指定してビルドすることが出来ます。 + +``` +# Zinc keyboard 'default' keymap: convenient command line option +make ZINC= zinc:defualt +# option= back | under | na | ios +# ex. +# make ZINC=under zinc:defualt +# make ZINC=under,ios zinc:defualt +# make ZINC=back zinc:default +# make ZINC=back,na zinc:default +# make ZINC=back,ios zinc:default +``` + +あるいは`qmk_firmware/keyboards/zinc/rev1/keymaps/default/rules.mk` の以下の部分を直接編集して機能を有効化してください。 + +``` +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + + +``` + +## RGB backlight を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_BACK_ENABLE = yes # LED backlight (Enable SK6812mini backlight) +``` + + +## RGB Underglow を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +``` + + +## iPad/iPhoneサポートを有効にする。 + +rules.mk の下記の部分を編集して no を yes に変更してください。 +RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。 + +``` +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +``` \ No newline at end of file diff --git a/keyboards/zinc/keymaps/default/rules.mk b/keyboards/zinc/keymaps/default/rules.mk new file mode 100644 index 0000000000..2dcefc0016 --- /dev/null +++ b/keyboards/zinc/keymaps/default/rules.mk @@ -0,0 +1,98 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define ZINC_CUSTOMISE_MSG + $(info Zinc customize) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Zinc keyboard 'default' keymap: convenient command line option +## make ZINC= zinc:defualt +## option= back | under | na | ios +## ex. +## make ZINC=under zinc:defualt +## make ZINC=under,ios zinc:defualt +## make ZINC=back zinc:default +## make ZINC=back,na zinc:default +## make ZINC=back,ios zinc:default + +ifneq ($(strip $(ZINC)),) + ifeq ($(findstring back,$(ZINC)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(ZINC)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(ZINC)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(ZINC)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(info ) +endif + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) +# OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS + +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/zinc/keymaps/monks/config.h b/keyboards/zinc/keymaps/monks/config.h new file mode 100644 index 0000000000..4dcb0724ff --- /dev/null +++ b/keyboards/zinc/keymaps/monks/config.h @@ -0,0 +1,38 @@ +/* +This is the c configuration file for the keymap + +Copyright 2018 monksoffunk +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 +// if you need more program area, try uncomment follow line +#include "serial_config_simpleapi.h" + +// place overrides here +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/zinc/keymaps/monks/keymap.c b/keyboards/zinc/keymaps/monks/keymap.c new file mode 100644 index 0000000000..5fd7c6aa85 --- /dev/null +++ b/keyboards/zinc/keymaps/monks/keymap.c @@ -0,0 +1,255 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + KANA, + EISU, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { \ + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | GUI |LOWER |Space | | Space| RAISE| KANA | Left | Down | Right| + * `-----------------------------------------' `-----------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KANA, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | - | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | UP | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | ? | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, S(KC_SLSH), _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST| | | | | | | | | | Ins | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | |RGB ON| HUE+ | SAT+ | VAL+ | Mac | | Win | - | = |Print |ScLock|Pause | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MODE | HUE- | SAT- | VAL- | | | | | | |PageUp| | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | EISU | EISU | EISU | | KANA | KANA | KANA | Home |PageDn| End | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, AG_NORM, AG_SWAP, KC_MINS, KC_EQL, KC_PSCR, KC_SLCK, KC_PAUS,\ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, KC_PGUP, _______,\ + _______, _______, _______, EISU, EISU, EISU, KANA, KANA, KANA, KC_HOME, KC_PGDN, KC_END\ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode_noeeprom(RGB_current_config.mode); + rgblight_step(); + RGB_current_config.mode = rgblight_config.mode; + } + #endif + return false; + break; + + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} + + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_init(); + RGB_current_config = rgblight_config; + #endif +} diff --git a/keyboards/zinc/keymaps/monks/readme_jp.md b/keyboards/zinc/keymaps/monks/readme_jp.md new file mode 100644 index 0000000000..680e2866c5 --- /dev/null +++ b/keyboards/zinc/keymaps/monks/readme_jp.md @@ -0,0 +1,103 @@ +# monksoffunk's personal zinc Layout +## 配列 + +### Qwerty配列 + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | GUI |LOWER |Space | | Space| RAISE| KANA | Left | Down | Right| + `------------------------------------------ ------------------------------------------' +``` + +KANAキーを独立させ、UPキーをLOWER+スラッシュに当てています。そのほかデフォルトからレイヤーをかなりいじっています。 +また、RGB LEDがアンコメントしてありますので、実装していない場合はソースを見て適宜コメントアウトしてください。 + +## コンパイルの仕方 + +コンパイルは、qmk_firmware のトップディレクトリで行います。 + +``` +$ cd qmk_firmware +``` +qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。 + +``` +$ make zinc:monks +``` + +キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。 + +``` +$ make zinc:monks:avrdude +``` + +コンパイル結果と中間生成物を消去したい場合は以下のようにします。 + +``` +$ make zinc:monks:clean +``` + +なお、avrdudeではなくQMK Toolbox(GUIツール)を使う方法もあります。 + +https://github.com/qmk/qmk_toolbox/releases + +その場合は、$ make zinc:monksでビルドした成果物をQMK Toolboxから指定してください。 + +## カスタマイズ + +コマンドラインからオプションを指定してビルドすることが出来ます。 + +``` +# Zinc keyboard 'monks' keymap: convenient command line option +make ZINC= zinc:monks +# option= back | under | na | ios +# ex. +# make ZINC=under zinc:monks +# make ZINC=under,ios zinc:monks +# make ZINC=back zinc:monks +# make ZINC=back,na zinc:monks +# make ZINC=back,ios zinc:monks +``` + +あるいは`qmk_firmware/keyboards/zinc/rev1/keymaps/monks/rules.mk` の以下の部分を編集して機能を有効化してください。 + +``` +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + + +``` + +## RGB backlight を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_BACK_ENABLE = yes # LED backlight (Enable SK6812mini backlight) +``` + + +## RGB Underglow を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight) +``` + + +## iPad/iPhoneサポートを有効にする。 + +rules.mk の下記の部分を編集して no を yes に変更してください。 +RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。 + +``` +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +``` \ No newline at end of file diff --git a/keyboards/zinc/keymaps/monks/rules.mk b/keyboards/zinc/keymaps/monks/rules.mk new file mode 100644 index 0000000000..a5335def87 --- /dev/null +++ b/keyboards/zinc/keymaps/monks/rules.mk @@ -0,0 +1,100 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define ZINC_CUSTOMISE_MSG + $(info Zinc customize) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Zinc keyboard 'default' keymap: convenient command line option +## make ZINC= zinc:defualt +## option= back | under | na | ios +## ex. +## make ZINC=under zinc:defualt +## make ZINC=under,ios zinc:defualt +## make ZINC=back zinc:default +## make ZINC=back,na zinc:default +## make ZINC=back,ios zinc:default + +ifneq ($(strip $(ZINC)),) + ifeq ($(findstring back,$(ZINC)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(ZINC)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(ZINC)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(ZINC)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(info ) +endif + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) +# OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) diff --git a/keyboards/zinc/readme.md b/keyboards/zinc/readme.md new file mode 100644 index 0000000000..3b4ce105c8 --- /dev/null +++ b/keyboards/zinc/readme.md @@ -0,0 +1,17 @@ +Zinc +=== + +![Zinc](https://i.imgur.com/vxlpWkD.jpg) + +40% row-staggered split keyboard. + +Keyboard Maintainer: [monksoffunk](https://github.com/monksoffunk/) [@monksoffunkJP](https://twitter.com/monksoffunkJP) +Hardware Supported: Zinc PCB +Hardware Availability: (https://twitter.com/monksoffunkJP) + +Make example for this keyboard (after setting up your build environment): + + make zinc: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/zinc/rev1/config.h b/keyboards/zinc/rev1/config.h new file mode 100644 index 0000000000..c628400f2e --- /dev/null +++ b/keyboards/zinc/rev1/config.h @@ -0,0 +1,149 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +//#ifndef REV1_CONFIG_H +//#define REV1_CONFIG_H + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9991 +#define DEVICE_VER 0x0001 +#define MANUFACTURER monksoffunk +#define PRODUCT zinc rev.1 +#define DESCRIPTION A split keyboard + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +/* Use I2C or Serial */ +//#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + + +/* key matrix size */ +// Rows are doubled-up + #define MATRIX_ROWS 8 + #define MATRIX_ROW_PINS { F6, F7, B1, B3 } + +// wiring of each half +#define MATRIX_COLS 6 +#define MATRIX_COL_PINS { F4, D4, C6, D7, E6, B4 } + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#ifdef RGBLED_BACK + #define RGBLED_NUM 24 +#else + #define RGBLED_NUM 6 +#endif + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 255 + #else + #if RGBLED_NUM <= 16 + #define RGBLIGHT_LIMIT_VAL 130 + #else + #define RGBLIGHT_LIMIT_VAL 120 + #endif + #endif + #define RGBLIGHT_VAL_STEP 17 +#else + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 90 + #else + #if RGBLED_NUM <= 16 + #define RGBLIGHT_LIMIT_VAL 45 + #else + #define RGBLIGHT_LIMIT_VAL 35 + #endif + #endif + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value +// 120 RGBoff +// 330 RGB 6 +// 300 RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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 + + +//#endif diff --git a/keyboards/zinc/rev1/info.json b/keyboards/zinc/rev1/info.json new file mode 100644 index 0000000000..0ca8acded9 --- /dev/null +++ b/keyboards/zinc/rev1/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Zinc rev.1", + "url": "https://github.com/monksoffunk/zinc", + "maintainer": "monksoffunk", + "width": 15, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 48, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}] + } + } +} diff --git a/keyboards/zinc/rev1/matrix.c b/keyboards/zinc/rev1/matrix.c new file mode 100644 index 0000000000..220954f051 --- /dev/null +++ b/keyboards/zinc/rev1/matrix.c @@ -0,0 +1,356 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/zinc/rev1/rev1.c b/keyboards/zinc/rev1/rev1.c new file mode 100644 index 0000000000..2ce08a07c4 --- /dev/null +++ b/keyboards/zinc/rev1/rev1.c @@ -0,0 +1,6 @@ +#include "zinc.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; + diff --git a/keyboards/zinc/rev1/rev1.h b/keyboards/zinc/rev1/rev1.h new file mode 100644 index 0000000000..933e635c2d --- /dev/null +++ b/keyboards/zinc/rev1/rev1.h @@ -0,0 +1,44 @@ +#pragma once + +#include "../zinc.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + + +// Standard Keymap +// (TRRS jack on both halves are to the left side) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05}, \ + { L10, L11, L12, L13, L14, L15}, \ + { L20, L21, L22, L23, L24, L25}, \ + { L30, L31, L32, L33, L34, L35}, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + } + +#define LAYOUT_ortho_4x12 LAYOUT diff --git a/keyboards/zinc/rev1/rules.mk b/keyboards/zinc/rev1/rules.mk new file mode 100644 index 0000000000..e78b9258d7 --- /dev/null +++ b/keyboards/zinc/rev1/rules.mk @@ -0,0 +1,4 @@ +SRC += rev1/matrix.c +SRC += rev1/split_util.c +SRC += rev1/split_scomm.c +SRC += ws2812.c diff --git a/keyboards/zinc/rev1/serial_config.h b/keyboards/zinc/rev1/serial_config.h new file mode 100644 index 0000000000..9fb5dfc671 --- /dev/null +++ b/keyboards/zinc/rev1/serial_config.h @@ -0,0 +1,18 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +#ifndef SOFT_SERIAL_PIN +/* Soft Serial defines */ +#define SOFT_SERIAL_PIN D2 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +#endif + +//// USE flexible API (using multi-type transaction function) +#define SERIAL_USE_MULTI_TRANSACTION + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/zinc/rev1/serial_config_simpleapi.h b/keyboards/zinc/rev1/serial_config_simpleapi.h new file mode 100644 index 0000000000..e2d22a41e7 --- /dev/null +++ b/keyboards/zinc/rev1/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/zinc/rev1/split_scomm.c b/keyboards/zinc/rev1/split_scomm.c new file mode 100644 index 0000000000..50d233ce9a --- /dev/null +++ b/keyboards/zinc/rev1/split_scomm.c @@ -0,0 +1,95 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef SERIAL_DEBUG_MODE +#include +#endif +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/zinc/rev1/split_scomm.h b/keyboards/zinc/rev1/split_scomm.h new file mode 100644 index 0000000000..873d8939d8 --- /dev/null +++ b/keyboards/zinc/rev1/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/zinc/rev1/split_util.c b/keyboards/zinc/rev1/split_util.c new file mode 100644 index 0000000000..e1ff8b4379 --- /dev/null +++ b/keyboards/zinc/rev1/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/zinc/reva/config.h b/keyboards/zinc/reva/config.h new file mode 100644 index 0000000000..1580518905 --- /dev/null +++ b/keyboards/zinc/reva/config.h @@ -0,0 +1,143 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9991 +#define DEVICE_VER 0x0001 +#define MANUFACTURER monksoffunk +#define PRODUCT zinc rev.A +#define DESCRIPTION A split keyboard + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 100 + +/* Use I2C or Serial */ +//#define USE_I2C +#define USE_SERIAL +//#define USE_MATRIX_I2C + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + + +/* key matrix size */ +// Rows are doubled-up + #define MATRIX_ROWS 8 + #define MATRIX_ROW_PINS { D4, C6, D7, E6 } + +// wiring of each half +#define MATRIX_COLS 6 +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3} + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 24 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +// RGB LED support +//#define RGBLIGHT_ANIMATIONS : see ./rules.mk: LED_ANIMATIONS = yes or no +// see ./rules.mk: LED_BACK_ENABLE or LED_UNDERGLOW_ENABLE set yes +#ifdef RGBLED_BACK + #define RGBLED_NUM 24 +#else + #define RGBLED_NUM 6 +#endif + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 255 + #else + #if RGBLED_NUM <= 16 + #define RGBLIGHT_LIMIT_VAL 130 + #else + #define RGBLIGHT_LIMIT_VAL 120 + #endif + #endif + #define RGBLIGHT_VAL_STEP 17 +#else + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 90 + #else + #if RGBLED_NUM <= 16 + #define RGBLIGHT_LIMIT_VAL 45 + #else + #define RGBLIGHT_LIMIT_VAL 35 + #endif + #endif + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value +// 120 RGBoff +// 330 RGB 6 +// 300 RGB 32 + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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/zinc/reva/info.json b/keyboards/zinc/reva/info.json new file mode 100644 index 0000000000..138c79068b --- /dev/null +++ b/keyboards/zinc/reva/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Zinc rev.A", + "url": "https://github.com/monksoffunk/zinc", + "maintainer": "monksoffunk", + "width": 15, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 48, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}] + } + } +} diff --git a/keyboards/zinc/reva/matrix.c b/keyboards/zinc/reva/matrix.c new file mode 100644 index 0000000000..220954f051 --- /dev/null +++ b/keyboards/zinc/reva/matrix.c @@ -0,0 +1,356 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else // USE_SERIAL +# include "split_scomm.h" +#endif + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + TXLED0; + RXLED0; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + return 1; +} + +#ifdef USE_MATRIX_I2C + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at 0x00 + err = i2c_master_write(0x00); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(int master_changed) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; +#ifdef SERIAL_USE_MULTI_TRANSACTION + int ret=serial_update_buffers(master_changed); +#else + int ret=serial_update_buffers(); +#endif + if (ret ) { + if(ret==2) RXLED1; + return 1; + } + RXLED0; + memcpy(&matrix[slaveOffset], + (void *)serial_slave_buffer, sizeof(serial_slave_buffer)); + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + memcpy(&matrix[offset], + (void *)serial_master_buffer, sizeof(serial_master_buffer)); + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + int mchanged = 1; + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C +// for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ +// i2c_slave_buffer[i] = matrix[offset+i]; +// } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + mchanged = memcmp((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); + #endif + memcpy((void *)serial_master_buffer, + &matrix[offset], sizeof(serial_master_buffer)); +#endif + +#ifdef USE_MATRIX_I2C + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction(mchanged) ) { +#endif + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#ifdef USE_MATRIX_I2C + for (int i = 0; i < ROWS_PER_HAND; ++i) { + /* i2c_slave_buffer[i] = matrix[offset+i]; */ + i2c_slave_buffer[i] = matrix[offset+i]; + } +#else // USE_SERIAL + #ifdef SERIAL_USE_MULTI_TRANSACTION + int change = 0; + #endif + for (int i = 0; i < ROWS_PER_HAND; ++i) { + #ifdef SERIAL_USE_MULTI_TRANSACTION + if( serial_slave_buffer[i] != matrix[offset+i] ) + change = 1; + #endif + serial_slave_buffer[i] = matrix[offset+i]; + } + #ifdef SERIAL_USE_MULTI_TRANSACTION + slave_buffer_change_count += change; + #endif +#endif +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/zinc/reva/reva.c b/keyboards/zinc/reva/reva.c new file mode 100644 index 0000000000..2ce08a07c4 --- /dev/null +++ b/keyboards/zinc/reva/reva.c @@ -0,0 +1,6 @@ +#include "zinc.h" + +void matrix_init_kb(void) { + matrix_init_user(); +}; + diff --git a/keyboards/zinc/reva/reva.h b/keyboards/zinc/reva/reva.h new file mode 100644 index 0000000000..933e635c2d --- /dev/null +++ b/keyboards/zinc/reva/reva.h @@ -0,0 +1,44 @@ +#pragma once + +#include "../zinc.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + + + +// Standard Keymap +// (TRRS jack on both halves are to the left side) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05}, \ + { L10, L11, L12, L13, L14, L15}, \ + { L20, L21, L22, L23, L24, L25}, \ + { L30, L31, L32, L33, L34, L35}, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + } + +#define LAYOUT_ortho_4x12 LAYOUT diff --git a/keyboards/zinc/reva/rules.mk b/keyboards/zinc/reva/rules.mk new file mode 100644 index 0000000000..3ea61267a2 --- /dev/null +++ b/keyboards/zinc/reva/rules.mk @@ -0,0 +1,4 @@ +SRC += reva/matrix.c +SRC += reva/split_util.c +SRC += reva/split_scomm.c +SRC += ws2812.c diff --git a/keyboards/zinc/reva/serial_config.h b/keyboards/zinc/reva/serial_config.h new file mode 100644 index 0000000000..9fb5dfc671 --- /dev/null +++ b/keyboards/zinc/reva/serial_config.h @@ -0,0 +1,18 @@ +#ifndef SOFT_SERIAL_CONFIG_H +#define SOFT_SERIAL_CONFIG_H + +#ifndef SOFT_SERIAL_PIN +/* Soft Serial defines */ +#define SOFT_SERIAL_PIN D2 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +#endif + +//// USE flexible API (using multi-type transaction function) +#define SERIAL_USE_MULTI_TRANSACTION + +#endif /* SOFT_SERIAL_CONFIG_H */ diff --git a/keyboards/zinc/reva/serial_config_simpleapi.h b/keyboards/zinc/reva/serial_config_simpleapi.h new file mode 100644 index 0000000000..e2d22a41e7 --- /dev/null +++ b/keyboards/zinc/reva/serial_config_simpleapi.h @@ -0,0 +1,8 @@ +#ifndef SERIAL_CONFIG_SIMPLEAPI_H +#define SERIAL_CONFIG_SIMPLEAPI_H + +#undef SERIAL_USE_MULTI_TRANSACTION +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +#endif // SERIAL_CONFIG_SIMPLEAPI_H diff --git a/keyboards/zinc/reva/split_scomm.c b/keyboards/zinc/reva/split_scomm.c new file mode 100644 index 0000000000..50d233ce9a --- /dev/null +++ b/keyboards/zinc/reva/split_scomm.c @@ -0,0 +1,95 @@ +#ifdef USE_SERIAL +#ifdef SERIAL_USE_MULTI_TRANSACTION +/* --- USE flexible API (using multi-type transaction function) --- */ + +#include +#include +#include +#include +#include "serial.h" +#ifdef SERIAL_DEBUG_MODE +#include +#endif +#ifdef CONSOLE_ENABLE + #include +#endif + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +uint8_t volatile status_com = 0; +uint8_t volatile status1 = 0; +uint8_t slave_buffer_change_count = 0; +uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; + +SSTD_t transactions[] = { +#define GET_SLAVE_STATUS 0 + /* master buffer not changed, only recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + 0, NULL, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define PUT_MASTER_GET_SLAVE_STATUS 1 + /* master buffer changed need send, and recive slave_buffer_change_count */ + { (uint8_t *)&status_com, + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + sizeof(slave_buffer_change_count), &slave_buffer_change_count, + }, +#define GET_SLAVE_BUFFER 2 + /* recive serial_slave_buffer */ + { (uint8_t *)&status1, + 0, NULL, + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + } +}; + +void serial_master_init(void) +{ + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); +} + +void serial_slave_init(void) +{ + soft_serial_target_init(transactions, TID_LIMIT(transactions)); +} + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(int master_update) +{ + int status, smatstatus; + static int need_retry = 0; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; + } + return smatstatus; +} + +#endif // SERIAL_USE_MULTI_TRANSACTION +#endif /* USE_SERIAL */ diff --git a/keyboards/zinc/reva/split_scomm.h b/keyboards/zinc/reva/split_scomm.h new file mode 100644 index 0000000000..873d8939d8 --- /dev/null +++ b/keyboards/zinc/reva/split_scomm.h @@ -0,0 +1,24 @@ +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ +#include "serial.h" + +#else +/* --- USE flexible API (using multi-type transaction function) --- */ +// Buffers for master - slave communication +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +extern uint8_t slave_buffer_change_count; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(int master_changed); + +#endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/zinc/reva/split_util.c b/keyboards/zinc/reva/split_util.c new file mode 100644 index 0000000000..e1ff8b4379 --- /dev/null +++ b/keyboards/zinc/reva/split_util.c @@ -0,0 +1,70 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" + +#ifdef USE_MATRIX_I2C +# include "i2c.h" +#else +# include "split_scomm.h" +#endif + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c + #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_master_init(); +#else + serial_master_init(); +#endif +} + +static void keyboard_slave_setup(void) { + +#ifdef USE_MATRIX_I2C + i2c_slave_init(SLAVE_I2C_ADDRESS); +#else + serial_slave_init(); +#endif +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +#define SLAVE_I2C_ADDRESS 0x32 + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/zinc/rules.mk b/keyboards/zinc/rules.mk new file mode 100644 index 0000000000..5236c0bb02 --- /dev/null +++ b/keyboards/zinc/rules.mk @@ -0,0 +1,72 @@ +#SRC += i2c.c +SRC += serial.c + +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SUBPROJECT_rev1 = no +USE_I2C = yes +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = zinc/rev1 diff --git a/keyboards/zinc/serial.c b/keyboards/zinc/serial.c new file mode 100644 index 0000000000..830f86b55a --- /dev/null +++ b/keyboards/zinc/serial.c @@ -0,0 +1,542 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include +#include "serial.h" +//#include + +#ifdef SOFT_SERIAL_PIN + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + #endif + uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + sizeof(serial_master_buffer), (uint8_t *)serial_master_buffer, + #else + 0, (uint8_t *)NULL, + #endif + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + sizeof(serial_slave_buffer), (uint8_t *)serial_slave_buffer + #else + 0, (uint8_t *)NULL, + #endif + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers() +{ + int result; + result = soft_serial_transaction(); + return result; +} + +#endif // Simple API (OLD API, compatible with let's split serial.c) + +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif + +#define TID_SEND_ADJUST 2 + +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 6 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static void serial_low(void) ALWAYS_INLINE; +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static void serial_high(void) ALWAYS_INLINE; +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); +} + +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif +} + +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; +static +void sync_recv(void) { + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void)NO_INLINE; +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; + + return byte; +} + +// Sends a byte with MSB ordering +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); + } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } + serial_delay(); + + serial_low(); // sync_send() / senc_recv() need raise edge +} + +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; + sync_send(); + serial_write_chunk(data,8); + } +} + +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} + +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} + +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; + } + serial_delay_half1(); + + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif + + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } + } else { + *trans->status = TRANSACTION_ACCEPTED; + } + + sync_recv(); //weit initiator output to high +} + +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) +// +// Returns: +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif + cli(); + + // signal to the target that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH_US); + +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the target is present + if (serial_read_pin()) { + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); + } + + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); + } +#endif + + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); + } + + // always, release the line when not in use + sync_send(); + + *trans->status = TRANSACTION_END; + sei(); + return TRANSACTION_END; +} + +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split (#2308) +// 2018-6-28 bug fix master to slave comm (#3255) +// 2018-8-11 improvements (#3608) +// 2018-10-21 fix serial and RGB animation conflict (#4191) diff --git a/keyboards/zinc/serial.h b/keyboards/zinc/serial.h new file mode 100644 index 0000000000..7e0c0847a4 --- /dev/null +++ b/keyboards/zinc/serial.h @@ -0,0 +1,84 @@ +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H + +#include + +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps +// +// //// USE Simple API (OLD API, compatible with let's split serial.c) +// ex. +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// + + +#ifndef SERIAL_USE_MULTI_TRANSACTION +/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if SERIAL_SLAVE_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +#endif +#if SERIAL_MASTER_BUFFER_LENGTH > 0 +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +#endif + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); + +#endif // USE Simple API + +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) + +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); + +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); +#endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/zinc/zinc.c b/keyboards/zinc/zinc.c new file mode 100644 index 0000000000..139919d5a6 --- /dev/null +++ b/keyboards/zinc/zinc.c @@ -0,0 +1 @@ +#include "zinc.h" diff --git a/keyboards/zinc/zinc.h b/keyboards/zinc/zinc.h new file mode 100644 index 0000000000..87d889da03 --- /dev/null +++ b/keyboards/zinc/zinc.h @@ -0,0 +1,14 @@ +#ifndef ZINC_H +#define ZINC_H + +#ifdef KEYBOARD_zinc_reva + #include "reva.h" +#endif +#ifdef KEYBOARD_zinc_rev1 + #include "rev1.h" +#endif + + +#include "quantum.h" + +#endif -- cgit v1.2.3 From 6916c0d728c604895c96bb7105114b153f1f6731 Mon Sep 17 00:00:00 2001 From: Mattia Dal Ben Date: Sat, 27 Oct 2018 17:23:12 +0200 Subject: Redox Wireless configurator support (#4256) --- keyboards/redox_w/info.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 keyboards/redox_w/info.json diff --git a/keyboards/redox_w/info.json b/keyboards/redox_w/info.json new file mode 100644 index 0000000000..5bc65b5d98 --- /dev/null +++ b/keyboards/redox_w/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Redox Wireless", + "url": "", + "maintainer": "qmk", + "width": 18.5, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [{"label":"[L2] `", "x":0, "y":0.375, "w":1.25}, {"label":"!", "x":1.25, "y":0.375}, {"label":"@", "x":2.25, "y":0.125}, {"label":"#", "x":3.25, "y":0}, {"label":"$", "x":4.25, "y":0.125}, {"label":"%", "x":5.25, "y":0.25}, {"label":"[L1]", "x":6.25, "y":0.75}, {"label":"[L1]", "x":11.25, "y":0.75}, {"label":"^", "x":12.25, "y":0.25}, {"label":"&", "x":13.25, "y":0.125}, {"label":"*", "x":14.25, "y":0}, {"label":"(", "x":15.25, "y":0.125}, {"label":")", "x":16.25, "y":0.375}, {"label":"[L2] -", "x":17.25, "y":0.375, "w":1.25}, {"label":"Tab", "x":0, "y":1.375, "w":1.25}, {"label":"Q", "x":1.25, "y":1.375}, {"label":"W", "x":2.25, "y":1.125}, {"label":"E", "x":3.25, "y":1}, {"label":"R", "x":4.25, "y":1.125}, {"label":"T", "x":5.25, "y":1.25}, {"label":"[", "x":6.25, "y":1.75, "h":1.5}, {"label":"]", "x":11.25, "y":1.75, "h":1.5}, {"label":"Y", "x":12.25, "y":1.25}, {"label":"U", "x":13.25, "y":1.125}, {"label":"I", "x":14.25, "y":1}, {"label":"O", "x":15.25, "y":1.125}, {"label":"P", "x":16.25, "y":1.375}, {"label":"=", "x":17.25, "y":1.375, "w":1.25}, {"label":"Esc", "x":0, "y":2.375, "w":1.25}, {"label":"A", "x":1.25, "y":2.375}, {"label":"S", "x":2.25, "y":2.125}, {"label":"D", "x":3.25, "y":2}, {"label":"F", "x":4.25, "y":2.125}, {"label":"G", "x":5.25, "y":2.25}, {"label":"PgUp", "x":6.75, "y":3.75}, {"label":"End", "x":10.75, "y":3.75}, {"label":"H", "x":12.25, "y":2.25}, {"label":"J", "x":13.25, "y":2.125}, {"label":"K", "x":14.25, "y":2}, {"label":"L", "x":15.25, "y":2.125}, {"label":":", "x":16.25, "y":2.375}, {"label":"'", "x":17.25, "y":2.375, "w":1.25}, {"label":"Shift", "x":0, "y":3.375, "w":1.25}, {"label":"Z", "x":1.25, "y":3.375}, {"label":"X", "x":2.25, "y":3.125}, {"label":"C", "x":3.25, "y":3}, {"label":"V", "x":4.25, "y":3.125}, {"label":"B", "x":5.25, "y":3.25}, {"label":"PgDn", "x":7.75, "y":3.75}, {"label":"Home", "x":9.75, "y":3.75}, {"label":"N", "x":12.25, "y":3.25}, {"label":"M", "x":13.25, "y":3.125}, {"label":"<", "x":14.25, "y":3}, {"label":">", "x":15.25, "y":3.125}, {"label":"?", "x":16.25, "y":3.375}, {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, {"label":"GUI", "x":0.25, "y":4.375}, {"label":"+", "x":1.25, "y":4.375}, {"label":"-", "x":2.25, "y":4.125}, {"label":"[Alt] *", "x":3.25, "y":4}, {"label":"[Ctrl] /", "x":5.5, "y":5.25, "w":1.25}, {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, {"label":"Del", "x":7.75, "y":4.75, "h":1.5}, {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, {"label":"Alt", "x":11.75, "y":5.25, "w":1.25}, {"label":"Left", "x":14.25, "y":4}, {"label":"Down", "x":15.25, "y":4.125}, {"label":"Up", "x":16.25, "y":4.375}, {"label":"Right", "x":17.25, "y":4.375}] + } + } +} -- cgit v1.2.3 From 2da852215443dc62617efee911c11a6dd9d03139 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Sat, 27 Oct 2018 17:29:34 +0200 Subject: Keymap: add my planck rev 5 layout (#4085) --- keyboards/planck/keymaps/jasperla/config.h | 10 ++ keyboards/planck/keymaps/jasperla/keymap.c | 136 ++++++++++++++++++++++++++++ keyboards/planck/keymaps/jasperla/readme.md | 7 ++ keyboards/planck/keymaps/jasperla/rules.mk | 1 + 4 files changed, 154 insertions(+) create mode 100644 keyboards/planck/keymaps/jasperla/config.h create mode 100644 keyboards/planck/keymaps/jasperla/keymap.c create mode 100644 keyboards/planck/keymaps/jasperla/readme.md create mode 100644 keyboards/planck/keymaps/jasperla/rules.mk diff --git a/keyboards/planck/keymaps/jasperla/config.h b/keyboards/planck/keymaps/jasperla/config.h new file mode 100644 index 0000000000..dc2a7369b4 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/config.h @@ -0,0 +1,10 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) +#endif + +/* + * MIDI options + */ +#define MIDI_BASIC diff --git a/keyboards/planck/keymaps/jasperla/keymap.c b/keyboards/planck/keymaps/jasperla/keymap.c new file mode 100644 index 0000000000..14f445d0f2 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _POINTER, + _ADJUST +}; + +#define QWERTY 0 + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define PT MO(_POINTER) + +/* ALT+F12 is mapped (in software) to lock the user's display */ +#define LOCK LALT(KC_F12) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT , + KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | INS |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_INS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Pointers + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | Up | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | | | | | Left | Down | Right| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_POINTER] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, PT, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, _______, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} diff --git a/keyboards/planck/keymaps/jasperla/readme.md b/keyboards/planck/keymaps/jasperla/readme.md new file mode 100644 index 0000000000..381667c73a --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/readme.md @@ -0,0 +1,7 @@ +# jasperla's keymap for Planck + +Slightly adjusted from the default keymap: +- map the arrow keys to IJKL on a separate "pointers" layer +- return key is next to the space key, and an RSHIFT is mapped + to where return used to be +- removed the dvorak, colemak and plover layers diff --git a/keyboards/planck/keymaps/jasperla/rules.mk b/keyboards/planck/keymaps/jasperla/rules.mk new file mode 100644 index 0000000000..dcf16bef39 --- /dev/null +++ b/keyboards/planck/keymaps/jasperla/rules.mk @@ -0,0 +1 @@ +SRC += muse.c -- cgit v1.2.3 From 569545a78f24644b1b130369d53932f7f46a588a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Pevec?= Date: Sat, 27 Oct 2018 17:30:47 +0200 Subject: Keymap: Personal dz60 keymap (#4251) * Personal dz60 keymap * Replacing unused macros Co-Authored-By: pevecyan * Fixes on keymap --- keyboards/dz60/keymaps/pevecyan/keymap.c | 41 ++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 keyboards/dz60/keymaps/pevecyan/keymap.c diff --git a/keyboards/dz60/keymaps/pevecyan/keymap.c b/keyboards/dz60/keymaps/pevecyan/keymap.c new file mode 100644 index 0000000000..897b6260ba --- /dev/null +++ b/keyboards/dz60/keymaps/pevecyan/keymap.c @@ -0,0 +1,41 @@ + +#include QMK_KEYBOARD_H +#include "keymap_slovenian.h" + + +#define CARON LT(3, SI_CIRC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT( \ + KC_GESC,SI_1, SI_2, SI_3, SI_4, SI_5, SI_6, SI_7, SI_8, SI_9, SI_0, SI_QOT, SI_PLUS,XXXXXXX,KC_BSPC, \ + KC_TAB, SI_Q, SI_W, SI_E, SI_R, SI_T, SI_Z, SI_U, SI_I, SI_O, SI_P, SI_GRV, SI_TILD,CARON, \ + MO(2), SI_A, SI_S, SI_D, SI_F, SI_G, SI_H, SI_J, SI_K, SI_L, KC_SCLN,KC_QUOT,KC_ENT, \ + KC_LSFT,XXXXXXX,SI_Y, SI_X, SI_C, SI_V, SI_B, SI_N, SI_M, SI_COMM,SI_DOT, SI_MINS, KC_RSFT,XXXXXXX, \ + KC_LCTL,KC_LGUI, KC_LALT,KC_SPC, KC_SPC, KC_SPC, KC_RALT,MO(3), XXXXXXX,MO(1), KC_F5 \ + ), + + [1] = LAYOUT( \ + KC_GRV, 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_DEL, \ + _______, RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD,_______,_______,_______,_______,RESET, \ + _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,BL_DEC, BL_TOGG,BL_INC, BL_STEP,_______,_______,_______,_______, _______,_______, \ + _______,_______, _______,_______, _______, _______, _______,_______,_______,_______,_______ \ + ), + + [2] = LAYOUT( \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______, KC_BSPC,KC_UP, KC_DEL, _______,_______,_______,_______,_______,_______,_______,_______,KC_HOME, KC_END, \ + _______, KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______, \ + _______,_______, _______,_______, _______, _______, _______,_______,_______,_______,_______ \ + ), + + [3] = LAYOUT( \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______, _______,_______,_______,_______,_______,SI_ZV, _______,_______,_______,_______,_______,_______,_______, \ + _______, _______,SI_SV, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,SI_CV, _______,_______,_______,_______,_______,_______,_______, _______,_______, \ + _______,_______, _______,_______, _______, _______, _______,_______,_______,_______,_______ \ + ), +}; -- cgit v1.2.3 From 9ea01035202e0d9b43413537702ac77b4c32108c Mon Sep 17 00:00:00 2001 From: Mattia Dal Ben Date: Sat, 27 Oct 2018 18:40:28 +0200 Subject: Keyboard: Redox keymaps refactoring (#4258) * Reconfigured keymap macro to resemble physical layout * Updated italian keymap * Added RGB controls * Updated default keymap * Updated german layout * Updated jeherve keymap * Changed include guards to pragmas * Changed include guards to pragmas in keymaps * Update readme * Fixed unused include * Fixed indentation --- keyboards/redox/config.h | 5 +- keyboards/redox/keymaps/default/config.h | 7 +- keyboards/redox/keymaps/default/keymap.c | 136 ++++++++++------------- keyboards/redox/keymaps/german/keymap.c | 126 ++++++++++------------ keyboards/redox/keymaps/italian/config.h | 7 +- keyboards/redox/keymaps/italian/keymap.c | 146 ++++++++++++------------- keyboards/redox/keymaps/jeherve/keymap.c | 179 +++++++++++++------------------ keyboards/redox/readme.md | 10 +- keyboards/redox/redox.h | 22 +--- keyboards/redox/rev1/config.h | 5 +- keyboards/redox/rev1/rev1.h | 74 ++++--------- 11 files changed, 290 insertions(+), 427 deletions(-) diff --git a/keyboards/redox/config.h b/keyboards/redox/config.h index 1083ff5f59..96f57f25eb 100644 --- a/keyboards/redox/config.h +++ b/keyboards/redox/config.h @@ -15,9 +15,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" - -#endif diff --git a/keyboards/redox/keymaps/default/config.h b/keyboards/redox/keymaps/default/config.h index 22e26c0041..0670bf294f 100644 --- a/keyboards/redox/keymaps/default/config.h +++ b/keyboards/redox/keymaps/default/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -37,5 +34,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/redox/keymaps/default/keymap.c b/keyboards/redox/keymaps/default/keymap.c index 3031a0c8e3..ef8eeb2e14 100644 --- a/keyboards/redox/keymaps/default/keymap.c +++ b/keyboards/redox/keymaps/default/keymap.c @@ -18,99 +18,75 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTPL LCTL_T(KC_PSLS) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY - * ,------------------------------------------------. ,------------------------------------------------. - * |`-Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |--Lyr2| - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | = | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | ; | ' | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | \ |Shift | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Gui | + | - |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space | Alt | Left | Down | Up | Right| - * `------------------------------------------------' `------------------------------------------------' - */ [_QWERTY] = LAYOUT( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - LT(_NAV, KC_GRV) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,MO(_SYMB), MO(_SYMB), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,LT(_NAV, KC_MINS), - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T ,KC_LBRC, KC_RBRC , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_EQL, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PGDN, KC_HOME , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_BSLASH, KC_RSFT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LGUI,KC_PPLS,KC_PMNS,LALT_T(KC_PAST),LCTL_T(KC_PSLS),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, KC_RALT,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_BKSL ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_LGUI ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Symbols - * ,------------------------------------------------. ,------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | # | $ | [ | ] | ~ | | | | | 4 | 5 | 6 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | % | ^ | ( | ) | ` | | | | | 1 | 2 | 3 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | 0 | 0 | . | | | - * `------------------------------------------------' `------------------------------------------------' - */ - [_SYMB] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, - _______, KC_EXLM, KC_AT , KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX, - _______, KC_HASH, KC_DLR , KC_LBRC, KC_RBRC, KC_GRV, _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, - _______, KC_PERC, KC_CIRC, KC_LPRN, KC_RPRN, KC_TILD, _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_LCBR ,KC_RCBR ,KC_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_DLR ,KC_LBRC ,KC_RBRC ,KC_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PERC ,KC_CIRC ,KC_LPRN ,KC_RPRN ,KC_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Navigation - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | |MOUS_U| |WHEL_U| | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | |MOUS_L|MOUS_D|MOUS_R|WHEL_D| | | | | LEFT | DOWN | UP |RIGHT | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | |MOUS_1|MOUS_2| | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_NAV] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, KC_WH_U, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT,XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), [_ADJUST] = LAYOUT( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, - XXXXXXX, RESET , RGB_M_P, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, KC_DEL, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) }; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - diff --git a/keyboards/redox/keymaps/german/keymap.c b/keyboards/redox/keymaps/german/keymap.c index 315740f68b..f94cd164a8 100644 --- a/keyboards/redox/keymaps/german/keymap.c +++ b/keyboards/redox/keymaps/german/keymap.c @@ -1,4 +1,5 @@ #include QMK_KEYBOARD_H + #include "keymap_german.h" extern keymap_config_t keymap_config; @@ -20,89 +21,76 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTPL LCTL_T(KC_PSLS) + +#define KC_NAGR LT(_NAV, DE_CIRC) +#define KC_NAMI LT(_NAV, DE_SS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY - * ,------------------------------------------------. ,------------------------------------------------. - * |^/Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |--Lyr2| - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | ` | | + | Y | U | I | O | P | = | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | Ö | Ä | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | - |Shift | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Gui | < | # |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space | Alt | Left | Down | Up | Right| - * `------------------------------------------------' `------------------------------------------------' - */ [_QWERTY] = LAYOUT( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - LT(_NAV, DE_CIRC) , DE_1 , DE_2 , DE_3 , DE_4 , DE_5 ,MO(_SYMB), MO(_SYMB), DE_6 , DE_7 , DE_8 , DE_9 , DE_0 ,LT(_NAV, DE_SS), - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_TAB , DE_Q , DE_W , DE_E , DE_R , DE_T , DE_ACUT, DE_PLUS , DE_Z , DE_U , DE_I , DE_O , DE_P , DE_UE, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_ESC , DE_A , DE_S , DE_D , DE_F , DE_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , DE_H , DE_J , DE_K , DE_L , DE_OE , DE_AE, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LSFT, DE_Y , DE_X , DE_C , DE_V , DE_B ,KC_PGDN, KC_HOME , DE_N , DE_M , DE_COMM, DE_DOT , DE_MINS , KC_RSFT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LGUI , DE_LESS , DE_HASH , LALT_T(KC_KP_PLUS),LCTL_T(KC_KP_ASTERISK),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, DE_ALGR , KC_LEFT, KC_DOWN, KC_UP , KC_RGHT - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,DE_1 ,DE_2 ,DE_3 ,DE_4 ,DE_5 , DE_6 ,DE_7 ,DE_8 ,DE_9 ,DE_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,DE_Q ,DE_W ,DE_E ,DE_R ,DE_T ,SYM_L , SYM_L ,DE_Z ,DE_U ,DE_I ,DE_O ,DE_P ,DE_UE , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC ,DE_A ,DE_S ,DE_D ,DE_F ,DE_G ,DE_ACUT , DE_PLUS ,DE_H ,DE_J ,DE_K ,DE_L ,DE_OE ,DE_AE , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,DE_Y ,DE_X ,DE_C ,DE_V ,DE_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,DE_N ,DE_M ,DE_COMM ,DE_DOT ,DE_MINS ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_LGUI ,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , KC_RALT , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Symbols - * ,------------------------------------------------. ,------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | F12 | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | # | $ | [ | ] | ~ | | | | | 4 | 5 | 6 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| % | ^ | ( | ) | ` | | | | | 1 | 2 | 3 | |Shift | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | Alt | Ctrl | | | | | | 0 | 0 | . | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_SYMB] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - _______, DE_EXLM, DE_AT , DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, KC_F12, - _______, DE_HASH, DE_DLR , DE_LBRC, DE_RBRC, DE_TILD, _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, - KC_LSFT, DE_PERC, DE_CIRC, DE_LPRN, DE_RPRN, DE_GRV, _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, KC_RSFT, - _______, _______, _______, KC_LALT, KC_LCTL, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,DE_EXLM ,DE_AT ,DE_LCBR ,DE_RCBR ,DE_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,KC_F12 , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,DE_HASH ,DE_DLR ,DE_LBRC ,DE_RBRC ,DE_TILD ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,DE_PERC ,DE_CIRC ,DE_LPRN ,DE_RPRN ,DE_GRV ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,KC_LALT , KC_LCTL , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Navigation - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | |MOUS_U| |WHEL_U| | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | |MOUS_L|MOUS_D|MOUS_R|WHEL_D| | | | | LEFT | DOWN | UP |RIGHT | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | |MOUS_1|MOUS_2| | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_NAV] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, KC_WH_U, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT,XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), [_ADJUST] = LAYOUT( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, - XXXXXXX, RESET , RGB_M_P, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, KC_DEL, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) }; diff --git a/keyboards/redox/keymaps/italian/config.h b/keyboards/redox/keymaps/italian/config.h index 22e26c0041..0670bf294f 100644 --- a/keyboards/redox/keymaps/italian/config.h +++ b/keyboards/redox/keymaps/italian/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* Use I2C or Serial, not both */ @@ -37,5 +34,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/redox/keymaps/italian/keymap.c b/keyboards/redox/keymaps/italian/keymap.c index c590d2d2d8..1eb34ff104 100644 --- a/keyboards/redox/keymaps/italian/keymap.c +++ b/keyboards/redox/keymaps/italian/keymap.c @@ -1,5 +1,7 @@ #include QMK_KEYBOARD_H +#include "keymap_italian.h" + extern keymap_config_t keymap_config; // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -18,99 +20,83 @@ enum custom_keycodes { ADJUST, }; -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO +// Shortcut to make keymap more readable +#define KC_BKSL KC_BSLASH +#define SYM_L MO(_SYMB) + +#define KC_ALAS LALT_T(KC_PAST) +#define KC_CTPL LCTL_T(KC_PSLS) + +#define KC_NAGR LT(_NAV, KC_GRV) +#define KC_NAMI LT(_NAV, KC_MINS) + +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) + +// Italian specific shortcuts +#define ALT_IACC RALT_T(IT_IACC) +#define GUI_LESS LGUI_T(IT_LESS) + +#define IT_SHSL RSFT_T(KC_SLSH) +#define IT_GRV RALT(KC_MINS) +#define IT_TILD RALT(KC_EQL) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY - * ,------------------------------------------------. ,------------------------------------------------. - * |\-Lyr2| 1 | 2 | 3 | 4 | 5 | Lyr1 | | Lyr1 | 6 | 7 | 8 | 9 | 0 |'-Lyr2| - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | è | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Esc | A | S | D | F | G | PgUp | | End | H | J | K | L | ò | à | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | PgDn | | Home | N | M | , | . | ù |-(Sft)| - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * |<(Gui)| + | - |*(Alt)|/(Ctr)|Bcksp | Del | |Enter |Space |ì(AlG)| Left | Down | Up | Right| - * `------------------------------------------------' `------------------------------------------------' - */ [_QWERTY] = LAYOUT( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - LT(_NAV, KC_GRV) , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,MO(_SYMB), MO(_SYMB), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,LT(_NAV, KC_MINS), - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T ,RALT(KC_LBRC), RALT(KC_RBRC) , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_LBRC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , LT(_ADJUST, KC_PGUP), LT( _ADJUST, KC_END) , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_PGDN, KC_HOME , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_BSLASH,RSFT_T(KC_SLSH), - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LGUI_T(KC_NONUS_BSLASH),KC_PPLS,KC_PMNS,LALT_T(KC_PAST),LCTL_T(KC_PSLS),KC_BSPC,KC_DEL , KC_ENT , KC_SPC, RALT_T(KC_EQL),KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_NAGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_NAMI , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,SYM_L , SYM_L ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,IT_EACC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_ESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,IT_LBRC , IT_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,IT_OACC ,IT_AACC , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,IT_UACC ,IT_SHSL , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + GUI_LESS,KC_PPLS ,KC_PMNS ,KC_ALAS , KC_CTPL , KC_BSPC ,KC_DEL , KC_ENT ,KC_SPC , ALT_IACC, KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Symbols - * ,------------------------------------------------. ,------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | ! | @ | { | } | | | | | | | 7 | 8 | 9 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | # | $ | [ | ] | ~ | | | | | 4 | 5 | 6 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | % | ^ | ( | ) | ` | | | | | 1 | 2 | 3 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | 0 | 0 | . | | | - * `------------------------------------------------' `------------------------------------------------' - */ - [_SYMB] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, XXXXXXX, - _______, KC_EXLM, RALT(KC_SCLN), RALT(KC_LCBR), RALT(KC_RCBR), KC_TILD, _______, _______, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, XXXXXXX, XXXXXXX, - _______, RALT(KC_QUOT), KC_DLR , RALT(KC_LBRC), RALT(KC_RBRC), RALT(KC_EQL), _______, _______, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, XXXXXXX, XXXXXXX, - _______, KC_PERC, LSFT(KC_EQL) , LSFT(KC_8), LSFT(KC_9), RALT(KC_MINS), _______, _______, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_0, KC_PDOT, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_EXLM ,IT_AT ,IT_LCBR ,IT_RCBR ,IT_PIPE ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_SHRP ,IT_DLR ,IT_LBRC ,IT_RBRC ,IT_GRV ,_______ , _______ ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,IT_PERC ,IT_CRC ,IT_LPRN ,IT_RPRN ,IT_TILD ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_KP_0 ,KC_PDOT ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Navigation - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | |MOUS_U| |WHEL_U| | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | |MOUS_L|MOUS_D|MOUS_R|WHEL_D| | | | | LEFT | DOWN | UP |RIGHT | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | |MOUS_1|MOUS_2| | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_NAV] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, XXXXXXX, KC_MS_U, XXXXXXX, KC_WH_U, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_D, XXXXXXX, _______, _______, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT,XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BTN1, KC_BTN2, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_MS_U ,XXXXXXX ,KC_WH_U ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,KC_MS_L ,KC_MS_D ,KC_MS_R ,KC_WH_D ,XXXXXXX ,_______ , _______ ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , KC_BTN1 , KC_BTN2 ,_______ , _______ ,_______ , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), [_ADJUST] = LAYOUT( - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, - XXXXXXX, RESET , RGB_M_P, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, KC_DEL, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) }; - -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - diff --git a/keyboards/redox/keymaps/jeherve/keymap.c b/keyboards/redox/keymaps/jeherve/keymap.c index d298fa9a31..f8dfc4854c 100644 --- a/keyboards/redox/keymaps/jeherve/keymap.c +++ b/keyboards/redox/keymaps/jeherve/keymap.c @@ -28,11 +28,6 @@ enum custom_keycodes { NBSP }; -// Fillers to make layering more clear -#define KC_ KC_TRNS -#define _______ KC_TRNS -#define XXXXXXX KC_NO - // Make macros a bit simpler with this shortcut. #define TAP_ONCE(code) \ register_code (code); \ @@ -129,118 +124,98 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; }; +// Shortcut to make keymap more readable +#define KC_CTDN LCTL(KC_DOWN) +#define KC_SYQT LT(_SYMB,KC_QUOT) +#define SYM_L MO(_SYMB) +#define MO_INTR MO(_INTER) +#define TT_ADJ TT(_ADJUST) + +#define UC_00E0 UC(0x00E0) +#define UC_00FC UC(0x00FC) +#define UC_00E8 UC(0x00E8) +#define UC_00F6 UC(0x00F6) +#define UC_00E1 UC(0x00E1) +#define UC_00F9 UC(0x00F9) +#define UC_00E9 UC(0x00E9) +#define UC_00ED UC(0x00ED) +#define UC_00F3 UC(0x00F3) +#define UC_00E2 UC(0x00E2) +#define UC_00E7 UC(0x00E7) +#define UC_0171 UC(0x0171) +#define UC_00EA UC(0x00EA) +#define UC_0151 UC(0x0151) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* COLEMAK - * ,------------------------------------------------. ,------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | Esc | | Exp | 6 | 7 | 8 | 9 | 0 | = | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | ( | | ) | J | L | U | Y | ; | \ | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Lay1 | A | R | S | T | D | Lay2 | | Lay2 | H | N | E | I | O |'/Lay1| - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | Lay1 | | Lay1 | K | M | , | . | / |Shift | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Lay3 | Ctrl | Hyper| Alt | Cmd |Bcksp | Ctrl | |Enter |Space | Cmd | Lay4 | Hyper| Ctrl | Lay3 | - * `------------------------------------------------' `------------------------------------------------' - */ [_COLEMAK] = LAYOUT( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 ,KC_ESC, LCTL(KC_DOWN), KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_EQL, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_TAB , KC_Q , KC_W , KC_F , KC_P , KC_G , M_BRACKET_LEFT, M_BRACKET_RIGHT , KC_J , KC_L , KC_U , KC_Y , KC_SCLN , KC_BSLS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - MO(_SYMB) , KC_A , KC_R , KC_S , KC_T , KC_D ,TT(_NAV), TT(_NAV) , KC_H , KC_N , KC_E , KC_I , KC_O , LT(_SYMB,KC_QUOT), - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B ,TT(_SYMB), TT(_SYMB) , KC_K , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_RSFT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - MO(_INTER),KC_LCTL,KC_HYPR,KC_LALT, KC_LCMD, KC_BSPC,KC_LCTL, KC_ENT,KC_SPC , KC_RCMD , TT(_ADJUST),KC_HYPR,KC_RCTL,MO(_INTER) - //`----+----+----+----+----+----+----' `----+----+----+----+----+----+----' + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_ESC , KC_CTDN ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + SYM_L ,KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,M_BRACKET_LEFT, M_BRACKET_RIGHT ,KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_SYQT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,TT(_NAV),TT(_SYMB), TT(_SYMB),TT(_NAV),KC_K ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , KC_RCMD , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Symbols - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | ! | @ | # | $ | % | | | | ^ | & | * | - | _ | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ - [_SYMB] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_LCBR, KC_RCBR, KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, - _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_UNDS, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_LCBR , KC_RCBR ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Navigation - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | |VOLDOW|VOL UP| MUTE | | | | LEFT | DOWN | UP |RIGHT | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_NAV] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, _______, _______, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP , KC_RIGHT, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,KC_VOLD ,KC_VOLU ,KC_MUTE ,XXXXXXX ,_______ , _______ ,XXXXXXX ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* i18n + emoji -* ,------------------------------------------------. ,------------------------------------------------. -* | | | | | | | | | | | | | | | | -* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| -* | | à | 👋 | | | | | | | | ü | è | YOSHI| ö | | -* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| -* | | á | |SHRUG | 👍 | | | | | | ú | é | í | ó | | -* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| -* | | â | | ç | | | | | | | ű | ê | | ő | | -* |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| -* | | | | | | | | | | | | | | | | -* `------------------------------------------------' `------------------------------------------------' -*/ [_INTER] = LAYOUT( - XXXXXXX, _______ , _______, _______ , _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, UC(0x00E0), WAVE , XXXXXXX , XXXXXXX , XXXXXXX, _______, _______, XXXXXXX, UC(0x00FC), UC(0x00E8), YOSHI, UC(0x00F6), XXXXXXX, - _______, UC(0x00E1), XXXXXXX, SHRUG , THUMB_UP, XXXXXXX, _______, _______, XXXXXXX, UC(0x00F9), UC(0x00E9), UC(0x00ED) , UC(0x00F3), _______, - XXXXXXX, UC(0x00E2), XXXXXXX, UC(0x00E7), XXXXXXX , XXXXXXX, _______, _______, XXXXXXX, UC(0x0171), UC(0x00EA), XXXXXXX, UC(0x0151), XXXXXXX, - _______, XXXXXXX , XXXXXXX, XXXXXXX , XXXXXXX , XXXXXXX, _______, _______, NBSP, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,UC_00E0 ,WAVE ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,UC_00FC ,UC_00E8 ,YOSHI ,UC_00F6 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,UC_00E1 ,XXXXXXX ,SHRUG ,THUMB_UP,XXXXXXX ,_______ , _______ ,XXXXXXX ,UC_00F9 ,UC_00E9 ,UC_00ED ,UC_00F3 ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,UC_00E2 ,XXXXXXX ,UC_00E7 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,UC_0171 ,UC_00EA ,XXXXXXX ,UC_0151 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), -/* Adjust keyboard settings - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | RGB- | RGB+ |RGB ON| | | | | | RESET| DEBUG|AUD ON| | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `------------------------------------------------' `------------------------------------------------' - */ [_ADJUST] = LAYOUT( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, RGB_VAD, RGB_VAI, RGB_TOG, XXXXXXX, _______, _______, XXXXXXX, RESET , DEBUG , AU_TOG , XXXXXXX, _______, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______ + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,XXXXXXX ,RGB_VAD ,RGB_VAI ,RGB_TOG ,XXXXXXX ,_______ , _______ ,XXXXXXX ,RESET ,DEBUG ,AU_TOG ,XXXXXXX ,_______ , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) }; diff --git a/keyboards/redox/readme.md b/keyboards/redox/readme.md index 8a2fc4b04c..d237caf013 100644 --- a/keyboards/redox/readme.md +++ b/keyboards/redox/readme.md @@ -16,10 +16,14 @@ Make example for this keyboard (after setting up your build environment): - make redox/rev1:default +```sh +make redox/rev1:default +``` Example of flashing this keyboard: - make redox/rev1:default:avrdude +```sh +make redox/rev1:default:avrdude +``` -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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/redox/redox.h b/keyboards/redox/redox.h index 73f5ab85ae..2f08bddccc 100644 --- a/keyboards/redox/redox.h +++ b/keyboards/redox/redox.h @@ -13,29 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef REDOX_H -#define REDOX_H + +#pragma once #ifdef KEYBOARD_redox_rev1 #include "rev1.h" #endif -// Used to create a keymap using only KC_ prefixed keys -#define LAYOUT_kc( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - KEYMAP( \ - KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, KC_##R06, \ - KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, KC_##R16, \ - KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, KC_##R26, \ - KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, KC_##R36, \ - KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, KC_##R46 \ - ) - #include "quantum.h" - -#endif diff --git a/keyboards/redox/rev1/config.h b/keyboards/redox/rev1/config.h index fe951f7226..f4ccbd2fd5 100644 --- a/keyboards/redox/rev1/config.h +++ b/keyboards/redox/rev1/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H +#pragma once #include "config_common.h" @@ -82,5 +81,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/redox/rev1/rev1.h b/keyboards/redox/rev1/rev1.h index be62247500..1bc1531eed 100644 --- a/keyboards/redox/rev1/rev1.h +++ b/keyboards/redox/rev1/rev1.h @@ -1,66 +1,34 @@ -#ifndef REV1_H -#define REV1_H +#pragma once #include "../redox.h" -//void promicro_bootloader_jmp(bool program); #include "quantum.h" #ifdef USE_I2C #include #ifdef __AVR__ - #include - #include + #include + #include #endif #endif -//void promicro_bootloader_jmp(bool program); - -#ifndef FLIP_HALF -// Standard Keymap -// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) -#define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R06, R05, R04, R03, R02, R01, R00 }, \ - { R16, R15, R14, R13, R12, R11, R10 }, \ - { R26, R25, R24, R23, R22, R21, R20 }, \ - { R36, R35, R34, R33, R32, R31, R30 }, \ - { R46, R45, R44, R43, R42, R41, R40 } \ - } -#else -// Keymap with right side flipped -// (TRRS jack on both halves are to the right) #define LAYOUT( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, L22, L23, L24, L25, L26, R20, R21, R22, R23, R24, R25, R26, \ - L30, L31, L32, L33, L34, L35, L36, R30, R31, R32, R33, R34, R35, R36, \ - L40, L41, L42, L43, L44, L45, L46, R40, R41, R42, R43, R44, R45, R46 \ - ) \ - { \ - { L00, L01, L02, L03, L04, L05, L06 }, \ - { L10, L11, L12, L13, L14, L15, L16 }, \ - { L20, L21, L22, L23, L24, L25, L26 }, \ - { L30, L31, L32, L33, L34, L35, L36 }, \ - { L40, L41, L42, L43, L44, L45, L46 }, \ - { R00, R01, R02, R03, R04, R05, R06 }, \ - { R10, R11, R12, R13, R14, R15, R16 }, \ - { R20, R21, R22, R23, R24, R25, R26 }, \ - { R30, R31, R32, R33, R34, R35, R36 }, \ - { R40, R41, R42, R43, R44, R45, R46 } \ - } -#endif - -#endif + k00, k01, k02, k03, k04, k05, k08, k09, k10, k11, k12, k13, \ + k14, k15, k16, k17, k18, k19, k06, k07, k22, k23, k24, k25, k26, k27, \ + k28, k29, k30, k31, k32, k33, k20, k21, k36, k37, k38, k39, k40, k41, \ + k42, k43, k44, k45, k46, k47, k34, k48, k49, k35, k50, k51, k52, k53, k54, k55, \ + k56, k57, k58, k59, k60, k61, k62, k63, k64, k65, k66, k67, k68, k69 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06 }, \ + { k14, k15, k16, k17, k18, k19, k20 }, \ + { k28, k29, k30, k31, k32, k33, k34 }, \ + { k42, k43, k44, k45, k46, k47, k48 }, \ + { k56, k57, k58, k59, k60, k61, k62 }, \ + { k13, k12, k11, k10, k09, k08, k07 }, \ + { k27, k26, k25, k24, k23, k22, k21 }, \ + { k41, k40, k39, k38, k37, k36, k35 }, \ + { k55, k54, k53, k52, k51, k50, k49 }, \ + { k69, k68, k67, k66, k65, k64, k63 } \ +} -- cgit v1.2.3 From 5be438f03d0ae3ebdb9e24d249fdfd7f5c573634 Mon Sep 17 00:00:00 2001 From: akrob Date: Sat, 27 Oct 2018 10:41:17 -0600 Subject: Keymap: update keymap transmogrified (#4241) * layer locked breathing, layer changed brighter leds * move config for tapping term into config.h * Respect LED off even with layer indicators, add readme and update config to new standard * update Readme with note about both sides of board being required to flash --- keyboards/iris/keymaps/transmogrified/Readme.md | 9 + keyboards/iris/keymaps/transmogrified/config.h | 22 +- keyboards/iris/keymaps/transmogrified/keymap.c | 330 ++++++++++++++---------- 3 files changed, 214 insertions(+), 147 deletions(-) create mode 100644 keyboards/iris/keymaps/transmogrified/Readme.md diff --git a/keyboards/iris/keymaps/transmogrified/Readme.md b/keyboards/iris/keymaps/transmogrified/Readme.md new file mode 100644 index 0000000000..96e27411dd --- /dev/null +++ b/keyboards/iris/keymaps/transmogrified/Readme.md @@ -0,0 +1,9 @@ +This layout is an attempt to make switching between the Iris and my laptop keyboard as seemless as possible. I switch caps lock and Ctrl/ESC on my laptop and I am able to adjust well with everything else... I still miss the Iris, but I am able to get work done. + +I use the following lighting queues to indicate layer changes. + +* Momentary toggled layer : LEDs brighten and dim when layer is released. +* Locked layer : LEDs breath. +* Config layer locked : LEDs off. + +NOTE you will need to flash both sides to update the brightness_levels so that breathing works on both sides as expected. diff --git a/keyboards/iris/keymaps/transmogrified/config.h b/keyboards/iris/keymaps/transmogrified/config.h index 8df0824b7a..12f2d7d6d8 100644 --- a/keyboards/iris/keymaps/transmogrified/config.h +++ b/keyboards/iris/keymaps/transmogrified/config.h @@ -1,5 +1,5 @@ /* -Copyright 2017 Danny Nguyen +Copyright 2017 Adam Roberts 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 @@ -15,11 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -27,8 +23,7 @@ along with this program. If not, see . // #define USE_I2C /* Select hand configuration */ - -// #define MASTER_LEFT +//#define MASTER_LEFT #define MASTER_RIGHT // #define EE_HANDS @@ -39,4 +34,13 @@ along with this program. If not, see . #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#endif +#define NO_USB_STARTUP_CHECK //keep both sides on when pc is sleeping. +#define TAPPING_TERM 200 + +// Remove features i don't use +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO + +// Override the rev2 config.h BACKLIGHT_LEVELS setting +#undef BACKLIGHT_LEVELS +#define BACKLIGHT_LEVELS 125 diff --git a/keyboards/iris/keymaps/transmogrified/keymap.c b/keyboards/iris/keymaps/transmogrified/keymap.c index 43d6cc6002..67545f08e6 100644 --- a/keyboards/iris/keymaps/transmogrified/keymap.c +++ b/keyboards/iris/keymaps/transmogrified/keymap.c @@ -2,64 +2,55 @@ #include "action_layer.h" #include "eeconfig.h" -// config settings -#define TAPPING_TERM 250 -#define ONESHOT_TAP_TOGGLE 1 -#define ONESHOT_TIMEOUT 10000 - extern keymap_config_t keymap_config; #define _QWERTY 0 #define _COLEMAK 1 -#define _DVORAK 2 -#define _ONEHANDR 3 -#define _ONEHANDL 4 -#define _RLAYER 5 -#define _LLAYER 6 -#define _DUAL 7 -#define _CONFIG 8 +#define _RLAYER 2 +#define _LLAYER 3 +#define _DUAL 4 +#define _CONFIG 5 enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - ONEHANDR, - ONEHANDL, - RLAYER, - LLAYER, - RLOCK, - LLOCK, - DUAL, - CONFIG, + QWERTY = SAFE_RANGE, // qwerty base layer + COLEMAK, // colemak base layer + RLAYER, // right layer + LLAYER, // left layer + RLOCK, // right layer LOCK + LLOCK, // left layer LOCK + DUAL, // right and left combo layer + CONFIG, // config layer + LEDUP, // custom LED brightness increase keycode + LEDDOWN, // custom LED brightness decrease keycode }; /* Tap Dance */ enum { - TD_LGUIAPP, - TD_SHIFTCAPS, + TD_LGUIAPP, // LGUI x1, app/menu x2 + TD_SHIFTCAPS, // LSHIFT x1, CAPS x3 + TD_CTRLALTDL, // CTRL+ALT+DEL x3 + TD_SHIFTCLAT, // LSHIFT x1, LCRTL x2, LALT x3, CTRL+ALT x4 }; /* NOOP Key and Transparent */ #define KC_ KC_TRNS #define KC_XXXX KC_NO -/* LAYERS */ +/* LAYERS / CUSTOM KEYS */ #define KC_LLAY LLAYER #define KC_RLAY RLAYER #define KC_RLOK RLOCK #define KC_LLOK LLOCK #define KC_QWER QWERTY -#define KC_DVOR DVORAK #define KC_COLE COLEMAK -#define KC_ONER ONEHANDR -#define KC_ONEL ONEHANDL #define KC_DUAL DUAL #define KC_CONF CONFIG +#define KC_BLUP LEDUP +#define KC_BLDN LEDDOWN -/* Custom Shortened Keys */ +/* Custom Shortened Keys (4 digits so they fit in my grid) */ #define KC_MCTB LCTL(KC_TAB) #define KC_MCST LCTL(LSFT(KC_TAB)) -#define KC_MCAD LALT(LCTL(KC_DEL)) #define KC_CTEC CTL_T(KC_ESC) #define KC_SINS LSFT(KC_INS) #define KC_LGU1 LGUI(KC_1) @@ -72,27 +63,27 @@ enum { #define KC_LGU8 LGUI(KC_8) #define KC_LGU9 LGUI(KC_9) #define KC_LGU0 LGUI(KC_0) -#define KC_BLUP BL_INC -#define KC_BLDN BL_DEC #define KC_SYSR KC_SYSREQ #define KC_REST RESET /* Tap Dance */ #define KC_LGUA TD(TD_LGUIAPP) -#define KC_SHCL TD(TD_SHIFTCAPS) +#define KC_SHCP TD(TD_SHIFTCAPS) +#define KC_CADL TD(TD_CTRLALTDL) +#define KC_SHCA TD(TD_SHIFTCLAT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + CADL, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, //|----+----+----+----+----+----| |----+----+----+----+----+----| TAB , Q , W , E , R , T , Y , U , I , O , P ,DEL , //|----+----+----+----+----+----| |----+----+----+----+----+----| CTEC, A , S , D , F , G , H , J , K , L ,SCLN,ENT , //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SHCL, Z , X , C , V , B ,LLOK, RLOK, N , M ,COMM,DOT ,SLSH,RSFT, + SHCP, Z , X , C , V , B ,LLOK, RLOK, N , M ,COMM,DOT ,SLSH,SHCA, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' LALT,LLAY,TAB , SPC ,RLAY,LGUA // `----+----+----' `----+----+----' @@ -100,60 +91,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_COLEMAK] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, + CADL, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, //|----+----+----+----+----+----| |----+----+----+----+----+----| TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,DEL , //|----+----+----+----+----+----| |----+----+----+----+----+----| CTEC, A , R , S , T , D , H , N , E , I , O ,ENT , //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SHCL, Z , X , C , V , B ,LLOK, RLOK, K , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - LALT,LLAY,TAB , SPC ,RLAY,LGUA - // `----+----+----' `----+----+----' - ), - - [_DVORAK] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - XXXX, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - CTEC, A , O , E , U , I , D , H , T , N , S ,ENT , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - SHCL,SCLN, Q , J , K , X ,LLOK, RLOK, B , M , W , V , Z ,EQL , + SHCP, Z , X , C , V , B ,LLOK, RLOK, K , M ,COMM,DOT ,SLSH,SHCA, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' LALT,LLAY,TAB , SPC ,RLAY,LGUA // `----+----+----' `----+----+----' ), - [_ONEHANDR] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, 6 , 7 , 8 , 9 , 0 ,BSPC, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, Y , U , I , O , P ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX,QWER, XXXX, N , M ,COMM,DOT ,SLSH,RSFT, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - XXXX,XXXX,XXXX, SPC ,ONEL,ENT - // `----+----+----' `----+----+----' - ), - - [_ONEHANDL] = LAYOUT_kc( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, 5 , 4 , 3 , 2 , 1 ,XXXX, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, T , R , E , W , Q ,TAB , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, G , F , D , S , A ,ENT , - //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| - XXXX,XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX, B , V , C , X , Z ,SHCL, - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' - XXXX,XXXX,XXXX, SPC ,ONEL,ENT - // `----+----+----' `----+----+----' - ), - [_RLAYER] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. ,SLCK,SYSR,PSCR,INS ,PAUS, MUTE,VOLD,VOLU,BLDN,BLUP, , @@ -163,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ,EXLM,PIPE,DLR ,LPRN,RPRN, AMPR,LEFT,DOWN,RGHT,MINS,QUOT, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| , AT ,HASH,PERC,LCBR,RCBR, , ,CIRC,END ,UNDS,PGDN,BSLS, , - //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' + //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' , , , , , // `----+----+----' `----+----+----' ), @@ -186,7 +135,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. ,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, //|----+----+----+----+----+----| |----+----+----+----+----+----| - ,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,MS_U,XXXX,XXXX,MCAD, + ,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,MS_U,XXXX,XXXX,XXXX, //|----+----+----+----+----+----| |----+----+----+----+----+----| ,XXXX,XXXX,XXXX,XXXX,XXXX, BTN2,MS_L,MS_D,MS_R,BTN1,XXXX, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| @@ -200,9 +149,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. REST,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,QWER,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,ONER,XXXX,XXXX, + XXXX,QWER,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, //|----+----+----+----+----+----| |----+----+----+----+----+----| - XXXX,XXXX,XXXX,DVOR,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, + XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| XXXX,XXXX,XXXX,COLE,XXXX,XXXX, , ,XXXX,XXXX,XXXX,XXXX,XXXX,XXXX, //`----+----+----+--+-+----+----+----/ \----+----+----+----+----+----+----' @@ -212,6 +161,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; +/* VARIABLES */ +// Configurable Variables for layer toggled light +int layerBLStep = 20; // change how much the brightness changes when holding layer key +int breathPulse = 5; // timing of the breathing +int breathPulseStall = 3; // time to pause at top and bottom of breath cycle +int blSteps = 6; // blSteps + 1 is the amount of brightness settings when manually adjusting + +// Variables needed for layer locked breathing and layer toggling lighting to work +int counter = 0; +bool breathUp = true; +bool resetBL = false; +bool rlocked = false; +bool llocked = false; +bool configOn = false; +int lockedBLLevel; +int momentaryLBLLevel; +int momentaryRBLLevel; +int currentBL; +/* END VARIABLES */ + /* TAP DANCE */ void shift_caps_down (qk_tap_dance_state_t *state, void *user_data) { if (state->count >= 3) { @@ -220,7 +189,6 @@ void shift_caps_down (qk_tap_dance_state_t *state, void *user_data) { register_code (KC_LSFT); } } - void shift_caps_up (qk_tap_dance_state_t *state, void *user_data) { if (state->count >= 3) { unregister_code (KC_CAPS); @@ -228,54 +196,90 @@ void shift_caps_up (qk_tap_dance_state_t *state, void *user_data) { unregister_code (KC_LSFT); } } +void shift_ctrlalt_down (qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 4) { + register_code (KC_LCTL); + register_code (KC_LALT); + } else if (state->count == 3) { + register_code (KC_LALT); + } else if (state->count == 2) { + register_code (KC_LCTL); + } else { + register_code (KC_RSFT); + } +} +void shift_ctlalt_up (qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 4) { + unregister_code (KC_LALT); + unregister_code (KC_LCTL); + } else if (state->count == 3) { + unregister_code (KC_LALT); + } else if (state->count == 2) { + unregister_code (KC_LCTL); + } else { + unregister_code (KC_RSFT); + } +} +void ctrlaltdel_up (qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 3) { + unregister_code (KC_DEL); + unregister_code (KC_LALT); + unregister_code (KC_LCTL); + } else { + } +} +void ctrlaltdel_down (qk_tap_dance_state_t *state, void *user_data) { + if (state->count >= 3) { + register_code (KC_LCTL); + register_code (KC_LALT); + register_code (KC_DEL); + } else { + } +} qk_tap_dance_action_t tap_dance_actions[] = { [TD_LGUIAPP] = ACTION_TAP_DANCE_DOUBLE(KC_LGUI, KC_APP), - [TD_SHIFTCAPS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, shift_caps_down, shift_caps_up) + [TD_SHIFTCAPS] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, shift_caps_down, shift_caps_up), + [TD_SHIFTCLAT] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, shift_ctrlalt_down, shift_ctlalt_up), + [TD_CTRLALTDL] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, ctrlaltdel_down, ctrlaltdel_up) }; - /* END TAP DANCE */ + void persistent_default_layer_set(uint16_t default_layer) { eeconfig_update_default_layer(default_layer); default_layer_set(default_layer); } -/* Variables for layer light toggling */ -static uint16_t currentBL = 0; -static uint16_t rlocked = 0; -static uint16_t llocked = 0; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); + configOn = false; + if (momentaryRBLLevel != 0 || momentaryLBLLevel != 0){ + backlight_toggle(); + } } return false; break; case COLEMAK: if (record->event.pressed) { set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case ONEHANDR: - if (record->event.pressed) { - set_single_persistent_default_layer(_ONEHANDR); - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); + configOn = false; + if (momentaryRBLLevel != 0 || momentaryLBLLevel != 0){ + backlight_toggle(); + } } return false; break; case CONFIG: if (record->event.pressed) { set_single_persistent_default_layer(_CONFIG); - backlight_toggle(); + configOn = true; + if (momentaryRBLLevel != 0 || momentaryLBLLevel != 0){ + backlight_toggle(); + } } return false; break; @@ -283,22 +287,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_RLAYER); update_tri_layer(_RLAYER, _LLAYER, _DUAL); - /* add logic to toggle backlight change when on a layer */ - currentBL = get_backlight_level(); - if ( currentBL == 0 || currentBL == 1 ) { - backlight_set(5); - } else { - backlight_set(0); + momentaryRBLLevel = get_backlight_level(); + if (momentaryRBLLevel != 0 || momentaryLBLLevel != 0){ + for (int i = 0; i < layerBLStep ; i++){ + backlight_increase(); + } } } else { unregister_code(KC_LGUI); - rlocked = 0; layer_off(_RLAYER); update_tri_layer(_RLAYER, _LLAYER, _DUAL); - if ( llocked == 0 ) { - backlight_set(currentBL); + if ( llocked == false && configOn == false ) { + for (int i = 0; i < layerBLStep ; i++){ + backlight_decrease(); + } } else { } + rlocked = false; } return false; break; @@ -306,21 +311,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_LLAYER); update_tri_layer(_RLAYER, _LLAYER, _DUAL); - /* add logic to toggle backlight change when on a layer */ - currentBL = get_backlight_level(); - if ( currentBL == 0 || currentBL == 1 ) { - backlight_set(5); - } else { - backlight_set(0); + momentaryLBLLevel = get_backlight_level(); + if (momentaryRBLLevel != 0 || momentaryLBLLevel != 0){ + for (int i = 0; i < layerBLStep ; i++){ + backlight_increase(); + } } } else { - llocked = 0; layer_off(_LLAYER); update_tri_layer(_RLAYER, _LLAYER, _DUAL); - if ( rlocked == 0 ) { - backlight_set(currentBL); + if ( rlocked == false && configOn == false ) { + for (int i = 0; i < layerBLStep ; i++){ + backlight_decrease(); + } } else { } + llocked = false; } return false; break; @@ -328,13 +334,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_RLAYER); /* add logic to toggle backlight change when on a layer */ - rlocked = 1; - currentBL = get_backlight_level(); - if ( currentBL == 0 || currentBL == 1 ) { - backlight_set(5); - } else { - backlight_set(0); + if (rlocked == false && llocked == false){ + lockedBLLevel = get_backlight_level(); } + rlocked = true; } else { } return false; @@ -343,25 +346,76 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { layer_on(_LLAYER); /* add logic to toggle backlight change when on a layer */ - llocked = 1; - currentBL = get_backlight_level(); - if ( currentBL == 0 || currentBL == 1 ) { - backlight_set(5); - } else { - backlight_set(0); + if (rlocked == false && llocked == false){ + lockedBLLevel = get_backlight_level(); + } + llocked = true; + } else { + } + return false; + break; + case LEDUP: + if (record->event.pressed) { + for (int i = 0; i < (BACKLIGHT_LEVELS / blSteps ) ; i++ ){ + backlight_increase(); } } else { } return false; break; - case ONEHANDL: + case LEDDOWN: if (record->event.pressed) { - layer_on(_ONEHANDL); + for (int i = 0; i < (BACKLIGHT_LEVELS / blSteps ) ; i++ ){ + backlight_decrease(); + } } else { - layer_off(_ONEHANDL); } return false; break; } return true; } + + +// LED breathing when a layer is locked +void matrix_scan_user(void) { + // Only breath if layer is locked + if (lockedBLLevel != 0 && (rlocked || llocked)){ + // counter to slow down the breathing + if (counter >= breathPulse) { + counter = 0; + // iterate brightness up or down + if (breathUp){ + backlight_increase(); + } else { + backlight_decrease(); + } + // figure out if we need to change directions + currentBL = get_backlight_level(); + if (currentBL >= BACKLIGHT_LEVELS){ + breathUp = false; + // make counter a big negative number to add some stall time + counter = ((BACKLIGHT_LEVELS * breathPulseStall) * (-1)); + } else if (currentBL == 0){ + breathUp = true; + // make counter a big negative number to add some stall time + counter = ((BACKLIGHT_LEVELS * breathPulseStall) * (-1)); + } + // make not that we need to change the brightness back to when we started the breathing + resetBL = true; + } else { + counter++; + } + } else { + // get the brightness back to the level it started at + if (resetBL){ + int i = 0; + // i is just there to make sure i don't get stuck in a loop if for some reason get_backlight_level isn't working as expected + while (get_backlight_level() != lockedBLLevel && i <= BACKLIGHT_LEVELS ){ + backlight_step(); + i++; + } + resetBL = false; + } + } +} -- cgit v1.2.3 From 4ffcacd92086870eb7a3102d54178a7af64edb0c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 11:53:50 -0700 Subject: Add Bootmagic Lite to QMK (#4215) * Preliminary additon of bootmagic lite functionality * Cleanup code * Clean up bootmagic code * Add documentation and clean up code * Make 'lite' an option for BOOTMAGIC_ENABLE * Update Templates with note about Bootmagic Lite option * Detect Debounce variable * Make sure debounce is a non-zero number * Capitalize Bootmagic * Capitalize bootmagic * Update wording * Re-add EEPROM reset, by popular demand And add eeprom-less version to drashna userspace for his sanity * Fix spacing * Set BOOTMAGIC_ENABLE to use full/lite/off And default yes to "full" for compatibility * Add Bootmagic lite info to templates * Remove text from makefiles * Cleanup of makefile * mention yes in bootmagic docs * Wordsmitthing the docs * Fix white spaces * Readd default bootmagic setting, because it's necessary --- docs/feature_bootmagic.md | 52 +++++++++++++++++++++++++++++++++++++- quantum/quantum.c | 34 ++++++++++++++++++++++++- quantum/quantum.h | 9 +++++++ quantum/template/avr/config.h | 3 +++ quantum/template/ps2avrgb/config.h | 4 +++ tmk_core/common.mk | 14 +++++++++- users/drashna/drashna.c | 16 ++++++++++++ 7 files changed, 129 insertions(+), 3 deletions(-) diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 586b5d8370..20c76d9b74 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -11,7 +11,15 @@ There are three separate but related features that allow you to change the behav On some keyboards Bootmagic is disabled by default. If this is the case, it must be explicitly enabled in your `rules.mk` with: ```make -BOOTMAGIC_ENABLE = yes +BOOTMAGIC_ENABLE = full +``` + +?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) ideally should be used instead. + +Additionally, you can use [Bootmagic Lite](#bootmagic-lite) (a scaled down, very basic version of Bootmagic) by adding the following to your `rules.mk` file: + +```make +BOOTMAGIC_ENABLE = lite ``` ## Hotkeys @@ -99,3 +107,45 @@ If you would like to change the hotkey assignments for Bootmagic, `#define` thes |`BOOTMAGIC_KEY_DEFAULT_LAYER_5` |`KC_5` |Make layer 5 the default layer | |`BOOTMAGIC_KEY_DEFAULT_LAYER_6` |`KC_6` |Make layer 6 the default layer | |`BOOTMAGIC_KEY_DEFAULT_LAYER_7` |`KC_7` |Make layer 7 the default layer | + +# Bootmagic Lite + +In addition to the full blown Bootmagic feature, is the Bootmagic Lite feature that only handles jumping into the bootloader. This is great for boards that don't have a physical reset button but you need a way to jump into the bootloader, and don't want to deal with the headache that Bootmagic can cause. + +To enable this version of Bootmagic, you need to enable it in your `rules.mk` with: + +```make +BOOTMAGIC_ENABLE = lite +``` + +Additionally, you may want to specify which key to use. This is especially useful for keyboards that have unusual matrices. To do so, you need to specify the row and column of the key that you want to use. Add these entries to your `config.h` file: + +```c +#define BOOTMAGIC_LITE_ROW 0 +#define BOOTMAGIC_LITE_COLUMN 1 +``` + +By default, these are set to 0 and 0, which is usually the "ESC" key on a majority of keyboards. + +And to trigger the bootloader, you hold this key down when plugging the keyboard in. Just the single key. + +## Advanced Bootmagic Lite + +The `bootmagic_lite` function is defined weakly, so that you can replace this in your code, if you need. A great example of this is the Zeal60 boards that have some additional handling needed. + +To replace the function, all you need to do is add something like this to your code: + +```c +void bootmagic_lite(void) { + matrix_scan(); + wait_ms(DEBOUNCING_DELAY * 2); + matrix_scan(); + + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + // Jump to bootloader. + bootloader_jump(); + } +} +``` + +You can additional feature here. For instance, resetting the eeprom or requiring additional keys to be pressed to trigger bootmagic. Keep in mind that `bootmagic_lite` is called before a majority of features are initialized in the firmware. diff --git a/quantum/quantum.c b/quantum/quantum.c index c9bec6740b..5f1a691c88 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -949,8 +949,40 @@ void tap_random_base64(void) { } } +__attribute__((weak)) +void bootmagic_lite(void) { + // The lite version of TMK's bootmagic based on Wilba. + // 100% less potential for accidentally making the + // keyboard do stupid things. + + // We need multiple scans because debouncing can't be turned off. + matrix_scan(); + #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 + wait_ms(DEBOUNCING_DELAY * 2); + #elif defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); + #else + wait_ms(30); + #endif + matrix_scan(); + + // If the Esc and space bar are held down on power up, + // reset the EEPROM valid state and jump to bootloader. + // Assumes Esc is at [0,0]. + // This isn't very generalized, but we need something that doesn't + // rely on user's keymaps in firmware or EEPROM. + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + eeconfig_disable(); + // Jump to bootloader. + bootloader_jump(); + } +} + void matrix_init_quantum() { - if (!eeconfig_is_enabled() && !eeconfig_is_disabled()) { + #ifdef BOOTMAGIC_LITE + bootmagic_lite(); + #endif + if (!eeconfig_is_enabled()) { eeconfig_init(); } #ifdef BACKLIGHT_ENABLE diff --git a/quantum/quantum.h b/quantum/quantum.h index 87a61356c7..1d3ee033fd 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -224,6 +224,15 @@ bool process_action_kb(keyrecord_t *record); bool process_record_kb(uint16_t keycode, keyrecord_t *record); bool process_record_user(uint16_t keycode, keyrecord_t *record); +#ifndef BOOTMAGIC_LITE_COLUMN + #define BOOTMAGIC_LITE_COLUMN 0 +#endif +#ifndef BOOTMAGIC_LITE_ROW + #define BOOTMAGIC_LITE_ROW 0 +#endif + +void bootmagic_lite(void); + void reset_keyboard(void); void startup_user(void); diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index caa72af0c2..56395f376f 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -222,3 +222,6 @@ along with this program. If not, see . #endif */ +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/quantum/template/ps2avrgb/config.h b/quantum/template/ps2avrgb/config.h index d2c83781fa..4ff3513bc7 100644 --- a/quantum/template/ps2avrgb/config.h +++ b/quantum/template/ps2avrgb/config.h @@ -44,3 +44,7 @@ along with this program. If not, see . /* key combination for command */ #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 33bcc97b2e..3844b13d48 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -61,14 +61,26 @@ endif # Option modules -ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) +BOOTMAGIC_ENABLE ?= no +VALID_MAGIC_TYPES := yes full lite +ifneq ($(strip $(BOOTMAGIC_ENABLE)), no) + ifeq ($(filter $(BOOTMAGIC_ENABLE),$(VALID_MAGIC_TYPES)),) + $(error BOOTMAGIC_ENABLE="$(BOOTMAGIC_ENABLE)" is not a valid type of magic) + endif + ifeq ($(strip $(BOOTMAGIC_ENABLE)), lite) + TMK_COMMON_DEFS += -DBOOTMAGIC_LITE + TMK_COMMON_DEFS += -DMAGIC_ENABLE + TMK_COMMON_SRC += $(COMMON_DIR)/magic.c + else TMK_COMMON_DEFS += -DBOOTMAGIC_ENABLE TMK_COMMON_SRC += $(COMMON_DIR)/bootmagic.c + endif else TMK_COMMON_DEFS += -DMAGIC_ENABLE TMK_COMMON_SRC += $(COMMON_DIR)/magic.c endif + ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 5b6620cf33..7c280e2ddd 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -424,3 +424,19 @@ void eeconfig_init_user(void) { userspace_config.raw = 0; eeconfig_update_user(userspace_config.raw); } + +void bootmagic_lite(void) { + matrix_scan(); + #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 + wait_ms(DEBOUNCING_DELAY * 2); + #elif defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); + #else + wait_ms(30); + #endif + matrix_scan(); + + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + bootloader_jump(); + } +} -- cgit v1.2.3 From 2abb29402a85675617d07111cbdf5502fd384572 Mon Sep 17 00:00:00 2001 From: Guido Bartolucci Date: Sun, 28 Oct 2018 11:29:37 -0400 Subject: Keymap: Updates to guidoism layout (#4262) * Initial commit of guidoism * created movement layer * movement layer works! * removed unnecessary layers * moved enter key up and recreated caps lock * cleaned up * num pad * checkpoint * checkpoint * checkpoint * Added num pad * changed max power draw so i can use this on ipad * move around quotes * added tri layer for a homed numpad * moved layout to new style * Update readme.md * Update readme.md * Update readme.md * Update readme.md * added keys to unicode conversion * removed adjust layer since its not used anymore * moved esc to seperate key * tweaked python * checkpoint * new code put into function * new code put into function * cleanup * cleanup * new code works perfect * removed old code * removed old code * generate_c.py now replaces code within keymap.c * added function layer * updated readme * updated readme * updated readme * updates readme * updates readme * updates readme * Tweaks based on CR * Remove old guidoism * Use MO(_FUNCTION) directly --- keyboards/planck/keymaps/guidoism/config.h | 42 ---- keyboards/planck/keymaps/guidoism/keymap.c | 253 --------------------- keyboards/planck/keymaps/guidoism/readme.md | 2 - keyboards/planck/keymaps/guidoism/rules.mk | 0 layouts/community/ortho_4x12/guidoism/config.h | 22 +- .../community/ortho_4x12/guidoism/generate_c.py | 104 +++++---- .../community/ortho_4x12/guidoism/guidoism.json | 2 +- layouts/community/ortho_4x12/guidoism/keymap.c | 149 +++++++++--- layouts/community/ortho_4x12/guidoism/keys.json | 29 +-- layouts/community/ortho_4x12/guidoism/readme.md | 63 +++-- 10 files changed, 242 insertions(+), 424 deletions(-) delete mode 100644 keyboards/planck/keymaps/guidoism/config.h delete mode 100644 keyboards/planck/keymaps/guidoism/keymap.c delete mode 100644 keyboards/planck/keymaps/guidoism/readme.md delete mode 100644 keyboards/planck/keymaps/guidoism/rules.mk diff --git a/keyboards/planck/keymaps/guidoism/config.h b/keyboards/planck/keymaps/guidoism/config.h deleted file mode 100644 index a1635f2bab..0000000000 --- a/keyboards/planck/keymaps/guidoism/config.h +++ /dev/null @@ -1,42 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -#ifdef AUDIO_ENABLE - #define STARTUP_SONG SONG(PLANCK_SOUND) - // #define STARTUP_SONG SONG(NO_SOUND) - - #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ - SONG(COLEMAK_SOUND), \ - SONG(DVORAK_SOUND) \ - } -#endif - -#define MUSIC_MASK (keycode != KC_NO) - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ - -#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif \ No newline at end of file diff --git a/keyboards/planck/keymaps/guidoism/keymap.c b/keyboards/planck/keymaps/guidoism/keymap.c deleted file mode 100644 index d644ac9709..0000000000 --- a/keyboards/planck/keymaps/guidoism/keymap.c +++ /dev/null @@ -1,253 +0,0 @@ -/* Copyright 2015-2017 Jack Humbert - * - * 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 message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" - -extern keymap_config_t keymap_config; - -enum planck_layers { - _QWERTY, - _LOWER, - _RAISE, - _MOVEMENT, - _NUMPAD, - _CODE, - _ADJUST -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - MOVEMENT, - NUMPAD, - CODE, - BACKLIT -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | S | D | F | G | H | J | K | L | ; | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Move |Numpad| Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - // {KC_ESC, LT(MOVEMENT, KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, - // {KC_ESC, MEH_T(KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, - {KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT}, - {LSFT_T(KC_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT}, - {MOVEMENT, NUMPAD, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LPRN, KC_RPRN, KC_LCBR, KC_RCBR} -}, - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' - */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, - -/* Movement - * ,-----------------------------------------------------------------------------------. - * | | | | | | | Home | PgUp | Up | PgDn | End | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | Left | Down | Right| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_MOVEMENT] = { - {_______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_UP, KC_PGDN, KC_END, _______}, - {_______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -/* Numpad - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | 7 | 8 | 9 | / | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | 4 | 5 | 6 | * | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | 1 | 2 | 3 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | 0 | = | + | - * `-----------------------------------------------------------------------------------' -[_NUMPAD] = { - {_______, _______, _______, _______, _______, _______, _______, _______, KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_SLASH}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_ASTERISK}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_MINUS}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_KP_EQUAL, KC_KP_PLUS} -}, - */ - -/* Numpad - */ -[_NUMPAD] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_7, KC_KP_8, KC_KP_9}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_4, KC_KP_5, KC_KP_6}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_1, KC_KP_2, KC_KP_3}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_KP_0, KC_DOT} -}, - -/* Code - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_CODE] = { - {_______, _______, _______, _______, _______, _______, _______, KC_LCBR, KC_RCBR, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, KC_LPRN, KC_RPRN, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = { - {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, } - -} - -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case MOVEMENT: - if (record->event.pressed) { - layer_on(_MOVEMENT); - } else { - layer_off(_MOVEMENT); - } - return false; - break; - case NUMPAD: - if (record->event.pressed) { - layer_on(_NUMPAD); - } else { - layer_off(_NUMPAD); - } - return false; - break; - case CODE: - if (record->event.pressed) { - layer_on(_CODE); - } else { - layer_off(_CODE); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - PORTE &= ~(1<<6); - } else { - unregister_code(KC_RSFT); - PORTE |= (1<<6); - } - return false; - break; - } - return true; -} diff --git a/keyboards/planck/keymaps/guidoism/readme.md b/keyboards/planck/keymaps/guidoism/readme.md deleted file mode 100644 index de9680b498..0000000000 --- a/keyboards/planck/keymaps/guidoism/readme.md +++ /dev/null @@ -1,2 +0,0 @@ -# The Default Planck Layout - diff --git a/keyboards/planck/keymaps/guidoism/rules.mk b/keyboards/planck/keymaps/guidoism/rules.mk deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/layouts/community/ortho_4x12/guidoism/config.h b/layouts/community/ortho_4x12/guidoism/config.h index 19b71b07ee..e22f298035 100644 --- a/layouts/community/ortho_4x12/guidoism/config.h +++ b/layouts/community/ortho_4x12/guidoism/config.h @@ -18,27 +18,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once #define IGNORE_MOD_TAP_INTERRUPT #define USB_MAX_POWER_CONSUMPTION 50 - -#ifndef LAYOUT_planck_mit -#define LAYOUT_planck_mit( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k37, k38, k39, k3a, k3b \ -) \ - LAYOUT_ortho_4x12( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k35, k37, k38, k39, k3a, k3b \ - ) -#endif - -#endif diff --git a/layouts/community/ortho_4x12/guidoism/generate_c.py b/layouts/community/ortho_4x12/guidoism/generate_c.py index 7876bee68b..5bee576084 100644 --- a/layouts/community/ortho_4x12/guidoism/generate_c.py +++ b/layouts/community/ortho_4x12/guidoism/generate_c.py @@ -1,38 +1,29 @@ import itertools import json -from pprint import pprint as pp +import os.path +import re -layers = dict(enumerate(['_QWERTY', '_LOWER', '_RAISE', '_MOVEMENT', '_NUMPAD'])) -key_names = {('MO(%d)' % i): layers.get(i).strip('_') for i in layers.keys()} +KEYMAP_C = """/* {0} +{1} +*/ +[{2}] = {3}( + {4}) +""" -unicodes = { - "": "next", - "": "vol-", - "": "vol+", - "": "play", -} +README_MD = """## {0} +``` +{1} +``` +""" -d = json.load(open('layouts/community/ortho_4x12/guidoism/guidoism.json')) +base = os.path.dirname(__file__) -def grouper(iterable, n): - args = [iter(iterable)] * n - return itertools.zip_longest(*args, fillvalue='') +layer_names = dict(enumerate(['_QWERTY', '_LOWER', '_RAISE', '_MOVEMENT', '_NUMPAD', '_FUNCTION'])) +layer_name = {('MO(%d)' % i): layer_names.get(i).strip('_') for i in layer_names.keys()} -def truthy(s): - return [a for a in s if a] +keys = json.load(open(os.path.join(base, 'keys.json'))) -def just(s, n): - return [a.center(n*2+1 if len(s) == 11 and i == 5 else n) for i, a in enumerate(s)] - -def replace(s): - return [key_names.get(a, a) for a in s] - -def layer(i, l): - n = max(len(s) for s in l) - rows = [', '.join(replace(truthy(row))) for row in grouper(l, 12)] - return '[%s] = %s(\n%s)' % (layers[i], d['layout'], ',\n'.join(rows)) - -print(',\n\n'.join(layer(i, l) for i, l in enumerate(d['layers']))) +d = json.load(open(os.path.join(base, 'guidoism.json'))) def surround(s, a, b, c): return a + b.join(s) + c @@ -40,20 +31,45 @@ def surround(s, a, b, c): def pattern(cell, table): return ['─'*cell for i in range(table)] -keys = json.load(open('layouts/community/ortho_4x12/guidoism/keys.json')) - -def layer2(i, l): - def replace(s): - s = [keys.get(a, a) for a in s] - return [unicodes.get(a, a) for a in s] - n = max(len(s) for s in l) - return [surround(just(replace(truthy(row)), 5), '│', '│', '│') for row in grouper(l, 12)] - -for i, l in enumerate(d['layers']): - print(surround(pattern(5, 12), '┌', '┬', '┐')) - for n, row in enumerate(layer2(i, l)): - print(row) - if n < 3: - print(surround(pattern(5, 12), '├', '┼', '┤')) - else: - print(surround(pattern(5, 12), '└', '┴', '┘')) +top = surround(pattern(5, 12), '┌', '┬', '┐') +mid = surround(pattern(5, 12), '├', '┼', '┤') +bottom = surround(pattern(5, 12), '└', '┴', '┘') + +from more_itertools import chunked, intersperse, interleave_longest + +def uni(k): + return keys.get(k, k).lower().center(5) + +def c_layout(i, definition, template): + c_name = layer_names[i] + pretty_name = c_name.strip('_').capitalize() + layout = d['layout'] + + surround = lambda s: ''.join(interleave_longest(['│']*(len(s)+1), s)) + layer = list(map(uni, definition)) + layer[41] = layer[41].center(11) + layer = chunked(layer, 12) + rows = intersperse(mid, map(surround, layer)) + pretty = '\n'.join(itertools.chain([top], rows, [bottom])) + + surround = lambda s: ', '.join(s) + layer = list(map(lambda k: layer_name.get(k, k), definition)) + layer = chunked(layer, 12) + rows = map(surround, layer) + c_layer = ',\n '.join(itertools.chain([], rows, [])) + + return template.format(pretty_name, pretty, c_name, layout, c_layer) + +start = '// START_REPLACEMENT\n' +end = '// END_REPLACEMENT\n' +replacement = start + ',\n\n'.join(c_layout(i, l, KEYMAP_C) for i, l in enumerate(d['layers'])) + end +keymap = os.path.join(base, 'keymap.c') +existing = open(keymap).read() +r = re.compile(r'// START_REPLACEMENT.*// END_REPLACEMENT', re.DOTALL) +open(keymap, 'w').write(r.sub(replacement, existing)) + +replacement = '## Current Configuration\n\n' + '\n\n'.join(c_layout(i, l, README_MD) for i, l in enumerate(d['layers'])) +keymap = os.path.join(base, 'readme.md') +existing = open(keymap).read() +r = re.compile(r'## Current Configuration.*', re.DOTALL) +open(keymap, 'w').write(r.sub(replacement, existing)) diff --git a/layouts/community/ortho_4x12/guidoism/guidoism.json b/layouts/community/ortho_4x12/guidoism/guidoism.json index fd287cf60e..6a4364c6be 100644 --- a/layouts/community/ortho_4x12/guidoism/guidoism.json +++ b/layouts/community/ortho_4x12/guidoism/guidoism.json @@ -1 +1 @@ -{"keyboard":"planck/rev4","keymap":"guidoism","layout":"LAYOUT_planck_mit","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","LCTL_T(KC_ESC)","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_COLN","KC_ENT","LSFT_T(KC_CAPS)","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_NO","MO(3)","KC_NO","KC_LALT","KC_LGUI","MO(1)","LSFT_T(KC_SPC)","MO(2)","KC_RGUI","KC_RALT","KC_SCLN","KC_NO"],["KC_TILD","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_NO","KC_NO","KC_UNDO","KC_TRNS","KC_NO","KC_CUT","KC_COPY","KC_PSTE","KC_NO","KC_NO","KC_UNDS","KC_PLUS","KC_DQUO","KC_QUOT","KC_PIPE","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MNXT","KC_VOLD","KC_VOLU","KC_MPLY"],["KC_GRV","KC_P1","KC_P2","KC_P3","KC_P4","KC_P5","KC_P6","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_LBRC","KC_RBRC","KC_LPRN","KC_RPRN","KC_NO","KC_NO","KC_PMNS","KC_PEQL","KC_NO","KC_NO","KC_BSLS","KC_TRNS","KC_LT","KC_GT","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["RESET","DEBUG","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_UP","KC_PGDN","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_HOME","KC_NO","KC_END","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P7","KC_P8","KC_P9","KC_PSLS","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P4","KC_P5","KC_P6","KC_PAST","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P1","KC_P2","KC_P3","KC_PMNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_PCMM","KC_P0","KC_PDOT","KC_PPLS","KC_TRNS"]]} +{"keyboard":"planck/rev4","keymap":"guidoism","layout":"LAYOUT_planck_mit","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_COLN","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_NO","MO(3)","KC_ESC","KC_LALT","KC_LGUI","MO(1)","LSFT_T(KC_SPC)","MO(2)","KC_RGUI","KC_RALT","KC_SCLN","MO(5)"],["KC_TILD","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_NO","KC_NO","KC_UNDO","KC_TRNS","KC_NO","KC_CUT","KC_COPY","KC_PSTE","KC_NO","KC_NO","KC_UNDS","KC_PLUS","KC_DQUO","KC_QUOT","KC_PIPE","KC_CAPS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MNXT","KC_VOLD","KC_VOLU","KC_MPLY"],["KC_GRV","KC_P1","KC_P2","KC_P3","KC_P4","KC_P5","KC_P6","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_LBRC","KC_RBRC","KC_LPRN","KC_RPRN","KC_NO","KC_NO","KC_PMNS","KC_PEQL","KC_NO","KC_NO","KC_BSLS","KC_TRNS","KC_LT","KC_GT","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["RESET","DEBUG","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_UP","KC_PGDN","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_HOME","KC_NO","KC_END","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PERC","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_DLR","KC_P4","KC_P5","KC_P6","KC_PDOT","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P0","KC_P1","KC_P2","KC_P3","KC_PCMM","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_NO","KC_P0","KC_NO","KC_NO","KC_TRNS"],["KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","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","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_TRNS"]]} \ No newline at end of file diff --git a/layouts/community/ortho_4x12/guidoism/keymap.c b/layouts/community/ortho_4x12/guidoism/keymap.c index 093fe140b0..2027e2bfa4 100644 --- a/layouts/community/ortho_4x12/guidoism/keymap.c +++ b/layouts/community/ortho_4x12/guidoism/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" extern keymap_config_t keymap_config; @@ -10,6 +8,7 @@ enum planck_layers { _RAISE, _MOVEMENT, _NUMPAD, + _FUNCTION, }; enum planck_keycodes { @@ -20,37 +19,125 @@ enum planck_keycodes { NUMPAD, }; +#define FUNCTION MO(_FUNCTION) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_planck_mit( -KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, -LCTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_ENT, -LSFT_T(KC_CAPS), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, -MOVEMENT, KC_NO, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPC), RAISE, KC_RGUI, KC_RALT, KC_SCLN, KC_NO), - - [_LOWER] = LAYOUT_planck_mit( -KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_UNDO, -KC_TRNS, KC_NO, KC_CUT, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_DQUO, KC_QUOT, KC_PIPE, -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY), - - [_RAISE] = LAYOUT_planck_mit( -KC_GRV, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, -KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_PMNS, KC_PEQL, KC_NO, KC_NO, KC_BSLS, -KC_TRNS, KC_LT, KC_GT, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - [_MOVEMENT] = LAYOUT_planck_mit( -RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_TRNS, -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS, -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), - - [_NUMPAD] = LAYOUT_planck_mit( -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P7, KC_P8, KC_P9, KC_PSLS, KC_TRNS, -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PAST, KC_TRNS, -KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P1, KC_P2, KC_P3, KC_PMNS, KC_TRNS, -KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PCMM, KC_P0, KC_PDOT, KC_PPLS, KC_TRNS) +// START_REPLACEMENT +/* Qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_QWERTY] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, + MOVEMENT, KC_ESC, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPC), RAISE, KC_RGUI, KC_RALT, KC_SCLN, FUNCTION) +, + +/* Lower +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ caps│ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_LOWER] = LAYOUT_planck_mit( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_UNDO, + KC_TRNS, KC_NO, KC_CUT, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_DQUO, KC_QUOT, KC_PIPE, + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY) +, + +/* Raise +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_RAISE] = LAYOUT_planck_mit( + KC_GRV, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, + KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_PMNS, KC_PEQL, KC_NO, KC_NO, KC_BSLS, + KC_TRNS, KC_LT, KC_GT, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +, + +/* Movement +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ home│ │ end │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_MOVEMENT] = LAYOUT_planck_mit( + RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +, + +/* Numpad +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ 0 │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_NUMPAD] = LAYOUT_planck_mit( + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PERC, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DLR, KC_P4, KC_P5, KC_P6, KC_PDOT, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_P0, KC_NO, KC_NO, KC_TRNS) +, + +/* Function +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_FUNCTION] = LAYOUT_planck_mit( + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, 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, 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_TRNS) +// END_REPLACEMENT + + + + + + + }; diff --git a/layouts/community/ortho_4x12/guidoism/keys.json b/layouts/community/ortho_4x12/guidoism/keys.json index 762deb7062..791119b4f2 100644 --- a/layouts/community/ortho_4x12/guidoism/keys.json +++ b/layouts/community/ortho_4x12/guidoism/keys.json @@ -102,8 +102,8 @@ "KC_SLASH": "/", "KC_NUBS": "/", "KC_NUHS": "#", - "KC_CAPSLOCK": "Caps Lock", - "KC_CAPS": "Caps Lock", + "KC_CAPSLOCK": "Caps", + "KC_CAPS": "Caps", "KC_LCTRL": "Ctrl", "KC_LCTL": "Ctrl", "KC_LSHIFT": "\u21e7", @@ -181,26 +181,26 @@ "KC_WAKE": "System Wake", "KC_STOP": "Stop", "KC__MUTE": "Mute (macOS)", - "KC__VOLUP": "", - "KC__VOLDOWN": "", + "KC__VOLUP": "vol+", + "KC__VOLDOWN": "vol-", "KC_AUDIO_MUTE": "Mute", "KC_MUTE": "Mute", - "KC_AUDIO_VOL_UP": "", - "KC_VOLU": "", - "KC_AUDIO_VOL_DOWN": "", - "KC_VOLD": "", - "KC_MEDIA_NEXT_TRACK": "", - "KC_MNXT": "", + "KC_AUDIO_VOL_UP": "vol+", + "KC_VOLU": "vol+", + "KC_AUDIO_VOL_DOWN": "vol-", + "KC_VOLD": "vol-", + "KC_MEDIA_NEXT_TRACK": "next", + "KC_MNXT": "next", "KC_MEDIA_PREV_TRACK": "Previous Track (Windows)", "KC_MPRV": "Previous Track (Windows)", - "KC_MEDIA_FAST_FORWARD": "", - "KC_MFFD": "", + "KC_MEDIA_FAST_FORWARD": "next", + "KC_MFFD": "next", "KC_MEDIA_REWIND": "Previous Track (macOS)", "KC_MRWD": "Previous Track (macOS)", "KC_MEDIA_STOP": "Stop Track", "KC_MSTP": "Stop Track", - "KC_MEDIA_PLAY_PAUSE": "", - "KC_MPLY": "", + "KC_MEDIA_PLAY_PAUSE": "play", + "KC_MPLY": "play", "KC_NUMLOCK": "Keypad Num Lock and Clear", "KC_NLCK": "Keypad Num Lock and Clear", "KC_SLSH": "/", @@ -295,6 +295,7 @@ "MO(3)": "mov", "MO(1)": "lower", "MO(2)": "raise", + "MO(5)": "fn", "LSFT_T(KC_SPC)": "sp/sh", "KC_TRNS": "", "KC_PSTE": "Paste", diff --git a/layouts/community/ortho_4x12/guidoism/readme.md b/layouts/community/ortho_4x12/guidoism/readme.md index 7137ffd141..540db64e85 100644 --- a/layouts/community/ortho_4x12/guidoism/readme.md +++ b/layouts/community/ortho_4x12/guidoism/readme.md @@ -1,37 +1,56 @@ # Guido's Planck Keyboard Layout +I've written a script to convert the json file from the +[QMK Configurator](https://config.qmk.fm) to the C macros +and a pretty form the comments. + +First import the json file in this directory into the configurator, +make any changes, export the file and then run this: + + mv ~/Downloads/guidoism.json layouts/community/ortho_4x12/guidoism/ && python3 layouts/community/ortho_4x12/guidoism/generate_c.py && make planck:guidoism:dfu + +TODO: Move running of generate_c.py to makefile so I just need to run `make planck:guidoism:dfu` + +Note that the pretty forms of the keys are defined in another json +file and are made for my specific board. You made need to update this +file to get the pretty forms to look right. + * Left palm to the `mov` key gets you the `Move` layer * Right thumb on the `raise` key gets you the various programming brackets and parens on your left hand * Left palm on `mov` key and left thumb on `lower` key gets you a numpad on your right hand * Shift with the spacebar * Left pinky is control on hold and escape on tap -* Left shift is caps lock on double-tap +## Current Configuration + +## Qwerty ``` ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ │ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ c/e │ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ +│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ mov │ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ │ +│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ``` + ## Lower ``` ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ Undo│ +│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ Cut │ Copy│Paste│ │ │ _ │ + │ " │ ' │ | │ +│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ +│ caps│ │ │ │ │ │ │ │ │ │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ``` + ## Raise ``` ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ @@ -45,32 +64,44 @@ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ``` -## Move + +## Movement ``` ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│RESET│DEBUG│ │ │ │ │ │ PgUp│ ↑ │ PgDn│ │ │ +│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ Home│ │ End │ │ │ +│ │ │ │ │ │ │ │ home│ │ end │ │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ │ │ │ │ │ │ │ │ │ │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ``` + ## Numpad ``` ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ │ │ │ │ │ │ 7 │ 8 │ 9 │ / │ │ +│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 4 │ 5 │ 6 │ * │ │ +│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 1 │ 2 │ 3 │ - │ │ +│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ , │ 0 │ . │ + │ │ +│ │ │ │ │ │ │ │ 0 │ │ │ │ └─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ ``` -Use the [QMK Configurator](https://config.qmk.fm/#/planck/rev4/LAYOUT_planck_mit) -to edit the guidoism.json file. Then update it and run `python3 layouts/community/ortho_4x12/guidoism/generate_c.py` -to get the update C structs and Markdown for this file. + +## Function +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` -- cgit v1.2.3 From 3d15038dd40721a992606705cdac5c5e381f5bba Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Oct 2018 07:30:12 -0700 Subject: Make RGB init write to eeprom once --- users/drashna/rgb_stuff.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index dc6075320e..9ad94c0c3d 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -273,7 +273,7 @@ void matrix_init_rgb(void) { default: rgblight_sethsv_noeeprom_cyan(); break; } - rgblight_mode_noeeprom(1); + rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); } } -- cgit v1.2.3 From 2776b9ee90d84b8a6c97e3e9395a8a87f499c5a9 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Oct 2018 08:22:37 -0700 Subject: Update readme for userspace --- users/drashna/readme.md | 97 ++++++++++++++++--------------------------------- 1 file changed, 31 insertions(+), 66 deletions(-) diff --git a/users/drashna/readme.md b/users/drashna/readme.md index 179960322a..ffc60060f4 100644 --- a/users/drashna/readme.md +++ b/users/drashna/readme.md @@ -1,11 +1,8 @@ -Overview -======== +# Overview -This is my personal userspace file. Most of my code exists here, as it's heavily shared. +This is my personal userspace file. Most of my code exists here, as it's heavily shared. - -Custom userspace handlers -------------------------- +## Custom userspace handlers Specifically QMK works by using customized handlers for everything. This allows for multiple levels of customization. @@ -15,29 +12,26 @@ The same goes for `matrix_init`, `layer_state_set`, `led_set`, and a few other f All (most) `_user` functions are handled here instead. To allow keyboard specific configuration, I've created `_keymap` functions that can be called by the keymap.c files instead. -This allows for keyboard specific configuration while maintaining the ability to customize the board. - -My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/keyboards/ergodox_ez/keymaps/drashna/keymap.c#L399) is a good example of this, as it uses the LEDs as modifier indicators. +This allows for keyboard specific configuration while maintaining the ability to customize the board. +My [Ergodox EZ Keymap](https://github.com/qmk/qmk_firmware/blob/master/layouts/community/ergodox/drashna/keymap.c#L297) is a good example of this, as it uses the LEDs as modifier indicators. -Keyboard Layout Templates -------------------------- +## Keyboard Layout Templates -This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. +This borrows from @jola5's "Not quite neo" code. This allows me to maintain blocks of keymaps in the userspace, so that I can modify the userspace, and this is reflected in all of the keyboards that use it, at once. This makes adding tap/hold mods, or other special keycodes or functions to all keyboards super easy, as it's done to all of them at once. -The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: +The caveat here is that the keymap needs a processor/wrapper, as it doesn't like the substitutions. However, this is as simple as just pushing it through a define. For instance: `#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__)` -Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. +Once that's been done and you've switched the keymaps to use the "wrapper", it will read the substitution blocks just fine. Credit goes to @jola5 for first implementing this awesome idea. -Custom Keycodes ---------------- +## Custom Keycodes Keycodes are defined in the drashna.h file and need to be included in the keymap.c files, so that they can be used there. @@ -45,10 +39,9 @@ A bunch of macros are present and are only included on boards that are not the E Included is a custom macro for compiling my keyboards. This includes the bootloader target (`:teensy`, `:avrdude`, or `:dfu`), and keeps RGBLIGHT, AUDIO and/or FAUXCLICKY enabled, if it previously was (regardless of the rules file). -This also includes a modified RESET keycode as well, that sets the underglow to red. +This also includes a modified RESET keycode as well, that sets the underglow to red. -Layer Indication ----------------- +## Layer Indication This uses the `layer_state_set_*` command to change the layer color, to indicate which layer it is on. This includes the default keymap, as well. @@ -58,9 +51,7 @@ Additionally, there is a custom keycode to toggle layer indication. And all RGB Also. I use `rgblight_sethsv` since it works with animation modes (that support it). - -Diablo Layer ------------- +## Diablo Layer This layer has some special handling. @@ -72,8 +63,7 @@ Tappind once disables this, and switching layers temporarily disables this, unti For critics that think this is cheating, search "diablo 3 num lock auto cast". This is just a simpler method, since I no longer own a normal (non QMK) numpad. -Secret Macros -------------- +## Secret Macros With help from gitter and Colinta, this adds the ability to add hidden macros from other users. @@ -82,7 +72,8 @@ First, I have several files that are hidden/excluded from Git/GitHub. These con And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.h` file to define the keycodes for the new macros. -###### .git/info/exclude +### .git/info/exclude + ``` # git ls-files --others --exclude-from=.git/info/exclude # Lines that start with '#' are comments. @@ -96,7 +87,7 @@ And this requires `KC_SECRET_1` through `KC_SECRET_5` to be defined in your `.c` file, you will want to add this to the top: +In the `.c` file, you will want to add this to the top: ```c __attribute__ ((weak)) @@ -152,64 +144,37 @@ bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } ``` -This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. +This is so that the function can be called here, and replaced in the `secrets.c` file, and so it won't error out if it doesn't exist. And then, in the `process_record_user` function, assuming you have `return process_record_keymap(keycode, record)` here, you'll want to replace the "final" return with the following. Otherwise, you want to replace the `return true;` with `return process_record_secrets(keycode, record);` + ```c return process_record_keymap(keycode, record) && process_record_secrets(keycode, record); } ``` -###### rules.mk +### rules.mk -Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. To do so, add this block: -```c +Here, you want your `/users//rules.mk` file to "detect" the existence of the `secrets.c` file, and only add it if the file exists. To do so, add this block: + +```make ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") SRC += secrets.c endif ``` Additionally, if you want to make sure that you can disable the function without messing with the file, you need to add this to your `/users//rules.mk`, so that it catches the flag: -```c + +```make ifeq ($(strip $(NO_SECRETS)), yes) OPT_DEFS += -DNO_SECRETS endif ``` -Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your `.c` file, rather than reading from your file. - - -Userspace EEPROM config ------------------------ - -This adds EEPROM support fo the userspace, so that certain values are configurable in such a way that persists when power is lost. Namely, just the clicky feature and the Overwatch macro option ("is_overwatch"). This is done by reading and saving the structure from EEPROM. - -To implement this, first you need to specify the location: - -```c -#define EECONFIG_USERSPACE (uint8_t *)20 -``` -This tells us where in the EEPROM that the data structure is located, and this specifies that it's a byte (8 bits). However, to maximize it's usage, we want to specify a data structure here, so that we can use multiple settings. To do that: - -```c -typedef union { - uint8_t raw; - struct { - bool clicky_enable :1; - bool is_overwatch :1; - }; -} userspace_config_t; -``` -Then, in your C file, you want to add: `userspace_config_t userspace_config;`, and in your `matrix_init_*` function, you want to add `userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE);` - -From there, you'd want to use the data structure (such as `userspace_config.is_overwatch`) when you want to check this value. - -And if you want to update it, update directly and then use `eeprom_update_byte(EECONFIG_USERSPACE, userspace_config.raw);` to write the value back to the EEPROM. - +Then, if you run `make keyboard:name NO_SECRETS=yes`, it will default to the test strings in your `.c` file, rather than reading from your file. -Pro Micro Hacking ------------------ +## Pro Micro Hacking Well, you can get the QMK DFU bootloader working on the ProMicro. But you need to change fuses. -- cgit v1.2.3 From 76b5ac621d3f5f5e809de2bc9479d54b99a2f89f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 16 Oct 2018 20:33:55 -0700 Subject: Update to Corne Keyboard (crkbd) keymap --- keyboards/crkbd/keymaps/drashna/keymap.c | 63 +++++++++++++++++++------------- keyboards/crkbd/keymaps/drashna/rules.mk | 2 +- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index a293d53374..49db492c4e 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -113,12 +113,47 @@ const char *read_logo(void); void set_keylog(uint16_t keycode, keyrecord_t *record); const char *read_keylog(void); const char *read_keylogs(void); - +char layer_state_str[24]; // const char *read_mode_icon(bool swap); -// const char *read_host_led_state(void); +const char *read_host_led_state(void); // void set_timelog(void); // const char *read_timelog(void); + +const char* read_layer_state(void) { + switch (layer_state) { + case _QWERTY: + switch (default_layer_state) { + case _QWERTY: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY"); + break; + case _COLEMAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); + break; + case _DVORAK: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); + break; + case _WORKMAN: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); + break; + } + break; + case _RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); + break; + case _LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); + break; + case _ADJUST: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); + break; + default: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); + } + + return layer_state_str; +} + void matrix_scan_keymap(void) { iota_gfx_task(); } @@ -130,7 +165,7 @@ void matrix_render_user(struct CharacterMatrix *matrix) { matrix_write_ln(matrix, read_keylog()); matrix_write_ln(matrix, read_keylogs()); //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - //matrix_write_ln(matrix, read_host_led_state()); + matrix_write_ln(matrix, read_host_led_state()); //matrix_write_ln(matrix, read_timelog()); } else { matrix_write(matrix, read_logo()); @@ -156,28 +191,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { set_keylog(keycode, record); // set_timelog(); } - - switch (keycode) { - case RGB_MOD: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - rgblight_mode_noeeprom(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - #endif - return false; - break; - case RGBRST: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - #endif - break; - } return true; } diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index 8f69cba72f..a4e1deba86 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -26,6 +26,6 @@ SRC += ./lib/glcdfont.c \ ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ + ./lib/host_led_state_reader.c \ # ./lib/mode_icon_reader.c \ - # ./lib/host_led_state_reader.c \ # ./lib/timelogger.c \ -- cgit v1.2.3 From 6ed925103fcc80add200760b5e725f100b3597ab Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 23 Oct 2018 09:00:41 -0700 Subject: Change user EEPROM defaults --- users/drashna/drashna.c | 1 + 1 file changed, 1 insertion(+) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 7c280e2ddd..cd7afe7687 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -422,6 +422,7 @@ void led_set_user(uint8_t usb_led) { void eeconfig_init_user(void) { userspace_config.raw = 0; + userspace_config.rgb_layer_change = true; eeconfig_update_user(userspace_config.raw); } -- cgit v1.2.3 From 796bce5ab23108558e3eb06d485d3468b89e80f6 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 24 Oct 2018 08:22:36 -0700 Subject: Cleanup KC_MAKE command --- users/drashna/drashna.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index cd7afe7687..5329d36e2e 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -254,17 +254,15 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { clear_mods(); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); if (temp_mod & MODS_SHIFT_MASK) { - send_string_with_delay_P(PSTR( -#if defined(__ARM__) - ":dfu-util" -#elif defined(BOOTLOADER_DFU) - ":dfu" -#elif defined(BOOTLOADER_HALFKAY) - ":teensy" -#elif defined(BOOTLOADER_CATERINA) - ":avrdude" -#endif // bootloader options - ), 10); + #if defined(__ARM__) + send_string_with_delay_P(PSTR(":dfu-util"), 10); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), 10); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), 10); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), 10); + #endif // bootloader options } if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); -- cgit v1.2.3 From 4df74f6058043cf37d997e8e93fc3526b29a13b3 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 24 Oct 2018 13:45:39 -0700 Subject: Minor updates to keymaps --- keyboards/crkbd/keymaps/drashna/keymap.c | 4 ++-- keyboards/crkbd/keymaps/drashna/rules.mk | 4 ++-- keyboards/iris/keymaps/drashna/keymap.c | 3 +-- keyboards/orthodox/keymaps/drashna/keymap.c | 2 +- layouts/community/ergodox/drashna/keymap.c | 3 +-- 5 files changed, 7 insertions(+), 9 deletions(-) diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 49db492c4e..99dcdb4e17 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -28,8 +28,8 @@ enum crkbd_keycodes { LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ - LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ + LT(_LOWER,KC_GRV), KC_SPC, LALT_T(KC_BSPC), KC_DEL, KC_ENT, RAISE \ ) #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index a4e1deba86..ccf8e2b7c8 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE @@ -23,9 +23,9 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend # If you want to change the display of OLED, you need to change here SRC += ./lib/glcdfont.c \ ./lib/rgb_state_reader.c \ - ./lib/layer_state_reader.c \ ./lib/logo_reader.c \ ./lib/keylogger.c \ ./lib/host_led_state_reader.c \ + # ./lib/layer_state_reader.c \ # ./lib/mode_icon_reader.c \ # ./lib/timelogger.c \ diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index 60f41f9d98..21e3151c0f 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -12,7 +12,7 @@ KC_ESC, ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_MINS, \ KC_TAB , K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ - KC_MLSF, CTL_T(K21), K22, K23, K24, K25, ALT_APP, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, OS_LALT, OS_RGUI, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ ) #define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) @@ -95,4 +95,3 @@ void matrix_init_keymap(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); } - diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 25296ca4fd..545ad25dcd 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -38,7 +38,7 @@ uint8_t last_osm; ) \ LAYOUT_wrapper( \ KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, ALT_APP, OS_LGUI, KC_LALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_TAB, K11, K12, K13, K14, K15, OS_LALT, OS_LGUI, OS_RALT, OS_RGUI, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, LOWER, KC_SPACE,KC_BSPC, KC_DEL, KC_ENT, RAISE, K26, K27, K28, K29, CTL_T(K2A), KC_MRSF \ ) #define LAYOUT_orthodox_base_wrapper(...) LAYOUT_orthodox_base(__VA_ARGS__) diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index b9a2eb7a8f..518eaf0348 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -41,7 +41,7 @@ bool skip_leds = false; KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ - ALT_T(KC_APP), OSM(MOD_LGUI), OSM(MOD_RGUI), CTL_T(KC_ESCAPE), \ + OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ KC_HOME, KC_PGUP, \ LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ ) @@ -335,4 +335,3 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) { return false; } } - -- cgit v1.2.3 From 7b3ead01339bcf75eecfa2c2c704159906995986 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 08:56:05 -0700 Subject: Remove 'return false' in macros since it's not needed And it produces better handling overall. --- users/drashna/drashna.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 5329d36e2e..5b9957c3da 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -226,25 +226,21 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } - return false; break; case KC_COLEMAK: if (record->event.pressed) { set_single_persistent_default_layer(_COLEMAK); } - return false; break; case KC_DVORAK: if (record->event.pressed) { set_single_persistent_default_layer(_DVORAK); } - return false; break; case KC_WORKMAN: if (record->event.pressed) { set_single_persistent_default_layer(_WORKMAN); } - return false; break; @@ -264,36 +260,26 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { send_string_with_delay_P(PSTR(":avrdude"), 10); #endif // bootloader options } + #if defined(KEYBOARD_viterbi) + send_string_with_delay_P(PSTR(":dfu"), 10); + #endif if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); set_mods(temp_mod); } - return false; break; case EPRM: // Resets EEPROM if (record->event.pressed) { eeconfig_init(); } - return false; break; case VRSN: // Prints firmware version if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); } - return false; break; -/* Code has been depreciated - case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo - if (!record->event.pressed) { - clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); - send_string(decoy_secret[keycode - KC_SECRET_1]); - } - return false; - break; -*/ - // These are a serious of gaming macros. // Only enables for the viterbi, basically, // to save on firmware space, since it's limited. @@ -303,7 +289,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #ifdef RGBLIGHT_ENABLE userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); #endif //RGBLIGHT_ENABLE - return false; break; + break; case KC_SALT: return send_game_macro("Salt, salt, salt...", record, false); case KC_MORESALT: @@ -339,7 +325,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } #endif // TAP_DANCE_ENABLE - return false; break; + break; case KC_CCCV: // One key copy/paste @@ -356,32 +342,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { unregister_code(KC_LCTL); } } - return false; break; #ifdef UNICODE_ENABLE case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ if (record->event.pressed) { send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); } - return false; break; case UC_TABL: // ┬─┬ノ( º _ ºノ) if (record->event.pressed) { send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); } - return false; break; case UC_SHRG: // ¯\_(ツ)_/¯ if (record->event.pressed) { send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); } - return false; break; case UC_DISA: // ಠ_ಠ if (record->event.pressed) { send_unicode_hex_string("0CA0 005F 0CA0"); } - return false; break; #endif } -- cgit v1.2.3 From ba7a1e89769049ba24de92e6538875803079a702 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 22:08:22 -0700 Subject: Update old iris config --- keyboards/iris/keymaps/drashna_old/config.h | 9 ++------- keyboards/iris/keymaps/drashna_old/rules.mk | 5 ++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/keyboards/iris/keymaps/drashna_old/config.h b/keyboards/iris/keymaps/drashna_old/config.h index 6152ca5b6e..e452f695a0 100644 --- a/keyboards/iris/keymaps/drashna_old/config.h +++ b/keyboards/iris/keymaps/drashna_old/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -34,7 +31,7 @@ along with this program. If not, see . #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 16 // Number of LEDs -#define RGBLIGHT_ANIMATIONS + #define RGBLIGHT_HUE_STEP 12 #define RGBLIGHT_SAT_STEP 12 #define RGBLIGHT_VAL_STEP 12 @@ -70,5 +67,3 @@ along with this program. If not, see . #define ALT_LED1 7 #define GUI_LED1 8 - -#endif diff --git a/keyboards/iris/keymaps/drashna_old/rules.mk b/keyboards/iris/keymaps/drashna_old/rules.mk index f6ec9d1e5a..441d15a54c 100644 --- a/keyboards/iris/keymaps/drashna_old/rules.mk +++ b/keyboards/iris/keymaps/drashna_old/rules.mk @@ -1,4 +1,5 @@ USER_NAME := drashna +SRC += ../drashna/keymap.c BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) @@ -10,12 +11,10 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = no +SWAP_HANDS_ENABLE = yes INDICATOR_LIGHTS = yes MACROS_ENABLED = no RGBLIGHT_TWINKLE = yes -SRC += ../drashna/keymap.c - BOOTLOADER = qmk-dfu -- cgit v1.2.3 From d29a61e9ce39947cc2618c5d19d36f063bb0255b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 25 Oct 2018 22:08:49 -0700 Subject: Add Bootmagic Lite for now --- users/drashna/config.h | 9 ++++++++- users/drashna/drashna.c | 19 +++++++++++++++++++ users/drashna/drashna.h | 1 - 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/users/drashna/config.h b/users/drashna/config.h index 4545b34ef6..0d41359cca 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -73,4 +73,11 @@ #define MACRO_TIMER 5 - +#if !defined(BOOTMAGIC_LITE) && !defined(BOOTMAGIC_ENABLE) +#ifndef BOOTMAGIC_LITE_COLUMN + #define BOOTMAGIC_LITE_COLUMN 0 +#endif +#ifndef BOOTMAGIC_LITE_ROW + #define BOOTMAGIC_LITE_ROW 0 +#endif +#endif diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 5b9957c3da..35fa15be47 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -81,6 +81,21 @@ bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t thi return false; } +void bootmagic_lite(void) { + matrix_scan(); + #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 + wait_ms(DEBOUNCING_DELAY * 2); + #elif defined(DEBOUNCE) && DEBOUNCE > 0 + wait_ms(DEBOUNCE * 2); + #else + wait_ms(30); + #endif + matrix_scan(); + if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { + bootloader_jump(); + } +} + // Add reconfigurable functions here, for keymap customization // This allows for a global, userspace functions, and continued // customization of the keymap. Use _keymap instead of _user @@ -133,6 +148,10 @@ void eeconfig_init_keymap(void) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { + #if !defined(BOOTMAGIC_LITE) && !defined(BOOTMAGIC_ENABLE) + bootmagic_lite(); + #endif + userspace_config.raw = eeconfig_read_user(); #ifdef BOOTLOADER_CATERINA diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 7e69a9f8d9..221a8e413e 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -353,4 +353,3 @@ NOTE: These are all the same length. If you do a search/replace #define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 #define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN #define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT - -- cgit v1.2.3 From 9d27bb512f86757607a1e7a46688568198e7ce7d Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 12:17:15 -0700 Subject: Fix userspace config.h --- users/drashna/config.h | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/users/drashna/config.h b/users/drashna/config.h index 0d41359cca..9d7d20add0 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -69,15 +69,4 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER - #define MACRO_TIMER 5 - -#if !defined(BOOTMAGIC_LITE) && !defined(BOOTMAGIC_ENABLE) -#ifndef BOOTMAGIC_LITE_COLUMN - #define BOOTMAGIC_LITE_COLUMN 0 -#endif -#ifndef BOOTMAGIC_LITE_ROW - #define BOOTMAGIC_LITE_ROW 0 -#endif -#endif -- cgit v1.2.3 From 214241853a7b52d64e5cc702b107f264160f6880 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 12:20:10 -0700 Subject: Fix Bootmagic_lite function --- users/drashna/drashna.c | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 35fa15be47..b2219e9aa7 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -423,19 +423,3 @@ void eeconfig_init_user(void) { userspace_config.rgb_layer_change = true; eeconfig_update_user(userspace_config.raw); } - -void bootmagic_lite(void) { - matrix_scan(); - #if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 - wait_ms(DEBOUNCING_DELAY * 2); - #elif defined(DEBOUNCE) && DEBOUNCE > 0 - wait_ms(DEBOUNCE * 2); - #else - wait_ms(30); - #endif - matrix_scan(); - - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { - bootloader_jump(); - } -} -- cgit v1.2.3 From 0f086e488954dcfac49c1c27aa972441b944c68c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 12:32:53 -0700 Subject: Add Alternate DVORAK layout --- users/drashna/drashna.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 221a8e413e..573cb26fd0 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -255,6 +255,14 @@ NOTE: These are all the same length. If you do a search/replace #define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z +#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U +#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L +#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S +#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z + #define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B #define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G #define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V -- cgit v1.2.3 From b9811fd7e79b409138d733f5544a29d13906cccf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 12:40:15 -0700 Subject: Make old keymap super compatible --- keyboards/iris/keymaps/drashna_old/rules.mk | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/keyboards/iris/keymaps/drashna_old/rules.mk b/keyboards/iris/keymaps/drashna_old/rules.mk index 441d15a54c..73f37c6c55 100644 --- a/keyboards/iris/keymaps/drashna_old/rules.mk +++ b/keyboards/iris/keymaps/drashna_old/rules.mk @@ -1,20 +1,4 @@ USER_NAME := drashna SRC += ../drashna/keymap.c -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -TAP_DANCE_ENABLE = no -RGBLIGHT_ENABLE = yes -AUDIO_ENABLE = yes -NKRO_ENABLE = yes -BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = yes - -INDICATOR_LIGHTS = yes -MACROS_ENABLED = no -RGBLIGHT_TWINKLE = yes - -BOOTLOADER = qmk-dfu +include $(KEYBOARD_PATH_2)/keymaps/drashna/rules.mk -- cgit v1.2.3 From c60a312ba99f4ece511f36bc25c5f63410313b5b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 27 Oct 2018 14:52:57 -0700 Subject: Further unify old iris keymap --- keyboards/iris/keymaps/drashna/config.h | 2 ++ keyboards/iris/keymaps/drashna_old/config.h | 41 +++++++---------------------- 2 files changed, 11 insertions(+), 32 deletions(-) diff --git a/keyboards/iris/keymaps/drashna/config.h b/keyboards/iris/keymaps/drashna/config.h index 0274867153..dd247a42a7 100644 --- a/keyboards/iris/keymaps/drashna/config.h +++ b/keyboards/iris/keymaps/drashna/config.h @@ -68,3 +68,5 @@ along with this program. If not, see . #define ALT_LED1 8 #define GUI_LED1 9 +#define BOOTMAGIC_LITE_ROW 4 +#define BOOTMAGIC_LITE_COLUMN 3 diff --git a/keyboards/iris/keymaps/drashna_old/config.h b/keyboards/iris/keymaps/drashna_old/config.h index e452f695a0..b985c4dfc1 100644 --- a/keyboards/iris/keymaps/drashna_old/config.h +++ b/keyboards/iris/keymaps/drashna_old/config.h @@ -18,52 +18,29 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -#define USE_SERIAL -#undef USE_I2C - -/* Select hand configuration */ - -// #define MASTER_LEFT -// #define MASTER_RIGHT -#define EE_HANDS +#include "../drashna/config.h" #ifdef RGBLIGHT_ENABLE #undef RGBLED_NUM #define RGBLED_NUM 16 // Number of LEDs - -#define RGBLIGHT_HUE_STEP 12 -#define RGBLIGHT_SAT_STEP 12 -#define RGBLIGHT_VAL_STEP 12 -#define RGBLIGHT_EFFECT_KNIGHT_LENGTH 2 -#define RGBLIGHT_EFFECT_SNAKE_LENGTH 2 -#define RGBLIGHT_EFFECT_BREATHE_CENTER 1 - -#define RGBLIGHT_LIMIT_VAL 225 -#endif // RGBLIGHT_ENABLE - -#ifdef AUDIO_ENABLE -#define C6_AUDIO -#ifdef RGBLIGHT_ENABLE -#define NO_MUSIC_MODE -#endif //RGBLIGHT_ENABLE -#endif //AUDIO_ENABLE - -#define QMK_ESC_OUTPUT F6 // usually COL -#define QMK_ESC_INPUT D7 // usually ROW -#define QMK_LED B0 -#define QMK_SPEAKER C6 +#endif #undef PRODUCT #ifdef KEYBOARD_iris_rev2 -#define PRODUCT Drashna Hacked Iris Rev.2 +#define PRODUCT Drashna Hacked Iris Rev.2 (16 LED) #endif +#undef SHFT_LED1 #define SHFT_LED1 5 +#undef SHFT_LED2 #define SHFT_LED2 10 +#undef CTRL_LED1 #define CTRL_LED1 6 +#undef CTRL_LED2 #define CTRL_LED2 9 +#undef ALT_LED1 #define ALT_LED1 7 +#undef GUI_LED1 #define GUI_LED1 8 -- cgit v1.2.3 From 8517f8a6606d092014edf23ac9874d6a47fe1178 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Mon, 29 Oct 2018 02:12:44 +0900 Subject: Helix serial.c re-adjust compiler depend value of delay (#4269) * Helix serial.c add debug code * re-adjust READ_WRITE_WIDTH_ADJUST values * re-adjust READ_WRITE_START_ADJUST values * re-adjust TID_SEND_ADJUST value * Helix serial.c: remove debug code --- keyboards/helix/rev2/split_scomm.c | 3 --- keyboards/helix/serial.c | 54 +++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 13 deletions(-) diff --git a/keyboards/helix/rev2/split_scomm.c b/keyboards/helix/rev2/split_scomm.c index 50d233ce9a..ada7867960 100644 --- a/keyboards/helix/rev2/split_scomm.c +++ b/keyboards/helix/rev2/split_scomm.c @@ -7,9 +7,6 @@ #include #include #include "serial.h" -#ifdef SERIAL_DEBUG_MODE -#include -#endif #ifdef CONSOLE_ENABLE #include #endif diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 830f86b55a..c813b6b9ae 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -136,38 +136,68 @@ int serial_update_buffers() // 5: about 20kbps #endif -#define TID_SEND_ADJUST 2 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif #if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 6 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed #define SERIAL_DELAY 36 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 5 // Ultra Low speed #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else #error invalid SELECT_SOFT_SERIAL_SPEED value #endif /* SELECT_SOFT_SERIAL_SPEED */ @@ -187,16 +217,19 @@ int serial_update_buffers() static SSTD_t *Transaction_table = NULL; static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -216,6 +249,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -270,7 +304,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); -- cgit v1.2.3 From d63fb6f716b865fe1cede22787aa15834aecd868 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Mon, 29 Oct 2018 02:23:48 +0900 Subject: helix serial.c: add some comment --- keyboards/helix/serial.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index c813b6b9ae..24b889d30b 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU -- cgit v1.2.3 From cd87a8a323f0a522624550117d8a7a0249a72017 Mon Sep 17 00:00:00 2001 From: R4WBIT Date: Mon, 29 Oct 2018 13:32:36 +0100 Subject: fixed broken linebreak in fedora part, and indentation in arch-part --- util/linux_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 5186e31f2b..2c6cba53d1 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -8,7 +8,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then sudo dnf install \ arm-none-eabi-binutils-cs \ arm-none-eabi-gcc-cs \ - arm-none-eabi-newlib + arm-none-eabi-newlib \ avr-binutils \ avr-gcc \ avr-libc \ @@ -59,7 +59,7 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then avr-binutils \ avr-libc \ avr-gcc \ - base-devel \ + base-devel \ dfu-util \ diff-utils \ gcc \ -- cgit v1.2.3 From cd23984afcee9a8dd2b1b44876b77141d692de45 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Mon, 29 Oct 2018 10:04:52 -0400 Subject: Fix undefined reference to `console_printf` for CTRL and ALT keyboards Fix undefined reference to `console_printf` for CTRL and ALT keyboards when enabling CONSOLE_ENABLE --- tmk_core/common/arm_atsam/printf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/common/arm_atsam/printf.c b/tmk_core/common/arm_atsam/printf.c index d49d234de2..7f298d1fda 100644 --- a/tmk_core/common/arm_atsam/printf.c +++ b/tmk_core/common/arm_atsam/printf.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifdef CONSOLE_PRINT +#ifdef CONSOLE_ENABLE #include "samd51j18a.h" #include "arm_atsam_protocol.h" @@ -63,4 +63,4 @@ void console_printf(char *fmt, ...) { } } -#endif //CONSOLE_PRINT +#endif //CONSOLE_ENABLE -- cgit v1.2.3 From 6a629e5d0d4ed5903afa361568da8daeddc1b090 Mon Sep 17 00:00:00 2001 From: jshuf <44121348+jshuf@users.noreply.github.com> Date: Mon, 29 Oct 2018 13:33:07 -0400 Subject: Keyboard: add support for kbd19x (#4272) * 60_ansi keymap for DZ60 * 60_ansi keymap for DZ60 Amend author * 60_ansi keymap for DZ60 * Merge new phantom layout from dev branch * Initial util/new_project files * Progress checkpoint (compiles, but untested) * Progress snapshot, still working on layout graphics * Add layer images * Tidy up formatting * First cut at info.json for kbd19x default layout * Add default keymap * add all-keys layout * clean up documentation * Update keyboards/kbd19x/info.json Co-Authored-By: jshuf <44121348+jshuf@users.noreply.github.com> * Update keyboards/kbd19x/rules.mk Co-Authored-By: jshuf <44121348+jshuf@users.noreply.github.com> * Change layout name from default to ansi --- keyboards/kbd19x/config.h | 224 +++++++++++++++++++++++++++++ keyboards/kbd19x/info.json | 218 ++++++++++++++++++++++++++++ keyboards/kbd19x/kbd19x.c | 63 ++++++++ keyboards/kbd19x/kbd19x.h | 103 +++++++++++++ keyboards/kbd19x/keymaps/default/config.h | 20 +++ keyboards/kbd19x/keymaps/default/keymap.c | 52 +++++++ keyboards/kbd19x/keymaps/default/readme.md | 13 ++ keyboards/kbd19x/readme.md | 19 +++ keyboards/kbd19x/rules.mk | 80 +++++++++++ 9 files changed, 792 insertions(+) create mode 100644 keyboards/kbd19x/config.h create mode 100644 keyboards/kbd19x/info.json create mode 100644 keyboards/kbd19x/kbd19x.c create mode 100644 keyboards/kbd19x/kbd19x.h create mode 100644 keyboards/kbd19x/keymaps/default/config.h create mode 100644 keyboards/kbd19x/keymaps/default/keymap.c create mode 100644 keyboards/kbd19x/keymaps/default/readme.md create mode 100644 keyboards/kbd19x/readme.md create mode 100644 keyboards/kbd19x/rules.mk diff --git a/keyboards/kbd19x/config.h b/keyboards/kbd19x/config.h new file mode 100644 index 0000000000..47cfd7484a --- /dev/null +++ b/keyboards/kbd19x/config.h @@ -0,0 +1,224 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER KBDFans +#define PRODUCT kbd19x +#define DESCRIPTION A compact-1800 keyboard kit. + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 13 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B7, B3, E6, F0, D5, D4, D6, C7 } +#define MATRIX_COL_PINS { C6, F1, F4, F5, F6, F7, D7, B4, B5, D0, D1, D2, D3 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +// #define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 18 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/kbd19x/info.json b/keyboards/kbd19x/info.json new file mode 100644 index 0000000000..dd5cc700cc --- /dev/null +++ b/keyboards/kbd19x/info.json @@ -0,0 +1,218 @@ +{ + "keyboard_name": "KBD19x", + "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbd19x", + "maintainer": "qmk", + "width": 19.5, + "height": 6.75, + "layouts": { + "LAYOUT_ansi": { + "key_count": 99, + "layout": [{"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"BkLgt Step", "x":14, "y":0}, + {"label":"Print Screen", "x":15.5, "y":0}, + {"label":"Scroll Lock", "x":16.5, "y":0}, + {"label":"Pause Break", "x":17.5, "y":0}, + {"label":"PgDn", "x":18.5, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75},\ + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5, "h":2}, + {"label":"\u2191", "x":14.25, "y":4.75}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"MO(1)", "x":10.75, "y":5.5}, + {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5}, + {"label":"\u2190", "x":13.25, "y":5.75}, + {"label":"\u2193", "x":14.25, "y":5.75}, + {"label":"\u2192", "x":15.25, "y":5.75}] + }, + "LAYOUT_all": { + "key_count": 103, + "layout": [{"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1.25, "y":0}, + {"label":"F2", "x":2.25, "y":0}, + {"label":"F3", "x":3.25, "y":0}, + {"label":"F4", "x":4.25, "y":0}, + {"label":"F5", "x":5.5, "y":0}, + {"label":"F6", "x":6.5, "y":0}, + {"label":"F7", "x":7.5, "y":0}, + {"label":"F8", "x":8.5, "y":0}, + {"label":"F9", "x":9.75, "y":0}, + {"label":"F10", "x":10.75, "y":0}, + {"label":"F11", "x":11.75, "y":0}, + {"label":"F12", "x":12.75, "y":0}, + {"label":"BkLgt Step", "x":14, "y":0}, + {"label":"Print Screen", "x":15.5, "y":0}, + {"label":"Scroll Lock", "x":16.5, "y":0}, + {"label":"Pause Break", "x":17.5, "y":0}, + {"label":"PgDn", "x":18.5, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"x":13, "y":1.5}, + {"label":"BS", "x":14, "y":1.5}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"x":18.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5}, + {"label":"\u2191", "x":14.25, "y":4.75}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"x":3.5, "y":5.5, "w":6.25}, + {"label":"Alt", "x":9.75, "y":5.5}, + {"label":"Menu", "x":10.75, "y":5.5}, + {"label":"Ctrl", "x":11.75, "y":5.5, "w":1.25}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5}, + {"x":18.5, "y":5.5}, + {"label":"\u2190", "x":13.25, "y":5.75}, + {"label":"\u2193", "x":14.25, "y":5.75}, + {"label":"\u2192", "x":15.25, "y":5.75}] + } + } +} + diff --git a/keyboards/kbd19x/kbd19x.c b/keyboards/kbd19x/kbd19x.c new file mode 100644 index 0000000000..360345600d --- /dev/null +++ b/keyboards/kbd19x/kbd19x.c @@ -0,0 +1,63 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +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 . +*/ + +#include "kbd19x.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1< @jshuf + +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 . +*/ + +#ifndef KBD19X_H +#define KBD19X_H + +#include "quantum.h" +#include "led.h" + +inline void kbd19x_caps_led_on(void) { DDRB |= (1<<0); PORTB &= ~(1<<0); } +inline void kbd19x_caps_led_off(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); } + +inline void kbd19x_sclk_led_on(void) { DDRB |= (1<<1); PORTB &= ~(1<<1); } +inline void kbd19x_sclk_led_off(void) { DDRB &= ~(1<<1); PORTB &= ~(1<<1); } + +inline void kbd19x_nmlk_led_on(void) { DDRB |= (1<<2); PORTB &= ~(1<<2); } +inline void kbd19x_nmlk_led_off(void) { DDRB &= ~(1<<2); PORTB &= ~(1<<2); } + +// readability +#define XXX KC_NO + +/* This is a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// 2u backspace: XXX, k1e +// split backspace: k1d, k1e + +// 2u numpad +: k2i, XXX +// split numpad +: k2i, k3i + +// 2u numpad enter: k4i, XXX +// split numpad enter: k4i, k5i + +// 2.25u lshift: k40, XXX +// split (1.25u, 1u) lshift: k40, k41 + +// ANSI enter or ISO enter: k3e +// backslash or NUHS: k2e + +// left winkey: k50, k51, k52 +// left WKL: k50, XXX, k52 + +// right winkey: k59, k5a, k5b +// right WKL: k59, XXX, k5b + +#define LAYOUT_all( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, k1f, k1g, k1h, k1i, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ + k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h, k5i \ +)\ +{\ + {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ + {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ + {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ + {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, k3i},\ + {k40, k41, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ + {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, k5i},\ + {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ + {k1d, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ +} + +#define LAYOUT_ansi( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, k0f, k0g, k0h, k0i, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1e, k1f, k1g, k1h, k1i, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2e, k2f, k2g, k2h, k2i, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3e, k3f, k3g, k3h, \ + k40, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, k4e, k4f, k4g, k4h, k4i, \ + k50, k51, k52, k56, k59, k5a, k5b, k5d, k5e, k5f, k5g, k5h \ +)\ +{\ + {k00, k01, k02, k03, k04, k09, k0a, k0b, k0c, k0f, k0g, k0h, k0i},\ + {k10, k11, k12, k13, k14, k19, k1a, k1b, k1c, k1f, k1g, k1h, k1i},\ + {k20, k21, k22, k23, k24, k29, k2a, k2b, k2c, k2f, k2g, k2h, k2i},\ + {k30, k32, k33, k34, k35, k3a, k3b, k3c, k3e, k3f, k3g, k3h, XXX},\ + {k40, XXX, k42, k43, k44, k49, k4a, k4b, k4c, k4f, k4g, k4h, k4i},\ + {k50, k51, k52, k5e, k5f, k59, k5a, k5b, k5d, k56, k5g, k5h, XXX},\ + {k05, k06, k07, k08, k15, k16, k17, k18, k25, k26, k27, k28, k36},\ + {XXX, k1e, k0e, k2e, k4e, k37, k38, k39, k45, k46, k47, k48, XXX},\ +} +#endif diff --git a/keyboards/kbd19x/keymaps/default/config.h b/keyboards/kbd19x/keymaps/default/config.h new file mode 100644 index 0000000000..70028a525c --- /dev/null +++ b/keyboards/kbd19x/keymaps/default/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +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 + +// place overrides here diff --git a/keyboards/kbd19x/keymaps/default/keymap.c b/keyboards/kbd19x/keymaps/default/keymap.c new file mode 100644 index 0000000000..c806072114 --- /dev/null +++ b/keyboards/kbd19x/keymaps/default/keymap.c @@ -0,0 +1,52 @@ +/* +Copyright 2018 Jeff Shufelt @jshuf + +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 . +*/ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( /* Base */ + 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, BL_STEP, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGDN, \ + 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_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_P7, KC_P8, KC_P9, KC_PPLS, \ + 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_LSFT, 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + [1] = LAYOUT_ansi( /* Func */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd19x/keymaps/default/readme.md b/keyboards/kbd19x/keymaps/default/readme.md new file mode 100644 index 0000000000..504a3ed02e --- /dev/null +++ b/keyboards/kbd19x/keymaps/default/readme.md @@ -0,0 +1,13 @@ +# Default KBD19x Layout + +This is the default KBD19x layout, consisting of the base layer and the function layer. Backlighting and RGB controls are accessible on the function layer. + +**Base layer** + +![kbd19x default base layer](https://i.imgur.com/XhT980a.png) + +**Function layer** + +![kbd19x default function layer](https://i.imgur.com/3w3PXN2.png) + + diff --git a/keyboards/kbd19x/readme.md b/keyboards/kbd19x/readme.md new file mode 100644 index 0000000000..ee4969b00d --- /dev/null +++ b/keyboards/kbd19x/readme.md @@ -0,0 +1,19 @@ +# kbd19x + +![kbd19x](https://i.imgur.com/0hWTEnh.jpg) + +**Layout possibilities for the KBD19x** + +![kbd19x](https://i.imgur.com/pVaR2zY.png) + +The KBD19x is a compact-1800 keyboard kit produced by KBDfans, offering a number of layout options. + +Keyboard Maintainer: [jshuf](https://github.com/jshuf) +Hardware Supported: KBD19x PCB +Hardware Availability: [KBDfans](https://kbdfans.cn) + +Make example for this keyboard (after setting up your build environment): + + make kbd19x: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/kbd19x/rules.mk b/keyboards/kbd19x/rules.mk new file mode 100644 index 0000000000..8e50962afa --- /dev/null +++ b/keyboards/kbd19x/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) -- cgit v1.2.3 From 1e96346f289ea235fc418ddc45203a599fd00c08 Mon Sep 17 00:00:00 2001 From: Bramver Date: Mon, 29 Oct 2018 18:45:17 +0100 Subject: Keymap: Added personal Contra layout. (#4235) * Added personal Contra layout. * Update keyboards/contra/keymaps/bramver/rules.mk Co-Authored-By: BramVer * Update keyboards/contra/keymaps/bramver/keymap.c Co-Authored-By: BramVer * Update keyboards/contra/keymaps/bramver/keymap.c Co-Authored-By: BramVer * Reformatted layers to use the layout format. --- keyboards/contra/keymaps/bramver/README.md | 35 ++++++++ keyboards/contra/keymaps/bramver/config.h | 9 +++ keyboards/contra/keymaps/bramver/keymap.c | 126 +++++++++++++++++++++++++++++ keyboards/contra/keymaps/bramver/rules.mk | 6 ++ 4 files changed, 176 insertions(+) create mode 100644 keyboards/contra/keymaps/bramver/README.md create mode 100755 keyboards/contra/keymaps/bramver/config.h create mode 100644 keyboards/contra/keymaps/bramver/keymap.c create mode 100755 keyboards/contra/keymaps/bramver/rules.mk diff --git a/keyboards/contra/keymaps/bramver/README.md b/keyboards/contra/keymaps/bramver/README.md new file mode 100644 index 0000000000..5327beba7c --- /dev/null +++ b/keyboards/contra/keymaps/bramver/README.md @@ -0,0 +1,35 @@ +# Contra layout + +My current setup consists of a very simple base layer, numbers layer, mouse layer and emoji layer. +Still many options, but time will tell if changes are needed. + +## Keymap + +``` +#define SP_MSE LT(_MOUSE, KC_SPC) + + +BASE layer + { 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_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT }, + { KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT }, + { KC_LCTL , KC_GRV , KC_LALT , KC_LGUI , MO(1) , SP_MSE , SP_MSE , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , MO(2) }, + +LOWER layer + { _______ , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL }, + { _______ , KC_F1 , KC_F2 , KC_F3 , KC_LBRC , KC_MINS , KC_EQL , KC_RBRC , KC_F7 , KC_F8 , KC_F9 , _______ }, + { _______ , KC_F4 , KC_F5 , KC_F6 , KC_HOME , KC_BSLS , KC_MPLY , KC_END , KC_F10 , KC_F11 , KC_F12 , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + +EMOJI layer + { _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ }, + { _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ }, + { _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, + +MOUSE layer + { _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ }, + { _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ }, + { _______ , KC_VOLD , KC_VOLU , KC_MPRV , KC_MNXT , KC_MPLY , KC_MPLY , KC_MPRV , KC_MNXT , KC_VOLD , KC_VOLU , _______ }, + { _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ }, +``` \ No newline at end of file diff --git a/keyboards/contra/keymaps/bramver/config.h b/keyboards/contra/keymaps/bramver/config.h new file mode 100755 index 0000000000..de2a9b0ee1 --- /dev/null +++ b/keyboards/contra/keymaps/bramver/config.h @@ -0,0 +1,9 @@ +#pragma once + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 16 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_MAX_SPEED 8 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 40 +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/contra/keymaps/bramver/keymap.c b/keyboards/contra/keymaps/bramver/keymap.c new file mode 100644 index 0000000000..8ccaf686bd --- /dev/null +++ b/keyboards/contra/keymaps/bramver/keymap.c @@ -0,0 +1,126 @@ +/* Copyright 2018 darm + * + * 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 . + */ +#include QMK_KEYBOARD_H + +enum emoji_map { + UNAM, // unamused 😒 + HEYE, // smiling face with heart shaped eyes 😍 + OK, // ok hand sign 👌 + SMIR, // smirk 😏 + PRAY, // pray 🙏 + CELE, // celebration 🙌 + COOL, // smile with sunglasses 😎 + EYES, // eyes + THNK, // BIG THONK + NAIL, // Nailcare + SOS, // Vuile sos + REDB, // Red B + HNDR, // 100 + MONY, + FIRE, + CAR, + BUTT, + BNIS, + CUM, + CLAP, + TRIU, // Fart from nose + SCRM, + VOMI, + DTIV, // Detective + EXPL, // Brainsplosion + HAIR, // Haircut + DANC, // Salsa dancer + STRN, // Stronk + LEFT, // Point Left + RGHT, // Point Right +}; + +const uint32_t PROGMEM unicode_map[] = { + [UNAM] = 0x1F612, + [HEYE] = 0x1f60d, + [OK] = 0x1F44C, + [SMIR] = 0x1F60F, + [PRAY] = 0x1F64F, + [CELE] = 0x1F64C, + [COOL] = 0x1F60E, + [EYES] = 0x1F440, + [THNK] = 0x1F914, + [NAIL] = 0x1F485, + [SOS] = 0x1F198, + [REDB] = 0x1F171, + [HNDR] = 0x1F4AF, + [MONY] = 0x1F480, + [FIRE] = 0x1F525, + [CAR] = 0x1F697, + [BUTT] = 0x1F351, + [BNIS] = 0x1F346, + [CUM] = 0x1F4A6, + [CLAP] = 0x1F44F, + [TRIU] = 0x1F624, + [SCRM] = 0x1F631, + [VOMI] = 0x1F92E, + [DTIV] = 0x1F575, + [EXPL] = 0x1F92F, + [HAIR] = 0x2640, + [DANC] = 0x1F483, + [STRN] = 0x1F4AA, + [LEFT] = 0x1F448, + [RGHT] = 0x1F449, +}; + +// Layer shorthand +#define _BASE 0 +#define _LOWER 1 +#define _EMOJI 2 +#define _MOUSE 3 + +#define SP_MSE LT(_MOUSE, KC_SPC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_BASE] = LAYOUT_ortho_4x12( + 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_TAB , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN , KC_ENT , + KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM , KC_DOT , KC_SLSH , KC_QUOT , + KC_LCTL , KC_GRV , KC_LALT , KC_LGUI , MO(1) , SP_MSE , SP_MSE , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , MO(2) + ), + + [_LOWER] = LAYOUT_ortho_4x12( + _______ , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL , + _______ , KC_F1 , KC_F2 , KC_F3 , KC_LBRC , KC_MINS , KC_EQL , KC_RBRC , KC_F7 , KC_F8 , KC_F9 , _______ , + _______ , KC_F4 , KC_F5 , KC_F6 , KC_HOME , KC_BSLS , KC_MPLY , KC_END , KC_F10 , KC_F11 , KC_F12 , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_EMOJI] = LAYOUT_ortho_4x12( + _______ , X(CLAP) , X(CUM) , X(BNIS) , X(BUTT) , X(CAR) , X(FIRE) , X(REDB) , X(MONY) , X(HNDR) , X(SOS) , _______ , + _______ , X(CELE) , X(PRAY) , X(NAIL) , X(OK) , X(THNK) , X(UNAM) , X(HEYE) , X(COOL) , X(EYES) , X(SMIR) , _______ , + _______ , X(TRIU) , X(SCRM) , X(VOMI) , X(DTIV) , X(EXPL) , X(HAIR) , X(DANC) , X(STRN) , X(LEFT) , X(RGHT) , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ), + + [_MOUSE] = LAYOUT_ortho_4x12( + _______ , KC_WH_L , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_U , KC_WH_U , KC_BTN1 , KC_MS_U , KC_BTN2 , KC_WH_L , _______ , + _______ , KC_WH_R , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_D , KC_WH_D , KC_MS_L , KC_MS_D , KC_MS_R , KC_WH_R , _______ , + _______ , KC_VOLD , KC_VOLU , KC_MPRV , KC_MNXT , KC_MPLY , KC_MPLY , KC_MPRV , KC_MNXT , KC_VOLD , KC_VOLU , _______ , + _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ , _______ + ) + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +} diff --git a/keyboards/contra/keymaps/bramver/rules.mk b/keyboards/contra/keymaps/bramver/rules.mk new file mode 100755 index 0000000000..925b1c2b26 --- /dev/null +++ b/keyboards/contra/keymaps/bramver/rules.mk @@ -0,0 +1,6 @@ +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +NKRO_ENABLE = yes # USB Nkey Rollover +UNICODEMAP_ENABLE = yes # Unicode +BOOTLOADER = atmel-dfu + -- cgit v1.2.3 From 1fa6c1d818add2c72381639a836180af5aa86738 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Mon, 29 Oct 2018 20:48:24 +0000 Subject: Make linux_install.sh work with openSUSE Leap 15.0 (#4218) --- util/linux_install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 2c6cba53d1..d3b9328d79 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -96,9 +96,13 @@ elif grep ID /etc/os-release | grep -q gentoo; then fi elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then + CROSS_AVR_GCC=cross-avr-gcc8 + if grep ID /etc/os-release | grep -q "15.0"; then + CROSS_AVR_GCC=cross-avr-gcc7 + fi sudo zypper install \ avr-libc \ - cross-avr-gcc8 \ + $CROSS_AVR_GCC \ cross-avr-binutils \ cross-arm-none-newlib-devel \ cross-arm-binutils cross-arm-none-newlib-devel \ -- cgit v1.2.3 From 34f102de7df093525ca310e265a3406e831bf4c6 Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Tue, 30 Oct 2018 13:00:40 +0800 Subject: Keyboard: Vinta (#4283) * added initial config files for vinta * added readme * changed product id and device ver * fixed keymap illustration * updated rules.mk to enable more commands * removed a bunch of pre-code text; changed some grammar woopsies * removed bootmagic lite * updated developer's note * updated readme.md --- .../vinta/boards/GENERIC_STM32_F042X6/board.c | 101 +++ .../vinta/boards/GENERIC_STM32_F042X6/board.h | 896 +++++++++++++++++++++ .../vinta/boards/GENERIC_STM32_F042X6/board.mk | 5 + keyboards/vinta/bootloader_defs.h | 7 + keyboards/vinta/chconf.h | 521 ++++++++++++ keyboards/vinta/config.h | 70 ++ keyboards/vinta/halconf.h | 350 ++++++++ keyboards/vinta/keymaps/default/keymap.c | 51 ++ keyboards/vinta/mcuconf.h | 168 ++++ keyboards/vinta/readme.md | 22 + keyboards/vinta/rules.mk | 47 ++ keyboards/vinta/vinta.c | 18 + keyboards/vinta/vinta.h | 25 + 13 files changed, 2281 insertions(+) create mode 100644 keyboards/vinta/boards/GENERIC_STM32_F042X6/board.c create mode 100644 keyboards/vinta/boards/GENERIC_STM32_F042X6/board.h create mode 100644 keyboards/vinta/boards/GENERIC_STM32_F042X6/board.mk create mode 100644 keyboards/vinta/bootloader_defs.h create mode 100644 keyboards/vinta/chconf.h create mode 100644 keyboards/vinta/config.h create mode 100644 keyboards/vinta/halconf.h create mode 100644 keyboards/vinta/keymaps/default/keymap.c create mode 100644 keyboards/vinta/mcuconf.h create mode 100644 keyboards/vinta/readme.md create mode 100644 keyboards/vinta/rules.mk create mode 100644 keyboards/vinta/vinta.c create mode 100644 keyboards/vinta/vinta.h diff --git a/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.c b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.c new file mode 100644 index 0000000000..19adfb933e --- /dev/null +++ b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.c @@ -0,0 +1,101 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.h b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.h new file mode 100644 index 0000000000..241d566afa --- /dev/null +++ b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.h @@ -0,0 +1,896 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +#ifndef _BOARD_H +#define _BOARD_H + +/* + * Setup for STMicroelectronics STM32 Nucleo32-F042K6 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F042X6 +#define BOARD_NAME "Vinta PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +/* + * MCU type as defined in the ST header. + */ +#define STM32F042x6 + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_PIN11 11U +#define GPIOA_PIN12 12U +#define GPIOA_PIN13 13U +#define GPIOA_PIN14 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_PIN0 0U +#define GPIOF_PIN1 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ + +#define LINE_BOOT0 PAL_LINE(GPIOB, 8U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - COL5 + * PA1 - COL4 + * PA2 - COL3 + * PA3 - COL2 + * PA4 - COL1 + * PA5 - COL0 + * PA6 - ROW4 + * PA7 - ROW3 + * PA8 - NC + * PA9 - ROW1 + * PA10 - ROW0 + * PA11 - USB_DM + * PA12 - USB_DP + * PA13 - COL15/SWDIO (for now, COL15) + * PA14 - COL14/SWCLK (for now, COL14) + * PA15 - COL13 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_PIN11) | \ + PIN_MODE_INPUT(GPIOA_PIN12) | \ + PIN_MODE_INPUT(GPIOA_PIN13) | \ + PIN_MODE_INPUT(GPIOA_PIN14) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_PULLUP(GPIOA_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN11) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_PIN11) | \ + PIN_ODR_HIGH(GPIOA_PIN12) | \ + PIN_ODR_HIGH(GPIOA_PIN13) | \ + PIN_ODR_HIGH(GPIOA_PIN14) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - ROW2 + * PB1 - RGB_D + * PB2 - PIN2 (input pullup). + * PB3 - COL12 + * PB4 - COL11 + * PB5 - COL10 + * PB6 - COL9 + * PB7 - COL8 + * PB8 - BOOT0 (set as output for STM32F042) + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_OUTPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_OUTPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_HIGH(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_HIGH(GPIOB_PIN9) | \ + PIN_OSPEED_HIGH(GPIOB_PIN10) | \ + PIN_OSPEED_HIGH(GPIOB_PIN11) | \ + PIN_OSPEED_HIGH(GPIOB_PIN12) | \ + PIN_OSPEED_HIGH(GPIOB_PIN13) | \ + PIN_OSPEED_HIGH(GPIOB_PIN14) | \ + PIN_OSPEED_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0U)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input pullup). + * PC15 - PIN15 (input pullup). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_PIN0) | \ + PIN_OSPEED_HIGH(GPIOC_PIN1) | \ + PIN_OSPEED_HIGH(GPIOC_PIN2) | \ + PIN_OSPEED_HIGH(GPIOC_PIN3) | \ + PIN_OSPEED_HIGH(GPIOC_PIN4) | \ + PIN_OSPEED_HIGH(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_PIN6) | \ + PIN_OSPEED_HIGH(GPIOC_PIN7) | \ + PIN_OSPEED_HIGH(GPIOC_PIN8) | \ + PIN_OSPEED_HIGH(GPIOC_PIN9) | \ + PIN_OSPEED_HIGH(GPIOC_PIN10) | \ + PIN_OSPEED_HIGH(GPIOC_PIN11) | \ + PIN_OSPEED_HIGH(GPIOC_PIN12) | \ + PIN_OSPEED_HIGH(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_HIGH(GPIOD_PIN0) | \ + PIN_OSPEED_HIGH(GPIOD_PIN1) | \ + PIN_OSPEED_HIGH(GPIOD_PIN2) | \ + PIN_OSPEED_HIGH(GPIOD_PIN3) | \ + PIN_OSPEED_HIGH(GPIOD_PIN4) | \ + PIN_OSPEED_HIGH(GPIOD_PIN5) | \ + PIN_OSPEED_HIGH(GPIOD_PIN6) | \ + PIN_OSPEED_HIGH(GPIOD_PIN7) | \ + PIN_OSPEED_HIGH(GPIOD_PIN8) | \ + PIN_OSPEED_HIGH(GPIOD_PIN9) | \ + PIN_OSPEED_HIGH(GPIOD_PIN10) | \ + PIN_OSPEED_HIGH(GPIOD_PIN11) | \ + PIN_OSPEED_HIGH(GPIOD_PIN12) | \ + PIN_OSPEED_HIGH(GPIOD_PIN13) | \ + PIN_OSPEED_HIGH(GPIOD_PIN14) | \ + PIN_OSPEED_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_HIGH(GPIOE_PIN0) | \ + PIN_OSPEED_HIGH(GPIOE_PIN1) | \ + PIN_OSPEED_HIGH(GPIOE_PIN2) | \ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_HIGH(GPIOE_PIN4) | \ + PIN_OSPEED_HIGH(GPIOE_PIN5) | \ + PIN_OSPEED_HIGH(GPIOE_PIN6) | \ + PIN_OSPEED_HIGH(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - COL7 + * PF1 - COL6 + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_PIN0) | \ + PIN_MODE_INPUT(GPIOF_PIN1) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN1) | \ + PIN_OSPEED_HIGH(GPIOF_PIN2) | \ + PIN_OSPEED_HIGH(GPIOF_PIN3) | \ + PIN_OSPEED_HIGH(GPIOF_PIN4) | \ + PIN_OSPEED_HIGH(GPIOF_PIN5) | \ + PIN_OSPEED_HIGH(GPIOF_PIN6) | \ + PIN_OSPEED_HIGH(GPIOF_PIN7) | \ + PIN_OSPEED_HIGH(GPIOF_PIN8) | \ + PIN_OSPEED_HIGH(GPIOF_PIN9) | \ + PIN_OSPEED_HIGH(GPIOF_PIN10) | \ + PIN_OSPEED_HIGH(GPIOF_PIN11) | \ + PIN_OSPEED_HIGH(GPIOF_PIN12) | \ + PIN_OSPEED_HIGH(GPIOF_PIN13) | \ + PIN_OSPEED_HIGH(GPIOF_PIN14) | \ + PIN_OSPEED_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_PULLUP(GPIOF_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_PIN0) | \ + PIN_ODR_HIGH(GPIOF_PIN1) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H */ diff --git a/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.mk b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.mk new file mode 100644 index 0000000000..bbeb5bbff7 --- /dev/null +++ b/keyboards/vinta/boards/GENERIC_STM32_F042X6/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F042X6/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F042X6 diff --git a/keyboards/vinta/bootloader_defs.h b/keyboards/vinta/bootloader_defs.h new file mode 100644 index 0000000000..4994be9c24 --- /dev/null +++ b/keyboards/vinta/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFC400 \ No newline at end of file diff --git a/keyboards/vinta/chconf.h b/keyboards/vinta/chconf.h new file mode 100644 index 0000000000..b836a3b99c --- /dev/null +++ b/keyboards/vinta/chconf.h @@ -0,0 +1,521 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 10000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ \ No newline at end of file diff --git a/keyboards/vinta/config.h b/keyboards/vinta/config.h new file mode 100644 index 0000000000..5f6ea7f06b --- /dev/null +++ b/keyboards/vinta/config.h @@ -0,0 +1,70 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0C61 +#define DEVICE_VER 0x00C6 +#define MANUFACTURER PeiorisBoards +#define PRODUCT Vinta R1 +#define DESCRIPTION Tada68 Replacement PCB + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +#define MATRIX_ROW_PINS { A10, A9, B0, A7, A6 } +#define MATRIX_COL_PINS { A5, A4, A3, A2, A1, A0, F1, F0, B7, B6, B5, B4, B3, A15, A14, A13 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 0 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) diff --git a/keyboards/vinta/halconf.h b/keyboards/vinta/halconf.h new file mode 100644 index 0000000000..bc2b66f2e1 --- /dev/null +++ b/keyboards/vinta/halconf.h @@ -0,0 +1,350 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 256 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ \ No newline at end of file diff --git a/keyboards/vinta/keymaps/default/keymap.c b/keyboards/vinta/keymaps/default/keymap.c new file mode 100644 index 0000000000..4e55ec308f --- /dev/null +++ b/keyboards/vinta/keymaps/default/keymap.c @@ -0,0 +1,51 @@ +/* Copyright 2018 Peioris + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \ | ` |Del | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bspc|PgUp| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgDn| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|End | + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|RST|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_69_ansi( + KC_ESC, 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_BSLS, KC_GRV, KC_DEL,\ + 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_BSPC, KC_PGUP,\ + 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_PGUP,\ + KC_LSFT, 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_PGDN,\ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, RESET, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), +}; + +void matrix_init_user(void) { + //user initialization +} + +void matrix_scan_user(void) { + //user matrix +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} \ No newline at end of file diff --git a/keyboards/vinta/mcuconf.h b/keyboards/vinta/mcuconf.h new file mode 100644 index 0000000000..4643e9f92e --- /dev/null +++ b/keyboards/vinta/mcuconf.h @@ -0,0 +1,168 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + http://www.apache.org/licenses/LICENSE-2.0 + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _MCUCONF_H_ +#define _MCUCONF_H_ + +/* + * STM32F0xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 3...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F0xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_HSI14_ENABLED TRUE +#define STM32_HSI48_ENABLED FALSE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED FALSE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2 +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 12 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE STM32_PPRE_DIV1 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADCPRE STM32_ADCPRE_DIV4 +#define STM32_ADCSW STM32_ADCSW_HSI14 +#define STM32_USBSW STM32_USBSW_HSI48 +#define STM32_CECSW STM32_CECSW_HSI +#define STM32_I2C1SW STM32_I2C1SW_HSI +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_RTCSEL STM32_RTCSEL_LSI + +/* + * ADC driver system settings. + */ +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_IRQ_PRIORITY 2 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 3 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 3 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM14 FALSE +#define STM32_GPT_TIM1_IRQ_PRIORITY 2 +#define STM32_GPT_TIM2_IRQ_PRIORITY 2 +#define STM32_GPT_TIM3_IRQ_PRIORITY 2 +#define STM32_GPT_TIM14_IRQ_PRIORITY 2 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 3 +#define STM32_I2C_I2C2_IRQ_PRIORITY 3 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 3 +#define STM32_ICU_TIM2_IRQ_PRIORITY 3 +#define STM32_ICU_TIM3_IRQ_PRIORITY 3 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 FALSE +#define STM32_PWM_USE_TIM3 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 3 +#define STM32_PWM_TIM2_IRQ_PRIORITY 3 +#define STM32_PWM_TIM3_IRQ_PRIORITY 3 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 FALSE +#define STM32_SERIAL_USART1_PRIORITY 3 +#define STM32_SERIAL_USART2_PRIORITY 3 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 2 +#define STM32_SPI_SPI2_IRQ_PRIORITY 2 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 2 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 3 +#define STM32_UART_USART2_IRQ_PRIORITY 3 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_LP_IRQ_PRIORITY 3 + +#endif /* _MCUCONF_H_ */ \ No newline at end of file diff --git a/keyboards/vinta/readme.md b/keyboards/vinta/readme.md new file mode 100644 index 0000000000..193f361216 --- /dev/null +++ b/keyboards/vinta/readme.md @@ -0,0 +1,22 @@ +Vinta +========= + +[Vinta](https://i.imgur.com/huX3lff.jpg) + + +This is an ARM-powered 65% keyboard PCB with USB Mini B connector and breakout for optional RGB underglow. + +Keyboard Maintainer: [Peioris](http://peioris.space/) and on [github](https://github.com/coarse) +Hardware Supported: Vinta with STM32F042K6T6 +Hardware Availability: Private Groupbuy (will post on Reddit once QMK has RGB underglow working) + +Make example for this keyboard (after setting up your build environment): + + make vinta:default + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +#### Developer's Note + +STM32F042xx chips does not allow jumping to bootloader without BOOT0 being set to high, therefore it is impossible to enter the bootloader from sending a `RESET` keycode nor using bootmagic or bootmagic lite. +The only way to enter bootloader is to hold the BOOT0 button while the keyboard is powering up or after a power reset (done by pressing the reset switch or sending a `RESET` keycode). \ No newline at end of file diff --git a/keyboards/vinta/rules.mk b/keyboards/vinta/rules.mk new file mode 100644 index 0000000000..bf3eecbe21 --- /dev/null +++ b/keyboards/vinta/rules.mk @@ -0,0 +1,47 @@ +# project specific files + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F0xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F042x6 + +# Startup code to use +# - it should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f0xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F042X6 + +# Cortex version +MCU = cortex-m0 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 6 + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +#OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = yes # USB Nkey Rollover +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in \ No newline at end of file diff --git a/keyboards/vinta/vinta.c b/keyboards/vinta/vinta.c new file mode 100644 index 0000000000..b5d40a1609 --- /dev/null +++ b/keyboards/vinta/vinta.c @@ -0,0 +1,18 @@ +#include "vinta.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + + return process_record_user(keycode, record); +} \ No newline at end of file diff --git a/keyboards/vinta/vinta.h b/keyboards/vinta/vinta.h new file mode 100644 index 0000000000..7f21157eee --- /dev/null +++ b/keyboards/vinta/vinta.h @@ -0,0 +1,25 @@ +#ifndef VINTA_H +#define VINTA_H + +#define XXX KC_NO + +#include "quantum.h" + +// This a shortcut to help you visually see your layout. + +#define LAYOUT_69_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3E, K3F, \ + K40, K41, K42, K45, K49, K4A, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, XXX, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, XXX, K3E, K3F }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, K4C, K4D, K4E, K4F } \ +} + +#endif \ No newline at end of file -- cgit v1.2.3 From a9c5e75437be7dbfb399d21f738feb9a07c4017d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDan=20Pevec?= Date: Tue, 30 Oct 2018 06:21:07 +0100 Subject: Planck keyboard layout update (#4279) * Personal dz60 keymap * Replacing unused macros Co-Authored-By: pevecyan * Fixes on keymap * Planck keyboard layout update --- keyboards/planck/keymaps/pevecyan/keymap.c | 34 +++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/keyboards/planck/keymaps/pevecyan/keymap.c b/keyboards/planck/keymaps/pevecyan/keymap.c index 7bc43a373c..4d76f09b0a 100644 --- a/keyboards/planck/keymaps/pevecyan/keymap.c +++ b/keyboards/planck/keymaps/pevecyan/keymap.c @@ -28,7 +28,9 @@ enum planck_layers { _RAISE, _ADJUST, _ALTGR, - _CAPS + _CAPS, + _MEMA, + _CARON }; enum planck_keycodes { @@ -39,6 +41,8 @@ enum planck_keycodes { #define RAISE MO(_RAISE) #define CAPS MO(_CAPS) #define ALTGR MO(_ALTGR) +#define MEMA MO(_MEMA) +#define CARON LT(_CARON, SI_QOT) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -55,14 +59,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT_planck_grid( KC_TAB, SI_Q, SI_W, SI_E, SI_R, SI_T, SI_Z, SI_U, SI_I, SI_O, SI_P, KC_BSPC, - CAPS, SI_A, SI_S, SI_D, SI_F, SI_G, SI_H, SI_J, SI_K, SI_L, KC_SCLN, KC_ENT, + CAPS, SI_A, SI_S, SI_D, SI_F, SI_G, SI_H, SI_J, SI_K, SI_L, CARON, KC_ENT, KC_LSFT, SI_Y, SI_X, SI_C, SI_V, SI_B, SI_N, SI_M, SI_COMM, SI_DOT, SI_MINS, KC_RSFT , - KC_LCTL, KC_LGUI, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, ALTGR, KC_DOWN, KC_UP, KC_F5 + KC_LCTL, KC_LALT, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, ALTGR, MEMA, KC_F12, KC_F5 ), /* Lower * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * | ~ | ! | " | # | $ | % | & | / | ( | ) | = | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * |------+------+------+------+------+------|------+------+------+------+------+------| @@ -72,8 +76,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_planck_grid( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_MINS, KC_PPLS , KC_ENT, + SI_TILD, SI_EXLM, SI_DQOT, KC_HASH, SI_DLR, SI_PERC, SI_AMPR, SI_SLSH, SI_LPRN, SI_RPRN, SI_EQL, _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_MINS, KC_PPLS, KC_ENT, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), @@ -100,7 +104,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * | | Reset| | | | | | | | | | Del | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -126,7 +130,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -) +), + +[_MEMA] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_MPLY, KC_VOLU, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_CARON] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, SI_ZV , _______, _______, _______, _______, _______, + _______, _______, SI_SV, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, SI_CV, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), }; -- cgit v1.2.3 From 9315172190f86a6bc40bcdf9867a827e9fa72021 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Tue, 30 Oct 2018 04:05:28 +0900 Subject: helix serial.c: Add the version of gcc used for adjustment to the comment. --- keyboards/helix/serial.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 24b889d30b..325c29a3f7 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -70,6 +70,7 @@ #error serial.c now support ATmega32U4 only #endif +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -111,7 +112,8 @@ int serial_update_buffers() return result; } -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) @@ -575,7 +577,14 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif // Helix serial.c history -// 2018-1-29 fork from let's split (#2308) -// 2018-6-28 bug fix master to slave comm (#3255) -// 2018-8-11 improvements (#3608) -// 2018-10-21 fix serial and RGB animation conflict (#4191) +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) -- cgit v1.2.3 From 31ff5f219ddcbdac183c7f3ad6cea8eca1b9d398 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Tue, 30 Oct 2018 08:22:25 -0700 Subject: Move grave to top layer (caps is esc) (#4288) --- keyboards/dz60/keymaps/crd/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c index 2aedc0b728..148b03b995 100644 --- a/keyboards/dz60/keymaps/crd/keymap.c +++ b/keyboards/dz60/keymaps/crd/keymap.c @@ -4,7 +4,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | * |-----------------------------------------------------------------------------------------+ * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | * |-----------------------------------------------------------------------------------------+ @@ -17,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_directional( - KC_GESC, 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_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_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, 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, KC_ENT, KC_LSFT, 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_DEL, @@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* FN1 Layer * ,-----------------------------------------------------------------------------------------. - * | ` ~ | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | * |-----------------------------------------------------------------------------------------+ * | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------+ @@ -39,7 +39,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_directional( - KC_GRV, 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, -- cgit v1.2.3 From 7373d5b394d9c75cd2b91d77984145606bf31a04 Mon Sep 17 00:00:00 2001 From: Leah Date: Tue, 30 Oct 2018 16:37:08 +0100 Subject: Update feature_bootmagic.md (#4290) Fix typo --- docs/feature_bootmagic.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_bootmagic.md b/docs/feature_bootmagic.md index 20c76d9b74..504fb90f45 100644 --- a/docs/feature_bootmagic.md +++ b/docs/feature_bootmagic.md @@ -14,7 +14,7 @@ On some keyboards Bootmagic is disabled by default. If this is the case, it must BOOTMAGIC_ENABLE = full ``` -?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) ideally should be used instead. +?> You may see `yes` being used in place of `full`, and this is okay. However, `yes` is deprecated, and ideally `full` (or `lite`) should be used instead. Additionally, you can use [Bootmagic Lite](#bootmagic-lite) (a scaled down, very basic version of Bootmagic) by adding the following to your `rules.mk` file: -- cgit v1.2.3 From 7fc9170ea7271e2931c7e0f854b635f0954fbbe1 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Tue, 30 Oct 2018 09:10:53 -0700 Subject: Add crd's AEK layout for ALPS64 board (#4292) --- keyboards/alps64/keymaps/crd/keymap.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 keyboards/alps64/keymaps/crd/keymap.c diff --git a/keyboards/alps64/keymaps/crd/keymap.c b/keyboards/alps64/keymaps/crd/keymap.c new file mode 100644 index 0000000000..a47ad86504 --- /dev/null +++ b/keyboards/alps64/keymaps/crd/keymap.c @@ -0,0 +1,22 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* 0: qwerty */ + LAYOUT_all( + 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_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, + 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, 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, + MO(1), KC_LALT, KC_LGUI, KC_SPC, _______, KC_RGUI, KC_RALT, MO(2) + ), + /* 1: fn1 */ + LAYOUT_all( + _______, 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_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; + +const uint16_t PROGMEM fn_actions[] = {}; -- cgit v1.2.3 From 426c18b8c6fac83620de9ccedb4668dbb3a1ff40 Mon Sep 17 00:00:00 2001 From: Elliot Powell <32494740+e11i0t23@users.noreply.github.com> Date: Tue, 30 Oct 2018 21:55:22 +0000 Subject: Keyboard: add ep40 qmk support (#4291) * add initial ep40 files * fixed issues * updated keymap * Added media control * Update keyboards/handwired/ep40/rules.mk Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Fixed requested changes * Fixed more requested changes --- keyboards/handwired/ep40/config.h | 114 +++++++++++++++++++++ keyboards/handwired/ep40/ep40.c | 43 ++++++++ keyboards/handwired/ep40/ep40.h | 44 ++++++++ keyboards/handwired/ep40/info.json | 12 +++ keyboards/handwired/ep40/keymaps/default/keymap.c | 39 +++++++ keyboards/handwired/ep40/keymaps/default/readme.md | 1 + keyboards/handwired/ep40/readme.md | 15 +++ keyboards/handwired/ep40/rules.mk | 80 +++++++++++++++ 8 files changed, 348 insertions(+) create mode 100644 keyboards/handwired/ep40/config.h create mode 100644 keyboards/handwired/ep40/ep40.c create mode 100644 keyboards/handwired/ep40/ep40.h create mode 100644 keyboards/handwired/ep40/info.json create mode 100644 keyboards/handwired/ep40/keymaps/default/keymap.c create mode 100644 keyboards/handwired/ep40/keymaps/default/readme.md create mode 100644 keyboards/handwired/ep40/readme.md create mode 100644 keyboards/handwired/ep40/rules.mk diff --git a/keyboards/handwired/ep40/config.h b/keyboards/handwired/ep40/config.h new file mode 100644 index 0000000000..90630cd68d --- /dev/null +++ b/keyboards/handwired/ep40/config.h @@ -0,0 +1,114 @@ +/* +Copyright 2018 Elliot Powell + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4040 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ep40 +#define DESCRIPTION A simple 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C7, C6, B6, B5 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, D2, D3, D5, D4, D6, D7, B4 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) +/* + * 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/handwired/ep40/ep40.c b/keyboards/handwired/ep40/ep40.c new file mode 100644 index 0000000000..257f9fa807 --- /dev/null +++ b/keyboards/handwired/ep40/ep40.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include "ep40.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/handwired/ep40/ep40.h b/keyboards/handwired/ep40/ep40.h new file mode 100644 index 0000000000..30f3d15b4f --- /dev/null +++ b/keyboards/handwired/ep40/ep40.h @@ -0,0 +1,44 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#ifndef EP40_H +#define EP40_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxx KC_NO + +#define LAYOUT(\ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b,\ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1b,\ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b,\ + k30, k31, k32, k34, k36, k38, k39, k3a, k3b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b},\ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, xxx, k1b},\ + {k20, xxx, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b},\ + {k30, k31, k32, xxx, k34, xxx, k36, xxx, k38, k39, k3a, k3b} \ +} + +#endif diff --git a/keyboards/handwired/ep40/info.json b/keyboards/handwired/ep40/info.json new file mode 100644 index 0000000000..1c57ac6749 --- /dev/null +++ b/keyboards/handwired/ep40/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name":"ep40", + "url":null, + "maintainer":"e11i0t23", + "width":12, + "hight":4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1, "w":1.25}, {"x":1.25, "y":1}, {"x":2.25, "y":1}, {"x":3.25, "y":1}, {"x":4.25, "y":1}, {"x":5.25, "y":1}, {"x":6.25, "y":1}, {"x":7.25, "y":1}, {"x":8.25, "y":1}, {"x":9.25, "y":1}, {"x":10.25, "y":1, "w":1.75}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2, "w":1.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "w":2.25}, {"x":5.25, "y":3, "w":2.75}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + } + } +} diff --git a/keyboards/handwired/ep40/keymaps/default/keymap.c b/keyboards/handwired/ep40/keymaps/default/keymap.c new file mode 100644 index 0000000000..2d8a5d0592 --- /dev/null +++ b/keyboards/handwired/ep40/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + 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_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ + LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RGUI, MO(2), RCTL_T(KC_RBRC), KC_RALT \ + ), + + [1] = LAYOUT( /* Base */ + KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_DEL ,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + + [2] = LAYOUT( /* Base */ + 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS,\ + KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ + ), +}; diff --git a/keyboards/handwired/ep40/keymaps/default/readme.md b/keyboards/handwired/ep40/keymaps/default/readme.md new file mode 100644 index 0000000000..242c0afb93 --- /dev/null +++ b/keyboards/handwired/ep40/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for ep40 \ No newline at end of file diff --git a/keyboards/handwired/ep40/readme.md b/keyboards/handwired/ep40/readme.md new file mode 100644 index 0000000000..5acd8892dd --- /dev/null +++ b/keyboards/handwired/ep40/readme.md @@ -0,0 +1,15 @@ +# ep40 + +![ep40](https://i.imgur.com/Jl7w6I9.jpg) + +A simple 40% keyboard + +Keyboard Maintainer: [Elliot Powell](https://reddit.com/u/e11i0t23, https://github.com/e11i0t23) +Hardware Supported: EP40 PCB +Hardware Availability: None at the moment + +Make example for this keyboard (after setting up your build environment): + + make ep40: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/handwired/ep40/rules.mk b/keyboards/handwired/ep40/rules.mk new file mode 100644 index 0000000000..9ddf9717e9 --- /dev/null +++ b/keyboards/handwired/ep40/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # 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 = no # 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) -- cgit v1.2.3 From 685cec47bb4d10de2642690a71cb2566bceffccb Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Tue, 30 Oct 2018 17:30:09 -0700 Subject: Configurator info.json fix for KBD19x The info.json had a random backslash, which invalidated the JSON structure. This commit fixes that issue. --- keyboards/kbd19x/info.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/kbd19x/info.json b/keyboards/kbd19x/info.json index dd5cc700cc..31f2f9cf57 100644 --- a/keyboards/kbd19x/info.json +++ b/keyboards/kbd19x/info.json @@ -1,9 +1,9 @@ { - "keyboard_name": "KBD19x", - "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbd19x", - "maintainer": "qmk", - "width": 19.5, - "height": 6.75, + "keyboard_name": "KBD19x", + "url": "https://github.com/qmk/qmk_firmware/tree/master/keyboards/kbd19x", + "maintainer": "qmk", + "width": 19.5, + "height": 6.75, "layouts": { "LAYOUT_ansi": { "key_count": 99, @@ -61,7 +61,7 @@ {"label":"8", "x":16.5, "y":2.5}, {"label":"9", "x":17.5, "y":2.5}, {"label":"+", "x":18.5, "y":2.5, "h":2}, - {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75},\ + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, {"label":"A", "x":1.75, "y":3.5}, {"label":"S", "x":2.75, "y":3.5}, {"label":"D", "x":3.75, "y":3.5}, -- cgit v1.2.3 From d147cf5ecefe9846d6d6b68ced498a4444754b03 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Wed, 31 Oct 2018 14:07:34 +0000 Subject: Add support for planck/rev6 to dshields keymap. (#4304) --- keyboards/planck/keymaps/dshields/rules.mk | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 033e3c9c4e..300a827904 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -9,12 +9,20 @@ EXTRAKEY_ENABLE = no SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend API_SYSEX_ENABLE = no -ifneq (,$(findstring planck/light,$(KEYBOARD))) - AUDIO_ENABLE = yes - BACKLIGHT_ENABLE = no - RGB_MATRIX_ENABLE = yes -else - AUDIO_ENABLE = no - BACKLIGHT_ENABLE = yes - RGB_MATRIX_ENABLE = no +ifeq ($(strip $(KEYBOARD)), planck/rev3) + AUDIO_ENABLE = no + BACKLIGHT_ENABLE = yes + RGB_MATRIX_ENABLE = no endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) + EXTRALDFLAGS = -Wl,--build-id=none + AUDIO_ENABLE = yes + BACKLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = no +endif +ifeq ($(strip $(KEYBOARD)), planck/light) + AUDIO_ENABLE = yes + BACKLIGHT_ENABLE = no + RGB_MATRIX_ENABLE = yes +endif + -- cgit v1.2.3 From 75d657b5251c80b4d5a3de583d4ba97c10ac619f Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Tue, 30 Oct 2018 18:22:30 -0700 Subject: Configurator info.json fix for XD87 --- keyboards/xd87/info.json | 291 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 291 insertions(+) diff --git a/keyboards/xd87/info.json b/keyboards/xd87/info.json index e69de29bb2..3837358cd3 100644 --- a/keyboards/xd87/info.json +++ b/keyboards/xd87/info.json @@ -0,0 +1,291 @@ +{ + "keyboard_name": "XD87", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 7.25, + "layouts": { + "LAYOUT_all": { + "layout": [ + { "label": "K00", "x": 0, "y": 0 }, + { "label": "K01", "x": 1, "y": 0 }, + { "label": "K02", "x": 2, "y": 0 }, + { "label": "K03", "x": 3, "y": 0 }, + { "label": "K04", "x": 4, "y": 0 }, + { "label": "K05", "x": 5, "y": 0 }, + { "label": "K06", "x": 6.5, "y": 0 }, + { "label": "K07", "x": 7.5, "y": 0 }, + { "label": "K08", "x": 8.5, "y": 0 }, + { "label": "K09", "x": 9.5, "y": 0 }, + { "label": "K0A", "x": 11, "y": 0 }, + { "label": "K0B", "x": 12, "y": 0 }, + { "label": "K0C", "x": 13, "y": 0 }, + { "label": "K0D", "x": 14, "y": 0 }, + { "label": "K0E", "x": 15.25, "y": 0 }, + { "label": "K0F", "x": 16.25, "y": 0 }, + { "label": "K0G", "x": 17.25, "y": 0 }, + { "label": "K10", "x": 0, "y": 1.25 }, + { "label": "K11", "x": 1, "y": 1.25 }, + { "label": "K12", "x": 2, "y": 1.25 }, + { "label": "K13", "x": 3, "y": 1.25 }, + { "label": "K14", "x": 4, "y": 1.25 }, + { "label": "K15", "x": 5, "y": 1.25 }, + { "label": "K16", "x": 6, "y": 1.25 }, + { "label": "K17", "x": 7, "y": 1.25 }, + { "label": "K18", "x": 8, "y": 1.25 }, + { "label": "K19", "x": 9, "y": 1.25 }, + { "label": "K1A", "x": 10, "y": 1.25 }, + { "label": "K1B", "x": 11, "y": 1.25 }, + { "label": "K1C", "x": 12, "y": 1.25 }, + { "label": "K1D", "x": 13, "y": 1.25 }, + { "label": "K3E", "x": 14, "y": 1.25 }, + { "label": "K1E", "x": 15.25, "y": 1.25 }, + { "label": "K1F", "x": 16.25, "y": 1.25 }, + { "label": "K1G", "x": 17.25, "y": 1.25 }, + { "label": "K20", "x": 0, "y": 2.25, "w": 1.5 }, + { "label": "K21", "x": 1.5, "y": 2.25 }, + { "label": "K22", "x": 2.5, "y": 2.25 }, + { "label": "K23", "x": 3.5, "y": 2.25 }, + { "label": "K24", "x": 4.5, "y": 2.25 }, + { "label": "K25", "x": 5.5, "y": 2.25 }, + { "label": "K26", "x": 6.5, "y": 2.25 }, + { "label": "K27", "x": 7.5, "y": 2.25 }, + { "label": "K28", "x": 8.5, "y": 2.25 }, + { "label": "K29", "x": 9.5, "y": 2.25 }, + { "label": "K2A", "x": 10.5, "y": 2.25 }, + { "label": "K2B", "x": 11.5, "y": 2.25 }, + { "label": "K2C", "x": 12.5, "y": 2.25 }, + { "label": "K2D", "x": 13.5, "y": 2.25, "w": 1.5 }, + { "label": "K2E", "x": 15.25, "y": 2.25 }, + { "label": "K2F", "x": 16.25, "y": 2.25 }, + { "label": "K2G", "x": 17.25, "y": 2.25 }, + { "label": "K30", "x": 0, "y": 3.25, "w": 1.75 }, + { "label": "K31", "x": 1.75, "y": 3.25 }, + { "label": "K32", "x": 2.75, "y": 3.25 }, + { "label": "K33", "x": 3.75, "y": 3.25 }, + { "label": "K34", "x": 4.75, "y": 3.25 }, + { "label": "K35", "x": 5.75, "y": 3.25 }, + { "label": "K36", "x": 6.75, "y": 3.25 }, + { "label": "K37", "x": 7.75, "y": 3.25 }, + { "label": "K38", "x": 8.75, "y": 3.25 }, + { "label": "K39", "x": 9.75, "y": 3.25 }, + { "label": "K3A", "x": 10.75, "y": 3.25 }, + { "label": "K3B", "x": 11.75, "y": 3.25 }, + { "label": "K3C", "x": 12.75, "y": 3.25 }, + { "label": "K3D", "x": 13.75, "y": 3.25, "w": 1.25 }, + { "label": "K40", "x": 0, "y": 4.25, "w": 1.25 }, + { "label": "K41", "x": 1.25, "y": 4.25 }, + { "label": "K42", "x": 2.25, "y": 4.25 }, + { "label": "K43", "x": 3.25, "y": 4.25 }, + { "label": "K44", "x": 4.25, "y": 4.25 }, + { "label": "K45", "x": 5.25, "y": 4.25 }, + { "label": "K46", "x": 6.25, "y": 4.25 }, + { "label": "K47", "x": 7.25, "y": 4.25 }, + { "label": "K48", "x": 8.25, "y": 4.25 }, + { "label": "K49", "x": 9.25, "y": 4.25 }, + { "label": "K4A", "x": 10.25, "y": 4.25 }, + { "label": "K4B", "x": 11.25, "y": 4.25 }, + { "label": "K4C", "x": 12.25, "y": 4.25, "w": 1.75 }, + { "label": "K4D", "x": 14, "y": 4.25 }, + { "label": "K4E", "x": 15.25, "y": 4.25 }, + { "label": "K4F", "x": 16.25, "y": 4.25 }, + { "label": "K4G", "x": 17.25, "y": 4.25 }, + { "label": "K50", "x": 0, "y": 5.25, "w": 1.5 }, + { "label": "K51", "x": 1.5, "y": 5.25 }, + { "label": "K52", "x": 2.5, "y": 5.25, "w": 1.5 }, + { "label": "K55", "x": 4, "y": 5.25, "w": 3 }, + { "label": "K58", "x": 7, "y": 5.25, "w": 3 }, + { "label": "K5A", "x": 10, "y": 5.25, "w": 1.25 }, + { "label": "K5B", "x": 11.25, "y": 5.25, "w": 1.25 }, + { "label": "K5C", "x": 12.5, "y": 5.25, "w": 1.25 }, + { "label": "K5D", "x": 13.75, "y": 5.25, "w": 1.25 }, + { "label": "K5E", "x": 15.25, "y": 5.25 }, + { "label": "K5F", "x": 16.25, "y": 5.25 }, + { "label": "K5G", "x": 17.25, "y": 5.25 } + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "F1", "x": 2, "y": 0 }, + { "label": "F2", "x": 3, "y": 0 }, + { "label": "F3", "x": 4, "y": 0 }, + { "label": "F4", "x": 5, "y": 0 }, + { "label": "F5", "x": 6.5, "y": 0 }, + { "label": "F6", "x": 7.5, "y": 0 }, + { "label": "F7", "x": 8.5, "y": 0 }, + { "label": "F8", "x": 9.5, "y": 0 }, + { "label": "F9", "x": 11, "y": 0 }, + { "label": "F10", "x": 12, "y": 0 }, + { "label": "F11", "x": 13, "y": 0 }, + { "label": "F12", "x": 14, "y": 0 }, + { "label": "Print Screen", "x": 15.25, "y": 0 }, + { "label": "Scroll Lock", "x": 16.25, "y": 0 }, + { "label": "Pause", "x": 17.25, "y": 0 }, + { "label": "`", "x": 0, "y": 1.25 }, + { "label": "1", "x": 1, "y": 1.25 }, + { "label": "2", "x": 2, "y": 1.25 }, + { "label": "3", "x": 3, "y": 1.25 }, + { "label": "4", "x": 4, "y": 1.25 }, + { "label": "5", "x": 5, "y": 1.25 }, + { "label": "6", "x": 6, "y": 1.25 }, + { "label": "7", "x": 7, "y": 1.25 }, + { "label": "8", "x": 8, "y": 1.25 }, + { "label": "9", "x": 9, "y": 1.25 }, + { "label": "0", "x": 10, "y": 1.25 }, + { "label": "-", "x": 11, "y": 1.25 }, + { "label": "=", "x": 12, "y": 1.25 }, + { "label": "Backspace", "x": 13, "y": 1.25, "w": 2 }, + { "label": "Insert", "x": 15.25, "y": 1.25 }, + { "label": "Home", "x": 16.25, "y": 1.25 }, + { "label": "PgUp", "x": 17.25, "y": 1.25 }, + { "label": "Tab", "x": 0, "y": 2.25, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 2.25 }, + { "label": "W", "x": 2.5, "y": 2.25 }, + { "label": "E", "x": 3.5, "y": 2.25 }, + { "label": "R", "x": 4.5, "y": 2.25 }, + { "label": "T", "x": 5.5, "y": 2.25 }, + { "label": "Y", "x": 6.5, "y": 2.25 }, + { "label": "U", "x": 7.5, "y": 2.25 }, + { "label": "I", "x": 8.5, "y": 2.25 }, + { "label": "O", "x": 9.5, "y": 2.25 }, + { "label": "P", "x": 10.5, "y": 2.25 }, + { "label": "[", "x": 11.5, "y": 2.25 }, + { "label": "]", "x": 12.5, "y": 2.25 }, + { "label": "\\", "x": 13.5, "y": 2.25, "w": 1.5 }, + { "label": "Delete", "x": 15.25, "y": 2.25 }, + { "label": "End", "x": 16.25, "y": 2.25 }, + { "label": "PgDn", "x": 17.25, "y": 2.25 }, + { "label": "Caps Lock", "x": 0, "y": 3.25, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 3.25 }, + { "label": "S", "x": 2.75, "y": 3.25 }, + { "label": "D", "x": 3.75, "y": 3.25 }, + { "label": "F", "x": 4.75, "y": 3.25 }, + { "label": "G", "x": 5.75, "y": 3.25 }, + { "label": "H", "x": 6.75, "y": 3.25 }, + { "label": "J", "x": 7.75, "y": 3.25 }, + { "label": "K", "x": 8.75, "y": 3.25 }, + { "label": "L", "x": 9.75, "y": 3.25 }, + { "label": ";", "x": 10.75, "y": 3.25 }, + { "label": "'", "x": 11.75, "y": 3.25 }, + { "label": "Enter", "x": 12.75, "y": 3.25, "w": 2.25 }, + { "label": "Shift", "x": 0, "y": 4.25, "w": 2.25 }, + { "label": "Z", "x": 2.25, "y": 4.25 }, + { "label": "X", "x": 3.25, "y": 4.25 }, + { "label": "C", "x": 4.25, "y": 4.25 }, + { "label": "V", "x": 5.25, "y": 4.25 }, + { "label": "B", "x": 6.25, "y": 4.25 }, + { "label": "N", "x": 7.25, "y": 4.25 }, + { "label": "M", "x": 8.25, "y": 4.25 }, + { "label": ",", "x": 9.25, "y": 4.25 }, + { "label": ".", "x": 10.25, "y": 4.25 }, + { "label": "/", "x": 11.25, "y": 4.25 }, + { "label": "Shift", "x": 12.25, "y": 4.25, "w": 2.75 }, + { "label": "Up", "x": 16.25, "y": 4.25 }, + { "label": "Ctrl", "x": 0, "y": 5.25, "w": 1.25 }, + { "label": "Win", "x": 1.25, "y": 5.25, "w": 1.25 }, + { "label": "Alt", "x": 2.5, "y": 5.25, "w": 1.25 }, + { "label": "Space", "x": 3.75, "y": 5.25, "w": 6.25 }, + { "label": "Alt", "x": 10, "y": 5.25, "w": 1.25 }, + { "label": "Win", "x": 11.25, "y": 5.25, "w": 1.25 }, + { "label": "Menu", "x": 12.5, "y": 5.25, "w": 1.25 }, + { "label": "Ctrl", "x": 13.75, "y": 5.25, "w": 1.25 }, + { "label": "Left", "x": 15.25, "y": 5.25 }, + { "label": "Down", "x": 16.25, "y": 5.25 }, + { "label": "Right", "x": 17.25, "y": 5.25 } + ] + }, + "LAYOUT_tkl_iso": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "F1", "x": 2, "y": 0 }, + { "label": "F2", "x": 3, "y": 0 }, + { "label": "F3", "x": 4, "y": 0 }, + { "label": "F4", "x": 5, "y": 0 }, + { "label": "F5", "x": 6.5, "y": 0 }, + { "label": "F6", "x": 7.5, "y": 0 }, + { "label": "F7", "x": 8.5, "y": 0 }, + { "label": "F8", "x": 9.5, "y": 0 }, + { "label": "F9", "x": 11, "y": 0 }, + { "label": "F10", "x": 12, "y": 0 }, + { "label": "F11", "x": 13, "y": 0 }, + { "label": "F12", "x": 14, "y": 0 }, + { "label": "Print Screen", "x": 15.25, "y": 0 }, + { "label": "Scroll Lock", "x": 16.25, "y": 0 }, + { "label": "Pause", "x": 17.25, "y": 0 }, + { "label": "`", "x": 0, "y": 1.25 }, + { "label": "1", "x": 1, "y": 1.25 }, + { "label": "2", "x": 2, "y": 1.25 }, + { "label": "3", "x": 3, "y": 1.25 }, + { "label": "4", "x": 4, "y": 1.25 }, + { "label": "5", "x": 5, "y": 1.25 }, + { "label": "6", "x": 6, "y": 1.25 }, + { "label": "7", "x": 7, "y": 1.25 }, + { "label": "8", "x": 8, "y": 1.25 }, + { "label": "9", "x": 9, "y": 1.25 }, + { "label": "0", "x": 10, "y": 1.25 }, + { "label": "-", "x": 11, "y": 1.25 }, + { "label": "=", "x": 12, "y": 1.25 }, + { "label": "Backspace", "x": 13, "y": 1.25, "w": 2 }, + { "label": "Insert", "x": 15.25, "y": 1.25 }, + { "label": "Home", "x": 16.25, "y": 1.25 }, + { "label": "PgUp", "x": 17.25, "y": 1.25 }, + { "label": "Tab", "x": 0, "y": 2.25, "w": 1.5 }, + { "label": "Q", "x": 1.5, "y": 2.25 }, + { "label": "W", "x": 2.5, "y": 2.25 }, + { "label": "E", "x": 3.5, "y": 2.25 }, + { "label": "R", "x": 4.5, "y": 2.25 }, + { "label": "T", "x": 5.5, "y": 2.25 }, + { "label": "Y", "x": 6.5, "y": 2.25 }, + { "label": "U", "x": 7.5, "y": 2.25 }, + { "label": "I", "x": 8.5, "y": 2.25 }, + { "label": "O", "x": 9.5, "y": 2.25 }, + { "label": "P", "x": 10.5, "y": 2.25 }, + { "label": "[", "x": 11.5, "y": 2.25 }, + { "label": "]", "x": 12.5, "y": 2.25 }, + { "label": "Delete", "x": 15.25, "y": 2.25 }, + { "label": "End", "x": 16.25, "y": 2.25 }, + { "label": "PgDn", "x": 17.25, "y": 2.25 }, + { "label": "Caps Lock", "x": 0, "y": 3.25, "w": 1.75 }, + { "label": "A", "x": 1.75, "y": 3.25 }, + { "label": "S", "x": 2.75, "y": 3.25 }, + { "label": "D", "x": 3.75, "y": 3.25 }, + { "label": "F", "x": 4.75, "y": 3.25 }, + { "label": "G", "x": 5.75, "y": 3.25 }, + { "label": "H", "x": 6.75, "y": 3.25 }, + { "label": "J", "x": 7.75, "y": 3.25 }, + { "label": "K", "x": 8.75, "y": 3.25 }, + { "label": "L", "x": 9.75, "y": 3.25 }, + { "label": ";", "x": 10.75, "y": 3.25 }, + { "label": "'", "x": 11.75, "y": 3.25 }, + { "label": "#", "x": 12.75, "y": 3.25 }, + { "label": "Enter", "x": 13.75, "y": 2.25, "w": 1.25, "h": 2 }, + { "label": "Shift", "x": 0, "y": 4.25, "w": 1.25 }, + { "label": "\\", "x": 1.25, "y": 4.25 }, + { "label": "Z", "x": 2.25, "y": 4.25 }, + { "label": "X", "x": 3.25, "y": 4.25 }, + { "label": "C", "x": 4.25, "y": 4.25 }, + { "label": "V", "x": 5.25, "y": 4.25 }, + { "label": "B", "x": 6.25, "y": 4.25 }, + { "label": "N", "x": 7.25, "y": 4.25 }, + { "label": "M", "x": 8.25, "y": 4.25 }, + { "label": ",", "x": 9.25, "y": 4.25 }, + { "label": ".", "x": 10.25, "y": 4.25 }, + { "label": "/", "x": 11.25, "y": 4.25 }, + { "label": "Shift", "x": 12.25, "y": 4.25, "w": 2.75 }, + { "label": "Up", "x": 16.25, "y": 4.25 }, + { "label": "Ctrl", "x": 0, "y": 5.25, "w": 1.25 }, + { "label": "Win", "x": 1.25, "y": 5.25, "w": 1.25 }, + { "label": "Alt", "x": 2.5, "y": 5.25, "w": 1.25 }, + { "label": "Space", "x": 3.75, "y": 5.25, "w": 6.25 }, + { "label": "AltGr", "x": 10, "y": 5.25, "w": 1.25 }, + { "label": "Win", "x": 11.25, "y": 5.25, "w": 1.25 }, + { "label": "Menu", "x": 12.5, "y": 5.25, "w": 1.25 }, + { "label": "Ctrl", "x": 13.75, "y": 5.25, "w": 1.25 }, + { "label": "Left", "x": 15.25, "y": 5.25 }, + { "label": "Down", "x": 16.25, "y": 5.25 }, + { "label": "Right", "x": 17.25, "y": 5.25 } + ] + } + } +} -- cgit v1.2.3 From 5630ad7604f7a8243ef9b643a4409fc8f9f96ed0 Mon Sep 17 00:00:00 2001 From: That-Canadian Date: Wed, 31 Oct 2018 17:42:15 -0400 Subject: Added JTAG disable code to the split_common (#4309) Added JTAG disable code to the split_common slave code since the slave never calls keyboard_init(). In the future the slave should likely be modified to call keyboard_init() in some way, but without calling any of the unnecessary USB initialization code. --- quantum/split_common/split_util.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 7c87de4d9b..7ca68c56cd 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -93,6 +93,10 @@ void split_keyboard_setup(void) { } void keyboard_slave_loop(void) { + // Disable JTAG since we skip calling keyboard_init() on the slave side + // Future fix will possible call keyboard_init() on the slave to remove this need + disable_JTAG(); + matrix_init(); //Init RGB @@ -152,3 +156,13 @@ void matrix_setup(void) { keyboard_slave_loop(); } } + +// Temporary code to disable JTAG on the slave board +void disable_JTAG(void) { + /* Copied from tmk_core/common/keybaord.c */ + // To use PORTF disable JTAG with writing JTD bit twice within four cycles. + #if (defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB1287__) || defined(__AVR_ATmega32U4__)) + MCUCR |= _BV(JTD); + MCUCR |= _BV(JTD); + #endif +} -- cgit v1.2.3 From bd6d6d93f26578baf7ef1d05d51963d8c38ee7c9 Mon Sep 17 00:00:00 2001 From: Danny Date: Wed, 31 Oct 2018 17:43:39 -0400 Subject: Update iris 3 (#4307) * Fix incorrect LED pin assignment * Strip out extra newline --- keyboards/iris/rev1/config.h | 1 - keyboards/iris/rev1_led/config.h | 1 - keyboards/iris/rev2/config.h | 1 - keyboards/iris/rev3/config.h | 3 +-- 4 files changed, 1 insertion(+), 5 deletions(-) diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index 3c088f6711..7f76df54ba 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -63,7 +63,6 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h index d8571f8daf..b58b11836a 100644 --- a/keyboards/iris/rev1_led/config.h +++ b/keyboards/iris/rev1_led/config.h @@ -63,7 +63,6 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 087e0f69e5..266c29b9c9 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -63,7 +63,6 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - #define RGBLED_NUM 12 // Number of LEDs /* diff --git a/keyboards/iris/rev3/config.h b/keyboards/iris/rev3/config.h index 3329a4edb2..1032231d89 100644 --- a/keyboards/iris/rev3/config.h +++ b/keyboards/iris/rev3/config.h @@ -58,12 +58,11 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -#define BACKLIGHT_PIN B5 +#define BACKLIGHT_PIN B6 #define BACKLIGHT_LEVELS 5 /* ws2812 RGB LED */ #define RGB_DI_PIN F7 - #define RGBLED_NUM 12 // Number of LEDs /* -- cgit v1.2.3 From f63c0b784490a04069b59f1b77355d5982f55ceb Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 31 Oct 2018 15:14:59 -0700 Subject: Add pointer(?) to disable_JTAG to prevent compiler errors (#4310) --- quantum/split_common/split_util.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 7ca68c56cd..8d39329d46 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -92,13 +92,14 @@ void split_keyboard_setup(void) { sei(); } +void disable_JTAG(void); void keyboard_slave_loop(void) { // Disable JTAG since we skip calling keyboard_init() on the slave side // Future fix will possible call keyboard_init() on the slave to remove this need disable_JTAG(); - + matrix_init(); - + //Init RGB #ifdef RGBLIGHT_ENABLE rgblight_init(); @@ -107,7 +108,7 @@ void keyboard_slave_loop(void) { while (1) { // Matrix Slave Scan matrix_slave_scan(); - + // Read Backlight Info #ifdef BACKLIGHT_ENABLE #ifdef USE_I2C @@ -126,14 +127,14 @@ void keyboard_slave_loop(void) { // Disable interupts (RGB data is big) cli(); // Create new DWORD for RGB data - uint32_t dword; - + uint32_t dword; + // Fill the new DWORD with the data that was sent over uint8_t *dword_dat = (uint8_t *)(&dword); for (int i = 0; i < 4; i++) { dword_dat[i] = i2c_slave_buffer[I2C_RGB_START+i]; } - + // Update the RGB now with the new data and set RGB_DIRTY to false rgblight_update_dword(dword); RGB_DIRTY = false; -- cgit v1.2.3 From 99740c670a4ece47095ec91d2ca71e56d7dd244c Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Wed, 31 Oct 2018 22:27:57 -0700 Subject: Add some more useful features to my alps64 AEK layout (#4312) * Add mod-tap to right mods and shift * Add del to fn1 layer and add fn2 layer for media and pcb debug --- keyboards/alps64/keymaps/crd/keymap.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/keyboards/alps64/keymaps/crd/keymap.c b/keyboards/alps64/keymaps/crd/keymap.c index a47ad86504..4f3ea446ec 100644 --- a/keyboards/alps64/keymaps/crd/keymap.c +++ b/keyboards/alps64/keymaps/crd/keymap.c @@ -6,17 +6,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_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, 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, 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, - MO(1), KC_LALT, KC_LGUI, KC_SPC, _______, KC_RGUI, KC_RALT, MO(2) + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_UP), _______, + MO(1), KC_LALT, KC_LGUI, KC_SPC, _______, RGUI_T(KC_LEFT), RALT_T(KC_DOWN), LT(2, KC_RIGHT) ), /* 1: fn1 */ LAYOUT_all( - _______, 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_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -}; + /* 2: fn2 */ + LAYOUT_all( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, + _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +} +; const uint16_t PROGMEM fn_actions[] = {}; -- cgit v1.2.3 From 153d1ecfcc60ad84139cd95a03d08e0e4b7d11ec Mon Sep 17 00:00:00 2001 From: Jason Yamada-Hanff Date: Thu, 1 Nov 2018 16:52:47 -0700 Subject: Keymap: add jyh levinson keymaps (#4284) * Keymap: add jyh levinson keymaps remove tap dance number keys due to sluggish responses simplify I2C configuration reverse hyper and meh positions reduce tapping term to allow fast typing with mod tap space keys remove Alt hold on right space key. too many false touches. add vim-style arrows (hjkl) on asdf; semicolon/quote on raise correct documentation string for jyh levinson layout add alternative levinson layout for jyh more inspiration from atreus keyboard. keeps shift in the expected places. reduces number of layers. puts numpad layout easily accessible. places important keys on palms and meta keys on top corners for xmonad. correct layer switching in jyh2 levinson layout I was getting stuck on the numpad layer because the numpad hold key was remapped once the layer was activated. Bad idea. Minor other refinements. use curly bracket { instead of brace [ on raise layer add RGB keys on adjust layer bootmagic key is confusing. turn it off. try out permissive hold setting to make mod-tap better remove hold for right control on quote key. too many mistakes turn off permissive hold. it was causing unexpected behavior enable rgb underglow animations add make it pink/blue key to levinson layout prevent stuck modifiers in jyh2 levinson keymap * fix up deprecated code after code review * remove PREVENT_STUCK_MODIFIERS because it is default Co-Authored-By: yamad --- keyboards/levinson/keymaps/jyh/config.h | 29 ++++ keyboards/levinson/keymaps/jyh/keymap.c | 215 +++++++++++++++++++++++++++++ keyboards/levinson/keymaps/jyh/readme.md | 32 +++++ keyboards/levinson/keymaps/jyh/rules.mk | 1 + keyboards/levinson/keymaps/jyh2/config.h | 33 +++++ keyboards/levinson/keymaps/jyh2/keymap.c | 222 ++++++++++++++++++++++++++++++ keyboards/levinson/keymaps/jyh2/readme.md | 32 +++++ keyboards/levinson/keymaps/jyh2/rules.mk | 2 + 8 files changed, 566 insertions(+) create mode 100644 keyboards/levinson/keymaps/jyh/config.h create mode 100644 keyboards/levinson/keymaps/jyh/keymap.c create mode 100644 keyboards/levinson/keymaps/jyh/readme.md create mode 100644 keyboards/levinson/keymaps/jyh/rules.mk create mode 100644 keyboards/levinson/keymaps/jyh2/config.h create mode 100644 keyboards/levinson/keymaps/jyh2/keymap.c create mode 100644 keyboards/levinson/keymaps/jyh2/readme.md create mode 100644 keyboards/levinson/keymaps/jyh2/rules.mk diff --git a/keyboards/levinson/keymaps/jyh/config.h b/keyboards/levinson/keymaps/jyh/config.h new file mode 100644 index 0000000000..d3e598bd09 --- /dev/null +++ b/keyboards/levinson/keymaps/jyh/config.h @@ -0,0 +1,29 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Select hand configuration */ +#define MASTER_LEFT + +/* Tap Dance timing */ +#define TAPPING_TERM 150 + +/* Toggling layer requires # taps */ +#define TAPPING_TOGGLE 2 diff --git a/keyboards/levinson/keymaps/jyh/keymap.c b/keyboards/levinson/keymaps/jyh/keymap.c new file mode 100644 index 0000000000..d8cfa7e06b --- /dev/null +++ b/keyboards/levinson/keymaps/jyh/keymap.c @@ -0,0 +1,215 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 3 /* Symbols, Media */ +#define _RAISE 4 /* Numbers, Arrows */ +#define _FUNC 5 /* Function Keys */ +#define _NUMS 6 /* Numpad */ +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +// Fillers to make layering more clear +#define KC_ KC_TRNS + +// tap toggle numpad on +#define NUMPAD TT(_NUMS) + +// Mod Tap Definitions +// ------------------- + // Tap Hold + // ------------------ +#define CTL_ESC MT(MOD_LCTL, KC_ESC) // Esc Left Control +#define SFT_ENT MT(MOD_RSFT, KC_ENT) // Enter Right Shift +#define CTL_SPC MT(MOD_LCTL, KC_SPC) // Space Left Control +#define ALT_SPC MT(MOD_LALT, KC_SPC) // Space Left Alt +#define ALT_BSP MT(MOD_LALT, KC_BSPC) // Bkspace Left Alt +#define HPR_TAB MT(MOD_HYPR, KC_TAB) // Tab Hyper (Super+Ctrl+Alt+Shift) +#define HPR_GRV MT(MOD_HYPR, KC_GRV) // ` Hyper +#define HPR_TIL MT(MOD_HYPR, KC_TILD) // ~ Hyper +#define MEH_TIL MT(MOD_MEH, KC_GRV) // ` Meh (Ctrl+Alt+Shift) +#define SFT_MIN MT(MOD_LSFT, KC_MINS) // - Left Shift +#define NPD_UND LT(_NUMS, KC_UNDS) // _ Layer Numpad +#define FNC_PIP LT(_FUNC, KC_PIPE) // | Layer Function Keys + +#define CTL_DEL MT(MOD_LCTL, KC_DEL) // Del Left Control +#define CTL_QOT MT(MOD_RCTL, KC_QUOT) // ' Right Control +#define CTL_BSL MT(MOD_RCTL, KC_BSLS) // \ Right Control +#define CTL_PIP MT(MOD_RCTL, KC_PIPE) // | Right Control + +// Redefine for LAYOUT_kc +#define KC_CTL_BSL CTL_BSL +#define KC_CTL_PIP CTL_PIP +#define KC_CTL_DEL CTL_DEL +#define KC_HPR_TIL HPR_TIL +#define KC_HPR_GRV HPR_GRV + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | - | Z | X | C | V | B | | N | M | , | . | / | Enter| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Numpd| Meh | Meta | Alt | Lower| Space| | Space| Raise| Alt | Meta | Hyper| Func | + * `-----------------------------------------' `-----------------------------------------' + * + * with Hold (Emacs-oriented) + * ,-----------------------------------------. ,-----------------------------------------. + * | Hyper| | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | | | | | | | | | | | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | Shift| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_4x12( + HPR_TAB, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_BSPC, + CTL_ESC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, CTL_QOT, + SFT_MIN, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, SFT_ENT, + NUMPAD , KC_MEH , KC_LGUI, KC_LALT, LOWER, CTL_SPC, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_HYPR, MO(_FUNC) + ), + + +/* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Left | Up | Down | Right| ( | | ) | - | = | [ | ] | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | ; | ' | * | , | { | | } | _ | + | . | / | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT_kc_ortho_4x12( + HPR_GRV, 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , + ,LEFT, UP ,DOWN,RGHT,LPRN, RPRN,MINS, EQL,LBRC,RBRC,CTL_PIP, + ,COLN,QUOT,ASTR,COMM,LCBR, RCBR,UNDS,PLUS, , , , + , , , , , , , , , , , + ), + +/* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | Vol+ | Mute | Play | PgUp | : | | ' | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Vol- | < M | M > | PgDn | ; | | " | | | , | . | / | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT_kc_ortho_4x12( + HPR_TIL,EXLM, AT ,HASH,DLR , PERC , CIRC,AMPR,ASTR,LPRN,RPRN, , + CTL_DEL,VOLU,MUTE,MPLY,PGUP, COLN , QUOT,MINS, EQL,LBRC,RBRC,CTL_BSL, + ,VOLD,MPRV,MNXT,PGDN, SCLN , DQUO,PIPE,COMM, DOT,SLSH, , + , , , , , , , , , , , + ), + + [_FUNC] = LAYOUT_kc_ortho_4x12( +// ,----+----+----+----+----+----. ,----+----+----+----+----+----. + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 , F10, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , F21, F22, F23, F24, NO , NO , NO , NO , NO , NO , , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , +// `----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_NUMS] = LAYOUT_kc_ortho_4x12( +// ,----+----+----+----+----+----. ,----+----+----+----+----+----. + , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 ,SLSH, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + ,CAPS, INS,HOME,PGUP,LPRN, RPRN, 4 , 5 , 6 ,ASTR, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + ,NLCK, DEL, END,PGDN,SCLN, COMM, 1 , 2 , 3 ,MINS, , +// |----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , 0 ,DOT ,EQL ,PLUS, +// `----+----+----+----+----+----' `----+----+----+----+----+----' + ), + + [_ADJUST] = LAYOUT_ortho_4x12( +// ,-------+--------+--------+--------+--------+--------. ,-------+--------+--------+--------+--------+--------. + RESET , XXXXXXX, KC_UP , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DEL , \ +// |-------+--------+--------+--------+--------+--------| |-------+--------+--------+--------+--------+--------| + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, BL_TOGG, BL_STEP, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ +// |-------+--------+--------+--------+--------+--------| |-------+--------+--------+--------+--------+--------| + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, \ +// |-------+--------+--------+--------+--------+--------| |-------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +// `-------+--------+--------+--------+--------+--------' `-------+--------+--------+--------+--------+--------, + ) + +/* + * ,-----------------------------------------. ,-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/jyh/readme.md b/keyboards/levinson/keymaps/jyh/readme.md new file mode 100644 index 0000000000..e20424e518 --- /dev/null +++ b/keyboards/levinson/keymaps/jyh/readme.md @@ -0,0 +1,32 @@ +# jyh's levinson layout + +[Levinson](https://keeb.io/products/levinson-lets-split-w-led-backlight) +built on rev2 PCBs. A split 4x12 keyboard with LED backlights. + +The layout is oriented towards needs for programming, Emacs, XMonad, +and experience with 60% keyboards with no base layer arrow keys +(Poker). It makes heavy use of modifiers and layers. + +## Layout features + + * Extensive use of _Mod Tap_, e.g. + * Tap sends Esc, Hold sends Left Control + * Tap sends Enter, Hold sends Right Shift + * ... and many more + * Hyper and Meh keys + * Right modifier keys in place of arrow keys + * Arrows are instead available in two alternate locations: + * WASD arrows on _Adjust_ + * Arrow cluster on _Raise_ (inspired by hexwire) + * Centered symbol/bracket cluster on _Lower/Raise_ + * Inspired by hexwire layout + * Programming-oriented + * Spacebar sends modifier keys on hold (_this is finicky in practice. may shut off completely_) + * Control ~~and Alt/Meta~~ on left ~~and right~~ space, respectively + * Strict space available on _Function_ and _Numpad_ layers + * For Emacs keychords + * Extra dedicated layers + * Numpad (available with tap toggle) + * Function key (F01-24) + * Redunant keys where it is convenient to have characters together + on one layer diff --git a/keyboards/levinson/keymaps/jyh/rules.mk b/keyboards/levinson/keymaps/jyh/rules.mk new file mode 100644 index 0000000000..66110cfcc0 --- /dev/null +++ b/keyboards/levinson/keymaps/jyh/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE=yes diff --git a/keyboards/levinson/keymaps/jyh2/config.h b/keyboards/levinson/keymaps/jyh2/config.h new file mode 100644 index 0000000000..f50674bb88 --- /dev/null +++ b/keyboards/levinson/keymaps/jyh2/config.h @@ -0,0 +1,33 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +/* Select hand configuration */ +#define MASTER_LEFT + +/* Tap Dance timing */ +#define TAPPING_TERM 150 + +/* Toggling layer requires # taps */ +#define TAPPING_TOGGLE 3 + +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 12 + diff --git a/keyboards/levinson/keymaps/jyh2/keymap.c b/keyboards/levinson/keymaps/jyh2/keymap.c new file mode 100644 index 0000000000..4b7442928e --- /dev/null +++ b/keyboards/levinson/keymaps/jyh2/keymap.c @@ -0,0 +1,222 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _QWERTY 0 +#define _LOWER 3 /* Symbols, Media */ +#define _RAISE 4 /* Numbers, Arrows */ +#define _FUNC 5 /* Function Keys */ +#define _NUMS 6 /* Numpad */ +#define _ADJUST 16 + +/* short layer aliases */ +#define _QW _QWERTY +#define _LW _LOWER +#define _RS _RAISE +#define _NM _NUMS +#define _AD _ADJUST + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + MKITPNK, + DYNAMIC_MACRO_RANGE +}; + +#include "dynamic_macro.h" + +#define DREC_1 DYN_REC_START1 +#define DREC_2 DYN_REC_START2 +#define DPLAY_1 DYN_MACRO_PLAY1 +#define DPLAY_2 DYN_MACRO_PLAY2 +#define DSTOP DYN_REC_STOP + + +// Mod Tap Definitions +// ------------------- + // Tap Hold + // ------------------ +#define GUI_GRV MT(MOD_LGUI, KC_GRV) // ` Meta +#define CTL_ESC MT(MOD_LCTL, KC_ESC) // Esc Left Control +#define SFT_MIN MT(MOD_LSFT, KC_MINS) // - Left Shift +#define MEH_LBC MT(MOD_MEH, KC_LBRC) // [ Meh +#define CTL_BSP MT(MOD_LCTL, KC_BSPC) // Bkspce Left Control +#define HPR_RBC MT(MOD_HYPR, KC_RBRC) // ] Hyper +#define SFT_EQL MT(MOD_RSFT, KC_EQL) // = Right Shift +#define GUI_BSL MT(MOD_RGUI, KC_BSLS) // \ Meta + +#define NUM_TAB LT(_NUMS, KC_TAB) // Tab Layer Numpad + +#define CTL_DEL MT(MOD_LCTL, KC_DEL) // Del Left Control + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | - | Z | X | C | V | B | | N | M | , | . | / | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Tab | [ | Meta | Alt | Lower| Bksp | | Space| Raise| Alt | Meta | ] | Enter| + * `-----------------------------------------' `-----------------------------------------' + * with Hold (Emacs-oriented) + * ,-----------------------------------------. ,-----------------------------------------. + * | Meta | | | | | | | | | | | | Meta | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | | | | | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| | | | | | | | | | | | Shift| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Numpd| Meh | | | | Ctrl | | | | | | Hyper| | + * `-----------------------------------------' `-----------------------------------------' + */ + [_QW] = LAYOUT_ortho_4x12( + GUI_GRV, KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , GUI_BSL, + CTL_ESC, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, + SFT_MIN, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, SFT_EQL, + NUM_TAB, MEH_LBC, KC_LGUI, KC_LALT, LOWER , CTL_BSP, KC_SPC , RAISE , KC_RALT, KC_RGUI, HPR_RBC, KC_ENT + ), + +/* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Left | Up | Down | Right| ; | | ' | 4 | 5 | 6 | * | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | { | } | ( | ) | , | | - | 1 | 2 | 3 | / | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | |Adjust| | | | RAISE| . | 0 | + | Enter| + * `-----------------------------------------' `-----------------------------------------' + */ + [_RS] = LAYOUT_ortho_4x12( + _______, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , _______, + _______, KC_LEFT, KC_UP , KC_DOWN, KC_RGHT, KC_SCLN, KC_QUOT, KC_4 , KC_5 , KC_6 , KC_ASTR, _______, + _______, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_COMM, KC_MINS, KC_1 , KC_2 , KC_3 , KC_SLSH, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_DOT , KC_0 , KC_PLUS, _______ + ), + +/* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Del | Vol+ | Mute | Play | PgUp | Home | | F1 | F2 | F3 | F4 | F5 | F6 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | Vol- | < M | M > | PgDn | End | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | |LOWER | | | |Adjust| | | | Enter| + * `-----------------------------------------' `-----------------------------------------' + */ + [_LW] = LAYOUT_ortho_4x12( + _______, KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + CTL_DEL, KC_VOLU, KC_MUTE, KC_MPLY, KC_PGUP, KC_HOME, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , + _______, KC_VOLD, KC_MPRV, KC_MNXT, KC_PGDN, KC_END , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* Numpad + * ,-----------------------------------------. ,-----------------------------------------. + * | | | PrSc | ScrLk| Pause| | | | 7 | 8 | 9 | 0 | Lock | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | Ins | Home | PgUp | | | | 4 | 5 | 6 | / | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | Del | End | PgDn | | | | 1 | 2 | 3 | * | = | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |NUMPAD| | | | | | | | 0 | . | + | - | Enter| + * `-----------------------------------------' `-----------------------------------------' + */ + [_NM] = LAYOUT_ortho_4x12( + XXXXXXX, XXXXXXX, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, KC_7 , KC_8 , KC_9 , KC_0 , TO(_NM), + XXXXXXX, XXXXXXX, KC_INS , KC_HOME, KC_PGUP, XXXXXXX, XXXXXXX, KC_4 , KC_5 , KC_6 , KC_SLSH, XXXXXXX, + XXXXXXX, XXXXXXX, KC_DEL , KC_END , KC_PGDN, XXXXXXX, XXXXXXX, KC_1 , KC_2 , KC_3 , KC_ASTR, KC_EQL , + _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, KC_0 , KC_DOT , KC_PLUS, KC_MINS, _______ + ), + +/* Adjust + * ,-----------------------------------------. ,-----------------------------------------. + * | Reset| | Up | | | Rec1 | | Rec2 | Plain| Snake|Gradnt| | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Caps | Left | Down | Right|MkItPk| Play1| | Play2| RGB | HUE+ | SAT+ | BRI+ | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | Stop1| | Stop2| MODE | HUE- | SAT- | BRI- | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | | | | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( + RESET , XXXXXXX, KC_UP , XXXXXXX, XXXXXXX, DREC_1 , DREC_2 , RGB_M_P, RGB_M_SN,RGB_M_G, XXXXXXX, KC_DEL , + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, MKITPNK, DPLAY_1, DPLAY_2, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, _______, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DSTOP , DSTOP , RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +void make_it_pink_blue(void) { + uint16_t blue_hue = 210; + uint16_t pink_hue = 315; + + /* key is pressed */ + uint16_t hue = rgblight_get_hue(); + uint8_t sat = rgblight_get_sat(); + uint8_t val = rgblight_get_val(); + + if (hue != blue_hue) + rgblight_sethsv(blue_hue, sat, val); + else + rgblight_sethsv(pink_hue, sat, val); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) + return false; + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case MKITPNK: + if (record->event.pressed) + make_it_pink_blue(); + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/jyh2/readme.md b/keyboards/levinson/keymaps/jyh2/readme.md new file mode 100644 index 0000000000..45ca956922 --- /dev/null +++ b/keyboards/levinson/keymaps/jyh2/readme.md @@ -0,0 +1,32 @@ +# jyh's levinson layout + +[Levinson](https://keeb.io/products/levinson-lets-split-w-led-backlight) +built on rev2 PCBs. A split 4x12 keyboard with LED backlights. + +The layout is oriented towards needs for programming, Emacs, XMonad, +and experience with 60% keyboards with no base layer arrow keys +(Poker). It makes heavy use of modifiers and layers. It is influenced +by good ideas from the Atreus keyboard layout. + +## Layout features + + * Extensive use of _Mod Tap_, e.g. + * Tap sends Esc, Hold sends Left Control + * Tap sends Tab, Hold activates Numpad layer + * Tap sends - , Hold sends Shift + * ... and many more + * Places Tab and Enter on bottom corners, for hitting with palm + * Meta is available on top corners, for controlling XMonad + * Control on center key, for Emacs (among other things) + * Backspace (Control Hold) and Space on center keys + * All 60% keys available on base layer, except for numbers + * Hyper and Meh keys + * Right modifier keys in place of arrow keys + * Arrows are instead available in two alternate locations: + * WASD arrows on _Adjust_ + * Arrow cluster on _Raise_ (inspired by hexwire) + * Numpad and Numrow on _Raise_ layer. Each is faster in some contexts + * Function keys on _Lower_ + * Dynamic macros from QMK firmware on _Adjust_ + * Redunant keys where it is convenient to have characters together + on one layer diff --git a/keyboards/levinson/keymaps/jyh2/rules.mk b/keyboards/levinson/keymaps/jyh2/rules.mk new file mode 100644 index 0000000000..fbb3b49d6b --- /dev/null +++ b/keyboards/levinson/keymaps/jyh2/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE=yes +BOOTMAGIC_ENABLE=no -- cgit v1.2.3 From e08266129eba8f26b86b571b7f654e0d9311db25 Mon Sep 17 00:00:00 2001 From: Jason Yamada-Hanff Date: Thu, 1 Nov 2018 17:26:43 -0700 Subject: Keymap: port atreus layout to levinson keyboard (#4285) * Keymap: port atreus layout to levinson keyboard * fix (mostly deprecation) issues after review --- keyboards/levinson/keymaps/atreus/config.h | 22 ++++++++++++++++ keyboards/levinson/keymaps/atreus/keymap.c | 41 +++++++++++++++++++++++++++++ keyboards/levinson/keymaps/atreus/readme.md | 8 ++++++ 3 files changed, 71 insertions(+) create mode 100644 keyboards/levinson/keymaps/atreus/config.h create mode 100644 keyboards/levinson/keymaps/atreus/keymap.c create mode 100644 keyboards/levinson/keymaps/atreus/readme.md diff --git a/keyboards/levinson/keymaps/atreus/config.h b/keyboards/levinson/keymaps/atreus/config.h new file mode 100644 index 0000000000..a82c15238a --- /dev/null +++ b/keyboards/levinson/keymaps/atreus/config.h @@ -0,0 +1,22 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#define MASTER_LEFT diff --git a/keyboards/levinson/keymaps/atreus/keymap.c b/keyboards/levinson/keymaps/atreus/keymap.c new file mode 100644 index 0000000000..61ad04ef74 --- /dev/null +++ b/keyboards/levinson/keymaps/atreus/keymap.c @@ -0,0 +1,41 @@ +#include QMK_KEYBOARD_H + +#define _QW 0 +#define _RS 1 +#define _LW 2 + +/* + * q w e r t || y u i o p + * a s d f g || h j k l ; + * z x c v b || n m , . / + * esc tab gui shift bksp ctrl || alt space raise - ' enter + */ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_QW] = LAYOUT_ortho_4x12( /* Qwerty */ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_NO, KC_NO, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_NO, KC_NO, KC_H, KC_J, KC_K, KC_L, KC_SCLN , + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH , + KC_ESC, KC_TAB, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, MO(_RS), KC_MINS, KC_QUOT, KC_ENT ), +/* + * ! @ up { } || pgup 7 8 9 * + * # left down right $ || pgdn 4 5 6 + + * [ ] ( ) & || ` 1 2 3 \ + * lower insert super shift bksp ctrl || alt space fn . 0 = + */ +[_RS] = LAYOUT_ortho_4x12( /* [> RAISE <] */ + KC_EXLM, KC_AT, KC_UP, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_PGUP, KC_7, KC_8, KC_9, KC_ASTR , + KC_HASH, KC_LEFT, KC_DOWN, KC_RGHT, KC_DLR, KC_NO, KC_NO, KC_PGDN, KC_4, KC_5, KC_6, KC_PLUS , + KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_AMPR, KC_NO, KC_NO, KC_GRV, KC_1, KC_2, KC_3, KC_BSLS , + TG(_LW), KC_INS, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, KC_TRNS, KC_DOT, KC_0, KC_EQL ), +/* + * insert home up end pgup || up F7 F8 F9 F10 + * del left down right pgdn || down F4 F5 F6 F11 + * volup reset || F1 F2 F3 F12 + * voldn super shift bksp ctrl || alt space L0 prtsc scroll pause + */ +[_LW] = LAYOUT_ortho_4x12( /* [> LOWER <] */ + KC_INS, KC_HOME, KC_UP, KC_END, KC_PGUP, KC_NO, KC_NO, KC_UP, KC_F7, KC_F8, KC_F9, KC_F10 , + KC_DELT, KC_LEFT, KC_DOWN, KC_RGHT, KC_DOWN, KC_NO, KC_NO, KC_DOWN, KC_F4, KC_F5, KC_F6, KC_F11 , + KC_NO, KC_VOLU, KC_NO, KC_NO, RESET, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_F12 , + KC_NO, KC_VOLD, KC_LGUI, KC_LSFT, KC_BSPC, KC_LCTL, KC_LALT, KC_SPC, TO(_QW), KC_PSCR, KC_SLCK, KC_PAUS ) +}; diff --git a/keyboards/levinson/keymaps/atreus/readme.md b/keyboards/levinson/keymaps/atreus/readme.md new file mode 100644 index 0000000000..0b548ace17 --- /dev/null +++ b/keyboards/levinson/keymaps/atreus/readme.md @@ -0,0 +1,8 @@ +# Atreus layout port + +Port the default Atreus layout to the Levinson/Let's Split. + +The purpose is to try out the layout to get a sense of what works in it. + +The 'extra' keys on the Levinson are dead in this version, to make a +more faithful emulation of the atreus layout. -- cgit v1.2.3 From 7a22da9f0573711be586915c763621027e285e81 Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Fri, 2 Nov 2018 08:28:01 +0800 Subject: Update rules.mk for Vinta (#4317) changed dfu args to exit to application mode after flashing --- keyboards/vinta/rules.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/vinta/rules.mk b/keyboards/vinta/rules.mk index bf3eecbe21..9d89d96636 100644 --- a/keyboards/vinta/rules.mk +++ b/keyboards/vinta/rules.mk @@ -29,10 +29,10 @@ ARMV = 6 # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB #OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 -OPT_DEFS = +OPT_DEFS = # Options to pass to dfu-util when flashing -DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000 +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave # Build Options # comment out to disable the options. @@ -44,4 +44,4 @@ EXTRAKEY_ENABLE = yes # Audio control and System control CONSOLE_ENABLE = no # Console for debug COMMAND_ENABLE = no # Commands for debug and configuration NKRO_ENABLE = yes # USB Nkey Rollover -NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in \ No newline at end of file +NO_USB_STARTUP_CHECK = no # Disable initialization only when usb is plugged in -- cgit v1.2.3 From 6eb7501eb0ab0ee1711f7f1275501ab53bcae8e2 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Fri, 2 Nov 2018 01:21:28 -0400 Subject: Four Banger: Clean Up Indentation (#4322) Make indentation consistent and match project standards --- keyboards/four_banger/config.h | 2 +- keyboards/four_banger/four_banger.h | 10 +++++----- keyboards/four_banger/keymaps/default/keymap.c | 26 +++++++++++++------------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/keyboards/four_banger/config.h b/keyboards/four_banger/config.h index 8dceff5db5..761ddba715 100644 --- a/keyboards/four_banger/config.h +++ b/keyboards/four_banger/config.h @@ -40,7 +40,7 @@ /* key combination for command */ #define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) #define RGB_DI_PIN E6 diff --git a/keyboards/four_banger/four_banger.h b/keyboards/four_banger/four_banger.h index b0de731b91..a6da8dd0b7 100644 --- a/keyboards/four_banger/four_banger.h +++ b/keyboards/four_banger/four_banger.h @@ -4,11 +4,11 @@ #include "quantum.h" #define LAYOUT_ortho_2x2( \ - K00, K01, \ - K10, K11 \ + K00, K01, \ + K10, K11 \ ) { \ - { K00, K01 }, \ - { K10, K11 } \ + { K00, K01 }, \ + { K10, K11 } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/four_banger/keymaps/default/keymap.c b/keyboards/four_banger/keymaps/default/keymap.c index 6c5f7c8a55..3fea0afd4f 100644 --- a/keyboards/four_banger/keymaps/default/keymap.c +++ b/keyboards/four_banger/keymaps/default/keymap.c @@ -5,20 +5,20 @@ enum custom_keycodes { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ortho_2x2( - KC_1, KC_U, - KC_P, UP_URL - ), + LAYOUT_ortho_2x2( + KC_1, KC_U, + KC_P, UP_URL + ), }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case UP_URL: - if (record->event.pressed) { - SEND_STRING("http://1upkeyboards.com"); - } - return false; - break; - } - return true; + switch (keycode) { + case UP_URL: + if (record->event.pressed) { + SEND_STRING("http://1upkeyboards.com"); + } + return false; + break; + } + return true; } -- cgit v1.2.3 From 5909d8aef1126357899b687155bfe377914891df Mon Sep 17 00:00:00 2001 From: ENDO Katsuhiro Date: Fri, 2 Nov 2018 14:55:29 +0900 Subject: Keyboard: Add MiniAxe (#4314) * Add a new keyboard MiniAxe. * Fix readme foramt. Co-Authored-By: ka2hiro * Fix readme format. Co-Authored-By: ka2hiro * Remove unnecessary keycode aliases. * Remove unnecessary param. Co-Authored-By: ka2hiro --- keyboards/miniaxe/config.h | 245 +++++++++++ keyboards/miniaxe/info.json | 12 + keyboards/miniaxe/keymaps/default/keymap.c | 159 +++++++ keyboards/miniaxe/keymaps/underglow/keymap.c | 159 +++++++ keyboards/miniaxe/keymaps/underglow/rules.mk | 2 + keyboards/miniaxe/matrix.c | 596 +++++++++++++++++++++++++++ keyboards/miniaxe/miniaxe.c | 43 ++ keyboards/miniaxe/miniaxe.h | 50 +++ keyboards/miniaxe/readme.md | 16 + keyboards/miniaxe/rules.mk | 88 ++++ 10 files changed, 1370 insertions(+) create mode 100644 keyboards/miniaxe/config.h create mode 100644 keyboards/miniaxe/info.json create mode 100644 keyboards/miniaxe/keymaps/default/keymap.c create mode 100644 keyboards/miniaxe/keymaps/underglow/keymap.c create mode 100644 keyboards/miniaxe/keymaps/underglow/rules.mk create mode 100644 keyboards/miniaxe/matrix.c create mode 100644 keyboards/miniaxe/miniaxe.c create mode 100644 keyboards/miniaxe/miniaxe.h create mode 100644 keyboards/miniaxe/readme.md create mode 100644 keyboards/miniaxe/rules.mk diff --git a/keyboards/miniaxe/config.h b/keyboards/miniaxe/config.h new file mode 100644 index 0000000000..13608feab2 --- /dev/null +++ b/keyboards/miniaxe/config.h @@ -0,0 +1,245 @@ +/* +Copyright 2018 ENDO Katsuhiro + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3939 +#define DEVICE_VER 0x0001 +#define MANUFACTURER ENDO Katsuhiro +#define PRODUCT MiniAxe +#define DESCRIPTION Yet another split keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * NO_DIODE = switches are directly connected to AVR pins + * +*/ +// #define MATRIX_ROW_PINS { D0, D5 } +// #define MATRIX_COL_PINS { F1, F0, B0 } +#define NO_PIN 0xFF +#define MATRIX_ROW_COL_PINS { \ + { F1, E6, B0, B2, B3 }, \ + { F5, F0, B1, B7, D2 }, \ + { F6, F7, C7, D5, D3 }, \ + { B5, C6, B6, NO_PIN, NO_PIN } \ +} +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION CUSTOM_MATRIX + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Uncomment below if use underglow */ +#define RGB_DI_PIN F4 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 + +/* Serial settings */ +#define USE_SERIAL +//#define EE_HANDS +#define I2C_MASTER_LEFT +//#define I2C_MASTER_RIGHT + +#define DISABLE_JTAG + diff --git a/keyboards/miniaxe/info.json b/keyboards/miniaxe/info.json new file mode 100644 index 0000000000..5fee787b55 --- /dev/null +++ b/keyboards/miniaxe/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "MiniAxe", + "url": "", + "maintainer": "ka2hiro", + "width": 11, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [{"label":"Q", "x":0, "y":0}, {"label":"W", "x":1, "y":0}, {"label":"E", "x":2, "y":0}, {"label":"R", "x":3, "y":0}, {"label":"T", "x":4, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"A", "x":0, "y":1}, {"label":"S", "x":1, "y":1}, {"label":"D", "x":2, "y":1}, {"label":"F", "x":3, "y":1}, {"label":"G", "x":4, "y":1}, {"label":"J", "x":6, "y":1}, {"label":"J", "x":7, "y":1}, {"label":"K", "x":8, "y":1}, {"label":"L", "x":9, "y":1}, {"label":";", "x":10, "y":1}, {"label":"Z", "x":0, "y":2}, {"label":"X", "x":1, "y":2}, {"label":"C", "x":2, "y":2}, {"label":"V", "x":3, "y":2}, {"label":"B", "x":4, "y":2}, {"label":"N", "x":6, "y":2}, {"label":"M", "x":7, "y":2}, {"label":",", "x":8, "y":2}, {"label":".", "x":9, "y":2}, {"label":"/", "x":10, "y":2}, {"label":"Cmd", "x":2, "y":3}, {"label":"⇓", "x":3, "y":3}, {"label":"Ctrl", "x":4, "y":3}, {"x":6, "y":3}, {"label":"⇑", "x":7, "y":3}, {"label":"Opt", "x":8, "y":3}] + } + } +} diff --git a/keyboards/miniaxe/keymaps/default/keymap.c b/keyboards/miniaxe/keymaps/default/keymap.c new file mode 100644 index 0000000000..4b405e2029 --- /dev/null +++ b/keyboards/miniaxe/keymaps/default/keymap.c @@ -0,0 +1,159 @@ +/* Copyright 2018 ENDO Katsuhiro + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,----------------------------------. ,----------------------------------. + * | Q | W | E | R | T | | Y | U | I | O | P | + * |------+------+------+------+------| |------+------+------+------+------| + * | A | S | D | F | G | | H | J | K | L | ; | + * |------+------+------+------+------| |------+------+------+------+------| + * | Z | X | C | V | B | | N | M | , | . | / | + * `-------------+------+------+------| |------+------+------+------+------' + * | GUI | LOWER|Ctrl/Esc| |Spc/Sft| RAISE|Alt/BkSp | + * `--------------------' `--------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LGUI, LOWER, MT(MOD_LCTL, KC_ESC), MT(MOD_LSFT, KC_SPC), RAISE, MT(MOD_LALT, KC_BSPC) \ +), + +/* Raise + * + * ,----------------------------------. ,----------------------------------. + * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + * |------+------+------+------+------| |------+------+------+------+------| + * | Tab | _ | + | | | ~ | | : | " | > | { | } | + * |------+------+------+------+------| |------+------+------+------+------| + * | Caps| - | = | \ | ` | | ; | ' | < | [ | ] | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | Esc | RAISE| | + * `--------------------' `--------------------' + */ +[_RAISE] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_TAB, KC_UNDS, KC_PLUS, KC_PIPE, KC_TILD, KC_COLN, KC_DQUO, KC_GT, KC_LCBR, KC_RCBR, \ + KC_CAPS, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_SCLN, KC_QUOT, KC_LT, KC_LBRC, KC_RBRC, \ + _______, _______, _______, _______, _______, _______\ +), + +/* Lower + * + * ,----------------------------------. ,----------------------------------. + * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------| |------+------+------+------+------| + * | Tab | | | | | | Left | Down | Up | Right| Enter| + * |------+------+------+------+------| |------+------+------+------+------| + * | Ctrl| ` | GUI | Alt | Del | | BkSp | PgUp | PgDn | \ | ' | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `--------------------' `--------------------' + */ +[_LOWER] = LAYOUT( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_TAB, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, \ + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, KC_DEL, KC_BSPC, KC_PGUP, KC_PGDN, KC_BSLS, KC_QUOT, \ + _______, _______, _______, _______, _______, _______ \ +), + + +/* Adjust (Lower + Raise) + * + * ,----------------------------------. ,----------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |------+------+------+------+------| + * | F11 | F12 | | | | | | | | | | + * |------+------+------+------+------| |------+------+------+------+------| + * | Reset| | | | | | Prev | Next | Vol- | Vol+ | Play | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `--------------------' `--------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, \ + RESET, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, \ + _______, _______, _______, _______, _______, _______ \ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // persistant_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { +} diff --git a/keyboards/miniaxe/keymaps/underglow/keymap.c b/keyboards/miniaxe/keymaps/underglow/keymap.c new file mode 100644 index 0000000000..6325b20565 --- /dev/null +++ b/keyboards/miniaxe/keymaps/underglow/keymap.c @@ -0,0 +1,159 @@ +/* Copyright 2018 ENDO Katsuhiro + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * + * ,----------------------------------. ,----------------------------------. + * | Q | W | E | R | T | | Y | U | I | O | P | + * |------+------+------+------+------| |------+------+------+------+------| + * | A | S | D | F | G | | H | J | K | L | ; | + * |------+------+------+------+------| |------+------+------+------+------| + * | Z | X | C | V | B | | N | M | , | . | / | + * `-------------+------+------+------| |------+------+------+------+------' + * | GUI | LOWER|Ctrl/Esc| |Spc/Sft| RAISE|Alt/BkSp | + * `--------------------' `--------------------' + */ +[_QWERTY] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LGUI, LOWER, MT(MOD_LCTL, KC_ESC), MT(MOD_LSFT, KC_SPC), RAISE, MT(MOD_LALT, KC_BSPC) \ +), + +/* Raise + * + * ,----------------------------------. ,----------------------------------. + * | ! | @ | # | $ | % | | ^ | & | * | ( | ) | + * |------+------+------+------+------| |------+------+------+------+------| + * | Tab | _ | + | | | ~ | | : | " | > | { | } | + * |------+------+------+------+------| |------+------+------+------+------| + * | Caps| - | = | \ | ` | | ; | ' | < | [ | ] | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | Esc | RAISE| | + * `--------------------' `--------------------' + */ +[_RAISE] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_TAB, KC_UNDS, KC_PLUS, KC_PIPE, KC_TILD, KC_COLN, KC_DQUO, KC_GT, KC_LCBR, KC_RCBR, \ + KC_CAPS, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_SCLN, KC_QUOT, KC_LT, KC_LBRC, KC_RBRC, \ + _______, _______, _______, _______, _______, _______\ +), + +/* Lower + * + * ,----------------------------------. ,----------------------------------. + * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------| |------+------+------+------+------| + * | Tab | | | | Play | | Left | Down | Up | Right| Enter| + * |------+------+------+------+------| |------+------+------+------+------| + * | Ctrl| ` | GUI | Alt | Del | | BkSp | PgUp | PgDn | \ | ' | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `--------------------' `--------------------' + */ +[_LOWER] = LAYOUT( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_TAB, _______, _______, _______, KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_ENT, \ + KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, KC_DEL, KC_BSPC, KC_PGUP, KC_PGDN, KC_BSLS, KC_QUOT, \ + _______, _______, _______, _______, _______, _______ \ +), + + +/* Adjust (Lower + Raise) + * + * ,----------------------------------. ,----------------------------------. + * | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | + * |------+------+------+------+------| |------+------+------+------+------| + * | F11 | F12 | |RGBSAI|RGBSAD| |RGBVAI|RGBVAD| | | | + * |------+------+------+------+------| |------+------+------+------+------| + * | Reset|RGBTOG|RGBMOD|RGBHUI|RGBHUD| | Prev | Next | Vol- | Vol+ | Play | + * `-------------+------+------+------| |------+------+------+------+------' + * | | LOWER| | | | RAISE| | + * `--------------------' `--------------------' + */ +[_ADJUST] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, \ + KC_F11, KC_F12, RGB_RMOD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, KC_MPRV, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, \ + _______, _______, _______, _______, _______, _______ \ +) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + // persistant_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { +} diff --git a/keyboards/miniaxe/keymaps/underglow/rules.mk b/keyboards/miniaxe/keymaps/underglow/rules.mk new file mode 100644 index 0000000000..64fa91deda --- /dev/null +++ b/keyboards/miniaxe/keymaps/underglow/rules.mk @@ -0,0 +1,2 @@ +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow + diff --git a/keyboards/miniaxe/matrix.c b/keyboards/miniaxe/matrix.c new file mode 100644 index 0000000000..55c458e1fb --- /dev/null +++ b/keyboards/miniaxe/matrix.c @@ -0,0 +1,596 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include "pro_micro.h" +#include "config.h" +#include "timer.h" +#include "split_flags.h" + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif +#ifdef BACKLIGHT_ENABLE +# include "backlight.h" + extern backlight_config_t backlight_config; +#endif + +#if defined(USE_I2C) || defined(EH) +# include "i2c.h" +#else // USE_SERIAL +# include "serial.h" +#endif + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#if (DEBOUNCING_DELAY > 0) + static uint16_t debouncing_time; + static bool debouncing = false; +#endif + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#else +# error "Currently only supports 8 COLS" +#endif +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#define ERROR_DISCONNECT_COUNT 5 + +#define ROWS_PER_HAND (MATRIX_ROWS/2) + +static uint8_t error_count = 0; + +#if ((DIODE_DIRECTION == COL2ROW) || (DIODE_DIRECTION == ROW2COL)) +static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +#elif (DIODE_DIRECTION == CUSTOM_MATRIX) +static uint8_t row_col_pins[MATRIX_ROWS][MATRIX_COLS] = MATRIX_ROW_COL_PINS; +#endif + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +#if (DIODE_DIRECTION == COL2ROW) + static void init_cols(void); + static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); + static void unselect_rows(void); + static void select_row(uint8_t row); + static void unselect_row(uint8_t row); +#elif (DIODE_DIRECTION == ROW2COL) + static void init_rows(void); + static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); + static void unselect_cols(void); + static void unselect_col(uint8_t col); + static void select_col(uint8_t col); +#elif (DIODE_DIRECTION == CUSTOM_MATRIX) + static void init_cols_rows(void); + static bool read_cols(matrix_row_t current_matrix[], uint8_t current_row); +#endif + +__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) { +} + +__attribute__ ((weak)) +void matrix_slave_scan_user(void) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ +#ifdef DISABLE_JTAG + // JTAG disable for PORT F. write JTD bit twice within four cycles. + MCUCR |= (1< 0) + bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); + + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } + +# else + read_cols_on_row(matrix+offset, current_row); +# endif + + } + +#elif (DIODE_DIRECTION == ROW2COL) + // Set col, read rows + for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_rows_on_col(matrix+offset, current_col); +# endif + + } + +#elif (DIODE_DIRECTION == CUSTOM_MATRIX) + // Set row, read cols + for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = read_cols(matrix_debouncing+offset, current_row); + if (matrix_changed) { + debouncing = true; + debouncing_time = timer_read(); + } +# else + read_cols(matrix+offset, current_row); +# endif + } +#endif + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + debouncing = false; + } +# endif + + return 1; +} + +#if defined(USE_I2C) || defined(EH) + +// Get rows from other half over i2c +int i2c_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int err = 0; + + // write backlight info + #ifdef BACKLIGHT_ENABLE + if (BACKLIT_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // Backlight location + err = i2c_master_write(I2C_BACKLIT_START); + if (err) goto i2c_error; + + // Write backlight + i2c_master_write(get_backlight_level()); + + BACKLIT_DIRTY = false; + } + #endif + + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // start of matrix stored at I2C_KEYMAP_START + err = i2c_master_write(I2C_KEYMAP_START); + if (err) goto i2c_error; + + // Start read + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); + if (err) goto i2c_error; + + if (!err) { + int i; + for (i = 0; i < ROWS_PER_HAND-1; ++i) { + matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); + } + matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); + i2c_master_stop(); + } else { +i2c_error: // the cable is disconnceted, or something else went wrong + i2c_reset_state(); + return err; + } + + #ifdef RGBLIGHT_ENABLE + if (RGB_DIRTY) { + err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); + if (err) goto i2c_error; + + // RGB Location + err = i2c_master_write(I2C_RGB_START); + if (err) goto i2c_error; + + uint32_t dword = eeconfig_read_rgblight(); + + // Write RGB + err = i2c_master_write_data(&dword, 4); + if (err) goto i2c_error; + + RGB_DIRTY = false; + i2c_master_stop(); + } + #endif + + return 0; +} + +#else // USE_SERIAL + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + + if (serial_update_buffers()) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + + #ifdef RGBLIGHT_ENABLE + // Code to send RGB over serial goes here (not implemented yet) + #endif + + #ifdef BACKLIGHT_ENABLE + // Write backlight level for slave to read + serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; + #endif + + return 0; +} +#endif + +uint8_t matrix_scan(void) +{ + uint8_t ret = _matrix_scan(); + +#if defined(USE_I2C) || defined(EH) + if( i2c_transaction() ) { +#else // USE_SERIAL + if( serial_transaction() ) { +#endif + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + +#if defined(USE_I2C) || defined(EH) + for (int i = 0; i < ROWS_PER_HAND; ++i) { + i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; + } +#else // USE_SERIAL + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +#endif + matrix_slave_scan_user(); +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) +{ + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + // Select row and wait for row selecton to stabilize + select_row(current_row); + wait_us(30); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + + // Select the col pin to read (active low) + uint8_t pin = col_pins[col_index]; + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + + // Populate the matrix row with the state of the col pin + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + + // Unselect row + unselect_row(current_row); + + return (last_row_value != current_matrix[current_row]); +} + +static void select_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_row(uint8_t row) +{ + uint8_t pin = row_pins[row]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == ROW2COL) + +static void init_rows(void) +{ + for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { + uint8_t pin = row_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) +{ + bool matrix_changed = false; + + // Select col and wait for col selecton to stabilize + select_col(current_col); + wait_us(30); + + // For each row... + for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) + { + + // Store last value of row prior to reading + matrix_row_t last_row_value = current_matrix[row_index]; + + // Check row pin state + if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + { + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); + } + else + { + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + } + + // Determine if the matrix changed state + if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) + { + matrix_changed = true; + } + } + + // Unselect col + unselect_col(current_col); + + return matrix_changed; +} + +static void select_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static void unselect_col(uint8_t col) +{ + uint8_t pin = col_pins[col]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static void unselect_cols(void) +{ + for(uint8_t x = 0; x < MATRIX_COLS; x++) { + uint8_t pin = col_pins[x]; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } +} + +#elif (DIODE_DIRECTION == CUSTOM_MATRIX) + +static void init_cols_rows(void) +{ + for(int row = 0; row < MATRIX_ROWS; row++) { + for(int col = 0; col < MATRIX_COLS; col++) { + uint8_t pin = row_col_pins[row][col]; + if(pin == NO_PIN) { + continue; + } + // DDxn set 0 for input + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); + // PORTxn set 1 for input/pullup + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); + } + } +} + +static bool read_cols(matrix_row_t current_matrix[], uint8_t current_row) +{ + matrix_row_t last_row_value = current_matrix[current_row]; + current_matrix[current_row] = 0; + + for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { + uint8_t pin = row_col_pins[current_row][col_index]; + if(pin == NO_PIN) { + current_matrix[current_row] |= 0; + } + else { + uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); + current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + } + } + + return (last_row_value != current_matrix[current_row]); +} + +#endif diff --git a/keyboards/miniaxe/miniaxe.c b/keyboards/miniaxe/miniaxe.c new file mode 100644 index 0000000000..965ada9a18 --- /dev/null +++ b/keyboards/miniaxe/miniaxe.c @@ -0,0 +1,43 @@ +/* Copyright 2018 ENDO Katsuhiro + * + * 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 . + */ +#include "miniaxe.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/miniaxe/miniaxe.h b/keyboards/miniaxe/miniaxe.h new file mode 100644 index 0000000000..a0130ad280 --- /dev/null +++ b/keyboards/miniaxe/miniaxe.h @@ -0,0 +1,50 @@ +/* Copyright 2018 ENDO Katsuhiro + * + * 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 . + */ +#ifndef MINIAXE_H +#define MINIAXE_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ + +// readability +#define ___ KC_NO + +#define LAYOUT( \ + L01, L02, L03, L04, L05, R01, R02, R03, R04, R05, \ + L06, L07, L08, L09, L10, R06, R07, R08, R09, R10, \ + L11, L12, L13, L14, L15, R11, R12, R13, R14, R15, \ + L16, L17, L18, R16, R17, R18 \ + ) \ + { \ + { L01, L02, L03, L04, L05 }, \ + { L06, L07, L08, L09, L10 }, \ + { L11, L12, L13, L14, L15 }, \ + { L16, L17, L18, ___, ___ }, \ + { R01, R02, R03, R04, R05 }, \ + { R06, R07, R08, R09, R10 }, \ + { R11, R12, R13, R14, R15 }, \ + { R16, R17, R18, ___, ___ } \ + } + +#endif diff --git a/keyboards/miniaxe/readme.md b/keyboards/miniaxe/readme.md new file mode 100644 index 0000000000..57ed01a917 --- /dev/null +++ b/keyboards/miniaxe/readme.md @@ -0,0 +1,16 @@ +MiniAxe +=== + +![MiniAxe](https://i.imgur.com/1ApzrCz.jpg) + +Yet another split ortholinear keyboard with 3x5+3 keys. + +Keyboard Maintainer: [ka2hiro](https://github.com/ka2hiro) [@ka2hiro](https://twitter.com/ka2hiro) +Hardware Supported: MiniAxe PCB, ATMEGA32U4 +Hardware Availability: [@ka2hiro](https://twitter.com/ka2hiro) + +Make example for this keyboard (after setting up your build environment): + + make miniaxe:default:dfu + +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/miniaxe/rules.mk b/keyboards/miniaxe/rules.mk new file mode 100644 index 0000000000..96e27686b8 --- /dev/null +++ b/keyboards/miniaxe/rules.mk @@ -0,0 +1,88 @@ +SRC += matrix.c + +# 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 = atmel-dfu + + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # 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) + +DEBUG_ENABLE = no +CUSTOM_MATRIX = yes # Use custom matrix code +SPLIT_KEYBOARD = yes # Use shared split_common code + -- cgit v1.2.3 From 15f6278aa623ceda4c220daee1cbedb9e38e6a97 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 2 Nov 2018 12:31:40 -0400 Subject: Add support for Atmega32A to pin declarations and universal matrix (#4015) * add computed pins from mcu type * update for atmega32a * doc typo * add atmega16 chips, link to references * remove avr include from config * exclude assembler in config.h includes * consolodate options, add 646 * fix typo in pindef --- docs/internals_gpio_control.md | 2 +- quantum/config_common.h | 156 +++++++++++++++++++----------- quantum/quantum.h | 20 ++-- tmk_core/protocol/vusb/usbdrv/usbdrvasm.S | 8 +- 4 files changed, 118 insertions(+), 68 deletions(-) diff --git a/docs/internals_gpio_control.md b/docs/internals_gpio_control.md index 21643d30c9..083e696648 100644 --- a/docs/internals_gpio_control.md +++ b/docs/internals_gpio_control.md @@ -12,7 +12,7 @@ The following functions can provide basic control of GPIOs and are found in `qua |`setPinInputHigh(pin)`|Set pin as input with build in pull-up | |`setPinInputLow(pin)` |Set pin as input with build in pull-down (Supported only on STM32)| |`setPinOutput(pin)` |Set pin as output | -|`writePinHige(pin)` |Set pin level as high, assuming it is an output | +|`writePinHigh(pin)` |Set pin level as high, assuming it is an output | |`writePinLow(pin)` |Set pin level as low, assuming it is an output | |`writePin(pin, level)`|Set pin level, assuming it is an output | |`readPin(pin)` |Returns the level of the pin | diff --git a/quantum/config_common.h b/quantum/config_common.h index 288617255f..cbff372eaf 100644 --- a/quantum/config_common.h +++ b/quantum/config_common.h @@ -1,4 +1,4 @@ -/* Copyright 2015-2017 Jack Humbert +/* Copyright 2015-2018 Jack Humbert * * 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 @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_DEFINITIONS_H -#define CONFIG_DEFINITIONS_H +#pragma once /* diode directions */ #define COL2ROW 0 @@ -23,57 +22,108 @@ #define CUSTOM_MATRIX 2 /* Disables built-in matrix scanning code */ #ifdef __AVR__ + #ifndef __ASSEMBLER__ + #include + #endif + #define PORT_SHIFTER 4 // this may be 4 for all AVR chips + + // If you want to add more to this list, reference the PINx definitions in these header + // files: https://github.com/vancegroup-mirrors/avr-libc/tree/master/avr-libc/include/avr + + #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega16U4__) + #define ADDRESS_BASE 0x00 + #define PINB_ADDRESS 0x3 + #define PINC_ADDRESS 0x6 + #define PIND_ADDRESS 0x9 + #define PINE_ADDRESS 0xC + #define PINF_ADDRESS 0xF + #elif defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) + #define ADDRESS_BASE 0x00 + #define PINB_ADDRESS 0x3 + #define PINC_ADDRESS 0x6 + #define PIND_ADDRESS 0x9 + #elif defined(__AVR_AT90USB1286__) || defined(__AVR_AT90USB646__) + #define ADDRESS_BASE 0x00 + #define PINA_ADDRESS 0x0 + #define PINB_ADDRESS 0x3 + #define PINC_ADDRESS 0x6 + #define PIND_ADDRESS 0x9 + #define PINE_ADDRESS 0xC + #define PINF_ADDRESS 0xF + #elif defined(__AVR_ATmega32A__) + #define ADDRESS_BASE 0x10 + #define PIND_ADDRESS 0x0 + #define PINC_ADDRESS 0x3 + #define PINB_ADDRESS 0x6 + #define PINA_ADDRESS 0x9 + #else + #error "Pins are not defined" + #endif + /* I/O pins */ - #ifndef F0 - #define B0 0x30 - #define B1 0x31 - #define B2 0x32 - #define B3 0x33 - #define B4 0x34 - #define B5 0x35 - #define B6 0x36 - #define B7 0x37 - #define C0 0x60 - #define C1 0x61 - #define C2 0x62 - #define C3 0x63 - #define C4 0x64 - #define C5 0x65 - #define C6 0x66 - #define C7 0x67 - #define D0 0x90 - #define D1 0x91 - #define D2 0x92 - #define D3 0x93 - #define D4 0x94 - #define D5 0x95 - #define D6 0x96 - #define D7 0x97 - #define E0 0xC0 - #define E1 0xC1 - #define E2 0xC2 - #define E3 0xC3 - #define E4 0xC4 - #define E5 0xC5 - #define E6 0xC6 - #define E7 0xC7 - #define F0 0xF0 - #define F1 0xF1 - #define F2 0xF2 - #define F3 0xF3 - #define F4 0xF4 - #define F5 0xF5 - #define F6 0xF6 - #define F7 0xF7 - #define A0 0x00 - #define A1 0x01 - #define A2 0x02 - #define A3 0x03 - #define A4 0x04 - #define A5 0x05 - #define A6 0x06 - #define A7 0x07 + #define PINDEF(port, pin) ((PIN##port##_ADDRESS << PORT_SHIFTER) | pin) + + #ifdef PORTA + #define A0 PINDEF(A, 0) + #define A1 PINDEF(A, 1) + #define A2 PINDEF(A, 2) + #define A3 PINDEF(A, 3) + #define A4 PINDEF(A, 4) + #define A5 PINDEF(A, 5) + #define A6 PINDEF(A, 6) + #define A7 PINDEF(A, 7) + #endif + #ifdef PORTB + #define B0 PINDEF(B, 0) + #define B1 PINDEF(B, 1) + #define B2 PINDEF(B, 2) + #define B3 PINDEF(B, 3) + #define B4 PINDEF(B, 4) + #define B5 PINDEF(B, 5) + #define B6 PINDEF(B, 6) + #define B7 PINDEF(B, 7) #endif + #ifdef PORTC + #define C0 PINDEF(C, 0) + #define C1 PINDEF(C, 1) + #define C2 PINDEF(C, 2) + #define C3 PINDEF(C, 3) + #define C4 PINDEF(C, 4) + #define C5 PINDEF(C, 5) + #define C6 PINDEF(C, 6) + #define C7 PINDEF(C, 7) + #endif + #ifdef PORTD + #define D0 PINDEF(D, 0) + #define D1 PINDEF(D, 1) + #define D2 PINDEF(D, 2) + #define D3 PINDEF(D, 3) + #define D4 PINDEF(D, 4) + #define D5 PINDEF(D, 5) + #define D6 PINDEF(D, 6) + #define D7 PINDEF(D, 7) + #endif + #ifdef PORTE + #define E0 PINDEF(E, 0) + #define E1 PINDEF(E, 1) + #define E2 PINDEF(E, 2) + #define E3 PINDEF(E, 3) + #define E4 PINDEF(E, 4) + #define E5 PINDEF(E, 5) + #define E6 PINDEF(E, 6) + #define E7 PINDEF(E, 7) + #endif + #ifdef PORTF + #define F0 PINDEF(F, 0) + #define F1 PINDEF(F, 1) + #define F2 PINDEF(F, 2) + #define F3 PINDEF(F, 3) + #define F4 PINDEF(F, 4) + #define F5 PINDEF(F, 5) + #define F6 PINDEF(F, 6) + #define F7 PINDEF(F, 7) + #endif + #elif defined(PROTOCOL_CHIBIOS) #define A0 PAL_LINE(GPIOA, 0) #define A1 PAL_LINE(GPIOA, 1) @@ -200,5 +250,3 @@ #define API_SYSEX_MAX_SIZE 32 #include "song_list.h" - -#endif diff --git a/quantum/quantum.h b/quantum/quantum.h index 1d3ee033fd..fe670c8eb4 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -140,26 +140,28 @@ extern uint32_t default_layer_state; //Function substitutions to ease GPIO manipulation #ifdef __AVR__ + #define PIN_ADDRESS(p, offset) _SFR_IO8(ADDRESS_BASE + (p >> PORT_SHIFTER) + offset) + #define pin_t uint8_t - #define setPinInput(pin) _SFR_IO8((pin >> 4) + 1) &= ~ _BV(pin & 0xF) + #define setPinInput(pin) PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF) #define setPinInputHigh(pin) ({\ - _SFR_IO8((pin >> 4) + 1) &= ~ _BV(pin & 0xF);\ - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF);\ + PIN_ADDRESS(pin, 1) &= ~ _BV(pin & 0xF);\ + PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF);\ }) #define setPinInputLow(pin) _Static_assert(0, "AVR Processors cannot impliment an input as pull low") - #define setPinOutput(pin) _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF) + #define setPinOutput(pin) PIN_ADDRESS(pin, 1) |= _BV(pin & 0xF) - #define writePinHigh(pin) _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF) - #define writePinLow(pin) _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF) + #define writePinHigh(pin) PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF) + #define writePinLow(pin) PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF) static inline void writePin(pin_t pin, uint8_t level){ if (level){ - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); + PIN_ADDRESS(pin, 2) |= _BV(pin & 0xF); } else { - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); + PIN_ADDRESS(pin, 2) &= ~_BV(pin & 0xF); } } - #define readPin(pin) (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)) + #define readPin(pin) (PIN_ADDRESS(pin, 0) & _BV(pin & 0xF)) #elif defined(PROTOCOL_CHIBIOS) #define pin_t ioline_t #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) diff --git a/tmk_core/protocol/vusb/usbdrv/usbdrvasm.S b/tmk_core/protocol/vusb/usbdrv/usbdrvasm.S index 45fcf18315..2e8097da9c 100644 --- a/tmk_core/protocol/vusb/usbdrv/usbdrvasm.S +++ b/tmk_core/protocol/vusb/usbdrv/usbdrvasm.S @@ -118,7 +118,7 @@ RTMODEL "__rt_version", "3" # define polyH r21 # define scratch r23 -#else /* __IAR_SYSTEMS_ASM__ */ +#else /* __IAR_SYSTEMS_ASM__ */ /* Register assignments for usbCrc16 on gcc */ /* Calling conventions on gcc: * First parameter passed in r24/r25, second in r22/23 and so on. @@ -151,7 +151,7 @@ RTMODEL "__rt_version", "3" ; unsigned table(unsigned char x) ; { ; unsigned value; -; +; ; value = (unsigned)x << 6; ; value ^= (unsigned)x << 7; ; if(parity(x)) @@ -161,7 +161,7 @@ RTMODEL "__rt_version", "3" ; unsigned usbCrc16(unsigned char *argPtr, unsigned char argLen) ; { ; unsigned crc = 0xffff; -; +; ; while(argLen--) ; crc = table(lo8(crc) ^ *argPtr++) ^ hi8(crc); ; return ~crc; @@ -299,7 +299,7 @@ usbCrc16Append: # define cnt16H r31 # define cntH r18 -#else /* __IAR_SYSTEMS_ASM__ */ +#else /* __IAR_SYSTEMS_ASM__ */ /* Register assignments for usbMeasureFrameLength on gcc */ /* Calling conventions on gcc: * First parameter passed in r24/r25, second in r22/23 and so on. -- cgit v1.2.3 From 34112dac36482edbd5331eac3dfe436752ff7653 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 2 Nov 2018 12:44:57 -0400 Subject: Adds the Proton C base project (#4224) * adds proton c base * fixes custom matrix include * adds readme.md * usable pins, readme update --- common_features.mk | 2 +- .../proton_c/boards/GENERIC_STM32_F303XC/board.c | 126 +++ .../proton_c/boards/GENERIC_STM32_F303XC/board.h | 1187 ++++++++++++++++++++ .../proton_c/boards/GENERIC_STM32_F303XC/board.mk | 5 + keyboards/proton_c/bootloader_defs.h | 7 + keyboards/proton_c/chconf.h | 520 +++++++++ keyboards/proton_c/config.h | 121 ++ keyboards/proton_c/halconf.h | 388 +++++++ keyboards/proton_c/keymaps/default/keymap.c | 21 + keyboards/proton_c/mcuconf.h | 257 +++++ keyboards/proton_c/proton_c.c | 25 + keyboards/proton_c/proton_c.h | 18 + keyboards/proton_c/readme.md | 16 + keyboards/proton_c/rules.mk | 51 + 14 files changed, 2743 insertions(+), 1 deletion(-) create mode 100644 keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c create mode 100644 keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h create mode 100644 keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk create mode 100644 keyboards/proton_c/bootloader_defs.h create mode 100644 keyboards/proton_c/chconf.h create mode 100644 keyboards/proton_c/config.h create mode 100644 keyboards/proton_c/halconf.h create mode 100644 keyboards/proton_c/keymaps/default/keymap.c create mode 100644 keyboards/proton_c/mcuconf.h create mode 100644 keyboards/proton_c/proton_c.c create mode 100644 keyboards/proton_c/proton_c.h create mode 100644 keyboards/proton_c/readme.md create mode 100644 keyboards/proton_c/rules.mk diff --git a/common_features.mk b/common_features.mk index 3fd8361a52..f44dfc47de 100644 --- a/common_features.mk +++ b/common_features.mk @@ -244,7 +244,7 @@ QUANTUM_SRC:= \ $(QUANTUM_DIR)/keymap_common.c \ $(QUANTUM_DIR)/keycode_config.c -ifndef CUSTOM_MATRIX +ifneq ($(strip $(CUSTOM_MATRIX)), yes) ifeq ($(strip $(SPLIT_KEYBOARD)), yes) QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c else diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c new file mode 100644 index 0000000000..4331155df4 --- /dev/null +++ b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.c @@ -0,0 +1,126 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + +#if HAL_USE_SDC || defined(__DOXYGEN__) +/** + * @brief SDC card detection. + */ +bool sdc_lld_is_card_inserted(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief SDC card write protection detection. + */ +bool sdc_lld_is_write_protected(SDCDriver *sdcp) { + + (void)sdcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif /* HAL_USE_SDC */ + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h new file mode 100644 index 0000000000..ec26557f3a --- /dev/null +++ b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.h @@ -0,0 +1,1187 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for Clueboard 60% Keyboard + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F303XC +#define BOARD_NAME "Planck PCB" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 8000000U +#endif + +// #define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F303xC + +/* + * IO pins assignments. + */ +#define GPIOA_PIN0 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_PIN13 13U +#define GPIOB_PIN14 14U +#define GPIOB_PIN15 15U + +#define GPIOC_PIN0 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_PIN6 6U +#define GPIOC_PIN7 7U +#define GPIOC_PIN8 8U +#define GPIOC_PIN9 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_PIN14 14U +#define GPIOC_PIN15 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_I2C2_SDA 0U +#define GPIOF_I2C2_SCL 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +#define GPIOG_PIN0 0U +#define GPIOG_PIN1 1U +#define GPIOG_PIN2 2U +#define GPIOG_PIN3 3U +#define GPIOG_PIN4 4U +#define GPIOG_PIN5 5U +#define GPIOG_PIN6 6U +#define GPIOG_PIN7 7U +#define GPIOG_PIN8 8U +#define GPIOG_PIN9 9U +#define GPIOG_PIN10 10U +#define GPIOG_PIN11 11U +#define GPIOG_PIN12 12U +#define GPIOG_PIN13 13U +#define GPIOG_PIN14 14U +#define GPIOG_PIN15 15U + +#define GPIOH_PIN0 0U +#define GPIOH_PIN1 1U +#define GPIOH_PIN2 2U +#define GPIOH_PIN3 3U +#define GPIOH_PIN4 4U +#define GPIOH_PIN5 5U +#define GPIOH_PIN6 6U +#define GPIOH_PIN7 7U +#define GPIOH_PIN8 8U +#define GPIOH_PIN9 9U +#define GPIOH_PIN10 10U +#define GPIOH_PIN11 11U +#define GPIOH_PIN12 12U +#define GPIOH_PIN13 13U +#define GPIOH_PIN14 14U +#define GPIOH_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_L3GD20_SDI PAL_LINE(GPIOA, 7U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_PIN6 PAL_LINE(GPIOF, 0U) +#define LINE_PIN7 PAL_LINE(GPIOF, 1U) + +#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U) + + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - NC + * PA1 - NC + * PA2 - COL1 + * PA3 - COL2 + * PA4 - SPEAKER1 + * PA5 - SPEAKER2 + * PA6 - COL3 + * PA7 - COL8 + * PA8 - COL6 + * PA9 - COL7 + * PA10 - ROW5 + * PA11 - USB_DM (alternate 14). + * PA12 - USB_DP (alternate 14). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - ROW4 + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \ + PIN_MODE_ALTERNATE(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \ + PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \ + PIN_OSPEED_HIGH(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_HIGH(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_FLOATING(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \ + PIN_AFIO_AF(GPIOA_PIN1, 1) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0) | \ + PIN_AFIO_AF(GPIOA_PIN5, 5) | \ + PIN_AFIO_AF(GPIOA_PIN6, 5) | \ + PIN_AFIO_AF(GPIOA_PIN7, 5)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 14) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 14) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (alternate 0). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 LSM303DLHC_SCL (alternate 4). + * PB7 - PIN7 LSM303DLHC_SDA (alternate 4). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - PIN13 (input pullup). + * PB14 - PIN14 (input pullup). + * PB15 - PIN15 (input pullup). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_ALTERNATE(GPIOB_PIN6) | \ + PIN_MODE_OUTPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_INPUT(GPIOB_PIN13) | \ + PIN_MODE_INPUT(GPIOB_PIN14) | \ + PIN_MODE_INPUT(GPIOB_PIN15)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN15)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_HIGH(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN15)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOB_PIN6) | \ + PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN15)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_LOW(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_PIN13) | \ + PIN_ODR_HIGH(GPIOB_PIN14) | \ + PIN_ODR_HIGH(GPIOB_PIN15)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0) | \ + PIN_AFIO_AF(GPIOB_PIN6, 4) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0) | \ + PIN_AFIO_AF(GPIOB_PIN13, 0) | \ + PIN_AFIO_AF(GPIOB_PIN14, 0) | \ + PIN_AFIO_AF(GPIOB_PIN15, 0)) + +/* + * GPIOC setup: + * + * PC0 - PIN0 (input pullup). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - PIN6 (input pullup). + * PC7 - PIN7 (input pullup). + * PC8 - PIN8 (input pullup). + * PC9 - PIN9 (input pullup). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - PIN14 (input floating). + * PC15 - PIN15 (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_INPUT(GPIOC_PIN6) | \ + PIN_MODE_INPUT(GPIOC_PIN7) | \ + PIN_MODE_INPUT(GPIOC_PIN8) | \ + PIN_MODE_INPUT(GPIOC_PIN9) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_PIN14) | \ + PIN_MODE_INPUT(GPIOC_PIN15)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN15)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_PIN14) | \ + PIN_OSPEED_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN14) | \ + PIN_PUPDR_FLOATING(GPIOC_PIN15)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_HIGH(GPIOC_PIN6) | \ + PIN_ODR_HIGH(GPIOC_PIN7) | \ + PIN_ODR_HIGH(GPIOC_PIN8) | \ + PIN_ODR_HIGH(GPIOC_PIN9) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_PIN14) | \ + PIN_ODR_HIGH(GPIOC_PIN15)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0) | \ + PIN_AFIO_AF(GPIOC_PIN6, 0) | \ + PIN_AFIO_AF(GPIOC_PIN7, 0)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \ + PIN_AFIO_AF(GPIOC_PIN9, 0) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0) | \ + PIN_AFIO_AF(GPIOC_PIN14, 0) | \ + PIN_AFIO_AF(GPIOC_PIN15, 0)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD11 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 L3GD20_CS (output pushpull maximum). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (output pushpull maximum). + * PE9 - PIN9 (output pushpull maximum). + * PE10 - PIN10 (output pushpull maximum). + * PE11 - PIN11 (output pushpull maximum). + * PE12 - PIN12 (output pushpull maximum). + * PE13 - PIN13 (output pushpull maximum). + * PE14 - PIN14 (output pushpull maximum). + * PE15 - PIN15 (output pushpull maximum). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) |\ + PIN_MODE_OUTPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) |\ + PIN_MODE_INPUT(GPIOE_PIN5) |\ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_OUTPUT(GPIOE_PIN8) | \ + PIN_MODE_OUTPUT(GPIOE_PIN9) | \ + PIN_MODE_OUTPUT(GPIOE_PIN10) | \ + PIN_MODE_OUTPUT(GPIOE_PIN11) | \ + PIN_MODE_OUTPUT(GPIOE_PIN12) | \ + PIN_MODE_OUTPUT(GPIOE_PIN13) | \ + PIN_MODE_OUTPUT(GPIOE_PIN14) | \ + PIN_MODE_OUTPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\ + PIN_OSPEED_HIGH(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_HIGH(GPIOE_PIN8) | \ + PIN_OSPEED_HIGH(GPIOE_PIN9) | \ + PIN_OSPEED_HIGH(GPIOE_PIN10) | \ + PIN_OSPEED_HIGH(GPIOE_PIN11) | \ + PIN_OSPEED_HIGH(GPIOE_PIN12) | \ + PIN_OSPEED_HIGH(GPIOE_PIN13) | \ + PIN_OSPEED_HIGH(GPIOE_PIN14) | \ + PIN_OSPEED_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN5) |\ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOE_PIN14) |\ + PIN_PUPDR_FLOATING(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_LOW(GPIOE_PIN8) | \ + PIN_ODR_LOW(GPIOE_PIN9) | \ + PIN_ODR_LOW(GPIOE_PIN10) | \ + PIN_ODR_LOW(GPIOE_PIN11) | \ + PIN_ODR_LOW(GPIOE_PIN12) | \ + PIN_ODR_LOW(GPIOE_PIN13) | \ + PIN_ODR_LOW(GPIOE_PIN14) | \ + PIN_ODR_LOW(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0) |\ + PIN_AFIO_AF(GPIOE_PIN3, 0) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0) |\ + PIN_AFIO_AF(GPIOE_PIN5, 0) |\ + PIN_AFIO_AF(GPIOE_PIN6, 0) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0)) + +/* + * GPIOF setup: + * + * PF0 - I2C2_SDA (input floating). + * PF1 - I2C2_SCL (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \ + PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \ + PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \ + PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \ + PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \ + PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \ + PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0)) + +/* + * GPIOG setup: + * + * PG0 - PIN0 (input pullup). + * PG1 - PIN1 (input pullup). + * PG2 - PIN2 (input pullup). + * PG3 - PIN3 (input pullup). + * PG4 - PIN4 (input pullup). + * PG5 - PIN5 (input pullup). + * PG6 - PIN6 (input pullup). + * PG7 - PIN7 (input pullup). + * PG8 - PIN8 (input pullup). + * PG9 - PIN9 (input pullup). + * PG10 - PIN10 (input pullup). + * PG11 - PIN11 (input pullup). + * PG12 - PIN12 (input pullup). + * PG13 - PIN13 (input pullup). + * PG14 - PIN14 (input pullup). + * PG15 - PIN15 (input pullup). + */ +#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \ + PIN_MODE_INPUT(GPIOG_PIN1) | \ + PIN_MODE_INPUT(GPIOG_PIN2) | \ + PIN_MODE_INPUT(GPIOG_PIN3) | \ + PIN_MODE_INPUT(GPIOG_PIN4) | \ + PIN_MODE_INPUT(GPIOG_PIN5) | \ + PIN_MODE_INPUT(GPIOG_PIN6) | \ + PIN_MODE_INPUT(GPIOG_PIN7) | \ + PIN_MODE_INPUT(GPIOG_PIN8) | \ + PIN_MODE_INPUT(GPIOG_PIN9) | \ + PIN_MODE_INPUT(GPIOG_PIN10) | \ + PIN_MODE_INPUT(GPIOG_PIN11) | \ + PIN_MODE_INPUT(GPIOG_PIN12) | \ + PIN_MODE_INPUT(GPIOG_PIN13) | \ + PIN_MODE_INPUT(GPIOG_PIN14) | \ + PIN_MODE_INPUT(GPIOG_PIN15)) +#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOG_PIN15)) +#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOG_PIN15)) +#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOG_PIN15)) +#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \ + PIN_ODR_HIGH(GPIOG_PIN1) | \ + PIN_ODR_HIGH(GPIOG_PIN2) | \ + PIN_ODR_HIGH(GPIOG_PIN3) | \ + PIN_ODR_HIGH(GPIOG_PIN4) | \ + PIN_ODR_HIGH(GPIOG_PIN5) | \ + PIN_ODR_HIGH(GPIOG_PIN6) | \ + PIN_ODR_HIGH(GPIOG_PIN7) | \ + PIN_ODR_HIGH(GPIOG_PIN8) | \ + PIN_ODR_HIGH(GPIOG_PIN9) | \ + PIN_ODR_HIGH(GPIOG_PIN10) | \ + PIN_ODR_HIGH(GPIOG_PIN11) | \ + PIN_ODR_HIGH(GPIOG_PIN12) | \ + PIN_ODR_HIGH(GPIOG_PIN13) | \ + PIN_ODR_HIGH(GPIOG_PIN14) | \ + PIN_ODR_HIGH(GPIOG_PIN15)) +#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \ + PIN_AFIO_AF(GPIOG_PIN1, 0) | \ + PIN_AFIO_AF(GPIOG_PIN2, 0) | \ + PIN_AFIO_AF(GPIOG_PIN3, 0) | \ + PIN_AFIO_AF(GPIOG_PIN4, 0) | \ + PIN_AFIO_AF(GPIOG_PIN5, 0) | \ + PIN_AFIO_AF(GPIOG_PIN6, 0) | \ + PIN_AFIO_AF(GPIOG_PIN7, 0)) +#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \ + PIN_AFIO_AF(GPIOG_PIN9, 0) | \ + PIN_AFIO_AF(GPIOG_PIN10, 0) | \ + PIN_AFIO_AF(GPIOG_PIN11, 0) | \ + PIN_AFIO_AF(GPIOG_PIN12, 0) | \ + PIN_AFIO_AF(GPIOG_PIN13, 0) | \ + PIN_AFIO_AF(GPIOG_PIN14, 0) | \ + PIN_AFIO_AF(GPIOG_PIN15, 0)) + +/* + * GPIOH setup: + * + * PH0 - PIN0 (input pullup). + * PH1 - PIN1 (input pullup). + * PH2 - PIN2 (input pullup). + * PH3 - PIN3 (input pullup). + * PH4 - PIN4 (input pullup). + * PH5 - PIN5 (input pullup). + * PH6 - PIN6 (input pullup). + * PH7 - PIN7 (input pullup). + * PH8 - PIN8 (input pullup). + * PH9 - PIN9 (input pullup). + * PH10 - PIN10 (input pullup). + * PH11 - PIN11 (input pullup). + * PH12 - PIN12 (input pullup). + * PH13 - PIN13 (input pullup). + * PH14 - PIN14 (input pullup). + * PH15 - PIN15 (input pullup). + */ +#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \ + PIN_MODE_INPUT(GPIOH_PIN1) | \ + PIN_MODE_INPUT(GPIOH_PIN2) | \ + PIN_MODE_INPUT(GPIOH_PIN3) | \ + PIN_MODE_INPUT(GPIOH_PIN4) | \ + PIN_MODE_INPUT(GPIOH_PIN5) | \ + PIN_MODE_INPUT(GPIOH_PIN6) | \ + PIN_MODE_INPUT(GPIOH_PIN7) | \ + PIN_MODE_INPUT(GPIOH_PIN8) | \ + PIN_MODE_INPUT(GPIOH_PIN9) | \ + PIN_MODE_INPUT(GPIOH_PIN10) | \ + PIN_MODE_INPUT(GPIOH_PIN11) | \ + PIN_MODE_INPUT(GPIOH_PIN12) | \ + PIN_MODE_INPUT(GPIOH_PIN13) | \ + PIN_MODE_INPUT(GPIOH_PIN14) | \ + PIN_MODE_INPUT(GPIOH_PIN15)) +#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOH_PIN15)) +#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOH_PIN15)) +#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOH_PIN15)) +#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \ + PIN_ODR_HIGH(GPIOH_PIN1) | \ + PIN_ODR_HIGH(GPIOH_PIN2) | \ + PIN_ODR_HIGH(GPIOH_PIN3) | \ + PIN_ODR_HIGH(GPIOH_PIN4) | \ + PIN_ODR_HIGH(GPIOH_PIN5) | \ + PIN_ODR_HIGH(GPIOH_PIN6) | \ + PIN_ODR_HIGH(GPIOH_PIN7) | \ + PIN_ODR_HIGH(GPIOH_PIN8) | \ + PIN_ODR_HIGH(GPIOH_PIN9) | \ + PIN_ODR_HIGH(GPIOH_PIN10) | \ + PIN_ODR_HIGH(GPIOH_PIN11) | \ + PIN_ODR_HIGH(GPIOH_PIN12) | \ + PIN_ODR_HIGH(GPIOH_PIN13) | \ + PIN_ODR_HIGH(GPIOH_PIN14) | \ + PIN_ODR_HIGH(GPIOH_PIN15)) +#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \ + PIN_AFIO_AF(GPIOH_PIN1, 0) | \ + PIN_AFIO_AF(GPIOH_PIN2, 0) | \ + PIN_AFIO_AF(GPIOH_PIN3, 0) | \ + PIN_AFIO_AF(GPIOH_PIN4, 0) | \ + PIN_AFIO_AF(GPIOH_PIN5, 0) | \ + PIN_AFIO_AF(GPIOH_PIN6, 0) | \ + PIN_AFIO_AF(GPIOH_PIN7, 0)) +#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \ + PIN_AFIO_AF(GPIOH_PIN9, 0) | \ + PIN_AFIO_AF(GPIOH_PIN10, 0) | \ + PIN_AFIO_AF(GPIOH_PIN11, 0) | \ + PIN_AFIO_AF(GPIOH_PIN12, 0) | \ + PIN_AFIO_AF(GPIOH_PIN13, 0) | \ + PIN_AFIO_AF(GPIOH_PIN14, 0) | \ + PIN_AFIO_AF(GPIOH_PIN15, 0)) + + +/* + * USB bus activation macro, required by the USB driver. + */ +// #define usb_lld_connect_bus(usbp) +#define usb_lld_connect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_ALTERNATE(14))) +// #define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT) +/* + * USB bus de-activation macro, required by the USB driver. + */ +// #define usb_lld_disconnect_bus(usbp) +#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP) +// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12) + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk new file mode 100644 index 0000000000..43377629a3 --- /dev/null +++ b/keyboards/proton_c/boards/GENERIC_STM32_F303XC/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F303XC diff --git a/keyboards/proton_c/bootloader_defs.h b/keyboards/proton_c/bootloader_defs.h new file mode 100644 index 0000000000..3b0e9d20a6 --- /dev/null +++ b/keyboards/proton_c/bootloader_defs.h @@ -0,0 +1,7 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here: + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/proton_c/chconf.h b/keyboards/proton_c/chconf.h new file mode 100644 index 0000000000..1d9f12ff1f --- /dev/null +++ b/keyboards/proton_c/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/proton_c/config.h b/keyboards/proton_c/config.h new file mode 100644 index 0000000000..1a2346d415 --- /dev/null +++ b/keyboards/proton_c/config.h @@ -0,0 +1,121 @@ +/* Copyright 2018 Jack Humbert + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0006 +#define MANUFACTURER QMK +#define PRODUCT Proton C +#define DESCRIPTION A compact ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 1 + +#define MATRIX_ROW_PINS { B9 } +#define MATRIX_COL_PINS { B0 } + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +// #define WS2812_LED_N 2 +// #define RGBLED_NUM WS2812_LED_N +// #define WS2812_TIM_N 2 +// #define WS2812_TIM_CH 2 +// #define PORT_WS2812 GPIOA +// #define PIN_WS2812 1 +// #define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + diff --git a/keyboards/proton_c/halconf.h b/keyboards/proton_c/halconf.h new file mode 100644 index 0000000000..8fe8e0c6f5 --- /dev/null +++ b/keyboards/proton_c/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/proton_c/keymaps/default/keymap.c b/keyboards/proton_c/keymaps/default/keymap.c new file mode 100644 index 0000000000..a3103432fa --- /dev/null +++ b/keyboards/proton_c/keymaps/default/keymap.c @@ -0,0 +1,21 @@ +/* Copyright 2018 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = {{ KC_A }} +}; diff --git a/keyboards/proton_c/mcuconf.h b/keyboards/proton_c/mcuconf.h new file mode 100644 index 0000000000..7c3c6e570c --- /dev/null +++ b/keyboards/proton_c/mcuconf.h @@ -0,0 +1,257 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef MCUCONF_H +#define MCUCONF_H + +/* + * STM32F3xx drivers configuration. + * The following settings override the default settings present in + * the various device driver implementation headers. + * Note that the settings for each driver only have effect if the whole + * driver is enabled in halconf.h. + * + * IRQ priorities: + * 15...0 Lowest...Highest. + * + * DMA priorities: + * 0...3 Lowest...Highest. + */ + +#define STM32F3xx_MCUCONF + +/* + * HAL driver system settings. + */ +#define STM32_NO_INIT FALSE +#define STM32_PVD_ENABLE FALSE +#define STM32_PLS STM32_PLS_LEV0 +#define STM32_HSI_ENABLED TRUE +#define STM32_LSI_ENABLED TRUE +#define STM32_HSE_ENABLED TRUE +#define STM32_LSE_ENABLED FALSE +#define STM32_SW STM32_SW_PLL +#define STM32_PLLSRC STM32_PLLSRC_HSE +#define STM32_PREDIV_VALUE 1 +#define STM32_PLLMUL_VALUE 9 +#define STM32_HPRE STM32_HPRE_DIV1 +#define STM32_PPRE1 STM32_PPRE1_DIV2 +#define STM32_PPRE2 STM32_PPRE2_DIV2 +#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK +#define STM32_ADC12PRES STM32_ADC12PRES_DIV1 +#define STM32_ADC34PRES STM32_ADC34PRES_DIV1 +#define STM32_USART1SW STM32_USART1SW_PCLK +#define STM32_USART2SW STM32_USART2SW_PCLK +#define STM32_USART3SW STM32_USART3SW_PCLK +#define STM32_UART4SW STM32_UART4SW_PCLK +#define STM32_UART5SW STM32_UART5SW_PCLK +#define STM32_I2C1SW STM32_I2C1SW_SYSCLK +#define STM32_I2C2SW STM32_I2C2SW_SYSCLK +#define STM32_TIM1SW STM32_TIM1SW_PCLK2 +#define STM32_TIM8SW STM32_TIM8SW_PCLK2 +#define STM32_RTCSEL STM32_RTCSEL_LSI +#define STM32_USB_CLOCK_REQUIRED TRUE +#define STM32_USBPRE STM32_USBPRE_DIV1P5 + +#undef STM32_HSE_BYPASS +// #error "oh no" +// #endif + +/* + * ADC driver system settings. + */ +#define STM32_ADC_DUAL_MODE FALSE +#define STM32_ADC_COMPACT_SAMPLES FALSE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE +#define STM32_ADC_USE_ADC4 FALSE +#define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(1, 1) +#define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) +#define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 5) +#define STM32_ADC_ADC4_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) +#define STM32_ADC_ADC1_DMA_PRIORITY 2 +#define STM32_ADC_ADC2_DMA_PRIORITY 2 +#define STM32_ADC_ADC3_DMA_PRIORITY 2 +#define STM32_ADC_ADC4_DMA_PRIORITY 2 +#define STM32_ADC_ADC12_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_IRQ_PRIORITY 5 +#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC2_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC3_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC4_DMA_IRQ_PRIORITY 5 +#define STM32_ADC_ADC12_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 +#define STM32_ADC_ADC34_CLOCK_MODE ADC_CCR_CKMODE_AHB_DIV1 + +/* + * CAN driver system settings. + */ +#define STM32_CAN_USE_CAN1 FALSE +#define STM32_CAN_CAN1_IRQ_PRIORITY 11 + +/* + * DAC driver system settings. + */ +#define STM32_DAC_DUAL_MODE FALSE +#define STM32_DAC_USE_DAC1_CH1 TRUE +#define STM32_DAC_USE_DAC1_CH2 TRUE +#define STM32_DAC_DAC1_CH1_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH2_IRQ_PRIORITY 10 +#define STM32_DAC_DAC1_CH1_DMA_PRIORITY 2 +#define STM32_DAC_DAC1_CH2_DMA_PRIORITY 2 + +/* + * EXT driver system settings. + */ +#define STM32_EXT_EXTI0_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI1_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI2_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI3_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI4_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI5_9_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI10_15_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI16_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI17_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI18_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI19_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI20_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI21_22_29_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI30_32_IRQ_PRIORITY 6 +#define STM32_EXT_EXTI33_IRQ_PRIORITY 6 + +/* + * GPT driver system settings. + */ +#define STM32_GPT_USE_TIM1 FALSE +#define STM32_GPT_USE_TIM2 FALSE +#define STM32_GPT_USE_TIM3 FALSE +#define STM32_GPT_USE_TIM4 FALSE +#define STM32_GPT_USE_TIM6 TRUE +#define STM32_GPT_USE_TIM7 TRUE +#define STM32_GPT_USE_TIM8 TRUE +#define STM32_GPT_TIM1_IRQ_PRIORITY 7 +#define STM32_GPT_TIM2_IRQ_PRIORITY 7 +#define STM32_GPT_TIM3_IRQ_PRIORITY 7 +#define STM32_GPT_TIM4_IRQ_PRIORITY 7 +#define STM32_GPT_TIM6_IRQ_PRIORITY 7 +#define STM32_GPT_TIM7_IRQ_PRIORITY 7 +#define STM32_GPT_TIM8_IRQ_PRIORITY 7 + +/* + * I2C driver system settings. + */ +#define STM32_I2C_USE_I2C1 FALSE +#define STM32_I2C_USE_I2C2 FALSE +#define STM32_I2C_BUSY_TIMEOUT 50 +#define STM32_I2C_I2C1_IRQ_PRIORITY 10 +#define STM32_I2C_I2C2_IRQ_PRIORITY 10 +#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_I2C1_DMA_PRIORITY 1 +#define STM32_I2C_I2C2_DMA_PRIORITY 1 +#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") + +/* + * ICU driver system settings. + */ +#define STM32_ICU_USE_TIM1 FALSE +#define STM32_ICU_USE_TIM2 FALSE +#define STM32_ICU_USE_TIM3 FALSE +#define STM32_ICU_USE_TIM4 FALSE +#define STM32_ICU_USE_TIM8 FALSE +#define STM32_ICU_TIM1_IRQ_PRIORITY 7 +#define STM32_ICU_TIM2_IRQ_PRIORITY 7 +#define STM32_ICU_TIM3_IRQ_PRIORITY 7 +#define STM32_ICU_TIM4_IRQ_PRIORITY 7 +#define STM32_ICU_TIM8_IRQ_PRIORITY 7 + +/* + * PWM driver system settings. + */ +#define STM32_PWM_USE_ADVANCED FALSE +#define STM32_PWM_USE_TIM1 FALSE +#define STM32_PWM_USE_TIM2 TRUE +#define STM32_PWM_USE_TIM3 TRUE +#define STM32_PWM_USE_TIM4 FALSE +#define STM32_PWM_USE_TIM8 FALSE +#define STM32_PWM_TIM1_IRQ_PRIORITY 7 +#define STM32_PWM_TIM2_IRQ_PRIORITY 7 +#define STM32_PWM_TIM3_IRQ_PRIORITY 7 +#define STM32_PWM_TIM4_IRQ_PRIORITY 7 +#define STM32_PWM_TIM8_IRQ_PRIORITY 7 + +/* + * SERIAL driver system settings. + */ +#define STM32_SERIAL_USE_USART1 FALSE +#define STM32_SERIAL_USE_USART2 TRUE +#define STM32_SERIAL_USE_USART3 FALSE +#define STM32_SERIAL_USE_UART4 FALSE +#define STM32_SERIAL_USE_UART5 FALSE +#define STM32_SERIAL_USART1_PRIORITY 12 +#define STM32_SERIAL_USART2_PRIORITY 12 +#define STM32_SERIAL_USART3_PRIORITY 12 +#define STM32_SERIAL_UART4_PRIORITY 12 +#define STM32_SERIAL_UART5_PRIORITY 12 + +/* + * SPI driver system settings. + */ +#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI2 FALSE +#define STM32_SPI_USE_SPI3 FALSE +#define STM32_SPI_SPI1_DMA_PRIORITY 1 +#define STM32_SPI_SPI2_DMA_PRIORITY 1 +#define STM32_SPI_SPI3_DMA_PRIORITY 1 +#define STM32_SPI_SPI1_IRQ_PRIORITY 10 +#define STM32_SPI_SPI2_IRQ_PRIORITY 10 +#define STM32_SPI_SPI3_IRQ_PRIORITY 10 +#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure") + +/* + * ST driver system settings. + */ +#define STM32_ST_IRQ_PRIORITY 8 +#define STM32_ST_USE_TIMER 2 + +/* + * UART driver system settings. + */ +#define STM32_UART_USE_USART1 FALSE +#define STM32_UART_USE_USART2 FALSE +#define STM32_UART_USE_USART3 FALSE +#define STM32_UART_USART1_IRQ_PRIORITY 12 +#define STM32_UART_USART2_IRQ_PRIORITY 12 +#define STM32_UART_USART3_IRQ_PRIORITY 12 +#define STM32_UART_USART1_DMA_PRIORITY 0 +#define STM32_UART_USART2_DMA_PRIORITY 0 +#define STM32_UART_USART3_DMA_PRIORITY 0 +#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure") + +/* + * USB driver system settings. + */ +#define STM32_USB_USE_USB1 TRUE +#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE +#define STM32_USB_USB1_HP_IRQ_PRIORITY 13 +#define STM32_USB_USB1_LP_IRQ_PRIORITY 14 + +/* + * WDG driver system settings. + */ +#define STM32_WDG_USE_IWDG FALSE + +#endif /* MCUCONF_H */ diff --git a/keyboards/proton_c/proton_c.c b/keyboards/proton_c/proton_c.c new file mode 100644 index 0000000000..5256343478 --- /dev/null +++ b/keyboards/proton_c/proton_c.c @@ -0,0 +1,25 @@ +/* Copyright 2018 Jack Humbert + * + * 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 . + */ + +#include "proton_c.h" + +void matrix_init_kb(void) { + // Turn status LED on + setPinOutput(C13); + writePinHigh(C13); + + matrix_init_user(); +} diff --git a/keyboards/proton_c/proton_c.h b/keyboards/proton_c/proton_c.h new file mode 100644 index 0000000000..159f9975a3 --- /dev/null +++ b/keyboards/proton_c/proton_c.h @@ -0,0 +1,18 @@ +/* Copyright 2018 Jack Humbert + * + * 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 +#include "quantum.h" diff --git a/keyboards/proton_c/readme.md b/keyboards/proton_c/readme.md new file mode 100644 index 0000000000..5f27795aec --- /dev/null +++ b/keyboards/proton_c/readme.md @@ -0,0 +1,16 @@ +Proton C +=== + +![Proton C](https://i.imgur.com/xZrjIqa.jpg) + +A Pro Micro drop-in replacement. + +Keyboard Maintainer: [Jack Humbert](https://github.com/jackhumbert) +Hardware Supported: QMK Proton C +Hardware Availability: [List of vendors](https://qmk.fm/proton-c) + +Make example for this keyboard (after setting up your build environment): + + make proton_c: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/proton_c/rules.mk b/keyboards/proton_c/rules.mk new file mode 100644 index 0000000000..f682c1fd6b --- /dev/null +++ b/keyboards/proton_c/rules.mk @@ -0,0 +1,51 @@ +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +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 +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +# SERIAL_LINK_ENABLE = yes -- cgit v1.2.3 From 5779ffb59a2e36fd45c3d4000d41ad73ad140de3 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 1 Nov 2018 21:49:18 -0700 Subject: Set the executable bit for sh scripts under util. --- util/activate_msys2.sh | 0 util/activate_wsl.sh | 0 util/freebsd_install.sh | 0 util/generate_internal_docs.sh | 0 util/msys2_install.sh | 0 util/travis_build.sh | 0 util/travis_compiled_push.sh | 0 util/travis_docs.sh | 0 util/travis_push.sh | 0 util/win_shared_install.sh | 0 util/wsl_install.sh | 0 11 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 util/activate_msys2.sh mode change 100644 => 100755 util/activate_wsl.sh mode change 100644 => 100755 util/freebsd_install.sh mode change 100644 => 100755 util/generate_internal_docs.sh mode change 100644 => 100755 util/msys2_install.sh mode change 100644 => 100755 util/travis_build.sh mode change 100644 => 100755 util/travis_compiled_push.sh mode change 100644 => 100755 util/travis_docs.sh mode change 100644 => 100755 util/travis_push.sh mode change 100644 => 100755 util/win_shared_install.sh mode change 100644 => 100755 util/wsl_install.sh diff --git a/util/activate_msys2.sh b/util/activate_msys2.sh old mode 100644 new mode 100755 diff --git a/util/activate_wsl.sh b/util/activate_wsl.sh old mode 100644 new mode 100755 diff --git a/util/freebsd_install.sh b/util/freebsd_install.sh old mode 100644 new mode 100755 diff --git a/util/generate_internal_docs.sh b/util/generate_internal_docs.sh old mode 100644 new mode 100755 diff --git a/util/msys2_install.sh b/util/msys2_install.sh old mode 100644 new mode 100755 diff --git a/util/travis_build.sh b/util/travis_build.sh old mode 100644 new mode 100755 diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh old mode 100644 new mode 100755 diff --git a/util/travis_docs.sh b/util/travis_docs.sh old mode 100644 new mode 100755 diff --git a/util/travis_push.sh b/util/travis_push.sh old mode 100644 new mode 100755 diff --git a/util/win_shared_install.sh b/util/win_shared_install.sh old mode 100644 new mode 100755 diff --git a/util/wsl_install.sh b/util/wsl_install.sh old mode 100644 new mode 100755 -- cgit v1.2.3 From a5fa75fcb3de822f4e43dcf29cee6eb9f945a992 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Fri, 2 Nov 2018 15:28:16 -0400 Subject: Move disable JTAG code from `keyboard_init` to `keyboard_setup` This way all split keyboards are using that code instead of just those using split_common with the fix --- quantum/split_common/matrix.c | 6 ------ quantum/split_common/split_util.c | 14 -------------- tmk_core/common/keyboard.c | 14 +++++++++----- tmk_core/common/keyboard.h | 2 ++ 4 files changed, 11 insertions(+), 25 deletions(-) diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index ff6738b58f..d6359b51fb 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -128,12 +128,6 @@ uint8_t matrix_cols(void) void matrix_init(void) { -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< Date: Fri, 2 Nov 2018 15:55:54 -0400 Subject: Remove old declaration Co-Authored-By: nooges --- quantum/split_common/split_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 7d1d7ee047..56077e4f20 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -92,7 +92,6 @@ void split_keyboard_setup(void) { sei(); } -void disable_JTAG(void); void keyboard_slave_loop(void) { matrix_init(); -- cgit v1.2.3 From 563fe23e53fb747f509b8558bb29bde0baf2d6a8 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Tue, 30 Oct 2018 12:23:57 -0400 Subject: Fix CTRL/ALT keyboard does not wake computer from sleep Fix for Massdrop CTRL and ALT keyboards not waking computer from sleep --- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 30 ++++++++++++++++++---------- tmk_core/protocol/arm_atsam/usb/udc.h | 2 +- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 54d056a14e..d3dc272ee0 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -62,6 +62,12 @@ void send_keyboard(report_keyboard_t *report) { uint32_t irqflags; + if (usb_state == USB_STATE_POWERDOWN) + { + udc_remotewakeup(); + return; + } + #ifdef NKRO_ENABLE if (!keymap_config.nkro) { @@ -156,25 +162,27 @@ void send_consumer(uint16_t data) } uint8_t g_drvid; +uint8_t g_usb_sleeping = 0; void main_subtask_usb_state(void) { if (usb_state == USB_STATE_POWERDOWN) { - uint32_t timer_led = timer_read32(); - - led_on; - if (led_enabled) + if (!g_usb_sleeping) { - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + g_usb_sleeping = 1; + if (led_enabled) { - I2C3733_Control_Set(0); + for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + { + I2C3733_Control_Set(0); + } } } - while (usb_state == USB_STATE_POWERDOWN) - { - if (timer_read32() - timer_led > 1000) led_off; //Good to indicate went to sleep, but only for a second - } + } + else if (g_usb_sleeping) + { + g_usb_sleeping = 0; if (led_enabled) { for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) @@ -182,12 +190,12 @@ void main_subtask_usb_state(void) I2C3733_Control_Set(1); } } - led_off; } } void main_subtask_led(void) { + if (g_usb_sleeping) return; led_matrix_task(); } diff --git a/tmk_core/protocol/arm_atsam/usb/udc.h b/tmk_core/protocol/arm_atsam/usb/udc.h index c88a442cb6..33335d1869 100644 --- a/tmk_core/protocol/arm_atsam/usb/udc.h +++ b/tmk_core/protocol/arm_atsam/usb/udc.h @@ -210,7 +210,7 @@ static inline void udc_detach(void) /*! \brief The USB driver sends a resume signal called \e "Upstream Resume" * This is authorized only when the remote wakeup feature is enabled by host. */ -static inline void udc_remotewakeup(void) +inline void udc_remotewakeup(void) { udd_send_remotewakeup(); } -- cgit v1.2.3 From cec203ea80c8e9365bb5f43418fba5971dd4091f Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 2 Nov 2018 15:30:51 -0400 Subject: USB Suspend for arm_atsam protocol Rewrote USB state tracking for implementation of suspend state. Updated suspend.c in entirety. Main subtasks (generally hardware related) are now run prior to keyboard task. --- tmk_core/common/arm_atsam/suspend.c | 90 ++++++++++++++++++++++++---- tmk_core/protocol/arm_atsam/i2c_master.c | 5 +- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 80 ++++++++++++++++--------- tmk_core/protocol/arm_atsam/usb/ui.c | 8 +-- tmk_core/protocol/arm_atsam/usb/ui.h | 6 -- 5 files changed, 136 insertions(+), 53 deletions(-) diff --git a/tmk_core/common/arm_atsam/suspend.c b/tmk_core/common/arm_atsam/suspend.c index 01d1930ea5..e34965df64 100644 --- a/tmk_core/common/arm_atsam/suspend.c +++ b/tmk_core/common/arm_atsam/suspend.c @@ -1,17 +1,85 @@ -/* Copyright 2017 Fred Sundvik +#include "matrix.h" +#include "i2c_master.h" +#include "led_matrix.h" +#include "suspend.h" + +/** \brief Suspend idle * - * 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. + * FIXME: needs doc + */ +void suspend_idle(uint8_t time) { + /* Note: Not used anywhere currently */ +} + +/** \brief Run user level Power down * - * 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. + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_user (void) { + +} + +/** \brief Run keyboard level Power down + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_power_down_kb(void) { + suspend_power_down_user(); +} + +/** \brief Suspend power down + * + * FIXME: needs doc + */ +void suspend_power_down(void) +{ + I2C3733_Control_Set(0); //Disable LED driver + + suspend_power_down_kb(); +} + +__attribute__ ((weak)) void matrix_power_up(void) {} +__attribute__ ((weak)) void matrix_power_down(void) {} +bool suspend_wakeup_condition(void) { + matrix_power_up(); + matrix_scan(); + matrix_power_down(); + for (uint8_t r = 0; r < MATRIX_ROWS; r++) { + if (matrix_get_row(r)) return true; + } + return false; +} + +/** \brief run user level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_user(void) { + +} + +/** \brief run keyboard level code immediately after wakeup + * + * FIXME: needs doc + */ +__attribute__ ((weak)) +void suspend_wakeup_init_kb(void) { + suspend_wakeup_init_user(); +} + +/** \brief run immediately after wakeup * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . + * FIXME: needs doc */ +void suspend_wakeup_init(void) { + /* If LEDs are set to enabled, enable the hardware */ + if (led_enabled) { + I2C3733_Control_Set(1); + } + suspend_wakeup_init_kb(); +} diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index 4f5a79e89f..ece9ee5db8 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -261,8 +261,9 @@ uint8_t I2C3733_Init_Control(void) { DBGC(DC_I2C3733_INIT_CONTROL_BEGIN); - srdata.bit.SDB_N = 1; - SPI_WriteSRData(); + //Hardware state shutdown on boot + //USB state machine will enable driver when communication is ready + I2C3733_Control_Set(0); CLK_delay_ms(1); diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index d3dc272ee0..13034a05d1 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -31,6 +31,8 @@ along with this program. If not, see . //From keyboard's directory #include "config_led.h" +uint8_t g_usb_state = USB_FSMSTATUS_FSMSTATE_OFF_Val; //Saved USB state from hardware value to detect changes + void main_subtasks(void); uint8_t keyboard_leds(void); void send_keyboard(report_keyboard_t *report); @@ -62,12 +64,6 @@ void send_keyboard(report_keyboard_t *report) { uint32_t irqflags; - if (usb_state == USB_STATE_POWERDOWN) - { - udc_remotewakeup(); - return; - } - #ifdef NKRO_ENABLE if (!keymap_config.nkro) { @@ -161,41 +157,56 @@ void send_consumer(uint16_t data) #endif //EXTRAKEY_ENABLE } -uint8_t g_drvid; -uint8_t g_usb_sleeping = 0; - void main_subtask_usb_state(void) { - if (usb_state == USB_STATE_POWERDOWN) + static uint32_t fsmstate_on_delay = 0; //Delay timer to be sure USB is actually operating before bringing up hardware + uint8_t fsmstate_now = USB->DEVICE.FSMSTATUS.reg; //Current state from hardware register + + if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) //If USB SUSPENDED { - if (!g_usb_sleeping) + fsmstate_on_delay = 0; //Clear ON delay timer + + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SUSPEND_Val) //If previously not SUSPENDED { - g_usb_sleeping = 1; - if (led_enabled) - { - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) - { - I2C3733_Control_Set(0); - } - } + suspend_power_down(); //Run suspend routine + g_usb_state = fsmstate_now; //Save current USB state } } - else if (g_usb_sleeping) + else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) //Else if USB SLEEPING { - g_usb_sleeping = 0; - if (led_enabled) + fsmstate_on_delay = 0; //Clear ON delay timer + + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_SLEEP_Val) //If previously not SLEEPING { - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) + suspend_power_down(); //Run suspend routine + g_usb_state = fsmstate_now; //Save current USB state + } + } + else if (fsmstate_now == USB_FSMSTATUS_FSMSTATE_ON_Val) //Else if USB ON + { + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_ON_Val) //If previously not ON + { + if (fsmstate_on_delay == 0) //If ON delay timer is cleared { - I2C3733_Control_Set(1); + fsmstate_on_delay = CLK_get_ms() + 250; //Set ON delay timer + } + else if (CLK_get_ms() > fsmstate_on_delay) //Else if ON delay timer is active and timed out + { + suspend_wakeup_init(); //Run wakeup routine + g_usb_state = fsmstate_now; //Save current USB state } } } + else //Else if USB is in a state not being tracked + { + fsmstate_on_delay = 0; //Clear ON delay timer + } } void main_subtask_led(void) { - if (g_usb_sleeping) return; + if (g_usb_state != USB_FSMSTATUS_FSMSTATE_ON_Val) return; //Only run LED tasks if USB is operating + led_matrix_task(); } @@ -275,8 +286,8 @@ int main(void) i2c_led_q_init(); - for (g_drvid = 0; g_drvid < ISSI3733_DRIVER_COUNT; g_drvid++) - I2C_LED_Q_ONOFF(g_drvid); //Queue data + for (uint8_t drvid = 0; drvid < ISSI3733_DRIVER_COUNT; drvid++) + I2C_LED_Q_ONOFF(drvid); //Queue data keyboard_setup(); @@ -294,10 +305,21 @@ int main(void) while (1) { - keyboard_task(); - main_subtasks(); //Note these tasks will also be run while waiting for USB keyboard polling intervals + if (g_usb_state == USB_FSMSTATUS_FSMSTATE_SUSPEND_Val || g_usb_state == USB_FSMSTATUS_FSMSTATE_SLEEP_Val) + { + if (suspend_wakeup_condition()) + { + udc_remotewakeup(); //Send remote wakeup signal + wait_ms(50); + } + + continue; + } + + keyboard_task(); + #ifdef CONSOLE_ENABLE if (CLK_get_ms() > next_print) { diff --git a/tmk_core/protocol/arm_atsam/usb/ui.c b/tmk_core/protocol/arm_atsam/usb/ui.c index 031678b643..70a6191098 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.c +++ b/tmk_core/protocol/arm_atsam/usb/ui.c @@ -52,8 +52,6 @@ #include "samd51j18a.h" #include "ui.h" -volatile uint8_t usb_state; - //! Sequence process running each \c SEQUENCE_PERIOD ms #define SEQUENCE_PERIOD 150 @@ -72,12 +70,12 @@ static void ui_wakeup_handler(void) void ui_init(void) { - usb_state = USB_STATE_POWERUP; + } void ui_powerdown(void) { - usb_state = USB_STATE_POWERDOWN; + } void ui_wakeup_enable(void) @@ -92,7 +90,7 @@ void ui_wakeup_disable(void) void ui_wakeup(void) { - usb_state = USB_STATE_POWERUP; + } void ui_process(uint16_t framenumber) diff --git a/tmk_core/protocol/arm_atsam/usb/ui.h b/tmk_core/protocol/arm_atsam/usb/ui.h index 3d899e6694..d1c767d457 100644 --- a/tmk_core/protocol/arm_atsam/usb/ui.h +++ b/tmk_core/protocol/arm_atsam/usb/ui.h @@ -47,12 +47,6 @@ #ifndef _UI_H_ #define _UI_H_ -extern volatile uint8_t usb_state; - -#define USB_STATE_UNKNOWN 0 -#define USB_STATE_POWERDOWN 1 -#define USB_STATE_POWERUP 2 - //! \brief Initializes the user interface void ui_init(void); -- cgit v1.2.3 From 6dec3550e0540ec979e11f7f310478877b3764b7 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Fri, 2 Nov 2018 14:48:44 -0700 Subject: Niu keymap (#4273) * Add modified planck layout * Update rules --- keyboards/niu_mini/keymaps/abhixec/keymap.c | 183 +++++++++++++++++++++++++++ keyboards/niu_mini/keymaps/abhixec/readme.md | 5 + keyboards/niu_mini/keymaps/abhixec/rules.mk | 1 + 3 files changed, 189 insertions(+) create mode 100644 keyboards/niu_mini/keymaps/abhixec/keymap.c create mode 100644 keyboards/niu_mini/keymaps/abhixec/readme.md create mode 100644 keyboards/niu_mini/keymaps/abhixec/rules.mk diff --git a/keyboards/niu_mini/keymaps/abhixec/keymap.c b/keyboards/niu_mini/keymaps/abhixec/keymap.c new file mode 100644 index 0000000000..6d3ff8a376 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/keymap.c @@ -0,0 +1,183 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum layers { + _QWERTY, + _COLEMAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + LOWER, + RAISE, + BACKLIT, + EXT_PLV +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , + _______, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_planck_mit( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_planck_mit( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | | |AG_NRM|AG_SWP|Qwerty|Colemk| | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_mit( + _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF,_______, _______, KC_DEL , + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} diff --git a/keyboards/niu_mini/keymaps/abhixec/readme.md b/keyboards/niu_mini/keymaps/abhixec/readme.md new file mode 100644 index 0000000000..1bc312a039 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/readme.md @@ -0,0 +1,5 @@ +# Abhixec's Layout + +This is inspired by planck but removed most of the unwanted and extra features of planck that is not there in this keyboard. + + diff --git a/keyboards/niu_mini/keymaps/abhixec/rules.mk b/keyboards/niu_mini/keymaps/abhixec/rules.mk new file mode 100644 index 0000000000..3bf3f27314 --- /dev/null +++ b/keyboards/niu_mini/keymaps/abhixec/rules.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = no -- cgit v1.2.3 From cd544e10a98b4bfd7f988d713dea446be9eb1b83 Mon Sep 17 00:00:00 2001 From: Elliot Powell <32494740+e11i0t23@users.noreply.github.com> Date: Fri, 2 Nov 2018 23:41:26 +0000 Subject: Keymap: Fixed poor layout of EP40 default keymap (#4330) * add initial ep40 files * fixed issues * updated keymap * Added media control * Update keyboards/handwired/ep40/rules.mk Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Fixed requested changes * Fixed more requested changes * Added delete key to layor 1 * Updated defualt keympap to have a Backspace mod del key * removed place holder Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * removed obsolete code Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> --- keyboards/handwired/ep40/keymaps/default/keymap.c | 38 +++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/keyboards/handwired/ep40/keymaps/default/keymap.c b/keyboards/handwired/ep40/keymaps/default/keymap.c index 2d8a5d0592..1ac66bc012 100644 --- a/keyboards/handwired/ep40/keymaps/default/keymap.c +++ b/keyboards/handwired/ep40/keymaps/default/keymap.c @@ -15,16 +15,22 @@ */ #include QMK_KEYBOARD_H +static bool bsdel_mods = false; + +enum custom_keycodes { + M_BSDEL = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum +}; + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( /* Base */ - 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_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, M_BSDEL,\ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ - LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RGUI, MO(2), RCTL_T(KC_RBRC), KC_RALT \ + LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RALT, MO(2), RCTL_T(KC_RBRC), KC_F5 \ ), [1] = LAYOUT( /* Base */ - KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_DEL ,\ + KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_TRNS,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ @@ -37,3 +43,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ ), }; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_BSDEL: { + uint8_t kc = KC_BSPC; + + if (record->event.pressed) { + if (keyboard_report->mods) { + kc = KC_DEL; + } + register_code (kc); + bsdel_mods = keyboard_report->mods; + } + else { + if (bsdel_mods) { + kc = KC_DEL; + } + unregister_code (kc); + } + + return false; + break; + } + } + return true; +} -- cgit v1.2.3 From 0633eb027308f08331cb33f27ddbe7cb3a08cda8 Mon Sep 17 00:00:00 2001 From: Josh Date: Sat, 3 Nov 2018 12:22:57 -0400 Subject: Increasing square wave buffer to max volume. (#4296) * Increasing square wave buffer to max volume. * Using range designated initializers for square waves; defining DAC_SAMPLE_MAX. --- quantum/audio/audio_arm.c | 133 ++++------------------------------------------ 1 file changed, 9 insertions(+), 124 deletions(-) diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index d38184f323..18e8a8c66d 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -80,6 +80,7 @@ float startup_song[][2] = STARTUP_SONG; static void gpt_cb8(GPTDriver *gptp); #define DAC_BUFFER_SIZE 720 +#define DAC_SAMPLE_MAX 65535U #define START_CHANNEL_1() gptStart(&GPTD6, &gpt6cfg1); \ gptStartContinuous(&GPTD6, 2U) @@ -202,132 +203,16 @@ GPTConfig gpt8cfg1 = { // squarewave static const dacsample_t dac_buffer[DAC_BUFFER_SIZE] = { - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + // First half is max, second half is 0 + [0 ... DAC_BUFFER_SIZE/2-1] = DAC_SAMPLE_MAX, + [DAC_BUFFER_SIZE/2 ... DAC_BUFFER_SIZE -1] = 0, }; // squarewave static const dacsample_t dac_buffer_2[DAC_BUFFER_SIZE] = { - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, - 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047, 2047 + // opposite of dac_buffer above + [0 ... DAC_BUFFER_SIZE/2-1] = 0, + [DAC_BUFFER_SIZE/2 ... DAC_BUFFER_SIZE -1] = DAC_SAMPLE_MAX, }; /* @@ -363,7 +248,7 @@ static void error_cb1(DACDriver *dacp, dacerror_t err) { } static const DACConfig dac1cfg1 = { - .init = 2047U, + .init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT }; @@ -375,7 +260,7 @@ static const DACConversionGroup dacgrpcfg1 = { }; static const DACConfig dac1cfg2 = { - .init = 2047U, + .init = DAC_SAMPLE_MAX, .datamode = DAC_DHRM_12BIT_RIGHT }; -- cgit v1.2.3 From 292a87ad0442293aadfe6910c9e5f19a53e54a81 Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Sun, 4 Nov 2018 01:08:05 +0800 Subject: Instructions on how to flash via STM32 bootloader (#4316) * Add instructions on flashing ARM keyboards with default STM32 bootloader * fixed typo; added note suggestion to step 4 --- docs/flashing.md | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/docs/flashing.md b/docs/flashing.md index 1edbe22253..bc418c4150 100644 --- a/docs/flashing.md +++ b/docs/flashing.md @@ -71,8 +71,8 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 2. Wait for the OS to detect the device -4. Flash a .hex file -5. Wait for the device to reset automatically +3. Flash a .hex file +4. Wait for the device to reset automatically or @@ -106,5 +106,28 @@ Flashing sequence: 1. Press the `RESET` keycode, or short RST to GND quickly (you only have 7 seconds to flash once it enters) 2. Wait for the OS to detect the device -4. Flash a .hex file -5. Reset the device into application mode (may be done automatically) +3. Flash a .hex file +4. Reset the device into application mode (may be done automatically) + +## STM32 + +All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same. + +At the moment, no `BOOTLOADER` variable is needed on `rules.mk` for STM32. + +Compatible flashers: + +* [QMK Toolbox](https://github.com/qmk/qmk_toolbox/releases) (recommended GUI) +* [dfu-util](https://github.com/Stefan-Schmidt/dfu-util) / `:dfu-util` (recommended command line) + +Flashing sequence: + +1. Enter the bootloader using any of the following methods: + * Tap the `RESET` keycode (may not work on STM32F042 devices) + * If a reset circuit is present, tap the RESET button + * Otherwise, you need to bridge BOOT0 to VCC (via BOOT0 button or bridge), short RESET to GND (via RESET button or bridge), and then let go of the BOOT0 bridge +2. Wait for the OS to detect the device +3. Flash a .bin file + * You will receive a warning about the DFU signature; Just ignore it +4. Reset the device into application mode (may be done automatically) + * If you are building from command line (e.g. `make planck/rev6:default:dfu-util`), make sure that `:leave` is passed to the `DFU_ARGS` variable inside your `rules.mk` (e.g. `DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave`) so that your device resets after flashing -- cgit v1.2.3 From bdc72740cb5f9d7d6d5df574b39721ec479dc733 Mon Sep 17 00:00:00 2001 From: BK Date: Sat, 3 Nov 2018 13:38:37 -0400 Subject: Add distro support for sabayon (#4320) * Add distro support for sabayon Sabayon is a gentoo based distro with a different package manager. Does not need any use flags or masking for the required packages. * Add missing backslash * Put echo string in quotes, remove extra newline * Order gentoo/sabayon packages alphabetically. --- util/linux_install.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index d3b9328d79..8dc28be6ef 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -86,15 +86,28 @@ elif grep ID /etc/os-release | grep -q gentoo; then app-arch/unzip \ app-arch/zip \ app-mobilephone/dfu-util \ + dev-embedded/avrdude \ net-misc/wget \ sys-devel/gcc \ - sys-devel/crossdev dev-embedded/avrdude + sys-devel/crossdev sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr - echo Done! + echo "Done!" else echo "Quitting..." fi +elif grep ID /etc/os-release | grep -q sabayon; then + sudo equo install \ + app-arch/unzip \ + app-arch/zip \ + app-mobilephone/dfu-util \ + dev-embedded/avrdude \ + net-misc/wget \ + sys-devel/gcc \ + sys-devel/crossdev + sudo crossdev -s4 --stable --g =4.9.4 --portage --verbose --target avr + echo "Done!" + elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then CROSS_AVR_GCC=cross-avr-gcc8 if grep ID /etc/os-release | grep -q "15.0"; then -- cgit v1.2.3 From 80c04b29194a0023b8e47f3ac49ea248c8ec953d Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Sat, 3 Nov 2018 10:39:40 -0700 Subject: 5x5bt (#4333) * got bluetooth working * get rid of description on bluetooth * get rid of commented code used for testing * Update config.h --- layouts/community/ortho_4x12/wanleg/config.h | 7 ++----- layouts/community/ortho_5x15/wanleg/config.h | 20 ++++++++++++++------ layouts/community/ortho_5x15/wanleg/keymap.c | 25 +++++++++++++++++-------- layouts/community/ortho_5x15/wanleg/rules.mk | 9 ++++++++- users/wanleg/rules.mk | 6 ++++++ 5 files changed, 47 insertions(+), 20 deletions(-) diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 2444b8b976..2b2072db22 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once //QMK DFU settings (ProMicro boards with QMK bootloader) // set top left key as bootloader mode escape key on Lets Split rev2 @@ -30,8 +29,6 @@ #undef MATRIX_ROW_PINS #undef MATRIX_COL_PINS #define MATRIX_ROW_PINS { D1, D0, D4, C6 } -//last 4 elements of the column array are are not broken out on a ProMicro (included only to preserve array structure) +//last 4 elements of the column array are not broken out on a ProMicro (included only to preserve array structure) #define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, B5, B4, E6, D7, F0, B7, D6, F1 } #endif - -#endif diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h index 1043986f7a..1aeda2db4e 100644 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -1,8 +1,16 @@ #pragma once -// set top left key as bootloader mode escape key on 5x5 75key layout -#if defined(KEYBOARD_5x5) && !defined(PRO_MICRO) -#define QMK_LED B0 -#define QMK_ESC_OUTPUT D7 // usually COL -#define QMK_ESC_INPUT B2 // usually ROW -#endif \ No newline at end of file +//5x5 powered by Adafruit Feather 32u4 Bluefruit LE +#if defined(KEYBOARD_5x5) && defined(BLUEFRUIT) + +//need to undefine standard 5x5 array before defining alternate Bluefruit array +#undef MATRIX_ROW_PINS +#undef MATRIX_COL_PINS +#define MATRIX_ROW_PINS { F7, F6, F5, D1, D0 } +//last 5 elements not tested +#define MATRIX_COL_PINS { C6, D7, B5, B6, B7, D6, C7, F0, F1, F4, B1, B2, B3, D2, D3 } + +//get rid of description - too long to show properly in Windows +#undef DESCRIPTION +#define DESCRIPTION +#endif diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index df74241157..66b3ce018d 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -15,14 +15,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT ), -[PAD] = LAYOUT_ortho_5x5_wrapper( - _______, _______, _______, _______, _______, - _______________NUMPAD_Row__0_______________, _______, - _______________NUMPAD_Row__1_______________, _______, - _______________NUMPAD_Row__2_______________, _______, - KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ -), - [GK50] = LAYOUT_ortho_5x10_wrapper( KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, _______________Gherkin_Row_0_______________, @@ -31,6 +23,23 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI ), +#if defined(BLUEFRUIT) +[PAD] = LAYOUT_ortho_5x5_wrapper( + _______, _______, _______, OUT_BT, OUT_USB, + _______________NUMPAD_Row__0_______________, _______, + _______________NUMPAD_Row__1_______________, _______, + _______________NUMPAD_Row__2_______________, _______, + KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ +), +#else + [PAD] = LAYOUT_ortho_5x5_wrapper( + _______, _______, _______, _______, _______, + _______________NUMPAD_Row__0_______________, _______, + _______________NUMPAD_Row__1_______________, _______, + _______________NUMPAD_Row__2_______________, _______, + KC_KP_0, TD(LYR50_TAP_DANCE), KC_KP_DOT, KC_PMNS, _______ +), +#endif #else /* Gherkin 75 * .--------------------------------------------------------------------------------------------------------------------------------------. diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk index e36226fb2e..bfc4c69d99 100644 --- a/layouts/community/ortho_5x15/wanleg/rules.mk +++ b/layouts/community/ortho_5x15/wanleg/rules.mk @@ -1 +1,8 @@ -SWAP_HANDS_ENABLE = no \ No newline at end of file +ifeq (,$(findstring yes,$(BLUEFRUIT))) + BLUETOOTH = AdafruitBLE + BLUETOOTH_ENABLE = yes + F_CPU = 8000000 + CONSOLE_ENABLE = no # Console for debug(+400) + COMMAND_ENABLE = no # Commands for debug and configuration + RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +endif \ No newline at end of file diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index 2a2a65cfea..e3e802b4a7 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -14,3 +14,9 @@ endif ifeq ($(strip $(PM)), yes) OPT_DEFS += -DPRO_MICRO endif + +#use alternate settings for boards using "Adafruit Feather 32u4 Bluefruit LE" instead of Micro +#example usage: make 5x5:wanleg BT=yes +ifeq ($(strip $(BT)), yes) + OPT_DEFS += -DBLUEFRUIT +endif \ No newline at end of file -- cgit v1.2.3 From 60ed0b7c3045d9511c28495f4d8c65240434c952 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 3 Nov 2018 15:09:32 -0700 Subject: Keyboard: Port over the x268 Noxary Firmware (#4339) * port over Rozakiin https://github.com/Rozakiin/Noxary_Firmware/tree/master/noxary_x268 * rename LAYOUT to LAYOUT_65_ansi default layout * add configurator support * add community layout support * put Rozakiin's name everywhere * update readme * problems with the 65_ansi keymap to be diagnosed later --- keyboards/noxary/README.md | 4 +- keyboards/noxary/x268/config.h | 230 ++++++++++++++++++++++++ keyboards/noxary/x268/info.json | 12 ++ keyboards/noxary/x268/keymaps/default/config.h | 19 ++ keyboards/noxary/x268/keymaps/default/keymap.c | 83 +++++++++ keyboards/noxary/x268/keymaps/default/readme.md | 1 + keyboards/noxary/x268/readme.md | 18 ++ keyboards/noxary/x268/rules.mk | 80 +++++++++ keyboards/noxary/x268/x268.c | 53 ++++++ keyboards/noxary/x268/x268.h | 35 ++++ 10 files changed, 534 insertions(+), 1 deletion(-) create mode 100644 keyboards/noxary/x268/config.h create mode 100644 keyboards/noxary/x268/info.json create mode 100644 keyboards/noxary/x268/keymaps/default/config.h create mode 100644 keyboards/noxary/x268/keymaps/default/keymap.c create mode 100644 keyboards/noxary/x268/keymaps/default/readme.md create mode 100644 keyboards/noxary/x268/readme.md create mode 100644 keyboards/noxary/x268/rules.mk create mode 100644 keyboards/noxary/x268/x268.c create mode 100644 keyboards/noxary/x268/x268.h diff --git a/keyboards/noxary/README.md b/keyboards/noxary/README.md index 81e525506a..bd4b4b591f 100644 --- a/keyboards/noxary/README.md +++ b/keyboards/noxary/README.md @@ -1,7 +1,9 @@ # Noxary Firmware -All files related to firmware of Noxary Keyboards designed by Rozakiin. +All files related to firmware of Noxary Keyboards designed by [Rozakiin](https://github.com/rozakiin). ### Keyboards - [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin + +- [x268](./x268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin diff --git a/keyboards/noxary/x268/config.h b/keyboards/noxary/x268/config.h new file mode 100644 index 0000000000..5c4f6cdad7 --- /dev/null +++ b/keyboards/noxary/x268/config.h @@ -0,0 +1,230 @@ +/* +Copyright 2018 Rozakiin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0044 +#define DEVICE_VER 0x00F2 +#define MANUFACTURER Noxary +#define PRODUCT x268 +#define DESCRIPTION QMK keyboard firmware for x268 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F7, F6, F5, F0, B4 } +#define MATRIX_COL_PINS { C6, B6, C7, F4, E6, B2, D6, D0, D1, D7, D4, D5, D3, F1, D2, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* ws2812b options */ +#define RGB_DI_PIN B5 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 16 +#define RGBLIGHT_SAT_STEP 16 +#define RGBLIGHT_VAL_STEP 16 +/*#define RGBLIGHT_LIMIT_VAL 255 */ +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/x268/info.json b/keyboards/noxary/x268/info.json new file mode 100644 index 0000000000..047c39f044 --- /dev/null +++ b/keyboards/noxary/x268/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary x268", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/noxary/x268/keymaps/default/config.h b/keyboards/noxary/x268/keymaps/default/config.h new file mode 100644 index 0000000000..9c4c2b6308 --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Rozakiin + * + * 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 + +// place overrides here diff --git a/keyboards/noxary/x268/keymaps/default/keymap.c b/keyboards/noxary/x268/keymaps/default/keymap.c new file mode 100644 index 0000000000..cb37407a7b --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| Grv| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent|PgUp| + * |----------------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Mo(1)|Ctrl|Lef|Dow|Rght| + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT_65_ansi( + KC_ESC, 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_BSLS, KC_BSPC, KC_GRV, + 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, + 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_LALT, MO(_FL1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute|Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT_65_ansi( + KC_GRV, 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, _______, + RGB_TOG, RGB_VAI, RGB_SAI, RGB_HUI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, RGB_VAD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, _______, KC_VOLD, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL2] = LAYOUT_65_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + diff --git a/keyboards/noxary/x268/keymaps/default/readme.md b/keyboards/noxary/x268/keymaps/default/readme.md new file mode 100644 index 0000000000..5d5bd69592 --- /dev/null +++ b/keyboards/noxary/x268/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for x268 diff --git a/keyboards/noxary/x268/readme.md b/keyboards/noxary/x268/readme.md new file mode 100644 index 0000000000..c1c05c34d5 --- /dev/null +++ b/keyboards/noxary/x268/readme.md @@ -0,0 +1,18 @@ +# Noxary x268 + +![x268](https://geekhack.org/index.php?action=dlattach;topic=96377.0;attach=198826;image) + +A fully customizable 65% keyboard. + +* Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) +* Hardware Supported: x268 PCB + * rev1 +* Hardware Availability: + * [Noxary - 268](https://geekhack.org/index.php?topic=92066.0) + * [LZ - CLS ms](https://geekhack.org/index.php?topic=96377) + +Make example for this keyboard (after setting up your build environment): + + make noxary/x268: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/noxary/x268/rules.mk b/keyboards/noxary/x268/rules.mk new file mode 100644 index 0000000000..3c4a26ad1a --- /dev/null +++ b/keyboards/noxary/x268/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) diff --git a/keyboards/noxary/x268/x268.c b/keyboards/noxary/x268/x268.c new file mode 100644 index 0000000000..3921270acc --- /dev/null +++ b/keyboards/noxary/x268/x268.c @@ -0,0 +1,53 @@ +/* Copyright 2018 Rozakiin + * + * 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 . + */ +#include "x268.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB |= (1 << 0); + } + else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } +} diff --git a/keyboards/noxary/x268/x268.h b/keyboards/noxary/x268/x268.h new file mode 100644 index 0000000000..53855e2060 --- /dev/null +++ b/keyboards/noxary/x268/x268.h @@ -0,0 +1,35 @@ +/* Copyright 2018 Rozakiin + * + * 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 . + */ +#ifndef X268_H +#define X268_H + +#include "quantum.h" + +#define LAYOUT_65_ansi( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K409, K410, K411, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, K214, K215 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315 }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, K409, K410, K411, K412, KC_NO, K414, K415 } \ +} + +#endif -- cgit v1.2.3 From b5d7bb6154f848e4f3fd3e5d3cc8bbb16a18e093 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 3 Nov 2018 23:57:42 -0700 Subject: converter/usb_usb Refactor and Configurator support (#4345) * converter/usb_usb: layout macro refactor - KEYMAP_ALL renamed to LAYOUT_all - KEYMAP renamed to LAYOUT_ansi - KEYMAP_ISO renamed to LAYOUT_iso - KEYMAP_JIS renamed to LAYOUT_jis * converter/usb_usb: keymap refactor - all keymaps now use #include QMK_KEYBOARD_H - layout macro names updated - removed deprecated TMK macro/function code * Add info.json file for Configurator support --- keyboards/converter/usb_usb/info.json | 485 +++++++++++++++++++++ keyboards/converter/usb_usb/keymaps/ble/keymap.c | 18 +- .../usb_usb/keymaps/coloneljesus/keymap.c | 44 +- .../converter/usb_usb/keymaps/default/keymap.c | 22 +- keyboards/converter/usb_usb/usb_usb.h | 56 +-- 5 files changed, 537 insertions(+), 88 deletions(-) create mode 100644 keyboards/converter/usb_usb/info.json diff --git a/keyboards/converter/usb_usb/info.json b/keyboards/converter/usb_usb/info.json new file mode 100644 index 0000000000..af3dd0b5e4 --- /dev/null +++ b/keyboards/converter/usb_usb/info.json @@ -0,0 +1,485 @@ +{ + "keyboard_name": "converter/usb_usb", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "layout": [ + {"label":"F13", "x":2, "y":0}, + {"label":"F14", "x":3, "y":0}, + {"label":"F15", "x":4, "y":0}, + {"label":"F16", "x":5, "y":0}, + {"label":"F17", "x":6.5, "y":0}, + {"label":"F18", "x":7.5, "y":0}, + {"label":"F19", "x":8.5, "y":0}, + {"label":"F20", "x":9.5, "y":0}, + {"label":"F21", "x":11, "y":0}, + {"label":"F22", "x":12, "y":0}, + {"label":"F23", "x":13, "y":0}, + {"label":"F24", "x":14, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"F1", "x":2, "y":1}, + {"label":"F2", "x":3, "y":1}, + {"label":"F3", "x":4, "y":1}, + {"label":"F4", "x":5, "y":1}, + {"label":"F5", "x":6.5, "y":1}, + {"label":"F6", "x":7.5, "y":1}, + {"label":"F7", "x":8.5, "y":1}, + {"label":"F8", "x":9.5, "y":1}, + {"label":"F9", "x":11, "y":1}, + {"label":"F10", "x":12, "y":1}, + {"label":"F11", "x":13, "y":1}, + {"label":"F12", "x":14, "y":1}, + {"label":"Print Screen", "x":15.25, "y":1}, + {"label":"Scroll Lock", "x":16.25, "y":1}, + {"label":"Pause", "x":17.25, "y":1}, + {"label":"Volume Down", "x":18.5, "y":1}, + {"label":"Vol Up", "x":19.5, "y":1}, + {"label":"Mute", "x":20.5, "y":1}, + {"label":"Power", "x":21.5, "y":1}, + {"label":"Help", "x":22.75, "y":1}, + {"label":"`", "x":0, "y":2.5}, + {"label":"1", "x":1, "y":2.5}, + {"label":"2", "x":2, "y":2.5}, + {"label":"3", "x":3, "y":2.5}, + {"label":"4", "x":4, "y":2.5}, + {"label":"5", "x":5, "y":2.5}, + {"label":"6", "x":6, "y":2.5}, + {"label":"7", "x":7, "y":2.5}, + {"label":"8", "x":8, "y":2.5}, + {"label":"9", "x":9, "y":2.5}, + {"label":"0", "x":10, "y":2.5}, + {"label":"-", "x":11, "y":2.5}, + {"label":"=", "x":12, "y":2.5}, + {"label":"Yen", "x":13, "y":2.5}, + {"label":"Back Space", "x":14, "y":2.5}, + {"label":"Insert", "x":15.25, "y":2.5}, + {"label":"Home", "x":16.25, "y":2.5}, + {"label":"Page Up", "x":17.25, "y":2.5}, + {"label":"Num Lock", "x":18.5, "y":2.5}, + {"label":"Num /", "x":19.5, "y":2.5}, + {"label":"Num *", "x":20.5, "y":2.5}, + {"label":"Num -", "x":21.5, "y":2.5}, + {"label":"Stop", "x":22.75, "y":2.5}, + {"label":"Again", "x":23.75, "y":2.5}, + {"label":"Tab", "x":0, "y":3.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":3.5}, + {"label":"W", "x":2.5, "y":3.5}, + {"label":"E", "x":3.5, "y":3.5}, + {"label":"R", "x":4.5, "y":3.5}, + {"label":"T", "x":5.5, "y":3.5}, + {"label":"Y", "x":6.5, "y":3.5}, + {"label":"U", "x":7.5, "y":3.5}, + {"label":"I", "x":8.5, "y":3.5}, + {"label":"O", "x":9.5, "y":3.5}, + {"label":"P", "x":10.5, "y":3.5}, + {"label":"[", "x":11.5, "y":3.5}, + {"label":"]", "x":12.5, "y":3.5}, + {"label":"\\", "x":13.5, "y":3.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3.5}, + {"label":"End", "x":16.25, "y":3.5}, + {"label":"Page Down", "x":17.25, "y":3.5}, + {"label":"Num 7", "x":18.5, "y":3.5}, + {"label":"Num 8", "x":19.5, "y":3.5}, + {"label":"Num 9", "x":20.5, "y":3.5}, + {"label":"Num +", "x":21.5, "y":3.5}, + {"label":"Menu", "x":22.75, "y":3.5}, + {"label":"Undo", "x":23.75, "y":3.5}, + {"label":"Caps Lock", "x":0, "y":4.5, "w":1.75}, + {"label":"A", "x":1.75, "y":4.5}, + {"label":"S", "x":2.75, "y":4.5}, + {"label":"D", "x":3.75, "y":4.5}, + {"label":"F", "x":4.75, "y":4.5}, + {"label":"G", "x":5.75, "y":4.5}, + {"label":"H", "x":6.75, "y":4.5}, + {"label":"J", "x":7.75, "y":4.5}, + {"label":"K", "x":8.75, "y":4.5}, + {"label":"L", "x":9.75, "y":4.5}, + {"label":";", "x":10.75, "y":4.5}, + {"label":"\"", "x":11.75, "y":4.5}, + {"label":"ISO #", "x":12.75, "y":4.5}, + {"label":"Enter", "x":13.75, "y":4.5, "w":1.25}, + {"label":"Num 4", "x":18.5, "y":4.5}, + {"label":"Num 5", "x":19.5, "y":4.5}, + {"label":"Num 6", "x":20.5, "y":4.5}, + {"label":"Num , ", "x":21.5, "y":4.5}, + {"label":"Select", "x":22.75, "y":4.5}, + {"label":"Copy", "x":23.75, "y":4.5}, + {"label":"Shift", "x":0, "y":5.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":5.5}, + {"label":"Z", "x":2.25, "y":5.5}, + {"label":"X", "x":3.25, "y":5.5}, + {"label":"C", "x":4.25, "y":5.5}, + {"label":"V", "x":5.25, "y":5.5}, + {"label":"B", "x":6.25, "y":5.5}, + {"label":"N", "x":7.25, "y":5.5}, + {"label":"M", "x":8.25, "y":5.5}, + {"label":",", "x":9.25, "y":5.5}, + {"label":".", "x":10.25, "y":5.5}, + {"label":"/", "x":11.25, "y":5.5}, + {"label":"JIS \\", "x":12.25, "y":5.5}, + {"label":"Shift", "x":13.25, "y":5.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":5.5}, + {"label":"Num 1", "x":18.5, "y":5.5}, + {"label":"Num 2", "x":19.5, "y":5.5}, + {"label":"Num 3", "x":20.5, "y":5.5}, + {"label":"Num =", "x":21.5, "y":5.5}, + {"label":"Exec", "x":22.75, "y":5.5}, + {"label":"Paste", "x":23.75, "y":5.5}, + {"label":"Ctrl", "x":0, "y":6.5}, + {"label":"GUI", "x":1, "y":6.5}, + {"label":"Alt", "x":2, "y":6.5}, + {"label":"JIS Muhenkan", "x":3, "y":6.5}, + {"label":"Hanja", "x":4, "y":6.5}, + {"label":"Space", "x":5, "y":6.5, "w":3}, + {"label":"Hangul/English", "x":8, "y":6.5}, + {"label":"JIS Henkan", "x":9, "y":6.5}, + {"label":"JIS Katakana/Hiragana", "x":10, "y":6.5}, + {"label":"Alt", "x":11, "y":6.5}, + {"label":"GUI", "x":12, "y":6.5}, + {"label":"App", "x":13, "y":6.5}, + {"label":"Ctrl", "x":14, "y":6.5}, + {"label":"Left", "x":15.25, "y":6.5}, + {"label":"Down", "x":16.25, "y":6.5}, + {"label":"Right", "x":17.25, "y":6.5}, + {"label":"Num 0", "x":18.5, "y":6.5, "w":2}, + {"label":"Num .", "x":20.5, "y":6.5}, + {"label":"Num Enter", "x":21.5, "y":6.5}, + {"label":"Find", "x":22.75, "y":6.5}, + {"label":"Cut", "x":23.75, "y":6.5} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2} + ] + }, + "LAYOUT_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"ISO #", "x":12.75, "y":3.5}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_jis": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"JIS Hankaku / Zenkaku", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"ˆ", "x":12, "y":1.5}, + {"label":"JIS Yen", "x":13, "y":1.5}, + {"label":"Back Space", "x":14, "y":1.5}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Num /", "x":19.5, "y":1.5}, + {"label":"Num *", "x":20.5, "y":1.5}, + {"label":"Num -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"@", "x":11.5, "y":2.5}, + {"label":"[", "x":12.5, "y":2.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Num 7", "x":18.5, "y":2.5}, + {"label":"Num 8", "x":19.5, "y":2.5}, + {"label":"Num 9", "x":20.5, "y":2.5}, + {"label":"Num +", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":":", "x":11.75, "y":3.5}, + {"label":"]", "x":12.75, "y":3.5}, + {"label":"Num 4", "x":18.5, "y":3.5}, + {"label":"Num 5", "x":19.5, "y":3.5}, + {"label":"Num 6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"JIS \\", "x":12.25, "y":4.5}, + {"label":"Shift", "x":13.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Num 1", "x":18.5, "y":4.5}, + {"label":"Num 2", "x":19.5, "y":4.5}, + {"label":"Num 3", "x":20.5, "y":4.5}, + {"label":"Num Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"JIS Muhenkan", "x":3.75, "y":5.5, "w":1.25}, + {"label":"Space", "x":5, "y":5.5, "w":2.5}, + {"label":"JIS Henkan", "x":7.5, "y":5.5, "w":1.25}, + {"label":"JIS Hiragana / Katakana", "x":8.75, "y":5.5, "w":1.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Num 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Num .", "x":20.5, "y":5.5} + ] + } + } +} diff --git a/keyboards/converter/usb_usb/keymaps/ble/keymap.c b/keyboards/converter/usb_usb/keymaps/ble/keymap.c index 094bd95693..190b3319fe 100644 --- a/keyboards/converter/usb_usb/keymaps/ble/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/ble/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,9 +36,9 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, 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_PPLS, KC_MENU, KC_UNDO, 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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, @@ -47,18 +47,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } diff --git a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c index 0cc66fd53d..6dfd1ad79e 100644 --- a/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/coloneljesus/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,7 +36,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - // KEYMAP_ALL( + // LAYOUT_all( // F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, // ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, // GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -45,17 +45,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { // LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PEQL, EXEC,PSTE, // LCTL,LGUI,LALT,MHEN,HANJ, SPC, HAEN,HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT,PENT, FIND,CUT // ), - KEYMAP_ALL( + LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, 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_PPLS, KC_MENU, KC_UNDO, MO(1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, 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_RO, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT ), - KEYMAP_ALL( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + LAYOUT_all( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______, KC_GRV, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, KC_CAPS, KC_MPRV, KC_VOLU, KC_MNXT, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, @@ -65,18 +65,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } @@ -113,7 +101,7 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent| * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP( + LAYOUT_ansi( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,BSLS, DEL, END, PGDN, P7, P8, P9, @@ -138,13 +126,13 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt| Space |HNK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP_ISO( + LAYOUT_iso( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC,ENT, DEL, END, PGDN, P7, P8, P9, PPLS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, LSFT,NUBS,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT + LCTL,LGUI,LALT, SPC, RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT ), /* JIS layout @@ -163,13 +151,13 @@ void led_set_user(uint8_t usb_led) { * |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ - KEYMAP_JIS( + LAYOUT_jis( ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,BRK, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JPY, BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC,RBRC, ENT, DEL, END, PGDN, P7, P8, P9, PPLS, LCTL,A, S, D, F, G, H, J, K, L, SCLN,QUOT,NUHS, P4, P5, P6, LSFT,Z, X, C, V, B, N, M, COMM,DOT, SLSH, RO, RSFT, UP, P1, P2, P3, PENT, - LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT + LCTL,LGUI,LALT,MHEN, SPC, HENK,KANA,RALT,RGUI,APP, RCTL, LEFT,DOWN,RGHT, P0, PDOT ), /* Colemak http://colemak.com @@ -185,7 +173,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -208,7 +196,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `-----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, LBRC,RBRC,JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -231,7 +219,7 @@ void led_set_user(uint8_t usb_led) { * |Ctrl |Gui |Alt | Space |Alt |Gui |Menu|Ctrl| * `-----------------------------------------------------------' */ - KEYMAP_ALL( + LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, GRV, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -265,7 +253,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, ESC, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, PSCR,SLCK,PAUS, VOLD,VOLU,MUTE,PWR, HELP, ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS,EQL, JYEN,BSPC, INS, HOME,PGUP, NLCK,PSLS,PAST,PMNS, STOP,AGIN, @@ -288,7 +276,7 @@ const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | * `-----------------------------------------------------------' */ - [1] = KEYMAP_ALL( + [1] = LAYOUT_all( TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS, TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS,TRNS, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS, GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, TRNS,DEL, TRNS,TRNS,TRNS, TRNS,TRNS,TRNS,TRNS, TRNS,TRNS, diff --git a/keyboards/converter/usb_usb/keymaps/default/keymap.c b/keyboards/converter/usb_usb/keymaps/default/keymap.c index 9817a607d3..170ed31ef8 100644 --- a/keyboards/converter/usb_usb/keymaps/default/keymap.c +++ b/keyboards/converter/usb_usb/keymaps/default/keymap.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "usb_usb.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { /* 0: plain Qwerty without layer switching @@ -36,17 +36,17 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { * |Ctl|Gui|Alt|MHEN|HNJ| Space |H/E|HENK|KANA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0 | .|Ent| |Fnd|Cut| * `-----------------------------------------------------------' `-----------' `---------------' `-------' */ - [0] = KEYMAP_ALL( + [0] = LAYOUT_all( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, - 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, + 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_VOLD, KC_VOLU, KC_MUTE, KC_PWR, KC_HELP, 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_JYEN, KC_BSPC, KC_INS, KC_HOME, KC_PGUP, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_STOP, KC_AGIN, 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_PPLS, KC_MENU, KC_UNDO, 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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PCMM, KC_SLCT, KC_COPY, 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_RO, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, KC_PEQL, KC_EXEC, KC_PSTE, KC_LCTL, KC_LGUI, KC_LALT, KC_MHEN, KC_HANJ, KC_SPC, KC_HAEN, KC_HENK, KC_KANA, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT, KC_FIND, KC_CUT ), - [1] = KEYMAP_ALL( - ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, + [1] = LAYOUT_all( + ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______, ______,______,______, ______,______,______,______, ______,______, @@ -56,18 +56,6 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] PROGMEM = { ), }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - default: - return MACRO_NONE; - } -}; - - void matrix_init_user(void) { } diff --git a/keyboards/converter/usb_usb/usb_usb.h b/keyboards/converter/usb_usb/usb_usb.h index c31fae1d0f..e0c7c9c0d4 100644 --- a/keyboards/converter/usb_usb/usb_usb.h +++ b/keyboards/converter/usb_usb/usb_usb.h @@ -62,7 +62,7 @@ along with this program. If not, see . * * TODO: use same keycode to pass through instead of KC_NO? */ -#define KEYMAP_ALL( \ +#define LAYOUT_all( \ K68,K69,K6A,K6B,K6C,K6D,K6E,K6F,K70,K71,K72,K73, \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, K81,K80,K7F,K66, K75, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, K78,K79, \ @@ -120,21 +120,21 @@ along with this program. If not, see . * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .|Ent| * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP( \ +#define LAYOUT_ansi( \ K29,K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K31, K4C,K4D,K4E, K5F,K60,K61, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K28, K5C,K5D,K5E,K57, \ KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KE5, K52, K59,K5A,K5B, \ KE0,KE3,KE2, K2C, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,KC_NO, K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K31, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, KC_NO, K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,KC_NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KC_NO, KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, KC_NO, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K31, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, KC_NO, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, KC_NO, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, KC_NO, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) /* ,---. ,---------------. ,---------------. ,---------------. ,-----------. @@ -152,21 +152,21 @@ along with this program. If not, see . * |Ctl|Gui|Alt| Space |Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP_ISO( \ +#define LAYOUT_iso( \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30,K28, K4C,K4D,K4E, K5F,K60,K61,K57, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32, K5C,K5D,K5E, \ KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KE5, K52, K59,K5A,K5B,K58, \ KE0,KE3,KE2, K2C, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,KC_NO, K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K32, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,K64,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, KC_NO, KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, KC_NO, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K32, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, K32, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, K64, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, KC_NO, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, KC_NO, KC_NO, K2C, KC_NO, KC_NO, KC_NO, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) /* ,---. ,---------------. ,---------------. ,---------------. ,-----------. @@ -184,20 +184,20 @@ along with this program. If not, see . * |Ctl|Gui|Alt|MHEN| Space |HENK|KNA|Alt|Gui|App|Ctl| |Lef|Dow|Rig| | 0| .| | * `-----------------------------------------------------------' `-----------' `---------------' */ -#define KEYMAP_JIS( \ +#define LAYOUT_jis( \ K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, \ K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, \ K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K28, K4C,K4D,K4E, K5F,K60,K61,K57, \ K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34,K32, K5C,K5D,K5E, \ KE1,K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K87,KE5, K52, K59,K5A,K5B,K58, \ KE0,KE3,KE2,K8B, K2C, K8A,K88,KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63 \ -) KEYMAP_ALL( \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K29, K3A,K3B,K3C,K3D,K3E,K3F,K40,K41,K42,K43,K44,K45, K46,K47,K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - K35,K1E,K1F,K20,K21,K22,K23,K24,K25,K26,K27,K2D,K2E,K89,K2A, K49,K4A,K4B, K53,K54,K55,K56, KC_NO, KC_NO, \ - K2B,K14,K1A,K08,K15,K17,K1C,K18,K0C,K12,K13,K2F,K30, K32, K4C,K4D,K4E, K5F,K60,K61,K57, KC_NO, KC_NO, \ - K39,K04,K16,K07,K09,K0A,K0B,K0D,K0E,K0F,K33,K34, K32,K28, K5C,K5D,K5E,KC_NO, KC_NO, KC_NO, \ - KE1,KC_NO, K1D,K1B,K06,K19,K05,K11,K10,K36,K37,K38, K87,KE5, K52, K59,K5A,K5B,KC_NO, KC_NO, KC_NO, \ - KE0,KE3,KE2,K8B,KC_NO, K2C, KC_NO, K8A,K88,KE6,KE7,K65,KE4, K50,K51,K4F, K62, K63,K58, KC_NO, KC_NO \ +) LAYOUT_all( \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K29, K3A, K3B, K3C, K3D, K3E, K3F, K40, K41, K42, K43, K44, K45, K46, K47, K48, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + K35, K1E, K1F, K20, K21, K22, K23, K24, K25, K26, K27, K2D, K2E, K89, K2A, K49, K4A, K4B, K53, K54, K55, K56, KC_NO, KC_NO, \ + K2B, K14, K1A, K08, K15, K17, K1C, K18, K0C, K12, K13, K2F, K30, K32, K4C, K4D, K4E, K5F, K60, K61, K57, KC_NO, KC_NO, \ + K39, K04, K16, K07, K09, K0A, K0B, K0D, K0E, K0F, K33, K34, K32, K28, K5C, K5D, K5E, KC_NO, KC_NO, KC_NO, \ + KE1, KC_NO, K1D, K1B, K06, K19, K05, K11, K10, K36, K37, K38, K87, KE5, K52, K59, K5A, K5B, KC_NO, KC_NO, KC_NO, \ + KE0, KE3, KE2, K8B, KC_NO, K2C, KC_NO, K8A, K88, KE6, KE7, K65, KE4, K50, K51, K4F, K62, K63, K58, KC_NO, KC_NO \ ) #endif -- cgit v1.2.3 From 3946ea21413b56ad50e55482ff5c43b576adc1d7 Mon Sep 17 00:00:00 2001 From: TurboMech <32869044+TurboMech@users.noreply.github.com> Date: Sun, 4 Nov 2018 10:39:58 -0500 Subject: Keyboard: adding Espectro (#4343) * added Espectro Added Espectro keyboard from MechKeys.ca * Update keyboards/espectro/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/espectro.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/default/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/default/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/config.h Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/keymaps/mac/keymap.c Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/readme.md Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/readme.md Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/readme.md Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/readme.md Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * Update keyboards/espectro/rules.mk Co-Authored-By: TurboMech <32869044+TurboMech@users.noreply.github.com> * fixing Espectro pull request * fixing macros in mac keymap --- keyboards/espectro/config.h | 70 ++++++++++++ keyboards/espectro/espectro.c | 76 +++++++++++++ keyboards/espectro/espectro.h | 91 +++++++++++++++ keyboards/espectro/keymaps/default/keymap.c | 89 +++++++++++++++ keyboards/espectro/keymaps/mac/config.h | 22 ++++ keyboards/espectro/keymaps/mac/keymap.c | 167 ++++++++++++++++++++++++++++ keyboards/espectro/keymaps/mac/readme.md | 56 ++++++++++ keyboards/espectro/readme.md | 15 +++ keyboards/espectro/rules.mk | 61 ++++++++++ 9 files changed, 647 insertions(+) create mode 100755 keyboards/espectro/config.h create mode 100755 keyboards/espectro/espectro.c create mode 100755 keyboards/espectro/espectro.h create mode 100755 keyboards/espectro/keymaps/default/keymap.c create mode 100644 keyboards/espectro/keymaps/mac/config.h create mode 100644 keyboards/espectro/keymaps/mac/keymap.c create mode 100644 keyboards/espectro/keymaps/mac/readme.md create mode 100644 keyboards/espectro/readme.md create mode 100755 keyboards/espectro/rules.mk diff --git a/keyboards/espectro/config.h b/keyboards/espectro/config.h new file mode 100755 index 0000000000..34852df43b --- /dev/null +++ b/keyboards/espectro/config.h @@ -0,0 +1,70 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xCA96 +#define DEVICE_VER 0x0001 +#define MANUFACTURER MECHKEYS +#define PRODUCT Espectro +#define DESCRIPTION 96% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 13 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B7, B3, E6, F0, D5, D4, D6, C7 } +#define MATRIX_COL_PINS { C6, F1, F4, F5, F6, F7, D7, B4, B5, D0, D1, D2, D3} +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_LEVELS 5 + + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 10 +#define RGBLIGHT_VAL_STEP 10 + +#define RGBLIGHT_ANIMATIONS + +#endif + diff --git a/keyboards/espectro/espectro.c b/keyboards/espectro/espectro.c new file mode 100755 index 0000000000..13030cdd41 --- /dev/null +++ b/keyboards/espectro/espectro.c @@ -0,0 +1,76 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 . + */ + + +#include QMK_KEYBOARD_H +#include "quantum.h" + + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); PORTB &= ~(1 << 2); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRB |= (1 << 1); PORTB &= ~(1 << 1); + } else { + DDRB &= ~(1 << 1); PORTB &= ~(1 << 1); + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} + diff --git a/keyboards/espectro/espectro.h b/keyboards/espectro/espectro.h new file mode 100755 index 0000000000..3d6ea466d3 --- /dev/null +++ b/keyboards/espectro/espectro.h @@ -0,0 +1,91 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 . + */ + + +#ifndef ESPECTRO_H +#define ESPECTRO_H + +#include "quantum.h" + + +//Arrow keys and 1.75u shift +#define LAYOUT_default( \ +K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ +K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K701, K109, K110, K111, K112, \ + K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, \ + K400, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ +K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO }, \ + { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ + { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, KC_NO }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ + { KC_NO, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ +} + +// Split numpad (enter, 0), split shifts (right, left), split backspace +// This is more of an example of every possible keycode placement +#define LAYOUT_split_shift_and_bs( \ +K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ +K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K700, K701, K109, K110, K111, K112, \ + K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ + K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ +K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ + { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ + { K701, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ +} + + + + +/* +Placement of every possible switch defined below. +x2 means the diode allows two possible positions for the switch + +#define LAYOUT_all( \ +K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ +K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K700, K701x2, K109, K110, K111, K112, \ +K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ + K308, K212, \ +K300, K300, K301, K302, K304, K612, K705, K706, K707, K305, K306, K307, K703, K308, K309, K310, K311, K312, \ +K400x2, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K408, K704, K409, K410, K411, K412, \ + K412, \ +K500x2, K501x2, K502, K503x3, K504x3, K505x2, K506x2, K507x2, K508x2, K509, K510x2, K511, K512 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312 }, \ + { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ + { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 }, \ + { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ + { K700, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ +} +*/ + +#endif diff --git a/keyboards/espectro/keymaps/default/keymap.c b/keyboards/espectro/keymaps/default/keymap.c new file mode 100755 index 0000000000..aeff733fc1 --- /dev/null +++ b/keyboards/espectro/keymaps/default/keymap.c @@ -0,0 +1,89 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 . + */ + + +#include QMK_KEYBOARD_H +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | END | P UP | P DOWN | DEL | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_default( + 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_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, KC_PGDN, + 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_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_P7, KC_P8, KC_P9, KC_PPLS, + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_default( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + diff --git a/keyboards/espectro/keymaps/mac/config.h b/keyboards/espectro/keymaps/mac/config.h new file mode 100644 index 0000000000..a18495221b --- /dev/null +++ b/keyboards/espectro/keymaps/mac/config.h @@ -0,0 +1,22 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 + +#define TAPPING_TOGGLE 2 + +// place overrides here + diff --git a/keyboards/espectro/keymaps/mac/keymap.c b/keyboards/espectro/keymaps/mac/keymap.c new file mode 100644 index 0000000000..4b72ff0aac --- /dev/null +++ b/keyboards/espectro/keymaps/mac/keymap.c @@ -0,0 +1,167 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 . + */ + + +#include QMK_KEYBOARD_H + +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define _QWERTY 0 //BASE layer +#define _FUNCTION 1 //Function layer +#define _WINDOWS 2 //Windows layer + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + EXPOSE, // Expose (LCTRL + UP) + LAUNCH, + DOCK, + SCRCAP, + CS1, + CS2, + QALL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Base Layer +____________________________________________________________________________________________________________________________________________________________________________ +| | SCREEN | SCREEN | | |SHOW | TOGGLE |SCREEN |CUSTOM |CUSTOM |PREVIOUS| PLAY/ | NEXT | | | | | | | +| ESC |BRIGHTEN| DIM | EXPOSE |LAUNCHPA|DESKTOP | DOCK |CAPTURE |SHORTCUT|SHORTCUT| TRACK | PAUSE | TRACK | MUTE | VOL DN | VOL UP | PG UP |PG DOWN | POWER | +|________|________|________|________|________|________|________|________|___1____|___2____|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | DELETE | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | TT | | | | | | | +| CTRL | L ALT | L GUI | SPACE | R GUI | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________| COMMAND |________________________________________________________|COMMAND |________|________|________|________|________|________|________|________| + */ + + [_QWERTY] = LAYOUT_default( + KC_ESC, KC_F14, KC_F15, EXPOSE, LAUNCH, KC_F11, DOCK, SCRCAP, CS1, CS2, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, KC_VOLD, KC_VOLU, KC_PGUP, KC_PGDN, KC_POWER, + 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_DEL, 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_P7, KC_P8, KC_P9, KC_PPLS, + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RCTL, TT(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), +/* FN1 - SEE readme.md +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| QUIT | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | | | HOME | END | RESET | +|_ALL____|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + + [_FUNCTION] = LAYOUT_default( + QALL, 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_HOME, KC_END, RESET, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, TO(2), _______, _______, _______, _______, _______, _______ + + ), + +/* Windows layer +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE | HOME | END | P UP | P DOWN | MENU | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | TO | | | | | | | +| L GUI | L ALT | L CTL | SPACE | R CTL | R ALT |LAYER 0 | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + + [_WINDOWS] = LAYOUT_default( + 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_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_MENU, + 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_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_P7, KC_P8, KC_P9, KC_PPLS, + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LGUI, KC_LALT, KC_LCTL, KC_SPC, KC_RCTL, KC_RALT, TO(0), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), +}; + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + // dynamically generate these. + case EXPOSE: + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_UP) SS_UP(X_LCTRL)); + return false; + case LAUNCH: + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_L) SS_UP(X_LCTRL)); + return false; + case DOCK: + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_D) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case SCRCAP: //screen capture + SEND_STRING(SS_DOWN(X_LCTRL) SS_TAP(X_S) SS_UP(X_LCTRL)); + return false; + case CS1: //custom shortcut 1 + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_1) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case CS2: //custom shortcut 2 + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_2) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + case QALL: //quit all applications + SEND_STRING(SS_DOWN(X_LALT) SS_DOWN(X_LGUI) SS_TAP(X_Q) SS_UP(X_LGUI) SS_UP(X_LALT)); + return false; + } + return false; + } + return true; +}; + diff --git a/keyboards/espectro/keymaps/mac/readme.md b/keyboards/espectro/keymaps/mac/readme.md new file mode 100644 index 0000000000..fb62260181 --- /dev/null +++ b/keyboards/espectro/keymaps/mac/readme.md @@ -0,0 +1,56 @@ +# This is u/TurboMech's keyboard layout for Espectro. + +## It is designed for Mac OS, due to the specific functions created. + +### Here is the layout found in the keymap.c file. +##### I use shortcuts for the Function row (above number row) listed below + - Scrn Bright Up: F14 + - Scrn Bright Down: F15 + - Expose: LCTRL + Up + - Launchpad: LCTRL + L + - Show Desktop: F11 + - Show/Hide Dock: LALT + LGUI + D + - Screen Capture: LCTRL + S + - Custom Shortcut 1: LCTRL + LGUI + 1 + - Custom Shortcut 2: LCTRL + LGUI + 2 + - use the custom shortcuts for whatever you want: launch an application, a macro, etc. + - Play/Pause: exactly that + - Mute / Volume Up / Volume Down: exactly what it says + - QALL: Quit all applications + + ##### Going down the right side from Vol Down: + - POWER: this serves as the power button on Mac's only. Press and hold the button as you would on your Macbook or iMac keyboard. + - Menu: this slides the notification bar on the right side (its the same as on iPhones/ iPads) + +### See below keymaps for how to setup shortcuts on Mac + +#### Base Layer +``` +Needs updating. +``` +#### Function Layer 1 - See above for shortcuts +``` +Needs updating +``` + +#### How to use/ setup shortcuts on Mac +- First navigate to System Preferences > Keyboard > Shortcuts + - You can use any of them in here + - Just set them to the shortcut keys listed above + +#### How to make your own (to launch applications, quit all, etc.) +- Navigate to Automator > New Document > click Service > Choose +- Now we have to setup our shortcut + - Here's how to setup the Quit All Shortcut + - In the right window select the Service recieves dropdown > select No Input + - At the top left click the Name (Search) > type quit > click and hold Quit All Applications > drag to the right hand box (under the Service Recieves) + - **IMPORTANT** You have to click the Run button at the upper right hand corner in order for these to actually work. + - Now click File > Save > save it as Quit All Apps (or whatever you want) / you can also just exit out and it'll ask you if you want to save +- Navigate back to System Preferences > Keyboard > Shortcuts + - The new shortcut can be found under services, set it to one of the shortcuts I listed above and done +- The same applies for applications in the Name (search) just type the application you want to have as shortcut. Don't forget to run it, then do the same steps + to set it up as a shortcut. + + + + diff --git a/keyboards/espectro/readme.md b/keyboards/espectro/readme.md new file mode 100644 index 0000000000..c4c0edc7f7 --- /dev/null +++ b/keyboards/espectro/readme.md @@ -0,0 +1,15 @@ +# Espectro + +![Espectro](https://cdn.shopify.com/s/files/1/1697/5323/products/IMG_0162_53a5ca83-3ce5-4741-92e8-10f769cf5ee1_1024x1024.jpg?v=1540701787) + +A 96% keyboard made and sold by MECHKEYS [More info on MECHKEYS](https://mechkeys.ca). + +Keyboard Maintainer: [TurboMech](https://github.com/TurboMech) +Hardware Supported: Espectro +Hardware Availability: [MECHKEYS](https://mechkeys.ca) + +Make example for this keyboard (after setting up your build environment): + + make espectro: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/espectro/rules.mk b/keyboards/espectro/rules.mk new file mode 100755 index 0000000000..2c28fe8504 --- /dev/null +++ b/keyboards/espectro/rules.mk @@ -0,0 +1,61 @@ +# MCU name +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) + +# 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 = atmel-dfu + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + + +# Boot Section Size in *bytes* + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes -- cgit v1.2.3 From e9fd42df71ebc367fccbbf918a1794498aa57914 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 4 Nov 2018 09:32:42 -0800 Subject: converter/adb_usb Configurator support and adb_usb.h cleanup (#4348) * converter/adb_usb: Configurator support Note: LAYOUT_ext_ansi has a blank space between the Spacebar and the Right Alt/Option key when loaded in the Configurator. This is deliberate. Stock Apple Extended Keyboards and AEK IIs send the scan code for Left Command when either Command key is used. (This is noted already in the readme.) That being the case, the Command keys cannot be assigned to different functions. Whichever keycode is placed on Left Command will be used for both Command keys. * converter/adb_usb: adb_usb.h cleanup - replaced KEYMAP_COMMON_H with ADB_USB_H - white space changes for visual alignment in LAYOUT_ext_ansi macro --- keyboards/converter/adb_usb/adb_usb.h | 12 +- keyboards/converter/adb_usb/info.json | 204 ++++++++++++++++++++++++++++++++++ 2 files changed, 210 insertions(+), 6 deletions(-) create mode 100644 keyboards/converter/adb_usb/info.json diff --git a/keyboards/converter/adb_usb/adb_usb.h b/keyboards/converter/adb_usb/adb_usb.h index 491db95f1c..8691adcc65 100644 --- a/keyboards/converter/adb_usb/adb_usb.h +++ b/keyboards/converter/adb_usb/adb_usb.h @@ -17,8 +17,8 @@ along with this program. If not, see . Ported to QMK by Peter Roe */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#ifndef ADB_USB_H +#define ADB_USB_H #include "quantum.h" @@ -58,10 +58,10 @@ Ported to QMK by Peter Roe { KC_NO, KC_NO, KC_NO, K4B, K4C, KC_NO, K4E, KC_NO, }, \ { KC_NO, KC_NO, K52, K53, K54, K55, K56, K57 }, \ { K58, K59, KC_NO, K5B, K5C, KC_NO, KC_NO, KC_NO, }, \ - { K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \ - { KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \ - { KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \ - { K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \ + { K60, K61, K62, K63, K64, K65, KC_NO, K67 }, \ + { KC_NO, K69, KC_NO, K6B, KC_NO, K6D, KC_NO, K6F }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 }, \ + { K78, K79, K7A, K7B, K7C, K7D, KC_NO, K7F } \ } /* M0116 Apple Standard Keyboard ANSI diff --git a/keyboards/converter/adb_usb/info.json b/keyboards/converter/adb_usb/info.json new file mode 100644 index 0000000000..e06f9c1adb --- /dev/null +++ b/keyboards/converter/adb_usb/info.json @@ -0,0 +1,204 @@ +{ + "keyboard_name": "ADB to USB Keyboard Converter", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 7, + "layouts": { + "LAYOUT_ext_ansi": { + "layout": [ + {"label":"Escape", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"Eject", "x":21.5, "y":0}, + {"label":"`", "x":0, "y":2}, + {"label":"1", "x":1, "y":2}, + {"label":"2", "x":2, "y":2}, + {"label":"3", "x":3, "y":2}, + {"label":"4", "x":4, "y":2}, + {"label":"5", "x":5, "y":2}, + {"label":"6", "x":6, "y":2}, + {"label":"7", "x":7, "y":2}, + {"label":"8", "x":8, "y":2}, + {"label":"9", "x":9, "y":2}, + {"label":"0", "x":10, "y":2}, + {"label":"-", "x":11, "y":2}, + {"label":"=", "x":12, "y":2}, + {"label":"Backspace", "x":13, "y":2, "w":2}, + {"label":"Insert", "x":15.25, "y":2}, + {"label":"Home", "x":16.25, "y":2}, + {"label":"Page Up", "x":17.25, "y":2}, + {"label":"Num Lock", "x":18.5, "y":2}, + {"label":"Num =", "x":19.5, "y":2}, + {"label":"Num /", "x":20.5, "y":2}, + {"label":"Num *", "x":21.5, "y":2}, + {"label":"Tab", "x":0, "y":3, "w":1.5}, + {"label":"Q", "x":1.5, "y":3}, + {"label":"W", "x":2.5, "y":3}, + {"label":"E", "x":3.5, "y":3}, + {"label":"R", "x":4.5, "y":3}, + {"label":"T", "x":5.5, "y":3}, + {"label":"Y", "x":6.5, "y":3}, + {"label":"U", "x":7.5, "y":3}, + {"label":"I", "x":8.5, "y":3}, + {"label":"O", "x":9.5, "y":3}, + {"label":"P", "x":10.5, "y":3}, + {"label":"[", "x":11.5, "y":3}, + {"label":"]", "x":12.5, "y":3}, + {"label":"\\", "x":13.5, "y":3, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3}, + {"label":"End", "x":16.25, "y":3}, + {"label":"Page Down", "x":17.25, "y":3}, + {"label":"Num 7", "x":18.5, "y":3}, + {"label":"Num 8", "x":19.5, "y":3}, + {"label":"Num 9", "x":20.5, "y":3}, + {"label":"Num -", "x":21.5, "y":3}, + {"label":"Lcap", "x":0, "y":4, "w":1.75}, + {"label":"A", "x":1.75, "y":4}, + {"label":"S", "x":2.75, "y":4}, + {"label":"D", "x":3.75, "y":4}, + {"label":"F", "x":4.75, "y":4}, + {"label":"G", "x":5.75, "y":4}, + {"label":"H", "x":6.75, "y":4}, + {"label":"J", "x":7.75, "y":4}, + {"label":"K", "x":8.75, "y":4}, + {"label":"L", "x":9.75, "y":4}, + {"label":";", "x":10.75, "y":4}, + {"label":"\"", "x":11.75, "y":4}, + {"label":"Enter", "x":12.75, "y":4, "w":2.25}, + {"label":"Num 4", "x":18.5, "y":4}, + {"label":"Num 5", "x":19.5, "y":4}, + {"label":"Num 6", "x":20.5, "y":4}, + {"label":"Num +", "x":21.5, "y":4}, + {"label":"Shift", "x":0, "y":5, "w":2.25}, + {"label":"Z", "x":2.25, "y":5}, + {"label":"X", "x":3.25, "y":5}, + {"label":"C", "x":4.25, "y":5}, + {"label":"V", "x":5.25, "y":5}, + {"label":"B", "x":6.25, "y":5}, + {"label":"N", "x":7.25, "y":5}, + {"label":"M", "x":8.25, "y":5}, + {"label":",", "x":9.25, "y":5}, + {"label":".", "x":10.25, "y":5}, + {"label":"/", "x":11.25, "y":5}, + {"label":"Shift", "x":12.25, "y":5, "w":2.75}, + {"label":"Up", "x":16.25, "y":5}, + {"label":"Num 1", "x":18.5, "y":5}, + {"label":"Num 2", "x":19.5, "y":5}, + {"label":"Num 3", "x":20.5, "y":5}, + {"label":"Ctrl", "x":0, "y":6, "w":1.5}, + {"label":"Alt", "x":1.5, "y":6, "w":1.25}, + {"label":"Command", "x":2.75, "y":6, "w":1.5}, + {"label":"Space", "x":4.25, "y":6, "w":6.5}, + {"label":"Alt", "x":12.25, "y":6, "w":1.25}, + {"label":"Ctrl", "x":13.5, "y":6, "w":1.5}, + {"label":"Left", "x":15.25, "y":6}, + {"label":"Down", "x":16.25, "y":6}, + {"label":"Right", "x":17.25, "y":6}, + {"label":"Num 0", "x":18.5, "y":6, "w":2}, + {"label":"Num .", "x":20.5, "y":6}, + {"label":"Num Enter", "x":21.5, "y":5, "h":2} + ] + }, + "LAYOUT_m0116_ansi": { + "width": 19.5, + "height": 6.25, + "layout": [ + {"label":"Power", "x":5, "y":0, "w":2}, + {"label":"Esc", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"-", "x":11, "y":1.25}, + {"label":"=", "x":12, "y":1.25}, + {"label":"Delete", "x":13, "y":1.25, "w":1.5}, + {"label":"Clear", "x":15.5, "y":1.25}, + {"label":"Num =", "x":16.5, "y":1.25}, + {"label":"Num /", "x":17.5, "y":1.25}, + {"label":"Num *", "x":18.5, "y":1.25}, + {"label":"Tab", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"[", "x":11.5, "y":2.25}, + {"label":"]", "x":12.5, "y":2.25}, + {"label":"Num 7", "x":15.5, "y":2.25}, + {"label":"Num 8", "x":16.5, "y":2.25}, + {"label":"Num 9", "x":17.5, "y":2.25}, + {"label":"Num +", "x":18.5, "y":2.25}, + {"label":"Ctrl", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":";", "x":10.75, "y":3.25}, + {"label":"'", "x":11.75, "y":3.25}, + {"label":"Return", "x":12.75, "y":3.25, "w":1.75}, + {"label":"Num 4", "x":15.5, "y":3.25}, + {"label":"Num 5", "x":16.5, "y":3.25}, + {"label":"Num 6", "x":17.5, "y":3.25}, + {"label":"Num -", "x":18.5, "y":3.25}, + {"label":"Shift", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":",", "x":9.25, "y":4.25}, + {"label":".", "x":10.25, "y":4.25}, + {"label":"/", "x":11.25, "y":4.25}, + {"label":"Shift", "x":12.25, "y":4.25, "w":2.25}, + {"label":"Num 1", "x":15.5, "y":4.25}, + {"label":"Num 2", "x":16.5, "y":4.25}, + {"label":"Num 3", "x":17.5, "y":4.25}, + {"label":"Caps Lock", "x":0, "y":5.25}, + {"label":"Option", "x":1, "y":5.25}, + {"label":"Command", "x":2, "y":5.25, "w":1.75}, + {"label":"`", "x":3.75, "y":5.25}, + {"label":"Space", "x":4.75, "y":5.25, "w":4.75}, + {"label":"\\", "x":9.5, "y":5.25}, + {"label":"Left", "x":10.5, "y":5.25}, + {"label":"Right", "x":11.5, "y":5.25}, + {"label":"Down", "x":12.5, "y":5.25}, + {"label":"Up", "x":13.5, "y":5.25}, + {"label":"Num 0", "x":15.5, "y":5.25, "w":2}, + {"label":"Num .", "x":17.5, "y":5.25}, + {"label":"Num Enter", "x":18.5, "y":4.25, "h":2} + ] + } + } +} -- cgit v1.2.3 From 756d92c1a071b6c481b67a44671308fc9d680afe Mon Sep 17 00:00:00 2001 From: Kosuke Adachi Date: Mon, 5 Nov 2018 03:46:26 +0900 Subject: Keyboard: Update the serial.c of crkbd based on the helix-serial.c (#4349) --- keyboards/crkbd/rev1/serial_config.h | 12 +- keyboards/crkbd/rev1/split_scomm.c | 49 ++++-- keyboards/crkbd/rev1/split_scomm.h | 5 +- keyboards/crkbd/rev1/split_util.h | 5 +- keyboards/crkbd/serial.c | 284 ++++++++++++++++++++++++++--------- keyboards/crkbd/serial.h | 27 ++-- 6 files changed, 277 insertions(+), 105 deletions(-) diff --git a/keyboards/crkbd/rev1/serial_config.h b/keyboards/crkbd/rev1/serial_config.h index 671ed821d2..4fab8e8ddf 100644 --- a/keyboards/crkbd/rev1/serial_config.h +++ b/keyboards/crkbd/rev1/serial_config.h @@ -1,10 +1,4 @@ -#pragma once - -/* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect - +#ifndef SOFT_SERIAL_PIN +#define SOFT_SERIAL_PIN D2 #define SERIAL_USE_MULTI_TRANSACTION +#endif diff --git a/keyboards/crkbd/rev1/split_scomm.c b/keyboards/crkbd/rev1/split_scomm.c index 9719eb22ea..ada7867960 100644 --- a/keyboards/crkbd/rev1/split_scomm.c +++ b/keyboards/crkbd/rev1/split_scomm.c @@ -7,8 +7,8 @@ #include #include #include "serial.h" -#ifdef SERIAL_DEBUG_MODE -#include +#ifdef CONSOLE_ENABLE + #include #endif uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; @@ -17,6 +17,7 @@ uint8_t volatile status_com = 0; uint8_t volatile status1 = 0; uint8_t slave_buffer_change_count = 0; uint8_t s_change_old = 0xff; +uint8_t s_change_new = 0xff; SSTD_t transactions[] = { #define GET_SLAVE_STATUS 0 @@ -41,12 +42,12 @@ SSTD_t transactions[] = { void serial_master_init(void) { - soft_serial_initiator_init(transactions); + soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) { - soft_serial_target_init(transactions); + soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error @@ -54,19 +55,37 @@ void serial_slave_init(void) // 2 => checksum error int serial_update_buffers(int master_update) { - int status; + int status, smatstatus; static int need_retry = 0; - if( s_change_old != slave_buffer_change_count ) { - status = soft_serial_transaction(GET_SLAVE_BUFFER); - if( status == TRANSACTION_END ) - s_change_old = slave_buffer_change_count; + + if( s_change_old != s_change_new ) { + smatstatus = soft_serial_transaction(GET_SLAVE_BUFFER); + if( smatstatus == TRANSACTION_END ) { + s_change_old = s_change_new; +#ifdef CONSOLE_ENABLE + uprintf("slave matrix = %b %b %b %b %b\n", + serial_slave_buffer[0], serial_slave_buffer[1], + serial_slave_buffer[2], serial_slave_buffer[3], + serial_slave_buffer[4] ); +#endif + } + } else { + // serial_slave_buffer dosen't change + smatstatus = TRANSACTION_END; // dummy status + } + + if( !master_update && !need_retry) { + status = soft_serial_transaction(GET_SLAVE_STATUS); + } else { + status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); + } + if( status == TRANSACTION_END ) { + s_change_new = slave_buffer_change_count; + need_retry = 0; + } else { + need_retry = 1; } - if( !master_update && !need_retry) - status = soft_serial_transaction(GET_SLAVE_STATUS); - else - status = soft_serial_transaction(PUT_MASTER_GET_SLAVE_STATUS); - need_retry = ( status == TRANSACTION_END ) ? 0 : 1; - return status; + return smatstatus; } #endif // SERIAL_USE_MULTI_TRANSACTION diff --git a/keyboards/crkbd/rev1/split_scomm.h b/keyboards/crkbd/rev1/split_scomm.h index 16887eb74f..873d8939d8 100644 --- a/keyboards/crkbd/rev1/split_scomm.h +++ b/keyboards/crkbd/rev1/split_scomm.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef SPLIT_COMM_H +#define SPLIT_COMM_H #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) --- */ @@ -19,3 +20,5 @@ void serial_slave_init(void); int serial_update_buffers(int master_changed); #endif + +#endif /* SPLIT_COMM_H */ diff --git a/keyboards/crkbd/rev1/split_util.h b/keyboards/crkbd/rev1/split_util.h index f593047560..687ca19bd3 100644 --- a/keyboards/crkbd/rev1/split_util.h +++ b/keyboards/crkbd/rev1/split_util.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef SPLIT_KEYBOARD_UTIL_H +#define SPLIT_KEYBOARD_UTIL_H #include #include "eeconfig.h" @@ -14,3 +15,5 @@ void split_keyboard_setup(void); bool has_usb(void); void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/crkbd/serial.c b/keyboards/crkbd/serial.c index 11ceff0b37..325c29a3f7 100644 --- a/keyboards/crkbd/serial.c +++ b/keyboards/crkbd/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -14,8 +19,58 @@ #include "serial.h" //#include -#ifdef USE_SERIAL +#ifdef SOFT_SERIAL_PIN +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -42,56 +97,118 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -105,17 +222,21 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -135,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -152,30 +274,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -191,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -205,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -230,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -288,6 +408,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -297,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -315,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -349,6 +479,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -375,9 +507,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -389,12 +522,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -404,12 +537,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -419,7 +552,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -442,3 +575,16 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif #endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/crkbd/serial.h b/keyboards/crkbd/serial.h index 76c6aaa043..7e0c0847a4 100644 --- a/keyboards/crkbd/serial.h +++ b/keyboards/crkbd/serial.h @@ -1,16 +1,19 @@ -#pragma once +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // // //// USE Simple API (OLD API, compatible with let's split serial.c) // ex. @@ -46,16 +49,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -71,7 +76,9 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif + +#endif /* SOFT_SERIAL_H */ -- cgit v1.2.3 From f28a4e39fc97e22a2e547c60d9ffce188d3a6495 Mon Sep 17 00:00:00 2001 From: TurboMech <32869044+TurboMech@users.noreply.github.com> Date: Sun, 4 Nov 2018 19:00:33 -0500 Subject: Fix Espectro build (#4353) After further testing and feedback from others, the bottom row matrix was incorrect. Also RGB number was incorrect (I was tired when building this, really shouldn't do that). --- keyboards/espectro/config.h | 2 +- keyboards/espectro/espectro.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/espectro/config.h b/keyboards/espectro/config.h index 34852df43b..294091d582 100755 --- a/keyboards/espectro/config.h +++ b/keyboards/espectro/config.h @@ -59,7 +59,7 @@ #define RGB_DI_PIN E2 #ifdef RGB_DI_PIN -#define RGBLED_NUM 16 +#define RGBLED_NUM 18 #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 10 #define RGBLIGHT_VAL_STEP 10 diff --git a/keyboards/espectro/espectro.h b/keyboards/espectro/espectro.h index 3d6ea466d3..6f9e4b7f7b 100755 --- a/keyboards/espectro/espectro.h +++ b/keyboards/espectro/espectro.h @@ -28,7 +28,7 @@ K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, \ K400, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ -K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511 \ +K500, K501, K502, K509, K505, K506, K507, K508, K503, K504, K510, K511 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ @@ -48,7 +48,7 @@ K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K7 K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, K312, \ K400, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ -K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 \ +K500, K501, K502, K509, K505, K506, K507, K508, K503, K504, K510, K511, K512 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ @@ -75,7 +75,7 @@ K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K300, K300, K301, K302, K304, K612, K705, K706, K707, K305, K306, K307, K703, K308, K309, K310, K311, K312, \ K400x2, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K408, K704, K409, K410, K411, K412, \ K412, \ -K500x2, K501x2, K502, K503x3, K504x3, K505x2, K506x2, K507x2, K508x2, K509, K510x2, K511, K512 \ +K500x2, K501x2, K502, K509x3, K505x3, K506x2, K507x2, K508x2, K503x2, K504, K510x2, K511, K512 \ ) { \ { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ -- cgit v1.2.3 From f2fda1bd56c97019777fb2a028d088ae37693b0f Mon Sep 17 00:00:00 2001 From: Jarred Steenvoorden Date: Mon, 5 Nov 2018 19:05:48 +1100 Subject: Keymap update Adding RGB underglow controls. (#4358) * Update userspace with common config.h * Add my dz60, satan and xd75 keyboard keymaps * Fixing executable bits changed during last upstream merge * Cleanup unnecessary files and defines * Remove unnecessary defines from userspace config * Add underglow controls to dz60 function layer * Fixing merge conflicts * Fixing exectable bits changed during merge --- keyboards/dz60/keymaps/jarred/keymap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/dz60/keymaps/jarred/keymap.c b/keyboards/dz60/keymaps/jarred/keymap.c index 9e68506831..2ef6794934 100644 --- a/keyboards/dz60/keymaps/jarred/keymap.c +++ b/keyboards/dz60/keymaps/jarred/keymap.c @@ -13,9 +13,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT,KC_RGUI, XXXXXXX,KC_APP, KC_RCTL), [_NV] = LAYOUT( - KC_GRV ,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_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, - _______,_______,_______,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, - _______,_______,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______,_______, - _______,_______,_______, _______,_______,_______, _______,_______,_______, RESET, _______) + KC_GRV ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 ,KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 ,XXXXXXX,_______, + _______,RGB_TOG,RGB_MOD,_______,KC_DEL ,KC_BSPC,_______,KC_HOME,KC_UP ,KC_END ,KC_INS ,_______,_______,_______, + _______,RGB_HUI,RGB_HUD,KC_LSFT,KC_LCTL,KC_ENT ,_______,KC_LEFT,KC_DOWN,KC_RGHT,KC_DEL ,KC_DEL , _______, + _______,XXXXXXX,RGB_SAD,RGB_SAI,_______,_______,_______,_______,KC_PGUP,KC_PGDN,_______,_______,_______,XXXXXXX, + _______,RGB_VAD,RGB_VAI, _______,_______,_______, _______,_______,XXXXXXX, RESET,_______) }; -- cgit v1.2.3 From d1d5f200787f70bb853e32d5e5e2ce7b35ef7a54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Mon, 5 Nov 2018 15:04:14 +0100 Subject: Update whitefox/konstantin keymap (#4363) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use Magic+Esc for entering bootloader mode * Expand rules.mk * Improve FN_RCTL tap dance * Avoid one-line if statements * Add PROGMEM to keymaps definition * td_fn_rctl_* → td_fn_rctrl_* * Fix FN_RCTL tap dance bug when count is 4, 8, 12 etc. * Add ACTION_TAP_DANCE_DOUBLE_MODS * Rearrange/rename keycode defines * Use RAL_RGU and RCT_RSF in keymaps * Replace keymap ASCII art with box drawing characters * Add FN_FNLK and use it * Set Unicode input mode in eeconfig_init_user instead of matrix_init_user --- keyboards/whitefox/keymaps/konstantin/config.h | 9 +- keyboards/whitefox/keymaps/konstantin/keymap.c | 202 ++++++++++++++++--------- keyboards/whitefox/keymaps/konstantin/rules.mk | 6 + 3 files changed, 142 insertions(+), 75 deletions(-) diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index 39450d6802..d1c3002d27 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -2,6 +2,12 @@ #define FORCE_NKRO +#undef IS_COMMAND +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) + +#define MAGIC_KEY_LAYER0_ALT1 BSLS +#define MAGIC_KEY_BOOTLOADER ESC + #define MOUSEKEY_DELAY 50 #define MOUSEKEY_INTERVAL 15 #define MOUSEKEY_MAX_SPEED 4 @@ -12,6 +18,3 @@ #define PERMISSIVE_HOLD #define TAPPING_TERM 200 #define TAPPING_TOGGLE 2 - -#undef IS_COMMAND -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index edb049287c..6732d9a01e 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -1,25 +1,29 @@ #include QMK_KEYBOARD_H -#define FN MO(L_FN) -#define FN_CAPS LT(L_FN, KC_CAPS) -#define FN_RCTL TD(TD_FN_RCTL) // Unused -#define RLALT TD(TD_RLALT) // Unused -#define DESKTOP TD(TD_DESKTOP) - -#define DESKT_L LCTL(LGUI(KC_LEFT)) -#define DESKT_R LCTL(LGUI(KC_RGHT)) #define TOP LCTL(KC_HOME) #define BOTTOM LCTL(KC_END) +#define DSKTP_L LCTL(LGUI(KC_LEFT)) +#define DSKTP_R LCTL(LGUI(KC_RGHT)) -#define UC_COMM UC(0x002C) -#define UC_LPRN UC(0x0028) -#define UC_RPRN UC(0x0029) -#define UC_EQLS UC(0x003D) -#define UC_MULS UC(0x00D7) -#define UC_DIVS UC(0x00F7) -#define UC_MINS UC(0x2212) +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_FNLK TT(L_FN) -void matrix_init_user(void) { +#define DESKTOP TD(TD_DESKTOP) +#define FN_RCTL TD(TD_FN_RCTL) +#define RAL_LAL TD(TD_RAL_LAL) +#define RAL_RGU TD(TD_RAL_RGU) +#define RCT_RSF TD(TD_RCT_RSF) + +#define COMMA UC(0x002C) +#define L_PAREN UC(0x0028) +#define R_PAREN UC(0x0029) +#define EQUALS UC(0x003D) +#define TIMES UC(0x00D7) +#define DIVIDE UC(0x00F7) +#define MINUS UC(0x2212) + +void eeconfig_init_user(void) { set_unicode_input_mode(UC_WINC); } @@ -37,7 +41,9 @@ enum custom_keycodes { bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case CLEAR: - if (record->event.pressed) { SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); } + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } return false; case NUMPAD: @@ -55,90 +61,142 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -enum tap_dance { - TD_FN_RCTL, - TD_RLALT, - TD_DESKTOP, -}; +struct { + bool fn_on; // Layer state when tap dance started + bool started; +} td_fn_rctrl_data; + +void td_fn_rctrl_each(qk_tap_dance_state_t *state, void *user_data) { + if (!td_fn_rctrl_data.started) { + td_fn_rctrl_data.fn_on = IS_LAYER_ON(L_FN); + td_fn_rctrl_data.started = true; + } + // Single tap → Fn, double tap → RCtrl, triple tap etc. → Fn+RCtrl + if (state->count == 1 || state->count == 3) { + layer_on(L_FN); + } else if (state->count == 2) { + if (!td_fn_rctrl_data.fn_on) { + layer_off(L_FN); + } + register_code(KC_RCTL); + } +} + +void td_fn_rctrl_reset(qk_tap_dance_state_t *state, void *user_data) { + if ((state->count == 1 || state->count > 2) && !td_fn_rctrl_data.fn_on) { + layer_off(L_FN); + } + if (state->count >= 2) { + unregister_code(KC_RCTL); + } + td_fn_rctrl_data.started = false; +} + +#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ + .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ + .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ + } -void td_fn_rctl_finished(qk_tap_dance_state_t *state, void *user_data) { - // Single tap → Fn, double tap → RCtrl, triple tap → Fn+RCtrl etc. - if (state->count & 1) { layer_on(L_FN); } - if (state->count & 2) { register_code(KC_RCTL); } +void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(mods->kc1); + } else if (state->count == 2) { + unregister_code(mods->kc1); + register_code(mods->kc2); + } + // Prevent tap dance from sending kc1 and kc2 as weak mods + state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2)); } -void td_fn_rctl_reset(qk_tap_dance_state_t *state, void *user_data) { - if (state->count & 1) { layer_off(L_FN); } - if (state->count & 2) { unregister_code(KC_RCTL); } +void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + if (state->count == 1 || state->count > 2) { + unregister_code(mods->kc1); + } + if (state->count >= 2) { + unregister_code(mods->kc2); + } } +enum tap_dance { + TD_DESKTOP, + TD_FN_RCTL, + TD_RAL_LAL, + TD_RAL_RGU, + TD_RCT_RSF, +}; + qk_tap_dance_action_t tap_dance_actions[] = { - [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, td_fn_rctl_finished, td_fn_rctl_reset), - [TD_RLALT] = ACTION_TAP_DANCE_DOUBLE(KC_RALT, KC_LALT), [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop + [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(td_fn_rctrl_each, NULL, td_fn_rctrl_reset), + [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), + [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI), + [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RCTL, KC_RSFT), }; -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Base layer - * ,---------------------------------------------------------------. - * |Esc| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | \ | ` |PSc| - * |---------------------------------------------------------------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] |Bspc |Del| - * |---------------------------------------------------------------| - * |FnCaps| A | S | D | F | G | H | J | K | L | ; | ' | Enter |PgU| - * |---------------------------------------------------------------| - * | LShift | Z | X | C | V | B | N | M | , | . | / |RCtrl | ↑ |PgD| - * |---------------------------------------------------------------| - * |LCtl|LGui|LAlt| Space |RAlt| Fn | | ← | ↓ | → | - * `---------------------------------------------------------------' + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │CtlSft│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │AlGu│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_BASE] = LAYOUT_truefox( \ KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ 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_BSPC, KC_DEL, \ 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_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RCTL, KC_UP, KC_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN, KC_LEFT,KC_DOWN,KC_RGHT \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,RCT_RSF, KC_UP, KC_PGDN, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, RAL_RGU,FN_FNLK, KC_LEFT,KC_DOWN,KC_RGHT \ ), /* Function layer - * ,---------------------------------------------------------------. - * | |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Num|Scr|Pau| - * |---------------------------------------------------------------| - * | M4 |M2 |M↑ |M1 |M3 |M5 | | | |Stp|Ply|Prv|Nxt|Clear|Ins| - * |---------------------------------------------------------------| - * | |M← |M↓ |M→ |MW↑| | | | | | | | |Top| - * |---------------------------------------------------------------| - * | |MA0|MA2|MW←|MW→| | | |VoD|VoU|Mut| App |PgU|Btm| - * |---------------------------------------------------------------| - * | |Dstp|Dst←| MW↓ |Dst→| | |Hom|PgD|End| - * `---------------------------------------------------------------' + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│Scr│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │ │ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │Dstp│Dst←│ MW↓ │Dst→│ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_FN] = LAYOUT_truefox( \ _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ - _______,DESKTOP,DESKT_L, KC_WH_D, DESKT_R,_______, KC_HOME,KC_PGDN,KC_END \ + _______,DESKTOP,DSKTP_L, KC_WH_D, DSKTP_R,_______, KC_HOME,KC_PGDN,KC_END \ ), /* Numpad layer - * ,---------------------------------------------------------------. - * |Num| | | | | | |P7 |P8 |P9 |P- | − | = |Num| | | - * |---------------------------------------------------------------| - * | | | | | | | |P4 |P5 |P6 |P+ | ( | ) | | | - * |---------------------------------------------------------------| - * | | | | | | | |P1 |P2 |P3 |P* | × | PEnter | | - * |---------------------------------------------------------------| - * | | | | | | |P0 |P0 | , |P. |P/ | ÷ | | | - * |---------------------------------------------------------------| - * | | | | | | | | | | | - * `---------------------------------------------------------------' + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Num│ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_NUMPAD] = LAYOUT_truefox( \ - NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,UC_MINS,UC_EQLS,NUMPAD, _______,_______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,UC_LPRN,UC_RPRN,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,UC_MULS, KC_PENT, _______, \ - _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, UC_COMM,KC_PDOT,KC_PSLS,UC_DIVS, _______,_______, \ + NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,MINUS, EQUALS, NUMPAD, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,L_PAREN,R_PAREN,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,TIMES, KC_PENT, _______, \ + _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, COMMA, KC_PDOT,KC_PSLS,DIVIDE, _______,_______, \ _______,_______,_______, _______, _______,_______, _______,_______,_______ \ ), }; diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index f1f3d2378e..abf92c2c46 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -1,4 +1,10 @@ +BACKLIGHT_ENABLE = no BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes +VISUALIZER_ENABLE = no -- cgit v1.2.3 From a95fc388fd85ffddcaf07e56ce5a147458fad47c Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Mon, 5 Nov 2018 15:04:52 +0100 Subject: Redox: move curly brackets one row down. (#4364) In #4258, the 2 curly brackets were inadvertently moved one row up. This fixes that. --- keyboards/redox/keymaps/jeherve/keymap.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/keyboards/redox/keymaps/jeherve/keymap.c b/keyboards/redox/keymaps/jeherve/keymap.c index f8dfc4854c..c2852f312c 100644 --- a/keyboards/redox/keymaps/jeherve/keymap.c +++ b/keyboards/redox/keymaps/jeherve/keymap.c @@ -158,7 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,TT(_NAV),TT(_SYMB), TT(_SYMB),TT(_NAV),KC_K ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , KC_RCMD , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR + MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , KC_RCMD , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -166,13 +166,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ _______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,KC_LCBR , KC_RCBR ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,_______ , + _______ ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 ,_______ , _______ ,KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,_______ , _______ ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , + _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,KC_LCBR , KC_RCBR ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -186,7 +186,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -200,7 +200,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,UC_00E2 ,XXXXXXX ,UC_00E7 ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,UC_0171 ,UC_00EA ,XXXXXXX ,UC_0151 ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,NBSP , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -214,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ + _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ) -- cgit v1.2.3 From a49d0a1e83d686a6c7a0673ffbd691f80908ea6f Mon Sep 17 00:00:00 2001 From: Danny Date: Mon, 5 Nov 2018 14:00:38 -0500 Subject: Keyboard: Add Nyquist Rev 3 (#4287) * Add Nyquist Rev 3 * Switch to split_common --- keyboards/nyquist/eeprom-lefthand.eep | 2 - keyboards/nyquist/eeprom-righthand.eep | 2 - keyboards/nyquist/i2c.c | 162 ---------- keyboards/nyquist/i2c.h | 49 --- keyboards/nyquist/info.json | 3 + keyboards/nyquist/keymaps/default/config.h | 7 +- keyboards/nyquist/keymaps/default/rules.mk | 4 - keyboards/nyquist/keymaps/hexwire/config.h | 7 +- keyboards/nyquist/keymaps/hexwire/rules.mk | 3 - keyboards/nyquist/matrix.c | 497 ----------------------------- keyboards/nyquist/nyquist.h | 8 +- keyboards/nyquist/rev1/config.h | 7 +- keyboards/nyquist/rev1/rev1.h | 5 +- keyboards/nyquist/rev2/config.h | 7 +- keyboards/nyquist/rev2/rev2.h | 5 +- keyboards/nyquist/rev3/config.h | 81 +++++ keyboards/nyquist/rev3/rev3.c | 21 ++ keyboards/nyquist/rev3/rev3.h | 63 ++++ keyboards/nyquist/rev3/rules.mk | 1 + keyboards/nyquist/rules.mk | 20 +- keyboards/nyquist/serial.c | 228 ------------- keyboards/nyquist/serial.h | 26 -- keyboards/nyquist/split_util.c | 86 ----- keyboards/nyquist/split_util.h | 20 -- 24 files changed, 188 insertions(+), 1126 deletions(-) delete mode 100644 keyboards/nyquist/eeprom-lefthand.eep delete mode 100644 keyboards/nyquist/eeprom-righthand.eep delete mode 100644 keyboards/nyquist/i2c.c delete mode 100644 keyboards/nyquist/i2c.h delete mode 100644 keyboards/nyquist/matrix.c create mode 100644 keyboards/nyquist/rev3/config.h create mode 100644 keyboards/nyquist/rev3/rev3.c create mode 100644 keyboards/nyquist/rev3/rev3.h create mode 100644 keyboards/nyquist/rev3/rules.mk delete mode 100644 keyboards/nyquist/serial.c delete mode 100644 keyboards/nyquist/serial.h delete mode 100644 keyboards/nyquist/split_util.c delete mode 100644 keyboards/nyquist/split_util.h diff --git a/keyboards/nyquist/eeprom-lefthand.eep b/keyboards/nyquist/eeprom-lefthand.eep deleted file mode 100644 index b9666a74c0..0000000000 --- a/keyboards/nyquist/eeprom-lefthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0B0000000000000000000000000001F4 -:00000001FF diff --git a/keyboards/nyquist/eeprom-righthand.eep b/keyboards/nyquist/eeprom-righthand.eep deleted file mode 100644 index 94cc5be7fc..0000000000 --- a/keyboards/nyquist/eeprom-righthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0B0000000000000000000000000000F5 -:00000001FF diff --git a/keyboards/nyquist/i2c.c b/keyboards/nyquist/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/nyquist/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 100000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/nyquist/info.json b/keyboards/nyquist/info.json index 0a038f6dd2..295864cfc9 100644 --- a/keyboards/nyquist/info.json +++ b/keyboards/nyquist/info.json @@ -7,6 +7,9 @@ "layouts": { "LAYOUT": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}] + }, + "LAYOUT_ortho_5x12": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}] } } } diff --git a/keyboards/nyquist/keymaps/default/config.h b/keyboards/nyquist/keymaps/default/config.h index c4604af436..0fa606f296 100644 --- a/keyboards/nyquist/keymaps/default/config.h +++ b/keyboards/nyquist/keymaps/default/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -37,5 +34,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/nyquist/keymaps/default/rules.mk b/keyboards/nyquist/keymaps/default/rules.mk index 1e57612788..1e3cebb145 100644 --- a/keyboards/nyquist/keymaps/default/rules.mk +++ b/keyboards/nyquist/keymaps/default/rules.mk @@ -1,5 +1 @@ RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/keymaps/hexwire/config.h b/keyboards/nyquist/keymaps/hexwire/config.h index 8b9c3ea2bd..4f1901b5dd 100644 --- a/keyboards/nyquist/keymaps/hexwire/config.h +++ b/keyboards/nyquist/keymaps/hexwire/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ @@ -39,5 +36,3 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/nyquist/keymaps/hexwire/rules.mk b/keyboards/nyquist/keymaps/hexwire/rules.mk index 1e57612788..a81250cdf6 100644 --- a/keyboards/nyquist/keymaps/hexwire/rules.mk +++ b/keyboards/nyquist/keymaps/hexwire/rules.mk @@ -1,5 +1,2 @@ RGBLIGHT_ENABLE = yes -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/nyquist/matrix.c b/keyboards/nyquist/matrix.c deleted file mode 100644 index 3cdad4adb8..0000000000 --- a/keyboards/nyquist/matrix.c +++ /dev/null @@ -1,497 +0,0 @@ -/* -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef BACKLIGHT_ENABLE - #include "backlight.h" - extern backlight_config_t backlight_config; -#endif - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - err = i2c_master_write(backlight_config.enable ? backlight_config.level : 0); -#else - // Write zero, so our byte index is the same - err = i2c_master_write(0x00); -#endif - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = backlight_config.enable ? backlight_config.level : 0; -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(i2c_slave_buffer[0]); -#endif - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i+1] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ -#if (DEBOUNCING_DELAY > 0) - if (debouncing) return false; -#endif - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/nyquist/nyquist.h b/keyboards/nyquist/nyquist.h index d401a45f78..9a3e996476 100644 --- a/keyboards/nyquist/nyquist.h +++ b/keyboards/nyquist/nyquist.h @@ -1,5 +1,4 @@ -#ifndef NYQUIST_H -#define NYQUIST_H +#pragma once #ifdef KEYBOARD_nyquist_rev1 #include "rev1.h" @@ -7,6 +6,9 @@ #ifdef KEYBOARD_nyquist_rev2 #include "rev2.h" #endif +#ifdef KEYBOARD_nyquist_rev3 + #include "rev3.h" +#endif #include "quantum.h" @@ -26,4 +28,4 @@ KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45 \ ) -#endif +#define LAYOUT_kc_ortho_5x12 LAYOUT_kc diff --git a/keyboards/nyquist/rev1/config.h b/keyboards/nyquist/rev1/config.h index eec084eccd..35fbaffb96 100644 --- a/keyboards/nyquist/rev1/config.h +++ b/keyboards/nyquist/rev1/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xCB10 @@ -81,5 +78,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/nyquist/rev1/rev1.h b/keyboards/nyquist/rev1/rev1.h index 2d4c9f73ee..6d3a23383b 100644 --- a/keyboards/nyquist/rev1/rev1.h +++ b/keyboards/nyquist/rev1/rev1.h @@ -1,5 +1,4 @@ -#ifndef REV1_H -#define REV1_H +#pragma once #include "nyquist.h" @@ -64,5 +63,3 @@ #endif #define LAYOUT_ortho_5x12 LAYOUT - -#endif diff --git a/keyboards/nyquist/rev2/config.h b/keyboards/nyquist/rev2/config.h index ab062c9209..7dc743b275 100644 --- a/keyboards/nyquist/rev2/config.h +++ b/keyboards/nyquist/rev2/config.h @@ -15,10 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV2_CONFIG_H -#define REV2_CONFIG_H - -#include QMK_KEYBOARD_CONFIG_H +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xCB10 @@ -82,5 +79,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/nyquist/rev2/rev2.h b/keyboards/nyquist/rev2/rev2.h index 1eec5d2beb..6d3a23383b 100644 --- a/keyboards/nyquist/rev2/rev2.h +++ b/keyboards/nyquist/rev2/rev2.h @@ -1,5 +1,4 @@ -#ifndef REV2_H -#define REV2_H +#pragma once #include "nyquist.h" @@ -64,5 +63,3 @@ #endif #define LAYOUT_ortho_5x12 LAYOUT - -#endif diff --git a/keyboards/nyquist/rev3/config.h b/keyboards/nyquist/rev3/config.h new file mode 100644 index 0000000000..6c51bc9a80 --- /dev/null +++ b/keyboards/nyquist/rev3/config.h @@ -0,0 +1,81 @@ +/* +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCB10 +#define PRODUCT_ID 0x1156 +#define DEVICE_VER 0x0300 +#define MANUFACTURER Keebio +#define PRODUCT The Nyquist Keyboard +#define DESCRIPTION Split 60 percent ortholinear keyboard + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 10 +#define MATRIX_COLS 6 + +// wiring of each half +#define MATRIX_ROW_PINS { F0, F5, D7, F6, F7 } +#define MATRIX_COL_PINS { F1, F4, B7, D2, D3, D4 } + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLIGHT_TIMER +#define RGBLED_NUM 12 + +/* Backlight LEDs */ +#define BACKLIGHT_PIN D5 +#define BACKLIGHT_LEVELS 7 + +/* + * 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/nyquist/rev3/rev3.c b/keyboards/nyquist/rev3/rev3.c new file mode 100644 index 0000000000..34500fb104 --- /dev/null +++ b/keyboards/nyquist/rev3/rev3.c @@ -0,0 +1,21 @@ +#include "rev3.h" + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + // // green led on + // DDRD |= (1<<5); + // PORTD &= ~(1<<5); + + // // orange led on + // DDRB |= (1<<0); + // PORTB &= ~(1<<0); + + matrix_init_user(); +}; diff --git a/keyboards/nyquist/rev3/rev3.h b/keyboards/nyquist/rev3/rev3.h new file mode 100644 index 0000000000..3a3141f6e0 --- /dev/null +++ b/keyboards/nyquist/rev3/rev3.h @@ -0,0 +1,63 @@ +#pragma once + +#include "nyquist.h" +#include "quantum.h" + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); + +#ifndef FLIP_HALF +// Standard Keymap +// (TRRS jack on the left half is to the right, TRRS jack on the right half is to the left) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R05, R04, R03, R02, R01, R00 }, \ + { R15, R14, R13, R12, R11, R10 }, \ + { R25, R24, R23, R22, R21, R20 }, \ + { R35, R34, R33, R32, R31, R30 }, \ + { R45, R44, R43, R42, R41, R40 } \ + } +#else +// Keymap with right side flipped +// (TRRS jack on both halves are to the right) +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, R40, R41, R42, R43, R44, R45 \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05 }, \ + { L10, L11, L12, L13, L14, L15 }, \ + { L20, L21, L22, L23, L24, L25 }, \ + { L30, L31, L32, L33, L34, L35 }, \ + { L40, L41, L42, L43, L44, L45 }, \ + { R00, R01, R02, R03, R04, R05 }, \ + { R10, R11, R12, R13, R14, R15 }, \ + { R20, R21, R22, R23, R24, R25 }, \ + { R30, R31, R32, R33, R34, R35 }, \ + { R40, R41, R42, R43, R44, R45 } \ + } +#endif + +#define LAYOUT_ortho_5x12 LAYOUT + diff --git a/keyboards/nyquist/rev3/rules.mk b/keyboards/nyquist/rev3/rules.mk new file mode 100644 index 0000000000..bd518d8f27 --- /dev/null +++ b/keyboards/nyquist/rev3/rules.mk @@ -0,0 +1 @@ +BACKLIGHT_ENABLE = yes diff --git a/keyboards/nyquist/rules.mk b/keyboards/nyquist/rules.mk index 74d5625f85..5313b85022 100644 --- a/keyboards/nyquist/rules.mk +++ b/keyboards/nyquist/rules.mk @@ -1,8 +1,3 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -41,9 +36,13 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. -BOOTLOADER = caterina +ifeq ($(strip $(KEYBOARD)), nyquist/rev3) + BOOTLOADER = dfu +else + BOOTLOADER = caterina +endif # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT @@ -63,13 +62,10 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -USE_I2C = yes -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes - +SPLIT_KEYBOARD = yes LAYOUTS = ortho_5x12 - DEFAULT_FOLDER = nyquist/rev2 diff --git a/keyboards/nyquist/serial.c b/keyboards/nyquist/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/nyquist/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/nyquist/serial.h b/keyboards/nyquist/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/nyquist/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/nyquist/split_util.c b/keyboards/nyquist/split_util.c deleted file mode 100644 index 346cbc9089..0000000000 --- a/keyboards/nyquist/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif -- cgit v1.2.3 From a3bb8c05c9ac6e6e4e5334caba1a816fa309d414 Mon Sep 17 00:00:00 2001 From: zvecr Date: Tue, 6 Nov 2018 03:00:54 +0000 Subject: Keyboard: Initial foobar port (#4367) --- keyboards/foobar/config.h | 230 +++++++++++++++++++++++++++++ keyboards/foobar/foobar.c | 55 +++++++ keyboards/foobar/foobar.h | 66 +++++++++ keyboards/foobar/info.json | 25 ++++ keyboards/foobar/keymaps/default/config.h | 19 +++ keyboards/foobar/keymaps/default/keymap.c | 49 ++++++ keyboards/foobar/keymaps/default/readme.md | 1 + keyboards/foobar/keymaps/macro/config.h | 19 +++ keyboards/foobar/keymaps/macro/keymap.c | 40 +++++ keyboards/foobar/keymaps/macro/readme.md | 1 + keyboards/foobar/readme.md | 17 +++ keyboards/foobar/rules.mk | 83 +++++++++++ 12 files changed, 605 insertions(+) create mode 100644 keyboards/foobar/config.h create mode 100644 keyboards/foobar/foobar.c create mode 100644 keyboards/foobar/foobar.h create mode 100644 keyboards/foobar/info.json create mode 100644 keyboards/foobar/keymaps/default/config.h create mode 100644 keyboards/foobar/keymaps/default/keymap.c create mode 100644 keyboards/foobar/keymaps/default/readme.md create mode 100644 keyboards/foobar/keymaps/macro/config.h create mode 100644 keyboards/foobar/keymaps/macro/keymap.c create mode 100644 keyboards/foobar/keymaps/macro/readme.md create mode 100644 keyboards/foobar/readme.md create mode 100644 keyboards/foobar/rules.mk diff --git a/keyboards/foobar/config.h b/keyboards/foobar/config.h new file mode 100644 index 0000000000..89219c4607 --- /dev/null +++ b/keyboards/foobar/config.h @@ -0,0 +1,230 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F00 +#define MANUFACTURER di0ib +#define PRODUCT The foobar Keyboard +#define DESCRIPTION A split 30 key keyboard + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 3*2 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6, B4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/foobar/foobar.c b/keyboards/foobar/foobar.c new file mode 100644 index 0000000000..c032056a15 --- /dev/null +++ b/keyboards/foobar/foobar.c @@ -0,0 +1,55 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "foobar.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + {{4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, +}; +#endif diff --git a/keyboards/foobar/foobar.h b/keyboards/foobar/foobar.h new file mode 100644 index 0000000000..fc49c72aaf --- /dev/null +++ b/keyboards/foobar/foobar.h @@ -0,0 +1,66 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_split( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 } \ +} +#else +#define LAYOUT_split( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 } \ +} +#endif + +#define LAYOUT_macro( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ } \ +} + +#define LAYOUT LAYOUT_macro + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/foobar/info.json b/keyboards/foobar/info.json new file mode 100644 index 0000000000..cb7f29b256 --- /dev/null +++ b/keyboards/foobar/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 15, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2} + ] + }, + "LAYOUT_split": { + "key_count": 30, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2} + ] + } + } +} diff --git a/keyboards/foobar/keymaps/default/config.h b/keyboards/foobar/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/foobar/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/foobar/keymaps/default/keymap.c b/keyboards/foobar/keymaps/default/keymap.c new file mode 100644 index 0000000000..b750c61851 --- /dev/null +++ b/keyboards/foobar/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define _______ KC_TRNS +#define FN1_Q LT(1, KC_Q) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split( + FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, + KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [1] = LAYOUT_split( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/foobar/keymaps/default/readme.md b/keyboards/foobar/keymaps/default/readme.md new file mode 100644 index 0000000000..7113469e7e --- /dev/null +++ b/keyboards/foobar/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for foobar diff --git a/keyboards/foobar/keymaps/macro/config.h b/keyboards/foobar/keymaps/macro/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/foobar/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/foobar/keymaps/macro/keymap.c b/keyboards/foobar/keymaps/macro/keymap.c new file mode 100644 index 0000000000..1e7ec905fd --- /dev/null +++ b/keyboards/foobar/keymaps/macro/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_INT1, \ + KC_F17, KC_F18, KC_F19, KC_F20, KC_INT2, \ + KC_F21, KC_F22, KC_F23, KC_F14, KC_INT5 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/foobar/keymaps/macro/readme.md b/keyboards/foobar/keymaps/macro/readme.md new file mode 100644 index 0000000000..4cc59e7e5d --- /dev/null +++ b/keyboards/foobar/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for foobar diff --git a/keyboards/foobar/readme.md b/keyboards/foobar/readme.md new file mode 100644 index 0000000000..3898d4bb1a --- /dev/null +++ b/keyboards/foobar/readme.md @@ -0,0 +1,17 @@ +# foobar + +![foobar](https://2.bp.blogspot.com/-rr8TK6xg2N0/WbwVL2O7EfI/AAAAAAACDc8/209wN69ju0wAFICYYPNLIEGQhat5-5MbwCLcBGAs/s640/a.JPG) + +Split 30% keyboard that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 15 key macropad. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/foobar) + +Keyboard Maintainer: QMK Community +Hardware Supported: foobar PCB +Hardware Availability: [foobar project on 40% Keyboards](http://www.40percent.club/2017/09/foobar-10.html) + +Make example for this keyboard (after setting up your build environment): + + make foobar: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/foobar/rules.mk b/keyboards/foobar/rules.mk new file mode 100644 index 0000000000..3275651650 --- /dev/null +++ b/keyboards/foobar/rules.mk @@ -0,0 +1,83 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes -- cgit v1.2.3 From 5729380530ca28049a193f84b0199e77ba3e8edd Mon Sep 17 00:00:00 2001 From: zvecr Date: Tue, 6 Nov 2018 03:01:13 +0000 Subject: Keyboard: Initial 6lit port (#4355) * Initial 6lit port * Pull request review changes * Switch to bootmagic lite --- keyboards/6lit/6lit.c | 53 +++++++ keyboards/6lit/6lit.h | 55 ++++++++ keyboards/6lit/config.h | 230 +++++++++++++++++++++++++++++++ keyboards/6lit/info.json | 23 ++++ keyboards/6lit/keymaps/default/config.h | 19 +++ keyboards/6lit/keymaps/default/keymap.c | 39 ++++++ keyboards/6lit/keymaps/default/readme.md | 1 + keyboards/6lit/keymaps/macro/config.h | 19 +++ keyboards/6lit/keymaps/macro/keymap.c | 39 ++++++ keyboards/6lit/keymaps/macro/readme.md | 1 + keyboards/6lit/readme.md | 17 +++ keyboards/6lit/rules.mk | 83 +++++++++++ 12 files changed, 579 insertions(+) create mode 100644 keyboards/6lit/6lit.c create mode 100644 keyboards/6lit/6lit.h create mode 100644 keyboards/6lit/config.h create mode 100644 keyboards/6lit/info.json create mode 100644 keyboards/6lit/keymaps/default/config.h create mode 100644 keyboards/6lit/keymaps/default/keymap.c create mode 100644 keyboards/6lit/keymaps/default/readme.md create mode 100644 keyboards/6lit/keymaps/macro/config.h create mode 100644 keyboards/6lit/keymaps/macro/keymap.c create mode 100644 keyboards/6lit/keymaps/macro/readme.md create mode 100644 keyboards/6lit/readme.md create mode 100644 keyboards/6lit/rules.mk diff --git a/keyboards/6lit/6lit.c b/keyboards/6lit/6lit.c new file mode 100644 index 0000000000..fd3ae7d009 --- /dev/null +++ b/keyboards/6lit/6lit.c @@ -0,0 +1,53 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "6lit.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{2, 2}, {1, 2}, {0, 2}}, + {{2, 3}, {1, 3}, {0, 3}}, + {{0, 0}, {1, 0}, {2, 0}}, + {{0, 1}, {1, 1}, {2, 1}}, +}; +#endif diff --git a/keyboards/6lit/6lit.h b/keyboards/6lit/6lit.h new file mode 100644 index 0000000000..ae0beea35d --- /dev/null +++ b/keyboards/6lit/6lit.h @@ -0,0 +1,55 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ________ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_split( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R02, R01, R00 }, \ + { R12, R11, R10 }, \ +} +#else +#define LAYOUT_split( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R00, R01, R02 }, \ + { R10, R11, R12 }, \ +} +#endif + +#define LAYOUT_macro( \ + L00, L01, L02, \ + L10, L11, L12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ +} + +#define LAYOUT LAYOUT_macro + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/6lit/config.h b/keyboards/6lit/config.h new file mode 100644 index 0000000000..8397818a61 --- /dev/null +++ b/keyboards/6lit/config.h @@ -0,0 +1,230 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F61 +#define MANUFACTURER di0ib +#define PRODUCT The 6lit Macropad +#define DESCRIPTION A split 12 key Macropad + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 2*2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6 } +#define MATRIX_COL_PINS { F6, F7, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/6lit/info.json b/keyboards/6lit/info.json new file mode 100644 index 0000000000..ce1a7d6e16 --- /dev/null +++ b/keyboards/6lit/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "6lit", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 6, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1} + ] + }, + "LAYOUT_split": { + "key_count": 12, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1} + ] + } + } +} diff --git a/keyboards/6lit/keymaps/default/config.h b/keyboards/6lit/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/6lit/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/6lit/keymaps/default/keymap.c b/keyboards/6lit/keymaps/default/keymap.c new file mode 100644 index 0000000000..6864c72f78 --- /dev/null +++ b/keyboards/6lit/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, \ + KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/6lit/keymaps/default/readme.md b/keyboards/6lit/keymaps/default/readme.md new file mode 100644 index 0000000000..b3acc3f58a --- /dev/null +++ b/keyboards/6lit/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for 6lit diff --git a/keyboards/6lit/keymaps/macro/config.h b/keyboards/6lit/keymaps/macro/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/6lit/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/6lit/keymaps/macro/keymap.c b/keyboards/6lit/keymaps/macro/keymap.c new file mode 100644 index 0000000000..6b10ac1330 --- /dev/null +++ b/keyboards/6lit/keymaps/macro/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F19, KC_F20, KC_F21, \ + KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/6lit/keymaps/macro/readme.md b/keyboards/6lit/keymaps/macro/readme.md new file mode 100644 index 0000000000..9f883b821c --- /dev/null +++ b/keyboards/6lit/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for 6lit diff --git a/keyboards/6lit/readme.md b/keyboards/6lit/readme.md new file mode 100644 index 0000000000..d5b2100285 --- /dev/null +++ b/keyboards/6lit/readme.md @@ -0,0 +1,17 @@ +# 6lit + +![6lit](https://1.bp.blogspot.com/-Pa8RgYZ0hy8/Wbmr4bjuV0I/AAAAAAACDbI/WLKQMDlcDVAVf1lAIRMN51usR1XcCCVNgCLcBGAs/s1600/a.JPG) + +6 key macropad that fits within the 100mm x 100mm PCB size. Can be used singly as a regular 6 key macropad as well. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/6lit) + +Keyboard Maintainer: QMK Community +Hardware Supported: 6lit PCB +Hardware Availability: [6lit project on 40% Keyboards](http://www.40percent.club/2017/09/6lit.html) + +Make example for this keyboard (after setting up your build environment): + + make 6lit: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/6lit/rules.mk b/keyboards/6lit/rules.mk new file mode 100644 index 0000000000..3275651650 --- /dev/null +++ b/keyboards/6lit/rules.mk @@ -0,0 +1,83 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes -- cgit v1.2.3 From 4636f0f623c71f1eda8628cbae4784fe08a8faf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 6 Nov 2018 06:34:54 +0100 Subject: Remove ALTG(kc) as it's misleading and is not actually AltGr (#4338) * Remove ALTG(kc) as it's misleading and is not actually AltGr * Add temporary alias for ALGR in keyboards/planck/keymaps/pevecyan/keymap.c --- docs/feature_advanced_keycodes.md | 1 - docs/keycodes.md | 1 - keyboards/planck/keymaps/pevecyan/keymap.c | 2 ++ quantum/keymap_extras/keymap_slovenian.h | 30 +++++++++++++++++------------- quantum/quantum_keycodes.h | 1 - 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f2e4909d86..f9a5c39806 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -73,7 +73,6 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | diff --git a/docs/keycodes.md b/docs/keycodes.md index 6676bb53c9..e5d35b2b4a 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -333,7 +333,6 @@ This is a reference only. Each group of keys links to the page documenting their |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | |`LCAG(kc)`| |Hold Left Control, Alt and GUI and press `kc` | -|`ALTG(kc)`| |Hold Right Control and Alt and press `kc` | |`SGUI(kc)`|`SCMD(kc)`, `SWIN(kc)`|Hold Left Shift and GUI and press `kc` | |`LCA(kc)` | |Hold Left Control and Alt and press `kc` | diff --git a/keyboards/planck/keymaps/pevecyan/keymap.c b/keyboards/planck/keymaps/pevecyan/keymap.c index 4d76f09b0a..57f9f0e7f9 100644 --- a/keyboards/planck/keymaps/pevecyan/keymap.c +++ b/keyboards/planck/keymaps/pevecyan/keymap.c @@ -20,6 +20,8 @@ #include "muse.h" #include "keymap_slovenian.h" +#define ALTG(kc) ALGR(kc) // FIXME: Remove this + extern keymap_config_t keymap_config; enum planck_layers { diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index a9db17becd..f27123c2a2 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -17,8 +17,12 @@ #ifndef KEYMAP_SLOVENIAN #define KEYMAP_SLOVENIAN + #include "keymap.h" +// Alt gr +#define ALGR(kc) RALT(kc) +#define SI_ALGR KC_RALT //Swapped Z and Y #define SI_Z KC_Y @@ -90,18 +94,18 @@ #define SI_UNDS LSFT(SI_MINS) // _ // Alt Gr-ed characters -#define SI_CIRC ALTG(KC_3) // ^ -#define SI_DEG ALTG(KC_5) // ° -#define SI_GRV ALTG(KC_7) // ` -#define SI_ACCU ALTG(KC_9) // ´ -#define SI_LCBR ALTG(KC_B) // { -#define SI_RCBR ALTG(KC_N) // } -#define SI_LBRC ALTG(KC_F) // [ -#define SI_RBRC ALTG(KC_G) // ] -#define SI_BSLS ALTG(KC_Q) // backslash -#define SI_AT ALTG(KC_V) // @ -#define SI_EURO ALTG(KC_E) // € -#define SI_TILD ALTG(KC_1) // ~ -#define SI_PIPE ALTG(KC_W) // | +#define SI_CIRC ALGR(KC_3) // ^ +#define SI_DEG ALGR(KC_5) // ° +#define SI_GRV ALGR(KC_7) // ` +#define SI_ACCU ALGR(KC_9) // ´ +#define SI_LCBR ALGR(KC_B) // { +#define SI_RCBR ALGR(KC_N) // } +#define SI_LBRC ALGR(KC_F) // [ +#define SI_RBRC ALGR(KC_G) // ] +#define SI_BSLS ALGR(KC_Q) // backslash +#define SI_AT ALGR(KC_V) // @ +#define SI_EURO ALGR(KC_E) // € +#define SI_TILD ALGR(KC_1) // ~ +#define SI_PIPE ALGR(KC_W) // | #endif diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index e983798f2b..53fece21cc 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -475,7 +475,6 @@ enum quantum_keycodes { #define HYPR(kc) (QK_LCTL | QK_LSFT | QK_LALT | QK_LGUI | (kc)) #define MEH(kc) (QK_LCTL | QK_LSFT | QK_LALT | (kc)) #define LCAG(kc) (QK_LCTL | QK_LALT | QK_LGUI | (kc)) -#define ALTG(kc) (QK_RCTL | QK_RALT | (kc)) #define SGUI(kc) (QK_LGUI | QK_LSFT | (kc)) #define SCMD(kc) SGUI(kc) #define SWIN(kc) SGUI(kc) -- cgit v1.2.3 From 672926562519c1ee7370b3ef188c11525de326e5 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 5 Nov 2018 21:35:16 -0800 Subject: Clarify the Mod Tap defines in documentation (#4352) * Fix up Mod Tap settings keys * Change link names * permissive hold wordsmith Co-Authored-By: drashna * ignore mod tap wordsmithing Co-Authored-By: drashna * grammar fix Co-Authored-By: drashna * wordsmithing Co-Authored-By: drashna * word smithing Co-Authored-By: drashna --- docs/config_options.md | 9 +++--- docs/feature_advanced_keycodes.md | 62 +++++++++++++++++++++++++++++---------- 2 files changed, 52 insertions(+), 19 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index 19861c9d23..c4921c21d7 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -132,14 +132,15 @@ If you define these options you will enable the associated feature, which may in * `#define TAPPING_TOGGLE 2` * how many taps before triggering the toggle * `#define PERMISSIVE_HOLD` - * makes tap and hold keys work better for fast typers who don't want tapping term set above 500 + * makes tap and hold keys trigger the hold if another key is pressed before releasing, even if it hasn't hit the `TAPPING_TERM` * See [Permissive Hold](feature_advanced_keycodes.md#permissive-hold) for details * `#define IGNORE_MOD_TAP_INTERRUPT` - * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold - * See [Mod tap interrupt](feature_advanced_keycodes.md#mod-tap-interrupt) for details + * makes it possible to do rolling combos (zx) with keys that convert to other keys on hold, by enforcing the `TAPPING_TERM` for both keys. + * See [Mod tap interrupt](feature_advanced_keycodes.md#ignore-mod-tap-interrupt) for details * `#define TAPPING_FORCE_HOLD` * makes it possible to use a dual role key as modifier shortly after having been tapped - * See [Hold after tap](feature_advanced_keycodes.md#hold-after-tap) + * See [Hold after tap](feature_advanced_keycodes.md#tapping-force-hold) + * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out * `#define ONESHOT_TIMEOUT 300` diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index f9a5c39806..bb5cb7419b 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -170,30 +170,56 @@ As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new #define PERMISSIVE_HOLD ``` -This makes it easier for fast typists to use dual-function keys. Without this, if you let go of a held key inside the tapping term, it won't register. +This makes tap and hold keys (like Mod Tap) work better for fast typist, or for high `TAPPING_TERM` settings. -Example: (Tapping Term = 200ms) +If you press a Mod Tap key, tap another key (press and release) and then release the Mod Tap key, all within the tapping term, it will output the "tapping" function for both keys. -- SHFT_T(KC_A) Down -- KC_X Down -- KC_X Up -- SHFT_T(KC_A) Up +For Instance: + +- `SHFT_T(KC_A)` Down +- `KC_X` Down +- `KC_X` Up +- `SHFT_T(KC_A)` Up + +Normally, if you do all this within the `TAPPING_TERM` (default: 200ms) this will be registered as `ax` by the firmware and host system. With permissive hold enabled, this modifies how this is handled by considering the Mod Tap keys as a Mod if another key is tapped, and would registered as `X` (`SHIFT`+`x`). + +?> If you have `Ignore Mod Tap Interrupt` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. + +# Ignore Mod Tap Interrupt + +To enable this setting, add this to your `config.h`: + +```c +#define IGNORE_MOD_TAP_INTERRUPT +``` -With defaults, if above is typed within tapping term, this will emit `ax`. With permissive hold, if above is typed within tapping term, this will emit `X` (so, Shift+X). +Similar to Permissive Hold, this alters how the firmware processes input for fast typist. If you press a Mod Tap key, press another key, release the Mod Tap key, and then release the normal key, it would normally output the "tapping" function for both keys. This may not be desirable for rolling combo keys. -# Mod tap interrupt +Setting `Ignore Mod Tap Interrupt` requires holding both keys for the `TAPPING_TERM` to trigger the hold function (the mod). -When a dual role key used for a modifier is quickly followed by another keys, it is interpreted as held even before the tapping term elapsed. This is a problem if a key is used for example inside a rolling combo because the second key will be pressed before the first key is released. +For Instance: -For example, when trying to type the rolling combo "zx" and z being configured to send Ctrl when hold, z rapidly followed by x actually sends Ctrl-x. That's bad. +- `SHFT_T(KC_A)` Down +- `KC_X` Down +- `SHFT_T(KC_A)` Up +- `KC_X` Up -You can disable this behavior by defining `IGNORE_MOD_TAP_INTERRUPT` in `config.h`. +Normally, this would send `X` (`SHIFT`+`x`). With `Ignore Mod Tap Interrupt` enabled, holding both keys are required for the `TAPPING_TERM` to register the hold action. A quick tap will output `ax` in this case, while a hold on both will still output `X` (`SHIFT`+`x`). -Note that this only concerns modifiers and not layer switching keys. -# Hold after tap +?> __Note__: This only concerns modifiers and not layer switching keys. -When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. If you prefer to hold a modifier instead, define `TAPPING_FORCE_HOLD` in `config.h`. +?> If you have `Permissive Hold` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. + +# Tapping Force Hold + +To enable `tapping force hold`, add the following to your `config.h`: + +```c +#define TAPPING_FORCE_HOLD +``` + +When the user holds a key after tap, this repeats the tapped key rather to hold a modifier key. This allows to use auto repeat for the tapped key. Example: @@ -211,6 +237,12 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo # Retro Tapping +To enable `retro tapping`, add the following to your `config.h`: + +```c +#define RETRO_TAPPING +``` + Holding and releasing a dual function key without pressing another key will result in nothing happening. With retro tapping enabled, releasing the key without pressing another will send the original keycode even if it is outside the tapping term. -For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With `RETRO_TAPPING` defined in your `config.h`, it will send `KC_SPACE`. +For instance, holding and releasing `LT(2, KC_SPACE)` without hitting another key will result in nothing happening. With this enabled, it will send `KC_SPACE` instead. -- cgit v1.2.3 From f2101cfb6a2270345fe6235d4c36e2e0d49db528 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 5 Nov 2018 21:36:26 -0800 Subject: Update to drashna keymaps (#4365) * Consistency fixes and more eeprom defaults * Handle setting Unicode mode on eeprom reset better * Unicode EEPROM hack * Re-enable permissive hold and ignore mod tap * Set unicode input mode * More unicode stuff * more haaaaaacks * Attempted RGB Cleanup * Fix compiler issue * Add GitLab CI config for personal compiling * Add avr gcc version to GitLab CI script * Add rgblight init to matrix init --- layouts/community/ergodox/drashna/keymap.c | 2 +- layouts/community/ortho_4x12/drashna/config.h | 2 +- layouts/community/ortho_4x12/drashna/keymap.c | 52 +++++++++++++++++---------- users/drashna/.gitlab-ci.yml | 26 ++++++++++++++ users/drashna/config.h | 4 +-- users/drashna/drashna.c | 40 +++++++++++++-------- users/drashna/rgb_stuff.c | 35 +++++------------- 7 files changed, 98 insertions(+), 63 deletions(-) create mode 100644 users/drashna/.gitlab-ci.yml diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 518eaf0348..360a2d9c6d 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -40,7 +40,7 @@ bool skip_leds = false; KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ - KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_IRNY, \ + KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_SHRG, \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ KC_HOME, KC_PGUP, \ LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index b4c780cc11..f279651b63 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -18,7 +18,7 @@ #define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) // #define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) // #define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -#define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended +// #define RGB_DISABLE_WHEN_USB_SUSPENDED false // turn off effects when suspended // #define RGB_MATRIX_SKIP_FRAMES 1 // number of frames to skip when displaying animations (0 is full effect) if not defined defaults to 1 // #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 // #define EECONFIG_RGB_MATRIX (uint32_t *)16 diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 108df69315..2a9e32cc88 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -17,6 +17,10 @@ #include QMK_KEYBOARD_H #include "drashna.h" +#ifdef RGB_MATRIX_ENABLE +extern bool g_suspend_state; +#endif + #ifdef BACKLIGHT_ENABLE enum planck_keycodes { BACKLIT = NEW_SAFE_RANGE, @@ -135,6 +139,15 @@ bool music_mask_user(uint16_t keycode) { #ifdef RGB_MATRIX_ENABLE +void suspend_power_down_keymap(void) +{ + rgb_matrix_set_suspend_state(true); +} + +void suspend_wakeup_init_keymap(void) +{ + rgb_matrix_set_suspend_state(false); +} void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { rgb_led led; @@ -152,25 +165,26 @@ void rgb_matrix_indicators_user(void) { uint8_t this_mod = get_mods(); uint8_t this_led = host_keyboard_leds(); uint8_t this_osm = get_oneshot_mods(); - - switch (biton32(layer_state)) { - case _RAISE: - rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; - case _LOWER: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; - case _ADJUST: - rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; - default: - switch (biton32(default_layer_state)) { - case _QWERTY: - rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; - case _COLEMAK: - rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; - case _DVORAK: - rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; - case _WORKMAN: - rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; - } + if (!g_suspend_state) { + switch (biton32(layer_state)) { + case _RAISE: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; + case _LOWER: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; + case _ADJUST: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; + default: + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(0x00, 0xFF, 0xFF, true); break; + case _COLEMAK: + rgb_matrix_layer_helper(0xFF, 0x00, 0xFF, true); break; + case _DVORAK: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00, true); break; + case _WORKMAN: + rgb_matrix_layer_helper(0xD9, 0xA5, 0x21, true); break; + } + } } switch (biton32(default_layer_state)) { diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml new file mode 100644 index 0000000000..3c95ad8507 --- /dev/null +++ b/users/drashna/.gitlab-ci.yml @@ -0,0 +1,26 @@ +stages: + - build + +qmk_firmware: + stage: build + variables: + GIT_SUBMODULE_STRATEGY: recursive + tags: + - linux + image: ubuntu + before_script: + - apt-get update -qy + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util diffutils gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - avr-gcc --version + script: + - make iris/rev2:drashna iris/rev2:drashna_old ergodox_ez:drashna viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - ./*.hex + - ./*.bin + only: + - master + - drashna_keymaps + - merge-requests + - branches diff --git a/users/drashna/config.h b/users/drashna/config.h index 9d7d20add0..7e6a7d1c81 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -44,8 +44,8 @@ // and when this option isn't enabled, z rapidly followed by x // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT -#undef PERMISSIVE_HOLD -// #define TAPPING_FORCE_HOLD +#define PERMISSIVE_HOLD +//#define TAPPING_FORCE_HOLD //#define RETRO_TAPPING #define FORCE_NKRO diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index b2219e9aa7..4111d29314 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -20,6 +20,12 @@ along with this program. If not, see . #include "rgb_stuff.h" userspace_config_t userspace_config; +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + #define DRASHNA_UNICODE_MODE UC_WIN +#else + // set to 2 for UC_WIN, set to 4 for UC_WINC + #define DRASHNA_UNICODE_MODE 2 +#endif uint16_t copy_paste_timer; // Helper Functions @@ -154,19 +160,18 @@ void matrix_init_user(void) { userspace_config.raw = eeconfig_read_user(); -#ifdef BOOTLOADER_CATERINA - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + #ifdef BOOTLOADER_CATERINA + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); -#endif + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); + #endif -#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) - if (eeprom_read_byte(EECONFIG_UNICODEMODE) != UC_WIN) { - set_unicode_input_mode(UC_WIN); - } -#endif //UNICODE_ENABLE + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(DRASHNA_UNICODE_MODE); + get_unicode_input_mode(); + #endif //UNICODE_ENABLE matrix_init_keymap(); } @@ -266,9 +271,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { uint8_t temp_mod = get_mods(); - clear_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); - if (temp_mod & MODS_SHIFT_MASK) { + if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { #if defined(__ARM__) send_string_with_delay_P(PSTR(":dfu-util"), 10); #elif defined(BOOTLOADER_DFU) @@ -282,7 +288,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #if defined(KEYBOARD_viterbi) send_string_with_delay_P(PSTR(":dfu"), 10); #endif - if (temp_mod & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } + if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); set_mods(temp_mod); } @@ -422,4 +428,10 @@ void eeconfig_init_user(void) { userspace_config.raw = 0; userspace_config.rgb_layer_change = true; eeconfig_update_user(userspace_config.raw); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(DRASHNA_UNICODE_MODE); + get_unicode_input_mode(); + #else + eeprom_update_byte(EECONFIG_UNICODEMODE, DRASHNA_UNICODE_MODE); + #endif } diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index 9ad94c0c3d..b6de4d39e5 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -12,14 +12,6 @@ void rgblight_sethsv_default_helper(uint8_t index) { #endif // RGBLIGHT_ENABLE #ifdef INDICATOR_LIGHTS -uint8_t last_mod; -uint8_t last_led; -uint8_t last_osm; -uint8_t current_mod; -uint8_t current_led; -uint8_t current_osm; - - void set_rgb_indicators(uint8_t this_mod, uint8_t this_led, uint8_t this_osm) { if (userspace_config.rgb_layer_change && biton32(layer_state) == 0) { if (this_mod & MODS_SHIFT_MASK || this_led & (1< Date: Mon, 5 Nov 2018 21:38:18 -0800 Subject: Add EEPROM_RESET keycode to core code (#4234) * Add EEPROM Reset keycode * Add keycode to docs * Move EEPROM Reset code to the end of the enum * Cleanup and naming change --- docs/quantum_keycodes.md | 25 +++++++++++++------------ quantum/quantum.c | 5 +++++ quantum/quantum_keycodes.h | 4 ++++ 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/docs/quantum_keycodes.md b/docs/quantum_keycodes.md index 1d7fc0e127..90192e6324 100644 --- a/docs/quantum_keycodes.md +++ b/docs/quantum_keycodes.md @@ -8,15 +8,16 @@ On this page we have documented keycodes between `0x00FF` and `0xFFFF` which are ## QMK Keycodes -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | diff --git a/quantum/quantum.c b/quantum/quantum.c index 5f1a691c88..69692233eb 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -298,6 +298,11 @@ bool process_record_quantum(keyrecord_t *record) { print("DEBUG: enabled.\n"); } return false; + case EEPROM_RESET: + if (record->event.pressed) { + eeconfig_init(); + } + return false; #ifdef FAUXCLICKY_ENABLE case FC_TOG: if (record->event.pressed) { diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 53fece21cc..14f8c2b812 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -454,6 +454,8 @@ enum quantum_keycodes { TERM_OFF, #endif + EEPROM_RESET, + // always leave at the end SAFE_RANGE }; @@ -569,6 +571,8 @@ enum quantum_keycodes { #define KC_GESC GRAVE_ESC +#define EEP_RST EEPROM_RESET + #define CK_TOGG CLICKY_TOGGLE #define CK_RST CLICKY_RESET #define CK_UP CLICKY_UP -- cgit v1.2.3 From 26a201e6875e82c623c136eccf937b511199c701 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 28 Oct 2018 09:18:41 -0700 Subject: fix example to reflect caveat --- docs/feature_combo.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/feature_combo.md b/docs/feature_combo.md index 5bb73ef106..05ffc0d725 100644 --- a/docs/feature_combo.md +++ b/docs/feature_combo.md @@ -44,15 +44,15 @@ For a more complicated implementation, you can use the `process_combo_event` fun ```c enum combo_events { ZC_COPY, - ZV_PASTE + XV_PASTE }; const uint16_t PROGMEM copy_combo[] = {KC_Z, KC_C, COMBO_END}; -const uint16_t PROGMEM paste_combo[] = {KC_Z, KC_V, COMBO_END}; +const uint16_t PROGMEM paste_combo[] = {KC_X, KC_V, COMBO_END}; combo_t key_combos[COMBO_COUNT] = { [ZC_COPY] = COMBO_ACTION(copy_combo), - [ZV_PASTE] = COMBO_ACTION(paste_combo), + [XV_PASTE] = COMBO_ACTION(paste_combo), }; void process_combo_event(uint8_t combo_index, bool pressed) { @@ -66,7 +66,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } break; - case ZV_PASTE: + case XV_PASTE: if (pressed) { register_code(KC_LCTL); register_code(KC_V); @@ -78,7 +78,7 @@ void process_combo_event(uint8_t combo_index, bool pressed) { } ``` -This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit Z and V. But you could change this to do stuff like change layers, play sounds, or change settings. +This will send Ctrl+C if you hit Z and C, and Ctrl+V if you hit X and V. But you could change this to do stuff like change layers, play sounds, or change settings. ## Additional Configuration -- cgit v1.2.3 From 4a033641dff0cbf430a5005d6d6c1e5b8c4b540c Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 28 Oct 2018 09:29:18 -0700 Subject: Update Features page to reflect all of the features linked in the sidebar/summary --- docs/features.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/features.md b/docs/features.md index 537e1061cd..43d972e689 100644 --- a/docs/features.md +++ b/docs/features.md @@ -8,13 +8,17 @@ QMK has a staggering number of features for building your keyboard. It can take * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. +* [Combos](feature_combos.md) - Custom actions for multiple key holds. +* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic"). * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. +* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave. * [HD44780 LCD Display](feature_hd44780.md) - Support for LCD character displays using the HD44780 standard. * [Key Lock](feature_key_lock.md) - Lock a key in the "down" state. * [Layouts](feature_layouts.md) - Use one keymap with any keyboard that supports your layout. * [Leader Key](feature_leader_key.md) - Tap the leader key followed by a sequence to trigger custom behavior. * [Macros](feature_macros.md) - Send multiple key presses when pressing only one physical key. * [Mouse keys](feature_mouse_keys.md) - Control your mouse pointer from your keyboard. +* [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) - Sticky Keys, lets hit a key rather than holding it. * [Pointing Device](feature_pointing_device.md) - Framework for connecting your custom pointing device to your keyboard. * [PS2 Mouse](feature_ps2_mouse.md) - Driver for connecting a PS/2 mouse directly to your keyboard. * [RGB Light](feature_rgblight.md) - RGB lighting for your keyboard. -- cgit v1.2.3 From ec34b5386455a4170db97aad21dc50b77d6ddfdd Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 29 Oct 2018 15:07:38 -0700 Subject: Fixe line endings --- keyboards/qwertyydox/rules.mk | 138 +++++++++++++++++++++--------------------- 1 file changed, 69 insertions(+), 69 deletions(-) diff --git a/keyboards/qwertyydox/rules.mk b/keyboards/qwertyydox/rules.mk index d04a4b9f30..8c6171bc00 100644 --- a/keyboards/qwertyydox/rules.mk +++ b/keyboards/qwertyydox/rules.mk @@ -1,69 +1,69 @@ -# MCU name -#MCU = at90usb1287 -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -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. -SUBPROJECT_rev1 = yes -USE_I2C = yes # I2C is used between the sides -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -SPLIT_KEYBOARD = yes - -DEFAULT_FOLDER = qwertyydox/rev1 +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. +SUBPROJECT_rev1 = yes +USE_I2C = yes # I2C is used between the sides +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes + +DEFAULT_FOLDER = qwertyydox/rev1 -- cgit v1.2.3 From 40313cfa3b4a4f1643382f0446e0a889ef3e76dc Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 30 Oct 2018 18:00:43 -0700 Subject: Fix Terminal feature on ChibiOS --- common_features.mk | 1 + tmk_core/common.mk | 4 +++- tmk_core/common/print.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/common_features.mk b/common_features.mk index f44dfc47de..8f53a82aae 100644 --- a/common_features.mk +++ b/common_features.mk @@ -213,6 +213,7 @@ endif ifeq ($(strip $(TERMINAL_ENABLE)), yes) SRC += $(QUANTUM_DIR)/process_keycode/process_terminal.c OPT_DEFS += -DTERMINAL_ENABLE + OPT_DEFS += -DUSER_PRINT endif ifeq ($(strip $(USB_HID_ENABLE)), yes) diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 3844b13d48..65dcf96f66 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -43,9 +43,11 @@ ifeq ($(PLATFORM),CHIBIOS) TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE else TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c -endif + endif ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c + else ifeq($(strip $(TERMINAL_ENABLE)), yes) + TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c endif endif diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index d945276572..06c6cbd7f1 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -73,7 +73,9 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #elif defined(PROTOCOL_CHIBIOS) /* PROTOCOL_CHIBIOS */ +#ifndef TERMINAL_ENABLE # include "chibios/printf.h" +#endif # ifdef USER_PRINT /* USER_PRINT */ -- cgit v1.2.3 From 73e634482ea8f57d1f1a5f1e16bc3ffd74f84b8e Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 30 Oct 2018 18:03:46 -0700 Subject: command.h include was not set correctly --- tmk_core/common/command.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tmk_core/common/command.h b/tmk_core/common/command.h index d9d89ba0f1..c38f2b9e80 100644 --- a/tmk_core/common/command.h +++ b/tmk_core/common/command.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef COMMAND_H -#define COMMAND +#pragma once /* FIXME: Add doxygen comments for the behavioral defines in here. */ @@ -155,5 +154,3 @@ bool command_proc(uint8_t code); #define XMAGIC_KC(key) KC_##key #define MAGIC_KC(key) XMAGIC_KC(key) - -#endif -- cgit v1.2.3 From 1b3ac77fec9817aad30f8d70f063d3b1eba42403 Mon Sep 17 00:00:00 2001 From: tcatkins99 Date: Tue, 6 Nov 2018 11:06:50 -0500 Subject: mapdev's Espectro layout (#4366) * Add mapdev layout to espectro * Add mapdev layout to espectro * - Update MO Co-Authored-By: tcatkins99 --- keyboards/espectro/keymaps/mapdev/keymap.c | 88 ++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 keyboards/espectro/keymaps/mapdev/keymap.c diff --git a/keyboards/espectro/keymaps/mapdev/keymap.c b/keyboards/espectro/keymaps/mapdev/keymap.c new file mode 100644 index 0000000000..bbd791582d --- /dev/null +++ b/keyboards/espectro/keymaps/mapdev/keymap.c @@ -0,0 +1,88 @@ +/* + * 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 . + */ + + +#include QMK_KEYBOARD_H +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | END | P UP | P DOWN | DEL | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | | | | | | | | | | | | | BACK | NUM | | | | +| ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | \ | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|_____________|________|________|________| + | +| | | | | | | | | | | ; | ' | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | " | ENTER | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | , | . | / | | | | | | | +| SHIFT | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_default( + 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_VOLD, KC_VOLU, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + 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_DEL, 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_P7, KC_P8, KC_P9, KC_PPLS, + KC_LCTL, 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, + MO(_FN1), KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, _______, KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|_____________|________|________|________| | +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|____________________|________|________|________|________| +| | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | +|__________________|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_default( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, KC_END, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + -- cgit v1.2.3 From 388df5359b913eaf1ce6fb0ef624e430ad010ea5 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 6 Nov 2018 01:31:56 -0800 Subject: Fix Spacing issue in makefile that breaks Terminal config --- tmk_core/common.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 65dcf96f66..8eac1734f4 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -46,7 +46,7 @@ ifeq ($(PLATFORM),CHIBIOS) endif ifeq ($(strip $(AUTO_SHIFT_ENABLE)), yes) TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c - else ifeq($(strip $(TERMINAL_ENABLE)), yes) + else ifeq ($(strip $(TERMINAL_ENABLE)), yes) TMK_COMMON_SRC += $(CHIBIOS)/os/various/syscalls.c endif endif -- cgit v1.2.3 From 63e212c0b78be664785433c11cd728f15f50cd6a Mon Sep 17 00:00:00 2001 From: Sean Dwyer Date: Tue, 6 Nov 2018 11:54:53 -0800 Subject: Add localized LED flash effect on keypress to Massdrop ALT (#4340) --- keyboards/massdrop/alt/keymaps/reywood/keymap.c | 195 +++++++++++++++++++++ .../massdrop/alt/keymaps/reywood/rgb_matrix_user.c | 193 ++++++++++++++++++++ .../massdrop/alt/keymaps/reywood/rgb_matrix_user.h | 3 + keyboards/massdrop/alt/keymaps/reywood/rules.mk | 34 ++++ tmk_core/protocol/arm_atsam/led_matrix.c | 14 +- tmk_core/protocol/arm_atsam/led_matrix.h | 3 +- 6 files changed, 438 insertions(+), 4 deletions(-) create mode 100644 keyboards/massdrop/alt/keymaps/reywood/keymap.c create mode 100644 keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c create mode 100644 keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h create mode 100644 keyboards/massdrop/alt/keymaps/reywood/rules.mk diff --git a/keyboards/massdrop/alt/keymaps/reywood/keymap.c b/keyboards/massdrop/alt/keymaps/reywood/keymap.c new file mode 100644 index 0000000000..8b69f0e8eb --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/keymap.c @@ -0,0 +1,195 @@ +#include QMK_KEYBOARD_H +#include "rgb_matrix_user.h" + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode +#define ______ KC_TRNS + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_MUTE, \ + _______, _______, _______, KC_UP, _______, _______, _______, U_T_AUTO,U_T_AGCR,_______, KC_PSCR, KC_SLCK, KC_PAUS, _______, KC_END, \ + _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, MD_BOOT, TG_NKRO, _______, _______, _______, _______, _______, KC_VOLU, _______, \ + _______, _______, _______, KC_MPLY, MO(2), _______, KC_MRWD, KC_VOLD, KC_MFFD \ + ), + [2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + L_T_BR, L_PSD, L_BRI, L_PSI, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, L_T_MD, L_T_ONF, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + rgb_matrix_record_key_press(record); + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c new file mode 100644 index 0000000000..36131e2020 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.c @@ -0,0 +1,193 @@ +#include "quantum.h" +#include "led_matrix.h" + +extern issi3733_led_t *led_cur; +extern uint8_t led_per_run; +extern issi3733_led_t *lede; +extern issi3733_led_t led_map[]; + +static uint16_t last_boost_update; +static uint8_t led_boosts[ISSI3733_LED_COUNT]; +static uint8_t led_boost_index; +static uint8_t led_cur_index; + +#define LED_BOOST_REFRESH_INTERVAL_IN_MS 40 +#define LED_BOOST_DECAY 0.7 +#define LED_BOOST_PROPAGATE 0.5 +#define LED_BOOST_PEAK 100 + +#define MIN_RGB 0x050008 +#define MIN_R (MIN_RGB >> 16 & 0xff) +#define MIN_G (MIN_RGB >> 8 & 0xff) +#define MIN_B (MIN_RGB & 0xff) + +#define MAX_RGB 0xc26eff +#define MAX_R (MAX_RGB >> 16 & 0xff) +#define MAX_G (MAX_RGB >> 8 & 0xff) +#define MAX_B (MAX_RGB & 0xff) + +#define UNDERGLOW_RGB 0x4f002e +#define UNDERGLOW_R (UNDERGLOW_RGB >> 16 & 0xff) +#define UNDERGLOW_G (UNDERGLOW_RGB >> 8 & 0xff) +#define UNDERGLOW_B (UNDERGLOW_RGB & 0xff) + +#define UNDERGLOW_SCAN_CODE 255 + +#define max(a, b) (((a) > (b)) ? (a) : (b)) + +#define __ -1 +static const uint8_t KEY_TO_LED_MAP[MATRIX_ROWS][MATRIX_COLS] = { + { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14}, + {15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29}, + {30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, __, 42, 43}, + {44, __, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57}, + {58, 59, 60, __, __, __, 61, __, __, __, 62, 63, 64, 65, 66}, +}; + +#define KEY_LED_COUNT 67 +#define KP(c, r) { .col = c, .row = r } // shorthand for keypos_t +static const keypos_t LED_TO_KEY_MAP[KEY_LED_COUNT] = { + KP(0, 0), KP(1, 0), KP(2, 0), KP(3, 0), KP(4, 0), KP(5, 0), KP(6, 0), KP(7, 0), KP(8, 0), KP(9, 0), KP(10, 0), KP(11, 0), KP(12, 0), KP(13, 0), KP(14, 0), + KP(0, 1), KP(1, 1), KP(2, 1), KP(3, 1), KP(4, 1), KP(5, 1), KP(6, 1), KP(7, 1), KP(8, 1), KP(9, 1), KP(10, 1), KP(11, 1), KP(12, 1), KP(13, 1), KP(14, 1), + KP(0, 2), KP(1, 2), KP(2, 2), KP(3, 2), KP(4, 2), KP(5, 2), KP(6, 2), KP(7, 2), KP(8, 2), KP(9, 2), KP(10, 2), KP(11, 2), KP(13, 2), KP(14, 2), + KP(0, 3), KP(2, 3), KP(3, 3), KP(4, 3), KP(5, 3), KP(6, 3), KP(7, 3), KP(8, 3), KP(9, 3), KP(10, 3), KP(11, 3), KP(12, 3), KP(13, 3), KP(14, 3), + KP(0, 4), KP(1, 4), KP(2, 4), KP(6, 4), KP(10, 4), KP(11, 4), KP(12, 4), KP(13, 4), KP(14, 4), +}; + + +static void update_led_boosts(void); +static void update_led_cur_rgb_values(void); +static void set_nearest_led_to_max(uint8_t col, uint8_t row); +static uint8_t calculate_new_color_component_value(uint8_t max, uint8_t min); +static void calculate_new_led_boosts(uint8_t new_led_boosts[]); +static uint8_t calculate_new_led_boost_at(int index); +static uint8_t get_propagated_boost_from_neighbors(int led_position); +static uint8_t get_led_boost_at_keypos(uint8_t row, uint8_t col); +static void set_new_led_boosts(uint8_t* new_led_boosts); +static uint8_t map_key_position_to_led_index(uint8_t col, uint8_t row); + + +void rgb_matrix_init_user(void) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + led_boosts[i] = 0; + } + last_boost_update = timer_read(); + led_boost_index = 0; + led_cur_index = 0; +} + +void led_matrix_run(void) { + uint8_t led_this_run = 0; + + if (led_cur == 0) { //Denotes start of new processing cycle in the case of chunked processing + led_cur = led_map; + led_cur_index = 0; + } + update_led_boosts(); + + while (led_cur < lede && led_this_run < led_per_run) { + update_led_cur_rgb_values(); + + led_cur++; + led_cur_index++; + led_this_run++; + } +} + +void rgb_matrix_record_key_press(keyrecord_t *record) { + if (record->event.pressed) { + keypos_t key = record->event.key; + set_nearest_led_to_max(key.col, key.row); + } +} + + +static void update_led_boosts(void) { + if (timer_elapsed(last_boost_update) > LED_BOOST_REFRESH_INTERVAL_IN_MS) { + last_boost_update = timer_read(); + + uint8_t new_led_boosts[ISSI3733_LED_COUNT]; + calculate_new_led_boosts(new_led_boosts); + set_new_led_boosts(new_led_boosts); + } +} + +static void update_led_cur_rgb_values(void) { + if (led_cur->scan == UNDERGLOW_SCAN_CODE) { + *led_cur->rgb.r = UNDERGLOW_R; + *led_cur->rgb.g = UNDERGLOW_G; + *led_cur->rgb.b = UNDERGLOW_B; + } else { + *led_cur->rgb.r = calculate_new_color_component_value(MAX_R, MIN_R); + *led_cur->rgb.g = calculate_new_color_component_value(MAX_G, MIN_G); + *led_cur->rgb.b = calculate_new_color_component_value(MAX_B, MIN_B); + } +} + +static void set_nearest_led_to_max(uint8_t col, uint8_t row) { + uint8_t led_index = map_key_position_to_led_index(col, row); + if (led_index >= 0 && led_index < ISSI3733_LED_COUNT) { + led_boosts[led_index] = LED_BOOST_PEAK; + } +} + +static uint8_t calculate_new_color_component_value(uint8_t max, uint8_t min) { + uint8_t current_boost = led_boosts[led_cur_index]; + return (float)(max - min) * current_boost / LED_BOOST_PEAK + min; +} + +static void calculate_new_led_boosts(uint8_t new_led_boosts[]) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + new_led_boosts[i] = calculate_new_led_boost_at(i); + } +} + +static uint8_t calculate_new_led_boost_at(int index) { + uint8_t decayed_boost = led_boosts[index] * LED_BOOST_DECAY; + uint8_t propagated_boost = get_propagated_boost_from_neighbors(index); + uint8_t new_boost = (propagated_boost > decayed_boost) ? propagated_boost : decayed_boost; + if (new_boost > LED_BOOST_PEAK) { + new_boost = LED_BOOST_PEAK; + } + return new_boost; +} + +static uint8_t get_propagated_boost_from_neighbors(int led_position) { + if (led_position < 0 || led_position >= KEY_LED_COUNT) { + return 0; + } + keypos_t led_keypos = LED_TO_KEY_MAP[led_position]; + uint8_t top_boost = get_led_boost_at_keypos(led_keypos.row - 1, led_keypos.col); + uint8_t bottom_boost = get_led_boost_at_keypos(led_keypos.row + 1, led_keypos.col); + uint8_t left_boost = get_led_boost_at_keypos(led_keypos.row, led_keypos.col - 1); + uint8_t right_boost = get_led_boost_at_keypos(led_keypos.row, led_keypos.col + 1); + uint8_t max_boost = max(max(top_boost, bottom_boost), max(left_boost, right_boost)); + if (max_boost > LED_BOOST_PEAK) { + max_boost = LED_BOOST_PEAK; + } + return max_boost * LED_BOOST_PROPAGATE; +} + +static uint8_t get_led_boost_at_keypos(uint8_t row, uint8_t col) { + if (row < 0 || row >= MATRIX_ROWS || col < 0 || col >= MATRIX_COLS) { + return 0; + } + uint8_t led_index = KEY_TO_LED_MAP[row][col]; + if (led_index < 0) { + return 0; + } + return led_boosts[led_index]; +} + +static void set_new_led_boosts(uint8_t* new_led_boosts) { + for (int i = 0; i < ISSI3733_LED_COUNT; i++) { + led_boosts[i] = new_led_boosts[i]; + } +} + +static uint8_t map_key_position_to_led_index(uint8_t col, uint8_t row) { + if (row >= 0 && row < MATRIX_ROWS && col >= 0 && col < MATRIX_COLS) { + return KEY_TO_LED_MAP[row][col]; + } + return -1; +} diff --git a/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h new file mode 100644 index 0000000000..4ffd202e9b --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rgb_matrix_user.h @@ -0,0 +1,3 @@ +#pragma once + +void rgb_matrix_record_key_press(keyrecord_t *record); diff --git a/keyboards/massdrop/alt/keymaps/reywood/rules.mk b/keyboards/massdrop/alt/keymaps/reywood/rules.mk new file mode 100644 index 0000000000..b5b961a0f3 --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/reywood/rules.mk @@ -0,0 +1,34 @@ +# project specific files +SRC = led_programs.c +SRC += matrix.c +SRC += rgb_matrix_user.c + +#For platform and packs +ARM_ATSAM = SAMD51J18A +MCU = cortex-m4 + +CUSTOM_MATRIX = yes + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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) +VIRTSER_ENABLE = no # USB Serial Driver +RAW_ENABLE = no # Raw device +AUTO_SHIFT_ENABLE = no # Auto Shift diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 7ee1dad224..c328fdc4ce 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -257,13 +257,15 @@ issi3733_led_t *led_cur; uint8_t led_per_run = 15; float breathe_mult; -void led_matrix_run(led_setup_t *f) +__attribute__ ((weak)) +void led_matrix_run(void) { float ro; float go; float bo; float px; uint8_t led_this_run = 0; + led_setup_t *f = (led_setup_t*)led_setups[led_animation_id]; if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing { @@ -459,13 +461,19 @@ uint8_t led_matrix_init(void) //Run led matrix code once for initial LED coloring led_cur = 0; - led_matrix_run((led_setup_t*)led_setups[led_animation_id]); + rgb_matrix_init_user(); + led_matrix_run(); DBGC(DC_LED_MATRIX_INIT_COMPLETE); return 0; } +__attribute__ ((weak)) +void rgb_matrix_init_user(void) { + +} + #define LED_UPDATE_RATE 10 //ms //led data processing can take time, so process data in chunks to free up the processor @@ -502,7 +510,7 @@ void led_matrix_task(void) if (led_cur != lede) { //m15_off; //debug profiling - led_matrix_run((led_setup_t*)led_setups[led_animation_id]); + led_matrix_run(); //m15_on; //debug profiling } } diff --git a/tmk_core/protocol/arm_atsam/led_matrix.h b/tmk_core/protocol/arm_atsam/led_matrix.h index 01b078b711..3f2b9cdb86 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.h +++ b/tmk_core/protocol/arm_atsam/led_matrix.h @@ -86,6 +86,7 @@ typedef struct led_disp_s { } led_disp_t; uint8_t led_matrix_init(void); +void rgb_matrix_init_user(void); #define LED_MODE_NORMAL 0 //Must be 0 #define LED_MODE_KEYS_ONLY 1 @@ -134,7 +135,7 @@ extern void *led_setups[]; extern issi3733_led_t *led_cur; extern issi3733_led_t *lede; -void led_matrix_run(led_setup_t *f); +void led_matrix_run(void); void led_matrix_task(void); void gcr_compute(void); -- cgit v1.2.3 From f8d800583544bca258b9c10af3ba44de9764639e Mon Sep 17 00:00:00 2001 From: Monksoffunk Date: Wed, 7 Nov 2018 05:00:02 +0900 Subject: Zinc : Update to latest serial.c #4278 (#4361) * Add Zinc keyboard * Fix photo * Fix readme.md * Fix RGB LED init of monks/keymap.c * Fix default keymap and readme.jp * Fix change DEFS of RGB ANIMATIONS to LED_ANIMATIONS * Add EOL * Use serial_config_simpleapi.h * Fix comment char * Fix error handling in split_scomm.c : mtei works * Fix keymaps * Remove DISABLE_LEADER definition * Remove pro_micro.h * Add 2 spaces after Hardware name * Fix keymaps - remove audio codes - change LAYOUT to LAYOUT_ortho_4X12 - change "persistent_default_layer_set" to core function * Use the Community Layouts feature - with some clean up * Update latest serial.c #4278 --- keyboards/zinc/serial.c | 78 +++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/keyboards/zinc/serial.c b/keyboards/zinc/serial.c index 830f86b55a..325c29a3f7 100644 --- a/keyboards/zinc/serial.c +++ b/keyboards/zinc/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -65,6 +70,7 @@ #error serial.c now support ATmega32U4 only #endif +//////////////// for backward compatibility //////////////////////////////// #ifndef SERIAL_USE_MULTI_TRANSACTION /* --- USE Simple API (OLD API, compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 @@ -106,7 +112,8 @@ int serial_update_buffers() return result; } -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of Simple API (OLD API, compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) @@ -136,38 +143,68 @@ int serial_update_buffers() // 5: about 20kbps #endif -#define TID_SEND_ADJUST 2 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif #if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 6 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed #define SERIAL_DELAY 36 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #elif SELECT_SOFT_SERIAL_SPEED == 5 // Ultra Low speed #define SERIAL_DELAY 48 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else #error invalid SELECT_SOFT_SERIAL_SPEED value #endif /* SELECT_SOFT_SERIAL_SPEED */ @@ -187,16 +224,19 @@ int serial_update_buffers() static SSTD_t *Transaction_table = NULL; static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -216,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -270,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -536,7 +577,14 @@ int soft_serial_get_and_clean_status(int sstd_index) { #endif // Helix serial.c history -// 2018-1-29 fork from let's split (#2308) -// 2018-6-28 bug fix master to slave comm (#3255) -// 2018-8-11 improvements (#3608) -// 2018-10-21 fix serial and RGB animation conflict (#4191) +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) -- cgit v1.2.3 From 8f5ac39fb90e9036a9df60f286888e02daf3fd1b Mon Sep 17 00:00:00 2001 From: TheOneTrueTrench <38593283+TheOneTrueTrench@users.noreply.github.com> Date: Tue, 6 Nov 2018 20:01:18 +0000 Subject: separated all my changes into separate files, working on generalizing my relativity macros. (#4368) * Updating to my local changes. * Added auto-complete for joins. * Added lights to imply current state better --- keyboards/dz60/keymaps/marianas/customLogic.c | 138 ++++++ keyboards/dz60/keymaps/marianas/customLogic.h | 10 + keyboards/dz60/keymaps/marianas/keyDefinitions.h | 124 ++++++ keyboards/dz60/keymaps/marianas/keymap.c | 521 +---------------------- keyboards/dz60/keymaps/marianas/keymap.h | 114 +---- keyboards/dz60/keymaps/marianas/relativity.c | 510 ++++++++++++++++++++++ keyboards/dz60/keymaps/marianas/relativity.h | 32 ++ keyboards/dz60/keymaps/marianas/rules.mk | 4 + 8 files changed, 839 insertions(+), 614 deletions(-) create mode 100644 keyboards/dz60/keymaps/marianas/customLogic.c create mode 100644 keyboards/dz60/keymaps/marianas/customLogic.h create mode 100644 keyboards/dz60/keymaps/marianas/keyDefinitions.h create mode 100644 keyboards/dz60/keymaps/marianas/relativity.c create mode 100644 keyboards/dz60/keymaps/marianas/relativity.h diff --git a/keyboards/dz60/keymaps/marianas/customLogic.c b/keyboards/dz60/keymaps/marianas/customLogic.c new file mode 100644 index 0000000000..b7dbcac95b --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/customLogic.c @@ -0,0 +1,138 @@ +#include QMK_KEYBOARD_H +#include "customLogic.h" +#include "keymap.h" +#include "keyDefinitions.h" +#include "relativity.h" +#include "timer.h" + +static int16_t fnTimer = 0; + + + +uint32_t layer_state_set_user(uint32_t state) +{ + switch (biton32(state)) + { + case QWERTY: + rgblight_mode(9); + break; + case NAV_CLUSTER: + rgblight_mode(29); + break; + case GAMING: + rgblight_mode(26); + break; + case SQLMACROS: + rgblight_mode(1); + break; + case FN_LAYER: + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL+5); + break; + } + return state; +} + + + +bool printSqlVerbs(uint16_t keycode, keyrecord_t *record) +{ + if (record->event.pressed) + { + switch (keycode) + { + case S_LFTJN: + SEND_STRING("LEFT JOIN"); + activateRelativity(); + return false; + case S_INRJN: + SEND_STRING("INNER JOIN "); + activateRelativity(); + return false; + case S_SLCT: + SEND_STRING("SELECT "); return + false; + case S_FROM: + SEND_STRING("FROM "); return + false; + case S_DSNCT: + SEND_STRING("DISTINCT "); return + false; + case S_ORDER: + SEND_STRING("ORDER BY "); return + false; + case S_WHERE: + SEND_STRING("WHERE "); return + false; + case S_ALTER: + SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = SUPPLY;"); return false; + case S_ASTRK: + SEND_STRING("* "); return false; + + } + } + return true; +} + + +bool isFn = false; +bool didFn = false; + + +bool updateLayerState(uint16_t keycode, keyrecord_t *record) +{ + + if (record->event.pressed) + { + switch (keycode) + { + case FN_QT: + fnTimer = timer_read(); + layer_on(FN_LAYER); + isFn = true; + return false; + } + if (isFn) + { + didFn = true; + return true; + } + } + else + { + switch(keycode) + { + case FN_QT: + layer_off(FN_LAYER); + if (!didFn) + { + #if fnTimeout + if (TIMER_DIFF_16(timer_read(), fnTimer) <= fnTimeout) + { + activateRelativity(); + } + else + { + deactivateRelativity(); + } + #else + activateRelativity(); + #endif + } + didFn = false; + isFn = false; + return false; + } + } + return true; +} + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + return + storeShiftState(keycode, record) && + printSqlVerbs(keycode, record) && + updateLayerState(keycode, record) && + handleSmartMacros(keycode, record); +} diff --git a/keyboards/dz60/keymaps/marianas/customLogic.h b/keyboards/dz60/keymaps/marianas/customLogic.h new file mode 100644 index 0000000000..f0e6ecdcac --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/customLogic.h @@ -0,0 +1,10 @@ +#define fnTimeout 500 + + +uint32_t layer_state_set_user(uint32_t state); + +bool printSqlVerbs(uint16_t keycode, keyrecord_t *record); + +bool updateLayerState(uint16_t keycode, keyrecord_t *record); + +bool process_record_user(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/keyDefinitions.h b/keyboards/dz60/keymaps/marianas/keyDefinitions.h new file mode 100644 index 0000000000..010ace7694 --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/keyDefinitions.h @@ -0,0 +1,124 @@ + +//Control +#define MO_FNLR MO(FN_LAYER) +#define BACKSPC KC_BSPC +#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT) +#define ESCAP KC_ESC +#define PSCR KC_PSCREEN +#define SCRL KC_SCROLLLOCK +#define PAUS KC_PAUSE +#define NSRT KC_INSERT +#define HOME KC_HOME +#define PGUP KC_PGUP +#define PGDN KC_PGDN +#define END_ KC_END +#define DELT KC_DELETE +#define UPUP KC_UP +#define D_WN KC_DOWN +#define LEFT KC_LEFT +#define RGHT KC_RIGHT + +//KEYPAD +#define KP_1 KC_KP_1 +#define KP_2 KC_KP_2 +#define KP_3 KC_KP_3 +#define KP_4 KC_KP_4 +#define KP_5 KC_KP_5 +#define KP_6 KC_KP_6 +#define KP_7 KC_KP_7 +#define KP_8 KC_KP_8 +#define KP_9 KC_KP_9 +#define KP_0 KC_KP_0 +#define NMLK KC_NUMLOCK +#define STAR KC_KP_ASTERISK +#define KSSH KC_KP_SLASH +#define KMIN KC_KP_MINUS +#define PLUS KC_KP_PLUS +#define KNTR KC_KP_ENTER +#define KDOT KC_KP_DOT + +//Modifiers +#define CTLL KC_LCTL +#define LEFTSHFT KC_LSPO +#define WINL KC_LGUI +#define ALTL KC_LALT +#define CTLR KC_RCTL +#define RIGHT_SHIFT__PAREN KC_RSPC +#define WINR KC_RGUI +#define ALTR KC_RALT +#define APPR KC_APP + + +//Punctuation +#define CMMA KC_COMM +#define PRRD KC_DOT +#define SLSH KC_SLSH +#define QUOT KC_QUOT +#define COLN KC_SCLN +#define LBRC KC_LBRC +#define RBRC KC_RBRC +#define EQUL KC_EQL +#define MNUS KC_MINS +#define BSLASH KC_BSLS + +//Layers +#define QWRTY TO(QWERTY) +#define NAVS TO(NAV_CLUSTER) +#define GAME TO(GAMING) + +//Space +#define ____ KC_TRNS +#define _____ KC_TRNS +#define ______ KC_TRNS +#define _______ KC_TRNS +#define ________ KC_TRNS +#define ___________ KC_TRNS +#define _________________ KC_TRNS +#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC +#define KCNO KC_NO + +enum sql_macros { + S_LFTJN = SAFE_RANGE, // L + S_INRJN, // I + S_SLCT, // S + S_FROM, // F + S_DSNCT, // D + S_ORDER, // O + S_WHERE, // W + S_ALTER, // Esc + S_ASTRK, // * + + TD_A, + TD_B, + TD_C, // Corp, Corporation, Company + TD_D, // Distribution, Dist, Distributor + TD_E, + TD_F, + TD_G, // GlobalLookup + TD_H, + TD_I, // Instance, Item + TD_J, + TD_K, + TD_L, + TD_M, + TD_N, // NadRate + TD_O, + TD_P, // Product, Person, + TD_Q, // Darden + TD_R, + TD_S, // Supplier, Step + TD_T, // Task, Type + TD_U, + TD_V, + TD_W, // Workflow, + TD_X, + TD_Y, + TD_Z, + TD_BSPC, + TD_ENT, + TD_ESC, + + FN_QT +}; + +bool isShifted(void); diff --git a/keyboards/dz60/keymaps/marianas/keymap.c b/keyboards/dz60/keymaps/marianas/keymap.c index e40bc6897b..f86074b9c2 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.c +++ b/keyboards/dz60/keymaps/marianas/keymap.c @@ -1,505 +1,10 @@ #include QMK_KEYBOARD_H #include "keymap.h" +#include "relativity.h" +#include "keyDefinitions.h" +#include "customLogic.h" -enum marianas_layers { - QWERTY, -/* - COLEMAK, - DVORAK, -*/ - NAV_CLUSTER, - GAMING, - SQLMACROS, - SQLNAMES, - FN_LAYER -}; - -enum sql_macros { - S_LFTJN = SAFE_RANGE, // L - S_INRJN, // I - S_SLCT, // S - S_FROM, // F - S_DSNCT, // D - S_ORDER, // O - S_WHERE, // W - S_ALTER, // Esc - S_ASTRK, // * - - TD_A, - TD_B, - TD_C, // Corp, Corporation, Company - TD_D, // Distribution, Dist, Distributor - TD_E, - TD_F, - TD_G, // GlobalLookup - TD_H, - TD_I, // Instance, Item - TD_J, - TD_K, - TD_L, - TD_M, - TD_N, // NadRate - TD_O, - TD_P, // Product, Person, - TD_Q, // Darden - TD_R, - TD_S, // Supplier, Step - TD_T, // Task, Type - TD_U, - TD_V, - TD_W, // Workflow, - TD_X, - TD_Y, - TD_Z, - TD_BSPC, - TD_ENT, - TD_ESC -}; - -uint16_t *macroTaps = 0; - -char *tableNameList = 0; - -uint8_t *charCount = 0; -uint8_t countPointer = 0; - -bool shifted = false; - -bool sendAbbr = false; - - -void initStringData(void) -{ - if (macroTaps == 0) - { - macroTaps = malloc(macroTapsLen*sizeof(uint16_t)); - for(int i = 0; i < macroTapsLen; i++) - { - macroTaps[i] = 0; - } - } - if (tableNameList == 0) - { - tableNameList = malloc(tableNameListLen*sizeof(char)); - for(int i = 0; i < tableNameListLen; i++) - { - tableNameList[i] = 0; - } - } - if (charCount == 0) - { - charCount = malloc(charCountLen*sizeof(uint8_t)); - for (int i = 0; i < charCountLen; i++) - { - charCount[i] = 0; - } - } -} - - -uint32_t layer_state_set_user(uint32_t state) -{ - switch (biton32(state)) - { - case QWERTY: - rgblight_mode(9); - break; - case NAV_CLUSTER: - rgblight_mode(29); - break; - case GAMING: - rgblight_mode(26); - break; - case SQLMACROS: - rgblight_mode(1); - rgblight_setrgb(0x00, 0xFF, 0x80); - break; - case SQLNAMES: - rgblight_mode(1); - rgblight_setrgb(0x80, 0xFF, 0x00); - break; - case FN_LAYER: - rgblight_mode(1); - rgblight_setrgb(0x00, 0x80, 0xFF); - break; - } - return state; -} - -bool containsCode(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc) return true; - } - return false; -} - -bool lastCodeIs(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true; - } - return false; -} - -bool last2CodeAre(uint16_t kc) -{ - for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true; - } - return false; -} - -bool last2CodesAre(uint16_t kc, uint16_t kc2) -{ - for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) - { - if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true; - } - return false; -} - -void addKeyCode(uint16_t kc) -{ - int i = 0; - while (i < macroTapsLen-2 && macroTaps[i] > 0) i++; - if (macroTaps[i] == 0) - { - macroTaps[i] = kc; - macroTaps[i+1] = 0; - } -} - -void eraseKeyCodes(void) -{ - int i = 0; - while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0; -} - -void eraseCharCounts(void) -{ - int i = 0; - while (i < charCountLen) - { - charCount[i] = 0; - } -} - -void printTableAbbreviation(void) -{ - initStringData(); - if (tableNameList[0] == 0) - { - return; - } - send_char(0x20); - int i = 0; - for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - { - if (tableNameList[i] >= 65 && tableNameList[i] <= 90) - { - send_char(tableNameList[i]+32); - } - else - { - send_char(tableNameList[i]); - } - } - send_char(0x20); -} - -void eraseTableAbbreviation(void) -{ - initStringData(); - for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - { - tableNameList[i] = '\0'; - } -} - -void printString(char* str) -{ - - if (str[0] != '\0') - { - int i = 0; - while (true) - { - if (str[i] == 0) - { - break; - } - send_char(str[i++]); - charCount[countPointer]++; - } - } -} - -void printStringAndQueueChar(char* str) -{ - initStringData(); - if (charCount[countPointer] != 0) - { - countPointer++; - } - sendAbbr = true; - if (str[0] != '\0') - { - printString(str); - - for (int i = 0; i < tableNameListLen-1; i++) - { - if (tableNameList[i] == '\0') - { - tableNameList[i] = str[0]; - tableNameList[i+1] = '\0'; - break; - } - else if (i == tableNameListLen-2) - { - printTableAbbreviation(); - break; - } - } - //for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) - //{ - // send_char(tableNameList[i]); - //} - //send_string_P("Darden"); - //send_string_P(&myarray); - //send_string_P(str); - } -} - -void ReplaceString(char *orig, char *repl) -{ - int i = 0; - while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i]) - i++; - - if(orig[i] != 0x0) - { - int o = i; - while (orig[o++] != 0x0) { - charCount[countPointer]--; - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - } - printString(repl+i); -} - -void deletePrev(void) -{ - for (int i = 0; i < charCount[countPointer]; i++) - { - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - charCount[countPointer] = 0; - countPointer--; - int i = 1; - for (;i < tableNameListLen-1; i++) - { - if (tableNameList[i] == 0x0) - { - break; - } - } - tableNameList[i-1] = 0x0; -} - -void processSmartMacroTap(uint16_t kc) -{ - initStringData(); - switch(kc) - { - case TD_C: - if (containsCode(TD_D)) - { - printString("ribution"); - printStringAndQueueChar("Center"); - } - else if (last2CodeAre(TD_C)) - { - ReplaceString("Corporation", "Contact"); - } - else if(lastCodeIs(TD_C)) - { - printString("oration"); - } - else - { - printStringAndQueueChar("Corp"); - } - break; - case TD_D: - if (last2CodeAre(TD_D)) - { - ReplaceString("Distribution", "Distributor"); - } - else if(lastCodeIs(TD_D)) - { - printString("ribution"); - } - else - { - printStringAndQueueChar("Dist"); - } - break; - case TD_G: - printStringAndQueueChar("Global"); - printStringAndQueueChar("Lookup"); - break; - case TD_I: - if (containsCode(TD_W)) - printStringAndQueueChar("Instance"); - else - printStringAndQueueChar("Item"); - break; - case TD_N: - printStringAndQueueChar("NadRate"); - break; - case TD_P: - if (last2CodesAre(TD_D, TD_C)) - { - ReplaceString("DistributionCenter", "DistCenter"); - printStringAndQueueChar("Pricing"); - } - else if (last2CodeAre(TD_P)) - { - } - else if(lastCodeIs(TD_P)) - { - ReplaceString("Product", "Person"); - } - else - { - printStringAndQueueChar("Product"); - } - break; - case TD_Q: - printStringAndQueueChar("Darden"); - break; - case TD_S: - if (containsCode(TD_W)) - if (containsCode(TD_S) || containsCode(TD_D)) - printStringAndQueueChar("Step"); - else - printStringAndQueueChar("Session"); - else - printStringAndQueueChar("Supplier"); - break; - case TD_T: - if (containsCode(TD_W)) - printStringAndQueueChar("Task"); - else - printStringAndQueueChar("Type"); - break; - case TD_W: - printStringAndQueueChar("Workflow"); - break; - } - addKeyCode(kc); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - if (record->event.pressed) - { - switch (keycode) - { - case KC_LSPO: - case KC_RSPC: - shifted = true; - return true; - - case S_LFTJN: SEND_STRING("LEFT JOIN"); return false; - case S_INRJN: SEND_STRING("INNER JOIN "); return false; - case S_SLCT: SEND_STRING("SELECT "); return false; - case S_FROM: SEND_STRING("FROM "); return false; - case S_DSNCT: SEND_STRING("DISTINCT "); return false; - case S_ORDER: SEND_STRING("ORDER "); return false; - case S_WHERE: SEND_STRING("WHERE "); return false; - case S_ALTER: SEND_STRING("ALTER SESSION SET CURRENT_SCHEMA = "); return false; - case S_ASTRK: SEND_STRING("* "); return false; - - case KC_BSLS: - initStringData(); - layer_on(SQLNAMES); - return false; - - case TD_BSPC: - if (!shifted){ - deletePrev(); - } - else { - register_code(KC_BSPC); - unregister_code(KC_BSPC); - } - return false; - - case TD_A: - case TD_B: - case TD_C: - case TD_D: - case TD_E: - case TD_F: - case TD_G: - case TD_H: - case TD_I: - case TD_J: - case TD_K: - case TD_L: - case TD_M: - case TD_N: - case TD_O: - case TD_P: - case TD_Q: - case TD_R: - case TD_S: - case TD_T: - case TD_U: - case TD_V: - case TD_W: - case TD_X: - case TD_Y: - case TD_Z: - processSmartMacroTap(keycode); - return false; - - case TD_ENT: - printTableAbbreviation(); - case TD_ESC: - eraseKeyCodes(); - eraseTableAbbreviation(); - layer_off(SQLNAMES); - return true; - } - } - else - { - switch (keycode) - { - - case KC_BSLS: - if (macroTaps[0] == 0) - { - SEND_STRING("\\"); - layer_off(SQLNAMES); - } - return true; - case KC_LSPO: - case KC_RSPC: - shifted = false; - return true; - } - } - return true; -}; +// planned change: store previous table names and abbreviations to allow scrolling for inner joins on table name+id and abbreviation+id. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -507,7 +12,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_ansi( ESCAP, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, MNUS, EQUL, BACKSPC, KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, LBRC, RBRC, BSLASH, - MO_FNLR, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL, + FN_QT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, COLN, QUOT, ENTER_OR_SQL, LEFTSHFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, CMMA, PRRD, SLSH, RIGHT_SHIFT__PAREN, CTLL, WINL, ALTL, SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE, ALTR, WINR, APPR, CTLR), @@ -531,23 +36,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_60_ansi( S_ALTER, ____, ____, ____, ____, ____, ____, ____, S_ASTRK, ____, ____, ____, ____, ___________, ______, ____, S_WHERE, ____, ____, ____, ____, ____, S_INRJN, S_ORDER, ____, ____, ____, ______, - _______, KC_LBRC, S_SLCT, KC_PAST,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________, - ________, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, _________________, + _______, KC_LBRC, S_SLCT, S_ASTRK ,S_FROM, ____, ____, ____, ____, S_LFTJN, ____, RBRC, ___________, + ________, RGB_VAI, RGB_VAD, ____, ____, ____, ____, ____, ____, ____, ____, _________________, ____, ____, ____, /*------------------*/_____/*------------------*/, ____, ____, ____, ____), - [SQLNAMES]= - LAYOUT_60_ansi( - TD_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, TD_BSPC, - ________, TD_Q, TD_W, TD_E, TD_R, TD_T, TD_Y, TD_U, TD_I, TD_O, TD_P, ____, ____, _____, - ___________, TD_A, TD_S, TD_D, TD_F, TD_G, TD_H, TD_J, TD_K, TD_L, ____, ____, TD_ENT, - ___________, TD_Z, TD_X, TD_C, TD_V, TD_B, TD_N, TD_M, ____, ____, ____, _________________, - ____, ____, ____, /*----------------------*/TD_ENT/*-----------------------*/, ____, ____, ____, RESET), - [FN_LAYER]= LAYOUT_60_ansi( KC_GRV, 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_DEL, KC_CAPSLOCK, KC_MPRV, KC_MPLY, KC_MNXT, LWIN(KC_R), ____, KC_CALC, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, KC_SLCK, KC_BRK, ____, ____, KC_VOLD, KC_MUTE, KC_VOLU, ____, ____, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_INS, KC_DEL, ____, - ____, ____, ____, ____, ____, ____, KC_END, ____, QWRTY, NAVS, GAME, ____, - ____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, ____) + ____, RGB_HUI, RGB_SAI, RGB_SAD, ____, ____, KC_END, QWRTY, GAME, NAVS, ____, ____, + ____, ____, ____, _________________, ____, KC_HYPR, KC_MEH, RESET) }; diff --git a/keyboards/dz60/keymaps/marianas/keymap.h b/keyboards/dz60/keymaps/marianas/keymap.h index 00e51cea2c..bb1ea68c77 100644 --- a/keyboards/dz60/keymaps/marianas/keymap.h +++ b/keyboards/dz60/keymaps/marianas/keymap.h @@ -1,105 +1,15 @@ -#include "quantum.h" +#include QMK_KEYBOARD_H -//Control -#define MO_FNLR MO(FN_LAYER) -#define BACKSPC KC_BSPC -#define ENTER_OR_SQL LT(SQLMACROS,KC_ENT) -#define ESCAP KC_ESC -#define PSCR KC_PSCREEN -#define SCRL KC_SCROLLLOCK -#define PAUS KC_PAUSE -#define NSRT KC_INSERT -#define HOME KC_HOME -#define PGUP KC_PGUP -#define PGDN KC_PGDN -#define END_ KC_END -#define DELT KC_DELETE -#define UPUP KC_UP -#define D_WN KC_DOWN -#define LEFT KC_LEFT -#define RGHT KC_RIGHT -//KEYPAD -#define KP_1 KC_KP_1 -#define KP_2 KC_KP_2 -#define KP_3 KC_KP_3 -#define KP_4 KC_KP_4 -#define KP_5 KC_KP_5 -#define KP_6 KC_KP_6 -#define KP_7 KC_KP_7 -#define KP_8 KC_KP_8 -#define KP_9 KC_KP_9 -#define KP_0 KC_KP_0 -#define NMLK KC_NUMLOCK -#define STAR KC_KP_ASTERISK -#define KSSH KC_KP_SLASH -#define KMIN KC_KP_MINUS -#define PLUS KC_KP_PLUS -#define KNTR KC_KP_ENTER -#define KDOT KC_KP_DOT +enum marianas_layers { + QWERTY, +/* + COLEMAK, + DVORAK, +*/ + NAV_CLUSTER, + GAMING, + SQLMACROS, + FN_LAYER +}; -//Modifiers -#define CTLL KC_LCTL -#define LEFTSHFT KC_LSPO -#define WINL KC_LGUI -#define ALTL KC_LALT -#define CTLR KC_RCTL -#define RIGHT_SHIFT__PAREN KC_RSPC -#define WINR KC_RGUI -#define ALTR KC_RALT -#define APPR KC_APP - - -//Punctuation -#define CMMA KC_COMM -#define PRRD KC_DOT -#define SLSH KC_SLSH -#define QUOT KC_QUOT -#define COLN KC_SCLN -#define LBRC KC_LBRC -#define RBRC KC_RBRC -#define EQUL KC_EQL -#define MNUS KC_MINS -#define BSLASH KC_BSLS - -//Layers -#define QWRTY TO(QWERTY) -#define NAVS TO(NAV_CLUSTER) -#define GAME TO(GAMING) - -//Space -#define ____ KC_TRNS -#define _____ KC_TRNS -#define ______ KC_TRNS -#define _______ KC_TRNS -#define ________ KC_TRNS -#define ___________ KC_TRNS -#define _________________ KC_TRNS -#define SPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACE KC_SPC -#define KCNO KC_NO - - - - - -#define macroTapsLen 32 -#define tableNameListLen 32 -#define charCountLen 32 - -void initStringData(void); -uint32_t layer_state_set_user(uint32_t state); -bool containsCode(uint16_t kc); -bool lastCodeIs(uint16_t kc); -bool last2CodeAre(uint16_t kc); -bool last2CodesAre(uint16_t kc, uint16_t kc2); -void addKeyCode(uint16_t kc); -void eraseKeyCodes(void); -void eraseCharCounts(void); -void printTableAbbreviation(void); -void eraseTableAbbreviation(void); -void printString(char* str); -void printStringAndQueueChar(char* str); -void ReplaceString(char *orig, char *repl); -void deletePrev(void); -void processSmartMacroTap(uint16_t kc); -bool process_record_user(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/relativity.c b/keyboards/dz60/keymaps/marianas/relativity.c new file mode 100644 index 0000000000..96a5eb4e6f --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/relativity.c @@ -0,0 +1,510 @@ +#include "relativity.h" +#include "keymap.h" +#include "keyDefinitions.h" + + +uint16_t *macroTaps = 0; + +char *tableNameList = 0; + +uint8_t *charCount = 0; +uint8_t countPointer = 0; + +bool relativityActive = false; + + +bool sendAbbr = false; + + +static int16_t relativityTimer = 0; + + +bool tempOff = false; + + + + +void initStringData() +{ + if (macroTaps == 0) + { + macroTaps = malloc(macroTapsLen*sizeof(uint16_t)); + for(int i = 0; i < macroTapsLen; i++) + { + macroTaps[i] = 0; + } + } + if (tableNameList == 0) + { + tableNameList = malloc(tableNameListLen*sizeof(char)); + for(int i = 0; i < tableNameListLen; i++) + { + tableNameList[i] = 0; + } + } + if (charCount == 0) + { + charCount = malloc(charCountLen*sizeof(uint8_t)); + for (int i = 0; i < charCountLen; i++) + { + charCount[i] = 0; + } + } +} + +void activateRelativity(void) +{ + initStringData(); + rgblight_mode(RGBLIGHT_MODE_KNIGHT); + relativityTimer = timer_read(); + relativityActive = true; +} + +bool deactivateRelativity(void) +{ + rgblight_mode(9); + eraseKeyCodes(); + eraseTableAbbreviation(); + eraseCharCounts(); + relativityActive = false; + tempOff = false; + return false; +} + +bool containsCode(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc) return true; + } + return false; +} + +bool lastCodeIs(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-1 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == 0) return true; + } + return false; +} + +bool last2CodeAre(uint16_t kc) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc && macroTaps[i+2] == 0) return true; + } + return false; +} + +bool last2CodesAre(uint16_t kc, uint16_t kc2) +{ + for (int i = 0; i < macroTapsLen-2 && macroTaps[i] > 0; i++) + { + if (macroTaps[i] == kc && macroTaps[i+1] == kc2 && macroTaps[i+2] == 0) return true; + } + return false; +} + +void addKeyCode(uint16_t kc) +{ + int i = 0; + while (i < macroTapsLen-2 && macroTaps[i] > 0) i++; + if (macroTaps[i] == 0) + { + macroTaps[i] = kc; + macroTaps[i+1] = 0; + } +} + +void eraseKeyCodes(void) +{ + int i = 0; + while (i < macroTapsLen && macroTaps[i] > 0) macroTaps[i++] = 0; +} + +void eraseCharCounts(void) +{ + while (countPointer > 0) + { + charCount[countPointer] = 0; + countPointer--; + } + charCount[countPointer] = 0; +} + +void printTableAbbreviationLimited(void) +{ + if (tableNameList[0] == 0) + { + return; + } + int i = 0; + for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + if (tableNameList[i] >= 65 && tableNameList[i] <= 90) + { + send_char(tableNameList[i]+32); + } + else + { + send_char(tableNameList[i]); + } + } +} + +void printTableAbbreviation(void) +{ + if (tableNameList[0] == 0) + { + return; + } + send_char(0x20); + int i = 0; + for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + if (tableNameList[i] >= 65 && tableNameList[i] <= 90) + { + send_char(tableNameList[i]+32); + } + else + { + send_char(tableNameList[i]); + } + } + send_char(0x20); +} + +void eraseTableAbbreviation(void) +{ + for (int i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + { + tableNameList[i] = '\0'; + } +} + +void printString(char* str) +{ + + if (str[0] != '\0') + { + int i = 0; + while (true) + { + if (str[i] == 0) + { + break; + } + send_char(str[i++]); + charCount[countPointer]++; + } + } +} + +void printStringAndQueueChar(char* str) +{ + if (charCount[countPointer] > 0 && countPointer < charCountLen) + { + countPointer++; + } + sendAbbr = true; + if (str[0] != '\0') + { + printString(str); + + for (int i = 0; i < tableNameListLen-1; i++) + { + if (tableNameList[i] == '\0') + { + tableNameList[i] = str[0]; + tableNameList[i+1] = '\0'; + break; + } + else if (i == tableNameListLen-2) + { + printTableAbbreviation(); + break; + } + } + //for (i = 0; i < tableNameListLen && tableNameList[i] > 0; i++) + //{ + // send_char(tableNameList[i]); + //} + //send_string_P("Darden"); + //send_string_P(&myarray); + //send_string_P(str); + } +} + +void ReplaceString(char *orig, char *repl) +{ + int i = 0; + while((orig[i] != 0x0 && repl[i] != 0x0) && orig[i] == repl[i]) + i++; + + if(orig[i] != 0x0) + { + int o = i; + while (orig[o++] != 0x0) { + charCount[countPointer]--; + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + } + printString(repl+i); +} + +void deletePrev(void) +{ + if (countPointer == 0 && charCount[countPointer] == 0) + return; + for (int i = 0; i < charCount[countPointer]; i++) + { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + charCount[countPointer] = 0; + int i = 1; + for (;i < tableNameListLen-1; i++) + { + if (tableNameList[i] == 0x0) + { + break; + } + } + tableNameList[i-1] = 0x0; + if (countPointer > 0) + { + countPointer--; + } +} + +bool processSmartMacroTap(uint16_t kc) +{ + if (relativityTimer > 0 && TIMER_DIFF_16(timer_read(), relativityTimer) >= relTimeout) + { + deactivateRelativity(); + return true; + } + relativityTimer = 0; + switch(kc) + { + case KC_C: + if (containsCode(KC_D)) + { + printString("ribution"); + printStringAndQueueChar("Center"); + } + else if (last2CodeAre(KC_C)) + { + ReplaceString("Corporation", "Contact"); + } + else if(lastCodeIs(KC_C)) + { + printString("oration"); + } + else + { + printStringAndQueueChar("Corp"); + } + break; + case KC_D: + if (last2CodeAre(KC_D)) + { + ReplaceString("Distribution", "Distributor"); + } + else if(lastCodeIs(KC_D)) + { + printString("ribution"); + } + else + { + printStringAndQueueChar("Dist"); + } + break; + case KC_G: + printStringAndQueueChar("Global"); + printStringAndQueueChar("Lookup"); + break; + case KC_I: + if (containsCode(KC_W)) + printStringAndQueueChar("Instance"); + else + printStringAndQueueChar("Item"); + break; + case KC_N: + printStringAndQueueChar("NadRate"); + break; + case KC_P: + if (last2CodesAre(KC_D, KC_C)) + { + ReplaceString("DistributionCenter", "DistCenter"); + printStringAndQueueChar("Pricing"); + } + else if (last2CodeAre(KC_P)) + { + } + else if(lastCodeIs(KC_P)) + { + ReplaceString("Product", "Person"); + } + else + { + printStringAndQueueChar("Product"); + } + break; + case KC_Q: + printStringAndQueueChar("Darden"); + break; + case KC_S: + if (containsCode(KC_W)) + if (containsCode(KC_S) || containsCode(KC_D)) + printStringAndQueueChar("Step"); + else + printStringAndQueueChar("Session"); + else + printStringAndQueueChar("Supplier"); + break; + case KC_T: + if (containsCode(KC_W)) + printStringAndQueueChar("Task"); + else + printStringAndQueueChar("Type"); + break; + case KC_W: + printStringAndQueueChar("Workflow"); + break; + } + addKeyCode(kc); + return false; +} + + +bool shifted = false; +bool isShifted() +{ + return shifted; +} + +void setShifted(bool val) +{ + shifted = val; +} + + +bool storeShiftState(uint16_t keycode, keyrecord_t *record) +{ + + if (record->event.pressed) + { + switch (keycode) + { + case KC_LSPO: + case KC_RSPC: + shifted = true; + } + } + else + { + switch (keycode) + { + + case KC_LSPO: + case KC_RSPC: + shifted = false; + return true; + } + } + return true; +} + +bool handleSmartMacros(uint16_t keycode, keyrecord_t *record) +{ + if (relativityActive != true) return true; + if (record->event.pressed) + { + switch (keycode) + { + case KC_BSPC: + if (!isShifted()){ + deletePrev(); + } + else { + register_code(KC_BSPC); + unregister_code(KC_BSPC); + } + return false; + case KC_A: + case KC_B: + case KC_C: + case KC_D: + case KC_E: + case KC_F: + case KC_G: + case KC_H: + case KC_I: + case KC_J: + case KC_K: + case KC_L: + case KC_M: + case KC_N: + case KC_O: + case KC_P: + case KC_Q: + case KC_R: + case KC_S: + case KC_T: + case KC_U: + case KC_V: + case KC_W: + case KC_X: + case KC_Y: + case KC_Z: + return processSmartMacroTap(keycode); + + case PRRD: + if (tempOff) + { + SEND_STRING("Id = "); + printTableAbbreviationLimited(); + SEND_STRING(".Id"); + return deactivateRelativity(); + } + else + { + printTableAbbreviation(); + SEND_STRING("ON "); + printTableAbbreviationLimited(); + eraseKeyCodes(); + eraseTableAbbreviation(); + eraseCharCounts(); + tempOff = true; + return true; + } + + + case KC_SPC: + printTableAbbreviation(); + return deactivateRelativity(); + case ENTER_OR_SQL: + if (tempOff) + { + SEND_STRING("Id = "); + printTableAbbreviationLimited(); + SEND_STRING(".Id"); + deactivateRelativity(); + return true; + } + else + { + printTableAbbreviation(); + deactivateRelativity(); + return true; + } + case KC_ESC: + return deactivateRelativity(); + } + } + return true; +} diff --git a/keyboards/dz60/keymaps/marianas/relativity.h b/keyboards/dz60/keymaps/marianas/relativity.h new file mode 100644 index 0000000000..c917b1a4dc --- /dev/null +++ b/keyboards/dz60/keymaps/marianas/relativity.h @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H +#define macroTapsLen 32 +#define tableNameListLen 32 +#define charCountLen 32 + +#define relTimeout 1500 + + +void activateRelativity(void); +bool deactivateRelativity(void); +void initStringData(void); +bool containsCode(uint16_t kc); +bool lastCodeIs(uint16_t kc); +bool last2CodeAre(uint16_t kc); +bool last2CodesAre(uint16_t kc, uint16_t kc2); +void addKeyCode(uint16_t kc); +void eraseKeyCodes(void); +void eraseCharCounts(void); +void printTableAbbreviation(void); +void eraseTableAbbreviation(void); +void printString(char* str); +void printStringAndQueueChar(char* str); +void ReplaceString(char *orig, char *repl); +void deletePrev(void); +bool processSmartMacroTap(uint16_t kc); +bool isShifted(void); +void setShifted(bool); + + + +bool handleSmartMacros(uint16_t keycode, keyrecord_t *record); +bool storeShiftState(uint16_t keycode, keyrecord_t *record); diff --git a/keyboards/dz60/keymaps/marianas/rules.mk b/keyboards/dz60/keymaps/marianas/rules.mk index ab188f3b2c..230d194ab8 100644 --- a/keyboards/dz60/keymaps/marianas/rules.mk +++ b/keyboards/dz60/keymaps/marianas/rules.mk @@ -15,3 +15,7 @@ AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = no AUTO_SHIFT_ENABLE = no + + +SRC += relativity.c +SRC += customLogic.c -- cgit v1.2.3 From a91f439aec39ec8bbcbb2f579a9434c266f09f5c Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Wed, 7 Nov 2018 05:02:30 +0900 Subject: Helix-serial.c configuration improvement (#4370) The new simple API can be selected. Previous version, can select two way. * use old API (compatible with let's split serial.c) * use new API (multi-type transaction) This version, can select three way. * use old API (compatible with let's split serial.c) * use new API (single-type transaction) * use new API (multi-type transaction) There is no change in the code generated by this change. --- keyboards/helix/serial.c | 6 +++--- keyboards/helix/serial.h | 35 ++++++++++++++++++++--------------- 2 files changed, 23 insertions(+), 18 deletions(-) diff --git a/keyboards/helix/serial.c b/keyboards/helix/serial.c index 325c29a3f7..6006ebf1bd 100644 --- a/keyboards/helix/serial.c +++ b/keyboards/helix/serial.c @@ -71,8 +71,8 @@ #endif //////////////// for backward compatibility //////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; #endif @@ -112,7 +112,7 @@ int serial_update_buffers() return result; } -#endif // end of Simple API (OLD API, compatible with let's split serial.c) +#endif // end of OLD API (compatible with let's split serial.c) //////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) diff --git a/keyboards/helix/serial.h b/keyboards/helix/serial.h index 7e0c0847a4..2e53928df2 100644 --- a/keyboards/helix/serial.h +++ b/keyboards/helix/serial.h @@ -15,31 +15,36 @@ // // 4: about 26kbps // // 5: about 20kbps // -// //// USE Simple API (OLD API, compatible with let's split serial.c) +// //// USE OLD API (compatible with let's split serial.c) // ex. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION // // ///////////////////////////////////////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -#endif -#if SERIAL_MASTER_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -#endif +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); -#endif // USE Simple API +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// // Soft Serial Transaction Descriptor typedef struct _SSTD_t { -- cgit v1.2.3 From 29dd6645898d1647c5e4326c9851c2f1562bb6a0 Mon Sep 17 00:00:00 2001 From: Danilo Vulicevic Date: Tue, 6 Nov 2018 21:03:33 +0100 Subject: Add whitefox/billypython keymap (#4374) * Add keyboards/whitefox/keymaps/billypython Cloned from vomindoraan/qmk_firmware * Customize keymap for Linux --- keyboards/whitefox/keymaps/billypython/config.h | 20 +++ keyboards/whitefox/keymaps/billypython/keymap.c | 205 ++++++++++++++++++++++++ keyboards/whitefox/keymaps/billypython/rules.mk | 10 ++ 3 files changed, 235 insertions(+) create mode 100644 keyboards/whitefox/keymaps/billypython/config.h create mode 100644 keyboards/whitefox/keymaps/billypython/keymap.c create mode 100644 keyboards/whitefox/keymaps/billypython/rules.mk diff --git a/keyboards/whitefox/keymaps/billypython/config.h b/keyboards/whitefox/keymaps/billypython/config.h new file mode 100644 index 0000000000..d1c3002d27 --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/config.h @@ -0,0 +1,20 @@ +#pragma once + +#define FORCE_NKRO + +#undef IS_COMMAND +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) + +#define MAGIC_KEY_LAYER0_ALT1 BSLS +#define MAGIC_KEY_BOOTLOADER ESC + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/whitefox/keymaps/billypython/keymap.c b/keyboards/whitefox/keymaps/billypython/keymap.c new file mode 100644 index 0000000000..8096885cf8 --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/keymap.c @@ -0,0 +1,205 @@ +#include QMK_KEYBOARD_H + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) +#define DSKTP_L LCTL(LGUI(KC_LEFT)) +#define DSKTP_R LCTL(LGUI(KC_RGHT)) + +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_FNLK TT(L_FN) + +#define DESKTOP TD(TD_DESKTOP) +#define FN_RCTL TD(TD_FN_RCTL) +#define RAL_LAL TD(TD_RAL_LAL) +#define RAL_RGU TD(TD_RAL_RGU) +#define RCT_RSF TD(TD_RCT_RSF) +#define RSF_RCT TD(TD_RSF_RCT) + +#define COMMA UC(0x002C) +#define L_PAREN UC(0x0028) +#define R_PAREN UC(0x0029) +#define EQUALS UC(0x003D) +#define TIMES UC(0x00D7) +#define DIVIDE UC(0x00F7) +#define MINUS UC(0x2212) + +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); +} + +enum layers { + L_BASE, + L_FN, + L_NUMPAD, +}; + +enum custom_keycodes { + CLEAR = SAFE_RANGE, + NUMPAD, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + case NUMPAD: + if (record->event.pressed) { + layer_invert(L_NUMPAD); + bool num_lock = host_keyboard_leds() & 1<count == 1 || state->count == 3) { + layer_on(L_FN); + } else if (state->count == 2) { + if (!td_fn_rctrl_data.fn_on) { + layer_off(L_FN); + } + register_code(KC_RCTL); + } +} + +void td_fn_rctrl_reset(qk_tap_dance_state_t *state, void *user_data) { + if ((state->count == 1 || state->count > 2) && !td_fn_rctrl_data.fn_on) { + layer_off(L_FN); + } + if (state->count >= 2) { + unregister_code(KC_RCTL); + } + td_fn_rctrl_data.started = false; +} + +#define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ + .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ + .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ + } + +void td_double_mods_each(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(mods->kc1); + } else if (state->count == 2) { + unregister_code(mods->kc1); + register_code(mods->kc2); + } + // Prevent tap dance from sending kc1 and kc2 as weak mods + state->weak_mods &= ~(MOD_BIT(mods->kc1) | MOD_BIT(mods->kc2)); +} + +void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) { + qk_tap_dance_pair_t *mods = (qk_tap_dance_pair_t *)user_data; + if (state->count == 1 || state->count > 2) { + unregister_code(mods->kc1); + } + if (state->count >= 2) { + unregister_code(mods->kc2); + } +} + +enum tap_dance { + TD_DESKTOP, + TD_FN_RCTL, + TD_RAL_LAL, + TD_RAL_RGU, + TD_RCT_RSF, + TD_RSF_RCT, +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop + [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(td_fn_rctrl_each, NULL, td_fn_rctrl_reset), + [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), + [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI), + [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RCTL, KC_RSFT), + [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL), +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │SftCtl│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │AlGu│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT_truefox( \ + KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ + 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_BSPC, KC_DEL, \ + 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_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,RSF_RCT, KC_UP, KC_PGDN, \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, RAL_RGU,FN_FNLK, KC_LEFT,KC_DOWN,KC_RGHT \ + ), + + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│Scr│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │PgU│ ↑ │PgD│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │Hom│ ← │ ↓ │ → │End│ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │VoD│VoU│Mut│ App │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT_truefox( \ + _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ + KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,KC_PGUP,KC_UP, KC_PGDN,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ + _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_END, _______, _______, TOP, \ + _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ + _______,_______,_______, KC_WH_D, _______,_______, KC_HOME,KC_PGDN,KC_END \ + ), + + /* Numpad layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Num│ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_NUMPAD] = LAYOUT_truefox( \ + NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,MINUS, EQUALS, NUMPAD, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,L_PAREN,R_PAREN,_______, _______, \ + _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,TIMES, KC_PENT, _______, \ + _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, COMMA, KC_PDOT,KC_PSLS,DIVIDE, _______,_______, \ + _______,_______,_______, _______, _______,_______, _______,_______,_______ \ + ), +}; diff --git a/keyboards/whitefox/keymaps/billypython/rules.mk b/keyboards/whitefox/keymaps/billypython/rules.mk new file mode 100644 index 0000000000..abf92c2c46 --- /dev/null +++ b/keyboards/whitefox/keymaps/billypython/rules.mk @@ -0,0 +1,10 @@ +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes +VISUALIZER_ENABLE = no -- cgit v1.2.3 From a5d22424f40cf386120008b5d44d810c62d0ffcb Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 6 Nov 2018 12:04:25 -0800 Subject: Commit my DZ60 keymap (#4375) * default mechmerlin keymap initial commit * fix up the keymap * cleanup keymap * add rgb sleep functionality * add the beginning of a readme * fix that compile error * fixup formatting * spruce up that readme * add RGB lighting controls to _CL layer * update readme * set rgb underglow color * update readme * fix formatting --- keyboards/dz60/keymaps/mechmerlin/config.h | 6 +++ keyboards/dz60/keymaps/mechmerlin/keymap.c | 40 +++++++++++++++++ keyboards/dz60/keymaps/mechmerlin/readme.md | 68 +++++++++++++++++++++++++++++ 3 files changed, 114 insertions(+) create mode 100644 keyboards/dz60/keymaps/mechmerlin/config.h create mode 100644 keyboards/dz60/keymaps/mechmerlin/keymap.c create mode 100644 keyboards/dz60/keymaps/mechmerlin/readme.md diff --git a/keyboards/dz60/keymaps/mechmerlin/config.h b/keyboards/dz60/keymaps/mechmerlin/config.h new file mode 100644 index 0000000000..92d4cfb50a --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/config.h @@ -0,0 +1,6 @@ +#pragma once + +// Turn off RGB when computer goes to sleep +#ifdef RGBLIGHT_ENABLE +#define RGBLIGHT_SLEEP +#endif // RGBLIGHT_ENABLE diff --git a/keyboards/dz60/keymaps/mechmerlin/keymap.c b/keyboards/dz60/keymaps/mechmerlin/keymap.c new file mode 100644 index 0000000000..1a8593ef16 --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTCP LCTL_T(KC_CAPS) +#define KC_RSSH RSFT_T(KC_SLSH) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_b_ansi( + KC_ESC, 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_BSPC, + 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_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSSH, KC_UP, KC_DEL, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + [_FL] = LAYOUT_60_b_ansi( + KC_GRV, 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_DEL, KC_DEL, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_PGUP, MO(_CL), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END), + + [_CL] = LAYOUT_60_b_ansi( + RESET, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +}; + +// Set underglow RGB leds to yellow +// Find the list of available colors in quantum/rgblight_list.h +void matrix_init_user(void) { + rgblight_sethsv_noeeprom_yellow(); +} diff --git a/keyboards/dz60/keymaps/mechmerlin/readme.md b/keyboards/dz60/keymaps/mechmerlin/readme.md new file mode 100644 index 0000000000..76ff54de54 --- /dev/null +++ b/keyboards/dz60/keymaps/mechmerlin/readme.md @@ -0,0 +1,68 @@ +# MechMerlin's DZ60 Keymap + +The purpose of this keymap is to provide examples on how to do some common QMK features. + +Make example for this keyboard (after setting up your build environment): + + make dz60:mechmerlin + +## Merlin's DZ60 Hardware Info +--- + +The DZ60 is a 60% pcb produced by KBDFans. It comes in two variants, USB Mini B and USB C. It supports many many layouts. It also supports both backlight and RGB underglow. The USB C variant does not have a hardware reset switch. USB C to C is not supported. + +Merlin's DZ60 uses +- Layout B, in QMK this is LAYOUT_60_b_ansi. +- USB C +- 50g Zilents +- Arrows are 78g Zilents +- KPRepublic XD64 Case + +## Layers +--- + +Merlin's keymap has three different layers. To switch layers you can use the `MO(X)` keycode, where `X` is the layer you want to switch to. + +### _BL + +This is the base layer also known as layer 0. It is a standard QWERTY layout. It has the `_FL` layer switch key. + +### _FL + +This is the function layer also known as layer 1. It utiizes the following: +- Function Keys +- Navigation Keys +- Audio keys such as Mute, Volume Down and Volume Up. +- `_CL` layer switch key + +### _CL + +This is the control layer also known as layer 2. It utilizes the following: +- RGB Controls +- `RESET` key + +## Non Standard Keycodes +--- +### RESET + +As long `BOOTMAGIC_ENABLE` is set to `yes` in `rules.mk`, the DZ60 can be put into bootloader mode by holding the `space` key and the `b` key while plugging in. However sometmes this doesn't work or is troublesome to do, might as well use the `RESET` keycode to accomplish this. + +### RSFT_T(KC_SLSH) + +Layout B is missing the `?` key and is instead replaced with a `right shift`. This keycode makes it so that the key can be tapped for `?` and held for `right shift`. + +### LCTL_T(KC_CAPS) + +`Caps Lock` is only ever used by tapping, why not use it as a `control` key when held? This keycode makes it so that the key can be tapped for `caps lock` and held for `control`. + + +## RGB Lighting +--- + +### RGBLIGHT_SLEEP + +This is set in `mechmerlin/config.h` so that when the computer goes to sleep, the RGB lights will also go to sleep on the keyboard. They will turn back on when the computer wakes. + +### RGB Underglow Color: Yellow + +This is set in `mechmerlin/keymap.c` in the `matrix_init_user` function. The list of available colors can be found in [`quantum/rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/388df5359b913eaf1ce6fb0ef624e430ad010ea5/quantum/rgblight_list.h#L59-L121). -- cgit v1.2.3 From 3dec80b7746ee61e4c9e67da817635828dd86b7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 6 Nov 2018 21:21:44 +0100 Subject: Improve wording, punctuation and capitalization in newbs_getting_started guide (#4342) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Improve wording, punctuation and capitalization in newbs_getting_started guide Also add some links * Update example build command output Co-Authored-By: vomindoraan * Replace occurrences of "layout" with "keymap" Co-Authored-By: MechMerlin <30334081+mechmerlin@users.noreply.github.com> * Explicitly instruct users to open an MSYS2 MinGW 64-bit terminal * MSYS2 Console → MSYS2 MinGW * Replace thin spaces with regular spaces --- docs/newbs_getting_started.md | 78 +++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/docs/newbs_getting_started.md b/docs/newbs_getting_started.md index 2181542856..276c7fec32 100644 --- a/docs/newbs_getting_started.md +++ b/docs/newbs_getting_started.md @@ -1,99 +1,97 @@ # Introduction -Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when they are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom layout you are creating the equivalent of an .exe for your keyboard. +Your computer keyboard has a processor inside of it, not unlike the one inside your computer. This processor runs software that is responsible for detecting button presses and sending reports about the state of the keyboard when buttons are pressed or released. QMK fills the role of that software, detecting button presses and passing that information on to the host computer. When you build your custom keymap, you are creating the equivalent of an executable program for your keyboard. -QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful layouts, you only have to follow a few simple syntax rules. +QMK tries to put a lot of power into your hands by making easy things easy, and hard things possible. You don't have to know how to program to create powerful keymaps — you only have to follow a few simple syntax rules. # Getting Started -Before you can build keymaps you need to install some software and setup your build environment. This only has to be done one time no matter how many keyboards you want to compile firmware for. +Before you can build keymaps, you need to install some software and set up your build environment. This only has to be done once no matter how many keyboards you plan to compile firmware for. ## Download Software ### Text Editor -You'll need a program that can edit and save **plain text** files. If you are on Windows you can make due with Notepad, and on Linux you can use Gedit, both of which are simple but functional text editors. On macOS be careful with TextEdit.app, it will not save plain text files unless you make sure to select "Make Plain text" from the "Format" menu, or you can use another program such as Sublime Text. +You'll need a program that can edit and save **plain text** files. If you're on Windows you can make do with Notepad, and on Linux you can use gedit. Both of these are simple but functional text editors. On macOS, be careful with the default TextEdit app: it will not save plain text files unless you explicitly select _Make Plain Text_ from the _Format_ menu. + +You can also download and install a dedicated text editor like [Sublime Text](https://www.sublimetext.com/) or [VS Code](https://code.visualstudio.com/). This is probably the best way to go regardless of platform, as these programs are specifically made for editing code. ?> Not sure which text editor to use? Laurence Bradford wrote [a great introduction](https://learntocodewith.me/programming/basics/text-editors/) to the subject. ### QMK Toolbox -QMK Toolbox is an optional graphical Windows and macOS program that allows you to both program and debug your custom keyboard. You will likely prefer it to easily flash your keyboard and receive the debugging messages that your keyboard will print. - -Download the files from the links below: - -For Windows: "qmk_toolbox.exe" or "qmk_toolbox_install.exe" (with installer) +QMK Toolbox is an optional graphical program for Windows and macOS that allows you to both program and debug your custom keyboard. You will likely find it invaluable for easily flashing your keyboard and viewing debug messages that it prints. -For Mac: "QMK.Toolbox.app.zip" or "QMK.Toolbox.pkg" (with installer) +[Download the latest release here.](https://github.com/qmk/qmk_toolbox/releases/latest) -* [Newest Release](https://github.com/qmk/qmk_toolbox/releases/latest) -* [Source Code](https://github.com/qmk/qmk_toolbox/) +* For Windows: `qmk_toolbox.exe` (portable) or `qmk_toolbox_install.exe` (installer) +* For macOS: `QMK.Toolbox.app.zip` (portable) or `QMK.Toolbox.pkg` (installer) -## Environment Setup +## Set Up Your Environment -We've tried to make QMK as easy to setup as possible. You only have to prepare your Linux or Unix environment and let QMK install the rest. +We've tried to make QMK as easy to set up as possible. You only have to prepare your Linux or Unix environment, then let QMK install the rest. -?> If you haven't worked with the Linux/Unix command line before there are a few basic concepts and commands you should learn. These resources will teach you enough to work with QMK:
+?> If you haven't worked with the Linux/Unix command line before, there are a few basic concepts and commands you should learn. These resources will teach you enough to be able to work with QMK:
[Must Know Linux Commands](https://www.guru99.com/must-know-linux-commands.html)
[Some Basic Unix Commands](https://www.tjhsst.edu/~dhyatt/superap/unixcmd.html) ### Windows -You will need to install msys2 and git. +You will need to install MSYS2 and Git. -* Follow the installation instructions on the msys2 homepage: http://www.msys2.org -* Close any open msys2 terminals, and open a new terminal -* Install git by running this command: `pacman -S git` +* Follow the installation instructions on the [MSYS2 homepage](http://www.msys2.org). +* Close any open MSYS2 terminals and open a new MSYS2 MinGW 64-bit terminal. +* Install Git by running this command: `pacman -S git`. ### macOS -You will need to install homebrew. Follow the instructions on the homebrew homepage: https://brew.sh +You will need to install Homebrew. Follow the instructions on the [Homebrew homepage](https://brew.sh). -After homebrew is installed continue with "Download QMK", following step "Setup QMK" runs a script that will install other packages. +After Homebrew is installed, continue with _Set Up QMK_. In that step you will run a script that will install other packages. ### Linux -You will need to install git. It's extremely likely you already have it, but if not one of the following commands should install it: +You will need to install Git. It's very likely that you already have it, but if not, one of the following commands should install it: -* Debian/Ubuntu/Devuan: `apt-get install git` -* Fedora/Redhat/Centos: `yum install git` +* Debian / Ubuntu / Devuan: `apt-get install git` +* Fedora / Red Hat / CentOS: `yum install git` * Arch: `pacman -S git` -## Download QMK +?> Docker is also an option on all platforms. [Click here for details.](getting_started_build_tools.md#docker) -Once you have setup your Linux/Unix environment you are ready to download QMK. We will do this by using git to "clone" the QMK repository. Open a Terminal or MSYS2 Console window and leave it open for the remainder of this guide. Inside that window run these two commands: +## Set Up QMK + +Once you have set up your Linux/Unix environment, you are ready to download QMK. We will do this by using Git to "clone" the QMK repository. Open a Terminal or MSYS2 MinGW window and leave it open for the remainder of this guide. Inside that window run these two commands: git clone https://github.com/qmk/qmk_firmware.git cd qmk_firmware -?> If you already know [how to use GitHub](getting_started_github.md) we recommend you create and clone your own fork instead. If you don't know what that means you can safely ignore this message. - -## Setup QMK +?> If you already know [how to use GitHub](getting_started_github.md), we recommend that you create and clone your own fork instead. If you don't know what that means, you can safely ignore this message. -QMK comes with a script to help you setup the rest of what you'll need. You should run it now by typing in this command: +QMK comes with a script to help you set up the rest of what you'll need. You should run it now by typing in this command: - ./util/qmk_install.sh + util/qmk_install.sh ## Test Your Build Environment -Now that your QMK build environment is setup you can build a firmware for your keyboard. Start by trying to build the default layout for your keyboard. You should be able to do that with a command in this format: +Now that your QMK build environment is set up, you can build a firmware for your keyboard. Start by trying to build the keyboard's default keymap. You should be able to do that with a command in this format: make :default -For example, to build a firmware for a Clueboard 66% use: +For example, to build a firmware for a Clueboard 66% you would use: make clueboard/66/rev3:default When it is done you should have a lot of output that ends similar to this: ``` -Linking: .build/clueboard_66_rev2_default.elf [OK] -Creating load file for flashing: .build/clueboard_66_rev2_default.hex [OK] -Copying clueboard_66_rev2_default.hex to qmk_firmware folder [OK] -Checking file size of clueboard_66_rev2_default.hex [OK] - * File size is fine - 25174/28672 +Linking: .build/clueboard_66_rev3_default.elf [OK] +Creating load file for flashing: .build/clueboard_66_rev3_default.hex [OK] +Copying clueboard_66_rev3_default.hex to qmk_firmware folder [OK] +Checking file size of clueboard_66_rev3_default.hex [OK] + * The firmware size is fine - 26356/28672 (2316 bytes free) ``` -## Creating Your Layout +# Creating Your Keymap -Now you are ready to create your own personal layout. Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. +You are now ready to create your own personal keymap! Move on to [Building Your First Firmware](newbs_building_firmware.md) for that. -- cgit v1.2.3 From f01a80968b327720048c3e95a8e5d57891ccfd5b Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Tue, 6 Nov 2018 12:35:08 -0800 Subject: Port over Noxary 268.2 from Rosakiin's Noxary Firmware (#4354) * port over 268.2 from Noxary Firmware * rename files * update readme * put rozakiin's ame in more places * add configurator support * Update keyboards/noxary/268_2/n268_2.c Co-Authored-By: mechmerlin <30334081+mechmerlin@users.noreply.github.com> * Update keyboards/noxary/268_2/keymaps/default/keymap.c Co-Authored-By: mechmerlin <30334081+mechmerlin@users.noreply.github.com> * rename 268_2 keyboard files --- keyboards/noxary/268_2/268_2.c | 54 ++++++ keyboards/noxary/268_2/268_2.h | 43 +++++ keyboards/noxary/268_2/config.h | 221 +++++++++++++++++++++++ keyboards/noxary/268_2/info.json | 12 ++ keyboards/noxary/268_2/keymaps/default/config.h | 19 ++ keyboards/noxary/268_2/keymaps/default/keymap.c | 83 +++++++++ keyboards/noxary/268_2/keymaps/default/readme.md | 1 + keyboards/noxary/268_2/readme.md | 16 ++ keyboards/noxary/268_2/rules.mk | 80 ++++++++ keyboards/noxary/README.md | 6 +- 10 files changed, 533 insertions(+), 2 deletions(-) create mode 100644 keyboards/noxary/268_2/268_2.c create mode 100644 keyboards/noxary/268_2/268_2.h create mode 100644 keyboards/noxary/268_2/config.h create mode 100644 keyboards/noxary/268_2/info.json create mode 100644 keyboards/noxary/268_2/keymaps/default/config.h create mode 100644 keyboards/noxary/268_2/keymaps/default/keymap.c create mode 100644 keyboards/noxary/268_2/keymaps/default/readme.md create mode 100644 keyboards/noxary/268_2/readme.md create mode 100644 keyboards/noxary/268_2/rules.mk diff --git a/keyboards/noxary/268_2/268_2.c b/keyboards/noxary/268_2/268_2.c new file mode 100644 index 0000000000..da4e5efb76 --- /dev/null +++ b/keyboards/noxary/268_2/268_2.c @@ -0,0 +1,54 @@ +/* Copyright 2018 Rozakiin + * + * 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 . + */ +#include "268_2.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +__attribute__((weak)) +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB |= (1 << 0); + } + else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } +} diff --git a/keyboards/noxary/268_2/268_2.h b/keyboards/noxary/268_2/268_2.h new file mode 100644 index 0000000000..2f5d985a33 --- /dev/null +++ b/keyboards/noxary/268_2/268_2.h @@ -0,0 +1,43 @@ +/* Copyright 2018 Rozakiin + * + * 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 . + */ +#ifndef N268_2_H +#define N268_2_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K214, K215, \ + K300, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K314, K315, \ + K400, K401, K402, K406, K409, K410, K412, K414, K415 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, KC_NO, K114, K115, }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, KC_NO, KC_NO, K214, K215, }, \ + { K300, KC_NO, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, KC_NO, K314, K315, }, \ + { K400, K401, K402, KC_NO, KC_NO, KC_NO, K406, KC_NO, KC_NO, K409, K410, KC_NO, K412, KC_NO, K414, K415, } \ +} + +#endif diff --git a/keyboards/noxary/268_2/config.h b/keyboards/noxary/268_2/config.h new file mode 100644 index 0000000000..f5308d8ecd --- /dev/null +++ b/keyboards/noxary/268_2/config.h @@ -0,0 +1,221 @@ +/* +Copyright 2018 Rozakiin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x4E58 +#define PRODUCT_ID 0x0044 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Noxary +#define PRODUCT 268.2 +#define DESCRIPTION QMK keyboard firmware for 268.2 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, F6, F5, F0, B5 } +#define MATRIX_COL_PINS { C6, B6, C7, F4, E6, D0, D7, D1, D2, B4, D6, D4, D5, F1, D3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B7 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/noxary/268_2/info.json b/keyboards/noxary/268_2/info.json new file mode 100644 index 0000000000..8d227afd86 --- /dev/null +++ b/keyboards/noxary/268_2/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Noxary 268.2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/noxary/268_2/keymaps/default/config.h b/keyboards/noxary/268_2/keymaps/default/config.h new file mode 100644 index 0000000000..9c4c2b6308 --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 Rozakiin + * + * 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 + +// place overrides here diff --git a/keyboards/noxary/268_2/keymaps/default/keymap.c b/keyboards/noxary/268_2/keymaps/default/keymap.c new file mode 100644 index 0000000000..994fe36b0c --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/keymap.c @@ -0,0 +1,83 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL1 1 +#define _FL2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* _BL: Base Layer(Default) - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \|BSpc| Grv| + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | Del| + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '| #| Ent|PgUp| + * |----------------------------------------------------------------| + * |Shift| \| Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Mo(1)|Ctrl|Lef|Dow|Rght| + * `----------------------------------------------------------------' + */ + [_BL] = LAYOUT( + KC_ESC, 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_BSLS, KC_BSPC, KC_GRV, + 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_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_PGUP, + KC_LSFT, 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_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL1), KC_LEFT, KC_DOWN, KC_RGHT), + /* _FL1: Function Layer 1 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | `|F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12| |PScr| | + * |----------------------------------------------------------------| + * | | | | |RST| | | | | | | | | | Ins| + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | |Home| + * |----------------------------------------------------------------| + * | | | | | | | | | |Bl-|Bl+| |Mute|Vol+| End| + * |----------------------------------------------------------------| + * | | | | BL_Toggle | | | | |Vol-| | + * `----------------------------------------------------------------' + */ + [_FL1] = LAYOUT( + KC_GRV, 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, _______, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, BL_DEC, BL_INC, _______, KC_MUTE, KC_VOLU, KC_END, + _______, _______, _______, BL_TOGG, _______, _______, _______, KC_VOLD, _______), + /* _FL2: Function Layer 2 - For ISO enter use ANSI enter + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | + * `----------------------------------------------------------------' + */ + [_FL2] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + + diff --git a/keyboards/noxary/268_2/keymaps/default/readme.md b/keyboards/noxary/268_2/keymaps/default/readme.md new file mode 100644 index 0000000000..c4c832cc64 --- /dev/null +++ b/keyboards/noxary/268_2/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for 268_2 diff --git a/keyboards/noxary/268_2/readme.md b/keyboards/noxary/268_2/readme.md new file mode 100644 index 0000000000..85d1a47179 --- /dev/null +++ b/keyboards/noxary/268_2/readme.md @@ -0,0 +1,16 @@ +# Noxary 268.2 + +![268.2](https://www.keebtalk.com/uploads/db8059/original/2X/6/65b93c83cadd98bbf8e3b1d739621d54b682609a.jpg) + +A fully customizable 65% keyboard. + +* Keyboard Maintainer: [Rozakiin](https://github.com/rozakiin) +* Hardware Supported: 268.2 PCB + * rev1 +* Hardware Availability: [Noxary](https://shop.noxary.co/collections/268-2/products/noxary-268-2-polycarbonate) + +Make example for this keyboard (after setting up your build environment): + + make noxary/268_2: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/noxary/268_2/rules.mk b/keyboards/noxary/268_2/rules.mk new file mode 100644 index 0000000000..9b6d7e672d --- /dev/null +++ b/keyboards/noxary/268_2/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # 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) diff --git a/keyboards/noxary/README.md b/keyboards/noxary/README.md index bd4b4b591f..8dbd85f7ef 100644 --- a/keyboards/noxary/README.md +++ b/keyboards/noxary/README.md @@ -4,6 +4,8 @@ All files related to firmware of Noxary Keyboards designed by [Rozakiin](https:/ ### Keyboards -- [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin +- [268](./268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin -- [x268](./x268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin +- [268.2](./268_2/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin + +- [x268](./x268/): Original repo [here](https://github.com/Rozakiin/Noxary_Firmware). Imported by kind [permission](https://github.com/Rozakiin/Noxary_Firmware/issues/1) of @rozakiin -- cgit v1.2.3 From fc477a1ee7a68cab4ae8fb7d7f0c8d6a4e6c8509 Mon Sep 17 00:00:00 2001 From: Danny Date: Tue, 6 Nov 2018 16:13:58 -0500 Subject: Add Tragicforce 68 layout for split backspace and add configurator layouts (#4378) --- keyboards/tragicforce68/info.json | 236 +++++++++++++++++++++++++++++++- keyboards/tragicforce68/tragicforce68.h | 18 +++ 2 files changed, 251 insertions(+), 3 deletions(-) diff --git a/keyboards/tragicforce68/info.json b/keyboards/tragicforce68/info.json index f3e3d6adad..550040a3a1 100644 --- a/keyboards/tragicforce68/info.json +++ b/keyboards/tragicforce68/info.json @@ -5,8 +5,238 @@ "width": 17.25, "height": 5, "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] - } + "LAYOUT": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + }, + "LAYOUT_split_space": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":1.75}, + {"x":7.75, "y":4, "w":2.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + }, + "LAYOUT_split_space_and_backspace": { + "layout": [ + {"label":"~", "x":0, "y":0}, + {"label":"!", "x":1, "y":0}, + {"label":"@", "x":2, "y":0}, + {"label":"#", "x":3, "y":0}, + {"label":"$", "x":4, "y":0}, + {"label":"%", "x":5, "y":0}, + {"label":"^", "x":6, "y":0}, + {"label":"&", "x":7, "y":0}, + {"label":"*", "x":8, "y":0}, + {"label":"(", "x":9, "y":0}, + {"label":")", "x":10, "y":0}, + {"label":"_", "x":11, "y":0}, + {"label":"+", "x":12, "y":0}, + {"label":"Del", "x":13, "y":0}, + {"label":"Backspace", "x":14, "y":0}, + {"x":15.25, "y":0}, + {"x":16.25, "y":0}, + + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":" {", "x":11.5, "y":1}, + {"label":"}", "x":12.5, "y":1}, + {"label":"|", "x":13.5, "y":1, "w":1.5}, + {"x":15.25, "y":1}, + {"x":16.25, "y":1}, + + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":":", "x":10.75, "y":2}, + {"label":"\"", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"<", "x":9.25, "y":3}, + {"label":">", "x":10.25, "y":3}, + {"label":"?", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"x":15.25, "y":3}, + + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"Win", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"x":3.75, "y":4, "w":2.25}, + {"x":6, "y":4, "w":1.75}, + {"x":7.75, "y":4, "w":2.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"Win", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"x":14.25, "y":4}, + {"x":15.25, "y":4}, + {"x":16.25, "y":4} + ] + } } } diff --git a/keyboards/tragicforce68/tragicforce68.h b/keyboards/tragicforce68/tragicforce68.h index e1b2a038d0..a63ce50a5e 100644 --- a/keyboards/tragicforce68/tragicforce68.h +++ b/keyboards/tragicforce68/tragicforce68.h @@ -38,6 +38,24 @@ { J1, J2, J3, J4, J5, J6, J7, J8 } \ } +#define LAYOUT_split_space_and_backspace( \ + A1, A2, A3, A4, A5, A6, A7, A8, E1, E2, E3, E4, E5, E6, H7, E7, E8, \ + B1, B2, B3, B4, B5, B6, B7, B8, F1, F2, F3, F4, F5, F6, F7, F8, \ + C1, C2, C3, C4, C5, C6, C7, C8, G1, G2, G3, G4, G5, \ + D1, D2, D3, D4, D5, D6, D7, D8, H1, H2, H3, H4, H5, \ + J1, J2, J3, J4, J5, J6, J7, J8, H6, G6, G7, G8 \ +) { \ + { A1, A2, A3, A4, A5, A6, A7, A8 }, \ + { B1, B2, B3, B4, B5, B6, B7, B8 }, \ + { C1, C2, C3, C4, C5, C6, C7, C8 }, \ + { D1, D2, D3, D4, D5, D6, D7, D8 }, \ + { E1, E2, E3, E4, E5, E6, E7, E8 }, \ + { F1, F2, F3, F4, F5, F6, F7, F8 }, \ + { G1, G2, G3, G4, G5, G6, G7, G8 }, \ + { H1, H2, H3, H4, H5, H6, H7, KC_NO }, \ + { J1, J2, J3, J4, J5, J6, J7, J8 } \ +} + #define LAYOUT_kc( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ -- cgit v1.2.3 From a30dd2bb1711f5402007adf89af9b3adb758a7fb Mon Sep 17 00:00:00 2001 From: Danilo Vulicevic Date: Wed, 7 Nov 2018 02:04:02 +0100 Subject: Add xd75/billypython keymap (#4381) * Add xd75/billypython keymap * Expand rules.mk (cherry picked from commit 806fee94ae3a21b6ca7a34624101349b57d41b75) * Expand billypython's rules.mk * Remove unused stuff in whitefox/billypython --- keyboards/whitefox/keymaps/billypython/config.h | 3 - keyboards/whitefox/keymaps/billypython/keymap.c | 52 +---------- keyboards/whitefox/keymaps/billypython/rules.mk | 5 + keyboards/whitefox/keymaps/konstantin/rules.mk | 5 + keyboards/xd75/keymaps/billypython/config.h | 17 ++++ keyboards/xd75/keymaps/billypython/keymap.c | 119 ++++++++++++++++++++++++ keyboards/xd75/keymaps/billypython/rules.mk | 15 +++ 7 files changed, 163 insertions(+), 53 deletions(-) create mode 100644 keyboards/xd75/keymaps/billypython/config.h create mode 100644 keyboards/xd75/keymaps/billypython/keymap.c create mode 100644 keyboards/xd75/keymaps/billypython/rules.mk diff --git a/keyboards/whitefox/keymaps/billypython/config.h b/keyboards/whitefox/keymaps/billypython/config.h index d1c3002d27..275f8effba 100644 --- a/keyboards/whitefox/keymaps/billypython/config.h +++ b/keyboards/whitefox/keymaps/billypython/config.h @@ -2,9 +2,6 @@ #define FORCE_NKRO -#undef IS_COMMAND -#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) - #define MAGIC_KEY_LAYER0_ALT1 BSLS #define MAGIC_KEY_BOOTLOADER ESC diff --git a/keyboards/whitefox/keymaps/billypython/keymap.c b/keyboards/whitefox/keymaps/billypython/keymap.c index 8096885cf8..dfc7d6a967 100644 --- a/keyboards/whitefox/keymaps/billypython/keymap.c +++ b/keyboards/whitefox/keymaps/billypython/keymap.c @@ -2,18 +2,11 @@ #define TOP LCTL(KC_HOME) #define BOTTOM LCTL(KC_END) -#define DSKTP_L LCTL(LGUI(KC_LEFT)) -#define DSKTP_R LCTL(LGUI(KC_RGHT)) #define FN MO(L_FN) #define FN_CAPS LT(L_FN, KC_CAPS) #define FN_FNLK TT(L_FN) -#define DESKTOP TD(TD_DESKTOP) -#define FN_RCTL TD(TD_FN_RCTL) -#define RAL_LAL TD(TD_RAL_LAL) -#define RAL_RGU TD(TD_RAL_RGU) -#define RCT_RSF TD(TD_RCT_RSF) #define RSF_RCT TD(TD_RSF_RCT) #define COMMA UC(0x002C) @@ -62,37 +55,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } } -struct { - bool fn_on; // Layer state when tap dance started - bool started; -} td_fn_rctrl_data; - -void td_fn_rctrl_each(qk_tap_dance_state_t *state, void *user_data) { - if (!td_fn_rctrl_data.started) { - td_fn_rctrl_data.fn_on = IS_LAYER_ON(L_FN); - td_fn_rctrl_data.started = true; - } - // Single tap → Fn, double tap → RCtrl, triple tap etc. → Fn+RCtrl - if (state->count == 1 || state->count == 3) { - layer_on(L_FN); - } else if (state->count == 2) { - if (!td_fn_rctrl_data.fn_on) { - layer_off(L_FN); - } - register_code(KC_RCTL); - } -} - -void td_fn_rctrl_reset(qk_tap_dance_state_t *state, void *user_data) { - if ((state->count == 1 || state->count > 2) && !td_fn_rctrl_data.fn_on) { - layer_off(L_FN); - } - if (state->count >= 2) { - unregister_code(KC_RCTL); - } - td_fn_rctrl_data.started = false; -} - #define ACTION_TAP_DANCE_DOUBLE_MODS(mod1, mod2) { \ .fn = { td_double_mods_each, NULL, td_double_mods_reset }, \ .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ @@ -122,20 +84,10 @@ void td_double_mods_reset(qk_tap_dance_state_t *state, void *user_data) { } enum tap_dance { - TD_DESKTOP, - TD_FN_RCTL, - TD_RAL_LAL, - TD_RAL_RGU, - TD_RCT_RSF, TD_RSF_RCT, }; qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DESKTOP] = ACTION_TAP_DANCE_DOUBLE(LCTL(LGUI(KC_D)), LCTL(LGUI(KC_F4))), // Add/close virtual desktop - [TD_FN_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(td_fn_rctrl_each, NULL, td_fn_rctrl_reset), - [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_LALT), - [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RALT, KC_RGUI), - [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RCTL, KC_RSFT), [TD_RSF_RCT] = ACTION_TAP_DANCE_DOUBLE_MODS(KC_RSFT, KC_RCTL), }; @@ -150,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │SftCtl│ ↑ │PgD│ * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │LCtl│LGui│LAlt│ Space │AlGu│FnLk│ │ ← │ ↓ │ → │ + * │LCtl│LGui│LAlt│ Space │RAlt│FnLk│ │ ← │ ↓ │ → │ * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_BASE] = LAYOUT_truefox( \ @@ -158,7 +110,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { 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_BSPC, KC_DEL, \ 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_PGUP, \ KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,RSF_RCT, KC_UP, KC_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, RAL_RGU,FN_FNLK, KC_LEFT,KC_DOWN,KC_RGHT \ + KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,FN_FNLK, KC_LEFT,KC_DOWN,KC_RGHT \ ), /* Function layer diff --git a/keyboards/whitefox/keymaps/billypython/rules.mk b/keyboards/whitefox/keymaps/billypython/rules.mk index abf92c2c46..c42f6e7059 100644 --- a/keyboards/whitefox/keymaps/billypython/rules.mk +++ b/keyboards/whitefox/keymaps/billypython/rules.mk @@ -1,10 +1,15 @@ +AUDIO_ENABLE = no BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no BOOTMAGIC_ENABLE = no COMMAND_ENABLE = yes CONSOLE_ENABLE = yes EXTRAKEY_ENABLE = yes +MIDI_ENABLE = no MOUSEKEY_ENABLE = yes NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +SLEEP_LIGHT_ENABLE = no TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes VISUALIZER_ENABLE = no diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index abf92c2c46..c42f6e7059 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -1,10 +1,15 @@ +AUDIO_ENABLE = no BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no BOOTMAGIC_ENABLE = no COMMAND_ENABLE = yes CONSOLE_ENABLE = yes EXTRAKEY_ENABLE = yes +MIDI_ENABLE = no MOUSEKEY_ENABLE = yes NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +SLEEP_LIGHT_ENABLE = no TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes VISUALIZER_ENABLE = no diff --git a/keyboards/xd75/keymaps/billypython/config.h b/keyboards/xd75/keymaps/billypython/config.h new file mode 100644 index 0000000000..275f8effba --- /dev/null +++ b/keyboards/xd75/keymaps/billypython/config.h @@ -0,0 +1,17 @@ +#pragma once + +#define FORCE_NKRO + +#define MAGIC_KEY_LAYER0_ALT1 BSLS +#define MAGIC_KEY_BOOTLOADER ESC + +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define PERMISSIVE_HOLD +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/xd75/keymaps/billypython/keymap.c b/keyboards/xd75/keymaps/billypython/keymap.c new file mode 100644 index 0000000000..8a06074ca5 --- /dev/null +++ b/keyboards/xd75/keymaps/billypython/keymap.c @@ -0,0 +1,119 @@ +#include QMK_KEYBOARD_H + +#define TOP LCTL(KC_HOME) +#define BOTTOM LCTL(KC_END) + +#define FN MO(L_FN) +#define FN_CAPS LT(L_FN, KC_CAPS) +#define FN_FNLK TT(L_FN) + +#define COMMA UC(0x002C) +#define L_PAREN UC(0x0028) +#define R_PAREN UC(0x0029) +#define EQUALS UC(0x003D) +#define TIMES UC(0x00D7) +#define DIVIDE UC(0x00F7) +#define MINUS UC(0x2212) + +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); +} + +enum layers { + L_BASE, + L_FN, + L_NUMPAD, +}; + +enum custom_keycodes { + CLEAR = SAFE_RANGE, + NUMPAD, +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; + + case NUMPAD: + if (record->event.pressed) { + layer_invert(L_NUMPAD); + bool num_lock = host_keyboard_leds() & 1< Date: Wed, 7 Nov 2018 09:25:18 -0700 Subject: Configurable Rainbow Swirl range (#4376) * Configurable Rainbow Swirl range This allows tweaking of the rainbow effect to get different effects on keyboards with varied LED layouts. We found the value 1950 works on the RGBKB.net Sol to get a cool striped effect across the keyboard. * Document RGBLIGHT_RAINBOW_SWIRL_RANGE * Better wording for the documentation --- docs/feature_rgblight.md | 1 + quantum/rgblight.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index a2820347de..0205ebe91a 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -122,6 +122,7 @@ The following options can be used to tweak the various animations: |`RGBLIGHT_EFFECT_KNIGHT_LED_NUM` |`RGBLED_NUM` |The number of LEDs to have the "Knight" animation travel | |`RGBLIGHT_EFFECT_CHRISTMAS_INTERVAL`|`1000` |How long to wait between light changes for the "Christmas" animation, in milliseconds| |`RGBLIGHT_EFFECT_CHRISTMAS_STEP` |`2` |The number of LEDs to group the red/green colors by for the "Christmas" animation | +|`RGBLIGHT_RAINBOW_SWIRL_RANGE` |`360` |Range adjustment for the rainbow swirl effect to get different swirls | You can also modify the speeds that the different modes animate at: diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 94e9c0a3b2..9ce3b23092 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -679,6 +679,10 @@ void rgblight_effect_rainbow_mood(uint8_t interval) { #endif #ifdef RGBLIGHT_EFFECT_RAINBOW_SWIRL +#ifndef RGBLIGHT_RAINBOW_SWIRL_RANGE + #define RGBLIGHT_RAINBOW_SWIRL_RANGE 360 +#endif + __attribute__ ((weak)) const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {100, 50, 20}; @@ -692,7 +696,7 @@ void rgblight_effect_rainbow_swirl(uint8_t interval) { } last_timer = timer_read(); for (i = 0; i < RGBLED_NUM; i++) { - hue = (360 / RGBLED_NUM * i + current_hue) % 360; + hue = (RGBLIGHT_RAINBOW_SWIRL_RANGE / RGBLED_NUM * i + current_hue) % 360; sethsv(hue, rgblight_config.sat, rgblight_config.val, (LED_TYPE *)&led[i]); } rgblight_set(); -- cgit v1.2.3 From 945dd946ab2679882b7cd923013ce5424f8f33b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 7 Nov 2018 18:29:57 +0100 Subject: Fix misspelled make option, format rules.mk files (#4382) --- keyboards/whitefox/keymaps/billypython/rules.mk | 28 ++++++++++++------------- keyboards/whitefox/keymaps/konstantin/rules.mk | 28 ++++++++++++------------- keyboards/xd75/keymaps/billypython/rules.mk | 28 ++++++++++++------------- 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/keyboards/whitefox/keymaps/billypython/rules.mk b/keyboards/whitefox/keymaps/billypython/rules.mk index c42f6e7059..8fbc1f3af4 100644 --- a/keyboards/whitefox/keymaps/billypython/rules.mk +++ b/keyboards/whitefox/keymaps/billypython/rules.mk @@ -1,15 +1,15 @@ -AUDIO_ENABLE = no -BACKLIGHT_ENABLE = no -BLUETOOTH_ENABLE = no -BOOTMAGIC_ENABLE = no -COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes -EXTRAKEY_ENABLE = yes -MIDI_ENABLE = no -MOUSEKEY_ENABLE = yes -NKRO_ENABLE = yes -RGBLIGHT_ENABLE = no -SLEEP_LIGHT_ENABLE = no -TAP_DANCE_ENABLE = yes -UNICODE_ENABLE = yes +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MIDI_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +SLEEP_LED_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes VISUALIZER_ENABLE = no diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index c42f6e7059..8fbc1f3af4 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -1,15 +1,15 @@ -AUDIO_ENABLE = no -BACKLIGHT_ENABLE = no -BLUETOOTH_ENABLE = no -BOOTMAGIC_ENABLE = no -COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes -EXTRAKEY_ENABLE = yes -MIDI_ENABLE = no -MOUSEKEY_ENABLE = yes -NKRO_ENABLE = yes -RGBLIGHT_ENABLE = no -SLEEP_LIGHT_ENABLE = no -TAP_DANCE_ENABLE = yes -UNICODE_ENABLE = yes +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MIDI_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +SLEEP_LED_ENABLE = no +TAP_DANCE_ENABLE = yes +UNICODE_ENABLE = yes VISUALIZER_ENABLE = no diff --git a/keyboards/xd75/keymaps/billypython/rules.mk b/keyboards/xd75/keymaps/billypython/rules.mk index 5a502b1526..c935bbac11 100644 --- a/keyboards/xd75/keymaps/billypython/rules.mk +++ b/keyboards/xd75/keymaps/billypython/rules.mk @@ -1,15 +1,15 @@ -AUDIO_ENABLE = no -BACKLIGHT_ENABLE = no -BLUETOOTH_ENABLE = no -BOOTMAGIC_ENABLE = no -COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes -EXTRAKEY_ENABLE = yes -MIDI_ENABLE = no -MOUSEKEY_ENABLE = yes -NKRO_ENABLE = yes -RGBLIGHT_ENABLE = no -SLEEP_LIGHT_ENABLE = no -TAP_DANCE_ENABLE = no -UNICODE_ENABLE = yes +AUDIO_ENABLE = no +BACKLIGHT_ENABLE = no +BLUETOOTH_ENABLE = no +BOOTMAGIC_ENABLE = no +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +EXTRAKEY_ENABLE = yes +MIDI_ENABLE = no +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGBLIGHT_ENABLE = no +SLEEP_LED_ENABLE = no +TAP_DANCE_ENABLE = no +UNICODE_ENABLE = yes VISUALIZER_ENABLE = no -- cgit v1.2.3 From ba76fcfb8bbc531213619f2893415c8744b65a47 Mon Sep 17 00:00:00 2001 From: Abhinav Date: Wed, 7 Nov 2018 21:39:29 -0800 Subject: Add Layout-b for GH60 satan (#4123) * Add Layout-b for GH60 satan * Update layout, toggle for colemak layout * Rename layout, replace function with KC_GESC * Update Layer order, Readme * Remove unnecessary code * Add backspace in extend layer --- keyboards/satan/keymaps/abhixec/keymap.c | 76 +++++++++++++++++++++++++++++++ keyboards/satan/keymaps/abhixec/readme.md | 19 ++++++++ keyboards/satan/keymaps/abhixec/rules.mk | 18 ++++++++ keyboards/satan/satan.h | 29 ++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 keyboards/satan/keymaps/abhixec/keymap.c create mode 100644 keyboards/satan/keymaps/abhixec/readme.md create mode 100644 keyboards/satan/keymaps/abhixec/rules.mk diff --git a/keyboards/satan/keymaps/abhixec/keymap.c b/keyboards/satan/keymaps/abhixec/keymap.c new file mode 100644 index 0000000000..59a8c43120 --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + + +// Each layer gets a name for readability, which is then used in the keymap matix 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 +#define _FL 2 +#define _CL 1 +#define _EL 3 + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,-----------------------------------------------------------. + * |Esc~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp | + * |-----------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ | + * |-----------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return | + * |-----------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift| Del| + * |-----------------------------------------------------------| + * |Ctrl|Gui |Alt | Space |Alt |Gui |FN |Ctrl | + * `-----------------------------------------------------------' + */ +[_BL] = LAYOUT_60_ansi_split_rshift( + KC_GESC, 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_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, \ + LT(_EL, KC_BSPC), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), + +/* Keymap _CL: (Colemak Layer) + */ +[_CL] = LAYOUT_60_ansi_split_rshift( + KC_GESC, 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_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, \ + LT(_EL, KC_BSPC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O,KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT, KC_DEL, \ + KC_LCTL, KC_LALT,KC_LGUI, KC_SPC, KC_RALT,KC_RGUI, MO(_FL),KC_RCTL), + +[_EL] = LAYOUT_60_ansi_split_rshift( + + KC_GRV, 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_LCTL,KC_WH_U,_______,_______,KC_MS_U,KC_PGUP,KC_HOME,KC_UP,KC_END,KC_DEL, KC_GESC, _______,_______, \ + _______,KC_LALT,KC_WH_D, KC_LSFT,_______,KC_MS_D,KC_PGDOWN,KC_LEFT,KC_DOWN,KC_RIGHT, KC_BSPC,_______,_______, \ +_______,KC_UNDO,KC_CUT,KC_COPY,KC_PASTE, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2,KC_MS_LEFT,KC_MS_RIGHT,_______,_______, _______, \ + _______,_______,_______, _______, _______,_______,_______,_______), + + + /* Keymap _FL: Function Layer + * ,-----------------------------------------------------------. + * | KC_GRV|F1|F2|F3|F4|F5|F6|F7| F8 | F9 |10|F11|F12| | + * |-----------------------------------------------------------| + * | | | | | | | | | | | |BL-|BL+|BL | + * |-----------------------------------------------------------| + * | | | | | | | | | |HOME| | | + * |-----------------------------------------------------------| + * | | | | | | |V_DWN|V_UP|MUTE | END || |_CL | + * |-----------------------------------------------------------| + * | | | | | | | | | + * `-----------------------------------------------------------' + */ + +[_FL] = LAYOUT_60_ansi_split_rshift( + + KC_GRV, 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_PSCREEN, BL_DEC, BL_INC,BL_TOGG, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_HOME,_______,_______, \ + _______,_______,_______,_______,_______,_______,KC_AUDIO_VOL_DOWN,KC_AUDIO_VOL_UP,KC_AUDIO_MUTE,KC_END,_______,_______, TG(_CL), \ + _______,_______,_______, _______, _______,_______,_______,_______) + +}; + diff --git a/keyboards/satan/keymaps/abhixec/readme.md b/keyboards/satan/keymaps/abhixec/readme.md new file mode 100644 index 0000000000..59a95b7fcf --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/readme.md @@ -0,0 +1,19 @@ +# default Satan GH60 layout + +The layout for this keyboard is: +![Layout-2](https://i.imgur.com/Eqp8hov.jpg) + +Currently there are 3 layers: + +1. Base Layer is qwerty +2. 1st layer is colemak +3. 2nd layer is function layer +4. 3rd layer is extend layer + +How to use the layers: +1. Base is default. If you want Colemak then press function key and del next to the right shift (this combination will be used to toggle the layer on and off) +2. Function layer is accessible by holding down the function key. +3. Extend layer is accsessible by holding down the capslock. + Which when tapped acts like backspace when held triggers the Extend layer capability. + + diff --git a/keyboards/satan/keymaps/abhixec/rules.mk b/keyboards/satan/keymaps/abhixec/rules.mk new file mode 100644 index 0000000000..fdbd25ea80 --- /dev/null +++ b/keyboards/satan/keymaps/abhixec/rules.mk @@ -0,0 +1,18 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 + diff --git a/keyboards/satan/satan.h b/keyboards/satan/satan.h index 0d9dd96a11..a2a5984601 100644 --- a/keyboards/satan/satan.h +++ b/keyboards/satan/satan.h @@ -36,6 +36,35 @@ {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, k49, k4a, k4b, k4c, k4d} \ } + +/* Satan GH60 ANSI layout-B + * ,-----------------------------------------------------------. + * | 00| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | + * |-----------------------------------------------------------| + * | 10 | 11| 12| 13| 14| 15| 16| 17| 18| 19| 1a| 1b| 1c| 1d | + * |-----------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 25| 26| 27| 28| 29| 2a| 2b| 2d | + * |-----------------------------------------------------------| + * | 30 | 32| 33| 34| 35| 36| 37| 38| 39| 3a| 3b| 3d | 3c | + * |-----------------------------------------------------------| + * | 40 | 41 | 42 | 45 | 4a | 4b | 4c | 4d | + * `-----------------------------------------------------------' + */ +#define LAYOUT_60_ansi_split_rshift( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3c, \ + k40, k41, k42, k45, k4a, k4b, k4c, k4d \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d}, \ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d}, \ + {k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, XXX, k2d}, \ + {k30, XXX, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, k3d}, \ + {k40, k41, k42, XXX, XXX, k45, XXX, XXX, XXX, XXX, k4a, k4b, k4c, k4d} \ +} + /* Satan GH60 ANSI layout * ,-----------------------------------------------------------. * | 00| 01| 02| 03| 04| 05| 06| 07| 08| 09| 0a| 0b| 0c| 0d | -- cgit v1.2.3 From 5eb69ca224f3d4233860a658e6a27516d86c4de7 Mon Sep 17 00:00:00 2001 From: Ryoichi KATO Date: Wed, 7 Nov 2018 23:04:02 -0800 Subject: Keyboard: fix ifdef for crkbd's default/keymap.c undef SSD1306OLED should not kill entire process_record_user() function. --- keyboards/crkbd/keymaps/default/keymap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c index e92fbdebfa..c7c9582e83 100644 --- a/keyboards/crkbd/keymaps/default/keymap.c +++ b/keyboards/crkbd/keymaps/default/keymap.c @@ -179,10 +179,13 @@ void iota_gfx_task_user(void) { matrix_render_user(&matrix); matrix_update(&display, &matrix); } +#endif//SSD1306OLED bool process_record_user(uint16_t keycode, keyrecord_t *record) { if (record->event.pressed) { +#ifdef SSD1306OLED set_keylog(keycode, record); +#endif // set_timelog(); } @@ -244,4 +247,3 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } -#endif -- cgit v1.2.3 From ef84bd979979f092980dc68d513a906e084c8c57 Mon Sep 17 00:00:00 2001 From: Filip Sund Date: Fri, 9 Nov 2018 00:12:42 +0100 Subject: Keyboard: Add 30wer config and keymap (#4386) * Preliminary 30wer firmware. Not tested on real board yet. * Added a layer to default 30wer keymap. * Wrote readme for 30wer. * Added 30wer info.json. --- keyboards/30wer/30wer.c | 1 + keyboards/30wer/30wer.h | 14 ++++++++ keyboards/30wer/config.h | 31 +++++++++++++++++ keyboards/30wer/info.json | 51 +++++++++++++++++++++++++++ keyboards/30wer/keymaps/default/keymap.c | 17 +++++++++ keyboards/30wer/readme.md | 16 +++++++++ keyboards/30wer/rules.mk | 60 ++++++++++++++++++++++++++++++++ 7 files changed, 190 insertions(+) create mode 100644 keyboards/30wer/30wer.c create mode 100644 keyboards/30wer/30wer.h create mode 100644 keyboards/30wer/config.h create mode 100644 keyboards/30wer/info.json create mode 100644 keyboards/30wer/keymaps/default/keymap.c create mode 100644 keyboards/30wer/readme.md create mode 100644 keyboards/30wer/rules.mk diff --git a/keyboards/30wer/30wer.c b/keyboards/30wer/30wer.c new file mode 100644 index 0000000000..a46c543196 --- /dev/null +++ b/keyboards/30wer/30wer.c @@ -0,0 +1 @@ +#include "30wer.h" diff --git a/keyboards/30wer/30wer.h b/keyboards/30wer/30wer.h new file mode 100644 index 0000000000..e7bce82776 --- /dev/null +++ b/keyboards/30wer/30wer.h @@ -0,0 +1,14 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b } \ +} diff --git a/keyboards/30wer/config.h b/keyboards/30wer/config.h new file mode 100644 index 0000000000..d497585246 --- /dev/null +++ b/keyboards/30wer/config.h @@ -0,0 +1,31 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x1234 +#define PRODUCT_ID 0x5678 +#define DEVICE_VER 0x0000 +#define MANUFACTURER 8o7wer +#define PRODUCT 30wer +#define DESCRIPTION Gherkin style construction 30% staggered pcb kit + +/* key matrix size */ +#define MATRIX_ROWS 3 +#define MATRIX_COLS 13 + +/* pcb default pin-out */ +#define MATRIX_ROW_PINS { E6, B4, B5 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D1, D0, D4, C6, D7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +#define PREVENT_STUCK_MODIFIERS diff --git a/keyboards/30wer/info.json b/keyboards/30wer/info.json new file mode 100644 index 0000000000..0fbbeb47dd --- /dev/null +++ b/keyboards/30wer/info.json @@ -0,0 +1,51 @@ +{ + "keyboard_name": "30wer", + "url": "", + "maintainer": "qmk", + "width": 13.25, + "height": 3, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Tab", "x":0, "y":0}, + {"label":"Q", "x":1, "y":0}, + {"label":"W", "x":2, "y":0}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0}, + {"label":"T", "x":5, "y":0}, + {"label":"Y", "x":6, "y":0}, + {"label":"U", "x":7, "y":0}, + {"label":"I", "x":8, "y":0}, + {"label":"O", "x":9, "y":0}, + {"label":"P", "x":10, "y":0}, + {"label":"Bksp", "x":11, "y":0}, + {"label":"Delete", "x":12, "y":0, "w":1.25}, + {"label":"Ctrl", "x":0, "y":1, "w":1.25}, + {"label":"A", "x":1.25, "y":1}, + {"label":"S", "x":2.25, "y":1}, + {"label":"D", "x":3.25, "y":1}, + {"label":"F", "x":4.25, "y":1}, + {"label":"G", "x":5.25, "y":1}, + {"label":"H", "x":6.25, "y":1}, + {"label":"J", "x":7.25, "y":1}, + {"label":"K", "x":8.25, "y":1}, + {"label":"L", "x":9.25, "y":1}, + {"label":":", "x":10.25, "y":1}, + {"label":"\"", "x":11.25, "y":1}, + {"label":"Enter", "x":12.25, "y":1}, + {"label":"Shift", "x":0, "y":2, "w":1.75}, + {"label":"Z", "x":1.75, "y":2}, + {"label":"X", "x":2.75, "y":2}, + {"label":"C", "x":3.75, "y":2}, + {"label":"V", "x":4.75, "y":2}, + {"label":"B", "x":5.75, "y":2}, + {"label":"N", "x":6.75, "y":2}, + {"label":"M", "x":7.75, "y":2}, + {"label":"<", "x":8.75, "y":2}, + {"label":">", "x":9.75, "y":2}, + {"label":"?", "x":10.75, "y":2}, + {"label":"Space", "x":11.75, "y":2, "w":1.5} + ] + } + } +} diff --git a/keyboards/30wer/keymaps/default/keymap.c b/keyboards/30wer/keymaps/default/keymap.c new file mode 100644 index 0000000000..9e39a500a3 --- /dev/null +++ b/keyboards/30wer/keymaps/default/keymap.c @@ -0,0 +1,17 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[0] = LAYOUT( \ + 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_BSPC, \ + KC_LCTL, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT(1, KC_SPC) \ +), + +[1] = LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_UP, KC_DEL, \ + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_LEFT, KC_RGHT, _______, \ + KC_LALT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DOWN, _______ \ +), + +}; diff --git a/keyboards/30wer/readme.md b/keyboards/30wer/readme.md new file mode 100644 index 0000000000..c9184f726b --- /dev/null +++ b/keyboards/30wer/readme.md @@ -0,0 +1,16 @@ +30wer by 8o7wer +=== + +![30wer](https://i.imgur.com/ZYbRvY7.png) + +Keyboard Maintainer: [Filip Sund](https://github.com/FSund) +Hardware Supported: Pro Micro +Hardware Availability: Group buy + +More info in the [group by thread at Keebtalk](https://www.keebtalk.com/t/gb-30wer-by-8o7wer/3618/). + +Make example for this keyboard (after setting up your build environment): + + make 30wer: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). \ No newline at end of file diff --git a/keyboards/30wer/rules.mk b/keyboards/30wer/rules.mk new file mode 100644 index 0000000000..9d77ec5461 --- /dev/null +++ b/keyboards/30wer/rules.mk @@ -0,0 +1,60 @@ +# MCU name +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 +# 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 = caterina + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +AUDIO_ENABLE = no # Audio output +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -- cgit v1.2.3 From 73883425a55f23a319eb1522c2e3ce52b8e2f042 Mon Sep 17 00:00:00 2001 From: zvecr Date: Thu, 8 Nov 2018 23:17:41 +0000 Subject: relocate 40percent.club boards to new parent folder (#4380) * Initial move of 40percent.club boards to common parent folder. * Refactor readme files to be consistent * Refactor readme files to be consistent - fix make command examples. * Refactor readme files to be consistent - align readme filenames. * Refactor readme files to be consistent - fix repo url. * Disable Community keymap builds as they are currently failing due to missing functionality * Move more of 40percent.club boards to common parent folder. * Refactor readme files to be consistent - align readme filenames. * Refactor readme files to be consistent - fix make command examples. --- keyboards/40percentclub/4x4/4x4.c | 29 ++ keyboards/40percentclub/4x4/4x4.h | 62 +++ keyboards/40percentclub/4x4/config.h | 202 ++++++++++ .../40percentclub/4x4/keymaps/default/config.h | 5 + .../40percentclub/4x4/keymaps/default/keymap.c | 124 ++++++ keyboards/40percentclub/4x4/readme.md | 24 ++ keyboards/40percentclub/4x4/rules.mk | 74 ++++ keyboards/40percentclub/5x5/5x5.c | 29 ++ keyboards/40percentclub/5x5/5x5.h | 57 +++ keyboards/40percentclub/5x5/config.h | 208 ++++++++++ .../40percentclub/5x5/keymaps/default/config.h | 5 + .../40percentclub/5x5/keymaps/default/keymap.c | 139 +++++++ keyboards/40percentclub/5x5/readme.md | 24 ++ keyboards/40percentclub/5x5/rules.mk | 74 ++++ keyboards/40percentclub/6lit/6lit.c | 53 +++ keyboards/40percentclub/6lit/6lit.h | 55 +++ keyboards/40percentclub/6lit/config.h | 230 +++++++++++ keyboards/40percentclub/6lit/info.json | 23 ++ .../40percentclub/6lit/keymaps/default/config.h | 19 + .../40percentclub/6lit/keymaps/default/keymap.c | 39 ++ .../40percentclub/6lit/keymaps/default/readme.md | 1 + .../40percentclub/6lit/keymaps/macro/config.h | 19 + .../40percentclub/6lit/keymaps/macro/keymap.c | 39 ++ .../40percentclub/6lit/keymaps/macro/readme.md | 1 + keyboards/40percentclub/6lit/readme.md | 18 + keyboards/40percentclub/6lit/rules.mk | 83 ++++ keyboards/40percentclub/foobar/config.h | 230 +++++++++++ keyboards/40percentclub/foobar/foobar.c | 55 +++ keyboards/40percentclub/foobar/foobar.h | 66 ++++ keyboards/40percentclub/foobar/info.json | 25 ++ .../40percentclub/foobar/keymaps/default/config.h | 19 + .../40percentclub/foobar/keymaps/default/keymap.c | 49 +++ .../40percentclub/foobar/keymaps/default/readme.md | 1 + .../40percentclub/foobar/keymaps/macro/config.h | 19 + .../40percentclub/foobar/keymaps/macro/keymap.c | 40 ++ .../40percentclub/foobar/keymaps/macro/readme.md | 1 + keyboards/40percentclub/foobar/readme.md | 18 + keyboards/40percentclub/foobar/rules.mk | 83 ++++ keyboards/40percentclub/gherkin/config.h | 54 +++ keyboards/40percentclub/gherkin/gherkin.c | 1 + keyboards/40percentclub/gherkin/gherkin.h | 18 + keyboards/40percentclub/gherkin/info.json | 13 + .../gherkin/keymaps/bbaserdem/README.md | 11 + .../gherkin/keymaps/bbaserdem/config.h | 13 + .../gherkin/keymaps/bbaserdem/keymap.c | 36 ++ .../gherkin/keymaps/bbaserdem/rules.mk | 17 + .../40percentclub/gherkin/keymaps/default/keymap.c | 74 ++++ .../gherkin/keymaps/itsaferbie/config.h | 15 + .../gherkin/keymaps/itsaferbie/keymap.c | 152 ++++++++ .../gherkin/keymaps/itsaferbie/rules.mk | 7 + .../40percentclub/gherkin/keymaps/mjt/config.h | 169 +++++++++ .../40percentclub/gherkin/keymaps/mjt/keymap.c | 279 ++++++++++++++ .../40percentclub/gherkin/keymaps/mjt/rules.mk | 29 ++ .../40percentclub/gherkin/keymaps/steno/config.h | 12 + .../40percentclub/gherkin/keymaps/steno/keymap.c | 13 + .../40percentclub/gherkin/keymaps/steno/readme.md | 9 + .../40percentclub/gherkin/keymaps/steno/rules.mk | 16 + .../gherkin/keymaps/talljoe-gherkin/config.h | 6 + .../gherkin/keymaps/talljoe-gherkin/keymap.c | 58 +++ .../gherkin/keymaps/talljoe-gherkin/rules.mk | 6 + keyboards/40percentclub/gherkin/readme.md | 21 ++ keyboards/40percentclub/gherkin/rules.mk | 59 +++ keyboards/40percentclub/luddite/config.h | 48 +++ .../40percentclub/luddite/keymaps/default/keymap.c | 32 ++ keyboards/40percentclub/luddite/luddite.c | 1 + keyboards/40percentclub/luddite/luddite.h | 21 ++ keyboards/40percentclub/luddite/readme.md | 21 ++ keyboards/40percentclub/luddite/rules.mk | 59 +++ keyboards/40percentclub/mf68/config.h | 162 ++++++++ keyboards/40percentclub/mf68/info.json | 12 + .../40percentclub/mf68/keymaps/default/keymap.c | 68 ++++ .../40percentclub/mf68/keymaps/factory/keymap.c | 74 ++++ keyboards/40percentclub/mf68/mf68.c | 8 + keyboards/40percentclub/mf68/mf68.h | 40 ++ keyboards/40percentclub/mf68/readme.md | 18 + keyboards/40percentclub/mf68/rules.mk | 68 ++++ keyboards/40percentclub/mf68_ble/config.h | 162 ++++++++ keyboards/40percentclub/mf68_ble/info.json | 12 + .../mf68_ble/keymaps/default/keymap.c | 68 ++++ keyboards/40percentclub/mf68_ble/mf68_ble.c | 8 + keyboards/40percentclub/mf68_ble/mf68_ble.h | 40 ++ keyboards/40percentclub/mf68_ble/readme.md | 29 ++ keyboards/40percentclub/mf68_ble/rules.mk | 67 ++++ keyboards/40percentclub/nano/config.h | 45 +++ keyboards/40percentclub/nano/info.json | 12 + .../40percentclub/nano/keymaps/default/keymap.c | 19 + .../40percentclub/nano/keymaps/default/rules.mk | 0 .../40percentclub/nano/keymaps/spooka/config.h | 25 ++ .../40percentclub/nano/keymaps/spooka/keymap.c | 12 + .../40percentclub/nano/keymaps/spooka/rules.mk | 1 + keyboards/40percentclub/nano/matrix.c | 159 ++++++++ keyboards/40percentclub/nano/nano.c | 5 + keyboards/40percentclub/nano/nano.h | 14 + keyboards/40percentclub/nano/readme.md | 16 + keyboards/40percentclub/nano/rules.mk | 70 ++++ keyboards/40percentclub/readme.md | 4 + keyboards/40percentclub/tomato/config.h | 48 +++ keyboards/40percentclub/tomato/info.json | 13 + .../40percentclub/tomato/keymaps/default/keymap.c | 158 ++++++++ keyboards/40percentclub/tomato/readme.md | 22 ++ keyboards/40percentclub/tomato/rules.mk | 58 +++ keyboards/40percentclub/tomato/tomato.c | 1 + keyboards/40percentclub/tomato/tomato.h | 18 + keyboards/40percentclub/ut47/LED_controls.ino | 420 +++++++++++++++++++++ keyboards/40percentclub/ut47/config.h | 87 +++++ keyboards/40percentclub/ut47/info.json | 13 + .../40percentclub/ut47/keymaps/default/config.h | 24 ++ .../40percentclub/ut47/keymaps/default/keymap.c | 136 +++++++ .../40percentclub/ut47/keymaps/default/readme.md | 19 + .../40percentclub/ut47/keymaps/non-us/config.h | 24 ++ .../40percentclub/ut47/keymaps/non-us/keymap.c | 136 +++++++ .../40percentclub/ut47/keymaps/non-us/readme.md | 19 + .../40percentclub/ut47/keymaps/nordic/config.h | 17 + .../40percentclub/ut47/keymaps/nordic/keymap.c | 179 +++++++++ .../40percentclub/ut47/keymaps/nordic/readme.md | 33 ++ keyboards/40percentclub/ut47/keymaps/rgb/config.h | 27 ++ keyboards/40percentclub/ut47/keymaps/rgb/keymap.c | 88 +++++ keyboards/40percentclub/ut47/keymaps/rgb/readme.md | 1 + keyboards/40percentclub/ut47/keymaps/rgb/rules.mk | 1 + keyboards/40percentclub/ut47/led.c | 38 ++ keyboards/40percentclub/ut47/matrix.c | 213 +++++++++++ keyboards/40percentclub/ut47/readme.md | 40 ++ keyboards/40percentclub/ut47/rules.mk | 70 ++++ keyboards/40percentclub/ut47/ut47.c | 50 +++ keyboards/40percentclub/ut47/ut47.h | 49 +++ keyboards/4x4/4x4.c | 29 -- keyboards/4x4/4x4.h | 62 --- keyboards/4x4/config.h | 202 ---------- keyboards/4x4/keymaps/default/config.h | 5 - keyboards/4x4/keymaps/default/keymap.c | 124 ------ keyboards/4x4/readme.md | 23 -- keyboards/4x4/rules.mk | 74 ---- keyboards/5x5/5x5.c | 29 -- keyboards/5x5/5x5.h | 57 --- keyboards/5x5/config.h | 208 ---------- keyboards/5x5/keymaps/default/config.h | 5 - keyboards/5x5/keymaps/default/keymap.c | 139 ------- keyboards/5x5/readme.md | 23 -- keyboards/5x5/rules.mk | 74 ---- keyboards/6lit/6lit.c | 53 --- keyboards/6lit/6lit.h | 55 --- keyboards/6lit/config.h | 230 ----------- keyboards/6lit/info.json | 23 -- keyboards/6lit/keymaps/default/config.h | 19 - keyboards/6lit/keymaps/default/keymap.c | 39 -- keyboards/6lit/keymaps/default/readme.md | 1 - keyboards/6lit/keymaps/macro/config.h | 19 - keyboards/6lit/keymaps/macro/keymap.c | 39 -- keyboards/6lit/keymaps/macro/readme.md | 1 - keyboards/6lit/readme.md | 17 - keyboards/6lit/rules.mk | 83 ---- keyboards/foobar/config.h | 230 ----------- keyboards/foobar/foobar.c | 55 --- keyboards/foobar/foobar.h | 66 ---- keyboards/foobar/info.json | 25 -- keyboards/foobar/keymaps/default/config.h | 19 - keyboards/foobar/keymaps/default/keymap.c | 49 --- keyboards/foobar/keymaps/default/readme.md | 1 - keyboards/foobar/keymaps/macro/config.h | 19 - keyboards/foobar/keymaps/macro/keymap.c | 40 -- keyboards/foobar/keymaps/macro/readme.md | 1 - keyboards/foobar/readme.md | 17 - keyboards/foobar/rules.mk | 83 ---- keyboards/gherkin/README.md | 18 - keyboards/gherkin/config.h | 54 --- keyboards/gherkin/gherkin.c | 1 - keyboards/gherkin/gherkin.h | 18 - keyboards/gherkin/info.json | 13 - keyboards/gherkin/keymaps/bbaserdem/README.md | 11 - keyboards/gherkin/keymaps/bbaserdem/config.h | 13 - keyboards/gherkin/keymaps/bbaserdem/keymap.c | 36 -- keyboards/gherkin/keymaps/bbaserdem/rules.mk | 17 - keyboards/gherkin/keymaps/default/keymap.c | 74 ---- keyboards/gherkin/keymaps/itsaferbie/config.h | 15 - keyboards/gherkin/keymaps/itsaferbie/keymap.c | 152 -------- keyboards/gherkin/keymaps/itsaferbie/rules.mk | 7 - keyboards/gherkin/keymaps/mjt/config.h | 169 --------- keyboards/gherkin/keymaps/mjt/keymap.c | 279 -------------- keyboards/gherkin/keymaps/mjt/rules.mk | 29 -- keyboards/gherkin/keymaps/steno/config.h | 12 - keyboards/gherkin/keymaps/steno/keymap.c | 13 - keyboards/gherkin/keymaps/steno/readme.md | 9 - keyboards/gherkin/keymaps/steno/rules.mk | 16 - keyboards/gherkin/keymaps/talljoe-gherkin/config.h | 6 - keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c | 58 --- keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk | 6 - keyboards/gherkin/rules.mk | 59 --- keyboards/luddite/README.md | 18 - keyboards/luddite/config.h | 48 --- keyboards/luddite/keymaps/default/keymap.c | 32 -- keyboards/luddite/luddite.c | 1 - keyboards/luddite/luddite.h | 21 -- keyboards/luddite/rules.mk | 59 --- keyboards/mf68/README.md | 18 - keyboards/mf68/config.h | 162 -------- keyboards/mf68/info.json | 12 - keyboards/mf68/keymaps/default/keymap.c | 68 ---- keyboards/mf68/keymaps/factory/keymap.c | 74 ---- keyboards/mf68/mf68.c | 8 - keyboards/mf68/mf68.h | 40 -- keyboards/mf68/rules.mk | 68 ---- keyboards/mf68_ble/README.md | 27 -- keyboards/mf68_ble/config.h | 162 -------- keyboards/mf68_ble/info.json | 12 - keyboards/mf68_ble/keymaps/default/keymap.c | 68 ---- keyboards/mf68_ble/mf68_ble.c | 8 - keyboards/mf68_ble/mf68_ble.h | 40 -- keyboards/mf68_ble/rules.mk | 67 ---- keyboards/nano/config.h | 45 --- keyboards/nano/info.json | 12 - keyboards/nano/keymaps/default/keymap.c | 19 - keyboards/nano/keymaps/default/rules.mk | 0 keyboards/nano/keymaps/spooka/config.h | 25 -- keyboards/nano/keymaps/spooka/keymap.c | 12 - keyboards/nano/keymaps/spooka/rules.mk | 1 - keyboards/nano/matrix.c | 159 -------- keyboards/nano/nano.c | 5 - keyboards/nano/nano.h | 14 - keyboards/nano/readme.md | 14 - keyboards/nano/rules.mk | 70 ---- keyboards/tomato/config.h | 48 --- keyboards/tomato/info.json | 13 - keyboards/tomato/keymaps/default/keymap.c | 158 -------- keyboards/tomato/readme.md | 20 - keyboards/tomato/rules.mk | 58 --- keyboards/tomato/tomato.c | 1 - keyboards/tomato/tomato.h | 18 - keyboards/ut47/LED_controls.ino | 420 --------------------- keyboards/ut47/config.h | 87 ----- keyboards/ut47/info.json | 13 - keyboards/ut47/keymaps/default/config.h | 24 -- keyboards/ut47/keymaps/default/keymap.c | 136 ------- keyboards/ut47/keymaps/default/readme.md | 19 - keyboards/ut47/keymaps/non-us/config.h | 24 -- keyboards/ut47/keymaps/non-us/keymap.c | 136 ------- keyboards/ut47/keymaps/non-us/readme.md | 19 - keyboards/ut47/keymaps/nordic/config.h | 17 - keyboards/ut47/keymaps/nordic/keymap.c | 179 --------- keyboards/ut47/keymaps/nordic/readme.md | 33 -- keyboards/ut47/keymaps/rgb/config.h | 27 -- keyboards/ut47/keymaps/rgb/keymap.c | 88 ----- keyboards/ut47/keymaps/rgb/readme.md | 1 - keyboards/ut47/keymaps/rgb/rules.mk | 1 - keyboards/ut47/led.c | 38 -- keyboards/ut47/matrix.c | 213 ----------- keyboards/ut47/readme.md | 39 -- keyboards/ut47/rules.mk | 70 ---- keyboards/ut47/ut47.c | 50 --- keyboards/ut47/ut47.h | 49 --- 249 files changed, 6732 insertions(+), 6711 deletions(-) create mode 100644 keyboards/40percentclub/4x4/4x4.c create mode 100644 keyboards/40percentclub/4x4/4x4.h create mode 100644 keyboards/40percentclub/4x4/config.h create mode 100644 keyboards/40percentclub/4x4/keymaps/default/config.h create mode 100644 keyboards/40percentclub/4x4/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/4x4/readme.md create mode 100644 keyboards/40percentclub/4x4/rules.mk create mode 100644 keyboards/40percentclub/5x5/5x5.c create mode 100644 keyboards/40percentclub/5x5/5x5.h create mode 100644 keyboards/40percentclub/5x5/config.h create mode 100644 keyboards/40percentclub/5x5/keymaps/default/config.h create mode 100644 keyboards/40percentclub/5x5/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/5x5/readme.md create mode 100644 keyboards/40percentclub/5x5/rules.mk create mode 100644 keyboards/40percentclub/6lit/6lit.c create mode 100644 keyboards/40percentclub/6lit/6lit.h create mode 100644 keyboards/40percentclub/6lit/config.h create mode 100644 keyboards/40percentclub/6lit/info.json create mode 100644 keyboards/40percentclub/6lit/keymaps/default/config.h create mode 100644 keyboards/40percentclub/6lit/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/6lit/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/6lit/keymaps/macro/config.h create mode 100644 keyboards/40percentclub/6lit/keymaps/macro/keymap.c create mode 100644 keyboards/40percentclub/6lit/keymaps/macro/readme.md create mode 100644 keyboards/40percentclub/6lit/readme.md create mode 100644 keyboards/40percentclub/6lit/rules.mk create mode 100644 keyboards/40percentclub/foobar/config.h create mode 100644 keyboards/40percentclub/foobar/foobar.c create mode 100644 keyboards/40percentclub/foobar/foobar.h create mode 100644 keyboards/40percentclub/foobar/info.json create mode 100644 keyboards/40percentclub/foobar/keymaps/default/config.h create mode 100644 keyboards/40percentclub/foobar/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/foobar/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/foobar/keymaps/macro/config.h create mode 100644 keyboards/40percentclub/foobar/keymaps/macro/keymap.c create mode 100644 keyboards/40percentclub/foobar/keymaps/macro/readme.md create mode 100644 keyboards/40percentclub/foobar/readme.md create mode 100644 keyboards/40percentclub/foobar/rules.mk create mode 100644 keyboards/40percentclub/gherkin/config.h create mode 100644 keyboards/40percentclub/gherkin/gherkin.c create mode 100644 keyboards/40percentclub/gherkin/gherkin.h create mode 100644 keyboards/40percentclub/gherkin/info.json create mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md create mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h create mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk create mode 100644 keyboards/40percentclub/gherkin/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h create mode 100644 keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk create mode 100644 keyboards/40percentclub/gherkin/keymaps/mjt/config.h create mode 100644 keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk create mode 100644 keyboards/40percentclub/gherkin/keymaps/steno/config.h create mode 100644 keyboards/40percentclub/gherkin/keymaps/steno/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/steno/readme.md create mode 100644 keyboards/40percentclub/gherkin/keymaps/steno/rules.mk create mode 100644 keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h create mode 100644 keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c create mode 100644 keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk create mode 100644 keyboards/40percentclub/gherkin/readme.md create mode 100644 keyboards/40percentclub/gherkin/rules.mk create mode 100644 keyboards/40percentclub/luddite/config.h create mode 100644 keyboards/40percentclub/luddite/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/luddite/luddite.c create mode 100644 keyboards/40percentclub/luddite/luddite.h create mode 100644 keyboards/40percentclub/luddite/readme.md create mode 100644 keyboards/40percentclub/luddite/rules.mk create mode 100644 keyboards/40percentclub/mf68/config.h create mode 100644 keyboards/40percentclub/mf68/info.json create mode 100644 keyboards/40percentclub/mf68/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/mf68/keymaps/factory/keymap.c create mode 100644 keyboards/40percentclub/mf68/mf68.c create mode 100644 keyboards/40percentclub/mf68/mf68.h create mode 100644 keyboards/40percentclub/mf68/readme.md create mode 100644 keyboards/40percentclub/mf68/rules.mk create mode 100644 keyboards/40percentclub/mf68_ble/config.h create mode 100644 keyboards/40percentclub/mf68_ble/info.json create mode 100644 keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/mf68_ble/mf68_ble.c create mode 100644 keyboards/40percentclub/mf68_ble/mf68_ble.h create mode 100644 keyboards/40percentclub/mf68_ble/readme.md create mode 100644 keyboards/40percentclub/mf68_ble/rules.mk create mode 100644 keyboards/40percentclub/nano/config.h create mode 100644 keyboards/40percentclub/nano/info.json create mode 100644 keyboards/40percentclub/nano/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/nano/keymaps/default/rules.mk create mode 100644 keyboards/40percentclub/nano/keymaps/spooka/config.h create mode 100644 keyboards/40percentclub/nano/keymaps/spooka/keymap.c create mode 100644 keyboards/40percentclub/nano/keymaps/spooka/rules.mk create mode 100644 keyboards/40percentclub/nano/matrix.c create mode 100644 keyboards/40percentclub/nano/nano.c create mode 100644 keyboards/40percentclub/nano/nano.h create mode 100644 keyboards/40percentclub/nano/readme.md create mode 100644 keyboards/40percentclub/nano/rules.mk create mode 100644 keyboards/40percentclub/readme.md create mode 100644 keyboards/40percentclub/tomato/config.h create mode 100644 keyboards/40percentclub/tomato/info.json create mode 100644 keyboards/40percentclub/tomato/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/tomato/readme.md create mode 100644 keyboards/40percentclub/tomato/rules.mk create mode 100644 keyboards/40percentclub/tomato/tomato.c create mode 100644 keyboards/40percentclub/tomato/tomato.h create mode 100644 keyboards/40percentclub/ut47/LED_controls.ino create mode 100644 keyboards/40percentclub/ut47/config.h create mode 100644 keyboards/40percentclub/ut47/info.json create mode 100644 keyboards/40percentclub/ut47/keymaps/default/config.h create mode 100644 keyboards/40percentclub/ut47/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/ut47/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/ut47/keymaps/non-us/config.h create mode 100644 keyboards/40percentclub/ut47/keymaps/non-us/keymap.c create mode 100644 keyboards/40percentclub/ut47/keymaps/non-us/readme.md create mode 100644 keyboards/40percentclub/ut47/keymaps/nordic/config.h create mode 100644 keyboards/40percentclub/ut47/keymaps/nordic/keymap.c create mode 100644 keyboards/40percentclub/ut47/keymaps/nordic/readme.md create mode 100644 keyboards/40percentclub/ut47/keymaps/rgb/config.h create mode 100644 keyboards/40percentclub/ut47/keymaps/rgb/keymap.c create mode 100644 keyboards/40percentclub/ut47/keymaps/rgb/readme.md create mode 100644 keyboards/40percentclub/ut47/keymaps/rgb/rules.mk create mode 100644 keyboards/40percentclub/ut47/led.c create mode 100644 keyboards/40percentclub/ut47/matrix.c create mode 100644 keyboards/40percentclub/ut47/readme.md create mode 100644 keyboards/40percentclub/ut47/rules.mk create mode 100644 keyboards/40percentclub/ut47/ut47.c create mode 100644 keyboards/40percentclub/ut47/ut47.h delete mode 100644 keyboards/4x4/4x4.c delete mode 100644 keyboards/4x4/4x4.h delete mode 100644 keyboards/4x4/config.h delete mode 100644 keyboards/4x4/keymaps/default/config.h delete mode 100644 keyboards/4x4/keymaps/default/keymap.c delete mode 100644 keyboards/4x4/readme.md delete mode 100644 keyboards/4x4/rules.mk delete mode 100644 keyboards/5x5/5x5.c delete mode 100644 keyboards/5x5/5x5.h delete mode 100644 keyboards/5x5/config.h delete mode 100644 keyboards/5x5/keymaps/default/config.h delete mode 100644 keyboards/5x5/keymaps/default/keymap.c delete mode 100644 keyboards/5x5/readme.md delete mode 100644 keyboards/5x5/rules.mk delete mode 100644 keyboards/6lit/6lit.c delete mode 100644 keyboards/6lit/6lit.h delete mode 100644 keyboards/6lit/config.h delete mode 100644 keyboards/6lit/info.json delete mode 100644 keyboards/6lit/keymaps/default/config.h delete mode 100644 keyboards/6lit/keymaps/default/keymap.c delete mode 100644 keyboards/6lit/keymaps/default/readme.md delete mode 100644 keyboards/6lit/keymaps/macro/config.h delete mode 100644 keyboards/6lit/keymaps/macro/keymap.c delete mode 100644 keyboards/6lit/keymaps/macro/readme.md delete mode 100644 keyboards/6lit/readme.md delete mode 100644 keyboards/6lit/rules.mk delete mode 100644 keyboards/foobar/config.h delete mode 100644 keyboards/foobar/foobar.c delete mode 100644 keyboards/foobar/foobar.h delete mode 100644 keyboards/foobar/info.json delete mode 100644 keyboards/foobar/keymaps/default/config.h delete mode 100644 keyboards/foobar/keymaps/default/keymap.c delete mode 100644 keyboards/foobar/keymaps/default/readme.md delete mode 100644 keyboards/foobar/keymaps/macro/config.h delete mode 100644 keyboards/foobar/keymaps/macro/keymap.c delete mode 100644 keyboards/foobar/keymaps/macro/readme.md delete mode 100644 keyboards/foobar/readme.md delete mode 100644 keyboards/foobar/rules.mk delete mode 100644 keyboards/gherkin/README.md delete mode 100644 keyboards/gherkin/config.h delete mode 100644 keyboards/gherkin/gherkin.c delete mode 100644 keyboards/gherkin/gherkin.h delete mode 100644 keyboards/gherkin/info.json delete mode 100644 keyboards/gherkin/keymaps/bbaserdem/README.md delete mode 100644 keyboards/gherkin/keymaps/bbaserdem/config.h delete mode 100644 keyboards/gherkin/keymaps/bbaserdem/keymap.c delete mode 100644 keyboards/gherkin/keymaps/bbaserdem/rules.mk delete mode 100644 keyboards/gherkin/keymaps/default/keymap.c delete mode 100644 keyboards/gherkin/keymaps/itsaferbie/config.h delete mode 100644 keyboards/gherkin/keymaps/itsaferbie/keymap.c delete mode 100644 keyboards/gherkin/keymaps/itsaferbie/rules.mk delete mode 100644 keyboards/gherkin/keymaps/mjt/config.h delete mode 100644 keyboards/gherkin/keymaps/mjt/keymap.c delete mode 100644 keyboards/gherkin/keymaps/mjt/rules.mk delete mode 100644 keyboards/gherkin/keymaps/steno/config.h delete mode 100644 keyboards/gherkin/keymaps/steno/keymap.c delete mode 100644 keyboards/gherkin/keymaps/steno/readme.md delete mode 100644 keyboards/gherkin/keymaps/steno/rules.mk delete mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/config.h delete mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c delete mode 100644 keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk delete mode 100644 keyboards/gherkin/rules.mk delete mode 100644 keyboards/luddite/README.md delete mode 100644 keyboards/luddite/config.h delete mode 100644 keyboards/luddite/keymaps/default/keymap.c delete mode 100644 keyboards/luddite/luddite.c delete mode 100644 keyboards/luddite/luddite.h delete mode 100644 keyboards/luddite/rules.mk delete mode 100644 keyboards/mf68/README.md delete mode 100644 keyboards/mf68/config.h delete mode 100644 keyboards/mf68/info.json delete mode 100644 keyboards/mf68/keymaps/default/keymap.c delete mode 100644 keyboards/mf68/keymaps/factory/keymap.c delete mode 100644 keyboards/mf68/mf68.c delete mode 100644 keyboards/mf68/mf68.h delete mode 100644 keyboards/mf68/rules.mk delete mode 100644 keyboards/mf68_ble/README.md delete mode 100644 keyboards/mf68_ble/config.h delete mode 100644 keyboards/mf68_ble/info.json delete mode 100644 keyboards/mf68_ble/keymaps/default/keymap.c delete mode 100644 keyboards/mf68_ble/mf68_ble.c delete mode 100644 keyboards/mf68_ble/mf68_ble.h delete mode 100644 keyboards/mf68_ble/rules.mk delete mode 100644 keyboards/nano/config.h delete mode 100644 keyboards/nano/info.json delete mode 100644 keyboards/nano/keymaps/default/keymap.c delete mode 100644 keyboards/nano/keymaps/default/rules.mk delete mode 100644 keyboards/nano/keymaps/spooka/config.h delete mode 100644 keyboards/nano/keymaps/spooka/keymap.c delete mode 100644 keyboards/nano/keymaps/spooka/rules.mk delete mode 100644 keyboards/nano/matrix.c delete mode 100644 keyboards/nano/nano.c delete mode 100644 keyboards/nano/nano.h delete mode 100644 keyboards/nano/readme.md delete mode 100644 keyboards/nano/rules.mk delete mode 100644 keyboards/tomato/config.h delete mode 100644 keyboards/tomato/info.json delete mode 100644 keyboards/tomato/keymaps/default/keymap.c delete mode 100644 keyboards/tomato/readme.md delete mode 100644 keyboards/tomato/rules.mk delete mode 100644 keyboards/tomato/tomato.c delete mode 100644 keyboards/tomato/tomato.h delete mode 100644 keyboards/ut47/LED_controls.ino delete mode 100644 keyboards/ut47/config.h delete mode 100644 keyboards/ut47/info.json delete mode 100644 keyboards/ut47/keymaps/default/config.h delete mode 100644 keyboards/ut47/keymaps/default/keymap.c delete mode 100644 keyboards/ut47/keymaps/default/readme.md delete mode 100644 keyboards/ut47/keymaps/non-us/config.h delete mode 100644 keyboards/ut47/keymaps/non-us/keymap.c delete mode 100644 keyboards/ut47/keymaps/non-us/readme.md delete mode 100644 keyboards/ut47/keymaps/nordic/config.h delete mode 100644 keyboards/ut47/keymaps/nordic/keymap.c delete mode 100644 keyboards/ut47/keymaps/nordic/readme.md delete mode 100644 keyboards/ut47/keymaps/rgb/config.h delete mode 100644 keyboards/ut47/keymaps/rgb/keymap.c delete mode 100644 keyboards/ut47/keymaps/rgb/readme.md delete mode 100644 keyboards/ut47/keymaps/rgb/rules.mk delete mode 100644 keyboards/ut47/led.c delete mode 100644 keyboards/ut47/matrix.c delete mode 100644 keyboards/ut47/readme.md delete mode 100644 keyboards/ut47/rules.mk delete mode 100644 keyboards/ut47/ut47.c delete mode 100644 keyboards/ut47/ut47.h diff --git a/keyboards/40percentclub/4x4/4x4.c b/keyboards/40percentclub/4x4/4x4.c new file mode 100644 index 0000000000..963b6d00d4 --- /dev/null +++ b/keyboards/40percentclub/4x4/4x4.c @@ -0,0 +1,29 @@ + +#include "4x4.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/4x4/4x4.h b/keyboards/40percentclub/4x4/4x4.h new file mode 100644 index 0000000000..ec75c3e280 --- /dev/null +++ b/keyboards/40percentclub/4x4/4x4.h @@ -0,0 +1,62 @@ + +#ifndef FOURX4_H +#define FOURX4_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x8( \ + K00, K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K35, K36, K37\ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___, ___, ___, ___, ___} \ +} +#define LAYOUT_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ +} + +#endif diff --git a/keyboards/40percentclub/4x4/config.h b/keyboards/40percentclub/4x4/config.h new file mode 100644 index 0000000000..e66e9433a9 --- /dev/null +++ b/keyboards/40percentclub/4x4/config.h @@ -0,0 +1,202 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x4444 +#define MANUFACTURER di0ib +#define PRODUCT The 4x4 Keyboard +#define DESCRIPTION A modular compact keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4 } +#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/40percentclub/4x4/keymaps/default/config.h b/keyboards/40percentclub/4x4/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/40percentclub/4x4/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/4x4/keymaps/default/keymap.c b/keyboards/40percentclub/4x4/keymaps/default/keymap.c new file mode 100644 index 0000000000..144ec05c17 --- /dev/null +++ b/keyboards/40percentclub/4x4/keymaps/default/keymap.c @@ -0,0 +1,124 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +// Readability keycodes +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 4x4 board only + * .-----------------------------------. + * | 7 | 8 | 9 | / | + * |--------+--------+--------+--------| + * | 4 | 5 | 6 | * | + * |--------+--------+--------+--------| + * | 1 | 2 | 3 | - | + * |--------+--------+--------+--------| + * | 0 | QWERTY | . | + | + * '-----------------------------------' + */ + + [PAD] = LAYOUT_ortho_4x4( + KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_KP_0, DF(_QW), KC_KP_DOT, KC_PPLS + ), + +/* QWERTY + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | / | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | * | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_4x16( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PPLS + ), + +/* NUMBERS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | | + * | | | | | | | | | | |CTRLhold| | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | + * | | | | | | | ENTER | SHIFT | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_4x16( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, + _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_4x16( + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + (void)event; + + switch (id) { + + } + return MACRO_NONE; +} + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/4x4/readme.md b/keyboards/40percentclub/4x4/readme.md new file mode 100644 index 0000000000..077a2049be --- /dev/null +++ b/keyboards/40percentclub/4x4/readme.md @@ -0,0 +1,24 @@ +# 4x4 + +![4x4](https://2.bp.blogspot.com/-xRZOpwlTT4c/WlOwRIVAecI/AAAAAAACKo4/d75juHTX2W0Nrch7NigssMbagvl3I4w_ACEwYBhgL/s1600/e.jpg) +=== + +**Modular keypad/keyboard** +The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side. +4x4, 4x8, 4x12 and 4x16 are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/4x4) + +Keyboard Maintainer: QMK Community +Hardware Supported: 4x4 PCB +Hardware Availability: [4x4x4x4x4 project on 40% Keyboards](http://www.40percent.club/2018/01/4x4x4x4x4.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/4x4: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). + +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/4x4/rules.mk b/keyboards/40percentclub/4x4/rules.mk new file mode 100644 index 0000000000..d572e72444 --- /dev/null +++ b/keyboards/40percentclub/4x4/rules.mk @@ -0,0 +1,74 @@ +# MCU name +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 + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = caterina + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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) + +#FIXME: Community keymap build are currently failing due to missing functionality +#LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/40percentclub/5x5/5x5.c b/keyboards/40percentclub/5x5/5x5.c new file mode 100644 index 0000000000..20e5246094 --- /dev/null +++ b/keyboards/40percentclub/5x5/5x5.c @@ -0,0 +1,29 @@ + +#include "5x5.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/5x5/5x5.h b/keyboards/40percentclub/5x5/5x5.h new file mode 100644 index 0000000000..45fb80a4f7 --- /dev/null +++ b/keyboards/40percentclub/5x5/5x5.h @@ -0,0 +1,57 @@ + +#ifndef FIVEX5_H +#define FIVEX5_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_5x5( \ + K00, K01, K02, K03, K04, \ + K10, K11, K12, K13, K14, \ + K20, K21, K22, K23, K24, \ + K30, K31, K32, K33, K34, \ + K40, K41, K42, K43, K44 \ +) \ +{ \ + { K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x10( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ +} + +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ +} + +#endif diff --git a/keyboards/40percentclub/5x5/config.h b/keyboards/40percentclub/5x5/config.h new file mode 100644 index 0000000000..bc609934e3 --- /dev/null +++ b/keyboards/40percentclub/5x5/config.h @@ -0,0 +1,208 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x05B5 +#define MANUFACTURER di0ib +#define PRODUCT The 5x5 Keyboard +#define DESCRIPTION A 25 or 50 or 75 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/5x5/keymaps/default/config.h b/keyboards/40percentclub/5x5/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/40percentclub/5x5/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/40percentclub/5x5/keymaps/default/keymap.c b/keyboards/40percentclub/5x5/keymaps/default/keymap.c new file mode 100644 index 0000000000..a2c525d089 --- /dev/null +++ b/keyboards/40percentclub/5x5/keymaps/default/keymap.c @@ -0,0 +1,139 @@ + +#include QMK_KEYBOARD_H + +#define PAD 0 +#define _QW 1 +#define NUM 2 +#define DIR 3 + +// Readability keycodes +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Single 5x5 board only + * .--------------------------------------------. + * | QWERTY | / | * | - | | + * |--------+--------+--------+--------+--------| + * | 7 | 8 | 9 | + | | + * |--------+--------+--------+--------+--------| + * | 4 | 5 | 6 | + | | + * |--------+--------+--------+--------+--------| + * | 1 | 2 | 3 | ENTER | | + * |--------+--------+--------+--------+--------| + * | 0 | 0 | . | ENTER | | + * '--------------------------------------------' + */ + + [PAD] = LAYOUT_ortho_5x5( + DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, + KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, + KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, + KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, + KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ + ), + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT + ), + +/* NUMBERS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | + * | | | | | | | | | | |CTRLhold| | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | ENTER | SHIFT | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [NUM] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, + _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, + _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ + ), + +/* DIRECTIONS + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | P-Brk | | | | | | | RGUI | ALT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | KEYPAD | | | | | | | | | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [DIR] = LAYOUT_ortho_5x15( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, + KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, + _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, + DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + +const uint16_t PROGMEM fn_actions[] = { + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/5x5/readme.md b/keyboards/40percentclub/5x5/readme.md new file mode 100644 index 0000000000..8f0d8e1667 --- /dev/null +++ b/keyboards/40percentclub/5x5/readme.md @@ -0,0 +1,24 @@ +# 5x5 + +![5x5](https://3.bp.blogspot.com/-bKOfUyMtdrE/WqGA_03kGZI/AAAAAAACPtY/DsHDTQS0IlMD3ie8HHlf1ATRUAwpZdcSgCLcBGAs/s1600/c.jpg) +=== + +**Modular Keypad/Keyboard** +The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. +5x5, 5x10, and 5x15 matrices are possible. +There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. +**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) + +Keyboard Maintainer: QMK Community +Hardware Supported: 5x5 PCB +Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/5x5: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). + +First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/5x5/rules.mk b/keyboards/40percentclub/5x5/rules.mk new file mode 100644 index 0000000000..abc961a86f --- /dev/null +++ b/keyboards/40percentclub/5x5/rules.mk @@ -0,0 +1,74 @@ +# MCU name +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 + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = caterina + +# 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 = no # USB Nkey Rollover +BACKLIGHT_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) + +#FIXME: Community keymap build are currently failing due to missing functionality +#LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/keyboards/40percentclub/6lit/6lit.c b/keyboards/40percentclub/6lit/6lit.c new file mode 100644 index 0000000000..fd3ae7d009 --- /dev/null +++ b/keyboards/40percentclub/6lit/6lit.c @@ -0,0 +1,53 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "6lit.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{2, 2}, {1, 2}, {0, 2}}, + {{2, 3}, {1, 3}, {0, 3}}, + {{0, 0}, {1, 0}, {2, 0}}, + {{0, 1}, {1, 1}, {2, 1}}, +}; +#endif diff --git a/keyboards/40percentclub/6lit/6lit.h b/keyboards/40percentclub/6lit/6lit.h new file mode 100644 index 0000000000..ae0beea35d --- /dev/null +++ b/keyboards/40percentclub/6lit/6lit.h @@ -0,0 +1,55 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ________ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_split( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R02, R01, R00 }, \ + { R12, R11, R10 }, \ +} +#else +#define LAYOUT_split( \ + L00, L01, L02, R00, R01, R02, \ + L10, L11, L12, R10, R11, R12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ + { R00, R01, R02 }, \ + { R10, R11, R12 }, \ +} +#endif + +#define LAYOUT_macro( \ + L00, L01, L02, \ + L10, L11, L12 \ +) { \ + { L00, L01, L02 }, \ + { L10, L11, L12 }, \ +} + +#define LAYOUT LAYOUT_macro + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/6lit/config.h b/keyboards/40percentclub/6lit/config.h new file mode 100644 index 0000000000..8397818a61 --- /dev/null +++ b/keyboards/40percentclub/6lit/config.h @@ -0,0 +1,230 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F61 +#define MANUFACTURER di0ib +#define PRODUCT The 6lit Macropad +#define DESCRIPTION A split 12 key Macropad + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 2*2 +#define MATRIX_COLS 3 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6 } +#define MATRIX_COL_PINS { F6, F7, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/6lit/info.json b/keyboards/40percentclub/6lit/info.json new file mode 100644 index 0000000000..ce1a7d6e16 --- /dev/null +++ b/keyboards/40percentclub/6lit/info.json @@ -0,0 +1,23 @@ +{ + "keyboard_name": "6lit", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 6, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1} + ] + }, + "LAYOUT_split": { + "key_count": 12, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1} + ] + } + } +} diff --git a/keyboards/40percentclub/6lit/keymaps/default/config.h b/keyboards/40percentclub/6lit/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/6lit/keymaps/default/keymap.c b/keyboards/40percentclub/6lit/keymaps/default/keymap.c new file mode 100644 index 0000000000..6864c72f78 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, \ + KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/6lit/keymaps/default/readme.md b/keyboards/40percentclub/6lit/keymaps/default/readme.md new file mode 100644 index 0000000000..b3acc3f58a --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for 6lit diff --git a/keyboards/40percentclub/6lit/keymaps/macro/config.h b/keyboards/40percentclub/6lit/keymaps/macro/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/6lit/keymaps/macro/keymap.c b/keyboards/40percentclub/6lit/keymaps/macro/keymap.c new file mode 100644 index 0000000000..6b10ac1330 --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/keymap.c @@ -0,0 +1,39 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F19, KC_F20, KC_F21, \ + KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/6lit/keymaps/macro/readme.md b/keyboards/40percentclub/6lit/keymaps/macro/readme.md new file mode 100644 index 0000000000..9f883b821c --- /dev/null +++ b/keyboards/40percentclub/6lit/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for 6lit diff --git a/keyboards/40percentclub/6lit/readme.md b/keyboards/40percentclub/6lit/readme.md new file mode 100644 index 0000000000..3d28df2d75 --- /dev/null +++ b/keyboards/40percentclub/6lit/readme.md @@ -0,0 +1,18 @@ +# 6lit + +![6lit](https://1.bp.blogspot.com/-Pa8RgYZ0hy8/Wbmr4bjuV0I/AAAAAAACDbI/WLKQMDlcDVAVf1lAIRMN51usR1XcCCVNgCLcBGAs/s1600/a.JPG) +=== + +6 key macropad that fits within the 100mm x 100mm PCB size. Can be used singly as a regular 6 key macropad as well. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/6lit) + +Keyboard Maintainer: QMK Community +Hardware Supported: 6lit PCB +Hardware Availability: [6lit project on 40% Keyboards](http://www.40percent.club/2017/09/6lit.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/6lit: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/40percentclub/6lit/rules.mk b/keyboards/40percentclub/6lit/rules.mk new file mode 100644 index 0000000000..3275651650 --- /dev/null +++ b/keyboards/40percentclub/6lit/rules.mk @@ -0,0 +1,83 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes diff --git a/keyboards/40percentclub/foobar/config.h b/keyboards/40percentclub/foobar/config.h new file mode 100644 index 0000000000..89219c4607 --- /dev/null +++ b/keyboards/40percentclub/foobar/config.h @@ -0,0 +1,230 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F00 +#define MANUFACTURER di0ib +#define PRODUCT The foobar Keyboard +#define DESCRIPTION A split 30 key keyboard + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 3*2 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D7, E6, B4 } +#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/foobar/foobar.c b/keyboards/40percentclub/foobar/foobar.c new file mode 100644 index 0000000000..c032056a15 --- /dev/null +++ b/keyboards/40percentclub/foobar/foobar.c @@ -0,0 +1,55 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "foobar.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, + {{4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, + {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, +}; +#endif diff --git a/keyboards/40percentclub/foobar/foobar.h b/keyboards/40percentclub/foobar/foobar.h new file mode 100644 index 0000000000..fc49c72aaf --- /dev/null +++ b/keyboards/40percentclub/foobar/foobar.h @@ -0,0 +1,66 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_split( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 } \ +} +#else +#define LAYOUT_split( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 } \ +} +#endif + +#define LAYOUT_macro( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ } \ +} + +#define LAYOUT LAYOUT_macro + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/foobar/info.json b/keyboards/40percentclub/foobar/info.json new file mode 100644 index 0000000000..cb7f29b256 --- /dev/null +++ b/keyboards/40percentclub/foobar/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 15, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2} + ] + }, + "LAYOUT_split": { + "key_count": 30, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2} + ] + } + } +} diff --git a/keyboards/40percentclub/foobar/keymaps/default/config.h b/keyboards/40percentclub/foobar/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/foobar/keymaps/default/keymap.c b/keyboards/40percentclub/foobar/keymaps/default/keymap.c new file mode 100644 index 0000000000..b750c61851 --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/keymap.c @@ -0,0 +1,49 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +#define _______ KC_TRNS +#define FN1_Q LT(1, KC_Q) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_split( + FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, + KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [1] = LAYOUT_split( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/foobar/keymaps/default/readme.md b/keyboards/40percentclub/foobar/keymaps/default/readme.md new file mode 100644 index 0000000000..7113469e7e --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for foobar diff --git a/keyboards/40percentclub/foobar/keymaps/macro/config.h b/keyboards/40percentclub/foobar/keymaps/macro/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/foobar/keymaps/macro/keymap.c b/keyboards/40percentclub/foobar/keymaps/macro/keymap.c new file mode 100644 index 0000000000..1e7ec905fd --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/keymap.c @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( /* Base */ + KC_F13, KC_F14, KC_F15, KC_F16, KC_INT1, \ + KC_F17, KC_F18, KC_F19, KC_F20, KC_INT2, \ + KC_F21, KC_F22, KC_F23, KC_F14, KC_INT5 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/foobar/keymaps/macro/readme.md b/keyboards/40percentclub/foobar/keymaps/macro/readme.md new file mode 100644 index 0000000000..4cc59e7e5d --- /dev/null +++ b/keyboards/40percentclub/foobar/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for foobar diff --git a/keyboards/40percentclub/foobar/readme.md b/keyboards/40percentclub/foobar/readme.md new file mode 100644 index 0000000000..0acdf7252d --- /dev/null +++ b/keyboards/40percentclub/foobar/readme.md @@ -0,0 +1,18 @@ +# foobar + +![foobar](https://2.bp.blogspot.com/-rr8TK6xg2N0/WbwVL2O7EfI/AAAAAAACDc8/209wN69ju0wAFICYYPNLIEGQhat5-5MbwCLcBGAs/s640/a.JPG) +=== + +Split 30% keyboard that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 15 key macropad. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/foobar) + +Keyboard Maintainer: QMK Community +Hardware Supported: foobar PCB +Hardware Availability: [foobar project on 40% Keyboards](http://www.40percent.club/2017/09/foobar-10.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/foobar: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/40percentclub/foobar/rules.mk b/keyboards/40percentclub/foobar/rules.mk new file mode 100644 index 0000000000..3275651650 --- /dev/null +++ b/keyboards/40percentclub/foobar/rules.mk @@ -0,0 +1,83 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes diff --git a/keyboards/40percentclub/gherkin/config.h b/keyboards/40percentclub/gherkin/config.h new file mode 100644 index 0000000000..34f38e35c2 --- /dev/null +++ b/keyboards/40percentclub/gherkin/config.h @@ -0,0 +1,54 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40 Percent Club +#define PRODUCT Gherkin +#define DESCRIPTION A 30 key ortholinear keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +#endif diff --git a/keyboards/40percentclub/gherkin/gherkin.c b/keyboards/40percentclub/gherkin/gherkin.c new file mode 100644 index 0000000000..2952d842cf --- /dev/null +++ b/keyboards/40percentclub/gherkin/gherkin.c @@ -0,0 +1 @@ +#include "gherkin.h" diff --git a/keyboards/40percentclub/gherkin/gherkin.h b/keyboards/40percentclub/gherkin/gherkin.h new file mode 100644 index 0000000000..f8674be40e --- /dev/null +++ b/keyboards/40percentclub/gherkin/gherkin.h @@ -0,0 +1,18 @@ +#ifndef GHERKIN_H +#define GHERKIN_H + +#include "quantum.h" + +#define LAYOUT_ortho_3x10( \ + K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ + K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ + K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, K25 }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, K43, K44, K45 } \ +} + +#endif diff --git a/keyboards/40percentclub/gherkin/info.json b/keyboards/40percentclub/gherkin/info.json new file mode 100644 index 0000000000..7ebbfb04be --- /dev/null +++ b/keyboards/40percentclub/gherkin/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Gherkin", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 3, + "layouts": { + "LAYOUT_ortho_3x10": { + "key_count": 30, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}] + } + } +} diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md new file mode 100644 index 0000000000..3c9a5e98b3 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/README.md @@ -0,0 +1,11 @@ +# Gherkin Layout +This is my gherkin layout. +It is used as a game pad, and key layout is inspired by spare keys I had lying around. +The firmware is very simple, and only includes one layer keymap, and RGB effects. + +# Flashing +The following command should be used from the main qmk directory. +``` +make gherkin:bbaserdem +sudo avrdude -p atmgea34u4 -P `ls /dev/ttyACM*` -c avr109 -U flash:.build/gherkin_bbaserdem.hex +``` diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h new file mode 100644 index 0000000000..37d7113e78 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h @@ -0,0 +1,13 @@ +#ifndef CONFIG_KEYMAP_H +#define CONFIG_KEYMAP_H + +#include "../../config.h" +#define RGB_DI_PIN F6 +#define RGBLED_NUM 10 +#define RGBLIGHT_ANIMATIONS +#ifdef BACKLIGHT_LEVELS +#undef BACKLIGHT_LEVELS +#endif +#define BACKLIGHT_LEVELS 3 + +#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c new file mode 100644 index 0000000000..0d3c8557c5 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/keymap.c @@ -0,0 +1,36 @@ +// This is a game-pad gherkin layout with RGB and LED lights + +#include QMK_KEYBOARD_H + +backlight_config_t backlight_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Game pad + * ,-----------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | Ctl | Alt | ~ | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | Tab | Q | W | E | R | T | |^| | ; | ' | / | + * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| + * | Shf | A | S | D | F | <-- | |v| | --> | , | . | + * `-----------------------------------------------------------' + */ + LAYOUT_ortho_3x10( + KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_LCTRL, KC_LALT, KC_GRAVE, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_UP, KC_SCLN, KC_QUOTE, KC_SLASH, + KC_LSHIFT, KC_A, KC_S, KC_D, KC_F, KC_LEFT, KC_DOWN, KC_RIGHT, KC_COMMA, KC_DOT + ) +}; + +void matrix_init_user(void) { + // Set LED's to max + _delay_us(300); + backlight_config.level = 2; + backlight_config.enable = 1; + eeconfig_update_backlight(backlight_config.raw); + backlight_set(backlight_config.level); + // Set RGB to rainbow mood light + rgblight_enable(); + rgblight_mode(1); + rgblight_sethsv(120,255,255); + rgblight_mode(6); +} diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk new file mode 100644 index 0000000000..cd1cddebf4 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk @@ -0,0 +1,17 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +USER_NAME := bbaserdem-nouserspace + +STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +AUDIO_ENABLE = no # Enable audio output from keyboard + +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +RGBLIGHT_ENABLE = yes # Enable RBG light strips +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c new file mode 100644 index 0000000000..f018200304 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +#define _______ KC_TRNS +#define FN1_Q LT(1, KC_Q) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [0] = LAYOUT_ortho_3x10( + FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, + KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [1] = LAYOUT_ortho_3x10( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, + _______, _______, _______, _______, _______, _______, RESET, _______, _______, BL_DEC + ), + +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + (void)event; + + switch (id) { + + } + return MACRO_NONE; +} + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h new file mode 100644 index 0000000000..71c0cb8b56 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h @@ -0,0 +1,15 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#undef RGB_DI_PIN +#undef RGBLED_NUM +#define RGB_DI_PIN D2 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c new file mode 100644 index 0000000000..580b041c9c --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c @@ -0,0 +1,152 @@ +#include QMK_KEYBOARD_H + +extern rgblight_config_t rgblight_config; +extern keymap_config_t keymap_config; + +#define _PS 0 // This is the Photoshop Layer +#define _AI 1 // This is the Illustrator Layer +#define _PR 2 // This is the Premier Layer +#define _XD 3 // This is the Experience Design Layer + +enum custom_keycodes { + PS = SAFE_RANGE, + AI, + PR, +}; + +#define _______ KC_TRNS + +#define PS TO(0) +#define AI TO(1) +#define PR TO(2) +#define XD TO(3) + +// Mix of Photoshop, Illustrator, Premiere, and Experience Design shortcuts. +#define SAVE LCTL(KC_S) +#define OPEN LCTL(KC_O) +#define COPY LCTL(KC_C) +#define PAST LCTL(KC_V) +#define CUNDO LCTL(LALT(KC_Z)) +#define INVERT LCTL(LSFT(KC_I)) +#define NLAYER LSFT(LCTL(KC_N)) +#define UNDO LCTL(KC_Z) +#define TRANS LCTL(KC_T) +#define ALIGNL LCTL(LSFT(KC_L)) +#define ALIGNC LCTL(LSFT(KC_C)) +#define ALIGNR LCTL(LSFT(KC_R)) +#define BRINGF LCTL(KC_RBRC) +#define BRINGB LCTL(KC_LBRC) + +// Illustrator layer shortcuts. +#define SHAPE LSFT(KC_M) +#define RULER LCTL(LALT(KC_R)) + +// Premiere layer shortcuts. +#define REDO LCTL(LSFT(KC_Z)) +#define EXPORT LCTL(KC_M) +#define IMPORT LCTL(KC_I) +#define PCOPY LCTL(KC_V) +#define PPASTE LCTL(LSFT(KC_V)) + +// Experience Design layer shortcuts. (can be used with others too.) +#define NEW LCTL(KC_N) +#define LOCK LCTL(KC_L) +#define SYMB LCTL(KC_K) +#define HIDE LCTL(KC_SCLN) +#define REPEAT LCTL(KC_R) +#define MASK LCTL(LSFT(KC_M)) +#define GROUP LCTL(KC_G) +#define UNGRP LCTL(LSFT(KC_G)) +#define VIEW LCTL(KC_TAB) +#define HORZ LSFT(KC_C) +#define VERT LSFT(KC_M) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Photoshop layer + [_PS] = LAYOUT_ortho_3x10( + SAVE, KC_W, KC_E, KC_T, KC_U, KC_I, KC_P, INVERT, CUNDO, NLAYER, + UNDO, KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB, BRINGF, OPEN, + KC_LSFT, COPY, PAST, KC_Z, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, AI + ), + + // Illustrator layer + [_AI] = LAYOUT_ortho_3x10( + _______, M(0), RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, + _______, _______, _______, KC_E, _______, _______, _______, SHAPE, KC_O, OPEN, + _______, _______, _______, _______, _______, _______, _______, KC_M, KC_SLSH, PR + ), + + // Premiere layer + [_PR] = LAYOUT_ortho_3x10( + _______, KC_Q, KC_W, KC_I, KC_O, KC_P, IMPORT, EXPORT, KC_MINS, KC_EQL, + _______, REDO, KC_D, KC_F, KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC, OPEN, + _______, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V, KC_LEFT, KC_RIGHT, XD + ), + + // Experience Design layer + [_XD] = LAYOUT_ortho_3x10( + _______, KC_E, KC_R, KC_T, KC_P, KC_A, KC_L, KC_V, KC_DEL, NEW, + _______, REDO, GROUP, UNGRP, VIEW, HORZ, VERT, KC_Z, KC_ENT, OPEN, + _______, KC_LCTL, COPY, PAST, SYMB, LOCK, MASK, HIDE, REPEAT, PS + ), + +}; + +void persistent_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +void matrix_init_user(void) { + rgblight_enable(); +} + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + + static uint8_t old_layer = 255; + uint8_t new_layer = biton32(layer_state); + + // Color of the Icons. + if (old_layer != new_layer) { + switch (new_layer) { + case _PS: + // #31C5F0 + rgblight_setrgb(49, 197, 240); + break; + case _AI: + // #FF8011 + rgblight_setrgb(255, 128, 17); + break; + case _PR: + // #E788FF + rgblight_setrgb(231, 136, 255); + break; + case _XD: + // #FF2BC2 + rgblight_setrgb(255, 43, 194); + break; + } + old_layer = new_layer; + } + #endif +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + (void)event; + + switch (id) { + case 0: + // Save for Web Macro. + return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END); + } + return MACRO_NONE; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + } + return true; +} diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk new file mode 100644 index 0000000000..ed0af7b8bd --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk @@ -0,0 +1,7 @@ +BACKLIGHT_ENABLE = yes +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/config.h b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h new file mode 100644 index 0000000000..bb59ec213d --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h @@ -0,0 +1,169 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Some Guy +#define PRODUCT Gherkin +#define DESCRIPTION 30 percent disaster + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 6 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +// These are with USB on the left. +// #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } +// original from TMK: #define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } +// #define MATRIX_COL_PINS { D0, D4, F6, D7, E6, B4 } + +// these are with USB on the right. +#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } +#define MATRIX_COL_PINS { B4, E6, D7, F6, D4, D0 } + +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_PIN B5 + +/* 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 + +#define AUDIO_VOICES + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c new file mode 100644 index 0000000000..2b4369c34f --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c @@ -0,0 +1,279 @@ +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif + +extern keymap_config_t keymap_config; + +//Tap Dance Declarations +enum { + TD_Z_LCTL = 0, + TD_X_LGUI = 1, + TD_C_LALT = 2, + TD_A_TAB = 3, + TD_Q_ESC = 4, +// M(0) +}; + +//Friendly Layer Names +enum gherkin_layers { + _QWERTY, + _SONGS, + _NUMBERS, + _SYMBOLS, + _PLOVER, + _ADJUST +}; + +// custom keycodes +enum gherkin_keycodes { + QWERTY = SAFE_RANGE, + NUMBERS, + SYMBOLS, + SONGS, + PLOVER, + BACKLIT, + MACSLEEP, + EXT_PLV +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_ortho_3x10( + TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + TD(TD_A_TAB), LT(_SYMBOLS,KC_S), KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_ADJUST,KC_SPC), + TD(TD_Z_LCTL), TD(TD_X_LGUI), TD(TD_C_LALT), KC_V, KC_B, LT(_NUMBERS, KC_N), KC_M, KC_COMM, KC_DOT, SFT_T(KC_ENT) + ), + [_NUMBERS] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END , + KC_F7, KC_F8, KC_F9, KC_F10, LT(_ADJUST,KC_F11), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT + ), + [_SYMBOLS] = LAYOUT_ortho_3x10( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_GRV, _______, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, KC_MINS, KC_EQL , KC_SCLN, KC_QUOT, + KC_TILD, MO(_ADJUST), XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, KC_UNDS, KC_PLUS, S(KC_SCLN), S(KC_QUOT) + ), + [_PLOVER] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_1, KC_U, KC_I, KC_O, KC_P, KC_LBRC, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX + ), + [_ADJUST] = LAYOUT_ortho_3x10( + RESET, _______, _______, _______, _______, QWERTY, NUMBERS, SYMBOLS, PLOVER, SONGS, + MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, _______, MACSLEEP, _______, + BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); + +float tone_goodbye[][2] = SONG(GOODBYE_SOUND); +#endif + +void persistant_default_layer_set(uint16_t default_layer) { + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + persistant_default_layer_set(1UL<<_QWERTY); + } + return false; + break; + case NUMBERS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + persistant_default_layer_set(1UL<<_NUMBERS); + } + return false; + break; + case SYMBOLS: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + persistant_default_layer_set(1UL<<_SYMBOLS); + } + return false; + break; + case PLOVER: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + stop_all_notes(); + PLAY_SONG(tone_plover); + #endif + layer_off(_NUMBERS); + layer_off(_SYMBOLS); + layer_off(_ADJUST); + layer_on(_PLOVER); + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + keymap_config.raw = eeconfig_read_keymap(); + keymap_config.nkro = 1; + eeconfig_update_keymap(keymap_config.raw); + } + return false; + break; + case EXT_PLV: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_plover_gb); + #endif + layer_off(_PLOVER); + } + return false; + break; + case MACSLEEP: + if (record->event.pressed) { + // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + + +/* +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + + switch (id) { + case 0: { + if (record->event.pressed) { + key_timer = timer_read(); // if the key is being pressed, we start the timer. + } + else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). + if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. + return MACRO( D(LSFT), END ); + } + else { + return MACRO( T(N), END ); + } + } + break; + } + } + return MACRO_NONE; +}*/ + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user() +{ + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +void matrix_scan_user(void) { +} + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Esc, twice for Caps Lock + [TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL), + [TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI), + [TD_C_LALT] = ACTION_TAP_DANCE_DOUBLE(KC_C, KC_LALT), + [TD_A_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_TAB), + [TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) +}; + +// don't know what this is doing... +/* +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 0); PORTB &= ~(1 << 0); + } else { + DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} +*/ diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk new file mode 100644 index 0000000000..afb93b674c --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk @@ -0,0 +1,29 @@ +## not sure where this stuff goes ## +MCU = atmega32u4 +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) +OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # 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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE=yes + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/config.h b/keyboards/40percentclub/gherkin/keymaps/steno/config.h new file mode 100644 index 0000000000..abacefa01d --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/config.h @@ -0,0 +1,12 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#define NO_ACTION_LAYER +#define NO_ACTION_TAPPING +#define NO_ACTION_ONESHOT +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/keymap.c b/keyboards/40percentclub/gherkin/keymaps/steno/keymap.c new file mode 100644 index 0000000000..c7ee63d126 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/keymap.c @@ -0,0 +1,13 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_ortho_3x10( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , + STN_NUM, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, STN_NUM), +}; + +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +} \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/readme.md b/keyboards/40percentclub/gherkin/keymaps/steno/readme.md new file mode 100644 index 0000000000..6536ed7aba --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/readme.md @@ -0,0 +1,9 @@ +# Gherkin Steno + +This is a stenography-only keymap. It boots by default into GeminiPR mode. All the excess stuff is stripped away (I'd remove normal keyboard support if I could). + +> Note: The number bar has been moved to the bottom row in all the left-over spaces. + + | S | T | P | H | * | F | P | L | T | D | + | S | K | W | R | * | R | B | G | S | Z | + | # | # | A | O | # | E | U | # | # | # | diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk new file mode 100644 index 0000000000..fa813f2099 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk @@ -0,0 +1,16 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = no # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h new file mode 100644 index 0000000000..7fa3bf328e --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "../../config.h" + +#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c new file mode 100644 index 0000000000..ea2921924e --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c @@ -0,0 +1,58 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +#define ST_BOLT QK_STENO_BOLT +#define ST_GEM QK_STENO_GEMINI + +#define XXXXXXX KC_NO + +enum keyboard_layers { + _QWERTY, + _RAISE, + _LOWER, + _PLOVER, + _ADJUST +}; + +#define ADJ_Z LT(_ADJUST, KC_Z) +#define RS_BSPC LT(_RAISE, KC_BSPC) +#define LW_SPC LT(_LOWER, KC_SPC) +#define MO_ADJ MO(_ADJUST) +#define TG_PLV TG(_PLOVER) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_LGUI OSM(MOD_LGUI) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT_ortho_3x10( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, + ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT + ), + + [_RAISE] = LAYOUT_ortho_3x10( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, + KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, + OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH + ), + + [_LOWER] = LAYOUT_ortho_3x10( + KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, + KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, + KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS + ), + + [_PLOVER] = LAYOUT_ortho_3x10( + STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX + ), + + [_ADJUST] = LAYOUT_ortho_3x10( + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET + ), + +}; diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk new file mode 100644 index 0000000000..02216ecb36 --- /dev/null +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk @@ -0,0 +1,6 @@ +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/40percentclub/gherkin/readme.md b/keyboards/40percentclub/gherkin/readme.md new file mode 100644 index 0000000000..a6680d7205 --- /dev/null +++ b/keyboards/40percentclub/gherkin/readme.md @@ -0,0 +1,21 @@ +# Gherkin + +![Gherkin](https://4.bp.blogspot.com/-sQ18-lNZXOc/WCzlTde-4PI/AAAAAAAB_JQ/qQrehAMG6DMKf3i4oj4mkmLGOfTUvb3KgCLcB/s640/IMG_20161116_122926.jpg) +=== + +A 30 key keyboard. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) + +Keyboard Maintainer: QMK Community +Hardware Supported: Gherkin PCB +Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/gherkin: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). + +First pass at adding support for the gherkin keyboard. Compiles but completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/gherkin/rules.mk b/keyboards/40percentclub/gherkin/rules.mk new file mode 100644 index 0000000000..416ca5e5f4 --- /dev/null +++ b/keyboards/40percentclub/gherkin/rules.mk @@ -0,0 +1,59 @@ +# MCU name +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + +LAYOUTS = ortho_3x10 diff --git a/keyboards/40percentclub/luddite/config.h b/keyboards/40percentclub/luddite/config.h new file mode 100644 index 0000000000..62ff72bb03 --- /dev/null +++ b/keyboards/40percentclub/luddite/config.h @@ -0,0 +1,48 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x1001 +#define MANUFACTURER di0ib +#define PRODUCT Luddite +#define DESCRIPTION Luddite Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4, C6, D7, E6 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } +#define UNUSED_PINS + +/* number of backlight levels */ +#define BACKLIGHT_PIN B5 +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 4 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 8 // Number of LEDs +// #define RGBLIGHT_HUE_STEP 10 +// #define RGBLIGHT_SAT_STEP 17 +// #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/40percentclub/luddite/keymaps/default/keymap.c b/keyboards/40percentclub/luddite/keymaps/default/keymap.c new file mode 100644 index 0000000000..4d6ae0d524 --- /dev/null +++ b/keyboards/40percentclub/luddite/keymaps/default/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, 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_BSPC, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/40percentclub/luddite/luddite.c b/keyboards/40percentclub/luddite/luddite.c new file mode 100644 index 0000000000..3e720ad571 --- /dev/null +++ b/keyboards/40percentclub/luddite/luddite.c @@ -0,0 +1 @@ +#include "luddite.h" diff --git a/keyboards/40percentclub/luddite/luddite.h b/keyboards/40percentclub/luddite/luddite.h new file mode 100644 index 0000000000..1ba743e9e7 --- /dev/null +++ b/keyboards/40percentclub/luddite/luddite.h @@ -0,0 +1,21 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_60_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K10, K11, K12, K13, K14, K15, \ + K16, K17, K20, K21, K22, K23, K24, K25, K26, K27, K30, K31, K32, K33, \ + K34, K35, K36, K37, K40, K41, K42, K43, K44, K45, K46, K47, K50, \ + K51, K52, K53, K54, K55, K56, K57, K60, K61, K62, K63, K64, \ + K65, K66, K67, K70, K71, K72, K73, K74\ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67 }, \ + { K70, K71, K72, K73, K74 }, \ +} + diff --git a/keyboards/40percentclub/luddite/readme.md b/keyboards/40percentclub/luddite/readme.md new file mode 100644 index 0000000000..928b6de8f3 --- /dev/null +++ b/keyboards/40percentclub/luddite/readme.md @@ -0,0 +1,21 @@ +# Luddite + +![Luddite](https://1.bp.blogspot.com/-GAAa-sMU_WU/W7uYLJJ8x1I/AAAAAAACS44/31n2z69BSboM4KT48YkNMJRYciC8LUMWgCLcBGAs/s640/a.jpg) +=== + +Luddite 60% keyboard with backlight and RGB underglow. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/luddite) + +Keyboard Maintainer: QMK Community +Hardware Supported: Luddite PCB +Hardware Availability: [Luddite project on 40% Keyboards](http://www.40percent.club/search/label/luddite) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/luddite: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). + +First pass at adding support for the luddite keyboard. Compiles but completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/luddite/rules.mk b/keyboards/40percentclub/luddite/rules.mk new file mode 100644 index 0000000000..2f7d847bf0 --- /dev/null +++ b/keyboards/40percentclub/luddite/rules.mk @@ -0,0 +1,59 @@ +# MCU name +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi diff --git a/keyboards/40percentclub/mf68/config.h b/keyboards/40percentclub/mf68/config.h new file mode 100644 index 0000000000..07d787eacf --- /dev/null +++ b/keyboards/40percentclub/mf68/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0510 +#define DEVICE_VER 0x0101 +#define MANUFACTURER di0ib +#define PRODUCT MF68 +#define DESCRIPTION Magicforce 68 with programmable PCB replacement + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } +#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/40percentclub/mf68/info.json b/keyboards/40percentclub/mf68/info.json new file mode 100644 index 0000000000..fae15aaf5f --- /dev/null +++ b/keyboards/40percentclub/mf68/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "MF68", + "url": "", + "maintainer": "qmk", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT_68_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] + } + } +} diff --git a/keyboards/40percentclub/mf68/keymaps/default/keymap.c b/keyboards/40percentclub/mf68/keymaps/default/keymap.c new file mode 100644 index 0000000000..73045f3107 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 +#define KC_ KC_TRNS +#define KC_X0 LT(_FN2, KC_GRV) +#define KC_X1 MO(_FN1) +#define KC_X2 BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, + /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, + /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , + /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , + /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ + LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT + /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + ), + + [_FN1] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , , , , , , X2 , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , , , , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , ,MUTE, , , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ), + + [_FN2] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , 0 , 1 , 2 , 3 , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/40percentclub/mf68/keymaps/factory/keymap.c b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c new file mode 100644 index 0000000000..0c5305e519 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c @@ -0,0 +1,74 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 +#define KC_ KC_TRNS +#define KC_X0 LT(_FN2, KC_CAPS) +#define KC_X1 MO(_FN1) +#define KC_X2 BL_STEP +#define KC_X3 BL_BRTG +#define KC_X4 BL_TOGG +#define KC_X5 BL_INC +#define KC_X6 BL_DEC + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, + /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, + /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , + /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , + /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ + LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT + /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + ), + + [_FN1] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , ,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , UP , , , , , , ,PSCR,SLCK,PAUS, X2 , , ,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + X0 ,LEFT,DOWN,RGHT, , X6 , X5 , X4 , X3 , X2 ,HOME, , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , ,MPLY,MSTP,MPRV,MNXT,VOLD,VOLU,MUTE, ,END , , X5 , + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , X3 , X6 , X4 + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ), + + [_FN2] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , 0 , 1 , 2 , 3 , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/40percentclub/mf68/mf68.c b/keyboards/40percentclub/mf68/mf68.c new file mode 100644 index 0000000000..1da522e7e1 --- /dev/null +++ b/keyboards/40percentclub/mf68/mf68.c @@ -0,0 +1,8 @@ +#include "mf68.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/40percentclub/mf68/mf68.h b/keyboards/40percentclub/mf68/mf68.h new file mode 100644 index 0000000000..a55c1d60b0 --- /dev/null +++ b/keyboards/40percentclub/mf68/mf68.h @@ -0,0 +1,40 @@ +#ifndef MF68_H +#define MF68_H + +#include "quantum.h" + +#define LAYOUT_68_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74 } \ +} + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) LAYOUT_68_ansi( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ + KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ + KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ + KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ + KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ +) + +#endif diff --git a/keyboards/40percentclub/mf68/readme.md b/keyboards/40percentclub/mf68/readme.md new file mode 100644 index 0000000000..825c265f16 --- /dev/null +++ b/keyboards/40percentclub/mf68/readme.md @@ -0,0 +1,18 @@ +# mf68 + +![mf68](https://3.bp.blogspot.com/-0YCA3Hx2Rq0/WD3U3GWhyvI/AAAAAAAB_Uo/RWTeyCPblGcxDrDwT9WL9ck2ZRuR26DgACLcB/s640/IMG_20161129_063741.jpg) +=== + +Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) + +Keyboard Maintainer: QMK Community +Hardware Supported: Pro Micro +Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/mf68: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/40percentclub/mf68/rules.mk b/keyboards/40percentclub/mf68/rules.mk new file mode 100644 index 0000000000..9f6445686d --- /dev/null +++ b/keyboards/40percentclub/mf68/rules.mk @@ -0,0 +1,68 @@ + +# MCU name +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 + + +# Boot Section Size in *bytes* +# 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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 + +LAYOUTS = 68_ansi \ No newline at end of file diff --git a/keyboards/40percentclub/mf68_ble/config.h b/keyboards/40percentclub/mf68_ble/config.h new file mode 100644 index 0000000000..83c0a7a5ac --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0510 +#define DEVICE_VER 0x0101 +#define MANUFACTURER di0ib +#define PRODUCT MF68 +#define DESCRIPTION Magicforce 68 BLE + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, C6, D7, B5, B6, B7, D6 } +#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, D2, D3 } +#define UNUSED_PINS {B5} + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW +/* +#define BACKLIGHT_PIN B5 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +*/ + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/40percentclub/mf68_ble/info.json b/keyboards/40percentclub/mf68_ble/info.json new file mode 100644 index 0000000000..4cd9b2c83c --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "MF68 BLE", + "url": "", + "maintainer": "qmk", + "width": 17.25, + "height": 5, + "layouts": { + "LAYOUT_68_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] + } + } +} diff --git a/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c b/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c new file mode 100644 index 0000000000..73045f3107 --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c @@ -0,0 +1,68 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _FN1 1 +#define _FN2 2 +#define KC_ KC_TRNS +#define KC_X0 LT(_FN2, KC_GRV) +#define KC_X1 MO(_FN1) +#define KC_X2 BL_STEP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, + /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ + TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, + /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ + X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , + /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ + LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , + /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ + LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT + /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ + ), + + [_FN1] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , , , , , , X2 , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , , , , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , ,MUTE, , , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ), + + [_FN2] = LAYOUT_kc( + /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ + GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, + /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ + , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, + /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ + , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , + /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ + , , , , , , 0 , 1 , 2 , 3 , , , MUTE, + /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ + , , , , , , , MPRV,MPLY,MNXT + /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ + ) +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; diff --git a/keyboards/40percentclub/mf68_ble/mf68_ble.c b/keyboards/40percentclub/mf68_ble/mf68_ble.c new file mode 100644 index 0000000000..95f8592f8f --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/mf68_ble.c @@ -0,0 +1,8 @@ +#include "mf68_ble.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/40percentclub/mf68_ble/mf68_ble.h b/keyboards/40percentclub/mf68_ble/mf68_ble.h new file mode 100644 index 0000000000..8ef14c98d4 --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/mf68_ble.h @@ -0,0 +1,40 @@ +#ifndef MF68_BLE_H +#define MF68_BLE_H + +#include "quantum.h" + +#define LAYOUT_68_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74 } \ +} + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ + K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ + K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ + K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ +) LAYOUT_68_ansi( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ + KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ + KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ + KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ + KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ +) + +#endif diff --git a/keyboards/40percentclub/mf68_ble/readme.md b/keyboards/40percentclub/mf68_ble/readme.md new file mode 100644 index 0000000000..0e0f4b90d8 --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/readme.md @@ -0,0 +1,29 @@ +# mf68_ble + +![mf68_ble](https://3.bp.blogspot.com/-0YCA3Hx2Rq0/WD3U3GWhyvI/AAAAAAAB_Uo/RWTeyCPblGcxDrDwT9WL9ck2ZRuR26DgACLcB/s640/IMG_20161129_063741.jpg) +=== + +Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). + +Keyboard Maintainer: QMK Community +Hardware Supported: [Feather 32u4 Bluefruit](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/) +Please note: This is 32u4 and not M0 +Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) +[MF68 thicc case files](https://github.com/harshitgoel96/mf68-case-thicc) +Story +----- + +The story and the idea behind this mod is available on [my reddit post](https://www.reddit.com/r/MechanicalKeyboards/comments/7eiiht/guide_i_built_a_bluetooth_enabled_magicforce68_no/) + +Wiring +------ + +Below is how you wire the Feather to PCB + +![wire map](https://i.imgur.com/zYOjlTA.png) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/mf68_ble: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/40percentclub/mf68_ble/rules.mk b/keyboards/40percentclub/mf68_ble/rules.mk new file mode 100644 index 0000000000..07b59d7853 --- /dev/null +++ b/keyboards/40percentclub/mf68_ble/rules.mk @@ -0,0 +1,67 @@ + +# MCU name +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 = 8000000 + + +# +# 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 + + +# Boot Section Size in *bytes* +# 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 ?= no # USB Nkey Rollover +BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE ?= no # MIDI controls +UNICODE_ENABLE ?= no # Unicode +BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE ?= no # Audio output on port C6 +BLUETOOTH = AdafruitBLE \ No newline at end of file diff --git a/keyboards/40percentclub/nano/config.h b/keyboards/40percentclub/nano/config.h new file mode 100644 index 0000000000..088fafcaa5 --- /dev/null +++ b/keyboards/40percentclub/nano/config.h @@ -0,0 +1,45 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xCEEB +#define PRODUCT_ID 0x0007 +#define DEVICE_VER 0x0001 +#define MANUFACTURER di0ib +#define PRODUCT Nano +#define DESCRIPTION 8 key microswitch board + +/* key matrix size */ +#define MATRIX_ROWS 2 +#define MATRIX_COLS 4 + +/* ws2812 RGB LED */ +#define RGB_DI_PIN D3 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 6 // Number of LEDs + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 + +#endif diff --git a/keyboards/40percentclub/nano/info.json b/keyboards/40percentclub/nano/info.json new file mode 100644 index 0000000000..b135a2d097 --- /dev/null +++ b/keyboards/40percentclub/nano/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Nano", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}] + } + } +} diff --git a/keyboards/40percentclub/nano/keymaps/default/keymap.c b/keyboards/40percentclub/nano/keymaps/default/keymap.c new file mode 100644 index 0000000000..cd9d4549de --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/default/keymap.c @@ -0,0 +1,19 @@ +#include QMK_KEYBOARD_H + +#define _MAIN 0 +#define _FN 1 + +#define _______ KC_TRNS +#define KC_X0 LT(_FN, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAIN] = LAYOUT( + KC_VOLU, KC_MPLY, KC_MPRV, KC_PGUP, + KC_VOLD, KC_MUTE, KC_MNXT, KC_PGDN + ), + + [_FN] = LAYOUT( + KC_F, _______, RGB_HUI, _______, + RGB_TOG, RGB_MOD, RGB_HUD, _______ + ) +}; diff --git a/keyboards/40percentclub/nano/keymaps/default/rules.mk b/keyboards/40percentclub/nano/keymaps/default/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/40percentclub/nano/keymaps/spooka/config.h b/keyboards/40percentclub/nano/keymaps/spooka/config.h new file mode 100644 index 0000000000..05900a215b --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/spooka/config.h @@ -0,0 +1,25 @@ +/* +Copyright 2018 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 + +#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/40percentclub/nano/keymaps/spooka/keymap.c b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c new file mode 100644 index 0000000000..63b90da09f --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c @@ -0,0 +1,12 @@ +#include QMK_KEYBOARD_H + +#define _MAIN 0 + +#define _______ KC_TRNS + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_MAIN] = LAYOUT( + RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, + RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD + ) +}; diff --git a/keyboards/40percentclub/nano/keymaps/spooka/rules.mk b/keyboards/40percentclub/nano/keymaps/spooka/rules.mk new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/keyboards/40percentclub/nano/keymaps/spooka/rules.mk @@ -0,0 +1 @@ + diff --git a/keyboards/40percentclub/nano/matrix.c b/keyboards/40percentclub/nano/matrix.c new file mode 100644 index 0000000000..fa2461af5f --- /dev/null +++ b/keyboards/40percentclub/nano/matrix.c @@ -0,0 +1,159 @@ +/* + +Note for ErgoDox EZ customizers: Here be dragons! +This is not a file you want to be messing with. +All of the interesting stuff for you is under keymaps/ :) +Love, Erez + +Copyright 2013 Oleg Kostyuk + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "action_layer.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "nano.h" +#include + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_stage[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static uint16_t debouncing_time; +static bool debouncing = false; + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + + DDRF &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); + PORTF |= (1<<4 | 1<<5 | 1<<6 | 1<<7); + DDRC &= ~(1<<6); + PORTC |= (1<<6); + DDRD &= ~(1<<0 | 1<<1 | 1<<4); + PORTD |= (1<<0 | 1<<1 | 1<<4); + + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + matrix_stage[i] = 0; + } + + matrix_init_quantum(); + +} + +uint8_t matrix_scan(void) +{ + matrix_stage[0] = + (PINF&(1<<4) ? 0 : (1<<0)) | + (PINF&(1<<5) ? 0 : (1<<1)) | + (PINF&(1<<6) ? 0 : (1<<2)) | + (PINF&(1<<7) ? 0 : (1<<3)); + matrix_stage[1] = + (PIND&(1<<1) ? 0 : (1<<0)) | + (PIND&(1<<0) ? 0 : (1<<1)) | + (PIND&(1<<4) ? 0 : (1<<2)) | + (PINC&(1<<6) ? 0 : (1<<3)); + + if (memcmp(matrix_debouncing, matrix_stage, sizeof(matrix)) != 0) { + debouncing = true; + debouncing_time = timer_read(); + } + + matrix_debouncing[0] = matrix_stage[0]; + matrix_debouncing[1] = matrix_stage[1]; + + if (debouncing && (timer_elapsed(debouncing_time) > 20)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_modified(void) +{ + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* eliminate lag on space cadet mods */ +#define PERMISSIVE_HOLD + +/* setup lighting */ +#define RGB_DI_PIN B5 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 30 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +#endif diff --git a/keyboards/40percentclub/tomato/info.json b/keyboards/40percentclub/tomato/info.json new file mode 100644 index 0000000000..f01f5e7e0b --- /dev/null +++ b/keyboards/40percentclub/tomato/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "Tomato", + "url": "", + "maintainer": "qmk", + "bootloader": "", + "width": 10, + "height": 3, + "layouts": { + "LAYOUT_ortho_3x10": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}] + } + } +} diff --git a/keyboards/40percentclub/tomato/keymaps/default/keymap.c b/keyboards/40percentclub/tomato/keymaps/default/keymap.c new file mode 100644 index 0000000000..94bfca202b --- /dev/null +++ b/keyboards/40percentclub/tomato/keymaps/default/keymap.c @@ -0,0 +1,158 @@ +#include QMK_KEYBOARD_H + +#define SPC_F1 LT(1,KC_SPC) +#define BS_F2 LT(2,KC_BSPC) +#define C_F3 LT(3,KC_C) +#define V_F4 LT(4,KC_V) +#define B_F5 LT(5,KC_B) +#define Z_CTL MT(MOD_LCTL, KC_Z) +#define X_ALT MT(MOD_LALT, KC_X) +#define N_ALT MT(MOD_RALT, KC_N) +#define M_CTL MT(MOD_RCTL, KC_M) +#define ENT_SFT MT(MOD_RSFT, KC_ENT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Level 0: Default Layer + * ,-------------------------------------------------------------------------------. + * | Q | W | E | R | T | Y | U | I | O | P | + * |-------------------------------------------------------------------------------| + * | A | S | D | F | G | H | J | K | L | ESC | + * |-------------------------------------------------------------------------------| + * | Z | X | C | V | BSPC | SPC | B | N | M | ENT | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P + , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC + , Z_CTL, X_ALT, C_F3, V_F4, BS_F2, SPC_F1, B_F5, N_ALT, M_CTL, ENT_SFT + ), + /* Level 1: Numbers Layer + * ,-------------------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |-------------------------------------------------------------------------------| + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | + * |-------------------------------------------------------------------------------| + * | | | | | DEL | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 + , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), + /* Level 2: Symbols Layer + * ,-------------------------------------------------------------------------------. + * | ! | @ | # | $ | % | ^ | & | * | ( | ) | + * |-------------------------------------------------------------------------------| + * | F11 | F12 | | | | | | | | ` | + * |-------------------------------------------------------------------------------| + * | | | | | | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN + , KC_F11, KC_F12,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_GRAVE + , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), + /* Level 3: RGB Layer + * ,-------------------------------------------------------------------------------. + * | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------------| + * | Tab | | | | | , | . | / | ; | ' | + * |-------------------------------------------------------------------------------| + * | | | | | | | Left | Down | Up | Right | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS + , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT + , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT + ), + /* Level 4: RGB Layer + * ,-------------------------------------------------------------------------------. + * | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------------| + * | Tab | | | | | < | > | ? | : | " | + * |-------------------------------------------------------------------------------| + * | | | | | | | Home | PgDn | PgUp | End | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE + , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO + , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_PGDN,KC_END + ), + /* Level 5: RGB Layer + * ,-------------------------------------------------------------------------------. + * | Calc | Web | Mail |Explore| | | | | | | + * |-------------------------------------------------------------------------------| + * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|xxxxxxx|xxxxxxx|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| + * |-------------------------------------------------------------------------------| + * | | | | | Flash | | | | | | + * '-------------------------------------------------------------------------------' + */ + LAYOUT_ortho_3x10 + ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,KC_NO, KC_NO, RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD + , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + } + return MACRO_NONE; +}; + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/40percentclub/tomato/readme.md b/keyboards/40percentclub/tomato/readme.md new file mode 100644 index 0000000000..f93105ffdd --- /dev/null +++ b/keyboards/40percentclub/tomato/readme.md @@ -0,0 +1,22 @@ +# Tomato + +![Tomato](https://2.bp.blogspot.com/-k6lyvfZz2WA/WXYyr508D7I/AAAAAAACB8A/UCNP2WCfvWAT8UWsCDICMRXwip5tAZsOwCLcBGAs/s640/a.JPG) +=== + +A 30 key keyboard with programmable rgb backlighting. + +* [The fluff](http://www.40percent.club/2017/07/tomato-in-gherkin.html) +* [The meat](https://github.com/di0ib/Misc/tree/master/tomato) + +Keyboard Maintainer: QMK Community +Hardware Supported: Tomato PCB +Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2017/07/tomato-in-gherkin.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/tomato: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). + +First pass at adding support for the tomato keyboard. Completely +untested. Intended to kick-start development. diff --git a/keyboards/40percentclub/tomato/rules.mk b/keyboards/40percentclub/tomato/rules.mk new file mode 100644 index 0000000000..cbb2b05196 --- /dev/null +++ b/keyboards/40percentclub/tomato/rules.mk @@ -0,0 +1,58 @@ +# MCU name +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 + + +# Boot Section Size in *bytes* +BOOTLOADER = caterina + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = yes + +LAYOUTS = ortho_3x10 diff --git a/keyboards/40percentclub/tomato/tomato.c b/keyboards/40percentclub/tomato/tomato.c new file mode 100644 index 0000000000..dbf8bfe12b --- /dev/null +++ b/keyboards/40percentclub/tomato/tomato.c @@ -0,0 +1 @@ +#include "tomato.h" diff --git a/keyboards/40percentclub/tomato/tomato.h b/keyboards/40percentclub/tomato/tomato.h new file mode 100644 index 0000000000..f8674be40e --- /dev/null +++ b/keyboards/40percentclub/tomato/tomato.h @@ -0,0 +1,18 @@ +#ifndef GHERKIN_H +#define GHERKIN_H + +#include "quantum.h" + +#define LAYOUT_ortho_3x10( \ + K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ + K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ + K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ +) { \ + { K00, K01, K02, K03, K04, K05 }, \ + { K10, K11, K12, K13, K14, K15 }, \ + { K20, K21, K22, K23, K24, K25 }, \ + { K30, K31, K32, K33, K34, K35 }, \ + { K40, K41, K42, K43, K44, K45 } \ +} + +#endif diff --git a/keyboards/40percentclub/ut47/LED_controls.ino b/keyboards/40percentclub/ut47/LED_controls.ino new file mode 100644 index 0000000000..dd50300eb7 --- /dev/null +++ b/keyboards/40percentclub/ut47/LED_controls.ino @@ -0,0 +1,420 @@ +#include +#include + +int iByte; +byte col = 0; +byte leds[12][4]; +byte pass = 1; +int fadecount = 1; +const int fadelimit = 3000; +const int fadelimitshort = 1000; +byte mode = 4; +byte brightness = 2; +boolean changemode = 0; +int rain = 0; +const int rainlimit = 5000; +const int rainfade = 5000; +byte rx = 0; +byte ry = 0; + +// pin[xx] on led matrix connected to nn on Arduino (-1 is dummy to make array start at pos 1) +int pins[17] = { + -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 14, 15, 18, 19, 20, 21 +}; + +// col[xx] of leds = pin yy on led matrix +int cols[12] = { + pins[8], pins[7], pins[6], pins[5], pins[9], pins[10], pins[11], pins[12], pins[13], pins[14], pins[15], pins[16] +}; + +// row[xx] of leds = pin yy on led matrix +int rows[4] = { + pins[1], pins[2], pins[3], pins[4] +}; + + +#define DELAY 0 +extern byte leds[12][4]; + +void setup() { + Serial1.begin(9600); + setupLeds(); + for (int s = 0; s < 5; s++) { + for ( int r = 1; r < 9; r++) { + delayMicroseconds(65000); + delayMicroseconds(65000); + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 12; i++) { + leds[i][j] = 1; + for (int p = 0; p < 25; p++) { + } + leds[i][j] = r; + } + } + } + for ( int r = 9; r > 0; r--) { + delayMicroseconds(65000); + delayMicroseconds(65000); + delayMicroseconds(65000); + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 12; i++) { + leds[i][j] = 1; + for (int p = 0; p < 25; p++) { + } + leds[i][j] = r; + } + } + } + } +} + +void loop() { + + switch (mode) { + case 0: + //Blacklight + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + leds[i][j] = brightness; + } + } + checkserial(); + break; + case 1: + //Breathing + for ( int r = 1; r < 9; r++) { + checkserial(); + if (changemode == 0) { + delayMicroseconds(65000); + delayMicroseconds(65000); + delayMicroseconds(65000); + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 12; i++) { + leds[i][j] = 1; + for (int p = 0; p < 25; p++) { + } + leds[i][j] = r; + } + } + } + else { + break; + } + } + for ( int r = 9; r > 0; r--) { + checkserial(); + if (changemode == 0) { + delayMicroseconds(65000); + delayMicroseconds(65000); + delayMicroseconds(65000); + delayMicroseconds(65000); + for (int j = 0; j < 4; j++) { + for (int i = 0; i < 12; i++) { + leds[i][j] = 1; + for (int p = 0; p < 25; p++) { + } + leds[i][j] = r; + } + } + } + else { + break; + } + } + for ( int r = 1; r < 30; r++) { + checkserial(); + if (changemode == 0) { + delayMicroseconds(65000); + delayMicroseconds(65000); + } + else { + break; + } + } + break; + case 2: + //Random + leds[random(12)][random(4)] = random(8); + delayMicroseconds(10000); + checkserial(); + break; + case 3: + //Rain + rain++; + if (rain > rainlimit) { + rain = 0; + rx = random(12); + ry = random(4); + if (leds[rx][ry] == 0) { + leds[rx][ry] = 18; + } + } + fadecount++; + if (fadecount > rainfade) { + fadecount = 1; + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + if (leds[i][j] > 0) { + leds[i][j] = leds[i][j] - 1; + } + } + } + } + checkserial(); + break; + case 4: + //Reactive + fadecount++; + if (fadecount > fadelimit) { + fadecount = 1; + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + if (leds[i][j] > 0) { + leds[i][j] = leds[i][j] - 1; + } + } + } + } + checkserial(); + break; + case 5: + //Reactive Target + fadecount++; + if (fadecount > fadelimitshort) { + fadecount = 1; + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + if (leds[i][j] > 0) { + leds[i][j] = leds[i][j] - 1; + } + } + } + } + checkserial(); + break; + default: + mode = 0; + break; + } + changemode = 0; +} + +void checkserial() { + if (Serial1.available() > 0) { + iByte = Serial1.read(); + if (iByte == 100) { + brightness++; + if (brightness > 9) { + brightness = 1; + } + } + if (iByte == 101) { + mode++; + } + if (iByte < 100) { + if (mode == 4) { + byte row = iByte / 16; + byte col = iByte % 16; + leds[col][row] = 18; + } + if (mode == 5) { + byte row = iByte / 16; + byte col = iByte % 16; + for (byte i = 0; i < 12; i++) { + leds[i][row] = 18; + } + for (byte p = 0; p < 4; p++) { + leds[col][p] = 18; + } + } + } + } +} + +void setupLeds() { + // sets the pins as output + FastGPIO::Pin<2>::setOutputLow(); + FastGPIO::Pin<3>::setOutputLow(); + FastGPIO::Pin<4>::setOutputLow(); + FastGPIO::Pin<5>::setOutputLow(); + FastGPIO::Pin<6>::setOutputLow(); + FastGPIO::Pin<7>::setOutputLow(); + FastGPIO::Pin<8>::setOutputLow(); + FastGPIO::Pin<9>::setOutputLow(); + FastGPIO::Pin<10>::setOutputLow(); + FastGPIO::Pin<16>::setOutputLow(); + FastGPIO::Pin<14>::setOutputLow(); + FastGPIO::Pin<15>::setOutputLow(); + FastGPIO::Pin<18>::setOutputLow(); + FastGPIO::Pin<19>::setOutputLow(); + FastGPIO::Pin<20>::setOutputLow(); + FastGPIO::Pin<21>::setOutputLow(); + + // set up Cols + FastGPIO::Pin<6>::setOutputValueLow(); + FastGPIO::Pin<7>::setOutputValueLow(); + FastGPIO::Pin<8>::setOutputValueLow(); + FastGPIO::Pin<9>::setOutputValueLow(); + FastGPIO::Pin<10>::setOutputValueLow(); + FastGPIO::Pin<16>::setOutputValueLow(); + FastGPIO::Pin<14>::setOutputValueLow(); + FastGPIO::Pin<15>::setOutputValueLow(); + FastGPIO::Pin<18>::setOutputValueLow(); + FastGPIO::Pin<19>::setOutputValueLow(); + FastGPIO::Pin<20>::setOutputValueLow(); + FastGPIO::Pin<21>::setOutputValueLow(); + + // set up Rows + FastGPIO::Pin<2>::setOutputValueLow(); + FastGPIO::Pin<3>::setOutputValueLow(); + FastGPIO::Pin<4>::setOutputValueLow(); + FastGPIO::Pin<5>::setOutputValueLow(); + + clearLeds(); + Timer1.initialize(25); + Timer1.attachInterrupt(display); + +} + +void clearLeds() { + // Clear display array + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + leds[i][j] = 0; + } + } +} + +void onLeds() { + // Clear display array + for (int i = 0; i < 12; i++) { + for (int j = 0; j < 4; j++) { + leds[i][j] = 7; + } + } +} + +// Interrupt routine +void display() { + + switch (col) { // Turn whole previous column off + case 0: + FastGPIO::Pin<6>::setOutputValueLow(); + break; + case 1: + FastGPIO::Pin<7>::setOutputValueLow(); + break; + case 2: + FastGPIO::Pin<8>::setOutputValueLow(); + break; + case 3: + FastGPIO::Pin<9>::setOutputValueLow(); + break; + case 4: + FastGPIO::Pin<10>::setOutputValueLow(); + break; + case 5: + FastGPIO::Pin<16>::setOutputValueLow(); + break; + case 6: + FastGPIO::Pin<14>::setOutputValueLow(); + break; + case 7: + FastGPIO::Pin<15>::setOutputValueLow(); + break; + case 8: + FastGPIO::Pin<18>::setOutputValueLow(); + break; + case 9: + FastGPIO::Pin<19>::setOutputValueLow(); + break; + case 10: + FastGPIO::Pin<20>::setOutputValueLow(); + break; + case 11: + FastGPIO::Pin<21>::setOutputValueLow(); + break; + } + + col++; + if (col == 12) { + col = 0; + pass++; + if (pass > 8) { + pass = 1; + } + } + for (int row = 0; row < 4; row++) { + if (leds[col][row] > pass) { + switch (row) { // Turn on this led + case 0: + FastGPIO::Pin<2>::setOutputValueLow(); + break; + case 1: + FastGPIO::Pin<3>::setOutputValueLow(); + break; + case 2: + FastGPIO::Pin<4>::setOutputValueLow(); + break; + case 3: + FastGPIO::Pin<5>::setOutputValueLow(); + break; + } + } + else { + switch (row) { // Turn off this led + case 0: + FastGPIO::Pin<2>::setOutputValueHigh(); + break; + case 1: + FastGPIO::Pin<3>::setOutputValueHigh(); + break; + case 2: + FastGPIO::Pin<4>::setOutputValueHigh(); + break; + case 3: + FastGPIO::Pin<5>::setOutputValueHigh(); + break; + } + } + } + switch (col) { // Turn column on + case 0: + FastGPIO::Pin<6>::setOutputValueHigh(); + break; + case 1: + FastGPIO::Pin<7>::setOutputValueHigh(); + break; + case 2: + FastGPIO::Pin<8>::setOutputValueHigh(); + break; + case 3: + FastGPIO::Pin<9>::setOutputValueHigh(); + break; + case 4: + FastGPIO::Pin<10>::setOutputValueHigh(); + break; + case 5: + FastGPIO::Pin<16>::setOutputValueHigh(); + break; + case 6: + FastGPIO::Pin<14>::setOutputValueHigh(); + break; + case 7: + FastGPIO::Pin<15>::setOutputValueHigh(); + break; + case 8: + FastGPIO::Pin<18>::setOutputValueHigh(); + break; + case 9: + FastGPIO::Pin<19>::setOutputValueHigh(); + break; + case 10: + FastGPIO::Pin<20>::setOutputValueHigh(); + break; + case 11: + FastGPIO::Pin<21>::setOutputValueHigh(); + break; + } + +} diff --git a/keyboards/40percentclub/ut47/config.h b/keyboards/40percentclub/ut47/config.h new file mode 100644 index 0000000000..4335e3edd5 --- /dev/null +++ b/keyboards/40percentclub/ut47/config.h @@ -0,0 +1,87 @@ +/* +Copyright 2018 Carlos Filoteo + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER 40percent.club +#define PRODUCT ut47 +#define DESCRIPTION An awesome 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +#define MATRIX_ROW_PINS { D1, D0, D4, C6 } +#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* Enable GNAP matrix serial output */ +#define GNAP_ENABLE + +/* USART configuration */ +#ifdef __AVR_ATmega32U4__ +# define SERIAL_UART_BAUD 9600 +# define SERIAL_UART_DATA UDR1 +# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +# define SERIAL_UART_RXD_VECT USART1_RX_vect +# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +# define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX */ \ + UCSR1B = _BV(TXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + sei(); \ + } while(0) +# else +# error "USART configuration is needed." +#endif + +#endif diff --git a/keyboards/40percentclub/ut47/info.json b/keyboards/40percentclub/ut47/info.json new file mode 100644 index 0000000000..59bffe99a3 --- /dev/null +++ b/keyboards/40percentclub/ut47/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "UT47", + "url": "", + "maintainer": "qmk", + "width": 12.5, + "height": 4, + "layouts": { + "LAYOUT": { + "key_count": 47, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Backspace", "x":11, "y":0, "w":1.5}, {"label":"LT(3) / Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.25}, {"label":"Shift", "x":0, "y":2, "w":1.5}, {"label":"Z", "x":1.5, "y":2}, {"label":"X", "x":2.5, "y":2}, {"label":"C", "x":3.5, "y":2}, {"label":"V", "x":4.5, "y":2}, {"label":"B", "x":5.5, "y":2}, {"label":"N", "x":6.5, "y":2}, {"label":"M", "x":7.5, "y":2}, {"label":"<", "x":8.5, "y":2}, {"label":">", "x":9.5, "y":2}, {"label":"?", "x":10.5, "y":2}, {"label":"Shift / Enter", "x":11.5, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"GUI", "x":2, "y":3}, {"label":"Menu", "x":3, "y":3}, {"label":"MO(2)", "x":4, "y":3, "w":1.25}, {"x":5.25, "y":3, "w":2}, {"label":"MO(1)", "x":7.25, "y":3, "w":1.25}, {"label":"\u2190", "x":8.5, "y":3}, {"label":"\u2193", "x":9.5, "y":3}, {"label":"\u2191", "x":10.5, "y":3}, {"label":"\u2192", "x":11.5, "y":3}] + } + } +} diff --git a/keyboards/40percentclub/ut47/keymaps/default/config.h b/keyboards/40percentclub/ut47/keymaps/default/config.h new file mode 100644 index 0000000000..46098a22fb --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/default/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/default/keymap.c b/keyboards/40percentclub/ut47/keymaps/default/keymap.c new file mode 100644 index 0000000000..6b6bb025b1 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/default/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define _______ KC_TRNS +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/default/readme.md b/keyboards/40percentclub/ut47/keymaps/default/readme.md new file mode 100644 index 0000000000..e09dc73fab --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/default/readme.md @@ -0,0 +1,19 @@ +# UT47 default keymap + +![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) + +[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) + +### LED Controls + +Use TAB+Z to cycle through brightness (8 steps) + +Use TAB+X to cycle through the following LED modes: + +- solid +- breathing +- random +- rain +- reactive +- poptang +- off diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/config.h b/keyboards/40percentclub/ut47/keymaps/non-us/config.h new file mode 100644 index 0000000000..46098a22fb --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/non-us/config.h @@ -0,0 +1,24 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here + +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c new file mode 100644 index 0000000000..1cb537b7d0 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c @@ -0,0 +1,136 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define _______ KC_TRNS +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| + * |-------------------------------------------------------------------------+ + * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | # | - | = | [ | ] | \ | + * |-------------------------------------------------------------------------+ + * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, KC_NUHS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | _ | + | { | } | | | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | Home| PgDn| PgUp| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left */ + KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | | | | | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | |MousL|MousD|MousU|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/readme.md b/keyboards/40percentclub/ut47/keymaps/non-us/readme.md new file mode 100644 index 0000000000..e09dc73fab --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/non-us/readme.md @@ -0,0 +1,19 @@ +# UT47 default keymap + +![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) + +[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) + +### LED Controls + +Use TAB+Z to cycle through brightness (8 steps) + +Use TAB+X to cycle through the following LED modes: + +- solid +- breathing +- random +- rain +- reactive +- poptang +- off diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/config.h b/keyboards/40percentclub/ut47/keymaps/nordic/config.h new file mode 100644 index 0000000000..fcdd2c2322 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/nordic/config.h @@ -0,0 +1,17 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c new file mode 100644 index 0000000000..cc3f43650e --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c @@ -0,0 +1,179 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" + +#endif + +#include "keymap_norwegian.h" + +#define _______ KC_TRNS +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) +#define CTRADEL LALT(LCTL(KC_DEL)) +#define ALTTAB LALT(KC_TAB) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Base Layer - L0 + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | + * |-------------------------------------------------------------------------+ + * |Tab/L3| A | S | D | F | G | H | J | K | L | ' |Ent/RS| + * |-------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | Up | L4 | + * |-------------------------------------------------------------------------+ + * | Ctrl| Gui | L4 | Alt | L2 | Space | L1 | Ctrl| Left| Down|Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Base - L0 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_APOS, MT_RSFT_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(4), + KC_LCTL, KC_LGUI, MO(4), KC_LALT, MO(2), KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + + /* FN Layer 1 + * ,-------------------------------------------------------------------------. + * | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| + * |-------------------------------------------------------------------------+ + * | | | | | | | | | + | = | * | / | + * |-------------------------------------------------------------------------+ + * | | | | | | | | | - | _ | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Right modifier - L1 */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, _______, NO_PLUS, NO_EQL, NO_ASTR, NO_SLSH, + _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, NO_UNDS, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 2 + * ,-------------------------------------------------------------------------. + * | § | ! | " | # | ¤ | % | & | / | = | + | \ | Delete| + * |-------------------------------------------------------------------------+ + * | | | ? | { | [ | ( | ) | ] | } | F10 | F11 | F12 | + * |-------------------------------------------------------------------------+ + * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | PgUp| | + * |-------------------------------------------------------------------------+ + * | | | |Capsl| | | | | Home| PgDn| End | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Left modifier - L2 */ + NO_SECT, KC_EXCLAIM, NO_QUO2, KC_HASH, NO_BULT, KC_PERCENT, NO_AMPR, NO_SLSH, NO_EQL, NO_PLUS, NO_BSLS, KC_DELETE, + _______, _______, NO_QUES, NO_LCBR, NO_LBRC, NO_LPRN, NO_RPRN, NO_RBRC, NO_RCBR, KC_F10, KC_F11, KC_F12, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_PGUP, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), + + /* FN Layer 3 + * ,-------------------------------------------------------------------------. + * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc|CtrAlDl| + * |-------------------------------------------------------------------------+ + * | | | | | | | |VolDn|VolUp| | | | + * |-------------------------------------------------------------------------+ + * | |LEDtg|LEDch| | |RESET| | Mute| |MouB1|MousU|MouB2| + * |-------------------------------------------------------------------------+ + * | | | | | | | | |MousL|MousD|MousR| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Hold Tab down - L3 */ + KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, CTRADEL, + _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, + _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R +), + + /* FN Layer 4 + * ,-------------------------------------------------------------------------. + * | | | @ | £ | $ | ~ | | ¨ | ´ | ` | Å | | + * |-------------------------------------------------------------------------+ + * | | | | € | | | | | ^ | Ø | Æ | | + * |-------------------------------------------------------------------------+ + * | | < | | | | | | µ | | | | | + * |-------------------------------------------------------------------------+ + * | | | | | | | | L5 | | | | + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* Norsk - L4 */ + _______, _______, NO_AT, NO_PND, NO_DLR, NO_TILD, _______, NO_QUOT, NO_ACUT, NO_GRV, NO_AA, _______, + _______, _______, _______, NO_EURO, _______, _______, _______, _______, NO_CIRC, NO_OSLH, NO_AE, _______, + _______, NO_LESS, _______, _______, _______, _______, _______, NO_MU, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, TO(5), _______, _______, _______ +), + + /* GAMING Layer (toggle on and off) + * ,-------------------------------------------------------------------------. + * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Alt+Tab| + * |-------------------------------------------------------------------------+ + * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| + * |-------------------------------------------------------------------------+ + * | Shift | 1 | 2 | 3 | 4 | 5 | 6 | F9 | F10 | F11 | Up |TOGGL| + * |-------------------------------------------------------------------------+ + * | Ctrl| Z | X | C | B | Space | M | V |Left |Down |Right| + * `-------------------------------------------------------------------------' + */ + +LAYOUT( /* GAMING, toggled on and off - L5 */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, ALTTAB, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, + KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), + KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/readme.md b/keyboards/40percentclub/ut47/keymaps/nordic/readme.md new file mode 100644 index 0000000000..4b0d0eb122 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/nordic/readme.md @@ -0,0 +1,33 @@ +# UT47 Nordic keymap + + +![UT47 Nordic layout image](https://i.imgur.com/ZNtF4wA.png) + +[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%2F%2F%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=Ctr%20Alt%20Del%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Alt%20Tab%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) + + +Chose to modify the layout to include dedicated arrows on the bottom right. Layers 1-4 are modifiers, layer 5 is a toggle on gaming mode. Tab is dual function: Tap for Tab and hold for L3. So is enter: tap for Enter and hold for Right shift. + +### Nordic characters +On its own modifier layer, accessed from left (between left GUI and ALT) or right (above Right arrow) + +### Gaming layer +Toggled on/off, accessed via the Nordic layer. + +Toggle on: L4+RCtrl + +Toggle off: L4 (above ) + +### LED Controls + +Use TAB+Z to cycle through brightness (8 steps) + +Use TAB+X to cycle through the following LED modes: + +- solid +- breathing +- random +- rain +- reactive +- poptang +- off diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/config.h b/keyboards/40percentclub/ut47/keymaps/rgb/config.h new file mode 100644 index 0000000000..0eb010a3ae --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/config.h @@ -0,0 +1,27 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +// place overrides here +#define RGBLIGHT_ANIMATIONS +#define RGB_DI_PIN D3 // The pin the LED strip is connected to +#define RGBLED_NUM 7 // Number of LEDs in your strip + +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c new file mode 100644 index 0000000000..58d11031ad --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c @@ -0,0 +1,88 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#include QMK_KEYBOARD_H +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +#define _______ KC_TRNS +#define LT3_TAB LT(3, KC_TAB) +#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) + +enum custom_keycodes { + LED_TOG = SAFE_RANGE, + LED_CHG +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +LAYOUT( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, + KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), + +LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +LAYOUT( + KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12, KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_DELETE, + _______, _______, _______, _______, _______, _______, _______, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END +), + +LAYOUT( /* Tab */ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R +), +}; + +//LED keymap functions + #ifdef LED_ENABLE +void led_chmode(void) { + serial_send(101); +} + +void led_toggle(void) { + serial_send(100); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case LED_TOG: + #ifdef LED_ENABLE + led_toggle(); + #endif + return false; + case LED_CHG: + #ifdef LED_ENABLE + led_chmode(); + #endif + return false; + } + } + return true; +}; +#endif diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/readme.md b/keyboards/40percentclub/ut47/keymaps/rgb/readme.md new file mode 100644 index 0000000000..00076bfc49 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/readme.md @@ -0,0 +1 @@ +WS2812B LED added and connected to pin D3 as described here: https://www.40percent.club/2018/04/gnap-underglow.html diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/rules.mk b/keyboards/40percentclub/ut47/keymaps/rgb/rules.mk new file mode 100644 index 0000000000..1e3cebb145 --- /dev/null +++ b/keyboards/40percentclub/ut47/keymaps/rgb/rules.mk @@ -0,0 +1 @@ +RGBLIGHT_ENABLE = yes diff --git a/keyboards/40percentclub/ut47/led.c b/keyboards/40percentclub/ut47/led.c new file mode 100644 index 0000000000..9458c038fe --- /dev/null +++ b/keyboards/40percentclub/ut47/led.c @@ -0,0 +1,38 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include +#include "stdint.h" +#include "led.h" + + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1<. +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif +static uint8_t debouncing = DEBOUNCE; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); + + +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 + unselect_rows(); + init_cols(); + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + +#ifdef LED_ENABLE + serial_init(); +#endif +} + +uint8_t matrix_scan(void) +{ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i] != cols) { + matrix_debouncing[i] = cols; + if (debouncing) { + debug("bounce!: "); debug_hex(debouncing); debug("\n"); + } + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debouncing[i]; + } + } + } + + return 1; +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<The reason this is an "opt-in" feature is to prevent sending serial communication over the pin, in case it ends up being used for something else (like RGB underglow). + +### Layout + +Go to the [default layout README](keymaps/default/readme.md) for more information. + +### Additional info + +Credit: Forked from [di0ib TMK version](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gnap) + +See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. + +### Build Guide + +[u/network_operations' build guide thread](https://www.reddit.com/r/MechanicalKeyboards/comments/7wqktu/gnap_the_cheap_40/) diff --git a/keyboards/40percentclub/ut47/rules.mk b/keyboards/40percentclub/ut47/rules.mk new file mode 100644 index 0000000000..b046598669 --- /dev/null +++ b/keyboards/40percentclub/ut47/rules.mk @@ -0,0 +1,70 @@ +# 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 +BOOTLOADER = caterina + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC += matrix.c protocol/serial_uart.c + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 +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 + +ifeq ($(strip $(LED_ENABLE)), yes) + OPT_DEFS += -DLED_ENABLE + SRC += led.c +endif diff --git a/keyboards/40percentclub/ut47/ut47.c b/keyboards/40percentclub/ut47/ut47.c new file mode 100644 index 0000000000..f467fd130a --- /dev/null +++ b/keyboards/40percentclub/ut47/ut47.c @@ -0,0 +1,50 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#include "ut47.h" +#ifdef LED_ENABLE + #include "protocol/serial.h" +#endif + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + if (record->event.pressed) { + #ifdef LED_ENABLE + serial_send((record->event.key.row*16)+record->event.key.col); + #endif + } + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/ut47/ut47.h b/keyboards/40percentclub/ut47/ut47.h new file mode 100644 index 0000000000..a4507dd34d --- /dev/null +++ b/keyboards/40percentclub/ut47/ut47.h @@ -0,0 +1,49 @@ +/* Copyright 2018 Carlos Filoteo + * + * 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 . + */ +#ifndef UT47_H +#define UT47_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ + } + +#define LAYOUT_kc( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ +) \ + LAYOUT( \ + KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, \ + KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, \ + KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, \ + KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b \ + ) + +#define LAYOUT_kc_ut47 LAYOUT_kc + +#endif diff --git a/keyboards/4x4/4x4.c b/keyboards/4x4/4x4.c deleted file mode 100644 index 963b6d00d4..0000000000 --- a/keyboards/4x4/4x4.c +++ /dev/null @@ -1,29 +0,0 @@ - -#include "4x4.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/4x4/4x4.h b/keyboards/4x4/4x4.h deleted file mode 100644 index ec75c3e280..0000000000 --- a/keyboards/4x4/4x4.h +++ /dev/null @@ -1,62 +0,0 @@ - -#ifndef FOURX4_H -#define FOURX4_H - -#include "quantum.h" -#define ___ KC_NO - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array - -#define LAYOUT_ortho_4x4( \ - K00, K01, K02, K03, \ - K10, K11, K12, K13, \ - K20, K21, K22, K23, \ - K30, K31, K32, K33 \ -) \ -{ \ - { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ -} -#define LAYOUT_ortho_4x8( \ - K00, K01, K02, K03, K04, K05, K06, K07, \ - K10, K11, K12, K13, K14, K15, K16, K17, \ - K20, K21, K22, K23, K24, K25, K26, K27, \ - K30, K31, K32, K33, K34, K35, K36, K37\ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___, ___, ___, ___, ___} \ -} -#define LAYOUT_ortho_4x12( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_4x16( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, K0f }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, K1f }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ -} - -#endif diff --git a/keyboards/4x4/config.h b/keyboards/4x4/config.h deleted file mode 100644 index e66e9433a9..0000000000 --- a/keyboards/4x4/config.h +++ /dev/null @@ -1,202 +0,0 @@ - - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x4444 -#define MANUFACTURER di0ib -#define PRODUCT The 4x4 Keyboard -#define DESCRIPTION A modular compact keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 16 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B2, D1, D0, D4 } -#define MATRIX_COL_PINS { C6, D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } -#define UNUSED_PINS - - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN C7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - diff --git a/keyboards/4x4/keymaps/default/config.h b/keyboards/4x4/keymaps/default/config.h deleted file mode 100644 index d533d806c9..0000000000 --- a/keyboards/4x4/keymaps/default/config.h +++ /dev/null @@ -1,5 +0,0 @@ - - -#pragma once - -// place overrides here diff --git a/keyboards/4x4/keymaps/default/keymap.c b/keyboards/4x4/keymaps/default/keymap.c deleted file mode 100644 index 144ec05c17..0000000000 --- a/keyboards/4x4/keymaps/default/keymap.c +++ /dev/null @@ -1,124 +0,0 @@ - -#include QMK_KEYBOARD_H - -#define PAD 0 -#define _QW 1 -#define NUM 2 -#define DIR 3 - -// Readability keycodes -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Single 4x4 board only - * .-----------------------------------. - * | 7 | 8 | 9 | / | - * |--------+--------+--------+--------| - * | 4 | 5 | 6 | * | - * |--------+--------+--------+--------| - * | 1 | 2 | 3 | - | - * |--------+--------+--------+--------| - * | 0 | QWERTY | . | + | - * '-----------------------------------' - */ - - [PAD] = LAYOUT_ortho_4x4( - KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, - KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, - KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, - KC_KP_0, DF(_QW), KC_KP_DOT, KC_PPLS - ), - -/* QWERTY - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | / | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | * | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | + | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [_QW] = LAYOUT_ortho_4x16( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, KC_PSLS, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, KC_PAST, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PPLS - ), - -/* NUMBERS - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | | - * | | | | | | | | | | |CTRLhold| | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| | - * | | | | | | | ENTER | SHIFT | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [NUM] = LAYOUT_ortho_4x16( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, - _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -/* DIRECTIONS - * .-----------------------------------------------------------------------------------------------------------------------------------------------. - * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | P-Brk | | | | | | | RGUI | ALT | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | KEYPAD | | | | | | | | | | | | | | | | - * '-----------------------------------------------------------------------------------------------------------------------------------------------' - */ - - [DIR] = LAYOUT_ortho_4x16( - RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, _______, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, _______, - _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, _______, - DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/4x4/readme.md b/keyboards/4x4/readme.md deleted file mode 100644 index 3ca074fddd..0000000000 --- a/keyboards/4x4/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# 4x4 - -![4x4](https://2.bp.blogspot.com/-xRZOpwlTT4c/WlOwRIVAecI/AAAAAAACKo4/d75juHTX2W0Nrch7NigssMbagvl3I4w_ACEwYBhgL/s1600/e.jpg) -=== - -**Modular keypad/keyboard** -The basic unit is a 4x4 matrix with 16 keys. Up to 4 of these can be connected to each other side by side. -4x4, 4x8, 4x12 and 4x16 are possible. -There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. -**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/4x4) - -Keyboard Maintainer: QMK Community -Hardware Supported: 4x4 PCB -Hardware Availability: [4x4x4x4x4 project on 40% Keyboards](http://www.40percent.club/2018/01/4x4x4x4x4.html) - -Make example for this keyboard (after setting up your build environment): - - make 4x4:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/4x4/rules.mk b/keyboards/4x4/rules.mk deleted file mode 100644 index b8b4bccc42..0000000000 --- a/keyboards/4x4/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -# 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 - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# 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 = caterina - -# 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -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) - -LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/5x5/5x5.c b/keyboards/5x5/5x5.c deleted file mode 100644 index 20e5246094..0000000000 --- a/keyboards/5x5/5x5.c +++ /dev/null @@ -1,29 +0,0 @@ - -#include "5x5.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/5x5/5x5.h b/keyboards/5x5/5x5.h deleted file mode 100644 index 45fb80a4f7..0000000000 --- a/keyboards/5x5/5x5.h +++ /dev/null @@ -1,57 +0,0 @@ - -#ifndef FIVEX5_H -#define FIVEX5_H - -#include "quantum.h" -#define ___ KC_NO - -// This a shortcut to help you visually see your layout. -// The first section contains all of the arguments -// The second converts the arguments into a two-dimensional array - -#define LAYOUT_ortho_5x5( \ - K00, K01, K02, K03, K04, \ - K10, K11, K12, K13, K14, \ - K20, K21, K22, K23, K24, \ - K30, K31, K32, K33, K34, \ - K40, K41, K42, K43, K44 \ -) \ -{ \ - { K00, K01, K02, K03, K04, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___}, \ - { K40, K41, K42, K43, K44, ___, ___, ___, ___, ___, ___, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_5x10( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49 \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, ___, ___, ___, ___, ___}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, ___, ___, ___, ___, ___}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, ___, ___, ___, ___, ___}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, ___, ___, ___, ___, ___}, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, ___, ___, ___, ___, ___} \ -} - -#define LAYOUT_ortho_5x15( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, \ - K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e \ -) \ -{ \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e}, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e}, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e}, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ -} - -#endif diff --git a/keyboards/5x5/config.h b/keyboards/5x5/config.h deleted file mode 100644 index bc609934e3..0000000000 --- a/keyboards/5x5/config.h +++ /dev/null @@ -1,208 +0,0 @@ - - -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x05B5 -#define MANUFACTURER di0ib -#define PRODUCT The 5x5 Keyboard -#define DESCRIPTION A 25 or 50 or 75 key keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B2, D1, D0, D4, C6 } -#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B7, D6, F7, F6, F5, F4, F1, F0, B3, B1 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ diff --git a/keyboards/5x5/keymaps/default/config.h b/keyboards/5x5/keymaps/default/config.h deleted file mode 100644 index d533d806c9..0000000000 --- a/keyboards/5x5/keymaps/default/config.h +++ /dev/null @@ -1,5 +0,0 @@ - - -#pragma once - -// place overrides here diff --git a/keyboards/5x5/keymaps/default/keymap.c b/keyboards/5x5/keymaps/default/keymap.c deleted file mode 100644 index a2c525d089..0000000000 --- a/keyboards/5x5/keymaps/default/keymap.c +++ /dev/null @@ -1,139 +0,0 @@ - -#include QMK_KEYBOARD_H - -#define PAD 0 -#define _QW 1 -#define NUM 2 -#define DIR 3 - -// Readability keycodes -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Single 5x5 board only - * .--------------------------------------------. - * | QWERTY | / | * | - | | - * |--------+--------+--------+--------+--------| - * | 7 | 8 | 9 | + | | - * |--------+--------+--------+--------+--------| - * | 4 | 5 | 6 | + | | - * |--------+--------+--------+--------+--------| - * | 1 | 2 | 3 | ENTER | | - * |--------+--------+--------+--------+--------| - * | 0 | 0 | . | ENTER | | - * '--------------------------------------------' - */ - - [PAD] = LAYOUT_ortho_5x5( - DF(_QW), KC_PSLS, KC_PAST, KC_PMNS, _______, - KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, _______, - KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, _______, - KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT, _______, - KC_KP_0, KC_KP_0, KC_KP_DOT, KC_PENT, _______ - ), - -/* QWERTY - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ESC | Q | W | E | R | T | Y | U | I | O | P | BACKSP | 7 | 8 | 9 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | TAB | A | S | D | F | G | H | J | K | L | ; | ' | 4 | 5 | 6 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENT/SFT| 1 | 2 | 3 | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | LCTRL | LGUI | ALT | ALT | NUM | SHIFT | SPACE | DIR | RGUI | RALT | DEL | CTRL | 0 | 0 | . | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [_QW] = LAYOUT_ortho_5x15( - _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, _______, - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_KP_4, KC_KP_5, KC_KP_6, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, MO(NUM), KC_LSFT, KC_SPC, MO(DIR), KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT - ), - -/* NUMBERS - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | NUMLOCK| / | * | - | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | | | + | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | F11 | F12 | | | | ENTER | SHIFT | RGUI | ./ALT | BKSC | | | | ENTER | - * | | | | | | | | | | |CTRLhold| | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | | ENTER | SHIFT | | | | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [NUM] = LAYOUT_ortho_5x15( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, - _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ - ), - -/* DIRECTIONS - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | RESET | TAB | up | | INS | CTRL | SHIFT | PgUp | Home | - | = | DEL | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | CAPSLK | left | down | right | PrScr | SHIFT | CTRL | PgDn | End | [ | ] | \ | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | P-Brk | | | | | | | RGUI | ALT | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | KEYPAD | | | | | | | | | | | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [DIR] = LAYOUT_ortho_5x15( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - RESET, KC_TAB, KC_UP, _______, KC_INS, KC_LCTL, KC_LSFT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_DEL, _______, _______, _______, - KC_CAPS, KC_LEFT, KC_DOWN, KC_RGHT, KC_PSCR, KC_LSFT, KC_LCTL, KC_PGDN, KC_END, KC_LBRC, KC_RBRC, KC_BSLS, _______, _______, _______, - _______, KC_PAUS, _______, _______, _______, _______, _______, _______, KC_RGUI, KC_RALT, _______, _______, _______, _______, _______, - DF(PAD), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/5x5/readme.md b/keyboards/5x5/readme.md deleted file mode 100644 index e25535968d..0000000000 --- a/keyboards/5x5/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# 5x5 - -![5x5](https://3.bp.blogspot.com/-bKOfUyMtdrE/WqGA_03kGZI/AAAAAAACPtY/DsHDTQS0IlMD3ie8HHlf1ATRUAwpZdcSgCLcBGAs/s1600/c.jpg) -=== - -**Modular Keypad/Keyboard** -The basic unit is a 5x5 matrix with 25 keys. Up to 3 of these can be connected to each other side by side. -5x5, 5x10, and 5x15 matrices are possible. -There are pads for header pins on each side that complete the circuits from board to board. These can be permanently connected with solder bridges or temporarily with pin headers and shunt jumpers. -**_All configurations are powered by a SINGLE Arduino Micro or clone (NOT a Pro Micro)._** - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/5x5) - -Keyboard Maintainer: QMK Community -Hardware Supported: 5x5 PCB -Hardware Availability: [5x5 project on 40% Keyboards](http://www.40percent.club/2018/04/5x5.html) - -Make example for this keyboard (after setting up your build environment): - - make 5x5:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the 4x4 keyboard. Compiles but completely untested. Intended to kick-start development. diff --git a/keyboards/5x5/rules.mk b/keyboards/5x5/rules.mk deleted file mode 100644 index 24e0e020fd..0000000000 --- a/keyboards/5x5/rules.mk +++ /dev/null @@ -1,74 +0,0 @@ -# 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 - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# 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 = caterina - -# 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 = no # USB Nkey Rollover -BACKLIGHT_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) - -LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/keyboards/6lit/6lit.c b/keyboards/6lit/6lit.c deleted file mode 100644 index fd3ae7d009..0000000000 --- a/keyboards/6lit/6lit.c +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include "6lit.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - {{2, 2}, {1, 2}, {0, 2}}, - {{2, 3}, {1, 3}, {0, 3}}, - {{0, 0}, {1, 0}, {2, 0}}, - {{0, 1}, {1, 1}, {2, 1}}, -}; -#endif diff --git a/keyboards/6lit/6lit.h b/keyboards/6lit/6lit.h deleted file mode 100644 index ae0beea35d..0000000000 --- a/keyboards/6lit/6lit.h +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2018 - * - * 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 - -#include "quantum.h" -#define ________ KC_NO - -#ifndef FLIP_HALF -#define LAYOUT_split( \ - L00, L01, L02, R00, R01, R02, \ - L10, L11, L12, R10, R11, R12 \ -) { \ - { L00, L01, L02 }, \ - { L10, L11, L12 }, \ - { R02, R01, R00 }, \ - { R12, R11, R10 }, \ -} -#else -#define LAYOUT_split( \ - L00, L01, L02, R00, R01, R02, \ - L10, L11, L12, R10, R11, R12 \ -) { \ - { L00, L01, L02 }, \ - { L10, L11, L12 }, \ - { R00, R01, R02 }, \ - { R10, R11, R12 }, \ -} -#endif - -#define LAYOUT_macro( \ - L00, L01, L02, \ - L10, L11, L12 \ -) { \ - { L00, L01, L02 }, \ - { L10, L11, L12 }, \ -} - -#define LAYOUT LAYOUT_macro - -#ifdef USE_I2C - #error "I2C not Supported" -#endif diff --git a/keyboards/6lit/config.h b/keyboards/6lit/config.h deleted file mode 100644 index 8397818a61..0000000000 --- a/keyboards/6lit/config.h +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2018 - * - * 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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0F61 -#define MANUFACTURER di0ib -#define PRODUCT The 6lit Macropad -#define DESCRIPTION A split 12 key Macropad - -#define USE_SERIAL - -/* Select hand configuration */ -#define MASTER_LEFT -//#define MASTER_RIGHT -//#define EE_HANDS - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 2*2 -#define MATRIX_COLS 3 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D7, E6 } -#define MATRIX_COL_PINS { F6, F7, B1 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ diff --git a/keyboards/6lit/info.json b/keyboards/6lit/info.json deleted file mode 100644 index ce1a7d6e16..0000000000 --- a/keyboards/6lit/info.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "keyboard_name": "6lit", - "url": "", - "maintainer": "qmk", - "width": 6, - "height": 2, - "layouts": { - "LAYOUT_macro": { - "key_count": 6, - "layout": [ - {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, - {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1} - ] - }, - "LAYOUT_split": { - "key_count": 12, - "layout": [ - {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, - {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1} - ] - } - } -} diff --git a/keyboards/6lit/keymaps/default/config.h b/keyboards/6lit/keymaps/default/config.h deleted file mode 100644 index 6173b63272..0000000000 --- a/keyboards/6lit/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 - * - * 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 - -// place overrides here diff --git a/keyboards/6lit/keymaps/default/keymap.c b/keyboards/6lit/keymaps/default/keymap.c deleted file mode 100644 index 6864c72f78..0000000000 --- a/keyboards/6lit/keymaps/default/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_split( /* Base */ - KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, \ - KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 \ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/6lit/keymaps/default/readme.md b/keyboards/6lit/keymaps/default/readme.md deleted file mode 100644 index b3acc3f58a..0000000000 --- a/keyboards/6lit/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default split keymap for 6lit diff --git a/keyboards/6lit/keymaps/macro/config.h b/keyboards/6lit/keymaps/macro/config.h deleted file mode 100644 index 6173b63272..0000000000 --- a/keyboards/6lit/keymaps/macro/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 - * - * 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 - -// place overrides here diff --git a/keyboards/6lit/keymaps/macro/keymap.c b/keyboards/6lit/keymaps/macro/keymap.c deleted file mode 100644 index 6b10ac1330..0000000000 --- a/keyboards/6lit/keymaps/macro/keymap.c +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_macro( /* Base */ - KC_F19, KC_F20, KC_F21, \ - KC_F22, KC_F23, KC_F24 \ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/6lit/keymaps/macro/readme.md b/keyboards/6lit/keymaps/macro/readme.md deleted file mode 100644 index 9f883b821c..0000000000 --- a/keyboards/6lit/keymaps/macro/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default single board macro keymap for 6lit diff --git a/keyboards/6lit/readme.md b/keyboards/6lit/readme.md deleted file mode 100644 index d5b2100285..0000000000 --- a/keyboards/6lit/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# 6lit - -![6lit](https://1.bp.blogspot.com/-Pa8RgYZ0hy8/Wbmr4bjuV0I/AAAAAAACDbI/WLKQMDlcDVAVf1lAIRMN51usR1XcCCVNgCLcBGAs/s1600/a.JPG) - -6 key macropad that fits within the 100mm x 100mm PCB size. Can be used singly as a regular 6 key macropad as well. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/6lit) - -Keyboard Maintainer: QMK Community -Hardware Supported: 6lit PCB -Hardware Availability: [6lit project on 40% Keyboards](http://www.40percent.club/2017/09/6lit.html) - -Make example for this keyboard (after setting up your build environment): - - make 6lit: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/6lit/rules.mk b/keyboards/6lit/rules.mk deleted file mode 100644 index 3275651650..0000000000 --- a/keyboards/6lit/rules.mk +++ /dev/null @@ -1,83 +0,0 @@ -# MCU name -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 = caterina - - -# 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 = lite # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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) - -# Enable generic behavior for split boards -SPLIT_KEYBOARD = yes diff --git a/keyboards/foobar/config.h b/keyboards/foobar/config.h deleted file mode 100644 index 89219c4607..0000000000 --- a/keyboards/foobar/config.h +++ /dev/null @@ -1,230 +0,0 @@ -/* Copyright 2018 - * - * 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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0F00 -#define MANUFACTURER di0ib -#define PRODUCT The foobar Keyboard -#define DESCRIPTION A split 30 key keyboard - -#define USE_SERIAL - -/* Select hand configuration */ -#define MASTER_LEFT -//#define MASTER_RIGHT -//#define EE_HANDS - -/* key matrix size */ -// Rows are doubled-up -#define MATRIX_ROWS 3*2 -#define MATRIX_COLS 5 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D7, E6, B4 } -#define MATRIX_COL_PINS { F6, F7, B1, B3, B2 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -// #define RGB_DI_PIN E2 -// #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 -// #endif - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ diff --git a/keyboards/foobar/foobar.c b/keyboards/foobar/foobar.c deleted file mode 100644 index c032056a15..0000000000 --- a/keyboards/foobar/foobar.c +++ /dev/null @@ -1,55 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include "foobar.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} - -#ifdef SWAP_HANDS_ENABLE -__attribute__ ((weak)) -const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { - {{4, 3}, {3, 3}, {2, 3}, {1, 3}, {0, 3}}, - {{4, 4}, {3, 4}, {2, 4}, {1, 4}, {0, 4}}, - {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, - {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, - {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, - {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, -}; -#endif diff --git a/keyboards/foobar/foobar.h b/keyboards/foobar/foobar.h deleted file mode 100644 index fc49c72aaf..0000000000 --- a/keyboards/foobar/foobar.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright 2018 - * - * 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 - -#include "quantum.h" -#define ___ KC_NO - -#ifndef FLIP_HALF -#define LAYOUT_split( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ -) { \ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { R04, R03, R02, R01, R00 }, \ - { R14, R13, R12, R11, R10 }, \ - { R24, R23, R22, R21, R20 } \ -} -#else -#define LAYOUT_split( \ - L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ - L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ - L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ -) { \ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { R00, R01, R02, R03, R04 }, \ - { R10, R11, R12, R13, R14 }, \ - { R20, R21, R22, R23, R24 } \ -} -#endif - -#define LAYOUT_macro( \ - L00, L01, L02, L03, L04, \ - L10, L11, L12, L13, L14, \ - L20, L21, L22, L23, L24 \ -) { \ - { L00, L01, L02, L03, L04 }, \ - { L10, L11, L12, L13, L14 }, \ - { L20, L21, L22, L23, L24 }, \ - { ___, ___, ___, ___, ___ }, \ - { ___, ___, ___, ___, ___ }, \ - { ___, ___, ___, ___, ___ } \ -} - -#define LAYOUT LAYOUT_macro - -#ifdef USE_I2C - #error "I2C not Supported" -#endif diff --git a/keyboards/foobar/info.json b/keyboards/foobar/info.json deleted file mode 100644 index cb7f29b256..0000000000 --- a/keyboards/foobar/info.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "keyboard_name": "foobar", - "url": "", - "maintainer": "qmk", - "width": 6, - "height": 2, - "layouts": { - "LAYOUT_macro": { - "key_count": 15, - "layout": [ - {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, - {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, - {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2} - ] - }, - "LAYOUT_split": { - "key_count": 30, - "layout": [ - {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, - {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, - {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2} - ] - } - } -} diff --git a/keyboards/foobar/keymaps/default/config.h b/keyboards/foobar/keymaps/default/config.h deleted file mode 100644 index 6173b63272..0000000000 --- a/keyboards/foobar/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 - * - * 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 - -// place overrides here diff --git a/keyboards/foobar/keymaps/default/keymap.c b/keyboards/foobar/keymaps/default/keymap.c deleted file mode 100644 index b750c61851..0000000000 --- a/keyboards/foobar/keymaps/default/keymap.c +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include QMK_KEYBOARD_H - -#define _______ KC_TRNS -#define FN1_Q LT(1, KC_Q) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_split( - FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, - KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [1] = LAYOUT_split( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/foobar/keymaps/default/readme.md b/keyboards/foobar/keymaps/default/readme.md deleted file mode 100644 index 7113469e7e..0000000000 --- a/keyboards/foobar/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default split keymap for foobar diff --git a/keyboards/foobar/keymaps/macro/config.h b/keyboards/foobar/keymaps/macro/config.h deleted file mode 100644 index 6173b63272..0000000000 --- a/keyboards/foobar/keymaps/macro/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 - * - * 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 - -// place overrides here diff --git a/keyboards/foobar/keymaps/macro/keymap.c b/keyboards/foobar/keymaps/macro/keymap.c deleted file mode 100644 index 1e7ec905fd..0000000000 --- a/keyboards/foobar/keymaps/macro/keymap.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Copyright 2018 - * - * 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 . - */ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_macro( /* Base */ - KC_F13, KC_F14, KC_F15, KC_F16, KC_INT1, \ - KC_F17, KC_F18, KC_F19, KC_F20, KC_INT2, \ - KC_F21, KC_F22, KC_F23, KC_F14, KC_INT5 \ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/foobar/keymaps/macro/readme.md b/keyboards/foobar/keymaps/macro/readme.md deleted file mode 100644 index 4cc59e7e5d..0000000000 --- a/keyboards/foobar/keymaps/macro/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default single board macro keymap for foobar diff --git a/keyboards/foobar/readme.md b/keyboards/foobar/readme.md deleted file mode 100644 index 3898d4bb1a..0000000000 --- a/keyboards/foobar/readme.md +++ /dev/null @@ -1,17 +0,0 @@ -# foobar - -![foobar](https://2.bp.blogspot.com/-rr8TK6xg2N0/WbwVL2O7EfI/AAAAAAACDc8/209wN69ju0wAFICYYPNLIEGQhat5-5MbwCLcBGAs/s640/a.JPG) - -Split 30% keyboard that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 15 key macropad. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/foobar) - -Keyboard Maintainer: QMK Community -Hardware Supported: foobar PCB -Hardware Availability: [foobar project on 40% Keyboards](http://www.40percent.club/2017/09/foobar-10.html) - -Make example for this keyboard (after setting up your build environment): - - make foobar: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/foobar/rules.mk b/keyboards/foobar/rules.mk deleted file mode 100644 index 3275651650..0000000000 --- a/keyboards/foobar/rules.mk +++ /dev/null @@ -1,83 +0,0 @@ -# MCU name -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 = caterina - - -# 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 = lite # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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) - -# Enable generic behavior for split boards -SPLIT_KEYBOARD = yes diff --git a/keyboards/gherkin/README.md b/keyboards/gherkin/README.md deleted file mode 100644 index 5e0daeabf9..0000000000 --- a/keyboards/gherkin/README.md +++ /dev/null @@ -1,18 +0,0 @@ -Gherkin -=== - -A 30 key keyboard. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gherkin) - -Keyboard Maintainer: QMK Community -Hardware Supported: Gherkin PCB -Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2016/11/gherkin.html) - -Make example for this keyboard (after setting up your build environment): - - make gherkin:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -First pass at adding support for the gherkin keyboard. Compiles but completely -untested. Intended to kick-start development. diff --git a/keyboards/gherkin/config.h b/keyboards/gherkin/config.h deleted file mode 100644 index 34f38e35c2..0000000000 --- a/keyboards/gherkin/config.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 40 Percent Club -#define PRODUCT Gherkin -#define DESCRIPTION A 30 key ortholinear keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, C6, D4, D0 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 3 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -#ifdef RGB_DI_PIN -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 0 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 -#endif - -#endif diff --git a/keyboards/gherkin/gherkin.c b/keyboards/gherkin/gherkin.c deleted file mode 100644 index 2952d842cf..0000000000 --- a/keyboards/gherkin/gherkin.c +++ /dev/null @@ -1 +0,0 @@ -#include "gherkin.h" diff --git a/keyboards/gherkin/gherkin.h b/keyboards/gherkin/gherkin.h deleted file mode 100644 index f8674be40e..0000000000 --- a/keyboards/gherkin/gherkin.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GHERKIN_H -#define GHERKIN_H - -#include "quantum.h" - -#define LAYOUT_ortho_3x10( \ - K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ - K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ - K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ -) { \ - { K00, K01, K02, K03, K04, K05 }, \ - { K10, K11, K12, K13, K14, K15 }, \ - { K20, K21, K22, K23, K24, K25 }, \ - { K30, K31, K32, K33, K34, K35 }, \ - { K40, K41, K42, K43, K44, K45 } \ -} - -#endif diff --git a/keyboards/gherkin/info.json b/keyboards/gherkin/info.json deleted file mode 100644 index 7ebbfb04be..0000000000 --- a/keyboards/gherkin/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "Gherkin", - "url": "", - "maintainer": "qmk", - "width": 10, - "height": 3, - "layouts": { - "LAYOUT_ortho_3x10": { - "key_count": 30, - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}] - } - } -} diff --git a/keyboards/gherkin/keymaps/bbaserdem/README.md b/keyboards/gherkin/keymaps/bbaserdem/README.md deleted file mode 100644 index 3c9a5e98b3..0000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Gherkin Layout -This is my gherkin layout. -It is used as a game pad, and key layout is inspired by spare keys I had lying around. -The firmware is very simple, and only includes one layer keymap, and RGB effects. - -# Flashing -The following command should be used from the main qmk directory. -``` -make gherkin:bbaserdem -sudo avrdude -p atmgea34u4 -P `ls /dev/ttyACM*` -c avr109 -U flash:.build/gherkin_bbaserdem.hex -``` diff --git a/keyboards/gherkin/keymaps/bbaserdem/config.h b/keyboards/gherkin/keymaps/bbaserdem/config.h deleted file mode 100644 index 37d7113e78..0000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/config.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H - -#include "../../config.h" -#define RGB_DI_PIN F6 -#define RGBLED_NUM 10 -#define RGBLIGHT_ANIMATIONS -#ifdef BACKLIGHT_LEVELS -#undef BACKLIGHT_LEVELS -#endif -#define BACKLIGHT_LEVELS 3 - -#endif diff --git a/keyboards/gherkin/keymaps/bbaserdem/keymap.c b/keyboards/gherkin/keymaps/bbaserdem/keymap.c deleted file mode 100644 index 0d3c8557c5..0000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/keymap.c +++ /dev/null @@ -1,36 +0,0 @@ -// This is a game-pad gherkin layout with RGB and LED lights - -#include QMK_KEYBOARD_H - -backlight_config_t backlight_config; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Game pad - * ,-----------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | Ctl | Alt | ~ | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Tab | Q | W | E | R | T | |^| | ; | ' | / | - * |-----+-----+-----+-----+-----+-----+-----+-----+-----+-----| - * | Shf | A | S | D | F | <-- | |v| | --> | , | . | - * `-----------------------------------------------------------' - */ - LAYOUT_ortho_3x10( - KC_ESCAPE, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_LCTRL, KC_LALT, KC_GRAVE, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_UP, KC_SCLN, KC_QUOTE, KC_SLASH, - KC_LSHIFT, KC_A, KC_S, KC_D, KC_F, KC_LEFT, KC_DOWN, KC_RIGHT, KC_COMMA, KC_DOT - ) -}; - -void matrix_init_user(void) { - // Set LED's to max - _delay_us(300); - backlight_config.level = 2; - backlight_config.enable = 1; - eeconfig_update_backlight(backlight_config.raw); - backlight_set(backlight_config.level); - // Set RGB to rainbow mood light - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv(120,255,255); - rgblight_mode(6); -} diff --git a/keyboards/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/gherkin/keymaps/bbaserdem/rules.mk deleted file mode 100644 index cd1cddebf4..0000000000 --- a/keyboards/gherkin/keymaps/bbaserdem/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -USER_NAME := bbaserdem-nouserspace - -STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -AUDIO_ENABLE = no # Enable audio output from keyboard - -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -RGBLIGHT_ENABLE = yes # Enable RBG light strips -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality diff --git a/keyboards/gherkin/keymaps/default/keymap.c b/keyboards/gherkin/keymaps/default/keymap.c deleted file mode 100644 index f018200304..0000000000 --- a/keyboards/gherkin/keymaps/default/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _______ KC_TRNS -#define FN1_Q LT(1, KC_Q) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [0] = LAYOUT_ortho_3x10( - FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, - KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [1] = LAYOUT_ortho_3x10( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_INC, - _______, _______, _______, _______, _______, _______, RESET, _______, _______, BL_DEC - ), - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 0); PORTB &= ~(1 << 0); - } else { - DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/gherkin/keymaps/itsaferbie/config.h b/keyboards/gherkin/keymaps/itsaferbie/config.h deleted file mode 100644 index 71c0cb8b56..0000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/config.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#undef RGB_DI_PIN -#undef RGBLED_NUM -#define RGB_DI_PIN D2 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/gherkin/keymaps/itsaferbie/keymap.c deleted file mode 100644 index 580b041c9c..0000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/keymap.c +++ /dev/null @@ -1,152 +0,0 @@ -#include QMK_KEYBOARD_H - -extern rgblight_config_t rgblight_config; -extern keymap_config_t keymap_config; - -#define _PS 0 // This is the Photoshop Layer -#define _AI 1 // This is the Illustrator Layer -#define _PR 2 // This is the Premier Layer -#define _XD 3 // This is the Experience Design Layer - -enum custom_keycodes { - PS = SAFE_RANGE, - AI, - PR, -}; - -#define _______ KC_TRNS - -#define PS TO(0) -#define AI TO(1) -#define PR TO(2) -#define XD TO(3) - -// Mix of Photoshop, Illustrator, Premiere, and Experience Design shortcuts. -#define SAVE LCTL(KC_S) -#define OPEN LCTL(KC_O) -#define COPY LCTL(KC_C) -#define PAST LCTL(KC_V) -#define CUNDO LCTL(LALT(KC_Z)) -#define INVERT LCTL(LSFT(KC_I)) -#define NLAYER LSFT(LCTL(KC_N)) -#define UNDO LCTL(KC_Z) -#define TRANS LCTL(KC_T) -#define ALIGNL LCTL(LSFT(KC_L)) -#define ALIGNC LCTL(LSFT(KC_C)) -#define ALIGNR LCTL(LSFT(KC_R)) -#define BRINGF LCTL(KC_RBRC) -#define BRINGB LCTL(KC_LBRC) - -// Illustrator layer shortcuts. -#define SHAPE LSFT(KC_M) -#define RULER LCTL(LALT(KC_R)) - -// Premiere layer shortcuts. -#define REDO LCTL(LSFT(KC_Z)) -#define EXPORT LCTL(KC_M) -#define IMPORT LCTL(KC_I) -#define PCOPY LCTL(KC_V) -#define PPASTE LCTL(LSFT(KC_V)) - -// Experience Design layer shortcuts. (can be used with others too.) -#define NEW LCTL(KC_N) -#define LOCK LCTL(KC_L) -#define SYMB LCTL(KC_K) -#define HIDE LCTL(KC_SCLN) -#define REPEAT LCTL(KC_R) -#define MASK LCTL(LSFT(KC_M)) -#define GROUP LCTL(KC_G) -#define UNGRP LCTL(LSFT(KC_G)) -#define VIEW LCTL(KC_TAB) -#define HORZ LSFT(KC_C) -#define VERT LSFT(KC_M) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - // Photoshop layer - [_PS] = LAYOUT_ortho_3x10( - SAVE, KC_W, KC_E, KC_T, KC_U, KC_I, KC_P, INVERT, CUNDO, NLAYER, - UNDO, KC_H, KC_L, TRANS, ALIGNL, ALIGNC, ALIGNR, BRINGB, BRINGF, OPEN, - KC_LSFT, COPY, PAST, KC_Z, KC_C, KC_V, KC_B, KC_LBRC, KC_RBRC, AI - ), - - // Illustrator layer - [_AI] = LAYOUT_ortho_3x10( - _______, M(0), RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, - _______, _______, _______, KC_E, _______, _______, _______, SHAPE, KC_O, OPEN, - _______, _______, _______, _______, _______, _______, _______, KC_M, KC_SLSH, PR - ), - - // Premiere layer - [_PR] = LAYOUT_ortho_3x10( - _______, KC_Q, KC_W, KC_I, KC_O, KC_P, IMPORT, EXPORT, KC_MINS, KC_EQL, - _______, REDO, KC_D, KC_F, KC_H, KC_M, KC_ENT, KC_LBRC, KC_RBRC, OPEN, - _______, PCOPY, PPASTE, KC_SPC, KC_Z, KC_C, KC_V, KC_LEFT, KC_RIGHT, XD - ), - - // Experience Design layer - [_XD] = LAYOUT_ortho_3x10( - _______, KC_E, KC_R, KC_T, KC_P, KC_A, KC_L, KC_V, KC_DEL, NEW, - _______, REDO, GROUP, UNGRP, VIEW, HORZ, VERT, KC_Z, KC_ENT, OPEN, - _______, KC_LCTL, COPY, PAST, SYMB, LOCK, MASK, HIDE, REPEAT, PS - ), - -}; - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void matrix_init_user(void) { - rgblight_enable(); -} - -void matrix_scan_user(void) { - #ifdef RGBLIGHT_ENABLE - - static uint8_t old_layer = 255; - uint8_t new_layer = biton32(layer_state); - - // Color of the Icons. - if (old_layer != new_layer) { - switch (new_layer) { - case _PS: - // #31C5F0 - rgblight_setrgb(49, 197, 240); - break; - case _AI: - // #FF8011 - rgblight_setrgb(255, 128, 17); - break; - case _PR: - // #E788FF - rgblight_setrgb(231, 136, 255); - break; - case _XD: - // #FF2BC2 - rgblight_setrgb(255, 43, 194); - break; - } - old_layer = new_layer; - } - #endif -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - case 0: - // Save for Web Macro. - return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END); - } - return MACRO_NONE; -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - } - return true; -} diff --git a/keyboards/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/gherkin/keymaps/itsaferbie/rules.mk deleted file mode 100644 index ed0af7b8bd..0000000000 --- a/keyboards/gherkin/keymaps/itsaferbie/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -BACKLIGHT_ENABLE = yes -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/mjt/config.h b/keyboards/gherkin/keymaps/mjt/config.h deleted file mode 100644 index bb59ec213d..0000000000 --- a/keyboards/gherkin/keymaps/mjt/config.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Some Guy -#define PRODUCT Gherkin -#define DESCRIPTION 30 percent disaster - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ - -// These are with USB on the left. -// #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } -// original from TMK: #define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } -// #define MATRIX_COL_PINS { D0, D4, F6, D7, E6, B4 } - -// these are with USB on the right. -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, F6, D4, D0 } - -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 -#define BACKLIGHT_PIN B5 - -/* 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 - -#define AUDIO_VOICES - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/gherkin/keymaps/mjt/keymap.c b/keyboards/gherkin/keymaps/mjt/keymap.c deleted file mode 100644 index 2b4369c34f..0000000000 --- a/keyboards/gherkin/keymaps/mjt/keymap.c +++ /dev/null @@ -1,279 +0,0 @@ -#include QMK_KEYBOARD_H -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -extern keymap_config_t keymap_config; - -//Tap Dance Declarations -enum { - TD_Z_LCTL = 0, - TD_X_LGUI = 1, - TD_C_LALT = 2, - TD_A_TAB = 3, - TD_Q_ESC = 4, -// M(0) -}; - -//Friendly Layer Names -enum gherkin_layers { - _QWERTY, - _SONGS, - _NUMBERS, - _SYMBOLS, - _PLOVER, - _ADJUST -}; - -// custom keycodes -enum gherkin_keycodes { - QWERTY = SAFE_RANGE, - NUMBERS, - SYMBOLS, - SONGS, - PLOVER, - BACKLIT, - MACSLEEP, - EXT_PLV -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_ortho_3x10( - TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - TD(TD_A_TAB), LT(_SYMBOLS,KC_S), KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_ADJUST,KC_SPC), - TD(TD_Z_LCTL), TD(TD_X_LGUI), TD(TD_C_LALT), KC_V, KC_B, LT(_NUMBERS, KC_N), KC_M, KC_COMM, KC_DOT, SFT_T(KC_ENT) - ), - [_NUMBERS] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_HOME, KC_PGDN, KC_PGUP, KC_END , - KC_F7, KC_F8, KC_F9, KC_F10, LT(_ADJUST,KC_F11), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT - ), - [_SYMBOLS] = LAYOUT_ortho_3x10( - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, - KC_GRV, _______, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, KC_MINS, KC_EQL , KC_SCLN, KC_QUOT, - KC_TILD, MO(_ADJUST), XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, KC_UNDS, KC_PLUS, S(KC_SCLN), S(KC_QUOT) - ), - [_PLOVER] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_1, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX - ), - [_ADJUST] = LAYOUT_ortho_3x10( - RESET, _______, _______, _______, _______, QWERTY, NUMBERS, SYMBOLS, PLOVER, SONGS, - MUV_DE, MUV_IN, MU_ON, MU_OFF, _______, _______, _______, _______, MACSLEEP, _______, - BACKLIT, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float tone_plover[][2] = SONG(PLOVER_SOUND); -float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); - -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case NUMBERS: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistant_default_layer_set(1UL<<_NUMBERS); - } - return false; - break; - case SYMBOLS: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistant_default_layer_set(1UL<<_SYMBOLS); - } - return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(tone_plover); - #endif - layer_off(_NUMBERS); - layer_off(_SYMBOLS); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_plover_gb); - #endif - layer_off(_PLOVER); - } - return false; - break; - case MACSLEEP: - if (record->event.pressed) { - // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - } - return true; -} - - -/* -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - - switch (id) { - case 0: { - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - } - else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. - return MACRO( D(LSFT), END ); - } - else { - return MACRO( T(N), END ); - } - } - break; - } - } - return MACRO_NONE; -}*/ - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{ - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -void matrix_scan_user(void) { -} - -//Tap Dance Definitions -qk_tap_dance_action_t tap_dance_actions[] = { - //Tap once for Esc, twice for Caps Lock - [TD_Z_LCTL] = ACTION_TAP_DANCE_DOUBLE(KC_Z, KC_LCTL), - [TD_X_LGUI] = ACTION_TAP_DANCE_DOUBLE(KC_X, KC_LGUI), - [TD_C_LALT] = ACTION_TAP_DANCE_DOUBLE(KC_C, KC_LALT), - [TD_A_TAB] = ACTION_TAP_DANCE_DOUBLE(KC_A, KC_TAB), - [TD_Q_ESC] = ACTION_TAP_DANCE_DOUBLE(KC_Q, KC_ESC) -}; - -// don't know what this is doing... -/* -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - DDRD |= (1 << 5); PORTD &= ~(1 << 5); - } else { - DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 0); PORTB &= ~(1 << 0); - } else { - DDRB &= ~(1 << 0); PORTB &= ~(1 << 0); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} -*/ diff --git a/keyboards/gherkin/keymaps/mjt/rules.mk b/keyboards/gherkin/keymaps/mjt/rules.mk deleted file mode 100644 index afb93b674c..0000000000 --- a/keyboards/gherkin/keymaps/mjt/rules.mk +++ /dev/null @@ -1,29 +0,0 @@ -## not sure where this stuff goes ## -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # 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. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE=yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/gherkin/keymaps/steno/config.h b/keyboards/gherkin/keymaps/steno/config.h deleted file mode 100644 index abacefa01d..0000000000 --- a/keyboards/gherkin/keymaps/steno/config.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define NO_ACTION_LAYER -#define NO_ACTION_TAPPING -#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION - -#endif \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/steno/keymap.c b/keyboards/gherkin/keymaps/steno/keymap.c deleted file mode 100644 index c7ee63d126..0000000000 --- a/keyboards/gherkin/keymaps/steno/keymap.c +++ /dev/null @@ -1,13 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ortho_3x10( - STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR , - STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR , - STN_NUM, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, STN_NUM), -}; - -void matrix_init_user() { - steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT -} \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/steno/readme.md b/keyboards/gherkin/keymaps/steno/readme.md deleted file mode 100644 index 6536ed7aba..0000000000 --- a/keyboards/gherkin/keymaps/steno/readme.md +++ /dev/null @@ -1,9 +0,0 @@ -# Gherkin Steno - -This is a stenography-only keymap. It boots by default into GeminiPR mode. All the excess stuff is stripped away (I'd remove normal keyboard support if I could). - -> Note: The number bar has been moved to the bottom row in all the left-over spaces. - - | S | T | P | H | * | F | P | L | T | D | - | S | K | W | R | * | R | B | G | S | Z | - | # | # | A | O | # | E | U | # | # | # | diff --git a/keyboards/gherkin/keymaps/steno/rules.mk b/keyboards/gherkin/keymaps/steno/rules.mk deleted file mode 100644 index fa813f2099..0000000000 --- a/keyboards/gherkin/keymaps/steno/rules.mk +++ /dev/null @@ -1,16 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB 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 -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no \ No newline at end of file diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/gherkin/keymaps/talljoe-gherkin/config.h deleted file mode 100644 index 7fa3bf328e..0000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/config.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#endif diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c deleted file mode 100644 index ea2921924e..0000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/keymap.c +++ /dev/null @@ -1,58 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -#define ST_BOLT QK_STENO_BOLT -#define ST_GEM QK_STENO_GEMINI - -#define XXXXXXX KC_NO - -enum keyboard_layers { - _QWERTY, - _RAISE, - _LOWER, - _PLOVER, - _ADJUST -}; - -#define ADJ_Z LT(_ADJUST, KC_Z) -#define RS_BSPC LT(_RAISE, KC_BSPC) -#define LW_SPC LT(_LOWER, KC_SPC) -#define MO_ADJ MO(_ADJUST) -#define TG_PLV TG(_PLOVER) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_LGUI OSM(MOD_LGUI) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT_ortho_3x10( - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_RSFT, - ADJ_Z, KC_X, KC_C, KC_V, RS_BSPC, LW_SPC, KC_B, KC_N, KC_M, KC_ENT - ), - - [_RAISE] = LAYOUT_ortho_3x10( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_7, KC_9, KC_0, - KC_ESC, KC_MINS, KC_EQL, _______, KC_LBRC, KC_RBRC, _______, KC_QUOT, KC_SCLN, _______, - OS_LCTL, OS_LGUI, OS_LALT, KC_GRV, _______, KC_TAB, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH - ), - - [_LOWER] = LAYOUT_ortho_3x10( - KC_F1, KC_F2, KC_F3, KC_F4, XXXXXXX, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, - KC_F5, KC_F6, KC_F7, KC_F8, XXXXXXX, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, - KC_F9, KC_F10, KC_F11, KC_F12, KC_DEL, _______, OS_LALT, OS_LGUI, OS_LCTL, KC_CAPS - ), - - [_PLOVER] = LAYOUT_ortho_3x10( - STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - MO_ADJ, STN_NUM, STN_A, STN_O, STN_NUM, STN_E, STN_U, STN_NUM, STN_NUM, XXXXXXX - ), - - [_ADJUST] = LAYOUT_ortho_3x10( - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ST_BOLT, ST_GEM, TG_PLV, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET - ), - -}; diff --git a/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk deleted file mode 100644 index 02216ecb36..0000000000 --- a/keyboards/gherkin/keymaps/talljoe-gherkin/rules.mk +++ /dev/null @@ -1,6 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/gherkin/rules.mk b/keyboards/gherkin/rules.mk deleted file mode 100644 index 416ca5e5f4..0000000000 --- a/keyboards/gherkin/rules.mk +++ /dev/null @@ -1,59 +0,0 @@ -# MCU name -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no - -LAYOUTS = ortho_3x10 diff --git a/keyboards/luddite/README.md b/keyboards/luddite/README.md deleted file mode 100644 index 72666dda5f..0000000000 --- a/keyboards/luddite/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# Luddite - -Luddite 60% keyboard with backlight and RGB underglow. - -* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/luddite) - -Keyboard Maintainer: QMK Community -Hardware Supported: Luddite PCB -Hardware Availability: [Luddite project on 40% Keyboards](http://www.40percent.club/search/label/luddite) - -Make example for this keyboard (after setting up your build environment): - - make luddite: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). - -First pass at adding support for the luddite keyboard. Compiles but completely -untested. Intended to kick-start development. diff --git a/keyboards/luddite/config.h b/keyboards/luddite/config.h deleted file mode 100644 index 62ff72bb03..0000000000 --- a/keyboards/luddite/config.h +++ /dev/null @@ -1,48 +0,0 @@ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x1001 -#define MANUFACTURER di0ib -#define PRODUCT Luddite -#define DESCRIPTION Luddite Keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 8 - -/* key matrix pins */ -#define MATRIX_ROW_PINS { D3, D2, D1, D0, D4, C6, D7, E6 } -#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6 } -#define UNUSED_PINS - -/* number of backlight levels */ -#define BACKLIGHT_PIN B5 -#ifdef BACKLIGHT_PIN -#define BACKLIGHT_LEVELS 4 -#endif - -/* Set 0 if debouncing isn't needed */ -#define DEBOUNCING_DELAY 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 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* ws2812 RGB LED */ -#define RGB_DI_PIN B4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 8 // Number of LEDs -// #define RGBLIGHT_HUE_STEP 10 -// #define RGBLIGHT_SAT_STEP 17 -// #define RGBLIGHT_VAL_STEP 17 diff --git a/keyboards/luddite/keymaps/default/keymap.c b/keyboards/luddite/keymaps/default/keymap.c deleted file mode 100644 index 4d6ae0d524..0000000000 --- a/keyboards/luddite/keymaps/default/keymap.c +++ /dev/null @@ -1,32 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -// 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 _BASE 0 -#define _FN1 1 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT_60_ansi( - KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL - ), - - [_FN1] = LAYOUT_60_ansi( - KC_GESC, 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_BSPC, \ - RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_GRV, _______, _______, _______, _______, _______, _______, _______ - ) -}; diff --git a/keyboards/luddite/luddite.c b/keyboards/luddite/luddite.c deleted file mode 100644 index 3e720ad571..0000000000 --- a/keyboards/luddite/luddite.c +++ /dev/null @@ -1 +0,0 @@ -#include "luddite.h" diff --git a/keyboards/luddite/luddite.h b/keyboards/luddite/luddite.h deleted file mode 100644 index 1ba743e9e7..0000000000 --- a/keyboards/luddite/luddite.h +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "quantum.h" - -#define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K10, K11, K12, K13, K14, K15, \ - K16, K17, K20, K21, K22, K23, K24, K25, K26, K27, K30, K31, K32, K33, \ - K34, K35, K36, K37, K40, K41, K42, K43, K44, K45, K46, K47, K50, \ - K51, K52, K53, K54, K55, K56, K57, K60, K61, K62, K63, K64, \ - K65, K66, K67, K70, K71, K72, K73, K74\ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K70, K71, K72, K73, K74 }, \ -} - diff --git a/keyboards/luddite/rules.mk b/keyboards/luddite/rules.mk deleted file mode 100644 index 2f7d847bf0..0000000000 --- a/keyboards/luddite/rules.mk +++ /dev/null @@ -1,59 +0,0 @@ -# MCU name -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -LAYOUTS = 60_ansi diff --git a/keyboards/mf68/README.md b/keyboards/mf68/README.md deleted file mode 100644 index 7dd3a900a5..0000000000 --- a/keyboards/mf68/README.md +++ /dev/null @@ -1,18 +0,0 @@ -MF68 -==== - -Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). - -Keyboard Maintainer: [di0ib](http://www.40percent.club) -Hardware Supported: Pro Micro -Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) - -Make example for this keyboard (after setting up your build environment): - - make mf68:default - -Example of flashing this keyboard: - - make mf68:default:avrdude - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/mf68/config.h b/keyboards/mf68/config.h deleted file mode 100644 index 07d787eacf..0000000000 --- a/keyboards/mf68/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0510 -#define DEVICE_VER 0x0101 -#define MANUFACTURER di0ib -#define PRODUCT MF68 -#define DESCRIPTION Magicforce 68 with programmable PCB replacement - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { B6, B2, B3, B1, F7, F6, F5, F4 } -#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/mf68/info.json b/keyboards/mf68/info.json deleted file mode 100644 index fae15aaf5f..0000000000 --- a/keyboards/mf68/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "MF68", - "url": "", - "maintainer": "qmk", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT_68_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] - } - } -} diff --git a/keyboards/mf68/keymaps/default/keymap.c b/keyboards/mf68/keymaps/default/keymap.c deleted file mode 100644 index 73045f3107..0000000000 --- a/keyboards/mf68/keymaps/default/keymap.c +++ /dev/null @@ -1,68 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_GRV) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , X2 , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68/keymaps/factory/keymap.c b/keyboards/mf68/keymaps/factory/keymap.c deleted file mode 100644 index 0c5305e519..0000000000 --- a/keyboards/mf68/keymaps/factory/keymap.c +++ /dev/null @@ -1,74 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_CAPS) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP -#define KC_X3 BL_BRTG -#define KC_X4 BL_TOGG -#define KC_X5 BL_INC -#define KC_X6 BL_DEC - - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , ,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , UP , , , , , , ,PSCR,SLCK,PAUS, X2 , , ,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - X0 ,LEFT,DOWN,RGHT, , X6 , X5 , X4 , X3 , X2 ,HOME, , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , ,MPLY,MSTP,MPRV,MNXT,VOLD,VOLU,MUTE, ,END , , X5 , - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , X3 , X6 , X4 - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68/mf68.c b/keyboards/mf68/mf68.c deleted file mode 100644 index 1da522e7e1..0000000000 --- a/keyboards/mf68/mf68.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "mf68.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} diff --git a/keyboards/mf68/mf68.h b/keyboards/mf68/mf68.h deleted file mode 100644 index a55c1d60b0..0000000000 --- a/keyboards/mf68/mf68.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef MF68_H -#define MF68_H - -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ - { K70, K71, K72, K73, K74 } \ -} - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT_68_ansi( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ - KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ - KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ - KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ - KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ -) - -#endif diff --git a/keyboards/mf68/rules.mk b/keyboards/mf68/rules.mk deleted file mode 100644 index 9f6445686d..0000000000 --- a/keyboards/mf68/rules.mk +++ /dev/null @@ -1,68 +0,0 @@ - -# MCU name -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 - - -# Boot Section Size in *bytes* -# 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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 - -LAYOUTS = 68_ansi \ No newline at end of file diff --git a/keyboards/mf68_ble/README.md b/keyboards/mf68_ble/README.md deleted file mode 100644 index 3829c8fd7d..0000000000 --- a/keyboards/mf68_ble/README.md +++ /dev/null @@ -1,27 +0,0 @@ -MF68 -==== - -Magicforce 68 with [replacement PCB](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68) designed by [di0ib](https://github.com/di0ib). - -Keyboard Maintainer: [di0ib](http://www.40percent.club) -Hardware Supported: [Feather 32u4 Bluefruit](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le/) -Please note: This is 32u4 and not M0 -Hardware Availability: [PCB files](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/mf68/pcb) -[MF68 thicc case files](https://github.com/harshitgoel96/mf68-case-thicc) -Story ------ - -The story and the idea behind this mod is available on [my reddit post](https://www.reddit.com/r/MechanicalKeyboards/comments/7eiiht/guide_i_built_a_bluetooth_enabled_magicforce68_no/) - -Wiring ------- - -Below is how you wire the Feather to PCB - -![wire map](https://i.imgur.com/zYOjlTA.png) - -Make example for this keyboard (after setting up your build environment): - - make mf68_ble:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/mf68_ble/config.h b/keyboards/mf68_ble/config.h deleted file mode 100644 index 83c0a7a5ac..0000000000 --- a/keyboards/mf68_ble/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0510 -#define DEVICE_VER 0x0101 -#define MANUFACTURER di0ib -#define PRODUCT MF68 -#define DESCRIPTION Magicforce 68 BLE - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D1, D0, C6, D7, B5, B6, B7, D6 } -#define MATRIX_COL_PINS { C7, F7, F6, F5, F4, F1, F0, D2, D3 } -#define UNUSED_PINS {B5} - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW -/* -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 -*/ - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/mf68_ble/info.json b/keyboards/mf68_ble/info.json deleted file mode 100644 index 4cd9b2c83c..0000000000 --- a/keyboards/mf68_ble/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "MF68 BLE", - "url": "", - "maintainer": "qmk", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT_68_ansi": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"x":15.25, "y":1}, {"x":16.25, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"x":15.25, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"x":14.25, "y":4}, {"x":15.25, "y":4}, {"x":16.25, "y":4}] - } - } -} diff --git a/keyboards/mf68_ble/keymaps/default/keymap.c b/keyboards/mf68_ble/keymaps/default/keymap.c deleted file mode 100644 index 73045f3107..0000000000 --- a/keyboards/mf68_ble/keymaps/default/keymap.c +++ /dev/null @@ -1,68 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _QWERTY 0 -#define _FN1 1 -#define _FN2 2 -#define KC_ KC_TRNS -#define KC_X0 LT(_FN2, KC_GRV) -#define KC_X1 MO(_FN1) -#define KC_X2 BL_STEP - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , BSPC , INS ,PGUP, - /*|----`----`----`----`----`----`----`----`----`----`----`----`----`--------| |----`----| */ - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, BSLS , DEL ,PGDN, - /*|------`----`----`----`----`----`----`----`----`----`----`----`----`------| `----`----' */ - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, ENTER , - /*|-------`----`----`----`----`----`----`----`----`----`----`----`----------| ,----. */ - LSFT , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, RSFT , UP , - /*|---------`----`----`----`----`----`----`----`----`----`----`-------------.--|----|----. */ - LCTL ,LGUI ,LALT , SPACE , X1 ,RALT ,RCTL , LEFT,DOWN,RGHT - /*`-----+-----+-----+------------------------------+------+-----+-----' `----+----+----' */ - ), - - [_FN1] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , , , , , , X2 , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , , , , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , ,MUTE, , , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ), - - [_FN2] = LAYOUT_kc( - /*,----+----+----+----+----+----+----+----+----+----+----+----+----+--------. ,----+----. */ - GRV , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 ,F11 ,F12 , BSPC , VOLU,HOME, - /*|esc-`-1--`-2--`-3--`-4--`-5--`-6--`-7--`-8--`-9--`-0--`mnus`plus`--bksp--| |ins-`pgup| */ - , , , UP , , , , 7 , 8 , 9 , , , , , VOLD,END, - /*|tab---`-q--`-w--`-e--`-r--`-t--`-y--`-u--`-i--`-o--`-p--`-{--`-}--`--|---| `del-`pgdn' */ - , ,LEFT,DOWN,RGHT, , , 4 , 5 , 6 , , , , - /*|caps---`-a--`-s--`-d--`-f--`-g--`-h--`-j--`-k--`-l--`-;--`-'--`----enter-| ,----. */ - , , , , , , 0 , 1 , 2 , 3 , , , MUTE, - /*|shift----`-z--`-x--`-c--`-v--`-b--`-n--`-m--`-,--`-.--`-/--`-------shift-.--|-up-|----. */ - , , , , , , , MPRV,MPLY,MNXT - /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ - ) -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/mf68_ble/mf68_ble.c b/keyboards/mf68_ble/mf68_ble.c deleted file mode 100644 index 95f8592f8f..0000000000 --- a/keyboards/mf68_ble/mf68_ble.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "mf68_ble.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} diff --git a/keyboards/mf68_ble/mf68_ble.h b/keyboards/mf68_ble/mf68_ble.h deleted file mode 100644 index 8ef14c98d4..0000000000 --- a/keyboards/mf68_ble/mf68_ble.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef MF68_BLE_H -#define MF68_BLE_H - -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ - { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ - { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ - { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ - { K70, K71, K72, K73, K74 } \ -} - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74 \ -) LAYOUT_68_ansi( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, \ - KC_##K40, KC_##K41, KC_##K42, KC_##K43, KC_##K44, KC_##K45, KC_##K46, KC_##K47, KC_##K48, \ - KC_##K50, KC_##K51, KC_##K52, KC_##K53, KC_##K54, KC_##K55, KC_##K56, KC_##K57, KC_##K58, \ - KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ - KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ -) - -#endif diff --git a/keyboards/mf68_ble/rules.mk b/keyboards/mf68_ble/rules.mk deleted file mode 100644 index 07b59d7853..0000000000 --- a/keyboards/mf68_ble/rules.mk +++ /dev/null @@ -1,67 +0,0 @@ - -# MCU name -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 = 8000000 - - -# -# 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 - - -# Boot Section Size in *bytes* -# 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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -BLUETOOTH = AdafruitBLE \ No newline at end of file diff --git a/keyboards/nano/config.h b/keyboards/nano/config.h deleted file mode 100644 index 088fafcaa5..0000000000 --- a/keyboards/nano/config.h +++ /dev/null @@ -1,45 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xCEEB -#define PRODUCT_ID 0x0007 -#define DEVICE_VER 0x0001 -#define MANUFACTURER di0ib -#define PRODUCT Nano -#define DESCRIPTION 8 key microswitch board - -/* key matrix size */ -#define MATRIX_ROWS 2 -#define MATRIX_COLS 4 - -/* ws2812 RGB LED */ -#define RGB_DI_PIN D3 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 6 // Number of LEDs - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -#define TAPPING_TERM 200 - -#endif diff --git a/keyboards/nano/info.json b/keyboards/nano/info.json deleted file mode 100644 index b135a2d097..0000000000 --- a/keyboards/nano/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "Nano", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 2, - "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}] - } - } -} diff --git a/keyboards/nano/keymaps/default/keymap.c b/keyboards/nano/keymaps/default/keymap.c deleted file mode 100644 index cd9d4549de..0000000000 --- a/keyboards/nano/keymaps/default/keymap.c +++ /dev/null @@ -1,19 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _MAIN 0 -#define _FN 1 - -#define _______ KC_TRNS -#define KC_X0 LT(_FN, KC_ESC) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MAIN] = LAYOUT( - KC_VOLU, KC_MPLY, KC_MPRV, KC_PGUP, - KC_VOLD, KC_MUTE, KC_MNXT, KC_PGDN - ), - - [_FN] = LAYOUT( - KC_F, _______, RGB_HUI, _______, - RGB_TOG, RGB_MOD, RGB_HUD, _______ - ) -}; diff --git a/keyboards/nano/keymaps/default/rules.mk b/keyboards/nano/keymaps/default/rules.mk deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/keyboards/nano/keymaps/spooka/config.h b/keyboards/nano/keymaps/spooka/config.h deleted file mode 100644 index 05900a215b..0000000000 --- a/keyboards/nano/keymaps/spooka/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -Copyright 2018 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 - -#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/nano/keymaps/spooka/keymap.c b/keyboards/nano/keymaps/spooka/keymap.c deleted file mode 100644 index 63b90da09f..0000000000 --- a/keyboards/nano/keymaps/spooka/keymap.c +++ /dev/null @@ -1,12 +0,0 @@ -#include QMK_KEYBOARD_H - -#define _MAIN 0 - -#define _______ KC_TRNS - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_MAIN] = LAYOUT( - RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, - RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD - ) -}; diff --git a/keyboards/nano/keymaps/spooka/rules.mk b/keyboards/nano/keymaps/spooka/rules.mk deleted file mode 100644 index 8b13789179..0000000000 --- a/keyboards/nano/keymaps/spooka/rules.mk +++ /dev/null @@ -1 +0,0 @@ - diff --git a/keyboards/nano/matrix.c b/keyboards/nano/matrix.c deleted file mode 100644 index fa2461af5f..0000000000 --- a/keyboards/nano/matrix.c +++ /dev/null @@ -1,159 +0,0 @@ -/* - -Note for ErgoDox EZ customizers: Here be dragons! -This is not a file you want to be messing with. -All of the interesting stuff for you is under keymaps/ :) -Love, Erez - -Copyright 2013 Oleg Kostyuk - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "action_layer.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "nano.h" -#include - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_stage[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static uint16_t debouncing_time; -static bool debouncing = false; - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - - DDRF &= ~(1<<4 | 1<<5 | 1<<6 | 1<<7); - PORTF |= (1<<4 | 1<<5 | 1<<6 | 1<<7); - DDRC &= ~(1<<6); - PORTC |= (1<<6); - DDRD &= ~(1<<0 | 1<<1 | 1<<4); - PORTD |= (1<<0 | 1<<1 | 1<<4); - - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - matrix_stage[i] = 0; - } - - matrix_init_quantum(); - -} - -uint8_t matrix_scan(void) -{ - matrix_stage[0] = - (PINF&(1<<4) ? 0 : (1<<0)) | - (PINF&(1<<5) ? 0 : (1<<1)) | - (PINF&(1<<6) ? 0 : (1<<2)) | - (PINF&(1<<7) ? 0 : (1<<3)); - matrix_stage[1] = - (PIND&(1<<1) ? 0 : (1<<0)) | - (PIND&(1<<0) ? 0 : (1<<1)) | - (PIND&(1<<4) ? 0 : (1<<2)) | - (PINC&(1<<6) ? 0 : (1<<3)); - - if (memcmp(matrix_debouncing, matrix_stage, sizeof(matrix)) != 0) { - debouncing = true; - debouncing_time = timer_read(); - } - - matrix_debouncing[0] = matrix_stage[0]; - matrix_debouncing[1] = matrix_stage[1]; - - if (debouncing && (timer_elapsed(debouncing_time) > 20)) { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - debouncing = false; - } - - matrix_scan_quantum(); - - return 1; -} - -bool matrix_is_modified(void) -{ - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* eliminate lag on space cadet mods */ -#define PERMISSIVE_HOLD - -/* setup lighting */ -#define RGB_DI_PIN B5 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 30 -#define RGBLIGHT_HUE_STEP 8 -#define RGBLIGHT_SAT_STEP 8 -#define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/tomato/info.json b/keyboards/tomato/info.json deleted file mode 100644 index f01f5e7e0b..0000000000 --- a/keyboards/tomato/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "Tomato", - "url": "", - "maintainer": "qmk", - "bootloader": "", - "width": 10, - "height": 3, - "layouts": { - "LAYOUT_ortho_3x10": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}] - } - } -} diff --git a/keyboards/tomato/keymaps/default/keymap.c b/keyboards/tomato/keymaps/default/keymap.c deleted file mode 100644 index 94bfca202b..0000000000 --- a/keyboards/tomato/keymaps/default/keymap.c +++ /dev/null @@ -1,158 +0,0 @@ -#include QMK_KEYBOARD_H - -#define SPC_F1 LT(1,KC_SPC) -#define BS_F2 LT(2,KC_BSPC) -#define C_F3 LT(3,KC_C) -#define V_F4 LT(4,KC_V) -#define B_F5 LT(5,KC_B) -#define Z_CTL MT(MOD_LCTL, KC_Z) -#define X_ALT MT(MOD_LALT, KC_X) -#define N_ALT MT(MOD_RALT, KC_N) -#define M_CTL MT(MOD_RCTL, KC_M) -#define ENT_SFT MT(MOD_RSFT, KC_ENT) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Level 0: Default Layer - * ,-------------------------------------------------------------------------------. - * | Q | W | E | R | T | Y | U | I | O | P | - * |-------------------------------------------------------------------------------| - * | A | S | D | F | G | H | J | K | L | ESC | - * |-------------------------------------------------------------------------------| - * | Z | X | C | V | BSPC | SPC | B | N | M | ENT | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P - , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC - , Z_CTL, X_ALT, C_F3, V_F4, BS_F2, SPC_F1, B_F5, N_ALT, M_CTL, ENT_SFT - ), - /* Level 1: Numbers Layer - * ,-------------------------------------------------------------------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - * |-------------------------------------------------------------------------------| - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | - * |-------------------------------------------------------------------------------| - * | | | | | DEL | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 - , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), - /* Level 2: Symbols Layer - * ,-------------------------------------------------------------------------------. - * | ! | @ | # | $ | % | ^ | & | * | ( | ) | - * |-------------------------------------------------------------------------------| - * | F11 | F12 | | | | | | | | ` | - * |-------------------------------------------------------------------------------| - * | | | | | | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN - , KC_F11, KC_F12,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_GRAVE - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), - /* Level 3: RGB Layer - * ,-------------------------------------------------------------------------------. - * | | | | | | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------------| - * | Tab | | | | | , | . | / | ; | ' | - * |-------------------------------------------------------------------------------| - * | | | | | | | Left | Down | Up | Right | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT - ), - /* Level 4: RGB Layer - * ,-------------------------------------------------------------------------------. - * | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------------| - * | Tab | | | | | < | > | ? | : | " | - * |-------------------------------------------------------------------------------| - * | | | | | | | Home | PgDn | PgUp | End | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_PGDN,KC_END - ), - /* Level 5: RGB Layer - * ,-------------------------------------------------------------------------------. - * | Calc | Web | Mail |Explore| | | | | | | - * |-------------------------------------------------------------------------------| - * |RGB_TOG|RGB_MOD|RGB_HUI|RGB_HUD|xxxxxxx|xxxxxxx|RGB_SAI|RGB_SAD|RGB_VAI|RGB_VAD| - * |-------------------------------------------------------------------------------| - * | | | | | Flash | | | | | | - * '-------------------------------------------------------------------------------' - */ - LAYOUT_ortho_3x10 - ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,KC_NO, KC_NO, RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - ), -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - - if (usb_led & (1 << USB_LED_NUM_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_COMPOSE)) { - - } else { - - } - - if (usb_led & (1 << USB_LED_KANA)) { - - } else { - - } - -} diff --git a/keyboards/tomato/readme.md b/keyboards/tomato/readme.md deleted file mode 100644 index e3851f18ca..0000000000 --- a/keyboards/tomato/readme.md +++ /dev/null @@ -1,20 +0,0 @@ -Tomato -=== - -A 30 key keyboard with programmable rgb backlighting. - -* [The fluff](http://www.40percent.club/2017/07/tomato-in-gherkin.html) -* [The meat](https://github.com/di0ib/Misc/tree/master/tomato) - -Keyboard Maintainer: QMK Community -Hardware Supported: Tomato PCB -Hardware Availability: [Gherkin project on 40% Keyboards](http://www.40percent.club/2017/07/tomato-in-gherkin.html) - -Make example for this keyboard (after setting up your build environment): - - make tomato:default - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -First pass at adding support for the tomato keyboard. Completely -untested. Intended to kick-start development. diff --git a/keyboards/tomato/rules.mk b/keyboards/tomato/rules.mk deleted file mode 100644 index cbb2b05196..0000000000 --- a/keyboards/tomato/rules.mk +++ /dev/null @@ -1,58 +0,0 @@ -# MCU name -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 - - -# Boot Section Size in *bytes* -BOOTLOADER = caterina - - -# Build Options -# comment out to disable the options. -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB 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 -AUDIO_ENABLE = no -RGBLIGHT_ENABLE = yes - -LAYOUTS = ortho_3x10 diff --git a/keyboards/tomato/tomato.c b/keyboards/tomato/tomato.c deleted file mode 100644 index dbf8bfe12b..0000000000 --- a/keyboards/tomato/tomato.c +++ /dev/null @@ -1 +0,0 @@ -#include "tomato.h" diff --git a/keyboards/tomato/tomato.h b/keyboards/tomato/tomato.h deleted file mode 100644 index f8674be40e..0000000000 --- a/keyboards/tomato/tomato.h +++ /dev/null @@ -1,18 +0,0 @@ -#ifndef GHERKIN_H -#define GHERKIN_H - -#include "quantum.h" - -#define LAYOUT_ortho_3x10( \ - K00, K01, K02, K03, K04, K05, K10, K11, K12, K13 , \ - K14, K15, K20, K21, K22, K23, K24, K25, K30, K31 , \ - K32, K33, K34, K35, K40, K41, K42, K43, K44, K45 \ -) { \ - { K00, K01, K02, K03, K04, K05 }, \ - { K10, K11, K12, K13, K14, K15 }, \ - { K20, K21, K22, K23, K24, K25 }, \ - { K30, K31, K32, K33, K34, K35 }, \ - { K40, K41, K42, K43, K44, K45 } \ -} - -#endif diff --git a/keyboards/ut47/LED_controls.ino b/keyboards/ut47/LED_controls.ino deleted file mode 100644 index dd50300eb7..0000000000 --- a/keyboards/ut47/LED_controls.ino +++ /dev/null @@ -1,420 +0,0 @@ -#include -#include - -int iByte; -byte col = 0; -byte leds[12][4]; -byte pass = 1; -int fadecount = 1; -const int fadelimit = 3000; -const int fadelimitshort = 1000; -byte mode = 4; -byte brightness = 2; -boolean changemode = 0; -int rain = 0; -const int rainlimit = 5000; -const int rainfade = 5000; -byte rx = 0; -byte ry = 0; - -// pin[xx] on led matrix connected to nn on Arduino (-1 is dummy to make array start at pos 1) -int pins[17] = { - -1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 16, 14, 15, 18, 19, 20, 21 -}; - -// col[xx] of leds = pin yy on led matrix -int cols[12] = { - pins[8], pins[7], pins[6], pins[5], pins[9], pins[10], pins[11], pins[12], pins[13], pins[14], pins[15], pins[16] -}; - -// row[xx] of leds = pin yy on led matrix -int rows[4] = { - pins[1], pins[2], pins[3], pins[4] -}; - - -#define DELAY 0 -extern byte leds[12][4]; - -void setup() { - Serial1.begin(9600); - setupLeds(); - for (int s = 0; s < 5; s++) { - for ( int r = 1; r < 9; r++) { - delayMicroseconds(65000); - delayMicroseconds(65000); - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 12; i++) { - leds[i][j] = 1; - for (int p = 0; p < 25; p++) { - } - leds[i][j] = r; - } - } - } - for ( int r = 9; r > 0; r--) { - delayMicroseconds(65000); - delayMicroseconds(65000); - delayMicroseconds(65000); - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 12; i++) { - leds[i][j] = 1; - for (int p = 0; p < 25; p++) { - } - leds[i][j] = r; - } - } - } - } -} - -void loop() { - - switch (mode) { - case 0: - //Blacklight - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - leds[i][j] = brightness; - } - } - checkserial(); - break; - case 1: - //Breathing - for ( int r = 1; r < 9; r++) { - checkserial(); - if (changemode == 0) { - delayMicroseconds(65000); - delayMicroseconds(65000); - delayMicroseconds(65000); - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 12; i++) { - leds[i][j] = 1; - for (int p = 0; p < 25; p++) { - } - leds[i][j] = r; - } - } - } - else { - break; - } - } - for ( int r = 9; r > 0; r--) { - checkserial(); - if (changemode == 0) { - delayMicroseconds(65000); - delayMicroseconds(65000); - delayMicroseconds(65000); - delayMicroseconds(65000); - for (int j = 0; j < 4; j++) { - for (int i = 0; i < 12; i++) { - leds[i][j] = 1; - for (int p = 0; p < 25; p++) { - } - leds[i][j] = r; - } - } - } - else { - break; - } - } - for ( int r = 1; r < 30; r++) { - checkserial(); - if (changemode == 0) { - delayMicroseconds(65000); - delayMicroseconds(65000); - } - else { - break; - } - } - break; - case 2: - //Random - leds[random(12)][random(4)] = random(8); - delayMicroseconds(10000); - checkserial(); - break; - case 3: - //Rain - rain++; - if (rain > rainlimit) { - rain = 0; - rx = random(12); - ry = random(4); - if (leds[rx][ry] == 0) { - leds[rx][ry] = 18; - } - } - fadecount++; - if (fadecount > rainfade) { - fadecount = 1; - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - if (leds[i][j] > 0) { - leds[i][j] = leds[i][j] - 1; - } - } - } - } - checkserial(); - break; - case 4: - //Reactive - fadecount++; - if (fadecount > fadelimit) { - fadecount = 1; - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - if (leds[i][j] > 0) { - leds[i][j] = leds[i][j] - 1; - } - } - } - } - checkserial(); - break; - case 5: - //Reactive Target - fadecount++; - if (fadecount > fadelimitshort) { - fadecount = 1; - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - if (leds[i][j] > 0) { - leds[i][j] = leds[i][j] - 1; - } - } - } - } - checkserial(); - break; - default: - mode = 0; - break; - } - changemode = 0; -} - -void checkserial() { - if (Serial1.available() > 0) { - iByte = Serial1.read(); - if (iByte == 100) { - brightness++; - if (brightness > 9) { - brightness = 1; - } - } - if (iByte == 101) { - mode++; - } - if (iByte < 100) { - if (mode == 4) { - byte row = iByte / 16; - byte col = iByte % 16; - leds[col][row] = 18; - } - if (mode == 5) { - byte row = iByte / 16; - byte col = iByte % 16; - for (byte i = 0; i < 12; i++) { - leds[i][row] = 18; - } - for (byte p = 0; p < 4; p++) { - leds[col][p] = 18; - } - } - } - } -} - -void setupLeds() { - // sets the pins as output - FastGPIO::Pin<2>::setOutputLow(); - FastGPIO::Pin<3>::setOutputLow(); - FastGPIO::Pin<4>::setOutputLow(); - FastGPIO::Pin<5>::setOutputLow(); - FastGPIO::Pin<6>::setOutputLow(); - FastGPIO::Pin<7>::setOutputLow(); - FastGPIO::Pin<8>::setOutputLow(); - FastGPIO::Pin<9>::setOutputLow(); - FastGPIO::Pin<10>::setOutputLow(); - FastGPIO::Pin<16>::setOutputLow(); - FastGPIO::Pin<14>::setOutputLow(); - FastGPIO::Pin<15>::setOutputLow(); - FastGPIO::Pin<18>::setOutputLow(); - FastGPIO::Pin<19>::setOutputLow(); - FastGPIO::Pin<20>::setOutputLow(); - FastGPIO::Pin<21>::setOutputLow(); - - // set up Cols - FastGPIO::Pin<6>::setOutputValueLow(); - FastGPIO::Pin<7>::setOutputValueLow(); - FastGPIO::Pin<8>::setOutputValueLow(); - FastGPIO::Pin<9>::setOutputValueLow(); - FastGPIO::Pin<10>::setOutputValueLow(); - FastGPIO::Pin<16>::setOutputValueLow(); - FastGPIO::Pin<14>::setOutputValueLow(); - FastGPIO::Pin<15>::setOutputValueLow(); - FastGPIO::Pin<18>::setOutputValueLow(); - FastGPIO::Pin<19>::setOutputValueLow(); - FastGPIO::Pin<20>::setOutputValueLow(); - FastGPIO::Pin<21>::setOutputValueLow(); - - // set up Rows - FastGPIO::Pin<2>::setOutputValueLow(); - FastGPIO::Pin<3>::setOutputValueLow(); - FastGPIO::Pin<4>::setOutputValueLow(); - FastGPIO::Pin<5>::setOutputValueLow(); - - clearLeds(); - Timer1.initialize(25); - Timer1.attachInterrupt(display); - -} - -void clearLeds() { - // Clear display array - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - leds[i][j] = 0; - } - } -} - -void onLeds() { - // Clear display array - for (int i = 0; i < 12; i++) { - for (int j = 0; j < 4; j++) { - leds[i][j] = 7; - } - } -} - -// Interrupt routine -void display() { - - switch (col) { // Turn whole previous column off - case 0: - FastGPIO::Pin<6>::setOutputValueLow(); - break; - case 1: - FastGPIO::Pin<7>::setOutputValueLow(); - break; - case 2: - FastGPIO::Pin<8>::setOutputValueLow(); - break; - case 3: - FastGPIO::Pin<9>::setOutputValueLow(); - break; - case 4: - FastGPIO::Pin<10>::setOutputValueLow(); - break; - case 5: - FastGPIO::Pin<16>::setOutputValueLow(); - break; - case 6: - FastGPIO::Pin<14>::setOutputValueLow(); - break; - case 7: - FastGPIO::Pin<15>::setOutputValueLow(); - break; - case 8: - FastGPIO::Pin<18>::setOutputValueLow(); - break; - case 9: - FastGPIO::Pin<19>::setOutputValueLow(); - break; - case 10: - FastGPIO::Pin<20>::setOutputValueLow(); - break; - case 11: - FastGPIO::Pin<21>::setOutputValueLow(); - break; - } - - col++; - if (col == 12) { - col = 0; - pass++; - if (pass > 8) { - pass = 1; - } - } - for (int row = 0; row < 4; row++) { - if (leds[col][row] > pass) { - switch (row) { // Turn on this led - case 0: - FastGPIO::Pin<2>::setOutputValueLow(); - break; - case 1: - FastGPIO::Pin<3>::setOutputValueLow(); - break; - case 2: - FastGPIO::Pin<4>::setOutputValueLow(); - break; - case 3: - FastGPIO::Pin<5>::setOutputValueLow(); - break; - } - } - else { - switch (row) { // Turn off this led - case 0: - FastGPIO::Pin<2>::setOutputValueHigh(); - break; - case 1: - FastGPIO::Pin<3>::setOutputValueHigh(); - break; - case 2: - FastGPIO::Pin<4>::setOutputValueHigh(); - break; - case 3: - FastGPIO::Pin<5>::setOutputValueHigh(); - break; - } - } - } - switch (col) { // Turn column on - case 0: - FastGPIO::Pin<6>::setOutputValueHigh(); - break; - case 1: - FastGPIO::Pin<7>::setOutputValueHigh(); - break; - case 2: - FastGPIO::Pin<8>::setOutputValueHigh(); - break; - case 3: - FastGPIO::Pin<9>::setOutputValueHigh(); - break; - case 4: - FastGPIO::Pin<10>::setOutputValueHigh(); - break; - case 5: - FastGPIO::Pin<16>::setOutputValueHigh(); - break; - case 6: - FastGPIO::Pin<14>::setOutputValueHigh(); - break; - case 7: - FastGPIO::Pin<15>::setOutputValueHigh(); - break; - case 8: - FastGPIO::Pin<18>::setOutputValueHigh(); - break; - case 9: - FastGPIO::Pin<19>::setOutputValueHigh(); - break; - case 10: - FastGPIO::Pin<20>::setOutputValueHigh(); - break; - case 11: - FastGPIO::Pin<21>::setOutputValueHigh(); - break; - } - -} diff --git a/keyboards/ut47/config.h b/keyboards/ut47/config.h deleted file mode 100644 index 4335e3edd5..0000000000 --- a/keyboards/ut47/config.h +++ /dev/null @@ -1,87 +0,0 @@ -/* -Copyright 2018 Carlos Filoteo - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER 40percent.club -#define PRODUCT ut47 -#define DESCRIPTION An awesome 40% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -#define MATRIX_ROW_PINS { D1, D0, D4, C6 } -#define MATRIX_COL_PINS { D7, E6, B4, B5, B6, B2, B3, B1, F7, F6, F5, F4 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* 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 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* Enable GNAP matrix serial output */ -#define GNAP_ENABLE - -/* USART configuration */ -#ifdef __AVR_ATmega32U4__ -# define SERIAL_UART_BAUD 9600 -# define SERIAL_UART_DATA UDR1 -# define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) -# define SERIAL_UART_RXD_VECT USART1_RX_vect -# define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) -# define SERIAL_UART_INIT() do { \ - /* baud rate */ \ - UBRR1L = SERIAL_UART_UBRR; \ - /* baud rate */ \ - UBRR1H = SERIAL_UART_UBRR >> 8; \ - /* enable TX */ \ - UCSR1B = _BV(TXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ - sei(); \ - } while(0) -# else -# error "USART configuration is needed." -#endif - -#endif diff --git a/keyboards/ut47/info.json b/keyboards/ut47/info.json deleted file mode 100644 index 59bffe99a3..0000000000 --- a/keyboards/ut47/info.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "keyboard_name": "UT47", - "url": "", - "maintainer": "qmk", - "width": 12.5, - "height": 4, - "layouts": { - "LAYOUT": { - "key_count": 47, - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Q", "x":1, "y":0}, {"label":"W", "x":2, "y":0}, {"label":"E", "x":3, "y":0}, {"label":"R", "x":4, "y":0}, {"label":"T", "x":5, "y":0}, {"label":"Y", "x":6, "y":0}, {"label":"U", "x":7, "y":0}, {"label":"I", "x":8, "y":0}, {"label":"O", "x":9, "y":0}, {"label":"P", "x":10, "y":0}, {"label":"Backspace", "x":11, "y":0, "w":1.5}, {"label":"LT(3) / Tab", "x":0, "y":1, "w":1.25}, {"label":"A", "x":1.25, "y":1}, {"label":"S", "x":2.25, "y":1}, {"label":"D", "x":3.25, "y":1}, {"label":"F", "x":4.25, "y":1}, {"label":"G", "x":5.25, "y":1}, {"label":"H", "x":6.25, "y":1}, {"label":"J", "x":7.25, "y":1}, {"label":"K", "x":8.25, "y":1}, {"label":"L", "x":9.25, "y":1}, {"label":":", "x":10.25, "y":1}, {"label":"\"", "x":11.25, "y":1, "w":1.25}, {"label":"Shift", "x":0, "y":2, "w":1.5}, {"label":"Z", "x":1.5, "y":2}, {"label":"X", "x":2.5, "y":2}, {"label":"C", "x":3.5, "y":2}, {"label":"V", "x":4.5, "y":2}, {"label":"B", "x":5.5, "y":2}, {"label":"N", "x":6.5, "y":2}, {"label":"M", "x":7.5, "y":2}, {"label":"<", "x":8.5, "y":2}, {"label":">", "x":9.5, "y":2}, {"label":"?", "x":10.5, "y":2}, {"label":"Shift / Enter", "x":11.5, "y":2}, {"label":"Ctrl", "x":0, "y":3}, {"label":"Alt", "x":1, "y":3}, {"label":"GUI", "x":2, "y":3}, {"label":"Menu", "x":3, "y":3}, {"label":"MO(2)", "x":4, "y":3, "w":1.25}, {"x":5.25, "y":3, "w":2}, {"label":"MO(1)", "x":7.25, "y":3, "w":1.25}, {"label":"\u2190", "x":8.5, "y":3}, {"label":"\u2193", "x":9.5, "y":3}, {"label":"\u2191", "x":10.5, "y":3}, {"label":"\u2192", "x":11.5, "y":3}] - } - } -} diff --git a/keyboards/ut47/keymaps/default/config.h b/keyboards/ut47/keymaps/default/config.h deleted file mode 100644 index 46098a22fb..0000000000 --- a/keyboards/ut47/keymaps/default/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/ut47/keymaps/default/keymap.c b/keyboards/ut47/keymaps/default/keymap.c deleted file mode 100644 index 6b6bb025b1..0000000000 --- a/keyboards/ut47/keymaps/default/keymap.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| - * |-------------------------------------------------------------------------+ - * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------+ - * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left */ - KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | |MousL|MousD|MousU|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/default/readme.md b/keyboards/ut47/keymaps/default/readme.md deleted file mode 100644 index e09dc73fab..0000000000 --- a/keyboards/ut47/keymaps/default/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# UT47 default keymap - -![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) - -[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) - -### LED Controls - -Use TAB+Z to cycle through brightness (8 steps) - -Use TAB+X to cycle through the following LED modes: - -- solid -- breathing -- random -- rain -- reactive -- poptang -- off diff --git a/keyboards/ut47/keymaps/non-us/config.h b/keyboards/ut47/keymaps/non-us/config.h deleted file mode 100644 index 46098a22fb..0000000000 --- a/keyboards/ut47/keymaps/non-us/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here - -#endif diff --git a/keyboards/ut47/keymaps/non-us/keymap.c b/keyboards/ut47/keymaps/non-us/keymap.c deleted file mode 100644 index 1cb537b7d0..0000000000 --- a/keyboards/ut47/keymaps/non-us/keymap.c +++ /dev/null @@ -1,136 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ; | ' | - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / |Sh/En| - * |-------------------------------------------------------------------------+ - * | Ctrl| Alt | Gui | App | L2 | Space | L1 | Left| Down| Up |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | # | - | = | [ | ] | \ | - * |-------------------------------------------------------------------------+ - * | | F11 | F12 | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, KC_NUHS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_NUBS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) |Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | _ | + | { | } | | | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | Home| PgDn| PgUp| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left */ - KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_UNDERSCORE, KC_PLUS, KC_LEFT_CURLY_BRACE, KC_RIGHT_CURLY_BRACE, KC_PIPE, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Mail| Comp| | | | | |PrtSc| | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | | | | | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | |MousL|MousD|MousU|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/non-us/readme.md b/keyboards/ut47/keymaps/non-us/readme.md deleted file mode 100644 index e09dc73fab..0000000000 --- a/keyboards/ut47/keymaps/non-us/readme.md +++ /dev/null @@ -1,19 +0,0 @@ -# UT47 default keymap - -![UT47 layout image](https://i.imgur.com/Tsz5qsF.png) - -[KLE](http://www.keyboard-layout-editor.com/##@@_y:0%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Back%20Space&_x:0.25&a:4&f:4&w:4&h:4&d:true%3B&=%3Cb%3EGNAP!%3C%2F%2Fb%3E%3Cp%3E%3Cp%3EMinimum%20stagger%3Cp%3E47%20key%20layout%3B&@_a:7&f:3&w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=J&=K&=L&=%2F%3B&_w:1.25%3B&=%27%3B&@_w:1.5%3B&=Shift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F%2F&=Return%3B&@=Ctrl&=Alt&=Super&=Menu&_w:1.25%3B&=%2F&dArr%2F%3B&_w:2%3B&=&_w:1.25%3B&=%2F&uArr%2F%3B&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&uarr%2F%3B&=%2F&rarr%2F%3B%3B&=undefined) - -### LED Controls - -Use TAB+Z to cycle through brightness (8 steps) - -Use TAB+X to cycle through the following LED modes: - -- solid -- breathing -- random -- rain -- reactive -- poptang -- off diff --git a/keyboards/ut47/keymaps/nordic/config.h b/keyboards/ut47/keymaps/nordic/config.h deleted file mode 100644 index fcdd2c2322..0000000000 --- a/keyboards/ut47/keymaps/nordic/config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 diff --git a/keyboards/ut47/keymaps/nordic/keymap.c b/keyboards/ut47/keymaps/nordic/keymap.c deleted file mode 100644 index cc3f43650e..0000000000 --- a/keyboards/ut47/keymaps/nordic/keymap.c +++ /dev/null @@ -1,179 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" - -#endif - -#include "keymap_norwegian.h" - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) -#define CTRADEL LALT(LCTL(KC_DEL)) -#define ALTTAB LALT(KC_TAB) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Base Layer - L0 - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | U | I | O | P |Bspace | - * |-------------------------------------------------------------------------+ - * |Tab/L3| A | S | D | F | G | H | J | K | L | ' |Ent/RS| - * |-------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | Up | L4 | - * |-------------------------------------------------------------------------+ - * | Ctrl| Gui | L4 | Alt | L2 | Space | L1 | Ctrl| Left| Down|Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Base - L0 */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_APOS, MT_RSFT_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, MO(4), - KC_LCTL, KC_LGUI, MO(4), KC_LALT, MO(2), KC_SPC, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT -), - - /* FN Layer 1 - * ,-------------------------------------------------------------------------. - * | | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Delete| - * |-------------------------------------------------------------------------+ - * | | | | | | | | | + | = | * | / | - * |-------------------------------------------------------------------------+ - * | | | | | | | | | - | _ | PgUp| | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | | Home| PgDn| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Right modifier - L1 */ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, _______, NO_PLUS, NO_EQL, NO_ASTR, NO_SLSH, - _______, _______, _______, _______, _______, _______, _______, _______, NO_MINS, NO_UNDS, KC_PGUP, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END -), - - /* FN Layer 2 - * ,-------------------------------------------------------------------------. - * | § | ! | " | # | ¤ | % | & | / | = | + | \ | Delete| - * |-------------------------------------------------------------------------+ - * | | | ? | { | [ | ( | ) | ] | } | F10 | F11 | F12 | - * |-------------------------------------------------------------------------+ - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | PgUp| | - * |-------------------------------------------------------------------------+ - * | | | |Capsl| | | | | Home| PgDn| End | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Left modifier - L2 */ - NO_SECT, KC_EXCLAIM, NO_QUO2, KC_HASH, NO_BULT, KC_PERCENT, NO_AMPR, NO_SLSH, NO_EQL, NO_PLUS, NO_BSLS, KC_DELETE, - _______, _______, NO_QUES, NO_LCBR, NO_LBRC, NO_LPRN, NO_RPRN, NO_RBRC, NO_RCBR, KC_F10, KC_F11, KC_F12, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_PGUP, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END -), - - /* FN Layer 3 - * ,-------------------------------------------------------------------------. - * | Esc | Calc|Webhm| Comp|Webrf| | | | | |PrtSc|CtrAlDl| - * |-------------------------------------------------------------------------+ - * | | | | | | | |VolDn|VolUp| | | | - * |-------------------------------------------------------------------------+ - * | |LEDtg|LEDch| | |RESET| | Mute| |MouB1|MousU|MouB2| - * |-------------------------------------------------------------------------+ - * | | | | | | | | |MousL|MousD|MousR| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Hold Tab down - L3 */ - KC_ESC, KC_CALC, KC_WHOM, KC_MYCM, KC_WREF, _______, _______, _______, _______, _______, KC_PSCR, CTRADEL, - _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, - _______, LED_TOG, LED_CHG, _______, _______, RESET, _______, KC_MUTE, _______, KC_MS_BTN1, KC_MS_U, KC_MS_BTN2, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R -), - - /* FN Layer 4 - * ,-------------------------------------------------------------------------. - * | | | @ | £ | $ | ~ | | ¨ | ´ | ` | Å | | - * |-------------------------------------------------------------------------+ - * | | | | € | | | | | ^ | Ø | Æ | | - * |-------------------------------------------------------------------------+ - * | | < | | | | | | µ | | | | | - * |-------------------------------------------------------------------------+ - * | | | | | | | | L5 | | | | - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* Norsk - L4 */ - _______, _______, NO_AT, NO_PND, NO_DLR, NO_TILD, _______, NO_QUOT, NO_ACUT, NO_GRV, NO_AA, _______, - _______, _______, _______, NO_EURO, _______, _______, _______, _______, NO_CIRC, NO_OSLH, NO_AE, _______, - _______, NO_LESS, _______, _______, _______, _______, _______, NO_MU, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, TO(5), _______, _______, _______ -), - - /* GAMING Layer (toggle on and off) - * ,-------------------------------------------------------------------------. - * | Esc | Q | W | E | R | T | Y | F1 | F2 | F3 | F4 |Alt+Tab| - * |-------------------------------------------------------------------------+ - * | Tab | A | S | D | F | G | H | F5 | F6 | F7 | F8 | Enter| - * |-------------------------------------------------------------------------+ - * | Shift | 1 | 2 | 3 | 4 | 5 | 6 | F9 | F10 | F11 | Up |TOGGL| - * |-------------------------------------------------------------------------+ - * | Ctrl| Z | X | C | B | Space | M | V |Left |Down |Right| - * `-------------------------------------------------------------------------' - */ - -LAYOUT( /* GAMING, toggled on and off - L5 */ - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_F1, KC_F2, KC_F3, KC_F4, ALTTAB, - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_F5, KC_F6, KC_F7, KC_F8, KC_ENT, - KC_LSFT, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_F9, KC_F10, KC_F11, KC_UP, TO(0), - KC_LCTL, KC_Z, KC_X, KC_C, KC_B, KC_SPC, KC_M, KC_V, KC_LEFT, KC_DOWN, KC_RGHT -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/nordic/readme.md b/keyboards/ut47/keymaps/nordic/readme.md deleted file mode 100644 index 4b0d0eb122..0000000000 --- a/keyboards/ut47/keymaps/nordic/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# UT47 Nordic keymap - - -![UT47 Nordic layout image](https://i.imgur.com/ZNtF4wA.png) - -[KLE - Nordic layout](http://www.keyboard-layout-editor.com/##@_name=UT47%20-%20Nordic%20layout&author=neonSpork%3B&@_a:7%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=U&=I&=O&=P&_w:1.5%3B&=Backspace%3B&@_c=%23c75656&a:4&w:1.25%3B&=%0A%0A%0AL3%0A%0A%0A%0A%0A%0ATab&_c=%23cccccc&a:7%3B&=A&=S&=D&=F&=G&=H&=J&=K&=L&='&_a:4&w:1.25%3B&=Enter%0A%0A%0ARShift%3B&@_a:7&w:1.5%3B&=LShift&=Z&=X&=C&=V&=B&=N&=M&=,&=.&=%2F&uarr%2F%3B&_c=%23bb45c4%3B&=L4%3B&@_c=%23cccccc%3B&=LCtrl&=LGUI&_c=%23bb45c4%3B&=L4&_c=%23cccccc%3B&=LAlt&_c=%2333aaff&w:1.25%3B&=L2&_c=%23cccccc&w:2%3B&=Space&_c=%23f5b047&w:1.25%3B&=L1&_c=%23cccccc%3B&=RCtrl&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F%3B%3B&@_y:0.25&c=%23f5b047%3B&=%7C&=1&=2&=3&=4&=5&=6&=7&=8&=9&=0&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=&=+&=%2F=&=*&_w:1.25%3B&=%2F%2F%3B&@_w:1.5%3B&=&=&=&=&=&=&=&=&=-&=%2F_&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%2333aaff%3B&=%C2%A7&=!&=%22&=%23&=%C2%A4&=%25&=%2F&&=%2F%2F&=%2F=&=+&=%5C&_w:1.5%3B&=Delete%3B&@_w:1.25%3B&=&=&=%3F&=%7B&=%5B&=(&=)&=%5D&=%7D&=F10&=F11&_w:1.25%3B&=F12%3B&@_w:1.5%3B&=&=F1&=F2&=F3&=F4&=F5&=F6&=F7&=F8&=F9&=PgUp&=%3B&@=&=&=&=Caps&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&=Home&=PgDn&=End%3B&@_y:0.25&c=%23c75656%3B&=Esc&=Calc&_a:5%3B&=www%0A%0A%0A%0A%0A%0Ahome&=My%0A%0A%0A%0A%0A%0AComp&=www%0A%0A%0A%0A%0A%0ARefresh&_a:7%3B&=&=&=&=&=&=PrtScr&_w:1.5%3B&=Ctr%20Alt%20Del%3B&@_w:1.25%3B&=&=&=&=&=&=&=&=VolDn&=VolUp&=&=&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=LEDtg&=LEDch&=&=&=RESET&=&=Mute&=&_a:5%3B&=Mouse%0AClick%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0AUp&=Mouse%0AClick%0A%0A%0A%0A%0ARight%3B&@_a:7%3B&=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&=&_a:5%3B&=Mouse%0A%0A%0A%0A%0A%0ALeft&=Mouse%0A%0A%0A%0A%0A%0ADown&=Mouse%0A%0A%0A%0A%0A%0ARight%3B&@_y:0.25&c=%23bb45c4&a:7%3B&=&=&=%2F@&=%C2%A3&=$&=~&=&=%C2%A8&=%C2%B4&=%60&=%C3%85&_w:1.5%3B&=%3B&@_w:1.25%3B&=&=&=&=%E2%82%AC&=&=&=&=&=%5E&=%C3%98&=%C3%86&_w:1.25%3B&=%3B&@_w:1.5%3B&=&=%3C&=&=&=&=&=&=%C2%B5&=&=&=&=%3B&@=&=&=&=&_w:1.25%3B&=&_w:2%3B&=&_w:1.25%3B&=&_c=%2345b564&a:5%3B&=L5%0A%0A%0A%0A%0A%0AON&_c=%23bb45c4&a:7%3B&=&=&=%3B&@_y:0.25&c=%2345b564%3B&=Esc&=Q&=W&=E&=R&=T&=Y&=F1&=F2&=F3&=F4&_w:1.5%3B&=Alt%20Tab%3B&@_w:1.25%3B&=Tab&=A&=S&=D&=F&=G&=H&=F5&=F6&=F7&=F8&_w:1.25%3B&=Enter%3B&@_w:1.5%3B&=Shift&=1&=2&=3&=4&=5&=6&=F9&=F10&=F11&=%2F&uarr%2F%3B&_c=%23cccccc&a:5%3B&=L5%0A%0A%0A%0A%0A%0AOFF%3B&@_c=%2345b564&a:7%3B&=LCtrl&=Z&=X&=C&_w:1.25%3B&=B&_w:2%3B&=Space&_w:1.25%3B&=M&=V&=%2F&larr%2F%3B&=%2F&darr%2F%3B&=%2F&rarr%2F) - - -Chose to modify the layout to include dedicated arrows on the bottom right. Layers 1-4 are modifiers, layer 5 is a toggle on gaming mode. Tab is dual function: Tap for Tab and hold for L3. So is enter: tap for Enter and hold for Right shift. - -### Nordic characters -On its own modifier layer, accessed from left (between left GUI and ALT) or right (above Right arrow) - -### Gaming layer -Toggled on/off, accessed via the Nordic layer. - -Toggle on: L4+RCtrl - -Toggle off: L4 (above ) - -### LED Controls - -Use TAB+Z to cycle through brightness (8 steps) - -Use TAB+X to cycle through the following LED modes: - -- solid -- breathing -- random -- rain -- reactive -- poptang -- off diff --git a/keyboards/ut47/keymaps/rgb/config.h b/keyboards/ut47/keymaps/rgb/config.h deleted file mode 100644 index 0eb010a3ae..0000000000 --- a/keyboards/ut47/keymaps/rgb/config.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" - -// place overrides here -#define RGBLIGHT_ANIMATIONS -#define RGB_DI_PIN D3 // The pin the LED strip is connected to -#define RGBLED_NUM 7 // Number of LEDs in your strip - -#endif diff --git a/keyboards/ut47/keymaps/rgb/keymap.c b/keyboards/ut47/keymaps/rgb/keymap.c deleted file mode 100644 index 58d11031ad..0000000000 --- a/keyboards/ut47/keymaps/rgb/keymap.c +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#include QMK_KEYBOARD_H -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -#define _______ KC_TRNS -#define LT3_TAB LT(3, KC_TAB) -#define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) - -enum custom_keycodes { - LED_TOG = SAFE_RANGE, - LED_CHG -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -LAYOUT( - KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - LT3_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MT_RSFT_ENT, - KC_LCTL, KC_LALT, KC_LGUI, KC_APP, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RGHT -), - -LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, - _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - -LAYOUT( - KC_FN6, KC_FN7, KC_FN8, KC_FN9, KC_FN10, KC_FN11, KC_FN12, KC_FN13, KC_FN14, KC_FN15, KC_FN16, KC_DELETE, - _______, _______, _______, _______, _______, _______, _______, KC_FN17, KC_FN18, KC_FN19, KC_FN20, KC_FN21, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, KC_CAPS, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END -), - -LAYOUT( /* Tab */ - KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R -), -}; - -//LED keymap functions - #ifdef LED_ENABLE -void led_chmode(void) { - serial_send(101); -} - -void led_toggle(void) { - serial_send(100); -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case LED_TOG: - #ifdef LED_ENABLE - led_toggle(); - #endif - return false; - case LED_CHG: - #ifdef LED_ENABLE - led_chmode(); - #endif - return false; - } - } - return true; -}; -#endif diff --git a/keyboards/ut47/keymaps/rgb/readme.md b/keyboards/ut47/keymaps/rgb/readme.md deleted file mode 100644 index 00076bfc49..0000000000 --- a/keyboards/ut47/keymaps/rgb/readme.md +++ /dev/null @@ -1 +0,0 @@ -WS2812B LED added and connected to pin D3 as described here: https://www.40percent.club/2018/04/gnap-underglow.html diff --git a/keyboards/ut47/keymaps/rgb/rules.mk b/keyboards/ut47/keymaps/rgb/rules.mk deleted file mode 100644 index 1e3cebb145..0000000000 --- a/keyboards/ut47/keymaps/rgb/rules.mk +++ /dev/null @@ -1 +0,0 @@ -RGBLIGHT_ENABLE = yes diff --git a/keyboards/ut47/led.c b/keyboards/ut47/led.c deleted file mode 100644 index 9458c038fe..0000000000 --- a/keyboards/ut47/led.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#include -#include "stdint.h" -#include "led.h" - - -void led_set(uint8_t usb_led) -{ - if (usb_led & (1<. -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - - -#ifndef DEBOUNCE -# define DEBOUNCE 5 -#endif -static uint8_t debouncing = DEBOUNCE; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -static matrix_row_t read_cols(void); -static void init_cols(void); -static void unselect_rows(void); -static void select_row(uint8_t row); - - -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 - unselect_rows(); - init_cols(); - - // initialize matrix state: all keys off - for (uint8_t i=0; i < MATRIX_ROWS; i++) { - matrix[i] = 0; - matrix_debouncing[i] = 0; - } - -#ifdef LED_ENABLE - serial_init(); -#endif -} - -uint8_t matrix_scan(void) -{ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - select_row(i); - _delay_us(30); // without this wait read unstable value. - matrix_row_t cols = read_cols(); - if (matrix_debouncing[i] != cols) { - matrix_debouncing[i] = cols; - if (debouncing) { - debug("bounce!: "); debug_hex(debouncing); debug("\n"); - } - debouncing = DEBOUNCE; - } - unselect_rows(); - } - - if (debouncing) { - if (--debouncing) { - _delay_ms(1); - } else { - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - matrix[i] = matrix_debouncing[i]; - } - } - } - - return 1; -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<The reason this is an "opt-in" feature is to prevent sending serial communication over the pin, in case it ends up being used for something else (like RGB underglow). - -### Layout - -Go to the [default layout README](keymaps/default/readme.md) for more information. - -### Additional info - -Credit: Forked from [di0ib TMK version](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/gnap) - -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. - -### Build Guide - -[u/network_operations' build guide thread](https://www.reddit.com/r/MechanicalKeyboards/comments/7wqktu/gnap_the_cheap_40/) diff --git a/keyboards/ut47/rules.mk b/keyboards/ut47/rules.mk deleted file mode 100644 index b046598669..0000000000 --- a/keyboards/ut47/rules.mk +++ /dev/null @@ -1,70 +0,0 @@ -# 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 -BOOTLOADER = caterina - -# custom matrix setup -CUSTOM_MATRIX = yes -SRC += matrix.c protocol/serial_uart.c - -# Build Options -# change yes to no to disable -# -BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 -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 - -ifeq ($(strip $(LED_ENABLE)), yes) - OPT_DEFS += -DLED_ENABLE - SRC += led.c -endif diff --git a/keyboards/ut47/ut47.c b/keyboards/ut47/ut47.c deleted file mode 100644 index f467fd130a..0000000000 --- a/keyboards/ut47/ut47.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#include "ut47.h" -#ifdef LED_ENABLE - #include "protocol/serial.h" -#endif - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - if (record->event.pressed) { - #ifdef LED_ENABLE - serial_send((record->event.key.row*16)+record->event.key.col); - #endif - } - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/ut47/ut47.h b/keyboards/ut47/ut47.h deleted file mode 100644 index a4507dd34d..0000000000 --- a/keyboards/ut47/ut47.h +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright 2018 Carlos Filoteo - * - * 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 . - */ -#ifndef UT47_H -#define UT47_H - -#include "quantum.h" - -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ -) \ - { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ - { K30, K31, K32, K33, K34, K35, K35, K37, K38, K39, K3a, K3b } \ - } - -#define LAYOUT_kc( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ - K30, K31, K32, K33, K34, K35, K37, K38, K39, K3a, K3b \ -) \ - LAYOUT( \ - KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, \ - KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, \ - KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, \ - KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b \ - ) - -#define LAYOUT_kc_ut47 LAYOUT_kc - -#endif -- cgit v1.2.3 From fa2183a64a1f8619f0b0ce9b8087732eaaa154bf Mon Sep 17 00:00:00 2001 From: dlgoodr Date: Thu, 8 Nov 2018 19:01:16 -0600 Subject: Keymap: dlg's tada68 keymap (#4289) * dlg's keymap * fix list order * remove cruft * pragma Co-Authored-By: dlgoodr * turn on bootmagic, enable swapping ` and Esc while I figure out which compromise is least bad --- keyboards/tada68/keymaps/dlg/config.h | 3 ++ keyboards/tada68/keymaps/dlg/keymap.c | 76 ++++++++++++++++++++++++++++++++++ keyboards/tada68/keymaps/dlg/readme.md | 54 ++++++++++++++++++++++++ keyboards/tada68/keymaps/dlg/rules.mk | 17 ++++++++ 4 files changed, 150 insertions(+) create mode 100644 keyboards/tada68/keymaps/dlg/config.h create mode 100755 keyboards/tada68/keymaps/dlg/keymap.c create mode 100755 keyboards/tada68/keymaps/dlg/readme.md create mode 100644 keyboards/tada68/keymaps/dlg/rules.mk diff --git a/keyboards/tada68/keymaps/dlg/config.h b/keyboards/tada68/keymaps/dlg/config.h new file mode 100644 index 0000000000..e1a6eb1a2b --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define GRAVE_ESC_ALT_OVERRIDE diff --git a/keyboards/tada68/keymaps/dlg/keymap.c b/keyboards/tada68/keymaps/dlg/keymap.c new file mode 100755 index 0000000000..9cd6cb2f12 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _FL 1 +#define _MAC 2 + +// investigate later - use lctl / lsft as up/down. +// https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/fakb +#define LCTL_MA LCTL_T(KC_UP) +#define LSFT_MA LSFT_T(KC_DOWN) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt|Fn |Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + * + * Note: Shift + Esc = ~ + * Win + Esc = ` + */ +[_BL] = LAYOUT_ansi( + KC_ESC, 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_GRV, \ + 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_LCTL, 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_PGUP, \ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(_FL), KC_RCTRL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * |`swp|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| Del |`swp| + * |----------------------------------------------------------------| + * | |BL |BL-|BL+|Brt| | | |mac| |PSc| | | |Ins | + * |----------------------------------------------------------------| + * | | | | | | |<- |Dn |Up | ->| | | |Hme | + * |----------------------------------------------------------------| + * | | | | | | | |MUT|V- |V+ | | |PUp|End | + * |----------------------------------------------------------------| + * | | | | | | | |Hme|PDn|End | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + MAGIC_UNSWAP_GRAVE_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_DEL, MAGIC_SWAP_GRAVE_ESC, \ + _______, BL_TOGG, BL_DEC, BL_INC , BL_BRTG, _______, _______, _______, TG(_MAC),_______, KC_PSCR, _______, _______, _______, KC_INS, \ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, _______, KC_HOME, \ + _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, KC_PGUP, KC_END , \ + _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END ), + + /* Keymap _MAC: Mac Layer + * ,----------------------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * | | | | | | | | | | | | | | | + * |----------------------------------------------------------------| + * |Ctrl|Alt |Win | |Win | |Alt| | | | + * `----------------------------------------------------------------' + */ +[_MAC] = LAYOUT_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LCTL, KC_LALT, KC_LGUI, _______, KC_RGUI, _______, KC_RALT, _______, _______, _______), + +}; diff --git a/keyboards/tada68/keymaps/dlg/readme.md b/keyboards/tada68/keymaps/dlg/readme.md new file mode 100755 index 0000000000..1f1ae18671 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/readme.md @@ -0,0 +1,54 @@ +# dlg's layout + +[tshack's layout](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/tshack), with: + + Mac layer + + Press Fn-I to align the bottom row to mac standards + + volume controls moved to Fn+ M<> + + [Space Cadet Shift](https://docs.qmk.fm/#/feature_space_cadet_shift) enabled + + Fn+R for LED breathing + + Fn+Del for Insert + + `GRAVE_ESC_ALT_OVERRIDE` so cmd-opt-esc still works (thx [mattdicarlo](https://github.com/qmk/qmk_firmware/tree/master/keyboards/tada68/keymaps/mattdicarlo)) + +``` + Base Layer +,----------------------------------------------------------------. +|Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | +|----------------------------------------------------------------| +|Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | +|----------------------------------------------------------------| +|Ctrl | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| +|----------------------------------------------------------------| +|Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgDn| +|----------------------------------------------------------------| +|Ctrl|Win |Alt | Space |Alt|Fn |Ctrl|<- |Dn | -> | +`----------------------------------------------------------------' +Note: Shift + Esc = ~ (tilde) + Win + Esc = ` (grave) + + + Fn Layer +,----------------------------------------------------------------. +| |F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12| Del | | +|----------------------------------------------------------------| +| |BL |BL-|BL+|Brt| | | |mac| |PSc| | | |Ins | +|----------------------------------------------------------------| +| | | | | | |<- |Dn |Up | ->| | | |Hme | +|----------------------------------------------------------------| +| | | | | | | |MUT|V- |V+ | | |PUp|End | +|----------------------------------------------------------------| +| | | | | | | |Hme|PDn|End | +`----------------------------------------------------------------' + +Mac Layer +,----------------------------------------------------------------. +| | | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | +|----------------------------------------------------------------| +| | | | | | | | | | | | | | | +|----------------------------------------------------------------| +|Ctrl|Alt |Win | |Win | |Alt| | | | +`----------------------------------------------------------------' +``` diff --git a/keyboards/tada68/keymaps/dlg/rules.mk b/keyboards/tada68/keymaps/dlg/rules.mk new file mode 100644 index 0000000000..2e0f1a6616 --- /dev/null +++ b/keyboards/tada68/keymaps/dlg/rules.mk @@ -0,0 +1,17 @@ +# 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 = full # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 6ae409dd55133e25e103aa974080ce127790357f Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Fri, 9 Nov 2018 08:49:29 -0800 Subject: Add my new ANSI layout dz60 setup (#4397) * minor additions to alps64 and dz60 * Rename crd keymap to represent 2u lshift layout * Add crd's new ANSI layout dz60 with preferred layers --- keyboards/alps64/keymaps/crd/keymap.c | 6 +-- keyboards/dz60/keymaps/crd/keymap.c | 70 --------------------------- keyboards/dz60/keymaps/crd_2u_lshift/keymap.c | 70 +++++++++++++++++++++++++++ keyboards/dz60/keymaps/crd_ansi/keymap.c | 25 ++++++++++ 4 files changed, 98 insertions(+), 73 deletions(-) delete mode 100644 keyboards/dz60/keymaps/crd/keymap.c create mode 100644 keyboards/dz60/keymaps/crd_2u_lshift/keymap.c create mode 100644 keyboards/dz60/keymaps/crd_ansi/keymap.c diff --git a/keyboards/alps64/keymaps/crd/keymap.c b/keyboards/alps64/keymaps/crd/keymap.c index 4f3ea446ec..815e6ddf4b 100644 --- a/keyboards/alps64/keymaps/crd/keymap.c +++ b/keyboards/alps64/keymaps/crd/keymap.c @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* 1: fn1 */ LAYOUT_all( - _______, 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_DEL, + 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_DEL, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -19,8 +19,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* 2: fn2 */ LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/dz60/keymaps/crd/keymap.c b/keyboards/dz60/keymaps/crd/keymap.c deleted file mode 100644 index 148b03b995..0000000000 --- a/keyboards/dz60/keymaps/crd/keymap.c +++ /dev/null @@ -1,70 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - /* Qwerty - * ,-----------------------------------------------------------------------------------------. - * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | - * |-----------------------------------------------------------------------------------------+ - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | - * |-----------------------------------------------------------------------------------------+ - * | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter | - * |-----------------------------------------------------------------------------------------+ - * | Shift | Z | X | C | V | B | N | M | , | . | / | RSh | U | DEL | - * |-----------------------------------------------------------------------------------------+ - * | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - 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_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, - 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, KC_ENT, - KC_LSFT, 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_DEL, - MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT - ), - - /* FN1 Layer - * ,-----------------------------------------------------------------------------------------. - * | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | L | D | U | R | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | |PgUp | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | |Home |PgDn | End | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - _______, 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_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END - ), - - /* FN2 Layer (Media) - * ,-----------------------------------------------------------------------------------------. - * | | | | | | | | | | | | | | RESET | - * |-----------------------------------------------------------------------------------------+ - * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | | | | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | | | | | | |Pl/Ps|Vol+ |Mute | - * |-----------------------------------------------------------------------------------------+ - * | | | | | | |Prev |Vol- |Next | - * `-----------------------------------------------------------------------------------------' - */ - - LAYOUT_directional( - KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, - _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT - ), -}; diff --git a/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c b/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c new file mode 100644 index 0000000000..4d2ca279c2 --- /dev/null +++ b/keyboards/dz60/keymaps/crd_2u_lshift/keymap.c @@ -0,0 +1,70 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------------------------------------------------------. + * | ` ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl/Esc| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | / |Home | U | End | + * |-----------------------------------------------------------------------------------------+ + * | FN1 | Alt | Cmd | Space | Cmd | FN2 | L | D | R | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + 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_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, + 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, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_HOME, KC_UP, KC_END, + MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_SPC, KC_SPC, KC_RGUI, MO(2), KC_LEFT, KC_DOWN, KC_RIGHT + ), + + /* FN1 Layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | Home | PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | L | D | U | R | End | PgDn| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | | |PgUp | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Home |PgDn | End | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + 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_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDOWN, KC_END + ), + + /* FN2 Layer (Media) + * ,-----------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | RESET | + * |-----------------------------------------------------------------------------------------+ + * | |RBB T|RGB M| Hue+| Hue-| Sat+| Sat-| Val+| Val-| |Mute | Vol- | Vol+ | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | |Bri- |Bri+ | | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | | | |Pl/Ps|Vol+ |Mute | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | |Prev |Vol- |Next | + * `-----------------------------------------------------------------------------------------' + */ + + LAYOUT_directional( + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, KC_VOLU, KC_MUTE, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_MNXT + ), +}; diff --git a/keyboards/dz60/keymaps/crd_ansi/keymap.c b/keyboards/dz60/keymaps/crd_ansi/keymap.c new file mode 100644 index 0000000000..eac0f1e84c --- /dev/null +++ b/keyboards/dz60/keymaps/crd_ansi/keymap.c @@ -0,0 +1,25 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + LAYOUT_60_ansi( + 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_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, + 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, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_UP), + MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, RGUI_T(KC_LEFT), RALT_T(KC_DOWN), LT(2, KC_RIGHT) + ), + LAYOUT_60_ansi( + 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_DEL, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + LAYOUT_60_ansi( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; -- cgit v1.2.3 From 519ce723fb5e8e7272ee08f611d2c15e40bb2969 Mon Sep 17 00:00:00 2001 From: mcmadhatter Date: Fri, 9 Nov 2018 19:16:08 +0000 Subject: Added support for backlight on diverge3 , and added a UK iso layout (#4392) * Added support for backlight , and a UK iso layout Added support for backlight , and a UK iso layout. Now uses the SPLIT_KEYBOARD #define rather than relying on lets split * Update keyboards/diverge3/keymaps/isoUK/keymap.c Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/isoUK/keymap.c Co-Authored-By: mcmadhatter * Simplified the lower layer Simplified the lower layer * dir rename to snake case dir rename to snake case * changed dir case changed dir case * Update keyboards/diverge3/rules.mk Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/config.h Co-Authored-By: mcmadhatter * Update keyboards/diverge3/config.h Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/keymap.c Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/keymap.c Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/keymap.c Co-Authored-By: mcmadhatter * Update keyboards/diverge3/config.h Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/config.h Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/config.h Co-Authored-By: mcmadhatter * Update keyboards/diverge3/keymaps/iso_uk/config.h Co-Authored-By: mcmadhatter * aligned and tidyied up aligned and tidyied up --- keyboards/diverge3/config.h | 14 ++++----- keyboards/diverge3/keymaps/iso_uk/config.h | 24 +++++++++++++++ keyboards/diverge3/keymaps/iso_uk/keymap.c | 45 +++++++++++++++++++++++++++++ keyboards/diverge3/keymaps/iso_uk/readme.md | 1 + keyboards/diverge3/keymaps/iso_uk/rules.mk | 1 + keyboards/diverge3/rules.mk | 10 ++----- 6 files changed, 79 insertions(+), 16 deletions(-) create mode 100755 keyboards/diverge3/keymaps/iso_uk/config.h create mode 100644 keyboards/diverge3/keymaps/iso_uk/keymap.c create mode 100755 keyboards/diverge3/keymaps/iso_uk/readme.md create mode 100755 keyboards/diverge3/keymaps/iso_uk/rules.mk diff --git a/keyboards/diverge3/config.h b/keyboards/diverge3/config.h index f3ed06739a..262be7b757 100644 --- a/keyboards/diverge3/config.h +++ b/keyboards/diverge3/config.h @@ -31,10 +31,6 @@ along with this program. If not, see . /* key matrix size */ #define MATRIX_ROWS 10 #define MATRIX_COLS 8 -// Only SERIAL is currently supported -// By converting this to use I2C, backlight -// would/should be fully functional as well -#define USE_SERIAL /* * Keyboard Matrix Assignments @@ -53,9 +49,9 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION ROW2COL -// #define BACKLIGHT_PIN C6 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 +#define BACKLIGHT_PIN C6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 5 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ @@ -63,7 +59,7 @@ along with this program. If not, see . /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST - + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE @@ -73,7 +69,7 @@ along with this program. If not, see . /* If defined, GRAVE_ESC will always act as ESC when CTRL is held. * This is userful for the Windows task manager shortcut (ctrl+shift+esc). */ -// #define GRAVE_ESC_CTRL_OVERRIDE + #define GRAVE_ESC_CTRL_OVERRIDE /* * Force NKRO diff --git a/keyboards/diverge3/keymaps/iso_uk/config.h b/keyboards/diverge3/keymaps/iso_uk/config.h new file mode 100755 index 0000000000..83f65979c7 --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/config.h @@ -0,0 +1,24 @@ +/* Copyright 2017 IslandMan93 + * + * 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 + + +// place overrides here +#define MASTER_LEFT +#define PERMISSIVE_HOLD +#define TAPPING_TERM 150 + diff --git a/keyboards/diverge3/keymaps/iso_uk/keymap.c b/keyboards/diverge3/keymaps/iso_uk/keymap.c new file mode 100644 index 0000000000..8043347850 --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/keymap.c @@ -0,0 +1,45 @@ +/* Copyright 2017 IslandMan93 + * + * 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 . + */ +#include QMK_KEYBOARD_H + + +enum layers { + _QWERTY, + _LOWER, +}; + +#define LOWER MO(_LOWER) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_CAPS, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LCBR, KC_RCBR, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_PSCR, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_NUHS, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_INS, KC_PGDN, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_HOME, KC_END, KC_SPC, KC_SPC, LOWER, KC_QUOT, KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_SLASH + ), + + [_LOWER] = LAYOUT( + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, KC_F12, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + BL_TOGG, KC_ASTG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_INC, KC_ASUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + BL_DEC, KC_ASDN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, KC_ASRP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ) + +}; diff --git a/keyboards/diverge3/keymaps/iso_uk/readme.md b/keyboards/diverge3/keymaps/iso_uk/readme.md new file mode 100755 index 0000000000..ff4971754a --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/readme.md @@ -0,0 +1 @@ +# My UK based diverge 3 layout diff --git a/keyboards/diverge3/keymaps/iso_uk/rules.mk b/keyboards/diverge3/keymaps/iso_uk/rules.mk new file mode 100755 index 0000000000..c9383ab8db --- /dev/null +++ b/keyboards/diverge3/keymaps/iso_uk/rules.mk @@ -0,0 +1 @@ +AUTO_SHIFT_ENABLE = yes diff --git a/keyboards/diverge3/rules.mk b/keyboards/diverge3/rules.mk index 38f3ee4e6a..36e8ccb471 100644 --- a/keyboards/diverge3/rules.mk +++ b/keyboards/diverge3/rules.mk @@ -1,6 +1,3 @@ -SRC += ../lets_split/matrix.c \ - ../lets_split/serial.c \ - ../lets_split/split_util.c # MCU name #MCU = at90usb1286 @@ -61,13 +58,12 @@ EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # 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 +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls 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. - +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +SPLIT_KEYBOARD = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes -- cgit v1.2.3 From d6184be67a56429a284c2d0fa5f990368a580735 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Fri, 9 Nov 2018 12:15:37 -0800 Subject: IDOBO Keyboard Support (75Keys Aluminum Keyboard) (#4401) * initial commit * put my name everywhere * get the switch matrix correct * add a basic keymap * use a better LAYOUT macro * update readme * Add QMK Configurator support --- keyboards/idobo/config.h | 227 ++++++++++++++++++++++++++++++ keyboards/idobo/idobo.c | 43 ++++++ keyboards/idobo/idobo.h | 44 ++++++ keyboards/idobo/info.json | 12 ++ keyboards/idobo/keymaps/default/config.h | 19 +++ keyboards/idobo/keymaps/default/keymap.c | 66 +++++++++ keyboards/idobo/keymaps/default/readme.md | 1 + keyboards/idobo/readme.md | 17 +++ keyboards/idobo/rules.mk | 81 +++++++++++ 9 files changed, 510 insertions(+) create mode 100644 keyboards/idobo/config.h create mode 100644 keyboards/idobo/idobo.c create mode 100644 keyboards/idobo/idobo.h create mode 100644 keyboards/idobo/info.json create mode 100644 keyboards/idobo/keymaps/default/config.h create mode 100644 keyboards/idobo/keymaps/default/keymap.c create mode 100644 keyboards/idobo/keymaps/default/readme.md create mode 100644 keyboards/idobo/readme.md create mode 100644 keyboards/idobo/rules.mk diff --git a/keyboards/idobo/config.h b/keyboards/idobo/config.h new file mode 100644 index 0000000000..f6b552bad8 --- /dev/null +++ b/keyboards/idobo/config.h @@ -0,0 +1,227 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT idobo +#define DESCRIPTION A custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B3, C7, B6, C6 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, E6, D5, D3, D2, D1, D0, D4, D6, D7, B4, B5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN F0 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 16 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/idobo/idobo.c b/keyboards/idobo/idobo.c new file mode 100644 index 0000000000..3f870835ed --- /dev/null +++ b/keyboards/idobo/idobo.c @@ -0,0 +1,43 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "idobo.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/idobo/idobo.h b/keyboards/idobo/idobo.h new file mode 100644 index 0000000000..386fcee1a9 --- /dev/null +++ b/keyboards/idobo/idobo.h @@ -0,0 +1,44 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef IDOBO_H +#define IDOBO_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C, K4D, K4E }, \ +} + +#endif diff --git a/keyboards/idobo/info.json b/keyboards/idobo/info.json new file mode 100644 index 0000000000..69c5e4e063 --- /dev/null +++ b/keyboards/idobo/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "IDOBO", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x15": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + } + } +} diff --git a/keyboards/idobo/keymaps/default/config.h b/keyboards/idobo/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/idobo/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/idobo/keymaps/default/keymap.c b/keyboards/idobo/keymaps/default/keymap.c new file mode 100644 index 0000000000..f54e3359bb --- /dev/null +++ b/keyboards/idobo/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x15( \ + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, KC_DEL, \ + 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_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/idobo/keymaps/default/readme.md b/keyboards/idobo/keymaps/default/readme.md new file mode 100644 index 0000000000..577c62b51f --- /dev/null +++ b/keyboards/idobo/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for idobo diff --git a/keyboards/idobo/readme.md b/keyboards/idobo/readme.md new file mode 100644 index 0000000000..7f2c684464 --- /dev/null +++ b/keyboards/idobo/readme.md @@ -0,0 +1,17 @@ +# IDOBO + +![IDOBO](imgur.com image replace me!) + +75Keys Aluminum Mechanical Keyboard. + +Firmware here originally appeared on qmkeyboard.cn + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: IDOBO PCB +Hardware Availability: [IDOBO on Massdrop](https://www.massdrop.com/buy/xd75-aluminum-mechanical-keyboard) + +Make example for this keyboard (after setting up your build environment): + + make idobo: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/idobo/rules.mk b/keyboards/idobo/rules.mk new file mode 100644 index 0000000000..383a3594b4 --- /dev/null +++ b/keyboards/idobo/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # 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) -- cgit v1.2.3 From b3853e7d40528a2d5fbab940678ce75c70b4de6c Mon Sep 17 00:00:00 2001 From: Logan Huskins Date: Sat, 10 Nov 2018 10:21:24 -0600 Subject: Keymap: Add default keymap from web for 1up60hse (#4351) --- .../1upkeyboards/1up60hse/keymaps/default/config.h | 1 + .../1upkeyboards/1up60hse/keymaps/default/keymap.c | 43 +++++++++++++--------- .../1up60hse/keymaps/default/readme.md | 6 +-- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h index a3ed4f762a..99a7005607 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/config.h @@ -1,4 +1,5 @@ /* Copyright 2018 MechMerlin + * Copyright 2018 Logan Huskins * * 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 diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c index 556246a3b2..1c168abf7d 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c @@ -1,4 +1,5 @@ /* Copyright 2018 MechMerlin + * Copyright 2018 Logan Huskins * * 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 @@ -17,28 +18,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi( - KC_ESC, 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_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, - MO(1), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(2), KC_RGUI, KC_RCTL), + KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, + KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, + KC_RALT, KC_RGUI, MO(1), KC_LCTL + ), - [1] = LAYOUT_60_ansi( - KC_GRV, 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_TRNS, - KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [1] = LAYOUT_60_ansi( + KC_GRV, 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_DEL, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, + KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, + KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS + ), [2] = LAYOUT_60_ansi( - RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_STEP, BL_DEC, BL_INC, BL_TOGG, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, RGB_VAD, RGB_VAI, RGB_SAI, RGB_HUD, RGB_HUI, RGB_MOD, RGB_TOG, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, RESET, BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, + RGB_SAI, RGB_VAI, RGB_SPI, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + ), }; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ return true; } - diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md index a9afa5ea6d..a7041f37b2 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/readme.md @@ -1,6 +1,4 @@ -# 1up60hse default keymap +# 1up60hse default keymap generated by QMK Configurator -This is the default keymap provided by [1upkeyboards](https://www.1upkeyboards.com). +This is the keymap used by [QMK Configurator](https://config.qmk.fm/#/1upkeyboards/1up60hse/LAYOUT_60_ansi) as default. -## Notes -- Software reset key is located on `Esc` on the third layer. -- cgit v1.2.3 From 3ba242cc3f5db93b14f0939f056e9aa759a43efe Mon Sep 17 00:00:00 2001 From: gorbachev Date: Sat, 10 Nov 2018 11:22:36 -0500 Subject: Keymap for random key presses for the scrabblepad (#4356) * Random key presses for scrabblepad * Fix keymap code comments * Remove unused methods as per code review --- keyboards/scrabblepad/keymaps/random/keymap.c | 75 ++++++++++++++++++++++++++ keyboards/scrabblepad/keymaps/random/readme.md | 5 ++ 2 files changed, 80 insertions(+) create mode 100644 keyboards/scrabblepad/keymaps/random/keymap.c create mode 100644 keyboards/scrabblepad/keymaps/random/readme.md diff --git a/keyboards/scrabblepad/keymaps/random/keymap.c b/keyboards/scrabblepad/keymaps/random/keymap.c new file mode 100644 index 0000000000..8e78259661 --- /dev/null +++ b/keyboards/scrabblepad/keymaps/random/keymap.c @@ -0,0 +1,75 @@ +#include "scrabblepad.h" +#include + +static uint16_t keystroke; +static bool shift_pressed; + +static int lower = (int) KC_A; +static int upper = (int) KC_Z; + +uint16_t random_keycode(void) { + return lower + (rand() % (upper - lower + 1)); +}; + +enum custom_keycodes { + RND_KEY = SAFE_RANGE +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case RND_KEY: + if (record->event.pressed) { + keystroke = random_keycode(); + if (rand() % 2 > 0) { + shift_pressed = 1; + register_code(KC_LSHIFT); + } + register_code(keystroke); + } else { + if (shift_pressed > 0) { + unregister_code(KC_LSHIFT); + } + unregister_code(keystroke); + } + + return false; + + default: + return true; + } + + return true; +} + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[0] = LAYOUT( /* Base */ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RESET, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, \ + RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY, RND_KEY +), +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/scrabblepad/keymaps/random/readme.md b/keyboards/scrabblepad/keymaps/random/readme.md new file mode 100644 index 0000000000..e719adaeb8 --- /dev/null +++ b/keyboards/scrabblepad/keymaps/random/readme.md @@ -0,0 +1,5 @@ +# Scrabblepad keymap with every key press random + +Every key produces a random key press, except the middle key, which is reserved for resetting the board. + +The random key press is selected between KC_A and KC_Z keycodes. -- cgit v1.2.3 From 408361402385ea938575956e9368b5f373edc629 Mon Sep 17 00:00:00 2001 From: yiancar Date: Sat, 10 Nov 2018 12:26:39 -0800 Subject: I2C driver docs (#4298) * I2C driver docs - Added I2C driver docs. - Changed arm master i2c driver to have a weak i2c_init as it is impossible to account for all possible port configuration in the STM32 world. * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * Update docs/i2c_driver.md Co-Authored-By: yiancar * GPIO release fix --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/i2c_driver.md | 83 ++++++++++++++++++++++++++++++++++++++++++++++++ drivers/arm/i2c_master.c | 5 ++- 4 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 docs/i2c_driver.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 2c57380122..67e81422a1 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -79,6 +79,7 @@ * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) * [ARM Debugging Guide](arm_debugging.md) + * [I2C Driver](i2c_driver.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/_summary.md b/docs/_summary.md index 2c57380122..67e81422a1 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -79,6 +79,7 @@ * [Hand Wiring Guide](hand_wire.md) * [ISP Flashing Guide](isp_flashing_guide.md) * [ARM Debugging Guide](arm_debugging.md) + * [I2C Driver](i2c_driver.md) * For a Deeper Understanding * [How Keyboards Work](how_keyboards_work.md) diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md new file mode 100644 index 0000000000..f69eb5a9da --- /dev/null +++ b/docs/i2c_driver.md @@ -0,0 +1,83 @@ +# I2C Master Driver + +The I2C Master drivers used in QMK have a set of common functions to allow portability between MCUs. + +## Available functions + +|Function |Description | +|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +|`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | +|`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | +|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. | +|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | +|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | +|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | +|`uint8_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_receive` function but `regaddr` sets from where in the slave the data will be read. | +|`uint8_t i2c_stop(uint16_t timeout);` |Stops the I2C driver. | + +### Function Return + +All the above functions, except `void i2c_init(void);` return the following truth table: + +|Return Value |Description | +|---------------|---------------------------------------------------| +|0 |Operation executed successfully. | +|-1 |Operation failed. | +|-2 |Operation timed out. | + + +## AVR + +### Configuration + +The following defines can be used to configure the I2C master driver. + +|Variable |Description |Default| +|------------------|---------------------------------------------------|-------| +|`#F_SCL` |Clock frequency in Hz |400KHz | +|`#Prescaler` |Divides master clock to aid in I2C clock selection |1 | + +AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required. + +## ARM + +For ARM the Chibios I2C HAL driver is under the hood. +This section assumes an STM32 MCU. + +### Configuration + +The configuration for ARM MCUs can be quite complex as often there are multiple I2C drivers which can be assigned to a variety of ports. + +Firstly the `mcuconf.h` file must be setup to enable the necessary hardware drivers. + +|Variable |Description |Default| +|------------------------------|------------------------------------------------------------------------------------|-------| +|`#STM32_I2C_USE_XXX` |Enable/Disable the hardware driver XXX (each driver should be explicitly listed) |FALSE | +|`#STM32_I2C_BUSY_TIMEOUT` |Time in ms until the I2C command is aborted if no response is received |50 | +|`#STM32_I2C_XXX_IRQ_PRIORITY` |Interrupt priority for hardware driver XXX (THIS IS AN EXPERT SETTING) |10 | +|`#STM32_I2C_USE_DMA` |Enable/Disable the ability of the MCU to offload the data transfer to the DMA unit |TRUE | +|`#STM32_I2C_XXX_DMA_PRIORITY` |Priority of DMA unit for hardware driver XXX (THIS IS AN EXPERT SETTING) |1 | + +Secondly, in the `halconf.h` file, `#define HAL_USE_I2C` must be set to `TRUE`. This allows ChibiOS to load its I2C driver. + +Lastly, we need to assign the correct GPIO pins depending on the I2C hardware driver we want to use. + +By default the I2C1 hardware driver is assumed to be used. If another hardware driver is used, `#define I2C_DRIVER I2CDX` should be added to the `config.h` file with X being the number of hardware driver used. For example is I2C3 is enabled, the `config.h` file should contain `#define I2C_DRIVER I2CD3`. This aligns the QMK I2C driver with the Chibios I2C driver. + +STM32 MCUs allows a variety of pins to be configured as I2C pins depending on the hardware driver used. By default B6 and B7 are set to I2C. + +This can be changed by declaring the `i2c_init` function which intentionally has a weak attribute. Please consult the datasheet of your MCU for the available GPIO configurations. The following is an example initialization function: + +```C +void i2c_init(void) +{ + setPinInput(B6); // Try releasing special pins for a short time + setPinInput(B7); + chThdSleepMilliseconds(10); // Wait for the release to happen + + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B6 to I2C function + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); // Set B7 to I2C function +} +``` + + diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 2a7badd351..de58438392 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -26,6 +26,7 @@ */ #include "i2c_master.h" +#include "quantum.h" #include #include @@ -41,9 +42,11 @@ static const I2CConfig i2cconfig = { 0 }; +__attribute__ ((weak)) void i2c_init(void) { - palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); // Try releasing special pins for a short time + setPinInput(B6); // Try releasing special pins for a short time + setPinInput(B7); chThdSleepMilliseconds(10); palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); -- cgit v1.2.3 From 6274980e6188c6f074e51b6655afd9efa991863e Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Sun, 11 Nov 2018 19:54:10 -0800 Subject: Improve new_project script (#4373) * Improve new_project script - use git user.name if available to replace the boilerplate name in files we generate - fix shellshock warnings * Test for git repo Suggestion by @skullydazed * Fix shellshock warning * Incorporate feedback from reviewers - thanks @vomindoraan - use a heredoc instead of echo for console - factor out common paths --- util/new_project.sh | 51 ++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 15 deletions(-) diff --git a/util/new_project.sh b/util/new_project.sh index a85e833222..d1d1ed82ca 100755 --- a/util/new_project.sh +++ b/util/new_project.sh @@ -14,7 +14,7 @@ elif [ -z "$KEYBOARD_TYPE" ]; then KEYBOARD_TYPE=avr fi -if [ $KEYBOARD_TYPE != "avr" -a $KEYBOARD_TYPE != "ps2avrgb" ]; then +if [ "$KEYBOARD_TYPE" != "avr" ] && [ "$KEYBOARD_TYPE" != "ps2avrgb" ]; then echo "Invalid keyboard type target" exit 1 fi @@ -24,22 +24,43 @@ if [ -e "keyboards/$1" ]; then exit 1 fi -cd "$(dirname "$0")/.." +cd "$(dirname "$0")/.." || exit -KEYBOARD_UPPERCASE=$(echo $1 | awk '{print toupper($0)}') -KEYBOARD_NAME=$(basename $1) -KEYBOARD_NAME_UPPERCASE=$(echo $KEYBOARD_NAME | awk '{print toupper($0)}') +KEYBOARD_NAME=$(basename "$1") +KEYBOARD_NAME_UPPERCASE=$(echo "$KEYBOARD_NAME" | awk '{print toupper($0)}') +NEW_KBD=keyboards/${KEYBOARD} -cp -r quantum/template/base keyboards/$KEYBOARD -cp -r quantum/template/$KEYBOARD_TYPE/. keyboards/$KEYBOARD +cp -r quantum/template/base "$NEW_KBD" +cp -r "quantum/template/$KEYBOARD_TYPE/." "$NEW_KBD" -mv keyboards/${KEYBOARD}/template.c keyboards/${KEYBOARD}/${KEYBOARD_NAME}.c -mv keyboards/${KEYBOARD}/template.h keyboards/${KEYBOARD}/${KEYBOARD_NAME}.h -find keyboards/${KEYBOARD} -type f -exec sed -i '' -e "s;%KEYBOARD%;${KEYBOARD_NAME};g" {} \; -find keyboards/${KEYBOARD} -type f -exec sed -i '' -e "s;%KEYBOARD_UPPERCASE%;${KEYBOARD_NAME_UPPERCASE};g" {} \; +mv "${NEW_KBD}/template.c" "${NEW_KBD}/${KEYBOARD_NAME}.c" +mv "${NEW_KBD}/template.h" "${NEW_KBD}/${KEYBOARD_NAME}.h" +find "${NEW_KBD}" -type f -exec sed -i '' -e "s;%KEYBOARD%;${KEYBOARD_NAME};g" {} \; +find "${NEW_KBD}" -type f -exec sed -i '' -e "s;%KEYBOARD_UPPERCASE%;${KEYBOARD_NAME_UPPERCASE};g" {} \; -echo "######################################################" -echo "# /keyboards/$KEYBOARD project created. To start" -echo "# working on things, cd into keyboards/$KEYBOARD" -echo "######################################################" +GIT=$(whereis git) +if [ "$GIT" != "" ]; then + IS_GIT_REPO=$($GIT log >>/dev/null 2>&1; echo $?) + if [ "$IS_GIT_REPO" -eq 0 ]; then + ID="'$($GIT config --get user.name)'" + echo "Using $ID as user name" + + for i in "$NEW_KBD/config.h" \ + "$NEW_KBD/$KEYBOARD_NAME.c" \ + "$NEW_KBD/$KEYBOARD_NAME.h" \ + "$NEW_KBD/keymaps/default/config.h" \ + "$NEW_KBD/keymaps/default/keymap.c" + do + awk -v id="$ID" '{sub(/REPLACE_WITH_YOUR_NAME/,id); print}' < "$i" > "$i.$$" + mv "$i.$$" "$i" + done + fi +fi + +cat <<-EOF +###################################################### +# $NEW_KBD project created. To start +# working on things, cd into $NEW_KBD +###################################################### +EOF -- cgit v1.2.3 From b49fd46eaaba5efe3231e6a1019af5c16558a057 Mon Sep 17 00:00:00 2001 From: Paco Date: Mon, 12 Nov 2018 14:58:07 -0500 Subject: Add support for slackware distribution (linux_install.sh) (#4369) * Add support for slackware distribution (linux_install.sh) The required packages are not provided by the official repository. The packages need to be installed from slackbuilds.org either manually or with the help of third party tools like sbotools. * Modify linux_install.sh according to code review Modifies the Slackware section of the linux_install.sh script based on the suggestions from the code review. * Modify utils/linux_install.sh according to suggestions --- util/linux_install.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/util/linux_install.sh b/util/linux_install.sh index 8dc28be6ef..971d4c543c 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -4,6 +4,8 @@ GENTOO_WARNING="This script will make a USE change in order to ensure that that QMK works on your system. All changes will be sent to the the file /etc/portage/package.use/qmk_firmware -- please review it, and read Portage's output carefully before installing any packages on your system. You will also need to ensure that your kernel is compiled with support for the keyboard chip that you are using (e.g. enable Arduino for the Pro Micro). Further information can be found on the Gentoo wiki." +SLACKWARE_WARNING="You will need the following packages from slackbuilds.org:\n\tarm-binutils\n\tarm-gcc\n\tavr-binutils\n\tavr-gcc\n\tavr-libc\n\tavrdude\n\tdfu-programmer\n\tdfu-util\n\tnewlib\nThese packages will be installed with sudo and sboinstall, so ensure that your user is added to sudoers and that sboinstall is configured." + if grep ID /etc/os-release | grep -qE "fedora"; then sudo dnf install \ arm-none-eabi-binutils-cs \ @@ -126,6 +128,26 @@ elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then wget \ zip +elif grep ID /etc/os-release | grep -q slackware; then + printf "$SLACKWARE_WARNING\n" + printf "\nProceed (y/N)? " + read -r answer + if echo "$answer" | grep -iq "^y" ;then + sudo sboinstall \ + avr-binutils \ + avr-gcc \ + avr-libc \ + avrdude \ + dfu-programmer \ + dfu-util \ + arm-binutils \ + arm-gcc \ + newlib + echo "Done!" + else + echo "Quitting..." + fi + else echo "Sorry, we don't recognize your OS. Help us by contributing support!" echo -- cgit v1.2.3 From 746005acba3a3522eaa2bf1c8014644e1a60c5df Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 12 Nov 2018 20:00:45 +0000 Subject: Keyboard: Initial 25 port (#4394) * Initial 25 port * Initial 25 port - fix info.json and hand_swap_config * Review comments - fix layout macros, copyright comments, and duplicated use of layering macros --- keyboards/40percentclub/25/25.c | 60 ++++++ keyboards/40percentclub/25/25.h | 85 ++++++++ keyboards/40percentclub/25/config.h | 230 +++++++++++++++++++++ keyboards/40percentclub/25/info.json | 29 +++ .../40percentclub/25/keymaps/default/config.h | 19 ++ .../40percentclub/25/keymaps/default/keymap.c | 87 ++++++++ .../40percentclub/25/keymaps/default/readme.md | 1 + keyboards/40percentclub/25/keymaps/macro/config.h | 19 ++ keyboards/40percentclub/25/keymaps/macro/keymap.c | 42 ++++ keyboards/40percentclub/25/keymaps/macro/readme.md | 1 + keyboards/40percentclub/25/readme.md | 18 ++ keyboards/40percentclub/25/rules.mk | 85 ++++++++ 12 files changed, 676 insertions(+) create mode 100644 keyboards/40percentclub/25/25.c create mode 100644 keyboards/40percentclub/25/25.h create mode 100644 keyboards/40percentclub/25/config.h create mode 100644 keyboards/40percentclub/25/info.json create mode 100644 keyboards/40percentclub/25/keymaps/default/config.h create mode 100644 keyboards/40percentclub/25/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/25/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/25/keymaps/macro/config.h create mode 100644 keyboards/40percentclub/25/keymaps/macro/keymap.c create mode 100644 keyboards/40percentclub/25/keymaps/macro/readme.md create mode 100644 keyboards/40percentclub/25/readme.md create mode 100644 keyboards/40percentclub/25/rules.mk diff --git a/keyboards/40percentclub/25/25.c b/keyboards/40percentclub/25/25.c new file mode 100644 index 0000000000..54a42d263c --- /dev/null +++ b/keyboards/40percentclub/25/25.c @@ -0,0 +1,60 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "25.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + {{4, 5}, {3, 5}, {2, 5}, {1, 5}, {0, 5}}, + {{4, 6}, {3, 6}, {2, 6}, {1, 6}, {0, 6}}, + {{4, 7}, {3, 7}, {2, 7}, {1, 7}, {0, 7}}, + {{4, 8}, {3, 8}, {2, 8}, {1, 8}, {0, 8}}, + {{4, 9}, {3, 9}, {2, 9}, {1, 9}, {0, 9}}, + + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}}, + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}}, +}; +#endif diff --git a/keyboards/40percentclub/25/25.h b/keyboards/40percentclub/25/25.h new file mode 100644 index 0000000000..db9c48b524 --- /dev/null +++ b/keyboards/40percentclub/25/25.h @@ -0,0 +1,85 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ___ KC_NO + +#ifndef FLIP_HALF +#define LAYOUT_ortho_5x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L30, L31, L32, L33, L34, R30, R31, R32, R33, R34, \ + L40, L41, L42, L43, L44, R40, R41, R42, R43, R44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { R04, R03, R02, R01, R00 }, \ + { R14, R13, R12, R11, R10 }, \ + { R24, R23, R22, R21, R20 }, \ + { R34, R33, R32, R31, R30 }, \ + { R44, R43, R42, R41, R40 } \ +} +#else +#define LAYOUT_ortho_5x10( \ + L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ + L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ + L20, L21, L22, L23, L24, R20, R21, R22, R23, R24, \ + L30, L31, L32, L33, L34, R30, R31, R32, R33, R34, \ + L40, L41, L42, L43, L44, R40, R41, R42, R43, R44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { R00, R01, R02, R03, R04 }, \ + { R10, R11, R12, R13, R14 }, \ + { R20, R21, R22, R23, R24 }, \ + { R30, R31, R32, R33, R34 }, \ + { R40, R41, R42, R43, R44 } \ +} +#endif + +#define LAYOUT_ortho_5x5( \ + L00, L01, L02, L03, L04, \ + L10, L11, L12, L13, L14, \ + L20, L21, L22, L23, L24, \ + L30, L31, L32, L33, L34, \ + L40, L41, L42, L43, L44 \ +) { \ + { L00, L01, L02, L03, L04 }, \ + { L10, L11, L12, L13, L14 }, \ + { L20, L21, L22, L23, L24 }, \ + { L30, L31, L32, L33, L34 }, \ + { L40, L41, L42, L43, L44 }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ }, \ + { ___, ___, ___, ___, ___ } \ +} + +#define LAYOUT_macro LAYOUT_ortho_5x5 +#define LAYOUT_split LAYOUT_ortho_5x10 + +#ifdef USE_I2C + #error "I2C not Supported" +#endif diff --git a/keyboards/40percentclub/25/config.h b/keyboards/40percentclub/25/config.h new file mode 100644 index 0000000000..23b768e153 --- /dev/null +++ b/keyboards/40percentclub/25/config.h @@ -0,0 +1,230 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0F25 +#define MANUFACTURER di0ib +#define PRODUCT The 5x5 Keyboard +#define DESCRIPTION A split 50 key keyboard + +#define USE_SERIAL + +/* Select hand configuration */ +#define MASTER_LEFT +//#define MASTER_RIGHT +//#define EE_HANDS + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 5*2 +#define MATRIX_COLS 5 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D4, C6, D7, E6, B4 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + +// #define RGB_DI_PIN E2 +// #ifdef RGB_DI_PIN +// #define RGBLIGHT_ANIMATIONS +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/25/info.json b/keyboards/40percentclub/25/info.json new file mode 100644 index 0000000000..abb77a0677 --- /dev/null +++ b/keyboards/40percentclub/25/info.json @@ -0,0 +1,29 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 6, + "height": 2, + "layouts": { + "LAYOUT_macro": { + "key_count": 15, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4} + ] + }, + "LAYOUT_split": { + "key_count": 30, + "layout": [ + {"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, + {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, + {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, + {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, + {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4} + ] + } + } +} diff --git a/keyboards/40percentclub/25/keymaps/default/config.h b/keyboards/40percentclub/25/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/25/keymaps/default/keymap.c b/keyboards/40percentclub/25/keymaps/default/keymap.c new file mode 100644 index 0000000000..ccb54c82a1 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/keymap.c @@ -0,0 +1,87 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// 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 _QWERTY 0 +#define _LOWER 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,---------------------------------------------------------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------+------+------+------+------| + * | Q | W | E | R | T | Y | U | I | O | P | + * |------+------+------+------+-------------+------+------+------+------| + * | A | S | D | F | G | H | J | K | L | Bksp | + * |------+------+------+------+------|------+------+------+------+------| + * | Z | X | C | V | B | N | M | , | . |Enter | + * |------+------+------+------+------+------+------+------+------+------| + * | Ctrl | GUI | Alt |Lower |Space | Shift| Left | Down | Up |Right | + * `---------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_split( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_BSPC, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_LSFT, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,---------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | ` | / | _ | + | + * |------+------+------+------+------|------+------+------+------+------| + * | F7 | F8 | F9 | F10 | F11 | F12 | ~ | [ | ] | \ | + * |------+------+------+------+-------------+------+------+------+------| + * | Esc | | | | | | | ; | " | Del | + * |------+------+------+------+------|------+------+------+------+------| + * | Tab | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------| + * | | | | | | | Home | PgDn | PgUp | End | + * `---------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_split( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_GRV, KC_SLSH, KC_UNDS, KC_PLUS, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TILD, KC_LBRC, KC_RBRC, KC_PIPE, \ + KC_ESC, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_QUOT, KC_DEL, \ + KC_TAB, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/25/keymaps/default/readme.md b/keyboards/40percentclub/25/keymaps/default/readme.md new file mode 100644 index 0000000000..7558c42ec5 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default split keymap for 25 diff --git a/keyboards/40percentclub/25/keymaps/macro/config.h b/keyboards/40percentclub/25/keymaps/macro/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/25/keymaps/macro/keymap.c b/keyboards/40percentclub/25/keymaps/macro/keymap.c new file mode 100644 index 0000000000..80d227710b --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/keymap.c @@ -0,0 +1,42 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_macro( + KC_ESC, KC_1, KC_2, KC_3, KC_4, \ + KC_GRV, KC_Q, KC_W, KC_E, KC_R, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/25/keymaps/macro/readme.md b/keyboards/40percentclub/25/keymaps/macro/readme.md new file mode 100644 index 0000000000..6645f93dd8 --- /dev/null +++ b/keyboards/40percentclub/25/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default macro keymap for 25 diff --git a/keyboards/40percentclub/25/readme.md b/keyboards/40percentclub/25/readme.md new file mode 100644 index 0000000000..b1685b618d --- /dev/null +++ b/keyboards/40percentclub/25/readme.md @@ -0,0 +1,18 @@ +# 25 + +![25](https://2.bp.blogspot.com/-lBK_ZlB3a9Q/WcAM0B_vwdI/AAAAAAACDgs/qnI9YB53pzck4Bw0v5QRvypDMs80CxWVQCLcBGAs/s640/IMG_0695.JPG) +=== + +Split 50 key keyboard - it is the largest keybad that fits within the 100mm x 100mm PCB size. Can be used together as a split keyboard or as a single 25 key macropad. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/25) + +Keyboard Maintainer: QMK Community +Hardware Supported: 25 PCB +Hardware Availability: [25 project on 40% Keyboards](http://www.40percent.club/2017/09/25.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/25: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/40percentclub/25/rules.mk b/keyboards/40percentclub/25/rules.mk new file mode 100644 index 0000000000..bfcdce7c99 --- /dev/null +++ b/keyboards/40percentclub/25/rules.mk @@ -0,0 +1,85 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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) + +# Enable generic behavior for split boards +SPLIT_KEYBOARD = yes + +LAYOUTS = ortho_5x5 ortho_5x10 -- cgit v1.2.3 From b173c05cc25e9394c6e50081c1af707443950104 Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 12 Nov 2018 20:02:28 +0000 Subject: Tidy 40percentclub boards (#4403) * Remove unnecessary re-definitions for XXXXXXX and _______ * Update 6lit to use KC_NO in layout macros * Update rules.mk to follow current template * Remove use of deprecated function action_get_macro - unused and contents were from old template * Remove use of deprecated function action_get_macro - all code was commented out * Remove use of deprecated function action_get_macro - convert macro to use process_record_user * Convert keymap to consistent use of _______ * fix use of old style header guards * Swap KC_NO for XXXXXXX macro since the swap to the macro for KC_TRANS * Resolve use of ?= in rules.mk files * Remove duplication of rules.mk and config.h in gherkin mjt keymap * Remove unnecessary #includes * Align layout macros so foobar can use gherkin keymaps * Align 6lit layout macros with foobar * Remove ifndef QUANTUM_DIR from keymaps --- keyboards/40percentclub/4x4/4x4.h | 6 +- .../40percentclub/4x4/keymaps/default/keymap.c | 22 +-- keyboards/40percentclub/4x4/rules.mk | 32 ++-- keyboards/40percentclub/5x5/5x5.h | 6 +- .../40percentclub/5x5/keymaps/default/keymap.c | 24 +-- keyboards/40percentclub/5x5/rules.mk | 33 ++-- keyboards/40percentclub/6lit/6lit.h | 13 +- keyboards/40percentclub/foobar/foobar.h | 9 +- .../40percentclub/foobar/keymaps/default/keymap.c | 1 - keyboards/40percentclub/foobar/rules.mk | 2 + keyboards/40percentclub/gherkin/config.h | 5 +- keyboards/40percentclub/gherkin/gherkin.h | 5 +- .../gherkin/keymaps/bbaserdem/config.h | 6 +- .../gherkin/keymaps/bbaserdem/rules.mk | 4 - .../40percentclub/gherkin/keymaps/default/keymap.c | 11 -- .../gherkin/keymaps/itsaferbie/config.h | 7 +- .../gherkin/keymaps/itsaferbie/keymap.c | 31 ++-- .../gherkin/keymaps/itsaferbie/rules.mk | 4 - .../40percentclub/gherkin/keymaps/mjt/config.h | 168 +-------------------- .../40percentclub/gherkin/keymaps/mjt/keymap.c | 29 ---- .../40percentclub/gherkin/keymaps/mjt/rules.mk | 31 +--- .../40percentclub/gherkin/keymaps/steno/config.h | 7 +- .../40percentclub/gherkin/keymaps/steno/rules.mk | 8 +- .../gherkin/keymaps/talljoe-gherkin/config.h | 7 +- .../gherkin/keymaps/talljoe-gherkin/keymap.c | 2 - .../gherkin/keymaps/talljoe-gherkin/rules.mk | 4 - keyboards/40percentclub/gherkin/rules.mk | 39 +++-- keyboards/40percentclub/luddite/rules.mk | 39 +++-- keyboards/40percentclub/mf68/config.h | 5 +- .../40percentclub/mf68/keymaps/default/keymap.c | 15 -- .../40percentclub/mf68/keymaps/factory/keymap.c | 15 -- keyboards/40percentclub/mf68/mf68.h | 5 +- keyboards/40percentclub/mf68/rules.mk | 54 ++++--- keyboards/40percentclub/mf68_ble/config.h | 5 +- .../mf68_ble/keymaps/default/keymap.c | 15 -- keyboards/40percentclub/mf68_ble/mf68_ble.h | 5 +- keyboards/40percentclub/mf68_ble/rules.mk | 54 ++++--- keyboards/40percentclub/nano/config.h | 5 +- .../40percentclub/nano/keymaps/default/keymap.c | 1 - .../40percentclub/nano/keymaps/spooka/keymap.c | 2 - keyboards/40percentclub/nano/nano.h | 5 +- keyboards/40percentclub/nano/rules.mk | 34 +++-- keyboards/40percentclub/tomato/config.h | 5 +- .../40percentclub/tomato/keymaps/default/keymap.c | 39 ++--- keyboards/40percentclub/tomato/rules.mk | 32 +++- keyboards/40percentclub/tomato/tomato.h | 5 +- keyboards/40percentclub/ut47/config.h | 5 +- .../40percentclub/ut47/keymaps/default/config.h | 5 +- .../40percentclub/ut47/keymaps/default/keymap.c | 1 - .../40percentclub/ut47/keymaps/non-us/config.h | 5 +- .../40percentclub/ut47/keymaps/non-us/keymap.c | 1 - .../40percentclub/ut47/keymaps/nordic/keymap.c | 1 - keyboards/40percentclub/ut47/keymaps/rgb/config.h | 5 +- keyboards/40percentclub/ut47/keymaps/rgb/keymap.c | 1 - keyboards/40percentclub/ut47/rules.mk | 31 +++- keyboards/40percentclub/ut47/ut47.h | 5 +- 56 files changed, 299 insertions(+), 617 deletions(-) diff --git a/keyboards/40percentclub/4x4/4x4.h b/keyboards/40percentclub/4x4/4x4.h index ec75c3e280..8cc5a150aa 100644 --- a/keyboards/40percentclub/4x4/4x4.h +++ b/keyboards/40percentclub/4x4/4x4.h @@ -1,6 +1,4 @@ - -#ifndef FOURX4_H -#define FOURX4_H +#pragma once #include "quantum.h" #define ___ KC_NO @@ -58,5 +56,3 @@ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ } - -#endif diff --git a/keyboards/40percentclub/4x4/keymaps/default/keymap.c b/keyboards/40percentclub/4x4/keymaps/default/keymap.c index 144ec05c17..1f52b20667 100644 --- a/keyboards/40percentclub/4x4/keymaps/default/keymap.c +++ b/keyboards/40percentclub/4x4/keymaps/default/keymap.c @@ -6,9 +6,6 @@ #define NUM 2 #define DIR 3 -// Readability keycodes -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Single 4x4 board only @@ -65,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [NUM] = LAYOUT_ortho_4x16( _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, _______, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, _______, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, + _______, KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -90,23 +87,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; - -const uint16_t PROGMEM fn_actions[] = { - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - - void matrix_init_user(void) { } diff --git a/keyboards/40percentclub/4x4/rules.mk b/keyboards/40percentclub/4x4/rules.mk index d572e72444..a513357988 100644 --- a/keyboards/40percentclub/4x4/rules.mk +++ b/keyboards/40percentclub/4x4/rules.mk @@ -36,24 +36,30 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 -# 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 selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID BOOTLOADER = caterina + +# 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) +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) @@ -68,7 +74,7 @@ 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) +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) #FIXME: Community keymap build are currently failing due to missing functionality #LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/40percentclub/5x5/5x5.h b/keyboards/40percentclub/5x5/5x5.h index 45fb80a4f7..182e9e8190 100644 --- a/keyboards/40percentclub/5x5/5x5.h +++ b/keyboards/40percentclub/5x5/5x5.h @@ -1,6 +1,4 @@ - -#ifndef FIVEX5_H -#define FIVEX5_H +#pragma once #include "quantum.h" #define ___ KC_NO @@ -53,5 +51,3 @@ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e}, \ { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4a, K4b, K4c, K4d, K4e} \ } - -#endif diff --git a/keyboards/40percentclub/5x5/keymaps/default/keymap.c b/keyboards/40percentclub/5x5/keymaps/default/keymap.c index a2c525d089..56ddbb23f5 100644 --- a/keyboards/40percentclub/5x5/keymaps/default/keymap.c +++ b/keyboards/40percentclub/5x5/keymaps/default/keymap.c @@ -6,9 +6,6 @@ #define NUM 2 #define DIR 3 -// Readability keycodes -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Single 5x5 board only @@ -74,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, _______, KC_PPLS, - _______, KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_TRNS, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, + _______, KC_F11, KC_F12, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, ALT_T(KC_DOT), CTL_T(KC_BSPC), _______, _______, _______, KC_PENT, _______, _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, _______, _______, _______, _______, _______, _______, _______ ), @@ -102,25 +99,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - void matrix_init_user(void) { diff --git a/keyboards/40percentclub/5x5/rules.mk b/keyboards/40percentclub/5x5/rules.mk index abc961a86f..ae04141269 100644 --- a/keyboards/40percentclub/5x5/rules.mk +++ b/keyboards/40percentclub/5x5/rules.mk @@ -36,24 +36,31 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -# OPT_DEFS += -DBOOTLOADER_SIZE=4096 -# 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 selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID BOOTLOADER = caterina + +# 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) +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) @@ -68,7 +75,7 @@ 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) +HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) #FIXME: Community keymap build are currently failing due to missing functionality #LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/keyboards/40percentclub/6lit/6lit.h b/keyboards/40percentclub/6lit/6lit.h index ae0beea35d..af01d44c2a 100644 --- a/keyboards/40percentclub/6lit/6lit.h +++ b/keyboards/40percentclub/6lit/6lit.h @@ -16,10 +16,10 @@ #pragma once #include "quantum.h" -#define ________ KC_NO +#define ___ KC_NO #ifndef FLIP_HALF -#define LAYOUT_split( \ +#define LAYOUT_ortho_2x6( \ L00, L01, L02, R00, R01, R02, \ L10, L11, L12, R10, R11, R12 \ ) { \ @@ -29,7 +29,7 @@ { R12, R11, R10 }, \ } #else -#define LAYOUT_split( \ +#define LAYOUT_ortho_2x6( \ L00, L01, L02, R00, R01, R02, \ L10, L11, L12, R10, R11, R12 \ ) { \ @@ -40,15 +40,18 @@ } #endif -#define LAYOUT_macro( \ +#define LAYOUT_ortho_2x3( \ L00, L01, L02, \ L10, L11, L12 \ ) { \ { L00, L01, L02 }, \ { L10, L11, L12 }, \ + { ___, ___, ___ }, \ + { ___, ___, ___ }, \ } -#define LAYOUT LAYOUT_macro +#define LAYOUT_macro LAYOUT_ortho_2x3 +#define LAYOUT_split LAYOUT_ortho_2x6 #ifdef USE_I2C #error "I2C not Supported" diff --git a/keyboards/40percentclub/foobar/foobar.h b/keyboards/40percentclub/foobar/foobar.h index fc49c72aaf..8cf2e384ff 100644 --- a/keyboards/40percentclub/foobar/foobar.h +++ b/keyboards/40percentclub/foobar/foobar.h @@ -19,7 +19,7 @@ #define ___ KC_NO #ifndef FLIP_HALF -#define LAYOUT_split( \ +#define LAYOUT_ortho_3x10( \ L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ @@ -32,7 +32,7 @@ { R24, R23, R22, R21, R20 } \ } #else -#define LAYOUT_split( \ +#define LAYOUT_ortho_3x10( \ L00, L01, L02, L03, L04, R00, R01, R02, R03, R04, \ L10, L11, L12, L13, L14, R10, R11, R12, R13, R14, \ L20, L21, L22, L23, L24, R20, R21, R22, R23, R24 \ @@ -46,7 +46,7 @@ } #endif -#define LAYOUT_macro( \ +#define LAYOUT_ortho_3x5( \ L00, L01, L02, L03, L04, \ L10, L11, L12, L13, L14, \ L20, L21, L22, L23, L24 \ @@ -59,7 +59,8 @@ { ___, ___, ___, ___, ___ } \ } -#define LAYOUT LAYOUT_macro +#define LAYOUT_macro LAYOUT_ortho_3x5 +#define LAYOUT_split LAYOUT_ortho_3x10 #ifdef USE_I2C #error "I2C not Supported" diff --git a/keyboards/40percentclub/foobar/keymaps/default/keymap.c b/keyboards/40percentclub/foobar/keymaps/default/keymap.c index b750c61851..774f1e8542 100644 --- a/keyboards/40percentclub/foobar/keymaps/default/keymap.c +++ b/keyboards/40percentclub/foobar/keymaps/default/keymap.c @@ -15,7 +15,6 @@ */ #include QMK_KEYBOARD_H -#define _______ KC_TRNS #define FN1_Q LT(1, KC_Q) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/40percentclub/foobar/rules.mk b/keyboards/40percentclub/foobar/rules.mk index 3275651650..155a7daacb 100644 --- a/keyboards/40percentclub/foobar/rules.mk +++ b/keyboards/40percentclub/foobar/rules.mk @@ -81,3 +81,5 @@ HD44780_ENABLE = no # Enable support for HD44780 based LCDs (+400) # Enable generic behavior for split boards SPLIT_KEYBOARD = yes + +LAYOUTS = ortho_3x10 diff --git a/keyboards/40percentclub/gherkin/config.h b/keyboards/40percentclub/gherkin/config.h index 34f38e35c2..3ed638b66f 100644 --- a/keyboards/40percentclub/gherkin/config.h +++ b/keyboards/40percentclub/gherkin/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -50,5 +49,3 @@ #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 #endif - -#endif diff --git a/keyboards/40percentclub/gherkin/gherkin.h b/keyboards/40percentclub/gherkin/gherkin.h index f8674be40e..70bffee302 100644 --- a/keyboards/40percentclub/gherkin/gherkin.h +++ b/keyboards/40percentclub/gherkin/gherkin.h @@ -1,5 +1,4 @@ -#ifndef GHERKIN_H -#define GHERKIN_H +#pragma once #include "quantum.h" @@ -14,5 +13,3 @@ { K30, K31, K32, K33, K34, K35 }, \ { K40, K41, K42, K43, K44, K45 } \ } - -#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h index 37d7113e78..5c9ca52d75 100644 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/config.h @@ -1,7 +1,5 @@ -#ifndef CONFIG_KEYMAP_H -#define CONFIG_KEYMAP_H +#pragma once -#include "../../config.h" #define RGB_DI_PIN F6 #define RGBLED_NUM 10 #define RGBLIGHT_ANIMATIONS @@ -9,5 +7,3 @@ #undef BACKLIGHT_LEVELS #endif #define BACKLIGHT_LEVELS 3 - -#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk index cd1cddebf4..07a20a4217 100644 --- a/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk +++ b/keyboards/40percentclub/gherkin/keymaps/bbaserdem/rules.mk @@ -1,7 +1,3 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - USER_NAME := bbaserdem-nouserspace STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c index f018200304..ae6f158627 100644 --- a/keyboards/40percentclub/gherkin/keymaps/default/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/default/keymap.c @@ -1,6 +1,5 @@ #include QMK_KEYBOARD_H -#define _______ KC_TRNS #define FN1_Q LT(1, KC_Q) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -19,16 +18,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - - } - return MACRO_NONE; -} - void matrix_init_user(void) { } diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h index 71c0cb8b56..6849bbdd2c 100644 --- a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/config.h @@ -1,7 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #undef RGB_DI_PIN #undef RGBLED_NUM @@ -11,5 +8,3 @@ #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c index 580b041c9c..950b6e86b9 100644 --- a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/keymap.c @@ -12,10 +12,9 @@ enum custom_keycodes { PS = SAFE_RANGE, AI, PR, + MACRO_0, }; -#define _______ KC_TRNS - #define PS TO(0) #define AI TO(1) #define PR TO(2) @@ -72,7 +71,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Illustrator layer [_AI] = LAYOUT_ortho_3x10( - _______, M(0), RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, + _______, MACRO_0, RULER, _______, KC_G, _______, _______, KC_Q, KC_MINS, KC_PLUS, _______, _______, _______, KC_E, _______, _______, _______, SHAPE, KC_O, OPEN, _______, _______, _______, _______, _______, _______, _______, KC_M, KC_SLSH, PR ), @@ -133,20 +132,14 @@ void matrix_scan_user(void) { #endif } -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - (void)event; - - switch (id) { - case 0: - // Save for Web Macro. - return MACRO(D(LSFT), D(LALT), D(LCTL), T(S), U(LCTL), U(LALT), U(LSFT), END); - } - return MACRO_NONE; -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - } - return true; -} + if (record->event.pressed) { + switch(keycode) { + case MACRO_0: + // Save for Web Macro. + SEND_STRING(SS_LSFT(SS_LALT(SS_LCTRL("s")))); + return false; + } + } + return true; +}; diff --git a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk index ed0af7b8bd..b359ca2874 100644 --- a/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk +++ b/keyboards/40percentclub/gherkin/keymaps/itsaferbie/rules.mk @@ -1,7 +1,3 @@ BACKLIGHT_ENABLE = yes AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/config.h b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h index bb59ec213d..9fe94bcd21 100644 --- a/keyboards/40percentclub/gherkin/keymaps/mjt/config.h +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/config.h @@ -1,169 +1,7 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 +#undef MANUFACTURER +#undef DESCRIPTION #define MANUFACTURER Some Guy -#define PRODUCT Gherkin #define DESCRIPTION 30 percent disaster - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 6 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ - -// These are with USB on the left. -// #define MATRIX_ROW_PINS { B6, B2, B3, B1, F7 } -// original from TMK: #define MATRIX_COL_PINS { D0, D4, C6, D7, E6, B4 } -// #define MATRIX_COL_PINS { D0, D4, F6, D7, E6, B4 } - -// these are with USB on the right. -#define MATRIX_ROW_PINS { F7, B1, B3, B2, B6 } -#define MATRIX_COL_PINS { B4, E6, D7, F6, D4, D0 } - -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -#define BACKLIGHT_LEVELS 3 -#define BACKLIGHT_PIN B5 - -/* 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 - -#define AUDIO_VOICES - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c index 2b4369c34f..2fd4c2a461 100644 --- a/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/keymap.c @@ -12,7 +12,6 @@ enum { TD_C_LALT = 2, TD_A_TAB = 3, TD_Q_ESC = 4, -// M(0) }; //Friendly Layer Names @@ -37,10 +36,6 @@ enum gherkin_keycodes { EXT_PLV }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_QWERTY] = LAYOUT_ortho_3x10( TD(TD_Q_ESC), KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, @@ -171,30 +166,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; } - -/* -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - keyevent_t event = record->event; - - switch (id) { - case 0: { - if (record->event.pressed) { - key_timer = timer_read(); // if the key is being pressed, we start the timer. - } - else { // this means the key was just released, so we can figure out how long it was pressed for (tap or "held down"). - if (timer_elapsed(key_timer) > 150) { // 150 being 150ms, the threshhold we pick for counting something as a tap. - return MACRO( D(LSFT), END ); - } - else { - return MACRO( T(N), END ); - } - } - break; - } - } - return MACRO_NONE; -}*/ - void matrix_init_user(void) { #ifdef AUDIO_ENABLE startup_user(); diff --git a/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk index afb93b674c..3a35ae3b30 100644 --- a/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk +++ b/keyboards/40percentclub/gherkin/keymaps/mjt/rules.mk @@ -1,29 +1,2 @@ -## not sure where this stuff goes ## -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DBOOTLOADER_SIZE=4096 - -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality -MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = yes # 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. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -TAP_DANCE_ENABLE=yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +AUDIO_ENABLE = yes # Audio output on port C6 +TAP_DANCE_ENABLE = yes diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/config.h b/keyboards/40percentclub/gherkin/keymaps/steno/config.h index abacefa01d..20a8f7844a 100644 --- a/keyboards/40percentclub/gherkin/keymaps/steno/config.h +++ b/keyboards/40percentclub/gherkin/keymaps/steno/config.h @@ -1,12 +1,7 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once #define NO_ACTION_LAYER #define NO_ACTION_TAPPING #define NO_ACTION_ONESHOT #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION - -#endif \ No newline at end of file diff --git a/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk index fa813f2099..a6e76f7cf9 100644 --- a/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk +++ b/keyboards/40percentclub/gherkin/keymaps/steno/rules.mk @@ -1,8 +1,4 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) @@ -13,4 +9,4 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend NKRO_ENABLE = no # USB 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 AUDIO_ENABLE = no -RGBLIGHT_ENABLE = no \ No newline at end of file +RGBLIGHT_ENABLE = no diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h index 7fa3bf328e..271f48d001 100644 --- a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c index ea2921924e..ca3da579a1 100644 --- a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/keymap.c @@ -4,8 +4,6 @@ #define ST_BOLT QK_STENO_BOLT #define ST_GEM QK_STENO_GEMINI -#define XXXXXXX KC_NO - enum keyboard_layers { _QWERTY, _RAISE, diff --git a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk index 02216ecb36..a64c606ae7 100644 --- a/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk +++ b/keyboards/40percentclub/gherkin/keymaps/talljoe-gherkin/rules.mk @@ -1,6 +1,2 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - MOUSEKEY_ENABLE = no # Mouse keys(+4700) STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER diff --git a/keyboards/40percentclub/gherkin/rules.mk b/keyboards/40percentclub/gherkin/rules.mk index 416ca5e5f4..1e0b346417 100644 --- a/keyboards/40percentclub/gherkin/rules.mk +++ b/keyboards/40percentclub/gherkin/rules.mk @@ -33,25 +33,40 @@ ARCH = AVR8 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) -# 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 = caterina - # 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 = caterina + + +# 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 # comment out to disable the options. # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no RGBLIGHT_ENABLE = no diff --git a/keyboards/40percentclub/luddite/rules.mk b/keyboards/40percentclub/luddite/rules.mk index 2f7d847bf0..8dff21f9ab 100644 --- a/keyboards/40percentclub/luddite/rules.mk +++ b/keyboards/40percentclub/luddite/rules.mk @@ -33,25 +33,40 @@ ARCH = AVR8 # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU. F_USB = $(F_CPU) -# 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 = caterina - # 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 = caterina + + +# 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 # comment out to disable the options. # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes diff --git a/keyboards/40percentclub/mf68/config.h b/keyboards/40percentclub/mf68/config.h index 07d787eacf..22d987e52c 100644 --- a/keyboards/40percentclub/mf68/config.h +++ b/keyboards/40percentclub/mf68/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -158,5 +157,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/40percentclub/mf68/keymaps/default/keymap.c b/keyboards/40percentclub/mf68/keymaps/default/keymap.c index 73045f3107..ae7e7297cb 100644 --- a/keyboards/40percentclub/mf68/keymaps/default/keymap.c +++ b/keyboards/40percentclub/mf68/keymaps/default/keymap.c @@ -51,18 +51,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/40percentclub/mf68/keymaps/factory/keymap.c b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c index 0c5305e519..12032350cd 100644 --- a/keyboards/40percentclub/mf68/keymaps/factory/keymap.c +++ b/keyboards/40percentclub/mf68/keymaps/factory/keymap.c @@ -57,18 +57,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/40percentclub/mf68/mf68.h b/keyboards/40percentclub/mf68/mf68.h index a55c1d60b0..a34f9cde8d 100644 --- a/keyboards/40percentclub/mf68/mf68.h +++ b/keyboards/40percentclub/mf68/mf68.h @@ -1,5 +1,4 @@ -#ifndef MF68_H -#define MF68_H +#pragma once #include "quantum.h" @@ -36,5 +35,3 @@ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ ) - -#endif diff --git a/keyboards/40percentclub/mf68/rules.mk b/keyboards/40percentclub/mf68/rules.mk index 9f6445686d..38c9f517b9 100644 --- a/keyboards/40percentclub/mf68/rules.mk +++ b/keyboards/40percentclub/mf68/rules.mk @@ -1,4 +1,3 @@ - # MCU name MCU = atmega32u4 @@ -15,7 +14,6 @@ MCU = atmega32u4 # software delays. F_CPU = 16000000 - # # LUFA specific # @@ -39,30 +37,42 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# 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 +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 +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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 -LAYOUTS = 68_ansi \ No newline at end of file +LAYOUTS = 68_ansi diff --git a/keyboards/40percentclub/mf68_ble/config.h b/keyboards/40percentclub/mf68_ble/config.h index 83c0a7a5ac..e7edd77fe6 100644 --- a/keyboards/40percentclub/mf68_ble/config.h +++ b/keyboards/40percentclub/mf68_ble/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -158,5 +157,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c b/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c index 73045f3107..ae7e7297cb 100644 --- a/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c +++ b/keyboards/40percentclub/mf68_ble/keymaps/default/keymap.c @@ -51,18 +51,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /*`ctrl-+-gui-+-alt-+----------space---------------+-fn---+-alt-+ctrl-' `left+down+rght' */ ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/40percentclub/mf68_ble/mf68_ble.h b/keyboards/40percentclub/mf68_ble/mf68_ble.h index 8ef14c98d4..a34f9cde8d 100644 --- a/keyboards/40percentclub/mf68_ble/mf68_ble.h +++ b/keyboards/40percentclub/mf68_ble/mf68_ble.h @@ -1,5 +1,4 @@ -#ifndef MF68_BLE_H -#define MF68_BLE_H +#pragma once #include "quantum.h" @@ -36,5 +35,3 @@ KC_##K60, KC_##K61, KC_##K62, KC_##K63, KC_##K64, KC_##K65, KC_##K66, KC_##K67, KC_##K68, \ KC_##K70, KC_##K71, KC_##K72, KC_##K73, KC_##K74 \ ) - -#endif diff --git a/keyboards/40percentclub/mf68_ble/rules.mk b/keyboards/40percentclub/mf68_ble/rules.mk index 07b59d7853..2ca811833c 100644 --- a/keyboards/40percentclub/mf68_ble/rules.mk +++ b/keyboards/40percentclub/mf68_ble/rules.mk @@ -1,4 +1,3 @@ - # MCU name MCU = atmega32u4 @@ -39,29 +38,42 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# 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 +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 +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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE ?= no # MIDI controls -UNICODE_ENABLE ?= no # Unicode -BLUETOOTH_ENABLE ?= no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE ?= no # Audio output on port C6 -BLUETOOTH = AdafruitBLE \ No newline at end of file +NKRO_ENABLE = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + +BLUETOOTH = AdafruitBLE diff --git a/keyboards/40percentclub/nano/config.h b/keyboards/40percentclub/nano/config.h index 088fafcaa5..36840d2f6c 100644 --- a/keyboards/40percentclub/nano/config.h +++ b/keyboards/40percentclub/nano/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -41,5 +40,3 @@ along with this program. If not, see . #define DIODE_DIRECTION COL2ROW #define TAPPING_TERM 200 - -#endif diff --git a/keyboards/40percentclub/nano/keymaps/default/keymap.c b/keyboards/40percentclub/nano/keymaps/default/keymap.c index cd9d4549de..9ce282a28a 100644 --- a/keyboards/40percentclub/nano/keymaps/default/keymap.c +++ b/keyboards/40percentclub/nano/keymaps/default/keymap.c @@ -3,7 +3,6 @@ #define _MAIN 0 #define _FN 1 -#define _______ KC_TRNS #define KC_X0 LT(_FN, KC_ESC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { diff --git a/keyboards/40percentclub/nano/keymaps/spooka/keymap.c b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c index 63b90da09f..7908794fe0 100644 --- a/keyboards/40percentclub/nano/keymaps/spooka/keymap.c +++ b/keyboards/40percentclub/nano/keymaps/spooka/keymap.c @@ -2,8 +2,6 @@ #define _MAIN 0 -#define _______ KC_TRNS - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MAIN] = LAYOUT( RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, diff --git a/keyboards/40percentclub/nano/nano.h b/keyboards/40percentclub/nano/nano.h index 21d6c4f30c..ae297ac12e 100644 --- a/keyboards/40percentclub/nano/nano.h +++ b/keyboards/40percentclub/nano/nano.h @@ -1,5 +1,4 @@ -#ifndef NANO_H -#define NANO_H +#pragma once #include "quantum.h" @@ -10,5 +9,3 @@ { k01, k02, k03, k04 }, \ { k05, k06, k07, k08 } \ } - -#endif diff --git a/keyboards/40percentclub/nano/rules.mk b/keyboards/40percentclub/nano/rules.mk index dc510bc0d1..66ad3ffc66 100644 --- a/keyboards/40percentclub/nano/rules.mk +++ b/keyboards/40percentclub/nano/rules.mk @@ -1,7 +1,4 @@ -SRC = matrix.c - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -40,16 +37,28 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID +BOOTLOADER = caterina + + +# 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 to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -67,4 +76,7 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# custom matrix setup +SRC = matrix.c CUSTOM_MATRIX = yes diff --git a/keyboards/40percentclub/tomato/config.h b/keyboards/40percentclub/tomato/config.h index 185cb326cc..05c83c30cd 100644 --- a/keyboards/40percentclub/tomato/config.h +++ b/keyboards/40percentclub/tomato/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -44,5 +43,3 @@ #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 - -#endif diff --git a/keyboards/40percentclub/tomato/keymaps/default/keymap.c b/keyboards/40percentclub/tomato/keymaps/default/keymap.c index 94bfca202b..01a868d7e3 100644 --- a/keyboards/40percentclub/tomato/keymaps/default/keymap.c +++ b/keyboards/40percentclub/tomato/keymaps/default/keymap.c @@ -38,7 +38,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT_ortho_3x10 ( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0 , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_DEL, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + , _______,_______,_______,_______,KC_DEL, _______,_______,_______,_______,_______ ), /* Level 2: Symbols Layer * ,-------------------------------------------------------------------------------. @@ -51,8 +51,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ LAYOUT_ortho_3x10 ( KC_EXLM,KC_AT, KC_HASH,KC_DLR, KC_PERC,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN - , KC_F11, KC_F12,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_GRAVE - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + , KC_F11, KC_F12,_______,_______,_______,_______,_______,_______,_______,KC_GRAVE + , _______,_______,_______,_______,_______,_______,_______,_______,_______,_______ ), /* Level 3: RGB Layer * ,-------------------------------------------------------------------------------. @@ -64,9 +64,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '-------------------------------------------------------------------------------' */ LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT + ( _______,_______,_______,_______,_______,KC_MINS,KC_EQL, KC_LBRC,KC_RBRC,KC_BSLS + , KC_TAB, _______,_______,_______,_______,KC_COMM,KC_DOT, KC_SLSH,KC_SCLN,KC_QUOT + , _______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN,KC_UP, KC_RGHT ), /* Level 4: RGB Layer * ,-------------------------------------------------------------------------------. @@ -78,9 +78,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '-------------------------------------------------------------------------------' */ LAYOUT_ortho_3x10 - ( KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE - , KC_TAB, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_HOME,KC_PGUP,KC_PGDN,KC_END + ( _______,_______,_______,_______,_______,KC_UNDS,KC_PLUS,KC_LCBR,KC_RCBR,KC_PIPE + , KC_TAB, _______,_______,_______,_______,KC_LT, KC_GT, KC_QUES,KC_COLN,KC_DQUO + , _______,_______,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_PGDN,KC_END ), /* Level 5: RGB Layer * ,-------------------------------------------------------------------------------. @@ -92,27 +92,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '-------------------------------------------------------------------------------' */ LAYOUT_ortho_3x10 - ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS - , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,KC_NO, KC_NO, RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD - , KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,RESET, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS + ( KC_CALC,KC_WSCH,KC_MAIL,KC_MYCM,_______,_______,_______,_______,_______,_______ + , RGB_TOG,RGB_MOD,RGB_HUI,RGB_HUD,XXXXXXX,XXXXXXX,RGB_SAI,RGB_SAD,RGB_VAI,RGB_VAD + , _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______ ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - void matrix_init_user(void) { } diff --git a/keyboards/40percentclub/tomato/rules.mk b/keyboards/40percentclub/tomato/rules.mk index cbb2b05196..844ff99827 100644 --- a/keyboards/40percentclub/tomato/rules.mk +++ b/keyboards/40percentclub/tomato/rules.mk @@ -37,21 +37,37 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID BOOTLOADER = caterina +# 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 # comment out to disable the options. # BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB 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 +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 AUDIO_ENABLE = no RGBLIGHT_ENABLE = yes diff --git a/keyboards/40percentclub/tomato/tomato.h b/keyboards/40percentclub/tomato/tomato.h index f8674be40e..70bffee302 100644 --- a/keyboards/40percentclub/tomato/tomato.h +++ b/keyboards/40percentclub/tomato/tomato.h @@ -1,5 +1,4 @@ -#ifndef GHERKIN_H -#define GHERKIN_H +#pragma once #include "quantum.h" @@ -14,5 +13,3 @@ { K30, K31, K32, K33, K34, K35 }, \ { K40, K41, K42, K43, K44, K45 } \ } - -#endif diff --git a/keyboards/40percentclub/ut47/config.h b/keyboards/40percentclub/ut47/config.h index 4335e3edd5..cd55e4d732 100644 --- a/keyboards/40percentclub/ut47/config.h +++ b/keyboards/40percentclub/ut47/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -83,5 +82,3 @@ along with this program. If not, see . # else # error "USART configuration is needed." #endif - -#endif diff --git a/keyboards/40percentclub/ut47/keymaps/default/config.h b/keyboards/40percentclub/ut47/keymaps/default/config.h index 46098a22fb..f88ebf7e80 100644 --- a/keyboards/40percentclub/ut47/keymaps/default/config.h +++ b/keyboards/40percentclub/ut47/keymaps/default/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/40percentclub/ut47/keymaps/default/keymap.c b/keyboards/40percentclub/ut47/keymaps/default/keymap.c index 6b6bb025b1..0fa7838dfd 100644 --- a/keyboards/40percentclub/ut47/keymaps/default/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/default/keymap.c @@ -18,7 +18,6 @@ #include "protocol/serial.h" #endif -#define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) #define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/config.h b/keyboards/40percentclub/ut47/keymaps/non-us/config.h index 46098a22fb..f88ebf7e80 100644 --- a/keyboards/40percentclub/ut47/keymaps/non-us/config.h +++ b/keyboards/40percentclub/ut47/keymaps/non-us/config.h @@ -14,11 +14,8 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" // place overrides here - -#endif diff --git a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c index 1cb537b7d0..0c1c2e7599 100644 --- a/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/non-us/keymap.c @@ -18,7 +18,6 @@ #include "protocol/serial.h" #endif -#define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) #define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) diff --git a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c index cc3f43650e..f3e297ec03 100644 --- a/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/nordic/keymap.c @@ -21,7 +21,6 @@ #include "keymap_norwegian.h" -#define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) #define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) #define CTRADEL LALT(LCTL(KC_DEL)) diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/config.h b/keyboards/40percentclub/ut47/keymaps/rgb/config.h index 0eb010a3ae..791147b5bf 100644 --- a/keyboards/40percentclub/ut47/keymaps/rgb/config.h +++ b/keyboards/40percentclub/ut47/keymaps/rgb/config.h @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #include "config_common.h" @@ -23,5 +22,3 @@ #define RGBLIGHT_ANIMATIONS #define RGB_DI_PIN D3 // The pin the LED strip is connected to #define RGBLED_NUM 7 // Number of LEDs in your strip - -#endif diff --git a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c index 58d11031ad..77fa5b4017 100644 --- a/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c +++ b/keyboards/40percentclub/ut47/keymaps/rgb/keymap.c @@ -18,7 +18,6 @@ #include "protocol/serial.h" #endif -#define _______ KC_TRNS #define LT3_TAB LT(3, KC_TAB) #define MT_RSFT_ENT MT(MOD_RSFT, KC_ENT) diff --git a/keyboards/40percentclub/ut47/rules.mk b/keyboards/40percentclub/ut47/rules.mk index b046598669..7495f5edda 100644 --- a/keyboards/40percentclub/ut47/rules.mk +++ b/keyboards/40percentclub/ut47/rules.mk @@ -1,5 +1,4 @@ # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -38,12 +37,26 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Bootloader + +# Bootloader selection +# Teensy halfkay +# Pro Micro caterina +# Atmel DFU atmel-dfu +# LUFA DFU lufa-dfu +# QMK DFU qmk-dfu +# atmega32a bootloadHID BOOTLOADER = caterina -# custom matrix setup -CUSTOM_MATRIX = yes -SRC += matrix.c protocol/serial_uart.c + +# 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 @@ -51,12 +64,12 @@ SRC += matrix.c protocol/serial_uart.c BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = yes # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +CONSOLE_ENABLE = no # 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 +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) UNICODE_ENABLE = no # Unicode @@ -64,6 +77,10 @@ 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 +# custom matrix setup +CUSTOM_MATRIX = yes +SRC += matrix.c protocol/serial_uart.c + ifeq ($(strip $(LED_ENABLE)), yes) OPT_DEFS += -DLED_ENABLE SRC += led.c diff --git a/keyboards/40percentclub/ut47/ut47.h b/keyboards/40percentclub/ut47/ut47.h index a4507dd34d..f6456fe911 100644 --- a/keyboards/40percentclub/ut47/ut47.h +++ b/keyboards/40percentclub/ut47/ut47.h @@ -13,8 +13,7 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef UT47_H -#define UT47_H +#pragma once #include "quantum.h" @@ -45,5 +44,3 @@ ) #define LAYOUT_kc_ut47 LAYOUT_kc - -#endif -- cgit v1.2.3 From b26ccf9a2f7f070ee3a91456757dc463e46dfe10 Mon Sep 17 00:00:00 2001 From: Logan Bussell <36081148+lbussell@users.noreply.github.com> Date: Mon, 12 Nov 2018 15:04:12 -0500 Subject: Add rules.mk to ortho_4x12/buswerks keymap (#4405) * Added buswerks keymap * cleaned up comments on buswerks keymap * Added buswerks keymap readme.md * Fixed spelling in buswerks readme.md * Removed unnecessary includes, changed process_record_user to now use set_single_persistent_default_layer(), removed deprecated functions, and moved the audio ifdef block to config.h * Changed buswerks ortho_4x12 layout to accommodate 'MIT' layout * Updated README.md to reflect layout changes * update buswerks keymap * add buswerks tragicforce68 keymap --- keyboards/tragicforce68/keymaps/buswerks/keymap.c | 60 +++++++++++++++++++++++ layouts/community/ortho_4x12/buswerks/keymap.c | 56 +++++++++++++++------ layouts/community/ortho_4x12/buswerks/rules.mk | 9 ++++ 3 files changed, 109 insertions(+), 16 deletions(-) create mode 100644 keyboards/tragicforce68/keymaps/buswerks/keymap.c create mode 100644 layouts/community/ortho_4x12/buswerks/rules.mk diff --git a/keyboards/tragicforce68/keymaps/buswerks/keymap.c b/keyboards/tragicforce68/keymaps/buswerks/keymap.c new file mode 100644 index 0000000000..d74c0186d6 --- /dev/null +++ b/keyboards/tragicforce68/keymaps/buswerks/keymap.c @@ -0,0 +1,60 @@ +#include QMK_KEYBOARD_H + +#define _QWERTY 0 +#define _COLEMAK 1 +#define _FN1 2 + +#define WORD_L LALT(KC_LEFT) +#define WORD_R LALT(KC_RGHT) +#define LINE_L LGUI(KC_LEFT) +#define LINE_R LGUI(KC_RGHT) + +#define DESK_L LCTL(KC_LEFT) +#define DESK_R LCTL(KC_RGHT) +#define MSN_CTL LCTL(KC_UP) + +#define LT_FN LT(_FN1, KC_ESC) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_ESC, 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_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_PGDN, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + LT_FN, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_CAPS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ), + + [_COLEMAK] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_ESC, 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_PGUP, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_PGDN, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + LT_FN, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENTER, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, KC_CAPS, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ), + + [_FN1] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────┬────────────────┐ ┌────────┬────────┐ + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, KC_HOME, + //├────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────────────┤ ├────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + //├────────────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴─┬──────┴────────────┤ └────────┴────────┘ + _______, DESK_L, MSN_CTL, DESK_R, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, _______, + //├──────────────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───┬────┴───────────────────┤ ┌────────┐ + _______, _______, _______, _______, _______, _______, LINE_L, WORD_L, WORD_R, LINE_R, _______, _______, BL_INC, + //├──────────┬───────┴──┬─────┴────┬───┴────────┴────────┴────────┴────────┴────────┴──────┬─┴────────┼────────┴─┬──────────┬────┬──────┴─┬────────┼────────┐ + _______, _______, _______, KC_BSPC, _______, _______, KC_MENU, BL_BRTG, BL_DEC, BL_TOGG + //└──────────┴──────────┴──────────┴───────────────────────────────────────────────────────┴──────────┴──────────┴──────────┘ └────────┴────────┴────────┘ + ) +}; \ No newline at end of file diff --git a/layouts/community/ortho_4x12/buswerks/keymap.c b/layouts/community/ortho_4x12/buswerks/keymap.c index c05c264183..72c592a0c3 100644 --- a/layouts/community/ortho_4x12/buswerks/keymap.c +++ b/layouts/community/ortho_4x12/buswerks/keymap.c @@ -7,6 +7,7 @@ extern keymap_config_t keymap_config; #define _DVORAK 2 #define _LOWER 3 #define _RAISE 4 +#define _MOUSE 5 #define _ADJUST 16 enum custom_keycodes { @@ -15,7 +16,7 @@ enum custom_keycodes { DVORAK, LOWER, RAISE, - NAV, + MOUSE, ADJUST, }; @@ -29,15 +30,26 @@ enum custom_keycodes { #define KC_LOWR LOWER #define KC_RASE RAISE #define KC_ADJ ADJUST +#define MOUSE TG(_MOUSE) #define DESK_L LCTL(KC_LEFT) #define DESK_R LCTL(KC_RGHT) #define MSN_CTL LCTL(KC_UP) #define APP_WND LCTL(KC_DOWN) +#define SWITCHR LGUI(KC_TAB) + +#define WORD_L LALT(KC_LEFT) +#define WORD_R LALT(KC_RGHT) +#define LINE_L LGUI(KC_LEFT) +#define LINE_R LGUI(KC_RGHT) + +#define COPY LGUI(KC_C) +#define CUT LGUI(KC_X) +#define PASTE LGUI(KC_V) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = LAYOUT_ortho_4x12( \ +[_QWERTY] = LAYOUT_ortho_4x12( // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I, KC_O , KC_P , KC_BSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -45,7 +57,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + KC_LCTL, KC_HYPR, MOUSE , KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), @@ -57,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSPC, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + KC_LCTL, KC_HYPR, MOUSE , KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), @@ -69,38 +81,50 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ + KC_LCTL, KC_HYPR, MOUSE , KC_LALT, LOWER , KC_SPC , KC_SPC , RSE_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), [_LOWER] = LAYOUT_ortho_4x12( \ // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_TILD, _______, KC_VOLD, MSN_CTL, KC_VOLU, _______, _______, KC_7, KC_8, KC_9, KC_MINS, KC_BSPC, \ + SWITCHR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_7, KC_8, KC_9, KC_MINS, _______, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, DESK_L , APP_WND, DESK_R , _______, _______, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ + KC_TILD, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_4, KC_5, KC_6, KC_PLUS, KC_PIPE, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LBRC, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_SLSH, KC_RBRC, \ + _______, _______, _______, KC_UNDS, KC_EQL, _______, _______, KC_1, KC_2, KC_3, _______, _______, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, KC_0, _______, _______, _______, _______ \ + _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, _______, _______ \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), [_RAISE] = LAYOUT_ortho_4x12( \ // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. - KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_UNDS, KC_EQL, KC_DEL, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, KC_LBRC, KC_LCBR, KC_RCBR, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_BSLS, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, LINE_L, WORD_L, WORD_R, LINE_R, _______, _______, \ + // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT \ + // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' +), + +[_MOUSE] = LAYOUT_ortho_4x12( \ + // .--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + SWITCHR, _______, _______, KC_MS_U, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT, _______, KC_BSLS, \ + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3, _______, _______, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - KC_LCBR, KC_CIRC, KC_ASTR, KC_UNDS, KC_EQL, KC_AMPR, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, KC_RCBR, \ + _______, _______, _______, KC_WH_U, KC_WH_D, COPY, PASTE, KC_BTN4, KC_BTN5, _______, _______, _______, \ // |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + _______, _______, MOUSE , _______, _______, KC_SPC, KC_SPC, KC_ENT, KC_LEFT, KC_DOWN, KC_UP , KC_RGHT \ // '--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------' ), [_ADJUST] = LAYOUT_ortho_4x12( \ - KC_F11, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F12, \ - _______, _______, RESET, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, QWERTY, COLEMAK, DVORAK, RESET, _______, _______, _______, _______, AG_NORM, AG_SWAP, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, AU_OFF , AU_ON , _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) diff --git a/layouts/community/ortho_4x12/buswerks/rules.mk b/layouts/community/ortho_4x12/buswerks/rules.mk new file mode 100644 index 0000000000..72f8257322 --- /dev/null +++ b/layouts/community/ortho_4x12/buswerks/rules.mk @@ -0,0 +1,9 @@ +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 = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes + +MACROS_ENABLED = no \ No newline at end of file -- cgit v1.2.3 From 2509039abfc5f59d791c8e061641b6fc2e63a69b Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Mon, 12 Nov 2018 12:02:51 +0000 Subject: Add missing arm gcc compiler for openSUSE 15.0 and Tumbleweed. --- util/linux_install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/linux_install.sh b/util/linux_install.sh index 971d4c543c..0e8296c0d2 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -112,12 +112,15 @@ elif grep ID /etc/os-release | grep -q sabayon; then elif grep ID /etc/os-release | grep -qE "opensuse|tumbleweed"; then CROSS_AVR_GCC=cross-avr-gcc8 + CROSS_ARM_GCC=cross-arm-none-gcc8 if grep ID /etc/os-release | grep -q "15.0"; then CROSS_AVR_GCC=cross-avr-gcc7 + CROSS_ARM_GCC=cross-arm-none-gcc7 fi sudo zypper install \ avr-libc \ $CROSS_AVR_GCC \ + $CROSS_ARM_GCC \ cross-avr-binutils \ cross-arm-none-newlib-devel \ cross-arm-binutils cross-arm-none-newlib-devel \ -- cgit v1.2.3 From b1e74aee43596e2601248b0a78b2c54c897ce78b Mon Sep 17 00:00:00 2001 From: Michael Kaylan <1063516+kaylanm@users.noreply.github.com> Date: Mon, 12 Nov 2018 11:20:56 -0500 Subject: Make sure that avr-gcc@7 gets linked into the path on MacOS. --- docs/faq_build.md | 2 +- docs/getting_started_build_tools.md | 1 + util/macos_install.sh | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/faq_build.md b/docs/faq_build.md index 465a283aef..14c61a1e99 100644 --- a/docs/faq_build.md +++ b/docs/faq_build.md @@ -126,5 +126,5 @@ For now, you need to rollback avr-gcc to 7 in brew. ``` brew uninstall --force avr-gcc brew install avr-gcc@7 -brew link avr-gcc@7 +brew link --force avr-gcc@7 ``` diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 587dece4a1..67bbe54344 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -57,6 +57,7 @@ If you're using [homebrew,](http://brew.sh/) you can use the following commands: brew tap PX4/homebrew-px4 brew update brew install avr-gcc@7 + brew link --force avr-gcc@7 brew install dfu-programmer brew install dfu-util brew install gcc-arm-none-eabi diff --git a/util/macos_install.sh b/util/macos_install.sh index c31be99d22..d2629a8cb4 100755 --- a/util/macos_install.sh +++ b/util/macos_install.sh @@ -23,3 +23,4 @@ brew tap osx-cross/avr brew tap PX4/homebrew-px4 brew update brew install avr-gcc@7 gcc-arm-none-eabi dfu-programmer avrdude dfu-util +brew link --force avr-gcc@7 -- cgit v1.2.3 From aa03049015855cdd5f61e6e8a7c6955abc5d3141 Mon Sep 17 00:00:00 2001 From: comaid <44457151+comaid@users.noreply.github.com> Date: Tue, 13 Nov 2018 05:19:29 +0900 Subject: Fix up screen off timer of crkbd (#4346) * fix about screen off timer * Fix Up ScreenOffInterval exceeded uint16_t * Fix Up never waking up once screen off if in case of matrix are not dirty. * Revert "fix about screen off timer" This reverts commit 3d175f2340c14250a71af78afec5a1e890d9f4e7. * Fix up screen off timer of crkbd * Fix Up ScreenOffInterval exceeded uint16_t * Fix Up never waking up once screen off if in case of matrix are not dirty. * Fix up screen off timer of helix * Fix Up ScreenOffInterval exceeded uint16_t * Fix Up never waking up once screen off if in case of matrix are not dirty * Revert "Fix up screen off timer of helix" This reverts commit f0efb82443a7dc34b75579359b0514e8bfa51100. * Improve internal processing of process_record_kb() * Use the return value of process_record_gfx() * Fix a indent Fix a indent --- keyboards/crkbd/crkbd.c | 5 +++++ keyboards/crkbd/ssd1306.c | 16 ++++++++++++++-- keyboards/crkbd/ssd1306.h | 3 +++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/keyboards/crkbd/crkbd.c b/keyboards/crkbd/crkbd.c index 5e8ba8bacf..32f7af776e 100644 --- a/keyboards/crkbd/crkbd.c +++ b/keyboards/crkbd/crkbd.c @@ -1 +1,6 @@ #include "crkbd.h" +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} \ No newline at end of file diff --git a/keyboards/crkbd/ssd1306.c b/keyboards/crkbd/ssd1306.c index 205ce67a9e..4330c8497d 100644 --- a/keyboards/crkbd/ssd1306.c +++ b/keyboards/crkbd/ssd1306.c @@ -24,12 +24,17 @@ static const unsigned char font[] PROGMEM; //static uint16_t last_battery_update; //static uint32_t vbat; //#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; #endif static uint16_t last_flush; +static bool force_dirty = true; + // Write command sequence. // Returns true on success. static inline bool _send_cmd1(uint8_t cmd) { @@ -321,12 +326,19 @@ void iota_gfx_task_user(void) { void iota_gfx_task(void) { iota_gfx_task_user(); - if (display.dirty) { + if (display.dirty|| force_dirty) { iota_gfx_flush(); + force_dirty = false; } if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } } + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + #endif diff --git a/keyboards/crkbd/ssd1306.h b/keyboards/crkbd/ssd1306.h index 76dd6a2a72..ea8c923280 100644 --- a/keyboards/crkbd/ssd1306.h +++ b/keyboards/crkbd/ssd1306.h @@ -3,6 +3,7 @@ #include #include #include "pincontrol.h" +#include "action.h" enum ssd1306_cmds { DisplayOff = 0xAE, @@ -86,3 +87,5 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file -- cgit v1.2.3 From 2b7decbaeb020c5320ada182552e633deec77ff7 Mon Sep 17 00:00:00 2001 From: comaid <44457151+comaid@users.noreply.github.com> Date: Tue, 13 Nov 2018 05:20:50 +0900 Subject: Fix up screen off timer of helix (#4347) * Fix up screen off timer of helix * Fix Up ScreenOffInterval exceeded uint16_t * Fix Up never waking up once screen off if in case of matrix are not dirty * Changing referenIng incorrect constant name * OLED_ENABLED => SSD1306OLED * Improve internal processing of process_record_kb() * Use the return value of process_record_gfx() * Move a include statement into #ifdef block Move #include "ssd1306.h` statement into #ifdef block * Move process_record_kbI() Move process_record_kb() from helix.c to rev1.c/rev2.c/pico.c * Move process_record_kb() --- keyboards/helix/pico/pico.c | 6 ++++++ keyboards/helix/rev1/rev1.c | 6 ++++++ keyboards/helix/rev2/rev2.c | 6 ++++++ keyboards/helix/ssd1306.c | 17 +++++++++++++++-- keyboards/helix/ssd1306.h | 3 ++- 5 files changed, 35 insertions(+), 3 deletions(-) diff --git a/keyboards/helix/pico/pico.c b/keyboards/helix/pico/pico.c index 5e248ccffe..bb8ba9ca2b 100644 --- a/keyboards/helix/pico/pico.c +++ b/keyboards/helix/pico/pico.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here //led_set_user(usb_led); diff --git a/keyboards/helix/rev1/rev1.c b/keyboards/helix/rev1/rev1.c index d7ea9b7235..309cca010f 100644 --- a/keyboards/helix/rev1/rev1.c +++ b/keyboards/helix/rev1/rev1.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here led_set_user(usb_led); diff --git a/keyboards/helix/rev2/rev2.c b/keyboards/helix/rev2/rev2.c index 75765f1d35..abaa02cdb1 100644 --- a/keyboards/helix/rev2/rev2.c +++ b/keyboards/helix/rev2/rev2.c @@ -2,6 +2,12 @@ #ifdef SSD1306OLED +#include "ssd1306.h" + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +} + void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here //led_set_user(usb_led); diff --git a/keyboards/helix/ssd1306.c b/keyboards/helix/ssd1306.c index b3e55a67c2..dd3290ba0c 100644 --- a/keyboards/helix/ssd1306.c +++ b/keyboards/helix/ssd1306.c @@ -1,3 +1,4 @@ + #ifdef SSD1306OLED #include "ssd1306.h" @@ -27,12 +28,17 @@ //static uint16_t last_battery_update; //static uint32_t vbat; //#define BatteryUpdateInterval 10000 /* milliseconds */ -#define ScreenOffInterval 300000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ #if DEBUG_TO_SCREEN static uint8_t displaying; #endif static uint16_t last_flush; +static bool force_dirty = true; + // Write command sequence. // Returns true on success. static inline bool _send_cmd1(uint8_t cmd) { @@ -318,12 +324,19 @@ void iota_gfx_task_user(void) { void iota_gfx_task(void) { iota_gfx_task_user(); - if (display.dirty) { + if (display.dirty|| force_dirty) { iota_gfx_flush(); + force_dirty = false; } if (timer_elapsed(last_flush) > ScreenOffInterval) { iota_gfx_off(); } } + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + #endif diff --git a/keyboards/helix/ssd1306.h b/keyboards/helix/ssd1306.h index 77ce7c211a..9cf6983b7e 100644 --- a/keyboards/helix/ssd1306.h +++ b/keyboards/helix/ssd1306.h @@ -4,6 +4,7 @@ #include #include #include "pincontrol.h" +#include "action.h" enum ssd1306_cmds { DisplayOff = 0xAE, @@ -87,6 +88,6 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data); void matrix_write_P(struct CharacterMatrix *matrix, const char *data); void matrix_render(struct CharacterMatrix *matrix); - +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); #endif -- cgit v1.2.3 From d0f8e1babee406af6c17759200173109705a35e3 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Thu, 25 Oct 2018 02:03:29 +0900 Subject: modify quantum/template/avr/config.h: add rgblight effect configurations --- quantum/template/avr/config.h | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 56395f376f..463ddff2db 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -54,11 +54,24 @@ along with this program. If not, see . // #define RGB_DI_PIN E2 // #ifdef RGB_DI_PIN -// #define RGBLIGHT_ANIMATIONS -// #define RGBLED_NUM 16 -// #define RGBLIGHT_HUE_STEP 8 -// #define RGBLIGHT_SAT_STEP 8 -// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLED_NUM 16 +// #define RGBLIGHT_HUE_STEP 8 +// #define RGBLIGHT_SAT_STEP 8 +// #define RGBLIGHT_VAL_STEP 8 +// #define RGBLIGHT_LIMIT_VAL 255 /* The maximum brightness level */ +// #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +// /*== all animations enable ==*/ +// #define RGBLIGHT_ANIMATIONS +// /*== or choose animations ==*/ +// #define RGBLIGHT_EFFECT_BREATHING +// #define RGBLIGHT_EFFECT_RAINBOW_MOOD +// #define RGBLIGHT_EFFECT_RAINBOW_SWIRL +// #define RGBLIGHT_EFFECT_SNAKE +// #define RGBLIGHT_EFFECT_KNIGHT +// #define RGBLIGHT_EFFECT_CHRISTMAS +// #define RGBLIGHT_EFFECT_STATIC_GRADIENT +// #define RGBLIGHT_EFFECT_RGB_TEST +// #define RGBLIGHT_EFFECT_ALTERNATING // #endif /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -- cgit v1.2.3 From 2b3473455cb366888cdb62e8e570d24444173a01 Mon Sep 17 00:00:00 2001 From: Junya Ogura Date: Thu, 8 Nov 2018 02:58:51 +0900 Subject: Change hex file permission to 644 from 755 --- util/bootloader_atmega32u4_1_0_0.hex | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 util/bootloader_atmega32u4_1_0_0.hex diff --git a/util/bootloader_atmega32u4_1_0_0.hex b/util/bootloader_atmega32u4_1_0_0.hex old mode 100755 new mode 100644 -- cgit v1.2.3 From 599b21b9f4b450392380870675b136449839f6e5 Mon Sep 17 00:00:00 2001 From: QMK Bot Date: Mon, 12 Nov 2018 20:51:24 +0000 Subject: convert to unix line-endings [skip ci] --- util/bootloader_atmega32u4_1_0_0.hex | 506 +++++++++++++++++------------------ 1 file changed, 253 insertions(+), 253 deletions(-) diff --git a/util/bootloader_atmega32u4_1_0_0.hex b/util/bootloader_atmega32u4_1_0_0.hex index 275aeacba3..20174989ae 100644 --- a/util/bootloader_atmega32u4_1_0_0.hex +++ b/util/bootloader_atmega32u4_1_0_0.hex @@ -1,253 +1,253 @@ -:020000020000FC -:047000000C948D3E21 -:047028000C94B73DD0 -:10702F0012010002FF010020EB03F42F0000010208 -:10703F00030109021200010100803209040000005F -:10704F00000000000C03410054004D0045004C00AF -:10705F001603410054006D00330032005500340018 -:10706F004400460055000C0331002E0030002E0066 -:10707F0030000403090416010C0100000C0000018C -:02708F006C7F14 -:1070920012BD01BDF89A00B5089501E00895F9996D -:1070A200FECF12BD01BD20BDFA9AF99AF6CFF99929 -:1070B200FECF0C944938F80104910895F8013491F7 -:1070C20031962491890108950091610000930C0189 -:1070D20000E80093610001E00093610005BF02E057 -:1070E20005BF0C9486380091D70001600093D70049 -:1070F200A89507EF04BF0091600000610093600053 -:1071020000E00093600001E008950E94AA3D0E9401 -:10711200B53DFDCF0CD00F7708D0006806D00061D6 -:1071220004D0016028D0789408950093D80000918B -:10713200D8000895FCDF00621ED04CD009B500FFD4 -:10714200FDCFF5DF0F7D17D00091E0000E7F009399 -:10715200E0000091E000077F0093E0000091E20070 -:1071620001600093E2000091E20008600093E200F7 -:1071720078940C94743B0093D800089500910D010B -:10718200002359F40091D90000FF07C0D0DF006846 -:10719200F2DF01E000930D01CDDFE0E2F2E00081D9 -:1071A200018100FF0DC0008111811E7F11830083C8 -:1071B20001E00093EA0000E00093EA0000931E025F -:1071C20000E00093E9000091E80003FF02C00E9482 -:1071D200F23B0895A89539D000E40093600000E0E6 -:1071E200009381000093800010E0009385000093DB -:1071F200840001E006BB00918100036000938100DE -:107202000091600007FFFCCF00E80093600010933C -:107212008100A89507EF04BF18D010936000209159 -:1072220084003091850010938100109380001093A8 -:1072320085001093840001E006BB2D3D354010F01F -:1072420002E101C002E009BD089500916000006101 -:107252000093600008950E94AD3E239741D100E063 -:1072620000930901B5D104811581012B51F437D165 -:1072720000910701002309F4B9C000E0009307015F -:10728200B5C058D102FFFDCF37D1068335D1009367 -:107292000F0132D1009310012FD1009311012CD193 -:1072A2000093120129D10093130102852091130149 -:1072B20030911201409111015091100116811A95DD -:1072C20041F01250A9F01A9599F11A9509F473C078 -:1072D2008BC010910F01113011F411E001C010E0C8 -:1072E200138799D00C3F11F414D17FC077D17DC0A0 -:1072F20092D010910F01112329F01A9549F01A9595 -:10730200A9F073C010E013870C3F09F06EC0ECCFF8 -:1073120056D103C04CD109F468C00D911C9144D1DF -:107322000F3FC1F305E0009309015FC011E0EBCF0D -:10733200D2D029F00250E1F10A9541F056C0FDD0B9 -:107342000E94A33F0FEF00930A014FC0552319F08B -:107352005A9579F04AC04ED00DEF04BF74D0EAD0EE -:1073620003FFFDCF67D051D04AD008E00093600000 -:10737200FFCF40D068D0DED003FFFDCF5BD03FD03F -:1073820044D00FEF1FE004C009811A810150104060 -:1073920009831A8309811A81012BB1F700E800934E -:1073A200610000910C01009361000C940000FFCF7A -:1073B20001E003871AC08FD019F00A9539F015C081 -:1073C200535098F4BAD002E000870FC0505339F0FE -:1073D2005A9541F05F52B1F35A95A1F306C002E00B -:1073E2000883F0CF01E0FCCFA8D079D02396E4E067 -:1073F2000C94BA3E01E005BF00E005BF089500917C -:10740200D8000F770093D800089509B50D7F09BD04 -:1074120000E009BD08955183408333832283109194 -:10742200E8001B7F1093E8001091E8001F7710938B -:10743200E80008955DD053D0F8940091E000016017 -:107442000093E000089579D04AC0219749D0009175 -:107452000601035019F00250B9F00BC03CD021F0E4 -:107462000A9559F00A9529F400910A010C3F19F482 -:1074720050D02196089567D0FCCF0091010100936E -:10748200F100009100010AC01091100124D019F0FE -:107492000A9549F0EECF135018F400E00093F10082 -:1074A2001ED044D0E6CF105339F01A9539F01F524E -:1074B20041F01A9541F0F4CF08E5F0CF00E006D094 -:1074C200EDCF02E0FCCF04E001D0E8CF10E020E0F5 -:1074D20030E00C94113F00910F010023089521C068 -:1074E2000BD008D007D00093040106D00093050109 -:1074F20021D00BC000D008830091F10008950091C3 -:10750200EB0000620093EB0015D0077F0093E800C8 -:107512000895F5DF02E00093080103E000930901FA -:10752200089559D007D000FFFDCF089503D002FF80 -:10753200FDCF03C00091E8000895FCDF0B7FE6DF7A -:10754200F9DF0F77E3CF0E94AC3E42D038D006C0BD -:107552002BD00093F1002BD059F43DD0082F092BEA -:10756200A9F0E8DF02FD12C0E5DF00FFFDCF4424F1 -:10757200042D4394003289F300910B0100230D91F5 -:107582001C9131F311970E945838E3CFD3DF00FFEB -:10759200FDCF21D0CFDF00FFFDCFCCDF02FFFDCF3B -:1075A200CCDFE5E00C94B93E11970C945C380D9158 -:1075B2001C910F5F1F4F1C930E93019708958281B8 -:1075C200938100811181801B910B0196DF01089547 -:1075D200E0E0F1E00895AEDF0E7F98CF0E94A93E71 -:1075E200F7DF80819181A081B181AF710481158122 -:1075F20000521040048315830AC000910B0100233E -:1076020031F4A301920103E911E00E943B3F47D00C -:10761200B8F1662477242C0111C06EDFF301ED5618 -:10762200FE4F008301E0600E00E0701E01960091A3 -:10763200F200002311F033D0B8F47FDF30D0E8F24B -:10764200F301B096E238F040C0F674DF02FFFDCFDE -:107652000091F200BDDF24813581201B304024835C -:107662003583E5CF49DFAA95AA23E1F700910B0103 -:10767200013099F62091F1008C010E945038D6CF4A -:1076820004811581012B21F055DF02FFFDCF55DF6B -:10769200A2DF50DF00FFFDCFE8E00C94B63EE0E051 -:1076A200F1E0028113810817190708952091EB0078 -:1076B20021602093EB000093EC000091ED0002703A -:1076C200012B0093ED000091ED0002600093ED00AC -:1076D2001091EE00012F000F00E0001F0895412FCE -:1076E2000093E900089500E009D000FD05C000E024 -:1076F200F7DF10E202E0DACF00E00895F1DF009157 -:10770200EB0008950F770132A9F5112369F11A955B -:1077120059F01A9561F01A9569F01A95F9F01A95CF -:10772200C1F01A95D9F024C00E942C3920C00E94C1 -:10773200263A1DC029D00091090123D001E01FD0B3 -:1077420020D0009108011BD00E94923A0E94973AE1 -:107752000EC01AD00091080114D007C002E00093B5 -:10776200080100E0009309010FD00E94923A03C081 -:107772000E94803A02C001E0089500E0089501D01D -:1077820000E00093F10008950091E800077F009364 -:10779200E800089508950350F9F4112339F01A9579 -:1077A20051F01A9581F01A9599F016C004E016D09E -:1077B20001E810E703C011D003E510E7E7E1F2E0CA -:1077C20000831183D8CF06E109D00FE510E7F6CF89 -:1077D20004D005E710E7F2CFD0CF0CE000931A02F5 -:1077E200089527D120D100931D02E1D0212F11232A -:1077F20029F12A95E9F02250F1F0225099F02A95C8 -:1078020049F0225061F02A9581F02A95E1F02A95FB -:10781200E9F023C0003809F44FC00C94833B0038D0 -:10782200E1F7C8C00023C9F71EC00023B1F72DC07D -:10783200033098F744C1033080F70BC1003868F376 -:10784200033858F7C9C0013841F77BC1013051F400 -:10785200FCD0BFD000FD06C0FCCF0E94833B0023BA -:1078620009F41ED008951091E3001078DCD00F7750 -:10787200012B0093E300E9D0ACD000FFFDCF0091D3 -:10788200E30000680093E300089591D0123040F4C1 -:107892000FD010931E02DAD000911E020C94CB3B43 -:1078A2000091EB0001D004C000620093EB00089548 -:1078B2000091E800077FC0C0BA93AA93229700E024 -:1078C2000093190274D0AFD0202F2A9519F02A956F -:1078D200E9F022C002E100931A020FE210E7E7E1A9 -:1078E200F2E0008311839DD008839DD00983E0DFFD -:1078F20000911A0210E02881398102171307A8F4B7 -:107902000F7181F401E00093190211C002E10093AA -:107912001A0201E410E7E3CF0E94CC3B002319F7DF -:107922008ED040C01093190202C020931A027ED05A -:10793200A7E1B2E001C08AD000911A02002309F146 -:1079420048D004FD1EC045D000FD03C042D004FF54 -:10795200FACF10E0012F1395003281F0ED91FC91E6 -:107962001197049133D02D913C912F5F3F4F3C935F -:107972002E93FD0103810A95038361F72AD004FF48 -:10798200DACF00911902013039F423D004FD04C08A -:1079920020D000FFFDCF5AD01CD004FFFDCF46D02F -:1079A20018D00B7F49D02296A991B99108951091D0 -:1079B200F10008957DDF00911E0208D047D009D062 -:1079C2000F773AD006D002FFFDCFBFC00093F1007F -:1079D20008950091E800089524D010911D021058D6 -:1079E20029F01A9589F01A9591F019C061DF00917A -:1079F2001C02ECDF00E0EADF29D0EBDF02FFFDCF63 -:107A020018D0E7DF0F770CC053DF00E0F2CF51D080 -:107A12000F7710E0F801E55EFD4F0081EACF0FD04D -:107A22000BC001D000D00091F1000895D2DF0F7E8B -:107A320003C00091E8000B7F0093E80008950091D5 -:107A4200EB0032DFC6DF077F089532DFC2DF0E7F31 -:107A5200F3CF00911D02002329F00A9509F10A953E -:107A620031F01EC0E0DF0A9561D0D9F41AC061D0AE -:107A7200B9F4D9DF0F7711F416D01BD00093E900C7 -:107A82001091EB0010FF0BC00ED010E01093E90034 -:107A920021E0F801E55EFD4F20834FD003C042D0C4 -:107AA20045D0CFDFC9CF1091EB0010621093EB00ED -:107AB20008951091E800177F1093E800089500914F -:107AC2001D02002311F4AFDF02C0013011F4B7DF51 -:107AD200B3CF023031F52DD019F52091F1002F7777 -:107AE2002093E90023D000FF19C081F01FD000616C -:107AF200DCDE01E010E0422F0E949F3E0093EA008C -:107B020000E00093EA0012D00860CFDE0BD030E034 -:107B1200F901E55EFD4F008310D0DACF03D0D7CF55 -:107B2200BFDE089500E00093E90008950091EB00A4 -:107B3200089579DF3CDF00230895BADE4ADF0E7F25 -:107B4200089583DF46DF02FFFDCF73DF42DF0F7749 -:107B520073CF0091D70001600093D7000E948B3849 -:107B620000E000931F0208950C94BF388A93FA93A1 -:107B7200EA933A922A921A920A927A936A935A93BF -:107B82004A933A932A931A930A938FB70091DA0091 -:107B920000FF24C00091D80000FF20C00EEF009328 -:107BA200DA000091D90000FF11C001E000930D013D -:107BB200ABD0026096D09AD00860A2D00E949B38C7 -:107BC2000091E0000E7F0093E00008C000E0009307 -:107BD2000D0100931E0298D0046083D07FD002FF73 -:107BE20005C084D002FF02C00BEF75D077D000FF32 -:107BF2001BC07CD000FF18C001E000930E016AD0C8 -:107C020083D000626ED00EEF6FD0006179D06ED05B -:107C12000F7D76D00091D80000620093D80009B59C -:107C22000D7F09BD00E009BD59D004FF20C05ED020 -:107C320004FF1DC009B500FD05C00E94EB3809B55F -:107C420000FFFDCF0091D8000F7D0093D80042D0F5 -:107C520000910E01002359F04CD00FEE45D00F7E5B -:107C620052D000643ED042D001604AD042D036D0D9 -:107C720005FF0FC03BD005FF0CC000E000930E01D2 -:107C820035D00F7E3DD00FED2FD00F7D3CD0006858 -:107C920028D024D003FF0DC029D003FF0AC000E082 -:107CA20000931F0207EF17D00E94743B2DD0116082 -:107CB20018D08FBF09911991299139914991599100 -:107CC200699179910990199029903990E991F991E6 -:107CD200899118950FEE0093E10008950091E1005B -:107CE20008951183008308950093E1000091E2005A -:107CF20008950091E200006203D00091E200086062 -:107D02000093E2000895FCDFE0E2F2E000811181DD -:107D1200089500008895FECF01E60DBF02E00EBF78 -:107D2200C2EED2E00E947438002311F00E94D33ECA -:107D32000E9465380E948A3E0C948A3E4A951AF047 -:107D4200000F111FFBCF0895BA92AA929A928A92BB -:107D52007A926A925A924A92BA93AA939A938A937D -:107D62000895BB84AA84998488847F806E805D8014 -:107D72004C80BB81AA8199818881F0E00FB6F8948A -:107D8200CE0FDF1F0FBE089520E006D0E9F7089559 -:107D9200259102D0E9F708952D9301501040202F2C -:107DA200212B089585E890E7FC0105911491FC01CF -:107DB2003296A591B491FC01349625913491422FCB -:107DC200432B19F0F901E4DF01C0DEDF069610E76C -:107DD2008139910748F308952F930CD02F9101D048 -:107DE20008953CD0F12FE02F45E047BFE89536D00B -:107DF20012D0089533D0F12FE02F43E047BFE8952A -:107E02002DD008952BD0F12FE02F43E047BFE89506 -:107E120025D001D0089522D041E147BFE8951EC088 -:107E22001DD0F12FE02F41E247BFC895002D16C0AB -:107E320015D0F12FE02F49E047BFC895002D0EC0A5 -:107E4200F32FE22F012E102E41E047BFE89506C026 -:107E520005D0002E29E027BFE89500C0022E27B7E3 -:107E620020FDFCCF202D0895022E27B726FDFCCF42 -:107E7200202D08950E94A53E22974801C901DA01EA -:107E820010C05BD001E0A00E00E0B01E00E4A0161E -:107E920000E0B00608F440C0830120E030E00E9418 -:107EA200F23E0A2F0B2B09F440C0082F0F7710E087 -:107EB2002C01401A510A320100E4A02E03C00A2FFD -:107EC2000B2BE1F04816590680F0F40101914F01A5 -:107ED2000983119729F001914F010883119711C06D -:107EE200F2013196049108830CC0F20104910983D6 -:107EF2003196E817F907A1F7F401EDCF1BD00883FB -:107F020019839201088119810E94213F16D0AA94F7 -:107F1200B1F62301AA24BB240DD0312F0F3F3F4FCE -:107F220009F4AFCF83011DD0B7CF01E02296ECE078 -:107F32000C94B23E82010C945F3802E0400E00E0E5 -:107F4200501E08959A938A9380E090E08C0109D0A4 -:107F520080589F4F8F3F0FE69007C0F38991999108 -:107F6200089520E030E00C94FB3E00000000000089 -:067F720000000000FC000D -:107FE4000C94ED3E0C94113F0C94193F0C94213FDA -:0C7FF4000C94F23E0C94033F0C94293FC7 -:040000030000700089 -:00000001FF +:020000020000FC +:047000000C948D3E21 +:047028000C94B73DD0 +:10702F0012010002FF010020EB03F42F0000010208 +:10703F00030109021200010100803209040000005F +:10704F00000000000C03410054004D0045004C00AF +:10705F001603410054006D00330032005500340018 +:10706F004400460055000C0331002E0030002E0066 +:10707F0030000403090416010C0100000C0000018C +:02708F006C7F14 +:1070920012BD01BDF89A00B5089501E00895F9996D +:1070A200FECF12BD01BD20BDFA9AF99AF6CFF99929 +:1070B200FECF0C944938F80104910895F8013491F7 +:1070C20031962491890108950091610000930C0189 +:1070D20000E80093610001E00093610005BF02E057 +:1070E20005BF0C9486380091D70001600093D70049 +:1070F200A89507EF04BF0091600000610093600053 +:1071020000E00093600001E008950E94AA3D0E9401 +:10711200B53DFDCF0CD00F7708D0006806D00061D6 +:1071220004D0016028D0789408950093D80000918B +:10713200D8000895FCDF00621ED04CD009B500FFD4 +:10714200FDCFF5DF0F7D17D00091E0000E7F009399 +:10715200E0000091E000077F0093E0000091E20070 +:1071620001600093E2000091E20008600093E200F7 +:1071720078940C94743B0093D800089500910D010B +:10718200002359F40091D90000FF07C0D0DF006846 +:10719200F2DF01E000930D01CDDFE0E2F2E00081D9 +:1071A200018100FF0DC0008111811E7F11830083C8 +:1071B20001E00093EA0000E00093EA0000931E025F +:1071C20000E00093E9000091E80003FF02C00E9482 +:1071D200F23B0895A89539D000E40093600000E0E6 +:1071E200009381000093800010E0009385000093DB +:1071F200840001E006BB00918100036000938100DE +:107202000091600007FFFCCF00E80093600010933C +:107212008100A89507EF04BF18D010936000209159 +:1072220084003091850010938100109380001093A8 +:1072320085001093840001E006BB2D3D354010F01F +:1072420002E101C002E009BD089500916000006101 +:107252000093600008950E94AD3E239741D100E063 +:1072620000930901B5D104811581012B51F437D165 +:1072720000910701002309F4B9C000E0009307015F +:10728200B5C058D102FFFDCF37D1068335D1009367 +:107292000F0132D1009310012FD1009311012CD193 +:1072A2000093120129D10093130102852091130149 +:1072B20030911201409111015091100116811A95DD +:1072C20041F01250A9F01A9599F11A9509F473C078 +:1072D2008BC010910F01113011F411E001C010E0C8 +:1072E200138799D00C3F11F414D17FC077D17DC0A0 +:1072F20092D010910F01112329F01A9549F01A9595 +:10730200A9F073C010E013870C3F09F06EC0ECCFF8 +:1073120056D103C04CD109F468C00D911C9144D1DF +:107322000F3FC1F305E0009309015FC011E0EBCF0D +:10733200D2D029F00250E1F10A9541F056C0FDD0B9 +:107342000E94A33F0FEF00930A014FC0552319F08B +:107352005A9579F04AC04ED00DEF04BF74D0EAD0EE +:1073620003FFFDCF67D051D04AD008E00093600000 +:10737200FFCF40D068D0DED003FFFDCF5BD03FD03F +:1073820044D00FEF1FE004C009811A810150104060 +:1073920009831A8309811A81012BB1F700E800934E +:1073A200610000910C01009361000C940000FFCF7A +:1073B20001E003871AC08FD019F00A9539F015C081 +:1073C200535098F4BAD002E000870FC0505339F0FE +:1073D2005A9541F05F52B1F35A95A1F306C002E00B +:1073E2000883F0CF01E0FCCFA8D079D02396E4E067 +:1073F2000C94BA3E01E005BF00E005BF089500917C +:10740200D8000F770093D800089509B50D7F09BD04 +:1074120000E009BD08955183408333832283109194 +:10742200E8001B7F1093E8001091E8001F7710938B +:10743200E80008955DD053D0F8940091E000016017 +:107442000093E000089579D04AC0219749D0009175 +:107452000601035019F00250B9F00BC03CD021F0E4 +:107462000A9559F00A9529F400910A010C3F19F482 +:1074720050D02196089567D0FCCF0091010100936E +:10748200F100009100010AC01091100124D019F0FE +:107492000A9549F0EECF135018F400E00093F10082 +:1074A2001ED044D0E6CF105339F01A9539F01F524E +:1074B20041F01A9541F0F4CF08E5F0CF00E006D094 +:1074C200EDCF02E0FCCF04E001D0E8CF10E020E0F5 +:1074D20030E00C94113F00910F010023089521C068 +:1074E2000BD008D007D00093040106D00093050109 +:1074F20021D00BC000D008830091F10008950091C3 +:10750200EB0000620093EB0015D0077F0093E800C8 +:107512000895F5DF02E00093080103E000930901FA +:10752200089559D007D000FFFDCF089503D002FF80 +:10753200FDCF03C00091E8000895FCDF0B7FE6DF7A +:10754200F9DF0F77E3CF0E94AC3E42D038D006C0BD +:107552002BD00093F1002BD059F43DD0082F092BEA +:10756200A9F0E8DF02FD12C0E5DF00FFFDCF4424F1 +:10757200042D4394003289F300910B0100230D91F5 +:107582001C9131F311970E945838E3CFD3DF00FFEB +:10759200FDCF21D0CFDF00FFFDCFCCDF02FFFDCF3B +:1075A200CCDFE5E00C94B93E11970C945C380D9158 +:1075B2001C910F5F1F4F1C930E93019708958281B8 +:1075C200938100811181801B910B0196DF01089547 +:1075D200E0E0F1E00895AEDF0E7F98CF0E94A93E71 +:1075E200F7DF80819181A081B181AF710481158122 +:1075F20000521040048315830AC000910B0100233E +:1076020031F4A301920103E911E00E943B3F47D00C +:10761200B8F1662477242C0111C06EDFF301ED5618 +:10762200FE4F008301E0600E00E0701E01960091A3 +:10763200F200002311F033D0B8F47FDF30D0E8F24B +:10764200F301B096E238F040C0F674DF02FFFDCFDE +:107652000091F200BDDF24813581201B304024835C +:107662003583E5CF49DFAA95AA23E1F700910B0103 +:10767200013099F62091F1008C010E945038D6CF4A +:1076820004811581012B21F055DF02FFFDCF55DF6B +:10769200A2DF50DF00FFFDCFE8E00C94B63EE0E051 +:1076A200F1E0028113810817190708952091EB0078 +:1076B20021602093EB000093EC000091ED0002703A +:1076C200012B0093ED000091ED0002600093ED00AC +:1076D2001091EE00012F000F00E0001F0895412FCE +:1076E2000093E900089500E009D000FD05C000E024 +:1076F200F7DF10E202E0DACF00E00895F1DF009157 +:10770200EB0008950F770132A9F5112369F11A955B +:1077120059F01A9561F01A9569F01A95F9F01A95CF +:10772200C1F01A95D9F024C00E942C3920C00E94C1 +:10773200263A1DC029D00091090123D001E01FD0B3 +:1077420020D0009108011BD00E94923A0E94973AE1 +:107752000EC01AD00091080114D007C002E00093B5 +:10776200080100E0009309010FD00E94923A03C081 +:107772000E94803A02C001E0089500E0089501D01D +:1077820000E00093F10008950091E800077F009364 +:10779200E800089508950350F9F4112339F01A9579 +:1077A20051F01A9581F01A9599F016C004E016D09E +:1077B20001E810E703C011D003E510E7E7E1F2E0CA +:1077C20000831183D8CF06E109D00FE510E7F6CF89 +:1077D20004D005E710E7F2CFD0CF0CE000931A02F5 +:1077E200089527D120D100931D02E1D0212F11232A +:1077F20029F12A95E9F02250F1F0225099F02A95C8 +:1078020049F0225061F02A9581F02A95E1F02A95FB +:10781200E9F023C0003809F44FC00C94833B0038D0 +:10782200E1F7C8C00023C9F71EC00023B1F72DC07D +:10783200033098F744C1033080F70BC1003868F376 +:10784200033858F7C9C0013841F77BC1013051F400 +:10785200FCD0BFD000FD06C0FCCF0E94833B0023BA +:1078620009F41ED008951091E3001078DCD00F7750 +:10787200012B0093E300E9D0ACD000FFFDCF0091D3 +:10788200E30000680093E300089591D0123040F4C1 +:107892000FD010931E02DAD000911E020C94CB3B43 +:1078A2000091EB0001D004C000620093EB00089548 +:1078B2000091E800077FC0C0BA93AA93229700E024 +:1078C2000093190274D0AFD0202F2A9519F02A956F +:1078D200E9F022C002E100931A020FE210E7E7E1A9 +:1078E200F2E0008311839DD008839DD00983E0DFFD +:1078F20000911A0210E02881398102171307A8F4B7 +:107902000F7181F401E00093190211C002E10093AA +:107912001A0201E410E7E3CF0E94CC3B002319F7DF +:107922008ED040C01093190202C020931A027ED05A +:10793200A7E1B2E001C08AD000911A02002309F146 +:1079420048D004FD1EC045D000FD03C042D004FF54 +:10795200FACF10E0012F1395003281F0ED91FC91E6 +:107962001197049133D02D913C912F5F3F4F3C935F +:107972002E93FD0103810A95038361F72AD004FF48 +:10798200DACF00911902013039F423D004FD04C08A +:1079920020D000FFFDCF5AD01CD004FFFDCF46D02F +:1079A20018D00B7F49D02296A991B99108951091D0 +:1079B200F10008957DDF00911E0208D047D009D062 +:1079C2000F773AD006D002FFFDCFBFC00093F1007F +:1079D20008950091E800089524D010911D021058D6 +:1079E20029F01A9589F01A9591F019C061DF00917A +:1079F2001C02ECDF00E0EADF29D0EBDF02FFFDCF63 +:107A020018D0E7DF0F770CC053DF00E0F2CF51D080 +:107A12000F7710E0F801E55EFD4F0081EACF0FD04D +:107A22000BC001D000D00091F1000895D2DF0F7E8B +:107A320003C00091E8000B7F0093E80008950091D5 +:107A4200EB0032DFC6DF077F089532DFC2DF0E7F31 +:107A5200F3CF00911D02002329F00A9509F10A953E +:107A620031F01EC0E0DF0A9561D0D9F41AC061D0AE +:107A7200B9F4D9DF0F7711F416D01BD00093E900C7 +:107A82001091EB0010FF0BC00ED010E01093E90034 +:107A920021E0F801E55EFD4F20834FD003C042D0C4 +:107AA20045D0CFDFC9CF1091EB0010621093EB00ED +:107AB20008951091E800177F1093E800089500914F +:107AC2001D02002311F4AFDF02C0013011F4B7DF51 +:107AD200B3CF023031F52DD019F52091F1002F7777 +:107AE2002093E90023D000FF19C081F01FD000616C +:107AF200DCDE01E010E0422F0E949F3E0093EA008C +:107B020000E00093EA0012D00860CFDE0BD030E034 +:107B1200F901E55EFD4F008310D0DACF03D0D7CF55 +:107B2200BFDE089500E00093E90008950091EB00A4 +:107B3200089579DF3CDF00230895BADE4ADF0E7F25 +:107B4200089583DF46DF02FFFDCF73DF42DF0F7749 +:107B520073CF0091D70001600093D7000E948B3849 +:107B620000E000931F0208950C94BF388A93FA93A1 +:107B7200EA933A922A921A920A927A936A935A93BF +:107B82004A933A932A931A930A938FB70091DA0091 +:107B920000FF24C00091D80000FF20C00EEF009328 +:107BA200DA000091D90000FF11C001E000930D013D +:107BB200ABD0026096D09AD00860A2D00E949B38C7 +:107BC2000091E0000E7F0093E00008C000E0009307 +:107BD2000D0100931E0298D0046083D07FD002FF73 +:107BE20005C084D002FF02C00BEF75D077D000FF32 +:107BF2001BC07CD000FF18C001E000930E016AD0C8 +:107C020083D000626ED00EEF6FD0006179D06ED05B +:107C12000F7D76D00091D80000620093D80009B59C +:107C22000D7F09BD00E009BD59D004FF20C05ED020 +:107C320004FF1DC009B500FD05C00E94EB3809B55F +:107C420000FFFDCF0091D8000F7D0093D80042D0F5 +:107C520000910E01002359F04CD00FEE45D00F7E5B +:107C620052D000643ED042D001604AD042D036D0D9 +:107C720005FF0FC03BD005FF0CC000E000930E01D2 +:107C820035D00F7E3DD00FED2FD00F7D3CD0006858 +:107C920028D024D003FF0DC029D003FF0AC000E082 +:107CA20000931F0207EF17D00E94743B2DD0116082 +:107CB20018D08FBF09911991299139914991599100 +:107CC200699179910990199029903990E991F991E6 +:107CD200899118950FEE0093E10008950091E1005B +:107CE20008951183008308950093E1000091E2005A +:107CF20008950091E200006203D00091E200086062 +:107D02000093E2000895FCDFE0E2F2E000811181DD +:107D1200089500008895FECF01E60DBF02E00EBF78 +:107D2200C2EED2E00E947438002311F00E94D33ECA +:107D32000E9465380E948A3E0C948A3E4A951AF047 +:107D4200000F111FFBCF0895BA92AA929A928A92BB +:107D52007A926A925A924A92BA93AA939A938A937D +:107D62000895BB84AA84998488847F806E805D8014 +:107D72004C80BB81AA8199818881F0E00FB6F8948A +:107D8200CE0FDF1F0FBE089520E006D0E9F7089559 +:107D9200259102D0E9F708952D9301501040202F2C +:107DA200212B089585E890E7FC0105911491FC01CF +:107DB2003296A591B491FC01349625913491422FCB +:107DC200432B19F0F901E4DF01C0DEDF069610E76C +:107DD2008139910748F308952F930CD02F9101D048 +:107DE20008953CD0F12FE02F45E047BFE89536D00B +:107DF20012D0089533D0F12FE02F43E047BFE8952A +:107E02002DD008952BD0F12FE02F43E047BFE89506 +:107E120025D001D0089522D041E147BFE8951EC088 +:107E22001DD0F12FE02F41E247BFC895002D16C0AB +:107E320015D0F12FE02F49E047BFC895002D0EC0A5 +:107E4200F32FE22F012E102E41E047BFE89506C026 +:107E520005D0002E29E027BFE89500C0022E27B7E3 +:107E620020FDFCCF202D0895022E27B726FDFCCF42 +:107E7200202D08950E94A53E22974801C901DA01EA +:107E820010C05BD001E0A00E00E0B01E00E4A0161E +:107E920000E0B00608F440C0830120E030E00E9418 +:107EA200F23E0A2F0B2B09F440C0082F0F7710E087 +:107EB2002C01401A510A320100E4A02E03C00A2FFD +:107EC2000B2BE1F04816590680F0F40101914F01A5 +:107ED2000983119729F001914F010883119711C06D +:107EE200F2013196049108830CC0F20104910983D6 +:107EF2003196E817F907A1F7F401EDCF1BD00883FB +:107F020019839201088119810E94213F16D0AA94F7 +:107F1200B1F62301AA24BB240DD0312F0F3F3F4FCE +:107F220009F4AFCF83011DD0B7CF01E02296ECE078 +:107F32000C94B23E82010C945F3802E0400E00E0E5 +:107F4200501E08959A938A9380E090E08C0109D0A4 +:107F520080589F4F8F3F0FE69007C0F38991999108 +:107F6200089520E030E00C94FB3E00000000000089 +:067F720000000000FC000D +:107FE4000C94ED3E0C94113F0C94193F0C94213FDA +:0C7FF4000C94F23E0C94033F0C94293FC7 +:040000030000700089 +:00000001FF -- cgit v1.2.3 From e653cc198e3a535f23ae33d677115f192979ee55 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Mon, 12 Nov 2018 19:31:22 -0500 Subject: The "Practice60" Board, Blue Pill powered (#4407) * Starting point for blue pill based practice60 * Changes * add * try raw bin no botloader * swap back to bootloader version * edit * Remove debug LED flash * Disable JTAG to open up B3 and B4 * Add led backlight support (no breathing yet) * Update matrix for correctness * RGB Underglow working in a very simple state * not as bright * Move to handwired * revert ChibiOS_Test changes * Changes based on PR comments * Address PR comments v2 * Move files --- .../practice60/boards/GENERIC_STM32_F103/board.c | 56 +++ .../practice60/boards/GENERIC_STM32_F103/board.h | 166 +++++++ .../practice60/boards/GENERIC_STM32_F103/board.mk | 5 + keyboards/handwired/practice60/bootloader_defs.h | 10 + keyboards/handwired/practice60/chconf.h | 524 +++++++++++++++++++++ keyboards/handwired/practice60/config.h | 74 +++ keyboards/handwired/practice60/halconf.h | 353 ++++++++++++++ keyboards/handwired/practice60/hsv2rgb.c | 80 ++++ keyboards/handwired/practice60/hsv2rgb.h | 23 + .../handwired/practice60/keymaps/default/keymap.c | 48 ++ keyboards/handwired/practice60/ld/MKL26Z64.ld | 105 +++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ++++ keyboards/handwired/practice60/led.c | 51 ++ keyboards/handwired/practice60/mcuconf.h | 209 ++++++++ keyboards/handwired/practice60/practice60.c | 32 ++ keyboards/handwired/practice60/practice60.h | 18 + keyboards/handwired/practice60/readme.md | 3 + keyboards/handwired/practice60/rules.mk | 56 +++ keyboards/handwired/practice60/underglow.c | 157 ++++++ keyboards/handwired/practice60/underglow.h | 10 + 20 files changed, 2068 insertions(+) create mode 100644 keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/handwired/practice60/bootloader_defs.h create mode 100644 keyboards/handwired/practice60/chconf.h create mode 100644 keyboards/handwired/practice60/config.h create mode 100644 keyboards/handwired/practice60/halconf.h create mode 100644 keyboards/handwired/practice60/hsv2rgb.c create mode 100644 keyboards/handwired/practice60/hsv2rgb.h create mode 100644 keyboards/handwired/practice60/keymaps/default/keymap.c create mode 100644 keyboards/handwired/practice60/ld/MKL26Z64.ld create mode 100644 keyboards/handwired/practice60/ld/STM32F103x8_stm32duino_bootloader.ld create mode 100644 keyboards/handwired/practice60/led.c create mode 100644 keyboards/handwired/practice60/mcuconf.h create mode 100644 keyboards/handwired/practice60/practice60.c create mode 100644 keyboards/handwired/practice60/practice60.h create mode 100644 keyboards/handwired/practice60/readme.md create mode 100644 keyboards/handwired/practice60/rules.mk create mode 100644 keyboards/handwired/practice60/underglow.c create mode 100644 keyboards/handwired/practice60/underglow.h diff --git a/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 0000000000..8c5a87f35f --- /dev/null +++ b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.h b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 0000000000..9427adabf1 --- /dev/null +++ b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.mk b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 0000000000..6b8b312fd9 --- /dev/null +++ b/keyboards/handwired/practice60/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/handwired/practice60/bootloader_defs.h b/keyboards/handwired/practice60/bootloader_defs.h new file mode 100644 index 0000000000..0f45203cb6 --- /dev/null +++ b/keyboards/handwired/practice60/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/handwired/practice60/chconf.h b/keyboards/handwired/practice60/chconf.h new file mode 100644 index 0000000000..dfb1f9dfb9 --- /dev/null +++ b/keyboards/handwired/practice60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 16 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 2000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/practice60/config.h b/keyboards/handwired/practice60/config.h new file mode 100644 index 0000000000..31ddd77d17 --- /dev/null +++ b/keyboards/handwired/practice60/config.h @@ -0,0 +1,74 @@ +/* +Copyright 2015 Jun Wako + +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT Practice 60 +#define DESCRIPTION Practice 60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, A4, A3, A2, A1, A0, C15, C14 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 1 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + + +/* + * 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/handwired/practice60/halconf.h b/keyboards/handwired/practice60/halconf.h new file mode 100644 index 0000000000..5fba285a38 --- /dev/null +++ b/keyboards/handwired/practice60/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/handwired/practice60/hsv2rgb.c b/keyboards/handwired/practice60/hsv2rgb.c new file mode 100644 index 0000000000..adb7af8fa5 --- /dev/null +++ b/keyboards/handwired/practice60/hsv2rgb.c @@ -0,0 +1,80 @@ +/* hsv2rgb.c + * Integer only conversion functions between HSV and RGB + */ + +#include "hsv2rgb.h" + +// TODO fix these buggy macros +#define max(x,y) ((x>y) ? x:y) +#define min(x,y) ((x>y) ? y:x) +#define min3(x,y,z) (min(min(x,y),z)) +#define max3(x,y,z) (max(max(x,y),z)) + + +rgb_color hsv2rgb(hsv_color hsv) +{ + // From : http://qscribble.blogspot.fr/2008/06/integer-conversion-from-hsl-to-rgb.html + int h = hsv.h; + int s = hsv.s; + int v = hsv.v; + rgb_color rgb = {0, 0, 0}; + + if (v == 0) + return rgb; + + // sextant = 0 .. 5 + int sextant = (h*6)/256; + // f = 0 .. 42 + int f = h - (sextant*256)/6; + + int p = (v * (256 - s))/256; + int q = (v * (256*43 - s*f))/(256*43); + int t = (v * (256*43 - s*(43-f)))/(256*43); + + // Corrige les erreurs dues aux arrondis + p = max(min(p, 255), 0); + q = max(min(q, 255), 0); + t = max(min(t, 255), 0); + + switch(sextant){ + case 0: rgb.r = v; rgb.g = t; rgb.b = p; break; + case 1: rgb.r = q; rgb.g = v; rgb.b = p; break; + case 2: rgb.r = p; rgb.g = v; rgb.b = t; break; + case 3: rgb.r = p; rgb.g = q; rgb.b = v; break; + case 4: rgb.r = t; rgb.g = p; rgb.b = v; break; + default:rgb.r = v; rgb.g = p; rgb.b = q; break; + } + return rgb; +} + + +hsv_color rgb2hsv(rgb_color rgb) +{ + // From : http://www.ruinelli.ch/rgb-to-hsv + hsv_color hsv = {0, 0, 0}; + int min, max, delta; + + min = min3(rgb.r, rgb.g, rgb.b); + max = max3(rgb.r, rgb.g, rgb.b); + + if(max==0) { + hsv.h = 0; + hsv.s = 0; + hsv.v = 0; + return hsv; + } + + hsv.v = max; + delta = max - min; + + hsv.s = (delta)*255 / max; + + if(rgb.r == max) + hsv.h = (rgb.g - rgb.b)*42/delta; // between yellow & magenta + else if(rgb.g == max) + hsv.h = 120 + (rgb.b - rgb.r)*42/delta; // between cyan & yellow + else + hsv.h = 240 + (rgb.r - rgb.g)*42/delta; // between magenta & cyan + + return hsv; +} \ No newline at end of file diff --git a/keyboards/handwired/practice60/hsv2rgb.h b/keyboards/handwired/practice60/hsv2rgb.h new file mode 100644 index 0000000000..99566c32c0 --- /dev/null +++ b/keyboards/handwired/practice60/hsv2rgb.h @@ -0,0 +1,23 @@ +/* hsv2rgb.h + * Convert Hue Saturation Value to Red Green Blue + * + * Programme de convertion d'une information HSV en RGB + */ +#ifndef HSV2RGB_H +#define HSV2RGB_H + +typedef struct { + unsigned char h; + unsigned char s; + unsigned char v; +} hsv_color; + +typedef struct { + unsigned char r; + unsigned char g; + unsigned char b; +} rgb_color; + +rgb_color hsv2rgb(hsv_color hsv); + +#endif \ No newline at end of file diff --git a/keyboards/handwired/practice60/keymaps/default/keymap.c b/keyboards/handwired/practice60/keymaps/default/keymap.c new file mode 100644 index 0000000000..e15cd22307 --- /dev/null +++ b/keyboards/handwired/practice60/keymaps/default/keymap.c @@ -0,0 +1,48 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_60_ansi( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL + ), + + [_FN1] = LAYOUT_60_ansi( + KC_GESC, 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_BSPC, \ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/keyboards/handwired/practice60/ld/MKL26Z64.ld b/keyboards/handwired/practice60/ld/MKL26Z64.ld new file mode 100644 index 0000000000..c4ca8b874c --- /dev/null +++ b/keyboards/handwired/practice60/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/practice60/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/handwired/practice60/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 0000000000..d0688ef601 --- /dev/null +++ b/keyboards/handwired/practice60/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/practice60/led.c b/keyboards/handwired/practice60/led.c new file mode 100644 index 0000000000..f15baed169 --- /dev/null +++ b/keyboards/handwired/practice60/led.c @@ -0,0 +1,51 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" +#include "backlight.h" +#include "led.h" +#include "printf.h" + +void backlight_init_ports(void) { + printf("backlight_init_ports()\n"); + #ifdef BACKLIGHT_ENABLE + palSetPadMode(GPIOA, 8, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(GPIOA, 8); + #endif +} + +void backlight_set(uint8_t level) { + printf("backlight_set(%d)\n", level); + #ifdef BACKLIGHT_ENABLE + if (level == 0) { + // Turn backlight off + palSetPad(GPIOA, 8); + } else { + // Turn backlight on + palClearPad(GPIOA, 8); + } + #endif +} + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes + +LAYOUTS = 60_ansi + +DEFAULT_FOLDER = handwired/practice60 diff --git a/keyboards/handwired/practice60/underglow.c b/keyboards/handwired/practice60/underglow.c new file mode 100644 index 0000000000..1383af1898 --- /dev/null +++ b/keyboards/handwired/practice60/underglow.c @@ -0,0 +1,157 @@ +#include "ch.h" +#include "hal.h" + +#include "hsv2rgb.h" +#include "underglow.h" + +#define BYTES_FOR_LED_BYTE 4 +#define NB_COLORS 3 +#define BYTES_FOR_LED BYTES_FOR_LED_BYTE*NB_COLORS +#define DATA_SIZE BYTES_FOR_LED*NB_LEDS +#define RESET_SIZE 200 +#define PREAMBLE_SIZE 4 + +// Define the spi your LEDs are plugged to here +#define LEDS_SPI SPID2 +// Define the number of LEDs you wish to control in your LED strip +#define NB_LEDS 8 + +#define LED_SPIRAL 1 + +static uint8_t txbuf[PREAMBLE_SIZE + DATA_SIZE + RESET_SIZE]; +static uint8_t get_protocol_eq(uint8_t data, int pos); + +/* + * This lib is meant to be used asynchronously, thus the colors contained in + * the txbuf will be sent in loop, so that the colors are always the ones you + * put in the table (the user thus have less to worry about) + * + * Since the data are sent via DMA, and the call to spiSend is a blocking one, + * the processor ressources are not used to much, if you see your program being + * too slow, simply add a: + * chThdSleepMilliseconds(x); + * after the spiSend, where you increment x untill you are satisfied with your + * program speed, another trick may be to lower this thread priority : your call + */ +static THD_WORKING_AREA(LEDS_THREAD_WA, 128); +static THD_FUNCTION(ledsThread, arg) { + (void) arg; + while(1){ + spiSend(&LEDS_SPI, PREAMBLE_SIZE + DATA_SIZE + RESET_SIZE, txbuf); + } +} + +#if LED_SPIRAL +/* + * 'Led spiral' is a simple demo in which we put all the leds to the same + * color, where this color does all the hsv circle in loop. + * If you want to launch the thread that will chage the led colors to the + * appropriate value, simply set LED_SPIRAL to 1. + */ +static THD_WORKING_AREA(HSVTRANS_WA, 128); +static THD_FUNCTION(hsv_transThread, arg){ + (void) arg; + hsv_color color = {0, 255, 127}; + while(1){ + color.h += 1; + color.h %= 256; + set_leds_color_hsv(color); + chThdSleepMilliseconds(50); + } +} +#endif + +static const SPIConfig spicfg = { + NULL, + GPIOB, + 15, + SPI_CR1_BR_1|SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us +}; + +/* + * Function used to initialize the driver. + * + * Starts by shutting off all the LEDs. + * Then gets access on the LED_SPI driver. + * May eventually launch an animation on the LEDs (e.g. a thread setting the + * txbuff values) + */ +void leds_init(void){ + for(int i = 0; i < RESET_SIZE; i++) + txbuf[DATA_SIZE+i] = 0x00; + for (int i=0; i Date: Tue, 13 Nov 2018 00:46:01 +0000 Subject: Fixed incorrect link to feature_combo.md in features.md docs file. Was linked to feature_combos.md, but _sidebar.md, _summary.md, and config_options.md all link to feature_combo.md. Assuming that it should not be pluralized. (#4411) --- docs/features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/features.md b/docs/features.md index 43d972e689..85f4cf6e00 100644 --- a/docs/features.md +++ b/docs/features.md @@ -8,7 +8,7 @@ QMK has a staggering number of features for building your keyboard. It can take * [Auto Shift](feature_auto_shift.md) - Tap for the normal key, hold slightly longer for its shifted state. * [Backlight](feature_backlight.md) - LED lighting support for your keyboard. * [Bootmagic](feature_bootmagic.md) - Adjust the behavior of your keyboard using hotkeys. -* [Combos](feature_combos.md) - Custom actions for multiple key holds. +* [Combos](feature_combo.md) - Custom actions for multiple key holds. * [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic"). * [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself. * [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave. -- cgit v1.2.3 From 9b28dc84889357b9097ece2557c926ffa12a8479 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Mon, 12 Nov 2018 21:46:34 -0800 Subject: KBDFans KBD67 Support (#4412) * initial commit for kbd67 keyboard * add in a standard matrix * get the correct matrix for layout_all * add a layout_65_ansi LAYOUT macro * get a default keymap in * add caps lock led support * fix formatting of my name in the comments * add QMK Configurator support * turn on bootmagic --- keyboards/kbd67/config.h | 240 ++++++++++++++++++++++++++++++ keyboards/kbd67/info.json | 16 ++ keyboards/kbd67/kbd67.c | 51 +++++++ keyboards/kbd67/kbd67.h | 59 ++++++++ keyboards/kbd67/keymaps/default/config.h | 19 +++ keyboards/kbd67/keymaps/default/keymap.c | 99 ++++++++++++ keyboards/kbd67/keymaps/default/readme.md | 1 + keyboards/kbd67/readme.md | 15 ++ keyboards/kbd67/rules.mk | 80 ++++++++++ 9 files changed, 580 insertions(+) create mode 100644 keyboards/kbd67/config.h create mode 100644 keyboards/kbd67/info.json create mode 100644 keyboards/kbd67/kbd67.c create mode 100644 keyboards/kbd67/kbd67.h create mode 100644 keyboards/kbd67/keymaps/default/config.h create mode 100644 keyboards/kbd67/keymaps/default/keymap.c create mode 100644 keyboards/kbd67/keymaps/default/readme.md create mode 100644 keyboards/kbd67/readme.md create mode 100644 keyboards/kbd67/rules.mk diff --git a/keyboards/kbd67/config.h b/keyboards/kbd67/config.h new file mode 100644 index 0000000000..2e3cf85c38 --- /dev/null +++ b/keyboards/kbd67/config.h @@ -0,0 +1,240 @@ +/* +Copyright 2018 MechMerlin + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER kbdfans +#define PRODUCT kbd67 +#define DESCRIPTION 65% Keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D0, D1, D2, D3, D5 } +#define MATRIX_COL_PINS { F0, F1, E6, C7, C6, B7, D4, B1, B0, B5, B4, D7, D6, B3, F4, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B6 +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +#define RGB_DI_PIN E2 +#ifdef RGB_DI_PIN + #define RGBLED_NUM 20 + #define RGBLIGHT_HUE_STEP 8 + #define RGBLIGHT_SAT_STEP 8 + #define RGBLIGHT_VAL_STEP 8 + #define RGBLIGHT_LIMIT_VAL 180 /* The maximum brightness level */ + // #define RGBLIGHT_SLEEP /* If defined, the RGB lighting will be switched off when the host goes to sleep */ +/*== all animations enable ==*/ + #define RGBLIGHT_ANIMATIONS +/*== or choose animations ==*/ + // #define RGBLIGHT_EFFECT_BREATHING + // #define RGBLIGHT_EFFECT_RAINBOW_MOOD + // #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + // #define RGBLIGHT_EFFECT_SNAKE + // #define RGBLIGHT_EFFECT_KNIGHT + // #define RGBLIGHT_EFFECT_CHRISTMAS + // #define RGBLIGHT_EFFECT_STATIC_GRADIENT + // #define RGBLIGHT_EFFECT_RGB_TEST + // #define RGBLIGHT_EFFECT_ALTERNATING +#endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/kbd67/info.json b/keyboards/kbd67/info.json new file mode 100644 index 0000000000..70a926a7f1 --- /dev/null +++ b/keyboards/kbd67/info.json @@ -0,0 +1,16 @@ +{ + "keyboard_name": "kbd67", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_all": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.25}, {"x":1.25, "y":3}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4, "w":1.25}, {"x":7.75, "y":4, "w":2.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + }, + + "LAYOUT_65_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] + } + } +} diff --git a/keyboards/kbd67/kbd67.c b/keyboards/kbd67/kbd67.c new file mode 100644 index 0000000000..5e0369673b --- /dev/null +++ b/keyboards/kbd67/kbd67.c @@ -0,0 +1,51 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#include "kbd67.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRB |= (1 << 2); + PORTB &= ~(1 << 2); + } else { + DDRB &= ~(1 << 2); + PORTB &= ~(1 << 2); + } + + led_set_user(usb_led); +} diff --git a/keyboards/kbd67/kbd67.h b/keyboards/kbd67/kbd67.h new file mode 100644 index 0000000000..4a98c66f7a --- /dev/null +++ b/keyboards/kbd67/kbd67.h @@ -0,0 +1,59 @@ +/* Copyright 2018 MechMerlin + * + * 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 . + */ +#ifndef KBD67_H +#define KBD67_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_all( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K44, K46, K48, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, K44, KC_NO, K46, KC_NO, K48, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + +#define LAYOUT_65_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, K0F, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2F, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, K3F, \ + K40, K41, K43, K46, K4A, K4B, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, KC_NO, K0E, K0F }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, K1F }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, KC_NO, K2F }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E, K3F }, \ + { K40, K41, KC_NO, K43, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E, K4F }, \ +} + +#endif diff --git a/keyboards/kbd67/keymaps/default/config.h b/keyboards/kbd67/keymaps/default/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/kbd67/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/kbd67/keymaps/default/keymap.c b/keyboards/kbd67/keymaps/default/keymap.c new file mode 100644 index 0000000000..89fa9a534d --- /dev/null +++ b/keyboards/kbd67/keymaps/default/keymap.c @@ -0,0 +1,99 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Keymap (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |CAPS | A| S| D| F| G| H| J| K| L| ;| '|Return |PgUp| + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[0] = LAYOUT_65_ansi( + KC_ESC, 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_HOME, \ + 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_PGUP, \ + KC_LCTL, 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_PGDN, \ + KC_LSFT, 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_END, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), + + /* Keymap Fn Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del |Ins | + * |----------------------------------------------------------------| + * | | |Up | | | | | | | | | | | |Hme | + * |----------------------------------------------------------------| + * | |<- |Dn | ->| | | | | | | | | |End | + * |----------------------------------------------------------------| + * | | | |Bl-|BL |BL+| |VU-|VU+|MUT| | McL|MsU|McR | + * |----------------------------------------------------------------| + * | | | | | | | |MsL|MsD|MsR | + * `----------------------------------------------------------------' + */ +[1] = LAYOUT_65_ansi( + KC_GRV, 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_DEL,KC_INS, \ + KC_CAPS,_______, KC_UP,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP,_______, _______,_______, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,_______,_______,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT, _______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______, KC_END,KC_PGDN,KC_DOWN, _______,KC_PGUP,_______, \ + _______, _______, _______, _______, _______,_______,_______,KC_HOME,KC_PGDN, KC_END), + +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/kbd67/keymaps/default/readme.md b/keyboards/kbd67/keymaps/default/readme.md new file mode 100644 index 0000000000..2cb43c5e1a --- /dev/null +++ b/keyboards/kbd67/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for kbd67 diff --git a/keyboards/kbd67/readme.md b/keyboards/kbd67/readme.md new file mode 100644 index 0000000000..734b1a63ae --- /dev/null +++ b/keyboards/kbd67/readme.md @@ -0,0 +1,15 @@ +# kbd67 + +![kbd67](imgur.com image replace me!) + +65% keyboard with blocker. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: KBD67 PCB +Hardware Availability: [KBDFans](https://kbdfans.cn/products/coming-soon-kbd67-mechanical-keyboard-diy-kit) + +Make example for this keyboard (after setting up your build environment): + + make kbd67: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/kbd67/rules.mk b/keyboards/kbd67/rules.mk new file mode 100644 index 0000000000..9d25d7b21a --- /dev/null +++ b/keyboards/kbd67/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = yes # 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 = no # 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) -- cgit v1.2.3 From 709bf386f4429687a8ec73ebd29193e5f209461b Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Tue, 13 Nov 2018 01:03:48 -0500 Subject: Update Practice60 to use MT feature and revise system ticks (#4413) * Update Practice60 to use MT feature and revise system tics * Increase system tick frequency 10,000 instead of 10,000 --- keyboards/handwired/practice60/chconf.h | 6 +++--- keyboards/handwired/practice60/keymaps/default/keymap.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/handwired/practice60/chconf.h b/keyboards/handwired/practice60/chconf.h index dfb1f9dfb9..bbd9b2da62 100644 --- a/keyboards/handwired/practice60/chconf.h +++ b/keyboards/handwired/practice60/chconf.h @@ -41,14 +41,14 @@ * @brief System time counter resolution. * @note Allowed values are 16 or 32 bits. */ -#define CH_CFG_ST_RESOLUTION 16 +#define CH_CFG_ST_RESOLUTION 32 /** * @brief System tick frequency. * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#define CH_CFG_ST_FREQUENCY 2000 +#define CH_CFG_ST_FREQUENCY 100000 /** * @brief Time delta constant for the tick-less mode. @@ -58,7 +58,7 @@ * The value one is not valid, timeouts are rounded up to * this value. */ -#define CH_CFG_ST_TIMEDELTA 2 +#define CH_CFG_ST_TIMEDELTA 0 /** @} */ diff --git a/keyboards/handwired/practice60/keymaps/default/keymap.c b/keyboards/handwired/practice60/keymaps/default/keymap.c index e15cd22307..afea72b116 100644 --- a/keyboards/handwired/practice60/keymaps/default/keymap.c +++ b/keyboards/handwired/practice60/keymaps/default/keymap.c @@ -32,7 +32,7 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_60_ansi( KC_GESC, 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_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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MT(MOD_LSFT, KC_Y), KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL -- cgit v1.2.3 From 7e87532ec261bcc30d7fa5dfc5bf6427e2d3d36e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 13 Nov 2018 08:26:55 -0800 Subject: converter/ibm_terminal Refactor and Configurator support (#4414) * IBM Terminal converter: layout macro refactor - Renamed KEYMAP to LAYOUT - Renamed KEYMAP_101 to LAYOUT_101 - minor matrix array fixes * IBM Terminal converter: default keymap refactor - Updated layout macro names - Updated to #include QMK_KEYBOARD_H - config.h updated to use #pragma once * IBM Terminal converter: priyadi keymap refactor - Updated layout macro names - Updated to #include QMK_KEYBOARD_H - Removed redundant KC_TRNS and KC_NO defines - config.h updated to use #pragma once * IBM Terminal converter: Configurator support * IBM Terminal converter: readme cleanup Updated markdown formatting. * IBM Terminal converter: readme rename Renamed file to fully lowercase. --- keyboards/converter/ibm_terminal/README.md | 40 ---- keyboards/converter/ibm_terminal/ibm_terminal.h | 10 +- keyboards/converter/ibm_terminal/info.json | 245 +++++++++++++++++++++ .../ibm_terminal/keymaps/default/config.h | 7 +- .../ibm_terminal/keymaps/default/keymap.c | 12 +- .../ibm_terminal/keymaps/priyadi/config.h | 7 +- .../ibm_terminal/keymaps/priyadi/keymap.c | 28 +-- keyboards/converter/ibm_terminal/readme.md | 39 ++++ 8 files changed, 305 insertions(+), 83 deletions(-) delete mode 100644 keyboards/converter/ibm_terminal/README.md create mode 100644 keyboards/converter/ibm_terminal/info.json create mode 100644 keyboards/converter/ibm_terminal/readme.md diff --git a/keyboards/converter/ibm_terminal/README.md b/keyboards/converter/ibm_terminal/README.md deleted file mode 100644 index dff26e0594..0000000000 --- a/keyboards/converter/ibm_terminal/README.md +++ /dev/null @@ -1,40 +0,0 @@ -Keyboard converter for IBM terminal keyboard -============================================ - -This is a port of TMK's converter/terminal_usb to QMK. - -It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy. -I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys). - -Source code: https://github.com/qmk/qmk_firmware.git -Article: http://geekhack.org/index.php?topic=27272.0 - - -CONNECTION ----------- -Keyboard ATMega32U4 ----------------------- -Data: PD2 -Clock: PD5 - -And VCC and GND, of course. See RESOURCE for keyboard connector pin assign. - - -BUILD ------ -$ git clone https://github.com/qmk/qmk_firmware.git -$ cd qmk_firmware -$ make converter/ibm_terminal:default - - -RESOURCE --------- -Soarer's Converter: http://geekhack.org/index.php?topic=17458.0 -102keys(1392595): http://geekhack.org/index.php?topic=10737.0 -122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html -KbdBabel: http://www.kbdbabel.org/ -RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png -DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png -WinAVR: http://winavr.sourceforge.net/ - -EOF diff --git a/keyboards/converter/ibm_terminal/ibm_terminal.h b/keyboards/converter/ibm_terminal/ibm_terminal.h index c6468349ca..adf048206e 100644 --- a/keyboards/converter/ibm_terminal/ibm_terminal.h +++ b/keyboards/converter/ibm_terminal/ibm_terminal.h @@ -19,7 +19,7 @@ void matrix_init_user(void); * 17| | * +---------+ */ -#define KEYMAP( \ +#define LAYOUT( \ K08,K10,K18,K20,K28,K30,K38,K40,K48,K50,K57,K5F, \ K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, \ \ @@ -45,13 +45,13 @@ void matrix_init_user(void); { K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ { K70, K71, K72, K73, K74, K75, K76, K77 }, \ { K78, K79, K7A, K7B, K7C, K7D, K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, K83, K84, KC_NO, KC_NO, KC_NO,}, \ + { KC_NO, KC_NO, KC_NO, K83, K84, KC_NO, KC_NO, KC_NO } \ } /* * IBM Terminal keyboard 1399625, 101-key */ -#define KEYMAP_101( \ +#define LAYOUT_101( \ K08, K07,K0F,K17,K1F,K27,K2F,K37,K3F,K47,K4F,K56,K5E, K57,K5F,K62, \ \ K0E,K16,K1E,K26,K25,K2E,K36,K3D,K3E,K46,K45,K4E,K55,K66, K67,K6E,K6F, K76,K77,K7E,K84, \ @@ -76,7 +76,7 @@ void matrix_init_user(void); { KC_NO, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ { K70, K71, K72, K73, K74, K75, K76, K77 }, \ { KC_NO, K79, K7A, KC_NO, K7C, K7D, K7E, KC_NO }, \ - { KC_NO, KC_NO, KC_NO, KC_NO, K84, KC_NO, KC_NO, KC_NO,}, \ + { KC_NO, KC_NO, KC_NO, KC_NO, K84, KC_NO, KC_NO, KC_NO } \ } -#endif \ No newline at end of file +#endif diff --git a/keyboards/converter/ibm_terminal/info.json b/keyboards/converter/ibm_terminal/info.json new file mode 100644 index 0000000000..f064f3c5bd --- /dev/null +++ b/keyboards/converter/ibm_terminal/info.json @@ -0,0 +1,245 @@ +{ + "keyboard_name": "Keyboard converter for IBM terminal keyboard", + "url": "", + "maintainer": "qmk", + "width": 24.75, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F13", "x":3.25, "y":0}, + {"label":"F14", "x":4.25, "y":0}, + {"label":"F15", "x":5.25, "y":0}, + {"label":"F16", "x":6.25, "y":0}, + {"label":"F17", "x":7.25, "y":0}, + {"label":"F18", "x":8.25, "y":0}, + {"label":"F19", "x":9.25, "y":0}, + {"label":"F20", "x":10.25, "y":0}, + {"label":"F21", "x":11.25, "y":0}, + {"label":"F22", "x":12.25, "y":0}, + {"label":"F23", "x":13.25, "y":0}, + {"label":"F24", "x":14.25, "y":0}, + {"label":"F1", "x":3.25, "y":1}, + {"label":"F2", "x":4.25, "y":1}, + {"label":"F3", "x":5.25, "y":1}, + {"label":"F4", "x":6.25, "y":1}, + {"label":"F5", "x":7.25, "y":1}, + {"label":"F6", "x":8.25, "y":1}, + {"label":"F7", "x":9.25, "y":1}, + {"label":"F8", "x":10.25, "y":1}, + {"label":"F9", "x":11.25, "y":1}, + {"label":"F10", "x":12.25, "y":1}, + {"label":"F11", "x":13.25, "y":1}, + {"label":"F12", "x":14.25, "y":1}, + {"label":"Print Screen", "x":0, "y":3}, + {"label":"Esc", "x":1, "y":3}, + {"label":"Esc", "x":2.25, "y":3}, + {"label":"1", "x":3.25, "y":3}, + {"label":"2", "x":4.25, "y":3}, + {"label":"3", "x":5.25, "y":3}, + {"label":"4", "x":6.25, "y":3}, + {"label":"5", "x":7.25, "y":3}, + {"label":"6", "x":8.25, "y":3}, + {"label":"7", "x":9.25, "y":3}, + {"label":"8", "x":10.25, "y":3}, + {"label":"9", "x":11.25, "y":3}, + {"label":"0", "x":12.25, "y":3}, + {"label":"-", "x":13.25, "y":3}, + {"label":"=", "x":14.25, "y":3}, + {"label":"No", "x":15.25, "y":3}, + {"label":"Back Space", "x":16.25, "y":3}, + {"label":"Insert", "x":17.5, "y":3}, + {"label":"Home", "x":18.5, "y":3}, + {"label":"Page Up", "x":19.5, "y":3}, + {"label":"Num Lock", "x":20.75, "y":3}, + {"label":"/", "x":21.75, "y":3}, + {"label":"*", "x":22.75, "y":3}, + {"label":"-", "x":23.75, "y":3}, + {"label":"Scroll Lock", "x":0, "y":4}, + {"label":"Int4", "x":1, "y":4}, + {"label":"Tab", "x":2.25, "y":4, "w":1.5}, + {"label":"Q", "x":3.75, "y":4}, + {"label":"W", "x":4.75, "y":4}, + {"label":"E", "x":5.75, "y":4}, + {"label":"R", "x":6.75, "y":4}, + {"label":"T", "x":7.75, "y":4}, + {"label":"Y", "x":8.75, "y":4}, + {"label":"U", "x":9.75, "y":4}, + {"label":"I", "x":10.75, "y":4}, + {"label":"O", "x":11.75, "y":4}, + {"label":"P", "x":12.75, "y":4}, + {"label":"[", "x":13.75, "y":4}, + {"label":"]", "x":14.75, "y":4}, + {"label":"No", "x":15.75, "y":4, "w":1.5}, + {"label":"Delete", "x":17.5, "y":4}, + {"label":"End", "x":18.5, "y":4}, + {"label":"Page Down", "x":19.5, "y":4}, + {"label":"7", "x":20.75, "y":4}, + {"label":"8", "x":21.75, "y":4}, + {"label":"9", "x":22.75, "y":4}, + {"label":"+", "x":23.75, "y":4}, + {"label":"Pause", "x":0, "y":5}, + {"label":"Int5", "x":1, "y":5}, + {"label":"Caps Lock", "x":2.25, "y":5, "w":1.75}, + {"label":"A", "x":4, "y":5}, + {"label":"S", "x":5, "y":5}, + {"label":"D", "x":6, "y":5}, + {"label":"F", "x":7, "y":5}, + {"label":"G", "x":8, "y":5}, + {"label":"H", "x":9, "y":5}, + {"label":"J", "x":10, "y":5}, + {"label":"K", "x":11, "y":5}, + {"label":"L", "x":12, "y":5}, + {"label":";", "x":13, "y":5}, + {"label":"'", "x":14, "y":5}, + {"label":"\\", "x":15, "y":5}, + {"label":"Enter", "x":16, "y":5, "w":1.25}, + {"label":"Up", "x":18.5, "y":5}, + {"label":"4", "x":20.75, "y":5}, + {"label":"5", "x":21.75, "y":5}, + {"label":"6", "x":22.75, "y":5}, + {"label":",", "x":23.75, "y":5}, + {"label":"App", "x":0, "y":6}, + {"label":"Int6", "x":1, "y":6}, + {"label":"Shift", "x":2.25, "y":6, "w":1.25}, + {"label":"ISO \\", "x":3.5, "y":6}, + {"label":"Z", "x":4.5, "y":6}, + {"label":"X", "x":5.5, "y":6}, + {"label":"C", "x":6.5, "y":6}, + {"label":"V", "x":7.5, "y":6}, + {"label":"B", "x":8.5, "y":6}, + {"label":"N", "x":9.5, "y":6}, + {"label":"M", "x":10.5, "y":6}, + {"label":",", "x":11.5, "y":6}, + {"label":".", "x":12.5, "y":6}, + {"label":"/", "x":13.5, "y":6}, + {"label":"No", "x":14.5, "y":6}, + {"label":"Shift", "x":15.5, "y":6, "w":1.75}, + {"label":"Left", "x":17.5, "y":6}, + {"label":"Int2", "x":18.5, "y":6}, + {"label":"Right", "x":19.5, "y":6}, + {"label":"1", "x":20.75, "y":6}, + {"label":"2", "x":21.75, "y":6}, + {"label":"3", "x":22.75, "y":6}, + {"label":"Enter", "x":23.75, "y":6}, + {"label":"RGUI", "x":0, "y":7}, + {"label":"lgui", "x":1, "y":7}, + {"label":"Ctrl", "x":2.25, "y":7, "w":1.5}, + {"label":"Alt", "x":4.75, "y":7, "w":1.5}, + {"label":"Space", "x":6.25, "y":7, "w":7}, + {"label":"Alt", "x":13.25, "y":7, "w":1.5}, + {"label":"Ctrl", "x":15.75, "y":7, "w":1.5}, + {"label":"Down", "x":18.5, "y":7}, + {"label":"No", "x":20.75, "y":7}, + {"label":"0", "x":21.75, "y":7}, + {"label":".", "x":22.75, "y":7}, + {"label":"No", "x":23.75, "y":7} + ] + }, + "LAYOUT_101": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":2}, + {"label":"1", "x":1, "y":2}, + {"label":"2", "x":2, "y":2}, + {"label":"3", "x":3, "y":2}, + {"label":"4", "x":4, "y":2}, + {"label":"5", "x":5, "y":2}, + {"label":"6", "x":6, "y":2}, + {"label":"7", "x":7, "y":2}, + {"label":"8", "x":8, "y":2}, + {"label":"9", "x":9, "y":2}, + {"label":"0", "x":10, "y":2}, + {"label":"-", "x":11, "y":2}, + {"label":"=", "x":12, "y":2}, + {"label":"Back Space", "x":13, "y":2, "w":2}, + {"label":"Insert", "x":15.25, "y":2}, + {"label":"Home", "x":16.25, "y":2}, + {"label":"Page Up", "x":17.25, "y":2}, + {"label":"Num Lock", "x":18.5, "y":2}, + {"label":"/", "x":19.5, "y":2}, + {"label":"*", "x":20.5, "y":2}, + {"label":"-", "x":21.5, "y":2}, + {"label":"Tab", "x":0, "y":3, "w":1.5}, + {"label":"Q", "x":1.5, "y":3}, + {"label":"W", "x":2.5, "y":3}, + {"label":"E", "x":3.5, "y":3}, + {"label":"R", "x":4.5, "y":3}, + {"label":"T", "x":5.5, "y":3}, + {"label":"Y", "x":6.5, "y":3}, + {"label":"U", "x":7.5, "y":3}, + {"label":"I", "x":8.5, "y":3}, + {"label":"O", "x":9.5, "y":3}, + {"label":"P", "x":10.5, "y":3}, + {"label":"[", "x":11.5, "y":3}, + {"label":"]", "x":12.5, "y":3}, + {"label":"\\", "x":13.5, "y":3, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3}, + {"label":"End", "x":16.25, "y":3}, + {"label":"Page Down", "x":17.25, "y":3}, + {"label":"7", "x":18.5, "y":3}, + {"label":"8", "x":19.5, "y":3}, + {"label":"9", "x":20.5, "y":3}, + {"label":"Caps Lock", "x":0, "y":4, "w":1.75}, + {"label":"A", "x":1.75, "y":4}, + {"label":"S", "x":2.75, "y":4}, + {"label":"D", "x":3.75, "y":4}, + {"label":"F", "x":4.75, "y":4}, + {"label":"G", "x":5.75, "y":4}, + {"label":"H", "x":6.75, "y":4}, + {"label":"J", "x":7.75, "y":4}, + {"label":"K", "x":8.75, "y":4}, + {"label":"L", "x":9.75, "y":4}, + {"label":";", "x":10.75, "y":4}, + {"label":"'", "x":11.75, "y":4}, + {"label":"Enter", "x":12.75, "y":4, "w":2.25}, + {"label":"4", "x":18.5, "y":4}, + {"label":"5", "x":19.5, "y":4}, + {"label":"6", "x":20.5, "y":4}, + {"label":"+", "x":21.5, "y":3, "h":2}, + {"label":"Shift", "x":0, "y":5, "w":2.25}, + {"label":"Z", "x":2.25, "y":5}, + {"label":"X", "x":3.25, "y":5}, + {"label":"C", "x":4.25, "y":5}, + {"label":"V", "x":5.25, "y":5}, + {"label":"B", "x":6.25, "y":5}, + {"label":"N", "x":7.25, "y":5}, + {"label":"M", "x":8.25, "y":5}, + {"label":",", "x":9.25, "y":5}, + {"label":".", "x":10.25, "y":5}, + {"label":"/", "x":11.25, "y":5}, + {"label":"Shift", "x":12.25, "y":5, "w":2.75}, + {"label":"Up", "x":16.25, "y":5}, + {"label":"1", "x":18.5, "y":5}, + {"label":"2", "x":19.5, "y":5}, + {"label":"3", "x":20.5, "y":5}, + {"label":"Ctrl", "x":0, "y":6, "w":1.5}, + {"label":"Alt", "x":2.5, "y":6, "w":1.5}, + {"label":"Space", "x":4, "y":6, "w":7}, + {"label":"Alt", "x":11, "y":6, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":6, "w":1.5}, + {"label":"Left", "x":15.25, "y":6}, + {"label":"Down", "x":16.25, "y":6}, + {"label":"Right", "x":17.25, "y":6}, + {"label":"0", "x":18.5, "y":6, "w":2}, + {"label":".", "x":20.5, "y":6}, + {"label":"Enter", "x":21.5, "y":5, "h":2} + ] + } + } +} diff --git a/keyboards/converter/ibm_terminal/keymaps/default/config.h b/keyboards/converter/ibm_terminal/keymaps/default/config.h index 7fa3bf328e..271f48d001 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/config.h +++ b/keyboards/converter/ibm_terminal/keymaps/default/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c index 2beb51106e..59187ef339 100644 --- a/keyboards/converter/ibm_terminal/keymaps/default/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/default/keymap.c @@ -15,18 +15,12 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include -#include -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "ibm_terminal.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // Layer 0 - KEYMAP( + LAYOUT( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -56,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `----' `---------------------------------------' `----' `-----------' `---------------' */ /* - KEYMAP_101( + LAYOUT_101( 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_NLCK,KC_PSLS,KC_PAST,KC_PMNS, diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h b/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h index 7fa3bf328e..271f48d001 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/config.h @@ -1,6 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif +// place overrides here diff --git a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c index 47a5181dde..3d6da6eab8 100644 --- a/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c +++ b/keyboards/converter/ibm_terminal/keymaps/priyadi/keymap.c @@ -15,17 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "keycode.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "ibm_terminal.h" -#include "action_layer.h" - -// Fillers to make layering clearer - -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#include QMK_KEYBOARD_H enum layers { QWE, // qwerty @@ -159,7 +149,7 @@ const uint32_t PROGMEM unicode_map[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* qwerty */ - [QWE] = KEYMAP( + [QWE] = LAYOUT( KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_PSCR, KC_SLCK, KC_PAUS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, @@ -171,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* colemak */ - [COL] = KEYMAP( + [COL] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -183,7 +173,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* workman */ - [WOR] = KEYMAP( + [WOR] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -195,7 +185,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* dvorak */ - [DVO] = KEYMAP( + [DVO] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -207,7 +197,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* system */ - [SYS] = KEYMAP( + [SYS] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -219,7 +209,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* mouse keys */ - [MOU] = KEYMAP( + [MOU] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -231,7 +221,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* emoji */ - [EMO] = KEYMAP( + [EMO] = LAYOUT( XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, @@ -243,7 +233,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* - [XXX] = KEYMAP( + [XXX] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/converter/ibm_terminal/readme.md b/keyboards/converter/ibm_terminal/readme.md new file mode 100644 index 0000000000..b781b04687 --- /dev/null +++ b/keyboards/converter/ibm_terminal/readme.md @@ -0,0 +1,39 @@ +# Keyboard converter for IBM terminal keyboard + +This is a port of TMK's converter/terminal_usb to QMK. + +It supports PS/2 Scan Code Set 3 and runs on USB AVR chips such like PJRC Teensy. +I tested the converter on ATMega32U4 with 1392595(102keys) and 6110345(122keys). + +Source code: https://github.com/qmk/qmk_firmware.git +Article: http://geekhack.org/index.php?topic=27272.0 + + +## Connection + +Keyboard | ATMega32U4 +:------- | :--------- +Data | PD2 +Clock | PD5 + +And VCC and GND, of course. See Resource section for keyboard connector pin assign. + + +## Build + +``` +git clone https://github.com/qmk/qmk_firmware.git +cd qmk_firmware +make converter/ibm_terminal:default +``` + +## Resource + +- Soarer's Converter: http://geekhack.org/index.php?topic=17458.0 +- 102keys(1392595): http://geekhack.org/index.php?topic=10737.0 +- 122keys(1390876): http://www.seasip.info/VintagePC/ibm_1390876.html +- KbdBabel: http://www.kbdbabel.org/ +- RJ45 Connector: http://www.kbdbabel.org/conn/kbd_connector_ibmterm.png +- DIN Connector: http://www.kbdbabel.org/conn/kbd_connector_ibm3179_318x_319x.png +- WinAVR: http://winavr.sourceforge.net/ + -- cgit v1.2.3 From caa293a8f77447891b02d5f8c91b209f9a082cc9 Mon Sep 17 00:00:00 2001 From: Junya Ogura <5352+juno@users.noreply.github.com> Date: Wed, 14 Nov 2018 01:27:46 +0900 Subject: Remove duplicate row from Available functions table in i2c_driver doc (#4416) --- docs/i2c_driver.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/i2c_driver.md b/docs/i2c_driver.md index f69eb5a9da..ea24dc64f3 100644 --- a/docs/i2c_driver.md +++ b/docs/i2c_driver.md @@ -8,7 +8,6 @@ The I2C Master drivers used in QMK have a set of common functions to allow porta |------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. | |`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. | -|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. | |`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. | |`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. | |`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. | -- cgit v1.2.3 From 2dea540afbfcffaea82f70b6642c39aedb9e3b5b Mon Sep 17 00:00:00 2001 From: Wilba Date: Wed, 14 Nov 2018 03:31:25 +1100 Subject: Refactoring M6-A, M6-B, Zeal60, Zeal65, WT60-A, WT65-A, WT80-A (#4417) * Refactored M6-B to use Zeal60 RGB backlight code * Fixed M6-B LED co-ordinates * Minor changes to RGB config for Zeal65 * Added dynamic keymaps to WT80-A, WT60-A, WT-80A, U80-A --- keyboards/rama/m6_a/config.h | 113 ++--------- keyboards/rama/m6_a/rules.mk | 32 +-- keyboards/rama/m6_b/config.h | 33 +++- keyboards/rama/m6_b/m6_b.c | 216 +-------------------- keyboards/rama/m6_b/m6_b_api.h | 39 ---- keyboards/rama/m6_b/rgb_backlight.c | 139 ------------- keyboards/rama/m6_b/rgb_backlight.h | 34 ---- keyboards/rama/m6_b/rules.mk | 24 +-- keyboards/rama/u80_a/config.h | 17 ++ keyboards/rama/u80_a/keymaps/default/keymap.c | 15 ++ keyboards/rama/u80_a/rules.mk | 12 +- keyboards/wilba_tech/wt60_a/config.h | 17 ++ keyboards/wilba_tech/wt60_a/rules.mk | 11 +- keyboards/wilba_tech/wt65_a/config.h | 17 ++ keyboards/wilba_tech/wt65_a/rules.mk | 11 +- keyboards/wilba_tech/wt80_a/config.h | 17 ++ .../wilba_tech/wt80_a/keymaps/default/keymap.c | 16 ++ keyboards/wilba_tech/wt80_a/rules.mk | 11 +- keyboards/wilba_tech/wt80_a/wt80_a.h | 15 ++ keyboards/wilba_tech/wt_main.c | 155 ++++++++++++++- keyboards/zeal60/rgb_backlight.c | 122 ++++++++---- keyboards/zeal60/zeal60.c | 1 + keyboards/zeal65/config.h | 8 +- 23 files changed, 468 insertions(+), 607 deletions(-) delete mode 100644 keyboards/rama/m6_b/m6_b_api.h delete mode 100644 keyboards/rama/m6_b/rgb_backlight.c delete mode 100644 keyboards/rama/m6_b/rgb_backlight.h diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 8d77f5339d..63da792745 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -1,20 +1,18 @@ -/* -Copyright 2018 Wilba - -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 . -*/ - +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 #include "config_common.h" @@ -47,7 +45,7 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW - + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 @@ -109,88 +107,10 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - #define RGB_BACKLIGHT_ENABLED 0 #define DYNAMIC_KEYMAP_LAYER_COUNT 4 - // EEPROM usage // TODO: refactor with new user EEPROM code (coming soon) @@ -206,3 +126,4 @@ along with this program. If not, see . #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 // Dynamic keymap starts after backlight config (35+37) #define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ed85ac36d0..ff17069182 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = keyboards/rama/m6_b/m6_b.c +SRC = ../zeal60/zeal60.c # MCU name MCU = atmega32u4 @@ -43,24 +43,32 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # Boot Section BOOTLOADER = atmel-dfu +# Do not put the microcontroller into power saving mode +# when we get USB suspend event. We want it to keep updating +# backlight effects. +OPT_DEFS += -DNO_SUSPEND_POWER_DOWN + + # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # 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 -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +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 controls +AUDIO_ENABLE = no # Audio output on port C6 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 +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes -DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = no + diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index 1adaad3f9e..c016703e04 100644 --- a/keyboards/rama/m6_b/config.h +++ b/keyboards/rama/m6_b/config.h @@ -109,8 +109,38 @@ #define RGB_BACKLIGHT_ENABLED 1 -#define DYNAMIC_KEYMAP_LAYER_COUNT 4 +// This conditionally compiles the backlight code for M6-B specifics +#define RGB_BACKLIGHT_M6_B + +// enable/disable LEDs based on layout +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 0 +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 0 +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +// disable backlight when USB suspended (PC sleep/hibernate/shutdown) +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 0 + +// disable backlight after timeout in minutes, 0 = no timeout +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 0 + +// the default effect (RGB test) +#define RGB_BACKLIGHT_EFFECT 255 + +// These define which keys in the matrix are alphas/mods +// Used for backlight effects so colors are different for +// alphas vs. mods +// Each value is for a row, bit 0 is column 0 +// Alpha=0 Mod=1 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_0 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_1 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_2 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_3 0 +#define RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 0 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage @@ -127,3 +157,4 @@ #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 // Dynamic keymap starts after backlight config (35+37) #define DYNAMIC_KEYMAP_EEPROM_ADDR 72 + diff --git a/keyboards/rama/m6_b/m6_b.c b/keyboards/rama/m6_b/m6_b.c index e7cd2f6287..581b31d753 100644 --- a/keyboards/rama/m6_b/m6_b.c +++ b/keyboards/rama/m6_b/m6_b.c @@ -13,218 +13,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m6_b.h" -#include "m6_b_api.h" - -// Check that no backlight functions are called -#if RGB_BACKLIGHT_ENABLED -#include "rgb_backlight.h" -#endif // RGB_BACKLIGHT_ENABLED - -#include "raw_hid.h" -#include "dynamic_keymap.h" -#include "timer.h" -#include "tmk_core/common/eeprom.h" - -bool eeprom_is_valid(void) -{ - return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && - eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); -} - -void eeprom_set_valid(bool valid) -{ - eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); - eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); -} - -void eeprom_reset(void) -{ - // Set the keyboard-specific EEPROM state as invalid. - eeprom_set_valid(false); - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); -} - -#ifdef RAW_ENABLE - -void raw_hid_receive( uint8_t *data, uint8_t length ) -{ - uint8_t *command_id = &(data[0]); - uint8_t *command_data = &(data[1]); - switch ( *command_id ) - { - case id_get_protocol_version: - { - command_data[0] = PROTOCOL_VERSION >> 8; - command_data[1] = PROTOCOL_VERSION & 0xFF; - break; - } - case id_get_keyboard_value: - { - if ( command_data[0] == id_uptime ) - { - uint32_t value = timer_read32(); - command_data[1] = (value >> 24 ) & 0xFF; - command_data[2] = (value >> 16 ) & 0xFF; - command_data[3] = (value >> 8 ) & 0xFF; - command_data[4] = value & 0xFF; - } - else - { - *command_id = id_unhandled; - } - break; - } -#ifdef DYNAMIC_KEYMAP_ENABLE - case id_dynamic_keymap_get_keycode: - { - uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); - command_data[3] = keycode >> 8; - command_data[4] = keycode & 0xFF; - break; - } - case id_dynamic_keymap_set_keycode: - { - dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); - break; - } - case id_dynamic_keymap_reset: - { - dynamic_keymap_reset(); - break; - } -#endif // DYNAMIC_KEYMAP_ENABLE -#if RGB_BACKLIGHT_ENABLED - case id_backlight_config_set_value: - { - //backlight_config_set_value(command_data); - break; - } - case id_backlight_config_get_value: - { - //backlight_config_get_value(command_data); - break; - } - case id_backlight_config_save: - { - //backlight_config_save(); - break; - } -#endif // RGB_BACKLIGHT_ENABLED - case id_eeprom_reset: - { - eeprom_reset(); - break; - } - case id_bootloader_jump: - { - // Need to send data back before the jump - // Informs host that the command is handled - raw_hid_send( data, length ); - // Give host time to read it - wait_ms(100); - bootloader_jump(); - break; - } - default: - { - // Unhandled message. - *command_id = id_unhandled; - break; - } - } - - // Return same buffer with values changed - raw_hid_send( data, length ); - -} - +#ifndef RGB_BACKLIGHT_M6_B +#error RGB_BACKLIGHT_M6_B not defined, you done goofed somehao, brah #endif - -void main_init(void) -{ - // If the EEPROM has the magic, the data is good. - // OK to load from EEPROM. - if (eeprom_is_valid()) { -#if RGB_BACKLIGHT_ENABLED - //backlight_config_load(); -#endif // RGB_BACKLIGHT_ENABLED - } else { -#if RGB_BACKLIGHT_ENABLED - // If the EEPROM has not been saved before, or is out of date, - // save the default values to the EEPROM. Default values - // come from construction of the zeal_backlight_config instance. - //backlight_config_save(); -#endif // RGB_BACKLIGHT_ENABLED -#ifdef DYNAMIC_KEYMAP_ENABLE - // This resets the keymaps in EEPROM to what is in flash. - dynamic_keymap_reset(); -#endif - // Save the magic number last, in case saving was interrupted - eeprom_set_valid(true); - } -#if RGB_BACKLIGHT_ENABLED - // Initialize LED drivers for backlight. - backlight_init_drivers(); - - backlight_timer_init(); - backlight_timer_enable(); -#endif // RGB_BACKLIGHT_ENABLED -} - -void bootmagic_lite(void) -{ - // The lite version of TMK's bootmagic. - // 100% less potential for accidentally making the - // keyboard do stupid things. - - // We need multiple scans because debouncing can't be turned off. - matrix_scan(); - wait_ms(DEBOUNCING_DELAY); - wait_ms(DEBOUNCING_DELAY); - matrix_scan(); - - // If the Esc (matrix 0,0) is held down on power up, - // reset the EEPROM valid state and jump to bootloader. - if ( matrix_get_row(0) & (1<<0) ) { - eeprom_reset(); - bootloader_jump(); - } -} - -void matrix_init_kb(void) { - bootmagic_lite(); - main_init(); - matrix_init_user(); -} - -void matrix_scan_kb(void) { -#if RGB_BACKLIGHT_ENABLED - // This only updates the LED driver buffers if something has changed. - backlight_update_pwm_buffers(); -#endif // BACKLIGHT_ENABLED - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - led_set_user(usb_led); -} - -void suspend_power_down_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(true); -#endif // BACKLIGHT_ENABLED -} - -void suspend_wakeup_init_kb(void) -{ -#if RGB_BACKLIGHT_ENABLED - //backlight_set_suspend_state(false); -#endif // BACKLIGHT_ENABLED -} diff --git a/keyboards/rama/m6_b/m6_b_api.h b/keyboards/rama/m6_b/m6_b_api.h deleted file mode 100644 index 041fd6e6ee..0000000000 --- a/keyboards/rama/m6_b/m6_b_api.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright 2017 Jason Williams (Wilba) - * - * 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 - -#define PROTOCOL_VERSION 0x0001 - -enum m6_b_command_id -{ - id_get_protocol_version = 0x01, // always 0x01 - id_get_keyboard_value, - id_set_keyboard_value, - id_dynamic_keymap_get_keycode, - id_dynamic_keymap_set_keycode, - id_dynamic_keymap_reset, - id_backlight_config_set_value, - id_backlight_config_get_value, - id_backlight_config_save, - id_eeprom_reset, - id_bootloader_jump, - id_unhandled = 0xFF, -}; - -enum m6_b_keyboard_value_id -{ - id_uptime = 0x01 -}; diff --git a/keyboards/rama/m6_b/rgb_backlight.c b/keyboards/rama/m6_b/rgb_backlight.c deleted file mode 100644 index 8f7ac06303..0000000000 --- a/keyboards/rama/m6_b/rgb_backlight.c +++ /dev/null @@ -1,139 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * 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 . - */ -#if RGB_BACKLIGHT_ENABLED - -#include "rgb_backlight.h" -//#include "rgb_backlight_api.h" - -#include -#include -#include -#include "progmem.h" - -#include "quantum/color.h" -#include "drivers/avr/i2c_master.h" -#include "drivers/issi/is31fl3218.h" - -bool g_suspend_state = false; - -// Global tick at 20 Hz -uint32_t g_tick = 0; -uint8_t g_config_effect_speed = 0; -uint8_t g_config_brightness = 255; - -void backlight_update_pwm_buffers(void) -{ - IS31FL3218_update_pwm_buffers(); -} - -void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color( index, red, green, blue ); -} - -void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) -{ - IS31FL3218_set_color_all( red, green, blue ); -} - - -// This is (F_CPU/1024) / 20 Hz -// = 15625 Hz / 20 Hz -// = 781 -#define TIMER3_TOP 260 - -void backlight_timer_init(void) -{ - static uint8_t backlight_timer_is_init = 0; - if ( backlight_timer_is_init ) - { - return; - } - backlight_timer_is_init = 1; - - // Timer 3 setup - TCCR3B = _BV(WGM32) | // CTC mode OCR3A as TOP - _BV(CS32) | _BV(CS30); // prescale by /1024 - // Set TOP value - uint8_t sreg = SREG; - cli(); - - OCR3AH = (TIMER3_TOP >> 8) & 0xff; - OCR3AL = TIMER3_TOP & 0xff; - SREG = sreg; -} - -void backlight_timer_enable(void) -{ - TIMSK3 |= _BV(OCIE3A); -} - -void backlight_timer_disable(void) -{ - TIMSK3 &= ~_BV(OCIE3A); -} - -void backlight_set_suspend_state(bool state) -{ - g_suspend_state = state; -} - -void backlight_effect_cycle_all(void) -{ - uint8_t hueOffset = ( g_tick << g_config_effect_speed ) & 0xFF; - uint8_t satOffset = 127; - // Relies on hue being 8-bit and wrapping - for ( int i=0; i<6; i++ ) - { - HSV hsv = { .h = hueOffset, .s = satOffset, .v = g_config_brightness }; - RGB rgb = hsv_to_rgb( hsv ); - backlight_set_color( i, rgb.r, rgb.g, rgb.b ); - } -} - -ISR(TIMER3_COMPA_vect) -{ - // delay 1 second before driving LEDs or doing anything else - static uint8_t startup_tick = 0; - if ( startup_tick < 20 ) - { - startup_tick++; - return; - } - - g_tick++; - - if ( g_suspend_state ) - { - backlight_set_color_all( 0, 0, 0 ); - } - else - { - //HSV hsv = { .h = 240, .s = 255, .v = g_config_brightness }; - //RGB rgb = hsv_to_rgb( hsv ); - //backlight_set_color_all( rgb.r, rgb.g, rgb.b ); - backlight_effect_cycle_all(); - } -} - -void backlight_init_drivers(void) -{ - // Initialize I2C - i2c_init(); - IS31FL3218_init(); -} - -#endif // RGB_BACKLIGHT_ENABLED diff --git a/keyboards/rama/m6_b/rgb_backlight.h b/keyboards/rama/m6_b/rgb_backlight.h deleted file mode 100644 index bbf605284b..0000000000 --- a/keyboards/rama/m6_b/rgb_backlight.h +++ /dev/null @@ -1,34 +0,0 @@ -/* Copyright 2018 Jason Williams (Wilba) - * - * 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 - -#if RGB_BACKLIGHT_ENABLED -#else -#error rgb_backlight.h included when RGB_BACKLIGHT_ENABLED == 0 -#endif // RGB_BACKLIGHT_ENABLED - -#include -#include - -#include "quantum/color.h" - -void backlight_init_drivers(void); -void backlight_update_pwm_buffers(void); -void backlight_timer_init(void); -void backlight_timer_enable(void); -void backlight_timer_disable(void); -void backlight_set_suspend_state(bool state); - diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk index 8226debd45..1a7466af37 100644 --- a/keyboards/rama/m6_b/rules.mk +++ b/keyboards/rama/m6_b/rules.mk @@ -1,5 +1,6 @@ # project specific files -SRC = rgb_backlight.c \ +SRC = ../zeal60/zeal60.c \ + ../zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3218.c \ drivers/avr/i2c_master.c @@ -56,22 +57,23 @@ OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Build Options # change yes to no to disable # -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) +CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # 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 -MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +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 controls +AUDIO_ENABLE = no # Audio output on port C6 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 +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes + diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index bfd9728283..9c74735ad5 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -185,3 +185,20 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/rama/u80_a/keymaps/default/keymap.c b/keyboards/rama/u80_a/keymaps/default/keymap.c index cf9225e3e5..036a57b689 100644 --- a/keyboards/rama/u80_a/keymaps/default/keymap.c +++ b/keyboards/rama/u80_a/keymaps/default/keymap.c @@ -18,5 +18,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), }; diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk index 99224c247c..67b04e350e 100644 --- a/keyboards/rama/u80_a/rules.mk +++ b/keyboards/rama/u80_a/rules.mk @@ -52,17 +52,21 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes +CIE1931_CURVE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 95f4c786e6..26f9ed2ba4 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -185,3 +185,20 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/wilba_tech/wt60_a/rules.mk b/keyboards/wilba_tech/wt60_a/rules.mk index 99224c247c..76a07d7a44 100644 --- a/keyboards/wilba_tech/wt60_a/rules.mk +++ b/keyboards/wilba_tech/wt60_a/rules.mk @@ -52,17 +52,20 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index fa919f186b..5f535c6a79 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -185,3 +185,20 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/wilba_tech/wt65_a/rules.mk b/keyboards/wilba_tech/wt65_a/rules.mk index 99224c247c..76a07d7a44 100644 --- a/keyboards/wilba_tech/wt65_a/rules.mk +++ b/keyboards/wilba_tech/wt65_a/rules.mk @@ -52,17 +52,20 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index 9687cb6d68..f78ce7fb34 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -185,3 +185,20 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION_ADDR 34 + +// Backlight config starts after EEPROM version +#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 +// Dynamic keymap starts after backlight config (35+37) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 diff --git a/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c index cf9225e3e5..9cbe7ff624 100644 --- a/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c +++ b/keyboards/wilba_tech/wt80_a/keymaps/default/keymap.c @@ -18,5 +18,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [2] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [3] = LAYOUT_all( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + }; diff --git a/keyboards/wilba_tech/wt80_a/rules.mk b/keyboards/wilba_tech/wt80_a/rules.mk index 99224c247c..76a07d7a44 100644 --- a/keyboards/wilba_tech/wt80_a/rules.mk +++ b/keyboards/wilba_tech/wt80_a/rules.mk @@ -52,17 +52,20 @@ BOOTLOADER = atmel-dfu # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = no # USB Nkey Rollover +NKRO_ENABLE = yes # USB Nkey Rollover BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default 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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt80_a/wt80_a.h b/keyboards/wilba_tech/wt80_a/wt80_a.h index 26403ef347..a6fb1cccb1 100644 --- a/keyboards/wilba_tech/wt80_a/wt80_a.h +++ b/keyboards/wilba_tech/wt80_a/wt80_a.h @@ -41,3 +41,18 @@ { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ } +#define LAYOUT_no_split( \ + K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ + K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ + K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ + K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, \ + K400, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K415, \ + K500, K501, K502, K506, K510, K511, K512, K513, K514, K515, K516 \ +) { \ + { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, ____, K014, K015, K016 }, \ + { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116 }, \ + { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216 }, \ + { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, ____, ____, ____ }, \ + { K400, ____, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412, K413, ____, K415, ____ }, \ + { K500, K501, K502, ____, ____, ____, K506, ____, ____, ____, K510, K511, K512, K513, K514, K515, K516 } \ +} diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index f514dbefcd..23f07d7eb1 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -16,6 +16,152 @@ #include "quantum.h" #include "keyboards/wilba_tech/wt_mono_backlight.h" +#include "keyboards/zeal60/zeal60_api.h" // Temporary hack + +#include "raw_hid.h" +#include "dynamic_keymap.h" +#include "timer.h" +#include "tmk_core/common/eeprom.h" + +bool eeprom_is_valid(void) +{ + return (eeprom_read_word(((void*)EEPROM_MAGIC_ADDR)) == EEPROM_MAGIC && + eeprom_read_byte(((void*)EEPROM_VERSION_ADDR)) == EEPROM_VERSION); +} + +void eeprom_set_valid(bool valid) +{ + eeprom_update_word(((void*)EEPROM_MAGIC_ADDR), valid ? EEPROM_MAGIC : 0xFFFF); + eeprom_update_byte(((void*)EEPROM_VERSION_ADDR), valid ? EEPROM_VERSION : 0xFF); +} + +void eeprom_reset(void) +{ + // Set the Zeal60 specific EEPROM state as invalid. + eeprom_set_valid(false); + // Set the TMK/QMK EEPROM state as invalid. + eeconfig_disable(); +} + +#ifdef RAW_ENABLE + +void raw_hid_receive( uint8_t *data, uint8_t length ) +{ + uint8_t *command_id = &(data[0]); + uint8_t *command_data = &(data[1]); + switch ( *command_id ) + { + case id_get_protocol_version: + { + command_data[0] = PROTOCOL_VERSION >> 8; + command_data[1] = PROTOCOL_VERSION & 0xFF; + break; + } + case id_get_keyboard_value: + { + if ( command_data[0] == id_uptime ) + { + uint32_t value = timer_read32(); + command_data[1] = (value >> 24 ) & 0xFF; + command_data[2] = (value >> 16 ) & 0xFF; + command_data[3] = (value >> 8 ) & 0xFF; + command_data[4] = value & 0xFF; + } + else + { + *command_id = id_unhandled; + } + break; + } +#ifdef DYNAMIC_KEYMAP_ENABLE + case id_dynamic_keymap_get_keycode: + { + uint16_t keycode = dynamic_keymap_get_keycode( command_data[0], command_data[1], command_data[2] ); + command_data[3] = keycode >> 8; + command_data[4] = keycode & 0xFF; + break; + } + case id_dynamic_keymap_set_keycode: + { + dynamic_keymap_set_keycode( command_data[0], command_data[1], command_data[2], ( command_data[3] << 8 ) | command_data[4] ); + break; + } + case id_dynamic_keymap_reset: + { + dynamic_keymap_reset(); + break; + } +#endif // DYNAMIC_KEYMAP_ENABLE + case id_backlight_config_set_value: + { + //backlight_config_set_value(command_data); + break; + } + case id_backlight_config_get_value: + { + //backlight_config_get_value(command_data); + break; + } + case id_backlight_config_save: + { + //backlight_config_save(); + break; + } + case id_eeprom_reset: + { + eeprom_reset(); + break; + } + case id_bootloader_jump: + { + // Need to send data back before the jump + // Informs host that the command is handled + raw_hid_send( data, length ); + // Give host time to read it + wait_ms(100); + bootloader_jump(); + break; + } + default: + { + // Unhandled message. + *command_id = id_unhandled; + break; + } + } + + // Return same buffer with values changed + raw_hid_send( data, length ); + +} + +#endif + +void main_init(void) +{ + // If the EEPROM has the magic, the data is good. + // OK to load from EEPROM. + if (eeprom_is_valid()) { + //backlight_config_load(); + } else { + // If the EEPROM has not been saved before, or is out of date, + // save the default values to the EEPROM. Default values + // come from construction of the zeal_backlight_config instance. + //backlight_config_save(); +#ifdef DYNAMIC_KEYMAP_ENABLE + // This resets the keymaps in EEPROM to what is in flash. + dynamic_keymap_reset(); +#endif + // Save the magic number last, in case saving was interrupted + eeprom_set_valid(true); + } + + // Initialize LED drivers for backlight. + backlight_init_drivers(); + + backlight_timer_init(); + backlight_timer_enable(); +} void bootmagic_lite(void) { @@ -32,9 +178,7 @@ void bootmagic_lite(void) // If the Esc (matrix 0,0) is held down on power up, // reset the EEPROM valid state and jump to bootloader. if ( matrix_get_row(0) & (1<<0) ) { - // Set the TMK/QMK EEPROM state as invalid. - eeconfig_disable(); - // Jump to bootloader. + eeprom_reset(); bootloader_jump(); } } @@ -42,14 +186,13 @@ void bootmagic_lite(void) void matrix_init_kb(void) { bootmagic_lite(); - backlight_init_drivers(); - backlight_timer_init(); - backlight_timer_enable(); + main_init(); matrix_init_user(); } void matrix_scan_kb(void) { + // This only updates the LED driver buffers if something has changed. backlight_update_pwm_buffers(); matrix_scan_user(); } diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c index ce8b1cb179..c3dade123c 100644 --- a/keyboards/zeal60/rgb_backlight.c +++ b/keyboards/zeal60/rgb_backlight.c @@ -15,12 +15,12 @@ */ #if RGB_BACKLIGHT_ENABLED -#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) #else -#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A +#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B #endif -#include "zeal60.h" +#include "quantum.h" #include "rgb_backlight.h" #include "rgb_backlight_api.h" #include "rgb_backlight_keycodes.h" @@ -32,7 +32,14 @@ #include "quantum/color.h" #include "drivers/avr/i2c_master.h" + +#if defined (RGB_BACKLIGHT_M6_B) +#include "drivers/issi/is31fl3218.h" +#define BACKLIGHT_LED_COUNT 6 +#else #include "drivers/issi/is31fl3731.h" +#define BACKLIGHT_LED_COUNT 72 +#endif #define BACKLIGHT_EFFECT_MAX 10 @@ -69,11 +76,12 @@ uint8_t g_indicator_state = 0; uint32_t g_tick = 0; // Ticks since this key was last hit. -uint8_t g_key_hit[72]; +uint8_t g_key_hit[BACKLIGHT_LED_COUNT]; // Ticks since any key was last hit. uint32_t g_any_key_hit = 0; +#if !defined(RGB_BACKLIGHT_M6_B) // This is a 7-bit address, that gets left-shifted and bit 0 // set to 0 for write, 1 for read (as per I2C protocol) #define ISSI_ADDR_1 0x74 @@ -162,7 +170,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { {1, C9_16, C7_15, C6_15}, // LD16 {1, C8_16, C7_16, C6_16}, // LD17 }; - +#endif // !defined(RGB_BACKLIGHT_M6_B) typedef struct Point { @@ -175,7 +183,7 @@ typedef struct Point { // point values in range x=0..224 y=0..64 // origin is center of top-left key (i.e Esc) #if defined (RGB_BACKLIGHT_ZEAL65) -const Point g_map_led_to_point[72] PROGMEM = { +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, @@ -189,7 +197,7 @@ const Point g_map_led_to_point[72] PROGMEM = { {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {144,60}, {164,64}, {188,64}, {208,64} }; -const Point g_map_led_to_point_polar[72] PROGMEM = { +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,247}, {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, @@ -204,7 +212,7 @@ const Point g_map_led_to_point_polar[72] PROGMEM = { {189,128}, {200,131}, {210,141}, {218,159}, {201,228}, {201,228}, {206,255}, {213,255}, {218,255} }; #elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) -const Point g_map_led_to_point[72] PROGMEM = { +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, @@ -218,7 +226,7 @@ const Point g_map_led_to_point[72] PROGMEM = { {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {210,48}, {224,48}, {116,48}, {132,48}, {148,48}, {164,48}, {144,64}, {161,64}, {181,64}, {201,64}, {221,64} }; -const Point g_map_led_to_point_polar[72] PROGMEM = { +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 {58,129}, {70,129}, {80,139}, {89,157}, {96,181}, {101,208}, {105,238}, {109,255}, {128,247}, {58,255}, {64,255}, {70,255}, {75,255}, {80,255}, {85,255}, {89,255}, {93,255}, {96,255}, @@ -232,6 +240,16 @@ const Point g_map_led_to_point_polar[72] PROGMEM = { {0,27}, {0,64}, {0,101}, {0,137}, {0,174}, {255,233}, {228,201}, {235,255}, {237,255}, {195,128}, {206,136}, {215,152}, {222,175}, {205,234}, {209,255}, {214,255}, {219,255}, {223,255} }; +#elif defined (RGB_BACKLIGHT_M6_B) +// M6-B is really simple: +// 0 3 5 +// 1 2 4 +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + {0,0}, {0,16}, {16,16}, {16,0}, {32,16}, {32,0} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + {0,0}, {0,16}, {16,16}, {16,0}, {32,16}, {32,0} +}; #endif // This may seem counter-intuitive, but it's quite flexible. @@ -245,16 +263,30 @@ void map_led_to_point( uint8_t index, Point *point ) point->x = pgm_read_byte(addr); point->y = pgm_read_byte(addr+1); +#if defined (RGB_BACKLIGHT_M6_B) + return; +#endif + switch (index) { case 18+4: // LB4A if ( g_config.use_split_backspace ) point->x -= 8; break; +#if defined (RGB_BACKLIGHT_ZEAL60) case 18+14: // LB14A if ( g_config.use_iso_enter ) point->y += 8; // extremely pedantic break; + case 54+5: // LD5A + if ( !g_config.use_iso_enter ) + point->x -= 10; + break; + case 36+16: // LC16A + if ( !g_config.use_split_left_shift ) + point->x += 8; + break; +#endif #if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) case 36+0: // LC0A if ( g_config.use_7u_spacebar ) @@ -264,19 +296,11 @@ void map_led_to_point( uint8_t index, Point *point ) if ( g_config.use_7u_spacebar ) point->x += 4; break; -#endif - case 36+16: // LC16A - if ( !g_config.use_split_left_shift ) - point->x += 8; - break; - case 54+5: // LD5A - if ( !g_config.use_iso_enter ) - point->x -= 10; - break; case 54+7: // LD7A if ( !g_config.use_split_right_shift ) point->x -= 8; break; +#endif } } @@ -325,6 +349,13 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8 }, { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 54+13, 54+14, 54+15, 54+16, 54+17 } }; +#elif defined (RGB_BACKLIGHT_M6_B) +// M6-B is really simple: +// 0 3 5 +// 1 2 4 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0, 3, 5, 1, 2, 4 } +}; #endif void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ) @@ -338,18 +369,30 @@ void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ) void backlight_update_pwm_buffers(void) { +#if defined (RGB_BACKLIGHT_M6_B) + IS31FL3218_update_pwm_buffers(); +#else IS31FL3731_update_pwm_buffers( ISSI_ADDR_1, ISSI_ADDR_2 ); IS31FL3731_update_led_control_registers( ISSI_ADDR_1, ISSI_ADDR_2 ); +#endif } void backlight_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ) { +#if defined (RGB_BACKLIGHT_M6_B) + IS31FL3218_set_color( index, red, green, blue ); +#else IS31FL3731_set_color( index, red, green, blue ); +#endif } void backlight_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { +#if defined (RGB_BACKLIGHT_M6_B) + IS31FL3218_set_color_all( red, green, blue ); +#else IS31FL3731_set_color_all( red, green, blue ); +#endif } void backlight_set_key_hit(uint8_t row, uint8_t column) @@ -436,6 +479,7 @@ void backlight_effect_rgb_test(void) } } +#if defined(RGB_DEBUGGING_ONLY) // This tests the LEDs // Note that it will change the LED control registers // in the LED drivers, and leave them in an invalid @@ -475,6 +519,7 @@ void backlight_effect_single_LED_test(void) backlight_set_color_all( 255, 255, 255 ); backlight_test_led( led, color==0, color==1, color==2 ); } +#endif // defined(RGB_DEBUGGING_ONLY) // All LEDs off void backlight_effect_all_off(void) @@ -502,7 +547,7 @@ void backlight_effect_alphas_mods(void) { uint8_t index; map_row_column_to_led( row, column, &index ); - if ( index < 72 ) + if ( index < BACKLIGHT_LED_COUNT ) { if ( ( g_config.alphas_mods[row] & (1< Date: Tue, 13 Nov 2018 11:38:48 -0500 Subject: Keyboard: Add 412 64 Model 00 keyboard. (#4400) * Add 412-64 keyboard firmware It's pretty barebones for now, but the Model 00 is also a pretty barebones machine. Model 01 won't be better, but plenty of pins exist for things like LEDs on Model 02. * MANU/PROD ID changes. Changed around the MANUFACTURER and PRODUCT IDs to be more polite when viewed in qmk toolbox. * Fixing PROD again. For the love of all that is good and holy, that was ugly. This new one looks better. This stuff matters to me for some reason. * Yep, updating MANU again. There we go. That's better - From my name to my "design firm". * Update keyboards/412_64/keymaps/default/keymap.c Co-Authored-By: FateEverywhere <41215461+FateEverywhere@users.noreply.github.com> * Update keyboards/412_64/rules.mk Co-Authored-By: FateEverywhere <41215461+FateEverywhere@users.noreply.github.com> * Update keyboards/412_64/rules.mk Co-Authored-By: FateEverywhere <41215461+FateEverywhere@users.noreply.github.com> * Update keyboards/412_64/rules.mk Co-Authored-By: FateEverywhere <41215461+FateEverywhere@users.noreply.github.com> * Update keyboards/412_64/rules.mk Co-Authored-By: FateEverywhere <41215461+FateEverywhere@users.noreply.github.com> --- keyboards/412_64/412_64.c | 29 +++++ keyboards/412_64/412_64.h | 29 +++++ keyboards/412_64/config.h | 202 ++++++++++++++++++++++++++++++ keyboards/412_64/keymaps/default/config.h | 5 + keyboards/412_64/keymaps/default/keymap.c | 105 ++++++++++++++++ keyboards/412_64/keymaps/default/rules.mk | 1 + keyboards/412_64/readme.md | 15 +++ keyboards/412_64/rules.mk | 73 +++++++++++ 8 files changed, 459 insertions(+) create mode 100644 keyboards/412_64/412_64.c create mode 100644 keyboards/412_64/412_64.h create mode 100644 keyboards/412_64/config.h create mode 100644 keyboards/412_64/keymaps/default/config.h create mode 100644 keyboards/412_64/keymaps/default/keymap.c create mode 100644 keyboards/412_64/keymaps/default/rules.mk create mode 100644 keyboards/412_64/readme.md create mode 100644 keyboards/412_64/rules.mk diff --git a/keyboards/412_64/412_64.c b/keyboards/412_64/412_64.c new file mode 100644 index 0000000000..eaec54ade8 --- /dev/null +++ b/keyboards/412_64/412_64.c @@ -0,0 +1,29 @@ + +#include "412_64.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/412_64/412_64.h b/keyboards/412_64/412_64.h new file mode 100644 index 0000000000..27a32f15aa --- /dev/null +++ b/keyboards/412_64/412_64.h @@ -0,0 +1,29 @@ + +#ifndef FOURx16_H +#define FOURx16_H + +#include "quantum.h" +#define ___ KC_NO + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguments +// The second converts the arguments into a two-dimensional array + +#define LAYOUT_ortho_4x16( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K30, K31, \ + K32, K33, K34, K35, K36, K37, K38, K39, K40, K41, K42, K43, K44, K45, K46, K47, \ + K48, K49, K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K60, K61, K62, K63 \ +) \ +{ \ + { K00, K02, K04, K06, K08, K10, K12, K14 }, \ + { K01, K03, K05, K07, K09, K11, K13, K15 }, \ + { K16, K18, K20, K22, K24, K26, K28, K30 }, \ + { K17, K19, K21, K23, K25, K27, K29, K31 }, \ + { K32, K34, K36, K38, K40, K42, K44, K46 }, \ + { K33, K35, K37, K39, K41, K43, K45, K47 }, \ + { K48, K50, K52, K54, K56, K58, K60, K62 }, \ + { K49, K51, K53, K55, K57, K59, K61, K63 } \ +} + +#endif diff --git a/keyboards/412_64/config.h b/keyboards/412_64/config.h new file mode 100644 index 0000000000..28d9763c31 --- /dev/null +++ b/keyboards/412_64/config.h @@ -0,0 +1,202 @@ + + +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xF7E0 +#define PRODUCT_ID 0x0412 +#define DEVICE_VER 0x0000 +#define MANUFACTURER EDI/SCI +#define PRODUCT 412 64 Model 00 +#define DESCRIPTION A compact 60% keyboard inspired by the 4x4x4x4x4 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, F4, F5, F6, F7, B1, B3, B2 } +#define MATRIX_COL_PINS { B0, D2, D0, D1, D4, C6, D7, E6 } +#define UNUSED_PINS { B4, B5, B6, B7, C7, F0, F1 } + + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN C7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/412_64/keymaps/default/config.h b/keyboards/412_64/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/412_64/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/412_64/keymaps/default/keymap.c b/keyboards/412_64/keymaps/default/keymap.c new file mode 100644 index 0000000000..c098a37e5e --- /dev/null +++ b/keyboards/412_64/keymaps/default/keymap.c @@ -0,0 +1,105 @@ + +#include QMK_KEYBOARD_H + +#define _MAIN 0 +#define _RAISE 1 +#define _LOWER 2 + +// Readability keycodes +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +/* MAIN + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | TAB | Q | W | E | R | T | Y | U | I | O | P | Backsp | Delete | 7 | 8 | 9 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | ESC | A | S | D | F | G | H | J | K | L | ; | ' | PgUp | 4 | 5 | 6 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SHIFT | Z | X | C | V | B | N | M | , | . | / | ENTER | PgDn | 1 | 2 | 3 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | LCTRL | PAUS | GUI | ALT | Lower | Space | Space | Raise | Left | Down | Up | Right | Shift | 0 | . | ENTER | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_MAIN] = LAYOUT_ortho_4x16( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_DEL, KC_KP_7, KC_KP_8, KC_KP_9, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_PGUP, KC_KP_4, KC_KP_5, KC_KP_6, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, KC_PGDN, KC_KP_1, KC_KP_2, KC_KP_3, + KC_LCTL, KC_PAUS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_RSFT, KC_KP_0, KC_KP_DOT, KC_PENT + ), + +/* RAISE + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | | Insert | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | - | = | [ | ] | \ | Home | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | ISO # | ISO / | | | PScr | End | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | Next | Vol- | Vol+ | Play | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_RAISE] = LAYOUT_ortho_4x16( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_INS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, KC_HOME, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_NUHS, KC_NUBS, _______, _______, KC_PSCR, KC_END, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______, _______ + ), + +/* LOWER + * .-----------------------------------------------------------------------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | | | | Reset | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | ISO ~ | ISO | | | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | | | | | Mute | | | | | + * '-----------------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_LOWER] = LAYOUT_ortho_4x16( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, _______, _______, RESET, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS), _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, _______, _______, _______, _______ + ), + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + keyevent_t event = record->event; + (void)event; + + switch (id) { + + } + return MACRO_NONE; +} + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/412_64/keymaps/default/rules.mk b/keyboards/412_64/keymaps/default/rules.mk new file mode 100644 index 0000000000..08fdcc0a56 --- /dev/null +++ b/keyboards/412_64/keymaps/default/rules.mk @@ -0,0 +1 @@ +KEY_LOCK_ENABLE = yes # Enable the universal locking key, which lets you do any locking you require. \ No newline at end of file diff --git a/keyboards/412_64/readme.md b/keyboards/412_64/readme.md new file mode 100644 index 0000000000..0811031075 --- /dev/null +++ b/keyboards/412_64/readme.md @@ -0,0 +1,15 @@ +# 412-64 + +![412-64](image_here) + +A compact 60% keyboard designed by Fate Everywhere and sold on a limited basis. Born out of the desire for a Planck with a numpad for technical work. + +Keyboard Maintainer: [Fate Everywhere](https://github.com/fateeverywhere) +Hardware Supported: 4x16 T&E Prototype, 412-64 Mk. 0, Mk. 1. +Hardware Availability: Highly limited, contact /u/FateEverywhere on reddit for availability. + +Make example for this keyboard (after setting up your build environment): + + make 412-64: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). \ No newline at end of file diff --git a/keyboards/412_64/rules.mk b/keyboards/412_64/rules.mk new file mode 100644 index 0000000000..9e74da5d98 --- /dev/null +++ b/keyboards/412_64/rules.mk @@ -0,0 +1,73 @@ +# MCU name +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 + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + +# 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 = atmel-dfu + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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) + +LAYOUTS = ortho_4x16 -- cgit v1.2.3 From 911b2d07565fa0c6edb49a198f4420391f7f33f3 Mon Sep 17 00:00:00 2001 From: KOBAYASHI Daisuke Date: Wed, 22 Aug 2018 23:56:24 +0900 Subject: Docs: Fix descriptions of KC_INT1 and KC_INT3 --- docs/keycodes.md | 4 ++-- docs/keycodes_basic.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index e5d35b2b4a..592b52ec7b 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -141,9 +141,9 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_LOCKING_SCROLL` |`KC_LSCR` |Locking Scroll Lock | |`KC_KP_COMMA` |`KC_PCMM` |Keypad `,` | |`KC_KP_EQUAL_AS400` | |Keypad `=` on AS/400 keyboards | -|`KC_INT1` |`KC_RO` |JIS `\` and | | +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | |`KC_INT2` |`KC_KANA` |JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN` |JIS `¥` | +|`KC_INT3` |`KC_JYEN` |JIS `¥` and | | |`KC_INT4` |`KC_HENK` |JIS Henkan | |`KC_INT5` |`KC_MHEN` |JIS Muhenkan | |`KC_INT6` | |JIS Numpad `,` | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 82e94aa5e9..ada9cc0e5a 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -123,9 +123,9 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |Key |Aliases |Description | |----------|---------|-------------------------------| -|`KC_INT1` |`KC_RO` |JIS `\` and || +|`KC_INT1` |`KC_RO` |JIS `\` and `_` | |`KC_INT2` |`KC_KANA`|JIS Katakana/Hiragana | -|`KC_INT3` |`KC_JYEN`|JIS `¥` | +|`KC_INT3` |`KC_JYEN`|JIS `¥` and || |`KC_INT4` |`KC_HENK`|JIS Henkan | |`KC_INT5` |`KC_MHEN`|JIS Muhenkan | |`KC_INT6` | |JIS Numpad `,` | -- cgit v1.2.3 From 991686203c91eca9149e6fe942be73e5172719ba Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 13 Nov 2018 14:20:42 -0800 Subject: converter/m0110_usb Configurator support and readme cleanup (#4421) * Apple M0110 USB converter: readme cleanup * Apple M0110 USB converter: Configurator support --- keyboards/converter/m0110_usb/README.md | 18 ++-- keyboards/converter/m0110_usb/info.json | 172 ++++++++++++++++++++++++++++++++ 2 files changed, 181 insertions(+), 9 deletions(-) create mode 100644 keyboards/converter/m0110_usb/info.json diff --git a/keyboards/converter/m0110_usb/README.md b/keyboards/converter/m0110_usb/README.md index 3041eb0b4a..2e8a2eaef1 100644 --- a/keyboards/converter/m0110_usb/README.md +++ b/keyboards/converter/m0110_usb/README.md @@ -1,19 +1,19 @@ -M0110(A) keyboard converter -====================================== +# M0110(A) keyboard converter + This is a port of the original M0110 converter from TMK to QMK. The original converter was designed to work with **ATmega32U2** and **ATmega32U4** based microcontrollers to convert Apple M0110/M0110A keyboards and M0120 numpads to USB. This port has been tested to be compatible with the [**Adafruit Feather 32U4 BLE**](https://learn.adafruit.com/adafruit-feather-32u4-bluefruit-le). -### Enabling Bluetooth for the Adafruit Feather 32U4 BLE ----------------------------------------------------- +## Enabling Bluetooth for the Adafruit Feather 32U4 BLE + Simply add `BLUETOOTH = AdafruitBLE` to your `rules.mk` file. This enables code specifically for the Adafruit Feather 32U4 BLE. If enabled, the device will use the `PRODUCT` and `DESCRIPTION` values from `config.h` for the device name displayed by the Feather on host devices. You can simply change these values to change the device name. -### Pins ----- +## Pins + This port utilizes the same pins that the TMK converter used. `PD1` is used for `CLOCK` and `PD0` is used for the `DATA` from the keyboard. These pins can be changed in `config.h`. -### Other important hardware notes from the original TMK converter Readme: +## Other important hardware notes from the original TMK converter Readme: >### Hardware >-------- >You can buy preassembled [TMK converter] or make yourown with AVR dev board like PJRC [Teensy]. @@ -45,7 +45,7 @@ This port utilizes the same pins that the TMK converter used. `PD1` is used for [**View the original TMK converter Repository**](https://github.com/tmk/tmk_keyboard/tree/master/converter/m0110_usb) -### QMK Port Changelog ---------- +## QMK Port Changelog + - 2018/08/01 - Original Release diff --git a/keyboards/converter/m0110_usb/info.json b/keyboards/converter/m0110_usb/info.json new file mode 100644 index 0000000000..6ef6103345 --- /dev/null +++ b/keyboards/converter/m0110_usb/info.json @@ -0,0 +1,172 @@ +{ + "keyboard_name": "M0110(A) keyboard converter", + "url": "", + "maintainer": "qmk", + "width": 19.25, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 78, + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":1.5}, + {"label":"Num Lock", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"/", "x":17.25, "y":0}, + {"label":"*", "x":18.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"7", "x":15.25, "y":1}, + {"label":"8", "x":16.25, "y":1}, + {"label":"9", "x":17.25, "y":1}, + {"label":"-", "x":18.25, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":1.75}, + {"label":"4", "x":15.25, "y":2}, + {"label":"5", "x":16.25, "y":2}, + {"label":"6", "x":17.25, "y":2}, + {"label":"+", "x":18.25, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Up", "x":13.5, "y":3}, + {"label":"1", "x":15.25, "y":3}, + {"label":"2", "x":16.25, "y":3}, + {"label":"3", "x":17.25, "y":3}, + {"label":"Enter", "x":18.25, "y":3, "h":2}, + {"label":"Alt", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4, "w":2}, + {"label":"Space", "x":3.5, "y":4, "w":6}, + {"label":"MO(1)", "x":9.5, "y":4}, + {"label":"\\", "x":10.5, "y":4}, + {"label":"Left", "x":11.5, "y":4}, + {"label":"Right", "x":12.5, "y":4}, + {"label":"Down", "x":13.5, "y":4}, + {"label":"0", "x":15.25, "y":4, "w":2}, + {"label":".", "x":17.25, "y":4} + ] + }, + "LAYOUT_iso": { + "key_count": 75, + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":1.5}, + {"label":"Num Lock", "x":15.25, "y":0}, + {"label":"=", "x":16.25, "y":0}, + {"label":"/", "x":17.25, "y":0}, + {"label":"*", "x":18.25, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Return", "x":13.75, "y":1, "w":0.75, "h":2}, + {"label":"7", "x":15.25, "y":1}, + {"label":"8", "x":16.25, "y":1}, + {"label":"9", "x":17.25, "y":1}, + {"label":"-", "x":18.25, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"#", "x":12.75, "y":2}, + {"label":"4", "x":15.25, "y":2}, + {"label":"5", "x":16.25, "y":2}, + {"label":"6", "x":17.25, "y":2}, + {"label":"+", "x":18.25, "y":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"\\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"1", "x":15.25, "y":3}, + {"label":"2", "x":16.25, "y":3}, + {"label":"3", "x":17.25, "y":3}, + {"label":"Enter", "x":18.25, "y":3, "h":2}, + {"label":"Option", "x":1, "y":4}, + {"label":"GUI", "x":2, "y":4, "w":1.5}, + {"label":"Space", "x":3.5, "y":4, "w":7.5}, + {"label":"Enter", "x":11, "y":4, "w":1.5}, + {"label":"0", "x":15.25, "y":4, "w":2}, + {"label":".", "x":17.25, "y":4} + ] + } + } +} -- cgit v1.2.3 From e10a602e7b1ac8d7f2ff027ae41570fe1a2ba57d Mon Sep 17 00:00:00 2001 From: FiNeXdesign Date: Tue, 13 Nov 2018 23:44:50 +0100 Subject: Keymap: Finex Redox keymap (#4418) * Added FiNeX custom Redox Layout, first commit. * updated readme * removed old code --- keyboards/redox/keymaps/finex/config.h | 36 ++++++ keyboards/redox/keymaps/finex/keymap.c | 188 ++++++++++++++++++++++++++++++++ keyboards/redox/keymaps/finex/readme.md | 35 ++++++ keyboards/redox/keymaps/finex/rules.mk | 3 + 4 files changed, 262 insertions(+) create mode 100644 keyboards/redox/keymaps/finex/config.h create mode 100644 keyboards/redox/keymaps/finex/keymap.c create mode 100644 keyboards/redox/keymaps/finex/readme.md create mode 100644 keyboards/redox/keymaps/finex/rules.mk diff --git a/keyboards/redox/keymaps/finex/config.h b/keyboards/redox/keymaps/finex/config.h new file mode 100644 index 0000000000..9adbcedf49 --- /dev/null +++ b/keyboards/redox/keymaps/finex/config.h @@ -0,0 +1,36 @@ +/* +Copyright 2018 Leonardo (FiNeX) Finetti + +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 + +/* 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 14 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 diff --git a/keyboards/redox/keymaps/finex/keymap.c b/keyboards/redox/keymaps/finex/keymap.c new file mode 100644 index 0000000000..8b8f5f1839 --- /dev/null +++ b/keyboards/redox/keymaps/finex/keymap.c @@ -0,0 +1,188 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// Layer names +#define _QWERTY 0 +#define _COLEMAKDHMK 1 +#define _QWERTY_MAC 2 +#define _COLEMAKDHMK_MAC 3 +#define _SYMB 4 +#define _ADJUST 5 + +// Custom keycodes +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAKDHMK, + QWERTY_MAC, + COLEMAKDHMK_MAC, + SYMB, + ADJUST, + ASC_SAR, + ASC_DAR, + ASC_SQT, + ASC_DQT, + ASC_HAP, + ASC_SAD +}; + +// Shortcut to make keymap more readable +#define KC_SYQT LT(_SYMB, KC_QUOT) +#define KC_SYGR LT(_SYMB, KC_GRV) +#define KC_SYSP LT(_SYMB, KC_SPC) +#define KC_ADEN LT(_ADJUST, KC_END) +#define KC_ADPU LT(_ADJUST, KC_PGUP) +#define KC_CESC LCTL_T(KC_ESC) +#define KC_CBSP LCTL_T(KC_BSPC) +#define KC_CMIN RCTL_T(KC_MINUS) +#define KC_GBSP LGUI_T(KC_BSPC) +#define KC_ADEL LALT_T(KC_DEL) +#define KC_APLS RALT_T(KC_PPLS) +#define KC_LSEN LSFT_T(KC_ENT) +#define KC_RSEN RSFT_T(KC_ENT) +#define FN1 QWERTY +#define FN2 COLEMAKDHMK +#define FN3 QWERTY_MAC +#define FN4 COLEMAKDHMK_MAC + +// Send custom strings or change default base layer +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch(keycode) { + case ASC_SAR: + SEND_STRING("->"); + return false; + case ASC_DAR: + SEND_STRING("=>"); + return false; + case ASC_SQT: + // SS_RALT(): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT("'")); + return false; + case ASC_DQT: + // SS_RALT(SS_LSFT()): Avoid sending dead key on software intl layouts + SEND_STRING(SS_RALT(SS_LSFT("\""))); + return false; + case ASC_HAP: + SEND_STRING(":-) "); + return false; + case ASC_SAD: + SEND_STRING(":-( "); + return false; + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAKDHMK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAKDHMK); + } + return false; + break; + case QWERTY_MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY_MAC); + } + return false; + break; + case COLEMAKDHMK_MAC: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAKDHMK_MAC); + } + return false; + break; + } + } + return true; +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_DEL , KC_BSPC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LGUI , KC_ADEL , KC_CBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_COLEMAKDHMK] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_DEL , KC_BSPC ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_S ,KC_T ,KC_G ,KC_LBRC , KC_RBRC ,KC_M ,KC_N ,KC_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LGUI , KC_ADEL , KC_CBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_QWERTY_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_E ,KC_R ,KC_T ,KC_DEL , KC_BSPC ,KC_Y ,KC_U ,KC_I ,KC_O ,KC_P ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_LBRC , KC_RBRC ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LCTL , KC_ADEL , KC_GBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_COLEMAKDHMK_MAC] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_SYGR ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_SYQT , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_B ,KC_DEL , KC_BSPC ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_EQL , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_CESC ,KC_A ,KC_R ,KC_S ,KC_T ,KC_G ,KC_LBRC , KC_RBRC ,KC_M ,KC_N ,KC_E ,KC_I ,KC_O ,KC_CMIN , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSPO ,KC_Z ,KC_X ,KC_C ,KC_D ,KC_V ,KC_ADPU ,KC_PGDN , KC_HOME ,KC_ADEN ,KC_K ,KC_H ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSPC , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + KC_SYSP ,KC_BSLS ,KC_QUOT ,KC_LCTL , KC_ADEL , KC_GBSP ,KC_LSEN , KC_RSEN ,KC_SYSP , KC_APLS , KC_LEFT ,KC_DOWN ,KC_UP ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_SYMB] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,KC_F1 ,KC_F2 ,KC_F3 ,KC_F4 ,KC_F5 , KC_F6 ,KC_F7 ,KC_F8 ,KC_F9 ,KC_F10 ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_CIRC ,KC_BSLS ,KC_PMNS ,KC_UNDS ,XXXXXXX ,_______ , _______ ,XXXXXXX ,KC_KP_7 ,KC_KP_8 ,KC_KP_9 ,KC_F11 ,KC_APP , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_PAST ,KC_PIPE ,ASC_SQT ,KC_TILD ,KC_QUOT ,ASC_SAR , ASC_DAR ,XXXXXXX ,KC_KP_4 ,KC_KP_5 ,KC_KP_6 ,KC_F12 ,KC_PSCR , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______ ,KC_HASH ,KC_AMPR ,KC_AT ,ASC_DQT ,KC_GRV ,ASC_SAD ,ASC_HAP , _______ ,_______ ,XXXXXXX ,KC_KP_1 ,KC_KP_2 ,KC_KP_3 ,KC_UP ,_______ , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , KC_KP_0 , KC_PDOT ,KC_LEFT ,KC_DOWN ,KC_RGHT + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + XXXXXXX ,FN1 ,FN2 ,FN3 ,FN4 ,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,RESET ,RGB_M_P ,RGB_TOG ,RGB_MOD ,RGB_HUD ,RGB_HUI , RGB_SAD ,RGB_SAI ,RGB_VAD ,RGB_VAI ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_B ,RGB_M_R ,RGB_M_SW,RGB_M_SN,XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,RGB_M_K ,RGB_M_X ,RGB_M_G ,XXXXXXX ,_______ ,XXXXXXX , XXXXXXX ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX + //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ + ) + +}; diff --git a/keyboards/redox/keymaps/finex/readme.md b/keyboards/redox/keymaps/finex/readme.md new file mode 100644 index 0000000000..f1b6fa7c7b --- /dev/null +++ b/keyboards/redox/keymaps/finex/readme.md @@ -0,0 +1,35 @@ +# Customized keymap for Redox by Leonardo (FiNeX) Finetti. + + +## Features + +- Enabled USE_SERIAL for Falba.Tech Redox keyboards. +- PC Layouts: QWERTY, Colemak Mod DH-MK. +- Mac Layouts: same as above with CTRL-GUI keys inverted on the bottom row. +- Added redundant "Space", "Esc" and "Ctrl" keys. +- Added macro to print "->" and "=>" strings. +- Added macro to print ":-( " and ":-) " strings. +- Added more arrows. +- Added "(" and ")" on Shifts keys. +- Added Shift on both ) "Enter" keys. +- Removed Mouse and media support. +- Added missing "Print Screen" and "Menu" keys. +- Added missing "F11" and "F12" keys. + + +## Layers + +This keymap use the default one with some minor improvements to suit my needs. + +## Changelog + +- 2018/11/13 + First public release + + +## TODO + +- Bring back mouse and multimedia keys. +- Add default Colemak Mod DH layout. +- Improve top corner keys. +- Improve bottom row keys (mostly KC_BSLS and KC_QUOT). diff --git a/keyboards/redox/keymaps/finex/rules.mk b/keyboards/redox/keymaps/finex/rules.mk new file mode 100644 index 0000000000..21550e9fe1 --- /dev/null +++ b/keyboards/redox/keymaps/finex/rules.mk @@ -0,0 +1,3 @@ +RGBLIGHT_ENABLE = yes + +COMMAND_ENABLE = no -- cgit v1.2.3 From f7fcba329dbd659a4bb37acdf7e2dc24204a81c8 Mon Sep 17 00:00:00 2001 From: James Osborn Date: Wed, 14 Nov 2018 15:33:46 +0000 Subject: Fixed Unicode Support heading (#4425) Previously, Unicode Support heading appeared as the last row in the Swap Hands table. --- docs/keycodes.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/keycodes.md b/docs/keycodes.md index 592b52ec7b..30fe60278f 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -459,6 +459,7 @@ This is a reference only. Each group of keys links to the page documenting their |`SH_MOFF` |Momentarily turns off swap. | |`SH_TG` |Toggles swap on and off with every key press. | |`SH_TT` |Toggles with a tap; momentary when held. | + ## [Unicode Support](feature_unicode.md) |Key |Aliases| | -- cgit v1.2.3 From 0cda2f43e2c95fe5dd440e6391ae807f508b040b Mon Sep 17 00:00:00 2001 From: Phillip Tennen Date: Wed, 14 Nov 2018 16:45:46 +0100 Subject: Backlight status functions (#4259) * add functions to set specific backlight state * add function to query backlight state * update documentation with new backlight functions * Update tmk_core/common/backlight.c Co-Authored-By: codyd51 * Update tmk_core/common/backlight.h Co-Authored-By: codyd51 * update docs for is_backlight_enabled() name change --- docs/feature_backlight.md | 19 ++++++++++------- tmk_core/common/backlight.c | 51 +++++++++++++++++++++++++++++++++++++++------ tmk_core/common/backlight.h | 4 ++++ 3 files changed, 60 insertions(+), 14 deletions(-) diff --git a/docs/feature_backlight.md b/docs/feature_backlight.md index 7bb7e03a89..f7a35406c7 100644 --- a/docs/feature_backlight.md +++ b/docs/feature_backlight.md @@ -54,14 +54,17 @@ In this handler, the value of an incrementing counter is mapped onto a precomput ## Backlight Functions -|Function |Description | -|----------|----------------------------------------------------------| -|`backlight_toggle()` |Turn the backlight on or off | -|`backlight_step()` |Cycle through backlight levels | -|`backlight_increase()` |Increase the backlight level | -|`backlight_decrease()` |Decrease the backlight level | -|`backlight_level(x)` |Sets the backlight level to specified level | -|`get_backlight_level()`|Return the current backlight level | +|Function |Description | +|----------|-----------------------------------------------------------| +|`backlight_toggle()` |Turn the backlight on or off | +|`backlight_enable()` |Turn the backlight on | +|`backlight_disable()` |Turn the backlight off | +|`backlight_step()` |Cycle through backlight levels | +|`backlight_increase()` |Increase the backlight level | +|`backlight_decrease()` |Decrease the backlight level | +|`backlight_level(x)` |Sets the backlight level to specified level | +|`get_backlight_level()` |Return the current backlight level | +|`is_backlight_enabled()`|Return whether the backlight is currently on | ### Backlight Breathing Functions diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c index 3e29aacc49..8ddacd98b6 100644 --- a/tmk_core/common/backlight.c +++ b/tmk_core/common/backlight.c @@ -76,12 +76,51 @@ void backlight_decrease(void) */ void backlight_toggle(void) { - backlight_config.enable ^= 1; - if (backlight_config.raw == 1) // enabled but level = 0 - backlight_config.level = 1; - eeconfig_update_backlight(backlight_config.raw); - dprintf("backlight toggle: %u\n", backlight_config.enable); - backlight_set(backlight_config.enable ? backlight_config.level : 0); + bool enabled = backlight_config.enable; + dprintf("backlight toggle: %u\n", enabled); + if (enabled) + backlight_disable(); + else + backlight_enable(); +} + +/** \brief Enable backlight + * + * FIXME: needs doc + */ +void backlight_enable(void) +{ + if (backlight_config.enable) return; // do nothing if backlight is already on + + backlight_config.enable = true; + if (backlight_config.raw == 1) // enabled but level == 0 + backlight_config.level = 1; + eeconfig_update_backlight(backlight_config.raw); + dprintf("backlight enable\n"); + backlight_set(backlight_config.level); +} + +/** /brief Disable backlight + * + * FIXME: needs doc + */ +void backlight_disable(void) +{ + if (!backlight_config.enable) return; // do nothing if backlight is already off + + backlight_config.enable = false; + eeconfig_update_backlight(backlight_config.raw); + dprintf("backlight disable\n"); + backlight_set(0); +} + +/** /brief Get the backlight status + * + * FIXME: needs doc + */ +bool is_backlight_enabled(void) +{ + return backlight_config.enable; } /** \brief Backlight step through levels diff --git a/tmk_core/common/backlight.h b/tmk_core/common/backlight.h index ef8ab9b2be..420c9d19ed 100644 --- a/tmk_core/common/backlight.h +++ b/tmk_core/common/backlight.h @@ -32,7 +32,11 @@ void backlight_init(void); void backlight_increase(void); void backlight_decrease(void); void backlight_toggle(void); +void backlight_enable(void); +void backlight_disable(void); +bool is_backlight_enabled(void); void backlight_step(void); void backlight_set(uint8_t level); void backlight_level(uint8_t level); uint8_t get_backlight_level(void); + -- cgit v1.2.3 From a034602651c86424bc2197ee61bea0ff584b3be1 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 14 Nov 2018 12:22:16 -0500 Subject: adding block def to ishtob's userspace (#4427) --- keyboards/planck/keymaps/ishtob/keymap.c | 34 +++---- users/ishtob/ishtob.h | 165 +++++++++++++++++++++++++++++++ 2 files changed, 182 insertions(+), 17 deletions(-) diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index 86c5555da3..082257b895 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -25,9 +25,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN), CTL_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), + LT_FN(KC_TAB), _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, + KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, CTL_ENT, + KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), @@ -43,10 +43,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, LT_RAI(KC_MINS), - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL + LT_FN(KC_TAB), _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, + KC_LCTL, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_ENT, + KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), /* Dvorak @@ -61,10 +61,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_DVORAK] = LAYOUT_planck_grid( - LT_FN(KC_TAB), KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_ENT, - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, LT_RAI(KC_MINS), - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL + LT_FN(KC_TAB), _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, + KC_LCTL, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_ENT, + KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL ), /* Lower @@ -79,9 +79,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_planck_grid( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_GRV, KC_BSLS, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), @@ -97,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT_planck_grid( - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_PLUS, KC_BSLS, _______, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK @@ -135,8 +135,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_FNLAYER] = LAYOUT_planck_grid( _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, + _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, + _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h index 2c47fce791..3e4d4ffbcb 100644 --- a/users/ishtob/ishtob.h +++ b/users/ishtob/ishtob.h @@ -71,6 +71,171 @@ enum userspace_layers { }; */ +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_planck_grid(...) LAYOUT_planck_grid(__VA_ARGS__) + +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, LT_MC(KC_SCLN) +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O) +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, LT_MC(KC_O) +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S) +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z + + +#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, LT_MC(KC_I) +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN +#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, LT_MC(KC_U) +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, LT_MC(KC_R) +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, LT_MC(KC_N) +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, LT_MC(KC_SCLN) +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, LT_MC(KC_H) +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define __________________LONG_FUNC_LEFT___________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6 +#define __________________LONG_FUNC_RIGHT__________________ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 + +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT + #endif // !USERSPACE \ No newline at end of file -- cgit v1.2.3 From d8f090e5592fd5b6fde35ae36e36f2473c716312 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 14 Nov 2018 18:32:28 -0800 Subject: Docs: Supporting a keyboard in the QMK Configurator (#4396) * Docs: Configurator Support * Minor updates * Updated keyboard.h example to use #pragma once per @drashna https://github.com/qmk/qmk_firmware/pull/4396#discussion_r232140934 * Add link to doc under Reference section Added to _sidebar.md and _summary.md * Changed doc title; minor tweaks Re-titled the doc as "Supporting Your Keyboard in QMK Configurator". Made some minor changes to the keyboard.h examples. * Added tags object to JSON example --- docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/reference_configurator_support.md | 195 +++++++++++++++++++++++++++++++++ 3 files changed, 197 insertions(+) create mode 100644 docs/reference_configurator_support.md diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 67e81422a1..1fb5398d93 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -39,6 +39,7 @@ * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) * [Useful Functions](ref_functions.md) + * [Configurator Support](reference_configurator_support.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/_summary.md b/docs/_summary.md index 67e81422a1..1fb5398d93 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -39,6 +39,7 @@ * [Glossary](reference_glossary.md) * [Unit Testing](unit_testing.md) * [Useful Functions](ref_functions.md) + * [Configurator Support](reference_configurator_support.md) * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) diff --git a/docs/reference_configurator_support.md b/docs/reference_configurator_support.md new file mode 100644 index 0000000000..a20a6c9adb --- /dev/null +++ b/docs/reference_configurator_support.md @@ -0,0 +1,195 @@ +# Supporting Your Keyboard in QMK Configurator + +This page covers how to properly support keyboards in the [QMK Configurator](https://config.qmk.fm/). + + +## How the Configurator Understands Keyboards + +To understand how the Configurator understands keyboards, first one must understand layout macros. For this exercise, we're going to imagine a 17-key numpad PCB, which we're going to call `numpad`. + +``` +┌───┬───┬───┬───┐ +│NLk│ / │ * │ - │ +├───┼───┼───┼───┤ +│7 │8 │9 │ + │ +├───┼───┼───┤ │ +│4 │5 │6 │ │ +├───┼───┼───┼───┤ +│1 │2 │3 │Ent│ +├───┴───┼───┤ │ +│0 │ . │ │ +└───────┴───┴───┘ +``` + +?> For more on layout macros, see [Understanding QMK: Matrix Scanning](understanding_qmk.md?id=matrix-scanning) and [Understanding QMK: Matrix to Physical Layout Map](understanding_qmk.md?id=matrix-to-physical-layout-map). + +The Configurator's API reads the keyboard's `.h` file from `qmk_firmware/keyboards//.h`. For our numpad, this file would be `qmk_firmware/keyboards/numpad/numpad.h`: + +```c +#pragma once + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO }, \ + { k30, k31, k32, k33 }, \ + { k40, KC_NO, k42, KC_NO } \ +} +``` + +QMK uses `KC_NO` to designate places in the switch matrix where there is no switch. Sometimes, `XXX`, `___` or `____` are used as shorthand to make this section easier to read if it needs to be debugged. This is usually defined near the beginning of the `.h` file: + +```c +#pragma once + +#define XXX KC_NO + +#define LAYOUT( \ + k00, k01, k02, k03, \ + k10, k11, k12, k13, \ + k20, k21, k22, \ + k30, k31, k32, k33, \ + k40, k42 \ + ) { \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, XXX }, \ + { k30, k31, k32, k33 }, \ + { k40, XXX, k42, XXX } \ +} +``` + +!> This usage differs from that of keymap macros, which almost always use `XXXXXXX` (seven capital X's) for `KC_NO` and `_______` (seven underscores) for `KC_TRNS`. + +!> To prevent user confusion, using `KC_NO` is preferred. + +The layout macro tells the Configurator that our keyboard has 17 keys, arranged in five rows of four columns each. Our switch positions are named `k`, counting from 0. The names themselves actually don't matter, as long as they match between the top section, which receives the keycodes from the keymap, and the bottom half which designates where each key is in the matrix. + +To display our keyboard in a way that resembles the physical keyboard, we need to build a JSON file that tells the Configurator how to tie the physical locations and sizes of our keys to our switch matrix. + +## Building the JSON file + +To build the JSON file, the easiest way is to build the layout in [Keyboard Layout Editor](http://www.keyboard-layout-editor.com/) ("KLE"), from which we'll feed the Raw Data into a QMK tool that converts this data into a JSON the Configurator will read and use. Since KLE opens by default with a numpad layout, we're just going to remove the Getting Started instructions, and use what's left. + +Once the layout is as desired, move to the Raw Data tab in KLE, and copy the contents: + +``` +["Num Lock","/","*","-"], +["7\nHome","8\n↑","9\nPgUp",{h:2},"+"], +["4\n←","5","6\n→"], +["1\nEnd","2\n↓","3\nPgDn",{h:2},"Enter"], +[{w:2},"0\nIns",".\nDel"] +``` + +To convert this data into our JSON, go to the [QMK KLE-JSON Converter](https://qmk.fm/converter/), paste the Raw Data into the Input field, and click the Convert button. After a moment, our JSON data will appear in the Output field. Copy the contents to a new text document, and name the document `info.json`, saving it in the same folder that contains `numpad.h`. + +Use the `keyboard_name` object to set the name of the keyboard. The `bootloader` object is deprecated, so it can be deleted. For instruction purposes, we will put each key's object on its own line. This is only to make the file more human-readable, and does not affect the Configurator's functionality. + +```json +{ + "keyboard_name": "Numpad", + "url": "", + "maintainer": "qmk", + "tags": { + "form_factor": "numpad" + }, + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Num Lock", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"Enter", "x":3, "y":3, "h":2}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4} + ] + } + } +} +``` + +The `layouts` object contains the data that represents the physical layout of the keyboard. It has an object `LAYOUT`, which needs to match the name of our layout macro from `numpad.h`. The `LAYOUT` object itself has an object named `layout`, which contains one JSON object for each physical key on our keyboard, formatted as follows: + +``` + ┌ The name of the key. Not displayed in the Configurator. + │ ┌ The key's X-axis location, in key units from the + │ │ keyboard's left edge. + │ │ ┌ The key's Y-axis location, in key units from + │ │ │ the keyboard's top (rear-facing) edge. + ↓ ↓ ↓ +{"label":"Num Lock", "x":0, "y":0}, +``` + +Some objects will also have `"w"` and `"h"` keys, which represent a key's width and height, respectively. + +?> For more on the `info.json` files, see [QMK Keyboard Guidelines: Keyboard Metadata](hardware_keyboard_guidelines.md?id=keyboard-metadata) + + +## How the Configurator Programs Keys + +The Configurator's API uses the layout macro and the JSON file we've given it to create a visual representation of the keyboard that has each visual object tied to a specific key, in sequence: + +key in layout macro | JSON object used +:---: | :---- +k00 | {"label":"Num Lock", "x":0, "y":0} +k01 | {"label":"/", "x":1, "y":0} +k02 | {"label":"*", "x":2, "y":0} +k03 | {"label":"-", "x":3, "y":0} +k10 | {"label":"7", "x":0, "y":1} +k11 | {"label":"8", "x":1, "y":1} +k12 | {"label":"9", "x":2, "y":1} +k13 | {"label":"+", "x":3, "y":1, "h":2} +k20 | {"label":"4", "x":0, "y":2} +k21 | {"label":"5", "x":1, "y":2} +k22 | {"label":"6", "x":2, "y":2} +k30 | {"label":"1", "x":0, "y":3} +k31 | {"label":"2", "x":1, "y":3} +k32 | {"label":"3", "x":2, "y":3} +k33 | {"label":"Enter", "x":3, "y":3, "h":2} +k40 | {"label":"0", "x":0, "y":4, "w":2} +k42 | {"label":".", "x":2, "y":4} + +When a user selects the top-left key in the Configurator, and assigns Num Lock to it, the Configurator builds a keymap file with `KC_NLCK` as the first key, and so on as the keymap is built. The `label` keys are not used; they are only for the user's reference in identifying specific keys when debugging the `info.json` file. + + +## Issues and Hazards + +Currently, the Configurator does not support key rotation or non-rectangular key shapes like ISO Enter. Additionally, keys that are vertically-offset from their "row" — the arrow keys on 1800-layouts like the [TKC1800](https://github.com/qmk/qmk_firmware/tree/4ac48a61a66206beaf2fdd5f2939d8bbedd0004c/keyboards/tkc1800/) being a prominent example — confuse the KLE-to-JSON Converter, if not adjusted for by the contributor of the `info.json` file. + +### Workarounds + +#### Non-rectangular keys + +For ISO Enter keys, QMK custom is to display it as a rectangular key, 1.25u wide and 2u high, aligned so its right edge is aligned with the right edge of the alphanumeric key block. + +![](https://i.imgur.com/JKngtTw.png) +*A 60% keyboard in standard ISO layout, as rendered by QMK Configurator.* + +#### Vertically-offset keys + +For vertically-offset keys, place them in KLE as if they were not offset, then edit the Y-values as needed in the converted JSON file + +![](https://i.imgur.com/fmDvDzR.png) +*An 1800-layout keyboard as rendered in Keyboard Layout Editor, without the vertical offset applied to the arrow keys.* + +![](https://i.imgur.com/8beYMBR.png) +*A Unix diff file, showing the changes needed to vertically-offset the arrow keys in our keyboard's JSON file.* -- cgit v1.2.3 From daf08f40f2aeb815322d65d14a90ae56ea22953c Mon Sep 17 00:00:00 2001 From: Pekaso Date: Thu, 15 Nov 2018 11:36:53 +0900 Subject: serial.c update (#4423) --- keyboards/fortitude60/serial.c | 290 +++++++++++++++++++++++++--------- keyboards/fortitude60/serial.h | 59 ++++--- keyboards/fortitude60/serial_config.h | 8 +- 3 files changed, 254 insertions(+), 103 deletions(-) diff --git a/keyboards/fortitude60/serial.c b/keyboards/fortitude60/serial.c index cea1a5f6ca..6006ebf1bd 100644 --- a/keyboards/fortitude60/serial.c +++ b/keyboards/fortitude60/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -14,10 +19,60 @@ #include "serial.h" //#include -#ifdef USE_SERIAL +#ifdef SOFT_SERIAL_PIN -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ #if SERIAL_SLAVE_BUFFER_LENGTH > 0 uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; #endif @@ -42,56 +97,118 @@ SSTD_t transactions[] = { }; void serial_master_init(void) -{ soft_serial_initiator_init(transactions); } +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } void serial_slave_init(void) -{ soft_serial_target_init(transactions); } +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } // 0 => no error // 1 => slave did not respond // 2 => checksum error int serial_update_buffers() -{ return soft_serial_transaction(); } +{ + int result; + result = soft_serial_transaction(); + return result; +} -#endif // Simple API (OLD API, compatible with let's split serial.c) +#endif // end of OLD API (compatible with let's split serial.c) +//////////////////////////////////////////////////////////////////////////// #define ALWAYS_INLINE __attribute__((always_inline)) #define NO_INLINE __attribute__((noinline)) #define _delay_sub_us(x) __builtin_avr_delay_cycles(x) -// Serial pulse period in microseconds. -#define TID_SEND_ADJUST 14 +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -#define SELECT_SERIAL_SPEED 1 -#if SELECT_SERIAL_SPEED == 0 +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif + +#if SELECT_SOFT_SERIAL_SPEED == 0 // Very High speed #define SERIAL_DELAY 4 // micro sec - #define READ_WRITE_START_ADJUST 33 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 1 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 // High speed #define SERIAL_DELAY 6 // micro sec - #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 2 + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 // Middle speed #define SERIAL_DELAY 12 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 3 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 // Low speed #define SERIAL_DELAY 24 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles -#elif SELECT_SERIAL_SPEED == 4 + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 // Very Low speed - #define SERIAL_DELAY 50 // micro sec + #define SERIAL_DELAY 36 // micro sec #define READ_WRITE_START_ADJUST 30 // cycles - #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif #else -#error Illegal Serial Speed -#endif - +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ #define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) #define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) @@ -105,17 +222,21 @@ int serial_update_buffers() #endif static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; inline static void serial_delay_half1(void) { _delay_us(SERIAL_DELAY_HALF1); } +inline static void serial_delay_half2(void) ALWAYS_INLINE; inline static void serial_delay_half2(void) { _delay_us(SERIAL_DELAY_HALF2); @@ -135,6 +256,7 @@ void serial_input_with_pullup(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); @@ -152,30 +274,28 @@ void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void soft_serial_initiator_init(SSTD_t *sstd_table) +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_output(); serial_high(); } -void soft_serial_target_init(SSTD_t *sstd_table) +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) { Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; serial_input_with_pullup(); -#if SERIAL_PIN_MASK == _BV(PD0) - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -#elif SERIAL_PIN_MASK == _BV(PD2) - // Enable INT2 - EIMSK |= _BV(INT2); - // Trigger on falling edge of INT2 - EICRA &= ~(_BV(ISC20) | _BV(ISC21)); + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; #else - #error unknown SERIAL_PIN_MASK value + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; #endif } @@ -191,7 +311,7 @@ void sync_recv(void) { } // Used by the reciver to send a synchronization signal to the sender. -static void sync_send(void)NO_INLINE; +static void sync_send(void) NO_INLINE; static void sync_send(void) { serial_low(); @@ -205,12 +325,12 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { uint8_t byte, i, p, pb; _delay_sub_us(READ_WRITE_START_ADJUST); - for( i = 0, byte = 0, p = 0; i < bit; i++ ) { + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { serial_delay_half1(); // read the middle of pulses if( serial_read_pin() ) { - byte = (byte << 1) | 1; p ^= 1; + byte = (byte << 1) | 1; p ^= 1; } else { - byte = (byte << 1) | 0; p ^= 0; + byte = (byte << 1) | 0; p ^= 0; } _delay_sub_us(READ_WRITE_WIDTH_ADJUST); serial_delay_half2(); @@ -230,13 +350,13 @@ static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; void serial_write_chunk(uint8_t data, uint8_t bit) { uint8_t b, p; - for( p = 0, b = 1<<(bit-1); b ; b >>= 1) { - if(data & b) { - serial_high(); p ^= 1; - } else { - serial_low(); p ^= 0; - } - serial_delay(); + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } /* send parity bit */ if(p & 1) { serial_high(); } @@ -288,6 +408,13 @@ void change_reciver2sender(void) { serial_delay_half1(); //4 } +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + // interrupt handle to be used by the target device ISR(SERIAL_PIN_INTERRUPT) { @@ -297,12 +424,15 @@ ISR(SERIAL_PIN_INTERRUPT) { SSTD_t *trans = Transaction_table; #else // recive transaction table index - uint8_t tid; + uint8_t tid, bits; uint8_t pecount = 0; sync_recv(); - tid = serial_read_chunk(&pecount,4); - if(pecount> 0) + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { return; + } serial_delay_half1(); serial_high(); // response step1 low->high @@ -315,17 +445,17 @@ ISR(SERIAL_PIN_INTERRUPT) { // target send phase if( trans->target2initiator_buffer_size > 0 ) serial_send_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size); + trans->target2initiator_buffer_size); // target switch to input change_sender2reciver(); // target recive phase if( trans->initiator2target_buffer_size > 0 ) { if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size) ) { - *trans->status = TRANSACTION_ACCEPTED; + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; } else { - *trans->status = TRANSACTION_DATA_ERROR; + *trans->status = TRANSACTION_DATA_ERROR; } } else { *trans->status = TRANSACTION_ACCEPTED; @@ -349,6 +479,8 @@ int soft_serial_transaction(void) { SSTD_t *trans = Transaction_table; #else int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; SSTD_t *trans = &Transaction_table[sstd_index]; #endif cli(); @@ -375,9 +507,10 @@ int soft_serial_transaction(int sstd_index) { #else // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); sync_send(); _delay_sub_us(TID_SEND_ADJUST); - serial_write_chunk(sstd_index, 4); + serial_write_chunk(tid, 7); serial_delay_half1(); // wait for the target response (step1 low->high) @@ -389,12 +522,12 @@ int soft_serial_transaction(int sstd_index) { // check if the target is present (step2 high->low) for( int i = 0; serial_read_pin(); i++ ) { if (i > SLAVE_INT_ACK_WIDTH + 1) { - // slave failed to pull the line low, assume not present - serial_output(); - serial_high(); - *trans->status = TRANSACTION_NO_RESPONSE; - sei(); - return TRANSACTION_NO_RESPONSE; + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; } _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } @@ -404,12 +537,12 @@ int soft_serial_transaction(int sstd_index) { // if the target is present syncronize with it if( trans->target2initiator_buffer_size > 0 ) { if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, - trans->target2initiator_buffer_size) ) { - serial_output(); - serial_high(); - *trans->status = TRANSACTION_DATA_ERROR; - sei(); - return TRANSACTION_DATA_ERROR; + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; } } @@ -419,7 +552,7 @@ int soft_serial_transaction(int sstd_index) { // initiator send phase if( trans->initiator2target_buffer_size > 0 ) { serial_send_packet((uint8_t *)trans->initiator2target_buffer, - trans->initiator2target_buffer_size); + trans->initiator2target_buffer_size); } // always, release the line when not in use @@ -441,4 +574,17 @@ int soft_serial_get_and_clean_status(int sstd_index) { } #endif -#endif \ No newline at end of file +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) diff --git a/keyboards/fortitude60/serial.h b/keyboards/fortitude60/serial.h index d008980556..2e53928df2 100644 --- a/keyboards/fortitude60/serial.h +++ b/keyboards/fortitude60/serial.h @@ -4,40 +4,47 @@ #include // ///////////////////////////////////////////////////////////////// -// Need Soft Serial defines in serial_config.h +// Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// #define SERIAL_PIN_DDR DDRD -// #define SERIAL_PIN_PORT PORTD -// #define SERIAL_PIN_INPUT PIND -// #define SERIAL_PIN_MASK _BV(PD?) ?=0,2 -// #define SERIAL_PIN_INTERRUPT INT?_vect ?=0,2 +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // -// //// USE Simple API (OLD API, compatible with let's split serial.c) +// //// USE OLD API (compatible with let's split serial.c) // ex. // #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 // #define SERIAL_MASTER_BUFFER_LENGTH 1 // -// //// USE flexible API (using multi-type transaction function) -// #define SERIAL_USE_MULTI_TRANSACTION +// //// USE NEW API +// //// USE simple API (using signle-type transaction function) +// #define SERIAL_USE_SINGLE_TRANSACTION +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION // // ///////////////////////////////////////////////////////////////// -#ifndef SERIAL_USE_MULTI_TRANSACTION -/* --- USE Simple API (OLD API, compatible with let's split serial.c) */ -#if SERIAL_SLAVE_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -#endif -#if SERIAL_MASTER_BUFFER_LENGTH > 0 -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; -#endif +//////////////// for backward compatibility //////////////////////////////// +#if !defined(SERIAL_USE_SINGLE_TRANSACTION) && !defined(SERIAL_USE_MULTI_TRANSACTION) +/* --- USE OLD API (compatible with let's split serial.c) */ + #if SERIAL_SLAVE_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; + #endif + #if SERIAL_MASTER_BUFFER_LENGTH > 0 + extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + #endif -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); + void serial_master_init(void); + void serial_slave_init(void); + int serial_update_buffers(void); -#endif // USE Simple API +#endif // end of USE OLD API +//////////////////////////////////////////////////////////////////////////// // Soft Serial Transaction Descriptor typedef struct _SSTD_t { @@ -47,16 +54,18 @@ typedef struct _SSTD_t { uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) // initiator is transaction start side -void soft_serial_initiator_init(SSTD_t *sstd_table); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); // target is interrupt accept side -void soft_serial_target_init(SSTD_t *sstd_table); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); // initiator resullt #define TRANSACTION_END 0 #define TRANSACTION_NO_RESPONSE 0x1 #define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 #ifndef SERIAL_USE_MULTI_TRANSACTION int soft_serial_transaction(void); #else @@ -72,9 +81,9 @@ int soft_serial_transaction(int sstd_index); // target: // TRANSACTION_DATA_ERROR // or TRANSACTION_ACCEPTED -#define TRANSACTION_ACCEPTED 0x4 +#define TRANSACTION_ACCEPTED 0x8 #ifdef SERIAL_USE_MULTI_TRANSACTION int soft_serial_get_and_clean_status(int sstd_index); #endif -#endif /* SOFT_SERIAL_H */ \ No newline at end of file +#endif /* SOFT_SERIAL_H */ diff --git a/keyboards/fortitude60/serial_config.h b/keyboards/fortitude60/serial_config.h index 96a54afbd8..d4a42bce38 100644 --- a/keyboards/fortitude60/serial_config.h +++ b/keyboards/fortitude60/serial_config.h @@ -2,13 +2,9 @@ #define SOFT_SERIAL_CONFIG_H /* Soft Serial defines */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD2) -#define SERIAL_PIN_INTERRUPT INT2_vect +#define SOFT_SERIAL_PIN D2 #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 #define SERIAL_MASTER_BUFFER_LENGTH 1 -#endif /* SOFT_SERIAL_CONFIG_H */ \ No newline at end of file +#endif /* SOFT_SERIAL_CONFIG_H */ -- cgit v1.2.3 From 46cf8cc9b33a3c8bdbb0ce7df7f48f28e4d979a5 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Wed, 14 Nov 2018 18:37:53 -0800 Subject: Configurator support for Octagon V2 75_ansi (#4426) --- keyboards/duck/octagon/v2/info.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/keyboards/duck/octagon/v2/info.json b/keyboards/duck/octagon/v2/info.json index 7bc0c6ef90..11bde45a5d 100644 --- a/keyboards/duck/octagon/v2/info.json +++ b/keyboards/duck/octagon/v2/info.json @@ -1,12 +1,16 @@ { - "keyboard_name": "Octagon V2", - "url": "", - "maintainer": "qmk", - "width": 16, - "height": 6, + "keyboard_name": "Octagon V2", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, "layouts": { "LAYOUT": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"F1", "x":1, "y":0}, {"label":"F2", "x":2, "y":0}, {"label":"F3", "x":3, "y":0}, {"label":"F4", "x":4, "y":0}, {"label":"F5", "x":5, "y":0}, {"label":"F6", "x":6, "y":0}, {"label":"F7", "x":7, "y":0}, {"label":"F8", "x":8, "y":0}, {"label":"F9", "x":9, "y":0}, {"label":"F10", "x":10, "y":0}, {"label":"F11", "x":11, "y":0}, {"label":"F12", "x":12, "y":0}, {"label":"PrtSc", "x":13, "y":0}, {"label":"Pause", "x":14, "y":0}, {"label":"Delete", "x":15, "y":0}, {"label":"~", "x":0, "y":1}, {"label":"!", "x":1, "y":1}, {"label":"@", "x":2, "y":1}, {"label":"#", "x":3, "y":1}, {"label":"$", "x":4, "y":1}, {"label":"%", "x":5, "y":1}, {"label":"^", "x":6, "y":1}, {"label":"&", "x":7, "y":1}, {"label":"*", "x":8, "y":1}, {"label":"(", "x":9, "y":1}, {"label":")", "x":10, "y":1}, {"label":"_", "x":11, "y":1}, {"label":"+", "x":12, "y":1}, {"label":"Backspace", "x":13, "y":1, "w":2}, {"label":"Home", "x":15, "y":1}, {"label":"Tab", "x":0, "y":2, "w":1.5}, {"label":"Q", "x":1.5, "y":2}, {"label":"W", "x":2.5, "y":2}, {"label":"E", "x":3.5, "y":2}, {"label":"R", "x":4.5, "y":2}, {"label":"T", "x":5.5, "y":2}, {"label":"Y", "x":6.5, "y":2}, {"label":"U", "x":7.5, "y":2}, {"label":"I", "x":8.5, "y":2}, {"label":"O", "x":9.5, "y":2}, {"label":"P", "x":10.5, "y":2}, {"label":"{", "x":11.5, "y":2}, {"label":"}", "x":12.5, "y":2}, {"label":"|", "x":13.5, "y":2, "w":1.5}, {"label":"Page Up", "x":15, "y":2}, {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, {"label":"A", "x":1.75, "y":3}, {"label":"S", "x":2.75, "y":3}, {"label":"D", "x":3.75, "y":3}, {"label":"F", "x":4.75, "y":3}, {"label":"G", "x":5.75, "y":3}, {"label":"H", "x":6.75, "y":3}, {"label":"J", "x":7.75, "y":3}, {"label":"K", "x":8.75, "y":3}, {"label":"L", "x":9.75, "y":3}, {"label":":", "x":10.75, "y":3}, {"label":"\"", "x":11.75, "y":3}, {"x":12.75, "y":3}, {"label":"Enter", "x":13.75, "y":3, "w":1.25}, {"label":"Page Down", "x":15, "y":3}, {"label":"Shift", "x":0, "y":4, "w":1.25}, {"x":1.25, "y":4}, {"label":"Z", "x":2.25, "y":4}, {"label":"X", "x":3.25, "y":4}, {"label":"C", "x":4.25, "y":4}, {"label":"V", "x":5.25, "y":4}, {"label":"B", "x":6.25, "y":4}, {"label":"N", "x":7.25, "y":4}, {"label":"M", "x":8.25, "y":4}, {"label":"<", "x":9.25, "y":4}, {"label":">", "x":10.25, "y":4}, {"label":"?", "x":11.25, "y":4}, {"label":"Shift", "x":12.25, "y":4, "w":1.75}, {"label":"\u2191", "x":14, "y":4}, {"label":"End", "x":15, "y":4}, {"label":"Ctrl", "x":0, "y":5, "w":1.25}, {"label":"Win", "x":1.25, "y":5, "w":1.25}, {"label":"Alt", "x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"label":"Alt", "x":10, "y":5}, {"label":"Fn", "x":11, "y":5}, {"label":"Ctrl", "x":12, "y":5}, {"label":"\u2190", "x":13, "y":5}, {"label":"\u2193", "x":14, "y":5}, {"label":"\u2192", "x":15, "y":5}] + }, + + "LAYOUT_75_ansi": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1, "w":2}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.5}, {"x":1.5, "y":2}, {"x":2.5, "y":2}, {"x":3.5, "y":2}, {"x":4.5, "y":2}, {"x":5.5, "y":2}, {"x":6.5, "y":2}, {"x":7.5, "y":2}, {"x":8.5, "y":2}, {"x":9.5, "y":2}, {"x":10.5, "y":2}, {"x":11.5, "y":2}, {"x":12.5, "y":2}, {"x":13.5, "y":2, "w":1.5}, {"x":15, "y":2}, {"x":0, "y":3, "w":1.75}, {"x":1.75, "y":3}, {"x":2.75, "y":3}, {"x":3.75, "y":3}, {"x":4.75, "y":3}, {"x":5.75, "y":3}, {"x":6.75, "y":3}, {"x":7.75, "y":3}, {"x":8.75, "y":3}, {"x":9.75, "y":3}, {"x":10.75, "y":3}, {"x":11.75, "y":3}, {"x":12.75, "y":3, "w":2.25}, {"x":15, "y":3}, {"x":0, "y":4, "w":2.25}, {"x":2.25, "y":4}, {"x":3.25, "y":4}, {"x":4.25, "y":4}, {"x":5.25, "y":4}, {"x":6.25, "y":4}, {"x":7.25, "y":4}, {"x":8.25, "y":4}, {"x":9.25, "y":4}, {"x":10.25, "y":4}, {"x":11.25, "y":4}, {"x":12.25, "y":4, "w":1.75}, {"x":14, "y":4}, {"x":15, "y":4}, {"x":0, "y":5, "w":1.25}, {"x":1.25, "y":5, "w":1.25}, {"x":2.5, "y":5, "w":1.25}, {"x":3.75, "y":5, "w":6.25}, {"x":10, "y":5}, {"x":11, "y":5}, {"x":12, "y":5}, {"x":13, "y":5}, {"x":14, "y":5}, {"x":15, "y":5}] } } } -- cgit v1.2.3 From 39bd760faf2666e91d6dc5b199f02fa3206c6acd Mon Sep 17 00:00:00 2001 From: James Laird-Wah Date: Fri, 16 Nov 2018 17:22:05 +1100 Subject: Use a single endpoint for HID reports (#3951) * Unify multiple HID interfaces into one This reduces the number of USB endpoints required, which frees them up for other things. NKRO and EXTRAKEY always use the shared endpoint. By default, MOUSEKEY also uses it. This means it won't work as a Boot Procotol mouse in some BIOSes, etc. If you really think your keyboard needs to work as a mouse in your BIOS, set MOUSE_SHARED_EP = no in your rules.mk. By default, the core keyboard does not use the shared endpoint, as not all BIOSes are standards compliant and that's one place you don't want to find out your keyboard doesn't work.. If you are really confident, you can set KEYBOARD_SHARED_EP = yes to use the shared endpoint here too. * unify endpoints: ChibiOS protocol implementation * fixup: missing #ifdef EXTRAKEY_ENABLEs broke build on AVR with EXTRAKEY disabled * endpoints: restore error when too many endpoints required * lufa: wait up to 10ms to send keyboard input This avoids packets being dropped when two reports are sent in quick succession (eg. releasing a dual role key). * endpoints: fix compile on ARM_ATSAM * endpoint: ARM_ATSAM fixes No longer use wrong or unexpected endpoint IDs * endpoints: accommodate VUSB protocol V-USB has its own, understandably simple ideas about the report formats. It already blasts the mouse and extrakeys through one endpoint with report IDs. We just stay out of its way. * endpoints: document new endpoint configuration options * endpoints: respect keyboard_report->mods in NKRO The caller(s) of host_keyboard_send expect to be able to just drop modifiers in the mods field and not worry about whether NKRO is in use. This is a good thing. So we just shift it over if needs be. * endpoints: report.c: update for new keyboard_report format --- docs/config_options.md | 29 ++++ tmk_core/common.mk | 21 +++ tmk_core/common/host.c | 22 +++ tmk_core/common/report.c | 21 ++- tmk_core/common/report.h | 46 ++++-- tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c | 5 +- tmk_core/protocol/chibios/usb_main.c | 176 ++++++++++----------- tmk_core/protocol/chibios/usb_main.h | 11 +- tmk_core/protocol/lufa/lufa.c | 92 ++++++----- tmk_core/protocol/usb_descriptor.c | 213 ++++++++++++-------------- tmk_core/protocol/usb_descriptor.h | 170 ++++++++------------ 11 files changed, 426 insertions(+), 380 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index c4921c21d7..b811fa877d 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -261,3 +261,32 @@ Use these to enable or disable building certain features. The more you have enab * Forces the keyboard to wait for a USB connection to be established before it starts up * `NO_USB_STARTUP_CHECK` * Disables usb suspend check after keyboard startup. Usually the keyboard waits for the host to wake it up before any tasks are performed. This is useful for split keyboards as one half will not get a wakeup call but must send commands to the master. + +## USB Endpoint Limitations + +In order to provide services over USB, QMK has to use USB endpoints. +These are a finite resource: each microcontroller has only a certain number. +This limits what features can be enabled together. +If the available endpoints are exceeded, a build error is thrown. + +The following features can require separate endpoints: + +* `MOUSEKEY_ENABLE` +* `EXTRAKEY_ENABLE` +* `CONSOLE_ENABLE` +* `NKRO_ENABLE` +* `MIDI_ENABLE` +* `RAW_ENABLE` +* `VIRTSER_ENABLE` + +In order to improve utilisation of the endpoints, the HID features can be combined to use a single endpoint. +By default, `MOUSEKEY`, `EXTRAKEY`, and `NKRO` are combined into a single endpoint. + +The base keyboard functionality can also be combined into the endpoint, +by setting `KEYBOARD_SHARED_EP = yes`. +This frees up one more endpoint, +but it can prevent the keyboard working in some BIOSes, +as they do not implement Boot Keyboard protocol switching. + +Combining the mouse also breaks Boot Mouse compatibility. +The mouse can be uncombined by setting `MOUSE_SHARED_EP = no` if this functionality is required. diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 8eac1734f4..063115acb1 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -82,15 +82,31 @@ else TMK_COMMON_SRC += $(COMMON_DIR)/magic.c endif +SHARED_EP_ENABLE = no +MOUSE_SHARED_EP ?= yes +ifeq ($(strip $(KEYBOARD_SHARED_EP)), yes) + TMK_COMMON_DEFS += -DKEYBOARD_SHARED_EP + SHARED_EP_ENABLE = yes + # With the current usb_descriptor.c code, + # you can't share kbd without sharing mouse; + # that would be a very unexpected use case anyway + MOUSE_SHARED_EP = yes +endif ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) TMK_COMMON_SRC += $(COMMON_DIR)/mousekey.c TMK_COMMON_DEFS += -DMOUSEKEY_ENABLE TMK_COMMON_DEFS += -DMOUSE_ENABLE + + ifeq ($(strip $(MOUSE_SHARED_EP)), yes) + TMK_COMMON_DEFS += -DMOUSE_SHARED_EP + SHARED_EP_ENABLE = yes + endif endif ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) TMK_COMMON_DEFS += -DEXTRAKEY_ENABLE + SHARED_EP_ENABLE = yes endif ifeq ($(strip $(RAW_ENABLE)), yes) @@ -111,6 +127,7 @@ endif ifeq ($(strip $(NKRO_ENABLE)), yes) TMK_COMMON_DEFS += -DNKRO_ENABLE + SHARED_EP_ENABLE = yes endif ifeq ($(strip $(USB_6KRO_ENABLE)), yes) @@ -182,6 +199,10 @@ ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) endif endif +ifeq ($(strip $(SHARED_EP_ENABLE)), yes) + TMK_COMMON_DEFS += -DSHARED_EP_ENABLE +endif + # Bootloader address ifdef STM32_BOOTLOADER_ADDRESS TMK_COMMON_DEFS += -DSTM32_BOOTLOADER_ADDRESS=$(STM32_BOOTLOADER_ADDRESS) diff --git a/tmk_core/common/host.c b/tmk_core/common/host.c index e12b622165..f5d0416996 100644 --- a/tmk_core/common/host.c +++ b/tmk_core/common/host.c @@ -22,6 +22,11 @@ along with this program. If not, see . #include "util.h" #include "debug.h" +#ifdef NKRO_ENABLE + #include "keycode_config.h" + extern keymap_config_t keymap_config; +#endif + static host_driver_t *driver; static uint16_t last_system_report = 0; static uint16_t last_consumer_report = 0; @@ -46,6 +51,20 @@ uint8_t host_keyboard_leds(void) void host_keyboard_send(report_keyboard_t *report) { if (!driver) return; +#if defined(NKRO_ENABLE) && defined(NKRO_SHARED_EP) + if (keyboard_protocol && keymap_config.nkro) { + /* The callers of this function assume that report->mods is where mods go in. + * But report->nkro.mods can be at a different offset if core keyboard does not have a report ID. + */ + report->nkro.mods = report->mods; + report->nkro.report_id = REPORT_ID_NKRO; + } else +#endif + { +#ifdef KEYBOARD_SHARED_EP + report->report_id = REPORT_ID_KEYBOARD; +#endif + } (*driver->send_keyboard)(report); if (debug_keyboard) { @@ -60,6 +79,9 @@ void host_keyboard_send(report_keyboard_t *report) void host_mouse_send(report_mouse_t *report) { if (!driver) return; +#ifdef MOUSE_SHARED_EP + report->report_id = REPORT_ID_MOUSE; +#endif (*driver->send_mouse)(report); } diff --git a/tmk_core/common/report.c b/tmk_core/common/report.c index eb3b44312f..6a06b70c60 100644 --- a/tmk_core/common/report.c +++ b/tmk_core/common/report.c @@ -19,6 +19,7 @@ #include "keycode_config.h" #include "debug.h" #include "util.h" +#include /** \brief has_anykey * @@ -27,8 +28,16 @@ uint8_t has_anykey(report_keyboard_t* keyboard_report) { uint8_t cnt = 0; - for (uint8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { - if (keyboard_report->raw[i]) + uint8_t *p = keyboard_report->keys; + uint8_t lp = sizeof(keyboard_report->keys); +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + p = keyboard_report->nkro.bits; + lp = sizeof(keyboard_report->nkro.bits); + } +#endif + while (lp--) { + if (*p++) cnt++; } return cnt; @@ -237,7 +246,11 @@ void del_key_from_report(report_keyboard_t* keyboard_report, uint8_t key) void clear_keys_from_report(report_keyboard_t* keyboard_report) { // not clear mods - for (int8_t i = 1; i < KEYBOARD_REPORT_SIZE; i++) { - keyboard_report->raw[i] = 0; +#ifdef NKRO_ENABLE + if (keyboard_protocol && keymap_config.nkro) { + memset(keyboard_report->nkro.bits, 0, sizeof(keyboard_report->nkro.bits)); + return; } +#endif + memset(keyboard_report->keys, 0, sizeof(keyboard_report->keys)); } diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 167f382751..5a1a6b19c7 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -23,9 +23,11 @@ along with this program. If not, see . /* report id */ -#define REPORT_ID_MOUSE 1 -#define REPORT_ID_SYSTEM 2 -#define REPORT_ID_CONSUMER 3 +#define REPORT_ID_KEYBOARD 1 +#define REPORT_ID_MOUSE 2 +#define REPORT_ID_SYSTEM 3 +#define REPORT_ID_CONSUMER 4 +#define REPORT_ID_NKRO 5 /* mouse buttons */ #define MOUSE_BTN1 (1<<0) @@ -72,32 +74,35 @@ along with this program. If not, see . #define SYSTEM_WAKE_UP 0x0083 +#define NKRO_SHARED_EP /* key report size(NKRO or boot mode) */ #if defined(NKRO_ENABLE) - #if defined(PROTOCOL_PJRC) - #include "usb.h" - #define KEYBOARD_REPORT_SIZE KBD2_SIZE - #define KEYBOARD_REPORT_KEYS (KBD2_SIZE - 2) - #define KEYBOARD_REPORT_BITS (KBD2_SIZE - 1) - #elif defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) + #if defined(PROTOCOL_LUFA) || defined(PROTOCOL_CHIBIOS) #include "protocol/usb_descriptor.h" - #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE - #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) - #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #define KEYBOARD_REPORT_BITS (SHARED_EPSIZE - 2) #elif defined(PROTOCOL_ARM_ATSAM) #include "protocol/arm_atsam/usb/udi_device_epsize.h" - #define KEYBOARD_REPORT_SIZE NKRO_EPSIZE - #define KEYBOARD_REPORT_KEYS (NKRO_EPSIZE - 2) #define KEYBOARD_REPORT_BITS (NKRO_EPSIZE - 1) + #undef NKRO_SHARED_EP + #undef MOUSE_SHARED_EP #else #error "NKRO not supported with this protocol" + #endif #endif +#ifdef KEYBOARD_SHARED_EP +# define KEYBOARD_REPORT_SIZE 9 #else # define KEYBOARD_REPORT_SIZE 8 -# define KEYBOARD_REPORT_KEYS 6 #endif +#define KEYBOARD_REPORT_KEYS 6 + +/* VUSB hardcodes keyboard and mouse+extrakey only */ +#if defined(PROTOCOL_VUSB) + #undef KEYBOARD_SHARED_EP + #undef MOUSE_SHARED_EP +#endif #ifdef __cplusplus extern "C" { @@ -126,12 +131,18 @@ extern "C" { typedef union { uint8_t raw[KEYBOARD_REPORT_SIZE]; struct { +#ifdef KEYBOARD_SHARED_EP + uint8_t report_id; +#endif uint8_t mods; uint8_t reserved; uint8_t keys[KEYBOARD_REPORT_KEYS]; }; #ifdef NKRO_ENABLE - struct { + struct nkro_report { +#ifdef NKRO_SHARED_EP + uint8_t report_id; +#endif uint8_t mods; uint8_t bits[KEYBOARD_REPORT_BITS]; } nkro; @@ -139,6 +150,9 @@ typedef union { } __attribute__ ((packed)) report_keyboard_t; typedef struct { +#ifdef MOUSE_SHARED_EP + uint8_t report_id; +#endif uint8_t buttons; int8_t x; int8_t y; diff --git a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c index 18f9784ae6..c263ac4aa1 100644 --- a/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c +++ b/tmk_core/protocol/arm_atsam/usb/udi_hid_kbd.c @@ -54,6 +54,7 @@ #include "udi_hid.h" #include "udi_hid_kbd.h" #include +#include "report.h" //*************************************************************************** // KBD @@ -430,7 +431,7 @@ UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = { 0x05, 0x01, // Usage Page (Generic Desktop), 0x09, 0x80, // Usage (System Control), 0xA1, 0x01, // Collection (Application), - 0x85, 0x02, // Report ID (2) (System), + 0x85, REPORT_ID_SYSTEM, // Report ID (2) (System), 0x16, 0x01, 0x00, // Logical Minimum (1), 0x26, 0x03, 0x00, // Logical Maximum (3), 0x1A, 0x81, 0x00, // Usage Minimum (81) (System Power Down), @@ -445,7 +446,7 @@ UDC_DESC_STORAGE udi_hid_exk_report_desc_t udi_hid_exk_report_desc = { 0x05, 0x0C, // Usage Page (Consumer), 0x09, 0x01, // Usage (Consumer Control), 0xA1, 0x01, // Collection (Application), - 0x85, 0x03, // Report ID (3) (Consumer), + 0x85, REPORT_ID_CONSUMER, // Report ID (3) (Consumer), 0x16, 0x01, 0x00, // Logical Minimum (1), 0x26, 0x9C, 0x02, // Logical Maximum (668), 0x1A, 0x01, 0x00, // Usage Minimum (1), diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 71892c4f49..3028e7ea2a 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -95,6 +95,7 @@ static const USBDescriptor *usb_get_descriptor_cb(USBDriver *usbp, uint8_t dtype return &desc; } +#ifndef KEYBOARD_SHARED_EP /* keyboard endpoint state structure */ static USBInEndpointState kbd_ep_state; /* keyboard endpoint initialization structure (IN) */ @@ -110,8 +111,9 @@ static const USBEndpointConfig kbd_ep_config = { 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) /* mouse endpoint state structure */ static USBInEndpointState mouse_ep_state; @@ -128,45 +130,26 @@ static const USBEndpointConfig mouse_ep_config = { 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; -#endif /* MOUSE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE -/* extrakey endpoint state structure */ -static USBInEndpointState extra_ep_state; - -/* extrakey endpoint initialization structure (IN) */ -static const USBEndpointConfig extra_ep_config = { - USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ - NULL, /* SETUP packet notification callback */ - extra_in_cb, /* IN notification callback */ - NULL, /* OUT notification callback */ - EXTRAKEY_EPSIZE, /* IN maximum packet size */ - 0, /* OUT maximum packet size */ - &extra_ep_state, /* IN Endpoint state */ - NULL, /* OUT endpoint state */ - 2, /* IN multiplier */ - NULL /* SETUP buffer (not a SETUP endpoint) */ -}; -#endif /* EXTRAKEY_ENABLE */ +#endif -#ifdef NKRO_ENABLE -/* nkro endpoint state structure */ -static USBInEndpointState nkro_ep_state; +#ifdef SHARED_EP_ENABLE +/* shared endpoint state structure */ +static USBInEndpointState shared_ep_state; -/* nkro endpoint initialization structure (IN) */ -static const USBEndpointConfig nkro_ep_config = { +/* shared endpoint initialization structure (IN) */ +static const USBEndpointConfig shared_ep_config = { USB_EP_MODE_TYPE_INTR, /* Interrupt EP */ NULL, /* SETUP packet notification callback */ - nkro_in_cb, /* IN notification callback */ + shared_in_cb, /* IN notification callback */ NULL, /* OUT notification callback */ - NKRO_EPSIZE, /* IN maximum packet size */ + SHARED_EPSIZE, /* IN maximum packet size */ 0, /* OUT maximum packet size */ - &nkro_ep_state, /* IN Endpoint state */ + &shared_ep_state, /* IN Endpoint state */ NULL, /* OUT endpoint state */ 2, /* IN multiplier */ NULL /* SETUP buffer (not a SETUP endpoint) */ }; -#endif /* NKRO_ENABLE */ +#endif typedef struct { size_t queue_capacity_in; @@ -309,16 +292,15 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) { case USB_EVENT_CONFIGURED: osalSysLockFromISR(); /* Enable the endpoints specified into the configuration. */ +#ifndef KEYBOARD_SHARED_EP usbInitEndpointI(usbp, KEYBOARD_IN_EPNUM, &kbd_ep_config); -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) usbInitEndpointI(usbp, MOUSE_IN_EPNUM, &mouse_ep_config); -#endif /* MOUSE_ENABLE */ -#ifdef EXTRAKEY_ENABLE - usbInitEndpointI(usbp, EXTRAKEY_IN_EPNUM, &extra_ep_config); -#endif /* EXTRAKEY_ENABLE */ -#ifdef NKRO_ENABLE - usbInitEndpointI(usbp, NKRO_IN_EPNUM, &nkro_ep_config); -#endif /* NKRO_ENABLE */ +#endif +#ifdef SHARED_EP_ENABLE + usbInitEndpointI(usbp, SHARED_IN_EPNUM, &shared_ep_config); +#endif for (int i=0;isetup fields: * 0: bmRequestType (bitmask) @@ -409,42 +402,16 @@ static bool usb_request_hook_cb(USBDriver *usbp) { case HID_GET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0?) */ case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: -#endif /* NKRO_ENABLE */ usbSetupTransfer(usbp, (uint8_t *)&keyboard_report_sent, sizeof(keyboard_report_sent), NULL); return TRUE; break; -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: usbSetupTransfer(usbp, (uint8_t *)&mouse_report_blank, sizeof(mouse_report_blank), NULL); return TRUE; break; -#endif /* MOUSE_ENABLE */ - -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - if(usbp->setup[3] == 1) { /* MSB(wValue) [Report Type] == 1 [Input Report] */ - switch(usbp->setup[2]) { /* LSB(wValue) [Report ID] */ - case REPORT_ID_SYSTEM: - extra_report_blank[0] = REPORT_ID_SYSTEM; - usbSetupTransfer(usbp, (uint8_t *)extra_report_blank, sizeof(extra_report_blank), NULL); - return TRUE; - break; - case REPORT_ID_CONSUMER: - extra_report_blank[0] = REPORT_ID_CONSUMER; - usbSetupTransfer(usbp, (uint8_t *)extra_report_blank, sizeof(extra_report_blank), NULL); - return TRUE; - break; - default: - return FALSE; - } - } else { - return FALSE; - } - break; -#endif /* EXTRAKEY_ENABLE */ +#endif default: usbSetupTransfer(usbp, NULL, 0, NULL); @@ -472,12 +439,25 @@ static bool usb_request_hook_cb(USBDriver *usbp) { case HID_SET_REPORT: switch(usbp->setup[4]) { /* LSB(wIndex) (check MSB==0 and wLength==1?) */ case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: -#endif /* NKRO_ENABLE */ +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) + case SHARED_INTERFACE: +#endif /* keyboard_led_stats = * keyboard_led_stats needs be word (or dword), otherwise we get an exception on F0 */ - usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL); + has_report_id = 0; +#if defined(SHARED_EP_ENABLE) + if (usbp->setup[4] == SHARED_INTERFACE) { + has_report_id = 1; + } +#endif + if (usbp->setup[4] == KEYBOARD_INTERFACE && !keyboard_protocol) { + has_report_id = 0; + } + if (has_report_id) { + usbSetupTransfer(usbp, set_report_buf, sizeof(set_report_buf), set_led_transfer_cb); + } else { + usbSetupTransfer(usbp, (uint8_t *)&keyboard_led_stats, 1, NULL); + } return TRUE; break; } @@ -591,20 +571,13 @@ void init_usb_driver(USBDriver *usbp) { * --------------------------------------------------------- */ /* keyboard IN callback hander (a kbd report has made it IN) */ +#ifndef KEYBOARD_SHARED_EP void kbd_in_cb(USBDriver *usbp, usbep_t ep) { /* STUB */ (void)usbp; (void)ep; } - -#ifdef NKRO_ENABLE -/* nkro IN callback hander (a nkro report has made it IN) */ -void nkro_in_cb(USBDriver *usbp, usbep_t ep) { - /* STUB */ - (void)usbp; - (void)ep; -} -#endif /* NKRO_ENABLE */ +#endif /* start-of-frame handler * TODO: i guess it would be better to re-implement using timers, @@ -628,9 +601,9 @@ static void keyboard_idle_timer_cb(void *arg) { } #ifdef NKRO_ENABLE - if(!keymap_config.nkro && keyboard_idle) { + if(!keymap_config.nkro && keyboard_idle && keyboard_protocol) { #else /* NKRO_ENABLE */ - if(keyboard_idle) { + if(keyboard_idle && keyboard_protocol) { #endif /* NKRO_ENABLE */ /* TODO: are we sure we want the KBD_ENDPOINT? */ if(!usbGetTransmitStatusI(usbp, KEYBOARD_IN_EPNUM)) { @@ -661,25 +634,25 @@ void send_keyboard(report_keyboard_t *report) { osalSysUnlock(); #ifdef NKRO_ENABLE - if(keymap_config.nkro) { /* NKRO protocol */ + if(keymap_config.nkro && keyboard_protocol) { /* NKRO protocol */ /* need to wait until the previous packet has made it through */ /* can rewrite this using the synchronous API, then would wait * until *after* the packet has been transmitted. I think * this is more efficient */ /* busy wait, should be short and not very common */ osalSysLock(); - if(usbGetTransmitStatusI(&USB_DRIVER, NKRO_IN_EPNUM)) { + if(usbGetTransmitStatusI(&USB_DRIVER, SHARED_IN_EPNUM)) { /* Need to either suspend, or loop and call unlock/lock during * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - osalThreadSuspendS(&(&USB_DRIVER)->epc[NKRO_IN_EPNUM]->in_state->thread); + osalThreadSuspendS(&(&USB_DRIVER)->epc[SHARED_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, NKRO_IN_EPNUM, (uint8_t *)report, sizeof(report_keyboard_t)); + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)report, sizeof(struct nkro_report)); osalSysUnlock(); } else #endif /* NKRO_ENABLE */ - { /* boot protocol */ + { /* regular protocol */ /* need to wait until the previous packet has made it through */ /* busy wait, should be short and not very common */ osalSysLock(); @@ -690,7 +663,15 @@ void send_keyboard(report_keyboard_t *report) { * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ osalThreadSuspendS(&(&USB_DRIVER)->epc[KEYBOARD_IN_EPNUM]->in_state->thread); } - usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, (uint8_t *)report, KEYBOARD_EPSIZE); + uint8_t *data, size; + if (keyboard_protocol) { + data = (uint8_t*)report; + size = KEYBOARD_REPORT_SIZE; + } else { /* boot protocol */ + data = &report->mods; + size = 8; + } + usbStartTransmitI(&USB_DRIVER, KEYBOARD_IN_EPNUM, data, size); osalSysUnlock(); } keyboard_report_sent = *report; @@ -703,11 +684,13 @@ void send_keyboard(report_keyboard_t *report) { #ifdef MOUSE_ENABLE +#ifndef MOUSE_SHARED_EP /* mouse IN callback hander (a mouse report has made it IN) */ void mouse_in_cb(USBDriver *usbp, usbep_t ep) { (void)usbp; (void)ep; } +#endif void send_mouse(report_mouse_t *report) { osalSysLock(); @@ -737,19 +720,24 @@ void send_mouse(report_mouse_t *report) { #endif /* MOUSE_ENABLE */ /* --------------------------------------------------------- - * Extrakey functions + * Shared EP functions * --------------------------------------------------------- */ - -#ifdef EXTRAKEY_ENABLE - -/* extrakey IN callback hander */ -void extra_in_cb(USBDriver *usbp, usbep_t ep) { +#ifdef SHARED_EP_ENABLE +/* shared IN callback hander */ +void shared_in_cb(USBDriver *usbp, usbep_t ep) { /* STUB */ (void)usbp; (void)ep; } +#endif + +/* --------------------------------------------------------- + * Extrakey functions + * --------------------------------------------------------- + */ +#ifdef EXTRAKEY_ENABLE static void send_extra_report(uint8_t report_id, uint16_t data) { osalSysLock(); if(usbGetDriverStateI(&USB_DRIVER) != USB_ACTIVE) { @@ -762,7 +750,7 @@ static void send_extra_report(uint8_t report_id, uint16_t data) { .usage = data }; - usbStartTransmitI(&USB_DRIVER, EXTRAKEY_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); + usbStartTransmitI(&USB_DRIVER, SHARED_IN_EPNUM, (uint8_t *)&report, sizeof(report_extra_t)); osalSysUnlock(); } diff --git a/tmk_core/protocol/chibios/usb_main.h b/tmk_core/protocol/chibios/usb_main.h index 1f7eb12f8d..55e8882cc4 100644 --- a/tmk_core/protocol/chibios/usb_main.h +++ b/tmk_core/protocol/chibios/usb_main.h @@ -65,6 +65,14 @@ void nkro_in_cb(USBDriver *usbp, usbep_t ep); void mouse_in_cb(USBDriver *usbp, usbep_t ep); #endif /* MOUSE_ENABLE */ +/* --------------- + * Shared EP header + * --------------- + */ + +/* shared IN request callback handler */ +void shared_in_cb(USBDriver *usbp, usbep_t ep); + /* --------------- * Extrakey header * --------------- @@ -72,9 +80,6 @@ void mouse_in_cb(USBDriver *usbp, usbep_t ep); #ifdef EXTRAKEY_ENABLE -/* extrakey IN request callback handler */ -void extra_in_cb(USBDriver *usbp, usbep_t ep); - /* extra report structure */ typedef struct { uint8_t report_id; diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 95e0b95b2f..e88e6f34aa 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -409,19 +409,21 @@ void EVENT_USB_Device_ConfigurationChanged(void) bool ConfigSuccess = true; /* Setup Keyboard HID Report Endpoints */ +#ifndef KEYBOARD_SHARED_EP ConfigSuccess &= ENDPOINT_CONFIG(KEYBOARD_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, KEYBOARD_EPSIZE, ENDPOINT_BANK_SINGLE); +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) /* Setup Mouse HID Report Endpoint */ ConfigSuccess &= ENDPOINT_CONFIG(MOUSE_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, MOUSE_EPSIZE, ENDPOINT_BANK_SINGLE); #endif -#ifdef EXTRAKEY_ENABLE - /* Setup Extra HID Report Endpoint */ - ConfigSuccess &= ENDPOINT_CONFIG(EXTRAKEY_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - EXTRAKEY_EPSIZE, ENDPOINT_BANK_SINGLE); +#ifdef SHARED_EP_ENABLE + /* Setup Shared HID Report Endpoint */ + ConfigSuccess &= ENDPOINT_CONFIG(SHARED_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, + SHARED_EPSIZE, ENDPOINT_BANK_SINGLE); #endif #ifdef RAW_ENABLE @@ -442,12 +444,6 @@ void EVENT_USB_Device_ConfigurationChanged(void) #endif #endif -#ifdef NKRO_ENABLE - /* Setup NKRO HID Report Endpoints */ - ConfigSuccess &= ENDPOINT_CONFIG(NKRO_IN_EPNUM, EP_TYPE_INTERRUPT, ENDPOINT_DIR_IN, - NKRO_EPSIZE, ENDPOINT_BANK_SINGLE); -#endif - #ifdef MIDI_ENABLE ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); @@ -512,8 +508,8 @@ void EVENT_USB_Device_ControlRequest(void) // Interface switch (USB_ControlRequest.wIndex) { case KEYBOARD_INTERFACE: -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: +#if defined(SHARED_EP_ENABLE) && !defined(KEYBOARD_SHARED_EP) + case SHARED_INTERFACE: #endif Endpoint_ClearSETUP(); @@ -521,7 +517,17 @@ void EVENT_USB_Device_ControlRequest(void) if (USB_DeviceState == DEVICE_STATE_Unattached) return; } +#if defined(SHARED_EP_ENABLE) + uint8_t report_id = REPORT_ID_KEYBOARD; + if (keyboard_protocol) { + report_id = Endpoint_Read_8(); + } + if (report_id == REPORT_ID_KEYBOARD || report_id == REPORT_ID_NKRO) { + keyboard_led_stats = Endpoint_Read_8(); + } +#else keyboard_led_stats = Endpoint_Read_8(); +#endif Endpoint_ClearOUT(); Endpoint_ClearStatusStage(); @@ -612,16 +618,20 @@ static void send_keyboard(report_keyboard_t *report) #ifdef MODULE_ADAFRUIT_BLE adafruit_ble_send_keys(report->mods, report->keys, sizeof(report->keys)); #elif MODULE_RN42 - bluefruit_serial_send(0xFD); - bluefruit_serial_send(0x09); - bluefruit_serial_send(0x01); - for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { - bluefruit_serial_send(report->raw[i]); - } + bluefruit_serial_send(0xFD); + bluefruit_serial_send(0x09); + bluefruit_serial_send(0x01); + bluefruit_serial_send(report->mods); + bluefruit_serial_send(report->reserved); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + bluefruit_serial_send(report->keys[i]); + } #else bluefruit_serial_send(0xFD); - for (uint8_t i = 0; i < KEYBOARD_EPSIZE; i++) { - bluefruit_serial_send(report->raw[i]); + bluefruit_serial_send(report->mods); + bluefruit_serial_send(report->reserved); + for (uint8_t i = 0; i < KEYBOARD_REPORT_KEYS; i++) { + bluefruit_serial_send(report->keys[i]); } #endif } @@ -632,30 +642,24 @@ static void send_keyboard(report_keyboard_t *report) } /* Select the Keyboard Report Endpoint */ + uint8_t ep = KEYBOARD_IN_EPNUM; + uint8_t size = KEYBOARD_REPORT_SIZE; #ifdef NKRO_ENABLE if (keyboard_protocol && keymap_config.nkro) { - /* Report protocol - NKRO */ - Endpoint_SelectEndpoint(NKRO_IN_EPNUM); - - /* Check if write ready for a polling interval around 1ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(4); - if (!Endpoint_IsReadWriteAllowed()) return; - - /* Write Keyboard Report Data */ - Endpoint_Write_Stream_LE(report, NKRO_EPSIZE, NULL); + ep = SHARED_IN_EPNUM; + size = sizeof(struct nkro_report); } - else #endif - { - /* Boot protocol */ - Endpoint_SelectEndpoint(KEYBOARD_IN_EPNUM); - - /* Check if write ready for a polling interval around 10ms */ - while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); - if (!Endpoint_IsReadWriteAllowed()) return; + Endpoint_SelectEndpoint(ep); + /* Check if write ready for a polling interval around 10ms */ + while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); + if (!Endpoint_IsReadWriteAllowed()) return; - /* Write Keyboard Report Data */ - Endpoint_Write_Stream_LE(report, KEYBOARD_EPSIZE, NULL); + /* If we're in Boot Protocol, don't send any report ID or other funky fields */ + if (!keyboard_protocol) { + Endpoint_Write_Stream_LE(&report->mods, 8, NULL); + } else { + Endpoint_Write_Stream_LE(report, size, NULL); } /* Finalize the stream transfer to send the last packet */ @@ -718,6 +722,7 @@ static void send_mouse(report_mouse_t *report) */ static void send_system(uint16_t data) { +#ifdef EXTRAKEY_ENABLE uint8_t timeout = 255; if (USB_DeviceState != DEVICE_STATE_Configured) @@ -727,7 +732,7 @@ static void send_system(uint16_t data) .report_id = REPORT_ID_SYSTEM, .usage = data - SYSTEM_POWER_DOWN + 1 }; - Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); + Endpoint_SelectEndpoint(SHARED_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); @@ -735,6 +740,7 @@ static void send_system(uint16_t data) Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL); Endpoint_ClearIN(); +#endif } /** \brief Send Consumer @@ -743,6 +749,7 @@ static void send_system(uint16_t data) */ static void send_consumer(uint16_t data) { +#ifdef EXTRAKEY_ENABLE uint8_t timeout = 255; uint8_t where = where_to_send(); @@ -786,7 +793,7 @@ static void send_consumer(uint16_t data) .report_id = REPORT_ID_CONSUMER, .usage = data }; - Endpoint_SelectEndpoint(EXTRAKEY_IN_EPNUM); + Endpoint_SelectEndpoint(SHARED_IN_EPNUM); /* Check if write ready for a polling interval around 10ms */ while (timeout-- && !Endpoint_IsReadWriteAllowed()) _delay_us(40); @@ -794,6 +801,7 @@ static void send_consumer(uint16_t data) Endpoint_Write_Stream_LE(&r, sizeof(report_extra_t), NULL); Endpoint_ClearIN(); +#endif } diff --git a/tmk_core/protocol/usb_descriptor.c b/tmk_core/protocol/usb_descriptor.c index cab3446752..589ad23cdd 100644 --- a/tmk_core/protocol/usb_descriptor.c +++ b/tmk_core/protocol/usb_descriptor.c @@ -47,11 +47,18 @@ /******************************************************************************* * HID Report Descriptors ******************************************************************************/ -const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = -{ +#ifdef KEYBOARD_SHARED_EP +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#define SHARED_REPORT_STARTED +#else +const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = { +#endif HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x06), /* Keyboard */ HID_RI_COLLECTION(8, 0x01), /* Application */ +# ifdef KEYBOARD_SHARED_EP + HID_RI_REPORT_ID(8, REPORT_ID_KEYBOARD), +# endif HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ @@ -84,14 +91,25 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM KeyboardReport[] = HID_RI_REPORT_SIZE(8, 0x08), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE), HID_RI_END_COLLECTION(0), + +#ifndef KEYBOARD_SHARED_EP }; +#endif -#ifdef MOUSE_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = -{ +#if defined(MOUSE_ENABLE) + +# if !defined(MOUSE_SHARED_EP) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = { +# elif !defined(SHARED_REPORT_STARTED) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#define SHARED_REPORT_STARTED +# endif HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x02), /* Mouse */ HID_RI_COLLECTION(8, 0x01), /* Application */ +# ifdef MOUSE_SHARED_EP + HID_RI_REPORT_ID(8, REPORT_ID_MOUSE), +# endif HID_RI_USAGE(8, 0x01), /* Pointer */ HID_RI_COLLECTION(8, 0x00), /* Physical */ @@ -133,12 +151,15 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM MouseReport[] = HID_RI_END_COLLECTION(0), HID_RI_END_COLLECTION(0), +# ifndef MOUSE_SHARED_EP }; +# endif #endif -#ifdef EXTRAKEY_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = -{ +#if defined(SHARED_EP_ENABLE) && !defined(SHARED_REPORT_STARTED) +const USB_Descriptor_HIDReport_Datatype_t PROGMEM SharedReport[] = { +#endif +# ifdef EXTRAKEY_ENABLE HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ HID_RI_USAGE(8, 0x80), /* System Control */ HID_RI_COLLECTION(8, 0x01), /* Application */ @@ -164,6 +185,43 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ExtrakeyReport[] = HID_RI_REPORT_COUNT(8, 1), HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_ARRAY | HID_IOF_ABSOLUTE), HID_RI_END_COLLECTION(0), +# endif + +# ifdef NKRO_ENABLE + HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ + HID_RI_USAGE(8, 0x06), /* Keyboard */ + HID_RI_COLLECTION(8, 0x01), /* Application */ + HID_RI_REPORT_ID(8, REPORT_ID_NKRO), + HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ + HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ + HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, 0x08), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + + HID_RI_USAGE_PAGE(8, 0x08), /* LEDs */ + HID_RI_USAGE_MINIMUM(8, 0x01), /* Num Lock */ + HID_RI_USAGE_MAXIMUM(8, 0x05), /* Kana */ + HID_RI_REPORT_COUNT(8, 0x05), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), + HID_RI_REPORT_COUNT(8, 0x01), + HID_RI_REPORT_SIZE(8, 0x03), + HID_RI_OUTPUT(8, HID_IOF_CONSTANT), + + HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ + HID_RI_USAGE_MINIMUM(8, 0x00), /* Keyboard 0 */ + HID_RI_USAGE_MAXIMUM(8, KEYBOARD_REPORT_BITS*8-1), + HID_RI_LOGICAL_MINIMUM(8, 0x00), + HID_RI_LOGICAL_MAXIMUM(8, 0x01), + HID_RI_REPORT_COUNT(8, KEYBOARD_REPORT_BITS*8), + HID_RI_REPORT_SIZE(8, 0x01), + HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), + HID_RI_END_COLLECTION(0), +# endif +#ifdef SHARED_EP_ENABLE }; #endif @@ -211,42 +269,6 @@ const USB_Descriptor_HIDReport_Datatype_t PROGMEM ConsoleReport[] = }; #endif -#ifdef NKRO_ENABLE -const USB_Descriptor_HIDReport_Datatype_t PROGMEM NKROReport[] = -{ - HID_RI_USAGE_PAGE(8, 0x01), /* Generic Desktop */ - HID_RI_USAGE(8, 0x06), /* Keyboard */ - HID_RI_COLLECTION(8, 0x01), /* Application */ - HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ - HID_RI_USAGE_MINIMUM(8, 0xE0), /* Keyboard Left Control */ - HID_RI_USAGE_MAXIMUM(8, 0xE7), /* Keyboard Right GUI */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, 0x08), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - - HID_RI_USAGE_PAGE(8, 0x08), /* LEDs */ - HID_RI_USAGE_MINIMUM(8, 0x01), /* Num Lock */ - HID_RI_USAGE_MAXIMUM(8, 0x05), /* Kana */ - HID_RI_REPORT_COUNT(8, 0x05), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_OUTPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE | HID_IOF_NON_VOLATILE), - HID_RI_REPORT_COUNT(8, 0x01), - HID_RI_REPORT_SIZE(8, 0x03), - HID_RI_OUTPUT(8, HID_IOF_CONSTANT), - - HID_RI_USAGE_PAGE(8, 0x07), /* Key Codes */ - HID_RI_USAGE_MINIMUM(8, 0x00), /* Keyboard 0 */ - HID_RI_USAGE_MAXIMUM(8, (NKRO_EPSIZE-1)*8-1), /* Keyboard Right GUI */ - HID_RI_LOGICAL_MINIMUM(8, 0x00), - HID_RI_LOGICAL_MAXIMUM(8, 0x01), - HID_RI_REPORT_COUNT(8, (NKRO_EPSIZE-1)*8), - HID_RI_REPORT_SIZE(8, 0x01), - HID_RI_INPUT(8, HID_IOF_DATA | HID_IOF_VARIABLE | HID_IOF_ABSOLUTE), - HID_RI_END_COLLECTION(0), -}; -#endif /******************************************************************************* * Device Descriptors @@ -303,6 +325,7 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = /* * Keyboard */ +#ifndef KEYBOARD_SHARED_EP .Keyboard_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -339,11 +362,12 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .EndpointSize = KEYBOARD_EPSIZE, .PollingIntervalMS = 0x0A }, +#endif /* * Mouse */ -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) .Mouse_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, @@ -383,26 +407,31 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = #endif /* - * Extra + * Shared */ -#ifdef EXTRAKEY_ENABLE - .Extrakey_Interface = +#ifdef SHARED_EP_ENABLE + .Shared_Interface = { .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - .InterfaceNumber = EXTRAKEY_INTERFACE, + .InterfaceNumber = SHARED_INTERFACE, .AlternateSetting = 0x00, .TotalEndpoints = 1, .Class = HID_CSCP_HIDClass, +# ifdef KEYBOARD_SHARED_EP + .SubClass = HID_CSCP_BootSubclass, + .Protocol = HID_CSCP_KeyboardBootProtocol, +# else .SubClass = HID_CSCP_NonBootSubclass, .Protocol = HID_CSCP_NonBootProtocol, +#endif .InterfaceStrIndex = NO_DESCRIPTOR }, - .Extrakey_HID = + .Shared_HID = { .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, @@ -410,16 +439,16 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = .CountryCode = 0x00, .TotalReportDescriptors = 1, .HIDReportType = HID_DTYPE_Report, - .HIDReportLength = sizeof(ExtrakeyReport) + .HIDReportLength = sizeof(SharedReport) }, - .Extrakey_INEndpoint = + .Shared_INEndpoint = { .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - .EndpointAddress = (ENDPOINT_DIR_IN | EXTRAKEY_IN_EPNUM), + .EndpointAddress = (ENDPOINT_DIR_IN | SHARED_IN_EPNUM), .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = EXTRAKEY_EPSIZE, + .EndpointSize = SHARED_EPSIZE, .PollingIntervalMS = 0x0A }, #endif @@ -528,48 +557,6 @@ const USB_Descriptor_Configuration_t PROGMEM ConfigurationDescriptor = }, #endif - /* - * NKRO - */ -#ifdef NKRO_ENABLE - .NKRO_Interface = - { - .Header = {.Size = sizeof(USB_Descriptor_Interface_t), .Type = DTYPE_Interface}, - - .InterfaceNumber = NKRO_INTERFACE, - .AlternateSetting = 0x00, - - .TotalEndpoints = 1, - - .Class = HID_CSCP_HIDClass, - .SubClass = HID_CSCP_NonBootSubclass, - .Protocol = HID_CSCP_NonBootProtocol, - - .InterfaceStrIndex = NO_DESCRIPTOR - }, - - .NKRO_HID = - { - .Header = {.Size = sizeof(USB_HID_Descriptor_HID_t), .Type = HID_DTYPE_HID}, - - .HIDSpec = VERSION_BCD(1,1,1), - .CountryCode = 0x00, - .TotalReportDescriptors = 1, - .HIDReportType = HID_DTYPE_Report, - .HIDReportLength = sizeof(NKROReport) - }, - - .NKRO_INEndpoint = - { - .Header = {.Size = sizeof(USB_Descriptor_Endpoint_t), .Type = DTYPE_Endpoint}, - - .EndpointAddress = (ENDPOINT_DIR_IN | NKRO_IN_EPNUM), - .Attributes = (EP_TYPE_INTERRUPT | ENDPOINT_ATTR_NO_SYNC | ENDPOINT_USAGE_DATA), - .EndpointSize = NKRO_EPSIZE, - .PollingIntervalMS = 0x01 - }, -#endif - #ifdef MIDI_ENABLE .Audio_Interface_Association = { @@ -936,19 +923,21 @@ uint16_t get_usb_descriptor(const uint16_t wValue, break; case HID_DTYPE_HID: switch (wIndex) { +#ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: Address = &ConfigurationDescriptor.Keyboard_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: Address = &ConfigurationDescriptor.Mouse_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; #endif -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - Address = &ConfigurationDescriptor.Extrakey_HID; +#ifdef SHARED_EP_ENABLE + case SHARED_INTERFACE: + Address = &ConfigurationDescriptor.Shared_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; #endif @@ -963,31 +952,27 @@ uint16_t get_usb_descriptor(const uint16_t wValue, Address = &ConfigurationDescriptor.Console_HID; Size = sizeof(USB_HID_Descriptor_HID_t); break; -#endif -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - Address = &ConfigurationDescriptor.NKRO_HID; - Size = sizeof(USB_HID_Descriptor_HID_t); - break; #endif } break; case HID_DTYPE_Report: switch (wIndex) { +#ifndef KEYBOARD_SHARED_EP case KEYBOARD_INTERFACE: Address = &KeyboardReport; Size = sizeof(KeyboardReport); break; -#ifdef MOUSE_ENABLE +#endif +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) case MOUSE_INTERFACE: Address = &MouseReport; Size = sizeof(MouseReport); break; #endif -#ifdef EXTRAKEY_ENABLE - case EXTRAKEY_INTERFACE: - Address = &ExtrakeyReport; - Size = sizeof(ExtrakeyReport); +#ifdef SHARED_EP_ENABLE + case SHARED_INTERFACE: + Address = &SharedReport; + Size = sizeof(SharedReport); break; #endif #ifdef RAW_ENABLE @@ -1001,12 +986,6 @@ uint16_t get_usb_descriptor(const uint16_t wValue, Address = &ConsoleReport; Size = sizeof(ConsoleReport); break; -#endif -#ifdef NKRO_ENABLE - case NKRO_INTERFACE: - Address = &NKROReport; - Size = sizeof(NKROReport); - break; #endif } break; diff --git a/tmk_core/protocol/usb_descriptor.h b/tmk_core/protocol/usb_descriptor.h index 586d07df62..3ca0c00b34 100644 --- a/tmk_core/protocol/usb_descriptor.h +++ b/tmk_core/protocol/usb_descriptor.h @@ -53,26 +53,27 @@ typedef struct { USB_Descriptor_Configuration_Header_t Config; +#ifndef KEYBOARD_SHARED_EP // Keyboard HID Interface USB_Descriptor_Interface_t Keyboard_Interface; USB_HID_Descriptor_HID_t Keyboard_HID; USB_Descriptor_Endpoint_t Keyboard_INEndpoint; +#endif -#ifdef MOUSE_ENABLE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) // Mouse HID Interface USB_Descriptor_Interface_t Mouse_Interface; USB_HID_Descriptor_HID_t Mouse_HID; USB_Descriptor_Endpoint_t Mouse_INEndpoint; #endif -#ifdef EXTRAKEY_ENABLE - // Extrakey HID Interface - USB_Descriptor_Interface_t Extrakey_Interface; - USB_HID_Descriptor_HID_t Extrakey_HID; - USB_Descriptor_Endpoint_t Extrakey_INEndpoint; +#if defined(SHARED_EP_ENABLE) + USB_Descriptor_Interface_t Shared_Interface; + USB_HID_Descriptor_HID_t Shared_HID; + USB_Descriptor_Endpoint_t Shared_INEndpoint; #endif -#ifdef RAW_ENABLE +#if defined(RAW_ENABLE) // Raw HID Interface USB_Descriptor_Interface_t Raw_Interface; USB_HID_Descriptor_HID_t Raw_HID; @@ -88,13 +89,6 @@ typedef struct USB_Descriptor_Endpoint_t Console_OUTEndpoint; #endif -#ifdef NKRO_ENABLE - // NKRO HID Interface - USB_Descriptor_Interface_t NKRO_Interface; - USB_HID_Descriptor_HID_t NKRO_HID; - USB_Descriptor_Endpoint_t NKRO_INEndpoint; -#endif - #ifdef MIDI_ENABLE USB_Descriptor_Interface_Association_t Audio_Interface_Association; // MIDI Audio Control Interface @@ -133,133 +127,105 @@ typedef struct /* index of interface */ -#define KEYBOARD_INTERFACE 0 - +enum usb_interfaces { +#if !defined(KEYBOARD_SHARED_EP) + KEYBOARD_INTERFACE, +#else +# define KEYBOARD_INTERFACE SHARED_INTERFACE +#endif // It is important that the Raw HID interface is at a constant // interface number, to support Linux/OSX platforms and chrome.hid // If Raw HID is enabled, let it be always 1. -#ifdef RAW_ENABLE -# define RAW_INTERFACE (KEYBOARD_INTERFACE + 1) -#else -# define RAW_INTERFACE KEYBOARD_INTERFACE +#if defined(RAW_ENABLE) + RAW_INTERFACE, #endif - -#ifdef MOUSE_ENABLE -# define MOUSE_INTERFACE (RAW_INTERFACE + 1) -#else -# define MOUSE_INTERFACE RAW_INTERFACE +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) + MOUSE_INTERFACE, #endif - -#ifdef EXTRAKEY_ENABLE -# define EXTRAKEY_INTERFACE (MOUSE_INTERFACE + 1) -#else -# define EXTRAKEY_INTERFACE MOUSE_INTERFACE +#if defined(SHARED_EP_ENABLE) + SHARED_INTERFACE, #endif - -#ifdef CONSOLE_ENABLE -# define CONSOLE_INTERFACE (EXTRAKEY_INTERFACE + 1) -#else -# define CONSOLE_INTERFACE EXTRAKEY_INTERFACE -#endif - -#ifdef NKRO_ENABLE -# define NKRO_INTERFACE (CONSOLE_INTERFACE + 1) -#else -# define NKRO_INTERFACE CONSOLE_INTERFACE +#if defined(CONSOLE_ENABLE) + CONSOLE_INTERFACE, #endif - -#ifdef MIDI_ENABLE -# define AC_INTERFACE (NKRO_INTERFACE + 1) -# define AS_INTERFACE (NKRO_INTERFACE + 2) -#else -# define AS_INTERFACE NKRO_INTERFACE +#if defined(MIDI_ENABLE) + AC_INTERFACE, + AS_INTERFACE, #endif - -#ifdef VIRTSER_ENABLE -# define CCI_INTERFACE (AS_INTERFACE + 1) -# define CDI_INTERFACE (AS_INTERFACE + 2) -#else -# define CDI_INTERFACE AS_INTERFACE +#if defined(VIRTSER_ENABLE) + CCI_INTERFACE, + CDI_INTERFACE, #endif + TOTAL_INTERFACES +}; -/* nubmer of interfaces */ -#define TOTAL_INTERFACES (CDI_INTERFACE + 1) - +#define NEXT_EPNUM __COUNTER__ -// Endopoint number and size -#define KEYBOARD_IN_EPNUM 1 - -#ifdef MOUSE_ENABLE -# define MOUSE_IN_EPNUM (KEYBOARD_IN_EPNUM + 1) +enum usb_endpoints { + __unused_epnum__ = NEXT_EPNUM, /* EP numbering starts at 1 */ +#if !defined(KEYBOARD_SHARED_EP) + KEYBOARD_IN_EPNUM = NEXT_EPNUM, #else -# define MOUSE_IN_EPNUM KEYBOARD_IN_EPNUM +# define KEYBOARD_IN_EPNUM SHARED_IN_EPNUM #endif - -#ifdef EXTRAKEY_ENABLE -# define EXTRAKEY_IN_EPNUM (MOUSE_IN_EPNUM + 1) +#if defined(MOUSE_ENABLE) && !defined(MOUSE_SHARED_EP) + MOUSE_IN_EPNUM = NEXT_EPNUM, #else -# define EXTRAKEY_IN_EPNUM MOUSE_IN_EPNUM +# define MOUSE_IN_EPNUM SHARED_IN_EPNUM #endif - -#ifdef RAW_ENABLE -# define RAW_IN_EPNUM (EXTRAKEY_IN_EPNUM + 1) -# define RAW_OUT_EPNUM (EXTRAKEY_IN_EPNUM + 2) -#else -# define RAW_OUT_EPNUM EXTRAKEY_IN_EPNUM +#if defined(RAW_ENABLE) + RAW_IN_EPNUM = NEXT_EPNUM, + RAW_OUT_EPNUM = NEXT_EPNUM, #endif - -#ifdef CONSOLE_ENABLE -# define CONSOLE_IN_EPNUM (RAW_OUT_EPNUM + 1) +#if defined(SHARED_EP_ENABLE) + SHARED_IN_EPNUM = NEXT_EPNUM, +#endif +#if defined(CONSOLE_ENABLE) + CONSOLE_IN_EPNUM = NEXT_EPNUM, #ifdef PROTOCOL_CHIBIOS // ChibiOS has enough memory and descriptor to actually enable the endpoint // It could use the same endpoint numbers, as that's supported by ChibiOS // But the QMK code currently assumes that the endpoint numbers are different -# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 2) + CONSOLE_OUT_EPNUM = NEXT_EPNUM, #else -# define CONSOLE_OUT_EPNUM (RAW_OUT_EPNUM + 1) +#define CONSOLE_OUT_EPNUM CONSOLE_IN_EPNUM #endif -#else -# define CONSOLE_OUT_EPNUM RAW_OUT_EPNUM #endif - -#ifdef NKRO_ENABLE -# define NKRO_IN_EPNUM (CONSOLE_OUT_EPNUM + 1) -#else -# define NKRO_IN_EPNUM CONSOLE_OUT_EPNUM -#endif - #ifdef MIDI_ENABLE -# define MIDI_STREAM_IN_EPNUM (NKRO_IN_EPNUM + 1) -// # define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 1) -# define MIDI_STREAM_OUT_EPNUM (NKRO_IN_EPNUM + 2) + MIDI_STREAM_IN_EPNUM = NEXT_EPNUM, + MIDI_STREAM_OUT_EPNUM = NEXT_EPNUM, # define MIDI_STREAM_IN_EPADDR (ENDPOINT_DIR_IN | MIDI_STREAM_IN_EPNUM) # define MIDI_STREAM_OUT_EPADDR (ENDPOINT_DIR_OUT | MIDI_STREAM_OUT_EPNUM) -#else -# define MIDI_STREAM_OUT_EPNUM NKRO_IN_EPNUM #endif - #ifdef VIRTSER_ENABLE -# define CDC_NOTIFICATION_EPNUM (MIDI_STREAM_OUT_EPNUM + 1) -# define CDC_IN_EPNUM (MIDI_STREAM_OUT_EPNUM + 2) -# define CDC_OUT_EPNUM (MIDI_STREAM_OUT_EPNUM + 3) + CDC_NOTIFICATION_EPNUM = NEXT_EPNUM, + CDC_IN_EPNUM = NEXT_EPNUM, + CDC_OUT_EPNUM = NEXT_EPNUM, # define CDC_NOTIFICATION_EPADDR (ENDPOINT_DIR_IN | CDC_NOTIFICATION_EPNUM) # define CDC_IN_EPADDR (ENDPOINT_DIR_IN | CDC_IN_EPNUM) # define CDC_OUT_EPADDR (ENDPOINT_DIR_OUT | CDC_OUT_EPNUM) -#else -# define CDC_OUT_EPNUM MIDI_STREAM_OUT_EPNUM #endif +}; + +#if defined(PROTOCOL_LUFA) +/* LUFA tells us total endpoints including control */ +#define MAX_ENDPOINTS (ENDPOINT_TOTAL_ENDPOINTS - 1) +#elif defined(PROTOCOL_CHIBIOS) +/* ChibiOS gives us number of available user endpoints, not control */ +#define MAX_ENDPOINTS USB_MAX_ENDPOINTS +#endif +/* TODO - ARM_ATSAM */ + -#if (defined(PROTOCOL_LUFA) && CDC_OUT_EPNUM > (ENDPOINT_TOTAL_ENDPOINTS - 1)) || \ - (defined(PROTOCOL_CHIBIOS) && CDC_OUT_EPNUM > USB_MAX_ENDPOINTS) -# error "There are not enough available endpoints to support all functions. Remove some in the rules.mk file.(MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL, STENO)" +#if (NEXT_EPNUM - 1) > MAX_ENDPOINTS +# error There are not enough available endpoints to support all functions. Remove some in the rules.mk file. (MOUSEKEY, EXTRAKEY, CONSOLE, NKRO, MIDI, SERIAL, STENO) #endif #define KEYBOARD_EPSIZE 8 +#define SHARED_EPSIZE 32 #define MOUSE_EPSIZE 8 -#define EXTRAKEY_EPSIZE 8 #define RAW_EPSIZE 32 #define CONSOLE_EPSIZE 32 -#define NKRO_EPSIZE 32 #define MIDI_STREAM_EPSIZE 64 #define CDC_NOTIFICATION_EPSIZE 8 #define CDC_EPSIZE 16 -- cgit v1.2.3 From 09813793bedd74c0bb109c6e87e3682bb864479a Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 16 Nov 2018 15:37:15 +0000 Subject: Add configurator support for luddite (#4434) --- keyboards/40percentclub/luddite/info.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 keyboards/40percentclub/luddite/info.json diff --git a/keyboards/40percentclub/luddite/info.json b/keyboards/40percentclub/luddite/info.json new file mode 100644 index 0000000000..51d71ec772 --- /dev/null +++ b/keyboards/40percentclub/luddite/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "foobar", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + } + } +} -- cgit v1.2.3 From b49f37dce97b1f84659146e7bbe4a55804407072 Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 16 Nov 2018 16:35:04 +0000 Subject: Unify 68keys with mf68 (#4435) * Move 68keys keymap to mf68 folder * Remove 68keys keyboard now its been migrated to mf68 keymap * Migrate 68keys build config to mf68 keymap overrides --- .../40percentclub/mf68/keymaps/68keys/config.h | 15 ++++ .../40percentclub/mf68/keymaps/68keys/keymap.c | 11 +++ .../40percentclub/mf68/keymaps/68keys/readme.md | 23 ++++++ .../40percentclub/mf68/keymaps/68keys/rules.mk | 5 ++ keyboards/68keys/68keys.c | 6 -- keyboards/68keys/68keys.h | 20 ------ keyboards/68keys/README.md | 23 ------ keyboards/68keys/config.h | 42 ----------- keyboards/68keys/info.json | 81 ---------------------- keyboards/68keys/keymaps/default/keymap.c | 10 --- keyboards/68keys/rules.mk | 22 ------ 11 files changed, 54 insertions(+), 204 deletions(-) create mode 100644 keyboards/40percentclub/mf68/keymaps/68keys/config.h create mode 100644 keyboards/40percentclub/mf68/keymaps/68keys/keymap.c create mode 100644 keyboards/40percentclub/mf68/keymaps/68keys/readme.md create mode 100644 keyboards/40percentclub/mf68/keymaps/68keys/rules.mk delete mode 100644 keyboards/68keys/68keys.c delete mode 100644 keyboards/68keys/68keys.h delete mode 100644 keyboards/68keys/README.md delete mode 100644 keyboards/68keys/config.h delete mode 100644 keyboards/68keys/info.json delete mode 100644 keyboards/68keys/keymaps/default/keymap.c delete mode 100644 keyboards/68keys/rules.mk diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/config.h b/keyboards/40percentclub/mf68/keymaps/68keys/config.h new file mode 100644 index 0000000000..a0a576b7bf --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/config.h @@ -0,0 +1,15 @@ +#pragma once + +/* USB Device descriptor parameter */ +#undef VENDOR_ID +#undef PRODUCT_ID +#undef DEVICE_VER +#undef MANUFACTURER +#undef PRODUCT +#undef DESCRIPTION +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0068 +#define MANUFACTURER 68Keys.io +#define PRODUCT The 68Keys.io Keyboard +#define DESCRIPTION A 68 keys mechanical keyboard diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c b/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c new file mode 100644 index 0000000000..3778ea21e7 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/keymap.c @@ -0,0 +1,11 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_68_ansi( + 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_ESC, 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_PGDN, + KC_CAPSLOCK, 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_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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; diff --git a/keyboards/40percentclub/mf68/keymaps/68keys/readme.md b/keyboards/40percentclub/mf68/keymaps/68keys/readme.md new file mode 100644 index 0000000000..4b7cdf1259 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/readme.md @@ -0,0 +1,23 @@ +# 68Keys.io + +Custom [68Keys.io](https://68keys.io) DIY keyboard. + +Keymap Maintainer: [sbstjn](https://sbstjn.com) +Hardware Supported: mf68 +Hardware Availability: [DIY Guide](https://68keys.io) + +Make example for this keyboard (after setting up your build environment): + +```bash +$ > cd qmk_firmware/ +$ > make 40percentclub/mf68:68keys +``` + +Example of flashing this keyboard: + +```bash +$ > cd qmk_firmware/ +$ > make 40percentclub/mf68:68keys:avrdude +``` + +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/40percentclub/mf68/keymaps/68keys/rules.mk b/keyboards/40percentclub/mf68/keymaps/68keys/rules.mk new file mode 100644 index 0000000000..96ce13fe73 --- /dev/null +++ b/keyboards/40percentclub/mf68/keymaps/68keys/rules.mk @@ -0,0 +1,5 @@ +BOOTLOADER = atmel-dfu + +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = no +BACKLIGHT_ENABLE = no diff --git a/keyboards/68keys/68keys.c b/keyboards/68keys/68keys.c deleted file mode 100644 index dcf04e6a3d..0000000000 --- a/keyboards/68keys/68keys.c +++ /dev/null @@ -1,6 +0,0 @@ -#include "68keys.h" - -void matrix_init_kb(void) -{ - matrix_init_user(); -} diff --git a/keyboards/68keys/68keys.h b/keyboards/68keys/68keys.h deleted file mode 100644 index e8a2c4aeed..0000000000 --- a/keyboards/68keys/68keys.h +++ /dev/null @@ -1,20 +0,0 @@ -#include "quantum.h" - -#define LAYOUT_68_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, K16, \ - K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, K33, K34, \ - K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ - K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, \ - K64, K65, K66, K67, K68, K70, K71, K72, K73, K74) \ - { \ - {K00, K01, K02, K03, K04, K05, K06, K07, K08}, \ - {K10, K11, K12, K13, K14, K15, K16, K17, K18}, \ - {K20, K21, K22, K23, K24, K25, K26, K27, K28}, \ - {K30, K31, K32, K33, K34, K35, K36, K37, K38}, \ - {K40, K41, K42, K43, K44, K45, K46, K47, K48}, \ - {K50, K51, K52, K53, K54, K55, K56, K57, K58}, \ - {K60, K61, K62, K63, K64, K65, K66, K67, K68}, \ - { \ - K70, K71, K72, K73, K74 \ - } \ - } diff --git a/keyboards/68keys/README.md b/keyboards/68keys/README.md deleted file mode 100644 index 082a47a755..0000000000 --- a/keyboards/68keys/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 68Keys.io - -Custom [68Keys.io](https://68keys.io) DIY keyboard. - -Keyboard Maintainer: [sbstjn](https://sbstjn.com) -Hardware Supported: Pro Micro -Hardware Availability: [DIY Guide](https://68keys.io) - -Make example for this keyboard (after setting up your build environment): - -```bash -$ > cd qmk_firmware/ -$ > make 68keys:default -``` - -Example of flashing this keyboard: - -```bash -$ > cd qmk_firmware/ -$ > make 68keys:default:avrdude -``` - -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/68keys/config.h b/keyboards/68keys/config.h deleted file mode 100644 index 07c87563d3..0000000000 --- a/keyboards/68keys/config.h +++ /dev/null @@ -1,42 +0,0 @@ -#pragma once - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0A0C -#define DEVICE_VER 0x0068 -#define MANUFACTURER 68Keys.io -#define PRODUCT The 68Keys.io Keyboard -#define DESCRIPTION A 68 keys mechanical keyboard - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 9 - -#define MATRIX_ROW_PINS \ - { \ - B6, B2, B3, B1, F7, F6, F5, F4 \ - } -#define MATRIX_COL_PINS \ - { \ - D3, D2, D1, D0, D4, C6, D7, E6, B4 \ - } -#define UNUSED_PINS - -#define DIODE_DIRECTION COL2ROW - -#define BACKLIGHT_PIN B5 -#define BACKLIGHT_BREATHING -#define BACKLIGHT_LEVELS 3 - -#define DEBOUNCING_DELAY 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 - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) diff --git a/keyboards/68keys/info.json b/keyboards/68keys/info.json deleted file mode 100644 index b24e22b0a1..0000000000 --- a/keyboards/68keys/info.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "keyboard_name": "68Keys.io", - "url": "https://68keys.io", - "maintainer": "qmk", - "width": 17.25, - "height": 5, - "layouts": { - "LAYOUT_68_ansi": { - "layout": [ - { "label": "~", "x": 0, "y": 0 }, - { "label": "!", "x": 1, "y": 0 }, - { "label": "@", "x": 2, "y": 0 }, - { "label": "#", "x": 3, "y": 0 }, - { "label": "$", "x": 4, "y": 0 }, - { "label": "%", "x": 5, "y": 0 }, - { "label": "^", "x": 6, "y": 0 }, - { "label": "&", "x": 7, "y": 0 }, - { "label": "*", "x": 8, "y": 0 }, - { "label": "(", "x": 9, "y": 0 }, - { "label": ")", "x": 10, "y": 0 }, - { "label": "_", "x": 11, "y": 0 }, - { "label": "+", "x": 12, "y": 0 }, - { "label": "Backspace", "x": 13, "y": 0, "w": 2 }, - { "label": "ESC", "x": 15.25, "y": 0 }, - { "label": "PGUP", "x": 16.25, "y": 0 }, - { "label": "Tab", "x": 0, "y": 1, "w": 1.5 }, - { "label": "Q", "x": 1.5, "y": 1 }, - { "label": "W", "x": 2.5, "y": 1 }, - { "label": "E", "x": 3.5, "y": 1 }, - { "label": "R", "x": 4.5, "y": 1 }, - { "label": "T", "x": 5.5, "y": 1 }, - { "label": "Y", "x": 6.5, "y": 1 }, - { "label": "U", "x": 7.5, "y": 1 }, - { "label": "I", "x": 8.5, "y": 1 }, - { "label": "O", "x": 9.5, "y": 1 }, - { "label": "P", "x": 10.5, "y": 1 }, - { "label": "{", "x": 11.5, "y": 1 }, - { "label": "}", "x": 12.5, "y": 1 }, - { "label": "|", "x": 13.5, "y": 1, "w": 1.5 }, - { "label": "DEL", "x": 15.25, "y": 1 }, - { "label": "PGDN", "x": 16.25, "y": 1 }, - { "label": "Caps Lock", "x": 0, "y": 2, "w": 1.75 }, - { "label": "A", "x": 1.75, "y": 2 }, - { "label": "S", "x": 2.75, "y": 2 }, - { "label": "D", "x": 3.75, "y": 2 }, - { "label": "F", "x": 4.75, "y": 2 }, - { "label": "G", "x": 5.75, "y": 2 }, - { "label": "H", "x": 6.75, "y": 2 }, - { "label": "J", "x": 7.75, "y": 2 }, - { "label": "K", "x": 8.75, "y": 2 }, - { "label": "L", "x": 9.75, "y": 2 }, - { "label": ":", "x": 10.75, "y": 2 }, - { "label": "\"", "x": 11.75, "y": 2 }, - { "label": "Enter", "x": 12.75, "y": 2, "w": 2.25 }, - { "label": "Shift", "x": 0, "y": 3, "w": 2.25 }, - { "label": "Z", "x": 2.25, "y": 3 }, - { "label": "X", "x": 3.25, "y": 3 }, - { "label": "C", "x": 4.25, "y": 3 }, - { "label": "V", "x": 5.25, "y": 3 }, - { "label": "B", "x": 6.25, "y": 3 }, - { "label": "N", "x": 7.25, "y": 3 }, - { "label": "M", "x": 8.25, "y": 3 }, - { "label": "<", "x": 9.25, "y": 3 }, - { "label": ">", "x": 10.25, "y": 3 }, - { "label": "?", "x": 11.25, "y": 3 }, - { "label": "Shift", "x": 12.25, "y": 3, "w": 2.75 }, - { "x": 15.25, "y": 3 }, - { "label": "CTRL", "x": 0, "y": 4, "w": 1.25 }, - { "label": "ALT", "x": 1.25, "y": 4, "w": 1.25 }, - { "label": "GUI", "x": 2.5, "y": 4, "w": 1.25 }, - { "x": 3.75, "y": 4, "w": 6.25 }, - { "label": "GUI", "x": 10, "y": 4, "w": 1.25 }, - { "label": "ALT", "x": 11.25, "y": 4, "w": 1.25 }, - { "label": "CTRL", "x": 12.5, "y": 4, "w": 1.25 }, - { "x": 14.25, "y": 4 }, - { "x": 15.25, "y": 4 }, - { "x": 16.25, "y": 4 } - ] - } - } -} diff --git a/keyboards/68keys/keymaps/default/keymap.c b/keyboards/68keys/keymaps/default/keymap.c deleted file mode 100644 index 8f23d22462..0000000000 --- a/keyboards/68keys/keymaps/default/keymap.c +++ /dev/null @@ -1,10 +0,0 @@ -#include QMK_KEYBOARD_H -#include "68keys.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_68_ansi( - 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_ESC, 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_PGDN, - KC_CAPSLOCK, 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_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_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT)}; diff --git a/keyboards/68keys/rules.mk b/keyboards/68keys/rules.mk deleted file mode 100644 index f1a56d496d..0000000000 --- a/keyboards/68keys/rules.mk +++ /dev/null @@ -1,22 +0,0 @@ -LAYOUTS = 68_ansi - -MCU = atmega32u4 -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -BOOTLOADER = atmel-dfu - -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration (+1000) -MOUSEKEY_ENABLE = no # Mouse keys (+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control (+450) -CONSOLE_ENABLE = no # Console for debug (+400) -COMMAND_ENABLE = no # Commands for debug and configuration -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -NKRO_ENABLE = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - -- cgit v1.2.3 From defcfb4953d49a0fc72ecf49faeac0534aafc190 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Fri, 16 Nov 2018 17:55:37 +0100 Subject: Update whitefox/konstantin keymap (#4436) * Add more spacing in keymaps * Enable link-time optimization * Disable deprecated TMK actions, change spacing in config.h * Remove unrelated rules.mk options --- keyboards/whitefox/keymaps/konstantin/config.h | 19 +++++++++------- keyboards/whitefox/keymaps/konstantin/keymap.c | 30 +++++++++++++------------- keyboards/whitefox/keymaps/konstantin/rules.mk | 6 ++---- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index d1c3002d27..ee30dbece1 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -5,15 +5,18 @@ #undef IS_COMMAND #define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RCTL))) -#define MAGIC_KEY_LAYER0_ALT1 BSLS -#define MAGIC_KEY_BOOTLOADER ESC +#define MAGIC_KEY_LAYER0_ALT1 BSLS +#define MAGIC_KEY_BOOTLOADER ESC -#define MOUSEKEY_DELAY 50 -#define MOUSEKEY_INTERVAL 15 -#define MOUSEKEY_MAX_SPEED 4 -#define MOUSEKEY_TIME_TO_MAX 50 -#define MOUSEKEY_WHEEL_MAX_SPEED 1 -#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 +#define MOUSEKEY_DELAY 50 +#define MOUSEKEY_INTERVAL 15 +#define MOUSEKEY_MAX_SPEED 4 +#define MOUSEKEY_TIME_TO_MAX 50 +#define MOUSEKEY_WHEEL_MAX_SPEED 1 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 50 + +#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO #define PERMISSIVE_HOLD #define TAPPING_TERM 200 diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index 6732d9a01e..55db5ca6b8 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -151,11 +151,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_BASE] = LAYOUT_truefox( \ - KC_ESC, 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_BSLS,KC_GRV, KC_PSCR, \ - 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_BSPC, KC_DEL, \ - 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_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,RCT_RSF, KC_UP, KC_PGDN, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, RAL_RGU,FN_FNLK, KC_LEFT,KC_DOWN,KC_RGHT \ + KC_ESC, 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_BSLS, KC_GRV, KC_PSCR, \ + 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_BSPC, KC_DEL, \ + 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_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RCT_RSF, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ ), /* Function layer @@ -172,11 +172,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_FN] = LAYOUT_truefox( \ - _______,KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK,KC_PAUS, \ - KC_BTN4,KC_BTN2,KC_MS_U,KC_BTN1,KC_BTN3,KC_BTN5,_______,_______,_______,KC_MSTP,KC_MPLY,KC_MPRV,KC_MNXT,CLEAR, KC_INS, \ - _______,KC_MS_L,KC_MS_D,KC_MS_R,KC_WH_U,_______,_______,_______,_______,_______,_______,_______, _______, TOP, \ - _______, KC_ACL0,KC_ACL2,KC_WH_L,KC_WH_R,_______,_______,_______,KC_VOLD,KC_VOLU,KC_MUTE,KC_APP, KC_PGUP,BOTTOM, \ - _______,DESKTOP,DSKTP_L, KC_WH_D, DSKTP_R,_______, KC_HOME,KC_PGDN,KC_END \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, \ + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \ + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ + _______, DESKTOP, DSKTP_L, KC_WH_D, DSKTP_R, _______, KC_HOME, KC_PGDN, KC_END \ ), /* Numpad layer @@ -193,10 +193,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ */ [L_NUMPAD] = LAYOUT_truefox( \ - NUMPAD, _______,_______,_______,_______,_______,_______,KC_P7, KC_P8, KC_P9, KC_PMNS,MINUS, EQUALS, NUMPAD, _______,_______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P4, KC_P5, KC_P6, KC_PPLS,L_PAREN,R_PAREN,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,KC_P1, KC_P2, KC_P3, KC_PAST,TIMES, KC_PENT, _______, \ - _______, _______,_______,_______,_______,_______,KC_P0, KC_P0, COMMA, KC_PDOT,KC_PSLS,DIVIDE, _______,_______, \ - _______,_______,_______, _______, _______,_______, _______,_______,_______ \ + NUMPAD, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, \ + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; diff --git a/keyboards/whitefox/keymaps/konstantin/rules.mk b/keyboards/whitefox/keymaps/konstantin/rules.mk index 8fbc1f3af4..96722d1d5b 100644 --- a/keyboards/whitefox/keymaps/konstantin/rules.mk +++ b/keyboards/whitefox/keymaps/konstantin/rules.mk @@ -1,15 +1,13 @@ -AUDIO_ENABLE = no BACKLIGHT_ENABLE = no -BLUETOOTH_ENABLE = no BOOTMAGIC_ENABLE = no COMMAND_ENABLE = yes CONSOLE_ENABLE = yes EXTRAKEY_ENABLE = yes -MIDI_ENABLE = no MOUSEKEY_ENABLE = yes NKRO_ENABLE = yes -RGBLIGHT_ENABLE = no SLEEP_LED_ENABLE = no TAP_DANCE_ENABLE = yes UNICODE_ENABLE = yes VISUALIZER_ENABLE = no + +EXTRAFLAGS += -flto -- cgit v1.2.3 From 774bee642685b6349e00603a9fd8a94432a7e893 Mon Sep 17 00:00:00 2001 From: Elliot Powell <32494740+e11i0t23@users.noreply.github.com> Date: Fri, 16 Nov 2018 19:31:44 +0000 Subject: Moved ep40 to ep/40 for easier adding of next ep keyboard (#4439) * add initial ep40 files * fixed issues * updated keymap * Added media control * Update keyboards/handwired/ep40/rules.mk Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Fixed requested changes * Fixed more requested changes * Added delete key to layor 1 * Updated defualt keympap to have a Backspace mod del key * removed place holder Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * removed obsolete code Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Moved ep40 to ep/40 * Fixed file names for moved code * Fixed readme --- keyboards/ep/40/40.c | 43 ++++++++ keyboards/ep/40/40.h | 44 ++++++++ keyboards/ep/40/config.h | 114 +++++++++++++++++++++ keyboards/ep/40/info.json | 12 +++ keyboards/ep/40/keymaps/default/keymap.c | 71 +++++++++++++ keyboards/ep/40/keymaps/default/readme.md | 1 + keyboards/ep/40/readme.md | 15 +++ keyboards/ep/40/rules.mk | 80 +++++++++++++++ keyboards/handwired/ep40/config.h | 114 --------------------- keyboards/handwired/ep40/ep40.c | 43 -------- keyboards/handwired/ep40/ep40.h | 44 -------- keyboards/handwired/ep40/info.json | 12 --- keyboards/handwired/ep40/keymaps/default/keymap.c | 71 ------------- keyboards/handwired/ep40/keymaps/default/readme.md | 1 - keyboards/handwired/ep40/readme.md | 15 --- keyboards/handwired/ep40/rules.mk | 80 --------------- 16 files changed, 380 insertions(+), 380 deletions(-) create mode 100644 keyboards/ep/40/40.c create mode 100644 keyboards/ep/40/40.h create mode 100644 keyboards/ep/40/config.h create mode 100644 keyboards/ep/40/info.json create mode 100644 keyboards/ep/40/keymaps/default/keymap.c create mode 100644 keyboards/ep/40/keymaps/default/readme.md create mode 100644 keyboards/ep/40/readme.md create mode 100644 keyboards/ep/40/rules.mk delete mode 100644 keyboards/handwired/ep40/config.h delete mode 100644 keyboards/handwired/ep40/ep40.c delete mode 100644 keyboards/handwired/ep40/ep40.h delete mode 100644 keyboards/handwired/ep40/info.json delete mode 100644 keyboards/handwired/ep40/keymaps/default/keymap.c delete mode 100644 keyboards/handwired/ep40/keymaps/default/readme.md delete mode 100644 keyboards/handwired/ep40/readme.md delete mode 100644 keyboards/handwired/ep40/rules.mk diff --git a/keyboards/ep/40/40.c b/keyboards/ep/40/40.c new file mode 100644 index 0000000000..7c235f3ce5 --- /dev/null +++ b/keyboards/ep/40/40.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include "40.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/40/40.h b/keyboards/ep/40/40.h new file mode 100644 index 0000000000..30f3d15b4f --- /dev/null +++ b/keyboards/ep/40/40.h @@ -0,0 +1,44 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#ifndef EP40_H +#define EP40_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxx KC_NO + +#define LAYOUT(\ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b,\ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1b,\ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b,\ + k30, k31, k32, k34, k36, k38, k39, k3a, k3b \ +) \ +{ \ + {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b},\ + {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, xxx, k1b},\ + {k20, xxx, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b},\ + {k30, k31, k32, xxx, k34, xxx, k36, xxx, k38, k39, k3a, k3b} \ +} + +#endif diff --git a/keyboards/ep/40/config.h b/keyboards/ep/40/config.h new file mode 100644 index 0000000000..90630cd68d --- /dev/null +++ b/keyboards/ep/40/config.h @@ -0,0 +1,114 @@ +/* +Copyright 2018 Elliot Powell + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x4040 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ep40 +#define DESCRIPTION A simple 40% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { C7, C6, B6, B5 } +#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, D2, D3, D5, D4, D6, D7, B4 } + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) +/* + * 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/ep/40/info.json b/keyboards/ep/40/info.json new file mode 100644 index 0000000000..1c57ac6749 --- /dev/null +++ b/keyboards/ep/40/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name":"ep40", + "url":null, + "maintainer":"e11i0t23", + "width":12, + "hight":4, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1, "w":1.25}, {"x":1.25, "y":1}, {"x":2.25, "y":1}, {"x":3.25, "y":1}, {"x":4.25, "y":1}, {"x":5.25, "y":1}, {"x":6.25, "y":1}, {"x":7.25, "y":1}, {"x":8.25, "y":1}, {"x":9.25, "y":1}, {"x":10.25, "y":1, "w":1.75}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2, "w":1.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "w":2.25}, {"x":5.25, "y":3, "w":2.75}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] + } + } +} diff --git a/keyboards/ep/40/keymaps/default/keymap.c b/keyboards/ep/40/keymaps/default/keymap.c new file mode 100644 index 0000000000..1ac66bc012 --- /dev/null +++ b/keyboards/ep/40/keymaps/default/keymap.c @@ -0,0 +1,71 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include QMK_KEYBOARD_H + +static bool bsdel_mods = false; + +enum custom_keycodes { + M_BSDEL = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, M_BSDEL,\ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ + LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RALT, MO(2), RCTL_T(KC_RBRC), KC_F5 \ + ), + + [1] = LAYOUT( /* Base */ + KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ + KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + + [2] = LAYOUT( /* Base */ + 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS,\ + KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,\ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case M_BSDEL: { + uint8_t kc = KC_BSPC; + + if (record->event.pressed) { + if (keyboard_report->mods) { + kc = KC_DEL; + } + register_code (kc); + bsdel_mods = keyboard_report->mods; + } + else { + if (bsdel_mods) { + kc = KC_DEL; + } + unregister_code (kc); + } + + return false; + break; + } + } + return true; +} diff --git a/keyboards/ep/40/keymaps/default/readme.md b/keyboards/ep/40/keymaps/default/readme.md new file mode 100644 index 0000000000..242c0afb93 --- /dev/null +++ b/keyboards/ep/40/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for ep40 \ No newline at end of file diff --git a/keyboards/ep/40/readme.md b/keyboards/ep/40/readme.md new file mode 100644 index 0000000000..647842bade --- /dev/null +++ b/keyboards/ep/40/readme.md @@ -0,0 +1,15 @@ +# ep40 + +![ep40](https://i.imgur.com/Jl7w6I9.jpg) + +A simple 40% keyboard + +Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23 on reddit](https://reddit.com/u/e11i0t23) +Hardware Supported: EP40 PCB +Hardware Availability: None at the moment + +Make example for this keyboard (after setting up your build environment): + + make ep/40: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/ep/40/rules.mk b/keyboards/ep/40/rules.mk new file mode 100644 index 0000000000..9ddf9717e9 --- /dev/null +++ b/keyboards/ep/40/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # 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 = no # 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) diff --git a/keyboards/handwired/ep40/config.h b/keyboards/handwired/ep40/config.h deleted file mode 100644 index 90630cd68d..0000000000 --- a/keyboards/handwired/ep40/config.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2018 Elliot Powell - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x4040 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Elliot Powell -#define PRODUCT ep40 -#define DESCRIPTION A simple 40% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 4 -#define MATRIX_COLS 12 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { C7, C6, B6, B5 } -#define MATRIX_COL_PINS { F6, F5, F4, F1, F0, D2, D3, D5, D4, D6, D7, B4 } - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) -/* - * 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/handwired/ep40/ep40.c b/keyboards/handwired/ep40/ep40.c deleted file mode 100644 index 257f9fa807..0000000000 --- a/keyboards/handwired/ep40/ep40.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 Elliot Powell - * - * 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 . - */ -#include "ep40.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/handwired/ep40/ep40.h b/keyboards/handwired/ep40/ep40.h deleted file mode 100644 index 30f3d15b4f..0000000000 --- a/keyboards/handwired/ep40/ep40.h +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright 2018 Elliot Powell - * - * 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 . - */ -#ifndef EP40_H -#define EP40_H - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define xxx KC_NO - -#define LAYOUT(\ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b,\ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1b,\ - k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b,\ - k30, k31, k32, k34, k36, k38, k39, k3a, k3b \ -) \ -{ \ - {k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b},\ - {k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, xxx, k1b},\ - {k20, xxx, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b},\ - {k30, k31, k32, xxx, k34, xxx, k36, xxx, k38, k39, k3a, k3b} \ -} - -#endif diff --git a/keyboards/handwired/ep40/info.json b/keyboards/handwired/ep40/info.json deleted file mode 100644 index 1c57ac6749..0000000000 --- a/keyboards/handwired/ep40/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name":"ep40", - "url":null, - "maintainer":"e11i0t23", - "width":12, - "hight":4, - "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":0, "y":1, "w":1.25}, {"x":1.25, "y":1}, {"x":2.25, "y":1}, {"x":3.25, "y":1}, {"x":4.25, "y":1}, {"x":5.25, "y":1}, {"x":6.25, "y":1}, {"x":7.25, "y":1}, {"x":8.25, "y":1}, {"x":9.25, "y":1}, {"x":10.25, "y":1, "w":1.75}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2, "w":1.25}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "w":2.25}, {"x":5.25, "y":3, "w":2.75}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}] - } - } -} diff --git a/keyboards/handwired/ep40/keymaps/default/keymap.c b/keyboards/handwired/ep40/keymaps/default/keymap.c deleted file mode 100644 index 1ac66bc012..0000000000 --- a/keyboards/handwired/ep40/keymaps/default/keymap.c +++ /dev/null @@ -1,71 +0,0 @@ -/* Copyright 2018 Elliot Powell - * - * 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 . - */ -#include QMK_KEYBOARD_H - -static bool bsdel_mods = false; - -enum custom_keycodes { - M_BSDEL = SAFE_RANGE, // ensure these codes start after the highest keycode defined in Quantum -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( /* Base */ - KC_GESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, M_BSDEL,\ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_RSFT,\ - LCTL_T(KC_LBRC), KC_LGUI, KC_LALT, KC_SPC, LT(1, KC_SPC), KC_RALT, MO(2), RCTL_T(KC_RBRC), KC_F5 \ - ), - - [1] = LAYOUT( /* Base */ - KC_TRNS, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_UP, KC_DOWN, KC_RIGHT, KC_TRNS,\ - KC_TRNS, KC_VOLD, KC_MUTE, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - - [2] = LAYOUT( /* Base */ - 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SCLN, KC_QUOT, KC_NUHS, KC_TRNS,\ - KC_TRNS, KC_NUBS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SLSH, KC_TRNS, KC_TRNS,\ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET \ - ), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case M_BSDEL: { - uint8_t kc = KC_BSPC; - - if (record->event.pressed) { - if (keyboard_report->mods) { - kc = KC_DEL; - } - register_code (kc); - bsdel_mods = keyboard_report->mods; - } - else { - if (bsdel_mods) { - kc = KC_DEL; - } - unregister_code (kc); - } - - return false; - break; - } - } - return true; -} diff --git a/keyboards/handwired/ep40/keymaps/default/readme.md b/keyboards/handwired/ep40/keymaps/default/readme.md deleted file mode 100644 index 242c0afb93..0000000000 --- a/keyboards/handwired/ep40/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for ep40 \ No newline at end of file diff --git a/keyboards/handwired/ep40/readme.md b/keyboards/handwired/ep40/readme.md deleted file mode 100644 index 5acd8892dd..0000000000 --- a/keyboards/handwired/ep40/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ep40 - -![ep40](https://i.imgur.com/Jl7w6I9.jpg) - -A simple 40% keyboard - -Keyboard Maintainer: [Elliot Powell](https://reddit.com/u/e11i0t23, https://github.com/e11i0t23) -Hardware Supported: EP40 PCB -Hardware Availability: None at the moment - -Make example for this keyboard (after setting up your build environment): - - make ep40: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/handwired/ep40/rules.mk b/keyboards/handwired/ep40/rules.mk deleted file mode 100644 index 9ddf9717e9..0000000000 --- a/keyboards/handwired/ep40/rules.mk +++ /dev/null @@ -1,80 +0,0 @@ -# MCU name -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 = atmel-dfu - - -# 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 = no # 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 = no # 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) -- cgit v1.2.3 From d9453a93f34a71f5dd5bf8cd2ef75fe21a2dcc7b Mon Sep 17 00:00:00 2001 From: Boy_314 <32818287+Boy-314@users.noreply.github.com> Date: Fri, 16 Nov 2018 17:47:06 -0500 Subject: Updating Boy_314's XD75 Layout (#4440) * fixed arrow keys and left control * added right shift * latest version * reverted arrow keys * edited readme * added osu layer * updated osu layout * updated osu layout * added full arrow keys to osu layout * in case i mess up creating macros * added the best meme key in the world * added plover steno layer * updated boy314 layout * removed unused layers * added boy314 xd75 layout, inspired by preonic layout * added boy314 xd75 layout, inspired by preonic layout * version 2 of boy314's xd75 layout * added readme notes * updated readme for boy314 xd75 layout * qwerty support, brackets on bottom row, caps lock underglow * fixed readme/ * small changes to allow merging * minor changes to format * fixed up default readme * added numpad and tweaked bottom row --- keyboards/xd75/keymaps/boy_314/keymap.c | 73 ++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/keyboards/xd75/keymaps/boy_314/keymap.c b/keyboards/xd75/keymaps/boy_314/keymap.c index 8658fde6e4..d807d1d861 100644 --- a/keyboards/xd75/keymaps/boy_314/keymap.c +++ b/keyboards/xd75/keymaps/boy_314/keymap.c @@ -3,9 +3,9 @@ // Layer shorthand #define _DV 0 #define _QW 1 -#define _FN1 2 -#define _FN2 3 -#define _NP 4 +#define _NP 2 +#define _FN1 3 +#define _FN2 4 #define RGBLIGHT_LIGHT_VAL 255 const uint8_t RGBLED_RAINBOW_SWIRL_INTERVALS[] PROGMEM = {10, 10, 10}; @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * | LSHIFT | ; | Q | J | K | X | END | UP | PG DN | M | W | W | V | Z | RSHIFT | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| - * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | [ | ] | { | } | + * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | LEFT | DOWN | UP | RIGHT | * '--------------------------------------------------------------------------------------------------------------------------------------' */ @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_LBRC, KC_BSLS, KC_RBRC, KC_F, KC_G, KC_C, KC_R, KC_L, KC_SLSH }, { KC_CAPS, KC_A, KC_O, KC_E, KC_U, KC_I, KC_HOME, KC_DEL, KC_PGUP, KC_D, KC_H, KC_T, KC_N, KC_S, KC_ENT }, { KC_LSPO, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_END, KC_UP, KC_PGDN, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSPC }, - { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR }, + { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT }, }, /* QWERTY @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| - * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | [ | ] | { | } | + * | LCTRL | DEL | LALT | WIN | FN1 | SPACE | LEFT | DOWN | RIGHT | SPACE | FN2 | LEFT | DOWN | UP | RIGHT | * '--------------------------------------------------------------------------------------------------------------------------------------' */ @@ -54,9 +54,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_ENT }, { KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT }, { KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC }, - { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LBRC, KC_RBRC, KC_LCBR, KC_RCBR }, + { KC_LCTL, KC_DEL, KC_LALT, KC_LGUI, MO(_FN1),KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, MO(_FN2),KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT }, }, +/* NUMPAD + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | | | | | | | / | * | - | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | 7 | 8 | 9 | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | 4 | 5 | 6 | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | 1 | 2 | 3 | | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | | | | | + | 0 | . | | | | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_NP] = { /* NUMPAD */ + { _______, _______, _______, _______, _______, _______, KC_SLSH, KC_ASTR, KC_MINS, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, _______, _______, _______, _______ }, + { _______, _______, _______, _______, _______, _______, KC_PLUS, KC_0, KC_DOT, _______, _______, _______, _______, _______, _______ }, + }, + /* FUNCTION1 * .--------------------------------------------------------------------------------------------------------------------------------------. * | ` | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | BACKSP | @@ -84,7 +106,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * .--------------------------------------------------------------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | BACKSP | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | ` | | | UP | | | RESET |RGB HUE-|RGB HUE+| | | | | | | + * | ` | | | UP | | | RESET |RGB HUE-|RGB HUE+| NUMPAD | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | DEL | | LEFT | DOWN | RIGHT | | |RGB SAT-|RGB SAT+| DVORAK | - | = | [ | ] | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| @@ -96,32 +118,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_FN2] = { /* FUNCTION2 */ { KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC }, - { KC_GRV, _______, _______, KC_UP, _______, _______, RESET, RGB_HUD, RGB_HUI, _______, _______, _______, _______, _______, KC_DEL }, - { KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, RGB_SAD, RGB_SAI, TO(_DV), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, - { _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, TO(_QW), _______, _______, KC_PGDN, KC_PGUP, _______ }, + { KC_GRV, _______, _______, KC_UP, _______, _______, RESET, RGB_HUD, RGB_HUI, TG(_NP), _______, _______, _______, _______, KC_DEL }, + { KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, RGB_SAD, RGB_SAI, TG(_DV), KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS }, + { _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, TG(_QW), _______, _______, KC_PGDN, KC_PGUP, _______ }, { _______, _______, _______, _______, _______, _______, _______,RGB_RMOD, RGB_MOD, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY }, - }, - -/* NUMPAD - * .--------------------------------------------------------------------------------------------------------------------------------------. - * | | | | | | / | * | - | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | 7 | 8 | 9 | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | 4 | 5 | 6 | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | 1 | 2 | 3 | | | | | | | | - * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| - * | | | | | | 0 | 0 | . | | | | | | | | - * '--------------------------------------------------------------------------------------------------------------------------------------' - */ - - [_NP] = { /* NUMPAD */ - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, } }; @@ -149,6 +149,13 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO_NONE; }; +void matrix_init_user(void) { + if (!(host_keyboard_leds() & (1< Date: Sun, 18 Nov 2018 16:52:14 +0100 Subject: Update to my keymaps and userspace (#4447) * fix to prime o keymap * changed ortho keymaps * added some symbols to lower layer * set lower to be a higher layer than raise * added split layout option with center numpad to prime_o keymap * added some gaming functionality * added alt f4 ortho keymaps and userspace * fixed small error --- .../niu_mini/keymaps/spacebarracecar/keymap.c | 27 +- keyboards/planck/keymaps/spacebarracecar/keymap.c | 25 +- .../prime_o/keymaps/spacebarracecar/keymap.c | 346 ++++++++++++++------- .../prime_o/keymaps/spacebarracecar/readme.md | 2 +- users/spacebarracecar/spacebarracecar.h | 2 + 5 files changed, 280 insertions(+), 122 deletions(-) diff --git a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c index c3f6fb09a1..9bee87f38f 100644 --- a/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c +++ b/keyboards/niu_mini/keymaps/spacebarracecar/keymap.c @@ -6,8 +6,8 @@ enum layers { _BASE, - _LOWER, - _RAISE + _RAISE, + _LOWER }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ortho_4x12( DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ortho_4x12( CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -89,21 +89,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Navigation ,-----------------------------------------------------------------------------------------------------------------------. -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game | +|RESET |ESCT | | | | | | | | | |Game | `-----------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT_ortho_4x12( - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + ALTF4, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, RGB_M_P, KC_ENT, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, RGB_TOG, RGB_MOD, RGB_HUI, CU_RGBV, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME + RESET, CU_ESCT, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME ) }; @@ -121,6 +121,17 @@ switch (keycode) { } else { return true; } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } default: return true; } diff --git a/keyboards/planck/keymaps/spacebarracecar/keymap.c b/keyboards/planck/keymaps/spacebarracecar/keymap.c index db91231bf7..b1c0e3148a 100644 --- a/keyboards/planck/keymaps/spacebarracecar/keymap.c +++ b/keyboards/planck/keymaps/spacebarracecar/keymap.c @@ -6,8 +6,8 @@ enum layers { _BASE, - _LOWER, _RAISE, + _LOWER, _MUSICMODE }; @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_ortho_4x12( DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -65,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_ortho_4x12( CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), @@ -97,21 +97,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Navigation ,-----------------------------------------------------------------------------------------------------------------------. -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game | +|RESET |ESCT | | | | | | | | | |Game | `-----------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT_ortho_4x12( - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + ALTF4, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, MU_ON, XXXXXXX, XXXXXXX, XXXXXXX, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME + RESET, CU_ESCT, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME ) }; @@ -129,6 +129,17 @@ switch (keycode) { } else { return true; } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } case MU_ON: if(record->event.pressed) { layer_off(_LOWER); diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c index d38ff0d1d6..6e2011770f 100644 --- a/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/keymap.c @@ -8,122 +8,244 @@ enum layers { _BASE, - _LOWER, _RAISE, + _LOWER, _GAME = _NAV+1 }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#ifndef LEFTNUM +#ifdef LEFTNUM + /* Base ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ |Numlock |/ |* |= | +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace|7 |8 |9 |- | +|+ |7 |8 |9 |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 |Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' |4 |5 |6 |+ | +|Enter |1 |2 |3 |(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 |RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_BASE] = LAYOUT( + KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, + KC_PPLS, KC_P7, KC_P8, KC_P9, KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_EQL, KC_P4, KC_P5, KC_P6, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + KC_PENT, KC_P1, KC_P2, KC_P3, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_BSPC, KC_PDOT, KC_P0, KC_P00, KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL +), + +/* Lower +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift |1 |2 |3 |Enter | +|+ |7 |8 |9 |~ |! |" |# |$ |% |^ |& |* |( |) | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl |00 |0 |. |Tab | +|Enter |1 |2 |3 | |? | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_LOWER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, _______, _______, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, _______, _______, _______, _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Raise +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | | | | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_RAISE] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Deadkey +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock | | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 | | | | | | | |Ü | |Ö | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Ä |ß | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | | | | | | | | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 | | | | | |" |" | | | | | | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_DEADKEY] = LAYOUT( + _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + _______, _______, _______, _______, KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, _______, _______, _______, _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ +), + +/* Navigation +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|- |* |/ |Numlock |Escape | | | | | | | | | | | | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|+ |7 |8 |9 |ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|= |4 |5 |6 | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Enter |1 |2 |3 | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | +|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Backspace|. |0 |00 |RESET |ESCT | | | | | | | | | |Game | +`---------------------------------------------------------------------------------------------------------------------------------------------------------------' +*/ + +[_NAV] = LAYOUT( + _______, _______, _______, _______, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, ALTF4, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, + _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, RESET, CU_ESCT, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME +), + +// Can be used to place macros on the numpad +[_GAME] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + +#elif defined CENTERNUM + +/* Base +,---------------------------------------------------------------------------------------------------------------------------------------------------------------. +|` |1 |2 |3 |4 |5 |Numlock |/ |* |= |6 |7 |8 |9 |0 |\ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Tab |Q |W |E |R |T |7 |8 |9 |- |Z |U |I |O |P |Backspace| +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|Esc/Nav |A |S |D |F |G |4 |5 |6 |+ |H |J |K |L |; |' | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|(/LShift |Y |X |C |V |B |1 |2 |3 |Enter |N |M |, |. |/ |)/RShift | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RCtrl | |Alt |Win |Lower |Space |00 |0 |. |Tab |Enter |Raise |Win |AltGr | |LCtrl | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT( - CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, - CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, KC_P4, KC_P5, KC_P6, KC_PEQL, - CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_P00, KC_P0, KC_PDOT, KC_TAB + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, KC_P7, KC_P8, KC_P9, KC_PPLS, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, KC_P4, KC_P5, KC_P6, CU_EQL, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, KC_P1, KC_P2, KC_P3, KC_PENT, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P00, KC_P0, KC_PDOT, KC_TAB, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL ), /* Lower ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|` |1 |2 |3 |4 |5 |Numlock |/ |* |- |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|~ |! |" |# |$ |% |^ |& |* |( |) | |7 |8 |9 |+ | +|~ |! |" |# |$ |% |7 |8 |9 |+ |^ |& |* |( |) | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || |4 |5 |6 |= | +| |@ |Strg+X |Strg+C |Strg+V | |4 |5 |6 |= | |_ |+ |{ |} || | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |? | | | | | | | | | | |1 |2 |3 |Enter | +| |? | | | | |1 |2 |3 |Enter | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |00 |0 |. |Tab | +| | | | | | |00 |0 |. |Tab | | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, _______, _______, _______, - _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, _______, _______, - _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, _______, _______, _______, _______, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, _______, _______, _______, _______, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Raise ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | +|` |1 |2 |3 |4 |5 |Numlock |/ |* |- |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |7 |8 |9 |+ | +|` |1 |2 |3 |4 |5 |7 |8 |9 |+ |6 |7 |8 |9 |0 | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ |4 |5 |6 |= | +| |F1 |F2 |F3 |F4 |F5 |4 |5 |6 |= |F6 |- |= |[ |] |\ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | |1 |2 |3 |Enter | +| |F7 |F8 |F9 |F10 |F11 |1 |2 |3 |Enter |F12 | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |00 |0 |. |Tab | +| | | | | | |00 |0 |. |Tab | | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, _______, _______, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, _______, _______, _______, _______, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, _______, _______, + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, _______, _______, _______, _______, CU_6, CU_7, CU_8, CU_9, CU_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, _______, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Deadkey ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -| | | | | | | | | | | | |Numlock |/ |* |- | +| | | | | | |Numlock |/ |* |- | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | |Ü | |Ö | | |7 |8 |9 |+ | +| | | | | | |7 |8 |9 |+ | |Ü | |Ö | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Ä |ß | | | | | | | | | |4 |5 |6 |= | +| |Ä |ß | | | |4 |5 |6 |= | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | | | | | | | | |1 |2 |3 |Enter | +| | | | | | |1 |2 |3 |Enter | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| | | | | |" |" | | | | | |00 |0 |. |Tab | +| | | | | |" |00 |0 |. |Tab |" | | | | | | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_DEADKEY] = LAYOUT( - CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, - KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, _______, _______, _______, _______, - _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, _______, _______, _______, _______, - _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______, _______, _______, _______, _______ + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, + _______, _______, _______, _______, _______, CU_DDQ, _______, _______, _______, _______, CU_DDQ, _______, _______, _______, _______, _______ ), /* Navigation ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|Escape | | | | | | | | | | | |Numlock |/ |* |- | +|Escape | | | | | |Numlock |/ |* |- | | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del |7 |8 |9 |+ | +|ALT F4 |PageDown |Up |PageUp |Home | |7 |8 |9 |+ | | |Win+Up | | |Del | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter |4 |5 |6 |= | +| |Left |Down |Right |End | |4 |5 |6 |= | |Win+Left |Win+Down |Win+Right| |Enter | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | |1 |2 |3 |Enter | +| |Prev |Pause |Next |LowerVol |RaiseVol |1 |2 |3 |Enter |Mute | | | | | | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|RESET | | | | | | | | | | |Game |00 |0 |. |Tab | +|RESET |ESCT | | | | |00 |0 |. |Tab | | | | | |Game | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT( - KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, - CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, _______, _______, _______, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, _______, _______, _______, - _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, - RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME, _______, _______, _______, _______ + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + ALTF4, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, _______, _______, _______, _______, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, _______, _______, _______, _______, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + RESET, CU_ESCT, _______, _______, _______, KC_SPC, _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, CU_GAME ), // Can be used to place macros on the numpad @@ -134,117 +256,117 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) -#endif -#ifdef LEFTNUM +#else + /* Base ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |\ |Numlock |/ |* |= | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace| -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 |Esc/Nav |A |S |D |F |G |H |J |K |L |; |' | +|Tab |Q |W |E |R |T |Z |U |I |O |P |Backspace|7 |8 |9 |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 |(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 |RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl | +|Esc/Nav |A |S |D |F |G |H |J |K |L |; |' |4 |5 |6 |+ | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|(/LShift |Y |X |C |V |B |N |M |, |. |/ |)/RShift |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RCtrl | |Alt |Win |Lower |Space |Enter |Raise |Win |AltGr | |LCtrl |00 |0 |. |Tab | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_BASE] = LAYOUT( - KC_PMNS, KC_PAST, KC_PSLS, KC_NLCK, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, - KC_PPLS, KC_P7, KC_P8, KC_P9, KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, - KC_PEQL, KC_P4, KC_P5, KC_P6, CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, - KC_PENT, KC_P1, KC_P2, KC_P3, CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, - KC_BSPC, KC_PDOT, KC_P0, KC_P00, KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, CU_BSLS, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, DE_Q, DE_W, DE_E, DE_R, DE_T, CU_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, KC_P7, KC_P8, KC_P9, KC_PPLS, + CU_NAV, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, CU_SCLN, CU_QUOT, KC_P4, KC_P5, KC_P6, CU_EQL, + CU_LSFT, CU_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, CU_COMM, CU_DOT, CU_SLSH, CU_RSFT, KC_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_P00, KC_P0, KC_PDOT, KC_TAB ), /* Lower ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |~ |! |" |# |$ |% |^ |& |* |( |) | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || | +|~ |! |" |# |$ |% |^ |& |* |( |) | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |? | | | | | | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | | | | | | | | | +| |@ |Strg+X |Strg+C |Strg+V | | |_ |+ |{ |} || |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |? | | | | | | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |00 |0 |. |Tab | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, - _______, _______, _______, _______, _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, - _______, _______, _______, _______, _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + DE_TILD, DE_EXLM, DE_DQOT, DE_HASH, DE_DLR, DE_PERC, CU_CIRC, DE_AMPR, DE_ASTR, DE_LPRN, DE_RPRN, _______, _______, _______, _______, _______, + _______, DE_AT, CTRLX, CTRLC, CTRLV, XXXXXXX, XXXXXXX, DE_UNDS, DE_PLUS, DE_LCBR, DE_RCBR, DE_PIPE, _______, _______, _______, _______, + _______, DE_EURO, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Raise ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ | +|` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |F7 |F8 |F9 |F10 |F11 |F12 | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | | | | | | | | | +| |F1 |F2 |F3 |F4 |F5 |F6 |- |= |[ |] |\ |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |F7 |F8 |F9 |F10 |F11 |F12 | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |00 |0 |. |Tab | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, - _______, _______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, - _______, _______, _______, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, + CU_GRV, DE_1, DE_2, CU_3, DE_4, DE_5, CU_6, CU_7, CU_8, CU_9, CU_0, _______, _______, _______, _______, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_MINS, CU_EQL, CU_LBRC, CU_RBRC, CU_BSLS, _______, _______, _______, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Deadkey ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock | | | | | | | | | | | | | +| | | | | | | | | | | | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 | | | | | | | |Ü | |Ö | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |Ä |ß | | | | | | | | | | +| | | | | | | |Ü | |Ö | | |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | | | | | | | | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 | | | | | |" |" | | | | | | +| |Ä |ß | | | | | | | | | |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | | | | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| | | | | |" |" | | | | | |00 |0 |. |Tab | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_DEADKEY] = LAYOUT( - _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, - _______, _______, _______, _______, KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, - _______, _______, _______, _______, _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, - _______, _______, _______, _______, _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______ + CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, + KC_TAB, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_UE, CU_ED, CU_OE, CU_ED, _______, _______, _______, _______, _______, + _______, CU_AE, CU_SS, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_DDQ, _______, _______, _______, _______, + _______, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, CU_ED, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, CU_DDQ, CU_DDQ, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Navigation ,---------------------------------------------------------------------------------------------------------------------------------------------------------------. -|- |* |/ |Numlock |Escape | | | | | | | | | | | | +|Escape | | | | | | | | | | | |Numlock |/ |* |- | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|+ |7 |8 |9 |ESCT |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|= |4 |5 |6 | |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter | +|ALT F4 |PageDown |Up |PageUp |Home | | | |Win+Up | | |Del |7 |8 |9 |+ | |---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Enter |1 |2 |3 | |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | | -|---------+---------+---------+---------|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| -|Backspace|. |0 |00 |RESET | | | | | | | | | | |Game | +| |Left |Down |Right |End | | |Win+Left |Win+Down |Win+Right| |Enter |4 |5 |6 |= | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +| |Prev |Pause |Next |LowerVol |RaiseVol |Mute | | | | | |1 |2 |3 |Enter | +|---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------+---------| +|RESET |ESCT | | | | | | | | | |Game |00 |0 |. |Tab | `---------------------------------------------------------------------------------------------------------------------------------------------------------------' */ [_NAV] = LAYOUT( - _______, _______, _______, _______, KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, CU_ESCT, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, - _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, - _______, _______, _______, _______, _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME + KC_ESC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, + ALTF4, KC_PGDN, KC_UP, KC_PGUP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, GUIU, XXXXXXX, XXXXXXX, KC_DEL, _______, _______, _______, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, XXXXXXX, XXXXXXX, GUIL, GUID, GUIR, XXXXXXX, KC_ENT, _______, _______, _______, _______, + _______, KC_MPRV, KC_MPLY, KC_MNXT, KC_VOLD, KC_VOLU, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______, + RESET, CU_ESCT, _______, _______, _______, KC_SPC, KC_ENT, _______, _______, _______, _______, CU_GAME, _______, _______, _______, _______ ), // Can be used to place macros on the numpad @@ -255,6 +377,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) + #endif }; @@ -272,6 +395,17 @@ switch (keycode) { } else { return true; } + case KC_LALT: + if (game) { + if (record->event.pressed){ + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + } else { + return true; + } case CU_GAME: if(record->event.pressed) { if (game) diff --git a/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md index eb8da3fa78..7e78330f07 100644 --- a/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md +++ b/keyboards/primekb/prime_o/keymaps/spacebarracecar/readme.md @@ -3,4 +3,4 @@ This keymap emulates most keys of the US-International layout on PCs that have German set as input language. This allows the use of the keyboard on any PC in Germany without the need to change any settings. The keymap is mostly based on the Planck default layout but adds essential features for german input, like access to Ä, Ö, Ü, ß. -Righthand Numpad is enabled by default, enable lefthand Numpad with #define LEFTNUM. +Righthand numpad is enabled by default, enable lefthand numpad with #define LEFTNUM and center numpad with #define CENTERNUM. diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h index 1e18253510..035c1ac790 100644 --- a/users/spacebarracecar/spacebarracecar.h +++ b/users/spacebarracecar/spacebarracecar.h @@ -81,6 +81,8 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record); #define CTRLC LCTL(KC_C) #define CTRLV LCTL(KC_V) +#define ALTF4 LALT(KC_F4) + #define GUIU LGUI(KC_UP) #define GUID LGUI(KC_DOWN) #define GUIL LGUI(KC_LEFT) -- cgit v1.2.3 From 9ee2991c3db72fbd4074f2b83185ef830d53cba4 Mon Sep 17 00:00:00 2001 From: Charlie McMackin Date: Sun, 18 Nov 2018 09:52:53 -0600 Subject: Default JIS TKL keymap for Pegasus Hoof (#4446) * Add TKL JIS layout for Pegasus Hoof Tested with a JIS Majestouch 2 TKL * Add default_jis keymap for Pegasus Hoof * Remove unnecessary keycode definition * Remove legacy fn_actions in favor of MO(1) * Remove unnecessary build directive --- .../pegasushoof/keymaps/default_jis/keymap.c | 54 ++++++++++++++++++++++ .../pegasushoof/keymaps/default_jis/rules.mk | 17 +++++++ keyboards/bpiphany/pegasushoof/pegasushoof.h | 18 ++++++++ 3 files changed, 89 insertions(+) create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c create mode 100644 keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c new file mode 100644 index 0000000000..a774741822 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/keymap.c @@ -0,0 +1,54 @@ +/* +Copyright 2016 Daniel Svensson + 2018 Charlie McMackin + +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 . +*/ + +#include QMK_KEYBOARD_H + +#define KM_JIS 0 +#define KM_MEDIA 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = + { + /* Layer 0: Standard JIS layer */ + [KM_JIS] = LAYOUT_tkl_jis(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_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_JYEN, 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_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_BSLS,KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH,KC_RO, KC_RSFT, KC_UP, \ + KC_LCTL, KC_LGUI,KC_LALT,KC_MHEN, KC_SPC, KC_HENK,KC_KANA,KC_RALT,MO(1), KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT), + /* Layer 1: Function layer */ + [KM_MEDIA] = LAYOUT_tkl_jis(_______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, \ + _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MPLY, \ + _______,_______,_______,_______, _______, _______,_______,_______,_______,RESET , KC_MPRV,KC_MSTP,KC_MNXT) + }; + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk new file mode 100644 index 0000000000..8254a83891 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/keymaps/default_jis/rules.mk @@ -0,0 +1,17 @@ +# 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 # 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 +CUSTOM_MATRIX = yes # Custom matrix file for the Pegasus Hoof due to the 2x74HC42 +NKRO_ENABLE = no # 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 controls +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. diff --git a/keyboards/bpiphany/pegasushoof/pegasushoof.h b/keyboards/bpiphany/pegasushoof/pegasushoof.h index d031e3ed25..939a854cd4 100644 --- a/keyboards/bpiphany/pegasushoof/pegasushoof.h +++ b/keyboards/bpiphany/pegasushoof/pegasushoof.h @@ -41,6 +41,24 @@ along with this program. If not, see . /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \ } +#define LAYOUT_tkl_jis( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO7, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO3, KO1, \ + KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \ + KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \ + ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ + /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , KG0 , KH0 , KI0 , KJ0 , KK0 , KL0 , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ + /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ + /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ + /* 3 */ { ___ , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ + /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ + /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ + /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , ___ , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ + /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , KO7 , KP7 , ___ , ___ }, \ +} + inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } inline void ph_caps_led_off(void) { DDRC &= ~(1<<6); PORTC &= ~(1<<6); } -- cgit v1.2.3 From 31298be2b17a1b9f203c8fd1d7bae8f923557cc0 Mon Sep 17 00:00:00 2001 From: zvecr Date: Sun, 18 Nov 2018 15:53:33 +0000 Subject: Add personal zvecr dz60 keymap (#4443) * Add Configurator support for dz60 ansi split space * Add keymap and fix layout macro --- keyboards/dz60/dz60.h | 27 +++++++++++++++++++++++ keyboards/dz60/info.json | 4 ++++ keyboards/dz60/keymaps/zvecr/keymap.c | 40 +++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+) create mode 100644 keyboards/dz60/keymaps/zvecr/keymap.c diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 2cf2eec7a0..62f6338cd4 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -170,6 +170,33 @@ { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ } +/* LAYOUT_60_ansi_split + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────────┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬────┬────┤ + * │40 │41 │43 │44 │46 │48 │4a │4b │4d │4e │ + * └────┴────┴────┴────────────────────────┴────┴────┴────┴────┘ +*/ +#define LAYOUT_60_ansi_split( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, \ + k40, k41, k43, k44, k46, k48, k4a, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, KC_NO }, \ + { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, KC_NO, k4d, k4e } \ +} + /* LAYOUT_60_iso * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0e │ diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index a163cc6a46..9ec7274531 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -25,6 +25,10 @@ "key_count": 61, "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] }, + "LAYOUT_60_ansi_split": { + "key_count": 61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":2.25}, {"label":"FN", "x":6.00, "y":4, "w":1.25}, {"x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_iso": { "key_count": 62, "layout": [{"label":"¬", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"£", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"CapsLock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"AltGr", "x":10, "y":4, "w":1.25}, {"label":"Win", "x":11.25, "y":4, "w":1.25}, {"label":"Menu", "x":12.5, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.75, "y":4, "w":1.25}] diff --git a/keyboards/dz60/keymaps/zvecr/keymap.c b/keyboards/dz60/keymaps/zvecr/keymap.c new file mode 100644 index 0000000000..9127fa0a7e --- /dev/null +++ b/keyboards/dz60/keymaps/zvecr/keymap.c @@ -0,0 +1,40 @@ +#include QMK_KEYBOARD_H + +/* +* Each layer gets a name for readability. +* 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, and you can also skip them entirely +* and just use numbers. +* +*/ +#define BL 0 // Base Layer +#define FL 1 // Function Layer +#define ML 2 // Macro Layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BL] = LAYOUT_60_ansi_split( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(FL), KC_SPC, KC_RALT, KC_RGUI, MO(ML), KC_RCTL), + + [FL] = LAYOUT_60_ansi_split( + KC_GRV, 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_DEL, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, + _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, KC_DEL, KC_END, KC_PGDN, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + + + [ML] = LAYOUT_60_ansi_split( + _______, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + +}; -- cgit v1.2.3 From de173e344e89ee356cfd0be75742122afac766d0 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 18 Nov 2018 08:23:51 -0800 Subject: Satan: add LAYOUT_60_ansi_split_rshift to info.json (#4441) --- keyboards/satan/info.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/keyboards/satan/info.json b/keyboards/satan/info.json index d0beb723b7..2b2e96ed19 100644 --- a/keyboards/satan/info.json +++ b/keyboards/satan/info.json @@ -20,8 +20,11 @@ "LAYOUT_60_iso_split_bs_rshift": { "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0}, {"label":"k49", "x":14, "y":0}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2c", "x":12.75, "y":2}, {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"k30", "x":0, "y":3, "w":1.25}, {"label":"k31", "x":1.25, "y":3}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.5}, {"label":"k41", "x":1.5, "y":4}, {"label":"k42", "x":2.5, "y":4, "w":1.5}, {"label":"k45", "x":4, "y":4, "w":6}, {"label":"k4a", "x":10, "y":4, "w":1.5}, {"label":"k4b", "x":11.5, "y":4}, {"label":"k4c", "x":12.5, "y":4}, {"label":"k4d", "x":13.5, "y":4, "w":1.5}] }, + "LAYOUT_60_ansi_split_rshift": { + "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0, "w":2}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k1d", "x":13.5, "y":1, "w":1.5}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2d", "x":12.75, "y":2, "w":2.25}, {"label":"k30", "x":0, "y":3, "w":2.25}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.25}, {"label":"k41", "x":1.25, "y":4, "w":1.25}, {"label":"k42", "x":2.5, "y":4, "w":1.25}, {"label":"k45", "x":3.75, "y":4, "w":6.25}, {"label":"k4a", "x":10, "y":4, "w":1.25}, {"label":"k4b", "x":11.25, "y":4, "w":1.25}, {"label":"k4c", "x":12.5, "y":4, "w":1.25}, {"label":"k4d", "x":13.75, "y":4, "w":1.25}] + }, "LAYOUT_60_iso_split_rshift": { "layout": [{"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0}, {"label":"k05", "x":5, "y":0}, {"label":"k06", "x":6, "y":0}, {"label":"k07", "x":7, "y":0}, {"label":"k08", "x":8, "y":0}, {"label":"k09", "x":9, "y":0}, {"label":"k0a", "x":10, "y":0}, {"label":"k0b", "x":11, "y":0}, {"label":"k0c", "x":12, "y":0}, {"label":"k0d", "x":13, "y":0, "w":2}, {"label":"k10", "x":0, "y":1, "w":1.5}, {"label":"k11", "x":1.5, "y":1}, {"label":"k12", "x":2.5, "y":1}, {"label":"k13", "x":3.5, "y":1}, {"label":"k14", "x":4.5, "y":1}, {"label":"k15", "x":5.5, "y":1}, {"label":"k16", "x":6.5, "y":1}, {"label":"k17", "x":7.5, "y":1}, {"label":"k18", "x":8.5, "y":1}, {"label":"k19", "x":9.5, "y":1}, {"label":"k1a", "x":10.5, "y":1}, {"label":"k1b", "x":11.5, "y":1}, {"label":"k1c", "x":12.5, "y":1}, {"label":"k20", "x":0, "y":2, "w":1.75}, {"label":"k21", "x":1.75, "y":2}, {"label":"k22", "x":2.75, "y":2}, {"label":"k23", "x":3.75, "y":2}, {"label":"k24", "x":4.75, "y":2}, {"label":"k25", "x":5.75, "y":2}, {"label":"k26", "x":6.75, "y":2}, {"label":"k27", "x":7.75, "y":2}, {"label":"k28", "x":8.75, "y":2}, {"label":"k29", "x":9.75, "y":2}, {"label":"k2a", "x":10.75, "y":2}, {"label":"k2b", "x":11.75, "y":2}, {"label":"k2c", "x":12.75, "y":2}, {"label":"k2d", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"k30", "x":0, "y":3, "w":1.25}, {"label":"k31", "x":1.25, "y":3}, {"label":"k32", "x":2.25, "y":3}, {"label":"k33", "x":3.25, "y":3}, {"label":"k34", "x":4.25, "y":3}, {"label":"k35", "x":5.25, "y":3}, {"label":"k36", "x":6.25, "y":3}, {"label":"k37", "x":7.25, "y":3}, {"label":"k38", "x":8.25, "y":3}, {"label":"k39", "x":9.25, "y":3}, {"label":"k3a", "x":10.25, "y":3}, {"label":"k3b", "x":11.25, "y":3}, {"label":"k3d", "x":12.25, "y":3, "w":1.75}, {"label":"k3c", "x":14, "y":3}, {"label":"k40", "x":0, "y":4, "w":1.25}, {"label":"k41", "x":1.25, "y":4, "w":1.25}, {"label":"k42", "x":2.5, "y":4, "w":1.25}, {"label":"k45", "x":3.75, "y":4, "w":6.25}, {"label":"k4a", "x":10, "y":4, "w":1.25}, {"label":"k4b", "x":11.25, "y":4, "w":1.25}, {"label":"k4c", "x":12.5, "y":4, "w":1.25}, {"label":"k4d", "x":13.75, "y":4, "w":1.25}] } } -} \ No newline at end of file +} -- cgit v1.2.3 From 504bf11769f1340711d749e8dc818f39a56a4dfb Mon Sep 17 00:00:00 2001 From: Florian Didron Date: Mon, 19 Nov 2018 01:24:41 +0900 Subject: Allows disabling rgb effects in userspace (#4422) * Allows disabling animations in user space * Describe disabling effects in the docs * Allows disabling individual reactive modes * Adds the list ode defines --- docs/feature_rgb_matrix.md | 24 +++++++ quantum/rgb_matrix.c | 170 +++++++++++++++++++++++++++++---------------- quantum/rgb_matrix.h | 44 ++++++++++-- 3 files changed, 173 insertions(+), 65 deletions(-) diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 809d034bdc..0af1e49479 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -150,6 +150,30 @@ These are the effects that are currently available: #endif RGB_MATRIX_EFFECT_MAX }; + +You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `config.h`: + + +|Define |Description | +|---------------------------------------------------|--------------------------------------------| +|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` | +|`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | +|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | +|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | +|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | +|`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON`|Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON`| +|`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | +|`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | +|`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | +|`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | +|`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | +|`#define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH` |Disables `RGB_MATRIX_SOLID_MULTISPLASH` | + ## Custom layer effects diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 26ee57f5c2..15bd136716 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -55,6 +55,10 @@ rgb_config_t rgb_matrix_config; #define RGB_DIGITAL_RAIN_DROPS 24 #endif +#if !defined(DISABLE_RGB_MATRIX_RAINDROPS) || !defined(DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS) || !defined(DISABLE_RGB_MATRIX_DIGITAL_RAIN) + #define TRACK_PREVIOUS_EFFECT +#endif + bool g_suspend_state = false; // Global tick at 20 Hz @@ -79,7 +83,12 @@ void eeconfig_update_rgb_matrix(uint32_t val) { void eeconfig_update_rgb_matrix_default(void) { dprintf("eeconfig_update_rgb_matrix_default\n"); rgb_matrix_config.enable = 1; +#ifndef DISABLE_RGB_MATRIX_CYCLE_ALL rgb_matrix_config.mode = RGB_MATRIX_CYCLE_LEFT_RIGHT; +#else + // fallback to solid colors if RGB_MATRIX_CYCLE_LEFT_RIGHT is disabled in userspace + rgb_matrix_config.mode = RGB_MATRIX_SOLID_COLOR; +#endif rgb_matrix_config.hue = 0; rgb_matrix_config.sat = 255; rgb_matrix_config.val = RGB_MATRIX_MAXIMUM_BRIGHTNESS; @@ -499,7 +508,7 @@ void rgb_matrix_digital_rain( const bool initialize ) { map_row_column_to_led(row, col, &led, &led_count); if (map[col][row] > pure_green_intensity) { - const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost + const uint8_t boost = (uint8_t) ((uint16_t) max_brightness_boost * (map[col][row] - pure_green_intensity) / (max_intensity - pure_green_intensity)); rgb_matrix_set_color(led, boost, max_intensity, boost); } @@ -618,12 +627,16 @@ void rgb_matrix_custom(void) { } void rgb_matrix_task(void) { - static uint8_t toggle_enable_last = 255; + #ifdef TRACK_PREVIOUS_EFFECT + static uint8_t toggle_enable_last = 255; + #endif if (!rgb_matrix_config.enable) { - rgb_matrix_all_off(); - rgb_matrix_indicators(); - toggle_enable_last = rgb_matrix_config.enable; - return; + rgb_matrix_all_off(); + rgb_matrix_indicators(); + #ifdef TRACK_PREVIOUS_EFFECT + toggle_enable_last = rgb_matrix_config.enable; + #endif + return; } // delay 1 second before driving LEDs or doing anything else static uint8_t startup_tick = 0; @@ -658,13 +671,16 @@ void rgb_matrix_task(void) { (RGB_DISABLE_AFTER_TIMEOUT > 0 && g_any_key_hit > RGB_DISABLE_AFTER_TIMEOUT * 60 * 20)); uint8_t effect = suspend_backlight ? 0 : rgb_matrix_config.mode; - // Keep track of the effect used last time, - // detect change in effect, so each effect can - // have an optional initialization. - static uint8_t effect_last = 255; - bool initialize = (effect != effect_last) || (rgb_matrix_config.enable != toggle_enable_last); - effect_last = effect; - toggle_enable_last = rgb_matrix_config.enable; + #ifdef TRACK_PREVIOUS_EFFECT + // Keep track of the effect used last time, + // detect change in effect, so each effect can + // have an optional initialization. + + static uint8_t effect_last = 255; + bool initialize = (effect != effect_last) || (rgb_matrix_config.enable != toggle_enable_last); + effect_last = effect; + toggle_enable_last = rgb_matrix_config.enable; + #endif // this gets ticked at 20 Hz. // each effect can opt to do calculations @@ -673,59 +689,93 @@ void rgb_matrix_task(void) { case RGB_MATRIX_SOLID_COLOR: rgb_matrix_solid_color(); break; - case RGB_MATRIX_ALPHAS_MODS: - rgb_matrix_alphas_mods(); - break; - case RGB_MATRIX_DUAL_BEACON: - rgb_matrix_dual_beacon(); - break; - case RGB_MATRIX_GRADIENT_UP_DOWN: - rgb_matrix_gradient_up_down(); - break; - case RGB_MATRIX_RAINDROPS: - rgb_matrix_raindrops( initialize ); - break; - case RGB_MATRIX_CYCLE_ALL: - rgb_matrix_cycle_all(); - break; - case RGB_MATRIX_CYCLE_LEFT_RIGHT: - rgb_matrix_cycle_left_right(); - break; - case RGB_MATRIX_CYCLE_UP_DOWN: - rgb_matrix_cycle_up_down(); - break; - case RGB_MATRIX_RAINBOW_BEACON: - rgb_matrix_rainbow_beacon(); - break; - case RGB_MATRIX_RAINBOW_PINWHEELS: - rgb_matrix_rainbow_pinwheels(); - break; - case RGB_MATRIX_RAINBOW_MOVING_CHEVRON: - rgb_matrix_rainbow_moving_chevron(); - break; - case RGB_MATRIX_JELLYBEAN_RAINDROPS: - rgb_matrix_jellybean_raindrops( initialize ); - break; - case RGB_MATRIX_DIGITAL_RAIN: - rgb_matrix_digital_rain( initialize ); - break; - #ifdef RGB_MATRIX_KEYPRESSES - case RGB_MATRIX_SOLID_REACTIVE: - rgb_matrix_solid_reactive(); + #ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS + case RGB_MATRIX_ALPHAS_MODS: + rgb_matrix_alphas_mods(); break; - case RGB_MATRIX_SPLASH: - rgb_matrix_splash(); + #endif + #ifndef DISABLE_RGB_MATRIX_DUAL_BEACON + case RGB_MATRIX_DUAL_BEACON: + rgb_matrix_dual_beacon(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN + case RGB_MATRIX_GRADIENT_UP_DOWN: + rgb_matrix_gradient_up_down(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_RAINDROPS + case RGB_MATRIX_RAINDROPS: + rgb_matrix_raindrops( initialize ); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_CYCLE_ALL + case RGB_MATRIX_CYCLE_ALL: + rgb_matrix_cycle_all(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT + case RGB_MATRIX_CYCLE_LEFT_RIGHT: + rgb_matrix_cycle_left_right(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN + case RGB_MATRIX_CYCLE_UP_DOWN: + rgb_matrix_cycle_up_down(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON + case RGB_MATRIX_RAINBOW_BEACON: + rgb_matrix_rainbow_beacon(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS + case RGB_MATRIX_RAINBOW_PINWHEELS: + rgb_matrix_rainbow_pinwheels(); break; - case RGB_MATRIX_MULTISPLASH: - rgb_matrix_multisplash(); + #endif + #ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON + case RGB_MATRIX_RAINBOW_MOVING_CHEVRON: + rgb_matrix_rainbow_moving_chevron(); break; - case RGB_MATRIX_SOLID_SPLASH: - rgb_matrix_solid_splash(); + #endif + #ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS + case RGB_MATRIX_JELLYBEAN_RAINDROPS: + rgb_matrix_jellybean_raindrops( initialize ); break; - case RGB_MATRIX_SOLID_MULTISPLASH: - rgb_matrix_solid_multisplash(); + #endif + #ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN + case RGB_MATRIX_DIGITAL_RAIN: + rgb_matrix_digital_rain( initialize ); break; #endif + #ifdef RGB_MATRIX_KEYPRESSES + #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE + case RGB_MATRIX_SOLID_REACTIVE: + rgb_matrix_solid_reactive(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_SPLASH + case RGB_MATRIX_SPLASH: + rgb_matrix_splash(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_MULTISPLASH + case RGB_MATRIX_MULTISPLASH: + rgb_matrix_multisplash(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH + case RGB_MATRIX_SOLID_SPLASH: + rgb_matrix_solid_splash(); + break; + #endif + #ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + case RGB_MATRIX_SOLID_MULTISPLASH: + rgb_matrix_solid_multisplash(); + break; + #endif + #endif default: rgb_matrix_custom(); break; diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index d2450a7d99..3cd248ffc4 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -70,24 +70,58 @@ typedef union { enum rgb_matrix_effects { RGB_MATRIX_SOLID_COLOR = 1, +#ifndef DISABLE_RGB_MATRIX_ALPHAS_MODS RGB_MATRIX_ALPHAS_MODS, +#endif +#ifndef DISABLE_RGB_MATRIX_DUAL_BEACON RGB_MATRIX_DUAL_BEACON, +#endif +#ifndef DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN RGB_MATRIX_GRADIENT_UP_DOWN, +#endif +#ifndef DISABLE_RGB_MATRIX_RAINDROPS RGB_MATRIX_RAINDROPS, +#endif +#ifndef DISABLE_RGB_MATRIX_CYCLE_ALL RGB_MATRIX_CYCLE_ALL, +#endif +#ifndef DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT RGB_MATRIX_CYCLE_LEFT_RIGHT, +#endif +#ifndef DISABLE_RGB_MATRIX_CYCLE_UP_DOWN RGB_MATRIX_CYCLE_UP_DOWN, +#endif +#ifndef DISABLE_RGB_MATRIX_RAINBOW_BEACON RGB_MATRIX_RAINBOW_BEACON, +#endif +#ifndef DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS RGB_MATRIX_RAINBOW_PINWHEELS, +#endif +#ifndef DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON RGB_MATRIX_RAINBOW_MOVING_CHEVRON, +#endif +#ifndef DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS RGB_MATRIX_JELLYBEAN_RAINDROPS, +#endif +#ifndef DISABLE_RGB_MATRIX_DIGITAL_RAIN RGB_MATRIX_DIGITAL_RAIN, +#endif #ifdef RGB_MATRIX_KEYPRESSES - RGB_MATRIX_SOLID_REACTIVE, - RGB_MATRIX_SPLASH, - RGB_MATRIX_MULTISPLASH, - RGB_MATRIX_SOLID_SPLASH, - RGB_MATRIX_SOLID_MULTISPLASH, + #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE + RGB_MATRIX_SOLID_REACTIVE, + #endif + #ifndef DISABLE_RGB_MATRIX_SPLASH + RGB_MATRIX_SPLASH, + #endif + #ifndef DISABLE_RGB_MATRIX_MULTISPLASH + RGB_MATRIX_MULTISPLASH, + #endif + #ifndef DISABLE_RGB_MATRIX_SOLID_SPLASH + RGB_MATRIX_SOLID_SPLASH, + #endif + #ifndef DISABLE_RGB_MATRIX_SOLID_MULTISPLASH + RGB_MATRIX_SOLID_MULTISPLASH, + #endif #endif RGB_MATRIX_EFFECT_MAX }; -- cgit v1.2.3 From bdd41715af2acdfbdbe78283d7519664dd01088e Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 16 Nov 2018 17:03:41 -0800 Subject: Make Ergodox EZ Glow's rgb matrix user configurable --- keyboards/ergodox_ez/ergodox_ez.c | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/ergodox_ez/ergodox_ez.c b/keyboards/ergodox_ez/ergodox_ez.c index 61f910711a..3b2c943506 100644 --- a/keyboards/ergodox_ez/ergodox_ez.c +++ b/keyboards/ergodox_ez/ergodox_ez.c @@ -269,6 +269,7 @@ const is31_led g_is31_leds[DRIVER_LED_TOTAL] = { }; +__attribute__ ((weak)) const rgb_led g_rgb_leds[DRIVER_LED_TOTAL] = { /*{row | col << 4} -- cgit v1.2.3 From 223b3d2be79594eddd3837067348ab97da2df8ae Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 18 Nov 2018 08:55:45 -0800 Subject: Fix i2c_master.d listed more than once warning --- keyboards/ergodox_ez/keymaps/default/keymap.c | 2 -- keyboards/ergodox_ez/rules.mk | 8 ++++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index ef70decd53..49de607737 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -1,6 +1,4 @@ #include QMK_KEYBOARD_H -#include "debug.h" -#include "action_layer.h" #include "version.h" #define BASE 0 // default layer diff --git a/keyboards/ergodox_ez/rules.mk b/keyboards/ergodox_ez/rules.mk index ef2aefbb9a..446ba3e21a 100644 --- a/keyboards/ergodox_ez/rules.mk +++ b/keyboards/ergodox_ez/rules.mk @@ -15,8 +15,7 @@ #---------------------------------------------------------------------------- # # project specific files -SRC = matrix.c \ - i2c_master.c +SRC += matrix.c # MCU name MCU = atmega32u4 @@ -85,4 +84,9 @@ API_SYSEX_ENABLE = no RGBLIGHT_ENABLE = yes RGB_MATRIX_ENABLE = no # enable later +ifeq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += i2c_master.c +endif + + LAYOUTS = ergodox -- cgit v1.2.3 From 4d66df5091412bb907bd95eef09a0b7e6567ab55 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 18 Nov 2018 08:59:52 -0800 Subject: Add default glow board --- keyboards/ergodox_ez/keymaps/default_glow/keymap.c | 1 + keyboards/ergodox_ez/keymaps/default_glow/readme.md | 15 +++++++++++++++ keyboards/ergodox_ez/keymaps/default_glow/rules.mk | 4 ++++ 3 files changed, 20 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/default_glow/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/default_glow/readme.md create mode 100644 keyboards/ergodox_ez/keymaps/default_glow/rules.mk diff --git a/keyboards/ergodox_ez/keymaps/default_glow/keymap.c b/keyboards/ergodox_ez/keymaps/default_glow/keymap.c new file mode 100644 index 0000000000..526c364029 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/default_glow/keymap.c @@ -0,0 +1 @@ +// Placeholder. See ../default/keymap.c for details diff --git a/keyboards/ergodox_ez/keymaps/default_glow/readme.md b/keyboards/ergodox_ez/keymaps/default_glow/readme.md new file mode 100644 index 0000000000..1150a4f709 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/default_glow/readme.md @@ -0,0 +1,15 @@ +# ErgoDox EZ Default Configuration + +## Changelog + +* Dec 2016: + * Added LED keys + * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. +* Sep 22, 2016: + * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. +* Feb 2, 2016 (V1.1): + * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). + +This is what we ship with out of the factory. :) The image says it all: + +![Default](https://i.imgur.com/Be53jH7.png) \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/default_glow/rules.mk b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk new file mode 100644 index 0000000000..360c3c51b8 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/default_glow/rules.mk @@ -0,0 +1,4 @@ +RGBLIGHT_ENABLE = no +RGB_MATRIX_ENABLE = yes # enable later + +SRC += ../default/keymap.c -- cgit v1.2.3 From e0690096f8b5199cd6f602bc3a11c234b4309fb2 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sun, 18 Nov 2018 15:20:21 -0800 Subject: Fix my community layouts (#4449) * fix formatting of keymap * update readme with boards I currently own * made the wrong assumption that every board would use the same space for backspace * update readme with boards I currently own --- layouts/community/60_ansi/mechmerlin-ansi/keymap.c | 26 +++++++++++----------- .../community/60_ansi/mechmerlin-ansi/readme.md | 7 +++--- .../mechmerlin-split/keymap.c | 24 ++++++++++---------- .../mechmerlin-split/readme.md | 3 ++- 4 files changed, 31 insertions(+), 29 deletions(-) diff --git a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c index 4128c4cf2d..12ed686802 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/keymap.c +++ b/layouts/community/60_ansi/mechmerlin-ansi/keymap.c @@ -3,24 +3,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_60_ansi( - KC_GESC, 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_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_BSLASH, \ - KC_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), + KC_GESC, 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_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_BSLASH, \ + KC_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_FNX, KC_RALT, KC_RGUI, KC_RCTL), [_FL] = LAYOUT_60_ansi( - KC_GRV, 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_DEL, \ - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_GRV, 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_DEL, \ + RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_AL] = LAYOUT_60_ansi( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/layouts/community/60_ansi/mechmerlin-ansi/readme.md b/layouts/community/60_ansi/mechmerlin-ansi/readme.md index 1c40def2a2..aefd6a9929 100644 --- a/layouts/community/60_ansi/mechmerlin-ansi/readme.md +++ b/layouts/community/60_ansi/mechmerlin-ansi/readme.md @@ -5,9 +5,10 @@ This is the 60% layout used by u/merlin36, host of the [MechMerlin](www.youtube. YouTube channel. It is used on his -[Duck Eagle V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/eagle_viper/v2) -[KBP V60 Type R Polestar](https://github.com/qmk/qmk_firmware/tree/master/keyboards/v60_type_r) -[NPKC KC60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kc60) +[Duck Eagle V2](https://github.com/qmk/qmk_firmware/tree/master/keyboards/eagle_viper/v2) +[NPKC KC60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/kc60) +[1up60HSE](https://github.com/qmk/qmk_firmware/tree/master/keyboards/1upkeyboards/1up60hse) +[HS60 V1](https://github.com/qmk/qmk_firmware/tree/master/keyboards/hs60/v1) ## Keymap Notes - Arrow toggle switch is tapping the `FN` key once. diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c index 2464dcaa70..96c3a32f26 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/keymap.c @@ -3,24 +3,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GESC, 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_NO, KC_BSPC, \ - 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_BSLASH, \ - KC_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), \ + KC_GESC, 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_BSPC, \ + 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_BSLASH, \ + KC_CTCP, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, TG(2), \ KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, MO(1), KC_RALT, KC_RGUI, KC_RCTL), [_FL] = LAYOUT_60_ansi_split_bs_rshift( - KC_GRV, 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_NO, KC_DEL, \ - RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_GRV, 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_DEL, KC_DEL, \ + RGB_TOG, KC_TRNS, KC_TRNS, KC_TRNS, RESET, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_AL] = LAYOUT_60_ansi_split_bs_rshift( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RSFT_T(KC_UP), KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT) }; diff --git a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md index 9f7cef347c..855fd5ac9e 100644 --- a/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md +++ b/layouts/community/60_ansi_split_bs_rshift/mechmerlin-split/readme.md @@ -6,7 +6,8 @@ host of the [MechMerlin](www.youtube.com/mechmerlin) YouTube channel. It is used on his [Sentraq S60-X RGB](https://github.com/qmk/qmk_firmware/tree/master/keyboards/s60_x) -[MechanicalKeyboards.com FaceW](https://github.com/qmk/qmk_firmware/tree/master/keyboards/bfake) +[Zeal60 Rev4](https://github.com/qmk/qmk_firmware/tree/master/keyboards/zeal60) +[DO60](https://github.com/qmk/qmk_firmware/tree/master/keyboards/do60) ## Keymap Notes - Highly influenced by the KBP V60 and WKL B.Face standard layouts -- cgit v1.2.3 From 9e0f68a6522a86625f2586003959fd12b18dd86b Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sun, 18 Nov 2018 17:51:00 -0800 Subject: Delete readme.md --- keyboards/ergodox_ez/keymaps/default_glow/readme.md | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/default_glow/readme.md diff --git a/keyboards/ergodox_ez/keymaps/default_glow/readme.md b/keyboards/ergodox_ez/keymaps/default_glow/readme.md deleted file mode 100644 index 1150a4f709..0000000000 --- a/keyboards/ergodox_ez/keymaps/default_glow/readme.md +++ /dev/null @@ -1,15 +0,0 @@ -# ErgoDox EZ Default Configuration - -## Changelog - -* Dec 2016: - * Added LED keys - * Refreshed layout graphic, comes from http://configure.ergodox-ez.com now. -* Sep 22, 2016: - * Created a new key in layer 1 (bottom-corner key) that resets the EEPROM. -* Feb 2, 2016 (V1.1): - * Made the right-hand quote key double as Cmd/Win on hold. So you get ' when you tap it, " when you tap it with Shift, and Cmd or Win when you hold it. You can then use it as a modifier, or just press and hold it for a moment (and then let go) to send a single Cmd or Win keystroke (handy for opening the Start menu on Windows). - -This is what we ship with out of the factory. :) The image says it all: - -![Default](https://i.imgur.com/Be53jH7.png) \ No newline at end of file -- cgit v1.2.3 From f03fd950009fdfd9fa0dcb6d343fe22c6ab386cb Mon Sep 17 00:00:00 2001 From: Maarten Dekkers Date: Mon, 19 Nov 2018 21:15:16 +0100 Subject: Fix permanently on capslock led on Atom47 (#4452) --- keyboards/atom47/rev2/rev2.c | 3 +++ keyboards/atom47/rev3/rev3.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/keyboards/atom47/rev2/rev2.c b/keyboards/atom47/rev2/rev2.c index 31a8561f0c..06fce06dad 100644 --- a/keyboards/atom47/rev2/rev2.c +++ b/keyboards/atom47/rev2/rev2.c @@ -17,6 +17,9 @@ void matrix_scan_kb(void) { void led_init_ports(void) { // * Set our LED pins as output DDRB &= ~(1<<5); + + //Set output high, so the capslock led is off + PORTB |= (1 << 5); } void led_set_kb(uint8_t usb_led) { diff --git a/keyboards/atom47/rev3/rev3.c b/keyboards/atom47/rev3/rev3.c index 2cd04fa767..c541ed559c 100644 --- a/keyboards/atom47/rev3/rev3.c +++ b/keyboards/atom47/rev3/rev3.c @@ -17,6 +17,9 @@ void matrix_scan_kb(void) { void led_init_ports(void) { // * Set our LED pins as output DDRE |= (1 << 6); + + //Set output high, so the capslock led is off + PORTE |= (1 << 6); } void led_set_kb(uint8_t usb_led) { -- cgit v1.2.3 From 26156e84e8913754586b16fecd41f268ede722df Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 19 Nov 2018 16:37:49 -0800 Subject: Fix UCIS code Revert code change that broke UCIS due to bad suggestions --- quantum/process_keycode/process_ucis.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 380199771d..8deb24a867 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -93,6 +93,8 @@ void register_ucis(const char *hex) { } bool process_ucis (uint16_t keycode, keyrecord_t *record) { + uint8_t i; + unicode_input_mode_init(); if (!qk_ucis_state.in_progress) @@ -122,7 +124,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { if (keycode == KC_ENT || keycode == KC_SPC || keycode == KC_ESC) { bool symbol_found = false; - for (uint8_t i = qk_ucis_state.count; i > 0; i--) { + for (i = qk_ucis_state.count; i > 0; i--) { register_code (KC_BSPC); unregister_code (KC_BSPC); wait_ms(UNICODE_TYPE_DELAY); @@ -134,7 +136,7 @@ bool process_ucis (uint16_t keycode, keyrecord_t *record) { } unicode_input_start(); - for (uint8_t i = 0; ucis_symbol_table[i].symbol; i++) { + for (i = 0; ucis_symbol_table[i].symbol; i++) { if (is_uni_seq (ucis_symbol_table[i].symbol)) { symbol_found = true; register_ucis(ucis_symbol_table[i].code + 2); -- cgit v1.2.3 From ad91454574ad1f0fad73923d04d6d1e037e45fed Mon Sep 17 00:00:00 2001 From: Michael Graf Date: Tue, 20 Nov 2018 15:55:35 +0100 Subject: Adaptive debounce logic The debounce filtering reports a key/switch change directly, without any extra delay. After that the debounce logic will filter all further changes, until the key/switch reports the same state for the given count of scans. So a perfect switch will get a short debounce period and a bad key will get a much longer debounce period. The result is an adaptive debouncing period for each switch. This value defines how often the same key/switch state has to be detected in successive reads until the next key state can be reported. In other words this value defines the minimum debouncing period for a switch. --- keyboards/ergodox_ez/config.h | 17 ++++++++------- keyboards/ergodox_ez/matrix.c | 49 ++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 28 deletions(-) diff --git a/keyboards/ergodox_ez/config.h b/keyboards/ergodox_ez/config.h index 7a350183b1..ee768853a9 100644 --- a/keyboards/ergodox_ez/config.h +++ b/keyboards/ergodox_ez/config.h @@ -85,17 +85,20 @@ along with this program. If not, see . #define RGBW 1 -/* "debounce" is measured in keyboard scans. Some users reported - * needing values as high as 15, which was at the time around 50ms. +/* + * The debounce filtering reports a key/switch change directly, + * without any extra delay. After that the debounce logic will filter + * all further changes, until the key/switch reports the same state for + * the given count of scans. + * So a perfect switch will get a short debounce period and + * a bad key will get a much longer debounce period. + * The result is an adaptive debouncing period for each switch. + * * If you don't define it here, the matrix code will default to * 5, which is now closer to 10ms, but still plenty according to * manufacturer specs. - * - * Default is quite high, because of reports with some production - * runs seeming to need it. This may change when configuration for - * this is more directly exposed. */ -#define DEBOUNCE 15 +#define DEBOUNCE 10 #define USB_MAX_POWER_CONSUMPTION 500 diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 2e95c83b65..6d5bfca31a 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -57,6 +57,11 @@ along with this program. If not, see . /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; +/* + * matrix state(1:on, 0:off) + * contains the raw values without debounce filtering of the last read cycle. + */ +static matrix_row_t raw_matrix[MATRIX_ROWS]; // Debouncing: store for each key the number of scans until it's eligible to // change. When scanning the matrix, ignore any changes in keys that have @@ -118,6 +123,7 @@ void matrix_init(void) // initialize matrix state: all keys off for (uint8_t i=0; i < MATRIX_ROWS; i++) { matrix[i] = 0; + raw_matrix[i] = 0; for (uint8_t j=0; j < MATRIX_COLS; ++j) { debounce_matrix[i * MATRIX_COLS + j] = 0; } @@ -151,26 +157,30 @@ void matrix_power_up(void) { // Returns a matrix_row_t whose bits are set if the corresponding key should be // eligible to change in this scan. -matrix_row_t debounce_mask(uint8_t row) { +matrix_row_t debounce_mask(matrix_row_t rawcols, uint8_t row) { matrix_row_t result = 0; - for (uint8_t j=0; j < MATRIX_COLS; ++j) { - if (debounce_matrix[row * MATRIX_COLS + j]) { - --debounce_matrix[row * MATRIX_COLS + j]; + matrix_row_t change = rawcols ^ raw_matrix[row]; + raw_matrix[row] = rawcols; + for (uint8_t i = 0; i < MATRIX_COLS; ++i) { + if (debounce_matrix[row * MATRIX_COLS + i]) { + --debounce_matrix[row * MATRIX_COLS + i]; } else { - result |= (1 << j); + result |= (1 << i); } - } - return result; -} - -// Report changed keys in the given row. Resets the debounce countdowns -// corresponding to each set bit in 'change' to DEBOUNCE. -void debounce_report(matrix_row_t change, uint8_t row) { - for (uint8_t i = 0; i < MATRIX_COLS; ++i) { if (change & (1 << i)) { debounce_matrix[row * MATRIX_COLS + i] = DEBOUNCE; } } + return result; +} + +matrix_row_t debounce_read_cols(uint8_t row) { + // Read the row without debouncing filtering and store it for later usage. + matrix_row_t cols = read_cols(row); + // Get the Debounce mask. + matrix_row_t mask = debounce_mask(cols, row); + // debounce the row and return the result. + return (cols & mask) | (matrix[row] & ~mask);; } uint8_t matrix_scan(void) @@ -214,15 +224,12 @@ uint8_t matrix_scan(void) select_row(i + MATRIX_ROWS_PER_SIDE); // we don't need a 30us delay anymore, because selecting a // left-hand row requires more than 30us for i2c. - matrix_row_t mask = debounce_mask(i); - matrix_row_t cols = (read_cols(i) & mask) | (matrix[i] & ~mask); - debounce_report(cols ^ matrix[i], i); - matrix[i] = cols; + + // grab cols from left hand + matrix[i] = debounce_read_cols(i); // grab cols from right hand - mask = debounce_mask(i + MATRIX_ROWS_PER_SIDE); - cols = (read_cols(i + MATRIX_ROWS_PER_SIDE) & mask) | (matrix[i + MATRIX_ROWS_PER_SIDE] & ~mask); - debounce_report(cols ^ matrix[i + MATRIX_ROWS_PER_SIDE], i + MATRIX_ROWS_PER_SIDE); - matrix[i + MATRIX_ROWS_PER_SIDE] = cols; + matrix[i + MATRIX_ROWS_PER_SIDE] = debounce_read_cols(i + MATRIX_ROWS_PER_SIDE); + unselect_rows(); } -- cgit v1.2.3 From 93c0362552603f2d2517ff3b5afe2667968e3bda Mon Sep 17 00:00:00 2001 From: Nick Piazza Date: Tue, 20 Nov 2018 12:07:20 -0600 Subject: Update Levinson readme to support elite-c (#4445) * init - updated levinson readme to support elite-c * updated readme per PR comment * added trailing spaces to lines 6 7 8 * updated readme bootloader instructions * updated readme * updated readme --- keyboards/levinson/readme.md | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/keyboards/levinson/readme.md b/keyboards/levinson/readme.md index 79e64d332e..8cb4ff1cf7 100644 --- a/keyboards/levinson/readme.md +++ b/keyboards/levinson/readme.md @@ -4,17 +4,25 @@ Levinson A split 40% split 4x12 ortholinear keyboard made and sold by Keebio. It's essentially a Let's Split with LED backlight support and 2u thumb key support. [More info at Keebio](https://keeb.io). Keyboard Maintainer: [Bakingpy/nooges](https://github.com/nooges) -Hardware Supported: Pro Micro +Hardware Supported: Pro Micro, Elite-C Hardware Availability: [Keebio](https://keeb.io) Make example for this keyboard (after setting up your build environment): make levinson/rev2:default -Example of flashing this keyboard: +Example of flashing this keyboard with Pro micro: make levinson/rev2:default:avrdude -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +Example of flashing this keyboard with Elite-C: + +You'll need to add `BOOTLOADER = atmel-dfu` to your `rules.mk` to ensure that resetting the board works properly. + +Hold the reset button on the Elite-C board, or the reset button on the keyboard if already assembled, then release the button and run: + + make levinson/rev2:default:dfu + +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). A build guide for this keyboard can be found here: [Levinson Build Guide](https://docs.keeb.io) -- cgit v1.2.3 From 303fa4ec3337760922a17fb19150c1aa3f58a3b3 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: 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 ++++++ keyboards/handwired/108key_trackpoint/README.md | 23 ++++++ keyboards/handwired/108key_trackpoint/config.h | 73 +++++++++++++++++++ .../108key_trackpoint/keymaps/default/keymap.c | 14 ++++ .../108key_trackpoint/keymaps/dvorak/keymap.c | 14 ++++ .../keymaps/dvorak_media/keymap.c | 14 ++++ keyboards/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 0000000000..3834f89613 --- /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 0000000000..100f4cb932 --- /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 0000000000..247043e171 --- /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 0000000000..7a63fe2628 --- /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 0000000000..3345aca169 --- /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 0000000000..0181ad9f77 --- /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 0000000000..d6223c496e --- /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 0000000000..84ec52eee9 --- /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 -- cgit v1.2.3 From 8837b9d99e59f9d815992352a28a1a515893e805 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 21 Nov 2018 07:49:28 -0800 Subject: Fix row 11 --- keyboards/ergodox_ez/matrix.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/keyboards/ergodox_ez/matrix.c b/keyboards/ergodox_ez/matrix.c index 2e95c83b65..3ff1c7ab45 100644 --- a/keyboards/ergodox_ez/matrix.c +++ b/keyboards/ergodox_ez/matrix.c @@ -379,7 +379,7 @@ static void select_row(uint8_t row) break; case 11: DDRD |= (1<<2); - PORTD &= ~(1<<3); + PORTD &= ~(1<<2); break; case 12: DDRD |= (1<<3); @@ -392,4 +392,3 @@ static void select_row(uint8_t row) } } } - -- cgit v1.2.3 From 2f34252278280c34b6958066240e38a2ee6a7237 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Wed, 21 Nov 2018 13:18:18 -0800 Subject: Keymap: Update keymap to match latest changes to Wilba's firmware. (#4432) * Fix firmware to work with latest Wilba changes (i.e. dynamic keymap) and M60a. * Get back RGB Backlight codes. * More tweaks. * Update users/talljoe/rules.mk Co-Authored-By: Talljoe --- keyboards/rama/m60_a/rules.mk | 6 +- .../minivan/keymaps/talljoe-minivan/config.h | 53 ++++++++++++ .../minivan/keymaps/talljoe-minivan/keymap.c | 1 + .../minivan/keymaps/talljoe-minivan/rules.mk | 3 + keyboards/tv44/keymaps/talljoe-minivan/config.h | 53 ------------ keyboards/tv44/keymaps/talljoe-minivan/keymap.c | 1 - keyboards/tv44/keymaps/talljoe-minivan/rules.mk | 3 - .../60_ansi_split_bs_rshift/talljoe/config.h | 2 +- .../60_ansi_split_bs_rshift/talljoe/keymap.c | 95 +--------------------- layouts/community/60_hhkb/talljoe-hhkb/config.h | 3 + layouts/community/tkl_ansi/talljoe-tkl/keymap.c | 90 +------------------- users/talljoe/config.h | 4 + users/talljoe/rules.mk | 2 + users/talljoe/talljoe.c | 34 +++++++- 14 files changed, 104 insertions(+), 246 deletions(-) create mode 100644 keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h create mode 100644 keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c create mode 100644 keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk delete mode 100644 keyboards/tv44/keymaps/talljoe-minivan/config.h delete mode 100644 keyboards/tv44/keymaps/talljoe-minivan/keymap.c delete mode 100644 keyboards/tv44/keymaps/talljoe-minivan/rules.mk diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 7ab1b7d3ba..9c1a2d9df7 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -54,7 +54,7 @@ BOOTLOADER = atmel-dfu OPT_DEFS += -DNO_SUSPEND_POWER_DOWN # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -68,7 +68,7 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend @@ -76,3 +76,5 @@ SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes CIE1931_CURVE = yes + +LAYOUTS = 60_hhkb diff --git a/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h new file mode 100644 index 0000000000..26d5e207e8 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/config.h @@ -0,0 +1,53 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include QMK_KEYBOARD_CONFIG_H + +#define SPACE_COUNT 2 + +#define TEMPLATE( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K0D, \ + K41, K49, K42, K44, K45, K3C, K0B, K00, K3D \ +) + +#define TEMPLATE_ALT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K41, K49, K42, K44, K45, K48, K49, K4B, K4C \ +) + +#define TEMPLATE_ADJUST( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ + K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ +) LAYOUT_arrow( \ + K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K2D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K44, K45, K48, K0B, K0C, K4C \ +) + +#define TEMPLATE_RESET LAYOUT_arrow( \ + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, \ + 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, KC_NO, \ + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET) + +#endif diff --git a/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c new file mode 100644 index 0000000000..7812add812 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/keymap.c @@ -0,0 +1 @@ +// This space intentionally left blank diff --git a/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk new file mode 100644 index 0000000000..a4e40d0ba6 --- /dev/null +++ b/keyboards/thevankeyboards/minivan/keymaps/talljoe-minivan/rules.mk @@ -0,0 +1,3 @@ +USER_NAME := talljoe + +COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/keyboards/tv44/keymaps/talljoe-minivan/config.h b/keyboards/tv44/keymaps/talljoe-minivan/config.h deleted file mode 100644 index fa1f43adce..0000000000 --- a/keyboards/tv44/keymaps/talljoe-minivan/config.h +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include QMK_KEYBOARD_CONFIG_H - -#define SPACE_COUNT 2 - -#define TEMPLATE( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K0D, \ - K41, K49, K42, K44, K45, K3C, K0B, K00, K3D \ -) - -#define TEMPLATE_ALT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K41, K49, K42, K44, K45, K48, K49, K4B, K4C \ -) - -#define TEMPLATE_ADJUST( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K2D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K44, K45, K46, K48, K49, K4B, K4C \ -) KEYMAP_ARROW( \ - K00, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K2D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2C, \ - K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ - K40, K49, K42, K44, K45, K48, K0B, K0C, K4C \ -) - -#define TEMPLATE_RESET KEYMAP_ARROW( \ - RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET, \ - 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, KC_NO, \ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RESET) - -#endif diff --git a/keyboards/tv44/keymaps/talljoe-minivan/keymap.c b/keyboards/tv44/keymaps/talljoe-minivan/keymap.c deleted file mode 100644 index 7812add812..0000000000 --- a/keyboards/tv44/keymaps/talljoe-minivan/keymap.c +++ /dev/null @@ -1 +0,0 @@ -// This space intentionally left blank diff --git a/keyboards/tv44/keymaps/talljoe-minivan/rules.mk b/keyboards/tv44/keymaps/talljoe-minivan/rules.mk deleted file mode 100644 index a4e40d0ba6..0000000000 --- a/keyboards/tv44/keymaps/talljoe-minivan/rules.mk +++ /dev/null @@ -1,3 +0,0 @@ -USER_NAME := talljoe - -COMMAND_ENABLE = no # Commands for debug and configuration diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h index bf18fd9f7d..65568d3abf 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h @@ -34,7 +34,7 @@ { K40, K41, K42, {}, {}, {}, {}, K47, {}, {}, K4A, K4B, K4C, K4D } \ } -#ifdef KEYBOARD_zeal60 +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) #define ZEAL_RGB diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c index cfad9da8a3..7812add812 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c @@ -1,94 +1 @@ -#ifdef KEYBOARD_zeal60 -#include "config.h" -#include "zeal60.h" -#include "rgb_backlight.h" -#include "action_layer.h" -#include "solarized.h" -#include "talljoe.h" - -// from zeal_backlight.c -// we want to be able to set indicators for the spacebar stabs -// but they are not represented by a row/index. -extern backlight_config g_config; -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); - -void set_backlight_defaults(void) { - uint8_t space; - uint8_t caps_lock; - map_row_column_to_led(3, 12, &caps_lock); - map_row_column_to_led(4, 7, &space); - backlight_config default_values = { - .use_split_backspace = USE_SPLIT_BACKSPACE, - .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, - .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, - .use_7u_spacebar = USE_7U_SPACEBAR, - .use_iso_enter = USE_ISO_ENTER, - .disable_when_usb_suspended = 1, - .disable_after_timeout = 0, - .brightness = 255, - .effect = 10, - .color_1 = solarized.base2, - .color_2 = solarized.base02, - .caps_lock_indicator = { .index = caps_lock, .color = solarized.red }, - .layer_1_indicator = { .index = space, .color = solarized.blue }, - .layer_2_indicator = { .index = space, .color = solarized.yellow }, - .layer_3_indicator = { .index = 254, .color = solarized.red }, - .alphas_mods = { - RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } - }; - memcpy(&g_config, &default_values, sizeof(backlight_config)); - backlight_config_save(); - -#undef CUSTOM_RGB_LAYOUTS -#ifdef CUSTOM_RGB_LAYOUTS - solarized_t* S = &solarized; - HSV alphas = S->base2; - HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( - S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red, - S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange, - S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green, - S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue, - S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green - ); - for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { - for (uint8_t col = 0; col < MATRIX_COLS; ++col) { - uint8_t index; - map_row_column_to_led( row, col, &index ); - set_key_color(index, custom_color_map[row][col]); - } - } -#endif // CUSTOM_RGB_LAYOUTS -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - static uint8_t last_effect; - switch (keycode) { - case DFAULTS: - if (IS_PRESSED(record->event)) set_backlight_defaults(); - return false; - case BL_TOGG: - if (IS_PRESSED(record->event)) { - if (g_config.effect) { - last_effect = g_config.effect; - g_config.effect = 0; - } else { - g_config.effect = last_effect; - } - } - return false; - case EFFECT...EFFECT_END: - if (IS_PRESSED(record->event)) { - uint8_t effect = keycode - EFFECT; - g_config.effect = effect; - backlight_config_save(); - } - return false; - } - - return true; -} -#endif +// This space intentionally left blank diff --git a/layouts/community/60_hhkb/talljoe-hhkb/config.h b/layouts/community/60_hhkb/talljoe-hhkb/config.h index 9e907feeb5..54756a940b 100644 --- a/layouts/community/60_hhkb/talljoe-hhkb/config.h +++ b/layouts/community/60_hhkb/talljoe-hhkb/config.h @@ -19,4 +19,7 @@ K41, K42, K45, K48, K4C \ ) +#ifdef RGB_BACKLIGHT_M60_A + #define ZEAL_RGB +#endif #endif //CONFIG_USER_H diff --git a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c index b5dc544927..7812add812 100644 --- a/layouts/community/tkl_ansi/talljoe-tkl/keymap.c +++ b/layouts/community/tkl_ansi/talljoe-tkl/keymap.c @@ -1,89 +1 @@ -#ifdef KEYBOARD_zeal60 -#include "config.h" -#include "zeal60.h" -#include "zeal_backlight.h" -#include "action_layer.h" -#include "solarized.h" -#include "talljoe.h" - -// from zeal_backlight.c -// we want to be able to set indicators for the spacebar stabs -// but they are not represented by a row/index. -extern zeal_backlight_config g_config; -void map_row_column_to_led( uint8_t row, uint8_t column, uint8_t *led ); - -void set_backlight_defaults(void) { - uint8_t space; - uint8_t caps_lock; - map_row_column_to_led(3, 12, &caps_lock); - map_row_column_to_led(4, 7, &space); - zeal_backlight_config default_values = { - .use_split_backspace = USE_SPLIT_BACKSPACE, - .use_split_left_shift = USE_SPLIT_LEFT_SHIFT, - .use_split_right_shift = USE_SPLIT_RIGHT_SHIFT, - .use_7u_spacebar = USE_7U_SPACEBAR, - .use_iso_enter = USE_ISO_ENTER, - .disable_when_usb_suspended = 1, - .disable_after_timeout = 0, - .brightness = 255, - .effect = 10, - .color_1 = solarized.base2, - .color_2 = solarized.base02, - .caps_lock_indicator = { .index = caps_lock, .color = solarized.red }, - .layer_1_indicator = { .index = space, .color = solarized.blue }, - .layer_2_indicator = { .index = space, .color = solarized.yellow }, - .layer_3_indicator = { .index = 254, .color = solarized.red }, - .alphas_mods = { - BACKLIGHT_ALPHAS_MODS_ROW_0, - BACKLIGHT_ALPHAS_MODS_ROW_1, - BACKLIGHT_ALPHAS_MODS_ROW_2, - BACKLIGHT_ALPHAS_MODS_ROW_3, - BACKLIGHT_ALPHAS_MODS_ROW_4 } - }; - memcpy(&g_config, &default_values, sizeof(zeal_backlight_config)); - backlight_config_save(); - - solarized_t* S = &solarized; - HSV alphas = S->base2; - HSV custom_color_map[MATRIX_ROWS][MATRIX_COLS] = CM( - S->red, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->red, - S->orange, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->orange, - S->green, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->green, - S->blue, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, alphas, S->blue, S->blue, - S->violet, S->magenta, S->yellow, alphas, S->yellow, S->magenta, S->violet, S->green - ); - for (uint8_t row = 0; row < MATRIX_ROWS; ++row) { - for (uint8_t col = 0; col < MATRIX_COLS; ++col) { - backlight_set_key_color(row, col, custom_color_map[row][col]); - } - } -} - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - static uint8_t last_effect; - switch (keycode) { - case DFAULTS: - if (IS_PRESSED(record->event)) set_backlight_defaults(); - return false; - case BL_TOGG: - if (IS_PRESSED(record->event)) { - if (g_config.effect) { - last_effect = g_config.effect; - g_config.effect = 0; - } else { - g_config.effect = last_effect; - } - } - return false; - case EFFECT...EFFECT_END: - if (IS_PRESSED(record->event)) { - uint8_t effect = keycode - EFFECT; - g_config.effect = effect; - backlight_config_save(); - } - return false; - } - - return true; -} -#endif +// This space intentionally left blank diff --git a/users/talljoe/config.h b/users/talljoe/config.h index 0d06a0b12d..33374014df 100644 --- a/users/talljoe/config.h +++ b/users/talljoe/config.h @@ -5,4 +5,8 @@ #define RESET_LAYER 15 +#define BOOTMAGIC_KEY_SALT KC_ESC +#define BOOTMAGIC_KEY_SKIP KC_I +#define BOOTMAGIC_KEY_EEPROM_CLEAR KC_E + #endif // !USERSPACE_CONFIG_H diff --git a/users/talljoe/rules.mk b/users/talljoe/rules.mk index 0f1f6f26a6..e0a71561f4 100644 --- a/users/talljoe/rules.mk +++ b/users/talljoe/rules.mk @@ -5,3 +5,5 @@ EXTRAFLAGS+=-flto TAP_DANCE_ENABLE=yes CONSOLE_ENABLE=no COMMAND_ENABLE=no +DYNAMIC_KEYMAP_ENABLE=no +BOOTMAGIC_ENABLE=full diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c index 7a343e7768..e72dc6c3e0 100644 --- a/users/talljoe/talljoe.c +++ b/users/talljoe/talljoe.c @@ -1,13 +1,16 @@ #include QMK_KEYBOARD_H #include "talljoe.h" +#ifdef ZEAL_RGB +#include "../../../keyboards/zeal60/rgb_backlight.h" +#endif const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = TEMPLATE_TKL( 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, MO_ADJ , US_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 , US_BSLS, KC_INS , KC_HOME, KC_PGUP, US_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_BSPC, KC_DEL , KC_END , KC_PGDN, - CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, US_QUOT, US_ENT , + CTL_ESC, KC_A, KC_S, KC_D, KC_F, KC_G , KC_H, KC_J, KC_K, KC_L, US_SCLN, KC_QUOT, US_ENT , SH_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B , KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SH_RBRC, KC_UP , KC_LCTL, KC_LGUI, KC_LALT, KC_SPC2, KC_SPC1, KC_SPC3, KC_RALT, KC_RGUI, KC_RCTL, KC_PTT , KC_LEFT, KC_DOWN, KC_RGHT), [_WORKMAN] = TEMPLATE( @@ -52,7 +55,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_PTT , KC_PGDN, KC_SPC , KC_SPC , KC_SPC , KC_RALT, KC_APP , KC_RCTL, KC_PTT ), #endif [_NAV] = TEMPLATE_NAV( - KC_GRV , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 , XXXXXXX, XXXXXXX, US_TAB , KC_EXLM, KC_AT , KC_HASH, KC_DLR , KC_PERC, KC_INS , KC_PGUP, KC_UP , KC_PGDN, KC_BTN1, KC_BTN3, KC_BTN2, KC_DEL , CTL_ESC, KC_LCBR, KC_RCBR, KC_LPRN, KC_RPRN, KC_AMPR, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END , US_QUOT, TG_ADJ , KC_LSFT, KC_EQL, KC_PLUS, KC_MINS, KC_UNDS, KC_ASTR, KC_CALC, US_GRV , KC_WBAK, KC_WFWD, KC_WREF, KC_RSFT, KC_APP , @@ -65,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL, KC_LGUI, KC_LALT, NM_SPC2, NM_SPC1, NM_SPC3, KC_PDOT, KC_PCMM, KC_RCTL, KC_PTT ), // Adjust layer is on the split-shift key; or NAV+Enter (for non-split keyboards) [_ADJUST] = TEMPLATE_ADJUST( - MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(8) , FX(9) , FX(10) , FX(20) , FX(0) , BR_DEC , BR_INC , XXXXXXX, MO_RST , + MO_RST , FX(1) , FX(2) , FX(3) , FX(4) , FX(5) , FX(6) , FX(7) , FX(8) , FX(9) , FX(10) , BR_DEC , BR_INC , XXXXXXX, MO_RST , MO_RST , H1_INC , S1_INC , H2_INC , S2_INC , EF_INC , RGB_HUI, RGB_SAI, RGB_MOD, RGB_M_P, DFAULTS, RGB_VAD, RGB_VAI, MO_RST , XXXXXXX, H1_DEC , S1_DEC , H2_DEC , S2_DEC , EF_DEC , RGB_HUD, RGB_SAD, RGB_RMOD,RGB_M_K, RGB_M_B, RGB_M_G, TG_ADJ , TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, LY_MALT, XXXXXXX, XXXXXXX, KC_MAKE, KC_CAPS, XXXXXXX, @@ -101,7 +104,11 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } +#ifdef ZEAL_RGB +extern backlight_config g_config; +#endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint8_t last_effect; #ifdef RGBLIGHT_ENABLE static uint32_t savedRgbMode; @@ -144,6 +151,27 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; +#ifdef ZEAL_RGB + case BL_TOGG: + if (IS_PRESSED(record->event)) { + if (g_config.effect) { + last_effect = g_config.effect; + g_config.effect = 0; + } else { + g_config.effect = last_effect; + } + } + return false; + case EFFECT...EFFECT_END: + if (IS_PRESSED(record->event)) { + uint8_t effect = keycode - EFFECT; + if(effect == g_config.effect) + effect = 0; // Toggle effect on second press + g_config.effect = effect; + backlight_config_save(); + } + return false; +#endif } return process_record_keymap(keycode, record); } -- cgit v1.2.3 From 87f06e7297c10020912beaba10013f11d2e8e570 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 21 Nov 2018 15:12:40 -0800 Subject: Fix raw hid define for chibios (#4460) --- tmk_core/protocol/chibios/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 6cceccd23c..ee9571c950 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -75,7 +75,7 @@ host_driver_t chibios_driver = { void virtser_task(void); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE void raw_hid_task(void); #endif @@ -220,7 +220,7 @@ int main(void) { #ifdef VIRTSER_ENABLE virtser_task(); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE raw_hid_task(); #endif } -- cgit v1.2.3 From 2943d19ecd9f91db2390da6f6d09cf58ea2f8dde Mon Sep 17 00:00:00 2001 From: Milton Griffin Date: Thu, 22 Nov 2018 13:15:46 -0500 Subject: Keymap: Clone layout for Massdrop's xd75 (#4461) * Added default75. No lighting. * Added default75. No lighting. * Update keyboards/idobo/keymaps/default75/config.h Co-Authored-By: griffinmilton3 * Update keyboards/idobo/keymaps/default75/config.h Co-Authored-By: griffinmilton3 * Update keyboards/idobo/keymaps/default75/config.h Co-Authored-By: griffinmilton3 * Update keyboards/idobo/keymaps/default75/config.h Co-Authored-By: griffinmilton3 * Fixes for pull request * Updated keyboard declartion structure --- keyboards/idobo/keymaps/default75/config.h | 21 +++++++++ keyboards/idobo/keymaps/default75/keymap.c | 67 +++++++++++++++++++++++++++++ keyboards/idobo/keymaps/default75/readme.md | 1 + keyboards/idobo/keymaps/default75/rules.mk | 14 ++++++ 4 files changed, 103 insertions(+) create mode 100644 keyboards/idobo/keymaps/default75/config.h create mode 100644 keyboards/idobo/keymaps/default75/keymap.c create mode 100644 keyboards/idobo/keymaps/default75/readme.md create mode 100644 keyboards/idobo/keymaps/default75/rules.mk diff --git a/keyboards/idobo/keymaps/default75/config.h b/keyboards/idobo/keymaps/default75/config.h new file mode 100644 index 0000000000..17c7addb38 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/config.h @@ -0,0 +1,21 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 + + +// place overrides here + diff --git a/keyboards/idobo/keymaps/default75/keymap.c b/keyboards/idobo/keymaps/default75/keymap.c new file mode 100644 index 0000000000..d607e11f66 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 Milton Griffin + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Keyboard Layers +#define _QW 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | - | ` | = | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | [ | \ | ] | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | SPACE | SPACE | FN | RALT | RGUI | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_GRV, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_BSLS, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_SPC, KC_SPC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \ + ), + +/* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SELECT | CALC | MYCOMP | MAIL | RGB HD | RGB HI | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | PREV | PLAY | NEXT | STOP | RGB SD | RGB SI | P4 | P5 | P6 | + | | RESET | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | VOL- | MUTE | VOL+ | APP | RGB VD | RGB VI | P1 | P2 | P3 | PENT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_MSEL, KC_CALC, KC_MYCM, KC_MAIL, RGB_HUD, RGB_HUI, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_MPRV, KC_MPLY, KC_MNXT, KC_MSTP, RGB_SAD, RGB_SAI, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \ + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, RGB_VAD, RGB_VAI, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \ + ), +}; diff --git a/keyboards/idobo/keymaps/default75/readme.md b/keyboards/idobo/keymaps/default75/readme.md new file mode 100644 index 0000000000..a1c0236ed9 --- /dev/null +++ b/keyboards/idobo/keymaps/default75/readme.md @@ -0,0 +1 @@ +# The default keymap for xd75, with led controls \ No newline at end of file diff --git a/keyboards/idobo/keymaps/default75/rules.mk b/keyboards/idobo/keymaps/default75/rules.mk new file mode 100644 index 0000000000..7efceba50a --- /dev/null +++ b/keyboards/idobo/keymaps/default75/rules.mk @@ -0,0 +1,14 @@ +# Copyright 2013 Jun Wako +# +# 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 . -- cgit v1.2.3 From 3dd6d53942bd3fafb57d170ecdaccf57e459a62c Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Thu, 22 Nov 2018 21:53:01 +0100 Subject: ergodox: update algernon's layout to v1.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the final version of my layout. Overall changes =============== * Updated to work with QMK master. Miscellaneous ============= * The `😂` symbol can be entered with UCIS. * `LEAD r` now inputs `Right Alt`. Signed-off-by: Gergely Nagy --- layouts/community/ergodox/algernon/NEWS.md | 13 +++++++++++++ .../community/ergodox/algernon/images/adore-layer.png | Bin 0 -> 105611 bytes .../community/ergodox/algernon/images/base-layer.png | Bin 0 -> 106956 bytes layouts/community/ergodox/algernon/images/heatmap.png | Bin 0 -> 139351 bytes .../community/ergodox/algernon/images/steno-layer.png | Bin 0 -> 64086 bytes layouts/community/ergodox/algernon/keymap.c | 8 +++++++- layouts/community/ergodox/algernon/readme.md | 12 +++++++++--- layouts/community/ergodox/algernon/rules.mk | 3 ++- 8 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 layouts/community/ergodox/algernon/images/adore-layer.png create mode 100644 layouts/community/ergodox/algernon/images/base-layer.png create mode 100644 layouts/community/ergodox/algernon/images/heatmap.png create mode 100644 layouts/community/ergodox/algernon/images/steno-layer.png diff --git a/layouts/community/ergodox/algernon/NEWS.md b/layouts/community/ergodox/algernon/NEWS.md index 1bc2b5dc6a..a6ce9813ba 100644 --- a/layouts/community/ergodox/algernon/NEWS.md +++ b/layouts/community/ergodox/algernon/NEWS.md @@ -1,5 +1,18 @@ +## v1.12 + +*2018-11-22* + +### Overall changes + +* Updated to work with QMK master. + +### Miscellaneous + +* The `😂` symbol can be entered with UCIS. +* `LEAD r` now inputs `Right Alt`. + ## v1.11 *2017-10-01* diff --git a/layouts/community/ergodox/algernon/images/adore-layer.png b/layouts/community/ergodox/algernon/images/adore-layer.png new file mode 100644 index 0000000000..75d2ca4f08 Binary files /dev/null and b/layouts/community/ergodox/algernon/images/adore-layer.png differ diff --git a/layouts/community/ergodox/algernon/images/base-layer.png b/layouts/community/ergodox/algernon/images/base-layer.png new file mode 100644 index 0000000000..2ca7a273be Binary files /dev/null and b/layouts/community/ergodox/algernon/images/base-layer.png differ diff --git a/layouts/community/ergodox/algernon/images/heatmap.png b/layouts/community/ergodox/algernon/images/heatmap.png new file mode 100644 index 0000000000..4f55c5adff Binary files /dev/null and b/layouts/community/ergodox/algernon/images/heatmap.png differ diff --git a/layouts/community/ergodox/algernon/images/steno-layer.png b/layouts/community/ergodox/algernon/images/steno-layer.png new file mode 100644 index 0000000000..9a2ba55eff Binary files /dev/null and b/layouts/community/ergodox/algernon/images/steno-layer.png differ diff --git a/layouts/community/ergodox/algernon/keymap.c b/layouts/community/ergodox/algernon/keymap.c index ebdc4ab4e4..fb6de1b721 100644 --- a/layouts/community/ergodox/algernon/keymap.c +++ b/layouts/community/ergodox/algernon/keymap.c @@ -13,6 +13,7 @@ #include "eeconfig.h" #include "wait.h" #include "version.h" +#include "print.h" /* Layers */ @@ -1033,6 +1034,10 @@ void matrix_scan_user(void) { } #endif + SEQ_ONE_KEY (KC_R) { + ang_tap(KC_RALT, 0); + } + SEQ_ONE_KEY (KC_T) { time_travel = !time_travel; } @@ -1126,7 +1131,8 @@ const qk_ucis_symbol_t ucis_symbol_table[] = UCIS_TABLE UCIS_SYM("micro", 0x00b5), UCIS_SYM("tm", 0x2122), UCIS_SYM("child", 0x1f476), - UCIS_SYM("family", 0x1F46A) + UCIS_SYM("family", 0x1F46A), + UCIS_SYM("joy", 0x1F602) ); bool process_record_user (uint16_t keycode, keyrecord_t *record) { diff --git a/layouts/community/ergodox/algernon/readme.md b/layouts/community/ergodox/algernon/readme.md index 03b094edb2..a25018a7bc 100644 --- a/layouts/community/ergodox/algernon/readme.md +++ b/layouts/community/ergodox/algernon/readme.md @@ -3,7 +3,12 @@ algernon's layout ======================= -This is an unconventional layout for the [ErgoDox EZ][ez]. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. +This is the layout I used to use on my [ErgoDox EZ][ez], while I was using [QMK][qmk]. I no longer do so, and this repository is obsolete, and not updated anymore. My current firmware is based on [Kaleidoscope][kaleidoscope], and is located [elsewhere][ergodox-sketch]. I'm keeping the repo around for historical and educational purposes. + + [kaleidoscope]: https://github.com/keyboardio/Kaleidoscope + [ergodox-sketch]: https://git.madhouse-project.org/algernon/ErgoDox-sketch + +Nevertheless, this is an unconventional layout for the [ErgoDox EZ][ez]. For more details about the history of the layout, see my [blog posts about my ErgoDox journey][blog-ergodox]. [ez]: https://ergodox-ez.com/ [blog-ergodox]: https://asylum.madhouse-project.org/blog/tags/ergodox/ @@ -57,6 +62,7 @@ At its core, this is a Dvorak layout, with some minor changes. The more interest - `LEAD d` toggles logging keypress positions to the HID console. - `LEAD t` toggles time travel. Figuring out the current `date` is left as an exercise to the reader. - `LEAD u` enters the [Unicode symbol input](#unicode-symbol-input) mode. + - `LEAD r` inputs `Right Alt`, which is the `Compose` key of my choice. The symbols on the front in the image above have the same color as the key that activates them, with the exception of the **Arrow** layer, which is just black on the front. @@ -128,13 +134,13 @@ $ git clone https://github.com/qmk/qmk_firmware.git $ cd qmk_firmware $ git clone https://github.com/algernon/ergodox-layout.git \ layouts/community/ergodox/algernon_master -$ make ergodox_ez-algernon_master +$ make ergodox_ez:algernon_master ``` From time to time, updates may be submitted back to the QMK repository. If you are reading it there, you can build the firmware like any other firmware included with it (assuming you are in the root directory of the firmware): ``` -$ make ergodox_ez-algernon +$ make ergodox_ez:algernon ``` ## Using on Windows diff --git a/layouts/community/ergodox/algernon/rules.mk b/layouts/community/ergodox/algernon/rules.mk index 53dec5153a..1b4c0995f6 100644 --- a/layouts/community/ergodox/algernon/rules.mk +++ b/layouts/community/ergodox/algernon/rules.mk @@ -9,8 +9,9 @@ KEYLOGGER_ENABLE ?= yes UCIS_ENABLE = yes MOUSEKEY_ENABLE = no LEADER_ENABLE = yes +RGBLIGHT_ENABLE = no -AUTOLOG_ENABLE ?= no +AUTOLOG_ENABLE ?= yes ifeq (${FORCE_NKRO},yes) OPT_DEFS += -DFORCE_NKRO -- cgit v1.2.3 From ee8627e078dccab722f05fbf9bb152eca1b2ee7b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 23 Nov 2018 20:07:53 -0800 Subject: Add EEPROM_RESET keycode to keycodes.md doc (#4473) --- docs/keycodes.md | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index 30fe60278f..1c5f46d6ec 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -206,18 +206,19 @@ This is a reference only. Each group of keys links to the page documenting their ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) -|Key |Aliases |Description | -|-------------|-----------|---------------------------------------------------------------------| -|`RESET` | |Put the keyboard into DFU mode for flashing | -|`DEBUG` | |Toggle debug mode | -|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| -|`KC_LSPO` | |Left Shift when held, `(` when tapped | -|`KC_RSPC` | |Right Shift when held, `)` when tapped | -|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | -|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | -|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | -|`M(n)` | |Call macro `n` | -|`MACROTAP(n)`| |Macro-tap `n` idk FIXME | +|Key |Aliases |Description | +|---------------|-----------|---------------------------------------------------------------------| +|`RESET` | |Put the keyboard into DFU mode for flashing | +|`DEBUG` | |Toggle debug mode | +|`EEPROM_RESET` |`EEP_RST` |Resets EEPROM state by reinitializing it | +|`KC_GESC` |`GRAVE_ESC`|Escape when tapped, ` when pressed with Shift or GUI| +|`KC_LSPO` | |Left Shift when held, `(` when tapped | +|`KC_RSPC` | |Right Shift when held, `)` when tapped | +|`KC_LEAD` | |The [Leader key](feature_leader_key.md) | +|`KC_LOCK` | |The [Lock key](feature_key_lock.md) | +|`FUNC(n)` |`F(n)` |Call `fn_action(n)` (deprecated) | +|`M(n)` | |Call macro `n` | +|`MACROTAP(n)` | |Macro-tap `n` idk FIXME | ## [Audio Keys](feature_audio.md) -- cgit v1.2.3 From 7bc7c34d4f7e8bda5859696fba9bacc5e47de512 Mon Sep 17 00:00:00 2001 From: Jasper Lievisse Adriaanse Date: Sat, 24 Nov 2018 17:40:48 +0100 Subject: Add RCTL to my Planck layout (#4475) --- keyboards/planck/keymaps/jasperla/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/planck/keymaps/jasperla/keymap.c b/keyboards/planck/keymaps/jasperla/keymap.c index 14f445d0f2..b9eb72b073 100644 --- a/keyboards/planck/keymaps/jasperla/keymap.c +++ b/keyboards/planck/keymaps/jasperla/keymap.c @@ -46,14 +46,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Shift | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | | + * | Ctrl | | LGUI | Alt |Lower | SPC | Enter|Raise |Point.| | LOCK | Ctrl | * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_planck_grid( KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT , - KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, _______ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, _______, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_ENT, RAISE, PT, _______, LOCK, KC_RCTL ), /* Lower -- cgit v1.2.3 From 3363743bf78fa5efc9a6a70f13925f4c95745641 Mon Sep 17 00:00:00 2001 From: xjacobx Date: Sat, 24 Nov 2018 11:41:39 -0500 Subject: Adding my new keymap for the Idobo (#4468) * Adding my new keymap, based of xd75, with leds enabled via the rules.mk file * cleaned up the rules file * Per Change Requests: removed deprecated functions along with updated the map to use the layout macro instead of raw matrix --- keyboards/idobo/keymaps/xaceofspaidsx/config.h | 19 +++++++ keyboards/idobo/keymaps/xaceofspaidsx/keymap.c | 67 +++++++++++++++++++++++++ keyboards/idobo/keymaps/xaceofspaidsx/readme.md | 1 + keyboards/idobo/keymaps/xaceofspaidsx/rules.mk | 19 +++++++ 4 files changed, 106 insertions(+) create mode 100644 keyboards/idobo/keymaps/xaceofspaidsx/config.h create mode 100644 keyboards/idobo/keymaps/xaceofspaidsx/keymap.c create mode 100644 keyboards/idobo/keymaps/xaceofspaidsx/readme.md create mode 100644 keyboards/idobo/keymaps/xaceofspaidsx/rules.mk diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/config.h b/keyboards/idobo/keymaps/xaceofspaidsx/config.h new file mode 100644 index 0000000000..a3ed4f762a --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 MechMerlin + * + * 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 + +// place overrides here diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c b/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c new file mode 100644 index 0000000000..c157317e2d --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 xAceOfSpaidsx + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW 0 +#define _FN 1 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY - based off xd75 default map with a couple modifications for my preference + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | 5 | F2 | ` | F5 | 6 | 7 | 8 | 9 | 0 | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | - | \ | = | Y | U | I | O | P | ' | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | HOME | DEL | PG UP | H | J | K | L | ; | ENTER | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | END | UP | PG DN | N | M | , | . | / | RSHIFT | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LCTRL | LGUI | LALT | FN | SPACE | SPACE | LEFT | DOWN | RIGHT | [ | ] | FN | RALT | RGUI | RCTRL | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW] = LAYOUT_ortho_5x15( /* QWERTY */ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F2, KC_GRV, KC_F5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_MINS, KC_BSLS, KC_EQL, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_HOME, KC_DEL, KC_PGUP, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_END, KC_UP, KC_PGDN, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, MO(_FN), KC_SPC, KC_SPC, KC_LEFT, KC_DOWN, KC_RGHT, KC_LBRC, KC_RBRC, MO(_FN), KC_RALT, KC_RGUI, KC_RCTL \ + ), + +/* FUNCTION Layer - removed the rgb hue saturation and vibrance for audio controls and added some functionality I use from other boards. + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | NUM LK | P/ | P* | F7 | F8 | F9 | F10 | F11 | F12 | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | SELECT | CALC | UP | | | NEXT | P7 | P8 | P9 | - | | | PR SCR | SCR LK | PAUSE | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | PREV | LEFT | DOWN | RIGHT | DEL | PLAY | P4 | P5 | P6 | + | | RESET | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | VOL- | MUTE | VOL+ | APP | | STOP | P1 | P2 | P3 | PENT | | | | | | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + * | | | RGB TG | FN | RGB RMD| RGB MD | P0 | | P. | PENT | PENT | FN | | | | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* FUNCTION */ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_NLCK, KC_SLSH, KC_ASTR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + KC_MSEL, KC_CALC, KC_UP , _______, _______, KC_MNXT, KC_P7, KC_P8, KC_P9, KC_MINS, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, \ + KC_MPRV, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL , KC_MPLY, KC_P4, KC_P5, KC_P6, KC_PLUS, _______, RESET, _______, _______, _______, \ + KC_VOLD, KC_MUTE, KC_VOLU, KC_APP, _______, KC_MSTP, KC_P1, KC_P2, KC_P3, KC_PENT, _______, _______, _______, _______, _______, \ + _______, _______, RGB_TOG, MO(_FN), RGB_RMOD,RGB_MOD, KC_P0, _______, KC_PDOT, KC_PENT, KC_PENT, MO(_FN), _______, _______, _______ \ + ), +}; diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/readme.md b/keyboards/idobo/keymaps/xaceofspaidsx/readme.md new file mode 100644 index 0000000000..ac6e74702c --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/readme.md @@ -0,0 +1 @@ +# Updated the keymap, based off XD75 default, to meet my needs. Refer to rules.mk to enable or disable rgb and other features. diff --git a/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk b/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk new file mode 100644 index 0000000000..b973e9d8b3 --- /dev/null +++ b/keyboards/idobo/keymaps/xaceofspaidsx/rules.mk @@ -0,0 +1,19 @@ +# Copyright 2013 Jun Wako +# +# 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 . + +#Had to disable the first 2 to get the firmware size down enough after enabling the rgb controls. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +COMMAND_ENABLE = no # Commands for debug and configuration +RGBLIGHT_ENABLE = yes # Enable keyboard RGB underglow -- cgit v1.2.3 From f0db40ff113a768f53de1197817b3a31bc32e9ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Silva?= Date: Sat, 24 Nov 2018 16:48:42 +0000 Subject: fix diffutils arch package name (#4470) --- util/linux_install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 0e8296c0d2..70b389c0da 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -61,9 +61,9 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then avr-binutils \ avr-libc \ avr-gcc \ - base-devel \ + base-devel \ dfu-util \ - diff-utils \ + diffutils \ gcc \ git \ unzip \ -- cgit v1.2.3 From d7ab738ca687a6ea923ce286f7cb81a5125b86ba Mon Sep 17 00:00:00 2001 From: Colin Kahn Date: Sun, 25 Nov 2018 18:38:46 -0800 Subject: Adding keymap layers for 40precentclub/foobar (#4481) --- .../40percentclub/foobar/keymaps/default/config.h | 2 + .../40percentclub/foobar/keymaps/default/keymap.c | 57 +++++++++++++++++++--- 2 files changed, 52 insertions(+), 7 deletions(-) diff --git a/keyboards/40percentclub/foobar/keymaps/default/config.h b/keyboards/40percentclub/foobar/keymaps/default/config.h index 6173b63272..bedc27ba85 100644 --- a/keyboards/40percentclub/foobar/keymaps/default/config.h +++ b/keyboards/40percentclub/foobar/keymaps/default/config.h @@ -17,3 +17,5 @@ #pragma once // place overrides here + +#define PERMISSIVE_HOLD diff --git a/keyboards/40percentclub/foobar/keymaps/default/keymap.c b/keyboards/40percentclub/foobar/keymaps/default/keymap.c index 774f1e8542..1be4b38dd9 100644 --- a/keyboards/40percentclub/foobar/keymaps/default/keymap.c +++ b/keyboards/40percentclub/foobar/keymaps/default/keymap.c @@ -15,19 +15,62 @@ */ #include QMK_KEYBOARD_H -#define FN1_Q LT(1, KC_Q) +enum foobar_layers { + QWERTY, + FN1, + FN2, + FN3, + FN4, + FN5 +}; + +#define FN1_SPC LT(FN1, KC_SPC) +#define FN2_BSC LT(FN2, KC_BSPC) +#define FN3_C LT(FN3, KC_C) +#define FN4_V LT(FN4, KC_V) +#define FN5_B LT(FN5, KC_B) +#define RALT_N RALT_T(KC_N) +#define LALT_X LALT_T(KC_X) +#define LCTL_Z LCTL_T(KC_Z) +#define RCTL_M RCTL_T(KC_M) +#define LSFT_ENT LSFT_T(KC_ENT) +#define RGUI_ESC RGUI_T(KC_ESC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_split( - FN1_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ESC, - KC_Z, KC_X, KC_C, KC_V, KC_BSPC, KC_SPC, KC_B, KC_N, KC_M, KC_ENT + [QWERTY] = LAYOUT_split( + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, RGUI_ESC, + LCTL_Z, LALT_X, FN3_C, FN4_V, FN2_BSC, FN1_SPC, FN5_B, RALT_N, RCTL_M, LSFT_ENT + ), + + [FN1] = LAYOUT_split( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, + _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, _______ + ), + + [FN2] = LAYOUT_split( + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, + KC_F11, KC_F12, _______, _______, _______, _______, _______, _______, _______, KC_GRV, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [FN3] = LAYOUT_split( + _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_TAB, _______, _______, _______, _______, KC_COMM, KC_DOT, KC_SLSH, KC_SCLN, KC_QUOT, + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + ), + + [FN4] = LAYOUT_split( + _______, _______, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_TAB, _______, _______, _______, _______, KC_LABK, KC_RABK, KC_QUES, KC_COLN, KC_DQUO, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - [1] = LAYOUT_split( + [FN5] = LAYOUT_split( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, RESET, _______, _______, _______ + _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______ ), }; -- cgit v1.2.3 From 834b555eca47392ec0bf367b7f20694919d79a00 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 25 Nov 2018 18:40:48 -0800 Subject: Keymap FAQ: fix positions of KC_HENK and KC_MHEN for JIS layout (#4482) These keys were previously in each other's positions. --- docs/faq_keymap.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 07d74d6cf3..4e842d363c 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -11,8 +11,8 @@ Keycodes are actually defined in [common/keycode.h](https://github.com/qmk/qmk_f There are 3 standard keyboard layouts in use around the world- ANSI, ISO, and JIS. North America primarily uses ANSI, Europe and Africa primarily use ISO, and Japan uses JIS. Regions not mentioned typically use either ANSI or ISO. The keycodes corresponding to these layouts are shown here: - -![Keyboard Layout Image](https://i.imgur.com/gvlNUpQ.png) + +![Keyboard Layout Image](https://i.imgur.com/5wsh5wM.png) ## Some Of My Keys Are Swapped Or Not Working -- cgit v1.2.3 From ccd4da941cb38839b60994302d453821fb88a1b1 Mon Sep 17 00:00:00 2001 From: Will Homer <392260+WillFour20@users.noreply.github.com> Date: Mon, 26 Nov 2018 15:57:30 +0000 Subject: Add Espectro ISO layout (#4479) * Add Espectro ISO layout * Remove unused define from Espectro ISO layout --- keyboards/espectro/keymaps/iso/keymap.c | 88 +++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100755 keyboards/espectro/keymaps/iso/keymap.c diff --git a/keyboards/espectro/keymaps/iso/keymap.c b/keyboards/espectro/keymaps/iso/keymap.c new file mode 100755 index 0000000000..d22e7aac4b --- /dev/null +++ b/keyboards/espectro/keymaps/iso/keymap.c @@ -0,0 +1,88 @@ +/* Copyright 2018 @TurboMech /u/TurboMech @A9entOran9e#6134 + * + * 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 . + */ + + +#include QMK_KEYBOARD_H + +#define _BL 0 //Base layer +#define _FN1 1 //Function layer + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* BL +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | | | | | | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DELETE | P SCN | HOME | END | P UP | P DOWN | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| ` | | | | | | | | | | | | | BACK | NUM | | | | +| ¬ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | +|________|________|________|________|________|________|________|________|________|________|________|________|________|_________________|________|________|________|________| +| | | | | | | | | | | | [ | ] | | | | | | +| TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | | 7 | 8 | 9 | | +|____________|________|________|________|________|________|________|________|________|________|________|________|________|__ ENTER |________|________|________| + | +| | | | | | | | | | | ; | ' | # | | | | | | +| CAPS LOCK | A | S | D | F | G | H | J | K | L | : | @ | ~ | | 4 | 5 | 6 | | +|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________| +| | \ | | | | | | | | , | . | / | | | | | | | +| SHIFT | | | Z | X | C | V | B | N | M | < | > | ? | SHIFT | UP | 1 | 2 | 3 | | +|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| ENTER | +| | | | | | | MO | | | | | | | +| CTRL | LGUI | L ALT | SPACE | R ALT | R CTRL | _FN | LEFT | DOWN | RIGHT | 0 | . | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_BL] = LAYOUT_split_shift_and_bs( + 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_DEL, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + 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_NO, KC_BSPC, 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_NUHS, KC_P7, KC_P8, KC_P9, KC_PPLS, + 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_NO, KC_P4, KC_P5, KC_P6, + 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_P1, KC_P2, KC_P3, KC_PENT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT, KC_NO + ), + +/* FN_1 +____________________________________________________________________________________________________________________________________________________________________________ +| | | | | | | | | | | | | | | VOL | VOL | NEXT | | | +| RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | +|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| +| | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +|________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| +| | BACK | BACK | | | | | | | | | | | | | | | | +| | LIGHT | LIGHT | | | | | | | | | | | | | | | | +|____________| TOGGLE |INCREASE|DECREASE|________|________|________|________|________|________|________|________|________|__ |________|________|________| | +| | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | +|______________|________|________|________|________|________|________|________|________|________|________|________|________|___________|________|________|________|________| +| | | | | | | | | | | | | | | | | | | +| | | | | | | | | | | | | | | | | | | +|__________|_______|________|________|________|________|________|________|________|________|________|________|________________|________|________|________|________| | +| | | | | | | | | | | | | | +| | | | | | | | | | | | | | +|__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| + */ + + [_FN1] = LAYOUT_split_shift_and_bs( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + +}; + -- cgit v1.2.3 From 6266c172b9363aa950cf13c52bed7674aae0375d Mon Sep 17 00:00:00 2001 From: Elliot Powell <32494740+e11i0t23@users.noreply.github.com> Date: Mon, 26 Nov 2018 15:58:53 +0000 Subject: added ep/96 as a supported keyboard (#4476) * added ep/96 * Update keyboards/ep/96/readme.md Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * removed led code * Update keyboards/ep/96/config.h Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Update keyboards/ep/96/info.json Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> * Update keyboards/ep/96/readme.md Co-Authored-By: e11i0t23 <32494740+e11i0t23@users.noreply.github.com> --- keyboards/ep/96/96.c | 43 +++ keyboards/ep/96/96.h | 47 ++++ keyboards/ep/96/config.h | 212 +++++++++++++++ keyboards/ep/96/info.json | 426 ++++++++++++++++++++++++++++++ keyboards/ep/96/keymaps/default/keymap.c | 67 +++++ keyboards/ep/96/keymaps/default/readme.md | 1 + keyboards/ep/96/readme.md | 15 ++ keyboards/ep/96/rules.mk | 81 ++++++ 8 files changed, 892 insertions(+) create mode 100644 keyboards/ep/96/96.c create mode 100644 keyboards/ep/96/96.h create mode 100644 keyboards/ep/96/config.h create mode 100644 keyboards/ep/96/info.json create mode 100644 keyboards/ep/96/keymaps/default/keymap.c create mode 100644 keyboards/ep/96/keymaps/default/readme.md create mode 100644 keyboards/ep/96/readme.md create mode 100644 keyboards/ep/96/rules.mk diff --git a/keyboards/ep/96/96.c b/keyboards/ep/96/96.c new file mode 100644 index 0000000000..9fdd51977d --- /dev/null +++ b/keyboards/ep/96/96.c @@ -0,0 +1,43 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include "96.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/ep/96/96.h b/keyboards/ep/96/96.h new file mode 100644 index 0000000000..1887eb472c --- /dev/null +++ b/keyboards/ep/96/96.h @@ -0,0 +1,47 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#ifndef EP96_H +#define EP96_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define xxxx KC_NO + +#define LAYOUT( \ + K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018, \ + K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, k114, k115, k116, k117, k118, \ + K200, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, k215, k216, k217, \ + K300, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318, \ + K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, k413, k414, k415, k416, k417, \ + K500, K501, K502, k506, k511, k512, k513, k514, k515, k516, k517, k518) \ +{ \ + {K000, K001, K002, k003, k004, k005, k006, k007, k008, k009, k010, k011, k012, k013, k014, k015, k016, k017, k018}, \ + {K100, K101, K102, k103, k104, k105, k106, k107, k108, k109, k110, k111, k112, xxxx, k114, k115, k116, k117, k118}, \ + {K200, xxxx, K202, k203, k204, k205, k206, k207, k208, k209, k210, k211, k212, k213, xxxx, k215, k216, k217, xxxx}, \ + {K300, xxxx, K302, k303, k304, k305, k306, k307, k308, k309, k310, k311, k312, k313, k314, k315, k316, k317, k318}, \ + {K400, K401, K402, k403, k404, k405, k406, k407, k408, k409, k410, k411, xxxx, k413, k414, k415, k416, k417, xxxx}, \ + {K500, K501, K502, xxxx, xxxx, xxxx, k506, xxxx, xxxx, xxxx, xxxx, k511, k512, k513, k514, k515, k516, k517, k518} \ +} + +#endif diff --git a/keyboards/ep/96/config.h b/keyboards/ep/96/config.h new file mode 100644 index 0000000000..0c37e4c596 --- /dev/null +++ b/keyboards/ep/96/config.h @@ -0,0 +1,212 @@ +/* +Copyright 2018 Elliot Powell + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x9696 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Elliot Powell +#define PRODUCT ep96 +#define DESCRIPTION A simple 96 key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 6 +#define MATRIX_COLS 19 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B0, B1, B3, B2, B7, C6 } +#define MATRIX_COL_PINS { D0, D1, D2, D3, D5, D4, D6, D7, B4, B5, B6, C7, F7, F6, F5, F4, F1, F0, E6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #endif + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + diff --git a/keyboards/ep/96/info.json b/keyboards/ep/96/info.json new file mode 100644 index 0000000000..4be41b24c3 --- /dev/null +++ b/keyboards/ep/96/info.json @@ -0,0 +1,426 @@ +{ + "keyboard_name": "ep96", + "maintainer": "e11i0t23", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT": { + "key_count": 100, + "layout": [{ + "label": "Esc", + "x": 0, + "y": 0 + }, { + "label": "F1", + "x": 1, + "y": 0 + }, { + "label": "F2", + "x": 2, + "y": 0 + }, { + "label": "F3", + "x": 3, + "y": 0 + }, { + "label": "F4", + "x": 4, + "y": 0 + }, { + "label": "F5", + "x": 5, + "y": 0 + }, { + "label": "F6", + "x": 6, + "y": 0 + }, { + "label": "F7", + "x": 7, + "y": 0 + }, { + "label": "F8", + "x": 8, + "y": 0 + }, { + "label": "F9", + "x": 9, + "y": 0 + }, { + "label": "F10", + "x": 10, + "y": 0 + }, { + "label": "F11", + "x": 11, + "y": 0 + }, { + "label": "F12", + "x": 12, + "y": 0 + }, { + "label": "Prt Sc", + "x": 13, + "y": 0 + }, { + "label": "Delete", + "x": 14, + "y": 0 + }, { + "label": "home", + "x": 15, + "y": 0 + }, { + "label": "Menu", + "x": 16, + "y": 0 + }, { + "label": "Pg Up", + "x": 17, + "y": 0 + }, { + "label": "Pg Dn", + "x": 18, + "y": 0 + }, { + "label": "~", + "x": 0, + "y": 1 + }, { + "label": "!", + "x": 1, + "y": 1 + }, { + "label": "@", + "x": 2, + "y": 1 + }, { + "label": "#", + "x": 3, + "y": 1 + }, { + "label": "$", + "x": 4, + "y": 1 + }, { + "label": "%", + "x": 5, + "y": 1 + }, { + "label": "^", + "x": 6, + "y": 1 + }, { + "label": "&", + "x": 7, + "y": 1 + }, { + "label": "*", + "x": 8, + "y": 1 + }, { + "label": "(", + "x": 9, + "y": 1 + }, { + "label": ")", + "x": 10, + "y": 1 + }, { + "label": "_", + "x": 11, + "y": 1 + }, { + "label": "+", + "x": 12, + "y": 1 + }, { + "label": "Backspace", + "x": 13, + "y": 1, + "w": 2 + }, { + "label": "Num Lock", + "x": 15, + "y": 1 + }, { + "label": "/", + "x": 16, + "y": 1 + }, { + "label": "*", + "x": 17, + "y": 1 + }, { + "label": "-", + "x": 18, + "y": 1 + }, { + "label": "Tab", + "x": 0, + "y": 2, + "w": 1.5 + }, { + "label": "Q", + "x": 1.5, + "y": 2 + }, { + "label": "W", + "x": 2.5, + "y": 2 + }, { + "label": "E", + "x": 3.5, + "y": 2 + }, { + "label": "R", + "x": 4.5, + "y": 2 + }, { + "label": "T", + "x": 5.5, + "y": 2 + }, { + "label": "Y", + "x": 6.5, + "y": 2 + }, { + "label": "U", + "x": 7.5, + "y": 2 + }, { + "label": "I", + "x": 8.5, + "y": 2 + }, { + "label": "O", + "x": 9.5, + "y": 2 + }, { + "label": "P", + "x": 10.5, + "y": 2 + }, { + "label": "{", + "x": 11.5, + "y": 2 + }, { + "label": "}", + "x": 12.5, + "y": 2 + }, { + "label": "Enter", + "x": 13.75, + "y": 2, + "w": 1.25, + "h": 2 + }, { + "label": "7", + "x": 15, + "y": 2 + }, { + "label": "8", + "x": 16, + "y": 2 + }, { + "label": "9", + "x": 17, + "y": 2 + }, { + "label": "+", + "x": 18, + "y": 2, + "h": 2 + }, { + "label": "Caps Lock", + "x": 0, + "y": 3, + "w": 1.75 + }, { + "label": "A", + "x": 1.75, + "y": 3 + }, { + "label": "S", + "x": 2.75, + "y": 3 + }, { + "label": "D", + "x": 3.75, + "y": 3 + }, { + "label": "F", + "x": 4.75, + "y": 3 + }, { + "label": "G", + "x": 5.75, + "y": 3 + }, { + "label": "H", + "x": 6.75, + "y": 3 + }, { + "label": "J", + "x": 7.75, + "y": 3 + }, { + "label": "K", + "x": 8.75, + "y": 3 + }, { + "label": "L", + "x": 9.75, + "y": 3 + }, { + "label": ":", + "x": 10.75, + "y": 3 + }, { + "label": "\"", + "x": 11.75, + "y": 3 + }, { + "label": "~", + "x": 12.75, + "y": 3 + }, { + "label": "4", + "x": 15, + "y": 3 + }, { + "label": "5", + "x": 16, + "y": 3 + }, { + "label": "6", + "x": 17, + "y": 3 + }, { + "label": "Shift", + "x": 0, + "y": 4, + "w": 1.25 + }, { + "label": "|", + "x": 1.25, + "y": 4 + }, { + "label": "Z", + "x": 2.25, + "y": 4 + }, { + "label": "X", + "x": 3.25, + "y": 4 + }, { + "label": "C", + "x": 4.25, + "y": 4 + }, { + "label": "V", + "x": 5.25, + "y": 4 + }, { + "label": "B", + "x": 6.25, + "y": 4 + }, { + "label": "N", + "x": 7.25, + "y": 4 + }, { + "label": "M", + "x": 8.25, + "y": 4 + }, { + "label": "<", + "x": 9.25, + "y": 4 + }, { + "label": ">", + "x": 10.25, + "y": 4 + }, { + "label": "?", + "x": 11.25, + "y": 4 + }, { + "label": "Shift", + "x": 12.25, + "y": 4, + "w": 1.75 + }, { + "label": "\u2191", + "x": 14, + "y": 4 + }, { + "label": "1", + "x": 15, + "y": 4 + }, { + "label": "2", + "x": 16, + "y": 4 + }, { + "label": "3", + "x": 17, + "y": 4 + }, { + "label": "Enter", + "x": 18, + "y": 4, + "h": 2 + }, { + "label": "Ctrl", + "x": 0, + "y": 5, + "w": 1.25 + }, { + "label": "Win", + "x": 1.25, + "y": 5, + "w": 1.25 + }, { + "label": "Alt", + "x": 2.5, + "y": 5, + "w": 1.25 + }, { + "x": 3.75, + "y": 5, + "w": 6.25 + }, { + "label": "Alt", + "x": 10, + "y": 5, + "w": 1.5 + }, { + "label": "Crtl", + "x": 11.5, + "y": 5, + "w": 1.5 + }, { + "label": "\u2190", + "x": 13, + "y": 5 + }, { + "label": "\u2193", + "x": 14, + "y": 5 + }, { + "label": "\u2192", + "x": 15, + "y": 5 + }, { + "label": "0", + "x": 16, + "y": 5 + }, { + "label": ".", + "x": 17, + "y": 5 + }] + } + } +} diff --git a/keyboards/ep/96/keymaps/default/keymap.c b/keyboards/ep/96/keymaps/default/keymap.c new file mode 100644 index 0000000000..d512041535 --- /dev/null +++ b/keyboards/ep/96/keymaps/default/keymap.c @@ -0,0 +1,67 @@ +/* Copyright 2018 Elliot Powell + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* Base */ + 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_DEL, KC_HOME, KC_END, KC_PGUP, KC_PGDN, \ + 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_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_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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + KC_LSFT, KC_BSLS, 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_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/ep/96/keymaps/default/readme.md b/keyboards/ep/96/keymaps/default/readme.md new file mode 100644 index 0000000000..81e87464f0 --- /dev/null +++ b/keyboards/ep/96/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for ep96 \ No newline at end of file diff --git a/keyboards/ep/96/readme.md b/keyboards/ep/96/readme.md new file mode 100644 index 0000000000..404419b63a --- /dev/null +++ b/keyboards/ep/96/readme.md @@ -0,0 +1,15 @@ +# ep96 + +![ep96](https://i.imgur.com/PZ2C7a8.jpg) + +A simple 96 key keyboard + +Keyboard Maintainer: Keyboard Maintainer: [Elliot Powell](https://github.com/e11i0t23), [/u/e11i0t23](https://reddit.com/u/e11i0t23) +Hardware Supported: EP96 PCB +Hardware Availability: Possible availability upon request + +Make example for this keyboard (after setting up your build environment): + + make ep/96: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/ep/96/rules.mk b/keyboards/ep/96/rules.mk new file mode 100644 index 0000000000..407135de2e --- /dev/null +++ b/keyboards/ep/96/rules.mk @@ -0,0 +1,81 @@ +# 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 = atmel-dfu + + +# 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 = no # 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 = no # 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) -- cgit v1.2.3 From 8bc19c8dcf8b32c57baff7e548793be756a5e4f4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 08:09:37 -0800 Subject: Fix Blockey compiler (and size) issues (#4390) --- keyboards/blockey/rules.mk | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/blockey/rules.mk b/keyboards/blockey/rules.mk index e217305bff..fb628cfaa3 100644 --- a/keyboards/blockey/rules.mk +++ b/keyboards/blockey/rules.mk @@ -1,5 +1,3 @@ -SRC += ws2812.c - # MCU name #MCU = at90usb1286 MCU = atmega32u4 @@ -54,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 -- cgit v1.2.3 From 97ab3211e2ace7a5cbf7bd2a21723ed751286c99 Mon Sep 17 00:00:00 2001 From: mwpeterson Date: Mon, 26 Nov 2018 12:26:26 -0500 Subject: Keymap: add Interrobang (#4420) * remove clmk and dvrk and backlight; switch esc and enter to be modtap; add meh key * change songs * space cadet; move enter; move '"; move pgup pgdn * remove extra songs * update from noahfredrick keymap * make it easier to type ../../thing/*/* * move pipe * requested changes * add interrobang support * add shift-insert to raise-v and lower-v, move pipe to raise-/lower-n --- keyboards/planck/keymaps/mwpeterson/keymap.c | 27 ++++++++++++++++++++++----- keyboards/planck/keymaps/mwpeterson/rules.mk | 13 +++++++------ 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/keyboards/planck/keymaps/mwpeterson/keymap.c b/keyboards/planck/keymaps/mwpeterson/keymap.c index bfb015c7a8..961b8394bc 100644 --- a/keyboards/planck/keymaps/mwpeterson/keymap.c +++ b/keyboards/planck/keymaps/mwpeterson/keymap.c @@ -35,6 +35,19 @@ enum planck_layers { #define WM_W LALT(LGUI(KC_LEFT)) #define WM_CNTR LALT(LGUI(KC_C)) +#define SFT_INS LSFT(KC_INS) + +// Unicode +#ifdef UNICODEMAP_ENABLE +enum unicode_name { + IBANG // ‽ +}; + +const uint32_t PROGMEM unicode_map[] = { + [IBANG] = 0x0203D // ‽ +}; +#endif // UNICODEMAP_ENABLE + // Custom key codes enum planck_keycodes { QWERTY = SAFE_RANGE, @@ -81,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * window ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ * switcher │ │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ - * │ │ - │ + │ ` │ | │ : │ │ │ , │ . │ \ │ │ + * │ │ - │ + │ ` │SFTIN│ : │ | │ ‽ │ , │ . │ \ │ │ * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ │ │ │ │ Backspace │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ @@ -89,8 +102,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LOWER_LAYER] = LAYOUT_planck_grid( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, S(KC_3), _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, KC_MINS, KC_PLUS, KC_GRV, KC_PIPE, KC_COLN, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_BSLS, _______, - _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______ + _______, KC_MINS, KC_PLUS, KC_GRV, SFT_INS, KC_COLN, KC_PIPE, X(IBANG), KC_COMM, KC_DOT, KC_BSLS, _______, + _______, _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, _______, _______, _______, _______ ), /* Symbol layer @@ -99,7 +112,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ ' │ " │ │ \ * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ |-- Mostly shifted version - * │ │ _ │ = │ ~ │ | │ : │ │ │ , │ . │ / │ │ / of lower layer + * │ │ _ │ = │ ~ │SFTIN│ : │ | │ │ , │ . │ / │ │ / of lower layer * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤ * │ │ │ │ │ │ Delete │ │ │ │ │ │ * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘ @@ -107,7 +120,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [RAISE_LAYER] = LAYOUT_planck_grid( S(KC_GRV), KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, S(KC_3), _______, S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), KC_QUOT, S(KC_QUOT), _______, - _______, KC_UNDS, KC_EQL, KC_TILD, KC_PIPE, KC_COLN, XXXXXXX, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, + _______, KC_UNDS, KC_EQL, KC_TILD, SFT_INS, KC_COLN, KC_PIPE, XXXXXXX, KC_COMM, KC_DOT, KC_SLSH, _______, _______, _______, _______, _______, _______, KC_DEL, KC_DEL, _______, _______, _______, _______, _______ ), @@ -241,6 +254,10 @@ void plover_lookup(void) { unregister_code(PV_RG); } +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; + uint32_t layer_state_set_user(uint32_t state) { return update_tri_layer_state(state, LOWER_LAYER, RAISE_LAYER, ADJUST_LAYER); } diff --git a/keyboards/planck/keymaps/mwpeterson/rules.mk b/keyboards/planck/keymaps/mwpeterson/rules.mk index de8aa389c4..e826170281 100644 --- a/keyboards/planck/keymaps/mwpeterson/rules.mk +++ b/keyboards/planck/keymaps/mwpeterson/rules.mk @@ -1,6 +1,7 @@ -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality -CONSOLE_ENABLE = no # Console for debug -COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens -MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) -NKRO_ENABLE = no # N-key rollover required for use as a steno board -AUDIO_ENABLE = yes # Audio output on port C6 +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Disable shift combination, which conflicts with shift-parens +MOUSEKEY_ENABLE = yes # Mouse keys (disabled to save space) +NKRO_ENABLE = no # N-key rollover required for use as a steno board +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODEMAP_ENABLE = yes # Enable extended unicode -- cgit v1.2.3 From 0031e461913d23e37a9aebd1da5daf1c93a149ee Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 26 Nov 2018 17:27:07 +0000 Subject: Keyboard: 40percentclub - enable 4x4 and 5x5 community keymaps (#4437) * Enable 4x4 and 5x5 community keymap support * Pull 4x4 community keymap fixes from @noroadsleft * Build fixes for guidoism keymap - move keymap to layouts/community/planck_mit as it uses the LAYOUT_planck_mit macro --- keyboards/40percentclub/4x4/4x4.h | 13 + keyboards/40percentclub/4x4/rules.mk | 3 +- keyboards/40percentclub/5x5/rules.mk | 3 +- layouts/community/ortho_4x12/bakingpy/rules.mk | 2 + layouts/community/ortho_4x12/guidoism/config.h | 24 -- .../community/ortho_4x12/guidoism/generate_c.py | 75 ----- .../community/ortho_4x12/guidoism/guidoism.json | 1 - layouts/community/ortho_4x12/guidoism/keymap.c | 183 ------------ layouts/community/ortho_4x12/guidoism/keys.json | 317 --------------------- layouts/community/ortho_4x12/guidoism/readme.md | 107 ------- layouts/community/ortho_4x12/wanleg/rules.mk | 4 +- layouts/community/ortho_4x12/xyverz/rules.mk | 2 + layouts/community/planck_mit/guidoism/config.h | 24 ++ .../community/planck_mit/guidoism/generate_c.py | 75 +++++ .../community/planck_mit/guidoism/guidoism.json | 1 + layouts/community/planck_mit/guidoism/keymap.c | 183 ++++++++++++ layouts/community/planck_mit/guidoism/keys.json | 317 +++++++++++++++++++++ layouts/community/planck_mit/guidoism/readme.md | 107 +++++++ 18 files changed, 728 insertions(+), 713 deletions(-) delete mode 100644 layouts/community/ortho_4x12/guidoism/config.h delete mode 100644 layouts/community/ortho_4x12/guidoism/generate_c.py delete mode 100644 layouts/community/ortho_4x12/guidoism/guidoism.json delete mode 100644 layouts/community/ortho_4x12/guidoism/keymap.c delete mode 100644 layouts/community/ortho_4x12/guidoism/keys.json delete mode 100644 layouts/community/ortho_4x12/guidoism/readme.md create mode 100644 layouts/community/planck_mit/guidoism/config.h create mode 100644 layouts/community/planck_mit/guidoism/generate_c.py create mode 100644 layouts/community/planck_mit/guidoism/guidoism.json create mode 100644 layouts/community/planck_mit/guidoism/keymap.c create mode 100644 layouts/community/planck_mit/guidoism/keys.json create mode 100644 layouts/community/planck_mit/guidoism/readme.md diff --git a/keyboards/40percentclub/4x4/4x4.h b/keyboards/40percentclub/4x4/4x4.h index 8cc5a150aa..359cdc80a1 100644 --- a/keyboards/40percentclub/4x4/4x4.h +++ b/keyboards/40percentclub/4x4/4x4.h @@ -56,3 +56,16 @@ { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, K2f }, \ { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e, K3f } \ } + +#define LAYOUT_kc_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b, ___, ___, ___, ___}, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b, ___, ___, ___, ___}, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b, ___, ___, ___, ___}, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b, ___, ___, ___, ___} \ +} diff --git a/keyboards/40percentclub/4x4/rules.mk b/keyboards/40percentclub/4x4/rules.mk index a513357988..4ab5e7431c 100644 --- a/keyboards/40percentclub/4x4/rules.mk +++ b/keyboards/40percentclub/4x4/rules.mk @@ -76,5 +76,4 @@ 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) -#FIXME: Community keymap build are currently failing due to missing functionality -#LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 +LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 ortho_4x16 diff --git a/keyboards/40percentclub/5x5/rules.mk b/keyboards/40percentclub/5x5/rules.mk index ae04141269..237de64977 100644 --- a/keyboards/40percentclub/5x5/rules.mk +++ b/keyboards/40percentclub/5x5/rules.mk @@ -77,5 +77,4 @@ 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) -#FIXME: Community keymap build are currently failing due to missing functionality -#LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 +LAYOUTS = ortho_5x5 ortho_5x10 ortho_5x15 diff --git a/layouts/community/ortho_4x12/bakingpy/rules.mk b/layouts/community/ortho_4x12/bakingpy/rules.mk index 490ebbf779..9be2f01d4d 100644 --- a/layouts/community/ortho_4x12/bakingpy/rules.mk +++ b/layouts/community/ortho_4x12/bakingpy/rules.mk @@ -5,6 +5,8 @@ endif AUDIO_ENABLE = no ifeq ($(strip $(KEYBOARD)), zlant) BACKLIGHT_ENABLE = no +else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) + BACKLIGHT_ENABLE = no else BACKLIGHT_ENABLE = yes endif diff --git a/layouts/community/ortho_4x12/guidoism/config.h b/layouts/community/ortho_4x12/guidoism/config.h deleted file mode 100644 index e22f298035..0000000000 --- a/layouts/community/ortho_4x12/guidoism/config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 - -#define IGNORE_MOD_TAP_INTERRUPT -#define USB_MAX_POWER_CONSUMPTION 50 diff --git a/layouts/community/ortho_4x12/guidoism/generate_c.py b/layouts/community/ortho_4x12/guidoism/generate_c.py deleted file mode 100644 index 5bee576084..0000000000 --- a/layouts/community/ortho_4x12/guidoism/generate_c.py +++ /dev/null @@ -1,75 +0,0 @@ -import itertools -import json -import os.path -import re - -KEYMAP_C = """/* {0} -{1} -*/ -[{2}] = {3}( - {4}) -""" - -README_MD = """## {0} -``` -{1} -``` -""" - -base = os.path.dirname(__file__) - -layer_names = dict(enumerate(['_QWERTY', '_LOWER', '_RAISE', '_MOVEMENT', '_NUMPAD', '_FUNCTION'])) -layer_name = {('MO(%d)' % i): layer_names.get(i).strip('_') for i in layer_names.keys()} - -keys = json.load(open(os.path.join(base, 'keys.json'))) - -d = json.load(open(os.path.join(base, 'guidoism.json'))) - -def surround(s, a, b, c): - return a + b.join(s) + c - -def pattern(cell, table): - return ['─'*cell for i in range(table)] - -top = surround(pattern(5, 12), '┌', '┬', '┐') -mid = surround(pattern(5, 12), '├', '┼', '┤') -bottom = surround(pattern(5, 12), '└', '┴', '┘') - -from more_itertools import chunked, intersperse, interleave_longest - -def uni(k): - return keys.get(k, k).lower().center(5) - -def c_layout(i, definition, template): - c_name = layer_names[i] - pretty_name = c_name.strip('_').capitalize() - layout = d['layout'] - - surround = lambda s: ''.join(interleave_longest(['│']*(len(s)+1), s)) - layer = list(map(uni, definition)) - layer[41] = layer[41].center(11) - layer = chunked(layer, 12) - rows = intersperse(mid, map(surround, layer)) - pretty = '\n'.join(itertools.chain([top], rows, [bottom])) - - surround = lambda s: ', '.join(s) - layer = list(map(lambda k: layer_name.get(k, k), definition)) - layer = chunked(layer, 12) - rows = map(surround, layer) - c_layer = ',\n '.join(itertools.chain([], rows, [])) - - return template.format(pretty_name, pretty, c_name, layout, c_layer) - -start = '// START_REPLACEMENT\n' -end = '// END_REPLACEMENT\n' -replacement = start + ',\n\n'.join(c_layout(i, l, KEYMAP_C) for i, l in enumerate(d['layers'])) + end -keymap = os.path.join(base, 'keymap.c') -existing = open(keymap).read() -r = re.compile(r'// START_REPLACEMENT.*// END_REPLACEMENT', re.DOTALL) -open(keymap, 'w').write(r.sub(replacement, existing)) - -replacement = '## Current Configuration\n\n' + '\n\n'.join(c_layout(i, l, README_MD) for i, l in enumerate(d['layers'])) -keymap = os.path.join(base, 'readme.md') -existing = open(keymap).read() -r = re.compile(r'## Current Configuration.*', re.DOTALL) -open(keymap, 'w').write(r.sub(replacement, existing)) diff --git a/layouts/community/ortho_4x12/guidoism/guidoism.json b/layouts/community/ortho_4x12/guidoism/guidoism.json deleted file mode 100644 index 6a4364c6be..0000000000 --- a/layouts/community/ortho_4x12/guidoism/guidoism.json +++ /dev/null @@ -1 +0,0 @@ -{"keyboard":"planck/rev4","keymap":"guidoism","layout":"LAYOUT_planck_mit","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_COLN","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_NO","MO(3)","KC_ESC","KC_LALT","KC_LGUI","MO(1)","LSFT_T(KC_SPC)","MO(2)","KC_RGUI","KC_RALT","KC_SCLN","MO(5)"],["KC_TILD","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_NO","KC_NO","KC_UNDO","KC_TRNS","KC_NO","KC_CUT","KC_COPY","KC_PSTE","KC_NO","KC_NO","KC_UNDS","KC_PLUS","KC_DQUO","KC_QUOT","KC_PIPE","KC_CAPS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MNXT","KC_VOLD","KC_VOLU","KC_MPLY"],["KC_GRV","KC_P1","KC_P2","KC_P3","KC_P4","KC_P5","KC_P6","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_LBRC","KC_RBRC","KC_LPRN","KC_RPRN","KC_NO","KC_NO","KC_PMNS","KC_PEQL","KC_NO","KC_NO","KC_BSLS","KC_TRNS","KC_LT","KC_GT","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["RESET","DEBUG","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_UP","KC_PGDN","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_HOME","KC_NO","KC_END","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PERC","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_DLR","KC_P4","KC_P5","KC_P6","KC_PDOT","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P0","KC_P1","KC_P2","KC_P3","KC_PCMM","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_NO","KC_P0","KC_NO","KC_NO","KC_TRNS"],["KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","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","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_TRNS"]]} \ No newline at end of file diff --git a/layouts/community/ortho_4x12/guidoism/keymap.c b/layouts/community/ortho_4x12/guidoism/keymap.c deleted file mode 100644 index 2027e2bfa4..0000000000 --- a/layouts/community/ortho_4x12/guidoism/keymap.c +++ /dev/null @@ -1,183 +0,0 @@ -#include QMK_KEYBOARD_H - -extern keymap_config_t keymap_config; - -enum planck_layers { - _QWERTY, - _LOWER, - _RAISE, - _MOVEMENT, - _NUMPAD, - _FUNCTION, -}; - -enum planck_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - MOVEMENT, - NUMPAD, -}; - -#define FUNCTION MO(_FUNCTION) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -// START_REPLACEMENT -/* Qwerty -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_QWERTY] = LAYOUT_planck_mit( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, - MOVEMENT, KC_ESC, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPC), RAISE, KC_RGUI, KC_RALT, KC_SCLN, FUNCTION) -, - -/* Lower -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ caps│ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_LOWER] = LAYOUT_planck_mit( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_UNDO, - KC_TRNS, KC_NO, KC_CUT, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_DQUO, KC_QUOT, KC_PIPE, - KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY) -, - -/* Raise -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_RAISE] = LAYOUT_planck_mit( - KC_GRV, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, - KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_PMNS, KC_PEQL, KC_NO, KC_NO, KC_BSLS, - KC_TRNS, KC_LT, KC_GT, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -, - -/* Movement -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ home│ │ end │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_MOVEMENT] = LAYOUT_planck_mit( - RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) -, - -/* Numpad -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 0 │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_NUMPAD] = LAYOUT_planck_mit( - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PERC, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DLR, KC_P4, KC_P5, KC_P6, KC_PDOT, KC_TRNS, - KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_P0, KC_NO, KC_NO, KC_TRNS) -, - -/* Function -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -*/ -[_FUNCTION] = LAYOUT_planck_mit( - KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, 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, 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_TRNS) -// END_REPLACEMENT - - - - - - - - -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - } else { - layer_off(_RAISE); - } - return false; - break; - case MOVEMENT: - if (record->event.pressed) { - layer_on(_MOVEMENT); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } else { - layer_off(_MOVEMENT); - update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); - } - return false; - break; - } - return true; -} diff --git a/layouts/community/ortho_4x12/guidoism/keys.json b/layouts/community/ortho_4x12/guidoism/keys.json deleted file mode 100644 index 791119b4f2..0000000000 --- a/layouts/community/ortho_4x12/guidoism/keys.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "KC_1": "1", - "SHIFTED_KC_1": "!", - "KC_2": "2", - "SHIFTED_KC_2": "@", - "KC_3": "3", - "SHIFTED_KC_3": "#", - "KC_4": "4", - "SHIFTED_KC_4": "$", - "KC_5": "5", - "SHIFTED_KC_5": "%", - "KC_6": "6", - "SHIFTED_KC_6": "^", - "KC_7": "7", - "SHIFTED_KC_7": "&", - "KC_8": "8", - "SHIFTED_KC_8": "*", - "KC_9": "9", - "SHIFTED_KC_9": "(", - "KC_0": "0", - "SHIFTED_KC_0": ")", - "KC_A": "a", - "SHIFTED_KC_A": "A", - "KC_B": "b", - "SHIFTED_KC_B": "B", - "KC_C": "c", - "SHIFTED_KC_C": "C", - "KC_D": "d", - "SHIFTED_KC_D": "D", - "KC_E": "e", - "SHIFTED_KC_E": "E", - "KC_F": "f", - "SHIFTED_KC_F": "F", - "KC_G": "g", - "SHIFTED_KC_G": "G", - "KC_H": "h", - "SHIFTED_KC_H": "H", - "KC_I": "i", - "SHIFTED_KC_I": "I", - "KC_J": "j", - "SHIFTED_KC_J": "J", - "KC_K": "k", - "SHIFTED_KC_K": "K", - "KC_L": "l", - "SHIFTED_KC_L": "L", - "KC_M": "m", - "SHIFTED_KC_M": "M", - "KC_N": "n", - "SHIFTED_KC_N": "N", - "KC_O": "o", - "SHIFTED_KC_O": "O", - "KC_P": "p", - "SHIFTED_KC_P": "P", - "KC_Q": "q", - "SHIFTED_KC_Q": "Q", - "KC_R": "r", - "SHIFTED_KC_R": "R", - "KC_S": "s", - "SHIFTED_KC_S": "S", - "KC_T": "t", - "SHIFTED_KC_T": "T", - "KC_U": "u", - "SHIFTED_KC_U": "U", - "KC_V": "v", - "SHIFTED_KC_V": "V", - "KC_W": "w", - "SHIFTED_KC_W": "W", - "KC_X": "x", - "SHIFTED_KC_X": "X", - "KC_Y": "y", - "SHIFTED_KC_Y": "Y", - "KC_Z": "z", - "SHIFTED_KC_Z": "Z", - "KC_ENTER": "\u23ce", - "KC_ENT": "\u23ce", - "KC_ESCAPE": "\u238b", - "KC_ESC": "\u238b", - "KC_BSPACE": "\u232b", - "KC_BSPC": "\u232b", - "KC_TAB": "\u21e5", - "KC_SPACE": "", - "KC_SPC": "", - "KC_MINUS": "-", - "KC_MINS": "-", - "KC_EQUAL": "+", - "KC_EQL": "=", - "KC_LBRACKET": "{", - "KC_LBRC": "[", - "KC_RBRACKET": "}", - "KC_RBRC": "]", - "KC_BSLS": "\\", - "KC_BSLASH": "\\", - "KC_SCOLON": ":", - "KC_SCLN": ";", - "KC_QUOTE": "\"", - "KC_QUOT": "'", - "KC_GRAVE": "`", - "KC_GRV": "`", - "KC_COMMA": ",", - "KC_COMM": ",", - "KC_DOT": ".", - "KC_SLASH": "/", - "KC_NUBS": "/", - "KC_NUHS": "#", - "KC_CAPSLOCK": "Caps", - "KC_CAPS": "Caps", - "KC_LCTRL": "Ctrl", - "KC_LCTL": "Ctrl", - "KC_LSHIFT": "\u21e7", - "KC_LSFT": "\u21e7", - "KC_LALT": "\u2325", - "KC_LGUI": "\u2318", - "KC_LCMD": "\u2318", - "KC_RCTRL": "Right Control", - "KC_RCTL": "Right Control", - "KC_RSHIFT": "\u21e7", - "KC_RSFT": "\u21e7", - "KC_RALT": "\u2325", - "KC_RGUI": "\u2318", - "KC_RCMD": "\u2318", - "KC_LOCKING_CAPS": "Locking Caps Lock", - "KC_LCAP": "Locking Caps Lock", - "KC_LOCKING_NUM": "Locking Num Lock", - "KC_LNUM": "Locking Num Lock", - "KC_LOCKING_SCROLL": "Locking Scroll Lock", - "KC_LSCR": "Locking Scroll Lock", - "KC_INT4": "JIS Henkan", - "KC_HENK": "JIS Henkan", - "KC_INT5": "JIS Muhenkan", - "KC_MHEN": "JIS Muhenkan", - "KC_PSCREEN": "Print Screen", - "KC_PSCR": "Print Screen", - "KC_SCROLLLOCK": "Scroll Lock", - "KC_SLCK": "Scroll Lock", - "KC_PAUSE": "Pause", - "KC_PAUS": "Pause", - "KC_INSERT": "Insert", - "KC_INS": "Insert", - "KC_HOME": "Home", - "KC_PGUP": "PgUp", - "KC_DELETE": "\u2326", - "KC_DEL": "\u2326", - "KC_END": "End", - "KC_PGDOWN": "PgDn", - "KC_PGDN": "PgDn", - "KC_RIGHT": "→", - "KC_RGHT": "→", - "KC_LEFT": "←", - "KC_DOWN": "↓", - "KC_UP": "↑", - "KC_APPLICATION": "Application (Windows Menu Key)", - "KC_APP": "Application (Windows Menu Key)", - "KC_POWER": "Deprecated by MS in favor of KC_SYSTEM_POWER.", - "KC_EXECUTE": "Execute", - "KC_HELP": "Help", - "KC_MENU": "Menu", - "KC_SELECT": "Select", - "KC_AGAIN": "Again", - "KC_UNDO": "Undo", - "KC_CUT": "Cut", - "KC_COPY": "Copy", - "KC_PASTE": "Paste", - "KC_FIND": "Find", - "KC_ALT_ERASE": "Alternate Erase", - "KC_SYSREQ": "SysReq/Attention", - "KC_CANCEL": "Cancel", - "KC_CLEAR": "Clear", - "KC_PRIOR": "Prior", - "KC_RETURN": "Return", - "KC_SEPARATOR": "Separator", - "KC_OUT": "Out", - "KC_OPER": "Oper", - "KC_CLEAR_AGAIN": "Clear/Again", - "KC_CRSEL": "CrSel/Props", - "KC_EXSEL": "ExSel", - "KC_SYSTEM_POWER": "System Power Down.", - "KC_PWR": "System Power Down.", - "KC_SYSTEM_SLEEP": "System Sleep", - "KC_SLEP": "System Sleep", - "KC_SYSTEM_WAKE": "System Wake", - "KC_WAKE": "System Wake", - "KC_STOP": "Stop", - "KC__MUTE": "Mute (macOS)", - "KC__VOLUP": "vol+", - "KC__VOLDOWN": "vol-", - "KC_AUDIO_MUTE": "Mute", - "KC_MUTE": "Mute", - "KC_AUDIO_VOL_UP": "vol+", - "KC_VOLU": "vol+", - "KC_AUDIO_VOL_DOWN": "vol-", - "KC_VOLD": "vol-", - "KC_MEDIA_NEXT_TRACK": "next", - "KC_MNXT": "next", - "KC_MEDIA_PREV_TRACK": "Previous Track (Windows)", - "KC_MPRV": "Previous Track (Windows)", - "KC_MEDIA_FAST_FORWARD": "next", - "KC_MFFD": "next", - "KC_MEDIA_REWIND": "Previous Track (macOS)", - "KC_MRWD": "Previous Track (macOS)", - "KC_MEDIA_STOP": "Stop Track", - "KC_MSTP": "Stop Track", - "KC_MEDIA_PLAY_PAUSE": "play", - "KC_MPLY": "play", - "KC_NUMLOCK": "Keypad Num Lock and Clear", - "KC_NLCK": "Keypad Num Lock and Clear", - "KC_SLSH": "/", - "KC_KP_SLASH": "/", - "KC_PSLS": "/", - "KC_KP_ASTERISK": "*", - "KC_PAST": "*", - "KC_KP_MINUS": "-", - "KC_PMNS": "-", - "KC_PPLS": "+", - "KC_KP_ENTER": "Enter", - "KC_PENT": "Enter", - "KC_KP_1": "1", - "KC_KP_2": "2", - "KC_KP_3": "3", - "KC_KP_4": "4", - "KC_KP_5": "5", - "KC_KP_6": "6", - "KC_KP_7": "7", - "KC_KP_8": "8", - "KC_KP_9": "9", - "KC_KP_0": "0", - "KC_F1": "F1", - "KC_F2": "F2", - "KC_F3": "F3", - "KC_F4": "F4", - "KC_F5": "F5", - "KC_F6": "F6", - "KC_F7": "F7", - "KC_F8": "F8", - "KC_F9": "F9", - "KC_F10": "F10", - "KC_F11": "F11", - "KC_F12": "F12", - "_______": "", - "KC_TILDE": "~", - "KC_TILD": "~", - "KC_EXCLAIM": "!", - "KC_EXLM": "!", - "KC_AT": "@", - "KC_HASH": "#", - "KC_DOLLAR": "$", - "KC_DLR": "$", - "KC_PERCENT": "%", - "KC_PERC": "%", - "KC_CIRCUMFLEX": "^", - "KC_CIRC": "^", - "KC_AMPERSAND": "&", - "KC_AMPR": "&", - "KC_ASTERISK": "*", - "KC_ASTR": "*", - "KC_LEFT_PAREN": "(", - "KC_LPRN": "(", - "KC_RIGHT_PAREN": ")", - "KC_RPRN": ")", - "KC_UNDERSCORE": "_", - "KC_UNDS": "_", - "KC_PLUS": "+", - "KC_LEFT_CURLY_BRACE": "{", - "KC_LCBR": "{", - "KC_RIGHT_CURLY_BRACE": "}", - "KC_RCBR": "}", - "KC_PIPE": "|", - "KC_COLON": ":", - "KC_COLN": ":", - "KC_DOUBLE_QUOTE": "\"", - "KC_DQUO": "\"", - "KC_DQT": "\"", - "KC_LEFT_ANGLE_BRACKET": "<", - "KC_LABK": "<", - "KC_LT": "<", - "KC_RIGHT_ANGLE_BRACKET": ">", - "KC_RABK": ">", - "KC_GT": ">", - "KC_QUESTION": "?", - "KC_QUES": "?", - "KC_KP_PLUS": "+", - "LSFT_T(KC_CAPS)": "\u21e7", - - "LGUI(KC_X)": "", - "LGUI(KC_C)": "", - "LGUI(S(LALT(KC_V)))": "", - - "S(KC_NUHS)": "#", - "S(KC_NUBS)": "/", - "MOVEMENT": "\u0394", - "RAISE": "\u2350", - "LOWER": "\u2357", - "LCTL_T(KC_ESC)": "c/e", - "KC_NO": " ", - - "MO(3)": "mov", - "MO(1)": "lower", - "MO(2)": "raise", - "MO(5)": "fn", - "LSFT_T(KC_SPC)": "sp/sh", - "KC_TRNS": "", - "KC_PSTE": "Paste", - - "KC_P1": "1", - "KC_P2": "2", - "KC_P3": "3", - "KC_P4": "4", - "KC_P5": "5", - "KC_P6": "6", - "KC_P7": "7", - "KC_P8": "8", - "KC_P9": "9", - "KC_P0": "0", - - "KC_PCMM": ",", - "KC_PDOT": ".", - "KC_PEQL": "=" -} diff --git a/layouts/community/ortho_4x12/guidoism/readme.md b/layouts/community/ortho_4x12/guidoism/readme.md deleted file mode 100644 index 540db64e85..0000000000 --- a/layouts/community/ortho_4x12/guidoism/readme.md +++ /dev/null @@ -1,107 +0,0 @@ -# Guido's Planck Keyboard Layout - -I've written a script to convert the json file from the -[QMK Configurator](https://config.qmk.fm) to the C macros -and a pretty form the comments. - -First import the json file in this directory into the configurator, -make any changes, export the file and then run this: - - mv ~/Downloads/guidoism.json layouts/community/ortho_4x12/guidoism/ && python3 layouts/community/ortho_4x12/guidoism/generate_c.py && make planck:guidoism:dfu - -TODO: Move running of generate_c.py to makefile so I just need to run `make planck:guidoism:dfu` - -Note that the pretty forms of the keys are defined in another json -file and are made for my specific board. You made need to update this -file to get the pretty forms to look right. - -* Left palm to the `mov` key gets you the `Move` layer -* Right thumb on the `raise` key gets you the various programming brackets and parens on your left hand -* Left palm on `mov` key and left thumb on `lower` key gets you a numpad on your right hand -* Shift with the spacebar -* Left pinky is control on hold and escape on tap - -## Current Configuration - -## Qwerty -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Lower -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ caps│ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Raise -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Movement -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ home│ │ end │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Numpad -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ 0 │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` - - -## Function -``` -┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ -│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ │ -├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ -│ │ │ │ │ │ │ │ │ │ │ │ -└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ -``` diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index fa433a6b0d..835022f4bf 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -5,10 +5,10 @@ ifeq ($(strip $(KEYBOARD)), jj40) SWAP_HANDS_ENABLE = no endif -ifeq ($(strip $(KEYBOARD)), 4x4) +ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) SWAP_HANDS_ENABLE = no endif ifeq ($(strip $(KEYBOARD)), zlant) SWAP_HANDS_ENABLE = no -endif \ No newline at end of file +endif diff --git a/layouts/community/ortho_4x12/xyverz/rules.mk b/layouts/community/ortho_4x12/xyverz/rules.mk index 852e38f24e..c181e11072 100644 --- a/layouts/community/ortho_4x12/xyverz/rules.mk +++ b/layouts/community/ortho_4x12/xyverz/rules.mk @@ -3,6 +3,8 @@ AUDIO_ENABLE = no # Audio output on port C6 ifeq ("$(KEYBOARD)","vitamins_included") RGBLIGHT_ENABLE = no +else ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) + RGBLIGHT_ENABLE = no else RGBLIGHT_ENABLE = yes endif diff --git a/layouts/community/planck_mit/guidoism/config.h b/layouts/community/planck_mit/guidoism/config.h new file mode 100644 index 0000000000..e22f298035 --- /dev/null +++ b/layouts/community/planck_mit/guidoism/config.h @@ -0,0 +1,24 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#define IGNORE_MOD_TAP_INTERRUPT +#define USB_MAX_POWER_CONSUMPTION 50 diff --git a/layouts/community/planck_mit/guidoism/generate_c.py b/layouts/community/planck_mit/guidoism/generate_c.py new file mode 100644 index 0000000000..5bee576084 --- /dev/null +++ b/layouts/community/planck_mit/guidoism/generate_c.py @@ -0,0 +1,75 @@ +import itertools +import json +import os.path +import re + +KEYMAP_C = """/* {0} +{1} +*/ +[{2}] = {3}( + {4}) +""" + +README_MD = """## {0} +``` +{1} +``` +""" + +base = os.path.dirname(__file__) + +layer_names = dict(enumerate(['_QWERTY', '_LOWER', '_RAISE', '_MOVEMENT', '_NUMPAD', '_FUNCTION'])) +layer_name = {('MO(%d)' % i): layer_names.get(i).strip('_') for i in layer_names.keys()} + +keys = json.load(open(os.path.join(base, 'keys.json'))) + +d = json.load(open(os.path.join(base, 'guidoism.json'))) + +def surround(s, a, b, c): + return a + b.join(s) + c + +def pattern(cell, table): + return ['─'*cell for i in range(table)] + +top = surround(pattern(5, 12), '┌', '┬', '┐') +mid = surround(pattern(5, 12), '├', '┼', '┤') +bottom = surround(pattern(5, 12), '└', '┴', '┘') + +from more_itertools import chunked, intersperse, interleave_longest + +def uni(k): + return keys.get(k, k).lower().center(5) + +def c_layout(i, definition, template): + c_name = layer_names[i] + pretty_name = c_name.strip('_').capitalize() + layout = d['layout'] + + surround = lambda s: ''.join(interleave_longest(['│']*(len(s)+1), s)) + layer = list(map(uni, definition)) + layer[41] = layer[41].center(11) + layer = chunked(layer, 12) + rows = intersperse(mid, map(surround, layer)) + pretty = '\n'.join(itertools.chain([top], rows, [bottom])) + + surround = lambda s: ', '.join(s) + layer = list(map(lambda k: layer_name.get(k, k), definition)) + layer = chunked(layer, 12) + rows = map(surround, layer) + c_layer = ',\n '.join(itertools.chain([], rows, [])) + + return template.format(pretty_name, pretty, c_name, layout, c_layer) + +start = '// START_REPLACEMENT\n' +end = '// END_REPLACEMENT\n' +replacement = start + ',\n\n'.join(c_layout(i, l, KEYMAP_C) for i, l in enumerate(d['layers'])) + end +keymap = os.path.join(base, 'keymap.c') +existing = open(keymap).read() +r = re.compile(r'// START_REPLACEMENT.*// END_REPLACEMENT', re.DOTALL) +open(keymap, 'w').write(r.sub(replacement, existing)) + +replacement = '## Current Configuration\n\n' + '\n\n'.join(c_layout(i, l, README_MD) for i, l in enumerate(d['layers'])) +keymap = os.path.join(base, 'readme.md') +existing = open(keymap).read() +r = re.compile(r'## Current Configuration.*', re.DOTALL) +open(keymap, 'w').write(r.sub(replacement, existing)) diff --git a/layouts/community/planck_mit/guidoism/guidoism.json b/layouts/community/planck_mit/guidoism/guidoism.json new file mode 100644 index 0000000000..6a4364c6be --- /dev/null +++ b/layouts/community/planck_mit/guidoism/guidoism.json @@ -0,0 +1 @@ +{"keyboard":"planck/rev4","keymap":"guidoism","layout":"LAYOUT_planck_mit","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSPC","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_COLN","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","KC_NO","MO(3)","KC_ESC","KC_LALT","KC_LGUI","MO(1)","LSFT_T(KC_SPC)","MO(2)","KC_RGUI","KC_RALT","KC_SCLN","MO(5)"],["KC_TILD","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_NO","KC_NO","KC_UNDO","KC_TRNS","KC_NO","KC_CUT","KC_COPY","KC_PSTE","KC_NO","KC_NO","KC_UNDS","KC_PLUS","KC_DQUO","KC_QUOT","KC_PIPE","KC_CAPS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_MNXT","KC_VOLD","KC_VOLU","KC_MPLY"],["KC_GRV","KC_P1","KC_P2","KC_P3","KC_P4","KC_P5","KC_P6","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_LBRC","KC_RBRC","KC_LPRN","KC_RPRN","KC_NO","KC_NO","KC_PMNS","KC_PEQL","KC_NO","KC_NO","KC_BSLS","KC_TRNS","KC_LT","KC_GT","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["RESET","DEBUG","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PGUP","KC_UP","KC_PGDN","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LEFT","KC_DOWN","KC_RGHT","KC_NO","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_HOME","KC_NO","KC_END","KC_NO","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS"],["KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_PERC","KC_P7","KC_P8","KC_P9","KC_P0","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_DLR","KC_P4","KC_P5","KC_P6","KC_PDOT","KC_TRNS","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_P0","KC_P1","KC_P2","KC_P3","KC_PCMM","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_TRNS","KC_NO","KC_P0","KC_NO","KC_NO","KC_TRNS"],["KC_NO","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","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","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_TRNS"]]} \ No newline at end of file diff --git a/layouts/community/planck_mit/guidoism/keymap.c b/layouts/community/planck_mit/guidoism/keymap.c new file mode 100644 index 0000000000..2027e2bfa4 --- /dev/null +++ b/layouts/community/planck_mit/guidoism/keymap.c @@ -0,0 +1,183 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _LOWER, + _RAISE, + _MOVEMENT, + _NUMPAD, + _FUNCTION, +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + MOVEMENT, + NUMPAD, +}; + +#define FUNCTION MO(_FUNCTION) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +// START_REPLACEMENT +/* Qwerty +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_QWERTY] = LAYOUT_planck_mit( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_COLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, + MOVEMENT, KC_ESC, KC_LALT, KC_LGUI, LOWER, LSFT_T(KC_SPC), RAISE, KC_RGUI, KC_RALT, KC_SCLN, FUNCTION) +, + +/* Lower +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ caps│ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_LOWER] = LAYOUT_planck_mit( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_UNDO, + KC_TRNS, KC_NO, KC_CUT, KC_COPY, KC_PSTE, KC_NO, KC_NO, KC_UNDS, KC_PLUS, KC_DQUO, KC_QUOT, KC_PIPE, + KC_CAPS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY) +, + +/* Raise +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_RAISE] = LAYOUT_planck_mit( + KC_GRV, KC_P1, KC_P2, KC_P3, KC_P4, KC_P5, KC_P6, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, + KC_TRNS, KC_LBRC, KC_RBRC, KC_LPRN, KC_RPRN, KC_NO, KC_NO, KC_PMNS, KC_PEQL, KC_NO, KC_NO, KC_BSLS, + KC_TRNS, KC_LT, KC_GT, KC_LCBR, KC_RCBR, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +, + +/* Movement +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ home│ │ end │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_MOVEMENT] = LAYOUT_planck_mit( + RESET, DEBUG, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, KC_UP, KC_PGDN, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_HOME, KC_NO, KC_END, KC_NO, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) +, + +/* Numpad +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ 0 │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_NUMPAD] = LAYOUT_planck_mit( + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PERC, KC_P7, KC_P8, KC_P9, KC_P0, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_DLR, KC_P4, KC_P5, KC_P6, KC_PDOT, KC_TRNS, + KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P0, KC_P1, KC_P2, KC_P3, KC_PCMM, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_P0, KC_NO, KC_NO, KC_TRNS) +, + +/* Function +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +*/ +[_FUNCTION] = LAYOUT_planck_mit( + KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, 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, 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_TRNS) +// END_REPLACEMENT + + + + + + + + +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case MOVEMENT: + if (record->event.pressed) { + layer_on(_MOVEMENT); + update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); + } else { + layer_off(_MOVEMENT); + update_tri_layer(_LOWER, _MOVEMENT, _NUMPAD); + } + return false; + break; + } + return true; +} diff --git a/layouts/community/planck_mit/guidoism/keys.json b/layouts/community/planck_mit/guidoism/keys.json new file mode 100644 index 0000000000..791119b4f2 --- /dev/null +++ b/layouts/community/planck_mit/guidoism/keys.json @@ -0,0 +1,317 @@ +{ + "KC_1": "1", + "SHIFTED_KC_1": "!", + "KC_2": "2", + "SHIFTED_KC_2": "@", + "KC_3": "3", + "SHIFTED_KC_3": "#", + "KC_4": "4", + "SHIFTED_KC_4": "$", + "KC_5": "5", + "SHIFTED_KC_5": "%", + "KC_6": "6", + "SHIFTED_KC_6": "^", + "KC_7": "7", + "SHIFTED_KC_7": "&", + "KC_8": "8", + "SHIFTED_KC_8": "*", + "KC_9": "9", + "SHIFTED_KC_9": "(", + "KC_0": "0", + "SHIFTED_KC_0": ")", + "KC_A": "a", + "SHIFTED_KC_A": "A", + "KC_B": "b", + "SHIFTED_KC_B": "B", + "KC_C": "c", + "SHIFTED_KC_C": "C", + "KC_D": "d", + "SHIFTED_KC_D": "D", + "KC_E": "e", + "SHIFTED_KC_E": "E", + "KC_F": "f", + "SHIFTED_KC_F": "F", + "KC_G": "g", + "SHIFTED_KC_G": "G", + "KC_H": "h", + "SHIFTED_KC_H": "H", + "KC_I": "i", + "SHIFTED_KC_I": "I", + "KC_J": "j", + "SHIFTED_KC_J": "J", + "KC_K": "k", + "SHIFTED_KC_K": "K", + "KC_L": "l", + "SHIFTED_KC_L": "L", + "KC_M": "m", + "SHIFTED_KC_M": "M", + "KC_N": "n", + "SHIFTED_KC_N": "N", + "KC_O": "o", + "SHIFTED_KC_O": "O", + "KC_P": "p", + "SHIFTED_KC_P": "P", + "KC_Q": "q", + "SHIFTED_KC_Q": "Q", + "KC_R": "r", + "SHIFTED_KC_R": "R", + "KC_S": "s", + "SHIFTED_KC_S": "S", + "KC_T": "t", + "SHIFTED_KC_T": "T", + "KC_U": "u", + "SHIFTED_KC_U": "U", + "KC_V": "v", + "SHIFTED_KC_V": "V", + "KC_W": "w", + "SHIFTED_KC_W": "W", + "KC_X": "x", + "SHIFTED_KC_X": "X", + "KC_Y": "y", + "SHIFTED_KC_Y": "Y", + "KC_Z": "z", + "SHIFTED_KC_Z": "Z", + "KC_ENTER": "\u23ce", + "KC_ENT": "\u23ce", + "KC_ESCAPE": "\u238b", + "KC_ESC": "\u238b", + "KC_BSPACE": "\u232b", + "KC_BSPC": "\u232b", + "KC_TAB": "\u21e5", + "KC_SPACE": "", + "KC_SPC": "", + "KC_MINUS": "-", + "KC_MINS": "-", + "KC_EQUAL": "+", + "KC_EQL": "=", + "KC_LBRACKET": "{", + "KC_LBRC": "[", + "KC_RBRACKET": "}", + "KC_RBRC": "]", + "KC_BSLS": "\\", + "KC_BSLASH": "\\", + "KC_SCOLON": ":", + "KC_SCLN": ";", + "KC_QUOTE": "\"", + "KC_QUOT": "'", + "KC_GRAVE": "`", + "KC_GRV": "`", + "KC_COMMA": ",", + "KC_COMM": ",", + "KC_DOT": ".", + "KC_SLASH": "/", + "KC_NUBS": "/", + "KC_NUHS": "#", + "KC_CAPSLOCK": "Caps", + "KC_CAPS": "Caps", + "KC_LCTRL": "Ctrl", + "KC_LCTL": "Ctrl", + "KC_LSHIFT": "\u21e7", + "KC_LSFT": "\u21e7", + "KC_LALT": "\u2325", + "KC_LGUI": "\u2318", + "KC_LCMD": "\u2318", + "KC_RCTRL": "Right Control", + "KC_RCTL": "Right Control", + "KC_RSHIFT": "\u21e7", + "KC_RSFT": "\u21e7", + "KC_RALT": "\u2325", + "KC_RGUI": "\u2318", + "KC_RCMD": "\u2318", + "KC_LOCKING_CAPS": "Locking Caps Lock", + "KC_LCAP": "Locking Caps Lock", + "KC_LOCKING_NUM": "Locking Num Lock", + "KC_LNUM": "Locking Num Lock", + "KC_LOCKING_SCROLL": "Locking Scroll Lock", + "KC_LSCR": "Locking Scroll Lock", + "KC_INT4": "JIS Henkan", + "KC_HENK": "JIS Henkan", + "KC_INT5": "JIS Muhenkan", + "KC_MHEN": "JIS Muhenkan", + "KC_PSCREEN": "Print Screen", + "KC_PSCR": "Print Screen", + "KC_SCROLLLOCK": "Scroll Lock", + "KC_SLCK": "Scroll Lock", + "KC_PAUSE": "Pause", + "KC_PAUS": "Pause", + "KC_INSERT": "Insert", + "KC_INS": "Insert", + "KC_HOME": "Home", + "KC_PGUP": "PgUp", + "KC_DELETE": "\u2326", + "KC_DEL": "\u2326", + "KC_END": "End", + "KC_PGDOWN": "PgDn", + "KC_PGDN": "PgDn", + "KC_RIGHT": "→", + "KC_RGHT": "→", + "KC_LEFT": "←", + "KC_DOWN": "↓", + "KC_UP": "↑", + "KC_APPLICATION": "Application (Windows Menu Key)", + "KC_APP": "Application (Windows Menu Key)", + "KC_POWER": "Deprecated by MS in favor of KC_SYSTEM_POWER.", + "KC_EXECUTE": "Execute", + "KC_HELP": "Help", + "KC_MENU": "Menu", + "KC_SELECT": "Select", + "KC_AGAIN": "Again", + "KC_UNDO": "Undo", + "KC_CUT": "Cut", + "KC_COPY": "Copy", + "KC_PASTE": "Paste", + "KC_FIND": "Find", + "KC_ALT_ERASE": "Alternate Erase", + "KC_SYSREQ": "SysReq/Attention", + "KC_CANCEL": "Cancel", + "KC_CLEAR": "Clear", + "KC_PRIOR": "Prior", + "KC_RETURN": "Return", + "KC_SEPARATOR": "Separator", + "KC_OUT": "Out", + "KC_OPER": "Oper", + "KC_CLEAR_AGAIN": "Clear/Again", + "KC_CRSEL": "CrSel/Props", + "KC_EXSEL": "ExSel", + "KC_SYSTEM_POWER": "System Power Down.", + "KC_PWR": "System Power Down.", + "KC_SYSTEM_SLEEP": "System Sleep", + "KC_SLEP": "System Sleep", + "KC_SYSTEM_WAKE": "System Wake", + "KC_WAKE": "System Wake", + "KC_STOP": "Stop", + "KC__MUTE": "Mute (macOS)", + "KC__VOLUP": "vol+", + "KC__VOLDOWN": "vol-", + "KC_AUDIO_MUTE": "Mute", + "KC_MUTE": "Mute", + "KC_AUDIO_VOL_UP": "vol+", + "KC_VOLU": "vol+", + "KC_AUDIO_VOL_DOWN": "vol-", + "KC_VOLD": "vol-", + "KC_MEDIA_NEXT_TRACK": "next", + "KC_MNXT": "next", + "KC_MEDIA_PREV_TRACK": "Previous Track (Windows)", + "KC_MPRV": "Previous Track (Windows)", + "KC_MEDIA_FAST_FORWARD": "next", + "KC_MFFD": "next", + "KC_MEDIA_REWIND": "Previous Track (macOS)", + "KC_MRWD": "Previous Track (macOS)", + "KC_MEDIA_STOP": "Stop Track", + "KC_MSTP": "Stop Track", + "KC_MEDIA_PLAY_PAUSE": "play", + "KC_MPLY": "play", + "KC_NUMLOCK": "Keypad Num Lock and Clear", + "KC_NLCK": "Keypad Num Lock and Clear", + "KC_SLSH": "/", + "KC_KP_SLASH": "/", + "KC_PSLS": "/", + "KC_KP_ASTERISK": "*", + "KC_PAST": "*", + "KC_KP_MINUS": "-", + "KC_PMNS": "-", + "KC_PPLS": "+", + "KC_KP_ENTER": "Enter", + "KC_PENT": "Enter", + "KC_KP_1": "1", + "KC_KP_2": "2", + "KC_KP_3": "3", + "KC_KP_4": "4", + "KC_KP_5": "5", + "KC_KP_6": "6", + "KC_KP_7": "7", + "KC_KP_8": "8", + "KC_KP_9": "9", + "KC_KP_0": "0", + "KC_F1": "F1", + "KC_F2": "F2", + "KC_F3": "F3", + "KC_F4": "F4", + "KC_F5": "F5", + "KC_F6": "F6", + "KC_F7": "F7", + "KC_F8": "F8", + "KC_F9": "F9", + "KC_F10": "F10", + "KC_F11": "F11", + "KC_F12": "F12", + "_______": "", + "KC_TILDE": "~", + "KC_TILD": "~", + "KC_EXCLAIM": "!", + "KC_EXLM": "!", + "KC_AT": "@", + "KC_HASH": "#", + "KC_DOLLAR": "$", + "KC_DLR": "$", + "KC_PERCENT": "%", + "KC_PERC": "%", + "KC_CIRCUMFLEX": "^", + "KC_CIRC": "^", + "KC_AMPERSAND": "&", + "KC_AMPR": "&", + "KC_ASTERISK": "*", + "KC_ASTR": "*", + "KC_LEFT_PAREN": "(", + "KC_LPRN": "(", + "KC_RIGHT_PAREN": ")", + "KC_RPRN": ")", + "KC_UNDERSCORE": "_", + "KC_UNDS": "_", + "KC_PLUS": "+", + "KC_LEFT_CURLY_BRACE": "{", + "KC_LCBR": "{", + "KC_RIGHT_CURLY_BRACE": "}", + "KC_RCBR": "}", + "KC_PIPE": "|", + "KC_COLON": ":", + "KC_COLN": ":", + "KC_DOUBLE_QUOTE": "\"", + "KC_DQUO": "\"", + "KC_DQT": "\"", + "KC_LEFT_ANGLE_BRACKET": "<", + "KC_LABK": "<", + "KC_LT": "<", + "KC_RIGHT_ANGLE_BRACKET": ">", + "KC_RABK": ">", + "KC_GT": ">", + "KC_QUESTION": "?", + "KC_QUES": "?", + "KC_KP_PLUS": "+", + "LSFT_T(KC_CAPS)": "\u21e7", + + "LGUI(KC_X)": "", + "LGUI(KC_C)": "", + "LGUI(S(LALT(KC_V)))": "", + + "S(KC_NUHS)": "#", + "S(KC_NUBS)": "/", + "MOVEMENT": "\u0394", + "RAISE": "\u2350", + "LOWER": "\u2357", + "LCTL_T(KC_ESC)": "c/e", + "KC_NO": " ", + + "MO(3)": "mov", + "MO(1)": "lower", + "MO(2)": "raise", + "MO(5)": "fn", + "LSFT_T(KC_SPC)": "sp/sh", + "KC_TRNS": "", + "KC_PSTE": "Paste", + + "KC_P1": "1", + "KC_P2": "2", + "KC_P3": "3", + "KC_P4": "4", + "KC_P5": "5", + "KC_P6": "6", + "KC_P7": "7", + "KC_P8": "8", + "KC_P9": "9", + "KC_P0": "0", + + "KC_PCMM": ",", + "KC_PDOT": ".", + "KC_PEQL": "=" +} diff --git a/layouts/community/planck_mit/guidoism/readme.md b/layouts/community/planck_mit/guidoism/readme.md new file mode 100644 index 0000000000..540db64e85 --- /dev/null +++ b/layouts/community/planck_mit/guidoism/readme.md @@ -0,0 +1,107 @@ +# Guido's Planck Keyboard Layout + +I've written a script to convert the json file from the +[QMK Configurator](https://config.qmk.fm) to the C macros +and a pretty form the comments. + +First import the json file in this directory into the configurator, +make any changes, export the file and then run this: + + mv ~/Downloads/guidoism.json layouts/community/ortho_4x12/guidoism/ && python3 layouts/community/ortho_4x12/guidoism/generate_c.py && make planck:guidoism:dfu + +TODO: Move running of generate_c.py to makefile so I just need to run `make planck:guidoism:dfu` + +Note that the pretty forms of the keys are defined in another json +file and are made for my specific board. You made need to update this +file to get the pretty forms to look right. + +* Left palm to the `mov` key gets you the `Move` layer +* Right thumb on the `raise` key gets you the various programming brackets and parens on your left hand +* Left palm on `mov` key and left thumb on `lower` key gets you a numpad on your right hand +* Shift with the spacebar +* Left pinky is control on hold and escape on tap + +## Current Configuration + +## Qwerty +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ⇥ │ q │ w │ e │ r │ t │ y │ u │ i │ o │ p │ ⌫ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ctrl│ a │ s │ d │ f │ g │ h │ j │ k │ l │ : │ ⏎ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ ⇧ │ z │ x │ c │ v │ b │ n │ m │ , │ . │ / │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ mov │ ⎋ │ ⌥ │ ⌘ │lower│ sp/sh │raise│ ⌘ │ ⌥ │ ; │ fn │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` + + +## Lower +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ~ │ ! │ @ │ # │ $ │ % │ ^ │ & │ * │ │ │ undo│ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ cut │ copy│paste│ │ │ _ │ + │ " │ ' │ | │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ caps│ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ next│ vol-│ vol+│ play│ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` + + +## Raise +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ [ │ ] │ ( │ ) │ │ │ - │ = │ │ │ \ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ < │ > │ { │ } │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` + + +## Movement +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│reset│debug│ │ │ │ │ │ pgup│ ↑ │ pgdn│ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ ← │ ↓ │ → │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ home│ │ end │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` + + +## Numpad +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ │ │ │ │ │ % │ 7 │ 8 │ 9 │ 0 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ $ │ 4 │ 5 │ 6 │ . │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ 0 │ 1 │ 2 │ 3 │ , │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ 0 │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` + + +## Function +``` +┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ +│ │ f1 │ f2 │ f3 │ f4 │ f5 │ f6 │ f7 │ f8 │ f9 │ f10 │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ │ +├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ +│ │ │ │ │ │ │ │ │ │ │ │ +└─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ +``` -- cgit v1.2.3 From f3ffd6ad50f0a4bf24f0a0453cc5502b4b88f390 Mon Sep 17 00:00:00 2001 From: epaew Date: Tue, 27 Nov 2018 02:50:45 +0900 Subject: Keymap: Refactor edvorakjp user library (#4480) * Refactor edvorakjp user library * add tap dance support * update keymaps * edvorakjp: add SWAP_SCLN option * fix behavior of SWAP_SCLN --- keyboards/helix/rev2/keymaps/edvorakjp/config.h | 1 + keyboards/helix/rev2/keymaps/edvorakjp/keymap.c | 2 +- .../helix/rev2/keymaps/edvorakjp/keymap_4rows.c | 2 +- .../helix/rev2/keymaps/edvorakjp/keymap_5rows.c | 2 +- keyboards/helix/rev2/keymaps/edvorakjp/oled.c | 15 +- keyboards/iris/keymaps/edvorakjp/config.h | 1 + keyboards/iris/keymaps/edvorakjp/keymap.c | 7 +- users/edvorakjp/edvorakjp.c | 222 +-------------------- users/edvorakjp/edvorakjp.h | 37 ++-- users/edvorakjp/edvorakjp_process_record.c | 206 +++++++++++++++++++ users/edvorakjp/edvorakjp_status.c | 75 +++++++ users/edvorakjp/edvorakjp_tap_dance.c | 71 +++++++ users/edvorakjp/readme.md | 12 +- users/edvorakjp/rules.mk | 8 +- 14 files changed, 406 insertions(+), 255 deletions(-) create mode 100644 users/edvorakjp/edvorakjp_process_record.c create mode 100644 users/edvorakjp/edvorakjp_status.c create mode 100644 users/edvorakjp/edvorakjp_tap_dance.c diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/config.h b/keyboards/helix/rev2/keymaps/edvorakjp/config.h index 643220383c..769988cdb5 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/config.h +++ b/keyboards/helix/rev2/keymaps/edvorakjp/config.h @@ -4,6 +4,7 @@ #undef TAPPING_FORCE_HOLD #undef TAPPING_TERM #define TAPPING_TERM 120 +#define SWAP_SCLN // If you need more program area, try select and reduce rgblight modes to use. diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c index 22940f7cbe..fd324a859a 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap.c @@ -11,7 +11,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case KC_LOCK: if (record->event.pressed) { - if (edvorakjp_config.enable_kc_lang) { + if (get_enable_kc_lang()) { SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); } else { SEND_STRING( SS_LGUI("l") ); diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c index d8257d81f8..805e6b17b7 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_4rows.c @@ -5,7 +5,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_EDVORAK] = LAYOUT_kc( //,----+----+----+----+----+----. ,----+----+----+----+----+----. - LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS, + LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, //|----+----+----+----+----+----| |----+----+----+----+----+----| EQL , A , O , E , I , U , D , T , N , S , M ,MINS, //|----+----+----+----+----+----| |----+----+----+----+----+----| diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c index 9116b39665..ef1b9d358c 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/keymap_5rows.c @@ -7,7 +7,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //,----+----+----+----+----+----. ,----+----+----+----+----+----. GRV ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,BSPC, //|----+----+----+----+----+----| |----+----+----+----+----+----| - LBRC,RBRC,COMM,DOT , P , Y , F , G , R , W , Q ,BSLS, + LBRC,RBRC,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, //|----+----+----+----+----+----| |----+----+----+----+----+----| EQL , A , O , E , I , U , D , T , N , S , M ,MINS, //|----+----+----+----+----+----+----. ,----|----+----+----+----+----+----| diff --git a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c index 5ced1d4fad..227e2c56f8 100644 --- a/keyboards/helix/rev2/keymaps/edvorakjp/oled.c +++ b/keyboards/helix/rev2/keymaps/edvorakjp/oled.c @@ -23,15 +23,10 @@ void render_status(struct CharacterMatrix *matrix) { // Render to mode icon static char logo[][2][3] = {{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if (edvorakjp_config.enable_kc_lang) { - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - } else { - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } + int mode_number = get_enable_kc_lang() ? 0 : 1; + matrix_write(matrix, logo[mode_number][0]); + matrix_write(matrix, "\n"); + matrix_write(matrix, logo[mode_number][1]); // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below char buf[40]; @@ -63,7 +58,7 @@ void render_status(struct CharacterMatrix *matrix) { // Host Keyboard LED Status char led[40]; snprintf(led, sizeof(led), "\n%s %s %s %s", - edvorakjp_config.enable_jp_extra_layer && japanese_mode ? "EXT" : " ", + get_enable_jp_extra_layer() && get_japanese_mode() ? "EXT" : " ", (host_keyboard_leds() & (1<event.pressed) { - if (edvorakjp_config.enable_kc_lang) { + if (get_enable_kc_lang()) { SEND_STRING( SS_LCTRL(SS_LSFT(SS_TAP(X_POWER))) ); } else { SEND_STRING( SS_LGUI("l") ); diff --git a/users/edvorakjp/edvorakjp.c b/users/edvorakjp/edvorakjp.c index cff1a123e4..1ac6107942 100644 --- a/users/edvorakjp/edvorakjp.c +++ b/users/edvorakjp/edvorakjp.c @@ -1,47 +1,12 @@ -#include "eeprom.h" #include "edvorakjp.h" -bool japanese_mode; -uint16_t time_on_pressed; - -edvorakjp_config_t edvorakjp_config; - -uint8_t eeconfig_read_edvorakjp(void) { - return eeprom_read_byte(EECONFIG_EDVORAK); -} - -void eeconfig_update_edvorakjp(uint8_t val) { - eeprom_update_byte(EECONFIG_EDVORAK, val); -} - void dvorakj_layer_off(void) { layer_off(_EDVORAKJ1); layer_off(_EDVORAKJ2); } -void update_japanese_mode(bool new_state) { - japanese_mode = new_state; - if (japanese_mode) { - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG1)); - } else { - SEND_STRING(SS_LALT("`")); - } - } else { - dvorakj_layer_off(); - if (edvorakjp_config.enable_kc_lang) { - SEND_STRING(SS_TAP(X_LANG2)); - } else { - SEND_STRING(SS_LALT("`")); - } - } -} - void matrix_init_user(void) { - japanese_mode = false; - time_on_pressed = 0; - edvorakjp_config.raw = eeconfig_read_edvorakjp(); - + edvorakjp_status_init(); matrix_init_keymap(); } @@ -58,189 +23,16 @@ uint32_t layer_state_set_keymap(uint32_t state) { return state; } -/* - * Each process_record_* methods defined here are - * return false if handle edvorak_keycodes, or return true others. - */ -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { - if (!(edvorakjp_config.enable_jp_extra_layer &&\ - (default_layer_state == 1UL<<_EDVORAK) &&\ - japanese_mode &&\ - record->event.pressed)) { - return true; - } - - // consonant keys - // layer_on(J1) or layer_on(J2) are defined based on key positions. - switch (keycode) { - // right hand's left side w/o N - case KC_F: - case KC_G: - case KC_R: - case KC_D: - case KC_T: - case KC_B: - case KC_H: - case KC_J: - layer_on(_EDVORAKJ1); - register_code(keycode); - unregister_code(keycode); - return false; - - // N: toggle layer - case KC_N: - biton32(layer_state) == _EDVORAK ? layer_on(_EDVORAKJ1) : dvorakj_layer_off(); - register_code(keycode); - unregister_code(keycode); - return false; - - // left hand and right hand's right side - case KC_X: - case KC_C: - case KC_V: - case KC_Z: - case KC_P: - case KC_Y: - case KC_W: - case KC_Q: - case KC_S: - case KC_M: - case KC_K: - case KC_L: - layer_on(_EDVORAKJ2); - register_code(keycode); - unregister_code(keycode); - return false; - } - - // vowel keys, symbol keys and modifier keys - dvorakj_layer_off(); - switch (keycode) { - // combination vowel keys - case KC_AI: - SEND_STRING("ai"); - return false; - case KC_OU: - SEND_STRING("ou"); - return false; - case KC_EI: - SEND_STRING("ei"); - return false; - case KC_ANN: - SEND_STRING("ann"); - return false; - case KC_ONN: - SEND_STRING("onn"); - return false; - case KC_ENN: - SEND_STRING("enn"); - return false; - case KC_INN: - SEND_STRING("inn"); - return false; - case KC_UNN: - SEND_STRING("unn"); - return false; - - // AOEIU and other (symbol, modifier) keys - default: - return true; - } -} - -bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_MAC: - edvorakjp_config.enable_kc_lang = true; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_WIN: - edvorakjp_config.enable_kc_lang = false; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_EXTON: - edvorakjp_config.enable_jp_extra_layer = true; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - case KC_EXTOFF: - edvorakjp_config.enable_jp_extra_layer = false; - eeconfig_update_edvorakjp(edvorakjp_config.raw); - return false; - } - return true; -} - -bool process_record_layer(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case EDVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_EDVORAK); - } - return false; - case QWERTY: - if (record->event.pressed) { - dvorakj_layer_off(); - set_single_persistent_default_layer(_QWERTY); - } - return false; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - time_on_pressed = record->event.time; - } else { - layer_off(_LOWER); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - update_japanese_mode(false); - } - time_on_pressed = 0; - } - return false; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - time_on_pressed = record->event.time; - } else { - layer_off(_RAISE); - - if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { - update_japanese_mode(true); - } - time_on_pressed = 0; - } - return false; - default: - return true; - } -} - -bool process_record_ime(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case KC_JPN: - if (record->event.pressed) { - update_japanese_mode(true); - } - return false; - case KC_ENG: - if (record->event.pressed) { - update_japanese_mode(false); - } - return false; - default: - return true; - } -} - bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return process_record_keymap(keycode, record) &&\ process_record_edvorakjp_ext(keycode, record) &&\ + process_record_edvorakjp_swap_scln(keycode, record) &&\ process_record_edvorakjp_config(keycode, record) &&\ process_record_layer(keycode, record) &&\ process_record_ime(keycode, record); } + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/edvorakjp/edvorakjp.h b/users/edvorakjp/edvorakjp.h index f67400686a..e781bf2378 100644 --- a/users/edvorakjp/edvorakjp.h +++ b/users/edvorakjp/edvorakjp.h @@ -1,5 +1,5 @@ -#ifndef USERSPACE -#define USERSPACE +#ifndef EDVORAKJP +#define EDVORAKJP #include "quantum.h" #include "action_layer.h" @@ -8,15 +8,6 @@ extern keymap_config_t keymap_config; -typedef union { - uint8_t raw; - struct { - bool enable_jp_extra_layer : 1; - bool enable_kc_lang : 1; // for macOS - }; -} edvorakjp_config_t; -extern edvorakjp_config_t edvorakjp_config; - enum edvorakjp_layers { _EDVORAK = 0, _EDVORAKJ1, @@ -50,26 +41,38 @@ enum edvorakjp_keycodes { NEW_SAFE_RANGE }; -uint8_t eeconfig_read_edvorakjp(void); -void eeconfig_update_edvorakjp(uint8_t val); +enum tap_dance_code { + TD_LOWER = 0, + TD_RAISE +}; +// base void dvorakj_layer_off(void); -void update_japanese_mode(bool new_state); void matrix_init_user(void); void matrix_init_keymap(void); uint32_t layer_state_set_user(uint32_t state); uint32_t layer_state_set_keymap(uint32_t state); +bool process_record_user(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +// status +void edvorakjp_status_init(void); +bool get_enable_jp_extra_layer(void); +void set_enable_jp_extra_layer(bool new_state); +bool get_enable_kc_lang(void); +void set_enable_kc_lang(bool new_state); +bool get_japanese_mode(void); +void set_japanese_mode(bool new_state); /* * Each process_record_* methods defined here are * return false if processed, or return true if not processed. * You can add your original macros in process_record_keymap() in keymap.c. */ -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record); +bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record); bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record); bool process_record_layer(uint16_t keycode, keyrecord_t *record); bool process_record_ime(uint16_t keycode, keyrecord_t *record); -bool process_record_user(uint16_t keycode, keyrecord_t *record); -#endif +#endif // EDVORAKJP diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c new file mode 100644 index 0000000000..dc70522b47 --- /dev/null +++ b/users/edvorakjp/edvorakjp_process_record.c @@ -0,0 +1,206 @@ +#include "edvorakjp.h" + +#if TAP_DANCE_ENABLE != yes +static uint16_t time_on_pressed; +#endif +/* + * Each process_record_* methods defined here are + * return false if handle edvorak_keycodes, or return true others. + */ +bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { + if (!(default_layer_state == 1UL<<_EDVORAK && + get_enable_jp_extra_layer() && get_japanese_mode())) { + return true; + } + + // consonant keys + // layer_on(J1) or layer_on(J2) are defined based on key positions. + switch (keycode) { + // right hand's left side w/o N + case KC_F: + case KC_G: + case KC_R: + case KC_D: + case KC_T: + case KC_B: + case KC_H: + case KC_J: + if (record->event.pressed) { + layer_on(_EDVORAKJ1); + } + return true; + + // N: toggle layer + case KC_N: + if (record->event.pressed) { + biton32(layer_state) == _EDVORAK ? layer_on(_EDVORAKJ1) : dvorakj_layer_off(); + } + return true; + + // left hand and right hand's right side + case KC_X: + case KC_C: + case KC_V: + case KC_Z: + case KC_Y: + case KC_P: + case KC_W: + case KC_Q: + case KC_S: + case KC_M: + case KC_K: + case KC_L: + if (record->event.pressed) { + layer_on(_EDVORAKJ2); + } + return true; + } + + // vowel keys, symbol keys and modifier keys + if (record->event.pressed) { + dvorakj_layer_off(); + } + switch (keycode) { + // combination vowel keys + case KC_AI: + if (record->event.pressed) { + SEND_STRING("ai"); + } + return false; + case KC_OU: + if (record->event.pressed) { + SEND_STRING("ou"); + } + return false; + case KC_EI: + if (record->event.pressed) { + SEND_STRING("ei"); + } + return false; + case KC_ANN: + if (record->event.pressed) { + SEND_STRING("ann"); + } + return false; + case KC_ONN: + if (record->event.pressed) { + SEND_STRING("onn"); + } + return false; + case KC_ENN: + if (record->event.pressed) { + SEND_STRING("enn"); + } + return false; + case KC_INN: + if (record->event.pressed) { + SEND_STRING("inn"); + } + return false; + case KC_UNN: + if (record->event.pressed) { + SEND_STRING("unn"); + } + return false; + } + // AOEIU and other (symbol, modifier) keys + return true; +} + +bool process_record_edvorakjp_swap_scln(uint16_t keycode, keyrecord_t *record) { +#ifdef SWAP_SCLN + static const uint8_t shift_bits = MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT); + static uint8_t last_mods_status; + if (keycode == KC_SCLN) { + if (record->event.pressed) { + last_mods_status = get_mods(); + + // invert shift_bits + if (last_mods_status & shift_bits) { + set_mods(last_mods_status & ~shift_bits); + } else { + set_mods(last_mods_status | MOD_BIT(KC_LSFT)); + } + } else { + set_mods(last_mods_status); + last_mods_status = 0; + } + } +#endif + return true; +} + +bool process_record_edvorakjp_config(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MAC: + case KC_WIN: + if (record->event.pressed) { + set_enable_kc_lang(keycode == KC_MAC); + } + return false; + case KC_EXTON: + case KC_EXTOFF: + if (record->event.pressed) { + set_enable_jp_extra_layer(keycode == KC_EXTON); + } + return false; + } + return true; +} + +bool process_record_layer(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case EDVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_EDVORAK); + } + return false; + case QWERTY: + if (record->event.pressed) { + dvorakj_layer_off(); + set_single_persistent_default_layer(_QWERTY); + } + return false; +#if TAP_DANCE_ENABLE != yes + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + time_on_pressed = record->event.time; + } else { + layer_off(_LOWER); + + if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { + set_japanese_mode(false); + } + time_on_pressed = 0; + } + return false; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + time_on_pressed = record->event.time; + } else { + layer_off(_RAISE); + + if (TIMER_DIFF_16(record->event.time, time_on_pressed) < TAPPING_TERM) { + set_japanese_mode(true); + } + time_on_pressed = 0; + } + return false; +#endif + } + return true; +} + +bool process_record_ime(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_JPN: + case KC_ENG: + if (record->event.pressed) { + set_japanese_mode(keycode == KC_JPN); + } + return false; + } + return true; +} diff --git a/users/edvorakjp/edvorakjp_status.c b/users/edvorakjp/edvorakjp_status.c new file mode 100644 index 0000000000..a60c8d853b --- /dev/null +++ b/users/edvorakjp/edvorakjp_status.c @@ -0,0 +1,75 @@ +#include "eeprom.h" +#include "edvorakjp.h" + +typedef union { + uint8_t raw; + struct { + bool enable_jp_extra_layer : 1; + bool enable_kc_lang : 1; // for macOS + }; +} edvorakjp_config_t; +static edvorakjp_config_t edvorakjp_config; + +typedef struct { + bool japanese_mode; +} edvorakjp_state_t; +static edvorakjp_state_t edvorakjp_state; + +/* + * private methods + */ +uint8_t eeconfig_read_edvorakjp(void) { + return eeprom_read_byte(EECONFIG_EDVORAK); +} + +void eeconfig_update_edvorakjp(uint8_t val) { + eeprom_update_byte(EECONFIG_EDVORAK, val); +} + +/* + * public methods + */ +void edvorakjp_status_init(void) { + edvorakjp_state.japanese_mode = false; + edvorakjp_config.raw = eeconfig_read_edvorakjp(); +} + +bool get_enable_jp_extra_layer(void) { + return edvorakjp_config.enable_jp_extra_layer; +} + +void set_enable_jp_extra_layer(bool new_state) { + edvorakjp_config.enable_jp_extra_layer = new_state; + eeconfig_update_edvorakjp(edvorakjp_config.raw); +} + +bool get_enable_kc_lang(void) { + return edvorakjp_config.enable_kc_lang; +} + +void set_enable_kc_lang(bool new_state) { + edvorakjp_config.enable_kc_lang = new_state; + eeconfig_update_edvorakjp(edvorakjp_config.raw); +} + +bool get_japanese_mode(void) { + return edvorakjp_state.japanese_mode; +} + +void set_japanese_mode(bool new_state) { + edvorakjp_state.japanese_mode = new_state; + if (edvorakjp_state.japanese_mode) { + if (edvorakjp_config.enable_kc_lang) { + SEND_STRING(SS_TAP(X_LANG1)); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + dvorakj_layer_off(); + if (edvorakjp_config.enable_kc_lang) { + SEND_STRING(SS_TAP(X_LANG2)); + } else { + SEND_STRING(SS_LALT("`")); + } + } +} diff --git a/users/edvorakjp/edvorakjp_tap_dance.c b/users/edvorakjp/edvorakjp_tap_dance.c new file mode 100644 index 0000000000..62c0c100a2 --- /dev/null +++ b/users/edvorakjp/edvorakjp_tap_dance.c @@ -0,0 +1,71 @@ +#include "edvorakjp.h" +#include "process_keycode/process_tap_dance.h" + +enum tap_state { + NONE = 0, + SINGLE_TAP = 1, + DOUBLE_TAP = 2, + HOLD +}; + +static int td_status_lower = NONE; +static int td_status_raise = NONE; + +int cur_dance(qk_tap_dance_state_t *state) { + if (state->interrupted || !state->pressed) { + return state->count == 1 ? SINGLE_TAP : DOUBLE_TAP; + } else { + return HOLD; + } +} + +void td_lower_finished(qk_tap_dance_state_t *state, void *user_data) { + td_status_lower = cur_dance(state); + switch(td_status_lower) { + case SINGLE_TAP: + set_japanese_mode(false); + register_code(KC_ESC); + break; + case DOUBLE_TAP: + set_japanese_mode(false); + break; + case HOLD: + break; + } + layer_on(_LOWER); +} + +void td_lower_reset(qk_tap_dance_state_t *state, void *user_data) { + if (td_status_lower == SINGLE_TAP) { + unregister_code(KC_ESC); + } + layer_off(_LOWER); + td_status_lower = NONE; +} + +void td_raise_finished(qk_tap_dance_state_t *state, void *user_data) { + td_status_raise = cur_dance(state); + switch(td_status_raise) { + case SINGLE_TAP: + case DOUBLE_TAP: + set_japanese_mode(true); + break; + case HOLD: + break; + } + layer_on(_RAISE); +} + +void td_raise_reset(qk_tap_dance_state_t *state, void *user_data) { + layer_off(_RAISE); + td_status_raise = NONE; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_LOWER] = ACTION_TAP_DANCE_FN_ADVANCED_TIME( + NULL, td_lower_finished, td_lower_reset, TAPPING_TERM * 1.5 + ), + [TD_RAISE] = ACTION_TAP_DANCE_FN_ADVANCED_TIME( + NULL, td_raise_finished, td_raise_reset, TAPPING_TERM * 1.5 + ) +}; diff --git a/users/edvorakjp/readme.md b/users/edvorakjp/readme.md index d7ec742852..077ba4abdc 100644 --- a/users/edvorakjp/readme.md +++ b/users/edvorakjp/readme.md @@ -10,7 +10,7 @@ This is a sample. You can swap any symbol keys and modifier keys. //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , P , Y , F , G , R , W , Q , / , = , \ , + TAB , ' , , , . , Y , P , F , G , R , W , Q , / , = , \ , //+------++---++---++---++---++---++---++---++---++---++---++---++---+-------+ CAPS , A , O , E , I , U , D , T , N , S , M , - , ENT , //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-----------+ @@ -25,7 +25,7 @@ This is a sample. You can swap any symbol keys and modifier keys. //+----+----+----+----+----+----+----+----+----+----+----+----+----+---------+ ` , ! , @ , # , $ , % , ^ , & , * , ( , ) , [ , ] , BSPC , //+----+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+-------+ - TAB , ' , , , . , P , Y , F , G , R , W , C , / , = , + TAB , ' , , , . , Y , P , F , G , R , W , C , / , = , //+------++---++---++---++---++---++---++---++---++---++---++---++---++ CAPS , A , O , E , I , U , D , T , N , S , M , ; , - , ENT , //+-------+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+-+--+------+ @@ -78,11 +78,15 @@ This is a sample. You can swap any symbol keys and modifier keys. ## for Programmer - Dvorak 配列をベースに、ショートカットでよく利用される XCV は QWERTY 配列の位置を維持 -- Vimユーザのために、HJKL キーを横並びで配置 +- 一部にVimユーザ用のキー配置を実施 + - HJKL キーを横並びで配置 + - Shift押下時と非押下時で、";"キーの挙動を入れ替え(`config.h` 内で `#define SWAP_SCLN` の宣言が必要です) - デフォルトレイヤーには、数字キーの代わりに記号 `!@#$%^&*()` を配置 - mainly based on Dvorak layout, but XCV is available in the same position of QWERTY layout -- HJKL is lining side by side, for Vim users +- for Vim users + - HJKL is lining side by side + - swap the ";" key behavior. i.e. send ":" normally and send ";" when you hold shift. (need `#define SWAP_SCLN` in your `config.h`) - we can type `!@#$%^&*()` keys without shift keys in base layer ## License diff --git a/users/edvorakjp/rules.mk b/users/edvorakjp/rules.mk index 4fb7391864..587c3b8d2e 100644 --- a/users/edvorakjp/rules.mk +++ b/users/edvorakjp/rules.mk @@ -1 +1,7 @@ -SRC += edvorakjp.c +SRC += edvorakjp.c \ + edvorakjp_process_record.c \ + edvorakjp_status.c + +ifeq ($(TAP_DANCE_ENABLE), yes) +SRC += edvorakjp_tap_dance.c +endif -- cgit v1.2.3 From 4ebd27002a344b017276dc70796435a8e718f46a Mon Sep 17 00:00:00 2001 From: listofoptions <39714365+listofoptions@users.noreply.github.com> Date: Mon, 26 Nov 2018 12:53:49 -0500 Subject: Keyboard: 5291 firmware to replace the existing soarers controller firmware (#4483) * compiles but is not working * still testing 5291 * compiles but is not working * still testing 5291 * fixed a but in the layout (reversed key order in row) * compiles but is not working * still testing 5291 * fixed a but in the layout (reversed key order in row) * fixed some issues * doumentation needed * doumentation needed * documentation needed * documentation needed * Update readme.md documentation * Update readme.md i dislike markdown <_> * merge preperation --- keyboards/converter/ibm_5291/config.h | 42 +++ keyboards/converter/ibm_5291/ibm_5291.c | 3 + keyboards/converter/ibm_5291/ibm_5291.h | 69 +++++ keyboards/converter/ibm_5291/info.json | 6 + .../converter/ibm_5291/keymaps/default/keymap.c | 233 +++++++++++++++++ .../ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf | Bin 0 -> 13054 bytes keyboards/converter/ibm_5291/matrix.c | 284 +++++++++++++++++++++ keyboards/converter/ibm_5291/matrix.csv | 96 +++++++ keyboards/converter/ibm_5291/readme.md | 70 +++++ keyboards/converter/ibm_5291/rules.mk | 72 ++++++ 10 files changed, 875 insertions(+) create mode 100644 keyboards/converter/ibm_5291/config.h create mode 100644 keyboards/converter/ibm_5291/ibm_5291.c create mode 100644 keyboards/converter/ibm_5291/ibm_5291.h create mode 100644 keyboards/converter/ibm_5291/info.json create mode 100644 keyboards/converter/ibm_5291/keymaps/default/keymap.c create mode 100644 keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf create mode 100644 keyboards/converter/ibm_5291/matrix.c create mode 100644 keyboards/converter/ibm_5291/matrix.csv create mode 100644 keyboards/converter/ibm_5291/readme.md create mode 100644 keyboards/converter/ibm_5291/rules.mk diff --git a/keyboards/converter/ibm_5291/config.h b/keyboards/converter/ibm_5291/config.h new file mode 100644 index 0000000000..5c9ca1e4a9 --- /dev/null +++ b/keyboards/converter/ibm_5291/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2018 listofoptions + +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 + +#include "config_common.h" + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 1 +#define MANUFACTURER QMK +#define PRODUCT 5291 keyboard converter +#define DESCRIPTION 5291 keyboard converter + +#define MATRIX_ROWS 24 +#define MATRIX_COLS 4 + +#define MATRIX_ROW_PINS {B2, B3, B4, B5, B6} +#define MATRIX_COL_PINS {B0, B1} +#define MATRIX_DATA_PIN D0 +#define MATRIX_STROBE_PIN D1 +#define LED_PIN D6 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 0 + + diff --git a/keyboards/converter/ibm_5291/ibm_5291.c b/keyboards/converter/ibm_5291/ibm_5291.c new file mode 100644 index 0000000000..9b937a545a --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.c @@ -0,0 +1,3 @@ +#include "ibm_5291.h" +#include +#include "quantum.h" \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/ibm_5291.h b/keyboards/converter/ibm_5291/ibm_5291.h new file mode 100644 index 0000000000..aa1b403242 --- /dev/null +++ b/keyboards/converter/ibm_5291/ibm_5291.h @@ -0,0 +1,69 @@ +/* +Copyright 2018 listofoptions + +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 + +#include "quantum.h" + +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift|PrS| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ + +#define LAYOUT_5291( \ + KEY_F1,KEY_F2, KEY_ESC, KEY_1, KEY_2,KEY_3,KEY_4,KEY_5,KEY_6,KEY_7,KEY_8,KEY_9, KEY_0, KEY_MIN, KEY_EQU, KEY_BACK, KEY_NLOCK, KEY_SLOCK, \ + KEY_F3,KEY_F4, KEY_TAB, KEY_Q, KEY_W,KEY_E,KEY_R,KEY_T,KEY_Y,KEY_U,KEY_I,KEY_O, KEY_P, KEY_LBRC,KEY_RBRC, KEY_PAD7,KEY_PAD8, KEY_PAD9,KEY_PMIN, \ + KEY_F5,KEY_F6, KEY_LCTR,KEY_A, KEY_S,KEY_D,KEY_F,KEY_G,KEY_H,KEY_J,KEY_K,KEY_L, KEY_SEMI,KEY_QUOT,KEY_TICK, KEY_ENTR,KEY_PAD4,KEY_PAD5, KEY_PAD6, \ + KEY_F7,KEY_F8, KEY_LSFS,KEY_BSLS,KEY_Z,KEY_X,KEY_C,KEY_V,KEY_B,KEY_N,KEY_M,KEY_COMM,KEY_DOT, KEY_SLS,KEY_RSFS, KEY_PAST,KEY_PAD1,KEY_PAD2, KEY_PAD3,KEY_PPLS, \ + KEY_F9,KEY_F10, KEY_LALT, KEY_SPACE, KEY_CLOCK, KEY_PAD0, KEY_PDOT \ +) \ +{ {KEY_Z, KEY_S, KEY_W, KEY_3 }\ +, {KEY_X, KEY_D, KEY_E, KEY_4 }\ +, {KEY_C, KEY_F, KEY_R, KEY_5 }\ +, {KEY_V, KEY_G, KEY_T, KEY_6 }\ +, {KEY_B, KEY_H, KEY_Y, KEY_7 }\ +, {KEY_N, KEY_J, KEY_U, KEY_8 }\ +, {KEY_PAD2, KEY_PAD5,KEY_PAD8,KEY_NLOCK }\ +, {KEY_M, KEY_K, KEY_I, KEY_9 }\ +, {KEY_COMM, KEY_L, KEY_O, KEY_0 }\ +, {KEY_DOT, KEY_SEMI,KEY_P, KEY_MIN }\ +, {KEY_SLS, KEY_QUOT,KEY_LBRC,KEY_EQU }\ +, {KEY_SPACE, KEY_RSFS,KEY_TICK,KEY_RBRC }\ +, {KEY_CLOCK, KEY_PAST,KEY_ENTR,KEY_BACK }\ +, {KEY_PAD0, KEY_PAD1,KEY_PAD4,KEY_PAD7 }\ +, {KEY_PPLS, KC_NO, KEY_PMIN,KEY_SLOCK }\ +, {KEY_PDOT, KEY_PAD3,KEY_PAD6,KEY_PAD9 }\ +, {KEY_BSLS, KEY_A, KEY_Q, KEY_2 }\ +, {KEY_LALT, KC_NO, KC_NO, KEY_1 }\ +, {KEY_F7, KEY_F5, KEY_F3, KEY_F1 }\ +, {KEY_F8, KEY_F6, KEY_F4, KEY_F2 }\ +, {KC_F10, KC_NO, KC_NO, KC_NO }\ +, {KC_F9, KC_NO, KC_NO, KC_NO }\ +, {KEY_LSFS, KEY_LCTR,KEY_TAB, KEY_ESC }\ +, {KC_NO, KC_NO, KC_NO, KC_NO }\ +} + +#define LAYOUT LAYOUT_5291 \ No newline at end of file diff --git a/keyboards/converter/ibm_5291/info.json b/keyboards/converter/ibm_5291/info.json new file mode 100644 index 0000000000..080a16336e --- /dev/null +++ b/keyboards/converter/ibm_5291/info.json @@ -0,0 +1,6 @@ +{ + "keyboard_name": "IBM 5291", + "keyboard_folder": "converter/5291", + "url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard", + "maintainer": "listofoptions", +} diff --git a/keyboards/converter/ibm_5291/keymaps/default/keymap.c b/keyboards/converter/ibm_5291/keymaps/default/keymap.c new file mode 100644 index 0000000000..9b286c887d --- /dev/null +++ b/keyboards/converter/ibm_5291/keymaps/default/keymap.c @@ -0,0 +1,233 @@ +/* +Copyright 2018 listofoptions + +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 . +*/ + +#include QMK_KEYBOARD_H +/* +enum xt_keycodes + { XT_PAST = SAFE_RANGE // XT pad asterisk / print screen + , XT_SLCK // XT scroll lock / break + , XT_F6 // F6 / app key + , XT_F5 // F5 / gui + , XT_F9 // F9 / F11 + , XT_F10 // F10 / F12 + } ; + +static bool shift_pressed = false , + alt_pressed = false , + ctrl_pressed = false , + xt_pscr_pressed = false , + xt_brk_pressed = false , + xt_app_pressed = false , + xt_gui_pressed = false , + xt_lout_pressed = false , + xt_f11_pressed = false , + xt_f12_pressed = false ; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_LSFT: + case KC_RSFT: + if (record->event.pressed) { + shift_pressed = true ; + } else { + shift_pressed = false ; + } + return true; + break; + + case KC_LALT: + if (record->event.pressed) { + alt_pressed = true ; + } else { + alt_pressed = false ; + } + return true; + break; + + case KC_LCTL: + if (record->event.pressed) { + ctrl_pressed = true ; + } else { + ctrl_pressed = false ; + } + return true; + break; + + case XT_PAST: + if (record->event.pressed) { + if (shift_pressed) { + xt_pscr_pressed = true ; + register_code(KC_PSCR); + } else { + register_code(KC_PAST); + } + } else { + if (xt_pscr_pressed) { + xt_pscr_pressed = false ; + unregister_code(KC_PSCR); + } else { + unregister_code(KC_PAST); + } + } + return false; + break; + + case XT_SLCK: + if (record->event.pressed) { + if (ctrl_pressed) { + xt_brk_pressed = true ; + register_code(KC_BRK); + } else { + register_code(KC_SLCK); + } + } else { + if (xt_brk_pressed) { + xt_brk_pressed = false ; + unregister_code(KC_BRK); + } else { + unregister_code(KC_SLCK); + } + } + return false; + break; + + case XT_F6: + if (record->event.pressed) { + if (shift_pressed) { + xt_app_pressed = true ; + register_code(KC_APP); + } else { + register_code(KC_F6); + } + } else { + if (xt_app_pressed) { + xt_app_pressed = false ; + unregister_code(KC_APP); + } else { + unregister_code(KC_F6); + } + } + return false; + break; + + case XT_F5: + if (record->event.pressed) { + if (shift_pressed) { + xt_gui_pressed = true ; + register_code(KC_LGUI); + } else if (ctrl_pressed) { + xt_lout_pressed = true ; + register_code (KC_LGUI) ; + register_code (KC_L) ; + } else { + register_code(KC_F5); + } + } else { + if (xt_gui_pressed) { + xt_gui_pressed = false ; + unregister_code(KC_LGUI); + } else if (xt_lout_pressed) { + xt_lout_pressed = false ; + unregister_code (KC_LGUI) ; + unregister_code (KC_L) ; + } else { + unregister_code(KC_F5); + } + } + return false; + break; + + case XT_F9: + if (record->event.pressed) { + if (shift_pressed) { + xt_f11_pressed = true ; + register_code(KC_F11); + } else { + register_code(KC_F9); + } + } else { + if (xt_f11_pressed) { + xt_f11_pressed = false ; + unregister_code(KC_F11); + } else { + unregister_code(KC_F9); + } + } + return false; + break; + + case XT_F10: + if (record->event.pressed) { + if (shift_pressed) { + xt_f12_pressed = true ; + register_code(KC_F12); + } else { + register_code(KC_F10); + } + } else { + if (xt_f12_pressed) { + xt_f12_pressed = false ; + unregister_code(KC_F12); + } else { + unregister_code(KC_F10); + } + } + return false; + break; + + default: + return true; + break; + } + + return true; +} +*/ + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +// default layout is the standard XT layout +/* + * ,-------. ,--------------------------------------------------------------------------. + * | F1| F2| |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BS |NumLck |ScrLck | + * |-------| |--------------------------------------------------------------------------| + * | F3| F4| | Tab | Q| W| E| R| T| Y| U| I| O| P| [| ] | | 7| 8| 9| -| + * |-------| |------------------------------------------------------|Ent|---------------| + * | F5| F6| | Ctrl | A| S| D| F| G| H| J| K| L| ;| '| `| | 4| 5| 6| | + * |-------| |----------------------------------------------------------------------| | + * | F7| F8| |Shif| \| Z| X| C| V| B| N| M| ,| .| /|Shift| *| 1| 2| 3| +| + * |-------| |----------------------------------------------------------------------| | + * | F9|F10| | Alt | Space |CapsLck| 0 | . | | + * `-------' `--------------------------------------------------------------------------' +*/ +/* + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, 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_NLCK, XT_SLCK, + KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS, + XT_F5,XT_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,XT_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + XT_F9,XT_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +*/ + [0] = LAYOUT ( + KC_F1,KC_F2, KC_ESC, 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_NLCK, KC_SLCK, + KC_F3,KC_F4, 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_P7,KC_P8, KC_P9, KC_PMNS, + KC_F5,KC_F6, KC_LCTL,KC_A, KC_S,KC_D,KC_F,KC_G,KC_H,KC_J,KC_K,KC_L, KC_SCLN,KC_QUOT,KC_GRV, KC_ENT, KC_P4,KC_P5, KC_P6, + KC_F7,KC_F8, KC_LSFT,KC_BSLS,KC_Z,KC_X,KC_C,KC_V,KC_B,KC_N,KC_M,KC_COMM,KC_DOT, KC_SLSH,KC_RSFT,KC_PAST,KC_P1,KC_P2, KC_P3, KC_PPLS, + KC_F9,KC_F10,KC_LALT, KC_SPACE, KC_CAPS, KC_P0, KC_PDOT + ) +} ; + diff --git a/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf b/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf new file mode 100644 index 0000000000..3560598f02 Binary files /dev/null and b/keyboards/converter/ibm_5291/keymaps/kbdbabel_doc_ibm5291_kbd.pdf differ diff --git a/keyboards/converter/ibm_5291/matrix.c b/keyboards/converter/ibm_5291/matrix.c new file mode 100644 index 0000000000..58f6e37b65 --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.c @@ -0,0 +1,284 @@ +/* +Copyright 2018 listofoptions + +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 . +*/ + +#include +#include +#include +#if defined(__AVR__) +#include +#endif +#include + +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" + +#include "config.h" + + +#ifndef DEBOUNCING_DELAY +# define DEBOUNCING_DELAY 5 +#endif + +#define print_matrix_header() print("\nr/c 01234567\n") +#define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +#define matrix_bitpop(i) bitpop(matrix[i]) +#define ROW_SHIFTER ((uint8_t)1) +#define check_bit(var,pos) ((var) & (1<<(pos))) + +#define NUM_ROW_PINS 5 +#define NUM_COL_PINS 2 + +static const uint8_t row_pins [NUM_ROW_PINS] = MATRIX_ROW_PINS ; +static const uint8_t col_pins [NUM_ROW_PINS] = MATRIX_COL_PINS ; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint16_t debouncing_time ; +static bool debouncing = false ; +#endif + +static uint8_t matrix [MATRIX_ROWS] = {0}; + +#if ( DEBOUNCING_DELAY > 0 ) +static uint8_t matrix_debounce [MATRIX_ROWS] = {0}; +#endif + +static +inline +void toggle_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 2) ^= _BV(pin & 0xF); +} + +static +inline +void init_led(void) { + uint8_t pin = LED_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW +} + +static +inline +void init_data(void) { + uint8_t pin = MATRIX_DATA_PIN ; + _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // LO +} + +static +inline +void init_strobe(void) { + uint8_t pin = MATRIX_STROBE_PIN ; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI +} + +static +inline +void init_rows(void) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void init_cols(void) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i]; + _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } +} + +static +inline +void select_row(uint8_t current_row) { + for ( uint8_t i = 0 ; i < NUM_ROW_PINS; ++i ) { + uint8_t pin = row_pins[i] ; + if ( check_bit( current_row, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +void select_col(uint8_t current_col) { + for ( uint8_t i = 0 ; i < NUM_COL_PINS; ++i ) { + uint8_t pin = col_pins[i] ; + if ( check_bit( current_col, i ) ) { + _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + } else { + _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + } + } + wait_us(30) ; +} + +static +inline +uint8_t matrix_strobe(uint8_t col_index) { + uint8_t strobe_pin = MATRIX_STROBE_PIN ; + uint8_t data_pin = MATRIX_DATA_PIN ; + + // set strobe pin low + _SFR_IO8((strobe_pin >> 4) + 2) &= ~_BV(strobe_pin & 0xF); + + wait_us(30) ; + + // read data + uint8_t data = (_SFR_IO8(data_pin >> 4) & _BV(data_pin & 0xF)) ; + + // set strobe pin hi + _SFR_IO8((strobe_pin >> 4) + 2) |= _BV(strobe_pin & 0xF); + + uint8_t out = data ? (1 << col_index) : 0 ; + return out ; +} + +static +bool matrix_read(uint8_t current_matrix[], uint8_t current_row) { + // Store last value of row prior to reading + uint8_t last_row_value = current_matrix[current_row]; + + // Clear data in matrix row + current_matrix[current_row] = 0; + + select_row(current_row); + + // For each col... + for(uint8_t col_index = 0; col_index < MATRIX_COLS; ++col_index) { + + select_col(col_index) ; + + // strobe the matrix + // Populate the matrix row with the state of the data pin + current_matrix[current_row] |= matrix_strobe(col_index) ; + } + + bool test = last_row_value != current_matrix[current_row] ; + return test ; +} + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +inline +uint8_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_init(void) { + init_led() ; + init_rows() ; + init_cols() ; + init_data() ; + init_strobe() ; + + // initialize matrix state: all keys off + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; +# if (DEBOUNCING_DELAY > 0) + matrix_debounce [i] = 0; +# endif + } + + matrix_init_quantum() ; +} + +uint8_t matrix_scan(void) { + for ( uint8_t current_row = 0; current_row < MATRIX_ROWS; ++current_row ) { +# if (DEBOUNCING_DELAY > 0) + bool matrix_changed = matrix_read(matrix_debounce, current_row); + + if (matrix_changed) { + debouncing = true ; + debouncing_time = timer_read(); + } + +# else + matrix_read(matrix, current_row); +# endif + } + +# if (DEBOUNCING_DELAY > 0) + if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + matrix[i] = matrix_debounce[i]; + } + debouncing = false; + } +# endif + + matrix_scan_quantum(); + return 1; +} + +void matrix_print(void) { + print_matrix_header(); + + for (uint8_t row = 0; row < MATRIX_ROWS; row++) { + phex(row); print(": "); + print_matrix_row(row); + print("\n"); + } +} diff --git a/keyboards/converter/ibm_5291/matrix.csv b/keyboards/converter/ibm_5291/matrix.csv new file mode 100644 index 0000000000..40462c2143 --- /dev/null +++ b/keyboards/converter/ibm_5291/matrix.csv @@ -0,0 +1,96 @@ +0,Z +1,S +2,W +3,3 +4,X +5,D +6,E +7,4 +8,C +9,F +10,R +11,5 +12,V +13,G +14,T +15,6 +16,B +17,H +18,Y +19,7 +20,N +21,J +22,U +23,8 +24,PAD_2 +25,PAD_5 +26,PAD_8 +27,NUM_LOCK +28,M +29,K +30,I +31,9 +32,COMMA +33,L +34,O +35,0 +36,PERIOD +37,SEMICOLON +38,P +39,MINUS +40,SLASH +41,QUOTE +42,LEFT_BRACE +43,EQUAL +44,SPACE +45,RSHIFT +46,BACK_QUOTE +47,RIGHT_BRACE +48,CAPS_LOCK +49,PAD_ASTERIX +50,ENTER +51,BACKSPACE +52,PAD_0 +53,PAD_1 +54,PAD_4 +55,PAD_7 +56,PAD_PLUS +57,UNASSIGNED +58,PAD_MINUS +59,SCROLL_LOCK +60,PAD_PERIOD +61,PAD_3 +62,PAD_6 +63,PAD_9 +64,BACKSLASH +65,A +66,Q +67,2 +68,LALT +69,UNASSIGNED +70,UNASSIGNED +71,1 +72,F7 +73,F5 +74,F3 +75,F1 +76,F8 +77,F6 +78,F4 +79,F2 +80,F10 +81,UNASSIGNED +82,UNASSIGNED +83,UNASSIGNED +84,F9 +85,UNASSIGNED +86,UNASSIGNED +87,UNASSIGNED +88,LSHIFT +89,LCTRL +90,TAB +91,ESC +92,UNASSIGNED +93,UNASSIGNED +94,UNASSIGNED +95,UNASSIGNED diff --git a/keyboards/converter/ibm_5291/readme.md b/keyboards/converter/ibm_5291/readme.md new file mode 100644 index 0000000000..06ae2e994e --- /dev/null +++ b/keyboards/converter/ibm_5291/readme.md @@ -0,0 +1,70 @@ +# IBM 5291 keyboard converter + +![5291](https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard) + +A converter for the eponymous keyboard. + +Keyboard Maintainer: [Listofoptions](https://github.com/listofoptions) +Hardware Supported: IBM 5291, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make converter/ibm_5291: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). + + +the pinout is as follows: + +IBM−5291−Cable to Pinhead−14 + +| pin | description +----|------------------------ +1 | GND +2 | NC +3 | GND +4 | GN) +5 | +5V +6 | D0 +7 | D1 +8 | D2 +9 | D3 +10| D4 +11| D5 +12| D6 +13| Strobe +14| Out + +the pins on this connector are organized ![here](https://geekhack.org/index.php?action=dlattach;topic=48950.0;attach=36759;image) + +IBM−5291−2 Cable with DB15M connector + +| pin | description +----|------------- +|1,2,3 | GND +|4 | +5V +|5 | D0 +|6 | D1 +|7 | D2 +|8 | D3 +|9 | D4 +|10 | D5 +|11 | D6 +|12 | Strobe +|13 | Out +|14 | PE +|15 | NC + +the above connector is actually numbered so it should be easier to determine +where the needed connections are. + +to connect to the teensy, the following are pins are needed (if you should choose not set your own): +* PB0 -> PB6 are connected to D0 -> D6 +* +5V is connected to the corresponding teensy pin +* gnd is as well, only one of the gnd pins needs to be connected though. +* strobe is connected to pin PD1 +* data is connected to PD0 +* PE does not need to be connected to anything, but it could also be connected to gnd + +sources: + http://www.retrocomputing.eu/documents/5291_MaintenanceLibrary.pdf diff --git a/keyboards/converter/ibm_5291/rules.mk b/keyboards/converter/ibm_5291/rules.mk new file mode 100644 index 0000000000..ca0c850c0b --- /dev/null +++ b/keyboards/converter/ibm_5291/rules.mk @@ -0,0 +1,72 @@ +# MCU name +#MCU = at90usb1287 +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 +# 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 = halfkay + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +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. +API_SYSEX_ENABLE = no +SPLIT_KEYBOARD = no +WAIT_FOR_USB = yes + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS_HAS_RGB = NO + +CUSTOM_MATRIX = yes +SRC = matrix.c \ No newline at end of file -- cgit v1.2.3 From fe68599a34af5e4f4f905a4127077fa321dbc0de Mon Sep 17 00:00:00 2001 From: zgtm Date: Mon, 26 Nov 2018 19:01:34 +0100 Subject: Keyboard: add generic ortho 5x15 layout support to Idobo (#4486) --- keyboards/idobo/rules.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/keyboards/idobo/rules.mk b/keyboards/idobo/rules.mk index 383a3594b4..246d152c97 100644 --- a/keyboards/idobo/rules.mk +++ b/keyboards/idobo/rules.mk @@ -79,3 +79,5 @@ 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) + +LAYOUTS = ortho_5x15 -- cgit v1.2.3 From b91dfa04e3bad560fb6fe2360dd51fb95d95fcbf Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 14:35:01 -0800 Subject: Add support for PR and Issue templates to QMK_firmware GitHub (#4491) * Add support document * Add Bug Report * Add GitHub Pull Request Template * Feature request issue template * Touch up feature request template * Add 'other issues' template * move support doc --- .github/ISSUE_TEMPLATE/bug_report.md | 27 +++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 15 +++++++++++ .github/ISSUE_TEMPLATE/other_issues.md | 7 +++++ .github/PULL_REQUEST_TEMPLATE.md | 22 ++++++++++++++++ docs/support.md | 43 +++++++++++++++++++++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/other_issues.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 docs/support.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..ed5d56ce32 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,27 @@ +--- +name: Bug report +about: Create a report to help us improve the QMK Firmware +--- + +**Describe the bug** + +A clear and concise description of what the bug is. + +**System Information** + - Keyboard: + - Revision (if applicable): + - Operating System: + - avr-gcc version: + (Run `avr-gcc --version` to find out) + - arm gcc version: + (Run `arm-none-eabi-gcc --version` to find out) + - QMK Firmware version: + (you can run `git describe --abbrev=0 --tags` to find this out) + - Any keyboard related software installed? + - [ ] Auto Hot Key + - [ ] Karabiner + - [ ] Other + +**Additional context** + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..ac924b3ac7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,15 @@ +--- +name: Feature request +about: Suggest a new feature or changes to existing features + +--- + +## Feature Request Type + +- [ ] Core Functionality +- [ ] Add-on hardware support (eg audio, rgb, oled screen, etc) +- [ ] Alteration (enhancement/optimization) of existing Feature(s) +- [ ] New behavior + +## Description +A few sentances describing what it is that you'd like to see. Additional information (such as links to spec sheets, licensing info, other related issues or PR's, etc) would be helpful. diff --git a/.github/ISSUE_TEMPLATE/other_issues.md b/.github/ISSUE_TEMPLATE/other_issues.md new file mode 100644 index 0000000000..53481f9ab8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other_issues.md @@ -0,0 +1,7 @@ +--- +name: Other issues +about: Anything else that doesn't fall into the above categories. + +--- + +Please check https://docs.qmk.fm/SUPPORT.md for additional resources first. If that doesn't answer your question, check the bug report option, as that may be more appropriate. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..36410da266 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,22 @@ +## Code Change Type +- [ ] Core +- [ ] Feature +- [ ] Bugfix +- [ ] Keyboard +- [ ] Keymap/Layout/Userspace +- [ ] Enhancement/Optimization +- [ ] Documentation + +## Description +A few sentences describing the overall goals of the pull request's commits. + +## Todo +- [ ] Tests +- [ ] Documentation + +## Issues Fixed or Closed by this PR + +* + +## Long Description +If needed, a longer description and a list of changes should be added here to make it clear what exactly this PR's goals are. diff --git a/docs/support.md b/docs/support.md new file mode 100644 index 0000000000..28894c2c31 --- /dev/null +++ b/docs/support.md @@ -0,0 +1,43 @@ +# Support + +If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. + +Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). + +## Help! I don't know where to start! + +If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. + +If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. + +## Help! I'm having issues flashing! + +First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. + +## Help, I have an issue that isn't covered by the links above + +Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). + +If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues)! + +## What if I found a bug? + +Then please open an issue, and if you know how to fix it, open up a Pull Request on GitHub with the fix. + +## But `git` and `GitHub` are intimidating! + +Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. + +Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). + +## I have a Keyboard that I want to add support for + +Awesome! Open up a Pull Request for it. We'll review the code, and merge it! + +### What if I want to do brand it with `QMK`? + +That's amazing! We would love to assist you with that! + +In fact, we have a [whol page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. + +If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From b7b20cd9dfc8928b3c31560a410c75e9a9ec232a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 14:35:48 -0800 Subject: Revert "Add support for PR and Issue templates to QMK_firmware GitHub (#4491)" (#4492) This reverts commit b91dfa04e3bad560fb6fe2360dd51fb95d95fcbf. --- .github/ISSUE_TEMPLATE/bug_report.md | 27 ------------------- .github/ISSUE_TEMPLATE/feature_request.md | 15 ----------- .github/ISSUE_TEMPLATE/other_issues.md | 7 ----- .github/PULL_REQUEST_TEMPLATE.md | 22 ---------------- docs/support.md | 43 ------------------------------- 5 files changed, 114 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/ISSUE_TEMPLATE/other_issues.md delete mode 100644 .github/PULL_REQUEST_TEMPLATE.md delete mode 100644 docs/support.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index ed5d56ce32..0000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve the QMK Firmware ---- - -**Describe the bug** - -A clear and concise description of what the bug is. - -**System Information** - - Keyboard: - - Revision (if applicable): - - Operating System: - - avr-gcc version: - (Run `avr-gcc --version` to find out) - - arm gcc version: - (Run `arm-none-eabi-gcc --version` to find out) - - QMK Firmware version: - (you can run `git describe --abbrev=0 --tags` to find this out) - - Any keyboard related software installed? - - [ ] Auto Hot Key - - [ ] Karabiner - - [ ] Other - -**Additional context** - -Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index ac924b3ac7..0000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: Feature request -about: Suggest a new feature or changes to existing features - ---- - -## Feature Request Type - -- [ ] Core Functionality -- [ ] Add-on hardware support (eg audio, rgb, oled screen, etc) -- [ ] Alteration (enhancement/optimization) of existing Feature(s) -- [ ] New behavior - -## Description -A few sentances describing what it is that you'd like to see. Additional information (such as links to spec sheets, licensing info, other related issues or PR's, etc) would be helpful. diff --git a/.github/ISSUE_TEMPLATE/other_issues.md b/.github/ISSUE_TEMPLATE/other_issues.md deleted file mode 100644 index 53481f9ab8..0000000000 --- a/.github/ISSUE_TEMPLATE/other_issues.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -name: Other issues -about: Anything else that doesn't fall into the above categories. - ---- - -Please check https://docs.qmk.fm/SUPPORT.md for additional resources first. If that doesn't answer your question, check the bug report option, as that may be more appropriate. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md deleted file mode 100644 index 36410da266..0000000000 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ /dev/null @@ -1,22 +0,0 @@ -## Code Change Type -- [ ] Core -- [ ] Feature -- [ ] Bugfix -- [ ] Keyboard -- [ ] Keymap/Layout/Userspace -- [ ] Enhancement/Optimization -- [ ] Documentation - -## Description -A few sentences describing the overall goals of the pull request's commits. - -## Todo -- [ ] Tests -- [ ] Documentation - -## Issues Fixed or Closed by this PR - -* - -## Long Description -If needed, a longer description and a list of changes should be added here to make it clear what exactly this PR's goals are. diff --git a/docs/support.md b/docs/support.md deleted file mode 100644 index 28894c2c31..0000000000 --- a/docs/support.md +++ /dev/null @@ -1,43 +0,0 @@ -# Support - -If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. - -Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). - -## Help! I don't know where to start! - -If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. - -If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. - -## Help! I'm having issues flashing! - -First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. - -## Help, I have an issue that isn't covered by the links above - -Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). - -If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues)! - -## What if I found a bug? - -Then please open an issue, and if you know how to fix it, open up a Pull Request on GitHub with the fix. - -## But `git` and `GitHub` are intimidating! - -Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. - -Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). - -## I have a Keyboard that I want to add support for - -Awesome! Open up a Pull Request for it. We'll review the code, and merge it! - -### What if I want to do brand it with `QMK`? - -That's amazing! We would love to assist you with that! - -In fact, we have a [whol page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. - -If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From edb6c98fd23ab102069037f3dbfbd46c6067e86a Mon Sep 17 00:00:00 2001 From: zvecr Date: Mon, 26 Nov 2018 22:58:22 +0000 Subject: Keyboard: Enable community ortho 4x12 layouts for lets split eh (#4487) * Enable ortho_4x12 community layouts for lets_split_eh * Keymap build fixes now that ortho_4x12 is enabled * Keymap build fixes now that ortho_4x12 is enabled --- keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c | 4 +--- keyboards/lets_split_eh/lets_split_eh.c | 15 +++++++++++++++ keyboards/lets_split_eh/rules.mk | 2 ++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c index 8976081542..721312623e 100644 --- a/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c +++ b/keyboards/lets_split_eh/keymaps/doxish_dvorak/keymap.c @@ -1,6 +1,4 @@ -#include "eeconfig.h" - -extern keymap_config_t keymap_config; +#include QMK_KEYBOARD_H // 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. diff --git a/keyboards/lets_split_eh/lets_split_eh.c b/keyboards/lets_split_eh/lets_split_eh.c index d5a312085d..7249f54cf2 100644 --- a/keyboards/lets_split_eh/lets_split_eh.c +++ b/keyboards/lets_split_eh/lets_split_eh.c @@ -1 +1,16 @@ #include "lets_split_eh.h" + +#ifdef SWAP_HANDS_ENABLE +__attribute__ ((weak)) +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + + {{0, 4}, {1, 4}, {2, 4}, {3, 4}, {4, 4}, {5, 4}}, + {{0, 5}, {1, 5}, {2, 5}, {3, 5}, {4, 5}, {5, 5}}, + {{0, 6}, {1, 6}, {2, 6}, {3, 6}, {4, 6}, {5, 6}}, + {{0, 7}, {1, 7}, {2, 7}, {3, 7}, {4, 7}, {5, 7}}, + {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {4, 0}, {5, 0}}, + {{0, 1}, {1, 1}, {2, 1}, {3, 1}, {4, 1}, {5, 1}}, + {{0, 2}, {1, 2}, {2, 2}, {3, 2}, {4, 2}, {5, 2}}, + {{0, 3}, {1, 3}, {2, 3}, {3, 3}, {4, 3}, {5, 3}}, +}; +#endif diff --git a/keyboards/lets_split_eh/rules.mk b/keyboards/lets_split_eh/rules.mk index dffeb9fa3c..99b1ba2344 100644 --- a/keyboards/lets_split_eh/rules.mk +++ b/keyboards/lets_split_eh/rules.mk @@ -67,4 +67,6 @@ SPLIT_KEYBOARD = yes # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +LAYOUTS = ortho_4x12 + DEFAULT_FOLDER = lets_split_eh/eh -- cgit v1.2.3 From ecd21b44a8efd5c7241ebf48c65fc7b30134865f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 26 Nov 2018 16:45:24 -0800 Subject: Update to drashna userspace and keymaps (#4459) * Fix reversed bool check in layer_state_set * Add Quefrency 65 for a friend * Add Ergodox EZ Glow keymap * Add RGB Matrix Code * Further changes to rgb matrix ErgoDox EZ * Update bjohnson keymaps * Fix CRKBD display * Overhaul to corne keyboard * Narrow scope for keylogger * Minor layout tweaks to Corne Keyboard * additional CRKBD tweaks * Minor tweaks to CRKBD * Add all characters for keylogger * Ergodox EZ Glow overhaul * Fix Ergodox EZ Glow layer colors * Increase Tapping Term for Corne Keyboard * Fix unicode-ish * Revert some changes * Add layer specific lighting effects * Some minor tweaks to ergodox glow config * revert changes to ergodox files * Update Glow readme * Add more tapping term defines * Fix changes * Fix ergodox keymap * Hopefully fix sleeping * Disable layer indications if rgb matrix is disabled * Add support for sleeping and rgb layer change toggle to ergodox ez glow * Make RGB Layer Indication Great Again * Make Unicode Great Again * Remove placeholder define Co-Authored-By: drashna * Remove placeholder define Co-Authored-By: drashna * Remove old EEPROM Reset keycode --- keyboards/crkbd/keymaps/drashna/config.h | 7 +- keyboards/crkbd/keymaps/drashna/keymap.c | 153 ++++++++++++++++------- keyboards/crkbd/keymaps/drashna/rules.mk | 8 +- keyboards/iris/keymaps/drashna/keymap.c | 2 +- keyboards/iris/keymaps/drashna/rules.mk | 2 +- keyboards/orthodox/keymaps/drashna/keymap.c | 2 +- keyboards/quefrency/keymaps/bjohnson/config.h | 41 ++++++ keyboards/quefrency/keymaps/bjohnson/keymap.c | 33 +++++ keyboards/quefrency/keymaps/bjohnson/rules.mk | 22 ++++ keyboards/viterbi/keymaps/drashna/keymap.c | 4 +- layouts/community/ergodox/drashna/keymap.c | 120 ++++++++++++++++-- layouts/community/ergodox/drashna_glow/README.md | 1 + layouts/community/ergodox/drashna_glow/config.h | 11 ++ layouts/community/ergodox/drashna_glow/keymap.c | 67 ++++++++++ layouts/community/ergodox/drashna_glow/rules.mk | 9 ++ layouts/community/ortho_4x12/drashna/keymap.c | 2 +- users/drashna/config.h | 4 +- users/drashna/drashna.c | 22 ++-- users/drashna/drashna.h | 8 +- users/drashna/rgb_stuff.c | 86 +++++++++---- users/drashna/rgb_stuff.h | 2 +- users/drashna/rules.mk | 17 +++ users/drashna/send_unicode.c | 54 ++++++++ users/drashna/template.c | 7 -- users/drashna/template.h | 4 +- 25 files changed, 576 insertions(+), 112 deletions(-) create mode 100644 keyboards/quefrency/keymaps/bjohnson/config.h create mode 100644 keyboards/quefrency/keymaps/bjohnson/keymap.c create mode 100644 keyboards/quefrency/keymaps/bjohnson/rules.mk create mode 100644 layouts/community/ergodox/drashna_glow/README.md create mode 100644 layouts/community/ergodox/drashna_glow/config.h create mode 100644 layouts/community/ergodox/drashna_glow/keymap.c create mode 100644 layouts/community/ergodox/drashna_glow/rules.mk diff --git a/keyboards/crkbd/keymaps/drashna/config.h b/keyboards/crkbd/keymaps/drashna/config.h index adfd79044d..cbc3feeb61 100644 --- a/keyboards/crkbd/keymaps/drashna/config.h +++ b/keyboards/crkbd/keymaps/drashna/config.h @@ -41,5 +41,10 @@ along with this program. If not, see . #define RGBLIGHT_HUE_STEP 8 #define RGBLIGHT_SAT_STEP 8 #define RGBLIGHT_VAL_STEP 8 -#define RGBLIGHT_LIMIT_VAL 120 +#define RGBLIGHT_LIMIT_VAL 100 +#endif + +#ifdef AUDIO_ENABLE +#define B6_AUDIO +// #define NO_MUSIC_MODE #endif diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 99dcdb4e17..282ee25725 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -26,10 +26,10 @@ enum crkbd_keycodes { K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ ) \ LAYOUT_wrapper( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ - KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ + KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ + KC_TAB, ALT_T(K11), K12, K13, K14, K15, K16, K17, K18, K19, K1A, RGUI_T(KC_QUOT), \ OS_LSFT, CTL_T(K21), K22, K23, K24, K25, K26, K27, K28, K29, CTL_T(K2A), OS_RSFT, \ - LT(_LOWER,KC_GRV), KC_SPC, LALT_T(KC_BSPC), KC_DEL, KC_ENT, RAISE \ + LT(_LOWER,KC_GRV), KC_SPC, KC_BSPC, KC_DEL, KC_ENT, RAISE \ ) #define LAYOUT_crkbd_base_wrapper(...) LAYOUT_crkbd_base(__VA_ARGS__) @@ -66,14 +66,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), [_LOWER] = LAYOUT_wrapper( - KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_BSPC, - KC_F11, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, - KC_F12, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + KC_F11, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_F11, + KC_F12, _________________LOWER_L2__________________, _________________LOWER_R2__________________, KC_PIPE, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, _______, _______, _______, _______, _______, _______ ), [_RAISE] = LAYOUT_wrapper( \ - KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_BSPC, + _______, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, _______, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, _______, _______, _______, _______, _______, _______ @@ -81,18 +81,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_wrapper( \ KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EPRM, - TG_MODS, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, - _______, _______, _______, _______, _______, _______ + VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, KC_MPLY, + _______, _______, _______, KC_NUKE, TG_MODS, _______ ) }; -int RGB_current_mode; - void matrix_init_keymap(void) { - #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; - #endif //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED iota_gfx_init(!has_usb()); // turns on the display @@ -102,53 +97,118 @@ void matrix_init_keymap(void) { PORTD &= ~(1<<5); DDRB &= ~(1<<0); - PORTB &= ~(1<<0);} + PORTB &= ~(1<<0); +} //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h #ifdef SSD1306OLED // When add source files to SRC in rules.mk, you can use functions. -const char *read_layer_state(void); const char *read_logo(void); -void set_keylog(uint16_t keycode, keyrecord_t *record); -const char *read_keylog(void); -const char *read_keylogs(void); char layer_state_str[24]; +char modifier_state_str[24]; +char host_led_state_str[24]; +char keylog_str[24] = {}; +char keylogs_str[21] = {}; +int keylogs_str_idx = 0; + // const char *read_mode_icon(bool swap); -const char *read_host_led_state(void); // void set_timelog(void); // const char *read_timelog(void); +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', '_', '-', '=', '[', ']', '\\', + '#', ';', '\'', '`', ',', '.', '/', ' ', ' ', ' '}; + +void set_keylog(uint16_t keycode, keyrecord_t *record) { + char name = ' '; + if (keycode < 60) { + name = code_to_name[keycode]; + } + + // update keylog + snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", + record->event.key.row, record->event.key.col, + keycode, name); + + // update keylogs + if (keylogs_str_idx == sizeof(keylogs_str) - 1) { + keylogs_str_idx = 0; + for (int i = 0; i < sizeof(keylogs_str) - 1; i++) { + keylogs_str[i] = ' '; + } + } + + keylogs_str[keylogs_str_idx] = name; + keylogs_str_idx++; +} + +const char *read_keylog(void) { + return keylog_str; +} + +const char *read_keylogs(void) { + return keylogs_str; +} + + +const char* read_modifier_state(void) { + uint8_t modifiers = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + + snprintf(modifier_state_str, sizeof(modifier_state_str), "Mods:%s %s %s %s", + (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL" : " ", + (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI" : " ", + (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT" : " ", + (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : " " + ); + + return modifier_state_str; +} + +const char *read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + + snprintf(host_led_state_str, sizeof(host_led_state_str), "NL:%s CL:%s SL:%s", + (leds & (1 << USB_LED_NUM_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "on" : "- ", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "on" : "- " + ); + + return host_led_state_str; +} const char* read_layer_state(void) { - switch (layer_state) { - case _QWERTY: - switch (default_layer_state) { + switch (biton32(layer_state)) { + case _RAISE: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise "); + break; + case _LOWER: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower "); + break; + case _ADJUST: + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust "); + break; + default: + switch (biton32(default_layer_state)) { case _QWERTY: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: QWERTY"); + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Qwerty "); break; case _COLEMAK: snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Colemak"); break; case _DVORAK: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak"); + snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Dvorak "); break; case _WORKMAN: snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Workman"); break; } break; - case _RAISE: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Raise"); - break; - case _LOWER: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Lower"); - break; - case _ADJUST: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Adjust"); - break; - default: - snprintf(layer_state_str, sizeof(layer_state_str), "Layer: Undef-%ld", layer_state); } return layer_state_str; @@ -160,12 +220,13 @@ void matrix_scan_keymap(void) { void matrix_render_user(struct CharacterMatrix *matrix) { if (is_master) { - // If you want to change the display of OLED, you need to change here + //If you want to change the display of OLED, you need to change here matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); + matrix_write_ln(matrix, read_modifier_state()); + // matrix_write_ln(matrix, read_keylog()); matrix_write_ln(matrix, read_keylogs()); - //matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - matrix_write_ln(matrix, read_host_led_state()); + // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); + matrix_write(matrix, read_host_led_state()); //matrix_write_ln(matrix, read_timelog()); } else { matrix_write(matrix, read_logo()); @@ -187,8 +248,14 @@ void iota_gfx_task_user(void) { } bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - set_keylog(keycode, record); + switch (keycode) { + case KC_A ... KC_SLASH: + case KC_F1 ... KC_F12: + case KC_INSERT ... KC_UP: + case KC_KP_SLASH ... KC_KP_DOT: + case KC_F13 ... KC_F24: + if (record->event.pressed) { set_keylog(keycode, record); } + break; // set_timelog(); } return true; diff --git a/keyboards/crkbd/keymaps/drashna/rules.mk b/keyboards/crkbd/keymaps/drashna/rules.mk index ccf8e2b7c8..4b70f66f7b 100644 --- a/keyboards/crkbd/keymaps/drashna/rules.mk +++ b/keyboards/crkbd/keymaps/drashna/rules.mk @@ -20,12 +20,14 @@ SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +BOOTLOADER = qmk-dfu + # If you want to change the display of OLED, you need to change here SRC += ./lib/glcdfont.c \ ./lib/rgb_state_reader.c \ ./lib/logo_reader.c \ - ./lib/keylogger.c \ - ./lib/host_led_state_reader.c \ - # ./lib/layer_state_reader.c \ + # ./lib/keylogger.c \ + # ./lib/host_led_state_reader.c \ # ./lib/mode_icon_reader.c \ + # ./lib/layer_state_reader.c \ # ./lib/timelogger.c \ diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index 21e3151c0f..ba6f18edde 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -79,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_wrapper( KC_MAKE, _______, _______, _______, _______, _______, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EPRM, + VRSN, _________________ADJUST_L1_________________, KC_NUKE, _______, _______, _______, _______, EEP_RST, _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG_MODS, _______, _________________ADJUST_L3_________________, TG_GAME, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _______, _______, _______, _______, _______ diff --git a/keyboards/iris/keymaps/drashna/rules.mk b/keyboards/iris/keymaps/drashna/rules.mk index 89e568f399..ccc33c06f3 100644 --- a/keyboards/iris/keymaps/drashna/rules.mk +++ b/keyboards/iris/keymaps/drashna/rules.mk @@ -8,7 +8,7 @@ RGBLIGHT_ENABLE = yes AUDIO_ENABLE = yes NKRO_ENABLE = yes BACKLIGHT_ENABLE = no -SWAP_HANDS_ENABLE = yes +SWAP_HANDS_ENABLE = no INDICATOR_LIGHTS = yes MACROS_ENABLED = no diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 545ad25dcd..346ca4f123 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -91,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_wrapper(\ KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RESET, - VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EPRM, + VRSN, _________________ADJUST_L2_________________, _______, _______, _______, KC_NUKE, _________________ADJUST_R2_________________, EEP_RST, TG_MODS, _________________ADJUST_L3_________________, _______, _______, _______, _______, _______, _______, _________________ADJUST_R3_________________, KC_MPLY ) }; diff --git a/keyboards/quefrency/keymaps/bjohnson/config.h b/keyboards/quefrency/keymaps/bjohnson/config.h new file mode 100644 index 0000000000..37c6d6672d --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/config.h @@ -0,0 +1,41 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert +Copyright 2018 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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +// #define USE_I2C + +#define TAPPING_TERM 500 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define FORCE_NKRO +#define RETRO_TAPPING + +#define TAPPING_TOGGLE 1 + +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + +#define RGBLIGHT_SLEEP diff --git a/keyboards/quefrency/keymaps/bjohnson/keymap.c b/keyboards/quefrency/keymaps/bjohnson/keymap.c new file mode 100644 index 0000000000..434a0a3058 --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/keymap.c @@ -0,0 +1,33 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _FN1 1 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BASE] = LAYOUT_65( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, XXXXXXX, KC_BSPC, KC_HOME, \ + 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_END, \ + 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_DEL, \ + KC_LSFT, 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_INS, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_FN1,KC_SPC),KC_SPC, KC_SPC, XXXXXXX, KC_RALT, KC_RGUI, XXXXXXX, KC_APP, KC_RCTL, TT(_FN1) + ), + + [_FN1] = LAYOUT_65( + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_BSPC, KC_PGUP, \ + _______, _______, KC_UP, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, _______, _______, _______, _______, KC_PGDN, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, \ + _______, RGB_MOD, RGB_HUI, RGB_HUD, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_P0, XXXXXXX, _______, _______, XXXXXXX, _______, _______, _______ + ) +}; diff --git a/keyboards/quefrency/keymaps/bjohnson/rules.mk b/keyboards/quefrency/keymaps/bjohnson/rules.mk new file mode 100644 index 0000000000..70fa711009 --- /dev/null +++ b/keyboards/quefrency/keymaps/bjohnson/rules.mk @@ -0,0 +1,22 @@ +BOOTLOADER = atmel-dfu + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +SPLIT_KEYBOARD = yes diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index acda8a0d25..a343205197 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_MEDIA] = LAYOUT_ortho_5x7( KC_MAKE, KC_RESET,MU_TOG, AU_ON, AU_OFF, CK_TOGG, RGB_SAD, - MEDIA, EPRM, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, + MEDIA, EEP_RST, KC_RGB_T,RGB_M_P, RGB_M_B, RGB_M_R, RGB_SAI, RGB_TOG, RGB_MOD, RGB_RMOD,RGB_M_SW,RGB_M_SN,RGB_M_K, RGB_HUD, KC_MPLY, KC_MPRV, KC_MNXT, RGB_M_X, RGB_M_G, RGB_M_P, RGB_HUI, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, RGB_VAD, RGB_VAI @@ -94,5 +94,3 @@ void matrix_init_keymap(void) { DDRB &= ~(1<<0); PORTB &= ~(1<<0); } - - diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index 360a2d9c6d..df9be62b77 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -20,8 +20,13 @@ along with this program. If not, see . #ifdef UNICODEMAP_ENABLE #include "drashna_unicode.h" #endif // UNICODEMAP_ENABLE +extern uint8_t input_mode; - +#ifdef RGB_MATRIX_ENABLE +extern bool g_suspend_state; +extern rgb_config_t rgb_matrix_config; +#endif +extern userspace_config_t userspace_config; //enum more_custom_keycodes { // KC_P00 = NEW_SAFE_RANGE @@ -40,7 +45,7 @@ bool skip_leds = false; KC_TAB, K01, K02, K03, K04, K05, TG(_DIABLO), TG(_DIABLO), K06, K07, K08, K09, K0A, KC_BSLS, \ KC_C1R3, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_QUOT, \ KC_MLSF, CTL_T(K21), K22, K23, K24, K25, TG(_GAMEPAD), TG(_GAMEPAD), K26, K27, K28, K29, CTL_T(K2A), KC_MRSF, \ - KC_GRV, OSM(MOD_MEH),OSM(MOD_LGUI),KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC_SHRG, \ + KC_GRV, OS_MEH, OS_HYPR, KC_LBRC, KC_RBRC, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, UC(0x2E2E), \ OS_LALT, OS_LGUI, OS_RGUI, CTL_T(KC_ESCAPE), \ KC_HOME, KC_PGUP, \ LT(_LOWER, KC_SPACE),KC_BSPC, KC_END, KC_PGDN, KC_DEL, LT(_RAISE, KC_ENTER) \ @@ -198,7 +203,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_GAMEPAD] = LAYOUT_ergodox_pretty_wrapper( KC_ESC, KC_NO, KC_1, KC_2, KC_3, HYPR(KC_Q), HYPR(KC_GRV), KC_TRNS, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, - KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_F1, KC_K, KC_Q, KC_W, KC_E, KC_R, KC_T, UC_SHRG, UC_DISA, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TAB, KC_G, KC_A, KC_S, KC_D, KC_F, KC_I, KC_O, KC_NO, KC_NO, KC_NO, KC_NO, KC_LCTL, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_TRNS, TG(_GAMEPAD), KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_GRV, KC_U, KC_I, KC_Y, KC_T, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_NO, @@ -263,7 +268,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( KC_MAKE, _______, _______, _______, _______, _______, _______, KC_NUKE, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EPRM, + VRSN, _________________ADJUST_L1_________________, _______, _______, _______, _______, _______, _______, _______, EEP_RST, _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, TG(_MODS), _______, _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, KC_MPLY, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, @@ -290,10 +295,6 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } -void matrix_init_keymap(void) { // Runs boot tasks for keyboard -}; - - void matrix_scan_keymap(void) { // runs frequently to update info uint8_t modifiers = get_mods(); uint8_t led_usb_state = host_keyboard_leds(); @@ -335,3 +336,106 @@ bool indicator_is_this_led_used_keyboard(uint8_t index) { return false; } } + + +#ifdef RGB_MATRIX_ENABLE + +void suspend_power_down_keymap(void) { + rgb_matrix_set_suspend_state(true); + rgb_matrix_config.enable = false; +} + +void suspend_wakeup_init_keymap(void) { + rgb_matrix_config.enable = true; + rgb_matrix_set_suspend_state(false); +} + +void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue) { + rgb_led led; + for (int i = 0; i < DRIVER_LED_TOTAL; i++) { + led = g_rgb_leds[i]; + if (led.matrix_co.raw < 0xFF) { + if (led.modifier) { + rgb_matrix_set_color( i, red, green, blue ); + } + } + } +} + +void rgb_matrix_indicators_user(void) { + if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) return; + + switch (biton32(layer_state)) { + case _MODS: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; + case _GAMEPAD: + rgb_matrix_layer_helper(0xFF, 0x80, 0x00); + rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q + rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W + rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E + rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R + rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A + rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S + rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D + rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F + + rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 + rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 + rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 + + break; + case _DIABLO: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; + case _RAISE: + rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; + case _LOWER: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; + case _ADJUST: + rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; + default: + switch (biton32(default_layer_state)) { + case _QWERTY: + rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; + case _COLEMAK: + rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; + case _DVORAK: + rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; + case _WORKMAN: + rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; + } + } +#if 0 + if (this_mod & MODS_SHIFT_MASK || this_led & (1<event.pressed) { - eeconfig_init(); - } - break; case VRSN: // Prints firmware version if (record->event.pressed) { send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); @@ -392,7 +390,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { #endif } return process_record_keymap(keycode, record) && -#ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) process_record_user_rgb(keycode, record) && #endif // RGBLIGHT_ENABLE process_record_secrets(keycode, record); @@ -413,7 +411,11 @@ uint32_t layer_state_set_user(uint32_t state) { uint32_t default_layer_state_set_user(uint32_t state) { - return default_layer_state_set_keymap(state); + state = default_layer_state_set_keymap(state); +#ifdef RGBLIGHT_ENABLE + state = default_layer_state_set_rgb(state); +#endif // RGBLIGHT_ENABLE + return state; } diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 573cb26fd0..06e726714c 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -73,6 +73,8 @@ typedef union { }; } userspace_config_t; +extern userspace_config_t userspace_config; + #if defined(KEYMAP_SAFE_RANGE) #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE #else @@ -80,8 +82,7 @@ typedef union { #endif enum userspace_custom_keycodes { - EPRM = PLACEHOLDER_SAFE_RANGE, // Resets EEPROM do defaults (as in eeconfig_init) - VRSN, // Prints QMK Firmware and board info + VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info KC_QWERTY, // Sets default layer to QWERTY KC_COLEMAK, // Sets default layer to COLEMAK KC_DVORAK, // Sets default layer to DVORAK @@ -159,6 +160,9 @@ enum userspace_custom_keycodes { #define OS_RCTL OSM(MOD_RCTL) #define OS_LALT OSM(MOD_LALT) #define OS_RALT OSM(MOD_RALT) +#define OS_MEH OSM(MOD_MEH) +#define OS_HYPR OSM(MOD_HYPR) + #define ALT_APP ALT_T(KC_APP) #define MG_NKRO MAGIC_TOGGLE_NKRO diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index b6de4d39e5..d238c20651 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -2,8 +2,11 @@ #include "rgb_stuff.h" #include "eeprom.h" +#if defined(RGBLIGHT_ENABLE) extern rgblight_config_t rgblight_config; -extern userspace_config_t userspace_config; +#elif defined(RGB_MATRIX_ENABLE) +extern rgb_config_t rgb_matrix_config; +#endif #ifdef RGBLIGHT_ENABLE void rgblight_sethsv_default_helper(uint8_t index) { @@ -209,7 +212,7 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { return true; break; #endif // RGBLIGHT_TWINKLE case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal -#ifdef RGBLIGHT_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) if (record->event.pressed) { userspace_config.rgb_layer_change ^= 1; xprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); @@ -237,24 +240,25 @@ bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { -void matrix_init_rgb(void) { + void matrix_init_rgb(void) { - if (userspace_config.rgb_layer_change) { - rgblight_init(); - rgblight_enable_noeeprom(); - switch (biton32(eeconfig_read_default_layer())) { - case _COLEMAK: - rgblight_sethsv_noeeprom_magenta(); break; - case _DVORAK: - rgblight_sethsv_noeeprom_springgreen(); break; - case _WORKMAN: - rgblight_sethsv_noeeprom_goldenrod(); break; - default: - rgblight_sethsv_noeeprom_cyan(); break; - } - rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); - } -} +// #ifdef RGBLIGHT_ENABLE +// if (userspace_config.rgb_layer_change) { +// rgblight_enable_noeeprom(); +// switch (biton32(eeconfig_read_default_layer())) { +// case _COLEMAK: +// rgblight_sethsv_noeeprom_magenta(); break; +// case _DVORAK: +// rgblight_sethsv_noeeprom_springgreen(); break; +// case _WORKMAN: +// rgblight_sethsv_noeeprom_goldenrod(); break; +// default: +// rgblight_sethsv_noeeprom_cyan(); break; +// } +// rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); +// } +// #endif + } void matrix_scan_rgb(void) { #ifdef RGBLIGHT_TWINKLE @@ -270,7 +274,6 @@ void matrix_scan_rgb(void) { uint32_t layer_state_set_rgb(uint32_t state) { #ifdef RGBLIGHT_ENABLE - static bool has_ran; if (userspace_config.rgb_layer_change) { switch (biton32(state)) { case _MACROS: @@ -312,12 +315,7 @@ uint32_t layer_state_set_rgb(uint32_t state) { default: rgblight_sethsv_noeeprom_cyan(); break; } - if (has_ran) { - biton32(state) == _MODS ? rgblight_mode(RGBLIGHT_MODE_BREATHING) : rgblight_mode(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it - } else { - biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it - has_ran = true; - } + biton32(state) == _MODS ? rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING) : rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); // if _MODS layer is on, then breath to denote it break; } // layer_state_set_indicator(); // Runs every scan, so need to call this here .... since I can't get it working "right" anyhow @@ -326,3 +324,39 @@ uint32_t layer_state_set_rgb(uint32_t state) { return state; } + +uint32_t default_layer_state_set_rgb(uint32_t state) { +#ifdef RGBLIGHT_ENABLE + if (userspace_config.rgb_layer_change) { + rgblight_config_t temp_rgblight_config = rgblight_config; + switch (biton32(state)) { + case _COLEMAK: + temp_rgblight_config.hue = 300; + temp_rgblight_config.val = 255; + temp_rgblight_config.sat = 255; + temp_rgblight_config.mode = 1; + break; + case _DVORAK: + temp_rgblight_config.hue = 150; + temp_rgblight_config.val = 255; + temp_rgblight_config.sat = 255; + temp_rgblight_config.mode = 1; + case _WORKMAN: + temp_rgblight_config.hue = 43; + temp_rgblight_config.val = 218; + temp_rgblight_config.sat = 218; + temp_rgblight_config.mode = 1; + default: + temp_rgblight_config.hue = 180; + temp_rgblight_config.val = 255; + temp_rgblight_config.sat = 255; + temp_rgblight_config.mode = 1; + } + if (temp_rgblight_config.raw != eeconfig_read_rgblight()) { + xprintf("rgblight set default layer hsv [EEPROM]: %u,%u,%u,%u\n", temp_rgblight_config.hue, temp_rgblight_config.sat, temp_rgblight_config.val, temp_rgblight_config.mode); + eeconfig_update_rgblight(temp_rgblight_config.raw); + } + } +#endif // RGBLIGHT_ENABLE + return state; +} diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 50c75c8c3c..3db068a31d 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -12,4 +12,4 @@ void scan_rgblight_fadeout(void); void matrix_init_rgb(void); void matrix_scan_rgb(void); uint32_t layer_state_set_rgb(uint32_t state); - +uint32_t default_layer_state_set_rgb(uint32_t state); diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 964c96c522..49b1ddae97 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -27,6 +27,11 @@ ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) endif endif +ifeq ($(strip $(RGB_MATRIX_ENABLE)), yes) + SRC += rgb_stuff.c +endif + + ifeq ($(strip $(MACROS_ENABLED)), yes) OPT_DEFS += -DMACROS_ENABLED endif @@ -37,3 +42,15 @@ ifdef CONSOLE_ENABLE endif endif + +ifeq ($(strip $(UCIS_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODE_ENABLE)), yes) + SRC += send_unicode.c +endif diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c index cacfe1dc85..ff35368da7 100644 --- a/users/drashna/send_unicode.c +++ b/users/drashna/send_unicode.c @@ -56,3 +56,57 @@ void send_unicode_hex_string(const char* str) { // If you need a good converter: https://r12a.github.io/app-conversion/ +uint8_t saved_mods; + +void unicode_input_start (void) { + // save current mods + saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + + switch(get_unicode_input_mode()) { + case UC_OSX: + register_code(KC_LALT); + break; + case UC_OSX_RALT: + register_code(KC_RALT); + break; + case UC_LNX: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + break; + case UC_WIN: + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + break; + case UC_WINC: + register_code(KC_RALT); + unregister_code(KC_RALT); + register_code(KC_U); + unregister_code(KC_U); + break; + } + wait_ms(UNICODE_TYPE_DELAY); +} + +void unicode_input_finish (void) { + switch(get_unicode_input_mode()) { + case UC_OSX: + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_OSX_RALT: + unregister_code(KC_RALT); + break; + case UC_LNX: + register_code(KC_SPC); + unregister_code(KC_SPC); + break; + } + + set_mods(saved_mods); // Reregister previously set mods +} diff --git a/users/drashna/template.c b/users/drashna/template.c index e6b50c961b..0e188f3a5e 100644 --- a/users/drashna/template.c +++ b/users/drashna/template.c @@ -50,12 +50,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return false; break; - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; case VRSN: if (record->event.pressed) { SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); @@ -128,4 +122,3 @@ void shutdown_keymap(void) {} void shutdown_user (void) { shutdown_keymap(); } - diff --git a/users/drashna/template.h b/users/drashna/template.h index 5b3a93de5f..dd1c487604 100644 --- a/users/drashna/template.h +++ b/users/drashna/template.h @@ -9,9 +9,7 @@ #define BASE 0 enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, - VRSN, + VRSN = SAFE_RANGE, // can always be here KC_MAKE, KC_RESET, NEWPLACEHOLDER //use "NEWPLACEHOLDER for keymap specific codes -- cgit v1.2.3 From bada74e2a10224849719d1caa1dff8493cf39c58 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Mon, 26 Nov 2018 17:39:29 -0800 Subject: Keymap: Fix build errors for non-Zeal boards. (#4496) --- users/talljoe/talljoe.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c index e72dc6c3e0..345b5604bb 100644 --- a/users/talljoe/talljoe.c +++ b/users/talljoe/talljoe.c @@ -108,7 +108,9 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { extern backlight_config g_config; #endif bool process_record_user(uint16_t keycode, keyrecord_t *record) { +#ifdef ZEAL_RGB static uint8_t last_effect; +#endif #ifdef RGBLIGHT_ENABLE static uint32_t savedRgbMode; -- cgit v1.2.3 From 952a30ef345e05051f62fa39960f88475817821d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 26 Nov 2018 20:57:15 -0800 Subject: handwired/arrow_pad Refactor and Configurator support (#4498) * handwired/arrow_pad: layout macro and keymap refactor - Layout macros moved from the keymaps to arrow_pad.h. - LAYOUT_pad21 refactored to only accept keys that are physical present (no KC_NO entries required in keymap) - Keymaps now use #include QMK_KEYBOARD_H - Keymaps refactored to use process_record_user function (from action_get_macro) * handwired/arrow_pad: Readme cleanup Fixed the make commands and updated the layout macro. * handwired/arrow_pad: Configurator support --- keyboards/handwired/arrow_pad/arrow_pad.h | 30 ++++ keyboards/handwired/arrow_pad/info.json | 62 ++++++++ .../handwired/arrow_pad/keymaps/default/keymap.c | 146 +++++++----------- .../handwired/arrow_pad/keymaps/pad_21/keymap.c | 165 ++++++++------------- .../handwired/arrow_pad/keymaps/pad_24/keymap.c | 146 +++++++----------- keyboards/handwired/arrow_pad/readme.md | 12 +- 6 files changed, 265 insertions(+), 296 deletions(-) create mode 100644 keyboards/handwired/arrow_pad/info.json diff --git a/keyboards/handwired/arrow_pad/arrow_pad.h b/keyboards/handwired/arrow_pad/arrow_pad.h index 62882b9b54..b93fd113f2 100644 --- a/keyboards/handwired/arrow_pad/arrow_pad.h +++ b/keyboards/handwired/arrow_pad/arrow_pad.h @@ -10,4 +10,34 @@ #include #include +// This is the 21-key keypad to 4x6 element matrix mapping +#define LAYOUT( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, KM_EQU, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, ___ENT, \ + KM___0, _____0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ + { KM___7, KM___8, KM___9, KM_EQU }, \ + { KM___4, KM___5, KM___6, KM_PLS }, \ + { KM___1, KM___2, KM___3, KC_NO }, \ + { KM___0, KC_NO, KM_DOT, KM_ENT } \ +} + +// This is the 21-key keypad to 2x11 element matrix mapping +#define LAYOUT_pad21( \ + KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ + KM_NUM, KM_FSL, KM_AST, KM_MIN, \ + KM___7, KM___8, KM___9, \ + KM___4, KM___5, KM___6, KM_PLS, \ + KM___1, KM___2, KM___3, \ + KM___0, KM_DOT, KM_ENT \ +) { \ + { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ + { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ +} + #endif diff --git a/keyboards/handwired/arrow_pad/info.json b/keyboards/handwired/arrow_pad/info.json new file mode 100644 index 0000000000..ad15e8e740 --- /dev/null +++ b/keyboards/handwired/arrow_pad/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "arrow_pad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"KM_ESC", "x":0, "y":0}, + {"label":"KM_TAB", "x":1, "y":0}, + {"label":"KM_BSL", "x":2, "y":0}, + {"label":"KM_ARR", "x":3, "y":0}, + {"label":"KM_NUM", "x":0, "y":1}, + {"label":"KM_FSL", "x":1, "y":1}, + {"label":"KM_AST", "x":2, "y":1}, + {"label":"KM_MIN", "x":3, "y":1}, + {"label":"KM___7", "x":0, "y":2}, + {"label":"KM___8", "x":1, "y":2}, + {"label":"KM___9", "x":2, "y":2}, + {"label":"KM_EQU", "x":3, "y":2}, + {"label":"KM___4", "x":0, "y":3}, + {"label":"KM___5", "x":1, "y":3}, + {"label":"KM___6", "x":2, "y":3}, + {"label":"KM_PLS", "x":3, "y":3}, + {"label":"KM___1", "x":0, "y":4}, + {"label":"KM___2", "x":1, "y":4}, + {"label":"KM___3", "x":2, "y":4}, + {"label":"___ENT", "x":3, "y":4}, + {"label":"KM___0", "x":0, "y":5}, + {"label":"_____0", "x":1, "y":5}, + {"label":"KM_DOT", "x":2, "y":5}, + {"label":"KM_ENT", "x":3, "y":5} + ] + }, + "LAYOUT_pad21": { + "layout": [ + {"label":"KM_ESC", "x":0, "y":0}, + {"label":"KM_TAB", "x":1, "y":0}, + {"label":"KM_BSL", "x":2, "y":0}, + {"label":"KM_ARR", "x":3, "y":0}, + {"label":"KM_NUM", "x":0, "y":1}, + {"label":"KM_FSL", "x":1, "y":1}, + {"label":"KM_AST", "x":2, "y":1}, + {"label":"KM_MIN", "x":3, "y":1}, + {"label":"KM___7", "x":0, "y":2}, + {"label":"KM___8", "x":1, "y":2}, + {"label":"KM___9", "x":2, "y":2}, + {"label":"KM___4", "x":0, "y":3}, + {"label":"KM___5", "x":1, "y":3}, + {"label":"KM___6", "x":2, "y":3}, + {"label":"KM_PLS", "x":3, "y":2, "h":2}, + {"label":"KM___1", "x":0, "y":4}, + {"label":"KM___2", "x":1, "y":4}, + {"label":"KM___3", "x":2, "y":4}, + {"label":"KM___0", "x":0, "y":5, "w":2}, + {"label":"KM_DOT", "x":2, "y":5}, + {"label":"KM_ENT", "x":3, "y":4, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c index b5d3047081..dd729c59a1 100644 --- a/keyboards/handwired/arrow_pad/keymaps/default/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/default/keymap.c @@ -1,35 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, KM_EQU, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ - { KM___7, KM___8, KM___9, KM_EQU }, \ - { KM___4, KM___5, KM___6, KM_PLS }, \ - { KM___1, KM___2, KM___3, KC_NO }, \ - { KM___0, KC_NO, KM_DOT, KM_ENT } \ -} - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -42,13 +25,10 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PEQL, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ @@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_EDIT] = LAYOUT( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ), [LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, XXXXXXX, \ @@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), - -}; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c index a29f9e1011..1692976357 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/pad_21/keymap.c @@ -1,32 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, ___PLS, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ -} - - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -39,100 +25,75 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ +[LAYER_BASE] = LAYOUT_pad21( \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ - KC_P7, KC_P8, KC_P9, XXXXXXX, \ + KC_P7, KC_P8, KC_P9, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ - KC_P1, KC_P2, KC_P3, XXXXXXX, \ - KC_P0, XXXXXXX, KC_PDOT, KC_PENT ), + KC_P1, KC_P2, KC_P3, \ + KC_P0, KC_PDOT, KC_PENT ), -[LAYER_EDIT] = LAYOUT( \ +[LAYER_EDIT] = LAYOUT_pad21( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ - KC_HOME, KC_UP, KC_PGUP, XXXXXXX, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ + KC_HOME, KC_UP, KC_PGUP, \ KC_LEFT, M_COPY, KC_RGHT, M_CTALT, \ - KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, XXXXXXX, KC_DEL, M_SHFCT), + KC_END, KC_DOWN, KC_PGDN, \ + KC_BSPC, KC_DEL, M_SHFCT), -[LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ - _______, _______, _______, XXXXXXX, \ +[LAYER_FUNCTION] = LAYOUT_pad21( \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ + _______, _______, _______, \ _______, _______, _______, _______, \ - _______, _______, _______, XXXXXXX, \ - RESET, XXXXXXX, _______, _______ ), - -}; - - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), + _______, _______, _______, \ + RESET, _______, _______ ), }; -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c index b5d3047081..dd729c59a1 100644 --- a/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c +++ b/keyboards/handwired/arrow_pad/keymaps/pad_24/keymap.c @@ -1,35 +1,18 @@ -#include "arrow_pad.h" +#include QMK_KEYBOARD_H #include "led.h" -// This is the 21-key keypad to 2x11 element matrix mapping -#define LAYOUT( \ - KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ - KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, KM_EQU, \ - KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ -) { \ - { KM_ESC, KM_TAB, KM_BSL, KM_ARR }, \ - { KM_NUM, KM_FSL, KM_AST, KM_MIN }, \ - { KM___7, KM___8, KM___9, KM_EQU }, \ - { KM___4, KM___5, KM___6, KM_PLS }, \ - { KM___1, KM___2, KM___3, KC_NO }, \ - { KM___0, KC_NO, KM_DOT, KM_ENT } \ -} - -#define LAYER_BASE 0 -#define LAYER_EDIT 1 -#define LAYER_FUNCTION 2 - -#define MACRO_COPY_CUT 0 -#define MACRO_SHIFT_CONTROL 1 -#define MACRO_CONTROL_ALT 2 +enum layers { + LAYER_BASE, + LAYER_EDIT, + LAYER_FUNCTION +}; -#define M_COPY KC_FN5 -#define M_SHFCT KC_FN6 -#define M_CTALT KC_FN7 +enum custom_keycodes { + M_COPY = SAFE_RANGE, // KC_FN5: MACRO_COPY_CUT + M_SHFCT, // KC_FN6: MACRO_SHIFT_CONTROL + M_CTALT // KC_FN7: MACRO_CONTROL_ALT +}; #define SC_UNDO LCTL(KC_Z) #define SC_REDO LCTL(KC_Y) @@ -42,13 +25,10 @@ #define SC_ACLS LALT(KC_F4) #define SC_CCLS LCTL(KC_F4) -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_BASE] = LAYOUT( \ - KC_ESC, KC_TAB, KC_BSLS, KC_FN0, \ + KC_ESC, KC_TAB, KC_BSLS, MO(2), \ KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ KC_P7, KC_P8, KC_P9, KC_PEQL, \ KC_P4, KC_P5, KC_P6, KC_PPLS, \ @@ -57,15 +37,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_EDIT] = LAYOUT( \ KC_ESC, KC_TAB, KC_SPC, _______, \ - KC_FN1, SC_PSTE, SC_REDO, SC_UNDO, \ + TG(1), SC_PSTE, SC_REDO, SC_UNDO, \ KC_HOME, KC_UP, KC_PGUP, KC_LALT, \ KC_LEFT, M_COPY, KC_RGHT, KC_LCTL, \ KC_END, KC_DOWN, KC_PGDN, XXXXXXX, \ - KC_BSPC, KC_PENT, KC_DEL, M_SHFCT), + KC_BSPC, KC_PENT, KC_DEL, M_SHFCT ), [LAYER_FUNCTION] = LAYOUT( \ - KC_FN2, KC_FN3, KC_FN4, _______, \ - KC_FN1, _______, _______, _______, \ + BL_TOGG, BL_INC, BL_DEC, _______, \ + TG(1), _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, _______, \ _______, _______, _______, XXXXXXX, \ @@ -74,68 +54,46 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(LAYER_FUNCTION), - [1] = ACTION_LAYER_TOGGLE(LAYER_EDIT), - [2] = ACTION_BACKLIGHT_TOGGLE(), - [3] = ACTION_BACKLIGHT_INCREASE(), - [4] = ACTION_BACKLIGHT_DECREASE(), - [5] = ACTION_MACRO_TAP(MACRO_COPY_CUT), - [6] = ACTION_MACRO_TAP(MACRO_SHIFT_CONTROL), - [7] = ACTION_MACRO_TAP(MACRO_CONTROL_ALT), - -}; - - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ -} +bool process_record_user(uint16_t keycode, keyrecord_t * record) { + // MACRODOWN only works in this function + switch (keycode) { + + case M_COPY: + if (record->event.pressed) { + register_code(KC_LCTL); + if (record->tap.count == 1) { + register_code(KC_C); + unregister_code(KC_C); + } else if (record->tap.count == 2) { + register_code(KC_X); + unregister_code(KC_X); + } + unregister_code(KC_LCTL); + } + break; + case M_SHFCT: + if (record->event.pressed) { + if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); + if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count == 3) register_code(KC_PENT);; + } else { + unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); + unregister_code(KC_PENT); + } + break; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) { - - case MACRO_COPY_CUT: - if (record->event.pressed) { - register_code(KC_LCTL); - if (record->tap.count == 1) { - register_code(KC_C); - unregister_code(KC_C); - } - else if (record->tap.count == 2) { - register_code(KC_X); - unregister_code(KC_X); - } - unregister_code(KC_LCTL); - } - break; - - case MACRO_SHIFT_CONTROL: - if (record->event.pressed) { - if (record->tap.count <= 2) register_mods(MOD_BIT(KC_LSFT)); - if (record->tap.count == 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count == 3) register_code(KC_PENT);; - } - else { - unregister_mods(MOD_BIT(KC_LSFT) | MOD_BIT(KC_LCTL)); - unregister_code(KC_PENT); - } - break; - - case MACRO_CONTROL_ALT: - if (record->event.pressed) { - if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); - if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); - } - else { - unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); - } - break; + case M_CTALT: + if (record->event.pressed) { + if (record->tap.count < 2) register_mods(MOD_BIT(KC_LCTL)); + if (record->tap.count >= 2) register_mods(MOD_BIT(KC_LALT)); + } else { + unregister_mods(MOD_BIT(KC_LCTL) | MOD_BIT(KC_LALT)); } + break; + } - return MACRO_NONE; + return true; } void led_set_user(uint8_t usb_led) diff --git a/keyboards/handwired/arrow_pad/readme.md b/keyboards/handwired/arrow_pad/readme.md index d0d172272e..43a0e33c40 100644 --- a/keyboards/handwired/arrow_pad/readme.md +++ b/keyboards/handwired/arrow_pad/readme.md @@ -94,13 +94,13 @@ More info can be found on [GeekHack](https://geekhack.org/index.php?topic=73632. The second ArrowPad was a conversion from a 21-key Genovation keypad. It used a 2 row x 11 column matrix. ``` -#define KEYMAP( \ +#define LAYOUT_pad21( \ KM_ESC, KM_TAB, KM_BSL, KM_ARR, \ KM_NUM, KM_FSL, KM_AST, KM_MIN, \ - KM___7, KM___8, KM___9, ___PLS, \ + KM___7, KM___8, KM___9, \ KM___4, KM___5, KM___6, KM_PLS, \ - KM___1, KM___2, KM___3, ___ENT, \ - KM___0, _____0, KM_DOT, KM_ENT \ + KM___1, KM___2, KM___3, \ + KM___0, KM_DOT, KM_ENT \ ) { \ { KM_ESC, KM_TAB, KM_BSL, KM_ARR, KM___7, KM___8, KM___9, KM_PLS, KM___1, KM___2, KM___3, }, \ { KM_NUM, KM_FSL, KM_AST, KM_MIN, KM___4, KM___5, KM___6, KM_ENT, KC_NO, KM___0, KM_DOT, }, \ @@ -119,7 +119,7 @@ Download or clone the whole firmware and navigate to the keyboards/arrow_pad fol Depending on which keymap you would like to use, you will have to compile slightly differently. ### Default -To build with the default keymap, simply run `make default`. +To build with the default keymap, simply run `make handwired/arrow_pad:default`. ### Other Keymaps Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. @@ -127,7 +127,7 @@ Several version of keymap are available in advance but you are recommended to de To build the firmware binary hex file with a keymap just do `make` with a keymap like this: ``` -$ make [default|pad_21|pad_24|] +$ make handwired/arrow_pad:[default|pad_21|pad_24|] ``` Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. -- cgit v1.2.3 From a054b5a06c00cf148fa416fae8f5a56586a10876 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Wed, 28 Nov 2018 00:22:47 +0900 Subject: Fix Helix ws2812.c listed more than once warning. (#4499) Remove `SRC += ws2812.c` from helix/rev2/rules.mk and helix/pico/rules.mk. Because it will be added in common_features.mk. --- keyboards/helix/pico/rules.mk | 5 ++--- keyboards/helix/rev2/rules.mk | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/keyboards/helix/pico/rules.mk b/keyboards/helix/pico/rules.mk index c994ac8dea..75bf0a5ef8 100644 --- a/keyboards/helix/pico/rules.mk +++ b/keyboards/helix/pico/rules.mk @@ -1,3 +1,2 @@ -SRC += pico/matrix.c \ - pico/split_util.c \ - ws2812.c +SRC += pico/matrix.c +SRC += pico/split_util.c diff --git a/keyboards/helix/rev2/rules.mk b/keyboards/helix/rev2/rules.mk index 4ea623c436..5582a0f9c4 100644 --- a/keyboards/helix/rev2/rules.mk +++ b/keyboards/helix/rev2/rules.mk @@ -1,4 +1,3 @@ SRC += rev2/matrix.c SRC += rev2/split_util.c SRC += rev2/split_scomm.c -SRC += ws2812.c -- cgit v1.2.3 From faef966a4d66b802babf9332cbf3045edf47c729 Mon Sep 17 00:00:00 2001 From: Mattia Dal Ben Date: Tue, 27 Nov 2018 17:59:53 +0100 Subject: Keymap: Set serial connection as default for the Redox rev1.0 keyboard (#4488) * Set serial as default for Redox * Updated rules.mk file * Removed unused rule Co-Authored-By: mattdibi * Removed unused rule Co-Authored-By: mattdibi --- keyboards/redox/keymaps/default/config.h | 6 ++---- keyboards/redox/keymaps/finex/config.h | 2 -- keyboards/redox/keymaps/german/config.h | 8 +++----- keyboards/redox/keymaps/italian/config.h | 6 ++---- keyboards/redox/keymaps/jeherve/config.h | 4 +--- keyboards/redox/rules.mk | 4 +--- 6 files changed, 9 insertions(+), 21 deletions(-) diff --git a/keyboards/redox/keymaps/default/config.h b/keyboards/redox/keymaps/default/config.h index 0670bf294f..a3ef209a05 100644 --- a/keyboards/redox/keymaps/default/config.h +++ b/keyboards/redox/keymaps/default/config.h @@ -18,12 +18,10 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/finex/config.h b/keyboards/redox/keymaps/finex/config.h index 9adbcedf49..b23342ce0f 100644 --- a/keyboards/redox/keymaps/finex/config.h +++ b/keyboards/redox/keymaps/finex/config.h @@ -18,12 +18,10 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - #define USE_SERIAL // #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/german/config.h b/keyboards/redox/keymaps/german/config.h index 0eb19ab1ef..a3ef209a05 100644 --- a/keyboards/redox/keymaps/german/config.h +++ b/keyboards/redox/keymaps/german/config.h @@ -18,14 +18,12 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - -// #define MASTER_LEFT #define MASTER_LEFT +// #define MASTER_RIGHT // #define EE_HANDS #undef RGBLED_NUM diff --git a/keyboards/redox/keymaps/italian/config.h b/keyboards/redox/keymaps/italian/config.h index 0670bf294f..a3ef209a05 100644 --- a/keyboards/redox/keymaps/italian/config.h +++ b/keyboards/redox/keymaps/italian/config.h @@ -18,12 +18,10 @@ along with this program. If not, see . #pragma once /* Use I2C or Serial, not both */ - -// #define USE_SERIAL -#define USE_I2C +#define USE_SERIAL +// #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/keymaps/jeherve/config.h b/keyboards/redox/keymaps/jeherve/config.h index 939d0c8d83..b9b67c999f 100644 --- a/keyboards/redox/keymaps/jeherve/config.h +++ b/keyboards/redox/keymaps/jeherve/config.h @@ -17,16 +17,14 @@ along with this program. If not, see . #pragma once -/* Use I2C or Serial, not both */ - /* Change the default tapping toggle value (normally 5) */ #define TAPPING_TOGGLE 2 +/* Use I2C or Serial, not both */ #define USE_SERIAL //#define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS diff --git a/keyboards/redox/rules.mk b/keyboards/redox/rules.mk index 748d89dcfb..c0edb5428b 100644 --- a/keyboards/redox/rules.mk +++ b/keyboards/redox/rules.mk @@ -66,9 +66,7 @@ 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 -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SPLIT_KEYBOARD = yes -- cgit v1.2.3 From 77ed9e3a7305b1921d079e2facfb8e6d3d137e19 Mon Sep 17 00:00:00 2001 From: abishalom Date: Tue, 27 Nov 2018 12:22:49 -0500 Subject: Keymap: Added abishalom keymaps (#4495) * Added abishalom keymaps Added personal keymaps for Massdrop Alt and Tada68 * Update keyboards/tada68/keymaps/abishalom/rules.mk Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/rules.mk Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/config.h Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/keymap.c Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/keymap.c Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/rules.mk Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/keymap.c Co-Authored-By: abishalom * Update keyboards/tada68/keymaps/abishalom/keymap.c Co-Authored-By: abishalom * Updated keymaps * Bugfix Tada68 * Update keyboards/tada68/keymaps/abishalom/keymap.c Co-Authored-By: abishalom --- keyboards/massdrop/alt/keymaps/abishalom/keymap.c | 189 ++++++++++++++++++++++ keyboards/tada68/keymaps/abishalom/config.h | 3 + keyboards/tada68/keymaps/abishalom/keymap.c | 96 +++++++++++ keyboards/tada68/keymaps/abishalom/readme.md | 6 + keyboards/tada68/keymaps/abishalom/rules.mk | 18 +++ 5 files changed, 312 insertions(+) create mode 100644 keyboards/massdrop/alt/keymaps/abishalom/keymap.c create mode 100644 keyboards/tada68/keymaps/abishalom/config.h create mode 100644 keyboards/tada68/keymaps/abishalom/keymap.c create mode 100644 keyboards/tada68/keymaps/abishalom/readme.md create mode 100644 keyboards/tada68/keymaps/abishalom/rules.mk diff --git a/keyboards/massdrop/alt/keymaps/abishalom/keymap.c b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c new file mode 100644 index 0000000000..7ffa53dcaa --- /dev/null +++ b/keyboards/massdrop/alt/keymaps/abishalom/keymap.c @@ -0,0 +1,189 @@ +#include QMK_KEYBOARD_H + +enum alt_keycodes { + L_BRI = SAFE_RANGE, //LED Brightness Increase + L_BRD, //LED Brightness Decrease + L_PTN, //LED Pattern Select Next + L_PTP, //LED Pattern Select Previous + L_PSI, //LED Pattern Speed Increase + L_PSD, //LED Pattern Speed Decrease + L_T_MD, //LED Toggle Mode + L_T_ONF, //LED Toggle On / Off + L_ON, //LED On + L_OFF, //LED Off + L_T_BR, //LED Toggle Breath Effect + L_T_PTD, //LED Toggle Scrolling Pattern Direction + U_T_AUTO, //USB Extra Port Toggle Auto Detect / Always Active + U_T_AGCR, //USB Toggle Automatic GCR control + DBG_TOG, //DEBUG Toggle On / Off + DBG_MTRX, //DEBUG Toggle Matrix Prints + DBG_KBD, //DEBUG Toggle Keyboard Prints + DBG_MOU, //DEBUG Toggle Mouse Prints + MD_BOOT, //Restart into bootloader after hold timeout +}; + +#define TG_NKRO MAGIC_TOGGLE_NKRO //Toggle 6KRO / NKRO mode + +keymap_config_t keymap_config; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_DEL, \ + 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_HOME, \ + 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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + [1] = LAYOUT( + KC_GRV, 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_TRNS, KC_MUTE, \ + L_T_BR, L_PSD, L_BRI, L_PSI, KC_TRNS, KC_TRNS, KC_TRNS, U_T_AUTO,U_T_AGCR,KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_END, \ + L_T_PTD, L_PTP, L_BRD, L_PTN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLU, \ + KC_TRNS, L_T_MD, L_T_ONF, KC_TRNS, KC_TRNS, MD_BOOT, TG_NKRO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_VOLD, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGDN, KC_END \ + ), + /* + [X] = LAYOUT( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ + ), + */ +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { +}; + +#define MODS_SHIFT (keyboard_report->mods & MOD_BIT(KC_LSHIFT) || keyboard_report->mods & MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL (keyboard_report->mods & MOD_BIT(KC_LCTL) || keyboard_report->mods & MOD_BIT(KC_RCTRL)) +#define MODS_ALT (keyboard_report->mods & MOD_BIT(KC_LALT) || keyboard_report->mods & MOD_BIT(KC_RALT)) + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + static uint32_t key_timer; + + switch (keycode) { + case L_BRI: + if (record->event.pressed) { + if (LED_GCR_STEP > LED_GCR_MAX - gcr_desired) gcr_desired = LED_GCR_MAX; + else gcr_desired += LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_BRD: + if (record->event.pressed) { + if (LED_GCR_STEP > gcr_desired) gcr_desired = 0; + else gcr_desired -= LED_GCR_STEP; + if (led_animation_breathing) gcr_breathe = gcr_desired; + } + return false; + case L_PTN: + if (record->event.pressed) { + if (led_animation_id == led_setups_count - 1) led_animation_id = 0; + else led_animation_id++; + } + return false; + case L_PTP: + if (record->event.pressed) { + if (led_animation_id == 0) led_animation_id = led_setups_count - 1; + else led_animation_id--; + } + return false; + case L_PSI: + if (record->event.pressed) { + led_animation_speed += ANIMATION_SPEED_STEP; + } + return false; + case L_PSD: + if (record->event.pressed) { + led_animation_speed -= ANIMATION_SPEED_STEP; + if (led_animation_speed < 0) led_animation_speed = 0; + } + return false; + case L_T_MD: + if (record->event.pressed) { + led_lighting_mode++; + if (led_lighting_mode > LED_MODE_MAX_INDEX) led_lighting_mode = LED_MODE_NORMAL; + } + return false; + case L_T_ONF: + if (record->event.pressed) { + led_enabled = !led_enabled; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_ON: + if (record->event.pressed) { + led_enabled = 1; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_OFF: + if (record->event.pressed) { + led_enabled = 0; + I2C3733_Control_Set(led_enabled); + } + return false; + case L_T_BR: + if (record->event.pressed) { + led_animation_breathing = !led_animation_breathing; + if (led_animation_breathing) { + gcr_breathe = gcr_desired; + led_animation_breathe_cur = BREATHE_MIN_STEP; + breathe_dir = 1; + } + } + return false; + case L_T_PTD: + if (record->event.pressed) { + led_animation_direction = !led_animation_direction; + } + return false; + case U_T_AUTO: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_extra_manual, "USB extra port manual mode"); + } + return false; + case U_T_AGCR: + if (record->event.pressed && MODS_SHIFT && MODS_CTRL) { + TOGGLE_FLAG_AND_PRINT(usb_gcr_auto, "USB GCR auto mode"); + } + return false; + case DBG_TOG: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_enable, "Debug mode"); + } + return false; + case DBG_MTRX: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_matrix, "Debug matrix"); + } + return false; + case DBG_KBD: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_keyboard, "Debug keyboard"); + } + return false; + case DBG_MOU: + if (record->event.pressed) { + TOGGLE_FLAG_AND_PRINT(debug_mouse, "Debug mouse"); + } + return false; + case MD_BOOT: + if (record->event.pressed) { + key_timer = timer_read32(); + } else { + if (timer_elapsed32(key_timer) >= 500) { + reset_keyboard(); + } + } + return false; + default: + return true; //Process all other keycodes normally + } +} diff --git a/keyboards/tada68/keymaps/abishalom/config.h b/keyboards/tada68/keymaps/abishalom/config.h new file mode 100644 index 0000000000..af01528b43 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/config.h @@ -0,0 +1,3 @@ +#pragma once + +#define BACKLIGHT_BREATHING diff --git a/keyboards/tada68/keymaps/abishalom/keymap.c b/keyboards/tada68/keymaps/abishalom/keymap.c new file mode 100644 index 0000000000..94217948e0 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/keymap.c @@ -0,0 +1,96 @@ +#include QMK_KEYBOARD_H + +// 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 +#define _FL 1 +#define _NL 2 + +#define SEMI_FN LT(_FL, KC_SCLN) + +//Tap Dance Declarations +enum { + TD_WIN_LOCK = 0 +}; + +//BL_BRTG - breathing mode. Would like to put in. + +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_WIN_LOCK] = ACTION_TAP_DANCE_DOUBLE(MAGIC_NO_GUI, MAGIC_UNNO_GUI) +}; + +// +////In Layer declaration, add tap dance item in place of a key code +//TD(TD_WIN_LOCK) + +// Double Tap Fn button to get caps. FN + Tab to get to number layer -> Maybe switch to FN + space?. +// Press fn+GUI once to lock, double tap to unlock. + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Keymap _BL: (Base Layer) Default Layer + * ,----------------------------------------------------------------. + * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |~ ` | + * |----------------------------------------------------------------| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \ |Del | + * |----------------------------------------------------------------| + * |FNCAP| A| S| D| F| G| H| J| K| L| ;| '|Enter |PgUp | + * |----------------------------------------------------------------| + * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | Up|PgDn| + * |----------------------------------------------------------------| + * |Ctrl|Win |Alt | Space |Alt| FN|Ctrl|Lef|Dow|Rig | + * `----------------------------------------------------------------' + */ +[_BL] = LAYOUT_ansi( + KC_GESC, 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_GRV, \ + 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, \ + LT(_FL, KC_CAPS), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, SEMI_FN,KC_QUOT, KC_ENT,KC_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,MO(_FL),KC_RCTRL, KC_LEFT,KC_DOWN,KC_RGHT), + + /* Keymap _FL: Function Layer + * ,----------------------------------------------------------------. + * | | F1|F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|Del | | + * |----------------------------------------------------------------| + * |#PAD |Pre| U |NXT| | | |PGD| U |PGU|PSC| | | |Ins | + * |----------------------------------------------------------------| + * | |L | D | R |PPl| | | L | D | R | | | |Home| + * |----------------------------------------------------------------| + * | CAPS |MUT|VU-|VU+| | | |BRG|BL-|BL+|BLT| |Stp|End | + * |----------------------------------------------------------------| + * | |WTOG| | | | | |Pre|PPl|Nxt | + * `----------------------------------------------------------------' + */ +[_FL] = LAYOUT_ansi( + _______, 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_DEL, _______ , \ + TO(_NL),KC_MPRV, KC_UP ,KC_MNXT,_______, _______,_______,KC_PGDN,KC_UP,KC_PGUP,KC_PSCR,_______,_______, _______,KC_INSERT, \ + _______,KC_LEFT,KC_DOWN,KC_RGHT,KC_MPLY,_______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______, _______,KC_HOME, \ + _______,KC_MUTE,KC_VOLD,KC_VOLU, _______,_______, _______,BL_BRTG,BL_DEC,BL_INC,BL_TOGG,_______, KC_STOP, KC_END, \ + _______,TD(TD_WIN_LOCK),_______, _______, _______,KC_TRNS,_______,KC_MPRV,KC_MPLY, KC_MNXT), + + +//Press either of function keys to get back to base layer. + + /* Keymap _NL: Number Layer + * ,----------------------------------------------------------------. + * |ESC| F1 | F2| F3| F4| |#L | 7 | 8 | 9 | - | | = | | | + * |----------------------------------------------------------------| + * | TAB | | UP| | | | / | 4 | 5 | 6 | + | | | | DEL| + * |----------------------------------------------------------------| + * | _BL |LFT|DWN|RGT| | | * | 1 | 2 | 3 |ENT| | ENT |PgUp| + * |----------------------------------------------------------------| + * | SHIFT | | | | | | 0 | 0 | , | . |BKS| SHIFT| U |PgDn| + * |----------------------------------------------------------------| + * |CTRL|WIN |ALT | |ALT| _BL |CTRL| L | D | R| + * `----------------------------------------------------------------' + */ +[_NL] = LAYOUT_ansi( + _______, KC_F1 ,KC_F2, KC_F3, KC_F4, _______, KC_NLCK, KC_P7, KC_P8, KC_P9, KC_PMNS, KC_PEQL, KC_PEQL, _______, _______ , \ + KC_TAB,_______, KC_UP,_______,_______, _______,KC_PSLS,KC_P4,KC_P5,KC_P6,KC_PPLS,_______,_______, _______,KC_DEL, \ + TO(_BL),KC_LEFT,KC_DOWN,KC_RGHT,_______,_______,KC_PAST,KC_P1,KC_P2,KC_P3,KC_PENT,_______, KC_ENT,KC_PGUP, \ + KC_LSFT,_______,_______,_______, _______,_______, KC_P0,KC_P0,KC_PCMM,KC_PDOT,KC_BSPC,KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTRL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,TO(_BL),KC_RCTRL,KC_LEFT,KC_DOWN, KC_RGHT), + +}; diff --git a/keyboards/tada68/keymaps/abishalom/readme.md b/keyboards/tada68/keymaps/abishalom/readme.md new file mode 100644 index 0000000000..511704223b --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/readme.md @@ -0,0 +1,6 @@ +# Godolphins13 Tada68 + +My Tada68 layout. +Caps lock acts as a function key when held, otherwise just caps lock. +In the function layer, arrow keys mapped to both wasd and ijkl, as I haven't really decided which I like best. + diff --git a/keyboards/tada68/keymaps/abishalom/rules.mk b/keyboards/tada68/keymaps/abishalom/rules.mk new file mode 100644 index 0000000000..b3eaa62150 --- /dev/null +++ b/keyboards/tada68/keymaps/abishalom/rules.mk @@ -0,0 +1,18 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +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 = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = yes # Tappa Dance Bitch -- cgit v1.2.3 From 90f9fb4eee0da25e5408e54ed872c6da2a40c5f3 Mon Sep 17 00:00:00 2001 From: mtei <2170248+mtei@users.noreply.github.com> Date: Fri, 5 Oct 2018 14:54:22 +0900 Subject: Fixed docs/newbs_testing_debugging.md and tmk_core/common/print.h --- docs/newbs_testing_debugging.md | 2 +- tmk_core/common/print.h | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/newbs_testing_debugging.md b/docs/newbs_testing_debugging.md index 1d8021dec8..45509110a5 100644 --- a/docs/newbs_testing_debugging.md +++ b/docs/newbs_testing_debugging.md @@ -28,6 +28,6 @@ Sometimes it's useful to print debug messages from within your [custom code](cus After that you can use a few different print functions: * `print("string")`: Print a simple string. -* `sprintf("%s string", var)`: Print a formatted string +* `uprintf("%s string", var)`: Print a formatted string * `dprint("string")` Print a simple string, but only when debug mode is enabled * `dprintf("%s string", var)`: Print a formatted string, but only when debug mode is enabled diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index 06c6cbd7f1..2d7184bd0d 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -60,7 +60,7 @@ # define println(s) xputs(PSTR(s "\r\n")) # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ @@ -125,7 +125,7 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); # define println(s) xprintf(s "\r\n") # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ @@ -141,19 +141,19 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); # define xprintf(fmt, ...) // Create user print defines -# define uprintf(fmt, ...) __xprintf(fmt, ...) +# define uprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) # define uprint(s) xprintf(s) # define uprintln(s) xprintf(s "\r\n") # else /* NORMAL PRINT */ // Create user & normal print defines -# define xprintf(fmt, ...) __xprintf(fmt, ...) +# define xprintf(fmt, ...) __xprintf(fmt, ##__VA_ARGS__) # define print(s) xprintf(s) # define println(s) xprintf(s "\r\n") # define uprint(s) print(s) # define uprintln(s) println(s) -# define uprintf(fmt, ...) xprintf(fmt, ...) +# define uprintf(fmt, ...) xprintf(fmt, ##__VA_ARGS__) # endif /* USER_PRINT / NORMAL PRINT */ -- cgit v1.2.3 From d79b5e67b691e367897a24008ec3f2188b1642f3 Mon Sep 17 00:00:00 2001 From: John Pettigrew Date: Tue, 27 Nov 2018 15:43:48 -0600 Subject: Puck Macropad (#4274) * Add Puck * Update Manufacturer name in metadata * Add num lock to high layer * update pins * update pin settings * fix numlock key * Cleanup config.h * Update device info * updates after review --- keyboards/puck/config.h | 31 +++++++++++++++ keyboards/puck/keymaps/default/keymap.c | 64 +++++++++++++++++++++++++++++++ keyboards/puck/puck.c | 1 + keyboards/puck/puck.h | 15 ++++++++ keyboards/puck/readme.md | 11 ++++++ keyboards/puck/rules.mk | 68 +++++++++++++++++++++++++++++++++ 6 files changed, 190 insertions(+) create mode 100644 keyboards/puck/config.h create mode 100644 keyboards/puck/keymaps/default/keymap.c create mode 100644 keyboards/puck/puck.c create mode 100644 keyboards/puck/puck.h create mode 100644 keyboards/puck/readme.md create mode 100644 keyboards/puck/rules.mk diff --git a/keyboards/puck/config.h b/keyboards/puck/config.h new file mode 100644 index 0000000000..b2cb1b23e3 --- /dev/null +++ b/keyboards/puck/config.h @@ -0,0 +1,31 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER OkKeebs LLC +#define PRODUCT Puck +#define DESCRIPTION 4x3 macropad + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 3 + +#define MATRIX_ROW_PINS { D2, D3, C6, C7 } +#define MATRIX_COL_PINS { B4, D7, D6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* number of backlight levels */ +#define BACKLIGHT_LEVELS 3 + +/* Locking resynchronize hack */ +#define LOCKING_RESYNC_ENABLE diff --git a/keyboards/puck/keymaps/default/keymap.c b/keyboards/puck/keymaps/default/keymap.c new file mode 100644 index 0000000000..6ba70a88bb --- /dev/null +++ b/keyboards/puck/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H + +#define _BL 0 +#define _HL 1 +#define _LL 2 + +enum keycodes { + LOW, + HIGH +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * Base Layer (Numbers) + */ + [_BL] = LAYOUT( + KC_KP_7, KC_KP_8, KC_KP_9, + KC_KP_4, KC_KP_5, KC_KP_6, + KC_KP_1, KC_KP_2, KC_KP_3, + LOW, KC_KP_0, HIGH + ), + /* + * High Layer (Work) + */ + [_HL] = LAYOUT( + KC_NUMLOCK, KC_PAST, KC_NO, + KC_PMNS, KC_PENT, KC_PPLS, + KC_NO, KC_PSLS, KC_NO, + KC_NO, KC_PDOT, KC_NO + ), + /* + * Low Layer (Media) + */ + [_LL] = LAYOUT( + KC_NO, KC_VOLU, KC_NO, + KC_MPRV, KC_MPLY, KC_MNXT, + KC_NO, KC_VOLD, KC_NO, + KC_NO, KC_NO, KC_NO + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { + case HIGH: + if (record->event.pressed) { + layer_on(_HL); + }else{ + layer_off(_HL); + layer_off(_LL); + } + return false; + break; + case LOW: + if (record->event.pressed) { + layer_on(_LL); + }else{ + layer_off(_LL); + layer_off(_HL); + } + return false; + break; + } + return true; +} diff --git a/keyboards/puck/puck.c b/keyboards/puck/puck.c new file mode 100644 index 0000000000..0e26b9c3cd --- /dev/null +++ b/keyboards/puck/puck.c @@ -0,0 +1 @@ +#include "puck.h" diff --git a/keyboards/puck/puck.h b/keyboards/puck/puck.h new file mode 100644 index 0000000000..4467614fdb --- /dev/null +++ b/keyboards/puck/puck.h @@ -0,0 +1,15 @@ +#ifndef PUCK_H +#define PUCK_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B \ +) { \ + { K00, K01, K02 }, \ + { K03, K04, K05 }, \ + { K06, K07, K08 }, \ + { K09, K0A, K0B }, \ +} + +#endif diff --git a/keyboards/puck/readme.md b/keyboards/puck/readme.md new file mode 100644 index 0000000000..45e438c471 --- /dev/null +++ b/keyboards/puck/readme.md @@ -0,0 +1,11 @@ +A 4 x 3 macropad. + +Keyboard Maintainer: [john-pettigrew](https://github.com/john-pettigrew) +Hardware Supported: Puck PCB. +Hardware Availability: [OkKeebs.com](https://okkeebs.com/products/puck-pcb) + +Make example for this keyboard (after setting up your build environment): + + make puck: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/puck/rules.mk b/keyboards/puck/rules.mk new file mode 100644 index 0000000000..48144534d4 --- /dev/null +++ b/keyboards/puck/rules.mk @@ -0,0 +1,68 @@ + + +# MCU name +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = halfkay + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -- cgit v1.2.3 From 82c02d9b8d30cac7ab0b0d21e9d81c1a70df73c1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 27 Nov 2018 13:45:01 -0800 Subject: Update MSYS to use the 5.4.0 toolchain (#4106) --- util/msys2_install.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/util/msys2_install.sh b/util/msys2_install.sh index d9459580c7..a0548ad9bc 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -13,9 +13,11 @@ source "$dir/win_shared_install.sh" function install_avr { rm -f -r "$avrtools" - wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe" - 7z x avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe - rm avr8-gnu-toolchain-installer-3.5.4.91-win32.any.x86.exe + wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip" + 7z x avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip + mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain + rm __MACOSX -R + rm avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip pacman --needed -S mingw-w64-x86_64-avrdude } -- cgit v1.2.3 From 929e6a3231d7b873bad475a7040f140712fb9c9d Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Tue, 27 Nov 2018 17:00:01 -0500 Subject: Ergodox EZ: Remove Unused Code From Keymap --- keyboards/ergodox_ez/keymaps/default/keymap.c | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 49de607737..0cd6d6c2ce 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -145,24 +145,6 @@ const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols) }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case 1: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; - } - return MACRO_NONE; -}; - bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { // dynamically generate these. @@ -197,11 +179,6 @@ void matrix_init_user(void) { #endif }; -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -}; - // Runs whenever there is a layer state change. uint32_t layer_state_set_user(uint32_t state) { ergodox_board_led_off(); -- cgit v1.2.3 From 6983c71efd9991e7f6b8290dff24a023bbe4eeb1 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Tue, 27 Nov 2018 17:04:29 -0500 Subject: Ergodox EZ: Clean Up process_record_user Function Set ERPM = SAFE_RANGE --- keyboards/ergodox_ez/keymaps/default/keymap.c | 35 ++++++++++----------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 0cd6d6c2ce..12d6cf6fa6 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -6,8 +6,7 @@ #define MDIA 2 // media keys enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - EPRM, + EPRM = SAFE_RANGE, VRSN, RGB_SLD }; @@ -146,28 +145,20 @@ const uint16_t PROGMEM fn_actions[] = { }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { + if (record->event.pressed) { + switch (keycode) { + case EPRM: eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { + return false; + case VRSN: SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - case RGB_SLD: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_mode(1); - #endif - } - return false; - break; + return false; + #ifdef RGBLIGHT_ENABLE + case RGB_SLD: + rgblight_mode(1); + return false; + #endif + } } return true; } -- cgit v1.2.3 From e4dfcf896ef641701564bec5ea1ea7aa81b072bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Tue, 27 Nov 2018 23:29:59 +0100 Subject: Add tap_code16 function (#4362) --- quantum/quantum.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/quantum/quantum.h b/quantum/quantum.h index fe670c8eb4..41c7d8351a 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -240,8 +240,9 @@ void reset_keyboard(void); void startup_user(void); void shutdown_user(void); -void register_code16 (uint16_t code); -void unregister_code16 (uint16_t code); +void register_code16(uint16_t code); +void unregister_code16(uint16_t code); +inline void tap_code16(uint16_t code) { register_code16(code); unregister_code16(code); } #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); -- cgit v1.2.3 From dd7534cccabd9e1cea86e69741ed8c68cb3d0299 Mon Sep 17 00:00:00 2001 From: epaew Date: Wed, 28 Nov 2018 08:18:11 +0900 Subject: Keyboard: fix for debug crkbd (#4469) --- keyboards/crkbd/crkbd.c | 10 +++++++--- keyboards/crkbd/rev1/split_scomm.c | 5 ++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/keyboards/crkbd/crkbd.c b/keyboards/crkbd/crkbd.c index 32f7af776e..d420ccda27 100644 --- a/keyboards/crkbd/crkbd.c +++ b/keyboards/crkbd/crkbd.c @@ -1,6 +1,10 @@ #include "crkbd.h" -#include "ssd1306.h" +#include "ssd1306.h" bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - return process_record_gfx(keycode,record) && process_record_user(keycode, record); -} \ No newline at end of file +#ifdef SSD1306OLED + return process_record_gfx(keycode,record) && process_record_user(keycode, record); +#else + return process_record_user(keycode, record); +#endif +} diff --git a/keyboards/crkbd/rev1/split_scomm.c b/keyboards/crkbd/rev1/split_scomm.c index ada7867960..a1fe6ba5b8 100644 --- a/keyboards/crkbd/rev1/split_scomm.c +++ b/keyboards/crkbd/rev1/split_scomm.c @@ -63,10 +63,9 @@ int serial_update_buffers(int master_update) if( smatstatus == TRANSACTION_END ) { s_change_old = s_change_new; #ifdef CONSOLE_ENABLE - uprintf("slave matrix = %b %b %b %b %b\n", + uprintf("slave matrix = %b %b %b %b\n", serial_slave_buffer[0], serial_slave_buffer[1], - serial_slave_buffer[2], serial_slave_buffer[3], - serial_slave_buffer[4] ); + serial_slave_buffer[2], serial_slave_buffer[3]); #endif } } else { -- cgit v1.2.3 From 55c32148779baf1dcacb3bedc74f8179a1e0b2d7 Mon Sep 17 00:00:00 2001 From: Christon DeWan Date: Tue, 27 Nov 2018 15:20:17 -0800 Subject: fixed misplaced paranthesis in arm usb mouse send function (#4478) bug was causing lots of dropped events for me. --- tmk_core/protocol/chibios/usb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/protocol/chibios/usb_main.c b/tmk_core/protocol/chibios/usb_main.c index 3028e7ea2a..8223d97228 100644 --- a/tmk_core/protocol/chibios/usb_main.c +++ b/tmk_core/protocol/chibios/usb_main.c @@ -704,7 +704,7 @@ void send_mouse(report_mouse_t *report) { * every iteration - otherwise the system will remain locked, * no interrupts served, so USB not going through as well. * Note: for suspend, need USB_USE_WAIT == TRUE in halconf.h */ - if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, MS2ST(10)==MSG_TIMEOUT)) { + if (osalThreadSuspendTimeoutS(&(&USB_DRIVER)->epc[MOUSE_IN_EPNUM]->in_state->thread, MS2ST(10))==MSG_TIMEOUT) { osalSysUnlock(); return; } -- cgit v1.2.3 From 19043197459c5c8ed4a7039f1a4c1da180da45e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 28 Nov 2018 00:34:06 +0100 Subject: Remove RGB_SMOD alias and replace uses with RGB_MOD (#4319) --- docs/feature_rgblight.md | 2 -- keyboards/bface/keymaps/default/keymap.c | 2 +- keyboards/crkbd/keymaps/default/keymap.c | 4 ++-- keyboards/crkbd/keymaps/like_jis/keymap.c | 4 ++-- keyboards/daisy/keymaps/default/keymap.c | 2 +- keyboards/do60/keymaps/default/keymap.c | 2 +- keyboards/do60/keymaps/test/keymap.c | 2 +- keyboards/handwired/woodpad/keymaps/drashna/keymap.c | 2 +- keyboards/helix/pico/keymaps/default/keymap.c | 2 +- keyboards/helix/rev2/keymaps/default/keymap.c | 4 ++-- keyboards/helix/rev2/keymaps/five_rows/README.md | 2 +- keyboards/helix/rev2/keymaps/five_rows/README_jp.md | 2 +- keyboards/helix/rev2/keymaps/five_rows/keymap.c | 2 +- keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c | 2 +- keyboards/helix/rev2/keymaps/yshrsmz/keymap.c | 4 ++-- keyboards/jj40/keymaps/like_jis/keymap.c | 4 ++-- keyboards/nyquist/keymaps/kim-kim/keymap.c | 2 +- keyboards/pearl/keymaps/jetpacktuxedo/keymap.c | 2 +- keyboards/playkbtw/ca66/keymaps/olivia/keymap.c | 2 +- keyboards/xd75/keymaps/kim-kim/keymap.c | 2 +- quantum/quantum_keycodes.h | 1 - users/turbomech/backupturbomech.c | 1 - 22 files changed, 24 insertions(+), 28 deletions(-) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 0205ebe91a..4610467b02 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -63,8 +63,6 @@ Changing the **Value** sets the overall brightness. |`RGB_MODE_GRADIENT`|`RGB_M_G` |Static gradient animation mode | |`RGB_MODE_RGBTEST` |`RGB_M_T` |Red, Green, Blue test animation mode | -?> For backwards compatibility, `RGB_SMOD` is another alias of `RGB_MOD`. - ## Configuration Your RGB lighting can be configured by placing these `#define`s in your `config.h`: diff --git a/keyboards/bface/keymaps/default/keymap.c b/keyboards/bface/keymaps/default/keymap.c index c29ce9abfa..9c41014bcb 100644 --- a/keyboards/bface/keymaps/default/keymap.c +++ b/keyboards/bface/keymaps/default/keymap.c @@ -29,7 +29,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS,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_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,BL_INC, BL_DEC, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_TRNS,RGB_SMOD,KC_TRNS,BL_ON, BL_OFF, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, + KC_TRNS,KC_TRNS,RGB_MOD,KC_TRNS,BL_ON, BL_OFF, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS, KC_TRNS, KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS ), /* You can copy this layer as base for a new fn layer * / diff --git a/keyboards/crkbd/keymaps/default/keymap.c b/keyboards/crkbd/keymaps/default/keymap.c index c7c9582e83..1e2e57a2b4 100644 --- a/keyboards/crkbd/keymaps/default/keymap.c +++ b/keyboards/crkbd/keymaps/default/keymap.c @@ -52,7 +52,7 @@ enum macro_keycodes { #define KC_LSAD RGB_SAD #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD +#define KC_LMOD RGB_MOD #define KC_CTLTB CTL_T(KC_TAB) #define KC_GUIEI GUI_T(KC_LANG2) #define KC_ALTKN ALT_T(KC_LANG1) @@ -100,7 +100,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+------+------+------+------+------| |------+------+------+------+------+------| LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| GUIEI, LOWER, SPC, ENT, RAISE, ALTKN \ //`--------------------' `--------------------' diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 05d31845c8..42d36de449 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -50,7 +50,7 @@ enum custom_keycodes { #define KC_LSAD RGB_SAD #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD +#define KC_LMOD RGB_MOD #define KC_KNRM AG_NORM #define KC_KSWP AG_SWAP @@ -99,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+-------+------+------+------+-----| |------+------+------+------+------+------| _____, LTOG, LHUI, LSAI, LVAI,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ //|------+-------+------+------+------+-----| |------+------+------+------+------+------| - _____, LSMOD, LHUD, LSAD, LVAD,XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ + _____, LMOD, LHUD, LSAD, LVAD,XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, XXXXX, _____, _____, XXXXX \ //`--------------------' `--------------------' diff --git a/keyboards/daisy/keymaps/default/keymap.c b/keyboards/daisy/keymaps/default/keymap.c index 833620b01f..f1a5e353fa 100644 --- a/keyboards/daisy/keymaps/default/keymap.c +++ b/keyboards/daisy/keymaps/default/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RS] = LAYOUT( RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TRNS, KC_HOME, KC_PGUP, KC_TRNS, KC_TRNS, KC_TRNS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_TRNS, KC_END, KC_PGDN, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_SMOD, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, BL_STEP, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_VAD, RGB_VAI, RGB_SAD, RGB_SAI, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), diff --git a/keyboards/do60/keymaps/default/keymap.c b/keyboards/do60/keymaps/default/keymap.c index 1a8b98a46b..7c66f0ac0b 100644 --- a/keyboards/do60/keymaps/default/keymap.c +++ b/keyboards/do60/keymaps/default/keymap.c @@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_all( RESET, 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_NO, KC_NO, \ KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, BL_TOGG,BL_ON, BL_INC, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ - KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, BL_STEP,BL_OFF, BL_DEC, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ + KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, BL_STEP,BL_OFF, BL_DEC, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \ KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), diff --git a/keyboards/do60/keymaps/test/keymap.c b/keyboards/do60/keymaps/test/keymap.c index 04b5f44bb1..6bac713fda 100644 --- a/keyboards/do60/keymaps/test/keymap.c +++ b/keyboards/do60/keymaps/test/keymap.c @@ -15,7 +15,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_all( RESET, 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_NO, KC_NO, \ KC_NO, RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, KC_HOME,KC_CALC,KC_NO, KC_INS, KC_NO, KC_PSCR, KC_SLCK, KC_PAUS, KC_DEL, \ - KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ + KC_NO, RGB_HUD, RGB_SAD, RGB_VAD, RGB_RMOD, KC_END, KC_PGDN,KC_NO, KC_NO, KC_NO, KC_HOME, KC_PGUP, KC_NO, KC_ENT, \ KC_LSFT, KC_NO, KC_NO, KC_APP, BL_STEP, KC_NO, KC_NO, KC_VOLD,KC_VOLU,KC_MUTE, KC_END, KC_RSFT, KC_NO , KC_PGUP, KC_INS, \ KC_LCTL, KC_LGUI, KC_LALT, KC_BSPC,KC_SPC, KC_DEL, KC_RGUI, F(0), KC_HOME, KC_PGDOWN,KC_END), diff --git a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c index fd1ff00535..f7df5eac79 100644 --- a/keyboards/handwired/woodpad/keymaps/drashna/keymap.c +++ b/keyboards/handwired/woodpad/keymaps/drashna/keymap.c @@ -64,7 +64,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_RESET, KC_MUTE, KC_VOLD, KC_VOLU,\ KC_MAKE, _______, RGB_HUI, RGB_HUD, \ KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, \ - RGB_TOG, RGB_SMOD, RGB_SAI, RGB_VAI, \ + RGB_TOG, RGB_MOD, RGB_SAI, RGB_VAI, \ _______, KC_RGB_T, RGB_SAD, RGB_VAD \ ), diff --git a/keyboards/helix/pico/keymaps/default/keymap.c b/keyboards/helix/pico/keymaps/default/keymap.c index 4c58785179..5273bb4a01 100644 --- a/keyboards/helix/pico/keymaps/default/keymap.c +++ b/keyboards/helix/pico/keymaps/default/keymap.c @@ -164,7 +164,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, AU_ON, AU_OFF, MU_TOG, MU_MOD, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, CK_TOGG, CK_RST, CK_UP, CK_DOWN, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; diff --git a/keyboards/helix/rev2/keymaps/default/keymap.c b/keyboards/helix/rev2/keymaps/default/keymap.c index 92393208ce..0fb821affb 100644 --- a/keyboards/helix/rev2/keymaps/default/keymap.c +++ b/keyboards/helix/rev2/keymaps/default/keymap.c @@ -183,7 +183,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; @@ -296,7 +296,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; diff --git a/keyboards/helix/rev2/keymaps/five_rows/README.md b/keyboards/helix/rev2/keymaps/five_rows/README.md index 4feaac2efb..10a4fa942c 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/README.md +++ b/keyboards/helix/rev2/keymaps/five_rows/README.md @@ -46,7 +46,7 @@ Mac mode swap Alt/Win(GUI) key. | ---- | ---- | --- | |on/off|Adjust + e(Qwerty)|RGB_TOG| | |Adjust + i(Qwerty)| | -|change mode|Adjust + d(Qwerty) |RGB_SMOD| +|change mode|Adjust + d(Qwerty) |RGB_MOD| | |Adjust + k(Qwerty)| | |HUE +|Adjust + Left Control|RGB_HUI| | |Adjust + Right Control| | diff --git a/keyboards/helix/rev2/keymaps/five_rows/README_jp.md b/keyboards/helix/rev2/keymaps/five_rows/README_jp.md index 932e200a56..317ffdd71d 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/README_jp.md +++ b/keyboards/helix/rev2/keymaps/five_rows/README_jp.md @@ -68,7 +68,7 @@ Winモードでは、該当のキーはどちらも共に Alt + `(日本語IME | ---- | ---- | --- | |オン/オフ|Adjust + e(Qwerty)|RGB_TOG| | |Adjust + i(Qwerty)| | -|モード切り替え|Adjust + d(Qwerty) |RGB_SMOD| +|モード切り替え|Adjust + d(Qwerty) |RGB_MOD| | |Adjust + k(Qwerty)| | |色相 +|Adjust + Left Control|RGB_HUI| | |Adjust + Right Control| | diff --git a/keyboards/helix/rev2/keymaps/five_rows/keymap.c b/keyboards/helix/rev2/keymaps/five_rows/keymap.c index 983bbe9378..e293f59005 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows/keymap.c @@ -280,7 +280,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT( \ XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \ XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \ - RGB_HUI, RGB_SAI, RGB_VAI,RGB_SMOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF,RGB_SMOD, RGB_VAI, RGB_SAI, RGB_HUI, \ + RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, \ RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \ _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ ), diff --git a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c index df00366e39..8c2040d5be 100644 --- a/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows_jis/keymap.c @@ -204,7 +204,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RESET, RGBRST, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, XXXXXXX, DL_BAS, DL_BASE, AG_NORM, AG_SWAP, XXXXXXX, \ XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, XXXXXXX, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, \ - XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, \ + XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; diff --git a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c index 049a864c1a..1bde66e885 100644 --- a/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c +++ b/keyboards/helix/rev2/keymaps/yshrsmz/keymap.c @@ -158,7 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; @@ -253,7 +253,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_SMOD,RGB_HUD, RGB_SAD, RGB_VAD \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD \ ) }; diff --git a/keyboards/jj40/keymaps/like_jis/keymap.c b/keyboards/jj40/keymaps/like_jis/keymap.c index 4724933eab..24db919472 100644 --- a/keyboards/jj40/keymaps/like_jis/keymap.c +++ b/keyboards/jj40/keymaps/like_jis/keymap.c @@ -30,7 +30,7 @@ enum custom_keycodes { #define KC_LSAD RGB_SAD #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD -#define KC_LSMOD RGB_SMOD +#define KC_LMOD RGB_MOD #define KC_BTOG BL_TOGG #define KC_BINC BL_INC #define KC_BDEC BL_DEC @@ -90,7 +90,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|------+------+------+------+------+------|------+------+------+------+------+------| XXXXX, LTOG, LHUI, LSAI, LVAI, BTOG, BINC, WH_R, WH_D, END, PGDN, XXXXX,\ //|------+------+------+------+------+------|------+------+------+------+------+------| - XXXXX, LSMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ + XXXXX, LMOD, LHUD, LSAD, LVAD, XXXXX, BDEC, XXXXX, BTN1, BTN2, MS_U, XXXXX,\ //|------+------+------+------+------+-------------+------+------+------+------+------| _____, _____, _____, _____, _____, XXXXX, XXXXX, _____, _____, MS_L, MS_D, MS_R \ //|------+------+------+------+------+-------------+------+------+------+------+------| diff --git a/keyboards/nyquist/keymaps/kim-kim/keymap.c b/keyboards/nyquist/keymaps/kim-kim/keymap.c index c8b081b25f..4051f296ee 100644 --- a/keyboards/nyquist/keymaps/kim-kim/keymap.c +++ b/keyboards/nyquist/keymaps/kim-kim/keymap.c @@ -53,7 +53,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LW] = LAYOUT( \ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, _______, _______, _______, \ _______, KC_MPRV, KC_MNXT, KC_VOLU, RGB_TOG, KC_F11, _______, _______, _______, _______, _______, _______, \ - _______, KC_MPLY, KC_MSTP, KC_VOLD, RGB_SMOD, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_MPLY, KC_MSTP, KC_VOLD, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), diff --git a/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c b/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c index b94fb673ff..759c6fdc7d 100644 --- a/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c +++ b/keyboards/pearl/keymaps/jetpacktuxedo/keymap.c @@ -10,7 +10,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = LAYOUT_all( 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_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_QUOT, KC_TRNS, - KC_TRNS, RGB_TOG, RGB_SMOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSLS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), [2] = LAYOUT_all( diff --git a/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c b/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c index f27824e57a..ed3d625e47 100644 --- a/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c +++ b/keyboards/playkbtw/ca66/keymaps/olivia/keymap.c @@ -11,7 +11,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LAYOUT( KC_PWR, 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_INS, KC_DEL, RESET, - KC_CAPS, RGB_RMOD,RGB_SMOD,RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_TOG, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, + KC_CAPS, RGB_RMOD,RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_TOG, KC_PSCR, KC_SLCK, KC_PAUS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_MUTE, KC_EJCT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_PGUP, KC_LEFT, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_DOWN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), diff --git a/keyboards/xd75/keymaps/kim-kim/keymap.c b/keyboards/xd75/keymaps/kim-kim/keymap.c index 85c0002309..0ec506e179 100644 --- a/keyboards/xd75/keymaps/kim-kim/keymap.c +++ b/keyboards/xd75/keymaps/kim-kim/keymap.c @@ -67,7 +67,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LW] = { /* LOWERED */ { _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F11, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, KC_MPRV, KC_MNXT, KC_VOLU, _______, _______, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______ }, - { _______, KC_MPLY, KC_MSTP, KC_VOLD, _______, _______, RGB_SMOD, _______, _______, _______, _______, _______, _______, _______, _______ }, + { _______, KC_MPLY, KC_MSTP, KC_VOLD, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, _______, _______, KC_MUTE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, { _______, MO(_RT), MO(_RT), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, }, diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 14f8c2b812..7670d53e96 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -581,7 +581,6 @@ enum quantum_keycodes { #define CK_OFF CLICKY_DISABLE #define RGB_MOD RGB_MODE_FORWARD -#define RGB_SMOD RGB_MODE_FORWARD #define RGB_RMOD RGB_MODE_REVERSE #define RGB_M_P RGB_MODE_PLAIN diff --git a/users/turbomech/backupturbomech.c b/users/turbomech/backupturbomech.c index 49bcded552..2815aa452f 100644 --- a/users/turbomech/backupturbomech.c +++ b/users/turbomech/backupturbomech.c @@ -269,7 +269,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { /*case RGB_MOD: -case RGB_SMOD: case RGB_HUI: case RGB_HUD: case RGB_SAI: -- cgit v1.2.3 From a495326aed8292138577387d9124a4b980904d37 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 27 Nov 2018 16:54:43 -0800 Subject: Turn off Mousekeys for several ps2avrGB keyboards (#4502) * Turn off Mousekeys for jc65 * Turn off Mousekeys for ps2avrGB templates * Disable mousekeys for bmini and canoe as well --- keyboards/bmini/rules.mk | 6 +++--- keyboards/canoe/rules.mk | 6 +++--- keyboards/jc65/v32a/rules.mk | 4 ++-- keyboards/pearl/rules.mk | 8 ++++---- keyboards/ps2avrGB/rules.mk | 6 +++--- quantum/template/ps2avrgb/rules.mk | 4 ++-- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/keyboards/bmini/rules.mk b/keyboards/bmini/rules.mk index 73c361e2a8..3d7bc0215d 100644 --- a/keyboards/bmini/rules.mk +++ b/keyboards/bmini/rules.mk @@ -26,13 +26,13 @@ F_CPU = 12000000 # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes diff --git a/keyboards/canoe/rules.mk b/keyboards/canoe/rules.mk index 73c361e2a8..3d7bc0215d 100644 --- a/keyboards/canoe/rules.mk +++ b/keyboards/canoe/rules.mk @@ -26,13 +26,13 @@ F_CPU = 12000000 # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes diff --git a/keyboards/jc65/v32a/rules.mk b/keyboards/jc65/v32a/rules.mk index 5c8e63283d..fac85172ec 100644 --- a/keyboards/jc65/v32a/rules.mk +++ b/keyboards/jc65/v32a/rules.mk @@ -31,8 +31,8 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes diff --git a/keyboards/pearl/rules.mk b/keyboards/pearl/rules.mk index c5b61c6d39..fac85172ec 100644 --- a/keyboards/pearl/rules.mk +++ b/keyboards/pearl/rules.mk @@ -26,13 +26,13 @@ F_CPU = 12000000 # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes @@ -47,4 +47,4 @@ CUSTOM_MATRIX = yes SRC = matrix.c i2c.c # programming options -PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex \ No newline at end of file +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/ps2avrGB/rules.mk b/keyboards/ps2avrGB/rules.mk index c7c12dcf17..1be9edc24f 100644 --- a/keyboards/ps2avrGB/rules.mk +++ b/keyboards/ps2avrGB/rules.mk @@ -26,13 +26,13 @@ F_CPU = 12000000 # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = atmel-dfu # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes diff --git a/quantum/template/ps2avrgb/rules.mk b/quantum/template/ps2avrgb/rules.mk index 68d50aec67..85603f955c 100644 --- a/quantum/template/ps2avrgb/rules.mk +++ b/quantum/template/ps2avrgb/rules.mk @@ -31,8 +31,8 @@ F_CPU = 12000000 BOOTLOADER = bootloadHID # build options -BOOTMAGIC_ENABLE = yes -MOUSEKEY_ENABLE = yes +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no EXTRAKEY_ENABLE = yes CONSOLE_ENABLE = yes COMMAND_ENABLE = yes -- cgit v1.2.3 From 6d2730eeff424ee096a334bab9d130e9f26230d0 Mon Sep 17 00:00:00 2001 From: zfhrp6 Date: Thu, 29 Nov 2018 00:33:08 +0900 Subject: [fortitude60] match default keymap comment to the implementation. (#4508) --- keyboards/fortitude60/keymaps/default/keymap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/keyboards/fortitude60/keymaps/default/keymap.c b/keyboards/fortitude60/keymaps/default/keymap.c index 9d724a8ec6..f0b9964ab5 100644 --- a/keyboards/fortitude60/keymaps/default/keymap.c +++ b/keyboards/fortitude60/keymaps/default/keymap.c @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | [ | ] | N | M | , | . | / |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_QWERTY] = LAYOUT( \ @@ -62,7 +62,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| Z | X | C | V | B | [ | ] | K | M | , | . | / |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_COLEMAK] = LAYOUT( \ @@ -83,7 +83,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+-------------+------+------+------+------+------+------| * | Shift| ; | Q | J | K | X | [ | ] | B | M | W | V | Z |Enter | * `-------------+------+------+------+------+------+------+------+------+------+------+-------------' - * | GUI | Ctrl |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | + * | GUI | Alt |Lower |Space | Ctrl |Enter |Space |Raise | Alt | GUI | * `---------------------------------------------------------------------' */ [_DVORAK] = LAYOUT( \ -- cgit v1.2.3 From 3b42cff51607171285754ced097392332b40b5fd Mon Sep 17 00:00:00 2001 From: Paul Massendari Date: Wed, 28 Nov 2018 16:56:34 +0100 Subject: Added Rick Roll to song lists (#4510) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🙂 --- quantum/audio/song_list.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/quantum/audio/song_list.h b/quantum/audio/song_list.h index e63616a994..9946084977 100644 --- a/quantum/audio/song_list.h +++ b/quantum/audio/song_list.h @@ -472,4 +472,34 @@ H__NOTE(_AS4), W__NOTE(_GS4), W__NOTE(_GS4), W__NOTE(_FS4), W__NOTE(_GS4), \ H__NOTE(_AS4), WD_NOTE(_DS4) +#define RICK_ROLL \ + Q__NOTE(_F4), \ + Q__NOTE(_G4), \ + Q__NOTE(_BF4), \ + Q__NOTE(_G4), \ + HD_NOTE(_D5), \ + HD_NOTE(_D5), \ + W__NOTE(_C5), \ + S__NOTE(_REST), \ + Q__NOTE(_F4), \ + Q__NOTE(_G4), \ + Q__NOTE(_BF4), \ + Q__NOTE(_G4), \ + HD_NOTE(_C5), \ + HD_NOTE(_C5), \ + W__NOTE(_BF4), \ + S__NOTE(_REST), \ + Q__NOTE(_F4), \ + Q__NOTE(_G4), \ + Q__NOTE(_BF4), \ + Q__NOTE(_G4), \ + W__NOTE(_BF4), \ + H__NOTE(_C5), \ + H__NOTE(_A4), \ + H__NOTE(_A4), \ + H__NOTE(_G4), \ + H__NOTE(_F4), \ + H__NOTE(_F4), \ + W__NOTE(_C5), \ + W__NOTE(_BF4), #endif -- cgit v1.2.3 From 8b85ec2a987d378fb95eea1468eadea70aec2cbf Mon Sep 17 00:00:00 2001 From: Giuseppe Rota Date: Wed, 28 Nov 2018 17:19:07 +0100 Subject: Add Extrakey support for Brightness up/down (#4477) --- docs/keycode.txt | 2 ++ docs/keycodes.md | 2 ++ docs/keycodes_basic.md | 2 ++ quantum/keymap_common.c | 2 +- tmk_core/common/keycode.h | 6 +++++- tmk_core/common/report.h | 7 ++++++- 6 files changed, 18 insertions(+), 3 deletions(-) diff --git a/docs/keycode.txt b/docs/keycode.txt index b2070f7117..bd93b0a941 100644 --- a/docs/keycode.txt +++ b/docs/keycode.txt @@ -209,6 +209,8 @@ KC_WWW_FORWARD KC_WFWD KC_WWW_STOP KC_WSTP KC_WWW_REFRESH KC_WREF KC_WWW_FAVORITES KC_WFAV +KC_BRIGHTNESS_UP KC_BRIU +KC_BRIGHTNESS_DOWN KC_BRID /* Mousekey */ KC_MS_UP KC_MS_U Mouse Cursor Up KC_MS_DOWN KC_MS_D Mouse Cursor Down diff --git a/docs/keycodes.md b/docs/keycodes.md index 1c5f46d6ec..75b01389c5 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -203,6 +203,8 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_WWW_FAVORITES` |`KC_WFAV` |Browser Favorites (Windows) | |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD` |Next Track (macOS) | |`KC_MEDIA_REWIND` |`KC_MRWD` |Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU` |Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID` |Brightness Down | ## [Quantum Keycodes](quantum_keycodes.md#qmk-keycodes) diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index ada9cc0e5a..9cc00f0325 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -219,6 +219,8 @@ Windows and macOS use different keycodes for "next track" and "previous track". |`KC_WWW_FAVORITES` |`KC_WFAV`|Browser Favorites (Windows) | |`KC_MEDIA_FAST_FORWARD`|`KC_MFFD`|Next Track (macOS) | |`KC_MEDIA_REWIND` |`KC_MRWD`|Previous Track (macOS) | +|`KC_BRIGHTNESS_UP` |`KC_BRIU`|Brightness Up | +|`KC_BRIGHTNESS_DOWN` |`KC_BRID`|Brightness Down | ## Number Pad diff --git a/quantum/keymap_common.c b/quantum/keymap_common.c index 50af15d626..f6c8b70d28 100644 --- a/quantum/keymap_common.c +++ b/quantum/keymap_common.c @@ -64,7 +64,7 @@ action_t action_for_key(uint8_t layer, keypos_t key) case KC_SYSTEM_POWER ... KC_SYSTEM_WAKE: action.code = ACTION_USAGE_SYSTEM(KEYCODE2SYSTEM(keycode)); break; - case KC_AUDIO_MUTE ... KC_MEDIA_REWIND: + case KC_AUDIO_MUTE ... KC_BRIGHTNESS_DOWN: action.code = ACTION_USAGE_CONSUMER(KEYCODE2CONSUMER(keycode)); break; case KC_MS_UP ... KC_MS_ACCEL2: diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index 61642ae84f..d6fef2bebf 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -33,7 +33,7 @@ along with this program. If not, see . #define IS_SPECIAL(code) ((0xA5 <= (code) && (code) <= 0xDF) || (0xE8 <= (code) && (code) <= 0xFF)) #define IS_SYSTEM(code) (KC_PWR <= (code) && (code) <= KC_WAKE) -#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_MRWD) +#define IS_CONSUMER(code) (KC_MUTE <= (code) && (code) <= KC_BRID) #define IS_FN(code) (KC_FN0 <= (code) && (code) <= KC_FN31) @@ -170,6 +170,8 @@ along with this program. If not, see . #define KC_WFAV KC_WWW_FAVORITES #define KC_MFFD KC_MEDIA_FAST_FORWARD #define KC_MRWD KC_MEDIA_REWIND +#define KC_BRIU KC_BRIGHTNESS_UP +#define KC_BRID KC_BRIGHTNESS_DOWN /* Mouse Keys */ #define KC_MS_U KC_MS_UP @@ -457,6 +459,8 @@ enum internal_special_keycodes { KC_WWW_FAVORITES, KC_MEDIA_FAST_FORWARD, KC_MEDIA_REWIND, + KC_BRIGHTNESS_UP, + KC_BRIGHTNESS_DOWN, /* Fn keys */ KC_FN0 = 0xC0, diff --git a/tmk_core/common/report.h b/tmk_core/common/report.h index 5a1a6b19c7..eb9afb727e 100644 --- a/tmk_core/common/report.h +++ b/tmk_core/common/report.h @@ -38,6 +38,7 @@ along with this program. If not, see . /* Consumer Page(0x0C) * following are supported by Windows: http://msdn.microsoft.com/en-us/windows/hardware/gg463372.aspx + * see also https://docs.microsoft.com/en-us/windows-hardware/drivers/hid/display-brightness-control */ #define AUDIO_MUTE 0x00E2 #define AUDIO_VOL_UP 0x00E9 @@ -47,6 +48,8 @@ along with this program. If not, see . #define TRANSPORT_STOP 0x00B7 #define TRANSPORT_STOP_EJECT 0x00CC #define TRANSPORT_PLAY_PAUSE 0x00CD +#define BRIGHTNESSUP 0x006F +#define BRIGHTNESSDOWN 0x0070 /* application launch */ #define AL_CC_CONFIG 0x0183 #define AL_EMAIL 0x018A @@ -189,7 +192,9 @@ typedef struct { (key == KC_WWW_FORWARD ? AC_FORWARD : \ (key == KC_WWW_STOP ? AC_STOP : \ (key == KC_WWW_REFRESH ? AC_REFRESH : \ - (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0))))))))))))))))))))) + (key == KC_BRIGHTNESS_UP ? BRIGHTNESSUP : \ + (key == KC_BRIGHTNESS_DOWN ? BRIGHTNESSDOWN : \ + (key == KC_WWW_FAVORITES ? AC_BOOKMARKS : 0))))))))))))))))))))))) uint8_t has_anykey(report_keyboard_t* keyboard_report); uint8_t get_first_key(report_keyboard_t* keyboard_report); -- cgit v1.2.3 From fff6f22cf652aeb601ea4901399b70fb9a3f757c Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 28 Nov 2018 08:51:16 -0800 Subject: Keyboard: handwired/bluepill Configurator support and readme cleanup (#4509) * handwired/bluepill/bluepill70: Configurator support * handwired/bluepill: readme cleanup Formatting fixes to make the file easier to read. --- keyboards/handwired/bluepill/bluepill70/info.json | 187 ++++++++++++++++++++++ keyboards/handwired/bluepill/readme.md | 20 +-- 2 files changed, 197 insertions(+), 10 deletions(-) create mode 100644 keyboards/handwired/bluepill/bluepill70/info.json diff --git a/keyboards/handwired/bluepill/bluepill70/info.json b/keyboards/handwired/bluepill/bluepill70/info.json new file mode 100644 index 0000000000..3f08b50e55 --- /dev/null +++ b/keyboards/handwired/bluepill/bluepill70/info.json @@ -0,0 +1,187 @@ +{ + "keyboard_name": "BluePill 70", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT_seventy_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Print Screen", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"Page Up", "x":15, "y":2}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":"'", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + {"label":"\\", "x":13.5, "y":2, "w":1.5}, + {"label":"Page Down", "x":15, "y":3}, + {"label":"Shift", "x":0, "y":4, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"TT(2)", "x":15, "y":4}, + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5}, + {"label":"Fn", "x":11, "y":5}, + {"label":"Ctrl", "x":12, "y":5}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + }, + "LAYOUT_seventy_iso": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"Print Screen", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Delete", "x":15, "y":1}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"Page Up", "x":15, "y":2}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":",", "x":11.75, "y":3}, + {"label":"ISO #", "x":12.75, "y":3}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"Page Down", "x":15, "y":3}, + {"label":"Shift", "x":0, "y":4, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"Shift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"TT(2)", "x":15, "y":4}, + {"label":"Ctrl", "x":0, "y":5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":6.25}, + {"label":"Alt", "x":10, "y":5}, + {"label":"Fn", "x":11, "y":5}, + {"label":"Ctrl", "x":12, "y":5}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/bluepill/readme.md b/keyboards/handwired/bluepill/readme.md index 8b53f12f46..b8ca96992c 100644 --- a/keyboards/handwired/bluepill/readme.md +++ b/keyboards/handwired/bluepill/readme.md @@ -3,15 +3,15 @@ Keyboards using a BluePill controller (generic Chinese STM32F103C8T6) and based on the [KC64 of Xydane](https://github.com/Xydane/qmk_firmware). -Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. -Hardware Supported: Bluepill STM32F103C8T6 +Keyboard Maintainer: [FPazos](https://github.com/fpazos), but I hope to leave the project in better hands. +Hardware Supported: Bluepill STM32F103C8T6 Hardware Availability: Everywhere Make example for BluePill70 (after setting up your build environment): -make handwired/bluepill/bluepill70:default + make handwired/bluepill/bluepill70:default -See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. +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). Read everything before using it. @@ -47,14 +47,14 @@ That's the pinout; A4 LCT| WIN| ALT| ESPACE | ALG| FN | RCT| LEF| DOW| RIG And the wiring: -ISO +ISO ![Wiring](https://i.imgur.com/ZCaxVzs.jpg) -ANSI +ANSI ![Wiring](https://i.imgur.com/dBUJCdD.jpg) -It also uses: +It also uses: PC13: Caps Lock led. -Backlight dual color leds, my version is for common anode that's more common, for leds with common anode just replace the palSetPad with palClearPad and viceversa. -PA1: Backlight color A. -PA0: Backlight color B. \ No newline at end of file +Backlight dual color leds, my version is for common anode that's more common, for leds with common anode just replace the palSetPad with palClearPad and viceversa. +PA1: Backlight color A. +PA0: Backlight color B. -- cgit v1.2.3 From 87e6d0137484fdc8e076eb79dbbed47836eba2c5 Mon Sep 17 00:00:00 2001 From: GO <44800276+GoTakigawa@users.noreply.github.com> Date: Thu, 29 Nov 2018 02:20:46 +0900 Subject: Keyboard: add newgame (#4466) * Add files via upload * Add files via upload * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/newgame40.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/keymaps/default/keymap.c Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/config.h Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/rules.mk Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/rules.mk Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Add readme (newgame40) * Update keyboards/newgame40/readme.md Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keyboards/newgame40/readme.md Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Update keymap.c * Update keyboards/newgame40/rules.mk Co-Authored-By: GoTakigawa <44800276+GoTakigawa@users.noreply.github.com> * Add files via upload * remove community/ortho_4x10 --- keyboards/newgame40/config.h | 75 ++++++++ keyboards/newgame40/info.json | 13 ++ keyboards/newgame40/keymaps/default/config.h | 5 + keyboards/newgame40/keymaps/default/keymap.c | 208 +++++++++++++++++++++ keyboards/newgame40/newgame40.c | 5 + keyboards/newgame40/newgame40.h | 19 ++ keyboards/newgame40/readme.md | 17 ++ keyboards/newgame40/rules.mk | 74 ++++++++ .../default/ortho_4x10/default_ortho_4x10/keymap.c | 10 + layouts/default/ortho_4x10/layout.json | 4 + layouts/default/ortho_4x10/readme.md | 3 + 11 files changed, 433 insertions(+) create mode 100644 keyboards/newgame40/config.h create mode 100644 keyboards/newgame40/info.json create mode 100644 keyboards/newgame40/keymaps/default/config.h create mode 100644 keyboards/newgame40/keymaps/default/keymap.c create mode 100644 keyboards/newgame40/newgame40.c create mode 100644 keyboards/newgame40/newgame40.h create mode 100644 keyboards/newgame40/readme.md create mode 100644 keyboards/newgame40/rules.mk create mode 100644 layouts/default/ortho_4x10/default_ortho_4x10/keymap.c create mode 100644 layouts/default/ortho_4x10/layout.json create mode 100644 layouts/default/ortho_4x10/readme.md diff --git a/keyboards/newgame40/config.h b/keyboards/newgame40/config.h new file mode 100644 index 0000000000..01c9142f77 --- /dev/null +++ b/keyboards/newgame40/config.h @@ -0,0 +1,75 @@ +/* +Copyright 2018 Go Takigawa + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER GoTakigawa +#define PRODUCT NEWGAME40 +#define DESCRIPTION 4x10key keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 10 + +/* pin-out */ +#define MATRIX_ROW_PINS { F7, B1, B3, B2 } +#define MATRIX_COL_PINS { D3, D2, D1, D0, D4, C6, D7, E6, B4, B5 } +#define UNUSED_PINS + +/* ws2812 RGB LED */ +#define RGB_DI_PIN F6 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 25 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#ifndef IOS_DEVICE_ENABLE + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 255 + #else + #define RGBLIGHT_LIMIT_VAL 130 + #endif + #define RGBLIGHT_VAL_STEP 17 +#else + #if RGBLED_NUM <= 6 + #define RGBLIGHT_LIMIT_VAL 90 + #else + #define RGBLIGHT_LIMIT_VAL 45 + #endif + #define RGBLIGHT_VAL_STEP 4 +#endif +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) + #define USB_MAX_POWER_CONSUMPTION 400 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +#define TAPPING_TERM 200 + diff --git a/keyboards/newgame40/info.json b/keyboards/newgame40/info.json new file mode 100644 index 0000000000..0239614082 --- /dev/null +++ b/keyboards/newgame40/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "NEWGAME40", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x10": { + "key_count": 40, + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}] + } + } +} diff --git a/keyboards/newgame40/keymaps/default/config.h b/keyboards/newgame40/keymaps/default/config.h new file mode 100644 index 0000000000..d533d806c9 --- /dev/null +++ b/keyboards/newgame40/keymaps/default/config.h @@ -0,0 +1,5 @@ + + +#pragma once + +// place overrides here diff --git a/keyboards/newgame40/keymaps/default/keymap.c b/keyboards/newgame40/keymaps/default/keymap.c new file mode 100644 index 0000000000..b42fef00fe --- /dev/null +++ b/keyboards/newgame40/keymaps/default/keymap.c @@ -0,0 +1,208 @@ +/* Copyright 2018 GoTakigawa + * + * 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 . + */ + + #include QMK_KEYBOARD_H + + extern keymap_config_t keymap_config; + +enum layers { + _QWERTY, + _COLEMAK, + _DVORAK, + _EUCALYN, + _LOWER, + _RAISE, + _ADJUST, +}; + + enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + EUCALYN, + ADJUST, + }; + + // Fillers to make layering more clear + #define LOWER MO(_LOWER) + #define RAISE MO(_RAISE) + + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,---------------------------------------------------------------------. + * | Q | W | E | R | T | Y | U | I | O | P | + * |------+------+------+------+------+------|------+------+------+------| + * | A | S | D | F | G | H | J | K | L | - | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | B | N | M | , | . | / | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_MINS, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Colemak + * ,---------------------------------------------------------------------. + * | Q | W | F | P | G | J | L | U | Y | - | + * |------+------+------+------+------+------|------+------+------+------| + * | A | R | S | T | D | H | N | E | I | O | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | B | K | M | , | . | / | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_MINS, \ + KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Dvorak + * ,---------------------------------------------------------------------. + * | " | , | . | P | Y | F | G | C | R | L | + * |------+------+------+------+------+------|------+------+------+------| + * | A | O | E | U | I | D | H | T | N | S | + * |------+------+------+------+------+------+-------------+------+------| + * | ; | Q | J | K | X | B | M | W | V | Z | + * |-------------+------+------+------+------+------+------+------+------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x10( \ + KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, \ + KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Lower + * ,---------------------------------------------------------------------. + * | Esc | | | | | | | | | | + * |------+------+------+------+------+------|------+------+------+------| + * | | | | | | | | | | | + * |------+------+------+------+------+------+-------------+------+------| + * | F13 | F14 | F15 | F16 | F17 | F18 | F19 | F20 | F21 | F22 | + * |-------------+------+------+------+------+------+------+------+------' + * | F1 | F2 | | F3 | F4 | F5 | F6 | | F7 | F8 | + * `---------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x10( \ + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, \ + KC_F1, KC_F2, _______, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_F7, KC_F8 \ + ), + + /* Raise + * ,---------------------------------------------------------------------. + * | 1 | 2 |  3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + * |------+------+------+------+------+------|------+------+------+------| + * | ! | " | # | $ | % | & | ' | (  | ) | _ | + * |------+------+------+------+------+------+-------------+------+------| + * | = | ¥ | { | } | * | ~ | | | < | > | ? | + * |-------------+------+------+------+------+------+------+------+------' + * | F1 | Alt | | [ | ] | ; | : | | \ | / | + * `---------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x10( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_EXLM, KC_DQT, KC_HASH, KC_DLR, KC_PERC, KC_AMPR, KC_QUOT, KC_LPRN, KC_RPRN, KC_UNDS, \ + KC_EQL, KC_JYEN, KC_LCBR, KC_RCBR, KC_ASTR, KC_TILD, KC_PIPE, KC_LABK, KC_RABK, KC_QUES, \ + KC_F1, KC_LALT, _______, KC_LBRC, KC_RBRC, KC_SCLN, KC_COLN, _______, KC_BSLS, KC_SLSH \ + ), + + /* EUCALYN + * ,---------------------------------------------------------------------. + * | Q | W | , | . | ; | M | R | D | Y | P | + * |------+------+------+------+------+------|------+------+------+------| + * | A | O | E | I | U | G | T | K | S | N | + * |------+------+------+------+------+------+-------------+------+------| + * | Z | X | C | V | F | B | H | J | L | / | + * `-------------+------+------+------+------+------+------+-------------' + * |Shift | GUI |Lower | Ctrl |Space | Bksp |Enter |Raise | Left |Right | + * `---------------------------------------------------------------------' + */ + [_EUCALYN] = LAYOUT_ortho_4x10( \ + KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, \ + KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, \ + KC_Z, KC_X, KC_C, KC_V, KC_F, KC_B, KC_H, KC_J, KC_L, KC_SLSH, \ + KC_LSFT, KC_LGUI, LT(_LOWER,KC_LANG2), KC_LCTL, KC_SPC, KC_BSPC, KC_ENT, LT(_RAISE,KC_LANG1), KC_LEFT, KC_RGHT\ + ), + + /* Adjust (Lower + Raise) + * ,---------------------------------------------------------------------. + * | |RGB Tg|RGB Md|Hue Up|Hue Dn|Sat Up|Sat Dn|Val Up|Val Dn| | + * |------+------+------+------+------+------.------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap| |BL TOG|BL STP| + * |------+------+------+------+------+------+------+------+------+------| + * |Qwerty|Colemk|Dvorak|Eucalyn| | | | | | | + * |------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | + * `---------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x10( \ + _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, _______, BL_TOGG, BL_STEP, \ + QWERTY, COLEMAK, DVORAK, EUCALYN, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ) + + + }; + + uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); + } + + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + case EUCALYN: + if (record->event.pressed) { + set_single_persistent_default_layer(_EUCALYN); + } + return false; + break; + } + return true; + } diff --git a/keyboards/newgame40/newgame40.c b/keyboards/newgame40/newgame40.c new file mode 100644 index 0000000000..e55b25b3d0 --- /dev/null +++ b/keyboards/newgame40/newgame40.c @@ -0,0 +1,5 @@ +#include "newgame40.h" + +void matrix_init_kb(void) { + matrix_init_user(); +} diff --git a/keyboards/newgame40/newgame40.h b/keyboards/newgame40/newgame40.h new file mode 100644 index 0000000000..6044f37657 --- /dev/null +++ b/keyboards/newgame40/newgame40.h @@ -0,0 +1,19 @@ +#ifndef NEWGAME40_H +#define NEWGAME40_H + +#include "quantum.h" + +#define LAYOUT_ortho_4x10( \ + k101, k102, k103, k104, k105, k106, k107, k108, k109, k110, \ + k201, k202, k203, k204, k205, k206, k207, k208, k209, k210, \ + k301, k302, k303, k304, k305, k306, k307, k308, k309, k310, \ + k401, k402, k403, k404, k405, k406, k407, k408, k409, k410 \ +) \ +{ \ + {k101, k102, k103, k104, k105, k106, k107, k108, k109, k110}, \ + {k201, k202, k203, k204, k205, k206, k207, k208, k209, k210}, \ + {k301, k302, k303, k304, k305, k306, k307, k308, k309, k310}, \ + {k401, k402, k403, k404, k405, k406, k407, k408, k409, k410} \ +} + +#endif diff --git a/keyboards/newgame40/readme.md b/keyboards/newgame40/readme.md new file mode 100644 index 0000000000..2aa568cfb0 --- /dev/null +++ b/keyboards/newgame40/readme.md @@ -0,0 +1,17 @@ +# NEWGAME40 + +![NEWGAME40](https://i.imgur.com/HtujXda.jpg) + +40% (4x10) ortholinear keyboard. + +Keyboard Maintainer: +[GoTakigawa](https://github.com/GoTakigawa) +[@Go_Drums](https://twitter.com/Go_Drums) +Hardware Supported: The NEWGAME40 PCBs, ProMicro supported +Hardware Availability: Group buy soon + +Make example for this keyboard (after setting up your build environment): + + make newgame40: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/newgame40/rules.mk b/keyboards/newgame40/rules.mk new file mode 100644 index 0000000000..cca40ce8e2 --- /dev/null +++ b/keyboards/newgame40/rules.mk @@ -0,0 +1,74 @@ +# MCU name +#MCU = at90usb1287 +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +BOOTLOADER = caterina + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 controls +AUDIO_ENABLE = no # Audio output on port C6 +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +IOS_DEVICE_ENABLE = no # connect to IOS Device + + ifeq ($(strip $(IOS_DEVICE_ENABLE )), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE + endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +LAYOUTS = ortho_4x10 diff --git a/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c new file mode 100644 index 0000000000..3f6285e2dd --- /dev/null +++ b/layouts/default/ortho_4x10/default_ortho_4x10/keymap.c @@ -0,0 +1,10 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x10( + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J, + KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, KC_G, KC_H, KC_I, KC_J + ) +}; diff --git a/layouts/default/ortho_4x10/layout.json b/layouts/default/ortho_4x10/layout.json new file mode 100644 index 0000000000..86f098e27e --- /dev/null +++ b/layouts/default/ortho_4x10/layout.json @@ -0,0 +1,4 @@ +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""], +["","","","","","","","","",""] diff --git a/layouts/default/ortho_4x10/readme.md b/layouts/default/ortho_4x10/readme.md new file mode 100644 index 0000000000..c5c29251c8 --- /dev/null +++ b/layouts/default/ortho_4x10/readme.md @@ -0,0 +1,3 @@ +# ortho_4x10 + + LAYOUT_ortho_4x10 -- cgit v1.2.3 From fbf59ba2e5a4ccd8842d044f7ffa75e91e1894cb Mon Sep 17 00:00:00 2001 From: Paul Massendari Date: Thu, 29 Nov 2018 16:33:45 +0100 Subject: Typo fix (#4515) --- docs/feature_unicode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index b1527b848a..c98a402287 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -30,7 +30,7 @@ Make sure that the order for both matches. ## UCIS_ENABLE -Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to main a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. +Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to maintain a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. For instance, you would need to have a table like this in your keymap: -- cgit v1.2.3 From 81ce35c10a89214a586773e013e647eeb701fee5 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Thu, 29 Nov 2018 07:57:06 -0800 Subject: New Keyboard: Cyclops (#4512) * initial commit * add correct atmega32u4 pins used * add a basic layout * add simple keymap * update readme * Add QMK Configurator support * add whitespace for formatting --- keyboards/cyclops/config.h | 214 ++++++++++++++++++++++++++++ keyboards/cyclops/cyclops.c | 43 ++++++ keyboards/cyclops/cyclops.h | 43 ++++++ keyboards/cyclops/info.json | 12 ++ keyboards/cyclops/keymaps/default/config.h | 19 +++ keyboards/cyclops/keymaps/default/keymap.c | 65 +++++++++ keyboards/cyclops/keymaps/default/readme.md | 1 + keyboards/cyclops/readme.md | 13 ++ keyboards/cyclops/rules.mk | 80 +++++++++++ 9 files changed, 490 insertions(+) create mode 100644 keyboards/cyclops/config.h create mode 100644 keyboards/cyclops/cyclops.c create mode 100644 keyboards/cyclops/cyclops.h create mode 100644 keyboards/cyclops/info.json create mode 100644 keyboards/cyclops/keymaps/default/config.h create mode 100644 keyboards/cyclops/keymaps/default/keymap.c create mode 100644 keyboards/cyclops/keymaps/default/readme.md create mode 100644 keyboards/cyclops/readme.md create mode 100644 keyboards/cyclops/rules.mk diff --git a/keyboards/cyclops/config.h b/keyboards/cyclops/config.h new file mode 100644 index 0000000000..d6b637345e --- /dev/null +++ b/keyboards/cyclops/config.h @@ -0,0 +1,214 @@ +/* +Copyright 2018 'mechmerlin' + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0000 +#define DEVICE_VER 0x0001 +#define MANUFACTURER You +#define PRODUCT cyclops +#define DESCRIPTION A custom 66% keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, D7, B4, F0 } +#define MATRIX_COL_PINS { D3, D2, D5, D6, B6, B1, B2, B3, C6, C7, F7, F6, F4, F5, F1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/cyclops/cyclops.c b/keyboards/cyclops/cyclops.c new file mode 100644 index 0000000000..8a15e8950e --- /dev/null +++ b/keyboards/cyclops/cyclops.c @@ -0,0 +1,43 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 . + */ +#include "cyclops.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/cyclops/cyclops.h b/keyboards/cyclops/cyclops.h new file mode 100644 index 0000000000..d85b4e9031 --- /dev/null +++ b/keyboards/cyclops/cyclops.h @@ -0,0 +1,43 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 . + */ +#ifndef CYCLOPS_H +#define CYCLOPS_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ +} + +#endif diff --git a/keyboards/cyclops/info.json b/keyboards/cyclops/info.json new file mode 100644 index 0000000000..e0e91222bc --- /dev/null +++ b/keyboards/cyclops/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "cyclops", + "url": "", + "maintainer": "qmk", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Page Up", "x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Page Down", "x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":"|", "x":1.5, "y":3}, {"label":"Z", "x":2.5, "y":3}, {"label":"X", "x":3.5, "y":3}, {"label":"C", "x":4.5, "y":3}, {"label":"V", "x":5.5, "y":3}, {"label":"B", "x":6.5, "y":3}, {"label":"N", "x":7.5, "y":3}, {"label":"M", "x":8.5, "y":3}, {"label":"<", "x":9.5, "y":3}, {"label":">", "x":10.5, "y":3}, {"label":"?", "x":11.5, "y":3}, {"x":12.5, "y":3}, {"label":"Shift", "x":13.5, "y":3}, {"label":"\u2191", "x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4, "w":1.25}, {"label":"Alt", "x":2.75, "y":4, "w":1.5}, {"x":4.25, "y":4, "w":6.5}, {"label":"Alt", "x":10.75, "y":4, "w":1.5}, {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13.5, "y":4}, {"label":"\u2193", "x":14.5, "y":4}, {"label":"\u2192", "x":15.5, "y":4}] + } + } +} diff --git a/keyboards/cyclops/keymaps/default/config.h b/keyboards/cyclops/keymaps/default/config.h new file mode 100644 index 0000000000..6278fae658 --- /dev/null +++ b/keyboards/cyclops/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 + +// place overrides here diff --git a/keyboards/cyclops/keymaps/default/keymap.c b/keyboards/cyclops/keymaps/default/keymap.c new file mode 100644 index 0000000000..875fbe244f --- /dev/null +++ b/keyboards/cyclops/keymaps/default/keymap.c @@ -0,0 +1,65 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( + KC_ESC, 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_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_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_RGHT, + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1), KC_0, KC_UP, + KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_ENT, KC_DOWN), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/cyclops/keymaps/default/readme.md b/keyboards/cyclops/keymaps/default/readme.md new file mode 100644 index 0000000000..b1e2b84a3b --- /dev/null +++ b/keyboards/cyclops/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cyclops diff --git a/keyboards/cyclops/readme.md b/keyboards/cyclops/readme.md new file mode 100644 index 0000000000..fcf6c15466 --- /dev/null +++ b/keyboards/cyclops/readme.md @@ -0,0 +1,13 @@ +# Cyclops + +66% Alps Keyboard in ISO layout. + +Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) +Hardware Supported: 66% Alps Keyboard +Hardware Availability: A very limited number were made. + +Make example for this keyboard (after setting up your build environment): + + make cyclops: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/cyclops/rules.mk b/keyboards/cyclops/rules.mk new file mode 100644 index 0000000000..bc370be039 --- /dev/null +++ b/keyboards/cyclops/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # 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) -- cgit v1.2.3 From b10aad45b60326c7e9f2d1fc67e45bd201341552 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 30 Nov 2018 00:14:55 -0500 Subject: Test out i18n of the docs (#4519) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph --- docs/zh-cn/README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 docs/zh-cn/README.md diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md new file mode 100644 index 0000000000..bb9d1371f1 --- /dev/null +++ b/docs/zh-cn/README.md @@ -0,0 +1,32 @@ +# QMK鍵盤固件 + +[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什麼是QMK固件? + +QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 + +## 如何得到QMK + +如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 + +否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 + +## 如何編譯 + +你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 + + make planck/rev4:default + +這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: + + make preonic:default + +## 如何赶近 + +QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 -- cgit v1.2.3 From d7f1e072a859d7fcbaccd675b4bad7d02d214e52 Mon Sep 17 00:00:00 2001 From: Wilba Date: Sat, 1 Dec 2018 03:43:34 +1100 Subject: Added macros to Dynamic Keymaps, Zeal60 RGB backlight improvements (#4520) * Refactored M6-B to use Zeal60 RGB backlight code * Fixed M6-B LED co-ordinates * Minor changes to RGB config for Zeal65 * Added dynamic keymaps to WT80-A, WT60-A, WT-80A, U80-A * Macro implementation * Implemented macros, API protocol version 8, RGB backlight fixes * Improved radial effects for M6-B * Fixed undefined references when building an RGB keyboard after M6-A --- keyboards/rama/m60_a/config.h | 13 ++-- keyboards/rama/m60_a/rules.mk | 4 +- keyboards/rama/m6_a/config.h | 14 +++- keyboards/rama/m6_a/rules.mk | 2 +- keyboards/rama/m6_b/config.h | 11 ++- keyboards/rama/m6_b/rules.mk | 4 +- keyboards/rama/u80_a/config.h | 10 ++- keyboards/wilba_tech/wt60_a/config.h | 12 +-- keyboards/wilba_tech/wt65_a/config.h | 12 +-- keyboards/wilba_tech/wt80_a/config.h | 12 +-- keyboards/wilba_tech/wt_main.c | 92 ++++++++++++++++++++-- keyboards/zeal60/config.h | 10 ++- keyboards/zeal60/rgb_backlight.c | 131 ++++++++++++++++++++++++++----- keyboards/zeal60/rgb_backlight.h | 25 ++++-- keyboards/zeal60/rgb_backlight_api.h | 3 +- keyboards/zeal60/zeal60.c | 88 +++++++++++++++------ keyboards/zeal60/zeal60_api.h | 10 ++- keyboards/zeal60/zeal60_keycodes.h | 18 ++++- keyboards/zeal65/config.h | 10 ++- keyboards/zeal65/rules.mk | 4 +- quantum/dynamic_keymap.c | 147 ++++++++++++++++++++++++++++++++++- quantum/dynamic_keymap.h | 35 +++++++++ 22 files changed, 561 insertions(+), 106 deletions(-) diff --git a/keyboards/rama/m60_a/config.h b/keyboards/rama/m60_a/config.h index 03794965fc..01cfe05a5f 100644 --- a/keyboards/rama/m60_a/config.h +++ b/keyboards/rama/m60_a/config.h @@ -31,7 +31,7 @@ #define MATRIX_ROWS 5 #define MATRIX_COLS 14 -// Zeal60 PCB default pin-out +// M60-A PCB default pin-out #define MATRIX_ROW_PINS { F0, F1, F4, F6, F7 } #define MATRIX_COL_PINS { F5, D5, B1, B2, B3, D3, D2, C7, C6, B6, B5, B4, D7, D6 } #define UNUSED_PINS @@ -118,11 +118,14 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/rama/m60_a/rules.mk b/keyboards/rama/m60_a/rules.mk index 9c1a2d9df7..09ed03e951 100644 --- a/keyboards/rama/m60_a/rules.mk +++ b/keyboards/rama/m60_a/rules.mk @@ -1,8 +1,8 @@ # project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3731.c \ drivers/avr/i2c_master.c diff --git a/keyboards/rama/m6_a/config.h b/keyboards/rama/m6_a/config.h index 63da792745..049749bd7d 100644 --- a/keyboards/rama/m6_a/config.h +++ b/keyboards/rama/m6_a/config.h @@ -119,11 +119,17 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 +// NOTE: M6-A doesn't use RGB backlight, but we keep this +// consistent with M6-B which does. + // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - +// Dynamic keymap starts after backlight config (35+43) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 78 +// Dynamic macro starts after dynamic keymaps (78+(4*6*2)) = (78+48) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 126 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 898 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/rama/m6_a/rules.mk b/keyboards/rama/m6_a/rules.mk index ff17069182..399e9e80d6 100644 --- a/keyboards/rama/m6_a/rules.mk +++ b/keyboards/rama/m6_a/rules.mk @@ -1,5 +1,5 @@ # project specific files -SRC = ../zeal60/zeal60.c +SRC = keyboards/zeal60/zeal60.c # MCU name MCU = atmega32u4 diff --git a/keyboards/rama/m6_b/config.h b/keyboards/rama/m6_b/config.h index c016703e04..67034ef8ce 100644 --- a/keyboards/rama/m6_b/config.h +++ b/keyboards/rama/m6_b/config.h @@ -150,11 +150,14 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 - +// Dynamic keymap starts after backlight config (35+43) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 78 +// Dynamic macro starts after dynamic keymaps (78+(4*6*2)) = (78+48) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 126 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 898 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/rama/m6_b/rules.mk b/keyboards/rama/m6_b/rules.mk index 1a7466af37..b7a76b8ddd 100644 --- a/keyboards/rama/m6_b/rules.mk +++ b/keyboards/rama/m6_b/rules.mk @@ -1,6 +1,6 @@ # project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3218.c \ drivers/avr/i2c_master.c diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index 9c74735ad5..b5dc27598a 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -198,7 +198,9 @@ #define EEPROM_VERSION 0x07 #define EEPROM_VERSION_ADDR 34 -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*17*2)) = (35+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 851 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 173 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 26f9ed2ba4..8c18582a88 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -195,10 +195,12 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*14*2)) = (35+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 595 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 429 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index 5f535c6a79..88e9023539 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -195,10 +195,12 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*5*15*2)) = (35+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 635 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 389 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index f78ce7fb34..ca03c366e9 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -195,10 +195,12 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 -// Backlight config starts after EEPROM version -#define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*6*17*2)) = (35+816) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 851 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 173 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index 23f07d7eb1..de6d7b92c1 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -17,6 +17,7 @@ #include "quantum.h" #include "keyboards/wilba_tech/wt_mono_backlight.h" #include "keyboards/zeal60/zeal60_api.h" // Temporary hack +#include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack #include "raw_hid.h" #include "dynamic_keymap.h" @@ -91,22 +92,57 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) dynamic_keymap_reset(); break; } -#endif // DYNAMIC_KEYMAP_ENABLE - case id_backlight_config_set_value: + case id_dynamic_keymap_macro_get_count: + { + command_data[0] = dynamic_keymap_macro_get_count(); + break; + } + case id_dynamic_keymap_macro_get_buffer_size: + { + uint16_t size = dynamic_keymap_macro_get_buffer_size(); + command_data[0] = size >> 8; + command_data[1] = size & 0xFF; + break; + } + case id_dynamic_keymap_macro_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_reset: + { + dynamic_keymap_macro_reset(); + break; + } + case id_dynamic_keymap_get_layer_count: { - //backlight_config_set_value(command_data); + command_data[0] = dynamic_keymap_get_layer_count(); break; } - case id_backlight_config_get_value: + case id_dynamic_keymap_get_buffer: { - //backlight_config_get_value(command_data); + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_get_buffer( offset, size, &command_data[3] ); break; } - case id_backlight_config_save: + case id_dynamic_keymap_set_buffer: { - //backlight_config_save(); + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_set_buffer( offset, size, &command_data[3] ); break; } +#endif // DYNAMIC_KEYMAP_ENABLE case id_eeprom_reset: { eeprom_reset(); @@ -151,6 +187,8 @@ void main_init(void) #ifdef DYNAMIC_KEYMAP_ENABLE // This resets the keymaps in EEPROM to what is in flash. dynamic_keymap_reset(); + // This resets the macros in EEPROM to nothing. + dynamic_keymap_macro_reset(); #endif // Save the magic number last, in case saving was interrupted eeprom_set_valid(true); @@ -196,3 +234,43 @@ void matrix_scan_kb(void) backlight_update_pwm_buffers(); matrix_scan_user(); } + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) +{ + switch(keycode) { + case FN_MO13: + if (record->event.pressed) { + layer_on(1); + update_tri_layer(1, 2, 3); + } else { + layer_off(1); + update_tri_layer(1, 2, 3); + } + return false; + break; + case FN_MO23: + if (record->event.pressed) { + layer_on(2); + update_tri_layer(1, 2, 3); + } else { + layer_off(2); + update_tri_layer(1, 2, 3); + } + return false; + break; + } + +#ifdef DYNAMIC_KEYMAP_ENABLE + // Handle macros + if (record->event.pressed) { + if ( keycode >= MACRO00 && keycode <= MACRO15 ) + { + uint8_t id = keycode - MACRO00; + dynamic_keymap_macro_send(id); + return false; + } + } +#endif //DYNAMIC_KEYMAP_ENABLE + + return process_record_user(keycode, record); +} diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h index baa4978a83..d1bd3f6a1a 100644 --- a/keyboards/zeal60/config.h +++ b/keyboards/zeal60/config.h @@ -115,11 +115,15 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*14*2)) = (66+560) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 626 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 398 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/zeal60/rgb_backlight.c b/keyboards/zeal60/rgb_backlight.c index c3dade123c..64b95059e1 100644 --- a/keyboards/zeal60/rgb_backlight.c +++ b/keyboards/zeal60/rgb_backlight.c @@ -15,9 +15,9 @@ */ #if RGB_BACKLIGHT_ENABLED -#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) +#if defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_ZEAL65) || defined (RGB_BACKLIGHT_M60_A) || defined(RGB_BACKLIGHT_M6_B) || defined(RGB_BACKLIGHT_KOYU) #else -#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B +#error None of the following was defined: RGB_BACKLIGHT_ZEAL60, RGB_BACKLIGHT_ZEAL65, RGB_BACKLIGHT_M60_A, RGB_BACKLIGHT_M6_B, RGB_BACKLIGHT_KOYU #endif #include "quantum.h" @@ -55,18 +55,21 @@ backlight_config g_config = { .brightness = 255, .effect = RGB_BACKLIGHT_EFFECT, .effect_speed = 0, - .color_1 = { .h = 0, .s = 255, .v = 255 }, - .color_2 = { .h = 127, .s = 255, .v = 255 }, - .caps_lock_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_1_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_2_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, - .layer_3_indicator = { .color = { .h = 0, .s = 0, .v = 255 }, .index = 255 }, + .color_1 = { .h = 0, .s = 255 }, + .color_2 = { .h = 127, .s = 255 }, + .caps_lock_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, + .layer_1_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, + .layer_2_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, + .layer_3_indicator = { .color = { .h = 0, .s = 0 }, .index = 255 }, .alphas_mods = { RGB_BACKLIGHT_ALPHAS_MODS_ROW_0, RGB_BACKLIGHT_ALPHAS_MODS_ROW_1, RGB_BACKLIGHT_ALPHAS_MODS_ROW_2, RGB_BACKLIGHT_ALPHAS_MODS_ROW_3, - RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 } + RGB_BACKLIGHT_ALPHAS_MODS_ROW_4 }, +#if defined(RGB_BACKLIGHT_M6_B) + .custom_color = { { 0, 255 }, { 43, 255 }, { 85, 255 }, { 128, 255 }, { 171, 255 }, { 213, 255 } } +#endif }; bool g_suspend_state = false; @@ -199,7 +202,7 @@ const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { }; const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { // LA0..LA17 - {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,247}, + {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,243}, {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, // LB0..LB17 {56,255}, {51,255}, {46,255}, {42,255}, {37,255}, {35,255}, {32,255}, {19,255}, {0,255}, @@ -208,8 +211,37 @@ const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { {184,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {255,255}, {167,255}, {165,255}, {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {145,233}, {148,255}, {161,255}, // LD0..LD17 - {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {255,201}, {224,181}, {230,217}, {235,255}, - {189,128}, {200,131}, {210,141}, {218,159}, {201,228}, {201,228}, {206,255}, {213,255}, {218,255} + {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255}, + {189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {201,228}, {206,255}, {213,255}, {218,255} +}; +#elif defined (RGB_BACKLIGHT_KOYU) +const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {120,16}, {104,16}, {88,16}, {72,16}, {56,16}, {40,16}, {24,16}, {4,16}, {4,32}, + {128,0}, {112,0}, {96,0}, {80,0}, {64,0}, {48,0}, {32,0}, {16,0}, {0,0}, + // LB0..LB17 + {144,0}, {160,0}, {176,0}, {192,0}, {208,0}, {224,0}, {240,0}, {240,16}, {240,32}, + {136,16}, {152,16}, {168,16}, {184,16}, {200,16}, {220,16}, {240,48}, {240,64}, {224,64}, + // LC0..LC17 + {112,64}, {100,48}, {84,48}, {68,48}, {52,48}, {36,48}, {64,60}, {44,60}, {24,64}, + {108,32}, {92,32}, {76,32}, {60,32}, {44,32}, {28,32}, {255,255}, {10,48}, {4,64}, + // LD0..LD17 + {124,32}, {140,32}, {156,32}, {172,32}, {188,32}, {214,32}, {180,48}, {202,48}, {224,48}, + {116,48}, {132,48}, {148,48}, {164,48}, {255,255}, {160,60}, {180,64}, {208,64}, {255,255} +}; +const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { + // LA0..LA17 + {64,128}, {75,132}, {84,145}, {91,164}, {97,187}, {102,213}, {105,242}, {109,255}, {128,243}, + {61,255}, {67,255}, {72,255}, {77,255}, {82,255}, {86,255}, {90,255}, {93,255}, {96,255}, + // LB0..LB17 + {56,255}, {51,255}, {46,255}, {42,255}, {38,255}, {35,255}, {32,255}, {19,255}, {0,255}, + {53,132}, {44,145}, {37,164}, {31,187}, {26,213}, {22,249}, {237,255}, {224,255}, {221,255}, + // LC0..LC17 + {189,255}, {179,135}, {170,149}, {163,169}, {157,193}, {153,220}, {172,252}, {169,255}, {165,255}, + {128,26}, {128,60}, {128,94}, {128,128}, {128,162}, {128,196}, {255,255}, {148,255}, {161,255}, + // LD0..LD17 + {0,9}, {0,43}, {0,77}, {0,111}, {0,145}, {0,201}, {224,181}, {230,217}, {235,255}, + {189,128}, {200,131}, {210,141}, {218,159}, {255,255}, {207,238}, {211,255}, {218,255}, {255,255} }; #elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { @@ -248,7 +280,7 @@ const Point g_map_led_to_point[BACKLIGHT_LED_COUNT] PROGMEM = { {0,0}, {0,16}, {16,16}, {16,0}, {32,16}, {32,0} }; const Point g_map_led_to_point_polar[BACKLIGHT_LED_COUNT] PROGMEM = { - {0,0}, {0,16}, {16,16}, {16,0}, {32,16}, {32,0} + {160,255}, {96,255}, {77,255}, {179,255}, {51,255}, {205,255} }; #endif @@ -318,7 +350,7 @@ void map_led_to_point_polar( uint8_t index, Point *point ) #if defined (RGB_BACKLIGHT_ZEAL65) -// Note: Left spacebar stab is at 4,3 (LC7) +// Note: Left spacebar stab is at 4,2 (LC7) // Right spacebar stab is at 4,9 (D14) // // A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 @@ -333,6 +365,22 @@ const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, { 36+17, 36+8, 36+7, 255, 255, 255, 255, 36+0, 255, 54+14, 54+15, 54+16, 54+17, 18+17, 18+16 } }; +#elif defined(RGB_BACKLIGHT_KOYU) +// Note: Left spacebar stab is at 4,4 (LC6) +// Right spacebar stab is at 4,10 (D14) +// +// A17, A16, A15, A14, A13, A12, A11, A10, A9, B0, B1, B2, B3, B4, B6 +// A7, A6, A5, A4, A3, A2, A1, A0, B9, B10, B11, B12, B13, B14, B7 +// A8, C14, C13, C12, C11, C10, C9, D0, D1, D2, D3, D4, D5, B5, B8 +// C16, C15, C5, C4, C3, C2, C1, D9, D10, D11, D12, D6, D7, D8, B15 +// C17, C8, C7, C6, ---, ---, ---, C0, ---, ---, D14, D15, D16, B17, B16 +const uint8_t g_map_row_column_to_led[MATRIX_ROWS][MATRIX_COLS] PROGMEM = { + { 0+17, 0+16, 0+15, 0+14, 0+13, 0+12, 0+11, 0+10, 0+9, 18+0, 18+1, 18+2, 18+3, 18+4, 18+6 }, + { 0+7, 0+6, 0+5, 0+4, 0+3, 0+2, 0+1, 0+0, 18+9, 18+10, 18+11, 18+12, 18+13, 18+14, 18+7 }, + { 0+8, 36+14, 36+13, 36+12, 36+11, 36+10, 36+9, 54+0, 54+1, 54+2, 54+3, 54+4, 54+5, 18+5, 18+8 }, + { 36+16, 36+15, 36+5, 36+4, 36+3, 36+2, 36+1, 54+9, 54+10, 54+11, 54+12, 54+6, 54+7, 54+8, 18+15 }, + { 36+17, 36+8, 36+7, 36+6, 255, 255, 255, 36+0, 255, 255, 54+14, 54+15, 54+16, 18+17, 18+16 } +}; #elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) // Note: Left spacebar stab is at 4,3 (LC6) // Right spacebar stab is at 4,9 (LD13) or 4,10 (LD14) @@ -781,8 +829,24 @@ void backlight_effect_cycle_radial2(void) } } -void backlight_effect_indicators_set_colors( uint8_t index, HSV hsv ) +#if defined(RGB_BACKLIGHT_M6_B) +void backlight_effect_custom_colors(void) { + RGB rgb; + for ( uint8_t i = 0; i < 6; i++ ) + { + HSV hsv = { .h = g_config.custom_color[i].h, .s = g_config.custom_color[i].s, .v = g_config.brightness }; + rgb = hsv_to_rgb( hsv ); + uint8_t led; + map_row_column_to_led( 0, i, &led ); + backlight_set_color( led, rgb.r, rgb.g, rgb.b ); + } +} +#endif + +void backlight_effect_indicators_set_colors( uint8_t index, HS color ) +{ + HSV hsv = { .h = color.h, .s = color.s, .v = g_config.brightness }; RGB rgb = hsv_to_rgb( hsv ); if ( index == 254 ) { @@ -799,6 +863,9 @@ void backlight_effect_indicators_set_colors( uint8_t index, HSV hsv ) #if defined (RGB_BACKLIGHT_ZEAL65) backlight_set_color( 36+7, rgb.r, rgb.g, rgb.b ); // LC7 backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 +#elif defined (RGB_BACKLIGHT_KOYU) + backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 + backlight_set_color( 54+14, rgb.r, rgb.g, rgb.b ); // LD14 #elif defined (RGB_BACKLIGHT_ZEAL60) || defined (RGB_BACKLIGHT_M60_A) backlight_set_color( 36+6, rgb.r, rgb.g, rgb.b ); // LC6 backlight_set_color( 54+13, rgb.r, rgb.g, rgb.b ); // LD13 @@ -911,7 +978,11 @@ ISR(TIMER3_COMPA_vect) backlight_effect_solid_color(); break; case 2: +#if defined(RGB_BACKLIGHT_M6_B) + backlight_effect_custom_colors(); +#else backlight_effect_alphas_mods(); +#endif break; case 3: backlight_effect_gradient_up_down(); @@ -989,18 +1060,16 @@ void backlight_get_indicator_row_col( uint8_t index, uint8_t *row, uint8_t *colu } // Some helpers for setting/getting HSV -void _set_color( HSV *color, uint8_t *data ) +void _set_color( HS *color, uint8_t *data ) { color->h = data[0]; color->s = data[1]; - color->v = data[2]; } -void _get_color( HSV *color, uint8_t *data ) +void _get_color( HS *color, uint8_t *data ) { data[0] = color->h; data[1] = color->s; - data[2] = color->v; } void backlight_config_set_value( uint8_t *data ) @@ -1132,6 +1201,16 @@ void backlight_config_set_value( uint8_t *data ) g_config.alphas_mods[i] = ( *(value_data+i*2) << 8 ) | ( *(value_data+i*2+1) ); } } +#if defined(RGB_BACKLIGHT_M6_B) + case id_custom_color: + { + uint8_t index = value_data[0]; + if ( index >= 0 && index <= 6 ) + { + _set_color( &(g_config.custom_color[index]), &(value_data[1]) ); + } + } +#endif } if ( reinitialize ) @@ -1259,6 +1338,16 @@ void backlight_config_get_value( uint8_t *data ) *(value_data+i*2+1) = g_config.alphas_mods[i] & 0xFF; } } +#if defined(RGB_BACKLIGHT_M6_B) + case id_custom_color: + { + uint8_t index = value_data[0]; + if ( index >= 0 && index <= 6 ) + { + _get_color( &(g_config.custom_color[index]), &(value_data[1]) ); + } + } +#endif } } @@ -1301,6 +1390,10 @@ void backlight_init_drivers(void) bool enabled = !( ( index == 18+5 && !g_config.use_split_backspace ) || // LB5 ( index == 36+6 ) || // LC6 ( index == 54+13 ) ); // LD13 +#elif defined (RGB_BACKLIGHT_KOYU) + bool enabled = !( ( index == 36+15 ) || // LC15 + ( index == 54+13 ) || // LD13 + ( index == 54+17 ) ); // LD17 #elif defined (RGB_BACKLIGHT_M60_A) bool enabled = !( // LB6 LB7 LB8 LB15 LB16 LB17 not present on M60-A diff --git a/keyboards/zeal60/rgb_backlight.h b/keyboards/zeal60/rgb_backlight.h index 60f2ace51a..aa24e3491d 100644 --- a/keyboards/zeal60/rgb_backlight.h +++ b/keyboards/zeal60/rgb_backlight.h @@ -25,9 +25,15 @@ #include "quantum/color.h" +typedef struct PACKED +{ + uint8_t h; + uint8_t s; +} HS; + typedef struct { - HSV color; + HS color; uint8_t index; } backlight_config_indicator; @@ -45,14 +51,17 @@ typedef struct uint8_t brightness; // 1 byte uint8_t effect; // 1 byte uint8_t effect_speed; // 1 byte - HSV color_1; // 3 bytes - HSV color_2; // 3 bytes - backlight_config_indicator caps_lock_indicator; // 4 bytes - backlight_config_indicator layer_1_indicator; // 4 bytes - backlight_config_indicator layer_2_indicator; // 4 bytes - backlight_config_indicator layer_3_indicator; // 4 bytes + HS color_1; // 2 bytes + HS color_2; // 2 bytes + backlight_config_indicator caps_lock_indicator; // 3 bytes + backlight_config_indicator layer_1_indicator; // 3 bytes + backlight_config_indicator layer_2_indicator; // 3 bytes + backlight_config_indicator layer_3_indicator; // 3 bytes uint16_t alphas_mods[5]; // 10 bytes -} backlight_config; // = 37 bytes +#if defined(RGB_BACKLIGHT_M6_B) + HS custom_color[6]; // 12 bytes +#endif +} backlight_config; // = 31 bytes (M6-B = 43 bytes) void backlight_config_load(void); void backlight_config_save(void); diff --git a/keyboards/zeal60/rgb_backlight_api.h b/keyboards/zeal60/rgb_backlight_api.h index 01827e849f..680ba4d99c 100644 --- a/keyboards/zeal60/rgb_backlight_api.h +++ b/keyboards/zeal60/rgb_backlight_api.h @@ -38,5 +38,6 @@ enum backlight_config_value id_layer_2_indicator_row_col = 0x13, id_layer_3_indicator_color = 0x14, id_layer_3_indicator_row_col = 0x15, - id_alphas_mods = 0x16 + id_alphas_mods = 0x16, + id_custom_color = 0x17 }; diff --git a/keyboards/zeal60/zeal60.c b/keyboards/zeal60/zeal60.c index b3b5d03fd0..5f93c571ad 100644 --- a/keyboards/zeal60/zeal60.c +++ b/keyboards/zeal60/zeal60.c @@ -94,6 +94,56 @@ void raw_hid_receive( uint8_t *data, uint8_t length ) dynamic_keymap_reset(); break; } + case id_dynamic_keymap_macro_get_count: + { + command_data[0] = dynamic_keymap_macro_get_count(); + break; + } + case id_dynamic_keymap_macro_get_buffer_size: + { + uint16_t size = dynamic_keymap_macro_get_buffer_size(); + command_data[0] = size >> 8; + command_data[1] = size & 0xFF; + break; + } + case id_dynamic_keymap_macro_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_macro_set_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_macro_reset: + { + dynamic_keymap_macro_reset(); + break; + } + case id_dynamic_keymap_get_layer_count: + { + command_data[0] = dynamic_keymap_get_layer_count(); + break; + } + case id_dynamic_keymap_get_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_get_buffer( offset, size, &command_data[3] ); + break; + } + case id_dynamic_keymap_set_buffer: + { + uint16_t offset = ( command_data[0] << 8 ) | command_data[1]; + uint16_t size = command_data[2]; // size <= 28 + dynamic_keymap_set_buffer( offset, size, &command_data[3] ); + break; + } #endif // DYNAMIC_KEYMAP_ENABLE #if RGB_BACKLIGHT_ENABLED case id_backlight_config_set_value: @@ -160,6 +210,8 @@ void main_init(void) #ifdef DYNAMIC_KEYMAP_ENABLE // This resets the keymaps in EEPROM to what is in flash. dynamic_keymap_reset(); + // This resets the macros in EEPROM to nothing. + dynamic_keymap_macro_reset(); #endif // Save the magic number last, in case saving was interrupted eeprom_set_valid(true); @@ -238,7 +290,19 @@ bool process_record_kb(uint16_t keycode, keyrecord_t *record) return false; break; } - + +#ifdef DYNAMIC_KEYMAP_ENABLE + // Handle macros + if (record->event.pressed) { + if ( keycode >= MACRO00 && keycode <= MACRO15 ) + { + uint8_t id = keycode - MACRO00; + dynamic_keymap_macro_send(id); + return false; + } + } +#endif //DYNAMIC_KEYMAP_ENABLE + return process_record_user(keycode, record); } @@ -263,28 +327,6 @@ uint16_t keymap_function_id_to_action( uint16_t function_id ) } } -#if USE_KEYMAPS_IN_EEPROM - -#if 0 - // This is how to implement actions stored in EEPROM. - // Not yet implemented. Not sure if it's worth the trouble - // before we have a nice GUI for keymap editing. - if ( eeprom_is_valid() && - function_id < 32 ) // TODO: replace magic number - { - uint16_t action = keymap_action_load(function_id); - - // If action is not "empty", return it, otherwise - // drop down to return the one in flash - if ( action != 0x0000 ) // TODO: replace magic number - { - return action; - } - } -#endif - -#endif // USE_KEYMAPS_IN_EEPROM - return pgm_read_word(&fn_actions[function_id]); } diff --git a/keyboards/zeal60/zeal60_api.h b/keyboards/zeal60/zeal60_api.h index a65bf2f509..8061146fde 100644 --- a/keyboards/zeal60/zeal60_api.h +++ b/keyboards/zeal60/zeal60_api.h @@ -15,7 +15,7 @@ */ #pragma once -#define PROTOCOL_VERSION 0x0007 +#define PROTOCOL_VERSION 0x0008 enum zeal60_command_id { @@ -30,6 +30,14 @@ enum zeal60_command_id id_backlight_config_save, id_eeprom_reset, id_bootloader_jump, + id_dynamic_keymap_macro_get_count, + id_dynamic_keymap_macro_get_buffer_size, + id_dynamic_keymap_macro_get_buffer, + id_dynamic_keymap_macro_set_buffer, + id_dynamic_keymap_macro_reset, + id_dynamic_keymap_get_layer_count, + id_dynamic_keymap_get_buffer, + id_dynamic_keymap_set_buffer, id_unhandled = 0xFF, }; diff --git a/keyboards/zeal60/zeal60_keycodes.h b/keyboards/zeal60/zeal60_keycodes.h index 9511801eb2..d9abf602b6 100644 --- a/keyboards/zeal60/zeal60_keycodes.h +++ b/keyboards/zeal60/zeal60_keycodes.h @@ -22,7 +22,23 @@ // Backlight keycodes are in range 0x5F00-0x5F0F enum zeal60_keycodes { FN_MO13 = 0x5F10, - FN_MO23 + FN_MO23, + MACRO00, + MACRO01, + MACRO02, + MACRO03, + MACRO04, + MACRO05, + MACRO06, + MACRO07, + MACRO08, + MACRO09, + MACRO10, + MACRO11, + MACRO12, + MACRO13, + MACRO14, + MACRO15, }; // Zeal60 specific "action functions" diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h index 683df2038a..63ce1c12a2 100644 --- a/keyboards/zeal65/config.h +++ b/keyboards/zeal65/config.h @@ -115,11 +115,15 @@ // Bump this every time we change what we store // This will automatically reset the EEPROM with defaults // and avoid loading invalid data from the EEPROM -#define EEPROM_VERSION 0x07 +#define EEPROM_VERSION 0x08 #define EEPROM_VERSION_ADDR 34 // Backlight config starts after EEPROM version #define RGB_BACKLIGHT_CONFIG_EEPROM_ADDR 35 -// Dynamic keymap starts after backlight config (35+37) -#define DYNAMIC_KEYMAP_EEPROM_ADDR 72 +// Dynamic keymap starts after backlight config (35+31) +#define DYNAMIC_KEYMAP_EEPROM_ADDR 66 +// Dynamic macro starts after dynamic keymaps (66+(4*5*15*2)) = (66+600) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 666 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 358 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/zeal65/rules.mk b/keyboards/zeal65/rules.mk index 7ab1b7d3ba..596c1e6496 100644 --- a/keyboards/zeal65/rules.mk +++ b/keyboards/zeal65/rules.mk @@ -1,8 +1,8 @@ # project specific files -SRC = ../zeal60/zeal60.c \ - ../zeal60/rgb_backlight.c \ +SRC = keyboards/zeal60/zeal60.c \ + keyboards/zeal60/rgb_backlight.c \ quantum/color.c \ drivers/issi/is31fl3731.c \ drivers/avr/i2c_master.c diff --git a/quantum/dynamic_keymap.c b/quantum/dynamic_keymap.c index ee39a20251..14627a93d6 100644 --- a/quantum/dynamic_keymap.c +++ b/quantum/dynamic_keymap.c @@ -18,7 +18,7 @@ #include "keymap.h" // to get keymaps[][][] #include "tmk_core/common/eeprom.h" #include "progmem.h" // to read default from flash - +#include "quantum.h" // for send_string() #include "dynamic_keymap.h" #ifdef DYNAMIC_KEYMAP_ENABLE @@ -31,6 +31,23 @@ #error DYNAMIC_KEYMAP_LAYER_COUNT not defined #endif +#ifndef DYNAMIC_KEYMAP_MACRO_COUNT +#error DYNAMIC_KEYMAP_MACRO_COUNT not defined +#endif + +#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR +#error DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR not defined +#endif + +#ifndef DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE +#error DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE not defined +#endif + +uint8_t dynamic_keymap_get_layer_count(void) +{ + return DYNAMIC_KEYMAP_LAYER_COUNT; +} + void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column) { // TODO: optimize this with some left shifts @@ -69,6 +86,36 @@ void dynamic_keymap_reset(void) } } +void dynamic_keymap_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2; + void *source = (void*)(DYNAMIC_KEYMAP_EEPROM_ADDR+offset); + uint8_t *target = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < dynamic_keymap_eeprom_size ) { + *target = eeprom_read_byte(source); + } else { + *target = 0x00; + } + source++; + target++; + } +} + +void dynamic_keymap_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + uint16_t dynamic_keymap_eeprom_size = DYNAMIC_KEYMAP_LAYER_COUNT * MATRIX_ROWS * MATRIX_COLS * 2; + void *target = (void*)(DYNAMIC_KEYMAP_EEPROM_ADDR+offset); + uint8_t *source = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < dynamic_keymap_eeprom_size ) { + eeprom_update_byte(target, *source); + } + source++; + target++; + } +} + // This overrides the one in quantum/keymap_common.c uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) { @@ -81,5 +128,103 @@ uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key) } } + + +uint8_t dynamic_keymap_macro_get_count(void) +{ + return DYNAMIC_KEYMAP_MACRO_COUNT; +} + +uint16_t dynamic_keymap_macro_get_buffer_size(void) +{ + return DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE; +} + +void dynamic_keymap_macro_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + void *source = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+offset); + uint8_t *target = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE ) { + *target = eeprom_read_byte(source); + } else { + *target = 0x00; + } + source++; + target++; + } +} + +void dynamic_keymap_macro_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ) +{ + void *target = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+offset); + uint8_t *source = data; + for ( uint16_t i = 0; i < size; i++ ) { + if ( offset + i < DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE ) { + eeprom_update_byte(target, *source); + } + source++; + target++; + } +} + +void dynamic_keymap_macro_reset(void) +{ + void *p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); + while ( p != end ) { + eeprom_update_byte(p, 0); + ++p; + } +} + +void dynamic_keymap_macro_send( uint8_t id ) +{ + if ( id >= DYNAMIC_KEYMAP_MACRO_COUNT ) { + return; + } + + // Check the last byte of the buffer. + // If it's not zero, then we are in the middle + // of buffer writing, possibly an aborted buffer + // write. So do nothing. + void *p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE-1); + if ( eeprom_read_byte(p) != 0 ) { + return; + } + + // Skip N null characters + // p will then point to the Nth macro + p = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR); + void *end = (void*)(DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR+DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE); + while ( id > 0 ) { + // If we are past the end of the buffer, then the buffer + // contents are garbage, i.e. there were not DYNAMIC_KEYMAP_MACRO_COUNT + // nulls in the buffer. + if ( p == end ) { + return; + } + if ( eeprom_read_byte(p) == 0 ) { + --id; + } + ++p; + } + + // Send the macro string one char at a time + // by making temporary 1 char strings + char data[2] = { 0, 0 }; + // We already checked there was a null at the end of + // the buffer, so this cannot go past the end + while ( 1 ) { + data[0] = eeprom_read_byte(p); + // Stop at the null terminator of this macro string + if ( data[0] == 0 ) { + break; + } + send_string(data); + ++p; + } +} + #endif // DYNAMIC_KEYMAP_ENABLE diff --git a/quantum/dynamic_keymap.h b/quantum/dynamic_keymap.h index bd76adae20..63653f6cb7 100644 --- a/quantum/dynamic_keymap.h +++ b/quantum/dynamic_keymap.h @@ -18,11 +18,46 @@ #include #include +uint8_t dynamic_keymap_get_layer_count(void); void *dynamic_keymap_key_to_eeprom_address(uint8_t layer, uint8_t row, uint8_t column); uint16_t dynamic_keymap_get_keycode(uint8_t layer, uint8_t row, uint8_t column); void dynamic_keymap_set_keycode(uint8_t layer, uint8_t row, uint8_t column, uint16_t keycode); void dynamic_keymap_reset(void); +// These get/set the keycodes as stored in the EEPROM buffer +// Data is big-endian 16-bit values (the keycodes) +// Order is by layer/row/column +// Thus offset 0 = 0,0,0, offset MATRIX_COLS*2 = 0,1,0, offset MATRIX_ROWS*MATRIX_COLS*2 = 1,0,0 +// Note the *2, because offset is in bytes and keycodes are two bytes +// This is only really useful for host applications that want to get a whole keymap fast, +// by reading 14 keycodes (28 bytes) at a time, reducing the number of raw HID transfers by +// a factor of 14. +void dynamic_keymap_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ); // This overrides the one in quantum/keymap_common.c // uint16_t keymap_key_to_keycode(uint8_t layer, keypos_t key); + + +// Note regarding dynamic_keymap_macro_set_buffer(): +// The last byte of the buffer is used as a valid flag, +// so macro sending is disabled during writing a new buffer, +// should it happen during, or after an interrupted transfer. +// +// Users writing to the buffer must first set the last byte of the buffer +// to non-zero (i.e. 0xFF). After (or during) the final write, set the +// last byte of the buffer to zero. +// +// Since the contents of the buffer must be a list of null terminated +// strings, the last byte must be a null when at maximum capacity, +// and it not being null means the buffer can be considered in an +// invalid state. + +uint8_t dynamic_keymap_macro_get_count(void); +uint16_t dynamic_keymap_macro_get_buffer_size(void); +void dynamic_keymap_macro_get_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_macro_set_buffer( uint16_t offset, uint16_t size, uint8_t *data ); +void dynamic_keymap_macro_reset(void); + +void dynamic_keymap_macro_send( uint8_t id ); + -- cgit v1.2.3 From 8c033497c62970087ae16c3e7c42fd72f3e1ecbe Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Fri, 30 Nov 2018 17:51:45 -0500 Subject: Planck: Align Keycode Columns (#4523) Remove Extra Newlines --- keyboards/planck/keymaps/default/keymap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/keyboards/planck/keymaps/default/keymap.c b/keyboards/planck/keymaps/default/keymap.c index 0b787cd122..03cc0049e4 100644 --- a/keyboards/planck/keymaps/default/keymap.c +++ b/keyboards/planck/keymaps/default/keymap.c @@ -144,7 +144,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Exit | | | A | O | | E | U | | | | * `-----------------------------------------------------------------------------------' */ - [_PLOVER] = LAYOUT_planck_grid( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, @@ -164,13 +163,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT_planck_grid( - _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , - _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , + _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) - }; #ifdef AUDIO_ENABLE -- cgit v1.2.3 From 5803012eda70d2ad85434e53820f2c93c310f92e Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Sat, 1 Dec 2018 08:17:50 -0800 Subject: Add a layout to support tsangan bottom row with split bs and rshift (#4521) * Add a layout to support tsangan bottom row with split bs and rshift * Move the new layout to defaults * Rename layout to be more accurately representative * Rename files to match renamed layout def --- .../keymap.c | 21 +++++++++++++++++++++ .../60_ansi_tsangan_split_bs_rshift/layout.json | 5 +++++ .../60_ansi_tsangan_split_bs_rshift/readme.md | 3 +++ 3 files changed, 29 insertions(+) create mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c create mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json create mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c b/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c new file mode 100644 index 0000000000..17b47eecf9 --- /dev/null +++ b/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_ansi_tsangan_split_bs_rshift( + 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_BSPC, + 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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT ,KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ) +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +}; diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json b/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json new file mode 100644 index 0000000000..117d26d419 --- /dev/null +++ b/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"",{w:1},""], +[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md b/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md new file mode 100644 index 0000000000..ad1c598b34 --- /dev/null +++ b/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md @@ -0,0 +1,3 @@ +# 60_ansi_tsangan_split_bs_rshift + + LAYOUT_60_ansi_tsangan_split_bs_rshift \ No newline at end of file -- cgit v1.2.3 From 75a51659abfbc68874f2e9326f0adf1258fc5458 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Sat, 1 Dec 2018 08:21:06 -0800 Subject: Add tap_random_base64 and software timer info to Useful Functions doc (#4360) * Update docs * Add security caveat Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna * Update docs/ref_functions.md Co-Authored-By: drashna --- docs/faq_keymap.md | 17 ----------------- docs/ref_functions.md | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/docs/faq_keymap.md b/docs/faq_keymap.md index 4e842d363c..ae01e93878 100644 --- a/docs/faq_keymap.md +++ b/docs/faq_keymap.md @@ -211,20 +211,3 @@ here real_mods lost state for 'physical left shift'. weak_mods is ORed with real_mods when keyboard report is sent. https://github.com/tmk/tmk_core/blob/master/common/action_util.c#L57 - -## Timer Functionality - -It's possible to start timers and read values for time-specific events - here's an example: - -```c -static uint16_t key_timer; -key_timer = timer_read(); - -if (timer_elapsed(key_timer) < 100) { - // do something if less than 100ms have passed -} else { - // do something if 100ms or more have passed -} -``` - -It's best to declare the `static uint16_t key_timer;` at the top of the file, outside of any code blocks you're using it in. diff --git a/docs/ref_functions.md b/docs/ref_functions.md index 9b5be7a883..174d9a95a6 100644 --- a/docs/ref_functions.md +++ b/docs/ref_functions.md @@ -96,3 +96,24 @@ And to do so, add `reset_keyboard()` to your function or macro, and this will re If you're having issues with Audio, RGB Underglow, backlighting or keys acting weird, then you can reset the EEPROM (persistent setting storage). Bootmagic is one way to do this, but if that isn't enabled, then you can use a custom macro to do so. To wipe the EEPROM, run `eeconfig_init()` from your function or macro to reset most of the settings to default. + +## Tap random key + +If you want to send a random character to the host computer, you can use the `tap_random_base64()` function. This [pseudorandomly](https://en.wikipedia.org/wiki/Pseudorandom_number_generator) selects a number between 0 and 63, and then sends a key press based on that selection. (0–25 is `A`–`Z`, 26–51 is `a`–`z`, 52–61 is `0`–`9`, 62 is `+` and 63 is `/`). + +?> Needless to say, but this is _not_ a cryptographically secure method of generating random Base64 keys or passwords. + +## Software Timers + +It's possible to start timers and read values for time-specific events. Here's an example: + +```c +static uint16_t key_timer; +key_timer = timer_read(); + +if (timer_elapsed(key_timer) < 100) { + // do something if less than 100ms have passed +} else { + // do something if 100ms or more have passed +} +``` -- cgit v1.2.3 From 0b0c98929b7d9375661a101740f2b1be8ca3e0fc Mon Sep 17 00:00:00 2001 From: Erovia Date: Sat, 1 Dec 2018 17:57:30 +0100 Subject: Add support for S7 Elephant (#4511) * Add support for S7 Elephant A high-end 70% custom keyboard designed and produced by jacky from Geekhack. * Polish S7 Elephant code Implement drashna's suggestions: - specify bootloader - remove unnecessary defines - use led_set_user() for LED logic * Correct info.json and s7_elephant.h Correct info.json and s7_elepant.h to follow QMK convention and fix a missing curly bracket. --- keyboards/s7_elephant/config.h | 47 ++ keyboards/s7_elephant/info.json | 129 ++++ keyboards/s7_elephant/keymaps/default/config.h | 1 + keyboards/s7_elephant/keymaps/default/keymap.c | 64 ++ keyboards/s7_elephant/keymaps/default/readme.md | 35 + keyboards/s7_elephant/readme.md | 17 + keyboards/s7_elephant/rules.mk | 52 ++ keyboards/s7_elephant/s7_elephant.c | 1 + keyboards/s7_elephant/s7_elephant.h | 855 ++++++++++++++++++++++++ 9 files changed, 1201 insertions(+) create mode 100644 keyboards/s7_elephant/config.h create mode 100644 keyboards/s7_elephant/info.json create mode 100644 keyboards/s7_elephant/keymaps/default/config.h create mode 100644 keyboards/s7_elephant/keymaps/default/keymap.c create mode 100644 keyboards/s7_elephant/keymaps/default/readme.md create mode 100644 keyboards/s7_elephant/readme.md create mode 100644 keyboards/s7_elephant/rules.mk create mode 100644 keyboards/s7_elephant/s7_elephant.c create mode 100644 keyboards/s7_elephant/s7_elephant.h diff --git a/keyboards/s7_elephant/config.h b/keyboards/s7_elephant/config.h new file mode 100644 index 0000000000..55baa4c37b --- /dev/null +++ b/keyboards/s7_elephant/config.h @@ -0,0 +1,47 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0007 +#define DEVICE_VER 0x0001 +#define MANUFACTURER jacky +#define PRODUCT S7 Elephant +#define DESCRIPTION A high-end 70% custom keyboard + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 16 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { B0, B1, B2, B3, B4 } +#define MATRIX_COL_PINS { B6, D0, D1, D2, D3, D4, D5, D6, D7, C6, C7, F4, F5, F6, F7, F1 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +#define RGB_DI_PIN E6 +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 2 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#define RGBLIGHT_SLEEP +#endif diff --git a/keyboards/s7_elephant/info.json b/keyboards/s7_elephant/info.json new file mode 100644 index 0000000000..37f98d79d5 --- /dev/null +++ b/keyboards/s7_elephant/info.json @@ -0,0 +1,129 @@ +{ + "keyboard_name": "S7 Elephant", + "url": "https://geekhack.org/index.php?topic=96434.0", + "maintainer": "qmk", + "width": 18, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_small_lshift": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_small_lshift_small_bspc": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_1u": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_1u_small_lshift": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_1u_small_bspc": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_1u_small_lshift_small_bspc": { + "key_count": 75, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_7u": { + "key_count": 71, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_7u_small_lshift": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_7u_small_bspc": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_7u_small_lshift_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_small_lshift": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_small_lshift_small_bspc": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_7u": { + "key_count": 71, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_7u_small_lshift": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_7u_small_bspc": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_ansi_blocker_7u_small_lshift_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_small_bspc": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_1u": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_1u_small_bspc": { + "key_count": 75, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_7u": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_7u_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_blocker": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_blocker_small_bspc": { + "key_count": 74, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_blocker_7u": { + "key_count": 72, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + }, + "LAYOUT_iso_blocker_7u_small_bspc": { + "key_count": 73, + "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + } + } +} diff --git a/keyboards/s7_elephant/keymaps/default/config.h b/keyboards/s7_elephant/keymaps/default/config.h new file mode 100644 index 0000000000..85f62371e9 --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/config.h @@ -0,0 +1 @@ +#define RGBLIGHT_LIMIT_VAL 80 diff --git a/keyboards/s7_elephant/keymaps/default/keymap.c b/keyboards/s7_elephant/keymaps/default/keymap.c new file mode 100644 index 0000000000..339f2d379c --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/keymap.c @@ -0,0 +1,64 @@ +#include QMK_KEYBOARD_H + +enum custom_layers { + _QWERTY, + _FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------. ,-------------------------------------------------------------------------------------------------. + * | F1 | | Esc`~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |Home | + * |------| |-------------------------------------------------------------------------------------------------| + * | F2 | | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | End | + * |------| |-------------------------------------------------------------------------------------------------| + * | F3 | | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Ins | + * |------| |-------------------------------------------------------------------------------------------------| + * | F4 | | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | U | Del | + * |------| |-------------------------------------------------------------------------------------------------| + * | F5 | | Ctrl | Gui | Alt | Space | FN | RCtrl | L | D | R | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +[_QWERTY] = LAYOUT_ansi( +KC_F1, KC_GESC, 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_F2, 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_F3, 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_HOME, +KC_F4, KC_LSFT, 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_END, +KC_F5, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, MO(_FN), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT +), + +/* FN + * ,------. ,-------------------------------------------------------------------------------------------------. + * |Reset | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr | ScrLck |Pause| + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | |Prev |Play |Next | | | | |VolD |Mute |VolU | | |PgUp | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | |PgDn | + * |------| |-------------------------------------------------------------------------------------------------| + * |EEPRST| | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +[_FN] = LAYOUT_ansi( +RESET, 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_MPRV, KC_MPLY, KC_MNXT, _______, _______, _______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_PGUP, +_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, +EEP_RST, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +}; + +void led_set_user(uint8_t usb_led) { + // Turn LEDs On/Off for Caps Lock + if (host_keyboard_leds() & (1 << USB_LED_CAPS_LOCK)) { + rgblight_enable_noeeprom(); + rgblight_sethsv_noeeprom(0, 0, 80); + } else { + rgblight_sethsv_noeeprom(0, 0, 80); + rgblight_disable_noeeprom(); + } +} diff --git a/keyboards/s7_elephant/keymaps/default/readme.md b/keyboards/s7_elephant/keymaps/default/readme.md new file mode 100644 index 0000000000..c4fe30acdd --- /dev/null +++ b/keyboards/s7_elephant/keymaps/default/readme.md @@ -0,0 +1,35 @@ +# Default keymap for S7 Elephant + +**Features** + +* LEDs are functioning as Caps-Lock indicators + +## QWERTY (Normal) Layer +``` +,------. ,-------------------------------------------------------------------------------------------------. +| F1 | | Esc`~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Bkspc |Home | +|------| |-------------------------------------------------------------------------------------------------| +| F2 | | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | End | +|------| |-------------------------------------------------------------------------------------------------| +| F3 | | Caps | A | S | D | F | G | H | J | K | L | ; | ' | Enter | Ins | +|------| |-------------------------------------------------------------------------------------------------| +| F4 | | Shift | Z | X | C | V | B | N | M | , | . | / | RShift | U | Del | +|------| |-------------------------------------------------------------------------------------------------| +| F5 | | Ctrl | Gui | Alt | Space | FN | RAlt | RCtrl | L | D | R | +`------' `-------------------------------------------------------------------------------------------------' +``` + +## FN Layer +``` +,------. ,-------------------------------------------------------------------------------------------------. +|Reset | | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | PScr | ScrLck |Pause| +|------| |-------------------------------------------------------------------------------------------------| +| | | | | | | | | | | | | | | | | | +|------| |-------------------------------------------------------------------------------------------------| +| | | |Prev |Play |Next | | | | |VolD |Mute |VolU | | |PgUp | +|------| |-------------------------------------------------------------------------------------------------| +| | | | | | | | | | | | | | | |PgDn | +|------| |-------------------------------------------------------------------------------------------------| +|EPRM | | | | | | | | | | | | +`------' `-------------------------------------------------------------------------------------------------' +``` diff --git a/keyboards/s7_elephant/readme.md b/keyboards/s7_elephant/readme.md new file mode 100644 index 0000000000..466e3f7316 --- /dev/null +++ b/keyboards/s7_elephant/readme.md @@ -0,0 +1,17 @@ +# S7 Elephant + +![S7 Elephant](https://i.imgur.com/CaHxKBJ.jpg) + +A high-end 70% custom keyboard designed and produced by [jacky](https://geekhack.org/index.php?action=profile;u=63864) from Geekhack. + +Keyboard Maintainer: QMK Community +Hardware Supported: S7 Elephant +Hardware Availability: [The GB has ended with little chance to run again.](https://geekhack.org/index.php?topic=96434.0) + +Make example for this keyboard (after setting up your build environment): + + make s7_elephant:default:dfu + +To enter the bootloader, either short the pins on the PCB or the RESET button on the FN layer. + +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/s7_elephant/rules.mk b/keyboards/s7_elephant/rules.mk new file mode 100644 index 0000000000..7f0ad6d3c5 --- /dev/null +++ b/keyboards/s7_elephant/rules.mk @@ -0,0 +1,52 @@ +# MCU name +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 = atmel-dfu + +# Build Options +# comment out to disable the options. +# +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 = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +RGBLIGHT_ENABLE = yes # Enable keyboard underlight functionality diff --git a/keyboards/s7_elephant/s7_elephant.c b/keyboards/s7_elephant/s7_elephant.c new file mode 100644 index 0000000000..a869f46dbe --- /dev/null +++ b/keyboards/s7_elephant/s7_elephant.c @@ -0,0 +1 @@ +#include "s7_elephant.h" diff --git a/keyboards/s7_elephant/s7_elephant.h b/keyboards/s7_elephant/s7_elephant.h new file mode 100644 index 0000000000..c351ffdb91 --- /dev/null +++ b/keyboards/s7_elephant/s7_elephant.h @@ -0,0 +1,855 @@ +#ifndef S7_ELEPHANT_H +#define S7_ELEPHANT_H + +#include "quantum.h" + +#define ____ KC_NO + +/* ANSI + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small shift and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_1u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with small shift and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_ansi_7u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with blocker + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_ansi_blocker_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ANSI with blocker and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_lshift( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, ____, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ANSI with blocker and small shift and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_ansi_blocker_7u_small_lshift_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_1u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* ISO with small backspace and 1u keys in the bottom row + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_1u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K412, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, K412, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------------------------------' + */ + +#define LAYOUT_iso_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, ____, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} +/* **************************************************************************************************************************************** */ +/* ISO with blocker + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_iso_blocker( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* ISO with blocker and small backspace + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | + * `------' `-------------------------------------------------------------------------- -------------------' + */ + +#define LAYOUT_iso_blocker_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K411, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, K411, ____, K413, K414, K415 } \ +} + +/* **************************************************************************************************************************************** */ +/* ISO with blocker and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_iso_blocker_7u( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, ____, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} + +/* ISO with blocker and small backspace and 7u spacebar + * ,------. ,-------------------------------------------------------------------------------------------------. + * | | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + | | | | | | | | | | | | | | | | | | + * |------| |------------------------------------------------------------------------------------ |-----| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | | | | | | | + * |------| |-------------------------------------------------------------------------------------------------| + * | | | | | | | | | | | | + * `------' `--------------------------------------------------------------------------- ------------------' + */ + +#define LAYOUT_iso_blocker_7u_small_bspc( \ +K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K013, K214, K015, \ +K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K115, \ +K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K114, K213, K215, \ +K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315, \ +K400, K401, K402, K403, K407, K410, K413, K414, K415 \ +) { \ +{ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015 }, \ +{ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115 }, \ +{ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215 }, \ +{ K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312, K313, K314, K315 }, \ +{ K400, K401, K402, K403, ____, ____, ____, K407, ____, ____, K410, ____, ____, K413, K414, K415 } \ +} +#endif -- cgit v1.2.3 From a90331aec21a47ef3a9fe47425c9c7204bc768b5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 1 Dec 2018 16:28:32 -0800 Subject: handwired/ortho5x13 default keymap refactor, Configurator support, and readme update (#4525) * handwired/ortho5x13: default keymap refactor - keymap now uses LAYOUT macro - keymap now uses #include QMK_KEYBOARD_H - removed redundant KC_TRNS and KC_NO definitions * handwired/ortho5x13: Configurator support * handwired/ortho5x13: fix Docs links in readme --- keyboards/handwired/ortho5x13/info.json | 77 +++++++ .../handwired/ortho5x13/keymaps/default/keymap.c | 237 ++++++++++----------- keyboards/handwired/ortho5x13/readme.md | 2 +- 3 files changed, 192 insertions(+), 124 deletions(-) create mode 100644 keyboards/handwired/ortho5x13/info.json diff --git a/keyboards/handwired/ortho5x13/info.json b/keyboards/handwired/ortho5x13/info.json new file mode 100644 index 0000000000..15a65081a1 --- /dev/null +++ b/keyboards/handwired/ortho5x13/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "ortho5x13", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"`", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":",", "x":11, "y":2}, + {"label":"\\", "x":12, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"Up", "x":12, "y":3}, + {"label":"Hyper", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"GUI", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Backspace", "x":8, "y":4}, + {"label":"Shift", "x":9, "y":4}, + {"label":"Left", "x":10, "y":4}, + {"label":"Right", "x":11, "y":4}, + {"label":"Down", "x":12, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/ortho5x13/keymaps/default/keymap.c b/keyboards/handwired/ortho5x13/keymaps/default/keymap.c index 0d5d0c430b..0c8bbb055e 100644 --- a/keyboards/handwired/ortho5x13/keymaps/default/keymap.c +++ b/keyboards/handwired/ortho5x13/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "ortho5x13.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // 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. @@ -25,146 +20,142 @@ enum custom_keycodes { BACKLIT }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - #define KC_L1 LOWER #define KC_L2 RAISE const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* Qwerty + /* Qwerty + * ,------------------------------------------------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | ` | A | S | D | F | G | H | J | K | L | ; | ' | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | Up | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Bksp |Shift | Left | Down |Right | + * `------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------. + KC_ESC ,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_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_GRV ,KC_A ,KC_S ,KC_D ,KC_F ,KC_G ,KC_H ,KC_J ,KC_K ,KC_L ,KC_SCLN ,KC_QUOT ,KC_BSLS , + //|--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| + KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,KC_N ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_ENT ,KC_UP , + //|--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------+--------| + KC_HYPR ,KC_LCTL ,KC_LALT ,KC_LGUI ,KC_L1 , KC_SPC ,KC_L2 ,KC_BSPC ,KC_RSFT ,KC_LEFT ,KC_RGHT ,KC_DOWN + //`--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+--------+--------' + ), + +/* Colemak * ,------------------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | * |------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | | * |------+------+------+------+------+-------------+------+------+------+------+------+------| - * | ` | A | S | D | F | G | H | J | K | L | ; | ' | \ | + * | Esc | A | R | S | T | D | H | N | E | I | O | " | | * |------+------+------+------+------+------|------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | Up | + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | | * |------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Hyper| Ctrl | Alt | GUI |Lower | Space |Raise | Bksp |Shift | Left | Down |Right | + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | * `------------------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_compact( - //,----+----+----+----+----+----+----+----+----+----+----+----+----. - ESC , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,MINS,EQL , - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - TAB , Q , W , E , R , T , Y , U , I , O , P ,LBRC,RBRC, - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - GRV , A , S , D , F , G , H , J , K , L ,SCLN,QUOT,BSLS, - //|----+----+----+----+----+----+----+----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,ENT , UP , - //|----+----+----+----+----+---------+----+----+----+----+----+----| - HYPR,LCTL,LALT,LGUI, L1 , SPACE , L2 ,BSPC,RSFT,LEFT,RGHT,DOWN - //`----+----+----+----+----+---------+----+----+----+----+----+----' - ), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL}, - {KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_COLEMAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL , _______, + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, _______, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , _______, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ +), /* Dvorak - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | O | E | U | I | D | H | T | N | S | / | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | " | , | . | P | Y | F | G | C | R | L | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | | + * `------------------------------------------------------------------------------------------' */ -[_DVORAK] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL}, - {KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH}, - {KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT }, - {BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, +[_DVORAK] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL , _______, + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, _______, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , _______, + BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______ +), /* Lower - * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC}, - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, _______, + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______ +), /* Raise - * ,-----------------------------------------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | Next | Vol- | Vol+ | Play | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | | + * `------------------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC}, - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY} -}, +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, _______, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL , _______, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______ +), /* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' + * ,------------------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------| + * | | | |Audoff|Aud on|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------| + * | |Voice-|Voice+|Musoff|Mus on| | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * `------------------------------------------------------------------------------------------' */ -[_ADJUST] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, - {_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL}, - {_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______}, - {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -} +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 , _______, + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, _______, + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; @@ -286,4 +277,4 @@ void music_scale_user(void) PLAY_SONG(music_scale); } -#endif \ No newline at end of file +#endif diff --git a/keyboards/handwired/ortho5x13/readme.md b/keyboards/handwired/ortho5x13/readme.md index 7241ddae8a..444cfec96e 100644 --- a/keyboards/handwired/ortho5x13/readme.md +++ b/keyboards/handwired/ortho5x13/readme.md @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/ortho5x13:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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). -- cgit v1.2.3 From 064d9e21750e8c717aca5f79263ad93b6606e125 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 1 Dec 2018 16:29:16 -0800 Subject: handwired/promethium Refactor and Configurator support (#4524) * handwired/promethium: refactor - config.h files - updated to use #pragma once - removed redundant config.h includes - layout macro moved from config.h to promethium.h - layout macro renamed from KEYMAP_CUSTOM to LAYOUT * handwired/promethium: Configurator support --- keyboards/handwired/promethium/config.h | 27 +-------- keyboards/handwired/promethium/info.json | 68 ++++++++++++++++++++++ .../handwired/promethium/keymaps/default/config.h | 7 +-- .../handwired/promethium/keymaps/default/keymap.c | 30 +++++----- .../handwired/promethium/keymaps/priyadi/config.h | 7 +-- .../handwired/promethium/keymaps/priyadi/keymap.c | 30 +++++----- keyboards/handwired/promethium/promethium.h | 19 ++++++ 7 files changed, 120 insertions(+), 68 deletions(-) create mode 100644 keyboards/handwired/promethium/info.json diff --git a/keyboards/handwired/promethium/config.h b/keyboards/handwired/promethium/config.h index ea5f2b76e8..dca0aec2e4 100644 --- a/keyboards/handwired/promethium/config.h +++ b/keyboards/handwired/promethium/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -159,27 +158,6 @@ along with this program. If not, see . #define MAX_VOLTAGE 4.2 #define MIN_VOLTAGE 3.2 -#define ___ KC_NO - -#define KEYMAP_CUSTOM( \ - k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, \ - k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, \ - k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3c, \ - k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b, k4c, \ - tp1, tp2, tp3 \ -) \ -{ \ - {k11, k12, k13, k14, k15, k16}, \ - {k21, k22, k23, k24, k25, k26}, \ - {k31, k32, k33, k34, k35, k36}, \ - {k41, k42, k43, k44, k45, k46}, \ - {k17, k18, k19, k1a, k1b, k1c}, \ - {k27, k28, k29, k2a, k2b, k2c}, \ - {k37, k38, k39, k3a, k3b, k3c}, \ - {k47, k48, k49, k4a, k4b, k4c}, \ - {tp1, tp2, tp3, ___, ___, ___} \ -} - #ifndef __ASSEMBLER__ // assembler doesn't like enum in .h file enum led_sequence { LED_IND_LINUX, @@ -351,6 +329,3 @@ enum led_sequence { #define PS2_USART_ERROR (UCSR1A & ((1< Date: Sat, 1 Dec 2018 17:19:33 -0800 Subject: Keyboard: Add HHKB layout support to the DO60 (#4526) * add 60_hhkb support * add qmk configurator support for the new 60_hhkb layout * allow community layout support for the 60_hhkb * fixup readme to adhere to new QMK standards --- keyboards/do60/do60.h | 14 ++++++++++++++ keyboards/do60/info.json | 4 ++++ keyboards/do60/readme.md | 17 ++++++++++------- keyboards/do60/rules.mk | 2 +- 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/keyboards/do60/do60.h b/keyboards/do60/do60.h index 30615d1d3d..8ee9022041 100644 --- a/keyboards/do60/do60.h +++ b/keyboards/do60/do60.h @@ -39,6 +39,20 @@ inline void setdefaultrgb(void){ rgblight_sethsv(100,100,100); } { K40, K41, K42, KC_NO,KC_NO,K45, K46, K47, KC_NO,KC_NO,K4A, K4B, K4C, K4D, K4E } \ } +#define LAYOUT_60_hhkb( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, \ + K30, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3D, K3E, \ + K41, K42, K46, K4A, K4B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, KC_NO, K2E }, \ + { K30, KC_NO, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, K3D, K3E }, \ + { KC_NO, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, KC_NO, KC_NO, KC_NO } \ +} + #define LAYOUT_60_ansi( \ K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0E, \ K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, \ diff --git a/keyboards/do60/info.json b/keyboards/do60/info.json index 6acfa08ef1..4c98bd8513 100644 --- a/keyboards/do60/info.json +++ b/keyboards/do60/info.json @@ -9,6 +9,10 @@ "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"\u2190", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3}, {"x":1, "y":3}, {"label":"Z", "x":2, "y":3}, {"label":"X", "x":3, "y":3}, {"label":"C", "x":4, "y":3}, {"label":"V", "x":5, "y":3}, {"label":"B", "x":6, "y":3}, {"label":"N", "x":7, "y":3}, {"label":"M", "x":8, "y":3}, {"label":"<", "x":9, "y":3}, {"label":">", "x":10, "y":3}, {"label":"?", "x":11, "y":3}, {"x":12, "y":3}, {"label":"\u2191", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"3u(Space)", "x":3.75, "y":4, "w":2.75}, {"x":6.5, "y":4}, {"label":"3u(Space)", "x":7.5, "y":4, "w":2.25}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"win", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] }, + "LAYOUT_60_hhkb": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Delete", "x":13.5, "y":1, "w":1.5}, {"label":"Control", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Os", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Os", "x":12.5, "y":4}] + }, + "LAYOUT_chiwi60_default": { "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"\u2190", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3, "w":1.75}, {"label":"\u2191", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"3u(Space)", "x":3.75, "y":4, "w":3}, {"label":"3u(Space)", "x":6.75, "y":4, "w":3}, {"label":"Alt", "x":9.75, "y":4, "w":1.25}, {"label":"win", "x":11, "y":4}, {"label":"\u2190", "x":12, "y":4}, {"label":"\u2193", "x":13, "y":4}, {"label":"\u2192", "x":14, "y":4}] }, diff --git a/keyboards/do60/readme.md b/keyboards/do60/readme.md index fce7c922c5..c4122361f2 100644 --- a/keyboards/do60/readme.md +++ b/keyboards/do60/readme.md @@ -1,11 +1,14 @@ -# QMK Firmware for DoyuStudio DO60 PCB +# DoyuStudio DO60 PCB +60% board supporting in-switch LEDs (two-pin, single colour) +Build-in WS2182 RGB LED for underglow lighting. -## Quantum MK Firmware -For the full Quantum feature list, see [the parent readme.md](/readme.md). +Keyboard Maintainer: QMK Community +Hardware Supported: Doyu Studios 60% PCB +Hardware Availability: [Doyustudio](https://shopkey.doyustudio.com/001pcb60) -Board supports in-switch LEDs (two-pin, single colour) -Build-in WS2182 RGB LED for underglow lighting. +Make example for this keyboard (after setting up your build environment): + + make do60:default -## Build -To build the default keymap, simply run `make do60:default`. \ No newline at end of file +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). \ No newline at end of file diff --git a/keyboards/do60/rules.mk b/keyboards/do60/rules.mk index 8003914fa7..7370a6262e 100644 --- a/keyboards/do60/rules.mk +++ b/keyboards/do60/rules.mk @@ -63,4 +63,4 @@ RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend UNICODE_ENABLE = no # Unicode -LAYOUTS = 60_ansi 60_ansi_split_bs_rshift \ No newline at end of file +LAYOUTS = 60_ansi 60_hhkb 60_ansi_split_bs_rshift \ No newline at end of file -- cgit v1.2.3 From 0db6bb10e0b2810d306d37ef7342b22a43f4bdf9 Mon Sep 17 00:00:00 2001 From: MechMerlin <30334081+mechmerlin@users.noreply.github.com> Date: Sat, 1 Dec 2018 17:28:35 -0800 Subject: Keyboard: Enable Lights by Default for Kira 75 (#4527) * enable rgb underglow and backlights by default for use with QMK Configurator * disable mousekeys --- keyboards/kira75/rules.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/keyboards/kira75/rules.mk b/keyboards/kira75/rules.mk index 45eb6ee376..610410ae4c 100644 --- a/keyboards/kira75/rules.mk +++ b/keyboards/kira75/rules.mk @@ -52,7 +52,7 @@ OPT_DEFS += -DBOOTLOADER_SIZE=4096 # change yes to no to disable # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # 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 @@ -60,7 +60,8 @@ COMMAND_ENABLE = yes # Commands for debug and configuration 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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 -- cgit v1.2.3 From dbc776168842439718334aa120f1afcbee9a96d9 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 1 Dec 2018 23:22:40 -0800 Subject: Keyboard: handwired/atreus50 Refactor, Configurator support, and readme cleanup (#4530) * handwired/atreus50: refactor - layout macro renames: - KEYMAP is now LAYOUT - COMPACT_KEYMAP is now LAYOUT_kc - keymap updates: - both keymaps now use #include QMK_KEYBOARD_H - removed redundant KC_TRNS and KC_NO definitions - default keymap now uses LAYOUT macro instead of LAYOUT_kc * handwired/atreus50: readme cleanup Reformatted the readme to be more closely aligned to current QMK template, and fixed some typos/grammar. * handwired/atreus50: Configurator support --- keyboards/handwired/atreus50/atreus50.h | 4 +- keyboards/handwired/atreus50/info.json | 70 +++++++++++++ .../handwired/atreus50/keymaps/ajp10304/keymap.c | 34 +++---- .../handwired/atreus50/keymaps/default/keymap.c | 109 +++++++-------------- keyboards/handwired/atreus50/readme.md | 18 +++- 5 files changed, 134 insertions(+), 101 deletions(-) create mode 100644 keyboards/handwired/atreus50/info.json diff --git a/keyboards/handwired/atreus50/atreus50.h b/keyboards/handwired/atreus50/atreus50.h index de06f255e8..eb31ca1b8e 100644 --- a/keyboards/handwired/atreus50/atreus50.h +++ b/keyboards/handwired/atreus50/atreus50.h @@ -5,7 +5,7 @@ // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ @@ -18,7 +18,7 @@ { k30, k31, k32, k33, k34, k35, km1, k36, k37, k38, k39, k3a, k3b } \ } -#define COMPACT_KEYMAP( \ +#define LAYOUT_kc( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ diff --git a/keyboards/handwired/atreus50/info.json b/keyboards/handwired/atreus50/info.json new file mode 100644 index 0000000000..4e3b4ac497 --- /dev/null +++ b/keyboards/handwired/atreus50/info.json @@ -0,0 +1,70 @@ +{ + "keyboard_name": "Atreus50", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 4.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Tab", "x":0, "y":0.5}, + {"label":"Q", "x":1, "y":0.5}, + {"label":"W", "x":2, "y":0.25}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0.25}, + {"label":"T", "x":5, "y":0.5}, + + {"label":"Y", "x":9, "y":0.5}, + {"label":"U", "x":10, "y":0.25}, + {"label":"I", "x":11, "y":0}, + {"label":"O", "x":12, "y":0.25}, + {"label":"P", "x":13, "y":0.5}, + {"label":"-", "x":14, "y":0.5}, + + {"label":"Ctrl/Esc", "x":0, "y":1.5}, + {"label":"A", "x":1, "y":1.5}, + {"label":"S", "x":2, "y":1.25}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1.25}, + {"label":"G", "x":5, "y":1.5}, + + {"label":"H", "x":9, "y":1.5}, + {"label":"J", "x":10, "y":1.25}, + {"label":"K", "x":11, "y":1}, + {"label":"L", "x":12, "y":1.25}, + {"label":";", "x":13, "y":1.5}, + {"label":"'", "x":14, "y":1.5}, + + {"label":"LShift", "x":0, "y":2.5}, + {"label":"Z", "x":1, "y":2.5}, + {"label":"X", "x":2, "y":2.25}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2.25}, + {"label":"B", "x":5, "y":2.5}, + + {"label":"N", "x":9, "y":2.5}, + {"label":"M", "x":10, "y":2.25}, + {"label":",", "x":11, "y":2}, + {"label":".", "x":12, "y":2.25}, + {"label":"/", "x":13, "y":2.5}, + {"label":"Shift/Enter", "x":14, "y":2.5}, + + {"label":"`", "x":0, "y":3.5}, + {"label":"LCtrl", "x":1, "y":3.5}, + {"label":"LAlt", "x":2, "y":3.25}, + {"label":"LGUI", "x":3, "y":3}, + {"label":"Lower", "x":4, "y":3.25}, + {"label":"Space", "x":5, "y":3.5}, + {"label":"Fn", "x":6, "y":2.75, "h":1.5}, + + {"label":"RShift", "x":8, "y":2.75, "h":1.5}, + {"label":"Back Space", "x":9, "y":3.5}, + {"label":"Raise", "x":10, "y":3.25}, + {"label":"Left", "x":11, "y":3}, + {"label":"Down", "x":12, "y":3.25}, + {"label":"Up", "x":13, "y":3.5}, + {"label":"Right", "x":14, "y":3.5} + ] + } + } +} diff --git a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c index 5b13224b0b..1e53d050b0 100644 --- a/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/ajp10304/keymap.c @@ -1,6 +1,4 @@ -#include "atreus50.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "keymap_uk.h" extern keymap_config_t keymap_config; @@ -37,10 +35,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -54,7 +48,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Raise | Shift| MENU | Ctrl | Fn2 | * `-------------------------------------------------------------------------------------------------' */ -[_QWERTY] = KEYMAP( +[_QWERTY] = LAYOUT( KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC , MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) , KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT , @@ -72,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp | Ctrl | Alt |Space |Mouse | MENU | Alt | Ctrl | Fn | * `-------------------------------------------------------------------------------------------------' */ -[_FUNC] = KEYMAP( +[_FUNC] = LAYOUT( 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT , KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , @@ -90,7 +84,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Lower | Del | Ctrl | Alt |Space | | Next | Vol- | Vol+ | Play | * `-------------------------------------------------------------------------------------------------' */ -[_LOWER] = KEYMAP( +[_LOWER] = LAYOUT( KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC , LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) , KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) , @@ -108,7 +102,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Mouse| | | | | Alt | Ctrl | Alt |Enter |Raise | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_RAISE] = KEYMAP( +[_RAISE] = LAYOUT( KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN , KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) , _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) , @@ -126,11 +120,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_ADJUST] = KEYMAP( +[_ADJUST] = LAYOUT( M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL , KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ , TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ , - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Mouse @@ -144,7 +138,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_MOUSE] = KEYMAP( +[_MOUSE] = LAYOUT( KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ , KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ , @@ -162,42 +156,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ -[_FUNC2] = KEYMAP( +[_FUNC2] = LAYOUT( _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______, _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______, _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MAC] = KEYMAP( +[_MAC] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MFNC, _______, _______, _______, MLWR, _______, _______, _______, _______, MRSE, _______, _______, _______, MFNC2 ), -[_MLWR] = KEYMAP( +[_MLWR] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MRSE] = KEYMAP( +[_MRSE] = LAYOUT( _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) , _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MFNC] = KEYMAP( +[_MFNC] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), -[_MFNC2] = KEYMAP( +[_MFNC2] = LAYOUT( _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______, _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______, _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) , diff --git a/keyboards/handwired/atreus50/keymaps/default/keymap.c b/keyboards/handwired/atreus50/keymaps/default/keymap.c index 21d91a8797..97b90a6db6 100644 --- a/keyboards/handwired/atreus50/keymaps/default/keymap.c +++ b/keyboards/handwired/atreus50/keymaps/default/keymap.c @@ -1,9 +1,4 @@ -#include "atreus50.h" -#include "action_layer.h" -#include "eeconfig.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif +#include QMK_KEYBOARD_H // 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. @@ -28,86 +23,52 @@ enum custom_keycodes { }; // Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC -#define KC_X1 LOWER -#define KC_X2 RAISE -#define KC_X3 MO(_MOVEMENT) -#define KC_X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter +#define X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for ESC +#define X3 MO(_MOVEMENT) +#define X4 MT(MOD_LSFT, KC_ENT) // Hold for Left Shift, Tap for Enter const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, + X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_COLEMAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , R , S , T , D , H , N , E , I , O ,QUOT, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH, X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_MINS, + X0, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_DVORAK] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TAB ,QUOT,COMM,DOT , P , Y , F , G , C , R , L ,MINS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - X0 , A , O , E , U , I , D , H , T , N , S ,SLSH, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - LSFT,SCLN, Q , J , K , X , B , M , W , V , Z , X4 , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - GRV ,LCTL,LALT,LGUI, X1 ,SPC , X3 ,RSFT,BSPC, X2 ,LEFT,DOWN, UP ,RGHT - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_MINS, + X0, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, X4, + KC_GRV, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, X3, KC_RSFT, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT ), - [_LOWER] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,UNDS,PLUS,LCBR,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_END, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - [_RAISE] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,MINS,EQL ,LBRC,RBRC,BSLS, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,NUHS,NUBS, , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , , , ,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), - [_MOVEMENT] = COMPACT_KEYMAP( - //,----+----+----+----+----+----. ,----+----+----+----+----+----. - TILD,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR, UP ,LPRN,RPRN,DEL , - //|----+----+----+----+----+----| |----+----+----+----+----+----| - DEL , F1 , F2 , F3 , F4 , F5 , F6 ,LEFT,DOWN,RGHT,RCBR,PIPE, - //|----+----+----+----+----+----| |----+----+----+----+----+----| - , F7 , F8 , F9 ,F10 ,F11 , F12 ,END , , , , , - //|----+----+----+----+----+----|----+----|----+----+----+----+----+----| - , , , , , , , ,PGDN,PGUP,MNXT,VOLD,VOLU,MPLY - //`----+----+----+----+----+----+----+----+----+----+----+----+----+----' + [_MOVEMENT] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_UP, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_LEFT, KC_DOWN, KC_RGHT, KC_RCBR, KC_PIPE, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_END, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY ), /* Adjust (Lower + Raise) @@ -121,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ - [_ADJUST] = KEYMAP( \ + [_ADJUST] = LAYOUT( \ _______, RESET, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, KC_DEL, \ _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______, \ diff --git a/keyboards/handwired/atreus50/readme.md b/keyboards/handwired/atreus50/readme.md index 0c24f67db2..9449d66e5b 100644 --- a/keyboards/handwired/atreus50/readme.md +++ b/keyboards/handwired/atreus50/readme.md @@ -1,7 +1,9 @@ -Handwired Atreus50 -================== +# Handwired Atreus50 -This firmware is for a Handwired Atreus50 using an Arduino Pro Micro. +This firmware is for a handwired Atreus50 using an Arduino Pro Micro. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Arduino Pro Micro ## Pinout @@ -11,6 +13,12 @@ The following pins are used: ## Compiling and loading the firmware -To build the firmware, run `make`. +Make example for this keyboard (after setting up your build environment): + + make handwired/atreus50:default + +To flash the firmware onto the microcontroller, run `make avrdude`, and press the reset button. + + make handwired/atreus50:default:avrdude -To flash the firemware onto the microcontroller, run `make avrdude`, and press the reset button. +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). -- cgit v1.2.3 From d5a06aec8386ef16e0751572c5182410b8d348f7 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 2 Dec 2018 15:12:54 -0500 Subject: Second try at configuring i18n for docsify and gitbook (#4531) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph * add fallback langurages * Create LANGS.md * Rename docs/zh-cn/README.md to docs/zh/README.md * Update LANGS.md * Update index.html --- docs/LANGS.md | 4 ++++ docs/index.html | 3 ++- docs/zh/README.md | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 docs/LANGS.md create mode 100644 docs/zh/README.md diff --git a/docs/LANGS.md b/docs/LANGS.md new file mode 100644 index 0000000000..4b48f2d3d8 --- /dev/null +++ b/docs/LANGS.md @@ -0,0 +1,4 @@ +# Languages + +* [English](/) +* [Chinese](zh/) diff --git a/docs/index.html b/docs/index.html index f0b1fae07e..f5aa92b531 100644 --- a/docs/index.html +++ b/docs/index.html @@ -25,7 +25,8 @@ placeholder: 'Search Documentation...', noData: 'We could not find any documents matching your search.', depth: 6 - } + }, + fallbackLanguages: ['zh'] } diff --git a/docs/zh/README.md b/docs/zh/README.md new file mode 100644 index 0000000000..bb9d1371f1 --- /dev/null +++ b/docs/zh/README.md @@ -0,0 +1,32 @@ +# QMK鍵盤固件 + +[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) +[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) +[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) +[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) +[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) +[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) + +## 什麼是QMK固件? + +QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 + +## 如何得到QMK + +如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 + +否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 + +## 如何編譯 + +你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 + + make planck/rev4:default + +這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: + + make preonic:default + +## 如何赶近 + +QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 -- cgit v1.2.3 From 5d47231f2a9353645aab07e14c1de21f00b7fc2f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sun, 2 Dec 2018 15:35:53 -0500 Subject: Add sidebar for ZH (#4533) * add zh-cn readme * edit readme * Round 1 of edits - Mandarin translation of QMK products is off, best to use the English name. - Fix some terminology and grammar. * trying re-translating the first paragraph * add fallback langurages * Create LANGS.md * Rename docs/zh-cn/README.md to docs/zh/README.md * Update LANGS.md * Update index.html * Delete README.md * add sidebar for zh --- docs/zh-cn/README.md | 32 ----------------- docs/zh/_sidebar.md | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 99 insertions(+), 32 deletions(-) delete mode 100644 docs/zh-cn/README.md create mode 100644 docs/zh/_sidebar.md diff --git a/docs/zh-cn/README.md b/docs/zh-cn/README.md deleted file mode 100644 index bb9d1371f1..0000000000 --- a/docs/zh-cn/README.md +++ /dev/null @@ -1,32 +0,0 @@ -# QMK鍵盤固件 - -[![當前版本](https://img.shields.io/github/tag/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/tags) -[![築邦](https://travis-ci.org/qmk/qmk_firmware.svg?branch=master)](https://travis-ci.org/qmk/qmk_firmware) -[![不和諧](https://img.shields.io/discord/440868230475677696.svg)](https://discord.gg/Uq7gcHh) -[![文檔狀態](https://img.shields.io/badge/docs-ready-orange.svg)](https://docs.qmk.fm) -[![GitHub的貢獻者](https://img.shields.io/github/contributors/qmk/qmk_firmware.svg)](https://github.com/qmk/qmk_firmware/pulse/monthly) -[![GitHub的叉](https://img.shields.io/github/forks/qmk/qmk_firmware.svg?style=social&label=Fork)](https://github.com/qmk/qmk_firmware/) - -## 什麼是QMK固件? - -QMK是一個由社群維護的開源鍵盤韌體,其中包含了QMK Toolbox、qmk.fm和其它文件。QMK韌體是以[tmk\_keyboard](http://github.com/tmk/tmk_keyboard)為基礎,讓一些有用的功能在Atmel AVR控制器實現,使用於[OLKB](https://olkb.com)、[ergodox EZ](http://www.ergodox-ez.com),和[Clueboard](http://clueboard.co/)的產品中。它也被移植到使用ChibiOS的ARM晶片上。你也可以用它來讓你徒手佈線,或是客製的鍵盤PCB發揮功能。 - -## 如何得到QMK - -如果你打算貢獻鍵盤佈局,鍵盤或功能QMK,最容易做的事情是[叉通過Github上爬行](https://github.com/qmk/qmk_firmware#fork-destination-box),和克隆你爬在本地進行更改,推動他們,然後打開從你的叉子[拉請求](https://github.com/qmk/qmk_firmware/pulls)。 - -否則,您可以直接下載([拉鍊](https://github.com/qmk/qmk_firmware/zipball/master) [焦油](https://github.com/qmk/qmk_firmware/tarball/master)),或者通過GIT中克隆它(`git@github.com:qmk/qmk_firmware.git`)或HTTP(`https://github.com/qmk/qmk_firmware.git`)。 - -## 如何編譯 - -你可以編譯之前,你需要[安裝環境](getting_started_build_tools.md)用於AVR或/和ARM開發。一旦完成,你會使用`make`命令建立一個鍵盤並用以下符號鍵盤佈局 - - make planck/rev4:default - -這將建立`rev4` `planck`的修訂與`default`鍵盤映射。並非所有鍵盤有一個修訂版(也稱為子項目或文件夾),在這種情況下,它可以被省略: - - make preonic:default - -## 如何赶近 - -QMK有很多[特點](features.md)探索和很好的協議[參考文獻](http://docs.qmk.fm)挖通的。大部分功能通過修改[鍵盤映射(keymap.md),並改變[鍵碼](keycodes.md)冤大頭。 diff --git a/docs/zh/_sidebar.md b/docs/zh/_sidebar.md new file mode 100644 index 0000000000..c167612929 --- /dev/null +++ b/docs/zh/_sidebar.md @@ -0,0 +1,99 @@ +* [完全指南菜鳥](zh/newbs.md) + * [入門](zh/newbs_getting_started.md) + * [構建第一個固件](zh/newbs_building_firmware.md) + * [刷新固件](zh/newbs_flashing.md) + * [測試和調試](zh/newbs_testing_debugging.md) + * [最佳實踐](zh/newbs_best_practices.md) + * [學習資源](zh/newbs_learn_more_resources.md) + +* [QMK基礎](zh/README.md) + * [QMK簡介](zh/getting_started_introduction.md) + * [特約QMK](zh/contributing.md) + * [如何使用Github上](zh/getting_started_github.md) + * [獲得幫助](zh/getting_started_getting_help.md) + +* [常問問題](zh/faq.md) + * [常問問題](zh/faq_general.md) + * [構建/編譯QMK](zh/faq_build.md) + * [調試/故障排除QMK](zh/faq_debug.md) + * [鍵盤佈局](zh/faq_keymap.md) + +* 詳細指南 + * [安裝編譯工具](zh/getting_started_build_tools.md) + * [流浪漢指南](zh/getting_started_vagrant.md) + * [構建/編譯器指令](zh/getting_started_make_guide.md) + * [刷新固件](zh/flashing.md) + * [定制功能](zh/custom_quantum_functions.md) + * [鍵盤映射概述](zh/keymap.md) + +* [硬件](zh/hardware.md) + * [AVR處理器](zh/hardware_avr.md) + * [司機](zh/hardware_drivers.md) + +* 參考 + * [Keyboard Guidelines](zh/hardware_keyboard_guidelines.md) + * [Config Options](zh/config_options.md) + * [Keycodes](zh/keycodes.md) + * [Documentation Best Practices](zh/documentation_best_practices.md) + * [Documentation Templates](zh/documentation_templates.md) + * [Glossary](zh/reference_glossary.md) + * [Unit Testing](zh/unit_testing.md) + * [Useful Functions](zh/ref_functions.md) + * [Configurator Support](zh/reference_configurator_support.md) + +* [特點](zh/features.md) + * [Basic Keycodes](zh/keycodes_basic.md) + * [Quantum Keycodes](zh/quantum_keycodes.md) + * [Advanced Keycodes](zh/feature_advanced_keycodes.md) + * [Audio](zh/feature_audio.md) + * [Auto Shift](zh/feature_auto_shift.md) + * [Backlight](zh/feature_backlight.md) + * [Bluetooth](zh/feature_bluetooth.md) + * [Bootmagic](zh/feature_bootmagic.md) + * [Combos](zh/feature_combo) + * [Command](zh/feature_command.md) + * [Dynamic Macros](zh/feature_dynamic_macros.md) + * [Encoders](zh/feature_encoders.md) + * [Grave Escape](zh/feature_grave_esc.md) + * [Key Lock](zh/feature_key_lock.md) + * [Layouts](zh/feature_layouts.md) + * [Leader Key](zh/feature_leader_key.md) + * [Macros](zh/feature_macros.md) + * [Mouse Keys](zh/feature_mouse_keys.md) + * [One Shot Keys](zh/feature_advanced_keycodes.md#one-shot-keys) + * [Pointing Device](zh/feature_pointing_device.md) + * [PS/2 Mouse](zh/feature_ps2_mouse.md) + * [RGB Lighting](zh/feature_rgblight.md) + * [RGB Matrix](zh/feature_rgb_matrix.md) + * [Space Cadet Shift](zh/feature_space_cadet_shift.md) + * [Space Cadet Shift Enter](zh/feature_space_cadet_shift_enter.md) + * [Stenography](zh/feature_stenography.md) + * [Swap Hands](zh/feature_swap_hands.md) + * [Tap Dance](zh/feature_tap_dance.md) + * [Terminal](zh/feature_terminal.md) + * [Thermal Printer](zh/feature_thermal_printer.md) + * [Unicode](zh/feature_unicode.md) + * [Userspace](zh/feature_userspace.md) + * [US ANSI Shifted Keys](zh/keycodes_us_ansi_shifted.md) + +* 對於製造商和遊戲模組 + * [Hand Wiring Guide](zh/hand_wire.md) + * [ISP Flashing Guide](zh/isp_flashing_guide.md) + * [ARM Debugging Guide](zh/arm_debugging.md) + * [I2C Driver](zh/i2c_driver.md) + +* 為了更深入的了解 + * [How Keyboards Work](zh/how_keyboards_work.md) + * [Understanding QMK](zh/understanding_qmk.md) + +* 其它主題 + * [Using Eclipse with QMK](zh/eclipse.md) + +* QMK內部(進行中) + * [Defines](zh/internals_defines.md) + * [Input Callback Reg](zh/internals_input_callback_reg.md) + * [Midi Device](zh/internals_midi_device.md) + * [Midi Device Setup Process](zh/internals_midi_device_setup_process.md) + * [Midi Util](zh/internals_midi_util.md) + * [Send Functions](zh/internals_send_functions.md) + * [Sysex Tools](zh/internals_sysex_tools.md) -- cgit v1.2.3 From fe982caf5d69fdb2d6f1dec123a630df11a98282 Mon Sep 17 00:00:00 2001 From: epaew Date: Tue, 4 Dec 2018 01:00:00 +0900 Subject: Add edvorakjp kepmap for crkbd (#4537) * edvorakjp layout for crkbd * bugfix of edvorakjp QMK cannot send keycode that doesn't exists on new layer. --- keyboards/crkbd/keymaps/edvorakjp/config.h | 24 +++++ keyboards/crkbd/keymaps/edvorakjp/keymap.c | 158 ++++++++++++++++++++++++++++ keyboards/crkbd/keymaps/edvorakjp/oled.c | 82 +++++++++++++++ keyboards/crkbd/keymaps/edvorakjp/oled.h | 24 +++++ keyboards/crkbd/keymaps/edvorakjp/readme.md | 21 ++++ keyboards/crkbd/keymaps/edvorakjp/rules.mk | 32 ++++++ users/edvorakjp/edvorakjp_process_record.c | 18 +++- 7 files changed, 354 insertions(+), 5 deletions(-) create mode 100644 keyboards/crkbd/keymaps/edvorakjp/config.h create mode 100644 keyboards/crkbd/keymaps/edvorakjp/keymap.c create mode 100644 keyboards/crkbd/keymaps/edvorakjp/oled.c create mode 100644 keyboards/crkbd/keymaps/edvorakjp/oled.h create mode 100644 keyboards/crkbd/keymaps/edvorakjp/readme.md create mode 100644 keyboards/crkbd/keymaps/edvorakjp/rules.mk diff --git a/keyboards/crkbd/keymaps/edvorakjp/config.h b/keyboards/crkbd/keymaps/edvorakjp/config.h new file mode 100644 index 0000000000..515591a429 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/config.h @@ -0,0 +1,24 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +#define SSD1306OLED +#define SWAP_SCLN + +// #define TAPPING_FORCE_HOLD +#define TAPPING_TERM 120 + +#undef RGBLED_NUM +#define RGBLIGHT_EFFECT_STATIC_GRADIENT +#define RGBLED_NUM 27 +#define RGBLIGHT_LIMIT_VAL 100 +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 +#define RGBLIGHT_VAL_STEP 17 + +#endif // CONFIG_USER_H diff --git a/keyboards/crkbd/keymaps/edvorakjp/keymap.c b/keyboards/crkbd/keymaps/edvorakjp/keymap.c new file mode 100644 index 0000000000..ae2f710a03 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/keymap.c @@ -0,0 +1,158 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA + #include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "oled.h" +#endif + +#include "edvorakjp.h" + +/* + * enum custom_keycodes { + * KC_LOCK = NEW_SAFE_RANGE, + * }; + */ + +#define KC_ KC_TRNS + +#define KC_TMB1 LGUI_T(KC_TAB) +#define KC_TMB2 LSFT_T(KC_SPC) +#define KC_TMB3 TD(TD_LOWER) // act as LOWER when hold, as KC_LANG2(=English) when tapped +#define KC_TMB4 TD(TD_RAISE) // act as RAISE when hold, as KC_LANG1(=Japanese) when tapped +#define KC_TMB5 RCTL_T(KC_BSPC) +#define KC_TMB6 RALT_T(KC_ENT) +#define KC_TMB7 KC_DEL +#define KC_TMB8 RALT(KC_ENT) +#define KC_TMB9 LGUI(KC_TAB) + +#define KC_RST RESET +#define KC_DBUG DEBUG +#define KC_RTOG RGB_TOG +#define KC_EDJP EDVORAK +#define KC_QWER QWERTY + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_EDVORAK] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ESC ,QUOT,COMM,DOT , Y , P , F , G , R , W , Q ,BSLS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + EQL , A , O , E , I , U , D , T , N , S , M ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV ,SCLN, X , C , V , Z , B , H , J , K , L ,SLSH, + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + TMB1,TMB2,TMB3, TMB4,TMB5,TMB6 + // `----+----+----' `----+----+----' + ), + + [_EDVORAKJ1] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , AI , OU , EI , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , Y , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_EDVORAKJ2] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , AI , OU , EI , , , , , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , Y , , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,ANN ,ONN ,ENN ,INN ,UNN , , , , , , , + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_QWERTY] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + TAB , Q , W , E , R , T , Y , U , I , O , P ,MINS, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + EQL , A , S , D , F , G , H , J , K , L ,SCLN,QUOT, + //|----+----+----+----+----+----| |----+----+----+----+----+----| + GRV , Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,BSLS, + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ), + + [_LOWER] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , 1 ,EXLM, AT ,HASH,DLR , PERC,CIRC,AMPR,ASTR, 0 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , LT ,LCBR,LPRN,LBRC, RBRC,RPRN,RCBR, GT , , , + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + , , , ,TMB7,TMB8 + // `----+----+----' `----+----+----' + ), + + [_RAISE] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , F1 , F2 , F3 , F4 , F5 , F6 , F7 , F8 , F9 ,F10 , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + ,F11 ,F12 ,PSCR,SLCK,PAUS, ,HOME,PGDN,PGUP,END , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , ,LEFT,DOWN, UP ,RGHT, , + //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + TMB9, , , , , + // `----+----+----' `----+----+----' + ), + + [_ADJUST] = LAYOUT_kc( + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , ,EXTOFF, , ,EXTON, , , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , ,QWER,WIN ,RST , RTOG,MAC ,EDJP, , , , + //|----+----+----+----+----+----| |----+----+----+----+----+----| + , , , , , , , , , , , , + //`----+----+----+----+----+----+----| |----+----+----+----+----+----+----' + , , , , , + // `----+----+----' `----+----+----' + ) +}; + +#ifdef SSD1306OLED +void matrix_init_keymap(void) { + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + iota_gfx_init(!has_usb()); // turns on the display +} + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} +#endif + +#ifdef RGBLIGHT_EFFECT_STATIC_GRADIENT +uint32_t layer_state_set_keymap(uint32_t state) { + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + switch (biton32(state)) { + case _EDVORAKJ1: + case _EDVORAKJ2: + // _EDVORAKJ1 & J2 are same colored + rgblight_sethsv_noeeprom_white(); + break; + case _LOWER: + rgblight_sethsv_noeeprom_red(); + break; + case _RAISE: + rgblight_sethsv_noeeprom_blue(); + break; + case _ADJUST: + rgblight_sethsv_noeeprom_green(); + break; + default: // for any other layers, or the default layer + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_GRADIENT + 3); + rgblight_sethsv_noeeprom_red(); + break; + } + return state; +} +#endif diff --git a/keyboards/crkbd/keymaps/edvorakjp/oled.c b/keyboards/crkbd/keymaps/edvorakjp/oled.c new file mode 100644 index 0000000000..e4cccf3e7f --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/oled.c @@ -0,0 +1,82 @@ +#include +#include "oled.h" + +// NOTE: Redefined to avoid to use snprintf(); It makes size of firmware big. +const char *read_mode_icon(bool windows_mode) { + static const char logo[][2][3] = {{{0x95, 0x96, 0}, {0xb5, 0xb6, 0}}, {{0x97, 0x98, 0}, {0xb7, 0xb8, 0}}}; + static char mode_icon[10]; + + int mode_number = windows_mode ? 1 : 0; + strcpy(mode_icon, logo[mode_number][0]); + + strcat(mode_icon, "\n"); + strcat(mode_icon, logo[mode_number][1]); + + return mode_icon; +} + +const char *read_layer_state(void) { + static char layer_state_str[24]; + char layer_name[17]; + + switch (biton32(layer_state)) { + case L_BASE: + strcpy(layer_name, default_layer_state == 1UL<<_EDVORAK ? "EDVORAK" : "QWERTY"); + break; + case _EDVORAKJ1: + case _EDVORAKJ2: + strcpy(layer_name, "JP_EXT"); + break; + case _RAISE: + strcpy(layer_name, "Raise"); + break; + case _LOWER: + strcpy(layer_name, "Lower"); + break; + case _ADJUST: + strcpy(layer_name, "Adjust"); + break; + default: + snprintf(layer_name, sizeof(layer_name), "Undef-%ld", layer_state); + } + + strcpy(layer_state_str, "Layer: "); + + strcat(layer_state_str, layer_name); + strcat(layer_state_str, "\n"); + return layer_state_str; +} + +const char *read_host_led_state(void) { + static char led_str[24]; + bool ext_status = get_enable_jp_extra_layer() && get_japanese_mode(); + strcpy(led_str, ext_status ? "EXT" : " "); + + strcat(led_str, (host_keyboard_leds() & (1<display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + if (is_master) { + matrix_write(&matrix, read_mode_icon(!get_enable_kc_lang())); + matrix_write(&matrix, " "); + matrix_write(&matrix, read_layer_state()); + matrix_write(&matrix, read_host_led_state()); + } else { + matrix_write(&matrix, read_logo()); + } + matrix_update(&display, &matrix); +} diff --git a/keyboards/crkbd/keymaps/edvorakjp/oled.h b/keyboards/crkbd/keymaps/edvorakjp/oled.h new file mode 100644 index 0000000000..896347aea9 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/oled.h @@ -0,0 +1,24 @@ +#ifndef OLED_USER_H +#define OLED_USER_H + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#include "ssd1306.h" +#include "edvorakjp.h" + +//assign the right code to your layers for OLED display +#define L_BASE 0 + +extern uint8_t is_master; +extern bool japanese_mode; + +// method prototypes defined in crkbd/lib +extern const char *read_logo(void); + +const char *read_mode_icon(bool swap); +const char *read_layer_state(void); +const char *read_host_led_state(void); +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source); +void iota_gfx_task_user(void); + +#endif // OLED_CONFIG_USER_H diff --git a/keyboards/crkbd/keymaps/edvorakjp/readme.md b/keyboards/crkbd/keymaps/edvorakjp/readme.md new file mode 100644 index 0000000000..dd406523d2 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/readme.md @@ -0,0 +1,21 @@ +# edvorakjp + +Epaew's Enhanced Dvorak layout for Japanese Programmer +see [here](/users/edvorakjp) for more informations. + +## License + +Copyright 2018 Ryo Maeda epaew.333@gmail.com @epaew + +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 . diff --git a/keyboards/crkbd/keymaps/edvorakjp/rules.mk b/keyboards/crkbd/keymaps/edvorakjp/rules.mk new file mode 100644 index 0000000000..b4f6d2f1f1 --- /dev/null +++ b/keyboards/crkbd/keymaps/edvorakjp/rules.mk @@ -0,0 +1,32 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing +TAP_DANCE_ENABLE = yes + +# 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 you want to change the display of OLED, you need to change here +SRC += ./lib/glcdfont.c \ + ./lib/logo_reader.c \ + oled.c \ + # ./lib/rgb_state_reader.c \ + # ./lib/layer_state_reader.c \ + # ./lib/keylogger.c \ + # ./lib/mode_icon_reader.c \ + # ./lib/host_led_state_reader.c \ + # ./lib/timelogger.c \ diff --git a/users/edvorakjp/edvorakjp_process_record.c b/users/edvorakjp/edvorakjp_process_record.c index dc70522b47..2dcdab2a25 100644 --- a/users/edvorakjp/edvorakjp_process_record.c +++ b/users/edvorakjp/edvorakjp_process_record.c @@ -37,11 +37,7 @@ bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { } return true; - // left hand and right hand's right side - case KC_X: - case KC_C: - case KC_V: - case KC_Z: + // left hand up and right hand's right side case KC_Y: case KC_P: case KC_W: @@ -54,6 +50,18 @@ bool process_record_edvorakjp_ext(uint16_t keycode, keyrecord_t *record) { layer_on(_EDVORAKJ2); } return true; + // left hand down + // If return true, QMK sends keycode in new layer, + // but these keys are only available in old layer. + case KC_X: + case KC_C: + case KC_V: + case KC_Z: + if (record->event.pressed) { + layer_on(_EDVORAKJ2); + tap_code(keycode); + } + return false; } // vowel keys, symbol keys and modifier keys -- cgit v1.2.3 From da1afe152af5a6dfb5c0bb28d86d34940162f960 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 3 Dec 2018 10:27:15 -0800 Subject: Fix up RGB Matrix code (#4503) * Fix up RGB Matrix code * Convert RGBLIGHT functions to rgbmatrix ones, and add defines --- quantum/rgb_matrix.c | 60 ++++++++++++++++++++++++++++++++++++++-------------- quantum/rgb_matrix.h | 59 +++++++++++++++++++++++++++++++++++++++------------ quantum/rgblight.c | 4 ++-- 3 files changed, 91 insertions(+), 32 deletions(-) diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 15bd136716..82d36177b5 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -842,13 +842,13 @@ void rgb_matrix_init(void) { } // Deals with the messy details of incrementing an integer -uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { +static uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { int16_t new_value = value; new_value += step; return MIN( MAX( new_value, min ), max ); } -uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { +static uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { int16_t new_value = value; new_value -= step; return MIN( MAX( new_value, min ), max ); @@ -887,77 +887,105 @@ uint32_t rgb_matrix_get_tick(void) { return g_tick; } -void rgblight_toggle(void) { +void rgb_matrix_toggle(void) { rgb_matrix_config.enable ^= 1; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_step(void) { +void rgb_matrix_enable(void) { + rgb_matrix_config.enable = 1; + eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +} + +void rgb_matrix_enable_noeeprom(void) { + rgb_matrix_config.enable = 1; +} + +void rgb_matrix_disable(void) { + rgb_matrix_config.enable = 0; + eeconfig_update_rgb_matrix(rgb_matrix_config.raw); +} + +void rgb_matrix_disable_noeeprom(void) { + rgb_matrix_config.enable = 0; +} + +void rgb_matrix_step(void) { rgb_matrix_config.mode++; if (rgb_matrix_config.mode >= RGB_MATRIX_EFFECT_MAX) rgb_matrix_config.mode = 1; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_step_reverse(void) { +void rgb_matrix_step_reverse(void) { rgb_matrix_config.mode--; if (rgb_matrix_config.mode < 1) rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_increase_hue(void) { +void rgb_matrix_increase_hue(void) { rgb_matrix_config.hue = increment( rgb_matrix_config.hue, 8, 0, 255 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_decrease_hue(void) { +void rgb_matrix_decrease_hue(void) { rgb_matrix_config.hue = decrement( rgb_matrix_config.hue, 8, 0, 255 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_increase_sat(void) { +void rgb_matrix_increase_sat(void) { rgb_matrix_config.sat = increment( rgb_matrix_config.sat, 8, 0, 255 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_decrease_sat(void) { +void rgb_matrix_decrease_sat(void) { rgb_matrix_config.sat = decrement( rgb_matrix_config.sat, 8, 0, 255 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_increase_val(void) { +void rgb_matrix_increase_val(void) { rgb_matrix_config.val = increment( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_decrease_val(void) { +void rgb_matrix_decrease_val(void) { rgb_matrix_config.val = decrement( rgb_matrix_config.val, 8, 0, RGB_MATRIX_MAXIMUM_BRIGHTNESS ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -void rgblight_increase_speed(void) { +void rgb_matrix_increase_speed(void) { rgb_matrix_config.speed = increment( rgb_matrix_config.speed, 1, 0, 3 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this } -void rgblight_decrease_speed(void) { +void rgb_matrix_decrease_speed(void) { rgb_matrix_config.speed = decrement( rgb_matrix_config.speed, 1, 0, 3 ); eeconfig_update_rgb_matrix(rgb_matrix_config.raw);//EECONFIG needs to be increased to support this } -void rgblight_mode(uint8_t mode) { +void rgb_matrix_mode(uint8_t mode) { rgb_matrix_config.mode = mode; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } -uint32_t rgblight_get_mode(void) { +void rgb_matrix_mode_noeeprom(uint8_t mode) { + rgb_matrix_config.mode = mode; +} + +uint32_t rgb_matrix_get_mode(void) { return rgb_matrix_config.mode; } -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { +void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_config.hue = hue; rgb_matrix_config.sat = sat; rgb_matrix_config.val = val; eeconfig_update_rgb_matrix(rgb_matrix_config.raw); } + +void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { + rgb_matrix_config.hue = hue; + rgb_matrix_config.sat = sat; + rgb_matrix_config.val = val; +} diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 3cd248ffc4..0cfeb4e069 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -127,6 +127,7 @@ enum rgb_matrix_effects { }; void rgb_matrix_set_color( int index, uint8_t red, uint8_t green, uint8_t blue ); +void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); // This runs after another backlight effect and replaces // colors already set @@ -160,20 +161,50 @@ void rgb_matrix_decrease(void); uint32_t rgb_matrix_get_tick(void); -void rgblight_toggle(void); -void rgblight_step(void); -void rgblight_sethsv(uint16_t hue, uint8_t sat, uint8_t val); -void rgblight_step_reverse(void); -void rgblight_increase_hue(void); -void rgblight_decrease_hue(void); -void rgblight_increase_sat(void); -void rgblight_decrease_sat(void); -void rgblight_increase_val(void); -void rgblight_decrease_val(void); -void rgblight_increase_speed(void); -void rgblight_decrease_speed(void); -void rgblight_mode(uint8_t mode); -uint32_t rgblight_get_mode(void); +void rgb_matrix_toggle(void); +void rgb_matrix_enable(void); +void rgb_matrix_enable_noeeprom(void); +void rgb_matrix_disable(void); +void rgb_matrix_disable_noeeprom(void); +void rgb_matrix_step(void); +void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val); +void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); +void rgb_matrix_step_reverse(void); +void rgb_matrix_increase_hue(void); +void rgb_matrix_decrease_hue(void); +void rgb_matrix_increase_sat(void); +void rgb_matrix_decrease_sat(void); +void rgb_matrix_increase_val(void); +void rgb_matrix_decrease_val(void); +void rgb_matrix_increase_speed(void); +void rgb_matrix_decrease_speed(void); +void rgb_matrix_mode(uint8_t mode); +void rgb_matrix_mode_noeeprom(uint8_t mode); +uint32_t rgb_matrix_get_mode(void); + +#ifndef RGBLIGHT_ENABLE +#define rgblight_toggle() rgb_matrix_toggle() +#define rgblight_enable() rgb_matrix_enable() +#define rgblight_enable_noeeprom() rgb_matrix_enable_noeeprom() +#define rgblight_disable() rgb_matrix_disable() +#define rgblight_disable_noeeprom() rgb_matrix_disable_noeeprom() +#define rgblight_step() rgb_matrix_step() +#define rgblight_sethsv(hue, sat, val) rgb_matrix_sethsv(hue, sat, val) +#define rgblight_sethsv_noeeprom(hue, sat, val) rgb_matrix_sethsv_noeeprom(hue, sat, val) +#define rgblight_step_reverse() rgb_matrix_step_reverse() +#define rgblight_increase_hue() rgb_matrix_increase_hue() +#define rgblight_decrease_hue() rgb_matrix_decrease_hue() +#define rgblight_increase_sat() rgb_matrix_increase_sat() +#define rgblight_decrease_sat() rgb_matrix_decrease_sat() +#define rgblight_increase_val() rgb_matrix_increase_val() +#define rgblight_decrease_val() rgb_matrix_decrease_val() +#define rgblight_increase_speed() rgb_matrix_increase_speed() +#define rgblight_decrease_speed() rgb_matrix_decrease_speed() +#define rgblight_mode(mode) rgb_matrix_mode(mode) +#define rgblight_mode_noeeprom(mode) rgb_matrix_mode_noeeprom(mode) +#define rgblight_get_mode() rgb_matrix_get_mode() + +#endif typedef struct { /* Perform any initialisation required for the other driver functions to work. */ diff --git a/quantum/rgblight.c b/quantum/rgblight.c index 9ce3b23092..a2d6fe7a07 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -325,13 +325,13 @@ void rgblight_disable_noeeprom(void) { // Deals with the messy details of incrementing an integer -uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { +static uint8_t increment( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { int16_t new_value = value; new_value += step; return MIN( MAX( new_value, min ), max ); } -uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { +static uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max ) { int16_t new_value = value; new_value -= step; return MIN( MAX( new_value, min ), max ); -- cgit v1.2.3 From 3a0f3a5bd0aff18934431ad471b1db390c3b33d1 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 3 Dec 2018 16:42:57 -0800 Subject: Make ARM Audio max volume configurable (#4540) * Make ARM Audio max volume configurable * Update docs/feature_audio.md Co-Authored-By: drashna * Update docs/feature_audio.md Co-Authored-By: drashna --- docs/feature_audio.md | 7 +++++++ quantum/audio/audio_arm.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index 82e0ed9503..a39c456873 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -65,6 +65,13 @@ The available keycodes for audio are: * `AU_OFF` - Turn audio mode off * `AU_TOG` - Toggle audio mode +## ARM Audio Volume + +For ARM devices, you can adjust the DAC sample values. If your board is too loud for you or your coworkers, you can set the max using `DAC_SAMPLE_MAX` in your `config.h`: + +```c +#define DAC_SAMPLE_MAX 65535U +``` ## Music Mode diff --git a/quantum/audio/audio_arm.c b/quantum/audio/audio_arm.c index 18e8a8c66d..989f7a64be 100644 --- a/quantum/audio/audio_arm.c +++ b/quantum/audio/audio_arm.c @@ -80,7 +80,9 @@ float startup_song[][2] = STARTUP_SONG; static void gpt_cb8(GPTDriver *gptp); #define DAC_BUFFER_SIZE 720 +#ifndef DAC_SAMPLE_MAX #define DAC_SAMPLE_MAX 65535U +#endif #define START_CHANNEL_1() gptStart(&GPTD6, &gpt6cfg1); \ gptStartContinuous(&GPTD6, 2U) -- cgit v1.2.3 From ac4fd5e99e81a09a481066f61211f598c7b218a0 Mon Sep 17 00:00:00 2001 From: Luciano Malavasi Date: Mon, 3 Dec 2018 20:45:41 -0800 Subject: Keymap: Fixed include statement in my Let's Split keymap. (#4543) * keymap + alpha * some fixes * keymap + alpha * some fixes * drashna changes * linked main Alpha repo in keyboards/alpha readme * missed a spot * there's another function called FUNC lol * keymap + alpha * some fixes * keymap + alpha * drashna changes * Fixed include * Revert "Fixed include" This reverts commit ea92f261f86d8433eab313cde498adca1682a006. * messed up my git, fixed include --- keyboards/lets_split/keymaps/pyrol/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/lets_split/keymaps/pyrol/keymap.c b/keyboards/lets_split/keymaps/pyrol/keymap.c index 23d779232f..c5227f5afa 100644 --- a/keyboards/lets_split/keymaps/pyrol/keymap.c +++ b/keyboards/lets_split/keymaps/pyrol/keymap.c @@ -1,4 +1,4 @@ -#include QMK_KEYBOARD_h +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; -- cgit v1.2.3 From 4bb28d2df092408a7a0e32a8d8ab47b7f4008fcd Mon Sep 17 00:00:00 2001 From: VM Date: Tue, 4 Dec 2018 00:10:28 -0500 Subject: Keymap: adding my keymap primarily to iris (#4541) --- keyboards/iris/keymaps/omgvee/config.h | 49 +++++++++ keyboards/iris/keymaps/omgvee/keymap.c | 173 ++++++++++++++++++++++++++++++++ keyboards/iris/keymaps/omgvee/readme.md | 17 ++++ keyboards/iris/keymaps/omgvee/rules.mk | 7 ++ 4 files changed, 246 insertions(+) create mode 100644 keyboards/iris/keymaps/omgvee/config.h create mode 100644 keyboards/iris/keymaps/omgvee/keymap.c create mode 100644 keyboards/iris/keymaps/omgvee/readme.md create mode 100644 keyboards/iris/keymaps/omgvee/rules.mk diff --git a/keyboards/iris/keymaps/omgvee/config.h b/keyboards/iris/keymaps/omgvee/config.h new file mode 100644 index 0000000000..c29201fe1f --- /dev/null +++ b/keyboards/iris/keymaps/omgvee/config.h @@ -0,0 +1,49 @@ +/* +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 + +/* 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 15 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +//tap dance shenanigans +#define TAPPING_TERM 200 + +//force n-key rollover to be enabled every boot +#define FORCE_NKRO + +//some mouse keys tweaking, as it is generally too slow by default +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_WHEEL_DELAY 0 \ No newline at end of file diff --git a/keyboards/iris/keymaps/omgvee/keymap.c b/keyboards/iris/keymaps/omgvee/keymap.c new file mode 100644 index 0000000000..da76b593b6 --- /dev/null +++ b/keyboards/iris/keymaps/omgvee/keymap.c @@ -0,0 +1,173 @@ +#include QMK_KEYBOARD_H +#include + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MOUSE 3 +#define _ADJUST 4 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + MOUSE, + ADJUST, +}; + +#define KC_MOUS TT(_MOUSE) // double tab toggle mouse layer +#define MS_L KC_MS_LEFT +#define MS_R KC_MS_RIGHT +#define MS_U KC_MS_UP +#define MS_D KC_MS_DOWN +#define MS_B1 KC_MS_BTN1 +#define MS_B2 KC_MS_BTN2 +#define MW_U KC_MS_WH_UP +#define MW_D KC_MS_WH_DOWN +#define MW_L KC_MS_WH_LEFT +#define MW_R KC_MS_WH_RIGHT + +//Tap Dance Declarations +enum { + TD_SCL = 0 +}; +//Tap Dance Definitions +qk_tap_dance_action_t tap_dance_actions[] = { + //Tap once for Shift, twice for Caps Lock + [TD_SCL] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) +}; +enum { + TD_EBT = 0 +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + TD(TD_SCL), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_MOUS, KC_MOUS, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LALT, LOWER, KC_ENT, KC_SPC, RAISE, KC_LGUI + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_MINS, KC_EQL, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, KC_PIPE, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,_______, KC_ENT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LCTL, _______, _______, _______, KC_LCBR, KC_LBRC, KC_LPRN, KC_RPRN, KC_RBRC, KC_RCBR, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, KC_DEL, KC_DEL, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_TILD, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + RGB_MOD, KC_MPRV, KC_MNXT, _______, KC_PGUP, KC_UNDS, KC_EQL, KC_HOME, RGB_HUI, RGB_SAI, RGB_VAI, KC_ENT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_MSTP, KC_MPLY, _______, KC_PGDN, KC_MINS, KC_LPRN, KC_RPRN, KC_PLUS, KC_END, RGB_HUD, RGB_SAD, RGB_VAD, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_MOUSE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + BL_BRTG, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, RESET, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + BL_TOGG, MS_B1, MS_U, MS_B2, MW_U, _______, _______, MS_B1, MS_B2, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, MS_L, MS_D, MS_R, MW_D, _______, MS_L, MS_D , MS_U, MS_R ,_______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + BL_STEP, _______, _______, MW_L, MW_R, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, RESET, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, KC_BRID, KC_BRIU, KC_VOLD, KC_VOLU, KC_MUTE, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ) +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + dprintf("Got on layer %s ", LOWER); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_LOWER); + dprintf("Got off layer %s ", LOWER); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + dprintf("Got on layer %s ", RAISE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_RAISE); + dprintf("Got off layer %s ", RAISE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case MOUSE: + if (record->event.pressed) { + layer_on(_MOUSE); + dprintf("Got on layer %s ", MOUSE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } else { + layer_off(_MOUSE); + dprintf("Got off layer %s ", MOUSE); + update_tri_layer(_LOWER, _RAISE, _MOUSE); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/omgvee/readme.md b/keyboards/iris/keymaps/omgvee/readme.md new file mode 100644 index 0000000000..bf9a5acb1f --- /dev/null +++ b/keyboards/iris/keymaps/omgvee/readme.md @@ -0,0 +1,17 @@ +# Reade.md for what I want from an Iris perfect layout +====================================================== + + +![My beloved IRIS keeb](https://i.imgur.com/wgsb37e.jpg) + +- mouse keys +- media keys and media controls +- in-switch LED intensity controls (+/-) +- underglow RGB hue/color controls +- underglow RGB intensity controls +- familiar key arrangement with Enter and symbols on the usual keys (to the right hand side) +- navigation keys should be the vim ones really, and same ones used for mouse; +- also have alternates on the same layer, in the form of AWSD, as well as HJKL (keep in mind the order is Left, Up, Down, Right) +- arrow keys on one layer, however with another modifier key, they become left=home, right=end, up=page up, down=page Down + +See keymap.c for layouts \ No newline at end of file diff --git a/keyboards/iris/keymaps/omgvee/rules.mk b/keyboards/iris/keymaps/omgvee/rules.mk new file mode 100644 index 0000000000..281f64c7eb --- /dev/null +++ b/keyboards/iris/keymaps/omgvee/rules.mk @@ -0,0 +1,7 @@ +RGBLIGHT_ENABLE = yes +BACKLIGHT_ENABLE = yes +MOUSEKEY_ENABLE = yes +CONSOLE_ENABLE = no +COMMAND_ENABLE = yes +TAP_DANCE_ENABLE = yes +NKRO_ENABLE = yes -- cgit v1.2.3 From 4099536c0e7a099b181a80e483b4b95f389b5a7e Mon Sep 17 00:00:00 2001 From: ishtob Date: Tue, 4 Dec 2018 11:04:57 -0500 Subject: adding Hadron v3 keyboard, QWIIC devices support, haptic feedback support (#4462) * add initial support for hadron ver3 * add initial support for hadron ver3 * pull qwiic support for micro_led to be modified for use in hadron's 64x24 ssd1306 oled display * initial work on OLED using qwiic driver * early work to get 128x32 oled working by redefining qwiic micro oled parameters. Currently working, but would affect qwiic's micro oled functionality * moved oled defines to config.h and added ifndef to micro_oled driver * WORKING :D - note, still work in progress to get the start location correct on the 128x32 display. * added equation to automatically calculate display offset based on screen width * adding time-out timer to oled display * changed read lock staus via read_led_state * lock indications fixes * Added scroll lock indication to oled * add support for DRV2605 haptic driver * Improve readabiity of DRV2605 driver. -added typedef for waveform library -added unions for registers * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob * Update keyboards/hadron/ver2/keymaps/default/config.h Co-Authored-By: ishtob * Fixes for PR * PR fixes * fix old persistent layer function to use new set_single_persistent_default_layer * fix issues with changing makefile defines that broken per-key haptic pulse * Comment fixes * Add definable parameter and auto-calibration based on motor choice --- common_features.mk | 9 + drivers/arm/i2c_master.c | 12 +- drivers/arm/i2c_master.h | 1 + drivers/haptic/DRV2605L.c | 129 +++ drivers/haptic/DRV2605L.h | 394 +++++++ drivers/qwiic/micro_oled.c | 691 ++++++++++++ drivers/qwiic/micro_oled.h | 134 +++ drivers/qwiic/qwiic.c | 31 + drivers/qwiic/qwiic.h | 28 + drivers/qwiic/qwiic.mk | 18 + drivers/qwiic/util/font5x7.h | 288 +++++ drivers/qwiic/util/font8x16.h | 127 +++ keyboards/hadron/config.h | 10 +- keyboards/hadron/hadron.c | 24 - keyboards/hadron/hadron.h | 4 +- keyboards/hadron/keymaps/default/config.h | 20 - keyboards/hadron/keymaps/default/keymap.c | 493 -------- keyboards/hadron/keymaps/default/readme.md | 2 - keyboards/hadron/keymaps/default/rules.mk | 24 - keyboards/hadron/keymaps/readme.md | 23 - keyboards/hadron/keymaps/side_numpad/config.h | 20 - keyboards/hadron/keymaps/side_numpad/keymap.c | 502 --------- keyboards/hadron/keymaps/side_numpad/readme.md | 2 - keyboards/hadron/keymaps/side_numpad/rules.mk | 26 - keyboards/hadron/readme.md | 4 +- keyboards/hadron/rules.mk | 73 -- keyboards/hadron/ver2/config.h | 11 + keyboards/hadron/ver2/keymaps/default/config.h | 9 + keyboards/hadron/ver2/keymaps/default/keymap.c | 448 ++++++++ keyboards/hadron/ver2/keymaps/default/readme.md | 2 + keyboards/hadron/ver2/keymaps/readme.md | 23 + keyboards/hadron/ver2/keymaps/side_numpad/config.h | 8 + keyboards/hadron/ver2/keymaps/side_numpad/keymap.c | 484 ++++++++ .../hadron/ver2/keymaps/side_numpad/readme.md | 2 + keyboards/hadron/ver2/keymaps/side_numpad/rules.mk | 26 + keyboards/hadron/ver2/rules.mk | 77 +- keyboards/hadron/ver2/ver2.c | 27 +- .../ver3/boards/GENERIC_STM32_F303XC/board.c | 126 +++ .../ver3/boards/GENERIC_STM32_F303XC/board.h | 1187 ++++++++++++++++++++ .../ver3/boards/GENERIC_STM32_F303XC/board.mk | 5 + keyboards/hadron/ver3/bootloader_defs.h | 7 + keyboards/hadron/ver3/chconf.h | 520 +++++++++ keyboards/hadron/ver3/config.h | 192 ++++ keyboards/hadron/ver3/halconf.h | 388 +++++++ keyboards/hadron/ver3/keymaps/default/config.h | 1 + keyboards/hadron/ver3/keymaps/default/keymap.c | 295 +++++ keyboards/hadron/ver3/keymaps/default/readme.md | 2 + keyboards/hadron/ver3/keymaps/readme.md | 23 + keyboards/hadron/ver3/matrix.c | 195 ++++ keyboards/hadron/ver3/mcuconf.h | 257 +++++ keyboards/hadron/ver3/rev3.h | 21 + keyboards/hadron/ver3/rules.mk | 57 + keyboards/hadron/ver3/ver3.c | 196 ++++ keyboards/hadron/ver3/ver3.h | 21 + keyboards/helix/rev1/keymaps/OLED_sample/rules.mk | 25 - tmk_core/common/action_layer.h | 4 +- tmk_core/common/keyboard.c | 10 + 57 files changed, 6487 insertions(+), 1251 deletions(-) create mode 100644 drivers/haptic/DRV2605L.c create mode 100644 drivers/haptic/DRV2605L.h create mode 100644 drivers/qwiic/micro_oled.c create mode 100644 drivers/qwiic/micro_oled.h create mode 100644 drivers/qwiic/qwiic.c create mode 100644 drivers/qwiic/qwiic.h create mode 100644 drivers/qwiic/qwiic.mk create mode 100644 drivers/qwiic/util/font5x7.h create mode 100644 drivers/qwiic/util/font8x16.h delete mode 100644 keyboards/hadron/keymaps/default/config.h delete mode 100644 keyboards/hadron/keymaps/default/keymap.c delete mode 100644 keyboards/hadron/keymaps/default/readme.md delete mode 100644 keyboards/hadron/keymaps/default/rules.mk delete mode 100644 keyboards/hadron/keymaps/readme.md delete mode 100644 keyboards/hadron/keymaps/side_numpad/config.h delete mode 100644 keyboards/hadron/keymaps/side_numpad/keymap.c delete mode 100644 keyboards/hadron/keymaps/side_numpad/readme.md delete mode 100644 keyboards/hadron/keymaps/side_numpad/rules.mk create mode 100644 keyboards/hadron/ver2/keymaps/default/config.h create mode 100644 keyboards/hadron/ver2/keymaps/default/keymap.c create mode 100644 keyboards/hadron/ver2/keymaps/default/readme.md create mode 100644 keyboards/hadron/ver2/keymaps/readme.md create mode 100644 keyboards/hadron/ver2/keymaps/side_numpad/config.h create mode 100644 keyboards/hadron/ver2/keymaps/side_numpad/keymap.c create mode 100644 keyboards/hadron/ver2/keymaps/side_numpad/readme.md create mode 100644 keyboards/hadron/ver2/keymaps/side_numpad/rules.mk create mode 100644 keyboards/hadron/ver3/boards/GENERIC_STM32_F303XC/board.c create mode 100644 keyboards/hadron/ver3/boards/GENERIC_STM32_F303XC/board.h create mode 100644 keyboards/hadron/ver3/boards/GENERIC_STM32_F303XC/board.mk create mode 100644 keyboards/hadron/ver3/bootloader_defs.h create mode 100644 keyboards/hadron/ver3/chconf.h create mode 100644 keyboards/hadron/ver3/config.h create mode 100644 keyboards/hadron/ver3/halconf.h create mode 100644 keyboards/hadron/ver3/keymaps/default/config.h create mode 100644 keyboards/hadron/ver3/keymaps/default/keymap.c create mode 100644 keyboards/hadron/ver3/keymaps/default/readme.md create mode 100644 keyboards/hadron/ver3/keymaps/readme.md create mode 100644 keyboards/hadron/ver3/matrix.c create mode 100644 keyboards/hadron/ver3/mcuconf.h create mode 100644 keyboards/hadron/ver3/rev3.h create mode 100644 keyboards/hadron/ver3/rules.mk create mode 100644 keyboards/hadron/ver3/ver3.c create mode 100644 keyboards/hadron/ver3/ver3.h delete mode 100644 keyboards/helix/rev1/keymaps/OLED_sample/rules.mk diff --git a/common_features.mk b/common_features.mk index 8f53a82aae..bd88e04d62 100644 --- a/common_features.mk +++ b/common_features.mk @@ -225,6 +225,13 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes) OPT_DEFS += -DENCODER_ENABLE endif +ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L) + COMMON_VPATH += $(DRIVER_PATH)/haptic + SRC += DRV2605L.c + SRC += i2c_master.c + OPT_DEFS += -DDRV2605L +endif + ifeq ($(strip $(HD44780_ENABLE)), yes) SRC += drivers/avr/hd44780.c OPT_DEFS += -DHD44780_ENABLE @@ -240,6 +247,8 @@ ifeq ($(strip $(LEADER_ENABLE)), yes) OPT_DEFS += -DLEADER_ENABLE endif +include $(DRIVER_PATH)/qwiic/qwiic.mk + QUANTUM_SRC:= \ $(QUANTUM_DIR)/quantum.c \ $(QUANTUM_DIR)/keymap_common.c \ diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index de58438392..ab962ea959 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -32,7 +32,7 @@ static uint8_t i2c_address; -// This configures the I2C clock to 400Mhz assuming a 72Mhz clock +// This configures the I2C clock to 400khz assuming a 72Mhz clock // For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html static const I2CConfig i2cconfig = { STM32_TIMINGR_PRESC(15U) | @@ -45,10 +45,14 @@ static const I2CConfig i2cconfig = { __attribute__ ((weak)) void i2c_init(void) { - setPinInput(B6); // Try releasing special pins for a short time - setPinInput(B7); - chThdSleepMilliseconds(10); + //palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); + + // Try releasing special pins for a short time + palSetPadMode(GPIOB, 6, PAL_MODE_INPUT); + palSetPadMode(GPIOB, 7, PAL_MODE_INPUT); + chThdSleepMilliseconds(10); + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); diff --git a/drivers/arm/i2c_master.h b/drivers/arm/i2c_master.h index 591fa7f77d..392760328f 100644 --- a/drivers/arm/i2c_master.h +++ b/drivers/arm/i2c_master.h @@ -34,6 +34,7 @@ void i2c_init(void); uint8_t i2c_start(uint8_t address); uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout); +uint8_t i2c_transmit_receive(uint8_t address, uint8_t * tx_body, uint16_t tx_length, uint8_t * rx_body, uint16_t rx_length); uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout); uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout); uint8_t i2c_stop(uint16_t timeout); diff --git a/drivers/haptic/DRV2605L.c b/drivers/haptic/DRV2605L.c new file mode 100644 index 0000000000..97ca292b9b --- /dev/null +++ b/drivers/haptic/DRV2605L.c @@ -0,0 +1,129 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * 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 . + */ +#include "DRV2605L.h" +#include "print.h" +#include +#include +#include + + +uint8_t DRV2605L_transfer_buffer[20]; +uint8_t DRV2605L_tx_register[0]; +uint8_t DRV2605L_read_buffer[0]; +uint8_t DRV2605L_read_register; + + +void DRV_write(uint8_t drv_register, uint8_t settings) { + DRV2605L_transfer_buffer[0] = drv_register; + DRV2605L_transfer_buffer[1] = settings; + i2c_transmit(DRV2605L_BASE_ADDRESS << 1, DRV2605L_transfer_buffer, 2, 100); +} + +uint8_t DRV_read(uint8_t regaddress) { + DRV2605L_tx_register[0] = regaddress; + if (MSG_OK != i2c_transmit_receive(DRV2605L_BASE_ADDRESS << 1, + DRV2605L_tx_register, 1, + DRV2605L_read_buffer, 1 +)){ + printf("err reading reg \n"); + } + DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0]; +return DRV2605L_read_register; +} + +void DRV_init(void) +{ + i2c_init(); + i2c_start(DRV2605L_BASE_ADDRESS); + + /* 0x07 sets DRV2605 into calibration mode */ + DRV_write(DRV_MODE,0x07); + +// DRV_write(DRV_FEEDBACK_CTRL,0xB6); + + #if FB_ERM_LRA == 0 + /* ERM settings */ + DRV_write(DRV_RATED_VOLT, (RATED_VOLTAGE/21.33)*1000); + #if ERM_OPEN_LOOP == 0 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (((V_PEAK*(DRIVE_TIME+BLANKING_TIME+IDISS_TIME))/0.02133)/(DRIVE_TIME-0.0003))); + #elif ERM_OPEN_LOOP == 1 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK/0.02196)); + #endif + #elif FB_ERM_LRA == 1 + DRV_write(DRV_RATED_VOLT, ((V_RMS * sqrt(1 - ((4 * ((150+(SAMPLE_TIME*50))*0.000001)) + 0.0003)* F_LRA)/0.02071))); + #if LRA_OPEN_LOOP == 0 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, ((V_PEAK/sqrt(1-(F_LRA*0.0008))/0.02133))); + #elif LRA_OPEN_LOOP == 1 + DRV_write(DRV_OVERDRIVE_CLAMP_VOLT, (V_PEAK/0.02196)); + #endif + #endif + + DRVREG_FBR FB_SET; + FB_SET.Bits.ERM_LRA = FB_ERM_LRA; + FB_SET.Bits.BRAKE_FACTOR = FB_BRAKEFACTOR; + FB_SET.Bits.LOOP_GAIN =FB_LOOPGAIN; + FB_SET.Bits.BEMF_GAIN = 0; /* auto-calibration populates this field*/ + DRV_write(DRV_FEEDBACK_CTRL, (uint8_t) FB_SET.Byte); + DRVREG_CTRL1 C1_SET; + C1_SET.Bits.C1_DRIVE_TIME = DRIVE_TIME; + C1_SET.Bits.C1_AC_COUPLE = AC_COUPLE; + C1_SET.Bits.C1_STARTUP_BOOST = STARTUP_BOOST; + DRV_write(DRV_CTRL_1, (uint8_t) C1_SET.Byte); + DRVREG_CTRL2 C2_SET; + C2_SET.Bits.C2_BIDIR_INPUT = BIDIR_INPUT; + C2_SET.Bits.C2_BRAKE_STAB = BRAKE_STAB; + C2_SET.Bits.C2_SAMPLE_TIME = SAMPLE_TIME; + C2_SET.Bits.C2_BLANKING_TIME = BLANKING_TIME; + C2_SET.Bits.C2_IDISS_TIME = IDISS_TIME; + DRV_write(DRV_CTRL_2, (uint8_t) C2_SET.Byte); + DRVREG_CTRL3 C3_SET; + C3_SET.Bits.C3_LRA_OPEN_LOOP = LRA_OPEN_LOOP; + C3_SET.Bits.C3_N_PWM_ANALOG = N_PWM_ANALOG; + C3_SET.Bits.C3_LRA_DRIVE_MODE = LRA_DRIVE_MODE; + C3_SET.Bits.C3_DATA_FORMAT_RTO = DATA_FORMAT_RTO; + C3_SET.Bits.C3_SUPPLY_COMP_DIS = SUPPLY_COMP_DIS; + C3_SET.Bits.C3_ERM_OPEN_LOOP = ERM_OPEN_LOOP; + C3_SET.Bits.C3_NG_THRESH = NG_THRESH; + DRV_write(DRV_CTRL_3, (uint8_t) C3_SET.Byte); + DRVREG_CTRL4 C4_SET; + C4_SET.Bits.C4_ZC_DET_TIME = ZC_DET_TIME; + C4_SET.Bits.C4_AUTO_CAL_TIME = AUTO_CAL_TIME; + DRV_write(DRV_CTRL_4, (uint8_t) C4_SET.Byte); + DRV_write(DRV_LIB_SELECTION,LIB_SELECTION); + //start autocalibration + DRV_write(DRV_GO, 0x01); + + /* 0x00 sets DRV2605 out of standby and to use internal trigger + * 0x01 sets DRV2605 out of standby and to use external trigger */ + DRV_write(DRV_MODE,0x00); + + /* 0x06: LRA library */ + DRV_write(DRV_WAVEFORM_SEQ_1, 0x01); + + /* 0xB9: LRA, 4x brake factor, medium gain, 7.5x back EMF + * 0x39: ERM, 4x brake factor, medium gain, 1.365x back EMF */ + + /* TODO: setup auto-calibration as part of initiation */ + +} + +void DRV_pulse(uint8_t sequence) +{ + DRV_write(DRV_GO, 0x00); + DRV_write(DRV_WAVEFORM_SEQ_1, sequence); + DRV_write(DRV_GO, 0x01); +} \ No newline at end of file diff --git a/drivers/haptic/DRV2605L.h b/drivers/haptic/DRV2605L.h new file mode 100644 index 0000000000..de9d294e9d --- /dev/null +++ b/drivers/haptic/DRV2605L.h @@ -0,0 +1,394 @@ +/* Copyright 2018 ishtob + * Driver for DRV2605L written for QMK + * + * 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 +#include "i2c_master.h" + +/* Initialization settings + + * Feedback Control Settings */ +#ifndef FB_ERM_LRA +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#endif +#ifndef FB_BRAKEFACTOR +#define FB_BRAKEFACTOR 3 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#endif +#ifndef FB_LOOPGAIN +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +#endif + +#ifndef RATED_VOLTAGE +#define RATED_VOLTAGE 2 /* 2v as safe range in case device voltage is not set */ +#ifndef V_PEAK +#define V_PEAK 2.8 +#endif +#endif + +/* LRA specific settings */ +#if FB_ERM_LRA == 1 +#ifndef V_RMS +#define V_RMS 2.0 +#endif +#ifndef V_PEAK +#define V_PEAK 2.1 +#endif +#ifndef F_LRA +#define F_LRA 205 +#endif +#endif + +/* Library Selection */ +#ifndef LIB_SELECTION +#if FB_ERM_LRA == 1 +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +#else +#define LIB_SELECTION 1 +#endif +#endif + +/* Control 1 register settings */ +#ifndef DRIVE_TIME +#define DRIVE_TIME 25 +#endif +#ifndef AC_COUPLE +#define AC_COUPLE 0 +#endif +#ifndef STARTUP_BOOST +#define STARTUP_BOOST 1 +#endif + +/* Control 2 Settings */ +#ifndef BIDIR_INPUT +#define BIDIR_INPUT 1 +#endif +#ifndef BRAKE_STAB +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#endif +#ifndef SAMPLE_TIME +#define SAMPLE_TIME 3 +#endif +#ifndef BLANKING_TIME +#define BLANKING_TIME 1 +#endif +#ifndef IDISS_TIME +#define IDISS_TIME 1 +#endif + +/* Control 3 settings */ +#ifndef NG_THRESH +#define NG_THRESH 2 +#endif +#ifndef ERM_OPEN_LOOP +#define ERM_OPEN_LOOP 1 +#endif +#ifndef SUPPLY_COMP_DIS +#define SUPPLY_COMP_DIS 0 +#endif +#ifndef DATA_FORMAT_RTO +#define DATA_FORMAT_RTO 0 +#endif +#ifndef LRA_DRIVE_MODE +#define LRA_DRIVE_MODE 0 +#endif +#ifndef N_PWM_ANALOG +#define N_PWM_ANALOG 0 +#endif +#ifndef LRA_OPEN_LOOP +#define LRA_OPEN_LOOP 0 +#endif + +/* Control 4 settings */ +#ifndef ZC_DET_TIME +#define ZC_DET_TIME 0 +#endif +#ifndef AUTO_CAL_TIME +#define AUTO_CAL_TIME 3 +#endif + +/* register defines -------------------------------------------------------- */ +#define DRV2605L_BASE_ADDRESS 0x5A /* DRV2605L Base address */ +#define DRV_STATUS 0x00 +#define DRV_MODE 0x01 +#define DRV_RTP_INPUT 0x02 +#define DRV_LIB_SELECTION 0x03 +#define DRV_WAVEFORM_SEQ_1 0x04 +#define DRV_WAVEFORM_SEQ_2 0x05 +#define DRV_WAVEFORM_SEQ_3 0x06 +#define DRV_WAVEFORM_SEQ_4 0x07 +#define DRV_WAVEFORM_SEQ_5 0x08 +#define DRV_WAVEFORM_SEQ_6 0x09 +#define DRV_WAVEFORM_SEQ_7 0x0A +#define DRV_WAVEFORM_SEQ_8 0x0B +#define DRV_GO 0x0C +#define DRV_OVERDRIVE_TIME_OFFSET 0x0D +#define DRV_SUSTAIN_TIME_OFFSET_P 0x0E +#define DRV_SUSTAIN_TIME_OFFSET_N 0x0F +#define DRV_BRAKE_TIME_OFFSET 0x10 +#define DRV_AUDIO_2_VIBE_CTRL 0x11 +#define DRV_AUDIO_2_VIBE_MIN_IN 0x12 +#define DRV_AUDIO_2_VIBE_MAX_IN 0x13 +#define DRV_AUDIO_2_VIBE_MIN_OUTDRV 0x14 +#define DRV_AUDIO_2_VIBE_MAX_OUTDRV 0x15 +#define DRV_RATED_VOLT 0x16 +#define DRV_OVERDRIVE_CLAMP_VOLT 0x17 +#define DRV_AUTO_CALIB_COMP_RESULT 0x18 +#define DRV_AUTO_CALIB_BEMF_RESULT 0x19 +#define DRV_FEEDBACK_CTRL 0x1A +#define DRV_CTRL_1 0x1B +#define DRV_CTRL_2 0x1C +#define DRV_CTRL_3 0x1D +#define DRV_CTRL_4 0x1E +#define DRV_CTRL_5 0x1F +#define DRV_OPEN_LOOP_PERIOD 0x20 +#define DRV_VBAT_VOLT_MONITOR 0x21 +#define DRV_LRA_RESONANCE_PERIOD 0x22 + +void DRV_init(void); +void DRV_write(const uint8_t drv_register, const uint8_t settings); +uint8_t DRV_read(const uint8_t regaddress); +void DRV_pulse(const uint8_t sequence); + + +typedef enum DRV_EFFECT{ + clear_sequence = 0, + strong_click = 1, + strong_click_60 = 2, + strong_click_30 = 3, + sharp_click = 4, + sharp_click_60 = 5, + sharp_click_30 = 6, + soft_bump = 7, + soft_bump_60 = 8, + soft_bump_30 = 9, + dbl_click = 10, + dbl_click_60 = 11, + trp_click = 12, + soft_fuzz = 13, + strong_buzz = 14, + alert_750ms = 15, + alert_1000ms = 16, + strong_click1 = 17, + strong_click2_80 = 18, + strong_click3_60 = 19, + strong_click4_30 = 20, + medium_click1 = 21, + medium_click2_80 = 22, + medium_click3_60 = 23, + sharp_tick1 = 24, + sharp_tick2_80 = 25, + sharp_tick3_60 = 26, + sh_dblclick_str = 27, + sh_dblclick_str_80 = 28, + sh_dblclick_str_60 = 29, + sh_dblclick_str_30 = 30, + sh_dblclick_med = 31, + sh_dblclick_med_80 = 32, + sh_dblclick_med_60 = 33, + sh_dblsharp_tick = 34, + sh_dblsharp_tick_80 = 35, + sh_dblsharp_tick_60 = 36, + lg_dblclick_str = 37, + lg_dblclick_str_80 = 38, + lg_dblclick_str_60 = 39, + lg_dblclick_str_30 = 40, + lg_dblclick_med = 41, + lg_dblclick_med_80 = 42, + lg_dblclick_med_60 = 43, + lg_dblsharp_tick = 44, + lg_dblsharp_tick_80 = 45, + lg_dblsharp_tick_60 = 46, + buzz = 47, + buzz_80 = 48, + buzz_60 = 49, + buzz_40 = 50, + buzz_20 = 51, + pulsing_strong = 52, + pulsing_strong_80 = 53, + pulsing_medium = 54, + pulsing_medium_80 = 55, + pulsing_sharp = 56, + pulsing_sharp_80 = 57, + transition_click = 58, + transition_click_80 = 59, + transition_click_60 = 60, + transition_click_40 = 61, + transition_click_20 = 62, + transition_click_10 = 63, + transition_hum = 64, + transition_hum_80 = 65, + transition_hum_60 = 66, + transition_hum_40 = 67, + transition_hum_20 = 68, + transition_hum_10 = 69, + transition_rampdown_long_smooth1 = 70, + transition_rampdown_long_smooth2 = 71, + transition_rampdown_med_smooth1 = 72, + transition_rampdown_med_smooth2 = 73, + transition_rampdown_short_smooth1 = 74, + transition_rampdown_short_smooth2 = 75, + transition_rampdown_long_sharp1 = 76, + transition_rampdown_long_sharp2 = 77, + transition_rampdown_med_sharp1 = 78, + transition_rampdown_med_sharp2 = 79, + transition_rampdown_short_sharp1 = 80, + transition_rampdown_short_sharp2 = 81, + transition_rampup_long_smooth1 = 82, + transition_rampup_long_smooth2 = 83, + transition_rampup_med_smooth1 = 84, + transition_rampup_med_smooth2 = 85, + transition_rampup_short_smooth1 = 86, + transition_rampup_short_smooth2 = 87, + transition_rampup_long_sharp1 = 88, + transition_rampup_long_sharp2 = 89, + transition_rampup_med_sharp1 = 90, + transition_rampup_med_sharp2 = 91, + transition_rampup_short_sharp1 = 92, + transition_rampup_short_sharp2 = 93, + transition_rampdown_long_smooth1_50 = 94, + transition_rampdown_long_smooth2_50 = 95, + transition_rampdown_med_smooth1_50 = 96, + transition_rampdown_med_smooth2_50 = 97, + transition_rampdown_short_smooth1_50 = 98, + transition_rampdown_short_smooth2_50 = 99, + transition_rampdown_long_sharp1_50 = 100, + transition_rampdown_long_sharp2_50 = 101, + transition_rampdown_med_sharp1_50 = 102, + transition_rampdown_med_sharp2_50 = 103, + transition_rampdown_short_sharp1_50 = 104, + transition_rampdown_short_sharp2_50 = 105, + transition_rampup_long_smooth1_50 = 106, + transition_rampup_long_smooth2_50 = 107, + transition_rampup_med_smooth1_50 = 108, + transition_rampup_med_smooth2_50 = 109, + transition_rampup_short_smooth1_50 = 110, + transition_rampup_short_smooth2_50 = 111, + transition_rampup_long_sharp1_50 = 112, + transition_rampup_long_sharp2_50 = 113, + transition_rampup_med_sharp1_50 = 114, + transition_rampup_med_sharp2_50 = 115, + transition_rampup_short_sharp1_50 = 116, + transition_rampup_short_sharp2_50 = 117, + long_buzz_for_programmatic_stopping = 118, + smooth_hum1_50 = 119, + smooth_hum2_40 = 120, + smooth_hum3_30 = 121, + smooth_hum4_20 = 122, + smooth_hum5_10 = 123, +} DRV_EFFECT; + +/* Register bit array unions */ + +typedef union DRVREG_STATUS { /* register 0x00 */ + uint8_t Byte; + struct { + uint8_t OC_DETECT :1; /* set to 1 when overcurrent event is detected */ + uint8_t OVER_TEMP :1; /* set to 1 when device exceeds temp threshold */ + uint8_t FB_STS :1; /* set to 1 when feedback controller has timed out */ + /* auto-calibration routine and diagnostic result + * result | auto-calibation | diagnostic | + * 0 | passed | actuator func normal | + * 1 | failed | actuator func fault* | + * * actuator is not present or is shorted, timing out, or giving out–of-range back-EMF */ + uint8_t DIAG_RESULT :1; + uint8_t :1; + uint8_t DEVICE_ID :3; /* Device IDs 3: DRV2605 4: DRV2604 5: DRV2604L 6: DRV2605L */ + } Bits; +} DRVREG_STATUS; + +typedef union DRVREG_MODE { /* register 0x01 */ + uint8_t Byte; + struct { + uint8_t MODE :3; /* Mode setting */ + uint8_t :3; + uint8_t STANDBY :1; /* 0:standby 1:ready */ + } Bits; +} DRVREG_MODE; + +typedef union DRVREG_WAIT { + uint8_t Byte; + struct { + uint8_t WAIT_MODE :1; /* Set to 1 to interpret as wait for next 7 bits x10ms */ + uint8_t WAIT_TIME :7; + } Bits; +} DRVREG_WAIT; + +typedef union DRVREG_FBR{ /* register 0x1A */ + uint8_t Byte; + struct { + uint8_t BEMF_GAIN :2; + uint8_t LOOP_GAIN :2; + uint8_t BRAKE_FACTOR :3; + uint8_t ERM_LRA :1; + } Bits; +} DRVREG_FBR; + +typedef union DRVREG_CTRL1{ /* register 0x1B */ + uint8_t Byte; + struct { + uint8_t C1_DRIVE_TIME :5; + uint8_t C1_AC_COUPLE :1; + uint8_t :1; + uint8_t C1_STARTUP_BOOST :1; + } Bits; +} DRVREG_CTRL1; + +typedef union DRVREG_CTRL2{ /* register 0x1C */ + uint8_t Byte; + struct { + uint8_t C2_IDISS_TIME :2; + uint8_t C2_BLANKING_TIME :2; + uint8_t C2_SAMPLE_TIME :2; + uint8_t C2_BRAKE_STAB :1; + uint8_t C2_BIDIR_INPUT :1; + } Bits; +} DRVREG_CTRL2; + +typedef union DRVREG_CTRL3{ /* register 0x1D */ + uint8_t Byte; + struct { + uint8_t C3_LRA_OPEN_LOOP :1; + uint8_t C3_N_PWM_ANALOG :1; + uint8_t C3_LRA_DRIVE_MODE :1; + uint8_t C3_DATA_FORMAT_RTO :1; + uint8_t C3_SUPPLY_COMP_DIS :1; + uint8_t C3_ERM_OPEN_LOOP :1; + uint8_t C3_NG_THRESH :2; + } Bits; +} DRVREG_CTRL3; + +typedef union DRVREG_CTRL4{ /* register 0x1E */ + uint8_t Byte; + struct { + uint8_t C4_OTP_PROGRAM :1; + uint8_t :1; + uint8_t C4_OTP_STATUS :1; + uint8_t :1; + uint8_t C4_AUTO_CAL_TIME :2; + uint8_t C4_ZC_DET_TIME :2; + } Bits; +} DRVREG_CTRL4; + +typedef union DRVREG_CTRL5{ /* register 0x1F */ + uint8_t Byte; + struct { + uint8_t C5_IDISS_TIME :2; + uint8_t C5_BLANKING_TIME :2; + uint8_t C5_PLAYBACK_INTERVAL :1; + uint8_t C5_LRA_AUTO_OPEN_LOOP :1; + uint8_t C5_AUTO_OL_CNT :2; + } Bits; +} DRVREG_CTRL5; \ No newline at end of file diff --git a/drivers/qwiic/micro_oled.c b/drivers/qwiic/micro_oled.c new file mode 100644 index 0000000000..35c5d6ee1d --- /dev/null +++ b/drivers/qwiic/micro_oled.c @@ -0,0 +1,691 @@ +/* Jim Lindblom @ SparkFun Electronics + * October 26, 2014 + * https://github.com/sparkfun/Micro_OLED_Breakout/tree/master/Firmware/Arduino/libraries/SFE_MicroOLED + * + * Modified by: + * Emil Varughese @ Edwin Robotics Pvt. Ltd. + * July 27, 2015 + * https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + * + * This code was heavily based around the MicroView library, written by GeekAmmo + * (https://github.com/geekammo/MicroView-Arduino-Library). + * + * Adapted for QMK by: + * Jack Humbert + * October 11, 2018 + * + * 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 3 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 . + */ +#include "micro_oled.h" +#include +#include "util/font5x7.h" +#include "util/font8x16.h" +#include "string.h" + +#define TOTALFONTS 2 +const unsigned char * fonts_pointer[]= { font5x7, font8x16 }; + +uint8_t foreColor,drawMode,fontWidth, fontHeight, fontType, fontStartChar, fontTotalChar, cursorX, cursorY; +uint16_t fontMapWidth; + +#define _BV(x) (1 << (x)) +#define swap(a, b) { uint8_t t = a; a = b; b = t; } + +uint8_t micro_oled_transfer_buffer[20]; +static uint8_t micro_oled_screen_current[LCDWIDTH*LCDWIDTH/8] = { 0 }; + +/* LCD Memory organised in 64 horizontal pixel and 6 rows of byte + B B .............B ----- + y y .............y \ + t t .............t \ + e e .............e \ + 0 1 .............63 \ + \ + D0 D0.............D0 \ + D1 D1.............D1 / ROW 0 + D2 D2.............D2 / + D3 D3.............D3 / + D4 D4.............D4 / + D5 D5.............D5 / + D6 D6.............D6 / + D7 D7.............D7 ---- + */ + +#if LCDWIDTH == 64 + #if LCDWIDTH == 48 +static uint8_t micro_oled_screen_buffer[] = { +// QMK Logo - generated at http://www.majer.ch/lcd/adf_bitmap.php +//64x48 image +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, +0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, +0xF8, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE, +0xFE, 0xF8, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x8C, 0x8C, 0x8C, 0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, +0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0x8C, 0x8C, 0x8C, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xF1, 0xE3, 0xE7, 0xCF, +0xCF, 0xCF, 0xCF, 0x00, 0x00, 0xCF, 0xCF, 0xCF, 0xC7, 0xE7, +0xE3, 0xF1, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, +0x06, 0x06, 0x1F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x7F, 0x7F, 0x1F, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, +0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00 +}; + #endif +#elif LCDWIDTH == 128 + #if LCDHEIGHT == 32 + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = { +//128x32 qmk image +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x80, 0xC0, 0xE0, 0xE0, 0xFC, 0xFC, 0xE0, 0xFC, 0xFC, +0xE0, 0xF0, 0xFC, 0xE0, 0xE0, 0xFC, 0xE0, 0xE0, 0xFC, 0xFC, +0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x30, 0xE0, 0x00, 0x00, +0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, +0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, +0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, +0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, +0x80, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xB2, 0xB2, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, 0x03, +0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, +0xFF, 0xB7, 0xB2, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x1F, 0x02, 0x02, 0x03, 0x01, 0x00, 0x06, 0x1F, 0x10, +0x10, 0x10, 0x1F, 0x06, 0x00, 0x03, 0x1E, 0x18, 0x0F, 0x01, +0x0F, 0x18, 0x1E, 0x01, 0x00, 0x0F, 0x1F, 0x12, 0x02, 0x12, +0x13, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0E, 0x1F, 0x12, +0x02, 0x12, 0x13, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x1F, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x48, 0x4D, 0x4D, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFE, 0xF8, 0xF9, 0xF3, 0xF3, 0xC0, 0x80, 0xF3, +0xF3, 0xF3, 0xF9, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, +0x4D, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0xC0, 0x00, 0x70, 0xC0, +0x00, 0x80, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, +0x04, 0x04, 0x04, 0x04, 0x1C, 0xF0, 0x00, 0x00, 0xFC, 0x0C, +0x38, 0xE0, 0x00, 0x00, 0xC0, 0x38, 0x0C, 0xFC, 0x00, 0x00, +0xFC, 0xFC, 0x60, 0x90, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x3F, +0x3F, 0x07, 0x3F, 0x3F, 0x07, 0x0F, 0x3F, 0x07, 0x07, 0x3F, +0x07, 0x07, 0x3F, 0x3F, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, +0x06, 0x04, 0x04, 0x07, 0x01, 0x00, 0x00, 0x13, 0x1E, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x04, 0x04, +0x04, 0x04, 0x07, 0x0D, 0x08, 0x00, 0x07, 0x00, 0x00, 0x01, +0x07, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x07, +0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00 + }; + #elif LCDHEIGHT == 64 + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = { +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, +0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, +0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFF, +0x7F, 0x7E, 0xFE, 0xFF, 0xFF, 0xFE, 0xFE, 0x7F, 0x7F, 0xFE, +0xFE, 0xFF, 0xFF, 0xFE, 0x7E, 0x7F, 0xFF, 0xFE, 0xFE, 0xFC, +0xFC, 0xF8, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x88, 0x88, 0x88, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, +0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xDD, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, +0xFF, 0xFF, 0xFE, 0xF8, 0xF0, 0xF3, 0xF3, 0xE7, 0xE7, 0x00, +0x00, 0xE7, 0xE7, 0xF3, 0xF3, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF, +0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x1F, 0x3F, +0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, +0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, +0x3F, 0x3F, 0x3F, 0x1F, 0x0F, 0x01, 0x01, 0x01, 0x01, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, +0x80, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x00, 0x80, 0x01, +0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0xFF, 0x11, 0x11, 0x11, 0x0E, 0x00, 0x70, +0x88, 0x04, 0x04, 0x04, 0xF8, 0x00, 0x00, 0x3C, 0xE0, 0xC0, +0x38, 0x1C, 0xE0, 0x80, 0x70, 0x0C, 0x00, 0xF8, 0xAC, 0x24, +0x24, 0x3C, 0x30, 0x00, 0x00, 0xFC, 0x0C, 0x04, 0x00, 0xF8, +0xAC, 0x24, 0x24, 0x2C, 0x30, 0x00, 0x70, 0xDC, 0x04, 0x04, +0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, +0x8C, 0x04, 0x04, 0xF8, 0x00, 0x04, 0x3C, 0xE0, 0x80, 0xF0, +0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x83, 0x01, 0x01, +0x01, 0x81, 0xFE, 0x3C, 0x00, 0x00, 0xFF, 0x03, 0x0E, 0x70, +0xC0, 0xE0, 0x38, 0x06, 0x03, 0xFF, 0x00, 0x00, 0xFF, 0x18, +0x38, 0x66, 0xC3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, +0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, +0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, +0x01, 0x01, 0x01, 0x01, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, +0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, +0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, +0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; +//TODO: generate bitmap of QMK logo here + #endif +#else +//catchall for custom screen szies + static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = {0}; +#endif + + + +void micro_oled_init(void) { + + i2c_init(); + i2c_start(I2C_ADDRESS_SA0_1); + + // Display Init sequence for 64x48 OLED module + send_command(DISPLAYOFF); // 0xAE + + send_command(SETDISPLAYCLOCKDIV); // 0xD5 + send_command(0x80); // the suggested ratio 0x80 + + send_command(SETMULTIPLEX); // 0xA8 + send_command(LCDHEIGHT - 1); + + send_command(SETDISPLAYOFFSET); // 0xD3 + send_command(0x00); // no offset + + send_command(SETSTARTLINE | 0x00); // line #0 + + send_command(CHARGEPUMP); // enable charge pump + send_command(0x14); + + send_command(NORMALDISPLAY); // 0xA6 + send_command(DISPLAYALLONRESUME); // 0xA4 + +//display at regular orientation + send_command(SEGREMAP | 0x1); + send_command(COMSCANDEC); + +//rotate display 180 +#ifdef micro_oled_rotate_180 + send_command(SEGREMAP); + send_command(COMSCANINC); +#endif + + send_command(MEMORYMODE); + send_command(0x10); + + send_command(SETCOMPINS); // 0xDA +if (LCDHEIGHT > 32) { + send_command(0x12); +} else { + send_command(0x02); +} + send_command(SETCONTRAST); // 0x81 + send_command(0x8F); + + send_command(SETPRECHARGE); // 0xd9 + send_command(0xF1); + + send_command(SETVCOMDESELECT); // 0xDB + send_command(0x40); + + send_command(DISPLAYON); //--turn on oled panel + clear_screen(); // Erase hardware memory inside the OLED controller to avoid random data in memory. + send_buffer(); +} + +void send_command(uint8_t command) { + micro_oled_transfer_buffer[0] = I2C_COMMAND; + micro_oled_transfer_buffer[1] = command; + i2c_transmit(I2C_ADDRESS_SA0_1 << 1, micro_oled_transfer_buffer, 2, 100); +} + +void send_data(uint8_t data) { + micro_oled_transfer_buffer[0] = I2C_DATA; + micro_oled_transfer_buffer[1] = data; + i2c_transmit(I2C_ADDRESS_SA0_1 << 1, micro_oled_transfer_buffer, 2, 100); +} + +/** \brief Set SSD1306 page address. + Send page address command and address to the SSD1306 OLED controller. +*/ +void set_page_address(uint8_t address) { + address = (0xB0 | address); + send_command(address); +} + +/** \brief Set SSD1306 column address. + Send column address command and address to the SSD1306 OLED controller. +*/ +void set_column_address(uint8_t address) { + send_command( ( 0x10 | (address >> 4) ) + ((128 - LCDWIDTH) >> 8) ); + send_command( 0x0F & address ); +} + +/** \brief Clear SSD1306's memory. + To clear GDRAM inside the LCD controller. +*/ +void clear_screen(void) { + for (int i=0;i<8; i++) { + set_page_address(i); + set_column_address(0); + for (int j=0; j<0x80; j++) { + send_data(0); + } + } +} + +/** \brief Clear SSD1306's memory. + To clear GDRAM inside the LCD controller. +*/ +void clear_buffer(void) { +//384 + memset(micro_oled_screen_buffer, 0, LCDWIDTH*LCDWIDTH/8); +} + +/** \brief Invert display. + The PIXEL_ON color of the display will turn to PIXEL_OFF and the PIXEL_OFF will turn to PIXEL_ON. +*/ +void invert_screen(bool invert) { + if (invert) { + send_command(INVERTDISPLAY); + } else { + send_command(NORMALDISPLAY); + } +} + +/** \brief Set contrast. + OLED contract value from 0 to 255. Note: Contrast level is not very obvious. +*/ +void set_contrast(uint8_t contrast) { + send_command(SETCONTRAST); // 0x81 + send_command(contrast); +} + +/** \brief Transfer display buffer. + Sends the updated buffer to the controller - the current status is checked before to save i2c exectution time +*/ +void send_buffer(void) { + uint8_t i, j; + + uint8_t page_addr = 0xFF; + for (i = 0; i < LCDHEIGHT/8; i++) { + uint8_t col_addr = 0xFF; + for (j = 0; j < LCDWIDTH; j++) { + if (micro_oled_screen_buffer[i*LCDWIDTH+j] != micro_oled_screen_current[i*LCDWIDTH+j]) { + if (page_addr != i) { + set_page_address(i); + } + if (col_addr != j) { + set_column_address(j); + } + send_data(micro_oled_screen_buffer[i*LCDWIDTH+j]); + micro_oled_screen_current[i*LCDWIDTH+j] = micro_oled_screen_buffer[i*LCDWIDTH+j]; + col_addr = j + 1; + } + } + } +} + +/** \brief Draw pixel with color and mode. + Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode. +*/ +void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode) { + if ((x<0) || (x>=LCDWIDTH) || (y<0) || (y>=LCDHEIGHT)) + return; + + if (mode == XOR) { + if (color == PIXEL_ON) + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] ^= _BV((y%8)); + } else { + if (color == PIXEL_ON) + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] |= _BV((y%8)); + else + micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] &= ~_BV((y%8)); + } +} + +/** \brief Draw line with color and mode. +Draw line using color and mode from x0,y0 to x1,y1 of the screen buffer. +*/ +void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode) { + uint8_t steep = abs(y1 - y0) > abs(x1 - x0); + if (steep) { + swap(x0, y0); + swap(x1, y1); + } + + if (x0 > x1) { + swap(x0, x1); + swap(y0, y1); + } + + uint8_t dx, dy; + dx = x1 - x0; + dy = abs(y1 - y0); + + int8_t err = dx / 2; + int8_t ystep; + + if (y0 < y1) { + ystep = 1; + } else { + ystep = -1;} + + for (; x0=TOTALFONTS) || (font<0)) + return; + + uint8_t fontType = font; + uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType]+0); + uint8_t fontHeight = pgm_read_byte(fonts_pointer[fontType]+1); + uint8_t fontStartChar = pgm_read_byte(fonts_pointer[fontType]+2); + uint8_t fontTotalChar = pgm_read_byte(fonts_pointer[fontType]+3); + uint16_t fontMapWidth = (pgm_read_byte(fonts_pointer[fontType]+4)*100)+pgm_read_byte(fonts_pointer[fontType]+5); // two bytes values into integer 16 + + if ((c(fontStartChar+fontTotalChar-1))) // no bitmap for the required c + return; + + tempC=c-fontStartChar; + + // each row (in datasheet is call page) is 8 bits high, 16 bit high character will have 2 rows to be drawn + rowsToDraw=fontHeight/8; // 8 is LCD's page size, see SSD1306 datasheet + if (rowsToDraw<=1) rowsToDraw=1; + + // the following draw function can draw anywhere on the screen, but SLOW pixel by pixel draw + if (rowsToDraw==1) { + for (i=0;i>=1; + } + } + return; + } + + // font height over 8 bit + // take character "0" ASCII 48 as example + charPerBitmapRow = fontMapWidth/fontWidth; // 256/8 =32 char per row + charColPositionOnBitmap = tempC % charPerBitmapRow; // =16 + charRowPositionOnBitmap = (int)(tempC/charPerBitmapRow); // =1 + charBitmapStartPosition = (charRowPositionOnBitmap * fontMapWidth * (fontHeight/8)) + (charColPositionOnBitmap * fontWidth) ; + + // each row on LCD is 8 bit height (see datasheet for explanation) + for(row=0;row>=1; + } + } + } + +} + +void draw_string(uint8_t x, uint8_t y, char * string, uint8_t color, uint8_t mode, uint8_t font) { + + if ((font>=TOTALFONTS) || (font<0)) + return; + + uint8_t fontType = font; + uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType]+0); + + uint8_t cur_x = x; + for (int i = 0; i < strlen(string); i++) { + draw_char(cur_x, y, string[i], color, mode, font); + cur_x += fontWidth + 1; + } + +} diff --git a/drivers/qwiic/micro_oled.h b/drivers/qwiic/micro_oled.h new file mode 100644 index 0000000000..5d6a1029ed --- /dev/null +++ b/drivers/qwiic/micro_oled.h @@ -0,0 +1,134 @@ +/* Jim Lindblom @ SparkFun Electronics + * October 26, 2014 + * https://github.com/sparkfun/Micro_OLED_Breakout/tree/master/Firmware/Arduino/libraries/SFE_MicroOLED + * + * Modified by: + * Emil Varughese @ Edwin Robotics Pvt. Ltd. + * July 27, 2015 + * https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + * + * This code was heavily based around the MicroView library, written by GeekAmmo + * (https://github.com/geekammo/MicroView-Arduino-Library). + * + * Adapted for QMK by: + * Jack Humbert + * October 11, 2018 + * + * 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 3 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 + +#include "qwiic.h" + +void micro_oled_init(void); + +void send_command(uint8_t command); +void send_data(uint8_t data); +void set_page_address(uint8_t address); +void set_column_address(uint8_t address); +void clear_screen(void); +void clear_buffer(void); +void send_buffer(void); +void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode); +void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, uint8_t mode); +void draw_line_hori(uint8_t x, uint8_t y, uint8_t width, uint8_t color, uint8_t mode); +void draw_line_vert(uint8_t x, uint8_t y, uint8_t height, bool color, uint8_t mode); +void draw_rect(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_soft(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_filled(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_rect_filled_soft(uint8_t x, uint8_t y, uint8_t width, uint8_t height, uint8_t color, uint8_t mode); +void draw_char(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode, uint8_t font); +void draw_string(uint8_t x, uint8_t y, char * string, uint8_t color, uint8_t mode, uint8_t font); + +#define I2C_ADDRESS_SA0_0 0b0111100 +#ifndef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111101 +#endif +#define I2C_COMMAND 0x00 +#define I2C_DATA 0x40 +#define PIXEL_OFF 0 +#define PIXEL_ON 1 + +#ifndef LCDWIDTH +#define LCDWIDTH 64 +#endif +#ifndef LCDWIDTH +#define LCDHEIGHT 48 +#endif +#define FONTHEADERSIZE 6 + +#define NORM 0 +#define XOR 1 + +#define PAGE 0 +#define ALL 1 + +#define WIDGETSTYLE0 0 +#define WIDGETSTYLE1 1 +#define WIDGETSTYLE2 2 + +#define SETCONTRAST 0x81 +#define DISPLAYALLONRESUME 0xA4 +#define DISPLAYALLON 0xA5 +#define NORMALDISPLAY 0xA6 +#define INVERTDISPLAY 0xA7 +#define DISPLAYOFF 0xAE +#define DISPLAYON 0xAF +#define SETDISPLAYOFFSET 0xD3 +#define SETCOMPINS 0xDA +#define SETVCOMDESELECT 0xDB +#define SETDISPLAYCLOCKDIV 0xD5 +#define SETPRECHARGE 0xD9 +#define SETMULTIPLEX 0xA8 +#define SETLOWCOLUMN 0x00 +#define SETHIGHCOLUMN 0x10 +#define SETSTARTLINE 0x40 +#define MEMORYMODE 0x20 +#define COMSCANINC 0xC0 +#define COMSCANDEC 0xC8 +#define SEGREMAP 0xA0 +#define CHARGEPUMP 0x8D +#define EXTERNALVCC 0x01 +#define SWITCHCAPVCC 0x02 + +// Scroll +#define ACTIVATESCROLL 0x2F +#define DEACTIVATESCROLL 0x2E +#define SETVERTICALSCROLLAREA 0xA3 +#define RIGHTHORIZONTALSCROLL 0x26 +#define LEFT_HORIZONTALSCROLL 0x27 +#define VERTICALRIGHTHORIZONTALSCROLL 0x29 +#define VERTICALLEFTHORIZONTALSCROLL 0x2A + +typedef enum CMD { + CMD_CLEAR, //0 + CMD_INVERT, //1 + CMD_CONTRAST, //2 + CMD_DISPLAY, //3 + CMD_SETCURSOR, //4 + CMD_PIXEL, //5 + CMD_LINE, //6 + CMD_LINEH, //7 + CMD_LINEV, //8 + CMD_RECT, //9 + CMD_RECTFILL, //10 + CMD_CIRCLE, //11 + CMD_CIRCLEFILL, //12 + CMD_DRAWCHAR, //13 + CMD_DRAWBITMAP, //14 + CMD_GETLCDWIDTH, //15 + CMD_GETLCDHEIGHT, //16 + CMD_SETCOLOR, //17 + CMD_SETDRAWMODE //18 +} commCommand_t; \ No newline at end of file diff --git a/drivers/qwiic/qwiic.c b/drivers/qwiic/qwiic.c new file mode 100644 index 0000000000..9047919927 --- /dev/null +++ b/drivers/qwiic/qwiic.c @@ -0,0 +1,31 @@ +/* Copyright 2018 Jack Humbert + * + * 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 . + */ +#include "qwiic.h" + +void qwiic_init(void) { + #ifdef QWIIC_JOYSTIIC_ENABLE + joystiic_init(); + #endif + #ifdef QWIIC_MICRO_OLED_ENABLE + micro_oled_init(); + #endif +} + +void qwiic_task(void) { + #ifdef QWIIC_JOYSTIIC_ENABLE + joystiic_task(); + #endif +} diff --git a/drivers/qwiic/qwiic.h b/drivers/qwiic/qwiic.h new file mode 100644 index 0000000000..160fb28dfd --- /dev/null +++ b/drivers/qwiic/qwiic.h @@ -0,0 +1,28 @@ +/* Copyright 2018 Jack Humbert + * + * 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 + +#include "i2c_master.h" + +#ifdef QWIIC_JOYSTIIC_ENABLE + #include "joystiic.h" +#endif +#ifdef QWIIC_MICRO_OLED_ENABLE + #include "micro_oled.h" +#endif + +void qwiic_init(void); +void qwiic_task(void); diff --git a/drivers/qwiic/qwiic.mk b/drivers/qwiic/qwiic.mk new file mode 100644 index 0000000000..4ae2d78e3e --- /dev/null +++ b/drivers/qwiic/qwiic.mk @@ -0,0 +1,18 @@ +ifneq ($(strip $(QWIIC_ENABLE)),) + COMMON_VPATH += $(DRIVER_PATH)/qwiic + OPT_DEFS += -DQWIIC_ENABLE + SRC += qwiic.c + ifeq ($(filter "i2c_master.c", $(SRC)),) + SRC += i2c_master.c + endif +endif + +ifneq ($(filter JOYSTIIC, $(QWIIC_ENABLE)),) + OPT_DEFS += -DQWIIC_JOYSTIIC_ENABLE + SRC += joystiic.c +endif + +ifneq ($(filter MICRO_OLED, $(QWIIC_ENABLE)),) + OPT_DEFS += -DQWIIC_MICRO_OLED_ENABLE + SRC += micro_oled.c +endif diff --git a/drivers/qwiic/util/font5x7.h b/drivers/qwiic/util/font5x7.h new file mode 100644 index 0000000000..0bad206b7c --- /dev/null +++ b/drivers/qwiic/util/font5x7.h @@ -0,0 +1,288 @@ +/****************************************************************************** +font5x7.h +Definition for small font + +This file was imported from the MicroView library, written by GeekAmmo +(https://github.com/geekammo/MicroView-Arduino-Library), and released under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 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 . + +Modified by: +Emil Varughese @ Edwin Robotics Pvt. Ltd. +July 27, 2015 +https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ + +******************************************************************************/ +#pragma once + +#include "progmem.h" + +// Standard ASCII 5x7 font +static const unsigned char font5x7[] PROGMEM = { + // first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256) + 5,8,0,255,12,75, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, + 0x00, 0x18, 0x3C, 0x18, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, + 0x00, 0x18, 0x24, 0x18, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, + 0x30, 0x48, 0x3A, 0x06, 0x0E, + 0x26, 0x29, 0x79, 0x29, 0x26, + 0x40, 0x7F, 0x05, 0x05, 0x07, + 0x40, 0x7F, 0x05, 0x25, 0x3F, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, + 0x14, 0x22, 0x7F, 0x22, 0x14, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, + 0x06, 0x09, 0x7F, 0x01, 0x7F, + 0x00, 0x66, 0x89, 0x95, 0x6A, + 0x60, 0x60, 0x60, 0x60, 0x60, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, + 0x08, 0x04, 0x7E, 0x04, 0x08, + 0x10, 0x20, 0x7E, 0x20, 0x10, + 0x08, 0x08, 0x2A, 0x1C, 0x08, + 0x08, 0x1C, 0x2A, 0x08, 0x08, + 0x1E, 0x10, 0x10, 0x10, 0x10, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, + 0x30, 0x38, 0x3E, 0x38, 0x30, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, + 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, + 0x23, 0x13, 0x08, 0x64, 0x62, + 0x36, 0x49, 0x56, 0x20, 0x50, + 0x00, 0x08, 0x07, 0x03, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, + 0x08, 0x08, 0x3E, 0x08, 0x08, + 0x00, 0x80, 0x70, 0x30, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, + 0x00, 0x00, 0x60, 0x60, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, + 0x3E, 0x51, 0x49, 0x45, 0x3E, + 0x00, 0x42, 0x7F, 0x40, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, + 0x21, 0x41, 0x49, 0x4D, 0x33, + 0x18, 0x14, 0x12, 0x7F, 0x10, + 0x27, 0x45, 0x45, 0x45, 0x39, + 0x3C, 0x4A, 0x49, 0x49, 0x31, + 0x41, 0x21, 0x11, 0x09, 0x07, + 0x36, 0x49, 0x49, 0x49, 0x36, + 0x46, 0x49, 0x49, 0x29, 0x1E, + 0x00, 0x00, 0x14, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x00, 0x41, 0x22, 0x14, 0x08, + 0x02, 0x01, 0x59, 0x09, 0x06, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, + 0x7C, 0x12, 0x11, 0x12, 0x7C, + 0x7F, 0x49, 0x49, 0x49, 0x36, + 0x3E, 0x41, 0x41, 0x41, 0x22, + 0x7F, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x49, 0x49, 0x49, 0x41, + 0x7F, 0x09, 0x09, 0x09, 0x01, + 0x3E, 0x41, 0x41, 0x51, 0x73, + 0x7F, 0x08, 0x08, 0x08, 0x7F, + 0x00, 0x41, 0x7F, 0x41, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, + 0x7F, 0x08, 0x14, 0x22, 0x41, + 0x7F, 0x40, 0x40, 0x40, 0x40, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, + 0x7F, 0x04, 0x08, 0x10, 0x7F, + 0x3E, 0x41, 0x41, 0x41, 0x3E, + 0x7F, 0x09, 0x09, 0x09, 0x06, + 0x3E, 0x41, 0x51, 0x21, 0x5E, + 0x7F, 0x09, 0x19, 0x29, 0x46, + 0x26, 0x49, 0x49, 0x49, 0x32, + 0x03, 0x01, 0x7F, 0x01, 0x03, + 0x3F, 0x40, 0x40, 0x40, 0x3F, + 0x1F, 0x20, 0x40, 0x20, 0x1F, + 0x3F, 0x40, 0x38, 0x40, 0x3F, + 0x63, 0x14, 0x08, 0x14, 0x63, + 0x03, 0x04, 0x78, 0x04, 0x03, + 0x61, 0x59, 0x49, 0x4D, 0x43, + 0x00, 0x7F, 0x41, 0x41, 0x41, + 0x02, 0x04, 0x08, 0x10, 0x20, + 0x00, 0x41, 0x41, 0x41, 0x7F, + 0x04, 0x02, 0x01, 0x02, 0x04, + 0x40, 0x40, 0x40, 0x40, 0x40, + 0x00, 0x03, 0x07, 0x08, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, + 0x7F, 0x28, 0x44, 0x44, 0x38, + 0x38, 0x44, 0x44, 0x44, 0x28, + 0x38, 0x44, 0x44, 0x28, 0x7F, + 0x38, 0x54, 0x54, 0x54, 0x18, + 0x00, 0x08, 0x7E, 0x09, 0x02, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, + 0x7F, 0x08, 0x04, 0x04, 0x78, + 0x00, 0x44, 0x7D, 0x40, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, + 0x7C, 0x08, 0x04, 0x04, 0x78, + 0x38, 0x44, 0x44, 0x44, 0x38, + 0xFC, 0x18, 0x24, 0x24, 0x18, + 0x18, 0x24, 0x24, 0x18, 0xFC, + 0x7C, 0x08, 0x04, 0x04, 0x08, + 0x48, 0x54, 0x54, 0x54, 0x24, + 0x04, 0x04, 0x3F, 0x44, 0x24, + 0x3C, 0x40, 0x40, 0x20, 0x7C, + 0x1C, 0x20, 0x40, 0x20, 0x1C, + 0x3C, 0x40, 0x30, 0x40, 0x3C, + 0x44, 0x28, 0x10, 0x28, 0x44, + 0x4C, 0x90, 0x90, 0x90, 0x7C, + 0x44, 0x64, 0x54, 0x4C, 0x44, + 0x00, 0x08, 0x36, 0x41, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, + 0x3C, 0x26, 0x23, 0x26, 0x3C, + 0x1E, 0xA1, 0xA1, 0x61, 0x12, + 0x3A, 0x40, 0x40, 0x20, 0x7A, + 0x38, 0x54, 0x54, 0x55, 0x59, + 0x21, 0x55, 0x55, 0x79, 0x41, + 0x21, 0x54, 0x54, 0x78, 0x41, + 0x21, 0x55, 0x54, 0x78, 0x40, + 0x20, 0x54, 0x55, 0x79, 0x40, + 0x0C, 0x1E, 0x52, 0x72, 0x12, + 0x39, 0x55, 0x55, 0x55, 0x59, + 0x39, 0x54, 0x54, 0x54, 0x59, + 0x39, 0x55, 0x54, 0x54, 0x58, + 0x00, 0x00, 0x45, 0x7C, 0x41, + 0x00, 0x02, 0x45, 0x7D, 0x42, + 0x00, 0x01, 0x45, 0x7C, 0x40, + 0xF0, 0x29, 0x24, 0x29, 0xF0, + 0xF0, 0x28, 0x25, 0x28, 0xF0, + 0x7C, 0x54, 0x55, 0x45, 0x00, + 0x20, 0x54, 0x54, 0x7C, 0x54, + 0x7C, 0x0A, 0x09, 0x7F, 0x49, + 0x32, 0x49, 0x49, 0x49, 0x32, + 0x32, 0x48, 0x48, 0x48, 0x32, + 0x32, 0x4A, 0x48, 0x48, 0x30, + 0x3A, 0x41, 0x41, 0x21, 0x7A, + 0x3A, 0x42, 0x40, 0x20, 0x78, + 0x00, 0x9D, 0xA0, 0xA0, 0x7D, + 0x39, 0x44, 0x44, 0x44, 0x39, + 0x3D, 0x40, 0x40, 0x40, 0x3D, + 0x3C, 0x24, 0xFF, 0x24, 0x24, + 0x48, 0x7E, 0x49, 0x43, 0x66, + 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, + 0xFF, 0x09, 0x29, 0xF6, 0x20, + 0xC0, 0x88, 0x7E, 0x09, 0x03, + 0x20, 0x54, 0x54, 0x79, 0x41, + 0x00, 0x00, 0x44, 0x7D, 0x41, + 0x30, 0x48, 0x48, 0x4A, 0x32, + 0x38, 0x40, 0x40, 0x22, 0x7A, + 0x00, 0x7A, 0x0A, 0x0A, 0x72, + 0x7D, 0x0D, 0x19, 0x31, 0x7D, + 0x26, 0x29, 0x29, 0x2F, 0x28, + 0x26, 0x29, 0x29, 0x29, 0x26, + 0x30, 0x48, 0x4D, 0x40, 0x20, + 0x38, 0x08, 0x08, 0x08, 0x08, + 0x08, 0x08, 0x08, 0x08, 0x38, + 0x2F, 0x10, 0xC8, 0xAC, 0xBA, + 0x2F, 0x10, 0x28, 0x34, 0xFA, + 0x00, 0x00, 0x7B, 0x00, 0x00, + 0x08, 0x14, 0x2A, 0x14, 0x22, + 0x22, 0x14, 0x2A, 0x14, 0x08, + 0xAA, 0x00, 0x55, 0x00, 0xAA, + 0xAA, 0x55, 0xAA, 0x55, 0xAA, + 0x00, 0x00, 0x00, 0xFF, 0x00, + 0x10, 0x10, 0x10, 0xFF, 0x00, + 0x14, 0x14, 0x14, 0xFF, 0x00, + 0x10, 0x10, 0xFF, 0x00, 0xFF, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x14, 0x14, 0x14, 0xFC, 0x00, + 0x14, 0x14, 0xF7, 0x00, 0xFF, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x14, 0x14, 0xF4, 0x04, 0xFC, + 0x14, 0x14, 0x17, 0x10, 0x1F, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0x1F, 0x00, + 0x10, 0x10, 0x10, 0xF0, 0x00, + 0x00, 0x00, 0x00, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0x1F, 0x10, + 0x10, 0x10, 0x10, 0xF0, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x10, + 0x10, 0x10, 0x10, 0x10, 0x10, + 0x10, 0x10, 0x10, 0xFF, 0x10, + 0x00, 0x00, 0x00, 0xFF, 0x14, + 0x00, 0x00, 0xFF, 0x00, 0xFF, + 0x00, 0x00, 0x1F, 0x10, 0x17, + 0x00, 0x00, 0xFC, 0x04, 0xF4, + 0x14, 0x14, 0x17, 0x10, 0x17, + 0x14, 0x14, 0xF4, 0x04, 0xF4, + 0x00, 0x00, 0xFF, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x14, 0x14, + 0x14, 0x14, 0xF7, 0x00, 0xF7, + 0x14, 0x14, 0x14, 0x17, 0x14, + 0x10, 0x10, 0x1F, 0x10, 0x1F, + 0x14, 0x14, 0x14, 0xF4, 0x14, + 0x10, 0x10, 0xF0, 0x10, 0xF0, + 0x00, 0x00, 0x1F, 0x10, 0x1F, + 0x00, 0x00, 0x00, 0x1F, 0x14, + 0x00, 0x00, 0x00, 0xFC, 0x14, + 0x00, 0x00, 0xF0, 0x10, 0xF0, + 0x10, 0x10, 0xFF, 0x10, 0xFF, + 0x14, 0x14, 0x14, 0xFF, 0x14, + 0x10, 0x10, 0x10, 0x1F, 0x00, + 0x00, 0x00, 0x00, 0xF0, 0x10, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, + 0xFF, 0xFF, 0xFF, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFF, 0xFF, + 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, + 0x38, 0x44, 0x44, 0x38, 0x44, + 0x7C, 0x2A, 0x2A, 0x3E, 0x14, + 0x7E, 0x02, 0x02, 0x06, 0x06, + 0x02, 0x7E, 0x02, 0x7E, 0x02, + 0x63, 0x55, 0x49, 0x41, 0x63, + 0x38, 0x44, 0x44, 0x3C, 0x04, + 0x40, 0x7E, 0x20, 0x1E, 0x20, + 0x06, 0x02, 0x7E, 0x02, 0x02, + 0x99, 0xA5, 0xE7, 0xA5, 0x99, + 0x1C, 0x2A, 0x49, 0x2A, 0x1C, + 0x4C, 0x72, 0x01, 0x72, 0x4C, + 0x30, 0x4A, 0x4D, 0x4D, 0x30, + 0x30, 0x48, 0x78, 0x48, 0x30, + 0xBC, 0x62, 0x5A, 0x46, 0x3D, + 0x3E, 0x49, 0x49, 0x49, 0x00, + 0x7E, 0x01, 0x01, 0x01, 0x7E, + 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, + 0x44, 0x44, 0x5F, 0x44, 0x44, + 0x40, 0x51, 0x4A, 0x44, 0x40, + 0x40, 0x44, 0x4A, 0x51, 0x40, + 0x00, 0x00, 0xFF, 0x01, 0x03, + 0xE0, 0x80, 0xFF, 0x00, 0x00, + 0x08, 0x08, 0x6B, 0x6B, 0x08, + 0x36, 0x12, 0x36, 0x24, 0x36, + 0x06, 0x0F, 0x09, 0x0F, 0x06, + 0x00, 0x00, 0x18, 0x18, 0x00, + 0x00, 0x00, 0x10, 0x10, 0x00, + 0x30, 0x40, 0xFF, 0x01, 0x01, + 0x00, 0x1F, 0x01, 0x01, 0x1E, + 0x00, 0x19, 0x1D, 0x17, 0x12, + 0x00, 0x3C, 0x3C, 0x3C, 0x3C, + 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/drivers/qwiic/util/font8x16.h b/drivers/qwiic/util/font8x16.h new file mode 100644 index 0000000000..c070e4ec8c --- /dev/null +++ b/drivers/qwiic/util/font8x16.h @@ -0,0 +1,127 @@ +/****************************************************************************** +font8x16.h +Definition for medium font + +This file was imported from the MicroView library, written by GeekAmmo +(https://github.com/geekammo/MicroView-Arduino-Library), and released under +the terms of the GNU General Public License as published by the Free Software +Foundation, either version 3 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 . + +Modified by: +Emil Varughese @ Edwin Robotics Pvt. Ltd. +July 27, 2015 +https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/ +******************************************************************************/ +#pragma once + +#include "progmem.h" + +static const unsigned char font8x16[] PROGMEM = { + // first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256) + 8,16,32,96,2,56, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBE, 0x90, 0xD0, 0xBE, 0x90, 0x00, + 0x00, 0x1C, 0x62, 0xFF, 0xC2, 0x80, 0x00, 0x00, 0x0C, 0x12, 0x92, 0x4C, 0xB0, 0x88, 0x06, 0x00, + 0x80, 0x7C, 0x62, 0xB2, 0x1C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0xE0, 0x18, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00, + 0x00, 0x24, 0x18, 0x7E, 0x18, 0x24, 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x06, 0x00, 0x00, + 0xF8, 0x04, 0xC2, 0x32, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x04, 0x04, 0xFE, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, + 0xC0, 0xA0, 0x98, 0x84, 0xFE, 0x80, 0x80, 0x00, 0x00, 0x1E, 0x12, 0x12, 0x22, 0xC2, 0x00, 0x00, + 0xF8, 0x44, 0x22, 0x22, 0x22, 0xC0, 0x00, 0x00, 0x00, 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, + 0x00, 0x8C, 0x52, 0x22, 0x52, 0x8C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x26, 0xF8, 0x00, 0x00, + 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, + 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, + 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x00, 0x04, 0x04, 0x0F, 0x04, 0x03, 0x00, 0x00, 0x04, 0x02, 0x01, 0x03, 0x04, 0x04, 0x03, 0x00, + 0x03, 0x04, 0x04, 0x04, 0x05, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x06, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x08, 0x06, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x01, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, + 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, + 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xF8, 0x04, 0x72, 0x8A, 0xFA, 0x84, 0x78, 0x00, 0x00, 0xC0, 0x38, 0x06, 0x38, 0xC0, 0x00, 0x00, + 0x00, 0xFE, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, + 0xFE, 0x02, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, + 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x22, 0xE2, 0x00, 0x00, + 0xFE, 0x20, 0x20, 0x20, 0x20, 0xFE, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0xFE, 0x40, 0xB0, 0x08, 0x04, 0x02, 0x00, 0x00, + 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x0C, 0x70, 0x80, 0x70, 0x0C, 0xFE, 0x00, + 0xFE, 0x0C, 0x30, 0xC0, 0x00, 0xFE, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, + 0xFE, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, + 0x00, 0xFE, 0x42, 0x42, 0xA2, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x42, 0x42, 0x80, 0x00, 0x00, + 0x02, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x02, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, + 0x06, 0x38, 0xC0, 0x00, 0xC0, 0x38, 0x06, 0x00, 0x3E, 0xC0, 0xF0, 0x0E, 0xF0, 0xC0, 0x3E, 0x00, + 0x00, 0x06, 0x98, 0x60, 0x98, 0x06, 0x00, 0x00, 0x00, 0x06, 0x18, 0xE0, 0x18, 0x06, 0x00, 0x00, + 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00, + 0x00, 0x06, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, + 0x40, 0x30, 0x0C, 0x0C, 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x02, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x07, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, + 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0C, 0x12, 0x11, 0x10, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, + 0x00, 0x06, 0x01, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, + 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, + 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, + 0x00, 0xE0, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x90, 0x90, 0x90, 0xE0, 0x00, 0x00, + 0x00, 0x20, 0xFC, 0x22, 0x22, 0x22, 0x02, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x80, 0x40, 0x20, 0x10, 0x00, 0x00, + 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0xF0, 0x20, 0x10, 0xF0, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xE0, 0x00, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, + 0x00, 0xF0, 0x20, 0x10, 0x10, 0x70, 0x00, 0x00, 0x00, 0x60, 0x90, 0x90, 0x90, 0x20, 0x00, 0x00, + 0x00, 0x20, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, + 0x00, 0x70, 0x80, 0x00, 0x80, 0x70, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x30, 0xC0, 0x00, 0xF0, 0x00, + 0x00, 0x30, 0xC0, 0xC0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x80, 0x70, 0x00, 0x00, + 0x00, 0x10, 0x10, 0x90, 0x50, 0x30, 0x00, 0x00, 0x00, 0x80, 0x80, 0x7E, 0x02, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7E, 0x80, 0x80, 0x00, 0x00, + 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, + 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x24, 0x24, 0x22, 0x1F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, + 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x3F, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x3F, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, + 0x00, 0x00, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x01, 0x06, 0x01, 0x00, + 0x00, 0x06, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x20, 0x20, 0x31, 0x0E, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; diff --git a/keyboards/hadron/config.h b/keyboards/hadron/config.h index 9111ad7279..d54d2c5437 100644 --- a/keyboards/hadron/config.h +++ b/keyboards/hadron/config.h @@ -24,7 +24,7 @@ along with this program. If not, see . #define PRODUCT_ID 0x6060 #define MANUFACTURER ishtob #define PRODUCT Hadron Keyboard -#define DESCRIPTION A cherry ML ortholinear keyboard +#define DESCRIPTION A low profile ortholinear keyboard @@ -46,9 +46,9 @@ along with this program. If not, see . #define DEBOUNCING_DELAY 5 /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ -#define LOCKING_SUPPORT_ENABLE +//#define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ -#define LOCKING_RESYNC_ENABLE +//#define LOCKING_RESYNC_ENABLE /* key combination for command */ #define IS_COMMAND() ( \ @@ -70,7 +70,7 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -#define NO_ACTION_MACRO -#define NO_ACTION_FUNCTION +//#define NO_ACTION_MACRO +//#define NO_ACTION_FUNCTION diff --git a/keyboards/hadron/hadron.c b/keyboards/hadron/hadron.c index ca5b20e894..fa5065b327 100644 --- a/keyboards/hadron/hadron.c +++ b/keyboards/hadron/hadron.c @@ -1,26 +1,2 @@ #include "hadron.h" - -void matrix_init_kb(void) { - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} \ No newline at end of file diff --git a/keyboards/hadron/hadron.h b/keyboards/hadron/hadron.h index a165f4c5c9..426face6f4 100644 --- a/keyboards/hadron/hadron.h +++ b/keyboards/hadron/hadron.h @@ -7,7 +7,9 @@ #ifdef SUBPROJECT_ver2 #include "ver2.h" #endif - +#ifdef SUBPROJECT_ver3 + #include "ver3.h" +#endif #include "quantum.h" diff --git a/keyboards/hadron/keymaps/default/config.h b/keyboards/hadron/keymaps/default/config.h deleted file mode 100644 index 09922b61bc..0000000000 --- a/keyboards/hadron/keymaps/default/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING - -#define USE_I2C -#define SSD1306OLED -#define OLED_ROTATE180 - -/* ws2812 RGB LED*/ -#define RGB_DI_PIN D4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#endif diff --git a/keyboards/hadron/keymaps/default/keymap.c b/keyboards/hadron/keymaps/default/keymap.c deleted file mode 100644 index de5979c1d2..0000000000 --- a/keyboards/hadron/keymaps/default/keymap.c +++ /dev/null @@ -1,493 +0,0 @@ -#include QMK_KEYBOARD_H -#include "LUFA/Drivers/Peripheral/TWI.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef USE_I2C -#include "i2c.h" -#endif -#ifdef SSD1306OLED -#include "ssd1306.h" -#endif -extern keymap_config_t keymap_config; - -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; - -// 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 _QWERTY 0 -#define _COLEMAK 1 -#define _DVORAK 2 -#define _LOWER 3 -#define _RAISE 4 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - -enum preonic_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, -}; - -enum macro_keycodes { - KC_DEMOMACRO, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define DEMOMACRO M(KC_DEMOMACRO) // Sample for macros - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Colemak - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_COLEMAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ - KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ - ), - -/* Dvorak - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | - * `--------------------------------------------------------------------------------------------------------' - */ -[_DVORAK] = LAYOUT( - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ - KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ -), - -/* Lower - * ,------+------+------+------+------+------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | - * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | - * `--------------------------------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Raise - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | - * `--------------------------------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ -), - -/* Mouse Layer (semi-col) - * ,------+------+------+------+------+------------------------------------------------. - * | ACCL0| ACCL1| ACCL2| | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | BTN1 | | | | BTN1 | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ - -[_MOUSECURSOR] = LAYOUT( - KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ - _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ -) - - - -}; - - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -// define variables for reactive RGB -bool RGB_INIT = false; -bool TOG_STATUS = false; -int RGB_current_mode; - - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - rgblight_mode(RGB_current_mode); - layer_on(layer3); - } else { - layer_off(layer3); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistant_default_layer_set(1UL<<_COLEMAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(16); - } - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(15); - } - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - layer_off(_RAISE); - TOG_STATUS = false; - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - case RGB_MOD: - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - return false; - break; - } - return true; -} - -void matrix_init_user(void) { - #ifdef USE_I2C - i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display - #endif - #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{cc - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_DEMOMACRO: - if (record->event.pressed){ - return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - } - - return MACRO_NONE; -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_FNLAYER 64 -#define L_NUMLAY 128 -#define L_NLOWER 136 -#define L_NFNLAYER 192 -#define L_MOUSECURSOR 256 -#define L_ADJUST 65560 - -void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - struct CharacterMatrix matrix; - - matrix_clear(&matrix); - matrix_write_P(&matrix, PSTR("USB: ")); -#ifdef PROTOCOL_LUFA - switch (USB_DeviceState) { - case DEVICE_STATE_Unattached: - matrix_write_P(&matrix, PSTR("Unattached")); - break; - case DEVICE_STATE_Suspended: - matrix_write_P(&matrix, PSTR("Suspended")); - break; - case DEVICE_STATE_Configured: - matrix_write_P(&matrix, PSTR("Connected")); - break; - case DEVICE_STATE_Powered: - matrix_write_P(&matrix, PSTR("Powered")); - break; - case DEVICE_STATE_Default: - matrix_write_P(&matrix, PSTR("Default")); - break; - case DEVICE_STATE_Addressed: - matrix_write_P(&matrix, PSTR("Addressed")); - break; - default: - matrix_write_P(&matrix, PSTR("Invalid")); - } -#endif - -// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(&matrix, PSTR("\n\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(&matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(&matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(&matrix, PSTR("Lower")); - break; - case L_ADJUST: - matrix_write_P(&matrix, PSTR("ADJUST")); - break; - default: - matrix_write(&matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<sort lines), and use this format: - - * **folder_name** description - -# List of Planck keymaps - -* **default** default Planck layout -* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file diff --git a/keyboards/hadron/keymaps/side_numpad/config.h b/keyboards/hadron/keymaps/side_numpad/config.h deleted file mode 100644 index 09922b61bc..0000000000 --- a/keyboards/hadron/keymaps/side_numpad/config.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" - -#define LEADER_TIMEOUT 300 -//#define BACKLIGHT_BREATHING - -#define USE_I2C -#define SSD1306OLED -#define OLED_ROTATE180 - -/* ws2812 RGB LED*/ -#define RGB_DI_PIN D4 -#define RGBLIGHT_ANIMATIONS -#define RGBLED_NUM 14 // Number of LEDs -#define RGBLIGHT_HUE_STEP 10 -#define RGBLIGHT_SAT_STEP 17 - -#endif diff --git a/keyboards/hadron/keymaps/side_numpad/keymap.c b/keyboards/hadron/keymaps/side_numpad/keymap.c deleted file mode 100644 index fa42c79ea0..0000000000 --- a/keyboards/hadron/keymaps/side_numpad/keymap.c +++ /dev/null @@ -1,502 +0,0 @@ -#include QMK_KEYBOARD_H -#include "LUFA/Drivers/Peripheral/TWI.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#ifdef USE_I2C -#include "i2c.h" -#endif -#ifdef SSD1306OLED -#include "ssd1306.h" -#endif -extern keymap_config_t keymap_config; - -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; - -// 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 _QWERTY 0 -#define _LOWER 3 -#define _RAISE 4 -#define _FNLAYER 6 -#define _NUMLAY 7 -#define _MOUSECURSOR 8 -#define _ADJUST 16 - -enum preonic_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - LOWER, - RAISE, - BACKLIT, - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, -}; - -enum macro_keycodes { - KC_DEMOMACRO, -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -// Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl -#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -// Requires KC_TRNS/_______ for the trigger key in the destination layer -#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer -#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor -#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise -#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY -#define DEMOMACRO M(KC_DEMOMACRO) // My login macros - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - -/* Qwerty - * ,------+------+------+------+------+------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | 7 | 8 | 9 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | CAPS | A | S | D | F | G | H | J | K | L | ; |Enter | 4 | 5 | 6 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / | = | 1 | 2 | 3 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | ~ | Ctrl | Alt | GUI |Lower |Space |Space |Raise | RAlt | Ins | Del |NumLay| 0 | . | ENT | - * `--------------------------------------------------------------------------------------------------------' - */ -[_QWERTY] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,\ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 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, LT_MC(KC_SCLN), CTL_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL, KC_P1, KC_P2, KC_P3, \ - KC_GRV, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_INS, KC_DEL, TG_NUMLAY, KC_P0, KC_PDOT, KC_PENT \ -), - -/* Lower - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | CAPS | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | [ | ] | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_LOWER] = LAYOUT( - KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, _______, _______, _______, \ - KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, _______, _______, _______, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______\ -), - -/* Raise - * ,-----------------------------------------------------------------------------------. - * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | - * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| - * | | A | Up | D | PrSc | | 4 | 5 | 6 | * | : | ' | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | Lt | Dn | Rt | Mute | | 1 | 2 | 3 | Up | / | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | |Space | 0 | | Left | Down | Right| | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_RAISE] = LAYOUT( - 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, _______, _______, _______, \ - _______, KC_A, KC_UP, KC_D, KC_PSCR, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC__MUTE, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______ \ -), - -/* FN layer on Esc key - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | [ | ] | ' | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | { | } | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_FNLAYER] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, _______, _______, _______, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, _______, _______, _______, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______ \ -), - -/* Num Layer - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | | | | | | | | F7 | F8 | F9 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | F4 | F5 | F6 | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | Up | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | Exit | Left | Down | Rght | - * `--------------------------------------------------------------------------------------------------------' - */ -[_NUMLAY] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PMNS, KC_UP, KC_PPLS, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT \ -), - -/* Mouse Layer (semi-col) - * ,-----------------------------------------------------------------------------------. - * | |ACCL0| ACCL1| ACCL2 | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | BTN1 | | | | BTN1 | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ - -[_MOUSECURSOR] = LAYOUT( - _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______,\ - _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, DEMOMACRO, _______, _______, _______, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______ \ -), - -/* Adjust (Lower + Raise) - - * ,-----------------------------------------------------------------------------------. - * | Reset| | | | | | | | | VolD | VolU | Mute | - * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. - * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | BL + |BL ST |BLSTEP| BL TG| | | | - * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * `--------------------------------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT( - RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, KC_VOLU, KC_MUTE, \ - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, _______, _______, \ - _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, _______, _______, \ - _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ -) - - - -}; - - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); -float tone_goodbye[][2] = SONG(GOODBYE_SOUND); -#endif - -// define variables for reactive RGB -bool RGB_INIT = false; -bool TOG_STATUS = false; -bool NUMLAY_STATUS = false; -int RGB_current_mode; - - - -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); -} - -void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - rgblight_mode(RGB_current_mode); - layer_on(layer3); - } else { - layer_off(layer3); - } -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistant_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(16); - } - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - TOG_STATUS = false; - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - //not sure how to have keyboard check mode and set it to a variable, so my work around - //uses another variable that would be set to true after the first time a reactive key is pressed. - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false - } else { - TOG_STATUS = !TOG_STATUS; - rgblight_mode(15); - } - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change - layer_off(_RAISE); - TOG_STATUS = false; - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); - #ifdef BACKLIGHT_ENABLE - backlight_step(); - #endif - } else { - unregister_code(KC_RSFT); - } - return false; - break; - //my attempt for RGB layer lock indication via changing the mode, still have to figure out how to not have other keypress not override this mode - case TG_NUMLAY: - if (record->event.pressed) { - if (RGB_INIT) {} else { - RGB_current_mode = rgblight_config.mode; - RGB_INIT = true; - } - NUMLAY_STATUS = !NUMLAY_STATUS; - if (NUMLAY_STATUS) { - rgblight_mode(4); - layer_on(_NUMLAY); - } else { - rgblight_mode(RGB_current_mode); - layer_off(_NUMLAY); } - } - return false; - break; - case RGB_MOD: - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - return false; - break; - } - return true; -} - -void matrix_init_user(void) { - #ifdef USE_I2C - i2c_master_init(); - #ifdef SSD1306OLED - // calls code for the SSD1306 OLED - _delay_ms(400); - TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); - iota_gfx_init(); // turns on the display - #endif - #endif - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -void matrix_scan_user(void) { - #ifdef SSD1306OLED - iota_gfx_task(); // this is what updates the display continuously - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void shutdown_user() -{cc - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); -} - -void music_on_user(void) -{ - music_scale_user(); -} - -void music_scale_user(void) -{ - PLAY_SONG(music_scale); -} - -#endif - -/* - * Macro definition - */ -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - - switch (id) { - case KC_DEMOMACRO: - if (record->event.pressed){ - return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); - } - } - - return MACRO_NONE; -} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_LOWER 8 -#define L_RAISE 16 -#define L_FNLAYER 64 -#define L_NUMLAY 128 -#define L_NLOWER 136 -#define L_NFNLAYER 192 -#define L_MOUSECURSOR 256 -#define L_ADJUST 65560 - -void iota_gfx_task_user(void) { -#if DEBUG_TO_SCREEN - if (debug_enable) { - return; - } -#endif - - struct CharacterMatrix matrix; - - matrix_clear(&matrix); - matrix_write_P(&matrix, PSTR("USB: ")); -#ifdef PROTOCOL_LUFA - switch (USB_DeviceState) { - case DEVICE_STATE_Unattached: - matrix_write_P(&matrix, PSTR("Unattached")); - break; - case DEVICE_STATE_Suspended: - matrix_write_P(&matrix, PSTR("Suspended")); - break; - case DEVICE_STATE_Configured: - matrix_write_P(&matrix, PSTR("Connected")); - break; - case DEVICE_STATE_Powered: - matrix_write_P(&matrix, PSTR("Powered")); - break; - case DEVICE_STATE_Default: - matrix_write_P(&matrix, PSTR("Default")); - break; - case DEVICE_STATE_Addressed: - matrix_write_P(&matrix, PSTR("Addressed")); - break; - default: - matrix_write_P(&matrix, PSTR("Invalid")); - } -#endif - -// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(&matrix, PSTR("\n\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(&matrix, PSTR("Default")); - break; - case L_RAISE: - matrix_write_P(&matrix, PSTR("Raise")); - break; - case L_LOWER: - matrix_write_P(&matrix, PSTR("Lower")); - break; - case L_ADJUST: - matrix_write_P(&matrix, PSTR("ADJUST")); - break; - default: - matrix_write(&matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<. #define UNUSED_PINS +#define USE_I2C +#define SSD1306OLED +#define OLED_ROTATE180 + +/* ws2812 RGB LED*/ +#define RGB_DI_PIN D4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 14 // Number of LEDs +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + diff --git a/keyboards/hadron/ver2/keymaps/default/config.h b/keyboards/hadron/ver2/keymaps/default/config.h new file mode 100644 index 0000000000..e1fdd6dd3e --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/default/config.h @@ -0,0 +1,9 @@ +#pragma once + +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND) \ + } + +#define LEADER_TIMEOUT 300 +//#define BACKLIGHT_BREATHING + diff --git a/keyboards/hadron/ver2/keymaps/default/keymap.c b/keyboards/hadron/ver2/keymaps/default/keymap.c new file mode 100644 index 0000000000..cc79f52671 --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/default/keymap.c @@ -0,0 +1,448 @@ +#include QMK_KEYBOARD_H +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef USE_I2C +#include "i2c.h" +#endif +#ifdef SSD1306OLED +#include "ssd1306.h" +#endif +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_DEMOMACRO, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define DEMOMACRO M(KC_DEMOMACRO) // Sample for macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______\ +) + + + +}; + +// define variables for reactive RGB +bool RGB_INIT = false; +bool TOG_STATUS = false; +int RGB_current_mode; + +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + + + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_DEMOMACRO: + if (record->event.pressed){ + return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + } + + return MACRO_NONE; +} + + +//Functions for ver2 +#ifdef KEYBOARD_hadron_ver2 +#include "LUFA/Drivers/Peripheral/TWI.h" +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65560 + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("USB: ")); +#ifdef PROTOCOL_LUFA + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + matrix_write_P(&matrix, PSTR("Unattached")); + break; + case DEVICE_STATE_Suspended: + matrix_write_P(&matrix, PSTR("Suspended")); + break; + case DEVICE_STATE_Configured: + matrix_write_P(&matrix, PSTR("Connected")); + break; + case DEVICE_STATE_Powered: + matrix_write_P(&matrix, PSTR("Powered")); + break; + case DEVICE_STATE_Default: + matrix_write_P(&matrix, PSTR("Default")); + break; + case DEVICE_STATE_Addressed: + matrix_write_P(&matrix, PSTR("Addressed")); + break; + default: + matrix_write_P(&matrix, PSTR("Invalid")); + } +#endif + +// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(&matrix, PSTR("\n\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(&matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(&matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(&matrix, PSTR("Lower")); + break; + case L_ADJUST: + matrix_write_P(&matrix, PSTR("ADJUST")); + break; + default: + matrix_write(&matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1<sort lines), and use this format: + + * **folder_name** description + +# List of Planck keymaps + +* **default** default Planck layout +* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file diff --git a/keyboards/hadron/ver2/keymaps/side_numpad/config.h b/keyboards/hadron/ver2/keymaps/side_numpad/config.h new file mode 100644 index 0000000000..409279a95f --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/side_numpad/config.h @@ -0,0 +1,8 @@ +#pragma once + +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND)\ + } + +#define LEADER_TIMEOUT 300 +//#define BACKLIGHT_BREATHING + diff --git a/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c b/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c new file mode 100644 index 0000000000..248bb7ca66 --- /dev/null +++ b/keyboards/hadron/ver2/keymaps/side_numpad/keymap.c @@ -0,0 +1,484 @@ +#include QMK_KEYBOARD_H +#include "LUFA/Drivers/Peripheral/TWI.h" +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef USE_I2C +#include "i2c.h" +#endif +#ifdef SSD1306OLED +#include "ssd1306.h" +#endif +extern keymap_config_t keymap_config; + +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; + +// 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 _QWERTY 0 +#define _LOWER 3 +#define _RAISE 4 +#define _FNLAYER 6 +#define _NUMLAY 7 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_DEMOMACRO, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_FN(kc) LT(_FNLAYER, kc) // L-ayer T-ap Function Layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define TG_NUMLAY TG(_NUMLAY) //Toggle for layer _NUMLAY +#define DEMOMACRO M(KC_DEMOMACRO) // My login macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | 7 | 8 | 9 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | H | J | K | L | ; |Enter | 4 | 5 | 6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / | = | 1 | 2 | 3 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ~ | Ctrl | Alt | GUI |Lower |Space |Space |Raise | RAlt | Ins | Del |NumLay| 0 | . | ENT | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, 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, LT_MC(KC_SCLN), CTL_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_EQL, KC_P1, KC_P2, KC_P3, \ + KC_GRV, KC_RCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_RALT, KC_INS, KC_DEL, TG_NUMLAY, KC_P0, KC_PDOT, KC_PENT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | [ | ] | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_ESC, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_GRV, KC_BSLS, _______, _______, _______, \ + KC_CAPS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, _______, _______, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______\ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | ~ | \ | | | | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | A | Up | D | PrSc | | 4 | 5 | 6 | * | : | ' | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | Lt | Dn | Rt | Mute | | 1 | 2 | 3 | Up | / | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | |Space | 0 | | Left | Down | Right| | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, _______, _______, _______, \ + _______, KC_A, KC_UP, KC_D, KC_PSCR, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC__MUTE, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, _______, _______ \ +), + +/* FN layer on Esc key + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | ! | @ | # | $ | % | ^ | & | * | ( | ) | + | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | _ | = | [ | ] | ' | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | { | } | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | Next | Vol- | Vol+ | Play | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_FNLAYER] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, _______, _______, _______, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, _______, _______, _______, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS), S(KC_NUBS), KC_LCBR, KC_RCBR, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______ \ +), + +/* Num Layer + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | | | | | F7 | F8 | F9 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | F4 | F5 | F6 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | Up | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Exit | Left | Down | Rght | + * `--------------------------------------------------------------------------------------------------------' + */ +[_NUMLAY] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, KC_END, KC_PGDN, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PMNS, KC_UP, KC_PPLS, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT \ +), + +/* Mouse Layer (semi-col) + * ,-----------------------------------------------------------------------------------. + * | |ACCL0| ACCL1| ACCL2 | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, DEMOMACRO, _______, _______, _______, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, _______, _______, _______, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, KC_BTN1, _______, _______, _______, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + + * ,-----------------------------------------------------------------------------------. + * | Reset| | | | | | | | | VolD | VolU | Mute | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | |RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | Del | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | BL + |BL ST |BLSTEP| BL TG| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, KC_VOLU, KC_MUTE, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, _______, _______, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + + +}; + +// define variables for reactive RGB +bool RGB_INIT = false; +bool TOG_STATUS = false; +bool NUMLAY_STATUS = false; +int RGB_current_mode; + + +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + rgblight_mode(RGB_current_mode); + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(16); + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + rgblight_mode(15); + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + //my attempt for RGB layer lock indication via changing the mode, still have to figure out how to not have other keypress not override this mode + case TG_NUMLAY: + if (record->event.pressed) { + if (RGB_INIT) {} else { + RGB_current_mode = rgblight_config.mode; + RGB_INIT = true; + } + NUMLAY_STATUS = !NUMLAY_STATUS; + if (NUMLAY_STATUS) { + rgblight_mode(4); + layer_on(_NUMLAY); + } else { + rgblight_mode(RGB_current_mode); + layer_off(_NUMLAY); } + } + return false; + break; + case RGB_MOD: + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + return false; + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef USE_I2C + i2c_master_init(); + #ifdef SSD1306OLED + // calls code for the SSD1306 OLED + _delay_ms(400); + TWI_Init(TWI_BIT_PRESCALE_1, TWI_BITLENGTH_FROM_FREQ(1, 800000)); + iota_gfx_init(); // turns on the display + #endif + #endif + #ifdef AUDIO_ENABLE + startup_user(); + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + iota_gfx_task(); // this is what updates the display continuously + #endif +} + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); +} + +void shutdown_user() +{cc + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_DEMOMACRO: + if (record->event.pressed){ + return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + } + + return MACRO_NONE; +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_LOWER 8 +#define L_RAISE 16 +#define L_FNLAYER 64 +#define L_NUMLAY 128 +#define L_NLOWER 136 +#define L_NFNLAYER 192 +#define L_MOUSECURSOR 256 +#define L_ADJUST 65560 + +void iota_gfx_task_user(void) { +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; + } +#endif + + struct CharacterMatrix matrix; + + matrix_clear(&matrix); + matrix_write_P(&matrix, PSTR("USB: ")); +#ifdef PROTOCOL_LUFA + switch (USB_DeviceState) { + case DEVICE_STATE_Unattached: + matrix_write_P(&matrix, PSTR("Unattached")); + break; + case DEVICE_STATE_Suspended: + matrix_write_P(&matrix, PSTR("Suspended")); + break; + case DEVICE_STATE_Configured: + matrix_write_P(&matrix, PSTR("Connected")); + break; + case DEVICE_STATE_Powered: + matrix_write_P(&matrix, PSTR("Powered")); + break; + case DEVICE_STATE_Default: + matrix_write_P(&matrix, PSTR("Default")); + break; + case DEVICE_STATE_Addressed: + matrix_write_P(&matrix, PSTR("Addressed")); + break; + default: + matrix_write_P(&matrix, PSTR("Invalid")); + } +#endif + +// Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(&matrix, PSTR("\n\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(&matrix, PSTR("Default")); + break; + case L_RAISE: + matrix_write_P(&matrix, PSTR("Raise")); + break; + case L_LOWER: + matrix_write_P(&matrix, PSTR("Lower")); + break; + case L_ADJUST: + matrix_write_P(&matrix, PSTR("ADJUST")); + break; + default: + matrix_write(&matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1</tmk_core/tool/chibios/ch-bootloader-jump.patch + */ +#define STM32_BOOTLOADER_ADDRESS 0x1FFFD800 diff --git a/keyboards/hadron/ver3/chconf.h b/keyboards/hadron/ver3/chconf.h new file mode 100644 index 0000000000..1d9f12ff1f --- /dev/null +++ b/keyboards/hadron/ver3/chconf.h @@ -0,0 +1,520 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 2 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM TRUE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT TRUE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY TRUE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS TRUE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK TRUE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h new file mode 100644 index 0000000000..11288f7a57 --- /dev/null +++ b/keyboards/hadron/ver3/config.h @@ -0,0 +1,192 @@ +/* + * Copyright 2018 Jack Humbert + * + * 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 . + */ + +#ifndef REV3_CONFIG_H +#define REV3_CONFIG_H + +/* USB Device descriptor parameter */ +#define DEVICE_VER 0x0003 + +#undef MATRIX_ROWS +#undef MATRIX_COLS +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + + +//Audio +#undef AUDIO_VOICES +#undef C6_AUDIO + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#define AUDIO_CLICKY + /* to enable clicky on startup */ + //#define AUDIO_CLICKY_ON +#define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f +#endif + +//configure qwiic micro_oled driver for the 128x32 oled +#ifdef QWIIC_MICRO_OLED_ENABLE + +#undef I2C_ADDRESS_SA0_1 +#define I2C_ADDRESS_SA0_1 0b0111100 +#define LCDWIDTH 128 +#define LCDHEIGHT 32 +#define micro_oled_rotate_180 + +#endif +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCE 6 + +/* 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 + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +/* Haptic Driver initialization settings + * Feedback Control Settings */ +#define FB_ERM_LRA 1 /* For ERM:0 or LRA:1*/ +#define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ +#define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ + +#define RATED_VOLTAGE 2 +#define V_RMS 2.0 +#define V_PEAK 2.85 +#define F_LRA 205 +/* Library Selection */ +#define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +/* Control 1 register settings */ +#define DRIVE_TIME 25 +#define AC_COUPLE 0 +#define STARTUP_BOOST 1 + +/* Control 2 Settings */ +#define BIDIR_INPUT 1 +#define BRAKE_STAB 1 /* Loopgain is reduced when braking is almost complete to improve stability */ +#define SAMPLE_TIME 3 +#define BLANKING_TIME 1 +#define IDISS_TIME 1 + +/* Control 3 settings */ +#define NG_THRESH 2 +#define ERM_OPEN_LOOP 1 +#define SUPPLY_COMP_DIS 0 +#define DATA_FORMAT_RTO 0 +#define LRA_DRIVE_MODE 0 +#define N_PWM_ANALOG 0 +#define LRA_OPEN_LOOP 0 +/* Control 4 settings */ +#define ZC_DET_TIME 0 +#define AUTO_CAL_TIME 3 + +//#define WS2812_LED_N 2 +//#define RGBLED_NUM WS2812_LED_N +//#define WS2812_TIM_N 2 +//#define WS2812_TIM_CH 2 +//#define PORT_WS2812 GPIOA +//#define PIN_WS2812 15 +//#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) +//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP +//#define WS2812_EXTERNAL_PULLUP + +#endif diff --git a/keyboards/hadron/ver3/halconf.h b/keyboards/hadron/ver3/halconf.h new file mode 100644 index 0000000000..c3e0cbb728 --- /dev/null +++ b/keyboards/hadron/ver3/halconf.h @@ -0,0 +1,388 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef HALCONF_H +#define HALCONF_H + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC TRUE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT TRUE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C TRUE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB TRUE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI FALSE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 16 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 256 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/** + * @brief Serial over USB number of buffers. + * @note The default is 2 buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_NUMBER) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_NUMBER 2 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* UART driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_WAIT) || defined(__DOXYGEN__) +#define UART_USE_WAIT FALSE +#endif + +/** + * @brief Enables the @p uartAcquireBus() and @p uartReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(UART_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define UART_USE_MUTUAL_EXCLUSION FALSE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* HALCONF_H */ + +/** @} */ diff --git a/keyboards/hadron/ver3/keymaps/default/config.h b/keyboards/hadron/ver3/keymaps/default/config.h new file mode 100644 index 0000000000..6f70f09bee --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/default/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/hadron/ver3/keymaps/default/keymap.c b/keyboards/hadron/ver3/keymaps/default/keymap.c new file mode 100644 index 0000000000..11761b3210 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/default/keymap.c @@ -0,0 +1,295 @@ +#include QMK_KEYBOARD_H + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _MOUSECURSOR 8 +#define _ADJUST 16 + +enum preonic_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + BACKLIT, + RGBLED_TOGGLE, + RGBLED_STEP_MODE, + RGBLED_INCREASE_HUE, + RGBLED_DECREASE_HUE, + RGBLED_INCREASE_SAT, + RGBLED_DECREASE_SAT, + RGBLED_INCREASE_VAL, + RGBLED_DECREASE_VAL, +}; + +enum macro_keycodes { + KC_DEMOMACRO, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +// Custom macros +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define CTL_TTAB CTL_T(KC_TAB) // Tap for Esc, hold for Ctrl +#define CTL_ENT CTL_T(KC_ENT) // Tap for Enter, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +// Requires KC_TRNS/_______ for the trigger key in the destination layer +#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor +#define LT_RAI(kc) LT(_RAISE, kc) // L-ayer T-ap to Raise +#define DEMOMACRO M(KC_DEMOMACRO) // Sample for macros + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | CAPS | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav| ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_P7, KC_P8, KC_P9, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_P4, KC_P5, KC_P6, KC_H, KC_J, KC_K, KC_L,LT_MC(KC_SCLN), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT,KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O | ' | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_P7, KC_P8, KC_P9, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTRL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_P4, KC_P5, KC_P6, KC_H, KC_N, KC_E, KC_I, LT_MC(KC_O), KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_P1, KC_P2, KC_P3, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, CTL_ENT, \ + KC_GRV, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | Ctrl | Alt | GUI |Lower |Space | 0 | . | = |Space |Raise | Left | Down | Up |Right | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_P7, KC_P8, KC_P9, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_P4, KC_P5, KC_P6, KC_D, KC_H, KC_T, KC_N, LT_MC(KC_S), KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_P1, KC_P2, KC_P3, KC_B, KC_M, KC_W, KC_V, KC_Z, CTL_ENT, \ + KC_GRV, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R,DEMOMACRO,_______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______ \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ +) + + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + + +/* + * Macro definition + */ +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + switch (id) { + case KC_DEMOMACRO: + if (record->event.pressed){ + return MACRO (I(1), T(H),T(E),T(L), T(L), T(O), T(SPACE), T(W), T(O), T(R), T(L), T(D), END); + } + } + + return MACRO_NONE; +} + + +void matrix_init_user(void) { +} + + +void matrix_scan_user(void) { +} + diff --git a/keyboards/hadron/ver3/keymaps/default/readme.md b/keyboards/hadron/ver3/keymaps/default/readme.md new file mode 100644 index 0000000000..88b958ec42 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/default/readme.md @@ -0,0 +1,2 @@ +# The Default Hadron Layout + diff --git a/keyboards/hadron/ver3/keymaps/readme.md b/keyboards/hadron/ver3/keymaps/readme.md new file mode 100644 index 0000000000..54fb5f6d9e --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/readme.md @@ -0,0 +1,23 @@ +# How to add your own keymap + +Folders can be named however you'd like (will be approved upon merging), or should follow the format with a preceding `_`: + + _[ISO 3166-1 alpha-2 code*]_[layout variant]_[layout name/author] + +\* See full list: https://en.wikipedia.org/wiki/ISO_3166-1#Officially_assigned_code_elements + +and contain the following files: + +* `keymap.c` +* `readme.md` *recommended* +* `config.h` *optional*, found automatically when compiling +* `Makefile` *optional*, found automatically when compling + +When adding your keymap to this list, keep it organised alphabetically (select list, edit->sort lines), and use this format: + + * **folder_name** description + +# List of Planck keymaps + +* **default** default Planck layout +* **cbbrowne** cbbrowne's Planck layout \ No newline at end of file diff --git a/keyboards/hadron/ver3/matrix.c b/keyboards/hadron/ver3/matrix.c new file mode 100644 index 0000000000..329d1328ab --- /dev/null +++ b/keyboards/hadron/ver3/matrix.c @@ -0,0 +1,195 @@ +#include +#include "hal.h" +#include "timer.h" +#include "wait.h" +#include "printf.h" +#include "backlight.h" +#include "matrix.h" +#include "action.h" +#include "keycode.h" + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_COLS]; +static bool debouncing = false; +static uint16_t debouncing_time = 0; + +static uint8_t encoder_state = 0; +static int8_t encoder_value = 0; +static int8_t encoder_LUT[] = { 0, -1, 1, 0, 1, 0, 0, -1, -1, 0, 0, 1, 0, 1, -1, 0 }; + +__attribute__ ((weak)) +void matrix_init_user(void) {} + +__attribute__ ((weak)) +void matrix_scan_user(void) {} + +__attribute__ ((weak)) +void matrix_init_kb(void) { + matrix_init_user(); +} + +__attribute__ ((weak)) +void matrix_scan_kb(void) { + matrix_scan_user(); +} + +void matrix_init(void) { + printf("matrix init\n"); + //debug_matrix = true; + + // encoder setup + palSetPadMode(GPIOB, 13, PAL_MODE_INPUT_PULLUP); + palSetPadMode(GPIOB, 14, PAL_MODE_INPUT_PULLUP); + + encoder_state = (palReadPad(GPIOB, 13) << 0) | (palReadPad(GPIOB, 14) << 1); + + // actual matrix setup + palSetPadMode(GPIOB, 8, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 10, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 2, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 0, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 3, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 1, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 6, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOA, 7, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 12, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOC, 13, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 11, PAL_MODE_OUTPUT_PUSHPULL); + palSetPadMode(GPIOB, 9, PAL_MODE_OUTPUT_PUSHPULL); + + palSetPadMode(GPIOC, 15, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOC, 14, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 10, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 9, PAL_MODE_INPUT_PULLDOWN); + palSetPadMode(GPIOA, 8, PAL_MODE_INPUT_PULLDOWN); + + + memset(matrix, 0, MATRIX_ROWS * sizeof(matrix_row_t)); + memset(matrix_debouncing, 0, MATRIX_COLS * sizeof(matrix_row_t)); + + + matrix_init_quantum(); +} + +__attribute__ ((weak)) +void encoder_update(bool clockwise) { } + +#ifndef ENCODER_RESOLUTION + #define ENCODER_RESOLUTION 4 +#endif + +uint8_t matrix_scan(void) { + // encoder on B13 and B14 + encoder_state <<= 2; + encoder_state |= (palReadPad(GPIOB, 13) << 0) | (palReadPad(GPIOB, 14) << 1); + encoder_value += encoder_LUT[encoder_state & 0xF]; + if (encoder_value >= ENCODER_RESOLUTION) { + encoder_update(0); + } + if (encoder_value <= -ENCODER_RESOLUTION) { // direction is arbitrary here, but this clockwise + encoder_update(1); + } + encoder_value %= ENCODER_RESOLUTION; + + // actual matrix + for (int col = 0; col < MATRIX_COLS; col++) { + matrix_row_t data = 0; + + // strobe col { PB8, PB2, PB10, PA0, PA1, PA2, PB0, PA3, PB1, PA6, PA7, PB1, PA6, PA7, PB12, PC3, PB11, } + switch (col) { + case 0: palSetPad(GPIOB, 8); break; + case 1: palSetPad(GPIOB, 2); break; + case 2: palSetPad(GPIOB, 10); break; + case 3: palSetPad(GPIOA, 0); break; + case 4: palSetPad(GPIOA, 1); break; + case 5: palSetPad(GPIOA, 2); break; + case 6: palSetPad(GPIOB, 0); break; + case 7: palSetPad(GPIOA, 3); break; + case 8: palSetPad(GPIOB, 1); break; + case 9: palSetPad(GPIOA, 6); break; + case 10: palSetPad(GPIOA, 7); break; + case 11: palSetPad(GPIOB, 12); break; + case 12: palSetPad(GPIOC, 13); break; + case 13: palSetPad(GPIOB, 11); break; + case 14: palSetPad(GPIOB, 9); break; + } + + // need wait to settle pin state + wait_us(20); + + // read row data { PC15, PC14, PA10, PA9, PA8 } + data = ( + (palReadPad(GPIOC, 15) << 0 ) | + (palReadPad(GPIOC, 14) << 1 ) | + (palReadPad(GPIOA, 10) << 2 ) | + (palReadPad(GPIOA, 9) << 3 ) | + (palReadPad(GPIOA, 8) << 4 ) + ); + + // unstrobe col { PB8, PB2, PB10, PA0, PA1, PA2, PB0, PA3, PB1, PA6, PA7, PB1, PA6, PA7, PB12, PC3, PB11, } + switch (col) { + case 0: palClearPad(GPIOB, 8); break; + case 1: palClearPad(GPIOB, 2); break; + case 2: palClearPad(GPIOB, 10); break; + case 3: palClearPad(GPIOA, 0); break; + case 4: palClearPad(GPIOA, 1); break; + case 5: palClearPad(GPIOA, 2); break; + case 6: palClearPad(GPIOB, 0); break; + case 7: palClearPad(GPIOA, 3); break; + case 8: palClearPad(GPIOB, 1); break; + case 9: palClearPad(GPIOA, 6); break; + case 10: palClearPad(GPIOA, 7); break; + case 11: palClearPad(GPIOB, 12); break; + case 12: palClearPad(GPIOC, 13); break; + case 13: palClearPad(GPIOB, 11); break; + case 14: palClearPad(GPIOB, 9); break; + } + + if (matrix_debouncing[col] != data) { + matrix_debouncing[col] = data; + debouncing = true; + debouncing_time = timer_read(); + } + } + + if (debouncing && timer_elapsed(debouncing_time) > DEBOUNCE) { + for (int row = 0; row < MATRIX_ROWS; row++) { + matrix[row] = 0; + for (int col = 0; col < MATRIX_COLS; col++) { + matrix[row] |= ((matrix_debouncing[col] & (1 << row) ? 1 : 0) << col); + } + } + debouncing = false; + } + + matrix_scan_quantum(); + + return 1; +} + +bool matrix_is_on(uint8_t row, uint8_t col) { + return (matrix[row] & (1< + * + * 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 . + */ +#ifndef REV3_H +#define REV3_H + +#include "hadron.h" + +#endif \ No newline at end of file diff --git a/keyboards/hadron/ver3/rules.mk b/keyboards/hadron/ver3/rules.mk new file mode 100644 index 0000000000..8375efdd35 --- /dev/null +++ b/keyboards/hadron/ver3/rules.mk @@ -0,0 +1,57 @@ +# project specific files +SRC = matrix.c + +## chip/board settings +# - the next two should match the directories in +# /os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F3xx + +# Linker script to use +# - it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +MCU_LDSCRIPT = STM32F303xC + +# Startup code to use +# - it should exist in /os/common/startup/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f3xx + +# Board: it should exist either in /os/hal/boards/ +# or /boards +BOARD = GENERIC_STM32_F303XC + +# Cortex version +MCU = cortex-m4 + +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 + +USE_FPU = yes + +# Vector table for application +# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ +# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB +# OPT_DEFS = -DCORTEX_VTOR_INIT=0x08005000 +OPT_DEFS = + +# Options to pass to dfu-util when flashing +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave + +# Build Options +# comment out to disable the options. +# +BACKLIGHT_ENABLE = no +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration +## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) +MOUSEKEY_ENABLE = yes # Mouse keys +EXTRAKEY_ENABLE = yes # Audio control and System control +CONSOLE_ENABLE = no # Console for debug +COMMAND_ENABLE = no # Commands for debug and configuration +#SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +CUSTOM_MATRIX = yes # Custom matrix file +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = no +HAPTIC_ENABLE = DRV2605L +QWIIC_ENABLE += MICRO_OLED +# SERIAL_LINK_ENABLE = yes diff --git a/keyboards/hadron/ver3/ver3.c b/keyboards/hadron/ver3/ver3.c new file mode 100644 index 0000000000..5e5e3e009f --- /dev/null +++ b/keyboards/hadron/ver3/ver3.c @@ -0,0 +1,196 @@ +/* Copyright 2018 Jack Humbert + * + * 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 . + */ +#include "ver3.h" +#include "qwiic.h" +#include "action_layer.h" +#include "matrix.h" +#include "DRV2605L.h" + +#ifdef QWIIC_MICRO_OLED_ENABLE + +/* screen off after this many milliseconds */ +#include "timer.h" +#define ScreenOffInterval 60000 /* milliseconds */ +static uint16_t last_flush; + +volatile uint8_t led_numlock = false; +volatile uint8_t led_capslock = false; +volatile uint8_t led_scrolllock = false; + +static uint8_t layer; +static bool queue_for_send = false; +static uint8_t encoder_value = 32; + +__attribute__ ((weak)) +void draw_ui(void) { + clear_buffer(); + last_flush = timer_read(); + send_command(DISPLAYON); + +/* Layer indicator is 41 x 10 pixels */ +#define LAYER_INDICATOR_X 0 +#define LAYER_INDICATOR_Y 0 + + draw_string(LAYER_INDICATOR_X + 1, LAYER_INDICATOR_Y + 2, "LAYER", PIXEL_ON, NORM, 0); + draw_rect_filled_soft(LAYER_INDICATOR_X + 32, LAYER_INDICATOR_Y + 1, 9, 9, PIXEL_ON, NORM); + draw_char(LAYER_INDICATOR_X + 34, LAYER_INDICATOR_Y + 2, layer + 0x30, PIXEL_ON, XOR, 0); + +/* Matrix display is 19 x 9 pixels */ +#define MATRIX_DISPLAY_X 0 +#define MATRIX_DISPLAY_Y 18 + + for (uint8_t x = 0; x < MATRIX_ROWS; x++) { + for (uint8_t y = 0; y < MATRIX_COLS; y++) { + draw_pixel(MATRIX_DISPLAY_X + y + 2, MATRIX_DISPLAY_Y + x + 2,(matrix_get_row(x) & (1 << y)) > 0, NORM); + } + } + draw_rect_soft(MATRIX_DISPLAY_X, MATRIX_DISPLAY_Y, 19, 9, PIXEL_ON, NORM); + /* hadron oled location on thumbnail */ + draw_rect_filled_soft(MATRIX_DISPLAY_X + 14, MATRIX_DISPLAY_Y + 2, 3, 1, PIXEL_ON, NORM); +/* + draw_rect_soft(0, 13, 64, 6, PIXEL_ON, NORM); + draw_line_vert(encoder_value, 13, 6, PIXEL_ON, NORM); + +*/ + +/* Mod display is 41 x 16 pixels */ +#define MOD_DISPLAY_X 30 +#define MOD_DISPLAY_Y 18 + + uint8_t mods = get_mods(); + if (mods & MOD_LSFT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 0, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 3, MOD_DISPLAY_Y + 2, "S", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LCTL) { + draw_rect_filled_soft(MOD_DISPLAY_X + 10, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 13, MOD_DISPLAY_Y + 2, "C", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LALT) { + draw_rect_filled_soft(MOD_DISPLAY_X + 20, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 23, MOD_DISPLAY_Y + 2, "A", PIXEL_ON, NORM, 0); + } + if (mods & MOD_LGUI) { + draw_rect_filled_soft(MOD_DISPLAY_X + 30, MOD_DISPLAY_Y, 5 + (1 * 6), 11, PIXEL_ON, NORM); + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_OFF, NORM, 0); + } else { + draw_string(MOD_DISPLAY_X + 33, MOD_DISPLAY_Y + 2, "G", PIXEL_ON, NORM, 0); + } + +/* Lock display is 23 x 32 */ +#define LOCK_DISPLAY_X 100 +#define LOCK_DISPLAY_Y 0 + + if (led_numlock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X, LOCK_DISPLAY_Y, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_OFF, NORM, 0); + } else if (led_numlock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 1, "NUM", PIXEL_ON, NORM, 0); + } + if (led_capslock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 11, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_OFF, NORM, 0); + } else if (led_capslock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 11 +1, "CAP", PIXEL_ON, NORM, 0); + } + + if (led_scrolllock == true) { + draw_rect_filled_soft(LOCK_DISPLAY_X + 0, LOCK_DISPLAY_Y + 22, 5 + (3 * 6), 9, PIXEL_ON, NORM); + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_OFF, NORM, 0); + } else if (led_scrolllock == false) { + draw_string(LOCK_DISPLAY_X + 3, LOCK_DISPLAY_Y + 22 +1, "SCR", PIXEL_ON, NORM, 0); + } + send_buffer(); +} + +void read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + if (leds & (1 << USB_LED_NUM_LOCK)) { + if (led_numlock == false){ + led_numlock = true;} + } else { + if (led_numlock == true){ + led_numlock = false;} + } + if (leds & (1 << USB_LED_CAPS_LOCK)) { + if (led_capslock == false){ + led_capslock = true;} + } else { + if (led_capslock == true){ + led_capslock = false;} + } + if (leds & (1 << USB_LED_SCROLL_LOCK)) { + if (led_scrolllock == false){ + led_scrolllock = true;} + } else { + if (led_scrolllock == true){ + led_scrolllock = false;} + } +} + +uint32_t layer_state_set_kb(uint32_t state) { + state = layer_state_set_user(state); + layer = biton32(state); + queue_for_send = true; + return state; +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + queue_for_send = true; + return process_record_user(keycode, record); +} + +void encoder_update_kb(uint8_t index, bool clockwise) { + encoder_value = (encoder_value + (clockwise ? 1 : -1)) % 64; + queue_for_send = true; +} + +#endif + +void matrix_init_kb(void) { +#ifdef DRV2605L + DRV_init(); +#endif + queue_for_send = true; + matrix_init_user(); +} + +void matrix_scan_kb(void) { + +if (queue_for_send) { + #ifdef DRV2605L + DRV_EFFECT play_eff = strong_click; + DRV_pulse(play_eff); + #endif +#ifdef QWIIC_MICRO_OLED_ENABLE + read_host_led_state(); + draw_ui(); +#endif + queue_for_send = false; + } +#ifdef QWIIC_MICRO_OLED_ENABLE + if (timer_elapsed(last_flush) > ScreenOffInterval) { + send_command(DISPLAYOFF); /* 0xAE */ + } +#endif + matrix_scan_user(); +} diff --git a/keyboards/hadron/ver3/ver3.h b/keyboards/hadron/ver3/ver3.h new file mode 100644 index 0000000000..516f7b9a1b --- /dev/null +++ b/keyboards/hadron/ver3/ver3.h @@ -0,0 +1,21 @@ +/* Copyright 2018 Jack Humbert + * + * 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 . + */ +#ifndef VER3_H +#define VER3_H + +#include "hadron.h" + +#endif \ No newline at end of file diff --git a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk b/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk deleted file mode 100644 index c56d6f37e0..0000000000 --- a/keyboards/helix/rev1/keymaps/OLED_sample/rules.mk +++ /dev/null @@ -1,25 +0,0 @@ - -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 controls -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 = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 6d48321f92..f1551d2519 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -82,12 +82,10 @@ void layer_xor(uint32_t state); #define layer_or(state) #define layer_and(state) #define layer_xor(state) +#endif -__attribute__((weak)) uint32_t layer_state_set_user(uint32_t state); -__attribute__((weak)) uint32_t layer_state_set_kb(uint32_t state); -#endif /* pressed actions cache */ #if !defined(NO_ACTION_LAYER) && !defined(STRICT_LAYER_RELEASE) diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index a6a5fb56b1..6f659b2440 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -72,6 +72,9 @@ along with this program. If not, see . #ifdef HD44780_ENABLE # include "hd44780.h" #endif +#ifdef QWIIC_ENABLE +# include "qwiic.h" +#endif #ifdef MATRIX_HAS_GHOST extern const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS]; @@ -161,6 +164,9 @@ bool is_keyboard_master(void) { void keyboard_init(void) { timer_init(); matrix_init(); +#ifdef QWIIC_ENABLE + qwiic_init(); +#endif #ifdef PS2_MOUSE_ENABLE ps2_mouse_init(); #endif @@ -270,6 +276,10 @@ void keyboard_task(void) MATRIX_LOOP_END: +#ifdef QWIIC_ENABLE + qwiic_task(); +#endif + #ifdef MOUSEKEY_ENABLE // mousekey repeat & acceleration mousekey_task(); -- cgit v1.2.3 From 59dc31a7371956b5ba9e54b7e19ddc7a3092c5df Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Tue, 4 Dec 2018 12:25:27 -0500 Subject: Keymap: Ergodox EZ: Clean Up Keymap Array Alignment (#4545) Remove layer name comments, they are above the visual layout Remove comments explaining things that are documented in qmk docs --- keyboards/ergodox_ez/keymaps/default/keymap.c | 115 +++++++++++++------------- 1 file changed, 56 insertions(+), 59 deletions(-) diff --git a/keyboards/ergodox_ez/keymaps/default/keymap.c b/keyboards/ergodox_ez/keymaps/default/keymap.c index 12d6cf6fa6..5834fa43af 100644 --- a/keyboards/ergodox_ez/keymaps/default/keymap.c +++ b/keyboards/ergodox_ez/keymaps/default/keymap.c @@ -33,28 +33,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |ace | End | | PgDn | | | * `--------------------' `----------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default - // left hand - KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, - KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), - KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, - KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), - LT(SYMB,KC_GRV),KC_QUOT, LALT(KC_LSFT), KC_LEFT,KC_RGHT, - ALT_T(KC_APP), KC_LGUI, - KC_HOME, - KC_SPC,KC_BSPC,KC_END, - // right hand - KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN),GUI_T(KC_QUOT), - MEH_T(KC_NO),KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), KC_RSFT, - KC_UP, KC_DOWN,KC_LBRC,KC_RBRC, KC_FN1, - KC_LALT, CTL_T(KC_ESC), - KC_PGUP, - KC_PGDN,KC_TAB, KC_ENT - ), +[BASE] = LAYOUT_ergodox( + // left hand + KC_EQL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, + KC_DELT, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB), + KC_BSPC, KC_A, KC_S, KC_D, KC_F, KC_G, + KC_LSFT, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_NO), + LT(SYMB,KC_GRV), KC_QUOT, LALT(KC_LSFT), KC_LEFT, KC_RGHT, + ALT_T(KC_APP), KC_LGUI, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + // right hand + KC_RGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_H, KC_J, KC_K, KC_L, LT(MDIA, KC_SCLN), GUI_T(KC_QUOT), + MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), KC_RSFT, + KC_UP, KC_DOWN, KC_LBRC, KC_RBRC, KC_FN1, + KC_LALT, CTL_T(KC_ESC), + KC_PGUP, + KC_PGDN, KC_TAB, KC_ENT +), /* Keymap 1: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. @@ -76,26 +74,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// SYMBOLS [SYMB] = LAYOUT_ergodox( - // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LCBR,KC_RCBR,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LPRN,KC_RPRN,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - RGB_MOD,KC_TRNS, - KC_TRNS, - RGB_VAD,RGB_VAI,KC_TRNS, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_TRNS,KC_DOT, KC_0, KC_EQL, KC_TRNS, - RGB_TOG, RGB_SLD, - KC_TRNS, - KC_TRNS, RGB_HUD, RGB_HUI + // left hand + VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, + KC_TRNS, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_TRNS, + KC_TRNS, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRV, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, + EPRM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_MOD, KC_TRNS, + KC_TRNS, + RGB_VAD, RGB_VAI, KC_TRNS, + // right hand + KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS, KC_DOT, KC_0, KC_EQL, KC_TRNS, + RGB_TOG, RGB_SLD, + KC_TRNS, + KC_TRNS, RGB_HUD, RGB_HUI ), /* Keymap 2: Media and mouse keys * @@ -118,25 +115,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE [MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, - KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_WBAK + // left hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right hand + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_TRNS, KC_TRNS, + KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_WBAK ), }; -- cgit v1.2.3 From 106de349fb6410d0deb706ecb68ae1e78a4ef2db Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Tue, 4 Dec 2018 10:09:39 -0800 Subject: Invalid JSON (#4547) --- keyboards/converter/ibm_5291/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/converter/ibm_5291/info.json b/keyboards/converter/ibm_5291/info.json index 080a16336e..48d835f338 100644 --- a/keyboards/converter/ibm_5291/info.json +++ b/keyboards/converter/ibm_5291/info.json @@ -2,5 +2,5 @@ "keyboard_name": "IBM 5291", "keyboard_folder": "converter/5291", "url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard", - "maintainer": "listofoptions", + "maintainer": "listofoptions" } -- cgit v1.2.3 From 6d0dc910d92bc381d3cce9ea712aa47ae40ddf15 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 4 Dec 2018 13:27:41 -0800 Subject: Rework drashna userspace to be more modular (#4544) * Break up files to make more readable * Add comments to ortho 4x12 layout rules.mk * Small tweaks * Update GitLab CI scripts * Make ortho boards smaller --- layouts/community/ortho_4x12/drashna/config.h | 4 +- layouts/community/ortho_4x12/drashna/rules.mk | 5 +- users/drashna/.gitlab-ci.yml | 2 +- users/drashna/config.h | 4 +- users/drashna/drashna.c | 271 +++-------------------- users/drashna/drashna.h | 301 ++------------------------ users/drashna/process_records.c | 175 +++++++++++++++ users/drashna/process_records.h | 101 +++++++++ users/drashna/rgb_stuff.h | 6 + users/drashna/rules.mk | 3 +- users/drashna/tap_dances.c | 1 - users/drashna/tap_dances.h | 12 + users/drashna/wrappers.h | 170 +++++++++++++++ 13 files changed, 526 insertions(+), 529 deletions(-) create mode 100644 users/drashna/process_records.c create mode 100644 users/drashna/process_records.h create mode 100644 users/drashna/wrappers.h diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index f279651b63..8658802d83 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -31,11 +31,11 @@ #define EE_HANDS #endif -#if defined(KEYBOARD_planck_rev5) +#if !defined(KEYBOARD_planck_light) #ifdef RGBLIGHT_ENABLE #define NO_MUSIC_MODE #endif // RGBLIGHT_ENABLE -#endif // KEYBOARD_planck_rev5 +#endif // KEYBOARD_planck_light /* diff --git a/layouts/community/ortho_4x12/drashna/rules.mk b/layouts/community/ortho_4x12/drashna/rules.mk index 5e46cf112e..a5429b8ffb 100644 --- a/layouts/community/ortho_4x12/drashna/rules.mk +++ b/layouts/community/ortho_4x12/drashna/rules.mk @@ -5,12 +5,12 @@ CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration TAP_DANCE_ENABLE = no AUDIO_ENABLE = yes -ifeq (,$(findstring planck/rev6,$(KEYBOARD))) +ifeq (,$(findstring planck/rev6,$(KEYBOARD))) # Make sure it's NOT the Planck Rev6 RGBLIGHT_ENABLE = yes INDICATOR_LIGHTS = yes RGBLIGHT_TWINKLE = yes endif -ifneq (,$(findstring planck/light,$(KEYBOARD))) +ifneq (,$(findstring planck/light,$(KEYBOARD))) # Make sure it IS the Planck Light RGB_MATRIX_ENABLE = yes RGBLIGHT_ENABLE = no endif @@ -23,4 +23,3 @@ endif MACROS_ENABLED = no - diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml index 3c95ad8507..bd693babc3 100644 --- a/users/drashna/.gitlab-ci.yml +++ b/users/drashna/.gitlab-ci.yml @@ -13,7 +13,7 @@ qmk_firmware: - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util diffutils gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip - avr-gcc --version script: - - make iris/rev2:drashna iris/rev2:drashna_old ergodox_ez:drashna viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna + - make iris/rev2:drashna:production iris/rev2:drashna_old:production ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna:production orthodox/rev1:drashna:production orthodox/rev3:drashna:production crkbd:drashna:production planck/light:drashna:production artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" paths: diff --git a/users/drashna/config.h b/users/drashna/config.h index 06cae86ab9..a338512300 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -3,7 +3,7 @@ #ifdef AUDIO_ENABLE #define AUDIO_CLICKY -#define STARTUP_SONG SONG(E1M1_DOOM) +#define STARTUP_SONG SONG(RICK_ROLL) #define GOODBYE_SONG SONG(SONIC_RING) #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ SONG(COLEMAK_SOUND), \ @@ -44,7 +44,7 @@ // and when this option isn't enabled, z rapidly followed by x // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT -#define PERMISSIVE_HOLD +#undef PERMISSIVE_HOLD //#define TAPPING_FORCE_HOLD //#define RETRO_TAPPING diff --git a/users/drashna/drashna.c b/users/drashna/drashna.c index 8f10a530e2..2228248379 100644 --- a/users/drashna/drashna.c +++ b/users/drashna/drashna.c @@ -16,8 +16,6 @@ along with this program. If not, see . */ #include "drashna.h" -#include "tap_dances.h" -#include "rgb_stuff.h" userspace_config_t userspace_config; #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) @@ -27,9 +25,6 @@ userspace_config_t userspace_config; #define DRASHNA_UNICODE_MODE 2 #endif -uint16_t copy_paste_timer; -// Helper Functions - // This block is for all of the gaming macros, as they were all doing // the same thing, but with differring text sent. @@ -109,55 +104,9 @@ void bootmagic_lite(void) { __attribute__ ((weak)) void matrix_init_keymap(void) {} -__attribute__ ((weak)) -void startup_keymap(void) {} - -__attribute__ ((weak)) -void shutdown_keymap(void) {} - -__attribute__ ((weak)) -void suspend_power_down_keymap(void) {} - -__attribute__ ((weak)) -void suspend_wakeup_init_keymap(void) {} - -__attribute__ ((weak)) -void matrix_scan_keymap(void) {} - -__attribute__ ((weak)) -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -__attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - - -__attribute__ ((weak)) -uint32_t layer_state_set_keymap (uint32_t state) { - return state; -} - -__attribute__ ((weak)) -uint32_t default_layer_state_set_keymap (uint32_t state) { - return state; -} - -__attribute__ ((weak)) -void led_set_keymap(uint8_t usb_led) {} - -__attribute__ ((weak)) -void eeconfig_init_keymap(void) {} - // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - #if !defined(BOOTMAGIC_LITE) && !defined(BOOTMAGIC_ENABLE) - bootmagic_lite(); - #endif - userspace_config.raw = eeconfig_read_user(); #ifdef BOOTLOADER_CATERINA @@ -178,40 +127,42 @@ void matrix_init_user(void) { #endif //RGBLIGHT_ENABLE } -void startup_user (void) { - // #ifdef RGBLIGHT_ENABLE - // matrix_init_rgb(); - // #endif //RGBLIGHT_ENABLE - startup_keymap(); -} + +__attribute__ ((weak)) +void shutdown_keymap(void) {} void shutdown_user (void) { -#ifdef RGBLIGHT_ENABLE - rgblight_enable_noeeprom(); - rgblight_mode_noeeprom(1); - rgblight_setrgb_red(); -#endif // RGBLIGHT_ENABLE -#ifdef RGB_MATRIX_ENABLE - rgb_led led; - for (int i = 0; i < DRIVER_LED_TOTAL; i++) { - led = g_rgb_leds[i]; - if (led.matrix_co.raw < 0xFF) { - rgb_matrix_set_color( i, 0xFF, 0x00, 0x00 ); - } - } -#endif //RGB_MATRIX_ENABLE + #ifdef RGBLIGHT_ENABLE + rgblight_enable_noeeprom(); + rgblight_mode_noeeprom(1); + rgblight_setrgb_red(); + #endif // RGBLIGHT_ENABLE + #ifdef RGB_MATRIX_ENABLE + uint16_t timer_start = timer_read(); + rgb_matrix_set_color_all( 0xFF, 0x00, 0x00 ); + while(timer_elapsed(timer_start) < 250) { wait_ms(1); } + #endif //RGB_MATRIX_ENABLE shutdown_keymap(); } +__attribute__ ((weak)) +void suspend_power_down_keymap(void) {} + void suspend_power_down_user(void) { suspend_power_down_keymap(); } +__attribute__ ((weak)) +void suspend_wakeup_init_keymap(void) {} + void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } +__attribute__ ((weak)) +void matrix_scan_keymap(void) {} + // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { @@ -233,172 +184,11 @@ void matrix_scan_user(void) { } - - -// Defines actions tor my global custom keycodes. Defined in drashna.h file -// Then runs the _keymap's record handier if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - // If console is enabled, it will print the matrix position and status of each key pressed -#ifdef KEYLOGGER_ENABLE - #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) - xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed); - #else - xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); - #endif -#endif //KEYLOGGER_ENABLE - - switch (keycode) { - case KC_QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - break; - case KC_COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - break; - case KC_DVORAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_DVORAK); - } - break; - case KC_WORKMAN: - if (record->event.pressed) { - set_single_persistent_default_layer(_WORKMAN); - } - break; - - - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); - if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { - #if defined(__ARM__) - send_string_with_delay_P(PSTR(":dfu-util"), 10); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), 10); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), 10); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), 10); - #endif // bootloader options - } - #if defined(KEYBOARD_viterbi) - send_string_with_delay_P(PSTR(":dfu"), 10); - #endif - if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); - set_mods(temp_mod); - } - break; - - case VRSN: // Prints firmware version - if (record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); - } - break; - -// These are a serious of gaming macros. -// Only enables for the viterbi, basically, -// to save on firmware space, since it's limited. -#ifdef MACROS_ENABLED - case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros - if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } -#ifdef RGBLIGHT_ENABLE - userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); -#endif //RGBLIGHT_ENABLE - break; - case KC_SALT: - return send_game_macro("Salt, salt, salt...", record, false); - case KC_MORESALT: - return send_game_macro("Please sir, can I have some more salt?!", record, false); - case KC_SALTHARD: - return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); - case KC_GOODGAME: - return send_game_macro("Good game, everyone!", record, false); - case KC_GLHF: - return send_game_macro("Good luck, have fun!!!", record, false); - case KC_SYMM: - return send_game_macro("Left click to win!", record, false); - case KC_JUSTGAME: - return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); - case KC_TORB: - return send_game_macro("That was positively riveting!", record, false); - case KC_AIM: - send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); - return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); - case KC_C9: - return send_game_macro("OMG!!! C9!!!", record, false); - case KC_GGEZ: - return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); -#endif // MACROS_ENABLED - - - case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } -#endif // TAP_DANCE_ENABLE - break; - - - case KC_CCCV: // One key copy/paste - if(record->event.pressed){ - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - register_code(KC_LCTL); - tap_code(KC_C); - unregister_code(KC_LCTL); - } else { // Tap, paste - register_code(KC_LCTL); - tap_code(KC_V); - unregister_code(KC_LCTL); - } - } - break; -#ifdef UNICODE_ENABLE - case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ - if (record->event.pressed) { - send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - } - break; - case UC_TABL: // ┬─┬ノ( º _ ºノ) - if (record->event.pressed) { - send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); - } - break; - case UC_SHRG: // ¯\_(ツ)_/¯ - if (record->event.pressed) { - send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); - } - break; - case UC_DISA: // ಠ_ಠ - if (record->event.pressed) { - send_unicode_hex_string("0CA0 005F 0CA0"); - } - break; -#endif - } - return process_record_keymap(keycode, record) && -#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) - process_record_user_rgb(keycode, record) && -#endif // RGBLIGHT_ENABLE - process_record_secrets(keycode, record); +__attribute__ ((weak)) +uint32_t layer_state_set_keymap (uint32_t state) { + return state; } - - -// Runs state check and changes underglow color and animation // on layer change, no matter where the change was initiated // Then runs keymap's layer change check uint32_t layer_state_set_user(uint32_t state) { @@ -410,6 +200,12 @@ uint32_t layer_state_set_user(uint32_t state) { } +__attribute__ ((weak)) +uint32_t default_layer_state_set_keymap (uint32_t state) { + return state; +} + +// Runs state check and changes underglow color and animation uint32_t default_layer_state_set_user(uint32_t state) { state = default_layer_state_set_keymap(state); #ifdef RGBLIGHT_ENABLE @@ -418,6 +214,8 @@ uint32_t default_layer_state_set_user(uint32_t state) { return state; } +__attribute__ ((weak)) +void led_set_keymap(uint8_t usb_led) {} // Any custom LED code goes here. // So far, I only have keyboard specific code, @@ -426,6 +224,9 @@ void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } +__attribute__ ((weak)) +void eeconfig_init_keymap(void) {} + void eeconfig_init_user(void) { userspace_config.raw = 0; userspace_config.rgb_layer_change = true; diff --git a/users/drashna/drashna.h b/users/drashna/drashna.h index 06e726714c..0a3d0f6327 100644 --- a/users/drashna/drashna.h +++ b/users/drashna/drashna.h @@ -19,9 +19,13 @@ along with this program. If not, see . #include "quantum.h" #include "version.h" #include "eeprom.h" - -#ifdef RGB_MATRIX_ENABLE -#include "rgb_matrix.h" +#include "wrappers.h" +#include "process_records.h" +#ifdef TAP_DANCE_ENABLE + #include "tap_dances.h" +#endif // TAP_DANCE_ENABLE +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #include "rgb_stuff.h" #endif @@ -51,17 +55,19 @@ define modifiers here, since MOD_* doesn't seem to work for these #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) -/* -RGB color codes are no longer located here anymore. Instead, you will want to -head to https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h -*/ - -#ifdef RGBLIGHT_ENABLE -void rgblight_sethsv_default_helper(uint8_t index); -#endif // RGBLIGHT_ENABLE bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); +bool send_game_macro(const char *str, keyrecord_t *record, bool override); +void matrix_init_keymap(void); +void shutdown_keymap(void); +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +void matrix_scan_keymap(void); +uint32_t layer_state_set_keymap (uint32_t state); +uint32_t default_layer_state_set_keymap (uint32_t state); +void led_set_keymap(uint8_t usb_led); +void eeconfig_init_keymap(void); typedef union { uint32_t raw; @@ -75,110 +81,6 @@ typedef union { extern userspace_config_t userspace_config; -#if defined(KEYMAP_SAFE_RANGE) - #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else - #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes { - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_QWERTY, // Sets default layer to QWERTY - KC_COLEMAK, // Sets default layer to COLEMAK - KC_DVORAK, // Sets default layer to DVORAK - KC_WORKMAN, // Sets default layer to WORKMAN - KC_DIABLO_CLEAR, // Clears all Diablo Timers - KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) - KC_SALT, // See drashna.c for details - KC_MORESALT, - KC_SALTHARD, - KC_GOODGAME, - KC_SYMM, - KC_JUSTGAME, - KC_GLHF, - KC_TORB, - KC_AIM, - KC_C9, - KC_GGEZ, - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - KC_SECRET_1, // test1 - KC_SECRET_2, // test2 - KC_SECRET_3, // test3 - KC_SECRET_4, // test4 - KC_SECRET_5, // test5 - KC_CCCV, // Hold to copy, tap to paste - KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes -}; - - -#define LOWER MO(_LOWER) -#define RAISE MO(_RAISE) -#define ADJUST MO(_ADJUST) -#define TG_MODS TG(_MODS) -#define TG_GAME TG(_GAMEPAD) - -#define KC_SEC1 KC_SECRET_1 -#define KC_SEC2 KC_SECRET_2 -#define KC_SEC3 KC_SECRET_3 -#define KC_SEC4 KC_SECRET_4 -#define KC_SEC5 KC_SECRET_5 - -#define QWERTY KC_QWERTY -#define DVORAK KC_DVORAK -#define COLEMAK KC_COLEMAK -#define WORKMAN KC_WORKMAN - -#define KC_RESET RESET -#define KC_RST KC_RESET - -#ifdef SWAP_HANDS_ENABLE -#define KC_C1R3 SH_TT -#else // SWAP_HANDS_ENABLE -#define KC_C1R3 KC_BSPC -#endif // SWAP_HANDS_ENABLE - -#define BK_LWER LT(_LOWER, KC_BSPC) -#define SP_LWER LT(_LOWER, KC_SPC) -#define DL_RAIS LT(_RAISE, KC_DEL) -#define ET_RAIS LT(_RAISE, KC_ENTER) - -/* OSM keycodes, to keep things clean and easy to change */ -#define KC_MLSF OSM(MOD_LSFT) -#define KC_MRSF OSM(MOD_RSFT) - -#define OS_LGUI OSM(MOD_LGUI) -#define OS_RGUI OSM(MOD_RGUI) -#define OS_LSFT OSM(MOD_LSFT) -#define OS_RSFT OSM(MOD_RSFT) -#define OS_LCTL OSM(MOD_LCTL) -#define OS_RCTL OSM(MOD_RCTL) -#define OS_LALT OSM(MOD_LALT) -#define OS_RALT OSM(MOD_RALT) -#define OS_MEH OSM(MOD_MEH) -#define OS_HYPR OSM(MOD_HYPR) - -#define ALT_APP ALT_T(KC_APP) - -#define MG_NKRO MAGIC_TOGGLE_NKRO - -#define UC_IRNY UC(0x2E2E) -#define UC_CLUE UC(0x203D) - -#ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4 -}; -#endif // TAP_DANCE_ENABLE - /* Custom Keycodes for Diablo 3 layer @@ -196,172 +98,3 @@ We use custom codes here, so we can substitute the right stuff #define KC_D3_3 KC_3 #define KC_D3_4 KC_4 #endif // TAP_DANCE_ENABLE - -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B -#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G -#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V - -#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O -#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - - -#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U -#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L -#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S -#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K -#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G -#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN -#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U -#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH - - -#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B -#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F -#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM - -#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L -#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R -#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X - - -#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q -#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U -#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W - -#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P -#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N -#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN - - -#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W -#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X - -#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J -#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN -#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J - -#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN -#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W -#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R -#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J - -#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN -#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H -#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH - - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ - - -#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ -#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ - -#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR -#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT - - - -#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ -#define _________________RAISE_L2__________________ ___________________BLANK___________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ -#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC -#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END - - - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM -#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 -#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN -#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c new file mode 100644 index 0000000000..5e311e60e8 --- /dev/null +++ b/users/drashna/process_records.c @@ -0,0 +1,175 @@ +#include "drashna.h" + +uint16_t copy_paste_timer; + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +__attribute__ ((weak)) +bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +// Defines actions tor my global custom keycodes. Defined in drashna.h file +// Then runs the _keymap's record handier if not processed here +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + // If console is enabled, it will print the matrix position and status of each key pressed +#ifdef KEYLOGGER_ENABLE + #if defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_iris_rev2) + xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.row, record->event.key.col, record->event.pressed); + #else + xprintf("KL: col: %u, row: %u, pressed: %u\n", record->event.key.col, record->event.key.row, record->event.pressed); + #endif +#endif //KEYLOGGER_ENABLE + + switch (keycode) { + case KC_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + break; + case KC_COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + break; + case KC_DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + break; + case KC_WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + break; + + + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { + #if defined(__ARM__) + send_string_with_delay_P(PSTR(":dfu-util"), 10); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), 10); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), 10); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), 10); + #endif // bootloader options + } + #if defined(KEYBOARD_viterbi) + send_string_with_delay_P(PSTR(":dfu"), 10); + #endif + if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + set_mods(temp_mod); + } + break; + + case VRSN: // Prints firmware version + if (record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), MACRO_TIMER); + } + break; + +// These are a serious of gaming macros. +// Only enables for the viterbi, basically, +// to save on firmware space, since it's limited. +#ifdef MACROS_ENABLED + case KC_OVERWATCH: // Toggle's if we hit "ENTER" or "BACKSPACE" to input macros + if (record->event.pressed) { userspace_config.is_overwatch ^= 1; eeconfig_update_user(userspace_config.raw); } +#ifdef RGBLIGHT_ENABLE + userspace_config.is_overwatch ? rgblight_mode_noeeprom(17) : rgblight_mode_noeeprom(18); +#endif //RGBLIGHT_ENABLE + break; + case KC_SALT: + return send_game_macro("Salt, salt, salt...", record, false); + case KC_MORESALT: + return send_game_macro("Please sir, can I have some more salt?!", record, false); + case KC_SALTHARD: + return send_game_macro("Your salt only makes me harder, and even more aggressive!", record, false); + case KC_GOODGAME: + return send_game_macro("Good game, everyone!", record, false); + case KC_GLHF: + return send_game_macro("Good luck, have fun!!!", record, false); + case KC_SYMM: + return send_game_macro("Left click to win!", record, false); + case KC_JUSTGAME: + return send_game_macro("It may be a game, but if you don't want to actually try, please go play AI, so that people that actually want to take the game seriously and \"get good\" have a place to do so without trolls like you throwing games.", record, false); + case KC_TORB: + return send_game_macro("That was positively riveting!", record, false); + case KC_AIM: + send_game_macro("That aim is absolutely amazing. It's almost like you're a machine!", record, true); + return send_game_macro("Wait! That aim is TOO good! You're clearly using an aim hack! CHEATER!", record, false); + case KC_C9: + return send_game_macro("OMG!!! C9!!!", record, false); + case KC_GGEZ: + return send_game_macro("That was a fantastic game, though it was a bit easy. Try harder next time!", record, false); +#endif // MACROS_ENABLED + + + case KC_DIABLO_CLEAR: // reset all Diablo timers, disabling them +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } +#endif // TAP_DANCE_ENABLE + break; + + + case KC_CCCV: // One key copy/paste + if(record->event.pressed){ + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + register_code(KC_LCTL); + tap_code(KC_C); + unregister_code(KC_LCTL); + } else { // Tap, paste + register_code(KC_LCTL); + tap_code(KC_V); + unregister_code(KC_LCTL); + } + } + break; +#ifdef UNICODE_ENABLE + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + break; +#endif + } + return process_record_keymap(keycode, record) && +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + process_record_user_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE + process_record_secrets(keycode, record); +} diff --git a/users/drashna/process_records.h b/users/drashna/process_records.h new file mode 100644 index 0000000000..620997addf --- /dev/null +++ b/users/drashna/process_records.h @@ -0,0 +1,101 @@ +#pragma once +#include "drashna.h" + +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_custom_keycodes { + VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info + KC_QWERTY, // Sets default layer to QWERTY + KC_COLEMAK, // Sets default layer to COLEMAK + KC_DVORAK, // Sets default layer to DVORAK + KC_WORKMAN, // Sets default layer to WORKMAN + KC_DIABLO_CLEAR, // Clears all Diablo Timers + KC_OVERWATCH, // Toggles game macro input mode (so in OW, it defaults to game chat) + KC_SALT, // See drashna.c for details + KC_MORESALT, + KC_SALTHARD, + KC_GOODGAME, + KC_SYMM, + KC_JUSTGAME, + KC_GLHF, + KC_TORB, + KC_AIM, + KC_C9, + KC_GGEZ, + KC_MAKE, // Run keyboard's customized make command + KC_RGB_T, // Toggles RGB Layer Indication mode + KC_SECRET_1, // test1 + KC_SECRET_2, // test2 + KC_SECRET_3, // test3 + KC_SECRET_4, // test4 + KC_SECRET_5, // test5 + KC_CCCV, // Hold to copy, tap to paste + KC_NUKE, // NUCLEAR LAUNCH DETECTED!!! + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes +}; + +bool process_record_secrets(uint16_t keycode, keyrecord_t *record); +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + + + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) +#define TG_MODS TG(_MODS) +#define TG_GAME TG(_GAMEPAD) + +#define KC_SEC1 KC_SECRET_1 +#define KC_SEC2 KC_SECRET_2 +#define KC_SEC3 KC_SECRET_3 +#define KC_SEC4 KC_SECRET_4 +#define KC_SEC5 KC_SECRET_5 + +#define QWERTY KC_QWERTY +#define DVORAK KC_DVORAK +#define COLEMAK KC_COLEMAK +#define WORKMAN KC_WORKMAN + +#define KC_RESET RESET +#define KC_RST KC_RESET + +#ifdef SWAP_HANDS_ENABLE +#define KC_C1R3 SH_TT +#else // SWAP_HANDS_ENABLE +#define KC_C1R3 KC_BSPC +#endif // SWAP_HANDS_ENABLE + +#define BK_LWER LT(_LOWER, KC_BSPC) +#define SP_LWER LT(_LOWER, KC_SPC) +#define DL_RAIS LT(_RAISE, KC_DEL) +#define ET_RAIS LT(_RAISE, KC_ENTER) + +/* OSM keycodes, to keep things clean and easy to change */ +#define KC_MLSF OSM(MOD_LSFT) +#define KC_MRSF OSM(MOD_RSFT) + +#define OS_LGUI OSM(MOD_LGUI) +#define OS_RGUI OSM(MOD_RGUI) +#define OS_LSFT OSM(MOD_LSFT) +#define OS_RSFT OSM(MOD_RSFT) +#define OS_LCTL OSM(MOD_LCTL) +#define OS_RCTL OSM(MOD_RCTL) +#define OS_LALT OSM(MOD_LALT) +#define OS_RALT OSM(MOD_RALT) +#define OS_MEH OSM(MOD_MEH) +#define OS_HYPR OSM(MOD_HYPR) + +#define ALT_APP ALT_T(KC_APP) + +#define MG_NKRO MAGIC_TOGGLE_NKRO + +#define UC_IRNY UC(0x2E2E) +#define UC_CLUE UC(0x203D) diff --git a/users/drashna/rgb_stuff.h b/users/drashna/rgb_stuff.h index 3db068a31d..065bda9f9e 100644 --- a/users/drashna/rgb_stuff.h +++ b/users/drashna/rgb_stuff.h @@ -1,4 +1,8 @@ +#pragma once #include "quantum.h" +#ifdef RGB_MATRIX_ENABLE + #include "rgb_matrix.h" +#endif typedef struct { bool enabled; @@ -13,3 +17,5 @@ void matrix_init_rgb(void); void matrix_scan_rgb(void); uint32_t layer_state_set_rgb(uint32_t state); uint32_t default_layer_state_set_rgb(uint32_t state); +void rgblight_sethsv_default_helper(uint8_t index); +void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ); diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 49b1ddae97..5f243b0076 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -1,4 +1,5 @@ -SRC += drashna.c +SRC += drashna.c \ + process_records.c ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") SRC += secrets.c diff --git a/users/drashna/tap_dances.c b/users/drashna/tap_dances.c index 3466758530..cbb3cf54ef 100644 --- a/users/drashna/tap_dances.c +++ b/users/drashna/tap_dances.c @@ -1,4 +1,3 @@ -#include "drashna.h" #include "tap_dances.h" diff --git a/users/drashna/tap_dances.h b/users/drashna/tap_dances.h index 8935753f6c..41d2bacb7b 100644 --- a/users/drashna/tap_dances.h +++ b/users/drashna/tap_dances.h @@ -1,3 +1,6 @@ +#pragma once +#include "drashna.h" + //define diablo macro timer variables extern uint16_t diablo_timer[4]; extern uint8_t diablo_times[]; @@ -5,3 +8,12 @@ extern uint8_t diablo_key_time[4]; void run_diablo_macro_check(void); + +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 +}; +#endif // TAP_DANCE_ENABLE diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h new file mode 100644 index 0000000000..b45359f676 --- /dev/null +++ b/users/drashna/wrappers.h @@ -0,0 +1,170 @@ +#pragma once +#include "drashna.h" +/* +Since our quirky block definitions are basically a list of comma separated +arguments, we need a wrapper in order for these definitions to be +expanded before being used as arguments to the LAYOUT_xxx macro. +*/ +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) +#define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) + +/* +Blocks for each of the four major keyboard layouts +Organized so we can quickly adapt and modify all of them +at once, rather than for each keyboard, one at a time. +And this allows for much cleaner blocks in the keymaps. +For instance Tap/Hold for Control on all of the layouts + +NOTE: These are all the same length. If you do a search/replace + then you need to add/remove underscores to keep the + lengths consistent. +*/ + +#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G +#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D +#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O +#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH + +#define ______________COLEMAK_MOD_DH_L1____________ KC_Q, KC_W, KC_F, KC_P, KC_B +#define ______________COLEMAK_MOD_DH_L2____________ KC_A, KC_R, KC_S, KC_T, KC_G +#define ______________COLEMAK_MOD_DH_L3____________ KC_Z, KC_X, KC_C, KC_D, KC_V + +#define ______________COLEMAK_MOD_DH_R1____________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN +#define ______________COLEMAK_MOD_DH_R2____________ KC_M, KC_N, KC_E, KC_I, KC_O +#define ______________COLEMAK_MOD_DH_R3____________ KC_K, KC_H, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I +#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L +#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S +#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z + + +#define ________________DVORAK_AU_L1_______________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y +#define ________________DVORAK_AU_L2_______________ KC_O, KC_A, KC_E, KC_I, KC_U +#define ________________DVORAK_AU_L3_______________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X + +#define ________________DVORAK_AU_R1_______________ KC_F, KC_G, KC_C, KC_R, KC_L +#define ________________DVORAK_AU_R2_______________ KC_D, KC_H, KC_T, KC_N, KC_S +#define ________________DVORAK_AU_R3_______________ KC_B, KC_M, KC_W, KC_V, KC_Z + +#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I +#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________NORMAN_L1_________________ KC_Q, KC_W, KC_D, KC_F, KC_K +#define _________________NORMAN_L2_________________ KC_A, KC_S, KC_E, KC_T, KC_G +#define _________________NORMAN_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________NORMAN_R1_________________ KC_J, KC_U, KC_R, KC_L, KC_SCLN +#define _________________NORMAN_R2_________________ KC_Y, KC_N, KC_I, KC_O, KC_U +#define _________________NORMAN_R3_________________ KC_P, KC_M, KC_COMM, KC_DOT, KC_SLASH + + +#define _________________MALTRON_L1________________ KC_Q, KC_P, KC_Y, KC_C, KC_B +#define _________________MALTRON_L2________________ KC_A, KC_N, KC_I, KC_S, KC_F +#define _________________MALTRON_L3________________ KC_SCLN, KC_SLSH, KC_J KC_G, KC_COMM + +#define _________________MALTRON_R1________________ KC_V, KC_M, KC_U, KC_Z, KC_L +#define _________________MALTRON_R2________________ KC_D, KC_T, KC_D, KC_O, KC_R +#define _________________MALTRON_R3________________ KC_DOT, KC_W, KC_K, KC_MINS, KC_X + + +#define _________________EUCALYN_L1________________ KC_SLSH, KC_COMM, KC_DOT, KC_F, KC_Q +#define _________________EUCALYN_L2________________ KC_A, KC_O, KC_E, KC_I, KC_U +#define _________________EUCALYN_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_W + +#define _________________EUCALYN_R1________________ KC_M, KC_R, KC_D, KC_Y, KC_P +#define _________________EUCALYN_R2________________ KC_G, KC_T, KC_K, KC_S, KC_N +#define _________________EUCALYN_R3________________ KC_B, KC_H, KC_J, KC_L, KC_SCLN + + +#define _____________CARPLAX_QFMLWY_L1_____________ KC_Q, KC_F, KC_M, KC_L, KC_W +#define _____________CARPLAX_QFMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QFMLWY_L3_____________ KC_Z, KC_V, KC_G, KC_C, KC_X + +#define _____________CARPLAX_QFMLWY_R1_____________ KC_Y, KC_U, KC_O, KC_B, KC_J +#define _____________CARPLAX_QFMLWY_R2_____________ KC_I, KC_A, KC_E, KC_H, KC_SCLN +#define _____________CARPLAX_QFMLWY_R3_____________ KC_P, KC_K, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWB_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWB_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWB_L3_____________ KC_Z, KC_X, KC_C, KC_F, KC_J + +#define _____________CARPLAX_QGMLWB_R1_____________ KC_B, KC_Y, KC_U, KC_V, KC_SCLN +#define _____________CARPLAX_QGMLWB_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWB_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define _____________CARPLAX_QGMLWY_L1_____________ KC_Q, KC_G, KC_M, KC_L, KC_W +#define _____________CARPLAX_QGMLWY_L2_____________ KC_D, KC_S, KC_T, KC_N, KC_R +#define _____________CARPLAX_QGMLWY_L3_____________ KC_Z, KC_X, KC_C, KC_V, KC_J + +#define _____________CARPLAX_QGMLWY_R1_____________ KC_Y, KC_F, KC_U, KC_B, KC_SCLN +#define _____________CARPLAX_QGMLWY_R2_____________ KC_I, KC_A, KC_E, KC_O, KC_H +#define _____________CARPLAX_QGMLWY_R3_____________ KC_K, KC_P, KC_COMM, KC_DOT, KC_SLSH + + +#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 +#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define ___________________BLANK___________________ _______, _______, _______, _______, _______ + + +#define _________________LOWER_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC +#define _________________LOWER_L2__________________ _________________FUNC_LEFT_________________ +#define _________________LOWER_L3__________________ _________________FUNC_RIGHT________________ + +#define _________________LOWER_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN +#define _________________LOWER_R2__________________ _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR +#define _________________LOWER_R3__________________ _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + + + +#define _________________RAISE_L1__________________ ________________NUMBER_LEFT________________ +#define _________________RAISE_L2__________________ ___________________BLANK___________________ +#define _________________RAISE_L3__________________ ___________________BLANK___________________ + +#define _________________RAISE_R1__________________ ________________NUMBER_RIGHT_______________ +#define _________________RAISE_R2__________________ _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC +#define _________________RAISE_R3__________________ _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END + + + +#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG +#define _________________ADJUST_L2_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, AG_NORM +#define _________________ADJUST_L3_________________ RGB_RMOD,RGB_HUD,RGB_SAD, RGB_VAD, KC_RGB_T + +#define _________________ADJUST_R1_________________ KC_SEC1, KC_SEC2, KC_SEC3, KC_SEC4, KC_SEC5 +#define _________________ADJUST_R2_________________ AG_SWAP, QWERTY, COLEMAK, DVORAK, WORKMAN +#define _________________ADJUST_R3_________________ MG_NKRO, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT -- cgit v1.2.3 From 8a330b33ff41ffc1ec3f8fa39722e93115ea3f0f Mon Sep 17 00:00:00 2001 From: Legonut Date: Tue, 4 Dec 2018 21:15:52 -0500 Subject: Keyboard: Add new keyboard "Sol" from RGBKB (#4497) * Add final RGBKB Sol firmware * Apply suggestions from code review Apply most of the changes noroadsleft has suggested Co-Authored-By: Legonut * Cleanup readme * Cleanup keymaps per @noroadslefts suggestions * Remove eeproms, use set_single_persistent_default_layer * Suggestions from @noroadsleft and @drashna some small cleanup * Change RGB_SMOD to RGB_RMOD * fix RGB_SMOD * Apply suggestions from code review Remove redundant lines Co-Authored-By: Legonut --- keyboards/sol/common/glcdfont.c | 244 +++++++++++++++++++ keyboards/sol/common/knob_v2.c | 71 ++++++ keyboards/sol/common/knob_v2.h | 28 +++ keyboards/sol/common/ssd1306.c | 329 +++++++++++++++++++++++++ keyboards/sol/common/ssd1306.h | 92 +++++++ keyboards/sol/config.h | 22 ++ keyboards/sol/i2c.c | 162 +++++++++++++ keyboards/sol/i2c.h | 49 ++++ keyboards/sol/keymaps/brianweyer/config.h | 27 +++ keyboards/sol/keymaps/brianweyer/keymap.c | 291 ++++++++++++++++++++++ keyboards/sol/keymaps/brianweyer/rules.mk | 46 ++++ keyboards/sol/keymaps/danielhklein/config.h | 25 ++ keyboards/sol/keymaps/danielhklein/keymap.c | 354 +++++++++++++++++++++++++++ keyboards/sol/keymaps/danielhklein/rules.mk | 50 ++++ keyboards/sol/keymaps/default/config.h | 25 ++ keyboards/sol/keymaps/default/keymap.c | 362 ++++++++++++++++++++++++++++ keyboards/sol/keymaps/default/readme.md | 133 ++++++++++ keyboards/sol/keymaps/default/rules.mk | 50 ++++ keyboards/sol/keymaps/kageurufu/config.h | 25 ++ keyboards/sol/keymaps/kageurufu/keymap.c | 335 +++++++++++++++++++++++++ keyboards/sol/keymaps/kageurufu/readme.md | 47 ++++ keyboards/sol/keymaps/kageurufu/rules.mk | 46 ++++ keyboards/sol/readme.md | 15 ++ keyboards/sol/rev1/config.h | 155 ++++++++++++ keyboards/sol/rev1/matrix.c | 304 +++++++++++++++++++++++ keyboards/sol/rev1/rev1.c | 15 ++ keyboards/sol/rev1/rev1.h | 70 ++++++ keyboards/sol/rev1/rules.mk | 2 + keyboards/sol/rev1/split_util.c | 54 +++++ keyboards/sol/rev1/split_util.h | 17 ++ keyboards/sol/rules.mk | 71 ++++++ keyboards/sol/serial.c | 288 ++++++++++++++++++++++ keyboards/sol/serial.h | 26 ++ keyboards/sol/sol.c | 1 + keyboards/sol/sol.h | 7 + 35 files changed, 3838 insertions(+) create mode 100644 keyboards/sol/common/glcdfont.c create mode 100644 keyboards/sol/common/knob_v2.c create mode 100644 keyboards/sol/common/knob_v2.h create mode 100644 keyboards/sol/common/ssd1306.c create mode 100644 keyboards/sol/common/ssd1306.h create mode 100644 keyboards/sol/config.h create mode 100644 keyboards/sol/i2c.c create mode 100644 keyboards/sol/i2c.h create mode 100755 keyboards/sol/keymaps/brianweyer/config.h create mode 100755 keyboards/sol/keymaps/brianweyer/keymap.c create mode 100755 keyboards/sol/keymaps/brianweyer/rules.mk create mode 100644 keyboards/sol/keymaps/danielhklein/config.h create mode 100644 keyboards/sol/keymaps/danielhklein/keymap.c create mode 100644 keyboards/sol/keymaps/danielhklein/rules.mk create mode 100644 keyboards/sol/keymaps/default/config.h create mode 100644 keyboards/sol/keymaps/default/keymap.c create mode 100644 keyboards/sol/keymaps/default/readme.md create mode 100644 keyboards/sol/keymaps/default/rules.mk create mode 100644 keyboards/sol/keymaps/kageurufu/config.h create mode 100644 keyboards/sol/keymaps/kageurufu/keymap.c create mode 100644 keyboards/sol/keymaps/kageurufu/readme.md create mode 100644 keyboards/sol/keymaps/kageurufu/rules.mk create mode 100644 keyboards/sol/readme.md create mode 100644 keyboards/sol/rev1/config.h create mode 100644 keyboards/sol/rev1/matrix.c create mode 100644 keyboards/sol/rev1/rev1.c create mode 100644 keyboards/sol/rev1/rev1.h create mode 100644 keyboards/sol/rev1/rules.mk create mode 100644 keyboards/sol/rev1/split_util.c create mode 100644 keyboards/sol/rev1/split_util.h create mode 100644 keyboards/sol/rules.mk create mode 100644 keyboards/sol/serial.c create mode 100644 keyboards/sol/serial.h create mode 100644 keyboards/sol/sol.c create mode 100644 keyboards/sol/sol.h diff --git a/keyboards/sol/common/glcdfont.c b/keyboards/sol/common/glcdfont.c new file mode 100644 index 0000000000..89665ba074 --- /dev/null +++ b/keyboards/sol/common/glcdfont.c @@ -0,0 +1,244 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +static const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, + 0x03, 0x07, 0x1F, 0x7F, 0xFF, 0xFF, + 0xFE, 0xF8, 0xF0, 0xC0, 0x20, 0xF8, + 0xFE, 0xFF, 0xFE, 0x79, 0x27, 0x1F, + 0x7F, 0xFF, 0xFF, 0xFE, 0xF8, 0xF0, + 0xC0, 0x20, 0xF8, 0xFE, 0xFF, 0xFF, + 0x7F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFE, + 0xF8, 0xF0, 0xC0, 0x00, 0x00, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xFF, 0x7F, 0x7F, 0x7F, + 0xBF, 0xBF, 0xC0, 0xC0, 0xC0, 0xE0, + 0xE0, 0xE0, 0xE0, 0xF0, 0xF0, 0xF0, + 0xF8, 0x78, 0x78, 0x7C, 0x3C, 0x3C, + 0xFE, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, + 0xBF, 0xBF, 0xDF, 0xDF, 0xEF, 0xEF, + 0x00, 0x03, 0x07, 0x1F, 0x7F, 0xFF, + 0xFF, 0xFF, 0xFE, 0xF8, 0xE0, 0xC0, + 0xE0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, + 0x7F, 0x1F, 0x07, 0x03, 0x00, 0x00, + 0xE0, 0xF0, 0xF0, 0xF0, 0xE0, 0xEC, + 0xEE, 0xF7, 0xF3, 0x70, 0x20, 0x00, + 0x7C, 0x7C, 0x7C, 0x7E, 0x00, 0x7E, + 0x7E, 0x7E, 0x7F, 0x7F, 0x7F, 0x00, + 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, + 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, + 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, + 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xC1, 0xF3, + 0xCF, 0xBF, 0x7F, 0xFF, 0xFF, 0xFC, + 0xFB, 0xE7, 0x81, 0x00, 0x00, 0x00, + 0x00, 0x80, 0xE3, 0xCF, 0x3F, 0xFF, + 0xFF, 0xFF, 0xFC, 0xFB, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x81, 0xE7, + 0xFF, 0xFF, 0xFF, 0xFF, 0x3C, 0x00, + 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xF8, 0xF8, 0xFC, 0x7C, 0x7E, + 0x7E, 0x3E, 0xFE, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xF7, 0xF7, 0xF7, 0xFB, + 0xFB, 0x7D, 0x7D, 0x7D, 0xBE, 0xBE, + 0xBE, 0xDF, 0xDF, 0xE0, 0xE0, 0x00, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0xFC, 0xFC, 0x7C, 0x7E, 0x7E, + 0x3E, 0x3E, 0x1F, 0x1F, 0x1F, 0x0F, + 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, + 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, + 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0x81, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x0F, 0x1F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x3F, 0x1E, 0x0C, 0x00, + 0x1F, 0x1F, 0x1F, 0x3F, 0x00, 0x3F, + 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x00, + 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, + 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, + 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, + 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x60, 0x70, 0x7C, 0x7F, 0x7F, 0x7F, + 0x7F, 0x1F, 0x06, 0x01, 0x03, 0x0F, + 0x3F, 0x7F, 0x7F, 0x7E, 0x7C, 0x7C, + 0x7E, 0x7F, 0x7F, 0x7F, 0x1F, 0x06, + 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0x7F, + 0x7E, 0x7C, 0x7C, 0x7E, 0x7F, 0x7F, + 0x3F, 0x0F, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7F, 0x7F, 0x7D, 0x7D, 0x3D, 0x3E, + 0x1E, 0x1F, 0x1F, 0x1F, 0x0F, 0x0F, + 0x07, 0x07, 0x07, 0x03, 0x03, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, + 0x7C, 0x7C, 0x7C, 0x7C, 0x7C, 0x00, + 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, + 0x00, 0x40, 0x70, 0x78, 0x7E, 0x7F, + 0x7F, 0x7F, 0x3F, 0x0F, 0x03, 0x01, + 0x03, 0x0F, 0x3F, 0x7F, 0x7F, 0x7F, + 0x7E, 0x78, 0x70, 0x40, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/sol/common/knob_v2.c b/keyboards/sol/common/knob_v2.c new file mode 100644 index 0000000000..f22f7c5d86 --- /dev/null +++ b/keyboards/sol/common/knob_v2.c @@ -0,0 +1,71 @@ +#include "knob_v2.h" + +bool knob_prev_a = false; +static knob_report_t knob_report = {.dir = 0, .phase = 0}; + +void knob_init(void) { + // I use pins D1 (ISR1) & D4 for a knob. + + // Set pin mode for D4 as input. + DDRD &= ~(0UL << ENCODER_PIN_2); + + // Enable internal pull-up for D4. + // This is done by "writing" 1 to a pin that has its mode set to input. + PORTD |= (1 << ENCODER_PIN_2); + + // Enable interrupt for D1 + // For more info on the below flags see this awesome section 11.1 (pages 89-90) here: + // https://cdn-shop.adafruit.com/datasheets/atmel-7766-8-bit-avr-atmega16u4-32u4_datasheet.pdf + // Set pin mode & pull-up. + DDRD &= ~(0UL << ENCODER_PIN_1); + PORTD |= (1UL << ENCODER_PIN_1); + + // INT: 33221100 + EICRA |= 0b00010000; // 0b01 - any edge + // INT: 6 3210 + EIMSK |= 0b00000100; +} + +ISR(ENCODER_INT) { + bool a = PIND & (1 << ENCODER_PIN_1); + + if (knob_prev_a != a) { + // "A" channel has REALLY changed. + knob_report.phase = a; + knob_prev_a = a; + bool b = PIND & (1 << ENCODER_PIN_2); + if (a == b) { + // Halfway through CCW rotation (A == B) + // + // +---YOU ARE HERE (A=1, B=1) + // | +---OR HERE (A=0, B=0) + // | | + // v v + // A: _____/^^^^^\__ + // B: __/^^^^^\_____ + knob_report.dir++; + } else { + // Halfway through CW rotation (A != B) + // + // +---YOU ARE HERE (A=1, B=0) + // | +---OR HERE (A=0, B=1) + // | | + // v v + // A: _____/^^^^^\_____ + // B: ________/^^^^^\__ + knob_report.dir--; + } + } +} + +knob_report_t knob_report_read(void) { + // Return knob report. + return knob_report; +} + +void knob_report_reset(void) { + // Call this ASAP once you've processed the previous knob report. + // TODO: This should probably be called within `knob_report_read`. + knob_report.dir = 0; + knob_report.phase = 0; +} diff --git a/keyboards/sol/common/knob_v2.h b/keyboards/sol/common/knob_v2.h new file mode 100644 index 0000000000..45196eb1a6 --- /dev/null +++ b/keyboards/sol/common/knob_v2.h @@ -0,0 +1,28 @@ +// Rotary knob implementation - Version 2. +// Uses 2 digital pins - D2 (via interrupt) & D6. +// #include "rev1.h" +#include +#include +#include + +#ifndef ENCODER_PIN_1 + #define ENCODER_PIN_1 PD2 +#endif +#ifndef ENCODER_PIN_2 + #define ENCODER_PIN_2 PD6 +#endif +#ifndef ENCODER_INT + #define ENCODER_INT INT2_vect +#endif + +typedef struct knob_report_t { + int8_t dir; // Contains number of rotations that happened + int8_t phase; // Contains 0 if last rotation happened on 90 degrees, 1 if on 270 +} knob_report_t; + +void knob_init(void); +knob_report_t knob_report_read(void); +void knob_report_reset(void); + +bool knob_prev_a; +int8_t knob_dir; diff --git a/keyboards/sol/common/ssd1306.c b/keyboards/sol/common/ssd1306.c new file mode 100644 index 0000000000..b3e55a67c2 --- /dev/null +++ b/keyboards/sol/common/ssd1306.c @@ -0,0 +1,329 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifndef LOCAL_GLCDFONT +#include "common/glcdfont.c" +#else +#include +#endif +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ +#define ScreenOffInterval 300000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty) { + iota_gfx_flush(); + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} +#endif diff --git a/keyboards/sol/common/ssd1306.h b/keyboards/sol/common/ssd1306.h new file mode 100644 index 0000000000..77ce7c211a --- /dev/null +++ b/keyboards/sol/common/ssd1306.h @@ -0,0 +1,92 @@ +#ifndef SSD1306_H +#define SSD1306_H + +#include +#include +#include "pincontrol.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + + + +#endif diff --git a/keyboards/sol/config.h b/keyboards/sol/config.h new file mode 100644 index 0000000000..93fd2261b1 --- /dev/null +++ b/keyboards/sol/config.h @@ -0,0 +1,22 @@ +/* +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#include "config_common.h" + diff --git a/keyboards/sol/i2c.c b/keyboards/sol/i2c.c new file mode 100644 index 0000000000..4bee5c6398 --- /dev/null +++ b/keyboards/sol/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/sol/keymaps/brianweyer/config.h b/keyboards/sol/keymaps/brianweyer/config.h new file mode 100755 index 0000000000..87b7dd2ac0 --- /dev/null +++ b/keyboards/sol/keymaps/brianweyer/config.h @@ -0,0 +1,27 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 + +#define SSD1306OLED + + +// place overrides here + diff --git a/keyboards/sol/keymaps/brianweyer/keymap.c b/keyboards/sol/keymaps/brianweyer/keymap.c new file mode 100755 index 0000000000..2259e246d2 --- /dev/null +++ b/keyboards/sol/keymaps/brianweyer/keymap.c @@ -0,0 +1,291 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "common/ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + FN, + ADJ, + RGBRST +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* QWERTY + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Bspc | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | [ | | ] | Y | U | I | O | P | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | A | S | D | F | G | | | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | | | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Alt | FN | LGui | RGB | Spc | Del | | Bspc | Spc | Adj | LGui | FN | Alt | Ctrl | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Spc | Ent | | Ent | Spc | + * `-------------' `-------------' + */ + [_QWERTY] = LAYOUT_kc( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + GRV, 1, 2, 3, 4, 5, MINS, EQL, 6, 7, 8, 9, 0, BSPC, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + TAB, Q, W, E, R, T, LBRC, RBRC, Y, U, I, O, P, BSLS, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + ESC, A, S, D, F, G, _______, _______, H, J, K, L, SCLN, QUOT, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + LSPO, Z, X, C, V, B, _______, _______, N, M, COMM, DOT, SLSH, RSPC, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + LCTL, LALT, FN, LGUI, RGB_MOD, SPC, DEL, BSPC, SPC, ADJ, LGUI, FN, LALT, LCTL, + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| + VOLD, VOLU, SPC, ENT, ENT, SPC, DOWN, UP + // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + ), + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | Up | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | Left | Down | Right| | | | | Play | Next | Mute | V-Up |V-Down| | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT_kc( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + F1, F2, F3, F4, F5, F6, _______, _______, F7, F8, F9, F10, F11, F12, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, LEFT, DOWN, RGHT, _______, _______, _______, MPLY, MNXT, MUTE, VOLD, VOLU, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--+--------+--------+--------+--------+--------+--------| + VOLD, VOLU, _______, _______, _______, _______, UP, DOWN + // Rotary Left |--------+--------| |--------+-----------+ Rotary Right + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Sat+ | Val+ | Hue+ |Speed+|Toggle| | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Sat- | Val- | Hue- |Speed-|Reset | | | | |QWERTY| COLE | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + //,--------+--------+--------+--------+--------+--------+--+--------+. ,--------+--+--------+--------+--------+--------+--------+--------+ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, RGB_SAI, RGB_VAI, RGB_HUI, RGB_SPI, RGB_TOG, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, RGB_SAD, RGB_VAD, RGB_HUD, RGB_SPD, RGBRST, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--------+--+--------| |--------+--+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + //|--------+--------+--------+--------+--------+--+--------+--------| |--------+--------+--+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______ \ + // Rotary Left |--------+--------| |--------+--------+ Rotary Right + ) +}; + + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + // led_test_init(); + iota_gfx_task(); // this is what updates the display continuously + #endif +} + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) +#define L_ADJ_TRI (L_ADJ|L_FN) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Laser")); + break; + case L_FN: + matrix_write_P(matrix, PSTR("Function")); + break; + case L_ADJ: + case L_ADJ_TRI: + matrix_write_P(matrix, PSTR("Adjustment")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< +Copyright 2015 Jack Humbert + +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 + + +// place overrides here + diff --git a/keyboards/sol/keymaps/danielhklein/keymap.c b/keyboards/sol/keymaps/danielhklein/keymap.c new file mode 100644 index 0000000000..883b418268 --- /dev/null +++ b/keyboards/sol/keymaps/danielhklein/keymap.c @@ -0,0 +1,354 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "common/ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + /* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | - | | = | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | [ | | ] | | | | | | Enter| + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Caps | | | | | | { | | } | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | ` | | \ | | | | | |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Left | Down | Ctrl | Alt | Gui | Bspc | FN | | ADJ | Space| Gui | Alt | Ctrl | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Bspc | FN | | ADJ | Space| + * `-------------' `-------------' + */ +#define BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +LAYOUT( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_ENT, \ + KC_CAPS, _10, _11, _12, _13, _14, KC_LCBR, KC_RCBR, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSFT, _20, _21, _22, _23, _24, KC_GRV, KC_BSLS, _25, _26, _27, _28, _29, KC_RSFT, \ + KC_LEFT, KC_DOWN, KC_LCTRL, KC_LALT, KC_LGUI, KC_BSPC, FN, ADJ, KC_SPC, KC_RGUI, KC_RALT, KC_RCTRL, KC_UP, KC_RIGHT, \ + KC_VOLU, KC_VOLD, KC_BSPC, FN, ADJ, KC_SPC, KC_VOLU, KC_VOLD \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | S | D | F | G | | | | H | J | K | L | ; | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | N | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_QWERTY] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH \ + ), + + /* Colemak + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | F | P | G | | | | J | L | U | Y | ; | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | R | S | T | D | | | | H | N | E | I | O | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | K | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `--------=----' + */ + [_COLEMAK] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ + KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH \ + ), + + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | | F1 | F2 | F3 | F4 | F5 | F6 | | F7 | F8 | F9 | F10 | F11 | F12 | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | | | | | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | | | | PLAY | MUTE | VOL- | VOL+ | LAST | NEXT | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | Gui | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT( \ + XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * |RESET | F1 | F2 | F3 | F4 | F5 | F6 | | | = | / | * | - | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | | 7 | 8 | 9 | + | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUI | VAI | SAI | | |COLEMK| | | 4 | 5 | 6 | Enter| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | HUD | VAD | SAD | | |QWERTY| | | 1 | 2 | 3 | Space| | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | |RGBRST|RGBTOG|RGBMOD|RGBSMD| | | | | | 0 | . | Bspc | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + RESET, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_PEQL, KC_PSLS, KC_PAST, KC_PMNS, XXXXXXX, XXXXXXX, \ + XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_PPLS, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_SAD, RGB_VAI, RGB_SAI, XXXXXXX, XXXXXXX, COLEMAK, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PENT, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGB_HUD, RGB_VAD, RGB_HUI, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_SPC, XXXXXXX, XXXXXXX, \ + XXXXXXX, RGBRST, RGB_TOG, RGB_MOD, RGB_RMOD, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_P0, KC_PDOT, KC_BSPC, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX \ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +// Setting ADJ layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case FN: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_FN); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_FN); + TOG_STATUS = false; + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_scan_user(void) { + led_test_init(); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_FN: + matrix_write_P(matrix, PSTR("FN")); + break; + case L_ADJ: + case L_ADJ_TRI: + matrix_write_P(matrix, PSTR("ADJ")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< +Copyright 2015 Jack Humbert + +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 + + +// place overrides here + diff --git a/keyboards/sol/keymaps/default/keymap.c b/keyboards/sol/keymaps/default/keymap.c new file mode 100644 index 0000000000..799507f66f --- /dev/null +++ b/keyboards/sol/keymaps/default/keymap.c @@ -0,0 +1,362 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "common/ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + + + +#define FN_ESC LT(_FN, KC_ESC) +#define FN_CAPS LT(_FN, KC_CAPS) + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + /* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | GESC | | | | | | - | | = | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | [ | | ] | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * |FN(CAPS)| | | | | | ( | | ) | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Shift | | | | | | { | | } | | | | | |Shift | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Alt | RGB | ADJ | Space| DEL | | Enter| Space| FN | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | Space| DEL | | Enter| Space| + * `-------------' `-------------' + */ +#define BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +LAYOUT( \ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_MINS, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_BSLS, \ + FN_CAPS, _10, _11, _12, _13, _14, KC_LPRN, KC_RPRN, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSFT, _20, _21, _22, _23, _24, KC_LCBR, KC_RCBR, _25, _26, _27, _28, _29, KC_ENT, \ + KC_LCTL, KC_LGUI, KC_LALT, RGB_TOG, ADJ, KC_SPC, KC_DEL, KC_ENT, KC_SPC, FN, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, \ + KC_VOLU, KC_VOLD, KC_SPC, KC_DEL, KC_ENT, KC_SPC, KC_VOLU, KC_VOLD \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | S | D | F | G | | | | H | J | K | L | ; | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | N | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `--------=----' + */ + [_QWERTY] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH \ + ), + + /* Colemak + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | F | P | G | | | | J | L | U | Y | ; | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | R | S | T | D | | | | H | N | E | I | O | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | K | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `--------=----' + */ + [_COLEMAK] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ + KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH \ + ), + + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | PGDN | UP | PGUP | | | | | | | PGDN | UP | PGUP | PRINT| HOME | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | LEFT | DOWN | RIGHT| | | | | | | LEFT | DOWN | RIGHT|INSERT| END | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD| | | | | | | PLAY | NEXT | MUTE | VOL- | VOL+ | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + [_FN] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, _______, _______, _______, _______, KC_PGDN, KC_UP, KC_PGUP, KC_PSCR, KC_HOME, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ + KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | | | | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | SAD | VAI | SAI | RESET| | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | HUD | VAD | HUI |RGBRST| | | | | |QWERTY|COLEMK| | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | |RGBTOG| HUI | SAI | VAI | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | |RGBMOD(| | | | | | | |RGBRMOD| HUD | SAD | VAD | + * `------+------+------+------+------+------+------| |------+------+------+------+------+------+------' + * | | | | | | + * `-------------' `-------------' + */ + + [_ADJ] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, RGB_MOD, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ + KC_VOLU, KC_VOLD, _______, _______, _______, _______, KC_VOLU, KC_VOLD \ + ) +}; + + + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +// Setting ADJ layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case FN: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(15); + #endif + } + layer_on(_FN); + } else { + #ifdef RGBLIGHT_ENABLE + //rgblight_mode(RGB_current_mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_FN); + TOG_STATUS = false; + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_scan_user(void) { + led_test_init(); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_FN: + matrix_write_P(matrix, PSTR("FN")); + break; + case L_ADJ: + case L_ADJ_TRI: + matrix_write_P(matrix, PSTR("ADJ")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< +Copyright 2015 Jack Humbert + +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 + + +// place overrides here + diff --git a/keyboards/sol/keymaps/kageurufu/keymap.c b/keyboards/sol/keymaps/kageurufu/keymap.c new file mode 100644 index 0000000000..822256d85f --- /dev/null +++ b/keyboards/sol/keymaps/kageurufu/keymap.c @@ -0,0 +1,335 @@ +#include QMK_KEYBOARD_H +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef SSD1306OLED + #include "common/ssd1306.h" +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _FN, + _ADJ +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + FN, + ADJ, + BACKLIT, + RGBRST +}; + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +#define FN_ESC LT(_FN, KC_ESC) + +// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns + /* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | | | | | | | | | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | | | | | | | | | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft( | | | | | | | | | | | | | | Sft) | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Win | Alt | FN | Space| RGB | | FN | FN | - | = | Down | PgUp | PgDn | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Space| Bksp | | Enter| Space| + * `-------------' `--------=----' + */ +#define BASE_LAYOUT( \ + _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ + _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ + _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ +) \ +LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, RGB_MOD, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_BSLS, \ + FN_ESC, _10, _11, _12, _13, _14, RGB_SAI, RGB_VAI, _15, _16, _17, _18, _19, KC_QUOT, \ + KC_LSPO, _20, _21, _22, _23, _24, RGB_SAD, RGB_VAD, _25, _26, _27, _28, _29, KC_RSPC, \ + KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, FN, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN, \ + KC_VOLD, KC_VOLU, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_VOLD, KC_VOLU \ +) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* Qwerty + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | E | R | T | | | | Y | U | I | O | P | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | S | D | F | G | | | | H | J | K | L | ; | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | V | B | | | | N | M | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `--------=----' + */ + [_QWERTY] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH \ + ), + + /* Colemak + * ,------------------------------------------------. ,------------------------------------------------. + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | Q | W | F | P | B | | | | J | L | U | Y | ; | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | | A | R | S | T | G | | | | K | N | E | I | O | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | Z | X | C | D | V | [ | | ] | M | H | , | . | / | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | | | | | | + * `-------------' `--------=----' + */ + [_COLEMAK] = BASE_LAYOUT( \ + KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ + KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, \ + KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH + ), + + + /* FN + * ,------------------------------------------------. ,------------------------------------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | | | D | H | T | N | S | / | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | [ | | ] | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | ADJ | Esc | Alt | GUI | EISU |Lower |Space | |Space |FN | KANA | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Lower |Space | |Space |FN | + * `-------------' `------------' + */ + [_FN] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, KC_PGDN, KC_UP, KC_PGUP, _______, KC_LBRC, _______, _______, KC_RBRC, KC_7, KC_UP, KC_9, KC_0, KC_HOME, \ + ADJ, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_RBRC, KC_END, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, _______, \ + _______, _______, _______, _______, ADJ, _______, ADJ, ADJ, ADJ, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ + KC_VOLD, KC_VOLU, _______, KC_DEL, _______, _______, KC_VOLD, KC_VOLU \ + ), + + /* ADJ + * ,------------------------------------------------. ,------------------------------------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | | | D | H | T | N | S | / | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | [ | | ] | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |ADJ| Esc | Alt | GUI | EISU |Lower |Space | |Space |FN | KANA | Left | Down | Up |Right | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * |Lower |Space | |Space |FN | + * `-------------' `------------' + */ + + [_ADJ] = LAYOUT( \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ + KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_VOLD, KC_VOLU \ + ) +}; + + +// define variables for reactive RGB +bool TOG_STATUS = false; +int RGB_current_mode; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); + + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case FN: + if (record->event.pressed) { + layer_on(_FN); + } else { + layer_off(_FN); + } + return false; + break; + case ADJ: + if (record->event.pressed) { + layer_on(_ADJ); + } else { + layer_off(_ADJ); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +void matrix_scan_user(void) { + #ifdef SSD1306OLED + led_test_init(); + iota_gfx_task(); // this is what updates the display continuously + #endif +} + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// hook point for 'led_test' keymap +// 'default' keymap's led_test_init() is empty function, do nothing +// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); +__attribute__ ((weak)) +void led_test_init(void) {} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +//assign the right code to your layers for OLED display +#define L_BASE 0 +#define L_FN (1<<_FN) +#define L_ADJ (1<<_ADJ) +#define L_ADJ_TRI (L_ADJ|L_FN) + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + + + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + char buf[40]; + snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); + matrix_write_P(matrix, PSTR("\nLayer: ")); + switch (layer_state) { + case L_BASE: + matrix_write_P(matrix, PSTR("Default")); + break; + case L_FN: + matrix_write_P(matrix, PSTR("FN")); + break; + case L_ADJ: + case L_ADJ_TRI: + matrix_write_P(matrix, PSTR("ADJ")); + break; + default: + matrix_write(matrix, buf); + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef REV1_CONFIG_H +#define REV1_CONFIG_H + + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x3060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER RGBKB +#define PRODUCT Sol +#define DESCRIPTION "An RGB, split, ortho-esque keyboard" + + +#define PREVENT_STUCK_MODIFIERS +#define TAPPING_FORCE_HOLD +#define TAPPING_TERM 150 + +#define USE_I2C +#define USE_SERIAL +#define USE_SERIAL_PD3 + +/* Select hand configuration */ +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + +// Helix keyboard OLED support +// see ./rules.mk: OLED_ENABLE=yes or no +#ifdef OLED_ENABLE + #define SSD1306OLED +#endif + +/* Select rows configuration */ +// Rows are 4 or 5 +// #define HELIX_ROWS 5 see ./rules.mk + +/* key matrix size */ +// Rows are doubled-up +#define MATRIX_ROWS 12 +#define MATRIX_ROW_PINS { C6, B6, B5, B4, D7, E6} + +// wiring of each half +#define MATRIX_COLS 7 +#define MATRIX_COL_PINS { F0, F1, F4, F5, F6, F7, C7 } +// #define MATRIX_COL_PINS { B2, B3, B1, F7, F6, F5, F4 } //uncomment this line and comment line above if you need to reverse left-to-right key order + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +// #define BACKLIGHT_LEVELS 3 + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* ws2812 RGB LED */ +#define RGB_DI_PIN B3 +#define RGBLIGHT_TIMER +//#define RGBLED_NUM 12 // Number of LEDs. see ./keymaps/default/config.h +#define ws2812_PORTREG PORTD +#define ws2812_DDRREG DDRD + +#define DRIVER_COUNT 2 +#define DRIVER_LED_TOTAL 70 +// #define RGB_MATRIX_KEYPRESSES +#define BACKLIGHT_PIN B7 +#define BACKLIGHT_LEVELS 5 + +#ifdef LED_MIRRORED + #define RGBLED_NUM 35 +#else + #define RGBLED_NUM 70 +#endif + +#define RGBLIGHT_RAINBOW_SWIRL_RANGE 1950 + +#ifdef IOS_DEVICE_ENABLE + #define RGBLIGHT_LIMIT_VAL 40 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 40 +#elif RGBLIGHT_FULL_POWER + #define RGBLIGHT_LIMIT_VAL 255 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 255 +#else + #define RGBLIGHT_LIMIT_VAL 120 + #define RGB_MATRIX_MAXIMUM_BRIGHTNESS 120 +#endif + +#define RGBLIGHT_VAL_STEP (RGBLIGHT_LIMIT_VAL / 10) +#define RGBLIGHT_HUE_STEP 10 +#define RGBLIGHT_SAT_STEP 17 + +#define RGBLIGHT_ANIMATIONS + +#if defined(RGBLIGHT_ENABLE) && !defined(IOS_DEVICE_ENABLE) +// USB_MAX_POWER_CONSUMPTION value for Helix keyboard +// 120 RGBoff, OLEDoff +// 120 OLED +// 330 RGB 6 +// 300 RGB 32 +// 310 OLED & RGB 32 + #define USB_MAX_POWER_CONSUMPTION 500 +#else + // fix iPhone and iPad power adapter issue + // iOS device need lessthan 100 + #define USB_MAX_POWER_CONSUMPTION 100 +#endif + +/* + * 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 + + +#endif diff --git a/keyboards/sol/rev1/matrix.c b/keyboards/sol/rev1/matrix.c new file mode 100644 index 0000000000..804d8b9809 --- /dev/null +++ b/keyboards/sol/rev1/matrix.c @@ -0,0 +1,304 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* + * scan matrix + */ +#include +#include +#include +#include +#include +#include +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "split_util.h" +#include + +#include "serial.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +#ifdef ENCODER_ENABLE_CUSTOM + #include "common/knob_v2.h" +#endif + +#define ERROR_DISCONNECT_COUNT 5 + +static uint8_t debouncing = DEBOUNCE; +static const int ROWS_PER_HAND = MATRIX_ROWS/2; +static uint8_t error_count = 0; +uint8_t is_master = 0 ; + +static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +static matrix_row_t read_cols(void); +static void init_cols(void); +static void unselect_rows(void); +static void select_row(uint8_t row); +static uint8_t matrix_master_scan(void); + + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + +void matrix_init(void) +{ + debug_enable = true; + debug_matrix = true; + debug_mouse = true; + // initialize row and col + unselect_rows(); + init_cols(); + + TX_RX_LED_INIT; + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) { + matrix[i] = 0; + matrix_debouncing[i] = 0; + } + + is_master = has_usb(); + + #ifdef ENCODER_ENABLE_CUSTOM + knob_init(); //FOR ENCODER + #endif + matrix_init_quantum(); +} + +uint8_t _matrix_scan(void) +{ + // Right hand is stored after the left in the matirx so, we need to offset it + int offset = isLeftHand ? 0 : (ROWS_PER_HAND); + + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + select_row(i); + _delay_us(30); // without this wait read unstable value. + matrix_row_t cols = read_cols(); + if (matrix_debouncing[i+offset] != cols) { + matrix_debouncing[i+offset] = cols; + debouncing = DEBOUNCE; + } + unselect_rows(); + } + + if (debouncing) { + if (--debouncing) { + _delay_ms(1); + } else { + for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { + matrix[i+offset] = matrix_debouncing[i+offset]; + } + } + } + + #ifdef ENCODER_ENABLE_CUSTOM + knob_report_t knob_report = knob_report_read(); + + knob_report_reset(); + + matrix[5 + offset] &= 0b11111100; + if (knob_report.phase) { // I check for phase to avoid handling the rotation twice (on 90 and 270 degrees). + if (knob_report.dir > 0) { + matrix[5 + offset] |= 0b00000001; + } else if (knob_report.dir < 0) { + matrix[5 + offset] |= 0b00000010; + } + } + #endif + + return 1; +} + +int serial_transaction(void) { + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + int ret=serial_update_buffers(); + if (ret ) { + return 1; + } + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = serial_slave_buffer[i]; + } + return 0; +} + +uint8_t matrix_scan(void) +{ + if (is_master) { + matrix_master_scan(); + }else{ + matrix_slave_scan(); + + int offset = (isLeftHand) ? ROWS_PER_HAND : 0; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[offset+i] = serial_master_buffer[i]; + } + + matrix_scan_quantum(); + } + return 1; +} + + +uint8_t matrix_master_scan(void) { + + int ret = _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_master_buffer[i] = matrix[offset+i]; + } + + if( serial_transaction() ) { + // turn on the indicator led when halves are disconnected + TXLED1; + + error_count++; + + if (error_count > ERROR_DISCONNECT_COUNT) { + // reset other half if disconnected + int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; + for (int i = 0; i < ROWS_PER_HAND; ++i) { + matrix[slaveOffset+i] = 0; + } + } + } else { + // turn off the indicator led on no error + TXLED0; + error_count = 0; + } + matrix_scan_quantum(); + return ret; +} + +void matrix_slave_scan(void) { + _matrix_scan(); + + int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; + + for (int i = 0; i < ROWS_PER_HAND; ++i) { + serial_slave_buffer[i] = matrix[offset+i]; + } +} + +bool matrix_is_modified(void) +{ + if (debouncing) return false; + return true; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(col_pins[x] & 0xF); + _SFR_IO8((col_pins[x] >> 4) + 2) |= _BV(col_pins[x] & 0xF); + } +} + +static matrix_row_t read_cols(void) +{ + matrix_row_t result = 0; + for(int x = 0; x < MATRIX_COLS; x++) { + result |= (_SFR_IO8(col_pins[x] >> 4) & _BV(col_pins[x] & 0xF)) ? 0 : (1 << x); + } + return result; +} + +static void unselect_rows(void) +{ + for(int x = 0; x < ROWS_PER_HAND; x++) { + _SFR_IO8((row_pins[x] >> 4) + 1) &= ~_BV(row_pins[x] & 0xF); + _SFR_IO8((row_pins[x] >> 4) + 2) |= _BV(row_pins[x] & 0xF); + } +} + +static void select_row(uint8_t row) +{ + _SFR_IO8((row_pins[row] >> 4) + 1) |= _BV(row_pins[row] & 0xF); + _SFR_IO8((row_pins[row] >> 4) + 2) &= ~_BV(row_pins[row] & 0xF); +} diff --git a/keyboards/sol/rev1/rev1.c b/keyboards/sol/rev1/rev1.c new file mode 100644 index 0000000000..01ab577d45 --- /dev/null +++ b/keyboards/sol/rev1/rev1.c @@ -0,0 +1,15 @@ +#include "sol.h" + + +#ifdef SSD1306OLED +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + //led_set_user(usb_led); +} +#endif + +void matrix_init_kb(void) { + + matrix_init_user(); +}; + diff --git a/keyboards/sol/rev1/rev1.h b/keyboards/sol/rev1/rev1.h new file mode 100644 index 0000000000..27b5ac8966 --- /dev/null +++ b/keyboards/sol/rev1/rev1.h @@ -0,0 +1,70 @@ +#ifndef REV1_H +#define REV1_H + +#include "sol.h" + +//void promicro_bootloader_jmp(bool program); +#include "quantum.h" + +#ifdef RGBLIGHT_ENABLE +//rgb led driver +#include "ws2812.h" +#endif + +#ifdef USE_I2C +#include +#ifdef __AVR__ + #include + #include +#endif +#endif + +//void promicro_bootloader_jmp(bool program); +// LEL/LER/REL/RER are +// LeftEncoderLeft, LeftEncoderRight, RightEncoderLeft, and RightEncoderRight + +#define LAYOUT( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45, \ + LEL, LER, L55, L56, R56, R50, REL, RER \ + ) \ + { \ + { L00, L01, L02, L03, L04, L05, L06 }, \ + { L10, L11, L12, L13, L14, L15, L16 }, \ + { L20, L21, L22, L23, L24, L25, L26 }, \ + { L30, L31, L32, L33, L34, L35, L36 }, \ + { L40, L41, L42, L43, L44, L45, L46 }, \ + { LEL, LER, KC_NO, KC_NO, KC_NO, L55, L56 }, \ + { R05, R04, R03, R02, R01, R00, R06 }, \ + { R15, R14, R13, R12, R11, R10, R16 }, \ + { R25, R24, R23, R22, R21, R20, R26 }, \ + { R35, R34, R33, R32, R31, R30, R36 }, \ + { R45, R44, R43, R42, R41, R40, R46 }, \ + { REL, RER, KC_NO, KC_NO, KC_NO, R50, R56 } \ + } + +#define KC________ KC_TRNS +#define KC_RGB_MOD RGB_MOD +#define KC_FN FN +#define KC_ADJ ADJ +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, L06, R06, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, L16, R16, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, L26, R26, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35, \ + L40, L41, L42, L43, L44, L45, L46, R46, R40, R41, R42, R43, R44, R45, \ + LEL, LER, L55, L56, R56, R50, REL, RER \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##L06, KC_##R06, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##L16, KC_##R16, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##L26, KC_##R26, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35, \ + KC_##L40, KC_##L41, KC_##L42, KC_##L43, KC_##L44, KC_##L45, KC_##L46, KC_##R46, KC_##R40, KC_##R41, KC_##R42, KC_##R43, KC_##R44, KC_##R45, \ + KC_##LEL, KC_##LER, KC_##L55, KC_##L56, KC_##R56, KC_##R50, KC_##REL, KC_##RER \ + ) + +#endif diff --git a/keyboards/sol/rev1/rules.mk b/keyboards/sol/rev1/rules.mk new file mode 100644 index 0000000000..99f4dd896c --- /dev/null +++ b/keyboards/sol/rev1/rules.mk @@ -0,0 +1,2 @@ +SRC += rev1/matrix.c \ + rev1/split_util.c diff --git a/keyboards/sol/rev1/split_util.c b/keyboards/sol/rev1/split_util.c new file mode 100644 index 0000000000..c645bbdfef --- /dev/null +++ b/keyboards/sol/rev1/split_util.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include +#include +#include "split_util.h" +#include "matrix.h" +#include "keyboard.h" +#include "serial.h" + +volatile bool isLeftHand = true; + +static void setup_handedness(void) { + #ifdef EE_HANDS + isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); + #else + #if defined(MASTER_RIGHT) + isLeftHand = !has_usb(); + #else + isLeftHand = has_usb(); + #endif + #endif +} + +static void keyboard_master_setup(void) { + serial_master_init(); +} + +static void keyboard_slave_setup(void) { + serial_slave_init(); +} + +bool has_usb(void) { + USBCON |= (1 << OTGPADE); //enables VBUS pad + _delay_us(5); + return (USBSTA & (1< +#include "eeconfig.h" + +extern volatile bool isLeftHand; + +// slave version of matix scan, defined in matrix.c +void matrix_slave_scan(void); + +void split_keyboard_setup(void); +bool has_usb(void); + +void matrix_master_OLED_init (void); + +#endif diff --git a/keyboards/sol/rules.mk b/keyboards/sol/rules.mk new file mode 100644 index 0000000000..f53e5b21fc --- /dev/null +++ b/keyboards/sol/rules.mk @@ -0,0 +1,71 @@ +SRC += i2c.c \ + serial.c \ + common/ssd1306.c + +# MCU name +#MCU = at90usb1287 +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) + +# 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 + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = no # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +CUSTOM_MATRIX = yes + +DEFAULT_FOLDER = sol/rev1 diff --git a/keyboards/sol/serial.c b/keyboards/sol/serial.c new file mode 100644 index 0000000000..169b4b176c --- /dev/null +++ b/keyboards/sol/serial.c @@ -0,0 +1,288 @@ +/* + * WARNING: be careful changing this code, it is very timing dependent + */ + +#ifndef F_CPU +#define F_CPU 16000000 +#endif + +#include +#include +#include +#include +#include "serial.h" + +#ifdef USE_SERIAL + +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// Serial pulse period in microseconds. +#define SELECT_SERIAL_SPEED 1 +#if SELECT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #define READ_WRITE_START_ADJUST 23 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#elif SELECT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 50 // micro sec + #define READ_WRITE_START_ADJUST 25 // cycles + #define READ_WRITE_WIDTH_ADJUST 10 // cycles +#else +#error Illegal Serial Speed +#endif + + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) + +#define SLAVE_INT_WIDTH 1 +#define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY + +uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; +uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; + +#define SLAVE_DATA_CORRUPT (1<<0) +volatile uint8_t status = 0; + +inline static +void serial_delay(void) { + _delay_us(SERIAL_DELAY); +} + +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static +void serial_output(void) { + SERIAL_PIN_DDR |= SERIAL_PIN_MASK; +} + +// make the serial pin an input with pull-up resistor +inline static +void serial_input_with_pullup(void) { + SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +inline static +uint8_t serial_read_pin(void) { + return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); +} + +inline static +void serial_low(void) { + SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; +} + +inline static +void serial_high(void) { + SERIAL_PIN_PORT |= SERIAL_PIN_MASK; +} + +void serial_master_init(void) { + serial_output(); + serial_high(); +} + +void serial_slave_init(void) { + serial_input_with_pullup(); + + +// Enable INT3 +EIMSK |= _BV(INT3); +// Trigger on falling edge of INT3 +EICRA &= ~(_BV(ISC30) | _BV(ISC31)); + +} + +// Used by the sender to synchronize timing with the reciver. +static +void sync_recv(void) { + for (int i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the slave disconnects because the + // serial line will float to high if the slave does disconnect. + while (!serial_read_pin()); +} + +// Used by the reciver to send a synchronization signal to the sender. +static +void sync_send(void) { + serial_low(); + serial_delay(); + serial_high(); +} + +// Reads a byte from the serial line +static +uint8_t serial_read_byte(void) { + uint8_t byte = 0; + _delay_sub_us(READ_WRITE_START_ADJUST); + for ( uint8_t i = 0; i < 8; ++i) { + serial_delay_half1(); // read the middle of pulses + byte = (byte << 1) | serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + } + return byte; +} + +// Sends a byte with MSB ordering +static +void serial_write_byte(uint8_t data) { + uint8_t b = 1<<7; + while( b ) { + if(data & b) { + serial_high(); + } else { + serial_low(); + } + b >>= 1; + serial_delay(); + } + serial_low(); // sync_send() / senc_recv() need raise edge +} + +// interrupt handle to be used by the slave device +ISR(SERIAL_PIN_INTERRUPT) { + serial_output(); + + // slave send phase + uint8_t checksum = 0; + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_slave_buffer[i]); + checksum += serial_slave_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // slave switch to input + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 + + // slave recive phase + uint8_t checksum_computed = 0; + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_master_buffer[i] = serial_read_byte(); + checksum_computed += serial_master_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if ( checksum_computed != checksum_received ) { + status |= SLAVE_DATA_CORRUPT; + } else { + status &= ~SLAVE_DATA_CORRUPT; + } + + sync_recv(); //weit master output to high +} + +inline +bool serial_slave_DATA_CORRUPT(void) { + return status & SLAVE_DATA_CORRUPT; +} + +// Copies the serial_slave_buffer to the master and sends the +// serial_master_buffer to the slave. +// +// Returns: +// 0 => no error +// 1 => slave did not respond +// 2 => checksum error +int serial_update_buffers(void) { + // this code is very time dependent, so we need to disable interrupts + cli(); + + // signal to the slave that we want to start a transaction + serial_output(); + serial_low(); + _delay_us(SLAVE_INT_WIDTH); + + // wait for the slaves response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); + + // check if the slave is present + if (serial_read_pin()) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + sei(); + return 1; + } + + // master recive phase + // if the slave is present syncronize with it + + uint8_t checksum_computed = 0; + // receive data from the slave + for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { + sync_recv(); + serial_slave_buffer[i] = serial_read_byte(); + checksum_computed += serial_slave_buffer[i]; + } + sync_recv(); + uint8_t checksum_received = serial_read_byte(); + + if (checksum_computed != checksum_received) { + serial_output(); + serial_high(); + sei(); + return 2; + } + + // master switch to output + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); // 3 + serial_delay_half1(); //4 + + // master send phase + uint8_t checksum = 0; + + for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { + sync_send(); + serial_write_byte(serial_master_buffer[i]); + checksum += serial_master_buffer[i]; + } + sync_send(); + serial_write_byte(checksum); + + // always, release the line when not in use + sync_send(); + + sei(); + return 0; +} + +#endif diff --git a/keyboards/sol/serial.h b/keyboards/sol/serial.h new file mode 100644 index 0000000000..cd6bcc76bc --- /dev/null +++ b/keyboards/sol/serial.h @@ -0,0 +1,26 @@ +#ifndef MY_SERIAL_H +#define MY_SERIAL_H + +#include + +/* TODO: some defines for interrupt setup */ +#define SERIAL_PIN_DDR DDRD +#define SERIAL_PIN_PORT PORTD +#define SERIAL_PIN_INPUT PIND +#define SERIAL_PIN_MASK _BV(PD3) //SErial pin goes here, D0-D3 +#define SERIAL_PIN_INTERRUPT INT3_vect //"INT#" of your serial pin + + +#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +#define SERIAL_MASTER_BUFFER_LENGTH MATRIX_ROWS/2 + +// Buffers for master - slave communication +extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; +extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; + +void serial_master_init(void); +void serial_slave_init(void); +int serial_update_buffers(void); +bool serial_slave_data_corrupt(void); + +#endif diff --git a/keyboards/sol/sol.c b/keyboards/sol/sol.c new file mode 100644 index 0000000000..5945cc60a4 --- /dev/null +++ b/keyboards/sol/sol.c @@ -0,0 +1 @@ +#include "sol.h" diff --git a/keyboards/sol/sol.h b/keyboards/sol/sol.h new file mode 100644 index 0000000000..8f451ce56b --- /dev/null +++ b/keyboards/sol/sol.h @@ -0,0 +1,7 @@ +#ifndef SOL_H +#define SOL_H + +#include "rev1.h" +#include "quantum.h" + +#endif -- cgit v1.2.3 From 538874f90f5ae69b241f80baa639fb6dbc4cfa80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismael=20Venegas=20Castell=C3=B3?= Date: Wed, 5 Dec 2018 10:12:35 -0600 Subject: Keymap: Hacker Dvorak (#4514) * Hacker Dvorak Programmer Dvorak based layout for the Ergodox EZ. * Address drashna comments. * Fix RGB and drop OSL for MO. * Add gulp file to automate development. * Fix gulpfile. * Caps, num and scroll lock indicators. * Fix scroll lock. --- .../ergodox_ez/keymaps/hacker_dvorak/.gitignore | 2 + .../ergodox_ez/keymaps/hacker_dvorak/config.h | 82 +++ .../keymaps/hacker_dvorak/default.png.md | 1 + .../keymaps/hacker_dvorak/default_highres.png.md | 1 + .../ergodox_ez/keymaps/hacker_dvorak/gulpfile.js | 13 + .../ergodox_ez/keymaps/hacker_dvorak/keymap.c | 781 +++++++++++++++++++++ .../ergodox_ez/keymaps/hacker_dvorak/package.json | 15 + .../ergodox_ez/keymaps/hacker_dvorak/readme.md | 62 ++ .../ergodox_ez/keymaps/hacker_dvorak/rules.mk | 35 + quantum/keymap_extras/keymap_plover_dvorak.h | 47 ++ 10 files changed, 1039 insertions(+) create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk create mode 100644 quantum/keymap_extras/keymap_plover_dvorak.h diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore b/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore new file mode 100644 index 0000000000..504afef81f --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h new file mode 100644 index 0000000000..c6b86004c5 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h @@ -0,0 +1,82 @@ +/* + Set any config.h overrides for your specific keymap here. + See config.h options at https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ +#pragma once + + +/* Keyboard Settings */ +#undef TAPPING_TERM +#define TAPPING_TERM 150 + +#undef DEBOUNCE +#define DEBOUNCE 10 + +#undef IGNORE_MOD_TAP_INTERRUPT +#define IGNORE_MOD_TAP_INTERRUPT + +#undef FORCE_NKRO +#define FORCE_NKRO + +/* This isn't defined by default, so there is no need to undefine it first. */ +#define LEADER_TIMEOUT 500 +#define PERMISSIVE_HOLD +#define QMK_KEYS_PER_SCAN 4 + + +// RGB Lights +#undef RGBLIGHT_HUE_STEP +#define RGBLIGHT_HUE_STEP 24 + +#undef RGBLIGHT_SAT_STEP +#define RGBLIGHT_SAT_STEP 24 + +#undef RGBLIGHT_VAL_STEP +#define RGBLIGHT_VAL_STEP 24 + +#undef RGBLIGHT_BRI_STEP +#define RGBLIGHT_BRI_STEP 24 + +#undef RGBLIGHT_LIMIT_VAL +#define RGBLIGHT_LIMIT_VAL 255 + +/* This isn't defined by default, so there is no need to undefine it first. */ +#define RGBLIGHT_SLEEP + + +// Mouse +#undef MOUSEKEY_INTERVAL +#define MOUSEKEY_INTERVAL 10 + +#undef MOUSEKEY_DELAY +#define MOUSEKEY_DELAY 15 + +#undef MOUSEKEY_MAX_SPEED +#define MOUSEKEY_MAX_SPEED 15 + +#undef MOUSEKEY_TIME_TO_MAX +#define MOUSEKEY_TIME_TO_MAX 150 + +#undef MOUSEKEY_WHEEL_MAX_SPEED +#define MOUSEKEY_WHEEL_MAX_SPEED 15 + +#undef MOUSEKEY_WHEEL_TIME_TO_MAX +#define MOUSEKEY_WHEEL_TIME_TO_MAX 150 + + +/* This is defined only if CONSOLE_ENABLE is set to "yes" */ +// #undef NO_DEBUG +// #define NO_DEBUG + +// #undef NO_PRINT +// #define NO_PRINT + +/* For COMBO only*/ +// #define COMBO_COUNT 1 +// #define COMBO_TERM 200 + +/* For tap toggle */ +// #define TAPPING_TOGGLE 2 +// #define ONESHOT_TAP_TOGGLE 2 +// #define ONESHOT_TIMEOUT 300 + diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md new file mode 100644 index 0000000000..744e7d172a --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md @@ -0,0 +1 @@ +https://i.imgur.com/fKX0Zbs.png diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md new file mode 100644 index 0000000000..074e0634d2 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md @@ -0,0 +1 @@ +https://i.imgur.com/giAc3M9.jpg diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js new file mode 100644 index 0000000000..338b0c6ba2 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js @@ -0,0 +1,13 @@ +let gulp = require('gulp'); +let run = require('gulp-run-command').default; + + +gulp.task('clean', run('rm -rf ../../../../.build')); + +gulp.task('build', ['clean'], run('make -C ../../../../ ergodox_ez:hacker_dvorak', { + ignoreErrors: true +})); + +gulp.task('watch', ['build'], () => { + gulp.watch(['keymap.c', 'config.h', 'rules.mk'], ['build']); +}); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c new file mode 100644 index 0000000000..c42b551084 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c @@ -0,0 +1,781 @@ +#include QMK_KEYBOARD_H +#include "keymap_dvorak.h" +#include "sendstring_dvorak.h" +#include "keymap_plover.h" +#include "keymap_plover_dvorak.h" + + +#define SCTL(kc) LSFT(LCTL(kc)) + +// Layers +enum layers { + DVORAK_US = 0, + PLOVER_US, + GAMING_US, + ARROWS_US, + MOUSE_US, + NUMPAD_US, + LAYERS_US, + DVORAK_DV, + PLOVER_DV, + GAMING_DV, + ARROWS_DV, + MOUSE_DV, + NUMPAD_DV, + LAYERS_DV, + MEDIA_FN, + HYPER_FN, + MEH_FN, + MEH_FN_PLUS, + FIRMWARE +}; + +int CAPS_LOCK = 0; +int NUM_LOCK = 0; +int SCROLL_LOCK = 0; + +enum tap_dances { + TD_ESC_CAPS = 0 +}; + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CLCK) +}; + + +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // can always be here + RGB_GREEN // to set default RGB layer as green once +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + * ,--------------------------------------------------. ,--------------------------------------------------. + * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | | 38 | 39 | 40 | 41 | 42 | 43 | 44 | + * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| + * | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 45 | 46 | 47 | 48 | 49 | 50 | 51 | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | 14 | 15 | 16 | 17 | 18 | 19 |------| |------| 52 | 53 | 54 | 55 | 56 | 57 | + * |--------+------+------+------+------+------| 26 | | 58 |------+------+------+------+------+--------| + * | 20 | 21 | 22 | 23 | 24 | 25 | | | | 59 | 60 | 61 | 62 | 63 | 64 | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * | 27 | 28 | 29 | 30 | 31 | | 65 | 66 | 67 | 68 | 69 | + * `----------------------------------' `----------------------------------' + * ,-------------. ,-------------. + * | 32 | 33 | | 70 | 71 | + * ,------+------+------| |------+------+------. + * | | | 34 | | 72 | | | + * | 35 | 36 |------| |------| 74 | 75 | + * | | | 37 | | 73 | | | + * `--------------------' `--------------------' + */ + [DVORAK_US] = LAYOUT_ergodox( + // left hand + KC_ESC, KC_LABK, KC_LCBR, KC_LBRC, KC_LPRN, KC_EXLM, KC_AMPR, + KC_TAB, KC_QUOT, SCMD_T(KC_COMM), MEH_T(KC_DOT), ALL_T(KC_P), KC_Y, KC_AT, + KC_EQL, CTL_T(KC_A), SFT_T(KC_O), LT(NUMPAD_US, KC_E), LT(ARROWS_US, KC_U), KC_I, + KC_BSLS, ALGR_T(KC_SCLN), ALT_T(KC_Q), LT(MEDIA_FN, KC_J), GUI_T(KC_K), KC_X, KC_PERC, + MO(MEH_FN), TG(LAYERS_US), KC_CIRC, KC_PLUS, KC_COLN, + + // left thumb + KC_LEFT, KC_RGHT, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + + // right hand + KC_PIPE, KC_QUES, KC_RPRN, KC_RBRC, KC_RCBR, KC_RABK, KC_ASTR, + KC_HASH, KC_F, ALL_T(KC_G), MEH_T(KC_C), SCMD_T(KC_R), KC_L, KC_SLSH, + KC_D, LT(MOUSE_US, KC_H), LT(HYPER_FN, KC_T), SFT_T(KC_N), CTL_T(KC_S), KC_MINS, + KC_DLR, KC_B, GUI_T(KC_M), LT(MEDIA_FN, KC_W), ALT_T(KC_V), ALGR_T(KC_Z), KC_GRV, + KC_DQUO, KC_UNDS, KC_TILD, TG(DVORAK_DV), MO(MEH_FN_PLUS), + + // right thumb + KC_UP, KC_DOWN, + KC_PGUP, + KC_PGDN, KC_DEL, KC_ENT + ), + + [PLOVER_US] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), + KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PV_NUM, + KC_TAB, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, + KC_CLCK, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, + MO(MEH_FN), TG(LAYERS_US), PV_NUM, PV_NUM, PV_NUM, + + // left thumb + KC_SPACE, KC_BSPACE, + KC_HOME, + PV_A, PV_O, KC_END, + + // right hand + KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, + PV_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, MO(MEH_FN_PLUS), + + // right thumb + KC_DELETE, KC_ENTER, + KC_PGUP, + KC_PGDOWN, PV_E, PV_U + ), + + [GAMING_US] = LAYOUT_ergodox( + // left hand + KC_ESCAPE, GUI_T(KC_MINS), KC_I, KC_O, KC_P, ALGR_T(KC_EQL), KC_T, + KC_TAB, KC_LALT, KC_Q, KC_W, KC_E, ALL_T(KC_R), KC_G, + LT(MOUSE_US, KC_GRV), KC_LCTRL, KC_A, KC_S, KC_D, MEH_T(KC_F), + KC_BSLS, KC_LSHIFT, KC_Z, KC_X, KC_C, SCMD_T(KC_V), KC_M, + MO(MEH_FN), TG(LAYERS_US), KC_COMM, KC_DOT, KC_LBRC, + + // left thumb + MO(MEDIA_FN), KC_NLCK, + KC_SCLN, + KC_SPACE, KC_ENTER, KC_BSPACE, + + // right hand + KC_QUOT, KC_Y, KC_K, KC_U, KC_KP_7, KC_KP_8, KC_KP_9, + KC_MS_WH_UP, KC_H, KC_J, KC_L, KC_KP_4, KC_KP_2, KC_KP_6, + KC_B, KC_MS_UP, KC_N, KC_KP_1, KC_KP_5, KC_KP_3, + KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, KC_SLASH, + KC_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, MO(MEH_FN_PLUS), + + // right thumb + KC_MS_BTN5, MO(HYPER_FN), + KC_MS_BTN4, + KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 + ), + + [ARROWS_US] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + LGUI(KC_X), XXXXXXX, LCTL(KC_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, + LGUI(KC_C), XXXXXXX, LCTL(KC_C), KC_UP, SCTL(KC_C), LCTL(KC_Z), LGUI(KC_Z), + KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, + LGUI(KC_V), XXXXXXX, LCTL(KC_V), KC_MS_WH_DOWN, SCTL(KC_V), LCTL(KC_Y), SGUI(KC_Z), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [MOUSE_US] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(KC_X), XXXXXXX, LGUI(KC_X), + LGUI(KC_Z), LCTL(KC_Z), SCTL(KC_C), KC_MS_UP, LCTL(KC_C), KC_MS_BTN4, LGUI(KC_C), + KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, + LGUI(KC_Z), LCTL(KC_Y), SCTL(KC_V), KC_MS_WH_DOWN, LCTL(KC_V), KC_MS_BTN5, LGUI(KC_V), + KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, + XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, + XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MS_ACCEL0 + ), + + [NUMPAD_US] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, + _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + KC_X, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_O, KC_I, KC_1, KC_2, KC_3, KC_SLSH, KC_PERC, + KC_M, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, + KC_L, KC_J, KC_7, KC_8, KC_9, KC_ASTR, KC_CIRC, + KC_DOT, KC_0, KC_COMM, KC_UNDS, KC_BSLS, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [LAYERS_US] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, TO(DVORAK_US), TO(PLOVER_US), TO(GAMING_US), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [DVORAK_DV] = LAYOUT_ergodox( + // left hand + KC_ESC, DV_LABK, DV_LCBR, DV_LBRC, DV_LPRN, DV_EXLM, DV_AMPR, + KC_TAB, DV_QUOT, SCMD_T(DV_COMM), MEH_T(DV_DOT), ALL_T(DV_P), DV_Y, DV_AT, + DV_EQL, CTL_T(DV_A), SFT_T(DV_O), LT(NUMPAD_DV, DV_E), LT(ARROWS_DV, DV_U), DV_I, + DV_BSLS, ALGR_T(DV_SCLN), ALT_T(DV_Q), LT(MEDIA_FN, DV_J), GUI_T(DV_K), DV_X, DV_PERC, + MO(MEH_FN), TG(LAYERS_DV), DV_CIRC, DV_PLUS, DV_COLN, + + // left thumb + KC_LEFT, KC_RGHT, + KC_HOME, + KC_SPC, KC_BSPC, KC_END, + + // right hand + DV_PIPE, DV_QUES, DV_RPRN, DV_RBRC, DV_RCBR, DV_RABK, DV_ASTR, + DV_HASH, DV_F, ALL_T(DV_G), MEH_T(DV_C), SCMD_T(DV_R), DV_L, DV_SLSH, + DV_D, LT(MOUSE_DV, DV_H), LT(HYPER_FN, DV_T), SFT_T(DV_N), CTL_T(DV_S), DV_MINS, + DV_DLR, DV_B, GUI_T(DV_M), LT(MEDIA_FN, DV_W), ALT_T(DV_V), ALGR_T(DV_Z), DV_GRV, + DV_DQUO, DV_UNDS, DV_TILD, _______, MO(MEH_FN_PLUS), + + // right thumb + KC_UP, KC_DOWN, + KC_PGUP, + KC_PGDN, KC_DEL, KC_ENT + ), + + [PLOVER_DV] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), + KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PD_NUM, + KC_TAB, PD_LS, PD_LT, PD_LP, PD_LH, PD_STAR, + KC_CLCK, PD_LS, PD_LK, PD_LW, PD_LR, PD_STAR, PD_STAR, + MO(MEH_FN), TG(LAYERS_DV), PD_NUM, PD_NUM, PD_NUM, + + // left thumb + KC_SPACE, KC_BSPACE, + KC_HOME, + PD_A, PD_O, KC_END, + + // right hand + KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, + PD_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, + PD_STAR, PD_RF, PD_RP, PD_RL, PD_RT, PD_RD, + PD_STAR, PD_STAR, PD_RR, PD_RB, PD_RG, PD_RS, PD_RZ, + PD_NUM, PD_NUM, PD_NUM, PD_NUM, MO(MEH_FN_PLUS), + + // right thumb + KC_DELETE, KC_ENTER, + KC_PGUP, + KC_PGDOWN, PD_E, PD_U + ), + + [GAMING_DV] = LAYOUT_ergodox( + // left hand + KC_ESCAPE, GUI_T(DV_MINS), DV_I, DV_O, DV_P, ALGR_T(DV_EQL), DV_T, + KC_TAB, KC_LALT, DV_Q, DV_W, DV_E, ALL_T(DV_R), DV_G, + LT(MOUSE_DV, DV_GRV), KC_LCTRL, DV_A, DV_S, DV_D, MEH_T(DV_F), + DV_BSLS, KC_LSHIFT, DV_Z, DV_X, DV_C, SCMD_T(DV_V), DV_M, + MO(MEH_FN), TG(LAYERS_DV), DV_COMM, DV_DOT, DV_LBRC, + + // left thumb + MO(MEDIA_FN), KC_NLCK, + DV_SCLN, + KC_SPACE, KC_ENTER, KC_BSPACE, + + // right hand + DV_QUOT, DV_Y, DV_K, DV_U, KC_KP_7, KC_KP_8, KC_KP_9, + KC_MS_WH_UP, DV_H, DV_J, DV_L, KC_KP_4, KC_KP_2, KC_KP_6, + DV_B, KC_MS_UP, DV_N, KC_KP_1, KC_KP_5, KC_KP_3, + KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, DV_SLSH, + DV_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, MO(MEH_FN_PLUS), + + // right thumb + KC_MS_BTN5, MO(HYPER_FN), + KC_MS_BTN4, + KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 + ), + + [ARROWS_DV] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + LGUI(DV_X), XXXXXXX, LCTL(DV_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, + LGUI(DV_C), XXXXXXX, LCTL(DV_C), KC_UP, SCTL(DV_C), LCTL(DV_Z), LGUI(DV_Z), + KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, + LGUI(DV_V), XXXXXXX, LCTL(DV_V), KC_MS_WH_DOWN, SCTL(DV_V), LCTL(DV_Y), SGUI(DV_Z), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [MOUSE_DV] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(DV_X), XXXXXXX, LGUI(DV_X), + LGUI(DV_Z), LCTL(DV_Z), SCTL(DV_C), KC_MS_UP, LCTL(DV_C), KC_MS_BTN4, LGUI(DV_C), + KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, + LGUI(DV_Z), LCTL(DV_Y), SCTL(DV_V), KC_MS_WH_DOWN, LCTL(DV_V), KC_MS_BTN5, LGUI(DV_V), + KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, + XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, + XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MS_ACCEL0 + ), + + [NUMPAD_DV] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, + _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + DV_X, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, + DV_O, DV_I, DV_1, DV_2, DV_3, DV_SLSH, DV_PERC, + DV_M, DV_4, DV_5, DV_6, DV_PLUS, DV_MINS, + DV_L, DV_J, DV_7, DV_8, DV_9, DV_ASTR, DV_CIRC, + DV_DOT, DV_0, DV_COMM, DV_UNDS, DV_BSLS, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [LAYERS_DV] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, TO(DVORAK_DV), TO(PLOVER_DV), TO(GAMING_DV), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [MEDIA_FN] = LAYOUT_ergodox( + // left hand + KC_AUDIO_VOL_DOWN, KC_AUDIO_MUTE, RGB_TOG, XXXXXXX, KC_MAIL, KC_FIND, KC_WWW_REFRESH, + KC_MEDIA_PREV_TRACK, KC_F9, KC_F7, KC_F5, KC_F3, KC_F1, KC_WWW_HOME, + KC_PAUSE, KC_F19, KC_F17, KC_F15, KC_F13, KC_F11, + RGB_HUD, XXXXXXX, XXXXXXX, _______, KC_F23, KC_F21, KC_WWW_BACK, + RGB_VAD, KC_CLCK, KC_PSCREEN, XXXXXXX, MO(FIRMWARE), + + // left thumb + _______, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MEDIA_EJECT, + + // right hand + KC_WWW_FAVORITES, KC_MY_COMPUTER, KC_CALCULATOR, XXXXXXX, RGB_MOD, RGB_M_P, KC_AUDIO_VOL_UP, + KC_WWW_SEARCH, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, KC_MEDIA_NEXT_TRACK, + KC_F12, KC_F14, KC_F16, KC_F18, KC_F20, KC_MEDIA_PLAY_PAUSE, + KC_WWW_FORWARD, KC_F22, KC_F24, _______, XXXXXXX, XXXXXXX, RGB_HUI, + KC_SYSTEM_POWER, XXXXXXX, KC_SYSTEM_SLEEP, KC_SYSTEM_WAKE, RGB_VAI, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + RGB_GREEN, XXXXXXX, XXXXXXX + ), + + [HYPER_FN] = LAYOUT_ergodox( + // left hand + XXXXXXX, HYPR(KC_F1), HYPR(KC_F2), HYPR(KC_F3), HYPR(KC_F4), HYPR(KC_F5), XXXXXXX, + XXXXXXX, HYPR(KC_F6), HYPR(KC_F7), HYPR(KC_F8), HYPR(KC_F9), HYPR(KC_F10), XXXXXXX, + XXXXXXX, HYPR(KC_F11), HYPR(KC_F12), HYPR(KC_F13), HYPR(KC_F14), HYPR(KC_F15), + XXXXXXX, HYPR(KC_F16), HYPR(KC_F17), HYPR(KC_F18), HYPR(KC_F19), HYPR(KC_F20), XXXXXXX, + XXXXXXX, HYPR(KC_F21), HYPR(KC_F22), HYPR(KC_F23), HYPR(KC_F24), + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, _______, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [MEH_FN] = LAYOUT_ergodox( + // left hand + LCA(KC_F11), LCA(KC_F9), LCA(KC_F7), LCA(KC_F5), LCA(KC_F3), LCA(KC_F1), XXXXXXX, + LCAG(KC_F11), LCAG(KC_F9), LCAG(KC_F7), LCAG(KC_F5), LCAG(KC_F3), LCAG(KC_F1), XXXXXXX, + MEH(KC_F11), MEH(KC_F9), MEH(KC_F7), MEH(KC_F5), MEH(KC_F3), MEH(KC_F1), + SGUI(KC_F11), SGUI(KC_F9), SGUI(KC_F7), SGUI(KC_F5), SGUI(KC_F3), SGUI(KC_F1), XXXXXXX, + _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, LCA(KC_F2), LCA(KC_F4), LCA(KC_F6), LCA(KC_F8), LCA(KC_F10), LCA(KC_F12), + XXXXXXX, LCAG(KC_F2), LCAG(KC_F4), LCAG(KC_F6), LCAG(KC_F8), LCAG(KC_F10), LCAG(KC_F12), + MEH(KC_F2), MEH(KC_F4), MEH(KC_F6), MEH(KC_F8), MEH(KC_F10), MEH(KC_F12), + XXXXXXX, SGUI(KC_F2), SGUI(KC_F4), SGUI(KC_F6), SGUI(KC_F8), SGUI(KC_F10), SGUI(KC_F12), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [MEH_FN_PLUS] = LAYOUT_ergodox( + // left hand + LCA(KC_F23), LCA(KC_F21), LCA(KC_F19), LCA(KC_F17), LCA(KC_F15), LCA(KC_F13), XXXXXXX, + LCAG(KC_F23), LCAG(KC_F21), LCAG(KC_F19), LCAG(KC_F17), LCAG(KC_F15), LCAG(KC_F13), XXXXXXX, + MEH(KC_F23), MEH(KC_F21), MEH(KC_F19), MEH(KC_F17), MEH(KC_F15), MEH(KC_F13), + SGUI(KC_F23), SGUI(KC_F21), SGUI(KC_F19), SGUI(KC_F17), SGUI(KC_F15), SGUI(KC_F13), XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, LCA(KC_F14), LCA(KC_F16), LCA(KC_F18), LCA(KC_F20), LCA(KC_F22), LCA(KC_F24), + XXXXXXX, LCAG(KC_F14), LCAG(KC_F16), LCAG(KC_F18), LCAG(KC_F20), LCAG(KC_F22), LCAG(KC_F24), + MEH(KC_F14), MEH(KC_F16), MEH(KC_F18), MEH(KC_F20), MEH(KC_F22), MEH(KC_F24), + XXXXXXX, SGUI(KC_F14), SGUI(KC_F16), SGUI(KC_F18), SGUI(KC_F20), SGUI(KC_F22), SGUI(KC_F24), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [FIRMWARE] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + RESET, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, EEP_RST + ) +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case RGB_GREEN: + if (record->event.pressed) { + #ifdef RGBLIGHT_ENABLE + rgblight_enable(); + rgblight_mode(1); + rgblight_sethsv_red(); + #endif + } + + return false; + + case KC_CLCK: + if (record->event.pressed) { + if (!(CAPS_LOCK)) { + ergodox_right_led_1_on(); + CAPS_LOCK = 1; + } else { + ergodox_right_led_1_off(); + CAPS_LOCK = 0; + } + } + + return true; + + case KC_NLCK: + if (record->event.pressed) { + if (!(NUM_LOCK)) { + ergodox_right_led_2_on(); + NUM_LOCK = 1; + } else { + ergodox_right_led_2_off(); + NUM_LOCK = 0; + } + } + + return true; + + case KC_SLCK: + if (record->event.pressed) { + if (!(SCROLL_LOCK)) { + ergodox_right_led_3_on(); + SCROLL_LOCK = 1; + } else { + ergodox_right_led_3_off(); + SCROLL_LOCK = 0; + } + } + + case KC_MS_WH_LEFT: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + case KC_MS_WH_UP: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + case KC_MS_WH_DOWN: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + case KC_MS_WH_RIGHT: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + default: + return true; + } +} + +uint32_t layer_state_set_user(uint32_t state) { + uint8_t layer = biton32(state); + + switch (layer) { + case DVORAK_US: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + + break; + + case PLOVER_US: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + break; + + case GAMING_US: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + break; + + case ARROWS_US: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case MOUSE_US: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case NUMPAD_US: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case LAYERS_US: + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case DVORAK_DV: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + break; + + case PLOVER_DV: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + break; + + case GAMING_DV: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + break; + + case ARROWS_DV: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case MOUSE_DV: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case NUMPAD_DV: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case LAYERS_DV: + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case MEDIA_FN: + rgblight_sethsv_noeeprom_yellow(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case HYPER_FN: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + case MEH_FN: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 4); + + break; + + case MEH_FN_PLUS: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5); + + break; + + case FIRMWARE: + rgblight_sethsv_noeeprom_pink(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + break; + + default: + break; + } + + return state; +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json b/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json new file mode 100644 index 0000000000..116911e46b --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/package.json @@ -0,0 +1,15 @@ +{ + "name": "hacker_dvorak", + "version": "1.0.0", + "description": "Inspired by the [*Programmer Dvorak*](https://www.kaufmann.no/roland/dvorak) keyboard layout, cherry picked ideas from other layouts in the [EZ Repository](https://configure.ergodox-ez.com/search?q=dvorak&legacy=true), a character distribution [heatmap vizualizer](https://run.plnkr.co/plunks/5EEO8nJ2wRzYAfT3), my own subjective use cases and lots of trial and error.", + "main": "gulpfile.js", + "scripts": { + "test": "test" + }, + "author": "SalchiPapa", + "license": "GPL-2.0", + "dependencies": { + "gulp": "^3.9.1", + "gulp-run-command": "0.0.9" + } +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md new file mode 100644 index 0000000000..c7df0d7483 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md @@ -0,0 +1,62 @@ +# [Ergodox EZ Hacker Dvorak Layout](https://configure.ergodox-ez.com/layouts/Wadz/latest/0) + +Inspired by the [*Programmer Dvorak*](https://www.kaufmann.no/roland/dvorak) keyboard layout, cherry picked ideas from other layouts in the [EZ Repository](https://configure.ergodox-ez.com/search?q=dvorak&legacy=true), a character distribution [heatmap vizualizer](https://run.plnkr.co/plunks/5EEO8nJ2wRzYAfT3), my own subjective use cases and lots of trial and error. + +## Setup + +Configure your OS keyboard layout to US, or the keymap will be incorrect. + +## Limitations + +I plan to use [QMK](https://docs.qmk.fm) in the future, in order to overcome some limitations of the Ergodox EZ [graphical configurator](https://configure.ergodox-ez.com/layouts/default/latest/0)), however I will defer that, until more progress is made to the new [configurator](https://medium.com/the-ergo/the-configurator-is-out-of-beta-e107aec80cae). + +## Layers + +1. Dvorak + * US Dvorak layout. + * All symbols (including shifted symbols). + * All modifier are dual keys positioned near the home row. +2. Querty + * Used to overcome the limitation pointed above, when your OS layout is set to Dvorak instead of US, this way you can use + Standard Dvorak (available by default on all the main operating systems) on other normal keybdoards and Hacker Dvorak on + the Ergodox EZ Shine at the same time, without changing back and forth tho OS layout. +3. Gaming + * Still in development. + * Left side is mainly "normal" Qwerty. + * Right side is mainly for movement, either using the mouse, the arrow keys, the number pad or the `H`, `J`, `K`, `L` as direction keys. +4. Arrows + * Arrow keys navigation. + * All modifier keys. + * Common text edititng shortcuts (doesn't work for MacOS). +5. Mouse + * Mouse navigation. + * All modifier keys. + * Common text edititng shortcuts (doesn't work for MacOS). +6. Numpad + * ATM style numpad. + * All modifier keys. + * Letters from `A` to `F` for hexadecimal numbers (`B` is also used for binary numeric literals in most programming + languages, ie. `0b11001`). + * `X` for hexadecimal numeric literals in most programming languages, ie. `0xbeef`. + * `O` for octal numeric literals in most programming languages, ie `0o123`. + * `J` for complex numeric literals in Python, ie. `3j`. + * `I` and `M` for complex Julia numeric literals, ie. `3im`. + * Common symbols for mathematical operations. +7. Hyper Fn + * Useful for custom global shortcuts. +8. Media Fn + * Media keys. + * Function keys. + * EZ Shine keys. +9. Meh Fn + * Useful for custom application shortcuts. +10. Meh Fn + + * Useful for custom standard shortcuts. + +## To Do + +Add images. + +*** + +Please comment below if you have any ideas or suggestions. If you have used this layout or used it as a base, I'd love to hear about your experience! \ No newline at end of file diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk new file mode 100644 index 0000000000..4aa2f262b7 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk @@ -0,0 +1,35 @@ +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes +MOUSEKEY_ENABLE = yes # Mouse keys(+4700b). +EXTRAKEY_ENABLE = yes # Audio control and System control(+450b). +SLEEP_LED_ENABLE = yes # Turn off leds when computer is sleeping. +KEY_LOCK_ENABLE = yes # (+1730b) +RGBLIGHT_ENABLE = yes +LEADER_ENABLE = yes + + +UNICODE_ENABLE = no # For Unicode. +COMMAND_ENABLE = no # Commands for debug and configuration +SWAP_HANDS_ENABLE = no # Allow swapping hands of keyboard. + + +# This are by default off: +# CONSOLE_ENABLE = no # Console for debug(+400) +# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +# API_SYSEX_ENABLE = no +# MIDI_ENABLE = no +# UNICODEMAP_ENABLE = no +# BLUETOOTH_ENABLE = no +# AUDIO_ENABLE = no +# FAUXCLICKY_ENABLE = no +# VARIABLE_TRACE = no +# BACKLIGHT_ENABLE = no +# RGB_MATRIX_ENABLE = no +# COMBO_ENABLE = no + + +# This don't need argument: +# CUSTOM_MATRIX # Custom matrix file for the ErgoDox EZ +# SPLIT_KEYBOARD diff --git a/quantum/keymap_extras/keymap_plover_dvorak.h b/quantum/keymap_extras/keymap_plover_dvorak.h new file mode 100644 index 0000000000..83bb1e8b87 --- /dev/null +++ b/quantum/keymap_extras/keymap_plover_dvorak.h @@ -0,0 +1,47 @@ +/* Copyright 2016 James Kay + * + * 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 . + */ +#ifndef KEYMAP_PLOVER_DVORAK_H +#define KEYMAP_PLOVER_DVORAK_H + +#include "keymap_dvorak.h" + +#define PD_NUM DV_1 +#define PD_LS DV_Q +#define PD_LT DV_W +#define PD_LP DV_E +#define PD_LH DV_R +#define PD_LK DV_S +#define PD_LW DV_D +#define PD_LR DV_F + +#define PD_STAR DV_Y +#define PD_RF DV_U +#define PD_RP DV_I +#define PD_RL DV_O +#define PD_RT DV_P +#define PD_RD DV_LBRC +#define PD_RR DV_J +#define PD_RB DV_K +#define PD_RG DV_L +#define PD_RS DV_SCLN +#define PD_RZ DV_QUOT + +#define PD_A DV_C +#define PD_O DV_V +#define PD_E DV_N +#define PD_U DV_M + +#endif -- cgit v1.2.3 From 86a7687a87a3b296ff2b823f12b971bd581b0708 Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Wed, 5 Dec 2018 10:19:14 -0600 Subject: Major revisions, focused on streamlining and useability (#4554) --- keyboards/iris/keymaps/vyolle/config.h | 44 ++++++++ keyboards/iris/keymaps/vyolle/keymap.c | 115 +++++++++++++++++++++ keyboards/iris/keymaps/vyolle/rules.mk | 7 ++ keyboards/iris/keymaps/vyolle_steno/config.h | 34 ------ keyboards/iris/keymaps/vyolle_steno/keymap.c | 149 --------------------------- keyboards/iris/keymaps/vyolle_steno/rules.mk | 7 -- 6 files changed, 166 insertions(+), 190 deletions(-) create mode 100644 keyboards/iris/keymaps/vyolle/config.h create mode 100644 keyboards/iris/keymaps/vyolle/keymap.c create mode 100644 keyboards/iris/keymaps/vyolle/rules.mk delete mode 100644 keyboards/iris/keymaps/vyolle_steno/config.h delete mode 100644 keyboards/iris/keymaps/vyolle_steno/keymap.c delete mode 100644 keyboards/iris/keymaps/vyolle_steno/rules.mk diff --git a/keyboards/iris/keymaps/vyolle/config.h b/keyboards/iris/keymaps/vyolle/config.h new file mode 100644 index 0000000000..1adbd65b5a --- /dev/null +++ b/keyboards/iris/keymaps/vyolle/config.h @@ -0,0 +1,44 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_I2C +// #define USE_SERIAL + + +#define FORCE_NKRO //Cause it's suprisingly handy. + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + +#define MOUSEKEY_INTERVAL 16 + +#define MOUSEKEY_DELAY 0 + +#define MOUSEKEY_TIME_TO_MAX 60 + +#define MOUSEKEY_MAX_SPEED 7 + +#define MOUSEKEY_WHEEL_DELAY 0 + diff --git a/keyboards/iris/keymaps/vyolle/keymap.c b/keyboards/iris/keymaps/vyolle/keymap.c new file mode 100644 index 0000000000..66bcaa385c --- /dev/null +++ b/keyboards/iris/keymaps/vyolle/keymap.c @@ -0,0 +1,115 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 4 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RSFT, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LGUI, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LALT, KC_RALT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RGUI, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_VOLU, KC_HOME, KC_LEFT, KC_UP, KC_RGHT, KC_PGUP, KC_WH_U, KC_MS_L, KC_MS_U, KC_MS_R, XXXXXXX, KC_BTN4, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, XXXXXXX, KC_WH_D, KC_WH_L, KC_MS_D, KC_WH_R, XXXXXXX, KC_BTN5, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3 + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRAVE,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TILD, KC_PIPE, KC_LT, KC_GT, _______, _______, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_COLN, KC_UNDS, KC_LPRN, KC_PLUS, KC_RPRN, KC_EQL, KC_UNDO, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + KC_CUT, KC_COPY, KC_PSTE, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + _______, _______, KC_CAPS, KC_MENU, KC_APP, KC_PSCR, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, KC_SLCK, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + _______, _______, _______, _______, _______, _______ + // └────────┴────────┴────────┘ └────────┴────────┴────────┘ + ), +}; + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/iris/keymaps/vyolle/rules.mk b/keyboards/iris/keymaps/vyolle/rules.mk new file mode 100644 index 0000000000..e7cbfb83d8 --- /dev/null +++ b/keyboards/iris/keymaps/vyolle/rules.mk @@ -0,0 +1,7 @@ +EXTRAKEY_ENABLE = yes # Disable if you run out of usb endpoints. Media keys need this to work. +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) Uses extra usb endpoints. +STENO_ENABLE = no # Additional protocols for Stenography(+1700), requires VIRTSER. +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes diff --git a/keyboards/iris/keymaps/vyolle_steno/config.h b/keyboards/iris/keymaps/vyolle_steno/config.h deleted file mode 100644 index 9cbc148e42..0000000000 --- a/keyboards/iris/keymaps/vyolle_steno/config.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -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 - -/* Use I2C or Serial, not both */ - -#define USE_I2C -// #define USE_SERIAL - - -#define FORCE_NKRO //For Steno. - -/* Select hand configuration */ - -#define MASTER_LEFT -// #define MASTER_RIGHT -// #define EE_HANDS - - diff --git a/keyboards/iris/keymaps/vyolle_steno/keymap.c b/keyboards/iris/keymaps/vyolle_steno/keymap.c deleted file mode 100644 index 3ad117655a..0000000000 --- a/keyboards/iris/keymaps/vyolle_steno/keymap.c +++ /dev/null @@ -1,149 +0,0 @@ -#include QMK_KEYBOARD_H -#include "keymap_steno.h" - -extern keymap_config_t keymap_config; - -#define _QWERTY 0 -#define _LOWER 1 -#define _RAISE 2 -#define _PLOVER 3 -#define _ADJUST 4 - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST, - PLOVER, - EXT_PLV, -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_QWERTY] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, PLOVER, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - RAISE, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_RBRC, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_BSPC, KC_RSFT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LGUI, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - KC_LCTL, LOWER, KC_SPC, KC_BSPC, KC_ENT, KC_LALT - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_LOWER] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_DEL, KC_0, KC_9, KC_8, KC_7, KC_6, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_SCLN, KC_P, KC_O, KC_I, KC_U, KC_Y, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, KC_QUOT, KC_L, KC_K, KC_J, KC_H, _______, KC_LEFT, KC_UP, KC_RGHT, KC_SCLN, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_ENT, KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N, KC_LALT, _______, _______, _______, KC_DOWN, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, KC_LGUI, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_RAISE] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - 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_VOLU, KC_LEFT, KC_UP, KC_RGHT, KC_INS, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_MUTE, KC_VOLD, KC_PGUP, KC_DOWN, KC_PGDN, KC_DEL, _______, _______, _______, _______, _______, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, KC_LALT, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_ADJUST] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, _______, _______, _______ - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ), - - [_PLOVER] = LAYOUT( - //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - STN_PWR, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EXT_PLV, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, - //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, - //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_RE1, STN_RE2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, - //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX - // └────────┴────────┴────────┘ └────────┴────────┴────────┘ - ) -}; - - -void matrix_init_user() { - steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - case PLOVER: - if (!record->event.pressed) { - layer_on(_PLOVER); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - layer_off(_PLOVER); - } - return false; - break; - } - return true; -} diff --git a/keyboards/iris/keymaps/vyolle_steno/rules.mk b/keyboards/iris/keymaps/vyolle_steno/rules.mk deleted file mode 100644 index ebe1c86a0e..0000000000 --- a/keyboards/iris/keymaps/vyolle_steno/rules.mk +++ /dev/null @@ -1,7 +0,0 @@ -EXTRAKEY_ENABLE = yes # Disable if you run out of usb endpoints. Media keys need this to work. -MOUSEKEY_ENABLE = no # Mouse keys(+4700) Uses extra usb endpoints. -STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER. -AUDIO_ENABLE = no # Audio output on port C6 -MIDI_ENABLE = no # MIDI controls -NKRO_ENABLE = yes -BOOTMAGIC_ENABLE = yes -- cgit v1.2.3 From 20130e010badad1968762439e66c71dc4b0760a1 Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 5 Dec 2018 16:36:31 +0000 Subject: Keyboard: Initial nori port (#4542) * Initial nori port * ortho_4x4 layout and RGB fixes * Review fixes for superseded audio and default layer functionality --- keyboards/40percentclub/nori/config.h | 221 +++++++++++++++++++++ keyboards/40percentclub/nori/info.json | 117 +++++++++++ .../40percentclub/nori/keymaps/default/config.h | 23 +++ .../40percentclub/nori/keymaps/default/keymap.c | 159 +++++++++++++++ .../40percentclub/nori/keymaps/default/readme.md | 1 + .../40percentclub/nori/keymaps/macro/config.h | 21 ++ .../40percentclub/nori/keymaps/macro/keymap.c | 41 ++++ .../40percentclub/nori/keymaps/macro/readme.md | 1 + keyboards/40percentclub/nori/nori.c | 43 ++++ keyboards/40percentclub/nori/nori.h | 69 +++++++ keyboards/40percentclub/nori/readme.md | 18 ++ keyboards/40percentclub/nori/rules.mk | 82 ++++++++ 12 files changed, 796 insertions(+) create mode 100644 keyboards/40percentclub/nori/config.h create mode 100644 keyboards/40percentclub/nori/info.json create mode 100644 keyboards/40percentclub/nori/keymaps/default/config.h create mode 100644 keyboards/40percentclub/nori/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/nori/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/nori/keymaps/macro/config.h create mode 100644 keyboards/40percentclub/nori/keymaps/macro/keymap.c create mode 100644 keyboards/40percentclub/nori/keymaps/macro/readme.md create mode 100644 keyboards/40percentclub/nori/nori.c create mode 100644 keyboards/40percentclub/nori/nori.h create mode 100644 keyboards/40percentclub/nori/readme.md create mode 100644 keyboards/40percentclub/nori/rules.mk diff --git a/keyboards/40percentclub/nori/config.h b/keyboards/40percentclub/nori/config.h new file mode 100644 index 0000000000..9232344bfc --- /dev/null +++ b/keyboards/40percentclub/nori/config.h @@ -0,0 +1,221 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0444 +#define MANUFACTURER di0ib +#define PRODUCT The nori Keyboard +#define DESCRIPTION A modular compact keyboard + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 12 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0 } +#define MATRIX_COL_PINS { F4, F5, F6, F7, B1, B3, B2, B6, D4, C6, D7, E6 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_PIN B5 +//#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 + +// enable RGB underglow +#define RGB_DI_PIN B4 +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 10 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ diff --git a/keyboards/40percentclub/nori/info.json b/keyboards/40percentclub/nori/info.json new file mode 100644 index 0000000000..db0d6aaadb --- /dev/null +++ b/keyboards/40percentclub/nori/info.json @@ -0,0 +1,117 @@ +{ + "keyboard_name": "nori", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT_ortho_4x4": { + "key_count": 16, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 } ] + }, + "LAYOUT_ortho_4x8": { + "key_count": 32, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 } ] + }, + "LAYOUT_ortho_4x12": { + "key_count": 48, + "layout": [ + { "w": 1, "x": 0, "y": 0 }, + { "w": 1, "x": 1, "y": 0 }, + { "w": 1, "x": 2, "y": 0 }, + { "w": 1, "x": 3, "y": 0 }, + { "w": 1, "x": 4, "y": 0 }, + { "w": 1, "x": 5, "y": 0 }, + { "w": 1, "x": 6, "y": 0 }, + { "w": 1, "x": 7, "y": 0 }, + { "w": 1, "x": 8, "y": 0 }, + { "w": 1, "x": 9, "y": 0 }, + { "w": 1, "x": 10, "y": 0 }, + { "w": 1, "x": 11, "y": 0 }, + { "w": 1, "x": 0, "y": 1 }, + { "w": 1, "x": 1, "y": 1 }, + { "w": 1, "x": 2, "y": 1 }, + { "w": 1, "x": 3, "y": 1 }, + { "w": 1, "x": 4, "y": 1 }, + { "w": 1, "x": 5, "y": 1 }, + { "w": 1, "x": 6, "y": 1 }, + { "w": 1, "x": 7, "y": 1 }, + { "w": 1, "x": 8, "y": 1 }, + { "w": 1, "x": 9, "y": 1 }, + { "w": 1, "x": 10, "y": 1 }, + { "w": 1, "x": 11, "y": 1 }, + { "w": 1, "x": 0, "y": 2 }, + { "w": 1, "x": 1, "y": 2 }, + { "w": 1, "x": 2, "y": 2 }, + { "w": 1, "x": 3, "y": 2 }, + { "w": 1, "x": 4, "y": 2 }, + { "w": 1, "x": 5, "y": 2 }, + { "w": 1, "x": 6, "y": 2 }, + { "w": 1, "x": 7, "y": 2 }, + { "w": 1, "x": 8, "y": 2 }, + { "w": 1, "x": 9, "y": 2 }, + { "w": 1, "x": 10, "y": 2 }, + { "w": 1, "x": 11, "y": 2 }, + { "w": 1, "x": 0, "y": 3 }, + { "w": 1, "x": 1, "y": 3 }, + { "w": 1, "x": 2, "y": 3 }, + { "w": 1, "x": 3, "y": 3 }, + { "w": 1, "x": 4, "y": 3 }, + { "w": 1, "x": 5, "y": 3 }, + { "w": 1, "x": 6, "y": 3 }, + { "w": 1, "x": 7, "y": 3 }, + { "w": 1, "x": 8, "y": 3 }, + { "w": 1, "x": 9, "y": 3 }, + { "w": 1, "x": 10, "y": 3 }, + { "w": 1, "x": 11, "y": 3 } ] + } + } +} diff --git a/keyboards/40percentclub/nori/keymaps/default/config.h b/keyboards/40percentclub/nori/keymaps/default/config.h new file mode 100644 index 0000000000..90831ff34e --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/config.h @@ -0,0 +1,23 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } diff --git a/keyboards/40percentclub/nori/keymaps/default/keymap.c b/keyboards/40percentclub/nori/keymaps/default/keymap.c new file mode 100644 index 0000000000..3c225a0d9c --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/keymap.c @@ -0,0 +1,159 @@ +#include QMK_KEYBOARD_H + +// 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 _QWERTY 0 +#define _COLEMAK 1 +#define _DVORAK 2 +#define _LOWER 3 +#define _RAISE 4 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, +}; + +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | ' | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Dvorak + * ,-----------------------------------------------------------------------------------. + * | Tab | ' | , | . | P | Y | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | O | E | U | I | D | H | T | N | S | / | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \ + KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ + _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ +) + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + } + return true; +} diff --git a/keyboards/40percentclub/nori/keymaps/default/readme.md b/keyboards/40percentclub/nori/keymaps/default/readme.md new file mode 100644 index 0000000000..4a55a35e4b --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap diff --git a/keyboards/40percentclub/nori/keymaps/macro/config.h b/keyboards/40percentclub/nori/keymaps/macro/config.h new file mode 100644 index 0000000000..03f34d3f51 --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/config.h @@ -0,0 +1,21 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here +#undef RGBLED_NUM +#define RGBLED_NUM 4 diff --git a/keyboards/40percentclub/nori/keymaps/macro/keymap.c b/keyboards/40percentclub/nori/keymaps/macro/keymap.c new file mode 100644 index 0000000000..14dc0b678c --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/keymap.c @@ -0,0 +1,41 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_4x4( /* Base */ + KC_INT1, KC_INT2, KC_INT3, KC_INT5, \ + KC_F13, KC_F14, KC_F15, KC_F16, \ + KC_F17, KC_F18, KC_F19, KC_F20, \ + KC_F21, KC_F22, KC_F23, KC_F24 \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/nori/keymaps/macro/readme.md b/keyboards/40percentclub/nori/keymaps/macro/readme.md new file mode 100644 index 0000000000..de2324248a --- /dev/null +++ b/keyboards/40percentclub/nori/keymaps/macro/readme.md @@ -0,0 +1 @@ +# The default single board macro keymap for nori diff --git a/keyboards/40percentclub/nori/nori.c b/keyboards/40percentclub/nori/nori.c new file mode 100644 index 0000000000..9d27df7a5c --- /dev/null +++ b/keyboards/40percentclub/nori/nori.c @@ -0,0 +1,43 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "nori.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/nori/nori.h b/keyboards/40percentclub/nori/nori.h new file mode 100644 index 0000000000..802f0bfce6 --- /dev/null +++ b/keyboards/40percentclub/nori/nori.h @@ -0,0 +1,69 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" +#define ___ KC_NO + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) \ +{ \ + { K00, K01, K02, K03, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K10, K11, K12, K13, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K20, K21, K22, K23, ___, ___, ___, ___, ___, ___, ___, ___ }, \ + { K30, K31, K32, K33, ___, ___, ___, ___, ___, ___, ___, ___ } \ +} +#define LAYOUT_ortho_4x8( \ + K00, K01, K02, K03, K04, K05, K06, K07, \ + K10, K11, K12, K13, K14, K15, K16, K17, \ + K20, K21, K22, K23, K24, K25, K26, K27, \ + K30, K31, K32, K33, K34, K35, K36, K37\ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, ___, ___, ___, ___ }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, ___, ___, ___, ___ }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, ___, ___, ___, ___ }, \ + { K30, K31, K32, K33, K34, K35, K35, K37, ___, ___, ___, ___ } \ +} +#define LAYOUT_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b } \ +} + +#define LAYOUT_kc_ortho_4x12( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ +) \ +{ \ + { KC_##K00, KC_##K01, KC_##K02, KC_##K03, KC_##K04, KC_##K05, KC_##K06, KC_##K07, KC_##K08, KC_##K09, KC_##K0a, KC_##K0b }, \ + { KC_##K10, KC_##K11, KC_##K12, KC_##K13, KC_##K14, KC_##K15, KC_##K16, KC_##K17, KC_##K18, KC_##K19, KC_##K1a, KC_##K1b }, \ + { KC_##K20, KC_##K21, KC_##K22, KC_##K23, KC_##K24, KC_##K25, KC_##K26, KC_##K27, KC_##K28, KC_##K29, KC_##K2a, KC_##K2b }, \ + { KC_##K30, KC_##K31, KC_##K32, KC_##K33, KC_##K34, KC_##K35, KC_##K36, KC_##K37, KC_##K38, KC_##K39, KC_##K3a, KC_##K3b } \ +} diff --git a/keyboards/40percentclub/nori/readme.md b/keyboards/40percentclub/nori/readme.md new file mode 100644 index 0000000000..3dd8afff48 --- /dev/null +++ b/keyboards/40percentclub/nori/readme.md @@ -0,0 +1,18 @@ +# nori + +![nori](https://2.bp.blogspot.com/-UBFz3c1-8hM/W48N0ynt6TI/AAAAAAACSQg/MHLY-DchBBMiiHUeIPVt_4T6x-ntmdjgwCEwYBhgL/s640/a.jpg) +=== + +A 4x12 matrix using 3 modular 4x4 matrix boards and powered by a Pro Micro. + +this one is using a Pro Micro. The Pro Micro has less data pins available so only 3 boards can be connected instead of 4. There are 2 pins left over, I used one (B5) for a backlight circuit like on a Gherkin. The other data pin (B4) is left for possible use with a WS2812B strip. + +Keyboard Maintainer: QMK Community +Hardware Supported: nori PCB +Hardware Availability: [nori project on 40% Keyboards](https://www.40percent.club/2018/10/nori.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/nori: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/40percentclub/nori/rules.mk b/keyboards/40percentclub/nori/rules.mk new file mode 100644 index 0000000000..f52135379a --- /dev/null +++ b/keyboards/40percentclub/nori/rules.mk @@ -0,0 +1,82 @@ +# MCU name +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 = caterina + + +# 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 = lite # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 = yes # Enable keyboard backlight functionality on B7 by default +RGBLIGHT_ENABLE = yes # 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) + +LAYOUTS = ortho_4x4 ortho_4x8 ortho_4x12 -- cgit v1.2.3 From 0677e64655f230722eaa35160acaefacf3684a43 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Wed, 5 Dec 2018 08:42:50 -0800 Subject: Keymap: Wanleg layout updates (#4550) * config fixes (including for issue #3678) * put back audio * jj40 backlighting setup * jj40 backlighting setup * rules.mk fix * jj40 backlighting settings * iris setup * iris setup * iris setup * iris setup * iris setup - onehand * remove commented-out section * edits due to #4403 * xd75 testing * fix 5x15 layout issues with 5x5 bluetooth & xd75 * commenting out unused placeholders * change iris to more wanleg-like 4x12 layout * formatting changes * onehand layout cleanup/fix * revert temp change --- keyboards/iris/keymaps/wanleg/config.h | 33 ++++++++++++ keyboards/iris/keymaps/wanleg/keymap.c | 76 ++++++++++++++++++++++++++++ keyboards/iris/keymaps/wanleg/rules.mk | 5 ++ layouts/community/ortho_4x12/wanleg/config.h | 13 ++++- layouts/community/ortho_4x12/wanleg/keymap.c | 17 ++++++- layouts/community/ortho_4x12/wanleg/rules.mk | 16 +++--- layouts/community/ortho_5x15/wanleg/config.h | 2 +- layouts/community/ortho_5x15/wanleg/keymap.c | 49 +++++++++--------- layouts/community/ortho_5x15/wanleg/rules.mk | 19 ++++--- users/wanleg/config.h | 12 ++--- users/wanleg/rules.mk | 10 +++- users/wanleg/tapdances.c | 4 +- users/wanleg/wanleg.h | 18 +++---- 13 files changed, 208 insertions(+), 66 deletions(-) create mode 100644 keyboards/iris/keymaps/wanleg/config.h create mode 100644 keyboards/iris/keymaps/wanleg/keymap.c create mode 100644 keyboards/iris/keymaps/wanleg/rules.mk diff --git a/keyboards/iris/keymaps/wanleg/config.h b/keyboards/iris/keymaps/wanleg/config.h new file mode 100644 index 0000000000..9b90007688 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/config.h @@ -0,0 +1,33 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +#undef USE_I2C + +/* Select hand configuration */ + +// #define MASTER_LEFT +// #define MASTER_RIGHT +#define EE_HANDS + +#define QMK_ESC_OUTPUT F6 // usually COL +#define QMK_ESC_INPUT D7 // usually ROW +#define QMK_LED B0 diff --git a/keyboards/iris/keymaps/wanleg/keymap.c b/keyboards/iris/keymaps/wanleg/keymap.c new file mode 100644 index 0000000000..6f8ff90661 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/keymap.c @@ -0,0 +1,76 @@ + +#include QMK_KEYBOARD_H +#include "wanleg.h" + + +#define LAYOUT_iris_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ + ) \ + LAYOUT_wrapper( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, _______, _______, K37, K38, K39, K3A, K3B, K3C, \ + _______, _______, _______, _______, _______, _______ \ + ) +#define LAYOUT_iris_base_wrapper(...) LAYOUT_iris_base(__VA_ARGS__) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_GK] = LAYOUT_iris_base_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + _______________GherkinLike_3_OneHand_______ + ), + [ONE] = LAYOUT_wrapper( + _______________Qwerty_Row__0_______________, + _______________Qwerty_Row__1_______________, + _______________Qwerty_Row__2_______________, + KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), _______, _______, SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL, + _______, _______, _______, _______, _______, _______ + ), + [SUP] = LAYOUT_iris_base_wrapper( + ________________SUPRA_Row_0________________, + ________________SUPRA_Row_1________________, + ________________SUPRA_Row_2________________, + ________________SUPRA_Row_3________________ + ), + [SUB] = LAYOUT_iris_base_wrapper( + _______________SUBTER_Row__0_______________, + _______________SUBTER_Row__1_______________, + _______________SUBTER_Row__2_______________, + _______________SUBTER_Row__3_______________ + ), + [NUM] = LAYOUT_iris_base_wrapper( + _______________NUMBERS_Row_0_______________, + _______________NUMBERS_Row_1_______________, + _______________NUMBERS_Row_2_______________, + _______________NUMBERS_Row_3_______________ + ), + [DIR] = LAYOUT_iris_base_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + [ETC] = LAYOUT_iris_base_wrapper( + ______________ETCETERA_Row__0______________, + ______________ETCETERA_Row__1______________, + ______________ETCETERA_Row__2______________, + ______________ETCETERA_Row__3______________ + ) + +}; + + +void matrix_init_keymap(void) { + DDRD &= ~(1<<5); + PORTD &= ~(1<<5); + + DDRB &= ~(1<<0); + PORTB &= ~(1<<0); +} diff --git a/keyboards/iris/keymaps/wanleg/rules.mk b/keyboards/iris/keymaps/wanleg/rules.mk new file mode 100644 index 0000000000..bbb05a5b48 --- /dev/null +++ b/keyboards/iris/keymaps/wanleg/rules.mk @@ -0,0 +1,5 @@ +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no + +SWAP_HANDS_ENABLE = yes +BOOTLOADER = qmk-dfu diff --git a/layouts/community/ortho_4x12/wanleg/config.h b/layouts/community/ortho_4x12/wanleg/config.h index 2b2072db22..f7650ddd3a 100644 --- a/layouts/community/ortho_4x12/wanleg/config.h +++ b/layouts/community/ortho_4x12/wanleg/config.h @@ -1,5 +1,14 @@ #pragma once +#if defined(KEYBOARD_jj40) +#undef BACKLIGHT_BREATHING +#undef BACKLIGHT_LEVELS +#undef BREATHING_PERIOD +#define BACKLIGHT_BREATHING +#define BACKLIGHT_LEVELS 3 +#define BREATHING_PERIOD 15 +#endif + //QMK DFU settings (ProMicro boards with QMK bootloader) // set top left key as bootloader mode escape key on Lets Split rev2 #if defined(KEYBOARD_lets_split_rev2) @@ -12,7 +21,7 @@ #endif // set top left key as bootloader mode escape key on 4x4 48key layout -#if defined(KEYBOARD_4x4) && !defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && !defined(PRO_MICRO) #define QMK_LED B0 #define QMK_ESC_OUTPUT C6 // usually COL #define QMK_ESC_INPUT B2 // usually ROW @@ -20,7 +29,7 @@ // use alternate settings for 4x4 board using ProMicro instead of Micro // usage: make 4x4:wanleg PM=yes -#if defined(KEYBOARD_4x4) && defined(PRO_MICRO) +#if defined(KEYBOARD_40percentclub_4x4) && defined(PRO_MICRO) #define QMK_ESC_OUTPUT F4 // usually COL #define QMK_ESC_INPUT D1 // usually ROW #define QMK_LED B0 diff --git a/layouts/community/ortho_4x12/wanleg/keymap.c b/layouts/community/ortho_4x12/wanleg/keymap.c index 6fe8446f6d..23e794dc41 100644 --- a/layouts/community/ortho_4x12/wanleg/keymap.c +++ b/layouts/community/ortho_4x12/wanleg/keymap.c @@ -15,8 +15,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________Qwerty_Row__2_______________, KC_LCTL, KC_LGUI, KC_LALT, GHERKIN, SUBTER, SH_T(KC_SPC), SH_T(KC_SPC), SUPRA, KC_RGUI, KC_RALT, GHERKIN, KC_RCTL ), - -#elif defined(KEYBOARD_4x4) +[DIR] = LAYOUT_ortho_4x12_wrapper( + _____________DIRECTIONS_Row__0_____________, + _____________DIRECTIONS_Row__1_____________, + _____________DIRECTIONS_Row__2_____________, + _______, _______, ONEHAND, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), +#elif defined(KEYBOARD_40percentclub_4x4) [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, _______________GherkinLike_1_______________, @@ -31,6 +36,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______________NUMPAD_Row__3_______________ ), +#elif defined(KEYBOARD_jj40) +[_GK] = LAYOUT_ortho_4x12_wrapper( + _______________GherkinLike_0_______________, + _______________GherkinLike_1_______________, + _______________GherkinLike_2_______________, + TD(RST_TAP_DANCE), BL_TOGG, BL_STEP, BL_BRTG, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL +), + #else [_GK] = LAYOUT_ortho_4x12_wrapper( _______________GherkinLike_0_______________, diff --git a/layouts/community/ortho_4x12/wanleg/rules.mk b/layouts/community/ortho_4x12/wanleg/rules.mk index 835022f4bf..e8277610b6 100644 --- a/layouts/community/ortho_4x12/wanleg/rules.mk +++ b/layouts/community/ortho_4x12/wanleg/rules.mk @@ -1,14 +1,10 @@ AUDIO_ENABLE = no -SWAP_HANDS_ENABLE = yes +SWAP_HANDS_ENABLE = no -ifeq ($(strip $(KEYBOARD)), jj40) - SWAP_HANDS_ENABLE = no +ifeq ($(strip $(KEYBOARD)), lets_split/rev2) + SWAP_HANDS_ENABLE = yes endif -ifeq ($(strip $(KEYBOARD)), 40percentclub/4x4) - SWAP_HANDS_ENABLE = no -endif - -ifeq ($(strip $(KEYBOARD)), zlant) - SWAP_HANDS_ENABLE = no -endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) + AUDIO_ENABLE = yes +endif \ No newline at end of file diff --git a/layouts/community/ortho_5x15/wanleg/config.h b/layouts/community/ortho_5x15/wanleg/config.h index 1aeda2db4e..d2b3d67193 100644 --- a/layouts/community/ortho_5x15/wanleg/config.h +++ b/layouts/community/ortho_5x15/wanleg/config.h @@ -1,7 +1,7 @@ #pragma once //5x5 powered by Adafruit Feather 32u4 Bluefruit LE -#if defined(KEYBOARD_5x5) && defined(BLUEFRUIT) +#if defined(KEYBOARD_40percentclub_5x5) && defined(BLUEFRUIT) //need to undefine standard 5x5 array before defining alternate Bluefruit array #undef MATRIX_ROW_PINS diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index 66b3ce018d..51b020fcde 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -6,7 +6,7 @@ #define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -#if defined(KEYBOARD_5x5) +#if defined(KEYBOARD_40percentclub_5x5) [GK75] = LAYOUT_ortho_5x15_wrapper( _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, @@ -23,6 +23,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI ), +[gNUM] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_NUM_0_______________, + _______________Gherkin_NUM_1_______________, + _______________Gherkin_NUM_2_______________, + _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ +), + +[gDIR] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_DIR_0_______________, + _______________Gherkin_DIR_1_______________, + _______________Gherkin_DIR_2_______________, + _________________BLANK_50__________________ +), + +[gETC] = LAYOUT_ortho_5x10_wrapper( + _________________BLANK_50__________________, + _______________Gherkin_ETC_0_______________, + _______________Gherkin_ETC_1_______________, + _______________Gherkin_ETC_2_______________, + _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ +), + #if defined(BLUEFRUIT) [PAD] = LAYOUT_ortho_5x5_wrapper( _______, _______, _______, OUT_BT, OUT_USB, @@ -210,27 +234,4 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R ), -[gNUM] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_NUM_0_______________, - _______________Gherkin_NUM_1_______________, - _______________Gherkin_NUM_2_______________, - _______, _______, _______, _______, _______, KC_ENT, KC_RSFT, KC_RGUI, _______, _______ -), - -[gDIR] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_DIR_0_______________, - _______________Gherkin_DIR_1_______________, - _______________Gherkin_DIR_2_______________, - _________________BLANK_50__________________ -), - -[gETC] = LAYOUT_ortho_5x10_wrapper( - _________________BLANK_50__________________, - _______________Gherkin_ETC_0_______________, - _______________Gherkin_ETC_1_______________, - _______________Gherkin_ETC_2_______________, - _______, KC_CAPS, _______, _______, _______, LALT(LCTL(KC_DEL)), _______, _______, _______, _______ -), }; diff --git a/layouts/community/ortho_5x15/wanleg/rules.mk b/layouts/community/ortho_5x15/wanleg/rules.mk index bfc4c69d99..96bbaa458e 100644 --- a/layouts/community/ortho_5x15/wanleg/rules.mk +++ b/layouts/community/ortho_5x15/wanleg/rules.mk @@ -1,8 +1,11 @@ -ifeq (,$(findstring yes,$(BLUEFRUIT))) - BLUETOOTH = AdafruitBLE - BLUETOOTH_ENABLE = yes - F_CPU = 8000000 - CONSOLE_ENABLE = no # Console for debug(+400) - COMMAND_ENABLE = no # Commands for debug and configuration - RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow -endif \ No newline at end of file +#ifeq ($(strip $(KEYBOARD)), xd75) +#or +#ifeq (,$(findstring xd75,$(KEYBOARD))) +#something +#endif + +#ifeq ($(strip $(KEYBOARD)), 40percentclub/5x5) +#or +#ifeq (,$(findstring 40percentclub/5x5,$(KEYBOARD))) +#something +#endif \ No newline at end of file diff --git a/users/wanleg/config.h b/users/wanleg/config.h index f2e785659f..0c8b048af7 100644 --- a/users/wanleg/config.h +++ b/users/wanleg/config.h @@ -1,10 +1,12 @@ -#ifndef USERSPACE_CONFIG_H -#define USERSPACE_CONFIG_H +#pragma once //TAPPING_TERM //tapping term short (<100): on multi-purpose keys, slow taps may not register, but "holds" register easier. multi-tap keys may be difficult to activate. //tapping term long (>200): holds don't register as easily - noticeable when typing quickly (e.g. shift doesn't want to engage.) -#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) + + +//MIGHT HAVE TO SPLIT THIS INTO TWO CONDITIONS +#if defined(TAP_DANCE_ENABLE) && defined(KEYBOARD_lets_split_rev2) || defined(KEYBOARD_iris_rev2) //Kailh Coppers activate quickly and don't need a long tapping term #define TAPPING_TERM 100 @@ -39,6 +41,4 @@ // Disable mod tap interrrupt #ifndef IGNORE_MOD_TAP_INTERRUPT #define IGNORE_MOD_TAP_INTERRUPT -#endif // !mod tap interrrupt - -#endif // !USERSPACE_CONFIG_H +#endif // !mod tap interrrupt \ No newline at end of file diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index e3e802b4a7..c6569594b3 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -18,5 +18,13 @@ endif #use alternate settings for boards using "Adafruit Feather 32u4 Bluefruit LE" instead of Micro #example usage: make 5x5:wanleg BT=yes ifeq ($(strip $(BT)), yes) - OPT_DEFS += -DBLUEFRUIT + #opt_defs for alternate pin usage + OPT_DEFS += -DBLUEFRUIT + #Adafruit Bluefruit controller settings + BLUETOOTH = AdafruitBLE + BLUETOOTH_ENABLE = yes + F_CPU = 8000000 + CONSOLE_ENABLE = no # Console for debug(+400) + COMMAND_ENABLE = no # Commands for debug and configuration + RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow endif \ No newline at end of file diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index 3878e6d31c..e5051f9ee6 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -73,9 +73,9 @@ void CAD_finished (qk_tap_dance_state_t *state, void *user_data) { //register_code(KC_NO); //take a screenshot of a single window, open Paint and paste SEND_STRING(SS_LALT(SS_TAP(X_PSCREEN)) SS_LGUI("r")); - _delay_ms(500); + wait_ms(500); SEND_STRING("mspaint" SS_TAP(X_ENTER)); - _delay_ms(700); + wait_ms(700); SEND_STRING(SS_LCTRL("v")); break; //register this keycode when button is held case DOUBLE_TAP: diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index 9e0cf3ee5d..c2644cd6c4 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -1,5 +1,4 @@ -#ifndef USERSPACE -#define USERSPACE +#pragma once #include "quantum.h" @@ -32,7 +31,6 @@ enum userspace_layers { #elif KEYBOARD_xd75 enum userspace_layers { GK75 = 0, - PAD, QW75, SUB75, SUP75, @@ -43,6 +41,7 @@ enum userspace_layers { gGK, _GK, _QW, + PAD, ONE, SUB, SUP, @@ -54,7 +53,7 @@ enum userspace_layers { gETC, GK50, }; -#elif KEYBOARD_5x5 +#elif KEYBOARD_40percentclub_5x5 enum userspace_layers { GK50 = 0, gNUM, @@ -82,8 +81,8 @@ enum userspace_layers { #else enum userspace_layers { _GK = 0, - PAD, _QW, + PAD, ONE, SUB, SUP, @@ -156,11 +155,11 @@ enum { #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_3x10_wrapper(...) LAYOUT_ortho_3x10(__VA_ARGS__) -#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) -#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) #define LAYOUT_ortho_4x4_wrapper(...) LAYOUT_ortho_4x4(__VA_ARGS__) +#define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) #define LAYOUT_ortho_5x5_wrapper(...) LAYOUT_ortho_5x5(__VA_ARGS__) +#define LAYOUT_ortho_5x10_wrapper(...) LAYOUT_ortho_5x10(__VA_ARGS__) +#define LAYOUT_ortho_5x15_wrapper(...) LAYOUT_ortho_5x15(__VA_ARGS__) // Blocks for each of the major keyboard layouts // Organized so we can quickly adapt and modify all of them @@ -229,7 +228,7 @@ enum { /* Gherkin-Like * .-----------------------------------------------------------------------------------------------------------. - * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | + * | ESC | Q//ESC | W | E | R | T | Y | U | I | O | P | BSPC | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | TAB | A | S | D | F | G | H | J | K | L | SPACE | ' | * | | | | | | | | | | |SFThold | | @@ -361,4 +360,3 @@ enum { #define _______________NUMPAD_Row__1_______________ KC_KP_4, KC_KP_5, KC_KP_6, KC_SPC #define _______________NUMPAD_Row__2_______________ KC_KP_1, KC_KP_2, KC_KP_3, KC_PENT #define _______________NUMPAD_Row__3_______________ KC_KP_0, TD(LYR_TAP_DANCE), KC_KP_DOT, KC_PMNS -#endif // !USERSPACE -- cgit v1.2.3 From d6b7ca04f22e3f1e0f9ce4074f3902fddba338ad Mon Sep 17 00:00:00 2001 From: fauxpark Date: Wed, 5 Dec 2018 11:14:55 +1100 Subject: Only try to read the report ID from SetReport when the keyboard is part of the shared EP Fixes #4471 Fixes #4517 --- tmk_core/protocol/lufa/lufa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index e88e6f34aa..27cf51b161 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -517,7 +517,7 @@ void EVENT_USB_Device_ControlRequest(void) if (USB_DeviceState == DEVICE_STATE_Unattached) return; } -#if defined(SHARED_EP_ENABLE) +#ifdef KEYBOARD_SHARED_EP uint8_t report_id = REPORT_ID_KEYBOARD; if (keyboard_protocol) { report_id = Endpoint_Read_8(); -- cgit v1.2.3 From d115abfd8d1e2a7e34cc7809165e413efc1eb9ce Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Wed, 5 Dec 2018 09:02:26 -0800 Subject: Keyboard: Add dz60 tsangan hhkb (#4529) * Add tsangan bottom row hhkb layout for dz60 * Add crd's tsangan hhkb layout for dz60 * Resort to native key aliases when they exist * Update crd's dz60 ansi keymap to match updates for hhkb fn layer * Add tsangan hhkb layout to dz60 info.json for KLE * Fix JSON nesting in dz60 layouts block * Minor adjustments to crd layouts to make them more consistent * Update layout naming to 60_tsangan_hhkb --- keyboards/dz60/dz60.h | 26 +++++++++++++ keyboards/dz60/info.json | 4 ++ keyboards/dz60/keymaps/crd_ansi/keymap.c | 43 ++++++++++++---------- keyboards/dz60/keymaps/crd_tsangan/keymap.c | 30 +++++++++++++++ .../keymap.c | 21 ----------- .../60_ansi_tsangan_split_bs_rshift/layout.json | 5 --- .../60_ansi_tsangan_split_bs_rshift/readme.md | 3 -- .../default_60_tsangan_hhkb/keymap.c | 21 +++++++++++ layouts/default/60_tsangan_hhkb/layout.json | 5 +++ layouts/default/60_tsangan_hhkb/readme.md | 3 ++ 10 files changed, 113 insertions(+), 48 deletions(-) create mode 100644 keyboards/dz60/keymaps/crd_tsangan/keymap.c delete mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c delete mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json delete mode 100644 layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md create mode 100644 layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c create mode 100644 layouts/default/60_tsangan_hhkb/layout.json create mode 100644 layouts/default/60_tsangan_hhkb/readme.md diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 62f6338cd4..50e80bed8f 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -332,5 +332,31 @@ { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_tsangan_hhkb + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │40 │41 │43 │46 (7u) │4b │4d │4e │ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ +#define LAYOUT_60_tsangan_hhkb( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0d, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \ +} #endif diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index 9ec7274531..d1139fd1fe 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -52,6 +52,10 @@ "LAYOUT_60_b_iso": { "key_count": 67, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] + }, + "LAYOUT_60_tsangan_hhkb": { + "key_count": 62, + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] } } } diff --git a/keyboards/dz60/keymaps/crd_ansi/keymap.c b/keyboards/dz60/keymaps/crd_ansi/keymap.c index eac0f1e84c..52d1756be2 100644 --- a/keyboards/dz60/keymaps/crd_ansi/keymap.c +++ b/keyboards/dz60/keymaps/crd_ansi/keymap.c @@ -1,25 +1,30 @@ #include QMK_KEYBOARD_H +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNLT LT(_FL, KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_60_ansi( - 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_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, - 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, KC_ENT, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_UP), - MO(1), KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, RGUI_T(KC_LEFT), RALT_T(KC_DOWN), LT(2, KC_RIGHT) - ), - LAYOUT_60_ansi( - 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_DEL, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + [_BL] = LAYOUT_60_ansi( + 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_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_CTES, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_FNLT, KC_RADN, KC_RCRT ), - LAYOUT_60_ansi( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + [_FL] =LAYOUT_60_ansi( + 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_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/dz60/keymaps/crd_tsangan/keymap.c b/keyboards/dz60/keymaps/crd_tsangan/keymap.c new file mode 100644 index 0000000000..320de07a17 --- /dev/null +++ b/keyboards/dz60/keymaps/crd_tsangan/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_RGLT RGUI_T(KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_tsangan_hhkb( + 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_BSLS, KC_ESC, + 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_BSPC, + KC_CTES, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, MO(_FL), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_tsangan_hhkb( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, RESET, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c b/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c deleted file mode 100644 index 17b47eecf9..0000000000 --- a/layouts/default/60_ansi_tsangan_split_bs_rshift/default_60_ansi_tsangan_split_bs_rshift/keymap.c +++ /dev/null @@ -1,21 +0,0 @@ -#include QMK_KEYBOARD_H - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT_60_ansi_tsangan_split_bs_rshift( - 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_BSPC, - 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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT ,KC_RSFT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL - ) -}; - -// Runs just one time when the keyboard initializes. -void matrix_init_user(void) { - -}; - -// Runs constantly in the background, in a loop. -void matrix_scan_user(void) { - -}; diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json b/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json deleted file mode 100644 index 117d26d419..0000000000 --- a/layouts/default/60_ansi_tsangan_split_bs_rshift/layout.json +++ /dev/null @@ -1,5 +0,0 @@ -[{a:7},"","","","","","","","","","","","","","",""], -[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], -[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], -[{w:2.25},"","","","","","","","","","","",{w:1.75},"",{w:1},""], -[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md b/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md deleted file mode 100644 index ad1c598b34..0000000000 --- a/layouts/default/60_ansi_tsangan_split_bs_rshift/readme.md +++ /dev/null @@ -1,3 +0,0 @@ -# 60_ansi_tsangan_split_bs_rshift - - LAYOUT_60_ansi_tsangan_split_bs_rshift \ No newline at end of file diff --git a/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c new file mode 100644 index 0000000000..c9c8313298 --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/default_60_tsangan_hhkb/keymap.c @@ -0,0 +1,21 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_60_tsangan_hhkb( + 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_BSPC, + 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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, KC_SLSH, KC_RSFT ,KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ) +}; + +// Runs just one time when the keyboard initializes. +void matrix_init_user(void) { + +}; + +// Runs constantly in the background, in a loop. +void matrix_scan_user(void) { + +}; diff --git a/layouts/default/60_tsangan_hhkb/layout.json b/layouts/default/60_tsangan_hhkb/layout.json new file mode 100644 index 0000000000..117d26d419 --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/layout.json @@ -0,0 +1,5 @@ +[{a:7},"","","","","","","","","","","","","","",""], +[{w:1.5},"","","","","","","","","","","","","",{w:1.5},""], +[{w:1.75},"","","","","","","","","","","","",{w:2.25},""], +[{w:2.25},"","","","","","","","","","","",{w:1.75},"",{w:1},""], +[{w:1.5},"",{w:1},"",{w:1.5},"",{w:7},"",{w:1.5},"",{w:1},"",{w:1.5},""] diff --git a/layouts/default/60_tsangan_hhkb/readme.md b/layouts/default/60_tsangan_hhkb/readme.md new file mode 100644 index 0000000000..f1e955f1e7 --- /dev/null +++ b/layouts/default/60_tsangan_hhkb/readme.md @@ -0,0 +1,3 @@ +# 60_tsangan_hhkb + + LAYOUT_60_tsangan_hhkb \ No newline at end of file -- cgit v1.2.3 From 7d4955b2c453828ab8ba315720ce73e4dae0a0c3 Mon Sep 17 00:00:00 2001 From: Jarrett Drouillard Date: Wed, 5 Dec 2018 12:08:05 -0500 Subject: Keymap: Preonic kuatsure updates 2018-Nov (#4500) * preonic-kuatsure: ctrl / esc in one key + hello ` again * preonic-kuatsure: remove esc on lower * preonic-kuatsure: programmy macros * user-kuatsure: turn off console all the time * preonic-kuatsure: auto shift, but only for numbers * preonic-kuatsure: remove programmery macros * preonic-kuatsure: move braces, parens, etc over to raise backwards compat move &*() on lower * preonic-kuatsure: stop with the full rep of game layer --- keyboards/preonic/keymaps/kuatsure/config.h | 3 ++ keyboards/preonic/keymaps/kuatsure/keymap.c | 54 ++++++++++++++++------------- keyboards/preonic/keymaps/kuatsure/rules.mk | 1 + users/kuatsure/kuatsure.h | 2 ++ users/kuatsure/rules.mk | 2 ++ 5 files changed, 38 insertions(+), 24 deletions(-) diff --git a/keyboards/preonic/keymaps/kuatsure/config.h b/keyboards/preonic/keymaps/kuatsure/config.h index ba0ed525e0..bae774211a 100644 --- a/keyboards/preonic/keymaps/kuatsure/config.h +++ b/keyboards/preonic/keymaps/kuatsure/config.h @@ -3,6 +3,9 @@ #include "config_common.h" +#define NO_AUTO_SHIFT_SPECIAL +#define NO_AUTO_SHIFT_ALPHA + #ifdef AUDIO_ENABLE #define STARTUP_SONG SONG(PREONIC_SOUND) // #define STARTUP_SONG SONG(NO_SOUND) diff --git a/keyboards/preonic/keymaps/kuatsure/keymap.c b/keyboards/preonic/keymaps/kuatsure/keymap.c index 63c3937fca..5a7fa40e56 100644 --- a/keyboards/preonic/keymaps/kuatsure/keymap.c +++ b/keyboards/preonic/keymaps/kuatsure/keymap.c @@ -32,17 +32,19 @@ enum preonic_keycodes { GAME_MOD, LOWER, RAISE, + + END_OF_LINE, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | * |------+------+------+------+------+------+------+------+------+------+------+------| * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * | Esc/C| A | S | D | F | G | H | J | K | L | ; | ' | * |------+------+------+------+------+------|------+------+------+------+------+------| * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -50,32 +52,36 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = LAYOUT_preonic_grid_wrapper( \ - KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ + KC_GRV, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ - KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ + KT_CESC, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ KC_LEAD, GAME, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Game + * + * Mostly transparent, but wanted to disable gui key, and give different raise / lower layers ( game_mod ). + * Also give a key to get back to qwerty layout. + * * ,-----------------------------------------------------------------------------------. - * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | Q | W | E | R | T | Y | U | I | O | P | \ | + * | | | | | | | | | | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' | + * | | | | | | | | | | | | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * | | | | | | | | | | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Leader|Qwerty| Alt | Spc |Game+ | Space |Game+ | Left | Down | Up |Right | + * | |Qwerty| | Spc |Game+ | |Game+ | | | | | * `-----------------------------------------------------------------------------------' */ [_GAME] = LAYOUT_preonic_grid_wrapper( \ - KC_ESC, _________________NUMBER_L1_________________, _________________NUMBER_R1_________________, KC_BSPC, \ - KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSLS, \ - KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT, \ - KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, KC_ENT, \ - KC_LEAD, QWERTY, KC_LALT, KC_SPC, GAME_MOD, KC_SPC, KC_SPC, GAME_MOD, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, QWERTY, _______, KC_SPC, GAME_MOD, _______, _______, GAME_MOD, _______, _______, _______, _______ \ ), /* Game Modifiers @@ -101,7 +107,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Lower * ,-----------------------------------------------------------------------------------. - * | ~ | ! | @ | # | $ | % | ^ | < | > | | | | + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | * |------+------+------+------+------+-------------+------+------+------+------+------| * | | | | Up | | ` | | { | } | _ | | | | * |------+------+------+------+------+-------------+------+------+------+------+------| @@ -109,35 +115,35 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------|------+------+------+------+------+------| * | | Vol- | Prev | Play | Next | Vol+ | - | [ | ] | | ? | | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Mute | | | | Esc | | Home | PgUp | PgDwn| End | + * | | Mute | | | | | | Home | PgUp | PgDwn| End | * `-----------------------------------------------------------------------------------' */ [_LOWER] = LAYOUT_preonic_grid_wrapper( \ - KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_LT, KC_GT, _______, _______, _______, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ _______, _______, _______, KC_UP, _______, KC_GRV, _______, KC_LCBR, KC_RCBR, KC_UNDS, _______, KC_PIPE, \ _______, KC_DEL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TILD, KC_EQL, KC_LPRN, KC_RPRN, KC_PLUS, KC_COLN, KC_DQT , \ _______, KC_VOLD, KC_MRWD, KC_MPLY, KC_MFFD, KC_VOLU, KC_MINS, KC_LBRC, KC_RBRC, _______, KC_QUES, _______, \ - _______, KC_MUTE, _______, _______, _______, KC_ESC, KC_ESC, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ + _______, KC_MUTE, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ ), /* Raise * ,-----------------------------------------------------------------------------------. * | E`~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | F9 | F10 | F11 | F12 | | | | | | | Bksp | + * | | F9 | F10 | F11 | F12 | | | { | } | | | Bksp | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | F5 | F6 | F7 | F8 | | | | | | | | + * | | F5 | F6 | F7 | F8 | | | ( | ) | < | > | | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | F1 | F2 | F3 | F4 | | | | | | | | + * | | F1 | F2 | F3 | F4 | | | [ | ] | | | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | Enter | | Home | PgUp | PgDwn| End | * `-----------------------------------------------------------------------------------' */ [_RAISE] = LAYOUT_preonic_grid_wrapper( \ KC_GESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ - _______, ____________FUNCTION_3____________, _______, _______, _______, _______, _______, _______, KC_BSPC, \ - _______, ____________FUNCTION_2____________, _______, _______, _______, _______, _______, _______, _______, \ - _______, ____________FUNCTION_1____________, _______, _______, _______, _______, _______, _______, _______, \ + _______, ____________FUNCTION_3____________, _______, _______, KC_LCBR, KC_RCBR, _______, _______, KC_BSPC, \ + _______, ____________FUNCTION_2____________, _______, _______, KC_LPRN, KC_RPRN, KC_LT, KC_GT, _______, \ + _______, ____________FUNCTION_1____________, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, \ _______, _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_HOME, KC_PGUP, KC_PGDN, KC_END \ ), diff --git a/keyboards/preonic/keymaps/kuatsure/rules.mk b/keyboards/preonic/keymaps/kuatsure/rules.mk index 9369f99a9e..4aacc70513 100644 --- a/keyboards/preonic/keymaps/kuatsure/rules.mk +++ b/keyboards/preonic/keymaps/kuatsure/rules.mk @@ -1,2 +1,3 @@ BACKLIGHT_ENABLE = no LEADER_ENABLE = yes +AUTO_SHIFT_ENABLE = yes diff --git a/users/kuatsure/kuatsure.h b/users/kuatsure/kuatsure.h index 56fb684ec0..23d3c617cb 100644 --- a/users/kuatsure/kuatsure.h +++ b/users/kuatsure/kuatsure.h @@ -8,6 +8,8 @@ void tmux_pane_zoom(void); void tmux_pane_switch(uint16_t keycode); void tmux_window_switch(uint16_t keycode); +#define KT_CESC CTL_T(KC_ESC) + #undef LEADER_TIMEOUT #define LEADER_TIMEOUT 300 diff --git a/users/kuatsure/rules.mk b/users/kuatsure/rules.mk index 11262d0ecf..f0d295aad0 100644 --- a/users/kuatsure/rules.mk +++ b/users/kuatsure/rules.mk @@ -1 +1,3 @@ +CONSOLE_ENABLE = no + SRC += kuatsure.c -- cgit v1.2.3 From d0da43fbdcb78603b34bcf6c0718e104b593c5ce Mon Sep 17 00:00:00 2001 From: Nicholas Shaff Date: Wed, 5 Dec 2018 11:35:26 -0600 Subject: Keyboard: Updated sixshooter keyboard to move LED macros into the default keymap. (#4428) --- keyboards/sixshooter/keymaps/default/keymap.c | 39 ++++++++++++++++++++++++--- keyboards/sixshooter/sixshooter.c | 19 ------------- keyboards/sixshooter/sixshooter.h | 11 -------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/keyboards/sixshooter/keymaps/default/keymap.c b/keyboards/sixshooter/keymaps/default/keymap.c index ca0973c60b..51f115d935 100644 --- a/keyboards/sixshooter/keymaps/default/keymap.c +++ b/keyboards/sixshooter/keymaps/default/keymap.c @@ -18,10 +18,16 @@ #define _BL 0 #define _FN 1 +// Define keyboard specific keycodes for controlling on/off for all LEDs as they +// are all on different pins with this PCB, rather than a single backlight pin +enum custom_keycodes { + SS_LON = SAFE_RANGE, + SS_LOFF +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Keymap 0: Media Keys + /* Base Layer: Media Keys * ,-----------. - * |Mut| V-| V+| + * |FN | V-| V+| * |---+---+---| * |Prv|Ply|Nxt| * `-----------' @@ -30,13 +36,38 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MO(_FN), KC_VOLD, KC_VOLU, \ KC_MPRV, KC_MPLY, KC_MNXT \ ), + /* FN Layer: LED control + * ,-----------. + * |FN | V-| V+| + * |---+---+---| + * |Prv|Ply|Nxt| + * `-----------' + */ [_FN] = LAYOUT( KC_TRNS, SS_LON, SS_LOFF, \ - KC_TRNS, KC_TRNS, KC_TRNS + KC_NO, KC_NO, KC_NO ), }; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + // Put your per-action keyboard code here. + // Runs for every action, just before processing by the firmware. + if (record->event.pressed) { + + // Check for custom keycodes for turning on and off LEDs + switch(keycode) { + case SS_LON: + sixshooter_led_all_on(); + return false; + case SS_LOFF: + sixshooter_led_all_off(); + return false; + } + } + return true; +}; + void matrix_init_user(void) { - /* Default all LEDs to on */ + // Default all LEDs to on sixshooter_led_all_on(); } diff --git a/keyboards/sixshooter/sixshooter.c b/keyboards/sixshooter/sixshooter.c index 814d219a29..87a739454d 100644 --- a/keyboards/sixshooter/sixshooter.c +++ b/keyboards/sixshooter/sixshooter.c @@ -31,25 +31,6 @@ void matrix_scan_kb(void) { matrix_scan_user(); } -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - if (record->event.pressed) { - - /* Check for custom keycodes for turning on and off LEDs */ - switch(keycode) { - case SS_LON: - sixshooter_led_all_on(); - return false; - case SS_LOFF: - sixshooter_led_all_off(); - return false; - } - } - - return process_record_user(keycode, record); -} - void led_set_kb(uint8_t usb_led) { // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here diff --git a/keyboards/sixshooter/sixshooter.h b/keyboards/sixshooter/sixshooter.h index d27b1e419c..490d562d06 100644 --- a/keyboards/sixshooter/sixshooter.h +++ b/keyboards/sixshooter/sixshooter.h @@ -10,17 +10,6 @@ { K00, K01, K02, K03, K04, K05 }, \ } - -/* - * Define keyboard specific keycodes for controlling on/off for all LEDs as they - * are all on different pins with this PCB, rather than a single backlight pin - */ -enum keyboard_keycode { - SS_LON = SAFE_RANGE, - SS_LOFF, - SAFE_RANGE_KB -}; - inline void sixshooter_led_0_on(void) { DDRB |= (1<<6); PORTB |= (1<<6); } inline void sixshooter_led_1_on(void) { DDRC |= (1<<7); PORTC |= (1<<7); } inline void sixshooter_led_2_on(void) { DDRD |= (1<<0); PORTD |= (1<<0); } -- cgit v1.2.3 From b3d6426aa95a895585b41b9cd6c0c5bec39f0e92 Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 5 Dec 2018 17:51:35 +0000 Subject: Keyboard: Refactor lets split to use split common code (#4536) * Refactor lets split to use split common code * Refactor lets split to use split common code * Build fixes for OLED_sample keymap * Build fixes for OLED_sample keymap - attempt to reduce firmware size --- keyboards/lets_split/config.h | 5 +- keyboards/lets_split/eeprom-lefthand.eep | 2 - keyboards/lets_split/eeprom-righthand.eep | 2 - keyboards/lets_split/i2c.c | 162 -------- keyboards/lets_split/i2c.h | 49 --- keyboards/lets_split/keymaps/OLED_sample/rules.mk | 17 +- keyboards/lets_split/lets_split.h | 5 +- keyboards/lets_split/matrix.c | 470 ---------------------- keyboards/lets_split/rev1/config.h | 7 +- keyboards/lets_split/rev1/rev1.h | 5 +- keyboards/lets_split/rev2/config.h | 8 +- keyboards/lets_split/rev2/rev2.h | 5 +- keyboards/lets_split/rules.mk | 16 +- keyboards/lets_split/serial.c | 228 ----------- keyboards/lets_split/serial.h | 26 -- keyboards/lets_split/sockets/config.h | 8 +- keyboards/lets_split/sockets/sockets.h | 5 +- keyboards/lets_split/split_util.c | 86 ---- keyboards/lets_split/split_util.h | 20 - 19 files changed, 19 insertions(+), 1107 deletions(-) delete mode 100644 keyboards/lets_split/eeprom-lefthand.eep delete mode 100644 keyboards/lets_split/eeprom-righthand.eep delete mode 100644 keyboards/lets_split/i2c.c delete mode 100644 keyboards/lets_split/i2c.h delete mode 100644 keyboards/lets_split/matrix.c delete mode 100644 keyboards/lets_split/serial.c delete mode 100644 keyboards/lets_split/serial.h delete mode 100644 keyboards/lets_split/split_util.c delete mode 100644 keyboards/lets_split/split_util.h diff --git a/keyboards/lets_split/config.h b/keyboards/lets_split/config.h index c910d8f24f..cfb6bf4ffc 100644 --- a/keyboards/lets_split/config.h +++ b/keyboards/lets_split/config.h @@ -16,9 +16,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" - -#endif diff --git a/keyboards/lets_split/eeprom-lefthand.eep b/keyboards/lets_split/eeprom-lefthand.eep deleted file mode 100644 index bda23cdb6e..0000000000 --- a/keyboards/lets_split/eeprom-lefthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000001F0 -:00000001FF diff --git a/keyboards/lets_split/eeprom-righthand.eep b/keyboards/lets_split/eeprom-righthand.eep deleted file mode 100644 index 549cd1ef0a..0000000000 --- a/keyboards/lets_split/eeprom-righthand.eep +++ /dev/null @@ -1,2 +0,0 @@ -:0F000000000000000000000000000000000000F1 -:00000001FF diff --git a/keyboards/lets_split/i2c.c b/keyboards/lets_split/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/lets_split/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/lets_split/keymaps/OLED_sample/rules.mk b/keyboards/lets_split/keymaps/OLED_sample/rules.mk index a14e84d4e5..89ad61fbe8 100644 --- a/keyboards/lets_split/keymaps/OLED_sample/rules.mk +++ b/keyboards/lets_split/keymaps/OLED_sample/rules.mk @@ -1,25 +1,22 @@ +SRC += ssd1306.c # 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # 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 +COMMAND_ENABLE = no # 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 controls 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 = yes # Enable WS2812 RGB underlight. -SWAP_HANDS_ENABLE = no # Enable one-hand typing +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +SWAP_HANDS_ENABLE = no # Enable one-hand typing # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif \ No newline at end of file diff --git a/keyboards/lets_split/lets_split.h b/keyboards/lets_split/lets_split.h index bce0ecb199..9c46f382d1 100644 --- a/keyboards/lets_split/lets_split.h +++ b/keyboards/lets_split/lets_split.h @@ -1,5 +1,4 @@ -#ifndef LETS_SPLIT_H -#define LETS_SPLIT_H +#pragma once #include "quantum.h" @@ -27,5 +26,3 @@ ) #define LAYOUT_kc_ortho_4x12 LAYOUT_kc - -#endif diff --git a/keyboards/lets_split/matrix.c b/keyboards/lets_split/matrix.c deleted file mode 100644 index f753d234a1..0000000000 --- a/keyboards/lets_split/matrix.c +++ /dev/null @@ -1,470 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -__attribute__ ((weak)) -void matrix_slave_scan_user(void) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ -#ifdef DISABLE_JTAG - // JTAG disable for PORT F. write JTD bit twice within four cycles. - MCUCR |= (1< 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } -#endif - matrix_slave_scan_user(); -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index c0e4d1fbce..a8d6149154 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -80,5 +77,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - -#endif diff --git a/keyboards/lets_split/rev1/rev1.h b/keyboards/lets_split/rev1/rev1.h index 073d83ef34..a43d4a25ba 100644 --- a/keyboards/lets_split/rev1/rev1.h +++ b/keyboards/lets_split/rev1/rev1.h @@ -1,5 +1,4 @@ -#ifndef REV1_H -#define REV1_H +#pragma once #include "lets_split.h" @@ -26,5 +25,3 @@ } #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 1ff25cd480..8844e5bb81 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV2_CONFIG_H -#define REV2_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xFEED @@ -80,6 +77,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/lets_split/rev2/rev2.h b/keyboards/lets_split/rev2/rev2.h index bf25ee8568..34e64e89f1 100644 --- a/keyboards/lets_split/rev2/rev2.h +++ b/keyboards/lets_split/rev2/rev2.h @@ -1,5 +1,4 @@ -#ifndef REV2_H -#define REV2_H +#pragma once #include "lets_split.h" @@ -58,5 +57,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/rules.mk b/keyboards/lets_split/rules.mk index 4cd972786f..f9d1a0dadb 100644 --- a/keyboards/lets_split/rules.mk +++ b/keyboards/lets_split/rules.mk @@ -1,11 +1,4 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c \ - ssd1306.c - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -42,7 +35,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -64,13 +57,12 @@ MIDI_ENABLE = no # MIDI controls 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. -SUBPROJECT_rev1 = yes -USE_I2C = yes +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes LAYOUTS = ortho_4x12 diff --git a/keyboards/lets_split/serial.c b/keyboards/lets_split/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/lets_split/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/lets_split/serial.h b/keyboards/lets_split/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/lets_split/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index a45cdd13bb..10d0c997e6 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef SOCKETS_CONFIG_H -#define SOCKETS_CONFIG_H - -#include "config_common.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xBEE5 @@ -85,6 +82,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/lets_split/sockets/sockets.h b/keyboards/lets_split/sockets/sockets.h index bd1019263c..a79770bac6 100644 --- a/keyboards/lets_split/sockets/sockets.h +++ b/keyboards/lets_split/sockets/sockets.h @@ -1,5 +1,4 @@ -#ifndef SOCKETS_H -#define SOCKETS_H +#pragma once #define DISABLE_JTAG // The keyboard uses PF4 and PF7, which are used by JTAG. #include "lets_split.h" @@ -59,5 +58,3 @@ #endif #define LAYOUT_ortho_4x12 LAYOUT - -#endif diff --git a/keyboards/lets_split/split_util.c b/keyboards/lets_split/split_util.c deleted file mode 100644 index 346cbc9089..0000000000 --- a/keyboards/lets_split/split_util.c +++ /dev/null @@ -1,86 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - #ifdef EE_HANDS - isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); - #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) - isLeftHand = !has_usb(); - #else - isLeftHand = has_usb(); - #endif - #endif -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init (); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif -- cgit v1.2.3 From 59b2be6200e13166cf69ae04aa7a05ec5e837d79 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 5 Dec 2018 10:28:06 -0800 Subject: Re-order feature list in sidebar (#4555) Specifically, moved the shifted keycodes to the top of the 'Feature' list, so it's more visible. This way, all of the keycodes are at the top of the list, rather than having the shifted keys at the bottom, so they should be easier to find since they're all in one place. --- docs/_sidebar.md | 2 +- docs/_summary.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 1fb5398d93..6338d69121 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -43,6 +43,7 @@ * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) @@ -74,7 +75,6 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) diff --git a/docs/_summary.md b/docs/_summary.md index 1fb5398d93..6338d69121 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -43,6 +43,7 @@ * [Features](features.md) * [Basic Keycodes](keycodes_basic.md) + * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * [Quantum Keycodes](quantum_keycodes.md) * [Advanced Keycodes](feature_advanced_keycodes.md) * [Audio](feature_audio.md) @@ -74,7 +75,6 @@ * [Thermal Printer](feature_thermal_printer.md) * [Unicode](feature_unicode.md) * [Userspace](feature_userspace.md) - * [US ANSI Shifted Keys](keycodes_us_ansi_shifted.md) * For Makers and Modders * [Hand Wiring Guide](hand_wire.md) -- cgit v1.2.3 From ff3369ac5d52af5ad046cd526d13963fda5cab89 Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Wed, 5 Dec 2018 14:13:52 -0600 Subject: Changed location of mouse 3, and arrow keys (#4556) --- keyboards/iris/keymaps/vyolle/keymap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/keyboards/iris/keymaps/vyolle/keymap.c b/keyboards/iris/keymaps/vyolle/keymap.c index 66bcaa385c..2479f08928 100644 --- a/keyboards/iris/keymaps/vyolle/keymap.c +++ b/keyboards/iris/keymaps/vyolle/keymap.c @@ -38,9 +38,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ KC_VOLU, KC_HOME, KC_LEFT, KC_UP, KC_RGHT, KC_PGUP, KC_WH_U, KC_MS_L, KC_MS_U, KC_MS_R, XXXXXXX, KC_BTN4, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, XXXXXXX, KC_WH_D, KC_WH_L, KC_MS_D, KC_WH_R, XXXXXXX, KC_BTN5, + KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, XXXXXXX, KC_WH_D, KC_WH_L, KC_MS_D, KC_WH_R, KC_BTN3, KC_BTN5, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, KC_BTN1, KC_BTN2, KC_BTN3 + _______, _______, _______, KC_BTN1, KC_BTN2, _______ // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), @@ -50,9 +50,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ KC_TILD, KC_PIPE, KC_LT, KC_GT, _______, _______, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, _______, + KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, _______, KC_LEFT, KC_UP, KC_RGHT, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_COLN, KC_UNDS, KC_LPRN, KC_PLUS, KC_RPRN, KC_EQL, KC_UNDO, _______, _______, _______, _______, _______, _______, _______, + KC_COLN, KC_UNDS, KC_LPRN, KC_PLUS, KC_RPRN, KC_EQL, KC_UNDO, _______, _______, _______, KC_DOWN, _______, _______, _______, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ KC_CUT, KC_COPY, KC_PSTE, _______, _______, _______ // └────────┴────────┴────────┘ └────────┴────────┴────────┘ -- cgit v1.2.3 From 161afe2e54e14b210b30539bd8a100471bcdf2c3 Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 5 Dec 2018 21:12:07 +0000 Subject: Keyboard: Fixes for superseded audio and default layer functionality (#4557) --- keyboards/lets_split/keymaps/default/config.h | 13 +++-- keyboards/lets_split/keymaps/default/keymap.c | 70 ++++----------------------- keyboards/lets_split/keymaps/default/rules.mk | 3 -- 3 files changed, 15 insertions(+), 71 deletions(-) diff --git a/keyboards/lets_split/keymaps/default/config.h b/keyboards/lets_split/keymaps/default/config.h index 5a6261c4f7..60e23f816d 100644 --- a/keyboards/lets_split/keymaps/default/config.h +++ b/keyboards/lets_split/keymaps/default/config.h @@ -18,20 +18,19 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" + // place overrides here +#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } /* Use I2C or Serial, not both */ - #define USE_SERIAL // #define USE_I2C /* Select hand configuration */ - #define MASTER_LEFT // #define MASTER_RIGHT // #define EE_HANDS - -#endif diff --git a/keyboards/lets_split/keymaps/default/keymap.c b/keyboards/lets_split/keymaps/default/keymap.c index f782781843..05f9bda8d8 100644 --- a/keyboards/lets_split/keymaps/default/keymap.c +++ b/keyboards/lets_split/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; - // 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 @@ -16,15 +14,12 @@ extern keymap_config_t keymap_config; enum custom_keycodes { QWERTY = SAFE_RANGE, COLEMAK, - DVORAK, - LOWER, - RAISE, - ADJUST, + DVORAK }; -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define ADJUST MO(_ADJUST) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -138,74 +133,27 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -#ifdef AUDIO_ENABLE -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_dvorak[][2] = SONG(DVORAK_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - persistent_default_layer_set(1UL<<_QWERTY); + set_single_persistent_default_layer(_QWERTY); } return false; - break; case COLEMAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - persistent_default_layer_set(1UL<<_COLEMAK); + set_single_persistent_default_layer(_COLEMAK); } return false; - break; case DVORAK: if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); - #endif - persistent_default_layer_set(1UL<<_DVORAK); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); + set_single_persistent_default_layer(_DVORAK); } return false; - break; } return true; } diff --git a/keyboards/lets_split/keymaps/default/rules.mk b/keyboards/lets_split/keymaps/default/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/lets_split/keymaps/default/rules.mk +++ b/keyboards/lets_split/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif -- cgit v1.2.3 From 368de26996fbd54eefbf54c567a90bf0d81e20c7 Mon Sep 17 00:00:00 2001 From: zvecr Date: Wed, 5 Dec 2018 21:56:43 +0000 Subject: Keyboard: Initial i75 port (#4553) * Initial i75 port - currently supporting promicro and teensy2 * Initial i75 port - review fixes --- keyboards/40percentclub/i75/config.h | 192 +++++++++++++++++++++ keyboards/40percentclub/i75/i75.c | 43 +++++ keyboards/40percentclub/i75/i75.h | 24 +++ keyboards/40percentclub/i75/info.json | 12 ++ .../40percentclub/i75/keymaps/default/config.h | 19 ++ .../40percentclub/i75/keymaps/default/keymap.c | 66 +++++++ .../40percentclub/i75/keymaps/default/readme.md | 1 + keyboards/40percentclub/i75/promicro/config.h | 40 +++++ keyboards/40percentclub/i75/promicro/promicro.c | 16 ++ keyboards/40percentclub/i75/promicro/promicro.h | 47 +++++ keyboards/40percentclub/i75/promicro/rules.mk | 58 +++++++ keyboards/40percentclub/i75/readme.md | 28 +++ keyboards/40percentclub/i75/rules.mk | 23 +++ keyboards/40percentclub/i75/teensy2/config.h | 40 +++++ keyboards/40percentclub/i75/teensy2/rules.mk | 58 +++++++ keyboards/40percentclub/i75/teensy2/teensy2.c | 16 ++ keyboards/40percentclub/i75/teensy2/teensy2.h | 47 +++++ 17 files changed, 730 insertions(+) create mode 100644 keyboards/40percentclub/i75/config.h create mode 100644 keyboards/40percentclub/i75/i75.c create mode 100644 keyboards/40percentclub/i75/i75.h create mode 100644 keyboards/40percentclub/i75/info.json create mode 100644 keyboards/40percentclub/i75/keymaps/default/config.h create mode 100644 keyboards/40percentclub/i75/keymaps/default/keymap.c create mode 100644 keyboards/40percentclub/i75/keymaps/default/readme.md create mode 100644 keyboards/40percentclub/i75/promicro/config.h create mode 100644 keyboards/40percentclub/i75/promicro/promicro.c create mode 100644 keyboards/40percentclub/i75/promicro/promicro.h create mode 100644 keyboards/40percentclub/i75/promicro/rules.mk create mode 100644 keyboards/40percentclub/i75/readme.md create mode 100644 keyboards/40percentclub/i75/rules.mk create mode 100644 keyboards/40percentclub/i75/teensy2/config.h create mode 100644 keyboards/40percentclub/i75/teensy2/rules.mk create mode 100644 keyboards/40percentclub/i75/teensy2/teensy2.c create mode 100644 keyboards/40percentclub/i75/teensy2/teensy2.h diff --git a/keyboards/40percentclub/i75/config.h b/keyboards/40percentclub/i75/config.h new file mode 100644 index 0000000000..bc032ba455 --- /dev/null +++ b/keyboards/40percentclub/i75/config.h @@ -0,0 +1,192 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0A0C +#define DEVICE_VER 0x0175 +#define MANUFACTURER di0ib +#define PRODUCT i75 +#define DESCRIPTION i75 15x5 ortholinear keyboard + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display + +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode + +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/40percentclub/i75/i75.c b/keyboards/40percentclub/i75/i75.c new file mode 100644 index 0000000000..7efe3b4549 --- /dev/null +++ b/keyboards/40percentclub/i75/i75.c @@ -0,0 +1,43 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "i75.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} diff --git a/keyboards/40percentclub/i75/i75.h b/keyboards/40percentclub/i75/i75.h new file mode 100644 index 0000000000..a31c9f6e6f --- /dev/null +++ b/keyboards/40percentclub/i75/i75.h @@ -0,0 +1,24 @@ +/* Copyright 2018 + * + * 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 + +#include "quantum.h" + +#ifdef KEYBOARD_40percentclub_i75_promicro + #include "promicro.h" +#elif KEYBOARD_40percentclub_i75_teensy2 + #include "teensy2.h" +#endif diff --git a/keyboards/40percentclub/i75/info.json b/keyboards/40percentclub/i75/info.json new file mode 100644 index 0000000000..033bf02bcc --- /dev/null +++ b/keyboards/40percentclub/i75/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "i75", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x15": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":4, "y":1}, {"x":5, "y":1}, {"x":6, "y":1}, {"x":7, "y":1}, {"x":8, "y":1}, {"x":9, "y":1}, {"x":10, "y":1}, {"x":11, "y":1}, {"x":12, "y":1}, {"x":13, "y":1}, {"x":14, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":4, "y":2}, {"x":5, "y":2}, {"x":6, "y":2}, {"x":7, "y":2}, {"x":8, "y":2}, {"x":9, "y":2}, {"x":10, "y":2}, {"x":11, "y":2}, {"x":12, "y":2}, {"x":13, "y":2}, {"x":14, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":4, "y":3}, {"x":5, "y":3}, {"x":6, "y":3}, {"x":7, "y":3}, {"x":8, "y":3}, {"x":9, "y":3}, {"x":10, "y":3}, {"x":11, "y":3}, {"x":12, "y":3}, {"x":13, "y":3}, {"x":14, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}, {"x":4, "y":4}, {"x":5, "y":4}, {"x":6, "y":4}, {"x":7, "y":4}, {"x":8, "y":4}, {"x":9, "y":4}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}] + } + } +} diff --git a/keyboards/40percentclub/i75/keymaps/default/config.h b/keyboards/40percentclub/i75/keymaps/default/config.h new file mode 100644 index 0000000000..6173b63272 --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 + * + * 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 + +// place overrides here diff --git a/keyboards/40percentclub/i75/keymaps/default/keymap.c b/keyboards/40percentclub/i75/keymaps/default/keymap.c new file mode 100644 index 0000000000..3054f8ebe5 --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/keymap.c @@ -0,0 +1,66 @@ +/* Copyright 2018 + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Defines the keycodes used by our macros in process_record_user +enum custom_keycodes { + QMKBEST = SAFE_RANGE, + QMKURL +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ortho_5x15( \ + KC_ESC, 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_BSLS, KC_GRV, \ + 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_BSPC, KC_DEL, \ + 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_ENT, KC_PGUP, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_RSFT, KC_UP, KC_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RCTL, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + } + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/40percentclub/i75/keymaps/default/readme.md b/keyboards/40percentclub/i75/keymaps/default/readme.md new file mode 100644 index 0000000000..4d054181fb --- /dev/null +++ b/keyboards/40percentclub/i75/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for i75 diff --git a/keyboards/40percentclub/i75/promicro/config.h b/keyboards/40percentclub/i75/promicro/config.h new file mode 100644 index 0000000000..bc9146328e --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/config.h @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { B4, E6, D7, C6, D4, D0, D1, D2, D3 } +#define MATRIX_COL_PINS { B5, B6, B2, B3, B1, F7, F6, F5, F4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/i75/promicro/promicro.c b/keyboards/40percentclub/i75/promicro/promicro.c new file mode 100644 index 0000000000..28684e7144 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/promicro.c @@ -0,0 +1,16 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "i75.h" diff --git a/keyboards/40percentclub/i75/promicro/promicro.h b/keyboards/40percentclub/i75/promicro/promicro.h new file mode 100644 index 0000000000..29394855a6 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/promicro.h @@ -0,0 +1,47 @@ +/* Copyright 2018 + * + * 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 + +#include "i75.h" +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, \ + K33, K34, K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, K64, K65, \ + K66, K67, K68, K70, K71, K72, K73, K74, K75, K76, K77, K78, K80, K81, K82 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78 }, \ + { K80, K81, K82 } \ +} diff --git a/keyboards/40percentclub/i75/promicro/rules.mk b/keyboards/40percentclub/i75/promicro/rules.mk new file mode 100644 index 0000000000..dc6f196237 --- /dev/null +++ b/keyboards/40percentclub/i75/promicro/rules.mk @@ -0,0 +1,58 @@ +# MCU name +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 = caterina + + +# 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 diff --git a/keyboards/40percentclub/i75/readme.md b/keyboards/40percentclub/i75/readme.md new file mode 100644 index 0000000000..9bdad68ada --- /dev/null +++ b/keyboards/40percentclub/i75/readme.md @@ -0,0 +1,28 @@ +# i75 + +![i75](https://1.bp.blogspot.com/-eRSwPnvgliI/WCYQ-aYihoI/AAAAAAAB_Bc/a7i1Envc1FYiEHeqvyHw80VxTAnafDsPgCLcB/s320/IMG_20161003_084555.jpg) +=== + +5x15 grid layout, multiple controllers supported +- Pro Micro +- PJRC Teensy 2.0 +- PJRC Teensy LC/3.2 (**NB: Not currently ported**) + +The matrix is a 9x9 grid. This uses all of the available pins on the Pro Micro. The other controllers have pins left over. The serial pins and pins connected to LEDs were avoided if possible. + +* [The original TMK firmware](https://github.com/di0ib/tmk_keyboard/tree/master/keyboard/i75_ProMicro) + +Keyboard Maintainer: QMK Community +Hardware Supported: i75 PCB +Hardware Availability: [i75 project on 40% Keyboards](http://www.40percent.club/2016/11/i75.html) + +Make example for this keyboard (after setting up your build environment): + + make 40percentclub/i75:default + +If you would like to use one of the alternative controllers: + + make 40percentclub/i75/promicro:default + make 40percentclub/i75/teensy2: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/40percentclub/i75/rules.mk b/keyboards/40percentclub/i75/rules.mk new file mode 100644 index 0000000000..6f79143a18 --- /dev/null +++ b/keyboards/40percentclub/i75/rules.mk @@ -0,0 +1,23 @@ +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = lite # 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 = no # 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) + +LAYOUTS = ortho_5x15 +DEFAULT_FOLDER = 40percentclub/i75/promicro diff --git a/keyboards/40percentclub/i75/teensy2/config.h b/keyboards/40percentclub/i75/teensy2/config.h new file mode 100644 index 0000000000..fdbde8d643 --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/config.h @@ -0,0 +1,40 @@ +/* Copyright 2018 + * + * 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 + +#include "config_common.h" + +/* key matrix size */ +#define MATRIX_ROWS 9 +#define MATRIX_COLS 9 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D3, D2, D1, D0, B7, B3, B2, B1, B0 } +#define MATRIX_COL_PINS { C6, C7, D6, D7, B5, B6, F7, F6, F5 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW diff --git a/keyboards/40percentclub/i75/teensy2/rules.mk b/keyboards/40percentclub/i75/teensy2/rules.mk new file mode 100644 index 0000000000..3fb7c7e5a7 --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/rules.mk @@ -0,0 +1,58 @@ +# MCU name +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 diff --git a/keyboards/40percentclub/i75/teensy2/teensy2.c b/keyboards/40percentclub/i75/teensy2/teensy2.c new file mode 100644 index 0000000000..28684e7144 --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/teensy2.c @@ -0,0 +1,16 @@ +/* Copyright 2018 + * + * 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 . + */ +#include "i75.h" diff --git a/keyboards/40percentclub/i75/teensy2/teensy2.h b/keyboards/40percentclub/i75/teensy2/teensy2.h new file mode 100644 index 0000000000..29394855a6 --- /dev/null +++ b/keyboards/40percentclub/i75/teensy2/teensy2.h @@ -0,0 +1,47 @@ +/* Copyright 2018 + * + * 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 + +#include "i75.h" +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT_ortho_5x15( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K10, K11, K12, K13, K14, K15, \ + K16, K17, K18, K20, K21, K22, K23, K24, K25, K26, K27, K28, K30, K31, K32, \ + K33, K34, K35, K36, K37, K38, K40, K41, K42, K43, K44, K45, K46, K47, K48, \ + K50, K51, K52, K53, K54, K55, K56, K57, K58, K60, K61, K62, K63, K64, K65, \ + K66, K67, K68, K70, K71, K72, K73, K74, K75, K76, K77, K78, K80, K81, K82 \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18 }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28 }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38 }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58 }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68 }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, K78 }, \ + { K80, K81, K82 } \ +} -- cgit v1.2.3 From 04de0533b8559c5e8d30508a4a4a786b327d970c Mon Sep 17 00:00:00 2001 From: jtcarrasco <5018598+jtcarrasco@users.noreply.github.com> Date: Wed, 5 Dec 2018 15:13:31 -0800 Subject: Keymap: Jtcarrasco (#4513) * my XD75 builds for idobo and XD75 these are my xd75 layouts for the 2 versions of the board * clearing of free space spring cleaning * additional cleaning more spring cleaning * removed lighting commands don't need lighting on the idobo board so removal of such commands to keep the sizing down * update for readme.md * Update config.h * commiting with keymap erros on idobo for review * syntax fix for idobo and xd75 revok75, addition of del key switch on fn layer * config edit to config user and keymap QMK_KEYBOARD_H * update to vol controls for both idobo and xd75 for revok75 keymap * filename changes --- keyboards/idobo/keymaps/revok75/config.h | 15 ++++++ keyboards/idobo/keymaps/revok75/keymap.c | 90 +++++++++++++++++++++++++++++++ keyboards/idobo/keymaps/revok75/readme.md | 1 + keyboards/idobo/keymaps/revok75/rules.mk | 14 +++++ keyboards/xd75/keymaps/revok75/config.h | 20 +++++++ keyboards/xd75/keymaps/revok75/keymap.c | 90 +++++++++++++++++++++++++++++++ keyboards/xd75/keymaps/revok75/readme.md | 1 + keyboards/xd75/keymaps/revok75/rules.mk | 18 +++++++ 8 files changed, 249 insertions(+) create mode 100644 keyboards/idobo/keymaps/revok75/config.h create mode 100644 keyboards/idobo/keymaps/revok75/keymap.c create mode 100644 keyboards/idobo/keymaps/revok75/readme.md create mode 100644 keyboards/idobo/keymaps/revok75/rules.mk create mode 100644 keyboards/xd75/keymaps/revok75/config.h create mode 100644 keyboards/xd75/keymaps/revok75/keymap.c create mode 100644 keyboards/xd75/keymaps/revok75/readme.md create mode 100644 keyboards/xd75/keymaps/revok75/rules.mk diff --git a/keyboards/idobo/keymaps/revok75/config.h b/keyboards/idobo/keymaps/revok75/config.h new file mode 100644 index 0000000000..f5c4659880 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/config.h @@ -0,0 +1,15 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 . + */ diff --git a/keyboards/idobo/keymaps/revok75/keymap.c b/keyboards/idobo/keymaps/revok75/keymap.c new file mode 100644 index 0000000000..a380240326 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Wunder + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW_M 0 +#define _QW_W 1 +#define _FN 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* QWERTY-Mac + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT| UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_M] = LAYOUT_ortho_5x15( /* QWERTY MAC*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LGUI(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LGUI(KC_C), LGUI(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LGUI(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LGUI(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LGUI(KC_F), LGUI(KC_T), KC_SPC, KC_NO, LALT(KC_SPACE), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* QWERTY-Win + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT | UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | START | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_W] = LAYOUT_ortho_5x15( /* QWERTY WIN*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LCTL(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LCTL(KC_C), LCTL(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LCTL(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LCTL(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_F), LCTL(KC_T), KC_SPC, KC_NO, LCTL(KC_GESC), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* FUNCTION + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | VOLDN | VOLUP | MUTE | DEL | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | - | WIN | - | - | RGB_TOG| - | - | OPTION | RESET | - | [ | ] | - | - | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | MAC | RAINBOW| PLAIN | - | - | - | - | - | - | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | INC | DEC | HUE I | HUE D | SAT I | SAT D | - | - | . | / | \ | RSHIFT| HOME | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | PGUP | END | PGDN | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_FN] = LAYOUT_ortho_5x15( /* OSLAYOUT + NUMPAD + MEDIA + LIGHTING */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, \ + KC_TRNS, KC_NO, DF(_QW_W), KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_RALT, RESET, KC_NO, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, \ + KC_TRNS, DF(_QW_M), RGB_MODE_RAINBOW, RGB_MODE_PLAIN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_NO, KC_NO, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_END, KC_PGDN \ + ), +}; diff --git a/keyboards/idobo/keymaps/revok75/readme.md b/keyboards/idobo/keymaps/revok75/readme.md new file mode 100644 index 0000000000..780c5401c4 --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/readme.md @@ -0,0 +1 @@ +# The default keymap for Revok 75 --idobo version diff --git a/keyboards/idobo/keymaps/revok75/rules.mk b/keyboards/idobo/keymaps/revok75/rules.mk new file mode 100644 index 0000000000..7efceba50a --- /dev/null +++ b/keyboards/idobo/keymaps/revok75/rules.mk @@ -0,0 +1,14 @@ +# Copyright 2013 Jun Wako +# +# 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 . diff --git a/keyboards/xd75/keymaps/revok75/config.h b/keyboards/xd75/keymaps/revok75/config.h new file mode 100644 index 0000000000..a5484876ef --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/config.h @@ -0,0 +1,20 @@ +/* Copyright 2017 Benjamin Kesselring + * + * 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 + +// place overrides here +#undef BACKLIGHT_BREATHING diff --git a/keyboards/xd75/keymaps/revok75/keymap.c b/keyboards/xd75/keymaps/revok75/keymap.c new file mode 100644 index 0000000000..44e2c52033 --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/keymap.c @@ -0,0 +1,90 @@ +/* Copyright 2017 Wunder + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// Layer shorthand +#define _QW_M 0 +#define _QW_W 1 +#define _FN 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* QWERTY-Mac + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT| UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_M] = LAYOUT_ortho_5x15( /* QWERTY MAC*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LGUI(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LGUI(KC_C), LGUI(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LGUI(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LGUI(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LGUI(KC_F), LGUI(KC_T), KC_SPC, KC_NO, LALT(KC_SPACE), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + + /* QWERTY-Win + * .--------------------------------------------------------------------------------------------------------------------------------------. + * | ESC | 1 | 2 | 3 | 4 | % | 6 | 7 | 8 | 9 | 0 | - | = | Cut | BACKSP | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| + * | TAB | Q | W | E | R | T | Y | U | I | O | P | { | } | Copy | Paste | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| + * | CAP LK | A | S | D | F | G | H | J | K | L | ; | ' | ENTER | ENTER | REF | + * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| + * | LSHIFT | Z | X | C | V | B | N | M | , | . | / | \ | RSHIFT | UP | SAVE | + * |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| + * | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | START | FN-MO | RALT | RGUI | RCTRL | LEFT | DOWN | RIGHT | + * '--------------------------------------------------------------------------------------------------------------------------------------' + */ + + [_QW_W] = LAYOUT_ortho_5x15( /* QWERTY WIN*/ + KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, LCTL(KC_X), KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LCBR, KC_RCBR, LCTL(KC_C), LCTL(KC_V), \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LCTL(KC_R), KC_NO, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_BSLS, KC_RSFT, KC_UP, LCTL(KC_S), \ + KC_LCTL, KC_LALT, KC_LGUI, LCTL(KC_F), LCTL(KC_T), KC_SPC, KC_NO, LCTL(KC_GESC), MO(_FN), KC_RGUI, KC_RALT, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + +/* FUNCTION +* .--------------------------------------------------------------------------------------------------------------------------------------. +* | ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | VOLDN | VOLUP | MUTE | DEL | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| +* | TAB | - | WIN | - | - | RGB_TOG| - | - | OPTION | RESET | - | [ | ] | - | - | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------+--------| +* | CAP LK | MAC | RAINBOW| PLAIN | - | - | - | - | - | - | ; | ' | ENTER | ENTER | REF | +* |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------------------------+--------| +* | LSHIFT | INC | DEC | HUE I | HUE D | SAT I | SAT D | - | - | . | / | \ | RSHIFT| HOME | SAVE | +* |--------+--------+--------+--------+--------+-----------------+--------+--------+--------+--------+-----------------+--------+--------| +* | LALT | LGUI | LALT | FIND | CMD T | SPACE | SPACE | ALFRED | FN-MO | RALT | RGUI | RCTRL | PGUP | END | PGDN | +* '--------------------------------------------------------------------------------------------------------------------------------------' +*/ + + [_FN] = LAYOUT_ortho_5x15( /* OSLAYOUT + NUMPAD + MEDIA + LIGHTING */ + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_VOLD, KC_VOLU, KC_MUTE, KC_DEL, \ + KC_TRNS, KC_NO, DF(_QW_W), KC_NO, KC_NO, RGB_TOG, KC_NO, KC_NO, KC_RALT, RESET, KC_NO, KC_LBRC, KC_RBRC, KC_TRNS, KC_TRNS, \ + KC_TRNS, DF(_QW_M), RGB_MODE_RAINBOW, RGB_MODE_PLAIN, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ + KC_TRNS, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_NO, KC_NO, KC_DOT, KC_TRNS, KC_TRNS, KC_TRNS, KC_HOME, KC_TRNS, \ + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_END, KC_PGDN \ + ) +}; diff --git a/keyboards/xd75/keymaps/revok75/readme.md b/keyboards/xd75/keymaps/revok75/readme.md new file mode 100644 index 0000000000..ecec8c9629 --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/readme.md @@ -0,0 +1 @@ +# The default keymap for Revok 75 diff --git a/keyboards/xd75/keymaps/revok75/rules.mk b/keyboards/xd75/keymaps/revok75/rules.mk new file mode 100644 index 0000000000..7472e8c646 --- /dev/null +++ b/keyboards/xd75/keymaps/revok75/rules.mk @@ -0,0 +1,18 @@ +# Copyright 2013 Jun Wako +# +# 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 . + +BOOTMAGIC_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes -- cgit v1.2.3 From fd0f78254db8e7b505c9ac46b8210721d6fc20b5 Mon Sep 17 00:00:00 2001 From: Ivan Choi <34844887+navigatorade@users.noreply.github.com> Date: Wed, 5 Dec 2018 18:20:39 -0500 Subject: Keymap: Updated files to work with Planck Rev. 6 (#4552) * Update to work with Planck Rev. 6 Still something that needs to be worked with under keymap.c Qwerty layer tap-toggle function seems to be a little laggy? Not instantaneous * Changes Deleted some unneeded lines * deleting unneeded lines --- keyboards/planck/keymaps/navi/config.h | 31 +++- keyboards/planck/keymaps/navi/keymap.c | 270 ++++++++++++--------------------- keyboards/planck/keymaps/navi/rules.mk | 5 +- 3 files changed, 124 insertions(+), 182 deletions(-) diff --git a/keyboards/planck/keymaps/navi/config.h b/keyboards/planck/keymaps/navi/config.h index 694053c6a4..087ebb54e7 100644 --- a/keyboards/planck/keymaps/navi/config.h +++ b/keyboards/planck/keymaps/navi/config.h @@ -1,7 +1,14 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "config_common.h" +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif /* * MIDI options @@ -13,7 +20,7 @@ /* enable basic MIDI features: - MIDI notes can be sent when in Music mode is on */ - + #define MIDI_BASIC /* enable advanced MIDI features: @@ -27,4 +34,18 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 -#endif \ No newline at end of file +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define MOUSEKEY_INTERVAL 16 + +#define MOUSEKEY_DELAY 0 + +#define MOUSEKEY_TIME_TO_MAX 60 + +#define MOUSEKEY_MAX_SPEED 7 + +#define MOUSEKEY_WHEEL_DELAY 0 + +#define TAPPING_TERM 80 +#define TAPPING_TOGGLE 2 diff --git a/keyboards/planck/keymaps/navi/keymap.c b/keyboards/planck/keymaps/navi/keymap.c index 0f0e48ad8d..bbf7d510f9 100644 --- a/keyboards/planck/keymaps/navi/keymap.c +++ b/keyboards/planck/keymaps/navi/keymap.c @@ -9,42 +9,35 @@ * 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. - * cd /c/qmk_firmware - * make planck/rev4:navi + * cd /c/qmk_firmware-master... make planck/rev6:navi * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" - #include "song_list.h" -#endif +#include QMK_KEYBOARD_H + extern keymap_config_t keymap_config; enum planck_layers { _QWERTY, - _COLEMAK, - _PLOVER, _LOWER, _RAISE, - _ADJUST, - _FUNCTION + _FUNCTION, + _ADJUST + }; enum planck_keycodes { QWERTY = SAFE_RANGE, - COLEMAK, - PLOVER, LOWER, RAISE, - EXT_PLV, FUNCTION }; +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -59,51 +52,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' * CtlSE = Control+shift+esc/ * CtlE = Control when held, esc when tapped - */ -[_QWERTY] = { - {KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {LCTL_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}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {FUNCTION, C_S_T(KC_ESC), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | CtlE | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | FN |CtlSE | GUI | Alt |Lower | Space | Raise| Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[_COLEMAK] = { - {KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC}, - {LCTL_T(KC_ESC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT }, - {FUNCTION, C_S_T(KC_ESC), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT} -}, - -/* Plover layer (http://opensteno.org) - * ,-----------------------------------------------------------------------------------. - * | # | # | # | # | # | # | # | # | # | # | # | # | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | S | T | P | H | * | * | F | P | L | T | D | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | S | K | W | R | * | * | R | B | G | S | Z | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Exit | | | A | O | | E | U | | | | - * `-----------------------------------------------------------------------------------' + * FN takes two taps to have it stay as FN */ - -[_PLOVER] = { - {KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 }, - {XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC}, - {XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX} -}, - +[_QWERTY] = LAYOUT_planck_grid( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, + LCTL_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, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + TT(_FUNCTION), LCTL(LALT(KC_DEL)), KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -116,12 +72,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | |Pg DN | Pg UP| | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______} -}, +[_LOWER] = LAYOUT_planck_grid( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -129,89 +85,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+-------------+------+------+------+------+------| * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Shift | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | End | Home | | + * |Shift | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | End | Home | | * |------+------+------+------+------+------+------+------+------+------+------+------| * | | | | | | | | |Pg DN |Pg UP | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL}, - {KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_END, KC_HOME, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______} -}, +[_RAISE] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSHIFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_END, KC_HOME, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN , KC_PGUP, _______ +), -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | |MU_MOD|Aud on|Audoff| | |Qwerty|Colemk|Plover| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * |Caps |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | Caps | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = { - {_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL }, - {_______, _______, MU_MOD, AU_ON, AU_OFF, _______, _______, QWERTY, COLEMAK, PLOVER,_______, _______}, - {KC_CAPS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, KC_CAPS}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, /* Function * ,-----------------------------------------------------------------------------------. - * | Esc | | Prev | Play | Next | | | | 7 | 8 | 9 | Bksp | + * | Vol- | Mute | Vol+ | | | | | # | 7 | 8 | 9 | Bksp | * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | Vol- | Mute | Vol+ | | | + | 4 | 5 | 6 | - | + * | Prev | Play | Next | | | | | + | 4 | 5 | 6 | - | * |------+------+------+------+------+------|------+------+------+------+------+------| - * | CALC | | | | | | | $ | 1 | 2 | 3 | Enter| + * | CALC | MWU | M1 |MouseU| M2 | | | $ | 1 | 2 | 3 | Enter| * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |Prntsc| | | | * | 0 | . |Numlck| / | + * | | MWD |MouseL|MouseD|MouseR| | * | 0 | . |Numlck| / | * `-----------------------------------------------------------------------------------' */ -[_FUNCTION] = { - {KC_ESC , _______, KC_MPRV, KC_MPLY, KC_MNXT, _______,_______,_______, KC_KP_7, KC_KP_8, KC_KP_9,KC_BSPC}, - {_______, _______, KC_VOLD, KC_MUTE, KC_VOLU, _______, _______, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS}, - {KC_CALC, _______, _______, _______, _______, _______, _______, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENT}, - {_______, _______, KC_PSCR, _______, _______ , _______, _______, KC_PAST, KC_KP_0, KC_KP_DOT,KC_NUMLOCK, KC_PSLS} -} +[_FUNCTION] = LAYOUT_planck_grid( + KC_VOLD, KC_MUTE, KC_VOLU, KC_MPRV, KC_MPLY, KC_MNXT, KC_TRNS, KC_HASH, KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, + KC_MPRV, KC_MPLY, KC_MNXT, AU_ON, AU_OFF, MU_ON, MU_OFF, KC_PPLS, KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, + KC_CALC, KC_WH_U, KC_BTN1, KC_MS_U, KC_BTN2, KC_TRNS, KC_TRNS, KC_DLR, KC_KP_1, KC_KP_2, KC_KP_3, KC_ENTER, + KC_TRNS, KC_WH_D, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_PAST, KC_KP_0, KC_KP_DOT,KC_NUMLOCK, KC_PSLS +) }; -#ifdef AUDIO_ENABLE -float tone_startup[][2] = SONG(ZELDA_PUZZLE); -float tone_qwerty[][2] = SONG(ZELDA_TREASURE); -float plover_song[][2] = SONG(PLOVER_SOUND); -float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); -float tone_colemak[][2] = SONG(VIOLIN_SOUND); -float tone_music_on[][2] = SONG(ONE_UP_SOUND); -float tone_music_off[][2] = SONG(ROCK_A_BYE_BABY); -#endif /* AUDIO_ENABLE */ +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: if (record->event.pressed) { - print("mode just switched to qwerty and this is a huge string\n"); - set_single_persistent_default_layer(_QWERTY); - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - } - return false; - break; - case COLEMAK: - if (record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); } return false; break; - case LOWER: + case LOWER: if (record->event.pressed) { layer_on(_LOWER); update_tri_layer(_LOWER, _RAISE, _ADJUST); @@ -238,62 +159,59 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { layer_off(_FUNCTION); } return false; - break; - case PLOVER: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - stop_all_notes(); - PLAY_SONG(plover_song); - #endif - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; - case EXT_PLV: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(plover_gb_song); - #endif - layer_off(_PLOVER); - } - return false; - break; + break; } return true; } -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif -} - -#ifdef AUDIO_ENABLE - -void startup_user() -{ - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); -} - -void music_on_user(void) -{ - PLAY_SONG(tone_music_on); +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +void encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_DOWN); + unregister_code(KC_MS_WH_DOWN); + #else + register_code(KC_PGDN); + unregister_code(KC_PGDN); + #endif + } else { + #ifdef MOUSEKEY_ENABLE + register_code(KC_MS_WH_UP); + unregister_code(KC_MS_WH_UP); + #else + register_code(KC_PGUP); + unregister_code(KC_PGUP); + #endif + } + } } -void music_off_user(void) -{ - PLAY_SONG(tone_music_off); +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } } -#endif - - diff --git a/keyboards/planck/keymaps/navi/rules.mk b/keyboards/planck/keymaps/navi/rules.mk index 628167ff66..4852442b36 100644 --- a/keyboards/planck/keymaps/navi/rules.mk +++ b/keyboards/planck/keymaps/navi/rules.mk @@ -1 +1,4 @@ -AUDIO_ENABLE = yes \ No newline at end of file +AUDIO_ENABLE = yes +MOUSEKEY_ENABLE = yes + +DFU_ARGS = -d 0483:df11 -a 0 -s 0x08000000:leave \ No newline at end of file -- cgit v1.2.3 From 58670ef4b75dad47770401167427bbeed1d5e170 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 5 Dec 2018 15:27:55 -0800 Subject: Keyboard: Configurator support for handwired/dactyl_manuform (#4558) * handwired/dactyl_manuform/4x5: Configurator support * handwired/dactyl_manuform/4x6: Configurator support * handwired/dactyl_manuform/5x6: Configurator support * handwired/dactyl_manuform/5x7: Configurator support * handwired/dactyl_manuform/6x6: Configurator support --- keyboards/handwired/dactyl_manuform/4x5/info.json | 59 +++++++++++++++ keyboards/handwired/dactyl_manuform/4x6/info.json | 65 +++++++++++++++++ keyboards/handwired/dactyl_manuform/5x6/info.json | 77 ++++++++++++++++++++ keyboards/handwired/dactyl_manuform/5x7/info.json | 87 ++++++++++++++++++++++ keyboards/handwired/dactyl_manuform/6x6/info.json | 89 +++++++++++++++++++++++ 5 files changed, 377 insertions(+) create mode 100644 keyboards/handwired/dactyl_manuform/4x5/info.json create mode 100644 keyboards/handwired/dactyl_manuform/4x6/info.json create mode 100644 keyboards/handwired/dactyl_manuform/5x6/info.json create mode 100644 keyboards/handwired/dactyl_manuform/5x7/info.json create mode 100644 keyboards/handwired/dactyl_manuform/6x6/info.json diff --git a/keyboards/handwired/dactyl_manuform/4x5/info.json b/keyboards/handwired/dactyl_manuform/4x5/info.json new file mode 100644 index 0000000000..4ee52e1644 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x5/info.json @@ -0,0 +1,59 @@ +{ + "keyboard_name": "Dactyl Manuform 4x5", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"R00", "x":10, "y":0}, + {"label":"R01", "x":11, "y":0}, + {"label":"R02", "x":12, "y":0}, + {"label":"R03", "x":13, "y":0}, + {"label":"R04", "x":14, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"R10", "x":10, "y":1}, + {"label":"R11", "x":11, "y":1}, + {"label":"R12", "x":12, "y":1}, + {"label":"R13", "x":13, "y":1}, + {"label":"R14", "x":14, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"R20", "x":10, "y":2}, + {"label":"R21", "x":11, "y":2}, + {"label":"R22", "x":12, "y":2}, + {"label":"R23", "x":13, "y":2}, + {"label":"R24", "x":14, "y":2}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"R32", "x":12, "y":3}, + {"label":"R33", "x":13, "y":3}, + {"label":"L33", "x":3, "y":4}, + {"label":"L34", "x":4, "y":4}, + {"label":"R30", "x":10, "y":4}, + {"label":"R31", "x":11, "y":4}, + {"label":"L44", "x":5, "y":5}, + {"label":"L43", "x":6, "y":5}, + {"label":"R41", "x":8, "y":5}, + {"label":"R40", "x":9, "y":5}, + {"label":"L42", "x":5, "y":6}, + {"label":"L41", "x":6, "y":6}, + {"label":"R43", "x":8, "y":6}, + {"label":"R42", "x":9, "y":6} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/4x6/info.json b/keyboards/handwired/dactyl_manuform/4x6/info.json new file mode 100644 index 0000000000..ba358a703f --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/4x6/info.json @@ -0,0 +1,65 @@ +{ + "keyboard_name": "Dactyl Manuform 4x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 7, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"L34", "x":4, "y":4}, + {"label":"L35", "x":5, "y":4}, + {"label":"R30", "x":11, "y":4}, + {"label":"R31", "x":12, "y":4}, + {"label":"L44", "x":6, "y":5}, + {"label":"L45", "x":7, "y":5}, + {"label":"R40", "x":9, "y":5}, + {"label":"R41", "x":10, "y":5}, + {"label":"L42", "x":6, "y":6}, + {"label":"L43", "x":7, "y":6}, + {"label":"R42", "x":9, "y":6}, + {"label":"R43", "x":10, "y":6} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/info.json b/keyboards/handwired/dactyl_manuform/5x6/info.json new file mode 100644 index 0000000000..d7aa3acee3 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "Dactyl Manuform 5x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L30", "x":0, "y":3}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"L34", "x":4, "y":3}, + {"label":"L35", "x":5, "y":3}, + {"label":"R30", "x":11, "y":3}, + {"label":"R31", "x":12, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"R34", "x":15, "y":3}, + {"label":"R35", "x":16, "y":3}, + {"label":"L42", "x":2, "y":4}, + {"label":"L43", "x":3, "y":4}, + {"label":"R42", "x":13, "y":4}, + {"label":"R43", "x":14, "y":4}, + {"label":"L44", "x":4, "y":5}, + {"label":"L45", "x":5, "y":5}, + {"label":"R40", "x":11, "y":5}, + {"label":"R41", "x":12, "y":5}, + {"label":"L54", "x":6, "y":6}, + {"label":"L55", "x":7, "y":6}, + {"label":"R50", "x":9, "y":6}, + {"label":"R51", "x":10, "y":6}, + {"label":"L52", "x":6, "y":7}, + {"label":"L53", "x":7, "y":7}, + {"label":"R52", "x":9, "y":7}, + {"label":"R53", "x":10, "y":7} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/5x7/info.json b/keyboards/handwired/dactyl_manuform/5x7/info.json new file mode 100644 index 0000000000..b4b2c7b797 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x7/info.json @@ -0,0 +1,87 @@ +{ + "keyboard_name": "Dactyl Manuform 5x7", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 16, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L11", "x":0, "y":0}, + {"label":"L12", "x":1, "y":0}, + {"label":"L13", "x":2, "y":0}, + {"label":"L14", "x":3, "y":0}, + {"label":"L15", "x":4, "y":0}, + {"label":"L16", "x":5, "y":0}, + {"label":"L17", "x":6, "y":0}, + {"label":"L21", "x":0, "y":1}, + {"label":"L22", "x":1, "y":1}, + {"label":"L23", "x":2, "y":1}, + {"label":"L24", "x":3, "y":1}, + {"label":"L25", "x":4, "y":1}, + {"label":"L26", "x":5, "y":1}, + {"label":"L27", "x":6, "y":1}, + {"label":"L31", "x":0, "y":2}, + {"label":"L32", "x":1, "y":2}, + {"label":"L33", "x":2, "y":2}, + {"label":"L34", "x":3, "y":2}, + {"label":"L35", "x":4, "y":2}, + {"label":"L36", "x":5, "y":2}, + {"label":"L37", "x":6, "y":2}, + {"label":"L41", "x":0, "y":3}, + {"label":"L42", "x":1, "y":3}, + {"label":"L43", "x":2, "y":3}, + {"label":"L44", "x":3, "y":3}, + {"label":"L45", "x":4, "y":3}, + {"label":"L46", "x":5, "y":3}, + {"label":"L51", "x":0, "y":4}, + {"label":"L52", "x":1, "y":4}, + {"label":"L53", "x":2, "y":4}, + {"label":"L54", "x":3, "y":4}, + {"label":"L55", "x":4, "y":5}, + {"label":"L56", "x":5, "y":5}, + {"label":"L65", "x":6, "y":6}, + {"label":"L66", "x":7, "y":6}, + {"label":"L63", "x":6, "y":7}, + {"label":"L64", "x":7, "y":7}, + {"label":"R11", "x":10, "y":0}, + {"label":"R12", "x":11, "y":0}, + {"label":"R13", "x":12, "y":0}, + {"label":"R14", "x":13, "y":0}, + {"label":"R15", "x":14, "y":0}, + {"label":"R16", "x":15, "y":0}, + {"label":"R17", "x":16, "y":0}, + {"label":"R21", "x":10, "y":1}, + {"label":"R22", "x":11, "y":1}, + {"label":"R23", "x":12, "y":1}, + {"label":"R24", "x":13, "y":1}, + {"label":"R25", "x":14, "y":1}, + {"label":"R26", "x":15, "y":1}, + {"label":"R27", "x":16, "y":1}, + {"label":"R31", "x":10, "y":2}, + {"label":"R32", "x":11, "y":2}, + {"label":"R33", "x":12, "y":2}, + {"label":"R34", "x":13, "y":2}, + {"label":"R35", "x":14, "y":2}, + {"label":"R36", "x":15, "y":2}, + {"label":"R37", "x":16, "y":2}, + {"label":"R42", "x":11, "y":3}, + {"label":"R43", "x":12, "y":3}, + {"label":"R44", "x":13, "y":3}, + {"label":"R45", "x":14, "y":3}, + {"label":"R46", "x":15, "y":3}, + {"label":"R47", "x":16, "y":3}, + {"label":"R54", "x":13, "y":4}, + {"label":"R55", "x":14, "y":4}, + {"label":"R56", "x":15, "y":4}, + {"label":"R57", "x":16, "y":4}, + {"label":"R52", "x":11, "y":5}, + {"label":"R53", "x":12, "y":5}, + {"label":"R62", "x":9, "y":6}, + {"label":"R63", "x":10, "y":6}, + {"label":"R64", "x":9, "y":7}, + {"label":"R65", "x":10, "y":7} + ] + } + } +} diff --git a/keyboards/handwired/dactyl_manuform/6x6/info.json b/keyboards/handwired/dactyl_manuform/6x6/info.json new file mode 100644 index 0000000000..2ae91d4694 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/6x6/info.json @@ -0,0 +1,89 @@ +{ + "keyboard_name": "Dactyl Manuform 6x6", + "url": "", + "maintainer": "qmk", + "width": 17, + "height": 9, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0}, + {"label":"L01", "x":1, "y":0}, + {"label":"L02", "x":2, "y":0}, + {"label":"L03", "x":3, "y":0}, + {"label":"L04", "x":4, "y":0}, + {"label":"L05", "x":5, "y":0}, + {"label":"R00", "x":11, "y":0}, + {"label":"R01", "x":12, "y":0}, + {"label":"R02", "x":13, "y":0}, + {"label":"R03", "x":14, "y":0}, + {"label":"R04", "x":15, "y":0}, + {"label":"R05", "x":16, "y":0}, + {"label":"L10", "x":0, "y":1}, + {"label":"L11", "x":1, "y":1}, + {"label":"L12", "x":2, "y":1}, + {"label":"L13", "x":3, "y":1}, + {"label":"L14", "x":4, "y":1}, + {"label":"L15", "x":5, "y":1}, + {"label":"R10", "x":11, "y":1}, + {"label":"R11", "x":12, "y":1}, + {"label":"R12", "x":13, "y":1}, + {"label":"R13", "x":14, "y":1}, + {"label":"R14", "x":15, "y":1}, + {"label":"R15", "x":16, "y":1}, + {"label":"L20", "x":0, "y":2}, + {"label":"L21", "x":1, "y":2}, + {"label":"L22", "x":2, "y":2}, + {"label":"L23", "x":3, "y":2}, + {"label":"L24", "x":4, "y":2}, + {"label":"L25", "x":5, "y":2}, + {"label":"R20", "x":11, "y":2}, + {"label":"R21", "x":12, "y":2}, + {"label":"R22", "x":13, "y":2}, + {"label":"R23", "x":14, "y":2}, + {"label":"R24", "x":15, "y":2}, + {"label":"R25", "x":16, "y":2}, + {"label":"L30", "x":0, "y":3}, + {"label":"L31", "x":1, "y":3}, + {"label":"L32", "x":2, "y":3}, + {"label":"L33", "x":3, "y":3}, + {"label":"L34", "x":4, "y":3}, + {"label":"L35", "x":5, "y":3}, + {"label":"R30", "x":11, "y":3}, + {"label":"R31", "x":12, "y":3}, + {"label":"R32", "x":13, "y":3}, + {"label":"R33", "x":14, "y":3}, + {"label":"R34", "x":15, "y":3}, + {"label":"R35", "x":16, "y":3}, + {"label":"L40", "x":0, "y":4}, + {"label":"L41", "x":1, "y":4}, + {"label":"L42", "x":2, "y":4}, + {"label":"L43", "x":3, "y":4}, + {"label":"L44", "x":4, "y":4}, + {"label":"L45", "x":5, "y":4}, + {"label":"R40", "x":11, "y":4}, + {"label":"R41", "x":12, "y":4}, + {"label":"R42", "x":13, "y":4}, + {"label":"R43", "x":14, "y":4}, + {"label":"R44", "x":15, "y":4}, + {"label":"R45", "x":16, "y":4}, + {"label":"L52", "x":2, "y":5}, + {"label":"L53", "x":3, "y":5}, + {"label":"R52", "x":13, "y":5}, + {"label":"R53", "x":14, "y":5}, + {"label":"L54", "x":4, "y":6}, + {"label":"L55", "x":5, "y":6}, + {"label":"R50", "x":11, "y":6}, + {"label":"R51", "x":12, "y":6}, + {"label":"L64", "x":6, "y":7}, + {"label":"L65", "x":7, "y":7}, + {"label":"R60", "x":9, "y":7}, + {"label":"R61", "x":10, "y":7}, + {"label":"L62", "x":6, "y":8}, + {"label":"L63", "x":7, "y":8}, + {"label":"R62", "x":9, "y":8}, + {"label":"R63", "x":10, "y":8} + ] + } + } +} -- cgit v1.2.3 From 8ad561c8f091a4baf167ad4d7c90c02383905e38 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 5 Dec 2018 16:55:35 -0800 Subject: Keyboard: handwired/fivethirteen Refactor, Configurator support, and readme cleanup (#4559) * handwired/fivethirteen: refactor - Layout macro KEYMAP renamed to LAYOUT - Default keymap - now uses #include QMK_KEYBOARD_H - Removed redundant KC_TRNS definition - Removed deprecated fn_actions and action_get_macro functions. * handwired/fivethirteen: Configurator support * handwired/fivethirteen: readme cleanup Restructured readme file to be closer to current QMK template. Couldn't find a photo of an assembled fivethirteen, so deleted the reference to the photograph. Renamed to readme.md --- keyboards/handwired/fivethirteen/README.md | 28 -------- keyboards/handwired/fivethirteen/fivethirteen.h | 22 +++---- keyboards/handwired/fivethirteen/info.json | 77 ++++++++++++++++++++++ .../fivethirteen/keymaps/default/keymap.c | 21 ++---- keyboards/handwired/fivethirteen/readme.md | 12 ++++ 5 files changed, 105 insertions(+), 55 deletions(-) delete mode 100644 keyboards/handwired/fivethirteen/README.md create mode 100644 keyboards/handwired/fivethirteen/info.json create mode 100644 keyboards/handwired/fivethirteen/readme.md diff --git a/keyboards/handwired/fivethirteen/README.md b/keyboards/handwired/fivethirteen/README.md deleted file mode 100644 index a965650fc6..0000000000 --- a/keyboards/handwired/fivethirteen/README.md +++ /dev/null @@ -1,28 +0,0 @@ -fivethirteen keyboard firmware -====================== - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/doc/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/fivethirteen folder. -Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use -the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/fivethirteen/fivethirteen.h b/keyboards/handwired/fivethirteen/fivethirteen.h index faa6de737d..6d14b7f1c0 100644 --- a/keyboards/handwired/fivethirteen/fivethirteen.h +++ b/keyboards/handwired/fivethirteen/fivethirteen.h @@ -3,19 +3,19 @@ #include "quantum.h" -#define KEYMAP( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ - k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k410, k411, k412 \ ) \ { \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ - { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k010, k011, k012 }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k110, k111, k112 }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k210, k211, k212 }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k310, k311, k312 }, \ + { k40, k41, k42, k43, k44, KC_NO, k46, k47, k48, k49, k410, k411, k412 } \ } #endif diff --git a/keyboards/handwired/fivethirteen/info.json b/keyboards/handwired/fivethirteen/info.json new file mode 100644 index 0000000000..f95cbbe011 --- /dev/null +++ b/keyboards/handwired/fivethirteen/info.json @@ -0,0 +1,77 @@ +{ + "keyboard_name": "fivethirteen", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"Ctrl/Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Enter", "x":12, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Up", "x":11, "y":3}, + {"label":"\\", "x":12, "y":3}, + {"label":"MO(MOS)", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"GUI", "x":3, "y":4}, + {"label":"MO(HDN)", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4, "w":2}, + {"label":"Shift/Backspace", "x":7, "y":4}, + {"label":"MO(OSY)", "x":8, "y":4}, + {"label":"MO(HDN)", "x":9, "y":4}, + {"label":"Left", "x":10, "y":4}, + {"label":"Down", "x":11, "y":4}, + {"label":"Right", "x":12, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c index d718510d50..d92f32e35c 100644 --- a/keyboards/handwired/fivethirteen/keymaps/default/keymap.c +++ b/keyboards/handwired/fivethirteen/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "fivethirteen.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H #define HDN 1 #define OSY 2 @@ -9,28 +7,28 @@ #define SFT_BSP SFT_T(KC_BSPC) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( +[0] = LAYOUT( KC_ESC, 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_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, \ CTL_ESC, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_UP, KC_BSLS, \ MO(MOS), KC_LCTL, KC_LALT, KC_LGUI, MO(HDN), KC_SPC , SFT_BSP, MO(OSY), MO(HDN), KC_LEFT, KC_DOWN, KC_RGHT \ ), -[HDN] = KEYMAP( +[HDN] = LAYOUT( _______, 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_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, _______, \ _______, KC_TILD, KC_GRV, KC_BSLS, KC_PIPE, KC_MINS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_TILD, KC_GRV, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_ENT, _______, _______, _______, KC_PGUP, _______, \ _______, _______, _______, _______, _______, KC_UNDS , KC_DEL, _______, _______, KC_HOME, KC_PGDN, KC_END \ ), -[OSY] = KEYMAP( +[OSY] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_PWR, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), -[MOS] = KEYMAP( +[MOS] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, _______, _______, _______, \ @@ -38,12 +36,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) }; - - -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - return MACRO_NONE; -}; diff --git a/keyboards/handwired/fivethirteen/readme.md b/keyboards/handwired/fivethirteen/readme.md new file mode 100644 index 0000000000..1a22fc9b93 --- /dev/null +++ b/keyboards/handwired/fivethirteen/readme.md @@ -0,0 +1,12 @@ +# fivethirteen + +A handwired 5x13 ortholinear keyboard with a 2U space bar. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: fivethirteen handwired + +Make example for this keyboard (after setting up your build environment): + + make handwired/fivethirteen: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). -- cgit v1.2.3 From 57678238a9f7023b3e0ba03bd9a61f6a7c309f9d Mon Sep 17 00:00:00 2001 From: Snipeye Date: Wed, 5 Dec 2018 19:31:21 -0700 Subject: Keyboard: Fixing spelling, updating code, finalizing keymap for Dichotomy (#4539) * Fixing spelling, updating code, finalizing keymap for Dichotomy * Fixing requested changes in PR * Further PR-requested changes for convention * Making macros functionable, removing unecessary defs * Fixing keymap to properly use previously-changed macros --- keyboards/dichotemy/config.h | 85 ----- keyboards/dichotemy/dichotemy.c | 86 ----- keyboards/dichotemy/dichotemy.h | 67 ---- keyboards/dichotemy/info.json | 12 - keyboards/dichotemy/keymaps/default/keymap.c | 394 --------------------- keyboards/dichotemy/matrix.c | 168 --------- keyboards/dichotemy/readme.md | 33 -- keyboards/dichotemy/rules.mk | 75 ---- keyboards/dichotomy/config.h | 85 +++++ keyboards/dichotomy/dichotomy.c | 89 +++++ keyboards/dichotomy/dichotomy.h | 46 +++ keyboards/dichotomy/info.json | 12 + keyboards/dichotomy/keymaps/default/keymap.c | 506 +++++++++++++++++++++++++++ keyboards/dichotomy/matrix.c | 228 ++++++++++++ keyboards/dichotomy/readme.md | 33 ++ keyboards/dichotomy/rules.mk | 77 ++++ 16 files changed, 1076 insertions(+), 920 deletions(-) delete mode 100644 keyboards/dichotemy/config.h delete mode 100644 keyboards/dichotemy/dichotemy.c delete mode 100644 keyboards/dichotemy/dichotemy.h delete mode 100644 keyboards/dichotemy/info.json delete mode 100644 keyboards/dichotemy/keymaps/default/keymap.c delete mode 100644 keyboards/dichotemy/matrix.c delete mode 100644 keyboards/dichotemy/readme.md delete mode 100644 keyboards/dichotemy/rules.mk create mode 100755 keyboards/dichotomy/config.h create mode 100755 keyboards/dichotomy/dichotomy.c create mode 100755 keyboards/dichotomy/dichotomy.h create mode 100644 keyboards/dichotomy/info.json create mode 100755 keyboards/dichotomy/keymaps/default/keymap.c create mode 100755 keyboards/dichotomy/matrix.c create mode 100755 keyboards/dichotomy/readme.md create mode 100755 keyboards/dichotomy/rules.mk diff --git a/keyboards/dichotemy/config.h b/keyboards/dichotemy/config.h deleted file mode 100644 index 1d92cf74e5..0000000000 --- a/keyboards/dichotemy/config.h +++ /dev/null @@ -1,85 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ - -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0xACC7 -#define DEVICE_VER 0x0001 -#define MANUFACTURER unknown -#define PRODUCT Dichotemy -#define DESCRIPTION q.m.k. keyboard firmware for Dichotemy - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 12 - -/* define if matrix has ghost */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ -//#define BACKLIGHT_LEVELS 3 - -#define ONESHOT_TIMEOUT 500 - - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* - * 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 - -//UART settings for communication with the RF microcontroller -#define SERIAL_UART_BAUD 1000000 -#define SERIAL_UART_DATA UDR1 -#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) -#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) -#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) -#define SERIAL_UART_INIT() do { \ - /* baud rate */ \ - UBRR1L = SERIAL_UART_UBRR; \ - /* baud rate */ \ - UBRR1H = SERIAL_UART_UBRR >> 8; \ - /* enable TX and RX */ \ - UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ - /* 8-bit data */ \ - UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ - } while(0) - -#endif diff --git a/keyboards/dichotemy/dichotemy.c b/keyboards/dichotemy/dichotemy.c deleted file mode 100644 index 080c2654cd..0000000000 --- a/keyboards/dichotemy/dichotemy.c +++ /dev/null @@ -1,86 +0,0 @@ -#include "dichotemy.h" -#include "pointing_device.h" -#include "report.h" - -void uart_init(void) { - SERIAL_UART_INIT(); -} - -void pointing_device_task(void){ - report_mouse_t currentReport = {}; - SERIAL_UART_INIT(); - uint32_t timeout = 0; - - //the m character requests the RF slave to send the mouse report - SERIAL_UART_DATA = 'm'; - - //trust the external inputs completely, erase old data - uint8_t uart_data[5] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 5; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, bits 1-4 are movement and scroll - //but bit 5 has bits 0-3 for the scroll button state - //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 - //We can use this to verify the report sent properly. - if (uart_data[4] == 0x0F || uart_data[4] == 0x8F) - { - currentReport = pointing_device_get_report(); - //shifting and transferring the info to the mouse report varaible - //mouseReport.x = 127 max -127 min - currentReport.x = uart_data[0]; - //mouseReport.y = 127 max -127 min - currentReport.y = uart_data[1]; - //mouseReport.v = 127 max -127 min (scroll vertical) - currentReport.v = uart_data[2]; - //mouseReport.h = 127 max -127 min (scroll horizontal) - currentReport.h = uart_data[3]; - //mouseReport.buttons = 0x31 max (bitmask for mouse buttons 1-5) 0x00 min - //mouse buttons 1 and 2 are handled by the keymap, but not 3 - if (uart_data[4] == 0x0F) { //then 3 is not pressed - currentReport.buttons &= ~MOUSE_BTN3; //MOUSE_BTN3 is def in report.h - } else { //3 must be pressed - currentReport.buttons |= MOUSE_BTN3; - } - pointing_device_set_report(currentReport); - } - pointing_device_send(); -} - -void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); -} - - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); - uart_init(); - led_init(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - matrix_scan_user(); -} - -void led_set_kb(uint8_t usb_led) { - -} diff --git a/keyboards/dichotemy/dichotemy.h b/keyboards/dichotemy/dichotemy.h deleted file mode 100644 index 1d617d91c9..0000000000 --- a/keyboards/dichotemy/dichotemy.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef DICHOTEMY_H -#define DICHOTEMY_H - -#include "quantum.h" -#include "matrix.h" -#include "backlight.h" -#include - -#define red_led_off PORTF |= (1<<5) -#define red_led_on PORTF &= ~(1<<5) -#define blu_led_off PORTF |= (1<<4) -#define blu_led_on PORTF &= ~(1<<4) -#define grn_led_off PORTD |= (1<<1) -#define grn_led_on PORTD &= ~(1<<1) - -#define set_led_off red_led_off; grn_led_off; blu_led_off -#define set_led_red red_led_on; grn_led_off; blu_led_off -#define set_led_blue red_led_off; grn_led_off; blu_led_on -#define set_led_green red_led_off; grn_led_on; blu_led_off -#define set_led_yellow red_led_on; grn_led_on; blu_led_off -#define set_led_magenta red_led_on; grn_led_off; blu_led_on -#define set_led_cyan red_led_off; grn_led_on; blu_led_on -#define set_led_white red_led_on; grn_led_on; blu_led_on - -/* -#define LED_B 5 -#define LED_R 6 -#define LED_G 7 - -#define all_leds_off PORTF &= ~(1<event.pressed) { - num_timer = timer_read(); - number_singular_key = true; - layer_invert(_NM); - } else { - if (timer_elapsed(num_timer) < MAX_TOGGLE_LENGTH && number_singular_key) { - //do nothing, the layer has already been inverted - } else { - layer_invert(_NM); - } - } - update_tri_layer(_NM, _SF, _NS); - return false; - break; - //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. - case SFTKEY: - if (record->event.pressed) { - shift_held = true; - shift_suspended = false; - shift_timer = timer_read(); - shift_singular_key = true; - layer_on(_SF); - register_code(KC_LSFT); - } else { - shift_held = false; - if (timer_elapsed(shift_timer) < MAX_TOGGLE_LENGTH && shift_singular_key) { - //this was basically a toggle, so activate/deactivate caps lock. - SEND_STRING(SS_TAP(X_CAPSLOCK)); - } - layer_off(_SF); - unregister_code(KC_LSFT); - } - update_tri_layer(_NM, _SF, _NS); - return false; - break; - //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift - case MOUSE: - if (record->event.pressed) { - mouse_timer = timer_read(); - mouse_singular_key = true; - layer_invert(_MS); - } else { - if (timer_elapsed(mouse_timer) < MAX_TOGGLE_LENGTH && number_singular_key){ - //do nothing, it was a toggle (and it's already been toggled) - } else { - layer_invert(_MS); - } - } - return false; - break; - //Custom macros for strange keys with different long-tap behavior - case CK_1G: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_1G-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_1G-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_1G-SAFE_RANGE] = 0; - unregister_code(KC_GRAVE); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_1)); - } - special_timers[CK_1G-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_BSPE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_BSPE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_BSPE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_BSPE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_BSLASH)); - } - special_timers[CK_BSPE-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_QE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - if (record->event.pressed) { - special_timers[CK_QE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_QE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_QE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_QUOTE)); - } - special_timers[CK_QE-SAFE_RANGE] = 0xFFFF; - } - break; - case CK_TE: - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - if (record->event.pressed) { - special_timers[CK_TE-SAFE_RANGE] = timer_read(); - } else { - if (special_key_states[CK_TE-SAFE_RANGE]){ - //key was activated after longpress_delay, need to close those keycodes - special_key_states[CK_TE-SAFE_RANGE] = 0; - unregister_code(KC_ENTER); - } else { - //key was not activated, return macro activating proper, pre-long-tap key - SEND_STRING(SS_TAP(X_TAB)); - } - special_timers[CK_TE-SAFE_RANGE] = 0xFFFF; - } - break; - //No-shift keys, they unregister the KC_LSFT code so they can send - //unshifted values - but they don't change the bool. if any other - //key is pressed and the bool is set, KC_LSFT is registered again. - case NS_HYPH: - if (record->event.pressed) { - shift_suspended = true; - unregister_code(KC_LSFT); - register_code(KC_MINS); - } else { - unregister_code(KC_MINS); - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - } - break; - case NS_EQU: - if (record->event.pressed) { - shift_suspended = true; - unregister_code(KC_LSFT); - register_code(KC_EQUAL); - } else { - unregister_code(KC_EQUAL); - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - } - break; - - //mouse buttons, for 1-3, to update the mouse report: - case MS_BTN1: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h - } else { - //update mouse report here - currentReport.buttons &= ~MOUSE_BTN1; - } - pointing_device_set_report(currentReport); - break; - case MS_BTN2: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h - } else { - //update mouse report here - } - pointing_device_set_report(currentReport); - break; - //there is a case for button 3, but that's handled in dichotemy.c, and this is being - //disabled to avoid any conflict. - /*case MS_BTN3: - currentReport = pointing_device_get_report(); - if (record->event.pressed) { - if (shift_held && shift_suspended){ - register_code(KC_LSFT); - shift_suspended = false; - } - //update mouse report here - currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN2 is a const defined in report.h - } else { - //update mouse report here - } - pointing_device_set_report(currentReport); - break;*/ - - //If any other key was pressed during the layer mod hold period, - //then the layer mod was used momentarily, and should block latching - //Additionally, if NS_ keys are in use, then shift may be held (but is - //disabled for the unshifted keycodes to be send. Check the bool and - //register shift as necessary. - default: - if (shift_held){ - register_code(KC_LSFT); - } - shift_singular_key = false; - number_singular_key = false; - mouse_singular_key = false; - break; - } - return true; -}; - -void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - for (uint8_t i = 0; i= LONGPRESS_DELAY && !special_key_states[i]){ - switch (i + SAFE_RANGE){ - case CK_1G: - register_code(KC_GRAVE); - break; - case CK_BSPE: - register_code(KC_ENTER); - break; - case CK_QE: - register_code(KC_ENTER); - break; - case CK_TE: - register_code(KC_ESCAPE); - break; - } - special_key_states[i] = 1; - } - } - switch (layer) { - case _BS: - set_led_off; - break; - case _NM: - set_led_blue; - break; - case _SF: - set_led_red; - break; - case _NS: - set_led_green; - break; - default: - break; - } -}; - diff --git a/keyboards/dichotemy/matrix.c b/keyboards/dichotemy/matrix.c deleted file mode 100644 index f2841df1de..0000000000 --- a/keyboards/dichotemy/matrix.c +++ /dev/null @@ -1,168 +0,0 @@ -/* -Copyright 2012 Jun Wako -Copyright 2014 Jack Humbert - -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 . -*/ -#include -#include -#if defined(__AVR__) -#include -#endif -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "timer.h" - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#elif (MATRIX_COLS <= 16) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop16(matrix[i]) -# define ROW_SHIFTER ((uint16_t)1) -#elif (MATRIX_COLS <= 32) -# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") -# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop32(matrix[i]) -# define ROW_SHIFTER ((uint32_t)1) -#endif - -#define MAIN_ROWMASK 0xFFF0; -#define LOWER_ROWMASK 0x1F80; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; - -__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) { -} - -inline -uint8_t matrix_rows(void) { - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) { - return MATRIX_COLS; -} - -void matrix_init(void) { - - matrix_init_quantum(); -} - -uint8_t matrix_scan(void) -{ - SERIAL_UART_INIT(); - - uint32_t timeout = 0; - - //the s character requests the RF slave to send the matrix - SERIAL_UART_DATA = 's'; - - //trust the external keystates entirely, erase the last data - uint8_t uart_data[7] = {0}; - - //there are 10 bytes corresponding to 10 columns, and an end byte - for (uint8_t i = 0; i < 7; i++) { - //wait for the serial data, timeout if it's been too long - //this only happened in testing with a loose wire, but does no - //harm to leave it in here - while(!SERIAL_UART_RXD_PRESENT){ - timeout++; - if (timeout > 10000){ - break; - } - } - uart_data[i] = SERIAL_UART_DATA; - } - - //check for the end packet, the key state bytes use the LSBs, so 0xE0 - //will only show up here if the correct bytes were recieved - if (uart_data[6] == 0x96) { //this is an arbitrary binary checksum (10010110) - //shifting and transferring the keystates to the QMK matrix variable - //bits 1-12 are row 1, 13-24 are row 2, 25-36 are row 3, - //bits 37-42 are row 4 (only 6 wide, 1-3 are 0, and 10-12 are 0) - //bits 43-48 are row 5 (same as row 4) - /* ASSUMING MSB FIRST */ - matrix[0] = (((uint16_t) uart_data[0] << 8) | ((uint16_t) uart_data[1])) & MAIN_ROWMASK; - matrix[1] = ((uint16_t) uart_data[1] << 12) | ((uint16_t) uart_data[2] << 4); - matrix[2] = (((uint16_t) uart_data[3] << 8) | ((uint16_t) uart_data[4])) & MAIN_ROWMASK; - matrix[3] = (((uint16_t) uart_data[4] << 9) | ((uint16_t) uart_data[5] << 1)) & LOWER_ROWMASK; - matrix[4] = ((uint16_t) uart_data[5] << 7) & LOWER_ROWMASK; - /* OK, TURNS OUT THAT WAS A BAD ASSUMPTION */ - for (uint8_t i = 0; i < MATRIX_ROWS; i++) { - //I've unpacked these into the mirror image of what QMK expects them to be, so... - matrix[i] = ((matrix[i] * 0x0802LU & 0x22110LU) | (matrix[i] * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; - //bithack mirror! Doesn't make any sense, but works - and efficiently. - } - } - - - matrix_scan_quantum(); - return 1; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1.c` and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with a keymap like this: - -``` -$ make [default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/dichotemy/rules.mk b/keyboards/dichotemy/rules.mk deleted file mode 100644 index 4e9db86875..0000000000 --- a/keyboards/dichotemy/rules.mk +++ /dev/null @@ -1,75 +0,0 @@ - -OPT_DEFS += -DDICHOTEMY_PROMICRO -DICHOTEMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) - -# # project specific files -SRC = matrix.c - - -# MCU name -#MCU = at90usb1287 -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) - -# 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 = caterina - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# Build Options -# comment out to disable the options. -# -#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) -#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = yes # Console for debug(+400) -COMMAND_ENABLE = yes # Commands for debug and configuration -CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend -NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA -# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality -# MIDI_ENABLE = YES # MIDI controls -UNICODE_ENABLE = YES # Unicode -# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID - -USB = /dev/ttyACM0 - -#upload: build -# $(DICHOTEMY_UPLOAD_COMMAND) diff --git a/keyboards/dichotomy/config.h b/keyboards/dichotomy/config.h new file mode 100755 index 0000000000..f0847ec52c --- /dev/null +++ b/keyboards/dichotomy/config.h @@ -0,0 +1,85 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0xACC7 +#define DEVICE_VER 0x0002 +#define MANUFACTURER Broekhuijsen +#define PRODUCT Dichotomy +#define DESCRIPTION q.m.k. keyboard firmware for Dichotomy + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +/* define if matrix has ghost */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ +//#define BACKLIGHT_LEVELS 3 + +#define ONESHOT_TIMEOUT 500 + + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* + * 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 + +//UART settings for communication with the RF microcontroller +#define SERIAL_UART_BAUD 1000000 +#define SERIAL_UART_DATA UDR1 +#define SERIAL_UART_UBRR (F_CPU / (16UL * SERIAL_UART_BAUD) - 1) +#define SERIAL_UART_TXD_READY (UCSR1A & _BV(UDRE1)) +#define SERIAL_UART_RXD_PRESENT (UCSR1A & _BV(RXC1)) +#define SERIAL_UART_INIT() do { \ + /* baud rate */ \ + UBRR1L = SERIAL_UART_UBRR; \ + /* baud rate */ \ + UBRR1H = SERIAL_UART_UBRR >> 8; \ + /* enable TX and RX */ \ + UCSR1B = _BV(TXEN1) | _BV(RXEN1); \ + /* 8-bit data */ \ + UCSR1C = _BV(UCSZ11) | _BV(UCSZ10); \ + } while(0) + +#endif diff --git a/keyboards/dichotomy/dichotomy.c b/keyboards/dichotomy/dichotomy.c new file mode 100755 index 0000000000..41e12090cb --- /dev/null +++ b/keyboards/dichotomy/dichotomy.c @@ -0,0 +1,89 @@ +#include "dichotomy.h" + +void uart_init(void) { + SERIAL_UART_INIT(); +} + +void pointing_device_task(void){ + /*report_mouse_t currentReport = {}; + SERIAL_UART_INIT(); + uint32_t timeout = 0; + + //the m character requests the RF slave to send the mouse report + SERIAL_UART_DATA = 'm'; + + //trust the external inputs completely, erase old data + uint8_t uart_data[5] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 5; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTIMED OUT"); + break; + } + } + xprintf("\r\nGOT DATA for %d",i); + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, bytes 1-4 are movement and scroll + //but byte 5 has bits 0-3 for the scroll button state + //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 + //We can use this to verify the report sent properly. + if (uart_data[4] == 0x0F || uart_data[4] == 0x8F) + { + xprintf("\r\nREQUESTED MOUSE, RECEIVED %i, %i, %i, %i, %i",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4]); + currentReport = pointing_device_get_report(); + //shifting and transferring the info to the mouse report varaible + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[0]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[1]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[2]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[3]; + //mouseReport.buttons = 0x31 max (bitmask for mouse buttons 1-5) 0x00 min + //mouse buttons 1 and 2 are handled by the keymap, but not 3 + if (uart_data[4] == 0x0F) { //then 3 is not pressed + currentReport.buttons &= ~MOUSE_BTN3; //MOUSE_BTN3 is def in report.h + } else { //3 must be pressed + currentReport.buttons |= MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + } else { + xprintf("\r\nRequested packet, data 4 was %d",uart_data[4]); + }*/ + pointing_device_send(); +} + +void led_init(void) { + DDRD |= (1<<1); + PORTD |= (1<<1); + DDRF |= (1<<4) | (1<<5); + PORTF |= (1<<4) | (1<<5); +} + + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + matrix_init_user(); + uart_init(); + led_init(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + matrix_scan_user(); +} + +void led_set_kb(uint8_t usb_led) { + +} diff --git a/keyboards/dichotomy/dichotomy.h b/keyboards/dichotomy/dichotomy.h new file mode 100755 index 0000000000..030209ff01 --- /dev/null +++ b/keyboards/dichotomy/dichotomy.h @@ -0,0 +1,46 @@ +#ifndef DICHOTOMY_H +#define DICHOTOMY_H + +#include QMK_KEYBOARD_H +#include "report.h" +#include "pointing_device.h" +#include "quantum.h" +#include "matrix.h" +#include "backlight.h" +#include + +#define red_led_off() PORTF |= (1<<6) +#define red_led_on() PORTF &= ~(1<<6) +#define blu_led_off() PORTF |= (1<<5) +#define blu_led_on() PORTF &= ~(1<<5) +#define grn_led_off() PORTD |= (1<<1) +#define grn_led_on() PORTD &= ~(1<<1) + +#define set_led_off() red_led_off(); grn_led_off(); blu_led_off() +#define set_led_red() red_led_on(); grn_led_off(); blu_led_off() +#define set_led_blue() red_led_off(); grn_led_off(); blu_led_on() +#define set_led_green() red_led_off(); grn_led_on(); blu_led_off() +#define set_led_yellow() red_led_on(); grn_led_on(); blu_led_off() +#define set_led_magenta() red_led_on(); grn_led_off(); blu_led_on() +#define set_led_cyan() red_led_off(); grn_led_on(); blu_led_on() +#define set_led_white() red_led_on(); grn_led_on(); blu_led_on() + +// This a shortcut to help you visually see your layout. +// The first section contains all of the arguements +// The second converts the arguments into a two-dimensional array +#define LAYOUT( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, \ + k33, k34, k35, k36, k37, k38, \ + k42, k43, k44, k45, k46, k47, k48, k49 \ +) \ +{ \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B }, \ + { KC_NO, KC_NO, KC_NO, k33, k34, k35, k36, k37, k38, KC_NO, KC_NO, KC_NO }, \ + { KC_NO, KC_NO, k42, k43, k44, k45, k46, k47, k48, k49, KC_NO, KC_NO } \ +} + +#endif diff --git a/keyboards/dichotomy/info.json b/keyboards/dichotomy/info.json new file mode 100644 index 0000000000..aeb00edce7 --- /dev/null +++ b/keyboards/dichotomy/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "Dichotomy", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [{"label":"k00", "x":0, "y":0.5}, {"label":"k01", "x":1, "y":0.5}, {"label":"k02", "x":2, "y":0.25}, {"label":"k03", "x":3, "y":0}, {"label":"k04", "x":4, "y":0.5}, {"label":"k05", "x":5, "y":0.5}, {"label":"k06", "x":7, "y":0.5}, {"label":"k07", "x":8, "y":0.5}, {"label":"k08", "x":9, "y":0}, {"label":"k09", "x":10, "y":0.25}, {"label":"k0A", "x":11, "y":0.5}, {"label":"k0B", "x":12, "y":0.5}, {"label":"k10", "x":0, "y":1.5}, {"label":"k11", "x":1, "y":1.5}, {"label":"k12", "x":2, "y":1.25}, {"label":"k13", "x":3, "y":1}, {"label":"k14", "x":4, "y":1.5}, {"label":"k15", "x":5, "y":1.5}, {"label":"k16", "x":7, "y":1.5}, {"label":"k17", "x":8, "y":1.5}, {"label":"k18", "x":9, "y":1}, {"label":"k19", "x":10, "y":1.25}, {"label":"k1A", "x":11, "y":1.5}, {"label":"k1B", "x":12, "y":1.5}, {"label":"k20", "x":0, "y":2.5}, {"label":"k21", "x":1, "y":2.5}, {"label":"k22", "x":2, "y":2.25}, {"label":"k23", "x":3, "y":2}, {"label":"k24", "x":4, "y":2.5}, {"label":"k25", "x":5, "y":2.5}, {"label":"k26", "x":7, "y":2.5}, {"label":"k27", "x":8, "y":2.5}, {"label":"k28", "x":9, "y":2}, {"label":"k29", "x":10, "y":2.25}, {"label":"k2A", "x":11, "y":2.5}, {"label":"k2B", "x":12, "y":2.5}, {"label":"k33", "x":3, "y":4}, {"label":"k34", "x":4, "y":4}, {"label":"k35", "x":5, "y":4}, {"label":"k36", "x":7, "y":4}, {"label":"k37", "x":8, "y":4}, {"label":"k38", "x":9, "y":4}, {"label":"k43", "x":3, "y":5}, {"label":"k44", "x":4, "y":5}, {"label":"k45", "x":5, "y":5}, {"label":"k46", "x":7, "y":5}, {"label":"k47", "x":8, "y":5}, {"label":"k48", "x":9, "y":5}] + } + } +} diff --git a/keyboards/dichotomy/keymaps/default/keymap.c b/keyboards/dichotomy/keymaps/default/keymap.c new file mode 100755 index 0000000000..e44bd21d9e --- /dev/null +++ b/keyboards/dichotomy/keymaps/default/keymap.c @@ -0,0 +1,506 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include "dichotomy.h" + +// 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. +enum dichotomy_layers { + _BS, + _SF, + _NM, + _NS, + _MS +}; + +#define LONGPRESS_COUNT 4 + +enum dichotomy_keycodes +{ + CK_1G = SAFE_RANGE, + CK_BSPE, + CK_QE, + CK_TE, //these 4 CK_XXXX keys are special "alternate long-press" keys controlled with unique timers. Make sure you understand them before you mess with them. + NS_HYPH, + NS_EQU, + NUMKEY, + SFTKEY, + MOUKEY, + MS_BTN1, + MS_BTN2, + MS_BTN3 +}; + +#define CUSTOM_LONGPRESS 150 +#define CUSTOM_TOGGLE_TIME 300 + +#define RED_BRIGHTNESS 3 +#define GREEN_BRIGHTNESS 2 +#define BLUE_BRIGHTNESS 2 + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[_BS] = LAYOUT( /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */ + CK_TE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + NUMKEY, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, CK_QE, + SFTKEY, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, + KC_LCTL, KC_LALT, KC_LGUI, KC_RGUI, KC_RALT, KC_RCTL, + MS_BTN3, KC_LBRC, KC_LPRN, KC_SPC, KC_SPC, KC_RPRN, KC_RBRC, MS_BTN3 +), + +[_SF] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, NS_HYPH, KC_UNDS, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, KC_LABK, _______, _______, KC_RABK, _______, _______ +), + +[_NM] = LAYOUT( /* Number layout, basically the main function layer */ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, CK_1G, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, CK_BSPE, + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_NS] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PLUS, NS_EQU, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MS] = LAYOUT( /* Mouse layer, including buttons for clicking. */ + _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, + _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ +) + +}; + + +const uint16_t PROGMEM fn_actions[] = { + +}; + +static uint16_t special_timers[LONGPRESS_COUNT] = {0xFFFF,0xFFFF,0xFFFF,0xFFFF}; +static bool special_key_states[LONGPRESS_COUNT] = {0,0,0,0}; +static bool special_key_pressed[LONGPRESS_COUNT] = {0,0,0,0}; + +static uint16_t shift_timer; +static uint16_t num_timer; +static uint16_t mouse_timer; + +static uint8_t red_timer; +static uint8_t green_timer; +static uint8_t blue_timer; + +static bool shift_singular_key = false; +static bool number_singular_key = false; +static bool mouse_singular_key = false; +static bool capsLED = false; +static bool shiftLED = false; +static bool numLED = false; +static bool mouseLED = false; + +static bool shift_held = false; +static bool shift_suspended = false; +report_mouse_t currentReport = {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + //uint8_t layer; + //layer = biton32(layer_state); // get the current layer //Or don't, I didn't use it. + bool returnVal = true; //this is to determine if more key processing is needed. + + //custom layer handling for tri_layer, + switch (keycode) { + case NUMKEY: + if (record->event.pressed) { + num_timer = timer_read(); + number_singular_key = true; + layer_invert(_NM); + numLED = !numLED; + } else { + if (timer_elapsed(num_timer) < CUSTOM_TOGGLE_TIME && number_singular_key) { + //do nothing, the layer has already been inverted + } else { + layer_invert(_NM); + numLED = !numLED; + } + } + update_tri_layer(_NM, _SF, _NS); + returnVal = false; + break; + //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. + case SFTKEY: + if (record->event.pressed) { + shift_held = true; + shiftLED = true; + shift_suspended = false; + shift_timer = timer_read(); + shift_singular_key = true; + layer_on(_SF); + register_code(KC_LSFT); + } else { + shift_held = false; + shiftLED = false; + if (timer_elapsed(shift_timer) < CUSTOM_TOGGLE_TIME && shift_singular_key) { + //this was basically a toggle, so activate/deactivate caps lock. + SEND_STRING(SS_TAP(X_CAPSLOCK)); + capsLED = !capsLED; + } + layer_off(_SF); + unregister_code(KC_LSFT); + } + update_tri_layer(_NM, _SF, _NS); + returnVal = false; + break; + //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift + case MOUKEY: + if (record->event.pressed) { + mouse_timer = timer_read(); + mouse_singular_key = true; + layer_invert(_MS); + mouseLED = !mouseLED; + } else { + if (timer_elapsed(mouse_timer) < CUSTOM_TOGGLE_TIME && mouse_singular_key){ + //do nothing, it was a toggle (and it's already been toggled) + } else { + layer_invert(_MS); + mouseLED = !mouseLED; + } + } + returnVal = false; + break; + //Custom macros for strange keys with different long-tap behavior + case CK_1G: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_1G-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_1G-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_1G-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_1G-SAFE_RANGE] = 0; + unregister_code(KC_GRAVE); + } else { + if (special_key_pressed[CK_1G-SAFE_RANGE]){ + //key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_1)); + special_key_pressed[CK_1G-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + + } + } + returnVal = false; + break; + case CK_BSPE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_BSPE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_BSPE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_BSPE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_BSPE-SAFE_RANGE] = 0; + unregister_code(KC_ENTER); + } else { + if (special_key_pressed[CK_BSPE-SAFE_RANGE]){ + //key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_BSLASH)); + special_key_pressed[CK_BSPE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + case CK_QE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_QE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_QE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_QE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_QE-SAFE_RANGE] = 0; + unregister_code(KC_ENTER); + } else { + if (special_key_pressed[CK_QE-SAFE_RANGE]){ + //the long-press key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_QUOTE)); + special_key_pressed[CK_QE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + case CK_TE: + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + if (record->event.pressed) { + special_timers[CK_TE-SAFE_RANGE] = timer_read(); + special_key_pressed[CK_TE-SAFE_RANGE] = 1; + } else { + if (special_key_states[CK_TE-SAFE_RANGE]){ + //key was activated after custom_longpress, need to close those keycodes + special_key_states[CK_TE-SAFE_RANGE] = 0; + unregister_code(KC_ESCAPE); + } else { + if (special_key_pressed[CK_TE-SAFE_RANGE]){ + //the long-press key was not activated, return macro activating proper, pre-long-tap key + SEND_STRING(SS_TAP(X_TAB)); + special_key_pressed[CK_TE-SAFE_RANGE] = 0; + } else { + //the short key was already sent, because another key was pressed. + //Do nothing. + } + } + } + returnVal = false; + break; + //No-shift keys, they unregister the KC_LSFT code so they can send + //unshifted values - but they don't change the bool. if any other + //key is pressed and the bool is set, KC_LSFT is registered again. + case NS_HYPH: + if (record->event.pressed) { + shift_suspended = true; + unregister_code(KC_LSFT); + register_code(KC_MINS); + } else { + unregister_code(KC_MINS); + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + } + returnVal = false; + break; + case NS_EQU: + if (record->event.pressed) { + shift_suspended = true; + unregister_code(KC_LSFT); + register_code(KC_EQUAL); + } else { + unregister_code(KC_EQUAL); + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + } + returnVal = false; + break; + + //mouse buttons, for 1-3, to update the mouse report: + case MS_BTN1: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN1; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + case MS_BTN2: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN2; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + case MS_BTN3: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN3 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + returnVal = false; + break; + //Additionally, if NS_ keys are in use, then shift may be held (but is + //disabled for the unshifted keycodes to be send. Check the bool and + //register shift as necessary. + default: + if (shift_held){ + register_code(KC_LSFT); + } + break; + } + switch (keycode){ + case KC_BSPC: + case KC_NO: + case NUMKEY: + case SFTKEY: + case MOUKEY: + //don't want to reset single key variables + break; + default: + //If any other key was pressed during the layer mod hold period, + //then the layer mod was used momentarily, and should block latching + shift_singular_key = false; + number_singular_key = false; + mouse_singular_key = false; + break; + } + switch (keycode){ + case KC_BSPC: + case KC_NO: + case NUMKEY: + case SFTKEY: + case MOUKEY: + case MOUSE_BTN1: + case MOUSE_BTN2: + case MOUSE_BTN3: + case KC_LCTL: + case KC_LALT: + case KC_LGUI: + case KC_RCTL: + case KC_RALT: + case KC_RGUI: + case CK_1G: + case CK_BSPE: + case CK_QE: + case CK_TE: + //Do nothing, don't want to trigger the timer key rollover + break; + default: + //Now we're checking to see if any of the special timer keys are pressed + //if so, we need to activate their short-press features + if (record->event.pressed) { + for (uint8_t i = 0; i= CUSTOM_LONGPRESS) && (!special_key_states[i]) && special_key_pressed[i]){ + switch (i + SAFE_RANGE){ + case CK_1G: + register_code(KC_GRAVE); + break; + case CK_BSPE: + register_code(KC_ENTER); + break; + case CK_QE: + register_code(KC_ENTER); + break; + case CK_TE: + register_code(KC_ESCAPE); + break; + } + special_key_pressed[i] = 0; + special_key_states[i] = 1; + } + } + if (shiftLED || capsLED){ + red_timer++; + if (red_timer < RED_BRIGHTNESS){ + red_led_on(); + } else { + red_timer = 0; + red_led_off(); + } + } else { + red_timer = 0; + red_led_off(); + } + if (numLED){ + green_timer++; + if (green_timer < GREEN_BRIGHTNESS){ + grn_led_on(); + } else { + green_timer = 0; + grn_led_off(); + } + } else { + green_timer = 0; + grn_led_off(); + } + if (mouseLED){ + blue_timer++; + if (blue_timer < BLUE_BRIGHTNESS){ + blu_led_on(); + } else { + blue_timer = 0; + blu_led_off(); + } + } else { + blue_timer = 0; + blu_led_off(); + } +}; diff --git a/keyboards/dichotomy/matrix.c b/keyboards/dichotomy/matrix.c new file mode 100755 index 0000000000..14c3f0d8e3 --- /dev/null +++ b/keyboards/dichotomy/matrix.c @@ -0,0 +1,228 @@ +/* +Copyright 2012 Jun Wako +Copyright 2014 Jack Humbert + +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 . +*/ +#include +#include +#if defined(__AVR__) +#include +#endif +#include "wait.h" +#include "print.h" +#include "debug.h" +#include "util.h" +#include "matrix.h" +#include "timer.h" +#include "dichotomy.h" +#include "pointing_device.h" +#include "report.h" + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + +#define MAIN_ROWMASK 0xFFF0; +#define LOWER_ROWMASK 0x3FC0; + +/* matrix state(1:on, 0:off) */ +static matrix_row_t matrix[MATRIX_ROWS]; + +__attribute__ ((weak)) +void matrix_init_quantum(void) { + matrix_init_kb(); +} + +__attribute__ ((weak)) +void matrix_scan_quantum(void) { + matrix_scan_kb(); +} + +__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) { +} + +inline +uint8_t matrix_rows(void) { + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) { + return MATRIX_COLS; +} + +void matrix_init(void) { + DDRF |= (1<<6); + DDRF |= (1<<5); + DDRD |= (1<<1); + matrix_init_quantum(); +} + +uint8_t matrix_scan(void) +{ + SERIAL_UART_INIT(); + //xprintf("\r\nTRYING TO SCAN"); + + uint32_t timeout = 0; + + //the s character requests the RF slave to send the matrix + SERIAL_UART_DATA = 's'; + + //trust the external keystates entirely, erase the last data + uint8_t uart_data[11] = {0}; + + //there are 10 bytes corresponding to 10 columns, and an end byte + for (uint8_t i = 0; i < 11; i++) { + //wait for the serial data, timeout if it's been too long + //this only happened in testing with a loose wire, but does no + //harm to leave it in here + while(!SERIAL_UART_RXD_PRESENT){ + timeout++; + if (timeout > 10000){ + xprintf("\r\nTime out in keyboard."); + break; + } + } + uart_data[i] = SERIAL_UART_DATA; + } + + //check for the end packet, the key state bytes use the LSBs, so 0xE0 + //will only show up here if the correct bytes were recieved + uint8_t checksum = 0x00; + for (uint8_t z=0; z<10; z++){ + checksum = checksum^uart_data[z]; + } + checksum = checksum ^ (uart_data[10] & 0xF0); + // Smash the checksum from 1 byte into 4 bits + checksum = (checksum ^ ((checksum & 0xF0)>>4)) & 0x0F; +//xprintf("\r\nGOT RAW PACKET: \r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4],uart_data[5],uart_data[6],uart_data[7],uart_data[8],uart_data[9],uart_data[10],checksum); + if ((uart_data[10] & 0x0F) == checksum) { //this is an arbitrary binary checksum (1001) (that would be 0x9.) + //xprintf("\r\nGOT PACKET: \r\n%d\r\n%d\r\n%d\r\n%d\r\n%d\r\n%d",uart_data[0],uart_data[1],uart_data[2],uart_data[3],uart_data[4],uart_data[5]); + //shifting and transferring the keystates to the QMK matrix variable + //bits 1-12 are row 1, 13-24 are row 2, 25-36 are row 3, + //bits 37-42 are row 4 (only 6 wide, 1-3 are 0, and 10-12 are 0) + //bits 43-48 are row 5 (same as row 4) + /* ASSUMING MSB FIRST */ + matrix[0] = (((uint16_t) uart_data[0] << 8) | ((uint16_t) uart_data[1])) & MAIN_ROWMASK; + matrix[1] = ((uint16_t) uart_data[1] << 12) | ((uint16_t) uart_data[2] << 4); + matrix[2] = (((uint16_t) uart_data[3] << 8) | ((uint16_t) uart_data[4])) & MAIN_ROWMASK; + matrix[3] = (((uint16_t) uart_data[4] << 9) | ((uint16_t) uart_data[5] << 1)) & LOWER_ROWMASK; + matrix[4] = (((uint16_t) uart_data[5] << 7) | ((uart_data[10] & 1<<7) ? 1:0) << 13 | ((uart_data[10] & 1<<6) ? 1:0) << 6) & LOWER_ROWMASK; + /* OK, TURNS OUT THAT WAS A BAD ASSUMPTION */ + for (uint8_t i = 0; i < MATRIX_ROWS; i++) { + //I've unpacked these into the mirror image of what QMK expects them to be, so... + /*uint8_t halfOne = (matrix[i]>>8); + uint8_t halfTwo = (matrix[i] & 0xFF); + halfOne = ((halfOne * 0x0802LU & 0x22110LU) | (halfOne * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + halfTwo = ((halfTwo * 0x0802LU & 0x22110LU) | (halfTwo * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + matrix[i] = ((halfTwo<<8) & halfOne);*/ + //matrix[i] = ((matrix[i] * 0x0802LU & 0x22110LU) | (matrix[i] * 0x8020LU & 0x88440LU)) * 0x10101LU >> 16; + matrix[i] = bitrev16(matrix[i]); + //bithack mirror! Doesn't make any sense, but works - and efficiently. + } + //if (uart_data[6]!=0 || uart_data[7]!=0){ + //if (maxCount<101){ + // xprintf("\r\nMouse data: x=%d, y=%d",(int8_t)uart_data[6],(int8_t)uart_data[7]); + //} + report_mouse_t currentReport = {}; + //check for the end packet, bytes 1-4 are movement and scroll + //but byte 5 has bits 0-3 for the scroll button state + //(1000 if pressed, 0000 if not) and bits 4-7 are always 1 + //We can use this to verify the report sent properly. + + currentReport = pointing_device_get_report(); + //shifting and transferring the info to the mouse report varaible + //mouseReport.x = 127 max -127 min + currentReport.x = (int8_t) uart_data[6]; + //mouseReport.y = 127 max -127 min + currentReport.y = (int8_t) uart_data[7]; + //mouseReport.v = 127 max -127 min (scroll vertical) + currentReport.v = (int8_t) uart_data[8]; + //mouseReport.h = 127 max -127 min (scroll horizontal) + currentReport.h = (int8_t) uart_data[9]; + /* + currentReport.x = 0; + currentReport.y = 0; + currentReport.v = 0; + currentReport.h = 0;*/ + pointing_device_set_report(currentReport); + } else { + //xprintf("\r\nRequested packet, data 10 was %d but checksum was %d",(uart_data[10] & 0x0F), (checksum & 0x0F)); + } + //matrix_print(); + + matrix_scan_quantum(); + return 1; +} + +inline +bool matrix_is_on(uint8_t row, uint8_t col) +{ + return (matrix[row] & ((matrix_row_t)1.c` and see keymap document (you can find in top readme.md) and existent keymap files. + +To build the firmware binary hex file with a keymap just do `make` with a keymap like this: + +``` +$ make [default|jack|] +``` +Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. diff --git a/keyboards/dichotomy/rules.mk b/keyboards/dichotomy/rules.mk new file mode 100755 index 0000000000..4dbc999b74 --- /dev/null +++ b/keyboards/dichotomy/rules.mk @@ -0,0 +1,77 @@ + +OPT_DEFS += -DDICHOTOMY_PROMICRO +DICHOTOMY_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) + +# # project specific files +SRC = matrix.c + + +# MCU name +#MCU = at90usb1287 +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) + +# 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 = caterina + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# Build Options +# comment out to disable the options. +# +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +#MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +POINTING_DEVICE_ENABLE = yes # Generic Pointer, not as big as mouse keys hopefully. +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = yes # Console for debug(+400) +COMMAND_ENABLE = yes # Commands for debug and configuration +CUSTOM_MATRIX = yes # Remote matrix from the wireless bridge +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +# SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover - not yet supported in LUFA +# BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +# MIDI_ENABLE = YES # MIDI controls +UNICODE_ENABLE = YES # Unicode +# BLUETOOTH_ENABLE = yes # Enable Bluetooth with the Adafruit EZ-Key HID + +USB = /dev/ttyACM0 + +#upload: build +# $(DICHOTOMY_UPLOAD_COMMAND) -- cgit v1.2.3 From a5b43b35fe7543c7d146029b05b8c6a13f17cd3e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 6 Dec 2018 07:27:04 -0800 Subject: Sol rev1 Configurator support (#4562) Adds Configurator support for the Sol rev. 1 by RGBKB. Notes: The Sol keyboard supports split thumb keys like the Ergodox - any of the 2u thumb keys can be split into two 1u keys. The matrix here is configured for fully 1u keys on the thumbs. The Sol also supports installing a rotary encoder on each half. The key matrix given includes the encoders' functions, which are shown in the Configurator as two 1u keys side by side below each half's main key block. The left key of the two (for each side) represents that half's rotary encoder's counter-clockwise function, and the right key is that encoder's clockwise function. --- keyboards/sol/rev1/info.json | 91 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 keyboards/sol/rev1/info.json diff --git a/keyboards/sol/rev1/info.json b/keyboards/sol/rev1/info.json new file mode 100644 index 0000000000..40bc01f7ff --- /dev/null +++ b/keyboards/sol/rev1/info.json @@ -0,0 +1,91 @@ +{ + "keyboard_name": "Sol", + "url": "", + "maintainer": "Legonut", + "width": 17, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"L00", "x":0, "y":0, "w":1.5}, + {"label":"L01", "x":1.5, "y":0}, + {"label":"L02", "x":2.5, "y":0}, + {"label":"L03", "x":3.5, "y":0}, + {"label":"L04", "x":4.5, "y":0}, + {"label":"L05", "x":5.5, "y":0}, + {"label":"L06", "x":6.75, "y":0}, + {"label":"R06", "x":9.25, "y":0}, + {"label":"R00", "x":10.5, "y":0}, + {"label":"R01", "x":11.5, "y":0}, + {"label":"R02", "x":12.5, "y":0}, + {"label":"R03", "x":13.5, "y":0}, + {"label":"R04", "x":14.5, "y":0}, + {"label":"R05", "x":15.5, "y":0, "w":1.5}, + {"label":"L10", "x":0, "y":1, "w":1.5}, + {"label":"L11", "x":1.5, "y":1}, + {"label":"L12", "x":2.5, "y":1}, + {"label":"L13", "x":3.5, "y":1}, + {"label":"L14", "x":4.5, "y":1}, + {"label":"L15", "x":5.5, "y":1}, + {"label":"L16", "x":6.75, "y":1}, + {"label":"R16", "x":9.25, "y":1}, + {"label":"R10", "x":10.5, "y":1}, + {"label":"R11", "x":11.5, "y":1}, + {"label":"R12", "x":12.5, "y":1}, + {"label":"R13", "x":13.5, "y":1}, + {"label":"R14", "x":14.5, "y":1}, + {"label":"R15", "x":15.5, "y":1, "w":1.5}, + {"label":"L20", "x":0, "y":2, "w":1.5}, + {"label":"L21", "x":1.5, "y":2}, + {"label":"L22", "x":2.5, "y":2}, + {"label":"L23", "x":3.5, "y":2}, + {"label":"L24", "x":4.5, "y":2}, + {"label":"L25", "x":5.5, "y":2}, + {"label":"L26", "x":6.75, "y":2}, + {"label":"R26", "x":9.25, "y":2}, + {"label":"R20", "x":10.5, "y":2}, + {"label":"R21", "x":11.5, "y":2}, + {"label":"R22", "x":12.5, "y":2}, + {"label":"R23", "x":13.5, "y":2}, + {"label":"R24", "x":14.5, "y":2}, + {"label":"R25", "x":15.5, "y":2, "w":1.5}, + {"label":"L30", "x":0, "y":3, "w":1.5}, + {"label":"L31", "x":1.5, "y":3}, + {"label":"L32", "x":2.5, "y":3}, + {"label":"L33", "x":3.5, "y":3}, + {"label":"L34", "x":4.5, "y":3}, + {"label":"L35", "x":5.5, "y":3}, + {"label":"L36", "x":6.75, "y":3}, + {"label":"R36", "x":9.25, "y":3}, + {"label":"R30", "x":10.5, "y":3}, + {"label":"R31", "x":11.5, "y":3}, + {"label":"R32", "x":12.5, "y":3}, + {"label":"R33", "x":13.5, "y":3}, + {"label":"R34", "x":14.5, "y":3}, + {"label":"R35", "x":15.5, "y":3, "w":1.5}, + {"label":"L40", "x":0, "y":4, "w":1.5}, + {"label":"L41", "x":1.5, "y":4}, + {"label":"L42", "x":2.5, "y":4}, + {"label":"L43", "x":3.5, "y":4}, + {"label":"L44", "x":4.5, "y":4}, + {"label":"L45", "x":6, "y":4.5}, + {"label":"L46", "x":7, "y":4.5}, + {"label":"R46", "x":9, "y":4.5}, + {"label":"R40", "x":10, "y":4.5}, + {"label":"R41", "x":11.5, "y":4}, + {"label":"R42", "x":12.5, "y":4}, + {"label":"R43", "x":13.5, "y":4}, + {"label":"R44", "x":14.5, "y":4}, + {"label":"R45", "x":15.5, "y":4, "w":1.5}, + {"label":"Left Encoder, Counter-Clockwise", "x":2.5, "y":5.5}, + {"label":"Left Encoder, Clockwise", "x":3.5, "y":5.5}, + {"label":"L55", "x":6, "y":5.5}, + {"label":"L56", "x":7, "y":5.5}, + {"label":"R56", "x":9, "y":5.5}, + {"label":"R50", "x":10, "y":5.5}, + {"label":"Right Encoder, Counter-Clockwise", "x":12.5, "y":5.5}, + {"label":"Right Encoder, Clockwise", "x":13.5, "y":5.5} + ] + } + } +} -- cgit v1.2.3 From dee2faf387e4c2a6cefa09e8531b9113dd610a1a Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 6 Dec 2018 07:29:42 -0800 Subject: handwired/frenchdev Refactor, Configurator support and readme cleanup (#4561) * handwired/frenchdev: refactor - layout macro KEYMAP renamed to LAYOUT - default keymap - now uses #include QMK_KEYBOARD_H - updated layout macro names * handwired/frenchdev: Configurator support * handwired/frenchdev: readme cleanup Capitalization and markdown formatting fixes. --- keyboards/handwired/frenchdev/frenchdev.h | 2 +- keyboards/handwired/frenchdev/info.json | 114 +++++++++++++++++++++ .../handwired/frenchdev/keymaps/default/keymap.c | 14 ++- keyboards/handwired/frenchdev/readme.md | 16 +-- 4 files changed, 129 insertions(+), 17 deletions(-) create mode 100644 keyboards/handwired/frenchdev/info.json diff --git a/keyboards/handwired/frenchdev/frenchdev.h b/keyboards/handwired/frenchdev/frenchdev.h index 82121e044e..82dbe18b89 100644 --- a/keyboards/handwired/frenchdev/frenchdev.h +++ b/keyboards/handwired/frenchdev/frenchdev.h @@ -77,7 +77,7 @@ inline void frenchdev_led_all_set(uint8_t n) frenchdev_led_3_set(n); } -#define KEYMAP( \ +#define LAYOUT( \ \ k01, k02, k03, k04, k05, k06, k09, k0a, k0b, k0c, k0d, k0e, \ k10, k11, k12, k13, k14, k15, k16, k19, k1a, k1b, k1c, k1d, k1e, k1f, \ diff --git a/keyboards/handwired/frenchdev/info.json b/keyboards/handwired/frenchdev/info.json new file mode 100644 index 0000000000..0f3c0a94fd --- /dev/null +++ b/keyboards/handwired/frenchdev/info.json @@ -0,0 +1,114 @@ +{ + "keyboard_name": "", + "url": "", + "maintainer": "qmk", + "bootloader": "", + "width": 20, + "height": 8, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F1", "x":1, "y":0.9}, + {"label":"F2", "x":2, "y":0.3}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0.4}, + {"label":"F5", "x":5, "y":0.5}, + {"label":"F6", "x":6, "y":0.5}, + {"label":"F7", "x":13, "y":0.5}, + {"label":"F8", "x":14, "y":0.5}, + {"label":"F9", "x":15, "y":0.4}, + {"label":"F10", "x":16, "y":0}, + {"label":"F11", "x":17, "y":0.3}, + {"label":"F12", "x":18, "y":0.9}, + + {"label":"Esc", "x":0, "y":1.9}, + {"label":"\"", "x":1, "y":1.9}, + {"label":"\u00ab", "x":2, "y":1.3}, + {"label":"\u00bb", "x":3, "y":1}, + {"label":"(", "x":4, "y":1.4}, + {"label":")", "x":5, "y":1.5}, + {"label":"\u00a8", "x":6, "y":1.5}, + {"label":"^", "x":13, "y":1.5}, + {"label":"@", "x":14, "y":1.5}, + {"label":"+", "x":15, "y":1.4}, + {"label":"-", "x":16, "y":1}, + {"label":"/", "x":17, "y":1.3}, + {"label":"*", "x":18, "y":1.9}, + {"label":"Backspace", "x":19, "y":1.9}, + + {"label":"Tab", "x":0, "y":2.9}, + {"label":"B", "x":1, "y":2.9}, + {"label":"É", "x":2, "y":2.3}, + {"label":"P", "x":3, "y":2}, + {"label":"O", "x":4, "y":2.4}, + {"label":"È", "x":5, "y":2.5}, + {"label":"_", "x":6, "y":2.5}, + {"label":"=", "x":13, "y":2.5}, + {"label":"K", "x":14, "y":2.5}, + {"label":"V", "x":15, "y":2.4}, + {"label":"D", "x":16, "y":2}, + {"label":"L", "x":17, "y":2.3}, + {"label":"J", "x":18, "y":2.9}, + {"label":"Enter", "x":19, "y":2.9}, + + {"label":"`", "x":0, "y":3.9}, + {"label":"A", "x":1, "y":3.9}, + {"label":"U", "x":2, "y":3.3}, + {"label":"E", "x":3, "y":3}, + {"label":"I", "x":4, "y":3.4}, + {"label":"F", "x":5, "y":3.5}, + {"label":";", "x":6, "y":3.5}, + {"label":"!", "x":13, "y":3.5}, + {"label":"C", "x":14, "y":3.5}, + {"label":"T", "x":15, "y":3.4}, + {"label":"S", "x":16, "y":3}, + {"label":"R", "x":17, "y":3.3}, + {"label":"N", "x":18, "y":3.9}, + {"label":"'", "x":19, "y":3.9}, + + {"label":"Shift", "x":0, "y":4.9}, + {"label":"Z", "x":1, "y":4.9}, + {"label":"À", "x":2, "y":4.3}, + {"label":"Y", "x":3, "y":4}, + {"label":"X", "x":4, "y":4.4}, + {"label":"]", "x":5, "y":4.5}, + {"label":"Shift/Space", "x":6.5, "y":5}, + {"label":"Ctrl/Backspace", "x":7.5, "y":5}, + {"label":"Layer 2/Insert", "x":8.5, "y":5}, + {"label":"Layer 2 Lock", "x":10.5, "y":5}, + {"label":"Ctrl/Delete", "x":11.5, "y":5}, + {"label":"Shift/Space", "x":12.5, "y":5}, + {"label":"M", "x":14, "y":4.5}, + {"label":"G", "x":15, "y":4.4}, + {"label":"Up", "x":16, "y":4}, + {"label":"H", "x":17, "y":4.3}, + {"label":"Q", "x":18, "y":4.9}, + {"label":"Shift", "x":19, "y":4.9}, + + {"label":"Ctrl", "x":0, "y":5.9}, + {"label":"GUI", "x":1, "y":5.9}, + {"label":"Keypad /", "x":2, "y":5.3}, + {"label":".", "x":3, "y":5}, + {"label":",", "x":4, "y":5.4}, + {"label":"Space", "x":5, "y":5.5}, + {"label":"Layer 1/Space", "x":6.5, "y":6}, + {"label":"Alt", "x":7.5, "y":6}, + {"label":"Caps Lock", "x":11.5, "y":6}, + {"label":"Layer 1/Space", "x":12.5, "y":6}, + {"label":"Space", "x":14, "y":5.5}, + {"label":"Left", "x":15, "y":5.4}, + {"label":"Down", "x":16, "y":5}, + {"label":"Right", "x":17, "y":5.3}, + {"label":":", "x":18, "y":5.9}, + {"label":"Ctrl", "x":19, "y":5.9}, + + {"label":"Left Pedal 1", "x":2.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Left Pedal 2", "x":3.75, "y":7.5, "w":1.5, "h":2}, + {"label":"Left Pedal 3", "x":5.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 1", "x":13.25, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 2", "x":14.75, "y":7.5, "w":1.5, "h":2}, + {"label":"Right Pedal 3", "x":16.25, "y":7.5, "w":1.5, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/frenchdev/keymaps/default/keymap.c b/keyboards/handwired/frenchdev/keymaps/default/keymap.c index e6d72d0131..635383b55b 100644 --- a/keyboards/handwired/frenchdev/keymaps/default/keymap.c +++ b/keyboards/handwired/frenchdev/keymaps/default/keymap.c @@ -1,8 +1,6 @@ -#include "frenchdev.h" +#include QMK_KEYBOARD_H #include "mousekey.h" -#include "action.h" -#include "action_layer.h" -#include "keymap_extras/keymap_bepo.h" +#include "keymap_bepo.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -67,7 +65,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------/ \-------------/ .. \-------------/ \-------------/ * *M(M_LP) */ -[_BASE] = KEYMAP( +[_BASE] = LAYOUT( 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_ESC, BP_DQOT, BP_LGIL, BP_RGIL, BP_LPRN, BP_RPRN, BP_DTRM, BP_DCRC, BP_AT, BP_PLUS, BP_MINS, BP_SLSH, BP_ASTR, KC_BSPC, \ KC_TAB, BP_B, BP_ECUT, BP_O, BP_P, BP_EGRV, BP_UNDS, BP_EQL, BP_K, BP_V, BP_D, BP_L, BP_J, KC_ENT, \ @@ -99,7 +97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------/ \-------------/ .. \-------------/ \-------------/ * * */ -[_SYMBOLS] = KEYMAP( +[_SYMBOLS] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, BP_DCUR, BP_PARG, BP_SECT, BP_DGRK, KC_TRNS, BP_TILD, BP_DCAR, BP_LEQL, BP_GEQL, BP_PSMS, BP_OBEL, BP_TIMS, KC_TRNS, \ KC_TRNS, BP_BSLS, BP_ASTR, BP_LCBR, BP_RCBR, BP_GRV, KC_TRNS, BP_DIFF, BP_HASH, BP_LBRC, BP_RBRC, BP_PERC, BP_PMIL, KC_TRNS, \ @@ -131,7 +129,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------/ \-------------/ .. \-------------/ \-------------/ * * */ -[_MEDIA] = KEYMAP( +[_MEDIA] = LAYOUT( RESET, KC_SLCK, KC_PAUS, KC_MUTE, KC_VOLD, KC_VOLU, KC_MUTE, KC_VOLD, KC_VOLU, KC_PSCR, KC_CALC, KC_NLCK, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_MSTP, KC_MPRV, KC_MNXT, KC_MPLY, KC_MPLY, KC_MPRV, KC_MNXT, KC_MSTP, KC_TRNS, KC_PMNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_WH_U, KC_TRNS, KC_BTN4, KC_BTN5, KC_BTN4, KC_BTN5, KC_KP_7, KC_KP_8, KC_KP_9, KC_PPLS, KC_TRNS, \ @@ -163,7 +161,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * */ -[_TRNS] = KEYMAP( +[_TRNS] = LAYOUT( KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ diff --git a/keyboards/handwired/frenchdev/readme.md b/keyboards/handwired/frenchdev/readme.md index 698b4befb2..9d7c59e71f 100644 --- a/keyboards/handwired/frenchdev/readme.md +++ b/keyboards/handwired/frenchdev/readme.md @@ -6,29 +6,29 @@ Concept based on with the added possibility to connect up to 6 external switches like pedals, and somewhat like the katy, not all keys are on the same level for easier reach. -###Photos +### Photos - [default layout](http://i.imgur.com/r2Nvr4p.png) - [editable layout on keyboard layout editor](http://www.keyboard-layout-editor.com/#/gists/4480e3ab8026eb7c710a7e22203ef4aa) (keys placement is NOT precise on this) - [the thing when finished](http://imgur.com/a/6FY8v) - [concept and cardboard mockup](http://imgur.com/a/R0vvs) -##Build instructions +## Build instructions docker run --rm -e keymap=default -e keyboard=frenchdev --rm -v D:/Repositories/qmk:/qmk:rw edasque/qmk_firmware -##Laser-cuttable file +## Laser-cuttable file There is intentionnaly no hole for the TRRS connector, you are supposed to use a drill for it. This way if you don't want to use the pedals you don't have a useless hole. Plus it's cleaner. http://qmk.fm/frenchdev/frenchdev_v1_lasercut_template.svg -##Side stickers +## Side stickers You can find my original file here : http://qmk.fm/frenchdev/example_printable_stickers.svg I used it when training but now I use blanks and the layout is different. I still uploaded it because I think it can be a good jumpstart for any temporary stickers on the side of keycaps. -##List of parts +## List of parts - I2C mcp23018 - [teensy 2](https://www.pjrc.com/store/teensy.html) - 3 LED, 5mm tall with flat head @@ -43,13 +43,13 @@ side of keycaps. - 20 R2 keys - 22 R1 keys -if you fancy adding pedals : +If you fancy adding pedals : [these are good enough and cheap](https://www.amazon.fr/gp/product/B00V7WITKI/ref=oh_aui_detailpage_o04_s00?ie=UTF8&psc=1). You also need a RCA connector for each of those to replace the included cable If you (or your coworkers) find them too loud you can replace the switch inside them. For once we don't really care about what's inside :) -##Various indications +## Various indications The PHYSICAL rows and columns are connected as such : @@ -96,7 +96,7 @@ and on left hand (main) : We use pull up resistor for SCL and VDA, see https://github.com/ErgoDox-EZ/docs/blob/master/ErgoDox%20EZ%20Schematic.pdf for example -the connector is a standard TRRS (jack with audio + mic) +The connector is a standard TRRS (jack with audio + mic) Diode direction is row to column -- cgit v1.2.3 From 4e5f921496faf29e5c7f61e388346f2181fab267 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 6 Dec 2018 07:40:19 -0800 Subject: Allow HS60 to use Community Layouts (#3862) * Add layout support to HS60 * Update Readme for HS60 * Remove defective code * Clean up readme * Fix typo --- keyboards/hs60/v1/keymaps/ansi/config.h | 4 +++- keyboards/hs60/v1/readme.md | 6 +++++- keyboards/hs60/v1/rules.mk | 2 ++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/keyboards/hs60/v1/keymaps/ansi/config.h b/keyboards/hs60/v1/keymaps/ansi/config.h index f51cc16d85..82cdc2689c 100644 --- a/keyboards/hs60/v1/keymaps/ansi/config.h +++ b/keyboards/hs60/v1/keymaps/ansi/config.h @@ -18,4 +18,6 @@ along with this program. If not, see . /* Include overwrites for specific keymap */ -#define HS60_ANSI +#ifdef KEYBOARD_hs60 + #define HS60_ANSI +#endif diff --git a/keyboards/hs60/v1/readme.md b/keyboards/hs60/v1/readme.md index a77bbc25ca..9034e9b881 100644 --- a/keyboards/hs60/v1/readme.md +++ b/keyboards/hs60/v1/readme.md @@ -9,7 +9,11 @@ Keyboard Maintainer: [Yiancar](http://yiancar-designs.com/) and on [github](http Hardware Supported: HS60 ISO and ANSI PCBs with Atmega 32u4 Hardware Availability: https://mechboards.co.uk/shop/all/hs60-pcb/ -Due to the RGB implementation, the HS60 is currently not compatible with community layouts. +If you're using the [community layouts feature](https://docs.qmk.fm/#/feature_layouts) and using the 60_ansi layout, you need to make sure that you include this on your config.h to ensure that the RGB Matrix is properly configured: + + #ifdef KEYBOARD_hs60 + #define HS60_ANSI + #endif Make example for this keyboard (after setting up your build environment): diff --git a/keyboards/hs60/v1/rules.mk b/keyboards/hs60/v1/rules.mk index bff9659489..29e91aa24c 100644 --- a/keyboards/hs60/v1/rules.mk +++ b/keyboards/hs60/v1/rules.mk @@ -69,6 +69,8 @@ AUDIO_ENABLE = no # Audio output on port C6 FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RGB_MATRIX_ENABLE = yes # Use RGB matrix +LAYOUTS = 60_ansi 60_iso + # Experimental features for zealcmd please do no enable #RAW_ENABLE = yes #USE_KEYMAPS_IN_EEPROM = yes -- cgit v1.2.3 From 42c9fd262585c9ba46a726604d60eb6c42b3cda7 Mon Sep 17 00:00:00 2001 From: fauxpark Date: Fri, 7 Dec 2018 03:31:17 +1100 Subject: Delete docs/keycode.txt (#4505) --- docs/keycode.txt | 263 ------------------------------------------------------- 1 file changed, 263 deletions(-) delete mode 100644 docs/keycode.txt diff --git a/docs/keycode.txt b/docs/keycode.txt deleted file mode 100644 index bd93b0a941..0000000000 --- a/docs/keycode.txt +++ /dev/null @@ -1,263 +0,0 @@ -Keycode Symbol Table -==================== -Keycodes are defined in `common/keycode.h`. -Range of 00-A4 and E0-E7 are identical with HID Usage: - -Virtual keycodes are defined out of above range to support special actions. - - -Keycode Symbol Short name Description --------------------------------------------------------------------------------- -KC_NO 00 Reserved (no event indicated) -KC_ROLL_OVER 01 Keyboard ErrorRollOver -KC_POST_FAIL 02 Keyboard POSTFail -KC_UNDEFINED 03 Keyboard ErrorUndefined -KC_A 04 Keyboard a and A -KC_B 05 Keyboard b and B -KC_C 06 Keyboard c and C -KC_D 07 Keyboard d and D -KC_E 08 Keyboard e and E -KC_F 09 Keyboard f and F -KC_G 0A Keyboard g and G -KC_H 0B Keyboard h and H -KC_I 0C Keyboard i and I -KC_J 0D Keyboard j and J -KC_K 0E Keyboard k and K -KC_L 0F Keyboard l and L -KC_M 10 Keyboard m and M -KC_N 11 Keyboard n and N -KC_O 12 Keyboard o and O -KC_P 13 Keyboard p and P -KC_Q 14 Keyboard q and Q -KC_R 15 Keyboard r and R -KC_S 16 Keyboard s and S -KC_T 17 Keyboard t and T -KC_U 18 Keyboard u and U -KC_V 19 Keyboard v and V -KC_W 1A Keyboard w and W -KC_X 1B Keyboard x and X -KC_Y 1C Keyboard y and Y -KC_Z 1D Keyboard z and Z -KC_1 1E Keyboard 1 and ! -KC_2 1F Keyboard 2 and @ -KC_3 20 Keyboard 3 and # -KC_4 21 Keyboard 4 and $ -KC_5 22 Keyboard 5 and % -KC_6 23 Keyboard 6 and ^ -KC_7 24 Keyboard 7 and & -KC_8 25 Keyboard 8 and * -KC_9 26 Keyboard 9 and ( -KC_0 27 Keyboard 0 and ) -KC_ENTER KC_ENT 28 Keyboard Return (ENTER) -KC_ESCAPE KC_ESC 29 Keyboard ESCAPE -KC_BSPACE KC_BSPC 2A Keyboard DELETE (Backspace) -KC_TAB 2B Keyboard Tab -KC_SPACE KC_SPC 2C Keyboard Spacebar -KC_MINUS KC_MINS 2D Keyboard - and (underscore) -KC_EQUAL KC_EQL 2E Keyboard = and + -KC_LBRACKET KC_LBRC 2F Keyboard [ and { -KC_RBRACKET KC_RBRC 30 Keyboard ] and } -KC_BSLASH KC_BSLS 31 Keyboard \ and | -KC_NONUS_HASH KC_NUHS 32 Keyboard Non-US # and ~ -KC_SCOLON KC_SCLN 33 Keyboard ; and : -KC_QUOTE KC_QUOT 34 Keyboard ‘ and “ -KC_GRAVE KC_GRV 35 Keyboard Grave Accent and Tilde -KC_COMMA KC_COMM 36 Keyboard , and < -KC_DOT 37 Keyboard . and > -KC_SLASH KC_SLSH 38 Keyboard / and ? -KC_CAPSLOCK KC_CAPS 39 Keyboard Caps Lock -KC_F1 3A Keyboard F1 -KC_F2 3B Keyboard F2 -KC_F3 3C Keyboard F3 -KC_F4 3D Keyboard F4 -KC_F5 3E Keyboard F5 -KC_F6 3F Keyboard F6 -KC_F7 40 Keyboard F7 -KC_F8 41 Keyboard F8 -KC_F9 42 Keyboard F9 -KC_F10 43 Keyboard F10 -KC_F11 44 Keyboard F11 -KC_F12 45 Keyboard F12 -KC_PSCREEN KC_PSCR 46 Keyboard PrintScreen -KC_SCROLLLOCK KC_SLCK 47 Keyboard Scroll Lock -KC_PAUSE KC_PAUS 48 Keyboard Pause -KC_INSERT KC_INS 49 Keyboard Insert -KC_HOME 4A Keyboard Home -KC_PGUP 4B Keyboard PageUp -KC_DELETE KC_DEL 4C Keyboard Delete Forward -KC_END 4D Keyboard End -KC_PGDOWN KC_PGDN 4E Keyboard PageDown -KC_RIGHT KC_RGHT 4F Keyboard RightArrow -KC_LEFT 50 Keyboard LeftArrow -KC_DOWN 51 Keyboard DownArrow -KC_UP 52 Keyboard UpArrow -KC_NUMLOCK KC_NLCK 53 Keypad Num Lock and Clear -KC_KP_SLASH KC_PSLS 54 Keypad / -KC_KP_ASTERISK KC_PAST 55 Keypad * -KC_KP_MINUS KC_PMNS 56 Keypad - -KC_KP_PLUS KC_PPLS 57 Keypad + -KC_KP_ENTER KC_PENT 58 Keypad ENTER -KC_KP_1 KC_P1 59 Keypad 1 and End -KC_KP_2 KC_P2 5A Keypad 2 and Down Arrow -KC_KP_3 KC_P3 5B Keypad 3 and PageDn -KC_KP_4 KC_P4 5C Keypad 4 and Left Arrow -KC_KP_5 KC_P5 5D Keypad 5 -KC_KP_6 KC_P6 5E Keypad 6 and Right Arrow -KC_KP_7 KC_P7 5F Keypad 7 and Home -KC_KP_8 KC_P8 60 Keypad 8 and Up Arrow -KC_KP_9 KC_P9 61 Keypad 9 and PageUp -KC_KP_0 KC_P0 62 Keypad 0 and Insert -KC_KP_DOT KC_PDOT 63 Keypad . and Delete -KC_NONUS_BSLASH KC_NUBS 64 Keyboard Non-US \ and | -KC_APPLICATION KC_APP 65 Keyboard Application -KC_POWER 66 Keyboard Power -KC_KP_EQUAL KC_PEQL 67 Keypad = -KC_F13 68 Keyboard F13 -KC_F14 69 Keyboard F14 -KC_F15 6A Keyboard F15 -KC_F16 6B Keyboard F16 -KC_F17 6C Keyboard F17 -KC_F18 6D Keyboard F18 -KC_F19 6E Keyboard F19 -KC_F20 6F Keyboard F20 -KC_F21 70 Keyboard F21 -KC_F22 71 Keyboard F22 -KC_F23 72 Keyboard F23 -KC_F24 73 Keyboard F24 -KC_EXECUTE 74 Keyboard Execute -KC_HELP 75 Keyboard Help -KC_MENU 76 Keyboard Menu -KC_SELECT 77 Keyboard Select -KC_STOP 78 Keyboard Stop -KC_AGAIN 79 Keyboard Again -KC_UNDO 7A Keyboard Undo -KC_CUT 7B Keyboard Cut -KC_COPY 7C Keyboard Copy -KC_PASTE 7D Keyboard Paste -KC_FIND 7E Keyboard Find -KC__MUTE 7F Keyboard Mute -KC__VOLUP 80 Keyboard Volume Up -KC__VOLDOWN 81 Keyboard Volume Down -KC_LOCKING_CAPS 82 Keyboard Locking Caps Lock -KC_LOCKING_NUM 83 Keyboard Locking Num Lock -KC_LOCKING_SCROLL 84 Keyboard Locking Scroll Lock -KC_KP_COMMA KC_PCMM 85 Keypad Comma -KC_KP_EQUAL_AS400 86 Keypad Equal Sign -KC_INT1 KC_RO 87 Keyboard International115 -KC_INT2 KC_KANA 88 Keyboard International216 -KC_INT3 KC_JYEN 89 Keyboard International317 -KC_INT4 KC_HENK 8A Keyboard International418 -KC_INT5 KC_MHEN 8B Keyboard International519 -KC_INT6 8C Keyboard International620 -KC_INT7 8D Keyboard International721 -KC_INT8 8E Keyboard International822 -KC_INT9 8F Keyboard International922 -KC_LANG1 90 Keyboard LANG125 -KC_LANG2 91 Keyboard LANG226 -KC_LANG3 92 Keyboard LANG330 -KC_LANG4 93 Keyboard LANG431 -KC_LANG5 94 Keyboard LANG532 -KC_LANG6 95 Keyboard LANG68 -KC_LANG7 96 Keyboard LANG78 -KC_LANG8 97 Keyboard LANG88 -KC_LANG9 98 Keyboard LANG98 -KC_ALT_ERASE 99 Keyboard Alternate Erase -KC_SYSREQ 9A Keyboard SysReq/Attention -KC_CANCEL 9B Keyboard Cancel -KC_CLEAR 9C Keyboard Clear -KC_PRIOR 9D Keyboard Prior -KC_RETURN 9E Keyboard Return -KC_SEPARATOR 9F Keyboard Separator -KC_OUT A0 Keyboard Out -KC_OPER A1 Keyboard Oper -KC_CLEAR_AGAIN A2 Keyboard Clear/Again -KC_CRSEL A3 Keyboard CrSel/Props -KC_EXSEL A4 Keyboard ExSel -/* Modifiers */ -KC_LCTRL KC_LCTL E0 Keyboard LeftControl -KC_LSHIFT KC_LSFT E1 Keyboard LeftShift -KC_LALT E2 Keyboard LeftAlt -KC_LGUI E3 Keyboard Left GUI(Windows/Apple/Meta key) -KC_RCTRL KC_RCTL E4 Keyboard RightControl -KC_RSHIFT KC_RSFT E5 Keyboard RightShift -KC_RALT E6 Keyboard RightAlt -KC_RGUI E7 Keyboard Right GUI(Windows/Apple/Meta key) - -/* - * Virtual keycodes - */ -/* System Control */ -KC_SYSTEM_POWER KC_PWR System Power Down -KC_SYSTEM_SLEEP KC_SLEP System Sleep -KC_SYSTEM_WAKE KC_WAKE System Wake -/* Consumer Page */ -KC_AUDIO_MUTE KC_MUTE -KC_AUDIO_VOL_UP KC_VOLU -KC_AUDIO_VOL_DOWN KC_VOLD -KC_MEDIA_NEXT_TRACK KC_MNXT -KC_MEDIA_PREV_TRACK KC_MPRV -KC_MEDIA_STOP KC_MSTP -KC_MEDIA_PLAY_PAUSE KC_MPLY -KC_MEDIA_SELECT KC_MSEL -KC_MAIL KC_MAIL -KC_CALCULATOR KC_CALC -KC_MY_COMPUTER KC_MYCM -KC_WWW_SEARCH KC_WSCH -KC_WWW_HOME KC_WHOM -KC_WWW_BACK KC_WBAK -KC_WWW_FORWARD KC_WFWD -KC_WWW_STOP KC_WSTP -KC_WWW_REFRESH KC_WREF -KC_WWW_FAVORITES KC_WFAV -KC_BRIGHTNESS_UP KC_BRIU -KC_BRIGHTNESS_DOWN KC_BRID -/* Mousekey */ -KC_MS_UP KC_MS_U Mouse Cursor Up -KC_MS_DOWN KC_MS_D Mouse Cursor Down -KC_MS_LEFT KC_MS_L Mouse Cursor Left -KC_MS_RIGHT KC_MS_R Mouse Cursor Right -KC_MS_BTN1 KC_BTN1 Mouse Button 1 -KC_MS_BTN2 KC_BTN2 Mouse Button 2 -KC_MS_BTN3 KC_BTN3 Mouse Button 3 -KC_MS_BTN4 KC_BTN4 Mouse Button 4 -KC_MS_BTN5 KC_BTN5 Mouse Button 5 -KC_MS_WH_UP KC_WH_U Mouse Wheel Up -KC_MS_WH_DOWN KC_WH_D Mouse Wheel Down -KC_MS_WH_LEFT KC_WH_L Mouse Wheel Left -KC_MS_WH_RIGHT KC_WH_R Mouse Wheel Right -KC_MS_ACCEL0 KC_ACL0 Mouse Acceleration 0 -KC_MS_ACCEL1 KC_ACL1 Mouse Acceleration 1 -KC_MS_ACCEL2 KC_ACL2 Mouse Acceleration 2 -/* Fn key */ -KC_FN0 -KC_FN1 -KC_FN2 -KC_FN3 -KC_FN4 -KC_FN5 -KC_FN6 -KC_FN7 -KC_FN8 -KC_FN9 -KC_FN10 -KC_FN11 -KC_FN12 -KC_FN13 -KC_FN14 -KC_FN15 -KC_FN16 -KC_FN17 -KC_FN18 -KC_FN19 -KC_FN20 -KC_FN21 -KC_FN22 -KC_FN23 -KC_FN24 -KC_FN25 -KC_FN26 -KC_FN27 -KC_FN28 -KC_FN29 -KC_FN30 -KC_FN31 -- cgit v1.2.3 From 21bc230dfdc29a03d6cf08b9c0ac438eadd3bf42 Mon Sep 17 00:00:00 2001 From: Ian O'Dea Date: Thu, 6 Dec 2018 10:58:58 -0600 Subject: Vertical animation support for arm_atsam led_matrix (#4538) * Add initial support for vertically-oriented animations * DRY up vertical animation support * Fix animation code for arm_atsam led_matrix to work in all directions * Adjust py calculation to base off bottom rather than top --- tmk_core/protocol/arm_atsam/led_matrix.c | 73 ++++++++++++++++++-------------- tmk_core/protocol/arm_atsam/led_matrix.h | 1 + 2 files changed, 43 insertions(+), 31 deletions(-) diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index c328fdc4ce..729e042a6e 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -226,7 +226,7 @@ void disp_pixel_setup(void) while (cur < lede) { cur->px = (cur->x - disp.left) / disp.width * 100; - cur->py = (cur->y - disp.top) / disp.height * 100; + cur->py = (cur->y - disp.bottom) / disp.height * 100; *cur->rgb.r = 0; *cur->rgb.g = 0; *cur->rgb.b = 0; @@ -244,6 +244,7 @@ void led_matrix_prepare(void) uint8_t led_enabled; float led_animation_speed; uint8_t led_animation_direction; +uint8_t led_animation_orientation; uint8_t led_animation_breathing; uint8_t led_animation_breathe_cur; uint8_t breathe_step; @@ -263,7 +264,7 @@ void led_matrix_run(void) float ro; float go; float bo; - float px; + float po; uint8_t led_this_run = 0; led_setup_t *f = (led_setup_t*)led_setups[led_animation_id]; @@ -325,59 +326,68 @@ void led_matrix_run(void) //Act on LED for (fcur = 0; fcur < fmax; fcur++) { - px = led_cur->px; - float pxmod; - pxmod = (float)(disp.frame % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; + + if (led_animation_orientation) + { + po = led_cur->py; + } + else + { + po = led_cur->px; + } + + float pomod; + pomod = (float)(disp.frame % (uint32_t)(1000.0f / led_animation_speed)) / 10.0f * led_animation_speed; //Add in any moving effects if ((!led_animation_direction && f[fcur].ef & EF_SCR_R) || (led_animation_direction && (f[fcur].ef & EF_SCR_L))) { - pxmod *= 100.0f; - pxmod = (uint32_t)pxmod % 10000; - pxmod /= 100.0f; + pomod *= 100.0f; + pomod = (uint32_t)pomod % 10000; + pomod /= 100.0f; - px -= pxmod; + po -= pomod; - if (px > 100) px -= 100; - else if (px < 0) px += 100; + if (po > 100) po -= 100; + else if (po < 0) po += 100; } else if ((!led_animation_direction && f[fcur].ef & EF_SCR_L) || (led_animation_direction && (f[fcur].ef & EF_SCR_R))) { - pxmod *= 100.0f; - pxmod = (uint32_t)pxmod % 10000; - pxmod /= 100.0f; - px += pxmod; + pomod *= 100.0f; + pomod = (uint32_t)pomod % 10000; + pomod /= 100.0f; + po += pomod; - if (px > 100) px -= 100; - else if (px < 0) px += 100; + if (po > 100) po -= 100; + else if (po < 0) po += 100; } - //Check if LED's px is in current frame - if (px < f[fcur].hs) continue; - if (px > f[fcur].he) continue; + //Check if LED's po is in current frame + if (po < f[fcur].hs) continue; + if (po > f[fcur].he) continue; //note: < 0 or > 100 continue - //Calculate the px within the start-stop percentage for color blending - px = (px - f[fcur].hs) / (f[fcur].he - f[fcur].hs); + //Calculate the po within the start-stop percentage for color blending + po = (po - f[fcur].hs) / (f[fcur].he - f[fcur].hs); //Add in any color effects if (f[fcur].ef & EF_OVER) { - ro = (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go = (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo = (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + ro = (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go = (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo = (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; } else if (f[fcur].ef & EF_SUBTRACT) { - ro -= (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go -= (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo -= (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + ro -= (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go -= (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo -= (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; } else { - ro += (px * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; - go += (px * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; - bo += (px * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; + ro += (po * (f[fcur].re - f[fcur].rs)) + f[fcur].rs;// + 0.5; + go += (po * (f[fcur].ge - f[fcur].gs)) + f[fcur].gs;// + 0.5; + bo += (po * (f[fcur].be - f[fcur].bs)) + f[fcur].bs;// + 0.5; } } } @@ -451,6 +461,7 @@ uint8_t led_matrix_init(void) led_lighting_mode = LED_MODE_NORMAL; led_animation_speed = 4.0f; led_animation_direction = 0; + led_animation_orientation = 0; led_animation_breathing = 0; led_animation_breathe_cur = BREATHE_MIN_STEP; breathe_step = 1; diff --git a/tmk_core/protocol/arm_atsam/led_matrix.h b/tmk_core/protocol/arm_atsam/led_matrix.h index 3f2b9cdb86..cedea8a856 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.h +++ b/tmk_core/protocol/arm_atsam/led_matrix.h @@ -125,6 +125,7 @@ extern uint8_t led_enabled; extern float led_animation_speed; extern uint8_t led_lighting_mode; extern uint8_t led_animation_direction; +extern uint8_t led_animation_orientation; extern uint8_t led_animation_breathing; extern uint8_t led_animation_breathe_cur; extern uint8_t breathe_dir; -- cgit v1.2.3 From 2fb14845d503f01bc5a15c95c8d1d51be73f98b5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 6 Dec 2018 15:19:40 -0800 Subject: handwired/gamenum Refactor, Configurator support and readme cleanup (#4563) * handwired/gamenum: refactor - layout macro KEYMAP renamed to LAYOUT - white space changes for alignment - default keymap - now uses #include QMK_KEYBOARD_H - updated layout macro names - white space changes (for readability) * handwired/gamenum: Configurator support * handwired/gamenum: readme cleanup - renamed file to lowercase - updated to match current QMK template more closely - edits to reflect the other changes in this PR --- keyboards/handwired/gamenum/README.md | 102 --------------------- keyboards/handwired/gamenum/gamenum.h | 18 ++-- keyboards/handwired/gamenum/info.json | 30 ++++++ .../handwired/gamenum/keymaps/default/keymap.c | 76 ++++++++------- keyboards/handwired/gamenum/readme.md | 85 +++++++++++++++++ 5 files changed, 160 insertions(+), 151 deletions(-) delete mode 100644 keyboards/handwired/gamenum/README.md create mode 100644 keyboards/handwired/gamenum/info.json create mode 100644 keyboards/handwired/gamenum/readme.md diff --git a/keyboards/handwired/gamenum/README.md b/keyboards/handwired/gamenum/README.md deleted file mode 100644 index bf8045be19..0000000000 --- a/keyboards/handwired/gamenum/README.md +++ /dev/null @@ -1,102 +0,0 @@ -GameNum firmware -====================== -## Board overview - -The GameNum was designed to facilitate the use of mechanical keys for gaming even when your packing space is limited. -It uses a standard numpad layout replacing the NumLock key with a layer toggle that allows you to cycle through the different layers. -The standard layout features a default layer that acts as a standard numpad, a layer that was meant for simple WASD based games and a layer that was designed to be used for MOBA/RTS related games. -The RTS layer is meant to be used rotating the device 90 degrees counterclockwise. - -The README.MD for this board is reasonably extensive and in-depth because the build is quite small and covers a lot of things that I feel that it would be a good starting point for getting into QMK. - -## Build considerations - -Since the GameNum is handwired and uses 2 of its pins to toggle indicator lights there are some things to keep in mind. -Firmware was build for use with a Pro Micro based on a ATMEGA32u4 at 16mHz. -The indicator LED's are normally assigned to `pin C6` and `pin D4`, C6 goes high when the first layer is used, D4 goes high when layer 2 is used. Both LED's are off when the default layer is enabled. -'+' of the LED goes to the respective pins and can be joined together on the '-' into a resistor that runs to the ground pin of the pro micro. With a standard LED a resistor value of 100 ohm is fine, keep in mind that you cannot use high powered LEDS on these pins without ruining your pro micro. - -## schematic of the switches and diodes - -![schematic overview](http://i.imgur.com/fleitoA.jpg) - -Keep in mind that the minus of the diodes should point towards the pro micros inputs. - -##LED hookup - -![led overview](http://i.imgur.com/U6m865n.jpg) - -## Adding more layers - -Adding additional layers is pretty straight forward. Look in `keymaps/default/keymap.c` and find `#define OSY 2` add a new definition for the layer you are going to add. This can be named pretty much anything. Example: `#define NAMEHERE 3`. -Keep in mind here that the number after the name should correspond with the number that the layer has in the stack of layers. - -Next thing to do is to add the actual layer for the keymap. - -``` -[DEF] = KEYMAP( - KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ - KC_7, KC_8, KC_9, KC_PLUS, \ - KC_4, KC_5, KC_6, \ - KC_1, KC_2, KC_3, \ - KC_0, KC_DOT, KC_ENT \ -) -``` - -This is the default layer for the gamenum. It's generally easiest to just copy this and change things as you see fit. Keep in mind that at least 1 button on the pad has to be used to switch to the next layer in the stack or you will be stuck in that layer FOREVER! D: -In the case of DEF this is key `KC_FN0`. Also keep in mind that the last layer that you add does not have a comma after its closing bracket but any other layer does! - -Which brings us nicely to the next part, the layer switching logic. Under the keymaps look for `PROGMEM fn_actions[]` this function handles the switching between layers, as you might have noticed every layer in the keymap has its own KC_FNx key. This is the key responsible for switching you from layer to layer. -The number that is at the end of the keycode corresponds with the code in the function. -`[0] = ACTION_LAYER_SET(HDN, ON_PRESS),` When `KC_FN0` is pressed the keyboard switches layer `HDN` on when the key is pressed down. Add an extra line for your layer here as well. - -Now for the LEDs, if you plan on adding extra LED's to the keyboard to indicate other layers you have to first define the pin that the LED will be using in `gamenum.c`. -Look for this piece of code: - -``` - DDRD |= (1<<4); - PORTD &= ~(1<<4); -``` - -Copy it and change the letter after DDR and PORT to the letter of your pin. Change the 4 to the number of your pin. `DDRx |= (1<event.pressed) { - PORTC &= ~(1 << 6); // PC6 goes low - PORTD |= (1<<4); //PD4 goes high - } - break; -``` - -This is the code for the KC_FN1 button. Notice how we check against what key is pressed in the case and then set pin C6 low and pin D4 high. Adjust this as you see fit. - - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/docs/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/gamenum folder. -Read the README.md for the qmk repository on how to set up your developer enviroment to build your firmware with. -Building firmware on Windows can be a bit of a hassle. Linux is a lot easier to use if you have some experience with it. A raspberry pi will already be able to build the firmware for you. -Once your dev env is set up, you'll be able to type `make` to generate your .hex - you can then use AVRDudess to program your .hex file. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` - - diff --git a/keyboards/handwired/gamenum/gamenum.h b/keyboards/handwired/gamenum/gamenum.h index ea633b9bfa..3a1429ff8c 100644 --- a/keyboards/handwired/gamenum/gamenum.h +++ b/keyboards/handwired/gamenum/gamenum.h @@ -3,19 +3,19 @@ #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, \ k10, k11, k12, k13, \ - k20, k21, k22, \ - k30, k31, k32, \ - k41, k42, k43 \ + k20, k21, k22, \ + k30, k31, k32, \ + k41, k42, k43 \ ) \ { \ - { k00, k01, k02, k03}, \ - { k10, k11, k12, k13}, \ - { k20, k21, k22, KC_NO}, \ - { k30, k31, k32, KC_NO}, \ - { KC_NO, k41, k42, k43} \ + { k00, k01, k02, k03 }, \ + { k10, k11, k12, k13 }, \ + { k20, k21, k22, KC_NO }, \ + { k30, k31, k32, KC_NO }, \ + { KC_NO, k41, k42, k43 } \ } #endif diff --git a/keyboards/handwired/gamenum/info.json b/keyboards/handwired/gamenum/info.json new file mode 100644 index 0000000000..dc80f027e8 --- /dev/null +++ b/keyboards/handwired/gamenum/info.json @@ -0,0 +1,30 @@ +{ + "keyboard_name": "gamenum", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Fn", "x":0, "y":0}, + {"label":"/", "x":1, "y":0}, + {"label":"*", "x":2, "y":0}, + {"label":"-", "x":3, "y":0}, + {"label":"7", "x":0, "y":1}, + {"label":"8", "x":1, "y":1}, + {"label":"9", "x":2, "y":1}, + {"label":"+", "x":3, "y":1, "h":2}, + {"label":"4", "x":0, "y":2}, + {"label":"5", "x":1, "y":2}, + {"label":"6", "x":2, "y":2}, + {"label":"1", "x":0, "y":3}, + {"label":"2", "x":1, "y":3}, + {"label":"3", "x":2, "y":3}, + {"label":"0", "x":0, "y":4, "w":2}, + {"label":".", "x":2, "y":4}, + {"label":"Ent", "x":3, "y":3, "h":2} + ] + } + } +} diff --git a/keyboards/handwired/gamenum/keymaps/default/keymap.c b/keyboards/handwired/gamenum/keymaps/default/keymap.c index 6950b741a3..a18ffc89b9 100644 --- a/keyboards/handwired/gamenum/keymaps/default/keymap.c +++ b/keyboards/handwired/gamenum/keymaps/default/keymap.c @@ -1,36 +1,32 @@ -#include "gamenum.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H -#define _______ KC_TRNS - #define DEF 0 #define HDN 1 #define OSY 2 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[DEF] = KEYMAP( - KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ - KC_7, KC_8, KC_9, KC_PLUS, \ - KC_4, KC_5, KC_6, \ - KC_1, KC_2, KC_3, \ - KC_0, KC_DOT, KC_ENT \ -), -[HDN] = KEYMAP( - KC_FN1, KC_1, KC_2, KC_3, \ - KC_Q, KC_W, KC_E, KC_R, \ - KC_A, KC_S, KC_D, \ - KC_Z, KC_X, KC_C, \ - KC_LSFT, KC_LALT, KC_SPC \ -), -[OSY] = KEYMAP( - KC_A, KC_Q, KC_1, KC_FN2, \ - KC_S, KC_W, KC_2, KC_LALT, \ - KC_D, KC_E, KC_3, \ - KC_F, KC_R, KC_4, \ - KC_SPC, KC_T, KC_TAB \ -) + [DEF] = LAYOUT( + KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ + KC_7, KC_8, KC_9, KC_PLUS, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + KC_0, KC_DOT, KC_ENT \ + ), + [HDN] = LAYOUT( + KC_FN1, KC_1, KC_2, KC_3, \ + KC_Q, KC_W, KC_E, KC_R, \ + KC_A, KC_S, KC_D, \ + KC_Z, KC_X, KC_C, \ + KC_LSFT, KC_LALT, KC_SPC \ + ), + [OSY] = LAYOUT( + KC_A, KC_Q, KC_1, KC_FN2, \ + KC_S, KC_W, KC_2, KC_LALT, \ + KC_D, KC_E, KC_3, \ + KC_F, KC_R, KC_4, \ + KC_SPC, KC_T, KC_TAB \ + ) }; @@ -48,21 +44,21 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { bool process_record_user (uint16_t keycode, keyrecord_t *record) { switch(keycode) { case KC_FN0: - if (record->event.pressed) { - PORTC |= (1 << 6); // PC6 goes high - } - break; + if (record->event.pressed) { + PORTC |= (1 << 6); // PC6 goes high + } + break; case KC_FN1: - if (record->event.pressed) { - PORTC &= ~(1 << 6); // PC6 goes high - PORTD |= (1<<4); - } - break; + if (record->event.pressed) { + PORTC &= ~(1 << 6); // PC6 goes high + PORTD |= (1<<4); + } + break; case KC_FN2: - if (record->event.pressed) { - PORTD &= ~(1 << 4); // PC6 goes high - } - break; + if (record->event.pressed) { + PORTD &= ~(1 << 4); // PC6 goes high + } + break; } return true; -} \ No newline at end of file +} diff --git a/keyboards/handwired/gamenum/readme.md b/keyboards/handwired/gamenum/readme.md new file mode 100644 index 0000000000..ee28cc1822 --- /dev/null +++ b/keyboards/handwired/gamenum/readme.md @@ -0,0 +1,85 @@ +# GameNum + +A handwired standard numpad oriented toward gaming on the go. + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: GameNum, Pro Micro + +Make example for this keyboard (after setting up your build environment): + + make handwired/gamenum: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). + +## Board overview + +The GameNum was designed to facilitate the use of mechanical keys for gaming even when your packing space is limited. +It uses a standard numpad layout replacing the NumLock key with a layer toggle that allows you to cycle through the different layers. +The standard layout features a default layer that acts as a standard numpad, a layer that was meant for simple WASD based games and a layer that was designed to be used for MOBA/RTS related games. +The RTS layer is meant to be used rotating the device 90 degrees counterclockwise. + +The README.MD for this board is reasonably extensive and in-depth because the build is quite small and covers a lot of things that I feel that it would be a good starting point for getting into QMK. + +## Build considerations + +Since the GameNum is handwired and uses 2 of its pins to toggle indicator lights there are some things to keep in mind. +Firmware was build for use with a Pro Micro based on a ATMEGA32u4 at 16mHz. +The indicator LED's are normally assigned to `pin C6` and `pin D4`, C6 goes high when the first layer is used, D4 goes high when layer 2 is used. Both LED's are off when the default layer is enabled. +'+' of the LED goes to the respective pins and can be joined together on the '-' into a resistor that runs to the ground pin of the pro micro. With a standard LED a resistor value of 100 ohm is fine, keep in mind that you cannot use high powered LEDS on these pins without ruining your pro micro. + +## schematic of the switches and diodes + +![schematic overview](http://i.imgur.com/fleitoA.jpg) + +Keep in mind that the minus of the diodes should point towards the pro micros inputs. + +## LED hookup + +![led overview](http://i.imgur.com/U6m865n.jpg) + +## Adding more layers + +Adding additional layers is pretty straight forward. Look in `keymaps/default/keymap.c` and find `#define OSY 2` add a new definition for the layer you are going to add. This can be named pretty much anything. Example: `#define NAMEHERE 3`. +Keep in mind here that the number after the name should correspond with the number that the layer has in the stack of layers. + +Next thing to do is to add the actual layer for the keymap. + +``` + [DEF] = LAYOUT( + KC_FN0, KC_SLSH, KC_ASTR, KC_MINS, \ + KC_7, KC_8, KC_9, KC_PLUS, \ + KC_4, KC_5, KC_6, \ + KC_1, KC_2, KC_3, \ + KC_0, KC_DOT, KC_ENT \ + ) +``` + +This is the default layer for the gamenum. It's generally easiest to just copy this and change things as you see fit. Keep in mind that at least 1 button on the pad has to be used to switch to the next layer in the stack or you will be stuck in that layer FOREVER! D: +In the case of DEF this is key `KC_FN0`. Also keep in mind that the last layer that you add does not have a comma after its closing bracket but any other layer does! + +Which brings us nicely to the next part, the layer switching logic. Under the keymaps look for `PROGMEM fn_actions[]` this function handles the switching between layers, as you might have noticed every layer in the keymap has its own KC_FNx key. This is the key responsible for switching you from layer to layer. +The number that is at the end of the keycode corresponds with the code in the function. +`[0] = ACTION_LAYER_SET(HDN, ON_PRESS),` When `KC_FN0` is pressed the keyboard switches layer `HDN` on when the key is pressed down. Add an extra line for your layer here as well. + +Now for the LEDs, if you plan on adding extra LED's to the keyboard to indicate other layers you have to first define the pin that the LED will be using in `gamenum.c`. +Look for this piece of code: + +``` + DDRD |= (1<<4); + PORTD &= ~(1<<4); +``` + +Copy it and change the letter after DDR and PORT to the letter of your pin. Change the 4 to the number of your pin. `DDRx |= (1<event.pressed) { + PORTC &= ~(1 << 6); // PC6 goes low + PORTD |= (1<<4); //PD4 goes high + } + break; +``` + +This is the code for the KC_FN1 button. Notice how we check against what key is pressed in the case and then set pin C6 low and pin D4 high. Adjust this as you see fit. -- cgit v1.2.3 From 3f96ba011359e7e842a5f917c11886c1867ba207 Mon Sep 17 00:00:00 2001 From: milestogo Date: Thu, 6 Dec 2018 17:13:15 -0800 Subject: Keyboard: Palm serial keyboard USB converter (#4485) * Initial palm_usb support * removing left over sun .c file * fixing licenses * actually adding updated files * fixing build error * more include cleanup --- keyboards/converter/palm_usb/config.h | 120 +++++++ keyboards/converter/palm_usb/matrix.c | 398 +++++++++++++++++++++ keyboards/converter/palm_usb/readme.md | 96 +++++ keyboards/converter/palm_usb/rules.mk | 46 +++ .../palm_usb/stowaway/keymaps/default/keymap.c | 59 +++ keyboards/converter/palm_usb/stowaway/rules.mk | 0 keyboards/converter/palm_usb/stowaway/stowaway.h | 53 +++ 7 files changed, 772 insertions(+) create mode 100644 keyboards/converter/palm_usb/config.h create mode 100644 keyboards/converter/palm_usb/matrix.c create mode 100644 keyboards/converter/palm_usb/readme.md create mode 100644 keyboards/converter/palm_usb/rules.mk create mode 100644 keyboards/converter/palm_usb/stowaway/keymaps/default/keymap.c create mode 100644 keyboards/converter/palm_usb/stowaway/rules.mk create mode 100644 keyboards/converter/palm_usb/stowaway/stowaway.h diff --git a/keyboards/converter/palm_usb/config.h b/keyboards/converter/palm_usb/config.h new file mode 100644 index 0000000000..4520725a1d --- /dev/null +++ b/keyboards/converter/palm_usb/config.h @@ -0,0 +1,120 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +/* This code makes use of cy384's Arduino USB HID adapter for the Palm Portable + Keyboard, released under the BSD licence */ + + + + +#pragma once + +#define CUSTOM_MATRIX 2 + +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x0001 +#define DEVICE_VER 0x0100 +#define MANUFACTURER QMK +#define PRODUCT Stowaway converter +#define DESCRIPTION USB converter for Stowaway keyboard + +// IO pins to serial +// https://deskthority.net/wiki/Arduino_Pro_Micro for pin lookup +#define VCC_PIN D1 // pro micro 2 +#define RX_PIN D0 //pro micro 3 , was 8 on cy384 +#define RTS_PIN C6 // 5 //[ was D4 // 4 on the cy384 +#define DCD_PIN E6 //7 + +// if using the particular arduino pinout of CY384 +#ifdef CY384 + #define GND_PIN D7 //6 + #define PULLDOWN_PIN B1 // 15 +#endif + +#ifndef HANDSPRING +// Set to 1 for Handspring or to disable RTS/DCD based handshake. + #define HANDSPRING 0 +#endif + +#define MAXDROP 10 // check if keyboard is connected every X polling cycles +#define SLEEP_TIMEOUT 500000 // check keyboard/reset this many millis + + +#define MATRIX_ROWS 12 +#define MATRIX_COLS 8 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LALT) | MOD_BIT(KC_RALT)) || \ + keyboard_report->mods == (MOD_BIT(KC_LGUI) | MOD_BIT(KC_RGUI)) || \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +/* Serial(USART) configuration + * asynchronous, negative logic, 9600baud, no flow control + * 1-start bit, 8-data bit, non parity, 1-stop bit + */ +#define SERIAL_SOFT_BAUD 9600 +#define SERIAL_SOFT_PARITY_NONE +#define SERIAL_SOFT_BIT_ORDER_LSB +#if (HANDSPRING == 0) + #define SERIAL_SOFT_LOGIC_NEGATIVE //RS232 logic +#endif +/* RXD Port */ +#define SERIAL_SOFT_RXD_ENABLE + +// we are using Pro micro pin 3 / D0 as serial +#define SERIAL_SOFT_RXD_DDR DDRD +#define SERIAL_SOFT_RXD_PORT PORTD +#define SERIAL_SOFT_RXD_PIN PIND +#define SERIAL_SOFT_RXD_BIT 0 +#define SERIAL_SOFT_RXD_VECT INT0_vect + +/* RXD Interupt */ +#define SERIAL_SOFT_RXD_INIT() do { \ + /* pin configuration: input with pull-up */ \ + SERIAL_SOFT_RXD_DDR &= ~(1< + +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 . +*/ + +#include QMK_KEYBOARD_H +#include "protocol/serial.h" +#include "timer.h" +#include "pincontrol.h" + + +/* + * Matrix Array usage: + * + * ROW: 12(4bits) + * COL: 8(3bits) + * + * +---------+ + * 0|00 ... 07| + * 1|00 ... 07| + * :| ... | + * :| ... | + * A| | + * B| | + * +---------+ + */ +static uint8_t matrix[MATRIX_ROWS]; + + +// we're going to need a sleep timer +static uint16_t last_activity ; +// and a byte to track duplicate up events signalling all keys up. +static uint16_t last_upKey ; +// serial device can disconnect. Check every MAXDROP characters. +static uint16_t disconnect_counter = 0; + + +// bitmath masks. +#define KEY_MASK 0b10000000 +#define COL_MASK 0b00000111 +#define ROW_MASK 0b01111000 + + +#define ROW(code) (( code & ROW_MASK ) >>3) +#define COL(code) ((code & COL_MASK) ) +#define KEYUP(code) ((code & KEY_MASK) >>7 ) + +static bool is_modified = false; + +__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) { +} + +inline +uint8_t matrix_rows(void) +{ + return MATRIX_ROWS; +} + +inline +uint8_t matrix_cols(void) +{ + return MATRIX_COLS; +} + + +void pins_init(void) { + // set pins for pullups, Rts , power &etc. + + //print ("pins setup\n"); + pinMode(VCC_PIN, PinDirectionOutput); + digitalWrite(VCC_PIN, PinLevelLow); + +#if ( HANDSPRING == 0) + +#ifdef CY835 + pinMode(GND_PIN, PinDirectionOutput); + digitalWrite(GND_PIN, PinLevelLow); + + pinMode(PULLDOWN_PIN, PinDirectionOutput); + digitalWrite(PULLDOWN_PIN, PinLevelLow); +#endif + + pinMode(DCD_PIN, PinDirectionInput); + pinMode(RTS_PIN, PinDirectionInput); +#endif + +/* check that the other side isn't powered up. + test=digitalRead(DCD_PIN); + xprintf("b%02X:", test); + test=digitalRead(RTS_PIN); + xprintf("%02X\n", test); +*/ + +} + +uint8_t rts_reset(void) { + static uint8_t firstread ; +/* bounce RTS so device knows it is rebooted */ + +// On boot, we keep rts as input, then switch roles here +// on leaving sleep, we toggle the same way + + firstread=digitalRead(RTS_PIN); + // printf("r%02X:", firstread); + + pinMode(RTS_PIN, PinDirectionOutput); + + if (firstread == PinLevelHigh) { + digitalWrite(RTS_PIN, PinLevelLow); + } + _delay_ms(10); + digitalWrite(RTS_PIN, PinLevelHigh); + + +/* the future is Arm + if (palReadPad(RTS_PIN_IOPRT) == PinLevelLow) + { + _delay_ms(10); + palSetPadMode(RTS_PINn_IOPORT, PinDirectionOutput_PUSHPULL); + palSetPad(RTS_PORT, RTS_PIN); + } + else + { + palSetPadMode(RTS_PIN_RTS_PORT, PinDirectionOutput_PUSHPULL); + palSetPad(RTS_PORT, RTS_PIN); + palClearPad(RTS_PORT, RTS_PIN); + _delay_ms(10); + palSetPad(RTS_PORT, RTS_PIN); + } +*/ + + + _delay_ms(5); + //print("rts\n"); + return 1; +} + +uint8_t get_serial_byte(void) { + static uint8_t code; + while(1) { + code = serial_recv(); + if (code) { + debug_hex(code); debug(" "); + return code; + } + } +} + +uint8_t palm_handshake(void) { + // assumes something has seen DCD go high, we've toggled RTS + // and we now need to verify handshake. + // listen for up to 4 packets before giving up. + // usually I get the sequence FF FA FD + static uint8_t codeA=0; + + for (uint8_t i=0; i < 5; i++) { + codeA=get_serial_byte(); + if ( 0xFA == codeA) { + if( 0xFD == get_serial_byte()) { + return 1; + } + } + } + return 0; +} + +uint8_t palm_reset(void) { + print("@"); + rts_reset(); // shouldn't need to power cycle. + + if ( palm_handshake() ) { + last_activity = timer_read(); + return 1; + } else { + print("failed reset"); + return 0; + } + +} + +uint8_t handspring_handshake(void) { + // should be sent 15 ms after power up. + // listen for up to 4 packets before giving up. + static uint8_t codeA=0; + + for (uint8_t i=0; i < 5; i++) { + codeA=get_serial_byte(); + if ( 0xF9 == codeA) { + if( 0xFB == get_serial_byte()) { + return 1; + } + } + } + return 0; +} + +uint8_t handspring_reset(void) { + digitalWrite(VCC_PIN, PinLevelLow); + _delay_ms(5); + digitalWrite(VCC_PIN, PinLevelHigh); + + if ( handspring_handshake() ) { + last_activity = timer_read(); + disconnect_counter=0; + return 1; + } else { + print("-HSreset"); + return 0; + } +} + +void matrix_init(void) +{ + debug_enable = true; + //debug_matrix =true; + + serial_init(); // arguments all #defined + +#if (HANDSPRING == 0) + pins_init(); // set all inputs and outputs. +#endif + + print("power up\n"); + digitalWrite(VCC_PIN, PinLevelHigh); + + // wait for DCD strobe from keyboard - it will do this + // up to 3 times, then the board needs the RTS toggled to try again + +#if ( HANDSPRING == 1) + if ( handspring_handshake() ) { + last_activity = timer_read(); + } else { + print("failed handshake"); + _delay_ms(1000); + //BUG /should/ power cycle or toggle RTS & reset, but this usually works. + } + +#else /// Palm / HP device with DCD + while( digitalRead(DCD_PIN) != PinLevelHigh ) {;} + print("dcd\n"); + + rts_reset(); // at this point the keyboard should think all is well. + + if ( palm_handshake() ) { + last_activity = timer_read(); + } else { + print("failed handshake"); + _delay_ms(1000); + //BUG /should/ power cycle or toggle RTS & reset, but this usually works. + } + +#endif + + // initialize matrix state: all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + + matrix_init_quantum(); + return; + + +} + + +uint8_t matrix_scan(void) +{ + uint8_t code; + code = serial_recv(); + if (!code) { +/* + disconnect_counter ++; + if (disconnect_counter > MAXDROP) { + // set all keys off + for (uint8_t i=0; i < MATRIX_ROWS; i++) matrix[i] = 0x00; + } +*/ + // check if the keyboard is asleep. + if (timer_elapsed(last_activity) > SLEEP_TIMEOUT) { +#if(HANDSPRING ==0 ) + palm_reset(); +#else + handspring_reset(); +#endif + return 0; + } + + } + + last_activity = timer_read(); + disconnect_counter=0; // if we are getting serial data, we're connected. + + debug_hex(code); debug(" "); + + + switch (code) { + case 0xFD: // unexpected reset byte 2 + print("rstD "); + return 0; + case 0xFA: // unexpected reset + print("rstA "); + return 0; + } + + if (KEYUP(code)) { + if (code == last_upKey) { + // all keys are not pressed. + // Manual says to disable all modifiers left open now. + // but that could defeat sticky keys. + // BUG? dropping this byte. + last_upKey=0; + return 0; + } + // release + if (matrix_is_on(ROW(code), COL(code))) { + matrix[ROW(code)] &= ~(1<. +*/ + +#include QMK_KEYBOARD_H + +enum layers { +_QWERTY=0, +_CDH, +_FN +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /* + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BACK, APP0, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, APP1, + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, APP2, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, APP3, + LCTL, FN, LALT, CMD, SPACE,SPACE,GRAVE,DONE, DEL, LEFT, DOWN, RIGHT + +*/ + [_QWERTY] = LAYOUT( /* Base */ + 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_ESC, + 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, TG(_CDH), + 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_PGUP, + KC_LSFT, 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_PGDN, + KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPACE,KC_SPACE,KC_GRAVE,KC_RGUI, KC_DEL, KC_LEFT,KC_DOWN, KC_RIGHT + ), + + [_CDH] = LAYOUT( /* Base */ + 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_ESC, + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSLS, _______, + KC_CAPS, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_D, KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_PGDN, + KC_LCTL, MO(_FN), KC_LALT, KC_LGUI, KC_SPACE,KC_SPACE,KC_GRAVE,KC_RGUI, KC_DEL, KC_LEFT,KC_DOWN, KC_RIGHT + ), + + [_FN] = LAYOUT( // FN Key + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, KC_ENT, _______, _______, _______, _______, _______, _______, _______ + ), + +}; diff --git a/keyboards/converter/palm_usb/stowaway/rules.mk b/keyboards/converter/palm_usb/stowaway/rules.mk new file mode 100644 index 0000000000..e69de29bb2 diff --git a/keyboards/converter/palm_usb/stowaway/stowaway.h b/keyboards/converter/palm_usb/stowaway/stowaway.h new file mode 100644 index 0000000000..71af9bf4a8 --- /dev/null +++ b/keyboards/converter/palm_usb/stowaway/stowaway.h @@ -0,0 +1,53 @@ +/* +Copyright 2018 milestogo + +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 + +#include "quantum.h" + + +/* Stowaway Keyboard + based on matrix from http://www.splorp.com/pdf/stowawayhwref.pdf + + 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, MINS, EQL, BACK APP0, + TAB, Q, W, E, R, T, Y, U, I, O, P, LBRC, RBRC, BSLS, APP1, + CAPS, A, S, D, F, G, H, J, K, L, SCLN, QUOT, ENT, APP2, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, UP, APP3, + LCTL, FN, LALT, CMD, SPACE,SPACE,GRAVE,DONE, DEL, LEFT, DOWN, RIGHT + +*/ +#define LAYOUT( \ + K000, K001, K002, K004, K005, K006, K007, K064, K065, K066, K060, K061, K062, K063,\ + K031, K011, K012, K013, K014, K015, K016, K074, K075, K076, K077, K070, K071, K072, K073,\ + K030, K021, K022, K023, K024, K025, K026, K084, K085, K086, K087, K080, K081, K082,\ + K110, K003, K020, K054, K055, K056, K057, K094, K095, K096, K090, K111, K091, K092,\ + K032, K042, K043, K010, K027, K067, K017, K097, K100, K101, K102, K103 \ +) { \ + { K000, K001, K002 , K003, K004, K005, K006, K007 }, \ + { K010, K011, K012 , K013, K014, K015, K016, K017 }, \ + { K020, K021, K022 , K023, K024, K025, K026, K027 }, \ + { K030, K031, K032 , KC_NO,KC_NO, KC_NO,KC_NO, KC_NO }, \ + { KC_NO, KC_NO, K042 , K043, KC_NO, KC_NO,KC_NO, KC_NO }, \ + { KC_NO, KC_NO, KC_NO, KC_NO,K054, K055, K056, K057 }, \ + { K060, K061, K062 , K063, K064, K065, K066, K067 }, \ + { K070, K071, K072 , K073, K074, K075, K076, K077 }, \ + { K080, K081, K082 , KC_NO,K084, K085, K086, K087 }, \ + { K090, K091, K092 , KC_NO,K094, K095, K096, K097 }, \ + { K100, K101, K102 , K103, KC_NO, KC_NO,KC_NO, KC_NO }, \ + { K110, K111, KC_NO, KC_NO,KC_NO, KC_NO,KC_NO, KC_NO } \ +} + -- cgit v1.2.3 From 45dca4bc40bf403bc55f47c8c2091457582c9f53 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Fri, 7 Dec 2018 07:52:31 -0800 Subject: crd alps64 updates (#4565) * Update alps64 aek layout to work I tried using the layout provided with my alp64 board in AEK configuration, but keys weren't mapping correctly until I made this fix. * Update crd's alps64 aek keymp to match other boards (inspired by mechmerlin) * Fix minor whitespace issue --- keyboards/alps64/alps64.h | 6 ++-- keyboards/alps64/keymaps/crd/keymap.c | 51 ++++++++++++++++---------------- keyboards/dz60/keymaps/crd_ansi/keymap.c | 2 +- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/keyboards/alps64/alps64.h b/keyboards/alps64/alps64.h index 4e8587435c..14ff552185 100644 --- a/keyboards/alps64/alps64.h +++ b/keyboards/alps64/alps64.h @@ -94,16 +94,16 @@ along with this program. If not, see . K34, K35, K44, K45, K54, K55, K64, K65, K75, K05, K15, K16, K25, K24, \ K32, K33, K43, K52, K53, K63, K73, K74, K03, K04, K13, K14, K23, \ K31, K42, K51, K61, K62, K71, K72, K01, K02, K11, K12, K21, \ - K30, K40, K50, K60, K70, K00, K20 \ + K30, K40, K50, K60, K00, K10, K20 \ ) { \ { K00, K01, K02, K03, K04, K05, K06, K07 }, \ - { KC_NO, K11, K12, K13, K14, K15, K16, K17 }, \ + { K10, K11, K12, K13, K14, K15, K16, K17 }, \ { K20, K21, KC_NO, K23, K24, K25, KC_NO, K27 }, \ { K30, K31, K32, K33, K34, K35, K36, K37 }, \ { K40, KC_NO, K42, K43, K44, K45, K46, K47 }, \ { K50, K51, K52, K53, K54, K55, K56, K57 }, \ { K60, K61, K62, K63, K64, K65, K66, K67 }, \ - { K70, K71, K72, K73, K74, K75, K76, K77 } \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77 } \ } #define LAYOUT_kc( \ diff --git a/keyboards/alps64/keymaps/crd/keymap.c b/keyboards/alps64/keymaps/crd/keymap.c index 815e6ddf4b..0b12f02ad7 100644 --- a/keyboards/alps64/keymaps/crd/keymap.c +++ b/keyboards/alps64/keymaps/crd/keymap.c @@ -1,31 +1,32 @@ #include QMK_KEYBOARD_H +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNDN LT(_FL, KC_DOWN) +#define KC_RGLT RCMD_T(KC_LEFT) +#define KC_RCRT RCTL_T(KC_RIGHT) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* 0: qwerty */ - LAYOUT_all( - 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_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, - 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, 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, RSFT_T(KC_UP), _______, - MO(1), KC_LALT, KC_LGUI, KC_SPC, _______, RGUI_T(KC_LEFT), RALT_T(KC_DOWN), LT(2, KC_RIGHT) - ), - /* 1: fn1 */ - LAYOUT_all( - 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_DEL, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGUP, _______, - _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, KC_PGDOWN, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ - ), - /* 2: fn2 */ - LAYOUT_all( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET, - _______, _______, _______, _______, RESET, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, - _______, _______, _______, DEBUG, _______, _______, _______, _______, _______, _______, KC_SCROLLLOCK, KC_PAUSE, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + [_BL] = LAYOUT_aek_103( + 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_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_CTES, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + MO(_FL), KC_LALT, KC_LGUI, KC_SPC, KC_RGLT, KC_FNDN, KC_RCRT ), -} -; + [_FL] = LAYOUT_aek_103( + 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_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; const uint16_t PROGMEM fn_actions[] = {}; diff --git a/keyboards/dz60/keymaps/crd_ansi/keymap.c b/keyboards/dz60/keymaps/crd_ansi/keymap.c index 52d1756be2..5d7b24d187 100644 --- a/keyboards/dz60/keymaps/crd_ansi/keymap.c +++ b/keyboards/dz60/keymaps/crd_ansi/keymap.c @@ -20,7 +20,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_FNLT, KC_RADN, KC_RCRT ), - [_FL] =LAYOUT_60_ansi( + [_FL] = LAYOUT_60_ansi( 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_DEL, _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, -- cgit v1.2.3 From 0f2108c90544ec0e143a427c78534d463b0c4437 Mon Sep 17 00:00:00 2001 From: Alex Mayer Date: Fri, 7 Dec 2018 10:56:38 -0500 Subject: 1up60hse: Make Keymap Rows Match Keyboard Row Layout (#4564) Remove unused process_record_user function --- .../1upkeyboards/1up60hse/keymaps/default/keymap.c | 38 +++++++++------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c index 1c168abf7d..48350a53e0 100644 --- a/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c +++ b/keyboards/1upkeyboards/1up60hse/keymaps/default/keymap.c @@ -18,34 +18,26 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_60_ansi( - KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, - KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, - KC_RALT, KC_RGUI, MO(1), KC_LCTL + KC_ESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(1), KC_LCTL ), [1] = LAYOUT_60_ansi( - KC_GRV, 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_DEL, KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, - KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, - KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, - KC_PGDN, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS + KC_GRV, 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_DEL, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, + KC_TRNS, KC_LEFT, KC_DOWN, KC_RGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_INS, KC_HOME, KC_PGUP, KC_TRNS, + KC_TRNS, KC_VOLU, KC_VOLD, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_PGDN, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MO(2), KC_TRNS, KC_TRNS ), [2] = LAYOUT_60_ansi( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, RESET, BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, - RGB_SAI, RGB_VAI, RGB_SPI, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, + BL_TOGG, BL_INC, BL_DEC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + RGB_TOG, RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_SPI, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SPD, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS ), }; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} -- cgit v1.2.3 From ca9262ca3dba6a511a0d14c48a5291dfd9465615 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Spie=C3=9F?= Date: Fri, 7 Dec 2018 17:36:51 +0100 Subject: Add levinson keymap for user 'drogglbecher' (#4566) * Add levinson layout for drogglbecher * Add tab to layer 0 * Change OS key to ALT * Remove unnecessary KC_TRNS define Co-Authored-By: Drogglbecher --- keyboards/levinson/keymaps/drogglbecher/config.h | 17 ++++++ keyboards/levinson/keymaps/drogglbecher/keymap.c | 76 ++++++++++++++++++++++++ keyboards/levinson/keymaps/drogglbecher/rules.mk | 10 ++++ 3 files changed, 103 insertions(+) create mode 100644 keyboards/levinson/keymaps/drogglbecher/config.h create mode 100644 keyboards/levinson/keymaps/drogglbecher/keymap.c create mode 100644 keyboards/levinson/keymaps/drogglbecher/rules.mk diff --git a/keyboards/levinson/keymaps/drogglbecher/config.h b/keyboards/levinson/keymaps/drogglbecher/config.h new file mode 100644 index 0000000000..ef96ff00b1 --- /dev/null +++ b/keyboards/levinson/keymaps/drogglbecher/config.h @@ -0,0 +1,17 @@ +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +#include "config_common.h" + +/* Use I2C or Serial, not both */ + +#define USE_SERIAL +/* #define USE_I2C */ + +/* Select hand configuration */ + +#define MASTER_LEFT +/* #define _MASTER_RIGHT */ +/* #define EE_HANDS */ + +#endif diff --git a/keyboards/levinson/keymaps/drogglbecher/keymap.c b/keyboards/levinson/keymaps/drogglbecher/keymap.c new file mode 100644 index 0000000000..b8d2dc5949 --- /dev/null +++ b/keyboards/levinson/keymaps/drogglbecher/keymap.c @@ -0,0 +1,76 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _FN0 0 +#define _FN1 1 +#define _FN2 2 + +#define KC_X1 MO(_FN1) +#define KC_X2 MO(_FN2) + +#define KC_LPRN LSFT(KC_9) // ( +#define KC_RPRN LSFT(KC_0) // ) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ ESC │ q │ w │ e │ r │ t │ │ y │ u │ i │ o │ p │ BS │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ CTRL │ a │ s │ d │ f │ g │ │ h │ j │ k │ l │ " ' │ RET │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ SHFT │ z │ x │ c │ v │ b │ │ n │ m │ [ { │ ] } │ ; : │ SHFT │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ L1 │ ALT │ L2 │ TAB | SPC │ SPC │ │ SPC │ SPC │ , < │ . > │ - _ │ / ? │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN0] = LAYOUT_ortho_4x12( \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, KC_ENT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_LBRC, KC_RBRC, KC_SCLN, KC_RSFT, \ + KC_X1, KC_LALT, KC_X2, KC_TAB, KC_SPC, KC_SPC, KC_SPC, KC_SPC, KC_COMM, KC_DOT, KC_MINS, KC_SLSH \ + ), + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ │ 1 │ 2 │ 3 │ 4 │ 5 │ │ 6 │ 7 │ 8 │ 9 │ 0 │ DEL │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ ä │ ö │ ü │ ß │ │ │ LEFT │ DOWN │ UP │ RGT │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ Ä │ Ö │ Ü │ € │ │ │ │ │ ( │ ) │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ | │ │ | SPC │ SPC │ │ SPC │ SPC │ │ │ │ \ | │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN1] = LAYOUT_ortho_4x12( \ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, UC(L'ä'), UC(L'ö'), UC(L'ü'), UC(L'ß'), _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, KC_PIPE, \ + _______, UC(L'Ä'), UC(L'Ö'), UC(L'Ü'), UC(L'€'), _______, _______, _______, KC_LPRN, KC_RPRN, _______, _______, \ + _______, _______, _______, KC_TAB, KC_SPC, KC_SPC, KC_SPC, KC_SPC, _______, _______, _______, KC_BSLS \ + ), + + /* ┌──────┬──────┬──────┬──────┬──────┬──────┐ ┌──────┬──────┬──────┬──────┬──────┬──────┐ + * │ ` │ ! │ @ │ # │ $ │ % │ │ ^ │ & │ * │ ~ │ + │ = │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ │ │ │ │ │ │ HOME │ PGDN │ PGUP │ END │ │ │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ F1 │ F2 │ F3 │ F4 │ F5 │ F6 │ │ F7 │ F8 │ F9 │ F10 │ F11 │ F12 │ + * ├──────┼──────┼──────┼──────┼──────┼──────┤ ├──────┼──────┼──────┼──────┼──────┼──────┤ + * │ │ │ │ │ SPC │ SPC │ │ SPC │ SPC │ │ VOL+ │ VOL- │ MUTE │ + * └──────┴──────┴──────┴──────┴──────┴──────┘ └──────┴──────┴──────┴──────┴──────┴──────┘ + */ + + [_FN2] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_TILD, KC_PLUS, KC_PEQL, \ + _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END, _______, _______, \ + 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_SPC, KC_SPC, KC_SPC, KC_SPC, _______, KC_VOLD, KC_VOLU, KC_MUTE \ + ) + +}; + +void matrix_init_user(void) { + set_unicode_input_mode(UC_LNX); +}; diff --git a/keyboards/levinson/keymaps/drogglbecher/rules.mk b/keyboards/levinson/keymaps/drogglbecher/rules.mk new file mode 100644 index 0000000000..b223b71aba --- /dev/null +++ b/keyboards/levinson/keymaps/drogglbecher/rules.mk @@ -0,0 +1,10 @@ +AUTO_SHIFT_ENABLE = no +AUTO_SHIFT_MODIFIERS = no +RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = no +UNICODE_ENABLE = yes +DEFAULT_FOLDER = levinson/rev2 + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif -- cgit v1.2.3 From afb4a43677f7289bb607cdb19870bf84eff14c3a Mon Sep 17 00:00:00 2001 From: ishtob Date: Fri, 7 Dec 2018 16:37:28 -0500 Subject: Keymap: adding ishtob's keymap to hadron ver3 (#4570) --- keyboards/hadron/ver3/keymaps/ishtob/config.h | 1 + keyboards/hadron/ver3/keymaps/ishtob/keymap.c | 229 +++++++++++++++++++++++++ keyboards/hadron/ver3/keymaps/ishtob/readme.md | 2 + 3 files changed, 232 insertions(+) create mode 100644 keyboards/hadron/ver3/keymaps/ishtob/config.h create mode 100644 keyboards/hadron/ver3/keymaps/ishtob/keymap.c create mode 100644 keyboards/hadron/ver3/keymaps/ishtob/readme.md diff --git a/keyboards/hadron/ver3/keymaps/ishtob/config.h b/keyboards/hadron/ver3/keymaps/ishtob/config.h new file mode 100644 index 0000000000..6f70f09bee --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/config.h @@ -0,0 +1 @@ +#pragma once diff --git a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c new file mode 100644 index 0000000000..870781930d --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c @@ -0,0 +1,229 @@ +#include QMK_KEYBOARD_H +#include "ishtob.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,------+------+------+------+------+------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | DEL | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | E | R | T | 7 | 8 | 9 | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | LCTL | A | S | D | F | G | 4 | 5 | 6 | H | J | K | L | ;/Nav|Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | N | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_QWERTY] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, _________________QWERTY_L1_________________, KC_P7, KC_P8, KC_P9, _________________QWERTY_R1_________________, KC_BSPC, \ + KC_CAPS, _________________QWERTY_L2_________________, KC_P4, KC_P5, KC_P6, _________________QWERTY_R2_________________, CTL_ENT, \ + KC_LSFT, _________________QWERTY_L3_________________, KC_P1, KC_P2, KC_P3, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ +), + +/* Colemak + * ,------+------+------+------+------+------------------------------------------------. + * | ` | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | Q | W | F | P | G | 7 | 8 | 9 | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | CAPS | A | R | S | T | D | 4 | 5 | 6 | H | N | E | I | O |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | 1 | 2 | 3 | K | M | , | . | / | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_COLEMAK] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, _________________COLEMAK_L1________________, KC_P7, KC_P8, KC_P9, _________________COLEMAK_R1________________, KC_BSPC, \ + KC_LCTRL, _________________COLEMAK_L2________________, KC_P4, KC_P5, KC_P6, _________________COLEMAK_R2________________, CTL_ENT, \ + KC_LSFT, _________________COLEMAK_L3________________, KC_P1, KC_P2, KC_P3, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ + ), + +/* Dvorak + * ,------+------+------+------+------+------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Tab | " | , | . | P | Y | 7 | 8 | 9 | F | G | C | R | L | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Esc | A | O | E | U | I | 4 | 5 | 6 | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | 1 | 2 | 3 | B | M | W | V | Z |Ctl/Et| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | Esc | Ctrl | GUI | Alt |Lower |Space | 0 | . | = |Space |Raise | Alt | NumL | App | Del | + * `--------------------------------------------------------------------------------------------------------' + */ +[_DVORAK] = LAYOUT_wrapper( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ + KC_TAB, _________________DVORAK_L1_________________, KC_P7, KC_P8, KC_P9, _________________DVORAK_R1_________________, KC_BSPC, \ + KC_LCTL, _________________DVORAK_L2_________________, KC_P4, KC_P5, KC_P6, _________________DVORAK_R2_________________, CTL_ENT, \ + KC_LSFT, _________________DVORAK_L3_________________, KC_P1, KC_P2, KC_P3, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ +), + +/* Lower + * ,------+------+------+------+------+------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_wrapper( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | | | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `--------------------------------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_wrapper( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Mouse Layer (semi-col) + * ,------+------+------+------+------+------------------------------------------------. + * | ACCL0| ACCL1| ACCL2| | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | | | | | | | | Home | Wh_Up| WHL_L| M_Up | WHL_R| Macro| | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | End | Wh_Dn| M_Lft| M_Dn | M_Rt | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | BTN2 | BTN3 | BTN4 | BTN5 | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | BTN1 | | | | BTN1 | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ + +[_MOUSECURSOR] = LAYOUT_wrapper( + KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, M_EMAIL,M_EMAIL2, _______, _______, _______, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, \ + _______, _______, _______, _______, O_RTQ6H, _______, _______, _______, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, \ + _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, KC_BTN1, _______, _______, _______, P_CITRIX, O_AUTODC \ +), + +/* Adjust (Lower + Raise) + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | Reset|RGB TG|RGB ST|RGBH -|RGBH +|RGBS -|RGBS +|RGBV -|RGBV +| | | | | | Del | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm| | | |AGswap|Qwerty|Colemk| | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|Musoff| | | | | | | | BL + |BL ST |BL TG | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | | + * `--------------------------------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_wrapper( + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ + RESET, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, KC_DEL, \ + _______, MAGIC_TOGGLE_NKRO, _______, AU_ON, AU_OFF, AG_NORM, _______, _______, _______, AG_SWAP, QWERTY, COLEMAK, _______, _______, _______, \ + _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CK_RST, CK_DOWN, CK_UP, CK_TOGG\ +) + + + +}; + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); +} + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_LOWER); + } else { + layer_off(_LOWER); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + layer_on(_RAISE); + } else { + layer_off(_RAISE); + } + return false; + break; + case BACKLIT: + if (record->event.pressed) { + register_code(KC_RSFT); + #ifdef BACKLIGHT_ENABLE + backlight_step(); + #endif + } else { + unregister_code(KC_RSFT); + } + return false; + break; + } + return true; +} + +bool music_mask_user(uint16_t keycode) { + switch (keycode) { + case RAISE: + case LOWER: + return false; + default: + return true; + } +} + + +void matrix_init_keymap(void) { +} + + +void matrix_scan_keymap(void) { +} + diff --git a/keyboards/hadron/ver3/keymaps/ishtob/readme.md b/keyboards/hadron/ver3/keymaps/ishtob/readme.md new file mode 100644 index 0000000000..88b958ec42 --- /dev/null +++ b/keyboards/hadron/ver3/keymaps/ishtob/readme.md @@ -0,0 +1,2 @@ +# The Default Hadron Layout + -- cgit v1.2.3 From 5b7260fc5327f195f63d872f856391e0bd168d27 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 7 Dec 2018 13:46:23 -0800 Subject: Keyboard: handwired/minorca Refactor, Configurator support and readme cleanup (#4571) * handwired/minorca: refactor - Refactored keymaps to use a layout macro, which was added to minorca.h. - keymaps now use QMK_KEYBOARD_H include - removed redundant KC_TRNS and KC_NO definitions - rgb keymap refactor to use QMK core layer switching and Mod-Tap keycodes * handwired/minorca: Configurator support * handwired/minorca: readme cleanup Restructure readme file to current QMK template. --- keyboards/handwired/minorca/info.json | 55 ++++++++++++++++ .../handwired/minorca/keymaps/default/keymap.c | 53 ++++++--------- keyboards/handwired/minorca/keymaps/rgb/keymap.c | 75 ++++++++-------------- keyboards/handwired/minorca/minorca.h | 12 ++++ keyboards/handwired/minorca/readme.md | 36 +++-------- 5 files changed, 123 insertions(+), 108 deletions(-) create mode 100644 keyboards/handwired/minorca/info.json diff --git a/keyboards/handwired/minorca/info.json b/keyboards/handwired/minorca/info.json new file mode 100644 index 0000000000..dafee63456 --- /dev/null +++ b/keyboards/handwired/minorca/info.json @@ -0,0 +1,55 @@ +{ + "keyboard_name": "Minorca Handwired", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"KA00", "x":0, "y":0}, + {"label":"KA01", "x":1, "y":0}, + {"label":"KA02", "x":2, "y":0}, + {"label":"KA03", "x":3, "y":0}, + {"label":"KA04", "x":4, "y":0}, + {"label":"KA05", "x":5, "y":0}, + {"label":"KA06", "x":6, "y":0}, + {"label":"KA07", "x":7, "y":0}, + {"label":"KA08", "x":8, "y":0}, + {"label":"KA09", "x":9, "y":0}, + {"label":"KA10", "x":10, "y":0}, + {"label":"KA11", "x":11, "y":0}, + {"label":"KB00", "x":0, "y":1, "w":1.25}, + {"label":"KB01", "x":1.25, "y":1}, + {"label":"KB02", "x":2.25, "y":1}, + {"label":"KB03", "x":3.25, "y":1}, + {"label":"KB04", "x":4.25, "y":1}, + {"label":"KB05", "x":5.25, "y":1}, + {"label":"KB06", "x":6.25, "y":1}, + {"label":"KB07", "x":7.25, "y":1}, + {"label":"KB08", "x":8.25, "y":1}, + {"label":"KB09", "x":9.25, "y":1}, + {"label":"KB11", "x":10.25, "y":1, "w":1.75}, + {"label":"KC00", "x":0, "y":2, "w":1.75}, + {"label":"KC02", "x":1.75, "y":2}, + {"label":"KC03", "x":2.75, "y":2}, + {"label":"KC04", "x":3.75, "y":2}, + {"label":"KC05", "x":4.75, "y":2}, + {"label":"KC06", "x":5.75, "y":2}, + {"label":"KC07", "x":6.75, "y":2}, + {"label":"KC08", "x":7.75, "y":2}, + {"label":"KC09", "x":8.75, "y":2}, + {"label":"KC10", "x":9.75, "y":2}, + {"label":"KC11", "x":10.75, "y":2, "w":1.25}, + {"label":"KD00", "x":0, "y":3, "w":1.25}, + {"label":"KD02", "x":1.25, "y":3, "w":1.25}, + {"label":"KD03", "x":2.5, "y":3, "w":1.25}, + {"label":"KD04", "x":3.75, "y":3, "w":2.25}, + {"label":"KD07", "x":6, "y":3, "w":2.25}, + {"label":"KD09", "x":8.25, "y":3, "w":1.25}, + {"label":"KD10", "x":9.5, "y":3}, + {"label":"KD11", "x":10.5, "y":3, "w":1.5} + ] + } + } +} diff --git a/keyboards/handwired/minorca/keymaps/default/keymap.c b/keyboards/handwired/minorca/keymaps/default/keymap.c index 3392f25ef8..29ed7aa03f 100644 --- a/keyboards/handwired/minorca/keymaps/default/keymap.c +++ b/keyboards/handwired/minorca/keymaps/default/keymap.c @@ -1,7 +1,4 @@ - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -10,33 +7,23 @@ extern keymap_config_t keymap_config; // Layer names don't all need to be of the same length, obviously, and you can also skip them // entirely and just use numbers. -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { /* Base */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_ENT }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, KC_SPC, XXXXXXX, XXXXXXX, KC_SPC, XXXXXXX, KC_DOT, KC_SLSH, KC_NO } - }, - [1] = { /* First */ - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELT }, - {KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, XXXXXXX, KC_LGUI }, - {KC_LCTRL,XXXXXXX, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, - [2] = { /* Second */ - {KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DELT }, - {KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, XXXXXXX, KC_ENT }, - {KC_CAPS, XXXXXXX, KC_LSFT, KC_RSFT, KC_PAUSE,KC_F10, KC_F11, KC_F12, KC_NO, KC_UP, KC_FN1, KC_FN0 }, - {KC_NO, XXXXXXX, KC_NO, KC_LALT, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_DOWN, KC_RIGHT,KC_NO } - }, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // to First overlay - [1] = ACTION_LAYER_MOMENTARY(2), // to Second overlay - -}; \ No newline at end of file + [0] = LAYOUT( /* Base */ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, \ + KC_LCTL, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_QUOT, MO(2), MO(1), \ + XXXXXXX, XXXXXXX, KC_LALT, KC_SPC, KC_SPC, KC_DOT, KC_SLSH, XXXXXXX \ + ), + [1] = LAYOUT( /* First */ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_TAB, KC_MPRV, KC_MPLY, KC_MNXT, KC_PGUP, KC_HOME, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_LGUI, \ + KC_LCTL, KC_Z, KC_X, KC_C, KC_PGDN, KC_END, KC_L, KC_SCLN, KC_UP, _______, _______, \ + XXXXXXX, XXXXXXX, KC_LALT, _______, _______, KC_DOWN, KC_RGHT, XXXXXXX \ + ), + [2] = LAYOUT( /* Second */ + KC_ESC, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_TAB, KC_MUTE, KC_VOLD, KC_VOLU, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_ENT, \ + KC_CAPS, KC_LSFT, KC_RSFT, KC_PAUS, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_UP, _______, _______, \ + XXXXXXX, XXXXXXX, KC_LALT, _______, _______, KC_DOWN, KC_RGHT, XXXXXXX \ + ), +}; diff --git a/keyboards/handwired/minorca/keymaps/rgb/keymap.c b/keyboards/handwired/minorca/keymaps/rgb/keymap.c index e1ee49dce6..c99a255e40 100644 --- a/keyboards/handwired/minorca/keymaps/rgb/keymap.c +++ b/keyboards/handwired/minorca/keymaps/rgb/keymap.c @@ -1,7 +1,4 @@ - -#include "minorca.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -14,50 +11,34 @@ extern keymap_config_t keymap_config; #define _RAISE 2 #define _TB 3 -// Macro name shortcuts -#define QWERTY M(_QWERTY) -#define LOWER M(_LOWER) -#define RAISE M(_RAISE) - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = { /* Qwerty */ - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {FUNC(0), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, XXXXXXX, KC_QUOT}, - {KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, FUNC(1)}, - {KC_LCTL, XXXXXXX, KC_LGUI, KC_LALT, FUNC(2), XXXXXXX, XXXXXXX, FUNC(3), XXXXXXX, KC_RALT, KC_APP, KC_RCTL} -}, - -[_RAISE] = { - {S(KC_GRV), S(KC_1), S(KC_2), S(KC_3), S(KC_4), S(KC_5), S(KC_6), S(KC_7), S(KC_8), S(KC_9), S(KC_0), KC_BSPC}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_PAUSE, KC_TRNS, KC_TRNS, KC_TRNS, S(KC_MINS), S(KC_EQL), S(KC_LBRC), XXXXXXX, S(KC_BSLS)}, - {KC_TRNS, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_MNXT, KC_MUTE, KC_MPLY} -}, - -[_LOWER] = { - {KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DELETE}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MINS, KC_EQL, KC_LBRC, XXXXXXX, KC_BSLS}, - {KC_TRNS, XXXXXXX, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT}, - {KC_TRNS, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_HOME, KC_PGDN, KC_END} -}, - -[_TB] = { /* Tab */ - {KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS}, - {KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, KC_TRNS}, - {KC_TRNS, XXXXXXX, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT}, - {BL_STEP, XXXXXXX, KC_TRNS, KC_TRNS, KC_TRNS, XXXXXXX, XXXXXXX, KC_TRNS, XXXXXXX, KC_LEFT, KC_DOWN, KC_RGHT} -} -}; - + [_QWERTY] = LAYOUT( /* Qwerty */ \ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + LT(_TB, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_ENT), \ + KC_LCTL, KC_LGUI, KC_LALT, LT(_RAISE, KC_SPC), LT(_LOWER, KC_SPC), KC_RALT, KC_APP, KC_RCTL \ + ), + + [_RAISE] = LAYOUT( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + _______, _______, _______, KC_PAUS, _______, _______, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_PIPE, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_ENT, \ + _______, _______, _______, _______, _______, KC_MNXT, KC_MUTE, KC_MPLY \ + ), + + [_LOWER] = LAYOUT( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, _______, _______, _______, _______, _______, _______, KC_MINS, KC_EQL, KC_LBRC, KC_BSLS, \ + _______, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_PGUP, KC_ENT, \ + _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END \ + ), + + [_TB] = LAYOUT( /* Tab */ \ + KC_ESC, KC_CALC, KC_WHOM, KC_MAIL, KC_MYCM, _______, _______, _______, _______, _______, KC_PSCR, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_UP, KC_ENT, \ + BL_STEP, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT \ + ) -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_TB, KC_TAB), - [1] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [2] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC), - [3] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), }; diff --git a/keyboards/handwired/minorca/minorca.h b/keyboards/handwired/minorca/minorca.h index 158e5b4c55..2df4ebdc4f 100644 --- a/keyboards/handwired/minorca/minorca.h +++ b/keyboards/handwired/minorca/minorca.h @@ -3,4 +3,16 @@ #include "quantum.h" +#define LAYOUT( \ + KA00, KA01, KA02, KA03, KA04, KA05, KA06, KA07, KA08, KA09, KA10, KA11, \ + KB00, KB01, KB02, KB03, KB04, KB05, KB06, KB07, KB08, KB09, KB11, \ + KC00, KC02, KC03, KC04, KC05, KC06, KC07, KC08, KC09, KC10, KC11, \ + KD00, KD02, KD03, KD04, KD07, KD09, KD10, KD11 \ +) { \ + { KA00, KA01, KA02, KA03, KA04, KA05, KA06, KA07, KA08, KA09, KA10, KA11 }, \ + { KB00, KB01, KB02, KB03, KB04, KB05, KB06, KB07, KB08, KB09, KC_NO, KB11 }, \ + { KC00, KC_NO, KC02, KC03, KC04, KC05, KC06, KC07, KC08, KC09, KC10, KC11 }, \ + { KD00, KC_NO, KD02, KD03, KD04, KC_NO, KC_NO, KD07, KC_NO, KD09, KD10, KD11 } \ +} + #endif diff --git a/keyboards/handwired/minorca/readme.md b/keyboards/handwired/minorca/readme.md index 0253506e09..c910459603 100644 --- a/keyboards/handwired/minorca/readme.md +++ b/keyboards/handwired/minorca/readme.md @@ -1,33 +1,13 @@ -minorca keyboard firmware -====================== -Handwired 40% keyboard +# minorca -http://www.panc.co/blog/minorcasebright-information-page +A handwired 40% keyboard by panc.co. -## Quantum MK Firmware +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: panc.co minorca +Hardware Availability: [panc.co](https://www.panc.co/blog/minorcasebright-information-page) -For the full Quantum feature list, see [the parent readme.md](/readme.md). +Make example for this keyboard (after setting up your build environment): -## Building + make handwired/minorca:default -Download or clone the whole firmware and navigate to the keyboards/planck folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use `make dfu` to program your PCB once you hit the reset button. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default -To build with the default keymap, simply run `make`. - -### Other Keymaps -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create file named `.c` in the keymaps folder, and see keymap document (you can find in top readme.md) and existent keymap files. - -To build the firmware binary hex file with a keymap just do `make` with `KEYMAP` option like: -``` -$ make KEYMAP=[default|jack|] -``` -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. - -### Notable forks (which some of the keymap files are from) -- [Shane's Fork](https://github.com/shanecelis/tmk_keyboard/tree/master/keyboard/planck) -- [Pierre's Fork](https://github.com/pcarrier/tmk_keyboard/blob/pcarrier/planck/keyboard/gh60/keymap_planck.c) -- [Nathan's Fork](https://github.com/nathanrosspowell/tmk_keyboard/tree/planck-jack/keyboard/planck) -- [Matthew's Fork](https://github.com/pepers/tmk_keyboard/tree/master/keyboard/planck) +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). -- cgit v1.2.3 From 7749f4590f5f69cb7cae758cae5e45111b68d042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nico=20Hormaz=C3=A1bal?= Date: Fri, 7 Dec 2018 23:00:26 +0100 Subject: Keymap: Updated keymap with better F positioning (#4463) * added own keymap for planck * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * Update Readme.md * dynamic macros * Update Readme.md * moved the reset button * Update readme for volume explanation * Format * Update Readme.md * Update Readme.md * added safe double shift * changed the modified shift to regular shift, for allowing shift + F keys * moved power stuff to the function layer * del button on raise * Update Readme.md * updated F keys * Update Readme.md * Update Readme.md * moved F keys * fixed conflicts * missed something * moved F11 and F12 * Update layout in the image * Update keyboards/planck/keymaps/dr_notsokind/keymap.c Co-Authored-By: pnikosis * Apply suggestions from code review Co-Authored-By: pnikosis --- keyboards/planck/keymaps/dr_notsokind/Readme.md | 2 +- keyboards/planck/keymaps/dr_notsokind/keymap.c | 108 ++++++++++++------------ 2 files changed, 54 insertions(+), 56 deletions(-) diff --git a/keyboards/planck/keymaps/dr_notsokind/Readme.md b/keyboards/planck/keymaps/dr_notsokind/Readme.md index e7e29cb7dd..a336de2f35 100644 --- a/keyboards/planck/keymaps/dr_notsokind/Readme.md +++ b/keyboards/planck/keymaps/dr_notsokind/Readme.md @@ -70,7 +70,7 @@ When you are done, press `Media` and `Enter`. You will finally hear a tune confi Press `Media` and the key where you stored your Macro, either `;` or `'`. The Macro will play. -![Imgur](https://i.imgur.com/ri4lEcl.png) +![Imgur](https://i.imgur.com/TcVyNag.png) http://www.keyboard-layout-editor.com/#/gists/4cfb26f84bbb4fabe5e6c7cc22c85e24 diff --git a/keyboards/planck/keymaps/dr_notsokind/keymap.c b/keyboards/planck/keymaps/dr_notsokind/keymap.c index f43fc37bc4..64650aaa82 100644 --- a/keyboards/planck/keymaps/dr_notsokind/keymap.c +++ b/keyboards/planck/keymaps/dr_notsokind/keymap.c @@ -1,8 +1,6 @@ // Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" -#include "planck.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #ifdef AUDIO_ENABLE #include "audio.h" #endif @@ -79,12 +77,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Ctrl | GUI | Alt | Mute | Lower| Space | Raise| / | Left | Down | Right| * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC}, - {KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, - {KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT} -}, +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT, + KC_LCTL, KC_LGUI, KC_LALT, MEDIA, LOWER, KC_SPC, KC_SPC, RAISE, KC_SLSH, KC_LEFT, KC_DOWN, KC_RGHT +), /* NUMPAD * ,-----------------------------------------------------------------------------------. @@ -97,12 +95,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | 0 | . | , | = | * `-----------------------------------------------------------------------------------' */ -[_NUMPAD] = { - {QWERTY, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS}, - {_______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS}, - {_______, KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PENT}, - {_______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PCMM, KC_PEQL} -}, +[_NUMPAD] = LAYOUT_planck_grid( + QWERTY, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PSLS, KC_P7, KC_P8, KC_P9, KC_PMNS, + _______, KC_LEFT, KC_DOWN, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAST, KC_P4, KC_P5, KC_P6, KC_PPLS, + _______, KC_NLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC, KC_P1, KC_P2, KC_P3, KC_PENT, + _______, _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_PCMM, KC_PEQL +), /* LOCK * ,-----------------------------------------------------------------------------------. @@ -115,30 +113,30 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | NULL | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_LOCKED] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT}, - {_______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, +[_LOCKED] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* RAISE * ,-----------------------------------------------------------------------------------. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Del | F1 | F2 | F3 | F4 | F5 | | - | = | [ | ] | \ | + * | Del | F11 | F12 | F13 | F14 | F15 | | - | = | [ | ] | \ | * |------+------+------+------+------+------+------+------+------+------+------+------| - * |LShift| F6 | F7 | F8 | F9 | F10 | |ISO # |ISO / | NULL | PgUp | Enter| + * |LShift| F16 | F17 | F18 | F19 | F20 | |ISO # |ISO / | NULL | PgUp | Enter| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | F11 | | F12 | | | Home | PgDn | End | + * | | | | | | | | | Home | PgDn | End | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL}, - {KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS}, - {KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, KC_NUHS, KC_NUBS, XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_F11, _______, KC_F12, KC_F12, _______, _______, KC_HOME, KC_PGDN, KC_END } -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + KC_DEL , KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, _______, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + KC_LSFT, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, _______, KC_NUHS, KC_NUBS, XXXXXXX, KC_PGUP, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), /* LOWER * ,-----------------------------------------------------------------------------------. @@ -148,15 +146,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+------+------+------+------+------| * |LShift| F6 | F7 | F8 | F9 | F10 | |ISO ~ |ISO | | NULL | PgUp | Enter| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | F11 | | F12 | | | Home | PgDn | End | + * | | | | | | | | | Home | PgDn | End | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE}, - {KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, S(KC_NUHS), S(KC_NUBS), XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_F11, _______, KC_F12, KC_F12, _______, _______, KC_HOME, KC_PGDN, KC_END } -}, +[_LOWER] = LAYOUT_planck_grid( + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL , + KC_DEL , KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + KC_LSFT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, _______, S(KC_NUHS), S(KC_NUBS), XXXXXXX, KC_PGUP, KC_ENT , + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_END +), /* MEDIA AND COMMANDS * ,-----------------------------------------------------------------------------------. @@ -169,12 +167,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |ONESHT| NULL | NULL | | Vol- | Mute | Vol+ |Zoom 0| Stop | Next | Play | * `-----------------------------------------------------------------------------------' */ -[_MEDIA] = { - {XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX}, - {XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2 }, - {KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP }, - {ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY } -}, +[_MEDIA] = LAYOUT_planck_grid( + XXXXXXX, XXXXXXX, KC_WHOM, XXXXXXX, XXXXXXX, XXXXXXX, KC_AGAIN, XXXXXXX, KC_INS, XXXXXXX, KC_PSCR, XXXXXXX, + XXXXXXX, XXXXXXX, KC_WSCH, XXXXXXX, KC_FIND, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, + KC_LSFT, XXXXXXX, XXXXXXX, KC_CALC, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ZOOM_OUT, ZOOM_IN, KC_MPRV, DYN_REC_STOP, + ONESHOT, XXXXXXX, XXXXXXX, _______, KC_VOLD, KC_MUTE, KC_MUTE, KC_VOLU, ZOOM_NML, KC_MSTP, KC_MNXT, KC_MPLY +), /* ONESHOT * ,-----------------------------------------------------------------------------------. @@ -187,12 +185,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ONESHOT] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, +[_ONESHOT] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* FUNCTIONS * ,-----------------------------------------------------------------------------------. @@ -205,12 +203,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Reset| NULL | LOCK | NULL | | NULL | | NULL |AGNorm|Voice-|AGSwap| * `-----------------------------------------------------------------------------------' */ -[_FUNCTN] = { - {KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR }, - {KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX }, - {XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ}, - {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP} -} +[_FUNCTN] = LAYOUT_planck_grid( + KC_SLEP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PWR, + KC_WAKE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, AU_OFF, MU_OFF, QWERTY, NUMPAD, MU_ON, AU_ON, XXXXXXX, MUV_IN, KC_SYSREQ, + RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, AG_NORM, MUV_DE, AG_SWAP +) }; -- cgit v1.2.3 From c9159effc0b07b44d90ea92de625b9d338938eb2 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 7 Dec 2018 16:48:03 -0800 Subject: handwired/MS_sculpt_mobile Refactor, Configurator and cleanup (#4576) * handwired/MS_sculpt_mobile: refactor - layout macro KEYMAP renamed to LAYOUT - layout macro MATRIX_TESTING_KEYMAP renamed to MATRIX_TESTING_LAYOUT * handwired/MS_sculpt_mobile: Configurator support * handwired/MS_sculpt_mobile: readme cleanup * handwired/MS_sculpt_mobile: rename folder Renamed the directory to fully lowercase. * handwired/MS_sculpt_mobile: rename keyboard files Renamed the keyboard core files to fully lowercase. * handwired/ms_sculpt_mobile: keymap readme cleanup Capitalization fixes because I'm that guy. * handwired/ms_sculpt_mobile: keymap config.h fixes Keymap config.h files updated to use #pragma once * handwired/ms_sculpt_mobile: updated paths Fixing path references due to rename. --- .../handwired/MS_sculpt_mobile/MS_sculpt_mobile.c | 1 - .../handwired/MS_sculpt_mobile/MS_sculpt_mobile.h | 48 --- keyboards/handwired/MS_sculpt_mobile/babblePaste.c | 460 --------------------- keyboards/handwired/MS_sculpt_mobile/babblePaste.h | 238 ----------- .../handwired/MS_sculpt_mobile/babblePaste.txt | 123 ------ keyboards/handwired/MS_sculpt_mobile/config.h | 98 ----- .../MS_sculpt_mobile/keymaps/default/config.h | 8 - .../MS_sculpt_mobile/keymaps/default/keymap.c | 64 --- .../MS_sculpt_mobile/keymaps/default/readme.md | 1 - .../MS_sculpt_mobile/keymaps/default/rules.mk | 17 - .../MS_sculpt_mobile/keymaps/milestogo/config.h | 32 -- .../MS_sculpt_mobile/keymaps/milestogo/keymap.c | 272 ------------ .../MS_sculpt_mobile/keymaps/milestogo/readme.md | 1 - .../MS_sculpt_mobile/keymaps/milestogo/rules.mk | 17 - keyboards/handwired/MS_sculpt_mobile/readme.md | 58 --- keyboards/handwired/MS_sculpt_mobile/rules.mk | 56 --- keyboards/handwired/ms_sculpt_mobile/babblePaste.c | 460 +++++++++++++++++++++ keyboards/handwired/ms_sculpt_mobile/babblePaste.h | 238 +++++++++++ .../handwired/ms_sculpt_mobile/babblePaste.txt | 123 ++++++ keyboards/handwired/ms_sculpt_mobile/config.h | 98 +++++ keyboards/handwired/ms_sculpt_mobile/info.json | 96 +++++ .../ms_sculpt_mobile/keymaps/default/config.h | 3 + .../ms_sculpt_mobile/keymaps/default/keymap.c | 44 ++ .../ms_sculpt_mobile/keymaps/default/readme.md | 1 + .../ms_sculpt_mobile/keymaps/default/rules.mk | 17 + .../ms_sculpt_mobile/keymaps/milestogo/config.h | 28 ++ .../ms_sculpt_mobile/keymaps/milestogo/keymap.c | 266 ++++++++++++ .../ms_sculpt_mobile/keymaps/milestogo/readme.md | 1 + .../ms_sculpt_mobile/keymaps/milestogo/rules.mk | 17 + .../handwired/ms_sculpt_mobile/ms_sculpt_mobile.c | 1 + .../handwired/ms_sculpt_mobile/ms_sculpt_mobile.h | 48 +++ keyboards/handwired/ms_sculpt_mobile/readme.md | 55 +++ keyboards/handwired/ms_sculpt_mobile/rules.mk | 56 +++ 33 files changed, 1552 insertions(+), 1494 deletions(-) delete mode 100644 keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c delete mode 100644 keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h delete mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.c delete mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.h delete mode 100644 keyboards/handwired/MS_sculpt_mobile/babblePaste.txt delete mode 100644 keyboards/handwired/MS_sculpt_mobile/config.h delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md delete mode 100644 keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk delete mode 100644 keyboards/handwired/MS_sculpt_mobile/readme.md delete mode 100644 keyboards/handwired/MS_sculpt_mobile/rules.mk create mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.c create mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/babblePaste.txt create mode 100644 keyboards/handwired/ms_sculpt_mobile/config.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/info.json create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md create mode 100644 keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk create mode 100644 keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c create mode 100644 keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h create mode 100644 keyboards/handwired/ms_sculpt_mobile/readme.md create mode 100644 keyboards/handwired/ms_sculpt_mobile/rules.mk diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c deleted file mode 100644 index 64982fb62d..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.c +++ /dev/null @@ -1 +0,0 @@ -#include "MS_sculpt_mobile.h" diff --git a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h b/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h deleted file mode 100644 index 1583dea6e8..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/MS_sculpt_mobile.h +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef MICROSOFT_SCULPT_MOBILE_H -#define MICROSOFT_SCULPT_MOBILE_H - -#include "quantum.h" - - -#define KEYMAP( \ - k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ - k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ - k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ - k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ - k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ - k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ - {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ - {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ - {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ - {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ - {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ -} - - -#define MATRIX_TESTING_KEYMAP( \ - k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ - k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ - k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ - k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ - k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ - k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ - k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ - k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ -) \ -{ \ - {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ - {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ - {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ - {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ - {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ - {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ - {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ - {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ -} - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c b/keyboards/handwired/MS_sculpt_mobile/babblePaste.c deleted file mode 100644 index 22394cc7d2..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.c +++ /dev/null @@ -1,460 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. -Setting the context is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -*/ - -#include "../MS_sculpt_mobile/babblePaste.h" - -#include "action_macro.h" - -#ifdef USE_BABLPASTE - -// GLOBAL variable to determine mode. Sets startup default if no eeppom -uint8_t babble_mode =0 ; - -// small function that we might also want to call from a keymap. - -macro_t* switch_babble_mode( uint8_t id) { - babble_mode= id; - return MACRO_NONE; //less typing where called -} - - -// Today I learned that the preprocessor can not create a switch statement label from an argument -// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 -#define BABLM(ent, macro...) \ - if ( ent == shortcut ) \ - { action_macro_play( MACRO(macro)); return MACRO_NONE; } - - -/* this function runs the appropriate babblepaste macro, given -the global babble_mode, and a shortcut from the ENUM in babblePaste.h -TODO, the pointers in this function should be stored in a PROGMEM array, not ram. -But that requires even more clever preprocessor foo. -*/ -const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { -/* - if ( shortcut < BABL_START_NUM || \ - shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { - return MACRO_NONE; - } -*/ - - -#ifdef MS_MODE - if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } -#endif -#ifdef MAC_MODE - if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } -#endif -#ifdef LINUX_MODE - if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } -#endif - #ifdef READMUX_MODE - if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } -#endif -#ifdef VI_MODE - if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } -#endif -#ifdef EMACS_MODE - if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } -#endif - - - - switch(babble_mode) { - -#ifdef MS_MODE - - case MS_MODE: - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE, T(HOME), END ); - BABLM( BABL_GO_END_LINE, T(END), END ); - BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE, T(UP), END ); - BABLM( BABL_PGDN, T(PGDN), END ); - BABLM( BABL_PGUP, T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - BABLM( BABL_FIND_NEXT, T(F3),END ); - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); - BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - BABLM( BABL_HELP, T(F1),END ); -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - - // Todo, ring bell, flash light, show user this isn't supported - return MACRO_NONE; - - -#endif /* MS_MODE*/ - - -#ifdef LINUX_MODE - - case LINUX_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); - BABLM( BABL_GO_START_LINE , T(HOME), END ); - BABLM( BABL_GO_END_LINE , T(END), END ); - BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); - BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); - BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); - BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); - BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); - BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); - /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ - BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ - /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ - BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ - BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); - BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); - BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); - BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); - //BABLM( BABL_HELP, END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); - BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); - BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); - BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); -#endif -#endif - return MACRO_NONE; - -#endif - -#ifdef MAC_MODE - - case MAC_MODE: - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); - BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); - BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); - BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); - BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); - BABLM( BABL_GO_PREV_LINE , T(UP), END ); - BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); - BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); - BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way - BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); - BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); - BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); - BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); - BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); - BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); - BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); - BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); - BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); - BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); - BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); - BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); - -#ifndef BABL_NOBROWSER - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -#endif -#endif - - return MACRO_NONE; -#endif - -#ifdef EMACS_MODE - - case EMACS_MODE: - switch(shortcut) { -//probably should allow meta to not be ALT - - BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); - BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); - BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); - BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably - BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); - BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure w3 out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - break; - - return MACRO_NONE; - } - -#endif - - -#ifdef VI_MODE - case VI_MODE: -// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) - - - BABLM( BABL_GO_LEFT_1C , T(H), END ); - BABLM( BABL_GO_RIGHT_1C , T(L), END ); - BABLM( BABL_GO_LEFT_WORD , T(B),END ); - BABLM( BABL_GO_RIGHT_WORD , T(W), END ); - BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ - BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ - BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); - BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); - BABLM( BABL_GO_NEXT_LINE , T(J), END ); - BABLM( BABL_GO_PREV_LINE, T(K), END ); - BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); - BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_1C , T(X),END ); - BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); - BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); - BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ - BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , T(U), END ); - BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); - BABLM( BABL_CUT , T(X), END ); - BABLM( BABL_COPY , T(Y),END ); - BABLM( BABL_PASTE , T(P), END ); - BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? - BABLM( BABL_FIND , T(SLASH),END ); - BABLM( BABL_FIND_NEXT , T(N),END ); - BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); - BABLM( BABL_RUNAPP,END ); - BABLM( BABL_SWITCH_APP_NEXT ,END ); - BABLM( BABL_SWITCH_APP_LAST ,END ); - BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); - BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help -#ifndef BABL_NOBROWSER -/* you get to figure this out - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - return MACRO_NONE; -#endif - - - - -#ifdef READMUX_MODE -// Readline command line editing + tmux windowing -// I havent decided how much to do readline and how much tmux - - - case READMUX_MODE: - - BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); - BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); - BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); - BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); - BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); - BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); - //BABLM( BABL_GO_START_DOC ,END );// tmux? - //BABLM( BABL_GO_END_DOC ,END ); // tmux? - BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); - BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); - BABLM( BABL_PGDN , T(PGDN), END ); - BABLM( BABL_PGUP , T(PGUP), END ); - BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); - BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); - BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); - BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); - BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); -#ifndef BABL_MOVEMENTONLY - BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); - BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably - BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time - //BABLM( BABL_COPY ,END ); - BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); - BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); - BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history - BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); - //BABLM( BABL_FIND_REPLACE ,END ); - BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux - BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux - BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux - BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want - // BABLM( BABL_HELP ,END ); -#ifndef BABL_NOBROWSER -/* Add lynx shortcuts? - BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); - BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); - BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); - BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); - BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); - BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); - BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); - BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); - BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); - BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); - //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE - BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome - // Chrome - BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache - BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F - BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); - BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); -*/ -#endif -#endif - - return MACRO_NONE; - -#endif - - default: - return MACRO_NONE; - } - -} - - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h b/keyboards/handwired/MS_sculpt_mobile/babblePaste.h deleted file mode 100644 index cedd7d92ba..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.h +++ /dev/null @@ -1,238 +0,0 @@ -/* A library to output the right key shortcut in any common app. -Given a global variable babble_mode to show the environment and a -key that calls the paste macro, do the right type of paste. - -Setting the bable_mode is done by another macro, or TBD interaction with the host. - -Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and jeebak & algernon's keymap -*/ -#ifndef _babblePaste_h_included__ -#define _babblePaste_h_included__ -#include "../MS_sculpt_mobile/config.h" -#include "action_layer.h" -#include "quantum_keycodes.h" - -#ifdef USE_BABLPASTE - -/* *************************** - -// Uncomment any modes you want. Whatever mode = 0 will be the default on boot -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#define USE_BABLPASTE - -//#define MS_MODE 0 // Windows. -//#define MAC_MODE 1 -//#define LINUX_MODE 2 //aka gnome+KDE -//#define EMACS_MODE 3 -//#define VI_MODE 4 -//#define WORDSTAR_MODE 5 -//#define READMUX 6 // Readline and tmux - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER -****************************/ - - -// Uncomment if you need more free flash space -// It removes everything but cursor movement -//#define BABL_MOVEMENTONLY - - -// Define starting number for BABL macros in the macro range. -// Probably can start the default even lower -#define BABL_START_NUM 50 - -/* Macros handled by babblepaste. Most should be available for all platforms. -Whatever isn't defined will NOP */ -enum { -// Movement macros - // left & right - BABL_GO_LEFT_1C= BABL_START_NUM, - BABL_GO_RIGHT_1C, - BABL_GO_LEFT_WORD, - BABL_GO_RIGHT_WORD, - BABL_GO_START_LINE, - BABL_GO_END_LINE, - // now up & down - BABL_GO_START_DOC, - BABL_GO_END_DOC, - BABL_GO_NEXT_LINE, - BABL_GO_PREV_LINE, - BABL_PGDN, - BABL_PGUP, - // And the delete options - //BABL_DEL_LEFT_1C == backspace, so why bother. - BABL_DEL_RIGHT_1C, // usually = Del - BABL_DEL_LEFT_WORD, - BABL_DEL_RIGHT_WORD, - BABL_DEL_TO_LINE_END, // delete from cursor to end of line - BABL_DEL_TO_LINE_START, // delete from cursor to begining line -#ifndef BABL_MOVEMENTONLY - // Cut & Paste - BABL_UNDO, - BABL_REDO, - BABL_CUT, - BABL_COPY, - BABL_PASTE, - BABL_SELECT_ALL, - /* not yet implemented - BABL_SWAP_LAST2C // swap last characters before the cursor - BABL_SWAP_LAST2W // Swap the last two words before the cursor - */ - // find & replace - BABL_FIND, - BABL_FIND_NEXT, - BABL_FIND_REPLACE, - // GUI or app - BABL_RUNAPP, - BABL_SWITCH_APP_NEXT, - BABL_SWITCH_APP_LAST, // previous - BABL_CLOSE_APP, - BABL_HELP, - -#ifndef BABL_NOBROWSER - BABL_BROWSER_NEW_TAB, - BABL_BROWSER_CLOSE_TAB, - BABL_BROWSER_REOPEN_LAST_TAB, - BABL_BROWSER_NEXT_TAB, - BABL_BROWSER_PREV_TAB, - BABL_BROWSER_URL_BAR, - BABL_BROWSER_FORWARD, - BABL_BROWSER_BACK, - BABL_BROWSER_FIND, - BABL_BROWSER_BOOKMARK, - BABL_BROWSER_DEV_TOOLS, // hard one to remember - BABL_BROWSER_RELOAD, - BABL_BROWSER_FULLSCREEN, - BABL_BROWSER_ZOOM_IN, - BABL_BROWSER_ZOOM_OUT, - -#endif - -#endif -// Macros for mode switching -#ifdef MS_MODE - BABL_WINDOWS, -#endif -#ifdef MAC_MODE - BABL_MAC, -#endif -#ifdef LINUX_MODE - BABL_LINUX, -#endif -#ifdef EMACS_MODE - BABL_EMACS, -#endif -#ifdef VI_MODE - BABL_VI, -#endif -#ifdef READMUX_MODE - BABL_READLINE, -#endif - - -}; - -// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? -#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. - -/* And all the shorthand keymap ready versions */ -// First the mode switching macros -#ifdef MS_MODE -#define B_WIN M(BABL_WINDOWS) -#endif -#ifdef MAC_MODE -#define B_MAC M(BABL_MAC) -#endif -#ifdef LINUX_MODE -#define B_LNX M(BABL_LINUX) -#endif -#ifdef EMACS_MODE -#define B_EMAX M(BABL_EMACS) -#endif -#ifdef VI_MODE -#define B_VI M(BABL_VI) -#endif -#ifdef READMUX_MODE -#define B_READ M(BABL_READLINE) -#endif - -// and all the movement & action. - -#define B_L1C M(BABL_GO_LEFT_1C) -#define B_R1C M(BABL_GO_RIGHT_1C) -#define B_L1W M(BABL_GO_LEFT_WORD) -#define B_R1W M(BABL_GO_RIGHT_WORD) -#define B_GSOL M(BABL_GO_START_LINE) -#define B_GEOL M(BABL_GO_END_LINE) -#define B_GTOP M(BABL_GO_START_DOC) -#define B_GEND M(BABL_GO_END_DOC) -#define B_DOWN M(BABL_GO_NEXT_LINE) -#define B_UP M(BABL_GO_PREV_LINE) -#define B_PGDN M(BABL_PGDN) -#define B_PGUP M(BABL_PGUP) -//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. -#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del -#define B_DLW M(BABL_DEL_LEFT_WORD) -#define B_DRW M(BABL_DEL_RIGHT_WORD) -#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line -#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line -#define B_UNDO M(BABL_UNDO) -#define B_REDO M(BABL_REDO) -#define B_CUT M(BABL_CUT) -#define B_COPY M(BABL_COPY) -#define B_PAST M(BABL_PASTE) -#define B_SELA M(BABL_SELECT_ALL) -#define B_FIND M(BABL_FIND) -#define B_FINDN M(BABL_FIND_NEXT) -#define B_FINDR M(BABL_FIND_REPLACE) -#define B_RAPP M(BABL_RUNAPP) -#define B_NAPP M(BABL_SWITCH_APP_NEXT) -#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous -#define B_CAPP M(BABL_CLOSE_APP) -#define B_HELP M(BABL_HELP) -#define B_NTAB M(BABL_BROWSER_NEW_TAB) -#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) -#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) -#define B_NXTB M(BABL_BROWSER_NEXT_TAB) -#define B_PTAB M(BABL_BROWSER_PREV_TAB) -#define B_NURL M(BABL_BROWSER_URL_BAR) -#define B_BFWD M(BABL_BROWSER_FORWARD) -#define B_BBAK M(BABL_BROWSER_BACK) -#define B_BFND M(BABL_BROWSER_FIND) -#define B_BOOK M(BABL_BROWSER_BOOKMARK) -#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember -#define B_BRLD M(BABL_BROWSER_RELOAD) -#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) -#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) -#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) - - - - - - - -/* from action_macro.h -typedef uint8_t macro_t; - -#define MACRO_NONE (macro_t*)0 -#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) -#define MACRO_GET(p) pgm_read_byte(p) - -#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) - -*/ - -const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); - -macro_t* switch_babble_mode( uint8_t id); - - -#endif -#endif - diff --git a/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt b/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt deleted file mode 100644 index cf75e153e8..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/babblePaste.txt +++ /dev/null @@ -1,123 +0,0 @@ - BabblePaste is a library of common macros used to make sure that -you can have one "paste" button on one layer, and it will do the -right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. - -The babblepaste library looks for the current status in a babble_mode global variable. -To switch modes, run the switch_babble_mode() function, or a pre defined macro. -Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, -across 42+ common macro actions. - - -###To use the library -1) Paste the following into your config.h. - -//////Begin////// -#define USE_BABLPASTE 1 - -#ifdef USE_BABLPASTE -/* define BabblePaste maps. Whatever = 0 will be the default. */ -// MAC_MODE 0 -// MS_MODE 1 -// LINUX_MODE 2 -// EMACS_MODE 3 -// VI_MODE 3 -// Readline and tmux -// READMUX_MODE 2 -// WORDSTAR_MODE 5 -#endif - -// Uncomment these to remove options an free up flash space - -// This removes everything but cursor movement -// BABL_MOVEMENTONLY -// and this just removes browser shortcuts -// BABL_NOBROWSER -///////End/////// - -2) Add the following to your keymap in the action_get_macro - -//////Begin////// -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif -///////End/////// - -3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the -list below -B_L1C // go left 1 char -B_R1C // go Right 1 char - B_L1W //GO_LEFT_1 WORD - B_R1W //BABL_GO_RIGHT_1 WORD - B_GSOL // BABL_GOTO_START of _LINE - B_GEOL // BABL_GOTO_END_LINE - B_GTOP //BABL_GOTO_START_DOC - B_GEND //BABL_GO_END_DOC - B_DOWN //BABL_GO_NEXT_LINE - B_UP // BABL_GO_PREV_LINE - B_PGDN //PGDN - B_PGUP //PGUP -// B_BKSP //backspace so why bother. - B_DEL // DEL_RIGHT_1 Char // usually = Del - B_DLW // DEL_LEFT_ 1 WORD) - B_DRW //DEL_RIGHT_1 WORD - B_DEOL // delete from cursor to end of line - B_DSOL // delete from cursor to begining line - B_UNDO //UNDO - B_REDO // REDO - B_CUT // CUT) - B_COPY // COPY) - B_PAST // PASTE) - B_SELA // SELECT_ALL - B_FIND // FIND) - B_FINDN //FIND_NEXT) - B_FINDR // FIND_REPLACE) - B_RAPP // open application launcher - B_NAPP // switch to next app - B_PAPP // switch to previous app - B_CAPP // CLOSE_APP) - B_HELP // HELP) - B_NTAB // BROWSER_NEW_TAB) - B_CTAB //BROWSER_CLOSE_TAB) - B_ROTB //BROWSER_REOPEN_LAST_TAB) - B_NXTB //BROWSER_NEXT_TAB) - B_PTAB //BROWSER_PREV_TAB) - B_NURL //BROWSER_jump to URL_BAR) - B_BFWD // BROWSER_FORWARD (in history) - B_BBAK //BROWSER_BACK (in history) - B_BFND // BROWSER_FIND) - B_BOOK //BROWSER_New BOOKMARK) - B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember - B_BRLD // BROWSER_RELOAD Page - B_BFUlL // BROWSER_FULLSCREEN) - B_ZMIN // BROWSER_ZOOM_IN) - B_ZMOT //BROWSER_ZOOM_OUT) - - -#### Development notes --Why a new function? Because it would make the keymap too ugly to put it there. --Why not return the macro to action_get_macro? Because I kept running into scope problems -and pointers to the wrong type. --Why not an array of arrays as a lookup instead of a function? That would allow you -to store the lookup table in PROGMEM. True, but that takes more pre-processor skill -than I had. - --Have you tested this on every platform? No. Submit a patch. - - -### Next steps for someone. -Make it easier to pair macros with modifiers. So key foo will jump to start of line, and -Shift(foo) will jump to the first tab in a browser. - -## Thanks - -Thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts -and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c -And of course QMK... - diff --git a/keyboards/handwired/MS_sculpt_mobile/config.h b/keyboards/handwired/MS_sculpt_mobile/config.h deleted file mode 100644 index c3bdf333e2..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/config.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER Microsoftplus -#define DESCRIPTION 6000 - -/* key matrix size */ -#define MATRIX_ROWS 8 -#define MATRIX_COLS 18 - -#ifdef ASTAR -#define PRODUCT sculpt mobile astar - /*0 1 2 3 4 5 6 7 8 */ -#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} - -#else -#define PRODUCT sculpt mobile teensypp -/* 0 1 2 3 4 5 6 7 */ -#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} -/* A B C D E F G H I J K L M N O P Q R */ -#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} -#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } - - -#endif - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION ROW2COL - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - - -/* - * 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 - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h deleted file mode 100644 index 4f3a425b7e..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/config.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../../MS_sculpt_mobile/config.h" - -// place overrides here - -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c deleted file mode 100644 index a8802c99a4..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/keymap.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "../../MS_sculpt_mobile.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| -* -------------------------------------------------------------------------------' -* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | -* -------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[0] = KEYMAP( \ - 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_VOLD, KC_VOLU, KC_MUTE,\ - KC_GRAVE, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ - 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_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_PGUP,\ - KC_LSFT, 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_PGDN,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -) - -}; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md deleted file mode 100644 index e67ddc6fec..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk b/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk deleted file mode 100644 index 3955a3ff42..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/default/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h deleted file mode 100644 index 5c04f647c3..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/config.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../../MS_sculpt_mobile/config.h" - -#define USE_BABLPASTE - -// Expect to get errors if you comment a feature out and leave it in your keymap. - -#ifdef USE_BABLPASTE -//define BabblePaste maps -// Windows. -#define MAC_MODE 0 -#define MS_MODE 1 -//aka gnome+KDE -//#define LINUX_MODE 2 -//#define EMACS_MODE 3 -#define VI_MODE 3 -// Readline and tmux -#define READMUX_MODE 2 -//#define WORDSTAR_MODE 5 -#endif - -// Uncomment if you need more free flash space - -// This removes everything but cursor movement -//#define BABL_MOVEMENTONLY -// and this just removes browser shortcuts -//#define BABL_NOBROWSER - -// place overrides here -#endif diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c deleted file mode 100644 index c9b16e75e5..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/keymap.c +++ /dev/null @@ -1,272 +0,0 @@ -#include "../../../MS_sculpt_mobile/babblePaste.h" -#include "../../MS_sculpt_mobile.h" -#include "action_layer.h" -#include "action_util.h" - -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif - -#define _QWR 0 -#define _CDH 2 -#define _SYM 3 -#define _MOV 4 -#define _TRAN 5 - - -enum layer_keycodes { -QWR, -CDH, -SYM, -MOV, -NUM, -TRAN -}; - - -// Shorter spacing -#define XXXX KC_NO -#define ____ KC_TRNS - -// Custom macros - -/* Fn Keys */ -#define TT_SYM MO(_SYM) -#define TT_MOV KC_FN2 -#define TT_NUM MO(_NUM) -#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) - -enum macro_keycodes { -DHPASTE=1, -VIBRK, -}; - - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -/* QWERTY -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_QWR] = KEYMAP( \ - 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_VOLD, KC_VOLU, CDH,\ - KC_ESC, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ - 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,\ - TT_MOV, 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_PGUP,\ - KC_LSFT, 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_PGDN,\ - KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT -), - -[_CDH] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ - KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ - TT_MOV, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ - KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ - ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ - -), - - -/* SYM -* -* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| -* -------------------------------------------------------------------------------' -* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | -* -------------------------------------------------------------------------- -* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_SYM] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ - ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ - ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), -/* -* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | -* -------------------------------------------------------------------------------' -* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| -* --------------------------------------------------------------------------- -* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | -* -------------------------------------------------------------------------------' -* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| -* -------------------------------------------------------------------------------- -* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| -* --------------------------------------------------------------------------------- -* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| -* --------------------------------------------------------------------------------- -*/ - -[_MOV] = KEYMAP (\ - ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ - ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ - ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -), - -[_TRAN] = KEYMAP (\ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ - ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ -) -}; - -const uint16_t PROGMEM fn_actions[] = { -[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), -[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) -}; - -#ifdef AUDIO_ENABLE - -float tone_startup[][2] = SONG(STARTUP_SOUND); -float tone_qwerty[][2] = SONG(QWERTY_SOUND); -float tone_colemak[][2] = SONG(COLEMAK_SOUND); -#endif - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWR: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); - #endif - layer_off(_CDH); - } - return false; - break; - - case CDH: - if (record->event.pressed) { - #ifdef AUDIO_ENABLE - PLAY_SONG(tone_colemak); - #endif - layer_on(_CDH); - } - return false; - break; - - case SYM: - if (record->event.pressed) { - layer_on(_SYM); - } else { - layer_off(_SYM); - } - return false; - break; - - } - return true; - -} - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - -/* If id is in the range of BABL macros, call the babl function */ -/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ -#ifdef USE_BABLPASTE - - if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { - if (record->event.pressed) { // is there a case where this isn't desired? - - babblePaste ( record, id ); - return MACRO_NONE; - } - } -#endif - - - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - - /* Colemak mod-dh moves the D key to the qwerty V position - This hack makes apple-V_position do what I mean */ - case DHPASTE: - if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { - if (record->event.pressed) { - clear_keyboard_but_mods(); - register_code(KC_V); - } else { - unregister_code(KC_V); - } - } else { - if (record->event.pressed) { - register_code(KC_D); - } else { - unregister_code(KC_D); - } - } - break; - - case VIBRK: // vi esc: - if (record->event.pressed) { - return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); - } - break; - - - - - default: - return MACRO_NONE; - } - - -return MACRO_NONE; -}; - - - - - -void matrix_init_user(void) { -} - -void matrix_scan_user(void) { - -} - - -void led_set_user(uint8_t usb_led) { - -} - - - - - - diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md deleted file mode 100644 index 96ee0e77a5..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/readme.md +++ /dev/null @@ -1 +0,0 @@ -# A more programmer oriented keymap for microsoft-sculpt-mobile diff --git a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk deleted file mode 100644 index ddfea82556..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/keymaps/milestogo/rules.mk +++ /dev/null @@ -1,17 +0,0 @@ -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -CONSOLE_ENABLE = no # 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 controls -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. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/MS_sculpt_mobile/readme.md b/keyboards/handwired/MS_sculpt_mobile/readme.md deleted file mode 100644 index d435b449fb..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/readme.md +++ /dev/null @@ -1,58 +0,0 @@ - -This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it -into a hard-wired keyboard running QMK. - -The keyboard is known under several different names: -Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded - -I had a stack of them,since they're cheap on ebay, travel well, and are just ergo enough. - -The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of -"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 - -Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. -They're also allow the cable to be inserted on top or bottom. - -If I was going to do it again, I'd make the MCU connection come out the top of the keyboard -and avoid the wires dangling out the bottom. - -As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, -but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a -half millimeter off the end of the ribbon cable & the errors go away. - -My method for discovering the matrix was to set up a KEYMAP macro that included all pins. -See MATRIX_TESTING_KEYMAP if you need it. Then set up a keymap that has all printable symbols -in the first 4 rows. test each key & record output. Then switch the printable symbols to the -bottom 4 rows & repeat. This was enough to show the matrix. - - -The full original keymap for the sculpt is - A B C D E F G H ---> -0 b n m , . / -1 g h " -2 7 8 9 0 Del PgUp -3 p [ ] \ -4 y u i o -5 ~ - += j k l ; 5 -6 a s d q w e, Up left -7 F7 F8 F9 F10 F11 F12 f - ------> I J K L M N O P Q R -0 Caps FN -1 Vol+ mute Rctl vol- pgdn LCTL -2 Rshift LShift -3 Ralt LAlt -4 LGUI -5 6 bakspc 1 2 3 4 F4 F5 F6 -6 Down right spc F1 F2 F3 tab -7 r t z x c v enter Esc - -This works with 18 cols + 8 rows on a Teensy++, or Arm based Teensy. - -The Astar mini has all pins exposed , so you can do 18x8 -If you want a speaker, LEDs &etc, you'll need to free up a pin. I recommend joining columns -R and L to the same pin. - -Building - add ASTAR=1 to the compile line or leave out for teensy2++ - - diff --git a/keyboards/handwired/MS_sculpt_mobile/rules.mk b/keyboards/handwired/MS_sculpt_mobile/rules.mk deleted file mode 100644 index 680c057d36..0000000000 --- a/keyboards/handwired/MS_sculpt_mobile/rules.mk +++ /dev/null @@ -1,56 +0,0 @@ - -## Project specific files -SRC= babblePaste.c - - -ifdef ASTAR - CFLAGS=-D ASTAR - MCU = atmega32u4 - SCULPT_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done ; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) - -else - MCU = at90usb1286 - SCULPT_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex -endif - -F_CPU = 16000000 -ARCH = AVR8 -F_USB = $(F_CPU) - -# 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. -ifdef ASTAR - BOOTLOADER = caterina -else - BOOTLOADER = atmel-dfu -endif - -# Interrupt driven control endpoint task(+60) -OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT - -# -BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - - -USB = /dev/cu.usbmodem14141 - - - -# upload: build -# $(SCULPT_UPLOAD_COMMAND) diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.c b/keyboards/handwired/ms_sculpt_mobile/babblePaste.c new file mode 100644 index 0000000000..e035648706 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/babblePaste.c @@ -0,0 +1,460 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. +Setting the context is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +*/ + +#include "babblePaste.h" + +#include "action_macro.h" + +#ifdef USE_BABLPASTE + +// GLOBAL variable to determine mode. Sets startup default if no eeppom +uint8_t babble_mode =0 ; + +// small function that we might also want to call from a keymap. + +macro_t* switch_babble_mode( uint8_t id) { + babble_mode= id; + return MACRO_NONE; //less typing where called +} + + +// Today I learned that the preprocessor can not create a switch statement label from an argument +// And else statements have problems, see https://gcc.gnu.org/onlinedocs/gcc-3.0.1/cpp_3.html#SEC15 +#define BABLM(ent, macro...) \ + if ( ent == shortcut ) \ + { action_macro_play( MACRO(macro)); return MACRO_NONE; } + + +/* this function runs the appropriate babblepaste macro, given +the global babble_mode, and a shortcut from the ENUM in babblePaste.h +TODO, the pointers in this function should be stored in a PROGMEM array, not ram. +But that requires even more clever preprocessor foo. +*/ +const macro_t *babblePaste (keyrecord_t *record, uint8_t shortcut) { +/* + if ( shortcut < BABL_START_NUM || \ + shortcut >= (BABL_START_NUM + BABL_NUM_MACROS ) ) { + return MACRO_NONE; + } +*/ + + +#ifdef MS_MODE + if ( BABL_WINDOWS == shortcut ) { return switch_babble_mode(MS_MODE); } +#endif +#ifdef MAC_MODE + if ( BABL_MAC == shortcut) { return switch_babble_mode(MAC_MODE); } +#endif +#ifdef LINUX_MODE + if ( BABL_LINUX == shortcut ) { return switch_babble_mode(LINUX_MODE); } +#endif + #ifdef READMUX_MODE + if ( BABL_READLINE == shortcut ) { switch_babble_mode(READMUX_MODE); return MACRO_NONE; } +#endif +#ifdef VI_MODE + if ( BABL_VI == shortcut ) { return switch_babble_mode(VI_MODE); } +#endif +#ifdef EMACS_MODE + if ( BABL_EMACS == shortcut ) { return switch_babble_mode(EMACS_MODE); } +#endif + + + + switch(babble_mode) { + +#ifdef MS_MODE + + case MS_MODE: + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD, D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE, T(HOME), END ); + BABLM( BABL_GO_END_LINE, T(END), END ); + BABLM( BABL_GO_START_DOC, D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC, D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE, T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE, T(UP), END ); + BABLM( BABL_PGDN, T(PGDN), END ); + BABLM( BABL_PGUP, T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C, T(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD, D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO, D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO, D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT, D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY, D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE, D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + BABLM( BABL_FIND_NEXT, T(F3),END ); + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); + BABLM( BABL_RUNAPP, D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LALT),T(TAB), U(LALT),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LALT),T(TAB), U(LALT), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + BABLM( BABL_HELP, T(F1),END ); +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LCTL),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), D(RSFT), T(EQL), U(RSFT), U(LCTL),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + + // Todo, ring bell, flash light, show user this isn't supported + return MACRO_NONE; + + +#endif /* MS_MODE*/ + + +#ifdef LINUX_MODE + + case LINUX_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LCTL), T(LEFT), U(LCTL), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LCTL), T(RIGHT), U(LCTL), END ); + BABLM( BABL_GO_START_LINE , T(HOME), END ); + BABLM( BABL_GO_END_LINE , T(END), END ); + BABLM( BABL_GO_START_DOC , D(LCTL),T(HOME), U(LCTL),END ); + BABLM( BABL_GO_END_DOC , D(LCTL),T(END), U(LCTL),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LCTL), T(DEL), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_END, D(RSFT), T(HOME), U(RSFT), T(DEL), END); + BABLM( BABL_DEL_TO_LINE_START, D(RSFT), T(END), U(RSFT), T(DEL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(Z), U(LCTL), END ); + BABLM( BABL_REDO , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_CUT , D(LCTL), T(X), U(LCTL), END ); + BABLM( BABL_COPY , D(LCTL), T(C), U(LCTL), END ); + BABLM( BABL_PASTE , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_SELECT_ALL, D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_FIND, D(LCTL),T(F), U(LCTL),END ); + /* BABLM(BABL_FIND_NEXT , T(F3),END ); KDE */ + BABLM( BABL_FIND_NEXT, D(LCTL),T(G), U(LCTL),END ); // Gnome*/ + /* BABLM( , D(LCTL),T(R), U(LCTL),END ); KDE */ + BABLM( BABL_FIND_REPLACE, D(LCTL),T(H), U(LCTL),END ); // Gnome*/ + BABLM( BABL_RUNAPP, D(LALT),T(F2), U(LALT),END ); + BABLM( BABL_SWITCH_APP_NEXT, D(LCTL),T(TAB), U(LCTL),END ); + BABLM( BABL_SWITCH_APP_LAST, D(LSFT),D(LCTL),T(TAB), U(LCTL), U(LSFT),END ); + BABLM( BABL_CLOSE_APP, D(LALT),T(F4), U(LALT),END ); + //BABLM( BABL_HELP, END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LCTL), T(T), U(LCTL),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LCTL), T(W), U(LCTL),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LCTL), D(RSFT),T(T), U(RSFT),U(LCTL),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LCTL), T(TAB), U(LCTL),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LCTL), D(RSFT), T(TAB), U(RSFT), U(LCTL),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LCTL), T(L), U(LCTL),END ); + BABLM( BABL_BROWSER_FORWARD, D(LALT), T(RIGHT), U(LALT),END ); + BABLM( BABL_BROWSER_BACK, D(LALT), T(LEFT), U(LALT),END ); + BABLM( BABL_BROWSER_FIND, D(LCTL), T(F), U(LCTL),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_BROWSER_DEV_TOOLS, D(LCTL), T(T), U(LCTL),END ); // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LCTL), T(F5), U(LCTL),END ); // hard reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, T(F11),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LCTL), T(PLUS), U(LCTL),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LCTL), T(MINS), U(LCTL),END ); +#endif +#endif + return MACRO_NONE; + +#endif + +#ifdef MAC_MODE + + case MAC_MODE: + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(LEFT), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(RIGHT), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LGUI), T(LEFT), U(LGUI), END ); + BABLM( BABL_GO_END_LINE , D(LGUI), T(RIGHT), U(LGUI), END ); + BABLM( BABL_GO_START_DOC , D(LGUI),T(UP), U(LGUI),END ); + BABLM( BABL_GO_END_DOC , D(LGUI),T(DOWN), U(LGUI),END ); + BABLM( BABL_GO_NEXT_LINE , T(DOWN), END ); + BABLM( BABL_GO_PREV_LINE , T(UP), END ); + BABLM( BABL_PGDN , D(LALT),T(DOWN), U(LALT), END ); + BABLM( BABL_PGUP , D(LALT),T(UP), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C , D(DEL), END ); + BABLM( BABL_DEL_LEFT_WORD , D(LALT), T(BSPACE), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_WORD, D(LALT), T(DEL), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END );// there must be another way + BABLM( BABL_DEL_TO_LINE_START, D(LGUI), T(BSPACE), U(LGUI), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(1), D(LGUI), T(Z), U(LGUI), END ); + BABLM( BABL_REDO , D(LSFT),D(LGUI), T(Z), U(LSFT),U(LGUI), END ); + BABLM( BABL_CUT , D(LGUI), T(X), U(LGUI), END ); + BABLM( BABL_COPY , D(LGUI), T(C), U(LGUI), END ); + BABLM( BABL_PASTE , D(LGUI), T(V), U(LGUI), END ); + BABLM( BABL_SELECT_ALL , D(LGUI), T(A), U(LGUI), END ); + BABLM( BABL_FIND , D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_FIND_NEXT, D(LGUI),T(G), U(LGUI),END ); + BABLM( BABL_FIND_REPLACE, D(LGUI),T(F), U(LGUI),END ); + BABLM( BABL_RUNAPP , D(LGUI),T(R), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_NEXT , D(LGUI),T(TAB), U(LGUI),END ); + BABLM( BABL_SWITCH_APP_LAST , D(LSFT),D(LGUI),T(TAB), U(LGUI), U(LSFT),END ); + BABLM( BABL_CLOSE_APP , D(LGUI),T(Q), U(LGUI),END ); + BABLM( BABL_HELP , D(LSFT),D(LGUI),T(SLASH), U(LGUI), U(LSFT),END ); + +#ifndef BABL_NOBROWSER + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +#endif +#endif + + return MACRO_NONE; +#endif + +#ifdef EMACS_MODE + + case EMACS_MODE: + switch(shortcut) { +//probably should allow meta to not be ALT + + BABLM( BABL_GO_LEFT_1C, T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C, T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD, D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + BABLM( BABL_GO_START_DOC , D(LALT), D(LSFT), T(COMM),U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_END_DOC , D(LALT), D(LSFT), T(DOT), U(LSFT), U(LALT) ,END ); + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , D(LCTL), T(V), U(LCTL), END ); + BABLM( BABL_PGUP , D(LALT), T(V), U(LALT), END ); + BABLM( BABL_DEL_RIGHT_1C, D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(BSPACE), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, T(ESC), T(0), D(LCTL), T(K), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LCTL), T(X), U(LCTL),T(C), END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_COPY , D(LALT), T(W), U(LALT), END ); //really? + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL ,D(LCTL), T(X), U(LCTL),T(H), END ); + BABLM( BABL_FIND , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_NEXT , D(LCTL), T(S), U(LCTL),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP , D(LALT), T(X), U(LALT),T(S),T(H),T(E),T(L),T(L),END );// arguably + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(X), U(LCTL),T(RIGHT), END ); // arguably + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(X), U(LCTL),T(LEFT), END ); // arguably + BABLM( BABL_CLOSE_APP , D(LCTL), T(X), U(LCTL),T(C),END ); + BABLM( BABL_HELP , D(LCTL),T(H), U(LCTL),T(A),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure w3 out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), D(RSFT), T(EQL), U(RSFT), U(LGUI),END ); // ctr+ + + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + break; + + return MACRO_NONE; + } + +#endif + + +#ifdef VI_MODE + case VI_MODE: +// you have to track the modes yourself. Otherwise motion is awful (bell, bell, bell) + + + BABLM( BABL_GO_LEFT_1C , T(H), END ); + BABLM( BABL_GO_RIGHT_1C , T(L), END ); + BABLM( BABL_GO_LEFT_WORD , T(B),END ); + BABLM( BABL_GO_RIGHT_WORD , T(W), END ); + BABLM( BABL_GO_START_LINE , D(LSFT), T(6),U(LSFT), END ); //^ + BABLM( BABL_GO_END_LINE , D(LSFT), T(4),U(LSFT) , END ); //$ + BABLM( BABL_GO_START_DOC , T(G),T(G) ,END ); + BABLM( BABL_GO_END_DOC , D(LSFT), T(G),U(LSFT),END ); + BABLM( BABL_GO_NEXT_LINE , T(J), END ); + BABLM( BABL_GO_PREV_LINE, T(K), END ); + BABLM( BABL_PGDN ,D(LCTL), T(F), U(LCTL), END ); + BABLM( BABL_PGUP , D(LCTL), T(B), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_1C , T(X),END ); + BABLM( BABL_DEL_LEFT_WORD , T(D),T(G),T(E),END ); + BABLM( BABL_DEL_RIGHT_WORD , T(D),T(W),END ); + BABLM( BABL_DEL_TO_LINE_END, T(D),D(LSFT), T(4),U(LSFT) ,END ); // d$ + BABLM( BABL_DEL_TO_LINE_START, T(D),D(LSFT), T(6),U(LSFT) ,END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , T(U), END ); + BABLM( BABL_REDO , D(LCTL), T(R), U(LCTL), END ); + BABLM( BABL_CUT , T(X), END ); + BABLM( BABL_COPY , T(Y),END ); + BABLM( BABL_PASTE , T(P), END ); + BABLM( BABL_SELECT_ALL , D(LSFT), T(SCLN),U(LSFT),D(LSFT), T(5),U(LSFT),T(Y), END ); // wrong but helpful? + BABLM( BABL_FIND , T(SLASH),END ); + BABLM( BABL_FIND_NEXT , T(N),END ); + BABLM( BABL_FIND_REPLACE , D(LALT),D(LSFT), T(5),U(LSFT), U(LALT), END ); + BABLM( BABL_RUNAPP,END ); + BABLM( BABL_SWITCH_APP_NEXT ,END ); + BABLM( BABL_SWITCH_APP_LAST ,END ); + BABLM(BABL_CLOSE_APP, D(LSFT), T(SCLN),U(LSFT), T(Q), D(RSFT), T(1),U(RSFT), END ); + BABLM(BABL_HELP, D(LSFT), T(SCLN),U(LSFT),T(H),END); // start search in help +#ifndef BABL_NOBROWSER +/* you get to figure this out + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + return MACRO_NONE; +#endif + + + + +#ifdef READMUX_MODE +// Readline command line editing + tmux windowing +// I havent decided how much to do readline and how much tmux + + + case READMUX_MODE: + + BABLM( BABL_GO_LEFT_1C , T(LEFT), END ); + BABLM( BABL_GO_RIGHT_1C , T(RIGHT), END ); + BABLM( BABL_GO_LEFT_WORD , D(LALT), T(B), U(LALT), END ); + BABLM( BABL_GO_RIGHT_WORD , D(LALT), T(F), U(LALT), END ); + BABLM( BABL_GO_START_LINE , D(LCTL), T(A), U(LCTL), END ); + BABLM( BABL_GO_END_LINE , D(LCTL), T(E), U(LCTL), END ); + //BABLM( BABL_GO_START_DOC ,END );// tmux? + //BABLM( BABL_GO_END_DOC ,END ); // tmux? + BABLM( BABL_GO_NEXT_LINE , D(LCTL), T(N), U(LCTL), END ); + BABLM( BABL_GO_PREV_LINE , D(LCTL), T(P), U(LCTL), END ); + BABLM( BABL_PGDN , T(PGDN), END ); + BABLM( BABL_PGUP , T(PGUP), END ); + BABLM( BABL_DEL_RIGHT_1C , D(LCTL), T(D), U(LCTL),END ); + BABLM( BABL_DEL_LEFT_WORD , D(LCTL), T(W), U(LCTL), END ); + BABLM( BABL_DEL_RIGHT_WORD , D(LALT), T(D), U(LALT), END ); + BABLM( BABL_DEL_TO_LINE_END, D(LCTL), T(K), U(LCTL), END ); + BABLM( BABL_DEL_TO_LINE_START, D(LCTL), T(U), U(LCTL), END ); +#ifndef BABL_MOVEMENTONLY + BABLM( BABL_UNDO , D(LALT), T(R), U(LALT) , END ); + BABLM( BABL_REDO , D(LCTL), T(X), U(LCTL),T(C), END ); // arguably + BABLM( BABL_CUT , D(LCTL), T(K), U(LCTL), END ); // wrong half the time + //BABLM( BABL_COPY ,END ); + BABLM( BABL_PASTE , D(LCTL), T(Y), U(LCTL), END ); + BABLM( BABL_SELECT_ALL , D(LCTL), T(A), T(K), T(Y), U(LCTL) , END ); + BABLM( BABL_FIND , D(LCTL), T(R), U(LCTL), END ); // search history + BABLM(BABL_FIND_NEXT, D(LCTL), T(S), U(LCTL), END ); + //BABLM( BABL_FIND_REPLACE ,END ); + BABLM( BABL_RUNAPP , D(LCTL), T(B), U(LCTL), T(C),END ); //tmux + BABLM( BABL_SWITCH_APP_NEXT , D(LCTL), T(B), U(LCTL), T(N),END ); //tmux + BABLM( BABL_SWITCH_APP_LAST , D(LCTL), T(B), U(LCTL), T(P),END ); //tmux + BABLM( BABL_CLOSE_APP , D(LCTL), T(B), U(LCTL), T(D),END); // usually what I want + // BABLM( BABL_HELP ,END ); +#ifndef BABL_NOBROWSER +/* Add lynx shortcuts? + BABLM( BABL_BROWSER_NEW_TAB, D(LGUI), T(T), U(LGUI),END ); + BABLM( BABL_BROWSER_CLOSE_TAB, D(LGUI), T(W), U(LGUI),END ); + BABLM( BABL_BROWSER_REOPEN_LAST_TAB, D(LGUI), D(RSFT),T(T), U(RSFT),U(LGUI),END ); + BABLM( BABL_BROWSER_NEXT_TAB, D(LGUI),D(LALT), T(RIGHT),U(LALT), U(LGUI),END ); + BABLM( BABL_BROWSER_PREV_TAB, D(LGUI), D(RSFT), T(LEFT), U(RSFT), U(LGUI),END ); + BABLM( BABL_BROWSER_URL_BAR, D(LGUI), T(L), U(LGUI),END ); + BABLM( BABL_BROWSER_FORWARD, D(LGUI), T(RIGHT), U(LGUI),END ); + BABLM( BABL_BROWSER_BACK, D(LGUI), T(LEFT), U(LGUI),END ); + BABLM( BABL_BROWSER_FIND, D(LGUI), T(F), U(LGUI),END ); + BABLM( BABL_BROWSER_BOOKMARK, D(LGUI), T(D), U(LGUI),END ); + //BABLM( BABL_BROWSER_DEV_TOOLS, T(F12), U(LGUI),END ); // EDGE + BABLM( BABL_BROWSER_DEV_TOOLS, D(LGUI), D(LALT), T(I), U(LALT),U(LGUI),END ); // Chrome + // Chrome + BABLM( BABL_BROWSER_RELOAD, D(LGUI), T(R), U(LGUI),END ); // add shift for reload w/o cache + BABLM( BABL_BROWSER_FULLSCREEN, D(LGUI), D(LCTL), T(P), U(LCTL), U(LGUI),END ); //command shift F + BABLM( BABL_BROWSER_ZOOM_IN, D(LGUI), T(PLUS), U(LGUI),END ); + BABLM( BABL_BROWSER_ZOOM_OUT, D(LGUI), T(MINS), U(LGUI),END ); +*/ +#endif +#endif + + return MACRO_NONE; + +#endif + + default: + return MACRO_NONE; + } + +} + + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.h b/keyboards/handwired/ms_sculpt_mobile/babblePaste.h new file mode 100644 index 0000000000..1e8206212a --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/babblePaste.h @@ -0,0 +1,238 @@ +/* A library to output the right key shortcut in any common app. +Given a global variable babble_mode to show the environment and a +key that calls the paste macro, do the right type of paste. + +Setting the bable_mode is done by another macro, or TBD interaction with the host. + +Huge thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and jeebak & algernon's keymap +*/ +#ifndef _babblePaste_h_included__ +#define _babblePaste_h_included__ +#include "config.h" +#include "action_layer.h" +#include "quantum_keycodes.h" + +#ifdef USE_BABLPASTE + +/* *************************** + +// Uncomment any modes you want. Whatever mode = 0 will be the default on boot +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#define USE_BABLPASTE + +//#define MS_MODE 0 // Windows. +//#define MAC_MODE 1 +//#define LINUX_MODE 2 //aka gnome+KDE +//#define EMACS_MODE 3 +//#define VI_MODE 4 +//#define WORDSTAR_MODE 5 +//#define READMUX 6 // Readline and tmux + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER +****************************/ + + +// Uncomment if you need more free flash space +// It removes everything but cursor movement +//#define BABL_MOVEMENTONLY + + +// Define starting number for BABL macros in the macro range. +// Probably can start the default even lower +#define BABL_START_NUM 50 + +/* Macros handled by babblepaste. Most should be available for all platforms. +Whatever isn't defined will NOP */ +enum { +// Movement macros + // left & right + BABL_GO_LEFT_1C= BABL_START_NUM, + BABL_GO_RIGHT_1C, + BABL_GO_LEFT_WORD, + BABL_GO_RIGHT_WORD, + BABL_GO_START_LINE, + BABL_GO_END_LINE, + // now up & down + BABL_GO_START_DOC, + BABL_GO_END_DOC, + BABL_GO_NEXT_LINE, + BABL_GO_PREV_LINE, + BABL_PGDN, + BABL_PGUP, + // And the delete options + //BABL_DEL_LEFT_1C == backspace, so why bother. + BABL_DEL_RIGHT_1C, // usually = Del + BABL_DEL_LEFT_WORD, + BABL_DEL_RIGHT_WORD, + BABL_DEL_TO_LINE_END, // delete from cursor to end of line + BABL_DEL_TO_LINE_START, // delete from cursor to begining line +#ifndef BABL_MOVEMENTONLY + // Cut & Paste + BABL_UNDO, + BABL_REDO, + BABL_CUT, + BABL_COPY, + BABL_PASTE, + BABL_SELECT_ALL, + /* not yet implemented + BABL_SWAP_LAST2C // swap last characters before the cursor + BABL_SWAP_LAST2W // Swap the last two words before the cursor + */ + // find & replace + BABL_FIND, + BABL_FIND_NEXT, + BABL_FIND_REPLACE, + // GUI or app + BABL_RUNAPP, + BABL_SWITCH_APP_NEXT, + BABL_SWITCH_APP_LAST, // previous + BABL_CLOSE_APP, + BABL_HELP, + +#ifndef BABL_NOBROWSER + BABL_BROWSER_NEW_TAB, + BABL_BROWSER_CLOSE_TAB, + BABL_BROWSER_REOPEN_LAST_TAB, + BABL_BROWSER_NEXT_TAB, + BABL_BROWSER_PREV_TAB, + BABL_BROWSER_URL_BAR, + BABL_BROWSER_FORWARD, + BABL_BROWSER_BACK, + BABL_BROWSER_FIND, + BABL_BROWSER_BOOKMARK, + BABL_BROWSER_DEV_TOOLS, // hard one to remember + BABL_BROWSER_RELOAD, + BABL_BROWSER_FULLSCREEN, + BABL_BROWSER_ZOOM_IN, + BABL_BROWSER_ZOOM_OUT, + +#endif + +#endif +// Macros for mode switching +#ifdef MS_MODE + BABL_WINDOWS, +#endif +#ifdef MAC_MODE + BABL_MAC, +#endif +#ifdef LINUX_MODE + BABL_LINUX, +#endif +#ifdef EMACS_MODE + BABL_EMACS, +#endif +#ifdef VI_MODE + BABL_VI, +#endif +#ifdef READMUX_MODE + BABL_READLINE, +#endif + + +}; + +// BUG, used to jump to babble functiion. Surely there is a way to calculate size of enum? +#define BABL_NUM_MACROS 48+4 // 48 + # of defined modes. + +/* And all the shorthand keymap ready versions */ +// First the mode switching macros +#ifdef MS_MODE +#define B_WIN M(BABL_WINDOWS) +#endif +#ifdef MAC_MODE +#define B_MAC M(BABL_MAC) +#endif +#ifdef LINUX_MODE +#define B_LNX M(BABL_LINUX) +#endif +#ifdef EMACS_MODE +#define B_EMAX M(BABL_EMACS) +#endif +#ifdef VI_MODE +#define B_VI M(BABL_VI) +#endif +#ifdef READMUX_MODE +#define B_READ M(BABL_READLINE) +#endif + +// and all the movement & action. + +#define B_L1C M(BABL_GO_LEFT_1C) +#define B_R1C M(BABL_GO_RIGHT_1C) +#define B_L1W M(BABL_GO_LEFT_WORD) +#define B_R1W M(BABL_GO_RIGHT_WORD) +#define B_GSOL M(BABL_GO_START_LINE) +#define B_GEOL M(BABL_GO_END_LINE) +#define B_GTOP M(BABL_GO_START_DOC) +#define B_GEND M(BABL_GO_END_DOC) +#define B_DOWN M(BABL_GO_NEXT_LINE) +#define B_UP M(BABL_GO_PREV_LINE) +#define B_PGDN M(BABL_PGDN) +#define B_PGUP M(BABL_PGUP) +//#define B_BKSP M(BABL_DEL_LEFT_1C) == backspace so why bother. +#define B_DEL M(BABL_DEL_RIGHT_1C) // usually = Del +#define B_DLW M(BABL_DEL_LEFT_WORD) +#define B_DRW M(BABL_DEL_RIGHT_WORD) +#define B_DEOL M(BABL_DEL_TO_LINE_END) // delete from cursor to end of line +#define B_DSOL M(BABL_DEL_TO_LINE_START) // delete from cursor to begining line +#define B_UNDO M(BABL_UNDO) +#define B_REDO M(BABL_REDO) +#define B_CUT M(BABL_CUT) +#define B_COPY M(BABL_COPY) +#define B_PAST M(BABL_PASTE) +#define B_SELA M(BABL_SELECT_ALL) +#define B_FIND M(BABL_FIND) +#define B_FINDN M(BABL_FIND_NEXT) +#define B_FINDR M(BABL_FIND_REPLACE) +#define B_RAPP M(BABL_RUNAPP) +#define B_NAPP M(BABL_SWITCH_APP_NEXT) +#define B_PAPP M(BABL_SWITCH_APP_LAST) // previous +#define B_CAPP M(BABL_CLOSE_APP) +#define B_HELP M(BABL_HELP) +#define B_NTAB M(BABL_BROWSER_NEW_TAB) +#define B_CTAB M(BABL_BROWSER_CLOSE_TAB) +#define B_ROTB M(BABL_BROWSER_REOPEN_LAST_TAB) +#define B_NXTB M(BABL_BROWSER_NEXT_TAB) +#define B_PTAB M(BABL_BROWSER_PREV_TAB) +#define B_NURL M(BABL_BROWSER_URL_BAR) +#define B_BFWD M(BABL_BROWSER_FORWARD) +#define B_BBAK M(BABL_BROWSER_BACK) +#define B_BFND M(BABL_BROWSER_FIND) +#define B_BOOK M(BABL_BROWSER_BOOKMARK) +#define B_BDEV M(BABL_BROWSER_DEV_TOOLS) // hard one to remember +#define B_BRLD M(BABL_BROWSER_RELOAD) +#define B_BFUlL M(BABL_BROWSER_FULLSCREEN) +#define B_ZMIN M(BABL_BROWSER_ZOOM_IN) +#define B_ZMOT M(BABL_BROWSER_ZOOM_OUT) + + + + + + + +/* from action_macro.h +typedef uint8_t macro_t; + +#define MACRO_NONE (macro_t*)0 +#define MACRO(...) ({ static const macro_t __m[] PROGMEM = { __VA_ARGS__ }; &__m[0]; }) +#define MACRO_GET(p) pgm_read_byte(p) + +#define BABL_MSTART (entry, os, macro...) ( const macro_t bablDict[entry][os] PROGMEM = { macro... }; ) + +*/ + +const macro_t *babblePaste(keyrecord_t *record, uint8_t shortcut); + +macro_t* switch_babble_mode( uint8_t id); + + +#endif +#endif + diff --git a/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt b/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt new file mode 100644 index 0000000000..cf75e153e8 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/babblePaste.txt @@ -0,0 +1,123 @@ + BabblePaste is a library of common macros used to make sure that +you can have one "paste" button on one layer, and it will do the +right thing on any OS or app. Windows=Ctrl-V. Mac = Command-V and so on. + +The babblepaste library looks for the current status in a babble_mode global variable. +To switch modes, run the switch_babble_mode() function, or a pre defined macro. +Currently supported are Windows, OS X, Gnome/kde, Emacs, VI and readline, +across 42+ common macro actions. + + +###To use the library +1) Paste the following into your config.h. + +//////Begin////// +#define USE_BABLPASTE 1 + +#ifdef USE_BABLPASTE +/* define BabblePaste maps. Whatever = 0 will be the default. */ +// MAC_MODE 0 +// MS_MODE 1 +// LINUX_MODE 2 +// EMACS_MODE 3 +// VI_MODE 3 +// Readline and tmux +// READMUX_MODE 2 +// WORDSTAR_MODE 5 +#endif + +// Uncomment these to remove options an free up flash space + +// This removes everything but cursor movement +// BABL_MOVEMENTONLY +// and this just removes browser shortcuts +// BABL_NOBROWSER +///////End/////// + +2) Add the following to your keymap in the action_get_macro + +//////Begin////// +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif +///////End/////// + +3) add Babbelpaste actions to your keymap. See the full list in babblePaste.h, or the +list below +B_L1C // go left 1 char +B_R1C // go Right 1 char + B_L1W //GO_LEFT_1 WORD + B_R1W //BABL_GO_RIGHT_1 WORD + B_GSOL // BABL_GOTO_START of _LINE + B_GEOL // BABL_GOTO_END_LINE + B_GTOP //BABL_GOTO_START_DOC + B_GEND //BABL_GO_END_DOC + B_DOWN //BABL_GO_NEXT_LINE + B_UP // BABL_GO_PREV_LINE + B_PGDN //PGDN + B_PGUP //PGUP +// B_BKSP //backspace so why bother. + B_DEL // DEL_RIGHT_1 Char // usually = Del + B_DLW // DEL_LEFT_ 1 WORD) + B_DRW //DEL_RIGHT_1 WORD + B_DEOL // delete from cursor to end of line + B_DSOL // delete from cursor to begining line + B_UNDO //UNDO + B_REDO // REDO + B_CUT // CUT) + B_COPY // COPY) + B_PAST // PASTE) + B_SELA // SELECT_ALL + B_FIND // FIND) + B_FINDN //FIND_NEXT) + B_FINDR // FIND_REPLACE) + B_RAPP // open application launcher + B_NAPP // switch to next app + B_PAPP // switch to previous app + B_CAPP // CLOSE_APP) + B_HELP // HELP) + B_NTAB // BROWSER_NEW_TAB) + B_CTAB //BROWSER_CLOSE_TAB) + B_ROTB //BROWSER_REOPEN_LAST_TAB) + B_NXTB //BROWSER_NEXT_TAB) + B_PTAB //BROWSER_PREV_TAB) + B_NURL //BROWSER_jump to URL_BAR) + B_BFWD // BROWSER_FORWARD (in history) + B_BBAK //BROWSER_BACK (in history) + B_BFND // BROWSER_FIND) + B_BOOK //BROWSER_New BOOKMARK) + B_BDEV //BROWSER_ Open DEV_TOOLS) // hard one to remember + B_BRLD // BROWSER_RELOAD Page + B_BFUlL // BROWSER_FULLSCREEN) + B_ZMIN // BROWSER_ZOOM_IN) + B_ZMOT //BROWSER_ZOOM_OUT) + + +#### Development notes +-Why a new function? Because it would make the keymap too ugly to put it there. +-Why not return the macro to action_get_macro? Because I kept running into scope problems +and pointers to the wrong type. +-Why not an array of arrays as a lookup instead of a function? That would allow you +to store the lookup table in PROGMEM. True, but that takes more pre-processor skill +than I had. + +-Have you tested this on every platform? No. Submit a patch. + + +### Next steps for someone. +Make it easier to pair macros with modifiers. So key foo will jump to start of line, and +Shift(foo) will jump to the first tab in a browser. + +## Thanks + +Thanks to https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts +and https://github.com/qmk/qmk_firmware/blob/master/keyboards/planck/keymaps/jeebak/keymap.c +And of course QMK... + diff --git a/keyboards/handwired/ms_sculpt_mobile/config.h b/keyboards/handwired/ms_sculpt_mobile/config.h new file mode 100644 index 0000000000..c3bdf333e2 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/config.h @@ -0,0 +1,98 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Microsoftplus +#define DESCRIPTION 6000 + +/* key matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 18 + +#ifdef ASTAR +#define PRODUCT sculpt mobile astar + /*0 1 2 3 4 5 6 7 8 */ +#define MATRIX_ROW_PINS {D7, C6, D4, D0, D1, D3, D2, E2} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS {B4, B5, E6, B7, B6, D6, C7, F7, F6, F4,F5, F1,F0, D5, B0, B1, B2, B3} + +#else +#define PRODUCT sculpt mobile teensypp +/* 0 1 2 3 4 5 6 7 */ +#define MATRIX_ROW_PINS { F7,F6,F4,F5,F3,F2,F1,F0} +/* A B C D E F G H I J K L M N O P Q R */ +#define MATRIX_COL_PINS { B7, D0, D1, D2, D3, D4, D5, D6, D7, E0,E1,C1, C0, C3, C2, C5, C4,C7} +#define UNUSED_PINS { B6,B5,B4,B3,B2,B1,B0 } + + +#endif + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION ROW2COL + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +/* + * 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 + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/info.json b/keyboards/handwired/ms_sculpt_mobile/info.json new file mode 100644 index 0000000000..86d5fde2e3 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/info.json @@ -0,0 +1,96 @@ +{ + "keyboard_name": "MS Sculpt Mobile", + "url": "", + "maintainer": "qmk", + "width": 16, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PrtSc", "x":13, "y":0}, + {"label":"Home", "x":14, "y":0}, + {"label":"End", "x":15, "y":0}, + {"label":"`", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"-", "x":11, "y":1}, + {"label":"=", "x":12, "y":1}, + {"label":"Backspace", "x":13, "y":1, "w":2}, + {"label":"Del", "x":15, "y":1, "h":1.6}, + {"label":"Tab", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"[", "x":11.5, "y":2}, + {"label":"]", "x":12.5, "y":2}, + {"label":"\\", "x":13.5, "y":2, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":";", "x":10.75, "y":3}, + {"label":"'", "x":11.75, "y":3}, + {"label":"Enter", "x":12.75, "y":3, "w":2.25}, + {"label":"PgUp", "x":15, "y":2.6, "h":1.2}, + {"label":"LShift", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":",", "x":9.25, "y":4}, + {"label":".", "x":10.25, "y":4}, + {"label":"/", "x":11.25, "y":4}, + {"label":"RShift", "x":12.25, "y":4, "w":1.75}, + {"label":"Up", "x":14, "y":4}, + {"label":"PgDn", "x":15, "y":3.8, "h":1.2}, + {"label":"LCtrl", "x":0, "y":5, "w":1.25}, + {"label":"LWin", "x":1.25, "y":5, "w":1.25}, + {"label":"LAlt", "x":2.5, "y":5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5, "w":5.5}, + {"label":"RAlt", "x":9.25, "y":5, "w":1.25}, + {"label":"Fn", "x":10.5, "y":5, "w":1.25}, + {"label":"RCtrl", "x":11.75, "y":5, "w":1.25}, + {"label":"Left", "x":13, "y":5}, + {"label":"Down", "x":14, "y":5}, + {"label":"Right", "x":15, "y":5} + ] + } + } +} diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h new file mode 100644 index 0000000000..271f48d001 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/config.h @@ -0,0 +1,3 @@ +#pragma once + +// place overrides here diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c new file mode 100644 index 0000000000..d4d0f33e9c --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/keymap.c @@ -0,0 +1,44 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|Mute| +* -------------------------------------------------------------------------------' +* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del | +* -------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* | caps | a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space |Ralt | FN | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + + [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_VOLD, KC_VOLU, KC_MUTE, \ + 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_DEL, \ + 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_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_PGUP, \ + KC_LSFT, 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_PGDN, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, RSFT(KC_1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md new file mode 100644 index 0000000000..91575f7cd5 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for Microsoft Sculpt Mobile diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk new file mode 100644 index 0000000000..3955a3ff42 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/default/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h new file mode 100644 index 0000000000..9d6be063e2 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/config.h @@ -0,0 +1,28 @@ +#pragma once + +#define USE_BABLPASTE + +// Expect to get errors if you comment a feature out and leave it in your keymap. + +#ifdef USE_BABLPASTE +//define BabblePaste maps +// Windows. +#define MAC_MODE 0 +#define MS_MODE 1 +//aka gnome+KDE +//#define LINUX_MODE 2 +//#define EMACS_MODE 3 +#define VI_MODE 3 +// Readline and tmux +#define READMUX_MODE 2 +//#define WORDSTAR_MODE 5 +#endif + +// Uncomment if you need more free flash space + +// This removes everything but cursor movement +//#define BABL_MOVEMENTONLY +// and this just removes browser shortcuts +//#define BABL_NOBROWSER + +// place overrides here diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c new file mode 100644 index 0000000000..c5ed18797f --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/keymap.c @@ -0,0 +1,266 @@ +#include "babblePaste.h" +#include QMK_KEYBOARD_H + +#define _QWR 0 +#define _CDH 2 +#define _SYM 3 +#define _MOV 4 +#define _TRAN 5 + + +enum layer_keycodes { +QWR, +CDH, +SYM, +MOV, +NUM, +TRAN +}; + + +// Shorter spacing +#define XXXX KC_NO +#define ____ KC_TRNS + +// Custom macros + +/* Fn Keys */ +#define TT_SYM MO(_SYM) +#define TT_MOV KC_FN2 +#define TT_NUM MO(_NUM) +#define SSFT ACTION_MODS_ONESHOT(MOD_LSFT) + +enum macro_keycodes { +DHPASTE=1, +VIBRK, +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +/* QWERTY +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | q | w | e | r | t | y | u | i | o | p | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| a | s | d | f | g | h | j | k | l | ; | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | z | x | c | v | b | n | m | , | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_QWR] = 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_VOLD, KC_VOLU, CDH,\ + KC_ESC, KC_1, KC_2, KC_3 ,KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS, KC_EQL, KC_BSPC, KC_DEL,\ + 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,\ + TT_MOV, 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_PGUP,\ + KC_LSFT, 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_PGDN,\ + KC_LCTL, KC_LGUI, KC_LALT, KC_FN1, KC_RGUI,TT_SYM,KC_RCTL, KC_LEFT, KC_DOWN, KC_RIGHT +), + +[_CDH] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, QWR, \ + KC_ESC, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, ____, ____, ____,\ + TT_MOV, KC_A, KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, KC_2,\ + KC_LSFT, KC_Z, KC_X, KC_C, M(DHPASTE), KC_V, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, ____, KC_1,\ + ____, ____, ____ , KC_FN1, ____, ____, ____, ____, ____, ____ + +), + + +/* SYM +* +* |ESC | F1 | F2 | F3 | F4 | F5 | F6 | f7 | F8 | F9 | F10| F11| F12|Vol-|Vol+|_CDH| +* -------------------------------------------------------------------------------' +* | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace|Del | +* -------------------------------------------------------------------------- +* | ESC: | ^ | { | } | @ | % | | [ | ( | ) | _ | [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| ! | # | 0 | = | { | } | - | 1 | + | ] | ` | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft | ; | ~ | : | ~ | "|"| $ | * | | . | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_SYM] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + M(VIBRK), KC_CIRC, KC_LCBR, KC_RCBR,KC_AT, KC_PERC, ____, KC_LBRC,KC_LPRN,KC_RPRN,KC_UNDS, ____, ____, ____,\ + ____, KC_EXLM, KC_HASH, KC_0, KC_EQL, KC_LCBR, KC_RCBR,KC_MINS,KC_1, KC_PLUS,KC_RBRC, KC_GRV, ____, ____,\ + ____, KC_SCLN, KC_TILDE, KC_COLN, KC_TILDE, KC_PIPE, KC_DLR, KC_ASTR, ____, KC_DOT , KC_SLSH, ____, ____, ____,\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), +/* +* |ESC | MAC| Win|RdLn| VI | | | | | | | | | | | | +* -------------------------------------------------------------------------------' +* | | | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = |Bakspace| Del| +* --------------------------------------------------------------------------- +* | tab | | |Find| |pTab |DSOL|DelW| Up |DelW|DEOL| [ | ] | \ | | +* -------------------------------------------------------------------------------' +* |Bak/Mov| | | | |nTab |GSOL| <- | Dwn | -> | EOL | ' | enter |PgUp| +* -------------------------------------------------------------------------------- +* |Lsft |Undo| Cut|Copy|Pste| | | | | | / | Rsft| Up| PgDn| +* --------------------------------------------------------------------------------- +* |Lctl |Lgui |Lalt | Space/Sym | GUI | Sym | Rctl |Left|Down|Rght| +* --------------------------------------------------------------------------------- +*/ + +[_MOV] = LAYOUT(\ + ____, B_MAC,B_WIN,B_READ, B_VI, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, B_PAPP, B_NAPP, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, B_UNDO, ____, B_BFND, ____, B_PTAB, B_DSOL, B_DLW, B_UP, B_DRW, B_DEOL, ____, ____, ____, \ + ____, B_SELA, B_BRLD, ____, ____, B_NXTB, B_GSOL, B_L1C, B_DOWN, B_R1C,B_GEOL, ____, ____, ____,\ + ____, B_UNDO,B_CUT, B_COPY, B_PAST, B_PAST, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +), + +[_TRAN] = LAYOUT(\ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____ +) +}; + +const uint16_t PROGMEM fn_actions[] = { +[1] = ACTION_LAYER_TAP_KEY(_SYM,KC_SPACE), +[2] = ACTION_LAYER_TAP_KEY(_MOV,KC_BSPC) +}; + +#ifdef AUDIO_ENABLE + +float tone_startup[][2] = SONG(STARTUP_SOUND); +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +#endif + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWR: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + layer_off(_CDH); + } + return false; + break; + + case CDH: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + layer_on(_CDH); + } + return false; + break; + + case SYM: + if (record->event.pressed) { + layer_on(_SYM); + } else { + layer_off(_SYM); + } + return false; + break; + + } + return true; + +} + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + +/* If id is in the range of BABL macros, call the babl function */ +/* Any clever remapping with modifiers should happen here e.g. shift bablkey does opposite*/ +#ifdef USE_BABLPASTE + + if( id >= BABL_START_NUM && id < (BABL_START_NUM + BABL_NUM_MACROS ) ) { + if (record->event.pressed) { // is there a case where this isn't desired? + + babblePaste ( record, id ); + return MACRO_NONE; + } + } +#endif + + + // MACRODOWN only works in this function + switch(id) { + case 0: + if (record->event.pressed) { + register_code(KC_RSFT); + } else { + unregister_code(KC_RSFT); + } + break; + + /* Colemak mod-dh moves the D key to the qwerty V position + This hack makes apple-V_position do what I mean */ + case DHPASTE: + if(keyboard_report->mods & MOD_BIT(KC_LGUI) ) { + if (record->event.pressed) { + clear_keyboard_but_mods(); + register_code(KC_V); + } else { + unregister_code(KC_V); + } + } else { + if (record->event.pressed) { + register_code(KC_D); + } else { + unregister_code(KC_D); + } + } + break; + + case VIBRK: // vi esc: + if (record->event.pressed) { + return MACRO( T(ESC),D(LSFT),T(SCLN),U(LSFT), END ); + } + break; + + + + + default: + return MACRO_NONE; + } + + +return MACRO_NONE; +}; + + + + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { + +} + + +void led_set_user(uint8_t usb_led) { + +} + + + + + + diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md new file mode 100644 index 0000000000..3cb1380d1c --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/readme.md @@ -0,0 +1 @@ +# A more programmer oriented keymap for Microsoft Sculpt Mobile diff --git a/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk new file mode 100644 index 0000000000..ddfea82556 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/keymaps/milestogo/rules.mk @@ -0,0 +1,17 @@ +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # 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 controls +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. +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend diff --git a/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c new file mode 100644 index 0000000000..53773e5d85 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.c @@ -0,0 +1 @@ +#include "ms_sculpt_mobile.h" diff --git a/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h new file mode 100644 index 0000000000..cfa07c92ef --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/ms_sculpt_mobile.h @@ -0,0 +1,48 @@ +#ifndef MICROSOFT_SCULPT_MOBILE_H +#define MICROSOFT_SCULPT_MOBILE_H + +#include "quantum.h" + + +#define LAYOUT( \ + k7Q, k6O, k6P, k6Q, k5O, k5P, k5Q, k7A, k7B, k7C, k7D, k7E, k7F, k1O, k1K, k1L, \ + k5A, k5K, k5L, k5M, k5N, k5H, k5I, k2A, k2B, k2C, k2D, k5B, k5C, k5J, k2E, \ + k6R, k6D, k6E, k6F, k7I, k7J, k4A, k4B, k4C, k4D, k3A, k3B, k3C, k3D, \ + k0J, k6A, k6B, k6C, k7H, k1A, k1B, k5D, k5E, k5F, k5G, k1C, k7P, k2G, \ + k2P, k7K, k7L, k7M, k7O, k0A, k0B, k0C, k0D, k0E, k0F, k2L, k6G, k1P,\ + k1Q, k4N, k3O,k6N, k3K, k0R, k1M, k6H, k6I, k6J \ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, KC_NO, KC_NO, KC_NO, k0J, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,KC_NO, KC_NO, k0R},\ + {k1A, k1B, k1C, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k1K, k1L, k1M, KC_NO, k1O, k1P, k1Q, KC_NO},\ + {k2A, k2B, k2C, k2D, k2E, KC_NO, k2G, KC_NO, KC_NO, KC_NO, KC_NO, k2L, KC_NO, KC_NO, KC_NO, k2P, KC_NO, KC_NO},\ + {k3A, k3B, k3C, k3D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k3K, KC_NO, KC_NO, KC_NO, k3O, KC_NO, KC_NO, KC_NO},\ + {k4A, k4B, k4C, k4D, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, k4N, KC_NO,KC_NO, KC_NO, KC_NO},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q, KC_NO },\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6J, KC_NO, KC_NO, KC_NO, k6N, k6O, k6P, k6Q, k6R},\ + {k7A, k7B, k7C, k7D, k7E, k7F, KC_NO, k7H, k7I, k7J, k7K, k7L, k7M, KC_NO, k7O, k7P, k7Q, KC_NO},\ +} + + +#define MATRIX_TESTING_LAYOUT( \ + k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q,\ + k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q,\ + k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q,\ + k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q,\ + k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q,\ + k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q,\ + k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q,\ + k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q\ +) \ +{ \ + {k0A, k0B, k0C, k0D, k0E, k0F, k0G, k0H, k0I, k0, k0J, k0K, k0L, k0M, k0N, k0O, k0P, k0Q},\ + {k1A, k1B, k1C, k1D, k1E, k1F, k1G, k1H, k1I, k1, k1J, k1K, k1L, k1M, k1N, k1O, k1P, k1Q},\ + {k2A, k2B, k2C, k2D, k2E, k2F, k2G, k2H, k2I, k2, k2J, k2K, k2L, k2M, k2N, k2O, k2P, k2Q},\ + {k3A, k3B, k3C, k3D, k3E, k3F, k3G, k3H, k3I, k3, k3J, k3K, k3L, k3M, k3N, k3O, k3P, k3Q},\ + {k4A, k4B, k4C, k4D, k4E, k4F, k4G, k4H, k4I, k4, k4J, k4K, k4L, k4M, k4N, k4O, k4P, k4Q},\ + {k5A, k5B, k5C, k5D, k5E, k5F, k5G, k5H, k5I, k5, k5J, k5K, k5L, k5M, k5N, k5O, k5P, k5Q},\ + {k6A, k6B, k6C, k6D, k6E, k6F, k6G, k6H, k6I, k6, k6J, k6K, k6L, k6M, k6N, k6O, k6P, k6Q},\ + {k7A, k7B, k7C, k7D, k7E, k7F, k7G, k7H, k7I, k7, k7J, k7K, k7L, k7M, k7N, k7O, k7P, k7Q},\ +} + +#endif diff --git a/keyboards/handwired/ms_sculpt_mobile/readme.md b/keyboards/handwired/ms_sculpt_mobile/readme.md new file mode 100644 index 0000000000..98fd1f8d1a --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/readme.md @@ -0,0 +1,55 @@ +# Microsoft Sculpt Mobile + +This is a way to take a Microsoft ergonomic bluetooth keyboard, and make it +into a hard-wired keyboard running QMK. + +The keyboard is known under several different names: +Mobile Bluetooth 5000, Mobile 6000, Sculpt mobile, and Asus rebranded. + +I had a stack of them, since they're cheap on ebay, travel well, and are just ergo enough. + +The ribbon cable is 1mm pitch, which is hard to hand solder. I bought a cheap set of +"pitch adapter" boards https://www.amazon.com/Double-Sided-0-4mm-1-0-Adapter-60mmx38mm/dp/B00OK42118 + +Cut the original ribbon cable sockets off the bluetooth board using a razor, they're hard to desolder. +They're also allow the cable to be inserted on top or bottom. + +If I was going to do it again, I'd make the MCU connection come out the top of the keyboard +and avoid the wires dangling out the bottom. + +As I was debugging the matrix, I started to get random failures. In desparation I tried a second MCU, +but had the same problems. It turns out that the ribbon cable connections can get worn. Shave a +half millimeter off the end of the ribbon cable & the errors go away. + +My method for discovering the matrix was to set up a LAYOUT macro that included all pins. +See MATRIX_TESTING_LAYOUT if you need it. Then set up a keymap that has all printable symbols +in the first 4 rows. test each key & record output. Then switch the printable symbols to the +bottom 4 rows & repeat. This was enough to show the matrix. + + +The full original keymap for the Sculpt is + +| | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | +|:-:|:--:|:--:|:--:|:---:|:---:|:---:|:----:|:----:|:----:|:-----:|:----:|:------:|:----:|:-----:|:----:|:------:|:----:|:---:| +| 0 | b | n | m | , | . | / | | | | Caps | | | | | | | | Fn | +| 1 | g | h | " | | | | | | | | Vol+ | Mute | RCtl | | Vol- | PgDn | LCtl | | +| 2 | 7 | 8 | 9 | 0 | Del | | PgUp | | | | | RShift | | | | LShift | | | +| 3 | p | [ | ] | \ | | | | | | | RAlt | | | | LAlt | | | | +| 4 | y | u | i | o | | | | | | | | | | LGUI | | | | | +| 5 | ~ | - | += | j | k | l | ; | 5 | 6 | Bksp | 1 | 2 | 3 | 4 | F4 | F5 | F6 | | +| 6 | a | s | d | q | w | e | Up | Left | Down | Right | | | | Space | F1 | F2 | F3 | Tab | +| 7 | F7 | F8 | F9 | F10 | F11 | F12 | | f | r | t | z | x | c | | v | Enter | Esc | | + +This works with 18 cols + 8 rows on a Teensy++, or ARM-based Teensy. + +The Astar mini has all pins exposed , so you can do 18x8 +If you want a speaker, LEDs, etc., you'll need to free up a pin. I recommend joining columns +R and L to the same pin. + +Building - add ASTAR=1 to the compile line or leave out for teensy2++ + +Make example for this keyboard (after setting up your build environment): + + make handwired/ms_sculpt_mobile: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/handwired/ms_sculpt_mobile/rules.mk b/keyboards/handwired/ms_sculpt_mobile/rules.mk new file mode 100644 index 0000000000..680c057d36 --- /dev/null +++ b/keyboards/handwired/ms_sculpt_mobile/rules.mk @@ -0,0 +1,56 @@ + +## Project specific files +SRC= babblePaste.c + + +ifdef ASTAR + CFLAGS=-D ASTAR + MCU = atmega32u4 + SCULPT_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done ; \ + avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) + +else + MCU = at90usb1286 + SCULPT_UPLOAD_COMMAND = teensy_loader_cli -w -mmcu=$(MCU) $(TARGET).hex +endif + +F_CPU = 16000000 +ARCH = AVR8 +F_USB = $(F_CPU) + +# 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. +ifdef ASTAR + BOOTLOADER = caterina +else + BOOTLOADER = atmel-dfu +endif + +# Interrupt driven control endpoint task(+60) +OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + + +USB = /dev/cu.usbmodem14141 + + + +# upload: build +# $(SCULPT_UPLOAD_COMMAND) -- cgit v1.2.3 From 6d78d45ca1ebf6ab78dc66274ce1f04e45a7c01a Mon Sep 17 00:00:00 2001 From: ajp10304 Date: Sat, 8 Dec 2018 00:49:33 +0000 Subject: AJP10304 Planck layout, add LAYOUT_planck_grid (#4575) --- keyboards/planck/keymaps/ajp10304/keymap.c | 159 ++++++++++++++-------------- keyboards/planck/keymaps/ajp10304/readme.md | 4 + 2 files changed, 81 insertions(+), 82 deletions(-) diff --git a/keyboards/planck/keymaps/ajp10304/keymap.c b/keyboards/planck/keymaps/ajp10304/keymap.c index ebc4e0b97a..49346f7b95 100644 --- a/keyboards/planck/keymaps/ajp10304/keymap.c +++ b/keyboards/planck/keymaps/ajp10304/keymap.c @@ -1,4 +1,3 @@ -#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #include "eeconfig.h" @@ -38,10 +37,6 @@ enum planck_keycodes { #include "dynamic_macro.h" -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Qwerty @@ -55,12 +50,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Raise | Shift| MENU | Ctrl | Fn2 | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = { - {KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC }, - {MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT) }, - {KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT }, - {MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) } -}, +[_QWERTY] = LAYOUT_planck_grid( + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MT(MOD_LSFT, KC_TAB), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, MT(MOD_RSFT, KC_ENT), + KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSHIFT, + MO(_FUNC), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_BSPC, KC_SPC, RAISE, KC_LSHIFT, KC_BTN2, KC_RCTL, MO(_FUNC2) +), /* Function * ,-----------------------------------------------------------------------------------. @@ -73,12 +68,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Fn | Ctrl | Alt | GUI |Lower | Bksp |Space |Mouse | MENU | Alt | Ctrl | Fn | * `-----------------------------------------------------------------------------------' */ -[_FUNC] = { - {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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT }, - {KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) }, - {_______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ } -}, +[_FUNC] = LAYOUT_planck_grid( + 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_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, UK_TILD, KC_INSERT, + KC_LSHIFT, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_PAST, KC_MINS, KC_EQL, KC_BSLASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, _______, _______, MO(_MOUSE), _______, _______, _______, _______ +), /* Lower * ,-----------------------------------------------------------------------------------. @@ -91,12 +86,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | |Lower | Del |Space | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = { - {KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC }, - {LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC) }, - {KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT) }, - {_______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY } -}, +[_LOWER] = LAYOUT_planck_grid( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, KC_BSPC, + LSFT(KC_1), LSFT(KC_2), LSFT(KC_3), LSFT(KC_4), LSFT(KC_5), LSFT(KC_6), LSFT(KC_7), LSFT(KC_8), LSFT(KC_9), LSFT(KC_0), LCTL(KC_DEL), LCTL(KC_BSPC), + KC_LSPO, KC_NONUS_BSLASH, KC_GRAVE, KC_NONUS_HASH, KC_QUOT, KC_MINS, KC_EQL, KC_NONUS_HASH, KC_LBRC, KC_RBRC, KC_QUOT, MT(MOD_RSFT, KC_ENT), + _______, _______, _______, _______, _______, KC_DEL, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), /* Raise * ,-----------------------------------------------------------------------------------. @@ -109,12 +104,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Mouse| | | | | Alt | Enter|Raise | | | | | * `-----------------------------------------------------------------------------------' */ -[_RAISE] = { - {KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN }, - {KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)) }, - {_______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS) }, - {MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ } -}, +[_RAISE] = LAYOUT_planck_grid( + KC_GRV, XXXXXXX, M(1), KC_LBRC, KC_RBRC, XXXXXXX, XXXXXXX, KC_PGUP, KC_HOME, KC_PGDOWN, XXXXXXX, KC_PSCREEN, + KC_GRV, XXXXXXX, XXXXXXX, LSFT(KC_9), LSFT(KC_0), XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_END, XXXXXXX, LCTL(LSFT(KC_EQL)), + _______, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), LSFT(KC_RBRC), XXXXXXX, LCTL(KC_LEFT), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_RIGHT), LCTL(KC_MINS), + MO(_MOUSE), _______, _______, _______, _______, KC_LALT, KC_ENT, _______, XXXXXXX, _______, _______, _______ +), /* Adjust (Lower + Raise) * ,-----------------------------------------------------------------------------------. @@ -127,12 +122,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = { - {M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL }, - {KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______ }, - {TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, +[_ADJUST] = LAYOUT_planck_grid( + M(0), RESET, QWERTY, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, _______, _______, _______, KC_DEL, + KC_CAPS, _______, _______, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, KC_AUDIO_MUTE, KC_AUDIO_VOL_UP, KC_MEDIA_PLAY_PAUSE, _______, _______, + TG(_MAC), _______, _______, _______, _______, DYN_REC_STOP, DYN_REC_STOP, KC_MEDIA_PREV_TRACK, KC_AUDIO_VOL_DOWN, KC_MEDIA_NEXT_TRACK, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* Mouse * ,-----------------------------------------------------------------------------------. @@ -145,12 +140,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_MOUSE] = { - {KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______ }, - {KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, +[_MOUSE] = LAYOUT_planck_grid( + KC_ESC , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, _______, _______, + KC_MS_ACCEL0, KC_MS_ACCEL1, KC_MS_ACCEL2, _______, _______, _______, _______, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), /* Function 2 (Right hand side) * ,-----------------------------------------------------------------------------------. @@ -163,47 +158,47 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_FUNC2] = { - {_______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______}, - {_______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______}, - {_______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -[_MAC] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 } -}, - -[_MLWR] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} -}, - -[_MRSE] = { - {_______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL) }, - {_______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, - -[_MFNC]= { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ } -}, - -[_MFNC2] = { - {_______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______}, - {_______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______}, - {_______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) }, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, -}, +[_FUNC2] = LAYOUT_planck_grid( + _______, _______, M(1), _______, _______, _______, M(5), _______, _______, _______, _______, _______, + _______, _______, M(3), M(7), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LCTL(KC_Z), LCTL(KC_X), LCTL(KC_C), LCTL(KC_V), _______, _______, _______, _______, _______, _______, M(98) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MAC] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + MFNC, _______, _______, _______, MLWR, _______, _______, MRSE, _______, _______, _______, MFNC2 +), + +[_MLWR] = LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MRSE] = LAYOUT_planck_grid( + _______, _______, M(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, LCTL(KC_A), _______, LCTL(KC_E), _______, LGUI(KC_EQL), + _______, _______, _______, _______, _______, _______, LALT(KC_LEFT), _______, _______, _______, LALT(KC_RIGHT), LGUI(KC_MINS), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC]= LAYOUT_planck_grid( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, LGUI(KC_PENT), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MFNC2] = LAYOUT_planck_grid( + _______, _______, M(2), _______, _______, _______, M(6), _______, _______, _______, _______, _______, + _______, _______, M(4), M(8), _______, _______, _______, M(10), _______, _______, _______, _______, + _______, LGUI(KC_Z), LGUI(KC_X), LGUI(KC_C), LGUI(KC_V), _______, _______, _______, _______, _______, _______, M(99) , + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) }; diff --git a/keyboards/planck/keymaps/ajp10304/readme.md b/keyboards/planck/keymaps/ajp10304/readme.md index 978f5a19e1..6573266db1 100644 --- a/keyboards/planck/keymaps/ajp10304/readme.md +++ b/keyboards/planck/keymaps/ajp10304/readme.md @@ -6,6 +6,10 @@ the second is the output when shift is applied. **Note:** The below tables assume a UK layout. +####Flashing +Rev <=5: sudo make planck:ajp10304:dfu +Rev 6: sudo make planck/rev6:ajp10304:dfu-util + ##### Main Qwerty Layer * Tab: when held, operates as shift. -- cgit v1.2.3 From 3e698a54ea22b12512c9e4f676f7d7363c35832f Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Fri, 7 Dec 2018 18:50:43 -0600 Subject: Removed mousekeys. Added Levinson Steno keymap. (#4574) * Changed location of mouse 3, and arrow keys * Removed MouseKeys. Added Levinson Layout --- keyboards/iris/keymaps/vyolle/keymap.c | 18 ++-- keyboards/levinson/keymaps/steno/config.h | 34 +++++++ keyboards/levinson/keymaps/steno/keymap.c | 148 ++++++++++++++++++++++++++++++ keyboards/levinson/keymaps/steno/rules.mk | 7 ++ 4 files changed, 198 insertions(+), 9 deletions(-) create mode 100644 keyboards/levinson/keymaps/steno/config.h create mode 100644 keyboards/levinson/keymaps/steno/keymap.c create mode 100644 keyboards/levinson/keymaps/steno/rules.mk diff --git a/keyboards/iris/keymaps/vyolle/keymap.c b/keyboards/iris/keymaps/vyolle/keymap.c index 2479f08928..33e1718211 100644 --- a/keyboards/iris/keymaps/vyolle/keymap.c +++ b/keyboards/iris/keymaps/vyolle/keymap.c @@ -32,29 +32,29 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT( //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_ACL0, KC_ACL1, KC_ACL2, XXXXXXX, XXXXXXX, + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_7, KC_8, KC_9, KC_PLUS, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSLS, KC_4, KC_5, KC_6, KC_MINUS, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_VOLU, KC_HOME, KC_LEFT, KC_UP, KC_RGHT, KC_PGUP, KC_WH_U, KC_MS_L, KC_MS_U, KC_MS_R, XXXXXXX, KC_BTN4, + KC_VOLU, KC_HOME, KC_LEFT, KC_UP, KC_RGHT, KC_PGUP, KC_PAST, KC_1, KC_2, KC_3, KC_EQL, _______, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, XXXXXXX, KC_WH_D, KC_WH_L, KC_MS_D, KC_WH_R, KC_BTN3, KC_BTN5, + KC_VOLD, KC_END, KC_INS, KC_DOWN, KC_DEL, KC_PGDN, KC_MUTE, _______, _______, KC_0, KC_COMM, KC_DOT, KC_ENT, _______, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - _______, _______, _______, KC_BTN1, KC_BTN2, _______ + _______, _______, _______, _______, _______, _______ // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), [_RAISE] = LAYOUT( //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRAVE,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TILD, KC_PIPE, KC_LT, KC_GT, _______, _______, _______, _______, _______, _______, _______, _______, + KC_GRAVE, KC_TILD, KC_UNDS, KC_EQL, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, _______, KC_LEFT, KC_UP, KC_RGHT, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_COLN, KC_UNDS, KC_LPRN, KC_PLUS, KC_RPRN, KC_EQL, KC_UNDO, _______, _______, _______, KC_DOWN, _______, _______, _______, + KC_COLN, KC_LT, KC_GT, KC_PLUS, KC_LPRN, KC_RPRN, _______, _______, _______, _______, KC_DOWN, _______, _______, _______, //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - KC_CUT, KC_COPY, KC_PSTE, _______, _______, _______ + _______, _______, _______, _______, _______, _______ // └────────┴────────┴────────┘ └────────┴────────┴────────┘ ), diff --git a/keyboards/levinson/keymaps/steno/config.h b/keyboards/levinson/keymaps/steno/config.h new file mode 100644 index 0000000000..9cbc148e42 --- /dev/null +++ b/keyboards/levinson/keymaps/steno/config.h @@ -0,0 +1,34 @@ +/* +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 + +/* Use I2C or Serial, not both */ + +#define USE_I2C +// #define USE_SERIAL + + +#define FORCE_NKRO //For Steno. + +/* Select hand configuration */ + +#define MASTER_LEFT +// #define MASTER_RIGHT +// #define EE_HANDS + + diff --git a/keyboards/levinson/keymaps/steno/keymap.c b/keyboards/levinson/keymaps/steno/keymap.c new file mode 100644 index 0000000000..f997b4de11 --- /dev/null +++ b/keyboards/levinson/keymaps/steno/keymap.c @@ -0,0 +1,148 @@ +#include QMK_KEYBOARD_H +#include "keymap_steno.h" + +extern keymap_config_t keymap_config; + +#define _PLOVER 0 +#define _QWERTY 1 +#define _LOWER 2 +#define _RAISE 3 +#define _ADJUST 4 + +enum custom_keycodes +{ + PLOVER = SAFE_RANGE, + QWERTY, + LOWER, + RAISE, + ADJUST, + EXT_QWE, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = +{ + + [_PLOVER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + STN_PWR, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_FN, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + XXXXXXX, STN_RE1, STN_RE2, XXXXXXX, STN_A, STN_O, STN_E, STN_U, XXXXXXX, XXXXXXX, QWERTY, XXXXXXX + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_QWERTY] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_QUOT, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + KC_LGUI, KC_Z, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL, KC_RALT, EXT_QWE, KC_RGUI + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_LOWER] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_7, KC_8, KC_9, KC_PLUS, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_F7, KC_F8, KC_LEFT, KC_UP, KC_RGHT, KC_F9, KC_PSLS, KC_4, KC_5, KC_6, KC_MINUS, KC_MUTE, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, KC_F10, KC_F11, KC_DOWN, KC_F11, KC_F12, KC_PAST, KC_1, KC_2, KC_3, KC_EQL, KC_VOLU, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, KC_0, _______, KC_COMM, KC_DOT, KC_ENT, KC_VOLD + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_RAISE] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRAVE, KC_TILD, KC_UNDS, KC_EQL, KC_PIPE, _______, KC_HOME, KC_DEL, _______, KC_INS, KC_PGUP, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_BSLASH,KC_LCBR, KC_RCBR, KC_MINUS, KC_LBRC, KC_RBRC, KC_END, KC_LEFT, KC_UP, KC_RGHT, KC_PGDN, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_COLN, KC_LT, KC_GT, KC_PLUS, KC_LPRN, KC_RPRN, _______, _______, KC_DOWN, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + [_ADJUST] = LAYOUT( + //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ + KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______, + //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ + + ), + + +}; + + +void matrix_init_user() { + steno_set_mode(STENO_MODE_GEMINI); // or STENO_MODE_BOLT +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case PLOVER: + if (record->event.pressed) { + set_single_persistent_default_layer(_PLOVER); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + case QWERTY: + if (!record->event.pressed) { + layer_on(_QWERTY); + } + return false; + break; + case EXT_QWE: + if (record->event.pressed) { + layer_off(_QWERTY); + } + return false; + break; + } + return true; +} diff --git a/keyboards/levinson/keymaps/steno/rules.mk b/keyboards/levinson/keymaps/steno/rules.mk new file mode 100644 index 0000000000..9c31e590ee --- /dev/null +++ b/keyboards/levinson/keymaps/steno/rules.mk @@ -0,0 +1,7 @@ +EXTRAKEY_ENABLE = no # Disable if you run out of usb endpoints. Media keys need this to work. +MOUSEKEY_ENABLE = no # Mouse keys(+4700) Uses extra usb enpoints. +STENO_ENABLE = yes # Additional protocols for Stenography(+1700), requires VIRTSER. +AUDIO_ENABLE = no # Audio output on port C6 +MIDI_ENABLE = no # MIDI controls +NKRO_ENABLE = yes +BOOTMAGIC_ENABLE = yes -- cgit v1.2.3 From 2ad2b73d685cf25268fa7d3726f45594edee70c4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 7 Dec 2018 16:51:27 -0800 Subject: Add support for PR and Issue templates to QMK_firmware GitHub (#4494) * Add support document * Add Bug Report * Add GitHub Pull Request Template * Feature request issue template * Touch up feature request template * Add 'other issues' template * move support doc * Minor tweaks * More minor tweaks * Spleeling fix Co-Authored-By: drashna * CapiTALization fIXes Co-Authored-By: drashna * Use new issue URL Co-Authored-By: drashna * Add blanck issue template * Update the PR template * Formatting and additional changes * Update docs/support.md Co-Authored-By: drashna --- .github/ISSUE_TEMPLATE/blank.md | 5 ++++ .github/ISSUE_TEMPLATE/bug_report.md | 31 ++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 19 ++++++++++++++ .github/ISSUE_TEMPLATE/other_issues.md | 9 +++++++ .github/PULL_REQUEST_TEMPLATE.md | 32 +++++++++++++++++++++++ docs/_sidebar.md | 1 + docs/_summary.md | 1 + docs/support.md | 43 +++++++++++++++++++++++++++++++ 8 files changed, 141 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/blank.md create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md create mode 100644 .github/ISSUE_TEMPLATE/other_issues.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 docs/support.md diff --git a/.github/ISSUE_TEMPLATE/blank.md b/.github/ISSUE_TEMPLATE/blank.md new file mode 100644 index 0000000000..50a32034d6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/blank.md @@ -0,0 +1,5 @@ +--- +name: Blank issue +about: If you're 100% sure that you don't need one of the other issue templates, use this one instead. + +--- diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..a4f90389b0 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,31 @@ +--- +name: Bug report +about: Create a report to help us improve the QMK Firmware +--- + + + + + +**Describe the bug** + + + +**System Information** + - Keyboard: + - Revision (if applicable): + - Operating System: + - avr-gcc version: + + - arm gcc version: + + - QMK Firmware version: + + - Any keyboard related software installed? + - [ ] Auto Hot Key + - [ ] Karabiner + - [ ] Other + +**Additional context** + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..c9198adff2 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,19 @@ +--- +name: Feature request +about: Suggest a new feature or changes to existing features +--- + + + + + +## Feature Request Type + +- [ ] Core Functionality +- [ ] Add-on hardware support (e.g. audio, RGB, OLED screen, etc.) +- [ ] Alteration (enhancement/optimization) of existing Feature(s) +- [ ] New behavior + +## Description + + diff --git a/.github/ISSUE_TEMPLATE/other_issues.md b/.github/ISSUE_TEMPLATE/other_issues.md new file mode 100644 index 0000000000..5f3e986cc4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/other_issues.md @@ -0,0 +1,9 @@ +--- +name: Other issues +about: Anything else that doesn't fall into the above categories. +--- + + + + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..05223aa4f6 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,32 @@ + + + + + +## Description + + +## Types of changes + +- [ ] Core +- [ ] Bugfix +- [ ] New Feature +- [ ] Enhancement/Optimization +- [ ] Keyboard (addition or update) +- [ ] Keymap/Layout/Userspace (addition or update) +- [ ] Documentation + + +## Issues Fixed or Closed by this PR + +* + +## Checklist: + + +- [ ] My code follows the code style of this project. +- [ ] My change requires a change to the documentation. +- [ ] I have updated the documentation accordingly. +- [ ] I have read the **CONTRIBUTING** document. (https://docs.qmk.fm/#/contributing) +- [ ] I have added tests to cover my changes. +- [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage). diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 6338d69121..b209c5e0b8 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -88,6 +88,7 @@ * Other Topics * [Using Eclipse with QMK](eclipse.md) + * [Support](support.md) * QMK Internals (In Progress) * [Defines](internals_defines.md) diff --git a/docs/_summary.md b/docs/_summary.md index 6338d69121..b209c5e0b8 100644 --- a/docs/_summary.md +++ b/docs/_summary.md @@ -88,6 +88,7 @@ * Other Topics * [Using Eclipse with QMK](eclipse.md) + * [Support](support.md) * QMK Internals (In Progress) * [Defines](internals_defines.md) diff --git a/docs/support.md b/docs/support.md new file mode 100644 index 0000000000..5c275b07e4 --- /dev/null +++ b/docs/support.md @@ -0,0 +1,43 @@ +# Support + +If you need help with something, the best place to get quick support is going to be on our [Discord Server](https://discord.gg/Uq7gcHh). There is usually somebody online, and there are a bunch of very helpful people there. + +Don't forget to read our [Code of Conduct](https://qmk.fm/coc/). + +## Help! I don't know where to start! + +If this is the case, then you should start with our [Newbs Guide](https://docs.qmk.fm/#/newbs). There is a lot of great info there, and that should cover everything you need to get started. + +If that's an issue, hop onto the [QMK Configurator](https://config.qmk.fm), as that will handle a majority of what you need there. + +## Help! I'm having issues flashing! + +First, head to the [Compiling/Flashing FAQ Page](https://docs.qmk.fm/#/faq_build). There is a good deal of info there, and you'll find a bunch of solutions to common issues there. + +## Help, I have an issue that isn't covered by the links above + +Okay, that's fine. Then please check the [open issues in our GitHub](https://github.com/qmk/qmk_firmware/issues) to see if somebody is experiencing the same thing (make sure it's not just similar, but actually the same). + +If you can't find anything, then please open a [new issue](https://github.com/qmk/qmk_firmware/issues/new)! + +## What if I found a bug? + +Then please open an [issue](https://github.com/qmk/qmk_firmware/issues/new), and if you know how to fix it, open up a Pull Request on GitHub with the fix. + +## But `git` and `GitHub` are intimidating! + +Don't worry, we have some pretty nice [Guidelines](https://docs.qmk.fm/#/newbs_best_practices) on how to start using `git` and GitHub to make things easier to develop. + +Additionally, you can find additional `git` and GitHub related links [here](https://docs.qmk.fm/#/newbs_learn_more_resources). + +## I have a Keyboard that I want to add support for + +Awesome! Open up a Pull Request for it. We'll review the code, and merge it! + +### What if I want to do brand it with `QMK`? + +That's amazing! We would love to assist you with that! + +In fact, we have a [whole page](https://qmk.fm/powered/) dedicated to adding QMK Branding to your page and keyboard. This covers pretty much everything you need (knowledge and images) to officially support QMK. + +If you have any questions about this, open an issue or head to [Discord](https://discord.gg/Uq7gcHh). -- cgit v1.2.3 From 13ad6501361faa9433562dba4ea8c55f85bf1dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Sat, 8 Dec 2018 18:42:46 +0100 Subject: Add a better Docker build script + update Dockerfile (#4222) * Add a Docker build script * Add usage and error messages * Add -r to reads Thanks mechmerlin * Add keyboard:keymap form, improve script * Add target argument, change usage forms in script * Add check for more than 3 args in keyboard:keymap:target form * Change Docker base image to debian, use community repo This matches what qmk_compiler uses (https://github.com/qmk/qmk_compiler/blob/master/Dockerfile#L1). I've removed the maintainer as we now have a community build on Docker Hub (https://hub.docker.com/r/qmkfm/qmk_firmware). This Dockerfile will also be maintained by the community. * Change build command format to keyboard:keymap * Call make directly in container run command * Simplify script, remove 3-arg form * Add COPY to Dockerfile so images are usable in and of themselves Also change WORKDIR from /qmk to /qmk_firmware * Add USB pass-through for Linux and docker-machine hosts * Read directly into variables instead of array * Alphabetically sort dependencies in Dockerfile * Set executable bit on util/docker_build.sh * Update Docker docs * Add warning about Docker on Windows * Expand comment in docs * Check docker-machine exit code instead of string * Only match --help with whole arguments * Make script POSIX-compliant * Convert script indentation to tabs --- Dockerfile | 37 ++++++++++++++-------------- docs/getting_started_build_tools.md | 25 ++++++++++--------- util/docker_build.sh | 49 +++++++++++++++++++++++++++++++++++++ 3 files changed, 82 insertions(+), 29 deletions(-) create mode 100755 util/docker_build.sh diff --git a/Dockerfile b/Dockerfile index dfde33b5cc..8f78dc2bfe 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,29 @@ -FROM debian:jessie -MAINTAINER Erik Dasque +FROM debian -RUN apt-get update && apt-get install --no-install-recommends -y build-essential \ - gcc \ - unzip \ - wget \ - zip \ - gcc-avr \ - binutils-avr \ +RUN apt-get update && apt-get install --no-install-recommends -y \ avr-libc \ + avrdude \ + binutils-arm-none-eabi \ + binutils-avr \ + build-essential \ dfu-programmer \ dfu-util \ + gcc \ gcc-arm-none-eabi \ - binutils-arm-none-eabi \ - libnewlib-arm-none-eabi \ + gcc-avr \ git \ + libnewlib-arm-none-eabi \ software-properties-common \ - avrdude \ + unzip \ + wget \ + zip \ && rm -rf /var/lib/apt/lists/* -ENV keyboard=ergodox -ENV subproject=ez -ENV keymap=default +ENV KEYBOARD=ergodox_ez +ENV KEYMAP=default + +VOLUME /qmk_firmware +WORKDIR /qmk_firmware +COPY . . -VOLUME /qmk -WORKDIR /qmk -CMD make clean ; make keyboard=${keyboard} subproject=${subproject} keymap=${keymap} +CMD make $KEYBOARD:$KEYMAP diff --git a/docs/getting_started_build_tools.md b/docs/getting_started_build_tools.md index 67bbe54344..375e9d108f 100644 --- a/docs/getting_started_build_tools.md +++ b/docs/getting_started_build_tools.md @@ -123,24 +123,27 @@ If you have trouble and want to ask for help, it is useful to generate a *Win_Ch ## Docker -If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker](https://www.docker.com/products/docker), run the following command at the root of the QMK folder to build a keyboard/keymap: - +If this is a bit complex for you, Docker might be the turn-key solution you need. After installing [Docker CE](https://docs.docker.com/install/#supported-platforms), run the following command from the `qmk_firmware` directory to build a keyboard/keymap: ```bash -# You'll run this every time you want to build a keymap -# modify the keymap and keyboard assignment to compile what you want -# defaults are ergodox/default - -docker run -e keymap=gwen -e keyboard=ergodox_ez --rm -v $('pwd'):/qmk:rw edasque/qmk_firmware +util/docker_build.sh keyboard:keymap +# For example: util/docker_build.sh ergodox_ez:steno ``` +This will compile the targeted keyboard/keymap and leave the resulting `.hex` or `.bin` file in the QMK directory for you to flash. If `:keymap` is omitted, the `default` keymap is used. Note that the parameter format is the same as when building with `make`. -On Windows Docker seems to have issues with the VOLUME tag in Dockerfile, and `$('pwd')` won't print a Windows compliant path; use full path instead, like this: - +You can also start the script without any parameters, in which case it will ask you to input the build parameters one by one, which you may find easier to use: ```bash -docker run -e keymap=default -e keyboard=ergodox_ez --rm -v D:/Users/Sacapuces/Documents/Repositories/qmk:/qmk:rw edasque/qmk_firmware +util/docker_build.sh +# Reads parameters as input (leave blank for defaults) +``` +There is also support for building _and_ flashing the keyboard straight from Docker by specifying the `target` as well: +```bash +util/docker_build.sh keyboard:keymap:target +# For example: util/docker_build.sh planck/rev6:default:dfu-util ``` +If you're on Linux, this should work out of the box. On Windows and macOS, it requires [Docker Machine](http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos/) to be running. This is tedious to set up, so it's not recommended; use QMK Toolbox instead. -This will compile the targeted keyboard/keymap and leave it in your QMK directory for you to flash. +!> Docker for Windows requires [Hyper-V](https://docs.microsoft.com/en-us/virtualization/hyper-v-on-windows/quick-start/enable-hyper-v) to be enabled. This means that it cannot work on versions of Windows which don't have Hyper-V, such as Windows 7, Windows 8 and **Windows 10 Home**. ## Vagrant If you have any problems building the firmware, you can try using a tool called Vagrant. It will set up a virtual computer with a known configuration that's ready-to-go for firmware building. OLKB does NOT host the files for this virtual computer. Details on how to set up Vagrant are in the [vagrant guide](getting_started_vagrant.md). diff --git a/util/docker_build.sh b/util/docker_build.sh new file mode 100755 index 0000000000..26075cc908 --- /dev/null +++ b/util/docker_build.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# NOTE: This script uses tabs for indentation + +USAGE="Usage: $0 [keyboard[:keymap[:target]]]" + +# Check preconditions +for arg; do + if [ "$arg" = "--help" ]; then + echo "$USAGE" + exit 0 + fi +done +if [ $# -gt 1 ]; then + echo "$USAGE" >&2 + exit 1 +elif ! command -v docker >/dev/null 2>&1; then + echo "Error: docker not found" >&2 + echo "See https://docs.docker.com/install/#supported-platforms for installation instructions" >&2 + exit 2 +fi + +# Determine arguments +if [ $# -eq 0 ]; then + printf "keyboard=" && read -r keyboard + [ -n "$keyboard" ] && printf "keymap=" && read -r keymap + [ -n "$keymap" ] && printf "target=" && read -r target +else + IFS=':' read -r keyboard keymap target x <<-EOF + $1 + EOF + if [ -n "$x" ]; then + echo "$USAGE" >&2 + exit 1 + fi +fi +if [ -n "$target" ]; then + if [ "$(uname)" = "Linux" ] || docker-machine active >/dev/null 2>&1; then + usb_args="--privileged -v /dev/bus/usb:/dev/bus/usb" + else + echo "Error: target requires docker-machine to work on your platform" >&2 + echo "See http://gw.tnode.com/docker/docker-machine-with-usb-support-on-windows-macos" >&2 + exit 3 + fi +fi +dir=$(pwd -W 2>/dev/null) || dir=$PWD # Use Windows path if on Windows + +# Run container and build firmware +docker run --rm $usb_args -v "$dir":/qmk_firmware qmkfm/qmk_firmware \ + make "$keyboard${keymap:+:$keymap}${target:+:$target}" -- cgit v1.2.3 From 11eaccdbce5246e7235ff91d0d04de83f7685919 Mon Sep 17 00:00:00 2001 From: marksard <38324387+marksard@users.noreply.github.com> Date: Sun, 9 Dec 2018 02:43:57 +0900 Subject: Keymap: Modified like-jis keymap for crkbd (#4577) --- keyboards/crkbd/keymaps/like_jis/config.h | 2 +- keyboards/crkbd/keymaps/like_jis/keymap.c | 303 ++++++++++++++----------- keyboards/crkbd/keymaps/like_jis/oled_helper.c | 83 +++++++ keyboards/crkbd/keymaps/like_jis/oled_helper.h | 35 +++ keyboards/crkbd/keymaps/like_jis/rules.mk | 17 +- 5 files changed, 304 insertions(+), 136 deletions(-) create mode 100644 keyboards/crkbd/keymaps/like_jis/oled_helper.c create mode 100644 keyboards/crkbd/keymaps/like_jis/oled_helper.h diff --git a/keyboards/crkbd/keymaps/like_jis/config.h b/keyboards/crkbd/keymaps/like_jis/config.h index 0e2960a937..a061b4fb09 100644 --- a/keyboards/crkbd/keymaps/like_jis/config.h +++ b/keyboards/crkbd/keymaps/like_jis/config.h @@ -34,7 +34,7 @@ along with this program. If not, see . #define PREVENT_STUCK_MODIFIERS #define TAPPING_FORCE_HOLD -#define TAPPING_TERM 150 +#define TAPPING_TERM 250 #undef RGBLED_NUM #define RGBLIGHT_ANIMATIONS diff --git a/keyboards/crkbd/keymaps/like_jis/keymap.c b/keyboards/crkbd/keymaps/like_jis/keymap.c index 42d36de449..b1b6c64b1e 100644 --- a/keyboards/crkbd/keymaps/like_jis/keymap.c +++ b/keyboards/crkbd/keymaps/like_jis/keymap.c @@ -7,6 +7,7 @@ #ifdef SSD1306OLED #include "ssd1306.h" #endif +#include "oled_helper.h" extern keymap_config_t keymap_config; @@ -21,27 +22,35 @@ extern uint8_t is_master; // 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 _QWERTY 0 -#define _LOWER 3 -#define _RAISE 4 -#define _ADJUST 16 +enum layer_number { + _BASE = 0, + _LOWER, + _RAISE, + _ADJUST, +}; enum custom_keycodes { LOWER = SAFE_RANGE, RAISE, ADJUST, + KANJI, RGBRST }; -#define KC______ KC_TRNS -#define KC_XXXXX KC_NO -#define KC_KANJI KC_GRV +enum tapdances{ + TD_CODO = 0, + // TD_MNUB, +}; +// Layer Mode aliases #define KC_LOWER LOWER #define KC_RAISE RAISE -#define KC_RST RESET +#define KC______ KC_TRNS +#define KC_XXXXX KC_NO +#define KC_KANJI KANJI +#define KC_RST RESET #define KC_LRST RGBRST #define KC_LTOG RGB_TOG #define KC_LHUI RGB_HUI @@ -51,31 +60,41 @@ enum custom_keycodes { #define KC_LVAI RGB_VAI #define KC_LVAD RGB_VAD #define KC_LMOD RGB_MOD - #define KC_KNRM AG_NORM #define KC_KSWP AG_SWAP -#define KC_GUAP LALT_T(KC_APP) + +#define KC_TBSF LSFT_T(KC_TAB) +// #define KC_SPSF LSFT_T(KC_SPC) +#define KC_ALAP LALT_T(KC_APP) + +#define KC_CODO TD(TD_CODO) +// #define KC_MNUB TD(TD_MNUB) + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_CODO] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_DOT), + // [TD_MNUB] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, LSFT(KC_RO)), +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( \ + [_BASE] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. ESC, Q, W, E, R, T, Y, U, I, O, P, MINS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LSFT, A, S, D, F, G, H, J, K, L, UP, ENT,\ + TBSF, A, S, D, F, G, H, J, K, L, UP, ENT,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - LCTRL, Z, X, C, V, B, N, M, COMM, LEFT, DOWN, RGHT,\ + LCTRL, Z, X, C, V, B, N, M, CODO, LEFT, DOWN, RGHT,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - LGUI, LOWER, BSPC, SPC, RAISE, GUAP \ + LGUI, LOWER, BSPC, SPC, RAISE, ALAP \ //`--------------------' `--------------------' ), [_LOWER] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - TAB, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\ + _____, F1, F2, F3, F4, F5, XXXXX, MINS, EQL, JYEN, LBRC, RBRC,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| _____, F6, F7, F8, F9, F10, XXXXX, XXXXX, XXXXX, SCLN, QUOT, BSLS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, F11, F12, XXXXX, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ + _____, F11, F12, TAB, KANJI, ENT, XXXXX, XXXXX, COMM, DOT, SLSH, RO,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, DEL, _____, _____, APP \ //`--------------------' `--------------------' @@ -83,11 +102,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - _____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, XXXXX,\ + _____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, PSLS,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 4, 5, 6, QUOT, XXXXX,\ + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, QUOT, 4, 5, 6, PPLS, PAST,\ //|------+------+------+------+------+------| |------+------+------+------+------+------| - _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, XXXXX,\ + _____, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, 0, 1, 2, 3, DOT, PMNS,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, BSPC, _____, _____, LALT \ //`--------------------' `--------------------' @@ -95,152 +114,182 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_ADJUST] = LAYOUT_kc( \ //,-----------------------------------------. ,-----------------------------------------. - _____, RST, LRST, KNRM, KSWP,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ + _____, RST, LRST, KNRM, KSWP, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX,\ //|------+-------+------+------+------+-----| |------+------+------+------+------+------| - _____, LTOG, LHUI, LSAI, LVAI,XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ + _____, LTOG, LHUI, LSAI, LVAI, XXXXX, XXXXX, XXXXX, XXXXX, XXXXX, PGUP, XXXXX,\ //|------+-------+------+------+------+-----| |------+------+------+------+------+------| - _____, LMOD, LHUD, LSAD, LVAD,XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ + _____, LMOD, LHUD, LSAD, LVAD, XXXXX, XXXXX, XXXXX, XXXXX, HOME, PGDN, END,\ //|------+------+------+------+------+------+------| |------+------+------+------+------+------+------| _____, _____, XXXXX, _____, _____, XXXXX \ //`--------------------' `--------------------' ) }; -int RGB_current_mode; +#define L_BASE _BASE +#define L_LOWER (1<<_LOWER) +#define L_RAISE (1<<_RAISE) +#define L_ADJUST (1<<_ADJUST) +#define L_ADJUST_TRI (L_ADJUST|L_RAISE|L_LOWER) -// Setting ADJUST layer RGB back to default -static inline void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { - if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { - layer_on(layer3); - } else { - layer_off(layer3); +#ifdef SSD1306OLED +typedef struct { + uint8_t state; + char name[8]; +}LAYER_DISPLAY_NAME; + +#define LAYER_DISPLAY_MAX 5 +const LAYER_DISPLAY_NAME layer_display_name[LAYER_DISPLAY_MAX] = { + {L_BASE, "Base"}, + {L_BASE + 1, "Base"}, + {L_LOWER, "Lower"}, + {L_RAISE, "Raise"}, + {L_ADJUST_TRI, "Adjust"} +}; + +static inline const char* get_leyer_status(void) { + + for (uint8_t i = 0; i < LAYER_DISPLAY_MAX; ++i) { + if (layer_state == 0 && layer_display_name[i].state == default_layer_state) { + + return layer_display_name[i].name; + } else if (layer_state != 0 && layer_display_name[i].state == layer_state) { + + return layer_display_name[i].name; + } } -} -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; - #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif + return "?"; } -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED +static char layer_status_buf[24] = "Layer state ready.\n"; +static inline void update_keymap_status(void) { + snprintf(layer_status_buf, sizeof(layer_status_buf) - 1, "OS:%s Layer:%s\n", + keymap_config.swap_lalt_lgui? "win" : "mac", get_leyer_status()); +} -// When add source files to SRC in rules.mk, you can use functions. -const char *read_layer_state(void); -const char *read_logo(void); -void set_keylog(uint16_t keycode, keyrecord_t *record); -const char *read_keylog(void); -const char *read_keylogs(void); +static inline void render_keymap_status(struct CharacterMatrix *matrix) { -// const char *read_mode_icon(bool swap); -// const char *read_host_led_state(void); -// void set_timelog(void); -// const char *read_timelog(void); + matrix_write(matrix, layer_status_buf); +} + +#define UPDATE_KEYMAP_STATUS() update_keymap_status() +#define RENDER_KEYMAP_STATUS(a) render_keymap_status(a) -#ifdef RGBLIGHT_ENABLE - const char *read_rgb_info(void); - #define RENDER_RGB_INFO(m) matrix_write_ln(m, (const char*)read_rgb_info()) #else - #define RENDER_RGB_INFO(m) + +#define UPDATE_KEYMAP_STATUS() +#define RENDER_KEYMAP_STATUS(a) + #endif +static inline void update_change_layer(bool pressed, uint8_t layer1, uint8_t layer2, uint8_t layer3) { -void matrix_scan_user(void) { - iota_gfx_task(); + pressed ? layer_on(layer1) : layer_off(layer1); + IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2) ? layer_on(layer3) : layer_off(layer3); } -static inline void matrix_render_user(struct CharacterMatrix *matrix) { - if (is_master) { - // If you want to change the display of OLED, you need to change here - matrix_write_ln(matrix, read_layer_state()); - matrix_write_ln(matrix, read_keylog()); - RENDER_RGB_INFO(matrix); - // matrix_write_ln(matrix, read_keylogs()); - // matrix_write_ln(matrix, read_host_led_state()); - - // matrix_write_ln(matrix, read_mode_icon(keymap_config.swap_lalt_lgui)); - // matrix_write_ln(matrix, read_timelog()); - } else { - matrix_write(matrix, read_logo()); +int RGB_current_mode; +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + + UPDATE_KEY_STATUS(keycode, record); + + bool result = false; + switch (keycode) { + case LOWER: + update_change_layer(record->event.pressed, _LOWER, _RAISE, _ADJUST); + break; + case RAISE: + update_change_layer(record->event.pressed, _RAISE, _LOWER, _ADJUST); + break; + case KANJI: + if (record->event.pressed) { + if (keymap_config.swap_lalt_lgui == false) { + register_code(KC_LANG2); + } else { + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + break; + #ifdef RGBLIGHT_ENABLE + case RGB_MOD: + if (record->event.pressed) { + rgblight_mode(RGB_current_mode); + rgblight_step(); + RGB_current_mode = rgblight_config.mode; + } + break; + case RGBRST: + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_mode = rgblight_config.mode; + } + break; + #endif + default: + result = true; + break; } + + UPDATE_KEYMAP_STATUS(); + return result; +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + RGB_current_mode = rgblight_config.mode; + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously } -static inline void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { +static inline void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { if (memcmp(dest->display, source->display, sizeof(dest->display))) { memcpy(dest->display, source->display, sizeof(dest->display)); dest->dirty = true; } } -void iota_gfx_task_user(void) { - struct CharacterMatrix matrix; - matrix_clear(&matrix); - matrix_render_user(&matrix); - matrix_update(&display, &matrix); +static inline void render_status(struct CharacterMatrix *matrix) { + + UPDATE_LED_STATUS(); + RENDER_LED_STATUS(matrix); + RENDER_KEYMAP_STATUS(matrix); + UPDATE_LOCK_STATUS(); + RENDER_LOCK_STATUS(matrix); + RENDER_KEY_STATUS(matrix); } -#endif +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - #ifdef SSD1306OLED - if (record->event.pressed) { - set_keylog(keycode, record); - // set_timelog(); + #if DEBUG_TO_SCREEN + if (debug_enable) { + return; } #endif - switch (keycode) { - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); - } - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - break; - - #ifdef RGBLIGHT_ENABLE - case RGB_MOD: - if (record->event.pressed) { - rgblight_mode(RGB_current_mode); - rgblight_step(); - RGB_current_mode = rgblight_config.mode; - } - break; - case RGBRST: - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - break; - #endif - default: - return true; + matrix_clear(&matrix); + if (is_master) { + render_status(&matrix); + } else { + RENDER_LOGO(&matrix); } - return false; + matrix_update(&display, &matrix); } + +#endif diff --git a/keyboards/crkbd/keymaps/like_jis/oled_helper.c b/keyboards/crkbd/keymaps/like_jis/oled_helper.c new file mode 100644 index 0000000000..500d3c0dc1 --- /dev/null +++ b/keyboards/crkbd/keymaps/like_jis/oled_helper.c @@ -0,0 +1,83 @@ +#ifdef SSD1306OLED +#include QMK_KEYBOARD_H +#include "ssd1306.h" + +void render_logo(struct CharacterMatrix *matrix) { + + const char logo_buf[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + + matrix_write(matrix, logo_buf); +} + +static char keylog_buf[24] = "Key state ready."; +const char code_to_name[60] = { + ' ', ' ', ' ', ' ', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', + 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', + 'R', 'E', 'B', 'T', ' ', '-', ' ', '@', ' ', ' ', + ' ', ';', ':', ' ', ',', '.', '/', ' ', ' ', ' '}; + +void update_key_status(uint16_t keycode, keyrecord_t *record) { + + if (!record->event.pressed) return; + + char name = (keycode < 60) ? code_to_name[keycode] : ' '; + snprintf(keylog_buf, sizeof(keylog_buf) - 1, "Key:%dx%d %2x %c", + record->event.key.row, record->event.key.col, + (uint16_t)keycode, name); +} + +void render_key_status(struct CharacterMatrix *matrix) { + + matrix_write(matrix, keylog_buf); +} + +static char lock_buf[24] = "Lock state ready.\n"; +void update_lock_status(void) { + + uint8_t leds = host_keyboard_leds(); + char *num_lock = (leds & (1< Date: Mon, 10 Dec 2018 00:28:46 +0800 Subject: Keymap: Keymap update (#4579) * Add YREG keycode * Add GM layer * Set tapping term to 105 * update tapping term --- keyboards/lets_split/keymaps/zer09/keymap.c | 24 ++++++++++++++++++++++-- users/zer09/config.h | 4 ++-- users/zer09/tap_dance.c | 27 ++++++++++++++++++++++++--- users/zer09/zer09.h | 10 +++++++++- 4 files changed, 57 insertions(+), 8 deletions(-) diff --git a/keyboards/lets_split/keymaps/zer09/keymap.c b/keyboards/lets_split/keymaps/zer09/keymap.c index 8d0eaf1411..cb6744433a 100644 --- a/keyboards/lets_split/keymaps/zer09/keymap.c +++ b/keyboards/lets_split/keymaps/zer09/keymap.c @@ -9,8 +9,15 @@ extern keymap_config_t keymap_config; TD(DA_UPLY), MO(_VL), KC_TAB, KC_BSPACE, KC_ESC, /**/KC_INS, KC_HOME, KC_PGUP, MO(_VL), TD(DA_UPLY), \ TD(DA_DWLY), TD(DA_LCTL), KC_SPC, TD(DA_LSPR), LSFT_T(KC_CAPS),/**/SFT_T(KC_CAPS), TD(DA_RALT), KC_ENT, TD(DA_RCTL), TD(DA_DWLY)) +#define _GMLayer LAYOUT( \ + KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, /**/KC_F, KC_G, KC_C, KC_R, KC_L, \ + KC_A, KC_O, KC_E, KC_U, KC_I, /**/KC_D, KC_H, ALT_T(KC_T), SFT_T(KC_N), CTL_T(KC_S), \ + KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, /**/KC_B, KC_M, KC_W, KC_V, KC_Z, \ + TD(DA_UPLY), MO(_VL), KC_TAB, KC_BSPACE, KC_ESC, /**/KC_INS, KC_HOME, KC_PGUP, MO(_VL), TD(DA_UPLY), \ + TD(DA_DWLY), TD(DA_LCTL), KC_SPC, TD(DA_LSPR), LSFT_T(KC_CAPS),/**/SFT_T(KC_CAPS), TD(DA_RALT), KC_ENT, TD(DA_RCTL), TD(DA_DWLY)) + #define _upLayer LAYOUT( \ - KC_4, KC_5, KC_6, _______, _______,/**/ _______, KC_RBRC, _______, _______, _______, \ + KC_4, KC_5, KC_6, KC_YREG, _______,/**/ _______, KC_RBRC, _______, _______, _______, \ LCTL_T(KC_1), LSFT_T(KC_2), LALT_T(KC_3), _______, _______,/**/ KC_LBRC, KC_BSLS, _______, _______, _______, \ KC_7, KC_8, KC_9, KC_0, KC_GRV, /**/ KC_SLSH, _______, _______, _______, _______, \ _______, _______, _______, _______, _______,/**/ KC_DEL, KC_END, KC_PGDN, _______, _______, \ @@ -35,4 +42,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_UL] = _upLayer, [_DL] = _downLayer, [_VL] = _upLayer, - [_AL] = _astdLayer}; + [_AL] = _astdLayer, + [_GM] = _GMLayer}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case YREG: + SEND_STRING("\"0p"); + return false; + } + } + + return true; +} diff --git a/users/zer09/config.h b/users/zer09/config.h index 4cb65c258f..c5ab32f8d4 100644 --- a/users/zer09/config.h +++ b/users/zer09/config.h @@ -16,13 +16,13 @@ #define FORCE_NKRO #ifndef TAPPING_TOGGLE -#define TAPPING_TOGGLE 1 +#define TAPPING_TOGGLE 1 #endif #ifdef TAPPING_TERM #undef TAPPING_TERM #endif -#define TAPPING_TERM 120 +#define TAPPING_TERM 95 // Disable action_get_macro and fn_actions, since we don't use these // and it saves on space in the firmware. diff --git a/users/zer09/tap_dance.c b/users/zer09/tap_dance.c index a23705ad8b..e99b26cca0 100644 --- a/users/zer09/tap_dance.c +++ b/users/zer09/tap_dance.c @@ -17,15 +17,27 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; volatile uint8_t active_layer = _BL; +volatile uint8_t gm_layer_act = false; static tap upltap_state = {.state = 0}; static tap dwltap_state = {.state = 0}; static tap lsprtap_state = {.state = 0}; static tap ralttap_state = {.state = 0}; void layer_switcher_tap(uint8_t new_layer) { - layer_off(active_layer); - layer_on(new_layer); - active_layer = new_layer; + if (gm_layer_act == true) { + layer_off(active_layer); + if (new_layer == _BL) { + layer_on(_GM); + active_layer = _GM; + } else { + layer_on(new_layer); + active_layer = new_layer; + } + } else { + layer_off(active_layer); + layer_on(new_layer); + active_layer = new_layer; + } } int cur_dance(qk_tap_dance_state_t *state) { @@ -162,6 +174,14 @@ void dance_dwly_finished(qk_tap_dance_state_t *state, void *user_data) { case DOUBLE_HOLD: layer_switcher_tap(_AL); break; + case TRIPLE_TAP: + if (gm_layer_act == true) { + gm_layer_act = false; + layer_switcher_tap(_BL); + } else { + gm_layer_act = true; + layer_switcher_tap(_GM); + } default: layer_switcher_tap(_BL); break; @@ -174,6 +194,7 @@ void dance_dwly_reset(qk_tap_dance_state_t *state, void *user_data) { break; case SINGLE_HOLD: case DOUBLE_HOLD: + case TRIPLE_TAP: default: layer_switcher_tap(_BL); break; diff --git a/users/zer09/zer09.h b/users/zer09/zer09.h index 75c1d3cad4..acac8ab09f 100644 --- a/users/zer09/zer09.h +++ b/users/zer09/zer09.h @@ -3,16 +3,24 @@ #include "quantum.h" -enum custom_keycodes { CK_SAFE = SAFE_RANGE, RGUP, RGDWN, NEWPLACEHOLDER }; +enum custom_keycodes { + CK_SAFE = SAFE_RANGE, + RGUP, + RGDWN, + YREG, + NEW_SAFE_RANGE +}; #define _______ KC_TRNS #define KC_RGUP RGUP #define KC_RGDWN RGDWN +#define KC_YREG YREG #define _BL 0 // The base layer #define _UL 1 // The up layer #define _DL 2 // The down layer #define _VL 3 // The shifted up layer #define _AL 4 // The assorted layer +#define _GM 5 #endif -- cgit v1.2.3 From b8db0b26b1b978bbc510af1fe95ba2a0b7f1f928 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Mon, 10 Dec 2018 01:42:28 +0900 Subject: Keymap: Fixed a problem with underglow with froggy keymap (#4580) --- keyboards/helix/rev2/keymaps/froggy/keymap.c | 30 +++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/froggy/keymap.c b/keyboards/helix/rev2/keymaps/froggy/keymap.c index 75c6f08114..efd8a29160 100644 --- a/keyboards/helix/rev2/keymaps/froggy/keymap.c +++ b/keyboards/helix/rev2/keymaps/froggy/keymap.c @@ -593,19 +593,39 @@ void matrix_scan_user(void) { if(!RGBAnimation){ switch (layer_state) { case L_BASE: - led_ripple_effect(0,112,127); + #ifdef RGBLED_BACK + led_ripple_effect(0,112,127); + #else + rgblight_setrgb(0,112,127); + #endif break; case L_OPT: - led_ripple_effect(127,0,100); + #ifdef RGBLED_BACK + led_ripple_effect(127,0,100); + #else + rgblight_setrgb(127,0,100); + #endif break; case L_NUM: - led_ripple_effect(127,23,0); + #ifdef RGBLED_BACK + led_ripple_effect(127,23,0); + #else + rgblight_setrgb(127,23,0); + #endif break; case L_SYM: - led_ripple_effect(0,127,0); + #ifdef RGBLED_BACK + led_ripple_effect(0,127,0); + #else + rgblight_setrgb(0,127,0); + #endif break; case L_FUNC: - led_ripple_effect(127,0,61); + #ifdef RGBLED_BACK + led_ripple_effect(127,0,61); + #else + rgblight_setrgb(127,0,61); + #endif break; } } -- cgit v1.2.3 From 16302be5adfa0f094e95f734b432c96460b79a6e Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 9 Dec 2018 23:26:09 +0100 Subject: docs typo (#4584) --- docs/feature_encoders.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_encoders.md b/docs/feature_encoders.md index 036c6a1d89..208d6db13c 100644 --- a/docs/feature_encoders.md +++ b/docs/feature_encoders.md @@ -13,7 +13,7 @@ and this to your `config.h`: Each PAD_A/B variable defines an array so multiple encoders can be defined, e.g.: #define ENCODERS_PAD_A { encoder1a, encoder2a } - #define ENCODERS_PAD_B { encoder1a, encoder2b } + #define ENCODERS_PAD_B { encoder1b, encoder2b } If your encoder's clockwise directions are incorrect, you can swap the A & B pad definitions. -- cgit v1.2.3 From fd3b0787ed4fc8d58158fa8c7136bc1d3b48ab16 Mon Sep 17 00:00:00 2001 From: Vyolle <44031868+Vyolle@users.noreply.github.com> Date: Sun, 9 Dec 2018 19:52:00 -0600 Subject: Fixed lack of semi colon. (#4587) --- keyboards/levinson/keymaps/steno/keymap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/keyboards/levinson/keymaps/steno/keymap.c b/keyboards/levinson/keymaps/steno/keymap.c index f997b4de11..cd7493467a 100644 --- a/keyboards/levinson/keymaps/steno/keymap.c +++ b/keyboards/levinson/keymaps/steno/keymap.c @@ -39,11 +39,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_P, KC_QUOT, + KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RSFT, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_LGUI, KC_Z, KC_LALT, KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL, KC_RALT, EXT_QWE, KC_RGUI + KC_LALT, KC_MINUS, KC_TAB, KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RCTL, KC_RGUI, EXT_QWE, KC_RALT //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ ), @@ -76,15 +76,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = [_ADJUST] = LAYOUT( //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ - KC_GRV, KC_HOME, KC_LBRC, KC_RBRC, KC_PIPE, KC_APP, KC_SLCK, _______, _______, _______, _______, _______, + _______, _______, KC_CAPS, KC_MENU, KC_APP, KC_PSCR, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - KC_PSCR, KC_END, KC_LCBR, KC_RCBR, KC_PLUS, KC_EQL, KC_PAUS, _______, _______, _______, _______, _______, + _______, _______,_______, _______, _______, KC_PAUS, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, KC_BSLS, KC_MINS, KC_UNDS, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_SLCK, _______, _______, _______, _______, _______, _______, //├────────┼────────┼────────┼────────┼────────┼────────┼ ┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴ ┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘ - + ), -- cgit v1.2.3 From 753f57ee0003c9adde5446e813e3a347d4b15a2a Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 9 Dec 2018 21:43:24 -0800 Subject: handwired/nicekey Refactor and readme cleanup (#4588) * handwired/nicekey: refactor Now uses a layout macro. * handwired/nicekey: readme cleanup - linked maintainer's GitHub account - updated Docs links --- keyboards/handwired/nicekey/keymaps/default/keymap.c | 2 +- keyboards/handwired/nicekey/nicekey.h | 13 ++++++++++++- keyboards/handwired/nicekey/readme.md | 4 ++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/keyboards/handwired/nicekey/keymaps/default/keymap.c b/keyboards/handwired/nicekey/keymaps/default/keymap.c index 5732377156..139ea6a3be 100644 --- a/keyboards/handwired/nicekey/keymaps/default/keymap.c +++ b/keyboards/handwired/nicekey/keymaps/default/keymap.c @@ -71,5 +71,5 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{ RANDOM_STRING_MACRO }} + LAYOUT( RANDOM_STRING_MACRO ) }; diff --git a/keyboards/handwired/nicekey/nicekey.h b/keyboards/handwired/nicekey/nicekey.h index 7a4a4835e6..ee5bcfd6be 100644 --- a/keyboards/handwired/nicekey/nicekey.h +++ b/keyboards/handwired/nicekey/nicekey.h @@ -1 +1,12 @@ -#include "quantum.h" \ No newline at end of file +#ifndef NICEKEY_H +#define NICEKEY_H + +#include "quantum.h" + +#define LAYOUT( \ + k00 \ + ) { \ + { k00 } \ +} + +#endif diff --git a/keyboards/handwired/nicekey/readme.md b/keyboards/handwired/nicekey/readme.md index a867e907e6..e108b38dd1 100644 --- a/keyboards/handwired/nicekey/readme.md +++ b/keyboards/handwired/nicekey/readme.md @@ -5,7 +5,7 @@ Custom handwired nicekey, a one key keyboard that writes random compliments. -Keyboard Maintainer: spydon +Keyboard Maintainer: [spydon](https://github.com/spydon) Hardware Supported: Custom handwired one key Hardware Availability: @@ -15,4 +15,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/nicekey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From 090c30212e13b5c21d78f600425a28b4b7ff0e37 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 10 Dec 2018 09:22:50 -0800 Subject: handwired/onekey Refactor and readme update (#4590) * handwired/onekey: refactor - keyboard now uses a layout macro - keymap now uses #include QMK_KEYBOARD_H * handwired/onekey: readme update Updated Docs links. --- keyboards/handwired/onekey/keymaps/default/keymap.c | 4 ++-- keyboards/handwired/onekey/onekey.h | 13 ++++++++++++- keyboards/handwired/onekey/readme.md | 2 +- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/keyboards/handwired/onekey/keymaps/default/keymap.c b/keyboards/handwired/onekey/keymaps/default/keymap.c index 10c486718d..dd64f9fa55 100644 --- a/keyboards/handwired/onekey/keymaps/default/keymap.c +++ b/keyboards/handwired/onekey/keymaps/default/keymap.c @@ -1,5 +1,5 @@ -#include "onekey.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - {{ KC_A }} + LAYOUT( KC_A ) }; diff --git a/keyboards/handwired/onekey/onekey.h b/keyboards/handwired/onekey/onekey.h index 7a4a4835e6..8ce6fec2d0 100644 --- a/keyboards/handwired/onekey/onekey.h +++ b/keyboards/handwired/onekey/onekey.h @@ -1 +1,12 @@ -#include "quantum.h" \ No newline at end of file +#ifndef ONEKEY_H +#define ONEKEY_H + +#include "quantum.h" + +#define LAYOUT( \ + k00 \ + ) { \ + { k00 } \ +} + +#endif diff --git a/keyboards/handwired/onekey/readme.md b/keyboards/handwired/onekey/readme.md index c28e284f32..eab3b75a93 100644 --- a/keyboards/handwired/onekey/readme.md +++ b/keyboards/handwired/onekey/readme.md @@ -12,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/onekey:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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). -- cgit v1.2.3 From e99615b2acb473fc4a23886b87abe61c80faa1bc Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Dec 2018 10:49:19 -0800 Subject: Keyboard: Added RGB toggle and cycle to default KDB6x mapping. (#4592) * Added RGB toggle and cycle to default mapping. This is present on layouts on 'http://qmkeyboard.cn/' but not here. * Added addition keycodes for hue/sat/val. --- keyboards/kbd6x/keymaps/default/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/kbd6x/keymaps/default/keymap.c b/keyboards/kbd6x/keymaps/default/keymap.c index 00adbf8873..e2e96fc634 100644 --- a/keyboards/kbd6x/keymaps/default/keymap.c +++ b/keyboards/kbd6x/keymaps/default/keymap.c @@ -26,7 +26,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [1] = 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_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, BL_DEC, BL_TOGG, BL_INC, BL_STEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -- cgit v1.2.3 From 4a5e68f4f29b0c4c75a68b5958dff197f4ac0f53 Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Mon, 10 Dec 2018 14:28:06 -0500 Subject: Bringing Massdrop keyboard hardware configuration to keyboard level (#4593) MCU Pins for debugging, LED, boot tracing, and shift registers are now configurable at keyboard level. Macros led_* replaced by DBG_LED_* Macros m15_* replaced by DBG_1_* Macros m27_* replaced by DBG_2_* Macros m28_* replaced by DBG_3_* For CTRL and ALT keyboards, debug boot tracing pin default now set to pad M27 instead of M28 since although M28 is not being used, it is technically a signal for USB port detection. m15_print(...) renamed to dbg_print(...) to get away from hard coded port names. dbg_print function now follows similar pattern to debug led output. --- keyboards/massdrop/alt/config.h | 51 ++++++++++- keyboards/massdrop/alt/matrix.c | 6 +- keyboards/massdrop/ctrl/config.h | 51 ++++++++++- keyboards/massdrop/ctrl/matrix.c | 6 +- tmk_core/protocol/arm_atsam/d51_util.c | 124 ++++++++++++++++++++------- tmk_core/protocol/arm_atsam/d51_util.h | 80 +++++++++++------ tmk_core/protocol/arm_atsam/i2c_master.c | 10 +-- tmk_core/protocol/arm_atsam/led_matrix.c | 4 +- tmk_core/protocol/arm_atsam/main_arm_atsam.c | 14 +-- tmk_core/protocol/arm_atsam/spi.c | 105 +++++++++++------------ tmk_core/protocol/arm_atsam/spi.h | 39 +++++---- tmk_core/protocol/arm_atsam/usb/usb2422.c | 85 +++++++++--------- 12 files changed, 382 insertions(+), 193 deletions(-) diff --git a/keyboards/massdrop/alt/config.h b/keyboards/massdrop/alt/config.h index a486f34a0c..660d44421b 100644 --- a/keyboards/massdrop/alt/config.h +++ b/keyboards/massdrop/alt/config.h @@ -32,17 +32,64 @@ along with this program. If not, see . #define MATRIX_ROWS 5 #define MATRIX_COLS 15 +/* MCU Port name definitions */ #define PA 0 #define PB 1 +/* Port and Pin definition of key row hardware configuration */ #define MATRIX_ROW_PORTS PA, PA, PA, PA, PA #define MATRIX_ROW_PINS 0, 1, 2, 3, 4 +/* Port and Pin definition of key column hardware configuration */ #define MATRIX_COL_PORTS PB, PB, PB, PB, PB, PB, PB, PB, PB, PB, PA, PA, PA, PA, PA #define MATRIX_COL_PINS 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 5, 6, 7, 10, 11 -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING +/* This Shift Register expands available hardware output lines to control additional peripherals */ +/* It uses four lines from the MCU to provide 16 output lines */ +/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */ +#define SR_EXP_RCLK_PORT PB +#define SR_EXP_RCLK_PIN 14 +/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */ +#define SR_EXP_OE_N_PORT PB +#define SR_EXP_OE_N_PIN 15 +/* SERCOM port to use for Shift Register SPI */ +/* DATAOUT and SCLK must be configured to use hardware pins of this port */ +#define SR_EXP_SERCOM SERCOM2 +/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */ +#define SR_EXP_DATAOUT_PORT PA +#define SR_EXP_DATAOUT_PIN 12 +#define SR_EXP_DATAOUT_MUX 2 +/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */ +#define SR_EXP_SCLK_PORT PA +#define SR_EXP_SCLK_PIN 13 +#define SR_EXP_SCLK_MUX 2 + +/* Debug LED (Small LED Located near MCU) */ +#define DEBUG_LED_ENABLE 1 +#define DEBUG_LED_PORT PA +#define DEBUG_LED_PIN 27 + +/* Additional debugging ports */ +/* PCB M21 */ +#define DEBUG_PORT1_ENABLE 1 +#define DEBUG_PORT1_PORT PB +#define DEBUG_PORT1_PIN 3 +/* PCB M23 */ +#define DEBUG_PORT2_ENABLE 1 +#define DEBUG_PORT2_PORT PB +#define DEBUG_PORT2_PIN 17 +/* PCB M25 */ +#define DEBUG_PORT3_ENABLE 1 +#define DEBUG_PORT3_PORT PA +#define DEBUG_PORT3_PIN 20 + +/* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */ +/* This is useful in determining which hardware device may have malfunctioned or is improperly configured */ +/* Feature is automatically disabled after successful boot */ +/* PCB M27 */ +#define DEBUG_BOOT_TRACING_ENABLE 1 +#define DEBUG_BOOT_TRACING_PORT PB +#define DEBUG_BOOT_TRACING_PIN 23 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 diff --git a/keyboards/massdrop/alt/matrix.c b/keyboards/massdrop/alt/matrix.c index 75a4d62b99..892d38791c 100644 --- a/keyboards/massdrop/alt/matrix.c +++ b/keyboards/massdrop/alt/matrix.c @@ -75,7 +75,7 @@ void matrix_init(void) PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low } - + matrix_init_quantum(); } @@ -91,7 +91,7 @@ uint8_t matrix_scan(void) if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - //m15_off; //Profiling scans + //DBG_1_OFF; //Profiling scans memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer @@ -135,7 +135,7 @@ uint8_t matrix_scan(void) mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; } - //m15_on; //Profiling scans + //DBG_1_ON; //Profiling scans matrix_scan_quantum(); diff --git a/keyboards/massdrop/ctrl/config.h b/keyboards/massdrop/ctrl/config.h index 1ab7f93cdd..31eccda87d 100644 --- a/keyboards/massdrop/ctrl/config.h +++ b/keyboards/massdrop/ctrl/config.h @@ -32,17 +32,64 @@ along with this program. If not, see . #define MATRIX_ROWS 11 #define MATRIX_COLS 8 +/* MCU Port name definitions */ #define PA 0 #define PB 1 +/* Port and Pin definition of key row hardware configuration */ #define MATRIX_ROW_PORTS PB, PB, PB, PB, PB, PB, PA, PA, PB, PB, PB #define MATRIX_ROW_PINS 4, 5, 6, 7, 8, 9, 10, 11, 10, 11, 12 +/* Port and Pin definition of key column hardware configuration */ #define MATRIX_COL_PORTS PA, PA, PA, PA, PA, PA, PA, PA #define MATRIX_COL_PINS 0, 1, 2, 3, 4, 5, 6, 7 -/* Print boot debug codes using debug LED when M28 and M30 shorted */ -#define DEBUG_BOOT_TRACING +/* This Shift Register expands available hardware output lines to control additional peripherals */ +/* It uses four lines from the MCU to provide 16 output lines */ +/* Shift Register Clock configuration (MCU to ShiftRegister.RCLK) */ +#define SR_EXP_RCLK_PORT PB +#define SR_EXP_RCLK_PIN 14 +/* Shift Register Output Enable configuration (MCU to ShiftRegister.OE_N) */ +#define SR_EXP_OE_N_PORT PB +#define SR_EXP_OE_N_PIN 15 +/* SERCOM port to use for Shift Register SPI */ +/* DATAOUT and SCLK must be configured to use hardware pins of this port */ +#define SR_EXP_SERCOM SERCOM2 +/* Shift Register SPI Data Out configuration (MCU.SERCOMx.PAD[0] to ShiftRegister.SER) */ +#define SR_EXP_DATAOUT_PORT PA +#define SR_EXP_DATAOUT_PIN 12 +#define SR_EXP_DATAOUT_MUX 2 +/* Shift Register SPI Serial Clock configuration (MCU.SERCOMx.PAD[1] to ShiftRegister.SRCLK) */ +#define SR_EXP_SCLK_PORT PA +#define SR_EXP_SCLK_PIN 13 +#define SR_EXP_SCLK_MUX 2 + +/* Debug LED (Small LED Located near MCU) */ +#define DEBUG_LED_ENABLE 1 +#define DEBUG_LED_PORT PA +#define DEBUG_LED_PIN 27 + +/* Additional debugging ports */ +/* PCB M21 */ +#define DEBUG_PORT1_ENABLE 1 +#define DEBUG_PORT1_PORT PB +#define DEBUG_PORT1_PIN 3 +/* PCB M23 */ +#define DEBUG_PORT2_ENABLE 1 +#define DEBUG_PORT2_PORT PB +#define DEBUG_PORT2_PIN 17 +/* PCB M25 */ +#define DEBUG_PORT3_ENABLE 1 +#define DEBUG_PORT3_PORT PA +#define DEBUG_PORT3_PIN 20 + +/* Debug Boot Tracing - During boot sequence, ground this pin to halt and display debug code using Debug LED */ +/* This is useful in determining which hardware device may have malfunctioned or is improperly configured */ +/* Feature is automatically disabled after successful boot */ +/* PCB M27 */ +#define DEBUG_BOOT_TRACING_ENABLE 1 +#define DEBUG_BOOT_TRACING_PORT PB +#define DEBUG_BOOT_TRACING_PIN 23 /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 diff --git a/keyboards/massdrop/ctrl/matrix.c b/keyboards/massdrop/ctrl/matrix.c index 6f306962e6..3580577dc1 100644 --- a/keyboards/massdrop/ctrl/matrix.c +++ b/keyboards/massdrop/ctrl/matrix.c @@ -75,7 +75,7 @@ void matrix_init(void) PORT->Group[col_ports[col]].DIRSET.reg = 1 << col_pins[col]; //Output PORT->Group[col_ports[col]].OUTCLR.reg = 1 << col_pins[col]; //Low } - + matrix_init_quantum(); } @@ -91,7 +91,7 @@ uint8_t matrix_scan(void) if (CLK_get_ms() < mdebouncing) return 1; //mdebouncing == 0 when no debouncing active - //m15_off; //Profiling scans + //DBG_1_OFF; //Profiling scans memset(mlatest, 0, MATRIX_ROWS * sizeof(matrix_row_t)); //Zero the result buffer @@ -135,7 +135,7 @@ uint8_t matrix_scan(void) mdebouncing = CLK_get_ms() + DEBOUNCING_DELAY; } - //m15_on; //Profiling scans + //DBG_1_ON; //Profiling scans matrix_scan_quantum(); diff --git a/tmk_core/protocol/arm_atsam/d51_util.c b/tmk_core/protocol/arm_atsam/d51_util.c index bb63a94814..ea42258575 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.c +++ b/tmk_core/protocol/arm_atsam/d51_util.c @@ -1,8 +1,11 @@ #include "d51_util.h" -//Display unsigned 32-bit number through m15 -//Read as follows: 1230 = || ||| |||| | (note always ending toggle) -void m15_print(uint32_t x) +static volatile uint32_t w; + +//Display unsigned 32-bit number by port toggling DBG_1 (to view on a scope) +//Read as follows: 1230 = | | | | | | || (note zero is fast double toggle) +#define DBG_PAUSE 5 +void dbg_print(uint32_t x) { int8_t t; uint32_t n; @@ -26,24 +29,34 @@ void m15_print(uint32_t x) while (p2--) p *= 10; n = x / p; x -= n * p; - while (n > 0) + if (!n) { - m15_on; + DBG_1_ON; + DBG_1_OFF; + DBG_1_ON; + DBG_1_OFF; n--; - m15_off; } - //Will always end with an extra toggle - m15_on; + else + { + while (n > 0) + { + DBG_1_ON; + DBG_1_OFF; + n--; + } + } + t--; - m15_off; } + + for (w = DBG_PAUSE; w; w--); //Long pause after number is complete } //Display unsigned 32-bit number through debug led //Read as follows: 1230 = [*] [* *] [* * *] [**] (note zero is fast double flash) #define DLED_ONTIME 1000000 #define DLED_PAUSE 1500000 -volatile uint32_t w; void dled_print(uint32_t x, uint8_t long_pause) { int8_t t; @@ -70,13 +83,13 @@ void dled_print(uint32_t x, uint8_t long_pause) x -= n * p; if (!n) { - led_on; + DBG_LED_ON; for (w = DLED_ONTIME / 4; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 4; w; w--); - led_on; + DBG_LED_ON; for (w = DLED_ONTIME / 4; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 4; w; w--); n--; } @@ -84,9 +97,9 @@ void dled_print(uint32_t x, uint8_t long_pause) { while (n > 0) { - led_on; + DBG_LED_ON; for (w = DLED_ONTIME; w; w--); - led_off; + DBG_LED_OFF; for (w = DLED_ONTIME / 2; w; w--); n--; } @@ -102,11 +115,52 @@ void dled_print(uint32_t x, uint8_t long_pause) } } -#ifdef DEBUG_BOOT_TRACING +#ifdef DEBUG_BOOT_TRACING_ENABLE volatile uint32_t debug_code; -void EIC_15_Handler() +//These macros are for compile time substitution +#define DEBUG_BOOT_TRACING_EXTINTn (DEBUG_BOOT_TRACING_PIN % _U_(0x10)) +#define DEBUG_BOOT_TRACING_EXTINTb (_U_(0x1) << DEBUG_BOOT_TRACING_EXTINTn) +#define DEBUG_BOOT_TRACING_CONFIG_INDn (DEBUG_BOOT_TRACING_EXTINTn / _U_(0x8)) +#define DEBUG_BOOT_TRACING_CONFIG_SENSEn (DEBUG_BOOT_TRACING_EXTINTn % _U_(0x8)) +#define DEBUG_BOOT_TRACING_CONFIG_SENSEb (DEBUG_BOOT_TRACING_CONFIG_SENSEn * _U_(0x4)) +#define DEBUG_BOOT_TRACING_IRQn (EIC_0_IRQn + DEBUG_BOOT_TRACING_EXTINTn) + +//These macros perform PORT+PIN definition translation to IRQn in the preprocessor +#define PORTPIN_TO_IRQn_EXPAND(def) def +#define PORTPIN_TO_IRQn_DEF(def) PORTPIN_TO_IRQn_EXPAND(def) +#if DEBUG_BOOT_TRACING_PIN < 10 +#define PORTPIN_TO_IRQn_TODEF(port, pin) PORTPIN_TO_IRQn_DEF(PIN_ ## port ## 0 ## pin ## A_EIC_EXTINT_NUM) +#else +#define PORTPIN_TO_IRQn_TODEF(port, pin) PORTPIN_TO_IRQn_DEF(PIN_ ## port ## pin ## A_EIC_EXTINT_NUM) +#endif +#define PORTPIN_TO_IRQn(port, pin) PORTPIN_TO_IRQn_TODEF(port, pin) + +//These macros perform function name output in the preprocessor +#define DEBUG_BOOT_TRACING_HANDLER_CONCAT(irq) void EIC_ ## irq ## _Handler(void) +#define DEBUG_BOOT_TRACING_HANDLER(irq) DEBUG_BOOT_TRACING_HANDLER_CONCAT(irq) + +//To generate the function name of the IRQ handler catching boot tracing, +// certain macros must be undefined, so save their current values to macro stack +#pragma push_macro("PA") +#pragma push_macro("PB") +#pragma push_macro("_L_") + +//Undefine / redefine pushed macros +#undef PA +#undef PB +#undef _L_ +#define _L_(x) x + +//Perform the work and output +//Ex: PORT PB, PIN 31 = void EIC_15_Handler(void) +DEBUG_BOOT_TRACING_HANDLER(PORTPIN_TO_IRQn(DEBUG_BOOT_TRACING_PORT, DEBUG_BOOT_TRACING_PIN)) + +//Restore macros +#pragma pop_macro("PA") +#pragma pop_macro("PB") +#pragma pop_macro("_L_") { //This is only for non-functional keyboard troubleshooting and should be disabled after boot //Intention is to lock up the keyboard here with repeating debug led code @@ -120,13 +174,13 @@ void debug_code_init(void) { DBGC(DC_UNSET); - //Configure Ports for EIC on PB31 - PORT->Group[1].DIRCLR.reg = 1 << 31; //Input - PORT->Group[1].OUTSET.reg = 1 << 31; //High - PORT->Group[1].PINCFG[31].bit.INEN = 1; //Input Enable - PORT->Group[1].PINCFG[31].bit.PULLEN = 1; //Pull Enable - PORT->Group[1].PINCFG[31].bit.PMUXEN = 1; //Mux Enable - PORT->Group[1].PMUX[15].bit.PMUXO = 0; //Mux A + //Configure Ports for EIC + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTSET.reg = 1 << DEBUG_BOOT_TRACING_PIN; //High + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 1; //Input Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 1; //Pull Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 1; //Mux Enable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; //Mux A //Enable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 1; @@ -134,25 +188,33 @@ void debug_code_init(void) //Configure EIC EIC->CTRLA.bit.SWRST = 1; while (EIC->SYNCBUSY.bit.SWRST) {} - EIC->ASYNCH.reg = 1 << 15; - EIC->INTENSET.reg = 1 << 15; - EIC->CONFIG[1].bit.SENSE7 = 2; + EIC->ASYNCH.reg = DEBUG_BOOT_TRACING_EXTINTb; + EIC->INTENSET.reg = DEBUG_BOOT_TRACING_EXTINTb; + EIC->CONFIG[DEBUG_BOOT_TRACING_CONFIG_INDn].reg |= (EIC_CONFIG_SENSE0_FALL_Val << DEBUG_BOOT_TRACING_CONFIG_SENSEb); EIC->CTRLA.bit.ENABLE = 1; while (EIC->SYNCBUSY.bit.ENABLE) {} //Enable EIC IRQ - NVIC_EnableIRQ(EIC_15_IRQn); + NVIC_EnableIRQ(DEBUG_BOOT_TRACING_IRQn); } void debug_code_disable(void) { //Disable EIC IRQ - NVIC_DisableIRQ(EIC_15_IRQn); + NVIC_DisableIRQ(DEBUG_BOOT_TRACING_IRQn); //Disable EIC EIC->CTRLA.bit.ENABLE = 0; while (EIC->SYNCBUSY.bit.ENABLE) {} + //Default port configuration + PORT->Group[DEBUG_BOOT_TRACING_PORT].DIRCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Input + PORT->Group[DEBUG_BOOT_TRACING_PORT].OUTCLR.reg = 1 << DEBUG_BOOT_TRACING_PIN; //Low + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.INEN = 0; //Input Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PULLEN = 0; //Pull Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PINCFG[DEBUG_BOOT_TRACING_PIN].bit.PMUXEN = 0; //Mux Disable + PORT->Group[DEBUG_BOOT_TRACING_PORT].PMUX[DEBUG_BOOT_TRACING_PIN / 2].bit.PMUXO = 0; //Mux A + //Disable CLK_EIC_APB MCLK->APBAMASK.bit.EIC_ = 0; } @@ -162,4 +224,4 @@ void debug_code_disable(void) void debug_code_init(void) {} void debug_code_disable(void) {} -#endif //DEBUG_BOOT_TRACING +#endif //DEBUG_BOOT_TRACING_ENABLE diff --git a/tmk_core/protocol/arm_atsam/d51_util.h b/tmk_core/protocol/arm_atsam/d51_util.h index 7a35f7989f..71431942c7 100644 --- a/tmk_core/protocol/arm_atsam/d51_util.h +++ b/tmk_core/protocol/arm_atsam/d51_util.h @@ -20,37 +20,65 @@ along with this program. If not, see . #include "samd51j18a.h" -//TODO: PS: Should bring these ports out to keyboard level configuration - -//Debug LED PA27 -#define led_ena REG_PORT_DIRSET0 = 0x08000000 //PA27 Output -#define led_on REG_PORT_OUTSET0 = 0x08000000 //PA27 High -#define led_off REG_PORT_OUTCLR0 = 0x08000000 //PA27 Low - -//Debug Port PB30 -#define m15_ena REG_PORT_DIRSET1 = 0x40000000 //PB30 Output -#define m15_on REG_PORT_OUTSET1 = 0x40000000 //PB30 High -#define m15_off REG_PORT_OUTCLR1 = 0x40000000 //PB30 Low - -//Debug Port PB23 -#define m27_ena REG_PORT_DIRSET1 = 0x800000 //PB23 Output -#define m27_on REG_PORT_OUTSET1 = 0x800000 //PB23 High -#define m27_off REG_PORT_OUTCLR1 = 0x800000 //PB23 Low - -//Debug Port PB31 -#define m28_ena REG_PORT_DIRSET1 = 0x80000000 //PB31 Output -#define m28_on REG_PORT_OUTSET1 = 0x80000000 //PB31 High -#define m28_off REG_PORT_OUTCLR1 = 0x80000000 //PB31 Low - -#define m15_loop(M15X) {uint8_t M15L=M15X; while(M15L--){m15_on;CLK_delay_us(1);m15_off;}} +/* Debug LED */ +#if DEBUG_LED_ENABLE == 1 +#define DBG_LED_ENA PORT->Group[DEBUG_LED_PORT].DIRSET.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_DIS PORT->Group[DEBUG_LED_PORT].DIRCLR.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_ON PORT->Group[DEBUG_LED_PORT].OUTSET.reg = (1 << DEBUG_LED_PIN) +#define DBG_LED_OFF PORT->Group[DEBUG_LED_PORT].OUTCLR.reg = (1 << DEBUG_LED_PIN) +#else +#define DBG_LED_ENA +#define DBG_LED_DIS +#define DBG_LED_ON +#define DBG_LED_OFF +#endif + +/* Debug Port 1 */ +#if DEBUG_PORT1_ENABLE == 1 +#define DBG_1_ENA PORT->Group[DEBUG_PORT1_PORT].DIRSET.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_DIS PORT->Group[DEBUG_PORT1_PORT].DIRCLR.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_ON PORT->Group[DEBUG_PORT1_PORT].OUTSET.reg = (1 << DEBUG_PORT1_PIN) +#define DBG_1_OFF PORT->Group[DEBUG_PORT1_PORT].OUTCLR.reg = (1 << DEBUG_PORT1_PIN) +#else +#define DBG_1_ENA +#define DBG_1_DIS +#define DBG_1_ON +#define DBG_1_OFF +#endif + +/* Debug Port 2 */ +#if DEBUG_PORT2_ENABLE == 1 +#define DBG_2_ENA PORT->Group[DEBUG_PORT2_PORT].DIRSET.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_DIS PORT->Group[DEBUG_PORT2_PORT].DIRCLR.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_ON PORT->Group[DEBUG_PORT2_PORT].OUTSET.reg = (1 << DEBUG_PORT2_PIN) +#define DBG_2_OFF PORT->Group[DEBUG_PORT2_PORT].OUTCLR.reg = (1 << DEBUG_PORT2_PIN) +#else +#define DBG_2_ENA +#define DBG_2_DIS +#define DBG_2_ON +#define DBG_2_OFF +#endif + +/* Debug Port 3 */ +#if DEBUG_PORT3_ENABLE == 1 +#define DBG_3_ENA PORT->Group[DEBUG_PORT3_PORT].DIRSET.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_DIS PORT->Group[DEBUG_PORT3_PORT].DIRCLR.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_ON PORT->Group[DEBUG_PORT3_PORT].OUTSET.reg = (1 << DEBUG_PORT3_PIN) +#define DBG_3_OFF PORT->Group[DEBUG_PORT3_PORT].OUTCLR.reg = (1 << DEBUG_PORT3_PIN) +#else +#define DBG_3_ENA +#define DBG_3_DIS +#define DBG_3_ON +#define DBG_3_OFF +#endif -void m15_print(uint32_t x); +void dbg_print(uint32_t x); void dled_print(uint32_t x, uint8_t long_pause); void debug_code_init(void); void debug_code_disable(void); -#ifdef DEBUG_BOOT_TRACING +#ifdef DEBUG_BOOT_TRACING_ENABLE #define DBGC(n) debug_code = n @@ -190,6 +218,6 @@ enum debug_code_list { #define DBGC(n) {} -#endif //DEBUG_BOOT_TRACING +#endif //DEBUG_BOOT_TRACING_ENABLE #endif //_D51_UTIL_H_ diff --git a/tmk_core/protocol/arm_atsam/i2c_master.c b/tmk_core/protocol/arm_atsam/i2c_master.c index ece9ee5db8..f608a79cc9 100644 --- a/tmk_core/protocol/arm_atsam/i2c_master.c +++ b/tmk_core/protocol/arm_atsam/i2c_master.c @@ -267,8 +267,8 @@ uint8_t I2C3733_Init_Control(void) CLK_delay_ms(1); - srdata.bit.IRST = 0; - SPI_WriteSRData(); + sr_exp_data.bit.IRST = 0; + SR_EXP_WriteData(); CLK_delay_ms(1); @@ -357,8 +357,8 @@ void I2C3733_Control_Set(uint8_t state) { DBGC(DC_I2C3733_CONTROL_SET_BEGIN); - srdata.bit.SDB_N = (state == 1 ? 1 : 0); - SPI_WriteSRData(); + sr_exp_data.bit.SDB_N = (state == 1 ? 1 : 0); + SR_EXP_WriteData(); DBGC(DC_I2C3733_CONTROL_SET_COMPLETE); } @@ -489,7 +489,7 @@ uint8_t i2c_led_q_request_room(uint8_t request_size) if (i2c_led_q_full >= 100) //Give the queue a chance to clear up { - led_on; + DBG_LED_ON; I2C_DMAC_LED_Init(); i2c_led_q_init(); return 1; diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 729e042a6e..e914fc80ea 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -520,9 +520,9 @@ void led_matrix_task(void) //Process more data if not finished if (led_cur != lede) { - //m15_off; //debug profiling + //DBG_1_OFF; //debug profiling led_matrix_run(); - //m15_on; //debug profiling + //DBG_1_ON; //debug profiling } } diff --git a/tmk_core/protocol/arm_atsam/main_arm_atsam.c b/tmk_core/protocol/arm_atsam/main_arm_atsam.c index 13034a05d1..2bda7d7c7b 100644 --- a/tmk_core/protocol/arm_atsam/main_arm_atsam.c +++ b/tmk_core/protocol/arm_atsam/main_arm_atsam.c @@ -247,8 +247,13 @@ void main_subtasks(void) int main(void) { - led_ena; - m15_ena; + DBG_LED_ENA; + DBG_1_ENA; + DBG_1_OFF; + DBG_2_ENA; + DBG_2_OFF; + DBG_3_ENA; + DBG_3_OFF; debug_code_init(); @@ -256,7 +261,7 @@ int main(void) ADC0_init(); - SPI_Init(); + SR_EXP_Init(); i2c1_init(); @@ -274,8 +279,7 @@ int main(void) while (USB2422_Port_Detect_Init() == 0) {} - led_off; - m15_off; + DBG_LED_OFF; led_matrix_init(); diff --git a/tmk_core/protocol/arm_atsam/spi.c b/tmk_core/protocol/arm_atsam/spi.c index 6036a92204..e275ba13f4 100644 --- a/tmk_core/protocol/arm_atsam/spi.c +++ b/tmk_core/protocol/arm_atsam/spi.c @@ -17,73 +17,70 @@ along with this program. If not, see . #include "arm_atsam_protocol.h" -Srdata_t srdata; +sr_exp_t sr_exp_data; -void SPI_WriteSRData(void) +void SR_EXP_WriteData(void) { - uint16_t timeout; + SR_EXP_RCLK_LO; - SC2_RCLCK_LO; + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.DRE)) { DBGC(DC_SPI_WRITE_DRE); } - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.DRE) && --timeout) { DBGC(DC_SPI_WRITE_DRE); } + SR_EXP_SERCOM->SPI.DATA.bit.DATA = sr_exp_data.reg & 0xFF; //Shift in bits 7-0 + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.TXC)) { DBGC(DC_SPI_WRITE_TXC_1); } - SCSPI->SPI.DATA.bit.DATA = srdata.reg & 0xFF; //Shift in bits 7-0 - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_1); } + SR_EXP_SERCOM->SPI.DATA.bit.DATA = (sr_exp_data.reg >> 8) & 0xFF; //Shift in bits 15-8 + while (!(SR_EXP_SERCOM->SPI.INTFLAG.bit.TXC)) { DBGC(DC_SPI_WRITE_TXC_2); } - SCSPI->SPI.DATA.bit.DATA = (srdata.reg >> 8) & 0xFF; //Shift in bits 15-8 - timeout = 50000; - while (!(SCSPI->SPI.INTFLAG.bit.TXC) && --timeout) { DBGC(DC_SPI_WRITE_TXC_2); } - - SC2_RCLCK_HI; + SR_EXP_RCLK_HI; } -void SPI_Init(void) +void SR_EXP_Init(void) { - uint32_t timeout; - DBGC(DC_SPI_INIT_BEGIN); CLK_set_spi_freq(CHAN_SERCOM_SPI, FREQ_SPI_DEFAULT); - PORT->Group[0].PMUX[6].bit.PMUXE = 2; - PORT->Group[0].PMUX[6].bit.PMUXO = 2; - PORT->Group[0].PINCFG[12].bit.PMUXEN = 1; - PORT->Group[0].PINCFG[13].bit.PMUXEN = 1; - - //Configure Shift Registers - SC2_DIRSET; - SC2_RCLCK_HI; - SC2_OE_DIS; - - SCSPI->SPI.CTRLA.bit.DORD = 1; - SCSPI->SPI.CTRLA.bit.CPOL = 1; - SCSPI->SPI.CTRLA.bit.CPHA = 1; - SCSPI->SPI.CTRLA.bit.DIPO = 3; - SCSPI->SPI.CTRLA.bit.MODE = 3; //master - - SCSPI->SPI.CTRLA.bit.ENABLE = 1; - timeout = 50000; - while (SCSPI->SPI.SYNCBUSY.bit.ENABLE && timeout--) { DBGC(DC_SPI_SYNC_ENABLING); } - - srdata.reg = 0; - srdata.bit.HUB_CONNECT = 0; - srdata.bit.HUB_RESET_N = 0; - srdata.bit.S_UP = 0; - srdata.bit.E_UP_N = 1; - srdata.bit.S_DN1 = 1; - srdata.bit.E_DN1_N = 1; - srdata.bit.E_VBUS_1 = 0; - srdata.bit.E_VBUS_2 = 0; - srdata.bit.SRC_1 = 1; - srdata.bit.SRC_2 = 1; - srdata.bit.IRST = 1; - srdata.bit.SDB_N = 0; - SPI_WriteSRData(); - - //Enable register output - SC2_OE_ENA; + //Set up MCU Shift Register pins + PORT->Group[SR_EXP_RCLK_PORT].DIRSET.reg = (1 << SR_EXP_RCLK_PIN); + PORT->Group[SR_EXP_OE_N_PORT].DIRSET.reg = (1 << SR_EXP_OE_N_PIN); + + //Set up MCU SPI pins + PORT->Group[SR_EXP_DATAOUT_PORT].PMUX[SR_EXP_DATAOUT_PIN / 2].bit.SR_EXP_DATAOUT_MUX_SEL = SR_EXP_DATAOUT_MUX; //MUX select for sercom + PORT->Group[SR_EXP_SCLK_PORT].PMUX[SR_EXP_SCLK_PIN / 2].bit.SR_EXP_SCLK_MUX_SEL = SR_EXP_SCLK_MUX; //MUX select for sercom + PORT->Group[SR_EXP_DATAOUT_PORT].PINCFG[SR_EXP_DATAOUT_PIN].bit.PMUXEN = 1; //MUX Enable + PORT->Group[SR_EXP_SCLK_PORT].PINCFG[SR_EXP_SCLK_PIN].bit.PMUXEN = 1; //MUX Enable + + //Initialize Shift Register + SR_EXP_OE_N_DIS; + SR_EXP_RCLK_HI; + + SR_EXP_SERCOM->SPI.CTRLA.bit.DORD = 1; //Data Order - LSB is transferred first + SR_EXP_SERCOM->SPI.CTRLA.bit.CPOL = 1; //Clock Polarity - SCK high when idle. Leading edge of cycle is falling. Trailing rising. + SR_EXP_SERCOM->SPI.CTRLA.bit.CPHA = 1; //Clock Phase - Leading Edge Falling, change, Trailing Edge - Rising, sample + SR_EXP_SERCOM->SPI.CTRLA.bit.DIPO = 3; //Data In Pinout - SERCOM PAD[3] is used as data input (Configure away from DOPO. Not using input.) + SR_EXP_SERCOM->SPI.CTRLA.bit.DOPO = 0; //Data Output PAD[0], Serial Clock PAD[1] + SR_EXP_SERCOM->SPI.CTRLA.bit.MODE = 3; //Operating Mode - Master operation + + SR_EXP_SERCOM->SPI.CTRLA.bit.ENABLE = 1; //Enable - Peripheral is enabled or being enabled + while (SR_EXP_SERCOM->SPI.SYNCBUSY.bit.ENABLE) { DBGC(DC_SPI_SYNC_ENABLING); } + + sr_exp_data.reg = 0; + sr_exp_data.bit.HUB_CONNECT = 0; + sr_exp_data.bit.HUB_RESET_N = 0; + sr_exp_data.bit.S_UP = 0; + sr_exp_data.bit.E_UP_N = 1; + sr_exp_data.bit.S_DN1 = 1; + sr_exp_data.bit.E_DN1_N = 1; + sr_exp_data.bit.E_VBUS_1 = 0; + sr_exp_data.bit.E_VBUS_2 = 0; + sr_exp_data.bit.SRC_1 = 1; + sr_exp_data.bit.SRC_2 = 1; + sr_exp_data.bit.IRST = 1; + sr_exp_data.bit.SDB_N = 0; + SR_EXP_WriteData(); + + //Enable Shift Register output + SR_EXP_OE_N_ENA; DBGC(DC_SPI_INIT_COMPLETE); } diff --git a/tmk_core/protocol/arm_atsam/spi.h b/tmk_core/protocol/arm_atsam/spi.h index 3412dfc364..4739b775db 100644 --- a/tmk_core/protocol/arm_atsam/spi.h +++ b/tmk_core/protocol/arm_atsam/spi.h @@ -18,21 +18,28 @@ along with this program. If not, see . #ifndef _SPI_H_ #define _SPI_H_ -//TODO: PS: Should bring ports to keyboard configuration +/* Macros for Shift Register control */ +#define SR_EXP_RCLK_LO PORT->Group[SR_EXP_RCLK_PORT].OUTCLR.reg = (1 << SR_EXP_RCLK_PIN) +#define SR_EXP_RCLK_HI PORT->Group[SR_EXP_RCLK_PORT].OUTSET.reg = (1 << SR_EXP_RCLK_PIN) +#define SR_EXP_OE_N_ENA PORT->Group[SR_EXP_OE_N_PORT].OUTCLR.reg = (1 << SR_EXP_OE_N_PIN) +#define SR_EXP_OE_N_DIS PORT->Group[SR_EXP_OE_N_PORT].OUTSET.reg = (1 << SR_EXP_OE_N_PIN) -#define SCSPI SERCOM2 +/* Determine bits to set for mux selection */ +#if SR_EXP_DATAOUT_PIN % 2 == 0 +#define SR_EXP_DATAOUT_MUX_SEL PMUXE +#else +#define SR_EXP_DATAOUT_MUX_SEL PMUXO +#endif -#define P14_DIR 0x00004000 /* PIN14 DIR Bit */ -#define P14_OUT 0x00004000 /* PIN14 OUT Bit */ -#define P15_DIR 0x00008000 /* PIN15 DIR Bit */ -#define P15_OUT 0x00008000 /* PIN15 OUT Bit */ - -#define SC2_RCLCK_LO REG_PORT_OUTCLR1 = P14_OUT /* PB14 Low, SC2_RCLCK Low */ -#define SC2_RCLCK_HI REG_PORT_OUTSET1 = P14_OUT /* PB14 High, SC2_RCLCK High */ -#define SC2_OE_ENA REG_PORT_OUTCLR1 = P15_OUT /* PB15 Low, SC2_OE_N Low (Shift register enabled) */ -#define SC2_OE_DIS REG_PORT_OUTSET1 = P15_OUT /* PB15 High, SC2_OE_N High (Shift register disabled) */ -#define SC2_DIRSET REG_PORT_DIRSET1 = P14_DIR | P15_DIR; /* PB14 PB15 OUT */ +/* Determine bits to set for mux selection */ +#if SR_EXP_SCLK_PIN % 2 == 0 +#define SR_EXP_SCLK_MUX_SEL PMUXE +#else +#define SR_EXP_SCLK_MUX_SEL PMUXO +#endif +/* Data structure to define Shift Register output expander hardware */ +/* This structure gets shifted into registers LSB first */ typedef union { struct { uint16_t RSVD4:1; /*!< bit: 0 */ @@ -53,11 +60,11 @@ typedef union { uint16_t HUB_CONNECT:1; /*!< bit: 15 SIGNAL VBUS CONNECT TO USB HUB WHEN 1 */ } bit; /*!< Structure used for bit access */ uint16_t reg; /*!< Type used for register access */ -} Srdata_t; +} sr_exp_t; -extern Srdata_t srdata; +extern sr_exp_t sr_exp_data; -void SPI_WriteSRData(void); -void SPI_Init(void); +void SR_EXP_WriteData(void); +void SR_EXP_Init(void); #endif //_SPI_H_ diff --git a/tmk_core/protocol/arm_atsam/usb/usb2422.c b/tmk_core/protocol/arm_atsam/usb/usb2422.c index 7c78e41d49..ac19bf4ea0 100644 --- a/tmk_core/protocol/arm_atsam/usb/usb2422.c +++ b/tmk_core/protocol/arm_atsam/usb/usb2422.c @@ -77,7 +77,6 @@ void USB2422_init(void) Port *pport = PORT; Oscctrl *posc = OSCCTRL; Usb *pusb = USB; - Srdata_t *pspi = &srdata; DBGC(DC_USB2422_INIT_BEGIN); @@ -132,9 +131,9 @@ void USB2422_init(void) i2c0_init(); //IC2 clk must be high at USB2422 reset release time to signal SMB configuration - pspi->bit.HUB_CONNECT = 1; //connect signal - pspi->bit.HUB_RESET_N = 1; //reset high - SPI_WriteSRData(); + sr_exp_data.bit.HUB_CONNECT = 1; //connect signal + sr_exp_data.bit.HUB_RESET_N = 1; //reset high + SR_EXP_WriteData(); CLK_delay_us(100); @@ -150,16 +149,14 @@ void USB2422_init(void) void USB_reset(void) { - Srdata_t *pspi = &srdata; - DBGC(DC_USB_RESET_BEGIN); //pulse reset for at least 1 usec - pspi->bit.HUB_RESET_N = 0; //reset low - SPI_WriteSRData(); + sr_exp_data.bit.HUB_RESET_N = 0; //reset low + SR_EXP_WriteData(); CLK_delay_us(1); - pspi->bit.HUB_RESET_N = 1; //reset high to run - SPI_WriteSRData(); + sr_exp_data.bit.HUB_RESET_N = 1; //reset high to run + SR_EXP_WriteData(); CLK_delay_us(1); DBGC(DC_USB_RESET_COMPLETE); @@ -241,14 +238,14 @@ void USB_set_host_by_voltage(void) #ifndef MD_BOOTLOADER usb_extra_state = USB_EXTRA_STATE_UNKNOWN; #endif //MD_BOOTLOADER - srdata.bit.SRC_1 = 1; //USBC-1 available for test - srdata.bit.SRC_2 = 1; //USBC-2 available for test - srdata.bit.E_UP_N = 1; //HOST disable - srdata.bit.E_DN1_N = 1; //EXTRA disable - srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O - srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + sr_exp_data.bit.SRC_1 = 1; //USBC-1 available for test + sr_exp_data.bit.SRC_2 = 1; //USBC-2 available for test + sr_exp_data.bit.E_UP_N = 1; //HOST disable + sr_exp_data.bit.E_DN1_N = 1; //EXTRA disable + sr_exp_data.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); CLK_delay_ms(250); @@ -262,37 +259,37 @@ void USB_set_host_by_voltage(void) if (v_con_1 > v_con_2) { - srdata.bit.S_UP = 0; //HOST to USBC-1 - srdata.bit.S_DN1 = 1; //EXTRA to USBC-2 - srdata.bit.SRC_1 = 1; //HOST on USBC-1 - srdata.bit.SRC_2 = 0; //EXTRA available on USBC-2 + sr_exp_data.bit.S_UP = 0; //HOST to USBC-1 + sr_exp_data.bit.S_DN1 = 1; //EXTRA to USBC-2 + sr_exp_data.bit.SRC_1 = 1; //HOST on USBC-1 + sr_exp_data.bit.SRC_2 = 0; //EXTRA available on USBC-2 - srdata.bit.E_VBUS_1 = 1; //USBC-1 enable full power I/O - srdata.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O + sr_exp_data.bit.E_VBUS_1 = 1; //USBC-1 enable full power I/O + sr_exp_data.bit.E_VBUS_2 = 0; //USBC-2 disable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); - srdata.bit.E_UP_N = 0; //HOST enable + sr_exp_data.bit.E_UP_N = 0; //HOST enable - SPI_WriteSRData(); + SR_EXP_WriteData(); usb_host_port = USB_HOST_PORT_1; } else { - srdata.bit.S_UP = 1; //EXTRA to USBC-1 - srdata.bit.S_DN1 = 0; //HOST to USBC-2 - srdata.bit.SRC_1 = 0; //EXTRA available on USBC-1 - srdata.bit.SRC_2 = 1; //HOST on USBC-2 + sr_exp_data.bit.S_UP = 1; //EXTRA to USBC-1 + sr_exp_data.bit.S_DN1 = 0; //HOST to USBC-2 + sr_exp_data.bit.SRC_1 = 0; //EXTRA available on USBC-1 + sr_exp_data.bit.SRC_2 = 1; //HOST on USBC-2 - srdata.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O - srdata.bit.E_VBUS_2 = 1; //USBC-2 enable full power I/O + sr_exp_data.bit.E_VBUS_1 = 0; //USBC-1 disable full power I/O + sr_exp_data.bit.E_VBUS_2 = 1; //USBC-2 enable full power I/O - SPI_WriteSRData(); + SR_EXP_WriteData(); - srdata.bit.E_UP_N = 0; //HOST enable + sr_exp_data.bit.E_UP_N = 0; //HOST enable - SPI_WriteSRData(); + SR_EXP_WriteData(); usb_host_port = USB_HOST_PORT_2; } @@ -325,15 +322,15 @@ uint8_t USB2422_Port_Detect_Init(void) if (v_con_1 > v_con_2) //Values updated from USB_set_host_by_voltage(); { //1 flash for port 1 detected - if (tmod > 500 && tmod < 600) { led_on; } - else { led_off; } + if (tmod > 500 && tmod < 600) { DBG_LED_ON; } + else { DBG_LED_OFF; } } else if (v_con_2 > v_con_1) //Values updated from USB_set_host_by_voltage(); { //2 flash for port 2 detected - if (tmod > 500 && tmod < 600) { led_on; } - else if (tmod > 700 && tmod < 800) { led_on; } - else { led_off; } + if (tmod > 500 && tmod < 600) { DBG_LED_ON; } + else if (tmod > 700 && tmod < 800) { DBG_LED_ON; } + else { DBG_LED_OFF; } } if (CLK_get_ms() > port_detect_retry_ms) @@ -357,12 +354,12 @@ void USB_ExtraSetState(uint8_t state) if (state == USB_EXTRA_STATE_DISABLED_UNTIL_REPLUG) state = USB_EXTRA_STATE_DISABLED; - if (usb_host_port == USB_HOST_PORT_1) srdata.bit.E_VBUS_2 = state; - else if (usb_host_port == USB_HOST_PORT_2) srdata.bit.E_VBUS_1 = state; + if (usb_host_port == USB_HOST_PORT_1) sr_exp_data.bit.E_VBUS_2 = state; + else if (usb_host_port == USB_HOST_PORT_2) sr_exp_data.bit.E_VBUS_1 = state; else return; - srdata.bit.E_DN1_N = !state; - SPI_WriteSRData(); + sr_exp_data.bit.E_DN1_N = !state; + SR_EXP_WriteData(); usb_extra_state = state_save; -- cgit v1.2.3 From e5380795b9a0b554673449675630062be3b09573 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 10 Dec 2018 11:38:57 -0800 Subject: Fix the LFKeyboards so they work with the QMK Configurator (#4591) * Make layer_info weak so it works with QMK Configurator * Fix lfk87 compile issue * Add fixes for lfkpad --- .../lfkeyboards/lfk78/keymaps/ca178858/rules.mk | 13 ------ .../lfkeyboards/lfk78/keymaps/default/rules.mk | 17 +------- keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk | 14 +------ .../lfk78/keymaps/split_bs_osx/rules.mk | 18 +------- keyboards/lfkeyboards/lfk78/lfk78.c | 9 ++++ keyboards/lfkeyboards/lfk78/rules.mk | 49 ++++++++++++++++++++++ .../lfkeyboards/lfk87/keymaps/ca178858/rules.mk | 11 ----- .../lfkeyboards/lfk87/keymaps/default/rules.mk | 11 ----- keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk | 13 ------ keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk | 11 ----- keyboards/lfkeyboards/lfk87/lfk87.c | 9 ++++ keyboards/lfkeyboards/lfk87/rules.mk | 34 +++++++++++++++ .../lfkeyboards/lfkpad/keymaps/default/rules.mk | 13 +----- keyboards/lfkeyboards/lfkpad/rules.mk | 28 +++++++++++++ .../lfkeyboards/mini1800/keymaps/ca178858/rules.mk | 3 -- .../lfkeyboards/mini1800/keymaps/default/rules.mk | 4 -- keyboards/lfkeyboards/mini1800/mini1800.c | 10 +++++ 17 files changed, 143 insertions(+), 124 deletions(-) diff --git a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk index 394c58b37e..98e3d5a78b 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/ca178858/rules.mk @@ -23,19 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired # # # # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight diff --git a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk index 555ad97230..1477c3ac77 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,21 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms CAPSLOCK_LED = no # Toggle back light LED of Caps Lock -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - -ifeq ($(strip $(CAPSLOCK_LED)), yes) - TMK_COMMON_DEFS += -DCAPSLOCK_LED -endif # Override the LFK78 hardware version: # diff --git a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk index 147e95bc87..3cfc994cb8 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/iso/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,18 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this mu WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired # # diff --git a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk index 555ad97230..f789b6866b 100644 --- a/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk +++ b/keyboards/lfkeyboards/lfk78/keymaps/split_bs_osx/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = yes # Audio output on port C6 UNICODE_ENABLE = no # Unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,22 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms CAPSLOCK_LED = no # Toggle back light LED of Caps Lock -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - -ifeq ($(strip $(CAPSLOCK_LED)), yes) - TMK_COMMON_DEFS += -DCAPSLOCK_LED -endif - # Override the LFK78 hardware version: # # B - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight diff --git a/keyboards/lfkeyboards/lfk78/lfk78.c b/keyboards/lfkeyboards/lfk78/lfk78.c index e02739e4f5..60b7ab4ce0 100644 --- a/keyboards/lfkeyboards/lfk78/lfk78.c +++ b/keyboards/lfkeyboards/lfk78/lfk78.c @@ -13,6 +13,15 @@ uint16_t click_hz = CLICK_HZ; uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x0000, 0x0FFF, 0x0000}}, // base layer - green + {0x00000002, 0xFFFFFFFE, {0x0000, 0x0000, 0x0FFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0x0FFF, 0x0000, 0x0FFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0x0FFF, 0x0FFF, 0x0FFF}}, // unknown layer - REQUIRED - white +}; + void matrix_init_kb(void) { matrix_init_user(); diff --git a/keyboards/lfkeyboards/lfk78/rules.mk b/keyboards/lfkeyboards/lfk78/rules.mk index 091cd77556..cc314c97a2 100644 --- a/keyboards/lfkeyboards/lfk78/rules.mk +++ b/keyboards/lfkeyboards/lfk78/rules.mk @@ -32,3 +32,52 @@ F_USB = $(F_CPU) # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms +CAPSLOCK_LED = no # Toggle back light LED of Caps Lock + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + TMK_COMMON_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + TMK_COMMON_DEFS += -DWATCHDOG_ENABLE +endif + +ifeq ($(strip $(CAPSLOCK_LED)), yes) + TMK_COMMON_DEFS += -DCAPSLOCK_LED +endif + +# # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired +# # +# # RevB - first public release, uses atmega32u4, has audio, ISSI matrix split between RGB and backlight +# # RevC/D - at90usb1286, no audio, ISSI device 0 is backlight, 4 is RGB +# # +# # Set to B, C or D +# LFK_REV = D + +# ifeq ($(LFK_REV), B) +# MCU = atmega32u4 +# else +# MCU = at90usb1286 +# endif +# OPT_DEFS += -DLFK_REV_$(LFK_REV) +# OPT_DEFS += -DUSB_PRODUCT=\"LFK_Rev$(LFK_REV)\" diff --git a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk index 9819cdbee2..f28ec80ea7 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/ca178858/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk index c1f1070fd6..c079c264ed 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/default/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # Override the LFK87 hardware version. diff --git a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk index c1f1070fd6..f7b39455b4 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/gbchk/rules.mk @@ -23,19 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif - - # Override the LFK87 hardware version. # # A - Green PCB. at90usb1286 Only 3 exist diff --git a/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk b/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk index 68e200a5de..7823dea787 100644 --- a/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk +++ b/keyboards/lfkeyboards/lfk87/keymaps/iso/rules.mk @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install thi WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfk87/lfk87.c b/keyboards/lfkeyboards/lfk87/lfk87.c index e9f184e36f..4b34fcef7e 100644 --- a/keyboards/lfkeyboards/lfk87/lfk87.c +++ b/keyboards/lfkeyboards/lfk87/lfk87.c @@ -14,6 +14,15 @@ uint16_t click_hz = CLICK_HZ; uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x00, 0xFF, 0x00}}, // base layers - green + {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0xFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0xFF, 0x00, 0xFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white +}; + void matrix_init_kb(void) { // put your keyboard start-up code here diff --git a/keyboards/lfkeyboards/lfk87/rules.mk b/keyboards/lfkeyboards/lfk87/rules.mk index 19b41de096..c10f473065 100644 --- a/keyboards/lfkeyboards/lfk87/rules.mk +++ b/keyboards/lfkeyboards/lfk87/rules.mk @@ -31,3 +31,37 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT LAYOUTS = tkl_ansi tkl_iso + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +AUDIO_ENABLE = yes # Audio output on port C6 +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes # Enable RGB underlight +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not WS2812 +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms + + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + OPT_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + OPT_DEFS += -DWATCHDOG_ENABLE +endif diff --git a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk index 1653f4e302..cc21b32dce 100644 --- a/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/keymaps/default/rules.mk @@ -14,7 +14,7 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = no @@ -23,17 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this mu WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -ifeq ($(strip $(ISSI_ENABLE)), yes) - TMK_COMMON_DEFS += -DISSI_ENABLE -endif - -ifeq ($(strip $(WATCHDOG_ENABLE)), yes) - TMK_COMMON_DEFS += -DWATCHDOG_ENABLE -endif # # Set the LFK78 hardware version. This is defined in rules.mk, but can be overidden here if desired diff --git a/keyboards/lfkeyboards/lfkpad/rules.mk b/keyboards/lfkeyboards/lfkpad/rules.mk index e28e398cc8..83553f64cb 100644 --- a/keyboards/lfkeyboards/lfkpad/rules.mk +++ b/keyboards/lfkeyboards/lfkpad/rules.mk @@ -11,3 +11,31 @@ ARCH = AVR8 OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT LAYOUTS = numpad_6x4 + +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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 = yes # Enable WS2812 RGB underlight. +RGBLIGHT_CUSTOM_DRIVER = yes # RGB code is implemented in lefkeyboards, not qmk base +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +TAP_DANCE_ENABLE = no + +ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be disabled +WATCHDOG_ENABLE = no # Resets keyboard if matrix_scan isn't run every 250ms + + +ifeq ($(strip $(ISSI_ENABLE)), yes) + TMK_COMMON_DEFS += -DISSI_ENABLE +endif + +ifeq ($(strip $(WATCHDOG_ENABLE)), yes) + TMK_COMMON_DEFS += -DWATCHDOG_ENABLE +endif diff --git a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk index 16452df677..2c6035d583 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk +++ b/keyboards/lfkeyboards/mini1800/keymaps/ca178858/rules.mk @@ -23,9 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE diff --git a/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk b/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk index d6e35e3537..1598173f36 100644 --- a/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk +++ b/keyboards/lfkeyboards/mini1800/keymaps/default/rules.mk @@ -23,10 +23,6 @@ ISSI_ENABLE = yes # If the I2C pullup resistors aren't install this must be di WATCHDOG_ENABLE = yes # Resets keyboard if matrix_scan isn't run every 250ms -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - ifeq ($(strip $(ISSI_ENABLE)), yes) TMK_COMMON_DEFS += -DISSI_ENABLE endif diff --git a/keyboards/lfkeyboards/mini1800/mini1800.c b/keyboards/lfkeyboards/mini1800/mini1800.c index f0692d46c7..d5f4193c1d 100644 --- a/keyboards/lfkeyboards/mini1800/mini1800.c +++ b/keyboards/lfkeyboards/mini1800/mini1800.c @@ -17,6 +17,16 @@ uint16_t click_time = CLICK_MS; uint8_t click_toggle = CLICK_ENABLED; float my_song[][2] = SONG(ZELDA_PUZZLE); +// Colors of the layer indicator LED +// This list needs to define layer 0xFFFFFFFF, it is the end of the list, and the unknown layer +__attribute__((weak)) +const Layer_Info layer_info[] = { + // Layer Mask Red Green Blue + {0x00000000, 0xFFFFFFFF, {0x00, 0xFF, 0x00}}, // base layers - green + {0x00000002, 0xFFFFFFFE, {0x00, 0x00, 0xFF}}, // function layer - blue + {0x00000004, 0xFFFFFFFC, {0xFF, 0x00, 0xFF}}, // settings layer - magenta + {0xFFFFFFFF, 0xFFFFFFFF, {0xFF, 0xFF, 0xFF}}, // unknown layer - REQUIRED - white +}; void matrix_init_kb(void) { -- cgit v1.2.3 From 3bef186ea6ba9da445a16d2ff72d2737e1d7c974 Mon Sep 17 00:00:00 2001 From: "Peter K. Cawley" Date: Mon, 10 Dec 2018 16:15:15 -0800 Subject: adjust install_avr function to use unzip for broader compatibility (#4596) On a laptop with god knows what mandatory security software (Cylance?), running up-to-date Windows 10 with msys2 mingw-64, attempting to install the AVR toolkit results in the following error: ``` 1 [main] 7z (13316) C:\msys32\usr\lib\p7zip\7z.exe: *** fatal error - cygheap base mismatch detected - 0x612A5410/0x2375410. This problem is probably due to using incompatible versions of the cygwin DLL. Search for cygwin1.dll using the Windows Start->Find/Search facility and delete all but the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution. Rebooting is also suggested if you are unable to find another cygwin DLL. ``` This appears to be related in some way, based on my research, to ASLR functionality in security software. Since I'm unable to override whatever is enforcing ASLR on my system, after trying several other approaches (removing other copies of msys-2.0.dll, which is what this is apparently actually referencing, rebasing that file in Windows to address 0x61000000, a few other things) I simply edited the installation shell script to use `unzip` instead of 7zip; `unzip`'s binary does not provoke a mismatch error and the installation proceeds as it should. I'm not aware of the reason why some parts of the install script use `unzip` (e.g. `install_arm`) and others use 7zip, but it seems that for broader compatibility and sparing users on locked down machines the 120 minutes or so of futzing this took me to fix, it might be better to just use `unzip` in all cases. Note: There is another function that uses 7zip, `extract_flip`. The line is `7z -oflip x FlipInstaller.exe`. I'm not sure what this is doing, or whether it's possible to do it with `unzip`, but it produces the same error. I haven't attempted to fix that in this PR, but it might be good to fix it for the same reason. --- util/msys2_install.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/msys2_install.sh b/util/msys2_install.sh index a0548ad9bc..fcb4882494 100755 --- a/util/msys2_install.sh +++ b/util/msys2_install.sh @@ -14,8 +14,9 @@ source "$dir/win_shared_install.sh" function install_avr { rm -f -r "$avrtools" wget "http://ww1.microchip.com/downloads/en/DeviceDoc/avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip" - 7z x avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip - mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain + echo "Extracting AVR toolchain..." + unzip -q avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip + mv avr8-gnu-toolchain-win32_x86/ avr8-gnu-toolchain rm __MACOSX -R rm avr8-gnu-toolchain-3.6.1.1752-win32.any.x86.zip pacman --needed -S mingw-w64-x86_64-avrdude -- cgit v1.2.3 From a003be1e9c195a4e1d74e563eaf261eec0e9a50b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 11 Dec 2018 00:19:55 -0800 Subject: handwired/pilcrow Refactor, Configurator support and readme update (#4602) * handwired/pilcrow: refactor - layout macro renamed from KEYMAP to LAYOUT - keymap now uses #include QMK_KEYBOARD_H - layers reformatted for readability - removed unused and deprecated fn_actions and action_get_macro blocks - keymap config.h - updated to use #pragma once - removed redundant config.h include * handwired/pilcrow: Configurator support * handwired/pilcrow: readme update Updated readme.md file to use modern template formatting. --- keyboards/handwired/pilcrow/info.json | 53 ++++++++++ .../handwired/pilcrow/keymaps/default/config.h | 7 +- .../handwired/pilcrow/keymaps/default/keymap.c | 116 +++++++++------------ keyboards/handwired/pilcrow/pilcrow.h | 2 +- keyboards/handwired/pilcrow/readme.md | 30 ++---- 5 files changed, 112 insertions(+), 96 deletions(-) create mode 100644 keyboards/handwired/pilcrow/info.json diff --git a/keyboards/handwired/pilcrow/info.json b/keyboards/handwired/pilcrow/info.json new file mode 100644 index 0000000000..824e2abbc5 --- /dev/null +++ b/keyboards/handwired/pilcrow/info.json @@ -0,0 +1,53 @@ +{ + "keyboard_name": "pilcrow", + "url": "", + "maintainer": "qmk", + "width": 10, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Q", "x":0, "y":0}, + {"label":"W", "x":1, "y":0}, + {"label":"E", "x":2, "y":0}, + {"label":"R", "x":3, "y":0}, + {"label":"T", "x":4, "y":0}, + {"label":"Y", "x":5, "y":0}, + {"label":"U", "x":6, "y":0}, + {"label":"I", "x":7, "y":0}, + {"label":"O", "x":8, "y":0}, + {"label":"P", "x":9, "y":0}, + {"label":"A", "x":0, "y":1}, + {"label":"S", "x":1, "y":1}, + {"label":"D", "x":2, "y":1}, + {"label":"F", "x":3, "y":1}, + {"label":"G", "x":4, "y":1}, + {"label":"H", "x":5, "y":1}, + {"label":"J", "x":6, "y":1}, + {"label":"K", "x":7, "y":1}, + {"label":"L", "x":8, "y":1}, + {"label":";", "x":9, "y":1}, + {"label":"Z", "x":0, "y":2}, + {"label":"X", "x":1, "y":2}, + {"label":"C", "x":2, "y":2}, + {"label":"V", "x":3, "y":2}, + {"label":"B", "x":4, "y":2}, + {"label":"N", "x":5, "y":2}, + {"label":"M", "x":6, "y":2}, + {"label":",", "x":7, "y":2}, + {"label":".", "x":8, "y":2}, + {"label":"/", "x":9, "y":2}, + {"label":"Ctrl", "x":0, "y":3}, + {"label":"Alt", "x":1, "y":3}, + {"label":"GUI", "x":2, "y":3}, + {"label":"MO(1)", "x":3, "y":3}, + {"label":"Space", "x":4, "y":3}, + {"label":"Shift / Space", "x":5, "y":3}, + {"label":"MO(2)", "x":6, "y":3}, + {"label":"MO(3)", "x":7, "y":3}, + {"label":"Delete", "x":8, "y":3}, + {"label":"Esc", "x":9, "y":3} + ] + } + } +} diff --git a/keyboards/handwired/pilcrow/keymaps/default/config.h b/keyboards/handwired/pilcrow/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/handwired/pilcrow/keymaps/default/config.h +++ b/keyboards/handwired/pilcrow/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/handwired/pilcrow/keymaps/default/keymap.c b/keyboards/handwired/pilcrow/keymaps/default/keymap.c index e382e4c6ad..617ff4f6cd 100644 --- a/keyboards/handwired/pilcrow/keymaps/default/keymap.c +++ b/keyboards/handwired/pilcrow/keymaps/default/keymap.c @@ -1,76 +1,58 @@ -#include "pilcrow.h" -#define _______ KC_TRNS -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( \ - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ - KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, MT(MOD_LSFT, KC_SPC), MO(2), MO(3), KC_DEL, KC_ESC \ -), - -/* Colemak - * ,-----------------------------------------------------------------------------------. - * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | Esc | A | R | S | T | D | H | N | E | I | O | " | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | - * `-----------------------------------------------------------------------------------' - */ -[1] = KEYMAP( \ - KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ - KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_PIPE, S(KC_QUOT), \ - _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_GRV \ -), -[2] = KEYMAP( \ - KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ - KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ - OSM(MOD_LSFT), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_BSLS, KC_QUOT, \ - _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_MNXT, KC_VOLD, KC_VOLU \ -), +#include QMK_KEYBOARD_H -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | | Reset| | | | | | | | | | Del | - * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | - * |------+------+------+------+------+------|------+------+------+------+------+------| - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[3] = KEYMAP( \ - RESET, KC_UP, _______, _______, _______, _______, _______, KC_MS_WH_DOWN, KC_MS_U, KC_MS_WH_UP, \ - KC_LEFT, KC_DOWN, KC_RIGHT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_MS_L,KC_MS_D, KC_MS_R, \ - RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, \ - _______, _______, _______, _______, KC_MS_BTN1, KC_MS_BTN2, _______, _______, _______, _______ \ -) -}; +#define SFT_SPC MT(MOD_LSFT, KC_SPC) -const uint16_t PROGMEM fn_actions[] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( \ + KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ + KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ + KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, \ + KC_LCTL, KC_LALT, KC_LGUI, MO(1), KC_SPC, SFT_SPC, MO(2), MO(3), KC_DEL, KC_ESC \ + ), -}; + /* Colemak + * ,-----------------------------------------------------------------------------------. + * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | R | S | T | D | H | N | E | I | O | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * |Adjust| Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ + [1] = LAYOUT( \ + KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, \ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, \ + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_PIPE, S(KC_QUOT), \ + _______, _______, _______, _______, KC_BSPC, KC_BSPC, _______, KC_MNXT, KC_VOLD, KC_GRV \ + ), + [2] = LAYOUT( \ + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, \ + KC_TAB, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, \ + OSM(MOD_LSFT), KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_BSLS, KC_QUOT, \ + _______, _______, _______, _______, KC_ENT, KC_ENT, _______, KC_MNXT, KC_VOLD, KC_VOLU \ + ), -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + [3] = LAYOUT( \ + RESET, KC_UP, _______, _______, _______, _______, _______, KC_WH_D, KC_MS_U, KC_WH_U, \ + KC_LEFT, KC_DOWN, KC_RGHT, AU_ON, AU_OFF, AG_NORM, AG_SWAP, KC_MS_L, KC_MS_D, KC_MS_R, \ + RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, \ + _______, _______, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, _______ \ + ) }; - void matrix_init_user(void) { } diff --git a/keyboards/handwired/pilcrow/pilcrow.h b/keyboards/handwired/pilcrow/pilcrow.h index 7138ccb3f6..37d2914f24 100644 --- a/keyboards/handwired/pilcrow/pilcrow.h +++ b/keyboards/handwired/pilcrow/pilcrow.h @@ -7,7 +7,7 @@ // The following is an example using the Planck MIT layout // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, \ diff --git a/keyboards/handwired/pilcrow/readme.md b/keyboards/handwired/pilcrow/readme.md index 7a7f6d2af5..79f22518e8 100644 --- a/keyboards/handwired/pilcrow/readme.md +++ b/keyboards/handwired/pilcrow/readme.md @@ -1,28 +1,14 @@ -pilcrow keyboard firmware -====================== +# pilcrow -## Quantum MK Firmware +![pilcrow](https://i.imgur.com/KQdn2kg.jpg) -For the full Quantum feature list, see [the parent readme](/). +A 4x10 ortholinear keyboard powered by a Teensy. -## Building +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Teensy-powered pilcrow -Download or clone the whole firmware and navigate to the keyboards/pilcrow folder. Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use the Teensy Loader to program your .hex file. +Make example for this keyboard (after setting up your build environment): -Depending on which keymap you would like to use, you will have to compile slightly differently. + make handwired/pilcrow:default -### Default - -To build with the default keymap, simply run `make default`. - -### Other Keymaps - -Several version of keymap are available in advance but you are recommended to define your favorite layout yourself. To define your own keymap create a folder with the name of your keymap in the keymaps folder, and see keymap documentation (you can find in top readme.md) and existant keymap files. - -To build the firmware binary hex file with a keymap just do `make` with a keymap like this: - -``` -$ make [default|jack|] -``` - -Keymaps follow the format **__\.c__** and are stored in the `keymaps` folder. +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). -- cgit v1.2.3 From cce19d265d22f13effd675e38122f7776682021f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 11 Dec 2018 07:29:17 -0800 Subject: Reduce compile size of KBD6x (#4599) Disable some functionality so that it will compile under size in the QMK Configurator --- keyboards/kbd6x/config.h | 5 ++--- keyboards/kbd6x/rules.mk | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/keyboards/kbd6x/config.h b/keyboards/kbd6x/config.h index 6a5ebf0624..9f23fb867c 100644 --- a/keyboards/kbd6x/config.h +++ b/keyboards/kbd6x/config.h @@ -169,8 +169,8 @@ along with this program. If not, see . //#define NO_ACTION_LAYER //#define NO_ACTION_TAPPING //#define NO_ACTION_ONESHOT -//#define NO_ACTION_MACRO -//#define NO_ACTION_FUNCTION +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION /* * MIDI options @@ -222,4 +222,3 @@ along with this program. If not, see . #define LCD_E_PIN 1 //< pin for Enable line #endif */ - diff --git a/keyboards/kbd6x/rules.mk b/keyboards/kbd6x/rules.mk index 5c7a3877ee..e9b61a76d6 100644 --- a/keyboards/kbd6x/rules.mk +++ b/keyboards/kbd6x/rules.mk @@ -55,7 +55,7 @@ BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) MOUSEKEY_ENABLE = no # 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 +COMMAND_ENABLE = no # 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 -- cgit v1.2.3 From 930e1dfc4c4d366fd85c6ce0652a071beaab91c0 Mon Sep 17 00:00:00 2001 From: Wilba Date: Wed, 12 Dec 2018 02:31:13 +1100 Subject: Changing Zeal60/Zeal65 VID/PID to be unique (#4605) --- keyboards/zeal60/config.h | 6 +++--- keyboards/zeal65/config.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/zeal60/config.h b/keyboards/zeal60/config.h index d1bd3f6a1a..6f3d43473f 100644 --- a/keyboards/zeal60/config.h +++ b/keyboards/zeal60/config.h @@ -18,12 +18,12 @@ #include "config_common.h" // USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 +#define VENDOR_ID 0x5A45 // ZealPC ("ZE") +#define PRODUCT_ID 0x0060 // Zeal60 #define DEVICE_VER 0x0001 #define MANUFACTURER ZealPC #define PRODUCT Zeal60 -#define DESCRIPTION Zeal60 (QMK Firmware) +#define DESCRIPTION Zeal60 // key matrix size #define MATRIX_ROWS 5 diff --git a/keyboards/zeal65/config.h b/keyboards/zeal65/config.h index 63ce1c12a2..24aae5e368 100644 --- a/keyboards/zeal65/config.h +++ b/keyboards/zeal65/config.h @@ -18,12 +18,12 @@ #include "config_common.h" // USB Device descriptor parameter -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6065 +#define VENDOR_ID 0x5A45 // ZealPC ("ZE") +#define PRODUCT_ID 0x0065 // Zeal65 #define DEVICE_VER 0x0001 #define MANUFACTURER ZealPC #define PRODUCT Zeal65 -#define DESCRIPTION Zeal65 (QMK Firmware) +#define DESCRIPTION Zeal65 // key matrix size #define MATRIX_ROWS 5 -- cgit v1.2.3 From fb900e2ad173c569ca97a57c076e32ca4a06fa76 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Tue, 11 Dec 2018 09:11:35 -0800 Subject: Fix macro docs to be consistent with keyboard template (#4600) --- docs/feature_macros.md | 158 +++++++++++++++++++++++++++---------------------- 1 file changed, 88 insertions(+), 70 deletions(-) diff --git a/docs/feature_macros.md b/docs/feature_macros.md index ba5d91882f..29ba29fef7 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -12,24 +12,28 @@ Here is an example `keymap.c` for a two-key keyboard: ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE + QMKBEST = SAFE_RANGE, }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); // this is our macro! - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, KC_ESC} - } + [0] = { + {QMKBEST, KC_ESC} + } }; ``` @@ -37,7 +41,7 @@ What happens here is this: We first define a new custom keycode in the range not occupied by any other keycodes. Then we use the `process_record_user` function, which is called whenever a key is pressed or released, to check if our custom keycode has been activated. If yes, we send the string `"QMK is the best thing ever!"` to the computer via the `SEND_STRING` macro (this is a C preprocessor macro, not to be confused with QMK macros). -We return `false` to indicate to the caller that the key press we just processed need not be processed any further. +We return `true` to indicate to the caller that the key press we just processed should continue to be processed as normal (as we didn't replace or alter the functionality). Finally, we define the keymap so that the first button activates our macro and the second button is just an escape button. You might want to add more than one macro. @@ -45,28 +49,42 @@ You can do that by adding another keycode and adding another case to the switch ```c enum custom_keycodes { - MY_CUSTOM_MACRO = SAFE_RANGE, - MY_OTHER_MACRO + QMKBEST = SAFE_RANGE, + QMKURL, + MY_OTHER_MACRO }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (record->event.pressed) { - switch(keycode) { - case MY_CUSTOM_MACRO: - SEND_STRING("QMK is the best thing ever!"); - return false; - case MY_OTHER_MACRO: - SEND_STRING(SS_LCTRL("ac")); // selects all and copies - return false; - } - } - return true; + switch (keycode) { + case QMKBEST: + if (record->event.pressed) { + // when keycode QMKBEST is pressed + SEND_STRING("QMK is the best thing ever!"); + } else { + // when keycode QMKBEST is released + } + break; + case QMKURL: + if (record->event.pressed) { + // when keycode QMKURL is pressed + SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); + } else { + // when keycode QMKURL is released + } + break; + case MY_OTHER_MACRO: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("ac")); // selects all and copies + } + break; + } + return true; }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = { - {MY_CUSTOM_MACRO, MY_OTHER_MACRO} - } + [0] = { + {MY_CUSTOM_MACRO, MY_OTHER_MACRO} + } }; ``` @@ -136,21 +154,21 @@ By default QMK assumes you don't have any macros. To define your macros you crea ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` This defines two macros which will be run when the key they are assigned to is pressed. If instead you'd like them to run when the key is released you can change the if statement: - if (!record->event.pressed) { + if (!record->event.pressed) { ### Macro Commands @@ -169,21 +187,21 @@ Use the `M()` function within your `KEYMAP()` to call a macro. For example, here ```c const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M(0), M(1) - ), + [0] = KEYMAP( + M(0), M(1) + ), }; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (record->event.pressed) { - switch(id) { - case 0: - return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); - case 1: - return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); - } - } - return MACRO_NONE; + if (record->event.pressed) { + switch(id) { + case 0: + return MACRO(D(LSFT), T(H), U(LSFT), T(I), D(LSFT), T(1), U(LSFT), END); + case 1: + return MACRO(D(LSFT), T(B), U(LSFT), T(Y), T(E), D(LSFT), T(1), U(LSFT), END); + } + } + return MACRO_NONE; }; ``` @@ -198,9 +216,9 @@ If you have a bunch of macros you want to refer to from your keymap while keepin #define M_BYE M(1) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( - M_HI, M_BYE - ), + [0] = KEYMAP( + M_HI, M_BYE + ), }; ``` @@ -213,11 +231,11 @@ There are some functions you may find useful in macro-writing. Keep in mind that This is a boolean value that can be tested to see if the switch is being pressed or released. An example of this is ```c - if (record->event.pressed) { - // on keydown - } else { - // on keyup - } + if (record->event.pressed) { + // on keydown + } else { + // on keyup + } ``` ### `register_code();` @@ -250,16 +268,16 @@ This example defines a macro which sends `Ctrl-C` when pressed down, and `Ctrl-V ```c const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: { - if (record->event.pressed) { - return MACRO( D(LCTL), T(C), U(LCTL), END ); - } else { - return MACRO( D(LCTL), T(V), U(LCTL), END ); - } - break; - } - } - return MACRO_NONE; + switch(id) { + case 0: { + if (record->event.pressed) { + return MACRO( D(LCTL), T(C), U(LCTL), END ); + } else { + return MACRO( D(LCTL), T(V), U(LCTL), END ); + } + break; + } + } + return MACRO_NONE; }; ``` -- cgit v1.2.3 From a5a46f3d36801ed7ae537f92a248c2ca5b8b8e05 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Sat, 1 Dec 2018 20:01:13 -0800 Subject: handwired/pteron: Configurator support --- keyboards/handwired/pteron/info.json | 78 ++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 keyboards/handwired/pteron/info.json diff --git a/keyboards/handwired/pteron/info.json b/keyboards/handwired/pteron/info.json new file mode 100644 index 0000000000..7b3b1b696f --- /dev/null +++ b/keyboards/handwired/pteron/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "pteron", + "url": "", + "maintainer": "FSund", + "width": 17, + "height": 5.95, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"K000", "x":0, "y":0.75}, + {"label":"K001", "x":1, "y":0.75}, + {"label":"K002", "x":2, "y":0.25}, + {"label":"K003", "x":3, "y":0}, + {"label":"K004", "x":4, "y":0.35}, + {"label":"K005", "x":5, "y":0.45}, + + {"label":"K006", "x":11, "y":0.45}, + {"label":"K007", "x":12, "y":0.35}, + {"label":"K008", "x":13, "y":0}, + {"label":"K009", "x":14, "y":0.25}, + {"label":"K010", "x":15, "y":0.75}, + {"label":"K011", "x":16, "y":0.75}, + + {"label":"K100", "x":0, "y":1.75}, + {"label":"K101", "x":1, "y":1.75}, + {"label":"K102", "x":2, "y":1.25}, + {"label":"K103", "x":3, "y":1}, + {"label":"K104", "x":4, "y":1.35}, + {"label":"K105", "x":5, "y":1.45}, + + {"label":"K106", "x":11, "y":1.45}, + {"label":"K107", "x":12, "y":1.35}, + {"label":"K108", "x":13, "y":1}, + {"label":"K109", "x":14, "y":1.25}, + {"label":"K110", "x":15, "y":1.75}, + {"label":"K111", "x":16, "y":1.75}, + + {"label":"K200", "x":0, "y":2.75}, + {"label":"K201", "x":1, "y":2.75}, + {"label":"K202", "x":2, "y":2.25}, + {"label":"K203", "x":3, "y":2}, + {"label":"K204", "x":4, "y":2.35}, + {"label":"K205", "x":5, "y":2.45}, + + {"label":"K206", "x":11, "y":2.45}, + {"label":"K207", "x":12, "y":2.35}, + {"label":"K208", "x":13, "y":2}, + {"label":"K209", "x":14, "y":2.25}, + {"label":"K210", "x":15, "y":2.75}, + {"label":"K211", "x":16, "y":2.75}, + + {"label":"K300", "x":0, "y":3.75}, + {"label":"K301", "x":1, "y":3.75}, + {"label":"K302", "x":2, "y":3.25}, + {"label":"K303", "x":3, "y":3}, + {"label":"K304", "x":4, "y":3.35}, + {"label":"K305", "x":5, "y":3.45}, + + {"label":"K306", "x":11, "y":3.45}, + {"label":"K307", "x":12, "y":3.35}, + {"label":"K308", "x":13, "y":3}, + {"label":"K309", "x":14, "y":3.25}, + {"label":"K310", "x":15, "y":3.75}, + {"label":"K311", "x":16, "y":3.75}, + + {"label":"K402", "x":4, "y":4.35}, + {"label":"K403", "x":5, "y":4.45}, + {"label":"K404", "x":6, "y":4.65}, + {"label":"K405", "x":7, "y":4.95}, + + {"label":"K406", "x":9, "y":4.95}, + {"label":"K407", "x":10, "y":4.65}, + {"label":"K408", "x":11, "y":4.45}, + {"label":"K409", "x":12, "y":4.35} + ] + } + } +} -- cgit v1.2.3 From 7c63c0a95075f6fb4dd94d020ceb5816e6bcca2c Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 11 Dec 2018 09:47:06 -0800 Subject: handwired/practice60: Configurator Support and refactor (#4603) * handwired/practice60: Configurator Support * handwired/practice60: refactor - layout macro rows did not have an equal number of arguments in all rows of the matrix - white space changes for readability/alignment --- keyboards/handwired/practice60/info.json | 74 ++++++++++++++++++++++ .../handwired/practice60/keymaps/default/keymap.c | 18 +++--- keyboards/handwired/practice60/practice60.h | 21 +++--- 3 files changed, 93 insertions(+), 20 deletions(-) create mode 100644 keyboards/handwired/practice60/info.json diff --git a/keyboards/handwired/practice60/info.json b/keyboards/handwired/practice60/info.json new file mode 100644 index 0000000000..cffbcf4924 --- /dev/null +++ b/keyboards/handwired/practice60/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "Practice 60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/practice60/keymaps/default/keymap.c b/keyboards/handwired/practice60/keymaps/default/keymap.c index afea72b116..ac6e755097 100644 --- a/keyboards/handwired/practice60/keymaps/default/keymap.c +++ b/keyboards/handwired/practice60/keymaps/default/keymap.c @@ -31,18 +31,18 @@ enum custom_keycodes { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = LAYOUT_60_ansi( - KC_GESC, 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MT(MOD_LSFT, KC_Y), KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ - 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - KC_LCTL , KC_LGUI , KC_LALT , KC_SPC , KC_RALT , KC_RGUI , MO(_FN1) , KC_RCTL + KC_GESC, 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, MT(MOD_LSFT, KC_Y), KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSLS, \ + 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, MO(_FN1), KC_RCTL ), [_FN1] = LAYOUT_60_ansi( KC_GESC, 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_BSPC, \ - RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______,\ - BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - KC_GRV, _______, _______, _______, _______, _______, _______, _______ + RGB_TOG, RGB_MOD, KC_UP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + BL_INC, BL_DEC, BL_TOGG, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_GRV, _______, _______, _______, _______, _______, _______, _______ ) }; diff --git a/keyboards/handwired/practice60/practice60.h b/keyboards/handwired/practice60/practice60.h index ffcf506143..5ebba8fb84 100644 --- a/keyboards/handwired/practice60/practice60.h +++ b/keyboards/handwired/practice60/practice60.h @@ -3,16 +3,15 @@ #include "quantum.h" #define LAYOUT_60_ansi( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ - K40, K41, K42, K43, K49, K4A, K4B, K4C \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K41, K42, K43, K49, K4A, K4B, K4C \ ) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B }, \ - { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, KC_NO }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO, KC_NO }, \ + { K40, K41, K42, K43, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K49, K4A, K4B, K4C, KC_NO } \ } - -- cgit v1.2.3 From 200ee8e7973f47dd3a497b65c6ecf7ee3f5051ab Mon Sep 17 00:00:00 2001 From: Skyler Lewis Date: Tue, 11 Dec 2018 13:43:56 -0700 Subject: Keymap: Dichotomy keymap by alairock (#4608) * dichotemy layout for alairock * dichotemy layout for alairock * complete overhaul * fix suggestions --- keyboards/dichotomy/keymaps/alairock/keymap.c | 196 ++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) create mode 100644 keyboards/dichotomy/keymaps/alairock/keymap.c diff --git a/keyboards/dichotomy/keymaps/alairock/keymap.c b/keyboards/dichotomy/keymaps/alairock/keymap.c new file mode 100644 index 0000000000..f39a226b71 --- /dev/null +++ b/keyboards/dichotomy/keymaps/alairock/keymap.c @@ -0,0 +1,196 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// 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 _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _MOUSE 8 +#define _ADJUST 16 + + +enum dichotomy_keycodes +{ + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, + MOUKEY, + MS_BTN1, + MS_BTN2, + MS_BTN3 +}; + +#define RED_BRIGHTNESS 3 +#define GREEN_BRIGHTNESS 2 +#define BLUE_BRIGHTNESS 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + +[_QWERTY] = LAYOUT( /* Base layout, nearly qwerty but with modifications because it's not a full keyboard. Obviously. */ + KC_ESCAPE, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MOUKEY, + KC_LCTL, KC_LALT, MOUKEY, KC_RGUI, KC_RALT, KC_RCTL, + MS_BTN3, SFT_T(KC_ESCAPE), KC_LGUI, KC_BSPC, KC_SPC, RAISE, LOWER, MS_BTN3 +), + +[_RAISE] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, KC_MRWD, _______, _______, _______, KC_BSLS, KC_QUOT, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, KC_LABK, _______, _______, KC_RABK, _______, _______ +), + +[_LOWER] = LAYOUT( /* Number layout, basically the main function layer */ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, KC_TILD, KC_GRV, KC_F13, KC_F14, KC_F15, KC_F16, KC_F7, KC_F8, KC_F9, KC_F10, _______, + _______, _______, _______, _______, _______, _______, + _______, RAISE, _______, _______, _______, _______, _______, _______ +), + +[_ADJUST] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ + _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ +), + +[_MOUSE] = LAYOUT( /* Mouse layer, including buttons for clicking. */ + _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, + _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, + _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ +) + +}; // end keymaps block + +static bool shift_held = false; +static bool shift_suspended = false; +report_mouse_t currentReport = {}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + grn_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + grn_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + //SHIFT is handled as LSHIFT in the general case - 'toggle' shoudl activate caps, while the layer is only active when shift is held. + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + red_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + red_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //MOUSE layer needs to be handled the same way as NUMKEY, but differently from shift + case MOUKEY: + if (record->event.pressed) { + layer_on(_MOUSE); + blu_led_on(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_MOUSE); + blu_led_off(); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + //mouse buttons, for 1-3, to update the mouse report: + case MS_BTN1: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN1; //MOUSE_BTN1 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN1; + } + pointing_device_set_report(currentReport); + return false; + break; + case MS_BTN2: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN2; //MOUSE_BTN2 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN2; + } + pointing_device_set_report(currentReport); + return false; + break; + case MS_BTN3: + currentReport = pointing_device_get_report(); + if (record->event.pressed) { + if (shift_held && shift_suspended){ + register_code(KC_LSFT); + shift_suspended = false; + } + //update mouse report here + currentReport.buttons |= MOUSE_BTN3; //MOUSE_BTN3 is a const defined in report.h + } else { + //update mouse report here + currentReport.buttons &= ~MOUSE_BTN3; + } + pointing_device_set_report(currentReport); + return false; + break; + //Additionally, if NS_ keys are in use, then shift may be held (but is + //disabled for the unshifted keycodes to be send. Check the bool and + //register shift as necessary. + // default: + // if (shift_held){ + // register_code(KC_LSFT); + // } + // break; + } + return true; +}; -- cgit v1.2.3 From b11c3324774e50b8f17f5b4a3af63f1b6ae441e0 Mon Sep 17 00:00:00 2001 From: Twopidee <42394451+Twopidee@users.noreply.github.com> Date: Tue, 11 Dec 2018 16:24:17 -0600 Subject: Keymap: Added Drewsky DZ60 keymap (#4607) * Added Drewsky's DZ60 Keymap * Update keyboards/dz60/keymaps/drewsky/keymap.c Co-Authored-By: Twopidee <42394451+Twopidee@users.noreply.github.com> --- keyboards/dz60/keymaps/drewsky/Readme.md | 11 +++++++++++ keyboards/dz60/keymaps/drewsky/keymap.c | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100755 keyboards/dz60/keymaps/drewsky/Readme.md create mode 100755 keyboards/dz60/keymaps/drewsky/keymap.c diff --git a/keyboards/dz60/keymaps/drewsky/Readme.md b/keyboards/dz60/keymaps/drewsky/Readme.md new file mode 100755 index 0000000000..115d9cf83b --- /dev/null +++ b/keyboards/dz60/keymaps/drewsky/Readme.md @@ -0,0 +1,11 @@ +# **DREWSKY'S DZ60 ANSI Layout** +![Imgur](https://i.imgur.com/v4zVbl7.jpg) + + +Layer 1 is default configuration, for the exception of the Space cadet shifts. Layer 2 is for WASD arrows and Media, which I have included both PREV and NEXT for Windows and macOS. Layer 3 is for RGB underglow. Legends in picture follow Layers. Modifier one is momentary, and the RGB layer is TT (TAP_TOGGLE) + +Make example for this keyboard (after setting up your build environment): + + make dz60:drewsky + +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/dz60/keymaps/drewsky/keymap.c b/keyboards/dz60/keymaps/drewsky/keymap.c new file mode 100755 index 0000000000..aba0d238f0 --- /dev/null +++ b/keyboards/dz60/keymaps/drewsky/keymap.c @@ -0,0 +1,34 @@ +#include QMK_KEYBOARD_H + +// Helpful defines +#define _L0 0 +#define _L1 1 +#define _L2 2 + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_L0] = LAYOUT_60_ansi( + KC_GESC, 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_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_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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, TT(2), KC_RALT, MO(1), KC_RCTL), + + [_L1] = LAYOUT_60_ansi( + 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_DEL, + KC_NO, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGUP, + KC_NO, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PGDN, + KC_NO, KC_MRWD, KC_MFFD, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_MSTP, KC_VOLD, KC_VOLU, KC_MPLY, KC__VOLDOWN, KC__VOLUP, KC_TRNS, KC_NO), + + [_L2] = LAYOUT_60_ansi( + KC_ESC, RGB_M_P, RGB_M_B, RGB_M_R, RGB_M_SW, RGB_M_SN, RGB_M_K, RGB_M_X, RGB_M_G, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_HUD, RGB_HUI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_SAD, RGB_SAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_NO, RGB_VAD, RGB_VAI, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, RGB_SPD, RGB_SPI, KC_NO, + KC_NO, KC_NO, KC_NO, RGB_TOG, KC_TRNS, KC_NO, KC_NO, DEBUG) +}; + + + + -- cgit v1.2.3 From d46d3043957b75369923cb0202c632fa1d8f0311 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 11 Dec 2018 15:58:10 -0800 Subject: Preonic Configurator update (#4598) * Preonic: refactor layout macros Unify layout macro names across AVR and ARM. - all layouts and matrices have moved/duplicated to their appropriate revisions - preonic.h now includes the appropriate header file from the selected revision - revision header files only contain layouts appropriate for that revision - Previously, all layouts were available in source for all revisions. - removed KEYMAP layout macro alias (was unused) - macros LAYOUT_preonic_1x2uC and LAYOUT_preonic_grid for AVR and ARM revisions - LAYOUT_preonic_grid has alias LAYOUT_ortho_5x12 for all revisions - deleted LAYOUT_ortho_4x12 alias (not appropriate for this keyboard) - ARM-based revisions have 1x2uR, 1x2uL and 2x2u matrices * Preonic: updated revision headers to #pragma once * Preonic: update Configurator files Updated the Configurator files to reflect the previous changes in this branch. - Preonic revs. 1 and 2 will use keyboards/preonic/info.json - Preonic rev. 3 will use keyboards/preonic/rev3/info.json - This file will override keyboards/preonic/info.json when preonic/rev3 is selected in the Configurator. --- keyboards/preonic/info.json | 4 +- keyboards/preonic/preonic.h | 159 +++---------------- keyboards/preonic/rev1/rev1.h | 39 ++++- keyboards/preonic/rev2/rev2.h | 36 +++++ keyboards/preonic/rev3/info.json | 330 +++++++++++++++++++++++++++++++++++++++ keyboards/preonic/rev3/rev3.h | 106 ++++++++++++- 6 files changed, 528 insertions(+), 146 deletions(-) create mode 100644 keyboards/preonic/rev3/info.json diff --git a/keyboards/preonic/info.json b/keyboards/preonic/info.json index 3e5670cfaf..cb0798b545 100644 --- a/keyboards/preonic/info.json +++ b/keyboards/preonic/info.json @@ -6,7 +6,7 @@ "width": 12, "height": 5, "layouts": { - "KEYMAP": { + "LAYOUT_preonic_1x2uC": { "key_count": 59, "layout": [ { "w": 1, "x": 0, "y": 0 }, @@ -69,7 +69,7 @@ { "w": 1, "x": 10, "y": 4 }, { "w": 1, "x": 11, "y": 4 } ] }, - "LAYOUT_preonic_grid": { + "LAYOUT_ortho_5x12": { "key_count": 60, "layout": [ { "w": 1, "x": 0, "y": 0 }, diff --git a/keyboards/preonic/preonic.h b/keyboards/preonic/preonic.h index 8d7b577a97..e2aa1545c1 100644 --- a/keyboards/preonic/preonic.h +++ b/keyboards/preonic/preonic.h @@ -1,149 +1,26 @@ -#ifndef PREONIC_H -#define PREONIC_H +#pragma once #include "quantum.h" -#ifdef __AVR__ - -#define LAYOUT_preonic_1x2uC( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ -} - -#define LAYOUT_preonic_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ - { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ - { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ - { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ -} - -#define KEYMAP LAYOUT_preonic_1x2uC -#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid - -#else - -#define LAYOUT_preonic_1x2uC( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} - -#define LAYOUT_preonic_1x2uR( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} -#define LAYOUT_preonic_1x2uL( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} - -#define LAYOUT_preonic_2x2u( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} +/************************************************** +** Include headers specific to keyboard revision ** +***************************************************/ +#ifdef KEYBOARD_preonic_rev1 + #include "rev1.h" +#endif -#define LAYOUT_preonic_grid( \ - k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ - k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ - k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ - k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ - k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ -) \ -{ \ - { k00, k01, k02, k03, k04, k05 }, \ - { k10, k11, k12, k13, k14, k15 }, \ - { k20, k21, k22, k23, k24, k25 }, \ - { k30, k31, k32, k33, k34, k35 }, \ - { k06, k07, k08, k09, k0a, k0b }, \ - { k16, k17, k18, k19, k1a, k1b }, \ - { k26, k27, k28, k29, k2a, k2b }, \ - { k36, k37, k38, k39, k3a, k3b }, \ - { k40, k41, k42, k49, k4a, k4b }, \ - { k46, k47, k48, k43, k44, k45 } \ -} +#ifdef KEYBOARD_preonic_rev2 + #include "rev2.h" +#endif -#define KEYMAP LAYOUT_preonic_grid -#define LAYOUT_ortho_4x12 LAYOUT_preonic_grid -#define KC_LAYOUT_ortho_4x12 KC_KEYMAP +#ifdef KEYBOARD_preonic_rev3 + #include "rev3.h" +#endif -#endif +/************************************************** +** Layout macros aliases common to all revisions ** -#endif + Name of Alias Matrix Name: + ----------------- ------------------- ****/ +#define LAYOUT_ortho_5x12 LAYOUT_preonic_grid diff --git a/keyboards/preonic/rev1/rev1.h b/keyboards/preonic/rev1/rev1.h index 6705b72591..6ca4afd3e2 100644 --- a/keyboards/preonic/rev1/rev1.h +++ b/keyboards/preonic/rev1/rev1.h @@ -13,4 +13,41 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "preonic.h" \ No newline at end of file + +#pragma once + +#include "preonic.h" + +#ifdef __AVR__ // Preonic revs. 1 & 2 + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ + } + +#endif diff --git a/keyboards/preonic/rev2/rev2.h b/keyboards/preonic/rev2/rev2.h index 5117214598..6ca4afd3e2 100644 --- a/keyboards/preonic/rev2/rev2.h +++ b/keyboards/preonic/rev2/rev2.h @@ -14,4 +14,40 @@ * along with this program. If not, see . */ +#pragma once + #include "preonic.h" + +#ifdef __AVR__ // Preonic revs. 1 & 2 + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k45, k47, k48, k49, k4a, k4b } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b }, \ + { k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b }, \ + { k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b }, \ + { k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b } \ + } + +#endif diff --git a/keyboards/preonic/rev3/info.json b/keyboards/preonic/rev3/info.json new file mode 100644 index 0000000000..50ae8e5fb1 --- /dev/null +++ b/keyboards/preonic/rev3/info.json @@ -0,0 +1,330 @@ +{ + "keyboard_name": "Preonic rev. 3", + "keyboard_folder": "preonic/rev3", + "url": "https://olkb.com/preonic", + "maintainer": "jackhumbert", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_preonic_1x2uC": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4, "w":2}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_1x2uR": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4}, + {"label":"k47", "x":6, "y":4, "w":2}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_1x2uL": { + "key_count": 59, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4, "w":2}, + {"label":"k46", "x":6, "y":4}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_preonic_2x2u": { + "key_count": 58, + "layout": [ + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4, "w":2}, + {"label":"k46", "x":6, "y":4, "w":2}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + }, + "LAYOUT_ortho_5x12": { + "layout": [ + "key_count": 60, + {"label":"k00", "x":0, "y":0}, + {"label":"k01", "x":1, "y":0}, + {"label":"k02", "x":2, "y":0}, + {"label":"k03", "x":3, "y":0}, + {"label":"k04", "x":4, "y":0}, + {"label":"k05", "x":5, "y":0}, + {"label":"k06", "x":6, "y":0}, + {"label":"k07", "x":7, "y":0}, + {"label":"k08", "x":8, "y":0}, + {"label":"k09", "x":9, "y":0}, + {"label":"k0a", "x":10, "y":0}, + {"label":"k0b", "x":11, "y":0}, + {"label":"k10", "x":0, "y":1}, + {"label":"k11", "x":1, "y":1}, + {"label":"k12", "x":2, "y":1}, + {"label":"k13", "x":3, "y":1}, + {"label":"k14", "x":4, "y":1}, + {"label":"k15", "x":5, "y":1}, + {"label":"k16", "x":6, "y":1}, + {"label":"k17", "x":7, "y":1}, + {"label":"k18", "x":8, "y":1}, + {"label":"k19", "x":9, "y":1}, + {"label":"k1a", "x":10, "y":1}, + {"label":"k1b", "x":11, "y":1}, + {"label":"k20", "x":0, "y":2}, + {"label":"k21", "x":1, "y":2}, + {"label":"k22", "x":2, "y":2}, + {"label":"k23", "x":3, "y":2}, + {"label":"k24", "x":4, "y":2}, + {"label":"k25", "x":5, "y":2}, + {"label":"k26", "x":6, "y":2}, + {"label":"k27", "x":7, "y":2}, + {"label":"k28", "x":8, "y":2}, + {"label":"k29", "x":9, "y":2}, + {"label":"k2a", "x":10, "y":2}, + {"label":"k2b", "x":11, "y":2}, + {"label":"k30", "x":0, "y":3}, + {"label":"k31", "x":1, "y":3}, + {"label":"k32", "x":2, "y":3}, + {"label":"k33", "x":3, "y":3}, + {"label":"k34", "x":4, "y":3}, + {"label":"k35", "x":5, "y":3}, + {"label":"k36", "x":6, "y":3}, + {"label":"k37", "x":7, "y":3}, + {"label":"k38", "x":8, "y":3}, + {"label":"k39", "x":9, "y":3}, + {"label":"k3a", "x":10, "y":3}, + {"label":"k3b", "x":11, "y":3}, + {"label":"k40", "x":0, "y":4}, + {"label":"k41", "x":1, "y":4}, + {"label":"k42", "x":2, "y":4}, + {"label":"k43", "x":3, "y":4}, + {"label":"k44", "x":4, "y":4}, + {"label":"k45", "x":5, "y":4}, + {"label":"k46", "x":6, "y":4}, + {"label":"k47", "x":7, "y":4}, + {"label":"k48", "x":8, "y":4}, + {"label":"k49", "x":9, "y":4}, + {"label":"k4a", "x":10, "y":4}, + {"label":"k4b", "x":11, "y":4} + ] + } + } +} diff --git a/keyboards/preonic/rev3/rev3.h b/keyboards/preonic/rev3/rev3.h index 7c274ae270..af97239fd1 100644 --- a/keyboards/preonic/rev3/rev3.h +++ b/keyboards/preonic/rev3/rev3.h @@ -13,9 +13,111 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef REV3_H -#define REV3_H + +#pragma once #include "preonic.h" +#ifndef __AVR__ // Preonic rev. 3 and later + + #define LAYOUT_preonic_1x2uC( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k45, k47, k48, k43, k44, k45 } \ + } + + #define LAYOUT_preonic_1x2uR( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k47, k47, k48, k43, k44, k45 } \ + } + + #define LAYOUT_preonic_1x2uL( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k44 } \ + } + + #define LAYOUT_preonic_2x2u( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k46, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k46, k48, k43, k44, k44 } \ + } + + #define LAYOUT_preonic_grid( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, \ + k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, \ + k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, \ + k30, k31, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, \ + k40, k41, k42, k43, k44, k45, k46, k47, k48, k49, k4a, k4b \ + ) \ + { \ + { k00, k01, k02, k03, k04, k05 }, \ + { k10, k11, k12, k13, k14, k15 }, \ + { k20, k21, k22, k23, k24, k25 }, \ + { k30, k31, k32, k33, k34, k35 }, \ + { k06, k07, k08, k09, k0a, k0b }, \ + { k16, k17, k18, k19, k1a, k1b }, \ + { k26, k27, k28, k29, k2a, k2b }, \ + { k36, k37, k38, k39, k3a, k3b }, \ + { k40, k41, k42, k49, k4a, k4b }, \ + { k46, k47, k48, k43, k44, k45 } \ + } + #endif -- cgit v1.2.3 From 8b6cdd17886db9847ff91be9c10a1788a7c74a6a Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 11 Dec 2018 20:49:44 -0800 Subject: handwired/numpad20 Refactor and Configurator support (#4589) * handwired/numpad20: refactor - layout macro no longer auto-prepends keycodes with KC_ - keymaps for this keyboard will now compile in QMK Configurator - keymap now uses #include QMK_KEYBOARD_H - deleted unused fn_actions code block * handwired/numpad20: Configurator support --- keyboards/handwired/numpad20/info.json | 33 ++++++++++++++++++++++ .../handwired/numpad20/keymaps/default/keymap.c | 19 +++++-------- keyboards/handwired/numpad20/numpad20.h | 12 ++++---- 3 files changed, 46 insertions(+), 18 deletions(-) create mode 100644 keyboards/handwired/numpad20/info.json diff --git a/keyboards/handwired/numpad20/info.json b/keyboards/handwired/numpad20/info.json new file mode 100644 index 0000000000..691acb3150 --- /dev/null +++ b/keyboards/handwired/numpad20/info.json @@ -0,0 +1,33 @@ +{ + "keyboard_name": "numpad20 handwired", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"K00", "x":0, "y":0}, + {"label":"K01", "x":1, "y":0}, + {"label":"K02", "x":2, "y":0}, + {"label":"K03", "x":3, "y":0}, + {"label":"K10", "x":0, "y":1}, + {"label":"K11", "x":1, "y":1}, + {"label":"K12", "x":2, "y":1}, + {"label":"K13", "x":3, "y":1}, + {"label":"K20", "x":0, "y":2}, + {"label":"K21", "x":1, "y":2}, + {"label":"K22", "x":2, "y":2}, + {"label":"K23", "x":3, "y":2}, + {"label":"K30", "x":0, "y":3}, + {"label":"K31", "x":1, "y":3}, + {"label":"K32", "x":2, "y":3}, + {"label":"K33", "x":3, "y":3}, + {"label":"K40", "x":0, "y":4}, + {"label":"K41", "x":1, "y":4}, + {"label":"K42", "x":2, "y":4}, + {"label":"K43", "x":3, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/numpad20/keymaps/default/keymap.c b/keyboards/handwired/numpad20/keymaps/default/keymap.c index 65799bfee4..414b104afd 100644 --- a/keyboards/handwired/numpad20/keymaps/default/keymap.c +++ b/keyboards/handwired/numpad20/keymaps/default/keymap.c @@ -1,16 +1,11 @@ -#include "numpad20.h" - -#define KC_ KC_TRNS +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT( - LEFT,RGHT, UP ,DOWN, \ - P7 , P8 , P9 ,PLUS, \ - P4 , P5 , P6 ,MINS, \ - P1 , P2 , P3 , ENT, \ - P0 ,DOT ,RGHT, TAB \ - ) -}; - -const uint16_t PROGMEM fn_actions[] = { + KC_LEFT, KC_RGHT, KC_UP, KC_DOWN, \ + KC_P7, KC_P8, KC_P9, KC_PLUS, \ + KC_P4, KC_P5, KC_P6, KC_MINS, \ + KC_P1, KC_P2, KC_P3, KC_ENT, \ + KC_P0, KC_DOT, KC_RGHT, KC_TAB \ + ) }; diff --git a/keyboards/handwired/numpad20/numpad20.h b/keyboards/handwired/numpad20/numpad20.h index a2aa8d16ba..c15aa9ac70 100644 --- a/keyboards/handwired/numpad20/numpad20.h +++ b/keyboards/handwired/numpad20/numpad20.h @@ -10,11 +10,11 @@ K30, K31, K32, K33, \ K40, K41, K42, K43 \ ) { \ - { KC_##K00, KC_##K01, KC_##K02, KC_##K03 }, \ - { KC_##K10, KC_##K11, KC_##K12, KC_##K13 }, \ - { KC_##K20, KC_##K21, KC_##K22, KC_##K23 }, \ - { KC_##K30, KC_##K31, KC_##K32, KC_##K33 }, \ - { KC_##K40, KC_##K41, KC_##K42, KC_##K43 } \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ } -#endif \ No newline at end of file +#endif -- cgit v1.2.3 From 28fbf84cc5ff52f545011ea4198a6cc6d054f896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 12 Dec 2018 19:17:19 +0100 Subject: Add standard definitions for ALGR and KC_ALGR (#4389) * Add standard ALGR defition, remove (re)definitions from language files * Use ALGR(kc) consistently in ALTGR(kc) aliases * Non-Nordic keymaps should not use NO_ALGR * Add standard KC_ALGR definition * Update docs with ALGR and KC_ALGR * Update SS_ALGR and ALGR_T aliases --- docs/feature_advanced_keycodes.md | 4 ++-- docs/keycodes.md | 4 ++-- docs/keycodes_basic.md | 2 +- keyboards/handwired/reddot/keymaps/default/keymap.c | 4 ++-- keyboards/xd75/keymaps/germanized/config.h | 1 - quantum/keymap_extras/keymap_belgian.h | 5 +---- quantum/keymap_extras/keymap_bepo.h | 5 +---- quantum/keymap_extras/keymap_canadian_multilingual.h | 5 +---- quantum/keymap_extras/keymap_fr_ch.h | 1 - quantum/keymap_extras/keymap_french.h | 5 +---- quantum/keymap_extras/keymap_german.h | 1 - quantum/keymap_extras/keymap_german_ch.h | 1 - quantum/keymap_extras/keymap_hungarian.h | 1 - quantum/keymap_extras/keymap_italian.h | 1 - quantum/keymap_extras/keymap_nordic.h | 1 - quantum/keymap_extras/keymap_slovenian.h | 1 - quantum/keymap_extras/keymap_spanish.h | 3 +-- quantum/keymap_extras/keymap_uk.h | 3 +-- quantum/quantum.h | 1 + quantum/quantum_keycodes.h | 5 +++-- tmk_core/common/keycode.h | 1 + 21 files changed, 18 insertions(+), 37 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index bb5cb7419b..e5f241f7f1 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -68,7 +68,7 @@ These allow you to combine a modifier with a keycode. When pressed, the keydown |`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | @@ -92,7 +92,7 @@ The modifiers this keycode and `OSM()` accept are prefixed with `MOD_`, not `KC_ |`MOD_LGUI`|Left GUI (Windows/Command/Meta key) | |`MOD_RCTL`|Right Control | |`MOD_RSFT`|Right Shift | -|`MOD_RALT`|Right Alt | +|`MOD_RALT`|Right Alt (AltGr) | |`MOD_RGUI`|Right GUI (Windows/Command/Meta key) | |`MOD_HYPR`|Hyper (Left Control, Shift, Alt and GUI)| |`MOD_MEH` |Meh (Left Control, Shift, and Alt) | diff --git a/docs/keycodes.md b/docs/keycodes.md index 75b01389c5..d12a85aa15 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -177,7 +177,7 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT` |`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key) | |`KC_SYSTEM_POWER` |`KC_PWR` |System Power Down | |`KC_SYSTEM_SLEEP` |`KC_SLEP` |System Sleep | @@ -331,7 +331,7 @@ This is a reference only. Each group of keys links to the page documenting their |`LGUI(kc)`|`LCMD(kc)`, `LWIN(kc)`|Hold Left GUI and press `kc` | |`RCTL(kc)`| |Hold Right Control and press `kc` | |`RSFT(kc)`| |Hold Right Shift and press `kc` | -|`RALT(kc)`| |Hold Right Alt and press `kc` | +|`RALT(kc)`|`ALGR(kc)` |Hold Right Alt and press `kc` | |`RGUI(kc)`|`RCMD(kc)`, `LWIN(kc)`|Hold Right GUI and press `kc` | |`HYPR(kc)`| |Hold Left Control, Shift, Alt and GUI and press `kc`| |`MEH(kc)` | |Hold Left Control, Shift and Alt and press `kc` | diff --git a/docs/keycodes_basic.md b/docs/keycodes_basic.md index 9cc00f0325..cba876d346 100644 --- a/docs/keycodes_basic.md +++ b/docs/keycodes_basic.md @@ -116,7 +116,7 @@ The basic set of keycodes are based on the [HID Keyboard/Keypad Usage Page (0x07 |`KC_LGUI` |`KC_LCMD`, `KC_LWIN`|Left GUI (Windows/Command/Meta key) | |`KC_RCTRL` |`KC_RCTL` |Right Control | |`KC_RSHIFT`|`KC_RSFT` |Right Shift | -|`KC_RALT` | |Right Alt | +|`KC_RALT` |`KC_ALGR` |Right Alt (AltGr) | |`KC_RGUI` |`KC_RCMD`, `KC_RWIN`|Right GUI (Windows/Command/Meta key)| ## International diff --git a/keyboards/handwired/reddot/keymaps/default/keymap.c b/keyboards/handwired/reddot/keymaps/default/keymap.c index 44ee2ce510..c67cc0e4c5 100755 --- a/keyboards/handwired/reddot/keymaps/default/keymap.c +++ b/keyboards/handwired/reddot/keymaps/default/keymap.c @@ -8,14 +8,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INSERT, KC_HOME, KC_PGUP,\ KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_PLUS,\ KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_KP_1, KC_UP, KC_KP_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, FR_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), [1] = KEYMAP( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9,\ KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_KP_PLUS,\ KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, NO_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, FR_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), }; diff --git a/keyboards/xd75/keymaps/germanized/config.h b/keyboards/xd75/keymaps/germanized/config.h index 5b19bddb05..379b954714 100644 --- a/keyboards/xd75/keymaps/germanized/config.h +++ b/keyboards/xd75/keymaps/germanized/config.h @@ -28,7 +28,6 @@ #define TAPPING_TERM 200 // Alt gr -#define ALGR(kc) RALT(kc) #define DE_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h index 764c561417..573fa2e8a4 100644 --- a/quantum/keymap_extras/keymap_belgian.h +++ b/quantum/keymap_extras/keymap_belgian.h @@ -22,10 +22,7 @@ #define BE_LALT KC_LGUI // Alt gr -#ifndef ALGR -#define ALGR(kc) RALT(kc) -#endif -#define NO_ALGR KC_RALT +#define BE_ALGR KC_RALT // Normal characters // Line 1 diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h index 05fd2b0023..e6545a7a83 100644 --- a/quantum/keymap_extras/keymap_bepo.h +++ b/quantum/keymap_extras/keymap_bepo.h @@ -21,10 +21,7 @@ // Alt gr #ifndef ALTGR -#define ALTGR(kc) RALT(kc) -#endif -#ifndef ALGR -#define ALGR(kc) ALTGR(kc) +#define ALTGR(kc) ALGR(kc) #endif #define BP_ALGR KC_RALT diff --git a/quantum/keymap_extras/keymap_canadian_multilingual.h b/quantum/keymap_extras/keymap_canadian_multilingual.h index 1d45bee32e..fbeef21874 100644 --- a/quantum/keymap_extras/keymap_canadian_multilingual.h +++ b/quantum/keymap_extras/keymap_canadian_multilingual.h @@ -20,10 +20,7 @@ // Alt gr #ifndef ALTGR -#define ALTGR(kc) RALT(kc) -#endif -#ifndef ALGR -#define ALGR(kc) ALTGR(kc) +#define ALTGR(kc) ALGR(kc) #endif #define CSA_ALTGR KC_RALT diff --git a/quantum/keymap_extras/keymap_fr_ch.h b/quantum/keymap_extras/keymap_fr_ch.h index c0ca832a6f..4eeca7209f 100644 --- a/quantum/keymap_extras/keymap_fr_ch.h +++ b/quantum/keymap_extras/keymap_fr_ch.h @@ -19,7 +19,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define FR_CH_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index 3308dc5f77..d2de859ee7 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -19,10 +19,7 @@ #include "keymap.h" // Alt gr -#ifndef ALGR -#define ALGR(kc) RALT(kc) -#endif -#define NO_ALGR KC_RALT +#define FR_ALGR KC_RALT // Normal characters #define FR_SUP2 KC_GRV diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index e007c26ef5..a215570fd3 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -20,7 +20,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define DE_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index 67350d6602..f0376a17c0 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h @@ -19,7 +19,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define CH_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h index b372440928..cd2dc94cfe 100644 --- a/quantum/keymap_extras/keymap_hungarian.h +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -20,7 +20,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define HU_ALGR KC_RALT // basic letters diff --git a/quantum/keymap_extras/keymap_italian.h b/quantum/keymap_extras/keymap_italian.h index 0ff6ce8762..f629081507 100644 --- a/quantum/keymap_extras/keymap_italian.h +++ b/quantum/keymap_extras/keymap_italian.h @@ -20,7 +20,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define IT_ALGR KC_RALT // normal characters diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 6b34db5588..4210d37145 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -19,7 +19,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define NO_ALGR KC_RALT // Normal characters diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index f27123c2a2..47f5bceed2 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -21,7 +21,6 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) #define SI_ALGR KC_RALT //Swapped Z and Y diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index 224db7be16..19d12551a6 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -19,8 +19,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) -#define NO_ALGR KC_RALT +#define ES_ALGR KC_RALT // Normal characters #define ES_OVRR KC_GRV diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index de47103cb9..a7bcd697e0 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -19,8 +19,7 @@ #include "keymap.h" // Alt gr -#define ALGR(kc) RALT(kc) -#define NO_ALGR KC_RALT +#define UK_ALGR KC_RALT // Normal characters #define UK_HASH KC_NUHS diff --git a/quantum/quantum.h b/quantum/quantum.h index 41c7d8351a..5920e4b139 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -197,6 +197,7 @@ extern uint32_t default_layer_state; #define SS_LALT(string) SS_DOWN(X_LALT) string SS_UP(X_LALT) #define SS_LSFT(string) SS_DOWN(X_LSHIFT) string SS_UP(X_LSHIFT) #define SS_RALT(string) SS_DOWN(X_RALT) string SS_UP(X_RALT) +#define SS_ALGR(string) SS_RALT(string) #define SEND_STRING(str) send_string_P(PSTR(str)) extern const bool ascii_to_shift_lut[0x80]; diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 7670d53e96..283b4a65ca 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -470,6 +470,7 @@ enum quantum_keycodes { #define RCTL(kc) (QK_RCTL | (kc)) #define RSFT(kc) (QK_RSFT | (kc)) #define RALT(kc) (QK_RALT | (kc)) +#define ALGR(kc) RALT(kc) #define RGUI(kc) (QK_RGUI | (kc)) #define RCMD(kc) RGUI(kc) #define RWIN(kc) RGUI(kc) @@ -480,7 +481,7 @@ enum quantum_keycodes { #define SGUI(kc) (QK_LGUI | QK_LSFT | (kc)) #define SCMD(kc) SGUI(kc) #define SWIN(kc) SGUI(kc) -#define LCA(kc) (QK_LCTL | QK_LALT | (kc)) +#define LCA(kc) (QK_LCTL | QK_LALT | (kc)) #define MOD_HYPR 0xf #define MOD_MEH 0x7 @@ -645,7 +646,7 @@ enum quantum_keycodes { #define ALT_T(kc) MT(MOD_LALT, kc) #define LALT_T(kc) MT(MOD_LALT, kc) #define RALT_T(kc) MT(MOD_RALT, kc) -#define ALGR_T(kc) MT(MOD_RALT, kc) // dual-function AltGR +#define ALGR_T(kc) RALT_T(kc) #define GUI_T(kc) MT(MOD_LGUI, kc) #define CMD_T(kc) GUI_T(kc) diff --git a/tmk_core/common/keycode.h b/tmk_core/common/keycode.h index d6fef2bebf..ac3edbd215 100644 --- a/tmk_core/common/keycode.h +++ b/tmk_core/common/keycode.h @@ -140,6 +140,7 @@ along with this program. If not, see . #define KC_LWIN KC_LGUI #define KC_RCTL KC_RCTRL #define KC_RSFT KC_RSHIFT +#define KC_ALGR KC_RALT #define KC_RCMD KC_RGUI #define KC_RWIN KC_RGUI -- cgit v1.2.3 From baf69ee89ded94b31a81c0b97ea942f489933a5b Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 12 Dec 2018 12:46:12 -0800 Subject: S7 Elephant Configurator fixes (#4614) * S7 Elephant: Configurator bugfix, part 1 Reformatted the JSON so each key is on its own line: This makes the keys easier to rearrange. * S7 Elephant: Configurator bugfix, part 2 Deleted the extra key from LAYOUT_iso_1u: JSON contents stated this layout used a split Backspace, but the matrix is configured and intended to have a 2u Backspace. Extended the Backspace to 2u width and deleted the extra key. (This fixes the error that broke LAYOUT_iso_1u's rendering in the Configurator.) * S7 Elephant: Configurator bugfix, part 3 Fix ISO layouts: Noticed JSON object for Enter on ISO layouts was immediately after Right Bracket. Inspection of s7_elephant.h revealed the expected and appropriate location to be after ISO Hash. Moved Enter key to the proper location on all ISO layouts. --- keyboards/s7_elephant/info.json | 2279 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 2249 insertions(+), 30 deletions(-) diff --git a/keyboards/s7_elephant/info.json b/keyboards/s7_elephant/info.json index 37f98d79d5..972f20ce04 100644 --- a/keyboards/s7_elephant/info.json +++ b/keyboards/s7_elephant/info.json @@ -7,123 +7,2342 @@ "layouts": { "LAYOUT_ansi": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_small_lshift": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_small_lshift_small_bspc": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_1u": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_1u_small_lshift": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_1u_small_bspc": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_1u_small_lshift_small_bspc": { "key_count": 75, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_7u": { "key_count": 71, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_7u_small_lshift": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_7u_small_bspc": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_7u_small_lshift_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_small_lshift": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_small_lshift_small_bspc": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_7u": { "key_count": 71, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_7u_small_lshift": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_7u_small_bspc": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":2.25}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_ansi_blocker_7u_small_lshift_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"|", "x":15.5, "y":1, "w":1.5}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"Enter", "x":14.75, "y":2, "w":2.25}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"|", "x":15.5, "y":1, "w":1.5}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"Enter", "x":14.75, "y":2, "w":2.25}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_small_bspc": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_1u": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_1u_small_bspc": { "key_count": 75, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4}, {"label":"Alt", "x":13, "y":4}, {"label":"Ctrl", "x":14, "y":4}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4}, + {"label":"Alt", "x":13, "y":4}, + {"label":"Ctrl", "x":14, "y":4}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_7u": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_7u_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4, "w":1.5}, {"x":5, "y":4, "w":7}, {"label":"Fn", "x":12, "y":4, "w":1.5}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4, "w":1.5}, + {"x":5, "y":4, "w":7}, + {"label":"Fn", "x":12, "y":4, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_blocker": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_blocker_small_bspc": { "key_count": 74, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.25}, {"label":"Win", "x":3.25, "y":4, "w":1.25}, {"label":"Alt", "x":4.5, "y":4, "w":1.25}, {"x":5.75, "y":4, "w":6.25}, {"label":"Fn", "x":12, "y":4, "w":1.25}, {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.25}, + {"label":"Win", "x":3.25, "y":4, "w":1.25}, + {"label":"Alt", "x":4.5, "y":4, "w":1.25}, + {"x":5.75, "y":4, "w":6.25}, + {"label":"Fn", "x":12, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.25, "y":4, "w":1.25}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_blocker_7u": { "key_count": 72, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0, "w":2}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0, "w":2}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] }, "LAYOUT_iso_blocker_7u_small_bspc": { "key_count": 73, - "layout": [{"label":"F1", "x":0, "y":0}, {"label":"Esc", "x":2, "y":0}, {"label":"!", "x":3, "y":0}, {"label":"@", "x":4, "y":0}, {"label":"#", "x":5, "y":0}, {"label":"$", "x":6, "y":0}, {"label":"%", "x":7, "y":0}, {"label":"^", "x":8, "y":0}, {"label":"&", "x":9, "y":0}, {"label":"*", "x":10, "y":0}, {"label":"(", "x":11, "y":0}, {"label":")", "x":12, "y":0}, {"label":"_", "x":13, "y":0}, {"label":"+", "x":14, "y":0}, {"label":"Backspace", "x":15, "y":0}, {"x":16, "y":0}, {"label":"Home", "x":17, "y":0}, {"label":"F2", "x":0, "y":1}, {"label":"Tab", "x":2, "y":1, "w":1.5}, {"label":"Q", "x":3.5, "y":1}, {"label":"W", "x":4.5, "y":1}, {"label":"E", "x":5.5, "y":1}, {"label":"R", "x":6.5, "y":1}, {"label":"T", "x":7.5, "y":1}, {"label":"Y", "x":8.5, "y":1}, {"label":"U", "x":9.5, "y":1}, {"label":"I", "x":10.5, "y":1}, {"label":"O", "x":11.5, "y":1}, {"label":"P", "x":12.5, "y":1}, {"label":"{", "x":13.5, "y":1}, {"label":"}", "x":14.5, "y":1}, {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, {"label":"End", "x":17, "y":1}, {"label":"F3", "x":0, "y":2}, {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, {"label":"A", "x":3.75, "y":2}, {"label":"S", "x":4.75, "y":2}, {"label":"D", "x":5.75, "y":2}, {"label":"F", "x":6.75, "y":2}, {"label":"G", "x":7.75, "y":2}, {"label":"H", "x":8.75, "y":2}, {"label":"J", "x":9.75, "y":2}, {"label":"K", "x":10.75, "y":2}, {"label":"L", "x":11.75, "y":2}, {"label":":", "x":12.75, "y":2}, {"label":"\"", "x":13.75, "y":2}, {"label":"|", "x":14.75, "y":2}, {"label":"Ins", "x":17, "y":2}, {"label":"F4", "x":0, "y":3}, {"label":"Shift", "x":2, "y":3, "w":1.25}, {"x":3.25, "y":3}, {"label":"Z", "x":4.25, "y":3}, {"label":"X", "x":5.25, "y":3}, {"label":"C", "x":6.25, "y":3}, {"label":"V", "x":7.25, "y":3}, {"label":"B", "x":8.25, "y":3}, {"label":"N", "x":9.25, "y":3}, {"label":"M", "x":10.25, "y":3}, {"label":"<", "x":11.25, "y":3}, {"label":">", "x":12.25, "y":3}, {"label":"?", "x":13.25, "y":3}, {"label":"Shift", "x":14.25, "y":3, "w":1.75}, {"label":"Up", "x":16, "y":3}, {"label":"Del", "x":17, "y":3}, {"label":"F5", "x":0, "y":4}, {"label":"Ctrl", "x":2, "y":4, "w":1.5}, {"label":"Win", "x":3.5, "y":4}, {"label":"Alt", "x":4.5, "y":4, "w":1.5}, {"x":6, "y":4, "w":6.75}, {"label":"Fn", "x":12.75, "y":4, "w":1.5}, {"label":"Left", "x":15, "y":4}, {"label":"Down", "x":16, "y":4}, {"label":"Right", "x":17, "y":4}] + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"Esc", "x":2, "y":0}, + {"label":"!", "x":3, "y":0}, + {"label":"@", "x":4, "y":0}, + {"label":"#", "x":5, "y":0}, + {"label":"$", "x":6, "y":0}, + {"label":"%", "x":7, "y":0}, + {"label":"^", "x":8, "y":0}, + {"label":"&", "x":9, "y":0}, + {"label":"*", "x":10, "y":0}, + {"label":"(", "x":11, "y":0}, + {"label":")", "x":12, "y":0}, + {"label":"_", "x":13, "y":0}, + {"label":"+", "x":14, "y":0}, + {"label":"Backspace", "x":15, "y":0}, + {"x":16, "y":0}, + {"label":"Home", "x":17, "y":0}, + {"label":"F2", "x":0, "y":1}, + {"label":"Tab", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"{", "x":13.5, "y":1}, + {"label":"}", "x":14.5, "y":1}, + {"label":"End", "x":17, "y":1}, + {"label":"F3", "x":0, "y":2}, + {"label":"Caps Lock", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":":", "x":12.75, "y":2}, + {"label":"\"", "x":13.75, "y":2}, + {"label":"|", "x":14.75, "y":2}, + {"label":"Enter", "x":15.75, "y":1, "w":1.25, "h":2}, + {"label":"Ins", "x":17, "y":2}, + {"label":"F4", "x":0, "y":3}, + {"label":"Shift", "x":2, "y":3, "w":1.25}, + {"x":3.25, "y":3}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"<", "x":11.25, "y":3}, + {"label":">", "x":12.25, "y":3}, + {"label":"?", "x":13.25, "y":3}, + {"label":"Shift", "x":14.25, "y":3, "w":1.75}, + {"label":"Up", "x":16, "y":3}, + {"label":"Del", "x":17, "y":3}, + {"label":"F5", "x":0, "y":4}, + {"label":"Ctrl", "x":2, "y":4, "w":1.5}, + {"label":"Win", "x":3.5, "y":4}, + {"label":"Alt", "x":4.5, "y":4, "w":1.5}, + {"x":6, "y":4, "w":6.75}, + {"label":"Fn", "x":12.75, "y":4, "w":1.5}, + {"label":"Left", "x":15, "y":4}, + {"label":"Down", "x":16, "y":4}, + {"label":"Right", "x":17, "y":4} + ] } } } -- cgit v1.2.3 From f6c0d999b99c6d18f838cd5d36f0351ca3345630 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 12 Dec 2018 12:46:56 -0800 Subject: Puck Refactor, Configurator support and readme cleanup (#4615) * Puck: layout macro refactor Reformat layout macro to resemble physical keyboard layout. * Puck: Configurator support * Puck: readme cleanup Markdown formatting corrections. --- keyboards/puck/info.json | 25 +++++++++++++++++++++++++ keyboards/puck/puck.h | 5 ++++- keyboards/puck/readme.md | 10 ++++++---- 3 files changed, 35 insertions(+), 5 deletions(-) create mode 100644 keyboards/puck/info.json diff --git a/keyboards/puck/info.json b/keyboards/puck/info.json new file mode 100644 index 0000000000..e8d03a43fd --- /dev/null +++ b/keyboards/puck/info.json @@ -0,0 +1,25 @@ +{ + "keyboard_name": "Puck", + "url": "", + "maintainer": "john-pettigrew", + "width": 3, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"SW1", "x":0, "y":0}, + {"label":"SW2", "x":1, "y":0}, + {"label":"SW3", "x":2, "y":0}, + {"label":"SW4", "x":0, "y":1}, + {"label":"SW5", "x":1, "y":1}, + {"label":"SW6", "x":2, "y":1}, + {"label":"SW7", "x":0, "y":2}, + {"label":"SW8", "x":1, "y":2}, + {"label":"SW9", "x":2, "y":2}, + {"label":"SW10", "x":0, "y":3}, + {"label":"SW11", "x":1, "y":3}, + {"label":"SW12", "x":2, "y":3} + ] + } + } +} diff --git a/keyboards/puck/puck.h b/keyboards/puck/puck.h index 4467614fdb..0f2a284a67 100644 --- a/keyboards/puck/puck.h +++ b/keyboards/puck/puck.h @@ -4,7 +4,10 @@ #include "quantum.h" #define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B \ + K00, K01, K02, \ + K03, K04, K05, \ + K06, K07, K08, \ + K09, K0A, K0B \ ) { \ { K00, K01, K02 }, \ { K03, K04, K05 }, \ diff --git a/keyboards/puck/readme.md b/keyboards/puck/readme.md index 45e438c471..fe1bd1668f 100644 --- a/keyboards/puck/readme.md +++ b/keyboards/puck/readme.md @@ -1,8 +1,10 @@ -A 4 x 3 macropad. +# Puck -Keyboard Maintainer: [john-pettigrew](https://github.com/john-pettigrew) -Hardware Supported: Puck PCB. -Hardware Availability: [OkKeebs.com](https://okkeebs.com/products/puck-pcb) +A 4x3 macropad. + +Keyboard Maintainer: [John Pettigrew](https://github.com/john-pettigrew) +Hardware Supported: Puck PCB +Hardware Availability: [OKKeebs.com](https://okkeebs.com/products/puck-pcb) Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From 4e78d28b4be046b2f21dfd6de2179fd7f821537f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 12 Dec 2018 15:08:34 -0800 Subject: Zlant: Configurator rendering bugfix (#4622) Configurator's API uses the available alias name, instead of the direct matrix name. --- keyboards/zlant/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/zlant/info.json b/keyboards/zlant/info.json index b1f20555c0..773fa5a31f 100644 --- a/keyboards/zlant/info.json +++ b/keyboards/zlant/info.json @@ -5,7 +5,7 @@ "width": 12.75, "height": 4, "layouts": { - "LAYOUT_ortho_4x12": { + "LAYOUT": { "key_count": 48, "layout": [{"label":"K000", "x":0, "y":0}, {"label":"K001", "x":1, "y":0}, {"label":"K002", "x":2, "y":0}, {"label":"K003", "x":3, "y":0}, {"label":"K004", "x":4, "y":0}, {"label":"K005", "x":5, "y":0}, {"label":"K006", "x":6, "y":0}, {"label":"K007", "x":7, "y":0}, {"label":"K008", "x":8, "y":0}, {"label":"K009", "x":9, "y":0}, {"label":"K010", "x":10, "y":0}, {"label":"K011", "x":11, "y":0}, {"label":"K100", "x":0.25, "y":1}, {"label":"K101", "x":1.25, "y":1}, {"label":"K102", "x":2.25, "y":1}, {"label":"K103", "x":3.25, "y":1}, {"label":"K104", "x":4.25, "y":1}, {"label":"K105", "x":5.25, "y":1}, {"label":"K106", "x":6.25, "y":1}, {"label":"K107", "x":7.25, "y":1}, {"label":"K108", "x":8.25, "y":1}, {"label":"K109", "x":9.25, "y":1}, {"label":"K110", "x":10.25, "y":1}, {"label":"K111", "x":11.25, "y":1}, {"label":"K200", "x":0.5, "y":2}, {"label":"K201", "x":1.5, "y":2}, {"label":"K202", "x":2.5, "y":2}, {"label":"K203", "x":3.5, "y":2}, {"label":"K204", "x":4.5, "y":2}, {"label":"K205", "x":5.5, "y":2}, {"label":"K206", "x":6.5, "y":2}, {"label":"K207", "x":7.5, "y":2}, {"label":"K208", "x":8.5, "y":2}, {"label":"K209", "x":9.5, "y":2}, {"label":"K210", "x":10.5, "y":2}, {"label":"K211", "x":11.5, "y":2}, {"label":"K300", "x":0.75, "y":3}, {"label":"K301", "x":1.75, "y":3}, {"label":"K302", "x":2.75, "y":3}, {"label":"K303", "x":3.75, "y":3}, {"label":"K304", "x":4.75, "y":3}, {"label":"K305", "x":5.75, "y":3}, {"label":"K306", "x":6.75, "y":3}, {"label":"K307", "x":7.75, "y":3}, {"label":"K308", "x":8.75, "y":3}, {"label":"K309", "x":9.75, "y":3}, {"label":"K310", "x":10.75, "y":3}, {"label":"K311", "x":11.75, "y":3}] }, -- cgit v1.2.3 From 2cef75cbb3ba9a3c05cf6914c6bafb720f2f2b83 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 12 Dec 2018 18:20:30 -0500 Subject: Keymap: update ishtobs hadron keymap (#4613) * adding ishtob's keymap to hadron ver3 * update ishtob keymap * ishtob hadron keymap update 2 * Delete readme (Case Conflict).md * Delete readme (Case Conflict).md * add missing FN layer to ishtob hadron keymap * removed unused toggle keycode --- keyboards/hadron/ver3/keymaps/ishtob/keymap.c | 41 ++++++++++++++++++++------- keyboards/hadron/ver3/rev3.h | 21 -------------- 2 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 keyboards/hadron/ver3/rev3.h diff --git a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c index 870781930d..530508b010 100644 --- a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c +++ b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c @@ -18,10 +18,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT_wrapper( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, _________________QWERTY_L1_________________, KC_P7, KC_P8, KC_P9, _________________QWERTY_R1_________________, KC_BSPC, \ + LT_FN(KC_TAB), _________________QWERTY_L1_________________, KC_P7, KC_P8, KC_P9, _________________QWERTY_R1_________________, KC_BSPC, \ KC_CAPS, _________________QWERTY_L2_________________, KC_P4, KC_P5, KC_P6, _________________QWERTY_R2_________________, CTL_ENT, \ KC_LSFT, _________________QWERTY_L3_________________, KC_P1, KC_P2, KC_P3, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), \ - KC_ESC, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ + KC_ESC, KC_LCTRL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ ), /* Colemak @@ -39,10 +39,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_COLEMAK] = LAYOUT_wrapper( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, _________________COLEMAK_L1________________, KC_P7, KC_P8, KC_P9, _________________COLEMAK_R1________________, KC_BSPC, \ + LT_FN(KC_TAB), _________________COLEMAK_L1________________, KC_P7, KC_P8, KC_P9, _________________COLEMAK_R1________________, KC_BSPC, \ KC_LCTRL, _________________COLEMAK_L2________________, KC_P4, KC_P5, KC_P6, _________________COLEMAK_R2________________, CTL_ENT, \ KC_LSFT, _________________COLEMAK_L3________________, KC_P1, KC_P2, KC_P3, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), \ - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ ), /* Dvorak @@ -60,10 +60,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_DVORAK] = LAYOUT_wrapper( KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL,\ - KC_TAB, _________________DVORAK_L1_________________, KC_P7, KC_P8, KC_P9, _________________DVORAK_R1_________________, KC_BSPC, \ + LT_FN(KC_TAB), _________________DVORAK_L1_________________, KC_P7, KC_P8, KC_P9, _________________DVORAK_R1_________________, KC_BSPC, \ KC_LCTL, _________________DVORAK_L2_________________, KC_P4, KC_P5, KC_P6, _________________DVORAK_R2_________________, CTL_ENT, \ KC_LSFT, _________________DVORAK_L3_________________, KC_P1, KC_P2, KC_P3, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), \ - KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, TG_NUMLAY, KC_APP, KC_DEL \ + KC_ESC, KC_CAPS, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_P0, KC_DOT, KC_EQL, KC_SPC, RAISE, KC_RALT, KC_RGUI, KC_APP, KC_DEL \ ), /* Lower @@ -102,10 +102,31 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_RAISE] = LAYOUT_wrapper( KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ - KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12, KC_NUHS, KC_NUBS, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ________________NUMBER_LEFT________________, KC_6, _______, _______, _______, KC_7, KC_8, KC_9, KC_0, KC_PLUS, KC_BSLS, \ + KC_DEL, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, _______, _______, _______, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, \ + _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, _______, _______, _______, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, \ + _______, _______, _______, _______, _______, KC_SPC, _______, _______, KC_SPC, KC_0, _______, KC_LEFT, KC_DOWN, KC_RIGHT, KC_NLCK \ +), + +/* FN layer on Esc key + * ,------+------+------+------+------+------------------------------------------------. + * | Esc | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------+--------------------. + * | | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | + | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | _ | = | [ | ] | ' | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | | | F12 |ISO ~ |ISO | | { | } |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | Next | Vol- | Vol+ | Play | + * '------+------+------+------+------+------+------+------+------+------+------+------+--------------------' + */ +[_FNLAYER] = LAYOUT_wrapper( + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, \ + _______, __________________LONG_FUNC_LEFT___________________, _______, _______, _______, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, \ + _______, __________________LONG_FUNC_RIGHT__________________, _______, _______, _______,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), /* Mouse Layer (semi-col) diff --git a/keyboards/hadron/ver3/rev3.h b/keyboards/hadron/ver3/rev3.h deleted file mode 100644 index 2cbd53acef..0000000000 --- a/keyboards/hadron/ver3/rev3.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2018 Jack Humbert - * - * 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 . - */ -#ifndef REV3_H -#define REV3_H - -#include "hadron.h" - -#endif \ No newline at end of file -- cgit v1.2.3 From ca39fa8222ed339f09b2713bd538880fd4f2ff0e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 12 Dec 2018 16:46:13 -0800 Subject: Keyboard: handwired/kbod Refactor, Configurator support and readme update (#4623) * handwired/kbod: refactor - layout macro KEYMAP renamed to LAYOUT * handwired/kbod: update config.h files to #pragma once * handwired/kbod: Configurator support * handwired/kbod: readme update - updated reademe to current template - added image --- keyboards/handwired/kbod/config.h | 5 +- keyboards/handwired/kbod/info.json | 74 +++++++++++++++++++++++ keyboards/handwired/kbod/kbod.h | 2 +- keyboards/handwired/kbod/keymaps/default/config.h | 7 +-- keyboards/handwired/kbod/keymaps/default/keymap.c | 54 ++++++++--------- keyboards/handwired/kbod/readme.md | 23 +++---- 6 files changed, 113 insertions(+), 52 deletions(-) create mode 100644 keyboards/handwired/kbod/info.json diff --git a/keyboards/handwired/kbod/config.h b/keyboards/handwired/kbod/config.h index a3f3e3908a..d3869f99ef 100644 --- a/keyboards/handwired/kbod/config.h +++ b/keyboards/handwired/kbod/config.h @@ -15,8 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -161,5 +160,3 @@ along with this program. If not, see . #undef TAPPING_TOGGLE #define TAPPING_TOGGLE 2 - -#endif diff --git a/keyboards/handwired/kbod/info.json b/keyboards/handwired/kbod/info.json new file mode 100644 index 0000000000..02586164b2 --- /dev/null +++ b/keyboards/handwired/kbod/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "kbod", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/kbod/kbod.h b/keyboards/handwired/kbod/kbod.h index 3560636242..5d9dbd05b3 100644 --- a/keyboards/handwired/kbod/kbod.h +++ b/keyboards/handwired/kbod/kbod.h @@ -3,7 +3,7 @@ #include "quantum.h" -#define KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, \ k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, \ k20, k21, k22, k23, k24, k25, k26, k27, k28, k29, k2A, k2B, k2C, \ diff --git a/keyboards/handwired/kbod/keymaps/default/config.h b/keyboards/handwired/kbod/keymaps/default/config.h index df06a26206..271f48d001 100644 --- a/keyboards/handwired/kbod/keymaps/default/config.h +++ b/keyboards/handwired/kbod/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif \ No newline at end of file diff --git a/keyboards/handwired/kbod/keymaps/default/keymap.c b/keyboards/handwired/kbod/keymaps/default/keymap.c index 1386b742f5..063a94b4d2 100644 --- a/keyboards/handwired/kbod/keymaps/default/keymap.c +++ b/keyboards/handwired/kbod/keymaps/default/keymap.c @@ -1,6 +1,4 @@ -#include "kbod.h" - -#define _____ KC_TRNS +#include QMK_KEYBOARD_H #define MODS_PRESSED(btn) (get_mods() & (MOD_BIT(KC_L##btn)|MOD_BIT(KC_R##btn))) @@ -25,33 +23,33 @@ if (record->event.pressed) { \ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - KEYMAP( /* Base */ - F(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQUAL, KC_BSPC, - 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_BSLASH, - KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, KC_QUOT, KC_ENTER, - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSFT, - TT(1), KC_LCTL, KC_LALT, KC_SPACE, KC_RALT, KC_RGUI, KC_APP, KC_RCTL + LAYOUT( /* Base */ + F(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, \ + 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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + TT(1), KC_LCTL, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL \ ), - KEYMAP( /* Cursor layer */ - KC_GRAVE, 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_DEL, - TT(3), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_INSERT, - TT(2), _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_HOME, _____, - _____, _____, _____, _____, _____, _____, _____, _____, KC_PGUP, KC_PGDN, KC_END, KC_UP, - _____, _____, _____, _____, _____, KC_LEFT, KC_DOWN, KC_RIGHT + LAYOUT( /* Cursor layer */ + KC_GRV, 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_DEL, \ + TT(3), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, \ + TT(2), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_PGDN, KC_END, KC_UP, \ + _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT \ ), - KEYMAP( /* Keypad layer */ - TO(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC, - _____, _____, _____, _____, _____, _____, _____, KC_P4, KC_P5, KC_P6, _____, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, KC_P1, KC_P2, KC_P3, _____, _____, _____, - _____, _____, _____, _____, _____, _____, _____, KC_P0, KC_PDOT, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, - _____, _____, _____, _____, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN3 + LAYOUT( /* Keypad layer */ + TO(0), KC_1, KC_2, KC_3, F(1), KC_5, KC_6, KC_P7, KC_P8, KC_P9, KC_P0, KC_PMNS, KC_PPLS, KC_BSPC, \ + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, KC_P0, KC_PDOT, KC_BTN1, KC_MS_U, KC_BTN2, \ + _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN3 \ ), - KEYMAP( /* Multimedia layer */ - TO(0), _____, _____, _____, _____, _____, _____, _____, _____, _____, KC_AUDIO_MUTE, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, _____, - _____, _____, KC_WAKE, _____, _____, _____, _____, _____, _____, _____, KC_MSTP, KC_MPRV, KC_MNXT, _____, - _____, _____, KC_SLEP, _____, _____, _____, _____, _____, _____, _____, _____, _____, _____, - _____, _____, KC_PWR, _____, _____, _____, _____, _____, _____, KC_MS_BTN1, KC_MS_WH_UP, KC_MS_BTN2, - _____, _____, _____, KC_MPLY, KC_MS_WH_LEFT, KC_MS_WH_DOWN, KC_MS_WH_RIGHT, KC_MS_BTN3 + LAYOUT( /* Multimedia layer */ + TO(0), _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, _______, \ + _______, _______, KC_WAKE, _______, _______, _______, _______, _______, _______, _______, KC_MSTP, KC_MPRV, KC_MNXT, _______, \ + _______, _______, KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, KC_PWR, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_WH_U, KC_BTN2, \ + _______, _______, _______, KC_MPLY, KC_WH_L, KC_WH_D, KC_WH_R, KC_BTN3 \ ), }; @@ -101,4 +99,4 @@ void matrix_scan_user(void) { } else { PORTC &= ~_BV(PC7); } -} \ No newline at end of file +} diff --git a/keyboards/handwired/kbod/readme.md b/keyboards/handwired/kbod/readme.md index d2f2c01ae8..470ccce0e3 100644 --- a/keyboards/handwired/kbod/readme.md +++ b/keyboards/handwired/kbod/readme.md @@ -1,21 +1,18 @@ -KBOD keyboard firmware -====================== +# KBOD -KBOD is a 60% Keyboard kit, hand-wired, with Arduino Micro as its controller. It's utilize 8x8 matrix and has layout similar to GH-60 +![KBOD](https://f4.fudanchii.net/shx/2017/02/IMG_20170212_224547.jpg) -## Quantum MK Firmware +KBOD is a 60% Keyboard kit, hand-wired, with Arduino Micro as its controller. It utilizes an 8x8 matrix and has layout similar to GH60. [More info](https://github.com/fudanchii/keyboard_of_disapproval) -For the full Quantum feature list, see [the parent readme](/). +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: Arduino Micro -## Building +Make example for this keyboard (after setting up your build environment): -Download or clone the whole firmware and use ```make handwired/kbod:default``` to generate the .hex file. You may flash it with avrdude + make handwired/kbod:default -## Flashing -Something along this line: +Flashing your firmware may be done with avrdude. The command should be something along this line: -``` -avrdude -p m32u4 -c avr109 -P -C -e -u flash:w:handwired_kbod_default.hex -``` + avrdude -p m32u4 -c avr109 -P -C -e -u flash:w:handwired_kbod_default.hex -[More info](https://github.com/fudanchii/keyboard_of_disapproval) \ No newline at end of file +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). -- cgit v1.2.3 From 24b17c96191d0791110ef6b51fa54f74d91075de Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 12 Dec 2018 17:56:29 -0800 Subject: Keyboard: handwired/maartenwut readme cleanup and Configurator support (#4624) * handwired/maartenwut: readme cleanup - Fixed typo (Maarten's last name was misspelled) - Updated Docs links * handwired/maartenwut: Configurator support --- keyboards/handwired/maartenwut/info.json | 80 ++++++++++++++++++++++++++++++++ keyboards/handwired/maartenwut/readme.md | 4 +- 2 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 keyboards/handwired/maartenwut/info.json diff --git a/keyboards/handwired/maartenwut/info.json b/keyboards/handwired/maartenwut/info.json new file mode 100644 index 0000000000..98720d24f1 --- /dev/null +++ b/keyboards/handwired/maartenwut/info.json @@ -0,0 +1,80 @@ +{ + "keyboard_name": "Maartenwut Ortho", + "url": "", + "maintainer": "maartenwut", + "width": 14, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"[", "x":11, "y":1}, + {"label":"]", "x":12, "y":1}, + {"label":"\\", "x":13, "y":1}, + {"label":"Tab", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Delete", "x":12, "y":2}, + {"label":"Enter", "x":13, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Shift", "x":11, "y":3}, + {"label":"Up", "x":12, "y":3}, + {"label":"Print Screen", "x":13, "y":3}, + {"label":"Ctrl", "x":0, "y":4}, + {"label":"GUI", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Fn", "x":3, "y":4}, + {"label":"Fn3 / Space", "x":4, "y":4, "w":2.25}, + {"label":"Space", "x":6.25, "y":4, "w":2.75}, + {"label":"Fn2", "x":9, "y":4}, + {"label":"Alt", "x":10, "y":4}, + {"label":"Left", "x":11, "y":4}, + {"label":"Down", "x":12, "y":4}, + {"label":"Right", "x":13, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/maartenwut/readme.md b/keyboards/handwired/maartenwut/readme.md index 31fc76743c..0ae7382711 100644 --- a/keyboards/handwired/maartenwut/readme.md +++ b/keyboards/handwired/maartenwut/readme.md @@ -2,7 +2,7 @@ Custom handwired keyboard for maartenwut. -Keyboard Maintainer: [Maarten Dekekrs](https://github.com/maartenwut) +Keyboard Maintainer: [Maarten Dekkers](https://github.com/maartenwut) Hardware Supported: Custom handwired Hardware Availability: @@ -10,4 +10,4 @@ Make example for this keyboard (after setting up your build environment): make handwired/maartenwut:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. \ No newline at end of file +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). -- cgit v1.2.3 From cc45f62d757f56c2fa9be92685f83f127b63b509 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Thu, 13 Dec 2018 19:33:04 +1100 Subject: Added Dynamic Keymaps to M10-B --- keyboards/rama/m10_b/config.h | 24 ++++++++++++++- keyboards/rama/m10_b/keymaps/default/keymap.c | 18 ------------ keyboards/rama/m10_b/keymaps/knops/config.h | 3 +- keyboards/rama/m10_b/m10_b.c | 31 ++------------------ keyboards/rama/m10_b/rules.mk | 42 +++++++++++++-------------- keyboards/rama/u80_a/config.h | 2 ++ keyboards/rama/u80_a/rules.mk | 1 - keyboards/wilba_tech/wt60_a/config.h | 2 ++ keyboards/wilba_tech/wt65_a/config.h | 2 ++ keyboards/wilba_tech/wt80_a/config.h | 2 ++ keyboards/wilba_tech/wt_main.c | 6 ++++ 11 files changed, 62 insertions(+), 71 deletions(-) diff --git a/keyboards/rama/m10_b/config.h b/keyboards/rama/m10_b/config.h index de626dba53..144f88d56d 100644 --- a/keyboards/rama/m10_b/config.h +++ b/keyboards/rama/m10_b/config.h @@ -26,7 +26,7 @@ along with this program. If not, see . #define DEVICE_VER 0x0001 #define MANUFACTURER RAMA.WORKS #define PRODUCT RAMA M10-B -#define DESCRIPTION RAMA M10-B Macropad +#define DESCRIPTION RAMA M10-B /* key matrix size */ #define MATRIX_ROWS 1 @@ -186,4 +186,26 @@ along with this program. If not, see . /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +//#define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*10*2)) = (35+80) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 115 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 909 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 + #endif diff --git a/keyboards/rama/m10_b/keymaps/default/keymap.c b/keyboards/rama/m10_b/keymaps/default/keymap.c index 8002b8c7cd..c307bcb2a7 100644 --- a/keyboards/rama/m10_b/keymaps/default/keymap.c +++ b/keyboards/rama/m10_b/keymaps/default/keymap.c @@ -6,21 +6,3 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_KP_7, KC_KP_8, KC_KP_9, KC_KP_4, KC_KP_5, KC_KP_6, KC_KP_1, KC_KP_2, KC_KP_3, KC_KP_0 ) }; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - return MACRO_NONE; -} - -void matrix_init_user(void) -{ -} - -void matrix_scan_user(void) -{ -} - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - return true; -} diff --git a/keyboards/rama/m10_b/keymaps/knops/config.h b/keyboards/rama/m10_b/keymaps/knops/config.h index d150575c1a..7c3ec9601d 100644 --- a/keyboards/rama/m10_b/keymaps/knops/config.h +++ b/keyboards/rama/m10_b/keymaps/knops/config.h @@ -19,6 +19,7 @@ #include "../../config.h" -// place overrides here +#undef RAW_ENABLE +#undef DYNAMIC_KEYMAP_ENABLE #endif diff --git a/keyboards/rama/m10_b/m10_b.c b/keyboards/rama/m10_b/m10_b.c index f43f6e2a19..ccff6d62c9 100644 --- a/keyboards/rama/m10_b/m10_b.c +++ b/keyboards/rama/m10_b/m10_b.c @@ -1,4 +1,4 @@ -/* Copyright 2018 Wilba +/* Copyright 2018 Jason Williams (Wilba) * * 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 @@ -13,32 +13,5 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#include "m10_b.h" -/* -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} -*/ +// Nothing to see here, move along... ;-) diff --git a/keyboards/rama/m10_b/rules.mk b/keyboards/rama/m10_b/rules.mk index 24df4632dd..70258b9ead 100644 --- a/keyboards/rama/m10_b/rules.mk +++ b/keyboards/rama/m10_b/rules.mk @@ -1,5 +1,7 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + # MCU name -#MCU = at90usb1286 MCU = atmega32u4 # Processor frequency. @@ -39,30 +41,28 @@ F_USB = $(F_CPU) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=4096 +# Boot Section +BOOTLOADER = atmel-dfu # 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 +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +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 ?= no # USB Nkey Rollover -BACKLIGHT_ENABLE ?= yes # Enable keyboard backlight functionality on B7 by default -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 +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes diff --git a/keyboards/rama/u80_a/config.h b/keyboards/rama/u80_a/config.h index b5dc27598a..c733601e17 100644 --- a/keyboards/rama/u80_a/config.h +++ b/keyboards/rama/u80_a/config.h @@ -185,6 +185,8 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/rama/u80_a/rules.mk b/keyboards/rama/u80_a/rules.mk index 67b04e350e..54479529be 100644 --- a/keyboards/rama/u80_a/rules.mk +++ b/keyboards/rama/u80_a/rules.mk @@ -69,4 +69,3 @@ FAUXCLICKY_ENABLE = no # Use buzzer to emulate clicky switches RAW_ENABLE = yes DYNAMIC_KEYMAP_ENABLE = yes -CIE1931_CURVE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt60_a/config.h b/keyboards/wilba_tech/wt60_a/config.h index 8c18582a88..9eff7d7f1b 100644 --- a/keyboards/wilba_tech/wt60_a/config.h +++ b/keyboards/wilba_tech/wt60_a/config.h @@ -185,6 +185,8 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/wilba_tech/wt65_a/config.h b/keyboards/wilba_tech/wt65_a/config.h index 88e9023539..88366edc04 100644 --- a/keyboards/wilba_tech/wt65_a/config.h +++ b/keyboards/wilba_tech/wt65_a/config.h @@ -185,6 +185,8 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/wilba_tech/wt80_a/config.h b/keyboards/wilba_tech/wt80_a/config.h index ca03c366e9..7c15e4a5b1 100644 --- a/keyboards/wilba_tech/wt80_a/config.h +++ b/keyboards/wilba_tech/wt80_a/config.h @@ -185,6 +185,8 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 1 +#define WT_MONO_BACKLIGHT + #define DYNAMIC_KEYMAP_LAYER_COUNT 4 // EEPROM usage diff --git a/keyboards/wilba_tech/wt_main.c b/keyboards/wilba_tech/wt_main.c index de6d7b92c1..7a63ab5b74 100644 --- a/keyboards/wilba_tech/wt_main.c +++ b/keyboards/wilba_tech/wt_main.c @@ -15,7 +15,9 @@ */ #include "quantum.h" +#ifdef WT_MONO_BACKLIGHT #include "keyboards/wilba_tech/wt_mono_backlight.h" +#endif #include "keyboards/zeal60/zeal60_api.h" // Temporary hack #include "keyboards/zeal60/zeal60_keycodes.h" // Temporary hack @@ -194,11 +196,13 @@ void main_init(void) eeprom_set_valid(true); } +#ifdef WT_MONO_BACKLIGHT // Initialize LED drivers for backlight. backlight_init_drivers(); backlight_timer_init(); backlight_timer_enable(); +#endif } void bootmagic_lite(void) @@ -230,8 +234,10 @@ void matrix_init_kb(void) void matrix_scan_kb(void) { +#ifdef WT_MONO_BACKLIGHT // This only updates the LED driver buffers if something has changed. backlight_update_pwm_buffers(); +#endif matrix_scan_user(); } -- cgit v1.2.3 From e8f730595c37a508ad86cc46fa39c7fae4d36800 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Tue, 30 Oct 2018 01:09:22 -0700 Subject: Dactyl_manuform map and updates to my ergodox layout for moving to a different location. --- .../dactyl_manuform/5x6/keymaps/333fred/config.h | 9 + .../dactyl_manuform/5x6/keymaps/333fred/keymap.c | 80 +++++ .../dactyl_manuform/5x6/keymaps/333fred/rules.mk | 7 + layouts/community/ergodox/333fred/keymap.c | 350 +++++++++------------ layouts/community/ergodox/333fred/visualizer.c | 14 +- users/333fred/333fred.h | 11 +- 6 files changed, 269 insertions(+), 202 deletions(-) create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c create mode 100644 keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h new file mode 100644 index 0000000000..10b9693267 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/config.h @@ -0,0 +1,9 @@ +#pragma once + +#include "333fred_config.h" + +#define USE_SERIAL +#define EE_HANDS + +#undef TAPPING_TERM +#define TAPPING_TERM 200 diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c new file mode 100644 index 0000000000..c37009f24d --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/keymap.c @@ -0,0 +1,80 @@ +#include QMK_KEYBOARD_H +#include "333fred.h" + +enum custom_macros { + DLEFT, + DRIGHT, + PSCREEN_APP +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [BASE] = LAYOUT_5x6( + 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_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, OSM(MOD_RSFT), + KC_F4, KC_F5, TG(CODEFLOW), KC_EQL, + KC_LALT, KC_BSPC, KC_SPC, OSL(VIM), + KC_TAB, TD(TD_SYM_VIM), KC_ENT, KC_RGUI, + KC_LCTL, KC_DEL, KC_UP, KC_DOWN + ), + + [CODEFLOW] = LAYOUT_5x6( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + KC_F7, KC_F8, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), + + [SYMB] = LAYOUT_5x6( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + _______, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, _______, KC_7, KC_8, KC_9, _______, KC_F12, + _______, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, _______, KC_4, KC_5, KC_6, _______, _______, + _______, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, _______, KC_1, KC_2, KC_3, _______, _______, + KC_F7, KC_F8, KC_0, KC_ENT, + _______, _______, KC_MPLY, KC_MNXT, + _______, _______, KC_MPRV, _______, + _______, _______, KC_VOLU, KC_VOLD + ), + + [VIM] = LAYOUT_5x6( + _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, RESET, _______, + _______, _______, _______, _______, KC_LSFT, _______, _______, _______, _______, _______, _______, _______, + _______, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______, + _______, _______, _______, _______ + ), +}; + +const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { + switch(id) { + case DLEFT: + if (record->event.pressed) { // Windows move desktop left + return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); + } + break; + case DRIGHT: + if (record->event.pressed) { // Windows move desktop right + return MACRO(D(LCTL), D(LGUI), T(RIGHT), U(LGUI), U(LCTL), END); + } + break; + case PSCREEN_APP: if (record->event.pressed) { + return MACRO(D(LALT), T(PSCR), U(LALT), END); + } + break; + } + return MACRO_NONE; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + tap_dance_process_record(keycode); + return true; +} diff --git a/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk new file mode 100644 index 0000000000..79ef33e7c3 --- /dev/null +++ b/keyboards/handwired/dactyl_manuform/5x6/keymaps/333fred/rules.mk @@ -0,0 +1,7 @@ + +NKRO_ENABLE = yes +KEY_LOCK_ENABLE = yes +TAP_DANCE_ENABLE = yes +CONSOLE_ENABLE = no +PERMISSIVE_HOLD = yes +EXTRAFLAGS += -flto diff --git a/layouts/community/ergodox/333fred/keymap.c b/layouts/community/ergodox/333fred/keymap.c index d7728a5bd4..b203f42c62 100644 --- a/layouts/community/ergodox/333fred/keymap.c +++ b/layouts/community/ergodox/333fred/keymap.c @@ -11,28 +11,19 @@ enum custom_keycodes { }; enum custom_macros { - VERSION, - EEPROM, - // Windows macros DLEFT, DRIGHT, PSCREEN_APP, LSFT_TAB, - // VS Macros - REFACTOR, - TEST, - DEBUG_TEST, - FORMAT, - BUILD, - GO_TO_IMPL, - FIND_ALL_REF, - REMOVE_SORT_USINGS, - // KeePass macros KEEPASS_OPEN, KEEPASS_TYPE, + + // Terminal Copy/Paste + TERM_CP, + TERM_PT }; // NOTE: Cells marked with ACCESS must remain transparent, they're the keys that actually get to that layer @@ -41,131 +32,111 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Keymap 0: Basic layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | ` | 1 | 2 | 3 | 4 | 5 | = | | L1 | 6 | 7 | 8 | 9 | 0 | - | + * | ` | 1 | 2 | 3 | 4 | 5 | F5 | | F6 | 6 | 7 | 8 | 9 | 0 | - | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | TAB | Q | W | E | R | T | L1 | | L2 | Y | U | I | O | P | \ | + * | TAB | Q | W | E | R | T | GAME | |GAMEA | Y | U | I | O | P | \ | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | Esc | A | S | D | F | G |------| |------| H | J | K | L | ; | ' | - * |--------+------+------+------+------+------| L2 | |MO(3) |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| SYMB | |MEDIA |------+------+------+------+------+--------| * | LShift |Z/Ctrl| X | C | V | B | | | | N | M | , | . |//Ctrl| RShift | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | Up | Right| RGUI | + * |LCTRL | F4 | F5 | LGUI | LALT | | Left | Down | = | Right| RGUI | * `----------------------------------' `----------------------------------' * ,-------------. ,-------------. * | Copy | Paste| | Copy | Paste | * ,------|------|------| |------+--------+------. - * | | | PgUp | | PgDn | | | + * | | | PgUp | | Up | | | * | Bcksp|OSL(2)|------| |------| Ent |Space | - * | | VIM | Del | | RCtrl| | | + * | | VIM | Del | | Down | | | * `--------------------' `----------------------' */ -// If it accepts an argument (i.e, is a function), it doesn't need KC_. -// Otherwise, it needs KC_* -[BASE] = LAYOUT_ergodox( // layer 0 : default +[BASE] = LAYOUT_ergodox_pretty( // layer 0 : default // left hand - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_EQL, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(CODE), - KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, - OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), - OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI,KC_LALT, - LCTL(KC_C), LCTL(KC_V), - KC_PGUP, - KC_BSPC,TD(TD_SYM_VIM), KC_DEL, - // right hand - TG(CODE), KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, - TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, - KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, - MO(MDIA), KC_N, KC_M, KC_COMM,KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), - KC_LEFT,KC_DOWN,KC_UP, KC_RIGHT, KC_RGUI, - LCTL(KC_C), LCTL(KC_V), - KC_PGDN, - KC_RCTL, KC_ENT, KC_SPC + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_F5, KC_F6, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(GAME), TG(GAME_ARROW), KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + OSM(MOD_LSFT), CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, TG(SYMB), MO(MDIA), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLSH), OSM(MOD_RSFT), + OSM(MOD_LCTL), KC_F4, KC_F5, KC_LGUI, KC_LALT, KC_LEFT, KC_DOWN, KC_EQL, KC_RIGHT, KC_RGUI, + LCTL(KC_C), LCTL(KC_V), LCTL(KC_C), LCTL(KC_V), + KC_PGUP, KC_UP, + KC_BSPC, TD(TD_SYM_VIM), KC_DEL, KC_DOWN, KC_ENT, KC_SPC ), -/* Keymap 1: Code Layer + +/* Keymap 2: Codeflow Layer * * ,--------------------------------------------------. ,--------------------------------------------------. - * | | | | | | | | |ACCESS| | | | | | | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | | | | | | | F10 | | F11 | | | | | | | + * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | |------| |------| | | | | | | - * |--------+------+------+------+------+------| L2 | | |------+------+------+------+------+--------| + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | | | | | | | | | | | | | | | * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | | | | | | | F12 |GoToIm| FAR | | | + * | | | | | | | F7 | F8 | | | | * `----------------------------------' `----------------------------------' * ,-------------. ,---------------. - * |Format|Build | | Copy | Paste | + * | |ACCESS| | | | * ,------|------|------| |------+--------+------. - * | | |Refact| | Up | | | - * | |ACCESS|------| |------| | | - * | | | | | Down | | | + * | | | | | | | | + * | | |------| |------| | | + * | | | | | | | | * `--------------------' `----------------------' */ // If it accepts an argument (i.e, is a function), it doesn't need KC_. // Otherwise, it needs KC_* -[CODE] = LAYOUT_ergodox( // layer 1 : code +[CODEFLOW] = LAYOUT_ergodox( // layer 1 : code // left hand KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_F10, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, TG(SYMB), + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - M(FORMAT),M(BUILD), - M(REFACTOR), - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, + // right han - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F11, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_F12, M(GO_TO_IMPL),M(FIND_ALL_REF),KC_TRNS, KC_TRNS, - LCTL(KC_C), LCTL(KC_V), - KC_UP, - KC_DOWN, KC_TRNS, KC_TRNS + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F7, KC_F8, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS ), -/* Keymap 2: Symbol Layer +/* Keymap 3: Symbol Layer * * ,---------------------------------------------------. ,--------------------------------------------------. - * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | + * | | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 | * |---------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | | ! | @ | ( | ) | | |ACCESS| |ACCESS| Up | 7 | 8 | 9 | * | F12 | + * | | ! | @ | ( | ) | | | | | | Up | 7 | 8 | 9 | * | F12 | * |---------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | | # | $ | { | } | ` |------| |------| Down | 4 | 5 | 6 | + | | * |---------+------+------+------+------+------|ACCESS| | |------+------+------+------+------+--------| * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | \ | | * `---------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | EPRM | | | | | | 0 | 0 | . | = | | + * | | | | | | | 0 | 0 | . | = | | * `-----------------------------------' `----------------------------------' * ,-------------. ,-------------. - * | | Caps | | | | + * | | | | | | * ,------|------|------| |------+------+------. * | | |APScr | | | | | * | |ACCESS|------| |------| | | - * | | | PScr | |ACCESS| | | + * | | | PScr | | | | | * `--------------------' `--------------------' */ -// SYMBOLS -[SYMB] = LAYOUT_ergodox( +[SYMB] = LAYOUT_ergodox_pretty( // left hand - VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, - KC_TRNS,KC_EXLM,KC_AT, KC_LPRN,KC_RPRN,KC_PIPE,KC_TRNS, - KC_TRNS,KC_HASH,KC_DLR, KC_LCBR,KC_RCBR,KC_GRV, - KC_TRNS,KC_PERC,KC_CIRC,KC_LBRC,KC_RBRC,KC_TILD,KC_TRNS, - EPRM,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS, - KC_TRNS,KC_CAPS, - M(PSCREEN_APP), - KC_TRNS,KC_TRNS,KC_PSCR, - // right hand - KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, - KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, - KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, - KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, - KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS + KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TRNS, KC_TRNS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, + KC_TRNS, KC_EXLM, KC_AT, KC_LPRN, KC_RPRN, KC_PIPE, KC_TRNS, KC_TRNS, KC_UP, KC_7, KC_8, KC_9, KC_ASTR, KC_F12, + KC_TRNS, KC_HASH, KC_DLR, KC_LCBR, KC_RCBR, KC_GRV, KC_DOWN, KC_4, KC_5, KC_6, KC_PLUS, KC_TRNS, + KC_TRNS, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_TILD, KC_TRNS, KC_TRNS, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_0, KC_DOT, KC_EQL, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + M(PSCREEN_APP), KC_TRNS, + KC_TRNS, KC_TRNS, KC_PSCR, KC_TRNS, KC_TRNS, KC_TRNS ), /* Keymap 3: Media and mouse keys * @@ -188,32 +159,22 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | Back | | | * `--------------------' `--------------------' */ -// MEDIA AND MOUSE -[MDIA] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, - BL_INC, BL_DEC, - BL_TOGG, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_VOLU, KC_TRNS, - KC_VOLD, - KC_MPRV, KC_MPLY, KC_MNXT +[MDIA] = LAYOUT_ergodox_pretty( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_U, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_MS_L, KC_MS_D, KC_MS_R, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_BTN1, KC_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + BL_INC, BL_DEC, KC_VOLU, KC_TRNS, + BL_TOGG, KC_VOLD, + KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MPLY, KC_MNXT ), /* Keymap 4: Movement * * ,--------------------------------------------------. ,--------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| - * | |KOpen |KType |LSHFT | | | | | | Copy | | | | Paste| | + * | |KOpen |KType |TERMCP|TERMPT| | | | | Copy | | | | Paste| | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| * | |DLeft |DRight|LCTRL | LGUI | |------| |------| Left | Down | Up | Right| | | * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| @@ -230,26 +191,84 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------' `--------------------' */ // MEDIA AND MOUSE -[VIM] = LAYOUT_ergodox( - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(KEEPASS_OPEN),M(KEEPASS_TYPE),KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, KC_TRNS, - KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, - // right hand - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, LCTL(KC_C),KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V),KC_TRNS, - KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT,KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_HOME, KC_END, - KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS - -) +[VIM] = LAYOUT_ergodox_pretty( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, M(KEEPASS_OPEN), M(KEEPASS_TYPE), TERM_CP, TERM_PT, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_C), KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_V), KC_TRNS, + KC_TRNS, M(DLEFT), M(DRIGHT), KC_LCTL, KC_LGUI, KC_TRNS, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_TRNS, KC_TRNS, + KC_TRNS, M(LSFT_TAB), KC_TAB, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_HOME, KC_END, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS +), +/* Keymap 1: Game Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | | | | |ACCESS| | | | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CTRL | | | | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | SHIFT | Z | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |ENTER | | | LOCK | BSPC | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | F5 | F6 | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | ALT | SPC |------| |------| | | + * | | | SYMB | | | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[GAME] = LAYOUT_ergodox_pretty( // layer 1 : code + // left hand + KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LCTL, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_Z, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_ENT, KC_TRNS, KC_TRNS, KC_LOCK, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), + KC_TRNS, KC_UP, + KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, KC_TRNS, KC_TRNS + ), +/* Keymap 1: Game Arrow Layer + * + * ,--------------------------------------------------. ,--------------------------------------------------. + * | ESC | | | | | | | | | | | | | | | + * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------| + * | | | Up | | | | | |ACCESS| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | CTRL | Left | Down |Right | | |------| |------| | | | | | | + * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| + * | SHIFT | Z | | | | | | | | | | | | | | + * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' + * |ENTER | | | LOCK | BSPC | | | | | | | + * `----------------------------------' `----------------------------------' + * ,-------------. ,---------------. + * | F5 | F6 | | | | + * ,------|------|------| |------+--------+------. + * | | | | | | | | + * | ALT | SPC |------| |------| | | + * | | | SYMB | | | | | + * `--------------------' `----------------------' + */ +// If it accepts an argument (i.e, is a function), it doesn't need KC_. +// Otherwise, it needs KC_* +[GAME_ARROW] = LAYOUT_ergodox_pretty( // layer 1 : code + // left hand + KC_ESC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LCTL, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_LSFT, KC_Z, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_ENT, KC_TRNS, KC_TRNS, KC_LOCK, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_F5, KC_F6, LCTL(KC_C), LCTL(KC_V), + KC_TRNS, KC_UP, + KC_LALT, KC_SPC, OSM(SYMB), KC_DOWN, KC_TRNS, KC_TRNS + ) }; const uint16_t PROGMEM fn_actions[] = { @@ -260,16 +279,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { // MACRODOWN only works in this function switch(id) { - case VERSION: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - break; - case EEPROM: - if (record->event.pressed) { // For resetting EEPROM - eeconfig_init(); - } - break; case DLEFT: if (record->event.pressed) { // Windows move desktop left return MACRO(D(LCTL), D(LGUI), T(LEFT), U(LGUI), U(LCTL), END); @@ -289,46 +298,6 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) if (record->event.pressed) { return MACRO(D(LSFT), T(TAB), U(LSFT), END); } - case REFACTOR: - if (record->event.pressed) { // VS Refactor CTRL+R, R - return MACRO(D(LCTL), T(R), U(LCTL), T(R), END); - } - break; - case TEST: - if (record->event.pressed) { // VS Run Tests CTRL+R, T - return MACRO(D(LCTL), T(R), U(LCTL), T(T), END); - } - break; - case DEBUG_TEST: - if (record->event.pressed) { // VS Debug Tests CTRL+R, CTRL+T - return MACRO(D(LCTL), T(R), T(T), U(LCTL), END); - } - break; - case FORMAT: - if (record->event.pressed) { // VS Format Document, CTRL+K, CTRL+D - return MACRO(D(LCTL), T(K), T(D), U(LCTL), END); - } - break; - case BUILD: - if (record->event.pressed) { // VS Build. Sends CTRL+SHFT+B - return MACRO(D(LCTL), D(LSFT), T(B), U(LSFT), U(LCTL), END); - } - break; - case GO_TO_IMPL: - if (record->event.pressed) { // VS Go To Implementation. Sends CTRL+F12 - return MACRO(D(LCTL), T(F12), U(LCTL), END); - } - break; - case FIND_ALL_REF: - if (record->event.pressed) { // VS Find All References. Sends CTRL+K, R - return MACRO(D(LCTL), T(K), U(LCTL), T(R), END); - } - break; - case REMOVE_SORT_USINGS: - if (record->event.pressed) { - return MACRO(D(LCTL), T(R), T(G), U(LCTL), END); - } - break; case KEEPASS_OPEN: if (record->event.pressed) { // Keepass open application return MACRO(D(LCTL), D(LALT), T(K), U(LALT), U(LCTL), END); @@ -339,27 +308,22 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) return MACRO(D(LCTL), D(LALT), T(A), U(LALT), U(LCTL), END); } break; + case TERM_CP: + if (record->event.pressed) { // Terminal Copy + return MACRO(D(LCTL), T(INSERT), U(LCTL), END); + } + break; + case TERM_PT: + if (record->event.pressed) { // Terminal Paste + return MACRO(D(LSFT), T(INSERT), U(LSFT), END); + } + break; } return MACRO_NONE; }; bool process_record_user(uint16_t keycode, keyrecord_t *record) { tap_dance_process_record(keycode); - switch (keycode) { - // dynamically generate these. - case EPRM: - if (record->event.pressed) { - eeconfig_init(); - } - return false; - break; - case VRSN: - if (record->event.pressed) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION); - } - return false; - break; - } return true; } diff --git a/layouts/community/ergodox/333fred/visualizer.c b/layouts/community/ergodox/333fred/visualizer.c index 2a30562ae7..d13b3cd794 100644 --- a/layouts/community/ergodox/333fred/visualizer.c +++ b/layouts/community/ergodox/333fred/visualizer.c @@ -14,16 +14,22 @@ static void get_visualizer_layer_and_color(visualizer_state_t* state) { if (state->status.leds & (1u << USB_LED_CAPS_LOCK)) { saturation = 255; } - if (state->status.layer & 0x10) { + if (state->status.layer & 0x80) { + state->target_lcd_color = LCD_COLOR(0, 255, 60); + state->layer_text = "Game Arrow"; + } else if (state->status.layer & 0x40) { + state->target_lcd_color = LCD_COLOR(0, 255, 60); + state->layer_text = "Game"; + } else if (state->status.layer & 0x20) { state->target_lcd_color = LCD_COLOR(140, 100, 60); state->layer_text = "Movement"; - } else if (state->status.layer & 0x8) { + } else if (state->status.layer & 0x10) { state->target_lcd_color = LCD_COLOR(0, saturation, 0xFF); state->layer_text = "Media"; - } else if (state->status.layer & 0x4) { + } else if (state->status.layer & 0x8) { state->target_lcd_color = LCD_COLOR(168, saturation, 0xFF); state->layer_text = "Symbol"; - } else if (state->status.layer & 0x2) { + } else if (state->status.layer & 0x2 || state->status.layer & 0x4) { state->target_lcd_color = LCD_COLOR(216, 90, 0xFF); state->layer_text = "Code"; } else { diff --git a/users/333fred/333fred.h b/users/333fred/333fred.h index 3b6f21133b..443930a6b1 100644 --- a/users/333fred/333fred.h +++ b/users/333fred/333fred.h @@ -4,11 +4,12 @@ #define BASE 0 #define CODE 1 // code layer -#define SYMB 2 -#define MDIA 3 // media keys -#define VIM 4 -#define GAME 5 -#define GAME_ARROW 6 +#define CODEFLOW 2 +#define SYMB 3 +#define MDIA 4 // media keys +#define VIM 5 +#define GAME 6 +#define GAME_ARROW 7 // Tap dance config shared between my keyboards enum tap_dance_declarations { -- cgit v1.2.3 From 9e6ee4777995a1ac3dfd7aa4454b0a4ed825d663 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 13 Dec 2018 18:05:50 -0800 Subject: Added noeeprom versions of set hue, sat, val, and step --- docs/feature_rgblight.md | 18 +++++++++++ quantum/rgblight.c | 80 ++++++++++++++++++++++++++++++++++++++---------- quantum/rgblight.h | 8 +++++ 3 files changed, 90 insertions(+), 16 deletions(-) diff --git a/docs/feature_rgblight.md b/docs/feature_rgblight.md index 4610467b02..52d5c5fe8a 100644 --- a/docs/feature_rgblight.md +++ b/docs/feature_rgblight.md @@ -161,6 +161,24 @@ If you need to change your RGB lighting in code, for example in a macro to chang |`rgblight_sethsv(h, s, v)` |Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 | |`rgblight_sethsv_noeeprom(h, s, v)`|Set all LEDs to the given HSV value where `h` is between 0 and 360 and `s`/`v` are between 0 and 255 (not written to EEPROM) | |`rgblight_sethsv_at(h, s, v, led)` |Set a single LED to the given HSV value, where `h` is between 0 and 360, `s`/`v` are between 0 and 255, and `led` is between 0 and `RGBLED_NUM` (not written to EEPROM)| +|`rgblight_toggle()` |Toggle all LEDs between on and off | +|`rgblight_toggle_noeeprom()` |Toggle all LEDs between on and off (not written to EEPROM) | +|`rgblight_step()` |Change the mode to the next RGB animation in the list of enabled RGB animations | +|`rgblight_step_noeeprom()` |Change the mode to the next RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_step_reverse()` |Change the mode to the previous RGB animation in the list of enabled RGB animations | +|`rgblight_step_reverse_noeeprom()` |Change the mode to the previous RGB animation in the list of enabled RGB animations (not written to EEPROM) | +|`rgblight_increase_hue()` |Increase the hue for all LEDs. This wraps around at maximum hue | +|`rgblight_increase_hue_noeeprom()` |Increase the hue for all LEDs. This wraps around at maximum hue (not written to EEPROM) | +|`rgblight_decrease_hue()` |Decrease the hue for all LEDs. This wraps around at minimum hue | +|`rgblight_decrease_hue_noeeprom()` |Decrease the hue for all LEDs. This wraps around at minimum hue (not written to EEPROM) | +|`rgblight_increase_sat()` |Increase the saturation for all LEDs. This wraps around at maximum saturation | +|`rgblight_increase_sat_noeeprom()` |Increase the saturation for all LEDs. This wraps around at maximum saturation (not written to EEPROM) | +|`rgblight_decrease_sat()` |Decrease the saturation for all LEDs. This wraps around at minimum saturation | +|`rgblight_decrease_sat_noeeprom()` |Decrease the saturation for all LEDs. This wraps around at minimum saturation (not written to EEPROM) | +|`rgblight_increase_val()` |Increase the value for all LEDs. This wraps around at maximum value | +|`rgblight_increase_val_noeeprom()` |Increase the value for all LEDs. This wraps around at maximum value (not written to EEPROM) | +|`rgblight_decrease_val()` |Decrease the value for all LEDs. This wraps around at minimum value | +|`rgblight_decrease_val_noeeprom()` |Decrease the value for all LEDs. This wraps around at minimum value (not written to EEPROM) | Additionally, [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blob/master/quantum/rgblight_list.h) defines several predefined shortcuts for various colors. Feel free to add to this list! diff --git a/quantum/rgblight.c b/quantum/rgblight.c index a2d6fe7a07..ae5dca1884 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -205,21 +205,33 @@ void rgblight_decrease(void) { } rgblight_mode(mode); } -void rgblight_step(void) { +void rgblight_step_helper(bool write_to_eeprom) { uint8_t mode = 0; mode = rgblight_config.mode + 1; if (mode > RGBLIGHT_MODES) { mode = 1; } - rgblight_mode(mode); + rgblight_mode_eeprom_helper(mode, write_to_eeprom); } -void rgblight_step_reverse(void) { +void rgblight_step_noeeprom(void) { + rgblight_step_helper(false); +} +void rgblight_step(void) { + rgblight_step_helper(true); +} +void rgblight_step_reverse_helper(bool write_to_eeprom) { uint8_t mode = 0; mode = rgblight_config.mode - 1; if (mode < 1) { mode = RGBLIGHT_MODES; } - rgblight_mode(mode); + rgblight_mode_eeprom_helper(mode, write_to_eeprom); +} +void rgblight_step_reverse_noeeprom(void) { + rgblight_step_reverse_helper(false); +} +void rgblight_step_reverse(void) { + rgblight_step_reverse_helper(true); } uint32_t rgblight_get_mode(void) { @@ -337,55 +349,91 @@ static uint8_t decrement( uint8_t value, uint8_t step, uint8_t min, uint8_t max return MIN( MAX( new_value, min ), max ); } -void rgblight_increase_hue(void) { +void rgblight_increase_hue_helper(bool write_to_eeprom) { uint16_t hue; hue = (rgblight_config.hue+RGBLIGHT_HUE_STEP) % 360; - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); + rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } -void rgblight_decrease_hue(void) { +void rgblight_increase_hue_noeeprom(void) { + rgblight_increase_hue_helper(false); +} +void rgblight_increase_hue(void) { + rgblight_increase_hue_helper(true); +} +void rgblight_decrease_hue_helper(bool write_to_eeprom) { uint16_t hue; if (rgblight_config.hue-RGBLIGHT_HUE_STEP < 0) { hue = (rgblight_config.hue + 360 - RGBLIGHT_HUE_STEP) % 360; } else { hue = (rgblight_config.hue - RGBLIGHT_HUE_STEP) % 360; } - rgblight_sethsv(hue, rgblight_config.sat, rgblight_config.val); + rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom); } -void rgblight_increase_sat(void) { +void rgblight_decrease_hue_noeeprom(void) { + rgblight_decrease_hue_helper(false); +} +void rgblight_decrease_hue(void) { + rgblight_decrease_hue_helper(true); +} +void rgblight_increase_sat_helper(bool write_to_eeprom) { uint8_t sat; if (rgblight_config.sat + RGBLIGHT_SAT_STEP > 255) { sat = 255; } else { sat = rgblight_config.sat + RGBLIGHT_SAT_STEP; } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } -void rgblight_decrease_sat(void) { +void rgblight_increase_sat_noeeprom(void) { + rgblight_increase_sat_helper(false); +} +void rgblight_increase_sat(void) { + rgblight_increase_sat_helper(true); +} +void rgblight_decrease_sat_helper(bool write_to_eeprom) { uint8_t sat; if (rgblight_config.sat - RGBLIGHT_SAT_STEP < 0) { sat = 0; } else { sat = rgblight_config.sat - RGBLIGHT_SAT_STEP; } - rgblight_sethsv(rgblight_config.hue, sat, rgblight_config.val); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, sat, rgblight_config.val, write_to_eeprom); } -void rgblight_increase_val(void) { +void rgblight_decrease_sat_noeeprom(void) { + rgblight_decrease_sat_helper(false); +} +void rgblight_decrease_sat(void) { + rgblight_decrease_sat_helper(true); +} +void rgblight_increase_val_helper(bool write_to_eeprom) { uint8_t val; if (rgblight_config.val + RGBLIGHT_VAL_STEP > RGBLIGHT_LIMIT_VAL) { val = RGBLIGHT_LIMIT_VAL; } else { val = rgblight_config.val + RGBLIGHT_VAL_STEP; } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); } -void rgblight_decrease_val(void) { +void rgblight_increase_val_noeeprom(void) { + rgblight_increase_val_helper(false); +} +void rgblight_increase_val(void) { + rgblight_increase_val_helper(true); +} +void rgblight_decrease_val_helper(bool write_to_eeprom) { uint8_t val; if (rgblight_config.val - RGBLIGHT_VAL_STEP < 0) { val = 0; } else { val = rgblight_config.val - RGBLIGHT_VAL_STEP; } - rgblight_sethsv(rgblight_config.hue, rgblight_config.sat, val); + rgblight_sethsv_eeprom_helper(rgblight_config.hue, rgblight_config.sat, val, write_to_eeprom); +} +void rgblight_decrease_val_noeeprom(void) { + rgblight_decrease_val_helper(false); +} +void rgblight_decrease_val(void) { + rgblight_decrease_val_helper(true); } void rgblight_increase_speed(void) { rgblight_config.speed = increment( rgblight_config.speed, 1, 0, 3 ); diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 33b279f08c..99ede43c5b 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -203,6 +203,14 @@ void rgblight_mode_noeeprom(uint8_t mode); void rgblight_toggle_noeeprom(void); void rgblight_enable_noeeprom(void); void rgblight_disable_noeeprom(void); +void rgblight_step_noeeprom(void); +void rgblight_step_reverse_noeeprom(void); +void rgblight_increase_hue_noeeprom(void); +void rgblight_decrease_hue_noeeprom(void); +void rgblight_increase_sat_noeeprom(void); +void rgblight_decrease_sat_noeeprom(void); +void rgblight_increase_val_noeeprom(void); +void rgblight_decrease_val_noeeprom(void); void rgblight_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom); void rgblight_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom); -- cgit v1.2.3 From 89b80b79d50b2193830a961b0ab3ea398ae1d6f1 Mon Sep 17 00:00:00 2001 From: Fredric Silberberg Date: Thu, 13 Dec 2018 11:06:41 -0800 Subject: Add big switch layout --- keyboards/bigswitch/keymaps/333fred/config.h | 20 +++++ keyboards/bigswitch/keymaps/333fred/keymap.c | 123 +++++++++++++++++++++++++++ keyboards/bigswitch/keymaps/333fred/rules.mk | 5 ++ 3 files changed, 148 insertions(+) create mode 100644 keyboards/bigswitch/keymaps/333fred/config.h create mode 100644 keyboards/bigswitch/keymaps/333fred/keymap.c create mode 100644 keyboards/bigswitch/keymaps/333fred/rules.mk diff --git a/keyboards/bigswitch/keymaps/333fred/config.h b/keyboards/bigswitch/keymaps/333fred/config.h new file mode 100644 index 0000000000..76f13f08b5 --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/config.h @@ -0,0 +1,20 @@ +/* +Copyright 2018 Fredric Silberberg (333fred) + +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 + +// Long tapping term on the big switch, because it takes so long to press +#define TAPPING_TERM 500 diff --git a/keyboards/bigswitch/keymaps/333fred/keymap.c b/keyboards/bigswitch/keymaps/333fred/keymap.c new file mode 100644 index 0000000000..791fb435f4 --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/keymap.c @@ -0,0 +1,123 @@ +#include QMK_KEYBOARD_H + +typedef enum { + SINGLE_TAP, SINGLE_HOLD, DOUBLE, TRIPLE, QUAD +} tap_dance_state_enum; + +enum { + TD_KEY = 0 +}; + +static tap_dance_state_enum tap_dance_state; +static bool tap_dance_active = false; +static uint16_t timer; + +void dance_cycle(bool override_timer) { + if (tap_dance_active) + { + if (timer_elapsed(timer) > 100 || override_timer) + { + switch (tap_dance_state) + { + case SINGLE_HOLD: + { + rgblight_increase_hue_noeeprom(); + break; + } + + case DOUBLE: + { + rgblight_step_noeeprom(); + break; + } + + case TRIPLE: + { + rgblight_toggle_noeeprom(); + break; + } + + default: + // Not needed + break; + } + + timer = timer_read(); + } + } +} + +void dance_finished(qk_tap_dance_state_t *state, void* user_data) { + // Determine the current state + switch (state->count) + { + case 1: + { + if (state->interrupted || state->pressed == 0) tap_dance_state = SINGLE_TAP; + else tap_dance_state = SINGLE_HOLD; + break; + } + case 2: + { + tap_dance_state = DOUBLE; + break; + } + case 3: + { + tap_dance_state = TRIPLE; + break; + } + default: + { + tap_dance_state = QUAD; + break; + } + } + + switch (tap_dance_state) + { + case SINGLE_TAP: + { + // VS Build: CTRL+SHIFT+B + SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) "b" SS_UP(X_LALT) SS_UP(X_LCTRL)); + tap_dance_active = false; + break; + } + + case SINGLE_HOLD: + case DOUBLE: + case TRIPLE: + { + // These are handled by the matrix_scan, which will register the appropriate rgb + // functions every scan + tap_dance_active = true; + timer = timer_read(); + dance_cycle(true); + break; + } + + case QUAD: + { + // Reprogram + reset_keyboard(); + break; + } + } +} + +void dance_reset(qk_tap_dance_state_t *state, void* user_data) +{ + tap_dance_active = false; +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_KEY] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_finished, dance_reset) +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT(TD(TD_KEY)) +}; + +void matrix_scan_user(void) { + dance_cycle(false); +} diff --git a/keyboards/bigswitch/keymaps/333fred/rules.mk b/keyboards/bigswitch/keymaps/333fred/rules.mk new file mode 100644 index 0000000000..20aaadacbc --- /dev/null +++ b/keyboards/bigswitch/keymaps/333fred/rules.mk @@ -0,0 +1,5 @@ +# I'm not using things from my userpace in this one +USER_NAME = disable + +RGBLIGHT_ENABLE = yes +TAP_DANCE_ENABLE = yes -- cgit v1.2.3 From 388de9bc076a135ff5f7ff35cc95594898d2e8c3 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 13 Dec 2018 22:35:27 -0800 Subject: Keyboardio Model 01: Configurator support --- keyboards/model01/info.json | 85 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 84 insertions(+), 1 deletion(-) diff --git a/keyboards/model01/info.json b/keyboards/model01/info.json index daf51492db..60c914d5c0 100644 --- a/keyboards/model01/info.json +++ b/keyboards/model01/info.json @@ -1,4 +1,87 @@ { "keyboard_name": "model01", - "url": "https://keyboard.io" + "keyboard_folder": "model01", + "url": "https://keyboard.io", + "maintainer": "qmk", + "width": 18.5, + "height": 7.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"PROG", "x":0, "y":0.4, "h":1.3}, + {"label":"1", "x":1, "y":0.2, "h":1.5}, + {"label":"2", "x":2, "y":0.1, "h":1.1}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0.1}, + {"label":"5", "x":5, "y":0.3}, + + {"label":"6", "x":12.5, "y":0.3}, + {"label":"7", "x":13.5, "y":0.1}, + {"label":"8", "x":14.5, "y":0}, + {"label":"9", "x":15.5, "y":0.1, "h":1.1}, + {"label":"0", "x":16.5, "y":0.2, "h":1.5}, + {"label":"NUM", "x":17.5, "y":0.4, "h":1.3}, + + {"label":"GRAVE", "x":0, "y":1.7}, + {"label":"Q", "x":1, "y":1.7}, + {"label":"W", "x":2, "y":1.2}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1.1}, + {"label":"T", "x":5, "y":1.3}, + {"label":"LED", "x":6, "y":0.6, "h":1.5}, + + {"label":"ANY", "x":11.5, "y":0.6, "h":1.5}, + {"label":"Y", "x":12.5, "y":1.3}, + {"label":"U", "x":13.5, "y":1.1}, + {"label":"I", "x":14.5, "y":1}, + {"label":"O", "x":15.5, "y":1.2}, + {"label":"P", "x":16.5, "y":1.7}, + {"label":"EQUAL", "x":17.5, "y":1.7}, + + {"label":"PAGEUP", "x":0, "y":2.7}, + {"label":"A", "x":1, "y":2.7}, + {"label":"S", "x":2, "y":2.2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2.1}, + {"label":"G", "x":5, "y":2.3}, + {"label":"TAB", "x":6, "y":2.1, "h":1.3}, + + {"label":"ENTER", "x":11.5, "y":2.1, "h":1.3}, + {"label":"H", "x":12.5, "y":2.3}, + {"label":"J", "x":13.5, "y":2.1}, + {"label":"K", "x":14.5, "y":2}, + {"label":"L", "x":15.5, "y":2.2}, + {"label":"SEMICOLON", "x":16.5, "y":2.7}, + {"label":"QUOTE", "x":17.5, "y":2.7}, + + {"label":"PAGEDOWN", "x":0, "y":3.7, "h":1.2}, + {"label":"Z", "x":1, "y":3.7}, + {"label":"X", "x":2, "y":3.2, "h":1.15}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3.1}, + {"label":"B", "x":5, "y":3.3}, + {"label":"ESC", "x":6, "y":3.4, "h":1.1}, + + {"label":"BUTTERFLY", "x":11.5, "y":3.4, "h":1.1}, + {"label":"N", "x":12.5, "y":3.3}, + {"label":"M", "x":13.5, "y":3.1}, + {"label":"COMMA", "x":14.5, "y":3}, + {"label":"DOT", "x":15.5, "y":3.2, "h":1.15}, + {"label":"SLASH", "x":16.5, "y":3.7}, + {"label":"MINS", "x":17.5, "y":3.7, "h":1.2}, + + {"label":"LCTL", "x":4.75, "y":4.3}, + {"label":"RCTL", "x":12.75, "y":4.3}, + {"label":"BACKSPACE", "x":5.75, "y":4.5}, + {"label":"SPACE", "x":11.75, "y":4.5}, + {"label":"LGUI", "x":6.75, "y":4.7}, + {"label":"RALT", "x":10.75, "y":4.7}, + {"label":"LSHIFT", "x":7.75, "y":5.1}, + {"label":"RSHIFT", "x":9.75, "y":5.1}, + + {"label":"FN", "x":6.25, "y":6.1, "h":1.4}, + {"label":"FN", "x":11.25, "y":6.1, "h":1.4} + ] + } + } } -- cgit v1.2.3 From 119b02c54055ba16ed2198b08d7e05443626a830 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 13 Dec 2018 23:33:29 -0800 Subject: AT101 Blackheart: Configurator support --- keyboards/at101_blackheart/info.json | 121 +++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 keyboards/at101_blackheart/info.json diff --git a/keyboards/at101_blackheart/info.json b/keyboards/at101_blackheart/info.json new file mode 100644 index 0000000000..4bef46712d --- /dev/null +++ b/keyboards/at101_blackheart/info.json @@ -0,0 +1,121 @@ +{ + "keyboard_name": "AT101 Blackheart PCB", + "keyboard_folder": "at101_blackheart", + "url": "https://deskthority.net/group-buys-f50/programmable-vintage-board-pcbs-omnikey-at101-and-z-150-t19325.html", + "maintainer": "qmk, blindassassin111", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"Grave", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"Keypad /", "x":19.5, "y":1.5}, + {"label":"Keypad *", "x":20.5, "y":1.5}, + {"label":"Keypad -", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"LBracket", "x":11.5, "y":2.5}, + {"label":"RBracket]", "x":12.5, "y":2.5}, + {"label":"Backslash", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Keypad 7", "x":18.5, "y":2.5}, + {"label":"Keypad 8", "x":19.5, "y":2.5}, + {"label":"Keypad 9", "x":20.5, "y":2.5}, + {"label":"Keypad +", "x":21.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":"Semicolon", "x":10.75, "y":3.5}, + {"label":"Quote", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Keypad 4", "x":18.5, "y":3.5}, + {"label":"Keypad 5", "x":19.5, "y":3.5}, + {"label":"Keypad 6", "x":20.5, "y":3.5}, + {"label":"Keypad =", "x":21.5, "y":3.5}, + {"label":"LShift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO Backslash", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"Comma", "x":9.25, "y":4.5}, + {"label":"Period", "x":10.25, "y":4.5}, + {"label":"Slash", "x":11.25, "y":4.5}, + {"label":"RShift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Fn", "x":14, "y":4.5}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Keypad 1", "x":18.5, "y":4.5}, + {"label":"Keypad 2", "x":19.5, "y":4.5}, + {"label":"Keypad 3", "x":20.5, "y":4.5}, + {"label":"Keypad Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"LCtrl", "x":0, "y":5.5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"LAlt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"RAlt", "x":10, "y":5.5, "w":1.25}, + {"label":"RGUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"RCtrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"Keypad 0", "x":18.5, "y":5.5, "w":2}, + {"label":"Keypad .", "x":20.5, "y":5.5} + ] + } + } +} -- cgit v1.2.3 From 48933811c541d9666c645f12bf83421e179cfd4c Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 13 Dec 2018 23:36:58 -0800 Subject: AT101 Blackheart: readme update - added image - updated Docs links --- keyboards/at101_blackheart/readme.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/keyboards/at101_blackheart/readme.md b/keyboards/at101_blackheart/readme.md index 7b356bc753..d435d6955a 100644 --- a/keyboards/at101_blackheart/readme.md +++ b/keyboards/at101_blackheart/readme.md @@ -1,5 +1,6 @@ -AT101 Blackheart PCB -=== +# AT101 Blackheart PCB + +![AT101 Blackheart PCB](https://deskthority.net/resources/image/48571) A replacement PCB for AT101 keyboards. @@ -11,4 +12,4 @@ Make example for this keyboard (after setting up your build environment): make at101_blackheart:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From e83c62a0023c80554506fd75672bbb287139b833 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 14 Dec 2018 00:03:40 -0800 Subject: Baguette: Configurator update The layout was right, but offset on both axes. --- keyboards/baguette/info.json | 163 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 150 insertions(+), 13 deletions(-) diff --git a/keyboards/baguette/info.json b/keyboards/baguette/info.json index 777899a600..f3c9b308fb 100644 --- a/keyboards/baguette/info.json +++ b/keyboards/baguette/info.json @@ -1,16 +1,153 @@ { - "keyboard_name": "Baguette", - "url": "", - "maintainer": "qmk", - "bootloader": "atmel-dfu", - "width": 19.75, - "height": 6.5, - "layouts": { - "LAYOUT_ansi": { - "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"|", "x":16.75, "y":2.5, "w":1.5}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"label":"Enter", "x":16, "y":3.5, "w":2.25}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] - }, - "LAYOUT_iso": { - "layout": [{"label":"~", "x":3.25, "y":1.5}, {"label":"!", "x":4.25, "y":1.5}, {"label":"@", "x":5.25, "y":1.5}, {"label":"#", "x":6.25, "y":1.5}, {"label":"$", "x":7.25, "y":1.5}, {"label":"%", "x":8.25, "y":1.5}, {"label":"^", "x":9.25, "y":1.5}, {"label":"&", "x":10.25, "y":1.5}, {"label":"*", "x":11.25, "y":1.5}, {"label":"(", "x":12.25, "y":1.5}, {"label":")", "x":13.25, "y":1.5}, {"label":"_", "x":14.25, "y":1.5}, {"label":"+", "x":15.25, "y":1.5}, {"label":"|", "x":16.25, "y":1.5}, {"label":"Del", "x":17.25, "y":1.5}, {"label":"Insert", "x":18.75, "y":1.5}, {"label":"Tab", "x":3.25, "y":2.5, "w":1.5}, {"label":"Q", "x":4.75, "y":2.5}, {"label":"W", "x":5.75, "y":2.5}, {"label":"E", "x":6.75, "y":2.5}, {"label":"R", "x":7.75, "y":2.5}, {"label":"T", "x":8.75, "y":2.5}, {"label":"Y", "x":9.75, "y":2.5}, {"label":"U", "x":10.75, "y":2.5}, {"label":"I", "x":11.75, "y":2.5}, {"label":"O", "x":12.75, "y":2.5}, {"label":"P", "x":13.75, "y":2.5}, {"label":"{", "x":14.75, "y":2.5}, {"label":"}", "x":15.75, "y":2.5}, {"label":"Enter", "x":17, "y":2.5, "w":1.25, "h":2}, {"label":"Delete", "x":18.75, "y":2.5}, {"label":"Control", "x":3.25, "y":3.5, "w":1.75}, {"label":"A", "x":5, "y":3.5}, {"label":"S", "x":6, "y":3.5}, {"label":"D", "x":7, "y":3.5}, {"label":"F", "x":8, "y":3.5}, {"label":"G", "x":9, "y":3.5}, {"label":"H", "x":10, "y":3.5}, {"label":"J", "x":11, "y":3.5}, {"label":"K", "x":12, "y":3.5}, {"label":"L", "x":13, "y":3.5}, {"label":":", "x":14, "y":3.5}, {"label":"\"", "x":15, "y":3.5}, {"x":16, "y":3.5}, {"x":3.25, "y":4.5, "w":1.25}, {"x":4.5, "y":4.5}, {"label":"Z", "x":5.5, "y":4.5}, {"label":"X", "x":6.5, "y":4.5}, {"label":"C", "x":7.5, "y":4.5}, {"label":"V", "x":8.5, "y":4.5}, {"label":"B", "x":9.5, "y":4.5}, {"label":"N", "x":10.5, "y":4.5}, {"label":"M", "x":11.5, "y":4.5}, {"label":"<", "x":12.5, "y":4.5}, {"label":">", "x":13.5, "y":4.5}, {"label":"?", "x":14.5, "y":4.5}, {"x":15.5, "y":4.5}, {"label":"Shift", "x":16.5, "y":4.5, "w":1.25}, {"label":"\u2191", "x":17.75, "y":4.5}, {"label":"Win", "x":4.5, "y":5.5}, {"label":"Alt", "x":5.5, "y":5.5, "w":1.25}, {"x":6.75, "y":5.5, "w":6.25}, {"label":"Ctrl", "x":13, "y":5.5, "w":1.25}, {"label":"Fn", "x":14.25, "y":5.5}, {"label":"\u2190", "x":16.75, "y":5.5}, {"label":"\u2193", "x":17.75, "y":5.5}, {"label":"\u2192", "x":18.75, "y":5.5}] - } + "keyboard_name": "Baguette", + "url": "", + "maintainer": "qmk", + "bootloader": "atmel-dfu", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT_ansi": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Backspace2", "x":14, "y":0}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"JP RO", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":1.25}, + {"label":"Space", "x":3.5, "y":4, "w":6.25}, + {"label":"Ctrl", "x":9.75, "y":4, "w":1.25}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] + }, + + "LAYOUT_iso": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0}, + {"label":"Backspace2", "x":14, "y":0}, + {"label":"Insert", "x":15.5, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Delete", "x":15.5, "y":1}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"ISO #", "x":12.75, "y":2}, + {"label":"Enter", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"JP_RO", "x":12.25, "y":3}, + {"label":"Shift", "x":13.25, "y":3, "w":1.25}, + {"label":"Up", "x":14.5, "y":3}, + {"label":"GUI", "x":1.25, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":1.25}, + {"label":"Space", "x":3.5, "y":4, "w":6.25}, + {"label":"Ctrl", "x":9.75, "y":4, "w":1.25}, + {"label":"Fn", "x":11, "y":4}, + {"label":"Left", "x":13.5, "y":4}, + {"label":"Down", "x":14.5, "y":4}, + {"label":"Right", "x":15.5, "y":4} + ] } + } } -- cgit v1.2.3 From 1ae07f657ad914b863d7ec095eadaeb1d44dbc74 Mon Sep 17 00:00:00 2001 From: Daniel Shields Date: Fri, 14 Dec 2018 15:27:54 +0000 Subject: Keymap: Disable audio for planck/dshields/rev6 and enable retro tapping. (#4643) --- keyboards/planck/keymaps/dshields/config.h | 1 + keyboards/planck/keymaps/dshields/rules.mk | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/keyboards/planck/keymaps/dshields/config.h b/keyboards/planck/keymaps/dshields/config.h index 63434f60ca..7f9cf74672 100644 --- a/keyboards/planck/keymaps/dshields/config.h +++ b/keyboards/planck/keymaps/dshields/config.h @@ -5,6 +5,7 @@ #define USB_MAX_POWER_CONSUMPTION 100 #define ONESHOT_TAP_TOGGLE 2 #define ONESHOT_TIMEOUT 3000 +#define RETRO_TAPPING #define MOUSEKEY_INTERVAL 20 #define MOUSEKEY_DELAY 0 diff --git a/keyboards/planck/keymaps/dshields/rules.mk b/keyboards/planck/keymaps/dshields/rules.mk index 300a827904..a526c5a31a 100644 --- a/keyboards/planck/keymaps/dshields/rules.mk +++ b/keyboards/planck/keymaps/dshields/rules.mk @@ -16,7 +16,7 @@ ifeq ($(strip $(KEYBOARD)), planck/rev3) endif ifeq ($(strip $(KEYBOARD)), planck/rev6) EXTRALDFLAGS = -Wl,--build-id=none - AUDIO_ENABLE = yes + AUDIO_ENABLE = no BACKLIGHT_ENABLE = no RGB_MATRIX_ENABLE = no endif -- cgit v1.2.3 From 25892301d426e0c77081aa8d431479df2f52d1f3 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 07:32:12 -0800 Subject: Keymap: handwired/108key_trackpoint Configurator support and readme update (#4633) * handwired/108key_trackpoint: Configurator support * handwired/108key_trackpoint: readme update - fix typo in make command - rename file to lowercase --- keyboards/handwired/108key_trackpoint/README.md | 23 ----- keyboards/handwired/108key_trackpoint/info.json | 125 ++++++++++++++++++++++++ keyboards/handwired/108key_trackpoint/readme.md | 23 +++++ 3 files changed, 148 insertions(+), 23 deletions(-) delete mode 100644 keyboards/handwired/108key_trackpoint/README.md create mode 100644 keyboards/handwired/108key_trackpoint/info.json create mode 100644 keyboards/handwired/108key_trackpoint/readme.md diff --git a/keyboards/handwired/108key_trackpoint/README.md b/keyboards/handwired/108key_trackpoint/README.md deleted file mode 100644 index 247043e171..0000000000 --- a/keyboards/handwired/108key_trackpoint/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# 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/info.json b/keyboards/handwired/108key_trackpoint/info.json new file mode 100644 index 0000000000..bd221892b3 --- /dev/null +++ b/keyboards/handwired/108key_trackpoint/info.json @@ -0,0 +1,125 @@ +{ + "keyboard_name": "108 Key with TrackPoint", + "url": "", + "maintainer": "mkem114", + "width": 22.5, + "height": 7.5, + "layouts": { + "LAYOUT": { + "key_count": 111, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"Mute", "x":18.5, "y":0}, + {"label":"Previous", "x":19.5, "y":0}, + {"label":"Next", "x":20.5, "y":0}, + {"label":"Play", "x":21.5, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"/", "x":19.5, "y":1.5}, + {"label":"*", "x":20.5, "y":1.5}, + {"label":"-", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"7", "x":18.5, "y":2.5}, + {"label":"8", "x":19.5, "y":2.5}, + {"label":"9", "x":20.5, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":18.5, "y":3.5}, + {"label":"5", "x":19.5, "y":3.5}, + {"label":"6", "x":20.5, "y":3.5}, + {"label":"+", "x":21.5, "y":2.5, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"1", "x":18.5, "y":4.5}, + {"label":"2", "x":19.5, "y":4.5}, + {"label":"3", "x":20.5, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"RGUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"0", "x":18.5, "y":5.5, "w":2}, + {"label":".", "x":20.5, "y":5.5}, + {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Mouse1", "x":5.25, "y":6.5}, + {"label":"Mouse3", "x":6.25, "y":6.5}, + {"label":"Mouse2", "x":7.25, "y":6.5} + ] + } + } +} diff --git a/keyboards/handwired/108key_trackpoint/readme.md b/keyboards/handwired/108key_trackpoint/readme.md new file mode 100644 index 0000000000..468fdf94dc --- /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/108key_trackpoint: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). -- cgit v1.2.3 From 60f9abca1245640e12d65aa60f5953ff1719408f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 07:33:00 -0800 Subject: handwired/CMD60 Refactor, Configurator support and readme update (#4632) * handwired/CMD60: refactor - renamed layout macro KEYMAP to LAYOUT - removed K2C, K3B and K3C locations (indications are these locations were unused in hardware) - keymap - now uses #include QMK_KEYBOARD_H - converted keycodes to short format - deleted TMK fn_actions and action_get_macro blocks - white space changes (readability/alignment) * handwired/CMD60: Configurator support * handwired/CMD60: readme update - updated to conform to current QMK template - added image and build gallery links * handwired/cmd60: rename all files and folders to lowercase --- keyboards/handwired/CMD60/CMD60.c | 8 - keyboards/handwired/CMD60/CMD60.h | 20 --- keyboards/handwired/CMD60/README.md | 35 ----- keyboards/handwired/CMD60/config.h | 162 --------------------- keyboards/handwired/CMD60/keymaps/default/keymap.c | 66 --------- keyboards/handwired/CMD60/rules.mk | 69 --------- keyboards/handwired/cmd60/cmd60.c | 8 + keyboards/handwired/cmd60/cmd60.h | 20 +++ keyboards/handwired/cmd60/config.h | 162 +++++++++++++++++++++ keyboards/handwired/cmd60/info.json | 74 ++++++++++ keyboards/handwired/cmd60/keymaps/default/keymap.c | 46 ++++++ keyboards/handwired/cmd60/readme.md | 19 +++ keyboards/handwired/cmd60/rules.mk | 69 +++++++++ 13 files changed, 398 insertions(+), 360 deletions(-) delete mode 100644 keyboards/handwired/CMD60/CMD60.c delete mode 100644 keyboards/handwired/CMD60/CMD60.h delete mode 100644 keyboards/handwired/CMD60/README.md delete mode 100644 keyboards/handwired/CMD60/config.h delete mode 100644 keyboards/handwired/CMD60/keymaps/default/keymap.c delete mode 100644 keyboards/handwired/CMD60/rules.mk create mode 100644 keyboards/handwired/cmd60/cmd60.c create mode 100644 keyboards/handwired/cmd60/cmd60.h create mode 100644 keyboards/handwired/cmd60/config.h create mode 100644 keyboards/handwired/cmd60/info.json create mode 100644 keyboards/handwired/cmd60/keymaps/default/keymap.c create mode 100644 keyboards/handwired/cmd60/readme.md create mode 100644 keyboards/handwired/cmd60/rules.mk diff --git a/keyboards/handwired/CMD60/CMD60.c b/keyboards/handwired/CMD60/CMD60.c deleted file mode 100644 index 799848e34e..0000000000 --- a/keyboards/handwired/CMD60/CMD60.c +++ /dev/null @@ -1,8 +0,0 @@ -#include "CMD60.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} diff --git a/keyboards/handwired/CMD60/CMD60.h b/keyboards/handwired/CMD60/CMD60.h deleted file mode 100644 index f90871fc71..0000000000 --- a/keyboards/handwired/CMD60/CMD60.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef CMD60_H -#define CMD60_H - -#include "quantum.h" - -#define KEYMAP( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ - K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ - K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, \ - K40, K41, K42, K45, K4A, K4B, K4C, K4D \ - ) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ - { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ - { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D }, \ - { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO,K4A, K4B, K4C, K4D } \ -} - -#endif \ No newline at end of file diff --git a/keyboards/handwired/CMD60/README.md b/keyboards/handwired/CMD60/README.md deleted file mode 100644 index 8b0dd109f6..0000000000 --- a/keyboards/handwired/CMD60/README.md +++ /dev/null @@ -1,35 +0,0 @@ -CMD60 keyboard firmware -====================== - -##CMD60 - -This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work -with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 -and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to -achieve a higher level of productivity if you take the time to learn its function layers. - -## Quantum MK Firmware - -For the full Quantum feature list, see [the parent readme.md](/docs/README.md). - -## Building - -Download or clone the whole firmware and navigate to the keyboards/handwired/CMD60 folder. -Once your dev env is setup, you'll be able to type `make` to generate your .hex - you can then use -the Teensy Loader to program your .hex file. - -Depending on which keymap you would like to use, you will have to compile slightly differently. - -### Default - -To build with the default keymap, simply run `make`. - -### Other Keymaps - -To build the firmware binary hex file with a keymap just do `make` with `keymap` option like: - -``` -$ make keymap=[default|jack|] -``` - -Keymaps follow the format **__keymap.c__** and are stored in folders in the `keymaps` folder, eg `keymaps/my_keymap/` diff --git a/keyboards/handwired/CMD60/config.h b/keyboards/handwired/CMD60/config.h deleted file mode 100644 index 27eb400b87..0000000000 --- a/keyboards/handwired/CMD60/config.h +++ /dev/null @@ -1,162 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -#ifndef CONFIG_H -#define CONFIG_H - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x6060 -#define DEVICE_VER 0x0001 -#define MANUFACTURER cmd -#define PRODUCT CMD60 -#define DESCRIPTION Advanced Programming Keeb Layout - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 14 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } -#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } -#define UNUSED_PINS - -/* COL2ROW or ROW2COL */ -#define DIODE_DIRECTION COL2ROW - -// #define BACKLIGHT_PIN B7 -// #define BACKLIGHT_BREATHING -// #define BACKLIGHT_LEVELS 3 - - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -#endif diff --git a/keyboards/handwired/CMD60/keymaps/default/keymap.c b/keyboards/handwired/CMD60/keymaps/default/keymap.c deleted file mode 100644 index 9f9cbcd661..0000000000 --- a/keyboards/handwired/CMD60/keymaps/default/keymap.c +++ /dev/null @@ -1,66 +0,0 @@ -#include "CMD60.h" - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = KEYMAP( /* CMD60 - QWERTY */ - KC_ESC, 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_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, \ - LT(3, KC_ENT), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NO, KC_ENT, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_NO, KC_NO, KC_RSFT, \ - KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ - ), - [1] = KEYMAP( /* CMD60 - GameMode */ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_RSFT, \ - KC_TRNS, KC_NO, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [2] = KEYMAP( /* CMD60 - Arrows */ - KC_GRV, 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_DEL, \ - KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_TRNS, \ - KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_TRNS, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_SPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [3] = KEYMAP( /* CMD60 - Functions */ - KC_GRV, 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_DEL, \ - KC_AUDIO_MUTE, KC_BSPC, KC_PGUP, KC_DEL, KC_TRNS, KC_TRNS, KC_TRNS, KC_PGUP, KC_UP, KC_PGDN, KC_TRNS, KC_PAUSE, KC_SLCK, KC_PSCREEN, \ - KC_TRNS, KC_HOME, KC_PGDN, KC_END, KC_TRNS, KC_TRNS, KC_HOME, KC_LEFT, KC_DOWN, KC_RIGHT, KC_TRNS, KC_INSERT, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_END, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [4] = KEYMAP( /* CMD60 - Mouse */ - KC_SYSTEM_SLEEP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_BTN1, KC_MS_UP, KC_MS_BTN2, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_TRNS, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MS_WH_UP, KC_MS_BTN3, KC_MS_WH_DOWN, KC_NO, KC_NO, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), - [5] = KEYMAP( /* CMD60 - Media */ - KC_SYSTEM_WAKE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_AUDIO_VOL_DOWN, KC_AUDIO_VOL_UP, KC_AUDIO_MUTE, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MEDIA_PREV_TRACK, KC_MEDIA_NEXT_TRACK, KC_MEDIA_PLAY_PAUSE, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_WWW_BACK, KC_WWW_FORWARD, KC_NO, KC_NO, KC_WWW_REFRESH, \ - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS \ - ), -}; - -const uint16_t PROGMEM fn_actions[] = { - -}; - - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { - register_code(KC_RSFT); - } else { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; diff --git a/keyboards/handwired/CMD60/rules.mk b/keyboards/handwired/CMD60/rules.mk deleted file mode 100644 index d980716eae..0000000000 --- a/keyboards/handwired/CMD60/rules.mk +++ /dev/null @@ -1,69 +0,0 @@ - -# MCU name -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 - - -# Boot Section Size in *bytes* -# Teensy halfKay 512 -# Teensy++ halfKay 1024 -# Atmel DFU loader 4096 -# LUFA bootloader 4096 -# USBaspLoader 2048 -OPT_DEFS += -DBOOTLOADER_SIZE=512 - - -# 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 = no # USB Nkey Rollover -BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default -MIDI_ENABLE = no # MIDI controls -UNICODE_ENABLE = no # Unicode -BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -AUDIO_ENABLE = no # Audio output on port C6 - - diff --git a/keyboards/handwired/cmd60/cmd60.c b/keyboards/handwired/cmd60/cmd60.c new file mode 100644 index 0000000000..91bbbd453b --- /dev/null +++ b/keyboards/handwired/cmd60/cmd60.c @@ -0,0 +1,8 @@ +#include "cmd60.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} diff --git a/keyboards/handwired/cmd60/cmd60.h b/keyboards/handwired/cmd60/cmd60.h new file mode 100644 index 0000000000..2e0baa9997 --- /dev/null +++ b/keyboards/handwired/cmd60/cmd60.h @@ -0,0 +1,20 @@ +#ifndef CMD60_H +#define CMD60_H + +#include "quantum.h" + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2D, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3D, \ + K40, K41, K42, K45, K4A, K4B, K4C, K4D \ + ) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, KC_NO, K2D }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, KC_NO, KC_NO, K3D }, \ + { K40, K41, K42, KC_NO, KC_NO, K45, KC_NO, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D } \ +} + +#endif diff --git a/keyboards/handwired/cmd60/config.h b/keyboards/handwired/cmd60/config.h new file mode 100644 index 0000000000..27eb400b87 --- /dev/null +++ b/keyboards/handwired/cmd60/config.h @@ -0,0 +1,162 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER cmd +#define PRODUCT CMD60 +#define DESCRIPTION Advanced Programming Keeb Layout + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 14 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { F0, F4, F5, F6, F7 } +#define MATRIX_COL_PINS { B0, B1, B2, B3, B7, D0, D1, D2, D3, C6, D7, B4, B5, B6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +#endif diff --git a/keyboards/handwired/cmd60/info.json b/keyboards/handwired/cmd60/info.json new file mode 100644 index 0000000000..8d555dc078 --- /dev/null +++ b/keyboards/handwired/cmd60/info.json @@ -0,0 +1,74 @@ +{ + "keyboard_name": "CMD60", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"Backspace", "x":13, "y":0, "w":2}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"\\", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":2.75}, + {"label":"Ctrl", "x":0, "y":4, "w":1.25}, + {"label":"GUI", "x":1.25, "y":4, "w":1.25}, + {"label":"Alt", "x":2.5, "y":4, "w":1.25}, + {"label":"Space", "x":3.75, "y":4, "w":6.25}, + {"label":"Alt", "x":10, "y":4, "w":1.25}, + {"label":"GUI", "x":11.25, "y":4, "w":1.25}, + {"label":"Menu", "x":12.5, "y":4, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":4, "w":1.25} + ] + } + } +} diff --git a/keyboards/handwired/cmd60/keymaps/default/keymap.c b/keyboards/handwired/cmd60/keymaps/default/keymap.c new file mode 100644 index 0000000000..448d81dc16 --- /dev/null +++ b/keyboards/handwired/cmd60/keymaps/default/keymap.c @@ -0,0 +1,46 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT( /* CMD60 - QWERTY */ + KC_ESC, 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_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, \ + LT(3, KC_ENT), 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ + KC_LCTL, KC_LGUI, KC_LALT, LT(2, KC_SPC), MO(3), MO(4), MO(5), TG(1) \ + ), + [1] = LAYOUT( /* CMD60 - GameMode */ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_CAPS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RSFT, \ + _______, XXXXXXX, _______, KC_SPC, _______, _______, _______, _______ \ + ), + [2] = LAYOUT( /* CMD60 - Arrows */ + KC_GRV, 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_DEL, \ + _______, KC_BSPC, KC_UP, KC_DEL, _______, _______, _______, KC_BSPC, KC_UP, KC_DEL, KC_PSCR, KC_SLCK, KC_PAUS, _______, \ + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, \ + _______, _______, _______, _______, KC_SPC, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [3] = LAYOUT( /* CMD60 - Functions */ + KC_GRV, 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_DEL, \ + KC_MUTE, KC_BSPC, KC_PGUP, KC_DEL, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, _______, KC_PAUS, KC_SLCK, KC_PSCR, \ + _______, KC_HOME, KC_PGDN, KC_END, _______, _______, KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_INS, _______, \ + _______, _______, _______, _______, _______, _______, KC_END, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [4] = LAYOUT( /* CMD60 - Mouse */ + KC_SLEP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_WH_U, KC_BTN3, KC_WH_D, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + [5] = LAYOUT( /* CMD60 - Media */ + KC_WAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MPLY, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WBAK, KC_WFWD, KC_WREF, \ + _______, _______, _______, _______, _______, _______, _______, _______ \ + ), +}; diff --git a/keyboards/handwired/cmd60/readme.md b/keyboards/handwired/cmd60/readme.md new file mode 100644 index 0000000000..933ac16d59 --- /dev/null +++ b/keyboards/handwired/cmd60/readme.md @@ -0,0 +1,19 @@ +# CMD60 + +![CMD60](https://i.imgur.com/r9LA6Lx.jpg) + +This layout has been designed to optimize use of the left-hand, and it focussed specifically on programmers who work +with text editors like SublimeText and Atom. It utilizes the power of Space_fn, and features a caps lock swap for Fn2 +and enter key on tap. These features allow you to keep your right hand on the mouse more and should enable you to +achieve a higher level of productivity if you take the time to learn its function layers. + +[Build Log](https://redd.it/4mkuu8) + +Keyboard Maintainer: [The QMK Community](https://github.com/qmk) +Hardware Supported: CMD60 handwired, Teensy 2.0 + +Make example for this keyboard (after setting up your build environment): + + make handwired/cmd60: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/handwired/cmd60/rules.mk b/keyboards/handwired/cmd60/rules.mk new file mode 100644 index 0000000000..d980716eae --- /dev/null +++ b/keyboards/handwired/cmd60/rules.mk @@ -0,0 +1,69 @@ + +# MCU name +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 + + +# Boot Section Size in *bytes* +# Teensy halfKay 512 +# Teensy++ halfKay 1024 +# Atmel DFU loader 4096 +# LUFA bootloader 4096 +# USBaspLoader 2048 +OPT_DEFS += -DBOOTLOADER_SIZE=512 + + +# 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 = no # USB Nkey Rollover +BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality on B7 by default +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 + + -- cgit v1.2.3 From 641bbeb41af87feb01882e9f8a252312d2665a6a Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:36:38 -0800 Subject: Remove userspace info from Quad-Function Tap Dance example (#4631) --- docs/feature_tap_dance.md | 36 +++++++----------------------------- 1 file changed, 7 insertions(+), 29 deletions(-) diff --git a/docs/feature_tap_dance.md b/docs/feature_tap_dance.md index b2b567f1d0..f2f2749440 100644 --- a/docs/feature_tap_dance.md +++ b/docs/feature_tap_dance.md @@ -185,29 +185,11 @@ Below is a specific example: ## Setup -You will need a few things that can be used for 'Quad Function Tap-Dance'. The suggested setup is to create a user directory for yourself. This directory will contain rules.mk `.c` and `.h`. This directory should be called ``, and located in the top level `users` directory. There should already be a few examples to look at there. +You will need a few things that can be used for 'Quad Function Tap-Dance'. -### In `/qmk_firmware/users//rules.mk` +You'll need to add these to the top of your `keymap.c` file, before your keymap. -Put the following: ```c -TAP_DANCE_ENABLE = yes -SRC += your_name.c -``` - -Pretty simple. It is a nice way to keep some rules common on all your keymaps. - - -### In `/qmk_firmware/users//.h` - -You will need a few things in this file: - -```c -#pragma once - -#include "quantum.h" -#include "process_keycode/process_tap_dance.h" - typedef struct { bool is_press_action; int state; @@ -234,18 +216,12 @@ int cur_dance (qk_tap_dance_state_t *state); //for the x tap dance. Put it here so it can be used in any keymap void x_finished (qk_tap_dance_state_t *state, void *user_data); void x_reset (qk_tap_dance_state_t *state, void *user_data); -``` -### In `/qmk_firmware/users//.c` +``` -And then in your user's `.c` file you implement the functions above: +Now, at the bottom of your `keymap.c` file, you'll need to add the following: ```c -#include ".h" -#include "quantum.h" -#include "action.h" -#include "process_keycode/process_tap_dance.h" - /* Return an integer that corresponds to what kind of tap dance should be executed. * * How to figure out tap dance state: interrupted and pressed. @@ -335,4 +311,6 @@ qk_tap_dance_action_t tap_dance_actions[] = { }; ``` -And then simply use `TD(X_CTL)` anywhere in your keymap after including `.h`. +And then simply use `TD(X_CTL)` anywhere in your keymap. + +If you want to implement this in your userspace, then you may want to check out how [DanielGGordon](https://github.com/qmk/qmk_firmware/tree/master/users/gordon) has implemented this in their userspace. -- cgit v1.2.3 From 6c6bbff600cd37416bdf067ac67971c58136129f Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:37:27 -0800 Subject: Enhance documentation for Tap-Hold functions (#4628) --- docs/feature_advanced_keycodes.md | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index e5f241f7f1..bda4972331 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -161,8 +161,13 @@ For one shot mods, you need to call `set_oneshot_mods(MOD)` to set it, or `clear !> If you're having issues with OSM translating over Remote Desktop Connection, this can be fixed by opening the settings, going to the "Local Resources" tap, and in the keyboard section, change the drop down to "On this Computer". This will fix the issue and allow OSM to function properly over Remote Desktop. +# Tap-Hold Configuration Options -# Permissive Hold +While Tap-Hold options are fantastic, they are not without their issues. We have tried to configure them with reasonal defaults, but that may still cause issues for some people. + +These options let you modify the behavior of the Tap-Hold keys. + +## Permissive Hold As of [PR#1359](https://github.com/qmk/qmk_firmware/pull/1359/), there is a new `config.h` option: @@ -185,7 +190,7 @@ Normally, if you do all this within the `TAPPING_TERM` (default: 200ms) this wil ?> If you have `Ignore Mod Tap Interrupt` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. -# Ignore Mod Tap Interrupt +## Ignore Mod Tap Interrupt To enable this setting, add this to your `config.h`: @@ -211,7 +216,7 @@ Normally, this would send `X` (`SHIFT`+`x`). With `Ignore Mod Tap Interrupt` ena ?> If you have `Permissive Hold` enabled, as well, this will modify how both work. The regular key has the modifier added if the first key is released first or if both keys are held longer than the `TAPPING_TERM`. -# Tapping Force Hold +## Tapping Force Hold To enable `tapping force hold`, add the following to your `config.h`: @@ -235,7 +240,7 @@ With `TAPPING_FORCE_HOLD`, the second press will be interpreted as a Shift, allo !> `TAPPING_FORCE_HOLD` will break anything that uses tapping toggles (Such as the `TT` layer keycode, and the One Shot Tapping Toggle). -# Retro Tapping +## Retro Tapping To enable `retro tapping`, add the following to your `config.h`: -- cgit v1.2.3 From 8c3054777a9d86613fd9d73cca1fdfaee54a6eff Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:51:17 -0800 Subject: Docs: Remove duplicate layer block in keycodes.md (#4621) * Docs: Remove duplicate layer block in keycodes.md Reorder and add OSL * remove glitch Co-Authored-By: drashna --- docs/keycodes.md | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/docs/keycodes.md b/docs/keycodes.md index d12a85aa15..468b59f84f 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -288,15 +288,16 @@ This is a reference only. Each group of keys links to the page documenting their ## [Layer Switching](feature_advanced_keycodes.md#switching-and-toggling-layers) -|Key |Description | -|-----------------|---------------------------------------------------------------------| -|`DF(layer)` |Switches the default layer | -|`MO(layer)` |Momentarily activates layer, switches off when you let go | -|`LM(layer, mod)` |As `MO(layer)` but with `mod` active | -|`LT(layer, kc)` |Momentarily activates layer if held, sends kc if tapped | -|`TG(layer)` |Toggles the layer (enables it if no active, and vise versa) | -|`TO(layer)` |Activates layer and deactivates all other layers | -|`TT(layer)` |Momentarily activates layer if held, toggles it if tapped repeatedly | +|Key |Description | +|----------------|----------------------------------------------------------------------------------| +|`DF(layer)` |Set the base (default) layer | +|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| +|`OSL(layer)` |Momentarily activates `layer` until a key is pressed. See [One Shot Keys](https://docs.qmk.fm/#/feature_advanced_keycodes?id=one-shot-keys) for details. | +|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. +|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | +|`TG(layer)` |Toggle `layer` on or off | +|`TO(layer)` |Turn on `layer` when pressed | +|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | ## [Mouse Keys](feature_mouse_keys.md) @@ -431,18 +432,6 @@ This is a reference only. Each group of keys links to the page documenting their |`KC_RIGHT_ANGLE_BRACKET`|`KC_RABK`, `KC_GT` |`>` | |`KC_QUESTION` |`KC_QUES` |`?` | -## [Switching and Toggling Layers](feature_advanced_keycodes.md#switching-and-toggling-layers) - -|Key |Description | -|----------------|----------------------------------------------------------------------------------| -|`LT(layer, kc)` |Turn on `layer` when held, `kc` when tapped | -|`TO(layer)` |Turn on `layer` when pressed | -|`MO(layer)` |Momentarily turn on `layer` when pressed (requires `KC_TRNS` on destination layer)| -|`DF(layer)` |Set the base (default) layer | -|`TG(layer)` |Toggle `layer` on or off | -|`TT(layer)` |Normally acts like MO unless it's tapped multiple times, which toggles `layer` on | -|`LM(layer, mod)`|Momentarily turn on `layer` (like MO) with `mod` active as well. | - ## [One Shot Keys](feature_advanced_keycodes.md#one-shot-keys) |Key |Description | -- cgit v1.2.3 From 80dfd34fe454f8dde67145fef51eb82ef7ea2e45 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 07:52:11 -0800 Subject: Add additional resource links (#4594) * Add additional resource links And fix a typo or two * Update docs/newbs.md Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- docs/newbs.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/newbs.md b/docs/newbs.md index e687fd2279..4f115c3c78 100644 --- a/docs/newbs.md +++ b/docs/newbs.md @@ -6,13 +6,17 @@ Not sure if your keyboard can run QMK? If it's a mechanical keyboard you built y ## Overview -There are 5 main sections to this guide: +There are 6 main sections to this guide: * [Getting Started](newbs_getting_started.md) * [Building Your First Firmware](newbs_building_firmware.md) * [Flashing Firmware](newbs_flashing.md) * [Testing and Debugging](newbs_testing_debugging.md) -* [Best Practices](newbs_best_practices.md) +* [Git Best Practices](newbs_best_practices.md) * [Learn More with these Resources](newbs_learn_more_resources.md) This guide is focused on helping someone who has never compiled software before. It makes choices and recommendations based on that viewpoint. There are alternative methods for many of these procedures, and we support most of those alternatives. If you have any doubt about how to accomplish a task you can [ask us for guidance](getting_started_getting_help.md). + +## Additional Resources + +* [Thomas Baart's QMK Basics Blog](https://thomasbaart.nl/category/mechanical-keyboards/firmware/qmk/qmk-basics/) – A user-created blog covering the basics of how to use QMK Firmware, as seen from a new user's perspective. -- cgit v1.2.3 From 02d44beb4410b806cb8c38e272941d212fee8a74 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 09:01:58 -0800 Subject: Fix up tap_code functionality (#4609) * Add delay in Tap Code to avoid issues I think a few people have reporting issues with it working properly, and it may be a timing issue. The 'register_code' uses this sort of delay in some of the functions, and this is probably why. Adding the 100ms delay should hopefully fix any issues with it. * Make tap_code delay configurable * Update documentation * Bring tap_code16 inline with changes * Fix type for tap_code16 Bad copy-paste job * Just use the value check for the define * Clarify timing in docs Co-Authored-By: drashna * Wordsmithing Co-Authored-By: drashna --- docs/config_options.md | 2 ++ docs/feature_macros.md | 2 ++ quantum/quantum.c | 8 ++++++++ quantum/quantum.h | 2 +- tmk_core/common/action.c | 12 ++++++++++++ tmk_core/common/action.h | 2 +- 6 files changed, 26 insertions(+), 2 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index b811fa877d..69fecc8b49 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -160,6 +160,8 @@ If you define these options you will enable the associated feature, which may in * Set this to the number of combos that you're using in the [Combo](feature_combo.md) feature. * `#define COMBO_TERM 200` * how long for the Combo keys to be detected. Defaults to `TAPPING_TERM` if not defined. +* `#define TAP_CODE_DELAY 100` + * Sets the delay between `register_code` and `unregister_code`, if you're having issues with it registering properly (common on VUSB boards). The value is in milliseconds. ## RGB Light Configuration diff --git a/docs/feature_macros.md b/docs/feature_macros.md index 29ba29fef7..aa13fb97f4 100644 --- a/docs/feature_macros.md +++ b/docs/feature_macros.md @@ -250,6 +250,8 @@ Parallel to `register_code` function, this sends the `` keyup event to the c This will send `register_code()` and then `unregister_code()`. This is useful if you want to send both the press and release events ("tap" the key, rather than hold it). +If you're having issues with taps (un)registering, you can add a delay between the register and unregister events by setting `#define TAP_CODE_DELAY 100` in your `config.h` file. The value is in milliseconds. + ### `clear_keyboard();` This will clear all mods and keys currently pressed. diff --git a/quantum/quantum.c b/quantum/quantum.c index 69692233eb..a57d4f89fe 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -132,6 +132,14 @@ void unregister_code16 (uint16_t code) { } } +void tap_code16(uint16_t code) { + register_code16(code); + #if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); + #endif + unregister_code16(code); +} + __attribute__ ((weak)) bool process_action_kb(keyrecord_t *record) { return true; diff --git a/quantum/quantum.h b/quantum/quantum.h index 5920e4b139..0faf1af29c 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -243,7 +243,7 @@ void shutdown_user(void); void register_code16(uint16_t code); void unregister_code16(uint16_t code); -inline void tap_code16(uint16_t code) { register_code16(code); unregister_code16(code); } +void tap_code16(uint16_t code); #ifdef BACKLIGHT_ENABLE void backlight_init_ports(void); diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 8bdcd54e32..456d1e25fe 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -847,6 +847,18 @@ void unregister_code(uint8_t code) #endif } +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void tap_code(uint8_t code) { + register_code(code); + #if TAP_CODE_DELAY > 0 + wait_ms(TAP_CODE_DELAY); + #endif + unregister_code(code); +} + /** \brief Utilities for actions. (FIXME: Needs better description) * * FIXME: Needs documentation. diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 833febe9ce..5d797fd628 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -88,7 +88,7 @@ void process_record(keyrecord_t *record); void process_action(keyrecord_t *record, action_t action); void register_code(uint8_t code); void unregister_code(uint8_t code); -inline void tap_code(uint8_t code) { register_code(code); unregister_code(code); } +void tap_code(uint8_t code); void register_mods(uint8_t mods); void unregister_mods(uint8_t mods); //void set_mods(uint8_t mods); -- cgit v1.2.3 From 161ffa0af6b9af76b8e73a3f274bbc415ae9f842 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 10:42:31 -0800 Subject: Add some optimization to the Tetris keyboard (#4645) --- keyboards/tetris/config.h | 12 ++++----- keyboards/tetris/keymaps/default/keymap.c | 42 +++++++++++-------------------- keyboards/tetris/rules.mk | 21 ++++++++-------- 3 files changed, 31 insertions(+), 44 deletions(-) diff --git a/keyboards/tetris/config.h b/keyboards/tetris/config.h index 7e7dac7cf6..c2e5524490 100644 --- a/keyboards/tetris/config.h +++ b/keyboards/tetris/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" @@ -10,6 +9,7 @@ #define MANUFACTURER Fengz #define PRODUCT Tetris #define DESCRIPTION Planck mit + #define QMK_ESC_OUTPUT B0 #define QMK_ESC_INPUT D7 #define QMK_LED B7 @@ -41,8 +41,10 @@ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +#define NO_ACTION_MACRO +#define NO_ACTION_FUNCTION + #define TAPPING_TERM 200 -#define PERMISSIVE_HOLD #ifdef AUDIO_ENABLE #define B5_AUDIO @@ -50,13 +52,11 @@ #define NO_MUSIC_MODE #endif +#if RGBLIGHT_ENABLE #define RGB_DI_PIN F5 -#ifdef RGB_DI_PIN #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_SLEEP #define RGBLED_NUM 47 #define RGBLIGHT_EFFECT_KNIGHT_LED_NUM 12 //#define RGBLIGHT_LIMIT_VAL 128 #endif - -#endif diff --git a/keyboards/tetris/keymaps/default/keymap.c b/keyboards/tetris/keymaps/default/keymap.c index 61f2961b42..5f48bd07ab 100644 --- a/keyboards/tetris/keymaps/default/keymap.c +++ b/keyboards/tetris/keymaps/default/keymap.c @@ -286,7 +286,7 @@ static uint16_t Type_Hue=270; void matrix_init_user( void ) { - _delay_ms( 200 ); + wait_ms( 200 ); /* Encoder init */ encoder_state = PIND & 0x3; @@ -368,27 +368,22 @@ void matrix_scan_user( void ) switch ( layer ) { case 0: - register_code( KC_VOLD ); - unregister_code( KC_VOLD ); + tap_code( KC_VOLD ); break; case _CODE: - register_code( KC_LEFT ); - unregister_code( KC_LEFT ); + tap_code( KC_LEFT ); break; case _RGB: rgblight_decrease_val(); break; case _NUMB: - register_code( KC_LEFT ); - unregister_code( KC_LEFT ); + tap_code( KC_LEFT ); break; case _MARO: - register_code( KC_UP ); - unregister_code( KC_UP ); + tap_code( KC_UP ); break; default: - register_code( KC_VOLD ); - unregister_code( KC_VOLD ); + tap_code( KC_VOLD ); } /* End of Set Encoder Keycode */ @@ -441,27 +436,22 @@ void matrix_scan_user( void ) switch ( layer ) { case 0: - register_code( KC_VOLU ); - unregister_code( KC_VOLU ); + tap_code( KC_VOLU ); break; case _CODE: - register_code( KC_RGHT ); - unregister_code( KC_RGHT ); + tap_code( KC_RGHT ); break; case _RGB: rgblight_increase_val(); break; case _NUMB: - register_code( KC_RGHT ); - unregister_code( KC_RGHT ); + tap_code( KC_RGHT ); break; case _MARO: - register_code( KC_DOWN ); - unregister_code( KC_DOWN ); + tap_code( KC_DOWN ); break; default: - register_code( KC_VOLU ); - unregister_code( KC_VOLU ); + tap_code( KC_VOLU ); } /* End of Set Encoder Keycode */ @@ -739,11 +729,8 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){ if (record->event.pressed) { // Do something when pressed } else { - register_code( KC_0 ); // send 0 - unregister_code( KC_0 ); - - register_code( KC_0 ); // send 0 twice without macro - unregister_code( KC_0 ); + tap_code( KC_0 ); // send 0 + tap_code( KC_0 ); // send 0 twice without macro } return false; // Skip all further processing of this key @@ -818,7 +805,7 @@ bool process_record_user( uint16_t keycode, keyrecord_t *record ){ void led_set_user( uint8_t usb_led ) { static uint8_t old_usb_led = 0; - _delay_ms( 10 ); /* gets rid of tick */ + wait_ms( 10 ); /* gets rid of tick */ if ( (usb_led & (1 << USB_LED_CAPS_LOCK) ) && !(old_usb_led & (1 << USB_LED_CAPS_LOCK) ) ) { /* CAPS on */ @@ -844,4 +831,3 @@ void led_set_user( uint8_t usb_led ) } old_usb_led = usb_led; } // End of led_set_user - diff --git a/keyboards/tetris/rules.mk b/keyboards/tetris/rules.mk index 784f6e4623..4741c162bd 100644 --- a/keyboards/tetris/rules.mk +++ b/keyboards/tetris/rules.mk @@ -44,17 +44,18 @@ BOOTLOADER =qmk-dfu # Build Options # comment out to disable the options. # -BOOTMAGIC_ENABLE ?= no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE ?= no # Mouse keys(+4700) -EXTRAKEY_ENABLE ?= yes # Audio control and System control(+450) -CONSOLE_ENABLE ?= no # Console for debug(+400) -COMMAND_ENABLE ?= no # Commands for debug and configuration -SLEEP_LED_ENABLE ?= no # Breathing sleep LED during USB suspend -NKRO_ENABLE ?= yes # USB 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 -AUDIO_ENABLE ?= yes -RGBLIGHT_ENABLE ?= yes +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = yes +RGBLIGHT_ENABLE = yes TAP_DANCE_ENABLE = no + EXTRAFLAGS += -flto # Make the hex smaller LAYOUTS = planck_mit -- cgit v1.2.3 From 9739d6ba0ad3da93f42cc28a78a6722d39ad3d72 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 10:43:24 -0800 Subject: Docs: Clarify audio keycodes (#4620) * Clarify audio keycodes * Spelling errors Co-Authored-By: drashna * Spacing in md Co-Authored-By: drashna * Fix midi link too * Wordsmithing --- docs/feature_audio.md | 10 ++++++---- docs/keycodes.md | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docs/feature_audio.md b/docs/feature_audio.md index a39c456873..38861e8c14 100644 --- a/docs/feature_audio.md +++ b/docs/feature_audio.md @@ -61,9 +61,11 @@ It's advised that you wrap all audio features in `#ifdef AUDIO_ENABLE` / `#endif The available keycodes for audio are: -* `AU_ON` - Turn audio mode on -* `AU_OFF` - Turn audio mode off -* `AU_TOG` - Toggle audio mode +* `AU_ON` - Turn Audio Feature on +* `AU_OFF` - Turn Audio Feature off +* `AU_TOG` - Toggle Audio Feature state + +!> These keycodes turn all of the audio functionality on and off. Turning it off means that audio feedback, audio clicky, music mode, etc. are disabled, completely. ## ARM Audio Volume @@ -158,7 +160,7 @@ You can configure the default, min and max frequencies, the stepping and built i ## MIDI Functionality -This is still a WIP, but check out `quantum/keymap_midi.c` to see what's happening. Enable from the Makefile. +This is still a WIP, but check out `quantum/process_keycode/process_midi.c` to see what's happening. Enable from the Makefile. ## Audio Keycodes diff --git a/docs/keycodes.md b/docs/keycodes.md index 468b59f84f..6d85253935 100644 --- a/docs/keycodes.md +++ b/docs/keycodes.md @@ -226,9 +226,9 @@ This is a reference only. Each group of keys links to the page documenting their |Key |Aliases |Description | |----------------|---------|----------------------------------| -|`AU_ON` | |Audio mode on | -|`AU_OFF` | |Audio mode off | -|`AU_TOG` | |Toggles Audio mode | +|`AU_ON` | |Turns on Audio Feature | +|`AU_OFF` | |Turns off Audio Feature | +|`AU_TOG` | |Toggles Audio state | |`CLICKY_TOGGLE` |`CK_TOGG`|Toggles Audio clicky mode | |`CLICKY_UP` |`CK_UP` |Increases frequency of the clicks | |`CLICKY_DOWN` |`CK_DOWN`|Decreases frequency of the clicks | -- cgit v1.2.3 From 155e9310ff685f557287749bef2e02510538a6d9 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sat, 15 Dec 2018 04:00:10 +0900 Subject: Make quantum/split_common/serial.[ch] configurable (#4419) * add temporary compile test shell script * add 'CONFIG_H += serial_backward_compatibility.h' into common_features.mk:SPLIT_KEYBOARD block * add quantum/split_common/serial_backward_compatibility.h SERIAL_PIN_PORT and other PIN define move to serial_backward_compatibility.h SERIAL_BACKLIT_START move to split_util.h * quantum/split_common/serial.c change to helix-serial.c style serial configuration * add temporary file quantum/split_common/split-keyboards-list.txt * add '#define SOFT_SERIAL_PIN D0' to keyboards/6lit/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/divergetm2/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/ergotravel/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/foobar/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/handwired/dactyl_manuform/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/handwired/qc60/config.h * add '//#define SOFT_SERIAL_PIN D0' to keyboards/handwired/xealous/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/iris/rev*/config.h * add '//#define SOFT_SERIAL_PIN D0' to keyboards/lets_split_eh/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/levinson/rev*/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/miniaxe/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/nyquist/rev?/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/quefrency/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/qwertyydox/config.h,keyboards/qwertyydox/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/redox/rev1/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/rorschach/rev1/config.h * remove '#define SOFT_SERIAL_PIN D0' from quantum/split_common/serial_backward_compatibility.h * remove temporary file quantum/split_common/split-keyboards-list.txt * remove temporary compile test shell script * Revert "remove temporary compile test shell script" This reverts commit 15b0021b4092127b8d8a21f572642ad3702b46d4. * update quantum/split_common/compile_split_test.sh for new keyboard test * add '#define SOFT_SERIAL_PIN D0' to keyboards/diverge3/config.h * add '#define SOFT_SERIAL_PIN D0' to keyboards/40percentclub/25/config.h * remove temporary compile test shell script * update docs/config_options.md, quantum/template/avr/config.h * fix quantum/template/avr/config.h * fix typo docs/config_options.md --- common_features.mk | 5 ++ docs/config_options.md | 3 ++ keyboards/40percentclub/25/config.h | 2 + keyboards/40percentclub/6lit/config.h | 3 ++ keyboards/40percentclub/foobar/config.h | 3 ++ keyboards/diverge3/config.h | 3 ++ keyboards/divergetm2/config.h | 3 ++ keyboards/ergotravel/rev1/config.h | 3 ++ keyboards/handwired/dactyl_manuform/config.h | 3 ++ keyboards/handwired/qc60/config.h | 3 ++ keyboards/handwired/xealous/config.h | 5 +- keyboards/iris/rev1/config.h | 3 ++ keyboards/iris/rev1_led/config.h | 3 ++ keyboards/iris/rev2/config.h | 3 ++ keyboards/iris/rev3/config.h | 3 ++ keyboards/lets_split_eh/config.h | 3 ++ keyboards/levinson/rev1/config.h | 3 ++ keyboards/levinson/rev2/config.h | 3 ++ keyboards/miniaxe/config.h | 3 ++ keyboards/nyquist/rev1/config.h | 3 ++ keyboards/nyquist/rev2/config.h | 3 ++ keyboards/nyquist/rev3/config.h | 3 ++ keyboards/quefrency/rev1/config.h | 3 ++ keyboards/qwertyydox/config.h | 3 ++ keyboards/qwertyydox/rev1/config.h | 3 ++ keyboards/redox/rev1/config.h | 3 ++ keyboards/rorschach/rev1/config.h | 3 ++ quantum/split_common/serial.c | 53 ++++++++++++++++++++++ quantum/split_common/serial.h | 23 ++++------ .../split_common/serial_backward_compatibility.h | 11 +++++ quantum/split_common/split_util.h | 3 ++ quantum/template/avr/config.h | 5 ++ 32 files changed, 165 insertions(+), 14 deletions(-) create mode 100644 quantum/split_common/serial_backward_compatibility.h diff --git a/common_features.mk b/common_features.mk index bd88e04d62..97febe2e77 100644 --- a/common_features.mk +++ b/common_features.mk @@ -263,6 +263,11 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes) endif ifeq ($(strip $(SPLIT_KEYBOARD)), yes) + SERIAL_BACKWARD_COMPAT := $(wildcard $(QUANTUM_DIR)/split_common/serial_backward_compatibility.h) + ifneq ($(SERIAL_BACKWARD_COMPAT),) + CONFIG_H += $(SERIAL_BACKWARD_COMPAT) + # $(info CONFIG_H=$(CONFIG_H)) + endif OPT_DEFS += -DSPLIT_KEYBOARD QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ $(QUANTUM_DIR)/split_common/split_util.c \ diff --git a/docs/config_options.md b/docs/config_options.md index 69fecc8b49..bea4acb010 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -198,6 +198,9 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) +* `#define SOFT_SERIAL_PIN D0` + * When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`. + # The `rules.mk` File This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features. diff --git a/keyboards/40percentclub/25/config.h b/keyboards/40percentclub/25/config.h index 23b768e153..7fe59fcca0 100644 --- a/keyboards/40percentclub/25/config.h +++ b/keyboards/40percentclub/25/config.h @@ -27,6 +27,8 @@ #define DESCRIPTION A split 50 key keyboard #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 /* Select hand configuration */ #define MASTER_LEFT diff --git a/keyboards/40percentclub/6lit/config.h b/keyboards/40percentclub/6lit/config.h index 8397818a61..940518f365 100644 --- a/keyboards/40percentclub/6lit/config.h +++ b/keyboards/40percentclub/6lit/config.h @@ -28,6 +28,9 @@ #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Select hand configuration */ #define MASTER_LEFT //#define MASTER_RIGHT diff --git a/keyboards/40percentclub/foobar/config.h b/keyboards/40percentclub/foobar/config.h index 89219c4607..88075c4560 100644 --- a/keyboards/40percentclub/foobar/config.h +++ b/keyboards/40percentclub/foobar/config.h @@ -28,6 +28,9 @@ #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Select hand configuration */ #define MASTER_LEFT //#define MASTER_RIGHT diff --git a/keyboards/diverge3/config.h b/keyboards/diverge3/config.h index 262be7b757..464dc835ff 100644 --- a/keyboards/diverge3/config.h +++ b/keyboards/diverge3/config.h @@ -57,6 +57,9 @@ along with this program. If not, see . /* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost (lacks anti-ghosting diodes) */ //#define MATRIX_HAS_GHOST diff --git a/keyboards/divergetm2/config.h b/keyboards/divergetm2/config.h index 8bc9d2c803..cbeeff9aa8 100644 --- a/keyboards/divergetm2/config.h +++ b/keyboards/divergetm2/config.h @@ -59,6 +59,9 @@ /* Locking resynchronize hack */ #define LOCKING_RESYNC_ENABLE +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* * Magic Key Options * diff --git a/keyboards/ergotravel/rev1/config.h b/keyboards/ergotravel/rev1/config.h index 3af1147a7a..e6d557361c 100644 --- a/keyboards/ergotravel/rev1/config.h +++ b/keyboards/ergotravel/rev1/config.h @@ -56,6 +56,9 @@ along with this program. If not, see . keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ ) +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + #define BACKLIGHT_PIN B5 #define BACKLIGHT_LEVELS 5 diff --git a/keyboards/handwired/dactyl_manuform/config.h b/keyboards/handwired/dactyl_manuform/config.h index 320ce3c482..0e6f3f98ed 100644 --- a/keyboards/handwired/dactyl_manuform/config.h +++ b/keyboards/handwired/dactyl_manuform/config.h @@ -38,6 +38,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/handwired/qc60/config.h b/keyboards/handwired/qc60/config.h index 3b6f84390b..00d095ddf1 100644 --- a/keyboards/handwired/qc60/config.h +++ b/keyboards/handwired/qc60/config.h @@ -18,6 +18,9 @@ /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ diff --git a/keyboards/handwired/xealous/config.h b/keyboards/handwired/xealous/config.h index 415a0dcf5b..7bce502c15 100644 --- a/keyboards/handwired/xealous/config.h +++ b/keyboards/handwired/xealous/config.h @@ -21,10 +21,13 @@ along with this program. If not, see . /* Use I2C or Serial, not both */ -// #define USE_SERIAL #define USE_I2C #define SCL_CLOCK 400000UL +// #define USE_SERIAL +/* serial.c configuration for split keyboard */ +// #define SOFT_SERIAL_PIN D0 + /* Select hand configuration */ #define MASTER_LEFT diff --git a/keyboards/iris/rev1/config.h b/keyboards/iris/rev1/config.h index 7f76df54ba..3b31ca0d7e 100644 --- a/keyboards/iris/rev1/config.h +++ b/keyboards/iris/rev1/config.h @@ -48,6 +48,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/iris/rev1_led/config.h b/keyboards/iris/rev1_led/config.h index b58b11836a..e9739c0031 100644 --- a/keyboards/iris/rev1_led/config.h +++ b/keyboards/iris/rev1_led/config.h @@ -48,6 +48,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/iris/rev2/config.h b/keyboards/iris/rev2/config.h index 266c29b9c9..d43d4b1c64 100644 --- a/keyboards/iris/rev2/config.h +++ b/keyboards/iris/rev2/config.h @@ -48,6 +48,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/iris/rev3/config.h b/keyboards/iris/rev3/config.h index 1032231d89..5642512f39 100644 --- a/keyboards/iris/rev3/config.h +++ b/keyboards/iris/rev3/config.h @@ -48,6 +48,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/lets_split_eh/config.h b/keyboards/lets_split_eh/config.h index b8fe95ea2b..abfee0eace 100644 --- a/keyboards/lets_split_eh/config.h +++ b/keyboards/lets_split_eh/config.h @@ -36,6 +36,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +//#define SOFT_SERIAL_PIN D0 + /* key combination for command */ #define IS_COMMAND() ( \ keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ diff --git a/keyboards/levinson/rev1/config.h b/keyboards/levinson/rev1/config.h index 8161b4e32f..07ba1e221e 100644 --- a/keyboards/levinson/rev1/config.h +++ b/keyboards/levinson/rev1/config.h @@ -41,6 +41,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/levinson/rev2/config.h b/keyboards/levinson/rev2/config.h index 03b98b45c1..a731c71955 100644 --- a/keyboards/levinson/rev2/config.h +++ b/keyboards/levinson/rev2/config.h @@ -41,6 +41,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/miniaxe/config.h b/keyboards/miniaxe/config.h index 13608feab2..2b732ca16f 100644 --- a/keyboards/miniaxe/config.h +++ b/keyboards/miniaxe/config.h @@ -237,6 +237,9 @@ along with this program. If not, see . /* Serial settings */ #define USE_SERIAL +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + //#define EE_HANDS #define I2C_MASTER_LEFT //#define I2C_MASTER_RIGHT diff --git a/keyboards/nyquist/rev1/config.h b/keyboards/nyquist/rev1/config.h index 35fbaffb96..892054b733 100644 --- a/keyboards/nyquist/rev1/config.h +++ b/keyboards/nyquist/rev1/config.h @@ -46,6 +46,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/nyquist/rev2/config.h b/keyboards/nyquist/rev2/config.h index 7dc743b275..21aea0aada 100644 --- a/keyboards/nyquist/rev2/config.h +++ b/keyboards/nyquist/rev2/config.h @@ -43,6 +43,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/nyquist/rev3/config.h b/keyboards/nyquist/rev3/config.h index 6c51bc9a80..8054ba79c2 100644 --- a/keyboards/nyquist/rev3/config.h +++ b/keyboards/nyquist/rev3/config.h @@ -43,6 +43,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/quefrency/rev1/config.h b/keyboards/quefrency/rev1/config.h index 1074590ff5..88d7044864 100644 --- a/keyboards/quefrency/rev1/config.h +++ b/keyboards/quefrency/rev1/config.h @@ -41,6 +41,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/qwertyydox/config.h b/keyboards/qwertyydox/config.h index b22ca534e3..a685652230 100644 --- a/keyboards/qwertyydox/config.h +++ b/keyboards/qwertyydox/config.h @@ -49,6 +49,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/qwertyydox/rev1/config.h b/keyboards/qwertyydox/rev1/config.h index 3d4c9b0d00..a2557592d3 100644 --- a/keyboards/qwertyydox/rev1/config.h +++ b/keyboards/qwertyydox/rev1/config.h @@ -49,6 +49,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/redox/rev1/config.h b/keyboards/redox/rev1/config.h index f4ccbd2fd5..654a84de74 100644 --- a/keyboards/redox/rev1/config.h +++ b/keyboards/redox/rev1/config.h @@ -49,6 +49,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/rorschach/rev1/config.h b/keyboards/rorschach/rev1/config.h index 1c9ef8276c..1ea6dde98d 100644 --- a/keyboards/rorschach/rev1/config.h +++ b/keyboards/rorschach/rev1/config.h @@ -42,6 +42,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index 74bcbb6bf6..f34f824d7d 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c @@ -14,6 +14,59 @@ #ifndef USE_I2C +#ifndef SOFT_SERIAL_PIN + #error quantum/split_common/serial.c need SOFT_SERIAL_PIN define +#endif + +#ifdef __AVR_ATmega32U4__ + // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. + #ifdef USE_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif + #endif + + #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 + #define SERIAL_PIN_DDR DDRD + #define SERIAL_PIN_PORT PORTD + #define SERIAL_PIN_INPUT PIND + #if SOFT_SERIAL_PIN == D0 + #define SERIAL_PIN_MASK _BV(PD0) + #define EIMSK_BIT _BV(INT0) + #define EICRx_BIT (~(_BV(ISC00) | _BV(ISC01))) + #define SERIAL_PIN_INTERRUPT INT0_vect + #elif SOFT_SERIAL_PIN == D1 + #define SERIAL_PIN_MASK _BV(PD1) + #define EIMSK_BIT _BV(INT1) + #define EICRx_BIT (~(_BV(ISC10) | _BV(ISC11))) + #define SERIAL_PIN_INTERRUPT INT1_vect + #elif SOFT_SERIAL_PIN == D2 + #define SERIAL_PIN_MASK _BV(PD2) + #define EIMSK_BIT _BV(INT2) + #define EICRx_BIT (~(_BV(ISC20) | _BV(ISC21))) + #define SERIAL_PIN_INTERRUPT INT2_vect + #elif SOFT_SERIAL_PIN == D3 + #define SERIAL_PIN_MASK _BV(PD3) + #define EIMSK_BIT _BV(INT3) + #define EICRx_BIT (~(_BV(ISC30) | _BV(ISC31))) + #define SERIAL_PIN_INTERRUPT INT3_vect + #endif + #elif SOFT_SERIAL_PIN == E6 + #define SERIAL_PIN_DDR DDRE + #define SERIAL_PIN_PORT PORTE + #define SERIAL_PIN_INPUT PINE + #define SERIAL_PIN_MASK _BV(PE6) + #define EIMSK_BIT _BV(INT6) + #define EICRx_BIT (~(_BV(ISC60) | _BV(ISC61))) + #define SERIAL_PIN_INTERRUPT INT6_vect + #else + #error invalid SOFT_SERIAL_PIN value + #endif + +#else + #error serial.c now support ATmega32U4 only +#endif + // Serial pulse period in microseconds. Its probably a bad idea to lower this // value. #define SERIAL_DELAY 24 diff --git a/quantum/split_common/serial.h b/quantum/split_common/serial.h index e566eb8a06..0b99f352d0 100644 --- a/quantum/split_common/serial.h +++ b/quantum/split_common/serial.h @@ -1,21 +1,18 @@ #ifndef MY_SERIAL_H #define MY_SERIAL_H -#include "config.h" #include -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Address location defines -#define SERIAL_BACKLIT_START 0x00 +// ///////////////////////////////////////////////////////////////// +// Need Soft Serial defines in config.h +// ///////////////////////////////////////////////////////////////// +// ex. +// /* Configuration of lower interface with the lower layer(hardware) of serial.c */ +// #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// +// /* Configuration of upper interface with the upper layer of serial.c */ +// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 +// #define SERIAL_MASTER_BUFFER_LENGTH 1 // Buffers for master - slave communication extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; diff --git a/quantum/split_common/serial_backward_compatibility.h b/quantum/split_common/serial_backward_compatibility.h new file mode 100644 index 0000000000..216b6c41ff --- /dev/null +++ b/quantum/split_common/serial_backward_compatibility.h @@ -0,0 +1,11 @@ +/* serial.h backward compatibility */ + +// #ifndef SOFT_SERIAL_PIN +// #define SOFT_SERIAL_PIN D0 +// #endif + +#ifndef SERIAL_SLAVE_BUFFER_LENGTH + #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 + #define SERIAL_MASTER_BUFFER_LENGTH 1 +#endif + diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h index d6cf3e72a9..45e8db0f2f 100644 --- a/quantum/split_common/split_util.h +++ b/quantum/split_common/split_util.h @@ -7,6 +7,9 @@ #include #include "eeconfig.h" +// backlight level store index in serial_master_buffer[] for slave to read +#define SERIAL_BACKLIT_START 0x00 + #define SLAVE_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; diff --git a/quantum/template/avr/config.h b/quantum/template/avr/config.h index 463ddff2db..eed50e5c04 100644 --- a/quantum/template/avr/config.h +++ b/quantum/template/avr/config.h @@ -48,6 +48,11 @@ along with this program. If not, see . /* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ #define DIODE_DIRECTION COL2ROW +/* + * Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk, and define SOFT_SERIAL_PIN. + */ +#define SOFT_SERIAL_PIN D0 // or D1, D2, D3, E6 + // #define BACKLIGHT_PIN B7 // #define BACKLIGHT_BREATHING // #define BACKLIGHT_LEVELS 3 -- cgit v1.2.3 From 8f02375cc6ddfbbc6be384a9d5b1a9c91517099e Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 11:37:26 -0800 Subject: Keyboard: B.mini EX refactor and Configurator support (#4647) * B.mini EX: refactor - add LAYOUT_ansi and LAYOUT_iso macros - add ansi and iso keymaps with readme files * B.mini EX: Configurator support --- keyboards/bminiex/bminiex.h | 36 ++++ keyboards/bminiex/info.json | 340 +++++++++++++++++++++++++++++++ keyboards/bminiex/keymaps/ansi/keymap.c | 29 +++ keyboards/bminiex/keymaps/ansi/readme.md | 17 ++ keyboards/bminiex/keymaps/iso/keymap.c | 29 +++ keyboards/bminiex/keymaps/iso/readme.md | 17 ++ 6 files changed, 468 insertions(+) create mode 100644 keyboards/bminiex/info.json create mode 100644 keyboards/bminiex/keymaps/ansi/keymap.c create mode 100644 keyboards/bminiex/keymaps/ansi/readme.md create mode 100644 keyboards/bminiex/keymaps/iso/keymap.c create mode 100644 keyboards/bminiex/keymaps/iso/readme.md diff --git a/keyboards/bminiex/bminiex.h b/keyboards/bminiex/bminiex.h index a58ce68923..8d897f639f 100644 --- a/keyboards/bminiex/bminiex.h +++ b/keyboards/bminiex/bminiex.h @@ -37,6 +37,42 @@ along with this program. If not, see . { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ } +#define LAYOUT_ansi( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, KD3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KD2, KE0, K62, K72, K82, K92, \ + K01, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, KC_NO, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC_NO, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KD3, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + +#define LAYOUT_iso( \ + K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ + K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ + K03, K13, K23, K33, K43, K53, K26, KC6, KC7, K27, KA3, KB3, KC3, K67, K63, K73, K83, \ + K02, K12, K22, K32, K42, K52, K36, KD6, KD7, K37, KA2, KB2, KC2, KD2, KE0, K62, K72, K82, K92, \ + K01, K30, K11, K21, K31, K41, K51, K46, KE6, KE7, K47, KA1, KB1, K86, K77, K61, K71, K81, \ + K00, K10, K20, K56, K57, KB0, KC0, K66, K76, K96, K60, K80, K90 \ +){ \ + { K00, K10, K20, K30, KC_NO, KC_NO, K60, KC_NO, K80, K90, KC_NO, KB0, KC0, KD0, KE0 }, \ + { K01, K11, K21, K31, K41, K51, K61, K71, K81, KC_NO, KA1, KB1, KC_NO, KD1, KE1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2, KE2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, KC_NO, KA3, KB3, KC3, KC_NO, KC_NO }, \ + { K04, K14, K24, K34, K44, K54, K64, K74, K84, K94, KA4, KB4, KC4, KC_NO, KE4 }, \ + { K05, KC_NO, K25, K35, K45, K55, K65, K75, K85, K95, KC_NO, KB5, KC5, KD5, KE5 }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6, KE6 }, \ + { K07, K17, K27, K37, K47, K57, K67, K77, KC_NO, KC_NO, KA7, KB7, KC7, KD7, KE7 } \ +} + #define LAYOUT_kc( \ K05, K25, K35, K45, K55, K06, KA6, KA7, K07, KB5, KC5, KD5, KE5, KD1, KE1, KE2, K65, K75, K85, K95, \ K04, K14, K24, K34, K44, K54, K16, KB6, KB7, K17, KA4, KB4, KC4, KE4, KD0, K64, K74, K84, K94, \ diff --git a/keyboards/bminiex/info.json b/keyboards/bminiex/info.json new file mode 100644 index 0000000000..8e38fbfb93 --- /dev/null +++ b/keyboards/bminiex/info.json @@ -0,0 +1,340 @@ +{ + "keyboard_name": "winkeyless.kr B.mini EX", + "keyboard_folder": "bminiex", + "url": "https://winkeyless.kr/product/b-mini-ex-x2-pcb/", + "maintainer": "qmk", + "width": 20.25, + "height": 6.25, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"NO", "x":13.5, "y":2.25, "w":1.5}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"NUHS", "x":12.75, "y":3.25}, + {"label":"ENT", "x":13.75, "y":3.25, "w":1.25}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":1.25}, + {"label":"NUBS", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"BSLS", "x":13.5, "y":2.25, "w":1.5}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"ENT", "x":12.75, "y":3.25, "w":2.25}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + }, + "LAYOUT_iso": { + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PSCR", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"NO", "x":16.25, "y":0}, + {"label":"NO", "x":17.25, "y":0}, + {"label":"NO", "x":18.25, "y":0}, + {"label":"NO", "x":19.25, "y":0}, + {"label":"GRV", "x":0, "y":1.25}, + {"label":"1", "x":1, "y":1.25}, + {"label":"2", "x":2, "y":1.25}, + {"label":"3", "x":3, "y":1.25}, + {"label":"4", "x":4, "y":1.25}, + {"label":"5", "x":5, "y":1.25}, + {"label":"6", "x":6, "y":1.25}, + {"label":"7", "x":7, "y":1.25}, + {"label":"8", "x":8, "y":1.25}, + {"label":"9", "x":9, "y":1.25}, + {"label":"0", "x":10, "y":1.25}, + {"label":"MINS", "x":11, "y":1.25}, + {"label":"EQL", "x":12, "y":1.25}, + {"label":"BSPC", "x":13, "y":1.25, "w":2}, + {"label":"DEL", "x":15, "y":1.25}, + {"label":"NLCK", "x":16.25, "y":1.25}, + {"label":"PSLS", "x":17.25, "y":1.25}, + {"label":"PAST", "x":18.25, "y":1.25}, + {"label":"PMNS", "x":19.25, "y":1.25}, + {"label":"TAB", "x":0, "y":2.25, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.25}, + {"label":"W", "x":2.5, "y":2.25}, + {"label":"E", "x":3.5, "y":2.25}, + {"label":"R", "x":4.5, "y":2.25}, + {"label":"T", "x":5.5, "y":2.25}, + {"label":"Y", "x":6.5, "y":2.25}, + {"label":"U", "x":7.5, "y":2.25}, + {"label":"I", "x":8.5, "y":2.25}, + {"label":"O", "x":9.5, "y":2.25}, + {"label":"P", "x":10.5, "y":2.25}, + {"label":"LBRC", "x":11.5, "y":2.25}, + {"label":"RBRC", "x":12.5, "y":2.25}, + {"label":"INS", "x":15, "y":2.25}, + {"label":"P7", "x":16.25, "y":2.25}, + {"label":"P8", "x":17.25, "y":2.25}, + {"label":"P9", "x":18.25, "y":2.25}, + {"label":"CAPS", "x":0, "y":3.25, "w":1.75}, + {"label":"A", "x":1.75, "y":3.25}, + {"label":"S", "x":2.75, "y":3.25}, + {"label":"D", "x":3.75, "y":3.25}, + {"label":"F", "x":4.75, "y":3.25}, + {"label":"G", "x":5.75, "y":3.25}, + {"label":"H", "x":6.75, "y":3.25}, + {"label":"J", "x":7.75, "y":3.25}, + {"label":"K", "x":8.75, "y":3.25}, + {"label":"L", "x":9.75, "y":3.25}, + {"label":"SCLN", "x":10.75, "y":3.25}, + {"label":"QUOT", "x":11.75, "y":3.25}, + {"label":"NUHS", "x":12.75, "y":3.25}, + {"label":"ENT", "x":13.75, "y":2.25, "w":1.25, "h":2}, + {"label":"PGUP", "x":15, "y":3.25}, + {"label":"P4", "x":16.25, "y":3.25}, + {"label":"P5", "x":17.25, "y":3.25}, + {"label":"P6", "x":18.25, "y":3.25}, + {"label":"PPLS", "x":19.25, "y":2.25, "h":2}, + {"label":"LSFT", "x":0, "y":4.25, "w":1.25}, + {"label":"NUBS", "x":1.25, "y":4.25}, + {"label":"Z", "x":2.25, "y":4.25}, + {"label":"X", "x":3.25, "y":4.25}, + {"label":"C", "x":4.25, "y":4.25}, + {"label":"V", "x":5.25, "y":4.25}, + {"label":"B", "x":6.25, "y":4.25}, + {"label":"N", "x":7.25, "y":4.25}, + {"label":"M", "x":8.25, "y":4.25}, + {"label":"COMM", "x":9.25, "y":4.25}, + {"label":"DOT", "x":10.25, "y":4.25}, + {"label":"SLSH", "x":11.25, "y":4.25}, + {"label":"RSFT", "x":12.25, "y":4.25, "w":1.75}, + {"label":"UP", "x":14, "y":4.25}, + {"label":"PGDN", "x":15, "y":4.25}, + {"label":"P1", "x":16.25, "y":4.25}, + {"label":"P2", "x":17.25, "y":4.25}, + {"label":"P3", "x":18.25, "y":4.25}, + {"label":"LCTL", "x":0, "y":5.25, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5.25, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5.25, "w":1.25}, + {"label":"SPC", "x":3.75, "y":5.25, "w":6.25}, + {"label":"RALT", "x":10, "y":5.25}, + {"label":"APP", "x":11, "y":5.25}, + {"label":"RCTL", "x":12, "y":5.25}, + {"label":"LEFT", "x":13, "y":5.25}, + {"label":"DOWN", "x":14, "y":5.25}, + {"label":"RGHT", "x":15, "y":5.25}, + {"label":"P0", "x":16.25, "y":5.25, "w":2}, + {"label":"PDOT", "x":18.25, "y":5.25}, + {"label":"PENT", "x":19.25, "y":4.25, "h":2} + ] + } + } +} diff --git a/keyboards/bminiex/keymaps/ansi/keymap.c b/keyboards/bminiex/keymaps/ansi/keymap.c new file mode 100644 index 0000000000..12c0714b13 --- /dev/null +++ b/keyboards/bminiex/keymaps/ansi/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_ansi( + 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_HOME, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, \ + 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_DEL, 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_INS, KC_P7, KC_P8, KC_P9, \ + KC_LCAP, 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_PGUP, 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_RSFT, KC_UP, KC_PGDN, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ) +}; diff --git a/keyboards/bminiex/keymaps/ansi/readme.md b/keyboards/bminiex/keymaps/ansi/readme.md new file mode 100644 index 0000000000..853fa05c59 --- /dev/null +++ b/keyboards/bminiex/keymaps/ansi/readme.md @@ -0,0 +1,17 @@ +# ansi + +An ANSI-layout keymap based on the default. + + ,-------------------------------------------------------------------------------. + |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|PSc|Hm |End|NO |NO |NO |NO | + |-------------------------------------------------------------------------------| + |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Bksp |Del|NLck|P/|P* |P- | + |-------------------------------------------------------------------------------| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Ins|P7 |P8 |P9 | | + |---------------------------------------------------------------------------|P+ | + |CapsLk|A |S |D |F |G |H |J |K |L |; |' |Enter |PgU|P4 |P5 |P6 | | + |-------------------------------------------------------------------------------| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD|P1 |P2 |P3 | | + |---------------------------------------------------------------------------|Ent| + |Ctrl|GUI |Alt |Space |Alt|App|Ctl|Lft|Dwn|Rgt|P0 |P. | | + `-------------------------------------------------------------------------------' diff --git a/keyboards/bminiex/keymaps/iso/keymap.c b/keyboards/bminiex/keymaps/iso/keymap.c new file mode 100644 index 0000000000..aa4ddf063a --- /dev/null +++ b/keyboards/bminiex/keymaps/iso/keymap.c @@ -0,0 +1,29 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_iso( + 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_HOME, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, \ + 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_DEL, 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_INS, KC_P7, KC_P8, KC_P9, \ + KC_LCAP, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, KC_P4, KC_P5, KC_P6, KC_PPLS, \ + 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_PGDN, KC_P1, KC_P2, KC_P3, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT \ + ) +}; diff --git a/keyboards/bminiex/keymaps/iso/readme.md b/keyboards/bminiex/keymaps/iso/readme.md new file mode 100644 index 0000000000..74c42a6184 --- /dev/null +++ b/keyboards/bminiex/keymaps/iso/readme.md @@ -0,0 +1,17 @@ +# iso + +An ISO-layout keymap based on the default. + + ,-------------------------------------------------------------------------------. + |Esc|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|PSc|Hm |End|NO |NO |NO |NO | + |-------------------------------------------------------------------------------| + |` |1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Bksp |Del|NLck|P/|P* |P- | + |-------------------------------------------------------------------------------| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] | |Ins|P7 |P8 |P9 | | + |------------------------------------------------------.Ent |---------------|P+ | + |CapsLk|A |S |D |F |G |H |J |K |L |; |' |# | |PgU|P4 |P5 |P6 | | + |-------------------------------------------------------------------------------| + |Sft |\ |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD|P1 |P2 |P3 | | + |---------------------------------------------------------------------------|Ent| + |Ctrl|GUI |Alt |Space |Alt|App|Ctl|Lft|Dwn|Rgt|P0 |P. | | + `-------------------------------------------------------------------------------' -- cgit v1.2.3 From 118d5cc03f587dcf97740606f8b4552749f849bc Mon Sep 17 00:00:00 2001 From: patrickmt <40182064+patrickmt@users.noreply.github.com> Date: Fri, 14 Dec 2018 13:37:37 -0500 Subject: Fix macro redefinition for GNUC compilers > 6 GNUC compilers greater than version 6 already have the macro __always_inline defined. This fix checks GNUC version before defining the macro itself. --- tmk_core/protocol/arm_atsam/usb/compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tmk_core/protocol/arm_atsam/usb/compiler.h b/tmk_core/protocol/arm_atsam/usb/compiler.h index d338439867..7d8350896b 100644 --- a/tmk_core/protocol/arm_atsam/usb/compiler.h +++ b/tmk_core/protocol/arm_atsam/usb/compiler.h @@ -136,7 +136,7 @@ */ #if defined(__CC_ARM) # define __always_inline __forceinline -#elif (defined __GNUC__) +#elif (defined __GNUC__ && __GNUC__ <= 6) # define __always_inline __attribute__((__always_inline__)) #elif (defined __ICCARM__) # define __always_inline _Pragma("inline=forced") -- cgit v1.2.3 From 306f23dc5119d864eb29cfef99ededb81075368e Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 14 Dec 2018 20:49:33 +0000 Subject: Document the correct path to the split keyboard EEPROM files (#4585) * Document the correct path to the split keyboard EEPROM files * Document the correct path to the split keyboard EEPROM files --- keyboards/handwired/dactyl_manuform/readme.md | 4 ++-- keyboards/handwired/not_so_minidox/readme.md | 4 ++-- keyboards/handwired/xealous/readme.md | 4 ++-- keyboards/lets_split/readme.md | 4 ++-- keyboards/minidox/readme.md | 4 ++-- keyboards/orthodox/readme.md | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/keyboards/handwired/dactyl_manuform/readme.md b/keyboards/handwired/dactyl_manuform/readme.md index 00288a8768..0d08c67a08 100644 --- a/keyboards/handwired/dactyl_manuform/readme.md +++ b/keyboards/handwired/dactyl_manuform/readme.md @@ -131,13 +131,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/handwired/not_so_minidox/readme.md b/keyboards/handwired/not_so_minidox/readme.md index 22d3558735..bd40607357 100644 --- a/keyboards/handwired/not_so_minidox/readme.md +++ b/keyboards/handwired/not_so_minidox/readme.md @@ -50,13 +50,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/handwired/xealous/readme.md b/keyboards/handwired/xealous/readme.md index 97bebbfe3a..14947cc90c 100644 --- a/keyboards/handwired/xealous/readme.md +++ b/keyboards/handwired/xealous/readme.md @@ -130,13 +130,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/lets_split/readme.md b/keyboards/lets_split/readme.md index 80fe08b93c..2a2b95c097 100644 --- a/keyboards/lets_split/readme.md +++ b/keyboards/lets_split/readme.md @@ -151,13 +151,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/minidox/readme.md b/keyboards/minidox/readme.md index 859504a43d..9ec306421d 100644 --- a/keyboards/minidox/readme.md +++ b/keyboards/minidox/readme.md @@ -54,13 +54,13 @@ file will run on both hands instead of having to flash left and right handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-lefthand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-lefthand.eep" // or the equivalent in dfu-programmer ``` and similarly for right half ``` -avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:eeprom-righhand.eep +avrdude -p atmega32u4 -P $(COM_PORT) -c avr109 -U eeprom:w:"./quantum/split_common/eeprom-righthand.eep" // or the equivalent in dfu-programmer ``` diff --git a/keyboards/orthodox/readme.md b/keyboards/orthodox/readme.md index 0c47dd9c43..8bf60a9bdd 100644 --- a/keyboards/orthodox/readme.md +++ b/keyboards/orthodox/readme.md @@ -125,7 +125,7 @@ EEPROM for the left and right halves. The EEPROM is used to store whether the half is left handed or right handed. This makes it so that the same firmware -file will run on both hands instead of having to flash [left](../lets_split/eeprom-lefthand.eep) and [right](../lets_split/eeprom-righthand.eep) handed +file will run on both hands instead of having to flash [left](../../quantum/split_common/eeprom-lefthand.eep) and [right](../../quantum/split_common/eeprom-righthand.eep) handed versions of the firmware to each half. To flash the EEPROM file for the left half run: ``` -- cgit v1.2.3 From 4446f86bfd273512d473d33c46d99690db5fbc51 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 13:01:04 -0800 Subject: Keyboard: Bpiphany Frosty Flake Refactor, Configurator support and readme cleanup (#4648) * Frosty Flake: layout macro refactor - frosty_flake.h updated to use #pragma once - KEYMAP renamed to LAYOUT - KEYMAP_TKL renamed to LAYOUT_tkl * Frosty Flake: keymap refactor - config.h files updated to #pragma once - deleted deprecated build script rules from rules.mk - keymap.c files: - #include QMK_KEYBOARD_H - updated layout macro name - white space changes for readability * Frosty Flake: Configurator support * Frosty Flake: readme cleanup - Fixed Hardware Availability link (old link was 404) - tiny grammar fix (colon missing on compile-and-flash instructions) --- keyboards/bpiphany/frosty_flake/frosty_flake.h | 10 +- keyboards/bpiphany/frosty_flake/info.json | 301 +++++++++++++++++++++ .../bpiphany/frosty_flake/keymaps/QFR_JM/config.h | 11 +- .../bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c | 31 +-- .../bpiphany/frosty_flake/keymaps/default/config.h | 7 +- .../bpiphany/frosty_flake/keymaps/default/keymap.c | 19 +- .../bpiphany/frosty_flake/keymaps/default/rules.mk | 8 +- .../bpiphany/frosty_flake/keymaps/nikchi/config.h | 11 +- .../bpiphany/frosty_flake/keymaps/nikchi/keymap.c | 65 +++-- .../bpiphany/frosty_flake/keymaps/nikchi/rules.mk | 8 +- .../bpiphany/frosty_flake/keymaps/tkl/config.h | 7 +- .../bpiphany/frosty_flake/keymaps/tkl/keymap.c | 4 +- keyboards/bpiphany/frosty_flake/readme.md | 4 +- 13 files changed, 372 insertions(+), 114 deletions(-) create mode 100644 keyboards/bpiphany/frosty_flake/info.json diff --git a/keyboards/bpiphany/frosty_flake/frosty_flake.h b/keyboards/bpiphany/frosty_flake/frosty_flake.h index 953172a8b0..8242873963 100644 --- a/keyboards/bpiphany/frosty_flake/frosty_flake.h +++ b/keyboards/bpiphany/frosty_flake/frosty_flake.h @@ -1,5 +1,4 @@ -#ifndef FROSTY_FLAKE_H -#define FROSTY_FLAKE_H +#pragma once #include "quantum.h" @@ -26,7 +25,7 @@ | A4 | P2 | C6 | K6 | C0 | M3 | D0 | A1 | | O0 | K0 | L0 | | L6 | Q6 | | `-------------------------------------------------------------------------' `--------------' `-------------------' */ -#define KEYMAP( \ +#define LAYOUT( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, KK1, KL1, KQ1, KQ0, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, KK5, KL5, KQ5, KO5, \ @@ -66,7 +65,7 @@ `-------------------------------------------------------------------------' `--------------' */ -#define KEYMAP_TKL( \ +#define LAYOUT_tkl( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ @@ -94,7 +93,7 @@ KI2, KJ3, KI3, KH3, KG3, KG6, KF6, KF3, KE3, KD3, KR3, KR6, KB1, \ KN2, KJ1, KI1, KH1, KG1, KG0, KF0, KF1, KE1, KD1, KR0, KN3, KO6, \ KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ -) KEYMAP_TKL( \ +) LAYOUT_tkl( \ KJ6, KI4, KH4, KH2, KH6, KA7, KE6, KD2, KD4, KB4, KB7, KB6, KB0, KC7, KC5, KA5, \ KJ4, KJ7, KI7, KH7, KG7, KG4, KF4, KF7, KE7, KD7, KR7, KR4, KE4, KB2, KL4, KO4, KQ4, \ KJ2, KJ5, KI5, KH5, KG5, KG2, KF2, KF5, KE5, KD5, KR5, KR2, KE2, KB3, KK4, KO7, KQ7, \ @@ -103,4 +102,3 @@ KA4, KP2, KC6, KK6, KC0, KM3, KD0, KA1, KO0, KK0, KL0 \ ) -#endif diff --git a/keyboards/bpiphany/frosty_flake/info.json b/keyboards/bpiphany/frosty_flake/info.json new file mode 100644 index 0000000000..15fb23d737 --- /dev/null +++ b/keyboards/bpiphany/frosty_flake/info.json @@ -0,0 +1,301 @@ +{ + "keyboard_name": "Frosty Flake", + "url": "", + "maintainer": "qmk", + "width": 22.5, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Num Lock", "x":18.5, "y":1.5}, + {"label":"/", "x":19.5, "y":1.5}, + {"label":"*", "x":20.5, "y":1.5}, + {"label":"-", "x":21.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"7", "x":18.5, "y":2.5}, + {"label":"8", "x":19.5, "y":2.5}, + {"label":"9", "x":20.5, "y":2.5}, + {"label":"+", "x":21.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":18.5, "y":3.5}, + {"label":"5", "x":19.5, "y":3.5}, + {"label":"6", "x":20.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"1", "x":18.5, "y":4.5}, + {"label":"2", "x":19.5, "y":4.5}, + {"label":"3", "x":20.5, "y":4.5}, + {"label":"Enter", "x":21.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5}, + {"label":"0", "x":18.5, "y":5.5, "w":2}, + {"label":".", "x":20.5, "y":5.5} + ] + }, + "LAYOUT_tkl": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h index b25194014b..017ead4255 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/config.h @@ -1,11 +1,4 @@ - -#define TAPPING_TERM 150 //reduce time required to register a held key - -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif +#define TAPPING_TERM 150 //reduce time required to register a held key diff --git a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c index 81899396af..684987e362 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/QFR_JM/keymap.c @@ -1,9 +1,4 @@ -#include "frosty_flake.h" -#include "action_layer.h" -#ifdef AUDIO_ENABLE - #include "audio.h" -#endif -#include "eeconfig.h" +#include QMK_KEYBOARD_H enum QFR_layers { _COLEMAK, @@ -27,7 +22,7 @@ enum custom_macros { }; const uint16_t PROGMEM fn_actions[] = { //ACTION_LAYER_TAP_TOGGLE requires that number of taps be defined in *config.h* - default set to 5 - [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, + [0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC), //Hold for momentary Lower layer, Tap for Space, [1] = ACTION_LAYER_MOMENTARY(_MOUSE) //Hold for momentary MOUSE }; @@ -37,12 +32,8 @@ enum custom_macros { #define PIPE M(R_PIPE) #define POINT M(R_POINT) -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_COLEMAK] = KEYMAP_TKL(\ +[_COLEMAK] = LAYOUT_tkl(\ 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_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_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC,KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ @@ -51,25 +42,25 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LCTL,KC_LGUI, KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT ), -[_QWERTY] = KEYMAP_TKL(\ +[_QWERTY] = LAYOUT_tkl(\ 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_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, SPC_LW, MSE, KC_RGUI , KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI , KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), -[_DVORAK] = KEYMAP_TKL(\ +[_DVORAK] = LAYOUT_tkl(\ 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_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_QUOT,KC_COMM,KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_LBRC, KC_RBRC, KC_BSLS, KC_DEL, KC_END, KC_PGDN, \ KC_BSPC,KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_QUOT, KC_ENT, \ KC_LSFT,KC_NUBS,KC_SCLN,KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ - KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + KC_LCTL,KC_LGUI,KC_LALT, SPC_LW, MSE, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), -[_LOWER] = KEYMAP_TKL(\ +[_LOWER] = LAYOUT_tkl(\ RESET, _______, _______, _______, _______, KC_MPLY, KC_MSTP, KC_MPRV, KC_MNXT, _______, KC_MUTE, KC_VOLD, KC_VOLU, QWERTY, COLEMAK,DVORAK, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_UNDS, KC_PLUS, KC_BSPC, _______,_______,_______, \ KC_TAB, KC_PGUP, KC_HOME, KC_UP, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LCBR, KC_RCBR, KC_PIPE, _______,_______,_______, \ @@ -78,7 +69,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, _______, _______, KC_RALT, _______, _______, _______, _______,_______,_______ \ ), -[_MOUSE] = KEYMAP_TKL(\ +[_MOUSE] = LAYOUT_tkl(\ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,_______,_______, \ 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_DEL, _______,_______,_______, \ KC_TAB, KC_WH_U, KC_WH_L, KC_MS_U, KC_WH_R, XXXXXXX, XXXXXXX, KC_BTN3, KC_BTN4, KC_BTN5, XXXXXXX, KC_LBRC, KC_RBRC, KC_BSLS, _______,_______,_______, \ @@ -106,7 +97,7 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { } return MACRO_NONE; } - + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { case QWERTY: @@ -126,7 +117,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { set_single_persistent_default_layer(_DVORAK); } return false; - break; + break; } return true; } \ No newline at end of file diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/config.h b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c index 4dc7ed655f..9d40d4c9cc 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/keymap.c @@ -1,11 +1,12 @@ -#include "frosty_flake.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - 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_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_PPLS, \ - 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_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_P1, KC_P2, KC_P3,KC_PENT, \ - KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT) -}; \ No newline at end of file + [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_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_PPLS, \ + 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_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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_APP, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ) +}; diff --git a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk index 93f927c7d0..5dcea84672 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/default/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 = no # Virtual DIP switch configuration(+1000) @@ -13,9 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h index 3f78526437..4bc6d2c3c0 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/config.h @@ -1,8 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once +// place overrides here #define TAPPING_TERM 200 #define LEADER_TIMEOUT 800 @@ -17,7 +15,4 @@ #define MOUSEKEY_DELAY 0 #define MOUSEKEY_TIME_TO_MAX 60 #define MOUSEKEY_MAX_SPEED 7 -#define MOUSEKEY_WHEEL_DELAY 0 -// place overrides here - -#endif +#define MOUSEKEY_WHEEL_DELAY 0 diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c index bf7c5e5883..dd2098d945 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/keymap.c @@ -1,11 +1,5 @@ -#include "frosty_flake.h" -#include "action_layer.h" -#include "eeconfig.h" -#include "process_unicode.h" -#include "process_unicodemap.h" -#include "quantum.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H + #define MAXEMOJITAPS 80 @@ -33,16 +27,16 @@ enum taps{ ALLS }; -enum unicode_name { +enum unicode_name { EMOTIS = 1,//80, //1F60x - 1F64x ANIMALS, //64, //1F40x - 1F43x SYMBOLS,// = 45, //1F300 - 1F32C - FOODS,// = 87 , //1F32D - + FOODS,// = 87 , //1F32D - ETC,// = 192, //1F44x -1F4Fx VEHICLES,// = 83, //1F68x - 1F6Dx SUPPLEMENT,// = 32, //1F91x-1F92x ALCHEMY,// = 116 //1F70x - 1F773 - + }; enum my_macros { @@ -102,7 +96,7 @@ const uint32_t PROGMEM unicode_map[] = { [EMOTIS] = 0x1F600, [ANIMALS] = 0x1F400, [SYMBOLS] = 0x1F300, - [FOODS] = 0x1F32D, + [FOODS] = 0x1F32D, [ETC] = 0x1F440, [VEHICLES] = 0x1F680, [SUPPLEMENT] = 0x1F910, @@ -110,27 +104,30 @@ const uint32_t PROGMEM unicode_map[] = { }; // Layouts const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP(\ - 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_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_PPLS, \ - KC_LCTL, 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_LSPO,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3,KC_PENT, \ - TD(TD_CTCPS),KC_LGUI,KC_LALT, KC_SPC, KC_LEAD,KC_RGUI, KC_APP,MO(1) , KC_LEFT,KC_DOWN,KC_RGHT, KC_P0,KC_PDOT), -[1] = KEYMAP(\ - TD(ALLS), 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_GRV, TD(EMOJIS),TD(ANIMAL),TD(ETC),TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,KC_MINS, KC_EQL,KC_BSPC, KC_MPRV,KC_MPLY,KC_MNXT, KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS, \ - KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP ,KC_RBRC,KC_BSLS, KC_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L,KC_LEFT,KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ - KC_LSFT,KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M,KC_COMM, KC_DOT,KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2),_______ , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), -[2] = KEYMAP(\ - 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_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_MPRV,KC_MPLY,KC_MNXT, 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_MUTE,KC_VOLD,KC_VOLU, KC_P7, KC_P8, KC_P9,KC_PPLS, \ - KC_LCTL, KC_D, 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_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_MS_U, KC_P1, KC_P2, KC_P3,KC_PENT, \ - KC_BTN1,KC_BTN3,KC_BTN2, KC_SPC, KC_RALT,KC_RGUI, TG(2) , KC_NO , KC_MS_L,KC_MS_D,KC_MS_R, KC_P0,KC_PDOT), + [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_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_PPLS, \ + KC_LCTL, 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_LSPO, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + TD(TD_CTCPS), KC_LGUI, KC_LALT, KC_SPC, KC_LEAD, KC_RGUI, KC_APP, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ + ), + [1] = LAYOUT(\ + TD(ALLS), 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_GRV, TD(EMOJIS), TD(ANIMAL), TD(ETC), TD(FOODS), KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSPC, KC_MPRV, KC_MPLY, KC_MNXT, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, \ + KC_TAB, KC_Q, M(0), KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_UP, KC_RBRC, KC_BSLS, KC_MUTE, KC_VOLD, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, M(1), M(3), M(2), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_LEFT, KC_RGHT, KC_ENT, KC_P4, KC_P5, KC_P6, \ + KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_DOWN, KC_RSFT, KC_MS_U, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_BTN1, KC_BTN3, KC_BTN2, KC_SPC, KC_RALT, KC_RGUI, TG(2), _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_P0, KC_PDOT \ + ), + [2] = 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_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_MPRV, KC_MPLY, KC_MNXT, 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_MUTE, KC_VOLD, KC_VOLU, KC_P7, KC_P8, KC_P9, KC_PPLS, \ + KC_LCTL, KC_D, 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_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_MS_U, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_BTN1, KC_BTN3, KC_BTN2, KC_SPC, KC_RALT, KC_RGUI, TG(2), KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_P0, KC_PDOT \ + ), }; LEADER_EXTERNS(); @@ -183,7 +180,7 @@ void cycleEmojis(qk_tap_dance_state_t *state, void *user_data) { } }; -void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { +void cycleAnimals(qk_tap_dance_state_t *state, void *user_data) { if(state->count == 1) { unicode_input_start(); register_hex32(pgm_read_dword(&unicode_map[ANIMALS])); diff --git a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk index fc5761c053..de0f30e48e 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk +++ b/keyboards/bpiphany/frosty_flake/keymaps/nikchi/rules.mk @@ -12,13 +12,9 @@ BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode -UNICODEMAP_ENABLE = yes # unicodemap +UNICODEMAP_ENABLE = yes # unicodemap BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend TAP_DANCE_ENABLE = yes LEADER_ENABLE = yes - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h index 8893d122e0..271f48d001 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/config.h @@ -1,8 +1,3 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once // place overrides here - -#endif diff --git a/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c index 99dc95627e..8e87239719 100644 --- a/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c +++ b/keyboards/bpiphany/frosty_flake/keymaps/tkl/keymap.c @@ -1,7 +1,7 @@ -#include "frosty_flake.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP_TKL(\ +[0] = LAYOUT_tkl(\ 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_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, \ diff --git a/keyboards/bpiphany/frosty_flake/readme.md b/keyboards/bpiphany/frosty_flake/readme.md index 0d6a4779f6..5917022a88 100644 --- a/keyboards/bpiphany/frosty_flake/readme.md +++ b/keyboards/bpiphany/frosty_flake/readme.md @@ -18,7 +18,7 @@ keymaps `default` (104) and `tkl` (87) for example layouts. Keyboard Maintainer: QMK Community Hardware Supported: Frosty Flake -Hardware Availability: https://1upkeyboards.com/qfr-frosty-flake-controller.html +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/qfr-frosty-flake-controller/) Make example for this keyboard (after setting up your build environment): @@ -28,7 +28,7 @@ Make example for this keyboard (after setting up your build environment): make bpiphany/frosty_flake:default ``` -To directly flash the frosty_flake after compiling use +To directly flash the frosty_flake after compiling use: ``` make bpiphany/frosty_flake:default:dfu -- cgit v1.2.3 From cb149650efd07cbdc3cacb1fe2eb58f17eee5965 Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 14 Dec 2018 21:29:30 +0000 Subject: Keyboard: Lets split eh default keymap - Fixes for superseded default layer functionality (#4581) * Fixes for superseded default layer functionality * Fixes for superseded default layer functionality --- keyboards/lets_split_eh/keymaps/default/config.h | 7 +-- keyboards/lets_split_eh/keymaps/default/keymap.c | 68 ++++-------------------- keyboards/lets_split_eh/keymaps/default/rules.mk | 3 -- 3 files changed, 12 insertions(+), 66 deletions(-) diff --git a/keyboards/lets_split_eh/keymaps/default/config.h b/keyboards/lets_split_eh/keymaps/default/config.h index a1df337bd9..c535299e74 100644 --- a/keyboards/lets_split_eh/keymaps/default/config.h +++ b/keyboards/lets_split_eh/keymaps/default/config.h @@ -18,9 +18,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once -#include "../../config.h" - -#endif \ No newline at end of file + // place overrides here diff --git a/keyboards/lets_split_eh/keymaps/default/keymap.c b/keyboards/lets_split_eh/keymaps/default/keymap.c index 8ef9735749..1983459f68 100644 --- a/keyboards/lets_split_eh/keymaps/default/keymap.c +++ b/keyboards/lets_split_eh/keymaps/default/keymap.c @@ -1,30 +1,19 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" -#include "eeconfig.h" - -extern keymap_config_t keymap_config; // 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 _QWERTY 0 - #define _LOWER 3 #define _RAISE 4 #define _FUNCTION 15 #define _ADJUST 16 -enum custom_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, - ADJUST -}; - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) +#define FUNCTION MO(_FUNCTION) +#define ADJUST MO(_ADJUST) // Defines for task manager and such #define CALTDEL LCTL(LALT(KC_DEL)) @@ -45,7 +34,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT( \ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ - MO(_FUNCTION), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ + FUNCTION, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT, \ OSM(MOD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_QUOT, \ KC_LCTL, KC_GRV, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), @@ -90,7 +79,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ,-----------------------------------------------------------------------------------. * |Taskmg| | | | | | | |RGBVAI|RGBSAI|RGBHUI|caltde| * |------+------+------+------+------+-------------+------+------+------+------+------| - * | | | | | | | |Qwerty|RGBVAD|RGBSAD|RGBHUD|RGBTOG| + * | | | | | | | | |RGBVAD|RGBSAD|RGBHUD|RGBTOG| * |------+------+------+------+------+------|------+------+------+------+------+------| * | | | | | | | | | | | |BLSTEP| * |------+------+------+------+------+------+------+------+------+------+------+------| @@ -99,7 +88,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_ADJUST] = LAYOUT( \ TSKMGR, _______, _______, _______, _______, _______, _______, _______, RGB_VAI, RGB_SAI, RGB_HUI, CALTDEL, \ - _______, _______, _______, _______, _______, _______, _______, QWERTY, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ + _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_SAD, RGB_HUD, RGB_TOG, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, BL_STEP, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET \ ), @@ -124,47 +113,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST); } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - } - return false; - break; - case LOWER: - if (record->event.pressed) { - layer_on(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_LOWER); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case RAISE: - if (record->event.pressed) { - layer_on(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } else { - layer_off(_RAISE); - update_tri_layer(_LOWER, _RAISE, _ADJUST); - } - return false; - break; - case ADJUST: - if (record->event.pressed) { - layer_on(_ADJUST); - } else { - layer_off(_ADJUST); - } - return false; - break; - } return true; -} \ No newline at end of file +} diff --git a/keyboards/lets_split_eh/keymaps/default/rules.mk b/keyboards/lets_split_eh/keymaps/default/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/lets_split_eh/keymaps/default/rules.mk +++ b/keyboards/lets_split_eh/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif -- cgit v1.2.3 From bb5262de0790ed3f4f91de20fad6e13fc0ffddc5 Mon Sep 17 00:00:00 2001 From: zvecr Date: Fri, 14 Dec 2018 22:25:32 +0000 Subject: Keyboard: Refactor fourier to use split common code (#4582) * Refactor fourier to use split common code * Refactor fourier to use split common code - fix handedness when not using EE_HANDS or MASTER_LEFT * add SOFT_SERIAL_PIN config --- keyboards/fourier/config.h | 9 +- keyboards/fourier/fourier.h | 8 +- keyboards/fourier/i2c.c | 162 ---------- keyboards/fourier/i2c.h | 49 --- keyboards/fourier/keymaps/default/config.h | 8 +- keyboards/fourier/keymaps/default/keymap.c | 4 - keyboards/fourier/keymaps/default/rules.mk | 3 - keyboards/fourier/matrix.c | 467 ----------------------------- keyboards/fourier/rev1/config.h | 14 +- keyboards/fourier/rev1/rev1.c | 2 - keyboards/fourier/rev1/rev1.h | 17 +- keyboards/fourier/rules.mk | 14 +- keyboards/fourier/serial.c | 228 -------------- keyboards/fourier/serial.h | 26 -- keyboards/fourier/split_util.c | 80 ----- keyboards/fourier/split_util.h | 20 -- 16 files changed, 17 insertions(+), 1094 deletions(-) delete mode 100644 keyboards/fourier/i2c.c delete mode 100644 keyboards/fourier/i2c.h delete mode 100644 keyboards/fourier/matrix.c delete mode 100644 keyboards/fourier/serial.c delete mode 100644 keyboards/fourier/serial.h delete mode 100644 keyboards/fourier/split_util.c delete mode 100644 keyboards/fourier/split_util.h diff --git a/keyboards/fourier/config.h b/keyboards/fourier/config.h index 8f0524f972..cfb6bf4ffc 100644 --- a/keyboards/fourier/config.h +++ b/keyboards/fourier/config.h @@ -16,13 +16,6 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_H -#define CONFIG_H +#pragma once #include "config_common.h" - -#ifdef SUBPROJECT_rev1 - #include "rev1/config.h" -#endif - -#endif diff --git a/keyboards/fourier/fourier.h b/keyboards/fourier/fourier.h index 4e9797b35b..1b4585c821 100644 --- a/keyboards/fourier/fourier.h +++ b/keyboards/fourier/fourier.h @@ -1,12 +1,11 @@ -#ifndef FOURIER_H -#define FOURIER_H - -#include "quantum.h" +#pragma once #ifdef KEYBOARD_fourier_rev1 #include "rev1.h" #endif +#include "quantum.h" + // Used to create a keymap using only KC_ prefixed keys #define LAYOUT_kc( \ LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ @@ -20,4 +19,3 @@ KC_##LC1, KC_##LC2, KC_##LC3, KC_##LC4, KC_##LC5, KC_##LC6, KC_##RC1, KC_##RC3, KC_##RC4, KC_##RC5, KC_##RC6, KC_##RC7, \ KC_##LD1, KC_##LD2, KC_##LD3, KC_##LD4, KC_##LD5, KC_##RD1, KC_##RD4, KC_##RD5, KC_##RD6, KC_##RD7 \ ) -#endif diff --git a/keyboards/fourier/i2c.c b/keyboards/fourier/i2c.c deleted file mode 100644 index 084c890c40..0000000000 --- a/keyboards/fourier/i2c.c +++ /dev/null @@ -1,162 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "i2c.h" - -#ifdef USE_I2C - -// Limits the amount of we wait for any one i2c transaction. -// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is -// 9 bits, a single transaction will take around 90μs to complete. -// -// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit -// poll loop takes at least 8 clock cycles to execute -#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 - -#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) - -volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -static volatile uint8_t slave_buffer_pos; -static volatile bool slave_has_register_set = false; - -// Wait for an i2c operation to finish -inline static -void i2c_delay(void) { - uint16_t lim = 0; - while(!(TWCR & (1<10. - // Check datasheets for more info. - TWBR = ((F_CPU/SCL_CLOCK)-16)/2; -} - -// Start a transaction with the given i2c slave address. The direction of the -// transfer is set with I2C_READ and I2C_WRITE. -// returns: 0 => success -// 1 => error -uint8_t i2c_master_start(uint8_t address) { - TWCR = (1< slave ACK -// 1 => slave NACK -uint8_t i2c_master_write(uint8_t data) { - TWDR = data; - TWCR = (1<= SLAVE_BUFFER_SIZE ) { - ack = 0; - slave_buffer_pos = 0; - } - slave_has_register_set = true; - } else { - i2c_slave_buffer[slave_buffer_pos] = TWDR; - BUFFER_POS_INC(); - } - break; - - case TW_ST_SLA_ACK: - case TW_ST_DATA_ACK: - // master has addressed this device as a slave transmitter and is - // requesting data. - TWDR = i2c_slave_buffer[slave_buffer_pos]; - BUFFER_POS_INC(); - break; - - case TW_BUS_ERROR: // something went wrong, reset twi state - TWCR = 0; - default: - break; - } - // Reset everything, so we are ready for the next TWI interrupt - TWCR |= (1< - -#ifndef F_CPU -#define F_CPU 16000000UL -#endif - -#define I2C_READ 1 -#define I2C_WRITE 0 - -#define I2C_ACK 1 -#define I2C_NACK 0 - -#define SLAVE_BUFFER_SIZE 0x10 - -// i2c SCL clock frequency -#define SCL_CLOCK 400000L - -extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; - -void i2c_master_init(void); -uint8_t i2c_master_start(uint8_t address); -void i2c_master_stop(void); -uint8_t i2c_master_write(uint8_t data); -uint8_t i2c_master_read(int); -void i2c_reset_state(void); -void i2c_slave_init(uint8_t address); - - -static inline unsigned char i2c_start_read(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_READ); -} - -static inline unsigned char i2c_start_write(unsigned char addr) { - return i2c_master_start((addr << 1) | I2C_WRITE); -} - -// from SSD1306 scrips -extern unsigned char i2c_rep_start(unsigned char addr); -extern void i2c_start_wait(unsigned char addr); -extern unsigned char i2c_readAck(void); -extern unsigned char i2c_readNak(void); -extern unsigned char i2c_read(unsigned char ack); - -#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); - -#endif diff --git a/keyboards/fourier/keymaps/default/config.h b/keyboards/fourier/keymaps/default/config.h index 20e49c4219..18f4c1f7ac 100644 --- a/keyboards/fourier/keymaps/default/config.h +++ b/keyboards/fourier/keymaps/default/config.h @@ -18,14 +18,8 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "config_common.h" +#pragma once /* Use I2C or Serial, not both */ - #define USE_SERIAL // #define USE_I2C - -#endif diff --git a/keyboards/fourier/keymaps/default/keymap.c b/keyboards/fourier/keymaps/default/keymap.c index 9c20137768..a08f27b7ce 100644 --- a/keyboards/fourier/keymaps/default/keymap.c +++ b/keyboards/fourier/keymaps/default/keymap.c @@ -1,7 +1,5 @@ #include QMK_KEYBOARD_H -extern keymap_config_t keymap_config; - // 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 @@ -14,8 +12,6 @@ enum custom_keycodes { QWERTY = SAFE_RANGE, }; -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define KC_FN1 MO(_FN1) #define KC_FN2 MO(_FN2) #define KC_SPFN1 LT(_FN1, KC_SPACE) diff --git a/keyboards/fourier/keymaps/default/rules.mk b/keyboards/fourier/keymaps/default/rules.mk index 457a3d01d4..e69de29bb2 100644 --- a/keyboards/fourier/keymaps/default/rules.mk +++ b/keyboards/fourier/keymaps/default/rules.mk @@ -1,3 +0,0 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/fourier/matrix.c b/keyboards/fourier/matrix.c deleted file mode 100644 index fdeead7dc7..0000000000 --- a/keyboards/fourier/matrix.c +++ /dev/null @@ -1,467 +0,0 @@ -/* -Copyright 2012 Jun Wako - -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 . -*/ - -/* - * scan matrix - */ -#include -#include -#include -#include "wait.h" -#include "print.h" -#include "debug.h" -#include "util.h" -#include "matrix.h" -#include "split_util.h" -#include "pro_micro.h" -#include "config.h" -#include "timer.h" -#include "backlight.h" - -#ifdef USE_I2C -# include "i2c.h" -#else // USE_SERIAL -# include "serial.h" -#endif - -#ifndef DEBOUNCING_DELAY -# define DEBOUNCING_DELAY 5 -#endif - -#if (DEBOUNCING_DELAY > 0) - static uint16_t debouncing_time; - static bool debouncing = false; -#endif - -#if (MATRIX_COLS <= 8) -# define print_matrix_header() print("\nr/c 01234567\n") -# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) -# define matrix_bitpop(i) bitpop(matrix[i]) -# define ROW_SHIFTER ((uint8_t)1) -#else -# error "Currently only supports 8 COLS" -#endif -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#define ERROR_DISCONNECT_COUNT 5 - -#define SERIAL_LED_ADDR 0x00 - -#define ROWS_PER_HAND (MATRIX_ROWS/2) - -static uint8_t error_count = 0; - -static const uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static const uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; - -/* matrix state(1:on, 0:off) */ -static matrix_row_t matrix[MATRIX_ROWS]; -static matrix_row_t matrix_debouncing[MATRIX_ROWS]; - -#if (DIODE_DIRECTION == COL2ROW) - static void init_cols(void); - static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row); - static void unselect_rows(void); - static void select_row(uint8_t row); - static void unselect_row(uint8_t row); -#elif (DIODE_DIRECTION == ROW2COL) - static void init_rows(void); - static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col); - static void unselect_cols(void); - static void unselect_col(uint8_t col); - static void select_col(uint8_t col); -#endif - -__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) { -} - -inline -uint8_t matrix_rows(void) -{ - return MATRIX_ROWS; -} - -inline -uint8_t matrix_cols(void) -{ - return MATRIX_COLS; -} - -void matrix_init(void) -{ - debug_enable = true; - debug_matrix = true; - debug_mouse = true; - // initialize row and col - unselect_rows(); - init_cols(); - - TX_RX_LED_INIT; - - // 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) -{ - int offset = isLeftHand ? 0 : (ROWS_PER_HAND); -#if (DIODE_DIRECTION == COL2ROW) - // Set row, read cols - for (uint8_t current_row = 0; current_row < ROWS_PER_HAND; current_row++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_cols_on_row(matrix_debouncing+offset, current_row); - - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } - -# else - read_cols_on_row(matrix+offset, current_row); -# endif - - } - -#elif (DIODE_DIRECTION == ROW2COL) - // Set col, read rows - for (uint8_t current_col = 0; current_col < MATRIX_COLS; current_col++) { -# if (DEBOUNCING_DELAY > 0) - bool matrix_changed = read_rows_on_col(matrix_debouncing+offset, current_col); - if (matrix_changed) { - debouncing = true; - debouncing_time = timer_read(); - } -# else - read_rows_on_col(matrix+offset, current_col); -# endif - - } -#endif - -# if (DEBOUNCING_DELAY > 0) - if (debouncing && (timer_elapsed(debouncing_time) > DEBOUNCING_DELAY)) { - for (uint8_t i = 0; i < ROWS_PER_HAND; i++) { - matrix[i+offset] = matrix_debouncing[i+offset]; - } - debouncing = false; - } -# endif - - return 1; -} - -#ifdef USE_I2C - -// Get rows from other half over i2c -int i2c_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - int err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_WRITE); - if (err) goto i2c_error; - - // start of matrix stored at 0x00 - err = i2c_master_write(0x00); - if (err) goto i2c_error; - - // Start read - err = i2c_master_start(SLAVE_I2C_ADDRESS + I2C_READ); - if (err) goto i2c_error; - - if (!err) { - int i; - for (i = 0; i < ROWS_PER_HAND-1; ++i) { - matrix[slaveOffset+i] = i2c_master_read(I2C_ACK); - } - matrix[slaveOffset+i] = i2c_master_read(I2C_NACK); - i2c_master_stop(); - } else { -i2c_error: // the cable is disconnceted, or something else went wrong - i2c_reset_state(); - return err; - } - - return 0; -} - -#else // USE_SERIAL - -int serial_transaction(void) { - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - - if (serial_update_buffers()) { - return 1; - } - - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; - } - -#ifdef BACKLIGHT_ENABLE - // Write backlight level for slave to read - serial_master_buffer[SERIAL_LED_ADDR] = get_backlight_level(); -#endif - return 0; -} -#endif - -uint8_t matrix_scan(void) -{ - uint8_t ret = _matrix_scan(); - -#ifdef USE_I2C - if( i2c_transaction() ) { -#else // USE_SERIAL - if( serial_transaction() ) { -#endif - // turn on the indicator led when halves are disconnected - TXLED1; - - error_count++; - - if (error_count > ERROR_DISCONNECT_COUNT) { - // reset other half if disconnected - int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = 0; - } - } - } else { - // turn off the indicator led on no error - TXLED0; - error_count = 0; - } - matrix_scan_quantum(); - return ret; -} - -void matrix_slave_scan(void) { - _matrix_scan(); - - int offset = (isLeftHand) ? 0 : ROWS_PER_HAND; - -#ifdef USE_I2C - for (int i = 0; i < ROWS_PER_HAND; ++i) { - i2c_slave_buffer[i] = matrix[offset+i]; - } -#else // USE_SERIAL - for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; - } - -#ifdef BACKLIGHT_ENABLE - // Read backlight level sent from master and update level on slave - backlight_set(serial_master_buffer[SERIAL_LED_ADDR]); -#endif -#endif -} - -bool matrix_is_modified(void) -{ - if (debouncing) return false; - return true; -} - -inline -bool matrix_is_on(uint8_t row, uint8_t col) -{ - return (matrix[row] & ((matrix_row_t)1<> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) -{ - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[current_row]; - - // Clear data in matrix row - current_matrix[current_row] = 0; - - // Select row and wait for row selecton to stabilize - select_row(current_row); - wait_us(30); - - // For each col... - for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); - } - - // Unselect row - unselect_row(current_row); - - return (last_row_value != current_matrix[current_row]); -} - -static void select_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_row(uint8_t row) -{ - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#elif (DIODE_DIRECTION == ROW2COL) - -static void init_rows(void) -{ - for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) -{ - bool matrix_changed = false; - - // Select col and wait for col selecton to stabilize - select_col(current_col); - wait_us(30); - - // For each row... - for(uint8_t row_index = 0; row_index < ROWS_PER_HAND; row_index++) - { - - // Store last value of row prior to reading - matrix_row_t last_row_value = current_matrix[row_index]; - - // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) - { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); - } - else - { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); - } - - // Determine if the matrix changed state - if ((last_row_value != current_matrix[row_index]) && !(matrix_changed)) - { - matrix_changed = true; - } - } - - // Unselect col - unselect_col(current_col); - - return matrix_changed; -} - -static void select_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW -} - -static void unselect_col(uint8_t col) -{ - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI -} - -static void unselect_cols(void) -{ - for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI - } -} - -#endif diff --git a/keyboards/fourier/rev1/config.h b/keyboards/fourier/rev1/config.h index 3bd67228c3..d9913d7dee 100644 --- a/keyboards/fourier/rev1/config.h +++ b/keyboards/fourier/rev1/config.h @@ -16,10 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#ifndef REV1_CONFIG_H -#define REV1_CONFIG_H - -#include "../config.h" +#pragma once /* USB Device descriptor parameter */ #define VENDOR_ID 0xCB10 @@ -38,6 +35,11 @@ along with this program. If not, see . #define MATRIX_ROW_PINS { F4, D7, E6, B4 } #define MATRIX_COL_PINS { F5, F6, F7, B1, B3, B2, B6 } +/* Split Defines */ +#define SPLIT_HAND_PIN D2 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* define if matrix has ghost */ //#define MATRIX_HAS_GHOST @@ -56,7 +58,6 @@ along with this program. If not, see . /* ws2812 RGB LED */ #define RGB_DI_PIN D3 - #define RGBLIGHT_ANIMATIONS #define RGBLED_NUM 14 // Number of LEDs @@ -77,6 +78,3 @@ along with this program. If not, see . //#define NO_ACTION_ONESHOT //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION - - -#endif diff --git a/keyboards/fourier/rev1/rev1.c b/keyboards/fourier/rev1/rev1.c index 61d7139d6c..1e662e7b8d 100644 --- a/keyboards/fourier/rev1/rev1.c +++ b/keyboards/fourier/rev1/rev1.c @@ -1,7 +1,5 @@ #include "fourier.h" - void matrix_init_kb(void) { matrix_init_user(); }; - diff --git a/keyboards/fourier/rev1/rev1.h b/keyboards/fourier/rev1/rev1.h index 9ef9b92330..ac889462b3 100644 --- a/keyboards/fourier/rev1/rev1.h +++ b/keyboards/fourier/rev1/rev1.h @@ -1,19 +1,8 @@ -#ifndef REV1_H -#define REV1_H - -#include "../fourier.h" +#pragma once +#include "fourier.h" #include "quantum.h" - -#ifdef USE_I2C -#include -#ifdef __AVR__ - #include - #include -#endif -#endif - #define LAYOUT( \ LA1, LA2, LA3, LA4, LA5, LA6, RA1, RA2, RA3, RA4, RA5, RA6, RA7, \ LB1, LB2, LB3, LB4, LB5, LB6, RB1, RB2, RB3, RB4, RB5, RB7, \ @@ -30,5 +19,3 @@ { RC1, KC_NO, RC3, RC4, RC5, RC6, RC7}, \ { RD1, KC_NO, KC_NO, RD4, RD5, RD6, RD7} \ } - -#endif diff --git a/keyboards/fourier/rules.mk b/keyboards/fourier/rules.mk index 9ec05e8740..93935e02eb 100644 --- a/keyboards/fourier/rules.mk +++ b/keyboards/fourier/rules.mk @@ -1,10 +1,4 @@ -SRC += matrix.c \ - i2c.c \ - split_util.c \ - serial.c - # MCU name -#MCU = at90usb1287 MCU = atmega32u4 # Processor frequency. @@ -41,7 +35,7 @@ F_USB = $(F_CPU) # 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 +# different sizes, comment this out, and the correct address will be loaded # automatically (+60). See bootloader.mk for all options. BOOTLOADER = caterina @@ -63,12 +57,12 @@ MIDI_ENABLE = no # MIDI controls 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 = yes # Enable WS2812 RGB underlight. +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. SUBPROJECT_rev1 = yes -USE_I2C = yes + # Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -CUSTOM_MATRIX = yes +SPLIT_KEYBOARD = yes DEFAULT_FOLDER = fourier/rev1 diff --git a/keyboards/fourier/serial.c b/keyboards/fourier/serial.c deleted file mode 100644 index 74bcbb6bf6..0000000000 --- a/keyboards/fourier/serial.c +++ /dev/null @@ -1,228 +0,0 @@ -/* - * WARNING: be careful changing this code, it is very timing dependent - */ - -#ifndef F_CPU -#define F_CPU 16000000 -#endif - -#include -#include -#include -#include -#include "serial.h" - -#ifndef USE_I2C - -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 - -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; - -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; - -inline static -void serial_delay(void) { - _delay_us(SERIAL_DELAY); -} - -inline static -void serial_output(void) { - SERIAL_PIN_DDR |= SERIAL_PIN_MASK; -} - -// make the serial pin an input with pull-up resistor -inline static -void serial_input(void) { - SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -inline static -uint8_t serial_read_pin(void) { - return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); -} - -inline static -void serial_low(void) { - SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; -} - -inline static -void serial_high(void) { - SERIAL_PIN_PORT |= SERIAL_PIN_MASK; -} - -void serial_master_init(void) { - serial_output(); - serial_high(); -} - -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); -} - -// Used by the master to synchronize timing with the slave. -static -void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. - while (!serial_read_pin()); - serial_delay(); -} - -// Used by the slave to send a synchronization signal to the master. -static -void sync_send(void) { - serial_output(); - - serial_low(); - serial_delay(); - - serial_high(); -} - -// Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); - } - - return byte; -} - -// Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); - } - serial_delay(); - } -} - -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); - - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); - sync_send(); - checksum += serial_slave_buffer[i]; - } - serial_write_byte(checksum); - sync_send(); - - // wait for the sync to finish sending - serial_delay(); - - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); - - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_send(); - - serial_input(); // end transaction - - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; - } else { - status &= ~SLAVE_DATA_CORRUPT; - } -} - -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; -} - -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. -// -// Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts - cli(); - - // signal to the slave that we want to start a transaction - serial_output(); - serial_low(); - _delay_us(1); - - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); - - // check if the slave is present - if (serial_read_pin()) { - // slave failed to pull the line low, assume not present - sei(); - return 1; - } - - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; - } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - - if (checksum_computed != checksum_received) { - sei(); - return 1; - } - - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; - } - serial_write_byte(checksum); - sync_recv(); - - // always, release the line when not in use - serial_output(); - serial_high(); - - sei(); - return 0; -} - -#endif diff --git a/keyboards/fourier/serial.h b/keyboards/fourier/serial.h deleted file mode 100644 index 15fe4db7b4..0000000000 --- a/keyboards/fourier/serial.h +++ /dev/null @@ -1,26 +0,0 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H - -#include "config.h" -#include - -/* TODO: some defines for interrupt setup */ -#define SERIAL_PIN_DDR DDRD -#define SERIAL_PIN_PORT PORTD -#define SERIAL_PIN_INPUT PIND -#define SERIAL_PIN_MASK _BV(PD0) -#define SERIAL_PIN_INTERRUPT INT0_vect - -#define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -#define SERIAL_MASTER_BUFFER_LENGTH 1 - -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; - -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); - -#endif diff --git a/keyboards/fourier/split_util.c b/keyboards/fourier/split_util.c deleted file mode 100644 index 2704e30e04..0000000000 --- a/keyboards/fourier/split_util.c +++ /dev/null @@ -1,80 +0,0 @@ -#include -#include -#include -#include -#include -#include -#include "split_util.h" -#include "matrix.h" -#include "keyboard.h" -#include "config.h" -#include "timer.h" -#include "pincontrol.h" - -#ifdef USE_I2C -# include "i2c.h" -#else -# include "serial.h" -#endif - -volatile bool isLeftHand = true; - -static void setup_handedness(void) { - // Test D2 pin for handedness, if D2 is grounded, it's the right hand - pinMode(D2, PinDirectionInput); - isLeftHand = digitalRead(D2); -} - -static void keyboard_master_setup(void) { -#ifdef USE_I2C - i2c_master_init(); -#ifdef SSD1306OLED - matrix_master_OLED_init(); -#endif -#else - serial_master_init(); -#endif -} - -static void keyboard_slave_setup(void) { - timer_init(); -#ifdef USE_I2C - i2c_slave_init(SLAVE_I2C_ADDRESS); -#else - serial_slave_init(); -#endif -} - -bool has_usb(void) { - USBCON |= (1 << OTGPADE); //enables VBUS pad - _delay_us(5); - return (USBSTA & (1< -#include "eeconfig.h" - -#define SLAVE_I2C_ADDRESS 0x32 - -extern volatile bool isLeftHand; - -// slave version of matix scan, defined in matrix.c -void matrix_slave_scan(void); - -void split_keyboard_setup(void); -bool has_usb(void); -void keyboard_slave_loop(void); - -void matrix_master_OLED_init (void); - -#endif -- cgit v1.2.3 From 039434caf96c77a8584f03ab2b27ed255e7adae5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 16:38:46 -0800 Subject: Keyboard: Bpiphany Pegasus Hoof Refactor, Configurator support (#4649) * Pegasus Hoof: layout macro refactor - Renamed KEYMAP to LAYOUT - Added LAYOUT_tkl_ansi macro - white space changes (changed tabs for 2 spaces) * Pegasus Hoof: keymap refactor - updated layout macro names - changed to #include QMK_KEYBOARD_H - removed redundant KC_TRNS definitions - white space changes (changed tabs to spaces) - removed deprecated build script instructions from rules.mk files - updated config.h to #pragma once * Pegasus Hoof: Configurator support * Pegasus Hoof: readme cleanup - Reformat header and description paragraph - Fix Hardware Availability link (was 404) - renamed filename to lowercase * Pegasus Hoof: add LAYOUTS = tkl_ansi to rules.mk * Pegasus Hoof: fix LAYOUT_tkl_jis macro --- keyboards/bpiphany/pegasushoof/README.md | 12 -- keyboards/bpiphany/pegasushoof/info.json | 192 +++++++++++++++++++++ .../bpiphany/pegasushoof/keymaps/blowrak/keymap.c | 12 +- .../bpiphany/pegasushoof/keymaps/blowrak/rules.mk | 9 +- .../bpiphany/pegasushoof/keymaps/citadel/config.h | 7 +- .../bpiphany/pegasushoof/keymaps/citadel/keymap.c | 8 +- .../bpiphany/pegasushoof/keymaps/citadel/rules.mk | 7 +- .../bpiphany/pegasushoof/keymaps/default/keymap.c | 64 ++++--- .../bpiphany/pegasushoof/keymaps/default/rules.mk | 9 +- keyboards/bpiphany/pegasushoof/pegasushoof.h | 66 ++++--- keyboards/bpiphany/pegasushoof/readme.md | 13 ++ keyboards/bpiphany/pegasushoof/rules.mk | 3 +- 12 files changed, 292 insertions(+), 110 deletions(-) delete mode 100644 keyboards/bpiphany/pegasushoof/README.md create mode 100644 keyboards/bpiphany/pegasushoof/info.json create mode 100644 keyboards/bpiphany/pegasushoof/readme.md diff --git a/keyboards/bpiphany/pegasushoof/README.md b/keyboards/bpiphany/pegasushoof/README.md deleted file mode 100644 index 1b3d631901..0000000000 --- a/keyboards/bpiphany/pegasushoof/README.md +++ /dev/null @@ -1,12 +0,0 @@ -Pegasus Hoof Controller -=== - -Keyboard Maintainer: QMK Community -Hardware Supported: Pegasus Hoof -Hardware Availability: https://1upkeyboards.com/filco-pegasus-hoof-controller.html - -Make example for this keyboard (after setting up your build environment): - - make bpiphany/pegasus_hoof: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/pegasushoof/info.json b/keyboards/bpiphany/pegasushoof/info.json new file mode 100644 index 0000000000..c4fa28ac46 --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/info.json @@ -0,0 +1,192 @@ +{ + "keyboard_name": "Pegasus Hoof", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Print Screen", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"Page Up", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"Page Down", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"GUI", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c index 6faf4db6fa..7db7e5d39e 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/keymap.c @@ -15,9 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "pegasushoof.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H /* Swedish keys */ #define SE_HALF KC_GRV @@ -44,7 +42,7 @@ along with this program. If not, see . const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Blowrak ISO layer, a Swedish take on Dvorak */ - [KM_BLOWRAK] = KEYMAP( \ + [KM_BLOWRAK] = 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, \ SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,KC_BSPC, KC_INS, KC_HOME,KC_PGUP, \ KC_TAB, SE_AO, SE_AE, SE_OE, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_COMM,SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ @@ -52,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SE_LTGT,KC_DOT, KC_Q, KC_J, KC_K, KC_B, KC_X, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, KC_UP, \ KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), /* Layer 1: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ + [KM_QWERTY] = 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, \ SE_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, SE_PLUS,SE_ACUT,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, SE_AO, SE_CIRC,SE_QUOT, KC_DEL, KC_END, KC_PGDN, \ @@ -60,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, SE_LTGT,KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM,KC_DOT, SE_MINS, KC_RSFT, KC_UP, \ KC_FN0, KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI,KC_MENU,KC_FN1, KC_LEFT,KC_DOWN,KC_RGHT), /* Layer 2: Media layer */ - [KM_MEDIA] = KEYMAP( \ + [KM_MEDIA] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_MUTE,_______,KC_VOLD, \ @@ -68,7 +66,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT), /* Layer 3: Programming layer */ - [KM_HAXHAX] = KEYMAP( \ + [KM_HAXHAX] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,SE_LCBR,SE_PIPE,SE_RCBR,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ diff --git a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk index 7a616ee5f3..8254a83891 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/blowrak/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 # Virtual DIP switch configuration(+1000) @@ -14,9 +14,4 @@ MIDI_ENABLE = no # MIDI controls 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. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h index 2d27ff392d..122627e88f 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/config.h @@ -1,11 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - -#include "../../config.h" +#pragma once /* overridden settings: */ #undef PRODUCT #define PRODUCT Pegasus Hoof Citadel - -#endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c index 382854de9b..79f07d3bb8 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/keymap.c @@ -14,7 +14,7 @@ * along with this program. If not, see . */ -#include "pegasushoof.h" +#include QMK_KEYBOARD_H /* Allow shortcuts for combos like RALT(KC_RBRC) that don't take up more than 7 characters: */ #define G(kc) RALT(KC_##kc) @@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '------------------------------------------------------------------------' '--------------' * NUHS = true position of KC_NUHS */ -[DEF] = KEYMAP( \ +[DEF] = 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,TD(AF4), \ 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_NUHS, KC_DEL, KC_END, KC_PGDN, \ @@ -89,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * '------------------------------------------------------------------------' '--------------' * */ -[FUN] = KEYMAP( \ +[FUN] = LAYOUT( \ CTALDEL, KC_MYCM,KC_WHOM,KC_CALC,KC_MSEL,KC_MPRV,KC_MNXT,KC_MPLY,KC_MSTP,KC_MUTE,KC_VOLD,KC_VOLU,MO(RES), _______,KC_SLCK,KC_PAUS, \ _______,_______,_______,_______,_______,_______,_______,G(7), G(8), G(9), G(0), G(MINS),_______,_______, _______,_______,KC_WH_U, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,G(RBRC),_______, _______,_______,KC_WH_D, \ @@ -99,7 +99,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 3: Reset layer (prevents accidental resets) */ -[RES] = KEYMAP( \ +[RES] = LAYOUT( \ _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ _______,_______,_______,_______,RESET, _______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______, \ diff --git a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk index 4cec29477a..3eb289a716 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/citadel/rules.mk @@ -13,10 +13,5 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. TAP_DANCE_ENABLE = yes # see https://docs.qmk.fm/#/feature_tap_dance (+1000) - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c index aa006b23a4..621441b901 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/keymap.c @@ -15,46 +15,42 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include "pegasushoof.h" - -#define _______ KC_TRNS +#include QMK_KEYBOARD_H #define KM_QWERTY 0 #define KM_MEDIA 1 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Layer 0: Standard ISO layer */ - [KM_QWERTY] = KEYMAP( \ - 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_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_CLCK, 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,KC_MENU,KC_FN0, KC_LEFT,KC_DOWN,KC_RGHT), - /* Layer 1: Function layer */ - [KM_MEDIA] = KEYMAP( \ - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, KC_WAKE,KC_PWR, KC_SLEP, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLU, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,KC_VOLD, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, \ - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MPLY, \ - _______,_______,_______, _______, _______,_______,RESET ,_______, KC_MPRV,KC_MSTP,KC_MNXT) -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(KM_MEDIA) + /* Layer 0: Standard ISO layer */ + [KM_QWERTY] = 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_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_CLCK, 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, KC_MENU, MO(1), KC_LEFT, KC_DOWN, KC_RGHT \ + ), + /* Layer 1: Function layer */ + [KM_MEDIA] = LAYOUT( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_WAKE, KC_PWR, KC_SLEP, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLU, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY, \ + _______, _______, _______, _______, _______, _______, RESET, _______, KC_MPRV, KC_MSTP, KC_MNXT \ + ) }; void led_set_user(uint8_t usb_led) { - if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - ph_caps_led_on(); - } else { - ph_caps_led_off(); - } - - if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { - ph_sclk_led_on(); - } else { - ph_sclk_led_off(); - } + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + ph_caps_led_on(); + } else { + ph_caps_led_off(); + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + ph_sclk_led_on(); + } else { + ph_sclk_led_off(); + } } diff --git a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk index 7a616ee5f3..8254a83891 100644 --- a/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk +++ b/keyboards/bpiphany/pegasushoof/keymaps/default/rules.mk @@ -1,5 +1,5 @@ # Build Options -# change to "no" to disable the options, or define them in the Makefile in +# 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 # Virtual DIP switch configuration(+1000) @@ -14,9 +14,4 @@ MIDI_ENABLE = no # MIDI controls 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. - - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. diff --git a/keyboards/bpiphany/pegasushoof/pegasushoof.h b/keyboards/bpiphany/pegasushoof/pegasushoof.h index 939a854cd4..b91235aadd 100644 --- a/keyboards/bpiphany/pegasushoof/pegasushoof.h +++ b/keyboards/bpiphany/pegasushoof/pegasushoof.h @@ -21,25 +21,39 @@ along with this program. If not, see . #include "matrix.h" #include "quantum.h" -#define ___ KC_NO +#define LAYOUT( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ + /* 0 */ { KC_NO , KC_NO , KC0 , KC_NO , KC_NO , KF0 , KC_NO , KC_NO , KC_NO , KJ0 , KK0 , KC_NO , KM0 , KN0 , KO0 , KC_NO , KQ0 , KR0 }, \ + /* 1 */ { KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , KC_NO , KO1 , KP1 , KC_NO , KC_NO }, \ + /* 2 */ { KC_NO , KB2 , KC_NO , KD2 , KC_NO , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , KC_NO , KO2 , KC_NO , KC_NO , KC_NO }, \ + /* 3 */ { KA3 , KB3 , KC_NO , KC_NO , KC_NO , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , KC_NO , KO3 , KC_NO , KC_NO , KC_NO }, \ + /* 4 */ { KC_NO , KC_NO , KC4 , KC_NO , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , KC_NO , KO4 , KP4 , KQ4 , KR4 }, \ + /* 5 */ { KC_NO , KC_NO , KC5 , KC_NO , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , KC_NO , KC_NO }, \ + /* 6 */ { KC_NO , KC_NO , KC6 , KC_NO , KC_NO , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , KC_NO , KN6 , KO6 , KC_NO , KQ6 , KC_NO }, \ + /* 7 */ { KC_NO , KC_NO , KC_NO , KC_NO , KC_NO , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , KC_NO , KP7 , KC_NO , KC_NO } \ + } -#define KEYMAP( \ - KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ - KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ - KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ - KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ - KB2, KH6, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ - KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ - ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ - /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , ___ , ___ , ___ , KJ0 , KK0 , ___ , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ - /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ - /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ - /* 3 */ { KA3 , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ - /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ - /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ - /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , KH6 , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ - /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , ___ , KP7 , ___ , ___ }, \ - } +#define LAYOUT_tkl_ansi( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) LAYOUT( \ + KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ + KG4, KG5, KH5, KI5, KJ5, KJ4, KK4, KK5, KL5, KM5, KF5, KF4, KL4, KO2, KR4, KC4, KE4, \ + KG2, KG7, KH7, KI7, KJ7, KJ2, KK2, KK7, KL7, KM7, KF7, KF2, KL2, KO3, KQ4, KC5, KE5, \ + KH2, KG3, KH3, KI3, KJ3, KJ6, KK6, KK3, KL3, KM3, KF3, KF6, KO1, \ + KB2,KC_NO,KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KB3, KC6, \ + KP4, KD2, KN6, KQ6, KN0, KA3, KM0, KP1, KC0, KQ0, KR0 \ + ) #define LAYOUT_tkl_jis( \ KG6, KH4, KI4, KI2, KI6, KP5, KL6, KM2, KM4, KO4, KO5, KO6, KO0, KN5, KN7, KP7, \ @@ -49,14 +63,14 @@ along with this program. If not, see . KB2, KG1, KH1, KI1, KJ1, KJ0, KK0, KK1, KL1, KM1, KF0, KL0, KB3, KC6, \ KP4, KD2, KN6, KG0, KQ6, KH0, KI0, KN0, KM0, KP1, KC0, KQ0, KR0 \ ) { /* 00-A 01-B 02-C 03-D 04-E 05-F 06-G 07-H 08-I 09-J 10-K 11-L 12-M 13-N 14-O 15-P 16-Q 17-R */ \ - /* 0 */ { ___ , ___ , KC0 , ___ , ___ , KF0 , KG0 , KH0 , KI0 , KJ0 , KK0 , KL0 , KM0 , KN0 , KO0 , ___ , KQ0 , KR0 }, \ - /* 1 */ { ___ , ___ , ___ , ___ , ___ , ___ , KG1 , KH1 , KI1 , KJ1 , KK1 , KL1 , KM1 , ___ , KO1 , KP1 , ___ , ___ }, \ - /* 2 */ { ___ , KB2 , ___ , KD2 , ___ , KF2 , KG2 , KH2 , KI2 , KJ2 , KK2 , KL2 , KM2 , ___ , KO2 , ___ , ___ , ___ }, \ - /* 3 */ { ___ , KB3 , ___ , ___ , ___ , KF3 , KG3 , KH3 , KI3 , KJ3 , KK3 , KL3 , KM3 , ___ , KO3 , ___ , ___ , ___ }, \ - /* 4 */ { ___ , ___ , KC4 , ___ , KE4 , KF4 , KG4 , KH4 , KI4 , KJ4 , KK4 , KL4 , KM4 , ___ , KO4 , KP4 , KQ4 , KR4 }, \ - /* 5 */ { ___ , ___ , KC5 , ___ , KE5 , KF5 , KG5 , KH5 , KI5 , KJ5 , KK5 , KL5 , KM5 , KN5 , KO5 , KP5 , ___ , ___ }, \ - /* 6 */ { ___ , ___ , KC6 , ___ , ___ , KF6 , KG6 , ___ , KI6 , KJ6 , KK6 , KL6 , ___ , KN6 , KO6 , ___ , KQ6 , ___ }, \ - /* 7 */ { ___ , ___ , ___ , ___ , ___ , KF7 , KG7 , KH7 , KI7 , KJ7 , KK7 , KL7 , KM7 , KN7 , KO7 , KP7 , ___ , ___ }, \ + /* 0 */ { KC_NO, KC_NO, KC0, KC_NO, KC_NO, KF0, KG0, KH0, KI0, KJ0, KK0, KL0, KM0, KN0, KO0, KC_NO, KQ0, KR0 }, \ + /* 1 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KG1, KH1, KI1, KJ1, KK1, KL1, KM1, KC_NO, KO1, KP1, KC_NO, KC_NO }, \ + /* 2 */ { KC_NO, KB2, KC_NO, KD2, KC_NO, KF2, KG2, KH2, KI2, KJ2, KK2, KL2, KM2, KC_NO, KO2, KC_NO, KC_NO, KC_NO }, \ + /* 3 */ { KC_NO, KB3, KC_NO, KC_NO, KC_NO, KF3, KG3, KH3, KI3, KJ3, KK3, KL3, KM3, KC_NO, KO3, KC_NO, KC_NO, KC_NO }, \ + /* 4 */ { KC_NO, KC_NO, KC4, KC_NO, KE4, KF4, KG4, KH4, KI4, KJ4, KK4, KL4, KM4, KC_NO, KO4, KP4, KQ4, KR4 }, \ + /* 5 */ { KC_NO, KC_NO, KC5, KC_NO, KE5, KF5, KG5, KH5, KI5, KJ5, KK5, KL5, KM5, KN5, KO5, KP5, KC_NO, KC_NO }, \ + /* 6 */ { KC_NO, KC_NO, KC6, KC_NO, KC_NO, KF6, KG6, KC_NO, KI6, KJ6, KK6, KL6, KC_NO, KN6, KO6, KC_NO, KQ6, KC_NO }, \ + /* 7 */ { KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KF7, KG7, KH7, KI7, KJ7, KK7, KL7, KK7, KL7, KO7, KP7, KC_NO, KC_NO } \ } inline void ph_caps_led_on(void) { DDRC |= (1<<6); PORTC &= ~(1<<6); } diff --git a/keyboards/bpiphany/pegasushoof/readme.md b/keyboards/bpiphany/pegasushoof/readme.md new file mode 100644 index 0000000000..10ec79300a --- /dev/null +++ b/keyboards/bpiphany/pegasushoof/readme.md @@ -0,0 +1,13 @@ +# Pegasus Hoof Controller + +A replacement controller that turns your Filco Majestouch 87/88 mechanical keyboard into a fully programmable keyboard. + +Keyboard Maintainer: QMK Community +Hardware Supported: Pegasus Hoof +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/filco-pegasus-hoof-controller/) + +Make example for this keyboard (after setting up your build environment): + + make bpiphany/pegasus_hoof: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/pegasushoof/rules.mk b/keyboards/bpiphany/pegasushoof/rules.mk index 0cfe115aab..00e4bb0ea1 100644 --- a/keyboards/bpiphany/pegasushoof/rules.mk +++ b/keyboards/bpiphany/pegasushoof/rules.mk @@ -60,8 +60,9 @@ MIDI_ENABLE = no # MIDI controls 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. +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +LAYOUTS = tkl_ansi CUSTOM_MATRIX = yes SRC = matrix.c -- cgit v1.2.3 From 91a4a63ac79460c63a8a8d49786ca2a67265b24d Mon Sep 17 00:00:00 2001 From: Fred Silberberg Date: Fri, 14 Dec 2018 18:39:16 -0800 Subject: Fix keymap build to send over remote desktop correctly. (#4651) --- keyboards/bigswitch/keymaps/333fred/keymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/bigswitch/keymaps/333fred/keymap.c b/keyboards/bigswitch/keymaps/333fred/keymap.c index 791fb435f4..be40fecb23 100644 --- a/keyboards/bigswitch/keymaps/333fred/keymap.c +++ b/keyboards/bigswitch/keymaps/333fred/keymap.c @@ -79,7 +79,7 @@ void dance_finished(qk_tap_dance_state_t *state, void* user_data) { case SINGLE_TAP: { // VS Build: CTRL+SHIFT+B - SEND_STRING(SS_DOWN(X_LCTRL) SS_DOWN(X_LALT) "b" SS_UP(X_LALT) SS_UP(X_LCTRL)); + send_string_with_delay_P(PSTR(SS_DOWN(X_LCTRL) SS_DOWN(X_LSHIFT) "b" SS_UP(X_LSHIFT) SS_UP(X_LCTRL)), 10); tap_dance_active = false; break; } -- cgit v1.2.3 From 4f1f52b53ba66ff83ce57e662c27b309ead9c693 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 14 Dec 2018 18:39:54 -0800 Subject: Add left/right EEPROM flashing for DFU (#4560) --- tmk_core/avr.mk | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/tmk_core/avr.mk b/tmk_core/avr.mk index add904c9c5..0c3a9624cb 100644 --- a/tmk_core/avr.mk +++ b/tmk_core/avr.mk @@ -169,6 +169,36 @@ dfu-ee: $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).eep fi $(DFU_PROGRAMMER) $(MCU) reset +dfu-split-left: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size + until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done + if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) erase --force;\ + $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\ + else\ + $(DFU_PROGRAMMER) $(MCU) erase;\ + $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-lefthand.eep;\ + fi + $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex + $(DFU_PROGRAMMER) $(MCU) reset + +dfu-split-right: $(BUILD_DIR)/$(TARGET).hex cpfirmware check-size + until $(DFU_PROGRAMMER) $(MCU) get bootloader-version; do\ + echo "Error: Bootloader not found. Trying again in 5s." ;\ + sleep 5 ;\ + done + if $(DFU_PROGRAMMER) --version 2>&1 | $(GREP) -q 0.7 ; then\ + $(DFU_PROGRAMMER) $(MCU) erase --force;\ + $(DFU_PROGRAMMER) $(MCU) flash --eeprom $(QUANTUM_PATH)/split_common/eeprom-righthand.eep;\ + else\ + $(DFU_PROGRAMMER) $(MCU) erase;\ + $(DFU_PROGRAMMER) $(MCU) flash-eeprom $(QUANTUM_PATH)/split_common/eeprom-rightand.eep;\ + fi + $(DFU_PROGRAMMER) $(MCU) flash $(BUILD_DIR)/$(TARGET).hex + $(DFU_PROGRAMMER) $(MCU) reset + define EXEC_AVRDUDE USB= ;\ if $(GREP) -q -s Microsoft /proc/version; then \ @@ -279,4 +309,3 @@ production: $(BUILD_DIR)/$(TARGET).hex bootloader cpfirmware @cat $(TARGET)_bootloader.hex >> $(TARGET)_production.hex echo "File sizes:" $(SIZE) $(TARGET).hex $(TARGET)_bootloader.hex $(TARGET)_production.hex - -- cgit v1.2.3 From a49d98e665d934c318894cfc9d9813adacd08f11 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Fri, 14 Dec 2018 02:29:14 -0800 Subject: Comet46: Configurator support --- keyboards/comet46/info.json | 62 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 keyboards/comet46/info.json diff --git a/keyboards/comet46/info.json b/keyboards/comet46/info.json new file mode 100644 index 0000000000..9881397b40 --- /dev/null +++ b/keyboards/comet46/info.json @@ -0,0 +1,62 @@ +{ + "keyboard_name": "Comet46", + "url": "", + "maintainer": "SatT", + "width": 15, + "height": 4.9, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"TAB", "x":0, "y":0.45}, + {"label":"Q", "x":1, "y":0.45}, + {"label":"W", "x":2, "y":0.15}, + {"label":"E", "x":3, "y":0}, + {"label":"R", "x":4, "y":0.30}, + {"label":"T", "x":5, "y":0.45}, + {"label":"Y", "x":9, "y":0.45}, + {"label":"U", "x":10, "y":0.30}, + {"label":"I", "x":11, "y":0}, + {"label":"O", "x":12, "y":0.15}, + {"label":"P", "x":13, "y":0.45}, + {"label":"BSPC", "x":14, "y":0.45}, + + {"label":"LCTL", "x":0, "y":1.45}, + {"label":"A", "x":1, "y":1.45}, + {"label":"S", "x":2, "y":1.15}, + {"label":"D", "x":3, "y":1}, + {"label":"F", "x":4, "y":1.30}, + {"label":"G", "x":5, "y":1.45}, + {"label":"ESC", "x":6, "y":1}, + {"label":"DEL", "x":8, "y":1}, + {"label":"H", "x":9, "y":1.45}, + {"label":"J", "x":10, "y":1.30}, + {"label":"K", "x":11, "y":1}, + {"label":"L", "x":12, "y":1.15}, + {"label":"SCLN", "x":13, "y":1.45}, + {"label":"QUOT", "x":14, "y":1.45}, + + {"label":"LSFT", "x":0, "y":2.45}, + {"label":"Z", "x":1, "y":2.45}, + {"label":"X", "x":2, "y":2.15}, + {"label":"C", "x":3, "y":2}, + {"label":"V", "x":4, "y":2.30}, + {"label":"B", "x":5, "y":2.45}, + {"label":"LCBR", "x":6, "y":2}, + {"label":"RCBR", "x":8, "y":2}, + {"label":"N", "x":9, "y":2.45}, + {"label":"M", "x":10, "y":2.30}, + {"label":"COMM", "x":11, "y":2}, + {"label":"DOT", "x":12, "y":2.15}, + {"label":"SLSH", "x":13, "y":2.45}, + {"label":"RSFT", "x":14, "y":2.45}, + + {"label":"LGUI", "x":4, "y":3.9}, + {"label":"LOWER", "x":5, "y":3.9}, + {"label":"SPACE", "x":6, "y":3.4, "h":1.5}, + {"label":"ENTER", "x":8, "y":3.4, "h":1.5}, + {"label":"RAISE", "x":9, "y":3.9}, + {"label":"LALT", "x":10, "y":3.9} + ] + } + } +} -- cgit v1.2.3 From 8f790948e5f7ed62b2c56e1a6aa63dae89d5c860 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Sat, 15 Dec 2018 14:31:56 +0900 Subject: Refactor quantum/split_common/i2c.c, quantum/split_common/serial.c (#4522) * add temporary compile test shell script * Extended support of SKIP_VERSION to make invariant compile results during testing. * build_keyboard.mk, tmk_core/rules.mk: add LIB_SRC, QUANTUM_LIB_SRC support Support compiled object enclosed in library. e.g. ``` LIB_SRC += xxxx.c xxxx.c --> xxxx.o ---> xxxx.a ``` * remove 'ifdef/ifndef USE_I2C' from quantum/split_common/{i2c|serial}.c * add SKIP_DEBUG_INFO into tmk_core/rules.mk When SKIP_DEBUG_INFO=yes is specified, do not use the -g option at compile time. * tmk_core/rules.mk: Library object need -fno-lto * add SKIP_DEBUG_INFO=yes * remove temporary compile test shell script * add '#define SOFT_SERIAL_PIN D0' to keyboards/lets_split/rev?/config.h * quantum/split_common/serial.c: Changed not to use USE_I2C. --- build_keyboard.mk | 6 ++++++ common_features.mk | 6 +++--- keyboards/lets_split/rev1/config.h | 3 +++ keyboards/lets_split/rev2/config.h | 3 +++ keyboards/lets_split/sockets/config.h | 3 +++ quantum/split_common/i2c.c | 3 --- quantum/split_common/serial.c | 16 ++++++---------- tmk_core/common/command.c | 4 ++++ tmk_core/rules.mk | 36 +++++++++++++++++++++++++++-------- 9 files changed, 56 insertions(+), 24 deletions(-) diff --git a/build_keyboard.mk b/build_keyboard.mk index d225fe8216..b639b92d3e 100644 --- a/build_keyboard.mk +++ b/build_keyboard.mk @@ -34,6 +34,10 @@ $(error MASTER does not have a valid value(left/right)) endif endif +ifdef SKIP_VERSION + OPT_DEFS += -DSKIP_VERSION +endif + # Determine which subfolders exist. KEYBOARD_FOLDER_PATH_1 := $(KEYBOARD) KEYBOARD_FOLDER_PATH_2 := $(patsubst %/,%,$(dir $(KEYBOARD_FOLDER_PATH_1))) @@ -278,6 +282,7 @@ ifneq ("$(wildcard $(KEYMAP_PATH)/config.h)","") endif # # project specific files +SRC += $(patsubst %.c,%.clib,$(LIB_SRC)) SRC += $(KEYBOARD_SRC) \ $(KEYMAP_C) \ $(QUANTUM_SRC) @@ -296,6 +301,7 @@ include $(TMK_PATH)/protocol.mk include $(TMK_PATH)/common.mk include bootloader.mk +SRC += $(patsubst %.c,%.clib,$(QUANTUM_LIB_SRC)) SRC += $(TMK_COMMON_SRC) OPT_DEFS += $(TMK_COMMON_DEFS) EXTRALDFLAGS += $(TMK_COMMON_LDFLAGS) diff --git a/common_features.mk b/common_features.mk index 97febe2e77..73aab5d845 100644 --- a/common_features.mk +++ b/common_features.mk @@ -270,7 +270,7 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) endif OPT_DEFS += -DSPLIT_KEYBOARD QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ - $(QUANTUM_DIR)/split_common/split_util.c \ - $(QUANTUM_DIR)/split_common/i2c.c \ - $(QUANTUM_DIR)/split_common/serial.c + $(QUANTUM_DIR)/split_common/split_util.c + QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/i2c.c + QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/serial.c endif diff --git a/keyboards/lets_split/rev1/config.h b/keyboards/lets_split/rev1/config.h index a8d6149154..18b7cce5a4 100644 --- a/keyboards/lets_split/rev1/config.h +++ b/keyboards/lets_split/rev1/config.h @@ -45,6 +45,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/lets_split/rev2/config.h b/keyboards/lets_split/rev2/config.h index 8844e5bb81..1c0871cd1e 100644 --- a/keyboards/lets_split/rev2/config.h +++ b/keyboards/lets_split/rev2/config.h @@ -45,6 +45,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/keyboards/lets_split/sockets/config.h b/keyboards/lets_split/sockets/config.h index 10d0c997e6..6939d37dc5 100644 --- a/keyboards/lets_split/sockets/config.h +++ b/keyboards/lets_split/sockets/config.h @@ -45,6 +45,9 @@ along with this program. If not, see . /* Set 0 if debouncing isn't needed */ #define DEBOUNCING_DELAY 5 +/* serial.c configuration for split keyboard */ +#define SOFT_SERIAL_PIN D0 + /* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */ #define LOCKING_SUPPORT_ENABLE /* Locking resynchronize hack */ diff --git a/quantum/split_common/i2c.c b/quantum/split_common/i2c.c index b3d7fcc681..45e958b395 100644 --- a/quantum/split_common/i2c.c +++ b/quantum/split_common/i2c.c @@ -7,8 +7,6 @@ #include "i2c.h" #include "split_flags.h" -#if defined(USE_I2C) || defined(EH) - // Limits the amount of we wait for any one i2c transaction. // Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is // 9 bits, a single transaction will take around 90μs to complete. @@ -184,4 +182,3 @@ ISR(TWI_vect) { // Reset everything, so we are ready for the next TWI interrupt TWCR |= (1< #include "serial.h" -#ifndef USE_I2C - -#ifndef SOFT_SERIAL_PIN - #error quantum/split_common/serial.c need SOFT_SERIAL_PIN define -#endif +#ifdef SOFT_SERIAL_PIN #ifdef __AVR_ATmega32U4__ // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. - #ifdef USE_I2C - #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 - #error Using ATmega32U4 I2C, so can not use PD0, PD1 - #endif + #ifdef USE_AVR_I2C + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif #endif #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 @@ -278,4 +274,4 @@ int serial_update_buffers(void) { return 0; } -#endif +#endif /* SOFT_SERIAL_PIN */ diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index f79d5a257b..aab99290d2 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -181,7 +181,11 @@ static void print_version(void) print("VID: " STR(VENDOR_ID) "(" STR(MANUFACTURER) ") " "PID: " STR(PRODUCT_ID) "(" STR(PRODUCT) ") " "VER: " STR(DEVICE_VER) "\n"); +#ifdef SKIP_VERSION + print("BUILD: (" __DATE__ ")\n"); +#else print("BUILD: " STR(QMK_VERSION) " (" __TIME__ " " __DATE__ ")\n"); +#endif /* build options */ print("OPTIONS:" diff --git a/tmk_core/rules.mk b/tmk_core/rules.mk index ce3cd83b3f..2e419dd667 100644 --- a/tmk_core/rules.mk +++ b/tmk_core/rules.mk @@ -28,12 +28,13 @@ VPATH := # Convert all SRC to OBJ define OBJ_FROM_SRC -$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$($1_SRC))))) +$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC)))))) endef $(foreach OUTPUT,$(OUTPUTS),$(eval $(OUTPUT)_OBJ +=$(call OBJ_FROM_SRC,$(OUTPUT)))) # Define a list of all objects OBJ := $(foreach OUTPUT,$(OUTPUTS),$($(OUTPUT)_OBJ)) +NO_LTO_OBJ := $(filter %.a,$(OBJ)) MASTER_OUTPUT := $(firstword $(OUTPUTS)) @@ -81,7 +82,9 @@ CSTANDARD = -std=gnu99 # -Wall...: warning level # -Wa,...: tell GCC to pass this to the assembler. # -adhlns...: create assembler listing -CFLAGS += -g$(DEBUG) +ifndef SKIP_DEBUG_INFO + CFLAGS += -g$(DEBUG) +endif CFLAGS += $(CDEFS) CFLAGS += -O$(OPT) # add color @@ -110,7 +113,9 @@ CFLAGS += $(CSTANDARD) # -Wall...: warning level # -Wa,...: tell GCC to pass this to the assembler. # -adhlns...: create assembler listing -CPPFLAGS += -g$(DEBUG) +ifndef SKIP_DEBUG_INFO + CPPFLAGS += -g$(DEBUG) +endif CPPFLAGS += $(CPPDEFS) CPPFLAGS += -O$(OPT) # to supress "warning: only initialized variables can be placed into program memory area" @@ -138,7 +143,11 @@ CPPFLAGS += -Wa,-adhlns=$(@:%.o=%.lst) # -listing-cont-lines: Sets the maximum number of continuation lines of hex # dump that will be displayed for a given single line of source input. ASFLAGS += $(ADEFS) -ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 +ifndef SKIP_DEBUG_INFO + ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),-gstabs,--listing-cont-lines=100 +else + ASFLAGS += -Wa,-adhlns=$(@:%.o=%.lst),--listing-cont-lines=100 +endif #---------------- Library Options ---------------- # Minimalistic printf version @@ -210,6 +219,11 @@ ALL_CFLAGS = $(MCUFLAGS) $(CFLAGS) $(EXTRAFLAGS) ALL_CPPFLAGS = $(MCUFLAGS) -x c++ $(CPPFLAGS) $(EXTRAFLAGS) ALL_ASFLAGS = $(MCUFLAGS) -x assembler-with-cpp $(ASFLAGS) $(EXTRAFLAGS) +define NO_LTO +$(patsubst %.a,%.o,$1): NOLTO_CFLAGS += -fno-lto +endef +$(foreach LOBJ, $(NO_LTO_OBJ), $(eval $(call NO_LTO,$(LOBJ)))) + MOVE_DEP = mv -f $(patsubst %.o,%.td,$@) $(patsubst %.o,%.d,$@) @@ -290,8 +304,8 @@ $1_INCFLAGS := $$(patsubst %,-I%,$$($1_INC)) ifdef $1_CONFIG $1_CONFIG_FLAGS += $$(patsubst %,-include %,$$($1_CONFIG)) endif -$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) -$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) +$1_CFLAGS = $$(ALL_CFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) +$1_CPPFLAGS= $$(ALL_CPPFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) $$(NOLTO_CFLAGS) $1_ASFLAGS= $$(ALL_ASFLAGS) $$($1_DEFS) $$($1_INCFLAGS) $$($1_CONFIG_FLAGS) # Compile: create object files from C source files. @@ -321,6 +335,12 @@ $1/%.o : %.S $1/asflags.txt $1/compiler.txt | $(BEGIN) $$(eval CMD=$$(CC) -c $$($1_ASFLAGS) $$< -o $$@) @$$(BUILD_CMD) +$1/%.a : $1/%.o + @mkdir -p $$(@D) + @$(SILENT) || printf "Archiving: $$<" | $$(AWK_CMD) + $$(eval CMD=$$(AR) $$@ $$<) + @$$(BUILD_CMD) + $1/force: $1/cflags.txt: $1/force @@ -346,7 +366,7 @@ $(MASTER_OUTPUT)/ldflags.txt: $(MASTER_OUTPUT)/force # We have to use static rules for the .d files for some reason -DEPS = $(patsubst %.o,%.d,$(OBJ)) +DEPS = $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) # Keep the .d files .PRECIOUS: $(DEPS) # Empty rule to force recompilation if the .d file is missing @@ -391,7 +411,7 @@ $(shell mkdir -p $(BUILD_DIR) 2>/dev/null) $(eval $(foreach OUTPUT,$(OUTPUTS),$(shell mkdir -p $(OUTPUT) 2>/dev/null))) # Include the dependency files. --include $(patsubst %.o,%.d,$(OBJ)) +-include $(patsubst %.o,%.d,$(patsubst %.a,%.o,$(OBJ))) # Listing of phony targets. -- cgit v1.2.3 From 45591ee443f57000bf5ad39f45bfa5d44f43dce0 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 21:36:03 -0800 Subject: Keyboard: Chimera Ortho refactor (#4652) * Layout macro refactor - Renamed KC_KEYMAP to LAYOUT_kc - Renamed KEYMAP to LAYOUT - moved LAYOUT above LAYOUT_kc (Hoping this encourages users to use LAYOUT.) - updated layout macro name in info.json - white space changes for readability * Keymap refactor: default Default keymap now uses `#include QMK_KEYBOARD_H` and LAYOUT macro (from KC_KEYMAP/LAYOUT_kc). Keymap was also refactored to use process_record_user function instead of deprecated action_get_macro from TMK. Also moved LONGPRESS_DELAY and LAYER_TOGGLE_DELAY definitions to config.h. * Keymap refactor: dcompact - Changed chimera_ortho.h include for QMK_KEYBOARD_H - Updated layout name on keymap layers * Coding conventions fix in default keymap * Keymap refactor: gordon - Changed chimera_ortho.h include for QMK_KEYBOARD_H - Removed redundant includes of action_layer.h and process_tap_dance.h (superseded by QMK_KEYBOARD_H) - Removed redundant definitions for KC_NO and KC_TRNS - Updated layout name on keymap layers --- keyboards/chimera_ortho/chimera_ortho.h | 33 +-- keyboards/chimera_ortho/info.json | 280 ++++------------------ keyboards/chimera_ortho/keymaps/dcompact/keymap.c | 12 +- keyboards/chimera_ortho/keymaps/default/config.h | 5 + keyboards/chimera_ortho/keymaps/default/keymap.c | 218 ++++++++--------- keyboards/chimera_ortho/keymaps/gordon/keymap.c | 58 +++-- 6 files changed, 206 insertions(+), 400 deletions(-) create mode 100644 keyboards/chimera_ortho/keymaps/default/config.h diff --git a/keyboards/chimera_ortho/chimera_ortho.h b/keyboards/chimera_ortho/chimera_ortho.h index 3b7690d43a..5981252751 100644 --- a/keyboards/chimera_ortho/chimera_ortho.h +++ b/keyboards/chimera_ortho/chimera_ortho.h @@ -49,31 +49,32 @@ // This a shortcut to help you visually see your layout. // The first section contains all of the arguements // The second converts the arguments into a two-dimensional array -#define KC_KEYMAP( \ +#define LAYOUT( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, \ k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, \ - k28, k29, k31, k32, k33, k34, k35, k36, k37, k38, k41, k42, k43, k44,\ - k45, k46, k47, k48 \ + k28, k29, k31, k32, k33, k34, k35, k36, k37, k38, k41, k42, k43, k44, \ + k45, k46, k47, k48 \ ) \ { \ - { KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k08, KC_##k09, KC_##k10, KC_##k11, KC_##k12 }, \ - { KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26 }, \ - { KC_##k29, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k37, KC_##k38, KC_##k41, KC_##k42, KC_##k43 }, \ - { KC_NO, KC_##k06, KC_##k20, KC_##k35, KC_##k46, KC_##k47, KC_##k36, KC_##k21, KC_##k07, KC_NO }, \ - { KC_NO, KC_##k28, KC_##k14, KC_##k00, KC_##k45, KC_##k48, KC_##k13, KC_##k27, KC_##k44, KC_NO }, \ + { k01, k02, k03, k04, k05, k08, k09, k10, k11, k12 }, \ + { k15, k16, k17, k18, k19, k22, k23, k24, k25, k26 }, \ + { k29, k31, k32, k33, k34, k37, k38, k41, k42, k43 }, \ + { KC_NO, k06, k20, k35, k46, k47, k36, k21, k07, KC_NO }, \ + { KC_NO, k28, k14, k00, k45, k48, k13, k27, k44, KC_NO } \ } -#define KEYMAP( \ +#define LAYOUT_kc( \ k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k10, k11, k12, k13, \ k14, k15, k16, k17, k18, k19, k20, k21, k22, k23, k24, k25, k26, k27, \ - k28, k29, k31, k32, k33, k34, k35, k36, k37, k38, k41, k42, k43, k44,\ - k45, k46, k47, k48 \ + k28, k29, k31, k32, k33, k34, k35, k36, k37, k38, k41, k42, k43, k44, \ + k45, k46, k47, k48 \ ) \ { \ - { k01, k02, k03, k04, k05, k08, k09, k10, k11, k12 }, \ - { k15, k16, k17, k18, k19, k22, k23, k24, k25, k26 }, \ - { k29, k31, k32, k33, k34, k37, k38, k41, k42, k43 }, \ - { KC_NO, k06, k20, k35, k46, k47, k36, k21, k07, KC_NO }, \ - { KC_NO, k28, k14, k00, k45, k48, k13, k27, k44, KC_NO }, \ + { KC_##k01, KC_##k02, KC_##k03, KC_##k04, KC_##k05, KC_##k08, KC_##k09, KC_##k10, KC_##k11, KC_##k12 }, \ + { KC_##k15, KC_##k16, KC_##k17, KC_##k18, KC_##k19, KC_##k22, KC_##k23, KC_##k24, KC_##k25, KC_##k26 }, \ + { KC_##k29, KC_##k31, KC_##k32, KC_##k33, KC_##k34, KC_##k37, KC_##k38, KC_##k41, KC_##k42, KC_##k43 }, \ + { KC_NO, KC_##k06, KC_##k20, KC_##k35, KC_##k46, KC_##k47, KC_##k36, KC_##k21, KC_##k07, KC_NO }, \ + { KC_NO, KC_##k28, KC_##k14, KC_##k00, KC_##k45, KC_##k48, KC_##k13, KC_##k27, KC_##k44, KC_NO } \ } + #endif diff --git a/keyboards/chimera_ortho/info.json b/keyboards/chimera_ortho/info.json index b1384379ce..3f8481be4b 100644 --- a/keyboards/chimera_ortho/info.json +++ b/keyboards/chimera_ortho/info.json @@ -1,240 +1,58 @@ { + "keyboard_name": "Chimera Ortho", + "keyboard_folder": "chimera_ortho", "maintainer": "qmk", "width": 15.5, "height": 4.25, "layouts": { - "KEYMAP": { + "LAYOUT": { "layout": [ - { - "label": "Esc", - "x": 0, - "y": 0 - }, - { - "label": "Q", - "x": 1, - "y": 0 - }, - { - "label": "W", - "x": 2, - "y": 0 - }, - { - "label": "E", - "x": 3, - "y": 0 - }, - { - "label": "R", - "x": 4, - "y": 0 - }, - { - "label": "T", - "x": 5, - "y": 0 - }, - { - "label": "{", - "x": 6, - "y": 0 - }, - { - "label": "}", - "x": 8.5, - "y": 0 - }, - { - "label": "Y", - "x": 9.5, - "y": 0 - }, - { - "label": "U", - "x": 10.5, - "y": 0 - }, - { - "label": "I", - "x": 11.5, - "y": 0 - }, - { - "label": "O", - "x": 12.5, - "y": 0 - }, - { - "label": "P", - "x": 13.5, - "y": 0 - }, - { - "label": "\"", - "x": 14.5, - "y": 0 - }, - { - "label": "Tab", - "x": 0, - "y": 1 - }, - { - "label": "A", - "x": 1, - "y": 1 - }, - { - "label": "S", - "x": 2, - "y": 1 - }, - { - "label": "D", - "x": 3, - "y": 1 - }, - { - "label": "F", - "x": 4, - "y": 1 - }, - { - "label": "G", - "x": 5, - "y": 1 - }, - { - "label": "-", - "x": 6, - "y": 1 - }, - { - "label": "1", - "x": 8.5, - "y": 1 - }, - { - "label": "H", - "x": 9.5, - "y": 1 - }, - { - "label": "J", - "x": 10.5, - "y": 1 - }, - { - "label": "K", - "x": 11.5, - "y": 1 - }, - { - "label": "L", - "x": 12.5, - "y": 1 - }, - { - "label": ";", - "x": 13.5, - "y": 1 - }, - { - "label": "Enter", - "x": 14.5, - "y": 1 - }, - { - "label": "(", - "x": 0, - "y": 2 - }, - { - "label": "Z", - "x": 1, - "y": 2 - }, - { - "label": "X", - "x": 2, - "y": 2 - }, - { - "label": "C", - "x": 3, - "y": 2 - }, - { - "label": "V", - "x": 4, - "y": 2 - }, - { - "label": "B", - "x": 5, - "y": 2 - }, - { - "label": "=", - "x": 6, - "y": 2 - }, - { - "label": "8", - "x": 8.5, - "y": 2 - }, - { - "label": "N", - "x": 9.5, - "y": 2 - }, - { - "label": "M", - "x": 10.5, - "y": 2 - }, - { - "label": ",", - "x": 11.5, - "y": 2 - }, - { - "label": ".", - "x": 12.5, - "y": 2 - }, - { - "label": "/", - "x": 13.5, - "y": 2 - }, - { - "label": ")", - "x": 14.5, - "y": 2 - }, - { - "label": "Num Layer", - "x": 4, - "y": 3.25 - }, - { - "label": "Back Space", - "x": 5, - "y": 3.25 - }, - { - "label": "Space", - "x": 9.5, - "y": 3.25 - }, - { - "label": "Symbol Layer", - "x": 10.5, - "y": 3.25 - } + {"label": "Esc", "x": 0, "y": 0}, + {"label": "Q", "x": 1, "y": 0}, + {"label": "W", "x": 2, "y": 0}, + {"label": "E", "x": 3, "y": 0}, + {"label": "R", "x": 4, "y": 0}, + {"label": "T", "x": 5, "y": 0}, + {"label": "{", "x": 6, "y": 0}, + {"label": "}", "x": 8.5, "y": 0}, + {"label": "Y", "x": 9.5, "y": 0}, + {"label": "U", "x": 10.5, "y": 0}, + {"label": "I", "x": 11.5, "y": 0}, + {"label": "O", "x": 12.5, "y": 0}, + {"label": "P", "x": 13.5, "y": 0}, + {"label": "\"", "x": 14.5, "y": 0}, + {"label": "Tab", "x": 0, "y": 1}, + {"label": "A", "x": 1, "y": 1}, + {"label": "S", "x": 2, "y": 1}, + {"label": "D", "x": 3, "y": 1}, + {"label": "F", "x": 4, "y": 1}, + {"label": "G", "x": 5, "y": 1}, + {"label": "-", "x": 6, "y": 1}, + {"label": "1", "x": 8.5, "y": 1}, + {"label": "H", "x": 9.5, "y": 1}, + {"label": "J", "x": 10.5, "y": 1}, + {"label": "K", "x": 11.5, "y": 1}, + {"label": "L", "x": 12.5, "y": 1}, + {"label": ";", "x": 13.5, "y": 1}, + {"label": "Enter", "x": 14.5, "y": 1}, + {"label": "(", "x": 0, "y": 2}, + {"label": "Z", "x": 1, "y": 2}, + {"label": "X", "x": 2, "y": 2}, + {"label": "C", "x": 3, "y": 2}, + {"label": "V", "x": 4, "y": 2}, + {"label": "B", "x": 5, "y": 2}, + {"label": "=", "x": 6, "y": 2}, + {"label": "8", "x": 8.5, "y": 2}, + {"label": "N", "x": 9.5, "y": 2}, + {"label": "M", "x": 10.5, "y": 2}, + {"label": ", ", "x": 11.5, "y": 2}, + {"label": ".", "x": 12.5, "y": 2}, + {"label": "/", "x": 13.5, "y": 2}, + {"label": ")", "x": 14.5, "y": 2}, + {"label": "Num Layer", "x": 4, "y": 3.25}, + {"label": "Back Space", "x": 5, "y": 3.25}, + {"label": "Space", "x": 9.5, "y": 3.25}, + {"label": "Symbol Layer", "x": 10.5, "y": 3.25} ] } } diff --git a/keyboards/chimera_ortho/keymaps/dcompact/keymap.c b/keyboards/chimera_ortho/keymaps/dcompact/keymap.c index 74c3a25cda..1c6ef7d6f9 100644 --- a/keyboards/chimera_ortho/keymaps/dcompact/keymap.c +++ b/keyboards/chimera_ortho/keymaps/dcompact/keymap.c @@ -1,4 +1,4 @@ -#include "chimera_ortho.h" +#include QMK_KEYBOARD_H enum chimera_ortho_layers { @@ -34,7 +34,7 @@ enum chimera_ortho_layers const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = KC_KEYMAP( + [_BASE] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. LALT ,TAB ,QUOT ,COMM ,DOT ,P ,Y ,F ,G ,C ,R ,L ,SLSH ,FUNC //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_NAV] = KC_KEYMAP( + [_NAV] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. , , , , , , , ,HOME ,PGDOWN ,PGUP ,END , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -58,7 +58,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_SYM] = KC_KEYMAP( + [_SYM] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. ,QUAKE ,GRAVE ,TILDE ,BSLASH ,PIPE ,LPRN ,RPRN ,7 ,8 ,9 ,SLSH ,EQUAL , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -70,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_FUNC] = KC_KEYMAP( + [_FUNC] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. ,RESET ,SLEP ,MRWD ,MPLY ,MFFD , , ,F9 ,F10 ,F11 ,F12 , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //\-------------------------------+-------+-------+-------/ \-------+-------+---------------------------------------/ ), - [_MOUSE] = KC_KEYMAP( + [_MOUSE] = LAYOUT_kc( //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. , , , , , , , , , , , , , //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| diff --git a/keyboards/chimera_ortho/keymaps/default/config.h b/keyboards/chimera_ortho/keymaps/default/config.h new file mode 100644 index 0000000000..bdfd4db80f --- /dev/null +++ b/keyboards/chimera_ortho/keymaps/default/config.h @@ -0,0 +1,5 @@ +#pragma once + +// place overrides here +#define LONGPRESS_DELAY 150 +//#define LAYER_TOGGLE_DELAY 300 diff --git a/keyboards/chimera_ortho/keymaps/default/keymap.c b/keyboards/chimera_ortho/keymaps/default/keymap.c index 6201eebac8..6a676493dd 100644 --- a/keyboards/chimera_ortho/keymaps/default/keymap.c +++ b/keyboards/chimera_ortho/keymaps/default/keymap.c @@ -1,20 +1,19 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ortho.h" +#include QMK_KEYBOARD_H // 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. -enum chimera_ortho_layers -{ - _QWERTY, - _CAPS, - _NUMPAD, - _SYMBOLS, - _MACROS, - _NAV +enum chimera_ortho_layers { + _QWERTY, + _CAPS, + _NUMPAD, + _SYMBOLS, + _MACROS, + _NAV }; #define KC_NMPD TG(_NUMPAD) @@ -27,153 +26,140 @@ enum chimera_ortho_layers #define KC_GBRC MT(MOD_RGUI, KC_8) #define KC_GQOT MT(MOD_LGUI, KC_QUOT) #define KC_MESC LT(_MACROS, KC_ESC) -#define KC_INCL M(0) -#define KC_PULL M(1) -#define KC_PUSH M(2) -#define KC_SCAP M(3) -#define KC_SCOF M(4) #define KC_CAD LALT(LCTL(KC_DEL)) -#define LONGPRESS_DELAY 150 -//#define LAYER_TOGGLE_DELAY 300 - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS +enum custom_keycodes { + KC_INCL = SAFE_RANGE, + KC_PULL, + KC_PUSH, + KC_SCAP, + KC_SCOF +}; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - MESC, Q , W , E , R , T ,SCTL, SCTR, Y , U , I , O , P ,QUOT, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - TAB , A , S , D , F , G ,SPLT, SPRT, H , J , K , L ,SCLN,ENT , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - LSPO, Z , X , C , V , B ,SPFN, GBRC, N , M ,COMM,DOT ,SLSH,RSPC, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - NMPD,BSPC, SPC ,SYMB - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_QWERTY] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + KC_MESC, KC_Q , KC_W , KC_E , KC_R , KC_T ,KC_SCTL, KC_SCTR, KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_QUOT, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_TAB , KC_A , KC_S , KC_D , KC_F , KC_G ,KC_SPLT, KC_SPRT, KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_ENT , + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_SPFN, KC_GBRC, KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH,KC_RSPC, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_NMPD,KC_BSPC, KC_SPC ,KC_SYMB + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_CAPS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , ,UNDS, , , , , ,COLN, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SCOF, , , , , , , , , , , , ,SCOF, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_CAPS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,KC_UNDS, _______,_______,_______,_______,_______,KC_COLN,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_SCOF,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______,_______,_______,KC_SCOF, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_NUMPAD] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , ,COLN , , , , , , , 7 , 8 , 9 ,ASTR,MINS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , ,DOT , , , , , , , 4 , 5 , 6 ,PLUS, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , , 1 , 2 , 3 ,SLSH, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , 0 - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_NUMPAD] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,KC_COLN,_______,_______,_______,_______, _______,_______, KC_7 , KC_8 , KC_9 ,KC_ASTR,KC_MINS, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,KC_DOT ,_______,_______,_______,_______, _______,_______, KC_4 , KC_5 , KC_6 ,KC_PLUS,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______, KC_1 , KC_2 , KC_3 ,KC_SLSH,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______, KC_0 + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_SYMBOLS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - ,EXLM, AT ,HASH,DLR ,PERC, , ,CIRC,AMPR,ASTR,LPRN,RPRN,BSLS, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F1 , F2 , F3 , F4 , F5 , , ,TILD,COLN,UNDS,LCBR,RCBR, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F6 , F7 , F8 , F9 ,F10 , , ,GRV ,SCLN,MINS,LBRC,RBRC, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - PIPE, , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_SYMBOLS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,KC_EXLM, KC_AT ,KC_HASH,KC_DLR ,KC_PERC,_______, _______,KC_CIRC,KC_AMPR,KC_ASTR,KC_LPRN,KC_RPRN,KC_BSLS, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______, KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 ,_______, _______,KC_TILD,KC_COLN,KC_UNDS,KC_LCBR,KC_RCBR,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______, KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,_______, _______,KC_GRV ,KC_SCLN,KC_MINS,KC_LBRC,KC_RBRC,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_PIPE,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_NAV] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , , UP , ,PSCR, , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,LEFT,DOWN,RGHT, , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , , ,PGUP,PGDN, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,DEL , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_NAV] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______, KC_UP ,_______,KC_PSCR,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______,KC_LEFT,KC_DOWN,KC_RGHT,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,_______,_______,_______,_______, _______,_______,KC_PGUP,KC_PGDN,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,KC_DEL , _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ), - [_MACROS] = KC_KEYMAP( - //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. - , , , , , , , , , ,INCL, , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , ,CAD , , , , , , , , , , , - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - SCAP, , , , , , , , , ,PULL,PUSH, ,SCAP, - //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , - // \------------------+----+----+---/ \---+----+----+-------------------/ + [_MACROS] = LAYOUT( + //,-------+-------+-------+-------+-------+-------+-------. ,-------+-------+-------+-------+-------+-------+-------. + _______,_______,_______,_______,_______,_______,_______, _______,_______,_______,KC_INCL,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______,_______,KC_CAD ,_______,_______,_______, _______,_______,_______,_______,_______,_______,_______, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + KC_SCAP,_______,_______,_______,_______,_______,_______, _______,_______,_______,KC_PULL,KC_PUSH,_______,KC_SCAP, + //|-------+-------+-------+-------+-------+-------+-------| |-------+-------+-------+-------+-------+-------+-------| + _______,_______, _______,_______ + // \------------------------------+-------+-------+------/ \------+-------+-------+------------------------------/ ) }; -const uint16_t PROGMEM fn_actions[] = { - -}; - -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch(id) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch(keycode) { /* include some kind of library or header */ - case 0: + case KC_INCL: if (record->event.pressed) { - SEND_STRING("#include <>"); - return MACRO( T(LEFT), END); + SEND_STRING("#include <>" SS_TAP(X_LEFT)); } - break; - case 1: + return false; + case KC_PULL: if (record->event.pressed) { - SEND_STRING("git pull"); - return MACRO( T(ENT), END ); + SEND_STRING("git pull" SS_TAP(X_ENTER)); } - break; - case 2: + return false; + case KC_PUSH: if (record->event.pressed){ - SEND_STRING("git push"); - return MACRO( T(ENT), END ); + SEND_STRING("git push" SS_TAP(X_ENTER)); } - break; - case 3: + return false; + case KC_SCAP: if (record->event.pressed){ layer_on(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); } - break; - case 4: + return false; + case KC_SCOF: if (record->event.pressed){ layer_off(_CAPS); register_code(KC_CAPSLOCK); unregister_code(KC_CAPSLOCK); } - break; + return false; } - return MACRO_NONE; + return true; }; - + void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); - + switch (layer) { - case _QWERTY: - set_led_green; - break; + case _QWERTY: + set_led_green; + break; case _CAPS: - set_led_white; - break; + set_led_white; + break; case _NUMPAD: set_led_blue; break; @@ -181,11 +167,11 @@ void matrix_scan_user(void) { set_led_red; break; case _NAV: - set_led_magenta; - break; + set_led_magenta; + break; case _MACROS: - set_led_cyan; - break; + set_led_cyan; + break; default: set_led_green; break; diff --git a/keyboards/chimera_ortho/keymaps/gordon/keymap.c b/keyboards/chimera_ortho/keymaps/gordon/keymap.c index c6d668f8f8..c6766bed3a 100644 --- a/keyboards/chimera_ortho/keymaps/gordon/keymap.c +++ b/keyboards/chimera_ortho/keymaps/gordon/keymap.c @@ -1,10 +1,8 @@ // this is the style you want to emulate. // This is the canonical layout file for the Quantum project. If you want to add another keyboard, -#include "chimera_ortho.h" -#include "action_layer.h" +#include QMK_KEYBOARD_H #include "version.h" -#include "process_keycode/process_tap_dance.h" #include "gordon.h" // Each layer gets a name for readability, which is then used in the keymap matrix below. @@ -83,11 +81,9 @@ //#define LAYER_TOGGLE_DELAY 300 // Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define KC_ KC_TRNS +#define KC_ KC_TRNS -/* TODO: +/* TODO: * * DONE: RESET and CAD into macro layer. * DONE: WINUP AND WINDOWN in NAV layer @@ -113,7 +109,7 @@ * Russain layer * Hebrew layer * Get rid of stupid git pull and push macros. - * + * */ //Tap dance enums @@ -127,14 +123,14 @@ enum { CALC_PRINTSCREEN }; -static xtap ttt_state = { +static xtap ttt_state = { .is_press_action = true, .state = 0 }; //Already exists in gordon.c, shouldn't need this anymore -/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. +/*// To activate SINGLE_HOLD, you will need to hold for 200ms first. // This tap dance favors keys that are used frequently in typing like 'f' int cur_dance (qk_tap_dance_state_t *state) { if (state->count == 1) { @@ -151,8 +147,8 @@ int cur_dance (qk_tap_dance_state_t *state) { else if (state->count == 2) { if (state->interrupted) return DOUBLE_SINGLE_TAP; else if (state->pressed) return DOUBLE_HOLD; - else return DOUBLE_TAP; - } + else return DOUBLE_TAP; + } else if ((state->count == 3) && ((state->interrupted) || (!state->pressed))) return TRIPLE_TAP; else if (state->count == 3) return TRIPLE_HOLD; else return 8; //magic number. At some point this method will expand to work for more presses @@ -194,7 +190,7 @@ void TTT_reset (qk_tap_dance_state_t *state, void *user_data) { qk_tap_dance_action_t tap_dance_actions[] = { // simple tap dance - [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), + [F12ETAPS] = ACTION_TAP_DANCE_DOUBLE(KC_F12,LSFT(LCTL(KC_F10))), [CALCCOMP] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_MY_COMPUTER), [CALC_PRINTSCREEN] = ACTION_TAP_DANCE_DOUBLE(KC_CALCULATOR, KC_PSCR), [ALTF4] = ACTION_TAP_DANCE_DOUBLE(KC_F4,LALT(KC_F4)), @@ -206,7 +202,7 @@ qk_tap_dance_action_t tap_dance_actions[] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = KC_KEYMAP( + [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. MESC, Q ,CSHW,ENAV, R , T ,SPC , CLPS, Y , U ,INAV, O , P ,TTT, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -218,7 +214,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NUMPAD] = KC_KEYMAP( + [_NUMPAD] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , ,ASTR, , , , , 7 , 8 , 9 ,ASTR,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -226,11 +222,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , ,SLSH, , , , , 1 , 2 , 3 ,SLSH, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , 0 + , , , 0 // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_SYMBOLS] = KC_KEYMAP( + [_SYMBOLS] = LAYOUT_kc( //,----+----+-----+----+----+----+----. ,----+----+----+----+----+----+----. ,EXLM, AT ,LCBR,RCBR,HASH, , ,CIRC,AMPR,ASTR,LPRN,RPRN,/**/, //|----+----+-----+----+----+----+----| |----+----+----+----+----+----+----| @@ -242,7 +238,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { // \-------------------+----+----+---/ \---+----+----+-------------------/ ), - [_FUNCTION] = KC_KEYMAP( + [_FUNCTION] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. F6F7 ,F1 ,F2 ,F3 ,ALF4,F5 ,F6 , F7 ,F8 ,F9 ,F10 ,F11 ,F12 ,/**/, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -250,11 +246,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_NAV] = KC_KEYMAP( + [_NAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , ,SNAPLEFT,/**/,SNAPRIGHT,, , , , , UP , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -262,11 +258,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , ,WORKLEFT, ,WORKRIGHT,, , , ,PGUP,PGDN, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CDEL ,DEL, , + CDEL ,DEL, , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_TEXTNAV] = KC_KEYMAP( + [_TEXTNAV] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , , , , , , , , ,/**/, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -274,11 +270,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ), - [_MOUSE] = KC_KEYMAP( + [_MOUSE] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. , , ,MS_UP, , , , , , , UP , , , ,/**/ //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -286,12 +282,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , , , , , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - ,MS_BTN1 ,MS_BTN2 , + ,MS_BTN1 ,MS_BTN2 , // \------------------+----+----+---/ \---+----+----+-------------------/ - ), + ), - [_MACROS] = KC_KEYMAP( + [_MACROS] = LAYOUT_kc( //,----+----+----+----+----+----+----. ,----+----+----+----+----+----+----. /**/,RESET,SECRET_2,SECRET_3, , , ,SYSTEM_SLEEP, , ,INCL, , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| @@ -299,7 +295,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| SCAP, , , , , , , , , , , , ,SCAP, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , + , , , // \------------------+----+----+---/ \---+----+----+-------------------/ ) @@ -349,11 +345,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) } return MACRO_NONE; }; - + void matrix_scan_user(void) { uint8_t layer = biton32(layer_state); - + switch (layer) { case _QWERTY: set_led_green; @@ -381,7 +377,7 @@ void matrix_scan_user(void) { _delay_ms(45); set_led_blue; _delay_ms(45); - break; + break; default: set_led_green; break; -- cgit v1.2.3 From 2527fe879f7c5249bbd35488cc6e889e518a6d56 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 22:58:30 -0800 Subject: converter/ibm_5291: Configurator support and readme cleanup (#4654) * converter/ibm_5291: Configurator support - added layout data to info.json file - corrected keyboard_folder value * converter/ibm_5291: readme cleanup - Fixed "image" url (target of link was a web page; changed markdown formatting to text link) - Sentence capitalization fixes - markdown formatting fixes for readability --- keyboards/converter/ibm_5291/info.json | 95 +++++++++++++++++++++++++++++++++- keyboards/converter/ibm_5291/readme.md | 12 +++-- 2 files changed, 100 insertions(+), 7 deletions(-) diff --git a/keyboards/converter/ibm_5291/info.json b/keyboards/converter/ibm_5291/info.json index 48d835f338..2cb3b76c20 100644 --- a/keyboards/converter/ibm_5291/info.json +++ b/keyboards/converter/ibm_5291/info.json @@ -1,6 +1,97 @@ { "keyboard_name": "IBM 5291", - "keyboard_folder": "converter/5291", + "keyboard_folder": "converter/ibm_5291", "url": "https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard", - "maintainer": "listofoptions" + "maintainer": "listofoptions", + "width": 21, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"Sys Req", "x":0, "y":0}, + {"label":"Cmd", "x":1, "y":0}, + {"label":"`", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + {"label":"7", "x":9.25, "y":0}, + {"label":"8", "x":10.25, "y":0}, + {"label":"9", "x":11.25, "y":0}, + {"label":"0", "x":12.25, "y":0}, + {"label":"-", "x":13.25, "y":0}, + {"label":"=", "x":14.25, "y":0}, + {"label":"Backspace", "x":15.25, "y":0, "w":1.75}, + {"label":"Reverse Tab", "x":17, "y":0, "w":2}, + {"label":"Dup", "x":19, "y":0, "w":2}, + {"label":"Del", "x":0, "y":1}, + {"label":"Erase Input", "x":1, "y":1}, + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + {"label":"Y", "x":8.75, "y":1}, + {"label":"U", "x":9.75, "y":1}, + {"label":"I", "x":10.75, "y":1}, + {"label":"O", "x":11.75, "y":1}, + {"label":"P", "x":12.75, "y":1}, + {"label":"¢", "x":13.75, "y":1}, + {"label":"\\", "x":14.75, "y":1, "w":1.25}, + {"label":"7", "x":17, "y":1}, + {"label":"8", "x":18, "y":1}, + {"label":"9", "x":19, "y":1}, + {"label":"Field -", "x":20, "y":1}, + {"label":"Print", "x":0, "y":2}, + {"label":"Help", "x":1, "y":2}, + {"label":"Caps Lock", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + {"label":"H", "x":9, "y":2}, + {"label":"J", "x":10, "y":2}, + {"label":"K", "x":11, "y":2}, + {"label":"L", "x":12, "y":2}, + {"label":";", "x":13, "y":2}, + {"label":"'", "x":14, "y":2}, + {"label":"{", "x":15, "y":2}, + {"label":"Field Exit", "x":16, "y":1, "h":2}, + {"label":"4", "x":17, "y":2}, + {"label":"5", "x":18, "y":2}, + {"label":"6", "x":19, "y":2}, + {"label":"Roll Up", "x":0, "y":3}, + {"label":"Roll Down", "x":1, "y":3}, + {"label":"Shift", "x":2.25, "y":3, "w":1.25}, + {"label":"<", "x":3.5, "y":3}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + {"label":"N", "x":9.5, "y":3}, + {"label":"M", "x":10.5, "y":3}, + {"label":",", "x":11.5, "y":3}, + {"label":".", "x":12.5, "y":3}, + {"label":"/", "x":13.5, "y":3}, + {"label":"Shift", "x":14.5, "y":3, "w":1.5}, + {"label":"Return", "x":16, "y":3}, + {"label":"1", "x":17, "y":3}, + {"label":"2", "x":18, "y":3}, + {"label":"3", "x":19, "y":3}, + {"label":"Field +", "x":20, "y":2, "h":3}, + {"label":"Left", "x":0, "y":4}, + {"label":"Right", "x":1, "y":4}, + {"label":"Error Reset", "x":2.25, "y":4, "w":2}, + {"label":"Space", "x":4.25, "y":4, "w":9.75}, + {"label":"Enter Rec Adv", "x":14, "y":4, "w":2}, + {"label":"0", "x":16, "y":4, "w":2}, + {"label":".", "x":18, "y":4, "w":2} + ] + } + } } diff --git a/keyboards/converter/ibm_5291/readme.md b/keyboards/converter/ibm_5291/readme.md index 06ae2e994e..03406d3f9d 100644 --- a/keyboards/converter/ibm_5291/readme.md +++ b/keyboards/converter/ibm_5291/readme.md @@ -1,6 +1,6 @@ # IBM 5291 keyboard converter -![5291](https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard) +[IBM 5291](https://deskthority.net/wiki/IBM_Model_F#IBM_5291_Keyboard) A converter for the eponymous keyboard. @@ -14,7 +14,7 @@ Make example for this keyboard (after setting up your build environment): 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). -the pinout is as follows: +The pinout is as follows: IBM−5291−Cable to Pinhead−14 @@ -35,7 +35,8 @@ IBM−5291−Cable to Pinhead−14 13| Strobe 14| Out -the pins on this connector are organized ![here](https://geekhack.org/index.php?action=dlattach;topic=48950.0;attach=36759;image) +The pins on this connector are organized +![here](https://geekhack.org/index.php?action=dlattach;topic=48950.0;attach=36759;image) IBM−5291−2 Cable with DB15M connector @@ -55,10 +56,11 @@ IBM−5291−2 Cable with DB15M connector |14 | PE |15 | NC -the above connector is actually numbered so it should be easier to determine +The above connector is actually numbered so it should be easier to determine where the needed connections are. -to connect to the teensy, the following are pins are needed (if you should choose not set your own): +To connect to the teensy, the following are pins are needed (if you should choose not set your own): + * PB0 -> PB6 are connected to D0 -> D6 * +5V is connected to the corresponding teensy pin * gnd is as well, only one of the gnd pins needs to be connected though. -- cgit v1.2.3 From ff5fcedb10310538ff8fda7b2bb620966e069b2a Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 14 Dec 2018 22:58:57 -0800 Subject: converter/palm_usb/stowaway: Configurator support (#4655) --- keyboards/converter/palm_usb/stowaway/info.json | 83 +++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 keyboards/converter/palm_usb/stowaway/info.json diff --git a/keyboards/converter/palm_usb/stowaway/info.json b/keyboards/converter/palm_usb/stowaway/info.json new file mode 100644 index 0000000000..8188d14bd8 --- /dev/null +++ b/keyboards/converter/palm_usb/stowaway/info.json @@ -0,0 +1,83 @@ +{ + "keyboard_name": "Palm Stowaway Serial", + "keyboard_folder": "converter/palm_usb/stowaway", + "url": "", + "maintainer": "qmk", + "width": 15.25, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"1", "x":0.5, "y":0}, + {"label":"2", "x":1.5, "y":0}, + {"label":"3", "x":2.5, "y":0}, + {"label":"4", "x":3.5, "y":0}, + {"label":"5", "x":4.5, "y":0}, + {"label":"6", "x":5.5, "y":0}, + {"label":"7", "x":6.5, "y":0}, + {"label":"8", "x":7.5, "y":0}, + {"label":"9", "x":8.5, "y":0}, + {"label":"0", "x":9.5, "y":0}, + {"label":"MINS", "x":10.5, "y":0}, + {"label":"EQL", "x":11.5, "y":0}, + {"label":"BACK", "x":12.5, "y":0, "w":1.5}, + {"label":"APP0", "x":14.25, "y":1, "h":0.6875}, + {"label":"TAB", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"LBRC", "x":11, "y":1}, + {"label":"RBRC", "x":12, "y":1}, + {"label":"BSLS", "x":13, "y":1}, + {"label":"APP1", "x":14.25, "y":1.6875, "h":0.6875}, + {"label":"CAPS", "x":0, "y":2, "w":1.25}, + {"label":"A", "x":1.25, "y":2}, + {"label":"S", "x":2.25, "y":2}, + {"label":"D", "x":3.25, "y":2}, + {"label":"F", "x":4.25, "y":2}, + {"label":"G", "x":5.25, "y":2}, + {"label":"H", "x":6.25, "y":2}, + {"label":"J", "x":7.25, "y":2}, + {"label":"K", "x":8.25, "y":2}, + {"label":"L", "x":9.25, "y":2}, + {"label":"SCLN", "x":10.25, "y":2}, + {"label":"QUOT", "x":11.25, "y":2}, + {"label":"ENT", "x":12.25, "y":2, "w":1.75}, + {"label":"APP2", "x":14.25, "y":2.375, "h":0.6875}, + {"label":"LSFT", "x":0, "y":3, "w":1.75}, + {"label":"Z", "x":1.75, "y":3}, + {"label":"X", "x":2.75, "y":3}, + {"label":"C", "x":3.75, "y":3}, + {"label":"V", "x":4.75, "y":3}, + {"label":"B", "x":5.75, "y":3}, + {"label":"N", "x":6.75, "y":3}, + {"label":"M", "x":7.75, "y":3}, + {"label":"COMM", "x":8.75, "y":3}, + {"label":"DOT", "x":9.75, "y":3}, + {"label":"SLSH", "x":10.75, "y":3}, + {"label":"RSFT", "x":11.75, "y":3, "w":1.25}, + {"label":"UP", "x":13, "y":3}, + {"label":"APP3", "x":14.25, "y":3.0625, "h":0.6875}, + {"label":"LCTL", "x":0, "y":4, "w":1.25}, + {"label":"FN", "x":1.25, "y":4}, + {"label":"LALT", "x":2.25, "y":4}, + {"label":"CMD", "x":3.25, "y":4}, + {"label":"SPACE", "x":4.25, "y":4, "w":3.5}, + {"label":"SPACE/New", "x":7.75, "y":4}, + {"label":"GRAVE", "x":8.75, "y":4}, + {"label":"DONE", "x":9.75, "y":4}, + {"label":"DEL", "x":10.75, "y":4, "w":1.25}, + {"label":"LEFT", "x":12, "y":4}, + {"label":"DOWN", "x":13, "y":4}, + {"label":"RIGHT", "x":14, "y":4} + ] + } + } +} -- cgit v1.2.3 From 11439c432600bae455d546fba0ad7685a2800948 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 15 Dec 2018 07:25:11 -0800 Subject: Configurator support for Sun Type 3 and Type 5 USB converters (#4656) * Sun Type 3 USB converter: Configurator support * Sun Type 5 USB converter: Configurator support --- keyboards/converter/sun_usb/type3/info.json | 109 ++++++++ keyboards/converter/sun_usb/type5/info.json | 381 ++++++++++++++++++++++++++++ 2 files changed, 490 insertions(+) create mode 100644 keyboards/converter/sun_usb/type3/info.json create mode 100644 keyboards/converter/sun_usb/type5/info.json diff --git a/keyboards/converter/sun_usb/type3/info.json b/keyboards/converter/sun_usb/type3/info.json new file mode 100644 index 0000000000..f8525b15cb --- /dev/null +++ b/keyboards/converter/sun_usb/type3/info.json @@ -0,0 +1,109 @@ +{ + "keyboard_name": "Sun Type 3", + "keyboard_folder": "converter/sun_usb/type3", + "url": "", + "maintainer": "qmk", + "width": 21, + "height": 6, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"STOP", "x":0, "y":0}, + {"label":"AGAIN", "x":1, "y":0}, + {"label":"CAPS LOCK", "x":2.5, "y":0}, + {"label":"F2", "x":3.5, "y":0}, + {"label":"F3", "x":4.5, "y":0, "w":2}, + {"label":"F4", "x":6.5, "y":0, "w":2}, + {"label":"F5", "x":8.5, "y":0, "w":2}, + {"label":"F6", "x":10.5, "y":0, "w":2}, + {"label":"F7", "x":12.5, "y":0, "w":2}, + {"label":"F8", "x":14.5, "y":0}, + {"label":"F9", "x":15.5, "y":0}, + {"label":"BACKSPACE", "x":16.5, "y":0}, + {"label":"R1", "x":18, "y":0}, + {"label":"R2", "x":19, "y":0}, + {"label":"R3", "x":20, "y":0}, + {"label":"PROPS", "x":0, "y":1}, + {"label":"UNDO", "x":1, "y":1}, + {"label":"ESC", "x":2.5, "y":1}, + {"label":"1", "x":3.5, "y":1}, + {"label":"2", "x":4.5, "y":1}, + {"label":"3", "x":5.5, "y":1}, + {"label":"4", "x":6.5, "y":1}, + {"label":"5", "x":7.5, "y":1}, + {"label":"6", "x":8.5, "y":1}, + {"label":"7", "x":9.5, "y":1}, + {"label":"8", "x":10.5, "y":1}, + {"label":"9", "x":11.5, "y":1}, + {"label":"0", "x":12.5, "y":1}, + {"label":"MINUS", "x":13.5, "y":1}, + {"label":"EQUAL", "x":14.5, "y":1}, + {"label":"BACKSLASH", "x":15.5, "y":1}, + {"label":"GRAVE", "x":16.5, "y":1}, + {"label":"R4", "x":18, "y":1}, + {"label":"R5", "x":19, "y":1}, + {"label":"R6", "x":20, "y":1}, + {"label":"FRONT", "x":0, "y":2}, + {"label":"COPY", "x":1, "y":2}, + {"label":"TAB", "x":2.5, "y":2, "w":1.5}, + {"label":"Q", "x":4, "y":2}, + {"label":"W", "x":5, "y":2}, + {"label":"E", "x":6, "y":2}, + {"label":"R", "x":7, "y":2}, + {"label":"T", "x":8, "y":2}, + {"label":"Y", "x":9, "y":2}, + {"label":"U", "x":10, "y":2}, + {"label":"I", "x":11, "y":2}, + {"label":"O", "x":12, "y":2}, + {"label":"P", "x":13, "y":2}, + {"label":"LBRACKET", "x":14, "y":2}, + {"label":"RBRACKET", "x":15, "y":2}, + {"label":"DELETE", "x":16, "y":2, "w":1.5}, + {"label":"R7", "x":18, "y":2}, + {"label":"R8", "x":19, "y":2}, + {"label":"R9", "x":20, "y":2}, + {"label":"OPEN", "x":0, "y":3}, + {"label":"PASTE", "x":1, "y":3}, + {"label":"CONTROL", "x":2.5, "y":3, "w":1.75}, + {"label":"A", "x":4.25, "y":3}, + {"label":"S", "x":5.25, "y":3}, + {"label":"D", "x":6.25, "y":3}, + {"label":"F", "x":7.25, "y":3}, + {"label":"G", "x":8.25, "y":3}, + {"label":"H", "x":9.25, "y":3}, + {"label":"J", "x":10.25, "y":3}, + {"label":"K", "x":11.25, "y":3}, + {"label":"L", "x":12.25, "y":3}, + {"label":"SEMICOLON", "x":13.25, "y":3}, + {"label":"QUOTE", "x":14.25, "y":3}, + {"label":"RETURN", "x":15.25, "y":3, "w":2.25}, + {"label":"R10", "x":18, "y":3}, + {"label":"R11", "x":19, "y":3}, + {"label":"R12", "x":20, "y":3}, + {"label":"FIND", "x":0, "y":4}, + {"label":"CUT", "x":1, "y":4}, + {"label":"LSHIFT", "x":2.5, "y":4, "w":2.25}, + {"label":"Z", "x":4.75, "y":4}, + {"label":"X", "x":5.75, "y":4}, + {"label":"C", "x":6.75, "y":4}, + {"label":"V", "x":7.75, "y":4}, + {"label":"B", "x":8.75, "y":4}, + {"label":"N", "x":9.75, "y":4}, + {"label":"M", "x":10.75, "y":4}, + {"label":"COMMA", "x":11.75, "y":4}, + {"label":"PERIOD", "x":12.75, "y":4}, + {"label":"SLASH", "x":13.75, "y":4}, + {"label":"RSHIFT", "x":14.75, "y":4, "w":1.75}, + {"label":"LINE FEED", "x":16.5, "y":4}, + {"label":"R13", "x":18, "y":4}, + {"label":"R14", "x":19, "y":4}, + {"label":"R15", "x":20, "y":4}, + {"label":"CAPS", "x":2.5, "y":5, "w":1.25}, + {"label":"LEFT", "x":3.75, "y":5, "w":1.5}, + {"label":"SPACE", "x":5.25, "y":5, "w":9}, + {"label":"RIGHT", "x":14.25, "y":5, "w":1.5}, + {"label":"ALTERNATE", "x":15.75, "y":5, "w":1.75} + ] + } + } +} diff --git a/keyboards/converter/sun_usb/type5/info.json b/keyboards/converter/sun_usb/type5/info.json new file mode 100644 index 0000000000..6785bbc076 --- /dev/null +++ b/keyboards/converter/sun_usb/type5/info.json @@ -0,0 +1,381 @@ +{ + "keyboard_name": "Sun Type 5", + "keyboard_folder": "converter/sun_usb/type5", + "url": "", + "maintainer": "qmk", + "width": 24.75, + "height": 7, + "layouts": { + "LAYOUT_jp_unix": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"NO", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"ESC", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSLASH", "x":15.25, "y":2}, + {"label":"GRAVE", "x":16.25, "y":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSPACE", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"LCTRL", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"CAPS LOCK", "x":2.25, "y":6}, + {"label":"LALT", "x":3.25, "y":6}, + {"label":"LGUI", "x":4.25, "y":6}, + {"label":"HENKAN", "x":5.25, "y":6, "w":1.5}, + {"label":"SPACE", "x":6.75, "y":6, "w":5}, + {"label":"MUHENKAN", "x":11.75, "y":6, "w":1.5}, + {"label":"KANA", "x":13.25, "y":6}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + }, + "LAYOUT_us_unix": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"NO", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"ESC", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSLASH", "x":15.25, "y":2}, + {"label":"GRAVE", "x":16.25, "y":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSPACE", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"LCTRL", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"CAPS LOCK", "x":2.25, "y":6, "w":1.75}, + {"label":"LALT", "x":4, "y":6}, + {"label":"LGUI", "x":5, "y":6}, + {"label":"SPACE", "x":6, "y":6, "w":8.25}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + }, + "LAYOUT_ansi": { + "layout": [ + {"label":"HELP", "x":0, "y":0, "w":2}, + {"label":"ESC", "x":2.25, "y":0}, + {"label":"F1", "x":4.25, "y":0}, + {"label":"F2", "x":5.25, "y":0}, + {"label":"F3", "x":6.25, "y":0}, + {"label":"F4", "x":7.25, "y":0}, + {"label":"F5", "x":8.75, "y":0}, + {"label":"F6", "x":9.75, "y":0}, + {"label":"F7", "x":10.75, "y":0}, + {"label":"F8", "x":11.75, "y":0}, + {"label":"F9", "x":13.25, "y":0}, + {"label":"F10", "x":14.25, "y":0}, + {"label":"F11", "x":15.25, "y":0}, + {"label":"F12", "x":16.25, "y":0}, + {"label":"PRINT SCREEN", "x":17.5, "y":0}, + {"label":"SCROLL LOCK", "x":18.5, "y":0}, + {"label":"PAUSE", "x":19.5, "y":0}, + {"label":"MUTE", "x":20.75, "y":0}, + {"label":"VOLD", "x":21.75, "y":0}, + {"label":"VOLU", "x":22.75, "y":0}, + {"label":"PWR", "x":23.75, "y":0}, + {"label":"STOP", "x":0, "y":2}, + {"label":"AGAIN", "x":1, "y":2}, + {"label":"GRAVE", "x":2.25, "y":2}, + {"label":"1", "x":3.25, "y":2}, + {"label":"2", "x":4.25, "y":2}, + {"label":"3", "x":5.25, "y":2}, + {"label":"4", "x":6.25, "y":2}, + {"label":"5", "x":7.25, "y":2}, + {"label":"6", "x":8.25, "y":2}, + {"label":"7", "x":9.25, "y":2}, + {"label":"8", "x":10.25, "y":2}, + {"label":"9", "x":11.25, "y":2}, + {"label":"0", "x":12.25, "y":2}, + {"label":"MINUS", "x":13.25, "y":2}, + {"label":"EQUAL", "x":14.25, "y":2}, + {"label":"BACKSPACE", "x":15.25, "y":2, "w":2}, + {"label":"INSERT", "x":17.5, "y":2}, + {"label":"HOME", "x":18.5, "y":2}, + {"label":"PAGE UP", "x":19.5, "y":2}, + {"label":"NUM LOCK", "x":20.75, "y":2}, + {"label":"PSLASH", "x":21.75, "y":2}, + {"label":"PASTERISK", "x":22.75, "y":2}, + {"label":"PMINUS", "x":23.75, "y":2}, + {"label":"MENU", "x":0, "y":3}, + {"label":"UNDO", "x":1, "y":3}, + {"label":"TAB", "x":2.25, "y":3, "w":1.5}, + {"label":"Q", "x":3.75, "y":3}, + {"label":"W", "x":4.75, "y":3}, + {"label":"E", "x":5.75, "y":3}, + {"label":"R", "x":6.75, "y":3}, + {"label":"T", "x":7.75, "y":3}, + {"label":"Y", "x":8.75, "y":3}, + {"label":"U", "x":9.75, "y":3}, + {"label":"I", "x":10.75, "y":3}, + {"label":"O", "x":11.75, "y":3}, + {"label":"P", "x":12.75, "y":3}, + {"label":"LBRACKET", "x":13.75, "y":3}, + {"label":"RBRACKET", "x":14.75, "y":3}, + {"label":"BACKSLASH", "x":15.75, "y":3, "w":1.5}, + {"label":"DELETE", "x":17.5, "y":3}, + {"label":"END", "x":18.5, "y":3}, + {"label":"PAGE DOWN", "x":19.5, "y":3}, + {"label":"P7", "x":20.75, "y":3}, + {"label":"P8", "x":21.75, "y":3}, + {"label":"P9", "x":22.75, "y":3}, + {"label":"PPLUS", "x":23.75, "y":3, "h":2}, + {"label":"SELECT", "x":0, "y":4}, + {"label":"COPY", "x":1, "y":4}, + {"label":"CAPS LOCK", "x":2.25, "y":4, "w":1.75}, + {"label":"A", "x":4, "y":4}, + {"label":"S", "x":5, "y":4}, + {"label":"D", "x":6, "y":4}, + {"label":"F", "x":7, "y":4}, + {"label":"G", "x":8, "y":4}, + {"label":"H", "x":9, "y":4}, + {"label":"J", "x":10, "y":4}, + {"label":"K", "x":11, "y":4}, + {"label":"L", "x":12, "y":4}, + {"label":"SEMICOLON", "x":13, "y":4}, + {"label":"QUOTE", "x":14, "y":4}, + {"label":"ENTER", "x":15, "y":4, "w":2.25}, + {"label":"P4", "x":20.75, "y":4}, + {"label":"P5", "x":21.75, "y":4}, + {"label":"P6", "x":22.75, "y":4}, + {"label":"EXECUTE", "x":0, "y":5}, + {"label":"PASTE", "x":1, "y":5}, + {"label":"LSHIFT", "x":2.25, "y":5, "w":2.25}, + {"label":"Z", "x":4.5, "y":5}, + {"label":"X", "x":5.5, "y":5}, + {"label":"C", "x":6.5, "y":5}, + {"label":"V", "x":7.5, "y":5}, + {"label":"B", "x":8.5, "y":5}, + {"label":"N", "x":9.5, "y":5}, + {"label":"M", "x":10.5, "y":5}, + {"label":"COMMA", "x":11.5, "y":5}, + {"label":"PERIOD", "x":12.5, "y":5}, + {"label":"SLASH", "x":13.5, "y":5}, + {"label":"RSHIFT", "x":14.5, "y":5, "w":2.75}, + {"label":"UP", "x":18.5, "y":5}, + {"label":"P1", "x":20.75, "y":5}, + {"label":"P2", "x":21.75, "y":5}, + {"label":"P3", "x":22.75, "y":5}, + {"label":"PENTER", "x":23.75, "y":5, "h":2}, + {"label":"FIND", "x":0, "y":6}, + {"label":"CUT", "x":1, "y":6}, + {"label":"LCTRL", "x":2.25, "y":6, "w":1.75}, + {"label":"LALT", "x":4, "y":6}, + {"label":"LGUI", "x":5, "y":6}, + {"label":"SPACE", "x":6, "y":6, "w":8.25}, + {"label":"RGUI", "x":14.25, "y":6}, + {"label":"APP", "x":15.25, "y":6}, + {"label":"RALT", "x":16.25, "y":6}, + {"label":"LEFT", "x":17.5, "y":6}, + {"label":"DOWN", "x":18.5, "y":6}, + {"label":"RIGHT", "x":19.5, "y":6}, + {"label":"P0", "x":20.75, "y":6, "w":2}, + {"label":"PDOT", "x":22.75, "y":6} + ] + } + } +} -- cgit v1.2.3 From 72bd17f2902c82ef84b9134433facb21ad696fbb Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 15 Dec 2018 07:25:29 -0800 Subject: converter/xt_usb: Configurator support (#4657) --- keyboards/converter/xt_usb/info.json | 229 +++++++++++++++++++++++++++++++++++ 1 file changed, 229 insertions(+) create mode 100644 keyboards/converter/xt_usb/info.json diff --git a/keyboards/converter/xt_usb/info.json b/keyboards/converter/xt_usb/info.json new file mode 100644 index 0000000000..1fde77d1f9 --- /dev/null +++ b/keyboards/converter/xt_usb/info.json @@ -0,0 +1,229 @@ +{ + "keyboard_name": "IBM PC XT", + "keyboard_folder": "converter/xt_usb", + "url": "", + "maintainer": "qmk", + "width": 21, + "height": 5, + "layouts": { + "LAYOUT_xt": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"Esc", "x":2.25, "y":0}, + {"label":"1", "x":3.25, "y":0}, + {"label":"2", "x":4.25, "y":0}, + {"label":"3", "x":5.25, "y":0}, + {"label":"4", "x":6.25, "y":0}, + {"label":"5", "x":7.25, "y":0}, + {"label":"6", "x":8.25, "y":0}, + {"label":"7", "x":9.25, "y":0}, + {"label":"8", "x":10.25, "y":0}, + {"label":"9", "x":11.25, "y":0}, + {"label":"0", "x":12.25, "y":0}, + {"label":"-", "x":13.25, "y":0}, + {"label":"=", "x":14.25, "y":0}, + {"label":"Backspace", "x":15.25, "y":0, "w":1.75}, + {"label":"Num Lock", "x":17, "y":0, "w":2}, + {"label":"Scroll Lock", "x":19, "y":0, "w":2}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"Tab", "x":2.25, "y":1, "w":1.5}, + {"label":"Q", "x":3.75, "y":1}, + {"label":"W", "x":4.75, "y":1}, + {"label":"E", "x":5.75, "y":1}, + {"label":"R", "x":6.75, "y":1}, + {"label":"T", "x":7.75, "y":1}, + {"label":"Y", "x":8.75, "y":1}, + {"label":"U", "x":9.75, "y":1}, + {"label":"I", "x":10.75, "y":1}, + {"label":"O", "x":11.75, "y":1}, + {"label":"P", "x":12.75, "y":1}, + {"label":"[", "x":13.75, "y":1}, + {"label":"]", "x":14.75, "y":1}, + {"label":"7", "x":17, "y":1}, + {"label":"8", "x":18, "y":1}, + {"label":"9", "x":19, "y":1}, + {"label":"-", "x":20, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"Ctrl", "x":2.25, "y":2, "w":1.75}, + {"label":"A", "x":4, "y":2}, + {"label":"S", "x":5, "y":2}, + {"label":"D", "x":6, "y":2}, + {"label":"F", "x":7, "y":2}, + {"label":"G", "x":8, "y":2}, + {"label":"H", "x":9, "y":2}, + {"label":"J", "x":10, "y":2}, + {"label":"K", "x":11, "y":2}, + {"label":"L", "x":12, "y":2}, + {"label":";", "x":13, "y":2}, + {"label":"'", "x":14, "y":2}, + {"label":"`", "x":15, "y":2}, + {"label":"Enter", "x":16, "y":1, "h":2}, + {"label":"4", "x":17, "y":2}, + {"label":"5", "x":18, "y":2}, + {"label":"6", "x":19, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"Shift", "x":2.25, "y":3, "w":1.25}, + {"label":"\\", "x":3.5, "y":3}, + {"label":"Z", "x":4.5, "y":3}, + {"label":"X", "x":5.5, "y":3}, + {"label":"C", "x":6.5, "y":3}, + {"label":"V", "x":7.5, "y":3}, + {"label":"B", "x":8.5, "y":3}, + {"label":"N", "x":9.5, "y":3}, + {"label":"M", "x":10.5, "y":3}, + {"label":",", "x":11.5, "y":3}, + {"label":".", "x":12.5, "y":3}, + {"label":"/", "x":13.5, "y":3}, + {"label":"Shift", "x":14.5, "y":3, "w":1.5}, + {"label":"Print Screen", "x":16, "y":3}, + {"label":"1", "x":17, "y":3}, + {"label":"2", "x":18, "y":3}, + {"label":"3", "x":19, "y":3}, + {"label":"+", "x":20, "y":2, "h":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"Alt", "x":2.25, "y":4, "w":2}, + {"label":"Space", "x":4.25, "y":4, "w":9.75}, + {"label":"Caps Lock", "x":14, "y":4, "w":2}, + {"label":"0", "x":16, "y":4, "w":2}, + {"label":".", "x":18, "y":4, "w":2} + ] + }, + "LAYOUT": { + "layout": [ + {"label":"F13", "x":2, "y":0}, + {"label":"F14", "x":3, "y":0}, + {"label":"F15", "x":4, "y":0}, + {"label":"F16", "x":5, "y":0}, + {"label":"F17", "x":6, "y":0}, + {"label":"F18", "x":7, "y":0}, + {"label":"F19", "x":8, "y":0}, + {"label":"F20", "x":9, "y":0}, + {"label":"F21", "x":10, "y":0}, + {"label":"F22", "x":11, "y":0}, + {"label":"F23", "x":12, "y":0}, + {"label":"F24", "x":13, "y":0}, + {"label":"Esc", "x":0, "y":1}, + {"label":"F1", "x":2, "y":1}, + {"label":"F2", "x":3, "y":1}, + {"label":"F3", "x":4, "y":1}, + {"label":"F4", "x":5, "y":1}, + {"label":"F5", "x":6, "y":1}, + {"label":"F6", "x":7, "y":1}, + {"label":"F7", "x":8, "y":1}, + {"label":"F8", "x":9, "y":1}, + {"label":"F9", "x":10, "y":1}, + {"label":"F10", "x":11, "y":1}, + {"label":"F11", "x":12, "y":1}, + {"label":"F12", "x":13, "y":1}, + {"label":"Print Screen", "x":15.25, "y":1}, + {"label":"Scroll Lock", "x":16.25, "y":1}, + {"label":"Pause", "x":17.25, "y":1}, + {"label":"Volume Down", "x":19.5, "y":1}, + {"label":"Volume Up", "x":20.5, "y":1}, + {"label":"Mute", "x":21.5, "y":1}, + {"label":"`", "x":0, "y":2.5}, + {"label":"1", "x":1, "y":2.5}, + {"label":"2", "x":2, "y":2.5}, + {"label":"3", "x":3, "y":2.5}, + {"label":"4", "x":4, "y":2.5}, + {"label":"5", "x":5, "y":2.5}, + {"label":"6", "x":6, "y":2.5}, + {"label":"7", "x":7, "y":2.5}, + {"label":"8", "x":8, "y":2.5}, + {"label":"9", "x":9, "y":2.5}, + {"label":"0", "x":10, "y":2.5}, + {"label":"-", "x":11, "y":2.5}, + {"label":"=", "x":12, "y":2.5}, + {"label":"JP Yen", "x":13, "y":2.5}, + {"label":"Back Space", "x":14, "y":2.5}, + {"label":"Insert", "x":15.25, "y":2.5}, + {"label":"Home", "x":16.25, "y":2.5}, + {"label":"Page Up", "x":17.25, "y":2.5}, + {"label":"Num Lock", "x":18.5, "y":2.5}, + {"label":"KP/", "x":19.5, "y":2.5}, + {"label":"KP*", "x":20.5, "y":2.5}, + {"label":"KP-", "x":21.5, "y":2.5}, + {"label":"Tab", "x":0, "y":3.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":3.5}, + {"label":"W", "x":2.5, "y":3.5}, + {"label":"E", "x":3.5, "y":3.5}, + {"label":"R", "x":4.5, "y":3.5}, + {"label":"T", "x":5.5, "y":3.5}, + {"label":"Y", "x":6.5, "y":3.5}, + {"label":"U", "x":7.5, "y":3.5}, + {"label":"I", "x":8.5, "y":3.5}, + {"label":"O", "x":9.5, "y":3.5}, + {"label":"P", "x":10.5, "y":3.5}, + {"label":"[", "x":11.5, "y":3.5}, + {"label":"]", "x":12.5, "y":3.5}, + {"label":"\\", "x":13.5, "y":3.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":3.5}, + {"label":"End", "x":16.25, "y":3.5}, + {"label":"Page Down", "x":17.25, "y":3.5}, + {"label":"KP 7", "x":18.5, "y":3.5}, + {"label":"KP 8", "x":19.5, "y":3.5}, + {"label":"KP 9", "x":20.5, "y":3.5}, + {"label":"KP+", "x":21.5, "y":3.5}, + {"label":"Caps Lock", "x":0, "y":4.5, "w":1.75}, + {"label":"A", "x":1.75, "y":4.5}, + {"label":"S", "x":2.75, "y":4.5}, + {"label":"D", "x":3.75, "y":4.5}, + {"label":"F", "x":4.75, "y":4.5}, + {"label":"G", "x":5.75, "y":4.5}, + {"label":"H", "x":6.75, "y":4.5}, + {"label":"J", "x":7.75, "y":4.5}, + {"label":"K", "x":8.75, "y":4.5}, + {"label":"L", "x":9.75, "y":4.5}, + {"label":";", "x":10.75, "y":4.5}, + {"label":"'", "x":11.75, "y":4.5}, + {"label":"ISO #", "x":12.75, "y":4.5}, + {"label":"Enter", "x":13.75, "y":4.5, "w":1.25}, + {"label":"KP 4", "x":18.5, "y":4.5}, + {"label":"KP 5", "x":19.5, "y":4.5}, + {"label":"KP 6", "x":20.5, "y":4.5}, + {"label":"KP ,", "x":21.5, "y":4.5}, + {"label":"Shift", "x":0, "y":5.5, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":5.5}, + {"label":"Z", "x":2.25, "y":5.5}, + {"label":"X", "x":3.25, "y":5.5}, + {"label":"C", "x":4.25, "y":5.5}, + {"label":"V", "x":5.25, "y":5.5}, + {"label":"B", "x":6.25, "y":5.5}, + {"label":"N", "x":7.25, "y":5.5}, + {"label":"M", "x":8.25, "y":5.5}, + {"label":",", "x":9.25, "y":5.5}, + {"label":".", "x":10.25, "y":5.5}, + {"label":"/", "x":11.25, "y":5.5}, + {"label":"JP RO", "x":12.25, "y":5.5}, + {"label":"Shift", "x":13.25, "y":5.5, "w":1.75}, + {"label":"Up", "x":16.25, "y":5.5}, + {"label":"KP 1", "x":18.5, "y":5.5}, + {"label":"KP 2", "x":19.5, "y":5.5}, + {"label":"KP 3", "x":20.5, "y":5.5}, + {"label":"KP Enter", "x":21.5, "y":5.5}, + {"label":"Ctrl", "x":0, "y":6.5, "w":1.25}, + {"label":"GUI", "x":1.25, "y":6.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":6.5, "w":1.25}, + {"label":"Muhenkan", "x":3.75, "y":6.5, "w":1.25}, + {"label":"Space", "x":5, "y":6.5, "w":3.25}, + {"label":"Henkan", "x":8.25, "y":6.5, "w":1.25}, + {"label":"Kana", "x":9.5, "y":6.5, "w":1.25}, + {"label":"Alt", "x":10.75, "y":6.5}, + {"label":"GUI", "x":11.75, "y":6.5}, + {"label":"Menu", "x":12.75, "y":6.5}, + {"label":"Ctrl", "x":13.75, "y":6.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":6.5}, + {"label":"Down", "x":16.25, "y":6.5}, + {"label":"Right", "x":17.25, "y":6.5}, + {"label":"KP 0", "x":18.5, "y":6.5, "w":2}, + {"label":"KP .", "x":20.5, "y":6.5}, + {"label":"KP =", "x":21.5, "y":6.5} + ] + } + } +} -- cgit v1.2.3 From 3ec4a00bfc090fc440480336e3273b459074aa18 Mon Sep 17 00:00:00 2001 From: Alexander Kagno Date: Sat, 15 Dec 2018 08:29:24 -0700 Subject: Per Key Leader Timing Option (#4026) * leader changes to enable per key timing option * Changes requested to docs for @drashna * Changes requested by @drashna --- docs/config_options.md | 6 +++++- docs/feature_leader_key.md | 23 +++++++++++++++++++++++ quantum/process_keycode/process_leader.c | 6 ++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/docs/config_options.md b/docs/config_options.md index bea4acb010..fb1655e9a3 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -143,6 +143,8 @@ If you define these options you will enable the associated feature, which may in * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out +* `#define LEADER_PER_KEY_TIMING` + * sets the timer for leader key chords to run on each key press rather than overall * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` @@ -194,7 +196,7 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define SPLIT_HAND_PIN B7` * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. - + * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) @@ -252,6 +254,8 @@ Use these to enable or disable building certain features. The more you have enab * Enable the audio subsystem. * `RGBLIGHT_ENABLE` * Enable keyboard underlight functionality +* `LEADER_ENABLE` + * Enable leader key chording * `MIDI_ENABLE` * MIDI controls * `UNICODE_ENABLE` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 92aebd463d..9b49e0fd96 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -47,3 +47,26 @@ To add support for Leader Key you simply need to add a single line to your keyma ``` LEADER_ENABLE = yes ``` + +## Per Key Timing on Leader keys + +Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). + +In order to enable this, place this in your `config.h`: +``` +#define LEADER_PER_KEY_TIMING +``` + +After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. + +``` +#define LEADER_TIMEOUT 250 +``` + +Now, something like this won't seem impossible to do without a 1000MS leader key timeout: + +``` +SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { + SEND_STRING("Per key timing is great!!!"); +} +``` diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index eddbf71f70..b32fc1db6a 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -38,9 +38,15 @@ uint8_t leader_sequence_size = 0; bool process_leader(uint16_t keycode, keyrecord_t *record) { // Leader key set-up if (record->event.pressed) { +#ifdef LEADER_PER_KEY_TIMING + leader_time = timer_read(); +#endif if (!leading && keycode == KC_LEAD) { leader_start(); leading = true; +#ifndef LEADER_PER_KEY_TIMING + leader_time = timer_read(); +#endif leader_time = timer_read(); leader_sequence_size = 0; leader_sequence[0] = 0; -- cgit v1.2.3 From 6172e55489b225f874125e801ca4b3d5a956f781 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 15 Dec 2018 13:39:05 -0800 Subject: Ergo42: Configurator patch (#4664) Wasn't rendering in Configurator as intended. Updated JSON data to use alias name instead of macro name. --- keyboards/ergo42/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/ergo42/info.json b/keyboards/ergo42/info.json index 6489e25a80..cac5a46a14 100644 --- a/keyboards/ergo42/info.json +++ b/keyboards/ergo42/info.json @@ -5,7 +5,7 @@ "width": 15, "height": 4, "layouts": { - "LAYOUT_ortho_4x14": { + "LAYOUT": { "key_count": 56, "layout": [{"label":"L00", "x":0, "y":0}, {"label":"L01", "x":1, "y":0}, {"label":"L02", "x":2, "y":0}, {"label":"L03", "x":3, "y":0}, {"label":"L04", "x":4, "y":0}, {"label":"L05", "x":5, "y":0}, {"label":"L06", "x":6, "y":0}, {"label":"R00", "x":8, "y":0}, {"label":"R01", "x":9, "y":0}, {"label":"R02", "x":10, "y":0}, {"label":"R03", "x":11, "y":0}, {"label":"R04", "x":12, "y":0}, {"label":"R05", "x":13, "y":0}, {"label":"R06", "x":14, "y":0}, {"label":"L10", "x":0, "y":1}, {"label":"L11", "x":1, "y":1}, {"label":"L12", "x":2, "y":1}, {"label":"L13", "x":3, "y":1}, {"label":"L14", "x":4, "y":1}, {"label":"L15", "x":5, "y":1}, {"label":"L16", "x":6, "y":1}, {"label":"R10", "x":8, "y":1}, {"label":"R11", "x":9, "y":1}, {"label":"R12", "x":10, "y":1}, {"label":"R13", "x":11, "y":1}, {"label":"R14", "x":12, "y":1}, {"label":"R15", "x":13, "y":1}, {"label":"R16", "x":14, "y":1}, {"label":"L20", "x":0, "y":2}, {"label":"L21", "x":1, "y":2}, {"label":"L22", "x":2, "y":2}, {"label":"L23", "x":3, "y":2}, {"label":"L24", "x":4, "y":2}, {"label":"L25", "x":5, "y":2}, {"label":"L26", "x":6, "y":2}, {"label":"R20", "x":8, "y":2}, {"label":"R21", "x":9, "y":2}, {"label":"R22", "x":10, "y":2}, {"label":"R23", "x":11, "y":2}, {"label":"R24", "x":12, "y":2}, {"label":"R25", "x":13, "y":2}, {"label":"R26", "x":14, "y":2}, {"label":"L30", "x":0, "y":3}, {"label":"L31", "x":1, "y":3}, {"label":"L32", "x":2, "y":3}, {"label":"L33", "x":3, "y":3}, {"label":"L34", "x":4, "y":3}, {"label":"L35", "x":5, "y":3}, {"label":"L36", "x":6, "y":3}, {"label":"R30", "x":8, "y":3}, {"label":"R31", "x":9, "y":3}, {"label":"R32", "x":10, "y":3}, {"label":"R33", "x":11, "y":3}, {"label":"R34", "x":12, "y":3}, {"label":"R35", "x":13, "y":3}, {"label":"R36", "x":14, "y":3}] } -- cgit v1.2.3 From 5ec327ad9974145e209146825e966aaf4a15d32d Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 15 Dec 2018 13:39:34 -0800 Subject: Cospad Configurator and readme update (#4663) * Cospad: Configurator update - added LAYOUT_gamepad_6x4 data - renders as 4 rows by 6 columns visually - fixed LAYOUT_numpad_6x4 data - JSON objects were in the wrong order * Cospad: readme update - markdown formatting fixes - made Hardware Availability address a hyperlink - updated Docs links --- keyboards/cospad/info.json | 77 ++++++++++++++++++++++++++++++++++++++-------- keyboards/cospad/readme.md | 6 ++-- 2 files changed, 67 insertions(+), 16 deletions(-) diff --git a/keyboards/cospad/info.json b/keyboards/cospad/info.json index 4fd2ea087f..b34013a47a 100644 --- a/keyboards/cospad/info.json +++ b/keyboards/cospad/info.json @@ -1,16 +1,67 @@ { - "keyboard_name": "", - "url": "", - "maintainer": "qmk", - "width": 4, - "height": 6, - "layouts": { - "LAYOUT_numpad_6x4": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2, "h":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4, "h":2}, {"label":"0", "x":0, "y":5, "w":2}, {"label":".", "x":2, "y":5}] - }, + "keyboard_name": "Cospad", + "keyboard_folder": "cospad", + "url": "", + "maintainer": "qmk", + "width": 4, + "height": 6, + "layouts": { + "LAYOUT_numpad_6x4": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"Tab", "x":1, "y":0}, + {"label":"Fn", "x":2, "y":0}, + {"label":"Back", "x":3, "y":0}, + {"label":"Num Lock", "x":0, "y":1}, + {"label":"/", "x":1, "y":1}, + {"label":"*", "x":2, "y":1}, + {"label":"-", "x":3, "y":1}, + {"label":"7", "x":0, "y":2}, + {"label":"8", "x":1, "y":2}, + {"label":"9", "x":2, "y":2}, + {"label":"4", "x":0, "y":3}, + {"label":"5", "x":1, "y":3}, + {"label":"6", "x":2, "y":3}, + {"label":"+", "x":3, "y":2, "h":2}, + {"label":"1", "x":0, "y":4}, + {"label":"2", "x":1, "y":4}, + {"label":"3", "x":2, "y":4}, + {"label":"0", "x":0, "y":5, "w":2}, + {"label":".", "x":2, "y":5}, + {"label":"Enter", "x":3, "y":4, "h":2} + ] + }, - "LAYOUT_ortho_6x4": { - "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}] - } + "LAYOUT_gamepad_6x4": { + "layout": [ + {"label":"k00", "x":5, "y":0}, + {"label":"k01", "x":5, "y":1}, + {"label":"k02", "x":5, "y":2}, + {"label":"k03", "x":5, "y":3}, + {"label":"k10", "x":4, "y":0}, + {"label":"k11", "x":4, "y":1}, + {"label":"k12", "x":4, "y":2}, + {"label":"k13", "x":4, "y":3}, + {"label":"k20", "x":3, "y":0}, + {"label":"k21", "x":3, "y":1}, + {"label":"k22", "x":3, "y":2}, + {"label":"k30", "x":2, "y":0}, + {"label":"k31", "x":2, "y":1}, + {"label":"k32", "x":2, "y":2}, + {"label":"k23", "x":2, "y":3, "w":2}, + {"label":"k40", "x":1, "y":0}, + {"label":"k41", "x":1, "y":1}, + {"label":"k42", "x":1, "y":2}, + {"label":"k43", "x":1, "y":3}, + {"label":"k50", "x":0, "y":0}, + {"label":"k51", "x":0, "y":1}, + {"label":"k52", "x":0, "y":2}, + {"label":"k53", "x":0, "y":3} + ] + }, + + "LAYOUT_ortho_6x4": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"Tab", "x":1, "y":0}, {"label":"Fn", "x":2, "y":0}, {"label":"Back", "x":3, "y":0}, {"label":"Num Lock", "x":0, "y":1}, {"label":"/", "x":1, "y":1}, {"label":"*", "x":2, "y":1}, {"label":"-", "x":3, "y":1}, {"label":"7", "x":0, "y":2}, {"label":"8", "x":1, "y":2}, {"label":"9", "x":2, "y":2}, {"label":"+", "x":3, "y":2}, {"label":"4", "x":0, "y":3}, {"label":"5", "x":1, "y":3}, {"label":"6", "x":2, "y":3}, {"x":3, "y":3}, {"label":"1", "x":0, "y":4}, {"label":"2", "x":1, "y":4}, {"label":"3", "x":2, "y":4}, {"label":"Enter", "x":3, "y":4}, {"label":"0", "x":0, "y":5}, {"x":1, "y":5}, {"label":".", "x":2, "y":5}, {"x":3, "y":5}] } -} \ No newline at end of file + } +} diff --git a/keyboards/cospad/readme.md b/keyboards/cospad/readme.md index 436b87dcee..2e9add691f 100644 --- a/keyboards/cospad/readme.md +++ b/keyboards/cospad/readme.md @@ -4,8 +4,8 @@ COSPAD A DIY Keypad Kit sold by KPRepublic, runs TKG natively. Keyboard Maintainer: QMK Community -Hardware Supported: COSPAD -Hardware Availability: https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html +Hardware Supported: COSPAD +Hardware Availability: [KPrepublic on Aliexpress](https://aliexpress.com/item/cospad-Custom-Mechanical-Keyboard-Kit-up-tp-24-keys-Supports-TKG-TOOLS-Underglow-RGB-PCB-20/32818383873.html) Only supports on and off for the backlight leds, as they are not connected to a PWM pin. @@ -18,4 +18,4 @@ Make example for this keyboard (after setting up your build environment): make cospad:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From 398204b2a03bdac68fccb6f7592ed3ea52741ce5 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 16 Dec 2018 00:40:46 -0800 Subject: EKeyboard: ErgoInu Configurator fix (#4665) * ErgoInu: Configurator update, part 1 Give each key its own line to make the file easier to debug. * ErgoInu: Configurator update, part 2 - converted all JSON variables to lowercase (this was the bugfix) - converted Tabs to Spaces * ErgoInu: Configurator update, part 3 - break key data into chunks * ErgoInu: Configurator update, part 4 Rebuilt the layout tree into a new file, taking the Y values from the original data. Copied relevant data from original file into the new file, and then overwrote the original file. --- keyboards/ergoinu/info.json | 83 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 75 insertions(+), 8 deletions(-) diff --git a/keyboards/ergoinu/info.json b/keyboards/ergoinu/info.json index f85447913c..81f53fd255 100644 --- a/keyboards/ergoinu/info.json +++ b/keyboards/ergoinu/info.json @@ -2,18 +2,85 @@ "keyboard_name": "Ergoinu", "url": "", "maintainer": "hsgw", - "width": 17, - "height": 6.75, + "width": 18, + "height": 5.4, "layouts": { "LAYOUT": { "key_count": 64, "layout": [ - {"x": 0, "y": 0.6}, {"x": 1, "y": 0.4}, {"x": 2, "y": 0.4}, {"x": 3, "y": 0.25}, {"x": 4, "y": 0}, {"x": 5, "y": 0.25}, {"x": 6, "y": 0.4}, {"x": 10, "y": 0.4}, {"x": 11, "y": 0.25}, {"x": 12, "y": 0}, {"x": 13, "y": 0.25}, {"x": 14, "y": 0.4}, {"x": 15, "y": 0.4}, {"x": 16, "y": 0.6}, - {"x": 0, "y": 1.6}, {"x": 1, "y": 1.4}, {"x": 2, "y": 1.4}, {"x": 3, "y": 1.25}, {"x": 4, "y": 1}, {"x": 5, "y": 1.25}, {"x": 6, "y": 1.4}, {"x": 10, "y": 1.4}, {"x": 11, "y": 1.25}, {"x": 12, "y": 1}, {"x": 13, "y": 1.25}, {"x": 14, "y": 1.4}, {"x": 15, "y": 1.4}, {"x": 16, "y": 1.6}, - {"x": 0.25, "y": 2.6, "W":1.75}, {"x": 2, "y": 2.4}, {"x": 3, "y": 2.25}, {"x": 4, "y": 2}, {"x": 5, "y": 2.25}, {"x": 6, "y": 2.4}, {"x": 10, "y": 2.4}, {"x": 11, "y": 2.25}, {"x": 12, "y": 2}, {"x": 13, "y": 2.25}, {"x": 14, "y": 2.4}, {"x": 15, "y": 2.4}, {"x": 16, "y": 2.6}, - {"x": 0.25, "y": 3.6, "W":1.75}, {"x": 2, "y": 3.4}, {"x": 3, "y": 3.25}, {"x": 4, "y": 3}, {"x": 5, "y": 3.25}, {"x": 6, "y": 3.4}, {"x": 10, "y": 3.4}, {"x": 11, "y": 3.25}, {"x": 12, "y": 3}, {"x": 13, "y": 3.25}, {"x": 14, "y": 3.4}, {"x": 15, "y": 3.4}, {"x": 16, "y": 3.6}, - {"x": 3, "y": 4.25}, {"x": 4, "y": 4}, {"x": 5, "y": 4.25}, {"x": 6, "y": 4.4}, {"X":7.5, "Y":4.4, "H":1.25,"R":30, "RX":6, "RY":4.4}, - {"X":8.25, "Y":4.4, "H":1.25,"R":-30, "RX":11, "RY":4.4}, {"x": 10, "y": 4.4}, {"x": 11, "y": 4.25}, {"x": 12, "y": 4}, {"x": 13, "y": 4.4} + { "x": 0, "y": 0.6, "label": "ESC" }, + { "x": 1, "y": 0.4, "label": "1" }, + { "x": 2, "y": 0.4, "label": "2" }, + { "x": 3, "y": 0.25, "label": "3" }, + { "x": 4, "y": 0, "label": "4" }, + { "x": 5, "y": 0.25, "label": "5" }, + { "x": 6, "y": 0.4, "label": "6" }, + + { "x": 11, "y": 0.4, "label": "7" }, + { "x": 12, "y": 0.25, "label": "8" }, + { "x": 13, "y": 0, "label": "9" }, + { "x": 14, "y": 0.25, "label": "0" }, + { "x": 15, "y": 0.4, "label": "MINUS" }, + { "x": 16, "y": 0.4, "label": "EQUAL" }, + { "x": 17, "y": 0.6, "label": "BACKSLASH" }, + + { "x": 0, "y": 1.6, "label": "DELETE" }, + { "x": 1, "y": 1.4, "label": "TAB" }, + { "x": 2, "y": 1.4, "label": "Q" }, + { "x": 3, "y": 1.25, "label": "W" }, + { "x": 4, "y": 1, "label": "E" }, + { "x": 5, "y": 1.25, "label": "R" }, + { "x": 6, "y": 1.4, "label": "T" }, + + { "x": 11, "y": 1.4, "label": "Y" }, + { "x": 12, "y": 1.25, "label": "U" }, + { "x": 13, "y": 1, "label": "I" }, + { "x": 14, "y": 1.25, "label": "O" }, + { "x": 15, "y": 1.4, "label": "P" }, + { "x": 16, "y": 1.4, "label": "LBRACKET" }, + { "x": 17, "y": 1.6, "label": "RBRACKET" }, + + { "x": 0.25, "y": 2.6, "w": 1.75, "label": "LCTRL" }, + { "x": 2, "y": 2.4, "label": "A" }, + { "x": 3, "y": 2.25, "label": "S" }, + { "x": 4, "y": 2, "label": "D" }, + { "x": 5, "y": 2.25, "label": "F" }, + { "x": 6, "y": 2.4, "label": "G" }, + + { "x": 11, "y": 2.4, "label": "H" }, + { "x": 12, "y": 2.25, "label": "J" }, + { "x": 13, "y": 2, "label": "K" }, + { "x": 14, "y": 2.25, "label": "L" }, + { "x": 15, "y": 2.4, "label": "SEMICOLON" }, + { "x": 16, "y": 2.4, "label": "QUOTE" }, + { "x": 17, "y": 2.6, "label": "GRAVE" }, + + { "x": 0.25, "y": 3.6, "w": 1.75, "label": "LSHIFT" }, + { "x": 2, "y": 3.4, "label": "Z" }, + { "x": 3, "y": 3.25, "label": "X" }, + { "x": 4, "y": 3, "label": "C" }, + { "x": 5, "y": 3.25, "label": "V" }, + { "x": 6, "y": 3.4, "label": "B" }, + + { "x": 11, "y": 3.4, "label": "N" }, + { "x": 12, "y": 3.25, "label": "M" }, + { "x": 13, "y": 3, "label": "COMMA" }, + { "x": 14, "y": 3.25, "label": "DOT" }, + { "x": 15, "y": 3.4, "label": "SLASH" }, + { "x": 16, "y": 3.4, "label": "RSHIFT" }, + { "x": 17, "y": 3.6, "label": "RSHIFT" }, + + { "x": 3, "y": 4.25, "label": "MO(META)" }, + { "x": 4, "y": 4, "label": "LALT" }, + { "x": 5, "y": 4.25, "label": "LGUI" }, + { "x": 6, "y": 4.4, "label": "ENT" }, + { "x": 7, "y": 4.4, "w": 1.5, "label": "SPACE" }, + + { "x": 9.5, "y": 4.4, "w": 1.5, "label": "ENTER" }, + { "x": 11, "y": 4.4, "label": "BACKSPACE" }, + { "x": 12, "y": 4.25, "label": "RGUI" }, + { "x": 13, "y": 4, "label": "RALT" }, + { "x": 14, "y": 4.25, "label": "MO(META)" } ] } } -- cgit v1.2.3 From 20e134e6817f2927dfa146524f84335b0b7cced3 Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Tue, 18 Dec 2018 11:26:43 -0500 Subject: Keyboard: Adding ortho60 to handwired (#4672) * Adding ortho60 to handwired * update to use LAYOUT_ortho_5x12 * Address PR comments about layout macros * Add default layout to info.json for configurator * Hack to xyverz layout until RGB branch is merged * Fix undef RGBDIPIN in xyverz 12x5 layout * Revert change to xvyerz's layout * Fix typo * Fix order * Revert xyverz rules.mk --- .../ortho60/boards/GENERIC_STM32_F103/board.c | 56 +++ .../ortho60/boards/GENERIC_STM32_F103/board.h | 166 +++++++ .../ortho60/boards/GENERIC_STM32_F103/board.mk | 5 + keyboards/handwired/ortho60/bootloader_defs.h | 10 + keyboards/handwired/ortho60/chconf.h | 524 +++++++++++++++++++++ keyboards/handwired/ortho60/config.h | 74 +++ keyboards/handwired/ortho60/halconf.h | 353 ++++++++++++++ keyboards/handwired/ortho60/hsv2rgb.c | 80 ++++ keyboards/handwired/ortho60/hsv2rgb.h | 23 + keyboards/handwired/ortho60/info.json | 73 +++ .../handwired/ortho60/keymaps/default/keymap.c | 98 ++++ keyboards/handwired/ortho60/ld/MKL26Z64.ld | 105 +++++ .../ld/STM32F103x8_stm32duino_bootloader.ld | 88 ++++ keyboards/handwired/ortho60/led.c | 51 ++ keyboards/handwired/ortho60/mcuconf.h | 209 ++++++++ keyboards/handwired/ortho60/ortho60.c | 32 ++ keyboards/handwired/ortho60/ortho60.h | 33 ++ keyboards/handwired/ortho60/readme.md | 3 + keyboards/handwired/ortho60/rules.mk | 56 +++ keyboards/handwired/ortho60/underglow.c | 157 ++++++ keyboards/handwired/ortho60/underglow.h | 10 + 21 files changed, 2206 insertions(+) create mode 100644 keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.c create mode 100644 keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.h create mode 100644 keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.mk create mode 100644 keyboards/handwired/ortho60/bootloader_defs.h create mode 100644 keyboards/handwired/ortho60/chconf.h create mode 100644 keyboards/handwired/ortho60/config.h create mode 100644 keyboards/handwired/ortho60/halconf.h create mode 100644 keyboards/handwired/ortho60/hsv2rgb.c create mode 100644 keyboards/handwired/ortho60/hsv2rgb.h create mode 100644 keyboards/handwired/ortho60/info.json create mode 100644 keyboards/handwired/ortho60/keymaps/default/keymap.c create mode 100644 keyboards/handwired/ortho60/ld/MKL26Z64.ld create mode 100644 keyboards/handwired/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld create mode 100644 keyboards/handwired/ortho60/led.c create mode 100644 keyboards/handwired/ortho60/mcuconf.h create mode 100644 keyboards/handwired/ortho60/ortho60.c create mode 100644 keyboards/handwired/ortho60/ortho60.h create mode 100644 keyboards/handwired/ortho60/readme.md create mode 100644 keyboards/handwired/ortho60/rules.mk create mode 100644 keyboards/handwired/ortho60/underglow.c create mode 100644 keyboards/handwired/ortho60/underglow.h diff --git a/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.c b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.c new file mode 100644 index 0000000000..8c5a87f35f --- /dev/null +++ b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.c @@ -0,0 +1,56 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#include "hal.h" + +// Value to place in RTC backup register 10 for persistent bootloader mode +#define RTC_BOOTLOADER_FLAG 0x424C + +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +#if HAL_USE_PAL || defined(__DOXYGEN__) +const PALConfig pal_default_config = +{ + {VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH}, + {VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH}, + {VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH}, + {VAL_GPIODODR, VAL_GPIODCRL, VAL_GPIODCRH}, + {VAL_GPIOEODR, VAL_GPIOECRL, VAL_GPIOECRH}, +}; +#endif + +/* + * Early initialization code. + * This initialization must be performed just after stack setup and before + * any other initialization. + */ +void __early_init(void) { + + stm32_clock_init(); +} + +/* + * Board-specific initialization code. + */ +void boardInit(void) { + //JTAG-DP Disabled and SW-DP Enabled + AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; + //Set backup register DR10 to enter bootloader on reset + BKP->DR10 = RTC_BOOTLOADER_FLAG; +} diff --git a/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.h b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.h new file mode 100644 index 0000000000..9427adabf1 --- /dev/null +++ b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.h @@ -0,0 +1,166 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef _BOARD_H_ +#define _BOARD_H_ + +/* + * Setup for a Generic STM32F103 board. + */ + +/* + * Board identifier. + */ +#define BOARD_GENERIC_STM32_F103 +#define BOARD_NAME "Generic STM32F103x board" + +/* + * Board frequencies. + */ +#define STM32_LSECLK 32768 +#define STM32_HSECLK 8000000 + +/* + * MCU type, supported types are defined in ./os/hal/platforms/hal_lld.h. + */ +#define STM32F103xB + +/* + * IO pins assignments + */ + +/* on-board */ + +#define GPIOA_LED 8 +#define GPIOD_OSC_IN 0 +#define GPIOD_OSC_OUT 1 + +/* In case your board has a "USB enable" hardware + controlled by a pin, define it here. (It could be just + a 1.5k resistor connected to D+ line.) +*/ +/* +#define GPIOB_USB_DISC 10 +*/ + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * + * The digits have the following meaning: + * 0 - Analog input. + * 1 - Push Pull output 10MHz. + * 2 - Push Pull output 2MHz. + * 3 - Push Pull output 50MHz. + * 4 - Digital input. + * 5 - Open Drain output 10MHz. + * 6 - Open Drain output 2MHz. + * 7 - Open Drain output 50MHz. + * 8 - Digital input with PullUp or PullDown resistor depending on ODR. + * 9 - Alternate Push Pull output 10MHz. + * A - Alternate Push Pull output 2MHz. + * B - Alternate Push Pull output 50MHz. + * C - Reserved. + * D - Alternate Open Drain output 10MHz. + * E - Alternate Open Drain output 2MHz. + * F - Alternate Open Drain output 50MHz. + * Please refer to the STM32 Reference Manual for details. + */ + +/* + * Port A setup. + * Everything input with pull-up except: + * PA2 - Alternate output (USART2 TX). + * PA3 - Normal input (USART2 RX). + * PA9 - Alternate output (USART1 TX). + * PA10 - Normal input (USART1 RX). + */ +#define VAL_GPIOACRL 0x88884B88 /* PA7...PA0 */ +#define VAL_GPIOACRH 0x888884B8 /* PA15...PA8 */ +#define VAL_GPIOAODR 0xFFFFFFFF + +/* + * Port B setup. + * Everything input with pull-up except: + * PB10 - Push Pull output (USB switch). + */ +#define VAL_GPIOBCRL 0x88888888 /* PB7...PB0 */ +#define VAL_GPIOBCRH 0x88888388 /* PB15...PB8 */ +#define VAL_GPIOBODR 0xFFFFFFFF + +/* + * Port C setup. + * Everything input with pull-up except: + * PC13 - Push Pull output (LED). + */ +#define VAL_GPIOCCRL 0x88888888 /* PC7...PC0 */ +#define VAL_GPIOCCRH 0x88388888 /* PC15...PC8 */ +#define VAL_GPIOCODR 0xFFFFFFFF + +/* + * Port D setup. + * Everything input with pull-up except: + * PD0 - Normal input (XTAL). + * PD1 - Normal input (XTAL). + */ +#define VAL_GPIODCRL 0x88888844 /* PD7...PD0 */ +#define VAL_GPIODCRH 0x88888888 /* PD15...PD8 */ +#define VAL_GPIODODR 0xFFFFFFFF + +/* + * Port E setup. + * Everything input with pull-up except: + */ +#define VAL_GPIOECRL 0x88888888 /* PE7...PE0 */ +#define VAL_GPIOECRH 0x88888888 /* PE15...PE8 */ +#define VAL_GPIOEODR 0xFFFFFFFF + +/* + * USB bus activation macro, required by the USB driver. + */ +/* The point is that most of the generic STM32F103* boards + have a 1.5k resistor connected on one end to the D+ line + and on the other end to some pin. Or even a slightly more + complicated "USB enable" circuit, controlled by a pin. + That should go here. + + However on some boards (e.g. one that I have), there's no + such hardware. In which case it's better to not do anything. +*/ +/* +#define usb_lld_connect_bus(usbp) palClearPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_connect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_INPUT); + +/* + * USB bus de-activation macro, required by the USB driver. + */ +/* +#define usb_lld_disconnect_bus(usbp) palSetPad(GPIOB, GPIOB_USB_DISC) +*/ +#define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12); + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* _BOARD_H_ */ diff --git a/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.mk b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.mk new file mode 100644 index 0000000000..6b8b312fd9 --- /dev/null +++ b/keyboards/handwired/ortho60/boards/GENERIC_STM32_F103/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/GENERIC_STM32_F103/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/GENERIC_STM32_F103 diff --git a/keyboards/handwired/ortho60/bootloader_defs.h b/keyboards/handwired/ortho60/bootloader_defs.h new file mode 100644 index 0000000000..0f45203cb6 --- /dev/null +++ b/keyboards/handwired/ortho60/bootloader_defs.h @@ -0,0 +1,10 @@ +/* Address for jumping to bootloader on STM32 chips. */ +/* It is chip dependent, the correct number can be looked up here (page 175): + * http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf + * This also requires a patch to chibios: + * /tmk_core/tool/chibios/ch-bootloader-jump.patch + */ + +// STM32F103* does NOT have an USB bootloader in ROM (only serial), +// so setting anything here does not make much sense +// #define STM32_BOOTLOADER_ADDRESS 0x1FFFC800 diff --git a/keyboards/handwired/ortho60/chconf.h b/keyboards/handwired/ortho60/chconf.h new file mode 100644 index 0000000000..bbd9b2da62 --- /dev/null +++ b/keyboards/handwired/ortho60/chconf.h @@ -0,0 +1,524 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/chconf.h + * @brief Configuration file template. + * @details A copy of this file must be placed in each project directory, it + * contains the application specific kernel settings. + * + * @addtogroup config + * @details Kernel related settings and hooks. + * @{ + */ + +#ifndef CHCONF_H +#define CHCONF_H + +#define _CHIBIOS_RT_CONF_ + +/*===========================================================================*/ +/** + * @name System timers settings + * @{ + */ +/*===========================================================================*/ + +/** + * @brief System time counter resolution. + * @note Allowed values are 16 or 32 bits. + */ +#define CH_CFG_ST_RESOLUTION 32 + +/** + * @brief System tick frequency. + * @details Frequency of the system timer that drives the system ticks. This + * setting also defines the system tick time unit. + */ +#define CH_CFG_ST_FREQUENCY 100000 + +/** + * @brief Time delta constant for the tick-less mode. + * @note If this value is zero then the system uses the classic + * periodic tick. This value represents the minimum number + * of ticks that is safe to specify in a timeout directive. + * The value one is not valid, timeouts are rounded up to + * this value. + */ +#define CH_CFG_ST_TIMEDELTA 0 + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel parameters and options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Round robin interval. + * @details This constant is the number of system ticks allowed for the + * threads before preemption occurs. Setting this value to zero + * disables the preemption for threads with equal priority and the + * round robin becomes cooperative. Note that higher priority + * threads can still preempt, the kernel is always preemptive. + * @note Disabling the round robin preemption makes the kernel more compact + * and generally faster. + * @note The round robin preemption is not supported in tickless mode and + * must be set to zero in that case. + */ +#define CH_CFG_TIME_QUANTUM 0 + +/** + * @brief Managed RAM size. + * @details Size of the RAM area to be managed by the OS. If set to zero + * then the whole available RAM is used. The core memory is made + * available to the heap allocator and/or can be used directly through + * the simplified core memory allocator. + * + * @note In order to let the OS manage the whole RAM the linker script must + * provide the @p __heap_base__ and @p __heap_end__ symbols. + * @note Requires @p CH_CFG_USE_MEMCORE. + */ +#define CH_CFG_MEMCORE_SIZE 0 + +/** + * @brief Idle thread automatic spawn suppression. + * @details When this option is activated the function @p chSysInit() + * does not spawn the idle thread. The application @p main() + * function becomes the idle thread and must implement an + * infinite loop. + */ +#define CH_CFG_NO_IDLE_THREAD FALSE + +/* Use __WFI in the idle thread for waiting. Does lower the power + * consumption. */ +#define CORTEX_ENABLE_WFI_IDLE TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Performance options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief OS optimization. + * @details If enabled then time efficient rather than space efficient code + * is used when two possible implementations exist. + * + * @note This is not related to the compiler optimization options. + * @note The default is @p TRUE. + */ +#define CH_CFG_OPTIMIZE_SPEED TRUE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Subsystem options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Time Measurement APIs. + * @details If enabled then the time measurement APIs are included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_TM FALSE + +/** + * @brief Threads registry APIs. + * @details If enabled then the registry APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_REGISTRY TRUE + +/** + * @brief Threads synchronization APIs. + * @details If enabled then the @p chThdWait() function is included in + * the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_WAITEXIT TRUE + +/** + * @brief Semaphores APIs. + * @details If enabled then the Semaphores APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_SEMAPHORES TRUE + +/** + * @brief Semaphores queuing mode. + * @details If enabled then the threads are enqueued on semaphores by + * priority rather than in FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_SEMAPHORES_PRIORITY FALSE + +/** + * @brief Mutexes APIs. + * @details If enabled then the mutexes APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MUTEXES TRUE + +/** + * @brief Enables recursive behavior on mutexes. + * @note Recursive mutexes are heavier and have an increased + * memory footprint. + * + * @note The default is @p FALSE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_MUTEXES_RECURSIVE FALSE + +/** + * @brief Conditional Variables APIs. + * @details If enabled then the conditional variables APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MUTEXES. + */ +#define CH_CFG_USE_CONDVARS TRUE + +/** + * @brief Conditional Variables APIs with timeout. + * @details If enabled then the conditional variables APIs with timeout + * specification are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_CONDVARS. + */ +#define CH_CFG_USE_CONDVARS_TIMEOUT FALSE + +/** + * @brief Events Flags APIs. + * @details If enabled then the event flags APIs are included in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_EVENTS TRUE + +/** + * @brief Events Flags APIs with timeout. + * @details If enabled then the events APIs with timeout specification + * are included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_EVENTS. + */ +#define CH_CFG_USE_EVENTS_TIMEOUT TRUE + +/** + * @brief Synchronous Messages APIs. + * @details If enabled then the synchronous messages APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MESSAGES TRUE + +/** + * @brief Synchronous Messages queuing mode. + * @details If enabled then messages are served by priority rather than in + * FIFO order. + * + * @note The default is @p FALSE. Enable this if you have special + * requirements. + * @note Requires @p CH_CFG_USE_MESSAGES. + */ +#define CH_CFG_USE_MESSAGES_PRIORITY FALSE + +/** + * @brief Mailboxes APIs. + * @details If enabled then the asynchronous messages (mailboxes) APIs are + * included in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_SEMAPHORES. + */ +#define CH_CFG_USE_MAILBOXES TRUE + +/** + * @brief Core Memory Manager APIs. + * @details If enabled then the core memory manager APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMCORE TRUE + +/** + * @brief Heap Allocator APIs. + * @details If enabled then the memory heap allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_MEMCORE and either @p CH_CFG_USE_MUTEXES or + * @p CH_CFG_USE_SEMAPHORES. + * @note Mutexes are recommended. + */ +#define CH_CFG_USE_HEAP TRUE + +/** + * @brief Memory Pools Allocator APIs. + * @details If enabled then the memory pools allocator APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + */ +#define CH_CFG_USE_MEMPOOLS FALSE + +/** + * @brief Dynamic Threads APIs. + * @details If enabled then the dynamic threads creation APIs are included + * in the kernel. + * + * @note The default is @p TRUE. + * @note Requires @p CH_CFG_USE_WAITEXIT. + * @note Requires @p CH_CFG_USE_HEAP and/or @p CH_CFG_USE_MEMPOOLS. + */ +#define CH_CFG_USE_DYNAMIC FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Debug options + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Debug option, kernel statistics. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_STATISTICS FALSE + +/** + * @brief Debug option, system state check. + * @details If enabled the correct call protocol for system APIs is checked + * at runtime. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_SYSTEM_STATE_CHECK FALSE + +/** + * @brief Debug option, parameters checks. + * @details If enabled then the checks on the API functions input + * parameters are activated. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_CHECKS FALSE + +/** + * @brief Debug option, consistency checks. + * @details If enabled then all the assertions in the kernel code are + * activated. This includes consistency checks inside the kernel, + * runtime anomalies and port-defined checks. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_ENABLE_ASSERTS FALSE + +/** + * @brief Debug option, trace buffer. + * @details If enabled then the trace buffer is activated. + * + * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED + +/** + * @brief Trace buffer entries. + * @note The trace buffer is only allocated if @p CH_DBG_TRACE_MASK is + * different from @p CH_DBG_TRACE_MASK_DISABLED. + */ +#define CH_DBG_TRACE_BUFFER_SIZE 128 + +/** + * @brief Debug option, stack checks. + * @details If enabled then a runtime stack check is performed. + * + * @note The default is @p FALSE. + * @note The stack check is performed in a architecture/port dependent way. + * It may not be implemented or some ports. + * @note The default failure mode is to halt the system with the global + * @p panic_msg variable set to @p NULL. + */ +#define CH_DBG_ENABLE_STACK_CHECK FALSE + +/** + * @brief Debug option, stacks initialization. + * @details If enabled then the threads working area is filled with a byte + * value when a thread is created. This can be useful for the + * runtime measurement of the used stack. + * + * @note The default is @p FALSE. + */ +#define CH_DBG_FILL_THREADS FALSE + +/** + * @brief Debug option, threads profiling. + * @details If enabled then a field is added to the @p thread_t structure that + * counts the system ticks occurred while executing the thread. + * + * @note The default is @p FALSE. + * @note This debug option is not currently compatible with the + * tickless mode. + */ +#define CH_DBG_THREADS_PROFILING FALSE + +/** @} */ + +/*===========================================================================*/ +/** + * @name Kernel hooks + * @{ + */ +/*===========================================================================*/ + +/** + * @brief Threads descriptor structure extension. + * @details User fields added to the end of the @p thread_t structure. + */ +#define CH_CFG_THREAD_EXTRA_FIELDS \ + /* Add threads custom fields here.*/ + +/** + * @brief Threads initialization hook. + * @details User initialization code added to the @p chThdInit() API. + * + * @note It is invoked from within @p chThdInit() and implicitly from all + * the threads creation APIs. + */ +#define CH_CFG_THREAD_INIT_HOOK(tp) { \ + /* Add threads initialization code here.*/ \ +} + +/** + * @brief Threads finalization hook. + * @details User finalization code added to the @p chThdExit() API. + */ +#define CH_CFG_THREAD_EXIT_HOOK(tp) { \ + /* Add threads finalization code here.*/ \ +} + +/** + * @brief Context switch hook. + * @details This hook is invoked just before switching between threads. + */ +#define CH_CFG_CONTEXT_SWITCH_HOOK(ntp, otp) { \ + /* Context switch code here.*/ \ +} + +/** + * @brief ISR enter hook. + */ +#define CH_CFG_IRQ_PROLOGUE_HOOK() { \ + /* IRQ prologue code here.*/ \ +} + +/** + * @brief ISR exit hook. + */ +#define CH_CFG_IRQ_EPILOGUE_HOOK() { \ + /* IRQ epilogue code here.*/ \ +} + +/** + * @brief Idle thread enter hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to activate a power saving mode. + */ +#define CH_CFG_IDLE_ENTER_HOOK() { \ + /* Idle-enter code here.*/ \ +} + +/** + * @brief Idle thread leave hook. + * @note This hook is invoked within a critical zone, no OS functions + * should be invoked from here. + * @note This macro can be used to deactivate a power saving mode. + */ +#define CH_CFG_IDLE_LEAVE_HOOK() { \ + /* Idle-leave code here.*/ \ +} + +/** + * @brief Idle Loop hook. + * @details This hook is continuously invoked by the idle thread loop. + */ +#define CH_CFG_IDLE_LOOP_HOOK() { \ + /* Idle loop code here.*/ \ +} + +/** + * @brief System tick event hook. + * @details This hook is invoked in the system tick handler immediately + * after processing the virtual timers queue. + */ +#define CH_CFG_SYSTEM_TICK_HOOK() { \ + /* System tick event code here.*/ \ +} + +/** + * @brief System halt hook. + * @details This hook is invoked in case to a system halting error before + * the system is halted. + */ +#define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ + /* System halt code here.*/ \ +} + +/** + * @brief Trace hook. + * @details This hook is invoked each time a new record is written in the + * trace buffer. + */ +#define CH_CFG_TRACE_HOOK(tep) { \ + /* Trace code here.*/ \ +} + +/** @} */ + +/*===========================================================================*/ +/* Port-specific settings (override port settings defaulted in chcore.h). */ +/*===========================================================================*/ + +#endif /* CHCONF_H */ + +/** @} */ diff --git a/keyboards/handwired/ortho60/config.h b/keyboards/handwired/ortho60/config.h new file mode 100644 index 0000000000..dd06f3f953 --- /dev/null +++ b/keyboards/handwired/ortho60/config.h @@ -0,0 +1,74 @@ +/* +Copyright 2015 Jun Wako + +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 + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6464 +#define DEVICE_VER 0x0001 +/* in python2: list(u"whatever".encode('utf-16-le')) */ +/* at most 32 characters or the ugly hack in usb_main.c borks */ +#define MANUFACTURER QMK +#define PRODUCT Ortho60 +#define DESCRIPTION Ortho60 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 12 + +#define MATRIX_COL_PINS { B11, B10, B1, B0, A7, A6, A5, A4, A3, A2, A1, A0 } +#define MATRIX_ROW_PINS { B3, B4, B5, B6, B7 } +#define DIODE_DIRECTION COL2ROW + +#define BACKLIGHT_LEVELS 1 + +/* 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + + +/* + * 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/handwired/ortho60/halconf.h b/keyboards/handwired/ortho60/halconf.h new file mode 100644 index 0000000000..5fba285a38 --- /dev/null +++ b/keyboards/handwired/ortho60/halconf.h @@ -0,0 +1,353 @@ +/* + ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/** + * @file templates/halconf.h + * @brief HAL configuration header. + * @details HAL configuration file, this file allows to enable or disable the + * various device drivers from your application. You may also use + * this file in order to override the device drivers default settings. + * + * @addtogroup HAL_CONF + * @{ + */ + +#ifndef _HALCONF_H_ +#define _HALCONF_H_ + +#include "mcuconf.h" + +/** + * @brief Enables the PAL subsystem. + */ +#if !defined(HAL_USE_PAL) || defined(__DOXYGEN__) +#define HAL_USE_PAL TRUE +#endif + +/** + * @brief Enables the ADC subsystem. + */ +#if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) +#define HAL_USE_ADC FALSE +#endif + +/** + * @brief Enables the CAN subsystem. + */ +#if !defined(HAL_USE_CAN) || defined(__DOXYGEN__) +#define HAL_USE_CAN FALSE +#endif + +/** + * @brief Enables the DAC subsystem. + */ +#if !defined(HAL_USE_DAC) || defined(__DOXYGEN__) +#define HAL_USE_DAC FALSE +#endif + +/** + * @brief Enables the EXT subsystem. + */ +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE +#endif + +/** + * @brief Enables the GPT subsystem. + */ +#if !defined(HAL_USE_GPT) || defined(__DOXYGEN__) +#define HAL_USE_GPT FALSE +#endif + +/** + * @brief Enables the I2C subsystem. + */ +#if !defined(HAL_USE_I2C) || defined(__DOXYGEN__) +#define HAL_USE_I2C FALSE +#endif + +/** + * @brief Enables the I2S subsystem. + */ +#if !defined(HAL_USE_I2S) || defined(__DOXYGEN__) +#define HAL_USE_I2S FALSE +#endif + +/** + * @brief Enables the ICU subsystem. + */ +#if !defined(HAL_USE_ICU) || defined(__DOXYGEN__) +#define HAL_USE_ICU FALSE +#endif + +/** + * @brief Enables the MAC subsystem. + */ +#if !defined(HAL_USE_MAC) || defined(__DOXYGEN__) +#define HAL_USE_MAC FALSE +#endif + +/** + * @brief Enables the MMC_SPI subsystem. + */ +#if !defined(HAL_USE_MMC_SPI) || defined(__DOXYGEN__) +#define HAL_USE_MMC_SPI FALSE +#endif + +/** + * @brief Enables the PWM subsystem. + */ +#if !defined(HAL_USE_PWM) || defined(__DOXYGEN__) +#define HAL_USE_PWM FALSE +#endif + +/** + * @brief Enables the RTC subsystem. + */ +#if !defined(HAL_USE_RTC) || defined(__DOXYGEN__) +#define HAL_USE_RTC FALSE +#endif + +/** + * @brief Enables the SDC subsystem. + */ +#if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) +#define HAL_USE_SDC FALSE +#endif + +/** + * @brief Enables the SERIAL subsystem. + */ +#if !defined(HAL_USE_SERIAL) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL FALSE +#endif + +/** + * @brief Enables the SERIAL over USB subsystem. + */ +#if !defined(HAL_USE_SERIAL_USB) || defined(__DOXYGEN__) +#define HAL_USE_SERIAL_USB FALSE +#endif + +/** + * @brief Enables the SPI subsystem. + */ +#if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) +#define HAL_USE_SPI TRUE +#endif + +/** + * @brief Enables the UART subsystem. + */ +#if !defined(HAL_USE_UART) || defined(__DOXYGEN__) +#define HAL_USE_UART FALSE +#endif + +/** + * @brief Enables the USB subsystem. + */ +#if !defined(HAL_USE_USB) || defined(__DOXYGEN__) +#define HAL_USE_USB TRUE +#endif + +/** + * @brief Enables the WDG subsystem. + */ +#if !defined(HAL_USE_WDG) || defined(__DOXYGEN__) +#define HAL_USE_WDG FALSE +#endif + +/*===========================================================================*/ +/* ADC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_WAIT) || defined(__DOXYGEN__) +#define ADC_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p adcAcquireBus() and @p adcReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(ADC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define ADC_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* CAN driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Sleep mode related APIs inclusion switch. + */ +#if !defined(CAN_USE_SLEEP_MODE) || defined(__DOXYGEN__) +#define CAN_USE_SLEEP_MODE TRUE +#endif + +/*===========================================================================*/ +/* I2C driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables the mutual exclusion APIs on the I2C bus. + */ +#if !defined(I2C_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define I2C_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* MAC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_ZERO_COPY) || defined(__DOXYGEN__) +#define MAC_USE_ZERO_COPY FALSE +#endif + +/** + * @brief Enables an event sources for incoming packets. + */ +#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__) +#define MAC_USE_EVENTS TRUE +#endif + +/*===========================================================================*/ +/* MMC_SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + * This option is recommended also if the SPI driver does not + * use a DMA channel and heavily loads the CPU. + */ +#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) +#define MMC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SDC driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Number of initialization attempts before rejecting the card. + * @note Attempts are performed at 10mS intervals. + */ +#if !defined(SDC_INIT_RETRY) || defined(__DOXYGEN__) +#define SDC_INIT_RETRY 100 +#endif + +/** + * @brief Include support for MMC cards. + * @note MMC support is not yet implemented so this option must be kept + * at @p FALSE. + */ +#if !defined(SDC_MMC_SUPPORT) || defined(__DOXYGEN__) +#define SDC_MMC_SUPPORT FALSE +#endif + +/** + * @brief Delays insertions. + * @details If enabled this options inserts delays into the MMC waiting + * routines releasing some extra CPU time for the threads with + * lower priority, this may slow down the driver a bit however. + */ +#if !defined(SDC_NICE_WAITING) || defined(__DOXYGEN__) +#define SDC_NICE_WAITING TRUE +#endif + +/*===========================================================================*/ +/* SERIAL driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SERIAL_DEFAULT_BITRATE 38400 +#endif + +/** + * @brief Serial buffers size. + * @details Configuration parameter, you can change the depth of the queue + * buffers depending on the requirements of your application. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SERIAL_USB driver related setting. */ +/*===========================================================================*/ + +/** + * @brief Serial over USB buffers size. + * @details Configuration parameter, the buffer size must be a multiple of + * the USB data endpoint maximum packet size. + * @note The default is 64 bytes for both the transmission and receive + * buffers. + */ +#if !defined(SERIAL_USB_BUFFERS_SIZE) || defined(__DOXYGEN__) +#define SERIAL_USB_BUFFERS_SIZE 1 +#endif + +/*===========================================================================*/ +/* SPI driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_WAIT) || defined(__DOXYGEN__) +#define SPI_USE_WAIT TRUE +#endif + +/** + * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(SPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define SPI_USE_MUTUAL_EXCLUSION TRUE +#endif + +/*===========================================================================*/ +/* USB driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Enables synchronous APIs. + * @note Disabling this option saves both code and data space. + */ +#if !defined(USB_USE_WAIT) || defined(__DOXYGEN__) +#define USB_USE_WAIT TRUE +#endif + +#endif /* _HALCONF_H_ */ + +/** @} */ diff --git a/keyboards/handwired/ortho60/hsv2rgb.c b/keyboards/handwired/ortho60/hsv2rgb.c new file mode 100644 index 0000000000..adb7af8fa5 --- /dev/null +++ b/keyboards/handwired/ortho60/hsv2rgb.c @@ -0,0 +1,80 @@ +/* hsv2rgb.c + * Integer only conversion functions between HSV and RGB + */ + +#include "hsv2rgb.h" + +// TODO fix these buggy macros +#define max(x,y) ((x>y) ? x:y) +#define min(x,y) ((x>y) ? y:x) +#define min3(x,y,z) (min(min(x,y),z)) +#define max3(x,y,z) (max(max(x,y),z)) + + +rgb_color hsv2rgb(hsv_color hsv) +{ + // From : http://qscribble.blogspot.fr/2008/06/integer-conversion-from-hsl-to-rgb.html + int h = hsv.h; + int s = hsv.s; + int v = hsv.v; + rgb_color rgb = {0, 0, 0}; + + if (v == 0) + return rgb; + + // sextant = 0 .. 5 + int sextant = (h*6)/256; + // f = 0 .. 42 + int f = h - (sextant*256)/6; + + int p = (v * (256 - s))/256; + int q = (v * (256*43 - s*f))/(256*43); + int t = (v * (256*43 - s*(43-f)))/(256*43); + + // Corrige les erreurs dues aux arrondis + p = max(min(p, 255), 0); + q = max(min(q, 255), 0); + t = max(min(t, 255), 0); + + switch(sextant){ + case 0: rgb.r = v; rgb.g = t; rgb.b = p; break; + case 1: rgb.r = q; rgb.g = v; rgb.b = p; break; + case 2: rgb.r = p; rgb.g = v; rgb.b = t; break; + case 3: rgb.r = p; rgb.g = q; rgb.b = v; break; + case 4: rgb.r = t; rgb.g = p; rgb.b = v; break; + default:rgb.r = v; rgb.g = p; rgb.b = q; break; + } + return rgb; +} + + +hsv_color rgb2hsv(rgb_color rgb) +{ + // From : http://www.ruinelli.ch/rgb-to-hsv + hsv_color hsv = {0, 0, 0}; + int min, max, delta; + + min = min3(rgb.r, rgb.g, rgb.b); + max = max3(rgb.r, rgb.g, rgb.b); + + if(max==0) { + hsv.h = 0; + hsv.s = 0; + hsv.v = 0; + return hsv; + } + + hsv.v = max; + delta = max - min; + + hsv.s = (delta)*255 / max; + + if(rgb.r == max) + hsv.h = (rgb.g - rgb.b)*42/delta; // between yellow & magenta + else if(rgb.g == max) + hsv.h = 120 + (rgb.b - rgb.r)*42/delta; // between cyan & yellow + else + hsv.h = 240 + (rgb.r - rgb.g)*42/delta; // between magenta & cyan + + return hsv; +} \ No newline at end of file diff --git a/keyboards/handwired/ortho60/hsv2rgb.h b/keyboards/handwired/ortho60/hsv2rgb.h new file mode 100644 index 0000000000..99566c32c0 --- /dev/null +++ b/keyboards/handwired/ortho60/hsv2rgb.h @@ -0,0 +1,23 @@ +/* hsv2rgb.h + * Convert Hue Saturation Value to Red Green Blue + * + * Programme de convertion d'une information HSV en RGB + */ +#ifndef HSV2RGB_H +#define HSV2RGB_H + +typedef struct { + unsigned char h; + unsigned char s; + unsigned char v; +} hsv_color; + +typedef struct { + unsigned char r; + unsigned char g; + unsigned char b; +} rgb_color; + +rgb_color hsv2rgb(hsv_color hsv); + +#endif \ No newline at end of file diff --git a/keyboards/handwired/ortho60/info.json b/keyboards/handwired/ortho60/info.json new file mode 100644 index 0000000000..b6e4854410 --- /dev/null +++ b/keyboards/handwired/ortho60/info.json @@ -0,0 +1,73 @@ +{ + "keyboard_name": "Ortho60", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x12": { + "layout": [ + {"label":"`", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"Backspace", "x":11, "y":0}, + {"label":"Tab", "x":0, "y":1}, + {"label":"Q", "x":1, "y":1}, + {"label":"W", "x":2, "y":1}, + {"label":"E", "x":3, "y":1}, + {"label":"R", "x":4, "y":1}, + {"label":"T", "x":5, "y":1}, + {"label":"Y", "x":6, "y":1}, + {"label":"U", "x":7, "y":1}, + {"label":"I", "x":8, "y":1}, + {"label":"O", "x":9, "y":1}, + {"label":"P", "x":10, "y":1}, + {"label":"Delete", "x":11, "y":1}, + {"label":"Esc", "x":0, "y":2}, + {"label":"A", "x":1, "y":2}, + {"label":"S", "x":2, "y":2}, + {"label":"D", "x":3, "y":2}, + {"label":"F", "x":4, "y":2}, + {"label":"G", "x":5, "y":2}, + {"label":"H", "x":6, "y":2}, + {"label":"J", "x":7, "y":2}, + {"label":"K", "x":8, "y":2}, + {"label":"L", "x":9, "y":2}, + {"label":";", "x":10, "y":2}, + {"label":"'", "x":11, "y":2}, + {"label":"Shift", "x":0, "y":3}, + {"label":"Z", "x":1, "y":3}, + {"label":"X", "x":2, "y":3}, + {"label":"C", "x":3, "y":3}, + {"label":"V", "x":4, "y":3}, + {"label":"B", "x":5, "y":3}, + {"label":"N", "x":6, "y":3}, + {"label":"M", "x":7, "y":3}, + {"label":",", "x":8, "y":3}, + {"label":".", "x":9, "y":3}, + {"label":"/", "x":10, "y":3}, + {"label":"Enter", "x":11, "y":3}, + {"label":"Fn", "x":0, "y":4}, + {"label":"Ctrl", "x":1, "y":4}, + {"label":"Alt", "x":2, "y":4}, + {"label":"Meta", "x":3, "y":4}, + {"label":"Lower", "x":4, "y":4}, + {"label":"Space", "x":5, "y":4}, + {"label":"Space", "x":6, "y":4}, + {"label":"Raise", "x":7, "y":4}, + {"label":"Left", "x":8, "y":4}, + {"label":"Down", "x":9, "y":4}, + {"label":"Right", "x":10, "y":4}, + {"label":"up", "x":11, "y":4} + ] + } + } +} diff --git a/keyboards/handwired/ortho60/keymaps/default/keymap.c b/keyboards/handwired/ortho60/keymaps/default/keymap.c new file mode 100644 index 0000000000..8617b6341a --- /dev/null +++ b/keyboards/handwired/ortho60/keymaps/default/keymap.c @@ -0,0 +1,98 @@ +/* +Copyright 2012,2013 Jun Wako + +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 . +*/ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +// 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 _BASE 0 +#define _RAISE 1 +#define _LOWER 2 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Qwerty + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Tab | Q | W | E | R | T | Y | U | I | O | P | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Esc | A | S | D | F | G | H | J | K | L | ; | " | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | + * `-----------------------------------------------------------------------------------' + */ +[_BASE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL, \ + KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, \ + BL_TOGG, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ +), +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ +) +}; diff --git a/keyboards/handwired/ortho60/ld/MKL26Z64.ld b/keyboards/handwired/ortho60/ld/MKL26Z64.ld new file mode 100644 index 0000000000..c4ca8b874c --- /dev/null +++ b/keyboards/handwired/ortho60/ld/MKL26Z64.ld @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2013-2016 Fabio Utzig, http://fabioutzig.com + * (C) 2016 flabbergast + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +/* + * KL26Z64 memory setup. + */ +MEMORY +{ + flash0 : org = 0x00000000, len = 0x100 + flash1 : org = 0x00000400, len = 0x10 + flash2 : org = 0x00000410, len = 62k - 0x410 + flash3 : org = 0x0000F800, len = 2k + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x1FFFF800, len = 8k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* Flash region for the configuration bytes.*/ +SECTIONS +{ + .cfmprotect : ALIGN(4) SUBALIGN(4) + { + KEEP(*(.cfmconfig)) + } > flash1 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash2); +REGION_ALIAS("XTORS_FLASH_LMA", flash2); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash2); +REGION_ALIAS("TEXT_FLASH_LMA", flash2); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash2); +REGION_ALIAS("RODATA_FLASH_LMA", flash2); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash2); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash2); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash2); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash2); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +__eeprom_workarea_start__ = ORIGIN(flash3); +__eeprom_workarea_size__ = LENGTH(flash3); +__eeprom_workarea_end__ = __eeprom_workarea_start__ + __eeprom_workarea_size__; + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld b/keyboards/handwired/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld new file mode 100644 index 0000000000..d0688ef601 --- /dev/null +++ b/keyboards/handwired/ortho60/ld/STM32F103x8_stm32duino_bootloader.ld @@ -0,0 +1,88 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * ST32F103xB memory setup for use with the maplemini bootloader. + * You will have to + * #define CORTEX_VTOR_INIT 0x5000 + * in your projects chconf.h + */ +MEMORY +{ + flash0 : org = 0x08002000, len = 64k - 0x2000 + flash1 : org = 0x00000000, len = 0 + flash2 : org = 0x00000000, len = 0 + flash3 : org = 0x00000000, len = 0 + flash4 : org = 0x00000000, len = 0 + flash5 : org = 0x00000000, len = 0 + flash6 : org = 0x00000000, len = 0 + flash7 : org = 0x00000000, len = 0 + ram0 : org = 0x20000000, len = 20k + ram1 : org = 0x00000000, len = 0 + ram2 : org = 0x00000000, len = 0 + ram3 : org = 0x00000000, len = 0 + ram4 : org = 0x00000000, len = 0 + ram5 : org = 0x00000000, len = 0 + ram6 : org = 0x00000000, len = 0 + ram7 : org = 0x00000000, len = 0 +} + +/* For each data/text section two region are defined, a virtual region + and a load region (_LMA suffix).*/ + +/* Flash region to be used for exception vectors.*/ +REGION_ALIAS("VECTORS_FLASH", flash0); +REGION_ALIAS("VECTORS_FLASH_LMA", flash0); + +/* Flash region to be used for constructors and destructors.*/ +REGION_ALIAS("XTORS_FLASH", flash0); +REGION_ALIAS("XTORS_FLASH_LMA", flash0); + +/* Flash region to be used for code text.*/ +REGION_ALIAS("TEXT_FLASH", flash0); +REGION_ALIAS("TEXT_FLASH_LMA", flash0); + +/* Flash region to be used for read only data.*/ +REGION_ALIAS("RODATA_FLASH", flash0); +REGION_ALIAS("RODATA_FLASH_LMA", flash0); + +/* Flash region to be used for various.*/ +REGION_ALIAS("VARIOUS_FLASH", flash0); +REGION_ALIAS("VARIOUS_FLASH_LMA", flash0); + +/* Flash region to be used for RAM(n) initialization data.*/ +REGION_ALIAS("RAM_INIT_FLASH_LMA", flash0); + +/* RAM region to be used for Main stack. This stack accommodates the processing + of all exceptions and interrupts.*/ +REGION_ALIAS("MAIN_STACK_RAM", ram0); + +/* RAM region to be used for the process stack. This is the stack used by + the main() function.*/ +REGION_ALIAS("PROCESS_STACK_RAM", ram0); + +/* RAM region to be used for data segment.*/ +REGION_ALIAS("DATA_RAM", ram0); +REGION_ALIAS("DATA_RAM_LMA", flash0); + +/* RAM region to be used for BSS segment.*/ +REGION_ALIAS("BSS_RAM", ram0); + +/* RAM region to be used for the default heap.*/ +REGION_ALIAS("HEAP_RAM", ram0); + +/* Generic rules inclusion.*/ +INCLUDE rules.ld diff --git a/keyboards/handwired/ortho60/led.c b/keyboards/handwired/ortho60/led.c new file mode 100644 index 0000000000..f15baed169 --- /dev/null +++ b/keyboards/handwired/ortho60/led.c @@ -0,0 +1,51 @@ +/* +Copyright 2012 Jun Wako + +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 . +*/ + +#include "hal.h" +#include "backlight.h" +#include "led.h" +#include "printf.h" + +void backlight_init_ports(void) { + printf("backlight_init_ports()\n"); + #ifdef BACKLIGHT_ENABLE + palSetPadMode(GPIOA, 8, PAL_MODE_OUTPUT_PUSHPULL); + palSetPad(GPIOA, 8); + #endif +} + +void backlight_set(uint8_t level) { + printf("backlight_set(%d)\n", level); + #ifdef BACKLIGHT_ENABLE + if (level == 0) { + // Turn backlight off + palSetPad(GPIOA, 8); + } else { + // Turn backlight on + palClearPad(GPIOA, 8); + } + #endif +} + +void led_set(uint8_t usb_led) +{ + if (usb_led & (1</os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES) +MCU_FAMILY = STM32 +MCU_SERIES = STM32F1xx +# linker script to use +# it should exist either in /os/common/ports/ARMCMx/compilers/GCC/ld/ +# or /ld/ +# startup code to use +# is should exist in /os/common/ports/ARMCMx/compilers/GCC/mk/ +MCU_STARTUP = stm32f1xx +# it should exist either in /os/hal/boards/ +# or /boards +# Cortex version +# Teensy LC is cortex-m0; Teensy 3.x are cortex-m4 +MCU = cortex-m3 +# ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7 +ARMV = 7 +# If you want to be able to jump to bootloader from firmware on STM32 MCUs, +# set the correct BOOTLOADER_ADDRESS. Either set it here, or define it in +# ./bootloader_defs.h or in ./boards//bootloader_defs.h (if you have +# a custom board definition that you plan to reuse). +# If you're not setting it here, leave it commented out. +# It is chip dependent, the correct number can be looked up here (page 175): +# http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf +# This also requires a patch to chibios: +# /tmk_core/tool/chibios/ch-bootloader-jump.patch +#STM32_BOOTLOADER_ADDRESS = 0x1FFFC800 + + +#BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration +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 +SLEEP_LED_ENABLE = yes # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB Nkey Rollover +BACKLIGHT_ENABLE = yes + +LAYOUTS = ortho_5x12 + +DEFAULT_FOLDER = handwired/ortho60 diff --git a/keyboards/handwired/ortho60/underglow.c b/keyboards/handwired/ortho60/underglow.c new file mode 100644 index 0000000000..1383af1898 --- /dev/null +++ b/keyboards/handwired/ortho60/underglow.c @@ -0,0 +1,157 @@ +#include "ch.h" +#include "hal.h" + +#include "hsv2rgb.h" +#include "underglow.h" + +#define BYTES_FOR_LED_BYTE 4 +#define NB_COLORS 3 +#define BYTES_FOR_LED BYTES_FOR_LED_BYTE*NB_COLORS +#define DATA_SIZE BYTES_FOR_LED*NB_LEDS +#define RESET_SIZE 200 +#define PREAMBLE_SIZE 4 + +// Define the spi your LEDs are plugged to here +#define LEDS_SPI SPID2 +// Define the number of LEDs you wish to control in your LED strip +#define NB_LEDS 8 + +#define LED_SPIRAL 1 + +static uint8_t txbuf[PREAMBLE_SIZE + DATA_SIZE + RESET_SIZE]; +static uint8_t get_protocol_eq(uint8_t data, int pos); + +/* + * This lib is meant to be used asynchronously, thus the colors contained in + * the txbuf will be sent in loop, so that the colors are always the ones you + * put in the table (the user thus have less to worry about) + * + * Since the data are sent via DMA, and the call to spiSend is a blocking one, + * the processor ressources are not used to much, if you see your program being + * too slow, simply add a: + * chThdSleepMilliseconds(x); + * after the spiSend, where you increment x untill you are satisfied with your + * program speed, another trick may be to lower this thread priority : your call + */ +static THD_WORKING_AREA(LEDS_THREAD_WA, 128); +static THD_FUNCTION(ledsThread, arg) { + (void) arg; + while(1){ + spiSend(&LEDS_SPI, PREAMBLE_SIZE + DATA_SIZE + RESET_SIZE, txbuf); + } +} + +#if LED_SPIRAL +/* + * 'Led spiral' is a simple demo in which we put all the leds to the same + * color, where this color does all the hsv circle in loop. + * If you want to launch the thread that will chage the led colors to the + * appropriate value, simply set LED_SPIRAL to 1. + */ +static THD_WORKING_AREA(HSVTRANS_WA, 128); +static THD_FUNCTION(hsv_transThread, arg){ + (void) arg; + hsv_color color = {0, 255, 127}; + while(1){ + color.h += 1; + color.h %= 256; + set_leds_color_hsv(color); + chThdSleepMilliseconds(50); + } +} +#endif + +static const SPIConfig spicfg = { + NULL, + GPIOB, + 15, + SPI_CR1_BR_1|SPI_CR1_BR_0 // baudrate : fpclk / 8 => 1tick is 0.32us +}; + +/* + * Function used to initialize the driver. + * + * Starts by shutting off all the LEDs. + * Then gets access on the LED_SPI driver. + * May eventually launch an animation on the LEDs (e.g. a thread setting the + * txbuff values) + */ +void leds_init(void){ + for(int i = 0; i < RESET_SIZE; i++) + txbuf[DATA_SIZE+i] = 0x00; + for (int i=0; i Date: Wed, 19 Dec 2018 03:28:31 +1100 Subject: Keyboard: Initial commit of WT8-A implementation (#4674) --- keyboards/wilba_tech/wt8_a/config.h | 115 +++++++++++++++++++++ keyboards/wilba_tech/wt8_a/info.json | 13 +++ .../wilba_tech/wt8_a/keymaps/default/keymap.c | 16 +++ keyboards/wilba_tech/wt8_a/readme.md | 15 +++ keyboards/wilba_tech/wt8_a/rules.mk | 68 ++++++++++++ keyboards/wilba_tech/wt8_a/wt8_a.c | 17 +++ keyboards/wilba_tech/wt8_a/wt8_a.h | 27 +++++ 7 files changed, 271 insertions(+) create mode 100644 keyboards/wilba_tech/wt8_a/config.h create mode 100644 keyboards/wilba_tech/wt8_a/info.json create mode 100644 keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c create mode 100644 keyboards/wilba_tech/wt8_a/readme.md create mode 100644 keyboards/wilba_tech/wt8_a/rules.mk create mode 100644 keyboards/wilba_tech/wt8_a/wt8_a.c create mode 100644 keyboards/wilba_tech/wt8_a/wt8_a.h diff --git a/keyboards/wilba_tech/wt8_a/config.h b/keyboards/wilba_tech/wt8_a/config.h new file mode 100644 index 0000000000..1c8522a1b5 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/config.h @@ -0,0 +1,115 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x6582 // wilba.tech +#define PRODUCT_ID 0x008A // 8-A +#define DEVICE_VER 0x0001 +#define MANUFACTURER wilba.tech +#define PRODUCT wilba.tech WT8-A +#define DESCRIPTION wilba.tech WT8-A + +/* key matrix size */ +#define MATRIX_ROWS 1 +#define MATRIX_COLS 8 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { E6 } +#define MATRIX_COL_PINS { F4, F1, B2, B6, F6, F7, D5, B4 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +// #define BACKLIGHT_PIN B7 +// #define BACKLIGHT_BREATHING +// #define BACKLIGHT_LEVELS 3 + + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +// Does not use WT_MONO_BACKLIGHT +// #define WT_MONO_BACKLIGHT + +#define DYNAMIC_KEYMAP_LAYER_COUNT 4 + +// EEPROM usage + +// TODO: refactor with new user EEPROM code (coming soon) +#define EEPROM_MAGIC 0x451F +#define EEPROM_MAGIC_ADDR 32 +// Bump this every time we change what we store +// This will automatically reset the EEPROM with defaults +// and avoid loading invalid data from the EEPROM +#define EEPROM_VERSION 0x08 +#define EEPROM_VERSION_ADDR 34 + +// Dynamic keymap starts after EEPROM version +#define DYNAMIC_KEYMAP_EEPROM_ADDR 35 +// Dynamic macro starts after dynamic keymaps (35+(4*1*8*2)) = (35+64) +#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 99 +#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 925 +#define DYNAMIC_KEYMAP_MACRO_COUNT 16 diff --git a/keyboards/wilba_tech/wt8_a/info.json b/keyboards/wilba_tech/wt8_a/info.json new file mode 100644 index 0000000000..c40d44db72 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/info.json @@ -0,0 +1,13 @@ +{ + "keyboard_name": "wilba.tech WT8-A", + "url": "https://wilba.tech", + "maintainer": "Wilba", + "bootloader": "atmel-dfu", + "width": 4, + "height": 2, + "layouts": { + "LAYOUT": { + "layout": [{"label":"x", "x":0, "y":0}, {"label":"x", "x":1, "y":0}, {"label":"x", "x":2, "y":0}, {"label":"x", "x":3, "y":0}, {"label":"x", "x":0, "y":1}, {"label":"x", "x":1, "y":1}, {"label":"x", "x":2, "y":1}, {"label":"x", "x":3, "y":1}] + } + } +} \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c b/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c new file mode 100644 index 0000000000..a9f40362c7 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/keymaps/default/keymap.c @@ -0,0 +1,16 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT( + KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8 ), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO), + + LAYOUT( + KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO) }; + diff --git a/keyboards/wilba_tech/wt8_a/readme.md b/keyboards/wilba_tech/wt8_a/readme.md new file mode 100644 index 0000000000..ab3cfdc55b --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/readme.md @@ -0,0 +1,15 @@ +# WILBA.TECH WT8-A + +![WILBA.TECH WT8-A](https://wilba.tech) + +WT8-A is an 8-key macropad PCB, designed for the Singa Ocelot. [More info at wilba.tech](https://wilba.tech/) + +Keyboard Maintainer: [Wilba6582](https://github.com/Wilba6582) +Hardware Supported: WILBA.TECH WT8-A +Hardware Availability: Singa Keyboards + +Make example for this keyboard (after setting up your build environment): + + make wilba_tech/wt8_a: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). \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/rules.mk b/keyboards/wilba_tech/wt8_a/rules.mk new file mode 100644 index 0000000000..f072c67198 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/rules.mk @@ -0,0 +1,68 @@ +# project specific files +SRC = keyboards/wilba_tech/wt_main.c + +# MCU name +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 + + +# Boot Section +BOOTLOADER = atmel-dfu + + +# Build Options +# change yes to no to disable +# +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +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 + +RAW_ENABLE = yes +DYNAMIC_KEYMAP_ENABLE = yes \ No newline at end of file diff --git a/keyboards/wilba_tech/wt8_a/wt8_a.c b/keyboards/wilba_tech/wt8_a/wt8_a.c new file mode 100644 index 0000000000..ccff6d62c9 --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/wt8_a.c @@ -0,0 +1,17 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 . + */ + +// Nothing to see here, move along... ;-) diff --git a/keyboards/wilba_tech/wt8_a/wt8_a.h b/keyboards/wilba_tech/wt8_a/wt8_a.h new file mode 100644 index 0000000000..0fb754f0ab --- /dev/null +++ b/keyboards/wilba_tech/wt8_a/wt8_a.h @@ -0,0 +1,27 @@ +/* Copyright 2018 Jason Williams (Wilba) + * + * 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 + +#include "quantum.h" + +#define ____ KC_NO + +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07 ) \ + { \ + {K00, K01, K02, K03, K04, K05, K06, K07 }, \ + } -- cgit v1.2.3 From 9eedaa88022f2e221ef3443ed35935e163b9ac95 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Wed, 19 Dec 2018 01:29:20 +0900 Subject: Keymap: Changed to use LAYOUT_kc() macro instead of LAYOUT() macro for easy maintenance. (#4676) --- keyboards/helix/rev2/keymaps/five_rows/keymap.c | 172 ++++++++++++------------ 1 file changed, 83 insertions(+), 89 deletions(-) diff --git a/keyboards/helix/rev2/keymaps/five_rows/keymap.c b/keyboards/helix/rev2/keymaps/five_rows/keymap.c index e293f59005..7b7d573d6a 100644 --- a/keyboards/helix/rev2/keymaps/five_rows/keymap.c +++ b/keyboards/helix/rev2/keymaps/five_rows/keymap.c @@ -47,22 +47,25 @@ enum custom_keycodes { DVORAK, EUCALYN, KEYPAD, - EISU, - KANA, - ZERO2, + KC_xEISU, + KC_xKANA, + KC_ZERO2, RGBRST }; -enum macro_keycodes { - KC_SAMPLEMACRO, -}; - - -// Fillers to make layering more clear -#define _______ KC_TRNS -#define XXXXXXX KC_NO //Macros -#define M_SAMPLE M(KC_SAMPLEMACRO) +#define KC_LOWER MO(_LOWER) +#define KC_RABS LT(_RAISE,KC_BSPC) +#define KC_RAEN LT(_RAISE,KC_ENT) +#define KC_FF12 LT(_PADFUNC,KC_F12) +#define KC_____ _______ +#define KC_XXXX XXXXXXX +#define KC_ADJ MO(_ADJUST) +#define KC_LSMI LSFT(KC_MINS) +#define KC_LSEQ LSFT(KC_EQL) +#define KC_LSRB LSFT(KC_RBRC) +#define KC_LSLB LSFT(KC_LBRC) +#define ___ _______ #if HELIX_ROWS == 5 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { @@ -80,13 +83,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ - [_QWERTY] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \ - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RCTL, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_QUOT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \ - LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ + [_QWERTY] = LAYOUT_kc( \ + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \ + TAB, Q, W, E, R, T, Y, U, I, O, P, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \ + LSFT, Z, X, C, V, B, GRV, QUOT, N, M, COMM, DOT, SLSH, RSFT, \ + LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \ ), /* Colemak @@ -102,13 +104,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ - [_COLEMAK] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \ - KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_RCTL, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_QUOT, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \ - MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \ - LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ + [_COLEMAK] = LAYOUT_kc( \ + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \ + TAB, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \ + LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \ + LSFT, Z, X, C, V, B, GRV, QUOT, K, M, COMM, DOT, SLSH, RSFT, \ + LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \ ), /* Dvorak @@ -124,13 +125,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ - [_DVORAK] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_RCTL, \ - KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_GRV, KC_SLSH, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \ - MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \ - LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ + [_DVORAK] = LAYOUT_kc( \ + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \ + TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \ + LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \ + LSFT, SCLN, Q, J, K, X, GRV, SLSH, B, M, W, V, Z, RSFT, \ + LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \ ), /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) @@ -146,13 +146,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | * `-------------------------------------------------------------------------------------------------' */ - [_EUCALYN] = LAYOUT( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ - KC_TAB, KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, KC_BSLS, \ - KC_LCTL, KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_RCTL, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_GRV, KC_QUOT, KC_B, KC_H, KC_J, KC_L, KC_SLSH, KC_RSFT, \ - MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \ - LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \ + [_EUCALYN] = LAYOUT_kc( \ + ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \ + TAB, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \ + LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \ + LSFT, Z, X, C, V, F, GRV, QUOT, B, H, J, L, SLSH, RSFT, \ + LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \ ), /* Keypad @@ -168,13 +167,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | 0 | , | . | Enter| F5 | F10 | F12 | F12 | F5 | F10 | Enter| 0 | , | . | * `-------------------------------------------------------------------------------------------------' */ - [_KEYPAD] = LAYOUT( \ - KC_TAB, KC_PSLS, KC_PAST, KC_DEL, KC_F1, KC_F6, KC_F1, KC_F6, KC_DEL, KC_TAB, KC_PSLS, KC_PAST, \ - KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, KC_F2, KC_F7, KC_F2, KC_F7, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, \ - KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, KC_F3, KC_F8, KC_F3, KC_F8, KC_PMNS, KC_KP_4, KC_KP_5, KC_KP_6, \ - KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, KC_F4, KC_F9, KC_F11, KC_F11, KC_F4, KC_F9, KC_PPLS, KC_KP_1, KC_KP_2, KC_KP_3, \ - KC_KP_0, KC_COMM, KC_PDOT, KC_PENT, KC_F5, KC_F10, LT(_PADFUNC,KC_F12), - LT(_PADFUNC,KC_F12),KC_F5, KC_F10, KC_PENT, KC_KP_0, KC_COMM, KC_PDOT \ + [_KEYPAD] = LAYOUT_kc( \ + TAB, PSLS, PAST, DEL, F1, F6, F1, F6, DEL, TAB, PSLS, PAST, \ + KP_7, KP_8, KP_9, BSPC, F2, F7, F2, F7, BSPC, KP_7, KP_8, KP_9, \ + KP_4, KP_5, KP_6, PMNS, F3, F8, F3, F8, PMNS, KP_4, KP_5, KP_6, \ + KP_1, KP_2, KP_3, PPLS, F4, F9, F11, F11, F4, F9, PPLS, KP_1, KP_2, KP_3, \ + KP_0, COMM, PDOT, PENT, F5, F10, FF12, FF12, F5, F10, PENT, KP_0, COMM, PDOT \ ), /* AUX modifier key layer @@ -190,12 +188,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | 00 | | | | | | | | | | | 00 | | * `-------------------------------------------------------------------------------------------------' */ - [_KAUX] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, ZERO2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ZERO2, _______ \ + [_KAUX] = LAYOUT_kc( \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____,ZERO2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ZERO2,____ \ ), /* Keypad function layer @@ -211,13 +209,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ - [_PADFUNC] = LAYOUT( \ - XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, KC_SLCK, KC_PSCR, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_PGUP, KC_PGUP, KC_UP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, KC_DEL, KC_INS, KC_LEFT, KC_DOWN, KC_RGHT, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, KC_END, XXXXXXX, KC_PGDN,MO(_ADJUST), - MO(_ADJUST), KC_PGDN, XXXXXXX, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + [_PADFUNC] = LAYOUT_kc( \ + XXXX, XXXX, XXXX, PAUS, SLCK, PSCR, PSCR, SLCK, PAUS, XXXX, XXXX, XXXX, \ + XXXX, XXXX, XXXX, HOME, UP, PGUP, PGUP, UP, HOME, XXXX, XXXX, XXXX, \ + XXXX, DEL, INS, LEFT, DOWN, RGHT, LEFT, DOWN, RGHT, INS, DEL, XXXX, \ + XXXX, XXXX, XXXX, END, XXXX, PGDN, ADJ, ADJ, PGDN, XXXX, END, XXXX, XXXX, XXXX, \ + XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, ____, ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX \ ), /* Lower @@ -233,13 +230,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | PrtSc| | | | | | | | | PrtSc| | | * `-------------------------------------------------------------------------------------------------' */ - [_LOWER] = LAYOUT( \ - XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \ - XXXXXXX, XXXXXXX, KC_PAUS, KC_SLCK, KC_INS, XXXXXXX, XXXXXXX, KC_INS, KC_SLCK, KC_PAUS, XXXXXXX, KC_F12, \ - _______, KC_HOME, XXXXXXX, KC_UP, KC_DEL, KC_PGUP, KC_PGUP, KC_DEL, KC_UP, XXXXXXX, KC_HOME, _______, \ - _______, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, XXXXXXX,KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, \ - _______, _______, KC_PSCR, _______, _______, _______, MO(_ADJUST), - MO(_ADJUST), _______, _______, _______, KC_PSCR, _______, _______ \ + [_LOWER] = LAYOUT_kc( \ + XXXX, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ + XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, F12, \ + ____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \ + ____, END, LEFT, DOWN, RGHT, PGDN, XXXX, XXXX, PGDN, LEFT, DOWN, RGHT, END, ____, \ + ____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \ ), /* Raise @@ -255,13 +251,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | | | | * `-------------------------------------------------------------------------------------------------' */ - [_RAISE] = LAYOUT( \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LSFT(KC_MINS), KC_MINS, KC_EQL, LSFT(KC_EQL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), KC_LBRC, KC_RBRC, LSFT(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, _______, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EISU, EISU, KANA, KANA, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, \ - MO(_ADJUST),MO(_ADJUST),XXXXXXX, _______, _______, XXXXXXX, _______, - _______, XXXXXXX, _______, _______, XXXXXXX,MO(_ADJUST),MO(_ADJUST) \ + [_RAISE] = LAYOUT_kc( \ + XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \ + XXXX, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \ + ____, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, ____, \ + ____, XXXX, XXXX, XXXX, XXXX,xEISU,xEISU, xKANA,xKANA,MNXT, VOLD, VOLU, MPLY, ____, \ + ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \ ), /* Adjust (Lower + Raise) @@ -278,11 +273,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------------------------------------------------------------------------------------------------' */ [_ADJUST] = LAYOUT( \ - XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \ - XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \ - RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, \ - RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \ - _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ + XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \ + XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \ + RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, \ + RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ ), /* AUX modifier key layer @@ -298,13 +293,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | BS | Enter| | | | | | | | * `-------------------------------------------------------------------------------------------------' */ - [_AUX] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ - _______, _______, _______, _______, _______, KC_BSPC, LT(_RAISE,KC_ENT), \ - _______, _______, _______, _______, _______, _______, _______ \ + [_AUX] = LAYOUT_kc( \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \ + ____, ____, ____, ____, ____, BSPC, RAEN, ____, ____, ____, ____, ____, ____, ____ \ ) }; @@ -400,13 +394,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case ZERO2: + case KC_ZERO2: if (record->event.pressed) { SEND_STRING("00"); } return false; break; - case EISU: + case KC_xEISU: if (record->event.pressed) { if(keymap_config.swap_lalt_lgui==false){ register_code(KC_LANG2); @@ -418,7 +412,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case KANA: + case KC_xKANA: if (record->event.pressed) { if(keymap_config.swap_lalt_lgui==false){ register_code(KC_LANG1); -- cgit v1.2.3 From e59f331268e28657954bdc7aa2f2eab09796610b Mon Sep 17 00:00:00 2001 From: Matthew Lyon Date: Tue, 18 Dec 2018 08:37:04 -0800 Subject: Keymap: @mattly's planck layout (#4678) --- keyboards/planck/keymaps/mattly/config.h | 43 ++++++++ keyboards/planck/keymaps/mattly/keymap.c | 176 ++++++++++++++++++++++++++++++ keyboards/planck/keymaps/mattly/readme.md | 28 +++++ keyboards/planck/keymaps/mattly/rules.mk | 2 + 4 files changed, 249 insertions(+) create mode 100644 keyboards/planck/keymaps/mattly/config.h create mode 100644 keyboards/planck/keymaps/mattly/keymap.c create mode 100644 keyboards/planck/keymaps/mattly/readme.md create mode 100644 keyboards/planck/keymaps/mattly/rules.mk diff --git a/keyboards/planck/keymaps/mattly/config.h b/keyboards/planck/keymaps/mattly/config.h new file mode 100644 index 0000000000..52e39ec7f4 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/config.h @@ -0,0 +1,43 @@ +#pragma once + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(PLANCK_SOUND) + // #define STARTUP_SONG SONG(NO_SOUND) + + #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ + SONG(COLEMAK_SOUND), \ + SONG(DVORAK_SOUND) \ + } +#endif + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ + +#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 2 + +// Most tactile encoders have detents every 4 stages +#define ENCODER_RESOLUTION 4 + +#define IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD +#define TAPPING_TOGGLE 2 +#define TAPPING_TERM 200 diff --git a/keyboards/planck/keymaps/mattly/keymap.c b/keyboards/planck/keymaps/mattly/keymap.c new file mode 100644 index 0000000000..2495f8a19c --- /dev/null +++ b/keyboards/planck/keymaps/mattly/keymap.c @@ -0,0 +1,176 @@ +/* Copyright 2015-2017 Jack Humbert + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "muse.h" + +extern keymap_config_t keymap_config; + +enum planck_layers { + _QWERTY, + _NUMBER, + _SYMBOL, + _FUNC, + _ADJUST +}; + +enum planck_keycodes { + QWERTY = SAFE_RANGE +}; + +#define SPC_SHF MT(MOD_LSFT, KC_SPC) + +#define ENT_FUN LT(_FUNC, KC_ENT) +#define ESC_FUN LT(_FUNC, KC_ESC) +#define TAB_NUM LT(_NUMBER, KC_TAB) +#define BSP_SYM LT(_SYMBOL, KC_BSPC) +#define DEL_ADJ LT(_ADJUST, KC_DEL) + +#define SYMLOCK TG(_SYMBOL) +#define NUMLOCK TG(_NUMBER) + +#define ONE_CTL OSM(MOD_LCTL) +#define ONE_ALT OSM(MOD_LALT) +#define ONE_GUI OSM(MOD_LGUI) +#define ONE_HYP OSM(MOD_HYPR) +#define ONE_MEH OSM(MOD_MEH) +#define ONE_WRP OSM(MOD_LCTL | MOD_LALT | MOD_LGUI) + +#define A_CTRL MT(MOD_LCTL, KC_A) +#define S_ALT MT(MOD_LALT, KC_S) +#define D_GUI MT(MOD_LGUI, KC_D) +#define F_SHFT MT(MOD_LSFT, KC_F) +#define G_NUM LT(_NUMBER, KC_G) +#define H_NAV LT(_SYMBOL, KC_H) +#define J_SHFT MT(MOD_RSFT, KC_J) +#define K_GUI MT(MOD_RGUI, KC_K) +#define L_ALT MT(MOD_RALT, KC_L) +#define MINSCTL MT(MOD_RCTL, KC_MINS) +#define SCL_CTL MT(MOD_RCTL, KC_SCLN) + +#define BWORD LALT(KC_LEFT) +#define FWORD LALT(KC_RIGHT) + +#define NWIN LGUI(KC_GRV) +#define PWIN LGUI(LSFT(KC_GRV)) +#define NTAB LGUI(LSFT(KC_RBRC)) +#define PTAB LGUI(LSFT(KC_LBRC)) + +#define XMSNCTL HYPR(KC_F14) +#define XDSKTOP HYPR(KC_F15) +#define XNXTSPC HYPR(KC_F16) +#define XPRVSPC HYPR(KC_F17) +#define XNOTIFY HYPR(KC_F18) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +/* Querty + | # | q | w | e | r | t | y | u | i | o | p | - | + | | | | | | | | | | | | | + |------|------|------|------|------|------|------|------|------|------|------|------| + | ( | a | s | d | f | g | h | j | k | l | ; | ' | + | | CTRL | ALT | GUI | SHIFT| NUMBR| SYMBL| SHIFT| GUI | ALT | CTRL | | + |------|------|------|------|------|------|------|------|------|------|------|------| + | [ | z | x | c | v | b | n | m | , | . | / | > | + | | | | | | | | | | | | | + |------|------|------|------|------|------|------|------|------|------|------|------| + | ctrl | alt | gui | Esc | Tab | space | Bksp | Del | hyper| meh | warp | + | | | | FUNC |NUMBER| SHIFT |SYMBOL| | | | | + */ + [_QWERTY] = LAYOUT_planck_grid( + KC_HASH, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SCLN, + KC_LPRN, A_CTRL, S_ALT, D_GUI, F_SHFT, G_NUM, H_NAV, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, + KC_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RABK, + KC_CAPS, ONE_ALT, ONE_GUI, ESC_FUN, TAB_NUM, SPC_SHF, SPC_SHF, BSP_SYM, DEL_ADJ, ONE_HYP, ONE_MEH, ONE_WRP + ), + +/* Symbol + | | & | ` | ~ | [ | ] | < | > | + | | | | - | + | | $ | % | = | ( | ) | | : | ! | @ | * | ' | + | | | ^ | # | { | } | | " | | | \ | | | + | | | | | LOCK | | .... | | | | | + */ + [_SYMBOL] = LAYOUT_planck_grid( + _______, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, _______, + _______, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_ASTR, _______, + _______, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, XXXXXXX, _______, + _______, _______, _______, _______, SYMLOCK, _______, _______, _______, _______, _______, _______, _______ + ), +/* Number + | | |<-word| up |word->| PgUp | . | 7 | 8 | 9 | + | * | + | | Enter| left | down | right| PgDn | 0 | 4 | 5 | 6 | - | / | + | | Bksp | Home | tab | End | Del | , | 1 | 2 | 3 | = | % | + | | | | | .... | | LOCK | | : | $ | | + */ +[_NUMBER] = LAYOUT_planck_grid( + XXXXXXX, _______, BWORD, KC_UP, FWORD, KC_PGUP, KC_DOT, KC_7, KC_8, KC_9, KC_PLUS, KC_ASTR, + XXXXXXX, KC_ENT , KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_0, KC_4, KC_5, KC_6, KC_MINS, KC_SLSH, + XXXXXXX, KC_BSPC, KC_HOME, KC_TAB, KC_END, KC_DEL, KC_COMM, KC_1, KC_2, KC_3, KC_EQL, KC_PERC, + _______, _______, _______, _______, _______, _______, _______, NUMLOCK, _______, KC_COLN, KC_DLR, _______ +), +/* Function + * | | Mctl | Pspc | Nwin | Nspc | Desk | | F7 | F8 | F9 | F10 | F13 | + * | | Nctr | Ptab | Pwin | Ntab | | | F4 | F5 | F6 | F11 | F14 | + * | Mute | Vol- | Vol+ | Trk- | Trk+ | Play | | F1 | F2 | F3 | F12 | F15 | + * | | | | | | | | | | | | | + */ +[_FUNC] = LAYOUT_planck_grid( + XXXXXXX, XMSNCTL, XPRVSPC, NWIN, XNXTSPC, XDSKTOP, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F13, + XXXXXXX, XNOTIFY, PTAB, PWIN, NTAB, XXXXXXX, XXXXXXX, KC_F4, KC_F5, KC_F6, KC_F11, KC_F14, + KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F12, KC_F15, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Reset| Debug| | | | | | | | | | | + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * | | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_planck_grid( + RESET, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +#ifdef AUDIO_ENABLE +#endif + +uint32_t layer_state_set_user(uint32_t state) { + /* state = update_tri_layer_state(state, _SYMBOL, _NUMBER, _ADJUST); */ + return state; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + print("mode just switched to qwerty and this is a huge string\n"); + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + } + return true; +} + + diff --git a/keyboards/planck/keymaps/mattly/readme.md b/keyboards/planck/keymaps/mattly/readme.md new file mode 100644 index 0000000000..58f2b979c6 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/readme.md @@ -0,0 +1,28 @@ +# Mattly's Planck layout + +This planck layout is optimized for, in order: + +- moving work from my pinkies to my thumbs +- writing lisp/clojure code in my evil-mode based emacs setup +- tapping out messages in chat applications such as slack +- writing english in markdown files in said emacs +- navigating mac applications +- writing english in a web browser on a macintosh +- writing other programming languages' code in said emacs +- writing english in other contexts +- literally anything else + +## oddities: + +You may notice that `enter` is on a layer. This is an experiment and I kind of +like it so far, since many programs interpret that keystroke as a "commit" +of some kind. + +## works in progress + +I'm trying to figure out how to make some things easier to do with the mouse or +one-handed. Right now the combo of entering numbers and using a mouse with my +right hand is kind of annoying. I want to be able to toggle layers on, but only +from within that layer. + +![mattly's keymap](https://lyonheart.us/etc/mattly-keymap.png) diff --git a/keyboards/planck/keymaps/mattly/rules.mk b/keyboards/planck/keymaps/mattly/rules.mk new file mode 100644 index 0000000000..7210cf34f0 --- /dev/null +++ b/keyboards/planck/keymaps/mattly/rules.mk @@ -0,0 +1,2 @@ +AUDIO_ENABLE = yes +SRC += muse.c -- cgit v1.2.3 From 06f19017839c25c4b41a16a9d9cf12b66ef8ade9 Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Tue, 18 Dec 2018 09:14:56 -0800 Subject: Keymap: A Planck style keymap with iris flair (#4677) * A Planck style keymap with iris flair - Re-arrange layers to be more planck like. - move backspace to right thumb - replace backspace with minus, more useful for coding - replace center keys with brackets - MT(MOD_LCTRL and ESCAPE) - Use QMK-DFU for bootloader - add a soft reset to keymap * Feedback from reviewers - remove redundant define (noroadsleft) - remove unused layer switch case (drashna) --- keyboards/ergotravel/keymaps/yanfali/config.h | 38 +++++++++ keyboards/ergotravel/keymaps/yanfali/keymap.c | 108 ++++++++++++++++++++++++++ keyboards/ergotravel/keymaps/yanfali/rules.mk | 1 + 3 files changed, 147 insertions(+) create mode 100644 keyboards/ergotravel/keymaps/yanfali/config.h create mode 100644 keyboards/ergotravel/keymaps/yanfali/keymap.c create mode 100644 keyboards/ergotravel/keymaps/yanfali/rules.mk diff --git a/keyboards/ergotravel/keymaps/yanfali/config.h b/keyboards/ergotravel/keymaps/yanfali/config.h new file mode 100644 index 0000000000..eeca26ce1d --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/config.h @@ -0,0 +1,38 @@ +/* +Copyright 2017 Pierre Constantineau + +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 + +/* 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/ergotravel/keymaps/yanfali/keymap.c b/keyboards/ergotravel/keymaps/yanfali/keymap.c new file mode 100644 index 0000000000..399dc9998c --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/keymap.c @@ -0,0 +1,108 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#define _QWERTY 0 +#define _LOWER 1 +#define _RAISE 2 +#define _ADJUST 16 + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + LOWER, + RAISE, + ADJUST, +}; + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + [_QWERTY] = LAYOUT( + //,---------------------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_LBRC, KC_RBRC, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINUS, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + MT(MOD_LCTL, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_LCBR, KC_RCBR, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_NO, KC_NO, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|---------------------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + ADJUST, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_BSPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT + //`---------------------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_LOWER] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, KC_Y, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + KC_CAPS, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + + [_RAISE] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, _______, _______, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_Q, KC_W, KC_E, KC_R, KC_T, _______, _______, KC_Y, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, KC_Z, KC_X, KC_C, KC_V, KC_B, _______, _______, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ), + + [_ADJUST] = LAYOUT( + //,--------+--------+--------+--------+--------+--------+--------. ,--------+--------+--------+--------+--------+--------+--------. + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, RESET, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + //|--------+--------+--------+--------+--------+--------+--------| |--------+--------+--------+--------+--------+--------+--------| + _______, _______, _______, _______, _______, _______, _______, RAISE, _______, _______, _______, _______ + //`--------+--------+--------+--------+--------+--------+--------/ \--------+--------+--------+--------+--------+--------+--------' + ) + +}; + + + + + + + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case LOWER: + if (record->event.pressed) { + layer_on(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_LOWER); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case RAISE: + if (record->event.pressed) { + layer_on(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } else { + layer_off(_RAISE); + update_tri_layer(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + } + return true; +} diff --git a/keyboards/ergotravel/keymaps/yanfali/rules.mk b/keyboards/ergotravel/keymaps/yanfali/rules.mk new file mode 100644 index 0000000000..0613ea8667 --- /dev/null +++ b/keyboards/ergotravel/keymaps/yanfali/rules.mk @@ -0,0 +1 @@ +BOOTLOADER = qmk-dfu -- cgit v1.2.3 From 8181c8dc97ddd073a94430032c2505ec2e4d4a05 Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Sat, 15 Dec 2018 22:44:48 -0800 Subject: FC980C: refactor and Configurator update - fc980c.h - updated to #pragma once method - layout macro visual alignment - info.json - fixed JSON ordering (keys were being assigned out-of-order) - default keymap - visual alignment - deleted unused fn_actions block --- keyboards/fc980c/fc980c.h | 60 ++++++-------- keyboards/fc980c/info.json | 197 +++++++++++++++++++++++---------------------- 2 files changed, 123 insertions(+), 134 deletions(-) diff --git a/keyboards/fc980c/fc980c.h b/keyboards/fc980c/fc980c.h index 74c4680613..f20c102e55 100644 --- a/keyboards/fc980c/fc980c.h +++ b/keyboards/fc980c/fc980c.h @@ -14,11 +14,9 @@ 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 . */ -#ifndef FC980C_H -#define FC980C_H +#pragma once #include "quantum.h" -// #include "quantum_keycodes.h" /* ---------------------------------------------------------------------------------------------------------------------- @@ -37,41 +35,31 @@ along with this program. If not, see . ---------------------------------------------------------------------------------------------------------------------- */ -#define LAYOUT( \ - K0D, K2D, K5D, K3D, K6D, K7D, K7F, K7E, K7C, K72, K71, K70, K73, K74, K76, K77, K75, \ - K0A, K69, K59, K58, K5B, K6F, K5F, K5E, K6C, K5C, K52, K51, K50, K55, K54, K56, K57, K65, \ - K6A, K39, K68, K6B, K3B, K3F, K6E, K3E, K3C, K62, K61, K60, K33, K53, K64, K66, K67, K25, \ - K3A, K29, K38, K28, K2B, K2F, K2E, K2C, K1C, K32, K31, K20, K63, K24, K26, K27, \ - K2A, K18, K08, K1B, K0B, K1F, K1E, K0E, K22, K11, K21, K30, K34, K14, K16, K17, K15, \ - K1A, K09, K19, K0F, K02, K01, K10, K00, K04, K06, K07, K05) \ - { \ - {K00, K01, K02, KC_NO, K04, K05, K06, K07, \ - K08, K09, K0A, K0B, KC_NO, K0D, K0E, K0F}, \ - {K10, K11, KC_NO, KC_NO, K14, K15, K16, K17, \ - K18, K19, K1A, K1B, K1C, KC_NO, K1E, K1F}, \ - {K20, K21, K22, KC_NO, K24, K25, K26, K27, \ - K28, K29, K2A, K2B, K2C, K2D, K2E, K2F}, \ - {K30, K31, K32, K33, K34, KC_NO, KC_NO, KC_NO, \ - K38, K39, K3A, K3B, K3C, K3D, K3E, K3F}, \ - {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}, \ - {K50, K51, K52, K53, K54, K55, K56, K57, \ - K58, K59, KC_NO, K5B, K5C, K5D, K5E, K5F}, \ - {K60, K61, K62, K63, K64, K65, K66, K67, \ - K68, K69, K6A, K6B, K6C, K6D, K6E, K6F}, \ - { \ - K70, K71, K72, K73, K74, K75, K76, K77, \ - KC_NO, KC_NO, KC_NO, KC_NO, K7C, K7D, K7E, K7F \ - } \ - } +#define LAYOUT( \ + K0D, K2D, K5D, K3D, K6D, K7D, K7F, K7E, K7C, K72, K71, K70, K73, K74, K76, K77, K75, \ + K0A, K69, K59, K58, K5B, K6F, K5F, K5E, K6C, K5C, K52, K51, K50, K55, K54, K56, K57, K65, \ + K6A, K39, K68, K6B, K3B, K3F, K6E, K3E, K3C, K62, K61, K60, K33, K53, K64, K66, K67, K25, \ + K3A, K29, K38, K28, K2B, K2F, K2E, K2C, K1C, K32, K31, K20, K63, K24, K26, K27, \ + K2A, K18, K08, K1B, K0B, K1F, K1E, K0E, K22, K11, K21, K30, K34, K14, K16, K17, K15, \ + K1A, K09, K19, K0F, K02, K01, K10, K00, K04, K06, K07, K05 \ +) { \ + { K00, K01, K02, KC_NO, K04, K05, K06, K07, K08, K09, K0A, K0B, KC_NO, K0D, K0E, K0F }, \ + { K10, K11, KC_NO, KC_NO, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, KC_NO, K1E, K1F }, \ + { K20, K21, K22, KC_NO, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, K2F }, \ + { K30, K31, K32, K33, K34, KC_NO, KC_NO, KC_NO, K38, K39, K3A, K3B, K3C, K3D, K3E, K3F }, \ + { 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 }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, KC_NO, K5B, K5C, K5D, K5E, K5F }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C, K6D, K6E, K6F }, \ + { K70, K71, K72, K73, K74, K75, K76, K77, KC_NO, KC_NO, KC_NO, KC_NO, K7C, K7D, K7E, K7F } \ +} /* LAYOUT( - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______,_______,_______,_______, - _______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______,_______,_______, - _______, _______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______,_______,_______, - _______,_______,_______, _______, _______,_______,_______, _______,_______,_______, _______,_______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ) */ diff --git a/keyboards/fc980c/info.json b/keyboards/fc980c/info.json index f3007f2f84..a15ff216ca 100644 --- a/keyboards/fc980c/info.json +++ b/keyboards/fc980c/info.json @@ -6,105 +6,106 @@ "height": 6.75, "layouts": { "LAYOUT": { + "key_count": 98, "layout": [ - { "label": "Esc", "x": 0, "y": 0 }, - { "label": "F1", "x": 2, "y": 0 }, - { "label": "F2", "x": 3, "y": 0 }, - { "label": "F3", "x": 4, "y": 0 }, - { "label": "F4", "x": 5, "y": 0 }, - { "label": "F5", "x": 6.5, "y": 0 }, - { "label": "F6", "x": 7.5, "y": 0 }, - { "label": "F7", "x": 8.5, "y": 0 }, - { "label": "F8", "x": 9.5, "y": 0 }, - { "label": "F9", "x": 11, "y": 0 }, - { "label": "F10", "x": 12, "y": 0 }, - { "label": "F11", "x": 13, "y": 0 }, - { "label": "F12", "x": 14, "y": 0 }, - { "label": "Delete", "x": 15.5, "y": 0 }, - { "label": "Insert", "x": 16.5, "y": 0 }, - { "label": "Pg Up", "x": 17.5, "y": 0 }, - { "label": "Pg Dn", "x": 18.5, "y": 0 }, - { "label": "~", "x": 0, "y": 1.5 }, - { "label": "!", "x": 1, "y": 1.5 }, - { "label": "@", "x": 2, "y": 1.5 }, - { "label": "#", "x": 3, "y": 1.5 }, - { "label": "$", "x": 4, "y": 1.5 }, - { "label": "%", "x": 5, "y": 1.5 }, - { "label": "^", "x": 6, "y": 1.5 }, - { "label": "&", "x": 7, "y": 1.5 }, - { "label": "*", "x": 8, "y": 1.5 }, - { "label": "(", "x": 9, "y": 1.5 }, - { "label": ")", "x": 10, "y": 1.5 }, - { "label": "_", "x": 11, "y": 1.5 }, - { "label": "+", "x": 12, "y": 1.5 }, - { "label": "Backspace", "x": 13, "y": 1.5, "w": 2 }, - { "label": "Num Lock", "x": 15.5, "y": 1.5 }, - { "label": "/", "x": 16.5, "y": 1.5 }, - { "label": "*", "x": 17.5, "y": 1.5 }, - { "label": "-", "x": 18.5, "y": 1.5 }, - { "label": "Tab", "x": 0, "y": 2.5, "w": 1.5 }, - { "label": "Q", "x": 1.5, "y": 2.5 }, - { "label": "W", "x": 2.5, "y": 2.5 }, - { "label": "E", "x": 3.5, "y": 2.5 }, - { "label": "R", "x": 4.5, "y": 2.5 }, - { "label": "T", "x": 5.5, "y": 2.5 }, - { "label": "Y", "x": 6.5, "y": 2.5 }, - { "label": "U", "x": 7.5, "y": 2.5 }, - { "label": "I", "x": 8.5, "y": 2.5 }, - { "label": "O", "x": 9.5, "y": 2.5 }, - { "label": "P", "x": 10.5, "y": 2.5 }, - { "label": "{", "x": 11.5, "y": 2.5 }, - { "label": "}", "x": 12.5, "y": 2.5 }, - { "label": "|", "x": 13.5, "y": 2.5, "w": 1.5 }, - { "label": "7", "x": 15.5, "y": 2.5 }, - { "label": "8", "x": 16.5, "y": 2.5 }, - { "label": "9", "x": 17.5, "y": 2.5 }, - { "label": "+", "x": 18.5, "y": 2.5, "h": 2 }, - { "label": "Caps Lock", "x": 0, "y": 3.5, "w": 1.75 }, - { "label": "A", "x": 1.75, "y": 3.5 }, - { "label": "S", "x": 2.75, "y": 3.5 }, - { "label": "D", "x": 3.75, "y": 3.5 }, - { "label": "F", "x": 4.75, "y": 3.5 }, - { "label": "G", "x": 5.75, "y": 3.5 }, - { "label": "H", "x": 6.75, "y": 3.5 }, - { "label": "J", "x": 7.75, "y": 3.5 }, - { "label": "K", "x": 8.75, "y": 3.5 }, - { "label": "L", "x": 9.75, "y": 3.5 }, - { "label": ":", "x": 10.75, "y": 3.5 }, - { "label": "\"", "x": 11.75, "y": 3.5 }, - { "label": "Enter", "x": 12.75, "y": 3.5, "w": 2.25 }, - { "label": "4", "x": 15.5, "y": 3.5 }, - { "label": "5", "x": 16.5, "y": 3.5 }, - { "label": "6", "x": 17.5, "y": 3.5 }, - { "label": "Shift", "x": 0, "y": 4.5, "w": 2.25 }, - { "label": "Z", "x": 2.25, "y": 4.5 }, - { "label": "X", "x": 3.25, "y": 4.5 }, - { "label": "C", "x": 4.25, "y": 4.5 }, - { "label": "V", "x": 5.25, "y": 4.5 }, - { "label": "B", "x": 6.25, "y": 4.5 }, - { "label": "N", "x": 7.25, "y": 4.5 }, - { "label": "M", "x": 8.25, "y": 4.5 }, - { "label": "<", "x": 9.25, "y": 4.5 }, - { "label": ">", "x": 10.25, "y": 4.5 }, - { "label": "?", "x": 11.25, "y": 4.5 }, - { "label": "Shift", "x": 12.25, "y": 4.5, "w": 1.75 }, - { "label": "1", "x": 15.5, "y": 4.5 }, - { "label": "2", "x": 16.5, "y": 4.5 }, - { "label": "3", "x": 17.5, "y": 4.5 }, - { "label": "Enter", "x": 18.5, "y": 4.5, "h": 2 }, - { "label": "\u2191", "x": 14.25, "y": 4.75 }, - { "label": "Ctrl", "x": 0, "y": 5.5, "w": 1.25 }, - { "label": "Win", "x": 1.25, "y": 5.5 }, - { "label": "Alt", "x": 2.25, "y": 5.5, "w": 1.25 }, - { "x": 3.5, "y": 5.5, "w": 6 }, - { "label": "Alt", "x": 9.5, "y": 5.5, "w": 1.25 }, - { "label": "Ctrl", "x": 10.75, "y": 5.5 }, - { "label": "Fn", "x": 11.75, "y": 5.5, "w": 1.25 }, - { "label": "0", "x": 16.5, "y": 5.5 }, - { "label": ".", "x": 17.5, "y": 5.5 }, - { "label": "\u2190", "x": 13.25, "y": 5.75 }, - { "label": "\u2193", "x": 14.25, "y": 5.75 }, - { "label": "\u2192", "x": 15.25, "y": 5.75 } + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"Delete", "x":15.5, "y":0}, + {"label":"Insert", "x":16.5, "y":0}, + {"label":"Page Up", "x":17.5, "y":0}, + {"label":"Page Down", "x":18.5, "y":0}, + {"label":"`", "x":0, "y":1.5}, + {"label":"1", "x":1, "y":1.5}, + {"label":"2", "x":2, "y":1.5}, + {"label":"3", "x":3, "y":1.5}, + {"label":"4", "x":4, "y":1.5}, + {"label":"5", "x":5, "y":1.5}, + {"label":"6", "x":6, "y":1.5}, + {"label":"7", "x":7, "y":1.5}, + {"label":"8", "x":8, "y":1.5}, + {"label":"9", "x":9, "y":1.5}, + {"label":"0", "x":10, "y":1.5}, + {"label":"-", "x":11, "y":1.5}, + {"label":"=", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Num Lock", "x":15.5, "y":1.5}, + {"label":"/", "x":16.5, "y":1.5}, + {"label":"*", "x":17.5, "y":1.5}, + {"label":"-", "x":18.5, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"[", "x":11.5, "y":2.5}, + {"label":"]", "x":12.5, "y":2.5}, + {"label":"\\", "x":13.5, "y":2.5, "w":1.5}, + {"label":"7", "x":15.5, "y":2.5}, + {"label":"8", "x":16.5, "y":2.5}, + {"label":"9", "x":17.5, "y":2.5}, + {"label":"+", "x":18.5, "y":2.5, "h":2}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":";", "x":10.75, "y":3.5}, + {"label":"'", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"4", "x":15.5, "y":3.5}, + {"label":"5", "x":16.5, "y":3.5}, + {"label":"6", "x":17.5, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":",", "x":9.25, "y":4.5}, + {"label":".", "x":10.25, "y":4.5}, + {"label":"/", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Up", "x":14.25, "y":4.75}, + {"label":"1", "x":15.5, "y":4.5}, + {"label":"2", "x":16.5, "y":4.5}, + {"label":"3", "x":17.5, "y":4.5}, + {"label":"Enter", "x":18.5, "y":4.5, "h":2}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5}, + {"label":"Alt", "x":2.25, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.5, "y":5.5, "w":6}, + {"label":"Alt", "x":9.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":10.75, "y":5.5}, + {"label":"Fn", "x":11.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":13.25, "y":5.75}, + {"label":"Down", "x":14.25, "y":5.75}, + {"label":"Right", "x":15.25, "y":5.75}, + {"label":"0", "x":16.5, "y":5.5}, + {"label":".", "x":17.5, "y":5.5} ] } } -- cgit v1.2.3 From 584a7a03952dc5950b22fa4d035dc1c8ee98c87f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 18 Dec 2018 09:16:06 -0800 Subject: Keyboard: Espectro refactor and Configurator support (#4666) * Espectro: layout macro refactor - updated to #pragma once method - restructure LAYOUT_all data as block comment - Configurator was reading the LAYOUT_all macro even though it was commented out. - updated all keyswitch arguments to use K notation - add LAYOUT_iso macro - add info.json file for Configurator support * Espectro: keymap refactor - deleted unused MODS_CTRL_MASK definitions - iso keymap refactored to use LAYOUT_iso macro - default and iso keymaps refactored for readability --- keyboards/espectro/espectro.h | 173 +++++++++----- keyboards/espectro/info.json | 347 ++++++++++++++++++++++++++++ keyboards/espectro/keymaps/default/keymap.c | 29 ++- keyboards/espectro/keymaps/iso/keymap.c | 30 +-- keyboards/espectro/keymaps/mac/keymap.c | 1 - keyboards/espectro/keymaps/mapdev/keymap.c | 1 - 6 files changed, 489 insertions(+), 92 deletions(-) create mode 100644 keyboards/espectro/info.json diff --git a/keyboards/espectro/espectro.h b/keyboards/espectro/espectro.h index 6f9e4b7f7b..ff58f9d97f 100755 --- a/keyboards/espectro/espectro.h +++ b/keyboards/espectro/espectro.h @@ -15,77 +15,130 @@ */ -#ifndef ESPECTRO_H -#define ESPECTRO_H +#pragma once #include "quantum.h" -//Arrow keys and 1.75u shift +/* + * Placement of every possible switch defined below. + * x2 means the diode allows two possible positions for the switch + * + * Layout: + * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐ + * │K00 │K01 │K02 │K03 │K04 │K60 │K61 │K62 │K63 │K05 │K06 │K07 │K08 │K72 │K09 │K0A │K0B │K0C │K7C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤ + * │K10 │K11 │K12 │K13 │K14 │K64 │K65 │K66 │K67 │K15 │K16 │K17 │K18 │K70 │K71 │K19 │K1A │K1B │K1C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │x2 │ │ │ │ │ + * ├─────┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴─────┼─────┼─────┼─────┼─────┤ ┌────────┐ + * │K20 │K21 │K22 │K23 │K24 │K68 │K69 │K6A │K6B │K25 │K26 │K27 │K28 │K73 │K29 │K2A │K2B │K2C │ │K38 │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├────────┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴─┬───┴────────┼─────┼─────┼─────┼─────┤ ┌───┴─┐ │ + * │K30 │K31 │K32 │K33 │K34 │K6C │K75 │K76 │K77 │K35 │K36 │K37 │K38 │K39 │K3A │K3B │K3C │ │K73 │ │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──┬──┴──────┬─────┼─────┼─────┼─────┼─────┤ └─────┴──────┘ + * │K40x2 │K41 │K42 │K43 │K44 │K78 │K79 │K7A │K7B │K45 │K46 │K47 │K48 │K74 │K49 │K4A │K4B │K4C │ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ + * ├───────┼─────┴─┬───┴───┬─┴─────┴─────┴─────┴─────┴─────┴───┬─┴───┬─┴───┬─┴───┬─────┼─────┼─────┼─────┼─────┼─────┤ + * │K50 │K51 │K52 │K59 │K55 │K56 │K57 │K58 │K53 │K54 │K5A │K5B │K5C │ + * │x2 │x2 │ │x3 │x3 │x2 │x2 │x2 │x2 │ │x2 │ │ │ + * └───────┴───────┴───────┴───────────────────────────────────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┴─────┘ + * + * Variants: + * - 2u Backspace: Delete K70 Use K71 + * - 2u Num +: Delete K3C Use K2C + * - 2u Num Enter: Delete K5C Use K4C + * - ANSI Left Shift: Delete K41 Use K40 + * + * ANSI Backslash and ISO Hash are the same position + * ANSI Enter and ISO Enter are the same position + * For two 1.5u modifiers on the right of the Spacebar, delete K56 and use K55 and K57 + * + * Matrix: + * { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + * { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + * { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + * { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + * { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + * { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C }, \ + * { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + * { K70, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ + */ + + +/* LAYOUT_all (Identical to LAYOUT_split_shift_and_bs) + * Every matrix position + * ,---------------------------------------------------------------------------. + * | 00| 01| 02| 03| 04| 60| 61| 62| 63| 05| 06| 07| 08| 72| 09| 0A| 0B| 0C| 7C| + * |---------------------------------------------------------------------------| + * | 10| 11| 12| 13| 14| 64| 65| 66| 67| 15| 16| 17| 18| 70| 71| 19| 1A| 1B| 1C| + * |---------------------------------------------------------------------------| + * | 20 | 21| 22| 23| 24| 68| 69| 6A| 6B| 25| 26| 27| 28| 73| 29| 2A| 2B| 2C| + * |---------------------------------------------------------------------------| + * | 30 | 31| 32| 33| 34| 6C| 75| 76| 77| 35| 36| 37| 38| 39| 3A| 3B| 3C| + * |---------------------------------------------------------------------------| + * | 40 | 41| 42| 43| 44| 78| 79| 7A| 7B| 45| 46| 47| 48| 74| 49| 4A| 4B| 4C| + * |---------------------------------------------------------------------------| + * | 50 | 51 | 52 | 59 | 55| 56| 57| 58| 53| 54| 5A| 5B| 5C| + * `---------------------------------------------------------------------------' +*/ + + +//Arrow keys and 1.75u right shift #define LAYOUT_default( \ -K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ -K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K701, K109, K110, K111, K112, \ - K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ - K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, \ - K400, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ -K500, K501, K502, K509, K505, K506, K507, K508, K503, K504, K510, K511 \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K73, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K38, K39, K3A, K3B, \ + K40, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, KC_NO }, \ - { K400, KC_NO, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ - { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, KC_NO }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ - { KC_NO, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO }, \ + { K40, KC_NO, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ } // Split numpad (enter, 0), split shifts (right, left), split backspace -// This is more of an example of every possible keycode placement +// This layout contains every possible keycode placement #define LAYOUT_split_shift_and_bs( \ -K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ -K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K700, K701, K109, K110, K111, K112, \ - K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ - K300, K301, K302, K303, K304, K612, K705, K706, K707, K305, K306, K307, K308, K309, K310, K311, K312, \ - K400, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K704, K409, K410, K411, K412, \ -K500, K501, K502, K509, K505, K506, K507, K508, K503, K504, K510, K511, K512 \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K70, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K73, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K38, K39, K3A, K3B, K3C, \ + K40, K41, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B, K5C \ ) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ - { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ - { K701, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, K5C }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { K71, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C }, \ } - - - -/* -Placement of every possible switch defined below. -x2 means the diode allows two possible positions for the switch - -#define LAYOUT_all( \ -K000, K001, K002, K003, K004, K600, K601, K602, K603, K005, K006, K007, K008, K702, K009, K010, K011, K012, K712, \ -K100, K101, K102, K103, K104, K604, K605, K606, K607, K105, K106, K107, K108, K700, K701x2, K109, K110, K111, K112, \ -K200, K201, K202, K203, K204, K608, K609, K610, K611, K205, K206, K207, K208, K703, K209, K210, K211, K212, \ - K308, K212, \ -K300, K300, K301, K302, K304, K612, K705, K706, K707, K305, K306, K307, K703, K308, K309, K310, K311, K312, \ -K400x2, K401, K402, K403, K404, K708, K709, K710, K711, K405, K406, K407, K408, K408, K704, K409, K410, K411, K412, \ - K412, \ -K500x2, K501x2, K502, K509x3, K505x3, K506x2, K507x2, K508x2, K503x2, K504, K510x2, K511, K512 \ -) { \ - { K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012 }, \ - { K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112 }, \ - { K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212 }, \ - { K300, K301, K302, K303, K304, K305, K306, K307, K308, K309, K310, K311, K312 }, \ - { K400, K401, K402, K403, K404, K405, K406, K407, K408, K409, K410, K411, K412 }, \ - { K500, K501, K502, K503, K504, K505, K506, K507, K508, K509, K510, K511, K512 }, \ - { K600, K601, K602, K603, K604, K605, K606, K607, K608, K609, K610, K611, K612 }, \ - { K700, K701, K702, K703, K704, K705, K706, K707, K708, K709, K710, K711, K712 }, \ +// ISO Layout +#define LAYOUT_iso( \ + K00, K01, K02, K03, K04, K60, K61, K62, K63, K05, K06, K07, K08, K72, K09, K0A, K0B, K0C, K7C, \ + K10, K11, K12, K13, K14, K64, K65, K66, K67, K15, K16, K17, K18, K71, K19, K1A, K1B, K1C, \ + K20, K21, K22, K23, K24, K68, K69, K6A, K6B, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K30, K31, K32, K33, K34, K6C, K75, K76, K77, K35, K36, K37, K73, K38, K39, K3A, K3B, \ + K40, K41, K42, K43, K44, K78, K79, K7A, K7B, K45, K46, K47, K48, K74, K49, K4A, K4B, K4C, \ + K50, K51, K52, K59, K55, K56, K57, K58, K53, K54, K5A, K5B \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, KC_NO }, \ + { K40, K41, K42, K43, K44, K45, K46, K47, K48, K49, K4A, K4B, K4C }, \ + { K50, K51, K52, K53, K54, K55, K56, K57, K58, K59, K5A, K5B, KC_NO }, \ + { K60, K61, K62, K63, K64, K65, K66, K67, K68, K69, K6A, K6B, K6C }, \ + { KC_NO, K71, K72, K73, K74, K75, K76, K77, K78, K79, K7A, K7B, K7C } \ } -*/ - -#endif diff --git a/keyboards/espectro/info.json b/keyboards/espectro/info.json new file mode 100644 index 0000000000..7a8c9bc0a9 --- /dev/null +++ b/keyboards/espectro/info.json @@ -0,0 +1,347 @@ +{ + "keyboard_name": "Espectro", + "keyboard_folder": "espectro", + "url": "", + "maintainer": "qmk", + "width": 19, + "height": 6, + "layouts": { + "LAYOUT_default": { + "key_count": 100, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1, "w":2}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"BACKSLASH", "x":13.5, "y":2, "w":1.5}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2, "h":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ENTER", "x":12.75, "y":3, "w":2.25}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":2.25}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4, "h":2}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"RCTRL", "x":11, "y":5}, + {"label":"FN", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5} + ] + }, + + "LAYOUT_split_shift_and_bs": { + "key_count": 104, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1}, + {"label":"BACKSPACE", "x":14, "y":1}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"BACKSLASH", "x":13.5, "y":2, "w":1.5}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ENTER", "x":12.75, "y":3, "w":2.25}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + {"label":"KEYPAD +", "x":18, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"MENU", "x":11, "y":5}, + {"label":"RCTRL", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5}, + {"label":"KEYPAD ENTER", "x":18, "y":5} + ] + }, + + "LAYOUT_iso": { + "key_count": 101, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"F1", "x":1, "y":0}, + {"label":"F2", "x":2, "y":0}, + {"label":"F3", "x":3, "y":0}, + {"label":"F4", "x":4, "y":0}, + {"label":"F5", "x":5, "y":0}, + {"label":"F6", "x":6, "y":0}, + {"label":"F7", "x":7, "y":0}, + {"label":"F8", "x":8, "y":0}, + {"label":"F9", "x":9, "y":0}, + {"label":"F10", "x":10, "y":0}, + {"label":"F11", "x":11, "y":0}, + {"label":"F12", "x":12, "y":0}, + {"label":"PRINT SCREEN", "x":13, "y":0}, + {"label":"HOME", "x":14, "y":0}, + {"label":"END", "x":15, "y":0}, + {"label":"PAGE UP", "x":16, "y":0}, + {"label":"PAGE DOWN", "x":17, "y":0}, + {"label":"DELETE", "x":18, "y":0}, + + {"label":"GRAVE", "x":0, "y":1}, + {"label":"1", "x":1, "y":1}, + {"label":"2", "x":2, "y":1}, + {"label":"3", "x":3, "y":1}, + {"label":"4", "x":4, "y":1}, + {"label":"5", "x":5, "y":1}, + {"label":"6", "x":6, "y":1}, + {"label":"7", "x":7, "y":1}, + {"label":"8", "x":8, "y":1}, + {"label":"9", "x":9, "y":1}, + {"label":"0", "x":10, "y":1}, + {"label":"MINUS", "x":11, "y":1}, + {"label":"EQUAL", "x":12, "y":1}, + {"label":"BACKSPACE", "x":13, "y":1, "w":2}, + {"label":"NUM LOCK", "x":15, "y":1}, + {"label":"KEYPAD /", "x":16, "y":1}, + {"label":"KEYPAD *", "x":17, "y":1}, + {"label":"KEYPAD -", "x":18, "y":1}, + + {"label":"TAB", "x":0, "y":2, "w":1.5}, + {"label":"Q", "x":1.5, "y":2}, + {"label":"W", "x":2.5, "y":2}, + {"label":"E", "x":3.5, "y":2}, + {"label":"R", "x":4.5, "y":2}, + {"label":"T", "x":5.5, "y":2}, + {"label":"Y", "x":6.5, "y":2}, + {"label":"U", "x":7.5, "y":2}, + {"label":"I", "x":8.5, "y":2}, + {"label":"O", "x":9.5, "y":2}, + {"label":"P", "x":10.5, "y":2}, + {"label":"LBRACKET", "x":11.5, "y":2}, + {"label":"RBRACKET", "x":12.5, "y":2}, + {"label":"KEYPAD 7", "x":15, "y":2}, + {"label":"KEYPAD 8", "x":16, "y":2}, + {"label":"KEYPAD 9", "x":17, "y":2}, + {"label":"KEYPAD +", "x":18, "y":2, "h":2}, + + {"label":"CAPS LOCK", "x":0, "y":3, "w":1.75}, + {"label":"A", "x":1.75, "y":3}, + {"label":"S", "x":2.75, "y":3}, + {"label":"D", "x":3.75, "y":3}, + {"label":"F", "x":4.75, "y":3}, + {"label":"G", "x":5.75, "y":3}, + {"label":"H", "x":6.75, "y":3}, + {"label":"J", "x":7.75, "y":3}, + {"label":"K", "x":8.75, "y":3}, + {"label":"L", "x":9.75, "y":3}, + {"label":"SEMICOLON", "x":10.75, "y":3}, + {"label":"QUOTE", "x":11.75, "y":3}, + {"label":"ISO HASH", "x":12.75, "y":3}, + {"label":"ENTER", "x":13.75, "y":2, "w":1.25, "h":2}, + {"label":"KEYPAD 4", "x":15, "y":3}, + {"label":"KEYPAD 5", "x":16, "y":3}, + {"label":"KEYPAD 6", "x":17, "y":3}, + + {"label":"LSHIFT", "x":0, "y":4, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":4}, + {"label":"Z", "x":2.25, "y":4}, + {"label":"X", "x":3.25, "y":4}, + {"label":"C", "x":4.25, "y":4}, + {"label":"V", "x":5.25, "y":4}, + {"label":"B", "x":6.25, "y":4}, + {"label":"N", "x":7.25, "y":4}, + {"label":"M", "x":8.25, "y":4}, + {"label":"COMMA", "x":9.25, "y":4}, + {"label":"PERIOD", "x":10.25, "y":4}, + {"label":"SLASH", "x":11.25, "y":4}, + {"label":"RSHIFT", "x":12.25, "y":4, "w":1.75}, + {"label":"UP", "x":14, "y":4}, + {"label":"KEYPAD 1", "x":15, "y":4}, + {"label":"KEYPAD 2", "x":16, "y":4}, + {"label":"KEYPAD 3", "x":17, "y":4}, + {"label":"KEYPAD ENTER", "x":18, "y":4, "h":2}, + + {"label":"LCTRL", "x":0, "y":5, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":5, "w":1.25}, + {"label":"LALT", "x":2.5, "y":5, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":5, "w":6.25}, + {"label":"RALT", "x":10, "y":5}, + {"label":"MENU", "x":11, "y":5}, + {"label":"RCTRL", "x":12, "y":5}, + {"label":"LEFT", "x":13, "y":5}, + {"label":"DOWN", "x":14, "y":5}, + {"label":"RIGHT", "x":15, "y":5}, + {"label":"KEYPAD 0", "x":16, "y":5}, + {"label":"KEYPAD .", "x":17, "y":5} + ] + } + } +} diff --git a/keyboards/espectro/keymaps/default/keymap.c b/keyboards/espectro/keymaps/default/keymap.c index aeff733fc1..b78fdbcac1 100755 --- a/keyboards/espectro/keymaps/default/keymap.c +++ b/keyboards/espectro/keymaps/default/keymap.c @@ -16,7 +16,6 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define _BL 0 //Base layer #define _FN1 1 //Function layer @@ -26,7 +25,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* BL ____________________________________________________________________________________________________________________________________________________________________________ | | | | | | | | | | | | | | | | | | | | -| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | P SCN | HOME | END | P UP | P DOWN | DEL | +| ESC | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | DEL | PRT SC | SCR LK | PAUSE | P UP | P DOWN | |________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| | | | | | | | | | | | | | | BACK | NUM | | | | | ~` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | _ - | = + | SPACE | LOCK | / | * | - | @@ -46,12 +45,12 @@ ________________________________________________________________________________ */ [_BL] = LAYOUT_default( - 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_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, KC_PGDN, - 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_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_P7, KC_P8, KC_P9, KC_PPLS, - 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT + 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_DEL, KC_PSCR, KC_SLCK, KC_PAUS, KC_PGUP, KC_PGDN, \ + 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_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_P7, KC_P8, KC_P9, KC_PPLS, \ + 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_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC, KC_UP, KC_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ ), /* FN_1 @@ -60,7 +59,7 @@ ________________________________________________________________________________ | RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | |________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| | | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | -| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | SAT | | | | | DELETE | | | | | |________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| | | BACK | BACK | | | | | | | | | | | | | | | | | | LIGHT | LIGHT | | | | | | | | | | | | | | | | @@ -77,12 +76,12 @@ ________________________________________________________________________________ */ [_FN1] = LAYOUT_default( - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, - _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, - _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, \ + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; diff --git a/keyboards/espectro/keymaps/iso/keymap.c b/keyboards/espectro/keymaps/iso/keymap.c index d22e7aac4b..a9625e4d96 100755 --- a/keyboards/espectro/keymaps/iso/keymap.c +++ b/keyboards/espectro/keymaps/iso/keymap.c @@ -44,13 +44,13 @@ ________________________________________________________________________________ |__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| */ - [_BL] = LAYOUT_split_shift_and_bs( - 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_DEL, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, - 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_NO, KC_BSPC, 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_NUHS, KC_P7, KC_P8, KC_P9, KC_PPLS, - 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_NO, KC_P4, KC_P5, KC_P6, - 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_P1, KC_P2, KC_P3, KC_PENT, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RIGHT, KC_P0, KC_PDOT, KC_NO + [_BL] = LAYOUT_iso( + 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_DEL, KC_PSCR, KC_HOME, KC_END, KC_PGUP, KC_PGDN, \ + 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_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_P7, KC_P8, KC_P9, KC_PPLS, \ + 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_NUHS, KC_ENT, KC_P4, KC_P5, KC_P6, \ + 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_P1, KC_P2, KC_P3, KC_PENT, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RCTL, MO(1), KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT \ ), /* FN_1 @@ -59,7 +59,7 @@ ________________________________________________________________________________ | RESET | | | | | | | | | | | | | MUTE | DOWN | UP | TRACK | HOME | END | |________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________|________| | | RGB | RGB | RGB | RGB | RGB | RGB | RGB | RGB | | | | | | | | | | -| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | | | | | | DELETE | | | | | +| | TOGGLE | MODE |INCREASE|DECREASE| HUE | HUE | SAT | SAT | | | | | DELETE | | | | | |________|________|________|________|________|INCREASE|DECREASE|INCREASE|DECREASE|________|________|________|________|_________________|________|________|________|________| | | BACK | BACK | | | | | | | | | | | | | | | | | | LIGHT | LIGHT | | | | | | | | | | | | | | | | @@ -75,13 +75,13 @@ ________________________________________________________________________________ |__________|__________|__________|________________________________________________________|________|________|________|________|________|________|________|________|________| */ - [_FN1] = LAYOUT_split_shift_and_bs( - RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, - _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, - _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + [_FN1] = LAYOUT_iso( + RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MNXT, KC_HOME, KC_END, \ + _______, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, _______, _______, _______, _______, KC_DEL, _______, _______, _______, _______, \ + _______, BL_TOGG, BL_INC, BL_DEC, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), }; diff --git a/keyboards/espectro/keymaps/mac/keymap.c b/keyboards/espectro/keymaps/mac/keymap.c index 4b72ff0aac..9c03e1345f 100644 --- a/keyboards/espectro/keymaps/mac/keymap.c +++ b/keyboards/espectro/keymaps/mac/keymap.c @@ -17,7 +17,6 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define _QWERTY 0 //BASE layer #define _FUNCTION 1 //Function layer diff --git a/keyboards/espectro/keymaps/mapdev/keymap.c b/keyboards/espectro/keymaps/mapdev/keymap.c index bbd791582d..89d412b2dd 100644 --- a/keyboards/espectro/keymaps/mapdev/keymap.c +++ b/keyboards/espectro/keymaps/mapdev/keymap.c @@ -15,7 +15,6 @@ #include QMK_KEYBOARD_H -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) #define _BL 0 //Base layer #define _FN1 1 //Function layer -- cgit v1.2.3 From 3054c7bda0dc68723f6402f9175ee11758ffc1b8 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 19 Dec 2018 08:23:28 -0800 Subject: Fix fc980c.h update (#4682) --- keyboards/fc980c/fc980c.h | 1 - 1 file changed, 1 deletion(-) diff --git a/keyboards/fc980c/fc980c.h b/keyboards/fc980c/fc980c.h index f20c102e55..ffb02e2579 100644 --- a/keyboards/fc980c/fc980c.h +++ b/keyboards/fc980c/fc980c.h @@ -63,4 +63,3 @@ LAYOUT( ) */ -#endif -- cgit v1.2.3 From 40bf3a2ce9ec781cc2ff7218f909ffdbece44e97 Mon Sep 17 00:00:00 2001 From: Danny Nguyen Date: Tue, 18 Dec 2018 16:17:29 -0500 Subject: Make `readPin` output a 0 or 1 when using AVR to match ChibiOS's version of `readPin` --- quantum/quantum.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/quantum.h b/quantum/quantum.h index 0faf1af29c..f78915fdfb 100644 --- a/quantum/quantum.h +++ b/quantum/quantum.h @@ -161,7 +161,7 @@ extern uint32_t default_layer_state; } } - #define readPin(pin) (PIN_ADDRESS(pin, 0) & _BV(pin & 0xF)) + #define readPin(pin) ((bool)(PIN_ADDRESS(pin, 0) & _BV(pin & 0xF))) #elif defined(PROTOCOL_CHIBIOS) #define pin_t ioline_t #define setPinInput(pin) palSetLineMode(pin, PAL_MODE_INPUT) -- cgit v1.2.3 From fdeec296369c0995bad1117e50946b2df84f35e4 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 19 Dec 2018 08:39:24 -0800 Subject: Overhaul Unicode Common functionality (#4325) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * remove merge artifacts * Unicode common cleanup (#17) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Remove trailing whitespace * Improve Cycling documentation * Add Unicode Input method Cycling support (#19) * Standardize the Unicode EEPROM code * Remove unicode init from process_record_* functions * Add unicode init to where it belongs: matrix_init_quantum * Move Unicode proccessing to unicode common * Add audio feedback to input mode keys to drive konstantin up a wall * Tap_code cleanup * Update keycodes * Update unicode documentation * Update unicode keycodes for consistency/easier merge * Add Audio Feedback section * Remove Functions from feature page And link to the file instead. Link to specific lines later on. * Fix white spaces Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * Because I missed it! Co-Authored-By: drashna * Fix spacing Co-Authored-By: drashna * SPAAAAAAAAAACing Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Add BSD for future compatibility * Thought I fixed that! Co-Authored-By: drashna * non-breaking Co-Authored-By: drashna * Considered that Co-Authored-By: drashna * Yuuup Co-Authored-By: drashna * consistency Co-Authored-By: drashna * white spaces .... copied from elsewhere Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * white spaces Co-Authored-By: drashna * Update keycode defines * Fix Linux Song * Update all of the songs * Cleanup * Move and update check to ensure only one unicode method is enabled * Update quantum/quantum_keycodes.h * Update documentation * Wordsmithing and cleanup * Format unicode_common (#13) * case alignment * process_record_unicode_common → process_unicode_common * Move song arrays into function where they're used, align preprocessor directives * Swap the order of UC_WIN and UC_BSD * Update Unicode docs * Reorder Unicode mode stuff to match the order of input mode constants * Fix capitalization in doc subtitle * Readd BSD and OSX_RALT songs * Reword BSD note in docs * Readd BSD keycode description * Reword explanation of input on different platforms * Steal vomindoraan's input mode documentation Co-Authored-By: vomindoraan (vomindoraan@gmail.com) * Willingly give Drashna the rest of my Unicode doc improvements * Wordsmithing Co-Authored-By: drashna * Rearrange process_unicode_common functions * Make Unicode input mode constants (UC_*) an enum * Simplify unicode_input_start/finish code * Make the key used for WinCompose configurable * Remove UC_OSX_RALT in favor of setting the key with UNICODE_OSX_KEY * Update Unicode input mode doc * Add descriptions and rearrange definitions in process_unicode_common.h * Add registry command to Unicode docs + misc updates * Reword an explanation in Unicode docs * Add TODO comment * Add cycle_unicode_input_mode and UNICODE_SELECTED_MODES macro * Add an option for making cycle changes persistent * Add debug prints to functions that change input_mode * Use cycle_unicode_input_mode in whitefox/konstantin * Add persist_unicode_input_mode function * Add offset to cycle to allow stepping in reverse * Add keycodes: UNICODE_MODE_FORWARD, UNICODE_MODE_REVERSE Aliases: UC_MOD, UC_RMOD (respectively) * REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts * Fix wrong constant name * Revert "REVERT ME: Undo changes to whitefox/konstantin to avoid conflicts" This reverts commit 42676bf251fc8e3823f5e614dad6e510ba47a2f3. * Change dprintf text * Give selected modes priority over EEPROM when !UNICODE_CYCLE_PERSIST * Remove trailing whitespace * Cleanup of RALT code and unicode compilation stuff * Remove else for unicode handling --- docs/feature_unicode.md | 133 +++++++++++---- keyboards/whitefox/keymaps/konstantin/config.h | 4 + keyboards/whitefox/keymaps/konstantin/keymap.c | 8 +- quantum/process_keycode/process_ucis.c | 2 - quantum/process_keycode/process_ucis.h | 5 +- quantum/process_keycode/process_unicode.c | 2 - quantum/process_keycode/process_unicode.h | 5 +- quantum/process_keycode/process_unicode_common.c | 200 +++++++++++++++-------- quantum/process_keycode/process_unicode_common.h | 66 ++++++-- quantum/process_keycode/process_unicodemap.c | 5 +- quantum/process_keycode/process_unicodemap.h | 4 +- quantum/quantum.c | 19 +-- quantum/quantum_keycodes.h | 21 ++- 13 files changed, 319 insertions(+), 155 deletions(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index c98a402287..1b083896a2 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -1,28 +1,28 @@ # Unicode Support -There are three Unicode keymap definition method available in QMK: +There are three Unicode keymap definition methods available in QMK: ## UNICODE_ENABLE -Supports Unicode input up to 0xFFFF. The keycode function is `UC(n)` in keymap file, where *n* is a 4 digit hexadecimal. +Supports Unicode up to `0xFFFF`. The keycode function is `UC(n)` in the keymap file, where _n_ is a 4 digit hexadecimal number. ## UNICODEMAP_ENABLE -Supports Unicode up to 0xFFFFFFFF. You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)` where *n* is the array index of the mapping table. +Supports Unicode up to `0x10FFFF` (all possible code points). You need to maintain a separate mapping table `const uint32_t PROGMEM unicode_map[] = {...}` in your keymap file. The keycode function is `X(n)`, where _n_ is an array index into the mapping table. And you may want to have an enum to make reference easier. So you'd want to add something like this to your keymap: ```c -enum unicode_name { - BANG, // ‽ - IRONY, // ⸮ - SNEK // snke 🐍 +enum unicode_names { + BANG, + IRONY, + SNEK, }; const uint32_t PROGMEM unicode_map[] = { - [BANG] = 0x0203D, // ‽ - [IRONY] = 0x02E2E, // ⸮ - [SNEK] = 0x1F40D // snke 🐍 + [BANG] = 0x203D, // ‽ + [IRONY] = 0x2E2E, // ⸮ + [SNEK] = 0x1F40D, // 🐍 }: ``` @@ -30,7 +30,7 @@ Make sure that the order for both matches. ## UCIS_ENABLE -Supports Unicode up to 0xFFFFFFFF. As with `UNICODE_MAP`, you may want to maintain a mapping table in your keymap file. However, there is no keycodes for this feature, you will have to add a keycode or function to call `qk_ucis_start()`. Once you've run that, you can just type the text for your unicode, and then hit space or enter to complete it, or ESC to cancel it. And if it matches an entry in your table, it will automatically "backspace" the trigger word (from your table) and then will input the unicode sequence. +Supports Unicode up to `0x10FFFF` (all possible code points). As with `UNICODEMAP`, you may want to maintain a mapping table in your keymap file. However, there are no built-in keycodes for this feature — you will have to add a keycode or function that calls `qk_ucis_start()`. Once it's been called, you can type the mnemonic for your character, then hit Space or Enter to complete it or Esc to cancel. If the mnemonic matches an entry in your table, the typed text will automatically be erased and the corresponding Unicode sequence inserted. For instance, you would need to have a table like this in your keymap: @@ -53,42 +53,103 @@ There are several functions that you can add to your keymap to customize the fun * `void qk_ucis_success(uint8_t symbol_index)` - This runs when the unicode input has matched something, and has completed. Default doesn't do anything. * `void qk_ucis_symbol_fallback (void)` - This runs if the input text doesn't match anything. The default function falls back to trying that input as a unicode code. -The default code for these are: +You can find the default implementations of these functions in [`process_ucis.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_ucis.c). + +## Input Modes + +Unicode input in QMK works by inputting a sequence of characters to the OS, sort of like a macro. Unfortunately, the way this is done differs for each platform. Specifically, each platform requires a different combination of keys to trigger Unicode input. Therefore, a corresponding input mode has to be set in QMK. + +The following input modes are available: + +* **`UC_OSX`**: Mac OS X built-in Unicode hex input. Supports code points up to `0xFFFF` (`0x10FFFF` with `UNICODEMAP`). + + To enable, go to _System Preferences > Keyboard > Input Sources_, add _Unicode Hex Input_ to the list (it's under _Other_), then activate it from the input dropdown in the Menu Bar. + By default, this mode uses the left Option key (`KC_LALT`), but this can be changed by defining [`UNICODE_OSX_KEY`](#input-key-configuration) with another keycode. + +* **`UC_LNX`**: Linux built-in IBus Unicode input. Supports all possible code points (`0x10FFFF`). + + Enabled by default and works almost anywhere on IBus-enabled distros. Without IBus, this mode works under GTK apps, but rarely anywhere else. + +* **`UC_WIN`**: _(not recommended)_ Windows built-in hex numpad Unicode input. Supports code points up to `0xFFFF`. + + To enable, create a registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad` and set its value to `1`. This can be done from the Command Prompt by running `reg add "HKCU\Control Panel\Input Method" -v EnableHexNumpad -t REG_SZ -d 1` with administrator privileges. Afterwards, reboot. + This mode is not recommended because of reliability and compatibility issues; use the `UC_WINC` mode instead. + +* **`UC_BSD`**: _(non implemented)_ Unicode input under BSD. Not implemented at this time. If you're a BSD user and want to help add support for it, please [open an issue on GitHub](https://github.com/qmk/qmk_firmware/issues). + +* **`UC_WINC`**: Windows Unicode input using [WinCompose](https://github.com/samhocevar/wincompose). As of v0.8.2, supports code points up to `0xFFFFF`. + + To enable, install the [latest release](https://github.com/samhocevar/wincompose/releases/latest). Once installed, WinCompose will automatically run on startup. Works reliably under all version of Windows supported by the app. + By default, this mode uses the right Alt key (`KC_RALT`), but this can be changed in the WinCompose settings and by defining [`UNICODE_WINC_KEY`](#input-key-configuration) with another keycode. + +### Switching Input Modes + +There are two ways to set the input mode for Unicode: by keycode or by function. Keep in mind that both methods write to persistent storage (EEPROM), and are loaded each time the keyboard starts. So once you've set it the first time, you don't need to set it again unless you want to change it, or you've reset the EEPROM settings. + +You can switch the input mode at any time by using one of the following keycodes. The easiest way is to add the ones you use to your keymap. + +|Keycode |Alias |Input mode |Description | +|-----------------------|---------|-------------|-----------------------------------------| +|`UNICODE_MODE_FORWARD` |`UC_MOD` | |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| +|`UNICODE_MODE_REVERSE` |`UC_RMOD`| |Cycles forwards through the available modes. [(Disabled by default)](#input-method-cycling)| +|`UNICODE_MODE_OSX` |`UC_M_OS`|`UC_OSX` |Switch to Mac OS X input. | +|`UNICODE_MODE_LNX` |`UC_M_LN`|`UC_LNX` |Switch to Linux input. | +|`UNICODE_MODE_WIN` |`UC_M_WI`|`UC_WIN` |Switch to Windows input. | +|`UNICODE_MODE_BSD` |`UC_M_BS`|`UC_BSD` |Switch to BSD input (not implemented). | +|`UNICODE_MODE_WINC` |`UC_M_WC`|`UC_WINC` |Switch to Windows input using WinCompose.| + +You can also switch the input mode by calling `set_unicode_input_mode(x)` in your code, where _x_ is one of the above input mode constants (e.g. `UC_LNX`). Since the function only needs to be called once, it's recommended that you do it in `eeconfig_init_user` (or a similar function). For example: ```c -void qk_ucis_start_user(void) { // outputs keyboard emoji - unicode_input_start(); - register_hex(0x2328); - unicode_input_finish(); +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); } +``` -void qk_ucis_success(uint8_t symbol_index) { -} +### Audio Feedback -void qk_ucis_symbol_fallback (void) { // falls back to manual unicode entry - for (uint8_t i = 0; i < qk_ucis_state.count - 1; i++) { - uint8_t code = qk_ucis_state.codes[i]; - register_code(code); - unregister_code(code); - wait_ms(UNICODE_TYPE_DELAY); - } -} +If you have the [Audio feature](feature_audio.md) enabled on the board, you can set melodies to be played when you press the above keys. That way you can have some audio feedback when switching input modes. + +For instance, you can add these definitions to your `config.h` file: + +```c +#define UNICODE_SONG_OSX COIN_SOUND +#define UNICODE_SONG_LNX UNICODE_LINUX +#define UNICODE_SONG_BSD MARIO_GAMEOVER +#define UNICODE_SONG_WIN UNICODE_WINDOWS +#define UNICODE_SONG_WINC UNICODE_WINDOWS ``` -## Unicode Input methods +### Additional Customization + +Because Unicode is such a large and variable feature, there are a number of options that you can customize to work better on your system. + +#### Start and Finish input functions + +The functions for starting and finishing Unicode input on your platform can be overridden locally. Possible uses include customizing input mode behavior if you don't use the default keys, or adding extra visual/audio feedback to Unicode input. + +* `void unicode_input_start(void)` – This sends the initial sequence that tells your platform to enter Unicode input mode. For example, it presses Ctrl+Shift+U on Linux and holds the Option key on Mac. +* `void unicode_input_finish(void)` – This is called to exit Unicode input mode, for example by pressing Space or releasing the Option key. -Unicode input in QMK works by inputting a sequence of characters to the OS, -sort of like macro. Unfortunately, each OS has different ideas on how Unicode is input. +You can find the default implementations of these functions in [`process_unicode_common.c`](https://github.com/qmk/qmk_firmware/blob/master/quantum/process_keycode/process_unicode_common.c). -This is the current list of Unicode input method in QMK: -* __UC_OSX__: MacOS Unicode Hex Input support. Works only up to 0xFFFF. Disabled by default. To enable: go to System Preferences -> Keyboard -> Input Sources, and enable Unicode Hex. -* __UC_OSX_RALT__: Same as UC_OSX, but sends the Right Alt key for unicode input -* __UC_LNX__: Unicode input method under Linux. Works up to 0xFFFFF. Should work almost anywhere on ibus enabled distros. Without ibus, this works under GTK apps, but rarely anywhere else. -* __UC_WIN__: (not recommended) Windows built-in Unicode input. To enable: create registry key under `HKEY_CURRENT_USER\Control Panel\Input Method\EnableHexNumpad` of type `REG_SZ` called `EnableHexNumpad`, set its value to 1, and reboot. This method is not recommended because of reliability and compatibility issue, use WinCompose method below instead. -* __UC_WINC__: Windows Unicode input using WinCompose. Requires [WinCompose](https://github.com/samhocevar/wincompose). Works reliably under many (all?) variations of Windows. +#### Input Key Configuration -At some point, you need to call `set_unicode_input_mode(x)` to set the correct unicode method. This sets the method that is used to send the unicode, and stores it in EEPROM, so you only need to call this once. +Additionally, you can customize the keys used to trigger the unicode input for macOS and WinCompose by adding defines to your `config.h` + +```c +#define UNICODE_OSX_KEY KC_LALT +#define UNICODE_WINC_KEY KC_RALT +``` + +#### Input Method Cycling + +Also, you can choose which input methods are availble for cycling through. By default, this is disabled. But if you want to enabled it, then limiting it to just those modes makes sense. Note that `UNICODE_SELECTED_MODES` define is comma delimited. + +```c +#define UNICODE_SELECTED_MODES UC_OSX, UC_LNX, UC_WIN, UC_BSD, UC_WINC +``` ## `send_unicode_hex_string` diff --git a/keyboards/whitefox/keymaps/konstantin/config.h b/keyboards/whitefox/keymaps/konstantin/config.h index ee30dbece1..ab920a50ba 100644 --- a/keyboards/whitefox/keymaps/konstantin/config.h +++ b/keyboards/whitefox/keymaps/konstantin/config.h @@ -21,3 +21,7 @@ #define PERMISSIVE_HOLD #define TAPPING_TERM 200 #define TAPPING_TOGGLE 2 + +#define UNICODE_CYCLE_PERSIST false +#define UNICODE_SELECTED_MODES UC_WINC, UC_LNX +#define UNICODE_WINC_KEY KC_RGUI diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index 55db5ca6b8..54777cfe08 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -23,10 +23,6 @@ #define DIVIDE UC(0x00F7) #define MINUS UC(0x2212) -void eeconfig_init_user(void) { - set_unicode_input_mode(UC_WINC); -} - enum layers { L_BASE, L_FN, @@ -162,7 +158,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│Scr│Pau│ * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │ │ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ @@ -173,7 +169,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [L_FN] = LAYOUT_truefox( \ _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, \ - KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, _______, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \ _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ _______, DESKTOP, DSKTP_L, KC_WH_D, DSKTP_R, _______, KC_HOME, KC_PGDN, KC_END \ diff --git a/quantum/process_keycode/process_ucis.c b/quantum/process_keycode/process_ucis.c index 8deb24a867..5de2e41fc3 100644 --- a/quantum/process_keycode/process_ucis.c +++ b/quantum/process_keycode/process_ucis.c @@ -95,8 +95,6 @@ void register_ucis(const char *hex) { bool process_ucis (uint16_t keycode, keyrecord_t *record) { uint8_t i; - unicode_input_mode_init(); - if (!qk_ucis_state.in_progress) return true; diff --git a/quantum/process_keycode/process_ucis.h b/quantum/process_keycode/process_ucis.h index d4aa34cde7..b114d839ab 100644 --- a/quantum/process_keycode/process_ucis.h +++ b/quantum/process_keycode/process_ucis.h @@ -14,8 +14,7 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UCIS_H -#define PROCESS_UCIS_H +#pragma once #include "quantum.h" #include "process_unicode_common.h" @@ -48,5 +47,3 @@ void qk_ucis_symbol_fallback (void); void qk_ucis_success(uint8_t symbol_index); void register_ucis(const char *hex); bool process_ucis (uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/quantum/process_keycode/process_unicode.c b/quantum/process_keycode/process_unicode.c index f39c4a36e1..19beb84520 100644 --- a/quantum/process_keycode/process_unicode.c +++ b/quantum/process_keycode/process_unicode.c @@ -20,11 +20,9 @@ bool process_unicode(uint16_t keycode, keyrecord_t *record) { if (keycode > QK_UNICODE && record->event.pressed) { uint16_t unicode = keycode & 0x7FFF; - unicode_input_mode_init(); unicode_input_start(); register_hex(unicode); unicode_input_finish(); } return true; } - diff --git a/quantum/process_keycode/process_unicode.h b/quantum/process_keycode/process_unicode.h index c525b74f03..0913e99107 100644 --- a/quantum/process_keycode/process_unicode.h +++ b/quantum/process_keycode/process_unicode.h @@ -13,12 +13,9 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef PROCESS_UNICODE_H -#define PROCESS_UNICODE_H +#pragma once #include "quantum.h" #include "process_unicode_common.h" bool process_unicode(uint16_t keycode, keyrecord_t *record); - -#endif diff --git a/quantum/process_keycode/process_unicode_common.c b/quantum/process_keycode/process_unicode_common.c index 4285d20a19..3286f45b5d 100644 --- a/quantum/process_keycode/process_unicode_common.c +++ b/quantum/process_keycode/process_unicode_common.c @@ -16,98 +16,111 @@ #include "process_unicode_common.h" #include "eeprom.h" -#include #include +#include -static uint8_t input_mode; -uint8_t mods; +unicode_config_t unicode_config; +#if UNICODE_SELECTED_MODES != -1 +static uint8_t selected[] = { UNICODE_SELECTED_MODES }; +static uint8_t selected_count = sizeof selected / sizeof *selected; +static uint8_t selected_index; +#endif -void set_unicode_input_mode(uint8_t os_target) { - input_mode = os_target; - eeprom_update_byte(EECONFIG_UNICODEMODE, os_target); +void unicode_input_mode_init(void) { + unicode_config.raw = eeprom_read_byte(EECONFIG_UNICODEMODE); +#if UNICODE_SELECTED_MODES != -1 + #if UNICODE_CYCLE_PERSIST + // Find input_mode in selected modes + uint8_t i; + for (i = 0; i < selected_count; i++) { + if (selected[i] == unicode_config.input_mode) { + selected_index = i; + break; + } + } + if (i == selected_count) { + // Not found: input_mode isn't selected, change to one that is + unicode_config.input_mode = selected[selected_index = 0]; + } + #else + // Always change to the first selected input mode + unicode_config.input_mode = selected[selected_index = 0]; + #endif +#endif + dprintf("Unicode input mode init to: %u\n", unicode_config.input_mode); } uint8_t get_unicode_input_mode(void) { - return input_mode; + return unicode_config.input_mode; } -void unicode_input_mode_init(void) { - static bool first_flag = false; - if (!first_flag) { - input_mode = eeprom_read_byte(EECONFIG_UNICODEMODE); - first_flag = true; - } +void set_unicode_input_mode(uint8_t mode) { + unicode_config.input_mode = mode; + persist_unicode_input_mode(); + dprintf("Unicode input mode set to: %u\n", unicode_config.input_mode); +} + +void cycle_unicode_input_mode(uint8_t offset) { +#if UNICODE_SELECTED_MODES != -1 + selected_index = (selected_index + offset) % selected_count; + unicode_config.input_mode = selected[selected_index]; + #if UNICODE_CYCLE_PERSIST + persist_unicode_input_mode(); + #endif + dprintf("Unicode input mode cycle to: %u\n", unicode_config.input_mode); +#endif +} + +void persist_unicode_input_mode(void) { + eeprom_update_byte(EECONFIG_UNICODEMODE, unicode_config.input_mode); } +static uint8_t saved_mods; + __attribute__((weak)) -void unicode_input_start (void) { - // save current mods - mods = keyboard_report->mods; - - // unregister all mods to start from clean state - if (mods & MOD_BIT(KC_LSFT)) unregister_code(KC_LSFT); - if (mods & MOD_BIT(KC_RSFT)) unregister_code(KC_RSFT); - if (mods & MOD_BIT(KC_LCTL)) unregister_code(KC_LCTL); - if (mods & MOD_BIT(KC_RCTL)) unregister_code(KC_RCTL); - if (mods & MOD_BIT(KC_LALT)) unregister_code(KC_LALT); - if (mods & MOD_BIT(KC_RALT)) unregister_code(KC_RALT); - if (mods & MOD_BIT(KC_LGUI)) unregister_code(KC_LGUI); - if (mods & MOD_BIT(KC_RGUI)) unregister_code(KC_RGUI); - - switch(input_mode) { +void unicode_input_start(void) { + saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + + switch (unicode_config.input_mode) { case UC_OSX: - register_code(KC_LALT); - break; - case UC_OSX_RALT: - register_code(KC_RALT); + register_code(UNICODE_OSX_KEY); break; case UC_LNX: register_code(KC_LCTL); register_code(KC_LSFT); - register_code(KC_U); - unregister_code(KC_U); + tap_code(KC_U); // TODO: Replace with tap_code16(LCTL(LSFT(KC_U))); and test unregister_code(KC_LSFT); unregister_code(KC_LCTL); break; case UC_WIN: register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); + tap_code(KC_PPLS); break; case UC_WINC: - register_code(KC_RALT); - unregister_code(KC_RALT); - register_code(KC_U); - unregister_code(KC_U); + tap_code(UNICODE_WINC_KEY); + tap_code(KC_U); + break; } + wait_ms(UNICODE_TYPE_DELAY); } __attribute__((weak)) -void unicode_input_finish (void) { - switch(input_mode) { - case UC_OSX: - case UC_WIN: - unregister_code(KC_LALT); - break; - case UC_OSX_RALT: - unregister_code(KC_RALT); - break; - case UC_LNX: - register_code(KC_SPC); - unregister_code(KC_SPC); - break; +void unicode_input_finish(void) { + switch (unicode_config.input_mode) { + case UC_OSX: + unregister_code(UNICODE_OSX_KEY); + break; + case UC_LNX: + tap_code(KC_SPC); + break; + case UC_WIN: + unregister_code(KC_LALT); + break; } - // reregister previously set mods - if (mods & MOD_BIT(KC_LSFT)) register_code(KC_LSFT); - if (mods & MOD_BIT(KC_RSFT)) register_code(KC_RSFT); - if (mods & MOD_BIT(KC_LCTL)) register_code(KC_LCTL); - if (mods & MOD_BIT(KC_RCTL)) register_code(KC_RCTL); - if (mods & MOD_BIT(KC_LALT)) register_code(KC_LALT); - if (mods & MOD_BIT(KC_RALT)) register_code(KC_RALT); - if (mods & MOD_BIT(KC_LGUI)) register_code(KC_LGUI); - if (mods & MOD_BIT(KC_RGUI)) register_code(KC_RGUI); + set_mods(saved_mods); // Reregister previously set mods } __attribute__((weak)) @@ -124,13 +137,12 @@ uint16_t hex_to_keycode(uint8_t hex) { void register_hex(uint16_t hex) { for(int i = 3; i >= 0; i--) { uint8_t digit = ((hex >> (i*4)) & 0xF); - register_code(hex_to_keycode(digit)); - unregister_code(hex_to_keycode(digit)); + tap_code(hex_to_keycode(digit)); } } void send_unicode_hex_string(const char *str) { - if (!str) { return; } // Safety net + if (!str) { return; } while (*str) { // Find the next code point (token) in the string @@ -153,3 +165,61 @@ void send_unicode_hex_string(const char *str) { str += n; // Move to the first ' ' (or '\0') after the current token } } + +bool process_unicode_common(uint16_t keycode, keyrecord_t *record) { + if (record->event.pressed) { + switch (keycode) { + case UNICODE_MODE_FORWARD: + cycle_unicode_input_mode(+1); + break; + case UNICODE_MODE_REVERSE: + cycle_unicode_input_mode(-1); + break; + + case UNICODE_MODE_OSX: + set_unicode_input_mode(UC_OSX); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_OSX) + static float song_osx[][2] = UNICODE_SONG_OSX; + PLAY_SONG(song_osx); +#endif + break; + case UNICODE_MODE_LNX: + set_unicode_input_mode(UC_LNX); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_LNX) + static float song_lnx[][2] = UNICODE_SONG_LNX; + PLAY_SONG(song_lnx); +#endif + break; + case UNICODE_MODE_WIN: + set_unicode_input_mode(UC_WIN); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WIN) + static float song_win[][2] = UNICODE_SONG_WIN; + PLAY_SONG(song_win); +#endif + break; + case UNICODE_MODE_BSD: + set_unicode_input_mode(UC_BSD); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_BSD) + static float song_bsd[][2] = UNICODE_SONG_BSD; + PLAY_SONG(song_bsd); +#endif + break; + case UNICODE_MODE_WINC: + set_unicode_input_mode(UC_WINC); +#if defined(AUDIO_ENABLE) && defined(UNICODE_SONG_WINC) + static float song_winc[][2] = UNICODE_SONG_WINC; + PLAY_SONG(song_winc); +#endif + break; + } + } +#if defined(UNICODE_ENABLE) + return process_unicode(keycode, record); +#elif defined(UNICODEMAP_ENABLE) + return process_unicode_map(keycode, record); +#elif defined(UCIS_ENABLE) + return process_ucis(keycode, record); +#else + return true; +#endif +} diff --git a/quantum/process_keycode/process_unicode_common.h b/quantum/process_keycode/process_unicode_common.h index e78e1cec6c..e608ab76be 100644 --- a/quantum/process_keycode/process_unicode_common.h +++ b/quantum/process_keycode/process_unicode_common.h @@ -14,35 +14,71 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UNICODE_COMMON_H -#define PROCESS_UNICODE_COMMON_H +#pragma once #include "quantum.h" +#if defined(UNICODE_ENABLE) + defined(UNICODEMAP_ENABLE) + defined(UCIS_ENABLE) > 1 + #error "Cannot enable more than one Unicode method (UNICODE, UNICODEMAP, UCIS) at the same time" +#endif + +// Keycodes used for starting Unicode input on different platforms +#ifndef UNICODE_OSX_KEY + #define UNICODE_OSX_KEY KC_LALT +#endif +#ifndef UNICODE_WINC_KEY + #define UNICODE_WINC_KEY KC_RALT +#endif + +// Comma-delimited, ordered list of input modes selected for use (e.g. in cycle) +// Example: #define UNICODE_SELECTED_MODES UC_WINC, UC_LNX +#ifndef UNICODE_SELECTED_MODES + #define UNICODE_SELECTED_MODES -1 +#endif + +// Whether input mode changes in cycle should be written to EEPROM +#ifndef UNICODE_CYCLE_PERSIST + #define UNICODE_CYCLE_PERSIST true +#endif + +// Delay between starting Unicode input and sending a sequence, in ms #ifndef UNICODE_TYPE_DELAY -#define UNICODE_TYPE_DELAY 10 + #define UNICODE_TYPE_DELAY 10 #endif -__attribute__ ((unused)) -static uint8_t input_mode; +enum unicode_input_modes { + UC_OSX, // Mac OS X using Unicode Hex Input + UC_LNX, // Linux using IBus + UC_WIN, // Windows using EnableHexNumpad + UC_BSD, // BSD (not implemented) + UC_WINC, // Windows using WinCompose (https://github.com/samhocevar/wincompose) + UC__COUNT // Number of available input modes (always leave at the end) +}; + +typedef union { + uint32_t raw; + struct { + uint8_t input_mode : 8; + }; +} unicode_config_t; + +extern unicode_config_t unicode_config; -void set_unicode_input_mode(uint8_t os_target); -uint8_t get_unicode_input_mode(void); void unicode_input_mode_init(void); +uint8_t get_unicode_input_mode(void); +void set_unicode_input_mode(uint8_t mode); +void cycle_unicode_input_mode(uint8_t offset); +void persist_unicode_input_mode(void); + void unicode_input_start(void); void unicode_input_finish(void); + void register_hex(uint16_t hex); void send_unicode_hex_string(const char *str); -#define UC_OSX 0 // Mac OS X -#define UC_LNX 1 // Linux -#define UC_WIN 2 // Windows 'HexNumpad' -#define UC_BSD 3 // BSD (not implemented) -#define UC_WINC 4 // WinCompose https://github.com/samhocevar/wincompose -#define UC_OSX_RALT 5 // Mac OS X using Right Alt key for Unicode Compose +bool process_unicode_common(uint16_t keycode, keyrecord_t *record); #define UC_BSPC UC(0x0008) - #define UC_SPC UC(0x0020) #define UC_EXLM UC(0x0021) @@ -147,5 +183,3 @@ void send_unicode_hex_string(const char *str); #define UC_RCBR UC(0x007D) #define UC_TILD UC(0x007E) #define UC_DEL UC(0x007F) - -#endif diff --git a/quantum/process_keycode/process_unicodemap.c b/quantum/process_keycode/process_unicodemap.c index ab5717ba3a..75f35112b1 100644 --- a/quantum/process_keycode/process_unicodemap.c +++ b/quantum/process_keycode/process_unicodemap.c @@ -45,13 +45,12 @@ __attribute__((weak)) void unicode_map_input_error() {} bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { - unicode_input_mode_init(); uint8_t input_mode = get_unicode_input_mode(); if ((keycode & QK_UNICODE_MAP) == QK_UNICODE_MAP && record->event.pressed) { const uint32_t* map = unicode_map; uint16_t index = keycode - QK_UNICODE_MAP; uint32_t code = pgm_read_dword(&map[index]); - if (code > 0xFFFF && code <= 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) { + if (code > 0xFFFF && code <= 0x10ffff && input_mode == UC_OSX) { // Convert to UTF-16 surrogate pair code -= 0x10000; uint32_t lo = code & 0x3ff; @@ -60,7 +59,7 @@ bool process_unicode_map(uint16_t keycode, keyrecord_t *record) { register_hex32(hi + 0xd800); register_hex32(lo + 0xdc00); unicode_input_finish(); - } else if ((code > 0x10ffff && (input_mode == UC_OSX || input_mode == UC_OSX_RALT)) || (code > 0xFFFFF && input_mode == UC_LNX)) { + } else if ((code > 0x10ffff && input_mode == UC_OSX) || (code > 0xFFFFF && input_mode == UC_LNX)) { // when character is out of range supported by the OS unicode_map_input_error(); } else { diff --git a/quantum/process_keycode/process_unicodemap.h b/quantum/process_keycode/process_unicodemap.h index 929c88c0b6..f6d64bb86b 100644 --- a/quantum/process_keycode/process_unicodemap.h +++ b/quantum/process_keycode/process_unicodemap.h @@ -14,12 +14,10 @@ * along with this program. If not, see . */ -#ifndef PROCESS_UNICODEMAP_H -#define PROCESS_UNICODEMAP_H +#pragma once #include "quantum.h" #include "process_unicode_common.h" void unicode_map_input_error(void); bool process_unicode_map(uint16_t keycode, keyrecord_t *record); -#endif diff --git a/quantum/quantum.c b/quantum/quantum.c index a57d4f89fe..85db100ab4 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c @@ -243,7 +243,7 @@ bool process_record_quantum(keyrecord_t *record) { process_key_lock(&keycode, record) && #endif #if defined(AUDIO_ENABLE) && defined(AUDIO_CLICKY) - process_clicky(keycode, record) && + process_clicky(keycode, record) && #endif //AUDIO_CLICKY process_record_kb(keycode, record) && #if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_KEYPRESSES) @@ -258,33 +258,27 @@ bool process_record_quantum(keyrecord_t *record) { #ifdef STENO_ENABLE process_steno(keycode, record) && #endif - #if ( defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) + #if (defined(AUDIO_ENABLE) || (defined(MIDI_ENABLE) && defined(MIDI_BASIC))) && !defined(NO_MUSIC_MODE) process_music(keycode, record) && #endif #ifdef TAP_DANCE_ENABLE process_tap_dance(keycode, record) && #endif + #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) + process_unicode_common(keycode, record) && + #endif #ifdef LEADER_ENABLE process_leader(keycode, record) && #endif #ifdef COMBO_ENABLE process_combo(keycode, record) && #endif - #ifdef UNICODE_ENABLE - process_unicode(keycode, record) && - #endif - #ifdef UCIS_ENABLE - process_ucis(keycode, record) && - #endif #ifdef PRINTING_ENABLE process_printer(keycode, record) && #endif #ifdef AUTO_SHIFT_ENABLE process_auto_shift(keycode, record) && #endif - #ifdef UNICODEMAP_ENABLE - process_unicode_map(keycode, record) && - #endif #ifdef TERMINAL_ENABLE process_terminal(keycode, record) && #endif @@ -1010,6 +1004,9 @@ void matrix_init_quantum() { #ifdef ENCODER_ENABLE encoder_init(); #endif + #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) + unicode_input_mode_init(); + #endif matrix_init_kb(); } diff --git a/quantum/quantum_keycodes.h b/quantum/quantum_keycodes.h index 283b4a65ca..2b309f4d52 100644 --- a/quantum/quantum_keycodes.h +++ b/quantum/quantum_keycodes.h @@ -81,9 +81,6 @@ enum quantum_keycodes { #endif QK_MOD_TAP = 0x6000, QK_MOD_TAP_MAX = 0x7FFF, -#if defined(UNICODEMAP_ENABLE) && defined(UNICODE_ENABLE) - #error "Cannot enable both UNICODEMAP && UNICODE" -#endif #ifdef UNICODE_ENABLE QK_UNICODE = 0x8000, QK_UNICODE_MAX = 0xFFFF, @@ -456,6 +453,15 @@ enum quantum_keycodes { EEPROM_RESET, + UNICODE_MODE_FORWARD, + UNICODE_MODE_REVERSE, + + UNICODE_MODE_OSX, + UNICODE_MODE_LNX, + UNICODE_MODE_WIN, + UNICODE_MODE_BSD, + UNICODE_MODE_WINC, + // always leave at the end SAFE_RANGE }; @@ -684,6 +690,15 @@ enum quantum_keycodes { #define X(n) (QK_UNICODE_MAP | (n)) #endif +#define UC_MOD UNICODE_MODE_FORWARD +#define UC_RMOD UNICODE_MODE_REVERSE + +#define UC_M_OS UNICODE_MODE_OSX +#define UC_M_LN UNICODE_MODE_LNX +#define UC_M_WI UNICODE_MODE_WIN +#define UC_M_BS UNICODE_MODE_BSD +#define UC_M_WC UNICODE_MODE_WINC + #ifdef SWAP_HANDS_ENABLE #define SH_T(kc) (QK_SWAP_HANDS | (kc)) #define SH_TG (QK_SWAP_HANDS | OP_SH_TOGGLE) -- cgit v1.2.3 From df33618b26bb7ff0c0eff619b2d638490c514ce4 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 19 Dec 2018 13:56:44 +0000 Subject: Minor STM32 i2c driver cleanup --- drivers/arm/i2c_master.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index ab962ea959..4417dc9851 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -45,8 +45,6 @@ static const I2CConfig i2cconfig = { __attribute__ ((weak)) void i2c_init(void) { - //palSetGroupMode(GPIOB, GPIOB_PIN6 | GPIOB_PIN7, 0, PAL_MODE_INPUT); - // Try releasing special pins for a short time palSetPadMode(GPIOB, 6, PAL_MODE_INPUT); palSetPadMode(GPIOB, 7, PAL_MODE_INPUT); -- cgit v1.2.3 From b13162f7fd5a4c09dff15ff6f9713526622925a7 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 19 Dec 2018 13:59:58 +0000 Subject: Also fix use of weak stm32 internal pullup --- drivers/arm/i2c_master.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/arm/i2c_master.c b/drivers/arm/i2c_master.c index 4417dc9851..385bd97cb8 100644 --- a/drivers/arm/i2c_master.c +++ b/drivers/arm/i2c_master.c @@ -51,8 +51,8 @@ void i2c_init(void) chThdSleepMilliseconds(10); - palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); - palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN | PAL_STM32_PUPDR_PULLUP); + palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); + palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(4) | PAL_STM32_OTYPE_OPENDRAIN); //i2cInit(); //This is invoked by halInit() so no need to redo it. } -- cgit v1.2.3 From 5eb8f3f6b51cecc067aaedfb8b2f08cb626381bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismael=20Venegas=20Castell=C3=B3?= Date: Wed, 19 Dec 2018 18:49:56 -0600 Subject: Keymap: Refactor Hacker Dvorak (#4688) Programmer Dvorak based layout for the Ergodox EZ. --- .../ergodox_ez/keymaps/hacker_dvorak/config.h | 50 +- .../keymaps/hacker_dvorak/default.png.md | 1 - .../keymaps/hacker_dvorak/default_highres.png.md | 1 - .../ergodox_ez/keymaps/hacker_dvorak/gulpfile.js | 10 +- .../keymaps/hacker_dvorak/hacker_dvorak.c | 353 +++++++++ .../hacker_dvorak/keycodes/aliases_definitions.c | 5 + .../hacker_dvorak/keycodes/custom_keycodes.c | 8 + .../ergodox_ez/keymaps/hacker_dvorak/keymap.c | 800 +-------------------- .../hacker_dvorak/layers/layers_definitions.c | 12 + .../hacker_dvorak/leader/leader_dictionary.c | 14 + .../keymaps/hacker_dvorak/leader/leader_setup.c | 14 + .../keymaps/hacker_dvorak/plover/plover_mode.c | 20 + .../ergodox_ez/keymaps/hacker_dvorak/readme.md | 10 +- .../ergodox_ez/keymaps/hacker_dvorak/rules.mk | 33 +- .../tap_dance/mod_tap_layer_dances/none_lead.c | 40 ++ .../hacker_dvorak/tap_dance/tap_dance_actions.c | 20 + .../hacker_dvorak/tap_dance/tap_dance_setup.c | 75 ++ .../keymaps/hacker_dvorak/tap_dance/tap_dances.c | 74 ++ .../hacker_dvorak/user/eeconfig_init_user.c | 3 + .../hacker_dvorak/user/layer_set_state_user.c | 121 ++++ .../keymaps/hacker_dvorak/user/matrix_scan_user.c | 12 + .../hacker_dvorak/user/process_record_user.c | 75 ++ 22 files changed, 925 insertions(+), 826 deletions(-) delete mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md delete mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c create mode 100644 keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h index c6b86004c5..e188d95d51 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/config.h @@ -5,26 +5,33 @@ #pragma once -/* Keyboard Settings */ #undef TAPPING_TERM -#define TAPPING_TERM 150 +#define TAPPING_TERM 200 #undef DEBOUNCE #define DEBOUNCE 10 #undef IGNORE_MOD_TAP_INTERRUPT -#define IGNORE_MOD_TAP_INTERRUPT #undef FORCE_NKRO #define FORCE_NKRO -/* This isn't defined by default, so there is no need to undefine it first. */ -#define LEADER_TIMEOUT 500 +#undef TAPPING_TOGGLE +#define TAPPING_TOGGLE 5 + +#define LEADER_TIMEOUT 1000 +#define IGNORE_MOD_TAP_INTERRUPT #define PERMISSIVE_HOLD #define QMK_KEYS_PER_SCAN 4 +#define DANCING_TERM 175 + +#define ONESHOT_TAP_TOGGLE 5 +#define ONESHOT_TIMEOUT 5000 + +#define COMBO_COUNT 4 +#define COMBO_TERM 200 -// RGB Lights #undef RGBLIGHT_HUE_STEP #define RGBLIGHT_HUE_STEP 24 @@ -40,11 +47,7 @@ #undef RGBLIGHT_LIMIT_VAL #define RGBLIGHT_LIMIT_VAL 255 -/* This isn't defined by default, so there is no need to undefine it first. */ -#define RGBLIGHT_SLEEP - -// Mouse #undef MOUSEKEY_INTERVAL #define MOUSEKEY_INTERVAL 10 @@ -52,31 +55,34 @@ #define MOUSEKEY_DELAY 15 #undef MOUSEKEY_MAX_SPEED -#define MOUSEKEY_MAX_SPEED 15 +#define MOUSEKEY_MAX_SPEED 20 #undef MOUSEKEY_TIME_TO_MAX -#define MOUSEKEY_TIME_TO_MAX 150 +#define MOUSEKEY_TIME_TO_MAX 200 #undef MOUSEKEY_WHEEL_MAX_SPEED -#define MOUSEKEY_WHEEL_MAX_SPEED 15 +#define MOUSEKEY_WHEEL_MAX_SPEED 20 #undef MOUSEKEY_WHEEL_TIME_TO_MAX -#define MOUSEKEY_WHEEL_TIME_TO_MAX 150 +#define MOUSEKEY_WHEEL_TIME_TO_MAX 200 -/* This is defined only if CONSOLE_ENABLE is set to "yes" */ // #undef NO_DEBUG // #define NO_DEBUG // #undef NO_PRINT // #define NO_PRINT -/* For COMBO only*/ -// #define COMBO_COUNT 1 -// #define COMBO_TERM 200 +// #define RETRO_TAPPING +// #define TAPPING_FORCE_HOLD + +// #define AUTO_SHIFT_TIMEOUT 150 +// #define NO_AUTO_SHIFT_SPECIAL +// #define NO_AUTO_SHIFT_NUMERIC +// #define NO_AUTO_SHIFT_ALPHA -/* For tap toggle */ -// #define TAPPING_TOGGLE 2 -// #define ONESHOT_TAP_TOGGLE 2 -// #define ONESHOT_TIMEOUT 300 +// #define EXTRA_LONG_COMBOS +// #define EXTRA_EXTRA_LONG_COMBOS +// #define COMBO_ALLOW_ACTION_KEYS +// #define RGBLIGHT_SLEEP diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md deleted file mode 100644 index 744e7d172a..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/fKX0Zbs.png diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md deleted file mode 100644 index 074e0634d2..0000000000 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/default_highres.png.md +++ /dev/null @@ -1 +0,0 @@ -https://i.imgur.com/giAc3M9.jpg diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js index 338b0c6ba2..23f19d18af 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/gulpfile.js @@ -1,7 +1,7 @@ let gulp = require('gulp'); let run = require('gulp-run-command').default; - + gulp.task('clean', run('rm -rf ../../../../.build')); gulp.task('build', ['clean'], run('make -C ../../../../ ergodox_ez:hacker_dvorak', { @@ -9,5 +9,11 @@ gulp.task('build', ['clean'], run('make -C ../../../../ ergodox_ez:hacker_dvorak })); gulp.task('watch', ['build'], () => { - gulp.watch(['keymap.c', 'config.h', 'rules.mk'], ['build']); + gulp.watch([ + 'keymap.c', + 'config.h', + 'rules.mk', + ], ['build']); }); + +gulp.task('default', ['watch']); diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c new file mode 100644 index 0000000000..65878a67cb --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/hacker_dvorak.c @@ -0,0 +1,353 @@ +// Keyboard keymap: +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [DVORAK] = LAYOUT_ergodox( + + // HACKER DVORAK left hand + + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // ESCAPE | | | | | | START RECORDING // + // | | | | | | // + KC_ESC, TD(GRV_TILD), TD(AT_DLR), TD(LCBR_LABK), TD(LPRN_LBRC), TD(EXLM_QUES), DYN_REC_START1, // + // | ~ | $ | < | [ | ? | // + // | TAP DANCE: ` | TAP DANCE: @ TAP DANCE: { | TAP DANCE: ( | TAP DANCE: ! | DYNAMIC MARCO 1 // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // TAB | MOD TAP: ALT+SHIFT | MOD TAP: CTRL+ALT | MOD TAP: CTRL+SHIFT | P | Y | // + // | | | | | | // + KC_TAB, TD(NONE_LEAD), TD(QUOT_DQUO), TD(DOT_COMM), ALL_T(KC_P), MEH_T(KC_Y), DYN_MACRO_PLAY1, // + // | LEAD | " | , | | | // + // | TAP DANCE: NONE | TAP DANCE: ' | TAP DANCE: . | MOD TAP: HYPER | MOD TAP: MEH | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------| PLAY DYNAMIC MACRO 1 // + // | MOD TAP: ALT | MOD TAP: CTRL | LAYER TAP: SHIFT | LAYER TAP: ARROW KEYS | MOD TAP: GUI | // + // | | | | Ü | | // + TD(EQL_PLUS), ALT_T(KC_A), CTL_T(KC_O), SFT_T(KC_E), LT(ARROWS, KC_U), LGUI_T(KC_I), //-----------------------// + // + | Á | Ó | É | Ú | Í | // + // TAP DANCE: = | TAP DANCE: A | TAP DANCE: O | TAP DANCE: E | TAP DANCE: U | TAP DANCE: I | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------| META // + // STOP RECORDING | MOD TAP: GUI+SHIFT+ALT | Q | J | K | X | // + // | | | | | | // + DYN_REC_STOP, TD(SCLN_COLN), SGUI_T(KC_Q), LT(MEDIA_FN, KC_J), LT(NUMPAD, KC_K), LCAG_T(KC_X), KC_LGUI, // + // | : | | | | | // + // DYNAMIC MACRO | TAP DANCE: ; | MOD TAP: SHIFT+GUI | LAYER TAP: MEDIA/F-KEYS | LAYER TAP: ATM NUMPAD | MOD TAP: CTL+ALT+GUI | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // LAYERS SWITCHER | APPLICATION MENU | | | // + // | | | | SCROLL // + TG(LAYERS), KC_APP, KC_NLCK, KC_SLCK, KC_CAPS, // + // | | | | NUM // + // LAYER TOGGLE | | | | TAP DANCE: CAPS // + //------------------------+-------------------------+-------------------------+-------------------------+------------------------// + + // HACKER DVORAK left thumb + + //------------------------+------------------------// + // MOUSE WHEEL LEFT | MOUSE WHEEL RIGHT // + // | // + KC_WH_L, KC_WH_R, // + // | // + // | // + //-------------------------+-------------------------+------------------------// + // | | HOME // + // | | // + /* SPACE | BACKSPACE */ KC_HOME, // + // | | // + // | | // + KC_SPC, KC_BSPC, //-----------------------// + // | | END // + // | | // + /* | */ KC_END, // + // | | // + // | | // + //-------------------------+-------------------------+------------------------// + + // HACKER DVORAK right hand + + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + DYN_REC_START2, TD(APMR_PIPE), TD(RPRN_RBRC), TD(RCBR_RABK), TD(HASH_PERC), TD(ASTR_CIRC), XXXXXXX, // + // | | | | | | // + // | | | | | | // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + DYN_MACRO_PLAY2, MEH_T(KC_F), ALL_T(KC_G), C_S_T(KC_C), LCA_T(KC_R), LAS_T(KC_L), TD(SLSH_BSLS), // + // | | | | | | // + // | | | | | | // + // |-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + /*-----------------------*/ LGUI_T(KC_D), LT(MOUSE, KC_H), SFT_T(KC_T), CTL_T(KC_N), ALT_T(KC_S), TD(MINS_UNDS), // + // | | | | | | // + // | | | | | | // + // |-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | | | // + // | | | | | | // + KC_LGUI, LCAG_T(KC_B), LT(HYPER, KC_M), LT(MEDIA_FN, KC_W), SGUI_T(KC_V), LGAS_T(KC_Z), COMPOSE, // + // | | | | | | // + // | | | | | | ⎄ // + //------------------------+-------------------------+-------------------------+-------------------------+-------------------------+-------------------------+------------------------// + // | | | | // + // | | | | // + KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_SYSREQ, // + // | | | | // + // | | | | // + //------------------------+-------------------------+-------------------------+-------------------------+------------------------// + + // HACKER DVORAK right thumb + + //------------------------+------------------------// + // | // + // | // + KC_WH_U, KC_WH_D, // + // | // + // | // + //------------------------+-------------------------+------------------------// + // | | // + // | | // + KC_PGUP, // | // + // | | // + // | | // + //------------------------| | // + // | | // + // | | // + KC_PGDN, KC_DEL, KC_ENT // + // | | // + // | | // + //------------------------+-------------------------+------------------------// + + ), + + [PLOVER] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), + KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PV_NUM, + KC_TAB, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, + KC_CLCK, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, + XXXXXXX, TG(LAYERS), PV_NUM, PV_NUM, PV_NUM, + + // left thumb + KC_SPACE, KC_BSPACE, + KC_HOME, + PV_A, PV_O, KC_END, + + // right hand + KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, + PV_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, + PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, + PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, + PV_NUM, PV_NUM, PV_NUM, PV_NUM, XXXXXXX, + + // right thumb + KC_DELETE, KC_ENTER, + KC_PGUP, + KC_PGDOWN, PV_E, PV_U + ), + + [GAMING] = LAYOUT_ergodox( + // left hand + KC_ESCAPE, GUI_T(KC_MINS), KC_I, KC_O, KC_P, ALGR_T(KC_EQL), KC_T, + KC_TAB, KC_LALT, KC_Q, KC_W, KC_E, ALL_T(KC_R), KC_G, + LT(MOUSE, KC_GRV), KC_LCTRL, KC_A, KC_S, KC_D, MEH_T(KC_F), + KC_BSLS, KC_LSHIFT, KC_Z, KC_X, KC_C, SCMD_T(KC_V), KC_M, + XXXXXXX, TG(LAYERS), KC_COMM, KC_DOT, KC_LBRC, + + // left thumb + MO(MEDIA_FN), KC_NLCK, + KC_SCLN, + KC_SPACE, KC_ENTER, KC_BSPACE, + + // right hand + KC_QUOT, KC_Y, KC_K, KC_U, KC_KP_7, KC_KP_8, KC_KP_9, + KC_MS_WH_UP, KC_H, KC_J, KC_L, KC_KP_4, KC_KP_2, KC_KP_6, + KC_B, KC_MS_UP, KC_N, KC_KP_1, KC_KP_5, KC_KP_3, + KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, KC_SLASH, + KC_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, + + // right thumb + KC_MS_BTN5, MO(HYPER), + KC_MS_BTN4, + KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 + ), + + [ARROWS] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + LGUI(KC_X), XXXXXXX, LCTL(KC_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, + LGUI(KC_C), XXXXXXX, LCTL(KC_C), KC_UP, SCTL(KC_C), LCTL(KC_Z), LGUI(KC_Z), + KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, + LGUI(KC_V), XXXXXXX, LCTL(KC_V), KC_MS_WH_DOWN, SCTL(KC_V), LCTL(KC_Y), SGUI(KC_Z), + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [MOUSE] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(KC_X), XXXXXXX, LGUI(KC_X), + LGUI(KC_Z), LCTL(KC_Z), SCTL(KC_C), KC_MS_UP, LCTL(KC_C), KC_MS_BTN4, LGUI(KC_C), + KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, + LGUI(KC_Z), LCTL(KC_Y), SCTL(KC_V), KC_MS_WH_DOWN, LCTL(KC_V), KC_MS_BTN5, LGUI(KC_V), + KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, + XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, + XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MS_ACCEL0 + ), + + [NUMPAD] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, + _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, + XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + KC_HOME, + KC_SPACE, KC_BSPACE, KC_END, + + // right hand + KC_X, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, + KC_O, KC_I, KC_1, KC_2, KC_3, KC_SLSH, KC_PERC, + KC_M, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, + KC_L, KC_J, KC_7, KC_8, KC_9, KC_ASTR, KC_CIRC, + KC_DOT, KC_0, KC_COMM, KC_UNDS, KC_BSLS, + + // right thumb + XXXXXXX, XXXXXXX, + KC_PGUP, + KC_PGDOWN, KC_DELETE, KC_ENTER + ), + + [LAYERS] = LAYOUT_ergodox( + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, TO(DVORAK), TO(PLOVER), TO(GAMING), XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [MEDIA_FN] = LAYOUT_ergodox( + // left hand + KC_VOLD, KC_MUTE, RGB_TOG, XXXXXXX, KC_MAIL, KC_FIND, KC_WWW_REFRESH, + KC_MPRV, KC_F9, KC_F7, KC_F5, KC_F3, KC_F1, KC_WWW_HOME, + KC_PAUS, KC_F19, KC_F17, KC_F15, KC_F13, KC_F11, + RGB_HUD, XXXXXXX, XXXXXXX, _______, KC_F23, KC_F21, KC_WWW_BACK, + RGB_VAD, KC_CLCK, KC_PSCREEN, XXXXXXX, MO(FIRMWARE), + + // left thumb + _______, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, KC_MEDIA_EJECT, + + // right hand + KC_WWW_FAVORITES, KC_MYCM, KC_CALC, XXXXXXX, RGB_MOD, RGB_M_P, KC_VOLU, + KC_WWW_SEARCH, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, KC_MNXT, + KC_F12, KC_F14, KC_F16, KC_F18, KC_F20, KC_MPLY, + KC_WWW_FORWARD, KC_F22, KC_F24, _______, XXXXXXX, XXXXXXX, RGB_HUI, + KC_PWR, XXXXXXX, KC_SLEP, KC_WAKE, RGB_VAI, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + RGB_GREEN, XXXXXXX, XXXXXXX + ), + + [HYPER] = LAYOUT_ergodox( + // left hand + XXXXXXX, HYPR(KC_F1), HYPR(KC_F2), HYPR(KC_F3), HYPR(KC_F4), HYPR(KC_F5), XXXXXXX, + XXXXXXX, HYPR(KC_F6), HYPR(KC_F7), HYPR(KC_F8), HYPR(KC_F9), HYPR(KC_F10), XXXXXXX, + XXXXXXX, HYPR(KC_F11), HYPR(KC_F12), HYPR(KC_F13), HYPR(KC_F14), HYPR(KC_F15), + XXXXXXX, HYPR(KC_F16), HYPR(KC_F17), HYPR(KC_F18), HYPR(KC_F19), HYPR(KC_F20), XXXXXXX, + XXXXXXX, HYPR(KC_F21), HYPR(KC_F22), HYPR(KC_F23), HYPR(KC_F24), + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, _______, + XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX + ), + + [FIRMWARE] = LAYOUT_ergodox( + + // left hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + + // left thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + RESET, XXXXXXX, XXXXXXX, + + // right hand + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + + // right thumb + XXXXXXX, XXXXXXX, + XXXXXXX, + XXXXXXX, XXXXXXX, EEP_RST + ) +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c new file mode 100644 index 0000000000..e5eba18202 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/aliases_definitions.c @@ -0,0 +1,5 @@ +// Keycode aliases +#define SCTL(kc) LSFT(LCTL(kc)) // Modifier keys: SHIFT+CTRL+kc combination. +#define LGAS_T(kc) MT(MOD_LGUI | MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, GUI+ALT+SHIFT when held. +#define LAS_T(kc) MT(MOD_LALT | MOD_LSFT, kc) // Mod tap: kc when tapped, ALT+SHIFT whin held. +#define COMPOSE KC_RALT // Compose key (used to input characters like á, ñ, ü). diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c new file mode 100644 index 0000000000..368062172b --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keycodes/custom_keycodes.c @@ -0,0 +1,8 @@ +// Define custom user keycodes: +enum custom_keycodes { + PLACEHOLDER = SAFE_RANGE, // Can always be here. + RGB_GREEN, // To set default RGB layer as green once. + MY_CUSTOM_MACRO, // Custom macro example. + MY_OTHER_MACRO, // Custom macro example. + DYNAMIC_MACRO_RANGE // Should always be the last. +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c index c42b551084..af06d2bd81 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/keymap.c @@ -1,781 +1,19 @@ -#include QMK_KEYBOARD_H -#include "keymap_dvorak.h" -#include "sendstring_dvorak.h" -#include "keymap_plover.h" -#include "keymap_plover_dvorak.h" - - -#define SCTL(kc) LSFT(LCTL(kc)) - -// Layers -enum layers { - DVORAK_US = 0, - PLOVER_US, - GAMING_US, - ARROWS_US, - MOUSE_US, - NUMPAD_US, - LAYERS_US, - DVORAK_DV, - PLOVER_DV, - GAMING_DV, - ARROWS_DV, - MOUSE_DV, - NUMPAD_DV, - LAYERS_DV, - MEDIA_FN, - HYPER_FN, - MEH_FN, - MEH_FN_PLUS, - FIRMWARE -}; - -int CAPS_LOCK = 0; -int NUM_LOCK = 0; -int SCROLL_LOCK = 0; - -enum tap_dances { - TD_ESC_CAPS = 0 -}; - -qk_tap_dance_action_t tap_dance_actions[] = { - [TD_ESC_CAPS] = ACTION_TAP_DANCE_DOUBLE(KC_ESC, KC_CLCK) -}; - - -enum custom_keycodes { - PLACEHOLDER = SAFE_RANGE, // can always be here - RGB_GREEN // to set default RGB layer as green once -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* - * ,--------------------------------------------------. ,--------------------------------------------------. - * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | | 38 | 39 | 40 | 41 | 42 | 43 | 44 | - * |--------+------+------+------+------+------+------| |------+------+------+------+------+------+--------| - * | 7 | 8 | 9 | 10 | 11 | 12 | 13 | | 45 | 46 | 47 | 48 | 49 | 50 | 51 | - * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------| - * | 14 | 15 | 16 | 17 | 18 | 19 |------| |------| 52 | 53 | 54 | 55 | 56 | 57 | - * |--------+------+------+------+------+------| 26 | | 58 |------+------+------+------+------+--------| - * | 20 | 21 | 22 | 23 | 24 | 25 | | | | 59 | 60 | 61 | 62 | 63 | 64 | - * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------' - * | 27 | 28 | 29 | 30 | 31 | | 65 | 66 | 67 | 68 | 69 | - * `----------------------------------' `----------------------------------' - * ,-------------. ,-------------. - * | 32 | 33 | | 70 | 71 | - * ,------+------+------| |------+------+------. - * | | | 34 | | 72 | | | - * | 35 | 36 |------| |------| 74 | 75 | - * | | | 37 | | 73 | | | - * `--------------------' `--------------------' - */ - [DVORAK_US] = LAYOUT_ergodox( - // left hand - KC_ESC, KC_LABK, KC_LCBR, KC_LBRC, KC_LPRN, KC_EXLM, KC_AMPR, - KC_TAB, KC_QUOT, SCMD_T(KC_COMM), MEH_T(KC_DOT), ALL_T(KC_P), KC_Y, KC_AT, - KC_EQL, CTL_T(KC_A), SFT_T(KC_O), LT(NUMPAD_US, KC_E), LT(ARROWS_US, KC_U), KC_I, - KC_BSLS, ALGR_T(KC_SCLN), ALT_T(KC_Q), LT(MEDIA_FN, KC_J), GUI_T(KC_K), KC_X, KC_PERC, - MO(MEH_FN), TG(LAYERS_US), KC_CIRC, KC_PLUS, KC_COLN, - - // left thumb - KC_LEFT, KC_RGHT, - KC_HOME, - KC_SPC, KC_BSPC, KC_END, - - // right hand - KC_PIPE, KC_QUES, KC_RPRN, KC_RBRC, KC_RCBR, KC_RABK, KC_ASTR, - KC_HASH, KC_F, ALL_T(KC_G), MEH_T(KC_C), SCMD_T(KC_R), KC_L, KC_SLSH, - KC_D, LT(MOUSE_US, KC_H), LT(HYPER_FN, KC_T), SFT_T(KC_N), CTL_T(KC_S), KC_MINS, - KC_DLR, KC_B, GUI_T(KC_M), LT(MEDIA_FN, KC_W), ALT_T(KC_V), ALGR_T(KC_Z), KC_GRV, - KC_DQUO, KC_UNDS, KC_TILD, TG(DVORAK_DV), MO(MEH_FN_PLUS), - - // right thumb - KC_UP, KC_DOWN, - KC_PGUP, - KC_PGDN, KC_DEL, KC_ENT - ), - - [PLOVER_US] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), - KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PV_NUM, - KC_TAB, PV_LS, PV_LT, PV_LP, PV_LH, PV_STAR, - KC_CLCK, PV_LS, PV_LK, PV_LW, PV_LR, PV_STAR, PV_STAR, - MO(MEH_FN), TG(LAYERS_US), PV_NUM, PV_NUM, PV_NUM, - - // left thumb - KC_SPACE, KC_BSPACE, - KC_HOME, - PV_A, PV_O, KC_END, - - // right hand - KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, - PV_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, - PV_STAR, PV_RF, PV_RP, PV_RL, PV_RT, PV_RD, - PV_STAR, PV_STAR, PV_RR, PV_RB, PV_RG, PV_RS, PV_RZ, - PV_NUM, PV_NUM, PV_NUM, PV_NUM, MO(MEH_FN_PLUS), - - // right thumb - KC_DELETE, KC_ENTER, - KC_PGUP, - KC_PGDOWN, PV_E, PV_U - ), - - [GAMING_US] = LAYOUT_ergodox( - // left hand - KC_ESCAPE, GUI_T(KC_MINS), KC_I, KC_O, KC_P, ALGR_T(KC_EQL), KC_T, - KC_TAB, KC_LALT, KC_Q, KC_W, KC_E, ALL_T(KC_R), KC_G, - LT(MOUSE_US, KC_GRV), KC_LCTRL, KC_A, KC_S, KC_D, MEH_T(KC_F), - KC_BSLS, KC_LSHIFT, KC_Z, KC_X, KC_C, SCMD_T(KC_V), KC_M, - MO(MEH_FN), TG(LAYERS_US), KC_COMM, KC_DOT, KC_LBRC, - - // left thumb - MO(MEDIA_FN), KC_NLCK, - KC_SCLN, - KC_SPACE, KC_ENTER, KC_BSPACE, - - // right hand - KC_QUOT, KC_Y, KC_K, KC_U, KC_KP_7, KC_KP_8, KC_KP_9, - KC_MS_WH_UP, KC_H, KC_J, KC_L, KC_KP_4, KC_KP_2, KC_KP_6, - KC_B, KC_MS_UP, KC_N, KC_KP_1, KC_KP_5, KC_KP_3, - KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, KC_SLASH, - KC_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, MO(MEH_FN_PLUS), - - // right thumb - KC_MS_BTN5, MO(HYPER_FN), - KC_MS_BTN4, - KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 - ), - - [ARROWS_US] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, - XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, - - // right hand - LGUI(KC_X), XXXXXXX, LCTL(KC_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, - LGUI(KC_C), XXXXXXX, LCTL(KC_C), KC_UP, SCTL(KC_C), LCTL(KC_Z), LGUI(KC_Z), - KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, - LGUI(KC_V), XXXXXXX, LCTL(KC_V), KC_MS_WH_DOWN, SCTL(KC_V), LCTL(KC_Y), SGUI(KC_Z), - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, - - // right thumb - XXXXXXX, XXXXXXX, - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - - [MOUSE_US] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(KC_X), XXXXXXX, LGUI(KC_X), - LGUI(KC_Z), LCTL(KC_Z), SCTL(KC_C), KC_MS_UP, LCTL(KC_C), KC_MS_BTN4, LGUI(KC_C), - KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, - LGUI(KC_Z), LCTL(KC_Y), SCTL(KC_V), KC_MS_WH_DOWN, LCTL(KC_V), KC_MS_BTN5, LGUI(KC_V), - KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, - XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, - XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, KC_MS_ACCEL0 - ), - - [NUMPAD_US] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, - _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, - XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, - - // right hand - KC_X, KC_A, KC_B, KC_C, KC_D, KC_E, KC_F, - KC_O, KC_I, KC_1, KC_2, KC_3, KC_SLSH, KC_PERC, - KC_M, KC_4, KC_5, KC_6, KC_PLUS, KC_MINS, - KC_L, KC_J, KC_7, KC_8, KC_9, KC_ASTR, KC_CIRC, - KC_DOT, KC_0, KC_COMM, KC_UNDS, KC_BSLS, - - // right thumb - XXXXXXX, XXXXXXX, - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - - [LAYERS_US] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, TO(DVORAK_US), TO(PLOVER_US), TO(GAMING_US), XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - - [DVORAK_DV] = LAYOUT_ergodox( - // left hand - KC_ESC, DV_LABK, DV_LCBR, DV_LBRC, DV_LPRN, DV_EXLM, DV_AMPR, - KC_TAB, DV_QUOT, SCMD_T(DV_COMM), MEH_T(DV_DOT), ALL_T(DV_P), DV_Y, DV_AT, - DV_EQL, CTL_T(DV_A), SFT_T(DV_O), LT(NUMPAD_DV, DV_E), LT(ARROWS_DV, DV_U), DV_I, - DV_BSLS, ALGR_T(DV_SCLN), ALT_T(DV_Q), LT(MEDIA_FN, DV_J), GUI_T(DV_K), DV_X, DV_PERC, - MO(MEH_FN), TG(LAYERS_DV), DV_CIRC, DV_PLUS, DV_COLN, - - // left thumb - KC_LEFT, KC_RGHT, - KC_HOME, - KC_SPC, KC_BSPC, KC_END, - - // right hand - DV_PIPE, DV_QUES, DV_RPRN, DV_RBRC, DV_RCBR, DV_RABK, DV_ASTR, - DV_HASH, DV_F, ALL_T(DV_G), MEH_T(DV_C), SCMD_T(DV_R), DV_L, DV_SLSH, - DV_D, LT(MOUSE_DV, DV_H), LT(HYPER_FN, DV_T), SFT_T(DV_N), CTL_T(DV_S), DV_MINS, - DV_DLR, DV_B, GUI_T(DV_M), LT(MEDIA_FN, DV_W), ALT_T(DV_V), ALGR_T(DV_Z), DV_GRV, - DV_DQUO, DV_UNDS, DV_TILD, _______, MO(MEH_FN_PLUS), - - // right thumb - KC_UP, KC_DOWN, - KC_PGUP, - KC_PGDN, KC_DEL, KC_ENT - ), - - [PLOVER_DV] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, KC_MS_BTN2, KC_MS_UP, KC_MS_BTN1, KC_MS_BTN3, GUI_T(KC_NO), - KC_ESC, KC_MS_BTN4, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_BTN5, PD_NUM, - KC_TAB, PD_LS, PD_LT, PD_LP, PD_LH, PD_STAR, - KC_CLCK, PD_LS, PD_LK, PD_LW, PD_LR, PD_STAR, PD_STAR, - MO(MEH_FN), TG(LAYERS_DV), PD_NUM, PD_NUM, PD_NUM, - - // left thumb - KC_SPACE, KC_BSPACE, - KC_HOME, - PD_A, PD_O, KC_END, - - // right hand - KC_MS_ACCEL2, KC_MS_ACCEL1, KC_MS_ACCEL0, KC_UP, KC_APPLICATION, XXXXXXX, KC_MS_WH_UP, - PD_NUM, KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_MS_WH_DOWN, - PD_STAR, PD_RF, PD_RP, PD_RL, PD_RT, PD_RD, - PD_STAR, PD_STAR, PD_RR, PD_RB, PD_RG, PD_RS, PD_RZ, - PD_NUM, PD_NUM, PD_NUM, PD_NUM, MO(MEH_FN_PLUS), - - // right thumb - KC_DELETE, KC_ENTER, - KC_PGUP, - KC_PGDOWN, PD_E, PD_U - ), - - [GAMING_DV] = LAYOUT_ergodox( - // left hand - KC_ESCAPE, GUI_T(DV_MINS), DV_I, DV_O, DV_P, ALGR_T(DV_EQL), DV_T, - KC_TAB, KC_LALT, DV_Q, DV_W, DV_E, ALL_T(DV_R), DV_G, - LT(MOUSE_DV, DV_GRV), KC_LCTRL, DV_A, DV_S, DV_D, MEH_T(DV_F), - DV_BSLS, KC_LSHIFT, DV_Z, DV_X, DV_C, SCMD_T(DV_V), DV_M, - MO(MEH_FN), TG(LAYERS_DV), DV_COMM, DV_DOT, DV_LBRC, - - // left thumb - MO(MEDIA_FN), KC_NLCK, - DV_SCLN, - KC_SPACE, KC_ENTER, KC_BSPACE, - - // right hand - DV_QUOT, DV_Y, DV_K, DV_U, KC_KP_7, KC_KP_8, KC_KP_9, - KC_MS_WH_UP, DV_H, DV_J, DV_L, KC_KP_4, KC_KP_2, KC_KP_6, - DV_B, KC_MS_UP, DV_N, KC_KP_1, KC_KP_5, KC_KP_3, - KC_MS_WH_DOWN, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_UP, KC_KP_0, DV_SLSH, - DV_RBRC, KC_LEFT, KC_DOWN, KC_RIGHT, MO(MEH_FN_PLUS), - - // right thumb - KC_MS_BTN5, MO(HYPER_FN), - KC_MS_BTN4, - KC_MS_BTN3, KC_MS_BTN2, KC_MS_BTN1 - ), - - [ARROWS_DV] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, SCMD_T(KC_NO), MEH_T(KC_NO), ALL_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, KC_LCTRL, KC_LSHIFT, XXXXXXX, _______, XXXXXXX, - XXXXXXX, KC_RALT, KC_LALT, GUI_T(KC_NO), XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, - - // right hand - LGUI(DV_X), XXXXXXX, LCTL(DV_X), KC_MS_WH_UP, XXXXXXX, XXXXXXX, XXXXXXX, - LGUI(DV_C), XXXXXXX, LCTL(DV_C), KC_UP, SCTL(DV_C), LCTL(DV_Z), LGUI(DV_Z), - KC_MS_WH_LEFT, KC_LEFT, KC_DOWN, KC_RIGHT, KC_MS_WH_RIGHT, KC_APPLICATION, - LGUI(DV_V), XXXXXXX, LCTL(DV_V), KC_MS_WH_DOWN, SCTL(DV_V), LCTL(DV_Y), SGUI(DV_Z), - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SLCK, - - // right thumb - XXXXXXX, XXXXXXX, - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - - [MOUSE_DV] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, KC_MS_WH_UP, LCTL(DV_X), XXXXXXX, LGUI(DV_X), - LGUI(DV_Z), LCTL(DV_Z), SCTL(DV_C), KC_MS_UP, LCTL(DV_C), KC_MS_BTN4, LGUI(DV_C), - KC_MS_BTN3, KC_MS_WH_LEFT, KC_MS_LEFT, KC_MS_DOWN, KC_MS_RIGHT, KC_MS_WH_RIGHT, - LGUI(DV_Z), LCTL(DV_Y), SCTL(DV_V), KC_MS_WH_DOWN, LCTL(DV_V), KC_MS_BTN5, LGUI(DV_V), - KC_SLCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - KC_MS_BTN1, KC_MS_BTN2, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, ALL_T(KC_NO), MEH_T(KC_NO), SCMD_T(KC_NO), XXXXXXX, - XXXXXXX, _______, KC_MS_ACCEL1, KC_LSHIFT, KC_LCTRL, KC_MS_ACCEL2, - XXXXXXX, XXXXXXX, XXXXXXX, GUI_T(KC_NO), KC_LALT, KC_RALT, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, KC_MS_ACCEL0 - ), - - [NUMPAD_DV] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, GUI_T(KC_NO), XXXXXXX, ALL_T(KC_NO), XXXXXXX, XXXXXXX, - _______, KC_LCTRL, KC_LSHIFT, _______, MEH_T(KC_NO), XXXXXXX, - XXXXXXX, KC_RALT, KC_LALT, XXXXXXX, SCMD_T(KC_NO), XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - KC_HOME, - KC_SPACE, KC_BSPACE, KC_END, - - // right hand - DV_X, DV_A, DV_B, DV_C, DV_D, DV_E, DV_F, - DV_O, DV_I, DV_1, DV_2, DV_3, DV_SLSH, DV_PERC, - DV_M, DV_4, DV_5, DV_6, DV_PLUS, DV_MINS, - DV_L, DV_J, DV_7, DV_8, DV_9, DV_ASTR, DV_CIRC, - DV_DOT, DV_0, DV_COMM, DV_UNDS, DV_BSLS, - - // right thumb - XXXXXXX, XXXXXXX, - KC_PGUP, - KC_PGDOWN, KC_DELETE, KC_ENTER - ), - - [LAYERS_DV] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, TO(DVORAK_DV), TO(PLOVER_DV), TO(GAMING_DV), XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - - [MEDIA_FN] = LAYOUT_ergodox( - // left hand - KC_AUDIO_VOL_DOWN, KC_AUDIO_MUTE, RGB_TOG, XXXXXXX, KC_MAIL, KC_FIND, KC_WWW_REFRESH, - KC_MEDIA_PREV_TRACK, KC_F9, KC_F7, KC_F5, KC_F3, KC_F1, KC_WWW_HOME, - KC_PAUSE, KC_F19, KC_F17, KC_F15, KC_F13, KC_F11, - RGB_HUD, XXXXXXX, XXXXXXX, _______, KC_F23, KC_F21, KC_WWW_BACK, - RGB_VAD, KC_CLCK, KC_PSCREEN, XXXXXXX, MO(FIRMWARE), - - // left thumb - _______, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, KC_MEDIA_EJECT, - - // right hand - KC_WWW_FAVORITES, KC_MY_COMPUTER, KC_CALCULATOR, XXXXXXX, RGB_MOD, RGB_M_P, KC_AUDIO_VOL_UP, - KC_WWW_SEARCH, KC_F2, KC_F4, KC_F6, KC_F8, KC_F10, KC_MEDIA_NEXT_TRACK, - KC_F12, KC_F14, KC_F16, KC_F18, KC_F20, KC_MEDIA_PLAY_PAUSE, - KC_WWW_FORWARD, KC_F22, KC_F24, _______, XXXXXXX, XXXXXXX, RGB_HUI, - KC_SYSTEM_POWER, XXXXXXX, KC_SYSTEM_SLEEP, KC_SYSTEM_WAKE, RGB_VAI, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - RGB_GREEN, XXXXXXX, XXXXXXX - ), - - [HYPER_FN] = LAYOUT_ergodox( - // left hand - XXXXXXX, HYPR(KC_F1), HYPR(KC_F2), HYPR(KC_F3), HYPR(KC_F4), HYPR(KC_F5), XXXXXXX, - XXXXXXX, HYPR(KC_F6), HYPR(KC_F7), HYPR(KC_F8), HYPR(KC_F9), HYPR(KC_F10), XXXXXXX, - XXXXXXX, HYPR(KC_F11), HYPR(KC_F12), HYPR(KC_F13), HYPR(KC_F14), HYPR(KC_F15), - XXXXXXX, HYPR(KC_F16), HYPR(KC_F17), HYPR(KC_F18), HYPR(KC_F19), HYPR(KC_F20), XXXXXXX, - XXXXXXX, HYPR(KC_F21), HYPR(KC_F22), HYPR(KC_F23), HYPR(KC_F24), - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, _______, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - - [MEH_FN] = LAYOUT_ergodox( - // left hand - LCA(KC_F11), LCA(KC_F9), LCA(KC_F7), LCA(KC_F5), LCA(KC_F3), LCA(KC_F1), XXXXXXX, - LCAG(KC_F11), LCAG(KC_F9), LCAG(KC_F7), LCAG(KC_F5), LCAG(KC_F3), LCAG(KC_F1), XXXXXXX, - MEH(KC_F11), MEH(KC_F9), MEH(KC_F7), MEH(KC_F5), MEH(KC_F3), MEH(KC_F1), - SGUI(KC_F11), SGUI(KC_F9), SGUI(KC_F7), SGUI(KC_F5), SGUI(KC_F3), SGUI(KC_F1), XXXXXXX, - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, LCA(KC_F2), LCA(KC_F4), LCA(KC_F6), LCA(KC_F8), LCA(KC_F10), LCA(KC_F12), - XXXXXXX, LCAG(KC_F2), LCAG(KC_F4), LCAG(KC_F6), LCAG(KC_F8), LCAG(KC_F10), LCAG(KC_F12), - MEH(KC_F2), MEH(KC_F4), MEH(KC_F6), MEH(KC_F8), MEH(KC_F10), MEH(KC_F12), - XXXXXXX, SGUI(KC_F2), SGUI(KC_F4), SGUI(KC_F6), SGUI(KC_F8), SGUI(KC_F10), SGUI(KC_F12), - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - - [MEH_FN_PLUS] = LAYOUT_ergodox( - // left hand - LCA(KC_F23), LCA(KC_F21), LCA(KC_F19), LCA(KC_F17), LCA(KC_F15), LCA(KC_F13), XXXXXXX, - LCAG(KC_F23), LCAG(KC_F21), LCAG(KC_F19), LCAG(KC_F17), LCAG(KC_F15), LCAG(KC_F13), XXXXXXX, - MEH(KC_F23), MEH(KC_F21), MEH(KC_F19), MEH(KC_F17), MEH(KC_F15), MEH(KC_F13), - SGUI(KC_F23), SGUI(KC_F21), SGUI(KC_F19), SGUI(KC_F17), SGUI(KC_F15), SGUI(KC_F13), XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, LCA(KC_F14), LCA(KC_F16), LCA(KC_F18), LCA(KC_F20), LCA(KC_F22), LCA(KC_F24), - XXXXXXX, LCAG(KC_F14), LCAG(KC_F16), LCAG(KC_F18), LCAG(KC_F20), LCAG(KC_F22), LCAG(KC_F24), - MEH(KC_F14), MEH(KC_F16), MEH(KC_F18), MEH(KC_F20), MEH(KC_F22), MEH(KC_F24), - XXXXXXX, SGUI(KC_F14), SGUI(KC_F16), SGUI(KC_F18), SGUI(KC_F20), SGUI(KC_F22), SGUI(KC_F24), - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX - ), - - [FIRMWARE] = LAYOUT_ergodox( - // left hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - - // left thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - RESET, XXXXXXX, XXXXXXX, - - // right hand - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - - // right thumb - XXXXXXX, XXXXXXX, - XXXXXXX, - XXXXXXX, XXXXXXX, EEP_RST - ) -}; - - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RGB_GREEN: - if (record->event.pressed) { - #ifdef RGBLIGHT_ENABLE - rgblight_enable(); - rgblight_mode(1); - rgblight_sethsv_red(); - #endif - } - - return false; - - case KC_CLCK: - if (record->event.pressed) { - if (!(CAPS_LOCK)) { - ergodox_right_led_1_on(); - CAPS_LOCK = 1; - } else { - ergodox_right_led_1_off(); - CAPS_LOCK = 0; - } - } - - return true; - - case KC_NLCK: - if (record->event.pressed) { - if (!(NUM_LOCK)) { - ergodox_right_led_2_on(); - NUM_LOCK = 1; - } else { - ergodox_right_led_2_off(); - NUM_LOCK = 0; - } - } - - return true; - - case KC_SLCK: - if (record->event.pressed) { - if (!(SCROLL_LOCK)) { - ergodox_right_led_3_on(); - SCROLL_LOCK = 1; - } else { - ergodox_right_led_3_off(); - SCROLL_LOCK = 0; - } - } - - case KC_MS_WH_LEFT: - if (record->event.pressed) { - if (SCROLL_LOCK) { - return false; - } else { - return true; - } - } - - case KC_MS_WH_UP: - if (record->event.pressed) { - if (SCROLL_LOCK) { - return false; - } else { - return true; - } - } - - case KC_MS_WH_DOWN: - if (record->event.pressed) { - if (SCROLL_LOCK) { - return false; - } else { - return true; - } - } - - case KC_MS_WH_RIGHT: - if (record->event.pressed) { - if (SCROLL_LOCK) { - return false; - } else { - return true; - } - } - - default: - return true; - } -} - -uint32_t layer_state_set_user(uint32_t state) { - uint8_t layer = biton32(state); - - switch (layer) { - case DVORAK_US: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - - break; - - case PLOVER_US: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - - break; - - case GAMING_US: - rgblight_sethsv_noeeprom_red(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - - break; - - case ARROWS_US: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case MOUSE_US: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case NUMPAD_US: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case LAYERS_US: - rgblight_sethsv_noeeprom_cyan(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case DVORAK_DV: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); - break; - - case PLOVER_DV: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - - break; - - case GAMING_DV: - rgblight_sethsv_noeeprom_green(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); - - break; - - case ARROWS_DV: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case MOUSE_DV: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case NUMPAD_DV: - rgblight_sethsv_noeeprom_blue(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case LAYERS_DV: - rgblight_sethsv_noeeprom_cyan(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case MEDIA_FN: - rgblight_sethsv_noeeprom_yellow(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case HYPER_FN: - rgblight_sethsv_noeeprom_magenta(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - case MEH_FN: - rgblight_sethsv_noeeprom_magenta(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 4); - - break; - - case MEH_FN_PLUS: - rgblight_sethsv_noeeprom_magenta(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_SNAKE + 5); - - break; - - case FIRMWARE: - rgblight_sethsv_noeeprom_pink(); - rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); - - break; - - default: - break; - } - - return state; -}; +#include QMK_KEYBOARD_H // Includes the QMK-verse. +#include "keymap_plover.h" // Includes the Plover keymap for easier readability. + + +// TODO: No eeprom changes unless needed, custom rgb settings for animations. +#include "keycodes/aliases_definitions.c" +#include "layers/layers_definitions.c" +#include "tap_dance/tap_dance_setup.c" +#include "tap_dance/tap_dances.c" +#include "user/matrix_scan_user.c" +#include "tap_dance/mod_tap_layer_dances/none_lead.c" +#include "tap_dance/tap_dance_actions.c" +#include "keycodes/custom_keycodes.c" +#include "dynamic_macro.h" // Includes dynamic macro definitions, needed *after* the custom keycodes. +#include "hacker_dvorak.c" +#include "user/eeconfig_init_user.c" +#include "user/process_record_user.c" +#include "plover/plover_mode.c" +#include "user/layer_set_state_user.c" diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c new file mode 100644 index 0000000000..f190e4f6f9 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/layers/layers_definitions.c @@ -0,0 +1,12 @@ +enum layers { // Hacker Dvorak keyboard layers: + DVORAK = 0, // * Dvorak base layer. + PLOVER = 1, // * Steno layer for use with Plover. + GAMING = 2, // * Gaming layer intended for general purpose playing. + ARROWS = 3, // * Arrows movement keys and edition shortcuts. + MOUSE = 4, // * Mouse movement keys and edition shortcuts. + NUMPAD = 5, // * ATM style numpad with symbols and letters that should suffice to input any numeric literal. + LAYERS = 6, // * Layer switcher used to change between DVORAK, PLOVER and GAMING layers. + MEDIA_FN = 7, // * Media, RGB and function keys from F1 to F24 in symmetric fashion. + HYPER = 8, // * Hot keys layer (uses hyper + F1 .. F24) suitable for global shortcut tasks. + FIRMWARE = 9 // * Layer with firmware related functionality, like the reset and EEPROM keys. +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c new file mode 100644 index 0000000000..8d5fa00a7d --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_dictionary.c @@ -0,0 +1,14 @@ +LEADER_DICTIONARY() { + leading = false; + leader_end(); + + SEQ_ONE_KEY(TD(APMR_PIPE)) { + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + } +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c new file mode 100644 index 0000000000..1e89c4bfca --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/leader/leader_setup.c @@ -0,0 +1,14 @@ +LEADER_EXTERNS(); + +void qk_leader_start(void) { + if (!leading) { + leading = true; + leader_time = timer_read(); + leader_sequence_size = 0; + leader_sequence[0] = 0; + leader_sequence[1] = 0; + leader_sequence[2] = 0; + leader_sequence[3] = 0; + leader_sequence[4] = 0; + } +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c new file mode 100644 index 0000000000..b388264907 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/plover/plover_mode.c @@ -0,0 +1,20 @@ +// TODO: improve feedback +void plover_toggle(void) { + // Press "PHROLG" + register_code(PV_LP); + register_code(PV_LH); + register_code(PV_LR); + register_code(PV_O); + register_code(PV_RL); + register_code(PV_RG); + + // Release "PHROLG" + unregister_code(PV_LP); + unregister_code(PV_LH); + unregister_code(PV_LR); + unregister_code(PV_O); + unregister_code(PV_RL); + unregister_code(PV_RG); +} + +bool PLOVER_MODE = false; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md index c7df0d7483..8089a6d55a 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/readme.md @@ -17,8 +17,8 @@ I plan to use [QMK](https://docs.qmk.fm) in the future, in order to overcome som * All symbols (including shifted symbols). * All modifier are dual keys positioned near the home row. 2. Querty - * Used to overcome the limitation pointed above, when your OS layout is set to Dvorak instead of US, this way you can use - Standard Dvorak (available by default on all the main operating systems) on other normal keybdoards and Hacker Dvorak on + * Used to overcome the limitation pointed above, when your OS layout is set to Dvorak instead of US, this way you can use + Standard Dvorak (available by default on all the main operating systems) on other normal keybdoards and Hacker Dvorak on the Ergodox EZ Shine at the same time, without changing back and forth tho OS layout. 3. Gaming * Still in development. @@ -35,7 +35,7 @@ I plan to use [QMK](https://docs.qmk.fm) in the future, in order to overcome som 6. Numpad * ATM style numpad. * All modifier keys. - * Letters from `A` to `F` for hexadecimal numbers (`B` is also used for binary numeric literals in most programming + * Letters from `A` to `F` for hexadecimal numbers (`B` is also used for binary numeric literals in most programming languages, ie. `0b11001`). * `X` for hexadecimal numeric literals in most programming languages, ie. `0xbeef`. * `O` for octal numeric literals in most programming languages, ie `0o123`. @@ -52,11 +52,11 @@ I plan to use [QMK](https://docs.qmk.fm) in the future, in order to overcome som * Useful for custom application shortcuts. 10. Meh Fn + * Useful for custom standard shortcuts. - + ## To Do Add images. *** -Please comment below if you have any ideas or suggestions. If you have used this layout or used it as a base, I'd love to hear about your experience! \ No newline at end of file +Please comment below if you have any ideas or suggestions. If you have used this layout or used it as a base, I'd love to hear about your experience! diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk index 4aa2f262b7..51a9ff0d49 100644 --- a/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/rules.mk @@ -1,35 +1,40 @@ # Set any rules.mk overrides for your specific keymap here. # See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file -NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work -TAP_DANCE_ENABLE = yes -MOUSEKEY_ENABLE = yes # Mouse keys(+4700b). -EXTRAKEY_ENABLE = yes # Audio control and System control(+450b). -SLEEP_LED_ENABLE = yes # Turn off leds when computer is sleeping. -KEY_LOCK_ENABLE = yes # (+1730b) -RGBLIGHT_ENABLE = yes -LEADER_ENABLE = yes +NKRO_ENABLE = yes # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work +TAP_DANCE_ENABLE = yes +MOUSEKEY_ENABLE = yes # Mouse keys(+4700b). +EXTRAKEY_ENABLE = yes # Audio control and System control(+450b). +RGBLIGHT_ENABLE = yes +LEADER_ENABLE = yes -UNICODE_ENABLE = no # For Unicode. +UNICODE_ENABLE = no COMMAND_ENABLE = no # Commands for debug and configuration SWAP_HANDS_ENABLE = no # Allow swapping hands of keyboard. # This are by default off: -# CONSOLE_ENABLE = no # Console for debug(+400) -# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +# COMBO_ENABLE = no +# UCIS_ENABLE = no # For Unicode. +# UNICODEMAP_ENABLE = no +# SLEEP_LED_ENABLE = no # Turn off leds when computer is sleeping. +# KEY_LOCK_ENABLE = no # (+1730b) +# CONSOLE_ENABLE = no # Console for debug(+400b) +# BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000b) # API_SYSEX_ENABLE = no # MIDI_ENABLE = no -# UNICODEMAP_ENABLE = no # BLUETOOTH_ENABLE = no # AUDIO_ENABLE = no # FAUXCLICKY_ENABLE = no # VARIABLE_TRACE = no # BACKLIGHT_ENABLE = no # RGB_MATRIX_ENABLE = no -# COMBO_ENABLE = no +# POINTING_DEVICE_ENABLE = no + +# AUTO_SHIFT_ENABLE = no +# AUTO_SHIFT_MODIFIERS = no -# This don't need argument: +# This don't need argument? # CUSTOM_MATRIX # Custom matrix file for the ErgoDox EZ # SPLIT_KEYBOARD diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c new file mode 100644 index 0000000000..6debc1ce45 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/mod_tap_layer_dances/none_lead.c @@ -0,0 +1,40 @@ +//instanalize an instance of 'tap' for the None - Lead tap dance. +static tap none_lead_state = { + .is_press_action = true, + .state = 0 +}; + +void none_lead_finished(qk_tap_dance_state_t *state, void *user_data) { + none_lead_state.state = current_dance(state); + switch (none_lead_state.state) { + case SINGLE_TAP: + register_code(KC_NO); + break; + + case SINGLE_HOLD: + register_code(KC_LALT); + register_code(KC_LSFT); + break; + + case DOUBLE_TAP: + qk_leader_start(); + break; + } +} + +void none_lead_reset(qk_tap_dance_state_t *state, void *user_data) { + switch (none_lead_state.state) { + case SINGLE_TAP: + unregister_code(KC_NO); + break; + + case SINGLE_HOLD: + unregister_code(KC_LALT); + unregister_code(KC_LSFT); + break; + + case DOUBLE_TAP: + break; + } + none_lead_state.state = 0; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c new file mode 100644 index 0000000000..550e1f7c84 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_actions.c @@ -0,0 +1,20 @@ +// Register the double tap dances: +qk_tap_dance_action_t tap_dance_actions[] = { + [EQL_PLUS] = ACTION_TAP_DANCE_DOUBLE(KC_EQL, KC_PLUS), + [MINS_UNDS] = ACTION_TAP_DANCE_DOUBLE(KC_MINS, KC_UNDS), + [SLSH_BSLS] = ACTION_TAP_DANCE_DOUBLE(KC_SLSH, KC_BSLS), + [GRV_TILD] = ACTION_TAP_DANCE_DOUBLE(KC_GRV, KC_TILD), + [QUOT_DQUO] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_DQUO), + [SCLN_COLN] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_COLN), + [ASTR_CIRC] = ACTION_TAP_DANCE_DOUBLE(KC_ASTR, KC_CIRC), + [APMR_PIPE] = ACTION_TAP_DANCE_DOUBLE(KC_AMPR, KC_PIPE), + [EXLM_QUES] = ACTION_TAP_DANCE_DOUBLE(KC_EXLM, KC_QUES), + [HASH_PERC] = ACTION_TAP_DANCE_DOUBLE(KC_HASH, KC_PERC), + [AT_DLR] = ACTION_TAP_DANCE_DOUBLE(KC_AT, KC_DLR), + [LPRN_LBRC] = ACTION_TAP_DANCE_DOUBLE(KC_LPRN, KC_LBRC), + [RPRN_RBRC] = ACTION_TAP_DANCE_DOUBLE(KC_RPRN, KC_RBRC), + [LCBR_LABK] = ACTION_TAP_DANCE_DOUBLE(KC_LCBR, KC_LABK), + [RCBR_RABK] = ACTION_TAP_DANCE_DOUBLE(KC_RCBR, KC_RABK), + [DOT_COMM] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_COMM), + [NONE_LEAD] = ACTION_TAP_DANCE_FN_ADVANCED_TIME(NULL, none_lead_finished, none_lead_reset, DANCING_TERM) +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c new file mode 100644 index 0000000000..340ccca133 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dance_setup.c @@ -0,0 +1,75 @@ +typedef struct { + bool is_press_action; + int state; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD = 2, + DOUBLE_TAP = 3, + DOUBLE_HOLD = 4, + DOUBLE_SINGLE_TAP = 5, // Send two single taps. + TRIPLE_TAP = 6, + TRIPLE_HOLD = 7, + TRIPLE_SINGLE_TAP = 8 // Send three single taps. +}; + +/* Return an integer that corresponds to what kind of tap dance should be executed. + * + * How to figure out tap dance state: interrupted and pressed. + * + * Interrupted: If the state of a dance dance is "interrupted", that means that another key has been hit + * under the tapping term. This is typically indicitive that you are trying to "tap" the key. + * + * Pressed: Whether or not the key is still being pressed. If this value is true, that means the tapping term + * has ended, but the key is still being pressed down. This generally means the key is being "held". + * + * One thing that is currenlty not possible with qmk software in regards to tap dance is to mimic the "permissive hold" + * feature. In general, advanced tap dances do not work well if they are used with commonly typed letters. + * For example "A". Tap dances are best used on non-letter keys that are not hit while typing letters. + * + * Good places to put an advanced tap dance: + * z,q,x,j,k,v,b, any function key, home/end, comma, semi-colon + * + * Criteria for "good placement" of a tap dance key: + * Not a key that is hit frequently in a sentence + * Not a key that is used frequently to double tap, for example 'tab' is often double tapped in a terminal, or + * in a web form. So 'tab' would be a poor choice for a tap dance. + * Letters used in common words as a double. For example 'p' in 'pepper'. If a tap dance function existed on the + * letter 'p', the word 'pepper' would be quite frustating to type. + * + * For the third point, there does exist the 'DOUBLE_SINGLE_TAP', however this is not fully tested + * + */ +int current_dance(qk_tap_dance_state_t *state) { + int current_state = 0; + if (state->count == 1) { + if (state->interrupted || !state->pressed) { + current_state = SINGLE_TAP; + } else { + current_state = SINGLE_HOLD; //key has not been interrupted, but they key is still held. Means you want to send a 'HOLD'. + } + } else if (state->count == 2) { + /* + * DOUBLE_SINGLE_TAP is to distinguish between typing "pepper", and actually wanting a double tap + * action when hitting 'pp'. Suggested use case for this return value is when you want to send two + * keystrokes of the key, and not the 'double tap' action/macro. + */ + if (state->interrupted) { + current_state = DOUBLE_SINGLE_TAP; + } else if (state->pressed) { + current_state = DOUBLE_HOLD; + } else { + current_state = DOUBLE_TAP; + } + } else if (state->count == 3) { + if (state->interrupted) { + current_state = TRIPLE_SINGLE_TAP; + } else if (state->pressed) { + current_state = TRIPLE_HOLD; + } else { + current_state = TRIPLE_TAP; + } + } + return current_state; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c new file mode 100644 index 0000000000..3d44698729 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/tap_dance/tap_dances.c @@ -0,0 +1,74 @@ + //--------------------------------------------------------------------------------------------// + // | | | | | // + // Single tap | Single hold | Double tap | Double hold | Triple tap | Triple hold // +// Mod tap dances: // | | | | | // +enum tap_dances { //--------------------------------------------------------------------------------------------// + // | | | | | // + EQL_PLUS = 0, // = | + | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + MINS_UNDS = 1, // - | _ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + SLSH_BSLS = 2, // / | \ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + GRV_TILD = 3, // ` | ~ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + QUOT_DQUO = 4, // ' | " | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + SCLN_COLN = 5, // ; | : | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + ASTR_CIRC = 6, // * | ^ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + APMR_PIPE = 7, // & | | | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + EXLM_QUES = 8, // ! | ? | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + HASH_PERC = 9, // # | % | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + AT_DLR = 10, // @ | $ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + LPRN_LBRC = 11, // ( | [ | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + RPRN_RBRC = 12, // ) | ] | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + LCBR_LABK = 13, // { | < | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + RCBR_RABK = 14, // } | > | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + DOT_COMM = 15, // . | , | | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// + // | | | | | // + NONE_LEAD = 16, // NONE | ALT+SHIFT | LEAD | | | // + // | | | | | // + //--------------------------------------------------------------------------------------------// +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c new file mode 100644 index 0000000000..41b7b66941 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/eeconfig_init_user.c @@ -0,0 +1,3 @@ +// void eeconfig_init_user(void) { +// +// }; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c new file mode 100644 index 0000000000..e2eeed6fa9 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/layer_set_state_user.c @@ -0,0 +1,121 @@ + +uint32_t layer_state_set_user(uint32_t state) { + uint8_t layer = biton32(state); + + switch (layer) { + case DVORAK: + rgblight_sethsv_noeeprom_green(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case PLOVER: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); + + if (!(PLOVER_MODE)) { + plover_toggle(); + PLOVER_MODE = true; + } + + break; + + case GAMING: + rgblight_sethsv_noeeprom_red(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case ARROWS: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case MOUSE: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case NUMPAD: + rgblight_sethsv_noeeprom_blue(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case LAYERS: + rgblight_sethsv_noeeprom_cyan(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case MEDIA_FN: + rgblight_sethsv_noeeprom_yellow(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case HYPER: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + case FIRMWARE: + rgblight_sethsv_noeeprom_magenta(); + rgblight_mode_noeeprom(RGBLIGHT_MODE_KNIGHT + 2); + + if (PLOVER_MODE) { + plover_toggle(); + PLOVER_MODE = false; + } + + break; + + default: + break; + } + + return state; +} diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c new file mode 100644 index 0000000000..3b78079cca --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/matrix_scan_user.c @@ -0,0 +1,12 @@ +#include "../leader/leader_setup.c" + +bool MATRIX_SCANNED = false; + +void matrix_scan_user(void) { + if (!(MATRIX_SCANNED)) { + rgblight_sethsv_noeeprom_green(); + MATRIX_SCANNED = true; + } + + #include "../leader/leader_dictionary.c" +}; diff --git a/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c new file mode 100644 index 0000000000..7644635824 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/hacker_dvorak/user/process_record_user.c @@ -0,0 +1,75 @@ +// TODO: Improve this currently there is no feedback if activated by other means. +bool CAPS_LOCK = false; +bool NUM_LOCK = false; +bool SCROLL_LOCK = false; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + + switch (keycode) { + case KC_CLCK: + if (record->event.pressed) { + if (!(CAPS_LOCK)) { + ergodox_right_led_1_on(); + CAPS_LOCK = true; + } else { + ergodox_right_led_1_off(); + CAPS_LOCK = false; + } + } + + return true; + + case KC_NLCK: + if (record->event.pressed) { + if (!(NUM_LOCK)) { + ergodox_right_led_2_on(); + NUM_LOCK = true; + } else { + ergodox_right_led_2_off(); + NUM_LOCK = false; + } + } + + return true; + + case KC_SLCK: + if (record->event.pressed) { + if (!(SCROLL_LOCK)) { + ergodox_right_led_3_on(); + SCROLL_LOCK = true; + } else { + ergodox_right_led_3_off(); + SCROLL_LOCK = false; + } + } + + return true; + + case KC_MS_WH_UP ... KC_MS_WH_RIGHT: + if (record->event.pressed) { + if (SCROLL_LOCK) { + return false; + } else { + return true; + } + } + + case MY_CUSTOM_MACRO: + if (record->event.pressed) { + SEND_STRING("QMK is the best thing ever!"); // this is our macro! + return false; + } + + case MY_OTHER_MACRO: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("ac")); // selects all and copies + return false; + } + + default: + return true; + } +} -- cgit v1.2.3 From f3cbb7bd6e307186e5802fa0366a21a5f9f5e41c Mon Sep 17 00:00:00 2001 From: Skyler Lewis Date: Wed, 19 Dec 2018 17:54:19 -0700 Subject: update the alairock keymap for dichotomy (#4687) Just a couple placement updates to my layout on the dichotomy keyboard. --- keyboards/dichotomy/keymaps/alairock/keymap.c | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/keyboards/dichotomy/keymaps/alairock/keymap.c b/keyboards/dichotomy/keymaps/alairock/keymap.c index f39a226b71..a1d196fb06 100644 --- a/keyboards/dichotomy/keymaps/alairock/keymap.c +++ b/keyboards/dichotomy/keymaps/alairock/keymap.c @@ -43,34 +43,34 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT( /* Shifted layout, small changes (because angle brackets have been moved to thumb cluster buttons) */ _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, - _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, - _______, _______, _______, _______, _______, KC_MRWD, _______, _______, _______, KC_BSLS, KC_QUOT, _______, + _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, KC_GRV, _______, _______, KC_MRWD, _______, _______, _______, KC_BSLS, KC_QUOT, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LABK, _______, _______, KC_RABK, _______, _______ ), [_LOWER] = LAYOUT( /* Number layout, basically the main function layer */ - _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, - _______, KC_TILD, KC_GRV, KC_F13, KC_F14, KC_F15, KC_F16, KC_F7, KC_F8, KC_F9, KC_F10, _______, - _______, _______, _______, _______, _______, _______, - _______, RAISE, _______, _______, _______, _______, _______, _______ + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, KC_VOLD, KC_VOLU, KC_MPLY, KC_MFFD, KC_MUTE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, KC_TILD, _______, _______, KC_MRWD, _______, _______, _______, KC_PIPE, KC_DQT, _______, + _______, _______, _______, _______, _______, _______, + _______, RAISE, _______, _______, _______, _______, _______, _______ ), [_ADJUST] = LAYOUT( /* Shifted number/function layout, for per-key control. Only active when shift is held, and number is toggled or held */ - _______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______ + KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_UP, _______, _______, _______, + KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, + KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ ), [_MOUSE] = LAYOUT( /* Mouse layer, including buttons for clicking. */ _______, _______, _______, _______, _______, _______, KC_VOLU, KC_HOME, KC_PGUP, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, MS_BTN1, MS_BTN2, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_END, KC_PGDN, _______, _______, _______, - _______, _______, _______, _______, KC_UP, _______, - _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ + _______, _______, _______, _______, KC_UP, _______, + _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______ ) }; // end keymaps block -- cgit v1.2.3 From 374ed67e87f8cba4e239696eecbb7477ce0286f1 Mon Sep 17 00:00:00 2001 From: Kevin Hogeland Date: Thu, 20 Dec 2018 01:43:17 -0800 Subject: Add PROGMEM keyword to Clueboard keymaps --- keyboards/clueboard/60/keymaps/default/keymap.c | 4 ++-- keyboards/clueboard/60/keymaps/default_aek/keymap.c | 4 ++-- keyboards/clueboard/60/keymaps/yanfali/keymap.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keyboards/clueboard/60/keymaps/default/keymap.c b/keyboards/clueboard/60/keymaps/default/keymap.c index 8397c4bbfb..3e906737b6 100644 --- a/keyboards/clueboard/60/keymaps/default/keymap.c +++ b/keyboards/clueboard/60/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "60.h" +#include QMK_KEYBOARD_H #define _______ KC_TRNS @@ -32,7 +32,7 @@ enum custom_keycodes { float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); #endif -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| diff --git a/keyboards/clueboard/60/keymaps/default_aek/keymap.c b/keyboards/clueboard/60/keymaps/default_aek/keymap.c index 63b1d8ba2e..ea5333e3c9 100644 --- a/keyboards/clueboard/60/keymaps/default_aek/keymap.c +++ b/keyboards/clueboard/60/keymaps/default_aek/keymap.c @@ -1,4 +1,4 @@ -#include "60.h" +#include QMK_KEYBOARD_H #define _______ KC_TRNS @@ -8,7 +8,7 @@ enum keyboard_layers { _CL }; -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| BkSp| diff --git a/keyboards/clueboard/60/keymaps/yanfali/keymap.c b/keyboards/clueboard/60/keymaps/yanfali/keymap.c index eec17720a5..b810bdcf8e 100644 --- a/keyboards/clueboard/60/keymaps/yanfali/keymap.c +++ b/keyboards/clueboard/60/keymaps/yanfali/keymap.c @@ -1,4 +1,4 @@ -#include "60.h" +#include QMK_KEYBOARD_H #define _______ KC_TRNS @@ -33,7 +33,7 @@ enum custom_keycodes { float song_zelda_puzzle[][2] = SONG(ZELDA_PUZZLE); #endif -const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------------. * |Esc | 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| -- cgit v1.2.3 From af55ef84182efbc148698d3528d48f2bf0fb730f Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Sun, 16 Dec 2018 00:11:08 -0800 Subject: GSKT-00 Configurator update - add JSON data for LAYOUT_all layout - fix ISO Enter on LAYOUT_60_iso_tsangan layout --- keyboards/gskt00/info.json | 94 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 81 insertions(+), 13 deletions(-) diff --git a/keyboards/gskt00/info.json b/keyboards/gskt00/info.json index 88191240b9..bfbb1fd7cd 100644 --- a/keyboards/gskt00/info.json +++ b/keyboards/gskt00/info.json @@ -1,16 +1,84 @@ { - "keyboard_name": "gskt00", - "url": "", - "maintainer": "nachie", - "width": 15, - "height": 5, - "layouts": { - "LAYOUT_60_ansi_tsangan": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] - }, - - "LAYOUT_60_iso_tsangan": { - "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":2, "w":1.25}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] - } + "keyboard_name": "gskt00", + "url": "", + "maintainer": "nachie", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_tsangan": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + + "LAYOUT_60_iso_tsangan": { + "layout": [{"label":"\u00ac", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"\"", "x":2, "y":0}, {"label":"\u00a3", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"@", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"|", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":2.75}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"AltGr", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, + + "LAYOUT_all": { + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"\\", "x":13, "y":0}, + {"label":"`", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":1.25}, + {"label":"ISO \\", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":7}, + {"label":"Alt", "x":11, "y":4, "w":1.5}, + {"label":"GUI", "x":12.5, "y":4}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5} + ] } } +} -- cgit v1.2.3 From 29830f306f682f731d64950eba43953d95503967 Mon Sep 17 00:00:00 2001 From: MakotoKurauchi Date: Fri, 21 Dec 2018 01:55:03 +0900 Subject: Keyboard: Pr/helixpico add layout kc (#4686) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add some comment about Helix customize and auto-setup RGBLIGHT_LIMIT_VAL * add define USB_MAX_POWER_CONSUMPTION * Helix keyboard OLED, RGBLIGHT enable/disable control integrate into rules.mk rules.mk: add 4 Variables for compile control. # Helix keyboard customize # you can edit follows 4 Variables # jp: 以下の4つの変数を必要に応じて編集します。 OLED_ENABLE = no # OLED_ENABLE LED_BACK_ENABLE = no # LED backlight (Enable WS2812 RGB underlight.) LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight.) LED_ANIMATIONS = yes # LED animations config.h: auto set RGBLED_NUM by HELIX_ROWS and rules.mk's define * HELIX_ROWS define move from config.h to rules.mk * add readme.md * rename readme.md to readme_jp.md * add readme.md and modify readme_jp.md * change helix/ssd1306.c for select glcdfont.c position * add variable LOCAL_GLCDFONT into each keymaps rules.mk * Add iPhone/iPad LED support to Helix default keymap * renumber _ADJUST for shrink program size * Fix Helix i2c wrong bit rate * add helix serial debug code * serial debug macro move from config.h to serial.h * helix serial.c debugging... * refine debug macros * add some comments * add SELECT_SERIAL_SPEED * add comments * debugging sync_send/sync_recv * add very high speed * fix sync_send/sync_recv * fix com. start and switch send/recv * debug mode off * remove debug codes * temporary change, compiling C, C++ and ASM without -g * helix config.h refine * Revert "temporary change, compiling C, C++ and ASM without -g" This reverts commit e9730cbbfd94fbcf792d992e3a1a65ad279b24d6. * add change_reciver2sender()/change_sender2reciver() This is a change to improve readability. * txled, rxled off in matrix_init() * add serial_send_packet() / serial_recive_packet() This is a change to reduce object size. * add serial_low() at ISR() top * add __attribute__((always_inline)) to some functions * modify serial_send_packet()/serial_recive_packet() A little, object size reduction. A little, speedup. * add debug code to helix/serial.c * Adjust sampling timing of serial signal being received * add split_scomm.c/split_scomm.h and change serial.c/serial.h serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. * add split_scomm.c/split_scomm.h into helix/rev1 * reduce object size helix/rev2/matrix.c * remove checksum check, add parity check * force occur parity error for test * parity test ok. remove test code * change some comment & add skip code when buffer_size == 0 * serial.c: multiple types of transaction support Add 4 bits transaction-type field at packet top. Select Transaction Descriptor Table entry by transaction-type. * helix serial master-slave transaction optimize Using multi-type transaction feature of serial.c, communication contents between master slaves were optimized. * add debug code for retry * add comment into each config.h * fix ISR status drop * add a debug macro 'debug_retry_chg()' * reduce led_test size * remove debug code from helix/serial.c and etc. * helix:five_rows change TAPPING_TERM value 140 * Improved compatibility with let's split of serial.c. Finish helix/serial.c improvement. - The difference with the original let's split's serial.c - It's high-speed about 4 times. - Stable bi-directional data transfer. (Helix need master to slave transfer) - serial.h was divided 2 files, serial_config.h and sereial.h - With multiple types of transaction support, communication contents can be optimized. (NEW flexible API) - USE OLD Simple APIs (compatible with let's split serial.c) - files : - serial_config.h -- hardware configuration (need include by config.h) - serial.c/serial.h -- serial communication - USE NEW flexible APIs. (Support multi-type transaction function.) serial.c was divided into 2 layers, split_scom.c and serial.c. The upper layer split_scomm.c is called from matrix.c. The lower layer serial.c accesses the hardware. - files - split_scomm.c -- communication buffer is defined in here. call by matrix.c. - split_scomm.h -- buffer size is defined in here. include by matrix.c, split_util.c - serial_config.h -- hardware configuration (need include by config.h) To use the NEW API, specify #define SERIAL_USE_MULTI_TRANSACTION - serial.c/serial.h -- serial communication lower layer - NEW APIs for serial.c / serial.h (The lower layer) // Soft Serial Transaction Descriptor typedef struct _SSTD_t { uint8_t *status; uint8_t initiator2target_buffer_size; uint8_t *initiator2target_buffer; uint8_t target2initiator_buffer_size; uint8_t *target2initiator_buffer; } SSTD_t; // initiator is transaction start side void soft_serial_initiator_init(SSTD_t *sstd_table); // target is interrupt accept side void soft_serial_target_init(SSTD_t *sstd_table); int soft_serial_transaction(int sstd_index); int soft_serial_get_and_clean_target_status(int sstd_index); - NEW APIs for split_scomm.c / split_scomm.h (The upper layer) move from old serial.c the following buffer and functions serial_slave_buffer[] serial_master_buffer[] void serial_master_init(void) void serial_slave_init(void) int serial_update_buffers(void) define SERIAL_xxxxx_BUFFER_LENGTH move from serial_config.h to split_scomm.h * fix comment typo * Fix the value of helix:five_rows variable HELIX_ROWS to 5. * led_test rules.mk some change * Separate common parts of helix/rev2/keymaps/*/rules.mk into helix/rev2/keymaps_common.mk * helix/rev2/keymaps/edvorakjp/rules.mk use helix/rev2/keymaps_common.mk * Separate common parts of helix/pico/keymaps/*/rules.mk into helix/pico/keymaps_common.mk * Helix each keymap's using rgblight mode symbol instead magic number No change in build result. * Helix pico keymaps: make rgblight modes selectable. No change in build result. * Helix rev2 keymaps: make rgblight modes selectable. No change in build result. * fixed Helix froggy/keymap.c: invalid rgblight mode value 0 to 1 (=RGBLIGHT_MODE_STATIC_LIGHT) * Deselect RGB_TEST and ALTERNATING in Helix rev2,pico keymaps config.h. * Merge branch 'master' of https://github.com/qmk/qmk_firmware * revert 955dcbc * delete keymaps_common.mk * add LAYOUT_kc() to keyboards/helix/pico/pico.h --- keyboards/helix/pico/pico.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/keyboards/helix/pico/pico.h b/keyboards/helix/pico/pico.h index a3d658daa0..153132775b 100644 --- a/keyboards/helix/pico/pico.h +++ b/keyboards/helix/pico/pico.h @@ -62,4 +62,18 @@ } #endif +#define LAYOUT_kc( \ + L00, L01, L02, L03, L04, L05, R00, R01, R02, R03, R04, R05, \ + L10, L11, L12, L13, L14, L15, R10, R11, R12, R13, R14, R15, \ + L20, L21, L22, L23, L24, L25, R20, R21, R22, R23, R24, R25, \ + L30, L31, L32, L33, L34, L35, L36, R36, R30, R31, R32, R33, R34, R35 \ + ) \ + LAYOUT( \ + KC_##L00, KC_##L01, KC_##L02, KC_##L03, KC_##L04, KC_##L05, KC_##R00, KC_##R01, KC_##R02, KC_##R03, KC_##R04, KC_##R05, \ + KC_##L10, KC_##L11, KC_##L12, KC_##L13, KC_##L14, KC_##L15, KC_##R10, KC_##R11, KC_##R12, KC_##R13, KC_##R14, KC_##R15, \ + KC_##L20, KC_##L21, KC_##L22, KC_##L23, KC_##L24, KC_##L25, KC_##R20, KC_##R21, KC_##R22, KC_##R23, KC_##R24, KC_##R25, \ + KC_##L30, KC_##L31, KC_##L32, KC_##L33, KC_##L34, KC_##L35, KC_##L36, KC_##R36, KC_##R30, KC_##R31, KC_##R32, KC_##R33, KC_##R34, KC_##R35 \ + ) + + #endif -- cgit v1.2.3 From 1586548b4f45f76d9cd05be4ee9588b3d4b3860e Mon Sep 17 00:00:00 2001 From: Emily Soldal Date: Wed, 19 Dec 2018 14:46:18 +0100 Subject: Enable RGB animations in Atom47 --- keyboards/atom47/rev3/config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/atom47/rev3/config.h b/keyboards/atom47/rev3/config.h index 8a91e29903..b94dc9773b 100644 --- a/keyboards/atom47/rev3/config.h +++ b/keyboards/atom47/rev3/config.h @@ -61,7 +61,7 @@ along with this program. If not, see . #define RGB_DI_PIN F5 // The pin the LED strip is connected to #define RGBLED_NUM 6 // Number of LEDs in your strip - +#define RGBLIGHT_ANIMATIONS #define QMK_ESC_OUTPUT B7 // usually COL #define QMK_ESC_INPUT B3 // usually ROW #define QMK_LED E6 -- cgit v1.2.3 From 639585314863912480c9967fc38bb2d9418a34ab Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 20 Dec 2018 08:58:12 -0800 Subject: Docs: Add additional clarification to Leader Key documention (#4660) * Add clarification for Leader Timeout * Add additional documentatin to config_options.md * Add leader_start() and leader_end() documentation * Add Examples * Clarify timout * Remove customization * Improve docs based on feedback * Better clarification of features * Fix example * Spelling/grammar issue * Spelling and clarification --- docs/config_options.md | 1 + docs/feature_leader_key.md | 82 ++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 76 insertions(+), 7 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index fb1655e9a3..879761a402 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -143,6 +143,7 @@ If you define these options you will enable the associated feature, which may in * Breaks any Tap Toggle functionality (`TT` or the One Shot Tap Toggle) * `#define LEADER_TIMEOUT 300` * how long before the leader key times out + * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. * `#define LEADER_PER_KEY_TIMING` * sets the timer for leader key chords to run on each key press rather than overall * `#define ONESHOT_TIMEOUT 300` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 9b49e0fd96..168a1fc1c8 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -5,10 +5,11 @@ If you've ever used Vim, you know what a Leader key is. If not, you're about to That's what `KC_LEAD` does. Here's an example: 1. Pick a key on your keyboard you want to use as the Leader key. Assign it the keycode `KC_LEAD`. This key would be dedicated just for this -- it's a single action key, can't be used for anything else. -2. Include the line `#define LEADER_TIMEOUT 300` in your config.h. The 300 there is 300ms -- that's how long you have for the sequence of keys following the leader. You can tweak this value for comfort, of course. -3. Within your `matrix_scan_user` function, do something like this: +2. Include the line `#define LEADER_TIMEOUT 300` in your `config.h`. This sets the timeout for the `KC_LEAD` key. Specifically, when you press the `KC_LEAD` key, you only have a certain amount of time to complete the Leader Key sequence. The `300` here sets that to 300ms, and you can increase this value to give you more time to hit the sequence. But any keys pressed during this timeout are intercepted and not sent, so you may want to keep this value low. . + * By default, this timeout is how long after pressing `KC_LEAD` to complete your entire sequence. This may be very low for some people. So you may want to increase this timeout. Optionally, you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. This allows you to maintain a low value here, but still be able to use the longer sequences. To enable this option, add `#define LEADER_PER_KEY_TIMING` to your `config.h`. +3. Within your `matrix_scan_user` function, add something like this: -``` +```c LEADER_EXTERNS(); void matrix_scan_user(void) { @@ -44,7 +45,7 @@ Each of these accepts one or more keycodes as arguments. This is an important po To add support for Leader Key you simply need to add a single line to your keymap's `rules.mk`: -``` +```make LEADER_ENABLE = yes ``` @@ -53,20 +54,87 @@ LEADER_ENABLE = yes Rather than relying on an incredibly high timeout for long leader key strings or those of us without 200wpm typing skills, we can enable per key timing to ensure that each key pressed provides us with more time to finish our stroke. This is incredibly helpful with leader key emulation of tap dance (read: multiple taps of the same key like C, C, C). In order to enable this, place this in your `config.h`: -``` +```c #define LEADER_PER_KEY_TIMING ``` After this, it's recommended that you lower your `LEADER_TIMEOUT` to something less that 300ms. -``` +```c #define LEADER_TIMEOUT 250 ``` Now, something like this won't seem impossible to do without a 1000MS leader key timeout: -``` +```c SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { SEND_STRING("Per key timing is great!!!"); } ``` + +## Customization + +The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. + +The `leader_start()` function is called when you tap the `KC_LEAD` key, and the `leader_end()` function is called when either the leader sequence is completed, or the leader timeout is hit. + +You can add these functions to your code (`keymap.c` usually) to add feedback to the Leader sequences (such as beeping or playing music). + +```c +void leader_start(void) { + // sequence started +} + +void leader_end(void) { + // sequence ended (no success/failuer detection) +} +``` + +### Example + +This example will play the Mario "One Up" sound when you hit `KC_LEAD` to start the Leader Sequence, and will play "All Star" if it completes successfully or "Rick Roll" you if it fails. + +```c +bool did_leader_succeed; +#ifdef AUDIO_ENABLE +float leader_start[][2] = SONG(ONE_UP_SOUND ); +float leader_succeed[][2] = SONG(ALL_STAR); +float leader_fail[][2] = SONG(RICK_ROLL); +#endif +LEADER_EXTERNS(); + +void matrix_scan_user(void) { + LEADER_DICTIONARY() { + did_leader_succeed = leading = false; + + SEQ_ONE_KEY(KC_E) { + // Anything you can do in a macro. + SEND_STRING(SS_LCTRL(SS_LSFT("t"))); + did_leader_succeed = true; + } else + SEQ_TWO_KEYS(KC_E, KC_D) { + SEND_STRING(SS_LGUI("r")"cmd"SS_TAP(KC_ENTER)SS_LCTRL("c")); + did_leader_succeed = true; + } + leader_end(); + } +} + +void leader_start(void) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_start); +#endif +} + +void leader_end(void) { + if (did_leader_succeed) { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_succeed); +#endif + } else { +#ifdef AUDIO_ENABLE + PLAY_SONG(leader_fail); +#endif + } +} +``` -- cgit v1.2.3 From 30c3f3b2bd9c68ba8bba644fcfa97152a4834c03 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Fri, 21 Dec 2018 02:50:51 +0900 Subject: Keymap: Add Helix/pico keymap 'mtei' (#4696) * add pico keymap 'mtei' * num layer key change --- keyboards/helix/pico/keymaps/mtei/config.h | 52 +++ keyboards/helix/pico/keymaps/mtei/keymap.c | 496 +++++++++++++++++++++++++++++ keyboards/helix/pico/keymaps/mtei/rules.mk | 129 ++++++++ 3 files changed, 677 insertions(+) create mode 100644 keyboards/helix/pico/keymaps/mtei/config.h create mode 100644 keyboards/helix/pico/keymaps/mtei/keymap.c create mode 100644 keyboards/helix/pico/keymaps/mtei/rules.mk diff --git a/keyboards/helix/pico/keymaps/mtei/config.h b/keyboards/helix/pico/keymaps/mtei/config.h new file mode 100644 index 0000000000..c5812de8d7 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/config.h @@ -0,0 +1,52 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +// place overrides here + +#ifdef AUDIO_ENABLE + #define STARTUP_SONG SONG(STARTUP_SOUND) + #define AUDIO_CLICKY +#endif + +#undef TAPPING_TERM +#define TAPPING_TERM 300 +#define PERMISSIVE_HOLD +/* when TAPPING_TERM >= 500 same effect PERMISSIVE_HOLD. + see tmk_core/common/action_tapping.c */ + +// If you need more program area, try select and reduce rgblight modes to use. + +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + //#define RGBLIGHT_EFFECT_SNAKE + //#define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif + +#endif /* CONFIG_USER_H */ diff --git a/keyboards/helix/pico/keymaps/mtei/keymap.c b/keyboards/helix/pico/keymaps/mtei/keymap.c new file mode 100644 index 0000000000..27bf062433 --- /dev/null +++ b/keyboards/helix/pico/keymaps/mtei/keymap.c @@ -0,0 +1,496 @@ +#include QMK_KEYBOARD_H +#include "bootloader.h" +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#include "split_util.h" +#endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif +#ifdef CONSOLE_ENABLE + #include +#endif + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _EUCALYN, + _NUML, + _NUMR, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + EUCALYN, + NUML, + NUMR, + KC_xEISU, + KC_xKANA, + KC_ZERO2, + RGBRST +}; + +//Macros +#define KC_LOWER MO(_LOWER) +#define KC_NUML LT(_NUML,KC_SPC) +#define KC_NUMR LT(_NUMR,KC_SPC) +#define KC_RABS LT(_RAISE,KC_BSPC) +#define KC_RAEN LT(_RAISE,KC_ENT) +#define KC_____ _______ +#define KC_XXXX XXXXXXX +#define KC_ADJ MO(_ADJUST) +#define KC_LSMI LSFT(KC_MINS) +#define KC_LSEQ LSFT(KC_EQL) +#define KC_LSRB LSFT(KC_RBRC) +#define KC_LSLB LSFT(KC_LBRC) +#define KC_LSGR LSFT(KC_GRV) +#define KC_LSQT LSFT(KC_QUOT) +#define ___ _______ +#define KC_S0 LSFT(KC_0) +#define KC_S1 LSFT(KC_1) +#define KC_S2 LSFT(KC_2) +#define KC_S3 LSFT(KC_3) +#define KC_S4 LSFT(KC_4) +#define KC_S5 LSFT(KC_5) +#define KC_S6 LSFT(KC_6) +#define KC_S7 LSFT(KC_7) +#define KC_S8 LSFT(KC_8) +#define KC_S9 LSFT(KC_9) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | E | R | T | | Y | U | I | O | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_QWERTY] = LAYOUT_kc( \ + ESC, Q, W, E, R, T, Y, U, I, O, P, BSLS, \ + LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \ + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | F | P | G | | J | L | U | Y | ; | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_COLEMAK] = LAYOUT_kc( \ + ESC, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \ + LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \ + LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | ' | , | . | P | Y | | F | G | C | R | L | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_DVORAK] = LAYOUT_kc( \ + ESC, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \ + LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \ + LSFT, SCLN, Q, J, K, X, B, M, W, V, Z, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout) + * ,-----------------------------------------. ,-----------------------------------------. + * | ESC | Q | W | , | . | ; | | M | R | D | Y | P | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | I | U | | G | T | K | S | N | Ctrl | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | F | | B | H | J | L | / | Shift| + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower | + * `-------------------------------------------------------------------------------------------------' + */ + [_EUCALYN] = LAYOUT_kc( \ + ESC, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \ + LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \ + LSFT, Z, X, C, V, F, B, H, J, L, SLSH, RSFT, \ + LOWER,LOWER, CAPS, LALT, LGUI,NUML, RABS, RAEN,NUMR, RGUI, RALT, APP,LOWER, LOWER \ + ), + + /* Num + * ,-----------------------------------------. ,-----------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | F12 | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | F7 | F8 | F9 | F10 | F11 | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_NUML] = LAYOUT_kc( \ + ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ + ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ + ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ + ____, ____, ____, ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____ \ + ), + + [_NUMR] = LAYOUT_kc( \ + ____, S1, S2, S3, S4, S5, S6, S7, S8, S9, S0, ____, \ + ____, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, F12, \ + ____, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \ + ____, ____, ____, ____, ____, SPC, ____, ____, ____, ____, ____, ____, ____, ____ \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | | |Pause | ScrLk| Ins | | | | Ins | ScrLk|Pause | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PgUp | | Up |Delete| Home | | Home |Delete| Up | | PgUp | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | PgDn | Left | Down | Right| End | | End | Left | Down | Right| PgDn | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | PrtSc| | | |Adjust|Adjust| | | | PrtSc| | | + * `-------------------------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_kc( \ + XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, ____, \ + ____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \ + ____, END, LEFT, DOWN, RGHT, PGDN, PGDN, LEFT, DOWN, RGHT, END, ____, \ + ____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | TAB | | | | _ | - | | = | + | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | EISU | | | | { | [ | | ] | } | | | | KANA | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | ~ | ` | | ' | " | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_kc( \ + TAB, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \ + xEISU, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, xKANA, \ + XXXX, XXXX, XXXX, XXXX, LSGR, GRV, QUOT, LSQT, XXXX, XXXX, XXXX, XXXX, \ + ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST|RGB ON|Aud on| Win | | Win | |Qwerty|Euclyn|Colemk|Dvorak| + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | HUE+ | SAT+ | VAL+ |RGB md|Audoff| Mac | | Mac | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | HUE- | SAT- | VAL- | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | | | + * `-------------------------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT( \ + XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, XXXXXXX, QWERTY, EUCALYN, COLEMAK, DVORAK, \ + RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \ + ) +}; + +#ifdef AUDIO_ENABLE + +float tone_qwerty[][2] = SONG(QWERTY_SOUND); +float tone_dvorak[][2] = SONG(DVORAK_SOUND); +float tone_colemak[][2] = SONG(COLEMAK_SOUND); +float tone_plover[][2] = SONG(PLOVER_SOUND); +float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND); +float music_scale[][2] = SONG(MUSIC_SCALE_SOUND); +#endif + +static int current_default_layer; + +uint32_t default_layer_state_set_kb(uint32_t state) { + // 1<<_QWERTY - 1 == 1 - 1 == _QWERTY (=0) + // 1<<_COLEMAK - 1 == 2 - 1 == _COLEMAK (=1) + current_default_layer = state - 1; + // 1<<_DVORAK - 2 == 4 - 2 == _DVORAK (=2) + if ( current_default_layer == 3 ) current_default_layer -= 1; + // 1<<_EUCALYN - 5 == 8 - 5 == _EUCALYN (=3) + if ( current_default_layer == 7 ) current_default_layer -= 4; + return state; +} + +void update_base_layer(int base) +{ + if( current_default_layer != base ) { + eeconfig_update_default_layer(1UL<event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_qwerty); + #endif + update_base_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_colemak); + #endif + update_base_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + update_base_layer(_DVORAK); + } + return false; + break; + case EUCALYN: + if (record->event.pressed) { + #ifdef AUDIO_ENABLE + PLAY_SONG(tone_dvorak); + #endif + update_base_layer(_EUCALYN); + } + return false; + break; + case KC_xEISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KC_xKANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + return true; +} + +void matrix_init_user(void) { + #ifdef AUDIO_ENABLE + startup_user(); + #endif + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif +} + + +#ifdef AUDIO_ENABLE + +void startup_user() +{ + _delay_ms(50); // gets rid of tick +} + +void shutdown_user() +{ + _delay_ms(150); + stop_all_notes(); +} + +void music_on_user(void) +{ + music_scale_user(); +} + +void music_scale_user(void) +{ + PLAY_SONG(music_scale); +} + +#endif + + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +void matrix_scan_user(void) { + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, + const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +static void render_logo(struct CharacterMatrix *matrix) { + + static char logo[]={ + 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, + 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, + 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, + 0}; + matrix_write(matrix, logo); +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_ANIMATIONS) + char buf[30]; + if(rgblight_config.enable) { + snprintf(buf, sizeof(buf), " LED %2d: %d,%d,%d ", + rgblight_config.mode, + rgblight_config.hue/RGBLIGHT_HUE_STEP, + rgblight_config.sat/RGBLIGHT_SAT_STEP, + rgblight_config.val/RGBLIGHT_VAL_STEP); + matrix_write(matrix, buf); + } +#endif + //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); +} + +static const char Qwerty_name[] PROGMEM = " Qwerty"; +static const char Colemak_name[] PROGMEM = " Colemak"; +static const char Dvorak_name[] PROGMEM = " Dvorak"; +static const char Eucalyn_name[] PROGMEM = " Eucalyn"; + +static const char NumL_name[] PROGMEM = ":NumL"; +static const char NumR_name[] PROGMEM = ":NumR"; +static const char Lower_name[] PROGMEM = ":Func"; +static const char Raise_name[] PROGMEM = ":Extra"; +static const char Adjust_name[] PROGMEM = ":Adjust"; + +static const char *layer_names[] = { + [_QWERTY] = Qwerty_name, + [_COLEMAK] = Colemak_name, + [_DVORAK] = Dvorak_name, + [_EUCALYN] = Eucalyn_name, + + [_NUML] = NumL_name, + [_NUMR] = NumR_name, + [_LOWER] = Lower_name, + [_RAISE] = Raise_name, + [_ADJUST] = Adjust_name +}; + +void render_status(struct CharacterMatrix *matrix) { + + // Render to mode icon + static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; + if(keymap_config.swap_lalt_lgui==false){ + matrix_write(matrix, logo[0][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[0][1]); + }else{ + matrix_write(matrix, logo[1][0]); + matrix_write_P(matrix, PSTR("\n")); + matrix_write(matrix, logo[1][1]); + } + + // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below + int name_num; + uint32_t lstate; + matrix_write_P(matrix, layer_names[current_default_layer]); + matrix_write_P(matrix, PSTR("\n")); + for( lstate = layer_state, name_num = 0; + lstate && name_num < sizeof(layer_names)/sizeof(char *); + lstate >>=1, name_num++ ) { + if( (lstate & 1) != 0 ) { + if( layer_names[name_num] ) { + matrix_write_P(matrix, layer_names[name_num]); + } + } + } + + // Host Keyboard LED Status + char led[40]; + snprintf(led, sizeof(led), "\n%s %s %s", + (host_keyboard_leds() & (1< helix:defualt +## option= oled | back | under | na | ios +## ex. +## make HELIX=oled helix:defualt +## make HELIX=oled,back helix:defualt +## make HELIX=oled,under helix:defualt +## make HELIX=oled,back,na helix:defualt +## make HELIX=oled,back,ios helix:defualt +## +ifneq ($(strip $(HELIX)),) + ifeq ($(findstring oled,$(HELIX)), oled) + OLED_ENABLE = yes + endif + ifeq ($(findstring back,$(HELIX)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(HELIX)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(HELIX)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(HELIX)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(info ) +endif + +# Uncomment these for checking +# jp: コンパイル時にカスタマイズの状態を表示したい時はコメントをはずします。 +# $(eval $(call HELIX_CUSTOMISE_MSG)) +# $(info ) + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call HELIX_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) + OPT_DEFS += -DLED_ANIMATIONS +endif + +ifeq ($(strip $(OLED_ENABLE)), yes) + OPT_DEFS += -DOLED_ENABLE +endif + +ifeq ($(strip $(LOCAL_GLCDFONT)), yes) + OPT_DEFS += -DLOCAL_GLCDFONT +endif + +ifeq ($(strip $(AUDIO_ENABLE)),yes) + ifeq ($(strip $(RGBLIGHT_ENABLE)),yes) + Link_Time_Optimization = yes + endif + ifeq ($(strip $(OLED_ENABLE)),yes) + Link_Time_Optimization = yes + endif +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +ifndef QUANTUM_DIR + include ../../../../Makefile +endif + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) -- cgit v1.2.3 From afd5cda4a0d832bacfff319177fe93968f686a11 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Thu, 20 Dec 2018 16:54:06 -0800 Subject: Fix up process_leader to be a bit more optimized (#4662) * Fix up process_leader to be a bit more optimized * Process dual function keys better * Make leader start a callable function * Fix per key timer call location * Add escape if already leading * Return false for KC_LEAD * Add documentation --- docs/config_options.md | 2 ++ docs/feature_leader_key.md | 6 ++++ quantum/process_keycode/process_leader.c | 51 +++++++++++++++++++------------- quantum/process_keycode/process_leader.h | 2 +- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index 879761a402..4bbc5debda 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -146,6 +146,8 @@ If you define these options you will enable the associated feature, which may in * If you're having issues finishing the sequence before it times out, you may need to increase the timeout setting. Or you may want to enable the `LEADER_PER_KEY_TIMING` option, which resets the timeout after each key is tapped. * `#define LEADER_PER_KEY_TIMING` * sets the timer for leader key chords to run on each key press rather than overall +* `#define LEADER_KEY_STRICT_KEY_PROCESSING` + * Disables keycode filtering for Mod-Tap and Layer-Tap keycodes. Eg, if you enable this, you would need to specify `MT(MOD_CTL, KC_A)` if you want to use `KC_A`. * `#define ONESHOT_TIMEOUT 300` * how long before oneshot times out * `#define ONESHOT_TAP_TOGGLE 2` diff --git a/docs/feature_leader_key.md b/docs/feature_leader_key.md index 168a1fc1c8..82cf789017 100644 --- a/docs/feature_leader_key.md +++ b/docs/feature_leader_key.md @@ -72,6 +72,12 @@ SEQ_THREE_KEYS(KC_C, KC_C, KC_C) { } ``` +## Strict Key Processing + +By default, the Leader Key feature will filter the keycode out of [`Mod-Tap`](feature_advanced_keycodes.md#mod-tap) and [`Layer Tap`](feature_advanced_keycodes.md#switching-and-toggling-layers) functions when checking for the Leader sequences. That means if you're using `LT(3, KC_A)`, it will pick this up as `KC_A` for the sequence, rather than `LT(3, KC_A)`, giving a more expected behavior for newer users. + +While, this may be fine for most, if you want to specify the whole keycode (eg, `LT(3, KC_A)` from the example above) in the sequence, you can enable this by added `#define LEADER_KEY_STRICT_KEY_PROCESSING` to your `config.h` file. This well then disable the filtering, and you'll need to specify the whole keycode. + ## Customization The Leader Key feature has some additional customization to how the Leader Key feature works. It has two functions that can be called at certain parts of the process. Namely `leader_start()` and `leader_end()`. diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index b32fc1db6a..57fccdc7e7 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -35,31 +35,42 @@ uint16_t leader_time = 0; uint16_t leader_sequence[5] = {0, 0, 0, 0, 0}; uint8_t leader_sequence_size = 0; +void qk_leader_start(void) { + if (leading) { return; } + leader_start(); + leading = true; + leader_time = timer_read(); + leader_sequence_size = 0; + leader_sequence[0] = 0; + leader_sequence[1] = 0; + leader_sequence[2] = 0; + leader_sequence[3] = 0; + leader_sequence[4] = 0; +} + bool process_leader(uint16_t keycode, keyrecord_t *record) { // Leader key set-up if (record->event.pressed) { + if (leading) { + if (timer_elapsed(leader_time) < LEADER_TIMEOUT) { +#ifndef LEADER_KEY_STRICT_KEY_PROCESSING + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } +#endif // LEADER_KEY_STRICT_KEY_PROCESSING + leader_sequence[leader_sequence_size] = keycode; + leader_sequence_size++; #ifdef LEADER_PER_KEY_TIMING - leader_time = timer_read(); + leader_time = timer_read(); #endif - if (!leading && keycode == KC_LEAD) { - leader_start(); - leading = true; -#ifndef LEADER_PER_KEY_TIMING - leader_time = timer_read(); -#endif - leader_time = timer_read(); - leader_sequence_size = 0; - leader_sequence[0] = 0; - leader_sequence[1] = 0; - leader_sequence[2] = 0; - leader_sequence[3] = 0; - leader_sequence[4] = 0; - return false; - } - if (leading && timer_elapsed(leader_time) < LEADER_TIMEOUT) { - leader_sequence[leader_sequence_size] = keycode; - leader_sequence_size++; - return false; + return false; + } + } else { + if (keycode == KC_LEAD) { + qk_leader_start(); + return false; + } + break; } } return true; diff --git a/quantum/process_keycode/process_leader.h b/quantum/process_keycode/process_leader.h index 59c3eed1be..15bccc3f67 100644 --- a/quantum/process_keycode/process_leader.h +++ b/quantum/process_keycode/process_leader.h @@ -24,7 +24,7 @@ bool process_leader(uint16_t keycode, keyrecord_t *record); void leader_start(void); void leader_end(void); - +void qk_leader_start(void); #define SEQ_ONE_KEY(key) if (leader_sequence[0] == (key) && leader_sequence[1] == 0 && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) #define SEQ_TWO_KEYS(key1, key2) if (leader_sequence[0] == (key1) && leader_sequence[1] == (key2) && leader_sequence[2] == 0 && leader_sequence[3] == 0 && leader_sequence[4] == 0) -- cgit v1.2.3 From ca3564753526fc866d6195ab6b957781070a64f8 Mon Sep 17 00:00:00 2001 From: Gergely Peidl Date: Fri, 21 Dec 2018 14:38:21 +0100 Subject: Feature Unicode example code fixed. --- docs/feature_unicode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_unicode.md b/docs/feature_unicode.md index 1b083896a2..9d57e2fb7a 100644 --- a/docs/feature_unicode.md +++ b/docs/feature_unicode.md @@ -23,7 +23,7 @@ const uint32_t PROGMEM unicode_map[] = { [BANG] = 0x203D, // ‽ [IRONY] = 0x2E2E, // ⸮ [SNEK] = 0x1F40D, // 🐍 -}: +}; ``` Make sure that the order for both matches. -- cgit v1.2.3 From b21c592f1e42b016f020821ae2879d1681ee3321 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 21 Dec 2018 08:03:34 -0800 Subject: handwired/not_so_minidox: Configurator support (#4699) --- keyboards/handwired/not_so_minidox/info.json | 63 ++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 keyboards/handwired/not_so_minidox/info.json diff --git a/keyboards/handwired/not_so_minidox/info.json b/keyboards/handwired/not_so_minidox/info.json new file mode 100644 index 0000000000..0222095024 --- /dev/null +++ b/keyboards/handwired/not_so_minidox/info.json @@ -0,0 +1,63 @@ +{ + "keyboard_name": "Not So MiniDox", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 5.75, + "layouts": { + "LAYOUT": { + "key_count": 42, + "layout": [ + {"x":0, "y":0.375}, + {"x":1, "y":0.25}, + {"x":2, "y":0.125}, + {"x":3, "y":0}, + {"x":4, "y":0.125}, + {"x":5, "y":0.25}, + + {"x":8, "y":0.25}, + {"x":9, "y":0.125}, + {"x":10, "y":0}, + {"x":11, "y":0.125}, + {"x":12, "y":0.25}, + {"x":13, "y":0.375}, + + {"x":0, "y":1.375}, + {"x":1, "y":1.25}, + {"x":2, "y":1.125}, + {"x":3, "y":1}, + {"x":4, "y":1.125}, + {"x":5, "y":1.25}, + + {"x":8, "y":1.25}, + {"x":9, "y":1.125}, + {"x":10, "y":1}, + {"x":11, "y":1.125}, + {"x":12, "y":1.25}, + {"x":13, "y":1.375}, + + {"x":0, "y":2.375}, + {"x":1, "y":2.25}, + {"x":2, "y":2.125}, + {"x":3, "y":2}, + {"x":4, "y":2.125}, + {"x":5, "y":2.25}, + + {"x":8, "y":2.25}, + {"x":9, "y":2.125}, + {"x":10, "y":2}, + {"x":11, "y":2.125}, + {"x":12, "y":2.25}, + {"x":13, "y":2.375}, + + {"x":3.5, "y":4.75}, + {"x":4.5, "y":4.75}, + {"x":5.5, "y":3.75, "h":2}, + + {"x":7.5, "y":3.75, "h":2}, + {"x":8.5, "y":4.75}, + {"x":9.5, "y":4.75} + ] + } + } +} -- cgit v1.2.3 From f0863286ccde082475d9cb483354f19a4e4de67c Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Fri, 21 Dec 2018 17:33:36 +0100 Subject: Update keymap for planck/rev6 (#4701) * Update keymap.c * Update rules and keymap * Update keymap rules --- keyboards/planck/keymaps/sascha/keymap.c | 4 ++-- keyboards/planck/keymaps/sascha/rules.mk | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/keyboards/planck/keymaps/sascha/keymap.c b/keyboards/planck/keymaps/sascha/keymap.c index 93787599c8..684b61f366 100644 --- a/keyboards/planck/keymaps/sascha/keymap.c +++ b/keyboards/planck/keymaps/sascha/keymap.c @@ -26,13 +26,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ * │ SINS │ ♥ │ ≈ │ ✓ │ ✗ │ ← │ → │ € │ ß │ Ü │ Ö │ Ä │ * ├──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┼──────┤ - * │ Powr │ Rset │ BLSt │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ + * │ Rset │ BLSt │ F1 │ Home │ End │ PgUp │ PgDn │ Left │ Down │ Up │ Rght │ │ * └──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┴──────┘ */ KC_TILD , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_DEL, KC_GRV , KC_EXLM , KC_AT , KC_HASH , KC_DLR , KC_PERC , KC_CIRC , KC_AMPR , KC_ASTR , UC(L'ü') , UC(L'ö') , UC(L'ä'), S(KC_INS) , UC(L'♥') , UC(L'≈') , UC(L'✓') , UC(L'✗') , UC(L'←') , UC(L'→') , UC(L'€') , UC(L'ß') , UC(L'Ü') , UC(L'Ö') , UC(L'Ä'), - KC_PWR , RESET , BL_STEP , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS + RESET , BL_STEP , KC_F1 , KC_HOME , KC_END , KC_PGUP , KC_PGDN , KC_LEFT , KC_DOWN , KC_UP , KC_RGHT , KC_TRNS ) }; diff --git a/keyboards/planck/keymaps/sascha/rules.mk b/keyboards/planck/keymaps/sascha/rules.mk index d3918164df..276b71daa8 100644 --- a/keyboards/planck/keymaps/sascha/rules.mk +++ b/keyboards/planck/keymaps/sascha/rules.mk @@ -1,5 +1,14 @@ AUTO_SHIFT_ENABLE = yes AUTO_SHIFT_MODIFIERS = yes +UNICODE_ENABLE = yes + +ifeq ($(strip $(KEYBOARD)), planck/rev5) BACKLIGHT_ENABLE = yes +CONSOLE_ENABLE = no +endif +ifeq ($(strip $(KEYBOARD)), planck/rev6) +BACKLIGHT_ENABLE = no +CONSOLE_ENABLE = yes +EXTRALDFLAGS = -Wl,--build-id=none UNICODE_ENABLE = yes -DEFAULT_FOLDER = planck/rev5 +endif -- cgit v1.2.3 From af84f0ff86b6b7fd8fd77ef49393ebe964c793c0 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Fri, 21 Dec 2018 19:00:45 +0100 Subject: Keymap: Redox / jeherve: updates (#4694) * Start using send_unicode_hex_string for shrug See https://docs.qmk.fm/#/feature_unicode?id=send_unicode_hex_string * Make sure one can come back to main layer after tapping to NAV * Add 4 new keys to symbol layer ~, `, =, +, are now more accesssible. No need to reach out far from home row anymore * Add two new macro keys I did not have much use for the Expose key and the right Command key, so opted to replace those with 2 Macros: - One to invoke Alfred: https://www.alfredapp.com/ => Opt + Space - One to invoke 1password: https://1password.com/ => Cmd + Opt + \ * Update readme to mention changes in new version * Remove unneeded short definition * Shorter name for our custom key See https://github.com/qmk/qmk_firmware/pull/4694#discussion_r243341864 * Make macros one-liners See https://github.com/qmk/qmk_firmware/pull/4694#discussion_r243341487 * Switch to using eeconfig_init_user to set Unicode mode See https://github.com/qmk/qmk_firmware/pull/4694#issuecomment-449151724 --- keyboards/redox/keymaps/jeherve/keymap.c | 42 ++++++++++++++++--------------- keyboards/redox/keymaps/jeherve/readme.md | 7 +++++- 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/keyboards/redox/keymaps/jeherve/keymap.c b/keyboards/redox/keymaps/jeherve/keymap.c index c2852f312c..f39b5a438a 100644 --- a/keyboards/redox/keymaps/jeherve/keymap.c +++ b/keyboards/redox/keymaps/jeherve/keymap.c @@ -25,14 +25,11 @@ enum custom_keycodes { WAVE, YOSHI, THUMB_UP, - NBSP + NBSP, + INV_1P, + ALFRED }; -// Make macros a bit simpler with this shortcut. -#define TAP_ONCE(code) \ - register_code (code); \ - unregister_code (code) - // Is shift being held? Let's store this in a bool. static bool shift_held = false; @@ -40,16 +37,22 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch(keycode) { case SHRUG: if (record->event.pressed) { - unicode_input_start(); register_hex(0xaf); unicode_input_finish(); - TAP_ONCE (KC_BSLS); - register_code (KC_RSFT); TAP_ONCE (KC_MINS); TAP_ONCE (KC_9); unregister_code (KC_RSFT); - unicode_input_start (); register_hex(0x30c4); unicode_input_finish(); - register_code (KC_RSFT); TAP_ONCE (KC_0); TAP_ONCE (KC_MINS); unregister_code (KC_RSFT); - TAP_ONCE (KC_SLSH); - unicode_input_start (); register_hex(0xaf); unicode_input_finish(); + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); } return false; break; + case INV_1P: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LGUI)SS_DOWN(X_LALT)SS_TAP(X_BSLASH)SS_UP(X_LGUI)SS_UP(X_LALT)); + } + return false; + break; + case ALFRED: + if (record->event.pressed) { + SEND_STRING(SS_DOWN(X_LALT)SS_TAP(X_SPACE)SS_UP(X_LALT)); + } + return false; + break; case YOSHI: if (record->event.pressed) { SEND_STRING(":yellow_yoshi:"); @@ -125,7 +128,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { }; // Shortcut to make keymap more readable -#define KC_CTDN LCTL(KC_DOWN) #define KC_SYQT LT(_SYMB,KC_QUOT) #define SYM_L MO(_SYMB) #define MO_INTR MO(_INTER) @@ -152,13 +154,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐ KC_GRV ,KC_1 ,KC_2 ,KC_3 ,KC_4 ,KC_5 , KC_6 ,KC_7 ,KC_8 ,KC_9 ,KC_0 ,KC_EQL , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_ESC , KC_CTDN ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS , + KC_TAB ,KC_Q ,KC_W ,KC_F ,KC_P ,KC_G ,KC_ESC , INV_1P ,KC_J ,KC_L ,KC_U ,KC_Y ,KC_SCLN ,KC_BSLS , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ SYM_L ,KC_A ,KC_R ,KC_S ,KC_T ,KC_D ,M_BRACKET_LEFT, M_BRACKET_RIGHT ,KC_H ,KC_N ,KC_E ,KC_I ,KC_O ,KC_SYQT , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ KC_LSFT ,KC_Z ,KC_X ,KC_C ,KC_V ,KC_B ,TT(_NAV),TT(_SYMB), TT(_SYMB),TT(_NAV),KC_K ,KC_M ,KC_COMM ,KC_DOT ,KC_SLSH ,KC_RSFT , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ - MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , KC_RCMD , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR + MO_INTR ,KC_LCTL ,KC_HYPR ,KC_LALT , KC_LCMD , KC_BSPC ,KC_LCTL , KC_ENT ,KC_SPC , ALFRED , TT_ADJ ,KC_HYPR ,KC_RCTL ,MO_INTR //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ ), @@ -170,7 +172,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ _______ ,KC_EXLM ,KC_AT ,KC_HASH ,KC_DLR ,KC_PERC ,KC_LCBR , KC_RCBR ,KC_CIRC ,KC_AMPR ,KC_ASTR ,KC_MINS ,KC_UNDS ,_______ , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , _______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ ,_______ , + _______ ,_______ ,_______ ,KC_TILD ,KC_GRV , _______ ,_______ ,_______ , _______ ,_______ ,_______ ,KC_EQL ,KC_PLUS ,_______ ,_______ ,_______ , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ _______ ,_______ ,_______ ,_______ , _______ , _______ ,_______ , _______ ,_______ , _______ , _______ ,_______ ,_______ ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ @@ -184,7 +186,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┼────────┤ XXXXXXX ,XXXXXXX ,KC_VOLD ,KC_VOLU ,KC_MUTE ,XXXXXXX ,_______ , _______ ,XXXXXXX ,KC_LEFT ,KC_DOWN ,KC_UP ,KC_RIGHT,XXXXXXX , //├────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┼────────┤ - XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ , _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , + XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,_______ ,_______ , _______ ,_______ ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX , //├────────┼────────┼────────┼────────┼────┬───┴────┬───┼────────┼────────┤ ├────────┼────────┼───┬────┴───┬────┼────────┼────────┼────────┼────────┤ _______ ,XXXXXXX ,XXXXXXX ,XXXXXXX , XXXXXXX , XXXXXXX ,_______ , _______ ,XXXXXXX , XXXXXXX , _______ ,XXXXXXX ,XXXXXXX ,_______ //└────────┴────────┴────────┴────────┘ └────────┘ └────────┴────────┘ └────────┴────────┘ └────────┘ └────────┴────────┴────────┴────────┘ @@ -230,8 +232,8 @@ void persistent_default_layer_set(uint16_t default_layer) { } // Set unicode in Mac OS. -void matrix_init_user(void) { - set_unicode_input_mode(UC_OSX); +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_OSX); }; // Change LED colors depending on the layer. diff --git a/keyboards/redox/keymaps/jeherve/readme.md b/keyboards/redox/keymaps/jeherve/readme.md index 5afad5530a..515dcbd622 100644 --- a/keyboards/redox/keymaps/jeherve/readme.md +++ b/keyboards/redox/keymaps/jeherve/readme.md @@ -1,7 +1,7 @@ # A Colemak keymap for the Redox keyboard ---- -![jeherve-redox-layout-3](https://user-images.githubusercontent.com/426388/45171716-69888200-b203-11e8-822d-7bc91f9f6c07.jpg) +![jeherve-redox-layout-4](https://user-images.githubusercontent.com/426388/50276398-2664be80-0442-11e9-86b9-fbd0f4275354.png) ---- @@ -25,6 +25,11 @@ My keymap uses 5 layers: ## Changelog +- 2018.12.20 + - 2 new Macro keys, to invoke [Alfred](https://www.alfredapp.com/) and [1Password](https://1password.com/). + - No more Right Command key or Expose key, I didn't use those much. + - Updates to use newer QMK function to call ¯\_(ツ)_/¯ + - Fix: you can now move back to the base layer when double tapping the thumb keys to switch to the Nav layer. 👍 - 2018.09.06 - Initial submission to QMK. It's alive! ⌨️ -- cgit v1.2.3 From ff8b1b9c6916a0817189a1c3079e8f2e09fc04b3 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Fri, 21 Dec 2018 17:39:10 -0800 Subject: Add crd's XD60 ANSI keymap (#4702) --- keyboards/xd60/keymaps/crd_ansi/README.md | 52 +++++++++++++++++++++++++++++++ keyboards/xd60/keymaps/crd_ansi/keymap.c | 30 ++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 keyboards/xd60/keymaps/crd_ansi/README.md create mode 100644 keyboards/xd60/keymaps/crd_ansi/keymap.c diff --git a/keyboards/xd60/keymaps/crd_ansi/README.md b/keyboards/xd60/keymaps/crd_ansi/README.md new file mode 100644 index 0000000000..80e4550249 --- /dev/null +++ b/keyboards/xd60/keymaps/crd_ansi/README.md @@ -0,0 +1,52 @@ +# ANSI Layout + +This is the standard ANSI keymap that I use on all of my 60% boards. This keymap +includes a single function layer available by holding the designated key on the +bottom row. + +I don't ever use Caps Lock, so that keycode is not mapped anywhere. In place of +the usual Caps Lock key, I have the following bnehaviour encoded: Escape when tapped +and Control when held. + +I also have the bottom right mod cluster mapped to navigational direction keys when tapped. +Shift = Up, Alt = Down, Ctrl = Right, Fn = Left. When held, these keys send the usual modifier +signals. + +``` +/* Base layer + * ,-----------------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | - | = | Backspace | + * |-----------------------------------------------------------------------------------------+ + * | Tab | Q | W | E | R | T | Y | U | I | O | P | [ | ] | \ | + * |-----------------------------------------------------------------------------------------+ + * | Esc/Ctrl| A | S | D | F | G | H | J | K | L | ; | ' | Enter | + * |-----------------------------------------------------------------------------------------+ + * | Shift | Z | X | C | V | B | N | M | , | . | ? | Shift | + * |-----------------------------------------------------------------------------------------+ + * | Ctrl | Alt | Cmd | Space | Cmd | Fn | Alt | Ctrl | + * `-----------------------------------------------------------------------------------------' + */ +``` + +While holding the function key, you have access to the following layout. Any key +not indicated is considered "transparent" and sends the signal indicated in the +layer below. This function later gets you dedicated access to Escape and Delete +keys, function keys on numbers, WASD directions, other navigation, multimedia +controls, RGB (underglow) controls, and firmware reset (DFU mode). + +``` +/* Fn layer + * ,-----------------------------------------------------------------------------------------. + * | Esc | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | Del | + * |-----------------------------------------------------------------------------------------+ + * | | Home| Up | End | | | | | Mute| | | Pg+ | Pg- | Reset | + * |-----------------------------------------------------------------------------------------+ + * | | Left| Down|Right| | | |Brt- |Vol- |Vol+ |Brt+ | | RGB Toggle | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | |R(Bt-)|R(Bt+)|R(Rot)| | + * |-----------------------------------------------------------------------------------------+ + * | | | | | | | | | + * `-----------------------------------------------------------------------------------------' + */ + +``` \ No newline at end of file diff --git a/keyboards/xd60/keymaps/crd_ansi/keymap.c b/keyboards/xd60/keymaps/crd_ansi/keymap.c new file mode 100644 index 0000000000..6964ca3158 --- /dev/null +++ b/keyboards/xd60/keymaps/crd_ansi/keymap.c @@ -0,0 +1,30 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL // Function Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_FNLT LT(_FL, KC_LEFT) +#define KC_RADN RALT_T(KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi( + 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_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_CTES, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_FNLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi( + 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_DEL, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, RGB_TOG, + _______, _______, _______, _______, _______, _______, _______, _______, RGB_VAD, RGB_VAI, RGB_MOD, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ) +}; -- cgit v1.2.3 From 4d98c69e0297973789564ce508f2e8dafe69c32b Mon Sep 17 00:00:00 2001 From: Michael Pio Date: Sat, 22 Dec 2018 10:39:25 +0800 Subject: Update Vinta (#4705) * add support for configurator * add more layouts * fix default keymap --- keyboards/vinta/info.json | 18 ++++++++++++++++++ keyboards/vinta/keymaps/default/keymap.c | 6 +++--- keyboards/vinta/vinta.h | 32 +++++++++++++++++++++++++++++++- 3 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 keyboards/vinta/info.json diff --git a/keyboards/vinta/info.json b/keyboards/vinta/info.json new file mode 100644 index 0000000000..dd972c895d --- /dev/null +++ b/keyboards/vinta/info.json @@ -0,0 +1,18 @@ +{ + "keyboard_name": "vinta", + "url": "", + "maintainer": "Peioris", + "width": 16, + "height": 5, + "layouts": { + "LAYOUT_69_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"~", "x":13, "y":0}, {"label":"|", "x":14, "y":0}, {"label":"Del", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"PgUp", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgDn", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"End", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Reset", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_68_tada": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4}, {"label":"Menu", "x":11, "y":4}, {"label":"Ctrl", "x":12, "y":4}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + }, + "LAYOUT_67_ansi": { + "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"~", "x":15, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Del", "x":15, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"PgUp", "x":15, "y":2}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"\u2191", "x":14, "y":3}, {"label":"PgDn", "x":15, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"Win", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"label":"Alt", "x":10, "y":4, "w":1.25}, {"label":"Ctrl", "x":11.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13, "y":4}, {"label":"\u2193", "x":14, "y":4}, {"label":"\u2192", "x":15, "y":4}] + } + } +} diff --git a/keyboards/vinta/keymaps/default/keymap.c b/keyboards/vinta/keymaps/default/keymap.c index 4e55ec308f..80499d73fc 100644 --- a/keyboards/vinta/keymaps/default/keymap.c +++ b/keyboards/vinta/keymaps/default/keymap.c @@ -33,8 +33,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [0] = LAYOUT_69_ansi( KC_ESC, 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_BSLS, KC_GRV, KC_DEL,\ 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_BSPC, KC_PGUP,\ - 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_PGUP,\ - KC_LSFT, 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_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_PGDN,\ + KC_LSFT, 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_END, \ KC_LCTL, KC_LGUI,KC_LALT, KC_SPC, KC_RALT, RESET, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT), }; @@ -48,4 +48,4 @@ void matrix_scan_user(void) { bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; -} \ No newline at end of file +} diff --git a/keyboards/vinta/vinta.h b/keyboards/vinta/vinta.h index 7f21157eee..991c981c97 100644 --- a/keyboards/vinta/vinta.h +++ b/keyboards/vinta/vinta.h @@ -22,4 +22,34 @@ { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, K4C, K4D, K4E, K4F } \ } -#endif \ No newline at end of file +#define LAYOUT_68_tada( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3E, K3F, \ + K40, K41, K42, K45, K49, K4A, K4C, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, XXX, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, XXX, K3E, K3F }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, XXX, K4D, K4E, K4F } \ +} + +#define LAYOUT_67_ansi( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0F, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1E, K1F, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2E, K2F, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3C, K3E, K3F, \ + K40, K41, K42, K45, K49, K4A, K4D, K4E, K4F \ +) \ +{ \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, XXX, K0F }, \ + { K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, XXX, K1E, K1F }, \ + { K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, XXX, XXX, K2E, K2F }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, XXX, K3C, XXX, K3E, K3F }, \ + { K40, K41, K42, XXX, XXX, K45, XXX, XXX, XXX, K49, K4A, XXX, XXX, K4D, K4E, K4F } \ +} + +#endif -- cgit v1.2.3 From ea1fe35ae7c5fa026309a1d51cd90450e48c6b39 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Fri, 21 Dec 2018 19:39:48 -0800 Subject: Keyboard: Infinity60 refactor, Configurator support and readme update (#4707) * Infinity60: refactor - infinity60.h / keymap.c - renamed layout macro to LAYOUT_60_ansi_split_bs_rshift; removed layout macro alias - updated to #pragma once - keymaps now use #include QMK_KEYBOARD_H - keymaps/jpetermans/config.h updated to #pragma once - keymaps/jpetermans/rules.mk deleted (complete contents were deprecated make instructions) * Infinity 60%: Configurator support * Infinity60: readme update Updated the Docs links. * Infinity60: bugfix depariel keymap Had a typo. * Infinity60: edit matrix.c per @drashna - https://github.com/qmk/qmk_firmware/pull/4707#issuecomment-449540676 --- keyboards/infinity60/infinity60.h | 11 ++-- keyboards/infinity60/info.json | 78 ++++++++++++++++++++++++ keyboards/infinity60/keymaps/default/keymap.c | 10 +-- keyboards/infinity60/keymaps/depariel/keymap.c | 16 ++--- keyboards/infinity60/keymaps/hasu/keymap.c | 12 ++-- keyboards/infinity60/keymaps/jpetermans/config.h | 7 +-- keyboards/infinity60/keymaps/jpetermans/keymap.c | 17 +++--- keyboards/infinity60/keymaps/jpetermans/rules.mk | 4 -- keyboards/infinity60/matrix.c | 19 ++++++ keyboards/infinity60/readme.md | 3 +- 10 files changed, 130 insertions(+), 47 deletions(-) create mode 100644 keyboards/infinity60/info.json delete mode 100644 keyboards/infinity60/keymaps/jpetermans/rules.mk diff --git a/keyboards/infinity60/infinity60.h b/keyboards/infinity60/infinity60.h index 21b8eeba2d..a719210451 100644 --- a/keyboards/infinity60/infinity60.h +++ b/keyboards/infinity60/infinity60.h @@ -14,16 +14,14 @@ 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 . */ -#ifndef KEYMAP_COMMON_H -#define KEYMAP_COMMON_H +#pragma once #include "quantum.h" -#define LAYOUT_60_ansi_split_bs_rshift KEYMAP - #ifdef INFINITY_PROTOTYPE + /* Infinity prototype */ -#define KEYMAP( \ +#define LAYOUT_60_ansi_split_bs_rshift( \ K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K86, \ K51, K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, \ K13, K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, \ @@ -44,7 +42,7 @@ along with this program. If not, see . #else /* Infinity production */ -#define KEYMAP( \ +#define LAYOUT_60_ansi_split_bs_rshift( \ K00, K10, K20, K30, K40, K50, K60, K70, K80, K01, K11, K21, K31, K41, K51, \ K61, K71, K81, K02, K12, K22, K32, K42, K52, K62, K72, K82, K03, K13, \ K23, K33, K43, K53, K63, K73, K83, K04, K14, K24, K34, K44, K54, \ @@ -64,4 +62,3 @@ along with this program. If not, see . #endif -#endif diff --git a/keyboards/infinity60/info.json b/keyboards/infinity60/info.json new file mode 100644 index 0000000000..06df911e5a --- /dev/null +++ b/keyboards/infinity60/info.json @@ -0,0 +1,78 @@ +{ + "keyboard_name": "Infinity 60%", + "keyboard_folder": "infinity60", + "url": "https://input.club/devices/infinity-keyboard/", + "maintainer": "qmk", + "width": 15, + "height": 5, + "layouts": { + "LAYOUT_60_ansi_split_bs_rshift": { + "key_count": 63, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"-", "x":11, "y":0}, + {"label":"=", "x":12, "y":0}, + {"label":"\\", "x":13, "y":0}, + {"label":"`", "x":14, "y":0}, + {"label":"Tab", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"[", "x":11.5, "y":1}, + {"label":"]", "x":12.5, "y":1}, + {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, + {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":";", "x":10.75, "y":2}, + {"label":"'", "x":11.75, "y":2}, + {"label":"Enter", "x":12.75, "y":2, "w":2.25}, + {"label":"Shift", "x":0, "y":3, "w":2.25}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":",", "x":9.25, "y":3}, + {"label":".", "x":10.25, "y":3}, + {"label":"/", "x":11.25, "y":3}, + {"label":"Shift", "x":12.25, "y":3, "w":1.75}, + {"label":"Fn", "x":14, "y":3}, + {"label":"Ctrl", "x":0, "y":4, "w":1.5}, + {"label":"GUI", "x":1.5, "y":4}, + {"label":"Alt", "x":2.5, "y":4, "w":1.5}, + {"label":"Space", "x":4, "y":4, "w":6}, + {"label":"Alt", "x":10, "y":4, "w":1.5}, + {"label":"GUI", "x":11.5, "y":4}, + {"label":"Fn", "x":12.5, "y":4}, + {"label":"Ctrl", "x":13.5, "y":4, "w":1.5} + ] + } + } +} diff --git a/keyboards/infinity60/keymaps/default/keymap.c b/keyboards/infinity60/keymaps/default/keymap.c index 8347c94b48..5d310e3b29 100644 --- a/keyboards/infinity60/keymaps/default/keymap.c +++ b/keyboards/infinity60/keymaps/default/keymap.c @@ -1,11 +1,11 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer * ,-----------------------------------------------------------. - * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| `|BSp| + * |Esc| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =| \| `| * |-----------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \| + * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| Bksp| * |-----------------------------------------------------------| * |Contro| A| S| D| F| G| H| J| K| L| ;| '|Enter | * |-----------------------------------------------------------| @@ -14,7 +14,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, 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_BSLS, KC_GRV, \ 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_BSPC, \ KC_LCTL,KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ @@ -34,7 +34,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_PWR, 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_INS, KC_DEL, \ KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS, KC_BSPC, \ KC_TRNS,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_PENT, \ diff --git a/keyboards/infinity60/keymaps/depariel/keymap.c b/keyboards/infinity60/keymaps/depariel/keymap.c index 57f9487f22..d1a1a04a45 100755 --- a/keyboards/infinity60/keymaps/depariel/keymap.c +++ b/keyboards/infinity60/keymaps/depariel/keymap.c @@ -1,4 +1,4 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -14,7 +14,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Fn2 |Gui |Alt | Space |RAlt|Prv|PlPs|Next| * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, 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_BSLS, KC_GRV, \ 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_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, LT(5, KC_ENT), \ @@ -23,7 +23,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 1: "Toggle" off SpaceFn for League of Legends */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, 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_BSLS, KC_GRV, \ 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_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ @@ -32,7 +32,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 2: "Toggle" off SpaceFn for MapleRoyals */ - [2] = KEYMAP( + [2] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, 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_BSLS, KC_GRV, \ 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_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, \ @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 3: FN layer 1 */ - [3] = KEYMAP( + [3] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, 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_NO, KC_NO, \ KC_NO, KC_BTN1, KC_MS_U, KC_BTN2, LALT(KC_F4), KC_HOME, KC_PGUP, KC_PSCR, KC_SLCK, KC_UP, KC_NO, KC_LPRN, KC_RPRN, KC_DEL, \ MO(6), KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_END, KC_PGDN, KC_TILD, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, \ @@ -50,7 +50,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 4: FN layer 2 */ - [4] = KEYMAP( + [4] = LAYOUT_60_ansi_split_bs_rshift( KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_PMNS, KC_PPLS, KC_PSLS, TG(2), \ KC_CAPS, KC_NO, KC_UP, KC_NO, KC_NO, KC_NO, KC_NO, KC_PSCR, KC_NO, KC_P7, KC_P8, KC_P9, KC_PAST, KC_BSPC, \ KC_LCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_P4, KC_P5, KC_P6, KC_PENT, \ @@ -59,7 +59,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 5: FN layer 3 */ - [5] = KEYMAP( + [5] = LAYOUT_60_ansi_split_bs_rshift( 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_TAB , KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F13, KC_F14, KC_F15, KC_F16, KC_NO, KC_TRNS, \ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F17, KC_F18, KC_F19, KC_F20, LT(5, KC_ENT), \ @@ -68,7 +68,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 6: FN layer 4 */ - [6] = KEYMAP( + [6] = LAYOUT_60_ansi_split_bs_rshift( 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, \ LCTL(LSFT(KC_TAB)), KC_NO, LGUI(KC_UP), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ MO(6), LGUI(KC_LEFT), LGUI(KC_DOWN), LGUI(KC_RGHT), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, \ diff --git a/keyboards/infinity60/keymaps/hasu/keymap.c b/keyboards/infinity60/keymaps/hasu/keymap.c index 9982078c19..ec0d321833 100644 --- a/keyboards/infinity60/keymaps/hasu/keymap.c +++ b/keyboards/infinity60/keymaps/hasu/keymap.c @@ -1,4 +1,4 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* Layer 0: Default Layer @@ -14,7 +14,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [0] = KEYMAP( + [0] = LAYOUT_60_ansi_split_bs_rshift( KC_ESC, 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_BSLS,KC_GRV, \ 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_BSPC, \ KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_SCLN), KC_QUOT,MT(KC_RCTL, KC_ENT), \ @@ -34,7 +34,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | |Gui|Alt | Space |Alt |Gui| | | * `-----------------------------------------------------------' */ - [1] = KEYMAP( + [1] = LAYOUT_60_ansi_split_bs_rshift( KC_PWR, 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_INS, KC_DEL, \ KC_CAPS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_TRNS,KC_PSCR,KC_SLCK,KC_PAUS, KC_UP, KC_TRNS,KC_BSPC, \ KC_LCTL,KC_VOLD,KC_VOLU,KC_MUTE,KC_TRNS,KC_TRNS,KC_PAST,KC_PSLS,KC_HOME,KC_PGUP,KC_LEFT,KC_RGHT,KC_ENT, \ @@ -54,7 +54,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Gui|Alt | Space |Alt |Gui| * `-------------------------------------------' */ - [2] = KEYMAP( + [2] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, 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_INS, KC_DEL, \ KC_TAB, KC_HOME,KC_PGDN,KC_UP, KC_PGUP,KC_END, KC_HOME,KC_PGDN,KC_PGUP,KC_END, KC_NO, KC_NO, KC_NO, KC_BSPC, \ KC_LCTL,KC_NO, KC_LEFT,KC_DOWN,KC_RGHT,KC_NO, KC_LEFT,KC_DOWN,KC_UP, KC_RGHT,KC_NO, KC_NO, KC_ENT, \ @@ -75,7 +75,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [3] = KEYMAP( + [3] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, 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_INS, KC_DEL, \ LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R, ALT_T(KC_LEFT), ALT_T(KC_RGHT),LALT(KC_TAB), \ KC_LCTL, KC_ACL0,KC_ACL1,KC_ACL2,KC_ACL2,KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, LT(3, KC_SCLN), KC_NO, KC_ENT, \ @@ -96,7 +96,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `--------------------------------------------' * Mc: Mouse Cursor / Mb: Mouse Button / Mw: Mouse Wheel */ - [4] = KEYMAP( + [4] = LAYOUT_60_ansi_split_bs_rshift( KC_GRV, 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_INS, KC_DEL, \ LALT(KC_TAB), KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_WH_L,KC_WH_D,KC_MS_U, KC_WH_U, KC_WH_R,KC_BTN4,KC_BTN5,LALT(KC_TAB), \ KC_LCTL, KC_VOLD,KC_VOLU,KC_MUTE,KC_NO, KC_NO, KC_NO, KC_MS_L,KC_MS_D, KC_MS_R, KC_BTN1,KC_NO, KC_ENT, \ diff --git a/keyboards/infinity60/keymaps/jpetermans/config.h b/keyboards/infinity60/keymaps/jpetermans/config.h index 72a2ed0810..1949a9ad9d 100644 --- a/keyboards/infinity60/keymaps/jpetermans/config.h +++ b/keyboards/infinity60/keymaps/jpetermans/config.h @@ -1,11 +1,6 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H - - -#include "../../config.h" +#pragma once //overrides #undef TAPPING_TOGGLE #define TAPPING_TOGGLE 2 -#endif diff --git a/keyboards/infinity60/keymaps/jpetermans/keymap.c b/keyboards/infinity60/keymaps/jpetermans/keymap.c index 59249ff728..c99b05e4c5 100644 --- a/keyboards/infinity60/keymaps/jpetermans/keymap.c +++ b/keyboards/infinity60/keymaps/jpetermans/keymap.c @@ -1,9 +1,6 @@ -#include "infinity60.h" +#include QMK_KEYBOARD_H #include "led_controller.h" -//Helpful Defines -#define _______ KC_TRNS - //Define Layer Names #define _BASE 0 #define _NUMPAD 1 @@ -54,7 +51,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------' */ /* default */ - [_BASE] = KEYMAP( \ + [_BASE] = LAYOUT_60_ansi_split_bs_rshift( \ KC_ESC, 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_BSLS,KC_NO,\ 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_BSPC, \ TT(_FNAV), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN,KC_QUOT,KC_ENT, \ @@ -63,7 +60,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* numpad */ - [_NUMPAD] = KEYMAP( \ + [_NUMPAD] = LAYOUT_60_ansi_split_bs_rshift( \ _______,_______,_______,_______,_______,_______,_______, KC_P7, KC_P8, KC_P9, KC_PSLS, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, KC_P4, KC_P5, KC_P6, KC_PAST, _______,_______,_______, \ MO(_FNAV),_______,_______,_______,_______,_______,_______, KC_P1, KC_P2, KC_P3, KC_PMNS, _______,_______, \ @@ -72,7 +69,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* F-, arrow, and media keys */ - [_FNAV] = KEYMAP( \ + [_FNAV] = LAYOUT_60_ansi_split_bs_rshift( \ KC_GRV, 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_NO,\ KC_CAPS,_______,_______,_______,_______,_______,_______,KC_PGUP,KC_UP,KC_PGDN,KC_PSCR,_______,_______,KC_DEL, \ _______,_______,KC_BTN2,_______,_______,_______,KC_HOME,KC_LEFT,KC_DOWN,KC_RGHT,KC_INS,_______,_______, \ @@ -81,7 +78,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), /* media */ - [_MEDIA] = KEYMAP( \ + [_MEDIA] = LAYOUT_60_ansi_split_bs_rshift( \ _______,F(MODE_SINGLE),F(MODE_PAGE),F(MODE_FLASH),_______,_______,_______, _______, _______, _______,KC_MUTE, KC_VOLD, KC_VOLU,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,F(GAME),_______, _______, _______, _______,_______, _______,_______, \ @@ -89,7 +86,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, KC_MPLY, _______,_______, _______,_______ \ ), /* ~ */ - [_TILDE] = KEYMAP( \ + [_TILDE] = LAYOUT_60_ansi_split_bs_rshift( \ KC_GRV,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \ @@ -97,7 +94,7 @@ const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______,_______,_______, _______, _______,_______, _______,_______ \ ), /* template */ - [5] = KEYMAP( \ + [5] = LAYOUT_60_ansi_split_bs_rshift( \ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,KC_NO,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______,_______,\ _______,_______,_______,_______,_______,_______,_______, _______, _______, _______,_______, _______,_______, \ diff --git a/keyboards/infinity60/keymaps/jpetermans/rules.mk b/keyboards/infinity60/keymaps/jpetermans/rules.mk deleted file mode 100644 index df3d1e952f..0000000000 --- a/keyboards/infinity60/keymaps/jpetermans/rules.mk +++ /dev/null @@ -1,4 +0,0 @@ - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif diff --git a/keyboards/infinity60/matrix.c b/keyboards/infinity60/matrix.c index bf86591ccf..ba16e69006 100644 --- a/keyboards/infinity60/matrix.c +++ b/keyboards/infinity60/matrix.c @@ -177,3 +177,22 @@ void matrix_print(void) xprintf("\n"); } } + +__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) { +} + diff --git a/keyboards/infinity60/readme.md b/keyboards/infinity60/readme.md index e77abca642..01f3a8a2ff 100644 --- a/keyboards/infinity60/readme.md +++ b/keyboards/infinity60/readme.md @@ -11,4 +11,5 @@ Make example for this keyboard (after setting up your build environment): make infinity60:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). + -- cgit v1.2.3 From 7bbd299fbac2cc1318ce5ec8cef18ffcf7fe8837 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sat, 22 Dec 2018 08:23:04 -0800 Subject: JD40 refactor and readme update (#4710) * JD40: default keymap refactor - Removed redundant action_layer.h include - Refactored to use LAYOUT macro (from LAYOUT_kc) - Refactored to use QMK-native keycodes - Removed superseded TMK code blocks * JD40: readme cleanup Fixed and updated the links in the readme file --- keyboards/jd40/keymaps/default/keymap.c | 226 ++++++-------------------------- keyboards/jd40/readme.md | 4 +- 2 files changed, 44 insertions(+), 186 deletions(-) diff --git a/keyboards/jd40/keymaps/default/keymap.c b/keyboards/jd40/keymaps/default/keymap.c index b4ec055053..ff31fd6f58 100644 --- a/keyboards/jd40/keymaps/default/keymap.c +++ b/keyboards/jd40/keymaps/default/keymap.c @@ -1,5 +1,4 @@ #include QMK_KEYBOARD_H -#include "action_layer.h" #define _BL 0 #define _AL 1 @@ -7,189 +6,48 @@ #define _UL 3 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = LAYOUT_kc( - F12, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT, - LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT), - - [_AL] = LAYOUT_kc( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL, - CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT, - TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END), - - [_FL] = LAYOUT_kc( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), - - [_UL] = LAYOUT_kc( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, FN4, FN5, FN11, FN10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), -}; - -enum function_id -{ - RGBLED_TOGGLE, - RGBLED_STEP_MODE, - RGBLED_INCREASE_HUE, - RGBLED_DECREASE_HUE, - RGBLED_INCREASE_SAT, - RGBLED_DECREASE_SAT, - RGBLED_INCREASE_VAL, - RGBLED_DECREASE_VAL, - SHIFT_ESC, -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay - [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow - [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode - [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), - [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), - [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), - [12] = ACTION_FUNCTION(SHIFT_ESC), + [_BL] = LAYOUT( + KC_F12, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_UP, KC_DOT, + KC_LCTL, KC_LGUI, KC_LALT, MO(_AL), KC_SPC, KC_SPC, MO(_AL), KC_LEFT, KC_DOWN, KC_RGHT + ), + + [_AL] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_DEL, + KC_CAPS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, + _______, _______, _______, _______, _______, _______, _______, _______, KC_SCLN, KC_PGUP, KC_QUOT, + _______, _______, _______, _______, TG(_UL), TG(_UL), _______, KC_HOME, KC_PGDN, KC_END + ), + + [_FL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), + + [_UL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - // MACRODOWN only works in this function - switch (id) - { - case 0: - if (record->event.pressed) - { - register_code(KC_RSFT); - } - else - { - unregister_code(KC_RSFT); - } - break; - } - return MACRO_NONE; -}; - -void matrix_scan_user(void) -{ - - // Layer LED indicators - // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster - uint32_t layer = layer_state; - if (layer & (1 << 1)) - { - //gh60_wasd_leds_on(); - } - else - { - //gh60_wasd_leds_off(); - } - - if (layer & (1 << 2)) - { - //gh60_esc_led_on(); - } - else - { - //gh60_esc_led_off(); - } -}; - -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) -{ - switch (id) - { - case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) - { - rgblight_toggle(); - } - break; - case RGBLED_INCREASE_HUE: - if (record->event.pressed) - { - rgblight_increase_hue(); - } - break; - case RGBLED_DECREASE_HUE: - if (record->event.pressed) - { - rgblight_decrease_hue(); - } - break; - case RGBLED_INCREASE_SAT: - if (record->event.pressed) - { - rgblight_increase_sat(); - } - break; - case RGBLED_DECREASE_SAT: - if (record->event.pressed) - { - rgblight_decrease_sat(); - } - break; - case RGBLED_INCREASE_VAL: - if (record->event.pressed) - { - rgblight_increase_val(); - } - break; - case RGBLED_DECREASE_VAL: - if (record->event.pressed) - { - rgblight_decrease_val(); - } - break; - case RGBLED_STEP_MODE: - if (record->event.pressed) - { - rgblight_step(); - } - break; - static uint8_t shift_esc_shift_mask; - // Shift + ESC = ~ - case SHIFT_ESC: - shift_esc_shift_mask = get_mods() & MODS_CTRL_MASK; - if (record->event.pressed) - { - if (shift_esc_shift_mask) - { - add_key(KC_GRV); - send_keyboard_report(); - } - else - { - add_key(KC_ESC); - send_keyboard_report(); - } - } - else - { - if (shift_esc_shift_mask) - { - del_key(KC_GRV); - send_keyboard_report(); - } - else - { - del_key(KC_ESC); - send_keyboard_report(); - } - } - break; - } +void matrix_scan_user(void) { + // Layer LED indicators + // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster + uint32_t layer = layer_state; + if (layer & (1 << 1)) { + //gh60_wasd_leds_on(); + } else { + //gh60_wasd_leds_off(); + } + + if (layer & (1 << 2)) { + //gh60_esc_led_on(); + } else { + //gh60_esc_led_off(); + } }; diff --git a/keyboards/jd40/readme.md b/keyboards/jd40/readme.md index f70bd9107d..3a92b8fb89 100644 --- a/keyboards/jd40/readme.md +++ b/keyboards/jd40/readme.md @@ -5,10 +5,10 @@ A compact 40% keyboard. Keyboard Maintainer: QMK Community Hardware Supported: JD40 PCB -Hardware Availability: [1up](https://1upkeyboards.com/jd40-mkii-1up-keyboards-logo-pcb.html) [mechanicalkeyboards.com](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=2452) [originative](https://www.originativeco.com/products/jd40-pcb) +Hardware Availability: [1upkeyboards](https://www.1upkeyboards.com/shop/controllers/jd40-mkii-1up-keyboards-logo-pcb/), [mechanicalkeyboards.com](https://mechanicalkeyboards.com/shop/index.php?l=product_detail&p=2452), [originative](https://www.originativeco.com/products/jd40-pcb) Make example for this keyboard (after setting up your build environment): make jd40:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +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). -- cgit v1.2.3 From 5e52eda0cacd45d2daa63dce71d7b7ceb5953368 Mon Sep 17 00:00:00 2001 From: Michishige Kaito Date: Thu, 20 Dec 2018 22:55:13 +0000 Subject: shell.nix: Packages relocated in upstream cleanup --- shell.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/shell.nix b/shell.nix index 67efb46b74..6ff8a7ad2d 100644 --- a/shell.nix +++ b/shell.nix @@ -4,6 +4,10 @@ with pkgs; let + avrbinutils = pkgsCross.avr.buildPackages.binutils; + avrlibc = pkgsCross.avr.libcCross; + gcc-arm-embedded = pkgsCross.arm-embedded.buildPackages.gcc; + avr_incflags = [ "-isystem ${avrlibc}/avr/include" "-B${avrlibc}/avr/lib/avr5" @@ -13,7 +17,7 @@ let "-B${avrlibc}/avr/lib/avr51" "-L${avrlibc}/avr/lib/avr51" ]; - avrgcc = pkgs.avrgcc.overrideAttrs (oldAttrs: rec { + avrgcc = pkgsCross.avr.buildPackages.gcc.overrideAttrs (oldAttrs: rec { name = "avr-gcc-8.1.0"; src = fetchurl { url = "mirror://gcc/releases/gcc-8.1.0/gcc-8.1.0.tar.xz"; -- cgit v1.2.3 From 2c3706611ff6ad20cc3210de837aacd4af7c7264 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Sun, 23 Dec 2018 08:36:01 -0800 Subject: Noxary x268: refactor and Configurator bugfix (#4713) - renamed layout macro LAYOUT_65_ansi to LAYOUT - rebuilt info.json to match LAYOUT macro --- keyboards/noxary/x268/info.json | 80 +++++++++++++++++++++++++- keyboards/noxary/x268/keymaps/default/keymap.c | 6 +- keyboards/noxary/x268/x268.h | 2 +- 3 files changed, 81 insertions(+), 7 deletions(-) diff --git a/keyboards/noxary/x268/info.json b/keyboards/noxary/x268/info.json index 047c39f044..cac7559baf 100644 --- a/keyboards/noxary/x268/info.json +++ b/keyboards/noxary/x268/info.json @@ -5,8 +5,82 @@ "width": 16, "height": 5, "layouts": { - "LAYOUT": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6, "y":0}, {"x":7, "y":0}, {"x":8, "y":0}, {"x":9, "y":0}, {"x":10, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0, "w":2}, {"x":15, "y":0}, {"x":0, "y":1, "w":1.5}, {"x":1.5, "y":1}, {"x":2.5, "y":1}, {"x":3.5, "y":1}, {"x":4.5, "y":1}, {"x":5.5, "y":1}, {"x":6.5, "y":1}, {"x":7.5, "y":1}, {"x":8.5, "y":1}, {"x":9.5, "y":1}, {"x":10.5, "y":1}, {"x":11.5, "y":1}, {"x":12.5, "y":1}, {"x":13.5, "y":1, "w":1.5}, {"x":15, "y":1}, {"x":0, "y":2, "w":1.75}, {"x":1.75, "y":2}, {"x":2.75, "y":2}, {"x":3.75, "y":2}, {"x":4.75, "y":2}, {"x":5.75, "y":2}, {"x":6.75, "y":2}, {"x":7.75, "y":2}, {"x":8.75, "y":2}, {"x":9.75, "y":2}, {"x":10.75, "y":2}, {"x":11.75, "y":2}, {"x":12.75, "y":2, "w":2.25}, {"x":15, "y":2}, {"x":0, "y":3, "w":2.25}, {"x":2.25, "y":3}, {"x":3.25, "y":3}, {"x":4.25, "y":3}, {"x":5.25, "y":3}, {"x":6.25, "y":3}, {"x":7.25, "y":3}, {"x":8.25, "y":3}, {"x":9.25, "y":3}, {"x":10.25, "y":3}, {"x":11.25, "y":3}, {"x":12.25, "y":3, "w":1.75}, {"x":14, "y":3}, {"x":15, "y":3}, {"x":0, "y":4, "w":1.25}, {"x":1.25, "y":4, "w":1.25}, {"x":2.5, "y":4, "w":1.25}, {"x":3.75, "y":4, "w":6.25}, {"x":10, "y":4}, {"x":11, "y":4}, {"x":12, "y":4}, {"x":13, "y":4}, {"x":14, "y":4}, {"x":15, "y":4}] - } + "LAYOUT": { + "key_count": 71, + "layout": [ + {"label":"ESC", "x":0, "y":0}, + {"label":"1", "x":1, "y":0}, + {"label":"2", "x":2, "y":0}, + {"label":"3", "x":3, "y":0}, + {"label":"4", "x":4, "y":0}, + {"label":"5", "x":5, "y":0}, + {"label":"6", "x":6, "y":0}, + {"label":"7", "x":7, "y":0}, + {"label":"8", "x":8, "y":0}, + {"label":"9", "x":9, "y":0}, + {"label":"0", "x":10, "y":0}, + {"label":"MINUS", "x":11, "y":0}, + {"label":"EQUAL", "x":12, "y":0}, + {"label":"BACKSLASH", "x":13, "y":0}, + {"label":"BACKSPACE", "x":14, "y":0}, + {"label":"GRAVE", "x":15, "y":0}, + {"label":"TAB", "x":0, "y":1, "w":1.5}, + {"label":"Q", "x":1.5, "y":1}, + {"label":"W", "x":2.5, "y":1}, + {"label":"E", "x":3.5, "y":1}, + {"label":"R", "x":4.5, "y":1}, + {"label":"T", "x":5.5, "y":1}, + {"label":"Y", "x":6.5, "y":1}, + {"label":"U", "x":7.5, "y":1}, + {"label":"I", "x":8.5, "y":1}, + {"label":"O", "x":9.5, "y":1}, + {"label":"P", "x":10.5, "y":1}, + {"label":"LBRACKET", "x":11.5, "y":1}, + {"label":"RBRACKET", "x":12.5, "y":1}, + {"label":"BACKSLASH", "x":13.5, "y":1, "w":1.5}, + {"label":"DELETE", "x":15, "y":1}, + {"label":"CAPS LOCK", "x":0, "y":2, "w":1.75}, + {"label":"A", "x":1.75, "y":2}, + {"label":"S", "x":2.75, "y":2}, + {"label":"D", "x":3.75, "y":2}, + {"label":"F", "x":4.75, "y":2}, + {"label":"G", "x":5.75, "y":2}, + {"label":"H", "x":6.75, "y":2}, + {"label":"J", "x":7.75, "y":2}, + {"label":"K", "x":8.75, "y":2}, + {"label":"L", "x":9.75, "y":2}, + {"label":"SEMICOLON", "x":10.75, "y":2}, + {"label":"QUOTE", "x":11.75, "y":2}, + {"label":"ISO HASH", "x":12.75, "y":2}, + {"label":"ENTER", "x":13.75, "y":2, "w":1.25}, + {"label":"PAGE UP", "x":15, "y":2}, + {"label":"LSHIFT", "x":0, "y":3, "w":1.25}, + {"label":"ISO BACKSLASH", "x":1.25, "y":3}, + {"label":"Z", "x":2.25, "y":3}, + {"label":"X", "x":3.25, "y":3}, + {"label":"C", "x":4.25, "y":3}, + {"label":"V", "x":5.25, "y":3}, + {"label":"B", "x":6.25, "y":3}, + {"label":"N", "x":7.25, "y":3}, + {"label":"M", "x":8.25, "y":3}, + {"label":"COMMA", "x":9.25, "y":3}, + {"label":"PERIOD", "x":10.25, "y":3}, + {"label":"SLASH", "x":11.25, "y":3}, + {"label":"RSHIFT", "x":12.25, "y":3, "w":1.75}, + {"label":"UP", "x":14, "y":3}, + {"label":"PAGE DOWN", "x":15, "y":3}, + {"label":"LCTRL", "x":0, "y":4, "w":1.25}, + {"label":"LGUI", "x":1.25, "y":4, "w":1.25}, + {"label":"LALT", "x":2.5, "y":4, "w":1.25}, + {"label":"SPACE", "x":3.75, "y":4, "w":6.25}, + {"label":"LALT", "x":10, "y":4}, + {"label":"FN", "x":11, "y":4}, + {"label":"RCTRL", "x":12, "y":4}, + {"label":"LEFT", "x":13, "y":4}, + {"label":"DOWN", "x":14, "y":4}, + {"label":"RIGHT", "x":15, "y":4} + ] + } } } + diff --git a/keyboards/noxary/x268/keymaps/default/keymap.c b/keyboards/noxary/x268/keymaps/default/keymap.c index cb37407a7b..ae07f5213d 100644 --- a/keyboards/noxary/x268/keymaps/default/keymap.c +++ b/keyboards/noxary/x268/keymaps/default/keymap.c @@ -22,7 +22,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |Ctrl|Win |Alt | Space |Alt|Mo(1)|Ctrl|Lef|Dow|Rght| * `----------------------------------------------------------------' */ - [_BL] = LAYOUT_65_ansi( + [_BL] = LAYOUT( KC_ESC, 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_BSLS, KC_BSPC, KC_GRV, 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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_ENT, KC_PGUP, @@ -41,7 +41,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | BL_Toggle | | | | |Vol-| | * `----------------------------------------------------------------' */ - [_FL1] = LAYOUT_65_ansi( + [_FL1] = LAYOUT( KC_GRV, 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, _______, RGB_TOG, RGB_VAI, RGB_SAI, RGB_HUI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_INS, _______, RGB_VAD, RGB_SAD, RGB_HUD, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `----------------------------------------------------------------' */ - [_FL2] = LAYOUT_65_ansi( + [_FL2] = LAYOUT( _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, diff --git a/keyboards/noxary/x268/x268.h b/keyboards/noxary/x268/x268.h index 53855e2060..9961b7dfdb 100644 --- a/keyboards/noxary/x268/x268.h +++ b/keyboards/noxary/x268/x268.h @@ -18,7 +18,7 @@ #include "quantum.h" -#define LAYOUT_65_ansi( \ +#define LAYOUT( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K013, K014, K015, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K114, K115, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, \ -- cgit v1.2.3 From 7e56c4bcb1bf0bad264401384d393ff0f7431d11 Mon Sep 17 00:00:00 2001 From: Adam Lee Date: Sun, 23 Dec 2018 11:39:30 -0500 Subject: [Miuni32] Update the # of LEDs to match the final version of PCB (#4714) * [Miuni32] Update the # of LEDs to match the final version of PCB * [Miuni32] Update link to website --- keyboards/miuni32/config.h | 2 +- keyboards/miuni32/readme.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/miuni32/config.h b/keyboards/miuni32/config.h index a56a818f55..37e9113f9d 100644 --- a/keyboards/miuni32/config.h +++ b/keyboards/miuni32/config.h @@ -161,7 +161,7 @@ along with this program. If not, see . #define RGB_DI_PIN D0 // The pin your RGB strip is wired to -#define RGBLED_NUM 7 // Number of LEDs +#define RGBLED_NUM 17 // Number of LEDs #define RGBLIGHT_ANIMATIONS #define RGBLIGHT_HUE_STEP 10 #define RGBLIGHT_SAT_STEP 17 diff --git a/keyboards/miuni32/readme.md b/keyboards/miuni32/readme.md index 050ec8ecd7..7fc72d601a 100644 --- a/keyboards/miuni32/readme.md +++ b/keyboards/miuni32/readme.md @@ -5,7 +5,7 @@ A compact 30% keyboard. Keyboard Maintainer: QMK Community Hardware Supported: miuni32 PCB -Hardware Availability: https://zealpc.net/products/miuni32 +Hardware Availability: https://bigtuna.io Make example for this keyboard (after setting up your build environment): -- cgit v1.2.3 From fc921a9c54bb28fe91219a9321f9d2c0cf7cf293 Mon Sep 17 00:00:00 2001 From: Othi Date: Mon, 24 Dec 2018 17:06:12 +0000 Subject: First PR for KBD6x HHKB layout keymap (#4704) * initial commit for Othi's HHKB layout keymap, covering multiple modifiers hold and vim-like support and german characters. If there's any suggestion i can be reached via mnpqraven on github or Othi#6661 on discord * added readme.md. TODO: update readme.md * changed to default quantum keycode for `KC_TRNS`, removed `PREVENT_STUCK_MODIFIERS`, fixed tap dance using one shots TODO: unicode implementation at https://docs.qmk.fm/#/feature_unicode * keymap documentaion(readme) added * unicode init TODO: figure out what made the compose sequence not running * update unicode and readme --- keyboards/kbd6x/keymaps/othi/config.h | 10 ++ keyboards/kbd6x/keymaps/othi/keymap.c | 190 +++++++++++++++++++++++++++++++++ keyboards/kbd6x/keymaps/othi/readme.md | 56 ++++++++++ keyboards/kbd6x/keymaps/othi/rules.mk | 19 ++++ 4 files changed, 275 insertions(+) create mode 100644 keyboards/kbd6x/keymaps/othi/config.h create mode 100644 keyboards/kbd6x/keymaps/othi/keymap.c create mode 100644 keyboards/kbd6x/keymaps/othi/readme.md create mode 100644 keyboards/kbd6x/keymaps/othi/rules.mk diff --git a/keyboards/kbd6x/keymaps/othi/config.h b/keyboards/kbd6x/keymaps/othi/config.h new file mode 100644 index 0000000000..42f68b4358 --- /dev/null +++ b/keyboards/kbd6x/keymaps/othi/config.h @@ -0,0 +1,10 @@ +#pragma once +#define ONESHOT_TAP_TOOGLE 2 +#define ONESHOT_TIMEOUT 2000 +// tap dance configurations +#define TAPPING_TERM 200 +#define TAPPING_TOGGLE 2 +#define PERMISSIVE_HOLD +// Fix KC_GESC conflict with Cmd+Alt+Esc on macros +#define GRAVE_ESC_GUI_OVERRIDE + diff --git a/keyboards/kbd6x/keymaps/othi/keymap.c b/keyboards/kbd6x/keymaps/othi/keymap.c new file mode 100644 index 0000000000..1e0fc8ad7e --- /dev/null +++ b/keyboards/kbd6x/keymaps/othi/keymap.c @@ -0,0 +1,190 @@ +/* Copyright 2018 Othi + * + * 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 . + */ +#include QMK_KEYBOARD_H + +// read README.md for rundown of what does what + +// #define BL 0 +#define CL 0 +#define NM_MODE 2 +#define VI_MODE 3 +#define FN3 4 +#define ACCENT 5 +#define ACCENT_CAP 6 + +//Unicode keymaps +void eeconfig_init_user(void) { + set_unicode_input_mode(UC_LNX); +} +#define DE_AE UC(0x00E4) +#define DE_SS UC(0x00DF) +#define DE_OE UC(0x00F6) +#define DE_UE UC(0x00FC) +#define DE_AE_CAP UC(0x00C4) +#define DE_OE_CAP UC(0x00D6) +#define DE_UE_CAP UC(0x00DC) + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case NM_MODE: + rgblight_setrgb (0x00, 0x66, 0x00); + break; + case VI_MODE: + rgblight_setrgb (0x66, 0x66, 0x00); + break; + case ACCENT: + rgblight_setrgb (0x7A, 0x00, 0xFF); + break; + case ACCENT_CAP: + rgblight_setrgb (0x7A, 0xFF, 0xFF); + break; + default: // for any other layers, or the default layer + rgblight_setrgb (0xFF, 0x00, 0x00); + break; + } + return state; +} + +//Tap Dance Declarations +enum { + CTL_NM = 0, + ALT_NM = 1, + SFT_NM = 2, + GUI_NM = 3 +}; + +void dance_CTL_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + set_oneshot_mods(MOD_LCTL); + } else { + register_code (KC_LCTL); + layer_on(NM_MODE); + } +} + +void dance_CTL_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LCTL); + } else { + unregister_code (KC_LCTL); + layer_off(NM_MODE); + } +} + +void dance_GUI_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LGUI); + } else { + register_code (KC_LGUI); + layer_on(NM_MODE); + } +} + +void dance_GUI_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LGUI); + } else { + unregister_code (KC_LGUI); + layer_off(NM_MODE); + } +} + +void dance_ALT_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LALT); + } else { + register_code (KC_LALT); + layer_on(NM_MODE); + } +} + +void dance_ALT_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LALT); + } else { + unregister_code (KC_LALT); + layer_off(NM_MODE); + } +} + +void dance_SFT_NM_finished (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + register_code (KC_LSFT); + set_oneshot_mods(MOD_LSFT); + } else { + register_code (KC_LSFT); + layer_on(NM_MODE); + } +} + +void dance_SFT_NM_reset (qk_tap_dance_state_t *state, void *user_data) { + if (state->count == 1) { + unregister_code (KC_LSFT); + } else { + unregister_code (KC_LSFT); + layer_off(NM_MODE); + } +} + + +qk_tap_dance_action_t tap_dance_actions[] = { + [CTL_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_CTL_NM_finished, dance_CTL_NM_reset), + [GUI_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_GUI_NM_finished, dance_GUI_NM_reset), + [ALT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_ALT_NM_finished, dance_ALT_NM_reset), + [SFT_NM] = ACTION_TAP_DANCE_FN_ADVANCED (NULL, dance_SFT_NM_finished, dance_SFT_NM_reset) +}; + +// backup +// old R3 capslock, LT(NM_MODE,KC_BSPC), +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [CL] = LAYOUT( + KC_GESC, 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_BSLS, KC_DEL, + MT(MOD_LGUI,KC_TAB), LT(NM_MODE,KC_Q), KC_W, LT(ACCENT,KC_F), KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_LBRC, KC_RBRC, KC_BSPC, + MT(MOD_LCTL,KC_BSPC), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, KC_ENT, + TD(SFT_NM), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, MT(MOD_LCTL,KC_COMM), MT(MOD_LSFT,KC_DOT), MT(MOD_LALT,KC_SLSH), LM(CL,MOD_LGUI|MOD_LSFT), TT(NM_MODE), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT) , _______ + ), + [NM_MODE] = LAYOUT( + KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, KC_END, _______, _______, _______, _______, _______, KC_HOME, _______, _______, RESET, KC_INS, + LGUI(KC_TAB), _______, LCTL(KC_RGHT), _______, _______, _______, _______, KC_UP, KC_PGUP, _______, _______, _______, TG(CL), KC_DEL, + _______, KC_LEFT, _______, KC_RGHT, _______, KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, _______, KC_ENT, KC_QUOT, KC_LGUI, + KC_LSFT, _______, _______, _______, _______, LCTL(KC_LEFT), _______, _______, _______, _______, _______, TG(VI_MODE), TO(CL), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______ + ), + + [VI_MODE] = LAYOUT( + KC_GRV, KC_MPRV, KC_MNXT, KC_MPLY, LSFT(KC_END), KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, LSFT(KC_HOME), KC_F11, KC_F12, RESET, KC_INS, + LGUI(KC_TAB), _______, LSFT(LCTL(KC_RGHT)), _______, _______, _______, _______, LSFT(KC_UP), _______, _______, _______, _______, TG(CL), KC_BSPC, + _______, _______, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), LSFT(KC_DOWN), LSFT(KC_RGHT), _______, KC_SCLN, KC_QUOT, KC_LGUI, + KC_LSFT, _______, _______, _______, _______, LSFT(LCTL(KC_LEFT)), _______, _______, _______, _______, KC_SLSH, OSM(MOD_LSFT), TO(CL), + _______, TD(CTL_NM), TD(ALT_NM), KC_SPC, LM(CL,MOD_LGUI|MOD_LALT), OSL(ACCENT), _______ + ), + [ACCENT] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, + _______, RGB_TOG, RGB_MODE_PLAIN, _______, _______, _______, _______, _______, DE_UE, _______, _______, _______, _______, _______, + _______, DE_AE, UC_Z, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE, _______, _______, + OSL(ACCENT_CAP), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, TO(CL), + _______, _______, _______, _______, _______, _______, _______ + ), + [ACCENT_CAP] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, DE_UE_CAP, _______, _______, _______, _______, _______, + _______, DE_AE_CAP, _______, DE_SS, _______, _______, _______, _______, _______, _______, DE_OE_CAP, _______, TO(CL), + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ), +}; + diff --git a/keyboards/kbd6x/keymaps/othi/readme.md b/keyboards/kbd6x/keymaps/othi/readme.md new file mode 100644 index 0000000000..95be36d057 --- /dev/null +++ b/keyboards/kbd6x/keymaps/othi/readme.md @@ -0,0 +1,56 @@ +## Othi's Universal HHKB keymap + +### Goals +- Colemak layout. If you don't use Colemak then you'll need to also change the arrow key bindigns in other layers + +- Vim-like navigation layer so you can use vim binding arrowkeys in non-vim environment + +- Good modifier support so you don't have to hold 14 modifier keys at the same time + +- RGB indicating layer change(only work with plain colors so far, don't put your rgb to pulsing or any non static animation) + +### Layers +- **CL:** + + The base layer, default is Colemak + +- **NM_MODE:** + + Vim-like arrowkeys in the home row, it's `LHNE` for *JENK Colemak* and `HJKL` for *QWERTY* + + Also `HOME`, `END` and next/prev word (`Ctrl + Left/Right`) in `0, 4, w, b` like in vim + +- **VI_MODE:** + + The same as `NM_MODE` but with `KC_LSFT` held down for mostly highlighting + +- **ACCENT + ACCENT_CAP:** + + Function row and Unicode characters + +### Modifiers and Tap Dance keys +**LHS:** + +- Any Tap Dance key with the format of `TD(XXX_NM)` act as normal XXX modifier upon hold, but will hold **and** put you to `NM_MODE` when double click hold(a tap before the hold)(eg you can produce `Alt + PgUp` by pressing `Alt + Alt + U`) + +- `KC_TAB` acts as both `KC_TAB` on tap and `KC_LGUI` on hold + +- R3 CapsLock acts as both `KC_BSPC` on tap and `KC_LCTL` on hold + +- Holding `KC_Q` also puts you into `NM_MODE` + +- Holding `KC_F` puts you into `VI_MODE` for fast function keys + +**RHS:** + +- 3 keys `KC_SCLN`, `KC_DOT` and `KC_SLSH` in `CL` layer can also be held down for respectively `KC_LCTL`, `KC_LSFT`, `KC_LALT` for easier 2-hand modifier holding + +- Right modifiers hold the selected modifier with `KC_LGUI` at the same time, mainly for i3wm, you can change this to whatever combination you want + +### Misc. functionalities + +**Unicode:** + +- In case the keyboard output the 4-digit codepoint instead of the actual unicode, you need to change the rewrite input mode of the keyboard into the EEPROM(you only have to do this if the EEPROM was cleared or your current machine use another unicode compose method other than IBus/Linux's `Ctrl + Shift + U`). Change the corresponding Input `void eeconfig_init_user(void)`. See [this](https://docs.qmk.fm/#/feature_unicode) for availble input modes. + +- **NOTE:** make sure to keep your qmk env up to date with upstream diff --git a/keyboards/kbd6x/keymaps/othi/rules.mk b/keyboards/kbd6x/keymaps/othi/rules.mk new file mode 100644 index 0000000000..9cda4109dd --- /dev/null +++ b/keyboards/kbd6x/keymaps/othi/rules.mk @@ -0,0 +1,19 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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 +MIDI_ENABLE = no # MIDI support (+2400 to 4200, depending on config) +UNICODE_ENABLE = yes # Unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +RGBLIGHT_ENABLE = yes +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) +TAP_DANCE_ENABLE=yes + -- cgit v1.2.3 From 33483b440ce1cf6df1010597b68a94751f4807b6 Mon Sep 17 00:00:00 2001 From: ishtob Date: Mon, 24 Dec 2018 12:06:33 -0500 Subject: Keymap: fix userspace compile error with planck grid (#4719) --- keyboards/planck/keymaps/ishtob/keymap.c | 20 ++++++++++---------- users/ishtob/ishtob.h | 1 - 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/keyboards/planck/keymaps/ishtob/keymap.c b/keyboards/planck/keymaps/ishtob/keymap.c index 082257b895..e036d8a5a3 100644 --- a/keyboards/planck/keymaps/ishtob/keymap.c +++ b/keyboards/planck/keymaps/ishtob/keymap.c @@ -24,7 +24,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Esc | Caps | Alt | GUI |Lower | Space |Raise |NumLay| RAlt | Men | Del | * `-----------------------------------------------------------------------------------' */ -[_QWERTY] = LAYOUT_planck_grid( +[_QWERTY] = LAYOUT_ortho_4x12_wrapper( LT_FN(KC_TAB), _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_BSPC, KC_LCTL, _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, CTL_ENT, KC_LSFT, _________________QWERTY_L3_________________, _________________QWERTY_R3_________________, LT_RAI(KC_MINS), @@ -42,7 +42,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_COLEMAK] = LAYOUT_planck_grid( +[_COLEMAK] = LAYOUT_ortho_4x12_wrapper( LT_FN(KC_TAB), _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, KC_BSPC, KC_LCTL, _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, KC_ENT, KC_LSFT, _________________COLEMAK_L3________________, _________________COLEMAK_R3________________, LT_RAI(KC_MINS), @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * `-----------------------------------------------------------------------------------' */ -[_DVORAK] = LAYOUT_planck_grid( +[_DVORAK] = LAYOUT_ortho_4x12_wrapper( LT_FN(KC_TAB), _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, KC_BSPC, KC_LCTL, _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, KC_ENT, KC_LSFT, _________________DVORAK_L3_________________, _________________DVORAK_R3_________________, LT_RAI(KC_MINS), @@ -78,7 +78,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_LOWER] = LAYOUT_planck_grid( +[_LOWER] = LAYOUT_ortho_4x12_wrapper( ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_GRV, KC_BSLS, _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, @@ -96,7 +96,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | 0 | | Left | Down | Right| NumLk| * `-----------------------------------------------------------------------------------' */ -[_RAISE] = LAYOUT_planck_grid( +[_RAISE] = LAYOUT_ortho_4x12_wrapper( ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, KC_PLUS, KC_BSLS, _______, KC_A, KC_UP, KC_D, KC_PSCR, KC_VOLU, KC_4, KC_5, KC_6, KC_PAST, KC_COLN, KC_QUOT, _______, KC_LEFT, KC_DOWN, KC_RIGHT,KC__MUTE, KC_VOLD, KC_1, KC_2, KC_3, KC_UP, KC_SLSH, _______, @@ -115,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_PLOVER] = LAYOUT_planck_grid( +[_PLOVER] = LAYOUT_ortho_4x12_wrapper( KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, @@ -133,7 +133,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Next | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_FNLAYER] = LAYOUT_planck_grid( +[_FNLAYER] = LAYOUT_ortho_4x12_wrapper( _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_PLUS, _______, __________________LONG_FUNC_LEFT___________________, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_QUOT, _______, __________________LONG_FUNC_RIGHT__________________,S(KC_NUHS),S(KC_NUBS),KC_LCBR, KC_RCBR, _______, @@ -151,7 +151,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | 0 | . | Exit | Vol- | Vol+ | Play | * `-----------------------------------------------------------------------------------' */ -[_NUMLAY] = LAYOUT_planck_grid( +[_NUMLAY] = LAYOUT_ortho_4x12_wrapper( _______, KC_Q, KC_UP, KC_H, XXXXXXX, XXXXXXX, KC_P7, KC_P8, KC_P9, KC_MINS, KC_PLUS, KC_BSPC, _______, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_P4, KC_P5, KC_P6, KC_PAST, KC_COLN, KC_ENT, _______, KC_Z, KC_X, KC_C, KC_V, XXXXXXX, KC_P1, KC_P2, KC_P3, KC_PDOT, KC_PSLS, _______, @@ -170,7 +170,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ -[_MOUSECURSOR] = LAYOUT_planck_grid( +[_MOUSECURSOR] = LAYOUT_ortho_4x12_wrapper( KC_ACL0, KC_ACL1, KC_ACL2, M_EMAIL,M_EMAIL2, KC_HOME, KC_PGUP, KC_WH_L, KC_MS_U, KC_WH_R, P_MPASS, P_META, _______, XXXXXXX, XXXXXXX, XXXXXXX, O_RTQ6H, KC_END , KC_PGDN, KC_MS_L, KC_MS_D, KC_MS_R, _______, O_DAYRN, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, KC_BTN2, KC_BTN3, KC_BTN4, KC_BTN5, _______, _______, @@ -188,7 +188,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | | * `-----------------------------------------------------------------------------------' */ -[_ADJUST] = LAYOUT_planck_grid( +[_ADJUST] = LAYOUT_ortho_4x12_wrapper( DFU, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, KC_DEL, _______, MAGIC_TOGGLE_NKRO, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, BL_DEC, BL_INC, BL_STEP, BL_TOGG, diff --git a/users/ishtob/ishtob.h b/users/ishtob/ishtob.h index 3e4d4ffbcb..ced78a09d8 100644 --- a/users/ishtob/ishtob.h +++ b/users/ishtob/ishtob.h @@ -85,7 +85,6 @@ expanded before being used as arguments to the LAYOUT_xxx macro. #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) -#define LAYOUT_planck_grid(...) LAYOUT_planck_grid(__VA_ARGS__) /* Blocks for each of the four major keyboard layouts -- cgit v1.2.3 From 2149f3b5889f898fecde845a03d61c1a854d9393 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 24 Dec 2018 09:19:18 -0800 Subject: Toad Configurator support and readme update (#4718) * Toad: Configurator support * Toad: update Docs links in readme --- keyboards/toad/info.json | 409 +++++++++++++++++++++++++++++++++++++++++++++++ keyboards/toad/readme.md | 2 +- 2 files changed, 410 insertions(+), 1 deletion(-) create mode 100644 keyboards/toad/info.json diff --git a/keyboards/toad/info.json b/keyboards/toad/info.json new file mode 100644 index 0000000000..17a37147ec --- /dev/null +++ b/keyboards/toad/info.json @@ -0,0 +1,409 @@ +{ + "keyboard_name": "Toad", + "url": "", + "maintainer": "qmk", + "width": 15, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "key_count": 78, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K113", "x":13, "y":1.5}, + {"label":"K013", "x":14, "y":1.5}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":3.5, "w":1.25}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":1.75}, + {"label":"K413", "x":14, "y":4.5}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_ansi_wk": { + "key_count": 74, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K313", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K400", "x":0, "y":4.5, "w":2.25}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_ansi_wkl": { + "key_count": 71, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K213", "x":13.5, "y":2.5, "w":1.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K313", "x":12.75, "y":3.5, "w":2.25}, + {"label":"K400", "x":0, "y":4.5, "w":2.25}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.5}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.5}, + {"label":"K507", "x":4, "y":5.5, "w":7}, + {"label":"K511", "x":11, "y":5.5, "w":1.5}, + {"label":"K513", "x":13.5, "y":5.5, "w":1.5} + ] + }, + + "LAYOUT_iso_wk": { + "key_count": 75, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.25}, + {"label":"K501", "x":1.25, "y":5.5, "w":1.25}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.25}, + {"label":"K507", "x":3.75, "y":5.5, "w":6.25}, + {"label":"K510", "x":10, "y":5.5, "w":1.25}, + {"label":"K511", "x":11.25, "y":5.5, "w":1.25}, + {"label":"K512", "x":12.5, "y":5.5, "w":1.25}, + {"label":"K513", "x":13.75, "y":5.5, "w":1.25} + ] + }, + + "LAYOUT_iso_wkl": { + "key_count": 72, + "layout": [ + {"label":"K000", "x":0, "y":0}, + {"label":"K001", "x":2, "y":0}, + {"label":"K002", "x":3, "y":0}, + {"label":"K003", "x":4, "y":0}, + {"label":"K004", "x":5, "y":0}, + {"label":"K005", "x":6.5, "y":0}, + {"label":"K006", "x":7.5, "y":0}, + {"label":"K007", "x":8.5, "y":0}, + {"label":"K008", "x":9.5, "y":0}, + {"label":"K009", "x":11, "y":0}, + {"label":"K010", "x":12, "y":0}, + {"label":"K011", "x":13, "y":0}, + {"label":"K012", "x":14, "y":0}, + {"label":"K100", "x":0, "y":1.5}, + {"label":"K101", "x":1, "y":1.5}, + {"label":"K102", "x":2, "y":1.5}, + {"label":"K103", "x":3, "y":1.5}, + {"label":"K104", "x":4, "y":1.5}, + {"label":"K105", "x":5, "y":1.5}, + {"label":"K106", "x":6, "y":1.5}, + {"label":"K107", "x":7, "y":1.5}, + {"label":"K108", "x":8, "y":1.5}, + {"label":"K109", "x":9, "y":1.5}, + {"label":"K110", "x":10, "y":1.5}, + {"label":"K111", "x":11, "y":1.5}, + {"label":"K112", "x":12, "y":1.5}, + {"label":"K013", "x":13, "y":1.5, "w":2}, + {"label":"K200", "x":0, "y":2.5, "w":1.5}, + {"label":"K201", "x":1.5, "y":2.5}, + {"label":"K202", "x":2.5, "y":2.5}, + {"label":"K203", "x":3.5, "y":2.5}, + {"label":"K204", "x":4.5, "y":2.5}, + {"label":"K205", "x":5.5, "y":2.5}, + {"label":"K206", "x":6.5, "y":2.5}, + {"label":"K207", "x":7.5, "y":2.5}, + {"label":"K208", "x":8.5, "y":2.5}, + {"label":"K209", "x":9.5, "y":2.5}, + {"label":"K210", "x":10.5, "y":2.5}, + {"label":"K211", "x":11.5, "y":2.5}, + {"label":"K212", "x":12.5, "y":2.5}, + {"label":"K300", "x":0, "y":3.5, "w":1.75}, + {"label":"K301", "x":1.75, "y":3.5}, + {"label":"K302", "x":2.75, "y":3.5}, + {"label":"K303", "x":3.75, "y":3.5}, + {"label":"K304", "x":4.75, "y":3.5}, + {"label":"K305", "x":5.75, "y":3.5}, + {"label":"K306", "x":6.75, "y":3.5}, + {"label":"K307", "x":7.75, "y":3.5}, + {"label":"K308", "x":8.75, "y":3.5}, + {"label":"K309", "x":9.75, "y":3.5}, + {"label":"K310", "x":10.75, "y":3.5}, + {"label":"K311", "x":11.75, "y":3.5}, + {"label":"K312", "x":12.75, "y":3.5}, + {"label":"K313", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"K400", "x":0, "y":4.5, "w":1.25}, + {"label":"K401", "x":1.25, "y":4.5}, + {"label":"K402", "x":2.25, "y":4.5}, + {"label":"K403", "x":3.25, "y":4.5}, + {"label":"K404", "x":4.25, "y":4.5}, + {"label":"K405", "x":5.25, "y":4.5}, + {"label":"K406", "x":6.25, "y":4.5}, + {"label":"K407", "x":7.25, "y":4.5}, + {"label":"K408", "x":8.25, "y":4.5}, + {"label":"K409", "x":9.25, "y":4.5}, + {"label":"K410", "x":10.25, "y":4.5}, + {"label":"K411", "x":11.25, "y":4.5}, + {"label":"K412", "x":12.25, "y":4.5, "w":2.75}, + {"label":"K500", "x":0, "y":5.5, "w":1.5}, + {"label":"K502", "x":2.5, "y":5.5, "w":1.5}, + {"label":"K507", "x":4, "y":5.5, "w":7}, + {"label":"K511", "x":11, "y":5.5, "w":1.5}, + {"label":"K513", "x":13.5, "y":5.5, "w":1.5} + ] + } + } +} + diff --git a/keyboards/toad/readme.md b/keyboards/toad/readme.md index 3f3bff5b5b..de58f7202b 100644 --- a/keyboards/toad/readme.md +++ b/keyboards/toad/readme.md @@ -10,5 +10,5 @@ Make examples for these keyboards (after setting up your build environment): make toad: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). -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. -- cgit v1.2.3 From 72d4e4bfd76b2c83b89787f8b3a8ba779a3e8d81 Mon Sep 17 00:00:00 2001 From: Takeshi ISHII <2170248+mtei@users.noreply.github.com> Date: Tue, 25 Dec 2018 04:14:57 +0900 Subject: Replace serial.c of quantum/split_common/ (#4669) * Add provisional Helix implementation to test the quantum/split_common. * copy keyboards/helix/serial.[ch] to quantum/split_common/ * Make serial.c a pure driver. Remove buffer name and buffer size from serial.c. They should be placed in the caller(matrix.c, split_utils.c). * remove quantum/split_common/serial_backward_compatibility.h * Changed array serial_master_buffer to structure serial_m2s_buffer. * Changed array serial_slave_buffer to structure serial_s2m_buffer. * Change keyboards/miniaxe/matrix.c I also made changes to quantum/split_comon/matrix.c to keyboards/miniaxe/matrix.c. Note: I contacted @ka2hiro, creator of miniaxe, and I got permission to change keyboards/miniaxe/matrix.c. * update history comment in quantum/split_common/serial.c * Revert "Add provisional Helix implementation to test the quantum/split_common." This reverts commit 168c82ef82c88e79979d9796bab9cc819cc2f685. * fix keyboards/miniaxe/matrix.c, quantum/split_common/matrix.c avr-gcc 4.9.[23] report error. avr-gcc 5.4.0, avr-gcc 7.3.0 pass. It is funny. * update comment quantum/split_common/serial.c * Reserve RGBLIGHT_SPLIT macro in quantum/split_common --- common_features.mk | 5 - keyboards/miniaxe/matrix.c | 59 ++- quantum/split_common/matrix.c | 61 ++- quantum/split_common/matrix.h | 31 ++ quantum/split_common/serial.c | 505 ++++++++++++++++----- quantum/split_common/serial.h | 65 ++- .../split_common/serial_backward_compatibility.h | 11 - quantum/split_common/split_util.c | 9 +- quantum/split_common/split_util.h | 3 - 9 files changed, 578 insertions(+), 171 deletions(-) create mode 100644 quantum/split_common/matrix.h delete mode 100644 quantum/split_common/serial_backward_compatibility.h diff --git a/common_features.mk b/common_features.mk index 73aab5d845..883681324b 100644 --- a/common_features.mk +++ b/common_features.mk @@ -263,11 +263,6 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes) endif ifeq ($(strip $(SPLIT_KEYBOARD)), yes) - SERIAL_BACKWARD_COMPAT := $(wildcard $(QUANTUM_DIR)/split_common/serial_backward_compatibility.h) - ifneq ($(SERIAL_BACKWARD_COMPAT),) - CONFIG_H += $(SERIAL_BACKWARD_COMPAT) - # $(info CONFIG_H=$(CONFIG_H)) - endif OPT_DEFS += -DSPLIT_KEYBOARD QUANTUM_SRC += $(QUANTUM_DIR)/split_common/split_flags.c \ $(QUANTUM_DIR)/split_common/split_util.c diff --git a/keyboards/miniaxe/matrix.c b/keyboards/miniaxe/matrix.c index 55c458e1fb..5fec1281df 100644 --- a/keyboards/miniaxe/matrix.c +++ b/keyboards/miniaxe/matrix.c @@ -32,9 +32,6 @@ along with this program. If not, see . #include "timer.h" #include "split_flags.h" -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" extern backlight_config_t backlight_config; @@ -55,6 +52,8 @@ along with this program. If not, see . static bool debouncing = false; #endif +#if defined(USE_I2C) || defined(EH) + #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) @@ -62,6 +61,27 @@ along with this program. If not, see . # define ROW_SHIFTER ((uint8_t)1) #else # error "Currently only supports 8 COLS" +#endif + +#else // USE_SERIAL + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + #endif static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -315,15 +335,39 @@ i2c_error: // the cable is disconnceted, or something else went wrong #else // USE_SERIAL + +typedef struct _Serial_s2m_buffer_t { + // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack + matrix_row_t smatrix[ROWS_PER_HAND]; +} Serial_s2m_buffer_t; + +volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; +volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; +uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, + sizeof(serial_s2m_buffer), (uint8_t *)&serial_s2m_buffer + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + int serial_transaction(void) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - if (serial_update_buffers()) { + if (soft_serial_transaction()) { return 1; } + // TODO: if MATRIX_COLS > 8 change to unpack() for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[slaveOffset+i] = serial_s2m_buffer.smatrix[i]; } #ifdef RGBLIGHT_ENABLE @@ -332,7 +376,7 @@ int serial_transaction(void) { #ifdef BACKLIGHT_ENABLE // Write backlight level for slave to read - serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; + serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; #endif return 0; @@ -375,8 +419,9 @@ void matrix_slave_scan(void) { i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; } #else // USE_SERIAL + // TODO: if MATRIX_COLS > 8 change to pack() for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_s2m_buffer.smatrix[i] = matrix[offset+i]; } #endif matrix_slave_scan_user(); diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index d6359b51fb..2611376386 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -32,9 +32,6 @@ along with this program. If not, see . #include "timer.h" #include "split_flags.h" -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" extern backlight_config_t backlight_config; @@ -55,6 +52,8 @@ along with this program. If not, see . static bool debouncing = false; #endif +#if defined(USE_I2C) || defined(EH) + #if (MATRIX_COLS <= 8) # define print_matrix_header() print("\nr/c 01234567\n") # define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) @@ -62,6 +61,27 @@ along with this program. If not, see . # define ROW_SHIFTER ((uint8_t)1) #else # error "Currently only supports 8 COLS" +#endif + +#else // USE_SERIAL + +#if (MATRIX_COLS <= 8) +# define print_matrix_header() print("\nr/c 01234567\n") +# define print_matrix_row(row) print_bin_reverse8(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop(matrix[i]) +# define ROW_SHIFTER ((uint8_t)1) +#elif (MATRIX_COLS <= 16) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse16(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop16(matrix[i]) +# define ROW_SHIFTER ((uint16_t)1) +#elif (MATRIX_COLS <= 32) +# define print_matrix_header() print("\nr/c 0123456789ABCDEF0123456789ABCDEF\n") +# define print_matrix_row(row) print_bin_reverse32(matrix_get_row(row)) +# define matrix_bitpop(i) bitpop32(matrix[i]) +# define ROW_SHIFTER ((uint32_t)1) +#endif + #endif static matrix_row_t matrix_debouncing[MATRIX_ROWS]; @@ -286,24 +306,48 @@ i2c_error: // the cable is disconnceted, or something else went wrong #else // USE_SERIAL + +typedef struct _Serial_s2m_buffer_t { + // TODO: if MATRIX_COLS > 8 change to uint8_t packed_matrix[] for pack/unpack + matrix_row_t smatrix[ROWS_PER_HAND]; +} Serial_s2m_buffer_t; + +volatile Serial_s2m_buffer_t serial_s2m_buffer = {}; +volatile Serial_m2s_buffer_t serial_m2s_buffer = {}; +uint8_t volatile status0 = 0; + +SSTD_t transactions[] = { + { (uint8_t *)&status0, + sizeof(serial_m2s_buffer), (uint8_t *)&serial_m2s_buffer, + sizeof(serial_s2m_buffer), (uint8_t *)&serial_s2m_buffer + } +}; + +void serial_master_init(void) +{ soft_serial_initiator_init(transactions, TID_LIMIT(transactions)); } + +void serial_slave_init(void) +{ soft_serial_target_init(transactions, TID_LIMIT(transactions)); } + int serial_transaction(void) { int slaveOffset = (isLeftHand) ? (ROWS_PER_HAND) : 0; - if (serial_update_buffers()) { + if (soft_serial_transaction()) { return 1; } + // TODO: if MATRIX_COLS > 8 change to unpack() for (int i = 0; i < ROWS_PER_HAND; ++i) { - matrix[slaveOffset+i] = serial_slave_buffer[i]; + matrix[slaveOffset+i] = serial_s2m_buffer.smatrix[i]; } - #ifdef RGBLIGHT_ENABLE + #if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) // Code to send RGB over serial goes here (not implemented yet) #endif #ifdef BACKLIGHT_ENABLE // Write backlight level for slave to read - serial_master_buffer[SERIAL_BACKLIT_START] = backlight_config.enable ? backlight_config.level : 0; + serial_m2s_buffer.backlight_level = backlight_config.enable ? backlight_config.level : 0; #endif return 0; @@ -346,8 +390,9 @@ void matrix_slave_scan(void) { i2c_slave_buffer[I2C_KEYMAP_START+i] = matrix[offset+i]; } #else // USE_SERIAL + // TODO: if MATRIX_COLS > 8 change to pack() for (int i = 0; i < ROWS_PER_HAND; ++i) { - serial_slave_buffer[i] = matrix[offset+i]; + serial_s2m_buffer.smatrix[i] = matrix[offset+i]; } #endif matrix_slave_scan_user(); diff --git a/quantum/split_common/matrix.h b/quantum/split_common/matrix.h new file mode 100644 index 0000000000..b5cb45baed --- /dev/null +++ b/quantum/split_common/matrix.h @@ -0,0 +1,31 @@ +#ifndef SPLIT_COMMON_MATRIX_H +#define SPLIT_COMMON_MATRIX_H + +#include + +#ifdef RGBLIGHT_ENABLE +# include "rgblight.h" +#endif + +typedef struct _Serial_m2s_buffer_t { +#ifdef BACKLIGHT_ENABLE + uint8_t backlight_level; +#endif +#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_SPLIT) + rgblight_config_t rgblight_config; //not yet use + // + // When MCUs on both sides drive their respective RGB LED chains, + // it is necessary to synchronize, so it is necessary to communicate RGB information. + // In that case, define the RGBLIGHT_SPLIT macro. + // + // Otherwise, if the master side MCU drives both sides RGB LED chains, + // there is no need to communicate. +#endif +} Serial_m2s_buffer_t; + +extern volatile Serial_m2s_buffer_t serial_m2s_buffer; + +void serial_master_init(void); +void serial_slave_init(void); + +#endif diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index 13e58d8259..4df8d103bd 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c @@ -1,5 +1,10 @@ /* * WARNING: be careful changing this code, it is very timing dependent + * + * 2018-10-28 checked + * avr-gcc 4.9.2 + * avr-gcc 5.4.0 + * avr-gcc 7.3.0 */ #ifndef F_CPU @@ -9,17 +14,19 @@ #include #include #include +#include #include #include "serial.h" +//#include #ifdef SOFT_SERIAL_PIN #ifdef __AVR_ATmega32U4__ // if using ATmega32U4 I2C, can not use PD0 and PD1 in soft serial. #ifdef USE_AVR_I2C - #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 - #error Using ATmega32U4 I2C, so can not use PD0, PD1 - #endif + #if SOFT_SERIAL_PIN == D0 || SOFT_SERIAL_PIN == D1 + #error Using ATmega32U4 I2C, so can not use PD0, PD1 + #endif #endif #if SOFT_SERIAL_PIN >= D0 && SOFT_SERIAL_PIN <= D3 @@ -63,215 +70,477 @@ #error serial.c now support ATmega32U4 only #endif -// Serial pulse period in microseconds. Its probably a bad idea to lower this -// value. -#define SERIAL_DELAY 24 +#define ALWAYS_INLINE __attribute__((always_inline)) +#define NO_INLINE __attribute__((noinline)) +#define _delay_sub_us(x) __builtin_avr_delay_cycles(x) + +// parity check +#define ODD_PARITY 1 +#define EVEN_PARITY 0 +#define PARITY EVEN_PARITY + +#ifdef SERIAL_DELAY + // custom setup in config.h + // #define TID_SEND_ADJUST 2 + // #define SERIAL_DELAY 6 // micro sec + // #define READ_WRITE_START_ADJUST 30 // cycles + // #define READ_WRITE_WIDTH_ADJUST 8 // cycles +#else +// ============ Standard setups ============ + +#ifndef SELECT_SOFT_SERIAL_SPEED +#define SELECT_SOFT_SERIAL_SPEED 1 +// 0: about 189kbps (Experiment only) +// 1: about 137kbps (default) +// 2: about 75kbps +// 3: about 39kbps +// 4: about 26kbps +// 5: about 20kbps +#endif -uint8_t volatile serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH] = {0}; -uint8_t volatile serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH] = {0}; +#if __GNUC__ < 6 + #define TID_SEND_ADJUST 14 +#else + #define TID_SEND_ADJUST 2 +#endif -#define SLAVE_DATA_CORRUPT (1<<0) -volatile uint8_t status = 0; +#if SELECT_SOFT_SERIAL_SPEED == 0 + // Very High speed + #define SERIAL_DELAY 4 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 34 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 1 + // High speed + #define SERIAL_DELAY 6 // micro sec + #if __GNUC__ < 6 + #define READ_WRITE_START_ADJUST 30 // cycles + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_START_ADJUST 33 // cycles + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 2 + // Middle speed + #define SERIAL_DELAY 12 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 3 + // Low speed + #define SERIAL_DELAY 24 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 4 + // Very Low speed + #define SERIAL_DELAY 36 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#elif SELECT_SOFT_SERIAL_SPEED == 5 + // Ultra Low speed + #define SERIAL_DELAY 48 // micro sec + #define READ_WRITE_START_ADJUST 30 // cycles + #if __GNUC__ < 6 + #define READ_WRITE_WIDTH_ADJUST 3 // cycles + #else + #define READ_WRITE_WIDTH_ADJUST 7 // cycles + #endif +#else +#error invalid SELECT_SOFT_SERIAL_SPEED value +#endif /* SELECT_SOFT_SERIAL_SPEED */ +#endif /* SERIAL_DELAY */ + +#define SERIAL_DELAY_HALF1 (SERIAL_DELAY/2) +#define SERIAL_DELAY_HALF2 (SERIAL_DELAY - SERIAL_DELAY/2) +#define SLAVE_INT_WIDTH_US 1 +#ifndef SERIAL_USE_MULTI_TRANSACTION + #define SLAVE_INT_RESPONSE_TIME SERIAL_DELAY +#else + #define SLAVE_INT_ACK_WIDTH_UNIT 2 + #define SLAVE_INT_ACK_WIDTH 4 +#endif + +static SSTD_t *Transaction_table = NULL; +static uint8_t Transaction_table_size = 0; + +inline static void serial_delay(void) ALWAYS_INLINE; inline static void serial_delay(void) { _delay_us(SERIAL_DELAY); } +inline static void serial_delay_half1(void) ALWAYS_INLINE; +inline static +void serial_delay_half1(void) { + _delay_us(SERIAL_DELAY_HALF1); +} + +inline static void serial_delay_half2(void) ALWAYS_INLINE; +inline static +void serial_delay_half2(void) { + _delay_us(SERIAL_DELAY_HALF2); +} + +inline static void serial_output(void) ALWAYS_INLINE; inline static void serial_output(void) { SERIAL_PIN_DDR |= SERIAL_PIN_MASK; } // make the serial pin an input with pull-up resistor +inline static void serial_input_with_pullup(void) ALWAYS_INLINE; inline static -void serial_input(void) { +void serial_input_with_pullup(void) { SERIAL_PIN_DDR &= ~SERIAL_PIN_MASK; SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } +inline static uint8_t serial_read_pin(void) ALWAYS_INLINE; inline static uint8_t serial_read_pin(void) { return !!(SERIAL_PIN_INPUT & SERIAL_PIN_MASK); } +inline static void serial_low(void) ALWAYS_INLINE; inline static void serial_low(void) { SERIAL_PIN_PORT &= ~SERIAL_PIN_MASK; } +inline static void serial_high(void) ALWAYS_INLINE; inline static void serial_high(void) { SERIAL_PIN_PORT |= SERIAL_PIN_MASK; } -void serial_master_init(void) { - serial_output(); - serial_high(); +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_output(); + serial_high(); } -void serial_slave_init(void) { - serial_input(); - - // Enable INT0 - EIMSK |= _BV(INT0); - // Trigger on falling edge of INT0 - EICRA &= ~(_BV(ISC00) | _BV(ISC01)); +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size) +{ + Transaction_table = sstd_table; + Transaction_table_size = (uint8_t)sstd_table_size; + serial_input_with_pullup(); + + // Enable INT0-INT3,INT6 + EIMSK |= EIMSK_BIT; +#if SERIAL_PIN_MASK == _BV(PE6) + // Trigger on falling edge of INT6 + EICRB &= EICRx_BIT; +#else + // Trigger on falling edge of INT0-INT3 + EICRA &= EICRx_BIT; +#endif } -// Used by the master to synchronize timing with the slave. +// Used by the sender to synchronize timing with the reciver. +static void sync_recv(void) NO_INLINE; static void sync_recv(void) { - serial_input(); - // This shouldn't hang if the slave disconnects because the - // serial line will float to high if the slave does disconnect. + for (uint8_t i = 0; i < SERIAL_DELAY*5 && serial_read_pin(); i++ ) { + } + // This shouldn't hang if the target disconnects because the + // serial line will float to high if the target does disconnect. while (!serial_read_pin()); - serial_delay(); } -// Used by the slave to send a synchronization signal to the master. +// Used by the reciver to send a synchronization signal to the sender. +static void sync_send(void) NO_INLINE; static void sync_send(void) { - serial_output(); - serial_low(); serial_delay(); - serial_high(); } // Reads a byte from the serial line -static -uint8_t serial_read_byte(void) { - uint8_t byte = 0; - serial_input(); - for ( uint8_t i = 0; i < 8; ++i) { - byte = (byte << 1) | serial_read_pin(); - serial_delay(); - _delay_us(1); +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) NO_INLINE; +static uint8_t serial_read_chunk(uint8_t *pterrcount, uint8_t bit) { + uint8_t byte, i, p, pb; + + _delay_sub_us(READ_WRITE_START_ADJUST); + for( i = 0, byte = 0, p = PARITY; i < bit; i++ ) { + serial_delay_half1(); // read the middle of pulses + if( serial_read_pin() ) { + byte = (byte << 1) | 1; p ^= 1; + } else { + byte = (byte << 1) | 0; p ^= 0; + } + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); } + /* recive parity bit */ + serial_delay_half1(); // read the middle of pulses + pb = serial_read_pin(); + _delay_sub_us(READ_WRITE_WIDTH_ADJUST); + serial_delay_half2(); + + *pterrcount += (p != pb)? 1 : 0; return byte; } // Sends a byte with MSB ordering -static -void serial_write_byte(uint8_t data) { - uint8_t b = 8; - serial_output(); - while( b-- ) { - if(data & (1 << b)) { - serial_high(); - } else { - serial_low(); +void serial_write_chunk(uint8_t data, uint8_t bit) NO_INLINE; +void serial_write_chunk(uint8_t data, uint8_t bit) { + uint8_t b, p; + for( p = PARITY, b = 1<<(bit-1); b ; b >>= 1) { + if(data & b) { + serial_high(); p ^= 1; + } else { + serial_low(); p ^= 0; + } + serial_delay(); } + /* send parity bit */ + if(p & 1) { serial_high(); } + else { serial_low(); } serial_delay(); - } -} -// interrupt handle to be used by the slave device -ISR(SERIAL_PIN_INTERRUPT) { - sync_send(); + serial_low(); // sync_send() / senc_recv() need raise edge +} - uint8_t checksum = 0; - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_slave_buffer[i]); +static void serial_send_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +void serial_send_packet(uint8_t *buffer, uint8_t size) { + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + data = buffer[i]; sync_send(); - checksum += serial_slave_buffer[i]; + serial_write_chunk(data,8); } - serial_write_byte(checksum); - sync_send(); +} - // wait for the sync to finish sending - serial_delay(); +static uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) NO_INLINE; +static +uint8_t serial_recive_packet(uint8_t *buffer, uint8_t size) { + uint8_t pecount = 0; + for (uint8_t i = 0; i < size; ++i) { + uint8_t data; + sync_recv(); + data = serial_read_chunk(&pecount, 8); + buffer[i] = data; + } + return pecount == 0; +} - // read the middle of pulses - _delay_us(SERIAL_DELAY/2); +inline static +void change_sender2reciver(void) { + sync_send(); //0 + serial_delay_half1(); //1 + serial_low(); //2 + serial_input_with_pullup(); //2 + serial_delay_half1(); //3 +} - uint8_t checksum_computed = 0; - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_master_buffer[i] = serial_read_byte(); - sync_send(); - checksum_computed += serial_master_buffer[i]; +inline static +void change_reciver2sender(void) { + sync_recv(); //0 + serial_delay(); //1 + serial_low(); //3 + serial_output(); //3 + serial_delay_half1(); //4 +} + +static inline uint8_t nibble_bits_count(uint8_t bits) +{ + bits = (bits & 0x5) + (bits >> 1 & 0x5); + bits = (bits & 0x3) + (bits >> 2 & 0x3); + return bits; +} + +// interrupt handle to be used by the target device +ISR(SERIAL_PIN_INTERRUPT) { + +#ifndef SERIAL_USE_MULTI_TRANSACTION + serial_low(); + serial_output(); + SSTD_t *trans = Transaction_table; +#else + // recive transaction table index + uint8_t tid, bits; + uint8_t pecount = 0; + sync_recv(); + bits = serial_read_chunk(&pecount,7); + tid = bits>>3; + bits = (bits&7) != nibble_bits_count(tid); + if( bits || pecount> 0 || tid > Transaction_table_size ) { + return; } - uint8_t checksum_received = serial_read_byte(); - sync_send(); + serial_delay_half1(); - serial_input(); // end transaction + serial_high(); // response step1 low->high + serial_output(); + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT*SLAVE_INT_ACK_WIDTH); + SSTD_t *trans = &Transaction_table[tid]; + serial_low(); // response step2 ack high->low +#endif - if ( checksum_computed != checksum_received ) { - status |= SLAVE_DATA_CORRUPT; + // target send phase + if( trans->target2initiator_buffer_size > 0 ) + serial_send_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size); + // target switch to input + change_sender2reciver(); + + // target recive phase + if( trans->initiator2target_buffer_size > 0 ) { + if (serial_recive_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size) ) { + *trans->status = TRANSACTION_ACCEPTED; + } else { + *trans->status = TRANSACTION_DATA_ERROR; + } } else { - status &= ~SLAVE_DATA_CORRUPT; + *trans->status = TRANSACTION_ACCEPTED; } -} -inline -bool serial_slave_DATA_CORRUPT(void) { - return status & SLAVE_DATA_CORRUPT; + sync_recv(); //weit initiator output to high } -// Copies the serial_slave_buffer to the master and sends the -// serial_master_buffer to the slave. +///////// +// start transaction by initiator +// +// int soft_serial_transaction(int sstd_index) // // Returns: -// 0 => no error -// 1 => slave did not respond -int serial_update_buffers(void) { - // this code is very time dependent, so we need to disable interrupts +// TRANSACTION_END +// TRANSACTION_NO_RESPONSE +// TRANSACTION_DATA_ERROR +// this code is very time dependent, so we need to disable interrupts +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void) { + SSTD_t *trans = Transaction_table; +#else +int soft_serial_transaction(int sstd_index) { + if( sstd_index > Transaction_table_size ) + return TRANSACTION_TYPE_ERROR; + SSTD_t *trans = &Transaction_table[sstd_index]; +#endif cli(); - // signal to the slave that we want to start a transaction + // signal to the target that we want to start a transaction serial_output(); serial_low(); - _delay_us(1); + _delay_us(SLAVE_INT_WIDTH_US); - // wait for the slaves response - serial_input(); - serial_high(); - _delay_us(SERIAL_DELAY); +#ifndef SERIAL_USE_MULTI_TRANSACTION + // wait for the target response + serial_input_with_pullup(); + _delay_us(SLAVE_INT_RESPONSE_TIME); - // check if the slave is present + // check if the target is present if (serial_read_pin()) { - // slave failed to pull the line low, assume not present + // target failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; sei(); - return 1; + return TRANSACTION_NO_RESPONSE; } - // if the slave is present syncronize with it - sync_recv(); - - uint8_t checksum_computed = 0; - // receive data from the slave - for (int i = 0; i < SERIAL_SLAVE_BUFFER_LENGTH; ++i) { - serial_slave_buffer[i] = serial_read_byte(); - sync_recv(); - checksum_computed += serial_slave_buffer[i]; +#else + // send transaction table index + int tid = (sstd_index<<3) | (7 & nibble_bits_count(sstd_index)); + sync_send(); + _delay_sub_us(TID_SEND_ADJUST); + serial_write_chunk(tid, 7); + serial_delay_half1(); + + // wait for the target response (step1 low->high) + serial_input_with_pullup(); + while( !serial_read_pin() ) { + _delay_sub_us(2); } - uint8_t checksum_received = serial_read_byte(); - sync_recv(); - if (checksum_computed != checksum_received) { - sei(); - return 1; + // check if the target is present (step2 high->low) + for( int i = 0; serial_read_pin(); i++ ) { + if (i > SLAVE_INT_ACK_WIDTH + 1) { + // slave failed to pull the line low, assume not present + serial_output(); + serial_high(); + *trans->status = TRANSACTION_NO_RESPONSE; + sei(); + return TRANSACTION_NO_RESPONSE; + } + _delay_sub_us(SLAVE_INT_ACK_WIDTH_UNIT); } +#endif - uint8_t checksum = 0; - // send data to the slave - for (int i = 0; i < SERIAL_MASTER_BUFFER_LENGTH; ++i) { - serial_write_byte(serial_master_buffer[i]); - sync_recv(); - checksum += serial_master_buffer[i]; + // initiator recive phase + // if the target is present syncronize with it + if( trans->target2initiator_buffer_size > 0 ) { + if (!serial_recive_packet((uint8_t *)trans->target2initiator_buffer, + trans->target2initiator_buffer_size) ) { + serial_output(); + serial_high(); + *trans->status = TRANSACTION_DATA_ERROR; + sei(); + return TRANSACTION_DATA_ERROR; + } + } + + // initiator switch to output + change_reciver2sender(); + + // initiator send phase + if( trans->initiator2target_buffer_size > 0 ) { + serial_send_packet((uint8_t *)trans->initiator2target_buffer, + trans->initiator2target_buffer_size); } - serial_write_byte(checksum); - sync_recv(); // always, release the line when not in use - serial_output(); - serial_high(); + sync_send(); + *trans->status = TRANSACTION_END; sei(); - return 0; + return TRANSACTION_END; } -#endif /* SOFT_SERIAL_PIN */ +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index) { + SSTD_t *trans = &Transaction_table[sstd_index]; + cli(); + int retval = *trans->status; + *trans->status = 0;; + sei(); + return retval; +} +#endif + +#endif + +// Helix serial.c history +// 2018-1-29 fork from let's split and add PD2, modify sync_recv() (#2308, bceffdefc) +// 2018-6-28 bug fix master to slave comm and speed up (#3255, 1038bbef4) +// (adjusted with avr-gcc 4.9.2) +// 2018-7-13 remove USE_SERIAL_PD2 macro (#3374, f30d6dd78) +// (adjusted with avr-gcc 4.9.2) +// 2018-8-11 add support multi-type transaction (#3608, feb5e4aae) +// (adjusted with avr-gcc 4.9.2) +// 2018-10-21 fix serial and RGB animation conflict (#4191, 4665e4fff) +// (adjusted with avr-gcc 7.3.0) +// 2018-10-28 re-adjust compiler depend value of delay (#4269, 8517f8a66) +// (adjusted with avr-gcc 5.4.0, 7.3.0) +// 2018-12-17 copy to TOP/quantum/split_common/ and remove backward compatibility code (#4669) diff --git a/quantum/split_common/serial.h b/quantum/split_common/serial.h index 0b99f352d0..b6638b3bde 100644 --- a/quantum/split_common/serial.h +++ b/quantum/split_common/serial.h @@ -1,5 +1,5 @@ -#ifndef MY_SERIAL_H -#define MY_SERIAL_H +#ifndef SOFT_SERIAL_H +#define SOFT_SERIAL_H #include @@ -7,20 +7,59 @@ // Need Soft Serial defines in config.h // ///////////////////////////////////////////////////////////////// // ex. -// /* Configuration of lower interface with the lower layer(hardware) of serial.c */ // #define SOFT_SERIAL_PIN ?? // ?? = D0,D1,D2,D3,E6 +// OPTIONAL: #define SELECT_SOFT_SERIAL_SPEED ? // ? = 1,2,3,4,5 +// // 1: about 137kbps (default) +// // 2: about 75kbps +// // 3: about 39kbps +// // 4: about 26kbps +// // 5: about 20kbps // -// /* Configuration of upper interface with the upper layer of serial.c */ -// #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 -// #define SERIAL_MASTER_BUFFER_LENGTH 1 +// //// USE simple API (using signle-type transaction function) +// /* nothing */ +// //// USE flexible API (using multi-type transaction function) +// #define SERIAL_USE_MULTI_TRANSACTION +// +// ///////////////////////////////////////////////////////////////// -// Buffers for master - slave communication -extern volatile uint8_t serial_slave_buffer[SERIAL_SLAVE_BUFFER_LENGTH]; -extern volatile uint8_t serial_master_buffer[SERIAL_MASTER_BUFFER_LENGTH]; +// Soft Serial Transaction Descriptor +typedef struct _SSTD_t { + uint8_t *status; + uint8_t initiator2target_buffer_size; + uint8_t *initiator2target_buffer; + uint8_t target2initiator_buffer_size; + uint8_t *target2initiator_buffer; +} SSTD_t; +#define TID_LIMIT( table ) (sizeof(table) / sizeof(SSTD_t)) -void serial_master_init(void); -void serial_slave_init(void); -int serial_update_buffers(void); -bool serial_slave_data_corrupt(void); +// initiator is transaction start side +void soft_serial_initiator_init(SSTD_t *sstd_table, int sstd_table_size); +// target is interrupt accept side +void soft_serial_target_init(SSTD_t *sstd_table, int sstd_table_size); +// initiator resullt +#define TRANSACTION_END 0 +#define TRANSACTION_NO_RESPONSE 0x1 +#define TRANSACTION_DATA_ERROR 0x2 +#define TRANSACTION_TYPE_ERROR 0x4 +#ifndef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_transaction(void); +#else +int soft_serial_transaction(int sstd_index); #endif + +// target status +// *SSTD_t.status has +// initiator: +// TRANSACTION_END +// or TRANSACTION_NO_RESPONSE +// or TRANSACTION_DATA_ERROR +// target: +// TRANSACTION_DATA_ERROR +// or TRANSACTION_ACCEPTED +#define TRANSACTION_ACCEPTED 0x8 +#ifdef SERIAL_USE_MULTI_TRANSACTION +int soft_serial_get_and_clean_status(int sstd_index); +#endif + +#endif /* SOFT_SERIAL_H */ diff --git a/quantum/split_common/serial_backward_compatibility.h b/quantum/split_common/serial_backward_compatibility.h deleted file mode 100644 index 216b6c41ff..0000000000 --- a/quantum/split_common/serial_backward_compatibility.h +++ /dev/null @@ -1,11 +0,0 @@ -/* serial.h backward compatibility */ - -// #ifndef SOFT_SERIAL_PIN -// #define SOFT_SERIAL_PIN D0 -// #endif - -#ifndef SERIAL_SLAVE_BUFFER_LENGTH - #define SERIAL_SLAVE_BUFFER_LENGTH MATRIX_ROWS/2 - #define SERIAL_MASTER_BUFFER_LENGTH 1 -#endif - diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 56077e4f20..e4475c5356 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -11,9 +11,6 @@ #include "timer.h" #include "split_flags.h" -#ifdef RGBLIGHT_ENABLE -# include "rgblight.h" -#endif #ifdef BACKLIGHT_ENABLE # include "backlight.h" #endif @@ -24,8 +21,6 @@ #if defined(USE_I2C) || defined(EH) # include "i2c.h" -#else -# include "serial.h" #endif volatile bool isLeftHand = true; @@ -112,7 +107,7 @@ void keyboard_slave_loop(void) { BACKLIT_DIRTY = false; } #else // USE_SERIAL - backlight_set(serial_master_buffer[SERIAL_BACKLIT_START]); + backlight_set(serial_m2s_buffer.backlight_level); #endif #endif // Read RGB Info @@ -137,7 +132,9 @@ void keyboard_slave_loop(void) { sei(); } #else // USE_SERIAL + #ifdef RGBLIGHT_SPLIT // Add serial implementation for RGB here + #endif #endif #endif } diff --git a/quantum/split_common/split_util.h b/quantum/split_common/split_util.h index 45e8db0f2f..d6cf3e72a9 100644 --- a/quantum/split_common/split_util.h +++ b/quantum/split_common/split_util.h @@ -7,9 +7,6 @@ #include #include "eeconfig.h" -// backlight level store index in serial_master_buffer[] for slave to read -#define SERIAL_BACKLIT_START 0x00 - #define SLAVE_I2C_ADDRESS 0x32 extern volatile bool isLeftHand; -- cgit v1.2.3 From 41dee98ec4d621c04541628bda70f06e703eab34 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Mon, 24 Dec 2018 14:27:35 -0800 Subject: Redox: Configurator bugfix (#4721) --- keyboards/redox/info.json | 87 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 86 insertions(+), 1 deletion(-) diff --git a/keyboards/redox/info.json b/keyboards/redox/info.json index f75d88a6be..f91017365a 100644 --- a/keyboards/redox/info.json +++ b/keyboards/redox/info.json @@ -6,7 +6,92 @@ "height": 6.25, "layouts": { "LAYOUT": { - "layout": [{"label":"[L2] `", "x":0, "y":0.375, "w":1.25}, {"label":"!", "x":1.25, "y":0.375}, {"label":"@", "x":2.25, "y":0.125}, {"label":"#", "x":3.25, "y":0}, {"label":"$", "x":4.25, "y":0.125}, {"label":"%", "x":5.25, "y":0.25}, {"label":"[L1]", "x":6.25, "y":0.75}, {"label":"[L1]", "x":11.25, "y":0.75}, {"label":"^", "x":12.25, "y":0.25}, {"label":"&", "x":13.25, "y":0.125}, {"label":"*", "x":14.25, "y":0}, {"label":"(", "x":15.25, "y":0.125}, {"label":")", "x":16.25, "y":0.375}, {"label":"[L2] -", "x":17.25, "y":0.375, "w":1.25}, {"label":"Tab", "x":0, "y":1.375, "w":1.25}, {"label":"Q", "x":1.25, "y":1.375}, {"label":"W", "x":2.25, "y":1.125}, {"label":"E", "x":3.25, "y":1}, {"label":"R", "x":4.25, "y":1.125}, {"label":"T", "x":5.25, "y":1.25}, {"label":"[", "x":6.25, "y":1.75, "h":1.5}, {"label":"]", "x":11.25, "y":1.75, "h":1.5}, {"label":"Y", "x":12.25, "y":1.25}, {"label":"U", "x":13.25, "y":1.125}, {"label":"I", "x":14.25, "y":1}, {"label":"O", "x":15.25, "y":1.125}, {"label":"P", "x":16.25, "y":1.375}, {"label":"=", "x":17.25, "y":1.375, "w":1.25}, {"label":"Esc", "x":0, "y":2.375, "w":1.25}, {"label":"A", "x":1.25, "y":2.375}, {"label":"S", "x":2.25, "y":2.125}, {"label":"D", "x":3.25, "y":2}, {"label":"F", "x":4.25, "y":2.125}, {"label":"G", "x":5.25, "y":2.25}, {"label":"PgUp", "x":6.75, "y":3.75}, {"label":"End", "x":10.75, "y":3.75}, {"label":"H", "x":12.25, "y":2.25}, {"label":"J", "x":13.25, "y":2.125}, {"label":"K", "x":14.25, "y":2}, {"label":"L", "x":15.25, "y":2.125}, {"label":":", "x":16.25, "y":2.375}, {"label":"'", "x":17.25, "y":2.375, "w":1.25}, {"label":"Shift", "x":0, "y":3.375, "w":1.25}, {"label":"Z", "x":1.25, "y":3.375}, {"label":"X", "x":2.25, "y":3.125}, {"label":"C", "x":3.25, "y":3}, {"label":"V", "x":4.25, "y":3.125}, {"label":"B", "x":5.25, "y":3.25}, {"label":"PgDn", "x":7.75, "y":3.75}, {"label":"Home", "x":9.75, "y":3.75}, {"label":"N", "x":12.25, "y":3.25}, {"label":"M", "x":13.25, "y":3.125}, {"label":"<", "x":14.25, "y":3}, {"label":">", "x":15.25, "y":3.125}, {"label":"?", "x":16.25, "y":3.375}, {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, {"label":"GUI", "x":0.25, "y":4.375}, {"label":"+", "x":1.25, "y":4.375}, {"label":"-", "x":2.25, "y":4.125}, {"label":"[Alt] *", "x":3.25, "y":4}, {"label":"[Ctrl] /", "x":5.5, "y":5.25, "w":1.25}, {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, {"label":"Del", "x":7.75, "y":4.75, "h":1.5}, {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, {"label":"Alt", "x":11.75, "y":5.25, "w":1.25}, {"label":"Left", "x":14.25, "y":4}, {"label":"Down", "x":15.25, "y":4.125}, {"label":"Up", "x":16.25, "y":4.375}, {"label":"Right", "x":17.25, "y":4.375}] + "layout": [ + {"label":"_Nav || `", "x":0, "y":0.375, "w":1.25}, + {"label":"1", "x":1.25, "y":0.375}, + {"label":"2", "x":2.25, "y":0.125}, + {"label":"3", "x":3.25, "y":0}, + {"label":"4", "x":4.25, "y":0.125}, + {"label":"5", "x":5.25, "y":0.25}, + + {"label":"6", "x":12.25, "y":0.25}, + {"label":"7", "x":13.25, "y":0.125}, + {"label":"8", "x":14.25, "y":0}, + {"label":"9", "x":15.25, "y":0.125}, + {"label":"0", "x":16.25, "y":0.375}, + {"label":"_Nav || -", "x":17.25, "y":0.375, "w":1.25}, + + {"label":"Tab", "x":0, "y":1.375, "w":1.25}, + {"label":"Q", "x":1.25, "y":1.375}, + {"label":"W", "x":2.25, "y":1.125}, + {"label":"E", "x":3.25, "y":1}, + {"label":"R", "x":4.25, "y":1.125}, + {"label":"T", "x":5.25, "y":1.25}, + {"label":"MO(_SYMB)", "x":6.25, "y":0.75}, + + {"label":"MO(_SYMB)", "x":11.25, "y":0.75}, + {"label":"Y", "x":12.25, "y":1.25}, + {"label":"U", "x":13.25, "y":1.125}, + {"label":"I", "x":14.25, "y":1}, + {"label":"O", "x":15.25, "y":1.125}, + {"label":"P", "x":16.25, "y":1.375}, + {"label":"=", "x":17.25, "y":1.375, "w":1.25}, + + {"label":"Esc", "x":0, "y":2.375, "w":1.25}, + {"label":"A", "x":1.25, "y":2.375}, + {"label":"S", "x":2.25, "y":2.125}, + {"label":"D", "x":3.25, "y":2}, + {"label":"F", "x":4.25, "y":2.125}, + {"label":"G", "x":5.25, "y":2.25}, + {"label":"[", "x":6.25, "y":1.75, "h":1.5}, + + {"label":"]", "x":11.25, "y":1.75, "h":1.5}, + {"label":"H", "x":12.25, "y":2.25}, + {"label":"J", "x":13.25, "y":2.125}, + {"label":"K", "x":14.25, "y":2}, + {"label":"L", "x":15.25, "y":2.125}, + {"label":";", "x":16.25, "y":2.375}, + {"label":"'", "x":17.25, "y":2.375, "w":1.25}, + + {"label":"Shift", "x":0, "y":3.375, "w":1.25}, + {"label":"Z", "x":1.25, "y":3.375}, + {"label":"X", "x":2.25, "y":3.125}, + {"label":"C", "x":3.25, "y":3}, + {"label":"V", "x":4.25, "y":3.125}, + {"label":"B", "x":5.25, "y":3.25}, + + {"label":"_Adjust/Page Up", "x":6.75, "y":3.75}, + {"label":"Page Down", "x":7.75, "y":3.75}, + + {"label":"Home", "x":9.75, "y":3.75}, + {"label":"_Adjust/End", "x":10.75, "y":3.75}, + + {"label":"N", "x":12.25, "y":3.25}, + {"label":"M", "x":13.25, "y":3.125}, + {"label":",", "x":14.25, "y":3}, + {"label":",", "x":15.25, "y":3.125}, + {"label":"\\", "x":16.25, "y":3.375}, + {"label":"Shift", "x":17.25, "y":3.375, "w":1.25}, + + {"label":"LGUI", "x":0.25, "y":4.375}, + {"label":"P+", "x":1.25, "y":4.375}, + {"label":"P-", "x":2.25, "y":4.125}, + {"label":"LAlt || P*", "x":3.25, "y":4}, + + {"label":"LCtrl || P/", "x":5.5, "y":5.25, "w":1.25}, + {"label":"Backspace", "x":6.75, "y":4.75, "h":1.5}, + {"label":"Delete", "x":7.75, "y":4.75, "h":1.5}, + + {"label":"Enter", "x":9.75, "y":4.75, "h":1.5}, + {"label":"Space", "x":10.75, "y":4.75, "h":1.5}, + {"label":"RAlt", "x":11.75, "y":5.25, "w":1.25}, + + {"label":"Left", "x":14.25, "y":4}, + {"label":"Down", "x":15.25, "y":4.125}, + {"label":"Up", "x":16.25, "y":4.375}, + {"label":"Right", "x":17.25, "y":4.375} + ] } } } + -- cgit v1.2.3 From 08e9fc142c89e783fdad3ecda0639bdf5c2e4c50 Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Mon, 24 Dec 2018 14:49:03 -0800 Subject: Add tsangan layout to dz60 with a "sane" default keymap (#4717) --- keyboards/dz60/dz60.h | 27 +++++++++++++++++++++++++ keyboards/dz60/info.json | 4 ++++ keyboards/dz60/keymaps/60_tsangan/keymap.c | 32 ++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100644 keyboards/dz60/keymaps/60_tsangan/keymap.c diff --git a/keyboards/dz60/dz60.h b/keyboards/dz60/dz60.h index 50e80bed8f..202bd1db4d 100644 --- a/keyboards/dz60/dz60.h +++ b/keyboards/dz60/dz60.h @@ -332,6 +332,33 @@ { k40, k41, KC_NO, k43, k44, KC_NO, k46, KC_NO, k48, KC_NO, k4a, k4b, k4c, k4d, k4e } \ } +/* LAYOUT_60_tsangan + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───────┐ + * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │ 0e │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─────┤ + * │10 │12 │13 │14 │15 │16 │17 │18 │19 │1a │1b │1c │1d │1e │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │20 │22 │23 │24 │25 │26 │27 │28 │29 │2a │2b │2c │2d │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │30 │32 │33 │34 │35 │36 │37 │38 │39 │3a │3b │3d │3e │ + * ├─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┤ + * │40 │41 │43 │46 (7u) │4b │4d │4e │ + * └─────┴───┴─────┴───────────────────────────┴─────┴───┴─────┘ +*/ +#define LAYOUT_60_tsangan( \ + k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, k0e, \ + k10, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e, \ + k20, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, \ + k30, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, k3d, k3e, \ + k40, k41, k43, k46, k4b, k4d, k4e \ +) { \ + { k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0a, k0b, k0c, KC_NO, k0e }, \ + { k10, KC_NO, k12, k13, k14, k15, k16, k17, k18, k19, k1a, k1b, k1c, k1d, k1e }, \ + { k20, KC_NO, k22, k23, k24, k25, k26, k27, k28, k29, k2a, k2b, k2c, k2d, KC_NO }, \ + { k30, KC_NO, k32, k33, k34, k35, k36, k37, k38, k39, k3a, k3b, KC_NO, k3d, k3e }, \ + { k40, k41, KC_NO, k43, KC_NO, KC_NO, k46, KC_NO, KC_NO, KC_NO, KC_NO, k4b, KC_NO, k4d, k4e } \ +} + /* LAYOUT_60_tsangan_hhkb * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ * │00 │01 │02 │03 │04 │05 │06 │07 │08 │09 │0a │0b │0c │0d │0e │ diff --git a/keyboards/dz60/info.json b/keyboards/dz60/info.json index d1139fd1fe..6a30234962 100644 --- a/keyboards/dz60/info.json +++ b/keyboards/dz60/info.json @@ -53,6 +53,10 @@ "key_count": 67, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"1", "x":1, "y":0}, {"label":"2", "x":2, "y":0}, {"label":"3", "x":3, "y":0}, {"label":"4", "x":4, "y":0}, {"label":"5", "x":5, "y":0}, {"label":"6", "x":6, "y":0}, {"label":"7", "x":7, "y":0}, {"label":"8", "x":8, "y":0}, {"label":"9", "x":9, "y":0}, {"label":"0", "x":10, "y":0}, {"label":"-", "x":11, "y":0}, {"label":"=", "x":12, "y":0}, {"x":13, "y":0}, {"label":"Back Space", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"[", "x":11.5, "y":1}, {"label":"]", "x":12.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":";", "x":10.75, "y":2}, {"label":"'", "x":11.75, "y":2}, {"label":"#", "x":12.75, "y":2}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Shift", "x":0, "y":3, "w":1.25}, {"label":"\\", "x":1.25, "y":3}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":",", "x":9.25, "y":3}, {"label":".", "x":10.25, "y":3}, {"label":"Shift", "x":11.25, "y":3, "w":1.75}, {"label":"Up", "x":13, "y":3}, {"label":"Del", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.25}, {"label":"GUI", "x":1.25, "y":4, "w":1.25}, {"label":"Alt", "x":2.5, "y":4, "w":1.25}, {"label":"Space", "x":3.75, "y":4, "w":2.25}, {"label":"Space", "x":6, "y":4, "w":1.25}, {"label":"Space", "x":7.25, "y":4, "w":2.75}, {"label":"AltGr", "x":10, "y":4}, {"label":"Fn", "x":11, "y":4}, {"label":"Left", "x":12, "y":4}, {"label":"Down", "x":13, "y":4}, {"label":"Right", "x":14, "y":4}] }, + "LAYOUT_60_tsangan": { + "keycount": 61, + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"|", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Alt", "x":11, "y":4, "w":1.5}, {"label":"Win", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] + }, "LAYOUT_60_tsangan_hhkb": { "key_count": 62, "layout": [{"label":"Esc", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"|", "x":13, "y":0}, {"label":"~", "x":14, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Backspace", "x":13.5, "y":1, "w":1.5}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"Enter", "x":12.75, "y":2, "w":2.25}, {"label":"Shift", "x":0, "y":3, "w":2.25}, {"label":"Z", "x":2.25, "y":3}, {"label":"X", "x":3.25, "y":3}, {"label":"C", "x":4.25, "y":3}, {"label":"V", "x":5.25, "y":3}, {"label":"B", "x":6.25, "y":3}, {"label":"N", "x":7.25, "y":3}, {"label":"M", "x":8.25, "y":3}, {"label":"<", "x":9.25, "y":3}, {"label":">", "x":10.25, "y":3}, {"label":"?", "x":11.25, "y":3}, {"label":"Shift", "x":12.25, "y":3, "w":1.75}, {"label":"Fn", "x":14, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4}, {"label":"Alt", "x":2.5, "y":4, "w":1.5}, {"x":4, "y":4, "w":7}, {"label":"Win", "x":11, "y":4, "w":1.5}, {"label":"Menu", "x":12.5, "y":4}, {"label":"Ctrl", "x":13.5, "y":4, "w":1.5}] diff --git a/keyboards/dz60/keymaps/60_tsangan/keymap.c b/keyboards/dz60/keymaps/60_tsangan/keymap.c new file mode 100644 index 0000000000..dfbc51dd99 --- /dev/null +++ b/keyboards/dz60/keymaps/60_tsangan/keymap.c @@ -0,0 +1,32 @@ +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_tsangan( + KC_GESC, 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_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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL + ), + [_FL] = LAYOUT_60_tsangan( + KC_GRV, 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_DEL, + _______, _______, KC_UP, _______, _______, _______, _______, _______, _______, _______, KC_PSCR, KC_SLCK, KC_PAUS, RESET, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_INS, KC_HOME, KC_PGUP, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, KC_PGDN, _______, _______, + _______, _______, _______, _______, _______, MO(_CL), _______ + ), + [_CL] = LAYOUT_60_tsangan( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, BL_DEC, BL_TOGG, BL_INC, BL_STEP, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______ + ) +}; -- cgit v1.2.3 From de78d9e1ffbeff34991413641c794a36e9fc5f9d Mon Sep 17 00:00:00 2001 From: TerryMathews Date: Tue, 25 Dec 2018 13:42:48 -0500 Subject: Chibios_test/stm32_f072_onekey: Add support for reset to bootloader (#4238) * Add support for reset to bootloader Chibios_test/STM32_F072_ONEKEY wouldn't reset to bootloader on a compatible Discovery board because the Chibios library board file was lacking the __early_init(void) function necessary to read the magic key. Borrowed code from Clueboard 60, tested working. * Remove board.chcfg --- .../boards/ST_STM32F072B_DISCOVERY/board.c | 111 +++ .../boards/ST_STM32F072B_DISCOVERY/board.h | 923 +++++++++++++++++++++ .../boards/ST_STM32F072B_DISCOVERY/board.mk | 5 + 3 files changed, 1039 insertions(+) create mode 100644 keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c create mode 100644 keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h create mode 100644 keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c new file mode 100644 index 0000000000..7e9f90853e --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.c @@ -0,0 +1,111 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#include "hal.h" + +#if HAL_USE_PAL || defined(__DOXYGEN__) +/** + * @brief PAL setup. + * @details Digital I/O ports static configuration as defined in @p board.h. + * This variable is used by the HAL when initializing the PAL driver. + */ +const PALConfig pal_default_config = { +#if STM32_HAS_GPIOA + {VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, + VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH}, +#endif +#if STM32_HAS_GPIOB + {VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, + VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH}, +#endif +#if STM32_HAS_GPIOC + {VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, + VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH}, +#endif +#if STM32_HAS_GPIOD + {VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, + VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH}, +#endif +#if STM32_HAS_GPIOE + {VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, + VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH}, +#endif +#if STM32_HAS_GPIOF + {VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, + VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH}, +#endif +#if STM32_HAS_GPIOG + {VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, + VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH}, +#endif +#if STM32_HAS_GPIOH + {VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, + VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH}, +#endif +#if STM32_HAS_GPIOI + {VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, + VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH} +#endif +}; +#endif + +void enter_bootloader_mode_if_requested(void); + +/** + * @brief Early initialization code. + * @details This initialization must be performed just after stack setup + * and before any other initialization. + */ +void __early_init(void) { + enter_bootloader_mode_if_requested(); + stm32_clock_init(); +} + + + +#if HAL_USE_MMC_SPI || defined(__DOXYGEN__) +/** + * @brief MMC_SPI card detection. + */ +bool mmc_lld_is_card_inserted(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return true; +} + +/** + * @brief MMC_SPI card write protection detection. + */ +bool mmc_lld_is_write_protected(MMCDriver *mmcp) { + + (void)mmcp; + /* TODO: Fill the implementation.*/ + return false; +} +#endif + +/** + * @brief Board-specific initialization code. + * @todo Add your board-specific code, if any. + */ +void boardInit(void) { +} diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h new file mode 100644 index 0000000000..173f7b6054 --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.h @@ -0,0 +1,923 @@ +/* + ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +/* + * This file has been automatically generated using ChibiStudio board + * generator plugin. Do not edit manually. + */ + +#ifndef BOARD_H +#define BOARD_H + +/* + * Setup for ST STM32F072B-Discovery board. + */ + +/* + * Board identifier. + */ +#define BOARD_ST_STM32F072B_DISCOVERY +#define BOARD_NAME "ST STM32F072B-Discovery" + +/* + * Board oscillators-related settings. + * NOTE: LSE not fitted. + * NOTE: HSE not fitted. + */ +#if !defined(STM32_LSECLK) +#define STM32_LSECLK 0U +#endif + +#define STM32_LSEDRV (3U << 3U) + +#if !defined(STM32_HSECLK) +#define STM32_HSECLK 0U +#endif + +#define STM32_HSE_BYPASS + +/* + * MCU type as defined in the ST header. + */ +#define STM32F072xB + +/* + * IO pins assignments. + */ +#define GPIOA_BUTTON 0U +#define GPIOA_PIN1 1U +#define GPIOA_PIN2 2U +#define GPIOA_PIN3 3U +#define GPIOA_PIN4 4U +#define GPIOA_PIN5 5U +#define GPIOA_PIN6 6U +#define GPIOA_PIN7 7U +#define GPIOA_PIN8 8U +#define GPIOA_PIN9 9U +#define GPIOA_PIN10 10U +#define GPIOA_USB_DM 11U +#define GPIOA_USB_DP 12U +#define GPIOA_SWDIO 13U +#define GPIOA_SWCLK 14U +#define GPIOA_PIN15 15U + +#define GPIOB_PIN0 0U +#define GPIOB_PIN1 1U +#define GPIOB_PIN2 2U +#define GPIOB_PIN3 3U +#define GPIOB_PIN4 4U +#define GPIOB_PIN5 5U +#define GPIOB_PIN6 6U +#define GPIOB_PIN7 7U +#define GPIOB_PIN8 8U +#define GPIOB_PIN9 9U +#define GPIOB_PIN10 10U +#define GPIOB_PIN11 11U +#define GPIOB_PIN12 12U +#define GPIOB_SPI2_SCK 13U +#define GPIOB_SPI2_MISO 14U +#define GPIOB_SPI2_MOSI 15U + +#define GPIOC_MEMS_CS 0U +#define GPIOC_PIN1 1U +#define GPIOC_PIN2 2U +#define GPIOC_PIN3 3U +#define GPIOC_PIN4 4U +#define GPIOC_PIN5 5U +#define GPIOC_LED_RED 6U +#define GPIOC_LED_BLUE 7U +#define GPIOC_LED_ORANGE 8U +#define GPIOC_LED_GREEN 9U +#define GPIOC_PIN10 10U +#define GPIOC_PIN11 11U +#define GPIOC_PIN12 12U +#define GPIOC_PIN13 13U +#define GPIOC_OSC32_IN 14U +#define GPIOC_OSC32_OUT 15U + +#define GPIOD_PIN0 0U +#define GPIOD_PIN1 1U +#define GPIOD_PIN2 2U +#define GPIOD_PIN3 3U +#define GPIOD_PIN4 4U +#define GPIOD_PIN5 5U +#define GPIOD_PIN6 6U +#define GPIOD_PIN7 7U +#define GPIOD_PIN8 8U +#define GPIOD_PIN9 9U +#define GPIOD_PIN10 10U +#define GPIOD_PIN11 11U +#define GPIOD_PIN12 12U +#define GPIOD_PIN13 13U +#define GPIOD_PIN14 14U +#define GPIOD_PIN15 15U + +#define GPIOE_PIN0 0U +#define GPIOE_PIN1 1U +#define GPIOE_PIN2 2U +#define GPIOE_PIN3 3U +#define GPIOE_PIN4 4U +#define GPIOE_PIN5 5U +#define GPIOE_PIN6 6U +#define GPIOE_PIN7 7U +#define GPIOE_PIN8 8U +#define GPIOE_PIN9 9U +#define GPIOE_PIN10 10U +#define GPIOE_PIN11 11U +#define GPIOE_PIN12 12U +#define GPIOE_PIN13 13U +#define GPIOE_PIN14 14U +#define GPIOE_PIN15 15U + +#define GPIOF_OSC_IN 0U +#define GPIOF_OSC_OUT 1U +#define GPIOF_PIN2 2U +#define GPIOF_PIN3 3U +#define GPIOF_PIN4 4U +#define GPIOF_PIN5 5U +#define GPIOF_PIN6 6U +#define GPIOF_PIN7 7U +#define GPIOF_PIN8 8U +#define GPIOF_PIN9 9U +#define GPIOF_PIN10 10U +#define GPIOF_PIN11 11U +#define GPIOF_PIN12 12U +#define GPIOF_PIN13 13U +#define GPIOF_PIN14 14U +#define GPIOF_PIN15 15U + +/* + * IO lines assignments. + */ +#define LINE_BUTTON PAL_LINE(GPIOA, 0U) +#define LINE_USB_DM PAL_LINE(GPIOA, 11U) +#define LINE_USB_DP PAL_LINE(GPIOA, 12U) +#define LINE_SWDIO PAL_LINE(GPIOA, 13U) +#define LINE_SWCLK PAL_LINE(GPIOA, 14U) + +#define LINE_SPI2_SCK PAL_LINE(GPIOB, 13U) +#define LINE_SPI2_MISO PAL_LINE(GPIOB, 14U) +#define LINE_SPI2_MOSI PAL_LINE(GPIOB, 15U) + +#define LINE_MEMS_CS PAL_LINE(GPIOC, 0U) +#define LINE_LED_RED PAL_LINE(GPIOC, 6U) +#define LINE_LED_BLUE PAL_LINE(GPIOC, 7U) +#define LINE_LED_ORANGE PAL_LINE(GPIOC, 8U) +#define LINE_LED_GREEN PAL_LINE(GPIOC, 9U) +#define LINE_OSC32_IN PAL_LINE(GPIOC, 14U) +#define LINE_OSC32_OUT PAL_LINE(GPIOC, 15U) + + + +#define LINE_OSC_IN PAL_LINE(GPIOF, 0U) +#define LINE_OSC_OUT PAL_LINE(GPIOF, 1U) + +/* + * I/O ports initial setup, this configuration is established soon after reset + * in the initialization code. + * Please refer to the STM32 Reference Manual for details. + */ +#define PIN_MODE_INPUT(n) (0U << ((n) * 2U)) +#define PIN_MODE_OUTPUT(n) (1U << ((n) * 2U)) +#define PIN_MODE_ALTERNATE(n) (2U << ((n) * 2U)) +#define PIN_MODE_ANALOG(n) (3U << ((n) * 2U)) +#define PIN_ODR_LOW(n) (0U << (n)) +#define PIN_ODR_HIGH(n) (1U << (n)) +#define PIN_OTYPE_PUSHPULL(n) (0U << (n)) +#define PIN_OTYPE_OPENDRAIN(n) (1U << (n)) +#define PIN_OSPEED_VERYLOW(n) (0U << ((n) * 2U)) +#define PIN_OSPEED_LOW(n) (1U << ((n) * 2U)) +#define PIN_OSPEED_MEDIUM(n) (2U << ((n) * 2U)) +#define PIN_OSPEED_HIGH(n) (3U << ((n) * 2U)) +#define PIN_PUPDR_FLOATING(n) (0U << ((n) * 2U)) +#define PIN_PUPDR_PULLUP(n) (1U << ((n) * 2U)) +#define PIN_PUPDR_PULLDOWN(n) (2U << ((n) * 2U)) +#define PIN_AFIO_AF(n, v) ((v) << (((n) % 8U) * 4U)) + +/* + * GPIOA setup: + * + * PA0 - BUTTON (input floating). + * PA1 - PIN1 (input pullup). + * PA2 - PIN2 (input pullup). + * PA3 - PIN3 (input pullup). + * PA4 - PIN4 (input pullup). + * PA5 - PIN5 (input pullup). + * PA6 - PIN6 (input pullup). + * PA7 - PIN7 (input pullup). + * PA8 - PIN8 (input pullup). + * PA9 - PIN9 (input pullup). + * PA10 - PIN10 (input pullup). + * PA11 - USB_DM (input floating). + * PA12 - USB_DP (input floating). + * PA13 - SWDIO (alternate 0). + * PA14 - SWCLK (alternate 0). + * PA15 - PIN15 (input pullup). + */ +#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_BUTTON) | \ + PIN_MODE_INPUT(GPIOA_PIN1) | \ + PIN_MODE_INPUT(GPIOA_PIN2) | \ + PIN_MODE_INPUT(GPIOA_PIN3) | \ + PIN_MODE_INPUT(GPIOA_PIN4) | \ + PIN_MODE_INPUT(GPIOA_PIN5) | \ + PIN_MODE_INPUT(GPIOA_PIN6) | \ + PIN_MODE_INPUT(GPIOA_PIN7) | \ + PIN_MODE_INPUT(GPIOA_PIN8) | \ + PIN_MODE_INPUT(GPIOA_PIN9) | \ + PIN_MODE_INPUT(GPIOA_PIN10) | \ + PIN_MODE_INPUT(GPIOA_USB_DM) | \ + PIN_MODE_INPUT(GPIOA_USB_DP) | \ + PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \ + PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \ + PIN_MODE_INPUT(GPIOA_PIN15)) +#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_BUTTON) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \ + PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \ + PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \ + PIN_OTYPE_PUSHPULL(GPIOA_PIN15)) +#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_BUTTON) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DM) | \ + PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \ + PIN_OSPEED_HIGH(GPIOA_SWDIO) | \ + PIN_OSPEED_HIGH(GPIOA_SWCLK) | \ + PIN_OSPEED_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_BUTTON) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN10) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \ + PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \ + PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \ + PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \ + PIN_PUPDR_PULLUP(GPIOA_PIN15)) +#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_BUTTON) | \ + PIN_ODR_HIGH(GPIOA_PIN1) | \ + PIN_ODR_HIGH(GPIOA_PIN2) | \ + PIN_ODR_HIGH(GPIOA_PIN3) | \ + PIN_ODR_HIGH(GPIOA_PIN4) | \ + PIN_ODR_HIGH(GPIOA_PIN5) | \ + PIN_ODR_HIGH(GPIOA_PIN6) | \ + PIN_ODR_HIGH(GPIOA_PIN7) | \ + PIN_ODR_HIGH(GPIOA_PIN8) | \ + PIN_ODR_HIGH(GPIOA_PIN9) | \ + PIN_ODR_HIGH(GPIOA_PIN10) | \ + PIN_ODR_HIGH(GPIOA_USB_DM) | \ + PIN_ODR_HIGH(GPIOA_USB_DP) | \ + PIN_ODR_HIGH(GPIOA_SWDIO) | \ + PIN_ODR_HIGH(GPIOA_SWCLK) | \ + PIN_ODR_HIGH(GPIOA_PIN15)) +#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_BUTTON, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN7, 0U)) +#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DM, 0U) | \ + PIN_AFIO_AF(GPIOA_USB_DP, 0U) | \ + PIN_AFIO_AF(GPIOA_SWDIO, 0U) | \ + PIN_AFIO_AF(GPIOA_SWCLK, 0U) | \ + PIN_AFIO_AF(GPIOA_PIN15, 0U)) + +/* + * GPIOB setup: + * + * PB0 - PIN0 (input pullup). + * PB1 - PIN1 (input pullup). + * PB2 - PIN2 (input pullup). + * PB3 - PIN3 (input pullup). + * PB4 - PIN4 (input pullup). + * PB5 - PIN5 (input pullup). + * PB6 - PIN6 (input pullup). + * PB7 - PIN7 (input pullup). + * PB8 - PIN8 (input pullup). + * PB9 - PIN9 (input pullup). + * PB10 - PIN10 (input pullup). + * PB11 - PIN11 (input pullup). + * PB12 - PIN12 (input pullup). + * PB13 - SPI2_SCK (alternate 0). + * PB14 - SPI2_MISO (alternate 0). + * PB15 - SPI2_MOSI (alternate 0). + */ +#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \ + PIN_MODE_INPUT(GPIOB_PIN1) | \ + PIN_MODE_INPUT(GPIOB_PIN2) | \ + PIN_MODE_INPUT(GPIOB_PIN3) | \ + PIN_MODE_INPUT(GPIOB_PIN4) | \ + PIN_MODE_INPUT(GPIOB_PIN5) | \ + PIN_MODE_INPUT(GPIOB_PIN6) | \ + PIN_MODE_INPUT(GPIOB_PIN7) | \ + PIN_MODE_INPUT(GPIOB_PIN8) | \ + PIN_MODE_INPUT(GPIOB_PIN9) | \ + PIN_MODE_INPUT(GPIOB_PIN10) | \ + PIN_MODE_INPUT(GPIOB_PIN11) | \ + PIN_MODE_INPUT(GPIOB_PIN12) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_SCK) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MISO) | \ + PIN_MODE_ALTERNATE(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_SCK) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MISO) | \ + PIN_OTYPE_PUSHPULL(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \ + PIN_OSPEED_HIGH(GPIOB_PIN2) | \ + PIN_OSPEED_HIGH(GPIOB_PIN3) | \ + PIN_OSPEED_HIGH(GPIOB_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_SCK) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MISO) | \ + PIN_OSPEED_VERYLOW(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOB_PIN12) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_SCK) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MISO) | \ + PIN_PUPDR_FLOATING(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \ + PIN_ODR_HIGH(GPIOB_PIN1) | \ + PIN_ODR_HIGH(GPIOB_PIN2) | \ + PIN_ODR_HIGH(GPIOB_PIN3) | \ + PIN_ODR_HIGH(GPIOB_PIN4) | \ + PIN_ODR_HIGH(GPIOB_PIN5) | \ + PIN_ODR_HIGH(GPIOB_PIN6) | \ + PIN_ODR_HIGH(GPIOB_PIN7) | \ + PIN_ODR_HIGH(GPIOB_PIN8) | \ + PIN_ODR_HIGH(GPIOB_PIN9) | \ + PIN_ODR_HIGH(GPIOB_PIN10) | \ + PIN_ODR_HIGH(GPIOB_PIN11) | \ + PIN_ODR_HIGH(GPIOB_PIN12) | \ + PIN_ODR_HIGH(GPIOB_SPI2_SCK) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MISO) | \ + PIN_ODR_HIGH(GPIOB_SPI2_MOSI)) +#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN7, 0U)) +#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOB_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_SCK, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MISO, 0U) | \ + PIN_AFIO_AF(GPIOB_SPI2_MOSI, 0U)) + +/* + * GPIOC setup: + * + * PC0 - MEMS_CS (output pushpull maximum). + * PC1 - PIN1 (input pullup). + * PC2 - PIN2 (input pullup). + * PC3 - PIN3 (input pullup). + * PC4 - PIN4 (input pullup). + * PC5 - PIN5 (input pullup). + * PC6 - LED_RED (output pushpull maximum). + * PC7 - LED_BLUE (output pushpull maximum). + * PC8 - LED_ORANGE (output pushpull maximum). + * PC9 - LED_GREEN (output pushpull maximum). + * PC10 - PIN10 (input pullup). + * PC11 - PIN11 (input pullup). + * PC12 - PIN12 (input pullup). + * PC13 - PIN13 (input pullup). + * PC14 - OSC32_IN (input floating). + * PC15 - OSC32_OUT (input floating). + */ +#define VAL_GPIOC_MODER (PIN_MODE_OUTPUT(GPIOC_MEMS_CS) | \ + PIN_MODE_INPUT(GPIOC_PIN1) | \ + PIN_MODE_INPUT(GPIOC_PIN2) | \ + PIN_MODE_INPUT(GPIOC_PIN3) | \ + PIN_MODE_INPUT(GPIOC_PIN4) | \ + PIN_MODE_INPUT(GPIOC_PIN5) | \ + PIN_MODE_OUTPUT(GPIOC_LED_RED) | \ + PIN_MODE_OUTPUT(GPIOC_LED_BLUE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_ORANGE) | \ + PIN_MODE_OUTPUT(GPIOC_LED_GREEN) | \ + PIN_MODE_INPUT(GPIOC_PIN10) | \ + PIN_MODE_INPUT(GPIOC_PIN11) | \ + PIN_MODE_INPUT(GPIOC_PIN12) | \ + PIN_MODE_INPUT(GPIOC_PIN13) | \ + PIN_MODE_INPUT(GPIOC_OSC32_IN) | \ + PIN_MODE_INPUT(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_MEMS_CS) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_RED) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_BLUE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_ORANGE) | \ + PIN_OTYPE_PUSHPULL(GPIOC_LED_GREEN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_HIGH(GPIOC_MEMS_CS) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \ + PIN_OSPEED_HIGH(GPIOC_LED_RED) | \ + PIN_OSPEED_HIGH(GPIOC_LED_BLUE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_ORANGE) | \ + PIN_OSPEED_HIGH(GPIOC_LED_GREEN) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_IN) | \ + PIN_OSPEED_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_PUPDR (PIN_PUPDR_FLOATING(GPIOC_MEMS_CS) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN5) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_RED) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_BLUE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_ORANGE) | \ + PIN_PUPDR_FLOATING(GPIOC_LED_GREEN) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOC_PIN13) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_IN) | \ + PIN_PUPDR_FLOATING(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_MEMS_CS) | \ + PIN_ODR_HIGH(GPIOC_PIN1) | \ + PIN_ODR_HIGH(GPIOC_PIN2) | \ + PIN_ODR_HIGH(GPIOC_PIN3) | \ + PIN_ODR_HIGH(GPIOC_PIN4) | \ + PIN_ODR_HIGH(GPIOC_PIN5) | \ + PIN_ODR_LOW(GPIOC_LED_RED) | \ + PIN_ODR_LOW(GPIOC_LED_BLUE) | \ + PIN_ODR_LOW(GPIOC_LED_ORANGE) | \ + PIN_ODR_LOW(GPIOC_LED_GREEN) | \ + PIN_ODR_HIGH(GPIOC_PIN10) | \ + PIN_ODR_HIGH(GPIOC_PIN11) | \ + PIN_ODR_HIGH(GPIOC_PIN12) | \ + PIN_ODR_HIGH(GPIOC_PIN13) | \ + PIN_ODR_HIGH(GPIOC_OSC32_IN) | \ + PIN_ODR_HIGH(GPIOC_OSC32_OUT)) +#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_MEMS_CS, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_RED, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_BLUE, 0U)) +#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_LED_ORANGE, 0U) | \ + PIN_AFIO_AF(GPIOC_LED_GREEN, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOC_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_IN, 0U) | \ + PIN_AFIO_AF(GPIOC_OSC32_OUT, 0U)) + +/* + * GPIOD setup: + * + * PD0 - PIN0 (input pullup). + * PD1 - PIN1 (input pullup). + * PD2 - PIN2 (input pullup). + * PD3 - PIN3 (input pullup). + * PD4 - PIN4 (input pullup). + * PD5 - PIN5 (input pullup). + * PD6 - PIN6 (input pullup). + * PD7 - PIN7 (input pullup). + * PD8 - PIN8 (input pullup). + * PD9 - PIN9 (input pullup). + * PD10 - PIN10 (input pullup). + * PD11 - PIN11 (input pullup). + * PD12 - PIN12 (input pullup). + * PD13 - PIN13 (input pullup). + * PD14 - PIN14 (input pullup). + * PD15 - PIN15 (input pullup). + */ +#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \ + PIN_MODE_INPUT(GPIOD_PIN1) | \ + PIN_MODE_INPUT(GPIOD_PIN2) | \ + PIN_MODE_INPUT(GPIOD_PIN3) | \ + PIN_MODE_INPUT(GPIOD_PIN4) | \ + PIN_MODE_INPUT(GPIOD_PIN5) | \ + PIN_MODE_INPUT(GPIOD_PIN6) | \ + PIN_MODE_INPUT(GPIOD_PIN7) | \ + PIN_MODE_INPUT(GPIOD_PIN8) | \ + PIN_MODE_INPUT(GPIOD_PIN9) | \ + PIN_MODE_INPUT(GPIOD_PIN10) | \ + PIN_MODE_INPUT(GPIOD_PIN11) | \ + PIN_MODE_INPUT(GPIOD_PIN12) | \ + PIN_MODE_INPUT(GPIOD_PIN13) | \ + PIN_MODE_INPUT(GPIOD_PIN14) | \ + PIN_MODE_INPUT(GPIOD_PIN15)) +#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOD_PIN15)) +#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOD_PIN15)) +#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOD_PIN15)) +#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \ + PIN_ODR_HIGH(GPIOD_PIN1) | \ + PIN_ODR_HIGH(GPIOD_PIN2) | \ + PIN_ODR_HIGH(GPIOD_PIN3) | \ + PIN_ODR_HIGH(GPIOD_PIN4) | \ + PIN_ODR_HIGH(GPIOD_PIN5) | \ + PIN_ODR_HIGH(GPIOD_PIN6) | \ + PIN_ODR_HIGH(GPIOD_PIN7) | \ + PIN_ODR_HIGH(GPIOD_PIN8) | \ + PIN_ODR_HIGH(GPIOD_PIN9) | \ + PIN_ODR_HIGH(GPIOD_PIN10) | \ + PIN_ODR_HIGH(GPIOD_PIN11) | \ + PIN_ODR_HIGH(GPIOD_PIN12) | \ + PIN_ODR_HIGH(GPIOD_PIN13) | \ + PIN_ODR_HIGH(GPIOD_PIN14) | \ + PIN_ODR_HIGH(GPIOD_PIN15)) +#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN7, 0U)) +#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOD_PIN15, 0U)) + +/* + * GPIOE setup: + * + * PE0 - PIN0 (input pullup). + * PE1 - PIN1 (input pullup). + * PE2 - PIN2 (input pullup). + * PE3 - PIN3 (input pullup). + * PE4 - PIN4 (input pullup). + * PE5 - PIN5 (input pullup). + * PE6 - PIN6 (input pullup). + * PE7 - PIN7 (input pullup). + * PE8 - PIN8 (input pullup). + * PE9 - PIN9 (input pullup). + * PE10 - PIN10 (input pullup). + * PE11 - PIN11 (input pullup). + * PE12 - PIN12 (input pullup). + * PE13 - PIN13 (input pullup). + * PE14 - PIN14 (input pullup). + * PE15 - PIN15 (input pullup). + */ +#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \ + PIN_MODE_INPUT(GPIOE_PIN1) | \ + PIN_MODE_INPUT(GPIOE_PIN2) | \ + PIN_MODE_INPUT(GPIOE_PIN3) | \ + PIN_MODE_INPUT(GPIOE_PIN4) | \ + PIN_MODE_INPUT(GPIOE_PIN5) | \ + PIN_MODE_INPUT(GPIOE_PIN6) | \ + PIN_MODE_INPUT(GPIOE_PIN7) | \ + PIN_MODE_INPUT(GPIOE_PIN8) | \ + PIN_MODE_INPUT(GPIOE_PIN9) | \ + PIN_MODE_INPUT(GPIOE_PIN10) | \ + PIN_MODE_INPUT(GPIOE_PIN11) | \ + PIN_MODE_INPUT(GPIOE_PIN12) | \ + PIN_MODE_INPUT(GPIOE_PIN13) | \ + PIN_MODE_INPUT(GPIOE_PIN14) | \ + PIN_MODE_INPUT(GPIOE_PIN15)) +#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOE_PIN15)) +#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN1) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOE_PIN15)) +#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN1) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOE_PIN15)) +#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \ + PIN_ODR_HIGH(GPIOE_PIN1) | \ + PIN_ODR_HIGH(GPIOE_PIN2) | \ + PIN_ODR_HIGH(GPIOE_PIN3) | \ + PIN_ODR_HIGH(GPIOE_PIN4) | \ + PIN_ODR_HIGH(GPIOE_PIN5) | \ + PIN_ODR_HIGH(GPIOE_PIN6) | \ + PIN_ODR_HIGH(GPIOE_PIN7) | \ + PIN_ODR_HIGH(GPIOE_PIN8) | \ + PIN_ODR_HIGH(GPIOE_PIN9) | \ + PIN_ODR_HIGH(GPIOE_PIN10) | \ + PIN_ODR_HIGH(GPIOE_PIN11) | \ + PIN_ODR_HIGH(GPIOE_PIN12) | \ + PIN_ODR_HIGH(GPIOE_PIN13) | \ + PIN_ODR_HIGH(GPIOE_PIN14) | \ + PIN_ODR_HIGH(GPIOE_PIN15)) +#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN1, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN7, 0U)) +#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOE_PIN15, 0U)) + +/* + * GPIOF setup: + * + * PF0 - OSC_IN (input floating). + * PF1 - OSC_OUT (input floating). + * PF2 - PIN2 (input pullup). + * PF3 - PIN3 (input pullup). + * PF4 - PIN4 (input pullup). + * PF5 - PIN5 (input pullup). + * PF6 - PIN6 (input pullup). + * PF7 - PIN7 (input pullup). + * PF8 - PIN8 (input pullup). + * PF9 - PIN9 (input pullup). + * PF10 - PIN10 (input pullup). + * PF11 - PIN11 (input pullup). + * PF12 - PIN12 (input pullup). + * PF13 - PIN13 (input pullup). + * PF14 - PIN14 (input pullup). + * PF15 - PIN15 (input pullup). + */ +#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_OSC_IN) | \ + PIN_MODE_INPUT(GPIOF_OSC_OUT) | \ + PIN_MODE_INPUT(GPIOF_PIN2) | \ + PIN_MODE_INPUT(GPIOF_PIN3) | \ + PIN_MODE_INPUT(GPIOF_PIN4) | \ + PIN_MODE_INPUT(GPIOF_PIN5) | \ + PIN_MODE_INPUT(GPIOF_PIN6) | \ + PIN_MODE_INPUT(GPIOF_PIN7) | \ + PIN_MODE_INPUT(GPIOF_PIN8) | \ + PIN_MODE_INPUT(GPIOF_PIN9) | \ + PIN_MODE_INPUT(GPIOF_PIN10) | \ + PIN_MODE_INPUT(GPIOF_PIN11) | \ + PIN_MODE_INPUT(GPIOF_PIN12) | \ + PIN_MODE_INPUT(GPIOF_PIN13) | \ + PIN_MODE_INPUT(GPIOF_PIN14) | \ + PIN_MODE_INPUT(GPIOF_PIN15)) +#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_OSC_IN) | \ + PIN_OTYPE_PUSHPULL(GPIOF_OSC_OUT) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \ + PIN_OTYPE_PUSHPULL(GPIOF_PIN15)) +#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOF_OSC_IN) | \ + PIN_OSPEED_VERYLOW(GPIOF_OSC_OUT) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \ + PIN_OSPEED_VERYLOW(GPIOF_PIN15)) +#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_OSC_IN) | \ + PIN_PUPDR_FLOATING(GPIOF_OSC_OUT) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN2) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN3) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN4) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN5) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN6) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN7) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN8) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN9) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN10) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN11) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN12) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN13) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN14) | \ + PIN_PUPDR_PULLUP(GPIOF_PIN15)) +#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_OSC_IN) | \ + PIN_ODR_HIGH(GPIOF_OSC_OUT) | \ + PIN_ODR_HIGH(GPIOF_PIN2) | \ + PIN_ODR_HIGH(GPIOF_PIN3) | \ + PIN_ODR_HIGH(GPIOF_PIN4) | \ + PIN_ODR_HIGH(GPIOF_PIN5) | \ + PIN_ODR_HIGH(GPIOF_PIN6) | \ + PIN_ODR_HIGH(GPIOF_PIN7) | \ + PIN_ODR_HIGH(GPIOF_PIN8) | \ + PIN_ODR_HIGH(GPIOF_PIN9) | \ + PIN_ODR_HIGH(GPIOF_PIN10) | \ + PIN_ODR_HIGH(GPIOF_PIN11) | \ + PIN_ODR_HIGH(GPIOF_PIN12) | \ + PIN_ODR_HIGH(GPIOF_PIN13) | \ + PIN_ODR_HIGH(GPIOF_PIN14) | \ + PIN_ODR_HIGH(GPIOF_PIN15)) +#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_OSC_IN, 0U) | \ + PIN_AFIO_AF(GPIOF_OSC_OUT, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN2, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN3, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN4, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN5, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN6, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN7, 0U)) +#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN9, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN10, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN11, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN12, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN13, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN14, 0U) | \ + PIN_AFIO_AF(GPIOF_PIN15, 0U)) + + +#if !defined(_FROM_ASM_) +#ifdef __cplusplus +extern "C" { +#endif + void boardInit(void); +#ifdef __cplusplus +} +#endif +#endif /* _FROM_ASM_ */ + +#endif /* BOARD_H */ diff --git a/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk new file mode 100644 index 0000000000..b98dcdd26c --- /dev/null +++ b/keyboards/chibios_test/boards/ST_STM32F072B_DISCOVERY/board.mk @@ -0,0 +1,5 @@ +# List of all the board related files. +BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c + +# Required include directories +BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY -- cgit v1.2.3 From 8e0444618fdf42301cce4467aea6de63bec3cfed Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Tue, 25 Dec 2018 11:24:47 -0800 Subject: XMMX refactor, Configurator support and readme update (#4722) * XMMX: matrix and keymap refactor - xmmx.h updated to use #pragma once - renamed LAYOUT_ansi_wk macro to LAYOUT_tkl_ansi - renamed LAYOUT_ansi_wkl macro to LAYOUT_tkl_ansi_wkl - renamed LAYOUT_iso_wk macro to LAYOUT_tkl_iso - renamed LAYOUT_iso_wkl macro to LAYOUT_tkl_iso_wkl * XMMX: Configurator support * XMMX: readme update --- keyboards/xmmx/info.json | 475 +++++++++++++++++++++++++++++++ keyboards/xmmx/keymaps/ansi_wk/keymap.c | 7 +- keyboards/xmmx/keymaps/ansi_wkl/keymap.c | 7 +- keyboards/xmmx/keymaps/default/keymap.c | 7 +- keyboards/xmmx/keymaps/iso_wk/keymap.c | 7 +- keyboards/xmmx/keymaps/iso_wkl/keymap.c | 7 +- keyboards/xmmx/readme.md | 10 +- keyboards/xmmx/xmmx.h | 12 +- 8 files changed, 505 insertions(+), 27 deletions(-) create mode 100644 keyboards/xmmx/info.json diff --git a/keyboards/xmmx/info.json b/keyboards/xmmx/info.json new file mode 100644 index 0000000000..28bd06bbf9 --- /dev/null +++ b/keyboards/xmmx/info.json @@ -0,0 +1,475 @@ +{ + "keyboard_name": "XMMX", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT_all": { + "key_count": 96, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Back Space", "x":13, "y":1.5}, + {"label":"Back Space", "x":14, "y":1.5}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":3.5, "w":1.25}, + {"x":15.25, "y":3.5}, + {"x":16.25, "y":3.5}, + {"x":17.25, "y":3.5}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":1.75}, + {"label":"Fn", "x":14, "y":4.5}, + {"x":15.25, "y":4.5}, + {"label":"Up", "x":16.25, "y":4.5}, + {"x":17.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi": { + "key_count": 87, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"Alt", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_ansi_wkl": { + "key_count": 84, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"~", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"@", "x":2, "y":1.5}, + {"label":"#", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"|", "x":13.5, "y":2.5, "w":1.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"\"", "x":11.75, "y":3.5}, + {"label":"Enter", "x":12.75, "y":3.5, "w":2.25}, + {"label":"Shift", "x":0, "y":4.5, "w":2.25}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"Alt", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso": { + "key_count": 88, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.25}, + {"label":"Win", "x":1.25, "y":5.5, "w":1.25}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.25}, + {"label":"Space", "x":3.75, "y":5.5, "w":6.25}, + {"label":"AltGr", "x":10, "y":5.5, "w":1.25}, + {"label":"Win", "x":11.25, "y":5.5, "w":1.25}, + {"label":"Menu", "x":12.5, "y":5.5, "w":1.25}, + {"label":"Ctrl", "x":13.75, "y":5.5, "w":1.25}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + }, + "LAYOUT_tkl_iso_wkl": { + "key_count": 85, + "layout": [ + {"label":"Esc", "x":0, "y":0}, + {"label":"F1", "x":2, "y":0}, + {"label":"F2", "x":3, "y":0}, + {"label":"F3", "x":4, "y":0}, + {"label":"F4", "x":5, "y":0}, + {"label":"F5", "x":6.5, "y":0}, + {"label":"F6", "x":7.5, "y":0}, + {"label":"F7", "x":8.5, "y":0}, + {"label":"F8", "x":9.5, "y":0}, + {"label":"F9", "x":11, "y":0}, + {"label":"F10", "x":12, "y":0}, + {"label":"F11", "x":13, "y":0}, + {"label":"F12", "x":14, "y":0}, + {"label":"PrtSc", "x":15.25, "y":0}, + {"label":"Scroll Lock", "x":16.25, "y":0}, + {"label":"Pause", "x":17.25, "y":0}, + {"label":"\u00ac", "x":0, "y":1.5}, + {"label":"!", "x":1, "y":1.5}, + {"label":"\"", "x":2, "y":1.5}, + {"label":"\u00a3", "x":3, "y":1.5}, + {"label":"$", "x":4, "y":1.5}, + {"label":"%", "x":5, "y":1.5}, + {"label":"^", "x":6, "y":1.5}, + {"label":"&", "x":7, "y":1.5}, + {"label":"*", "x":8, "y":1.5}, + {"label":"(", "x":9, "y":1.5}, + {"label":")", "x":10, "y":1.5}, + {"label":"_", "x":11, "y":1.5}, + {"label":"+", "x":12, "y":1.5}, + {"label":"Backspace", "x":13, "y":1.5, "w":2}, + {"label":"Insert", "x":15.25, "y":1.5}, + {"label":"Home", "x":16.25, "y":1.5}, + {"label":"PgUp", "x":17.25, "y":1.5}, + {"label":"Tab", "x":0, "y":2.5, "w":1.5}, + {"label":"Q", "x":1.5, "y":2.5}, + {"label":"W", "x":2.5, "y":2.5}, + {"label":"E", "x":3.5, "y":2.5}, + {"label":"R", "x":4.5, "y":2.5}, + {"label":"T", "x":5.5, "y":2.5}, + {"label":"Y", "x":6.5, "y":2.5}, + {"label":"U", "x":7.5, "y":2.5}, + {"label":"I", "x":8.5, "y":2.5}, + {"label":"O", "x":9.5, "y":2.5}, + {"label":"P", "x":10.5, "y":2.5}, + {"label":"{", "x":11.5, "y":2.5}, + {"label":"}", "x":12.5, "y":2.5}, + {"label":"Delete", "x":15.25, "y":2.5}, + {"label":"End", "x":16.25, "y":2.5}, + {"label":"PgDn", "x":17.25, "y":2.5}, + {"label":"Caps Lock", "x":0, "y":3.5, "w":1.75}, + {"label":"A", "x":1.75, "y":3.5}, + {"label":"S", "x":2.75, "y":3.5}, + {"label":"D", "x":3.75, "y":3.5}, + {"label":"F", "x":4.75, "y":3.5}, + {"label":"G", "x":5.75, "y":3.5}, + {"label":"H", "x":6.75, "y":3.5}, + {"label":"J", "x":7.75, "y":3.5}, + {"label":"K", "x":8.75, "y":3.5}, + {"label":"L", "x":9.75, "y":3.5}, + {"label":":", "x":10.75, "y":3.5}, + {"label":"@", "x":11.75, "y":3.5}, + {"label":"~", "x":12.75, "y":3.5}, + {"label":"Enter", "x":13.75, "y":2.5, "w":1.25, "h":2}, + {"label":"Shift", "x":0, "y":4.5, "w":1.25}, + {"label":"|", "x":1.25, "y":4.5}, + {"label":"Z", "x":2.25, "y":4.5}, + {"label":"X", "x":3.25, "y":4.5}, + {"label":"C", "x":4.25, "y":4.5}, + {"label":"V", "x":5.25, "y":4.5}, + {"label":"B", "x":6.25, "y":4.5}, + {"label":"N", "x":7.25, "y":4.5}, + {"label":"M", "x":8.25, "y":4.5}, + {"label":"<", "x":9.25, "y":4.5}, + {"label":">", "x":10.25, "y":4.5}, + {"label":"?", "x":11.25, "y":4.5}, + {"label":"Shift", "x":12.25, "y":4.5, "w":2.75}, + {"label":"Up", "x":16.25, "y":4.5}, + {"label":"Ctrl", "x":0, "y":5.5, "w":1.5}, + {"label":"Alt", "x":2.5, "y":5.5, "w":1.5}, + {"label":"Space", "x":4, "y":5.5, "w":7}, + {"label":"AltGr", "x":11, "y":5.5, "w":1.5}, + {"label":"Ctrl", "x":13.5, "y":5.5, "w":1.5}, + {"label":"Left", "x":15.25, "y":5.5}, + {"label":"Down", "x":16.25, "y":5.5}, + {"label":"Right", "x":17.25, "y":5.5} + ] + } + } +} + diff --git a/keyboards/xmmx/keymaps/ansi_wk/keymap.c b/keyboards/xmmx/keymaps/ansi_wk/keymap.c index abdba99ba7..213f65a4a2 100644 --- a/keyboards/xmmx/keymaps/ansi_wk/keymap.c +++ b/keyboards/xmmx/keymaps/ansi_wk/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ansi_wk( - 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, \ + LAYOUT_tkl_ansi( + 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_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_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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/ansi_wkl/keymap.c b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c index aeb61ff2ca..d566f1a210 100644 --- a/keyboards/xmmx/keymaps/ansi_wkl/keymap.c +++ b/keyboards/xmmx/keymaps/ansi_wkl/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_ansi_wkl( - 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, \ + LAYOUT_tkl_ansi_wkl( + 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_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_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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/default/keymap.c b/keyboards/xmmx/keymaps/default/keymap.c index a7522fe25a..a4c38cd54e 100644 --- a/keyboards/xmmx/keymaps/default/keymap.c +++ b/keyboards/xmmx/keymaps/default/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_all( - 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, \ + LAYOUT_all( + 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_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_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_NUHS, KC_ENT, KC_NO, KC_NO, KC_NO, \ 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_RSFT, KC_NO, KC_UP, KC_NO, \ KC_LCTL,KC_LGUI,KC_LALT, KC_SPC, KC_RALT,KC_RGUI, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/iso_wk/keymap.c b/keyboards/xmmx/keymaps/iso_wk/keymap.c index 882cb224a6..a71795ccf0 100644 --- a/keyboards/xmmx/keymaps/iso_wk/keymap.c +++ b/keyboards/xmmx/keymaps/iso_wk/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_iso_wk( - 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, \ + LAYOUT_tkl_iso( + 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_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_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_NUHS, 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, KC_APP,KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/keymaps/iso_wkl/keymap.c b/keyboards/xmmx/keymaps/iso_wkl/keymap.c index 18ba79e1f9..d40257177d 100644 --- a/keyboards/xmmx/keymaps/iso_wkl/keymap.c +++ b/keyboards/xmmx/keymaps/iso_wkl/keymap.c @@ -2,12 +2,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - LAYOUT_iso_wkl( - 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, \ + LAYOUT_tkl_iso_wkl( + 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_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_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_NUHS, 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_LALT, KC_SPC, KC_RALT, KC_RCTL, KC_LEFT,KC_DOWN,KC_RGHT - ) + ) }; + diff --git a/keyboards/xmmx/readme.md b/keyboards/xmmx/readme.md index 8f94df4b92..51775f2414 100644 --- a/keyboards/xmmx/readme.md +++ b/keyboards/xmmx/readme.md @@ -1,14 +1,14 @@ # XMMX -XMMX: Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases +XMMX is a Tenkeyless Mechanical Keyboard PCB designed to fit Filco Majestouch TKL and Cooler Master Quickfire Rapid cases. -XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d) +XMMX schematic and PCB are available opensource under Creative Commons BY-SA 3.0 license on EasyEDA at [this link](https://easyeda.com/farmakon/XMMX-0447d28c1e4644b88fd04905d983684d). -For more informations on the XMMX please visit this [geekhack.org thread](https://geekhack.org/index.php?topic=93422.0) +For more informations on the XMMX please visit [this geekhack.org thread](https://geekhack.org/index.php?topic=93422.0). -Make examples for these keyboards (after setting up your build environment): +Make example for this keyboard (after setting up your build environment): make xmmx: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). -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. diff --git a/keyboards/xmmx/xmmx.h b/keyboards/xmmx/xmmx.h index 22d0f1480d..82c3fb5882 100644 --- a/keyboards/xmmx/xmmx.h +++ b/keyboards/xmmx/xmmx.h @@ -1,5 +1,4 @@ -#ifndef XMMX -#define XMMX +#pragma once #include "quantum.h" @@ -21,7 +20,7 @@ } // 80% keyboard: ANSI Winkey -#define LAYOUT_ansi_wk( \ +#define LAYOUT_tkl_ansi( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -38,7 +37,7 @@ } // 80% keyboard: ANSI Winkeyless -#define LAYOUT_ansi_wkl( \ +#define LAYOUT_tkl_ansi_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K213, K214, K215, K216, \ @@ -55,7 +54,7 @@ } // 80% keyboard: ISO Winkey -#define LAYOUT_iso_wk( \ +#define LAYOUT_tkl_iso( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -72,7 +71,7 @@ } // 80% keyboard: ISO Winkeyless -#define LAYOUT_iso_wkl( \ +#define LAYOUT_tkl_iso_wkl( \ K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, K014, K015, K016, \ K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K111, K112, K113, K114, K115, K116, \ K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, K214, K215, K216, \ @@ -88,4 +87,3 @@ { K500, KC_NO,K502, KC_NO,KC_NO,KC_NO,KC_NO,K507, KC_NO,KC_NO,KC_NO,K511, KC_NO,K513, K514, K515, K516 } \ } -#endif -- cgit v1.2.3 From ee1be3e5b5a0259cc7d1c7a126ff7451acf3d6cb Mon Sep 17 00:00:00 2001 From: Yan-Fa Li Date: Tue, 25 Dec 2018 16:40:53 -0800 Subject: Improve diagnostics for build hashes --- .travis.yml | 3 ++- util/travis_compiled_push.sh | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ff4060ab7..6cfc9e067e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ install: before_script: - avr-gcc --version script: +- git rev-parse --short HEAD - make test:all AUTOGEN=false - bash util/travis_build.sh - bash util/travis_docs.sh @@ -33,7 +34,7 @@ addons: - diffutils - dos2unix - doxygen -after_success: +after_success: bash util/travis_compiled_push.sh notifications: webhooks: diff --git a/util/travis_compiled_push.sh b/util/travis_compiled_push.sh index a49908c71e..66b3beb6ce 100755 --- a/util/travis_compiled_push.sh +++ b/util/travis_compiled_push.sh @@ -8,6 +8,7 @@ TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE:-HEAD~1..HEAD}" set -o errexit -o nounset rev=$(git rev-parse --short HEAD) +echo "Using git hash ${rev}" if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" ]] ; then @@ -34,7 +35,7 @@ increment_version () part[2]=$((part[2] + 1)) new="${part[*]}" echo -e "${new// /.}" -} +} git diff --name-only -n 1 ${TRAVIS_COMMIT_RANGE} @@ -63,7 +64,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then ssh-add -D eval `ssh-agent -s` ssh-add id_rsa_qmk.fm - + # don't delete files in case not all keyboards are built # rm -f compiled/*.hex @@ -74,7 +75,7 @@ if [[ "$TRAVIS_COMMIT_MESSAGE" != *"[skip build]"* ]] ; then for file in ../qmk_firmware/keyboards/*/*/*/*/keymaps/*/*_default.hex; do mv -v "$file" "compiled/${file##*/}" || true; done bash _util/generate_keyboard_page.sh git add -A - git commit -m "generated from qmk/qmk_firmware@${rev}" + git commit -m "generated from qmk/qmk_firmware@${rev}" git push git@github.com:qmk/qmk.fm.git fi -- cgit v1.2.3 From b7d2a9f980be009f5d40950cf649ce1086b821a9 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Wed, 26 Dec 2018 07:55:42 -0800 Subject: S65-Plus: refactor and Configurator support (#4725) - s65_plus.h updated to #pragma once method - added info.json file --- keyboards/s65_plus/info.json | 92 +++++++++++++++++++++++++++++++++++++++++++ keyboards/s65_plus/s65_plus.h | 4 +- 2 files changed, 93 insertions(+), 3 deletions(-) create mode 100644 keyboards/s65_plus/info.json diff --git a/keyboards/s65_plus/info.json b/keyboards/s65_plus/info.json new file mode 100644 index 0000000000..589269db99 --- /dev/null +++ b/keyboards/s65_plus/info.json @@ -0,0 +1,92 @@ +{ + "keyboard_name": "S65-Plus", + "url": "", + "maintainer": "qmk", + "width": 18, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [ + {"label":"F1", "x":0, "y":0}, + {"label":"F2", "x":1, "y":0}, + {"label":"ESC", "x":2, "y":0}, + {"label":"1", "x":3, "y":0}, + {"label":"2", "x":4, "y":0}, + {"label":"3", "x":5, "y":0}, + {"label":"4", "x":6, "y":0}, + {"label":"5", "x":7, "y":0}, + {"label":"6", "x":8, "y":0}, + {"label":"7", "x":9, "y":0}, + {"label":"8", "x":10, "y":0}, + {"label":"9", "x":11, "y":0}, + {"label":"0", "x":12, "y":0}, + {"label":"MINUS", "x":13, "y":0}, + {"label":"EQUAL", "x":14, "y":0}, + {"label":"BACKSPACE", "x":15, "y":0, "w":2}, + {"label":"DELETE", "x":17, "y":0}, + {"label":"F3", "x":0, "y":1}, + {"label":"F4", "x":1, "y":1}, + {"label":"TAB", "x":2, "y":1, "w":1.5}, + {"label":"Q", "x":3.5, "y":1}, + {"label":"W", "x":4.5, "y":1}, + {"label":"E", "x":5.5, "y":1}, + {"label":"R", "x":6.5, "y":1}, + {"label":"T", "x":7.5, "y":1}, + {"label":"Y", "x":8.5, "y":1}, + {"label":"U", "x":9.5, "y":1}, + {"label":"I", "x":10.5, "y":1}, + {"label":"O", "x":11.5, "y":1}, + {"label":"P", "x":12.5, "y":1}, + {"label":"LBRACKET", "x":13.5, "y":1}, + {"label":"RBRACKET", "x":14.5, "y":1}, + {"label":"BACKSLASH", "x":15.5, "y":1, "w":1.5}, + {"label":"PAGEUP", "x":17, "y":1}, + {"label":"F5", "x":0, "y":2}, + {"label":"F6", "x":1, "y":2}, + {"label":"CAPSLOCK", "x":2, "y":2, "w":1.75}, + {"label":"A", "x":3.75, "y":2}, + {"label":"S", "x":4.75, "y":2}, + {"label":"D", "x":5.75, "y":2}, + {"label":"F", "x":6.75, "y":2}, + {"label":"G", "x":7.75, "y":2}, + {"label":"H", "x":8.75, "y":2}, + {"label":"J", "x":9.75, "y":2}, + {"label":"K", "x":10.75, "y":2}, + {"label":"L", "x":11.75, "y":2}, + {"label":"SEMICOLON", "x":12.75, "y":2}, + {"label":"QUOTE", "x":13.75, "y":2}, + {"label":"ENTER", "x":14.75, "y":2, "w":2.25}, + {"label":"PAGEDOWN", "x":17, "y":2}, + {"label":"F7", "x":0, "y":3}, + {"label":"F8", "x":1, "y":3}, + {"label":"LSHIFT", "x":2, "y":3, "w":2.25}, + {"label":"Z", "x":4.25, "y":3}, + {"label":"X", "x":5.25, "y":3}, + {"label":"C", "x":6.25, "y":3}, + {"label":"V", "x":7.25, "y":3}, + {"label":"B", "x":8.25, "y":3}, + {"label":"N", "x":9.25, "y":3}, + {"label":"M", "x":10.25, "y":3}, + {"label":"COMMA", "x":11.25, "y":3}, + {"label":"PERIOD", "x":12.25, "y":3}, + {"label":"SLASH", "x":13.25, "y":3}, + {"label":"RSHIFT", "x":14.25, "y":3, "w":1.75}, + {"label":"UP", "x":16, "y":3}, + {"label":"END", "x":17, "y":3}, + {"label":"F9", "x":0, "y":4}, + {"label":"F10", "x":1, "y":4}, + {"label":"LCTRL", "x":2, "y":4, "w":1.25}, + {"label":"LGUI", "x":3.25, "y":4, "w":1.25}, + {"label":"LALT", "x":4.5, "y":4, "w":1.25}, + {"label":"SPACE", "x":5.75, "y":4, "w":6.25}, + {"label":"RALT", "x":12, "y":4}, + {"label":"FN", "x":13, "y":4}, + {"label":"RCTRL", "x":14, "y":4}, + {"label":"LEFT", "x":15, "y":4}, + {"label":"DOWN", "x":16, "y":4}, + {"label":"RIGHT", "x":17, "y":4} + ] + } + } +} + diff --git a/keyboards/s65_plus/s65_plus.h b/keyboards/s65_plus/s65_plus.h index 2ff445f6c9..1075571085 100644 --- a/keyboards/s65_plus/s65_plus.h +++ b/keyboards/s65_plus/s65_plus.h @@ -1,5 +1,4 @@ -#ifndef S60PLUS_H -#define S60PLUS_H +#pragma once #include "quantum.h" @@ -20,4 +19,3 @@ void matrix_init_user(void); void matrix_scan_user(void); -#endif -- cgit v1.2.3 From 0c1256e60ab430402ad5dcd11f2368bb065fa958 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Wed, 26 Dec 2018 17:01:26 +0100 Subject: Read user input properly in linux_install.sh for Gentoo (#4395) * Change spaces to tabs on two lines The rest of the file uses tabs * Read user input in a non-terrible, non-hacky way * Remove unnecessary tee call * read -p is not POSIX * Add missing $ to echo GENTOO_WARNING * Replace non-POSIX echo -n with printf * Use cd ... || exit 1 in case git clone fails * Add missing sudo Thanks @snortwolf * Undo replacing tee with >> --- util/linux_install.sh | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/util/linux_install.sh b/util/linux_install.sh index 70b389c0da..d6e6b86cdc 100755 --- a/util/linux_install.sh +++ b/util/linux_install.sh @@ -32,7 +32,7 @@ if grep ID /etc/os-release | grep -qE "fedora"; then elif grep ID /etc/os-release | grep -qE 'debian|ubuntu'; then DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true - export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN + export DEBIAN_FRONTEND DEBCONF_NONINTERACTIVE_SEEN sudo apt-get update sudo apt-get install \ build-essential \ @@ -70,20 +70,18 @@ elif grep ID /etc/os-release | grep -q 'arch\|manjaro'; then wget \ zip git clone https://aur.archlinux.org/dfu-programmer.git /tmp/dfu-programmer - cd /tmp/dfu-programmer + cd /tmp/dfu-programmer || exit 1 makepkg -sic rm -rf /tmp/dfu-programmer/ elif grep ID /etc/os-release | grep -q gentoo; then - echo GENTOO_WARNING | fmt - echo -n "Proceed (y/N)? " - old_stty_cfg=$(stty -g) - stty raw -echo - answer=$( while ! head -c 1 | grep -i '[ny]' ;do true ;done ) - stty $old_stty_cfg - if echo "$answer" | grep -iq "^y" ;then + echo "$GENTOO_WARNING" | fmt + printf "\nProceed (y/N)? " + read -r answer + if echo "$answer" | grep -iq "^y"; then sudo touch /etc/portage/package.use/qmkfirmware - echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware > /dev/null + # tee is used here since sudo doesn't apply to >> + echo "sys-devel/gcc multilib" | sudo tee --append /etc/portage/package.use/qmkfirmware >/dev/null sudo emerge -auN \ app-arch/unzip \ app-arch/zip \ -- cgit v1.2.3 From cfba2165413796da0e657675c67e40a8683e6107 Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 27 Dec 2018 08:37:29 -0800 Subject: S65-Plus: fix layout macro name in info.json (#4728) --- keyboards/s65_plus/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/s65_plus/info.json b/keyboards/s65_plus/info.json index 589269db99..14c5b08d91 100644 --- a/keyboards/s65_plus/info.json +++ b/keyboards/s65_plus/info.json @@ -5,7 +5,7 @@ "width": 18, "height": 5, "layouts": { - "LAYOUT": { + "LAYOUT_ansi": { "layout": [ {"label":"F1", "x":0, "y":0}, {"label":"F2", "x":1, "y":0}, -- cgit v1.2.3 From 3744a2b641628c8e1646ce743c07934314357c51 Mon Sep 17 00:00:00 2001 From: Jumail Mundekkat Date: Fri, 28 Dec 2018 03:40:33 +1100 Subject: Added Skog TKL support (#4727) * Added Skog TKL support * Updated manufacturer/product name --- keyboards/skog/README.md | 61 +++++ keyboards/skog/backlight.c | 211 +++++++++++++++++ keyboards/skog/backlight_custom.h | 13 ++ keyboards/skog/breathing_custom.h | 140 +++++++++++ keyboards/skog/config.h | 42 ++++ keyboards/skog/i2c.c | 106 +++++++++ keyboards/skog/i2c.h | 25 ++ keyboards/skog/info.json | 12 + keyboards/skog/keymaps/default/keymap.c | 37 +++ keyboards/skog/matrix.c | 112 +++++++++ keyboards/skog/rules.mk | 55 +++++ keyboards/skog/skog.c | 98 ++++++++ keyboards/skog/skog.h | 39 ++++ keyboards/skog/usbconfig.h | 396 ++++++++++++++++++++++++++++++++ 14 files changed, 1347 insertions(+) create mode 100644 keyboards/skog/README.md create mode 100644 keyboards/skog/backlight.c create mode 100644 keyboards/skog/backlight_custom.h create mode 100644 keyboards/skog/breathing_custom.h create mode 100644 keyboards/skog/config.h create mode 100644 keyboards/skog/i2c.c create mode 100644 keyboards/skog/i2c.h create mode 100644 keyboards/skog/info.json create mode 100644 keyboards/skog/keymaps/default/keymap.c create mode 100644 keyboards/skog/matrix.c create mode 100644 keyboards/skog/rules.mk create mode 100644 keyboards/skog/skog.c create mode 100644 keyboards/skog/skog.h create mode 100644 keyboards/skog/usbconfig.h diff --git a/keyboards/skog/README.md b/keyboards/skog/README.md new file mode 100644 index 0000000000..51a792b6bd --- /dev/null +++ b/keyboards/skog/README.md @@ -0,0 +1,61 @@ +Skog TKL by Percent +========================== + +Keyboard Maintainer: QMK Community +Hardware Supported: Skog PCB +Hardware Availability: https://geekhack.org/index.php?topic=87953.0 + +Make example for this keyboard (after setting up your build environment): + + make skog:default + +## Setting the board to bootloader mode + +If you're lucky, the programming script does this automagically for you. If +however this doesn't work for you, you need to enter the bootloader mode manually +by plugging the keyboard in while holding the bootloader key. If you did this +correctly the LEDs will blink and you'll be able to flash your firmware. + +The bootloader key is in the top-right (Pause). + +## Flashing + +ps2avr(GB) boards use an atmega32a microcontroller and a different bootloader. It is not flashable using the regular QMK methods. + +Windows: +1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash). +2. Place your keyboard into reset. +3. Press the `Find Device` button and ensure that your keyboard is found. +4. Press the `Open .hex File` button and locate the `.hex` file you created. +5. Press the `Flash Device` button and wait for the process to complete. + +macOS: +1. Install homebrew by typing the following: + ``` + /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + ``` +2. Install `crosspack-avr`. + ``` + brew cask install crosspack-avr + ``` +3. Install the following packages: + ``` + brew install python + brew install pyusb + brew install --HEAD`https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb + +4. Place your keyboard into reset. +5. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file. + +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). + +## Troubleshooting + +From my experience, it's really hard to brick these boards. But these +tricks have been useful when it got stuck in a weird scenario. + +1. Try plugging the board in while holding the bootloader key. This will force + it to boot only the bootloader without loading the firmware. Once this is + done, just reflash the board with the original firmware. +2. Sometimes USB hubs can act weird, so try connecting the board directly + to your computer or plugging/unplugging the USB hub. diff --git a/keyboards/skog/backlight.c b/keyboards/skog/backlight.c new file mode 100644 index 0000000000..94e8126d88 --- /dev/null +++ b/keyboards/skog/backlight.c @@ -0,0 +1,211 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#include "backlight.h" +#include "quantum.h" + +#include +#include + +#include "backlight_custom.h" +#include "breathing_custom.h" + +// DEBUG +#include +#include + +// Port D: digital pins of the AVR chipset +#define NUMLOCK_PORT (1 << 0) // D0 +#define CAPSLOCK_PORT (1 << 1) // D1 +#define BACKLIGHT_PORT (1 << 4) // D4 +#define SCROLLLOCK_PORT (1 << 6) // D6 + +#define TIMER_CLK_DIV64 0x03 ///< Timer clocked at F_CPU/64 +#define TIMER1PRESCALE TIMER_CLK_DIV64 ///< timer 1 prescaler default + +#define TIMER_PRESCALE_MASK 0x07 ///< Timer Prescaler Bit-Mask + +#define PWM_MAX 0xFF +#define TIMER_TOP 255 // 8 bit PWM + +extern backlight_config_t backlight_config; + +/** + * References + * Port Registers: https://www.arduino.cc/en/Reference/PortManipulation + * TCCR1A: https://electronics.stackexchange.com/questions/92350/what-is-the-difference-between-tccr1a-and-tccr1b + * Timers: http://www.avrbeginners.net/architecture/timers/timers.html + * 16-bit timer setup: http://sculland.com/ATmega168/Interrupts-And-Timers/16-Bit-Timer-Setup/ + * PS2AVRGB firmware: https://github.com/showjean/ps2avrU/tree/master/firmware + */ + +// @Override +// turn LEDs on and off depending on USB caps/num/scroll lock states. +__attribute__ ((weak)) +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + // turn on + DDRD |= NUMLOCK_PORT; + PORTD |= NUMLOCK_PORT; + } else { + // turn off + DDRD &= ~NUMLOCK_PORT; + PORTD &= ~NUMLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= CAPSLOCK_PORT; + PORTD |= CAPSLOCK_PORT; + } else { + DDRD &= ~CAPSLOCK_PORT; + PORTD &= ~CAPSLOCK_PORT; + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRD |= SCROLLLOCK_PORT; + PORTD |= SCROLLLOCK_PORT; + } else { + DDRD &= ~SCROLLLOCK_PORT; + PORTD &= ~SCROLLLOCK_PORT; + } +} + +#ifdef BACKLIGHT_ENABLE + +// sets up Timer 1 for 8-bit PWM +void timer1PWMSetup(void) { // NOTE ONLY CALL THIS ONCE + // default 8 bit mode + TCCR1A &= ~(1 << 1); // cbi(TCCR1A,PWM11); <- set PWM11 bit to HIGH + TCCR1A |= (1 << 0); // sbi(TCCR1A,PWM10); <- set PWM10 bit to LOW + + // clear output compare value A + // outb(OCR1AH, 0); + // outb(OCR1AL, 0); + + // clear output comparator registers for B + OCR1BH = 0; // outb(OCR1BH, 0); + OCR1BL = 0; // outb(OCR1BL, 0); +} + +bool is_init = false; +void timer1Init(void) { + // timer1SetPrescaler(TIMER1PRESCALE) + // set to DIV/64 + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | TIMER1PRESCALE; + + // reset TCNT1 + TCNT1H = 0; // outb(TCNT1H, 0); + TCNT1L = 0; // outb(TCNT1L, 0); + + // TOIE1: Timer Overflow Interrupt Enable (Timer 1); + TIMSK |= _BV(TOIE1); // sbi(TIMSK, TOIE1); + + is_init = true; +} + +void timer1UnInit(void) { + // set prescaler back to NONE + (TCCR1B) = ((TCCR1B) & ~TIMER_PRESCALE_MASK) | 0x00; // TIMERRTC_CLK_STOP + + // disable timer overflow interrupt + TIMSK &= ~_BV(TOIE1); // overflow bit? + + setPWM(0); + + is_init = false; +} + + +// handle TCNT1 overflow +//! Interrupt handler for tcnt1 overflow interrupt +ISR(TIMER1_OVF_vect, ISR_NOBLOCK) +{ + // sei(); + // handle breathing here + #ifdef BACKLIGHT_BREATHING + if (is_breathing()) { + custom_breathing_handler(); + } + #endif +} + +// enable timer 1 PWM +// timer1PWMBOn() +void timer1PWMBEnable(void) { + // turn on channel B (OC1B) PWM output + // set OC1B as non-inverted PWM + TCCR1A |= _BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +// disable timer 1 PWM +// timer1PWMBOff() +void timer1PWMBDisable(void) { + TCCR1A &= ~_BV(COM1B1); + TCCR1A &= ~_BV(COM1B0); +} + +void enableBacklight(void) { + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high +} + +void disableBacklight(void) { + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low +} + +void startPWM(void) { + timer1Init(); + timer1PWMBEnable(); + enableBacklight(); +} + +void stopPWM(void) { + timer1UnInit(); + disableBacklight(); + timer1PWMBDisable(); +} + +void b_led_init_ports(void) { + /* turn backlight on/off depending on user preference */ + #if BACKLIGHT_ON_STATE == 0 + // DDRx register: sets the direction of Port D + // DDRD &= ~BACKLIGHT_PORT; // set digital pin 4 as input + PORTD &= ~BACKLIGHT_PORT; // set digital pin 4 to low + #else + DDRD |= BACKLIGHT_PORT; // set digital pin 4 as output + PORTD |= BACKLIGHT_PORT; // set digital pin 4 to high + #endif + + timer1PWMSetup(); + startPWM(); + + #ifdef BACKLIGHT_BREATHING + breathing_enable(); + #endif +} + +void b_led_set(uint8_t level) { + if (level > BACKLIGHT_LEVELS) { + level = BACKLIGHT_LEVELS; + } + + setPWM((int)(TIMER_TOP * (float) level / BACKLIGHT_LEVELS)); +} + +// called every matrix scan +void b_led_task(void) { + // do nothing for now +} + +void setPWM(uint16_t xValue) { + if (xValue > TIMER_TOP) { + xValue = TIMER_TOP; + } + OCR1B = xValue; // timer1PWMBSet(xValue); +} + +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/skog/backlight_custom.h b/keyboards/skog/backlight_custom.h new file mode 100644 index 0000000000..51365fe3ba --- /dev/null +++ b/keyboards/skog/backlight_custom.h @@ -0,0 +1,13 @@ +/** + * Backlighting code for PS2AVRGB boards (ATMEGA32A) + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#pragma once + +#include +void b_led_init_ports(void); +void b_led_set(uint8_t level); +void b_led_task(void); +void setPWM(uint16_t xValue); + diff --git a/keyboards/skog/breathing_custom.h b/keyboards/skog/breathing_custom.h new file mode 100644 index 0000000000..71416b1b45 --- /dev/null +++ b/keyboards/skog/breathing_custom.h @@ -0,0 +1,140 @@ +/** + * Breathing effect code for PS2AVRGB boards (ATMEGA32A) + * Works in conjunction with `backlight.c`. + * + * Code adapted from `quantum.c` to register with the existing TIMER1 overflow + * handler in `backlight.c` instead of setting up its own timer. + * Kenneth A. (github.com/krusli | krusli.me) + */ + +#ifdef BACKLIGHT_ENABLE +#ifdef BACKLIGHT_BREATHING + +#include "backlight_custom.h" + +#ifndef BREATHING_PERIOD +#define BREATHING_PERIOD 6 +#endif + +#define breathing_min() do {breathing_counter = 0;} while (0) +#define breathing_max() do {breathing_counter = breathing_period * 244 / 2;} while (0) + +// TODO make this share code with quantum.c + +#define BREATHING_NO_HALT 0 +#define BREATHING_HALT_OFF 1 +#define BREATHING_HALT_ON 2 +#define BREATHING_STEPS 128 + +static uint8_t breathing_period = BREATHING_PERIOD; +static uint8_t breathing_halt = BREATHING_NO_HALT; +static uint16_t breathing_counter = 0; + +static bool breathing = false; + +bool is_breathing(void) { + return breathing; +} + +// See http://jared.geek.nz/2013/feb/linear-led-pwm +static uint16_t cie_lightness(uint16_t v) { + if (v <= 5243) // if below 8% of max + return v / 9; // same as dividing by 900% + else { + uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare + // to get a useful result with integer division, we shift left in the expression above + // and revert what we've done again after squaring. + y = y * y * y >> 8; + if (y > 0xFFFFUL) // prevent overflow + return 0xFFFFU; + else + return (uint16_t) y; + } +} + +void breathing_enable(void) { + breathing = true; + breathing_counter = 0; + breathing_halt = BREATHING_NO_HALT; + // interrupt already registered +} + +void breathing_pulse(void) { + if (get_backlight_level() == 0) + breathing_min(); + else + breathing_max(); + breathing_halt = BREATHING_HALT_ON; + // breathing_interrupt_enable(); + breathing = true; +} + +void breathing_disable(void) { + breathing = false; + // backlight_set(get_backlight_level()); + b_led_set(get_backlight_level()); // custom implementation of backlight_set() +} + +void breathing_self_disable(void) +{ + if (get_backlight_level() == 0) + breathing_halt = BREATHING_HALT_OFF; + else + breathing_halt = BREATHING_HALT_ON; +} + +void breathing_toggle(void) { + if (is_breathing()) + breathing_disable(); + else + breathing_enable(); +} + +void breathing_period_set(uint8_t value) +{ + if (!value) + value = 1; + breathing_period = value; +} + +void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} + +void breathing_period_inc(void) +{ + breathing_period_set(breathing_period+1); +} + +void breathing_period_dec(void) +{ + breathing_period_set(breathing_period-1); +} + +/* To generate breathing curve in python: + * from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)] + */ +static const uint8_t breathing_table[BREATHING_STEPS] PROGMEM = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + +// Use this before the cie_lightness function. +static inline uint16_t scale_backlight(uint16_t v) { + return v / BACKLIGHT_LEVELS * get_backlight_level(); +} + +void custom_breathing_handler(void) { + uint16_t interval = (uint16_t) breathing_period * 244 / BREATHING_STEPS; + // resetting after one period to prevent ugly reset at overflow. + breathing_counter = (breathing_counter + 1) % (breathing_period * 244); + uint8_t index = breathing_counter / interval % BREATHING_STEPS; + + if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) || + ((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1))) + { + // breathing_interrupt_disable(); + } + + setPWM(cie_lightness(scale_backlight((uint16_t) pgm_read_byte(&breathing_table[index]) * 0x0101U))); +} + +#endif // BACKLIGHT_BREATHING +#endif // BACKLIGHT_ENABLE diff --git a/keyboards/skog/config.h b/keyboards/skog/config.h new file mode 100644 index 0000000000..dea3e28e88 --- /dev/null +++ b/keyboards/skog/config.h @@ -0,0 +1,42 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +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 . +*/ + +#ifndef CONFIG_H +#define CONFIG_H + +#define VENDOR_ID 0x20A0 +#define PRODUCT_ID 0x422D + +#define MANUFACTURER Percent +#define PRODUCT Skog TKL + +/* matrix size */ +#define MATRIX_ROWS 8 +#define MATRIX_COLS 14 + +#define RGBLED_NUM 2 +#define RGBLIGHT_ANIMATIONS + +#define BACKLIGHT_LEVELS 5 + +#define NO_UART 1 +#define BOOTLOADHID_BOOTLOADER 1 + +/* key combination for command */ +#define IS_COMMAND() (keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT))) + +#endif diff --git a/keyboards/skog/i2c.c b/keyboards/skog/i2c.c new file mode 100644 index 0000000000..a4f9521352 --- /dev/null +++ b/keyboards/skog/i2c.c @@ -0,0 +1,106 @@ +/* +Copyright 2016 Luiz Ribeiro + +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 . +*/ + +// Please do not modify this file + +#include +#include + +#include "i2c.h" + +void i2c_set_bitrate(uint16_t bitrate_khz) { + uint8_t bitrate_div = ((F_CPU / 1000l) / bitrate_khz); + if (bitrate_div >= 16) { + bitrate_div = (bitrate_div - 16) / 2; + } + TWBR = bitrate_div; +} + +void i2c_init(void) { + // set pull-up resistors on I2C bus pins + PORTC |= 0b11; + + i2c_set_bitrate(400); + + // enable TWI (two-wire interface) + TWCR |= (1 << TWEN); + + // enable TWI interrupt and slave address ACK + TWCR |= (1 << TWIE); + TWCR |= (1 << TWEA); +} + +uint8_t i2c_start(uint8_t address) { + // reset TWI control register + TWCR = 0; + + // begin transmission and wait for it to end + TWCR = (1< + +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 . +*/ + +// Please do not modify this file + +#pragma once + +void i2c_init(void); +void i2c_set_bitrate(uint16_t bitrate_khz); +uint8_t i2c_send(uint8_t address, uint8_t *data, uint16_t length); + diff --git a/keyboards/skog/info.json b/keyboards/skog/info.json new file mode 100644 index 0000000000..06fad3a741 --- /dev/null +++ b/keyboards/skog/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "skog", + "url": "", + "maintainer": "qmk", + "width": 18.25, + "height": 6.5, + "layouts": { + "LAYOUT": { + "layout": [{"x":0, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":4, "y":0}, {"x":5, "y":0}, {"x":6.5, "y":0}, {"x":7.5, "y":0}, {"x":8.5, "y":0}, {"x":9.5, "y":0}, {"x":11, "y":0}, {"x":12, "y":0}, {"x":13, "y":0}, {"x":14, "y":0}, {"x":15.25, "y":0}, {"x":16.25, "y":0}, {"x":17.25, "y":0}, {"x":0, "y":1.5}, {"x":1, "y":1.5}, {"x":2, "y":1.5}, {"x":3, "y":1.5}, {"x":4, "y":1.5}, {"x":5, "y":1.5}, {"x":6, "y":1.5}, {"x":7, "y":1.5}, {"x":8, "y":1.5}, {"x":9, "y":1.5}, {"x":10, "y":1.5}, {"x":11, "y":1.5}, {"x":12, "y":1.5}, {"x":13, "y":1.5, "w":2}, {"x":15.25, "y":1.5}, {"x":16.25, "y":1.5}, {"x":17.25, "y":1.5}, {"x":0, "y":2.5, "w":1.5}, {"x":1.5, "y":2.5}, {"x":2.5, "y":2.5}, {"x":3.5, "y":2.5}, {"x":4.5, "y":2.5}, {"x":5.5, "y":2.5}, {"x":6.5, "y":2.5}, {"x":7.5, "y":2.5}, {"x":8.5, "y":2.5}, {"x":9.5, "y":2.5}, {"x":10.5, "y":2.5}, {"x":11.5, "y":2.5}, {"x":12.5, "y":2.5}, {"x":13.5, "y":2.5, "w":1.5}, {"x":15.25, "y":2.5}, {"x":16.25, "y":2.5}, {"x":17.25, "y":2.5}, {"x":0, "y":3.5, "w":1.75}, {"x":1.75, "y":3.5}, {"x":2.75, "y":3.5}, {"x":3.75, "y":3.5}, {"x":4.75, "y":3.5}, {"x":5.75, "y":3.5}, {"x":6.75, "y":3.5}, {"x":7.75, "y":3.5}, {"x":8.75, "y":3.5}, {"x":9.75, "y":3.5}, {"x":10.75, "y":3.5}, {"x":11.75, "y":3.5}, {"x":12.75, "y":3.5, "w":2.25}, {"x":0, "y":4.5, "w":2.25}, {"x":2.25, "y":4.5}, {"x":3.25, "y":4.5}, {"x":4.25, "y":4.5}, {"x":5.25, "y":4.5}, {"x":6.25, "y":4.5}, {"x":7.25, "y":4.5}, {"x":8.25, "y":4.5}, {"x":9.25, "y":4.5}, {"x":10.25, "y":4.5}, {"x":11.25, "y":4.5}, {"x":12.25, "y":4.5, "w":1.75}, {"x":14, "y":4.5}, {"x":16.25, "y":4.5}, {"x":0, "y":5.5, "w":1.25}, {"x":1.25, "y":5.5, "w":1.25}, {"x":2.5, "y":5.5, "w":1.25}, {"x":3.75, "y":5.5, "w":6.25}, {"x":10, "y":5.5, "w":1.25}, {"x":11.25, "y":5.5, "w":1.25}, {"x":12.5, "y":5.5, "w":1.25}, {"x":13.75, "y":5.5, "w":1.25}, {"x":15.25, "y":5.5}, {"x":16.25, "y":5.5}, {"x":17.25, "y":5.5}] + } + } +} diff --git a/keyboards/skog/keymaps/default/keymap.c b/keyboards/skog/keymaps/default/keymap.c new file mode 100644 index 0000000000..eefc24cb0d --- /dev/null +++ b/keyboards/skog/keymaps/default/keymap.c @@ -0,0 +1,37 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +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 . +*/ + +#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_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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_LSFT, KC_TRNS, KC_UP, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, KC_RGUI, KC_MENU, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT + ) +}; + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} diff --git a/keyboards/skog/matrix.c b/keyboards/skog/matrix.c new file mode 100644 index 0000000000..245813dfd2 --- /dev/null +++ b/keyboards/skog/matrix.c @@ -0,0 +1,112 @@ +/* +Copyright 2017 Luiz Ribeiro + +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 . +*/ + +#include +#include + +#include "matrix.h" + +#ifndef DEBOUNCE +# define DEBOUNCE 5 +#endif + +static uint8_t debouncing = DEBOUNCE; + +static matrix_row_t matrix[MATRIX_ROWS]; +static matrix_row_t matrix_debouncing[MATRIX_ROWS]; + +void matrix_set_row_status(uint8_t row); +uint8_t bit_reverse(uint8_t x); + +void matrix_init(void) { + // all outputs for rows high + DDRB = 0xFF; + PORTB = 0xFF; + // all inputs for columns + DDRA = 0x00; + DDRC &= ~(0x111111<<2); + DDRD &= ~(1< 7 + (~PINA) & 0xFF + ) | ( + // cols 8..13, PORTC 7 -> 0 + bit_reverse((~PINC) & 0xFF) << 8 + ) | ( + // col 14, PORTD 7 + ((~PIND) & (1 << PIND7)) << 7 + ); + + if (matrix_debouncing[row] != cols) { + matrix_debouncing[row] = cols; + debouncing = DEBOUNCE; + } + } + + 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; +} + +// declarations +void matrix_set_row_status(uint8_t row) { + DDRB = (1 << row); + PORTB = ~(1 << row); +} + +uint8_t bit_reverse(uint8_t x) { + x = ((x >> 1) & 0x55) | ((x << 1) & 0xaa); + x = ((x >> 2) & 0x33) | ((x << 2) & 0xcc); + x = ((x >> 4) & 0x0f) | ((x << 4) & 0xf0); + return x; +} + +inline matrix_row_t matrix_get_row(uint8_t row) { + return matrix[row]; +} + +void matrix_print(void) { +} diff --git a/keyboards/skog/rules.mk b/keyboards/skog/rules.mk new file mode 100644 index 0000000000..bce0c442a6 --- /dev/null +++ b/keyboards/skog/rules.mk @@ -0,0 +1,55 @@ +# Copyright 2018 Jumail Mundekkat / MxBlue +# +# 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 . + +# MCU name +MCU = atmega32a +PROTOCOL = VUSB + +# unsupported features for now +NO_UART = yes +NO_SUSPEND_POWER_DOWN = yes + +# processor frequency +F_CPU = 12000000 + +# 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 = bootloadHID + +# build options +BOOTMAGIC_ENABLE = full +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +CONSOLE_ENABLE = yes +COMMAND_ENABLE = yes +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes + +BACKLIGHT_CUSTOM_DRIVER = yes +RGBLIGHT_CUSTOM_DRIVER = yes + +OPT_DEFS = -DDEBUG_LEVEL=0 + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + +# custom matrix setup +CUSTOM_MATRIX = yes +SRC = matrix.c i2c.c backlight.c + +# programming options +PROGRAM_CMD = ./util/atmega32a_program.py $(TARGET).hex diff --git a/keyboards/skog/skog.c b/keyboards/skog/skog.c new file mode 100644 index 0000000000..3d1eb0e1a1 --- /dev/null +++ b/keyboards/skog/skog.c @@ -0,0 +1,98 @@ +/* +Copyright 2018 Jumail Mundekkat / MxBlue + +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 . + +ps2avrGB support code by Kenneth A. (bminiex/.[ch]) +*/ + +#include "skog.h" + +#include "rgblight.h" + +#include + +#include "action_layer.h" +#include "i2c.h" +#include "quantum.h" + +#include "backlight.h" +#include "backlight_custom.h" + +// for keyboard subdirectory level init functions +// @Override +void matrix_init_kb(void) { + // call user level keymaps, if any + matrix_init_user(); +} + +#ifdef BACKLIGHT_ENABLE +/// Overrides functions in `quantum.c` +void backlight_init_ports(void) { + b_led_init_ports(); +} + +void backlight_task(void) { + b_led_task(); +} + +void backlight_set(uint8_t level) { + b_led_set(level); +} +#endif + +#ifdef RGBLIGHT_ENABLE +extern rgblight_config_t rgblight_config; + +// custom RGB driver +void rgblight_set(void) { + if (!rgblight_config.enable) { + for (uint8_t i=0; i. +*/ + +#pragma once + +#include "quantum.h" + +#define LAYOUT( \ + K11, K31, K41, K51, K61, K81, K91, KA1, KB1, KC1, K01, KD1, K21, K20, K30, K00, \ + \ + K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, K02, KD2 , K70, K60, K50, \ + K13 , K23, K33, K43, K53, K63, K73, K83, K93, KA3, KB3, KC3, K03, KD3 , KD0, K90, K80, \ + K15 , K25, K35, K45, K55, K65, K75, K85, K95, KA5, KB5, KC5, K05 , \ + K16 , K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6 , K06, KD6, \ + K17 , K27 , K37 , K57 , K97 , KA7 , KB7 , KC7 , K07, KD7, K87 \ +){ \ + { K00, KC_NO, K20, K30, KC_NO, K50, K60, K70, K80, K90, KC_NO, KC_NO, KC_NO, KD0 }, \ + { K01, K11, K21, K31, K41, K51, K61, KC_NO, K81, K91, KA1, KB1, KC1, KD1 }, \ + { K02, K12, K22, K32, K42, K52, K62, K72, K82, K92, KA2, KB2, KC2, KD2 }, \ + { K03, K13, K23, K33, K43, K53, K63, K73, K83, K93, KA3, KB3, KC3, KD3 }, \ + { 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 }, \ + { K05, K15, K25, K35, K45, K55, K65, K75, K85, K95, KA5, KB5, KC5, KC_NO }, \ + { K06, K16, K26, K36, K46, K56, K66, K76, K86, K96, KA6, KB6, KC6, KD6 }, \ + { K07, K17, K27, K37, KC_NO, K57, KC_NO, KC_NO, K87, K97, KA7, KB7, KC7, KD7 } \ +} diff --git a/keyboards/skog/usbconfig.h b/keyboards/skog/usbconfig.h new file mode 100644 index 0000000000..481d7c0b14 --- /dev/null +++ b/keyboards/skog/usbconfig.h @@ -0,0 +1,396 @@ +/* Name: usbconfig.h + * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers + * Author: Christian Starkjohann + * Creation Date: 2005-04-01 + * Tabsize: 4 + * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH + * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) + * This Revision: $Id: usbconfig-prototype.h 785 2010-05-30 17:57:07Z cs $ + */ + +#ifndef __usbconfig_h_included__ +#define __usbconfig_h_included__ + +#include "config.h" + +/* +General Description: +This file is an example configuration (with inline documentation) for the USB +driver. It configures V-USB for USB D+ connected to Port D bit 2 (which is +also hardware interrupt 0 on many devices) and USB D- to Port D bit 4. You may +wire the lines to any other port, as long as D+ is also wired to INT0 (or any +other hardware interrupt, as long as it is the highest level interrupt, see +section at the end of this file). +*/ + +/* ---------------------------- Hardware Config ---------------------------- */ + +#define USB_CFG_IOPORTNAME D +/* This is the port where the USB bus is connected. When you configure it to + * "B", the registers PORTB, PINB and DDRB will be used. + */ +#define USB_CFG_DMINUS_BIT 3 +/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected. + * This may be any bit in the port. + */ +#define USB_CFG_DPLUS_BIT 2 +/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected. + * This may be any bit in the port. Please note that D+ must also be connected + * to interrupt pin INT0! [You can also use other interrupts, see section + * "Optional MCU Description" below, or you can connect D- to the interrupt, as + * it is required if you use the USB_COUNT_SOF feature. If you use D- for the + * interrupt, the USB interrupt will also be triggered at Start-Of-Frame + * markers every millisecond.] + */ +#define USB_CFG_CLOCK_KHZ (F_CPU/1000) +/* Clock rate of the AVR in kHz. Legal values are 12000, 12800, 15000, 16000, + * 16500, 18000 and 20000. The 12.8 MHz and 16.5 MHz versions of the code + * require no crystal, they tolerate +/- 1% deviation from the nominal + * frequency. All other rates require a precision of 2000 ppm and thus a + * crystal! + * Since F_CPU should be defined to your actual clock rate anyway, you should + * not need to modify this setting. + */ +#define USB_CFG_CHECK_CRC 0 +/* Define this to 1 if you want that the driver checks integrity of incoming + * data packets (CRC checks). CRC checks cost quite a bit of code size and are + * currently only available for 18 MHz crystal clock. You must choose + * USB_CFG_CLOCK_KHZ = 18000 if you enable this option. + */ + +/* ----------------------- Optional Hardware Config ------------------------ */ + +/* #define USB_CFG_PULLUP_IOPORTNAME D */ +/* If you connect the 1.5k pullup resistor from D- to a port pin instead of + * V+, you can connect and disconnect the device from firmware by calling + * the macros usbDeviceConnect() and usbDeviceDisconnect() (see usbdrv.h). + * This constant defines the port on which the pullup resistor is connected. + */ +/* #define USB_CFG_PULLUP_BIT 4 */ +/* This constant defines the bit number in USB_CFG_PULLUP_IOPORT (defined + * above) where the 1.5k pullup resistor is connected. See description + * above for details. + */ + +/* --------------------------- Functional Range ---------------------------- */ + +#define USB_CFG_HAVE_INTRIN_ENDPOINT 1 +/* Define this to 1 if you want to compile a version with two endpoints: The + * default control endpoint 0 and an interrupt-in endpoint (any other endpoint + * number). + */ +#define USB_CFG_HAVE_INTRIN_ENDPOINT3 1 +/* Define this to 1 if you want to compile a version with three endpoints: The + * default control endpoint 0, an interrupt-in endpoint 3 (or the number + * configured below) and a catch-all default interrupt-in endpoint as above. + * You must also define USB_CFG_HAVE_INTRIN_ENDPOINT to 1 for this feature. + */ +#define USB_CFG_EP3_NUMBER 3 +/* If the so-called endpoint 3 is used, it can now be configured to any other + * endpoint number (except 0) with this macro. Default if undefined is 3. + */ +/* #define USB_INITIAL_DATATOKEN USBPID_DATA1 */ +/* The above macro defines the startup condition for data toggling on the + * interrupt/bulk endpoints 1 and 3. Defaults to USBPID_DATA1. + * Since the token is toggled BEFORE sending any data, the first packet is + * sent with the oposite value of this configuration! + */ +#define USB_CFG_IMPLEMENT_HALT 0 +/* Define this to 1 if you also want to implement the ENDPOINT_HALT feature + * for endpoint 1 (interrupt endpoint). Although you may not need this feature, + * it is required by the standard. We have made it a config option because it + * bloats the code considerably. + */ +#define USB_CFG_SUPPRESS_INTR_CODE 0 +/* Define this to 1 if you want to declare interrupt-in endpoints, but don't + * want to send any data over them. If this macro is defined to 1, functions + * usbSetInterrupt() and usbSetInterrupt3() are omitted. This is useful if + * you need the interrupt-in endpoints in order to comply to an interface + * (e.g. HID), but never want to send any data. This option saves a couple + * of bytes in flash memory and the transmit buffers in RAM. + */ +#define USB_CFG_INTR_POLL_INTERVAL 1 +/* If you compile a version with endpoint 1 (interrupt-in), this is the poll + * interval. The value is in milliseconds and must not be less than 10 ms for + * low speed devices. + */ +#define USB_CFG_IS_SELF_POWERED 0 +/* Define this to 1 if the device has its own power supply. Set it to 0 if the + * device is powered from the USB bus. + */ +#define USB_CFG_MAX_BUS_POWER 500 +/* Set this variable to the maximum USB bus power consumption of your device. + * The value is in milliamperes. [It will be divided by two since USB + * communicates power requirements in units of 2 mA.] + */ +#define USB_CFG_IMPLEMENT_FN_WRITE 1 +/* Set this to 1 if you want usbFunctionWrite() to be called for control-out + * transfers. Set it to 0 if you don't need it and want to save a couple of + * bytes. + */ +#define USB_CFG_IMPLEMENT_FN_READ 0 +/* Set this to 1 if you need to send control replies which are generated + * "on the fly" when usbFunctionRead() is called. If you only want to send + * data from a static buffer, set it to 0 and return the data from + * usbFunctionSetup(). This saves a couple of bytes. + */ +#define USB_CFG_IMPLEMENT_FN_WRITEOUT 0 +/* Define this to 1 if you want to use interrupt-out (or bulk out) endpoints. + * You must implement the function usbFunctionWriteOut() which receives all + * interrupt/bulk data sent to any endpoint other than 0. The endpoint number + * can be found in 'usbRxToken'. + */ +#define USB_CFG_HAVE_FLOWCONTROL 0 +/* Define this to 1 if you want flowcontrol over USB data. See the definition + * of the macros usbDisableAllRequests() and usbEnableAllRequests() in + * usbdrv.h. + */ +#define USB_CFG_DRIVER_FLASH_PAGE 0 +/* If the device has more than 64 kBytes of flash, define this to the 64 k page + * where the driver's constants (descriptors) are located. Or in other words: + * Define this to 1 for boot loaders on the ATMega128. + */ +#define USB_CFG_LONG_TRANSFERS 0 +/* Define this to 1 if you want to send/receive blocks of more than 254 bytes + * in a single control-in or control-out transfer. Note that the capability + * for long transfers increases the driver size. + */ +/* #define USB_RX_USER_HOOK(data, len) if(usbRxToken == (uchar)USBPID_SETUP) blinkLED(); */ +/* This macro is a hook if you want to do unconventional things. If it is + * defined, it's inserted at the beginning of received message processing. + * If you eat the received message and don't want default processing to + * proceed, do a return after doing your things. One possible application + * (besides debugging) is to flash a status LED on each packet. + */ +/* #define USB_RESET_HOOK(resetStarts) if(!resetStarts){hadUsbReset();} */ +/* This macro is a hook if you need to know when an USB RESET occurs. It has + * one parameter which distinguishes between the start of RESET state and its + * end. + */ +/* #define USB_SET_ADDRESS_HOOK() hadAddressAssigned(); */ +/* This macro (if defined) is executed when a USB SET_ADDRESS request was + * received. + */ +#define USB_COUNT_SOF 1 +/* define this macro to 1 if you need the global variable "usbSofCount" which + * counts SOF packets. This feature requires that the hardware interrupt is + * connected to D- instead of D+. + */ +/* #ifdef __ASSEMBLER__ + * macro myAssemblerMacro + * in YL, TCNT0 + * sts timer0Snapshot, YL + * endm + * #endif + * #define USB_SOF_HOOK myAssemblerMacro + * This macro (if defined) is executed in the assembler module when a + * Start Of Frame condition is detected. It is recommended to define it to + * the name of an assembler macro which is defined here as well so that more + * than one assembler instruction can be used. The macro may use the register + * YL and modify SREG. If it lasts longer than a couple of cycles, USB messages + * immediately after an SOF pulse may be lost and must be retried by the host. + * What can you do with this hook? Since the SOF signal occurs exactly every + * 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in + * designs running on the internal RC oscillator. + * Please note that Start Of Frame detection works only if D- is wired to the + * interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES! + */ +#define USB_CFG_CHECK_DATA_TOGGLING 0 +/* define this macro to 1 if you want to filter out duplicate data packets + * sent by the host. Duplicates occur only as a consequence of communication + * errors, when the host does not receive an ACK. Please note that you need to + * implement the filtering yourself in usbFunctionWriteOut() and + * usbFunctionWrite(). Use the global usbCurrentDataToken and a static variable + * for each control- and out-endpoint to check for duplicate packets. + */ +#define USB_CFG_HAVE_MEASURE_FRAME_LENGTH 0 +/* define this macro to 1 if you want the function usbMeasureFrameLength() + * compiled in. This function can be used to calibrate the AVR's RC oscillator. + */ +#define USB_USE_FAST_CRC 0 +/* The assembler module has two implementations for the CRC algorithm. One is + * faster, the other is smaller. This CRC routine is only used for transmitted + * messages where timing is not critical. The faster routine needs 31 cycles + * per byte while the smaller one needs 61 to 69 cycles. The faster routine + * may be worth the 32 bytes bigger code size if you transmit lots of data and + * run the AVR close to its limit. + */ + +/* -------------------------- Device Description --------------------------- */ + +#define USB_CFG_VENDOR_ID (VENDOR_ID & 0xFF), ((VENDOR_ID >> 8) & 0xFF) +/* USB vendor ID for the device, low byte first. If you have registered your + * own Vendor ID, define it here. Otherwise you may use one of obdev's free + * shared VID/PID pairs. Be sure to read USB-IDs-for-free.txt for rules! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_ID (PRODUCT_ID & 0xFF), ((PRODUCT_ID >> 8) & 0xFF) +/* This is the ID of the product, low byte first. It is interpreted in the + * scope of the vendor ID. If you have registered your own VID with usb.org + * or if you have licensed a PID from somebody else, define it here. Otherwise + * you may use one of obdev's free shared VID/PID pairs. See the file + * USB-IDs-for-free.txt for details! + * *** IMPORTANT NOTE *** + * This template uses obdev's shared VID/PID pair for Vendor Class devices + * with libusb: 0x16c0/0x5dc. Use this VID/PID pair ONLY if you understand + * the implications! + */ +#define USB_CFG_DEVICE_VERSION 0x00, 0x02 +/* Version number of the device: Minor number first, then major number. + */ +#define USB_CFG_VENDOR_NAME 'P','e','r','c','e','n','t' +#define USB_CFG_VENDOR_NAME_LEN 7 +/* These two values define the vendor name returned by the USB device. The name + * must be given as a list of characters under single quotes. The characters + * are interpreted as Unicode (UTF-16) entities. + * If you don't want a vendor name string, undefine these macros. + * ALWAYS define a vendor name containing your Internet domain name if you use + * obdev's free shared VID/PID pair. See the file USB-IDs-for-free.txt for + * details. + */ +#define USB_CFG_DEVICE_NAME 'S','k','o','g',' ','T','K','L' +#define USB_CFG_DEVICE_NAME_LEN 8 +/* Same as above for the device name. If you don't want a device name, undefine + * the macros. See the file USB-IDs-for-free.txt before you assign a name if + * you use a shared VID/PID. + */ +/*#define USB_CFG_SERIAL_NUMBER 'N', 'o', 'n', 'e' */ +/*#define USB_CFG_SERIAL_NUMBER_LEN 0 */ +/* Same as above for the serial number. If you don't want a serial number, + * undefine the macros. + * It may be useful to provide the serial number through other means than at + * compile time. See the section about descriptor properties below for how + * to fine tune control over USB descriptors such as the string descriptor + * for the serial number. + */ +#define USB_CFG_DEVICE_CLASS 0 +#define USB_CFG_DEVICE_SUBCLASS 0 +/* See USB specification if you want to conform to an existing device class. + * Class 0xff is "vendor specific". + */ +#define USB_CFG_INTERFACE_CLASS 3 /* HID */ +#define USB_CFG_INTERFACE_SUBCLASS 1 /* Boot */ +#define USB_CFG_INTERFACE_PROTOCOL 1 /* Keyboard */ +/* See USB specification if you want to conform to an existing device class or + * protocol. The following classes must be set at interface level: + * HID class is 3, no subclass and protocol required (but may be useful!) + * CDC class is 2, use subclass 2 and protocol 1 for ACM + */ +#define USB_CFG_HID_REPORT_DESCRIPTOR_LENGTH 0 +/* Define this to the length of the HID report descriptor, if you implement + * an HID device. Otherwise don't define it or define it to 0. + * If you use this define, you must add a PROGMEM character array named + * "usbHidReportDescriptor" to your code which contains the report descriptor. + * Don't forget to keep the array and this define in sync! + */ + +/* #define USB_PUBLIC static */ +/* Use the define above if you #include usbdrv.c instead of linking against it. + * This technique saves a couple of bytes in flash memory. + */ + +/* ------------------- Fine Control over USB Descriptors ------------------- */ +/* If you don't want to use the driver's default USB descriptors, you can + * provide our own. These can be provided as (1) fixed length static data in + * flash memory, (2) fixed length static data in RAM or (3) dynamically at + * runtime in the function usbFunctionDescriptor(). See usbdrv.h for more + * information about this function. + * Descriptor handling is configured through the descriptor's properties. If + * no properties are defined or if they are 0, the default descriptor is used. + * Possible properties are: + * + USB_PROP_IS_DYNAMIC: The data for the descriptor should be fetched + * at runtime via usbFunctionDescriptor(). If the usbMsgPtr mechanism is + * used, the data is in FLASH by default. Add property USB_PROP_IS_RAM if + * you want RAM pointers. + * + USB_PROP_IS_RAM: The data returned by usbFunctionDescriptor() or found + * in static memory is in RAM, not in flash memory. + * + USB_PROP_LENGTH(len): If the data is in static memory (RAM or flash), + * the driver must know the descriptor's length. The descriptor itself is + * found at the address of a well known identifier (see below). + * List of static descriptor names (must be declared PROGMEM if in flash): + * char usbDescriptorDevice[]; + * char usbDescriptorConfiguration[]; + * char usbDescriptorHidReport[]; + * char usbDescriptorString0[]; + * int usbDescriptorStringVendor[]; + * int usbDescriptorStringDevice[]; + * int usbDescriptorStringSerialNumber[]; + * Other descriptors can't be provided statically, they must be provided + * dynamically at runtime. + * + * Descriptor properties are or-ed or added together, e.g.: + * #define USB_CFG_DESCR_PROPS_DEVICE (USB_PROP_IS_RAM | USB_PROP_LENGTH(18)) + * + * The following descriptors are defined: + * USB_CFG_DESCR_PROPS_DEVICE + * USB_CFG_DESCR_PROPS_CONFIGURATION + * USB_CFG_DESCR_PROPS_STRINGS + * USB_CFG_DESCR_PROPS_STRING_0 + * USB_CFG_DESCR_PROPS_STRING_VENDOR + * USB_CFG_DESCR_PROPS_STRING_PRODUCT + * USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER + * USB_CFG_DESCR_PROPS_HID + * USB_CFG_DESCR_PROPS_HID_REPORT + * USB_CFG_DESCR_PROPS_UNKNOWN (for all descriptors not handled by the driver) + * + * Note about string descriptors: String descriptors are not just strings, they + * are Unicode strings prefixed with a 2 byte header. Example: + * int serialNumberDescriptor[] = { + * USB_STRING_DESCRIPTOR_HEADER(6), + * 'S', 'e', 'r', 'i', 'a', 'l' + * }; + */ + +#define USB_CFG_DESCR_PROPS_DEVICE 0 +#define USB_CFG_DESCR_PROPS_CONFIGURATION USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_CONFIGURATION 0 +#define USB_CFG_DESCR_PROPS_STRINGS 0 +#define USB_CFG_DESCR_PROPS_STRING_0 0 +#define USB_CFG_DESCR_PROPS_STRING_VENDOR 0 +#define USB_CFG_DESCR_PROPS_STRING_PRODUCT 0 +#define USB_CFG_DESCR_PROPS_STRING_SERIAL_NUMBER 0 +#define USB_CFG_DESCR_PROPS_HID USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID 0 +#define USB_CFG_DESCR_PROPS_HID_REPORT USB_PROP_IS_DYNAMIC +//#define USB_CFG_DESCR_PROPS_HID_REPORT 0 +#define USB_CFG_DESCR_PROPS_UNKNOWN 0 + +#define usbMsgPtr_t unsigned short +/* If usbMsgPtr_t is not defined, it defaults to 'uchar *'. We define it to + * a scalar type here because gcc generates slightly shorter code for scalar + * arithmetics than for pointer arithmetics. Remove this define for backward + * type compatibility or define it to an 8 bit type if you use data in RAM only + * and all RAM is below 256 bytes (tiny memory model in IAR CC). + */ + +/* ----------------------- Optional MCU Description ------------------------ */ + +/* The following configurations have working defaults in usbdrv.h. You + * usually don't need to set them explicitly. Only if you want to run + * the driver on a device which is not yet supported or with a compiler + * which is not fully supported (such as IAR C) or if you use a differnt + * interrupt than INT0, you may have to define some of these. + */ +/* #define USB_INTR_CFG MCUCR */ +/* #define USB_INTR_CFG_SET ((1 << ISC00) | (1 << ISC01)) */ +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE GIMSK */ +/* #define USB_INTR_ENABLE_BIT INT0 */ +/* #define USB_INTR_PENDING GIFR */ +/* #define USB_INTR_PENDING_BIT INTF0 */ +/* #define USB_INTR_VECTOR INT0_vect */ + +/* Set INT1 for D- falling edge to count SOF */ +/* #define USB_INTR_CFG EICRA */ +#define USB_INTR_CFG_SET ((1 << ISC11) | (0 << ISC10)) +/* #define USB_INTR_CFG_CLR 0 */ +/* #define USB_INTR_ENABLE EIMSK */ +#define USB_INTR_ENABLE_BIT INT1 +/* #define USB_INTR_PENDING EIFR */ +#define USB_INTR_PENDING_BIT INTF1 +#define USB_INTR_VECTOR INT1_vect + +#endif /* __usbconfig_h_included__ */ -- cgit v1.2.3 From fbcbf4492685108a7f257df4e06871abd9def4d7 Mon Sep 17 00:00:00 2001 From: Kyle Brown Date: Fri, 28 Dec 2018 10:31:15 -0800 Subject: Update feature_advanced_keycodes.md (#3672) * Update feature_advanced_keycodes.md Probably a better way to word it, but I've solved this issue on reddit several times, had to solve this for friends, ect. It's something worth being in the docs as it's a common issue, and not always intuitive. I have offered this change as I was told by several people "It was never mentioned in the docs". * Update feature_advanced_keycodes.md Clear up what was meant to be said. --- docs/feature_advanced_keycodes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/feature_advanced_keycodes.md b/docs/feature_advanced_keycodes.md index bda4972331..8c0a22fc67 100644 --- a/docs/feature_advanced_keycodes.md +++ b/docs/feature_advanced_keycodes.md @@ -21,7 +21,7 @@ Additionally, if at least one right-handed modifier is specified in a Mod Tap or # Switching and Toggling Layers -These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) +These functions allow you to activate layers in various ways. Note that layers are not generally independent layouts -- multiple layers can be activated at once, and it's typical for layers to use `KC_TRNS` to allow keypresses to pass through to lower layers. For a detailed explanation of layers, see [Keymap Overview](keymap.md#keymap-and-layers) When using momentary layer switching with MO(), LM(), TT(), or LT(), make sure to leave the key on the above layers transparent or it may not work as intended. * `DF(layer)` - switches the default layer. The default layer is the always-active base layer that other layers stack on top of. See below for more about the default layer. This might be used to switch from QWERTY to Dvorak layout. (Note that this is a temporary switch that only persists until the keyboard loses power. To modify the default layer in a persistent way requires deeper customization, such as calling the `set_single_persistent_default_layer` function inside of [process_record_user](custom_quantum_functions.md#programming-the-behavior-of-any-keycode).) * `MO(layer)` - momentarily activates *layer*. As soon as you let go of the key, the layer is deactivated. -- cgit v1.2.3 From 93b004c943a4b13bd640fc83000e910b72cb4640 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Fri, 28 Dec 2018 20:07:56 +0100 Subject: Keep pressed keys on layer state change (fixes #2053, #2279) (#3905) * Keep pressed keys on layer state change * Add doc comment for clear_keyboard_but_mods_and_keys * Keep pressed keys only if PREVENT_STUCK_MODIFIERS is on * Check STRICT_LAYER_RELEASE instead of PREVENT_STUCK_MODIFIERS --- tmk_core/common/action.c | 11 ++++++++++- tmk_core/common/action.h | 1 + tmk_core/common/action_layer.c | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index 456d1e25fe..b99c2acaa7 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -898,10 +898,19 @@ void clear_keyboard(void) * FIXME: Needs documentation. */ void clear_keyboard_but_mods(void) +{ + clear_keys(); + clear_keyboard_but_mods_and_keys(); +} + +/** \brief Utilities for actions. (FIXME: Needs better description) + * + * FIXME: Needs documentation. + */ +void clear_keyboard_but_mods_and_keys() { clear_weak_mods(); clear_macro_mods(); - clear_keys(); send_keyboard_report(); #ifdef MOUSEKEY_ENABLE mousekey_clear(); diff --git a/tmk_core/common/action.h b/tmk_core/common/action.h index 5d797fd628..8e47e5339e 100644 --- a/tmk_core/common/action.h +++ b/tmk_core/common/action.h @@ -94,6 +94,7 @@ void unregister_mods(uint8_t mods); //void set_mods(uint8_t mods); void clear_keyboard(void); void clear_keyboard_but_mods(void); +void clear_keyboard_but_mods_and_keys(void); void layer_switch(uint8_t new_layer); bool is_tap_key(keypos_t key); diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index b8dcb34f3a..120ce3f51b 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -44,7 +44,11 @@ static void default_layer_state_set(uint32_t state) default_layer_debug(); debug(" to "); default_layer_state = state; default_layer_debug(); debug("\n"); +#ifdef STRICT_LAYER_RELEASE clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Default Layer Print @@ -127,7 +131,11 @@ void layer_state_set(uint32_t state) layer_debug(); dprint(" to "); layer_state = state; layer_debug(); dprintln(); +#ifdef STRICT_LAYER_RELEASE clear_keyboard_but_mods(); // To avoid stuck keys +#else + clear_keyboard_but_mods_and_keys(); // Don't reset held keys +#endif } /** \brief Layer clear -- cgit v1.2.3 From c0859ac096f1e4251351bb0a5a04b3ae4a9451f4 Mon Sep 17 00:00:00 2001 From: Danny Date: Fri, 28 Dec 2018 16:02:53 -0500 Subject: Update split keyboard docs (#4735) * Remove unused I2C_MASTER_RIGHT setting * Update documentation about split keyboard options --- docs/config_options.md | 37 +++++++++++++++++++++++++++++++++++-- quantum/split_common/serial.c | 2 +- quantum/split_common/split_util.c | 3 +-- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/docs/config_options.md b/docs/config_options.md index 4bbc5debda..085ab3ee58 100644 --- a/docs/config_options.md +++ b/docs/config_options.md @@ -197,8 +197,27 @@ If you define these options you will enable the associated feature, which may in Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in your rules.mk -* `#define SPLIT_HAND_PIN B7` - * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace 'B7' with the pin you are using. This is optional and you can still use the EEHANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. +### Setting Handedness + +One thing to remember, the side that the USB port is plugged into is always the master half. The side not plugged into USB is the slave. + +There are a few different ways to set handedness for split keyboards (listed in order of precedence): + +1. Set `SPLIT_HAND_PIN`: Reads a pin to determine handedness. If pin is high, it's the left side, if low, the half is determined to be the right side +2. Set `EE_HANDS` and flash `eeprom-lefthand.eep`/`eeprom-righthand.eep` to each half +3. Set `MASTER_RIGHT`: Half that is plugged into the USB port is determined to be the master and right half (inverse of the default) +4. Default: The side that is plugged into the USB port is the master half and is assumed to be the left half. The slave side is the right half + +* `#define SPLIT_HAND_PIN B7` + * For using high/low pin to determine handedness, low = right hand, high = left hand. Replace `B7` with the pin you are using. This is optional, and if you leave `SPLIT_HAND_PIN` undefined, then you can still use the EE_HANDS method or MASTER_LEFT / MASTER_RIGHT defines like the stock Let's Split uses. + +* `#define EE_HANDS` (only works if `SPLIT_HAND_PIN` is not defined) + * Reads the handedness value stored in the EEPROM after `eeprom-lefthand.eep`/`eeprom-righthand.eep` has been flashed to their respective halves. + +* `#define MASTER_RIGHT` + * Master half is defined to be the right half. + +### Other Options * `#define USE_I2C` * For using I2C instead of Serial (defaults to serial) @@ -206,6 +225,20 @@ Split Keyboard specific options, make sure you have 'SPLIT_KEYBOARD = yes' in yo * `#define SOFT_SERIAL_PIN D0` * When using serial, define this. `D0` or `D1`,`D2`,`D3`,`E6`. +* `#define MATRIX_ROW_PINS_RIGHT { }` +* `#define MATRIX_COL_PINS_RIGHT { }` + * If you want to specify a different pinout for the right half than the left half, you can define `MATRIX_ROW_PINS_RIGHT`/`MATRIX_COL_PINS_RIGHT`. Currently, the size of `MATRIX_ROW_PINS` must be the same as `MATRIX_ROW_PINS_RIGHT` and likewise for the definition of columns. + +* `#define SELECT_SOFT_SERIAL_SPEED ` (default speed is 1) + * Sets the protocol speed when using serial communication + * Speeds: + * 0: about 189kbps (Experimental only) + * 1: about 137kbps (default) + * 2: about 75kbps + * 3: about 39kbps + * 4: about 26kbps + * 5: about 20kbps + # The `rules.mk` File This is a [make](https://www.gnu.org/software/make/manual/make.html) file that is included by the top-level `Makefile`. It is used to set some information about the MCU that we will be compiling for as well as enabling and disabling certain features. diff --git a/quantum/split_common/serial.c b/quantum/split_common/serial.c index 4df8d103bd..1315377a34 100644 --- a/quantum/split_common/serial.c +++ b/quantum/split_common/serial.c @@ -90,7 +90,7 @@ #ifndef SELECT_SOFT_SERIAL_SPEED #define SELECT_SOFT_SERIAL_SPEED 1 -// 0: about 189kbps (Experiment only) +// 0: about 189kbps (Experimental only) // 1: about 137kbps (default) // 2: about 75kbps // 3: about 39kbps diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index e4475c5356..da04c8d3ff 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -36,8 +36,7 @@ static void setup_handedness(void) { #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else - // I2C_MASTER_RIGHT is deprecated, use MASTER_RIGHT instead, since this works for both serial and i2c - #if defined(I2C_MASTER_RIGHT) || defined(MASTER_RIGHT) + #ifdef(MASTER_RIGHT) isLeftHand = !has_usb(); #else isLeftHand = has_usb(); -- cgit v1.2.3 From 6b46c06018324d78bed863d823df53d71cefb2fd Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Fri, 28 Dec 2018 13:37:23 -0800 Subject: Fix Split Common Split_util.c typo --- quantum/split_common/split_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index da04c8d3ff..c613f265a3 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -36,7 +36,7 @@ static void setup_handedness(void) { #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); #else - #ifdef(MASTER_RIGHT) + #ifdef MASTER_RIGHT isLeftHand = !has_usb(); #else isLeftHand = has_usb(); -- cgit v1.2.3 From 2c6c483096f2ec1f37943975e9d62b901884c835 Mon Sep 17 00:00:00 2001 From: Max <17062872+westfoxtrot@users.noreply.github.com> Date: Sat, 29 Dec 2018 00:07:47 +0100 Subject: refactored cyclops keyboard project (#4734) * refactored cyclops keyboard project Moved the files into a subfolder to allow consistency in preparation for additional commits to come in the future. made some small adjustments to the configuration and keymap * Update keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c Co-Authored-By: westfoxtrot <17062872+westfoxtrot@users.noreply.github.com> * Update keyboards/westfoxtrot/cyclops/readme.md Co-Authored-By: westfoxtrot <17062872+westfoxtrot@users.noreply.github.com> * Update keyboards/westfoxtrot/cyclops/readme.md Co-Authored-By: westfoxtrot <17062872+westfoxtrot@users.noreply.github.com> * Update keyboards/westfoxtrot/cyclops/readme.md Co-Authored-By: westfoxtrot <17062872+westfoxtrot@users.noreply.github.com> --- keyboards/cyclops/config.h | 214 --------------------- keyboards/cyclops/cyclops.c | 43 ----- keyboards/cyclops/cyclops.h | 43 ----- keyboards/cyclops/info.json | 12 -- keyboards/cyclops/keymaps/default/config.h | 19 -- keyboards/cyclops/keymaps/default/keymap.c | 65 ------- keyboards/cyclops/keymaps/default/readme.md | 1 - keyboards/cyclops/readme.md | 13 -- keyboards/cyclops/rules.mk | 80 -------- keyboards/westfoxtrot/cyclops/config.h | 212 ++++++++++++++++++++ keyboards/westfoxtrot/cyclops/cyclops.c | 43 +++++ keyboards/westfoxtrot/cyclops/cyclops.h | 43 +++++ keyboards/westfoxtrot/cyclops/info.json | 12 ++ .../westfoxtrot/cyclops/keymaps/default/config.h | 19 ++ .../westfoxtrot/cyclops/keymaps/default/keymap.c | 53 +++++ .../westfoxtrot/cyclops/keymaps/default/readme.md | 1 + keyboards/westfoxtrot/cyclops/readme.md | 15 ++ keyboards/westfoxtrot/cyclops/rules.mk | 80 ++++++++ 18 files changed, 478 insertions(+), 490 deletions(-) delete mode 100644 keyboards/cyclops/config.h delete mode 100644 keyboards/cyclops/cyclops.c delete mode 100644 keyboards/cyclops/cyclops.h delete mode 100644 keyboards/cyclops/info.json delete mode 100644 keyboards/cyclops/keymaps/default/config.h delete mode 100644 keyboards/cyclops/keymaps/default/keymap.c delete mode 100644 keyboards/cyclops/keymaps/default/readme.md delete mode 100644 keyboards/cyclops/readme.md delete mode 100644 keyboards/cyclops/rules.mk create mode 100644 keyboards/westfoxtrot/cyclops/config.h create mode 100644 keyboards/westfoxtrot/cyclops/cyclops.c create mode 100644 keyboards/westfoxtrot/cyclops/cyclops.h create mode 100644 keyboards/westfoxtrot/cyclops/info.json create mode 100644 keyboards/westfoxtrot/cyclops/keymaps/default/config.h create mode 100644 keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c create mode 100644 keyboards/westfoxtrot/cyclops/keymaps/default/readme.md create mode 100644 keyboards/westfoxtrot/cyclops/readme.md create mode 100644 keyboards/westfoxtrot/cyclops/rules.mk diff --git a/keyboards/cyclops/config.h b/keyboards/cyclops/config.h deleted file mode 100644 index d6b637345e..0000000000 --- a/keyboards/cyclops/config.h +++ /dev/null @@ -1,214 +0,0 @@ -/* -Copyright 2018 'mechmerlin' - -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 - -#include "config_common.h" - -/* USB Device descriptor parameter */ -#define VENDOR_ID 0xFEED -#define PRODUCT_ID 0x0000 -#define DEVICE_VER 0x0001 -#define MANUFACTURER You -#define PRODUCT cyclops -#define DESCRIPTION A custom 66% keyboard - -/* key matrix size */ -#define MATRIX_ROWS 5 -#define MATRIX_COLS 15 - -/* - * Keyboard Matrix Assignments - * - * Change this to how you wired your keyboard - * COLS: AVR pins used for columns, left to right - * ROWS: AVR pins used for rows, top to bottom - * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) - * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) - * -*/ -#define MATRIX_ROW_PINS { D1, D0, D7, B4, F0 } -#define MATRIX_COL_PINS { D3, D2, D5, D6, B6, B1, B2, B3, C6, C7, F7, F6, F4, F5, F1 } -#define UNUSED_PINS - -/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ -#define DIODE_DIRECTION COL2ROW - -/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ -#define DEBOUNCING_DELAY 5 - -/* define if matrix has ghost (lacks anti-ghosting diodes) */ -//#define MATRIX_HAS_GHOST - -/* number of backlight levels */ - -/* 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 - -/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. - * This is userful for the Windows task manager shortcut (ctrl+shift+esc). - */ -// #define GRAVE_ESC_CTRL_OVERRIDE - -/* - * 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 - -/* - * Magic Key Options - * - * Magic keys are hotkey commands that allow control over firmware functions of - * the keyboard. They are best used in combination with the HID Listen program, - * found here: https://www.pjrc.com/teensy/hid_listen.html - * - * The options below allow the magic key functionality to be changed. This is - * useful if your keyboard/keypad is missing keys and you want magic key support. - * - */ - -/* key combination for magic key command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - -/* control how magic key switches layers */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false - -/* override magic key keymap */ -//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS -//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM -//#define MAGIC_KEY_HELP1 H -//#define MAGIC_KEY_HELP2 SLASH -//#define MAGIC_KEY_DEBUG D -//#define MAGIC_KEY_DEBUG_MATRIX X -//#define MAGIC_KEY_DEBUG_KBD K -//#define MAGIC_KEY_DEBUG_MOUSE M -//#define MAGIC_KEY_VERSION V -//#define MAGIC_KEY_STATUS S -//#define MAGIC_KEY_CONSOLE C -//#define MAGIC_KEY_LAYER0_ALT1 ESC -//#define MAGIC_KEY_LAYER0_ALT2 GRAVE -//#define MAGIC_KEY_LAYER0 0 -//#define MAGIC_KEY_LAYER1 1 -//#define MAGIC_KEY_LAYER2 2 -//#define MAGIC_KEY_LAYER3 3 -//#define MAGIC_KEY_LAYER4 4 -//#define MAGIC_KEY_LAYER5 5 -//#define MAGIC_KEY_LAYER6 6 -//#define MAGIC_KEY_LAYER7 7 -//#define MAGIC_KEY_LAYER8 8 -//#define MAGIC_KEY_LAYER9 9 -//#define MAGIC_KEY_BOOTLOADER PAUSE -//#define MAGIC_KEY_LOCK CAPS -//#define MAGIC_KEY_EEPROM E -//#define MAGIC_KEY_NKRO N -//#define MAGIC_KEY_SLEEP_LED Z - -/* - * 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 - -/* - * MIDI options - */ - -/* Prevent use of disabled MIDI features in the keymap */ -//#define MIDI_ENABLE_STRICT 1 - -/* enable basic MIDI features: - - MIDI notes can be sent when in Music mode is on -*/ -//#define MIDI_BASIC - -/* enable advanced MIDI features: - - MIDI notes can be added to the keymap - - Octave shift and transpose - - Virtual sustain, portamento, and modulation wheel - - etc. -*/ -//#define MIDI_ADVANCED - -/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ -//#define MIDI_TONE_KEYCODE_OCTAVES 1 - -/* - * HD44780 LCD Display Configuration - */ -/* -#define LCD_LINES 2 //< number of visible lines of the display -#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display - -#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode - -#if LCD_IO_MODE -#define LCD_PORT PORTB //< port for the LCD lines -#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 -#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 -#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 -#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 -#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 -#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 -#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 -#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 -#define LCD_RS_PORT LCD_PORT //< port for RS line -#define LCD_RS_PIN 3 //< pin for RS line -#define LCD_RW_PORT LCD_PORT //< port for RW line -#define LCD_RW_PIN 2 //< pin for RW line -#define LCD_E_PORT LCD_PORT //< port for Enable line -#define LCD_E_PIN 1 //< pin for Enable line -#endif -*/ - -/* Bootmagic Lite key configuration */ -// #define BOOTMAGIC_LITE_ROW 0 -// #define BOOTMAGIC_LITE_COLUMN 0 diff --git a/keyboards/cyclops/cyclops.c b/keyboards/cyclops/cyclops.c deleted file mode 100644 index 8a15e8950e..0000000000 --- a/keyboards/cyclops/cyclops.c +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 'mechmerlin' - * - * 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 . - */ -#include "cyclops.h" - -void matrix_init_kb(void) { - // put your keyboard start-up code here - // runs once when the firmware starts up - - matrix_init_user(); -} - -void matrix_scan_kb(void) { - // put your looping keyboard code here - // runs every cycle (a lot) - - matrix_scan_user(); -} - -bool process_record_kb(uint16_t keycode, keyrecord_t *record) { - // put your per-action keyboard code here - // runs for every action, just before processing by the firmware - - return process_record_user(keycode, record); -} - -void led_set_kb(uint8_t usb_led) { - // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here - - led_set_user(usb_led); -} diff --git a/keyboards/cyclops/cyclops.h b/keyboards/cyclops/cyclops.h deleted file mode 100644 index d85b4e9031..0000000000 --- a/keyboards/cyclops/cyclops.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Copyright 2018 'mechmerlin' - * - * 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 . - */ -#ifndef CYCLOPS_H -#define CYCLOPS_H - -#include "quantum.h" - -/* This a shortcut to help you visually see your layout. - * - * The first section contains all of the arguments representing the physical - * layout of the board and position of the keys. - * - * The second converts the arguments into a two-dimensional array which - * represents the switch matrix. - */ -#define LAYOUT( \ - K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ - K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ - K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ - K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ - K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ -) { \ - { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ - { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ - { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ - { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ - { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ -} - -#endif diff --git a/keyboards/cyclops/info.json b/keyboards/cyclops/info.json deleted file mode 100644 index e0e91222bc..0000000000 --- a/keyboards/cyclops/info.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "keyboard_name": "cyclops", - "url": "", - "maintainer": "qmk", - "width": 16.5, - "height": 5, - "layouts": { - "LAYOUT": { - "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Page Up", "x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Page Down", "x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":"|", "x":1.5, "y":3}, {"label":"Z", "x":2.5, "y":3}, {"label":"X", "x":3.5, "y":3}, {"label":"C", "x":4.5, "y":3}, {"label":"V", "x":5.5, "y":3}, {"label":"B", "x":6.5, "y":3}, {"label":"N", "x":7.5, "y":3}, {"label":"M", "x":8.5, "y":3}, {"label":"<", "x":9.5, "y":3}, {"label":">", "x":10.5, "y":3}, {"label":"?", "x":11.5, "y":3}, {"x":12.5, "y":3}, {"label":"Shift", "x":13.5, "y":3}, {"label":"\u2191", "x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4, "w":1.25}, {"label":"Alt", "x":2.75, "y":4, "w":1.5}, {"x":4.25, "y":4, "w":6.5}, {"label":"Alt", "x":10.75, "y":4, "w":1.5}, {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13.5, "y":4}, {"label":"\u2193", "x":14.5, "y":4}, {"label":"\u2192", "x":15.5, "y":4}] - } - } -} diff --git a/keyboards/cyclops/keymaps/default/config.h b/keyboards/cyclops/keymaps/default/config.h deleted file mode 100644 index 6278fae658..0000000000 --- a/keyboards/cyclops/keymaps/default/config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Copyright 2018 'mechmerlin' - * - * 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 - -// place overrides here diff --git a/keyboards/cyclops/keymaps/default/keymap.c b/keyboards/cyclops/keymaps/default/keymap.c deleted file mode 100644 index 875fbe244f..0000000000 --- a/keyboards/cyclops/keymaps/default/keymap.c +++ /dev/null @@ -1,65 +0,0 @@ -/* Copyright 2018 'mechmerlin' - * - * 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 . - */ -#include QMK_KEYBOARD_H - -// Defines the keycodes used by our macros in process_record_user -enum custom_keycodes { - QMKBEST = SAFE_RANGE, - QMKURL -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [0] = LAYOUT( - KC_ESC, 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_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_PGDN, - KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, KC_RGHT, - KC_LSFT, KC_NUBS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, MO(1), KC_0, KC_UP, - KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_ENT, KC_DOWN), -}; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QMKBEST: - if (record->event.pressed) { - // when keycode QMKBEST is pressed - SEND_STRING("QMK is the best thing ever!"); - } else { - // when keycode QMKBEST is released - } - break; - case QMKURL: - if (record->event.pressed) { - // when keycode QMKURL is pressed - SEND_STRING("https://qmk.fm/" SS_TAP(X_ENTER)); - } else { - // when keycode QMKURL is released - } - break; - } - return true; -} - -void matrix_init_user(void) { - -} - -void matrix_scan_user(void) { - -} - -void led_set_user(uint8_t usb_led) { - -} diff --git a/keyboards/cyclops/keymaps/default/readme.md b/keyboards/cyclops/keymaps/default/readme.md deleted file mode 100644 index b1e2b84a3b..0000000000 --- a/keyboards/cyclops/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# The default keymap for cyclops diff --git a/keyboards/cyclops/readme.md b/keyboards/cyclops/readme.md deleted file mode 100644 index fcf6c15466..0000000000 --- a/keyboards/cyclops/readme.md +++ /dev/null @@ -1,13 +0,0 @@ -# Cyclops - -66% Alps Keyboard in ISO layout. - -Keyboard Maintainer: [MechMerlin](https://github.com/mechmerlin) -Hardware Supported: 66% Alps Keyboard -Hardware Availability: A very limited number were made. - -Make example for this keyboard (after setting up your build environment): - - make cyclops: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/cyclops/rules.mk b/keyboards/cyclops/rules.mk deleted file mode 100644 index bc370be039..0000000000 --- a/keyboards/cyclops/rules.mk +++ /dev/null @@ -1,80 +0,0 @@ -# MCU name -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 = atmel-dfu - - -# 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 = no # 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) diff --git a/keyboards/westfoxtrot/cyclops/config.h b/keyboards/westfoxtrot/cyclops/config.h new file mode 100644 index 0000000000..f54f818d53 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/config.h @@ -0,0 +1,212 @@ +/* +Copyright 2018 westfoxtrot + +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 + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0x21FF +#define PRODUCT_ID 0x0A66 +#define DEVICE_VER 0x0001 +#define MANUFACTURER westfoxtrot +#define PRODUCT cyclops +#define DESCRIPTION AEK66 + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 15 + +/* + * Keyboard Matrix Assignments + * + * Change this to how you wired your keyboard + * COLS: AVR pins used for columns, left to right + * ROWS: AVR pins used for rows, top to bottom + * DIODE_DIRECTION: COL2ROW = COL = Anode (+), ROW = Cathode (-, marked on diode) + * ROW2COL = ROW = Anode (+), COL = Cathode (-, marked on diode) + * +*/ +#define MATRIX_ROW_PINS { D1, D0, D7, B4, F0 } +#define MATRIX_COL_PINS { D3, D2, D5, D6, B6, B1, B2, B3, C6, C7, F7, F6, F4, F5, F1 } +#define UNUSED_PINS + +/* COL2ROW, ROW2COL, or CUSTOM_MATRIX */ +#define DIODE_DIRECTION COL2ROW + +/* Debounce reduces chatter (unintended double-presses) - set 0 if debouncing is not needed */ +#define DEBOUNCING_DELAY 5 + +/* define if matrix has ghost (lacks anti-ghosting diodes) */ +//#define MATRIX_HAS_GHOST + +/* number of backlight levels */ + +/* 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 + +/* If defined, GRAVE_ESC will always act as ESC when CTRL is held. + * This is userful for the Windows task manager shortcut (ctrl+shift+esc). + */ +// #define GRAVE_ESC_CTRL_OVERRIDE + +/* + * 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 + +/* + * Magic Key Options + * + * Magic keys are hotkey commands that allow control over firmware functions of + * the keyboard. They are best used in combination with the HID Listen program, + * found here: https://www.pjrc.com/teensy/hid_listen.html + * + * The options below allow the magic key functionality to be changed. This is + * useful if your keyboard/keypad is missing keys and you want magic key support. + * + */ + +/* key combination for magic key command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* control how magic key switches layers */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS true +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM false + +/* override magic key keymap */ +//#define MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +//#define MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM +//#define MAGIC_KEY_HELP1 H +//#define MAGIC_KEY_HELP2 SLASH +//#define MAGIC_KEY_DEBUG D +//#define MAGIC_KEY_DEBUG_MATRIX X +//#define MAGIC_KEY_DEBUG_KBD K +//#define MAGIC_KEY_DEBUG_MOUSE M +//#define MAGIC_KEY_VERSION V +//#define MAGIC_KEY_STATUS S +//#define MAGIC_KEY_CONSOLE C +//#define MAGIC_KEY_LAYER0_ALT1 ESC +//#define MAGIC_KEY_LAYER0_ALT2 GRAVE +//#define MAGIC_KEY_LAYER0 0 +//#define MAGIC_KEY_LAYER1 1 +//#define MAGIC_KEY_LAYER2 2 +//#define MAGIC_KEY_LAYER3 3 +//#define MAGIC_KEY_LAYER4 4 +//#define MAGIC_KEY_LAYER5 5 +//#define MAGIC_KEY_LAYER6 6 +//#define MAGIC_KEY_LAYER7 7 +//#define MAGIC_KEY_LAYER8 8 +//#define MAGIC_KEY_LAYER9 9 +//#define MAGIC_KEY_BOOTLOADER PAUSE +//#define MAGIC_KEY_LOCK CAPS +//#define MAGIC_KEY_EEPROM E +//#define MAGIC_KEY_NKRO N +//#define MAGIC_KEY_SLEEP_LED Z + +/* + * 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 + +/* + * MIDI options + */ + +/* Prevent use of disabled MIDI features in the keymap */ +//#define MIDI_ENABLE_STRICT 1 + +/* enable basic MIDI features: + - MIDI notes can be sent when in Music mode is on +*/ +//#define MIDI_BASIC + +/* enable advanced MIDI features: + - MIDI notes can be added to the keymap + - Octave shift and transpose + - Virtual sustain, portamento, and modulation wheel + - etc. +*/ +//#define MIDI_ADVANCED + +/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ +//#define MIDI_TONE_KEYCODE_OCTAVES 1 + +/* + * HD44780 LCD Display Configuration + */ +/* +#define LCD_LINES 2 //< number of visible lines of the display +#define LCD_DISP_LENGTH 16 //< visibles characters per line of the display +#define LCD_IO_MODE 1 //< 0: memory mapped mode, 1: IO port mode +#if LCD_IO_MODE +#define LCD_PORT PORTB //< port for the LCD lines +#define LCD_DATA0_PORT LCD_PORT //< port for 4bit data bit 0 +#define LCD_DATA1_PORT LCD_PORT //< port for 4bit data bit 1 +#define LCD_DATA2_PORT LCD_PORT //< port for 4bit data bit 2 +#define LCD_DATA3_PORT LCD_PORT //< port for 4bit data bit 3 +#define LCD_DATA0_PIN 4 //< pin for 4bit data bit 0 +#define LCD_DATA1_PIN 5 //< pin for 4bit data bit 1 +#define LCD_DATA2_PIN 6 //< pin for 4bit data bit 2 +#define LCD_DATA3_PIN 7 //< pin for 4bit data bit 3 +#define LCD_RS_PORT LCD_PORT //< port for RS line +#define LCD_RS_PIN 3 //< pin for RS line +#define LCD_RW_PORT LCD_PORT //< port for RW line +#define LCD_RW_PIN 2 //< pin for RW line +#define LCD_E_PORT LCD_PORT //< port for Enable line +#define LCD_E_PIN 1 //< pin for Enable line +#endif +*/ + +/* Bootmagic Lite key configuration */ +// #define BOOTMAGIC_LITE_ROW 0 +// #define BOOTMAGIC_LITE_COLUMN 0 \ No newline at end of file diff --git a/keyboards/westfoxtrot/cyclops/cyclops.c b/keyboards/westfoxtrot/cyclops/cyclops.c new file mode 100644 index 0000000000..aea51e6b34 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/cyclops.c @@ -0,0 +1,43 @@ +/* Copyright 2018 westfoxtrot + * + * 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 . + */ +#include "cyclops.h" + +void matrix_init_kb(void) { + // put your keyboard start-up code here + // runs once when the firmware starts up + + matrix_init_user(); +} + +void matrix_scan_kb(void) { + // put your looping keyboard code here + // runs every cycle (a lot) + + matrix_scan_user(); +} + +bool process_record_kb(uint16_t keycode, keyrecord_t *record) { + // put your per-action keyboard code here + // runs for every action, just before processing by the firmware + + return process_record_user(keycode, record); +} + +void led_set_kb(uint8_t usb_led) { + // put your keyboard LED indicator (ex: Caps Lock LED) toggling code here + + led_set_user(usb_led); +} \ No newline at end of file diff --git a/keyboards/westfoxtrot/cyclops/cyclops.h b/keyboards/westfoxtrot/cyclops/cyclops.h new file mode 100644 index 0000000000..f32d2fd441 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/cyclops.h @@ -0,0 +1,43 @@ +/* Copyright 2018 westfoxtrot + * + * 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 . + */ +#ifndef CYCLOPS_H +#define CYCLOPS_H + +#include "quantum.h" + +/* This a shortcut to help you visually see your layout. + * + * The first section contains all of the arguments representing the physical + * layout of the board and position of the keys. + * + * The second converts the arguments into a two-dimensional array which + * represents the switch matrix. + */ +#define LAYOUT( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E, \ + K10, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E, \ + K20, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E, \ + K40, K41, K42, K46, K4A, K4B, K4C, K4D, K4E \ +) { \ + { K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, K0D, K0E }, \ + { K10, KC_NO, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, K1D, K1E }, \ + { K20, KC_NO, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, K2D, K2E }, \ + { K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C, K3D, K3E }, \ + { K40, K41, K42, KC_NO, KC_NO, KC_NO, K46, KC_NO, KC_NO, KC_NO, K4A, K4B, K4C, K4D, K4E } \ +} + +#endif diff --git a/keyboards/westfoxtrot/cyclops/info.json b/keyboards/westfoxtrot/cyclops/info.json new file mode 100644 index 0000000000..a215a8a3de --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/info.json @@ -0,0 +1,12 @@ +{ + "keyboard_name": "cyclops", + "url": "", + "maintainer": "qmk", + "width": 16.5, + "height": 5, + "layouts": { + "LAYOUT": { + "layout": [{"label":"~", "x":0, "y":0}, {"label":"!", "x":1, "y":0}, {"label":"@", "x":2, "y":0}, {"label":"#", "x":3, "y":0}, {"label":"$", "x":4, "y":0}, {"label":"%", "x":5, "y":0}, {"label":"^", "x":6, "y":0}, {"label":"&", "x":7, "y":0}, {"label":"*", "x":8, "y":0}, {"label":"(", "x":9, "y":0}, {"label":")", "x":10, "y":0}, {"label":"_", "x":11, "y":0}, {"label":"+", "x":12, "y":0}, {"label":"Backspace", "x":13, "y":0, "w":2}, {"label":"Page Up", "x":15.5, "y":0}, {"label":"Tab", "x":0, "y":1, "w":1.5}, {"label":"Q", "x":1.5, "y":1}, {"label":"W", "x":2.5, "y":1}, {"label":"E", "x":3.5, "y":1}, {"label":"R", "x":4.5, "y":1}, {"label":"T", "x":5.5, "y":1}, {"label":"Y", "x":6.5, "y":1}, {"label":"U", "x":7.5, "y":1}, {"label":"I", "x":8.5, "y":1}, {"label":"O", "x":9.5, "y":1}, {"label":"P", "x":10.5, "y":1}, {"label":"{", "x":11.5, "y":1}, {"label":"}", "x":12.5, "y":1}, {"label":"Enter", "x":13.75, "y":1, "w":1.25, "h":2}, {"label":"Page Down", "x":15.5, "y":1}, {"label":"Caps Lock", "x":0, "y":2, "w":1.75}, {"label":"A", "x":1.75, "y":2}, {"label":"S", "x":2.75, "y":2}, {"label":"D", "x":3.75, "y":2}, {"label":"F", "x":4.75, "y":2}, {"label":"G", "x":5.75, "y":2}, {"label":"H", "x":6.75, "y":2}, {"label":"J", "x":7.75, "y":2}, {"label":"K", "x":8.75, "y":2}, {"label":"L", "x":9.75, "y":2}, {"label":":", "x":10.75, "y":2}, {"label":"\"", "x":11.75, "y":2}, {"label":"~", "x":12.75, "y":2}, {"label":"Shift", "x":0, "y":3, "w":1.5}, {"label":"|", "x":1.5, "y":3}, {"label":"Z", "x":2.5, "y":3}, {"label":"X", "x":3.5, "y":3}, {"label":"C", "x":4.5, "y":3}, {"label":"V", "x":5.5, "y":3}, {"label":"B", "x":6.5, "y":3}, {"label":"N", "x":7.5, "y":3}, {"label":"M", "x":8.5, "y":3}, {"label":"<", "x":9.5, "y":3}, {"label":">", "x":10.5, "y":3}, {"label":"?", "x":11.5, "y":3}, {"x":12.5, "y":3}, {"label":"Shift", "x":13.5, "y":3}, {"label":"\u2191", "x":14.5, "y":3}, {"label":"Ctrl", "x":0, "y":4, "w":1.5}, {"label":"Win", "x":1.5, "y":4, "w":1.25}, {"label":"Alt", "x":2.75, "y":4, "w":1.5}, {"x":4.25, "y":4, "w":6.5}, {"label":"Alt", "x":10.75, "y":4, "w":1.5}, {"label":"Ctrl", "x":12.25, "y":4, "w":1.25}, {"label":"\u2190", "x":13.5, "y":4}, {"label":"\u2193", "x":14.5, "y":4}, {"label":"\u2192", "x":15.5, "y":4}] + } + } +} \ No newline at end of file diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/config.h b/keyboards/westfoxtrot/cyclops/keymaps/default/config.h new file mode 100644 index 0000000000..6278fae658 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 'mechmerlin' + * + * 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 + +// place overrides here diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c b/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c new file mode 100644 index 0000000000..c850b9da06 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/keymap.c @@ -0,0 +1,53 @@ +/* Copyright 2018 westfoxtrot + * + * 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 . + */ + +#include QMK_KEYBOARD_H + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + // Default layer + [0] = LAYOUT( + KC_ESC, 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_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_PGDN, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_NUHS, 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_NO, KC_RSFT, KC_UP, + KC_CAPS, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_LEFT, KC_DOWN, KC_RGHT), + + // Fn1 Layer + [1] = LAYOUT( + KC_GRV, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F11, KC_DEL, KC_HOME, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_END, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_ENT, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + RESET, _______, _______, _______, _______, _______, _______, _______, _______), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md b/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md new file mode 100644 index 0000000000..b1e2b84a3b --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/keymaps/default/readme.md @@ -0,0 +1 @@ +# The default keymap for cyclops diff --git a/keyboards/westfoxtrot/cyclops/readme.md b/keyboards/westfoxtrot/cyclops/readme.md new file mode 100644 index 0000000000..e026c41194 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/readme.md @@ -0,0 +1,15 @@ +# cyclops + +![cyclops](https://github.com/westfoxtrot/Cyclops) + +66% Alps Keyboard in ISO layout. + + Keyboard Maintainer: [westfoxtrot](https://github.com/westfoxtrot) + Hardware Supported: Cyclops (AEKISO66) PCB + Hardware Availability: Files released here (https://github.com/westfoxtrot/Cyclops) + +Make example for this keyboard (after setting up your build environment): + + make westfoxtrot/cyclops: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/westfoxtrot/cyclops/rules.mk b/keyboards/westfoxtrot/cyclops/rules.mk new file mode 100644 index 0000000000..10ea513910 --- /dev/null +++ b/keyboards/westfoxtrot/cyclops/rules.mk @@ -0,0 +1,80 @@ +# MCU name +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 = atmel-dfu + + +# 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 = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # 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) \ No newline at end of file -- cgit v1.2.3 From d9abb833e54ff8981a2bc1d17c6f863b49430fcd Mon Sep 17 00:00:00 2001 From: Jason Thigpen Date: Fri, 28 Dec 2018 22:27:35 -0800 Subject: Add my zeal60 keymap (#4732) * Add my zeal60 keymap * Temporarily remove failing community layout from zeal60 make rules * Revert "Temporarily remove failing community layout from zeal60 make rules" This reverts commit ffd0018fb1dcf3d5f90d4a226c437d4e85430cce. --- keyboards/zeal60/keymaps/crd/config.h | 29 ++++++++++++++++++++++++++ keyboards/zeal60/keymaps/crd/keymap.c | 39 +++++++++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 keyboards/zeal60/keymaps/crd/config.h create mode 100644 keyboards/zeal60/keymaps/crd/keymap.c diff --git a/keyboards/zeal60/keymaps/crd/config.h b/keyboards/zeal60/keymaps/crd/config.h new file mode 100644 index 0000000000..a70f9da7e6 --- /dev/null +++ b/keyboards/zeal60/keymaps/crd/config.h @@ -0,0 +1,29 @@ +#pragma once + +/* enable/disable LEDs based on layout */ +#undef RGB_BACKLIGHT_USE_SPLIT_BACKSPACE +#define RGB_BACKLIGHT_USE_SPLIT_BACKSPACE 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_LEFT_SHIFT 0 + +#undef RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT +#define RGB_BACKLIGHT_USE_SPLIT_RIGHT_SHIFT 1 + +#undef RGB_BACKLIGHT_USE_7U_SPACEBAR +#define RGB_BACKLIGHT_USE_7U_SPACEBAR 1 + +#undef RGB_BACKLIGHT_USE_ISO_ENTER +#define RGB_BACKLIGHT_USE_ISO_ENTER 0 + +#undef RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS +#define RGB_BACKLIGHT_DISABLE_HHKB_BLOCKER_LEDS 0 + +#undef RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED +#define RGB_BACKLIGHT_DISABLE_WHEN_USB_SUSPENDED 1 + +#undef RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT +#define RGB_BACKLIGHT_DISABLE_AFTER_TIMEOUT 3 + +#undef RGB_BACKLIGHT_EFFECT +#define RGB_BACKLIGHT_EFFECT 0 \ No newline at end of file diff --git a/keyboards/zeal60/keymaps/crd/keymap.c b/keyboards/zeal60/keymaps/crd/keymap.c new file mode 100644 index 0000000000..971782561c --- /dev/null +++ b/keyboards/zeal60/keymaps/crd/keymap.c @@ -0,0 +1,39 @@ +// tsangan layout for Zeal60 +#include QMK_KEYBOARD_H + +enum keyboard_layers { + _BL = 0, // Base Layer + _FL, // Function Layer + _CL // Control Layer +}; + +// Custom #defined keycodes (shorter macros for readability) +#define KC_CTES CTL_T(KC_ESC) +#define KC_RSUP RSFT_T(KC_UP) +#define KC_RGLT RCMD_T(KC_LEFT) +#define KC_RADN LT(_CL, KC_DOWN) +#define KC_RCRT RCTL_T(KC_RIGHT) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_BL] = LAYOUT_60_ansi_split_bs_rshift( + 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, XXXXXXX, + 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_CTES, 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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSUP, MO(_FL), + KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, XXXXXXX, KC_RGLT, KC_RADN, KC_RCRT + ), + [_FL] = LAYOUT_60_ansi_split_bs_rshift( + 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_DEL, _______, + _______, KC_HOME, KC_UP, KC_END, _______, _______, _______, _______, KC_MUTE, _______, _______, KC_PGDN, KC_PGUP, _______, + _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, KC_SLCK, KC_VOLD, KC_VOLU, KC_PAUS, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), + [_CL] = LAYOUT_60_ansi_split_bs_rshift( + _______, EF_DEC, EF_INC, H1_DEC, H1_INC, H2_DEC, H2_INC, _______, _______, _______, _______, BR_DEC, BR_INC, _______, _______, + _______, _______, _______, S1_DEC, S1_INC, S2_DEC, S2_INC, _______, _______, _______, _______, ES_DEC, ES_INC, RESET, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______ + ), +}; -- cgit v1.2.3 From 8443481aea47182683d6b26aa00548e9ebfab82e Mon Sep 17 00:00:00 2001 From: Stephen Gelman Date: Thu, 27 Dec 2018 01:15:58 -0600 Subject: Fix apparent typo in WhiteFox LED config It seems the led_mask is set incorrectly on the WhiteFox meaning that the LED at C9-1 (the space bar) doesn't get lit. I can't see any reason for this to be intentional so I am pretty sure it's a typo. At the very least it fixes the space bar LED for me. --- keyboards/whitefox/board_is31fl3731c.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/whitefox/board_is31fl3731c.h b/keyboards/whitefox/board_is31fl3731c.h index dea643f107..d59b2ff43a 100644 --- a/keyboards/whitefox/board_is31fl3731c.h +++ b/keyboards/whitefox/board_is31fl3731c.h @@ -31,7 +31,7 @@ static const uint8_t led_mask[] = { 0xFF, 0x00, /* C6-1 -> C6-16 */ 0xFF, 0x00, /* C7-1 -> C7-16 */ 0xFF, 0x00, /* C8-1 -> C8-16 */ - 0xFE, 0x00, /* C9-1 -> C9-16 */ + 0xFF, 0x00, /* C9-1 -> C9-16 */ }; // The address of the LED -- cgit v1.2.3 From e2f60eba2f5d44282a6aff35fde9076b0532c23c Mon Sep 17 00:00:00 2001 From: Menchen Date: Tue, 25 Dec 2018 20:01:54 +0100 Subject: Fix capkey led for dz60. --- keyboards/dz60/dz60.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/keyboards/dz60/dz60.c b/keyboards/dz60/dz60.c index b54ff01170..8295fb432c 100644 --- a/keyboards/dz60/dz60.c +++ b/keyboards/dz60/dz60.c @@ -23,11 +23,9 @@ void led_init_ports(void) { void led_set_kb(uint8_t usb_led) { if (usb_led & (1 << USB_LED_CAPS_LOCK)) { - DDRB |= (1 << 2); PORTB &= ~(1 << 2); } else { - DDRB &= ~(1 << 2); - PORTB &= ~(1 << 2); + PORTB |= (1 << 2); } led_set_user(usb_led); -- cgit v1.2.3 From bb1b44132514fc30de7de77f2c6a80b8c7ba0416 Mon Sep 17 00:00:00 2001 From: Giuseppe Rota Date: Sat, 29 Dec 2018 16:04:41 +0100 Subject: Fix leader processing --- quantum/process_keycode/process_leader.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/quantum/process_keycode/process_leader.c b/quantum/process_keycode/process_leader.c index 57fccdc7e7..897e9eabf6 100644 --- a/quantum/process_keycode/process_leader.c +++ b/quantum/process_keycode/process_leader.c @@ -68,9 +68,7 @@ bool process_leader(uint16_t keycode, keyrecord_t *record) { } else { if (keycode == KC_LEAD) { qk_leader_start(); - return false; } - break; } } return true; -- cgit v1.2.3 From cc7bf108a93416036e3cd4d3e129abd56dfa9350 Mon Sep 17 00:00:00 2001 From: ginjake Date: Sun, 30 Dec 2018 01:19:34 +0900 Subject: Keymap: add ginjake keymap for the zinc keyboard (#4741) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * サンシャインぴっかぴかモード実装 * サンシャインぴっかぴかモード --- keyboards/zinc/keymaps/ginjake/config.h | 38 +++ keyboards/zinc/keymaps/ginjake/keymap.c | 368 ++++++++++++++++++++++++++++ keyboards/zinc/keymaps/ginjake/readme_jp.md | 123 ++++++++++ keyboards/zinc/keymaps/ginjake/rules.mk | 98 ++++++++ 4 files changed, 627 insertions(+) create mode 100644 keyboards/zinc/keymaps/ginjake/config.h create mode 100644 keyboards/zinc/keymaps/ginjake/keymap.c create mode 100644 keyboards/zinc/keymaps/ginjake/readme_jp.md create mode 100644 keyboards/zinc/keymaps/ginjake/rules.mk diff --git a/keyboards/zinc/keymaps/ginjake/config.h b/keyboards/zinc/keymaps/ginjake/config.h new file mode 100644 index 0000000000..4dcb0724ff --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/config.h @@ -0,0 +1,38 @@ +/* +This is the c configuration file for the keymap + +Copyright 2018 monksoffunk +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 +// if you need more program area, try uncomment follow line +#include "serial_config_simpleapi.h" + +// place overrides here +// Selection of RGBLIGHT MODE to use. +#if defined(LED_ANIMATIONS) + #define RGBLIGHT_EFFECT_BREATHING + #define RGBLIGHT_EFFECT_RAINBOW_MOOD + #define RGBLIGHT_EFFECT_RAINBOW_SWIRL + #define RGBLIGHT_EFFECT_SNAKE + #define RGBLIGHT_EFFECT_KNIGHT + #define RGBLIGHT_EFFECT_CHRISTMAS + #define RGBLIGHT_EFFECT_STATIC_GRADIENT + //#define RGBLIGHT_EFFECT_RGB_TEST + //#define RGBLIGHT_EFFECT_ALTERNATING +#endif diff --git a/keyboards/zinc/keymaps/ginjake/keymap.c b/keyboards/zinc/keymaps/ginjake/keymap.c new file mode 100644 index 0000000000..323d2c7d44 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/keymap.c @@ -0,0 +1,368 @@ +#include QMK_KEYBOARD_H + +extern keymap_config_t keymap_config; + +#ifdef RGBLIGHT_ENABLE +//Following line allows macro to read current RGB settings +extern rgblight_config_t rgblight_config; +rgblight_config_t RGB_current_config; +#endif + +extern uint8_t is_master; + +// 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. +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, + ADJUST, + BACKLIT, + KANA, + EISU, + RGBRST, + AQOURS, //サンシャインぴっかぴかモード +}; + +#ifdef RGBLIGHT_ENABLE + //9色に変化するLEDのHSV各パラメータ + int aqours_h[] = { 26, 340, 150, 0, 199, 220, 53, 265, 322}; + int aqours_s[] = {255, 165, 255, 255, 255, 350, 255, 255, 255}; + int aqours_v[] = {255, 255, 255, 255, 255, 255, 255, 255, 255}; + const int NEXT_COLOR_TIME = 2400; //次の色に切り替わるまでの時間 + const int NEXT_CHANGE_TARGET_TIME = 100; //次のキーに色が伝播するまでの時間 + bool aqours_mode = false; + int aqours_next_color_timer_count = 0; + int aqours_num = 0; + int target_col = 0; + + //keyのmatrixの位置とLEDの番号を紐づける + int combined_key_to_led[] = + { + 0,1,2,3,4,5, + 11,10,9,8,7,6, + 12,13,14,15,16,17, + 23,22,21,20,19,18 + }; +#endif + +enum macro_keycodes { + KC_SAMPLEMACRO, +}; + +//Macros +#define M_SAMPLE M(KC_SAMPLEMACRO) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { \ + /* Qwerty + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Win | Alt |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ +[_QWERTY] = LAYOUT_ortho_4x12( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \ + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Colemak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_COLEMAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \ + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Dvorak + * ,-----------------------------------------. ,-----------------------------------------. + * | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + * `-----------------------------------------' `-----------------------------------------' + */ + [_DVORAK] = LAYOUT_ortho_4x12( \ + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL, \ + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \ + KC_ESC, ADJUST, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ), + + /* Lower + * ,-----------------------------------------. ,-----------------------------------------. + * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | - | _ | + | { | } | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | | Home | End | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_LOWER] = LAYOUT_ortho_4x12( \ + KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, \ + _______, _______, _______, _______, _______, _______, KC_MINS, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_END, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Raise + * ,-----------------------------------------. ,-----------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | | F12 | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------' `-----------------------------------------' + */ + [_RAISE] = LAYOUT_ortho_4x12( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_DEL, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \ + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ + ), + + /* Adjust (Lower + Raise) + * ,-----------------------------------------. ,-----------------------------------------. + * | | Reset|RGBRST|Aud on|Audoff| | | |Qwerty|Colemk|Dvorak| | Ins | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * |AQOURS|RGB ON| HUE+ | SAT+ | VAL+ | Mac | | Win | - | = |Print |ScLock|Pause | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | MODE | HUE- | SAT- | VAL- | | | | | | | | | + * |------+------+------+------+------+------| |------+------+------+------+------+------| + * | | | | EISU | EISU | EISU | | KANA | KANA | Home |PageDn|PageUp| End | + * `-----------------------------------------' `-----------------------------------------' + */ + [_ADJUST] = LAYOUT_ortho_4x12( \ + _______, RESET, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, DVORAK, _______, KC_INS, \ + AQOURS, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, AG_NORM, AG_SWAP, KC_MINS, KC_EQL, KC_PSCR, KC_SLCK, KC_PAUS,\ + _______, RGB_MOD, RGB_HUD, RGB_SAD, RGB_VAD, _______, _______, _______, _______, _______, _______, _______,\ + _______, _______, _______, EISU, EISU, EISU, KANA, KANA, KC_HOME, KC_PGDN, KC_PGUP, KC_END\ + ) +}; + +// define variables for reactive RGB +bool TOG_STATUS = false; + +// Setting ADJUST layer RGB back to default +void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) { + if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); + #endif + layer_on(layer3); + } else { + layer_off(layer3); + } +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + return false; + break; + + case LOWER: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(16); + #endif + } + layer_on(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + TOG_STATUS = false; + layer_off(_LOWER); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case RAISE: + if (record->event.pressed) { + //not sure how to have keyboard check mode and set it to a variable, so my work around + //uses another variable that would be set to true after the first time a reactive key is pressed. + if (TOG_STATUS) { //TOG_STATUS checks is another reactive key currently pressed, only changes RGB mode if returns false + } else { + TOG_STATUS = !TOG_STATUS; + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(15); + #endif + } + layer_on(_RAISE); + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } else { + #ifdef RGBLIGHT_ENABLE + rgblight_mode_noeeprom(RGB_current_config.mode); // revert RGB to initial mode prior to RGB mode change + #endif + layer_off(_RAISE); + TOG_STATUS = false; + update_tri_layer_RGB(_LOWER, _RAISE, _ADJUST); + } + return false; + break; + + case ADJUST: + if (record->event.pressed) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + return false; + break; + //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released + case RGB_MOD: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + rgblight_mode_noeeprom(RGB_current_config.mode); + rgblight_step(); + RGB_current_config.mode = rgblight_config.mode; + } + #endif + return false; + break; + + case EISU: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG2); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG2); + } + return false; + break; + case KANA: + if (record->event.pressed) { + if(keymap_config.swap_lalt_lgui==false){ + register_code(KC_LANG1); + }else{ + SEND_STRING(SS_LALT("`")); + } + } else { + unregister_code(KC_LANG1); + } + return false; + break; + case AQOURS: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + aqours_mode = !aqours_mode; + } + #endif + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + RGB_current_config = rgblight_config; + } + #endif + break; + } + return true; +} + +#ifdef RGBLIGHT_ENABLE + + void aqours_led(void) { + aqours_next_color_timer_count++; + //一定間隔で色が変化 + if (aqours_next_color_timer_count > NEXT_COLOR_TIME) { + aqours_num++; + aqours_next_color_timer_count = 0; + target_col = 0; + if (aqours_num == sizeof(aqours_h) / sizeof(int)) { + aqours_num = 0; + } + } + + //キー毎に時間差で色が変化していく + if (aqours_next_color_timer_count % NEXT_CHANGE_TARGET_TIME == 0) { + if (target_col < MATRIX_COLS) { + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[11 - target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[12 + target_col]); + sethsv(aqours_h[aqours_num], aqours_s[aqours_num], aqours_v[aqours_num], (LED_TYPE *)&led[23 - target_col]); + target_col++; + rgblight_set(); + } + } + } +#endif + +void matrix_scan_user(void) { + #ifdef RGBLIGHT_ENABLE + if (aqours_mode) { + aqours_led(); + } + #endif +} + +void matrix_init_user(void) { + #ifdef RGBLIGHT_ENABLE + rgblight_init(); + RGB_current_config = rgblight_config; + #endif +} diff --git a/keyboards/zinc/keymaps/ginjake/readme_jp.md b/keyboards/zinc/keymaps/ginjake/readme_jp.md new file mode 100644 index 0000000000..f6e91f0c89 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/readme_jp.md @@ -0,0 +1,123 @@ +# The Default Zinc Layout +## 配列 + +### Qwerty配列 + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | S | D | F | G | | H | J | K | L | ; | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc | Fn | Alt | Win |Lower |Space | | Space| Raise| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Colemak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | R | S | T | D | | H | N | E | I | O | ' | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `------------------------------------------ ------------------------------------------' +``` + +### Dvorak + +``` + ,-----------------------------------------. ,-----------------------------------------. + | Tab | ' | , | . | P | Y | | F | G | C | R | L | Del | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Ctrl | A | O | E | U | I | | D | H | T | N | S | / | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter | + |------+------+------+------+------+------| |------+------+------+------+------+------| + | Esc |ADJUST| Alt | Win |LOWER |Space | | Space| RAISE| Left | Down | Up | Right| + `-----------------------------------------' `-----------------------------------------' +``` + + +## コンパイルの仕方 + +コンパイルは、qmk_firmware のトップディレクトリで行います。 + +``` +$ cd qmk_firmware +``` +qmk_firmwareでは各キーボードのコンパイルは、`<キーボード名>:<キーマップ名>`という指定で行います。 + +``` +$ make zinc:default +``` + +キーボードへの書き込みまで同時に行うには下記のように`:avrdude`を付けます。 + +``` +$ make zinc:default:avrdude +``` + +コンパイル結果と中間生成物を消去したい場合は以下のようにします。 + +``` +$ make zinc:default:clean +``` + +## カスタマイズ + +コマンドラインからオプションを指定してビルドすることが出来ます。 + +``` +# Zinc keyboard 'default' keymap: convenient command line option +make ZINC= zinc:defualt +# option= back | under | na | ios +# ex. +# make ZINC=under zinc:defualt +# make ZINC=under,ios zinc:defualt +# make ZINC=back zinc:default +# make ZINC=back,na zinc:default +# make ZINC=back,ios zinc:default +``` + +あるいは`qmk_firmware/keyboards/zinc/rev1/keymaps/default/rules.mk` の以下の部分を直接編集して機能を有効化してください。 + +``` +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) + + +``` + +## RGB backlight を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_BACK_ENABLE = yes # LED backlight (Enable SK6812mini backlight) +``` + + +## RGB Underglow を有効にする + +rules.mk の下記の部分を編集して no を yes に変更してください。 +``` +LED_UNDERGLOW_ENABLE = yes # LED underglow (Enable WS2812 RGB underlight.) +``` + + +## iPad/iPhoneサポートを有効にする。 + +rules.mk の下記の部分を編集して no を yes に変更してください。 +RBG Underglow や RGBバックライトの輝度を抑えて、iPad, iPhone にも接続できるようになります。 + +``` +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +``` \ No newline at end of file diff --git a/keyboards/zinc/keymaps/ginjake/rules.mk b/keyboards/zinc/keymaps/ginjake/rules.mk new file mode 100644 index 0000000000..2dcefc0016 --- /dev/null +++ b/keyboards/zinc/keymaps/ginjake/rules.mk @@ -0,0 +1,98 @@ + +# 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 = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +NKRO_ENABLE = no # 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 controls +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. +SWAP_HANDS_ENABLE = no # Enable one-hand typing + +define ZINC_CUSTOMISE_MSG + $(info Zinc customize) + $(info - LED_BACK_ENABLE=$(LED_BACK_ENABLE)) + $(info - LED_UNDERGLOW_ENABLE=$(LED_UNDERGLOW_ENABLE)) + $(info - LED_ANIMATION=$(LED_ANIMATIONS)) + $(info - IOS_DEVICE_ENABLE=$(IOS_DEVICE_ENABLE)) +endef + +# Zinc keyboard customize +LED_BACK_ENABLE = no # LED backlight (Enable SK6812mini backlight) +LED_UNDERGLOW_ENABLE = no # LED underglow (Enable WS2812 RGB underlight) +LED_ANIMATIONS = yes # LED animations +IOS_DEVICE_ENABLE = no # connect to IOS device (iPad,iPhone) +Link_Time_Optimization = no # if firmware size over limit, try this option + +#### LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE. +#### Do not enable these with audio at the same time. + +### Zinc keyboard 'default' keymap: convenient command line option +## make ZINC= zinc:defualt +## option= back | under | na | ios +## ex. +## make ZINC=under zinc:defualt +## make ZINC=under,ios zinc:defualt +## make ZINC=back zinc:default +## make ZINC=back,na zinc:default +## make ZINC=back,ios zinc:default + +ifneq ($(strip $(ZINC)),) + ifeq ($(findstring back,$(ZINC)), back) + LED_BACK_ENABLE = yes + else ifeq ($(findstring under,$(ZINC)), under) + LED_UNDERGLOW_ENABLE = yes + endif + ifeq ($(findstring na,$(ZINC)), na) + LED_ANIMATIONS = no + endif + ifeq ($(findstring ios,$(ZINC)), ios) + IOS_DEVICE_ENABLE = yes + endif + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(info ) +endif + +ifeq ($(strip $(LED_BACK_ENABLE)), yes) + RGBLIGHT_ENABLE = yes + OPT_DEFS += -DRGBLED_BACK + ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + $(eval $(call ZINC_CUSTOMISE_MSG)) + $(error LED_BACK_ENABLE and LED_UNDERGLOW_ENABLE both 'yes') + endif +else ifeq ($(strip $(LED_UNDERGLOW_ENABLE)), yes) + RGBLIGHT_ENABLE = yes +else + RGBLIGHT_ENABLE = no +endif + +ifeq ($(strip $(IOS_DEVICE_ENABLE)), yes) + OPT_DEFS += -DIOS_DEVICE_ENABLE +endif + +ifeq ($(strip $(LED_ANIMATIONS)), yes) +# OPT_DEFS += -DRGBLIGHT_ANIMATIONS + OPT_DEFS += -DLED_ANIMATIONS + +endif + +ifeq ($(strip $(Link_Time_Optimization)),yes) + EXTRAFLAGS += -flto -DUSE_Link_Time_Optimization +endif + +# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend + + +# Uncomment these for debugging +# $(info -- RGBLIGHT_ENABLE=$(RGBLIGHT_ENABLE)) +# $(info -- OPT_DEFS=$(OPT_DEFS)) +# $(info ) -- cgit v1.2.3 From c043edd13871b9ec96cf495b9423da8df7f36965 Mon Sep 17 00:00:00 2001 From: wanleg <32079073+wanleg@users.noreply.github.com> Date: Sun, 30 Dec 2018 07:53:02 -0800 Subject: Keymap: Wanleg 5x5 Keymap changes (#4738) * config fixes (including for issue #3678) * put back audio * jj40 backlighting setup * jj40 backlighting setup * rules.mk fix * jj40 backlighting settings * iris setup * iris setup * iris setup * iris setup * iris setup - onehand * remove commented-out section * edits due to #4403 * xd75 testing * fix 5x15 layout issues with 5x5 bluetooth & xd75 * commenting out unused placeholders * change iris to more wanleg-like 4x12 layout * formatting changes * onehand layout cleanup/fix * revert temp change * create centre numpad option * 1st working version * change keypad numbers to regular numbers - doesn't work otherwise * adding comparison files, no change to core * fixed 5x5 with cleave * fixed 5x5 with cleave * switch mouse scroll buttons * clean up left/right/centre pad placement in 5x15 layouts * minor comment change * Update layouts/community/ortho_5x15/wanleg/keymap.c Co-Authored-By: wanleg <32079073+wanleg@users.noreply.github.com> * Update layouts/community/ortho_5x15/wanleg/keymap.c Co-Authored-By: wanleg <32079073+wanleg@users.noreply.github.com> * Update layouts/community/ortho_5x15/wanleg/keymap.c Co-Authored-By: wanleg <32079073+wanleg@users.noreply.github.com> * revert to original --- layouts/community/ortho_5x15/wanleg/keymap.c | 137 +++++++++++++++++---------- users/wanleg/rules.mk | 9 ++ users/wanleg/tapdances.c | 4 +- users/wanleg/wanleg.c | 58 +----------- users/wanleg/wanleg.h | 69 ++------------ 5 files changed, 109 insertions(+), 168 deletions(-) diff --git a/layouts/community/ortho_5x15/wanleg/keymap.c b/layouts/community/ortho_5x15/wanleg/keymap.c index 51b020fcde..a98f61988c 100644 --- a/layouts/community/ortho_5x15/wanleg/keymap.c +++ b/layouts/community/ortho_5x15/wanleg/keymap.c @@ -1,26 +1,71 @@ #include QMK_KEYBOARD_H #include "wanleg.h" -#define _________________BLANK_75__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ #define _________________BLANK_50__________________ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -#define _________________Num_Row_75________________ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK + +#if defined(PADC) +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + K00, K01, K02, K03, K04, K05, K0c, K0d, K0e, K06, K07, K08, K09, K0a, K0b, \ + K10, K11, K12, K13, K14, K15, K1c, K1d, K1e, K16, K17, K18, K19, K1a, K1b, \ + K20, K21, K22, K23, K24, K25, K2c, K2d, K2e, K26, K27, K28, K29, K2a, K2b, \ + K30, K31, K32, K33, K34, K35, K3c, K3d, K3e, K36, K37, K38, K39, K3a, K3b \ + ) + +#elif defined(PADL) +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + K0c, K0d, K0e, K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, \ + K1c, K1d, K1e, K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, \ + K2c, K2d, K2e, K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, \ + K3c, K3d, K3e, K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b \ + ) + +#else +#define LAYOUT_75_base( \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) \ + LAYOUT_ortho_5x15_wrapper( \ + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NLCK, QWERTY, GHERKIN, FUNCTION, \ + K00, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0a, K0b, K0c, K0d, K0e, \ + K10, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1a, K1b, K1c, K1d, K1e, \ + K20, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2a, K2b, K2c, K2d, K2e, \ + K30, K31, K32, K33, K34, K35, K36, K37, K38, K39, K3a, K3b, K3c, K3d, K3e \ + ) +#endif + +#define LAYOUT_75_base_wrapper(...) LAYOUT_75_base(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { #if defined(KEYBOARD_40percentclub_5x5) -[GK75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, - _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +[_GK] = LAYOUT_75_base_wrapper( + _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, + _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, + TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM, KC_V), LT(ETC, KC_B), KC_N, LT(DIR, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_1, KC_2, KC_3, + TD(RST_TAP_DANCE), GHERKIN50, KC_LALT, NUMPAD, NUMBER, ETCETERA, KC_SPC,DIRECTION, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_0, KC_0, KC_DOT ), [GK50] = LAYOUT_ortho_5x10_wrapper( - KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, + KC_ESC, _______, _______, _______, _______, _______, _______, _______, _______, KC_BSPC, _______________Gherkin_Row_0_______________, _______________Gherkin_Row_1_______________, _______________Gherkin_Row_2_______________, - TD(RST_TAP_DANCE), GHERKIN75, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI + TD(RST_TAP_DANCE), GHERKIN, NUMPAD, gNUMBER, gETCETERA, KC_SPC,gDIRECTION, KC_RGUI, KC_RALT, KC_RGUI ), [gNUM] = LAYOUT_ortho_5x10_wrapper( @@ -65,9 +110,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), #endif #else - /* Gherkin 75 + /* Gherkin * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | | FN | + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| * | | 7 | 8 | 9 | * | |--------+--------+--------| @@ -78,17 +123,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | 0 | 0 | . | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[GK75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, QWERTY75, XXXXXXX, FUNCTION75, - _______________GherkinLike_0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________GherkinLike_1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - TD(TD_SFT_CAPS), SFT_T(KC_Z), KC_X, KC_C, LT(NUM75, KC_V), LT(ETC75, KC_B), KC_N, LT(DIR75, KC_M), GUI_T(KC_COMM), ALT_T(KC_DOT), CTL_T(KC_BSPC), SFT_T(KC_ENT), KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, NUMBER75, ETCETERA75, KC_SPC,DIRECTION75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +[_GK] = LAYOUT_75_base_wrapper( + _______________GherkinLike_0_______________, KC_7, KC_8, KC_9, + _______________GherkinLike_1_______________, KC_4, KC_5, KC_6, + _______________GherkinLike_2_______________, KC_1, KC_2, KC_3, + _______________GherkinLike_3_______________, KC_0, KC_0, KC_DOT ), #endif - /* QWERTY 75 +/* QWERTY * .--------------------------------------------------------------------------------------------------------------------------------------. - * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| gherkin| | FN | + * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | NUMLOCK| qwerty | gherkin| FN | * |-----------------------------------------------------------------------------------------------------------+--------+--------+--------| * | | 7 | 8 | 9 | * | |--------+--------+--------| @@ -99,17 +143,16 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | 0 | 0 | . | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[QW75] = LAYOUT_ortho_5x15_wrapper( - _________________Num_Row_75________________, GHERKIN75, XXXXXXX, FUNCTION75, - _______________Qwerty_Row__0_______________, KC_KP_7, KC_KP_8, KC_KP_9, - _______________Qwerty_Row__1_______________, KC_KP_4, KC_KP_5, KC_KP_6, - _______________Qwerty_Row__2_______________, KC_KP_1, KC_KP_2, KC_KP_3, - KC_LCTL, KC_LGUI, KC_LALT, KC_LALT, SUBTER75, KC_LSFT, KC_SPC, SUPRA75, KC_RGUI, KC_RALT, KC_DEL, KC_RCTL, KC_KP_0, KC_KP_0, KC_KP_DOT +[_QW] = LAYOUT_75_base_wrapper( + _______________Qwerty_Row__0_______________, KC_7, KC_8, KC_9, + _______________Qwerty_Row__1_______________, KC_4, KC_5, KC_6, + _______________Qwerty_Row__2_______________, KC_1, KC_2, KC_3, + _______________Qwerty_Row__3_______________, KC_0, KC_0, KC_DOT ), - /* SUBTER75 + /* SUBTER * .--------------------------------------------------------------------------------------------------------------------------------------. - * | SUBTER ROW 0 LAYOUT | | | | + * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------+--------+-----------------| * | | / | * | - | * | |--------+--------+--------| @@ -120,15 +163,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[SUB75] = LAYOUT_ortho_5x15_wrapper( - _______________SUBTER_Row__0_______________, _______, _______, _______, +[SUB] = LAYOUT_75_base_wrapper( _______________SUBTER_Row__0_______________, KC_PSLS, KC_PAST, KC_PMNS, - _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, + _______________SUBTER_Row__1_______________, _______, _______, KC_PPLS, _______________SUBTER_Row__2_______________, _______, _______, KC_PENT, - _______, _______, GHERKIN75, _______, _______, _______, KC_ENT, KC_LSFT, _______, _______, _______, _______, _______, _______, _______ + _______________SUBTER_Row__3_______________, _______, _______, _______ ), -/* SUPRA75 +/* SUPRA * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| @@ -141,15 +183,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[SUP75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[SUP] = LAYOUT_75_base_wrapper( ________________SUPRA_Row_0________________, _______, _______, _______, ________________SUPRA_Row_1________________, _______, _______, _______, ________________SUPRA_Row_2________________, _______, _______, _______, - _________________BLANK_75__________________ + ________________SUPRA_Row_3________________, _______, _______, _______ ), -/* Gherkin 75 Numbers +/* Gherkin Numbers * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -162,15 +203,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[NUM75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[NUM] = LAYOUT_75_base_wrapper( _______________NUMBERS_Row_0_______________, KC_PSLS, KC_PAST, KC_PMNS, _______________NUMBERS_Row_1_______________, _______, _______, KC_PPLS, _______________NUMBERS_Row_2_______________, _______, _______, KC_PENT, _______________NUMBERS_Row_3_______________, _______, _______, _______ ), -/* Gherkin 75 Et Cetera +/* Gherkin Et Cetera * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -183,15 +223,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[ETC75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[ETC] = LAYOUT_75_base_wrapper( ______________ETCETERA_Row__0______________, _______, _______, _______, ______________ETCETERA_Row__1______________, _______, _______, _______, ______________ETCETERA_Row__2______________, _______, _______, _______, ______________ETCETERA_Row__3______________, _______, _______, _______ ), -/* Gherkin 75 Directional Keys +/* Gherkin Directional Keys * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |-----------------------------------------------------------------------------------------------------------|--------+-----------------| @@ -204,16 +243,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[DIR75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, +[DIR] = LAYOUT_75_base_wrapper( _____________DIRECTIONS_Row__0_____________, _______, _______, _______, _____________DIRECTIONS_Row__1_____________, _______, _______, _______, _____________DIRECTIONS_Row__2_____________, _______, _______, _______, - _______, _______, QWERTY75, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _____________DIRECTIONS_Row__3_____________, _______, _______, _______ ), -/* FUNCTION 75 +/* FUNCTION * .--------------------------------------------------------------------------------------------------------------------------------------. * | | | | | | | | | | | | | | | | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+-----------------| @@ -226,9 +264,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | MS BT1 | | | | | | MOUS L | MOUS D | MOUS R | * '--------------------------------------------------------------------------------------------------------------------------------------' */ -[FN75] = LAYOUT_ortho_5x15_wrapper( - _________________BLANK_75__________________, - _________________BLANK_75__________________, +[_FN] = LAYOUT_75_base_wrapper( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_CAPS, KC_BTN5, KC_BTN4, KC_BTN3, KC_BTN2, KC_ACL0, KC_ACL2, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, _______, KC_WH_U, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, BL_TOGG, BL_INC, BL_DEC, _______, _______, KC_MS_U, KC_WH_D, _______, _______, _______, _______, _______, _______, KC_BTN1, _______, _______, _______, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R diff --git a/users/wanleg/rules.mk b/users/wanleg/rules.mk index c6569594b3..b069cd8d38 100644 --- a/users/wanleg/rules.mk +++ b/users/wanleg/rules.mk @@ -27,4 +27,13 @@ ifeq ($(strip $(BT)), yes) CONSOLE_ENABLE = no # Console for debug(+400) COMMAND_ENABLE = no # Commands for debug and configuration RGBLIGHT_ENABLE = no # Enable keyboard RGB underglow +endif + +#move numpad to Left/Centre/Right(default) on 5x15 boards +#example usage: make 4x4:wanleg padc=yes +ifeq ($(strip $(padc)), yes) + OPT_DEFS += -DPADC +endif +ifeq ($(strip $(padl)), yes) + OPT_DEFS += -DPADL endif \ No newline at end of file diff --git a/users/wanleg/tapdances.c b/users/wanleg/tapdances.c index e5051f9ee6..1be5636dc7 100644 --- a/users/wanleg/tapdances.c +++ b/users/wanleg/tapdances.c @@ -168,7 +168,7 @@ void LYR75_finished (qk_tap_dance_state_t *state, void *user_data) { LYR75tap_state.state = cur_dance(state); switch (LYR75tap_state.state) { case SINGLE_TAP: register_code(KC_PSLS); break; - case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; case DOUBLE_SINGLE_TAP: register_code(KC_PSLS); unregister_code(KC_PSLS); register_code(KC_PSLS); } } @@ -176,7 +176,7 @@ void LYR75_finished (qk_tap_dance_state_t *state, void *user_data) { void LYR75_reset (qk_tap_dance_state_t *state, void *user_data) { switch (LYR75tap_state.state) { case SINGLE_TAP: unregister_code(KC_PSLS); break; - case DOUBLE_TAP: set_single_persistent_default_layer(GK75); break; + case DOUBLE_TAP: set_single_persistent_default_layer(_GK); break; case DOUBLE_SINGLE_TAP: unregister_code(KC_PSLS); } LYR75tap_state.state = 0; diff --git a/users/wanleg/wanleg.c b/users/wanleg/wanleg.c index 4e60c422fa..274c74f728 100644 --- a/users/wanleg/wanleg.c +++ b/users/wanleg/wanleg.c @@ -29,18 +29,6 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case QWERTY75: - if (record->event.pressed) { - set_single_persistent_default_layer(QW75); - } - return false; - break; - case GHERKIN75: - if (record->event.pressed) { - set_single_persistent_default_layer(GK75); - } - return false; - break; case NUMPAD: if (record->event.pressed) { set_single_persistent_default_layer(PAD); @@ -117,51 +105,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { } return false; break; - case SUBTER75: - if (record->event.pressed) { - layer_on(SUB75); - } else { - layer_off(SUB75); - } - return false; - break; - case SUPRA75: - if (record->event.pressed) { - layer_on(SUP75); - } else { - layer_off(SUP75); - } - return false; - break; - case NUMBER75: - if (record->event.pressed) { - layer_on(NUM75); - } else { - layer_off(NUM75); - } - return false; - break; - case DIRECTION75: - if (record->event.pressed) { - layer_on(DIR75); - } else { - layer_off(DIR75); - } - return false; - break; - case ETCETERA75: - if (record->event.pressed) { - layer_on(ETC75); - } else { - layer_off(ETC75); - } - return false; - break; - case FUNCTION75: + case FUNCTION: if (record->event.pressed) { - layer_on(FN75); + layer_on(_FN); } else { - layer_off(FN75); + layer_off(_FN); } return false; break; diff --git a/users/wanleg/wanleg.h b/users/wanleg/wanleg.h index c2644cd6c4..9d07760a7b 100644 --- a/users/wanleg/wanleg.h +++ b/users/wanleg/wanleg.h @@ -11,72 +11,33 @@ enum userspace_layers { gETC, _GK, _QW, - QW75, - GK75, ONE, SUB, SUP, NUM, DIR, ETC, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, + _FN, PAD, GK50, }; -#elif KEYBOARD_xd75 +#elif KEYBOARD_40percentclub_5x5 enum userspace_layers { - GK75 = 0, - QW75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, - gGK, + GK50 = 0, _GK, _QW, PAD, - ONE, - SUB, - SUP, - NUM, - DIR, - ETC, - gNUM, - gDIR, - gETC, - GK50, -}; -#elif KEYBOARD_40percentclub_5x5 -enum userspace_layers { - GK50 = 0, gNUM, gDIR, gETC, - GK75, - QW75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, - PAD, gGK, - _GK, - _QW, ONE, SUB, SUP, NUM, DIR, ETC, + _FN, }; #else enum userspace_layers { @@ -93,14 +54,7 @@ enum userspace_layers { gNUM, gDIR, gETC, - QW75, - GK75, - SUB75, - SUP75, - NUM75, - DIR75, - ETC75, - FN75, + _FN, GK50, }; #endif @@ -109,8 +63,6 @@ enum userspace_custom_keycodes { gGHERKIN = SAFE_RANGE, GHERKIN, QWERTY, - QWERTY75, - GHERKIN75, ONEHAND, SUBTER, SUPRA, @@ -120,12 +72,7 @@ enum userspace_custom_keycodes { gNUMBER, gDIRECTION, gETCETERA, - SUBTER75, - SUPRA75, - NUMBER75, - DIRECTION75, - ETCETERA75, - FUNCTION75, + FUNCTION, NUMPAD, GHERKIN50, @@ -215,14 +162,14 @@ enum { /* Et Cetera * .-----------------------------------------------------------------------------------------. - * | ` | mUP | | | RESET | SHIFT | mScrUp | mScrDn | | \ | + * | ` | mUP | | | RESET | SHIFT | mScrDn | mScrUp | | \ | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | mLeft | mDown | mRight | | SHIFT | mBtn3 | mBtn1 | mBtn2 | ; | ' | * |--------+--------+--------+--------+--------+--------+--------+--------+--------+--------| * | Sft//Cp| CAPS | | | | C-A-D | mScrL | mScrR | ALT | DEL | * '-----------------------------------------------------------------------------------------' */ -#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_U, KC_WH_D, _______, KC_BSLS +#define _______________Gherkin_ETC_0_______________ KC_GRV, KC_MS_U, _______,_______, RESET, KC_RSFT, KC_WH_D, KC_WH_U, _______, KC_BSLS #define _______________Gherkin_ETC_1_______________ KC_MS_L, KC_MS_D, KC_MS_R,_______, KC_LSFT, KC_BTN3, KC_BTN1, KC_BTN2, KC_SCLN, KC_QUOT #define _______________Gherkin_ETC_2_______________ TD(TD_SFT_CAPS),KC_CAPS, _______,_______, _______, LALT(LCTL(KC_DEL)), KC_WH_L, KC_WH_R, KC_LALT, KC_DEL -- cgit v1.2.3 From c2390bf32156884d6825686c7f13f9c621bab366 Mon Sep 17 00:00:00 2001 From: Matthew Lyon Date: Sun, 30 Dec 2018 07:54:10 -0800 Subject: Keymap: mattly: more tweaks (#4746) --- keyboards/planck/keymaps/mattly/keymap.c | 94 ++++++++++++++------------------ 1 file changed, 42 insertions(+), 52 deletions(-) diff --git a/keyboards/planck/keymaps/mattly/keymap.c b/keyboards/planck/keymaps/mattly/keymap.c index 2495f8a19c..baa7d9fbf7 100644 --- a/keyboards/planck/keymaps/mattly/keymap.c +++ b/keyboards/planck/keymaps/mattly/keymap.c @@ -24,7 +24,6 @@ enum planck_layers { _NUMBER, _SYMBOL, _FUNC, - _ADJUST }; enum planck_keycodes { @@ -33,11 +32,10 @@ enum planck_keycodes { #define SPC_SHF MT(MOD_LSFT, KC_SPC) -#define ENT_FUN LT(_FUNC, KC_ENT) -#define ESC_FUN LT(_FUNC, KC_ESC) +#define ESC_HYP MT(MOD_HYPR, KC_ESC) #define TAB_NUM LT(_NUMBER, KC_TAB) #define BSP_SYM LT(_SYMBOL, KC_BSPC) -#define DEL_ADJ LT(_ADJUST, KC_DEL) +#define DEL_WRP MT(MOD_LCTL | MOD_LALT | MOD_LGUI, KC_DEL) #define SYMLOCK TG(_SYMBOL) #define NUMLOCK TG(_NUMBER) @@ -48,18 +46,25 @@ enum planck_keycodes { #define ONE_HYP OSM(MOD_HYPR) #define ONE_MEH OSM(MOD_MEH) #define ONE_WRP OSM(MOD_LCTL | MOD_LALT | MOD_LGUI) - -#define A_CTRL MT(MOD_LCTL, KC_A) -#define S_ALT MT(MOD_LALT, KC_S) -#define D_GUI MT(MOD_LGUI, KC_D) -#define F_SHFT MT(MOD_LSFT, KC_F) -#define G_NUM LT(_NUMBER, KC_G) -#define H_NAV LT(_SYMBOL, KC_H) -#define J_SHFT MT(MOD_RSFT, KC_J) -#define K_GUI MT(MOD_RGUI, KC_K) -#define L_ALT MT(MOD_RALT, KC_L) +#define ONE_WOA OSM(MOD_LCTL | MOD_LGUI | MOD_LSFT) +#define ONE_DER OSM(MOD_LALT | MOD_LGUI | MOD_LSFT) + +#define A_CTRL MT(MOD_LCTL, KC_A) +#define S_ALT MT(MOD_LALT, KC_S) +#define D_GUI MT(MOD_LGUI, KC_D) +#define F_SHFT MT(MOD_LSFT, KC_F) +#define J_SHFT MT(MOD_RSFT, KC_J) +#define K_GUI MT(MOD_RGUI, KC_K) +#define L_ALT MT(MOD_RALT, KC_L) #define MINSCTL MT(MOD_RCTL, KC_MINS) -#define SCL_CTL MT(MOD_RCTL, KC_SCLN) + +#define ENT_CTL MT(MOD_LCTL, KC_ENT) +#define LT_ALT MT(MOD_LALT, KC_LEFT) +#define DN_GUI MT(MOD_LGUI, KC_DOWN) +#define RT_SHFT MT(MOD_LSFT, KC_RGHT) +#define N4_SHFT MT(MOD_RSFT, KC_4) +#define N5_GUI MT(MOD_RGUI, KC_5) +#define N6_ALT MT(MOD_RALT, KC_6) #define BWORD LALT(KC_LEFT) #define FWORD LALT(KC_RIGHT) @@ -68,6 +73,8 @@ enum planck_keycodes { #define PWIN LGUI(LSFT(KC_GRV)) #define NTAB LGUI(LSFT(KC_RBRC)) #define PTAB LGUI(LSFT(KC_LBRC)) +#define NAVBACK LGUI(KC_LBRC) +#define NAVFWD LGUI(KC_RBRC) #define XMSNCTL HYPR(KC_F14) #define XDSKTOP HYPR(KC_F15) @@ -82,7 +89,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { | | | | | | | | | | | | | |------|------|------|------|------|------|------|------|------|------|------|------| | ( | a | s | d | f | g | h | j | k | l | ; | ' | - | | CTRL | ALT | GUI | SHIFT| NUMBR| SYMBL| SHIFT| GUI | ALT | CTRL | | + | | CTRL | ALT | GUI | SHIFT| | | SHIFT| GUI | ALT | CTRL | | |------|------|------|------|------|------|------|------|------|------|------|------| | [ | z | x | c | v | b | n | m | , | . | / | > | | | | | | | | | | | | | | @@ -92,71 +99,54 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { */ [_QWERTY] = LAYOUT_planck_grid( KC_HASH, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_SCLN, - KC_LPRN, A_CTRL, S_ALT, D_GUI, F_SHFT, G_NUM, H_NAV, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, + KC_LPRN, A_CTRL, S_ALT, D_GUI, F_SHFT, KC_G, KC_H, J_SHFT, K_GUI, L_ALT, MINSCTL, KC_QUOT, KC_LBRC, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RABK, - KC_CAPS, ONE_ALT, ONE_GUI, ESC_FUN, TAB_NUM, SPC_SHF, SPC_SHF, BSP_SYM, DEL_ADJ, ONE_HYP, ONE_MEH, ONE_WRP + NUMLOCK, MO(_FUNC), ONE_MEH, ESC_HYP, TAB_NUM, SPC_SHF, SPC_SHF, BSP_SYM, DEL_WRP, ONE_WRP, ONE_DER, SYMLOCK ), /* Symbol - | | & | ` | ~ | [ | ] | < | > | + | | | | - | - | | $ | % | = | ( | ) | | : | ! | @ | * | ' | - | | | ^ | # | { | } | | " | | | \ | | | - | | | | | LOCK | | .... | | | | | + | | & | ` | ~ | [ | ] | < | > | + | | | | | + | | $ | % | = | ( | ) | ; | : | ! | @ | _ | | + | | | ^ | # | { | } | ' | " | | | \ | ? | | + | | | | | | | .... | | | | | */ [_SYMBOL] = LAYOUT_planck_grid( - _______, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, _______, - _______, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_ASTR, _______, - _______, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, XXXXXXX, _______, - _______, _______, _______, _______, SYMLOCK, _______, _______, _______, _______, _______, _______, _______ + KC_ESC, KC_AMPR, KC_GRV, KC_TILD, KC_LBRC, KC_RBRC, KC_LABK, KC_RABK, KC_PLUS, KC_ASTR, XXXXXXX, KC_DEL, + KC_ENT, KC_DLR, KC_PERC, KC_EQL, KC_LPRN, KC_RPRN, KC_SCLN, KC_COLN, KC_EXLM, KC_AT, KC_UNDS, KC_BSPC, + _______, XXXXXXX, KC_CIRC, KC_HASH, KC_LCBR, KC_RCBR, KC_QUOT, KC_DQUO, KC_PIPE, KC_BSLS, KC_QUES, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), /* Number | | |<-word| up |word->| PgUp | . | 7 | 8 | 9 | + | * | | | Enter| left | down | right| PgDn | 0 | 4 | 5 | 6 | - | / | | | Bksp | Home | tab | End | Del | , | 1 | 2 | 3 | = | % | - | | | | | .... | | LOCK | | : | $ | | + | | | | | .... | | | | : | $ | | */ [_NUMBER] = LAYOUT_planck_grid( - XXXXXXX, _______, BWORD, KC_UP, FWORD, KC_PGUP, KC_DOT, KC_7, KC_8, KC_9, KC_PLUS, KC_ASTR, - XXXXXXX, KC_ENT , KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, KC_0, KC_4, KC_5, KC_6, KC_MINS, KC_SLSH, + XXXXXXX, XXXXXXX, BWORD, KC_UP, FWORD, KC_PGUP, KC_DOT, KC_7, KC_8, KC_9, KC_PLUS, KC_ASTR, + KC_CAPS, ENT_CTL, LT_ALT, DN_GUI, RT_SHFT, KC_PGDN, KC_0, N4_SHFT, N5_GUI, N6_ALT, MINSCTL, KC_SLSH, XXXXXXX, KC_BSPC, KC_HOME, KC_TAB, KC_END, KC_DEL, KC_COMM, KC_1, KC_2, KC_3, KC_EQL, KC_PERC, - _______, _______, _______, _______, _______, _______, _______, NUMLOCK, _______, KC_COLN, KC_DLR, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, KC_DLR, _______ ), /* Function - * | | Mctl | Pspc | Nwin | Nspc | Desk | | F7 | F8 | F9 | F10 | F13 | - * | | Nctr | Ptab | Pwin | Ntab | | | F4 | F5 | F6 | F11 | F14 | + * | Reset| Mctl | Pspc | Nwin | Nspc | Desk | | F7 | F8 | F9 | F10 | F13 | + * | Debug| Nctr | Ptab | Pwin | Ntab | Back | Fwd | F4 | F5 | F6 | F11 | F14 | * | Mute | Vol- | Vol+ | Trk- | Trk+ | Play | | F1 | F2 | F3 | F12 | F15 | * | | | | | | | | | | | | | */ [_FUNC] = LAYOUT_planck_grid( - XXXXXXX, XMSNCTL, XPRVSPC, NWIN, XNXTSPC, XDSKTOP, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F13, - XXXXXXX, XNOTIFY, PTAB, PWIN, NTAB, XXXXXXX, XXXXXXX, KC_F4, KC_F5, KC_F6, KC_F11, KC_F14, + RESET, XMSNCTL, XPRVSPC, NWIN, XNXTSPC, XDSKTOP, XXXXXXX, KC_F7, KC_F8, KC_F9, KC_F10, KC_F13, + DEBUG, XNOTIFY, PTAB, PWIN, NTAB, NAVBACK, NAVFWD, KC_F4, KC_F5, KC_F6, KC_F11, KC_F14, KC_MUTE, KC_VOLD, KC_VOLU, KC_MRWD, KC_MFFD, KC_MPLY, XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F12, KC_F15, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ -), - -/* Adjust (Lower + Raise) - * ,-----------------------------------------------------------------------------------. - * | Reset| Debug| | | | | | | | | | | - * | | | | | | | | | | | | | - * | | | | | | | | | | | | | - * | | | | | | | | | | | | | - * `-----------------------------------------------------------------------------------' - */ -[_ADJUST] = LAYOUT_planck_grid( - RESET, DEBUG, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) - - }; #ifdef AUDIO_ENABLE #endif uint32_t layer_state_set_user(uint32_t state) { - /* state = update_tri_layer_state(state, _SYMBOL, _NUMBER, _ADJUST); */ + state = update_tri_layer_state(state, _SYMBOL, _NUMBER, _FUNC); return state; } -- cgit v1.2.3 From 46b4b4407ff6e23d0799b0f902e61f1fe3645a9a Mon Sep 17 00:00:00 2001 From: satt99 <39004890+satt99@users.noreply.github.com> Date: Mon, 31 Dec 2018 01:34:06 +0900 Subject: Comet46 add support for OLED (#4745) * Add OLED support for Comet46 * fix length of char "name" of keylogger.c * update ssd1306 * fix rules.mk * update led-receiver keymap * Update OLED related code * add mod_state_reader & modify led_state_reader * Update OLED related files * Update kemaps * Update readme * change default-oled-display to default * Add OSM compatibility to mod_state_reader * Code formatting * Use PROGMEM to store code_to_name * Clean up satt keymap * Rename default-led keymap to defult-rgbled --- keyboards/comet46/comet46.c | 8 - keyboards/comet46/comet46.h | 40 --- keyboards/comet46/config.h | 12 +- keyboards/comet46/i2c.c | 162 ++++++++++ keyboards/comet46/i2c.h | 49 +++ keyboards/comet46/keymaps/default-rgbled/keymap.c | 226 ++++++++++++++ keyboards/comet46/keymaps/default-rgbled/readme.md | 3 + keyboards/comet46/keymaps/default/config.h | 31 ++ keyboards/comet46/keymaps/default/keymap.c | 189 +++++++++-- keyboards/comet46/keymaps/default/readme.md | 3 + keyboards/comet46/keymaps/default/rules.mk | 5 + keyboards/comet46/keymaps/satt/action_pseudo_lut.c | 212 ++++++------- keyboards/comet46/keymaps/satt/config.h | 34 ++ keyboards/comet46/keymaps/satt/keymap.c | 256 +++++++++------ keyboards/comet46/keymaps/satt/keymap_jis2us.h | 46 +-- keyboards/comet46/keymaps/satt/rules.mk | 29 +- keyboards/comet46/lib/glcdfont.c | 148 +++++++++ keyboards/comet46/lib/host_led_state_reader.c | 15 + keyboards/comet46/lib/keylogger.c | 294 ++++++++++++++++++ keyboards/comet46/lib/modifier_state_reader.c | 18 ++ keyboards/comet46/readme.md | 5 +- keyboards/comet46/rules.mk | 16 +- keyboards/comet46/ssd1306.c | 344 +++++++++++++++++++++ keyboards/comet46/ssd1306.h | 91 ++++++ 24 files changed, 1906 insertions(+), 330 deletions(-) create mode 100644 keyboards/comet46/i2c.c create mode 100644 keyboards/comet46/i2c.h create mode 100644 keyboards/comet46/keymaps/default-rgbled/keymap.c create mode 100644 keyboards/comet46/keymaps/default-rgbled/readme.md create mode 100644 keyboards/comet46/keymaps/default/config.h create mode 100644 keyboards/comet46/keymaps/default/readme.md create mode 100644 keyboards/comet46/keymaps/default/rules.mk create mode 100644 keyboards/comet46/keymaps/satt/config.h create mode 100644 keyboards/comet46/lib/glcdfont.c create mode 100644 keyboards/comet46/lib/host_led_state_reader.c create mode 100644 keyboards/comet46/lib/keylogger.c create mode 100644 keyboards/comet46/lib/modifier_state_reader.c create mode 100644 keyboards/comet46/ssd1306.c create mode 100644 keyboards/comet46/ssd1306.h diff --git a/keyboards/comet46/comet46.c b/keyboards/comet46/comet46.c index 20dcfab83c..0710b8e330 100644 --- a/keyboards/comet46/comet46.c +++ b/keyboards/comet46/comet46.c @@ -4,19 +4,11 @@ void uart_init(void) { SERIAL_UART_INIT(); } -void led_init(void) { - DDRD |= (1<<1); - PORTD |= (1<<1); - DDRF |= (1<<4) | (1<<5); - PORTF |= (1<<4) | (1<<5); -} - void matrix_init_kb(void) { // put your keyboard start-up code here // runs once when the firmware starts up matrix_init_user(); uart_init(); - led_init(); } void matrix_scan_kb(void) { diff --git a/keyboards/comet46/comet46.h b/keyboards/comet46/comet46.h index 7d6d6d513b..07dad0a001 100644 --- a/keyboards/comet46/comet46.h +++ b/keyboards/comet46/comet46.h @@ -6,46 +6,6 @@ #include "backlight.h" #include -#define red_led_off PORTF |= (1<<5) -#define red_led_on PORTF &= ~(1<<5) -#define blu_led_off PORTF |= (1<<4) -#define blu_led_on PORTF &= ~(1<<4) -#define grn_led_off PORTD |= (1<<1) -#define grn_led_on PORTD &= ~(1<<1) - -#define set_led_off red_led_off; grn_led_off; blu_led_off -#define set_led_red red_led_on; grn_led_off; blu_led_off -#define set_led_blue red_led_off; grn_led_off; blu_led_on -#define set_led_green red_led_off; grn_led_on; blu_led_off -#define set_led_yellow red_led_on; grn_led_on; blu_led_off -#define set_led_magenta red_led_on; grn_led_off; blu_led_on -#define set_led_cyan red_led_off; grn_led_on; blu_led_on -#define set_led_white red_led_on; grn_led_on; blu_led_on - -/* -#define LED_B 5 -#define LED_R 6 -#define LED_G 7 - -#define all_leds_off PORTF &= ~(1<. #define ONESHOT_TIMEOUT 500 - -/* key combination for command */ -#define IS_COMMAND() ( \ - keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ -) - /* * Feature disable options * These options are also useful to firmware size reduction. @@ -65,6 +59,12 @@ along with this program. If not, see . //#define NO_ACTION_MACRO //#define NO_ACTION_FUNCTION +// Define masks for modifiers +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + //UART settings for communication with the RF microcontroller #define SERIAL_UART_BAUD 1000000 #define SERIAL_UART_DATA UDR1 diff --git a/keyboards/comet46/i2c.c b/keyboards/comet46/i2c.c new file mode 100644 index 0000000000..4bee5c6398 --- /dev/null +++ b/keyboards/comet46/i2c.c @@ -0,0 +1,162 @@ +#include +#include +#include +#include +#include +#include +#include "i2c.h" + +#ifdef USE_I2C + +// Limits the amount of we wait for any one i2c transaction. +// Since were running SCL line 100kHz (=> 10μs/bit), and each transactions is +// 9 bits, a single transaction will take around 90μs to complete. +// +// (F_CPU/SCL_CLOCK) => # of μC cycles to transfer a bit +// poll loop takes at least 8 clock cycles to execute +#define I2C_LOOP_TIMEOUT (9+1)*(F_CPU/SCL_CLOCK)/8 + +#define BUFFER_POS_INC() (slave_buffer_pos = (slave_buffer_pos+1)%SLAVE_BUFFER_SIZE) + +volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +static volatile uint8_t slave_buffer_pos; +static volatile bool slave_has_register_set = false; + +// Wait for an i2c operation to finish +inline static +void i2c_delay(void) { + uint16_t lim = 0; + while(!(TWCR & (1<10. + // Check datasheets for more info. + TWBR = ((F_CPU/SCL_CLOCK)-16)/2; +} + +// Start a transaction with the given i2c slave address. The direction of the +// transfer is set with I2C_READ and I2C_WRITE. +// returns: 0 => success +// 1 => error +uint8_t i2c_master_start(uint8_t address) { + TWCR = (1< slave ACK +// 1 => slave NACK +uint8_t i2c_master_write(uint8_t data) { + TWDR = data; + TWCR = (1<= SLAVE_BUFFER_SIZE ) { + ack = 0; + slave_buffer_pos = 0; + } + slave_has_register_set = true; + } else { + i2c_slave_buffer[slave_buffer_pos] = TWDR; + BUFFER_POS_INC(); + } + break; + + case TW_ST_SLA_ACK: + case TW_ST_DATA_ACK: + // master has addressed this device as a slave transmitter and is + // requesting data. + TWDR = i2c_slave_buffer[slave_buffer_pos]; + BUFFER_POS_INC(); + break; + + case TW_BUS_ERROR: // something went wrong, reset twi state + TWCR = 0; + default: + break; + } + // Reset everything, so we are ready for the next TWI interrupt + TWCR |= (1< + +#ifndef F_CPU +#define F_CPU 16000000UL +#endif + +#define I2C_READ 1 +#define I2C_WRITE 0 + +#define I2C_ACK 1 +#define I2C_NACK 0 + +#define SLAVE_BUFFER_SIZE 0x10 + +// i2c SCL clock frequency 400kHz +#define SCL_CLOCK 400000L + +extern volatile uint8_t i2c_slave_buffer[SLAVE_BUFFER_SIZE]; + +void i2c_master_init(void); +uint8_t i2c_master_start(uint8_t address); +void i2c_master_stop(void); +uint8_t i2c_master_write(uint8_t data); +uint8_t i2c_master_read(int); +void i2c_reset_state(void); +void i2c_slave_init(uint8_t address); + + +static inline unsigned char i2c_start_read(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_READ); +} + +static inline unsigned char i2c_start_write(unsigned char addr) { + return i2c_master_start((addr << 1) | I2C_WRITE); +} + +// from SSD1306 scrips +extern unsigned char i2c_rep_start(unsigned char addr); +extern void i2c_start_wait(unsigned char addr); +extern unsigned char i2c_readAck(void); +extern unsigned char i2c_readNak(void); +extern unsigned char i2c_read(unsigned char ack); + +#define i2c_read(ack) (ack) ? i2c_readAck() : i2c_readNak(); + +#endif diff --git a/keyboards/comet46/keymaps/default-rgbled/keymap.c b/keyboards/comet46/keymaps/default-rgbled/keymap.c new file mode 100644 index 0000000000..d446d50d05 --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/keymap.c @@ -0,0 +1,226 @@ +// this is the style you want to emulate. +// This is the canonical layout file for the Quantum project. If you want to add another keyboard, + +#include QMK_KEYBOARD_H + +// 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. +enum comet46_layers +{ + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + LOWER, + RAISE, +}; + +// Fillers to make layering more clear +#define _______ KC_TRNS +#define XXXXXXX KC_NO +#define LOWER MO(_LOWER) +#define RAISE MO(_RAISE) + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + /* Qwerty + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | S | D | F | G | Esc | | Del | H | J | K | L | ; | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | N | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_QWERTY] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_ESC, KC_DEL, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Colemak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Dvorak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Lower + * ,-----------------------------------------+ +-----------------------------------------. + * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | | | | ` | \ | - | = | [ | ] | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | | | | ~ | | | _ | + | { | } | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_LOWER] = LAYOUT( + _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______, + _______, _______, _______, _______, _______, _______, _______, KC_GRV, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, + _______, _______, _______, _______, _______, _______, _______, KC_TILD, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Raise + * ,-----------------------------------------+ +-----------------------------------------. + * | | 1 | 2 | 3 | 4 | 5 | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_RAISE] = LAYOUT( + _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Adjust + * ,-----------------------------------------+ +-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Qwerty| |Colemk| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Reset | |Dvorak| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______ + ) +}; + + +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} + +// settings for LED on receiver +void led_init(void) { + DDRD |= (1<<1); + PORTD |= (1<<1); + DDRF |= (1<<4) | (1<<5); + PORTF |= (1<<4) | (1<<5); +} + +#define red_led_off PORTF |= (1<<5) +#define red_led_on PORTF &= ~(1<<5) +#define blu_led_off PORTF |= (1<<4) +#define blu_led_on PORTF &= ~(1<<4) +#define grn_led_off PORTD |= (1<<1) +#define grn_led_on PORTD &= ~(1<<1) + +#define set_led_off red_led_off; grn_led_off; blu_led_off +#define set_led_red red_led_on; grn_led_off; blu_led_off +#define set_led_blue red_led_off; grn_led_off; blu_led_on +#define set_led_green red_led_off; grn_led_on; blu_led_off +#define set_led_yellow red_led_on; grn_led_on; blu_led_off +#define set_led_magenta red_led_on; grn_led_off; blu_led_on +#define set_led_cyan red_led_off; grn_led_on; blu_led_on +#define set_led_white red_led_on; grn_led_on; blu_led_on + +void matrix_init_user(void) { + led_init(); +} + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); + switch (layer) { + case _LOWER: + set_led_red; + break; + case _RAISE: + set_led_blue; + break; + case _ADJUST: + set_led_magenta; + break; + default: + switch (default_layer) { + case _COLEMAK: + set_led_white; + break; + case _DVORAK: + set_led_yellow; + break; + default: + set_led_green; + break; + } + break; + } +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } + return true; +} diff --git a/keyboards/comet46/keymaps/default-rgbled/readme.md b/keyboards/comet46/keymaps/default-rgbled/readme.md new file mode 100644 index 0000000000..40cc744337 --- /dev/null +++ b/keyboards/comet46/keymaps/default-rgbled/readme.md @@ -0,0 +1,3 @@ +## default-led + +A keymap that is compatible with mitosis-type receivers, which use RGB LED for layer indication. diff --git a/keyboards/comet46/keymaps/default/config.h b/keyboards/comet46/keymaps/default/config.h new file mode 100644 index 0000000000..7873cf5a72 --- /dev/null +++ b/keyboards/comet46/keymaps/default/config.h @@ -0,0 +1,31 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +// #include "../../config.h" + +/* Use I2C or Serial */ + +#define USE_I2C +#define SSD1306OLED + +#endif diff --git a/keyboards/comet46/keymaps/default/keymap.c b/keyboards/comet46/keymaps/default/keymap.c index b03ece4e95..c87492e4b9 100644 --- a/keyboards/comet46/keymaps/default/keymap.c +++ b/keyboards/comet46/keymaps/default/keymap.c @@ -2,6 +2,10 @@ // This is the canonical layout file for the Quantum project. If you want to add another keyboard, #include QMK_KEYBOARD_H +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif + // 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. @@ -9,13 +13,18 @@ // entirely and just use numbers. enum comet46_layers { - _QWERTY, - _LOWER, - _RAISE, + _QWERTY, + _COLEMAK, + _DVORAK, + _LOWER, + _RAISE, + _ADJUST, }; enum custom_keycodes { QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, LOWER, RAISE, }; @@ -46,6 +55,42 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT ), + /* Colemak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | R | S | T | D | Esc | | Del | H | N | E | I | O | " | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| Z | X | C | V | B | { | | } | K | M | , | . | / | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_COLEMAK] = LAYOUT( + KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, + KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_ESC, KC_DEL, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_LCBR, KC_RCBR, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + + /* Dvorak + * ,-----------------------------------------+ +-----------------------------------------. + * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Ctl | A | O | E | U | I | Esc | | Del | D | H | T | N | S | / | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | Shift| ; | Q | J | K | X | { | | } | B | M | W | V | Z | Shift| + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | GUI | Lower| Space| | Enter| Raise| Alt | + * +--------------------/ \--------------------+ + */ + [_DVORAK] = LAYOUT( + KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, + KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_ESC, KC_DEL, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_LCBR, KC_RCBR, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, + KC_LGUI, LOWER, KC_SPC, KC_ENT, RAISE, KC_LALT + ), + /* Lower * ,-----------------------------------------+ +-----------------------------------------. * | | ! | @ | # | $ | % | | ^ | & | * | ( | ) | | @@ -70,7 +115,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| * | | F1 | F2 | F3 | F4 | F5 | F6 | | | Left | Down | Up |Right | End | | * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| - * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | | | | | | + * | | F7 | F8 | F9 | F10 | F11 | F12 | | Home | | PgDn | PgUp | | | | * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| * | | | | | | | | * +--------------------/ \--------------------+ @@ -78,26 +123,134 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_RAISE] = LAYOUT( _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_END, _______, - _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, + _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_HOME, XXXXXXX, KC_PGDN, KC_PGUP, XXXXXXX, XXXXXXX, _______, + _______, _______, _______, _______, _______, _______ + ), + + /* Adjust + * ,-----------------------------------------+ +-----------------------------------------. + * | | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Qwerty| |Colemk| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+------+------| + * | | | | | | |Reset | |Dvorak| | | | | | | + * |------+------+------+------+------+------+------+ +------+------+------+------+------+-------------| + * | | | | | | | | + * +--------------------/ \--------------------+ + */ + [_ADJUST] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, RESET, DVORAK, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ) }; +uint32_t layer_state_set_user(uint32_t state) { + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); +} + +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED + +// You need to add source files to SRC in rules.mk when using OLED display functions +void set_keylog(uint16_t keycode); +const char *read_keylog(void); +const char *read_modifier_state(void); +const char *read_host_led_state(void); + +void matrix_init_user(void) { + iota_gfx_init(false); // turns on the display +} + void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - switch (layer) { - case _QWERTY: - set_led_green; - break; - case _RAISE: - set_led_blue; - break; - case _LOWER: - set_led_red; - break; + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void render_status(struct CharacterMatrix *matrix) { + // Layer state + char layer_str[22]; + matrix_write(matrix, "Layer: "); + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); + switch (layer) { + case _QWERTY: + switch (default_layer) { + case _QWERTY: + snprintf(layer_str, sizeof(layer_str), "Qwerty"); + break; + case _COLEMAK: + snprintf(layer_str, sizeof(layer_str), "Colemak"); + break; + case _DVORAK: + snprintf(layer_str, sizeof(layer_str), "Dvorak"); + break; default: - set_led_green; - break; + snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); + break; + } + break; + case _RAISE: + snprintf(layer_str, sizeof(layer_str), "Raise"); + break; + case _LOWER: + snprintf(layer_str, sizeof(layer_str), "Lower"); + break; + case _ADJUST: + snprintf(layer_str, sizeof(layer_str), "Adjust"); + break; + default: + snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); + } + matrix_write_ln(matrix, layer_str); + // Last entered keycode + matrix_write_ln(matrix, read_keylog()); + // Modifier state + matrix_write_ln(matrix, read_modifier_state()); + // Host Keyboard LED Status + matrix_write(matrix, read_host_led_state()); +} + + +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + matrix_clear(&matrix); + render_status(&matrix); + matrix_update(&display, &matrix); +} + +#endif//SSD1306OLED + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + #ifdef SSD1306OLED + if (record->event.pressed) { + set_keylog(keycode); } + #endif + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + break; + case COLEMAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + break; + case DVORAK: + if (record->event.pressed) { + set_single_persistent_default_layer(_DVORAK); + } + break; + } + return true; } diff --git a/keyboards/comet46/keymaps/default/readme.md b/keyboards/comet46/keymaps/default/readme.md new file mode 100644 index 0000000000..b0085d2a62 --- /dev/null +++ b/keyboards/comet46/keymaps/default/readme.md @@ -0,0 +1,3 @@ +## default-oled-display + +A keymap that is compatible with receivers with an OLED display. diff --git a/keyboards/comet46/keymaps/default/rules.mk b/keyboards/comet46/keymaps/default/rules.mk new file mode 100644 index 0000000000..3fa01f96af --- /dev/null +++ b/keyboards/comet46/keymaps/default/rules.mk @@ -0,0 +1,5 @@ +# If you want to change display settings of the OLED, you need to change the following lines +SRC += ./lib/glcdfont.c \ + ./lib/keylogger.c \ + ./lib/modifier_state_reader.c \ + ./lib/host_led_state_reader.c diff --git a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c index 5664d4d2a5..0ac7133591 100644 --- a/keyboards/comet46/keymaps/satt/action_pseudo_lut.c +++ b/keyboards/comet46/keymaps/satt/action_pseudo_lut.c @@ -10,133 +10,133 @@ static uint8_t send_key_shift_bit[SHIFT_BIT_SIZE]; * Memo: Using other layer keymap to get keycode */ void action_pseudo_lut(keyrecord_t *record, uint8_t base_keymap_id, const uint16_t (*keymap)[2]) { - uint8_t prev_shift; - uint16_t keycode; - uint16_t pseudo_keycode; + uint8_t prev_shift; + uint16_t keycode; + uint16_t pseudo_keycode; - /* get keycode from keymap you specified */ - keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); + /* get keycode from keymap you specified */ + keycode = keymap_key_to_keycode(base_keymap_id, record->event.key); - prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); + prev_shift = keyboard_report->mods & (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)); - if (record->event.pressed) { - /* when magic commands entered, keycode does not converted */ - if (IS_COMMAND()) { - if (prev_shift) { - add_shift_bit(keycode); - } - register_code(keycode); - return; - } + if (record->event.pressed) { + /* when magic commands entered, keycode does not converted */ + if (IS_COMMAND()) { + if (prev_shift) { + add_shift_bit(keycode); + } + register_code(keycode); + return; + } - if (prev_shift) { - pseudo_keycode = convert_keycode(keymap, keycode, true); - dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); - add_shift_bit(keycode); + if (prev_shift) { + pseudo_keycode = convert_keycode(keymap, keycode, true); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + add_shift_bit(keycode); - if (IS_LSFT(pseudo_keycode)) { - register_code(QK_LSFT ^ pseudo_keycode); - } else { - /* delete shift mod temporarily */ - del_mods(prev_shift); - send_keyboard_report(); - register_code(pseudo_keycode); - add_mods(prev_shift); - send_keyboard_report(); - } - } else { - pseudo_keycode = convert_keycode(keymap, keycode, false); - dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); + if (IS_LSFT(pseudo_keycode)) { + register_code(QK_LSFT ^ pseudo_keycode); + } else { + /* delete shift mod temporarily */ + del_mods(prev_shift); + send_keyboard_report(); + register_code(pseudo_keycode); + add_mods(prev_shift); + send_keyboard_report(); + } + } else { + pseudo_keycode = convert_keycode(keymap, keycode, false); + dprintf("pressed: %02X, converted: %04X\n", keycode, pseudo_keycode); - if (IS_LSFT(pseudo_keycode)) { - add_weak_mods(MOD_BIT(KC_LSFT)); - send_keyboard_report(); - register_code(QK_LSFT ^ pseudo_keycode); - /* on Windows, prevent key repeat to avoid unintended output */ - unregister_code(QK_LSFT ^ pseudo_keycode); - del_weak_mods(MOD_BIT(KC_LSFT)); - send_keyboard_report(); - } else { - register_code(pseudo_keycode); - } - } + if (IS_LSFT(pseudo_keycode)) { + add_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + register_code(QK_LSFT ^ pseudo_keycode); + /* on Windows, prevent key repeat to avoid unintended output */ + unregister_code(QK_LSFT ^ pseudo_keycode); + del_weak_mods(MOD_BIT(KC_LSFT)); + send_keyboard_report(); + } else { + register_code(pseudo_keycode); + } + } + } else { + if (get_shift_bit(keycode)) { + del_shift_bit(keycode); + pseudo_keycode = convert_keycode(keymap, keycode, true); } else { - if (get_shift_bit(keycode)) { - del_shift_bit(keycode); - pseudo_keycode = convert_keycode(keymap, keycode, true); - } else { - pseudo_keycode = convert_keycode(keymap, keycode, false); - } - dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); + pseudo_keycode = convert_keycode(keymap, keycode, false); + } + dprintf("released: %02X, converted: %04X\n", keycode, pseudo_keycode); - if (IS_LSFT(pseudo_keycode)) { - unregister_code(QK_LSFT ^ pseudo_keycode); - } else { - unregister_code(pseudo_keycode); - } + if (IS_LSFT(pseudo_keycode)) { + unregister_code(QK_LSFT ^ pseudo_keycode); + } else { + unregister_code(pseudo_keycode); } + } } uint16_t convert_keycode(const uint16_t (*keymap)[2], uint16_t keycode, bool shift_modded) { - uint16_t pseudo_keycode; + uint16_t pseudo_keycode; - switch (keycode) { - case KC_A ... KC_CAPSLOCK: -#if defined(__AVR__) - if (shift_modded) { - pseudo_keycode = pgm_read_word(&keymap[keycode][1]); - } else { - pseudo_keycode = pgm_read_word(&keymap[keycode][0]); - } -#else - if (shift_modded) { - pseudo_keycode = keymap[keycode][1]; - } else { - pseudo_keycode = keymap[keycode][0]; - } -#endif - /* if undefined, use got keycode as it is */ - if (pseudo_keycode == 0x00) { - if (shift_modded) { - pseudo_keycode = S(keycode); - } else { - pseudo_keycode = keycode; - } - } - break; - default: - if (shift_modded) { - pseudo_keycode = S(keycode); - } else { - pseudo_keycode = keycode; - } - break; - } - return pseudo_keycode; + switch (keycode) { + case KC_A ... KC_CAPSLOCK: + #if defined(__AVR__) + if (shift_modded) { + pseudo_keycode = pgm_read_word(&keymap[keycode][1]); + } else { + pseudo_keycode = pgm_read_word(&keymap[keycode][0]); + } + #else + if (shift_modded) { + pseudo_keycode = keymap[keycode][1]; + } else { + pseudo_keycode = keymap[keycode][0]; + } + #endif + /* if undefined, use got keycode as it is */ + if (pseudo_keycode == 0x00) { + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + } + break; + default: + if (shift_modded) { + pseudo_keycode = S(keycode); + } else { + pseudo_keycode = keycode; + } + break; + } + return pseudo_keycode; } uint8_t get_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); - } else { - dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); - return 0; - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + return send_key_shift_bit[keycode >> 3] & (1 << (keycode & 7)); + } else { + dprintf("get_shift_bit: Can't get shift bit. keycode: %02X\n", keycode); + return 0; + } } void add_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); - } else { - dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] |= (1 << (keycode & 7)); + } else { + dprintf("add_shift_bit: Can't add shift bit. keycode: %02X\n", keycode); + } } void del_shift_bit(uint16_t keycode) { - if ((keycode >> 3) < SHIFT_BIT_SIZE) { - send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); - } else { - dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); - } + if ((keycode >> 3) < SHIFT_BIT_SIZE) { + send_key_shift_bit[keycode >> 3] &= ~(1 << (keycode & 7)); + } else { + dprintf("del_shift_bit: Can't delete shift bit. keycode: %02X\n", keycode); + } } diff --git a/keyboards/comet46/keymaps/satt/config.h b/keyboards/comet46/keymaps/satt/config.h new file mode 100644 index 0000000000..c99de2cf80 --- /dev/null +++ b/keyboards/comet46/keymaps/satt/config.h @@ -0,0 +1,34 @@ +/* +This is the c configuration file for the keymap + +Copyright 2012 Jun Wako +Copyright 2015 Jack Humbert + +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 . +*/ + +#ifndef CONFIG_USER_H +#define CONFIG_USER_H + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSFT) | MOD_BIT(KC_RSFT)) \ +) + +/* Use I2C or Serial */ + +#define USE_I2C +#define SSD1306OLED + +#endif diff --git a/keyboards/comet46/keymaps/satt/keymap.c b/keyboards/comet46/keymaps/satt/keymap.c index 7e728e5d08..eec40eff49 100644 --- a/keyboards/comet46/keymaps/satt/keymap.c +++ b/keyboards/comet46/keymaps/satt/keymap.c @@ -4,64 +4,96 @@ #include QMK_KEYBOARD_H #include "keymap_jis2us.h" #include "action_pseudo_lut.h" +#include "keymap_jp.h" +#ifdef SSD1306OLED + #include "ssd1306.h" +#endif // 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. enum comet46_layers { - _QWERTY, - _LOWER, - _RAISE, - _PSEUDO_US, - _PSEUDO_US_LOWER, - _PSEUDO_US_RAISE, - _ADJUST + _QWERTY, + _LOWER, + _RAISE, + _PSEUDO_US, + _PSEUDO_US_LOWER, + _PSEUDO_US_RAISE, + _ADJUST }; enum custom_keycodes { QWERTY = SAFE_RANGE, PSEUDO_US, + JIS2US, }; -#define KC_LWR MO(_LOWER) -#define KC_RSE MO(_RAISE) +// JIS keycodes +#define KC_JZHT JP_ZHTG // hankaku/zenkaku|kanzi +#define KC_JCIR JP_CIRC // ^, ~ +#define KC_JAT JP_AT // @, ` +#define KC_JLBR JP_LBRC // [, { +#define KC_JCOL JP_COLN // :, * +#define KC_JRBR JP_RBRC // ], } +#define KC_JBSL JP_BSLS // \, _ +#define KC_JMHE JP_MHEN // muhenkan +#define KC_JHEN JP_HENK // henkan +#define KC_JKAN JP_KANA // katakana/hiragana|ro-mazi +#define KC_JMKA JP_MKANA //kana on MacOSX +#define KC_JMEI JP_MEISU //eisu on MacOSX +#define KC_JAMP JP_AMPR // & +#define KC_JQUO JP_QUOT // ' +#define KC_JLPR JP_LPRN // ( +#define KC_JRPR JP_RPRN // ) +#define KC_JEQL JP_EQL // = +#define KC_JTIL JP_TILD // ~ +#define KC_JPIP JP_PIPE // | +#define KC_JGRV JP_GRV // ` +#define KC_JLCB JP_LCBR // { +#define KC_JPLU JP_PLUS // + +#define KC_JAST JP_ASTR // * +#define KC_JRCB JP_RCBR // } +#define KC_JUND JP_UNDS // _ + +// Layer related keycodes +#define KC_LWR MO(_LOWER) +#define KC_RSE MO(_RAISE) #define KC_P_LW MO(_PSEUDO_US_LOWER) #define KC_P_RS MO(_PSEUDO_US_RAISE) #define KC_QWRT QWERTY #define KC_P_US PSEUDO_US +#define KC_J2US JIS2US + +// Special keycodes #define KC_SPCT CTL_T(KC_SPC) #define KC_ENSF SFT_T(KC_ENT) -#define KC_SFTA SFT_T(KC_A) -#define KC_CTSF S(KC_LCTL) +#define KC_CAEC MT(MOD_LCTL | MOD_LALT, KC_ESC) +#define KC_CSTB C_S_T(KC_TAB) #define KC_IMON ALT_T(KC_F13) #define KC_IMOF GUI_T(KC_F14) -#define KC_SRO S(KC_RO) -#define KC_SYEN S(KC_JYEN) #define KC_CAD LCA(KC_DEL) #define KC_RST RESET -#define LONGPRESS_DELAY 150 - // Fillers to make layering more clear -#define KC_ KC_TRNS +#define KC_ KC_TRNS #define KC_XXXX KC_NO const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = LAYOUT_kc( + [_QWERTY] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL , + CAEC, Q , W , E , R , T , Y , U , I , O , P ,DEL , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - TAB ,SFTA, S , D , F , G ,LPRN, RPRN, H , J , K , L ,SCLN,BSPC, + CSTB, A , S , D , F , G ,LPRN, RPRN, H , J , K , L ,SCLN,BSPC, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CTSF, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,QUOT, + LSFT, Z , X , C , V , B ,LBRC, RBRC, N , M ,COMM,DOT ,SLSH,QUOT, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| IMOF,LWR ,SPCT, ENSF,RSE ,IMON // +----+----+---/ \---+----+----+ ), - [_LOWER] = LAYOUT_kc( + [_LOWER] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. ,EXLM, AT ,HASH,DLR ,PERC, CIRC,AMPR,ASTR,LPRN,RPRN, , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| @@ -69,60 +101,60 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , F7 , F8 , F9 , F10, F11, F12, TILD,PIPE,UNDS,PLUS,LCBR,RCBR, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_RAISE] = LAYOUT_kc( + [_RAISE] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| , , , , , , , XXXX,LEFT,DOWN, UP ,RGHT,END , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , HOME,XXXX,XXXX,XXXX,XXXX,XXXX, , + , , , , , , , HOME,XXXX,PGDN,PGUP,XXXX,XXXX, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US] = LAYOUT_kc( + [_PSEUDO_US] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ESC , Q , W , E , R , T , Y , U , I , O , P ,DEL , + CAEC, Q , W , E , R , T , Y , U , I , O , P ,DEL , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - TAB ,SFTA, S , D , F , G ,ASTR, LPRN, H , J , K , L ,FN0 ,BSPC, + CSTB, A , S , D , F , G ,JLPR, JRPR, H , J , K , L ,J2US,BSPC, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - CTSF, Z , X , C , V , B ,FN0 , FN0 , N , M ,COMM,DOT ,SLSH,FN0 , + LSFT, Z , X , C , V , B ,J2US, J2US, N , M ,COMM,DOT ,SLSH,J2US, //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| IMOF,P_LW,SPCT, ENSF,P_RS,IMON // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US_LOWER] = LAYOUT_kc( + [_PSEUDO_US_LOWER] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. - ,EXLM,LBRC,HASH,DLR ,PERC, EQL ,CIRC, DQT,ASTR,LPRN, , + ,EXLM,JAT ,HASH,DLR ,PERC, JCIR,JAMP,JAST,JLPR,JRPR, , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - , F1 , F2 , F3 , F4 , F5 , F6 , LCBR,JYEN,MINS,UNDS,RBRC,BSLS, , + , F1 , F2 , F3 , F4 , F5 , F6 , JGRV,JBSL,MINS,JEQL,JLBR,JRBR, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , F7 , F8 , F9 , F10, F11, F12, PLUS,SYEN,SRO ,COLN,RCBR,PIPE, , + , F7 , F8 , F9 , F10, F11, F12, JTIL,JPIP,JUND,JPLU,JLCB,JRCB, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_PSEUDO_US_RAISE] = LAYOUT_kc( + [_PSEUDO_US_RAISE] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| - , , , , , , GRV, XXXX,LEFT,DOWN, UP ,RGHT,END , , + , , , , , ,JZHT, XXXX,LEFT,DOWN, UP ,RGHT,END , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , , , HOME,XXXX,XXXX,XXXX,XXXX,XXXX, , + , , , , , , , HOME,XXXX,PGDN,PGUP,XXXX,XXXX, , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ), - [_ADJUST] = LAYOUT_kc( + [_ADJUST] = LAYOUT_kc( //,----+----+----+----+----+----+ +----+----+----+----+----+----. , , , , , , , , , , , , //|----+----+----+----+----+----+----+ +----+----+----+----+----+----+----| @@ -130,90 +162,130 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| , , , , , ,RST , P_US, , , , , , , //|----+----+----+----+----+----+----| |----+----+----+----+----+----+----| - , , , , , + , , , , , // +----+----+---/ \---+----+----+ ) }; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _PSEUDO_US_LOWER: + case _PSEUDO_US_RAISE: + return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); + break; + default: + return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); + break; + } +} -/* - * user defined action function - */ -enum function_id { - PSEUDO_US_FUNCTION, -}; +//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h +#ifdef SSD1306OLED -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) - { - case PSEUDO_US_FUNCTION: - action_pseudo_lut(record, _QWERTY, keymap_jis2us); - break; - } -} +// You need to add source files to SRC in rules.mk when using OLED display functions +void set_keylog(uint16_t keycode); +const char *read_keylog(void); +const char *read_modifier_state(void); +const char *read_host_led_state(void); -/* - * Fn action definition - */ -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(PSEUDO_US_FUNCTION), -}; +void matrix_init_user(void) { + iota_gfx_init(false); // turns on the display +} void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); + iota_gfx_task(); // this is what updates the display continuously +} + +void matrix_update(struct CharacterMatrix *dest, const struct CharacterMatrix *source) { + if (memcmp(dest->display, source->display, sizeof(dest->display))) { + memcpy(dest->display, source->display, sizeof(dest->display)); + dest->dirty = true; + } +} + +void render_status(struct CharacterMatrix *matrix) { + // Layer state + char layer_str[22]; + matrix_write(matrix, "Layer: "); + uint8_t layer = biton32(layer_state); + uint8_t default_layer = biton32(eeconfig_read_default_layer()); switch (layer) { - case _LOWER: - set_led_red; - break; + case _QWERTY: + switch (default_layer) { + case _QWERTY: + snprintf(layer_str, sizeof(layer_str), "Qwerty"); + break; + case _PSEUDO_US: + snprintf(layer_str, sizeof(layer_str), "Psuedo_US"); + break; + default: + snprintf(layer_str, sizeof(layer_str), "Undef-%d", default_layer); + break; + } + break; case _RAISE: - set_led_blue; - break; - case _PSEUDO_US_LOWER: - set_led_yellow; - break; + snprintf(layer_str, sizeof(layer_str), "Raise"); + break; + case _LOWER: + snprintf(layer_str, sizeof(layer_str), "Lower"); + break; case _PSEUDO_US_RAISE: - set_led_cyan; - break; + snprintf(layer_str, sizeof(layer_str), "P_US_Raise"); + break; + case _PSEUDO_US_LOWER: + snprintf(layer_str, sizeof(layer_str), "P_US_Lower"); + break; case _ADJUST: - set_led_magenta; - break; + snprintf(layer_str, sizeof(layer_str), "Adjust"); + break; default: - set_led_green; - break; + snprintf(layer_str, sizeof(layer_str), "Undef-%d", layer); } -}; + matrix_write_ln(matrix, layer_str); + // Last entered keycode + matrix_write_ln(matrix, read_keylog()); + // Modifier state + matrix_write_ln(matrix, read_modifier_state()); + // Host Keyboard LED Status + matrix_write(matrix, read_host_led_state()); +} -uint32_t layer_state_set_user(uint32_t state) { - switch (biton32(state)) { - case _PSEUDO_US: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - case _PSEUDO_US_LOWER: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - case _PSEUDO_US_RAISE: - return update_tri_layer_state(state, _PSEUDO_US_RAISE, _PSEUDO_US_LOWER, _ADJUST); - break; - default: - return update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); - break; +void iota_gfx_task_user(void) { + struct CharacterMatrix matrix; + +#if DEBUG_TO_SCREEN + if (debug_enable) { + return; } +#endif + + matrix_clear(&matrix); + render_status(&matrix); + matrix_update(&display, &matrix); } +#endif//SSD1306OLED + bool process_record_user(uint16_t keycode, keyrecord_t *record) { + #ifdef SSD1306OLED + if (record->event.pressed) { + set_keylog(keycode); + } + #endif switch (keycode) { case QWERTY: if (record->event.pressed) { set_single_persistent_default_layer(_QWERTY); } - return false; break; case PSEUDO_US: if (record->event.pressed) { set_single_persistent_default_layer(_PSEUDO_US); } - return false; + break; + case JIS2US: + action_pseudo_lut(record, _QWERTY, keymap_jis2us); break; } return true; diff --git a/keyboards/comet46/keymaps/satt/keymap_jis2us.h b/keyboards/comet46/keymaps/satt/keymap_jis2us.h index cf2bd4f0e8..e32a0579aa 100644 --- a/keyboards/comet46/keymaps/satt/keymap_jis2us.h +++ b/keyboards/comet46/keymaps/satt/keymap_jis2us.h @@ -3,30 +3,30 @@ /* keymap for convert from JIS to US */ const uint16_t PROGMEM keymap_jis2us[][2] = { - [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ + [KC_A ... KC_CAPS] = { 0x00, 0x00 }, /* default value */ - [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ - [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ - [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ - [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ - [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ - [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ - [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ - [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ - [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ - [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ - [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ - [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ - [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ - [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ - [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ - [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ - [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ - [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ - [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ - [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ - [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ - [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ + [KC_1] = { KC_1, KC_EXLM }, /* 1 and ! -> 1 and ! */ + [KC_2] = { KC_2, KC_LBRC }, /* 2 and " -> 2 and @ */ + [KC_3] = { KC_3, KC_HASH }, /* 3 and # -> 3 and # */ + [KC_4] = { KC_4, KC_DLR }, /* 4 and $ -> 4 and $ */ + [KC_5] = { KC_5, KC_PERC }, /* 5 and % -> 5 and % */ + [KC_6] = { KC_6, KC_EQL }, /* 6 and & -> 6 and ^ */ + [KC_7] = { KC_7, KC_CIRC }, /* 7 and ' -> 7 and & */ + [KC_8] = { KC_8, KC_DQT }, /* 8 and ( -> 8 and * */ + [KC_9] = { KC_9, KC_ASTR }, /* 9 and ) -> 9 and ( */ + [KC_0] = { KC_0, KC_LPRN }, /* 0 and (no assign) -> 0 and ) */ + [KC_MINS] = { KC_MINS, S(KC_RO) }, /* - and = -> - and _ */ + [KC_EQL] = { KC_UNDS, KC_COLN }, /* ^ and ~ -> = and + */ + [KC_LBRC] = { KC_RBRC, KC_RCBR }, /* @ and ` -> [ and { */ + [KC_RBRC] = { KC_BSLS, KC_PIPE }, /* [ and { -> ] and } */ + [KC_BSLS] = { KC_JYEN, S(KC_JYEN) }, /* ] and } -> / and | */ + [KC_NUHS] = { KC_NUHS, S(KC_NUHS) }, /* (no assign) */ + [KC_SCLN] = { KC_SCLN, KC_QUOT }, /* ; and + -> ; and : */ + [KC_QUOT] = { KC_AMPR, KC_AT }, /* : and * -> ' and " */ + [KC_GRV] = { KC_LCBR, KC_PLUS }, /* (no assign) -> ` and ~ */ + [KC_COMM] = { KC_COMM, KC_LT }, /* , and < -> , and < */ + [KC_DOT] = { KC_DOT, KC_GT }, /* . and > -> . and > */ + [KC_SLSH] = { KC_SLSH, KC_QUES }, /* / and ? -> / and ? */ }; #endif diff --git a/keyboards/comet46/keymaps/satt/rules.mk b/keyboards/comet46/keymaps/satt/rules.mk index dc4355c78f..5839b778b8 100644 --- a/keyboards/comet46/keymaps/satt/rules.mk +++ b/keyboards/comet46/keymaps/satt/rules.mk @@ -1,26 +1,7 @@ SRC += action_pseudo_lut.c -# 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 = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) -CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration -NKRO_ENABLE = no # 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 controls -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. -ONEHAND_ENABLE = no # Enable one-hand typing - -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +# If you want to change display settings of the OLED, you need to change the following lines +SRC += ./lib/glcdfont.c \ + ./lib/keylogger.c \ + ./lib/modifier_state_reader.c \ + ./lib/host_led_state_reader.c diff --git a/keyboards/comet46/lib/glcdfont.c b/keyboards/comet46/lib/glcdfont.c new file mode 100644 index 0000000000..e912d2233c --- /dev/null +++ b/keyboards/comet46/lib/glcdfont.c @@ -0,0 +1,148 @@ +// This is the 'classic' fixed-space bitmap font for Adafruit_GFX since 1.0. +// See gfxfont.h for newer custom bitmap font info. + +#ifndef FONT5X7_H +#define FONT5X7_H + +#ifdef __AVR__ + #include + #include +#elif defined(ESP8266) + #include +#else + #define PROGMEM +#endif + +// Standard ASCII 5x7 font + +const unsigned char font[] PROGMEM = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, + 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, + 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, + 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, + 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, + 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, + 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, + 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, + 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, + 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, + 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, + 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, + 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, + 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, + 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, + 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, + 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, + 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, + 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, + 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, + 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, + 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00, + 0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, + 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, + 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, + 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, + 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, + 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, + 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, + 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, + 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, + 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, + 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, + 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, + 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, + 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, + 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, + 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, + 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, + 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, + 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, + 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, + 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, + 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, + 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00, + 0x72, 0x49, 0x49, 0x49, 0x46, 0x00, + 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, + 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, + 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, + 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, + 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, + 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, + 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, + 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, + 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, + 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, + 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, + 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, + 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, + 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, + 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, + 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00, + 0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, + 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, + 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, + 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, + 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, + 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, + 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, + 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, + 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, + 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, + 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, + 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, + 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, + 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, + 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, + 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, + 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, + 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, + 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, + 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, + 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, + 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, + 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x28, 0x00, + 0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, + 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, + 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, + 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, + 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, + 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, + 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, + 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, + 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, + 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, + 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, + 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, + 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, + 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, + 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, + 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, + 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, + 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, + 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, + 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, + 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, + 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, + 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, + 0x00, 0x41, 0x36, 0x08, 0x00, 0x00, + 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, + 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00 +}; +#endif // FONT5X7_H diff --git a/keyboards/comet46/lib/host_led_state_reader.c b/keyboards/comet46/lib/host_led_state_reader.c new file mode 100644 index 0000000000..864b1e2447 --- /dev/null +++ b/keyboards/comet46/lib/host_led_state_reader.c @@ -0,0 +1,15 @@ +#include +#include "comet46.h" + +char host_led_state_str[22]; + +const char *read_host_led_state(void) { + uint8_t leds = host_keyboard_leds(); + + snprintf(host_led_state_str, sizeof(host_led_state_str), "Lock: %s%s%s", + (leds & (1 << USB_LED_CAPS_LOCK)) ? "CAPL " : "", + (leds & (1 << USB_LED_SCROLL_LOCK)) ? "SCRL " : "", + (leds & (1 << USB_LED_NUM_LOCK)) ? "NUML" : ""); + + return host_led_state_str; +} diff --git a/keyboards/comet46/lib/keylogger.c b/keyboards/comet46/lib/keylogger.c new file mode 100644 index 0000000000..184f601095 --- /dev/null +++ b/keyboards/comet46/lib/keylogger.c @@ -0,0 +1,294 @@ +#include + +#ifdef __AVR__ + #include + #include +#else + #define PROGMEM +#endif + +#define NUM_USB_HID_KEYCODES 255 +#define LEN_KEYCODE_STR 4 + +char keylog[22] = {"KC: ID: "}; + +// Quick and dirty way to display USB HID keycodes used in QMK +// USB HID keycodes from 0x0000 to 0x00FF are stored in a 4x256+1 length char +const char code_to_name[] PROGMEM = { + "NO " //0x00 + "TRNS" + "? " + "? " + "A " + "B " + "C " + "D " + "E " + "F " + "G " + "H " + "I " + "J " + "K " + "L " + "M " //0x10 + "N " + "O " + "P " + "Q " + "R " + "S " + "T " + "U " + "V " + "W " + "X " + "Y " + "Z " + "1 " + "2 " + "3 " //0x20 + "4 " + "5 " + "6 " + "7 " + "8 " + "9 " + "0 " + "ENT " + "ESC " + "BSPC" + "TAB " + "SPC " + "MINS" + "EQL " + "LBRC" + "RBRC" //0x30 + "BSLS" + "NUHS" + "SCLN" + "QUOT" + "GRV " + "COMM" + "DOT " + "SLSH" + "CAPS" + "F1 " + "F2 " + "F3 " + "F4 " + "F5 " + "F6 " + "F7 " //0x40 + "F8 " + "F9 " + "F10 " + "F11 " + "F12 " + "PSCR" + "SLCK" + "PAUS" + "INS " + "HOME" + "PGUP" + "DEL " + "END " + "PGDN" + "RGHT" + "LEFT" //0x50 + "DOWN" + "UP " + "NLCK" + "PSLS" + "PAST" + "PMNS" + "PPLS" + "PENT" + "P1 " + "P2 " + "P3 " + "P4 " + "P5 " + "P6 " + "P7 " + "P8 " //0x60 + "P9 " + "P0 " + "PDOT" + "NUBS" + "APP " + "POW " + "PEQL" + "F13 " + "F14 " + "F15 " + "F16 " + "F17 " + "F18 " + "F19 " + "F20 " + "F21 " //0x70 + "F22 " + "F23 " + "F24 " + "EXEC" + "HELP" + "MENU" + "SLCT" + "STOP" + "AGIN" + "UNDO" + "CUT " + "COPY" + "PSTE" + "FIND" + "_MUT" + "_VUP" //0x80 + "_VDN" + "LCAP" + "LNUM" + "LSCR" + "PCMM" + "PEQA" + "INT1" + "INT2" + "INT3" + "INT4" + "INT5" + "INT6" + "INT7" + "INT8" + "INT9" + "LAN1" //0x90 + "LAN2" + "LAN3" + "LAN4" + "LAN5" + "LAN6" + "LAN7" + "LAN8" + "LAN9" + "ERAS" + "SYSR" + "CNCL" + "CLR " + "PRIR" + "RTRN" + "SEP " + "OUT " //0xA0 + "OPER" + "CLRA" + "CSEL" + "ESEL" + "PWR " //0xA5 + "SLEP" + "WAKE" + "MUTE" + "VOLU" + "VOLD" + "MNXT" + "MPRV" + "MSTP" + "MPLY" + "MSEL" + "EJCT" //0xB0 + "MAIL" + "CALC" + "MYCM" + "WSCH" + "WHOM" + "WBAK" + "WFWD" + "WSTP" + "WREF" + "WFAV" + "MFFD" + "MRWD" + "BRIU" + "BRID" + "? " + "FN0 " //0xC0 + "FN1 " + "FN2 " + "FN3 " + "FN4 " + "FN5 " + "FN6 " + "FN7 " + "FN8 " + "FN9 " + "FN10" + "FN11" + "FN12" + "FN13" + "FN14" + "FN15" + "FN16" //0xD0 + "FN17" + "FN18" + "FN19" + "FN20" + "FN21" + "FN22" + "FN23" + "FN24" + "FN25" + "FN26" + "FN27" + "FN28" + "FN29" + "FN30" + "FN31" + "LCTL" //0xE0 + "LSFT" + "LALT" + "LGUI" + "RCTL" + "RSFT" + "RALT" + "RGUI" + "? " + "? " + "? " + "? " + "? " + "? " + "? " + "? " + "MS_U" //0xF0 + "MS_D" + "MS_L" + "MS_R" + "BTN1" + "BTN2" + "BTN3" + "BTN4" + "BTN5" + "WH_U" + "WH_D" + "WH_L" + "WH_R" + "ACL0" + "ACL1" + "ACL2" +}; + +void set_keylog(uint16_t keycode) +{ + char name[LEN_KEYCODE_STR+1] = "? "; + + if (keycode <= NUM_USB_HID_KEYCODES) { + for (uint8_t k = 0; k < LEN_KEYCODE_STR; k++) { + name[k] = pgm_read_byte_near(code_to_name + keycode * LEN_KEYCODE_STR + k); + } + } else if (keycode > NUM_USB_HID_KEYCODES) { + snprintf(name, sizeof(name), "QMK "); + } + + // update keylog + snprintf(keylog, sizeof(keylog), "KC: %s ID: %d", name, keycode); +} + +const char *read_keylog(void) { + return keylog; +} diff --git a/keyboards/comet46/lib/modifier_state_reader.c b/keyboards/comet46/lib/modifier_state_reader.c new file mode 100644 index 0000000000..518eef92a6 --- /dev/null +++ b/keyboards/comet46/lib/modifier_state_reader.c @@ -0,0 +1,18 @@ +#include +#include "comet46.h" + +char modifier_state_str[22]; + +const char *read_modifier_state(void) { + uint8_t modifiers = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + + snprintf(modifier_state_str, sizeof(modifier_state_str), "Mod: %s%s%s%s", + (modifiers & MODS_CTRL_MASK || one_shot & MODS_CTRL_MASK) ? "CTL " : "", + (modifiers & MODS_GUI_MASK || one_shot & MODS_GUI_MASK) ? "GUI " : "", + (modifiers & MODS_ALT_MASK || one_shot & MODS_ALT_MASK) ? "ALT " : "", + (modifiers & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) ? "SFT" : "" + ); + + return modifier_state_str; +} diff --git a/keyboards/comet46/readme.md b/keyboards/comet46/readme.md index 8df27183d0..3db64d291b 100644 --- a/keyboards/comet46/readme.md +++ b/keyboards/comet46/readme.md @@ -1,6 +1,6 @@ # Comet46 -![Comet46](https://user-images.githubusercontent.com/39004890/42418180-d5bb188c-82d5-11e8-99fa-65020ce5ac5d.jpg) +![Comet46](https://user-images.githubusercontent.com/39004890/50396817-a1660600-07af-11e9-8611-3156c635db43.jpg) A split wireless 40% column-staggered keyboard @@ -13,4 +13,5 @@ Make example for this keyboard (after setting up your build environment): make comet46:default -See [build environment setup](https://docs.qmk.fm/build_environment_setup.html) then the [make instructions](https://docs.qmk.fm/make_instructions.html) for more information. +See [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) then the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. + diff --git a/keyboards/comet46/rules.mk b/keyboards/comet46/rules.mk index 648b8b2008..897cc9b8c6 100644 --- a/keyboards/comet46/rules.mk +++ b/keyboards/comet46/rules.mk @@ -1,12 +1,8 @@ - -OPT_DEFS += -DCOMET46_ORTHO_===PROMICRO -COMET46_UPLOAD_COMMAND = while [ ! -r $(USB) ]; do sleep 1; done; \ - avrdude -p $(MCU) -c avr109 -U flash:w:$(TARGET).hex -P $(USB) - # # project specific files -SRC = matrix.c - - +SRC += matrix.c \ + i2c.c \ + ssd1306.c + # MCU name #MCU = at90usb1287 MCU = atmega32u4 @@ -24,8 +20,6 @@ MCU = atmega32u4 # software delays. F_CPU = 16000000 - -# # LUFA specific # # Target architecture (see library "Board Types" documentation). @@ -48,7 +42,7 @@ F_USB = $(F_CPU) # 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 = caterina +# BOOTLOADER = caterina # Interrupt driven control endpoint task(+60) OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT diff --git a/keyboards/comet46/ssd1306.c b/keyboards/comet46/ssd1306.c new file mode 100644 index 0000000000..4330c8497d --- /dev/null +++ b/keyboards/comet46/ssd1306.c @@ -0,0 +1,344 @@ +#ifdef SSD1306OLED + +#include "ssd1306.h" +#include "i2c.h" +#include +#include "print.h" +#ifdef ADAFRUIT_BLE_ENABLE +#include "adafruit_ble.h" +#endif +#ifdef PROTOCOL_LUFA +#include "lufa.h" +#endif +#include "sendchar.h" +#include "timer.h" + +static const unsigned char font[] PROGMEM; + +// Set this to 1 to help diagnose early startup problems +// when testing power-on with ble. Turn it off otherwise, +// as the latency of printing most of the debug info messes +// with the matrix scan, causing keys to drop. +#define DEBUG_TO_SCREEN 0 + +//static uint16_t last_battery_update; +//static uint32_t vbat; +//#define BatteryUpdateInterval 10000 /* milliseconds */ + +// 'last_flush' is declared as uint16_t, +// so this must be less than 65535 +#define ScreenOffInterval 60000 /* milliseconds */ +#if DEBUG_TO_SCREEN +static uint8_t displaying; +#endif +static uint16_t last_flush; + +static bool force_dirty = true; + +// Write command sequence. +// Returns true on success. +static inline bool _send_cmd1(uint8_t cmd) { + bool res = false; + + if (i2c_start_write(SSD1306_ADDRESS)) { + xprintf("failed to start write to %d\n", SSD1306_ADDRESS); + goto done; + } + + if (i2c_master_write(0x0 /* command byte follows */)) { + print("failed to write control byte\n"); + + goto done; + } + + if (i2c_master_write(cmd)) { + xprintf("failed to write command %d\n", cmd); + goto done; + } + res = true; +done: + i2c_master_stop(); + return res; +} + +// Write 2-byte command sequence. +// Returns true on success +static inline bool _send_cmd2(uint8_t cmd, uint8_t opr) { + if (!_send_cmd1(cmd)) { + return false; + } + return _send_cmd1(opr); +} + +// Write 3-byte command sequence. +// Returns true on success +static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) { + if (!_send_cmd1(cmd)) { + return false; + } + if (!_send_cmd1(opr1)) { + return false; + } + return _send_cmd1(opr2); +} + +#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;} +#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;} +#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;} + +static void clear_display(void) { + matrix_clear(&display); + + // Clear all of the display bits (there can be random noise + // in the RAM on startup) + send_cmd3(PageAddr, 0, (DisplayHeight / 8) - 1); + send_cmd3(ColumnAddr, 0, DisplayWidth - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < DisplayWidth; ++col) { + i2c_master_write(0); + } + } + + display.dirty = false; + +done: + i2c_master_stop(); +} + +#if DEBUG_TO_SCREEN +#undef sendchar +static int8_t capture_sendchar(uint8_t c) { + sendchar(c); + iota_gfx_write_char(c); + + if (!displaying) { + iota_gfx_flush(); + } + return 0; +} +#endif + +bool iota_gfx_init(bool rotate) { + bool success = false; + + i2c_master_init(); + send_cmd1(DisplayOff); + send_cmd2(SetDisplayClockDiv, 0x80); + send_cmd2(SetMultiPlex, DisplayHeight - 1); + + send_cmd2(SetDisplayOffset, 0); + + + send_cmd1(SetStartLine | 0x0); + send_cmd2(SetChargePump, 0x14 /* Enable */); + send_cmd2(SetMemoryMode, 0 /* horizontal addressing */); + + if(rotate){ + // the following Flip the display orientation 180 degrees + send_cmd1(SegRemap); + send_cmd1(ComScanInc); + }else{ + // Flips the display orientation 0 degrees + send_cmd1(SegRemap | 0x1); + send_cmd1(ComScanDec); + } + + send_cmd2(SetComPins, 0x2); + send_cmd2(SetContrast, 0x8f); + send_cmd2(SetPreCharge, 0xf1); + send_cmd2(SetVComDetect, 0x40); + send_cmd1(DisplayAllOnResume); + send_cmd1(NormalDisplay); + send_cmd1(DeActivateScroll); + send_cmd1(DisplayOn); + + send_cmd2(SetContrast, 0); // Dim + + clear_display(); + + success = true; + + iota_gfx_flush(); + +#if DEBUG_TO_SCREEN + print_set_sendchar(capture_sendchar); +#endif + +done: + return success; +} + +bool iota_gfx_off(void) { + bool success = false; + + send_cmd1(DisplayOff); + success = true; + +done: + return success; +} + +bool iota_gfx_on(void) { + bool success = false; + + send_cmd1(DisplayOn); + success = true; + +done: + return success; +} + +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) { + *matrix->cursor = c; + ++matrix->cursor; + + if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) { + // We went off the end; scroll the display upwards by one line + memmove(&matrix->display[0], &matrix->display[1], + MatrixCols * (MatrixRows - 1)); + matrix->cursor = &matrix->display[MatrixRows - 1][0]; + memset(matrix->cursor, ' ', MatrixCols); + } +} + +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) { + matrix->dirty = true; + + if (c == '\n') { + // Clear to end of line from the cursor and then move to the + // start of the next line + uint8_t cursor_col = (matrix->cursor - &matrix->display[0][0]) % MatrixCols; + + while (cursor_col++ < MatrixCols) { + matrix_write_char_inner(matrix, ' '); + } + return; + } + + matrix_write_char_inner(matrix, c); +} + +void iota_gfx_write_char(uint8_t c) { + matrix_write_char(&display, c); +} + +void matrix_write(struct CharacterMatrix *matrix, const char *data) { + const char *end = data + strlen(data); + while (data < end) { + matrix_write_char(matrix, *data); + ++data; + } +} + +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data) { + char data_ln[strlen(data)+2]; + snprintf(data_ln, sizeof(data_ln), "%s\n", data); + matrix_write(matrix, data_ln); +} + +void iota_gfx_write(const char *data) { + matrix_write(&display, data); +} + +void matrix_write_P(struct CharacterMatrix *matrix, const char *data) { + while (true) { + uint8_t c = pgm_read_byte(data); + if (c == 0) { + return; + } + matrix_write_char(matrix, c); + ++data; + } +} + +void iota_gfx_write_P(const char *data) { + matrix_write_P(&display, data); +} + +void matrix_clear(struct CharacterMatrix *matrix) { + memset(matrix->display, ' ', sizeof(matrix->display)); + matrix->cursor = &matrix->display[0][0]; + matrix->dirty = true; +} + +void iota_gfx_clear_screen(void) { + matrix_clear(&display); +} + +void matrix_render(struct CharacterMatrix *matrix) { + last_flush = timer_read(); + iota_gfx_on(); +#if DEBUG_TO_SCREEN + ++displaying; +#endif + + // Move to the home position + send_cmd3(PageAddr, 0, MatrixRows - 1); + send_cmd3(ColumnAddr, 0, (MatrixCols * FontWidth) - 1); + + if (i2c_start_write(SSD1306_ADDRESS)) { + goto done; + } + if (i2c_master_write(0x40)) { + // Data mode + goto done; + } + + for (uint8_t row = 0; row < MatrixRows; ++row) { + for (uint8_t col = 0; col < MatrixCols; ++col) { + const uint8_t *glyph = font + (matrix->display[row][col] * FontWidth); + + for (uint8_t glyphCol = 0; glyphCol < FontWidth; ++glyphCol) { + uint8_t colBits = pgm_read_byte(glyph + glyphCol); + i2c_master_write(colBits); + } + + // 1 column of space between chars (it's not included in the glyph) + //i2c_master_write(0); + } + } + + matrix->dirty = false; + +done: + i2c_master_stop(); +#if DEBUG_TO_SCREEN + --displaying; +#endif +} + +void iota_gfx_flush(void) { + matrix_render(&display); +} + +__attribute__ ((weak)) +void iota_gfx_task_user(void) { +} + +void iota_gfx_task(void) { + iota_gfx_task_user(); + + if (display.dirty|| force_dirty) { + iota_gfx_flush(); + force_dirty = false; + } + + if (timer_elapsed(last_flush) > ScreenOffInterval) { + iota_gfx_off(); + } +} + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record) { + force_dirty = true; + return true; +} + +#endif diff --git a/keyboards/comet46/ssd1306.h b/keyboards/comet46/ssd1306.h new file mode 100644 index 0000000000..ea8c923280 --- /dev/null +++ b/keyboards/comet46/ssd1306.h @@ -0,0 +1,91 @@ +#pragma once + +#include +#include +#include "pincontrol.h" +#include "action.h" + +enum ssd1306_cmds { + DisplayOff = 0xAE, + DisplayOn = 0xAF, + + SetContrast = 0x81, + DisplayAllOnResume = 0xA4, + + DisplayAllOn = 0xA5, + NormalDisplay = 0xA6, + InvertDisplay = 0xA7, + SetDisplayOffset = 0xD3, + SetComPins = 0xda, + SetVComDetect = 0xdb, + SetDisplayClockDiv = 0xD5, + SetPreCharge = 0xd9, + SetMultiPlex = 0xa8, + SetLowColumn = 0x00, + SetHighColumn = 0x10, + SetStartLine = 0x40, + + SetMemoryMode = 0x20, + ColumnAddr = 0x21, + PageAddr = 0x22, + + ComScanInc = 0xc0, + ComScanDec = 0xc8, + SegRemap = 0xa0, + SetChargePump = 0x8d, + ExternalVcc = 0x01, + SwitchCapVcc = 0x02, + + ActivateScroll = 0x2f, + DeActivateScroll = 0x2e, + SetVerticalScrollArea = 0xa3, + RightHorizontalScroll = 0x26, + LeftHorizontalScroll = 0x27, + VerticalAndRightHorizontalScroll = 0x29, + VerticalAndLeftHorizontalScroll = 0x2a, +}; + +// Controls the SSD1306 128x32 OLED display via i2c + +#ifndef SSD1306_ADDRESS +#define SSD1306_ADDRESS 0x3C +#endif + +#define DisplayHeight 32 +#define DisplayWidth 128 + +#define FontHeight 8 +#define FontWidth 6 + +#define MatrixRows (DisplayHeight / FontHeight) +#define MatrixCols (DisplayWidth / FontWidth) + +struct CharacterMatrix { + uint8_t display[MatrixRows][MatrixCols]; + uint8_t *cursor; + bool dirty; +}; + +struct CharacterMatrix display; + +bool iota_gfx_init(bool rotate); +void iota_gfx_task(void); +bool iota_gfx_off(void); +bool iota_gfx_on(void); +void iota_gfx_flush(void); +void iota_gfx_write_char(uint8_t c); +void iota_gfx_write(const char *data); +void iota_gfx_write_P(const char *data); +void iota_gfx_clear_screen(void); + +void iota_gfx_task_user(void); + +void matrix_clear(struct CharacterMatrix *matrix); +void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c); +void matrix_write(struct CharacterMatrix *matrix, const char *data); +void matrix_write_ln(struct CharacterMatrix *matrix, const char *data); +void matrix_write_P(struct CharacterMatrix *matrix, const char *data); +void matrix_render(struct CharacterMatrix *matrix); + +bool process_record_gfx(uint16_t keycode, keyrecord_t *record); \ No newline at end of file -- cgit v1.2.3 From 3ddec14eb8c1b666df381573c6db8a4b2fda035f Mon Sep 17 00:00:00 2001 From: Giuseppe Rota Date: Sat, 29 Dec 2018 15:48:01 +0100 Subject: Register the interrupting keycode in the tap dance state struct --- quantum/process_keycode/process_tap_dance.c | 2 ++ quantum/process_keycode/process_tap_dance.h | 1 + 2 files changed, 3 insertions(+) diff --git a/quantum/process_keycode/process_tap_dance.c b/quantum/process_keycode/process_tap_dance.c index b55ace5ba8..16d33dddee 100644 --- a/quantum/process_keycode/process_tap_dance.c +++ b/quantum/process_keycode/process_tap_dance.c @@ -131,6 +131,7 @@ void preprocess_tap_dance(uint16_t keycode, keyrecord_t *record) { if (keycode == action->state.keycode && keycode == last_td) continue; action->state.interrupted = true; + action->state.interrupting_keycode = keycode; process_tap_dance_action_on_dance_finished (action); reset_tap_dance (&action->state); } @@ -209,5 +210,6 @@ void reset_tap_dance (qk_tap_dance_state_t *state) { state->count = 0; state->interrupted = false; state->finished = false; + state->interrupting_keycode = 0; last_td = 0; } diff --git a/quantum/process_keycode/process_tap_dance.h b/quantum/process_keycode/process_tap_dance.h index 8b0a47c49b..ca12f4746e 100644 --- a/quantum/process_keycode/process_tap_dance.h +++ b/quantum/process_keycode/process_tap_dance.h @@ -27,6 +27,7 @@ typedef struct uint8_t oneshot_mods; uint8_t weak_mods; uint16_t keycode; + uint16_t interrupting_keycode; uint16_t timer; bool interrupted; bool pressed; -- cgit v1.2.3 From 0c0e208a36300660f3d568d52ae3155becf92893 Mon Sep 17 00:00:00 2001 From: takashiski Date: Mon, 31 Dec 2018 07:53:09 +0900 Subject: define brainfuck keymap (#4742) * define brainfuck keymap * Update keyboards/namecard2x4/keymaps/brainfuck/readme.md Co-Authored-By: takashiski --- keyboards/namecard2x4/keymaps/brainfuck/config.h | 19 ++++++++ keyboards/namecard2x4/keymaps/brainfuck/keymap.c | 59 +++++++++++++++++++++++ keyboards/namecard2x4/keymaps/brainfuck/readme.md | 12 +++++ 3 files changed, 90 insertions(+) create mode 100644 keyboards/namecard2x4/keymaps/brainfuck/config.h create mode 100644 keyboards/namecard2x4/keymaps/brainfuck/keymap.c create mode 100644 keyboards/namecard2x4/keymaps/brainfuck/readme.md diff --git a/keyboards/namecard2x4/keymaps/brainfuck/config.h b/keyboards/namecard2x4/keymaps/brainfuck/config.h new file mode 100644 index 0000000000..dbacdcce58 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/config.h @@ -0,0 +1,19 @@ +/* Copyright 2018 takashiski + * + * 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 + +// place overrides here diff --git a/keyboards/namecard2x4/keymaps/brainfuck/keymap.c b/keyboards/namecard2x4/keymaps/brainfuck/keymap.c new file mode 100644 index 0000000000..287e011def --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/keymap.c @@ -0,0 +1,59 @@ +/* Copyright 2018 takashiski + * + * 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 . + */ +#include QMK_KEYBOARD_H +#include "keymap_jp.h" + +enum Layer +{ + JP, + EN, + CONFIG +}; + + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { +[JP] = LAYOUT( + JP_LT,JP_GT,JP_PLUS,JP_MINS,\ + LT(CONFIG,JP_DOT),JP_COMM,JP_LBRC,LT(CONFIG,JP_RBRC)\ + ), +[EN] = LAYOUT( + KC_LT,KC_GT,KC_PLUS,KC_MINS,\ + LT(CONFIG,KC_DOT),KC_COMM,KC_LBRC,LT(CONFIG,KC_RBRC)\ + ), +[CONFIG]= LAYOUT( + KC_NO,DF(JP),DF(JP),KC_NO,\ + KC_TRNS,DF(EN),DF(JP),KC_TRNS\ + ) + +}; + + +void matrix_init_user(void) { + +} + +void matrix_scan_user(void) { + +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + +} diff --git a/keyboards/namecard2x4/keymaps/brainfuck/readme.md b/keyboards/namecard2x4/keymaps/brainfuck/readme.md new file mode 100644 index 0000000000..7fee17acd9 --- /dev/null +++ b/keyboards/namecard2x4/keymaps/brainfuck/readme.md @@ -0,0 +1,12 @@ +# keymap for brainfuck + + This keymap is specialized for the brainfuck programming language. + +| < | > | + | - | +| . | , | [ | ] | + +and when you hold . or ], change config layer. + +default layer is for JP keyboard(logical pairing). +you can choose EN keyboard(typewrite pairing). + -- cgit v1.2.3 From b7688590b8a252f7497e3f78d569b98ae62ab177 Mon Sep 17 00:00:00 2001 From: David Dai Date: Mon, 31 Dec 2018 08:42:58 -0800 Subject: Change rgblight_get_mode & rgb_matrix_get_mode's return type to uint8_t. (#4747) * Change rgblight_get_mode's return type to uint8_t. Since rgblight_get_mode() is just returning rgblight_config_t.mode, it should match rgblight_config_t.mode's type: uint8_t. * Update rgb_matrix_get_mode to return uint8_t. --- keyboards/mxss/rgblight.c | 2 +- quantum/rgb_matrix.c | 2 +- quantum/rgb_matrix.h | 2 +- quantum/rgblight.c | 2 +- quantum/rgblight.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/keyboards/mxss/rgblight.c b/keyboards/mxss/rgblight.c index da7959c6a8..73f94f3ab0 100644 --- a/keyboards/mxss/rgblight.c +++ b/keyboards/mxss/rgblight.c @@ -234,7 +234,7 @@ void rgblight_step_reverse(void) { rgblight_mode(mode); } -uint32_t rgblight_get_mode(void) { +uint8_t rgblight_get_mode(void) { if (!rgblight_config.enable) { return false; } diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 82d36177b5..2ed36304dc 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c @@ -973,7 +973,7 @@ void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_config.mode = mode; } -uint32_t rgb_matrix_get_mode(void) { +uint8_t rgb_matrix_get_mode(void) { return rgb_matrix_config.mode; } diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 0cfeb4e069..e43532d11e 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h @@ -180,7 +180,7 @@ void rgb_matrix_increase_speed(void); void rgb_matrix_decrease_speed(void); void rgb_matrix_mode(uint8_t mode); void rgb_matrix_mode_noeeprom(uint8_t mode); -uint32_t rgb_matrix_get_mode(void); +uint8_t rgb_matrix_get_mode(void); #ifndef RGBLIGHT_ENABLE #define rgblight_toggle() rgb_matrix_toggle() diff --git a/quantum/rgblight.c b/quantum/rgblight.c index ae5dca1884..23420ddd87 100644 --- a/quantum/rgblight.c +++ b/quantum/rgblight.c @@ -234,7 +234,7 @@ void rgblight_step_reverse(void) { rgblight_step_reverse_helper(true); } -uint32_t rgblight_get_mode(void) { +uint8_t rgblight_get_mode(void) { if (!rgblight_config.enable) { return false; } diff --git a/quantum/rgblight.h b/quantum/rgblight.h index 99ede43c5b..65dda3f521 100644 --- a/quantum/rgblight.h +++ b/quantum/rgblight.h @@ -167,7 +167,7 @@ void rgblight_enable(void); void rgblight_disable(void); void rgblight_step(void); void rgblight_step_reverse(void); -uint32_t rgblight_get_mode(void); +uint8_t rgblight_get_mode(void); void rgblight_mode(uint8_t mode); void rgblight_set(void); void rgblight_update_dword(uint32_t dword); -- cgit v1.2.3 From 7f0def77a201bd419517332581dbc2cc3b0bd7eb Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 31 Dec 2018 08:45:44 -0800 Subject: Move Split Common VPATH addition (#4716) Specifically, only add the split_common folder to COMMON_VPATH if the feature is eanbled, to prevent issues with compilation --- common.mk | 1 - common_features.mk | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/common.mk b/common.mk index 272d170e68..aea29a7a20 100644 --- a/common.mk +++ b/common.mk @@ -21,5 +21,4 @@ COMMON_VPATH += $(QUANTUM_PATH)/keymap_extras COMMON_VPATH += $(QUANTUM_PATH)/audio COMMON_VPATH += $(QUANTUM_PATH)/process_keycode COMMON_VPATH += $(QUANTUM_PATH)/api -COMMON_VPATH += $(QUANTUM_PATH)/split_common COMMON_VPATH += $(DRIVER_PATH) diff --git a/common_features.mk b/common_features.mk index 883681324b..c86e8bbfe3 100644 --- a/common_features.mk +++ b/common_features.mk @@ -268,4 +268,5 @@ ifeq ($(strip $(SPLIT_KEYBOARD)), yes) $(QUANTUM_DIR)/split_common/split_util.c QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/i2c.c QUANTUM_LIB_SRC += $(QUANTUM_DIR)/split_common/serial.c + COMMON_VPATH += $(QUANTUM_PATH)/split_common endif -- cgit v1.2.3 From 40383089d035f69101851831f756508271fff103 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Mon, 31 Dec 2018 14:29:56 -0800 Subject: Keymap: Update for Drashna code - Proton C Prep Edition (#4708) * Make CRKBD keylogger output actually show tap keys * check MT/LT for twinkling * Add ortho 5x12 support for fractal keyboard * Use newer interface for setting pins/ports * Remove custom unicode methods * Reomve unicode input info * Odd rules issue * Redefine REST note to be more pleasing * Properly disable PM LEDs with GPIO commands * Update gitlab CI yaml file * Remove extra mod tap check * Remove initial state on ergodox glow * Rev6 Cleanup * Fix KC_MAKE macro * Update GitLab CI yaml file * More GitLab CI changes * One final GitLab CI change * Remove unneeded unicode support * Optimize KC_MAKE --- keyboards/crkbd/keymaps/drashna/keymap.c | 24 ++-- keyboards/iris/keymaps/drashna/keymap.c | 10 +- keyboards/orthodox/keymaps/drashna/keymap.c | 10 +- keyboards/viterbi/keymaps/drashna/keymap.c | 11 +- layouts/community/ergodox/drashna/keymap.c | 10 +- layouts/community/ergodox/drashna/rules.mk | 2 +- layouts/community/ergodox/drashna_glow/rules.mk | 2 + layouts/community/ortho_4x12/drashna/config.h | 5 +- layouts/community/ortho_4x12/drashna/keymap.c | 13 +- layouts/community/ortho_5x12/drashna/config.h | 16 +++ layouts/community/ortho_5x12/drashna/keymap.c | 156 ++++++++++++++++++++++++ layouts/community/ortho_5x12/drashna/rules.mk | 23 ++++ users/drashna/.gitlab-ci.yml | 70 +++++++++-- users/drashna/config.h | 8 +- users/drashna/process_records.c | 41 ++++--- users/drashna/rgb_stuff.c | 5 +- users/drashna/rules.mk | 13 -- users/drashna/send_unicode.c | 112 ----------------- users/drashna/wrappers.h | 1 + 19 files changed, 339 insertions(+), 193 deletions(-) create mode 100644 layouts/community/ortho_5x12/drashna/config.h create mode 100644 layouts/community/ortho_5x12/drashna/keymap.c create mode 100644 layouts/community/ortho_5x12/drashna/rules.mk delete mode 100644 users/drashna/send_unicode.c diff --git a/keyboards/crkbd/keymaps/drashna/keymap.c b/keyboards/crkbd/keymaps/drashna/keymap.c index 282ee25725..678fd33b57 100644 --- a/keyboards/crkbd/keymaps/drashna/keymap.c +++ b/keyboards/crkbd/keymaps/drashna/keymap.c @@ -88,16 +88,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_keymap(void) { - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif - - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); - - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h + #ifdef SSD1306OLED + iota_gfx_init(!has_usb()); // turns on the display + #endif + + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); + + setPinOutput(B0); + writePinHigh(B0); + #endif } //SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h @@ -126,10 +128,10 @@ const char code_to_name[60] = { void set_keylog(uint16_t keycode, keyrecord_t *record) { char name = ' '; + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { keycode = keycode & 0xFF; } if (keycode < 60) { name = code_to_name[keycode]; } - // update keylog snprintf(keylog_str, sizeof(keylog_str), "%dx%d, k%2d : %c", record->event.key.row, record->event.key.col, diff --git a/keyboards/iris/keymaps/drashna/keymap.c b/keyboards/iris/keymaps/drashna/keymap.c index ba6f18edde..d89656b7ea 100644 --- a/keyboards/iris/keymaps/drashna/keymap.c +++ b/keyboards/iris/keymaps/drashna/keymap.c @@ -89,9 +89,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + setPinOutput(B0); + writePinHigh(B0); + #endif } diff --git a/keyboards/orthodox/keymaps/drashna/keymap.c b/keyboards/orthodox/keymaps/drashna/keymap.c index 346ca4f123..9373d851dc 100644 --- a/keyboards/orthodox/keymaps/drashna/keymap.c +++ b/keyboards/orthodox/keymaps/drashna/keymap.c @@ -97,9 +97,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { }; void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + setPinOutput(B0); + writePinHigh(B0); + #endif } diff --git a/keyboards/viterbi/keymaps/drashna/keymap.c b/keyboards/viterbi/keymaps/drashna/keymap.c index a343205197..9ca14961be 100644 --- a/keyboards/viterbi/keymaps/drashna/keymap.c +++ b/keyboards/viterbi/keymaps/drashna/keymap.c @@ -87,10 +87,13 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + void matrix_init_keymap(void) { - DDRD &= ~(1<<5); - PORTD &= ~(1<<5); + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); - DDRB &= ~(1<<0); - PORTB &= ~(1<<0); + setPinOutput(B0); + writePinHigh(B0); + #endif } diff --git a/layouts/community/ergodox/drashna/keymap.c b/layouts/community/ergodox/drashna/keymap.c index df9be62b77..45860b8740 100644 --- a/layouts/community/ergodox/drashna/keymap.c +++ b/layouts/community/ergodox/drashna/keymap.c @@ -20,7 +20,6 @@ along with this program. If not, see . #ifdef UNICODEMAP_ENABLE #include "drashna_unicode.h" #endif // UNICODEMAP_ENABLE -extern uint8_t input_mode; #ifdef RGB_MATRIX_ENABLE extern bool g_suspend_state; @@ -425,17 +424,12 @@ void rgb_matrix_indicators_user(void) { } void matrix_init_keymap(void) { +#if 0 #ifdef RGB_MATRIX_KEYPRESSES rgblight_mode(RGB_MATRIX_MULTISPLASH); #else rgblight_mode(RGB_MATRIX_RAINBOW_MOVING_CHEVRON); #endif - - input_mode = 2; -} - -#else -void matrix_init_keymap(void) { - input_mode = 2; +#endif } #endif //RGB_MATRIX_INIT diff --git a/layouts/community/ergodox/drashna/rules.mk b/layouts/community/ergodox/drashna/rules.mk index 8bf53950e4..31488108b9 100644 --- a/layouts/community/ergodox/drashna/rules.mk +++ b/layouts/community/ergodox/drashna/rules.mk @@ -1,6 +1,6 @@ TAP_DANCE_ENABLE = yes SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend -COMMAND_ENABLE = yes # Commands for debug and configuration +COMMAND_ENABLE = no # Commands for debug and configuration ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) RGBLIGHT_ENABLE = yes RGB_MATRIX_ENABLE = no diff --git a/layouts/community/ergodox/drashna_glow/rules.mk b/layouts/community/ergodox/drashna_glow/rules.mk index 3b317224a6..c8941391ea 100644 --- a/layouts/community/ergodox/drashna_glow/rules.mk +++ b/layouts/community/ergodox/drashna_glow/rules.mk @@ -7,3 +7,5 @@ ifneq (,$(findstring ergodox_ez,$(KEYBOARD))) RGBLIGHT_ENABLE = no RGB_MATRIX_ENABLE = yes endif + +COMMAND_ENABLE = no diff --git a/layouts/community/ortho_4x12/drashna/config.h b/layouts/community/ortho_4x12/drashna/config.h index 8658802d83..0b0110dfa9 100644 --- a/layouts/community/ortho_4x12/drashna/config.h +++ b/layouts/community/ortho_4x12/drashna/config.h @@ -1,5 +1,4 @@ -#ifndef CONFIG_USER_H -#define CONFIG_USER_H +#pragma once #if defined(RGBLIGHT_ENABLE) && !defined(RGBLED_NUM) @@ -61,5 +60,3 @@ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ //#define MIDI_TONE_KEYCODE_OCTAVES 2 - -#endif diff --git a/layouts/community/ortho_4x12/drashna/keymap.c b/layouts/community/ortho_4x12/drashna/keymap.c index 205d12d8c3..5d32189342 100644 --- a/layouts/community/ortho_4x12/drashna/keymap.c +++ b/layouts/community/ortho_4x12/drashna/keymap.c @@ -94,7 +94,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_NUKE ) @@ -219,4 +219,15 @@ void rgb_matrix_indicators_user(void) { void matrix_init_keymap(void) { rgblight_mode(RGB_MATRIX_MULTISPLASH); } +#else //RGB_MATRIX_INIT + +void matrix_init_keymap(void) { + #ifndef CONVERT_TO_PROTON_C + setPinOutput(D5); + writePinHigh(D5); + + setPinOutput(B0); + writePinHigh(B0); + #endif +} #endif //RGB_MATRIX_INIT diff --git a/layouts/community/ortho_5x12/drashna/config.h b/layouts/community/ortho_5x12/drashna/config.h new file mode 100644 index 0000000000..e41dadc601 --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/config.h @@ -0,0 +1,16 @@ +#pragma once + + +/* ws2812 RGB LED */ +#if defined(KEYBOARD_fractal) + #define RGB_DI_PIN D2 + #undef RGBLED_NUM + #define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 29 // Number of LEDs + #undef RGBLIGHT_HUE_STEP + #define RGBLIGHT_HUE_STEP 8 + #undef RGBLIGHT_SAT_STEP + #define RGBLIGHT_SAT_STEP 8 + #undef RGBLIGHT_VAL_STEP + #define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/layouts/community/ortho_5x12/drashna/keymap.c b/layouts/community/ortho_5x12/drashna/keymap.c new file mode 100644 index 0000000000..bf0907a513 --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/keymap.c @@ -0,0 +1,156 @@ +/* Copyright 2015-2017 Jack Humbert + * Modified by KeyPCB for the Fractal keyboard + * Backlight isn't on the Fractal, so I've removed the keycode from the keymaps + * + * 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 . + */ + +#include QMK_KEYBOARD_H +#include "drashna.h" + +#define LAYOUT_ortho_5x12_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A \ + ) \ + LAYOUT_ortho_5x12_wrapper( \ + KC_GRV, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_BSPC, \ + KC_TAB, K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, KC_BSPC, \ + KC_ESC, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, KC_QUOT, \ + KC_MLSF, CTL_T(K31), K32, K33, K34, K35, K36, K37, K38, K39, CTL_T(K3A), KC_ENT, \ + KC_NO, OS_LCTL, OS_LALT, OS_LGUI, SP_LWER, BK_LWER, DL_RAIS, ET_RAIS, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + ) +#define LAYOUT_ortho_5x12_base_wrapper(...) LAYOUT_ortho_5x12_base(__VA_ARGS__) + + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + +[_QWERTY] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ +), + +[_COLEMAK] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ +), + +[_DVORAK] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________DVORAK_L1_________________, _________________DVORAK_R1_________________, + _________________DVORAK_L2_________________, _________________DVORAK_R2_________________, + _________________DVORAK_L3_________________, _________________DVORAK_R3_________________ +), + +[_WORKMAN] = LAYOUT_ortho_5x12_base_wrapper( + ________________NUMBER_LEFT________________, ________________NUMBER_RIGHT_______________, + _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, + _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, + _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ +), + +[_MODS] = LAYOUT_ortho_5x12_wrapper( + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_LSFT, ___________________BLANK___________________, ___________________BLANK___________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +), + +/* Lower + * ,-----------------------------------------------------------------------------------. + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_LOWER] = LAYOUT_ortho_5x12_wrapper( \ + _______, ___________________BLANK___________________, ___________________BLANK___________________, _______, + KC_TILD, _________________LOWER_L1__________________, _________________LOWER_R1__________________, KC_PIPE, + KC_DEL, _________________LOWER_L2__________________, _________________LOWER_R2__________________, _______, + _______, _________________LOWER_L3__________________, _________________LOWER_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY +), + +/* Raise + * ,-----------------------------------------------------------------------------------. + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | Next | Vol- | Vol+ | Play | + * `-----------------------------------------------------------------------------------' + */ +[_RAISE] = LAYOUT_ortho_5x12_wrapper( \ + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ + KC_GRV, _________________RAISE_L1__________________, _________________RAISE_R1__________________, _______, + KC_DEL, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_BSLS, + _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, + _______, _______, _______, _______, _______, _______, _______, _________________RAISE_R3__________________ +), + +/* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | Reset| | | | | | | | | | Del | + * |------+------+------+------+------+-------------+------+------+------+------+------| + * | | | |Aud on|AudOff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | | + * |------+------+------+------+------+------|------+------+------+------+------+------| + * | |Voice-|Voice+|Mus on|MusOff|MidiOn|MidOff| | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ +[_ADJUST] = LAYOUT_ortho_5x12_wrapper( \ + KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, + VRSN, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, EEP_RST, + _______, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, _______, + _______, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, TG_MODS, + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ +) + + +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + } + return true; +}; + +void matrix_init_keymap(void) { +#ifdef KEYBOARD_fractal + setPinOutput(D5); + writePinHigh(D5); + + setPinOutput(B0); + writePinHigh(B0); +#endif +} diff --git a/layouts/community/ortho_5x12/drashna/rules.mk b/layouts/community/ortho_5x12/drashna/rules.mk new file mode 100644 index 0000000000..160419fcce --- /dev/null +++ b/layouts/community/ortho_5x12/drashna/rules.mk @@ -0,0 +1,23 @@ +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +TAP_DANCE_ENABLE = no +AUDIO_ENABLE = yes +ifneq (,$(findstring fractal,$(KEYBOARD))) # Make sure it IS the Planck Light + RGB_MATRIX_ENABLE = no + AUDIO_ENABLE = no + RGBLIGHT_ENABLE = yes + RGBLIGHT_TWINKLE = yes + BOOTLOADER = qmk-dfu +endif + +ifeq ($(strip $(PROTOCOL)), VUSB) +NKRO_ENABLE = no +else +NKRO_ENABLE = yes +endif + + +MACROS_ENABLED = no diff --git a/users/drashna/.gitlab-ci.yml b/users/drashna/.gitlab-ci.yml index bd693babc3..9b18d44fb3 100644 --- a/users/drashna/.gitlab-ci.yml +++ b/users/drashna/.gitlab-ci.yml @@ -1,26 +1,78 @@ stages: + - test - build + - deploy -qmk_firmware: +Tests: + stage: test + variables: + GIT_SUBMODULE_STRATEGY: recursive + tags: + - linux + image: ubuntu:18.10 + before_script: + - apt-get update -qy + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - avr-gcc --version + - uname -a + script: + - make test:all + - make planck/rev6:default + +QMK Firmware Defaults: + stage: deploy + variables: + GIT_SUBMODULE_STRATEGY: recursive + tags: + - linux + image: ubuntu:18.10 + before_script: + - apt-get update -qy + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - avr-gcc --version + - uname -a + script: + - make test:all + - make all:default -j16 + +Drashna Firmware: stage: build variables: GIT_SUBMODULE_STRATEGY: recursive tags: - linux - image: ubuntu + image: ubuntu:18.10 + before_script: + - apt-get update -qy + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - avr-gcc --version + script: + - make iris/rev2:drashna iris/rev2:drashna_old ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna orthodox/rev1:drashna orthodox/rev3:drashna crkbd:drashna planck/light:drashna planck/rev6:drashna fractal:drashna + artifacts: + name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" + paths: + - ./*.hex + - ./*.bin + expire_in: 1 month + +Firmware Deploy: + stage: deploy + dependencies: + - Drashna Firmware + variables: + GIT_SUBMODULE_STRATEGY: recursive + tags: + - linux + image: ubuntu:18.10 before_script: - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util diffutils gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip + - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi gcc-avr git libnewlib-arm-none-eabi unzip wget zip - avr-gcc --version script: - - make iris/rev2:drashna:production iris/rev2:drashna_old:production ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna:production orthodox/rev1:drashna:production orthodox/rev3:drashna:production crkbd:drashna:production planck/light:drashna:production + - make iris/rev2:drashna:production iris/rev2:drashna_old:production ergodox_ez:drashna ergodox_ez:drashna_glow viterbi/rev1:drashna:production orthodox/rev1:drashna:production orthodox/rev3:drashna:production crkbd:drashna:production planck/light:drashna planck/rev6:drashna fractal:drashna:production artifacts: name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" paths: - ./*.hex - ./*.bin - only: - - master - - drashna_keymaps - - merge-requests - - branches + expire_in: 1 month diff --git a/users/drashna/config.h b/users/drashna/config.h index a338512300..827b1b8ace 100644 --- a/users/drashna/config.h +++ b/users/drashna/config.h @@ -14,8 +14,12 @@ #define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f // #ifdef RGBLIGHT_ENABLE // #define NO_MUSIC_MODE -// #endif //RGBLIGHT_ENABLE -#endif +// #endif //RGBLIGHT_ENABLE/ +#ifndef __arm__ +#undef NOTE_REST +#define NOTE_REST 1.00f +#endif // !__arm__ +#endif // !AUDIO_ENABLE #ifdef RGBLIGHT_ENABLE #define RGBLIGHT_SLEEP diff --git a/users/drashna/process_records.c b/users/drashna/process_records.c index 5e311e60e8..17d7dc01c5 100644 --- a/users/drashna/process_records.c +++ b/users/drashna/process_records.c @@ -51,27 +51,30 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader if (!record->event.pressed) { - uint8_t temp_mod = get_mods(); - uint8_t temp_osm = get_oneshot_mods(); - clear_mods(); clear_oneshot_mods(); - send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); - if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { - #if defined(__ARM__) - send_string_with_delay_P(PSTR(":dfu-util"), 10); - #elif defined(BOOTLOADER_DFU) - send_string_with_delay_P(PSTR(":dfu"), 10); - #elif defined(BOOTLOADER_HALFKAY) - send_string_with_delay_P(PSTR(":teensy"), 10); - #elif defined(BOOTLOADER_CATERINA) - send_string_with_delay_P(PSTR(":avrdude"), 10); - #endif // bootloader options - } + #if !defined(KEYBOARD_viterbi) + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); clear_oneshot_mods(); + #endif + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), MACRO_TIMER); #if defined(KEYBOARD_viterbi) - send_string_with_delay_P(PSTR(":dfu"), 10); + send_string_with_delay_P(PSTR(":dfu" SS_TAP(X_ENTER)), MACRO_TIMER); + #else + if (temp_mod & MODS_SHIFT_MASK || temp_osm & MODS_SHIFT_MASK) { + #if defined(__arm__) + send_string_with_delay_P(PSTR(":dfu-util"), MACRO_TIMER); + #elif defined(BOOTLOADER_DFU) + send_string_with_delay_P(PSTR(":dfu"), MACRO_TIMER); + #elif defined(BOOTLOADER_HALFKAY) + send_string_with_delay_P(PSTR(":teensy"), MACRO_TIMER); + #elif defined(BOOTLOADER_CATERINA) + send_string_with_delay_P(PSTR(":avrdude"), MACRO_TIMER); + #endif // bootloader options + } + if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), MACRO_TIMER); } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), MACRO_TIMER); + set_mods(temp_mod); #endif - if (temp_mod & MODS_CTRL_MASK || temp_osm & MODS_CTRL_MASK) { send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); } - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); - set_mods(temp_mod); } break; diff --git a/users/drashna/rgb_stuff.c b/users/drashna/rgb_stuff.c index d238c20651..7d00604b4e 100644 --- a/users/drashna/rgb_stuff.c +++ b/users/drashna/rgb_stuff.c @@ -200,7 +200,10 @@ void start_rgb_light(void) { bool process_record_user_rgb(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { + if ((keycode >= QK_MOD_TAP && keycode <= QK_MOD_TAP_MAX) || (keycode >= QK_LAYER_TAP && keycode <= QK_LAYER_TAP_MAX)) { + keycode = keycode & 0xFF; + } + switch (keycode) { #ifdef RGBLIGHT_TWINKLE case KC_A ... KC_SLASH: case KC_F1 ... KC_F12: diff --git a/users/drashna/rules.mk b/users/drashna/rules.mk index 5f243b0076..6d8612e71a 100644 --- a/users/drashna/rules.mk +++ b/users/drashna/rules.mk @@ -42,16 +42,3 @@ ifdef CONSOLE_ENABLE OPT_DEFS += -DKEYLOGGER_ENABLE endif endif - - -ifeq ($(strip $(UCIS_ENABLE)), yes) - SRC += send_unicode.c -endif - -ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) - SRC += send_unicode.c -endif - -ifeq ($(strip $(UNICODE_ENABLE)), yes) - SRC += send_unicode.c -endif diff --git a/users/drashna/send_unicode.c b/users/drashna/send_unicode.c deleted file mode 100644 index ff35368da7..0000000000 --- a/users/drashna/send_unicode.c +++ /dev/null @@ -1,112 +0,0 @@ -// Written by konstantin: vomindoraan -#include "send_unicode.h" -#include -#include - -__attribute__((weak)) -void send_unicode_hex_string(const char* str) { - if (!str) { return; } // Safety net - - while (*str) { - // Find the next code point (token) in the string - for (; *str == ' '; str++); - size_t n = strcspn(str, " "); // Length of the current token - char code_point[n+1]; - strncpy(code_point, str, n); - code_point[n] = '\0'; // Make sure it's null-terminated - - // Normalize the code point: make all hex digits lowercase - for (char *p = code_point; *p; p++) { - *p = tolower((unsigned char)*p); - } - - // Send the code point as a Unicode input string - unicode_input_start(); - send_string(code_point); - unicode_input_finish(); - - str += n; // Move to the first ' ' (or '\0') after the current token - } -} - -// (ノಠ痊ಠ)ノ彡┻━┻ -// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); - -//Old code -// (╯°□°)╯ ︵ ┻━┻ - #if 0 - register_code(KC_RSFT); - tap(KC_9); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - process_unicode((0x25A1 | QK_UNICODE), record); // Mouth - process_unicode((0x00B0 | QK_UNICODE), record); // Eye - register_code(KC_RSFT); - tap(KC_0); - unregister_code(KC_RSFT); - process_unicode((0x256F | QK_UNICODE), record); // Arm - tap(KC_SPC); - process_unicode((0x0361 | QK_UNICODE), record); // Flippy - tap(KC_SPC); - process_unicode((0x253B | QK_UNICODE), record); // Table - process_unicode((0x2501 | QK_UNICODE), record); // Table - process_unicode((0x253B | QK_UNICODE), record); // Table - #endif - - -// If you need a good converter: https://r12a.github.io/app-conversion/ -uint8_t saved_mods; - -void unicode_input_start (void) { - // save current mods - saved_mods = get_mods(); // Save current mods - clear_mods(); // Unregister mods to start from a clean state - - switch(get_unicode_input_mode()) { - case UC_OSX: - register_code(KC_LALT); - break; - case UC_OSX_RALT: - register_code(KC_RALT); - break; - case UC_LNX: - register_code(KC_LCTL); - register_code(KC_LSFT); - register_code(KC_U); - unregister_code(KC_U); - unregister_code(KC_LSFT); - unregister_code(KC_LCTL); - break; - case UC_WIN: - register_code(KC_LALT); - register_code(KC_PPLS); - unregister_code(KC_PPLS); - break; - case UC_WINC: - register_code(KC_RALT); - unregister_code(KC_RALT); - register_code(KC_U); - unregister_code(KC_U); - break; - } - wait_ms(UNICODE_TYPE_DELAY); -} - -void unicode_input_finish (void) { - switch(get_unicode_input_mode()) { - case UC_OSX: - case UC_WIN: - unregister_code(KC_LALT); - break; - case UC_OSX_RALT: - unregister_code(KC_RALT); - break; - case UC_LNX: - register_code(KC_SPC); - unregister_code(KC_SPC); - break; - } - - set_mods(saved_mods); // Reregister previously set mods -} diff --git a/users/drashna/wrappers.h b/users/drashna/wrappers.h index b45359f676..070a5a0a4a 100644 --- a/users/drashna/wrappers.h +++ b/users/drashna/wrappers.h @@ -14,6 +14,7 @@ expanded before being used as arguments to the LAYOUT_xxx macro. #define KEYMAP_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_wrapper(...) LAYOUT(__VA_ARGS__) #define LAYOUT_ortho_4x12_wrapper(...) LAYOUT_ortho_4x12(__VA_ARGS__) +#define LAYOUT_ortho_5x12_wrapper(...) LAYOUT_ortho_5x12(__VA_ARGS__) /* Blocks for each of the four major keyboard layouts -- cgit v1.2.3 From 134a69f4ada6b50d98cb233c30cce05ddc39c1cd Mon Sep 17 00:00:00 2001 From: Frank Tackitt Date: Mon, 31 Dec 2018 15:55:48 -0700 Subject: Keyboard: Enable defaults for Sol (#4751) The enables RGB, Mousekeys, and Extrakeys for users of config.qmk.fm --- keyboards/sol/rules.mk | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/keyboards/sol/rules.mk b/keyboards/sol/rules.mk index f53e5b21fc..aa18721b6c 100644 --- a/keyboards/sol/rules.mk +++ b/keyboards/sol/rules.mk @@ -52,19 +52,14 @@ OPT_DEFS += -DINTERRUPT_CONTROL_ENDPOINT # the appropriate keymap folder that will get included automatically # BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = no # Audio control and System control(+450) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) CONSOLE_ENABLE = no # Console for debug(+400) -COMMAND_ENABLE = no # Commands for debug and configuration +COMMAND_ENABLE = yes # Commands for debug and configuration NKRO_ENABLE = no # 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 controls -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. -# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. Do not enable this with audio at the same time. CUSTOM_MATRIX = yes -- cgit v1.2.3 From c71c078dff74ea3047410c855f6e42bad7281f8c Mon Sep 17 00:00:00 2001 From: lbibass Date: Wed, 2 Jan 2019 11:42:03 -0500 Subject: Added brightness controls and Media controls to my keymap. (#4760) * Added my Mechmini2 layout to qmk. * Added more info to the readme. * Made changes. * Update keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c Co-Authored-By: lbibass * Update keyboards/mechmini/v2/keymaps/lbibass_split_space/keymap.c Co-Authored-By: lbibass * Added brightness and volume controls to MechMini 625 layout. --- .../mechmini/v2/keymaps/lbibass_625_space/keymap.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c index 40bfc42de0..fba582e1b7 100755 --- a/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c +++ b/keyboards/mechmini/v2/keymaps/lbibass_625_space/keymap.c @@ -4,6 +4,7 @@ #define _FN1 2 #define _FN2 3 #define _WIN 1 +#define _FN3 4 //Tap Dance Declarations enum { @@ -22,10 +23,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, GUI_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), - KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_RGUI, RGB_TOG), + KC_ESC, KC_LALT, KC_LCTL, KC_SPC, KC_RGUI, MO(4)), [_WIN] = LAYOUT_625_space( LT(OSL(2), KC_TAB), KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(3, KC_ENT), + CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(4, KC_ENT), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, TD(TD_DOTCOM), OSL(2), OSM(MOD_RSFT), KC_ESC, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, RGB_TOG), [_FN1] = LAYOUT_625_space( @@ -35,14 +36,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), [_FN2] = LAYOUT_625_space( + KC_PWR, KC_BRID, KC_BRIU, KC_NO, KC_NO, KC_NO, KC_NO, KC_MRWD, KC_MPLY, KC_MFFD, KC_MUTE, RESET, + MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_TRNS, + KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + [_FN3] = LAYOUT_625_space( KC_PWR, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, RESET, MT(KC_LGUI, KC_ESC), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, TG(1), KC_TRNS, KC_TRNS, KC_F11, KC_F12, KC_TRNS, KC_TRNS, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, KC_TRNS, KC_TRNS, - KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + KC_CAPS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS) }; - - - - - -- cgit v1.2.3 From 7b5fa4b13e332bab476b65565d63708b306d000a Mon Sep 17 00:00:00 2001 From: Frank Tackitt Date: Wed, 2 Jan 2019 10:16:55 -0700 Subject: Keymap: Add userspace for @kageurufu (#4752) * Add userspace for @kageurufu * Remove custom keycodes for layer keys Add some common defaults for my rules.mk --- keyboards/sol/keymaps/kageurufu/config.h | 25 --- keyboards/sol/keymaps/kageurufu/keymap.c | 346 ++++-------------------------- keyboards/sol/keymaps/kageurufu/readme.md | 47 ---- keyboards/zen/keymaps/kageurufu/keymap.c | 62 ++++++ users/kageurufu/config.h | 4 + users/kageurufu/custom_rgb.c | 18 ++ users/kageurufu/custom_rgb.h | 3 + users/kageurufu/kageurufu.c | 12 ++ users/kageurufu/kageurufu.h | 5 + users/kageurufu/layouts.h | 58 +++++ users/kageurufu/process_records.c | 44 ++++ users/kageurufu/process_records.h | 27 +++ users/kageurufu/readme.md | 14 ++ users/kageurufu/rules.mk | 15 ++ 14 files changed, 307 insertions(+), 373 deletions(-) delete mode 100644 keyboards/sol/keymaps/kageurufu/config.h delete mode 100644 keyboards/sol/keymaps/kageurufu/readme.md create mode 100644 keyboards/zen/keymaps/kageurufu/keymap.c create mode 100644 users/kageurufu/config.h create mode 100644 users/kageurufu/custom_rgb.c create mode 100644 users/kageurufu/custom_rgb.h create mode 100644 users/kageurufu/kageurufu.c create mode 100644 users/kageurufu/kageurufu.h create mode 100644 users/kageurufu/layouts.h create mode 100644 users/kageurufu/process_records.c create mode 100644 users/kageurufu/process_records.h create mode 100644 users/kageurufu/readme.md create mode 100644 users/kageurufu/rules.mk diff --git a/keyboards/sol/keymaps/kageurufu/config.h b/keyboards/sol/keymaps/kageurufu/config.h deleted file mode 100644 index 452cdda823..0000000000 --- a/keyboards/sol/keymaps/kageurufu/config.h +++ /dev/null @@ -1,25 +0,0 @@ -/* -This is the c configuration file for the keymap - -Copyright 2012 Jun Wako -Copyright 2015 Jack Humbert - -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 - - -// place overrides here - diff --git a/keyboards/sol/keymaps/kageurufu/keymap.c b/keyboards/sol/keymaps/kageurufu/keymap.c index 822256d85f..9ea89db058 100644 --- a/keyboards/sol/keymaps/kageurufu/keymap.c +++ b/keyboards/sol/keymaps/kageurufu/keymap.c @@ -1,69 +1,35 @@ #include QMK_KEYBOARD_H +#include "kageurufu.h" #ifdef PROTOCOL_LUFA #include "lufa.h" #include "split_util.h" #endif -#ifdef SSD1306OLED - #include "common/ssd1306.h" -#endif extern keymap_config_t keymap_config; - -#ifdef RGBLIGHT_ENABLE -//Following line allows macro to read current RGB settings -extern rgblight_config_t rgblight_config; -#endif - extern uint8_t is_master; -// 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. -enum layer_number { - _QWERTY = 0, - _COLEMAK, - _FN, - _ADJ -}; - -enum custom_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - FN, - ADJ, - BACKLIT, - RGBRST -}; - -enum macro_keycodes { - KC_SAMPLEMACRO, -}; - -#define FN_ESC LT(_FN, KC_ESC) - -// Define your non-alpha grouping in this define's LAYOUT, and all your BASE_LAYERS will share the same mod/macro columns - /* Base Layout - * ,------------------------------------------------. ,------------------------------------------------. - * | ` | | | | | | | | | | | | | | BkSp | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | Tab | | | | | | | | | | | | | | \ | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | Esc | | | | | | | | | | | | | | ' | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Sft( | | | | | | | | | | | | | | Sft) | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Ctrl | Win | Win | Alt | FN | Space| RGB | | FN | FN | - | = | Down | PgUp | PgDn | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Space| Bksp | | Enter| Space| - * `-------------' `--------=----' - */ -#define BASE_LAYOUT( \ +/* Base Layout + * ,------------------------------------------------. ,------------------------------------------------. + * | ` | | | | | | | | | | | | | | BkSp | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Tab | | | | | | | | | | | | | | \ | + * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| + * | Esc | | | | | | | | | | | | | | ' | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Sft( | | | | | | | | | | | | | | Sft) | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Ctrl | Win | Win | Alt | FN | Space| RGB | | FN | FN | - | = | Down | PgUp | PgDn | + * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| + * | Space| Bksp | | Enter| Space| + * `-------------' `--------=----' + */ +#define EXPAND_LAYOUT(...) LAYOUT(__VA_ARGS__) +#define _BASE_LAYOUT( \ _00, _01, _02, _03, _04, _05, _06, _07, _08, _09, \ _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, \ _20, _21, _22, _23, _24, _25, _26, _27, _28, _29 \ ) \ -LAYOUT( \ +EXPAND_LAYOUT( \ KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, RGB_MOD, KC_EQL, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \ KC_TAB, _00, _01, _02, _03, _04, KC_LBRC, KC_RBRC, _05, _06, _07, _08, _09, KC_BSLS, \ FN_ESC, _10, _11, _12, _13, _14, RGB_SAI, RGB_VAI, _15, _16, _17, _18, _19, KC_QUOT, \ @@ -71,265 +37,43 @@ LAYOUT( \ KC_LCTL, KC_LGUI, KC_LGUI, KC_LALT, FN, KC_SPC, FN, FN, KC_SPC, KC_MINS, KC_EQL, KC_DOWN, KC_PGUP, KC_PGDN, \ KC_VOLD, KC_VOLU, KC_SPC, KC_BSPC, KC_ENT, KC_SPC, KC_VOLD, KC_VOLU \ ) +#define BASE_LAYOUT(...) _BASE_LAYOUT(__VA_ARGS__) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Qwerty - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | | Q | W | E | R | T | | | | Y | U | I | O | P | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | | A | S | D | F | G | | | | H | J | K | L | ; | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | Z | X | C | V | B | | | | N | M | , | . | / | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | - * `-------------' `--------=----' - */ + [_QWERTY] = BASE_LAYOUT( \ - KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, \ - KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, \ - KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH \ + _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, \ + _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, \ + _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ \ ), - /* Colemak - * ,------------------------------------------------. ,------------------------------------------------. - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | | Q | W | F | P | B | | | | J | L | U | Y | ; | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | | A | R | S | T | G | | | | K | N | E | I | O | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | Z | X | C | D | V | [ | | ] | M | H | , | . | / | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | | | | | | | | | | | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | | | | | | - * `-------------' `--------=----' - */ [_COLEMAK] = BASE_LAYOUT( \ - KC_Q, KC_W, KC_F, KC_P, KC_B, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, \ - KC_A, KC_R, KC_S, KC_T, KC_G, KC_K, KC_N, KC_E, KC_I, KC_O, \ - KC_Z, KC_X, KC_C, KC_D, KC_V, KC_M, KC_H, KC_COMM, KC_DOT, KC_SLSH + _________________COLEMAK_L1________________, _________________COLEMAK_R1________________, \ + _________________COLEMAK_L2________________, _________________COLEMAK_R2________________, \ + _________________COLEMAK_L3________________, _________________COLEMAK_R3________________ \ ), + [_COLEMAK_DH] = BASE_LAYOUT( \ + ______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, \ + ______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, \ + ______________COLEMAK_MOD_DH_L3____________, ______________COLEMAK_MOD_DH_R3____________ \ + ), - /* FN - * ,------------------------------------------------. ,------------------------------------------------. - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | Ctrl | A | O | E | U | I | | | | D | H | T | N | S | / | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | [ | | ] | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | ADJ | Esc | Alt | GUI | EISU |Lower |Space | |Space |FN | KANA | Left | Down | Up |Right | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * |Lower |Space | |Space |FN | - * `-------------' `------------' - */ - [_FN] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, KC_PSCR, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, KC_PGDN, KC_UP, KC_PGUP, _______, KC_LBRC, _______, _______, KC_RBRC, KC_7, KC_UP, KC_9, KC_0, KC_HOME, \ - ADJ, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_RBRC, KC_END, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_PGDN, KC_PGUP, _______, \ - _______, _______, _______, _______, ADJ, _______, ADJ, ADJ, ADJ, KC_MPLY, KC_MNXT, KC_MUTE, KC_VOLD, KC_VOLU, \ - KC_VOLD, KC_VOLU, _______, KC_DEL, _______, _______, KC_VOLD, KC_VOLU \ + [_FN] = EXPAND_LAYOUT( \ + ________________FUNCTION_L1________________, _______, KC_PSCR, ________________FUNCTION_R1________________, \ + ________________FUNCTION_L2________________, _______, _______, ________________FUNCTION_R2________________, \ + ________________FUNCTION_L3________________, _______, _______, ________________FUNCTION_R3________________, \ + ________________FUNCTION_L4________________, _______, _______, ________________FUNCTION_R4________________, \ + ________________FUNCTION_L5________________, ADJ, ADJ, ________________FUNCTION_R5________________, \ + KC_VOLD, KC_VOLU, _______, KC_DEL, _______, _______, KC_VOLD, KC_VOLU \ ), - /* ADJ - * ,------------------------------------------------. ,------------------------------------------------. - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | ~ | ! | @ | # | $ | % | | | | ^ | & | * | ( | ) | | - * |------+------+------+------+------+------|------| |------|------+------+------+------+------+------| - * | Ctrl | A | O | E | U | I | | | | D | H | T | N | S | / | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * | Shift| ; | Q | J | K | X | [ | | ] | B | M | W | V | Z |Enter | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * |ADJ| Esc | Alt | GUI | EISU |Lower |Space | |Space |FN | KANA | Left | Down | Up |Right | - * |------+------+------+------+------+------+------| |------+------+------+------+------+------+------| - * |Lower |Space | |Space |FN | - * `-------------' `------------' - */ - - [_ADJ] = LAYOUT( \ - KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, _______, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, \ - _______, RGB_SAD, RGB_VAI, RGB_SAI, RESET, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \ - _______, RGB_HUD, RGB_VAD, RGB_HUI, RGBRST, _______, _______, _______, _______, QWERTY, COLEMAK, _______, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, RGB_HUI, RGB_SAI, RGB_VAI, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_RMOD,RGB_HUD, RGB_SAD, RGB_VAD, \ + [_ADJ] = EXPAND_LAYOUT( \ + _________________ADJUST_L1_________________, _______, _______, _________________ADJUST_R1_________________, \ + _________________ADJUST_L2_________________, _______, _______, _________________ADJUST_R2_________________, \ + _________________ADJUST_L3_________________, _______, _______, _________________ADJUST_R3_________________, \ + _________________ADJUST_L4_________________, _______, _______, _________________ADJUST_R4_________________, \ + _________________ADJUST_L5_________________, _______, _______, _________________ADJUST_R5_________________, \ KC_VOLD, KC_VOLU, _______, _______, _______, _______, KC_VOLD, KC_VOLU \ ) }; - - -// define variables for reactive RGB -bool TOG_STATUS = false; -int RGB_current_mode; - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - //uint8_t shifted = get_mods() & (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)); - - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - set_single_persistent_default_layer(_QWERTY); - } - return false; - break; - case COLEMAK: - if(record->event.pressed) { - set_single_persistent_default_layer(_COLEMAK); - } - return false; - break; - case FN: - if (record->event.pressed) { - layer_on(_FN); - } else { - layer_off(_FN); - } - return false; - break; - case ADJ: - if (record->event.pressed) { - layer_on(_ADJ); - } else { - layer_off(_ADJ); - } - return false; - break; - //led operations - RGB mode change now updates the RGB_current_mode to allow the right RGB mode to be set after reactive keys are released - case RGBRST: - #ifdef RGBLIGHT_ENABLE - if (record->event.pressed) { - eeconfig_update_rgblight_default(); - rgblight_enable(); - RGB_current_mode = rgblight_config.mode; - } - #endif - break; - } - return true; -} - -void matrix_init_user(void) { - #ifdef RGBLIGHT_ENABLE - RGB_current_mode = rgblight_config.mode; - #endif - //SSD1306 OLED init, make sure to add #define SSD1306OLED in config.h - #ifdef SSD1306OLED - iota_gfx_init(!has_usb()); // turns on the display - #endif -} - -void matrix_scan_user(void) { - #ifdef SSD1306OLED - led_test_init(); - iota_gfx_task(); // this is what updates the display continuously - #endif -} - - -//SSD1306 OLED update loop, make sure to add #define SSD1306OLED in config.h -#ifdef SSD1306OLED - -// hook point for 'led_test' keymap -// 'default' keymap's led_test_init() is empty function, do nothing -// 'led_test' keymap's led_test_init() force rgblight_mode_noeeprom(35); -__attribute__ ((weak)) -void led_test_init(void) {} - -void matrix_update(struct CharacterMatrix *dest, - const struct CharacterMatrix *source) { - if (memcmp(dest->display, source->display, sizeof(dest->display))) { - memcpy(dest->display, source->display, sizeof(dest->display)); - dest->dirty = true; - } -} - -//assign the right code to your layers for OLED display -#define L_BASE 0 -#define L_FN (1<<_FN) -#define L_ADJ (1<<_ADJ) -#define L_ADJ_TRI (L_ADJ|L_FN) - -static void render_logo(struct CharacterMatrix *matrix) { - - static char logo[]={ - 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87,0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f,0x90,0x91,0x92,0x93,0x94, - 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7,0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf,0xb0,0xb1,0xb2,0xb3,0xb4, - 0xc0,0xc1,0xc2,0xc3,0xc4,0xc5,0xc6,0xc7,0xc8,0xc9,0xca,0xcb,0xcc,0xcd,0xce,0xcf,0xd0,0xd1,0xd2,0xd3,0xd4, - 0}; - matrix_write(matrix, logo); - //matrix_write_P(&matrix, PSTR(" Split keyboard kit")); -} - - - -void render_status(struct CharacterMatrix *matrix) { - - // Render to mode icon - static char logo[][2][3]={{{0x95,0x96,0},{0xb5,0xb6,0}},{{0x97,0x98,0},{0xb7,0xb8,0}}}; - if(keymap_config.swap_lalt_lgui==false){ - matrix_write(matrix, logo[0][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[0][1]); - }else{ - matrix_write(matrix, logo[1][0]); - matrix_write_P(matrix, PSTR("\n")); - matrix_write(matrix, logo[1][1]); - } - - // Define layers here, Have not worked out how to have text displayed for each layer. Copy down the number you see and add a case for it below - char buf[40]; - snprintf(buf,sizeof(buf), "Undef-%ld", layer_state); - matrix_write_P(matrix, PSTR("\nLayer: ")); - switch (layer_state) { - case L_BASE: - matrix_write_P(matrix, PSTR("Default")); - break; - case L_FN: - matrix_write_P(matrix, PSTR("FN")); - break; - case L_ADJ: - case L_ADJ_TRI: - matrix_write_P(matrix, PSTR("ADJ")); - break; - default: - matrix_write(matrix, buf); - } - - // Host Keyboard LED Status - char led[40]; - snprintf(led, sizeof(led), "\n%s %s %s", - (host_keyboard_leds() & (1<event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case COLEMAK: + if(record->event.pressed) { + set_single_persistent_default_layer(_COLEMAK); + } + return false; + break; + case RGBRST: + #ifdef RGBLIGHT_ENABLE + if (record->event.pressed) { + eeconfig_update_rgblight_default(); + rgblight_enable(); + } + #endif + break; + } + + + return process_record_keymap(keycode, record) && +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + process_record_rgb(keycode, record) && +#endif // RGBLIGHT_ENABLE; + true; +} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + + +__attribute__ ((weak)) +bool process_record_rgb(uint16_t keycode, keyrecord_t *record) { + return true; +} diff --git a/users/kageurufu/process_records.h b/users/kageurufu/process_records.h new file mode 100644 index 0000000000..d1c50a4112 --- /dev/null +++ b/users/kageurufu/process_records.h @@ -0,0 +1,27 @@ +#pragma once +#include "kageurufu.h" + +#define FN_ESC LT(_FN, KC_ESC) +#define FN MO(_FN) +#define ADJ MO(_ADJ) + +enum layer_number { + _QWERTY = 0, + _COLEMAK, + _COLEMAK_DH, + _FN, + _ADJ, + ADDITIONAL_LAYER +}; + +enum custom_keycodes { + QWERTY = SAFE_RANGE, + COLEMAK, + CMAK_DH, + RGBRST, + KAGEURUFU_SAFE_RANGE +}; + + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); +bool process_record_rgb(uint16_t keycode, keyrecord_t *record); diff --git a/users/kageurufu/readme.md b/users/kageurufu/readme.md new file mode 100644 index 0000000000..57dd85d6be --- /dev/null +++ b/users/kageurufu/readme.md @@ -0,0 +1,14 @@ +Copyright 2018- Franklyn Tackitt franklyn@tackitt.net @kageurufu + +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 . diff --git a/users/kageurufu/rules.mk b/users/kageurufu/rules.mk new file mode 100644 index 0000000000..1bd16e2626 --- /dev/null +++ b/users/kageurufu/rules.mk @@ -0,0 +1,15 @@ +SRC += kageurufu.c \ + process_records.c \ + custom_rgb.c + +# Link time optimization, should save on firmware size +EXTRAFLAGS += -flto + + +# Some usual defaults +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +COMMAND_ENABLE = yes +CONSOLE_ENABLE = yes +RGBLIGHT_ENABLE = yes +RGBLIGHT_ANIMATIONS = yes -- cgit v1.2.3 From a7b1b146d12cce1858db59c1d99ce84fb37fc59e Mon Sep 17 00:00:00 2001 From: Jacob Jerrell Date: Wed, 2 Jan 2019 11:23:42 -0600 Subject: Keymap: Bocaj Layout and Userspace Refactor (#4753) * Bocaj Layout Revamp * Pull in Upstream (#1) * Various tweaks for some Input:Club build processes * change KEYMAP to LAYOUT for all new keyboards made using this script * Add support for rev3 of the Atom47 (#2672) * Added support for rev3 of the Atom47 * Updated Atom47 readme's * Fix redefine error on rev2 and add maartenwut's keymap * Fix redefine error on LEdiodes keymap * Add Nyquist keymap (#2692) * nyquist * danielhklein nyquist setup * shift left controls * remove readme * cleanup before pr * ready for pr * Adds Phantom TKL support (#2696) * Add an info.json to phantom keyboard * Add layouts - KEYMAP_WINKEYLESS - KEYMAP_7BIT - KEYMAP_ISO - KEYMAP_ISO_WINKEYLESS * Add key_counts * Add 2 missing F-Row keys * Add TKC1800 info.json Created an info.json for the tkc1800. * Clueboard 60 info.json - adds - LAYOUT_60_ansi - LAYOUT_60_iso - KEYMAP_AEK - KEYMAP - LAYOUT_60_ansi_split_bs_rshift * Add the Speedo keyboard * Fix KC60 info.json file (#2707) * change KEYMAP to LAYOUT in all the KC60 files * Redo the info.json file * Small fixes to TKC1800 - adjust F-row to use 0.25 spacing - split left shift - add key_count * Fix some Configurator Warnings regarding LAYOUT vs KEYMAP (#2708) * change diverge 3 KC_KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for handwired arrow pad * change M10A to LAYOUT for m10-a * Change KC_KEYMAP to LAYOUT_kc and KEYMAP to LAYOUT for mf68 * change KC_KEYMAP to LAYOUT for nano * Refactor to LAYOUT * refactor to LAYOUT-ansi and LAYOUT_iso for s65 * LAYOUT conversions for lfkkeyboards * missed a few renames * mini1800 for lfkeyobards support of LAYOUT * Improve state/chord handling and clean up namespace Some values that can never, ever, change were held in local variables, rather than in PROGMEM. Fixed. Change "pressed" to a signed int so the test for < 0 makes sense, and to avoid possible weird failure modes in the case where a key release comes in when pressed is already zero. (Shouldn't happen, sure, but computers are weird.) A lot of things in process_steno had external linkage for no particular reason. They've been marked static. Stuff still builds. Distinguish between currently-held keys and keys that have been held, and expose these values through a nicely-named API so other code could, say, check on the current set of steno chording in order to make displays. Also in passing fix up the "state" value having external linkage so it could clash with other people's variable declarations. The API also provides hooks for key processing and steno chord events, so you can monitor those events without having to run in matrix_scan_user and recheck the values directly. Also document these. There is no path through processing a key that doesn't end with a return false, so the nested return foo() are gone and we just return false. * Pull information from config.h and rules.mk (#2711) * Pull information from config.h and rules.mk * Readd the kbd75 maintainer * Remove obsolete info.json entries (#2712) * Clean up some long-standing errors when populating the API (#2715) * More Configurator Warning Fixes (#2716) * mf68_ble did not have the correct .c and .h files * Fix JC65 KEYMAP to LAYOUT * Change KEYMAP to LAYOUT for s60_x * Convert KEYMAP to LAYOUT for lets_split boards * Convert KEYMAP to LAYOUT * more fixes to keymap for iris * convert KEYMAP to LAYOUT for levinson keyboard * change losinggeneration's KEYMAP to LAYOUT * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for nyquist * convert KEYMAP to LAYOUT * convert KEYMAP to LAYOUT for viterbi * convert KEYMAP to LAYOUT * convert KEYMAP and its subsidiries to the LAYOUT standard * convert KEYMAP and its subsidiries to the new LAYOUT standard * Normacos keymap for let's split keyboard (#2691) * Cheers let's split keymap * fixed typo on norman layer of cheers keymap for let's split * fixed right handed mappings for home row * cheers keymap for let's split redefinition * updated Cheers keymap for let's split * cheers keymap for let's split updated with some terminal macros * renamed cheers let's split keymap to a more appropriate normacos * updated normacos keymap doc / removed non functional keys * reset let's split rules to default values * added more spotlight search macros * normalized keymap comments * Moved numpad on lower layer * hhkb jp personal keymap (#2698) * Add JJ40 Cockpit personal keymap (#2713) * Add JJ40 Cockpit keymap * Fix lower layer symbols * Add readme for "major" keyboards to eliminate more QMK Configurator errors (#2718) * add readme to ktype keyboard * add readme to m10a * add readme to mini1800 * add readme to parent directory * Revert "Pull in Upstream (#1)" This reverts commit eeba0cec17ccb636e4225eed88aeae72b99f5e45. * Updates to Bocaj Files - Gave up on Tap Dance for ' -> ' + Added another 'Secret' + Add ' -> ' to the Swap Hands key + Add Swap Hands to the ' -> ' key + Made Hand Swapping a momentary toggle - Removed Auto Shift + Added Layer Toggle to KC_QUOTE for the _TOOLS layer - Disabled Tap Dance * Merge remote-tracking branch 'upstream/master' * Updates to Bocaj Added Game Layers, Removed Unused Macros * Removed 'secrets.h' * Updates to Bocaj Remove 'secrets'. Remove 'sendstring_workman.h' and set related layer back to qwerty due to macro compatibility issues * Total revisioning of keymap and layout structure * Missed readme.md file * Bocaj - Permissive Hold setting enabled * Switching from ErgoDox EZ centric configuration to the layout/user approach * Bocaj - Create Userspace and Ergodox layout * Update settings.json * Pushing local updates * Reverting .vscode/settings.json * Adds pretty_osx and _win wrappers * Utilize Windows and Mac Wrappers * Update layouts/community/ergodox/bocaj/keymap.c * Updates to Bocaj keymap.c - Extended pretty_osx and pretty_win wrappers to allow modification of the bottom rows and thumb clusters. - Fixed already wrapped layouts to align with the change - Wrapped _NUMS and _CLICKY layers with the _osx wrapper because I main with a Mac * Updates to Bocaj Small documentation updates, added KC_MAKE from Drashna's layout, added KC_LOCK back to the diablo layer. * Add LShift to _Adjust layer * Minor changes to bocaj Put wrappers in userspace and added RESET keycode to the Adjust layer * Updates to Bocaj config & keymap; Fixed problem with process_leader.c - Made lots of changes to the bocaj layout and userspace - Pulled in latest upstream/master - Attempted to compile with latest and found an unneccessary `break` in process_leader.c * Bocaj - Updates to Layout and Userspace * Adjust LEADER_TIMEOUT to 350 * Put KC_GRAVE on _ADJUST layer * Eliminate _LOWER layer and associated definitions * Adjusted layer indicating LEDs to match changes * Fixed Diablo leader sequence * Added build info leader sequence * Got rid of obsoleted IGNORE_MOD_TAP_INTERRUPT/PERMISSIVE_HOLD/PREVENT_STUCK_MODIFIERS (may add STRICT_LAYER_RELEASE in the future) * Remove type_traits Not sure what in my VSCode config always brings this one in * refactor stage 1 * Bocaj Refactor Phase II * Made LED_2 brighter if both CTRL & GUI are being held * Enabled unicode because I got it to work in Mac OS * Finalized Build Info leader combination after testing in Mac OS * Not sure why KC_D3_1 was set to ASDF if !TAP_DANCE_ENABLE. So I changed that back * Experienced issues with `EXTRAFLAGS += -flto` using Docker in MacOS. Not sure what it does, but I don't seem to be missing anything * Wrote obligatory readme.md files and mentioned Drashna too many times... I don't think I can actually take credit for much of anything here. * Updates to Bocaj Made LED changes, added LM_DFLT which is similar to the grave macro, enabled retro tapping, working on a unicode idea -- currently fails to build. * Bocaj Refactor Phase 3 Part 2 - Continuation of implementing unicode switching based on default layer - Slight adjustments to _DIABLO and base wrapper because LM_DFLT macro didn't function as I'd hoped * Slight adjustment to KC_MAKE --- layouts/community/ergodox/bocaj/config.h | 4 +- layouts/community/ergodox/bocaj/keymap.c | 292 +++++++++++++----------------- layouts/community/ergodox/bocaj/readme.md | 37 ++++ layouts/community/ergodox/bocaj/rules.mk | 5 + users/bocaj/bocaj.c | 200 ++++++++++---------- users/bocaj/bocaj.h | 190 +++++++------------ users/bocaj/config.h | 5 +- users/bocaj/process_records.c | 149 +++++++++++++++ users/bocaj/process_records.h | 52 ++++++ users/bocaj/readme.md | 110 +++++++++-- users/bocaj/rules.mk | 30 ++- users/bocaj/send_unicode.c | 106 +++++++++++ users/bocaj/send_unicode.h | 71 ++++++++ users/bocaj/tap_dances.c | 1 - users/bocaj/tap_dances.h | 12 ++ users/bocaj/wrappers.h | 37 ++++ 16 files changed, 896 insertions(+), 405 deletions(-) create mode 100644 layouts/community/ergodox/bocaj/readme.md create mode 100644 users/bocaj/process_records.c create mode 100644 users/bocaj/process_records.h create mode 100644 users/bocaj/send_unicode.c create mode 100644 users/bocaj/send_unicode.h create mode 100644 users/bocaj/wrappers.h diff --git a/layouts/community/ergodox/bocaj/config.h b/layouts/community/ergodox/bocaj/config.h index 78350f6033..bc1d20a626 100644 --- a/layouts/community/ergodox/bocaj/config.h +++ b/layouts/community/ergodox/bocaj/config.h @@ -2,5 +2,5 @@ #include QMK_KEYBOARD_CONFIG_H -#undef PRODUCT -#define PRODUCT BocajEZ - Frankensteined ErgoDox EZ +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c index fbe0fca653..cb78e7aae7 100644 --- a/layouts/community/ergodox/bocaj/keymap.c +++ b/layouts/community/ergodox/bocaj/keymap.c @@ -1,5 +1,5 @@ /* -Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell +Copyright 2018 Jacob Jerrell @JacobJerrell 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 @@ -14,97 +14,99 @@ 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 . */ + #include QMK_KEYBOARD_H #include "bocaj.h" +#define LAYOUT_ergodox_pretty_base( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ + ) \ + LAYOUT_ergodox_pretty_wrapper( \ + KC_ESC, __________________NUMBER_LEFT_______________, JJ_ARRW, KC_MINS, __________________NUMBER_RIGHT______________, KC_EQUAL, \ + KC_DEL, K01, K02, K03, K04, K05, KC_LPRN, KC_RPRN, K06, K07, K08, K09, K0A, KC_BSLASH, \ + KC_NUMS, K11, SFT_T(K12), K13, ALT_T(K14), K15, K16, ALT_T(K17), K18, SFT_T(K19), K1A, KC_QUOT, \ + OS_LSFT, CTL_T(K21), K22, K23, K24, K25, HYP_LBK, MEH_RBK, K26, K27, K28, K29, CTL_T(K2A), KC_RSFT, \ + KC_GAME,KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, UC_DISA,KC_GAME, KC_ADJS, \ + KC_APP,KC_HOME, KC_END,KC_ESC, \ + UC_FLIP, UC_TABL, \ + KC_SPACE,KC_BSPACE,KC_LEAD, UC_SHRG,KC_TAB,KC_LWEN \ +) + +#define LAYOUT_ergodox_pretty_base_wrapper(...) LAYOUT_ergodox_pretty_base(__VA_ARGS__) + const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Hardware Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' + /* Workman - http://www.keyboard-layout-editor.com/#/gists/7a07cb982ec3597ba3e3d947554225f1 + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | D | R | W | B | ( | ! ) | J | F | U | P | ; | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | H | T | G |-------! !-------! Y | N | E | O | I | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | M | C | V | [ | ! ] | K | L | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | |GAME | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' */ - [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, - KC_DEL, _______________________HWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________HWORKMAN_R1_______________________, KC_BSLS, - KC_NUMS,_______________________HWORKMAN_L2_______________________, _______________________HWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________HWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________HWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ + [_WORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, + _________________WORKMAN_L2_________________, _________________WORKMAN_R2_________________, + _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ ), -/* Software Workman / QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f - .---------------------------------------------. .---------------------------------------------. - | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' -*/ - [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC, _______________________NUMBER_LEFT_______________________, JJ_ARRW, KC_MINUS,_______________________NUMBER_RIGHT______________________, KC_EQUAL, - KC_DEL, _______________________SWORKMAN_L1_______________________, KC_LPRN, KC_RPRN, _______________________SWORKMAN_R1_______________________, KC_BSLS, - KC_NUMS,_______________________SWORKMAN_L2_______________________, _______________________SWORKMAN_R2_______________________, KC_QUOTE, - KC_LSFT,_______________________SWORKMAN_L3_______________________, HYP_LBK, MEH_RBK, _______________________SWORKMAN_R3_______________________, KC_RSFT, - ___________________ERGODOX_BOTTOM_LEFT___________________, ___________________ERGODOX_BOTTOM_RIGHT__________________, - ______________________ERGODOX_THUMBS_____________________ + [_WINWORKMAN] = LAYOUT_ergodox_pretty_base_wrapper( + _________________WORKMAN_L1_________________, _________________WORKMAN_R1_________________, + ________________WWORKMAN_L2_________________, ________________WWORKMAN_R2_________________, + _________________WORKMAN_L3_________________, _________________WORKMAN_R3_________________ ), -/* Lower - http://www.keyboard-layout-editor.com/#/gists/f1d745a88d1c48ab55e095efd9e7a43a - .---------------------------------------------. .---------------------------------------------. - | ESC | | | | | | -> | ! - | | | | | | = | - !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! - | DEL | ! | @ | # | $ | % | ( | ! ) | ^ | & | * | ( | ) | \ | - !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | ` | 1 | 2 | 3 | 4 | 5 |-------! !-------! 6 | 7 | 8 | 9 | 0 | ' | - !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! - | SHIFT | | | | | | [ | ! ] | | | | | | SHIFT | - '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | - '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | END | ! PGDN | ! ENTER ! - ! SPACE ! BSPCE !-------! !-------! TAB ! / ! - | | | COPY | ! PASTE | | LOWER | - '-----------------------' '-----------------------' +/* QWERTY - http://www.keyboard-layout-editor.com/#/gists/b6c016a22a9d31381a276a603a42fe5f + .---------------------------------------------. .---------------------------------------------. + | ESC | 1 | 2 | 3 | 4 | 5 | -> | ! - | 6 | 7 | 8 | 9 | 0 | = | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | DEL | Q | W | E | R | T | ( | ! ) | Y | U | I | O | P | \ | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | NUMS | A | S | D | F | G |-------! !-------! H | J | K | L | ; | ' | + !-------+-----+-----+-----x-----x-----! HYP ! ! MEH !-----x-----x-----+-----+-----+-------! + | SHIFT | Z | X | C | V | B | [ | ! ] | N | M | , | . | / | SHIFT | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | GAME | NUM | LWR | UP | LFT | .---------------. .---------------. ! RGT | DWN | | | ADJ | + '------------------------------' | APP | HOME | ! PGUP | ESC | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | END | ! PGDN | ! ENTER ! + ! SPACE ! BSPCE !-------! !-------! TAB ! / ! + | | | COPY | ! PASTE | | LOWER | + '-----------------------' '-----------------------' */ + [_QWERTY] = LAYOUT_ergodox_pretty_base_wrapper( + _________________QWERTY_L1__________________, _________________QWERTY_R1__________________, + _________________QWERTY_L2__________________, _________________QWERTY_R2__________________, + _________________QWERTY_L3__________________, _________________QWERTY_R3__________________ + ), [_LOWER] = LAYOUT_ergodox_pretty_wrapper( - _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, - _______,_______________________SPECIAL_LEFT______________________, _______, _______, _______________________SPECIAL_RIGHT_____________________, _______, - KC_GRV ,_______________________NUMBER_LEFT_______________________, _______________________NUMBER_RIGHT______________________, _______, - _______,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, _______, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, _______, - _________________________________________________________, _________________________________________________________, - ______________________ERGODOX_THUMBS_____________________ + KC_F11 ,__________________FUNCTION_LEFT_____________, _______, _______, __________________FUNCTION_RIGHT____________, KC_F12, + _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_PAST, _______, + LM_GRAVE, _______, KC_LEFT, KC_DOWN,KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_PPLS, _______, + OS_LSFT,____________________BLANK___________________, _______, _______, _______, KC_1, KC_2, KC_3, KC_PMNS, _______, + ____________________BLANK___________________, KC_0, KC_PDOT, KC_COMM,KC_PEQL, _______, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), - /* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 +/* Adjust - http://www.keyboard-layout-editor.com/#/gists/dedeae17b35a5d5f745a42aaea78f007 .---------------------------------------------. .---------------------------------------------. - | | | | | | | EPRM | ! EPRM | | | | | | | + | MAKE | | | | | | RESET | ! EPRM | | | | | | | !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! | | | | | | | | ! | | | | | | | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | SWRKM | + | | 🔇 | 🔉 | 🔊 | LCK | |-------! !-------! | | | | | QWRTY | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! - | | | | | | | | ! | | | | | | HWRKM | + | | | | | | | | ! | | | | | WIN | WRKMN | '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' | | | | | | .---------------. .---------------. ! | | | | | '------------------------------' | | | ! | | '------------------------------' @@ -115,101 +117,66 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { '-----------------------' '-----------------------' */ [_ADJUST] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, KC_EPRM, KC_EPRM, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX,KC__MUTE, KC__VOLDOWN, KC__VOLUP, MC_LOCK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_SWRK, - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_HWRK, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, - ______________________ERGODOX_THUMBS_____________________ - ), - [_NUMS] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXX, XXXXXXX, KC_UP, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_7, KC_KP_8, KC_KP_9, KC_PAST, XXXXXXX, - _______,XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_KP_4, KC_KP_5, KC_KP_6, KC_PPLS, XXXXXXX, - LM_SHFT,XXXXXXX, XXXXXXX, XXXXXXX, JJ_COPY, JJ_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, KC_KP_1, KC_KP_2, KC_KP_3, KC_PMNS, XXXXXXX, - XXXXXXX,_______,XXXXXXX,XXXXXXX,XXXXXXX, KC_KP_0, KC_PDOT, KC_COMM, KC_PEQL, XXXXXXX, - _______, _______, _______,_______, - _______, _______, - KC_LALT,KC_LGUI,_______, _______,_______,_______ - ), - [_NMOD] = LAYOUT_ergodox_pretty_wrapper( - XXXXXXX,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, - XXXXXXX,XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX,XXXXXXX, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - LM_SHFT,XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, _______, _______, _______, _______, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, - XXXXXXX, XXXXXXX, - KC_LALT,KC_LGUI,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX + KC_MAKE, ____________________BLANK___________________, KC_RST, KC_EPRM, ____________________BLANK___________________, XXXXXXX, + _______, ____________________BLANK___________________, _______, _______, ____________________BLANK___________________, XXXXXXX, + _______,KC__MUTE,KC__VOLDOWN,KC__VOLUP,MC_LOCK,_______, ____________________BLANK___________________, KC_MQWR, + _______, ____________________BLANK___________________, _______, _______, _______, _______, _______, _______, KC_WWRK, KC_MWRK, + ____________________BLANK___________________, ____________________BLANK___________________, + _______, _______, _______, _______, + _______, _______, + _______, _______, _______, _______, _______, _______ ), -// Diablo - http://www.keyboard-layout-editor.com/#/gists/28476e4237e77d4835ac8a9d7e5f9b2c [_DIABLO] = LAYOUT_ergodox_pretty_wrapper( - KC_ESC , XXXXXXX , XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX ,XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_TAB , KC_Q ,ALT_T(KC_S), KC_I , KC_F , KC_J ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_LOCK, KC_1 , KC_2 , KC_3 , KC_4 ,KC_DCLR , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - KC_LSFT, KC_D3_1 , KC_D3_2 , KC_D3_3 , KC_D3_4 , KC_T ,KC_MINS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - _______, XXXXXXX , XXXXXXX , XXXXXXX , KC_M , XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, - XXXXXXX, XXXXXXX, XXXXXXX,XXXXXXX, - XXXXXXX, XXXXXXX, - KC_BTN1,KC_BTN2,KC_ENTER, XXXXXXX,XXXXXXX,XXXXXXX + KC_ESC, KC_V, KC_D, KC_LALT, KC_NO, KC_NO, KC_NO, KC_NO, KC_F9, KC_F10, KC_F11, KC_F12, KC_NO, KC_NO, + KC_TAB, KC_S, KC_F, KC_I, KC_M, KC_T, KC_ENTER, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_Q, KC_1, KC_2, KC_3, KC_4, KC_P, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, + KC_LCTL, KC_D3_1, KC_D3_2, KC_D3_3, KC_D3_4, KC_Z, KC_LOCK, KC_NO, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, + _______, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_TRNS, KC_NO, + KC_L, KC_J, KC_NO, KC_NO, + KC_F, KC_NO, + SFT_T(KC_SPACE), ALT_T(KC_Q), KC_DCLR, KC_PGDN, KC_DEL, KC_ENT ) }; bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - uint8_t default_layer = 0; - default_layer = eeconfig_read_default_layer(); - switch (keycode) { - case KC_SWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_SWRKMN); - layer_move(default_layer); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_HWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_HWRKMN); - layer_move(default_layer); - ergodox_blink_all_leds(); - ergodox_blink_all_leds(); - } - return false; - break; - case KC_EPRM: - if (!record->event.pressed) { - ergodox_blink_all_leds(); - eeconfig_init(); - } - return false; - break; - case MC_LOCK: - if (!record->event.pressed) { - layer_move(default_layer); - SEND_STRING(SS_LCTRL(SS_LGUI("q"))); - } - return false; - break; - } return true; } void matrix_init_keymap(void) {}; void matrix_scan_keymap(void) { + uint8_t modifiers = get_mods(); + uint8_t led_usb_state = host_keyboard_leds(); + uint8_t one_shot = get_oneshot_mods(); uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); ergodox_right_led_1_off(); ergodox_right_led_2_off(); ergodox_right_led_3_off(); + switch (layer) { - /* - Lights are treated as binary here for easy identification. - LED1 = 4; LED2 = 2; LED1 = 1 - This allows for up to 8 identified layers (default layers being no lights on) - Which is way more than I should ever need - */ + case _WORKMAN: + case _QWERTY: + case _WINWORKMAN: + if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1< @JacobJerrell + +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 . +*/ + #include "bocaj.h" -#include "eeprom.h" -#include "version.h" -#include "tap_dances.h" -static uint16_t copy_paste_timer; userspace_config_t userspace_config; +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + #define BOCAJ_UNICODE_MODE UC_OSX +#else + // set to 2 for UC_WIN, set to 4 for UC_WINC + #define BOCAJ_UNICODE_MODE 2 +#endif -/* *** *** *** *** * - * Helper Functions * - * *** *** *** *** */ void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; // Add reconfigurable functions here, for keymap customization @@ -36,10 +52,7 @@ bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { } __attribute__ ((weak)) -bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { - return true; -} - +void matrix_scan_secrets(void) {} __attribute__ ((weak)) uint32_t layer_state_set_keymap (uint32_t state) { @@ -57,7 +70,14 @@ void led_set_keymap(uint8_t usb_led) {} // Call user matrix init, set default RGB colors and then // call the keymap's init function void matrix_init_user(void) { - userspace_config.raw = eeprom_read_byte(EECONFIG_USERSPACE); + userspace_config.raw = eeconfig_read_user(); + + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(BOCAJ_UNICODE_MODE); + get_unicode_input_mode(); + #endif //UNICODE_ENABLE + + matrix_init_keymap(); } @@ -78,6 +98,18 @@ void suspend_wakeup_init_user(void) #endif } +void eeconfig_init_user(void) { + userspace_config.raw = 0; + eeconfig_update_user(userspace_config.raw); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(BOCAJ_UNICODE_MODE); + get_unicode_input_mode(); + #else + eeprom_update_byte(EECONFIG_UNICODEMODE, BOCAJ_UNICODE_MODE); + #endif +} + +LEADER_EXTERNS(); // No global matrix scan code, so just run keymap's matrix // scan function void matrix_scan_user(void) { @@ -86,6 +118,68 @@ void matrix_scan_user(void) { has_ran_yet = true; startup_user(); } + LEADER_DICTIONARY() { + leading = false; + leader_end(); + + // Mac Save (Leader -> s) + SEQ_ONE_KEY(KC_S) { + SEND_STRING(SS_LGUI("s")); + } + + // Mac copy line down (Leader -> d, d) + SEQ_TWO_KEYS(KC_D, KC_D) { + register_code(KC_LSHIFT); + register_code(KC_HOME); + unregister_code(KC_HOME); + unregister_code(KC_LSHIFT); + SEND_STRING(SS_LGUI("c")); + tap(KC_END); + tap(KC_ENTER); + SEND_STRING(SS_LGUI("v")); + } + + // Mac copy line up (Leader -> u, u) + SEQ_TWO_KEYS(KC_U, KC_U) { + register_code(KC_LSHIFT); + register_code(KC_HOME); + unregister_code(KC_HOME); + unregister_code(KC_LSHIFT); + SEND_STRING(SS_LGUI("c")); + tap(KC_UP); + tap(KC_END); + tap(KC_ENTER); + SEND_STRING(SS_LGUI("v")); + } + + // Mac VS Debug + SEQ_ONE_KEY(KC_D) { + tap(KC_F5); + } + + // Mac VS Stop Debug + SEQ_TWO_KEYS(KC_S, KC_D) { + register_code(KC_LSHIFT); + tap(KC_F5); + unregister_code(KC_LSHIFT); + } + + // Start Diablo 3 + SEQ_ONE_KEY(KC_3) { + SEND_STRING(SS_LCTRL(" ")); + SEND_STRING("Diablo"); + tap(KC_ENTER); + } + + SEQ_ONE_KEY(KC_B) { + SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " "); + tap(KC_ENTER); + SEND_STRING ("Built at: " QMK_BUILDDATE); + } +#ifndef NO_SECRETS + matrix_scan_secrets(); +#endif // !NO_SECRETS + } #ifdef TAP_DANCE_ENABLE // Run Diablo 3 macro checking code. run_diablo_macro_check(); @@ -93,85 +187,3 @@ void matrix_scan_user(void) { matrix_scan_keymap(); } - -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - /* uint8_t default_layer = 0; - default_layer = eeconfig_read_default_layer(); */ - switch (keycode) { - case JJ_COPY: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("c")); - } - return false; - break; - case JJ_PSTE: - if (!record->event.pressed) { - SEND_STRING(SS_LGUI("v")); - } - return false; - break; - case JJ_ARRW: - if (!record->event.pressed) { - SEND_STRING("->"); - } - return false; - break; /* - case KC_SWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_SWRKMN); - layer_move(default_layer); - //ergodox_blink_all_leds(); - //ergodox_blink_all_leds(); - } - return false; - break; - case KC_HWRK: - if (!record->event.pressed) { - set_single_persistent_default_layer(_HWRKMN); - layer_move(default_layer); - //ergodox_blink_all_leds(); - //ergodox_blink_all_leds(); - } - return false; - break; - case KC_EPRM: - if (!record->event.pressed) { - //ergodox_blink_all_leds(); - eeconfig_init(); - } - return false; - break; - case MC_LOCK: - if (!record->event.pressed) { - layer_move(default_layer); - SEND_STRING(SS_LCTRL(SS_LGUI("q"))); - } - return false; - break; */ - case KC_DCLR: -#ifdef TAP_DANCE_ENABLE - if (record->event.pressed) { - uint8_t dtime; - for (dtime = 0; dtime < 4; dtime++) { - diablo_key_time[dtime] = diablo_times[0]; - } - } -#endif // !TAP_DANCE_ENABLE - return false; - break; - case KC_CCCV: - if (record->event.pressed) { - copy_paste_timer = timer_read(); - } else { - if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy - SEND_STRING(SS_LGUI("c")); - } else { - SEND_STRING(SS_LGUI("v")); - } - } - return false; - break; - } - return process_record_keymap(keycode, record); -} - diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h index 7b537397f0..04991a0150 100644 --- a/users/bocaj/bocaj.h +++ b/users/bocaj/bocaj.h @@ -1,141 +1,85 @@ -#ifndef USERSPACE -#define USERSPACE +/* +Copyright 2018 Jacob Jerrell @JacobJerrell +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 #include "quantum.h" +#include "version.h" +#include "eeprom.h" +#include "wrappers.h" +#include "process_records.h" +#ifdef TAP_DANCE_ENABLE + #include "tap_dances.h" +#endif // TAP_DANCE_ENABLE -/* *** *** *** *** *** * - * Define layer names * - * *** *** *** *** *** */ +/* Layer Names */ enum userspace_layers { - _HWRKMN = 0, - _SWRKMN, + _WORKMAN = 0, + _WINWORKMAN, + _QWERTY, _LOWER, _ADJUST, - _NUMS, - _NMOD, - _DIABLO + _DIABLO, }; -#define EECONFIG_USERSPACE (uint8_t *)19 +#if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + #define BOCAJ_UNICODE_MODE UC_OSX +#else + // set to 2 for UC_WIN, set to 4 for UC_WINC + #define BOCAJ_UNICODE_MODE 2 +#endif + +/* +define modifiers here, since MOD_* doesn't seem to work for these + */ +#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) +#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) +#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) + +bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); +bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); +bool send_game_macro(const char *str, keyrecord_t *record, bool override); +void matrix_init_keymap(void); +void shutdown_keymap(void); +void suspend_power_down_keymap(void); +void suspend_wakeup_init_keymap(void); +void matrix_scan_keymap(void); +uint32_t layer_state_set_keymap (uint32_t state); +uint32_t default_layer_state_set_keymap (uint32_t state); +void led_set_keymap(uint8_t usb_led); +void eeconfig_init_keymap(void); +void tap(uint16_t keycode); + typedef union { uint8_t raw; } userspace_config_t; -/* *** *** *** *** *** *** * - * Define Custom Keycodes * - * *** *** *** *** *** *** */ -enum userspace_custom_keycodes { - KC_EPRM = SAFE_RANGE, // can always be here - KC_SWRK, - KC_HWRK, - KC_VRSN, - JJ_COPY, - JJ_PSTE, - JJ_ARRW, - KC_CCCV, - MC_LOCK, - KC_DCLR, - NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes -}; - -// Space Cadet Hyper/Meh and [/] -#define HYP_LBK ALL_T(KC_LBRACKET) -#define MEH_RBK MEH_T(KC_RBRACKET) - -// Layout beauti-/simpli-fication -#define KC_LWEN LT(_LOWER, KC_ENTER) -#define KC_ADJS TT(_ADJUST) -#define KC_NUMS TT(_NUMS) -#define LM_SHFT LM(_NMOD, MOD_LSFT) -#define XXXXXXX KC_NO -#define _______ KC_TRNS - -void tap(uint16_t keycode); - -/* *** *** *** *** *** *** * - * Diablo 3 Macro Handling * - * *** *** *** *** *** *** */ +extern userspace_config_t userspace_config; // If Tap Dancing is enabled, we manage that here. // If it is not, then we define the KC_D3_# codes gracefully #ifdef TAP_DANCE_ENABLE -enum { - TD_D3_1 = 0, - TD_D3_2, - TD_D3_3, - TD_D3_4, -}; - -#define KC_D3_1 TD(TD_D3_1) -#define KC_D3_2 TD(TD_D3_2) -#define KC_D3_3 TD(TD_D3_3) -#define KC_D3_4 TD(TD_D3_4) + #define KC_D3_1 TD(TD_D3_1) + #define KC_D3_2 TD(TD_D3_2) + #define KC_D3_3 TD(TD_D3_3) + #define KC_D3_4 TD(TD_D3_4) #else // !TAP_DANCE_ENABLE -#define KC_D3_1 KC_1 -#define KC_D3_2 KC_2 -#define KC_D3_3 KC_3 -#define KC_D3_4 KC_4 + #define KC_D3_1 KC_1 + #define KC_D3_2 KC_2 + #define KC_D3_3 KC_3 + #define KC_D3_4 KC_4 #endif // TAP_DANCE_ENABLE - -// Wrapper for handling of keymap 'blocks' -// not 100% sure what this first part does. Credit to Drashna -#if (!defined(LAYOUT) && defined(KEYMAP)) -#define LAYOUT KEYMAP -#endif - -#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -/* Pretty Layout -.---------------------------------------------. .---------------------------------------------. -| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | -!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! -| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | -!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! -| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | -'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' - | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | - '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' - .-------+-------+-------! !-------+-------+-------. - ! ! | 69 | ! 70 | ! ! - ! ! !-------! !-------! ! ! - | 71 | 72 | 73 | ! 74 | 75 | 76 | - '-----------------------' '-----------------------' -*/ - -#define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G -#define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B - -#define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN -#define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -// Hardware Driven Workman -#define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G -#define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V - -#define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I -#define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) - -#define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT -#define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, XXXXXXX, XXXXXXX, TT(_ADJUST) - -#define _______________________NUMBER_LEFT_______________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define _______________________NUMBER_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0 - -#define _______________________SPECIAL_LEFT______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _______________________SPECIAL_RIGHT_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN - -#define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -#define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO - -// LEFT | RIGHT -#define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ - KC_END, KC_PGDOWN, \ - KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PSTE,KC_TAB,KC_LWEN - - -#endif // !USERSPACE diff --git a/users/bocaj/config.h b/users/bocaj/config.h index 0e726598cd..1956ea6d96 100644 --- a/users/bocaj/config.h +++ b/users/bocaj/config.h @@ -10,12 +10,15 @@ // actually sends Ctrl-x. That's bad.) #define IGNORE_MOD_TAP_INTERRUPT #undef PERMISSIVE_HOLD +#define PREVENT_STUCK_MODIFIERS #ifdef TAPPING_TERM #undef TAPPING_TERM #endif // TAPPING_TERM #define TAPPING_TERM 175 +#define RETRO_TAPPING + // Disable action_get_macro and fn_actions, since we don't use these // and it saves on space in the firmware. #ifndef NO_DEBUG @@ -27,6 +30,4 @@ #define NO_ACTION_MACRO #define NO_ACTION_FUNCTION -#define DISABLE_LEADER - #define MACRO_TIMER 5 diff --git a/users/bocaj/process_records.c b/users/bocaj/process_records.c new file mode 100644 index 0000000000..c36683f8ba --- /dev/null +++ b/users/bocaj/process_records.c @@ -0,0 +1,149 @@ +#include "bocaj.h" +#include QMK_KEYBOARD_H + +uint16_t copy_paste_timer; +uint16_t grave_layer_timer; +uint16_t heal_layer_timer; + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +// Defines actions tor my global custom keycodes. Defined in bocaj.h file +// Then runs the _keymap's record handler if not processed here +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(0); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case KC_WWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_WINWORKMAN); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(4); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case KC_MQWR: + if (!record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) + set_unicode_input_mode(0); + #endif + layer_move(0); + ergodox_blink_all_leds(); + } + break; + case MC_LOCK: + if (!record->event.pressed) { + layer_move(0); + SEND_STRING(SS_LCTRL(SS_LGUI("q"))); + } + break; + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + uint8_t temp_mod = get_mods(); + uint8_t temp_osm = get_oneshot_mods(); + clear_mods(); + clear_oneshot_mods(); + if (biton32(default_layer_state) == _WINWORKMAN) { + send_string_with_delay_P(PSTR("make " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + } else { + send_string_with_delay_P(PSTR("util/docker_build.sh " QMK_KEYBOARD ":" QMK_KEYMAP), 10); + } + if (temp_mod & MODS_SHIFT_MASK) { + send_string_with_delay_P(PSTR(":teensy"), 10); + } + if (temp_mod & MODS_CTRL_MASK) { + send_string_with_delay_P(PSTR(" -j8 --output-sync"), 10); + } + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), 10); + set_mods(temp_mod); + layer_move(0); + } + break; + case KC_DCLR: // reset all Diablo timers, disabling them +#ifdef TAP_DANCE_ENABLE + if (record->event.pressed) { + uint8_t dtime; + for (dtime = 0; dtime < 4; dtime++) { + diablo_key_time[dtime] = diablo_times[0]; + } + } +#endif // TAP_DANCE_ENABLE + break; + case JJ_ARRW: + if (!record->event.pressed) { + SEND_STRING("->"); + } + return false; + break; + case LM_GRAVE: + if (record->event.pressed) { + grave_layer_timer = timer_read(); + } else { + if (timer_elapsed(grave_layer_timer) < TAPPING_TERM) { + uint8_t temp_mod = get_mods(); + uint8_t one_shot = get_oneshot_mods(); + clear_mods(); + if (temp_mod & MODS_SHIFT_MASK || one_shot & MODS_SHIFT_MASK) { + register_code(KC_LSFT); + tap(KC_GRAVE); + unregister_code(KC_LSFT); + } else { + tap(KC_GRAVE); + } + set_mods(temp_mod); + } else { + layer_move(0); + } + } + return false; + break; + case KC_CCCV: + if (record->event.pressed) { + copy_paste_timer = timer_read(); + } else { + if (timer_elapsed(copy_paste_timer) > TAPPING_TERM) { // Hold, copy + SEND_STRING(SS_LGUI("c")); + } else { + SEND_STRING(SS_LGUI("v")); + } + } + return false; + break; +#ifdef UNICODE_ENABLE + case UC_FLIP: // (ノಠ痊ಠ)ノ彡┻━┻ + if (record->event.pressed) { + send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + } + break; + case UC_TABL: // ┬─┬ノ( º _ ºノ) + if (record->event.pressed) { + send_unicode_hex_string("252C 2500 252C 30CE 0028 0020 00BA 0020 005F 0020 00BA 30CE 0029"); + } + break; + case UC_SHRG: // ¯\_(ツ)_/¯ + if (record->event.pressed) { + send_unicode_hex_string("00AF 005C 005F 0028 30C4 0029 005F 002F 00AF"); + } + break; + case UC_DISA: // ಠ_ಠ + if (record->event.pressed) { + send_unicode_hex_string("0CA0 005F 0CA0"); + } + break; +#endif + } + return process_record_keymap(keycode, record); +} diff --git a/users/bocaj/process_records.h b/users/bocaj/process_records.h new file mode 100644 index 0000000000..248df13e1b --- /dev/null +++ b/users/bocaj/process_records.h @@ -0,0 +1,52 @@ +#pragma once +#include "bocaj.h" + +#if defined(KEYMAP_SAFE_RANGE) + #define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else + #define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_custom_keycodes { + KC_EPRM = PLACEHOLDER_SAFE_RANGE, // can always be here + KC_MWRK, + KC_WWRK, + KC_MQWR, + KC_VRSN, + LM_GRAVE, // Shift if held, layer change if tapped + JJ_COPY, + JJ_PSTE, + JJ_ARRW, + KC_CCCV, + MC_LOCK, + KC_DCLR, + KC_MAKE, + UC_FLIP, // (ಠ痊ಠ)┻━┻ + UC_TABL, // ┬─┬ノ( º _ ºノ) + UC_SHRG, // ¯\_(ツ)_/¯ + UC_DISA, // ಠ_ಠ + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + +// One Shot +#define OS_LSFT OSM(MOD_LSFT) + +// Space Cadet Hyper/Meh and [/] +#define HYP_LBK ALL_T(KC_LBRACKET) +#define MEH_RBK MEH_T(KC_RBRACKET) + +#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc ) + +// Layout beauti-/simpli-fication +#define KC_LWEN LT(_LOWER, KC_ENTER) +#define KC_ADJS TT(_ADJUST) +#define KC_NUMS TT(_LOWER) +#define KC_GAME TT(_DIABLO) +#define XXXXXXX KC_NO +#define _______ KC_TRNS + +// Other Keycodes +#define KC_RST RESET +#define KC_BS KC_BSLASH diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md index bab6d7337f..669299cb0d 100644 --- a/users/bocaj/readme.md +++ b/users/bocaj/readme.md @@ -1,14 +1,102 @@ -Copyright 2018 Jacob Jerrell jacob.jerrell@gmail.com @JacobJerrell +# Overview -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. +My personal QMK userspace. First, I must say that the credit for a majority of the code found here belongs to Drashna and/or the people he derived his code from. My Ergodox layout is briefly described in its respective folder. As for explaining this userspace, you could honestly go to Drashna's userspace and read his well put together readme. Regardless, I am mostly writing this as an excercise for myself to better understand what is going on, and where applicable, describe things that I innovated on my own. -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. +## Bocaj.c -You should have received a copy of the GNU General Public License -along with this program. If not, see . +### Unicode + +I've always had difficulty implementing unicode in QMK, all of this code is literally copy/pasted from Drashna's userspace and lies dormant here until I can take the time to figure it out. + +Update: Got it to work in Mac OS which is more important to me than Windows (probably pretty easy to figure out at this point). So I'm a happy table flipping person now! + +(ノಠ痊ಠ)ノ彡┻━┻ + +┬─┬ノ( º _ ºノ) + +### Tap Macro + +Not sure why this doesn't exist in QMK already (maybe it does?) + +```c +void tap(uint16_t keycode){ register_code(keycode); unregister_code(keycode); }; +``` + +### *_keymap functions + +We're running *_user functions in the userspace, that way we can add to or reconfigure at the keyboard level. Any *_user functions should call the equivalent *_keymap function at the end. If the *_keymap function isn't defined in the keymap, the `__attribute__ ((weak))` will prevent build problems. + +### Startup/Suspend/Shutdown Functions + +I have no idea what these do. Non-Ergodox keyboard functions? + +### Matrix Scan User + +Leader key defines, Diablo macro ancillary function, run matrix_scan_keymap. + +#### Leader Key + +I've always been interested in this feature, but I've had 0 experience with applications that have similar behavior. My implementation seeks to implement features that I feel VS2017 lacks + +## Secrets + +Hacked Drashna's secret macro implementation to work with the leader key instead. +TODO: Finish documentation + +## Bocaj.h + +Layer defines, some macro ancillary defines, setup Diablo macros and failsafe + +## Process_Records.c/.h + +Again, taking ideas from Drashna to make maintenance simpler. A couple of things that I'm proud of here, but nothing really ground breaking. + +* Features + * Change default layer + * KC_MWRK, KC_WWRK, KC_MQWR + * MacOS Lock Screen Macro + * Make macro (Credit: Drashna) + * Need to reconfigure so it runs the docker command if one of the Mac OS layers are default because the AVR install fails on the corporate laptop + * Arrow macro (->) because I find myself telling people how to get to something quite frequently and typing this manually requires moving the right hand to the top-left of the ergodox and then to the bottom right, which feels unnatural. + * LM_GRAVE + * While combining _NUMS and _LOWER, I also needed a place to put F1-12 keys. This required me to relocate the grave key. The most comfortable place to put it was over a key that I frequently use to toggle the numpad. I do have other ways to get to/from this layer but my mind has been wired to use them for different workflows, so I would sit here frozen for a moment trying to tell my fingers where to go + * How it works + * A timer starts when pressed down + * If the timer at release was less than the TAPPING_TERM define + * Get mods + * If Shift was held or one-shot shift was active + * Send `~` + * Else + * Send ` + * Else (timer at released was greater than the TAPPING_TERM define) + * Move to the default layer + * KC_CCCV + * Another neat idea I found in Drashna's userspace... highly underutilized in my layout but the inspiration for LM_GRAVE was obviously derived from this code + * Unicode stuff + * All I've ever wanted was a table-flip macro... I managed to get about half of it to work before I gave up and disabled it + +## Send_Unicode.c/.h + +I have some basic understanding of this, Drashna may already have it documented in his userspace. I'll put it in my own words when I get around to making it work and understanding it better. + +## Tap_Dances.c/h + +Again, building on Drashna's userspace organization to simplify maintenance of a heavily configured layout. This is all the stuff for the Diablo 3 macros that spam a given skill (1-4) every ~1 second + +## Wrappers.h + +Traditionally, you would put all of this into the \.h file. But I liked the idea of separating it to simplify modification in the future. + +### GUI_CTR(os, kc) + +A notable mention in this file is the GUI_CTR(os, kc) custom keycode defined in process_records.h as: + +```c +#define GUI_CTR(os, kc) MT( (os == 0) ? (MOD_LGUI) : (MOD_LCTL), kc ) +``` + +I tried several things before coming to this one-liner conclusion. I believe it is quite elegant and it definitely solves the problem I had (separate wrappers for Windows/MacOS layers). But I would love to make this into something more intuitive, like a macro that detects which layer you're on and sends the applicable hotkey when held, or keycode when tapped. Ultimately, I was too tired of thinking about it to come up with a solution like that at this time. + +Anyhow, if you set `os == 1`, it sends the Windows CTRL hotkey when held. If you set `os == 0`, it sends the Mac OS GUI hotkey when held. If tapped, it sends the keycode. + +This is effectively a slightly more advanced `MOD_T(kc)` keycode. diff --git a/users/bocaj/rules.mk b/users/bocaj/rules.mk index 17d2772a7c..9ed8c250a3 100644 --- a/users/bocaj/rules.mk +++ b/users/bocaj/rules.mk @@ -1,5 +1,33 @@ -SRC += bocaj.c +SRC += bocaj.c \ + process_records.c + +ifneq ("$(wildcard $(USER_PATH)/secrets.c)","") + SRC += secrets.c +endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) SRC += tap_dances.c endif + +# Caused problems when building via docker on Mac OS +# EXTRAFLAGS += -flto + +ifeq ($(strip $(NO_SECRETS)), yes) + OPT_DEFS += -DNO_SECRETS +endif + +ifeq ($(strip $(MACROS_ENABLED)), yes) + OPT_DEFS += -DMACROS_ENABLED +endif + +ifeq ($(strip $(UCIS_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODEMAP_ENABLE)), yes) + SRC += send_unicode.c +endif + +ifeq ($(strip $(UNICODE_ENABLE)), yes) + SRC += send_unicode.c +endif diff --git a/users/bocaj/send_unicode.c b/users/bocaj/send_unicode.c new file mode 100644 index 0000000000..b1290f6319 --- /dev/null +++ b/users/bocaj/send_unicode.c @@ -0,0 +1,106 @@ +// Written by konstantin: vomindoraan +#include "send_unicode.h" +#include +#include + +__attribute__((weak)) +void send_unicode_hex_string(const char* str) { + if (!str) { return; } // Safety net + + while (*str) { + // Find the next code point (token) in the string + for (; *str == ' '; str++); + size_t n = strcspn(str, " "); // Length of the current token + char code_point[n+1]; + strncpy(code_point, str, n); + code_point[n] = '\0'; // Make sure it's null-terminated + + // Normalize the code point: make all hex digits lowercase + for (char *p = code_point; *p; p++) { + *p = tolower((unsigned char)*p); + } + + // Send the code point as a Unicode input string + unicode_input_start(); + send_string(code_point); + unicode_input_finish(); + + str += n; // Move to the first ' ' (or '\0') after the current token + } +} + +// (ノಠ痊ಠ)ノ彡┻━┻ +// send_unicode_hex_string("0028 30CE 0CA0 75CA 0CA0 0029 30CE 5F61 253B 2501 253B"); + +//Old code +// (╯°□°)╯ ︵ ┻━┻ + #if 0 + register_code(KC_RSFT); + tap(KC_9); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + process_unicode((0x25A1 | QK_UNICODE), record); // Mouth + process_unicode((0x00B0 | QK_UNICODE), record); // Eye + register_code(KC_RSFT); + tap(KC_0); + unregister_code(KC_RSFT); + process_unicode((0x256F | QK_UNICODE), record); // Arm + tap(KC_SPC); + process_unicode((0x0361 | QK_UNICODE), record); // Flippy + tap(KC_SPC); + process_unicode((0x253B | QK_UNICODE), record); // Table + process_unicode((0x2501 | QK_UNICODE), record); // Table + process_unicode((0x253B | QK_UNICODE), record); // Table + #endif + + +// If you need a good converter: https://r12a.github.io/app-conversion/ +uint8_t saved_mods; + +void unicode_input_start (void) { + // save current mods + saved_mods = get_mods(); // Save current mods + clear_mods(); // Unregister mods to start from a clean state + + switch(get_unicode_input_mode()) { + case UC_OSX: + register_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_LCTL); + register_code(KC_LSFT); + register_code(KC_U); + unregister_code(KC_U); + unregister_code(KC_LSFT); + unregister_code(KC_LCTL); + break; + case UC_WIN: + register_code(KC_LALT); + register_code(KC_PPLS); + unregister_code(KC_PPLS); + break; + case UC_WINC: + register_code(KC_RALT); + unregister_code(KC_RALT); + register_code(KC_U); + unregister_code(KC_U); + break; + } + wait_ms(UNICODE_TYPE_DELAY); +} + +void unicode_input_finish (void) { + switch(get_unicode_input_mode()) { + case UC_OSX: + case UC_WIN: + unregister_code(KC_LALT); + break; + case UC_LNX: + register_code(KC_SPC); + unregister_code(KC_SPC); + break; + } + + set_mods(saved_mods); // Reregister previously set mods +} diff --git a/users/bocaj/send_unicode.h b/users/bocaj/send_unicode.h new file mode 100644 index 0000000000..818b6e571b --- /dev/null +++ b/users/bocaj/send_unicode.h @@ -0,0 +1,71 @@ +#pragma once + +#include "quantum.h" + +void send_unicode_hex_string(const char* str); + +/* use X(n) to call the */ +#ifdef UNICODEMAP_ENABLE +enum unicode_name { + THINK, // thinking face 🤔 + GRIN, // grinning face 😊 + SMRK, // smirk 😏 + WEARY, // good shit 😩 + UNAMU, // unamused 😒 + + SNEK, // snke 🐍 + PENGUIN, // 🐧 + DRAGON, // 🐉 + MONKEY, // 🐒 + CHICK, // 🐥 + BOAR, // 🐗 + + OKOK, // 👌 + EFFU, // 🖕 + INUP, // 👆 + THUP, // 👍 + THDN, // 👎 + + BBB, // dat B 🅱 + POO, // poop 💩 + HUNDR, // 100 💯 + EGGPL, // EGGPLANT 🍆 + WATER, // wet 💦 + TUMBLER, // 🥃 + + LIT, // fire 🔥 + BANG, // ‽ + IRONY, // ⸮ + DEGREE // ° +}; + + +const uint32_t PROGMEM unicode_map[] = { + [THINK] = 0x1F914, + [GRIN] = 0x1F600, + [BBB] = 0x1F171, + [POO] = 0x1F4A9, + [HUNDR] = 0x1F4AF, + [SMRK] = 0x1F60F, + [WEARY] = 0x1F629, + [EGGPL] = 0x1F346, + [WATER] = 0x1F4A6, + [LIT] = 0x1F525, + [UNAMU] = 0x1F612, + [SNEK] = 0x1F40D, + [PENGUIN] = 0x1F427, + [BOAR] = 0x1F417, + [MONKEY] = 0x1F412, + [CHICK] = 0x1F425, + [DRAGON] = 0x1F409, + [OKOK] = 0x1F44C, + [EFFU] = 0x1F595, + [INUP] = 0x1F446, + [THDN] = 0x1F44E, + [THUP] = 0x1F44D, + [TUMBLER] = 0x1F943, + [BANG] = 0x0203D, + [IRONY] = 0x02E2E, + [DEGREE] = 0x000B0 + }; +#endif // UNICODEMAP_ENABLE diff --git a/users/bocaj/tap_dances.c b/users/bocaj/tap_dances.c index 10767db453..a9628a345d 100644 --- a/users/bocaj/tap_dances.c +++ b/users/bocaj/tap_dances.c @@ -1,4 +1,3 @@ -#include "bocaj.h" #include "tap_dances.h" diff --git a/users/bocaj/tap_dances.h b/users/bocaj/tap_dances.h index 8935753f6c..5b1277ec58 100644 --- a/users/bocaj/tap_dances.h +++ b/users/bocaj/tap_dances.h @@ -1,3 +1,6 @@ +#pragma once +#include "bocaj.h" + //define diablo macro timer variables extern uint16_t diablo_timer[4]; extern uint8_t diablo_times[]; @@ -5,3 +8,12 @@ extern uint8_t diablo_key_time[4]; void run_diablo_macro_check(void); + +#ifdef TAP_DANCE_ENABLE +enum { + TD_D3_1 = 0, + TD_D3_2, + TD_D3_3, + TD_D3_4 +}; +#endif // TAP_DANCE_ENABLE diff --git a/users/bocaj/wrappers.h b/users/bocaj/wrappers.h new file mode 100644 index 0000000000..379edaad29 --- /dev/null +++ b/users/bocaj/wrappers.h @@ -0,0 +1,37 @@ +#pragma once +#include "bocaj.h" + +#if (!defined(LAYOUT) && defined(KEYMAP)) +#define LAYOUT KEYMAP +#endif + +#define LAYOUT_ergodox_wrapper(...) LAYOUT_ergodox(__VA_ARGS__) +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) + +#define _________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define _________________QWERTY_L2__________________ KC_A, KC_S, GUI_CTR(0, KC_D), KC_F, KC_G +#define _________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define _________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define _________________QWERTY_R2__________________ KC_H, KC_J, GUI_CTR(0, KC_K), KC_L, KC_SCLN +#define _________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH + +// Hardware Driven Workman +#define _________________WORKMAN_L1_________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define _________________WORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(0, KC_H), KC_T, KC_G // GUI_CTR(0, kc) behaves as GUI_T(kc) +#define ________________WWORKMAN_L2_________________ KC_A, KC_S, GUI_CTR(1, KC_H), KC_T, KC_G // GUI_CTR(1, kc) behaves as CTR_T(kc) +#define _________________WORKMAN_L3_________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define _________________WORKMAN_R1_________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define _________________WORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(0, KC_E), KC_O, KC_I // GUI_CTR(0, kc) behaves as GUI_T(kc) +#define ________________WWORKMAN_R2_________________ KC_Y, KC_N, GUI_CTR(1, KC_E), KC_O, KC_I // GUI_CTR(1, kc) behaves as CTR_T(kc) +#define _________________WORKMAN_R3_________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH + + +#define __________________NUMBER_LEFT_______________ KC_1, KC_2, KC_3, KC_4, KC_5 +#define __________________NUMBER_RIGHT______________ KC_6, KC_7, KC_8, KC_9, KC_0 + +#define __________________FUNCTION_LEFT_____________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 +#define __________________FUNCTION_RIGHT____________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 + +#define ____________________BLANK___________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS -- cgit v1.2.3 From 484c85bd0dd1141bfc12ecada44da92a8f2e78f6 Mon Sep 17 00:00:00 2001 From: ishtob Date: Wed, 2 Jan 2019 16:30:59 -0500 Subject: Adding default settings for ERM motors for Hadron v3 haptic feedback (#4761) * adding default settings to support 3v ERM vibration motors * set default settings of haptic motor for LV061228B-L64-A 2v LRA * update ishtob keymap and fix config settings --- keyboards/hadron/ver3/config.h | 30 ++++++++++++++++++--------- keyboards/hadron/ver3/keymaps/ishtob/keymap.c | 2 +- keyboards/hadron/ver3/mcuconf.h | 2 +- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/keyboards/hadron/ver3/config.h b/keyboards/hadron/ver3/config.h index 11288f7a57..7db5003043 100644 --- a/keyboards/hadron/ver3/config.h +++ b/keyboards/hadron/ver3/config.h @@ -148,13 +148,26 @@ #define FB_BRAKEFACTOR 6 /* For 1x:0, 2x:1, 3x:2, 4x:3, 6x:4, 8x:5, 16x:6, Disable Braking:7 */ #define FB_LOOPGAIN 1 /* For Low:0, Medium:1, High:2, Very High:3 */ +/* default 3V ERM vibration motor voltage and library*/ +#if FB_ERM_LRA == 0 +#define RATED_VOLTAGE 3 +#define V_RMS 2.3 +#define V_PEAK 3.30 +/* Library Selection */ +#define LIB_SELECTION 4 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ + +/* default 2V LRA voltage and library */ +#elif FB_ERM_LRA == 1 #define RATED_VOLTAGE 2 #define V_RMS 2.0 #define V_PEAK 2.85 -#define F_LRA 205 +#define F_LRA 200 /* Library Selection */ #define LIB_SELECTION 6 /* For Empty:0' TS2200 library A to D:1-5, LRA Library: 6 */ +#endif + + /* Control 1 register settings */ #define DRIVE_TIME 25 #define AC_COUPLE 0 @@ -179,14 +192,11 @@ #define ZC_DET_TIME 0 #define AUTO_CAL_TIME 3 -//#define WS2812_LED_N 2 -//#define RGBLED_NUM WS2812_LED_N -//#define WS2812_TIM_N 2 -//#define WS2812_TIM_CH 2 -//#define PORT_WS2812 GPIOA -//#define PIN_WS2812 15 -//#define WS2812_DMA_STREAM STM32_DMA1_STREAM2 // DMA stream for TIMx_UP (look up in reference manual under DMA Channel selection) -//#define WS2812_DMA_CHANNEL 7 // DMA channel for TIMx_UP -//#define WS2812_EXTERNAL_PULLUP +//#define RGBLIGHT_ANIMATIONS + +//#define RGBLED_NUM 10 +//#define RGB_DI_PIN B5 +//#define DRIVER_LED_TOTAL RGBLED_NUM +//#define RGB_MATRIX_KEYPRESSES #endif diff --git a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c index 530508b010..641c016247 100644 --- a/keyboards/hadron/ver3/keymaps/ishtob/keymap.c +++ b/keyboards/hadron/ver3/keymaps/ishtob/keymap.c @@ -82,7 +82,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_LOWER] = LAYOUT_wrapper( KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \ KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, _______, _______, _______, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL, \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_PLUS, KC_LBRC, KC_RBRC, KC_PIPE, \ + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______, _______, _______, KC_F6, KC_UNDS, KC_EQL, KC_LBRC, KC_RBRC, KC_PIPE, \ _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, _______, _______, _______, KC_F12,S(KC_NUHS),S(KC_NUBS),_______,_______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \ ), diff --git a/keyboards/hadron/ver3/mcuconf.h b/keyboards/hadron/ver3/mcuconf.h index 36f8ca2252..d0776b0463 100644 --- a/keyboards/hadron/ver3/mcuconf.h +++ b/keyboards/hadron/ver3/mcuconf.h @@ -159,7 +159,7 @@ #define STM32_I2C_BUSY_TIMEOUT 50 #define STM32_I2C_I2C1_IRQ_PRIORITY 10 #define STM32_I2C_I2C2_IRQ_PRIORITY 10 -#define STM32_I2C_USE_DMA TRUE +#define STM32_I2C_USE_DMA FALSE #define STM32_I2C_I2C1_DMA_PRIORITY 1 #define STM32_I2C_I2C2_DMA_PRIORITY 1 #define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure") -- cgit v1.2.3 From 526bc4c7cc6b4a7701d317bb66b8bb5fa6c9c87f Mon Sep 17 00:00:00 2001 From: flehrad <20124416+flehrad@users.noreply.github.com> Date: Fri, 4 Jan 2019 03:05:33 +1100 Subject: Keyboard: add snagpad and trainstation keyboards (#4755) * add snagpad * Update keyboards/snagpad/kb.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Rename kb.c to snagpad.c * Update and rename kb.h to snagpad.h * Update snagpad.h * Update keymap.c * Update config.h * Update config.h * Update rules.mk * Update README.md * Add files via upload * Update info.json * Update keymap.c * Update snagpad.h * Delete snagpad_numpad.json * Delete snagpad_ortho.json * Update README.md * Update keyboards/snagpad/info.json Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/rules.mk Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * add tradestation * --all * Did something weird messing with git -_- hopefully fixed * Update keyboards/tradestation/keymaps/default/keymap.c Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/tradestation/config.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/tradestation/config.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/tradestation/rules.mk Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update snagpad.h * Update rules.mk * Update keymap.c * fixed merge conflict, updated to LAYOUT_numpad_5x4 * relocated to handwire, updated naming, added layouts to rules.mk * Update keyboards/handwired/tradestation/rules.mk Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Update keyboards/snagpad/snagpad.h Co-Authored-By: flehrad <20124416+flehrad@users.noreply.github.com> * Rename LICENSE to license * Rename README.md to readme.md * Rename LICENSE to license * Rename README.md to readme.md * Update info.json * Update keymap.c * Update info.json --- keyboards/handwired/tradestation/config.h | 52 ++++++ keyboards/handwired/tradestation/info.json | 15 ++ .../tradestation/keymaps/default/keymap.c | 61 +++++++ keyboards/handwired/tradestation/license | 201 +++++++++++++++++++++ keyboards/handwired/tradestation/readme.md | 25 +++ keyboards/handwired/tradestation/rules.mk | 65 +++++++ keyboards/handwired/tradestation/tradestation.c | 1 + keyboards/handwired/tradestation/tradestation.h | 27 +++ keyboards/snagpad/config.h | 56 ++++++ keyboards/snagpad/info.json | 17 ++ keyboards/snagpad/keymaps/default/keymap.c | 63 +++++++ keyboards/snagpad/license | 201 +++++++++++++++++++++ keyboards/snagpad/readme.md | 21 +++ keyboards/snagpad/rules.mk | 65 +++++++ keyboards/snagpad/snagpad.c | 1 + keyboards/snagpad/snagpad.h | 30 +++ 16 files changed, 901 insertions(+) create mode 100644 keyboards/handwired/tradestation/config.h create mode 100644 keyboards/handwired/tradestation/info.json create mode 100644 keyboards/handwired/tradestation/keymaps/default/keymap.c create mode 100644 keyboards/handwired/tradestation/license create mode 100644 keyboards/handwired/tradestation/readme.md create mode 100644 keyboards/handwired/tradestation/rules.mk create mode 100644 keyboards/handwired/tradestation/tradestation.c create mode 100644 keyboards/handwired/tradestation/tradestation.h create mode 100644 keyboards/snagpad/config.h create mode 100644 keyboards/snagpad/info.json create mode 100644 keyboards/snagpad/keymaps/default/keymap.c create mode 100644 keyboards/snagpad/license create mode 100644 keyboards/snagpad/readme.md create mode 100644 keyboards/snagpad/rules.mk create mode 100644 keyboards/snagpad/snagpad.c create mode 100644 keyboards/snagpad/snagpad.h diff --git a/keyboards/handwired/tradestation/config.h b/keyboards/handwired/tradestation/config.h new file mode 100644 index 0000000000..346577a922 --- /dev/null +++ b/keyboards/handwired/tradestation/config.h @@ -0,0 +1,52 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT Trade Station + #define DESCRIPTION A Pro Micro-powered macropad layout by Didier Luximon. 1/8U gap space top two rows and 1/4U gap between 2U bottom two rows. + +/* key matrix size */ +#define MATRIX_ROWS 4 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, C6, D4, D0 } +#define MATRIX_COL_PINS { F7, B1, D7, E6 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS + #define RGBLED_NUM 5 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif diff --git a/keyboards/handwired/tradestation/info.json b/keyboards/handwired/tradestation/info.json new file mode 100644 index 0000000000..f26d4ec371 --- /dev/null +++ b/keyboards/handwired/tradestation/info.json @@ -0,0 +1,15 @@ +{ + "keyboard_name": "Tradestation", + "url": "", + "maintainer": "Flehrad", + "bootloader": "", + "width": 4.3, + "height": 4.5, + "layouts": { + "LAYOUT_tradestation": { + "layout": [{"x":0, "y":0}, {"x":1.1, "y":0}, {"x":2.2, "y":0}, {"x":3.3, "y":0}, {"x":0, "y":1.1}, {"x":1.1, "y":1.1}, {"x":2.2, "y":1.1}, {"x":3.3, "y":1.1}, {"x":0, "y":2.25, "w":2}, {"x":2.25, "y":2.25, "w":2}, {"x":0, "y":3.5, "w":2}, {"x":2.25, "y":3.5, "w":2}] + }, + "LAYOUT_ortho_4x4": { + "layout": [{"x":0, "y":0}, {"x":1.1, "y":0}, {"x":2.2, "y":0}, {"x":3.3, "y":0}, {"x":0, "y":1.1}, {"x":1.1, "y":1.1}, {"x":2.2, "y":1.1}, {"x":3.3, "y":1.1}, {"x":0, "y":2.25}, {"x":1, "y":2.25}, {"x":2.25, "y":2.25}, {"x":3.25, "y":2.25}, {"x":0, "y":3.5}, {"x":1, "y":3.5}, {"x":2.25, "y":3.5}, {"x":3.25, "y":3.5}] + } +} diff --git a/keyboards/handwired/tradestation/keymaps/default/keymap.c b/keyboards/handwired/tradestation/keymaps/default/keymap.c new file mode 100644 index 0000000000..3497dcb941 --- /dev/null +++ b/keyboards/handwired/tradestation/keymaps/default/keymap.c @@ -0,0 +1,61 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_4x4( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + + LAYOUT_tradestation( + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS), +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/handwired/tradestation/license b/keyboards/handwired/tradestation/license new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/keyboards/handwired/tradestation/license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/handwired/tradestation/readme.md b/keyboards/handwired/tradestation/readme.md new file mode 100644 index 0000000000..69c0331a92 --- /dev/null +++ b/keyboards/handwired/tradestation/readme.md @@ -0,0 +1,25 @@ +# Tradestation +QMK for Tradestation Macropad + +This macropad was layout designed by Didier Luximon + +This PCB supports an overall 4x4 matrix with unique spacing. +* Top two rows are 1U keys with 1/8U spacing +* Bottom two rows are available with 4x2 1U as clusters of 2x1U or as 2x2 2U, spaced with 1/4U + +For QMK Configurator, the info.json is utilised. +- For 2U keys , the first 1u row/column key assignment is the same as the 2u position. + +Build requires a pro micro. + +Can be built as single PCB with custom case, or as two PCB style with standoffs. + +If you like this simple PCB and want to make a donation, you can at https://paypal.me/theboardpodcast + +Check out our: + +YouTube (https://www.youtube.com/channel/UCg98oJZNffR9nDLJNkorjqw) + +Podcast (www.libsyn.com/theboardpodcast) + +Patreon (www.patreon.com/theboardpodcast) diff --git a/keyboards/handwired/tradestation/rules.mk b/keyboards/handwired/tradestation/rules.mk new file mode 100644 index 0000000000..9d49888b5f --- /dev/null +++ b/keyboards/handwired/tradestation/rules.mk @@ -0,0 +1,65 @@ +# MCU name +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 = caterina + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no + LAYOUTS = ortho_4x4 diff --git a/keyboards/handwired/tradestation/tradestation.c b/keyboards/handwired/tradestation/tradestation.c new file mode 100644 index 0000000000..a3285a2cc8 --- /dev/null +++ b/keyboards/handwired/tradestation/tradestation.c @@ -0,0 +1 @@ +#include "tradestation.h" diff --git a/keyboards/handwired/tradestation/tradestation.h b/keyboards/handwired/tradestation/tradestation.h new file mode 100644 index 0000000000..15e40e3b51 --- /dev/null +++ b/keyboards/handwired/tradestation/tradestation.h @@ -0,0 +1,27 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_4x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 } \ +} + +#define LAYOUT_tradestation( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K22, \ + K30, K32 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, KC_NO, K22, KC_NO }, \ + { K30, KC_NO, K32, KC_NO } \ +} diff --git a/keyboards/snagpad/config.h b/keyboards/snagpad/config.h new file mode 100644 index 0000000000..a14ead67fb --- /dev/null +++ b/keyboards/snagpad/config.h @@ -0,0 +1,56 @@ +#pragma once + +#include "config_common.h" + +/* USB Device descriptor parameter */ +#define VENDOR_ID 0xFEED +#define PRODUCT_ID 0x6060 +#define DEVICE_VER 0x0001 +#define MANUFACTURER Flehrad +#define PRODUCT Snagpad +#define DESCRIPTION A Pro Micro-Powered 5x4 macropad/numpad + +/* key matrix size */ +#define MATRIX_ROWS 5 +#define MATRIX_COLS 4 + +/* key matrix pins */ +#define MATRIX_ROW_PINS { D1, D0, D4, C6, D7 } +#define MATRIX_COL_PINS { F4, F5, F6, F7 } +#define UNUSED_PINS + +/* COL2ROW or ROW2COL */ +#define DIODE_DIRECTION COL2ROW + +/* number of backlight levels */ + +#ifdef BACKLIGHT_PIN +#define BACKLIGHT_LEVELS 3 +#endif + +/* Set 0 if debouncing isn't needed */ +#define DEBOUNCING_DELAY 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 + +/* key combination for command */ +#define IS_COMMAND() ( \ + keyboard_report->mods == (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) \ +) + +/* prevent stuck modifiers */ +//#define STRICT_LAYER_RELEASE + + +#ifdef RGB_DI_PIN +#define RGBLIGHT_ANIMATIONS +#define RGBLED_NUM 0 +#define RGBLIGHT_HUE_STEP 8 +#define RGBLIGHT_SAT_STEP 8 +#define RGBLIGHT_VAL_STEP 8 +#endif + diff --git a/keyboards/snagpad/info.json b/keyboards/snagpad/info.json new file mode 100644 index 0000000000..4faa1d2c0f --- /dev/null +++ b/keyboards/snagpad/info.json @@ -0,0 +1,17 @@ +{ + "keyboard_name": "Snagpad", + "url": "", + "maintainer": "Flehrad", + + "width": 4, + "height": 5, + "layouts": { + "LAYOUT_ortho_5x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}] + }, + "LAYOUT_numpad_5x4": { + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1, "h":2}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "h":2}, {"x":0, "y":4, "w":2}, {"x":2, "y":4}] + + } + } +} diff --git a/keyboards/snagpad/keymaps/default/keymap.c b/keyboards/snagpad/keymaps/default/keymap.c new file mode 100644 index 0000000000..7645b435c1 --- /dev/null +++ b/keyboards/snagpad/keymaps/default/keymap.c @@ -0,0 +1,63 @@ +#include QMK_KEYBOARD_H + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + + LAYOUT_ortho_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, KC_PPLS, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, KC_PENT, + KC_P0, KC_P0, KC_PDOT, KC_PENT), + + LAYOUT_numpad_5x4( + KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_P7, KC_P8, KC_P9, + KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_P1, KC_P2, KC_P3, + KC_P0, KC_PDOT, KC_PENT), +}; + + +void matrix_init_user(void) { +} + +void matrix_scan_user(void) { +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + return true; +} + +void led_set_user(uint8_t usb_led) { + + if (usb_led & (1 << USB_LED_NUM_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_COMPOSE)) { + + } else { + + } + + if (usb_led & (1 << USB_LED_KANA)) { + + } else { + + } + +} diff --git a/keyboards/snagpad/license b/keyboards/snagpad/license new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/keyboards/snagpad/license @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/keyboards/snagpad/readme.md b/keyboards/snagpad/readme.md new file mode 100644 index 0000000000..eeafceba9a --- /dev/null +++ b/keyboards/snagpad/readme.md @@ -0,0 +1,21 @@ +# Snagpad +QMK for Snagpad + +This PCB can be used as a standard numpad, or a ortho 5x4 macropad. + +For QMK Configurator, the info.json is utilised. +- For 2U keys on numpad, the first 1u row/column key assignment is the same as the 2u position. + +Build requires a pro micro. + +Can be built as single PCB with custom case, or as two PCB style with standoffs. + +If you like this simple PCB and want to make a donation, you can at https://paypal.me/theboardpodcast + +Check out our: + +YouTube (https://www.youtube.com/channel/UCg98oJZNffR9nDLJNkorjqw) + +Podcast (www.libsyn.com/theboardpodcast) + +Patreon (www.patreon.com/theboardpodcast) diff --git a/keyboards/snagpad/rules.mk b/keyboards/snagpad/rules.mk new file mode 100644 index 0000000000..624ed262ec --- /dev/null +++ b/keyboards/snagpad/rules.mk @@ -0,0 +1,65 @@ +# MCU name +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 = caterina + +# Boot Section Size in *bytes* +# OPT_DEFS += -DBOOTLOADER_SIZE=4096 + + +# Build Options +# comment out to disable the options. +# +BOOTMAGIC_ENABLE = yes # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # USB 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 +AUDIO_ENABLE = no +RGBLIGHT_ENABLE = no +LAYOUTS = ortho_5x4 numpad_5x4 diff --git a/keyboards/snagpad/snagpad.c b/keyboards/snagpad/snagpad.c new file mode 100644 index 0000000000..ce7e50b387 --- /dev/null +++ b/keyboards/snagpad/snagpad.c @@ -0,0 +1 @@ +#include "snagpad.h" diff --git a/keyboards/snagpad/snagpad.h b/keyboards/snagpad/snagpad.h new file mode 100644 index 0000000000..d6a62ddf7e --- /dev/null +++ b/keyboards/snagpad/snagpad.h @@ -0,0 +1,30 @@ +#pragma once + +#include "quantum.h" + +#define LAYOUT_ortho_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, K13, \ + K20, K21, K22, K23, \ + K30, K31, K32, K33, \ + K40, K41, K42, K43 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, K23 }, \ + { K30, K31, K32, K33 }, \ + { K40, K41, K42, K43 } \ +} +#define LAYOUT_numpad_5x4( \ + K00, K01, K02, K03, \ + K10, K11, K12, \ + K20, K21, K22, K13, \ + K30, K31, K32, \ + K40, K42, K33 \ +) { \ + { K00, K01, K02, K03 }, \ + { K10, K11, K12, K13 }, \ + { K20, K21, K22, KC_NO }, \ + { K30, K31, K32, K33 }, \ + { K40, KC_NO, K42, KC_NO } \ +} -- cgit v1.2.3 From 6cb2d7ba6dc19fe579fac856fbce36be0f8384f6 Mon Sep 17 00:00:00 2001 From: Gam3cat <31171909+Gam3cat@users.noreply.github.com> Date: Thu, 3 Jan 2019 08:12:58 -0800 Subject: Keymap updates (#4706) * adding my keymap * update keymap * adding gamecat keymap for jc65 keyboard * updating jc65-gamecat keymap * updating jc65-gamecat keymap * updating jc65-gamecat keymap * updating jc65-gamecat keymap * M10a keymap and M65a updates * keymap updates * keymap updates * M10a/M65a keymap updates * M10a/M65a keymap updates * Delete test.txt * M65 keymap update * M65 keymap update * M65 keymap update * M65/M10 keymap updates * M65 keymap update * M65 keymap update * M65 keymap update * M65 keymap update * M65 keymap update * M65/M10 keymap update * M65 keymap update * M65 keymap update * M65 keymap update * M65 keymap update * M65 keymap update * Set theme jekyll-theme-cayman * Set theme jekyll-theme-slate * M65 keymap update * M10a/M65a keymap updates * M10a keymap update * M65a keymap update * M65a keymap update * M65a keymap update * M65a readme update * M65a/M10a updates * M65a readme updates * M65a/M10a updates * M65A update * M65A update * M65A update * M65A update * M65A/M10A keymap update * M10A keymap update * Set theme jekyll-theme-tactile * M10A keymap update * M65A keymap.c update * M65 keymap added LED backlight toggle, inc/dec to adjust layer. * M65 keymap/readme updates. * M65 keymap fix * M65 keymap update * remove theme * fix comments/readme * update keymap * LED backlight update, guess based on reading atmega32u4 documentation for DDRB/PORTB regs, believe DDRB should only be written to once not every time CAPS is hit, but really not too sure. * LED backlight update, guess based on reading atmega32u4 documentation for DDRB/PORTB regs, believe DDRB should only be written to once not every time CAPS is hit, but really not too sure. * M65 keymap update * Updated M65, M10, and gonNerd keymaps. * update * del * keymap updates M65, M10, gonnerd * update keymaps * adding back readme that somehow got removed. * updated keymap * update keymap * add back readme * Added h87a keymap, updated m10a/jc65/gonnerd * Update h87a keymap * Updates after feedback * Updates after feedback * Updates after feedback * Updates after feedback --- keyboards/gonnerd/keymaps/gam3cat/config.h | 8 +- keyboards/gonnerd/keymaps/gam3cat/keymap.c | 351 ++++++++++++------------- keyboards/gonnerd/keymaps/gam3cat/readme.md | 106 ++++---- keyboards/gonnerd/keymaps/gam3cat/rules.mk | 27 +- keyboards/h87a/keymaps/gam3cat/config.h | 10 + keyboards/h87a/keymaps/gam3cat/keymap.c | 292 ++++++++++++++++++++ keyboards/h87a/keymaps/gam3cat/readme.md | 114 ++++++++ keyboards/h87a/keymaps/gam3cat/rules.mk | 24 ++ keyboards/jc65/v32u4/keymaps/gam3cat/config.h | 6 +- keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c | 229 ++++++++-------- keyboards/jc65/v32u4/keymaps/gam3cat/readme.md | 54 ++-- keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk | 30 ++- keyboards/m10a/keymaps/gam3cat/keymap.c | 199 +++++++------- keyboards/m10a/keymaps/gam3cat/readme.md | 10 +- keyboards/m10a/keymaps/gam3cat/rules.mk | 27 +- 15 files changed, 966 insertions(+), 521 deletions(-) create mode 100644 keyboards/h87a/keymaps/gam3cat/config.h create mode 100644 keyboards/h87a/keymaps/gam3cat/keymap.c create mode 100644 keyboards/h87a/keymaps/gam3cat/readme.md create mode 100644 keyboards/h87a/keymaps/gam3cat/rules.mk diff --git a/keyboards/gonnerd/keymaps/gam3cat/config.h b/keyboards/gonnerd/keymaps/gam3cat/config.h index d86da86e40..334beb0ac2 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/config.h +++ b/keyboards/gonnerd/keymaps/gam3cat/config.h @@ -1,6 +1,10 @@ -#include "../../config.h" +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. -#define GRAVE_ESC_CTRL_OVERRIDE +//#define GRAVE_ESC_CTRL_OVERRIDE //Delay matrix scan for tap dance, reduce to activate modifier keys faster. //#define TAPPING_TERM 200 diff --git a/keyboards/gonnerd/keymaps/gam3cat/keymap.c b/keyboards/gonnerd/keymaps/gam3cat/keymap.c index 3e43d67d50..f01dd920e7 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/keymap.c +++ b/keyboards/gonnerd/keymaps/gam3cat/keymap.c @@ -11,13 +11,16 @@ enum layers { _AL, // Adjust Layer }; -enum gonnerd_keycodes { +enum custom_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE, + QMK_REV, + KC_WEB, + KC_SP4 }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define FN_CAPS LT(_FL, KC_CAPS) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 @@ -25,47 +28,44 @@ enum gonnerd_keycodes { #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer, mostly standard TKL QWERTY layout. - * .-----------------------------------------------------------------------. - * |Esc||||| F1| F2| F3| F4||| F5| F6| F7| F8||| F9|F10|F11|F12|PSc|SLk|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| - * |-----------------------------------------------------------|-----------| - * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return | | - * |-----------------------------------------------------------|-----------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up| | - * |-----------------------------------------------------------|-----------| - * |Ctrl |||||Win | Space |RAlt |||||Ctrl |Lft|Dwn|Rgt| - * *-----------------------------------------------------------------------* + /*#### _BL: Base Layer - Standard TKL QWERTY layout. + * .-----------------------------------------------------------------------. + * |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|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 | | + * |-----------------------------------------------------------|-----------| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + * |-----------------------------------------------------------|-----------| + * |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + * *-----------------------------------------------------------------------* */ [_BL] = LAYOUT_tkl( \ 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_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, XXXXXXX, KC_ENT, \ + KC_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, XXXXXXX, KC_ENT, \ KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \ - KC_LCTL, KC_LALT, KC_LGUI, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ ), - - /* _WL: Workman Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| S| H| T| G| Y| N| E| O| I| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| M| C| V| K| L| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _WL: Workman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |H |T |G |Y |N |E |O |I |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_WL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -75,21 +75,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _NL: Norman Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| S| E| T| G| Y| N| I| O| H| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| C| V| B| P| M| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _NL: Norman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |E |T |G |Y |N |I |O |H |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_NL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -99,21 +98,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _DL: Dvorak Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | [| ]| | | | | - * |-----------------------------------------------------------|-----------| - * | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| O| E| U| I| D| H| T| N| S| -| | | - * |-----------------------------------------------------------|-----------| - * | | ;| Q| J| K| X| B| M| W| V| Z| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _DL: Dvorak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |[ |] | | | | | + * |-----------------------------------------------------------|-----------| + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |O |E |U |I |D |H |T |N |S |- | | | + * |-----------------------------------------------------------|-----------| + * | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_DL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -123,21 +121,20 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _CL: Colmak Layer. - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | -| =| | | | | - * |-----------------------------------------------------------|-----------| - * | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | | | - * |-----------------------------------------------------------|-----------| - * | | A| R| S| T| D| H| N| E| I| O| '| | | - * |-----------------------------------------------------------|-----------| - * | | Z| X| C| V| B| K| M| ,| .| /| | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _CL: Colmak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |R |S |T |D |H |N |E |I |O |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* */ [_CL] = LAYOUT_tkl( \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ @@ -147,142 +144,126 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ ), - - /* _FL: Function Layer. - * M0 opens Chrome - * .-----------------------------------------------------------------------. - * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | - * .-----------------------------------------------------------|-----------| - * | M0| | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * |Fn_AL| | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * |FnCaps| | | | | | |Lft|Dwn|Up |Rgt| | | | - * |-----------------------------------------------------------|-----------| - * | | | | | | | | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| |WBk| |WFw| - * *-----------------------------------------------------------------------* + /*#### _FL: Function Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + * .-----------------------------------------------------------|-----------| + * |Web| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * |Fn_AL| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | |Lft|Dwn|Up |Rgt| | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | SP4 | |Fn | |WBk| |WFw| + * *-----------------------------------------------------------------------* */ [_FL] = LAYOUT_tkl( \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, \ - M(0), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_WEB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ - XXXXXXX, XXXXXXX, KC_MENU, M(1), XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ ), - - /* _AL: Adjust Layer. - * Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. - * .-----------------------------------------------------------------------. - * |Rst||||| | | | ||| | | | ||| | | | | | | | - * .-----------------------------------------------------------|-----------| - * |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| - * |-----------------------------------------------------------|-----------| - * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| - * |-----------------------------------------------------------|-----------| - * |FnCaps| | |_DL| | | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | | | |_CL| |_BL|_NL| | | | | | | | | | - * |-----------------------------------------------------------|-----------| - * | ||||| | | ||||| | | | | - * *-----------------------------------------------------------------------* + /*#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + * .-----------------------------------------------------------------------. + * |Rst||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + * |-----------------------------------------------------------|-----------| + * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + * |-----------------------------------------------------------|-----------| + * | | | |_DL| | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | |Fn | | | | | + * *-----------------------------------------------------------------------* */ [_AL] = LAYOUT_tkl( \ RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ - F(0), RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, KC_DMR2, KC_DMP2, \ - _______, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ - _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(0), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe\n"); - return false; } - break; - case 1: + return false; + break; + case KC_SP4: if (record->event.pressed) { - return MACRO(I(0), T(SPC), T(SPC), T(SPC), T(SPC), END); + SEND_STRING (" "); } - else { - return false; - } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[QMK:" QMK_KEYBOARD ":" QMK_KEYMAP ":" QMK_VERSION "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - break; - case 1: - backlight_level(1); - break; - case 2: - backlight_level(1); - break; - case 3: - backlight_level(1); - break; - case 4: - backlight_level(1); - break; - case 5: - backlight_level(2); - break; - case 6: - backlight_level(3); - break; - default: - backlight_level(0); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + break; + case _WL: + case _NL: + case _DL: + case _CL: + custom_backlight_level(1); + break; + case _FL: + custom_backlight_level(2); + break; + case _AL: + custom_backlight_level(3); + break; + default: + custom_backlight_level(0); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/gonnerd/keymaps/gam3cat/readme.md b/keyboards/gonnerd/keymaps/gam3cat/readme.md index 181369790a..8630ea2966 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/readme.md +++ b/keyboards/gonnerd/keymaps/gam3cat/readme.md @@ -1,120 +1,114 @@ # Keymap Maintainer: Gam3cat make gonnerd:gam3cat ## Layout Config: -2u backspace, 2.25u left shift/enter, 1.75u right shift. -2x1.5u, 1x7.0u, 2x1.5u, 3x1u bottom row. - - FN_CAPS = MO(_FL) when held, CAPS when tapped. - GRAVE_ESC + GUI = ` - GRAVE_ESC + SHIFT = ~ +2u backspace, 2.25u lshift/enter, [2.75u rshift] or [1.75u rshift, 1u Fn]. +[1.5u, 1u, 1.5u 1x7.0u, 1.5u, 1u, 1.5u, 3x1u] or [2x1.5u, 1x7.0u, 2x1.5u, 3x1u] bottom row. ## Base Layer Selection: -(Caps+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak +(Fn+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak ### Base Layer Options: - _BL: Base Layer, mostly standard TKL QWERTY layout. +#### _BL: Base Layer - Standard TKL QWERTY layout. .-----------------------------------------------------------------------. - |Esc||||| F1| F2| F3| F4||| F5| F6| F7| F8||| F9|F10|F11|F12|PSc|SLk|Pau| + |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|Pau| |-----------------------------------------------------------|-----------| - | ~| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins|Hom|PgU| + |~ |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| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del|End|PgD| |-----------------------------------------------------------|-----------| - |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return | | + |Caps |A |S |D |F |G |H |J |K |L |; |' |Return | | |-----------------------------------------------------------|-----------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift | | Up| | + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | |-----------------------------------------------------------|-----------| - |Ctrl |||||Win | Space |RAlt |||||Ctrl |Lft|Dwn|Rgt| + |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| *-----------------------------------------------------------------------* - - _WL: Workman Layer. + +#### _WL: Workman Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | | | + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| S| H| T| G| Y| N| E| O| I| '| | | + | |A |S |H |T |G |Y |N |E |O |I |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| M| C| V| K| L| ,| .| /| | | | | | + | |Z |X |M |C |V |K |L |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _NL: Norman Layer. + +#### _NL: Norman Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | | | + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| S| E| T| G| Y| N| I| O| H| '| | | + | |A |S |E |T |G |Y |N |I |O |H |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| C| V| B| P| M| ,| .| /| | | | | | + | |Z |X |C |V |B |P |M |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _DL: Dvorak Layer. + +#### _DL: Dvorak Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | [| ]| | | | | + | | | | | | | | | | | |[ |] | | | | | |-----------------------------------------------------------|-----------| - | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | | | + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | |-----------------------------------------------------------|-----------| - | | A| O| E| U| I| D| H| T| N| S| -| | | + | |A |O |E |U |I |D |H |T |N |S |- | | | |-----------------------------------------------------------|-----------| - | | ;| Q| J| K| X| B| M| W| V| Z| | | | | | + | |; |Q |J |K |X |B |M |W |V |Z | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _CL: Colmak Layer. + +#### _CL: Colmak Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - | | | | | | | | | | | | -| =| | | | | + | | | | | | | | | | | |- |= | | | | | |-----------------------------------------------------------|-----------| - | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | | | + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | |-----------------------------------------------------------|-----------| - | | A| R| S| T| D| H| N| E| I| O| '| | | + | |A |R |S |T |D |H |N |E |I |O |' | | | |-----------------------------------------------------------|-----------| - | | Z| X| C| V| B| K| M| ,| .| /| | | | | | + | |Z |X |C |V |B |K |M |, |. |/ | | | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | | | | | | | *-----------------------------------------------------------------------* - - _FL: Function Layer. - M0 opens Chrome + +#### _FL: Function Layer. .-----------------------------------------------------------------------. | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | .-----------------------------------------------------------|-----------| - | M0| | | | | | | | | | | | | | | | | + |Web| | | | | | | | | | | | | | | | | |-----------------------------------------------------------|-----------| - | | | | | | | | | | | | | | | | | | + |Fn_AL| | | | | | | | | | | | | | | | | |-----------------------------------------------------------|-----------| | | | | | | | |Lft|Dwn|Up |Rgt| | | | |-----------------------------------------------------------|-----------| - | | | | | | | | | | | | | | | | | + | | | | | | | | | | | | |Fn | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| |WBk| |WFw| + | | | | SP4 | |Fn | |WBk| |WFw| *-----------------------------------------------------------------------* - - _AL: Adjust Layer. - Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. + +#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. .-----------------------------------------------------------------------. |Rst||||| | | | ||| | | | ||| | | | | | | | .-----------------------------------------------------------|-----------| - |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| |-----------------------------------------------------------|-----------| |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| |-----------------------------------------------------------|-----------| - |FnCaps| | |_DL| | | | | | | | | | | + | | | |_DL| | | | | | | | | | | |-----------------------------------------------------------|-----------| - | | | |_CL| |_BL|_NL| | | | | | | | | | + | | | |_CL| |_BL|_NL| | | | | |Fn | | | | |-----------------------------------------------------------|-----------| - | ||||| | | ||||| | | | | + | | | | | |Fn | | | | | *-----------------------------------------------------------------------* diff --git a/keyboards/gonnerd/keymaps/gam3cat/rules.mk b/keyboards/gonnerd/keymaps/gam3cat/rules.mk index a226838424..6eab033cc0 100644 --- a/keyboards/gonnerd/keymaps/gam3cat/rules.mk +++ b/keyboards/gonnerd/keymaps/gam3cat/rules.mk @@ -2,20 +2,23 @@ # change to "no" to disable the options, or define them in the Makefile in # the appropriate keymap folder that will get included automatically # +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = yes # Mouse keys(+4700) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) 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 = yes # Enable keyboard backlight functionality +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality MIDI_ENABLE = no # MIDI controls -AUDIO_ENABLE = no # Audio output on port C6 UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID -RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. -SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend - -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/h87a/keymaps/gam3cat/config.h b/keyboards/h87a/keymaps/gam3cat/config.h new file mode 100644 index 0000000000..334beb0ac2 --- /dev/null +++ b/keyboards/h87a/keymaps/gam3cat/config.h @@ -0,0 +1,10 @@ +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + +//GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. +//#define GRAVE_ESC_CTRL_OVERRIDE + +//Delay matrix scan for tap dance, reduce to activate modifier keys faster. +//#define TAPPING_TERM 200 diff --git a/keyboards/h87a/keymaps/gam3cat/keymap.c b/keyboards/h87a/keymaps/gam3cat/keymap.c new file mode 100644 index 0000000000..2a4e5ca410 --- /dev/null +++ b/keyboards/h87a/keymaps/gam3cat/keymap.c @@ -0,0 +1,292 @@ +#include QMK_KEYBOARD_H +#include "version.h" + +enum layers { + _BL = 0, // Base Layer + _WL, // Workman Layer + _NL, // Norman Layer + _DL, // Dvorak Layer + _CL, // Base Layer + _FL, // Function Layer + _AL, // Adjust Layer +}; + +enum custom_keycodes { + DYNAMIC_MACRO_RANGE = SAFE_RANGE, + QMK_REV, + KC_WEB, + KC_SP4 +}; + +extern backlight_config_t backlight_config; + +#include "dynamic_macro.h" +#define FN_CAPS LT(_FL, KC_CAPS) +#define KC_DMR1 DYN_REC_START1 +#define KC_DMR2 DYN_REC_START2 +#define KC_DMP1 DYN_MACRO_PLAY1 +#define KC_DMP2 DYN_MACRO_PLAY2 +#define KC_DMRS DYN_REC_STOP + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + /*#### _BL: Base Layer - Standard TKL QWERTY layout. + * .-----------------------------------------------------------------------. + * |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|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 | | + * |-----------------------------------------------------------|-----------| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + * |-----------------------------------------------------------|-----------| + * |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + * *-----------------------------------------------------------------------* + */ + [_BL] = LAYOUT_all( \ + 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_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_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, XXXXXXX, KC_ENT, \ + KC_LSFT, XXXXXXX, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, MO(_FL), KC_UP, \ + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RGUI, KC_RALT, MO(_FL), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT \ + ), + /*#### _WL: Workman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |H |T |G |Y |N |E |O |I |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_WL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_D , KC_R , KC_W , KC_B , KC_J , KC_F , KC_U , KC_P , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_S , KC_H , KC_T , KC_G , KC_Y , KC_N , KC_E , KC_O , KC_I , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _NL: Norman Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |S |E |T |G |Y |N |I |O |H |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_NL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_W , KC_D , KC_F , KC_K , KC_J , KC_U , KC_R , KC_L , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_S , KC_E , KC_T , KC_G , KC_Y , KC_N , KC_I , KC_O , KC_H , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _DL: Dvorak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |[ |] | | | | | + * |-----------------------------------------------------------|-----------| + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |O |E |U |I |D |H |T |N |S |- | | | + * |-----------------------------------------------------------|-----------| + * | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_DL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_LBRC, KC_RBRC, _______, _______, _______, _______, _______, \ + _______, 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_A , KC_O , KC_E , KC_U , KC_I , KC_D , KC_H , KC_T , KC_N , KC_S , KC_MINS, _______, _______, \ + _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _CL: Colmak Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * | | | | | | | | | | | |- |= | | | | | + * |-----------------------------------------------------------|-----------| + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + * |-----------------------------------------------------------|-----------| + * | |A |R |S |T |D |H |N |E |I |O |' | | | + * |-----------------------------------------------------------|-----------| + * | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | + * *-----------------------------------------------------------------------* + */ + [_CL] = LAYOUT_all( \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \ + _______, KC_Q , KC_W , KC_F , KC_P , KC_G , KC_J , KC_L , KC_U , KC_Y , KC_SCLN, _______, _______, _______, _______, _______, _______, \ + _______, KC_A , KC_R , KC_S , KC_T , KC_D , KC_H , KC_N , KC_E , KC_I , KC_O , _______, _______, _______, \ + _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, \ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ \ + ), + /*#### _FL: Function Layer. + * .-----------------------------------------------------------------------. + * | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + * .-----------------------------------------------------------|-----------| + * |Web| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * |Fn_AL| | | | | | | | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | |Lft|Dwn|Up |Rgt| | | | + * |-----------------------------------------------------------|-----------| + * | | | | | | | | | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | SP4 | |Fn | |WBk| |WFw| + * *-----------------------------------------------------------------------* + */ + [_FL] = LAYOUT_all( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLD, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, \ + KC_WEB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, XXXXXXX, _______, XXXXXXX, XXXXXXX, KC_WBAK, XXXXXXX, KC_WFWD \ + ), + /*#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + * .-----------------------------------------------------------------------. + * |Rst||||| | | | ||| | | | ||| | | | | | | | + * .-----------------------------------------------------------|-----------| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + * |-----------------------------------------------------------|-----------| + * |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + * |-----------------------------------------------------------|-----------| + * | | | |_DL| | | | | | | | | | | + * |-----------------------------------------------------------|-----------| + * | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + * |-----------------------------------------------------------|-----------| + * | | | | | |Fn | | | | | + * *-----------------------------------------------------------------------* + */ + [_AL] = LAYOUT_all( \ + RESET, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR1, KC_DMP1, \ + _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, KC_DMR2, KC_DMP2, \ + XXXXXXX, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \ + ), +}; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); + } + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); + SEND_STRING("chrome.exe\n"); + } + return false; + break; + case KC_SP4: + if (record->event.pressed) { + SEND_STRING (" "); + } + return false; + break; + } + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; + } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); +} + +void matrix_init_user(void) { + #ifdef BACKLIGHT_ENABLE + custom_backlight_level(0); + #endif + #ifdef RGBLIGHT_ENABLE + rgblight_mode(1); + rgblight_sethsv_noeeprom(180,100,100); + #endif +} + +void matrix_scan_user(void) { + +} + +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,255); + break; + case _WL: + case _NL: + case _DL: + case _CL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(230,255,255); + break; + case _FL: + custom_backlight_level(2); + rgblight_sethsv_noeeprom(280,255,255); + break; + case _AL: + custom_backlight_level(3); + rgblight_sethsv_noeeprom(350,255,255); + break; + default: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,100); + break; + } + return state; +} + +void led_init_ports(void) { + DDRD |= (1<<5); // OUT + DDRE |= (1<<6); // OUT +} + +void led_set_user(uint8_t usb_led) { + if (usb_led & (1 << USB_LED_CAPS_LOCK)) { + DDRD |= (1 << 5); PORTD &= ~(1 << 5); + } else { + DDRD &= ~(1 << 5); PORTD &= ~(1 << 5); + } + if (usb_led & (1 << USB_LED_SCROLL_LOCK)) { + DDRE |= (1 << 6); PORTE &= ~(1 << 6); + } else { + DDRE &= ~(1 << 6); PORTE &= ~(1 << 6); + } +} diff --git a/keyboards/h87a/keymaps/gam3cat/readme.md b/keyboards/h87a/keymaps/gam3cat/readme.md new file mode 100644 index 0000000000..5eb4c7d611 --- /dev/null +++ b/keyboards/h87a/keymaps/gam3cat/readme.md @@ -0,0 +1,114 @@ +# Keymap Maintainer: Gam3cat +make h87a:gam3cat +## Layout Config: +2u backspace, 2.25u lshift/enter, [2.75u rshift] or [1.75u rshift, 1u Fn]. +[1.5u, 1u, 1.5u 1x7.0u, 1.5u, 1u, 1.5u, 3x1u] or [2x1.5u, 1x7.0u, 2x1.5u, 3x1u] bottom row. + +## Base Layer Selection: +(Fn+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak + +### Base Layer Options: +#### _BL: Base Layer - Standard TKL QWERTY layout. + .-----------------------------------------------------------------------. + |Esc|||||F1 |F2 |F3 |F4 |||F5 |F6 |F7 |F8 |||F9 |F10|F11|F12|PSc|SLk|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 | | + |-----------------------------------------------------------|-----------| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Fn | | Up| | + |-----------------------------------------------------------|-----------| + |Ctrl |Win|Alt | Space |RAlt |Fn |Ctrl |Lft|Dwn|Rgt| + *-----------------------------------------------------------------------* + +#### _WL: Workman Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |S |H |T |G |Y |N |E |O |I |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |M |C |V |K |L |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _NL: Norman Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |S |E |T |G |Y |N |I |O |H |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |C |V |B |P |M |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _DL: Dvorak Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |[ |] | | | | | + |-----------------------------------------------------------|-----------| + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |O |E |U |I |D |H |T |N |S |- | | | + |-----------------------------------------------------------|-----------| + | |; |Q |J |K |X |B |M |W |V |Z | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _CL: Colmak Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + | | | | | | | | | | | |- |= | | | | | + |-----------------------------------------------------------|-----------| + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | | | + |-----------------------------------------------------------|-----------| + | |A |R |S |T |D |H |N |E |I |O |' | | | + |-----------------------------------------------------------|-----------| + | |Z |X |C |V |B |K |M |, |. |/ | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | + *-----------------------------------------------------------------------* + +#### _FL: Function Layer. + .-----------------------------------------------------------------------. + | ||||| | | | ||| | | | ||| |VlM|VlD|VlU| | | | + .-----------------------------------------------------------|-----------| + |Web| | | | | | | | | | | | | | | | | + |-----------------------------------------------------------|-----------| + |Fn_AL| | | | | | | | | | | | | | | | | + |-----------------------------------------------------------|-----------| + | | | | | | | |Lft|Dwn|Up |Rgt| | | | + |-----------------------------------------------------------|-----------| + | | | | | | | | | | | | |Fn | | | | + |-----------------------------------------------------------|-----------| + | | | | SP4 | |Fn | |WBk| |WFw| + *-----------------------------------------------------------------------* + +#### _AL: Adjust Layer - Keymap select, LED backlight, and Dynamic Macro settings. + .-----------------------------------------------------------------------. + |Rst||||| | | | ||| | | | ||| | | | | | | | + .-----------------------------------------------------------|-----------| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| | |MR1|MP1| + |-----------------------------------------------------------|-----------| + |Fn_AL|_BL|_WL| | | | | | | | | | | | MS|MR2|MP2| + |-----------------------------------------------------------|-----------| + | | | |_DL| | | | | | | | | | | + |-----------------------------------------------------------|-----------| + | | | |_CL| |_BL|_NL| | | | | |Fn | | | | + |-----------------------------------------------------------|-----------| + | | | | | |Fn | | | | | + *-----------------------------------------------------------------------* diff --git a/keyboards/h87a/keymaps/gam3cat/rules.mk b/keyboards/h87a/keymaps/gam3cat/rules.mk new file mode 100644 index 0000000000..85b2b41a6b --- /dev/null +++ b/keyboards/h87a/keymaps/gam3cat/rules.mk @@ -0,0 +1,24 @@ +# 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 +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h index d86da86e40..e4df94be70 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/config.h +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/config.h @@ -1,4 +1,8 @@ -#include "../../config.h" +#pragma once + +//Force NKRO to be enabled. +#define FORCE_NKRO + //GRAVE_ESC override for CTRL+SHIFT+ESC Windows task manager shortcut. #define GRAVE_ESC_CTRL_OVERRIDE diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c b/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c index af45fb608f..aa5709a373 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/keymap.c @@ -11,13 +11,16 @@ enum layers { _AL, // Adjust Layer }; -enum jc65_keycodes { +enum custom_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE, + QMK_REV, + KC_WEB, + KC_SP4 }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO #define FN_CAPS LT(_FL, KC_CAPS) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 @@ -25,18 +28,16 @@ enum jc65_keycodes { #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* _BL: Base Layer, mostly standard 65% QWERTY layout. + /*#### _BL: Base Layer - Mostly standard 65% QWERTY layout. * .---------------------------------------------------------------. - * |GrE| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins| + * |GrE|1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins| * |---------------------------------------------------------------| - * |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del| + * |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del| * |---------------------------------------------------------------| - * |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return |PgU| + * |FnCaps|A |S |D |F |G |H |J |K |L |; |' |Return |PgU| * |---------------------------------------------------------------| - * |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD| + * |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD| * |---------------------------------------------------------------| * |Ctrl|Gui |Alt | Space |RAlt |Ctrl |Lft|Dwn|Rgt| * *---------------------------------------------------------------* @@ -48,16 +49,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LSFT, XXXXXXX, 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_PGDN, KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_SPC, KC_SPC, KC_RALT, KC_RGUI, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT ), - - /* _WL: Workman Layer. + /*#### _WL: Workman Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | + * | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| S| H| T| G| Y| N| E| O| I| '| | | + * | |A |S |H |T |G |Y |N |E |O |I |' | | | * |---------------------------------------------------------------| - * | | Z| X| M| C| V| K| L| ,| .| /| | | | + * | |Z |X |M |C |V |K |L |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -69,16 +69,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_M , KC_C , KC_V , KC_K , KC_L , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _NL: Norman Layer. + /*#### _NL: Norman Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | + * | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| S| E| T| G| Y| N| I| O| H| '| | | + * | |A |S |E |T |G |Y |N |I |O |H |' | | | * |---------------------------------------------------------------| - * | | Z| X| C| V| B| P| M| ,| .| /| | | | + * | |Z |X |C |V |B |P |M |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -90,16 +89,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_P , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _DL: Dvorak Layer. + /*#### _DL: Dvorak Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | [| ]| | | + * | | | | | | | | | | | |[ |] | | | * |---------------------------------------------------------------| - * | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | + * | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | * |---------------------------------------------------------------| - * | | A| O| E| U| I| D| H| T| N| S| -| | | + * | |A |O |E |U |I |D |H |T |N |S |- | | | * |---------------------------------------------------------------| - * | | ;| Q| J| K| X| B| M| W| V| Z| | | | + * | |; |Q |J |K |X |B |M |W |V |Z | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -111,16 +109,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_SCLN, KC_Q , KC_J , KC_K , KC_X , KC_B , KC_M , KC_W , KC_V , KC_Z , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _CL: Colmak Layer. + /*#### _CL: Colmak Layer. * .---------------------------------------------------------------. - * | | | | | | | | | | | | -| =| | | + * | | | | | | | | | | | |- |= | | | * |---------------------------------------------------------------| - * | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | + * | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | * |---------------------------------------------------------------| - * | | A| R| S| T| D| H| N| E| I| O| '| | | + * | |A |R |S |T |D |H |N |E |I |O |' | | | * |---------------------------------------------------------------| - * | | Z| X| C| V| B| K| M| ,| .| /| | | | + * | |Z |X |C |V |B |K |M |, |. |/ | | | | * |---------------------------------------------------------------| * | | | | | | | | | | * *---------------------------------------------------------------* @@ -132,11 +129,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { _______, _______, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_K , KC_M , KC_COMM, KC_DOT , KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ ), - - /* _FL: Function Layer. - * M0 opens Chrome + /*#### _FL: Function Layer. * .---------------------------------------------------------------. - * |M0 | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|SLock |PSc| + * |Web|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|SLock |PSc| * |---------------------------------------------------------------| * |Fn_AL| | | | | | | | | | | | | |Pau| * |---------------------------------------------------------------| @@ -144,21 +139,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * |---------------------------------------------------------------| * | | | | | | | | | | | |VlMute|VlU|End| * |---------------------------------------------------------------| - * | | |Menu| | | |WBk|VlD|WFw| + * | | |Menu| SP4 | | |WBk|VlD|WFw| * *---------------------------------------------------------------* */ [_FL] = LAYOUT( - M(0), KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_SLCK, KC_PSCR, + KC_WEB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, XXXXXXX, KC_SLCK, KC_PSCR, MO(_AL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, KC_VOLU, KC_END, - XXXXXXX, XXXXXXX, KC_MENU, M(1), M(1), M(1), XXXXXXX, XXXXXXX, XXXXXXX, KC_WBAK, KC_VOLD, KC_WFWD + XXXXXXX, XXXXXXX, KC_MENU, KC_SP4, KC_SP4, KC_SP4, XXXXXXX, XXXXXXX, XXXXXXX, KC_WBAK, KC_VOLD, KC_WFWD ), - - /* _AL: Adjust Layer. - * Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. + /*#### _AL: Adjust Layer - Keymap select, RGB Underglow, LED backlight, and Dynamic Macro settings. * .---------------------------------------------------------------. - * |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| + * |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| * |---------------------------------------------------------------| * |Fn_AL|_BL|_WL| | | | | | | | | | | |MR1| * |---------------------------------------------------------------| @@ -170,7 +163,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * *---------------------------------------------------------------* */ [_AL] = LAYOUT( - F(0), RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMP1, + QMK_REV, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, XXXXXXX, BL_TOGG, BL_DEC, BL_INC, XXXXXXX, XXXXXXX, KC_DMP1, _______, DF(_BL), DF(_WL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR1, _______, XXXXXXX, XXXXXXX, DF(_DL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMRS, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, DF(_CL), XXXXXXX, DF(_BL), DF(_NL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_DMR2, @@ -178,102 +171,96 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { ), }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(0), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe https://geekhack.org/index.php?topic=86756.new;topicseen#new\n"); - return false; } - break; - case 1: + return false; + break; + case KC_SP4: if (record->event.pressed) { - return MACRO(I(0), T(SPC), T(SPC), T(SPC), T(SPC), END); + SEND_STRING (" "); } - else { - return false; - } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[QMK:" QMK_KEYBOARD ":" QMK_KEYMAP ":" QMK_VERSION "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif #ifdef RGBLIGHT_ENABLE rgblight_mode(1); - rgblight_sethsv(180,100,100); + rgblight_sethsv_noeeprom(180,100,100); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - rgblight_sethsv(180,100,255); - break; - case 1: - backlight_level(1); - rgblight_sethsv(180,95,240); - break; - case 2: - backlight_level(1); - rgblight_sethsv(180,90,225); - break; - case 3: - backlight_level(1); - rgblight_sethsv(180,85,210); - break; - case 4: - backlight_level(1); - rgblight_sethsv(180,80,195); - break; - case 5: - backlight_level(2); - rgblight_sethsv(230,255,255); - break; - case 6: - backlight_level(3); - rgblight_sethsv(350,255,255); - break; - default: - backlight_level(0); - rgblight_sethsv(180,100,100); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _BL: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,255); + break; + case _WL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,95,240); + break; + case _NL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,90,225); + break; + case _DL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,85,210); + break; + case _CL: + custom_backlight_level(1); + rgblight_sethsv_noeeprom(180,80,195); + break; + case _FL: + custom_backlight_level(2); + rgblight_sethsv_noeeprom(230,255,255); + break; + case _AL: + custom_backlight_level(3); + rgblight_sethsv_noeeprom(350,255,255); + break; + default: + custom_backlight_level(0); + rgblight_sethsv_noeeprom(180,100,100); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md b/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md index 88b65dbbb7..e79ce4ff7f 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/readme.md @@ -13,76 +13,74 @@ make jc65/v32u4:gam3cat (Caps+TAB+( )): (Q)WERTY, (W)orkman, (N)orman, (D)vorak, (C)olmak ### Base Layer Options: -#### _BL: Base Layer, mostly standard 65% QWERTY layout. +#### _BL: Base Layer - Mostly standard 65% QWERTY layout. .---------------------------------------------------------------. - |GrE| 1| 2| 3| 4| 5| 6| 7| 8| 9| 0| -| =|Backsp |Ins| + |GrE|1 |2 |3 |4 |5 |6 |7 |8 |9 |0 |- |= |Backsp |Ins| |---------------------------------------------------------------| - |Tab | Q| W| E| R| T| Y| U| I| O| P| [| ]| \|Del| + |Tab |Q |W |E |R |T |Y |U |I |O |P |[ |] |\ |Del| |---------------------------------------------------------------| - |FnCaps| A| S| D| F| G| H| J| K| L| ;| '|Return |PgU| + |FnCaps|A |S |D |F |G |H |J |K |L |; |' |Return |PgU| |---------------------------------------------------------------| - |Shift | Z| X| C| V| B| N| M| ,| .| /|Shift |Up |PgD| + |Shift |Z |X |C |V |B |N |M |, |. |/ |Shift |Up |PgD| |---------------------------------------------------------------| |Ctrl|Gui |Alt | Space |RAlt |Ctrl |Lft|Dwn|Rgt| *---------------------------------------------------------------* #### _WL: Workman Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| D| R| W| B| J| F| U| P| ;| [| ]| \| | + | |Q |D |R |W |B |J |F |U |P |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| S| H| T| G| Y| N| E| O| I| '| | | + | |A |S |H |T |G |Y |N |E |O |I |' | | | |---------------------------------------------------------------| - | | Z| X| M| C| V| K| L| ,| .| /| | | | + | |Z |X |M |C |V |K |L |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _NL: Norman Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| W| D| F| K| J| U| R| L| ;| [| ]| \| | + | |Q |W |D |F |K |J |U |R |L |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| S| E| T| G| Y| N| I| O| H| '| | | + | |A |S |E |T |G |Y |N |I |O |H |' | | | |---------------------------------------------------------------| - | | Z| X| C| V| B| P| M| ,| .| /| | | | + | |Z |X |C |V |B |P |M |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _DL: Dvorak Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | [| ]| | | + | | | | | | | | | | | |[ |] | | | |---------------------------------------------------------------| - | | '| ,| .| P| Y| F| G| C| R| L| /| =| \| | + | |' |, |. |P |Y |F |G |C |R |L |/ |= |\ | | |---------------------------------------------------------------| - | | A| O| E| U| I| D| H| T| N| S| -| | | + | |A |O |E |U |I |D |H |T |N |S |- | | | |---------------------------------------------------------------| - | | ;| Q| J| K| X| B| M| W| V| Z| | | | + | |; |Q |J |K |X |B |M |W |V |Z | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* #### _CL: Colmak Layer. .---------------------------------------------------------------. - | | | | | | | | | | | | -| =| | | + | | | | | | | | | | | |- |= | | | |---------------------------------------------------------------| - | | Q| W| F| P| G| J| L| U| Y| ;| [| ]| \| | + | |Q |W |F |P |G |J |L |U |Y |; |[ |] |\ | | |---------------------------------------------------------------| - | | A| R| S| T| D| H| N| E| I| O| '| | | + | |A |R |S |T |D |H |N |E |I |O |' | | | |---------------------------------------------------------------| - | | Z| X| C| V| B| K| M| ,| .| /| | | | + | |Z |X |C |V |B |K |M |, |. |/ | | | | |---------------------------------------------------------------| | | | | | | | | | | *---------------------------------------------------------------* -### Function Layer: (hold Caps to access) - M0 opens Chrome #### _FL: Function Layer. .---------------------------------------------------------------. - |M0 | F1| F2| F3| F4| F5| F6| F7| F8| F9|F10|F11|F12|SLock |PSc| + |Web|F1 |F2 |F3 |F4 |F5 |F6 |F7 |F8 |F9 |F10|F11|F12|SLock |PSc| |---------------------------------------------------------------| |Fn_AL| | | | | | | | | | | | | |Pau| |---------------------------------------------------------------| @@ -90,14 +88,12 @@ make jc65/v32u4:gam3cat |---------------------------------------------------------------| | | | | | | | | | | | |VlMute|VlU|End| |---------------------------------------------------------------| - | | |Menu| | | |WBk|VlD|WFw| + | | |Menu| SP4 | | |WBk|VlD|WFw| *---------------------------------------------------------------* -### Adjust Layer: (hold Caps+TAB to access) - Default keymap, RGB Underglow, LED backlight, and Dynamic Macro settings. -#### _AL: Adjust Layer. +#### _AL: Adjust Layer - Keymap select, RGB Underglow, LED backlight, and Dynamic Macro settings. .---------------------------------------------------------------. - |Ver|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| + |Rev|Tog|Mod|H- |H+ |S- |S+ |V- |V+ | |BLT|BL-|BL+| |MP1| |---------------------------------------------------------------| |Fn_AL|_BL|_WL| | | | | | | | | | | |MR1| |---------------------------------------------------------------| diff --git a/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk b/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk index c0a3ac69c3..85b2b41a6b 100644 --- a/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk +++ b/keyboards/jc65/v32u4/keymaps/gam3cat/rules.mk @@ -1,6 +1,24 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif - -BACKLIGHT_ENABLE=yes -//TAP_DANCE_ENABLE=yes +# 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 +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = yes # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = no # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common diff --git a/keyboards/m10a/keymaps/gam3cat/keymap.c b/keyboards/m10a/keymaps/gam3cat/keymap.c index 8f4c878da5..8ee35d50ab 100644 --- a/keyboards/m10a/keymaps/gam3cat/keymap.c +++ b/keyboards/m10a/keymaps/gam3cat/keymap.c @@ -1,6 +1,4 @@ -#include "m10a.h" -#include "action_layer.h" -#include "eeconfig.h" +#include QMK_KEYBOARD_H #include "version.h" extern keymap_config_t keymap_config; @@ -18,46 +16,48 @@ enum layers { _L9 }; -enum m10a_keycodes { +enum custom_keycodes { DYNAMIC_MACRO_RANGE = SAFE_RANGE, + QMK_REV, + KC_WEB, + KC_WCLS }; +extern backlight_config_t backlight_config; + #include "dynamic_macro.h" -#define _______ KC_TRNS -#define XXXXXXX KC_NO -#define FN_ZERO LT(_L9, KC_0) +#define FN_ZERO LT(_L9, KC_KP_0) #define KC_DMR1 DYN_REC_START1 #define KC_DMR2 DYN_REC_START2 #define KC_DMP1 DYN_MACRO_PLAY1 #define KC_DMP2 DYN_MACRO_PLAY2 #define KC_DMRS DYN_REC_STOP -static uint8_t current_layer; - const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* .-----------. .-----------. .-----------. .-----------. .-----------. - * | 7| 8| 9| | +| -| *| | ^| &| !| |VLU|Ver|WFD| |VLU|NXT|FFD| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | 4| 5| 6| | /| %| ,| | D| E| F| |MUT|C-W|CHR| |MUT|STP|PLY| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | 1| 2| 3| | .| =|Ent| | A| B| C| |VLD|CMP|WBK| |VLD|PRV|RWD| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * |L0 | _L9/0| |L1 | _L9 | |L2 | _L9 | |L3 | _L9 | |L4 | _L9 | - * *-----------* *-----------* *-----------* *-----------* *-----------* - * .-----------. .-----------. .-----------. .-----------. .-----------. - * | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | | | | | | | | | |MRS| | | | | | |_L3|_L4|_L5| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| - * |-----------| |-----------| |-----------| |-----------| |-----------| - * |L5 | _L9 | |L6 | _L9 | |L7 | _L9 | |L8 | _L9 | |L9 | | - * *-----------* *-----------* *-----------* *-----------* *-----------* + /*## Layout Config: + * .-----------. .-----------. .-----------. .-----------. .-----------. + * |7 |8 |9 | |+ |- |* | |^ |& |! | |VLU|Ver|WFD| |VLU|NXT|FFD| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |4 |5 |6 | |/ |% |, | |D |E |F | |MUT|C-W|CHR| |MUT|STP|PLY| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |1 |2 |3 | |. |= |Ent| |A |B |C | |VLD|CMP|WBK| |VLD|PRV|RWD| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |#L0|_L9/0 | |#L1|_L9 | |#L2|_L9 | |#L3|_L9 | |#L4|_L9 | + * *-----------* *-----------* *-----------* *-----------* *-----------* + * .-----------. .-----------. .-----------. .-----------. .-----------. + * | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * | | | | | | | | | |MRS| | | | | | |_L3|_L4|_L5| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| + * |-----------| |-----------| |-----------| |-----------| |-----------| + * |#L5|_L9 | |#L6|_L9 | |#L7|_L9 | |#L8|_L9 | |#L9| | + * *-----------* *-----------* *-----------* *-----------* *-----------* */ - [_L0] = {{KC_7, KC_8, KC_9 }, {KC_4, KC_5, KC_6 }, {KC_1, KC_2, KC_3 }, {XXXXXXX, XXXXXXX, FN_ZERO}}, + [_L0] = {{KC_KP_7, KC_KP_8, KC_KP_9}, {KC_KP_4, KC_KP_5, KC_KP_6}, {KC_KP_1, KC_KP_2, KC_KP_3}, {XXXXXXX, XXXXXXX, FN_ZERO}}, [_L1] = {{KC_PPLS, KC_PMNS, KC_PAST}, {KC_PSLS, KC_PERC, KC_COMM}, {KC_PDOT, KC_EQL, KC_PENT}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L2] = {{KC_CIRC, KC_AMPR, KC_EXLM}, {S(KC_D), S(KC_E), S(KC_F)}, {S(KC_A), S(KC_B), S(KC_C)}, {XXXXXXX, XXXXXXX, MO(_L9)}}, - [_L3] = {{KC_VOLU, F(0), KC_WFWD}, {KC_MUTE, M(1), M(0) }, {KC_VOLD, KC_MYCM, KC_WBAK}, {XXXXXXX, XXXXXXX, MO(_L9)}}, + [_L3] = {{KC_VOLU, QMK_REV, KC_WFWD}, {KC_MUTE, KC_WCLS, KC_WEB }, {KC_VOLD, KC_MYCM, KC_WBAK}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L4] = {{KC_VOLU, KC_MNXT, KC_MFFD}, {KC_MUTE, KC_MSTP, KC_MPLY}, {KC_VOLD, KC_MPRV, KC_MRWD}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L5] = {{_______, _______, _______}, {_______, _______, _______}, {_______, _______, _______}, {XXXXXXX, XXXXXXX, MO(_L9)}}, [_L6] = {{_______, _______, _______}, {_______, _______, _______}, {_______, _______, _______}, {XXXXXXX, XXXXXXX, MO(_L9)}}, @@ -66,96 +66,93 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_L9] = {{DF(_L6), DF(_L7), DF(_L8)}, {DF(_L3), DF(_L4), DF(_L5)}, {DF(_L0), DF(_L1), DF(_L2)}, {XXXXXXX, XXXXXXX, _______}}, }; -const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch(id) { - case 0: +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case QMK_REV: if (record->event.pressed) { - return MACRO(I(10), D(LGUI), T(R), U(LGUI), END); + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP "@" QMK_VERSION ":" QMK_BUILDDATE); } - else { + return false; + break; + case KC_WEB: + if (record->event.pressed) { + SEND_STRING(SS_LGUI("r")); + wait_ms(100); SEND_STRING("chrome.exe\n"); - return false; } - break; - case 1: + return false; + break; + case KC_WCLS: if (record->event.pressed) { - return MACRO(I(10), D(LCTL), T(W), U(LCTL), END); + SEND_STRING (SS_LCTRL("w")); } - break; + return false; + break; } - return MACRO_NONE; -}; - -const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_FUNCTION(0), -}; - -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case 0: - if (record->event.pressed) { - SEND_STRING ("[Keyboard: " QMK_KEYBOARD "] -- [QMK Version: " QMK_VERSION "] -- [Keymap: " QMK_KEYMAP "]"); - } - break; + // Dynamic Macros. + if (!process_record_dynamic_macro(keycode, record)) { + return false; } + return true; +} + +void custom_backlight_level(uint8_t level) { + if (level > BACKLIGHT_LEVELS) + level = BACKLIGHT_LEVELS; + backlight_config.level = level; + backlight_config.enable = !!backlight_config.level; + backlight_set(backlight_config.level); } void matrix_init_user(void) { #ifdef BACKLIGHT_ENABLE - backlight_level(0); + custom_backlight_level(0); #endif } -// Runs constantly in the background, in a loop. void matrix_scan_user(void) { - uint8_t layer = biton32(layer_state); - if (current_layer == layer) { - } - else { - current_layer = layer; - switch (layer) { - case 0: - backlight_level(0); - break; - case 1: - backlight_level(1); - break; - case 2: - backlight_level(2); - break; - case 3: - backlight_level(3); - break; - case 4: - backlight_level(4); - break; - case 5: - backlight_level(5); - break; - case 6: - backlight_level(6); - break; - case 7: - backlight_level(6); - break; - case 8: - backlight_level(6); - break; - case 9: - backlight_level(0); - break; - default: - backlight_level(0); - break; - } - } } -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - // Enable Dynamic Macros. - if (!process_record_dynamic_macro(keycode, record)) { - return false; +uint32_t layer_state_set_user(uint32_t state) { + switch (biton32(state)) { + case _L0: + custom_backlight_level(0); + break; + case _L1: + custom_backlight_level(1); + break; + case _L2: + custom_backlight_level(2); + break; + case _L3: + custom_backlight_level(3); + break; + case _L4: + custom_backlight_level(4); + break; + case _L5: + custom_backlight_level(5); + break; + case _L6: + custom_backlight_level(6); + break; + case _L7: + custom_backlight_level(6); + break; + case _L8: + custom_backlight_level(6); + break; + case _L9: + custom_backlight_level(0); + break; + default: + custom_backlight_level(0); + break; } - return true; + return state; +} + +void led_set_user(uint8_t usb_led) { + } diff --git a/keyboards/m10a/keymaps/gam3cat/readme.md b/keyboards/m10a/keymaps/gam3cat/readme.md index 879a6c5a37..5c68e8c893 100644 --- a/keyboards/m10a/keymaps/gam3cat/readme.md +++ b/keyboards/m10a/keymaps/gam3cat/readme.md @@ -2,13 +2,13 @@ make m10a:gam3cat ## Layout Config: .-----------. .-----------. .-----------. .-----------. .-----------. - | 7| 8| 9| | +| -| *| | ^| &| !| |VLU|Ver|WFD| |VLU|NXT|FFD| + |7 |8 |9 | |+ |- |* | |^ |& |! | |VLU|Ver|WFD| |VLU|NXT|FFD| |-----------| |-----------| |-----------| |-----------| |-----------| - | 4| 5| 6| | /| %| ,| | D| E| F| |MUT|C-W|CHR| |MUT|STP|PLY| + |4 |5 |6 | |/ |% |, | |D |E |F | |MUT|C-W|CHR| |MUT|STP|PLY| |-----------| |-----------| |-----------| |-----------| |-----------| - | 1| 2| 3| | .| =|Ent| | A| B| C| |VLD|CMP|WBK| |VLD|PRV|RWD| + |1 |2 |3 | |. |= |Ent| |A |B |C | |VLD|CMP|WBK| |VLD|PRV|RWD| |-----------| |-----------| |-----------| |-----------| |-----------| - |L0 | _L9/0| |L1 | _L9 | |L2 | _L9 | |L3 | _L9 | |L4 | _L9 | + |#L0|_L9/0 | |#L1|_L9 | |#L2|_L9 | |#L3|_L9 | |#L4|_L9 | *-----------* *-----------* *-----------* *-----------* *-----------* .-----------. .-----------. .-----------. .-----------. .-----------. | | | | | | | | |MP1| |MP2| | | |RST| |_L6|_L7|_L8| @@ -17,5 +17,5 @@ make m10a:gam3cat |-----------| |-----------| |-----------| |-----------| |-----------| | | | | | | | | |MR1| |MR2| | | | | |_L0|_L1|_L2| |-----------| |-----------| |-----------| |-----------| |-----------| - |L5 | _L9 | |L6 | _L9 | |L7 | _L9 | |L8 | _L9 | |L9 | | + |#L5|_L9 | |#L6|_L9 | |#L7|_L9 | |#L8|_L9 | |#L9| | *-----------* *-----------* *-----------* *-----------* *-----------* diff --git a/keyboards/m10a/keymaps/gam3cat/rules.mk b/keyboards/m10a/keymaps/gam3cat/rules.mk index 457a3d01d4..00515a31e9 100644 --- a/keyboards/m10a/keymaps/gam3cat/rules.mk +++ b/keyboards/m10a/keymaps/gam3cat/rules.mk @@ -1,3 +1,24 @@ -ifndef QUANTUM_DIR - include ../../../../Makefile -endif +# 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 +# +TAP_DANCE_ENABLE = no # Enable TapDance functionality +RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. +BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000) +MOUSEKEY_ENABLE = yes # Mouse keys(+1500) +EXTRAKEY_ENABLE = yes # Audio control and System control(+450) +CONSOLE_ENABLE = no # Console for debug(+400) +COMMAND_ENABLE = no # Commands for debug and configuration +SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend +NKRO_ENABLE = yes # Nkey Rollover - If this doesn't work, add this to config.h: #define FORCE_NKRO +BACKLIGHT_ENABLE = yes # Enable keyboard backlight functionality +MIDI_ENABLE = no # MIDI controls +UNICODE_ENABLE = no # Unicode +UNICODEMAP_ENABLE = no # Enable extended unicode +BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID +AUDIO_ENABLE = no # Audio output on port C6 +FAUXCLICKY_ENABLE = no # Uses buzzer to emulate clicky switches. By default, uses the C6 pin, same as AUDIO_ENABLE. +#VARIABLE_TRACE = no # Use this to debug changes to variable values +API_SYSEX_ENABLE = no # This enables using the Quantum SYSEX API to send strings(+5390) +KEY_LOCK_ENABLE = no # This enables key lock(+260) +SPLIT_KEYBOARD = no # This enables split keyboard support and includes all necessary files located at quantum/split_common -- cgit v1.2.3 From e76bf17d36c3e23d4c780ab7dd0a10b5883889a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20=C4=90or=C4=91evi=C4=87?= Date: Thu, 3 Jan 2019 17:13:55 +0100 Subject: Remove redundant, language-specific aliases for KC_ALGR (#4720) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Use standard KC_ALGR, remove language-specific redefinitions * Use ALGR instead of ALTGR in BÉPO and Canadian multilingual keymaps * Remove BE_LALT, BE_LGUI aliases --- keyboards/contra/keymaps/maxr1998/keymap.c | 4 +- keyboards/ergodox_ez/keymaps/skug/keymap.c | 2 +- .../handwired/reddot/keymaps/default/keymap.c | 4 +- keyboards/lets_split/keymaps/DE_simple/keymap.c | 2 +- keyboards/planck/keymaps/skug/keymap.c | 2 +- keyboards/preonic/keymaps/jacwib/keymap.c | 4 +- keyboards/satan/keymaps/dende_iso/keymap.c | 2 +- keyboards/xd75/keymaps/germanized/config.h | 3 - layouts/community/ergodox/bepo/keymap.c | 2 +- layouts/community/ergodox/bepo_csa/keymap.c | 12 +- .../community/ergodox/dvorak_svorak_a5/keymap.c | 2 +- layouts/community/ergodox/swedish-lindhe/keymap.c | 2 +- layouts/community/ergodox/swedish/keymap.c | 2 +- quantum/keymap_extras/keymap_belgian.h | 6 - quantum/keymap_extras/keymap_bepo.h | 150 ++++++++++----------- .../keymap_extras/keymap_canadian_multilingual.h | 46 +++---- quantum/keymap_extras/keymap_fr_ch.h | 3 - quantum/keymap_extras/keymap_french.h | 3 - quantum/keymap_extras/keymap_german.h | 3 - quantum/keymap_extras/keymap_german_ch.h | 3 - quantum/keymap_extras/keymap_hungarian.h | 3 - quantum/keymap_extras/keymap_italian.h | 6 - quantum/keymap_extras/keymap_neo2.h | 2 +- quantum/keymap_extras/keymap_nordic.h | 3 - quantum/keymap_extras/keymap_slovenian.h | 3 - quantum/keymap_extras/keymap_spanish.h | 3 - quantum/keymap_extras/keymap_uk.h | 3 - users/spacebarracecar/spacebarracecar.c | 4 +- users/spacebarracecar/spacebarracecar.h | 4 +- 29 files changed, 116 insertions(+), 172 deletions(-) diff --git a/keyboards/contra/keymaps/maxr1998/keymap.c b/keyboards/contra/keymaps/maxr1998/keymap.c index 87bf338948..4d731c08b4 100644 --- a/keyboards/contra/keymaps/maxr1998/keymap.c +++ b/keyboards/contra/keymaps/maxr1998/keymap.c @@ -127,11 +127,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { return true; case NR_L3: if (record->event.pressed) { - register_code(DE_ALGR); + register_code(KC_ALGR); layer_on(_NUMROW_L3); } else { layer_off(_NUMROW_L3); - unregister_code(DE_ALGR); + unregister_code(KC_ALGR); } return false; default: diff --git a/keyboards/ergodox_ez/keymaps/skug/keymap.c b/keyboards/ergodox_ez/keymaps/skug/keymap.c index d17990481e..b3696f3a98 100644 --- a/keyboards/ergodox_ez/keymaps/skug/keymap.c +++ b/keyboards/ergodox_ez/keymaps/skug/keymap.c @@ -80,7 +80,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE), KC_WFWD, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC, - KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD), + KC_SPC, KC_BSPC, KC_ALGR, NO_ASTR, CTL_T(NO_TILD), KC_HOME, NO_CIRC, KC_PGUP, KC_UP, KC_DOWN, KC_LGUI, ALT_T(KC_ESC), CTL_T(KC_ENT) diff --git a/keyboards/handwired/reddot/keymaps/default/keymap.c b/keyboards/handwired/reddot/keymaps/default/keymap.c index c67cc0e4c5..73aeff2252 100755 --- a/keyboards/handwired/reddot/keymaps/default/keymap.c +++ b/keyboards/handwired/reddot/keymaps/default/keymap.c @@ -8,14 +8,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_INSERT, KC_HOME, KC_PGUP,\ KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_DELETE, KC_END, KC_PGDOWN, KC_KP_PLUS,\ KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_KP_1, KC_UP, KC_KP_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, FR_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, KC_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), [1] = KEYMAP( KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_TAB, KC_CAPS, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_FN0, KC_KP_SLASH, KC_KP_ASTERISK, KC_KP_MINUS,\ KC_LALT, FR_AMP, FR_EACU, FR_QUOT, FR_APOS, FR_LPRN, KC_BSPACE, KC_DELETE, FR_MINS, FR_EGRV, FR_UNDS, FR_CCED, FR_AGRV, FR_RPRN, FR_EQL, KC_7, KC_8, KC_9,\ KC_LGUI, FR_A, FR_Z, KC_E, KC_R, KC_T, KC_LSFT, KC_ENT, KC_Y, KC_U, KC_I, KC_O, KC_P, FR_CIRC, FR_DLR, KC_4, KC_5, KC_6, KC_KP_PLUS,\ KC_LCTL, FR_Q, KC_S, KC_D, KC_F, KC_G, KC_ENT, KC_H, KC_J, KC_K, KC_L, FR_M, FR_UGRV, FR_ASTR, KC_1, KC_2, KC_3,\ - FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, FR_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), + FR_LESS, FR_W, KC_X, KC_C, KC_V, KC_B, KC_SPACE, KC_SPACE, KC_N, FR_COMM, FR_SCLN, FR_COLN, FR_EXLM, KC_ALGR, KC_LEFT, KC_DOWN, KC_RIGHT, KC_KP_ENTER), }; diff --git a/keyboards/lets_split/keymaps/DE_simple/keymap.c b/keyboards/lets_split/keymaps/DE_simple/keymap.c index d329bea4c0..e801c241e1 100644 --- a/keyboards/lets_split/keymaps/DE_simple/keymap.c +++ b/keyboards/lets_split/keymaps/DE_simple/keymap.c @@ -40,7 +40,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, DE_Q, DE_W, DE_E, DE_R, DE_T, DE_Z, DE_U, DE_I, DE_O, DE_P, KC_BSPC, \ KC_TAB, DE_A, DE_S, DE_D, DE_F, DE_G, DE_H, DE_J, DE_K, DE_L, DE_PLUS, DE_HASH, \ KC_LSFT, DE_Y, DE_X, DE_C, DE_V, DE_B, DE_N, DE_M, DE_COMM, DE_DOT, DE_MINS, KC_ENT , \ - KC_LCTL, KC_LALT, DE_ALGR, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_ALGR, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c index 29324a09e4..86a1de767b 100644 --- a/keyboards/planck/keymaps/skug/keymap.c +++ b/keyboards/planck/keymaps/skug/keymap.c @@ -60,7 +60,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , NO_AA , UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , NO_OSLH, NO_AE , KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , NO_MINS, KC_RSPC, - LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, NO_ALGR, NO_ASTR, RGT_CTR + LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, KC_ALGR, NO_ASTR, RGT_CTR ), /* Raise diff --git a/keyboards/preonic/keymaps/jacwib/keymap.c b/keyboards/preonic/keymaps/jacwib/keymap.c index 0b63abce17..ffd5889455 100644 --- a/keyboards/preonic/keymaps/jacwib/keymap.c +++ b/keyboards/preonic/keymaps/jacwib/keymap.c @@ -46,7 +46,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH, \ KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS, \ - KC_LCTL, KC_LALT, KC_LGUI, NO_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, KC_ALGR, LOWER, KC_SPC, KC_ENT, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Lower @@ -109,7 +109,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AM, \ KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_AE, NO_OSLH, \ KC_LSFT, NO_LESS, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_DOT, KC_COMM, NO_MINS, \ - KC_LCTL, KC_LALT, KC_LGUI, NO_ALGR, MLOWER, KC_SPC, KC_ENT, MRAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ + KC_LCTL, KC_LALT, KC_LGUI, KC_ALGR, MLOWER, KC_SPC, KC_ENT, MRAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \ ), /* Mac Lower diff --git a/keyboards/satan/keymaps/dende_iso/keymap.c b/keyboards/satan/keymaps/dende_iso/keymap.c index 205e9cb77d..be1bfd23aa 100644 --- a/keyboards/satan/keymaps/dende_iso/keymap.c +++ b/keyboards/satan/keymaps/dende_iso/keymap.c @@ -35,7 +35,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, DE_Z, KC_U, KC_I, KC_O, KC_P, DE_UE, DE_PLUS, \ FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, DE_OE, DE_AE, DE_HASH, KC_ENT, \ KC_LSFT, DE_LESS, DE_Y, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, DE_MINS, KC_RSFT, KC_DELETE, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, DE_ALGR, KC_RGUI, KC_APP, KC_RCTL), + KC_LCTL, KC_LGUI, KC_LALT, KC_SPACE, KC_ALGR, KC_RGUI, KC_APP, KC_RCTL), /* Keymap _FNK: Function Keys diff --git a/keyboards/xd75/keymaps/germanized/config.h b/keyboards/xd75/keymaps/germanized/config.h index 379b954714..dd3f32275b 100644 --- a/keyboards/xd75/keymaps/germanized/config.h +++ b/keyboards/xd75/keymaps/germanized/config.h @@ -27,9 +27,6 @@ //Tap Dancing #define TAPPING_TERM 200 -// Alt gr -#define DE_ALGR KC_RALT - // normal characters #define DE_Z KC_Y #define DE_Y KC_Z diff --git a/layouts/community/ergodox/bepo/keymap.c b/layouts/community/ergodox/bepo/keymap.c index c33c3c2550..6ea8cba681 100644 --- a/layouts/community/ergodox/bepo/keymap.c +++ b/layouts/community/ergodox/bepo/keymap.c @@ -50,7 +50,7 @@ KC_ESC, KC_INS, KC_LGUI, KC_LCTL, KC_LALT, KC_CAPSLOCK, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_NUMLOCK, BP_APOS, BP_Q, BP_G, BP_H, BP_F, BP_CCED, - BP_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, + KC_ALGR, KC_RCTL, KC_RGUI, KC_PSCREEN, KC_PAUSE, DF(AZ_B), DF(BEPO), MO(NUMK), MO(FNAV), KC_RSHIFT, KC_ENTER), diff --git a/layouts/community/ergodox/bepo_csa/keymap.c b/layouts/community/ergodox/bepo_csa/keymap.c index 9526ea3f77..125301d443 100644 --- a/layouts/community/ergodox/bepo_csa/keymap.c +++ b/layouts/community/ergodox/bepo_csa/keymap.c @@ -105,7 +105,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_BSPC, BP_DCRC, BP_V, BP_D, BP_L, BP_J, BP_Z, BP_C, BP_T, BP_S, BP_R, BP_N, BP_M, KC_ENT, BP_APOS, BP_Q, BP_G, BP_H, BP_F, KC_RSFT, - BP_ALGR, BP_PERC, KC_APP, BP_CCED, KC_RCTL, + KC_ALGR, BP_PERC, KC_APP, BP_CCED, KC_RCTL, KC_LEFT, KC_RGHT, KC_UP, @@ -449,14 +449,14 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) register_code(KC_1 + (id - M_1)); break; case M_DEGR: - return MACRO(DOWN(CSA_ALTGR), D(SCLN), END); + return MACRO(DOWN(KC_ALGR), D(SCLN), END); case M_SCLN: return MACRO(D(SCLN), END); case M_GRV: - return MACRO(I(75), DOWN(CSA_ALTGR), TYPE(CSA_DCRC), UP(CSA_ALTGR), T(SPACE), END); + return MACRO(I(75), DOWN(KC_ALGR), TYPE(CSA_DCRC), UP(KC_ALGR), T(SPACE), END); case M_NBSP: // use weak mod such that pressing another key will not be affected - add_weak_mods(MOD_BIT(CSA_ALTGR)); + add_weak_mods(MOD_BIT(KC_ALGR)); return MACRO(D(SPACE), END); } } else { @@ -466,11 +466,11 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) unregister_code(KC_1 + (id - M_1)); break; case M_DEGR: - return MACRO(UP(CSA_ALTGR), U(SCLN), END); + return MACRO(UP(KC_ALGR), U(SCLN), END); case M_SCLN: return MACRO(U(SCLN), END); case M_NBSP: - del_weak_mods(MOD_BIT(CSA_ALTGR)); + del_weak_mods(MOD_BIT(KC_ALGR)); return MACRO(U(SPACE), END); } } diff --git a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c index 2668fce866..98df732893 100644 --- a/layouts/community/ergodox/dvorak_svorak_a5/keymap.c +++ b/layouts/community/ergodox/dvorak_svorak_a5/keymap.c @@ -171,7 +171,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_TRNS, KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, NO_OSLH, NO_AE, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSFT, - NO_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, + KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_ENT, KC_SPACE diff --git a/layouts/community/ergodox/swedish-lindhe/keymap.c b/layouts/community/ergodox/swedish-lindhe/keymap.c index e977ab9948..a46408793a 100644 --- a/layouts/community/ergodox/swedish-lindhe/keymap.c +++ b/layouts/community/ergodox/swedish-lindhe/keymap.c @@ -63,7 +63,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA, KC_H, KC_J, KC_K, KC_L, NO_OSLH, NO_AE, KC_DELT, KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSFT, - NO_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, + KC_ALGR, KC_DOWN, KC_UP, KC_LEFT, KC_RGHT, KC_HOME, KC_END, KC_PGUP, KC_PGDN, KC_TAB, LT(MDIA, KC_ENT) diff --git a/layouts/community/ergodox/swedish/keymap.c b/layouts/community/ergodox/swedish/keymap.c index d2b9b40d1f..0cda8511f7 100644 --- a/layouts/community/ergodox/swedish/keymap.c +++ b/layouts/community/ergodox/swedish/keymap.c @@ -76,7 +76,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), GUI_T(NO_AE), MEH_T(KC_NO), KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(NO_MINS), KC_RSFT, KC_UP, KC_DOWN, NO_CIRC, NO_ASTR, KC_FN1, - NO_ALGR, CTL_T(KC_ESC), + KC_ALGR, CTL_T(KC_ESC), KC_PGUP, KC_PGDN,KC_TAB, KC_ENT ), diff --git a/quantum/keymap_extras/keymap_belgian.h b/quantum/keymap_extras/keymap_belgian.h index 573fa2e8a4..ab89fbabfe 100644 --- a/quantum/keymap_extras/keymap_belgian.h +++ b/quantum/keymap_extras/keymap_belgian.h @@ -18,12 +18,6 @@ #include "keymap.h" -#define BE_LGUI KC_LALT -#define BE_LALT KC_LGUI - -// Alt gr -#define BE_ALGR KC_RALT - // Normal characters // Line 1 #define BE_SUP2 KC_GRV diff --git a/quantum/keymap_extras/keymap_bepo.h b/quantum/keymap_extras/keymap_bepo.h index e6545a7a83..8d7b36ca3d 100644 --- a/quantum/keymap_extras/keymap_bepo.h +++ b/quantum/keymap_extras/keymap_bepo.h @@ -19,12 +19,6 @@ #include "keymap.h" -// Alt gr -#ifndef ALTGR -#define ALTGR(kc) ALGR(kc) -#endif -#define BP_ALGR KC_RALT - // Normal characters // First row (on usual keyboards) #define BP_DOLLAR KC_GRAVE // $ @@ -139,138 +133,138 @@ // AltGr-ed characters // First row -#define BP_EN_DASH ALTGR(BP_DOLLAR) // – +#define BP_EN_DASH ALGR(BP_DOLLAR) // – #define BP_NDSH BP_EN_DASH -#define BP_EM_DASH ALTGR(KC_1) // — +#define BP_EM_DASH ALGR(KC_1) // — #define BP_MDSH BP_EM_DASH -#define BP_LESS ALTGR(KC_2) // < -#define BP_GREATER ALTGR(KC_3) // > +#define BP_LESS ALGR(KC_2) // < +#define BP_GREATER ALGR(KC_3) // > #define BP_GRTR BP_GREATER -#define BP_LBRACKET ALTGR(KC_4) // [ +#define BP_LBRACKET ALGR(KC_4) // [ #define BP_LBRC BP_LBRACKET -#define BP_RBRACKET ALTGR(KC_5) // ] +#define BP_RBRACKET ALGR(KC_5) // ] #define BP_RBRC BP_RBRACKET -#define BP_CIRCUMFLEX ALTGR(KC_6) // ^ +#define BP_CIRCUMFLEX ALGR(KC_6) // ^ #define BP_CIRC BP_CIRCUMFLEX -#define BP_PLUS_MINUS ALTGR(KC_7) // ± +#define BP_PLUS_MINUS ALGR(KC_7) // ± #define BP_PSMS BP_PLUS_MINUS -#define BP_MATH_MINUS ALTGR(KC_8) // − +#define BP_MATH_MINUS ALGR(KC_8) // − #define BP_MMNS BP_MATH_MINUS -#define BP_OBELUS ALTGR(KC_9) // ÷ +#define BP_OBELUS ALGR(KC_9) // ÷ #define BP_OBEL BP_OBELUS // more conventional name of the symbol #define BP_DIVISION_SIGN BP_OBELUS #define BP_DVSN BP_DIVISION_SIGN -#define BP_TIMES ALTGR(KC_0) // × +#define BP_TIMES ALGR(KC_0) // × #define BP_TIMS BP_TIMES -#define BP_DIFFERENT ALTGR(BP_EQUAL) // ≠ +#define BP_DIFFERENT ALGR(BP_EQUAL) // ≠ #define BP_DIFF BP_DIFFERENT -#define BP_PERMILLE ALTGR(BP_PERCENT) // ‰ +#define BP_PERMILLE ALGR(BP_PERCENT) // ‰ #define BP_PMIL BP_PERMILLE // Second row -#define BP_PIPE ALTGR(BP_B) // | -#define BP_DEAD_ACUTE ALTGR(BP_E_ACUTE) // dead ´ +#define BP_PIPE ALGR(BP_B) // | +#define BP_DEAD_ACUTE ALGR(BP_E_ACUTE) // dead ´ #define BP_DACT BP_DEAD_ACUTE -#define BP_AMPERSAND ALTGR(BP_P) // & +#define BP_AMPERSAND ALGR(BP_P) // & #define BP_AMPR BP_AMPERSAND -#define BP_OE_LIGATURE ALTGR(BP_O) // œ +#define BP_OE_LIGATURE ALGR(BP_O) // œ #define BP_OE BP_OE_LIGATURE -#define BP_DEAD_GRAVE ALTGR(BP_E_GRAVE) // ` +#define BP_DEAD_GRAVE ALGR(BP_E_GRAVE) // ` #define BP_DGRV BP_DEAD_GRAVE -#define BP_INVERTED_EXCLAIM ALTGR(BP_DEAD_CIRCUMFLEX) // ¡ +#define BP_INVERTED_EXCLAIM ALGR(BP_DEAD_CIRCUMFLEX) // ¡ #define BP_IXLM BP_INVERTED_EXCLAIM -#define BP_DEAD_CARON ALTGR(BP_V) // dead ˇ +#define BP_DEAD_CARON ALGR(BP_V) // dead ˇ #define BP_DCAR BP_DEAD_CARON -#define BP_ETH ALTGR(BP_D) // ð -#define BP_DEAD_SLASH ALTGR(BP_L) // dead / +#define BP_ETH ALGR(BP_D) // ð +#define BP_DEAD_SLASH ALGR(BP_L) // dead / #define BP_DSLH BP_DEAD_SLASH -#define BP_IJ_LIGATURE ALTGR(BP_J) // ij +#define BP_IJ_LIGATURE ALGR(BP_J) // ij #define BP_IJ BP_IJ_LIGATURE -#define BP_SCHWA ALTGR(BP_Z) // ə +#define BP_SCHWA ALGR(BP_Z) // ə #define BP_SCWA BP_SCHWA -#define BP_DEAD_BREVE ALTGR(BP_W) // dead ˘ +#define BP_DEAD_BREVE ALGR(BP_W) // dead ˘ #define BP_DBRV BP_DEAD_BREVE // Third row -#define BP_AE_LIGATURE ALTGR(BP_A) // æ +#define BP_AE_LIGATURE ALGR(BP_A) // æ #define BP_AE BP_AE_LIGATURE -#define BP_U_GRAVE ALTGR(BP_U) // ù +#define BP_U_GRAVE ALGR(BP_U) // ù #define BP_UGRV BP_U_GRAVE -#define BP_DEAD_TREMA ALTGR(BP_I) // dead ¨ (trema/umlaut/diaresis) +#define BP_DEAD_TREMA ALGR(BP_I) // dead ¨ (trema/umlaut/diaresis) #define BP_DTRM BP_DEAD_TREMA -#define BP_EURO ALTGR(BP_E) // € -#define BP_TYPOGRAPHICAL_APOSTROPHE ALTGR(BP_COMMA) // ’ +#define BP_EURO ALGR(BP_E) // € +#define BP_TYPOGRAPHICAL_APOSTROPHE ALGR(BP_COMMA) // ’ #define BP_TAPO BP_TYPOGRAPHICAL_APOSTROPHE -#define BP_COPYRIGHT ALTGR(BP_C) // © +#define BP_COPYRIGHT ALGR(BP_C) // © #define BP_CPRT BP_COPYRIGHT -#define BP_THORN ALTGR(BP_T) // þ +#define BP_THORN ALGR(BP_T) // þ #define BP_THRN BP_THORN -#define BP_SHARP_S ALTGR(BP_S) // ß +#define BP_SHARP_S ALGR(BP_S) // ß #define BP_SRPS BP_SHARP_S -#define BP_REGISTERED_TRADEMARK ALTGR(BP_R) // ® +#define BP_REGISTERED_TRADEMARK ALGR(BP_R) // ® #define BP_RTM BP_REGISTERED_TRADEMARK -#define BP_DEAD_TILDE ALTGR(BP_N) // dead ~ +#define BP_DEAD_TILDE ALGR(BP_N) // dead ~ #define BP_DTLD BP_DEAD_TILDE -#define BP_DEAD_MACRON ALTGR(BP_M) // dead ¯ +#define BP_DEAD_MACRON ALGR(BP_M) // dead ¯ #define BP_DMCR BP_DEAD_MACRON -#define BP_DEAD_CEDILLA ALTGR(BP_C_CEDILLA) // dead ¸ +#define BP_DEAD_CEDILLA ALGR(BP_C_CEDILLA) // dead ¸ #define BP_DCED BP_DEAD_CEDILLA // Fourth row -#define BP_NONUS_SLASH ALTGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo) +#define BP_NONUS_SLASH ALGR(BP_E_CIRCUMFLEX) // / on non-us backslash key (102nd key, ê in bépo) #define BP_NUSL BP_NONUS_SLASH -#define BP_BACKSLASH ALTGR(BP_A_GRAVE) /* \ */ +#define BP_BACKSLASH ALGR(BP_A_GRAVE) /* \ */ #define BP_BSLS BP_BACKSLASH -#define BP_LEFT_CURLY_BRACE ALTGR(BP_Y) // { +#define BP_LEFT_CURLY_BRACE ALGR(BP_Y) // { #define BP_LCBR BP_LEFT_CURLY_BRACE -#define BP_RIGHT_CURLY_BRACE ALTGR(BP_X) // } +#define BP_RIGHT_CURLY_BRACE ALGR(BP_X) // } #define BP_RCBR BP_RIGHT_CURLY_BRACE -#define BP_ELLIPSIS ALTGR(BP_DOT) // … +#define BP_ELLIPSIS ALGR(BP_DOT) // … #define BP_ELPS BP_ELLIPSIS -#define BP_TILDE ALTGR(BP_K) // ~ +#define BP_TILDE ALGR(BP_K) // ~ #define BP_TILD BP_TILDE -#define BP_INVERTED_QUESTION ALTGR(BP_QUESTION) // ¿ +#define BP_INVERTED_QUESTION ALGR(BP_QUESTION) // ¿ #define BP_IQST BP_INVERTED_QUESTION -#define BP_DEAD_RING ALTGR(BP_Q) // dead ° +#define BP_DEAD_RING ALGR(BP_Q) // dead ° #define BP_DRNG BP_DEAD_RING -#define BP_DEAD_GREEK ALTGR(BP_G) // dead Greek key (following key will make a Greek letter) +#define BP_DEAD_GREEK ALGR(BP_G) // dead Greek key (following key will make a Greek letter) #define BP_DGRK BP_DEAD_GREEK -#define BP_DAGGER ALTGR(BP_H) // † +#define BP_DAGGER ALGR(BP_H) // † #define BP_DAGR BP_DAGGER -#define BP_DEAD_OGONEK ALTGR(BP_F) // dead ˛ +#define BP_DEAD_OGONEK ALGR(BP_F) // dead ˛ #define BP_DOGO BP_DEAD_OGONEK // Space bar -#define BP_UNDERSCORE ALTGR(KC_SPACE) // _ +#define BP_UNDERSCORE ALGR(KC_SPACE) // _ #define BP_UNDS BP_UNDERSCORE // AltGr-Shifted characters (different from capitalised AltGr-ed characters) // First row -#define BP_PARAGRAPH ALTGR(BP_HASH) // ¶ +#define BP_PARAGRAPH ALGR(BP_HASH) // ¶ #define BP_PARG BP_PARAGRAPH -#define BP_LOW_DOUBLE_QUOTE ALTGR(BP_1) // „ +#define BP_LOW_DOUBLE_QUOTE ALGR(BP_1) // „ #define BP_LWQT BP_LOW_DOUBLE_QUOTE -#define BP_LEFT_DOUBLE_QUOTE ALTGR(BP_2) // “ +#define BP_LEFT_DOUBLE_QUOTE ALGR(BP_2) // “ #define BP_LDQT BP_LEFT_DOUBLE_QUOTE -#define BP_RIGHT_DOUBLE_QUOTE ALTGR(BP_3) // ” +#define BP_RIGHT_DOUBLE_QUOTE ALGR(BP_3) // ” #define BP_RDQT BP_RIGHT_DOUBLE_QUOTE -#define BP_LESS_OR_EQUAL ALTGR(BP_4) // ≤ +#define BP_LESS_OR_EQUAL ALGR(BP_4) // ≤ #define BP_LEQL BP_LESS_OR_EQUAL -#define BP_GREATER_OR_EQUAL ALTGR(BP_5) // ≥ +#define BP_GREATER_OR_EQUAL ALGR(BP_5) // ≥ #define BP_GEQL BP_GREATER_OR_EQUAL -// nothing on ALTGR(BP_6) -#define BP_NEGATION ALTGR(BP_7) // ¬ +// nothing on ALGR(BP_6) +#define BP_NEGATION ALGR(BP_7) // ¬ #define BP_NEGT BP_NEGATION -#define BP_ONE_QUARTER ALTGR(BP_8) // ¼ +#define BP_ONE_QUARTER ALGR(BP_8) // ¼ #define BP_1QRT BP_ONE_QUARTER -#define BP_ONE_HALF ALTGR(BP_9) // ½ +#define BP_ONE_HALF ALGR(BP_9) // ½ #define BP_1HLF BP_ONE_HALF -#define BP_THREE_QUARTERS ALTGR(BP_0) // ¾ +#define BP_THREE_QUARTERS ALGR(BP_0) // ¾ #define BP_3QRT BP_THREE_QUARTERS -#define BP_MINUTES ALTGR(BP_DEGREE) // ′ +#define BP_MINUTES ALGR(BP_DEGREE) // ′ #define BP_MNUT BP_MINUTES -#define BP_SECONDS ALTGR(BP_GRAVE) // ″ +#define BP_SECONDS ALGR(BP_GRAVE) // ″ #define BP_SCND BP_SECONDS // Second row @@ -278,7 +272,7 @@ #define BP_BPIP BP_BROKEN_PIPE #define BP_DEAD_DOUBLE_ACUTE LSFT(BP_DEAD_ACUTE) // ˝ #define BP_DDCT BP_DEAD_DOUBLE_ACUTE -#define BP_SECTION ALTGR(LSFT(BP_P)) // § +#define BP_SECTION ALGR(LSFT(BP_P)) // § #define BP_SECT BP_SECTION // LSFT(BP_DEAD_GRAVE) is actually the same character as LSFT(BP_PERCENT) #define BP_GRAVE_BIS LSFT(BP_DEAD_GRAVE) // ` @@ -289,35 +283,35 @@ #define BP_DDTA BP_DEAD_DOT_ABOVE #define BP_DEAD_CURRENCY LSFT(BP_EURO) // dead ¤ (next key will generate a currency code like ¥ or £) #define BP_DCUR BP_DEAD_CURRENCY -#define BP_DEAD_HORN LSFT(ALTGR(BP_COMMA)) // dead ̛ +#define BP_DEAD_HORN LSFT(ALGR(BP_COMMA)) // dead ̛ #define BP_DHRN BP_DEAD_HORN -#define BP_LONG_S LSFT(ALTGR(BP_C)) // ſ +#define BP_LONG_S LSFT(ALGR(BP_C)) // ſ #define BP_LNGS BP_LONG_S #define BP_TRADEMARK LSFT(BP_REGISTERED_TRADEMARK) // ™ #define BP_TM BP_TRADEMARK -#define BP_ORDINAL_INDICATOR_O LSFT(ALTGR(BP_M)) // º +#define BP_ORDINAL_INDICATOR_O LSFT(ALGR(BP_M)) // º #define BP_ORDO BP_ORDINAL_INDICATOR_O #define BP_DEAD_COMMA LSFT(BP_DEAD_CEDILLA) // dead ˛ #define BP_DCOM BP_DEAD_COMMA // Fourth row -#define BP_LEFT_QUOTE LSFT(ALTGR(BP_Y)) // ‘ +#define BP_LEFT_QUOTE LSFT(ALGR(BP_Y)) // ‘ #define BP_LQOT BP_LEFT_QUOTE -#define BP_RIGHT_QUOTE LSFT(ALTGR(BP_X)) // ’ +#define BP_RIGHT_QUOTE LSFT(ALGR(BP_X)) // ’ #define BP_RQOT BP_RIGHT_QUOTE -#define BP_INTERPUNCT LSFT(ALTGR(BP_DOT)) // · +#define BP_INTERPUNCT LSFT(ALGR(BP_DOT)) // · #define BP_IPCT BP_INTERPUNCT -#define BP_DEAD_HOOK_ABOVE LSFT(ALTGR(BP_QUESTION)) // dead ̉ +#define BP_DEAD_HOOK_ABOVE LSFT(ALGR(BP_QUESTION)) // dead ̉ #define BP_DHKA BP_DEAD_HOOK_ABOVE #define BP_DEAD_UNDERDOT LSFT(BP_DEAD_RING) // dead ̣ #define BP_DUDT BP_DEAD_UNDERDOT #define BP_DOUBLE_DAGGER LSFT(BP_DAGGER) // ‡ #define BP_DDGR BP_DOUBLE_DAGGER -#define BP_ORDINAL_INDICATOR_A LSFT(ALTGR(BP_F)) // ª +#define BP_ORDINAL_INDICATOR_A LSFT(ALGR(BP_F)) // ª #define BP_ORDA BP_ORDINAL_INDICATOR_A // Space bar -#define BP_NARROW_NON_BREAKING_SPACE ALTGR(BP_NON_BREAKING_SPACE) +#define BP_NARROW_NON_BREAKING_SPACE ALGR(BP_NON_BREAKING_SPACE) #define BP_NNBS BP_NARROW_NON_BREAKING_SPACE #endif diff --git a/quantum/keymap_extras/keymap_canadian_multilingual.h b/quantum/keymap_extras/keymap_canadian_multilingual.h index fbeef21874..2b5b95d6fa 100644 --- a/quantum/keymap_extras/keymap_canadian_multilingual.h +++ b/quantum/keymap_extras/keymap_canadian_multilingual.h @@ -13,19 +13,11 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ -#ifndef KEYMAP_CANADIAN_MULTILINGUAG_H -#define KEYMAP_CANADIAN_MULTILINGUAG_H +#ifndef KEYMAP_CANADIAN_MULTILINGUAL_H +#define KEYMAP_CANADIAN_MULTILINGUAL_H #include "keymap.h" -// Alt gr -#ifndef ALTGR -#define ALTGR(kc) ALGR(kc) -#endif - -#define CSA_ALTGR KC_RALT -#define CSA_ALGR CSA_ALTGR - #ifndef GR2A #define GR2A(kc) RCTL(kc) #endif @@ -75,43 +67,43 @@ // Alt Gr-ed characters // First row -#define CSA_PIPE ALTGR(CSA_SLASH) // | -#define CSA_CURRENCY ALTGR(KC_4) // ¤ +#define CSA_PIPE ALGR(CSA_SLASH) // | +#define CSA_CURRENCY ALGR(KC_4) // ¤ #define CSA_CURR CSA_CURRENCY -#define CSA_LEFT_CURLY_BRACE ALTGR(KC_7) // { +#define CSA_LEFT_CURLY_BRACE ALGR(KC_7) // { #define CSA_LCBR CSA_LEFT_CURLY_BRACE -#define CSA_RIGHT_CURLY_BRACE ALTGR(KC_8) // } +#define CSA_RIGHT_CURLY_BRACE ALGR(KC_8) // } #define CSA_RCBR CSA_RIGHT_CURLY_BRACE -#define CSA_LBRACKET ALTGR(KC_9) // [ +#define CSA_LBRACKET ALGR(KC_9) // [ #define CSA_LBRC CSA_LBRACKET -#define CSA_RBRACKET ALTGR(KC_0) // ] +#define CSA_RBRACKET ALGR(KC_0) // ] #define CSA_RBRC CSA_RBRACKET -#define CSA_NEGATION ALTGR(KC_EQUAL) // ¬ +#define CSA_NEGATION ALGR(KC_EQUAL) // ¬ #define CSA_NEGT CSA_NEGATION // Second row // euro symbol not available on Linux? (X.org) -#define CSA_EURO ALTGR(KC_E) // € -#define CSA_DEAD_GRAVE ALTGR(CSA_DEAD_CIRCUMFLEX) +#define CSA_EURO ALGR(KC_E) // € +#define CSA_DEAD_GRAVE ALGR(CSA_DEAD_CIRCUMFLEX) #define CSA_DGRV CSA_DEAD_GRAVE // dead ` -#define CSA_DEAD_TILDE ALTGR(CSA_C_CEDILLA) // ~ +#define CSA_DEAD_TILDE ALGR(CSA_C_CEDILLA) // ~ #define CSA_DTLD CSA_DEAD_TILDE // Third row -#define CSA_DEGREE ALTGR(KC_SCOLON) // ° +#define CSA_DEGREE ALGR(KC_SCOLON) // ° #define CSA_DEGR CSA_DEGREE // Fourth row -#define CSA_LEFT_GUILLEMET ALTGR(KC_Z) // « +#define CSA_LEFT_GUILLEMET ALGR(KC_Z) // « #define CSA_LGIL CSA_LEFT_GUILLEMET -#define CSA_RIGHT_GUILLEMET ALTGR(KC_X) // » +#define CSA_RIGHT_GUILLEMET ALGR(KC_X) // » #define CSA_RGIL CSA_RIGHT_GUILLEMET -#define CSA_LESS ALTGR(KC_COMMA) // < -#define CSA_GREATER ALTGR(KC_DOT) // > +#define CSA_LESS ALGR(KC_COMMA) // < +#define CSA_GREATER ALGR(KC_DOT) // > #define CSA_GRTR CSA_GREATER // Space bar -#define CSA_NON_BREAKING_SPACE ALTGR(KC_SPACE) +#define CSA_NON_BREAKING_SPACE ALGR(KC_SPACE) #define CSA_NBSP CSA_NON_BREAKING_SPACE // GR2A-ed characters @@ -198,7 +190,7 @@ // nothing on 2 #define CSA_POUND GR2A(LSFT(KC_3)) // £ #define CSA_GBP CSA_POUND_SIGN -// already on ALTGR(KC_E) +// already on ALGR(KC_E) #define CSA_EURO_BIS GR2A(LSFT(KC_4)) // € #define CSA_EURB CSA_EURO_BIS #define CSA_THREE_EIGHTHS GR2A(LSFT(KC_5)) // ⅜ diff --git a/quantum/keymap_extras/keymap_fr_ch.h b/quantum/keymap_extras/keymap_fr_ch.h index 4eeca7209f..69f9547bb9 100644 --- a/quantum/keymap_extras/keymap_fr_ch.h +++ b/quantum/keymap_extras/keymap_fr_ch.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define FR_CH_ALGR KC_RALT - // normal characters #define FR_CH_Z KC_Y #define FR_CH_Y KC_Z diff --git a/quantum/keymap_extras/keymap_french.h b/quantum/keymap_extras/keymap_french.h index d2de859ee7..bef7754707 100644 --- a/quantum/keymap_extras/keymap_french.h +++ b/quantum/keymap_extras/keymap_french.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define FR_ALGR KC_RALT - // Normal characters #define FR_SUP2 KC_GRV #define FR_AMP KC_1 diff --git a/quantum/keymap_extras/keymap_german.h b/quantum/keymap_extras/keymap_german.h index a215570fd3..0ba3570df7 100644 --- a/quantum/keymap_extras/keymap_german.h +++ b/quantum/keymap_extras/keymap_german.h @@ -19,9 +19,6 @@ #include "keymap.h" -// Alt gr -#define DE_ALGR KC_RALT - // normal characters #define DE_Z KC_Y #define DE_Y KC_Z diff --git a/quantum/keymap_extras/keymap_german_ch.h b/quantum/keymap_extras/keymap_german_ch.h index f0376a17c0..bd1ef89a19 100644 --- a/quantum/keymap_extras/keymap_german_ch.h +++ b/quantum/keymap_extras/keymap_german_ch.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define CH_ALGR KC_RALT - // normal characters #define CH_Z KC_Y #define CH_Y KC_Z diff --git a/quantum/keymap_extras/keymap_hungarian.h b/quantum/keymap_extras/keymap_hungarian.h index cd2dc94cfe..ff43535f38 100644 --- a/quantum/keymap_extras/keymap_hungarian.h +++ b/quantum/keymap_extras/keymap_hungarian.h @@ -19,9 +19,6 @@ #include "keymap.h" -// Alt gr -#define HU_ALGR KC_RALT - // basic letters #define HU_Z KC_Y #define HU_Y KC_Z diff --git a/quantum/keymap_extras/keymap_italian.h b/quantum/keymap_extras/keymap_italian.h index f629081507..fe0f5eb847 100644 --- a/quantum/keymap_extras/keymap_italian.h +++ b/quantum/keymap_extras/keymap_italian.h @@ -19,13 +19,7 @@ #include "keymap.h" -// Alt gr -#define IT_ALGR KC_RALT - // normal characters - - - #define IT_A KC_A #define IT_B KC_B #define IT_C KC_C diff --git a/quantum/keymap_extras/keymap_neo2.h b/quantum/keymap_extras/keymap_neo2.h index 174f4a6eec..818a739c76 100644 --- a/quantum/keymap_extras/keymap_neo2.h +++ b/quantum/keymap_extras/keymap_neo2.h @@ -73,6 +73,6 @@ #define NEO_L1_R DE_HASH #define NEO_L2_L DE_LESS -#define NEO_L2_R DE_ALGR +#define NEO_L2_R KC_ALGR #endif diff --git a/quantum/keymap_extras/keymap_nordic.h b/quantum/keymap_extras/keymap_nordic.h index 4210d37145..551a4212b2 100644 --- a/quantum/keymap_extras/keymap_nordic.h +++ b/quantum/keymap_extras/keymap_nordic.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define NO_ALGR KC_RALT - // Normal characters #define NO_HALF KC_GRV #define NO_PLUS KC_MINS diff --git a/quantum/keymap_extras/keymap_slovenian.h b/quantum/keymap_extras/keymap_slovenian.h index 47f5bceed2..892283e702 100644 --- a/quantum/keymap_extras/keymap_slovenian.h +++ b/quantum/keymap_extras/keymap_slovenian.h @@ -20,9 +20,6 @@ #include "keymap.h" -// Alt gr -#define SI_ALGR KC_RALT - //Swapped Z and Y #define SI_Z KC_Y #define SI_Y KC_Z diff --git a/quantum/keymap_extras/keymap_spanish.h b/quantum/keymap_extras/keymap_spanish.h index 19d12551a6..1f183327f9 100644 --- a/quantum/keymap_extras/keymap_spanish.h +++ b/quantum/keymap_extras/keymap_spanish.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define ES_ALGR KC_RALT - // Normal characters #define ES_OVRR KC_GRV #define ES_APOS KC_MINS diff --git a/quantum/keymap_extras/keymap_uk.h b/quantum/keymap_extras/keymap_uk.h index a7bcd697e0..cc3d0039e2 100644 --- a/quantum/keymap_extras/keymap_uk.h +++ b/quantum/keymap_extras/keymap_uk.h @@ -18,9 +18,6 @@ #include "keymap.h" -// Alt gr -#define UK_ALGR KC_RALT - // Normal characters #define UK_HASH KC_NUHS #define UK_BSLS KC_NUBS diff --git a/users/spacebarracecar/spacebarracecar.c b/users/spacebarracecar/spacebarracecar.c index f7048869ed..130d7dc2d4 100644 --- a/users/spacebarracecar/spacebarracecar.c +++ b/users/spacebarracecar/spacebarracecar.c @@ -211,11 +211,11 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { timer_timeout(); if (lshift || rshift){ unregister_code(KC_LSFT); - register_code(DE_ALGR); + register_code(KC_ALGR); unregister_code(DE_PLUS); register_code(DE_PLUS); unregister_code(DE_PLUS); - unregister_code(DE_ALGR); + unregister_code(KC_ALGR); register_code(KC_LSFT); } else { register_code(KC_LSFT); diff --git a/users/spacebarracecar/spacebarracecar.h b/users/spacebarracecar/spacebarracecar.h index 035c1ac790..d0259b73cc 100644 --- a/users/spacebarracecar/spacebarracecar.h +++ b/users/spacebarracecar/spacebarracecar.h @@ -192,7 +192,7 @@ return false; if (record->event.pressed) { \ timer_timeout(); \ unregister_code(KC_LSFT); \ - register_code(DE_ALGR); \ + register_code(KC_ALGR); \ if (lshift || rshift) { \ unregister_code(kc2); \ register_code(kc2); \ @@ -203,7 +203,7 @@ if (record->event.pressed) { \ register_code(kc1); \ unregister_code(kc1); \ } \ - unregister_code(DE_ALGR); \ + unregister_code(KC_ALGR); \ } \ return false; -- cgit v1.2.3 From 6f80217958e575aab3c247e286cf919ff75bc72f Mon Sep 17 00:00:00 2001 From: noroadsleft <18669334+noroadsleft@users.noreply.github.com> Date: Thu, 3 Jan 2019 16:33:32 -0800 Subject: Snagpad: fix Configurator mismatch (#4767) Key objects for the LAYOUT_numpad_5x4 macro were out-of-order in info.json. Also white space changes because I'm that guy. --- keyboards/snagpad/info.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/keyboards/snagpad/info.json b/keyboards/snagpad/info.json index 4faa1d2c0f..ffaa5c0a74 100644 --- a/keyboards/snagpad/info.json +++ b/keyboards/snagpad/info.json @@ -6,12 +6,11 @@ "width": 4, "height": 5, "layouts": { - "LAYOUT_ortho_5x4": { + "LAYOUT_ortho_5x4": { "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3}, {"x":0, "y":4}, {"x":1, "y":4}, {"x":2, "y":4}, {"x":3, "y":4}] - }, + }, "LAYOUT_numpad_5x4": { - "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":3, "y":1, "h":2}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":3, "y":3, "h":2}, {"x":0, "y":4, "w":2}, {"x":2, "y":4}] - - } + "layout": [{"x":0, "y":0}, {"x":1, "y":0}, {"x":2, "y":0}, {"x":3, "y":0}, {"x":0, "y":1}, {"x":1, "y":1}, {"x":2, "y":1}, {"x":0, "y":2}, {"x":1, "y":2}, {"x":2, "y":2}, {"x":3, "y":1, "h":2}, {"x":0, "y":3}, {"x":1, "y":3}, {"x":2, "y":3}, {"x":0, "y":4, "w":2}, {"x":2, "y":4}, {"x":3, "y":3, "h":2}] + } } } -- cgit v1.2.3 From 54b572159f62913ead47b0a6ee8d2d09dfb8f19a Mon Sep 17 00:00:00 2001 From: noroadsleft Date: Thu, 3 Jan 2019 18:40:23 -0800 Subject: Preonic rev. 3: fix info.json file File was saved with an invalid JSON structure. --- keyboards/preonic/rev3/info.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/preonic/rev3/info.json b/keyboards/preonic/rev3/info.json index 50ae8e5fb1..b1ad1227e1 100644 --- a/keyboards/preonic/rev3/info.json +++ b/keyboards/preonic/rev3/info.json @@ -262,8 +262,8 @@ ] }, "LAYOUT_ortho_5x12": { - "layout": [ "key_count": 60, + "layout": [ {"label":"k00", "x":0, "y":0}, {"label":"k01", "x":1, "y":0}, {"label":"k02", "x":2, "y":0}, -- cgit v1.2.3 From 38e01a7480f6826b3d220c4c8357788558b2af07 Mon Sep 17 00:00:00 2001 From: James Churchill Date: Sat, 29 Dec 2018 16:53:21 +1100 Subject: Convert split_common to use generic GPIO api --- quantum/split_common/matrix.c | 60 +++++++++++++-------------------------- quantum/split_common/split_util.c | 15 ++-------- 2 files changed, 22 insertions(+), 53 deletions(-) diff --git a/quantum/split_common/matrix.c b/quantum/split_common/matrix.c index 2611376386..2c37053f88 100644 --- a/quantum/split_common/matrix.c +++ b/quantum/split_common/matrix.c @@ -20,17 +20,14 @@ along with this program. If not, see . */ #include #include -#include #include "wait.h" -#include "print.h" -#include "debug.h" #include "util.h" #include "matrix.h" #include "split_util.h" -#include "pro_micro.h" #include "config.h" #include "timer.h" #include "split_flags.h" +#include "quantum.h" #ifdef BACKLIGHT_ENABLE # include "backlight.h" @@ -91,8 +88,8 @@ static matrix_row_t matrix_debouncing[MATRIX_ROWS]; static uint8_t error_count = 0; -static uint8_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; -static uint8_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; +static pin_t row_pins[MATRIX_ROWS] = MATRIX_ROW_PINS; +static pin_t col_pins[MATRIX_COLS] = MATRIX_COL_PINS; /* matrix state(1:on, 0:off) */ static matrix_row_t matrix[MATRIX_ROWS]; @@ -440,9 +437,7 @@ uint8_t matrix_key_count(void) static void init_cols(void) { for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[x]); } } @@ -460,13 +455,8 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) // For each col... for(uint8_t col_index = 0; col_index < MATRIX_COLS; col_index++) { - - // Select the col pin to read (active low) - uint8_t pin = col_pins[col_index]; - uint8_t pin_state = (_SFR_IO8(pin >> 4) & _BV(pin & 0xF)); - // Populate the matrix row with the state of the col pin - current_matrix[current_row] |= pin_state ? 0 : (ROW_SHIFTER << col_index); + current_matrix[current_row] |= readPin(col_pins[col_index]) ? 0 : (ROW_SHIFTER << col_index); } // Unselect row @@ -477,24 +467,19 @@ static bool read_cols_on_row(matrix_row_t current_matrix[], uint8_t current_row) static void select_row(uint8_t row) { - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + writePinLow(row_pins[row]); + setPinOutput(row_pins[row]); } static void unselect_row(uint8_t row) { - uint8_t pin = row_pins[row]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(row_pins[row]); } static void unselect_rows(void) { for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(row_pins[x]); } } @@ -503,9 +488,7 @@ static void unselect_rows(void) static void init_rows(void) { for(uint8_t x = 0; x < ROWS_PER_HAND; x++) { - uint8_t pin = row_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(row_pins[x]); } } @@ -525,15 +508,15 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) matrix_row_t last_row_value = current_matrix[row_index]; // Check row pin state - if ((_SFR_IO8(row_pins[row_index] >> 4) & _BV(row_pins[row_index] & 0xF)) == 0) + if (readPin(row_pins[row_index])) { - // Pin LO, set col bit - current_matrix[row_index] |= (ROW_SHIFTER << current_col); + // Pin HI, clear col bit + current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); } else { - // Pin HI, clear col bit - current_matrix[row_index] &= ~(ROW_SHIFTER << current_col); + // Pin LO, set col bit + current_matrix[row_index] |= (ROW_SHIFTER << current_col); } // Determine if the matrix changed state @@ -551,24 +534,19 @@ static bool read_rows_on_col(matrix_row_t current_matrix[], uint8_t current_col) static void select_col(uint8_t col) { - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) |= _BV(pin & 0xF); // OUT - _SFR_IO8((pin >> 4) + 2) &= ~_BV(pin & 0xF); // LOW + writePinLow(col_pins[col]); + setPinOutput(col_pins[col]); } static void unselect_col(uint8_t col) { - uint8_t pin = col_pins[col]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[col]); } static void unselect_cols(void) { for(uint8_t x = 0; x < MATRIX_COLS; x++) { - uint8_t pin = col_pins[x]; - _SFR_IO8((pin >> 4) + 1) &= ~_BV(pin & 0xF); // IN - _SFR_IO8((pin >> 4) + 2) |= _BV(pin & 0xF); // HI + setPinInputHigh(col_pins[x]); } } diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index c613f265a3..11453c9987 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -1,24 +1,15 @@ -#include -#include -#include -#include -#include -#include #include "split_util.h" #include "matrix.h" #include "keyboard.h" #include "config.h" #include "timer.h" #include "split_flags.h" +#include "quantum.h" #ifdef BACKLIGHT_ENABLE # include "backlight.h" #endif -#ifdef SPLIT_HAND_PIN -# include "pincontrol.h" -#endif - #if defined(USE_I2C) || defined(EH) # include "i2c.h" #endif @@ -30,8 +21,8 @@ volatile uint8_t setTries = 0; static void setup_handedness(void) { #ifdef SPLIT_HAND_PIN // Test pin SPLIT_HAND_PIN for High/Low, if low it's right hand - pinMode(SPLIT_HAND_PIN, PinDirectionInput); - isLeftHand = digitalRead(SPLIT_HAND_PIN); + setPinInput(SPLIT_HAND_PIN); + isLeftHand = readPin(SPLIT_HAND_PIN); #else #ifdef EE_HANDS isLeftHand = eeprom_read_byte(EECONFIG_HANDEDNESS); -- cgit v1.2.3 From 563ce3f225d981ce460c12ca5130dfe47af41df0 Mon Sep 17 00:00:00 2001 From: James Churchill Date: Thu, 3 Jan 2019 14:30:23 +1100 Subject: Add explicit eeprom include in split_common Fixes builds that set EE_HANDS. --- quantum/split_common/split_util.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quantum/split_common/split_util.c b/quantum/split_common/split_util.c index 11453c9987..e41b6f6386 100644 --- a/quantum/split_common/split_util.c +++ b/quantum/split_common/split_util.c @@ -6,6 +6,10 @@ #include "split_flags.h" #include "quantum.h" +#ifdef EE_HANDS +# include "tmk_core/common/eeprom.h" +#endif + #ifdef BACKLIGHT_ENABLE # include "backlight.h" #endif -- cgit v1.2.3